diff --git a/apps/decoder.c b/apps/decoder.c index b75a280e5a9992fcbb58bd87c9946fc2c0c161b3..f71abb1f349f4638664c33ecea3b80bff574112a 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -570,7 +570,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 2682dd96fa946680554b5dcfcd673d5eaf06725f..a1186da4f66262a270af70a2711f6416cbd3e3bb 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -1203,7 +1203,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 94abc3b85967e021de192e0834378452549c2917..e079a6f752dc0422866d6af4e6e6398176407cb8 100644 --- a/lib_com/common_api_types.h +++ b/lib_com/common_api_types.h @@ -315,7 +315,9 @@ typedef enum typedef struct _IVAS_ROOM_ACOUSTICS_CONFIG { +#ifndef FIX_587_DEFAULT_REVERB Word16 override; +#endif Word16 nBands; /* Number of frequency bands for which reverb properties are provided, integer, range [2..256] */ Word32 pFc_input_fx[IVAS_CLDFB_NO_CHANNELS_MAX]; /*Q16 Center frequencies for which following values are provided: */ Word32 pAcoustic_rt60_fx[IVAS_CLDFB_NO_CHANNELS_MAX]; /*Q26 - The room's T60 per center frequency */ diff --git a/lib_com/options.h b/lib_com/options.h index bd233ffd05d07a863d934d486fd67c6c6dd316d6..1a31c10bcf8d5e1a6c997eccd4df84547294adfd 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -121,6 +121,7 @@ #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 FIX_587_DEFAULT_REVERB /* Philips: issue 587: inconsistent default reverb parameters across renderers */ #define NONBE_FIX_1097_SBA_DTX_BRATE_SWITCHING_ENC /* FhG: fix out-of-bound errors when switching from SID frame to active frame*/ #define NONBE_FIX_1052_SBA_EXT_FIX /* VA: SBA external output support fix - do not overwrite "output_config" parameter */ #define NONBE_1289_STEREO_SW_TO_MONO /* VA: issue 1289: Fix glitch when stereo signal is decoded to mono n TD->DFT switching */ diff --git a/lib_dec/ivas_binRenderer_internal_fx.c b/lib_dec/ivas_binRenderer_internal_fx.c index 4ee8f9f4da109a76feb343746eda6993e43d9afe..5a96048be40768764b72e68a6750b5973c2144a6 100644 --- a/lib_dec/ivas_binRenderer_internal_fx.c +++ b/lib_dec/ivas_binRenderer_internal_fx.c @@ -1193,6 +1193,9 @@ ivas_error ivas_binRenderer_open_fx( Word16 convBand, chIdx, k; #endif ivas_error error; +#ifdef FIX_587_DEFAULT_REVERB + const IVAS_ROOM_ACOUSTICS_CONFIG_DATA *pRoomAcoustics; +#endif error = IVAS_ERR_OK; move32(); @@ -1350,61 +1353,72 @@ ivas_error ivas_binRenderer_open_fx( /* Allocate memories needed for reverb module */ test(); - IF( EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_FASTCONV_ROOM ) || ( EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_FASTCONV ) && EQ_32( st_ivas->hOutSetup.output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) ){ - IF( NE_32( ( 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_fx, st_ivas->hHrtfFastConv->fastconvReverberationEneCorrections_fx ) ), IVAS_ERR_OK ) ){ + IF( EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_FASTCONV_ROOM ) || ( EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_FASTCONV ) && EQ_32( st_ivas->hOutSetup.output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) ) + { +#ifdef FIX_587_DEFAULT_REVERB + pRoomAcoustics = NULL; + IF( EQ_32( st_ivas->hOutSetup.output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) + { + pRoomAcoustics = &( st_ivas->hRenderConfig->roomAcoustics ); + } + IF( NE_32( ( 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_fx, st_ivas->hHrtfFastConv->fastconvReverberationEneCorrections_fx ) ), IVAS_ERR_OK ) ) +#else + IF( NE_32( ( 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_fx, st_ivas->hHrtfFastConv->fastconvReverberationEneCorrections_fx ) ), IVAS_ERR_OK ) ) +#endif + { return error; -} + } /* initialize the dmx matrix */ #ifndef FIX_1053_REVERB_RECONFIGURATION -IF( NE_16( hBinRenderer->nInChannels, HOA3_CHANNELS ) ) -{ - FOR( chIdx = 0; chIdx < BINAURAL_CHANNELS; chIdx++ ) - { - FOR( k = 0; k < hBinRenderer->nInChannels; k++ ) + IF( NE_16( hBinRenderer->nInChannels, HOA3_CHANNELS ) ) { - hBinRenderer->hReverb->dmxmtx_fx[chIdx][k] = dmxmtx_table_fx[chIdx][k]; - move32(); + FOR( chIdx = 0; chIdx < BINAURAL_CHANNELS; chIdx++ ) + { + FOR( k = 0; k < hBinRenderer->nInChannels; k++ ) + { + hBinRenderer->hReverb->dmxmtx_fx[chIdx][k] = dmxmtx_table_fx[chIdx][k]; + move32(); + } + } } - } -} #endif -} -ELSE -{ - hBinRenderer->hReverb = NULL; -} + } + ELSE + { + hBinRenderer->hReverb = NULL; + } -hBinRenderer->hEFAPdata = NULL; + hBinRenderer->hEFAPdata = NULL; -IF( hBinRenderer->hReverb != NULL && NE_16( hBinRenderer->nInChannels, HOA3_CHANNELS ) ) -{ - test(); - test(); - IF( hBinRenderer->hInputSetup->is_loudspeaker_setup == 0 ) + IF( hBinRenderer->hReverb != NULL && NE_16( hBinRenderer->nInChannels, HOA3_CHANNELS ) ) { - FOR( k = 0; k < 11; k++ ) + test(); + test(); + IF( hBinRenderer->hInputSetup->is_loudspeaker_setup == 0 ) { - ivas_dirac_dec_get_response_fx( extract_l( L_shr_r( ls_azimuth_CICP19_fx[k], 22 ) ), extract_l( L_shr_r( ls_elevation_CICP19_fx[k], 22 ) ), hBinRenderer->hReverb->foa_enc_fx[k], 1, Q29 ); - // Q29: hBinRenderer->hReverb->foa_enc_fx[k] + FOR( k = 0; k < 11; k++ ) + { + ivas_dirac_dec_get_response_fx( extract_l( L_shr_r( ls_azimuth_CICP19_fx[k], 22 ) ), extract_l( L_shr_r( ls_elevation_CICP19_fx[k], 22 ) ), hBinRenderer->hReverb->foa_enc_fx[k], 1, Q29 ); + // Q29: hBinRenderer->hReverb->foa_enc_fx[k] + } } - } - ELSE IF( EQ_32( st_ivas->ivas_format, MC_FORMAT ) && ( st_ivas->hDecoderConfig->Opt_Headrotation || st_ivas->hDecoderConfig->Opt_ExternalOrientation ) ) - { - IF( NE_32( ( error = efap_init_data_fx( &( st_ivas->hEFAPdata ), st_ivas->hIntSetup.ls_azimuth_fx, st_ivas->hIntSetup.ls_elevation_fx, st_ivas->hIntSetup.nchan_out_woLFE, EFAP_MODE_EFAP ) ), IVAS_ERR_OK ) ) + ELSE IF( EQ_32( st_ivas->ivas_format, MC_FORMAT ) && ( st_ivas->hDecoderConfig->Opt_Headrotation || st_ivas->hDecoderConfig->Opt_ExternalOrientation ) ) { - return error; - } + IF( NE_32( ( error = efap_init_data_fx( &( st_ivas->hEFAPdata ), st_ivas->hIntSetup.ls_azimuth_fx, st_ivas->hIntSetup.ls_elevation_fx, st_ivas->hIntSetup.nchan_out_woLFE, EFAP_MODE_EFAP ) ), IVAS_ERR_OK ) ) + { + return error; + } - /* Copy handles to bin renderer handle*/ - hBinRenderer->hEFAPdata = st_ivas->hEFAPdata; + /* Copy handles to bin renderer handle*/ + hBinRenderer->hEFAPdata = st_ivas->hEFAPdata; + } } -} -/* Copy the handles to main handle */ -st_ivas->hBinRenderer = hBinRenderer; + /* Copy the handles to main handle */ + st_ivas->hBinRenderer = hBinRenderer; -return error; + return error; } /*------------------------------------------------------------------------- diff --git a/lib_dec/lib_dec_fx.c b/lib_dec/lib_dec_fx.c index 651a8fc8b5584a574bf66976d3eae8e9556c0cfa..94d917e65d6a70d1f8a037ed334f0534d9e367be 100644 --- a/lib_dec/lib_dec_fx.c +++ b/lib_dec/lib_dec_fx.c @@ -2705,7 +2705,9 @@ static ivas_error copyRendererConfigStruct( return IVAS_ERR_UNEXPECTED_NULL_POINTER; } +#ifndef FIX_587_DEFAULT_REVERB hRCout->roomAcoustics.override = hRCin->roomAcoustics.override; +#endif hRCout->roomAcoustics.nBands = hRCin->roomAcoustics.nBands; hRCout->roomAcoustics.acousticPreDelay_fx = hRCin->roomAcoustics.acousticPreDelay_fx; hRCout->roomAcoustics.inputPreDelay_fx = hRCin->roomAcoustics.inputPreDelay_fx; @@ -2791,7 +2793,9 @@ ivas_error IVAS_DEC_FeedRenderConfig( } hRenderConfig = hIvasDec->st_ivas->hRenderConfig; +#ifndef FIX_587_DEFAULT_REVERB hRenderConfig->roomAcoustics.override = renderConfig.roomAcoustics.override; +#endif hRenderConfig->roomAcoustics.nBands = renderConfig.roomAcoustics.nBands; hRenderConfig->roomAcoustics.acousticPreDelay_fx = renderConfig.roomAcoustics.acousticPreDelay_fx; hRenderConfig->roomAcoustics.inputPreDelay_fx = renderConfig.roomAcoustics.inputPreDelay_fx; diff --git a/lib_rend/ivas_dirac_dec_binaural_functions_fx.c b/lib_rend/ivas_dirac_dec_binaural_functions_fx.c index 9a39eaf38bcf2a8dec667851a36630466ae77582..7dacb204b094aeee2cf84ec9471e3d0686ae19e4 100755 --- a/lib_rend/ivas_dirac_dec_binaural_functions_fx.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions_fx.c @@ -180,6 +180,9 @@ ivas_error ivas_dirac_dec_init_binaural_data_fx( ivas_error error; Word16 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 ) @@ -303,10 +306,16 @@ ivas_error ivas_dirac_dec_init_binaural_data_fx( IF( EQ_32( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) ) { Copy32( ( *phHrtfParambin )->parametricEarlyPartEneCorrection_fx, hDiracDecBin->earlyPartEneCorrection_fx, nBins ); +#ifdef FIX_587_DEFAULT_REVERB + pRoomAcoustics = NULL; +#endif } ELSE { set32_fx( hDiracDecBin->earlyPartEneCorrection_fx, ONE_IN_Q28, CLDFB_NO_CHANNELS_MAX ); +#ifdef FIX_587_DEFAULT_REVERB + pRoomAcoustics = &( st_ivas->hRenderConfig->roomAcoustics ); +#endif } #else Copy32( ( *phHrtfParambin )->parametricEarlyPartEneCorrection_fx, hDiracDecBin->earlyPartEneCorrection_fx, nBins ); @@ -329,7 +338,11 @@ ivas_error ivas_dirac_dec_init_binaural_data_fx( { #ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF +#ifdef FIX_587_DEFAULT_REVERB + if ( NE_32( ( error = ivas_binaural_reverb_init( &hDiracDecBin->hReverb, st_ivas->hHrtfStatistics, nBins, CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES, pRoomAcoustics, output_Fs, ( *phHrtfParambin )->parametricReverberationTimes_fx, ( *phHrtfParambin )->parametricReverberationEneCorrections_fx ) ), IVAS_ERR_OK ) ) +#else if ( NE_32( ( 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_fx, ( *phHrtfParambin )->parametricReverberationEneCorrections_fx ) ), 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_fx, st_ivas->hHrtfParambin->parametricReverberationEneCorrections_fx ) ) != IVAS_ERR_OK ) #endif diff --git a/lib_rend/ivas_render_config_fx.c b/lib_rend/ivas_render_config_fx.c index 5871e80ca15e00d3cab4a5b31e10392f0ff7a511..9ce867566be1bd650a4c6f9de2dabfc6a29048f8 100644 --- a/lib_rend/ivas_render_config_fx.c +++ b/lib_rend/ivas_render_config_fx.c @@ -109,8 +109,10 @@ ivas_error ivas_render_config_init_from_rom_fx( { return IVAS_ERROR( IVAS_ERR_UNEXPECTED_NULL_POINTER, "Unexpected null pointer while attempting to fill renderer configuration from ROM" ); } +#ifndef FIX_587_DEFAULT_REVERB ( *hRenderConfig )->roomAcoustics.override = FALSE; move16(); +#endif ( *hRenderConfig )->roomAcoustics.nBands = IVAS_REVERB_DEFAULT_N_BANDS; move16(); ( *hRenderConfig )->roomAcoustics.acousticPreDelay_fx = IVAS_REVERB_DEFAULT_PRE_DELAY_FX; diff --git a/lib_rend/ivas_reverb_fx.c b/lib_rend/ivas_reverb_fx.c index be378babf1132c1965bcb0e9050bd477404c2331..3e9cd47413adfbe8b518ac511f85f0f7ed021f03 100644 --- a/lib_rend/ivas_reverb_fx.c +++ b/lib_rend/ivas_reverb_fx.c @@ -1523,8 +1523,10 @@ ivas_error ivas_reverb_open_fx( /* set reverb acoustic configuration based on renderer config */ +#ifndef FIX_587_DEFAULT_REVERB pState->pConfig.roomAcoustics.override = hRenderConfig->roomAcoustics.override; move16(); +#endif pState->pConfig.roomAcoustics.nBands = hRenderConfig->roomAcoustics.nBands; move16(); @@ -2477,7 +2479,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_fx.c b/lib_rend/lib_rend_fx.c index 14813f619a116fe1eceeb7f871c92d6e73b98c59..d1ba74217f7c31a128c169b18d134b0412f95188 100644 --- a/lib_rend/lib_rend_fx.c +++ b/lib_rend/lib_rend_fx.c @@ -4792,12 +4792,16 @@ Word16 IVAS_REND_GetRenderConfig( } hRCin = hIvasRend->hRendererConfig; +#ifndef FIX_587_DEFAULT_REVERB hRCout->roomAcoustics.override = hRCin->roomAcoustics.override; +#endif hRCout->roomAcoustics.nBands = hRCin->roomAcoustics.nBands; hRCout->roomAcoustics.acousticPreDelay_fx = hRCin->roomAcoustics.acousticPreDelay_fx; hRCout->roomAcoustics.inputPreDelay_fx = hRCin->roomAcoustics.inputPreDelay_fx; Copy( hRCin->directivity_fx, hRCout->directivity_fx, 3 * MAX_NUM_OBJECTS ); +#ifndef FIX_587_DEFAULT_REVERB move16(); +#endif move16(); move32(); move32(); @@ -4856,8 +4860,10 @@ Word16 IVAS_REND_FeedRenderConfig( } hRenderConfig = hIvasRend->hRendererConfig; +#ifndef FIX_587_DEFAULT_REVERB hRenderConfig->roomAcoustics.override = renderConfig.roomAcoustics.override; move16(); +#endif hRenderConfig->roomAcoustics.nBands = renderConfig.roomAcoustics.nBands; move16(); hRenderConfig->roomAcoustics.acousticPreDelay_fx = renderConfig.roomAcoustics.acousticPreDelay_fx; @@ -9808,6 +9814,10 @@ static ivas_error ivas_masa_ext_rend_parambin_init( Word16 tmpFloat_fx; ivas_error error; Word16 frequency_axis_fx[CLDFB_NO_CHANNELS_MAX]; +#ifdef FIX_587_DEFAULT_REVERB + const IVAS_ROOM_ACOUSTICS_CONFIG_DATA *pRoomAcoustics; +#endif + Word16 pos_idx, num_poses; Word16 tmp; Word16 tmp_e; @@ -9934,10 +9944,16 @@ static ivas_error ivas_masa_ext_rend_parambin_init( IF( EQ_32( *inputMasa->base.ctx.pOutConfig, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) ) { Copy32( ( *phHrtfParambin )->parametricEarlyPartEneCorrection_fx, hDiracDecBin->earlyPartEneCorrection_fx, nBins ); +#ifdef FIX_587_DEFAULT_REVERB + pRoomAcoustics = NULL; +#endif } ELSE { set32_fx( hDiracDecBin->earlyPartEneCorrection_fx, ONE_IN_Q28, CLDFB_NO_CHANNELS_MAX ); +#ifdef FIX_587_DEFAULT_REVERB + pRoomAcoustics = &( hRendCfg->roomAcoustics ); +#endif } #else Copy32( ( *phHrtfParambin )->parametricEarlyPartEneCorrection_fx, hDiracDecBin->earlyPartEneCorrection_fx, nBins ); @@ -9951,7 +9967,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 ( NE_32( ( error = ivas_binaural_reverb_init( &hDiracDecBin->hReverb, hHrtfStatistics, nBins, CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES, pRoomAcoustics, output_Fs, ( *phHrtfParambin )->parametricReverberationTimes_fx, ( *phHrtfParambin )->parametricReverberationEneCorrections_fx ) ), IVAS_ERR_OK ) ) +#else if ( NE_32( ( error = ivas_binaural_reverb_init( &hDiracDecBin->hReverb, hHrtfStatistics, nBins, CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES, &( hRendCfg->roomAcoustics ), output_Fs, ( *phHrtfParambin )->parametricReverberationTimes_fx, ( *phHrtfParambin )->parametricReverberationEneCorrections_fx ) ), IVAS_ERR_OK ) ) +#endif #else IF( NE_32( ( error = ivas_binaural_reverb_init( &hDiracDecBin->hReverb, hHrtfStatistics, nBins, CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES, &( hRendCfg->roomAcoustics ), output_Fs, hHrtfParambin->parametricReverberationTimes_fx, hHrtfParambin->parametricReverberationEneCorrections_fx ) ), IVAS_ERR_OK ) ) #endif