From a781c1aff517d4e40e42247b3aa675ecfb902b71 Mon Sep 17 00:00:00 2001 From: Thomas Dettbarn Date: Fri, 1 Aug 2025 14:14:55 +0200 Subject: [PATCH 1/3] In ivas_binaural_reverb_init(), the division of two constants was moved from run time to compile time. --- lib_rend/ivas_reverb_fx.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib_rend/ivas_reverb_fx.c b/lib_rend/ivas_reverb_fx.c index 5156911f3..9d46e360a 100644 --- a/lib_rend/ivas_reverb_fx.c +++ b/lib_rend/ivas_reverb_fx.c @@ -2427,7 +2427,6 @@ ivas_error ivas_binaural_reverb_init( Word32 ene[CLDFB_NO_CHANNELS_MAX]; Word16 preDelay; #ifdef FIX_1831_REVERB_REGRESSION - Word16 temp16, s; Word32 temp32; #endif @@ -2447,9 +2446,7 @@ ivas_error ivas_binaural_reverb_init( } #ifdef FIX_1831_REVERB_REGRESSION - temp16 = BASOP_Util_Divide3216_Scale( 48000, CLDFB_NO_CHANNELS_MAX, &s ); - temp16 = shl( temp16, s ); // Q0 - temp32 = Mult_32_16( roomAcoustics->acousticPreDelay_fx, temp16 ); // Q11 + temp32 = Mult_32_16( roomAcoustics->acousticPreDelay_fx, ( IVAS_48k/ CLDFB_NO_CHANNELS_MAX/ 2 ) ); // Q11 preDelay = extract_l( L_shr( L_add( temp32, L_shl( 1, 10 ) ), 11 ) ); // Q0 #else preDelay = (int16_t) roundf( 48000.0f * roomAcoustics->acousticPreDelay / CLDFB_NO_CHANNELS_MAX ); -- GitLab From 611e7dc0d3e3d523d48dae1ba2f18663a4cbc448 Mon Sep 17 00:00:00 2001 From: Thomas Dettbarn Date: Fri, 1 Aug 2025 14:52:25 +0200 Subject: [PATCH 2/3] applied the clang patch and made a shift from Q12->Q11 more explicit. --- lib_rend/ivas_reverb_fx.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib_rend/ivas_reverb_fx.c b/lib_rend/ivas_reverb_fx.c index 9d46e360a..54b64d381 100644 --- a/lib_rend/ivas_reverb_fx.c +++ b/lib_rend/ivas_reverb_fx.c @@ -2446,10 +2446,10 @@ ivas_error ivas_binaural_reverb_init( } #ifdef FIX_1831_REVERB_REGRESSION - temp32 = Mult_32_16( roomAcoustics->acousticPreDelay_fx, ( IVAS_48k/ CLDFB_NO_CHANNELS_MAX/ 2 ) ); // Q11 - preDelay = extract_l( L_shr( L_add( temp32, L_shl( 1, 10 ) ), 11 ) ); // Q0 + temp32 = Mult_32_16( roomAcoustics->acousticPreDelay_fx, ( ( IVAS_48k / CLDFB_NO_CHANNELS_MAX ) >> 1 ) ); // Q11 + preDelay = extract_l( L_shr( L_add( temp32, L_shl( 1, 10 ) ), 11 ) ); // Q0 #else - preDelay = (int16_t) roundf( 48000.0f * roomAcoustics->acousticPreDelay / CLDFB_NO_CHANNELS_MAX ); + preDelay = (int16_t) roundf( ( 48000.0f / CLDFB_NO_CHANNELS_MAX ) * roomAcoustics->acousticPreDelay ); #endif #ifdef FIX_1741_REVERB_TIMES_Q_FORMAT floatToFixed_arrL( t60_temp, t60, Q26, CLDFB_NO_CHANNELS_MAX ); -- GitLab From 96b8616526dbf0f21c79ed658066094725c25d09 Mon Sep 17 00:00:00 2001 From: Thomas Dettbarn Date: Fri, 1 Aug 2025 15:36:18 +0200 Subject: [PATCH 3/3] applied the clang patch. --- lib_rend/ivas_reverb_fx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_rend/ivas_reverb_fx.c b/lib_rend/ivas_reverb_fx.c index 54b64d381..3a0337772 100644 --- a/lib_rend/ivas_reverb_fx.c +++ b/lib_rend/ivas_reverb_fx.c @@ -2447,7 +2447,7 @@ ivas_error ivas_binaural_reverb_init( #ifdef FIX_1831_REVERB_REGRESSION temp32 = Mult_32_16( roomAcoustics->acousticPreDelay_fx, ( ( IVAS_48k / CLDFB_NO_CHANNELS_MAX ) >> 1 ) ); // Q11 - preDelay = extract_l( L_shr( L_add( temp32, L_shl( 1, 10 ) ), 11 ) ); // Q0 + preDelay = extract_l( L_shr( L_add( temp32, L_shl( 1, 10 ) ), 11 ) ); // Q0 #else preDelay = (int16_t) roundf( ( 48000.0f / CLDFB_NO_CHANNELS_MAX ) * roomAcoustics->acousticPreDelay ); #endif -- GitLab