From 9f73d76fec97023ff03c24537504e4b65173ded0 Mon Sep 17 00:00:00 2001 From: Marek Szczerba Date: Thu, 22 Jun 2023 12:47:00 +0200 Subject: [PATCH 1/3] Fix for erroneous renderer modes switching in case of BINAURAL_ROOM_REVERB output configuration --- lib_dec/ivas_output_config.c | 12 ++++++++++++ lib_rend/lib_rend.c | 4 ++++ 2 files changed, 16 insertions(+) diff --git a/lib_dec/ivas_output_config.c b/lib_dec/ivas_output_config.c index e60a48a10c..f1e7c65a64 100644 --- a/lib_dec/ivas_output_config.c +++ b/lib_dec/ivas_output_config.c @@ -135,7 +135,11 @@ void ivas_renderer_select( else if ( st_ivas->ivas_format == MASA_FORMAT || ( st_ivas->ivas_format == SBA_FORMAT && st_ivas->nchan_transport <= 2 ) ) { *internal_config = output_config; +#ifdef FIX_571_REVERB_NOT_ACTIVATED_ISM + if ( output_config == AUDIO_CONFIG_BINAURAL || output_config == AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) +#else if ( output_config == AUDIO_CONFIG_BINAURAL ) +#endif { *renderer_type = RENDERER_BINAURAL_PARAMETRIC; } @@ -147,7 +151,11 @@ void ivas_renderer_select( else if ( st_ivas->ivas_format == SBA_FORMAT ) { *internal_config = AUDIO_CONFIG_HOA3; +#ifdef FIX_571_REVERB_NOT_ACTIVATED_ISM + if ( output_config == AUDIO_CONFIG_BINAURAL || output_config == AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) +#else if ( output_config == AUDIO_CONFIG_BINAURAL ) +#endif { *renderer_type = RENDERER_BINAURAL_FASTCONV; } @@ -183,7 +191,11 @@ void ivas_renderer_select( if ( st_ivas->mc_mode == MC_MODE_MCMASA ) { *internal_config = output_config; +#ifdef FIX_571_REVERB_NOT_ACTIVATED_ISM + if ( output_config == AUDIO_CONFIG_BINAURAL || output_config == AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) +#else if ( output_config == AUDIO_CONFIG_BINAURAL ) +#endif { *renderer_type = RENDERER_BINAURAL_PARAMETRIC; } diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 4e75d5fea8..d9ab18ebc5 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -2489,7 +2489,11 @@ static ivas_error initMasaDummyDecForBinauralOut( decDummy->mc_mode = MC_MODE_NONE; /* Todo Nokia: This should be also refactored in such way that it is not checked if not in MC mode */ ivas_output_init( &( decDummy->hOutSetup ), output_config ); +#ifdef FIX_571_REVERB_NOT_ACTIVATED_ISM + if ( output_config == AUDIO_CONFIG_BINAURAL || output_config == AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) +#else if ( output_config == AUDIO_CONFIG_BINAURAL ) +#endif { decDummy->renderer_type = RENDERER_BINAURAL_PARAMETRIC; } -- GitLab From cab49d5ed8a6c9a30758310ecbd5a22686e2c64a Mon Sep 17 00:00:00 2001 From: Marek Szczerba Date: Fri, 23 Jun 2023 09:34:54 +0200 Subject: [PATCH 2/3] Fix for erroneous renderer modes switching in case of BINAURAL_ROOM_REVERB output configuration --- lib_rend/ivas_dirac_dec_binaural_functions.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib_rend/ivas_dirac_dec_binaural_functions.c b/lib_rend/ivas_dirac_dec_binaural_functions.c index 1f3ac58318..87bc40298d 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions.c @@ -1379,7 +1379,7 @@ static void ivas_dirac_dec_binaural_process_output( nSlots = st_ivas->hDirAC->subframe_nbslots[subframe]; #ifdef FIX_571_REVERB_NOT_ACTIVATED_ISM - if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC && st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) + if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM || ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC && st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) #else if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM ) #endif @@ -1450,7 +1450,7 @@ static void ivas_dirac_dec_binaural_process_output( } #ifdef FIX_571_REVERB_NOT_ACTIVATED_ISM - if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC && st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) + if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM || ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC && st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) #else if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM ) #endif -- GitLab From 14f026d0aad392c49504be9a7db21f0ce6be13fd Mon Sep 17 00:00:00 2001 From: Marek Szczerba Date: Fri, 23 Jun 2023 14:06:38 +0200 Subject: [PATCH 3/3] Fix for erroneous renderer modes switching in case of BINAURAL_ROOM_REVERB output configuration --- lib_dec/ivas_binRenderer_internal.c | 8 ++++++++ lib_dec/ivas_output_config.c | 16 ++++++++-------- lib_rend/ivas_dirac_dec_binaural_functions.c | 8 -------- lib_rend/ivas_reverb.c | 8 ++++++++ lib_rend/lib_rend.c | 4 ---- 5 files changed, 24 insertions(+), 20 deletions(-) diff --git a/lib_dec/ivas_binRenderer_internal.c b/lib_dec/ivas_binRenderer_internal.c index 5bd09236e0..b3c31a9794 100644 --- a/lib_dec/ivas_binRenderer_internal.c +++ b/lib_dec/ivas_binRenderer_internal.c @@ -723,7 +723,11 @@ ivas_error ivas_binRenderer_open( } /* Allocate memories needed for reverb module */ +#ifdef FIX_571_REVERB_NOT_ACTIVATED_ISM + if ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV && st_ivas->hIntSetup.output_config == AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) +#else if ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM && st_ivas->hIntSetup.output_config == AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) +#endif { if ( ( error = ivas_binaural_reverb_open( &( hBinRenderer->hReverb ), hBinRenderer->conv_band, @@ -731,7 +735,11 @@ ivas_error ivas_binRenderer_open( &( st_ivas->hRenderConfig->roomAcoustics ), st_ivas->hIntSetup.output_config, st_ivas->hDecoderConfig->output_Fs, +#ifdef FIX_571_REVERB_NOT_ACTIVATED_ISM + RENDERER_BINAURAL_FASTCONV, +#else RENDERER_BINAURAL_FASTCONV_ROOM, +#endif st_ivas->hHrtfFastConv, st_ivas->hHrtfParambin ) ) != IVAS_ERR_OK ) { diff --git a/lib_dec/ivas_output_config.c b/lib_dec/ivas_output_config.c index f1e7c65a64..94e22ea419 100644 --- a/lib_dec/ivas_output_config.c +++ b/lib_dec/ivas_output_config.c @@ -82,7 +82,11 @@ void ivas_renderer_select( { if ( st_ivas->ism_mode == ISM_MODE_PARAM ) { +#ifdef FIX_571_REVERB_NOT_ACTIVATED_ISM + if ( output_config == AUDIO_CONFIG_BINAURAL ) +#else if ( output_config == AUDIO_CONFIG_BINAURAL || output_config == AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) +#endif { *renderer_type = RENDERER_BINAURAL_PARAMETRIC; } @@ -135,11 +139,7 @@ void ivas_renderer_select( else if ( st_ivas->ivas_format == MASA_FORMAT || ( st_ivas->ivas_format == SBA_FORMAT && st_ivas->nchan_transport <= 2 ) ) { *internal_config = output_config; -#ifdef FIX_571_REVERB_NOT_ACTIVATED_ISM - if ( output_config == AUDIO_CONFIG_BINAURAL || output_config == AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) -#else if ( output_config == AUDIO_CONFIG_BINAURAL ) -#endif { *renderer_type = RENDERER_BINAURAL_PARAMETRIC; } @@ -191,11 +191,7 @@ void ivas_renderer_select( if ( st_ivas->mc_mode == MC_MODE_MCMASA ) { *internal_config = output_config; -#ifdef FIX_571_REVERB_NOT_ACTIVATED_ISM - if ( output_config == AUDIO_CONFIG_BINAURAL || output_config == AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) -#else if ( output_config == AUDIO_CONFIG_BINAURAL ) -#endif { *renderer_type = RENDERER_BINAURAL_PARAMETRIC; } @@ -207,7 +203,11 @@ void ivas_renderer_select( else { *internal_config = transport_config; +#ifdef FIX_571_REVERB_NOT_ACTIVATED_ISM + if ( output_config == AUDIO_CONFIG_BINAURAL || output_config == AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) +#else if ( output_config == AUDIO_CONFIG_BINAURAL ) +#endif { #ifdef DEBUGGING if ( ( ( ( st_ivas->transport_config == AUDIO_CONFIG_5_1 || st_ivas->transport_config == AUDIO_CONFIG_7_1 ) && ( st_ivas->hDecoderConfig->Opt_Headrotation || st_ivas->hDecoderConfig->Opt_ExternalOrientation ) ) || ( st_ivas->hDecoderConfig->force_rend == FORCE_TD_RENDERER ) ) && ( st_ivas->mc_mode == MC_MODE_MCT || st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) && !( st_ivas->hDecoderConfig->force_rend == FORCE_CLDFB_RENDERER ) ) diff --git a/lib_rend/ivas_dirac_dec_binaural_functions.c b/lib_rend/ivas_dirac_dec_binaural_functions.c index 87bc40298d..4616993f79 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions.c @@ -1378,11 +1378,7 @@ static void ivas_dirac_dec_binaural_process_output( offsetSamples = 0; nSlots = st_ivas->hDirAC->subframe_nbslots[subframe]; -#ifdef FIX_571_REVERB_NOT_ACTIVATED_ISM - if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM || ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC && st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) -#else if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM ) -#endif { /* Process second / room effect part of binaural output when needed */ ivas_binaural_reverb_processSubframe( st_ivas->hDiracDecBin->hReverb, numInChannels, nSlots, inRe, inIm, reverbRe, reverbIm ); @@ -1449,11 +1445,7 @@ static void ivas_dirac_dec_binaural_process_output( } } -#ifdef FIX_571_REVERB_NOT_ACTIVATED_ISM - if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM || ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC && st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) -#else if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM ) -#endif { /* Combine second (reverb) part with the first (HRTF) part to obtain binaural output signal with room effect */ v_add( outSlotRe, reverbRe[chA][slot], outSlotRe, CLDFB_NO_CHANNELS_MAX ); diff --git a/lib_rend/ivas_reverb.c b/lib_rend/ivas_reverb.c index 6374b6812e..cfea5594a1 100644 --- a/lib_rend/ivas_reverb.c +++ b/lib_rend/ivas_reverb.c @@ -1813,7 +1813,11 @@ ivas_error ivas_binaural_reverb_open( set_f( hReverb->preDelayBufferImag[k], 0.0f, hReverb->numBins ); } +#ifdef FIX_571_REVERB_NOT_ACTIVATED_ISM + if ( renderer_type == RENDERER_BINAURAL_FASTCONV ) +#else if ( renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM ) +#endif { if ( !roomAcoustics->override ) { @@ -1900,7 +1904,11 @@ ivas_error ivas_binaural_reverb_open( } else { +#ifdef FIX_571_REVERB_NOT_ACTIVATED_ISM + if (renderer_type == RENDERER_BINAURAL_FASTCONV ) +#else if ( renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM ) +#endif { ivas_binaural_reverb_setReverbTimes( hReverb, sampling_rate, hHrtfFastConv->fastconvReverberationTimes, hHrtfFastConv->fastconvReverberationEneCorrections ); ivas_binaural_reverb_setPreDelay( hReverb, 10 ); diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index d9ab18ebc5..4e75d5fea8 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -2489,11 +2489,7 @@ static ivas_error initMasaDummyDecForBinauralOut( decDummy->mc_mode = MC_MODE_NONE; /* Todo Nokia: This should be also refactored in such way that it is not checked if not in MC mode */ ivas_output_init( &( decDummy->hOutSetup ), output_config ); -#ifdef FIX_571_REVERB_NOT_ACTIVATED_ISM - if ( output_config == AUDIO_CONFIG_BINAURAL || output_config == AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) -#else if ( output_config == AUDIO_CONFIG_BINAURAL ) -#endif { decDummy->renderer_type = RENDERER_BINAURAL_PARAMETRIC; } -- GitLab