From 17d51d7ddc45d77cf60fec5167296f69e65054a9 Mon Sep 17 00:00:00 2001 From: Tommy Vaillancourt Date: Fri, 6 Sep 2024 11:24:35 -0400 Subject: [PATCH] proposed fix to 875 --- lib_com/options.h | 1 + lib_com/swb_tbe_com_fx.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/lib_com/options.h b/lib_com/options.h index 6b9976ba5..a16e34d67 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -180,6 +180,7 @@ #define FIX_869_WRONG_UVGAIN_STEP /* VA: Fix wrong decoding of uv gain quantizer for td-stereo*/ #define FIX_871_REMOVE_UNNECESSARY_CONDITION /* VA: remove a condition that is not needed and prevented correct frame classification of the secondary channel of the TD stereo */ +#define FIX_875_SATURATION_DURING_ROUNDING /* VA: fix a possible saturation when rounding */ /* ################## End DEVELOPMENT switches ######################### */ /* clang-format on */ diff --git a/lib_com/swb_tbe_com_fx.c b/lib_com/swb_tbe_com_fx.c index faa6248c4..891e2524c 100644 --- a/lib_com/swb_tbe_com_fx.c +++ b/lib_com/swb_tbe_com_fx.c @@ -3671,7 +3671,11 @@ void GenShapedSHBExcitation_ivas_fx( { FOR( j = 0; j < 32; ++j ) { +#ifndef FIX_875_SATURATION_DURING_ROUNDING White_exc16k_FB_temp[i * 32 + j] = mult_r( White_exc16k_FB_temp[i * 32 + j], cos_fb_exc_fx[j] ); +#else + White_exc16k_FB_temp[i * 32 + j] = mult_r_sat( White_exc16k_FB_temp[i * 32 + j], cos_fb_exc_fx[j] ); +#endif move16(); } } -- GitLab