From 00e408eae651be624ffb05654618fc4bd8b8aff8 Mon Sep 17 00:00:00 2001 From: naghibza Date: Mon, 18 Aug 2025 17:58:54 +0200 Subject: [PATCH 1/3] correct binauralCoherenceCrossmixGains_fx calculation --- lib_com/options.h | 1 + lib_rend/ivas_reverb_fx.c | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/lib_com/options.h b/lib_com/options.h index e666308ca..9f3339e16 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -83,6 +83,7 @@ #define NONBE_SVD_OPTIMIZATION /* FhG: reduce WMOPS of HouseHolderReduction() in ivas_svd_dec.c() by removing redundant mathematics and using 64 bit additions */ #define FIX_1766_TCX2ACELP_BWE_ISSUE /* VA : Fix rare BWE issue when switching from TCX to ACELP */ +#define FIX_1931_BIN_COHR_CROSS_MIX /* FhG: correct binauralCoherenceCrossmixGains_fx calculation */ /* #################### Start BASOP porting switches ############################ */ #define FIX_1372_ISAR_POST_REND diff --git a/lib_rend/ivas_reverb_fx.c b/lib_rend/ivas_reverb_fx.c index 31141a1ef..fc17d6b96 100644 --- a/lib_rend/ivas_reverb_fx.c +++ b/lib_rend/ivas_reverb_fx.c @@ -249,6 +249,11 @@ static void ivas_binaural_reverb_setReverbTimes_fx( L_tmp = Mpy_32_16_1( output_Fs, tmp ); /*- exp */ binCenterFreq_exp = add( 31, exp ); binCenterFreq_fx = L_shr( L_tmp, 1 ); // divide by 2 +#ifdef FIX_1931_BIN_COHR_CROSS_MIX + norm = norm_l( binCenterFreq_fx ); + binCenterFreq_fx = L_shl( binCenterFreq_fx, norm ); + binCenterFreq_exp = sub(binCenterFreq_exp, norm); +#endif IF( bin == 0 ) { diffuseFieldICC_fx = ONE_IN_Q31; @@ -272,9 +277,12 @@ static void ivas_binaural_reverb_setReverbTimes_fx( /* binCenterFreq / 2700.0f */ L_tmp = Mpy_32_32( binCenterFreq_fx, 795364 /* 1 / 2700 in Q31 */ ); +#ifdef FIX_1931_BIN_COHR_CROSS_MIX + L_tmp = L_shl( L_tmp, binCenterFreq_exp ); /* Q31 */ +#else norm = norm_l( L_tmp ); L_tmp = L_shl( L_tmp, norm ); /* Q31 */ - +#endif /* ( 1.0f - binCenterFreq / 2700.0f ) */ L_tmp = L_sub( ONE_IN_Q31, L_tmp ); /* Q31 */ -- GitLab From 3d4bde14ed7dc8e6887d03a3410462459e6e2e8d Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Mon, 18 Aug 2025 20:42:16 +0200 Subject: [PATCH 2/3] formatting --- lib_rend/ivas_reverb_fx.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib_rend/ivas_reverb_fx.c b/lib_rend/ivas_reverb_fx.c index fc17d6b96..68d377807 100644 --- a/lib_rend/ivas_reverb_fx.c +++ b/lib_rend/ivas_reverb_fx.c @@ -252,7 +252,7 @@ static void ivas_binaural_reverb_setReverbTimes_fx( #ifdef FIX_1931_BIN_COHR_CROSS_MIX norm = norm_l( binCenterFreq_fx ); binCenterFreq_fx = L_shl( binCenterFreq_fx, norm ); - binCenterFreq_exp = sub(binCenterFreq_exp, norm); + binCenterFreq_exp = sub( binCenterFreq_exp, norm ); #endif IF( bin == 0 ) { @@ -1427,11 +1427,11 @@ static ivas_error setup_FDN_branches_fx( * Allocate and initialize FDN reverberation handle *------------------------------------------------------------------------*/ #else -/*------------------------------------------------------------------------- - * ivas_reverb_open_fx() - * - * Allocate and initialize Crend reverberation handle - *------------------------------------------------------------------------*/ + /*------------------------------------------------------------------------- + * ivas_reverb_open_fx() + * + * Allocate and initialize Crend reverberation handle + *------------------------------------------------------------------------*/ #endif ivas_error ivas_reverb_open_fx( REVERB_HANDLE *hReverb, /* i/o: Reverberator handle */ -- GitLab From 25436139f94e566a0b50dc90b009cc78d5e11fa9 Mon Sep 17 00:00:00 2001 From: naghibza Date: Tue, 19 Aug 2025 09:02:28 +0200 Subject: [PATCH 3/3] Apply clang formatting patch. --- lib_rend/ivas_reverb_fx.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib_rend/ivas_reverb_fx.c b/lib_rend/ivas_reverb_fx.c index fc17d6b96..68d377807 100644 --- a/lib_rend/ivas_reverb_fx.c +++ b/lib_rend/ivas_reverb_fx.c @@ -252,7 +252,7 @@ static void ivas_binaural_reverb_setReverbTimes_fx( #ifdef FIX_1931_BIN_COHR_CROSS_MIX norm = norm_l( binCenterFreq_fx ); binCenterFreq_fx = L_shl( binCenterFreq_fx, norm ); - binCenterFreq_exp = sub(binCenterFreq_exp, norm); + binCenterFreq_exp = sub( binCenterFreq_exp, norm ); #endif IF( bin == 0 ) { @@ -1427,11 +1427,11 @@ static ivas_error setup_FDN_branches_fx( * Allocate and initialize FDN reverberation handle *------------------------------------------------------------------------*/ #else -/*------------------------------------------------------------------------- - * ivas_reverb_open_fx() - * - * Allocate and initialize Crend reverberation handle - *------------------------------------------------------------------------*/ + /*------------------------------------------------------------------------- + * ivas_reverb_open_fx() + * + * Allocate and initialize Crend reverberation handle + *------------------------------------------------------------------------*/ #endif ivas_error ivas_reverb_open_fx( REVERB_HANDLE *hReverb, /* i/o: Reverberator handle */ -- GitLab