Commit 8ac987e3 authored by vaillancour's avatar vaillancour
Browse files

Merge branch 'main' into VA_basop_no_glob_hi_level

parent 8cd44221
Loading
Loading
Loading
Loading
Loading
+1579 −1579
Original line number Diff line number Diff line
@@ -25,15 +25,15 @@
/*---------------------------------------------------------------------*
 * Local function prototypes
 *---------------------------------------------------------------------*/
static void shb_CNG_encod_fx(Encoder_State_fx *st_fx, const Word16 update_fx );
static Word16 shb_DTX_fx(Encoder_State_fx *st_fx, const Word16 *shb_speech_fx, const Word16 *syn_12k8_16k );
static void shb_CNG_encod_fx(Encoder_State *st_fx, const Word16 update_fx );
static Word16 shb_DTX_fx(Encoder_State *st_fx, const Word16 *shb_speech_fx, const Word16 *syn_12k8_16k );
/*---------------------------------------------------------------------*
* CNG_enc()
*
* Confort noise generation for the coder
*---------------------------------------------------------------------*/
void CNG_enc_fx(
    Encoder_State_fx *st_fx,/* i/o: State structure                                     */
    Encoder_State *st_fx,/* i/o: State structure                                     */
    Word16 Aq[],            /* o  : LP coefficients                               Q12   */
    const Word16 *speech,   /* i  : pointer to current frame input speech buffer  Q_new */
    Word32 L_enr,           /* i  : residual energy from Levinson-Durbin          Q6    */
@@ -114,7 +114,7 @@ void CNG_enc_fx(
    pt_sp = speech;
    L_ener = L_deposit_l(1);
    /*  L_ener = L_add(L_shr(sum2_f_fx( speech, L_frame ), 8) , L_ener);*/
    IF( EQ_16(st_fx->L_frame_fx, L_FRAME))
    IF( EQ_16(st_fx->L_frame, L_FRAME))
    {
        FOR (j=0; j<128; j++)
        {
@@ -164,7 +164,7 @@ void CNG_enc_fx(
        test();
        test();
        test();
        IF( GT_32(st_fx->last_core_brate_fx, SID_2k40) && ( EQ_16( st_fx->last_core_fx, HQ_CORE ) || st_fx->hTdCngEnc->burst_ho_cnt > 0 ) && LT_16(hTdCngEnc->lp_sp_enr_fx, 1536) &&
        IF( GT_32(st_fx->last_core_brate, SID_2k40) && ( EQ_16( st_fx->last_core, HQ_CORE ) || st_fx->hTdCngEnc->burst_ho_cnt > 0 ) && LT_16(hTdCngEnc->lp_sp_enr_fx, 1536) &&
        GT_16(sub(sp_enr, hTdCngEnc->lp_sp_enr_fx), 1024) && GT_16(sp_enr, 1536) )
        {
            hTdCngEnc->lp_sp_enr_fx = sp_enr;
@@ -194,14 +194,14 @@ void CNG_enc_fx(
    *-----------------------------------------------------------------*/
    test();
    test();
    IF( (EQ_32(st_fx->core_brate_fx, SID_2k40) || EQ_32(st_fx->core_brate_fx,SID_1k75)) && GE_16(hDtxEnc->cng_cnt,sub(hDtxEnc->cng_hist_size,1)))
    IF( (EQ_32(st_fx->core_brate, SID_2k40) || EQ_32(st_fx->core_brate,SID_1k75)) && GE_16(hDtxEnc->cng_cnt,sub(hDtxEnc->cng_hist_size,1)))
    {
        set32_fx( max_val, 0, 2 );
        set16_fx( max_idx, 0, 2 );

        FOR( i=0; i< hDtxEnc->cng_hist_size; i++ )
        {
            IF ( EQ_16(st_fx->L_frame_fx,L_FRAME))
            IF ( EQ_16(st_fx->L_frame,L_FRAME))
            {
                lsp2lsf_fx( &hTdCngEnc->cng_lsp_hist_fx[i*M], lsf_tmp, M, INT_FS_FX );
                ftmp_fx = 964;
@@ -285,7 +285,7 @@ void CNG_enc_fx(
         (LT_16(add(st_lp_sp_enr, 1024 /* 4.0, Q8 */), sp_enr)) &&
         (hDtxEnc->first_CNG != 0) &&
         (hTdCngEnc->old_enr_index >= 0) &&
         (GT_32(st_fx->last_core_brate_fx, SID_2k40))) ||
         (GT_32(st_fx->last_core_brate, SID_2k40))) ||
        EQ_16(force_cn_step, 1))
    {
        *allow_cn_step = 1;
@@ -311,10 +311,10 @@ void CNG_enc_fx(


    test();
    IF( EQ_32(st_fx->core_brate_fx, SID_2k40) || EQ_32(st_fx->core_brate_fx,SID_1k75))
    IF( EQ_32(st_fx->core_brate, SID_2k40) || EQ_32(st_fx->core_brate,SID_1k75))
    {
        /* LSF quantization */
        IF ( st_fx->Opt_AMR_WB_fx != 0 )
        IF ( st_fx->Opt_AMR_WB != 0 )
        {
            isf_enc_amr_wb_fx( st_fx, lsf_new, lsp_new, 0);
        }
@@ -329,7 +329,7 @@ void CNG_enc_fx(
        /* Reset CNG history if CNG frame length is changed */
        test();
        test();
        if ( EQ_16(st_fx->bwidth_fx,WB) && hDtxEnc->first_CNG!=0 && NE_16(st_fx->L_frame_fx, hDtxEnc->last_CNG_L_frame))
        if ( EQ_16(st_fx->bwidth,WB) && hDtxEnc->first_CNG!=0 && NE_16(st_fx->L_frame, hDtxEnc->last_CNG_L_frame))
        {
            hTdCngEnc->ho_hist_size = 0;
            move16();
@@ -347,10 +347,10 @@ void CNG_enc_fx(
    * Find A(z) coefficients
    *---------------------------------------------------------------------*/

    IF( LE_32(st_fx->last_core_brate_fx, SID_2k40))
    IF( LE_32(st_fx->last_core_brate, SID_2k40))
    {
        /* Reset hangover counter if not first SID period */
        if( GT_32(st_fx->core_brate_fx,FRAME_NO_DATA))
        if( GT_32(st_fx->core_brate,FRAME_NO_DATA))
        {
            hTdCngEnc->num_ho = 0;
            move16();
@@ -373,7 +373,7 @@ void CNG_enc_fx(
        test();
        test();
        test();
        IF( EQ_16(st_fx->element_mode, EVS_MONO) && (( st_fx->Opt_AMR_WB_fx || EQ_16(st_fx->bwidth_fx,WB))
        IF( EQ_16(st_fx->element_mode, EVS_MONO) && (( st_fx->Opt_AMR_WB || EQ_16(st_fx->bwidth,WB))
                && ( !hDtxEnc->first_CNG || GE_16(hTdCngEnc->act_cnt2,MIN_ACT_CNG_UPD)  ) ) )
        {
            IF (GT_32(hDtxEnc->last_active_brate, ACELP_16k40))
@@ -410,12 +410,12 @@ void CNG_enc_fx(
            /* Conversion between 12.8k and 16k LSPs */
            test();
            test();
            IF( EQ_16(st_fx->L_frame_fx,L_FRAME )&&EQ_16(hTdCngEnc->ho_16k_lsp[s_ptr],1))
            IF( EQ_16(st_fx->L_frame,L_FRAME )&&EQ_16(hTdCngEnc->ho_16k_lsp[s_ptr],1))
            {
                /* Conversion from 16k LPSs to 12k8 */
                lsp_convert_poly_fx( &(hTdCngEnc->ho_lsp_circ_fx[s_ptr*M]), st_fx->L_frame_fx, 0 );
                lsp_convert_poly_fx( &(hTdCngEnc->ho_lsp_circ_fx[s_ptr*M]), st_fx->L_frame, 0 );
            }
            ELSE IF ( EQ_16(st_fx->L_frame_fx,L_FRAME16k)&& hTdCngEnc->ho_16k_lsp[s_ptr]==0)
            ELSE IF ( EQ_16(st_fx->L_frame,L_FRAME16k)&& hTdCngEnc->ho_16k_lsp[s_ptr]==0)
            {
                /* 16k LSPs already converted and stored, just copy to the other buffer */
                Copy(&(hTdCngEnc->ho_lsp_circ2_fx[s_ptr*M]), &(hTdCngEnc->ho_lsp_circ_fx[s_ptr*M]), M );
@@ -452,7 +452,7 @@ void CNG_enc_fx(
            IF(NE_16(lp_ener_thr_scale, 8))
            {
                L_tmp1 = L_add(L_tmp1, L_shr(hTdCngEnc->lp_ener_fx, 8));
            } /*fenew = dotp( fexc, fexc, pit_max )/pit_max;*/
            }
            L_tmp1 = L_sub(L_tmp1, hTdCngEnc->lp_ener_fx);
#else
            L_tmp1 = L_shr(hTdCngEnc->ho_ener_hist_fx[hTdCngEnc->ho_hist_ptr],2);
@@ -529,7 +529,7 @@ void CNG_enc_fx(

            FOR( i=0; i<m; i++ )
            {
                IF ( EQ_16(st_fx->L_frame_fx,L_FRAME))
                IF ( EQ_16(st_fx->L_frame,L_FRAME))
                {
                    lsp2lsf_fx( &tmp[i*M], lsf_tmp, M, INT_FS_FX );
                    ftmp_fx = 964;
@@ -683,7 +683,7 @@ void CNG_enc_fx(
            Copy( lsp_new, hDtxEnc->lspCNG_fx, M );  /* use newly analyzed ISFs */
        }
    }
    IF ( st_fx->Opt_AMR_WB_fx != 0 )
    IF ( st_fx->Opt_AMR_WB != 0 )
    {
        E_LPC_f_isp_a_conversion(hDtxEnc->lspCNG_fx, Aq, M );
    }
@@ -692,7 +692,7 @@ void CNG_enc_fx(
        E_LPC_f_lsp_a_conversion(hDtxEnc->lspCNG_fx, Aq, M );     /* Find A(z) (not interpolated) */
    }

    tmp_loop = shr(st_fx->L_frame_fx,6);
    tmp_loop = shr(st_fx->L_frame,6);
    FOR( i=1; i<tmp_loop; i++ )
    {
        Copy( Aq, &Aq[i*(M+1)], M+1 );
@@ -703,8 +703,8 @@ void CNG_enc_fx(
    *-----------------------------------------------------------------*/

    /* calculate the residual signal */
    Residu3_fx(Aq, speech, res, st_fx->L_frame_fx, 0);
    Copy(res, res1, st_fx->L_frame_fx);
    Residu3_fx(Aq, speech, res, st_fx->L_frame, 0);
    Copy(res, res1, st_fx->L_frame);
    test();
    IF (EQ_16(st_fx->element_mode, IVAS_CPE_DFT) || EQ_16(st_fx->element_mode, IVAS_CPE_TD))
    {
@@ -714,10 +714,10 @@ void CNG_enc_fx(
        v_multc(res1, att, res1, st->L_frame);
#endif
    }
    ELSE IF( NE_16(st_fx->bwidth_fx,NB))
    ELSE IF( NE_16(st_fx->bwidth,NB))
    {
        test();
        IF( EQ_16(st_fx->bwidth_fx,WB) && hDtxEnc->CNG_mode>=0)
        IF( EQ_16(st_fx->bwidth,WB) && hDtxEnc->CNG_mode>=0)
        {
            ftmp_fx = HO_ATT_FX[hDtxEnc->CNG_mode];
        }
@@ -734,7 +734,7 @@ void CNG_enc_fx(
        att = div_s(16374,tmp1); /* Q15 */

        att = s_max(att, ftmp_fx);
        FOR( i = 0; i < st_fx->L_frame_fx; i++ )
        FOR( i = 0; i < st_fx->L_frame; i++ )
        {
            /*res1[i] *= att;*/
            res1[i] = mult(res1[i],att);
@@ -744,9 +744,9 @@ void CNG_enc_fx(
    }

    /* calculate the spectrum of residual signal */
    Copy(res1, fft_io, st_fx->L_frame_fx);
    Copy(res1, fft_io, st_fx->L_frame);

    IF ( EQ_16(st_fx->L_frame_fx,L_FRAME16k))
    IF ( EQ_16(st_fx->L_frame,L_FRAME16k))
    {
        modify_Fs_fx( fft_io, L_FRAME16k, 16000, fft_io, 12800, hTdCngEnc->exc_mem2_fx,0);
    }
@@ -780,14 +780,14 @@ void CNG_enc_fx(
    /*enr = dotp( res, res, L_frame ) / L_frame; */
    maxv = 0;
    move16();
    FOR(i = 0; i < st_fx->L_frame_fx; i++)
    FOR(i = 0; i < st_fx->L_frame; i++)
    {
        maxv = s_max(maxv, abs_s(res[i]));
    }
    scale = norm_s(maxv);
    pt_res = res;
    L_ener = L_deposit_l(1);
    IF( EQ_16(st_fx->L_frame_fx, L_FRAME))
    IF( EQ_16(st_fx->L_frame, L_FRAME))
    {
        FOR (j=0; j<128; j++)
        {
@@ -830,7 +830,7 @@ void CNG_enc_fx(
    * Quantize residual signal energy (only in SID frame)
    *-----------------------------------------------------------------*/
    test();
    IF( EQ_32(st_fx->core_brate_fx, SID_2k40)||EQ_32(st_fx->core_brate_fx,SID_1k75))
    IF( EQ_32(st_fx->core_brate, SID_2k40)||EQ_32(st_fx->core_brate,SID_1k75))
    {
        IF( GE_16(hDtxEnc->cng_cnt,sub(hDtxEnc->cng_hist_size,1)))
        {
@@ -897,9 +897,9 @@ void CNG_enc_fx(
                //IVAS_CODE
            //enr += hTdCngEnc->CNG_att * FAC_LOG2 / 10.0f;
        }
        ELSE IF( NE_16(st_fx->bwidth_fx, NB))
        ELSE IF( NE_16(st_fx->bwidth, NB))
        {
            IF( EQ_16(st_fx->bwidth_fx,WB))
            IF( EQ_16(st_fx->bwidth,WB))
            {
                IF(hDtxEnc->CNG_mode >= 0 )
                {
@@ -922,7 +922,7 @@ void CNG_enc_fx(
            enr = sub(enr, att );
        }
        /* intialize the energy quantization parameters */
        IF( st_fx->Opt_AMR_WB_fx == 0 )
        IF( st_fx->Opt_AMR_WB == 0 )
        {
            step = STEP_SID_FX;
            move16();
@@ -983,12 +983,12 @@ void CNG_enc_fx(
        /* substract by 2 not done to leave Energy in Q2 */
        lo = L_Extract_lc(L_tmp, &hi);
        hTdCngEnc->Enew_fx = Pow2(add(hi, 4), lo); /* Q6 */
        IF ( EQ_32(st_fx->core_brate_fx, SID_2k40))
        IF ( EQ_32(st_fx->core_brate, SID_2k40))
        {
            /* enr1 = (float)log10( st->Enew*L_frame + 0.1f ) / (float)log10( 2.0f );*/
            exp = norm_l(hTdCngEnc->Enew_fx);
            L_tmp = L_shl(hTdCngEnc->Enew_fx,exp); /*Q(exp+6) */
            L_tmp = Mult_32_16(L_tmp,shl(st_fx->L_frame_fx,5));/* Q(exp+6+5-15=exp-4) */
            L_tmp = Mult_32_16(L_tmp,shl(st_fx->L_frame,5));/* Q(exp+6+5-15=exp-4) */

#ifdef BASOP_NOGLOB  
            L_tmp = L_shr_sat(L_tmp,sub(exp,10)); /* Q6 */
@@ -1091,7 +1091,7 @@ void CNG_enc_fx(
            /* update the hangover energy buffer */
            hTdCngEnc->ho_ener_hist_fx[hTdCngEnc->ho_hist_ptr] = hTdCngEnc->Enew_fx;
            move32();
            IF ( EQ_32(st_fx->core_brate_fx, SID_2k40))
            IF ( EQ_32(st_fx->core_brate, SID_2k40))
            {
                FOR ( i=0; i<NUM_ENV_CNG; i++ )
                {
@@ -1120,13 +1120,13 @@ void CNG_enc_fx(
        }
    }
    /* dithering bit for AMR-WB IO mode is always set to 0 */
    IF( EQ_32(st_fx->core_brate_fx, SID_1k75))
    IF( EQ_32(st_fx->core_brate, SID_1k75))
    {
        push_indice_fx( hBstr, IND_DITHERING, 0, 1 );
    }
    IF ( EQ_32(st_fx->core_brate_fx, SID_2k40))
    IF ( EQ_32(st_fx->core_brate, SID_2k40))
    {
        IF(EQ_16(st_fx->L_frame_fx, L_FRAME16k))
        IF(EQ_16(st_fx->L_frame, L_FRAME16k))
        {
            push_indice_fx( hBstr, IND_ACELP_16KHZ, 1, 1 );
        }
@@ -1140,7 +1140,7 @@ void CNG_enc_fx(
        move16();
        push_indice_fx( hBstr, IND_SID_TYPE, 0, 1 );

        IF ( LT_32(st_fx->input_Fs_fx, 32000) && NE_16(st_fx->element_mode, IVAS_CPE_DFT))
        IF ( LT_32(st_fx->input_Fs, 32000) && NE_16(st_fx->element_mode, IVAS_CPE_DFT))
        {
            push_indice_fx( hBstr, IND_SID_BW, 0, 1 );
            *sid_bw = 0;
@@ -1153,14 +1153,14 @@ void CNG_enc_fx(
    *-----------------------------------------------------------------*/
    /* update the SID frames counter */
    test();
    IF( EQ_32(st_fx->core_brate_fx, SID_2k40)||EQ_32(st_fx->core_brate_fx,SID_1k75))
    IF( EQ_32(st_fx->core_brate, SID_2k40)||EQ_32(st_fx->core_brate,SID_1k75))
    {
        hDtxEnc->cng_cnt = 0;
        move16();
        hTdCngEnc->cng_hist_ptr = -1;
        move16();
        /* update frame length memory */
        hDtxEnc->last_CNG_L_frame = st_fx->L_frame_fx;
        hDtxEnc->last_CNG_L_frame = st_fx->L_frame;
        move16();
    }
    ELSE
@@ -1176,7 +1176,7 @@ void CNG_enc_fx(
 * SWB DTX/CNG encoding
 *---------------------------------------------------------------------*/
void swb_CNG_enc_fx(
    Encoder_State_fx *st_fx,             /* i/o: State structure                                                   */
    Encoder_State *st_fx,             /* i/o: State structure                                                   */
    const Word16 *shb_speech_fx,     /* i  : SHB target signal (6-14kHz) at 16kHz       (Q0)                   */
    const Word16 *syn_12k8_16k_fx    /* i  : ACELP core synthesis at 12.8kHz or 16kHz   (st_fx->Q_syn = 0)     */
)
@@ -1185,11 +1185,11 @@ void swb_CNG_enc_fx(
    TD_CNG_ENC_HANDLE  hTdCngEnc = st_fx->hTdCngEnc;

    test();
    IF ( EQ_32(st_fx->core_brate_fx, SID_2k40)||st_fx->core_brate_fx==FRAME_NO_DATA)
    IF ( EQ_32(st_fx->core_brate, SID_2k40)||st_fx->core_brate==FRAME_NO_DATA)
    {
        IF (EQ_16(st_fx->cng_type_fx,LP_CNG))
        IF (EQ_16(st_fx->cng_type,LP_CNG))
        {
            IF (GE_32(st_fx->input_Fs_fx, L_FRAME32k * FRAMES_PER_SEC))
            IF (GE_32(st_fx->input_Fs, L_FRAME32k * FRAMES_PER_SEC))
            {
                /* decide if SHB SID encoding or not */
                shb_SID_updt_fx = shb_DTX_fx(st_fx, shb_speech_fx, syn_12k8_16k_fx);
@@ -1197,7 +1197,7 @@ void swb_CNG_enc_fx(
                /* SHB CNG encoding */
                shb_CNG_encod_fx(st_fx, shb_SID_updt_fx);
            }
            ELSE IF (EQ_16(st_fx->element_mode, IVAS_CPE_DFT) && EQ_32(st_fx->core_brate_fx, SID_2k40))
            ELSE IF (EQ_16(st_fx->element_mode, IVAS_CPE_DFT) && EQ_32(st_fx->core_brate, SID_2k40))
            {
                //PMT("CNG IVAS_CPE_DFT code not implemented")
#ifdef IVAS_CODE
@@ -1227,7 +1227,7 @@ void swb_CNG_enc_fx(
 * SID parameters encoding for SHB signal
 *---------------------------------------------------------------------*/
static void shb_CNG_encod_fx(
    Encoder_State_fx *st_fx,             /* i/o: State structure                                 */
    Encoder_State *st_fx,             /* i/o: State structure                                 */
    const Word16 update_fx           /* i  : SID update flag                                 */
)
{
@@ -1256,7 +1256,7 @@ static void shb_CNG_encod_fx(
#endif
        }

        if ( LT_16(st_fx->bwidth_fx, SWB))
        if ( LT_16(st_fx->bwidth, SWB))
        {
            idx_ener_fx = 0;
            move16();
@@ -1313,7 +1313,7 @@ static void shb_CNG_encod_fx(
    }
    ELSE
    {
        IF ( EQ_32(st_fx->core_brate_fx, SID_2k40))
        IF ( EQ_32(st_fx->core_brate, SID_2k40))
        {
            hTdCngEnc->ho_sid_bw = L_shl(L_and(hTdCngEnc->ho_sid_bw, (Word32) 0x3fffffffL ), 1);
            push_indice_fx( hBstr, IND_SID_BW, 0, 1 );
@@ -1329,7 +1329,7 @@ static void shb_CNG_encod_fx(
* Decide if encoding SHB SID or not
*---------------------------------------------------------------------*/
static Word16 shb_DTX_fx(
    Encoder_State_fx *st_fx,             /* i/o: State structure                                                   */
    Encoder_State *st_fx,             /* i/o: State structure                                                   */
    const Word16 *shb_speech_fx,     /* i  : SHB target signal (6-14kHz) at 16kHz       (Q0)                   */
    const Word16 *syn_12k8_16k       /* i  : ACELP core synthesis at 12.8kHz or 16kHz   (st_fx->Q_syn = 0)     */
)
@@ -1367,7 +1367,7 @@ static Word16 shb_DTX_fx(
    shb_ener_fx = L_add(Mpy_32_16_1(shb_ener_fx, 102), 1); /* 102 in Q15, shb_ener_fx in Q1 */

    wb_ener_fx = L_deposit_l(0);
    FOR ( i=0; i<st_fx->L_frame_fx; i++ )
    FOR ( i=0; i<st_fx->L_frame; i++ )
    {
#ifdef BASOP_NOGLOB
        wb_ener_fx = L_mac_o(wb_ener_fx, syn_12k8_16k[i], syn_12k8_16k[i], &Overflow);
@@ -1458,7 +1458,7 @@ static Word16 shb_DTX_fx(

    update_fx = 0;
    move16();
    IF ( EQ_32(st_fx->core_brate_fx, SID_2k40))
    IF ( EQ_32(st_fx->core_brate, SID_2k40))
    {
        test();
        test();
@@ -1485,7 +1485,7 @@ static Word16 shb_DTX_fx(
                ELSE
                {
                    test();
                    IF ( GE_16(st_fx->bwidth_fx, SWB)&&LT_16(hTdCngEnc->last_SID_bwidth,SWB))
                    IF ( GE_16(st_fx->bwidth, SWB)&&LT_16(hTdCngEnc->last_SID_bwidth,SWB))
                    {
                        update_fx = 1;
                        move16();
@@ -1493,7 +1493,7 @@ static Word16 shb_DTX_fx(
                    ELSE
                    {
                        test();
                        IF ( LT_16(st_fx->bwidth_fx, SWB)&&GE_16(hTdCngEnc->last_SID_bwidth,SWB))
                        IF ( LT_16(st_fx->bwidth, SWB)&&GE_16(hTdCngEnc->last_SID_bwidth,SWB))
                        {
                            update_fx = 1;
                            move16();
@@ -1503,12 +1503,12 @@ static Word16 shb_DTX_fx(
            }
        }

        hTdCngEnc->last_SID_bwidth = st_fx->bwidth_fx;
        hTdCngEnc->last_SID_bwidth = st_fx->bwidth;
        move16();
    }
    /* LF-boost not yet implemented in decoder which means that the specific wb_sid information is not used */
    test();test();
    if ((EQ_16(st_fx->element_mode, IVAS_CPE_DFT) || EQ_16(st_fx->element_mode, IVAS_CPE_TD)) && EQ_32(st_fx->core_brate_fx, SID_2k40))
    if ((EQ_16(st_fx->element_mode, IVAS_CPE_DFT) || EQ_16(st_fx->element_mode, IVAS_CPE_TD)) && EQ_32(st_fx->core_brate, SID_2k40))
    {
        update_fx = 1;
        move16();
@@ -1535,7 +1535,7 @@ static Word16 shb_DTX_fx(
 *---------------------------------------------------------------------*/

void calculate_hangover_attenuation_gain_fx(
    Encoder_State_fx* st,           /* i  : encoder state structure         */
    Encoder_State* st,           /* i  : encoder state structure         */
    Word16* att,                    /* o  : attenuation factor              */
    const Word16 vad_hover_flag     /* i  : VAD hangover flag                       */
)
@@ -1550,7 +1550,7 @@ void calculate_hangover_attenuation_gain_fx(
    IF (hTdCngEnc != NULL)
    {
        test();test();test();
        IF( hTdCngEnc->burst_ho_cnt > 0 && (vad_hover_flag != 0) && (NE_16(st->bwidth_fx, NB) || GT_16(st->element_mode, EVS_MONO)))   /* corresponds to line 504 in FLT acelp_core_enc.c */
        IF( hTdCngEnc->burst_ho_cnt > 0 && (vad_hover_flag != 0) && (NE_16(st->bwidth, NB) || GT_16(st->element_mode, EVS_MONO)))   /* corresponds to line 504 in FLT acelp_core_enc.c */
        {
#ifdef IVAS_CODE
            if (st->element_mode == IVAS_CPE_DFT || st->element_mode == IVAS_CPE_TD)
@@ -1562,7 +1562,7 @@ void calculate_hangover_attenuation_gain_fx(
            {
                offset = 5;
                test();
                if (EQ_16(st->bwidth_fx, WB) && st->hDtxEnc->CNG_mode >= 0)
                if (EQ_16(st->bwidth, WB) && st->hDtxEnc->CNG_mode >= 0)
                {
                    offset = st->hDtxEnc->CNG_mode;
                    move16();