diff --git a/lib_com/options.h b/lib_com/options.h index 2d359665cfdcf218f78d840a31f75e152761af1f..e7c3f2ce5b7c999e7d44b701108bc4ea95d48818 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -169,4 +169,5 @@ #define FIX_1072_SPEEDUP_COMPUTEDIFUSENESS /* FhG: Minor WMOPS tuning, nonbe */ #define FIX_1320_LOWRATE_ACELP #define FIX_1297_OVERFLOW /* VA: fixes issue with overflows in pre-processing */ +#define FIX_1298 /* VA: fix possible assert in gaus_enc */ #endif diff --git a/lib_enc/gaus_enc_fx.c b/lib_enc/gaus_enc_fx.c index a9add7ea809f9c8fcd1541cb85f10011adc96ef1..a7d60642bb0d6c56b7772c47e85b77b2a6138b9f 100644 --- a/lib_enc/gaus_enc_fx.c +++ b/lib_enc/gaus_enc_fx.c @@ -980,9 +980,13 @@ void gauss2v_ivas_fx( /* eneri = round_fx(ener[i]) + round_fx(ener[j]) + 2*round_fx(dotprod) */ /* Use ScalingShift to stay aligned with ener[] */ eneri = L_shl( dotprod, 1 ); /* One left shift added for factor of 2 */ +#ifndef FIX_1298 eneri = L_add( ener[i], eneri ); eneri = L_add( ener[j], eneri ); /* Q31 */ - +#else + eneri = L_add_sat( ener[i], eneri ); + eneri = L_add_sat( ener[j], eneri ); /* Q31 */ +#endif lo1 = L_Extract_lc( cor32, &hi1 ); cor2 = Sad_32( 0, hi1, lo1 ); /* Square + Add */