Commit 9ad874d3 authored by multrus's avatar multrus
Browse files

[cleanup] accept NONBE_FIX_ISSUE_2206_SWB_EXPERIMENT

parent be0d5a59
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -1354,12 +1354,8 @@ void stereo_tcx_init_dec_fx(

void stereo_icBWE_enc_fx(
    CPE_ENC_HANDLE hCPE,                                        /* i/o: CPE encoder structure                */
#ifdef NONBE_FIX_ISSUE_2206_SWB_EXPERIMENT
    const Word16 shb_speech_ref_fx16[],                         /* i  : SHB speech ref channel             shb_speech_ref_q*/
    const Word16 shb_speech_ref_q,                              /* i  : SHB speech ref channel Q             */
#else
    const Word16 shb_speech_ref_fx16[],                         /* i  : SHB speech ref channel             Q0*/
#endif
    Word16 shb_speech_nonref_fx_16[],                           /* i/o: SHB speech non-ref channel         shb_speech_nonref_e*/
    Word16 shb_speech_nonref_e,                                 /* i/o: SHB speech non-ref channel           */
    const Word16 *voice_factors_fx                              /* i  : voicing factors                  Q15 */
+0 −1
Original line number Diff line number Diff line
@@ -86,7 +86,6 @@
#define FIX_1990_SANITIZER_IN_REVERB_LOAD               /* Nokia: Fix issue part of issue 1990 by introducing missing free of structure - keep until #2059 is addressed */
#define TMP_1342_WORKAROUND_DEC_FLUSH_BROKEN_IN_SR      /* FhG: Temporary workaround for incorrect implementation of decoder flush with split rendering */
#define NONBE_1122_KEEP_EVS_MODE_UNCHANGED              /* FhG: Disables fix for issue 1122 in EVS mode to keep BE tests green. This switch should be removed once the 1122 fix is added to EVS via a CR.  */
#define NONBE_FIX_ISSUE_2206_SWB_EXPERIMENT             /* FhG: Dynamic scale of shb_speech buffers */
#define NONBE_FIX_ISSUE_2206_TD_CHANNEL_EXTRAPOLATION   /* FhG: Use different scale to avoid saturation of LPC coefficient in TD Stereo signal extrapolation. */
#define NONBE_FIX_ISSUE_2206_AVOID_OVERFLOW_SWB_fenv_fx2 /* FhG: Avoid overflow of SWB_fenv_fx in SWB_BWE_encoding_fx because of very small energies. */
#define NONBE_FIX_ISSUE_2206_AVOID_OVERFLOW_MSVQ_Interpol_Tran_fx /* FhG: Fix saturation crash in MSVQ_Interpol_Tran_fx() */
+0 −4
Original line number Diff line number Diff line
@@ -5281,11 +5281,7 @@ static void Estimate_mix_factors_fx(

    pow3 = Dot_product( shb_res_local, shb_res_local, L_FRAME16k ); /* (2*Q_shb+1) */

#ifdef NONBE_FIX_ISSUE_2206_SWB_EXPERIMENT
    pow3 = L_add_sat( pow3, L_shl( 21475l /*0.00001f in Q31*/, 2 * Q_shb + 1 - 31 ) ); /* (2*Q_shb+1) */
#else
    pow3 = L_add( pow3, L_shl( 21475l /*0.00001f in Q31*/, 2 * Q_shb + 1 - 31 ) ); /* (2*Q_shb+1) */
#endif
    if ( pow3 == 0 )
    {
        pow3 = 1;
+0 −37
Original line number Diff line number Diff line
@@ -27,11 +27,7 @@
 *---------------------------------------------------------------------*/

static void shb_CNG_encod_fx( Encoder_State *st_fx, const Word16 update_fx );
#ifdef NONBE_FIX_ISSUE_2206_SWB_EXPERIMENT
static Word16 shb_DTX_fx( Encoder_State *st_fx, const Word16 *shb_speech_fx, const Word16 shb_speech_q, const Word16 *syn_12k8_16k );
#else
static Word16 shb_DTX_fx( Encoder_State *st_fx, const Word16 *shb_speech_fx, const Word16 *syn_12k8_16k );
#endif

/*---------------------------------------------------------------------*
 * CNG_enc()
@@ -1456,12 +1452,8 @@ void calculate_hangover_attenuation_gain_fx(

void swb_CNG_enc_fx(
    Encoder_State *st, /* i/o: State structure                              */
#ifdef NONBE_FIX_ISSUE_2206_SWB_EXPERIMENT
    const Word16 *shb_speech_fx, /* i  : SHB target signal (6-14kHz) at 16kHz      shb_speech_q */
    const Word16 shb_speech_q,   /* i  : SHB target signal Q (6-14kHz) at 16kHz    Q0 */
#else
    const Word16 *shb_speech_fx, /* i  : SHB target signal (6-14kHz) at 16kHz      Q0 */
#endif
    const Word16 *syn_12k8_16k_fx /* i  : ACELP core synthesis at 12.8kHz or 16kHz  Q0 */
)
{
@@ -1476,11 +1468,7 @@ void swb_CNG_enc_fx(
            IF( GE_32( st->input_Fs, L_FRAME32k * FRAMES_PER_SEC ) )
            {
                /* decide if SHB SID encoding or not */
#ifdef NONBE_FIX_ISSUE_2206_SWB_EXPERIMENT
                shb_SID_updt = shb_DTX_fx( st, shb_speech_fx, shb_speech_q, syn_12k8_16k_fx );
#else
                shb_SID_updt = shb_DTX_fx( st, shb_speech_fx, syn_12k8_16k_fx );
#endif

                /* SHB CNG encoding */
                shb_CNG_encod_fx( st, shb_SID_updt );
@@ -1632,12 +1620,8 @@ static void shb_CNG_encod_fx(

static Word16 shb_DTX_fx(
    Encoder_State *st, /* i/o: State structure                                 */
#ifdef NONBE_FIX_ISSUE_2206_SWB_EXPERIMENT
    const Word16 *shb_speech_fx, /* i  : SHB target signal (6-14kHz) at 16kHz         shb_speech_q */
    const Word16 shb_speech_q,   /* i  : SHB target signal (6-14kHz) at 16kHz Q       Q0 */
#else
    const Word16 *shb_speech_fx, /* i  : SHB target signal (6-14kHz) at 16kHz         Q0 */
#endif
    const Word16 *syn_12k8_16k_fx /* i  : ACELP core synthesis at 12.8kHz or 16kHz     Q0 */
)
{
@@ -1649,9 +1633,7 @@ static Word16 shb_DTX_fx(
    Word16 *shb_new_speech_fx;
    Word32 wb_ener_fx;
    Word32 shb_ener_fx;
#ifdef NONBE_FIX_ISSUE_2206_SWB_EXPERIMENT
    Word16 shb_ener_q;
#endif
    Word16 log_wb_ener_fx;
    Word16 log_shb_ener_fx;
    Word16 tmp;
@@ -1663,20 +1645,13 @@ static Word16 shb_DTX_fx(
    TD_BWE_ENC_HANDLE hBWE_TD = st->hBWE_TD;

    shb_new_speech_fx = shb_old_speech_fx + ( ACELP_LOOK_12k8 + L_SUBFR ) * 5 / 4;
#ifdef NONBE_FIX_ISSUE_2206_SWB_EXPERIMENT
    Copy_Scale_sig_nosat( hBWE_TD->old_speech_shb_fx, shb_old_speech_fx, ( ACELP_LOOK_12k8 + L_SUBFR ) * 5 / 4, sub( shb_speech_q, hBWE_TD->old_speech_shb_q ) );
    Copy( shb_speech_fx, shb_new_speech_fx, L_FRAME16k );
    Copy( shb_old_speech_fx + L_FRAME16k, hBWE_TD->old_speech_shb_fx, ( ACELP_LOOK_12k8 + L_SUBFR ) * 5 / 4 );
    hBWE_TD->old_speech_shb_q = shb_speech_q;
    move16();
#else
    Copy( hBWE_TD->old_speech_shb_fx, shb_old_speech_fx, ( ACELP_LOOK_12k8 + L_SUBFR ) * 5 / 4 );              // old_speech_shb_fx -> Q0
    Copy( shb_speech_fx, shb_new_speech_fx, L_FRAME16k );                                                      // Q0
    Copy( shb_old_speech_fx + L_FRAME16k, hBWE_TD->old_speech_shb_fx, ( ACELP_LOOK_12k8 + L_SUBFR ) * 5 / 4 ); // Q0
#endif

    shb_ener_fx = L_deposit_l( 0 );
#ifdef NONBE_FIX_ISSUE_2206_SWB_EXPERIMENT
    FOR( i = 0; i < L_FRAME16k; i++ )
    {
        shb_ener_fx = L_mac_sat( shb_ener_fx, shb_old_speech_fx[i], shb_old_speech_fx[i] ); // ( 2 * hBWE_TD->old_speech_shb_q + Q1 ) --> Q1 due to left shift in L_mac
@@ -1684,14 +1659,6 @@ static Word16 shb_DTX_fx(
    shb_ener_q = add( shl( hBWE_TD->old_speech_shb_q, 1 ), 1 );

    shb_ener_fx = L_add( Mpy_32_16_1( shb_ener_fx, 102 ), 1 ); /* ( 1 / L_FRAME16K ) -> 102 in Q15, shb_ener_fx in shb_ener_q */
#else
    FOR( i = 0; i < L_FRAME16k; i++ )
    {
        shb_ener_fx = L_mac_sat( shb_ener_fx, shb_old_speech_fx[i], shb_old_speech_fx[i] ); // ( Q0 + Q0 + Q1 ) --> Q1 due to left shift in L_mac
    }

    shb_ener_fx = L_add( Mpy_32_16_1( shb_ener_fx, 102 ), 1 ); /* ( 1 / L_FRAME16K ) -> 102 in Q15, shb_ener_fx in Q1 */
#endif

    wb_ener_fx = L_deposit_l( 0 );
    FOR( i = 0; i < st->L_frame; i++ )
@@ -1709,11 +1676,7 @@ static Word16 shb_DTX_fx(
    log_wb_ener_fx = round_fx_sat( L_shl_sat( wb_ener_fx, 10 ) ); /* log_wb_ener_fx in Q8 */
    exp = norm_l( shb_ener_fx );
    fra = Log2_norm_lc( L_shl( shb_ener_fx, exp ) );
#ifdef NONBE_FIX_ISSUE_2206_SWB_EXPERIMENT
    exp = sub( sub( 30, shb_ener_q ), exp );
#else
    exp = sub( 30 - 1, exp );
#endif
    shb_ener_fx = Mpy_32_16( exp, fra, LG10 );

    test();
+0 −7
Original line number Diff line number Diff line
@@ -411,13 +411,8 @@ void core_switching_pre_enc_fx(
        }

        tmp = sub( L_LOOK_16k + L_SUBFR16k, Sample_Delay_HP );
#ifdef NONBE_FIX_ISSUE_2206_SWB_EXPERIMENT
        Copy( &hBWE_TD->old_speech_shb_fx[tmp], hBWE_FD->new_input_hp_fx, Sample_Delay_HP ); /*Q(hBWE_TD->old_speech_shb_q)*/
        hBWE_FD->Q_new_input_hp = hBWE_TD->old_speech_shb_q;
#else
        Copy( &hBWE_TD->old_speech_shb_fx[tmp], hBWE_FD->new_input_hp_fx, Sample_Delay_HP ); /*Q(Q_shb_spch)*/
        hBWE_FD->Q_new_input_hp = 0;
#endif
        move16();

        IF( NE_16( st_fx->last_extl, WB_BWE ) )
@@ -567,10 +562,8 @@ void core_switching_post_enc_fx(
            ELSE
            {
                set16_fx( hBWE_TD->old_speech_shb_fx, 0, L_LOOK_16k + L_SUBFR16k );
#ifdef NONBE_FIX_ISSUE_2206_SWB_EXPERIMENT
                hBWE_TD->old_speech_shb_q = Q15;
                move16();
#endif
            }

            swb_tbe_reset_fx( hBWE_TD->mem_csfilt_fx, hBWE_TD->mem_genSHBexc_filt_down_shb_fx, hBWE_TD->state_lpc_syn_fx,
Loading