From 62eb56afe89da9df036b894f200b4ded0279cfa9 Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Wed, 26 Oct 2022 10:08:52 +0200 Subject: [PATCH] implement SPAR_STEREO_NO_DIRAC to fix #180 --- lib_com/options.h | 1 + lib_dec/ivas_init_dec.c | 7 ++++++- lib_dec/ivas_output_init.c | 6 ++++++ lib_dec/ivas_spar_decoder.c | 7 ++++++- 4 files changed, 19 insertions(+), 2 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 87edfc787e..49c0ef3d90 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -155,6 +155,7 @@ #define FIX_I178_HQ_BUFFER_OVERRUN /* issue 178: Buffer overrun in HQ core decoder -- spectral filling buffer did not account for extended transition frame in IVAS */ #define PRINT_SBA_ORDER /* Issue 179: print-out also the SBA order of IVAS SBA format to stdout */ +#define SPAR_STEREO_NO_DIRAC /* Issue 180: skip DirAC processing channels for stereo output */ /* ################## End DEVELOPMENT switches ######################### */ /* clang-format on */ diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index e3849dfbe0..3250fe05cb 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -790,7 +790,12 @@ ivas_error ivas_init_decoder( return error; } - if ( hDecoderConfig->output_config != AUDIO_CONFIG_FOA ) + if ( hDecoderConfig->output_config != AUDIO_CONFIG_FOA +#ifdef SPAR_STEREO_NO_DIRAC + && st_ivas->hDecoderConfig->output_config != AUDIO_CONFIG_STEREO + && st_ivas->hDecoderConfig->output_config != AUDIO_CONFIG_MONO +#endif + ) { if ( ( error = ivas_dirac_dec_open( st_ivas ) ) != IVAS_ERR_OK ) { diff --git a/lib_dec/ivas_output_init.c b/lib_dec/ivas_output_init.c index 307b29e74a..3b65756ad6 100644 --- a/lib_dec/ivas_output_init.c +++ b/lib_dec/ivas_output_init.c @@ -515,6 +515,12 @@ void ivas_renderer_select( { *internal_config = output_config; } +#ifdef SPAR_STEREO_NO_DIRAC + else if ( output_config == AUDIO_CONFIG_MONO || output_config == AUDIO_CONFIG_STEREO ) + { + *internal_config = AUDIO_CONFIG_FOA; + } +#endif else { *internal_config = AUDIO_CONFIG_HOA3; diff --git a/lib_dec/ivas_spar_decoder.c b/lib_dec/ivas_spar_decoder.c index eea34b31dc..a51e941548 100644 --- a/lib_dec/ivas_spar_decoder.c +++ b/lib_dec/ivas_spar_decoder.c @@ -1146,7 +1146,12 @@ void ivas_spar_dec_upmixer( } } - if ( st_ivas->hDecoderConfig->output_config != AUDIO_CONFIG_FOA ) + if ( st_ivas->hDecoderConfig->output_config != AUDIO_CONFIG_FOA +#ifdef SPAR_STEREO_NO_DIRAC + && st_ivas->hDecoderConfig->output_config != AUDIO_CONFIG_STEREO + && st_ivas->hDecoderConfig->output_config != AUDIO_CONFIG_MONO +#endif + ) { ivas_dirac_dec( st_ivas, output, nchan_internal, cldfb_in_ts_re, cldfb_in_ts_im, i_sf ); } -- GitLab