From bedf96372f5f1743cf6690916f104415a63ff2cc Mon Sep 17 00:00:00 2001 From: Serdar Buyuksarac Date: Mon, 24 Jun 2024 10:07:32 +0200 Subject: [PATCH 1/6] Add switch --- lib_com/options.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib_com/options.h b/lib_com/options.h index 8e314ba4f1..015294ed2e 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -164,6 +164,8 @@ #define FIX_1099_JBM_MD_HANDLE_ALLOC /* VA: issue 1099: Limit the allocation of `hJbmMetadata` handle to MASA and OMASA only */ #define FIX_1111_TDM_LSP_BUFFER /* VA: issue 1111: remove unused buffer `tdm_lspQ_PCh[]' */ #define FIX_1101_CLEANING_JBM_CALL /* VA: issue 1101: remove obsolete call of ivas_jbm_dec_tc_buffer_open() */ +#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 BE switches ################################## */ -- GitLab From 949b5630b55f594a27febcf8c78465fdad0e0040 Mon Sep 17 00:00:00 2001 From: Serdar Buyuksarac Date: Mon, 24 Jun 2024 17:13:22 +0200 Subject: [PATCH 2/6] Switch off reverb and modify crend --- lib_rend/ivas_crend.c | 2 ++ lib_rend/lib_rend.c | 12 ++++++++++++ 2 files changed, 14 insertions(+) diff --git a/lib_rend/ivas_crend.c b/lib_rend/ivas_crend.c index bd9fa49571..d3c3c7f693 100644 --- a/lib_rend/ivas_crend.c +++ b/lib_rend/ivas_crend.c @@ -1906,6 +1906,7 @@ ivas_error ivas_rend_crendProcessSubframe( return error; } +#ifndef FIX_1129_EXT_REND_OUTPUT_HIGH if ( pCrend->hCrend[0]->hReverb != NULL ) { if ( ( error = ivas_reverb_process( pCrend->hCrend[pos_idx]->hReverb, inConfig, 1, tc_local, p_pcm_tmp, 0 ) ) != IVAS_ERR_OK ) @@ -1913,6 +1914,7 @@ ivas_error ivas_rend_crendProcessSubframe( return error; } } +#endif for ( ch = 0; ch < nchan_in; ch++ ) { diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 6e3257b6c8..6758109466 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -2552,7 +2552,11 @@ static ivas_error updateSbaPanGains( return error; } +#ifdef FIX_1129_EXT_REND_OUTPUT_HIGH + if ( ( error = ivas_rend_openCrend( &inputSba->crendWrapper, inConfig, outConfig, hRendCfg, hMixconv, hHrtfStatistics, *rendCtx.pOutSampleRate, rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses ) ) != IVAS_ERR_OK ) +#else if ( ( error = ivas_rend_openCrend( &inputSba->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, hMixconv, hHrtfStatistics, *rendCtx.pOutSampleRate, rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses ) ) != IVAS_ERR_OK ) +#endif { return error; } @@ -6755,11 +6759,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: -- GitLab From 394806a55cbf075f879274fc7d5861b4d35a4705 Mon Sep 17 00:00:00 2001 From: Marek Szczerba Date: Fri, 5 Jul 2024 15:51:19 +0200 Subject: [PATCH 3/6] Fix for intermediate rendering format in case of binaural room reverb output --- lib_rend/ivas_crend.c | 2 -- lib_rend/lib_rend.c | 9 +++++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/lib_rend/ivas_crend.c b/lib_rend/ivas_crend.c index d3c3c7f693..bd9fa49571 100644 --- a/lib_rend/ivas_crend.c +++ b/lib_rend/ivas_crend.c @@ -1906,7 +1906,6 @@ ivas_error ivas_rend_crendProcessSubframe( return error; } -#ifndef FIX_1129_EXT_REND_OUTPUT_HIGH if ( pCrend->hCrend[0]->hReverb != NULL ) { if ( ( error = ivas_reverb_process( pCrend->hCrend[pos_idx]->hReverb, inConfig, 1, tc_local, p_pcm_tmp, 0 ) ) != IVAS_ERR_OK ) @@ -1914,7 +1913,6 @@ ivas_error ivas_rend_crendProcessSubframe( return error; } } -#endif for ( ch = 0; ch < nchan_in; ch++ ) { diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 6758109466..4a383ee54d 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -2530,6 +2530,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 ) { if ( ( error = ivas_rend_openCldfbRend( &inputSba->cldfbRendWrapper, inConfig, outConfig, &rendCtx.pSplitRendWrapper->multiBinPoseData, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) @@ -2546,17 +2549,15 @@ 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; } -#ifdef FIX_1129_EXT_REND_OUTPUT_HIGH - if ( ( error = ivas_rend_openCrend( &inputSba->crendWrapper, inConfig, outConfig, hRendCfg, hMixconv, hHrtfStatistics, *rendCtx.pOutSampleRate, rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses ) ) != IVAS_ERR_OK ) -#else if ( ( error = ivas_rend_openCrend( &inputSba->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, hMixconv, hHrtfStatistics, *rendCtx.pOutSampleRate, rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses ) ) != IVAS_ERR_OK ) -#endif { return error; } -- GitLab From c1bdb556ab4a21f4c01555718e67296f05308f96 Mon Sep 17 00:00:00 2001 From: Marek Szczerba Date: Mon, 8 Jul 2024 16:34:26 +0200 Subject: [PATCH 4/6] Additional cleanup --- lib_rend/lib_rend.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 4a383ee54d..52ba461c20 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -947,7 +947,11 @@ static ivas_error initEfap( const float *elevations; int16_t numNonLfeChannels; +#ifdef FIX_1129_EXT_REND_OUTPUT_HIGH + if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) +#else if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR || outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) +#endif { pEfapWrapper->speakerConfig = IVAS_AUDIO_CONFIG_7_1_4; } @@ -1999,9 +2003,14 @@ static ivas_error updateMcPanGains( case IVAS_AUDIO_CONFIG_BINAURAL: case IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED: case IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM: +#ifdef FIX_1129_EXT_REND_OUTPUT_HIGH + case IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB: +#endif break; /* Do nothing */ case IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR: +#ifndef FIX_1129_EXT_REND_OUTPUT_HIGH case IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB: +#endif /* Prepare rendering to intermediate format */ error = updateMcPanGainsForMcOut( inputMc, IVAS_AUDIO_CONFIG_7_1_4 ); break; @@ -6273,10 +6282,15 @@ static ivas_error renderInputMc( switch ( outConfig ) { case IVAS_AUDIO_CONFIG_BINAURAL: +#ifdef FIX_1129_EXT_REND_OUTPUT_HIGH + case IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB: +#endif error = renderMcToBinaural( mcInput, outConfig, outAudio ); break; case IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR: +#ifndef FIX_1129_EXT_REND_OUTPUT_HIGH case IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB: +#endif if ( mcInput->base.inConfig == IVAS_AUDIO_CONFIG_LS_CUSTOM ) { error = renderMcCustomLsToBinauralRoom( mcInput, outConfig, outAudio ); -- GitLab From 36f7240f6e786b0b252a668b8358e2c98fb906ee Mon Sep 17 00:00:00 2001 From: Marek Szczerba Date: Mon, 8 Jul 2024 16:48:27 +0200 Subject: [PATCH 5/6] Reverting previous change --- lib_rend/lib_rend.c | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 52ba461c20..49e8621c40 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -947,11 +947,7 @@ static ivas_error initEfap( const float *elevations; int16_t numNonLfeChannels; -#ifdef FIX_1129_EXT_REND_OUTPUT_HIGH - if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) -#else if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR || outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) -#endif { pEfapWrapper->speakerConfig = IVAS_AUDIO_CONFIG_7_1_4; } @@ -2003,14 +1999,8 @@ static ivas_error updateMcPanGains( case IVAS_AUDIO_CONFIG_BINAURAL: case IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED: case IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM: -#ifdef FIX_1129_EXT_REND_OUTPUT_HIGH - case IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB: -#endif break; /* Do nothing */ case IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR: -#ifndef FIX_1129_EXT_REND_OUTPUT_HIGH - case IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB: -#endif /* Prepare rendering to intermediate format */ error = updateMcPanGainsForMcOut( inputMc, IVAS_AUDIO_CONFIG_7_1_4 ); break; @@ -6282,15 +6272,9 @@ static ivas_error renderInputMc( switch ( outConfig ) { case IVAS_AUDIO_CONFIG_BINAURAL: -#ifdef FIX_1129_EXT_REND_OUTPUT_HIGH - case IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB: -#endif error = renderMcToBinaural( mcInput, outConfig, outAudio ); break; case IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR: -#ifndef FIX_1129_EXT_REND_OUTPUT_HIGH - case IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB: -#endif if ( mcInput->base.inConfig == IVAS_AUDIO_CONFIG_LS_CUSTOM ) { error = renderMcCustomLsToBinauralRoom( mcInput, outConfig, outAudio ); -- GitLab From 9c96307d3b43ebafd4913392bcc26939fa3fcc6b Mon Sep 17 00:00:00 2001 From: Marek Szczerba Date: Tue, 9 Jul 2024 13:49:03 +0200 Subject: [PATCH 6/6] Rendering via 7.1+4 only in case of BINAURAL_ROOM_IR mode --- lib_rend/lib_rend.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 49e8621c40..4a383ee54d 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -2001,6 +2001,7 @@ static ivas_error updateMcPanGains( case IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM: break; /* Do nothing */ case IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR: + case IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB: /* Prepare rendering to intermediate format */ error = updateMcPanGainsForMcOut( inputMc, IVAS_AUDIO_CONFIG_7_1_4 ); break; @@ -6275,6 +6276,7 @@ static ivas_error renderInputMc( error = renderMcToBinaural( mcInput, outConfig, outAudio ); break; case IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR: + case IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB: if ( mcInput->base.inConfig == IVAS_AUDIO_CONFIG_LS_CUSTOM ) { error = renderMcCustomLsToBinauralRoom( mcInput, outConfig, outAudio ); -- GitLab