diff --git a/lib_com/swb_tbe_com_fx.c b/lib_com/swb_tbe_com_fx.c index 08bbd6362e5ef0f2f6c78ebe9b0ef3ef0dcdd83e..96d07e7ef305ed4534d8dd4a3ae338a537a7dbda 100644 --- a/lib_com/swb_tbe_com_fx.c +++ b/lib_com/swb_tbe_com_fx.c @@ -5971,7 +5971,7 @@ void non_linearity_ivas_fx( } - IF( GT_16( max_val, shl( 1, Q_inp ) ) ) + IF( GT_16( max_val, shl_sat( 1, Q_inp ) ) ) { exp = norm_s( max_val ); tmp = div_s( shl( 1, sub( 14, exp ) ), max_val ); /* Q(29-exp-Q_inp) */ @@ -6045,7 +6045,7 @@ void non_linearity_ivas_fx( max_val = s_max( max_val, tmp ); } - IF( GT_16( max_val, shl( 1, Q_inp ) ) ) + IF( GT_16( max_val, shl_sat( 1, Q_inp ) ) ) { exp = norm_s( max_val ); tmp = div_s( shl( 1, sub( 14, exp ) ), max_val ); /* Q(29-exp-Q_inp) */ diff --git a/lib_enc/analy_sp_fx.c b/lib_enc/analy_sp_fx.c index dc59ec752986a0750a75777d68d3aedf254b2414..7062a30900dc52a2758064a42e9cf34d04fc4da7 100644 --- a/lib_enc/analy_sp_fx.c +++ b/lib_enc/analy_sp_fx.c @@ -860,7 +860,7 @@ static void ivas_find_enr( * Find the total energy over the input bandwidth *-----------------------------------------------------------------*/ - etot = *LEtot; // *q_band + etot = *LEtot; // *q_band+1 move64(); FOR( i = min_band; i <= max_band; i++ ) { diff --git a/lib_enc/ivas_core_pre_proc_front_fx.c b/lib_enc/ivas_core_pre_proc_front_fx.c index f1e6b219389dbee185693731b14b3f870d21e022..be208296dfa5d792ae08b9d2aa1a4f5fa1963597 100644 --- a/lib_enc/ivas_core_pre_proc_front_fx.c +++ b/lib_enc/ivas_core_pre_proc_front_fx.c @@ -1453,7 +1453,7 @@ ivas_error pre_proc_front_ivas_fx( test(); IF( lr_vad_enabled && st->idchan == 0 ) { - ivas_long_enr_fx( st, -1, localVAD_HE_SAD, high_lpn_flag, hCPE->hFrontVad, CPE_CHANNELS, localVAD_HE_SAD_LR, Etot_LR_fx ); + ivas_long_enr_fx( st, -256 /*-1 q8*/, localVAD_HE_SAD, high_lpn_flag, hCPE->hFrontVad, CPE_CHANNELS, localVAD_HE_SAD_LR, Etot_LR_fx ); Copy32( fr_bands_LR_fx[0] + NB_BANDS, hCPE->hFrontVad[0]->hNoiseEst->enrO_fx, NB_BANDS ); // fr_bands_LR_fx_q hCPE->hFrontVad[0]->hNoiseEst->q_enrO = fr_bands_LR_fx_q[0]; diff --git a/lib_enc/ivas_front_vad_fx.c b/lib_enc/ivas_front_vad_fx.c index f2b3adece71326893968901d387f63af6cbe1d61..a4baf6a00f4d5645c9fe1e60954096d4b9137a3c 100644 --- a/lib_enc/ivas_front_vad_fx.c +++ b/lib_enc/ivas_front_vad_fx.c @@ -758,7 +758,7 @@ ivas_error front_vad_spar_fx( ivas_smc_gmm_fx( st, NULL, localVAD_HE_SAD[0], Etot_fx_0, lsp_new_fx, cor_map_sum_fx, epsP_fx, PS_fx, non_sta_fx, relE_fx, &high_lpn_flag, flag_spitch, Qfact_PS, Q_esp, hSpMusClas->past_PS_Q ); /* long-term energy update */ - ivas_long_enr_fx( st, -1, localVAD_HE_SAD[0], high_lpn_flag, &hFrontVad, 1, localVAD_HE_SAD, Etot_fx ); + ivas_long_enr_fx( st, -256 /*-1 q8*/, localVAD_HE_SAD[0], high_lpn_flag, &hFrontVad, 1, localVAD_HE_SAD, Etot_fx ); /* increase ini_frame counter */ hFrontVad->ini_frame = s_min( add( hFrontVad->ini_frame, 1 ), MAX_FRAME_COUNTER ); /* Q0 */