From 7a5cb1ab39d2b4053aa3ad960201a0e82542acb7 Mon Sep 17 00:00:00 2001 From: Sandesh Venkatesh Date: Fri, 7 Mar 2025 10:45:15 +0530 Subject: [PATCH] Fix for 3GPP issue 1347: Saturation of energies memory for dtx path Link #1347 --- lib_enc/ivas_core_pre_proc_front_fx.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/lib_enc/ivas_core_pre_proc_front_fx.c b/lib_enc/ivas_core_pre_proc_front_fx.c index f41eb7f9c..46de4e232 100644 --- a/lib_enc/ivas_core_pre_proc_front_fx.c +++ b/lib_enc/ivas_core_pre_proc_front_fx.c @@ -1016,14 +1016,14 @@ ivas_error pre_proc_front_ivas_fx( Word16 msNoiseEst_Q = Q31; move16(); move16(); - zero_flag = get_zero_flag( st->hFdCngEnc->msNoiseEst_fx, NPART ); + zero_flag = get_zero_flag( st->hFdCngEnc->msNoiseEst_old_fx, NPART ); IF( zero_flag ) { - msNoiseEst_Q = getScaleFactor32( st->hFdCngEnc->msNoiseEst_fx, NPART ); + msNoiseEst_Q = getScaleFactor32( st->hFdCngEnc->msNoiseEst_old_fx, NPART ); + scale_sig32( st->hFdCngEnc->msNoiseEst_old_fx, NPART, msNoiseEst_Q ); /* exp(st->hFdCngEnc->msNoiseEst_old_fx_exp - msNoiseEst_Q) */ + st->hFdCngEnc->msNoiseEst_old_fx_exp = sub( st->hFdCngEnc->msNoiseEst_old_fx_exp, msNoiseEst_Q ); + move16(); } - Scale_sig32( st->hFdCngEnc->msNoiseEst_old_fx, NPART, msNoiseEst_Q ); /* exp(st->hFdCngEnc->msNoiseEst_old_fx_exp - msNoiseEst_Q) */ - st->hFdCngEnc->msNoiseEst_fx_exp = sub( st->hFdCngEnc->msNoiseEst_old_fx_exp, msNoiseEst_Q ); - move16(); perform_noise_estimation_enc_ivas_fx( band_energies_LR_fx, sub( Q31, band_energies_LR_fx_q ), enerBuffer_fx, *enerBuffer_fx_exp, st->hFdCngEnc, input_Fs, hCPE ); } ELSE @@ -1049,14 +1049,14 @@ ivas_error pre_proc_front_ivas_fx( move16(); Word16 msNoiseEst_Q = Q31; move16(); - zero_flag = get_zero_flag( st->hFdCngEnc->msNoiseEst_fx, NPART ); /* Q0 */ + zero_flag = get_zero_flag( st->hFdCngEnc->msNoiseEst_old_fx, NPART ); /* Q0 */ IF( zero_flag ) { - msNoiseEst_Q = getScaleFactor32( st->hFdCngEnc->msNoiseEst_fx, NPART ); + msNoiseEst_Q = getScaleFactor32( st->hFdCngEnc->msNoiseEst_old_fx, NPART ); + scale_sig32( st->hFdCngEnc->msNoiseEst_old_fx, NPART, msNoiseEst_Q ); /* exp(st->hFdCngEnc->msNoiseEst_old_fx_exp - msNoiseEst_Q) */ + st->hFdCngEnc->msNoiseEst_old_fx_exp = sub( st->hFdCngEnc->msNoiseEst_old_fx_exp, msNoiseEst_Q ); + move16(); } - Scale_sig32( st->hFdCngEnc->msNoiseEst_old_fx, NPART, msNoiseEst_Q ); /* exp(st->hFdCngEnc->msNoiseEst_old_fx_exp - msNoiseEst_Q) */ - st->hFdCngEnc->msNoiseEst_fx_exp = sub( st->hFdCngEnc->msNoiseEst_old_fx_exp, msNoiseEst_Q ); - move16(); zero_flag = get_zero_flag( st->hFdCngEnc->hFdCngCom->periodog, PERIODOGLEN ); /* Q0 */ Word16 normmsperiodog = 31; move16(); -- GitLab