From ebb8e3f62494e9e017ff5caff23514698e48a4ce Mon Sep 17 00:00:00 2001 From: Charles Kinuthia Date: Thu, 1 Feb 2024 10:29:49 +0100 Subject: [PATCH 1/7] activate reverb for TDREND MC with head-tracking --- lib_com/options.h | 1 + lib_dec/ivas_init_dec.c | 5 ++++- lib_dec/ivas_objectRenderer_internal.c | 10 ++++++++-- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 8f7a89fcf0..a40eec1f4d 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -174,6 +174,7 @@ #define NONBE_FIX_967_ISM_MONO_DMX /* FhG: issue 967: accumulating energies in ISM mono DMX */ #define NONBE_FIX_968_ISM_BRIR_WITH_HEADROTATION_5MS_FIX /* FhG : issue #968: differences between 5ms and 20ms rendering for discrete ISM with BRIR and head rotation*/ #define NONBE_FIX_977_OSBA_GAIN_MISMATCH /* Dlb : issue 977 : Output gain mismatch for different bit rates in OSBA */ +#define NONBE_FIX_MC_TDREND_REVERB /* Eri : activate reverb for TDREND with headtracking */ /* ##################### End NON-BE switches ########################### */ diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index 24ba618a3c..930c2dc03c 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -1990,8 +1990,11 @@ ivas_error ivas_init_decoder( { return error; } - +#ifdef NONBE_FIX_MC_TDREND_REVERB + if ( st_ivas->hIntSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB || st_ivas->hIntSetup.output_config == IVAS_AUDIO_CONFIG_5_1 || st_ivas->hIntSetup.output_config == IVAS_AUDIO_CONFIG_7_1 ) +#else if ( st_ivas->hIntSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) +#endif // DEBUG { #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( ( error = ivas_reverb_open( &st_ivas->hReverb, st_ivas->hHrtfStatistics, st_ivas->hRenderConfig, st_ivas->hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK ) diff --git a/lib_dec/ivas_objectRenderer_internal.c b/lib_dec/ivas_objectRenderer_internal.c index d405df50b0..34dfc159f8 100644 --- a/lib_dec/ivas_objectRenderer_internal.c +++ b/lib_dec/ivas_objectRenderer_internal.c @@ -187,8 +187,11 @@ ivas_error ivas_td_binaural_renderer_sf( { return error; } - +#ifdef NONBE_FIX_MC_TDREND_REVERB + if ( st_ivas->hRenderConfig != NULL && ( st_ivas->hIntSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB || st_ivas->hIntSetup.output_config == IVAS_AUDIO_CONFIG_5_1 || st_ivas->hIntSetup.output_config == IVAS_AUDIO_CONFIG_7_1 ) ) +#else if ( st_ivas->hRenderConfig != NULL && st_ivas->hIntSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) +#endif { if ( ( error = ivas_reverb_process( st_ivas->hReverb, st_ivas->transport_config, 0, tc_local, p_reverb_signal, 0 ) ) != IVAS_ERR_OK ) { @@ -203,8 +206,11 @@ ivas_error ivas_td_binaural_renderer_sf( { return error; } - +#ifdef NONBE_FIX_MC_TDREND_REVERB + if ( st_ivas->hRenderConfig != NULL && ( st_ivas->hIntSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB|| st_ivas->hIntSetup.output_config == IVAS_AUDIO_CONFIG_5_1 || st_ivas->hIntSetup.output_config == IVAS_AUDIO_CONFIG_7_1 )) +#else if ( st_ivas->hRenderConfig != NULL && st_ivas->hIntSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) +#endif { /* add reverb to rendered signals */ v_add( reverb_signal[0], output_f_local[0], output_f_local[0], output_frame ); -- GitLab From 277b493a6fe8b15723488b11d571e6f0d2de83e7 Mon Sep 17 00:00:00 2001 From: Charles Kinuthia Date: Thu, 1 Feb 2024 10:37:37 +0100 Subject: [PATCH 2/7] rename switch --- lib_com/options.h | 2 +- lib_dec/ivas_init_dec.c | 2 +- lib_dec/ivas_objectRenderer_internal.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index a40eec1f4d..0181b1f0ed 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -174,7 +174,7 @@ #define NONBE_FIX_967_ISM_MONO_DMX /* FhG: issue 967: accumulating energies in ISM mono DMX */ #define NONBE_FIX_968_ISM_BRIR_WITH_HEADROTATION_5MS_FIX /* FhG : issue #968: differences between 5ms and 20ms rendering for discrete ISM with BRIR and head rotation*/ #define NONBE_FIX_977_OSBA_GAIN_MISMATCH /* Dlb : issue 977 : Output gain mismatch for different bit rates in OSBA */ -#define NONBE_FIX_MC_TDREND_REVERB /* Eri : activate reverb for TDREND with headtracking */ +#define NONBE_FIX_978_MC_TDREND_REVERB /* Eri : activate reverb for TDREND with headtracking */ /* ##################### End NON-BE switches ########################### */ diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index 930c2dc03c..b3a58b2e81 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -1990,7 +1990,7 @@ ivas_error ivas_init_decoder( { return error; } -#ifdef NONBE_FIX_MC_TDREND_REVERB +#ifdef NONBE_FIX_978_MC_TDREND_REVERB if ( st_ivas->hIntSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB || st_ivas->hIntSetup.output_config == IVAS_AUDIO_CONFIG_5_1 || st_ivas->hIntSetup.output_config == IVAS_AUDIO_CONFIG_7_1 ) #else if ( st_ivas->hIntSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) diff --git a/lib_dec/ivas_objectRenderer_internal.c b/lib_dec/ivas_objectRenderer_internal.c index 34dfc159f8..002d62bed5 100644 --- a/lib_dec/ivas_objectRenderer_internal.c +++ b/lib_dec/ivas_objectRenderer_internal.c @@ -187,7 +187,7 @@ ivas_error ivas_td_binaural_renderer_sf( { return error; } -#ifdef NONBE_FIX_MC_TDREND_REVERB +#ifdef NONBE_FIX_978_MC_TDREND_REVERB if ( st_ivas->hRenderConfig != NULL && ( st_ivas->hIntSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB || st_ivas->hIntSetup.output_config == IVAS_AUDIO_CONFIG_5_1 || st_ivas->hIntSetup.output_config == IVAS_AUDIO_CONFIG_7_1 ) ) #else if ( st_ivas->hRenderConfig != NULL && st_ivas->hIntSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) @@ -206,7 +206,7 @@ ivas_error ivas_td_binaural_renderer_sf( { return error; } -#ifdef NONBE_FIX_MC_TDREND_REVERB +#ifdef NONBE_FIX_978_MC_TDREND_REVERB if ( st_ivas->hRenderConfig != NULL && ( st_ivas->hIntSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB|| st_ivas->hIntSetup.output_config == IVAS_AUDIO_CONFIG_5_1 || st_ivas->hIntSetup.output_config == IVAS_AUDIO_CONFIG_7_1 )) #else if ( st_ivas->hRenderConfig != NULL && st_ivas->hIntSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) -- GitLab From e42f0a62bf270028bc227b1d5f16c8620227d296 Mon Sep 17 00:00:00 2001 From: Charles Kinuthia Date: Mon, 5 Feb 2024 10:46:53 +0100 Subject: [PATCH 3/7] clang-formart --- lib_dec/ivas_objectRenderer_internal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_dec/ivas_objectRenderer_internal.c b/lib_dec/ivas_objectRenderer_internal.c index 002d62bed5..59755f5646 100644 --- a/lib_dec/ivas_objectRenderer_internal.c +++ b/lib_dec/ivas_objectRenderer_internal.c @@ -207,7 +207,7 @@ ivas_error ivas_td_binaural_renderer_sf( return error; } #ifdef NONBE_FIX_978_MC_TDREND_REVERB - if ( st_ivas->hRenderConfig != NULL && ( st_ivas->hIntSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB|| st_ivas->hIntSetup.output_config == IVAS_AUDIO_CONFIG_5_1 || st_ivas->hIntSetup.output_config == IVAS_AUDIO_CONFIG_7_1 )) + if ( st_ivas->hRenderConfig != NULL && ( st_ivas->hIntSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB || st_ivas->hIntSetup.output_config == IVAS_AUDIO_CONFIG_5_1 || st_ivas->hIntSetup.output_config == IVAS_AUDIO_CONFIG_7_1 ) ) #else if ( st_ivas->hRenderConfig != NULL && st_ivas->hIntSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) #endif -- GitLab From 4909bfd4ae2c4960e74950a6bdd6c5d4a041dc06 Mon Sep 17 00:00:00 2001 From: Charles Kinuthia Date: Tue, 6 Feb 2024 12:35:17 +0100 Subject: [PATCH 4/7] fix asan error --- lib_com/options.h | 2 +- lib_dec/ivas_init_dec.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib_com/options.h b/lib_com/options.h index 0181b1f0ed..5569c8d6bd 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -174,7 +174,7 @@ #define NONBE_FIX_967_ISM_MONO_DMX /* FhG: issue 967: accumulating energies in ISM mono DMX */ #define NONBE_FIX_968_ISM_BRIR_WITH_HEADROTATION_5MS_FIX /* FhG : issue #968: differences between 5ms and 20ms rendering for discrete ISM with BRIR and head rotation*/ #define NONBE_FIX_977_OSBA_GAIN_MISMATCH /* Dlb : issue 977 : Output gain mismatch for different bit rates in OSBA */ -#define NONBE_FIX_978_MC_TDREND_REVERB /* Eri : activate reverb for TDREND with headtracking */ +#define NONBE_FIX_978_MC_TDREND_REVERB /* Eri : activate reverb for TDREND with headtracking */ /* ##################### End NON-BE switches ########################### */ diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index b3a58b2e81..c9d3aecf35 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -1231,7 +1231,11 @@ ivas_error ivas_init_decoder( * Allocate and initialize HRTF Statistics handle *--------------------------------------------------------------------*/ +#ifdef NONBE_FIX_978_MC_TDREND_REVERB + if ( st_ivas->hOutSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB || st_ivas->hIntSetup.output_config == IVAS_AUDIO_CONFIG_5_1 || st_ivas->hIntSetup.output_config == IVAS_AUDIO_CONFIG_7_1 ) +#else if ( st_ivas->hOutSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) +#endif { if ( ( error = ivas_HRTF_statistics_init( &st_ivas->hHrtfStatistics, output_Fs ) ) != IVAS_ERR_OK ) { -- GitLab From ff3dd477822c64d28f178c0645862ea8aa2a14c6 Mon Sep 17 00:00:00 2001 From: Charles Kinuthia Date: Tue, 6 Feb 2024 13:36:59 +0100 Subject: [PATCH 5/7] bug fix --- lib_dec/ivas_init_dec.c | 6 +----- lib_dec/ivas_objectRenderer_internal.c | 4 ++-- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index c9d3aecf35..2475ccc0c6 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -1231,11 +1231,7 @@ ivas_error ivas_init_decoder( * Allocate and initialize HRTF Statistics handle *--------------------------------------------------------------------*/ -#ifdef NONBE_FIX_978_MC_TDREND_REVERB - if ( st_ivas->hOutSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB || st_ivas->hIntSetup.output_config == IVAS_AUDIO_CONFIG_5_1 || st_ivas->hIntSetup.output_config == IVAS_AUDIO_CONFIG_7_1 ) -#else if ( st_ivas->hOutSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) -#endif { if ( ( error = ivas_HRTF_statistics_init( &st_ivas->hHrtfStatistics, output_Fs ) ) != IVAS_ERR_OK ) { @@ -1995,7 +1991,7 @@ ivas_error ivas_init_decoder( return error; } #ifdef NONBE_FIX_978_MC_TDREND_REVERB - if ( st_ivas->hIntSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB || st_ivas->hIntSetup.output_config == IVAS_AUDIO_CONFIG_5_1 || st_ivas->hIntSetup.output_config == IVAS_AUDIO_CONFIG_7_1 ) + if ( st_ivas->hOutSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB) #else if ( st_ivas->hIntSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) #endif // DEBUG diff --git a/lib_dec/ivas_objectRenderer_internal.c b/lib_dec/ivas_objectRenderer_internal.c index 59755f5646..4770fc4d6d 100644 --- a/lib_dec/ivas_objectRenderer_internal.c +++ b/lib_dec/ivas_objectRenderer_internal.c @@ -188,7 +188,7 @@ ivas_error ivas_td_binaural_renderer_sf( return error; } #ifdef NONBE_FIX_978_MC_TDREND_REVERB - if ( st_ivas->hRenderConfig != NULL && ( st_ivas->hIntSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB || st_ivas->hIntSetup.output_config == IVAS_AUDIO_CONFIG_5_1 || st_ivas->hIntSetup.output_config == IVAS_AUDIO_CONFIG_7_1 ) ) + if ( st_ivas->hRenderConfig != NULL && st_ivas->hOutSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) #else if ( st_ivas->hRenderConfig != NULL && st_ivas->hIntSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) #endif @@ -207,7 +207,7 @@ ivas_error ivas_td_binaural_renderer_sf( return error; } #ifdef NONBE_FIX_978_MC_TDREND_REVERB - if ( st_ivas->hRenderConfig != NULL && ( st_ivas->hIntSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB || st_ivas->hIntSetup.output_config == IVAS_AUDIO_CONFIG_5_1 || st_ivas->hIntSetup.output_config == IVAS_AUDIO_CONFIG_7_1 ) ) + if ( st_ivas->hRenderConfig != NULL && st_ivas->hOutSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) #else if ( st_ivas->hRenderConfig != NULL && st_ivas->hIntSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) #endif -- GitLab From 6a0190b6afa6162fefada06316a1e5c541bc78e5 Mon Sep 17 00:00:00 2001 From: Charles Kinuthia Date: Tue, 6 Feb 2024 13:39:15 +0100 Subject: [PATCH 6/7] clang-format --- lib_dec/ivas_init_dec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index 2475ccc0c6..73ba3ad68c 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -1991,7 +1991,7 @@ ivas_error ivas_init_decoder( return error; } #ifdef NONBE_FIX_978_MC_TDREND_REVERB - if ( st_ivas->hOutSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB) + if ( st_ivas->hOutSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) #else if ( st_ivas->hIntSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) #endif // DEBUG -- GitLab From 6983d22c488b81724f880f3ee653b2d0c4fb221f Mon Sep 17 00:00:00 2001 From: Charles Kinuthia Date: Thu, 8 Feb 2024 16:49:56 +0100 Subject: [PATCH 7/7] Use hOutSetup.output_config for ism --- lib_dec/ivas_ism_dec.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib_dec/ivas_ism_dec.c b/lib_dec/ivas_ism_dec.c index b2bcf783da..89b1e68316 100644 --- a/lib_dec/ivas_ism_dec.c +++ b/lib_dec/ivas_ism_dec.c @@ -199,7 +199,11 @@ static ivas_error ivas_ism_bitrate_switching_dec( { return error; } +#ifdef NONBE_FIX_978_MC_TDREND_REVERB + if ( st_ivas->hOutSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) +#else if ( st_ivas->hIntSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) +#endif { #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( ( error = ivas_reverb_open( &st_ivas->hReverb, st_ivas->hHrtfStatistics, st_ivas->hRenderConfig, st_ivas->hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK ) -- GitLab