From 8bbf53dac5c00a2997c584166e5762f90473ec61 Mon Sep 17 00:00:00 2001 From: Devansh Kandpal <43807487+mrkandpal@users.noreply.github.com> Date: Wed, 6 Aug 2025 08:52:35 +0200 Subject: [PATCH 1/7] Added compiler switch and code changes for port --- lib_com/options.h | 2 ++ lib_rend/lib_rend.c | 15 ++++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/lib_com/options.h b/lib_com/options.h index 7611427c6..699374ff2 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -192,6 +192,8 @@ #define FIX_1068_ASAN_IN_MC_2_BINAURAL_ROOM_IR /* issue 1068 : Memory leak in MC to BINAURAL_ROOM decoding with bitrate switching*/ +#define FIX_1129_EXT_REND_OUTPUT_HIGH /* Philips: issue 1129: External renderer BINAURAL_ROOM_REVERB format output level too high compared to internal rendering output */ + /* #################### End BASOP porting switches ############################ */ /* clang-format on */ diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 3fae93971..06853aa7d 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -2538,6 +2538,9 @@ static ivas_error updateSbaPanGains( break; } case IVAS_AUDIO_CONFIG_BINAURAL: +#ifdef FIX_1129_EXT_REND_OUTPUT_HIGH + case IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB: +#endif { if ( hRendCfg->split_rend_config.rendererSelection == ISAR_SPLIT_REND_RENDERER_SELECTION_FASTCONV ) { @@ -2556,7 +2559,9 @@ static ivas_error updateSbaPanGains( } break; case IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR: +#ifndef FIX_1129_EXT_REND_OUTPUT_HIGH case IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB: +#endif if ( ( error = initSbaPanGainsForMcOut( inputSba, IVAS_AUDIO_CONFIG_7_1_4, NULL ) ) != IVAS_ERR_OK ) { return error; @@ -6779,11 +6784,19 @@ static ivas_error renderInputSba( case IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM: error = renderSbaToSplitBinaural( sbaInput, outConfig, outAudio ); break; +#ifdef FIX_1129_EXT_REND_OUTPUT_HIGH + case IVAS_AUDIO_CONFIG_BINAURAL: + case IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB: + error = renderSbaToBinaural( sbaInput, outConfig, outAudio ); + break; + case IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR: +#else case IVAS_AUDIO_CONFIG_BINAURAL: error = renderSbaToBinaural( sbaInput, outConfig, outAudio ); break; case IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR: case IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB: +#endif error = renderSbaToBinauralRoom( sbaInput, outConfig, outAudio ); break; default: @@ -7472,7 +7485,7 @@ static ivas_error getSamplesInternal( &bits, Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, - ( const int16_t )( ( BINAURAL_MAXBANDS * hIvasRend->sampleRateOut ) / 48000 ), + (const int16_t) ( ( BINAURAL_MAXBANDS * hIvasRend->sampleRateOut ) / 48000 ), tmpBinaural, 1, cldfb_in_flag, -- GitLab From 33fa603b82c041bb9dbae1e24def2dab66230a41 Mon Sep 17 00:00:00 2001 From: Devansh Kandpal <43807487+mrkandpal@users.noreply.github.com> Date: Wed, 6 Aug 2025 09:09:46 +0200 Subject: [PATCH 2/7] clang patch --- lib_rend/lib_rend.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 06853aa7d..b754153d0 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -7485,7 +7485,7 @@ static ivas_error getSamplesInternal( &bits, Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, - (const int16_t) ( ( BINAURAL_MAXBANDS * hIvasRend->sampleRateOut ) / 48000 ), + ( const int16_t )( ( BINAURAL_MAXBANDS * hIvasRend->sampleRateOut ) / 48000 ), tmpBinaural, 1, cldfb_in_flag, -- GitLab From 053f2df5dea3ea1f27cfa4f93d21d5170017ebd7 Mon Sep 17 00:00:00 2001 From: Devansh Kandpal <43807487+mrkandpal@users.noreply.github.com> Date: Wed, 6 Aug 2025 09:30:13 +0200 Subject: [PATCH 3/7] MR marked ready, restart pipeline -- GitLab From a1ef21db7596dd0c1ff622c0e29fe93dd6ca9769 Mon Sep 17 00:00:00 2001 From: Devansh Kandpal <43807487+mrkandpal@users.noreply.github.com> Date: Mon, 11 Aug 2025 14:39:04 +0200 Subject: [PATCH 4/7] Pull latest changes and resolve merge conflicts --- lib_com/options.h | 1 - 1 file changed, 1 deletion(-) diff --git a/lib_com/options.h b/lib_com/options.h index f628e1728..dea2e6973 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -193,7 +193,6 @@ #define NONBE_FIX_1070_USAN_SEGFAULT_MC_TO_BIN_BTSW_HEADROT /* fix 1070 USAN: nullptr-with-offset and Segfaults in 7_1_4 to BINAURAL and BINAURAL_ROOM_REVERB decoding with bitrate switching and head rotation*/ #define FIX_1068_ASAN_IN_MC_2_BINAURAL_ROOM_IR /* issue 1068 : Memory leak in MC to BINAURAL_ROOM decoding with bitrate switching*/ - #define FIX_1158_FASTCONV_REVERB_HRTF /* Philips: issue 1158: Rendering with FastConv to BINAURAL_ROOM_REVERB uses BRIR convolution instead of HRTF */ #define FIX_1129_EXT_REND_OUTPUT_HIGH /* Philips: issue 1129: External renderer BINAURAL_ROOM_REVERB format output level too high compared to internal rendering output */ -- GitLab From d5377f982fd8a43a2429ee22d1adf7665b11fb1d Mon Sep 17 00:00:00 2001 From: Devansh Kandpal <43807487+mrkandpal@users.noreply.github.com> Date: Fri, 15 Aug 2025 10:44:21 +0200 Subject: [PATCH 5/7] Cleaned up porting errors --- apps/decoder.c | 2 -- lib_com/options.h | 1 - lib_dec/ivas_output_config.c | 4 ---- 3 files changed, 7 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index 74c93949f..63c9e5744 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -406,7 +406,6 @@ int main( } } -#ifndef FIX_1158_FASTCONV_REVERB_HRTF /*------------------------------------------------------------------------------------------* * Open renderer configuration reader file *------------------------------------------------------------------------------------------*/ @@ -427,7 +426,6 @@ int main( goto cleanup; } } -#endif /*------------------------------------------------------------------------------------------* * Configure the decoder diff --git a/lib_com/options.h b/lib_com/options.h index 270373e85..f5608eb5d 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -191,7 +191,6 @@ #define NONBE_1215_FIX_JBM_MAX_SCALING /* FhG: issue 1215: Fix assert hit in a specific VoIP decoder config. Caused by integer overflow in max scaling calculation. */ #define NONBE_FIX_1070_USAN_SEGFAULT_MC_TO_BIN_BTSW_HEADROT /* fix 1070 USAN: nullptr-with-offset and Segfaults in 7_1_4 to BINAURAL and BINAURAL_ROOM_REVERB decoding with bitrate switching and head rotation*/ #define FIX_1068_ASAN_IN_MC_2_BINAURAL_ROOM_IR /* issue 1068 : Memory leak in MC to BINAURAL_ROOM decoding with bitrate switching*/ -#define FIX_1158_FASTCONV_REVERB_HRTF /* Philips: issue 1158: Rendering with FastConv to BINAURAL_ROOM_REVERB uses BRIR convolution instead of HRTF */ #define FIX_1129_EXT_REND_OUTPUT_HIGH /* Philips: issue 1129: External renderer BINAURAL_ROOM_REVERB format output level too high compared to internal rendering output */ #define NONBE_FIX_MC_LFE_LPF /* Dlb: Adding the LFE LPF filter back for MC content. */ #define NONBE_FIX_1052_SBA_EXT /* Dlb: SBA external output support */ diff --git a/lib_dec/ivas_output_config.c b/lib_dec/ivas_output_config.c index 6aea937ce..3c969b612 100644 --- a/lib_dec/ivas_output_config.c +++ b/lib_dec/ivas_output_config.c @@ -141,11 +141,7 @@ void ivas_renderer_select( { *internal_config = IVAS_AUDIO_CONFIG_HOA3; -#ifdef FIX_1158_FASTCONV_REVERB_HRTF - if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) -#else if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) -#endif { *renderer_type = RENDERER_BINAURAL_FASTCONV; } -- GitLab From 1e107f9cfd3fd20a5cae34f70856193fbc160f19 Mon Sep 17 00:00:00 2001 From: Devansh Kandpal <43807487+mrkandpal@users.noreply.github.com> Date: Fri, 15 Aug 2025 13:07:53 +0200 Subject: [PATCH 6/7] Removed extra code from port --- apps/decoder.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index 262643965..ea31b85df 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -619,14 +619,6 @@ int main( goto cleanup; } -#ifdef FIX_1158_FASTCONV_REVERB_HRTF - if ( ( error = RenderConfigReader_open( arg.renderConfigFilename, &renderConfigReader ) ) != IVAS_ERR_OK ) - { - fprintf( stderr, "\nError: Can't open Renderer configuration file %s \n\n", arg.renderConfigFilename ); - goto cleanup; - } -#endif - if ( RenderConfigReader_read( renderConfigReader, arg.renderConfigFilename, &renderConfig ) != IVAS_ERR_OK ) { fprintf( stderr, "Failed to read renderer configuration from file %s\n\n", arg.renderConfigFilename ); -- GitLab From 59226b818574577342e2aabf81b43ccd4235e6c3 Mon Sep 17 00:00:00 2001 From: Devansh Kandpal <43807487+mrkandpal@users.noreply.github.com> Date: Mon, 25 Aug 2025 10:12:02 +0200 Subject: [PATCH 7/7] restored state of decoder.c and ivas_output_config.c based on ivas-float-update --- apps/decoder.c | 10 ++++++++++ lib_dec/ivas_output_config.c | 4 ++++ 2 files changed, 14 insertions(+) diff --git a/apps/decoder.c b/apps/decoder.c index aeff6f387..59aacd9a9 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -418,6 +418,7 @@ int main( } } +#ifndef FIX_1158_FASTCONV_REVERB_HRTF /*------------------------------------------------------------------------------------------* * Open renderer configuration reader file *------------------------------------------------------------------------------------------*/ @@ -442,6 +443,7 @@ int main( goto cleanup; } } +#endif /*------------------------------------------------------------------------------------------* * Configure the decoder @@ -652,6 +654,14 @@ int main( goto cleanup; } +#ifdef FIX_1158_FASTCONV_REVERB_HRTF + if ( ( error = RenderConfigReader_open( arg.renderConfigFilename, &renderConfigReader ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nError: Can't open Renderer configuration file %s \n\n", arg.renderConfigFilename ); + goto cleanup; + } +#endif + if ( RenderConfigReader_read( renderConfigReader, arg.renderConfigFilename, &renderConfig ) != IVAS_ERR_OK ) { fprintf( stderr, "Failed to read renderer configuration from file %s\n\n", arg.renderConfigFilename ); diff --git a/lib_dec/ivas_output_config.c b/lib_dec/ivas_output_config.c index 3f6134a11..801cc58e6 100644 --- a/lib_dec/ivas_output_config.c +++ b/lib_dec/ivas_output_config.c @@ -141,7 +141,11 @@ void ivas_renderer_select( { *internal_config = IVAS_AUDIO_CONFIG_HOA3; +#ifdef FIX_1158_FASTCONV_REVERB_HRTF + if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) +#else if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) +#endif { *renderer_type = RENDERER_BINAURAL_FASTCONV; } -- GitLab