diff --git a/apps/decoder.c b/apps/decoder.c index 34df9b6827cc0ce4493405efcc00f7ca7ae5c16c..c869a5b50fb7fca7f2788a0e4ab52889d4f7114b 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -697,7 +697,9 @@ int main( #endif goto cleanup; } +#ifndef FIX_587_DEFAULT_REVERB renderConfig.roomAcoustics.override = true; +#endif } /* ISAR frame size is set from command line, not renderer config file. diff --git a/apps/renderer.c b/apps/renderer.c index 59dbb7571a49f3de8e252fc32b5eda5849d9ecb6..3e0dc1b70a366177ed7bd2338ea0a6d9875dec3a 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -1117,7 +1117,9 @@ int main( #endif goto cleanup; } +#ifndef FIX_587_DEFAULT_REVERB renderConfig.roomAcoustics.override = 1; +#endif } /* ISAR frame size is set from command line, not renderer config file. diff --git a/lib_com/common_api_types.h b/lib_com/common_api_types.h index 212af9fed37a1af2f252c66283398029f4b00dfa..f3c818149f953b6dbc400559db14cffa1416d63d 100644 --- a/lib_com/common_api_types.h +++ b/lib_com/common_api_types.h @@ -300,7 +300,9 @@ typedef enum typedef struct _IVAS_ROOM_ACOUSTICS_CONFIG { +#ifndef FIX_587_DEFAULT_REVERB int16_t override; +#endif int16_t nBands; /* Number of frequency bands for which reverb properties are provided, integer, range [2..256] */ float pFc_input[IVAS_CLDFB_NO_CHANNELS_MAX]; /* Center frequencies for which following values are provided: */ float pAcoustic_rt60[IVAS_CLDFB_NO_CHANNELS_MAX]; /* - The room's T60 per center frequency */ diff --git a/lib_com/options.h b/lib_com/options.h index 9077fa821fd00cc2edf0c62e98e0ea75eeff4089..a4f399e73836538f0a6d2a8ca623d55d15eab5ab 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -183,7 +183,7 @@ #define NONBE_1329_FIX_OSBA_CRASH /* FhG: issue 1329: prevent assert when bit budget is low*/ #define NONBE_FIX_1128_OSBA_EXT_OUTPUT_ORDER /* FhG: issue 1128: set output ambisonics order to input order for EXT output */ #define FIX_1138_SBA_EXT_ERROR_PRINTOUT /* VA: issue 1138: Fix SBA EXT output call of audioCfg2channels() */ -#define NONBE_1244_FIX_SWB_BWE_MEMORY /* VA: issue 1244: fix to SWB BWE memory in case of switching from FB coding - pending a review by Huawei */ +#define NONBE_1244_FIX_SWB_BWE_MEMORY /* VA: issue 1244: fix to SWB BWE memory in case of switching from FB coding - pending a review by Huawei */ #define NONBE_FIX_981_PARAMBIN_DEFAULT_EARLY_PART /* Nokia: Set default early part energy correction to unity for BINAURAL_ROOM_REVERB */ #define NONBE_FIX_1174_MCMASA_LBR_LOOP_ERROR /* Nokia: Fix issue 1174 by removing the unnecessary inner loop causing problems. */ #define NONBE_FIX_1097_SBA_DTX_BRATE_SWITCHING_ENC /* FhG: fix out-of-bound errors when switching from SID frame to active frame*/ @@ -207,6 +207,7 @@ #define FIX_1101_CLEANING_JBM_CALL /* VA: issue 1101: remove obsolete call of ivas_jbm_dec_tc_buffer_open() */ #define NONBE_FIX_1337_MISSING_DIRECTIVITY_DISTATT_EXTREND /* Eri: issue 1337: Missing directivity setting and distance attenuation in external renderer IVAS_rend */ #define FIX_1348_OVERFLOW /* FhG: fix BASOP overflow in hq_lr_dec(), brings floating-point code inline with FX */ +#define FIX_587_DEFAULT_REVERB /* Philips: issue 587: inconsistent default reverb parameters across renderers */ /* #################### End BASOP porting switches ############################ */ diff --git a/lib_dec/ivas_binRenderer_internal.c b/lib_dec/ivas_binRenderer_internal.c index 146a029fc43db1884413c3fd4f659431dde722e7..2a3f3a36f6ecc4fbd92dfc926bce1685a1058604 100644 --- a/lib_dec/ivas_binRenderer_internal.c +++ b/lib_dec/ivas_binRenderer_internal.c @@ -1056,6 +1056,9 @@ ivas_error ivas_binRenderer_open( int16_t convBand, chIdx, k; #endif ivas_error error; +#ifdef FIX_587_DEFAULT_REVERB + const IVAS_ROOM_ACOUSTICS_CONFIG_DATA *pRoomAcoustics; +#endif error = IVAS_ERR_OK; @@ -1195,7 +1198,12 @@ ivas_error ivas_binRenderer_open( /* Allocate memories needed for reverb module */ if ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM || ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV && st_ivas->hOutSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) { +#ifdef FIX_587_DEFAULT_REVERB + pRoomAcoustics = ( st_ivas->hOutSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ? &( st_ivas->hRenderConfig->roomAcoustics ) : NULL; + if ( ( error = ivas_binaural_reverb_init( &( hBinRenderer->hReverb ), st_ivas->hHrtfStatistics, hBinRenderer->conv_band, hBinRenderer->timeSlots, pRoomAcoustics, st_ivas->hDecoderConfig->output_Fs, st_ivas->hHrtfFastConv->fastconvReverberationTimes, st_ivas->hHrtfFastConv->fastconvReverberationEneCorrections ) ) != IVAS_ERR_OK ) +#else if ( ( error = ivas_binaural_reverb_init( &( hBinRenderer->hReverb ), st_ivas->hHrtfStatistics, hBinRenderer->conv_band, hBinRenderer->timeSlots, &( st_ivas->hRenderConfig->roomAcoustics ), st_ivas->hDecoderConfig->output_Fs, st_ivas->hHrtfFastConv->fastconvReverberationTimes, st_ivas->hHrtfFastConv->fastconvReverberationEneCorrections ) ) != IVAS_ERR_OK ) +#endif { return error; } diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index fbb413ab1ee35bd0d44d1268bc21c2a7fc42ab3c..ca0907352dc15140e6c0fc5a30088904be7394bd 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -2090,7 +2090,9 @@ static ivas_error copyRendererConfigStruct( break; } #endif +#ifndef FIX_587_DEFAULT_REVERB hRCout->roomAcoustics.override = hRCin->roomAcoustics.override; +#endif hRCout->roomAcoustics.nBands = hRCin->roomAcoustics.nBands; hRCout->roomAcoustics.acousticPreDelay = hRCin->roomAcoustics.acousticPreDelay; hRCout->roomAcoustics.inputPreDelay = hRCin->roomAcoustics.inputPreDelay; @@ -2176,7 +2178,9 @@ ivas_error IVAS_DEC_FeedRenderConfig( hRenderConfig->renderer_type_override = IVAS_RENDER_TYPE_OVERRIDE_CREND; } #endif +#ifndef FIX_587_DEFAULT_REVERB hRenderConfig->roomAcoustics.override = renderConfig.roomAcoustics.override; +#endif hRenderConfig->roomAcoustics.nBands = renderConfig.roomAcoustics.nBands; hRenderConfig->roomAcoustics.acousticPreDelay = renderConfig.roomAcoustics.acousticPreDelay; hRenderConfig->roomAcoustics.inputPreDelay = renderConfig.roomAcoustics.inputPreDelay; diff --git a/lib_rend/ivas_dirac_dec_binaural_functions.c b/lib_rend/ivas_dirac_dec_binaural_functions.c index 9c92a9d3d1d2f844468ca3cb5f5be536ca9edd27..0aab6f6604032ccfb05ccf3381b625515cc8b289 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions.c @@ -154,7 +154,9 @@ ivas_error ivas_dirac_dec_init_binaural_data( ivas_error error; float frequency_axis[CLDFB_NO_CHANNELS_MAX]; int16_t num_poses, pos_idx; - +#ifdef FIX_587_DEFAULT_REVERB + const IVAS_ROOM_ACOUSTICS_CONFIG_DATA *pRoomAcoustics; +#endif num_poses = 1; if ( st_ivas->hSplitBinRend != NULL ) { @@ -235,10 +237,16 @@ ivas_error ivas_dirac_dec_init_binaural_data( if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) { mvr2r( ( *phHrtfParambin )->parametricEarlyPartEneCorrection, hDiracDecBin->earlyPartEneCorrection, nBins ); +#ifdef FIX_587_DEFAULT_REVERB + pRoomAcoustics = NULL; +#endif } else { set_f( hDiracDecBin->earlyPartEneCorrection, 1.0f, CLDFB_NO_CHANNELS_MAX ); +#ifdef FIX_587_DEFAULT_REVERB + pRoomAcoustics = &( st_ivas->hRenderConfig->roomAcoustics ); +#endif } #else mvr2r( ( *phHrtfParambin )->parametricEarlyPartEneCorrection, hDiracDecBin->earlyPartEneCorrection, nBins ); @@ -257,7 +265,11 @@ ivas_error ivas_dirac_dec_init_binaural_data( if ( hDiracDecBin->hReverb == NULL && pos_idx == 0 ) /* open reverb only for the main direction */ { #ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF +#ifdef FIX_587_DEFAULT_REVERB + if ( ( error = ivas_binaural_reverb_init( &hDiracDecBin->hReverb, st_ivas->hHrtfStatistics, nBins, CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES, pRoomAcoustics, output_Fs, ( *phHrtfParambin )->parametricReverberationTimes, ( *phHrtfParambin )->parametricReverberationEneCorrections ) ) != IVAS_ERR_OK ) +#else if ( ( error = ivas_binaural_reverb_init( &hDiracDecBin->hReverb, st_ivas->hHrtfStatistics, nBins, CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES, &( st_ivas->hRenderConfig->roomAcoustics ), output_Fs, ( *phHrtfParambin )->parametricReverberationTimes, ( *phHrtfParambin )->parametricReverberationEneCorrections ) ) != IVAS_ERR_OK ) +#endif #else if ( ( error = ivas_binaural_reverb_init( &hDiracDecBin->hReverb, st_ivas->hHrtfStatistics, nBins, CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES, &( st_ivas->hRenderConfig->roomAcoustics ), output_Fs, st_ivas->hHrtfParambin->parametricReverberationTimes, st_ivas->hHrtfParambin->parametricReverberationEneCorrections ) ) != IVAS_ERR_OK ) #endif diff --git a/lib_rend/ivas_render_config.c b/lib_rend/ivas_render_config.c index 7ab1949702606be23d6aa61c6686b5dd7adfc8c4..6a6ac61307b526a4c74838e431ed24b2add7daf6 100644 --- a/lib_rend/ivas_render_config.c +++ b/lib_rend/ivas_render_config.c @@ -112,7 +112,9 @@ ivas_error ivas_render_config_init_from_rom( #ifdef DEBUGGING ( *hRenderConfig )->renderer_type_override = IVAS_RENDER_TYPE_OVERRIDE_NONE; #endif +#ifndef FIX_587_DEFAULT_REVERB ( *hRenderConfig )->roomAcoustics.override = FALSE; +#endif ( *hRenderConfig )->roomAcoustics.nBands = IVAS_REVERB_DEFAULT_N_BANDS; ( *hRenderConfig )->roomAcoustics.acousticPreDelay = IVAS_REVERB_DEFAULT_PRE_DELAY; ( *hRenderConfig )->roomAcoustics.inputPreDelay = IVAS_REVERB_DEFAULT_INPUT_DELAY; diff --git a/lib_rend/ivas_reverb.c b/lib_rend/ivas_reverb.c index b8afc952073fa7ee016a76150a3bd39f73e60204..5c3a4d645d442f72ef21e07fcc20236c9e6096b6 100644 --- a/lib_rend/ivas_reverb.c +++ b/lib_rend/ivas_reverb.c @@ -1179,7 +1179,9 @@ ivas_error ivas_reverb_open( #ifdef DEBUGGING pState->pConfig.renderer_type_override = hRenderConfig->renderer_type_override; #endif +#ifndef FIX_587_DEFAULT_REVERB pState->pConfig.roomAcoustics.override = hRenderConfig->roomAcoustics.override; +#endif pState->pConfig.roomAcoustics.nBands = hRenderConfig->roomAcoustics.nBands; if ( hRenderConfig->roomAcoustics.use_er == 1 ) @@ -1967,7 +1969,11 @@ ivas_error ivas_binaural_reverb_init( error = IVAS_ERR_OK; +#ifdef FIX_587_DEFAULT_REVERB + if ( roomAcoustics != NULL ) +#else if ( ( roomAcoustics != NULL ) && roomAcoustics->override ) +#endif { revTimes = t60; revEne = ene; diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index d6e301c6d77e16f47efa0de673710109cb337ad1..f89b99cf63301c501eab9e5fab1caefc88bdad9f 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -4167,7 +4167,9 @@ int16_t IVAS_REND_GetRenderConfig( break; } #endif +#ifndef FIX_587_DEFAULT_REVERB hRCout->roomAcoustics.override = hRCin->roomAcoustics.override; +#endif hRCout->roomAcoustics.nBands = hRCin->roomAcoustics.nBands; hRCout->roomAcoustics.acousticPreDelay = hRCin->roomAcoustics.acousticPreDelay; hRCout->roomAcoustics.inputPreDelay = hRCin->roomAcoustics.inputPreDelay; @@ -4227,7 +4229,9 @@ int16_t IVAS_REND_FeedRenderConfig( hRenderConfig->renderer_type_override = renderConfig.renderer_type_override; #endif +#ifndef FIX_587_DEFAULT_REVERB hRenderConfig->roomAcoustics.override = renderConfig.roomAcoustics.override; +#endif hRenderConfig->roomAcoustics.nBands = renderConfig.roomAcoustics.nBands; hRenderConfig->roomAcoustics.acousticPreDelay = renderConfig.roomAcoustics.acousticPreDelay; hRenderConfig->roomAcoustics.inputPreDelay = renderConfig.roomAcoustics.inputPreDelay; @@ -8288,6 +8292,9 @@ static ivas_error ivas_masa_ext_rend_parambin_init( ivas_error error; float frequency_axis[CLDFB_NO_CHANNELS_MAX]; int16_t pos_idx; +#ifdef FIX_587_DEFAULT_REVERB + const IVAS_ROOM_ACOUSTICS_CONFIG_DATA *pRoomAcoustics; +#endif error = IVAS_ERR_OK; @@ -8372,10 +8379,16 @@ static ivas_error ivas_masa_ext_rend_parambin_init( if ( *inputMasa->base.ctx.pOutConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) { mvr2r( ( *phHrtfParambin )->parametricEarlyPartEneCorrection, hDiracDecBin->earlyPartEneCorrection, nBins ); +#ifdef FIX_587_DEFAULT_REVERB + pRoomAcoustics = NULL; +#endif } else { set_f( hDiracDecBin->earlyPartEneCorrection, 1.0f, CLDFB_NO_CHANNELS_MAX ); +#ifdef FIX_587_DEFAULT_REVERB + pRoomAcoustics = &( hRendCfg->roomAcoustics ); +#endif } #else mvr2r( ( *phHrtfParambin )->parametricEarlyPartEneCorrection, hDiracDecBin->earlyPartEneCorrection, nBins ); @@ -8387,7 +8400,11 @@ static ivas_error ivas_masa_ext_rend_parambin_init( if ( hDiracDecBin->hReverb == NULL && pos_idx == 0 ) /* open reverb only for the main direction */ { #ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF +#ifdef FIX_587_DEFAULT_REVERB + if ( ( error = ivas_binaural_reverb_init( &hDiracDecBin->hReverb, hHrtfStatistics, nBins, CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES, pRoomAcoustics, output_Fs, ( *phHrtfParambin )->parametricReverberationTimes, ( *phHrtfParambin )->parametricReverberationEneCorrections ) ) != IVAS_ERR_OK ) +#else if ( ( error = ivas_binaural_reverb_init( &hDiracDecBin->hReverb, hHrtfStatistics, nBins, CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES, &( hRendCfg->roomAcoustics ), output_Fs, ( *phHrtfParambin )->parametricReverberationTimes, ( *phHrtfParambin )->parametricReverberationEneCorrections ) ) != IVAS_ERR_OK ) +#endif #else if ( ( error = ivas_binaural_reverb_init( &hDiracDecBin->hReverb, hHrtfStatistics, nBins, CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES, &( hRendCfg->roomAcoustics ), output_Fs, hHrtfParambin->parametricReverberationTimes, hHrtfParambin->parametricReverberationEneCorrections ) ) != IVAS_ERR_OK ) #endif