From ae505b0ec870620fa1ba7b54bc25f560ffb8fe43 Mon Sep 17 00:00:00 2001 From: Simon Plain Date: Mon, 18 Sep 2023 14:39:42 +0200 Subject: [PATCH] Move HighPass filtering to before ParamUpmix --- lib_com/options.h | 1 + lib_dec/ivas_dec.c | 14 +++++++++++--- lib_dec/ivas_jbm_dec.c | 23 ++++++++++++++++++++++- 3 files changed, 34 insertions(+), 4 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 1a5f05080f..0b031c8773 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -200,6 +200,7 @@ #define NONBE_FIX_738_SBA_BR_SW_ASAN /* FhG: issue 738: fixes bug when switching to an MCT bitrate and previous frame was ACELP */ #define NONBE_CR_FIX_735_SBA_HP20_BRATE_SWITCHING /* VA: Issue 735: Resolve "HP20 filtering bug in SBA/OSBA bitrate switching" */ #define NONBE_FIX_588_UPDATE_FASTCONV_SD /* FhG: issue 588: update FastConv SD HRTFs in CLDFB domain with new conversion method */ +#define NONBE_FIX_802_PARAMUPMIX_HIGHPASS /* Dlb: issue 802: Move HighPass filter operation for ParamUpmix */ /* ##################### End NON-BE switches ########################### */ diff --git a/lib_dec/ivas_dec.c b/lib_dec/ivas_dec.c index 40b93b18e0..681f8d0f16 100644 --- a/lib_dec/ivas_dec.c +++ b/lib_dec/ivas_dec.c @@ -875,9 +875,17 @@ ivas_error ivas_dec( { return error; } - +#ifdef NONBE_FIX_802_PARAMUPMIX_HIGHPASS + for ( n = 0; n < st_ivas->nchan_transport; n++ ) + { + if ( n != LFE_CHANNEL ) + { + hp20( p_output[n], output_frame, st_ivas->mem_hp20_out[n], output_Fs ); + } + } +#endif ivas_mc_paramupmix_dec( st_ivas, p_output ); - +#ifndef NONBE_FIX_802_PARAMUPMIX_HIGHPASS /* HP filtering */ if ( st_ivas->renderer_type != RENDERER_BINAURAL_FASTCONV && st_ivas->renderer_type != RENDERER_BINAURAL_FASTCONV_ROOM ) { @@ -889,7 +897,7 @@ ivas_error ivas_dec( } } } - +#endif if ( st_ivas->transport_config != st_ivas->intern_config && ( st_ivas->intern_config == IVAS_AUDIO_CONFIG_FOA || st_ivas->intern_config == IVAS_AUDIO_CONFIG_HOA2 || st_ivas->intern_config == IVAS_AUDIO_CONFIG_HOA3 ) ) { ivas_mc2sba( st_ivas->hTransSetup, p_output, p_output, output_frame, st_ivas->hIntSetup.ambisonics_order, GAIN_LFE ); diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index 556000b72c..9fefafe800 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -462,6 +462,25 @@ ivas_error ivas_jbm_dec_tc( return error; } +#ifdef NONBE_FIX_802_PARAMUPMIX_HIGHPASS + /* HP filtering */ + for ( n = 0; n < st_ivas->nchan_transport; n++ ) + { + if ( n != LFE_CHANNEL ) + { + hp20( p_output[n], output_frame, st_ivas->mem_hp20_out[n], output_Fs ); + } + } + + /* Rendering */ + if ( ( st_ivas->renderer_type == RENDERER_MC ) && ( output_config == IVAS_AUDIO_CONFIG_MONO || output_config == IVAS_AUDIO_CONFIG_STEREO ) ) + { + if ( output_config == IVAS_AUDIO_CONFIG_MONO || output_config == IVAS_AUDIO_CONFIG_STEREO ) + { + ivas_ls_setup_conversion( st_ivas, audioCfg2channels( IVAS_AUDIO_CONFIG_5_1_2 ), output_frame, p_output, p_output ); + } + } +#else /* Rendering */ if ( st_ivas->renderer_type == RENDERER_MC ) { @@ -478,6 +497,7 @@ ivas_error ivas_jbm_dec_tc( ivas_ls_setup_conversion( st_ivas, audioCfg2channels( IVAS_AUDIO_CONFIG_5_1_2 ), output_frame, p_output, p_output ); } } +#endif } else if ( st_ivas->mc_mode == MC_MODE_PARAMMC ) { @@ -1043,6 +1063,7 @@ ivas_error ivas_jbm_dec_render( { ivas_mc_paramupmix_dec_render( st_ivas, nSamplesAskedLocal, nSamplesRendered, nSamplesAvailableNext, p_tc, p_output ); +#ifndef NONBE_FIX_802_PARAMUPMIX_HIGHPASS /* HP filtering */ #ifdef SPLIT_REND_WITH_HEAD_ROT /*no HPF when rendering is already done*/ @@ -1057,7 +1078,7 @@ ivas_error ivas_jbm_dec_render( } } } - +#endif if ( st_ivas->transport_config != st_ivas->intern_config && ( st_ivas->intern_config == IVAS_AUDIO_CONFIG_FOA || st_ivas->intern_config == IVAS_AUDIO_CONFIG_HOA2 || st_ivas->intern_config == IVAS_AUDIO_CONFIG_HOA3 ) ) { ivas_mc2sba( st_ivas->hTransSetup, p_output, p_output, *nSamplesRendered, st_ivas->hIntSetup.ambisonics_order, GAIN_LFE ); -- GitLab