From 66a4d9420c004b9cf307770a81569c3e361ae09e Mon Sep 17 00:00:00 2001 From: Remco Stoutjesdijk Date: Thu, 8 Dec 2022 23:01:21 +0100 Subject: [PATCH 1/2] fix test cases tripping over nonexistant roomAcoustics --- lib_com/options.h | 1 + lib_rend/ivas_binaural_reverb.c | 23 ++++++++++++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/lib_com/options.h b/lib_com/options.h index 9dc8ab44c8..4359d8c0fe 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -153,6 +153,7 @@ #define FIX_ITD_CNG /* Eri Contribution 11: Fix for CNG ITD */ #define FIX_VBR_COMPLEXITY /* Issue 234: fix extremely high complexity numbers for IVAS EVS mode */ #define FIX_ISM_INACTIVE_BITS /* Issue 230: fix bitbudget distribution in inactive frames in ISM format */ +#define FIX_RA_PARAMS_PARAM_BIN_REND /* Issue 103: Digest room acoustics parameters for Parametric Binaural Renderer*/ diff --git a/lib_rend/ivas_binaural_reverb.c b/lib_rend/ivas_binaural_reverb.c index db12954a1e..3ce50cce1d 100644 --- a/lib_rend/ivas_binaural_reverb.c +++ b/lib_rend/ivas_binaural_reverb.c @@ -482,6 +482,27 @@ ivas_error ivas_binaural_reverb_open( } } +#ifdef FIX_RA_PARAMS_PARAM_BIN_REND + if ( ( roomAcoustics ) && ( roomAcoustics->override ) ) + { + ivas_reverb_prepare_cldfb_params( roomAcoustics, output_config, roomAcoustics->use_brir, sampling_rate, t60, ene ); + ivas_binaural_reverb_setReverbTimes( hReverb, sampling_rate, t60, ene ); + ivas_binaural_reverb_setPreDelay( hReverb, (int16_t) roundf( 48000.0f * roomAcoustics->acousticPreDelay / CLDFB_NO_CHANNELS_MAX ) ); + } + else + { + if ( renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM ) + { + ivas_binaural_reverb_setReverbTimes( hReverb, sampling_rate, fastconvReverberationTimes, fastconvReverberationEneCorrections ); + ivas_binaural_reverb_setPreDelay( hReverb, 10 ); + } + else + { + ivas_binaural_reverb_setReverbTimes( hReverb, sampling_rate, parametricReverberationTimes, parametricReverberationEneCorrections ); + ivas_binaural_reverb_setPreDelay( hReverb, 10 ); + } + } +#else if ( renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM ) { if ( !roomAcoustics->override ) @@ -501,7 +522,7 @@ ivas_error ivas_binaural_reverb_open( ivas_binaural_reverb_setReverbTimes( hReverb, sampling_rate, parametricReverberationTimes, parametricReverberationEneCorrections ); ivas_binaural_reverb_setPreDelay( hReverb, 10 ); } - +#endif return IVAS_ERR_OK; } -- GitLab From 214a3f59c07655558ecaa1936111b9d21667e991 Mon Sep 17 00:00:00 2001 From: Remco Stoutjesdijk Date: Wed, 22 Feb 2023 12:18:26 +0100 Subject: [PATCH 2/2] reapply FIX_103_RA_PARAMS_PARAM_BIN_REND since function moved to another file --- lib_rend/ivas_reverb.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/lib_rend/ivas_reverb.c b/lib_rend/ivas_reverb.c index a3d55584b4..f4c098984b 100644 --- a/lib_rend/ivas_reverb.c +++ b/lib_rend/ivas_reverb.c @@ -1884,6 +1884,28 @@ ivas_error ivas_binaural_reverb_open( } } + +#ifdef FIX_103_RA_PARAMS_PARAM_BIN_REND + if ( ( roomAcoustics ) && ( roomAcoustics->override ) ) + { + ivas_reverb_prepare_cldfb_params( roomAcoustics, hHrtfFastConv, output_config, roomAcoustics->use_brir, sampling_rate, t60, ene ); + ivas_binaural_reverb_setReverbTimes( hReverb, sampling_rate, t60, ene ); + ivas_binaural_reverb_setPreDelay( hReverb, (int16_t) roundf( 48000.0f * roomAcoustics->acousticPreDelay / CLDFB_NO_CHANNELS_MAX ) ); + } + else + { + if ( renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM ) + { + ivas_binaural_reverb_setReverbTimes( hReverb, sampling_rate, hHrtfFastConv->fastconvReverberationTimes, hHrtfFastConv->fastconvReverberationEneCorrections ); + ivas_binaural_reverb_setPreDelay( hReverb, 10 ); + } + else + { + ivas_binaural_reverb_setReverbTimes( hReverb, sampling_rate, hHrtfParambin->parametricReverberationTimes, hHrtfParambin->parametricReverberationEneCorrections ); + ivas_binaural_reverb_setPreDelay( hReverb, 10 ); + } + } +#else if ( renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM ) { if ( !roomAcoustics->override ) @@ -1904,6 +1926,7 @@ ivas_error ivas_binaural_reverb_open( ivas_binaural_reverb_setPreDelay( hReverb, 10 ); } +#endif return IVAS_ERR_OK; } -- GitLab