diff --git a/lib_com/options.h b/lib_com/options.h index ac4ec92a18b1faf6eec1835c2d57853c27a597c9..bd233ffd05d07a863d934d486fd67c6c6dd316d6 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -86,6 +86,7 @@ #define FIX_1843_IO_QFACTOR_INIT /* FhG: initialize CRend's io_qfactor also in IVAS_rend */ +#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 8d54c39ff5d930c93089e3143c167a6c59f188f9..be378babf1132c1965bcb0e9050bd477404c2331 100644 --- a/lib_rend/ivas_reverb_fx.c +++ b/lib_rend/ivas_reverb_fx.c @@ -236,6 +236,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; @@ -259,9 +264,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 */ @@ -1381,11 +1389,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 */