From 94281df39fdd956142e93eca624a2b3fb95a0cab Mon Sep 17 00:00:00 2001 From: Sandesh Venkatesh Date: Mon, 9 Dec 2024 14:13:06 +0530 Subject: [PATCH] Fix for 3GPP issue 1062: Assertion exit in BASOP encoder (stereo_dmx) and in EVS BASOP decoder link #1062 This change fixes issue reported in #1068 as well. --- lib_com/options.h | 1 + lib_com/swb_bwe_com_lr_fx.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/lib_com/options.h b/lib_com/options.h index 2d52463ed..c74d7af34 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -82,4 +82,5 @@ #define FIX_1013_CRASH_HQ_CORE_DEC /* Ittiam: Saturation added on the lines of EVS */ #define NONE_BE_FIX_BASOP_1044_OSBA_PRERENDER_MIX_GAINS /* DLB: adjust prerendering and mixing gain in OSBA encoder. This is fix to float codes*/ #define NONBE_1233_HQ_CLASSIFIER_DIV_BY_ZERO /* Eri: issue 1233: Address possible division by zero in hf_spectrum_sparseness() */ +#define FIX_ISSUE_1062_AND_1068_TON_ENE_EST_FX #endif diff --git a/lib_com/swb_bwe_com_lr_fx.c b/lib_com/swb_bwe_com_lr_fx.c index 1e7112a02..0535cb1c8 100644 --- a/lib_com/swb_bwe_com_lr_fx.c +++ b/lib_com/swb_bwe_com_lr_fx.c @@ -2389,7 +2389,11 @@ void ton_ene_est_fx( exp_normn = norm_s( peak_fx[k] ); fac_fx = div_s( shl( temp2_fx, exp_normd ), shl( peak_fx[k], exp_normn ) ); +#ifdef FIX_ISSUE_1062_AND_1068_TON_ENE_EST_FX + fac_fx = shl_sat( fac_fx, sub( add( Qss, exp_normn ), add( Qtemp2, exp_normd ) ) ); /* Qtemp2+exp_normd-(Qss+exp_normn)+15 -> 15*/ +#else fac_fx = shl( fac_fx, sub( add( Qss, exp_normn ), add( Qtemp2, exp_normd ) ) ); /* Qtemp2+exp_normd-(Qss+exp_normn)+15 -> 15*/ +#endif } ni_gain_fx[k] = mult_r( avg_pe_fx[k], fac_fx ); /* Qavg_pe[k] */ -- GitLab