Commit 75ccfd47 authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

Bug fix related to 3GPP issue 1316

parent dbfcefc0
Loading
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -1168,6 +1168,7 @@ void ivas_mdct_core_whitening_enc_fx(
    Word32 scf_fx[CPE_CHANNELS][NB_DIV][M];
    Word32 scf_q_fx[CPE_CHANNELS][NB_DIV][M];
    Word64 chE_fx[2], chE_tot_fx;
    Word16 chE_q[2];
    Word8 sns_low_br_mode;
    Word16 nbits_start_sns;
    Word16 num_sns;
@@ -1905,6 +1906,7 @@ void ivas_mdct_core_whitening_enc_fx(
        IF( mct_on )
        {
            set64_fx( chE_fx, 0, NB_DIV );
            set16_fx( chE_q, 0, NB_DIV );
        }

        init_tcx_enc_info_fx( st, &L_subframe, &L_subframeTCX, &tcx_subframe_coded_lines );
@@ -1973,6 +1975,8 @@ void ivas_mdct_core_whitening_enc_fx(
                    chE_fx[n] = W_add( W_deposit32_l( powerSpec_fx[i] ), chE_fx[n] );
                    move64();
                }
                chE_q[n] = sub( add( q_pow_tmp, q_pow ), 32 );
                move16();
            }
            sns_compute_scf_fx( powerSpec_fx, st->hTcxCfg->psychParamsCurrent, st->L_frame, scf_fx[ch][n], sub( add( q_pow_tmp, q_pow ), 32 ) );
        }
@@ -1980,14 +1984,14 @@ void ivas_mdct_core_whitening_enc_fx(
        /* MCT: detect whether there are silent channels and set mct_chan_mode accordingly */
        IF( mct_on )
        {
            Word16 q = sub( add( q_pow_tmp, q_pow ), 32 );
            Word16 q = s_min( chE_q[0], chE_q[1] );
            Word64 silent_thr = SILENT_CHANNEL_THRES_FX;
            move64();
            chE_tot_fx = 0;
            move64();
            FOR( i = 0; i < NB_DIV; i++ )
            {
                chE_tot_fx = W_add( chE_fx[i], chE_tot_fx );
                chE_tot_fx = W_add( W_shr( chE_fx[i], sub( chE_q[i], q ) ), chE_tot_fx );
            }
            IF( GT_16( q, Q24 ) )
            {