diff --git a/lib_com/options.h b/lib_com/options.h index 6b9976ba55d749567f58c68420ddd9ce5ab176a7..a16e34d67db2700b1d7565dfabc9ec5b558ba527 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 faa6248c4f4dd8ad2ca4d0d28bd6fd2b099a8e3e..891e2524c0e9b19d3c980863c97c43cfa12108da 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(); } }