From 75ad8cd9cebb21b03d00f58bf1120ea212c5c6d0 Mon Sep 17 00:00:00 2001 From: Ke Zhao Date: Thu, 6 Jul 2023 14:00:40 +1000 Subject: [PATCH 1/2] Use CLDFB HRTFs of the appropriate SBA order --- lib_com/options.h | 1 + lib_rend/ivas_reverb_utils.c | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/lib_com/options.h b/lib_com/options.h index e4d3a06b58..56f0ee7333 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -160,6 +160,7 @@ #define FIX_575_LOW_OVERLAP_PLC_RECOVERY /* FhG: Issue 575 fix for PLC and transistion to TCX5*/ #define ISM_FB_16k4 /* VA: Issue: 579: change BW from SWB to FB in NxISM conditions to match the EVS codec */ #define FIX_580_PARAMMC_ENER_BURSTS /* FhG: issue 580: energy bursts due to ILD holding when energy relations change too much */ +#define UPDATE_REVERB_UTILS /* Use CLDFB HRTFs of the appropriate SBA order in get_IR_from_filter_taps() */ /* ################## End DEVELOPMENT switches ######################### */ diff --git a/lib_rend/ivas_reverb_utils.c b/lib_rend/ivas_reverb_utils.c index 6ff101bec5..c9d8af5147 100644 --- a/lib_rend/ivas_reverb_utils.c +++ b/lib_rend/ivas_reverb_utils.c @@ -52,7 +52,9 @@ #define FFT_SPECTRUM_SIZE ( 1 + ( RV_FILTER_MAX_FFT_SIZE / 2 ) ) #define N_INITIAL_IGNORED_FRAMES 4 +#ifndef UPDATE_REVERB_UTILS #define NUM_CLDFB_TAPES 7 +#endif /*-----------------------------------------------------------------------------------------* * Local function prototypes @@ -225,7 +227,11 @@ static void get_IR_from_filter_taps( output_sample_idx = 0; /* Assign CLDFB taps */ +#ifdef UPDATE_REVERB_UTILS + if ( input_audio_config == AUDIO_CONFIG_HOA3 ) +#else if ( input_audio_config == AUDIO_CONFIG_FOA || input_audio_config == AUDIO_CONFIG_HOA2 || input_audio_config == AUDIO_CONFIG_HOA3 ) +#endif { for ( band_idx = 0; band_idx < BINAURAL_CONVBANDS; band_idx++ ) { @@ -235,6 +241,28 @@ static void get_IR_from_filter_taps( convolver_state.filter_taps_right_im[band_idx] = hHrtfFastConv->rightHRIRImag_HOA3[band_idx][hrtf_idx]; } } +#ifdef UPDATE_REVERB_UTILS + else if ( input_audio_config == AUDIO_CONFIG_HOA2 ) + { + for ( band_idx = 0; band_idx < BINAURAL_CONVBANDS; band_idx++ ) + { + convolver_state.filter_taps_left_re[band_idx] = hHrtfFastConv->leftHRIRReal_HOA2[band_idx][hrtf_idx]; + convolver_state.filter_taps_left_im[band_idx] = hHrtfFastConv->leftHRIRImag_HOA2[band_idx][hrtf_idx]; + convolver_state.filter_taps_right_re[band_idx] = hHrtfFastConv->rightHRIRReal_HOA2[band_idx][hrtf_idx]; + convolver_state.filter_taps_right_im[band_idx] = hHrtfFastConv->rightHRIRImag_HOA2[band_idx][hrtf_idx]; + } + } + else if ( input_audio_config == AUDIO_CONFIG_FOA ) + { + for ( band_idx = 0; band_idx < BINAURAL_CONVBANDS; band_idx++ ) + { + convolver_state.filter_taps_left_re[band_idx] = hHrtfFastConv->leftHRIRReal_FOA[band_idx][hrtf_idx]; + convolver_state.filter_taps_left_im[band_idx] = hHrtfFastConv->leftHRIRImag_FOA[band_idx][hrtf_idx]; + convolver_state.filter_taps_right_re[band_idx] = hHrtfFastConv->rightHRIRReal_FOA[band_idx][hrtf_idx]; + convolver_state.filter_taps_right_im[band_idx] = hHrtfFastConv->rightHRIRImag_FOA[band_idx][hrtf_idx]; + } + } +#endif else { array_idx = 0; @@ -313,7 +341,11 @@ static void get_IR_from_filter_taps( } } +#ifdef UPDATE_REVERB_UTILS + ivas_cldfb_convolver( &convolver_state, out_CLDFB_real, out_CLDFB_imag, real_buffer_in, imag_buffer_in, BINAURAL_CONVBANDS, BINAURAL_NTAPS ); +#else ivas_cldfb_convolver( &convolver_state, out_CLDFB_real, out_CLDFB_imag, real_buffer_in, imag_buffer_in, BINAURAL_CONVBANDS, NUM_CLDFB_TAPES ); +#endif ppRealBuf[0] = out_CLDFB_real[0]; ppImagBuf[0] = out_CLDFB_imag[0]; -- GitLab From b2842e2ed50fdf3e09d3c28e82a21a9b0a5e6b59 Mon Sep 17 00:00:00 2001 From: Ke Zhao Date: Thu, 6 Jul 2023 14:44:13 +1000 Subject: [PATCH 2/2] Fix clang formatting --- lib_rend/ivas_reverb_utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_rend/ivas_reverb_utils.c b/lib_rend/ivas_reverb_utils.c index c9d8af5147..b821521b68 100644 --- a/lib_rend/ivas_reverb_utils.c +++ b/lib_rend/ivas_reverb_utils.c @@ -53,7 +53,7 @@ #define N_INITIAL_IGNORED_FRAMES 4 #ifndef UPDATE_REVERB_UTILS -#define NUM_CLDFB_TAPES 7 +#define NUM_CLDFB_TAPES 7 #endif /*-----------------------------------------------------------------------------------------* -- GitLab