From 802fb9cd53d024f0cb1e550ba0426a22a9b3cdcd Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Tue, 8 Jul 2025 15:11:20 +0200 Subject: [PATCH 01/11] [cleanup] accept FIX_1024_REMOVE_PARAMMC_MIXING_MAT --- lib_com/options.h | 1 - lib_dec/ivas_mc_param_dec_fx.c | 10 ---------- lib_dec/ivas_out_setup_conversion_fx.c | 8 -------- 3 files changed, 19 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index b292f4364..14a9bf919 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -121,7 +121,6 @@ #define FIX_777_COMBI_RENDER_CONFIG_FILE /* Philips: Fix for combined renderer config file support */ #define NONBE_FIX_991_PARAMBIN_BINARY_HRTF /* Nokia: issue #991: fix using of binary file HRTF in ParamBin (to activate when USE_NEW_HRTF_BINARY_FILE_FORMAT and FIX_777_COMBI_RENDER_CONFIG_FILE are on ) */ -#define FIX_1024_REMOVE_PARAMMC_MIXING_MAT /* VA: issue 1024: remove unused function ivas_param_mc_get_mono_stereo_mixing_matrices() */ #define FIX_1741_REVERB_TIMES_Q_FORMAT /* Philips: reverberation times in Q26 format instead of Q31 */ #define NONBE_FIX_1034_DRY_MASA_RATIOS /* Nokia: Fix issue 1034, use of wrong numDir state. */ #define NONBE_FIX_1021_ISM_BRIR_RS_FLUSH /* FhG: issue #1021: fix ISM with JBM and RS renderer flushing*/ diff --git a/lib_dec/ivas_mc_param_dec_fx.c b/lib_dec/ivas_mc_param_dec_fx.c index 1767f5cde..a9cbc0264 100644 --- a/lib_dec/ivas_mc_param_dec_fx.c +++ b/lib_dec/ivas_mc_param_dec_fx.c @@ -3063,16 +3063,6 @@ static void ivas_param_mc_get_mixing_matrices_fx( return; } -#ifndef FIX_1024_REMOVE_PARAMMC_MIXING_MAT - -/*------------------------------------------------------------------------- - * ivas_param_mc_get_mono_stereo_mixing_matrices() - * - * calculate the direct and residual mixing matrices - * for mono and stereo output - *------------------------------------------------------------------------*/ - -#endif /*------------------------------------------------------------------------- * param_mc_update_mixing_matrices() diff --git a/lib_dec/ivas_out_setup_conversion_fx.c b/lib_dec/ivas_out_setup_conversion_fx.c index 5ce1f08f1..596115278 100644 --- a/lib_dec/ivas_out_setup_conversion_fx.c +++ b/lib_dec/ivas_out_setup_conversion_fx.c @@ -1190,11 +1190,7 @@ void ivas_ls_setup_conversion_process_mdct_param_mc_fx( set_zero_fx( cy_fx, MAX_CICP_CHANNELS * MAX_CICP_CHANNELS ); set_zero_fx( Nrqq_fx, MAX_OUTPUT_CHANNELS ); set_zero_fx( target_ch_ener_fx, MAX_OUTPUT_CHANNELS ); -#ifdef FIX_1024_REMOVE_PARAMMC_MIXING_MAT /* Step 1.2, get target channel energies for the transported format, Nrqq calculation */ -#else - /* Step 1.2, get target channel energies for the transported format as in ivas_param_mc_get_mono_stereo_mixing_matrices(), Nrqq calculation */ -#endif ild_q_fx = hParamMC->icld_q_fx + imult1616( bandIdx, hParamMC->hMetadataPMC->ild_mapping_conf->ild_map_size_lfe ); move16(); FOR( chInIdx = 0; chInIdx < nchan_transport_format; chInIdx++ ) @@ -1216,11 +1212,7 @@ void ivas_ls_setup_conversion_process_mdct_param_mc_fx( move32(); } -#ifdef FIX_1024_REMOVE_PARAMMC_MIXING_MAT /* Step 1.3 get target Cy () (with dmx matrix from CICPX to MONO/STEREO saved in hParamMC) */ -#else - /* Step 1.3 get target Cy like in ivas_param_mc_get_mono_stereo_mixing_matrices() (with dmx matrix from CICPX to MONO/STEREO saved in hParamMC) */ -#endif FOR( chOutIdx = 0; chOutIdx < nchan_out; chOutIdx++ ) { FOR( i = 0; i < nchan_transport_format; i++ ) -- GitLab From 528dc61141306ed485003f126c3c15f599b76352 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Tue, 8 Jul 2025 15:11:30 +0200 Subject: [PATCH 02/11] [cleanup] accept FIX_1035_HT_OSBA --- lib_com/options.h | 1 - lib_dec/ivas_binRenderer_internal_fx.c | 4 ---- 2 files changed, 5 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 14a9bf919..a51d49769 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -124,7 +124,6 @@ #define FIX_1741_REVERB_TIMES_Q_FORMAT /* Philips: reverberation times in Q26 format instead of Q31 */ #define NONBE_FIX_1034_DRY_MASA_RATIOS /* Nokia: Fix issue 1034, use of wrong numDir state. */ #define NONBE_FIX_1021_ISM_BRIR_RS_FLUSH /* FhG: issue #1021: fix ISM with JBM and RS renderer flushing*/ -#define FIX_1035_HT_OSBA /* Dlb: issue 1035: Issue with headtracking in OSBA*/ /* #################### End BASOP porting switches ############################ */ diff --git a/lib_dec/ivas_binRenderer_internal_fx.c b/lib_dec/ivas_binRenderer_internal_fx.c index 883977d6f..a1b6bb5ed 100644 --- a/lib_dec/ivas_binRenderer_internal_fx.c +++ b/lib_dec/ivas_binRenderer_internal_fx.c @@ -1204,11 +1204,7 @@ ivas_error ivas_binRenderer_open_fx( hBinRenderer->rotInCldfb = 0; move16(); test(); -#ifdef FIX_1035_HT_OSBA if ( EQ_32( st_ivas->ivas_format, MC_FORMAT ) || EQ_32( st_ivas->ivas_format, SBA_FORMAT ) || EQ_32( st_ivas->ivas_format, SBA_ISM_FORMAT ) ) -#else - if ( EQ_32( st_ivas->ivas_format, MC_FORMAT ) || EQ_32( st_ivas->ivas_format, SBA_FORMAT ) ) -#endif { hBinRenderer->rotInCldfb = 1; move16(); -- GitLab From e29ad661df16322a547600a7ff14bd6933c24ee0 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Tue, 8 Jul 2025 15:11:36 +0200 Subject: [PATCH 03/11] [cleanup] accept NONBE_FIX_1021_ISM_BRIR_RS_FLUSH --- lib_com/ivas_prot_fx.h | 2 -- lib_com/options.h | 1 - lib_dec/ivas_ism_renderer_fx.c | 16 ---------------- lib_dec/ivas_jbm_dec_fx.c | 12 ------------ lib_dec/ivas_osba_dec_fx.c | 4 ---- 5 files changed, 35 deletions(-) diff --git a/lib_com/ivas_prot_fx.h b/lib_com/ivas_prot_fx.h index a34c2297d..e4945bf52 100644 --- a/lib_com/ivas_prot_fx.h +++ b/lib_com/ivas_prot_fx.h @@ -1056,9 +1056,7 @@ ivas_error ivas_ism_renderer_open_fx( void ivas_ism_render_sf_fx( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ -#ifdef NONBE_FIX_1021_ISM_BRIR_RS_FLUSH const RENDERER_TYPE renderer_type, /* i : active renderer type */ -#endif Word32 *output_fx[], /* i/o: core-coder transport channels/object output */ const Word16 n_samples_to_render /* i : output frame length per channel */ ); diff --git a/lib_com/options.h b/lib_com/options.h index a51d49769..b2f1e6b85 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -123,7 +123,6 @@ #define FIX_1741_REVERB_TIMES_Q_FORMAT /* Philips: reverberation times in Q26 format instead of Q31 */ #define NONBE_FIX_1034_DRY_MASA_RATIOS /* Nokia: Fix issue 1034, use of wrong numDir state. */ -#define NONBE_FIX_1021_ISM_BRIR_RS_FLUSH /* FhG: issue #1021: fix ISM with JBM and RS renderer flushing*/ /* #################### End BASOP porting switches ############################ */ diff --git a/lib_dec/ivas_ism_renderer_fx.c b/lib_dec/ivas_ism_renderer_fx.c index 686329eea..44008cf37 100644 --- a/lib_dec/ivas_ism_renderer_fx.c +++ b/lib_dec/ivas_ism_renderer_fx.c @@ -157,9 +157,7 @@ void ivas_ism_renderer_close( *-------------------------------------------------------------------------*/ void ivas_ism_render_sf_fx( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ -#ifdef NONBE_FIX_1021_ISM_BRIR_RS_FLUSH const RENDERER_TYPE renderer_type, /* i : active renderer type */ -#endif Word32 *output_fx[], /* i/o: core-coder transport channels/object output Q11*/ const Word16 n_samples_to_render /* i : output frame length per channel */ ) @@ -197,17 +195,7 @@ void ivas_ism_render_sf_fx( last_sf = add( last_sf, 1 ); } -#ifdef NONBE_FIX_1021_ISM_BRIR_RS_FLUSH num_objects = st_ivas->nchan_ism; -#else - num_objects = st_ivas->nchan_transport; - move16(); - if ( EQ_32( st_ivas->ivas_format, SBA_ISM_FORMAT ) ) - { - num_objects = st_ivas->nchan_ism; - move16(); - } -#endif nchan_out_woLFE = st_ivas->hIntSetup.nchan_out_woLFE; move16(); @@ -336,11 +324,7 @@ void ivas_ism_render_sf_fx( n_samples_rendered_loop = add( n_samples_rendered_loop, n_samples_in_subframe ); /* update rendered subframe and slots info for all cases apart from a following crend call, the update will then happen in the crend call*/ -#ifdef NONBE_FIX_1021_ISM_BRIR_RS_FLUSH if ( NE_16( renderer_type, RENDERER_BINAURAL_MIXER_CONV_ROOM ) ) -#else - if ( NE_16( st_ivas->renderer_type, RENDERER_BINAURAL_MIXER_CONV_ROOM ) ) -#endif { st_ivas->hTcBuffer->subframes_rendered = add( st_ivas->hTcBuffer->subframes_rendered, 1 ); st_ivas->hTcBuffer->slots_rendered = add( st_ivas->hTcBuffer->slots_rendered, st_ivas->hTcBuffer->subframe_nbslots[subframe_idx] ); diff --git a/lib_dec/ivas_jbm_dec_fx.c b/lib_dec/ivas_jbm_dec_fx.c index a4547a483..324c099b6 100644 --- a/lib_dec/ivas_jbm_dec_fx.c +++ b/lib_dec/ivas_jbm_dec_fx.c @@ -1958,11 +1958,7 @@ ivas_error ivas_jbm_dec_render_fx( IF( EQ_32( st_ivas->renderer_type, RENDERER_TD_PANNING ) || EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_MIXER_CONV_ROOM ) ) { /* Convert to CICPxx; used also for ISM->CICP19->binaural_room rendering */ -#ifdef NONBE_FIX_1021_ISM_BRIR_RS_FLUSH ivas_ism_render_sf_fx( st_ivas, st_ivas->renderer_type, p_output_fx, *nSamplesRendered ); -#else - ivas_ism_render_sf_fx( st_ivas, p_output_fx, *nSamplesRendered ); -#endif } ELSE IF( EQ_32( st_ivas->renderer_type, RENDERER_NON_DIEGETIC_DOWNMIX ) ) { @@ -2144,11 +2140,7 @@ ivas_error ivas_jbm_dec_render_fx( } /* render objects */ -#ifdef NONBE_FIX_1021_ISM_BRIR_RS_FLUSH ivas_ism_render_sf_fx( st_ivas, st_ivas->renderer_type, p_output_fx, *nSamplesRendered ); -#else - ivas_ism_render_sf_fx( st_ivas, p_output_fx, *nSamplesRendered ); -#endif /* add already rendered SBA part */ FOR( n = 0; n < nchan_out; n++ ) @@ -2686,11 +2678,7 @@ ivas_error ivas_jbm_dec_flush_renderer_fx( /* Convert to CICPxx; used also for ISM->CICP19->binaural_room rendering */ set16_fx( st_ivas->hIsmRendererData->interpolator_fx, 32767, hTcBuffer->n_samples_granularity ); // 32767=1.0f in Q15 -#ifdef NONBE_FIX_1021_ISM_BRIR_RS_FLUSH ivas_ism_render_sf_fx( st_ivas, renderer_type_old, p_output_fx, hTcBuffer->n_samples_granularity ); -#else - ivas_ism_render_sf_fx( st_ivas, p_output_fx, hTcBuffer->n_samples_granularity ); -#endif st_ivas->hCrendWrapper->p_io_qfactor = &st_ivas->hCrendWrapper->io_qfactor; *st_ivas->hCrendWrapper->p_io_qfactor = 11; diff --git a/lib_dec/ivas_osba_dec_fx.c b/lib_dec/ivas_osba_dec_fx.c index 3491b0491..fc325d893 100644 --- a/lib_dec/ivas_osba_dec_fx.c +++ b/lib_dec/ivas_osba_dec_fx.c @@ -308,11 +308,7 @@ ivas_error ivas_osba_render_sf_fx( IF( NE_32( st_ivas->renderer_type, RENDERER_BINAURAL_FASTCONV_ROOM ) ) { -#ifdef NONBE_FIX_1021_ISM_BRIR_RS_FLUSH ivas_ism_render_sf_fx( st_ivas, st_ivas->renderer_type, p_output_ism, *nSamplesRendered ); -#else - ivas_ism_render_sf_fx( st_ivas, p_output_ism, *nSamplesRendered ); -#endif } FOR( n = 0; n < st_ivas->hDecoderConfig->nchan_out; n++ ) -- GitLab From 6d2d54d0f31a787493cb33006fb4c7bbfb771fe6 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Tue, 8 Jul 2025 15:11:39 +0200 Subject: [PATCH 04/11] [cleanup] accept NONBE_FIX_1034_DRY_MASA_RATIOS --- lib_com/ivas_cnst.h | 4 ---- lib_com/options.h | 1 - lib_enc/ivas_masa_enc_fx.c | 12 ------------ 3 files changed, 17 deletions(-) diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index 6e17c7046..8e5d0d626 100644 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -1286,11 +1286,7 @@ enum #define MASA_RATIO_TOLERANCE 0.1f #define MASA_RATIO_THRESHOLD 0.1f #define MASA_ANGLE_TOLERANCE 0.5f -#ifdef NONBE_FIX_1034_DRY_MASA_RATIOS #define MASA_RATIO_THRESHOLD_FX 32212255 // 0.015 in Q31 -#else -#define MASA_RATIO_THRESHOLD_FX 214748365 // 0.1 in Q31 -#endif #define MASA_RATIO_TOLERANCE_FX 107374182 // 0.1 in Q30 #define MASA_ANGLE_TOLERANCE_FX ONE_IN_Q21 // 0.5 in Q22 #define MASA_LIMIT_NO_BANDS_SUR_COH 8 diff --git a/lib_com/options.h b/lib_com/options.h index b2f1e6b85..05c7dd2c7 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -122,7 +122,6 @@ #define NONBE_FIX_991_PARAMBIN_BINARY_HRTF /* Nokia: issue #991: fix using of binary file HRTF in ParamBin (to activate when USE_NEW_HRTF_BINARY_FILE_FORMAT and FIX_777_COMBI_RENDER_CONFIG_FILE are on ) */ #define FIX_1741_REVERB_TIMES_Q_FORMAT /* Philips: reverberation times in Q26 format instead of Q31 */ -#define NONBE_FIX_1034_DRY_MASA_RATIOS /* Nokia: Fix issue 1034, use of wrong numDir state. */ /* #################### End BASOP porting switches ############################ */ diff --git a/lib_enc/ivas_masa_enc_fx.c b/lib_enc/ivas_masa_enc_fx.c index 57fc30e78..869b41fd2 100644 --- a/lib_enc/ivas_masa_enc_fx.c +++ b/lib_enc/ivas_masa_enc_fx.c @@ -1857,9 +1857,7 @@ void ivas_masa_combine_directions_fx( hMeta->directional_meta[1].energy_ratio_fx[j][i] = 0; // Q30 move16(); move16(); -#ifdef NONBE_FIX_1034_DRY_MASA_RATIOS hMeta->common_meta.diffuse_to_total_ratio_fx[j][i] = L_sub( ONE_IN_Q30, hMeta->directional_meta[0].energy_ratio_fx[j][i] ); // Q30 -#endif IF( computeCoherence ) { @@ -2107,10 +2105,8 @@ static void detect_metadata_composition_fx( { FOR( band = 0; band < MASA_FREQUENCY_BANDS; band++ ) { -#ifdef NONBE_FIX_1034_DRY_MASA_RATIOS hMeta->directional_meta[0].spherical_index[sf][band] = hMeta->directional_meta[1].spherical_index[sf][band]; move16(); -#endif hMeta->directional_meta[0].azimuth_fx[sf][band] = hMeta->directional_meta[1].azimuth_fx[sf][band]; /*q22*/ hMeta->directional_meta[0].elevation_fx[sf][band] = hMeta->directional_meta[1].elevation_fx[sf][band]; /*q22*/ hMeta->directional_meta[0].energy_ratio_fx[sf][band] = hMeta->directional_meta[1].energy_ratio_fx[sf][band]; /*q30*/ @@ -2235,12 +2231,8 @@ static void compensate_energy_ratios_fx( UWord8 numDirs; hMeta = &( hMasa->masaMetadata ); -#ifdef NONBE_FIX_1034_DRY_MASA_RATIOS numDirs = hMasa->config.numberOfDirections; move16(); -#else - numDirs = (UWord8) add( hMeta->descriptive_meta.numberOfDirections, 1 ); -#endif FOR( sf = 0; sf < MAX_PARAM_SPATIAL_SUBFRAMES; sf++ ) { @@ -3149,20 +3141,16 @@ static void copy_masa_metadata_subframe_fx( ) { UWord8 dir; -#ifdef NONBE_FIX_1034_DRY_MASA_RATIOS UWord8 band; -#endif /* directional metadata */ FOR( dir = 0; dir < MASA_MAXIMUM_DIRECTIONS; dir++ ) { -#ifdef NONBE_FIX_1034_DRY_MASA_RATIOS FOR( band = 0; band < MASA_FREQUENCY_BANDS; band++ ) { hMetaTo->directional_meta[dir].spherical_index[sfTo][band] = hMetaFrom->directional_meta[dir].spherical_index[sfFrom][band]; move16(); } -#endif Copy32( hMetaFrom->directional_meta[dir].azimuth_fx[sfFrom], hMetaTo->directional_meta[dir].azimuth_fx[sfTo], MASA_FREQUENCY_BANDS ); // Q22 Copy32( hMetaFrom->directional_meta[dir].elevation_fx[sfFrom], hMetaTo->directional_meta[dir].elevation_fx[sfTo], MASA_FREQUENCY_BANDS ); // Q22 Copy32( hMetaFrom->directional_meta[dir].energy_ratio_fx[sfFrom], hMetaTo->directional_meta[dir].energy_ratio_fx[sfTo], MASA_FREQUENCY_BANDS ); // Q30 -- GitLab From 2cbc3f71f02024e7a585221f4e913823d7a64d2f Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Tue, 8 Jul 2025 15:13:15 +0200 Subject: [PATCH 05/11] formatting --- lib_dec/ivas_ism_renderer_fx.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib_dec/ivas_ism_renderer_fx.c b/lib_dec/ivas_ism_renderer_fx.c index 44008cf37..8d141537d 100644 --- a/lib_dec/ivas_ism_renderer_fx.c +++ b/lib_dec/ivas_ism_renderer_fx.c @@ -156,10 +156,10 @@ void ivas_ism_renderer_close( * Object rendering process *-------------------------------------------------------------------------*/ void ivas_ism_render_sf_fx( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ + Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ const RENDERER_TYPE renderer_type, /* i : active renderer type */ - Word32 *output_fx[], /* i/o: core-coder transport channels/object output Q11*/ - const Word16 n_samples_to_render /* i : output frame length per channel */ + Word32 *output_fx[], /* i/o: core-coder transport channels/object output Q11*/ + const Word16 n_samples_to_render /* i : output frame length per channel */ ) { Word16 i, j, k, j2; -- GitLab From d9b5dca01d023e6888862d635db3c7760ee6bc1d Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Tue, 8 Jul 2025 15:22:54 +0200 Subject: [PATCH 06/11] [cleanup] accept FIX_638_ENERGIE_IAC_ROM_TABLES --- lib_com/options.h | 1 - lib_rend/ivas_hrtf_fx.c | 4 - lib_rend/ivas_objectRenderer_mix_fx.c | 2 - lib_rend/ivas_rom_binaural_crend_head.h | 2 - lib_rend/ivas_rom_binaural_crend_head_fx.c | 2 - lib_rend/ivas_rom_rend.h | 19 -- lib_rend/ivas_rom_rend_fx.c | 340 --------------------- lib_util/hrtf_file_reader.c | 4 - 8 files changed, 374 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 05c7dd2c7..b61f560ad 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -112,7 +112,6 @@ #define USE_NEW_HRTF_BINARY_FILE_FORMAT /* Orange: to activate when decided to change the hrtf binary file format */ #define NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES /* Philips: Use pre-computed HRTF average L/R energies and IAC in all renderers */ -#define FIX_638_ENERGIE_IAC_ROM_TABLES /* Orange: Missing left/right and coherence late reverb tables in binary format*/ #define FIX_WARNING_RENDER_CONFIG /* Orange: fix warning on windows build */ #define FIX_INV_DIFFUSE_WEIGHT /* Orange : Fix error in energy compensation in late binaural */ diff --git a/lib_rend/ivas_hrtf_fx.c b/lib_rend/ivas_hrtf_fx.c index 58dc54b26..7a81b7946 100644 --- a/lib_rend/ivas_hrtf_fx.c +++ b/lib_rend/ivas_hrtf_fx.c @@ -33,11 +33,7 @@ #include #include "options.h" #include "prot_fx.h" -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES #include "ivas_rom_binaural_crend_head.h" -#else -#include "ivas_rom_rend.h" -#endif #include "ivas_prot_rend_fx.h" #include "ivas_error.h" #include "wmc_auto.h" diff --git a/lib_rend/ivas_objectRenderer_mix_fx.c b/lib_rend/ivas_objectRenderer_mix_fx.c index c46ca25db..b267044b1 100644 --- a/lib_rend/ivas_objectRenderer_mix_fx.c +++ b/lib_rend/ivas_objectRenderer_mix_fx.c @@ -38,9 +38,7 @@ #include "ivas_error.h" #include "wmc_auto.h" #include "ivas_rom_rend.h" -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES #include "ivas_rom_binaural_crend_head.h" -#endif #include "ivas_prot_fx.h" /*-------------------------------------------------------------------* diff --git a/lib_rend/ivas_rom_binaural_crend_head.h b/lib_rend/ivas_rom_binaural_crend_head.h index 4f40c2ed7..0a8e3b7c6 100644 --- a/lib_rend/ivas_rom_binaural_crend_head.h +++ b/lib_rend/ivas_rom_binaural_crend_head.h @@ -348,7 +348,6 @@ extern Word32 CRendBin_Combined_BRIR_coeff_im_16kHz_fx[HRTF_LS_CHANNELS][BINAURA extern Word32 CRendBin_Combined_BRIR_coeff_diffuse_re_16kHz_fx[BINAURAL_CHANNELS][2522]; extern Word32 CRendBin_Combined_BRIR_coeff_diffuse_im_16kHz_fx[BINAURAL_CHANNELS][2522]; -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES #ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB extern float defaultHRIR_coherence_48kHz_fx[LR_IAC_LENGTH_NR_FC]; /*Q-27*/ extern float defaultHRIR_left_avg_power_48kHz_fx[LR_IAC_LENGTH_NR_FC]; /*Q-23*/ @@ -374,6 +373,5 @@ extern const Word32 defaultHRIR_coherence_16kHz_fx[LR_IAC_LENGTH_NR_FC]; / extern const Word32 defaultHRIR_left_avg_power_16kHz_fx[LR_IAC_LENGTH_NR_FC]; /*Q-23*/ extern const Word32 defaultHRIR_right_avg_power_16kHz_fx[LR_IAC_LENGTH_NR_FC]; /*Q-23*/ #endif -#endif #endif /* _IVAS_ROM_BINAURAL_CREND_HEAD_ */ diff --git a/lib_rend/ivas_rom_binaural_crend_head_fx.c b/lib_rend/ivas_rom_binaural_crend_head_fx.c index 436ba60f6..bdf8e0252 100644 --- a/lib_rend/ivas_rom_binaural_crend_head_fx.c +++ b/lib_rend/ivas_rom_binaural_crend_head_fx.c @@ -59650,7 +59650,6 @@ const Word32 CRendBin_Combined_BRIR_coeff_diffuse_im_16kHz_fx[BINAURAL_CHANNELS] -6515466, }, }; -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES #ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB /********************** defaultHRIR reverb rom tables at sampling rate 48kHz **********************/ @@ -60184,7 +60183,6 @@ const Word32 defaultHRIR_right_avg_power_16kHz_fx[LR_IAC_LENGTH_NR_FC] /*Q-23*/ }; #endif -#endif Word32 sine_table_Q31 [361] = { diff --git a/lib_rend/ivas_rom_rend.h b/lib_rend/ivas_rom_rend.h index 7cbe76051..6c966e457 100644 --- a/lib_rend/ivas_rom_rend.h +++ b/lib_rend/ivas_rom_rend.h @@ -93,25 +93,6 @@ extern const Word16 HRTF_MODEL_N_CPTS_VAR[HRTF_MODEL_N_SECTIONS]; extern const Word32 SincTable_fx[321]; -#ifndef FIX_638_ENERGIE_IAC_ROM_TABLES -extern const Word32 defaultHRIR_coherence_48kHz_fx[LR_IAC_LENGTH_NR_FC]; /*Q-27*/ -extern const Word32 defaultHRIR_left_avg_power_48kHz_fx[LR_IAC_LENGTH_NR_FC]; /*Q-23*/ -extern const Word32 defaultHRIR_right_avg_power_48kHz_fx[LR_IAC_LENGTH_NR_FC]; /*Q-23*/ - -extern const Word32 defaultHRIR_coherence_32kHz_fx[LR_IAC_LENGTH_NR_FC]; /*Q-27*/ -extern const Word32 defaultHRIR_left_avg_power_32kHz_fx[LR_IAC_LENGTH_NR_FC]; /*Q-23*/ -extern const Word32 defaultHRIR_right_avg_power_32kHz_fx[LR_IAC_LENGTH_NR_FC]; /*Q-23*/ - -#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB -extern float defaultHRIR_coherence_16kHz_fx[LR_IAC_LENGTH_NR_FC_16KHZ]; /*Q-27*/ -extern float defaultHRIR_left_avg_power_16kHz_fx[LR_IAC_LENGTH_NR_FC_16KHZ]; /*Q-23*/ -extern float defaultHRIR_right_avg_power_16kHz_fx[LR_IAC_LENGTH_NR_FC_16KHZ]; /*Q-23*/ -#else -extern const Word32 defaultHRIR_coherence_16kHz_fx[LR_IAC_LENGTH_NR_FC]; /*Q-27*/ -extern const Word32 defaultHRIR_left_avg_power_16kHz_fx[LR_IAC_LENGTH_NR_FC]; /*Q-23*/ -extern const Word32 defaultHRIR_right_avg_power_16kHz_fx[LR_IAC_LENGTH_NR_FC]; /*Q-23*/ -#endif -#endif /*----------------------------------------------------------------------------------* * t-design and SN3D normalization table *----------------------------------------------------------------------------------*/ diff --git a/lib_rend/ivas_rom_rend_fx.c b/lib_rend/ivas_rom_rend_fx.c index 5247b8e77..6589adcf7 100644 --- a/lib_rend/ivas_rom_rend_fx.c +++ b/lib_rend/ivas_rom_rend_fx.c @@ -206,346 +206,6 @@ const Word32 SincTable_fx[321] /*Q31*/ = { 8716980, 8185692, 7649294, 7108665, 6564643, 6017979, 5469361, 4919434, 4368840, 3818118, 3267783, 2718370, 2170290, 1624034, 1079948, 538481, }; -#ifndef FIX_638_ENERGIE_IAC_ROM_TABLES -const Word32 defaultHRIR_coherence_48kHz_fx[LR_IAC_LENGTH_NR_FC] /*Q-27*/ = { - 131936432,125285536,105934832,77097344,45729324,19356880,2523696,0,0, - 0,1602425,4763253,5796595,5698884,5608690,5175704,3880368,2303444, - 1553033,1902670,2661537,3300414,3919560,4475624,4485288,3976468,3688169, - 3682129,3375844,2619661,1976758,1906026,2165066,2186943,1765500,1162325, - 671759,348160,140123,27783,0,0,0,148981,534991, - 939926,1281242,1547798,1665910,1550617,1228897,835102,478486,185757, - 0,0,0,0,4294,124554,284273,410840,479828, - 507343,493652,417417,278367,114890,0,0,0,0, - 0,0,0,0,0,29125,130728,242531,313264, - 326954,282528,204816,121735,46976,0,0,0,0, - 0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,31943,114353,173543, - 205218,205755,176362,128043,69927,20803,0,0,0, - 0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0, - 0,0,3355,38117,83214,127372,170993,215553,257966, - 294607,327222,360643,395137,425738,452447,480096,507208,525462, - 533247,534186,526804,505463,469896,424799,372856,312190,242397, - 168711,95831,28319,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,102810,72074,0, - 226962,443858,219445,0,214882,1013209,77846,0,273535, - 1385798,289239,0,472983,1241648,688671,0,306821,870536, - 792153,0,115695,613375,552574,0,0,434462,205890, - 34762,26709,182938,117843,0 -}; -const Word32 defaultHRIR_left_avg_power_48kHz_fx[LR_IAC_LENGTH_NR_FC] /*Q-23*/ = { - 8209721,8156956,8050127,7984940,7992858,8011649,7974747,7910306,7917252, - 8038476,8174723,8228729,8192717,8124794,8070352,8029995,7989956,7953608, - 7931152,7912210,7870745,7803402,7745101,7727896,7735563,7724331,7693670, - 7672548,7668253,7662666,7647508,7638633,7652147,7680265,7699593,7698955, - 7689828,7687614,7690835,7685852,7667229,7645042,7629506,7617787,7601639, - 7578545,7554822,7537315,7524279,7507108,7481430,7453328,7431803,7415991, - 7395254,7364820,7335141,7319069,7310202,7296948,7280120,7270700,7273946, - 7282989,7288836,7292510,7303600,7327768,7359376,7389357,7418784,7458856, - 7515186,7577119,7632232,7684091,7741771,7803922,7858506,7897295,7924793, - 7950529,7975309,7989134,7983815,7964337,7942418,7920028,7885853,7832460, - 7773178,7719675,7667640,7605540,7531820,7456659,7388182,7322718,7251305, - 7173342,7099371,7039023,6989942,6943645,6900871,6876377,6876200,6891753, - 6912280,6938008,6976184,7027514,7081939,7129159,7169768,7212416,7260113, - 7303961,7334160,7353923,7375390,7399868,7413919,7410756,7397888,7384995, - 7371128,7347783,7311469,7269433,7231533,7198642,7162562,7118413,7073358, - 7038218,7011467,6978885,6936976,6896929,6866243,6838636,6804318,6763793, - 6726715,6699377,6677726,6654422,6630095,6613880,6612001,6619165,6625113, - 6629517,6642997,6668750,6697196,6718344,6734173,6753895,6779589,6802146, - 6813185,6816633,6823486,6836086,6844013,6839567,6830432,6829887,6834652, - 6833897,6825424,6817447,6817430,6823444,6827572,6826137,6824845,6832135, - 6847612,6860472,6863735,6867082,6885344,6912573,6928050,6933679,6949215, - 6980018,7009084,7024486,7037715,7065515,7103221,7130283,7141717,7156523, - 7182804,7191302,7148830,7066479,6973039,6845448,6642997,6369529,6067757, - 5757018,5407708,4989863,4529504,4091224,3695693,3270760,2711684,2000297, - 1252050,651123,273904,89170,20652,2843,209,134,134, - 125,117,92,75,75,75,58,50,50, - 58,50,41,41,50,41,41,41,41, - 41,41,41,41,41,41,41,41,41, - 41,41,41,41,41 -}; -const Word32 defaultHRIR_right_avg_power_48kHz_fx[LR_IAC_LENGTH_NR_FC] /*Q-23*/ = { - 8209721,8156956,8050144,7984965,7992850,8011640,7974756,7910323,7917252, - 8038484,8174707,8228738,8192709,8124794,8070361,8030003,7989948,7953583, - 7931127,7912202,7870737,7803402,7745101,7727896,7735563,7724331,7693679, - 7672548,7668236,7662658,7647491,7638624,7652147,7680265,7699609,7698964, - 7689820,7687597,7690827,7685844,7667229,7645050,7629472,7617779,7601639, - 7578545,7554822,7537315,7524288,7507133,7481447,7453337,7431803,7415982, - 7395229,7364812,7335141,7319077,7310185,7296931,7280120,7270700,7273955, - 7282998,7288836,7292494,7303583,7327776,7359401,7389382,7418776,7458856, - 7515186,7577127,7632241,7684082,7741787,7803939,7858523,7897295,7924793, - 7950529,7975309,7989125,7983824,7964320,7942426,7920062,7885853,7832443, - 7773194,7719675,7667640,7605556,7531829,7456675,7388199,7322726,7251305, - 7173333,7099379,7039032,6989967,6943653,6900880,6876377,6876226,6891753, - 6912271,6937999,6976184,7027514,7081931,7129151,7169768,7212416,7260122, - 7303961,7334160,7353940,7375398,7399868,7413910,7410731,7397871,7384978, - 7371145,7347791,7311477,7269450,7231542,7198633,7162554,7118413,7073358, - 7038218,7011475,6978885,6936976,6896920,6866226,6838628,6804310,6763785, - 6726707,6699369,6677709,6654414,6630095,6613889,6612010,6619148,6625071, - 6629508,6642989,6668750,6697204,6718352,6734190,6753920,6779597,6802146, - 6813210,6816641,6823495,6836095,6844030,6839559,6830457,6829904,6834677, - 6833905,6825416,6817455,6817421,6823428,6827555,6826129,6824837,6832135, - 6847620,6860472,6863735,6867082,6885336,6912582,6928059,6933679,6949232, - 6980026,7009084,7024477,7037706,7065489,7103188,7130275,7141708,7156497, - 7182812,7191285,7148847,7066488,6973047,6845439,6642997,6369529,6067757, - 5757001,5407699,4989863,4529504,4091224,3695702,3270751,2711693,2000297, - 1252050,651123,273904,89170,20652,2843,209,134,134, - 125,117,92,75,75,75,58,50,50, - 58,50,41,41,50,41,41,41,41, - 41,41,41,41,41,41,41,41,41, - 41,41,41,41,41 -}; -const Word32 defaultHRIR_coherence_32kHz_fx[LR_IAC_LENGTH_NR_FC] /*Q-27*/ = { - 131125216,129227112,119736576,105149792,87165424,65548180,45102524,26414452,12630962, - 2261837,646258,0,0,0,362790,1269699,3305916,5226035, - 5552185,5544266,5313545,5242007,4972498,4406099,3304843,2138491,1245809, - 945832,1040724,1586856,2087488,2519669,2930509,3330210,3706959,3852988, - 3845069,3506438,3230889,3049963,3020838,2972117,2692944,2226269,1634369, - 1306206,1176284,1344056,1533169,1651817,1468073,1147695,736184,393929, - 141465,23622,0,0,0,0,0,0,0, - 0,0,31004,186025,403995,663840,869999,1052669,1200174, - 1230910,1195208,1010927,774704,504121,258100,82812,13824,0, - 0,0,0,0,0,0,0,0,0, - 0,35567,94757,127104,150189,159048,139586,103616,29662, - 0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0, - 0,13287,46305,75833,95294,77980,44426,0,0, - 0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,13153,45768,78383,106434, - 117574,114487,101871,68719,36641,6039,0,0,0, - 0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,1476, - 5234,21072,40667,63619,89120,116098,144015,171932,199715, - 227901,255818,281723,304405,324941,341584,357824,373796,388962, - 403995,419296,437818,458621,488820,521301,557674,596329,636728, - 680886,727728,776315,821546,862751,897916,926773,952409,971870, - 980460,981802,955227,918049,865167,793897,713233,613106,507477, - 398224,342255,316082,334604,338228 -}; -const Word32 defaultHRIR_left_avg_power_32kHz_fx[LR_IAC_LENGTH_NR_FC] /*Q-23*/ = { - 8747993,8732977,8657866,8592845,8534553,8549703,8574332,8613196,8612450, - 8594632,8548151,8528631,8527079,8602383,8683241,8772412,8811402,8825092, - 8787822,8745552,8699960,8676052,8653847,8634210,8606620,8577981,8553109, - 8534922,8521190,8494783,8457906,8405301,8354525,8310963,8294462,8290268, - 8294278,8284279,8267812,8241648,8222362,8207531,8203647,8196752,8187852, - 8170672,8158450,8153660,8165857,8182684,8201064,8209352,8210920,8201391, - 8193506,8188086,8186669,8185008,8178398,8165219,8147653,8126564,8107262, - 8090653,8075973,8060647,8040892,8017060,7990510,7965369,7942812,7924139, - 7905508,7885266,7858574,7828903,7797253,7770124,7745051,7723047,7698192, - 7671231,7638683,7606840,7575458,7552800,7532081,7514280,7493736,7472068, - 7448614,7429295,7412736,7405756,7399180,7393182,7382990,7372018,7362119, - 7358680,7359552,7368629,7377118,7384718,7391127,7398953,7413675,7435679, - 7462522,7492302,7520043,7544714,7568412,7592915,7621662,7651325,7681599, - 7702873,7719423,7728886,7735043,7740672,7747517,7751812,7754412,7743650, - 7728089,7705339,7680970,7656341,7632308,7603568,7571683,7527366,7481606, - 7433699,7390347,7348345,7307132,7260525,7210319,7153108,7097458,7044149, - 6995864,6948351,6898883,6845179,6788657,6732512,6680016,6632990,6592154, - 6553113,6515029,6478094,6441947,6416664,6397714,6388260,6386465,6386851, - 6388319,6391700,6396364,6411102,6429029,6451720,6471844,6489796,6501641, - 6513435,6525204,6542518,6559405,6575670,6584344,6589771,6589813,6590845, - 6592531,6595845,6596365,6592707,6580091,6564161,6543961,6524642,6505902, - 6486113,6462969,6434800,6400113,6364034,6328861,6297445,6268521,6239597, - 6208098,6172732,6136241,6100909,6071330,6044722,6020084,5990858,5959116, - 5923599,5889046,5855634,5825838,5795177,5763938,5725518,5685253,5642211, - 5600763,5560540,5523688,5486661,5449525,5408043,5366612,5325264,5291257, - 5260940,5238031,5214778,5191290,5165126,5142795,5126186,5122067,5121799, - 5124433,5124877,5123837,5133241,5151268,5182239,5223192,5269715,5328527, - 5411331,5510141,5612029,5649811,5591443,5269488,4824515,4151102,3472472, - 2790361,2355655,2029229,1865232,1832432 -}; -const Word32 defaultHRIR_right_avg_power_32kHz_fx[LR_IAC_LENGTH_NR_FC] /*Q-23*/ = { - 8747984,8732969,8657857,8592837,8534561,8549686,8574315,8613188,8612450, - 8594632,8548151,8528622,8527070,8602392,8683241,8772404,8811402,8825109, - 8787822,8745552,8699951,8676044,8653847,8634226,8606620,8577964,8553100, - 8534914,8521190,8494808,8457931,8405310,8354525,8310963,8294471,8290276, - 8294278,8284287,8267820,8241639,8222362,8207540,8203664,8196752,8187826, - 8170663,8158450,8153685,8165873,8182684,8201064,8209360,8210945,8201416, - 8193531,8188095,8186669,8185008,8178398,8165219,8147653,8126539,8107237, - 8090644,8075973,8060664,8040875,8017043,7990510,7965369,7942812,7924122, - 7905499,7885283,7858574,7828903,7797270,7770116,7745034,7723056,7698192, - 7671222,7638675,7606840,7575466,7552809,7532089,7514280,7493736,7472068, - 7448597,7429287,7412753,7405756,7399163,7393174,7382981,7372009,7362111, - 7358680,7359560,7368637,7377126,7384718,7391135,7398970,7413692,7435679, - 7462514,7492293,7520026,7544705,7568403,7592915,7621688,7651341,7681582, - 7702873,7719423,7728877,7735026,7740663,7747517,7751829,7754437,7743650, - 7728080,7705330,7680970,7656349,7632308,7603568,7571700,7527383,7481623, - 7433716,7390363,7348353,7307132,7260525,7210327,7153125,7097475,7044149, - 6995872,6948359,6898883,6845179,6788657,6732520,6680024,6632990,6592154, - 6553113,6515037,6478102,6441947,6416664,6397714,6388269,6386457,6386843, - 6388327,6391700,6396347,6411102,6429029,6451712,6471844,6489796,6501624, - 6513427,6525213,6542518,6559405,6575653,6584327,6589763,6589813,6590845, - 6592531,6595836,6596365,6592716,6580099,6564169,6543978,6524642,6505894, - 6486122,6462994,6434817,6400122,6364034,6328852,6297428,6268521,6239597, - 6208090,6172723,6136241,6100909,6071330,6044722,6020076,5990842,5959107, - 5923599,5889037,5855617,5825829,5795169,5763921,5725518,5685253,5642194, - 5600755,5560548,5523688,5486661,5449508,5408026,5366603,5325256,5291257, - 5260949,5238040,5214778,5191281,5165134,5142795,5126194,5122075,5121799, - 5124441,5124877,5123854,5133241,5151259,5182230,5223192,5269715,5328527, - 5411340,5510149,5612037,5649820,5591435,5269472,4824498,4151094,3472472, - 2790378,2355663,2029237,1865240,1832432 -}; - -#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB -/* Sample Rate = 16000 */ - - float defaultHRIR_coherence_16kHz_fx[LR_IAC_LENGTH_NR_FC_16KHZ] = - {0.983044f, 0.960794f, 0.893756f, 0.783586f, 0.638963f, 0.477338f, 0.319879f, 0.183374f, 0.075909f, - 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.003842f, 0.025288f, 0.035886f, - 0.037785f, 0.035991f, 0.034784f, 0.035091f, 0.034683f, 0.030849f, 0.023146f, 0.014061f, 0.007275f, - 0.005053f, 0.006930f, 0.010589f, 0.013905f, 0.016288f, 0.018404f, 0.020849f, 0.023164f, 0.024149f, - 0.023098f, 0.020635f, 0.018325f, 0.017381f, 0.017611f, 0.017534f, 0.015650f, 0.011786f, 0.007342f, - 0.004290f, 0.003732f, 0.005148f, 0.006838f, 0.007172f, 0.005579f, 0.002632f, 0.000000f, 0.000000f, - 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, - 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000238f, 0.001738f, 0.003011f, 0.003910f, - 0.004120f, 0.003394f, 0.001769f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, - 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, - 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, - 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, - 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, - 0.000000f, 0.002101f, 0.004247f, 0.006330f, 0.008300f, 0.010110f, 0.011735f, 0.013165f, 0.014384f, - 0.015345f, 0.015972f, 0.016191f}; - - float defaultHRIR_left_avg_power_16kHz_fx[LR_IAC_LENGTH_NR_FC_16KHZ] = - {1.118974f, 1.115256f, 1.106210f, 1.096901f, 1.092316f, 1.094422f, 1.101140f, 1.107775f, 1.110000f, - 1.106535f, 1.099921f, 1.094914f, 1.095643f, 1.103178f, 1.114955f, 1.126292f, 1.132973f, 1.133288f, - 1.128471f, 1.121439f, 1.114842f, 1.109721f, 1.105480f, 1.100966f, 1.095650f, 1.090074f, 1.085225f, - 1.081525f, 1.078267f, 1.074026f, 1.067777f, 1.059839f, 1.051856f, 1.045772f, 1.042531f, 1.041432f, - 1.040607f, 1.038291f, 1.033910f, 1.028286f, 1.022846f, 1.018514f, 1.015152f, 1.011898f, 1.008047f, - 1.003762f, 0.999992f, 0.997770f, 0.997349f, 0.997960f, 0.998259f, 0.997177f, 0.994506f, 0.990883f, - 0.987207f, 0.984003f, 0.981133f, 0.977984f, 0.973950f, 0.968837f, 0.962915f, 0.956690f, 0.950584f, - 0.944679f, 0.938744f, 0.932399f, 0.925372f, 0.917663f, 0.909568f, 0.901511f, 0.893804f, 0.886455f, - 0.879155f, 0.871463f, 0.863142f, 0.854285f, 0.845334f, 0.836740f, 0.828656f, 0.820817f, 0.812713f, - 0.803960f, 0.794564f, 0.784952f, 0.775633f, 0.766881f, 0.758539f, 0.750156f, 0.741330f, 0.732004f, - 0.722524f, 0.713387f, 0.704919f, 0.697057f, 0.689419f, 0.681576f, 0.673350f, 0.664931f, 0.656703f, - 0.648997f, 0.641801f, 0.634760f, 0.627357f, 0.619192f, 0.610186f, 0.600526f, 0.590442f, 0.579952f, - 0.568762f, 0.556384f, 0.542389f, 0.526648f, 0.509355f, 0.490884f, 0.471542f, 0.451447f, 0.430550f, - 0.408842f, 0.386537f, 0.364126f, 0.342284f, 0.321675f, 0.302809f, 0.286016f, 0.271536f, 0.259639f, - 0.250691f, 0.245099f, 0.243192f}; - - float defaultHRIR_right_avg_power_16kHz_fx[LR_IAC_LENGTH_NR_FC_16KHZ] = - {1.118974f, 1.115254f, 1.106207f, 1.096903f, 1.092317f, 1.094425f, 1.101145f, 1.107775f, 1.109999f, - 1.106540f, 1.099921f, 1.094912f, 1.095644f, 1.103178f, 1.114952f, 1.126292f, 1.132973f, 1.133288f, - 1.128472f, 1.121439f, 1.114842f, 1.109719f, 1.105481f, 1.100965f, 1.095650f, 1.090072f, 1.085224f, - 1.081527f, 1.078270f, 1.074025f, 1.067775f, 1.059840f, 1.051856f, 1.045772f, 1.042533f, 1.041433f, - 1.040611f, 1.038292f, 1.033911f, 1.028286f, 1.022844f, 1.018512f, 1.015153f, 1.011899f, 1.008050f, - 1.003762f, 0.999995f, 0.997769f, 0.997349f, 0.997959f, 0.998259f, 0.997178f, 0.994509f, 0.990883f, - 0.987204f, 0.984003f, 0.981133f, 0.977983f, 0.973949f, 0.968836f, 0.962914f, 0.956689f, 0.950583f, - 0.944681f, 0.938745f, 0.932399f, 0.925373f, 0.917662f, 0.909567f, 0.901511f, 0.893804f, 0.886456f, - 0.879153f, 0.871467f, 0.863138f, 0.854286f, 0.845334f, 0.836740f, 0.828656f, 0.820816f, 0.812712f, - 0.803961f, 0.794567f, 0.784951f, 0.775631f, 0.766882f, 0.758540f, 0.750158f, 0.741330f, 0.732005f, - 0.722523f, 0.713388f, 0.704920f, 0.697057f, 0.689418f, 0.681575f, 0.673352f, 0.664930f, 0.656706f, - 0.648998f, 0.641802f, 0.634762f, 0.627355f, 0.619192f, 0.610187f, 0.600527f, 0.590442f, 0.579953f, - 0.568763f, 0.556383f, 0.542389f, 0.526646f, 0.509355f, 0.490883f, 0.471543f, 0.451446f, 0.430550f, - 0.408843f, 0.386537f, 0.364127f, 0.342285f, 0.321676f, 0.302809f, 0.286016f, 0.271535f, 0.259640f, - 0.250692f, 0.245099f, 0.243192f}; - - -#else - -const Word32 defaultHRIR_coherence_16kHz_fx[LR_IAC_LENGTH_NR_FC] /*Q-27*/ = { - 130123416,130123416,128225040,123478832,118732624,113118568,104033232,94947768,85862304, - 75063144,64263984,53464828,43914296,34675820,25437480,17993766,11746601,5499437, - 1532229,985023,437818,0,0,0,0,0,0, - 0,343865,773496,1203261,2004810,3054258,4103707,4777480,4887673, - 4998000,5066316,4966727,4867271,4767816,4765534,4763253,4760971,4569174, - 4329998,4090822,3659312,3099355,2539533,2037290,1621350,1205543,880065, - 916304,952677,988916,1233058,1477200,1721342,1912602,2090441,2268413, - 2427327,2573490,2719788,2859643,2989834,3120025,3219078,3193576,3168075, - 3142574,2987686,2832665,2677778,2583691,2504771,2425851,2397128,2401692, - 2406255,2356594,2225464,2094333,1933137,1651280,1369423,1087566,924357, - 761148,597940,625051,699677,774302,854295,937779,1021128,1026631, - 915230,803830,670014,446676,223338,0,0,0,0, - 0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,5100,30735, - 56371,81872,173140,264408,355542,419698,477144,534455,552037, - 543044,533918,485599,378494,271254,173946,115964,57982,0, - 0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0, - 0,0,671,1476,2415,99723,261321,423054,646795, - 963549,1280302,1632087,2124129,2616037,3108080,3841982,4575885,5309922, - 6280181,7309766,8339216,8750996,8750996 -}; -const Word32 defaultHRIR_left_avg_power_16kHz_fx[LR_IAC_LENGTH_NR_FC] /*Q-23*/ = { - 9335246,9335246,9316514,9269680,9222847,9180350,9155201,9130044,9104894, - 9126688,9148473,9170267,9191549,9212688,9233844,9234423,9221295,9208167, - 9191205,9168497,9145789,9127997,9129884,9131780,9133676,9164823,9195978, - 9227125,9267550,9310290,9353038,9385225,9410374,9435531,9445170,9431538, - 9417907,9399855,9364128,9328409,9292682,9270670,9248667,9226655,9215783, - 9207688,9199593,9183605,9162356,9141108,9116244,9085961,9055678,9028608, - 9014432,9000255,8986078,8975962,8965845,8955728,8926108,8891606,8857103, - 8819145,8778896,8738639,8710806,8701604,8692401,8686227,8692209,8698190, - 8704171,8686706,8669232,8651767,8623917,8593466,8563024,8543554,8531399, - 8519252,8509748,8504203,8498667,8489716,8467083,8444459,8421835,8399773, - 8377711,8355649,8351698,8352268,8352847,8355833,8360430,8365027,8363484, - 8352721,8341959,8331028,8319460,8307884,8296308,8292063,8287827,8283582, - 8271142,8256647,8242159,8221389,8196442,8171494,8150547,8135607,8120659, - 8106465,8095225,8083992,8072760,8043073,8013394,7983706,7949422,7913997, - 7878564,7853893,7836394,7818904,7801472,7784141,7766811,7744782,7703972, - 7663169,7622359,7580802,7539253,7497696,7474266,7455367,7436467,7415496, - 7393140,7370784,7338471,7291235,7244007,7197551,7154232,7110914,7067595, - 7046615,7025627,7004647,6977485,6948779,6920073,6878751,6829015,6779278, - 6733644,6694184,6654724,6618804,6597044,6575284,6553524,6518183,6482842, - 6447501,6401632,6353137,6304634,6267229,6237215,6207201,6181045,6160677, - 6140310,6115580,6073427,6031275,5989122,5942817,5896503,5850198,5825150, - 5805428,5785707,5765742,5745626,5725510,5693398,5643285,5593180,5544358, - 5500720,5457091,5413454,5404126,5394797,5385469,5366930,5346085,5325239, - 5282164,5224274,5166376,5115566,5075376,5035186,5002731,5001238,4999736, - 4998243,4969436,4940630,4911823,4847290,4773822,4700355,4646282,4605153, - 4564023,4540250,4542523,4544788,4536869,4488241,4439612,4390983,4285488, - 4179984,4074489,4025282,3990150,3955019,3974925,4031523,4088129,4108127, - 4073222,4038317,3957300,3691818,3426335,3160861,2774481,2388110,2001740, - 1708239,1437966,1167685,1059581,1059581 -}; -const Word32 defaultHRIR_right_avg_power_16kHz_fx[LR_IAC_LENGTH_NR_FC] /*Q-23*/ = { - 9335246,9335246,9316514,9269689,9222855,9180358,9155201,9130035,9104869, - 9126663,9148465,9170258,9191540,9212688,9233827,9234415,9221295,9208175, - 9191213,9168488,9145755,9127963,9129867,9131772,9133676,9164831,9195978, - 9227133,9267550,9310281,9353021,9385200,9410357,9435506,9445153,9431522, - 9417899,9399855,9364119,9328384,9292648,9270653,9248658,9226663,9215792, - 9207688,9199593,9183596,9162348,9141100,9116236,9085953,9055678,9028617, - 9014432,9000255,8986070,8975962,8965853,8955745,8926116,8891614,8857103, - 8819145,8778888,8738631,8710789,8701587,8692385,8686219,8692200,8698181, - 8704162,8686697,8669232,8651775,8623917,8593466,8563016,8543546,8531390, - 8519244,8509739,8504203,8498675,8489724,8467100,8444468,8421844,8399773, - 8377703,8355641,8351681,8352252,8352830,8355817,8360414,8365019,8363475, - 8352721,8341959,8331037,8319469,8307893,8296316,8292072,8287835,8283591, - 8271142,8256647,8242151,8221381,8196433,8171494,8150547,8135616,8120676, - 8106482,8095250,8084009,8072777,8043081,8013385,7983698,7949405,7913972, - 7878547,7853876,7836386,7818904,7801481,7784150,7766819,7744790,7703980, - 7663161,7622350,7580793,7539244,7497696,7474258,7455358,7436459,7415487, - 7393132,7370776,7338471,7291244,7244016,7197560,7154241,7110914,7067587, - 7046607,7025627,7004647,6977485,6948770,6920064,6878742,6829006,6779270, - 6733644,6694184,6654724,6618813,6597053,6575301,6553549,6518191,6482842, - 6447492,6401623,6353137,6304643,6267229,6237215,6207201,6181037,6160677, - 6140310,6115580,6073427,6031275,5989122,5942817,5896512,5850207,5825167, - 5805445,5785723,5765750,5745626,5725493,5693382,5643276,5593180,5544375, - 5500729,5457074,5413429,5404109,5394789,5385478,5366939,5346093,5325247, - 5282172,5224282,5166384,5115574,5075384,5035195,5002739,5001238,4999736, - 4998243,4969436,4940630,4911823,4847290,4773814,4700338,4646274,4605153, - 4564023,4540258,4542523,4544788,4536878,4488249,4439612,4390983,4285480, - 4179984,4074489,4025282,3990150,3955019,3974925,4031523,4088129,4108127, - 4073222,4038317,3957292,3691809,3426327,3160844,2774473,2388110,2001740, - 1708239,1437966,1167685,1059573,1059573 -}; -#endif -#endif /*----------------------------------------------------------------------------------* * t-design and SN3D normalization table *----------------------------------------------------------------------------------*/ diff --git a/lib_util/hrtf_file_reader.c b/lib_util/hrtf_file_reader.c index 4551617de..b38743f1a 100644 --- a/lib_util/hrtf_file_reader.c +++ b/lib_util/hrtf_file_reader.c @@ -35,11 +35,7 @@ #include "prot_fx.h" #include "ivas_prot_rend_fx.h" #include "ivas_prot_fx.h" -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES #include "ivas_rom_binaural_crend_head.h" -#else -#include "ivas_rom_rend.h" -#endif /*---------------------------------------------------------------------* * Local structures -- GitLab From 23339b3f9088d030ed0fe68eae923e3951029a47 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Tue, 8 Jul 2025 15:22:57 +0200 Subject: [PATCH 07/11] [cleanup] accept FIX_INV_DIFFUSE_WEIGHT --- lib_com/options.h | 1 - lib_rend/ivas_crend_fx.c | 216 --------------------- lib_rend/ivas_rom_binaural_crend_head.h | 60 ------ lib_rend/ivas_rom_binaural_crend_head_fx.c | 63 ------ lib_rend/ivas_stat_rend.h | 9 - lib_util/hrtf_file_reader.c | 18 -- 6 files changed, 367 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index b61f560ad..b1d305f81 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -113,7 +113,6 @@ #define NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES /* Philips: Use pre-computed HRTF average L/R energies and IAC in all renderers */ #define FIX_WARNING_RENDER_CONFIG /* Orange: fix warning on windows build */ -#define FIX_INV_DIFFUSE_WEIGHT /* Orange : Fix error in energy compensation in late binaural */ diff --git a/lib_rend/ivas_crend_fx.c b/lib_rend/ivas_crend_fx.c index 031926546..825ff582e 100644 --- a/lib_rend/ivas_crend_fx.c +++ b/lib_rend/ivas_crend_fx.c @@ -71,10 +71,8 @@ ivas_error ivas_hrtf_init( hHrtf->max_num_ir = 0; hHrtf->max_num_iterations = 0; hHrtf->index_frequency_max_diffuse = 0; -#ifdef FIX_INV_DIFFUSE_WEIGHT hHrtf->same_inv_diffuse_weight = 1; move16(); -#endif move32(); move16(); move16(); @@ -83,16 +81,10 @@ ivas_error ivas_hrtf_init( FOR( i = 0; i < MAX_INTERN_CHANNELS; i++ ) { -#ifndef FIX_INV_DIFFUSE_WEIGHT - hHrtf->inv_diffuse_weight_fx[i] = 0; - move16(); -#endif FOR( j = 0; j < BINAURAL_CHANNELS; j++ ) { -#ifdef FIX_INV_DIFFUSE_WEIGHT hHrtf->inv_diffuse_weight_fx[j][i] = 0; move16(); -#endif hHrtf->num_iterations[i][j] = 0; move16(); hHrtf->pIndex_frequency_max[i][j] = NULL; @@ -111,10 +103,8 @@ ivas_error ivas_hrtf_init( hHrtf->pOut_to_bin_diffuse_im_fx[j] = NULL; } -#ifdef FIX_INV_DIFFUSE_WEIGHT hHrtf->init_from_rom = 1; move16(); -#endif return IVAS_ERR_OK; } @@ -424,24 +414,11 @@ static ivas_error ivas_rend_initCrend_fx( IF( EQ_32( output_Fs, 48000 ) ) { -#ifndef FIX_INV_DIFFUSE_WEIGHT - IF( EQ_16( outConfig, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) ) - { - hHrtf->inv_diffuse_weight_fx[i] = CRendBin_Combined_BRIR_inv_diffuse_weight_48kHz_fx[tmp]; // Q15 - } - ELSE - { - hHrtf->inv_diffuse_weight_fx[i] = CRendBin_Combined_HRIR_inv_diffuse_weight_48kHz_fx[tmp]; // Q15 - } - move16(); -#endif FOR( j = 0; j < BINAURAL_CHANNELS; j++ ) { IF( EQ_16( outConfig, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) ) { -#ifdef FIX_INV_DIFFUSE_WEIGHT hHrtf->inv_diffuse_weight_fx[j][i] = CRendBin_Combined_BRIR_inv_diffuse_weight_48kHz_fx[j][tmp]; -#endif hHrtf->num_iterations[i][j] = CRendBin_Combined_BRIR_num_iterations_48kHz[tmp][j]; hHrtf->pIndex_frequency_max[i][j] = CRendBin_Combined_BRIR_pIndex_frequency_max_48kHz[tmp][j]; @@ -450,9 +427,7 @@ static ivas_error ivas_rend_initCrend_fx( } ELSE { -#ifdef FIX_INV_DIFFUSE_WEIGHT hHrtf->inv_diffuse_weight_fx[j][i] = CRendBin_Combined_HRIR_inv_diffuse_weight_48kHz_fx[j][tmp]; -#endif hHrtf->num_iterations[i][j] = CRendBin_Combined_HRIR_num_iterations_48kHz[tmp][j]; hHrtf->pIndex_frequency_max[i][j] = CRendBin_Combined_HRIR_pIndex_frequency_max_48kHz[tmp][j]; @@ -467,24 +442,11 @@ static ivas_error ivas_rend_initCrend_fx( } ELSE IF( EQ_32( output_Fs, 32000 ) ) { -#ifndef FIX_INV_DIFFUSE_WEIGHT - IF( EQ_16( outConfig, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) ) - { - hHrtf->inv_diffuse_weight_fx[i] = CRendBin_Combined_BRIR_inv_diffuse_weight_32kHz_fx[tmp]; // Q15 - } - ELSE - { - hHrtf->inv_diffuse_weight_fx[i] = CRendBin_Combined_HRIR_inv_diffuse_weight_32kHz_fx[tmp]; // Q15 - } - move16(); -#endif FOR( j = 0; j < BINAURAL_CHANNELS; j++ ) { IF( EQ_16( outConfig, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) ) { -#ifdef FIX_INV_DIFFUSE_WEIGHT hHrtf->inv_diffuse_weight_fx[j][i] = CRendBin_Combined_BRIR_inv_diffuse_weight_32kHz_fx[j][tmp]; -#endif hHrtf->num_iterations[i][j] = CRendBin_Combined_BRIR_num_iterations_32kHz[tmp][j]; hHrtf->pIndex_frequency_max[i][j] = CRendBin_Combined_BRIR_pIndex_frequency_max_32kHz[tmp][j]; @@ -493,9 +455,7 @@ static ivas_error ivas_rend_initCrend_fx( } ELSE { -#ifdef FIX_INV_DIFFUSE_WEIGHT hHrtf->inv_diffuse_weight_fx[j][i] = CRendBin_Combined_HRIR_inv_diffuse_weight_32kHz_fx[j][tmp]; -#endif hHrtf->num_iterations[i][j] = CRendBin_Combined_HRIR_num_iterations_32kHz[tmp][j]; hHrtf->pIndex_frequency_max[i][j] = CRendBin_Combined_HRIR_pIndex_frequency_max_32kHz[tmp][j]; @@ -510,24 +470,11 @@ static ivas_error ivas_rend_initCrend_fx( } ELSE IF( EQ_32( output_Fs, 16000 ) ) { -#ifndef FIX_INV_DIFFUSE_WEIGHT - IF( EQ_16( outConfig, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) ) - { - hHrtf->inv_diffuse_weight_fx[i] = CRendBin_Combined_BRIR_inv_diffuse_weight_16kHz_fx[tmp]; // Q15 - } - ELSE - { - hHrtf->inv_diffuse_weight_fx[i] = CRendBin_Combined_HRIR_inv_diffuse_weight_16kHz_fx[tmp]; // Q15 - } - move16(); -#endif FOR( j = 0; j < BINAURAL_CHANNELS; j++ ) { IF( EQ_16( outConfig, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) ) { -#ifdef FIX_INV_DIFFUSE_WEIGHT hHrtf->inv_diffuse_weight_fx[j][i] = CRendBin_Combined_BRIR_inv_diffuse_weight_16kHz_fx[j][tmp]; -#endif hHrtf->num_iterations[i][j] = CRendBin_Combined_BRIR_num_iterations_16kHz[tmp][j]; hHrtf->pIndex_frequency_max[i][j] = CRendBin_Combined_BRIR_pIndex_frequency_max_16kHz[tmp][j]; @@ -536,9 +483,7 @@ static ivas_error ivas_rend_initCrend_fx( } ELSE { -#ifdef FIX_INV_DIFFUSE_WEIGHT hHrtf->inv_diffuse_weight_fx[j][i] = CRendBin_Combined_HRIR_inv_diffuse_weight_16kHz_fx[j][tmp]; -#endif hHrtf->num_iterations[i][j] = CRendBin_Combined_HRIR_num_iterations_16kHz[tmp][j]; hHrtf->pIndex_frequency_max[i][j] = CRendBin_Combined_HRIR_pIndex_frequency_max_16kHz[tmp][j]; @@ -572,16 +517,10 @@ static ivas_error ivas_rend_initCrend_fx( FOR( i = 0; i < hHrtf->max_num_ir; i++ ) { -#ifndef FIX_INV_DIFFUSE_WEIGHT - hHrtf->inv_diffuse_weight_fx[i] = CRendBin_HOA3_HRIR_inv_diffuse_weight_48kHz_fx[i]; // Q15 - move16(); -#endif FOR( j = 0; j < BINAURAL_CHANNELS; j++ ) { -#ifdef FIX_INV_DIFFUSE_WEIGHT hHrtf->inv_diffuse_weight_fx[j][i] = CRendBin_HOA3_HRIR_inv_diffuse_weight_48kHz_fx[j][i]; // Q15 move16(); -#endif hHrtf->num_iterations[i][j] = CRendBin_HOA3_HRIR_num_iterations_48kHz[i][j]; hHrtf->pIndex_frequency_max[i][j] = CRendBin_HOA3_HRIR_pIndex_frequency_max_48kHz[i][j]; @@ -617,16 +556,10 @@ static ivas_error ivas_rend_initCrend_fx( FOR( i = 0; i < hHrtf->max_num_ir; i++ ) { -#ifndef FIX_INV_DIFFUSE_WEIGHT - hHrtf->inv_diffuse_weight_fx[i] = CRendBin_HOA3_HRIR_inv_diffuse_weight_32kHz_fx[i]; // Q15 - move16(); -#endif FOR( j = 0; j < BINAURAL_CHANNELS; j++ ) { -#ifdef FIX_INV_DIFFUSE_WEIGHT hHrtf->inv_diffuse_weight_fx[j][i] = CRendBin_HOA3_HRIR_inv_diffuse_weight_32kHz_fx[j][i]; // Q15 move16(); -#endif hHrtf->num_iterations[i][j] = CRendBin_HOA3_HRIR_num_iterations_32kHz[i][j]; hHrtf->pIndex_frequency_max[i][j] = CRendBin_HOA3_HRIR_pIndex_frequency_max_32kHz[i][j]; @@ -663,17 +596,11 @@ static ivas_error ivas_rend_initCrend_fx( FOR( i = 0; i < hHrtf->max_num_ir; i++ ) { -#ifndef FIX_INV_DIFFUSE_WEIGHT - hHrtf->inv_diffuse_weight_fx[i] = CRendBin_HOA3_HRIR_inv_diffuse_weight_16kHz_fx[i]; // Q15 - move16(); -#endif FOR( j = 0; j < BINAURAL_CHANNELS; j++ ) { -#ifdef FIX_INV_DIFFUSE_WEIGHT hHrtf->inv_diffuse_weight_fx[j][i] = CRendBin_HOA3_HRIR_inv_diffuse_weight_16kHz_fx[j][i]; // Q15 move16(); -#endif hHrtf->num_iterations[i][j] = CRendBin_HOA3_HRIR_num_iterations_16kHz[i][j]; hHrtf->pIndex_frequency_max[i][j] = CRendBin_HOA3_HRIR_pIndex_frequency_max_16kHz[i][j]; @@ -717,16 +644,10 @@ static ivas_error ivas_rend_initCrend_fx( FOR( i = 0; i < hHrtf->max_num_ir; i++ ) { -#ifndef FIX_INV_DIFFUSE_WEIGHT - hHrtf->inv_diffuse_weight_fx[i] = CRendBin_HOA2_HRIR_inv_diffuse_weight_48kHz_fx[i]; // Q15 - move16(); -#endif FOR( j = 0; j < BINAURAL_CHANNELS; j++ ) { -#ifdef FIX_INV_DIFFUSE_WEIGHT hHrtf->inv_diffuse_weight_fx[j][i] = CRendBin_HOA2_HRIR_inv_diffuse_weight_48kHz_fx[j][i]; // Q15 move16(); -#endif hHrtf->num_iterations[i][j] = CRendBin_HOA2_HRIR_num_iterations_48kHz[i][j]; hHrtf->pIndex_frequency_max[i][j] = CRendBin_HOA2_HRIR_pIndex_frequency_max_48kHz[i][j]; @@ -762,16 +683,10 @@ static ivas_error ivas_rend_initCrend_fx( FOR( i = 0; i < hHrtf->max_num_ir; i++ ) { -#ifndef FIX_INV_DIFFUSE_WEIGHT - hHrtf->inv_diffuse_weight_fx[i] = CRendBin_HOA2_HRIR_inv_diffuse_weight_32kHz_fx[i]; // Q15 - move16(); -#endif FOR( j = 0; j < BINAURAL_CHANNELS; j++ ) { -#ifdef FIX_INV_DIFFUSE_WEIGHT hHrtf->inv_diffuse_weight_fx[j][i] = CRendBin_HOA2_HRIR_inv_diffuse_weight_32kHz_fx[j][i]; // Q15 move16(); -#endif hHrtf->num_iterations[i][j] = CRendBin_HOA2_HRIR_num_iterations_32kHz[i][j]; hHrtf->pIndex_frequency_max[i][j] = CRendBin_HOA2_HRIR_pIndex_frequency_max_32kHz[i][j]; @@ -808,16 +723,10 @@ static ivas_error ivas_rend_initCrend_fx( FOR( i = 0; i < hHrtf->max_num_ir; i++ ) { -#ifndef FIX_INV_DIFFUSE_WEIGHT - hHrtf->inv_diffuse_weight_fx[i] = CRendBin_HOA2_HRIR_inv_diffuse_weight_16kHz_fx[i]; // Q15 - move16(); -#endif FOR( j = 0; j < BINAURAL_CHANNELS; j++ ) { -#ifdef FIX_INV_DIFFUSE_WEIGHT hHrtf->inv_diffuse_weight_fx[j][i] = CRendBin_HOA2_HRIR_inv_diffuse_weight_16kHz_fx[j][i]; // Q15 move16(); -#endif hHrtf->num_iterations[i][j] = CRendBin_HOA2_HRIR_num_iterations_16kHz[i][j]; hHrtf->pIndex_frequency_max[i][j] = CRendBin_HOA2_HRIR_pIndex_frequency_max_16kHz[i][j]; @@ -861,16 +770,10 @@ static ivas_error ivas_rend_initCrend_fx( FOR( i = 0; i < hHrtf->max_num_ir; i++ ) { -#ifndef FIX_INV_DIFFUSE_WEIGHT - hHrtf->inv_diffuse_weight_fx[i] = CRendBin_FOA_HRIR_inv_diffuse_weight_48kHz_fx[i]; // Q15 - move16(); -#endif FOR( j = 0; j < BINAURAL_CHANNELS; j++ ) { -#ifdef FIX_INV_DIFFUSE_WEIGHT hHrtf->inv_diffuse_weight_fx[j][i] = CRendBin_FOA_HRIR_inv_diffuse_weight_48kHz_fx[j][i]; // Q15 move16(); -#endif hHrtf->num_iterations[i][j] = CRendBin_FOA_HRIR_num_iterations_48kHz[i][j]; hHrtf->pIndex_frequency_max[i][j] = CRendBin_FOA_HRIR_pIndex_frequency_max_48kHz[i][j]; @@ -906,16 +809,10 @@ static ivas_error ivas_rend_initCrend_fx( FOR( i = 0; i < hHrtf->max_num_ir; i++ ) { -#ifndef FIX_INV_DIFFUSE_WEIGHT - hHrtf->inv_diffuse_weight_fx[i] = CRendBin_FOA_HRIR_inv_diffuse_weight_32kHz_fx[i]; // Q15 - move16(); -#endif FOR( j = 0; j < BINAURAL_CHANNELS; j++ ) { -#ifdef FIX_INV_DIFFUSE_WEIGHT hHrtf->inv_diffuse_weight_fx[j][i] = CRendBin_FOA_HRIR_inv_diffuse_weight_32kHz_fx[j][i]; // Q15 move16(); -#endif hHrtf->num_iterations[i][j] = CRendBin_FOA_HRIR_num_iterations_32kHz[i][j]; hHrtf->pIndex_frequency_max[i][j] = CRendBin_FOA_HRIR_pIndex_frequency_max_32kHz[i][j]; @@ -952,16 +849,10 @@ static ivas_error ivas_rend_initCrend_fx( FOR( i = 0; i < hHrtf->max_num_ir; i++ ) { -#ifndef FIX_INV_DIFFUSE_WEIGHT - hHrtf->inv_diffuse_weight_fx[i] = CRendBin_FOA_HRIR_inv_diffuse_weight_16kHz_fx[i]; // Q15 - move16(); -#endif FOR( j = 0; j < BINAURAL_CHANNELS; j++ ) { -#ifdef FIX_INV_DIFFUSE_WEIGHT hHrtf->inv_diffuse_weight_fx[j][i] = CRendBin_FOA_HRIR_inv_diffuse_weight_16kHz_fx[j][i]; // Q15 move16(); -#endif hHrtf->num_iterations[i][j] = CRendBin_FOA_HRIR_num_iterations_16kHz[i][j]; hHrtf->pIndex_frequency_max[i][j] = CRendBin_FOA_HRIR_pIndex_frequency_max_16kHz[i][j]; @@ -1087,26 +978,12 @@ static ivas_error ivas_rend_initCrend_fx( return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Error: Channel configuration not specified!\n\n" ); } move16(); -#ifndef FIX_INV_DIFFUSE_WEIGHT - - IF( EQ_16( outConfig, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) ) - { - hHrtf->inv_diffuse_weight_fx[i] = hSetOfHRTF->hHRTF_brir_combined->inv_diffuse_weight_fx[tmp]; // Q15 - } - ELSE - { - hHrtf->inv_diffuse_weight_fx[i] = hSetOfHRTF->hHRTF_hrir_combined->inv_diffuse_weight_fx[tmp]; // Q15 - } - move16(); -#endif FOR( j = 0; j < BINAURAL_CHANNELS; j++ ) { IF( EQ_16( outConfig, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) ) { -#ifdef FIX_INV_DIFFUSE_WEIGHT hHrtf->inv_diffuse_weight_fx[j][i] = hSetOfHRTF->hHRTF_brir_combined->inv_diffuse_weight_fx[j][tmp]; move16(); -#endif hHrtf->num_iterations[i][j] = hSetOfHRTF->hHRTF_brir_combined->num_iterations[tmp][j]; hHrtf->pIndex_frequency_max[i][j] = hSetOfHRTF->hHRTF_brir_combined->pIndex_frequency_max[tmp][j]; @@ -1115,10 +992,8 @@ static ivas_error ivas_rend_initCrend_fx( } ELSE { -#ifdef FIX_INV_DIFFUSE_WEIGHT hHrtf->inv_diffuse_weight_fx[j][i] = hSetOfHRTF->hHRTF_hrir_combined->inv_diffuse_weight_fx[j][tmp]; move16(); -#endif hHrtf->num_iterations[i][j] = hSetOfHRTF->hHRTF_hrir_combined->num_iterations[tmp][j]; hHrtf->pIndex_frequency_max[i][j] = hSetOfHRTF->hHRTF_hrir_combined->pIndex_frequency_max[tmp][j]; @@ -1149,16 +1024,10 @@ static ivas_error ivas_rend_initCrend_fx( FOR( i = 0; i < hHrtf->max_num_ir; i++ ) { -#ifndef FIX_INV_DIFFUSE_WEIGHT - hHrtf->inv_diffuse_weight_fx[i] = hSetOfHRTF->hHRTF_hrir_hoa3->inv_diffuse_weight_fx[i]; // Q31 - move16(); -#endif FOR( j = 0; j < BINAURAL_CHANNELS; j++ ) { -#ifdef FIX_INV_DIFFUSE_WEIGHT hHrtf->inv_diffuse_weight_fx[j][i] = hSetOfHRTF->hHRTF_hrir_hoa3->inv_diffuse_weight_fx[j][i]; move16(); -#endif hHrtf->num_iterations[i][j] = hSetOfHRTF->hHRTF_hrir_hoa3->num_iterations[i][j]; hHrtf->pIndex_frequency_max[i][j] = hSetOfHRTF->hHRTF_hrir_hoa3->pIndex_frequency_max[i][j]; @@ -1198,16 +1067,10 @@ static ivas_error ivas_rend_initCrend_fx( FOR( i = 0; i < hHrtf->max_num_ir; i++ ) { -#ifndef FIX_INV_DIFFUSE_WEIGHT - hHrtf->inv_diffuse_weight_fx[i] = hSetOfHRTF->hHRTF_hrir_hoa2->inv_diffuse_weight_fx[i]; // Q15 - move16(); -#endif FOR( j = 0; j < BINAURAL_CHANNELS; j++ ) { -#ifdef FIX_INV_DIFFUSE_WEIGHT hHrtf->inv_diffuse_weight_fx[j][i] = hSetOfHRTF->hHRTF_hrir_hoa2->inv_diffuse_weight_fx[j][i]; move16(); -#endif hHrtf->num_iterations[i][j] = hSetOfHRTF->hHRTF_hrir_hoa2->num_iterations[i][j]; hHrtf->pIndex_frequency_max[i][j] = hSetOfHRTF->hHRTF_hrir_hoa2->pIndex_frequency_max[i][j]; @@ -1247,16 +1110,10 @@ static ivas_error ivas_rend_initCrend_fx( FOR( i = 0; i < hHrtf->max_num_ir; i++ ) { -#ifndef FIX_INV_DIFFUSE_WEIGHT - hHrtf->inv_diffuse_weight_fx[i] = hSetOfHRTF->hHRTF_hrir_foa->inv_diffuse_weight_fx[i]; // Q31 - move16(); -#endif FOR( j = 0; j < BINAURAL_CHANNELS; j++ ) { -#ifdef FIX_INV_DIFFUSE_WEIGHT hHrtf->inv_diffuse_weight_fx[j][i] = hSetOfHRTF->hHRTF_hrir_foa->inv_diffuse_weight_fx[j][i]; move16(); -#endif hHrtf->num_iterations[i][j] = hSetOfHRTF->hHRTF_hrir_foa->num_iterations[i][j]; hHrtf->pIndex_frequency_max[i][j] = hSetOfHRTF->hHRTF_hrir_foa->pIndex_frequency_max[i][j]; @@ -1289,7 +1146,6 @@ static ivas_error ivas_rend_initCrend_fx( } } -#ifdef FIX_INV_DIFFUSE_WEIGHT hHrtf->same_inv_diffuse_weight = 1; for ( i = 0; i < hHrtf->max_num_ir; i++ ) { @@ -1302,7 +1158,6 @@ static ivas_error ivas_rend_initCrend_fx( } } } -#endif pCrend->hHrtfCrend = hHrtf; @@ -1607,15 +1462,10 @@ ivas_error ivas_rend_initCrendWrapper( } hCrend->hTrack = NULL; -#ifdef FIX_INV_DIFFUSE_WEIGHT hCrend->freq_buffer_re_diffuse_fx[0] = NULL; hCrend->freq_buffer_re_diffuse_fx[1] = NULL; hCrend->freq_buffer_im_diffuse_fx[0] = NULL; hCrend->freq_buffer_im_diffuse_fx[1] = NULL; -#else - hCrend->freq_buffer_re_diffuse_fx = NULL; - hCrend->freq_buffer_im_diffuse_fx = NULL; -#endif hCrend->hReverb = NULL; hCrend->reflections = NULL; hCrend->delay_line_rw_index = 0; @@ -1742,7 +1592,6 @@ ivas_error ivas_rend_openCrend( IF( max_total_ir_len > 0 ) { -#ifdef FIX_INV_DIFFUSE_WEIGHT IF( ( hCrend->freq_buffer_re_diffuse_fx[0] = (Word32 *) malloc( sizeof( Word32 ) * max_total_ir_len ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend" ); @@ -1758,22 +1607,11 @@ ivas_error ivas_rend_openCrend( { hCrend->freq_buffer_re_diffuse_fx[1] = NULL; } -#else - IF( ( hCrend->freq_buffer_re_diffuse_fx = (Word32 *) malloc( sizeof( Word32 ) * max_total_ir_len ) ) == NULL ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend" ); - } -#endif -#ifdef FIX_INV_DIFFUSE_WEIGHT set_zero2_fx( hCrend->freq_buffer_re_diffuse_fx[0], max_total_ir_len ); IF( hCrend->freq_buffer_re_diffuse_fx[1] != NULL ) { set_zero2_fx( hCrend->freq_buffer_re_diffuse_fx[1], max_total_ir_len ); } -#else - set_zero2_fx( hCrend->freq_buffer_re_diffuse_fx, max_total_ir_len ); -#endif -#ifdef FIX_INV_DIFFUSE_WEIGHT IF( ( hCrend->freq_buffer_im_diffuse_fx[0] = (Word32 *) malloc( sizeof( Word32 ) * max_total_ir_len ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend" ); @@ -1789,33 +1627,18 @@ ivas_error ivas_rend_openCrend( { hCrend->freq_buffer_im_diffuse_fx[1] = NULL; } -#else - IF( ( hCrend->freq_buffer_im_diffuse_fx = (Word32 *) malloc( sizeof( Word32 ) * max_total_ir_len ) ) == NULL ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend" ); - } -#endif -#ifdef FIX_INV_DIFFUSE_WEIGHT set_zero2_fx( hCrend->freq_buffer_im_diffuse_fx[0], max_total_ir_len ); IF( hCrend->freq_buffer_im_diffuse_fx[1] != NULL ) { set_zero2_fx( hCrend->freq_buffer_im_diffuse_fx[1], max_total_ir_len ); } -#else - set_zero2_fx( hCrend->freq_buffer_im_diffuse_fx, max_total_ir_len ); -#endif } ELSE { -#ifdef FIX_INV_DIFFUSE_WEIGHT hCrend->freq_buffer_re_diffuse_fx[0] = NULL; hCrend->freq_buffer_im_diffuse_fx[0] = NULL; hCrend->freq_buffer_re_diffuse_fx[1] = NULL; hCrend->freq_buffer_im_diffuse_fx[1] = NULL; -#else - hCrend->freq_buffer_re_diffuse_fx = NULL; - hCrend->freq_buffer_im_diffuse_fx = NULL; -#endif } max_total_ir_len = add( extract_l( L_shr( L_add( L_shl( Mult_32_32( hHrtf->latency_s_fx, output_Fs ), 1 ), 1 ), 1 ) ), subframe_length ); /*(int16_t) ( hHrtf->latency_s * output_Fs + 0.5f ) + subframe_length;*/ @@ -1956,7 +1779,6 @@ void ivas_rend_closeCrend( free( hCrend->lfe_delay_line_fx ); hCrend->lfe_delay_line_fx = NULL; } -#ifdef FIX_INV_DIFFUSE_WEIGHT IF( hCrend->freq_buffer_re_diffuse_fx[0] != NULL ) { free( hCrend->freq_buffer_re_diffuse_fx[0] ); @@ -1980,18 +1802,6 @@ void ivas_rend_closeCrend( free( hCrend->freq_buffer_im_diffuse_fx[1] ); hCrend->freq_buffer_im_diffuse_fx[1] = NULL; } -#else - IF( hCrend->freq_buffer_re_diffuse_fx != NULL ) - { - free( hCrend->freq_buffer_re_diffuse_fx ); - hCrend->freq_buffer_re_diffuse_fx = NULL; - } - IF( hCrend->freq_buffer_im_diffuse_fx != NULL ) - { - free( hCrend->freq_buffer_im_diffuse_fx ); - hCrend->freq_buffer_im_diffuse_fx = NULL; - } -#endif IF( hCrend->hTrack != NULL ) { free( hCrend->hTrack ); @@ -2074,9 +1884,7 @@ static ivas_error ivas_rend_crendConvolver( Word16 nchan_in, nchan_out; const Word32 *pIn; Word32 *pFreq_buf_re, *pFreq_buf_im; -#ifdef FIX_INV_DIFFUSE_WEIGHT Word32 *pFreq_buf2_re, *pFreq_buf2_im; -#endif const Word32 *pFreq_filt_re, *pFreq_filt_im; Word32 pOut[L_FRAME48k * 2]; Word32 tmp_out_re[L_FRAME48k]; @@ -2119,7 +1927,6 @@ static ivas_error ivas_rend_crendConvolver( IF( pCrend->hHrtfCrend->num_iterations_diffuse[0] > 0 ) { -#ifdef FIX_INV_DIFFUSE_WEIGHT set32_fx( &hCrend->freq_buffer_re_diffuse_fx[0][offset_diffuse], 0, subframe_length ); set32_fx( &hCrend->freq_buffer_im_diffuse_fx[0][offset_diffuse], 0, subframe_length ); if ( pCrend->hHrtfCrend->same_inv_diffuse_weight == 0 ) @@ -2127,10 +1934,6 @@ static ivas_error ivas_rend_crendConvolver( set32_fx( &hCrend->freq_buffer_re_diffuse_fx[1][offset_diffuse], 0, subframe_length ); set32_fx( &hCrend->freq_buffer_im_diffuse_fx[1][offset_diffuse], 0, subframe_length ); } -#else - set32_fx( &hCrend->freq_buffer_re_diffuse_fx[offset_diffuse], 0, subframe_length ); - set32_fx( &hCrend->freq_buffer_im_diffuse_fx[offset_diffuse], 0, subframe_length ); -#endif } i = 0; @@ -2143,7 +1946,6 @@ static ivas_error ivas_rend_crendConvolver( { IF( pCrend->hHrtfCrend->num_iterations_diffuse[0] > 0 ) { -#ifdef FIX_INV_DIFFUSE_WEIGHT IF( pCrend->hHrtfCrend->same_inv_diffuse_weight ) { pFreq_buf_re = &hCrend->freq_buffer_re_diffuse_fx[0][offset_diffuse]; @@ -2180,19 +1982,6 @@ static ivas_error ivas_rend_crendConvolver( move32(); } } -#else - pFreq_buf_re = &hCrend->freq_buffer_re_diffuse_fx[offset_diffuse]; // Qx - pFreq_buf_im = &hCrend->freq_buffer_im_diffuse_fx[offset_diffuse]; // Qx - pFreq_filt_re = &hCrend->freq_buffer_re_fx[i][offset]; // Qx - pFreq_filt_im = &hCrend->freq_buffer_im_fx[i][offset]; // Qx - FOR( k = 0; k < pCrend->hHrtfCrend->index_frequency_max_diffuse; k++ ) - { - pFreq_buf_re[k] = L_add( Mpy_32_16_r( pFreq_filt_re[k], pCrend->hHrtfCrend->inv_diffuse_weight_fx[i] ), pFreq_buf_re[k] ); // Qx - pFreq_buf_im[k] = L_add( Mpy_32_16_r( pFreq_filt_im[k], pCrend->hHrtfCrend->inv_diffuse_weight_fx[i] ), pFreq_buf_im[k] ); // Qx - move32(); - move32(); - } -#endif } pFreq_buf_re = &hCrend->freq_buffer_re_fx[i][offset]; // Qx pFreq_buf_im = &hCrend->freq_buffer_im_fx[i][offset]; // Qx @@ -2253,7 +2042,6 @@ static ivas_error ivas_rend_crendConvolver( index_in = index_in % pCrend->hHrtfCrend->num_iterations_diffuse[0]; move16(); offset_diffuse = L_mult0( index_in, subframe_length ); -#ifdef FIX_INV_DIFFUSE_WEIGHT if ( pCrend->hHrtfCrend->same_inv_diffuse_weight ) { pFreq_buf_re = &hCrend->freq_buffer_re_diffuse_fx[0][offset_diffuse]; @@ -2264,10 +2052,6 @@ static ivas_error ivas_rend_crendConvolver( pFreq_buf_re = &hCrend->freq_buffer_re_diffuse_fx[j][offset_diffuse]; pFreq_buf_im = &hCrend->freq_buffer_im_diffuse_fx[j][offset_diffuse]; } -#else - pFreq_buf_re = &hCrend->freq_buffer_re_diffuse_fx[offset_diffuse]; // Qx - pFreq_buf_im = &hCrend->freq_buffer_im_diffuse_fx[offset_diffuse]; // Qx -#endif pFreq_filt_re = &pCrend->hHrtfCrend->pOut_to_bin_diffuse_re_fx[j][offset]; // Q31 pFreq_filt_im = &pCrend->hHrtfCrend->pOut_to_bin_diffuse_im_fx[j][offset]; // Q31 FOR( k = 0; k < pCrend->hHrtfCrend->pIndex_frequency_max_diffuse[j][m]; k++ ) diff --git a/lib_rend/ivas_rom_binaural_crend_head.h b/lib_rend/ivas_rom_binaural_crend_head.h index 0a8e3b7c6..30d9cbb24 100644 --- a/lib_rend/ivas_rom_binaural_crend_head.h +++ b/lib_rend/ivas_rom_binaural_crend_head.h @@ -61,11 +61,7 @@ extern UWord16 CRendBin_Combined_HRIR_num_iterations_48kHz[HRTF_LS_CHANNELS][BIN extern UWord16 CRendBin_Combined_HRIR_num_iterations_diffuse_48kHz[BINAURAL_CHANNELS]; extern UWord16 CRendBin_Combined_HRIR_pIndex_frequency_max_48kHz[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][1]; extern UWord16 CRendBin_Combined_HRIR_index_frequency_max_diffuse_48kHz; -#ifdef FIX_INV_DIFFUSE_WEIGHT extern Word16 CRendBin_Combined_HRIR_inv_diffuse_weight_48kHz_fx[BINAURAL_CHANNELS][HRTF_LS_CHANNELS]; -#else -extern Word16 CRendBin_Combined_HRIR_inv_diffuse_weight_48kHz_fx[HRTF_LS_CHANNELS]; -#endif extern UWord16 *CRendBin_Combined_HRIR_pIndex_frequency_max_diffuse_48kHz[BINAURAL_CHANNELS]; extern Word32 CRendBin_Combined_HRIR_coeff_re_48kHz_fx[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][240]; extern Word32 CRendBin_Combined_HRIR_coeff_im_48kHz_fx[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][240]; @@ -79,11 +75,7 @@ extern UWord16 CRendBin_Combined_HRIR_num_iterations_32kHz[HRTF_LS_CHANNELS][BIN extern UWord16 CRendBin_Combined_HRIR_num_iterations_diffuse_32kHz[BINAURAL_CHANNELS]; extern UWord16 CRendBin_Combined_HRIR_pIndex_frequency_max_32kHz[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][1]; extern UWord16 CRendBin_Combined_HRIR_index_frequency_max_diffuse_32kHz; -#ifdef FIX_INV_DIFFUSE_WEIGHT extern Word16 CRendBin_Combined_HRIR_inv_diffuse_weight_32kHz_fx[BINAURAL_CHANNELS][HRTF_LS_CHANNELS]; -#else -extern Word16 CRendBin_Combined_HRIR_inv_diffuse_weight_32kHz_fx[HRTF_LS_CHANNELS]; -#endif extern UWord16 *CRendBin_Combined_HRIR_pIndex_frequency_max_diffuse_32kHz[BINAURAL_CHANNELS]; extern Word32 CRendBin_Combined_HRIR_coeff_re_32kHz_fx[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][160]; extern Word32 CRendBin_Combined_HRIR_coeff_im_32kHz_fx[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][160]; @@ -97,11 +89,7 @@ extern UWord16 CRendBin_Combined_HRIR_num_iterations_16kHz[HRTF_LS_CHANNELS][BIN extern UWord16 CRendBin_Combined_HRIR_num_iterations_diffuse_16kHz[BINAURAL_CHANNELS]; extern UWord16 CRendBin_Combined_HRIR_pIndex_frequency_max_16kHz[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][1]; extern UWord16 CRendBin_Combined_HRIR_index_frequency_max_diffuse_16kHz; -#ifdef FIX_INV_DIFFUSE_WEIGHT extern Word16 CRendBin_Combined_HRIR_inv_diffuse_weight_16kHz_fx[BINAURAL_CHANNELS][HRTF_LS_CHANNELS]; -#else -extern Word16 CRendBin_Combined_HRIR_inv_diffuse_weight_16kHz_fx[HRTF_LS_CHANNELS]; -#endif extern UWord16 *CRendBin_Combined_HRIR_pIndex_frequency_max_diffuse_16kHz[BINAURAL_CHANNELS]; extern Word32 CRendBin_Combined_HRIR_coeff_re_16kHz_fx[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][80]; extern Word32 CRendBin_Combined_HRIR_coeff_im_16kHz_fx[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][80]; @@ -122,11 +110,7 @@ extern UWord16 CRendBin_FOA_HRIR_num_iterations_48kHz[FOA_CHANNELS][BINAURAL_CHA extern UWord16 CRendBin_FOA_HRIR_num_iterations_diffuse_48kHz[BINAURAL_CHANNELS]; extern UWord16 CRendBin_FOA_HRIR_pIndex_frequency_max_48kHz[FOA_CHANNELS][BINAURAL_CHANNELS][1]; extern UWord16 CRendBin_FOA_HRIR_index_frequency_max_diffuse_48kHz; -#ifdef FIX_INV_DIFFUSE_WEIGHT extern Word16 CRendBin_FOA_HRIR_inv_diffuse_weight_48kHz_fx[BINAURAL_CHANNELS][FOA_CHANNELS]; -#else -extern Word16 CRendBin_FOA_HRIR_inv_diffuse_weight_48kHz_fx[FOA_CHANNELS]; -#endif extern UWord16 *CRendBin_FOA_HRIR_pIndex_frequency_max_diffuse_48kHz[BINAURAL_CHANNELS]; extern Word32 CRendBin_FOA_HRIR_coeff_re_48kHz_fx[FOA_CHANNELS][BINAURAL_CHANNELS][240]; extern Word32 CRendBin_FOA_HRIR_coeff_im_48kHz_fx[FOA_CHANNELS][BINAURAL_CHANNELS][240]; @@ -140,11 +124,7 @@ extern UWord16 CRendBin_FOA_HRIR_num_iterations_32kHz[FOA_CHANNELS][BINAURAL_CHA extern UWord16 CRendBin_FOA_HRIR_num_iterations_diffuse_32kHz[BINAURAL_CHANNELS]; extern UWord16 CRendBin_FOA_HRIR_pIndex_frequency_max_32kHz[FOA_CHANNELS][BINAURAL_CHANNELS][1]; extern UWord16 CRendBin_FOA_HRIR_index_frequency_max_diffuse_32kHz; -#ifdef FIX_INV_DIFFUSE_WEIGHT extern Word16 CRendBin_FOA_HRIR_inv_diffuse_weight_32kHz_fx[BINAURAL_CHANNELS][FOA_CHANNELS]; -#else -extern Word16 CRendBin_FOA_HRIR_inv_diffuse_weight_32kHz_fx[FOA_CHANNELS]; -#endif extern UWord16 *CRendBin_FOA_HRIR_pIndex_frequency_max_diffuse_32kHz[BINAURAL_CHANNELS]; extern Word32 CRendBin_FOA_HRIR_coeff_re_32kHz_fx[FOA_CHANNELS][BINAURAL_CHANNELS][160]; extern Word32 CRendBin_FOA_HRIR_coeff_im_32kHz_fx[FOA_CHANNELS][BINAURAL_CHANNELS][160]; @@ -158,11 +138,7 @@ extern UWord16 CRendBin_FOA_HRIR_num_iterations_16kHz[FOA_CHANNELS][BINAURAL_CHA extern UWord16 CRendBin_FOA_HRIR_num_iterations_diffuse_16kHz[BINAURAL_CHANNELS]; extern UWord16 CRendBin_FOA_HRIR_pIndex_frequency_max_16kHz[FOA_CHANNELS][BINAURAL_CHANNELS][1]; extern UWord16 CRendBin_FOA_HRIR_index_frequency_max_diffuse_16kHz; -#ifdef FIX_INV_DIFFUSE_WEIGHT extern Word16 CRendBin_FOA_HRIR_inv_diffuse_weight_16kHz_fx[BINAURAL_CHANNELS][FOA_CHANNELS]; -#else -extern Word16 CRendBin_FOA_HRIR_inv_diffuse_weight_16kHz_fx[FOA_CHANNELS]; -#endif extern UWord16 *CRendBin_FOA_HRIR_pIndex_frequency_max_diffuse_16kHz[BINAURAL_CHANNELS]; extern Word32 CRendBin_FOA_HRIR_coeff_re_16kHz_fx[FOA_CHANNELS][BINAURAL_CHANNELS][80]; extern Word32 CRendBin_FOA_HRIR_coeff_im_16kHz_fx[FOA_CHANNELS][BINAURAL_CHANNELS][80]; @@ -182,11 +158,7 @@ extern UWord16 CRendBin_HOA2_HRIR_num_iterations_48kHz[HOA2_CHANNELS][BINAURAL_C extern UWord16 CRendBin_HOA2_HRIR_num_iterations_diffuse_48kHz[BINAURAL_CHANNELS]; extern UWord16 CRendBin_HOA2_HRIR_pIndex_frequency_max_48kHz[HOA2_CHANNELS][BINAURAL_CHANNELS][1]; extern UWord16 CRendBin_HOA2_HRIR_index_frequency_max_diffuse_48kHz; -#ifdef FIX_INV_DIFFUSE_WEIGHT extern Word16 CRendBin_HOA2_HRIR_inv_diffuse_weight_48kHz_fx[BINAURAL_CHANNELS][HOA2_CHANNELS]; -#else -extern Word16 CRendBin_HOA2_HRIR_inv_diffuse_weight_48kHz_fx[HOA2_CHANNELS]; -#endif extern UWord16 *CRendBin_HOA2_HRIR_pIndex_frequency_max_diffuse_48kHz[BINAURAL_CHANNELS]; extern Word32 CRendBin_HOA2_HRIR_coeff_re_48kHz_fx[HOA2_CHANNELS][BINAURAL_CHANNELS][240]; extern Word32 CRendBin_HOA2_HRIR_coeff_im_48kHz_fx[HOA2_CHANNELS][BINAURAL_CHANNELS][240]; @@ -200,11 +172,7 @@ extern UWord16 CRendBin_HOA2_HRIR_num_iterations_32kHz[HOA2_CHANNELS][BINAURAL_C extern UWord16 CRendBin_HOA2_HRIR_num_iterations_diffuse_32kHz[BINAURAL_CHANNELS]; extern UWord16 CRendBin_HOA2_HRIR_pIndex_frequency_max_32kHz[HOA2_CHANNELS][BINAURAL_CHANNELS][1]; extern UWord16 CRendBin_HOA2_HRIR_index_frequency_max_diffuse_32kHz; -#ifdef FIX_INV_DIFFUSE_WEIGHT extern Word16 CRendBin_HOA2_HRIR_inv_diffuse_weight_32kHz_fx[BINAURAL_CHANNELS][HOA2_CHANNELS]; -#else -extern Word16 CRendBin_HOA2_HRIR_inv_diffuse_weight_32kHz_fx[HOA2_CHANNELS]; -#endif extern UWord16 *CRendBin_HOA2_HRIR_pIndex_frequency_max_diffuse_32kHz[BINAURAL_CHANNELS]; extern Word32 CRendBin_HOA2_HRIR_coeff_re_32kHz_fx[HOA2_CHANNELS][BINAURAL_CHANNELS][160]; extern Word32 CRendBin_HOA2_HRIR_coeff_im_32kHz_fx[HOA2_CHANNELS][BINAURAL_CHANNELS][160]; @@ -218,11 +186,7 @@ extern UWord16 CRendBin_HOA2_HRIR_num_iterations_16kHz[HOA2_CHANNELS][BINAURAL_C extern UWord16 CRendBin_HOA2_HRIR_num_iterations_diffuse_16kHz[BINAURAL_CHANNELS]; extern UWord16 CRendBin_HOA2_HRIR_pIndex_frequency_max_16kHz[HOA2_CHANNELS][BINAURAL_CHANNELS][1]; extern UWord16 CRendBin_HOA2_HRIR_index_frequency_max_diffuse_16kHz; -#ifdef FIX_INV_DIFFUSE_WEIGHT extern Word16 CRendBin_HOA2_HRIR_inv_diffuse_weight_16kHz_fx[BINAURAL_CHANNELS][HOA2_CHANNELS]; -#else -extern Word16 CRendBin_HOA2_HRIR_inv_diffuse_weight_16kHz_fx[HOA2_CHANNELS]; -#endif extern UWord16 *CRendBin_HOA2_HRIR_pIndex_frequency_max_diffuse_16kHz[BINAURAL_CHANNELS]; extern Word32 CRendBin_HOA2_HRIR_coeff_re_16kHz_fx[HOA2_CHANNELS][BINAURAL_CHANNELS][80]; extern Word32 CRendBin_HOA2_HRIR_coeff_im_16kHz_fx[HOA2_CHANNELS][BINAURAL_CHANNELS][80]; @@ -241,11 +205,7 @@ extern UWord16 CRendBin_HOA3_HRIR_num_iterations_48kHz[HOA3_CHANNELS][BINAURAL_C extern UWord16 CRendBin_HOA3_HRIR_num_iterations_diffuse_48kHz[BINAURAL_CHANNELS]; extern UWord16 CRendBin_HOA3_HRIR_pIndex_frequency_max_48kHz[HOA3_CHANNELS][BINAURAL_CHANNELS][1]; extern UWord16 CRendBin_HOA3_HRIR_index_frequency_max_diffuse_48kHz; -#ifdef FIX_INV_DIFFUSE_WEIGHT extern Word16 CRendBin_HOA3_HRIR_inv_diffuse_weight_48kHz_fx[BINAURAL_CHANNELS][HOA3_CHANNELS]; -#else -extern Word16 CRendBin_HOA3_HRIR_inv_diffuse_weight_48kHz_fx[HOA3_CHANNELS]; -#endif extern UWord16 *CRendBin_HOA3_HRIR_pIndex_frequency_max_diffuse_48kHz[BINAURAL_CHANNELS]; extern Word32 CRendBin_HOA3_HRIR_coeff_re_48kHz_fx[HOA3_CHANNELS][BINAURAL_CHANNELS][240]; extern Word32 CRendBin_HOA3_HRIR_coeff_im_48kHz_fx[HOA3_CHANNELS][BINAURAL_CHANNELS][240]; @@ -259,11 +219,7 @@ extern UWord16 CRendBin_HOA3_HRIR_num_iterations_32kHz[HOA3_CHANNELS][BINAURAL_C extern UWord16 CRendBin_HOA3_HRIR_num_iterations_diffuse_32kHz[BINAURAL_CHANNELS]; extern UWord16 CRendBin_HOA3_HRIR_pIndex_frequency_max_32kHz[HOA3_CHANNELS][BINAURAL_CHANNELS][1]; extern UWord16 CRendBin_HOA3_HRIR_index_frequency_max_diffuse_32kHz; -#ifdef FIX_INV_DIFFUSE_WEIGHT extern Word16 CRendBin_HOA3_HRIR_inv_diffuse_weight_32kHz_fx[BINAURAL_CHANNELS][HOA3_CHANNELS]; -#else -extern Word16 CRendBin_HOA3_HRIR_inv_diffuse_weight_32kHz_fx[HOA3_CHANNELS]; -#endif extern UWord16 *CRendBin_HOA3_HRIR_pIndex_frequency_max_diffuse_32kHz[BINAURAL_CHANNELS]; extern Word32 CRendBin_HOA3_HRIR_coeff_re_32kHz_fx[HOA3_CHANNELS][BINAURAL_CHANNELS][160]; extern Word32 CRendBin_HOA3_HRIR_coeff_im_32kHz_fx[HOA3_CHANNELS][BINAURAL_CHANNELS][160]; @@ -277,11 +233,7 @@ extern UWord16 CRendBin_HOA3_HRIR_num_iterations_16kHz[HOA3_CHANNELS][BINAURAL_C extern UWord16 CRendBin_HOA3_HRIR_num_iterations_diffuse_16kHz[BINAURAL_CHANNELS]; extern UWord16 CRendBin_HOA3_HRIR_pIndex_frequency_max_16kHz[HOA3_CHANNELS][BINAURAL_CHANNELS][1]; extern UWord16 CRendBin_HOA3_HRIR_index_frequency_max_diffuse_16kHz; -#ifdef FIX_INV_DIFFUSE_WEIGHT extern Word16 CRendBin_HOA3_HRIR_inv_diffuse_weight_16kHz_fx[BINAURAL_CHANNELS][HOA3_CHANNELS]; -#else -extern Word16 CRendBin_HOA3_HRIR_inv_diffuse_weight_16kHz_fx[HOA3_CHANNELS]; -#endif extern UWord16 *CRendBin_HOA3_HRIR_pIndex_frequency_max_diffuse_16kHz[BINAURAL_CHANNELS]; extern Word32 CRendBin_HOA3_HRIR_coeff_re_16kHz_fx[HOA3_CHANNELS][BINAURAL_CHANNELS][80]; extern Word32 CRendBin_HOA3_HRIR_coeff_im_16kHz_fx[HOA3_CHANNELS][BINAURAL_CHANNELS][80]; @@ -301,11 +253,7 @@ extern UWord16 CRendBin_Combined_BRIR_num_iterations_48kHz[HRTF_LS_CHANNELS][BIN extern UWord16 CRendBin_Combined_BRIR_num_iterations_diffuse_48kHz[BINAURAL_CHANNELS]; extern UWord16 CRendBin_Combined_BRIR_pIndex_frequency_max_48kHz[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][22]; extern UWord16 CRendBin_Combined_BRIR_index_frequency_max_diffuse_48kHz; -#ifdef FIX_INV_DIFFUSE_WEIGHT extern Word16 CRendBin_Combined_BRIR_inv_diffuse_weight_48kHz_fx[BINAURAL_CHANNELS][HRTF_LS_CHANNELS]; -#else -extern Word16 CRendBin_Combined_BRIR_inv_diffuse_weight_48kHz_fx[HRTF_LS_CHANNELS]; -#endif extern UWord16 CRendBin_Combined_BRIR_pIndex_frequency_max_diffuse_48kHz[BINAURAL_CHANNELS][40]; extern Word32 CRendBin_Combined_BRIR_coeff_re_48kHz_fx[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][2955]; extern Word32 CRendBin_Combined_BRIR_coeff_im_48kHz_fx[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][2955]; @@ -319,11 +267,7 @@ extern UWord16 CRendBin_Combined_BRIR_num_iterations_32kHz[HRTF_LS_CHANNELS][BIN extern UWord16 CRendBin_Combined_BRIR_num_iterations_diffuse_32kHz[BINAURAL_CHANNELS]; extern UWord16 CRendBin_Combined_BRIR_pIndex_frequency_max_32kHz[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][22]; extern UWord16 CRendBin_Combined_BRIR_index_frequency_max_diffuse_32kHz; -#ifdef FIX_INV_DIFFUSE_WEIGHT extern Word16 CRendBin_Combined_BRIR_inv_diffuse_weight_32kHz_fx[BINAURAL_CHANNELS][HRTF_LS_CHANNELS]; -#else -extern Word16 CRendBin_Combined_BRIR_inv_diffuse_weight_32kHz_fx[HRTF_LS_CHANNELS]; -#endif extern UWord16 CRendBin_Combined_BRIR_pIndex_frequency_max_diffuse_32kHz[BINAURAL_CHANNELS][40]; extern Word32 CRendBin_Combined_BRIR_coeff_re_32kHz_fx[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][2819]; extern Word32 CRendBin_Combined_BRIR_coeff_im_32kHz_fx[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][2819]; @@ -337,11 +281,7 @@ extern UWord16 CRendBin_Combined_BRIR_num_iterations_16kHz[HRTF_LS_CHANNELS][BIN extern UWord16 CRendBin_Combined_BRIR_num_iterations_diffuse_16kHz[BINAURAL_CHANNELS]; extern UWord16 CRendBin_Combined_BRIR_pIndex_frequency_max_16kHz[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][23]; extern UWord16 CRendBin_Combined_BRIR_index_frequency_max_diffuse_16kHz; -#ifdef FIX_INV_DIFFUSE_WEIGHT extern Word16 CRendBin_Combined_BRIR_inv_diffuse_weight_16kHz_fx[BINAURAL_CHANNELS][HRTF_LS_CHANNELS]; -#else -extern Word16 CRendBin_Combined_BRIR_inv_diffuse_weight_16kHz_fx[HRTF_LS_CHANNELS]; -#endif extern UWord16 CRendBin_Combined_BRIR_pIndex_frequency_max_diffuse_16kHz[BINAURAL_CHANNELS][40]; extern Word32 CRendBin_Combined_BRIR_coeff_re_16kHz_fx[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][1774]; extern Word32 CRendBin_Combined_BRIR_coeff_im_16kHz_fx[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][1774]; diff --git a/lib_rend/ivas_rom_binaural_crend_head_fx.c b/lib_rend/ivas_rom_binaural_crend_head_fx.c index bdf8e0252..866a70c97 100644 --- a/lib_rend/ivas_rom_binaural_crend_head_fx.c +++ b/lib_rend/ivas_rom_binaural_crend_head_fx.c @@ -61,11 +61,7 @@ const UWord16 CRendBin_Combined_HRIR_num_iterations_48kHz[HRTF_LS_CHANNELS][BINA const UWord16 CRendBin_Combined_HRIR_num_iterations_diffuse_48kHz[BINAURAL_CHANNELS] = {0, 0}; const UWord16 CRendBin_Combined_HRIR_pIndex_frequency_max_48kHz[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][1]={{{240},{240}},{{240},{240}},{{240},{240}},{{240},{240}},{{240},{240}},{{240},{240}},{{240},{240}},{{240},{240}},{{240},{240}},{{240},{240}},{{240},{240}},{{240},{240}},{{240},{240}},{{240},{240}},{{240},{240}}}; const UWord16 CRendBin_Combined_HRIR_index_frequency_max_diffuse_48kHz = 0; -#ifdef FIX_INV_DIFFUSE_WEIGHT const Word16 CRendBin_Combined_HRIR_inv_diffuse_weight_48kHz_fx[BINAURAL_CHANNELS][HRTF_LS_CHANNELS]={{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}; -#else -const Word16 CRendBin_Combined_HRIR_inv_diffuse_weight_48kHz_fx[HRTF_LS_CHANNELS]={0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; -#endif const UWord16 *CRendBin_Combined_HRIR_pIndex_frequency_max_diffuse_48kHz[BINAURAL_CHANNELS]={NULL,NULL}; const Word32 *CRendBin_Combined_HRIR_coeff_diffuse_re_48kHz_fx[BINAURAL_CHANNELS]={NULL,NULL}; const Word32 *CRendBin_Combined_HRIR_coeff_diffuse_im_48kHz_fx[BINAURAL_CHANNELS]={NULL,NULL}; @@ -76,11 +72,7 @@ const UWord16 CRendBin_Combined_HRIR_num_iterations_32kHz[HRTF_LS_CHANNELS][BINA const UWord16 CRendBin_Combined_HRIR_num_iterations_diffuse_32kHz[BINAURAL_CHANNELS] = {0, 0}; const UWord16 CRendBin_Combined_HRIR_pIndex_frequency_max_32kHz[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][1]={{{160},{160}},{{160},{160}},{{160},{160}},{{160},{160}},{{160},{160}},{{160},{160}},{{160},{160}},{{160},{160}},{{160},{160}},{{160},{160}},{{160},{160}},{{160},{160}},{{160},{160}},{{160},{160}},{{160},{160}}}; const UWord16 CRendBin_Combined_HRIR_index_frequency_max_diffuse_32kHz = 0; -#ifdef FIX_INV_DIFFUSE_WEIGHT const Word16 CRendBin_Combined_HRIR_inv_diffuse_weight_32kHz_fx[BINAURAL_CHANNELS][HRTF_LS_CHANNELS]={{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}; -#else -const Word16 CRendBin_Combined_HRIR_inv_diffuse_weight_32kHz_fx[HRTF_LS_CHANNELS]={0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}; -#endif const UWord16 *CRendBin_Combined_HRIR_pIndex_frequency_max_diffuse_32kHz[BINAURAL_CHANNELS]={NULL,NULL}; const Word32 *CRendBin_Combined_HRIR_coeff_diffuse_re_32kHz_fx[BINAURAL_CHANNELS]={NULL,NULL}; const Word32 *CRendBin_Combined_HRIR_coeff_diffuse_im_32kHz_fx[BINAURAL_CHANNELS]={NULL,NULL}; @@ -91,11 +83,7 @@ const UWord16 CRendBin_Combined_HRIR_num_iterations_16kHz[HRTF_LS_CHANNELS][BINA const UWord16 CRendBin_Combined_HRIR_num_iterations_diffuse_16kHz[BINAURAL_CHANNELS] = {0, 0}; const UWord16 CRendBin_Combined_HRIR_pIndex_frequency_max_16kHz[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][1]={{{80},{80}},{{80},{80}},{{80},{80}},{{80},{80}},{{80},{80}},{{80},{80}},{{80},{80}},{{80},{80}},{{80},{80}},{{80},{80}},{{80},{80}},{{80},{80}},{{80},{80}},{{80},{80}},{{80},{80}}}; const UWord16 CRendBin_Combined_HRIR_index_frequency_max_diffuse_16kHz = 0; -#ifdef FIX_INV_DIFFUSE_WEIGHT const Word16 CRendBin_Combined_HRIR_inv_diffuse_weight_16kHz_fx[BINAURAL_CHANNELS][HRTF_LS_CHANNELS]={{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}; -#else -const Word16 CRendBin_Combined_HRIR_inv_diffuse_weight_16kHz_fx[HRTF_LS_CHANNELS]={0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}; -#endif const UWord16 *CRendBin_Combined_HRIR_pIndex_frequency_max_diffuse_16kHz[BINAURAL_CHANNELS]={NULL,NULL}; const Word32 *CRendBin_Combined_HRIR_coeff_diffuse_re_16kHz_fx[BINAURAL_CHANNELS]={NULL,NULL}; const Word32 *CRendBin_Combined_HRIR_coeff_diffuse_im_16kHz_fx[BINAURAL_CHANNELS]={NULL,NULL}; @@ -113,11 +101,7 @@ const UWord16 CRendBin_FOA_HRIR_num_iterations_48kHz[FOA_CHANNELS][BINAURAL_CHAN const UWord16 CRendBin_FOA_HRIR_num_iterations_diffuse_48kHz[BINAURAL_CHANNELS] = {0, 0}; const UWord16 CRendBin_FOA_HRIR_pIndex_frequency_max_48kHz[FOA_CHANNELS][BINAURAL_CHANNELS][1]={{{240},{240}},{{240},{240}},{{240},{240}},{{240},{240}}}; const UWord16 CRendBin_FOA_HRIR_index_frequency_max_diffuse_48kHz = 0; -#ifdef FIX_INV_DIFFUSE_WEIGHT const Word16 CRendBin_FOA_HRIR_inv_diffuse_weight_48kHz_fx[BINAURAL_CHANNELS][FOA_CHANNELS]={{0, 0, 0, 0},{0, 0, 0, 0}}; -#else -const Word16 CRendBin_FOA_HRIR_inv_diffuse_weight_48kHz_fx[FOA_CHANNELS]={0, 0, 0, 0}; -#endif const UWord16 *CRendBin_FOA_HRIR_pIndex_frequency_max_diffuse_48kHz[BINAURAL_CHANNELS]={NULL,NULL}; const Word32 *CRendBin_FOA_HRIR_coeff_diffuse_re_48kHz_fx[BINAURAL_CHANNELS]={NULL,NULL}; const Word32 *CRendBin_FOA_HRIR_coeff_diffuse_im_48kHz_fx[BINAURAL_CHANNELS]={NULL,NULL}; @@ -128,11 +112,7 @@ const UWord16 CRendBin_FOA_HRIR_num_iterations_32kHz[FOA_CHANNELS][BINAURAL_CHAN const UWord16 CRendBin_FOA_HRIR_num_iterations_diffuse_32kHz[BINAURAL_CHANNELS] = {0, 0}; const UWord16 CRendBin_FOA_HRIR_pIndex_frequency_max_32kHz[FOA_CHANNELS][BINAURAL_CHANNELS][1]={{{160},{160}},{{160},{160}},{{160},{160}},{{160},{160}}}; const UWord16 CRendBin_FOA_HRIR_index_frequency_max_diffuse_32kHz = 0; -#ifdef FIX_INV_DIFFUSE_WEIGHT const Word16 CRendBin_FOA_HRIR_inv_diffuse_weight_32kHz_fx[BINAURAL_CHANNELS][FOA_CHANNELS]={{0, 0, 0, 0},{0, 0, 0, 0}}; -#else -const Word16 CRendBin_FOA_HRIR_inv_diffuse_weight_32kHz_fx[FOA_CHANNELS]={0, 0, 0, 0}; -#endif const UWord16 *CRendBin_FOA_HRIR_pIndex_frequency_max_diffuse_32kHz[BINAURAL_CHANNELS]={NULL,NULL}; const Word32 *CRendBin_FOA_HRIR_coeff_diffuse_re_32kHz_fx[BINAURAL_CHANNELS]={NULL,NULL}; const Word32 *CRendBin_FOA_HRIR_coeff_diffuse_im_32kHz_fx[BINAURAL_CHANNELS]={NULL,NULL}; @@ -143,11 +123,7 @@ const UWord16 CRendBin_FOA_HRIR_num_iterations_16kHz[FOA_CHANNELS][BINAURAL_CHAN const UWord16 CRendBin_FOA_HRIR_num_iterations_diffuse_16kHz[BINAURAL_CHANNELS] = {0, 0}; const UWord16 CRendBin_FOA_HRIR_pIndex_frequency_max_16kHz[FOA_CHANNELS][BINAURAL_CHANNELS][1]={{{80},{80}},{{80},{80}},{{80},{80}},{{80},{80}}}; const UWord16 CRendBin_FOA_HRIR_index_frequency_max_diffuse_16kHz = 0; -#ifdef FIX_INV_DIFFUSE_WEIGHT const Word16 CRendBin_FOA_HRIR_inv_diffuse_weight_16kHz_fx[BINAURAL_CHANNELS][FOA_CHANNELS]={{0, 0, 0, 0},{0, 0, 0, 0}}; -#else -const Word16 CRendBin_FOA_HRIR_inv_diffuse_weight_16kHz_fx[FOA_CHANNELS]={0, 0, 0, 0}; -#endif const UWord16 *CRendBin_FOA_HRIR_pIndex_frequency_max_diffuse_16kHz[BINAURAL_CHANNELS]={NULL,NULL}; const Word32 *CRendBin_FOA_HRIR_coeff_diffuse_re_16kHz_fx[BINAURAL_CHANNELS]={NULL,NULL}; const Word32 *CRendBin_FOA_HRIR_coeff_diffuse_im_16kHz_fx[BINAURAL_CHANNELS]={NULL,NULL}; @@ -164,11 +140,7 @@ const UWord16 CRendBin_HOA2_HRIR_num_iterations_48kHz[HOA2_CHANNELS][BINAURAL_CH const UWord16 CRendBin_HOA2_HRIR_num_iterations_diffuse_48kHz[BINAURAL_CHANNELS] = {0, 0}; const UWord16 CRendBin_HOA2_HRIR_pIndex_frequency_max_48kHz[HOA2_CHANNELS][BINAURAL_CHANNELS][1]={{{240},{240}},{{240},{240}},{{240},{240}},{{240},{240}},{{240},{240}},{{240},{240}},{{240},{240}},{{240},{240}},{{240},{240}}}; const UWord16 CRendBin_HOA2_HRIR_index_frequency_max_diffuse_48kHz = 0; -#ifdef FIX_INV_DIFFUSE_WEIGHT const Word16 CRendBin_HOA2_HRIR_inv_diffuse_weight_48kHz_fx[BINAURAL_CHANNELS][HOA2_CHANNELS]={{0, 0, 0, 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0, 0, 0}}; -#else -const Word16 CRendBin_HOA2_HRIR_inv_diffuse_weight_48kHz_fx[HOA2_CHANNELS]={0, 0, 0, 0, 0, 0, 0, 0, 0}; -#endif const UWord16 *CRendBin_HOA2_HRIR_pIndex_frequency_max_diffuse_48kHz[BINAURAL_CHANNELS]={NULL,NULL}; const Word32 *CRendBin_HOA2_HRIR_coeff_diffuse_re_48kHz_fx[BINAURAL_CHANNELS]={NULL,NULL}; const Word32 *CRendBin_HOA2_HRIR_coeff_diffuse_im_48kHz_fx[BINAURAL_CHANNELS]={NULL,NULL}; @@ -179,11 +151,7 @@ const UWord16 CRendBin_HOA2_HRIR_num_iterations_32kHz[HOA2_CHANNELS][BINAURAL_CH const UWord16 CRendBin_HOA2_HRIR_num_iterations_diffuse_32kHz[BINAURAL_CHANNELS] = {0, 0}; const UWord16 CRendBin_HOA2_HRIR_pIndex_frequency_max_32kHz[HOA2_CHANNELS][BINAURAL_CHANNELS][1]={{{160},{160}},{{160},{160}},{{160},{160}},{{160},{160}},{{160},{160}},{{160},{160}},{{160},{160}},{{160},{160}},{{160},{160}}}; const UWord16 CRendBin_HOA2_HRIR_index_frequency_max_diffuse_32kHz = 0; -#ifdef FIX_INV_DIFFUSE_WEIGHT const Word16 CRendBin_HOA2_HRIR_inv_diffuse_weight_32kHz_fx[BINAURAL_CHANNELS][HOA2_CHANNELS]={{0, 0, 0, 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0, 0, 0}}; -#else -const Word16 CRendBin_HOA2_HRIR_inv_diffuse_weight_32kHz_fx[HOA2_CHANNELS]={0, 0, 0, 0, 0, 0, 0, 0, 0}; -#endif const UWord16 *CRendBin_HOA2_HRIR_pIndex_frequency_max_diffuse_32kHz[BINAURAL_CHANNELS]={NULL,NULL}; const Word32 *CRendBin_HOA2_HRIR_coeff_diffuse_re_32kHz_fx[BINAURAL_CHANNELS]={NULL,NULL}; const Word32 *CRendBin_HOA2_HRIR_coeff_diffuse_im_32kHz_fx[BINAURAL_CHANNELS]={NULL,NULL}; @@ -194,11 +162,7 @@ const UWord16 CRendBin_HOA2_HRIR_num_iterations_16kHz[HOA2_CHANNELS][BINAURAL_CH const UWord16 CRendBin_HOA2_HRIR_num_iterations_diffuse_16kHz[BINAURAL_CHANNELS] = {0, 0}; const UWord16 CRendBin_HOA2_HRIR_pIndex_frequency_max_16kHz[HOA2_CHANNELS][BINAURAL_CHANNELS][1]={{{80},{80}},{{80},{80}},{{80},{80}},{{80},{80}},{{80},{80}},{{80},{80}},{{80},{80}},{{80},{80}},{{80},{80}}}; const UWord16 CRendBin_HOA2_HRIR_index_frequency_max_diffuse_16kHz = 0; -#ifdef FIX_INV_DIFFUSE_WEIGHT const Word16 CRendBin_HOA2_HRIR_inv_diffuse_weight_16kHz_fx[BINAURAL_CHANNELS][HOA2_CHANNELS]={{0, 0, 0, 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0, 0, 0}}; -#else -const Word16 CRendBin_HOA2_HRIR_inv_diffuse_weight_16kHz_fx[HOA2_CHANNELS]={0, 0, 0, 0, 0, 0, 0, 0, 0}; -#endif const UWord16 *CRendBin_HOA2_HRIR_pIndex_frequency_max_diffuse_16kHz[BINAURAL_CHANNELS]={NULL,NULL}; const Word32 *CRendBin_HOA2_HRIR_coeff_diffuse_re_16kHz_fx[BINAURAL_CHANNELS]={NULL,NULL}; const Word32 *CRendBin_HOA2_HRIR_coeff_diffuse_im_16kHz_fx[BINAURAL_CHANNELS]={NULL,NULL}; @@ -214,11 +178,7 @@ const UWord16 CRendBin_HOA3_HRIR_num_iterations_48kHz[HOA3_CHANNELS][BINAURAL_CH const UWord16 CRendBin_HOA3_HRIR_num_iterations_diffuse_48kHz[BINAURAL_CHANNELS] = {0, 0}; const UWord16 CRendBin_HOA3_HRIR_pIndex_frequency_max_48kHz[HOA3_CHANNELS][BINAURAL_CHANNELS][1]={{{240},{240}},{{240},{240}},{{240},{240}},{{240},{240}},{{240},{240}},{{240},{240}},{{240},{240}},{{240},{240}},{{240},{240}},{{240},{240}},{{240},{240}},{{240},{240}},{{240},{240}},{{240},{240}},{{240},{240}},{{240},{240}}}; const UWord16 CRendBin_HOA3_HRIR_index_frequency_max_diffuse_48kHz = 0; -#ifdef FIX_INV_DIFFUSE_WEIGHT const Word16 CRendBin_HOA3_HRIR_inv_diffuse_weight_48kHz_fx[BINAURAL_CHANNELS][HOA3_CHANNELS]={{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}; -#else -const Word16 CRendBin_HOA3_HRIR_inv_diffuse_weight_48kHz_fx[HOA3_CHANNELS]={0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; -#endif const UWord16 *CRendBin_HOA3_HRIR_pIndex_frequency_max_diffuse_48kHz[BINAURAL_CHANNELS]={NULL,NULL}; const Word32 *CRendBin_HOA3_HRIR_coeff_diffuse_re_48kHz_fx[BINAURAL_CHANNELS]={NULL,NULL}; const Word32 *CRendBin_HOA3_HRIR_coeff_diffuse_im_48kHz_fx[BINAURAL_CHANNELS]={NULL,NULL}; @@ -229,11 +189,7 @@ const UWord16 CRendBin_HOA3_HRIR_num_iterations_32kHz[HOA3_CHANNELS][BINAURAL_CH const UWord16 CRendBin_HOA3_HRIR_num_iterations_diffuse_32kHz[BINAURAL_CHANNELS] = {0, 0}; const UWord16 CRendBin_HOA3_HRIR_pIndex_frequency_max_32kHz[HOA3_CHANNELS][BINAURAL_CHANNELS][1]={{{160},{160}},{{160},{160}},{{160},{160}},{{160},{160}},{{160},{160}},{{160},{160}},{{160},{160}},{{160},{160}},{{160},{160}},{{160},{160}},{{160},{160}},{{160},{160}},{{160},{160}},{{160},{160}},{{160},{160}},{{160},{160}}}; const UWord16 CRendBin_HOA3_HRIR_index_frequency_max_diffuse_32kHz = 0; -#ifdef FIX_INV_DIFFUSE_WEIGHT const Word16 CRendBin_HOA3_HRIR_inv_diffuse_weight_32kHz_fx[BINAURAL_CHANNELS][HOA3_CHANNELS]={{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}; -#else -const Word16 CRendBin_HOA3_HRIR_inv_diffuse_weight_32kHz_fx[HOA3_CHANNELS]={0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; -#endif const UWord16 *CRendBin_HOA3_HRIR_pIndex_frequency_max_diffuse_32kHz[BINAURAL_CHANNELS]={NULL,NULL}; const Word32 *CRendBin_HOA3_HRIR_coeff_diffuse_re_32kHz_fx[BINAURAL_CHANNELS]={NULL,NULL}; const Word32 *CRendBin_HOA3_HRIR_coeff_diffuse_im_32kHz_fx[BINAURAL_CHANNELS]={NULL,NULL}; @@ -244,11 +200,7 @@ const UWord16 CRendBin_HOA3_HRIR_num_iterations_16kHz[HOA3_CHANNELS][BINAURAL_CH const UWord16 CRendBin_HOA3_HRIR_num_iterations_diffuse_16kHz[BINAURAL_CHANNELS] = {0, 0}; const UWord16 CRendBin_HOA3_HRIR_pIndex_frequency_max_16kHz[HOA3_CHANNELS][BINAURAL_CHANNELS][1]={{{80},{80}},{{80},{80}},{{80},{80}},{{80},{80}},{{80},{80}},{{80},{80}},{{80},{80}},{{80},{80}},{{80},{80}},{{80},{80}},{{80},{80}},{{80},{80}},{{80},{80}},{{80},{80}},{{80},{80}},{{80},{80}}}; const UWord16 CRendBin_HOA3_HRIR_index_frequency_max_diffuse_16kHz = 0; -#ifdef FIX_INV_DIFFUSE_WEIGHT const Word16 CRendBin_HOA3_HRIR_inv_diffuse_weight_16kHz[BINAURAL_CHANNELS][HOA3_CHANNELS]={{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}; -#else -const float CRendBin_HOA3_HRIR_inv_diffuse_weight_16kHz[HOA3_CHANNELS]={0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f}; -#endif const Word16 CRendBin_HOA3_HRIR_inv_diffuse_weight_16kHz_fx[HOA3_CHANNELS]={0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; const UWord16 *CRendBin_HOA3_HRIR_pIndex_frequency_max_diffuse_16kHz[BINAURAL_CHANNELS]={NULL,NULL}; const Word32 *CRendBin_HOA3_HRIR_coeff_diffuse_re_16kHz_fx[BINAURAL_CHANNELS]={NULL,NULL}; @@ -265,13 +217,8 @@ const UWord16 CRendBin_Combined_BRIR_num_iterations_48kHz[HRTF_LS_CHANNELS][BINA const UWord16 CRendBin_Combined_BRIR_num_iterations_diffuse_48kHz[BINAURAL_CHANNELS] = {40, 40}; const UWord16 CRendBin_Combined_BRIR_pIndex_frequency_max_48kHz[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][22]={{{116, 118, 117, 121, 112, 119, 121, 131, 134, 131, 137, 127, 134, 135, 134, 135, 129, 139, 135, 130, 128, 240},{116, 118, 117, 121, 112, 119, 121, 131, 134, 131, 137, 127, 134, 135, 134, 135, 129, 139, 135, 130, 128, 240}},{{122, 106, 121, 114, 121, 123, 119, 126, 123, 126, 127, 130, 128, 136, 132, 131, 129, 141, 137, 131, 129, 240},{122, 106, 121, 114, 121, 123, 119, 126, 123, 126, 127, 130, 128, 136, 132, 131, 129, 141, 137, 131, 129, 240}},{{118, 104, 116, 104, 123, 123, 122, 125, 130, 128, 132, 135, 131, 132, 131, 132, 135, 137, 144, 129, 129, 240},{118, 104, 116, 104, 123, 123, 122, 125, 130, 128, 132, 135, 131, 132, 131, 132, 135, 137, 144, 129, 129, 240}},{{102, 117, 116, 121, 117, 114, 115, 125, 126, 124, 125, 142, 133, 124, 129, 132, 134, 137, 143, 125, 125, 240},{102, 117, 116, 121, 117, 114, 115, 125, 126, 124, 125, 142, 133, 124, 129, 132, 134, 137, 143, 125, 125, 240}},{{116, 115, 117, 120, 121, 119, 125, 129, 123, 129, 124, 127, 128, 143, 133, 131, 136, 141, 158, 127, 131, 240},{116, 115, 117, 120, 121, 119, 125, 129, 123, 129, 124, 127, 128, 143, 133, 131, 136, 141, 158, 127, 131, 240}},{{112, 106, 118, 123, 115, 120, 129, 123, 130, 127, 130, 130, 131, 131, 131, 135, 134, 153, 138, 132, 127, 240},{112, 106, 118, 123, 115, 120, 129, 123, 130, 127, 130, 130, 131, 131, 131, 135, 134, 153, 138, 132, 127, 240}},{{107, 112, 111, 120, 115, 125, 122, 123, 132, 123, 133, 138, 125, 134, 130, 131, 135, 137, 136, 127, 121, 240},{107, 112, 111, 120, 115, 125, 122, 123, 132, 123, 133, 138, 125, 134, 130, 131, 135, 137, 136, 127, 121, 240}},{{111, 113, 132, 115, 121, 123, 121, 127, 135, 128, 129, 128, 133, 130, 133, 138, 134, 137, 152, 138, 124, 240},{111, 113, 132, 115, 121, 123, 121, 127, 135, 128, 129, 128, 133, 130, 133, 138, 134, 137, 152, 138, 124, 240}},{{114, 104, 114, 117, 125, 127, 123, 129, 123, 127, 144, 131, 138, 132, 129, 129, 132, 134, 136, 127, 121, 240},{114, 104, 114, 117, 125, 127, 123, 129, 123, 127, 144, 131, 138, 132, 129, 129, 132, 134, 136, 127, 121, 240}},{{100, 102, 112, 118, 115, 116, 118, 116, 121, 124, 125, 121, 125, 130, 127, 132, 133, 134, 134, 129, 132, 240},{100, 102, 112, 118, 115, 116, 118, 116, 121, 124, 125, 121, 125, 130, 127, 132, 133, 134, 134, 129, 132, 240}},{{106, 93, 103, 108, 124, 111, 114, 115, 120, 121, 119, 123, 131, 130, 132, 132, 132, 131, 140, 129, 131, 240},{106, 93, 103, 108, 124, 111, 114, 115, 120, 121, 119, 123, 131, 130, 132, 132, 132, 131, 140, 129, 131, 240}},{{108, 101, 115, 115, 115, 110, 121, 124, 124, 120, 122, 129, 124, 128, 125, 132, 135, 133, 138, 160, 119, 240},{108, 101, 115, 115, 115, 110, 121, 124, 124, 120, 122, 129, 124, 128, 125, 132, 135, 133, 138, 160, 119, 240}},{{112, 106, 114, 110, 128, 117, 120, 126, 124, 128, 126, 132, 129, 127, 133, 134, 136, 133, 154, 197, 129, 240},{112, 106, 114, 110, 128, 117, 120, 126, 124, 128, 126, 132, 129, 127, 133, 134, 136, 133, 154, 197, 129, 240}},{{102, 107, 111, 116, 116, 120, 118, 115, 120, 119, 128, 131, 131, 130, 128, 126, 126, 132, 145, 136, 133, 240},{102, 107, 111, 116, 116, 120, 118, 115, 120, 119, 128, 131, 131, 130, 128, 126, 126, 132, 145, 136, 133, 240}},{{111, 117, 106, 120, 123, 121, 125, 125, 130, 125, 123, 123, 127, 131, 125, 131, 135, 134, 148, 134, 132, 240},{111, 117, 106, 120, 123, 121, 125, 125, 130, 125, 123, 123, 127, 131, 125, 131, 135, 134, 148, 134, 132, 240}}}; const UWord16 CRendBin_Combined_BRIR_index_frequency_max_diffuse_48kHz = 98; -#ifdef FIX_INV_DIFFUSE_WEIGHT const float CRendBin_Combined_BRIR_inv_diffuse_weight_48kHz[BINAURAL_CHANNELS][HRTF_LS_CHANNELS]={{0.224183f, 0.227455f, 0.241830f, 0.207155f, 0.218087f, 0.222942f, 0.232158f, 0.248203f, 0.249262f, 0.261591f, 0.246276f, 0.279163f, 0.285701f, 0.262541f, 0.271844f},{0.224183f, 0.227455f, 0.241830f, 0.207155f, 0.218087f, 0.222942f, 0.232158f, 0.248203f, 0.249262f, 0.261591f, 0.246276f, 0.279163f, 0.285701f, 0.262541f, 0.271844f}}; const Word16 CRendBin_Combined_BRIR_inv_diffuse_weight_48kHz_fx[BINAURAL_CHANNELS][HRTF_LS_CHANNELS]={{7346, 7453, 7924, 6788, 7146, 7305, 7607, 8133, 8167, 8571, 8069, 9147, 9361, 8602, 8907},{7346, 7453, 7924, 6788, 7146, 7305, 7607, 8133, 8167, 8571, 8069, 9147, 9361, 8602, 8907}}; -#else -const float CRendBin_Combined_BRIR_inv_diffuse_weight_48kHz[HRTF_LS_CHANNELS]={0.224183f, 0.227455f, 0.241830f, 0.207155f, 0.218087f, 0.222942f, 0.232158f, 0.248203f, 0.249262f, 0.261591f, 0.246276f, 0.279163f, 0.285701f, 0.262541f, 0.271844f}; -const Word16 CRendBin_Combined_BRIR_inv_diffuse_weight_48kHz_fx[HRTF_LS_CHANNELS]={7346, 7453, 7924, 6788, 7146, 7305, 7607, 8133, 8167, 8571, 8069, 9147, 9361, 8602, 8907}; -#endif const UWord16 CRendBin_Combined_BRIR_pIndex_frequency_max_diffuse_48kHz[BINAURAL_CHANNELS][40]={{47, 47, 47, 47, 47, 47, 51, 51, 58, 58, 58, 65, 65, 65, 65, 65, 72, 72, 72, 74, 74, 77, 77, 79, 81, 81, 81, 81, 87, 87, 87, 87, 87, 87, 91, 91, 93, 93, 93, 98},{47, 47, 47, 47, 47, 47, 51, 51, 58, 58, 58, 65, 65, 65, 65, 65, 72, 72, 72, 74, 74, 77, 77, 79, 81, 81, 81, 81, 87, 87, 87, 87, 87, 87, 91, 91, 93, 93, 93, 98}}; /* Sample Rate = 32000 */ @@ -280,13 +227,8 @@ const UWord16 CRendBin_Combined_BRIR_num_iterations_32kHz[HRTF_LS_CHANNELS][BINA const UWord16 CRendBin_Combined_BRIR_num_iterations_diffuse_32kHz[BINAURAL_CHANNELS] = {40, 40}; const UWord16 CRendBin_Combined_BRIR_pIndex_frequency_max_32kHz[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][22]={{{115, 117, 117, 120, 112, 118, 121, 130, 126, 130, 136, 127, 133, 135, 132, 133, 129, 137, 134, 129, 128, 160},{115, 117, 117, 120, 112, 118, 121, 130, 126, 130, 136, 127, 133, 135, 132, 133, 129, 137, 134, 129, 128, 160}},{{121, 106, 119, 113, 120, 123, 114, 126, 123, 125, 127, 128, 127, 134, 132, 130, 129, 139, 133, 131, 128, 160},{121, 106, 119, 113, 120, 123, 114, 126, 123, 125, 127, 128, 127, 134, 132, 130, 129, 139, 133, 131, 128, 160}},{{113, 103, 116, 104, 123, 123, 122, 124, 130, 128, 132, 131, 131, 132, 130, 132, 130, 135, 137, 128, 128, 160},{113, 103, 116, 104, 123, 123, 122, 124, 130, 128, 132, 131, 131, 132, 130, 132, 130, 135, 137, 128, 128, 160}},{{102, 116, 116, 121, 116, 114, 115, 121, 125, 123, 124, 130, 132, 122, 127, 131, 131, 135, 133, 124, 125, 160},{102, 116, 116, 121, 116, 114, 115, 121, 125, 123, 124, 130, 132, 122, 127, 131, 131, 135, 133, 124, 125, 160}},{{115, 115, 115, 119, 121, 119, 125, 127, 123, 129, 122, 126, 128, 134, 130, 130, 131, 140, 146, 127, 131, 160},{115, 115, 115, 119, 121, 119, 125, 127, 123, 129, 122, 126, 128, 134, 130, 130, 131, 140, 146, 127, 131, 160}},{{112, 106, 118, 121, 115, 117, 129, 123, 128, 126, 130, 130, 131, 131, 130, 134, 133, 149, 130, 132, 126, 160},{112, 106, 118, 121, 115, 117, 129, 123, 128, 126, 130, 130, 131, 131, 130, 134, 133, 149, 130, 132, 126, 160}},{{107, 112, 110, 119, 114, 124, 121, 121, 132, 122, 131, 134, 124, 133, 130, 129, 134, 134, 135, 127, 120, 160},{107, 112, 110, 119, 114, 124, 121, 121, 132, 122, 131, 134, 124, 133, 130, 129, 134, 134, 135, 127, 120, 160}},{{110, 113, 123, 113, 121, 120, 120, 126, 131, 123, 128, 128, 132, 130, 132, 136, 133, 136, 135, 128, 124, 160},{110, 113, 123, 113, 121, 120, 120, 126, 131, 123, 128, 128, 132, 130, 132, 136, 133, 136, 135, 128, 124, 160}},{{114, 101, 113, 113, 124, 126, 123, 128, 122, 127, 132, 127, 136, 128, 128, 127, 132, 132, 129, 125, 120, 160},{114, 101, 113, 113, 124, 126, 123, 128, 122, 127, 132, 127, 136, 128, 128, 127, 132, 132, 129, 125, 120, 160}},{{99, 100, 111, 117, 114, 114, 118, 116, 121, 124, 124, 121, 125, 130, 127, 132, 132, 130, 133, 128, 131, 160},{99, 100, 111, 117, 114, 114, 118, 116, 121, 124, 124, 121, 125, 130, 127, 132, 132, 130, 133, 128, 131, 160}},{{105, 93, 103, 108, 119, 110, 111, 114, 120, 121, 119, 122, 130, 128, 130, 131, 132, 131, 136, 128, 128, 160},{105, 93, 103, 108, 119, 110, 111, 114, 120, 121, 119, 122, 130, 128, 130, 131, 132, 131, 136, 128, 128, 160}},{{105, 100, 112, 114, 115, 108, 117, 120, 123, 117, 122, 129, 124, 128, 124, 132, 135, 131, 139, 153, 116, 160},{105, 100, 112, 114, 115, 108, 117, 120, 123, 117, 122, 129, 124, 128, 124, 132, 135, 131, 139, 153, 116, 160}},{{110, 106, 113, 110, 122, 116, 119, 125, 123, 128, 125, 127, 128, 127, 133, 130, 132, 132, 143, 155, 127, 160},{110, 106, 113, 110, 122, 116, 119, 125, 123, 128, 125, 127, 128, 127, 133, 130, 132, 132, 143, 155, 127, 160}},{{102, 107, 110, 112, 115, 117, 117, 115, 120, 118, 127, 130, 130, 129, 126, 126, 125, 130, 141, 135, 127, 160},{102, 107, 110, 112, 115, 117, 117, 115, 120, 118, 127, 130, 130, 129, 126, 126, 125, 130, 141, 135, 127, 160}},{{110, 117, 106, 118, 118, 116, 121, 124, 128, 125, 122, 122, 126, 131, 124, 130, 133, 131, 139, 134, 131, 160},{110, 117, 106, 118, 118, 116, 121, 124, 128, 125, 122, 122, 126, 131, 124, 130, 133, 131, 139, 134, 131, 160}}}; const UWord16 CRendBin_Combined_BRIR_index_frequency_max_diffuse_32kHz = 97; -#ifdef FIX_INV_DIFFUSE_WEIGHT const float CRendBin_Combined_BRIR_inv_diffuse_weight_32kHz[BINAURAL_CHANNELS][HRTF_LS_CHANNELS]={{0.224190f, 0.227445f, 0.241827f, 0.207131f, 0.218113f, 0.222941f, 0.232139f, 0.248192f, 0.249239f, 0.261572f, 0.246309f, 0.279145f, 0.285786f, 0.262528f, 0.271847f},{0.224190f, 0.227445f, 0.241827f, 0.207131f, 0.218113f, 0.222941f, 0.232139f, 0.248192f, 0.249239f, 0.261572f, 0.246309f, 0.279145f, 0.285786f, 0.262528f, 0.271847f}}; const Word16 CRendBin_Combined_BRIR_inv_diffuse_weight_32kHz_fx[BINAURAL_CHANNELS][HRTF_LS_CHANNELS]={{7346, 7452, 7924, 6787, 7147, 7305, 7606, 8132, 8167, 8571, 8071, 9147, 9364, 8602, 8907},{7346, 7452, 7924, 6787, 7147, 7305, 7606, 8132, 8167, 8571, 8071, 9147, 9364, 8602, 8907}}; -#else -const float CRendBin_Combined_BRIR_inv_diffuse_weight_32kHz[HRTF_LS_CHANNELS]={0.224190f, 0.227445f, 0.241827f, 0.207131f, 0.218113f, 0.222941f, 0.232139f, 0.248192f, 0.249239f, 0.261572f, 0.246309f, 0.279145f, 0.285786f, 0.262528f, 0.271847f}; -const Word16 CRendBin_Combined_BRIR_inv_diffuse_weight_32kHz_fx[HRTF_LS_CHANNELS]={7346, 7452, 7924, 6787, 7147, 7305, 7606, 8132, 8167, 8571, 8071, 9147, 9364, 8602, 8907}; -#endif const UWord16 CRendBin_Combined_BRIR_pIndex_frequency_max_diffuse_32kHz[BINAURAL_CHANNELS][40]={{47, 47, 47, 47, 47, 47, 50, 50, 56, 56, 56, 63, 63, 63, 63, 63, 72, 72, 72, 74, 74, 77, 77, 79, 81, 81, 81, 81, 87, 87, 87, 87, 87, 87, 93, 93, 93, 93, 93, 97},{47, 47, 47, 47, 47, 47, 50, 50, 56, 56, 56, 63, 63, 63, 63, 63, 72, 72, 72, 74, 74, 77, 77, 79, 81, 81, 81, 81, 87, 87, 87, 87, 87, 87, 93, 93, 93, 93, 93, 97}}; /* Sample Rate = 16000 */ @@ -295,13 +237,8 @@ const UWord16 CRendBin_Combined_BRIR_num_iterations_16kHz[HRTF_LS_CHANNELS][BINA const UWord16 CRendBin_Combined_BRIR_num_iterations_diffuse_16kHz[BINAURAL_CHANNELS] = {40, 40}; const UWord16 CRendBin_Combined_BRIR_pIndex_frequency_max_16kHz[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][23]={{{77, 76, 77, 77, 77, 76, 77, 76, 77, 76, 77, 77, 77, 78, 76, 76, 77, 77, 77, 77, 77, 76, 80},{77, 76, 77, 77, 77, 76, 77, 76, 77, 76, 77, 77, 77, 78, 76, 76, 77, 77, 77, 77, 77, 76, 80}},{{76, 77, 77, 75, 77, 78, 77, 76, 77, 77, 76, 77, 77, 77, 77, 77, 76, 77, 76, 76, 77, 78, 80},{76, 77, 77, 75, 77, 78, 77, 76, 77, 77, 76, 77, 77, 77, 77, 77, 76, 77, 76, 76, 77, 78, 80}},{{77, 76, 76, 78, 75, 76, 74, 78, 77, 76, 77, 77, 77, 76, 76, 77, 78, 78, 77, 77, 77, 77, 80},{77, 76, 76, 78, 75, 76, 74, 78, 77, 76, 77, 77, 77, 76, 76, 77, 78, 78, 77, 77, 77, 77, 80}},{{76, 76, 76, 76, 77, 77, 76, 78, 77, 77, 77, 77, 78, 78, 77, 77, 77, 77, 77, 78, 77, 78, 80},{76, 76, 76, 76, 77, 77, 76, 78, 77, 77, 77, 77, 78, 78, 77, 77, 77, 77, 77, 78, 77, 78, 80}},{{76, 77, 77, 76, 77, 77, 75, 77, 77, 77, 76, 77, 77, 77, 77, 78, 77, 77, 77, 77, 76, 76, 80},{76, 77, 77, 76, 77, 77, 75, 77, 77, 77, 76, 77, 77, 77, 77, 78, 77, 77, 77, 77, 76, 76, 80}},{{77, 76, 77, 77, 77, 77, 77, 77, 76, 78, 76, 78, 75, 76, 77, 77, 76, 76, 77, 78, 78, 77, 80},{77, 76, 77, 77, 77, 77, 77, 77, 76, 78, 76, 78, 75, 76, 77, 77, 76, 76, 77, 78, 78, 77, 80}},{{77, 77, 75, 76, 76, 77, 77, 77, 77, 77, 77, 75, 77, 76, 76, 76, 77, 77, 76, 77, 76, 77, 80},{77, 77, 75, 76, 76, 77, 77, 77, 77, 77, 77, 75, 77, 76, 76, 76, 77, 77, 76, 77, 76, 77, 80}},{{75, 76, 77, 77, 75, 77, 75, 76, 76, 77, 77, 77, 78, 78, 77, 77, 76, 77, 78, 78, 78, 76, 80},{75, 76, 77, 77, 75, 77, 75, 76, 76, 77, 77, 77, 78, 78, 77, 77, 76, 77, 78, 78, 78, 76, 80}},{{77, 77, 77, 76, 77, 77, 76, 76, 76, 77, 77, 75, 76, 78, 78, 77, 77, 78, 78, 77, 76, 76, 80},{77, 77, 77, 76, 77, 77, 76, 76, 76, 77, 77, 75, 76, 78, 78, 77, 77, 78, 78, 77, 76, 76, 80}},{{76, 75, 76, 76, 77, 77, 77, 77, 77, 77, 74, 78, 77, 78, 78, 77, 76, 77, 77, 77, 77, 76, 80},{76, 75, 76, 76, 77, 77, 77, 77, 77, 77, 74, 78, 77, 78, 78, 77, 76, 77, 77, 77, 77, 76, 80}},{{76, 76, 77, 76, 77, 77, 76, 76, 76, 76, 77, 77, 76, 76, 77, 75, 77, 76, 76, 76, 77, 77, 80},{76, 76, 77, 76, 77, 77, 76, 76, 76, 76, 77, 77, 76, 76, 77, 75, 77, 76, 76, 76, 77, 77, 80}},{{76, 76, 77, 75, 78, 77, 77, 77, 77, 77, 77, 77, 77, 76, 78, 77, 76, 78, 76, 77, 76, 77, 80},{76, 76, 77, 75, 78, 77, 77, 77, 77, 77, 77, 77, 77, 76, 78, 77, 76, 78, 76, 77, 76, 77, 80}},{{76, 77, 77, 76, 76, 77, 77, 75, 77, 77, 77, 77, 77, 77, 78, 78, 78, 78, 77, 76, 76, 78, 80},{76, 77, 77, 76, 76, 77, 77, 75, 77, 77, 77, 77, 77, 77, 78, 78, 78, 78, 77, 76, 76, 78, 80}},{{74, 76, 74, 76, 75, 76, 76, 76, 76, 77, 77, 78, 77, 78, 75, 76, 77, 76, 78, 76, 78, 77, 80},{74, 76, 74, 76, 75, 76, 76, 76, 76, 77, 77, 78, 77, 78, 75, 76, 77, 76, 78, 76, 78, 77, 80}},{{76, 77, 77, 77, 76, 78, 77, 76, 75, 77, 77, 77, 76, 78, 77, 78, 78, 78, 77, 76, 77, 75, 80},{76, 77, 77, 77, 76, 78, 77, 76, 75, 77, 77, 77, 76, 78, 77, 78, 78, 78, 77, 76, 77, 75, 80}}}; const UWord16 CRendBin_Combined_BRIR_index_frequency_max_diffuse_16kHz = 77; -#ifdef FIX_INV_DIFFUSE_WEIGHT const float CRendBin_Combined_BRIR_inv_diffuse_weight_16kHz[BINAURAL_CHANNELS][HRTF_LS_CHANNELS]={{0.223532f, 0.226827f, 0.248830f, 0.208782f, 0.220391f, 0.219790f, 0.231187f, 0.248730f, 0.251408f, 0.263698f, 0.243858f, 0.281483f, 0.283080f, 0.261660f, 0.273527f},{0.223532f, 0.226827f, 0.248830f, 0.208782f, 0.220391f, 0.219790f, 0.231187f, 0.248730f, 0.251408f, 0.263698f, 0.243858f, 0.281483f, 0.283080f, 0.261660f, 0.273527f}}; const Word16 CRendBin_Combined_BRIR_inv_diffuse_weight_16kHz_fx[BINAURAL_CHANNELS][HRTF_LS_CHANNELS]={{7346, 7452, 7924, 6787, 7147, 7305, 7606, 8132, 8167, 8571, 8071, 9147, 9364, 8602, 8907},{7346, 7452, 7924, 6787, 7147, 7305, 7606, 8132, 8167, 8571, 8071, 9147, 9364, 8602, 8907}}; -#else -const float CRendBin_Combined_BRIR_inv_diffuse_weight_16kHz[HRTF_LS_CHANNELS]={0.223532f, 0.226827f, 0.248830f, 0.208782f, 0.220391f, 0.219790f, 0.231187f, 0.248730f, 0.251408f, 0.263698f, 0.243858f, 0.281483f, 0.283080f, 0.261660f, 0.273527f}; -const Word16 CRendBin_Combined_BRIR_inv_diffuse_weight_16kHz_fx[HRTF_LS_CHANNELS]={7346, 7452, 7924, 6787, 7147, 7305, 7606, 8132, 8167, 8571, 8071, 9147, 9364, 8602, 8907}; -#endif const UWord16 CRendBin_Combined_BRIR_pIndex_frequency_max_diffuse_16kHz[BINAURAL_CHANNELS][40]={{46, 46, 46, 46, 46, 46, 46, 49, 49, 53, 53, 53, 55, 55, 61, 61, 61, 65, 67, 67, 67, 67, 67, 67, 69, 72, 72, 72, 73, 73, 75, 75, 75, 75, 75, 75, 75, 75, 75, 77},{46, 46, 46, 46, 46, 46, 46, 49, 49, 53, 53, 53, 55, 55, 61, 61, 61, 65, 67, 67, 67, 67, 67, 67, 69, 72, 72, 72, 73, 73, 75, 75, 75, 75, 75, 75, 75, 75, 75, 77}}; //BRIR and HRIR coeff tables in Q29 const Word32 CRendBin_Combined_BRIR_coeff_re_48kHz_fx[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][2955] ={ diff --git a/lib_rend/ivas_stat_rend.h b/lib_rend/ivas_stat_rend.h index 963d6dd8d..50e3d7f6c 100644 --- a/lib_rend/ivas_stat_rend.h +++ b/lib_rend/ivas_stat_rend.h @@ -1336,12 +1336,8 @@ typedef struct ivas_hrtfs_structure UWord16 index_frequency_max_diffuse; Word16 max_num_ir; Word16 max_num_iterations; -#ifdef FIX_INV_DIFFUSE_WEIGHT Word16 inv_diffuse_weight_fx[BINAURAL_CHANNELS][MAX_INTERN_CHANNELS]; /* inverse diffuse weights array, access one inverse weight by pInvDiffuseWeight[channel] */ Word16 same_inv_diffuse_weight; -#else - Word16 inv_diffuse_weight_fx[MAX_INTERN_CHANNELS]; /* inverse diffuse weights array, access one inverse weight by pInvDiffuseWeight[channel] Q15 */ -#endif Word32 latency_s_fx; Word16 init_from_rom; Word16 gain_lfe_fx; // Q14 @@ -1351,13 +1347,8 @@ typedef struct ivas_crend_state_t { Word32 *freq_buffer_re_fx[MAX_INTERN_CHANNELS]; Word32 *freq_buffer_im_fx[MAX_INTERN_CHANNELS]; -#ifdef FIX_INV_DIFFUSE_WEIGHT Word32 *freq_buffer_re_diffuse_fx[BINAURAL_CHANNELS]; Word32 *freq_buffer_im_diffuse_fx[BINAURAL_CHANNELS]; -#else - Word32 *freq_buffer_re_diffuse_fx; - Word32 *freq_buffer_im_diffuse_fx; -#endif Word32 *prev_out_buffer_fx[BINAURAL_CHANNELS]; Word32 *lfe_delay_line_fx; Word32 m_fYaw_fx; diff --git a/lib_util/hrtf_file_reader.c b/lib_util/hrtf_file_reader.c index b38743f1a..8b5dadf39 100644 --- a/lib_util/hrtf_file_reader.c +++ b/lib_util/hrtf_file_reader.c @@ -1294,7 +1294,6 @@ static ivas_error create_HRTF_from_rawdata( /* inv_diffuse_weight */ #ifdef USE_NEW_HRTF_BINARY_FILE_FORMAT -#ifdef FIX_INV_DIFFUSE_WEIGHT for ( i = 0; i < ( *hHRTF )->max_num_ir; i++ ) { ( *hHRTF )->inv_diffuse_weight_fx[0][i] = (Word16) ( *( (float *) ( hrtf_data_rptr ) ) * ONE_IN_Q15 ); @@ -1306,15 +1305,6 @@ static ivas_error create_HRTF_from_rawdata( hrtf_data_rptr += sizeof( float ); } #else - for ( i = 0; i < ( *hHRTF )->max_num_ir; i++ ) - { - ( *hHRTF )->inv_diffuse_weight_fx[i] = (Word16) ( *( (float *) ( hrtf_data_rptr ) ) * ONE_IN_Q15 ); - hrtf_data_rptr += sizeof( float ); - } - hrtf_data_rptr += sizeof( float ) * ( *hHRTF )->max_num_ir; -#endif -#else -#ifdef FIX_INV_DIFFUSE_WEIGHT /* inv_diffuse_weight */ for ( i = 0; i < ( *hHRTF )->max_num_ir; i++ ) { @@ -1322,14 +1312,6 @@ static ivas_error create_HRTF_from_rawdata( ( *hHRTF )->inv_diffuse_weight_fx[1][i] = ( *hHRTF )->inv_diffuse_weight[0][i]; hrtf_data_rptr += sizeof( float ); } -#else - /* inv_diffuse_weight */ - for ( i = 0; i < ( *hHRTF )->max_num_ir; i++ ) - { - ( *hHRTF )->inv_diffuse_weight[i] = (Word16) ( *( (float *) ( hrtf_data_rptr ) ) * ONE_IN_Q15 ); - hrtf_data_rptr += sizeof( float ); - } -#endif #endif /* max_total_num_fsamp_per_iteration */ -- GitLab From 1adaa7f6966e297006d09ad2950bdce48bee12e2 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Tue, 8 Jul 2025 15:23:00 +0200 Subject: [PATCH 08/11] [cleanup] accept NONBE_FIX_AVG_IAC_CLDFB_REVERB --- lib_com/ivas_cnst.h | 4 - lib_com/options.h | 1 - lib_rend/ivas_hrtf_fx.c | 18 -- lib_rend/ivas_objectRenderer_mix_fx.c | 6 - lib_rend/ivas_reverb_fx.c | 11 - lib_rend/ivas_reverb_utils_fx.c | 4 - lib_rend/ivas_rom_binaural_crend_head.h | 14 - lib_rend/ivas_rom_binaural_crend_head_fx.c | 285 --------------------- lib_util/hrtf_file_reader.c | 39 --- 9 files changed, 382 deletions(-) diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index 8e5d0d626..06d8fa323 100644 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -1743,15 +1743,11 @@ typedef enum #define RV_FILTER_MAX_HISTORY ( 512 - 160 ) /* for longest history */ #define RV_LENGTH_NR_FC ( RV_FILTER_MAX_FFT_SIZE / 2 ) + 1 -#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB #define RV_LENGTH_NR_FC_16KHZ ( RV_FILTER_MAX_FFT_SIZE / 4 ) + 1 -#endif #define IVAS_REVERB_DEFAULT_N_BANDS 31 #define LR_IAC_LENGTH_NR_FC ( RV_LENGTH_NR_FC ) -#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB #define LR_IAC_LENGTH_NR_FC_16KHZ ( RV_LENGTH_NR_FC_16KHZ ) -#endif /*----------------------------------------------------------------------------------* * FB mixer constants diff --git a/lib_com/options.h b/lib_com/options.h index b1d305f81..1bb60b341 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -106,7 +106,6 @@ #define FIX_1372_ISAR_POST_REND #define NONBE_FIX_1058_DECODER_ERROR_WITH_REVERB_ROOM /* FhG: issue 1058: do not initialize EFAP when IntSetup is HOA3 */ #ifdef NONBE_FIX_1058_DECODER_ERROR_WITH_REVERB_ROOM -#define NONBE_FIX_AVG_IAC_CLDFB_REVERB #endif #define USE_NEW_HRTF_BINARY_FILE_FORMAT /* Orange: to activate when decided to change the hrtf binary file format */ diff --git a/lib_rend/ivas_hrtf_fx.c b/lib_rend/ivas_hrtf_fx.c index 7a81b7946..da862b51b 100644 --- a/lib_rend/ivas_hrtf_fx.c +++ b/lib_rend/ivas_hrtf_fx.c @@ -284,7 +284,6 @@ ivas_error ivas_HRTF_statistics_init( switch ( sampleRate ) { -#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB case 48000: HrtfStatistics->average_energy_l_dyn = (Word32 *) malloc( LR_IAC_LENGTH_NR_FC * sizeof( Word32 ) ); if ( HrtfStatistics->average_energy_l_dyn == NULL ) @@ -354,23 +353,6 @@ ivas_error ivas_HRTF_statistics_init( HrtfStatistics->average_energy_r = (const Word32 *) HrtfStatistics->average_energy_r_dyn; HrtfStatistics->inter_aural_coherence = (const Word32 *) HrtfStatistics->inter_aural_coherence_dyn; break; -#else - case 48000: - HrtfStatistics->average_energy_l = defaultHRIR_left_avg_power_48kHz_fx; - HrtfStatistics->average_energy_r = defaultHRIR_right_avg_power_48kHz_fx; - HrtfStatistics->inter_aural_coherence = defaultHRIR_coherence_48kHz_fx; - break; - case 32000: - HrtfStatistics->average_energy_l = defaultHRIR_left_avg_power_32kHz_fx; - HrtfStatistics->average_energy_r = defaultHRIR_right_avg_power_32kHz_fx; - HrtfStatistics->inter_aural_coherence = defaultHRIR_coherence_32kHz_fx; - break; - case 16000: - HrtfStatistics->average_energy_l = defaultHRIR_left_avg_power_16kHz_fx; - HrtfStatistics->average_energy_r = defaultHRIR_right_avg_power_16kHz_fx; - HrtfStatistics->inter_aural_coherence = defaultHRIR_coherence_16kHz_fx; - break; -#endif } HrtfStatistics->fromROM = TRUE; diff --git a/lib_rend/ivas_objectRenderer_mix_fx.c b/lib_rend/ivas_objectRenderer_mix_fx.c index b267044b1..cb6e3a3fe 100644 --- a/lib_rend/ivas_objectRenderer_mix_fx.c +++ b/lib_rend/ivas_objectRenderer_mix_fx.c @@ -422,7 +422,6 @@ static ivas_error DefaultBSplineModel_fx( HrFiltSet_p->lr_energy_and_iac_fx[2] = defaultHRIR_coherence_32kHz_fx; // Q23 BREAK; case 16000: -#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB for ( i = 0; i < 3; i++ ) { HrFiltSet_p->lr_energy_and_iac_dyn_fx[i] = (Word32 *) malloc( LR_IAC_LENGTH_NR_FC_16KHZ * sizeof( float ) ); @@ -437,11 +436,6 @@ static ivas_error DefaultBSplineModel_fx( HrFiltSet_p->lr_energy_and_iac_fx[0] = (const Word32 *) HrFiltSet_p->lr_energy_and_iac_dyn_fx[0]; HrFiltSet_p->lr_energy_and_iac_fx[1] = (const Word32 *) HrFiltSet_p->lr_energy_and_iac_dyn_fx[1]; HrFiltSet_p->lr_energy_and_iac_fx[2] = (const Word32 *) HrFiltSet_p->lr_energy_and_iac_dyn_fx[2]; -#else - HrFiltSet_p->lr_energy_and_iac_fx[0] = defaultHRIR_left_avg_power_16kHz_fx; // Q23 - HrFiltSet_p->lr_energy_and_iac_fx[1] = defaultHRIR_right_avg_power_16kHz_fx; // Q23 - HrFiltSet_p->lr_energy_and_iac_fx[2] = defaultHRIR_coherence_16kHz_fx; // Q23 -#endif BREAK; } #endif diff --git a/lib_rend/ivas_reverb_fx.c b/lib_rend/ivas_reverb_fx.c index d7dd26ec3..e886bfeab 100644 --- a/lib_rend/ivas_reverb_fx.c +++ b/lib_rend/ivas_reverb_fx.c @@ -1652,17 +1652,10 @@ ivas_error ivas_reverb_open_fx( { params.pDsr_fx[i] = L_shl( params.pDsr_fx[i], params.pDsr_e[i] ); move32(); -#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB pHrtf_avg_pwr_response_l_const[i] = params.pHrtf_avg_pwr_response_l_const_fx[i]; /*Q28*/ move32(); pHrtf_avg_pwr_response_r_const[i] = params.pHrtf_avg_pwr_response_r_const_fx[i]; /*Q23+5*/ move32(); -#else - pHrtf_avg_pwr_response_l_const[i] = L_shl( params.pHrtf_avg_pwr_response_l_const_fx[i], 5 ); /*Q23+5*/ - move32(); - pHrtf_avg_pwr_response_r_const[i] = L_shl( params.pHrtf_avg_pwr_response_r_const_fx[i], 5 ); /*Q23+5*/ - move32(); -#endif } FOR( i = 0; i < lenT60_filter_coeff; i++ ) { @@ -1710,11 +1703,7 @@ ivas_error ivas_reverb_open_fx( Word32 *pHrtf_inter_aural_coherence_const = (Word32 *) malloc( nr_fc_fft_filter * sizeof( Word32 ) ); FOR( i = 0; i < nr_fc_fft_filter; i++ ) { -#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB pHrtf_inter_aural_coherence_const[i] = L_shl( params.pHrtf_inter_aural_coherence_const_fx[i], 3 ); /*Scaling up to Q30*/ -#else - pHrtf_inter_aural_coherence_const[i] = params.pHrtf_inter_aural_coherence_const_fx[i]; /*Scaling up to Q30*/ -#endif move32(); } ivas_reverb_calc_correl_filters_fx( pHrtf_inter_aural_coherence_const, pTime_window_fx, pState->fft_size, pFft_wf_filter_ch0_fx, pFft_wf_filter_ch1_fx, &q_pFft_wf_filter_ch0_fx, &q_pFft_wf_filter_ch1_fx ); diff --git a/lib_rend/ivas_reverb_utils_fx.c b/lib_rend/ivas_reverb_utils_fx.c index 2c61d54df..e63e6017a 100644 --- a/lib_rend/ivas_reverb_utils_fx.c +++ b/lib_rend/ivas_reverb_utils_fx.c @@ -320,11 +320,7 @@ static ivas_error ivas_reverb_get_fastconv_hrtf_set_energies( #endif #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES -#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB const int16_t avg_pwr_len = sampling_rate == 16000 ? LR_IAC_LENGTH_NR_FC_16KHZ : LR_IAC_LENGTH_NR_FC; -#else - const int16_t avg_pwr_len = LR_IAC_LENGTH_NR_FC; -#endif for ( freq_idx = 0; freq_idx < avg_pwr_len; freq_idx++ ) { diff --git a/lib_rend/ivas_rom_binaural_crend_head.h b/lib_rend/ivas_rom_binaural_crend_head.h index 30d9cbb24..77d54a5d3 100644 --- a/lib_rend/ivas_rom_binaural_crend_head.h +++ b/lib_rend/ivas_rom_binaural_crend_head.h @@ -288,7 +288,6 @@ extern Word32 CRendBin_Combined_BRIR_coeff_im_16kHz_fx[HRTF_LS_CHANNELS][BINAURA extern Word32 CRendBin_Combined_BRIR_coeff_diffuse_re_16kHz_fx[BINAURAL_CHANNELS][2522]; extern Word32 CRendBin_Combined_BRIR_coeff_diffuse_im_16kHz_fx[BINAURAL_CHANNELS][2522]; -#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB extern float defaultHRIR_coherence_48kHz_fx[LR_IAC_LENGTH_NR_FC]; /*Q-27*/ extern float defaultHRIR_left_avg_power_48kHz_fx[LR_IAC_LENGTH_NR_FC]; /*Q-23*/ extern float defaultHRIR_right_avg_power_48kHz_fx[LR_IAC_LENGTH_NR_FC]; /*Q-23*/ @@ -300,18 +299,5 @@ extern float defaultHRIR_right_avg_power_32kHz_fx[LR_IAC_LENGTH_NR_FC]; /*Q-23* extern float defaultHRIR_coherence_16kHz_fx[LR_IAC_LENGTH_NR_FC_16KHZ]; /*Q-27*/ extern float defaultHRIR_left_avg_power_16kHz_fx[LR_IAC_LENGTH_NR_FC_16KHZ]; /*Q-23*/ extern float defaultHRIR_right_avg_power_16kHz_fx[LR_IAC_LENGTH_NR_FC_16KHZ]; /*Q-23*/ -#else -extern const Word32 defaultHRIR_coherence_48kHz_fx[LR_IAC_LENGTH_NR_FC]; /*Q-27*/ -extern const Word32 defaultHRIR_left_avg_power_48kHz_fx[LR_IAC_LENGTH_NR_FC]; /*Q-23*/ -extern const Word32 defaultHRIR_right_avg_power_48kHz_fx[LR_IAC_LENGTH_NR_FC]; /*Q-23*/ - -extern const Word32 defaultHRIR_coherence_32kHz_fx[LR_IAC_LENGTH_NR_FC]; /*Q-27*/ -extern const Word32 defaultHRIR_left_avg_power_32kHz_fx[LR_IAC_LENGTH_NR_FC]; /*Q-23*/ -extern const Word32 defaultHRIR_right_avg_power_32kHz_fx[LR_IAC_LENGTH_NR_FC]; /*Q-23*/ - -extern const Word32 defaultHRIR_coherence_16kHz_fx[LR_IAC_LENGTH_NR_FC]; /*Q-27*/ -extern const Word32 defaultHRIR_left_avg_power_16kHz_fx[LR_IAC_LENGTH_NR_FC]; /*Q-23*/ -extern const Word32 defaultHRIR_right_avg_power_16kHz_fx[LR_IAC_LENGTH_NR_FC]; /*Q-23*/ -#endif #endif /* _IVAS_ROM_BINAURAL_CREND_HEAD_ */ diff --git a/lib_rend/ivas_rom_binaural_crend_head_fx.c b/lib_rend/ivas_rom_binaural_crend_head_fx.c index 866a70c97..a14d75137 100644 --- a/lib_rend/ivas_rom_binaural_crend_head_fx.c +++ b/lib_rend/ivas_rom_binaural_crend_head_fx.c @@ -59588,7 +59588,6 @@ const Word32 CRendBin_Combined_BRIR_coeff_diffuse_im_16kHz_fx[BINAURAL_CHANNELS] }; -#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB /********************** defaultHRIR reverb rom tables at sampling rate 48kHz **********************/ const float defaultHRIR_coherence_48kHz_fx[LR_IAC_LENGTH_NR_FC] = @@ -59836,290 +59835,6 @@ const float defaultHRIR_right_avg_power_16kHz_fx[LR_IAC_LENGTH_NR_FC_16KHZ] = 0.250692f, 0.245099f, 0.243192f}; -#else - -const Word32 defaultHRIR_coherence_48kHz_fx[LR_IAC_LENGTH_NR_FC] /*Q-27*/ = { - 131936432,125285536,105934832,77097344,45729324,19356880,2523696,0,0, - 0,1602425,4763253,5796595,5698884,5608690,5175704,3880368,2303444, - 1553033,1902670,2661537,3300414,3919560,4475624,4485288,3976468,3688169, - 3682129,3375844,2619661,1976758,1906026,2165066,2186943,1765500,1162325, - 671759,348160,140123,27783,0,0,0,148981,534991, - 939926,1281242,1547798,1665910,1550617,1228897,835102,478486,185757, - 0,0,0,0,4294,124554,284273,410840,479828, - 507343,493652,417417,278367,114890,0,0,0,0, - 0,0,0,0,0,29125,130728,242531,313264, - 326954,282528,204816,121735,46976,0,0,0,0, - 0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,31943,114353,173543, - 205218,205755,176362,128043,69927,20803,0,0,0, - 0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0, - 0,0,3355,38117,83214,127372,170993,215553,257966, - 294607,327222,360643,395137,425738,452447,480096,507208,525462, - 533247,534186,526804,505463,469896,424799,372856,312190,242397, - 168711,95831,28319,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,102810,72074,0, - 226962,443858,219445,0,214882,1013209,77846,0,273535, - 1385798,289239,0,472983,1241648,688671,0,306821,870536, - 792153,0,115695,613375,552574,0,0,434462,205890, - 34762,26709,182938,117843,0 -}; -const Word32 defaultHRIR_left_avg_power_48kHz_fx[LR_IAC_LENGTH_NR_FC] /*Q-23*/ = { - 8209721,8156956,8050127,7984940,7992858,8011649,7974747,7910306,7917252, - 8038476,8174723,8228729,8192717,8124794,8070352,8029995,7989956,7953608, - 7931152,7912210,7870745,7803402,7745101,7727896,7735563,7724331,7693670, - 7672548,7668253,7662666,7647508,7638633,7652147,7680265,7699593,7698955, - 7689828,7687614,7690835,7685852,7667229,7645042,7629506,7617787,7601639, - 7578545,7554822,7537315,7524279,7507108,7481430,7453328,7431803,7415991, - 7395254,7364820,7335141,7319069,7310202,7296948,7280120,7270700,7273946, - 7282989,7288836,7292510,7303600,7327768,7359376,7389357,7418784,7458856, - 7515186,7577119,7632232,7684091,7741771,7803922,7858506,7897295,7924793, - 7950529,7975309,7989134,7983815,7964337,7942418,7920028,7885853,7832460, - 7773178,7719675,7667640,7605540,7531820,7456659,7388182,7322718,7251305, - 7173342,7099371,7039023,6989942,6943645,6900871,6876377,6876200,6891753, - 6912280,6938008,6976184,7027514,7081939,7129159,7169768,7212416,7260113, - 7303961,7334160,7353923,7375390,7399868,7413919,7410756,7397888,7384995, - 7371128,7347783,7311469,7269433,7231533,7198642,7162562,7118413,7073358, - 7038218,7011467,6978885,6936976,6896929,6866243,6838636,6804318,6763793, - 6726715,6699377,6677726,6654422,6630095,6613880,6612001,6619165,6625113, - 6629517,6642997,6668750,6697196,6718344,6734173,6753895,6779589,6802146, - 6813185,6816633,6823486,6836086,6844013,6839567,6830432,6829887,6834652, - 6833897,6825424,6817447,6817430,6823444,6827572,6826137,6824845,6832135, - 6847612,6860472,6863735,6867082,6885344,6912573,6928050,6933679,6949215, - 6980018,7009084,7024486,7037715,7065515,7103221,7130283,7141717,7156523, - 7182804,7191302,7148830,7066479,6973039,6845448,6642997,6369529,6067757, - 5757018,5407708,4989863,4529504,4091224,3695693,3270760,2711684,2000297, - 1252050,651123,273904,89170,20652,2843,209,134,134, - 125,117,92,75,75,75,58,50,50, - 58,50,41,41,50,41,41,41,41, - 41,41,41,41,41,41,41,41,41, - 41,41,41,41,41 -}; -const Word32 defaultHRIR_right_avg_power_48kHz_fx[LR_IAC_LENGTH_NR_FC] /*Q-23*/ = { - 8209721,8156956,8050144,7984965,7992850,8011640,7974756,7910323,7917252, - 8038484,8174707,8228738,8192709,8124794,8070361,8030003,7989948,7953583, - 7931127,7912202,7870737,7803402,7745101,7727896,7735563,7724331,7693679, - 7672548,7668236,7662658,7647491,7638624,7652147,7680265,7699609,7698964, - 7689820,7687597,7690827,7685844,7667229,7645050,7629472,7617779,7601639, - 7578545,7554822,7537315,7524288,7507133,7481447,7453337,7431803,7415982, - 7395229,7364812,7335141,7319077,7310185,7296931,7280120,7270700,7273955, - 7282998,7288836,7292494,7303583,7327776,7359401,7389382,7418776,7458856, - 7515186,7577127,7632241,7684082,7741787,7803939,7858523,7897295,7924793, - 7950529,7975309,7989125,7983824,7964320,7942426,7920062,7885853,7832443, - 7773194,7719675,7667640,7605556,7531829,7456675,7388199,7322726,7251305, - 7173333,7099379,7039032,6989967,6943653,6900880,6876377,6876226,6891753, - 6912271,6937999,6976184,7027514,7081931,7129151,7169768,7212416,7260122, - 7303961,7334160,7353940,7375398,7399868,7413910,7410731,7397871,7384978, - 7371145,7347791,7311477,7269450,7231542,7198633,7162554,7118413,7073358, - 7038218,7011475,6978885,6936976,6896920,6866226,6838628,6804310,6763785, - 6726707,6699369,6677709,6654414,6630095,6613889,6612010,6619148,6625071, - 6629508,6642989,6668750,6697204,6718352,6734190,6753920,6779597,6802146, - 6813210,6816641,6823495,6836095,6844030,6839559,6830457,6829904,6834677, - 6833905,6825416,6817455,6817421,6823428,6827555,6826129,6824837,6832135, - 6847620,6860472,6863735,6867082,6885336,6912582,6928059,6933679,6949232, - 6980026,7009084,7024477,7037706,7065489,7103188,7130275,7141708,7156497, - 7182812,7191285,7148847,7066488,6973047,6845439,6642997,6369529,6067757, - 5757001,5407699,4989863,4529504,4091224,3695702,3270751,2711693,2000297, - 1252050,651123,273904,89170,20652,2843,209,134,134, - 125,117,92,75,75,75,58,50,50, - 58,50,41,41,50,41,41,41,41, - 41,41,41,41,41,41,41,41,41, - 41,41,41,41,41 -}; -const Word32 defaultHRIR_coherence_32kHz_fx[LR_IAC_LENGTH_NR_FC] /*Q-27*/ = { - 131125216,129227112,119736576,105149792,87165424,65548180,45102524,26414452,12630962, - 2261837,646258,0,0,0,362790,1269699,3305916,5226035, - 5552185,5544266,5313545,5242007,4972498,4406099,3304843,2138491,1245809, - 945832,1040724,1586856,2087488,2519669,2930509,3330210,3706959,3852988, - 3845069,3506438,3230889,3049963,3020838,2972117,2692944,2226269,1634369, - 1306206,1176284,1344056,1533169,1651817,1468073,1147695,736184,393929, - 141465,23622,0,0,0,0,0,0,0, - 0,0,31004,186025,403995,663840,869999,1052669,1200174, - 1230910,1195208,1010927,774704,504121,258100,82812,13824,0, - 0,0,0,0,0,0,0,0,0, - 0,35567,94757,127104,150189,159048,139586,103616,29662, - 0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0, - 0,13287,46305,75833,95294,77980,44426,0,0, - 0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,13153,45768,78383,106434, - 117574,114487,101871,68719,36641,6039,0,0,0, - 0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,1476, - 5234,21072,40667,63619,89120,116098,144015,171932,199715, - 227901,255818,281723,304405,324941,341584,357824,373796,388962, - 403995,419296,437818,458621,488820,521301,557674,596329,636728, - 680886,727728,776315,821546,862751,897916,926773,952409,971870, - 980460,981802,955227,918049,865167,793897,713233,613106,507477, - 398224,342255,316082,334604,338228 -}; -const Word32 defaultHRIR_left_avg_power_32kHz_fx[LR_IAC_LENGTH_NR_FC] /*Q-23*/ = { - 8747993,8732977,8657866,8592845,8534553,8549703,8574332,8613196,8612450, - 8594632,8548151,8528631,8527079,8602383,8683241,8772412,8811402,8825092, - 8787822,8745552,8699960,8676052,8653847,8634210,8606620,8577981,8553109, - 8534922,8521190,8494783,8457906,8405301,8354525,8310963,8294462,8290268, - 8294278,8284279,8267812,8241648,8222362,8207531,8203647,8196752,8187852, - 8170672,8158450,8153660,8165857,8182684,8201064,8209352,8210920,8201391, - 8193506,8188086,8186669,8185008,8178398,8165219,8147653,8126564,8107262, - 8090653,8075973,8060647,8040892,8017060,7990510,7965369,7942812,7924139, - 7905508,7885266,7858574,7828903,7797253,7770124,7745051,7723047,7698192, - 7671231,7638683,7606840,7575458,7552800,7532081,7514280,7493736,7472068, - 7448614,7429295,7412736,7405756,7399180,7393182,7382990,7372018,7362119, - 7358680,7359552,7368629,7377118,7384718,7391127,7398953,7413675,7435679, - 7462522,7492302,7520043,7544714,7568412,7592915,7621662,7651325,7681599, - 7702873,7719423,7728886,7735043,7740672,7747517,7751812,7754412,7743650, - 7728089,7705339,7680970,7656341,7632308,7603568,7571683,7527366,7481606, - 7433699,7390347,7348345,7307132,7260525,7210319,7153108,7097458,7044149, - 6995864,6948351,6898883,6845179,6788657,6732512,6680016,6632990,6592154, - 6553113,6515029,6478094,6441947,6416664,6397714,6388260,6386465,6386851, - 6388319,6391700,6396364,6411102,6429029,6451720,6471844,6489796,6501641, - 6513435,6525204,6542518,6559405,6575670,6584344,6589771,6589813,6590845, - 6592531,6595845,6596365,6592707,6580091,6564161,6543961,6524642,6505902, - 6486113,6462969,6434800,6400113,6364034,6328861,6297445,6268521,6239597, - 6208098,6172732,6136241,6100909,6071330,6044722,6020084,5990858,5959116, - 5923599,5889046,5855634,5825838,5795177,5763938,5725518,5685253,5642211, - 5600763,5560540,5523688,5486661,5449525,5408043,5366612,5325264,5291257, - 5260940,5238031,5214778,5191290,5165126,5142795,5126186,5122067,5121799, - 5124433,5124877,5123837,5133241,5151268,5182239,5223192,5269715,5328527, - 5411331,5510141,5612029,5649811,5591443,5269488,4824515,4151102,3472472, - 2790361,2355655,2029229,1865232,1832432 -}; -const Word32 defaultHRIR_right_avg_power_32kHz_fx[LR_IAC_LENGTH_NR_FC] /*Q-23*/ = { - 8747984,8732969,8657857,8592837,8534561,8549686,8574315,8613188,8612450, - 8594632,8548151,8528622,8527070,8602392,8683241,8772404,8811402,8825109, - 8787822,8745552,8699951,8676044,8653847,8634226,8606620,8577964,8553100, - 8534914,8521190,8494808,8457931,8405310,8354525,8310963,8294471,8290276, - 8294278,8284287,8267820,8241639,8222362,8207540,8203664,8196752,8187826, - 8170663,8158450,8153685,8165873,8182684,8201064,8209360,8210945,8201416, - 8193531,8188095,8186669,8185008,8178398,8165219,8147653,8126539,8107237, - 8090644,8075973,8060664,8040875,8017043,7990510,7965369,7942812,7924122, - 7905499,7885283,7858574,7828903,7797270,7770116,7745034,7723056,7698192, - 7671222,7638675,7606840,7575466,7552809,7532089,7514280,7493736,7472068, - 7448597,7429287,7412753,7405756,7399163,7393174,7382981,7372009,7362111, - 7358680,7359560,7368637,7377126,7384718,7391135,7398970,7413692,7435679, - 7462514,7492293,7520026,7544705,7568403,7592915,7621688,7651341,7681582, - 7702873,7719423,7728877,7735026,7740663,7747517,7751829,7754437,7743650, - 7728080,7705330,7680970,7656349,7632308,7603568,7571700,7527383,7481623, - 7433716,7390363,7348353,7307132,7260525,7210327,7153125,7097475,7044149, - 6995872,6948359,6898883,6845179,6788657,6732520,6680024,6632990,6592154, - 6553113,6515037,6478102,6441947,6416664,6397714,6388269,6386457,6386843, - 6388327,6391700,6396347,6411102,6429029,6451712,6471844,6489796,6501624, - 6513427,6525213,6542518,6559405,6575653,6584327,6589763,6589813,6590845, - 6592531,6595836,6596365,6592716,6580099,6564169,6543978,6524642,6505894, - 6486122,6462994,6434817,6400122,6364034,6328852,6297428,6268521,6239597, - 6208090,6172723,6136241,6100909,6071330,6044722,6020076,5990842,5959107, - 5923599,5889037,5855617,5825829,5795169,5763921,5725518,5685253,5642194, - 5600755,5560548,5523688,5486661,5449508,5408026,5366603,5325256,5291257, - 5260949,5238040,5214778,5191281,5165134,5142795,5126194,5122075,5121799, - 5124441,5124877,5123854,5133241,5151259,5182230,5223192,5269715,5328527, - 5411340,5510149,5612037,5649820,5591435,5269472,4824498,4151094,3472472, - 2790378,2355663,2029237,1865240,1832432 -}; - -const Word32 defaultHRIR_coherence_16kHz_fx[LR_IAC_LENGTH_NR_FC] /*Q-27*/ = { - 130123416,130123416,128225040,123478832,118732624,113118568,104033232,94947768,85862304, - 75063144,64263984,53464828,43914296,34675820,25437480,17993766,11746601,5499437, - 1532229,985023,437818,0,0,0,0,0,0, - 0,343865,773496,1203261,2004810,3054258,4103707,4777480,4887673, - 4998000,5066316,4966727,4867271,4767816,4765534,4763253,4760971,4569174, - 4329998,4090822,3659312,3099355,2539533,2037290,1621350,1205543,880065, - 916304,952677,988916,1233058,1477200,1721342,1912602,2090441,2268413, - 2427327,2573490,2719788,2859643,2989834,3120025,3219078,3193576,3168075, - 3142574,2987686,2832665,2677778,2583691,2504771,2425851,2397128,2401692, - 2406255,2356594,2225464,2094333,1933137,1651280,1369423,1087566,924357, - 761148,597940,625051,699677,774302,854295,937779,1021128,1026631, - 915230,803830,670014,446676,223338,0,0,0,0, - 0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,5100,30735, - 56371,81872,173140,264408,355542,419698,477144,534455,552037, - 543044,533918,485599,378494,271254,173946,115964,57982,0, - 0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0, - 0,0,671,1476,2415,99723,261321,423054,646795, - 963549,1280302,1632087,2124129,2616037,3108080,3841982,4575885,5309922, - 6280181,7309766,8339216,8750996,8750996 -}; -const Word32 defaultHRIR_left_avg_power_16kHz_fx[LR_IAC_LENGTH_NR_FC] /*Q-23*/ = { - 9335246,9335246,9316514,9269680,9222847,9180350,9155201,9130044,9104894, - 9126688,9148473,9170267,9191549,9212688,9233844,9234423,9221295,9208167, - 9191205,9168497,9145789,9127997,9129884,9131780,9133676,9164823,9195978, - 9227125,9267550,9310290,9353038,9385225,9410374,9435531,9445170,9431538, - 9417907,9399855,9364128,9328409,9292682,9270670,9248667,9226655,9215783, - 9207688,9199593,9183605,9162356,9141108,9116244,9085961,9055678,9028608, - 9014432,9000255,8986078,8975962,8965845,8955728,8926108,8891606,8857103, - 8819145,8778896,8738639,8710806,8701604,8692401,8686227,8692209,8698190, - 8704171,8686706,8669232,8651767,8623917,8593466,8563024,8543554,8531399, - 8519252,8509748,8504203,8498667,8489716,8467083,8444459,8421835,8399773, - 8377711,8355649,8351698,8352268,8352847,8355833,8360430,8365027,8363484, - 8352721,8341959,8331028,8319460,8307884,8296308,8292063,8287827,8283582, - 8271142,8256647,8242159,8221389,8196442,8171494,8150547,8135607,8120659, - 8106465,8095225,8083992,8072760,8043073,8013394,7983706,7949422,7913997, - 7878564,7853893,7836394,7818904,7801472,7784141,7766811,7744782,7703972, - 7663169,7622359,7580802,7539253,7497696,7474266,7455367,7436467,7415496, - 7393140,7370784,7338471,7291235,7244007,7197551,7154232,7110914,7067595, - 7046615,7025627,7004647,6977485,6948779,6920073,6878751,6829015,6779278, - 6733644,6694184,6654724,6618804,6597044,6575284,6553524,6518183,6482842, - 6447501,6401632,6353137,6304634,6267229,6237215,6207201,6181045,6160677, - 6140310,6115580,6073427,6031275,5989122,5942817,5896503,5850198,5825150, - 5805428,5785707,5765742,5745626,5725510,5693398,5643285,5593180,5544358, - 5500720,5457091,5413454,5404126,5394797,5385469,5366930,5346085,5325239, - 5282164,5224274,5166376,5115566,5075376,5035186,5002731,5001238,4999736, - 4998243,4969436,4940630,4911823,4847290,4773822,4700355,4646282,4605153, - 4564023,4540250,4542523,4544788,4536869,4488241,4439612,4390983,4285488, - 4179984,4074489,4025282,3990150,3955019,3974925,4031523,4088129,4108127, - 4073222,4038317,3957300,3691818,3426335,3160861,2774481,2388110,2001740, - 1708239,1437966,1167685,1059581,1059581 -}; -const Word32 defaultHRIR_right_avg_power_16kHz_fx[LR_IAC_LENGTH_NR_FC] /*Q-23*/ = { - 9335246,9335246,9316514,9269689,9222855,9180358,9155201,9130035,9104869, - 9126663,9148465,9170258,9191540,9212688,9233827,9234415,9221295,9208175, - 9191213,9168488,9145755,9127963,9129867,9131772,9133676,9164831,9195978, - 9227133,9267550,9310281,9353021,9385200,9410357,9435506,9445153,9431522, - 9417899,9399855,9364119,9328384,9292648,9270653,9248658,9226663,9215792, - 9207688,9199593,9183596,9162348,9141100,9116236,9085953,9055678,9028617, - 9014432,9000255,8986070,8975962,8965853,8955745,8926116,8891614,8857103, - 8819145,8778888,8738631,8710789,8701587,8692385,8686219,8692200,8698181, - 8704162,8686697,8669232,8651775,8623917,8593466,8563016,8543546,8531390, - 8519244,8509739,8504203,8498675,8489724,8467100,8444468,8421844,8399773, - 8377703,8355641,8351681,8352252,8352830,8355817,8360414,8365019,8363475, - 8352721,8341959,8331037,8319469,8307893,8296316,8292072,8287835,8283591, - 8271142,8256647,8242151,8221381,8196433,8171494,8150547,8135616,8120676, - 8106482,8095250,8084009,8072777,8043081,8013385,7983698,7949405,7913972, - 7878547,7853876,7836386,7818904,7801481,7784150,7766819,7744790,7703980, - 7663161,7622350,7580793,7539244,7497696,7474258,7455358,7436459,7415487, - 7393132,7370776,7338471,7291244,7244016,7197560,7154241,7110914,7067587, - 7046607,7025627,7004647,6977485,6948770,6920064,6878742,6829006,6779270, - 6733644,6694184,6654724,6618813,6597053,6575301,6553549,6518191,6482842, - 6447492,6401623,6353137,6304643,6267229,6237215,6207201,6181037,6160677, - 6140310,6115580,6073427,6031275,5989122,5942817,5896512,5850207,5825167, - 5805445,5785723,5765750,5745626,5725493,5693382,5643276,5593180,5544375, - 5500729,5457074,5413429,5404109,5394789,5385478,5366939,5346093,5325247, - 5282172,5224282,5166384,5115574,5075384,5035195,5002739,5001238,4999736, - 4998243,4969436,4940630,4911823,4847290,4773814,4700338,4646274,4605153, - 4564023,4540258,4542523,4544788,4536878,4488249,4439612,4390983,4285480, - 4179984,4074489,4025282,3990150,3955019,3974925,4031523,4088129,4108127, - 4073222,4038317,3957292,3691809,3426327,3160844,2774473,2388110,2001740, - 1708239,1437966,1167685,1059573,1059573 -}; - -#endif Word32 sine_table_Q31 [361] = { diff --git a/lib_util/hrtf_file_reader.c b/lib_util/hrtf_file_reader.c index 8b5dadf39..7e38a1a08 100644 --- a/lib_util/hrtf_file_reader.c +++ b/lib_util/hrtf_file_reader.c @@ -586,32 +586,24 @@ static ivas_error set_default_reverb_iac_energy( ) { int16_t i; -#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB int16_t lr_iac_len; -#endif if ( HrFiltSet_p == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; } -#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB lr_iac_len = LR_IAC_LENGTH_NR_FC; if ( HrFiltSet_p->SampleRate == 16000 ) { lr_iac_len = LR_IAC_LENGTH_NR_FC_16KHZ; } -#endif if ( HrFiltSet_p->ModelParams.modelROM == 0 ) { for ( i = 0; i < 3; i++ ) { -#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB HrFiltSet_p->lr_energy_and_iac_dyn_fx[i] = (Word32 *) malloc( lr_iac_len * sizeof( float ) ); -#else - HrFiltSet_p->lr_energy_and_iac_dyn[i] = (Word32 *) malloc( LR_IAC_LENGTH_NR_FC * sizeof( float ) ); -#endif if ( HrFiltSet_p->lr_energy_and_iac_dyn_fx[i] == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for hrtf data" ); @@ -630,15 +622,9 @@ static ivas_error set_default_reverb_iac_energy( mvl2l( defaultHRIR_coherence_32kHz_fx, HrFiltSet_p->lr_energy_and_iac_dyn_fx[2], LR_IAC_LENGTH_NR_FC ); break; case 16000: -#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB floatToFixed_arr32( defaultHRIR_coherence_16kHz_fx, HrFiltSet_p->lr_energy_and_iac_dyn_fx[2], Q27, lr_iac_len ); /* tables from which lr_energy_and_iac is updated has Q27 for i=2 */ floatToFixed_arr32( defaultHRIR_left_avg_power_16kHz_fx, HrFiltSet_p->lr_energy_and_iac_dyn_fx[1], Q23, lr_iac_len ); /* tables from which lr_energy_and_iac is updated has Q23 for i=0,1 */ floatToFixed_arr32( defaultHRIR_left_avg_power_16kHz_fx, HrFiltSet_p->lr_energy_and_iac_dyn_fx[0], Q23, lr_iac_len ); /* tables from which lr_energy_and_iac is updated has Q23 for i=0,1 */ -#else - mvl2l( defaultHRIR_left_avg_power_16kHz_fx, HrFiltSet_p->lr_energy_and_iac_dyn_fx[0], LR_IAC_LENGTH_NR_FC ); - mvl2l( defaultHRIR_right_avg_power_16kHz_fx, HrFiltSet_p->lr_energy_and_iac_dyn_fx[1], LR_IAC_LENGTH_NR_FC ); - mvl2l( defaultHRIR_coherence_16kHz_fx, HrFiltSet_p->lr_energy_and_iac_dyn_fx[2], LR_IAC_LENGTH_NR_FC ); -#endif break; } } @@ -657,7 +643,6 @@ static ivas_error set_default_reverb_iac_energy( HrFiltSet_p->lr_energy_and_iac_fx[2] = defaultHRIR_coherence_32kHz_fx; break; case 16000: -#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB for ( i = 0; i < 3; i++ ) { HrFiltSet_p->lr_energy_and_iac_dyn_fx[i] = (Word32 *) malloc( lr_iac_len * sizeof( float ) ); @@ -672,11 +657,6 @@ static ivas_error set_default_reverb_iac_energy( HrFiltSet_p->lr_energy_and_iac_fx[0] = (const Word32 *) HrFiltSet_p->lr_energy_and_iac_dyn_fx[0]; HrFiltSet_p->lr_energy_and_iac_fx[1] = (const Word32 *) HrFiltSet_p->lr_energy_and_iac_dyn_fx[1]; HrFiltSet_p->lr_energy_and_iac_fx[2] = (const Word32 *) HrFiltSet_p->lr_energy_and_iac_dyn_fx[2]; -#else - HrFiltSet_p->lr_energy_and_iac_fx[0] = defaultHRIR_left_avg_power_16kHz_fx; - HrFiltSet_p->lr_energy_and_iac_fx[1] = defaultHRIR_right_avg_power_16kHz_fx; - HrFiltSet_p->lr_energy_and_iac_fx[2] = defaultHRIR_coherence_16kHz_fx; -#endif break; @@ -726,7 +706,6 @@ static ivas_error load_reverb_from_binary( } lr_iac_len = LR_IAC_LENGTH_NR_FC; -#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( sampleRate == 16000 ) #else @@ -735,7 +714,6 @@ static ivas_error load_reverb_from_binary( { lr_iac_len = LR_IAC_LENGTH_NR_FC_16KHZ; } -#endif header_check_result = IVAS_ERR_OK; @@ -806,7 +784,6 @@ static ivas_error load_reverb_from_binary( hHrtfStatistics->average_energy_r = hHrtfStatistics->average_energy_r_dyn; hHrtfStatistics->inter_aural_coherence = hHrtfStatistics->inter_aural_coherence_dyn; -#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB fread( f_tmp_lr_energy_and_iac_dyn, sizeof( float ), lr_iac_len, f_hrtf ); floatToFixed_arr32( f_tmp_lr_energy_and_iac_dyn, hHrtfStatistics->average_energy_l_dyn, Q28, lr_iac_len ); @@ -815,16 +792,6 @@ static ivas_error load_reverb_from_binary( fread( f_tmp_lr_energy_and_iac_dyn, sizeof( float ), lr_iac_len, f_hrtf ); floatToFixed_arr32( f_tmp_lr_energy_and_iac_dyn, hHrtfStatistics->inter_aural_coherence_dyn, Q26, lr_iac_len ); -#else - fread( f_tmp_lr_energy_and_iac_dyn, sizeof( float ), lr_iac_len, f_hrtf ); - floatToFixed_arr32( f_tmp_lr_energy_and_iac_dyn, hHrtfStatistics->average_energy_l_dyn, Q23, lr_iac_len ); - - fread( f_tmp_lr_energy_and_iac_dyn, sizeof( float ), lr_iac_len, f_hrtf ); - floatToFixed_arr32( f_tmp_lr_energy_and_iac_dyn, hHrtfStatistics->average_energy_r_dyn, Q23, lr_iac_len ); - - fread( f_tmp_lr_energy_and_iac_dyn, sizeof( float ), lr_iac_len, f_hrtf ); - floatToFixed_arr32( f_tmp_lr_energy_and_iac_dyn, hHrtfStatistics->inter_aural_coherence_dyn, Q23, lr_iac_len ); -#endif hHrtfStatistics->fromROM = FALSE; #else /* left/right energy and interaural coherence for late reverb */ @@ -1155,7 +1122,6 @@ void destroy_td_hrtf( free( ( *hHrtf )->lr_energy_and_iac_dyn_fx[i] ); } } -#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB else { for ( i = 0; i < 3; i++ ) @@ -1166,7 +1132,6 @@ void destroy_td_hrtf( } } } -#endif #else } #endif @@ -2344,11 +2309,7 @@ void destroy_hrtf_statistics( IVAS_DEC_HRTF_STATISTICS_HANDLE *hHrtfStatistics /* i/o: HRTF statistics handle */ ) { -#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB if ( ( hHrtfStatistics != NULL ) && ( *hHrtfStatistics != NULL ) ) -#else - if ( ( hHrtfStatistics != NULL ) && ( *hHrtfStatistics != NULL ) && ( ( *hHrtfStatistics )->fromROM == FALSE ) ) -#endif { if ( ( *hHrtfStatistics )->average_energy_l_dyn != NULL ) { -- GitLab From c4510ca6a7bca037ee36933a5b0c4355034e7728 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Tue, 8 Jul 2025 15:23:03 +0200 Subject: [PATCH 09/11] [cleanup] accept NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES --- apps/decoder.c | 23 -- apps/renderer.c | 16 -- lib_com/common_api_types.h | 2 - lib_com/options.h | 1 - lib_dec/ivas_binRenderer_internal_fx.c | 4 - lib_dec/ivas_init_dec_fx.c | 18 -- lib_dec/ivas_ism_dec_fx.c | 8 - lib_dec/ivas_mct_dec_fx.c | 4 - lib_dec/ivas_stat_dec.h | 2 - lib_dec/lib_dec.h | 2 - lib_dec/lib_dec_fx.c | 2 - lib_rend/ivas_crend_fx.c | 10 - .../ivas_dirac_dec_binaural_functions_fx.c | 5 - lib_rend/ivas_hrtf_fx.c | 2 - lib_rend/ivas_objectRenderer_mix_fx.c | 32 --- lib_rend/ivas_prot_rend_fx.h | 62 ----- lib_rend/ivas_reverb_filter_design_fx.c | 257 ------------------ lib_rend/ivas_reverb_fx.c | 208 -------------- lib_rend/ivas_reverb_utils_fx.c | 214 --------------- lib_rend/ivas_stat_rend.h | 7 - lib_rend/lib_rend.h | 2 - lib_rend/lib_rend_fx.c | 97 ------- lib_util/hrtf_file_reader.c | 164 ----------- lib_util/hrtf_file_reader.h | 6 - 24 files changed, 1148 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index 0108d1325..98673972e 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -166,9 +166,7 @@ int main( IVAS_RENDER_FRAMESIZE asked_frame_size; IVAS_DEC_HRTF_HANDLE *hHrtfTD = NULL; IVAS_DEC_HRTF_CREND_HANDLE *hSetOfHRTF = NULL; -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES IVAS_DEC_HRTF_STATISTICS_HANDLE *hHrtfStatistics = NULL; -#endif #ifdef WMOPS reset_wmops(); @@ -586,16 +584,6 @@ int main( } } -#ifndef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES - if ( ( *hHrtfTD != NULL ) && ( error = load_reverb_binary( *hHrtfTD, hrtfReader ) ) != IVAS_ERR_OK ) - { - if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA ) - { - fprintf( stderr, "\nError in loading HRTF binary file %s \n\n", arg.hrtfFileName ); - goto cleanup; - } - } -#endif if ( ( error = IVAS_DEC_GetHrtfCRendHandle( hIvasDec, &hSetOfHRTF ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nIVAS_DEC_GetHrtfCRendHandle failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); @@ -654,7 +642,6 @@ int main( destroy_parambin_hrtf( hHrtfParambin ); } } -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( ( error = IVAS_DEC_GetHrtfStatisticsHandle( hIvasDec, &hHrtfStatistics ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nIVAS_DEC_GetHrtfHandle failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); @@ -672,16 +659,6 @@ int main( destroy_hrtf_statistics( hHrtfStatistics ); } } -#else - if ( ( hHrtfTD != NULL ) && ( *hHrtfTD != NULL ) && ( error = load_reverb_binary( *hHrtfTD, hrtfReader ) ) != IVAS_ERR_OK ) - { - if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA ) - { - fprintf( stderr, "\nError in loading HRTF binary file %s \n\n", arg.hrtfFileName ); - goto cleanup; - } - } -#endif } /*------------------------------------------------------------------------------------------* diff --git a/apps/renderer.c b/apps/renderer.c index f36434778..13d68cdef 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -735,9 +735,7 @@ int main( IVAS_DEC_HRTF_FASTCONV_HANDLE *hHrtfFastConv = NULL; IVAS_DEC_HRTF_PARAMBIN_HANDLE *hHrtfParambin = NULL; IVAS_DEC_HRTF_HANDLE *hHrtfTD = NULL; -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES IVAS_DEC_HRTF_STATISTICS_HANDLE *hHrtfStatistics = NULL; -#endif IsmPositionProvider *positionProvider = NULL; LfeRoutingConfig *lfeRoutingConfigs[RENDERER_MAX_MC_INPUTS]; RenderConfigReader *renderConfigReader = NULL; @@ -992,16 +990,6 @@ int main( } } -#ifndef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES - if ( ( hHrtfTD != NULL ) && ( error = load_reverb_binary( *hHrtfTD, hrtfFileReader ) ) != IVAS_ERR_OK ) - { - if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA ) - { - fprintf( stderr, "\nError in loading HRTF binary file %s: %s \n\n", args.customHrtfFilePath, ivas_error_to_string( error ) ); - goto cleanup; - } - } -#endif if ( ( error = IVAS_REND_GetHrtfCRendHandle( hIvasRend, &hSetOfHRTF ) ) != IVAS_ERR_OK ) { @@ -1062,7 +1050,6 @@ int main( } -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( ( error = IVAS_REND_GetHrtfStatisticsHandle( hIvasRend, &hHrtfStatistics ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nIVAS_REND_GetHrtfStatisticsHandle failed\n\n" ); @@ -1080,7 +1067,6 @@ int main( destroy_hrtf_statistics( hHrtfStatistics ); } } -#endif hrtfFileReader_close( &hrtfFileReader ); } @@ -2107,9 +2093,7 @@ cleanup: { destroy_td_hrtf( hHrtfTD ); } -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES destroy_hrtf_statistics( hHrtfStatistics ); -#endif IVAS_REND_Close( &hIvasRend ); IsmPositionProvider_close( positionProvider ); RenderConfigReader_close( &renderConfigReader ); diff --git a/lib_com/common_api_types.h b/lib_com/common_api_types.h index 175b23c3b..33013360e 100644 --- a/lib_com/common_api_types.h +++ b/lib_com/common_api_types.h @@ -182,9 +182,7 @@ typedef struct TDREND_HRFILT_FiltSet_struct *IVAS_DEC_HRTF_HANDLE; typedef struct ivas_hrtfs_crend_structure *IVAS_DEC_HRTF_CREND_HANDLE; typedef struct ivas_hrtfs_fastconv_struct *IVAS_DEC_HRTF_FASTCONV_HANDLE; typedef struct ivas_hrtfs_parambin_struct *IVAS_DEC_HRTF_PARAMBIN_HANDLE; -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES typedef struct ivas_hrtfs_statistics_struct *IVAS_DEC_HRTF_STATISTICS_HANDLE; -#endif typedef struct cldfb_filter_bank_struct *IVAS_CLDFB_FILTER_BANK_HANDLE; typedef struct ivas_LS_setup_custom *IVAS_LSSETUP_CUSTOM_HANDLE; diff --git a/lib_com/options.h b/lib_com/options.h index 1bb60b341..fb009faea 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -109,7 +109,6 @@ #endif #define USE_NEW_HRTF_BINARY_FILE_FORMAT /* Orange: to activate when decided to change the hrtf binary file format */ -#define NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES /* Philips: Use pre-computed HRTF average L/R energies and IAC in all renderers */ #define FIX_WARNING_RENDER_CONFIG /* Orange: fix warning on windows build */ diff --git a/lib_dec/ivas_binRenderer_internal_fx.c b/lib_dec/ivas_binRenderer_internal_fx.c index a1b6bb5ed..6911e487f 100644 --- a/lib_dec/ivas_binRenderer_internal_fx.c +++ b/lib_dec/ivas_binRenderer_internal_fx.c @@ -1344,11 +1344,7 @@ ivas_error ivas_binRenderer_open_fx( test(); IF( ( EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_FASTCONV_ROOM ) || EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_FASTCONV ) ) && EQ_32( st_ivas->hOutSetup.output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) { -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES IF( NE_32( ( error = ivas_binaural_reverb_init( &( hBinRenderer->hReverb ), st_ivas->hHrtfStatistics, hBinRenderer->conv_band, hBinRenderer->timeSlots, &( st_ivas->hRenderConfig->roomAcoustics ), st_ivas->hDecoderConfig->output_Fs, st_ivas->hHrtfFastConv->fastconvReverberationTimes_fx, st_ivas->hHrtfFastConv->fastconvReverberationEneCorrections_fx ) ), IVAS_ERR_OK ) ) -#else - IF( NE_32( ( error = ivas_binaural_reverb_open_fastconv_fx( &( hBinRenderer->hReverb ), hBinRenderer->conv_band, hBinRenderer->timeSlots, &( st_ivas->hRenderConfig->roomAcoustics ), st_ivas->hIntSetup.output_config, st_ivas->hDecoderConfig->output_Fs, st_ivas->hHrtfFastConv ) ), IVAS_ERR_OK ) ) -#endif { return error; } diff --git a/lib_dec/ivas_init_dec_fx.c b/lib_dec/ivas_init_dec_fx.c index 926d1f93f..ef3d8c6e9 100644 --- a/lib_dec/ivas_init_dec_fx.c +++ b/lib_dec/ivas_init_dec_fx.c @@ -1163,12 +1163,10 @@ IF( NE_32( ( error = ivas_HRTF_parambin_binary_open_fx( &st_ivas->hHrtfParambin return error; } -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES IF( NE_32( ( error = ivas_HRTF_statistics_binary_open( &st_ivas->hHrtfStatistics ) ), IVAS_ERR_OK ) ) { return error; } -#endif } /*-------------------------------------------------------------------* @@ -1353,7 +1351,6 @@ ivas_error ivas_init_decoder_fx( } -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES /*--------------------------------------------------------------------* * Allocate and initialize HRTF Statistics handle *--------------------------------------------------------------------*/ @@ -1365,7 +1362,6 @@ ivas_error ivas_init_decoder_fx( return error; } } -#endif /*-----------------------------------------------------------------* * Initialize binuaral split rendering @@ -2276,11 +2272,7 @@ ivas_error ivas_init_decoder_fx( IF( EQ_32( st_ivas->hOutSetup.output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) { -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( NE_32( ( error = ivas_reverb_open_fx( &st_ivas->hReverb, st_ivas->hHrtfStatistics, st_ivas->hRenderConfig, st_ivas->hDecoderConfig->output_Fs ) ), IVAS_ERR_OK ) ) -#else - IF( NE_32( ( error = ivas_reverb_open_fx( &st_ivas->hReverb, st_ivas->hDecoderConfig->output_config, NULL, st_ivas->hBinRendererTd->HrFiltSet_p->lr_energy_and_iac_fx, st_ivas->hRenderConfig, st_ivas->hDecoderConfig->output_Fs ) ), IVAS_ERR_OK ) ) -#endif { return error; } @@ -2323,15 +2315,9 @@ ivas_error ivas_init_decoder_fx( } } -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES IF( NE_32( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), st_ivas->intern_config, st_ivas->hDecoderConfig->output_config, st_ivas->hRenderConfig, st_ivas->hSetOfHRTF, st_ivas->hHrtfStatistics, st_ivas->hDecoderConfig->output_Fs, ( st_ivas->hSplitBinRend == NULL ) ? 1 : st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses ) ), IVAS_ERR_OK ) ) -#else - IF( NE_32( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), st_ivas->intern_config, st_ivas->hDecoderConfig->output_config, - st_ivas->hRenderConfig, st_ivas->hSetOfHRTF, st_ivas->hDecoderConfig->output_Fs, ( st_ivas->hSplitBinRend == NULL ) ? 1 : st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses ) ), - IVAS_ERR_OK ) ) -#endif { return error; } @@ -2862,9 +2848,7 @@ void ivas_initialize_handles_dec( st_ivas->hSetOfHRTF = NULL; st_ivas->hHrtfFastConv = NULL; st_ivas->hHrtfParambin = NULL; -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES st_ivas->hHrtfStatistics = NULL; -#endif st_ivas->hoa_dec_mtx = NULL; st_ivas->hMasaIsmData = NULL; st_ivas->hSbaIsmData = NULL; @@ -3087,10 +3071,8 @@ void ivas_destroy_dec_fx( /* Parametric binauralizer HRTF filters */ ivas_HRTF_parambin_binary_close_fx( &st_ivas->hHrtfParambin ); -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES /* HRTF statistics */ ivas_HRTF_statistics_close( &st_ivas->hHrtfStatistics ); -#endif /* Config. Renderer */ ivas_render_config_close( &( st_ivas->hRenderConfig ) ); diff --git a/lib_dec/ivas_ism_dec_fx.c b/lib_dec/ivas_ism_dec_fx.c index 727a0a651..41c1efcdc 100644 --- a/lib_dec/ivas_ism_dec_fx.c +++ b/lib_dec/ivas_ism_dec_fx.c @@ -212,11 +212,7 @@ static ivas_error ivas_ism_bitrate_switching_dec_fx( } IF( EQ_32( st_ivas->hOutSetup.output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) { -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES IF( NE_32( ( error = ivas_reverb_open_fx( &st_ivas->hReverb, st_ivas->hHrtfStatistics, st_ivas->hRenderConfig, st_ivas->hDecoderConfig->output_Fs ) ), IVAS_ERR_OK ) ) -#else - IF( NE_32( ( error = ivas_reverb_open_fx( &st_ivas->hReverb, st_ivas->hDecoderConfig->output_config, NULL, st_ivas->hBinRendererTd->HrFiltSet_p->lr_energy_and_iac_fx, st_ivas->hRenderConfig, st_ivas->hDecoderConfig->output_Fs ) ), IVAS_ERR_OK ) ) -#endif { return error; } @@ -239,11 +235,7 @@ static ivas_error ivas_ism_bitrate_switching_dec_fx( ivas_dirac_dec_close_binaural_data( st_ivas->hDiracDecBin ); /* Open Crend Binaural renderer */ -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES IF( NE_32( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), st_ivas->intern_config, st_ivas->hOutSetup.output_config, st_ivas->hRenderConfig, st_ivas->hSetOfHRTF, st_ivas->hHrtfStatistics, st_ivas->hDecoderConfig->output_Fs, ( st_ivas->hSplitBinRend == NULL ) ? 1 : st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses ) ), IVAS_ERR_OK ) ) -#else - IF( NE_32( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), st_ivas->intern_config, st_ivas->hOutSetup.output_config, st_ivas->hRenderConfig, st_ivas->hSetOfHRTF, st_ivas->hDecoderConfig->output_Fs, ( st_ivas->hSplitBinRend == NULL ) ? 1 : st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses ) ), IVAS_ERR_OK ) ) -#endif st_ivas->binaural_latency_ns = st_ivas->hCrendWrapper->binaural_latency_ns; move32(); diff --git a/lib_dec/ivas_mct_dec_fx.c b/lib_dec/ivas_mct_dec_fx.c index ed43b9991..97b794b44 100644 --- a/lib_dec/ivas_mct_dec_fx.c +++ b/lib_dec/ivas_mct_dec_fx.c @@ -1546,11 +1546,7 @@ static ivas_error ivas_mc_dec_reconfig_fx( } ELSE IF( st_ivas->hCrendWrapper == NULL && ( EQ_16( st_ivas->renderer_type, RENDERER_BINAURAL_MIXER_CONV ) || EQ_16( st_ivas->renderer_type, RENDERER_BINAURAL_MIXER_CONV_ROOM ) ) ) { -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES IF( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), st_ivas->intern_config, st_ivas->hDecoderConfig->output_config, st_ivas->hRenderConfig, st_ivas->hSetOfHRTF, st_ivas->hHrtfStatistics, st_ivas->hDecoderConfig->output_Fs, ( st_ivas->hSplitBinRend == NULL ) ? 1 : st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses ) ) != IVAS_ERR_OK ) -#else - IF( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), st_ivas->intern_config, st_ivas->hDecoderConfig->output_config, st_ivas->hRenderConfig, st_ivas->hSetOfHRTF, st_ivas->hDecoderConfig->output_Fs, ( st_ivas->hSplitBinRend == NULL ) ? 1 : st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses ) ) != IVAS_ERR_OK ) -#endif { return error; } diff --git a/lib_dec/ivas_stat_dec.h b/lib_dec/ivas_stat_dec.h index db23485b8..274aa1910 100644 --- a/lib_dec/ivas_stat_dec.h +++ b/lib_dec/ivas_stat_dec.h @@ -1121,9 +1121,7 @@ typedef struct Decoder_Struct HRTFS_CREND_HANDLE hSetOfHRTF; /* Set of HRTFs handle (CRend) */ HRTFS_FASTCONV_HANDLE hHrtfFastConv; /* FASTCONV HRTF tables for binaural rendering */ HRTFS_PARAMBIN_HANDLE hHrtfParambin; /* HRTF tables for parametric binauralizer */ -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES HRTFS_STATISTICS_HANDLE hHrtfStatistics; /* HRTF statistics handle */ -#endif LSSETUP_CUSTOM_HANDLE hLsSetupCustom; /* Custom LS configuration handle */ Word32 *hoa_dec_mtx; /* Pointer to decoder matrix for SBA */ HEAD_TRACK_DATA_HANDLE hHeadTrackData; /* Head tracking data structure */ diff --git a/lib_dec/lib_dec.h b/lib_dec/lib_dec.h index 28b8594fe..3a6ea5b45 100644 --- a/lib_dec/lib_dec.h +++ b/lib_dec/lib_dec.h @@ -367,12 +367,10 @@ ivas_error IVAS_DEC_GetHrtfParamBinHandle( IVAS_DEC_HRTF_PARAMBIN_HANDLE **hHrtfParambin /* o : Parametric binauralizer HRTF handle */ ); -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES ivas_error IVAS_DEC_GetHrtfStatisticsHandle( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ IVAS_DEC_HRTF_STATISTICS_HANDLE **hHrtfStatistics /* o : HRTF statistics handle */ ); -#endif /*! r: error code*/ ivas_error IVAS_DEC_GetRenderConfig( diff --git a/lib_dec/lib_dec_fx.c b/lib_dec/lib_dec_fx.c index 551a20c0f..4c448efc7 100644 --- a/lib_dec/lib_dec_fx.c +++ b/lib_dec/lib_dec_fx.c @@ -2564,7 +2564,6 @@ ivas_error IVAS_DEC_GetHrtfParamBinHandle( return IVAS_ERR_OK; } -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES /*---------------------------------------------------------------------* * IVAS_DEC_GetHrtfStatisticsHandle( ) * @@ -2585,7 +2584,6 @@ ivas_error IVAS_DEC_GetHrtfStatisticsHandle( return IVAS_ERR_OK; } -#endif /*---------------------------------------------------------------------* * copyRendererConfigStruct( ) diff --git a/lib_rend/ivas_crend_fx.c b/lib_rend/ivas_crend_fx.c index 825ff582e..a8195dae3 100644 --- a/lib_rend/ivas_crend_fx.c +++ b/lib_rend/ivas_crend_fx.c @@ -1500,11 +1500,7 @@ ivas_error ivas_rend_openMultiBinCrend( { ivas_error error; -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( ( error = ivas_rend_openCrend( pCrend, inConfig, outConfig, NULL /*hRendCfg*/, NULL, NULL /* hHrtfStatistics */, output_Fs, pMultiBinPoseData->num_poses ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_rend_openCrend( pCrend, inConfig, outConfig, NULL /*hRendCfg*/, NULL, output_Fs, pMultiBinPoseData->num_poses ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -1524,9 +1520,7 @@ ivas_error ivas_rend_openCrend( const AUDIO_CONFIG outConfig, RENDER_CONFIG_DATA *hRendCfg, HRTFS_CREND_HANDLE hSetOfHRTF, -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES HRTFS_STATISTICS_HANDLE hHrtfStatistics, -#endif const Word32 output_Fs, const Word16 num_poses ) { @@ -1657,11 +1651,7 @@ ivas_error ivas_rend_openCrend( IF( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES IF( NE_32( ( error = ivas_reverb_open_fx( &( hCrend->hReverb ), hHrtfStatistics, hRendCfg, output_Fs ) ), IVAS_ERR_OK ) ) -#else - IF( NE_32( ( error = ivas_reverb_open_fx( &( hCrend->hReverb ), inConfig, ( *pCrend )->hHrtfCrend, NULL, hRendCfg, output_Fs ) ), IVAS_ERR_OK ) ) -#endif { return error; } diff --git a/lib_rend/ivas_dirac_dec_binaural_functions_fx.c b/lib_rend/ivas_dirac_dec_binaural_functions_fx.c index 75a8d4b23..959c8165c 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions_fx.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions_fx.c @@ -315,15 +315,10 @@ ivas_error ivas_dirac_dec_init_binaural_data_fx( IF( hDiracDecBin->hReverb == NULL && EQ_16( pos_idx, 0 ) ) /* open reverb only for the main direction */ { -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES #ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF if ( NE_32( ( error = ivas_binaural_reverb_init( &hDiracDecBin->hReverb, st_ivas->hHrtfStatistics, nBins, CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES, &( st_ivas->hRenderConfig->roomAcoustics ), output_Fs, ( *phHrtfParambin )->parametricReverberationTimes_fx, ( *phHrtfParambin )->parametricReverberationEneCorrections_fx ) ), IVAS_ERR_OK ) ) #else if ( ( error = ivas_binaural_reverb_init( &hDiracDecBin->hReverb, st_ivas->hHrtfStatistics, nBins, CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES, &( st_ivas->hRenderConfig->roomAcoustics ), output_Fs, st_ivas->hHrtfParambin->parametricReverberationTimes_fx, st_ivas->hHrtfParambin->parametricReverberationEneCorrections_fx ) ) != IVAS_ERR_OK ) -#endif -#else - /* Todo Philips: Room acoustics should be passed here once the underlying part works. Probably enough to pick it from st_ivas but you know best. */ - if ( ( error = ivas_binaural_reverb_open_parambin( &hDiracDecBin->hReverb, nBins, CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES, NULL, output_Fs, st_ivas->hHrtfParambin ) ) != IVAS_ERR_OK ) #endif { return error; diff --git a/lib_rend/ivas_hrtf_fx.c b/lib_rend/ivas_hrtf_fx.c index da862b51b..2a75dee81 100644 --- a/lib_rend/ivas_hrtf_fx.c +++ b/lib_rend/ivas_hrtf_fx.c @@ -214,7 +214,6 @@ void ivas_HRTF_parambin_binary_close_fx( return; } -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES /*-----------------------------------------------------------------------* * ivas_HRTF_statistics_binary_open() * @@ -361,4 +360,3 @@ ivas_error ivas_HRTF_statistics_init( return IVAS_ERR_OK; } -#endif diff --git a/lib_rend/ivas_objectRenderer_mix_fx.c b/lib_rend/ivas_objectRenderer_mix_fx.c index cb6e3a3fe..1fc754dff 100644 --- a/lib_rend/ivas_objectRenderer_mix_fx.c +++ b/lib_rend/ivas_objectRenderer_mix_fx.c @@ -407,38 +407,6 @@ static ivas_error DefaultBSplineModel_fx( model = &( HrFiltSet_p->ModelParams ); modelITD = &( HrFiltSet_p->ModelParamsITD ); -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES -#else - SWITCH( output_Fs ) - { - case 48000: - HrFiltSet_p->lr_energy_and_iac_fx[0] = defaultHRIR_left_avg_power_48kHz_fx; // Q23 - HrFiltSet_p->lr_energy_and_iac_fx[1] = defaultHRIR_right_avg_power_48kHz_fx; // Q23 - HrFiltSet_p->lr_energy_and_iac_fx[2] = defaultHRIR_coherence_48kHz_fx; // Q23 - BREAK; - case 32000: - HrFiltSet_p->lr_energy_and_iac_fx[0] = defaultHRIR_left_avg_power_32kHz_fx; // Q23 - HrFiltSet_p->lr_energy_and_iac_fx[1] = defaultHRIR_right_avg_power_32kHz_fx; // Q23 - HrFiltSet_p->lr_energy_and_iac_fx[2] = defaultHRIR_coherence_32kHz_fx; // Q23 - BREAK; - case 16000: - for ( i = 0; i < 3; i++ ) - { - HrFiltSet_p->lr_energy_and_iac_dyn_fx[i] = (Word32 *) malloc( LR_IAC_LENGTH_NR_FC_16KHZ * sizeof( float ) ); - if ( HrFiltSet_p->lr_energy_and_iac_dyn_fx[i] == NULL ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for hrtf data" ); - } - } - floatToFixed_arr32( defaultHRIR_coherence_16kHz_fx, HrFiltSet_p->lr_energy_and_iac_dyn_fx[2], Q27, LR_IAC_LENGTH_NR_FC_16KHZ ); /* tables from which lr_energy_and_iac is updated has Q27 for i=2 */ - floatToFixed_arr32( defaultHRIR_left_avg_power_16kHz_fx, HrFiltSet_p->lr_energy_and_iac_dyn_fx[1], Q23, LR_IAC_LENGTH_NR_FC_16KHZ ); /* tables from which lr_energy_and_iac is updated has Q23 for i=0,1 */ - floatToFixed_arr32( defaultHRIR_left_avg_power_16kHz_fx, HrFiltSet_p->lr_energy_and_iac_dyn_fx[0], Q23, LR_IAC_LENGTH_NR_FC_16KHZ ); /* tables from which lr_energy_and_iac is updated has Q23 for i=0,1 */ - HrFiltSet_p->lr_energy_and_iac_fx[0] = (const Word32 *) HrFiltSet_p->lr_energy_and_iac_dyn_fx[0]; - HrFiltSet_p->lr_energy_and_iac_fx[1] = (const Word32 *) HrFiltSet_p->lr_energy_and_iac_dyn_fx[1]; - HrFiltSet_p->lr_energy_and_iac_fx[2] = (const Word32 *) HrFiltSet_p->lr_energy_and_iac_dyn_fx[2]; - BREAK; - } -#endif /* Set ROM flag for correct deallocation */ model->modelROM = TRUE; diff --git a/lib_rend/ivas_prot_rend_fx.h b/lib_rend/ivas_prot_rend_fx.h index 3fc299761..0e2033fd4 100644 --- a/lib_rend/ivas_prot_rend_fx.h +++ b/lib_rend/ivas_prot_rend_fx.h @@ -616,7 +616,6 @@ void ivas_HRTF_CRend_binary_close_fx( HRTFS_CREND **hSetOfHRTF /* i/o: Set of HRTF handle */ ); -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES ivas_error ivas_HRTF_statistics_init( HRTFS_STATISTICS_HANDLE *hHrtfStatistics, /* i/o: HRTF statistics structure */ int32_t sampleRate /* i : Sample rate */ @@ -630,7 +629,6 @@ ivas_error ivas_HRTF_statistics_binary_open( HRTFS_STATISTICS **hHrtfStatistics /* i/o: HRTF statistics structure */ ); -#endif /*----------------------------------------------------------------------------------* * TD object renderer @@ -876,9 +874,7 @@ ivas_error ivas_rend_openCrend( const AUDIO_CONFIG outConfig, RENDER_CONFIG_DATA *hRendCfg, HRTFS_CREND_HANDLE hSetOfHRTF, -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES HRTFS_STATISTICS_HANDLE hHrtfStatistics, -#endif const Word32 output_Fs, const Word16 num_poses ); @@ -919,44 +915,18 @@ ivas_error ivas_rend_crendProcessSubframe( * Reverberator *----------------------------------------------------------------------------------*/ -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES ivas_error ivas_binaural_reverb_init( -#else -ivas_error ivas_binaural_reverb_open_fastconv_fx( -#endif REVERB_STRUCT_HANDLE *hReverbPr, /* i/o: binaural reverb handle */ -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES const HRTFS_STATISTICS_HANDLE hHrtfStatistics, /* i : HRTF statistics handle */ -#else -#endif const Word16 numBins, /* i : number of CLDFB bins */ const Word16 numCldfbSlotsPerFrame, /* i : number of CLDFB slots per frame */ -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES const IVAS_ROOM_ACOUSTICS_CONFIG_DATA *roomAcoustics, /* i/o: room acoustics parameters */ -#else - IVAS_ROOM_ACOUSTICS_CONFIG_DATA *roomAcoustics, /* i/o: room acoustics parameters */ - const AUDIO_CONFIG internal_config, /* i : internal audio config for FastConv */ -#endif const Word32 sampling_rate, /* i : sampling rate */ -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES const Word32 *defaultTimes, /* i : default reverberation times */ const Word32 *defaultEne /* i : default reverberation energies */ -#else - const HRTFS_FASTCONV_HANDLE hHrtfFastConv /* i : FastConv HRTF handle */ -#endif ); -#ifndef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES -ivas_error ivas_binaural_reverb_open_parambin( - REVERB_STRUCT_HANDLE *hReverbPr, /* i/o: binaural reverb handle */ - const Word16 numBins, /* i : number of CLDFB bins Q0 */ - const Word16 numCldfbSlotsPerFrame, /* i : number of CLDFB slots per frame Q0 */ - IVAS_ROOM_ACOUSTICS_CONFIG_DATA *roomAcoustics, /* i/o: room acoustics parameters */ - const Word32 sampling_rate, /* i : sampling rate Q0 */ - const HRTFS_PARAMBIN_HANDLE hHrtfParambin /* i : Parametric binauralizer HRTF handle */ -); -#endif void ivas_binaural_reverb_close_fx( REVERB_STRUCT_HANDLE *hReverb /* i/o: binaural reverb handle */ @@ -977,13 +947,7 @@ void ivas_binaural_reverb_processSubframe_fx( ivas_error ivas_reverb_open_fx( REVERB_HANDLE *hReverb, /* i/o: Reverberator handle */ -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES const HRTFS_STATISTICS_HANDLE hHrtfStatistics, /* i : HRTF statistics handle */ -#else - const AUDIO_CONFIG input_audio_config, /* i : reverb. input audio configuration */ - const HRTFS_HANDLE hHrtf, /* i : HRTF handle */ - const Word32 *lr_energy_and_iac_fx[], /* i : precomuputed lr energies and iac */ -#endif RENDER_CONFIG_HANDLE hRenderConfig, /* i : Renderer configuration handle */ const Word32 output_Fs /* i : output sampling rate */ ); @@ -1129,23 +1093,12 @@ void ivas_reverb_calc_color_levels_fx( const Word32 *pT60_filter_coeff, //input in Q31 Word32 *pTarget_color_L, //output in Q30 Word32 *pTarget_color_R); //output in Q30 -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES ivas_error ivas_reverb_prepare_cldfb_params( const IVAS_ROOM_ACOUSTICS_CONFIG_DATA *pInput_params, const HRTFS_STATISTICS_HANDLE hHrtfStatistics, const int32_t output_Fs, float *pOutput_t60, float *pOutput_ene ); -#else -ivas_error ivas_reverb_prepare_cldfb_params( - IVAS_ROOM_ACOUSTICS_CONFIG_DATA *pInput_params, - const HRTFS_FASTCONV_HANDLE hHrtfFastConv, - const AUDIO_CONFIG input_audio_config, - const int16_t use_brir, - const int32_t output_Fs, - float *pOutput_t60, - float *pOutput_ene ); -#endif void ivas_reverb_interpolate_acoustic_data_fx( const Word16 input_table_size, const Word32 *pInput_fc, //input in Q16 @@ -1172,21 +1125,6 @@ void ivas_reverb_interpolate_energies_fx( Word16 *pOutput_ene_r_e //output e ); #endif -#ifndef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES -void ivas_reverb_get_hrtf_set_properties_fx( - Word32 **ppHrtf_set_L_re, - Word32 **ppHrtf_set_L_im, - Word32 **ppHrtf_set_R_re, - Word32 **ppHrtf_set_R_im, - const AUDIO_CONFIG input_audio_config, - const Word16 hrtf_count, - const Word16 in_freq_count, - const Word16 out_freq_count, - Word32 *pOut_avg_pwr_L, //output in Q23 - Word32 *pOut_avg_pwr_R, //output in Q23 - Word32 *out_i_a_coherence //output in Q27 -); -#endif /*---------------------------------------------------------------------------------* * Shoebox Prototypes *-----------------------------------------------------------------------------------*/ diff --git a/lib_rend/ivas_reverb_filter_design_fx.c b/lib_rend/ivas_reverb_filter_design_fx.c index aacfb2009..0b8642120 100644 --- a/lib_rend/ivas_reverb_filter_design_fx.c +++ b/lib_rend/ivas_reverb_filter_design_fx.c @@ -1003,260 +1003,3 @@ void ivas_reverb_interpolate_energies_fx( } #endif -#ifndef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES -/*-------------------------------------------------------------------* - * ivas_reverb_get_hrtf_set_properties() - * - * Function analyses the HRTF set and computes avarage left/right power spectrum - * and frequency-dependent IA coherence. Expects frequency-domain HRTF input - *-------------------------------------------------------------------*/ - - -void ivas_reverb_get_hrtf_set_properties_fx( - Word32 **ppHrtf_set_L_re, // Q29 - Word32 **ppHrtf_set_L_im, // Q29 - Word32 **ppHrtf_set_R_re, // Q29 - Word32 **ppHrtf_set_R_im, // Q29 - const AUDIO_CONFIG input_audio_config, - const Word16 hrtf_count, - const Word16 in_freq_count, - const Word16 out_freq_count, - Word32 *pOut_avg_pwr_L, // output in Q23 - Word32 *pOut_avg_pwr_R, // output in Q23 - Word32 *out_i_a_coherence ) // output in Q27 -{ - const Word16 foa_sum_coeffs[4][3] = { - { MAX_WORD16, MAX_WORD16, 0 }, - { MAX_WORD16, -MAX_WORD16, 0 }, - { MAX_WORD16, 0, MAX_WORD16 }, - { MAX_WORD16, 0, -MAX_WORD16 } - }; - move16(); - move16(); - move16(); - move16(); - move16(); - move16(); - move16(); - move16(); - move16(); - move16(); - move16(); - move16(); - const Word32 inp_freq_step = divide3232( ONE_IN_Q22, L_shl( in_freq_count, 23 ) ); // q= 15 - const Word32 inp_freq_offset = L_shr( inp_freq_step, 1 ); // q= 15 - const Word16 out_freq_step = divide3232( ONE_IN_Q21, L_shl( L_sub( out_freq_count, 1 ), 22 ) ); // q = 15 - - Word16 hrtf_count_inverted, used_hrtf_count, freq_idx, hrtf_idx, out_bin_idx, ch_index, is_ambisonics; - Word32 relative_pos, weight_1st, base_idx; - Word32 avg_pwr_left[2]; - Word32 avg_pwr_right[2]; - Word32 IA_coherence[2]; - - test(); - test(); - IF( EQ_16( input_audio_config, IVAS_AUDIO_CONFIG_FOA ) || EQ_16( input_audio_config, IVAS_AUDIO_CONFIG_HOA2 ) || EQ_16( input_audio_config, IVAS_AUDIO_CONFIG_HOA3 ) ) - { - is_ambisonics = 1; - move16(); - used_hrtf_count = 4; /* Using only 1st order HRTFs */ - move16(); - } - ELSE - { - is_ambisonics = 0; - move16(); - used_hrtf_count = hrtf_count; - move16(); - } - - /* Interpolation (linear to a new grid) */ - base_idx = 0; - move32(); - relative_pos = 0; - move32(); - hrtf_count_inverted = divide1616( ONE_IN_Q11, shl( used_hrtf_count, 11 ) ); // q = 15 - - /* Loop over output frequency bins */ - FOR( out_bin_idx = 0; out_bin_idx < out_freq_count; out_bin_idx++ ) - { - /* Computing normalized frequency for the current bin (1.0 corresponds to sampling rate) */ - - const Word32 norm_freq = L_mult( out_freq_step, shl( out_bin_idx, 5 ) ); // q = 21 - - /* Computing the bin index in the source data */ - Word16 div_q = 0; - move16(); - // Word32 tbl_index = BASOP_Util_Divide3232_Scale(L_sub(norm_freq , L_shl(inp_freq_offset, 6)), L_shl(inp_freq_step, 6), &div_q);//q =15 - div_q - Word32 tbl_index = Mpy_32_32( L_sub( norm_freq, L_shl( inp_freq_offset, 6 ) ), L_shl( in_freq_count, 22 ) ); // q = 11 - IF( div_q < 0 ) - { - tbl_index = L_shl( tbl_index, div_q ); - div_q = 0; - move16(); - } - IF( tbl_index <= 0 ) /* In case of extrapolation (below 1st bin), choose nearest */ - { - base_idx = 0; - move32(); - relative_pos = 0; - move32(); - } - ELSE - { - base_idx = ( tbl_index ); // q = 21 - move32(); - relative_pos = L_shl( L_sub( tbl_index, L_shl( L_shr( base_idx, 11 ), 11 ) ), 20 ); // q = 31 - base_idx = L_shr( base_idx, 11 ); - IF( GT_32( base_idx, L_sub( in_freq_count, 2 ) ) ) /* In case of extrapolation (above last bin), choose nearest */ - { - base_idx = L_sub( in_freq_count, 2 ); - relative_pos = ONE_IN_Q31; // Q31 - move32(); - } - } - - /* Computing 2 bins data for later interpolation */ - - /* Zeroing before accumalation for average value computing */ - avg_pwr_left[0] = 0; - move32(); - avg_pwr_left[1] = 0; - move32(); - avg_pwr_right[0] = 0; - move32(); - avg_pwr_right[1] = 0; - move32(); - IA_coherence[0] = 0; - move32(); - IA_coherence[1] = 0; - move32(); - - /* Get power spectra and cross - correlation between left and right hrtfs */ - /* Loop over all the HRTFs available */ - FOR( hrtf_idx = 0; hrtf_idx < used_hrtf_count; hrtf_idx++ ) - { - /* Pointers to current HRTF data */ - Word32 *current_base_L_ptr_re, *current_base_L_ptr_im, *current_base_R_ptr_re, *current_base_R_ptr_im; - - /* combined HRTF data used for FOA */ - Word32 combined_channels_L_re[2]; - Word32 combined_channels_L_im[2]; - Word32 combined_channels_R_re[2]; - Word32 combined_channels_R_im[2]; - - /* Process the frequency bins containing both real and img parts */ - /* In case of 5.1 or 7.1 formats, use the available HRTF paires directly*/ - IF( !is_ambisonics ) - { - current_base_L_ptr_re = ( ppHrtf_set_L_re[hrtf_idx] + base_idx ); // Q29 - current_base_R_ptr_re = ( ppHrtf_set_R_re[hrtf_idx] + base_idx ); // Q29 - current_base_L_ptr_im = ( ppHrtf_set_L_im[hrtf_idx] + base_idx ); // Q29 - current_base_R_ptr_im = ( ppHrtf_set_R_im[hrtf_idx] + base_idx ); // Q29 - } - - /* In case of FOA format, combine the W channel with the X/Y channels */ - ELSE - { - FOR( freq_idx = 0; freq_idx < 2; freq_idx++ ) - { - combined_channels_L_re[freq_idx] = 0; - move32(); - combined_channels_R_re[freq_idx] = 0; - move32(); - combined_channels_L_im[freq_idx] = 0; - move32(); - combined_channels_R_im[freq_idx] = 0; - move32(); - - FOR( ch_index = 0; ch_index < 3; ch_index++ ) - { - combined_channels_L_re[freq_idx] = L_add( combined_channels_L_re[freq_idx], Mpy_32_16_1( ppHrtf_set_L_re[ch_index][base_idx + freq_idx], foa_sum_coeffs[hrtf_idx][ch_index] ) ); // Q29 + Q15 - 15 - move32(); - combined_channels_R_re[freq_idx] = L_add( combined_channels_R_re[freq_idx], Mpy_32_16_1( ppHrtf_set_R_re[ch_index][base_idx + freq_idx], foa_sum_coeffs[hrtf_idx][ch_index] ) ); // Q29 + Q15 - 15 - move32(); - combined_channels_L_im[freq_idx] = L_add( combined_channels_L_im[freq_idx], Mpy_32_16_1( ppHrtf_set_L_im[ch_index][base_idx + freq_idx], foa_sum_coeffs[hrtf_idx][ch_index] ) ); // Q29 + Q15 - 15 - move32(); - combined_channels_R_im[freq_idx] = L_add( combined_channels_R_im[freq_idx], Mpy_32_16_1( ppHrtf_set_R_im[ch_index][base_idx + freq_idx], foa_sum_coeffs[hrtf_idx][ch_index] ) ); // Q29 + Q15 - 15 - move32(); - } - } - - current_base_L_ptr_re = &combined_channels_L_re[0]; // Q29 - current_base_R_ptr_re = &combined_channels_R_re[0]; // Q29 - current_base_L_ptr_im = &combined_channels_L_im[0]; // Q29 - current_base_R_ptr_im = &combined_channels_R_im[0]; // Q29 - } - - FOR( freq_idx = 0; freq_idx < 2; freq_idx++ ) - { - Word32 L_re, L_im, R_re, R_im, C_re; - - L_re = current_base_L_ptr_re[freq_idx]; // Q29 - R_re = current_base_R_ptr_re[freq_idx]; // Q29 - L_im = current_base_L_ptr_im[freq_idx]; // Q29 - R_im = current_base_R_ptr_im[freq_idx]; // Q29 - move32(); - move32(); - move32(); - move32(); - avg_pwr_left[freq_idx] = L_add( L_shr( L_add( Mpy_32_32( L_re, L_re ), Mpy_32_32( L_im, L_im ) ), 4 ), avg_pwr_left[freq_idx] ); // q = 23 - move32(); - avg_pwr_right[freq_idx] = L_add( L_shr( L_add( Mpy_32_32( R_re, R_re ), Mpy_32_32( R_im, R_im ) ), 4 ), avg_pwr_right[freq_idx] ); // q = 23 - move32(); - /* Cross product (Re part) */ - C_re = L_add( Mpy_32_32( L_re, R_re ), Mpy_32_32( L_im, R_im ) ); // q = 27 - - IA_coherence[freq_idx] = L_add( C_re, IA_coherence[freq_idx] ); // q = 27 - move32(); - } - } - - /* Compute the averages and the IA coherence */ - FOR( freq_idx = 0; freq_idx < 2; freq_idx++ ) - { - Word16 sqrt_exp = 0; - move16(); - Word32 var1; - avg_pwr_left[freq_idx] = Mpy_32_16_1( avg_pwr_left[freq_idx], hrtf_count_inverted ); // q = 23 - move32(); - avg_pwr_right[freq_idx] = Mpy_32_16_1( avg_pwr_right[freq_idx], hrtf_count_inverted ); // q = 23 - move32(); - IF( EQ_32( avg_pwr_left[freq_idx], avg_pwr_right[freq_idx] ) ) - { - var1 = avg_pwr_left[freq_idx]; - move32(); - sqrt_exp = 4; - move16(); - } - ELSE - { - var1 = Sqrt32( Mpy_32_32( avg_pwr_left[freq_idx], avg_pwr_right[freq_idx] ), &sqrt_exp ); - move32(); - } - Word16 temp; - IA_coherence[freq_idx] = BASOP_Util_Divide3232_Scale( Mpy_32_16_1( IA_coherence[freq_idx], hrtf_count_inverted ), L_shl( var1, sqrt_exp ), &temp ); // q =15 - move32(); - IA_coherence[freq_idx] = L_shl( IA_coherence[freq_idx], sub( 27, sub( 15, temp ) ) ); // q = 27 - move32(); - /* Limiting to (0...1) range in case of small numerical errors or negative values */ - IA_coherence[freq_idx] = L_min( IA_coherence[freq_idx], ONE_IN_Q27 ); // Q27 - move32(); - IA_coherence[freq_idx] = L_max( IA_coherence[freq_idx], 0 ); // Q27 - move32(); - } - - /* Computing weighted average of 2 nearest values (1 below + 1 above) for linear interpolation */ - weight_1st = L_sub( ONE_IN_Q31, relative_pos ); // q = 31 - - pOut_avg_pwr_L[out_bin_idx] = L_add( Mpy_32_32( weight_1st, avg_pwr_left[0] ), Mpy_32_32( relative_pos, avg_pwr_left[1] ) ); // q = 23 - move32(); - pOut_avg_pwr_R[out_bin_idx] = L_add( Mpy_32_32( weight_1st, avg_pwr_right[0] ), Mpy_32_32( relative_pos, avg_pwr_right[1] ) ); // q = 23 - move32(); - out_i_a_coherence[out_bin_idx] = L_add( Mpy_32_32( weight_1st, IA_coherence[0] ), Mpy_32_32( relative_pos, IA_coherence[1] ) ); // q = 27 - move32(); - } - - return; -} -#endif diff --git a/lib_rend/ivas_reverb_fx.c b/lib_rend/ivas_reverb_fx.c index e886bfeab..b6a634bb7 100644 --- a/lib_rend/ivas_reverb_fx.c +++ b/lib_rend/ivas_reverb_fx.c @@ -1272,32 +1272,14 @@ static void set_fft_and_datablock_sizes_fx( static void set_reverb_acoustic_data_fx( ivas_reverb_params_t *pParams, -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES -#else - const AUDIO_CONFIG input_audio_config, - const HRTFS_HANDLE hHrtf, -#endif IVAS_ROOM_ACOUSTICS_CONFIG_DATA *pRoomAcoustics, -#ifndef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES - const Word16 subframe_len, -#endif const Word16 nr_fc_input, const Word16 nr_fc_fft_filter ) { -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES int16_t bin_idx; -#else - Word16 nr_out_ch, hrtf_idx, offset, iter_idx, bin_idx; -#endif Word32 ln_1e6_inverted_fx, delay_diff_fx, L_tmp; Word16 exp_argument_fx, tmp, tmp_flag, exp_argument_e; Word16 pow_exp; -#ifndef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES - Word32 *pHrtf_set_l_re_fx[MAX_INTERN_CHANNELS]; - Word32 *pHrtf_set_l_im_fx[MAX_INTERN_CHANNELS]; - Word32 *pHrtf_set_r_re_fx[MAX_INTERN_CHANNELS]; - Word32 *pHrtf_set_r_im_fx[MAX_INTERN_CHANNELS]; -#endif Word32 *pFc_input_fx = pRoomAcoustics->pFc_input_fx; Word32 *pAcoustic_rt60_fx = pRoomAcoustics->pAcoustic_rt60_fx; @@ -1309,48 +1291,6 @@ static void set_reverb_acoustic_data_fx( Word32 *pDsr_fx = pParams->pDsr_fx; Word16 *pDsr_e = pParams->pDsr_e; -#ifndef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES - /* use crend hrtf filters */ - IF( hHrtf != NULL ) - { - /* Compute HRTF set properties: average left/right energies, IA coherence */ - /* First, find the offset of the frequency-domain data for the 1st frame and assign HRTF pointers */ - FOR( nr_out_ch = 0; nr_out_ch < BINAURAL_CHANNELS; nr_out_ch++ ) - { - FOR( hrtf_idx = 0; hrtf_idx < hHrtf->max_num_ir; hrtf_idx++ ) - { - offset = 0; - move16(); - FOR( iter_idx = 0; iter_idx < hHrtf->num_iterations[hrtf_idx][nr_out_ch] - 1; iter_idx++ ) - { - offset = add( offset, hHrtf->pIndex_frequency_max[hrtf_idx][nr_out_ch][iter_idx] ); - } - - IF( EQ_16( nr_out_ch, 0 ) ) - { - pHrtf_set_l_re_fx[hrtf_idx] = &hHrtf->pOut_to_bin_re_fx[hrtf_idx][0][offset]; - pHrtf_set_l_im_fx[hrtf_idx] = &hHrtf->pOut_to_bin_im_fx[hrtf_idx][0][offset]; - } - ELSE - { - pHrtf_set_r_re_fx[hrtf_idx] = &hHrtf->pOut_to_bin_re_fx[hrtf_idx][1][offset]; - pHrtf_set_r_im_fx[hrtf_idx] = &hHrtf->pOut_to_bin_im_fx[hrtf_idx][1][offset]; - } - } - } - - /* Compute HRTF set properties using frequency-domain HRTF data */ - Word32 *pHrtf_avg_pwr_response_l_fx = pParams->pHrtf_avg_pwr_response_l_fx; - Word32 *pHrtf_avg_pwr_response_r_fx = pParams->pHrtf_avg_pwr_response_r_fx; - Word32 *pHrtf_inter_aural_coherence_fx = pParams->pHrtf_inter_aural_coherence_fx; - ivas_reverb_get_hrtf_set_properties_fx( pHrtf_set_l_re_fx, pHrtf_set_l_im_fx, pHrtf_set_r_re_fx, pHrtf_set_r_im_fx, input_audio_config, hHrtf->max_num_ir, subframe_len, - nr_fc_fft_filter, pHrtf_avg_pwr_response_l_fx, pHrtf_avg_pwr_response_r_fx, pHrtf_inter_aural_coherence_fx ); - - pParams->pHrtf_avg_pwr_response_l_const_fx = (const Word32 *) pParams->pHrtf_avg_pwr_response_l_fx; - pParams->pHrtf_avg_pwr_response_r_const_fx = (const Word32 *) pParams->pHrtf_avg_pwr_response_r_fx; - pParams->pHrtf_inter_aural_coherence_const_fx = (const Word32 *) pParams->pHrtf_inter_aural_coherence_fx; - } -#endif /* interpolate input table data for T60 and DSR to the FFT filter grid */ ivas_reverb_interpolate_acoustic_data_fx( nr_fc_input, pFc_input_fx, pAcoustic_rt60_fx, pAcoustic_dsr_fx, nr_fc_fft_filter, pFc_fx, pRt60_fx, pDsr_fx, pRt60_e, pDsr_e ); @@ -1482,13 +1422,7 @@ static ivas_error setup_FDN_branches_fx( ivas_error ivas_reverb_open_fx( REVERB_HANDLE *hReverb, /* i/o: Reverberator handle */ -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES const HRTFS_STATISTICS_HANDLE hHrtfStatistics, /* i : HRTF statistics handle */ -#else - const AUDIO_CONFIG input_audio_config, /* i : reverb. input audio configuration */ - const HRTFS_HANDLE hHrtf, /* i : HRTF handle */ - const Word32 *lr_energy_and_iac_fx[], /* i : precomuputed lr energies and iac */ -#endif RENDER_CONFIG_HANDLE hRenderConfig, /* i : Renderer configuration handle */ const int32_t output_Fs ) { @@ -1565,7 +1499,6 @@ ivas_error ivas_reverb_open_fx( test(); -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES /* set up reverb acoustic data on the basis of HRTF data and renderer config */ Scale_sig32( params.pFc_fx, nr_fc_fft_filter, 2 ); Word16 *pRt60_e = (Word16 *) malloc( sizeof( Word16 ) * nr_fc_fft_filter ); @@ -1588,31 +1521,6 @@ ivas_error ivas_reverb_open_fx( params.pHrtf_avg_pwr_response_r_const_fx = hHrtfStatistics->average_energy_r; params.pHrtf_inter_aural_coherence_const_fx = hHrtfStatistics->inter_aural_coherence; -#else - IF( hHrtf == NULL && lr_energy_and_iac_fx != NULL ) - { - params.pHrtf_avg_pwr_response_l_const_fx = lr_energy_and_iac_fx[0]; - params.pHrtf_avg_pwr_response_r_const_fx = lr_energy_and_iac_fx[1]; - params.pHrtf_inter_aural_coherence_const_fx = lr_energy_and_iac_fx[2]; - } - /* set up reverb acoustic data on the basis of HRTF data and renderer config */ - Scale_sig32( params.pFc_fx, nr_fc_fft_filter, 2 ); - Word16 *pRt60_e = (Word16 *) malloc( sizeof( Word16 ) * nr_fc_fft_filter ); - Word16 *pDsr_e = (Word16 *) malloc( sizeof( Word16 ) * nr_fc_fft_filter ); - - params.pRt60_e = pRt60_e; - params.pDsr_e = pDsr_e; - - set_reverb_acoustic_data_fx( ¶ms, input_audio_config, hHrtf, &hRenderConfig->roomAcoustics, subframe_len, nr_fc_input, nr_fc_fft_filter ); - Scale_sig32( params.pFc_fx, nr_fc_fft_filter, -2 ); - FOR( i = 0; i < nr_fc_fft_filter; i++ ) - { - params.pRt60_fx[i] = L_abs( params.pRt60_fx[i] ); - move32(); - params.pDsr_fx[i] = L_abs( params.pDsr_fx[i] ); - move32(); - } -#endif /* set reverb acoustic configuration based on renderer config */ pState->pConfig.roomAcoustics.override = hRenderConfig->roomAcoustics.override; @@ -1776,10 +1684,6 @@ ivas_error ivas_reverb_open_fx( { return error; } -#ifndef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES - free( pDsr_e ); - free( pRt60_e ); -#endif *hReverb = pState; return error; @@ -2507,7 +2411,6 @@ static ivas_error ivas_binaural_reverb_open_fx( return IVAS_ERR_OK; } -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES /*------------------------------------------------------------------------- * ivas_binaural_reverb_init() * @@ -2566,117 +2469,6 @@ ivas_error ivas_binaural_reverb_init( return error; } -#else - -/*------------------------------------------------------------------------- - * ivas_binaural_reverb_open_fastconv() - * - * Allocate and initialize binaural room reverberator handle for FastConv - *------------------------------------------------------------------------*/ -ivas_error ivas_binaural_reverb_open_fastconv_fx( - REVERB_STRUCT_HANDLE *hReverbPr, /* i/o: binaural reverb handle */ - const Word16 numBins, /* i : number of CLDFB bins */ - const Word16 numCldfbSlotsPerFrame, /* i : number of CLDFB slots per frame */ - IVAS_ROOM_ACOUSTICS_CONFIG_DATA *roomAcoustics, /* i/o: room acoustics parameters */ - const AUDIO_CONFIG internal_config, /* i : internal audio config for FastConv */ - const Word32 sampling_rate, /* i : sampling rate */ - const HRTFS_FASTCONV_HANDLE hHrtfFastConv /* i : FastConv HRTF handle */ -) -{ - ivas_error error; - const Word32 *revTimes; - const Word32 *revEne; - Word32 t60[CLDFB_NO_CHANNELS_MAX]; - Word32 ene[CLDFB_NO_CHANNELS_MAX]; - Word16 preDelay; - - error = IVAS_ERR_OK; - - IF( ( roomAcoustics != NULL ) && roomAcoustics->override ) - { - /* THIS PART IS YET TO BE CONVERTED AS REVERB_UTILS.C IS NOT INVOKED IN GPROF */ - float t60_flt[CLDFB_NO_CHANNELS_MAX]; - float ene_flt[CLDFB_NO_CHANNELS_MAX]; - - revTimes = t60; - revEne = ene; - - IF( NE_32( ( error = ivas_reverb_prepare_cldfb_params( roomAcoustics, hHrtfFastConv, internal_config, false, sampling_rate, t60_flt, ene_flt ) ), IVAS_ERR_OK ) ) - { - return error; - } - - preDelay = (Word16) roundf( 48000.0f * roomAcoustics->acousticPreDelay / CLDFB_NO_CHANNELS_MAX ); - floatToFixed_arrL( t60_flt, t60, Q31, CLDFB_NO_CHANNELS_MAX ); - floatToFixed_arrL( ene_flt, ene, Q31, CLDFB_NO_CHANNELS_MAX ); - } - ELSE - { -#ifdef FIX_1741_REVERB_TIMES_Q_FORMAT - revTimes = hHrtfFastConv->fastconvReverberationTimes_fx; /*Q26*/ -#else - revTimes = hHrtfFastConv->fastconvReverberationTimes_fx; /*Q31*/ -#endif - revEne = hHrtfFastConv->fastconvReverberationEneCorrections_fx; /*Q31*/ - preDelay = 10; - move16(); - } - - error = ivas_binaural_reverb_open_fx( hReverbPr, numBins, numCldfbSlotsPerFrame, sampling_rate, revTimes, revEne, preDelay ); - - return error; -} - - -/*------------------------------------------------------------------------- - * ivas_binaural_reverb_open_parambin() - * - * Allocate and initialize binaural room reverberator handle for ParamBin - *------------------------------------------------------------------------*/ - -ivas_error ivas_binaural_reverb_open_parambin( - REVERB_STRUCT_HANDLE *hReverbPr, /* i/o: binaural reverb handle */ - const Word16 numBins, /* i : number of CLDFB bins Q0 */ - const Word16 numCldfbSlotsPerFrame, /* i : number of CLDFB slots per frame Q0 */ - IVAS_ROOM_ACOUSTICS_CONFIG_DATA *roomAcoustics, /* i/o: room acoustics parameters */ - const Word32 sampling_rate, /* i : sampling rate Q0 */ - const HRTFS_PARAMBIN_HANDLE hHrtfParambin /* i : Parametric binauralizer HRTF handle */ -) -{ - ivas_error error; - const Word32 *revTimes; - const Word32 *revEne; - Word32 t60[CLDFB_NO_CHANNELS_MAX]; - Word32 ene[CLDFB_NO_CHANNELS_MAX]; - Word16 preDelay; - - error = IVAS_ERR_OK; - - IF( ( roomAcoustics != NULL ) && roomAcoustics->override ) - { - revTimes = t60; - revEne = ene; - preDelay = (Word16) L_shr_r( Mpy_32_32( 1677721600 /*800 in Q21*/, roomAcoustics->acousticPreDelay_fx /*Q27*/ ), Q17 ); /*Q0*/ - move16(); - } - ELSE - { -#ifdef FIX_1741_REVERB_TIMES_Q_FORMAT - revTimes = hHrtfParambin->parametricReverberationTimes_fx; /*Q26*/ -#else - revTimes = hHrtfParambin->parametricReverberationTimes_fx; /*Q31*/ -#endif - revEne = hHrtfParambin->parametricReverberationEneCorrections_fx; /*Q31*/ - preDelay = 10; - move16(); - } - - error = ivas_binaural_reverb_open_fx( hReverbPr, numBins, numCldfbSlotsPerFrame, sampling_rate, revTimes, revEne, preDelay ); - - return error; -} - -#endif /*------------------------------------------------------------------------- * ivas_binaural_reverb_close() * diff --git a/lib_rend/ivas_reverb_utils_fx.c b/lib_rend/ivas_reverb_utils_fx.c index e63e6017a..84fa82bce 100644 --- a/lib_rend/ivas_reverb_utils_fx.c +++ b/lib_rend/ivas_reverb_utils_fx.c @@ -64,11 +64,7 @@ typedef struct cldfb_convolver_state float filter_states_im[BINAURAL_CONVBANDS][CLDFB_CONVOLVER_NTAPS_MAX]; } cldfb_convolver_state; -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES static void ivas_reverb_set_energies( const Word32 *avg_pwr_l, const Word32 *avg_pwr_r, const int32_t sampling_rate, float *avg_pwr_l_out, float *avg_pwr_r_out ); -#else -static ivas_error ivas_reverb_get_fastconv_hrtf_set_energies( const HRTFS_FASTCONV_HANDLE hHrtfFastConv, const AUDIO_CONFIG input_audio_config, const int16_t use_brir, const int32_t sampling_rate, float *avg_pwr_left, float *avg_pwr_right ); -#endif /*-----------------------------------------------------------------------------------------* * Function ivas_reverb_prepare_cldfb_params() @@ -77,23 +73,12 @@ static ivas_error ivas_reverb_get_fastconv_hrtf_set_energies( const HRTFS_FASTCO *-----------------------------------------------------------------------------------------*/ -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES ivas_error ivas_reverb_prepare_cldfb_params( const IVAS_ROOM_ACOUSTICS_CONFIG_DATA *pInput_params, const HRTFS_STATISTICS_HANDLE hHrtfStatistics, const int32_t output_Fs, float *pOutput_t60, float *pOutput_ene ) -#else -ivas_error ivas_reverb_prepare_cldfb_params( - IVAS_ROOM_ACOUSTICS_CONFIG_DATA *pInput_params, - const HRTFS_FASTCONV_HANDLE hHrtfFastConv, - const AUDIO_CONFIG input_audio_config, - const int16_t use_brir, - const int32_t output_Fs, - float *pOutput_t60, - float *pOutput_ene ) -#endif { int16_t idx; float avg_pwr_left[CLDFB_NO_CHANNELS_MAX]; @@ -101,9 +86,6 @@ ivas_error ivas_reverb_prepare_cldfb_params( float delay_diff, ln_1e6_inverted, exp_argument; const float dist = DEFAULT_SRC_DIST; const float dmx_gain_2 = 4.0f * EVS_PI * dist * dist / 0.001f; -#ifndef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES - ivas_error error; -#endif Word32 output_fc_fx[CLDFB_NO_CHANNELS_MAX]; Word32 output_t60_fx[CLDFB_NO_CHANNELS_MAX]; Word16 output_t60_e[CLDFB_NO_CHANNELS_MAX]; @@ -138,14 +120,7 @@ ivas_error ivas_reverb_prepare_cldfb_params( exp_argument = max( exp_argument, -23.0f ); pOutput_ene[idx] *= expf( exp_argument ); } -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES ivas_reverb_set_energies( hHrtfStatistics->average_energy_l, hHrtfStatistics->average_energy_r, output_Fs, avg_pwr_left, avg_pwr_right ); -#else - if ( ( error = ivas_reverb_get_fastconv_hrtf_set_energies( hHrtfFastConv, input_audio_config, use_brir, output_Fs, avg_pwr_left, avg_pwr_right ) ) != IVAS_ERR_OK ) - { - return error; - } -#endif for ( idx = 0; idx < CLDFB_NO_CHANNELS_MAX; idx++ ) { @@ -155,122 +130,7 @@ ivas_error ivas_reverb_prepare_cldfb_params( return IVAS_ERR_OK; } -#ifndef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES -/*-----------------------------------------------------------------------------------------* - * Function ivas_cldfb_convolver() - * - * Function for convolving CLDFB-domain data with filter taps - *-----------------------------------------------------------------------------------------*/ - - -/*-----------------------------------------------------------------------------------------* - * Function get_IR_from_filter_taps() - * - * Function converts CLDFB filter taps into time-domain data - *-----------------------------------------------------------------------------------------*/ - -/*-----------------------------------------------------------------------------------------* - * Function ivas_reverb_get_cldfb_hrtf_set_properties() - * - * Function analyses the HRTF set and computes avarage left/right power spectrum - * and frequency-dependent IA coherence. - * Uses fastconv renderer filter taps to compute energies - *-----------------------------------------------------------------------------------------*/ - -static ivas_error ivas_reverb_get_cldfb_hrtf_set_properties( - AUDIO_CONFIG input_audio_config, - const HRTFS_FASTCONV_HANDLE hHrtfFastConv, - const int16_t use_brir, - const int32_t sampling_rate, - float *avg_pwr_left, - float *avg_pwr_right ) -{ - float current_HRTF_data_L[L_FRAME48k]; - float current_HRTF_data_R[L_FRAME48k]; - int16_t freq_idx, hrtf_idx, hrtf_count; - float hrtf_count_inverted; - int16_t fft_size, log2_fft_size, half_fft_size, freq_count; - ivas_error error; - UNUSED_PARAM( error ); - fft_size = RV_FILTER_MAX_FFT_SIZE; - Word16 IR_length; - IR_length = CLDFB_NO_CHANNELS_MAX * ( ( fft_size + CLDFB_NO_CHANNELS_MAX - 1 ) / CLDFB_NO_CHANNELS_MAX ); - log2_fft_size = int_log2( fft_size ); - half_fft_size = fft_size >> 1; - freq_count = 1 + half_fft_size; - - /* chosing between ambisonics, 5.1 and 7.1 MC audio */ - if ( ( input_audio_config == IVAS_AUDIO_CONFIG_FOA ) || ( input_audio_config == IVAS_AUDIO_CONFIG_HOA2 ) || ( input_audio_config == IVAS_AUDIO_CONFIG_HOA3 ) ) - { - hrtf_count = 1; - } - else if ( input_audio_config == IVAS_AUDIO_CONFIG_7_1 ) - { - hrtf_count = 7; - } - else - { - hrtf_count = 5; - input_audio_config = IVAS_AUDIO_CONFIG_5_1; - } - - /* Zeroing before accumalation for average value computing */ - for ( freq_idx = 0; freq_idx < freq_count; freq_idx++ ) - { - avg_pwr_left[freq_idx] = 0.0f; - avg_pwr_right[freq_idx] = 0.0f; - } - - /* Get power spectra and cross - correlation between left and right hrtfs - Loop over all the HRTFs available */ - for ( hrtf_idx = 0; hrtf_idx < hrtf_count; hrtf_idx++ ) - { - UNUSED_PARAM( hHrtfFastConv ); - UNUSED_PARAM( use_brir ); - UNUSED_PARAM( sampling_rate ); - UNUSED_PARAM( IR_length ); - - /* Perform forward FFT on both L/R channels */ - fft_rel( current_HRTF_data_L, (int16_t) fft_size, (int16_t) log2_fft_size ); - fft_rel( current_HRTF_data_R, (int16_t) fft_size, (int16_t) log2_fft_size ); - - /* Process the DC bin (without img part) */ - avg_pwr_left[0] += current_HRTF_data_L[0] * current_HRTF_data_L[0]; - avg_pwr_right[0] += current_HRTF_data_R[0] * current_HRTF_data_R[0]; - - /* Process the Nyquist frequency bin (without img part) */ - avg_pwr_left[half_fft_size] += current_HRTF_data_L[half_fft_size] * current_HRTF_data_L[half_fft_size]; - avg_pwr_right[half_fft_size] += current_HRTF_data_R[half_fft_size] * current_HRTF_data_R[half_fft_size]; - - /* Process the other frequency bins containing both real and img parts */ - for ( freq_idx = 1; freq_idx < half_fft_size; freq_idx++ ) - { - float L_re, L_im, R_re, R_im; - L_re = current_HRTF_data_L[freq_idx]; - R_re = current_HRTF_data_R[freq_idx]; - L_im = current_HRTF_data_L[fft_size - freq_idx]; - R_im = current_HRTF_data_R[fft_size - freq_idx]; - - avg_pwr_left[freq_idx] += L_re * L_re + L_im * L_im; - avg_pwr_right[freq_idx] += R_re * R_re + R_im * R_im; - } - } - - /* Compute the averages and the IA coherence */ - hrtf_count_inverted = 1.0f / (float) hrtf_count; - for ( freq_idx = 0; freq_idx < freq_count; freq_idx++ ) - { - avg_pwr_left[freq_idx] *= hrtf_count_inverted; - avg_pwr_right[freq_idx] *= hrtf_count_inverted; - } - - return IVAS_ERR_OK; -} - -#endif - -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES /*-----------------------------------------------------------------------------------------* * Function ivas_reverb_set_energies() * @@ -281,29 +141,11 @@ static ivas_error ivas_reverb_get_cldfb_hrtf_set_properties( static void ivas_reverb_set_energies( const Word32 *avg_pwr_l, const Word32 *avg_pwr_r, -#else -/*-----------------------------------------------------------------------------------------* - * Function ivas_reverb_get_fastconv_hrtf_set_energies() - * - * Function analyses the HRTF set and computes avarage left/right power spectrum. - * Uses fastconv renderer filter taps to compute energies. Output interpolated - * to CLDFB bin center frequencies - *-----------------------------------------------------------------------------------------*/ - -static ivas_error ivas_reverb_get_fastconv_hrtf_set_energies( - const HRTFS_FASTCONV_HANDLE hHrtfFastConv, - const AUDIO_CONFIG input_audio_config, - const int16_t use_brir, -#endif const int32_t sampling_rate, float *avg_pwr_left, float *avg_pwr_right ) { int16_t freq_idx; -#ifndef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES - float avg_pwr_left_fft[FFT_SPECTRUM_SIZE]; - float avg_pwr_right_fft[FFT_SPECTRUM_SIZE]; -#endif float input_fc[FFT_SPECTRUM_SIZE]; #ifdef FIX_1741_REVERB_TIMES_Q_FORMAT Word32 input_fc_fx[FFT_SPECTRUM_SIZE]; @@ -315,11 +157,7 @@ static ivas_error ivas_reverb_get_fastconv_hrtf_set_energies( const Word16 cldfb_freq_halfstep = MAX_SAMPLING_RATE / ( 4 * CLDFB_NO_CHANNELS_MAX ); #endif -#ifndef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES - ivas_error error; -#endif -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES const int16_t avg_pwr_len = sampling_rate == 16000 ? LR_IAC_LENGTH_NR_FC_16KHZ : LR_IAC_LENGTH_NR_FC; for ( freq_idx = 0; freq_idx < avg_pwr_len; freq_idx++ ) @@ -336,14 +174,7 @@ static ivas_error ivas_reverb_get_fastconv_hrtf_set_energies( output_fc_fx[freq_idx] = ( ( freq_idx << 1 ) + 1 ) * cldfb_freq_halfstep * ONE_IN_Q16; } #endif -#else - for ( freq_idx = 0; freq_idx < FFT_SPECTRUM_SIZE; freq_idx++ ) - { - input_fc[freq_idx] = freq_idx * ( 0.5f * sampling_rate / (float) ( FFT_SPECTRUM_SIZE - 1 ) ); - } -#endif -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES #ifndef FIX_1741_REVERB_TIMES_Q_FORMAT Word32 *input_fc_fx = (Word32 *) malloc( 60 * sizeof( Word32 ) ); @@ -390,49 +221,4 @@ static ivas_error ivas_reverb_get_fastconv_hrtf_set_energies( free( avg_pwr_right_fx ); #endif -#else - if ( ( error = ivas_reverb_get_cldfb_hrtf_set_properties( input_audio_config, hHrtfFastConv, use_brir, sampling_rate, avg_pwr_left_fft, avg_pwr_right_fft ) ) != IVAS_ERR_OK ) - { - return error; - } - Word32 *input_fc_fx = (Word32 *) malloc( 60 * sizeof( Word32 * ) ); - Word32 *avg_pwr_left_fft_fx = (Word32 *) malloc( 60 * sizeof( Word32 * ) ); - Word32 *avg_pwr_right_fft_fx = (Word32 *) malloc( 60 * sizeof( Word32 * ) ); - - Word32 *output_fc_fx = (Word32 *) malloc( 257 * sizeof( Word32 * ) ); - Word32 *avg_pwr_left_fx = (Word32 *) malloc( 257 * sizeof( Word32 * ) ); - Word16 *avg_pwr_left_e = (Word16 *) malloc( 257 * sizeof( Word16 * ) ); - Word32 *avg_pwr_right_fx = (Word32 *) malloc( 257 * sizeof( Word32 * ) ); - Word16 *avg_pwr_right_e = (Word16 *) malloc( 257 * sizeof( Word16 * ) ); - - for ( int i = 0; i < 60; i++ ) - { - input_fc_fx[i] = (Word32) input_fc[i] * ( 1 << 16 ); - avg_pwr_left_fft_fx[i] = (Word32) ( avg_pwr_left_fft[i] ) * ONE_IN_Q26; - avg_pwr_right_fft_fx[i] = (Word32) avg_pwr_right_fft[i] * ONE_IN_Q30; - } - - for ( int i = 0; i < 257; i++ ) - { - output_fc_fx[i] = (Word32) input_fc[i] * ONE_IN_Q16; - } - - ivas_reverb_interpolate_acoustic_data_fx( FFT_SPECTRUM_SIZE, input_fc_fx, avg_pwr_left_fft_fx, avg_pwr_right_fft_fx, - CLDFB_NO_CHANNELS_MAX, output_fc_fx, avg_pwr_left_fx, avg_pwr_right_fx, avg_pwr_left_e, avg_pwr_right_e ); - for ( int i = 0; i < 257; i++ ) - { - avg_pwr_left[i] = (float) fabs( me2f( avg_pwr_left_fx[i], avg_pwr_left_e[i] ) ); - avg_pwr_right[i] = (float) fabs( me2f( avg_pwr_right_fx[i], avg_pwr_right_e[i] ) ); - } - - free( input_fc_fx ); - free( avg_pwr_left_fft_fx ); - free( avg_pwr_right_fft_fx ); - free( output_fc_fx ); - free( avg_pwr_left_fx ); - free( avg_pwr_left_e ); - free( avg_pwr_right_fx ); - free( avg_pwr_right_e ); - return IVAS_ERR_OK; -#endif } diff --git a/lib_rend/ivas_stat_rend.h b/lib_rend/ivas_stat_rend.h index 50e3d7f6c..747af4048 100644 --- a/lib_rend/ivas_stat_rend.h +++ b/lib_rend/ivas_stat_rend.h @@ -1206,11 +1206,6 @@ typedef struct TDREND_HRFILT_FiltSet_struct ModelParamsITD_t ModelParamsITD; TDREND_HRFILT_Method_t FilterMethod; /* HR filtering method */ Word32 latency_s_fx; /* Q31 */ -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES -#else - const Word32 *lr_energy_and_iac_fx[3]; /* left/right energy and interaural coherence for late reverb */ - Word32 *lr_energy_and_iac_dyn_fx[3]; -#endif } TDREND_HRFILT_FiltSet_t; /* Distance attenuation */ @@ -1478,7 +1473,6 @@ typedef struct ivas_hrtfs_parambin_struct #endif -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES typedef struct ivas_hrtfs_statistics_struct { const Word32 *average_energy_l; @@ -1489,7 +1483,6 @@ typedef struct ivas_hrtfs_statistics_struct Word32 *inter_aural_coherence_dyn; int16_t fromROM; /* Flag that indicates that the pointers point to tables in ROM (controls init/dealloc).*/ } HRTFS_STATISTICS, *HRTFS_STATISTICS_HANDLE; -#endif /*----------------------------------------------------------------------------------* diff --git a/lib_rend/lib_rend.h b/lib_rend/lib_rend.h index 1300d6340..41fbff92d 100644 --- a/lib_rend/lib_rend.h +++ b/lib_rend/lib_rend.h @@ -209,12 +209,10 @@ ivas_error IVAS_REND_GetHrtfParamBinHandle( IVAS_DEC_HRTF_PARAMBIN_HANDLE **hHrtfParambin /* o : Parametric binauralizer HRTF handle */ ); -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES ivas_error IVAS_REND_GetHrtfStatisticsHandle( IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS renderer handle */ IVAS_DEC_HRTF_STATISTICS_HANDLE **hHrtfStatistics /* o : HRTF statistics handle */ ); -#endif /* Functions to be called during rendering */ diff --git a/lib_rend/lib_rend_fx.c b/lib_rend/lib_rend_fx.c index 97b83b7b6..ee83f69c7 100644 --- a/lib_rend/lib_rend_fx.c +++ b/lib_rend/lib_rend_fx.c @@ -196,9 +196,7 @@ typedef struct hrtf_handles IVAS_DEC_HRTF_FASTCONV_HANDLE hHrtfFastConv; IVAS_DEC_HRTF_PARAMBIN_HANDLE hHrtfParambin; IVAS_DEC_HRTF_HANDLE hHrtfTD; -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES IVAS_DEC_HRTF_STATISTICS_HANDLE hHrtfStatistics; -#endif } hrtf_handles; struct IVAS_REND @@ -234,11 +232,7 @@ struct IVAS_REND /*-------------------------------------------------------------------* * Local function prototypes *-------------------------------------------------------------------*/ -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES static ivas_error initMasaExtRenderer( input_masa *inputMasa, const AUDIO_CONFIG outConfig, const RENDER_CONFIG_DATA *hRendCfg, hrtf_handles *hHrtfs ); -#else -static ivas_error initMasaExtRenderer( input_masa *inputMasa, const AUDIO_CONFIG outConfig, hrtf_handles *hHrtfs ); -#endif static void freeMasaExtRenderer( MASA_EXT_REND_HANDLE *hMasaExtRendOut ); static void intermidiate_ext_dirac_render( @@ -1578,22 +1572,14 @@ static ivas_error setRendInputActiveIsm( IF( EQ_16( outConfig, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) { -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES IF( NE_32( ( error = ivas_reverb_open_fx( &( inputIsm->hReverb ), hrtfs->hHrtfStatistics, hRendCfg, *rendCtx.pOutSampleRate ) ), IVAS_ERR_OK ) ) -#else - IF( NE_32( ( error = ivas_reverb_open_fx( &( inputIsm->hReverb ), outConfig, NULL, inputIsm->tdRendWrapper.hBinRendererTd->HrFiltSet_p->lr_energy_and_iac_fx, hRendCfg, *rendCtx.pOutSampleRate ) ), IVAS_ERR_OK ) ) -#endif { return error; } } ELSE IF( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) { -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES IF( NE_32( ( error = ivas_rend_openCrend( &inputIsm->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, hrtfs->hSetOfHRTF, hrtfs->hHrtfStatistics, *rendCtx.pOutSampleRate, rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses ) ), IVAS_ERR_OK ) ) -#else - IF( NE_32( ( error = ivas_rend_openCrend( &inputIsm->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, hrtfs->hSetOfHRTF, *rendCtx.pOutSampleRate, rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses ) ), IVAS_ERR_OK ) ) -#endif { return error; } @@ -2404,9 +2390,7 @@ static ivas_error initMcBinauralRendering( const AUDIO_CONFIG outConfig, RENDER_CONFIG_DATA *hRendCfg, IVAS_DEC_HRTF_CREND_HANDLE hMixconv, -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES HRTFS_STATISTICS_HANDLE hHrtfStatistics, -#endif uint8_t reconfigureFlag ) { ivas_error error; @@ -2556,11 +2540,7 @@ static ivas_error initMcBinauralRendering( test(); IF( EQ_32( outConfig, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) && inputMc->hReverb == NULL ) { -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES IF( NE_32( ( error = ivas_reverb_open_fx( &( inputMc->hReverb ), hHrtfStatistics, hRendCfg, outSampleRate ) ), IVAS_ERR_OK ) ) -#else - IF( NE_32( ( error = ivas_reverb_open_fx( &( inputMc->hReverb ), outConfig, NULL, inputMc->tdRendWrapper.hBinRendererTd->HrFiltSet_p->lr_energy_and_iac_fx, hRendCfg, outSampleRate ) ), IVAS_ERR_OK ) ) -#endif { return error; } @@ -2569,16 +2549,9 @@ static ivas_error initMcBinauralRendering( ELSE IF( !useTDRend && inputMc->crendWrapper == NULL ) { /* open CREND */ -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES IF( NE_32( ( error = ivas_rend_openCrend( &inputMc->crendWrapper, ( inConfig == IVAS_AUDIO_CONFIG_LS_CUSTOM ) ? IVAS_AUDIO_CONFIG_7_1_4 : inConfig, outConfig, hRendCfg, hMixconv, hHrtfStatistics, outSampleRate, ( ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) || ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) ) ? inputMc->base.ctx.pSplitRendWrapper->multiBinPoseData.num_poses : 1 ) ), IVAS_ERR_OK ) ) -#else - IF( NE_32( ( error = ivas_rend_openCrend( &inputMc->crendWrapper, ( EQ_16( inConfig, IVAS_AUDIO_CONFIG_LS_CUSTOM ) ) ? IVAS_AUDIO_CONFIG_7_1_4 : inConfig, outConfig, hRendCfg, - hMixconv, - outSampleRate, ( ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) || ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) ) ? inputMc->base.ctx.pSplitRendWrapper->multiBinPoseData.num_poses : 1 ) ), - IVAS_ERR_OK ) ) -#endif { return error; } @@ -2784,11 +2757,7 @@ static ivas_error setRendInputActiveMc( IF( EQ_32( getAudioConfigType( outConfig ), IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL ) ) { -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES IF( NE_32( ( error = initMcBinauralRendering( inputMc, inConfig, outConfig, hRendCfg, hrtfs->hSetOfHRTF, hrtfs->hHrtfStatistics, FALSE ) ), IVAS_ERR_OK ) ) -#else - IF( NE_32( ( error = initMcBinauralRendering( inputMc, inConfig, outConfig, hRendCfg, hrtfs->hSetOfHRTF, FALSE ) ), IVAS_ERR_OK ) ) -#endif { return error; } @@ -2944,10 +2913,8 @@ static ivas_error updateSbaPanGains( const AUDIO_CONFIG outConfig, RENDER_CONFIG_DATA *hRendCfg, IVAS_DEC_HRTF_CREND_HANDLE hMixconv -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES , IVAS_DEC_HRTF_STATISTICS_HANDLE hHrtfStatistics -#endif ) { @@ -3007,11 +2974,7 @@ static ivas_error updateSbaPanGains( } else { -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES IF( NE_32( ( error = ivas_rend_openCrend( &inputSba->crendWrapper, inConfig, outConfig, hRendCfg, hMixconv, hHrtfStatistics, *rendCtx.pOutSampleRate, rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses ) ), IVAS_ERR_OK ) ) -#else - IF( NE_32( ( error = ivas_rend_openCrend( &inputSba->crendWrapper, inConfig, outConfig, hRendCfg, hMixconv, *rendCtx.pOutSampleRate, rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses ) ), IVAS_ERR_OK ) ) -#endif { return error; } @@ -3024,11 +2987,7 @@ static ivas_error updateSbaPanGains( { return error; } -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES IF( NE_32( ( error = ivas_rend_openCrend( &inputSba->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, hMixconv, hHrtfStatistics, *rendCtx.pOutSampleRate, rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses ) ), IVAS_ERR_OK ) ) -#else - IF( NE_32( ( error = ivas_rend_openCrend( &inputSba->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, hMixconv, *rendCtx.pOutSampleRate, rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses ) ), IVAS_ERR_OK ) ) -#endif { return error; } @@ -3120,11 +3079,7 @@ static ivas_error setRendInputActiveSba( return error; } } -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES IF( NE_32( ( error = updateSbaPanGains( inputSba, outConfig, hRendCfg, hrtfs->hSetOfHRTF, hrtfs->hHrtfStatistics ) ), IVAS_ERR_OK ) ) -#else - IF( NE_32( ( error = updateSbaPanGains( inputSba, outConfig, hRendCfg, hrtfs->hSetOfHRTF ) ), IVAS_ERR_OK ) ) -#endif { return error; } @@ -3160,11 +3115,7 @@ static ivas_error setRendInputActiveMasa( const IVAS_REND_InputId id, RENDER_CONFIG_DATA *hRendCfg, hrtf_handles *hrtfs -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES ) -#else - ) /* Todo: This is not used at all within MASA. Support might be better to do after refactoring. */ -#endif { ivas_error error; rendering_context rendCtx; @@ -3176,9 +3127,6 @@ static ivas_error setRendInputActiveMasa( rendCtx = inputMasa->base.ctx; outConfig = *rendCtx.pOutConfig; move32(); -#ifndef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES - (void) hRendCfg; /* Suppress warning */ -#endif IF( !isIoConfigPairSupported( inConfig, outConfig ) ) { @@ -3217,11 +3165,7 @@ static ivas_error setRendInputActiveMasa( } ELSE { -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES IF( NE_32( ( error = initMasaExtRenderer( inputMasa, outConfig, hRendCfg, hrtfs ) ), IVAS_ERR_OK ) ) -#else - IF( NE_32( ( error = initMasaExtRenderer( inputMasa, outConfig, hrtfs ) ), IVAS_ERR_OK ) ) -#endif { return error; } @@ -3407,9 +3351,7 @@ ivas_error IVAS_REND_Open( hIvasRend->hHrtfs.hHrtfParambin = NULL; hIvasRend->hHrtfs.hHrtfTD = NULL; hIvasRend->hHrtfs.hSetOfHRTF = NULL; -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES hIvasRend->hHrtfs.hHrtfStatistics = NULL; -#endif IF( asHrtfBinary ) { IF( NE_32( ( error = ivas_HRTF_binary_open_fx( &( hIvasRend->hHrtfs.hHrtfTD ) ) ), IVAS_ERR_OK ) ) @@ -3428,19 +3370,15 @@ ivas_error IVAS_REND_Open( { return error; } -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES IF( NE_32( ( error = ivas_HRTF_statistics_binary_open( &( hIvasRend->hHrtfs.hHrtfStatistics ) ) ), IVAS_ERR_OK ) ) { return error; } -#endif } -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES IF( NE_32( ( error = ivas_HRTF_statistics_init( &( hIvasRend->hHrtfs.hHrtfStatistics ), hIvasRend->sampleRateOut ) ), IVAS_ERR_OK ) ) { return error; } -#endif return IVAS_ERR_OK; } @@ -3588,11 +3526,7 @@ ivas_error IVAS_REND_ConfigureCustomOutputLoudspeakerLayout( /* Input inactive, skip. */ CONTINUE; } -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES IF( NE_32( ( error = updateSbaPanGains( inputSba, hIvasRend->outputConfig, hIvasRend->hRendererConfig, NULL, NULL ) ), IVAS_ERR_OK ) ) -#else - IF( NE_32( ( error = updateSbaPanGains( inputSba, hIvasRend->outputConfig, hIvasRend->hRendererConfig, NULL ) ), IVAS_ERR_OK ) ) -#endif { return error; } @@ -4101,11 +4035,7 @@ ivas_error IVAS_REND_ConfigureCustomInputLoudspeakerLayout( IF( EQ_32( getAudioConfigType( hIvasRend->outputConfig ), IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL ) ) { -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES IF( NE_32( ( error = initMcBinauralRendering( inputMc, inputMc->base.inConfig, hIvasRend->outputConfig, hIvasRend->hRendererConfig, hIvasRend->hHrtfs.hSetOfHRTF, hIvasRend->hHrtfs.hHrtfStatistics, FALSE ) ), IVAS_ERR_OK ) ) -#else - IF( NE_32( ( error = initMcBinauralRendering( inputMc, inputMc->base.inConfig, hIvasRend->outputConfig, hIvasRend->hRendererConfig, hIvasRend->hHrtfs.hSetOfHRTF, FALSE ) ), IVAS_ERR_OK ) ) -#endif { return error; } @@ -4907,11 +4837,7 @@ ivas_error IVAS_REND_SetHeadRotation( { IF( NE_32( hIvasRend->inputsMc[i].base.inConfig, IVAS_AUDIO_CONFIG_INVALID ) ) { -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES IF( NE_32( ( error = initMcBinauralRendering( &hIvasRend->inputsMc[i], hIvasRend->inputsMc[i].base.inConfig, hIvasRend->outputConfig, hIvasRend->hRendererConfig, hIvasRend->hHrtfs.hSetOfHRTF, hIvasRend->hHrtfs.hHrtfStatistics, TRUE ) ), IVAS_ERR_OK ) ) -#else - IF( NE_32( ( error = initMcBinauralRendering( &hIvasRend->inputsMc[i], hIvasRend->inputsMc[i].base.inConfig, hIvasRend->outputConfig, hIvasRend->hRendererConfig, hIvasRend->hHrtfs.hSetOfHRTF, TRUE ) ), IVAS_ERR_OK ) ) -#endif { return error; } @@ -5005,11 +4931,7 @@ ivas_error IVAS_REND_DisableHeadRotation( { IF( NE_32( hIvasRend->inputsMc[i].base.inConfig, IVAS_AUDIO_CONFIG_INVALID ) ) { -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES IF( NE_32( ( error = initMcBinauralRendering( &hIvasRend->inputsMc[i], hIvasRend->inputsMc[i].base.inConfig, hIvasRend->outputConfig, hIvasRend->hRendererConfig, hIvasRend->hHrtfs.hSetOfHRTF, hIvasRend->hHrtfs.hHrtfStatistics, TRUE ) ), IVAS_ERR_OK ) ) -#else - IF( NE_32( ( error = initMcBinauralRendering( &hIvasRend->inputsMc[i], hIvasRend->inputsMc[i].base.inConfig, hIvasRend->outputConfig, hIvasRend->hRendererConfig, hIvasRend->hHrtfs.hSetOfHRTF, TRUE ) ), IVAS_ERR_OK ) ) -#endif { return error; @@ -8969,9 +8891,7 @@ void IVAS_REND_Close( ivas_HRTF_CRend_binary_close_fx( &( hIvasRend->hHrtfs.hSetOfHRTF ) ); ivas_HRTF_fastconv_binary_close_fx( &( hIvasRend->hHrtfs.hHrtfFastConv ) ); ivas_HRTF_parambin_binary_close_fx( &( hIvasRend->hHrtfs.hHrtfParambin ) ); -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES ivas_HRTF_statistics_close( &( hIvasRend->hHrtfs.hHrtfStatistics ) ); -#endif free( hIvasRend ); *phIvasRend = NULL; @@ -9203,7 +9123,6 @@ ivas_error IVAS_REND_GetHrtfParamBinHandle( } -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES /*---------------------------------------------------------------------* * IVAS_REND_GetHrtfStatisticsHandle( ) * @@ -9224,7 +9143,6 @@ ivas_error IVAS_REND_GetHrtfStatisticsHandle( return IVAS_ERR_OK; } -#endif static ivas_error ivas_masa_ext_rend_dirac_rend_init( input_masa *inputMasa ) @@ -9655,13 +9573,9 @@ static ivas_error ivas_masa_ext_rend_dirac_rend_init( static ivas_error ivas_masa_ext_rend_parambin_init( -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES input_masa *inputMasa, /* i/o: MASA external renderer structure */ const RENDER_CONFIG_DATA *hRendCfg, /* i : Renderer configuration data handle */ HRTFS_STATISTICS_HANDLE hHrtfStatistics /* i : HRTF statistics */ -#else - input_masa *inputMasa /* i/o: MASA external renderer structure */ -#endif ) { DIRAC_DEC_BIN_HANDLE hDiracDecBin; @@ -9802,15 +9716,10 @@ static ivas_error ivas_masa_ext_rend_parambin_init( IF( hDiracDecBin->hReverb == NULL && pos_idx == 0 ) /* open reverb only for the main direction */ { -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES #ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF if ( NE_32( ( error = ivas_binaural_reverb_init( &hDiracDecBin->hReverb, hHrtfStatistics, nBins, CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES, &( hRendCfg->roomAcoustics ), output_Fs, ( *phHrtfParambin )->parametricReverberationTimes_fx, ( *phHrtfParambin )->parametricReverberationEneCorrections_fx ) ), IVAS_ERR_OK ) ) #else IF( NE_32( ( error = ivas_binaural_reverb_init( &hDiracDecBin->hReverb, hHrtfStatistics, nBins, CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES, &( hRendCfg->roomAcoustics ), output_Fs, hHrtfParambin->parametricReverberationTimes_fx, hHrtfParambin->parametricReverberationEneCorrections_fx ) ), IVAS_ERR_OK ) ) -#endif -#else - /* Todo Philips: Room acoustics should be passed here once the underlying part works. In this case, it probably should come from render context or somewhere else suitable. */ - IF( NE_32( ( error = ivas_binaural_reverb_open_parambin( &hDiracDecBin->hReverb, nBins, CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES, NULL, output_Fs, hHrtfParambin ) ), IVAS_ERR_OK ) ) #endif { return error; @@ -9867,9 +9776,7 @@ static ivas_error ivas_masa_ext_rend_parambin_init( static ivas_error initMasaExtRenderer( input_masa *inputMasa, const AUDIO_CONFIG outConfig, -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES const RENDER_CONFIG_DATA *hRendCfg, -#endif hrtf_handles *hrtfs ) { Word16 i; @@ -10003,11 +9910,7 @@ static ivas_error initMasaExtRenderer( return error; } } -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( NE_32( ( error = ivas_masa_ext_rend_parambin_init( inputMasa, hRendCfg, hrtfs->hHrtfStatistics ) ), IVAS_ERR_OK ) ) -#else - IF( NE_32( ( error = ivas_masa_ext_rend_parambin_init( inputMasa ) ), IVAS_ERR_OK ) ) -#endif { return error; } diff --git a/lib_util/hrtf_file_reader.c b/lib_util/hrtf_file_reader.c index 7e38a1a08..abf157d9c 100644 --- a/lib_util/hrtf_file_reader.c +++ b/lib_util/hrtf_file_reader.c @@ -574,98 +574,6 @@ static ivas_error LoadBSplineBinary( return IVAS_ERR_OK; } -#ifndef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES -/*-------------------------------------------------------------------* - * set_default_reverb_iac_energy() - * - * Loads reverb data from file. - --------------------------------------------------------------------*/ - -static ivas_error set_default_reverb_iac_energy( - IVAS_DEC_HRTF_HANDLE HrFiltSet_p /* i/o: HR filter model parameter structure */ -) -{ - int16_t i; - int16_t lr_iac_len; - - if ( HrFiltSet_p == NULL ) - { - return IVAS_ERR_UNEXPECTED_NULL_POINTER; - } - - lr_iac_len = LR_IAC_LENGTH_NR_FC; - if ( HrFiltSet_p->SampleRate == 16000 ) - { - lr_iac_len = LR_IAC_LENGTH_NR_FC_16KHZ; - } - - if ( HrFiltSet_p->ModelParams.modelROM == 0 ) - { - for ( i = 0; i < 3; i++ ) - { - HrFiltSet_p->lr_energy_and_iac_dyn_fx[i] = (Word32 *) malloc( lr_iac_len * sizeof( float ) ); - if ( HrFiltSet_p->lr_energy_and_iac_dyn_fx[i] == NULL ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for hrtf data" ); - } - } - switch ( HrFiltSet_p->SampleRate ) - { - case 48000: - mvl2l( defaultHRIR_left_avg_power_48kHz_fx, HrFiltSet_p->lr_energy_and_iac_dyn_fx[0], LR_IAC_LENGTH_NR_FC ); - mvl2l( defaultHRIR_right_avg_power_48kHz_fx, HrFiltSet_p->lr_energy_and_iac_dyn_fx[1], LR_IAC_LENGTH_NR_FC ); - mvl2l( defaultHRIR_coherence_48kHz_fx, HrFiltSet_p->lr_energy_and_iac_dyn_fx[2], LR_IAC_LENGTH_NR_FC ); - break; - case 32000: - mvl2l( defaultHRIR_left_avg_power_32kHz_fx, HrFiltSet_p->lr_energy_and_iac_dyn_fx[0], LR_IAC_LENGTH_NR_FC ); - mvl2l( defaultHRIR_right_avg_power_32kHz_fx, HrFiltSet_p->lr_energy_and_iac_dyn_fx[1], LR_IAC_LENGTH_NR_FC ); - mvl2l( defaultHRIR_coherence_32kHz_fx, HrFiltSet_p->lr_energy_and_iac_dyn_fx[2], LR_IAC_LENGTH_NR_FC ); - break; - case 16000: - floatToFixed_arr32( defaultHRIR_coherence_16kHz_fx, HrFiltSet_p->lr_energy_and_iac_dyn_fx[2], Q27, lr_iac_len ); /* tables from which lr_energy_and_iac is updated has Q27 for i=2 */ - floatToFixed_arr32( defaultHRIR_left_avg_power_16kHz_fx, HrFiltSet_p->lr_energy_and_iac_dyn_fx[1], Q23, lr_iac_len ); /* tables from which lr_energy_and_iac is updated has Q23 for i=0,1 */ - floatToFixed_arr32( defaultHRIR_left_avg_power_16kHz_fx, HrFiltSet_p->lr_energy_and_iac_dyn_fx[0], Q23, lr_iac_len ); /* tables from which lr_energy_and_iac is updated has Q23 for i=0,1 */ - break; - } - } - else - { - switch ( HrFiltSet_p->SampleRate ) - { - case 48000: - HrFiltSet_p->lr_energy_and_iac_fx[0] = defaultHRIR_left_avg_power_48kHz_fx; - HrFiltSet_p->lr_energy_and_iac_fx[1] = defaultHRIR_right_avg_power_48kHz_fx; - HrFiltSet_p->lr_energy_and_iac_fx[2] = defaultHRIR_coherence_48kHz_fx; - break; - case 32000: - HrFiltSet_p->lr_energy_and_iac_fx[0] = defaultHRIR_left_avg_power_32kHz_fx; - HrFiltSet_p->lr_energy_and_iac_fx[1] = defaultHRIR_right_avg_power_32kHz_fx; - HrFiltSet_p->lr_energy_and_iac_fx[2] = defaultHRIR_coherence_32kHz_fx; - break; - case 16000: - for ( i = 0; i < 3; i++ ) - { - HrFiltSet_p->lr_energy_and_iac_dyn_fx[i] = (Word32 *) malloc( lr_iac_len * sizeof( float ) ); - if ( HrFiltSet_p->lr_energy_and_iac_dyn_fx[i] == NULL ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for hrtf data" ); - } - } - floatToFixed_arr32( defaultHRIR_coherence_16kHz_fx, HrFiltSet_p->lr_energy_and_iac_dyn_fx[2], Q27, lr_iac_len ); /* tables from which lr_energy_and_iac is updated has Q27 for i=2 */ - floatToFixed_arr32( defaultHRIR_left_avg_power_16kHz_fx, HrFiltSet_p->lr_energy_and_iac_dyn_fx[1], Q23, lr_iac_len ); /* tables from which lr_energy_and_iac is updated has Q23 for i=0,1 */ - floatToFixed_arr32( defaultHRIR_left_avg_power_16kHz_fx, HrFiltSet_p->lr_energy_and_iac_dyn_fx[0], Q23, lr_iac_len ); /* tables from which lr_energy_and_iac is updated has Q23 for i=0,1 */ - HrFiltSet_p->lr_energy_and_iac_fx[0] = (const Word32 *) HrFiltSet_p->lr_energy_and_iac_dyn_fx[0]; - HrFiltSet_p->lr_energy_and_iac_fx[1] = (const Word32 *) HrFiltSet_p->lr_energy_and_iac_dyn_fx[1]; - HrFiltSet_p->lr_energy_and_iac_fx[2] = (const Word32 *) HrFiltSet_p->lr_energy_and_iac_dyn_fx[2]; - - - break; - } - } - - return IVAS_ERR_OK; -} -#endif /*-------------------------------------------------------------------* * load_reverb_from_binary() @@ -674,18 +582,11 @@ static ivas_error set_default_reverb_iac_energy( --------------------------------------------------------------------*/ static ivas_error load_reverb_from_binary( -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES IVAS_DEC_HRTF_STATISTICS_HANDLE hHrtfStatistics, /* i/o: HRTF statistics handle */ int32_t sampleRate, /* i : sample rate */ -#else - IVAS_DEC_HRTF_HANDLE HrFiltSet_p, /* i/o: HR filter model parameter structure */ -#endif FILE *f_hrtf /* i : HR filter data file handle */ ) { -#ifndef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES - int16_t i; -#endif bool is_reverb; ivas_error header_check_result; ivas_hrtfs_file_header_t hrtfs_file_header; @@ -696,21 +597,13 @@ static ivas_error load_reverb_from_binary( int16_t lr_iac_len; float f_tmp_lr_energy_and_iac_dyn[LR_IAC_LENGTH_NR_FC]; -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( hHrtfStatistics == NULL ) -#else - if ( HrFiltSet_p == NULL ) -#endif { return IVAS_ERR_UNEXPECTED_NULL_POINTER; } lr_iac_len = LR_IAC_LENGTH_NR_FC; -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( sampleRate == 16000 ) -#else - if ( HrFiltSet_p->SampleRate == 16000 ) -#endif { lr_iac_len = LR_IAC_LENGTH_NR_FC_16KHZ; } @@ -771,7 +664,6 @@ static ivas_error load_reverb_from_binary( if ( is_reverb ) { -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES hHrtfStatistics->average_energy_l_dyn = (Word32 *) malloc( lr_iac_len * sizeof( Word32 ) ); hHrtfStatistics->average_energy_r_dyn = (Word32 *) malloc( lr_iac_len * sizeof( Word32 ) ); hHrtfStatistics->inter_aural_coherence_dyn = (Word32 *) malloc( lr_iac_len * sizeof( Word32 ) ); @@ -793,37 +685,9 @@ static ivas_error load_reverb_from_binary( fread( f_tmp_lr_energy_and_iac_dyn, sizeof( float ), lr_iac_len, f_hrtf ); floatToFixed_arr32( f_tmp_lr_energy_and_iac_dyn, hHrtfStatistics->inter_aural_coherence_dyn, Q26, lr_iac_len ); hHrtfStatistics->fromROM = FALSE; -#else - /* left/right energy and interaural coherence for late reverb */ - FOR( i = 0; i < 3; i++ ) - { - HrFiltSet_p->lr_energy_and_iac_dyn_fx[i] = (Word32 *) malloc( lr_iac_len * sizeof( float ) ); - if ( HrFiltSet_p->lr_energy_and_iac_dyn_fx[i] == NULL ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for hrtf data" ); - } - fread( f_tmp_lr_energy_and_iac_dyn, sizeof( const float ), lr_iac_len, f_hrtf ); - IF( i == 2 ) - { - floatToFixed_arr32( f_tmp_lr_energy_and_iac_dyn, HrFiltSet_p->lr_energy_and_iac_dyn_fx[i], Q27, lr_iac_len ); /* tables from which lr_energy_and_iac is updated has Q27 for i=2 */ - } - ELSE - { - floatToFixed_arr32( f_tmp_lr_energy_and_iac_dyn, HrFiltSet_p->lr_energy_and_iac_dyn_fx[i], Q23, lr_iac_len ); /* tables from which lr_energy_and_iac is updated has Q23 for i=0,1 */ - } - HrFiltSet_p->lr_energy_and_iac_fx[i] = (const Word32 *) HrFiltSet_p->lr_energy_and_iac_dyn_fx[i]; - } -#endif } else { -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES -#else - if ( ( header_check_result = set_default_reverb_iac_energy( HrFiltSet_p ) ) != IVAS_ERR_OK ) - { - return header_check_result; - } -#endif return IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA; } @@ -837,22 +701,14 @@ static ivas_error load_reverb_from_binary( *---------------------------------------------------------------------*/ ivas_error load_reverb_binary( -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES IVAS_DEC_HRTF_STATISTICS_HANDLE hHrtfStatistics, /* i/o: HRTF statistics handle */ int32_t sampleRate, /* i : sample rate */ -#else - IVAS_DEC_HRTF_HANDLE hHrtf, /* i/o: HRTF handle */ -#endif const hrtfFileReader *hrtfReader /* i/o: pointer to hrtfFileReader handle */ ) { fseek( hrtfReader->file, 0, SEEK_SET ); -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES return load_reverb_from_binary( hHrtfStatistics, sampleRate, hrtfReader->file ); -#else - return load_reverb_from_binary( hHrtf, hrtfReader->file ); -#endif } /*-------------------------------------------------------------------* * TDREND_MIX_LoadHRTF() @@ -1116,25 +972,7 @@ void destroy_td_hrtf( free( ( *hHrtf )->ModelEval.hrfModL_fx ); free( ( *hHrtf )->ModelEval.hrfModR_fx ); -#ifndef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES - for ( i = 0; i < 3; i++ ) - { - free( ( *hHrtf )->lr_energy_and_iac_dyn_fx[i] ); - } } - else - { - for ( i = 0; i < 3; i++ ) - { - if ( ( *hHrtf )->lr_energy_and_iac_dyn_fx[i] ) - { - free( ( *hHrtf )->lr_energy_and_iac_dyn_fx[i] ); - } - } - } -#else - } -#endif ivas_HRTF_binary_close_fx( hHrtf ); @@ -2298,7 +2136,6 @@ void destroy_SetOfHRTF( } -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES /*---------------------------------------------------------------------* * destroy_hrtf_statistics() * @@ -2326,7 +2163,6 @@ void destroy_hrtf_statistics( } ivas_HRTF_statistics_close( hHrtfStatistics ); } -#endif /*---------------------------------------------------------------------* * destroy_fastconv_hrtf() diff --git a/lib_util/hrtf_file_reader.h b/lib_util/hrtf_file_reader.h index 91e68b358..904182ab3 100644 --- a/lib_util/hrtf_file_reader.h +++ b/lib_util/hrtf_file_reader.h @@ -99,12 +99,8 @@ ivas_error load_HRTF_binary( *---------------------------------------------------------------------*/ ivas_error load_reverb_binary( -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES IVAS_DEC_HRTF_STATISTICS_HANDLE hHrtfStatistics, /* i/o: HRTF statistics handle */ int32_t sampleRate, /* i : sample rate */ -#else - IVAS_DEC_HRTF_HANDLE hHrtf, /* i/o: HRTF handle */ -#endif const hrtfFileReader *hrtfReader /* i/o: pointer to hrtfFileReader handle */ ); @@ -164,7 +160,6 @@ ivas_error load_parambin_HRTF_from_binary( const hrtfFileReader *hrtfReader /* i : pointer to hrtfFileReader handle */ ); -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES /*---------------------------------------------------------------------* * destroy_hrtf_statistics() * @@ -174,7 +169,6 @@ ivas_error load_parambin_HRTF_from_binary( void destroy_hrtf_statistics( IVAS_DEC_HRTF_STATISTICS_HANDLE *hHrtfStatistics /* i/o: HRTF statistics handle */ ); -#endif /*---------------------------------------------------------------------* * dealloc_HRTF_binary() -- GitLab From a3b7687d08b1178ef4b0af3c63b12503aac545a8 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Tue, 8 Jul 2025 15:23:06 +0200 Subject: [PATCH 10/11] [cleanup] accept FIX_777_COMBI_RENDER_CONFIG_FILE --- lib_com/options.h | 1 - lib_util/render_config_reader.c | 8 -------- 2 files changed, 9 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index fb009faea..7a8ea4d33 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -114,7 +114,6 @@ -#define FIX_777_COMBI_RENDER_CONFIG_FILE /* Philips: Fix for combined renderer config file support */ #define NONBE_FIX_991_PARAMBIN_BINARY_HRTF /* Nokia: issue #991: fix using of binary file HRTF in ParamBin (to activate when USE_NEW_HRTF_BINARY_FILE_FORMAT and FIX_777_COMBI_RENDER_CONFIG_FILE are on ) */ #define FIX_1741_REVERB_TIMES_Q_FORMAT /* Philips: reverberation times in Q26 format instead of Q31 */ diff --git a/lib_util/render_config_reader.c b/lib_util/render_config_reader.c index 8df6c0d42..bd9e7a48e 100644 --- a/lib_util/render_config_reader.c +++ b/lib_util/render_config_reader.c @@ -2249,11 +2249,7 @@ ivas_error RenderConfigReader_read( /* RT60 */ else if ( strcmp( item, "RT60" ) == 0 ) { -#ifdef FIX_777_COMBI_RENDER_CONFIG_FILE if ( read_txt_vector( pValue, pRenderConfigReader->pAE[acIdx].pFG->nrBands, pRenderConfigReader->pAE[acIdx].pRT60 ) ) -#else - if ( read_txt_vector( pValue, pRenderConfigReader->pFG[idx].nrBands, pRenderConfigReader->pAE[acIdx].pRT60 ) ) -#endif { errorHandler( item, ERROR_VALUE_INVALID ); return IVAS_ERR_INVALID_RENDER_CONFIG; @@ -2263,11 +2259,7 @@ ivas_error RenderConfigReader_read( /* DSR */ else if ( strcmp( item, "DSR" ) == 0 ) { -#ifdef FIX_777_COMBI_RENDER_CONFIG_FILE if ( read_txt_vector( pValue, pRenderConfigReader->pAE[acIdx].pFG->nrBands, pRenderConfigReader->pAE[acIdx].pDSR ) ) -#else - if ( read_txt_vector( pValue, pRenderConfigReader->pFG[idx].nrBands, pRenderConfigReader->pAE[acIdx].pDSR ) ) -#endif { errorHandler( item, ERROR_VALUE_INVALID ); return IVAS_ERR_INVALID_RENDER_CONFIG; -- GitLab From a8de754fdbc8a9075d622f5df195bc9b10a4f646 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Tue, 8 Jul 2025 15:24:13 +0200 Subject: [PATCH 11/11] formatting --- lib_dec/ivas_init_dec_fx.c | 74 +++++++++++++------------ lib_rend/ivas_reverb_filter_design_fx.c | 1 - lib_rend/ivas_reverb_fx.c | 4 +- lib_rend/ivas_reverb_utils_fx.c | 1 - lib_rend/lib_rend_fx.c | 6 +- lib_util/hrtf_file_reader.c | 5 +- lib_util/hrtf_file_reader.h | 2 +- 7 files changed, 45 insertions(+), 48 deletions(-) diff --git a/lib_dec/ivas_init_dec_fx.c b/lib_dec/ivas_init_dec_fx.c index ef3d8c6e9..40bf1ccf5 100644 --- a/lib_dec/ivas_init_dec_fx.c +++ b/lib_dec/ivas_init_dec_fx.c @@ -1143,52 +1143,54 @@ ivas_error ivas_init_decoder_front( * Allocate HRTF binary handle *--------------------------------------------------------------------*/ - IF( st_ivas->hDecoderConfig->Opt_HRTF_binary ){ - IF( NE_32( ( error = ivas_HRTF_binary_open_fx( &( st_ivas->hHrtfTD ) ) ), IVAS_ERR_OK ) ){ + IF( st_ivas->hDecoderConfig->Opt_HRTF_binary ) + { + IF( NE_32( ( error = ivas_HRTF_binary_open_fx( &( st_ivas->hHrtfTD ) ) ), IVAS_ERR_OK ) ) + { return error; -} - -IF( NE_32( ( error = ivas_HRTF_CRend_binary_open_fx( &( st_ivas->hSetOfHRTF ) ) ), IVAS_ERR_OK ) ) -{ - return error; -} + } -IF( NE_32( ( error = ivas_HRTF_fastconv_binary_open_fx( &st_ivas->hHrtfFastConv ) ), IVAS_ERR_OK ) ) -{ - return error; -} + IF( NE_32( ( error = ivas_HRTF_CRend_binary_open_fx( &( st_ivas->hSetOfHRTF ) ) ), IVAS_ERR_OK ) ) + { + return error; + } -IF( NE_32( ( error = ivas_HRTF_parambin_binary_open_fx( &st_ivas->hHrtfParambin ) ), IVAS_ERR_OK ) ) -{ - return error; -} + IF( NE_32( ( error = ivas_HRTF_fastconv_binary_open_fx( &st_ivas->hHrtfFastConv ) ), IVAS_ERR_OK ) ) + { + return error; + } -IF( NE_32( ( error = ivas_HRTF_statistics_binary_open( &st_ivas->hHrtfStatistics ) ), IVAS_ERR_OK ) ) -{ - return error; -} -} + IF( NE_32( ( error = ivas_HRTF_parambin_binary_open_fx( &st_ivas->hHrtfParambin ) ), IVAS_ERR_OK ) ) + { + return error; + } -/*-------------------------------------------------------------------* - * Allocate and initialize Binaural Renderer configuration handle - *--------------------------------------------------------------------*/ -test(); -test(); -IF( EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL ) || EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) || EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) || EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) || - ( EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_STEREO ) && st_ivas->hDecoderConfig->Opt_non_diegetic_pan ) ) -{ - IF( NE_32( ( error = ivas_render_config_open( &( st_ivas->hRenderConfig ) ) ), IVAS_ERR_OK ) ) - { - return error; + IF( NE_32( ( error = ivas_HRTF_statistics_binary_open( &st_ivas->hHrtfStatistics ) ), IVAS_ERR_OK ) ) + { + return error; + } } - IF( NE_32( ( error = ivas_render_config_init_from_rom_fx( &st_ivas->hRenderConfig ) ), IVAS_ERR_OK ) ) + /*-------------------------------------------------------------------* + * Allocate and initialize Binaural Renderer configuration handle + *--------------------------------------------------------------------*/ + test(); + test(); + IF( EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL ) || EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) || EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) || EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) || + ( EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_STEREO ) && st_ivas->hDecoderConfig->Opt_non_diegetic_pan ) ) { - return error; + IF( NE_32( ( error = ivas_render_config_open( &( st_ivas->hRenderConfig ) ) ), IVAS_ERR_OK ) ) + { + return error; + } + + IF( NE_32( ( error = ivas_render_config_init_from_rom_fx( &st_ivas->hRenderConfig ) ), IVAS_ERR_OK ) ) + { + return error; + } } -} -return error; + return error; } diff --git a/lib_rend/ivas_reverb_filter_design_fx.c b/lib_rend/ivas_reverb_filter_design_fx.c index 0b8642120..a40fcfac8 100644 --- a/lib_rend/ivas_reverb_filter_design_fx.c +++ b/lib_rend/ivas_reverb_filter_design_fx.c @@ -1002,4 +1002,3 @@ void ivas_reverb_interpolate_energies_fx( return; } #endif - diff --git a/lib_rend/ivas_reverb_fx.c b/lib_rend/ivas_reverb_fx.c index b6a634bb7..761f87ef8 100644 --- a/lib_rend/ivas_reverb_fx.c +++ b/lib_rend/ivas_reverb_fx.c @@ -1421,9 +1421,9 @@ static ivas_error setup_FDN_branches_fx( *------------------------------------------------------------------------*/ ivas_error ivas_reverb_open_fx( - REVERB_HANDLE *hReverb, /* i/o: Reverberator handle */ + REVERB_HANDLE *hReverb, /* i/o: Reverberator handle */ const HRTFS_STATISTICS_HANDLE hHrtfStatistics, /* i : HRTF statistics handle */ - RENDER_CONFIG_HANDLE hRenderConfig, /* i : Renderer configuration handle */ + RENDER_CONFIG_HANDLE hRenderConfig, /* i : Renderer configuration handle */ const int32_t output_Fs ) { ivas_error error; diff --git a/lib_rend/ivas_reverb_utils_fx.c b/lib_rend/ivas_reverb_utils_fx.c index 84fa82bce..cfbfd7315 100644 --- a/lib_rend/ivas_reverb_utils_fx.c +++ b/lib_rend/ivas_reverb_utils_fx.c @@ -220,5 +220,4 @@ static void ivas_reverb_set_energies( free( avg_pwr_left_fx ); free( avg_pwr_right_fx ); #endif - } diff --git a/lib_rend/lib_rend_fx.c b/lib_rend/lib_rend_fx.c index ee83f69c7..050da6393 100644 --- a/lib_rend/lib_rend_fx.c +++ b/lib_rend/lib_rend_fx.c @@ -2912,8 +2912,7 @@ static ivas_error updateSbaPanGains( input_sba *inputSba, const AUDIO_CONFIG outConfig, RENDER_CONFIG_DATA *hRendCfg, - IVAS_DEC_HRTF_CREND_HANDLE hMixconv - , + IVAS_DEC_HRTF_CREND_HANDLE hMixconv, IVAS_DEC_HRTF_STATISTICS_HANDLE hHrtfStatistics ) @@ -3114,8 +3113,7 @@ static ivas_error setRendInputActiveMasa( const AUDIO_CONFIG inConfig, const IVAS_REND_InputId id, RENDER_CONFIG_DATA *hRendCfg, - hrtf_handles *hrtfs -) + hrtf_handles *hrtfs ) { ivas_error error; rendering_context rendCtx; diff --git a/lib_util/hrtf_file_reader.c b/lib_util/hrtf_file_reader.c index abf157d9c..9a89badaf 100644 --- a/lib_util/hrtf_file_reader.c +++ b/lib_util/hrtf_file_reader.c @@ -584,7 +584,7 @@ static ivas_error LoadBSplineBinary( static ivas_error load_reverb_from_binary( IVAS_DEC_HRTF_STATISTICS_HANDLE hHrtfStatistics, /* i/o: HRTF statistics handle */ int32_t sampleRate, /* i : sample rate */ - FILE *f_hrtf /* i : HR filter data file handle */ + FILE *f_hrtf /* i : HR filter data file handle */ ) { bool is_reverb; @@ -703,7 +703,7 @@ static ivas_error load_reverb_from_binary( ivas_error load_reverb_binary( IVAS_DEC_HRTF_STATISTICS_HANDLE hHrtfStatistics, /* i/o: HRTF statistics handle */ int32_t sampleRate, /* i : sample rate */ - const hrtfFileReader *hrtfReader /* i/o: pointer to hrtfFileReader handle */ + const hrtfFileReader *hrtfReader /* i/o: pointer to hrtfFileReader handle */ ) { fseek( hrtfReader->file, 0, SEEK_SET ); @@ -971,7 +971,6 @@ void destroy_td_hrtf( free( ( *hHrtf )->ModelEval.hrfModL_fx ); free( ( *hHrtf )->ModelEval.hrfModR_fx ); - } ivas_HRTF_binary_close_fx( hHrtf ); diff --git a/lib_util/hrtf_file_reader.h b/lib_util/hrtf_file_reader.h index 904182ab3..c0b44e29b 100644 --- a/lib_util/hrtf_file_reader.h +++ b/lib_util/hrtf_file_reader.h @@ -101,7 +101,7 @@ ivas_error load_HRTF_binary( ivas_error load_reverb_binary( IVAS_DEC_HRTF_STATISTICS_HANDLE hHrtfStatistics, /* i/o: HRTF statistics handle */ int32_t sampleRate, /* i : sample rate */ - const hrtfFileReader *hrtfReader /* i/o: pointer to hrtfFileReader handle */ + const hrtfFileReader *hrtfReader /* i/o: pointer to hrtfFileReader handle */ ); /*---------------------------------------------------------------------* -- GitLab