From 307b1e39e1611349dcd5a410a8607a088f4a7fe2 Mon Sep 17 00:00:00 2001 From: Tommy Vaillancourt Date: Tue, 3 Feb 2026 15:30:04 -0500 Subject: [PATCH 1/2] fix proposal for #2407 --- lib_com/options.h | 2 +- lib_com/residu_fx.c | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/lib_com/options.h b/lib_com/options.h index 0ea316a82..ec9d44855 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -122,7 +122,7 @@ #define FIX_1283_STEREO_DFT_COLLAPSE /* FhG: float issue 1283: fix for critical issue with DFT stereo core coder */ #define FIX_2379_REMOVE_previoussynth_fx_32 /* VA: basop issue 2379: remove duplicated buffer st->previoussynth_fx_32[] */ #define FIX_2396_CONSTANT_STRIDE_IN_TC_BUFFER /* FhG/VA: basop issue 2396: keep TC channel pointers in one constant place during decoding and rendering */ - +#define FIX_2407_FIX_RESIDU_IVAS /* VA: basop 2407, Implementation issue in residu_ivas + unnecessary complexity */ /* ##################### End NON-BE switches ########################### */ /* ################## End MAINTENANCE switches ######################### */ diff --git a/lib_com/residu_fx.c b/lib_com/residu_fx.c index 60c0c3356..b281f11a2 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,24 @@ 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] ); + move32(); + 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; } -- GitLab From f8c617e78c045797459b209c9e2020910291e9d9 Mon Sep 17 00:00:00 2001 From: Tommy Vaillancourt Date: Wed, 4 Feb 2026 08:43:20 -0500 Subject: [PATCH 2/2] remove 1 not necessary move() --- lib_com/residu_fx.c | 1 - 1 file changed, 1 deletion(-) diff --git a/lib_com/residu_fx.c b/lib_com/residu_fx.c index b281f11a2..7008b4cf0 100644 --- a/lib_com/residu_fx.c +++ b/lib_com/residu_fx.c @@ -47,7 +47,6 @@ void residu_ivas_fx( FOR( i = 0; i < l; i++ ) { s64 = W_mult_32_16( x[i], a[0] ); - move32(); FOR( j = 1; j <= m; j++ ) { s64 = W_mac_32_16( s64, x[i - j], a[j] ); -- GitLab