From c006583dfff2c513cc639515ddcf30ddf55223a8 Mon Sep 17 00:00:00 2001 From: Sandesh Venkatesh Date: Mon, 18 Nov 2024 12:30:11 +0530 Subject: [PATCH 1/2] Fix for 3GPP issue 1013: Crash in ivas_hq_core_dec_fx() for MC 5.1 at 32kbps JBM 16kHz out link #1013 --- lib_com/trans_inv_fx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_com/trans_inv_fx.c b/lib_com/trans_inv_fx.c index 5c41122fb..050548bc3 100644 --- a/lib_com/trans_inv_fx.c +++ b/lib_com/trans_inv_fx.c @@ -531,7 +531,7 @@ void preecho_sb_fx( tmp_fx1 = norm_l( es_mdct_fx[i] ); tmp_fxL1 = L_shl( es_mdct_fx[i], tmp_fx1 ); tmp_fxL2 = L_shl( mean_prev_fx_loc, tmp_fx1 ); - tmp_fx1 = round_fx( tmp_fxL1 ); + tmp_fx1 = round_fx_sat( tmp_fxL1 ); tmp_fx2 = round_fx( tmp_fxL2 ); tmp_fx3 = div_s( tmp_fx2, tmp_fx1 ); min_g_fx[i] = Frac_sqrt( tmp_fx3 ); -- GitLab From 61c3c69e4a5dff1cce14ea1c828ad8583c9ab28a Mon Sep 17 00:00:00 2001 From: Sandesh Venkatesh Date: Wed, 4 Dec 2024 15:01:01 +0530 Subject: [PATCH 2/2] Adding switch in options.h --- lib_com/options.h | 1 + lib_com/trans_inv_fx.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/lib_com/options.h b/lib_com/options.h index f5785f099..5990027cb 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -80,4 +80,5 @@ #define SIMPLIFY_CODE_BE // Simplify synthesis loop #define CR_2109_to_2112_cd0_ce0 /* This is related to the CRs include in the 26.444 package of 21-12. Concerns lead_deindexing and */ #define FIX_QMETADATA_PENALTY /* Nokia: transform penalty calculation in qmetadata into integer operations */ +#define FIX_1013_CRASH_HQ_CORE_DEC /* Ittiam: Saturation added on the lines of EVS */ #endif diff --git a/lib_com/trans_inv_fx.c b/lib_com/trans_inv_fx.c index 050548bc3..24e87c5a6 100644 --- a/lib_com/trans_inv_fx.c +++ b/lib_com/trans_inv_fx.c @@ -531,7 +531,11 @@ void preecho_sb_fx( tmp_fx1 = norm_l( es_mdct_fx[i] ); tmp_fxL1 = L_shl( es_mdct_fx[i], tmp_fx1 ); tmp_fxL2 = L_shl( mean_prev_fx_loc, tmp_fx1 ); +#ifdef FIX_1013_CRASH_HQ_CORE_DEC tmp_fx1 = round_fx_sat( tmp_fxL1 ); +#else + tmp_fx1 = round_fx( tmp_fxL1 ); +#endif tmp_fx2 = round_fx( tmp_fxL2 ); tmp_fx3 = div_s( tmp_fx2, tmp_fx1 ); min_g_fx[i] = Frac_sqrt( tmp_fx3 ); -- GitLab