From 78545b82b34d295b0e957107b7fe117fb4050a4e Mon Sep 17 00:00:00 2001 From: rtyag Date: Tue, 11 Apr 2023 18:03:06 +1000 Subject: [PATCH 1/2] fix for issue 392 --- apps/renderer.c | 4 ++++ lib_com/options.h | 1 + lib_rend/lib_rend.c | 16 ++++++++++++++-- lib_rend/lib_rend.h | 8 ++++++-- 4 files changed, 25 insertions(+), 4 deletions(-) diff --git a/apps/renderer.c b/apps/renderer.c index 7fb3e0e009..00b6c4c82a 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -675,7 +675,11 @@ int main( } /* === Configure === */ +#ifdef FIX_392_LATE_REVERB + if ( ( error = IVAS_REND_InitConfig( hIvasRend, args.outConfig.audioConfig ) ) != IVAS_ERR_OK ) +#else if ( ( error = IVAS_REND_InitConfig( hIvasRend, ( args.outConfig.audioConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM ) || ( args.outConfig.audioConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL ) ) ) != IVAS_ERR_OK ) +#endif { fprintf( stderr, "Error in Renderer Config Init\n" ); exit( -1 ); diff --git a/lib_com/options.h b/lib_com/options.h index c4d0aebd2b..f7073d3d6c 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -159,6 +159,7 @@ #define FIX_389_EXT_REND_PCM_SR /* Nokia: Issue 389: Fix assignment of sample rate with PCM input. */ #define FIX_390_EXT_REND_MASA_META_COPY /* Nokia: Issue 390: Fixes MASA metadata copying to renderer. */ +#define FIX_392_LATE_REVERB /* DLB : Issue 392: keep late reverb by default off when output config is not BINAURAL_ROOM*/ /* ################## End DEVELOPMENT switches ######################### */ /* clang-format on */ diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 5a4d31d313..3307b9f087 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -3657,11 +3657,20 @@ ivas_error IVAS_REND_FeedInputMasaMetadata( *-------------------------------------------------------------------*/ ivas_error IVAS_REND_InitConfig( - IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ + IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ +#ifdef FIX_392_LATE_REVERB + const IVAS_REND_AudioConfig outAudioConfig /* i : output audioConfig */ +#else const bool rendererConfigEnabled /* i : flag indicating if a renderer configuration file was supplied */ +#endif ) { ivas_error error; +#ifdef FIX_392_LATE_REVERB + bool rendererConfigEnabled; + + rendererConfigEnabled = ( outAudioConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM ) || ( outAudioConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL ); +#endif if ( rendererConfigEnabled ) { @@ -3678,8 +3687,11 @@ ivas_error IVAS_REND_InitConfig( { return error; } - +#ifdef FIX_392_LATE_REVERB + if ( ( error = ivas_render_config_init_from_rom( &hIvasRend->hRendererConfig, outAudioConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM ) ) != IVAS_ERR_OK ) +#else if ( ( error = ivas_render_config_init_from_rom( &hIvasRend->hRendererConfig, hIvasRend->rendererConfigEnabled ) ) != IVAS_ERR_OK ) +#endif { return error; } diff --git a/lib_rend/lib_rend.h b/lib_rend/lib_rend.h index 99b33dc381..ec4c05a6d6 100644 --- a/lib_rend/lib_rend.h +++ b/lib_rend/lib_rend.h @@ -228,8 +228,12 @@ ivas_error IVAS_REND_FeedInputMasaMetadata( ); ivas_error IVAS_REND_InitConfig( - IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ - const bool rendererConfigEnabled /* i : flag indicating if a renderer configuration file was supplied */ + IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ +#ifdef FIX_392_LATE_REVERB + const IVAS_REND_AudioConfig outAudioConfig /* i : output audioConfig */ +#else + const bool rendererConfigEnabled /* i : flag indicating if a renderer configuration file was supplied */ +#endif ); int16_t IVAS_REND_GetRenderConfig( -- GitLab From c253d58f924060de64dcb336f720e70f334afcd2 Mon Sep 17 00:00:00 2001 From: rtyag Date: Tue, 11 Apr 2023 18:34:01 +1000 Subject: [PATCH 2/2] fix for issue 392, using BIN type enum for if check --- 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 3307b9f087..3d2420632d 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -3669,7 +3669,7 @@ ivas_error IVAS_REND_InitConfig( #ifdef FIX_392_LATE_REVERB bool rendererConfigEnabled; - rendererConfigEnabled = ( outAudioConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM ) || ( outAudioConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL ); + rendererConfigEnabled = ( getAudioConfigType( outAudioConfig ) == IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL ); #endif if ( rendererConfigEnabled ) -- GitLab