diff --git a/lib_com/options.h b/lib_com/options.h index 66b74d56491e481643fb99b7c4f3a06ba38f7101..331530effcc876327cb6f716a1a186d873add088 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -104,6 +104,7 @@ #define FIX_2408_FD_BWE_UPDATE /* VA: basop issue 2408: bug-fix in the FD BWE memory updates in wb_pre_proc_ivas_fx() */ #define FIX_2380_HARM_GSC_GAIN_COMP_FX /* VA: basop issue 2380 & 2381: Fix issue when switching from CNG low energy to active content with high energy */ #define FIX_2406_FIX_GAIN_ON_INACTIVE /* VA: basop issue 2406: gain between 6.4 and 8kHz was too weak during inactive content with Fs=16kHz */ +#define FIX_2407_FIX_RESIDU_IVAS /* VA: basop 2407, Implementation issue in residu_ivas + unnecessary complexity */ /* ##################### End NON-BE switches ########################### */ diff --git a/lib_com/residu_fx.c b/lib_com/residu_fx.c index 60c0c3356f5d827efb551da6df2ab08a57a3ff26..7008b4cf056f516200c39068350c2204141d1c0b 100644 --- a/lib_com/residu_fx.c +++ b/lib_com/residu_fx.c @@ -24,6 +24,7 @@ void residu_ivas_fx( const Word16 l /* i : size of filtering */ ) { +#ifndef FIX_2407_FIX_RESIDU_IVAS Word32 s; Word16 i, j; @@ -38,7 +39,23 @@ void residu_ivas_fx( y[i] = s; move32(); } +#else + Word64 s64; + Word16 i, j, scaling; + + scaling = sub( Q15, a_exp ); + FOR( i = 0; i < l; i++ ) + { + s64 = W_mult_32_16( x[i], a[0] ); + FOR( j = 1; j <= m; j++ ) + { + s64 = W_mac_32_16( s64, x[i - j], a[j] ); + } + y[i] = W_shl_sat_l( s64, scaling ); + move32(); + } +#endif return; }