From 37fd9d6c442b78b505a20b380397f0a63e106996 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Tue, 28 Apr 2026 14:28:49 +0200 Subject: [PATCH] Add fix FIX_BASOP_2562_HQ_PREECHO_SAT to address saturation --- lib_com/options.h | 1 + lib_com/trans_inv_fx.c | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib_com/options.h b/lib_com/options.h index d88efcb33..867143dc5 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -141,6 +141,7 @@ #define FIX_BASOP_2548_ProcessIGF_fx_PREDICTIONGAIN /* FhG: fixes obvious bug for IVAS path. For EVS path, issue is still not resolved */ #define FIX_FMSW_DEC /* float issue 1542: fix JBM issue in format switching */ #define FIX_FMSW_DEC_2 /* float issue 1575: fix crash for format switching when bitsream starts with EVS */ +#define FIX_BASOP_2562_HQ_PREECHO_SAT /* Eri/Orange: Basop issue 2562: Add saturation to L_add in preecho calculations */ /* ##################### End NON-BE switches ########################### */ diff --git a/lib_com/trans_inv_fx.c b/lib_com/trans_inv_fx.c index 33e945ecd..405dd1914 100644 --- a/lib_com/trans_inv_fx.c +++ b/lib_com/trans_inv_fx.c @@ -746,7 +746,11 @@ void preecho_sb_fx( } } - tmp_fxL1 = L_add( eshbmean2_fx, es_mdct_hb_fx[ind3] ); /*2*(q_sig16)*/ +#ifdef FIX_BASOP_2562_HQ_PREECHO_SAT + tmp_fxL1 = L_add_sat( eshbmean2_fx, es_mdct_hb_fx[ind3] ); /*2*(q_sig16)*/ +#else + tmp_fxL1 = L_add( eshbmean2_fx, es_mdct_hb_fx[ind3] ); /*2*(q_sig16)*/ +#endif Mpy_32_16_ss( tmp_fxL1, 4369, &eshbmean3_fx, &tmp_u16 ); /*10922 : 1/3*/ tmp_fxL1 = L_sub( es_mdct_hb_fx[ind3], es_mdct_hb_fx[ind5] ); /*2*(q_sig16)*/ -- GitLab