diff --git a/lib_com/options.h b/lib_com/options.h index 9401a6f974d56ba972b07ee213d3fa4d6bec44b6..c313a39f88e1926b2ecbf092ac8ce70815c30385 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -174,6 +174,7 @@ #define FIX_1152_UNINIT_VAL_IN_ITD_VAD_COMPUTATION /* FhG: fix uninitialized value being used in ITD VAD mid signal computation that does not affect synthesis, but crashes BASOPs */ #define FIX_1157_OBSOLETE_DMX_TABLE /* FhG: remove obsolte ParamMC DMX table ivas_param_mc_dmx_fac_CICP19_4tc[] */ #define FIX_1135_EXT_RENDERER_HANDLES /* VA: issue 1135: Memory usage reduction in external renderer: Allocate only handles that are really needed. */ +#define FIX_1159_SPLIT_RENDERING_CONFIG /* VA: issue 1159: Execute split rendering config only for split rendering outputs. */ /* #################### End BE switches ################################## */ diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index da4bc043921bf7136fa4a75222e6ee2b773e301a..c95d24f0ea586fd3d313c9cfdc4001ff8a2b7f7a 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -2230,10 +2230,17 @@ ivas_error IVAS_DEC_FeedRenderConfig( hRenderConfig->split_rend_config.poseCorrectionMode = ISAR_SPLIT_REND_POSE_CORRECTION_MODE_NONE; } - if ( ( error = isar_split_rend_validate_config( &hRenderConfig->split_rend_config, ( hIvasDec->st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0 ) ) != IVAS_ERR_OK ) +#ifdef FIX_1159_SPLIT_RENDERING_CONFIG + if ( is_split_rendering_enabled( hIvasDec->st_ivas->hDecoderConfig, hRenderConfig ) ) { - return error; +#endif + if ( ( error = isar_split_rend_validate_config( &hRenderConfig->split_rend_config, ( hIvasDec->st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0 ) ) != IVAS_ERR_OK ) + { + return error; + } +#ifdef FIX_1159_SPLIT_RENDERING_CONFIG } +#endif return IVAS_ERR_OK; } diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 15e4c20ab3738962f986efd09cb403b14c235371..5d47e23e3be7079b839e28ab477e51475a9247fc 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -609,7 +609,9 @@ static ivas_error validateOutputSampleRate( /* Otherwise rendering to binaural, support the same set as IVAS decoder */ switch ( sampleRate ) { +#ifndef FIX_1159_SPLIT_RENDERING_CONFIG case 8000: +#endif case 16000: case 32000: case 48000: @@ -2930,7 +2932,7 @@ ivas_error IVAS_REND_Open( { if ( ( hIvasRend->splitRendWrapper = (SPLIT_REND_WRAPPER *) malloc( sizeof( SPLIT_REND_WRAPPER ) ) ) == NULL ) { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Cannot allocate memory for IVAS decoder handle" ); + return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Cannot allocate memory for IVAS renderer handle" ); } isar_init_split_rend_handles( hIvasRend->splitRendWrapper ); @@ -4253,7 +4255,7 @@ ivas_error IVAS_REND_InitConfig( *-------------------------------------------------------------------*/ ivas_error IVAS_REND_GetRenderConfig( - IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS decoder handle */ + IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS renderer handle */ const IVAS_RENDER_CONFIG_HANDLE hRCout /* o : Render configuration handle */ ) { @@ -4316,7 +4318,7 @@ ivas_error IVAS_REND_GetRenderConfig( *-------------------------------------------------------------------*/ ivas_error IVAS_REND_FeedRenderConfig( - IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS decoder handle */ + IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS renderer handle */ const IVAS_RENDER_CONFIG_DATA renderConfig /* i : Render configuration struct */ ) { @@ -4466,10 +4468,17 @@ ivas_error IVAS_REND_FeedRenderConfig( hRenderConfig->split_rend_config.codec = renderConfig.split_rend_config.codec; - if ( ( error = isar_split_rend_validate_config( &hRenderConfig->split_rend_config, ( hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0 ) ) != IVAS_ERR_OK ) +#ifdef FIX_1159_SPLIT_RENDERING_CONFIG + if ( hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { - return error; +#endif + if ( ( error = isar_split_rend_validate_config( &hRenderConfig->split_rend_config, ( hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0 ) ) != IVAS_ERR_OK ) + { + return error; + } +#ifdef FIX_1159_SPLIT_RENDERING_CONFIG } +#endif /* Must re-initialize split rendering config in case renderer config is updated after adding renderer inputs */ /* if its not initialized yet then no need to re-initialize, initialization will happen while adding inputs*/ @@ -7975,7 +7984,7 @@ int32_t IVAS_REND_GetCntFramesLimited( *---------------------------------------------------------------------*/ ivas_error IVAS_REND_GetHrtfHandle( - IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS decoder handle */ + IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS renderer handle */ IVAS_DEC_HRTF_HANDLE **hHrtfTD /* o : HRTF handle */ ) { @@ -7997,7 +8006,7 @@ ivas_error IVAS_REND_GetHrtfHandle( *---------------------------------------------------------------------*/ ivas_error IVAS_REND_GetHrtfCRendHandle( - IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS decoder handle */ + IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS renderer handle */ IVAS_DEC_HRTF_CREND_HANDLE **hSetOfHRTF /* o : Set of HRTF handle */ ) { @@ -8019,7 +8028,7 @@ ivas_error IVAS_REND_GetHrtfCRendHandle( *---------------------------------------------------------------------*/ ivas_error IVAS_REND_GetHrtfFastConvHandle( - IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS decoder handle */ + IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS renderer handle */ IVAS_DEC_HRTF_FASTCONV_HANDLE **hHrtfFastConv /* o : FASTCONV HRTF handle */ ) { @@ -8041,7 +8050,7 @@ ivas_error IVAS_REND_GetHrtfFastConvHandle( *---------------------------------------------------------------------*/ ivas_error IVAS_REND_GetHrtfParamBinHandle( - IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS decoder handle */ + IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS renderer handle */ IVAS_DEC_HRTF_PARAMBIN_HANDLE **hHrtfParambin /* o : Parametric binauralizer HRTF handle */ ) { @@ -8062,7 +8071,7 @@ ivas_error IVAS_REND_GetHrtfParamBinHandle( *---------------------------------------------------------------------*/ ivas_error IVAS_REND_GetHrtfStatisticsHandle( - IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS decoder handle */ + IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS renderer handle */ IVAS_DEC_HRTF_STATISTICS_HANDLE **hHrtfStatistics /* o : HRTF statistics handle */ ) { diff --git a/lib_rend/lib_rend.h b/lib_rend/lib_rend.h index 819d85b1899d7c7678865d0ea9f5e57719847801..299e4ede26fbe5b9992f4a3749a9d204d1dccca1 100644 --- a/lib_rend/lib_rend.h +++ b/lib_rend/lib_rend.h @@ -243,12 +243,12 @@ ivas_error IVAS_REND_InitConfig( ); ivas_error IVAS_REND_GetRenderConfig( - IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS decoder handle */ + IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS renderer handle */ const IVAS_RENDER_CONFIG_HANDLE hRCout /* o : Render configuration handle */ ); ivas_error IVAS_REND_FeedRenderConfig( - IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS decoder handle */ + IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS renderer handle */ const IVAS_RENDER_CONFIG_DATA renderConfig /* i : Render configuration struct */ );