From 2a9cbac58d4177d4766f8c681d644168b63ba7c6 Mon Sep 17 00:00:00 2001 From: Sandesh Venkatesh Date: Mon, 13 Jan 2025 14:34:41 +0530 Subject: [PATCH] Fix for 3GPP issue 1152: Assertion error observed in evs_enc_fx (with option stereo_dmx_evs) from find_tilt_fx function Link #1157 --- lib_com/options.h | 1 + lib_enc/find_tilt_fx.c | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/lib_com/options.h b/lib_com/options.h index e301163f0..d2f32a1ce 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -114,4 +114,5 @@ #define FIX_ISSUE_1153 /* Ittiam: Fix for Issue 1153: Assertion error observed in stereo_dmx_evs_enc_fx from calc_poc_fx function*/ #define FIX_ISSUE_1154 /* Ittiam: Fix for Issue 1154: Encoder crash for ParamMC 7.1 at 96kbps in ivas_param_mc_param_est_enc_fx() */ #define FIX_ISSUE_1157 /* Ittiam: Fix for Issue 1157: Encoder crash for Stereo at 48/64kbps DTX on/off in kernel_switch_trafo_fx() */ +#define FIX_ISSUE_1152 /* Ittiam: Fix for issue 1152: Assertion error observed in evs_enc_fx (with option stereo_dmx_evs) from find_tilt_fx function*/ #endif diff --git a/lib_enc/find_tilt_fx.c b/lib_enc/find_tilt_fx.c index f29a9709c..d63585a39 100644 --- a/lib_enc/find_tilt_fx.c +++ b/lib_enc/find_tilt_fx.c @@ -96,7 +96,17 @@ void find_tilt_fx( hp_bckr = L_deposit_l( 1 ); } tmp = BASOP_Util_Divide3232_Scale( lp_bckr, hp_bckr, &e_tmp ); + +#ifdef FIX_ISSUE_1152 +#ifdef BASOP_NOGLOB + Ltmp = L_shr_r_sat( L_deposit_h( tmp ), sub( 15, e_tmp ) ); +#else + Ltmp = L_shr_r( L_deposit_h( tmp ), sub( 15, e_tmp ) ); +#endif +#else Ltmp = L_shr_r( L_deposit_h( tmp ), sub( 15, e_tmp ) ); +#endif + *bckr_tilt_lt = L_add( Mpy_32_16_r( *bckr_tilt_lt, 29491 ), Mpy_32_16_r( Ltmp, 3277 ) ); /* Q16 */ test(); -- GitLab