From 4254c638927b810a5584ff9af91674ffe2a1df32 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Tue, 8 Jul 2025 14:54:03 +0200 Subject: [PATCH 01/13] [cleanup] accept FIX_1024_REMOVE_PARAMMC_MIXING_MAT --- lib_com/options.h | 1 - lib_dec/ivas_mc_param_dec.c | 143 ---------------------------- lib_dec/ivas_out_setup_conversion.c | 8 -- 3 files changed, 152 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index a3e08cd32..4d96af96d 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -189,7 +189,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 actiate 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_1023_REMOVE_PARAMMC_DEC /* VA: issue 1023: remove unused function ivas_param_mc_dec() */ #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.c b/lib_dec/ivas_mc_param_dec.c index ccb95aa12..2d92dfabc 100644 --- a/lib_dec/ivas_mc_param_dec.c +++ b/lib_dec/ivas_mc_param_dec.c @@ -88,10 +88,6 @@ static void ivas_param_mc_dequantize_cov( PARAM_MC_DEC_HANDLE hDirAC, float *ild static void ivas_param_mc_get_mixing_matrices( PARAM_MC_DEC_HANDLE hParamMC, IVAS_OUTPUT_SETUP *hSynthesisOutputSetup, float Cx_in[PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS], const int16_t param_band_idx, float *mixing_matrix[], float *mixing_matrix_res[], const int16_t nY_int, const PARAM_MC_SYNTHESIS_CONF synth_conf, const int16_t nX, const int16_t nY ); -#ifndef FIX_1024_REMOVE_PARAMMC_MIXING_MAT -static void ivas_param_mc_get_mono_stereo_mixing_matrices( PARAM_MC_DEC_HANDLE hParamMC, float Cx_in[PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS], const int16_t param_band_idx, float *mixing_matrix[], float *mixing_matrix_res[], const int16_t nY_intern, const int16_t nX, const int16_t nY_cov ); - -#endif static void param_mc_update_mixing_matrices( PARAM_MC_DEC_HANDLE hParamMC, float *mixing_matrix[], float *mixing_matrix_res[], const uint16_t nX, const uint16_t nY ); static void ivas_param_mc_dec_compute_interpolator( const uint16_t bAttackPresent, const uint16_t attackPos, const uint16_t interp_length, float *interpolator ); @@ -1496,21 +1492,6 @@ void ivas_param_mc_dec_digest_tc( continue; } -#ifndef FIX_1024_REMOVE_PARAMMC_MIXING_MAT - if ( hParamMC->synthesis_conf == PARAM_MC_SYNTH_MONO_STEREO ) - { - ivas_param_mc_get_mono_stereo_mixing_matrices( hParamMC, - is_next_band ? cx_next_band : cx, - param_band_idx + is_next_band, - hParamMC->h_output_synthesis_cov_state.mixing_matrix, - hParamMC->h_output_synthesis_cov_state.mixing_matrix_res, - nchan_out_transport, - nchan_transport, - nchan_out_cov ); - } - else - { -#endif /* generate mixing matrices */ ivas_param_mc_get_mixing_matrices( hParamMC, hSynthesisOutputSetup, @@ -1522,9 +1503,6 @@ void ivas_param_mc_dec_digest_tc( hParamMC->synthesis_conf, nchan_transport, nchan_out_cov ); -#ifndef FIX_1024_REMOVE_PARAMMC_MIXING_MAT - } -#endif } } @@ -2496,127 +2474,6 @@ static void ivas_param_mc_get_mixing_matrices( } -#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 - *------------------------------------------------------------------------*/ - -static void ivas_param_mc_get_mono_stereo_mixing_matrices( - PARAM_MC_DEC_HANDLE hParamMC, /* i : Parametric MC handle */ - float Cx_in[PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS], /* i : transport channel covariance for all parameter bands */ - const int16_t param_band_idx, /* i : parameter band index */ - float *mixing_matrix[], /* o : direct mixing matrices for all parameter bands */ - float *mixing_matrix_res[], /* o : residual mixing matrices for all parameter bands */ - const int16_t nY_intern, /* i : number of channels of the transport format */ - const int16_t nX, /* i : number of transport channels */ - const int16_t nY_cov /* i : number of output channels */ -) -{ - float Cy_full[MAX_CICP_CHANNELS * MAX_CICP_CHANNELS]; - float mixing_matrix_woLFE[MAX_CICP_CHANNELS * PARAM_MC_MAX_TRANSPORT_CHANS]; - float Nrqq[MAX_OUTPUT_CHANNELS]; - float target_ch_ener[MAX_OUTPUT_CHANNELS]; - int16_t k, l; - float *ild_q; - - float Cx[PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS]; - float Cy_diag[MAX_CICP_CHANNELS]; - float Cproto_diag[MAX_CICP_CHANNELS]; - float Cproto[MAX_CICP_CHANNELS * MAX_CICP_CHANNELS]; - float mat_mult_buffer1[MAX_CICP_CHANNELS * MAX_CICP_CHANNELS]; - float *Cx_state; - float *Cx_old_state; - float Cy_state[MAX_CICP_CHANNELS * MAX_CICP_CHANNELS]; - float *Cy_old_state; - int16_t nY_band; - float proto_matrix[PARAM_MC_MAX_TRANSPORT_CHANS * MAX_CICP_CHANNELS]; - uint16_t i; - - set_zero( Cproto, MAX_CICP_CHANNELS * MAX_CICP_CHANNELS ); - set_zero( mat_mult_buffer1, MAX_CICP_CHANNELS * MAX_CICP_CHANNELS ); - set_zero( proto_matrix, PARAM_MC_MAX_TRANSPORT_CHANS * MAX_CICP_CHANNELS ); - - mvr2r( hParamMC->h_output_synthesis_params.proto_matrix, proto_matrix, nY_cov * nX ); - nY_band = nY_cov; - - Cx_state = Cx_in; - Cx_old_state = hParamMC->h_output_synthesis_cov_state.cx_old[param_band_idx]; - Cy_old_state = hParamMC->h_output_synthesis_cov_state.cy_old[param_band_idx]; - set_zero( Nrqq, MAX_OUTPUT_CHANNELS ); - set_zero( target_ch_ener, MAX_OUTPUT_CHANNELS ); - set_zero( Cy_full, MAX_CICP_CHANNELS * MAX_CICP_CHANNELS ); - set_zero( Cy_state, MAX_CICP_CHANNELS * MAX_CICP_CHANNELS ); - set_zero( Cproto_diag, MAX_CICP_CHANNELS ); - ild_q = hParamMC->icld_q + param_band_idx * hParamMC->hMetadataPMC->ild_mapping_conf->ild_map_size_lfe; - - /*get back Nrg*/ - for ( k = 0; k < nY_intern; k++ ) - { - float ref_ener = 0.0f; - int16_t ref_channel_cnt; - int16_t ref_channel_idx; - - for ( ref_channel_cnt = 0; ref_channel_cnt < hParamMC->hMetadataPMC->ild_mapping_conf->num_ref_channels[k]; ref_channel_cnt++ ) - { - ref_channel_idx = hParamMC->hMetadataPMC->ild_mapping_conf->ref_channel_idx[k][ref_channel_cnt]; - ref_ener += Cx_state[ref_channel_idx + ref_channel_idx * nX]; - } - Nrqq[hParamMC->hMetadataPMC->ild_mapping_conf->ild_index[k]] = powf( 10.0f, ild_q[k] / 10.0f ) * hParamMC->hMetadataPMC->ild_factors[k] * ref_ener; - } - for ( k = 0; k < nY_cov; k++ ) - { - for ( l = 0; l < nY_intern; l++ ) - { - target_ch_ener[k] += hParamMC->ls_conv_dmx_matrix[k + l * nY_cov] * Nrqq[l]; - } - Cy_state[k + nY_cov * k] = target_ch_ener[k]; - } - - /* Smoothing: Sum over two buffers */ - if ( hParamMC->hMetadataPMC->bAttackPresent ) - { - /* no smoothing on attacks */ - mvr2r( Cx_state, Cx, nX * nX ); - mvr2r( Cy_state, Cy_full, nY_cov * nY_cov ); - } - else - { - /* smoothing gains are now identical to one, simply add up */ - v_add( Cx_state, Cx_old_state, Cx, nX * nX ); - v_add( Cy_state, Cy_old_state, Cy_full, nY_cov * nY_cov ); - } - - /* cov buffer update */ - mvr2r( Cx_state, Cx_old_state, nX * nX ); - mvr2r( Cy_state, Cy_old_state, nY_cov * nY_cov ); - - - matrix_product( proto_matrix, nY_band, nX, 0, Cx, nX, nX, 0, mat_mult_buffer1 ); - - matrix_product_diag( mat_mult_buffer1, nY_band, nX, 0, proto_matrix, nY_band, nX, 1, Cproto_diag ); - - /* Computing the mixing matrices */ - for ( i = 0; i < nY_band; i++ ) - { - Cy_diag[i] = Cy_full[i + nY_band * i]; - Cy_diag[i] = sqrtf( Cy_diag[i] / ( Cproto_diag[i] + EPSILON ) ); - } - - diag_matrix_product( Cy_diag, nY_band, proto_matrix, nY_band, nX, 0, mixing_matrix_woLFE ); - - mvr2r( mixing_matrix_woLFE, mixing_matrix[param_band_idx], nY_cov * nX ); - if ( hParamMC->band_grouping[param_band_idx] < hParamMC->h_output_synthesis_params.max_band_decorr ) - { - set_zero( mixing_matrix_res[param_band_idx], nY_cov * nY_cov ); - } - - return; -} - -#endif /*------------------------------------------------------------------------- * param_mc_update_mixing_matrices() diff --git a/lib_dec/ivas_out_setup_conversion.c b/lib_dec/ivas_out_setup_conversion.c index d192a2013..699343c1d 100644 --- a/lib_dec/ivas_out_setup_conversion.c +++ b/lib_dec/ivas_out_setup_conversion.c @@ -973,11 +973,7 @@ void ivas_ls_setup_conversion_process_mdct_param_mc( set_zero( Nrqq, MAX_OUTPUT_CHANNELS ); set_zero( target_ch_ener, 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 = hParamMC->icld_q + bandIdx * hParamMC->hMetadataPMC->ild_mapping_conf->ild_map_size_lfe; for ( chInIdx = 0; chInIdx < nchan_transport_format; chInIdx++ ) @@ -995,11 +991,7 @@ void ivas_ls_setup_conversion_process_mdct_param_mc( Nrqq[hParamMC->hMetadataPMC->ild_mapping_conf->ild_index[chInIdx]] = powf( 10.0f, ild_q[chInIdx] / 10.0f ) * hParamMC->hMetadataPMC->ild_factors[chInIdx] * ref_ener; } -#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 36aa15182f9fc06dcc127dfa733e03d269466dd3 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Tue, 8 Jul 2025 14:54:05 +0200 Subject: [PATCH 02/13] [cleanup] accept FIX_1023_REMOVE_PARAMMC_DEC --- lib_com/ivas_prot.h | 7 ------ lib_com/options.h | 1 - lib_dec/ivas_mc_param_dec.c | 43 ------------------------------------- 3 files changed, 51 deletions(-) diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index eefdca3c1..f974c6c15 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -3879,13 +3879,6 @@ void ivas_param_mc_dec_render( float *output_f[] /* o : rendered time signal */ ); -#ifndef FIX_1023_REMOVE_PARAMMC_DEC -void ivas_param_mc_dec( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ - float *output_f[] /* i/o: synthesized core-coder transport channels/DirAC output */ -); - -#endif /*! r: number of cldfb synthesis instances */ int16_t param_mc_get_num_cldfb_syntheses( Decoder_Struct *st_ivas /* i : IVAS decoder structure */ diff --git a/lib_com/options.h b/lib_com/options.h index 4d96af96d..3c5fffb51 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -189,7 +189,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 actiate when USE_NEW_HRTF_BINARY_FILE_FORMAT and FIX_777_COMBI_RENDER_CONFIG_FILE are on )*/ -#define FIX_1023_REMOVE_PARAMMC_DEC /* VA: issue 1023: remove unused function ivas_param_mc_dec() */ #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*/ diff --git a/lib_dec/ivas_mc_param_dec.c b/lib_dec/ivas_mc_param_dec.c index 2d92dfabc..c5f4a1856 100644 --- a/lib_dec/ivas_mc_param_dec.c +++ b/lib_dec/ivas_mc_param_dec.c @@ -1835,49 +1835,6 @@ void ivas_param_mc_dec_render( return; } -#ifndef FIX_1023_REMOVE_PARAMMC_DEC - -/*------------------------------------------------------------------------- - * ivas_param_mc_dec() - * - * Parametric MC decoding process - *------------------------------------------------------------------------*/ - -void ivas_param_mc_dec( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ - float *output_f[] /* i/o: synthesized core-coder transport channels/DirAC output */ -) -{ - PARAM_MC_DEC_HANDLE hParamMC; - float Cldfb_RealBuffer_in[PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_NSLOTS * CLDFB_NO_CHANNELS_MAX]; - float Cldfb_ImagBuffer_in[PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_NSLOTS * CLDFB_NO_CHANNELS_MAX]; - uint16_t nSamplesAsked, nSamplesAvailableNext, nSamplesRendered; - - hParamMC = st_ivas->hParamMC; - assert( hParamMC ); - push_wmops( "param_mc_dec" ); - - /* set some handle pointers to the stack buffers */ - hParamMC->Cldfb_RealBuffer_tc = Cldfb_RealBuffer_in; - hParamMC->Cldfb_ImagBuffer_tc = Cldfb_ImagBuffer_in; - - nSamplesAsked = (int16_t) ( st_ivas->hDecoderConfig->output_Fs / FRAMES_PER_SEC ); - ivas_param_mc_dec_digest_tc( st_ivas, DEFAULT_JBM_CLDFB_TIMESLOTS, output_f ); - ivas_param_mc_dec_render( st_ivas, nSamplesAsked, &nSamplesRendered, &nSamplesAvailableNext, output_f ); -#ifdef DEBUGGING - assert( nSamplesRendered == nSamplesAsked ); - assert( nSamplesAvailableNext == 0 ); -#endif - - /* set handle pointers back to NULL */ - hParamMC->Cldfb_RealBuffer_tc = NULL; - hParamMC->Cldfb_ImagBuffer_tc = NULL; - - pop_wmops(); - return; -} - -#endif /*------------------------------------------------------------------------- * param_mc_dec_init() -- GitLab From 1802846ef8a3e9658a74ef04561c0e9f26b95452 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Tue, 8 Jul 2025 14:54:08 +0200 Subject: [PATCH 03/13] [cleanup] accept FIX_1022_REMOVE_PARAMISM_DEC --- lib_com/ivas_prot.h | 6 - lib_com/options.h | 1 - lib_dec/ivas_ism_param_dec.c | 283 ----------------------------------- 3 files changed, 290 deletions(-) diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index f974c6c15..ab817b6a1 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -1109,12 +1109,6 @@ void ivas_param_ism_dec_close( const AUDIO_CONFIG output_config /* i : output audio configuration */ ); -#ifndef FIX_1022_REMOVE_PARAMISM_DEC -void ivas_param_ism_dec( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ - float *output_f[] /* i/o: synthesized core-coder transport channels/DirAC output */ -); -#endif void ivas_ism_dec_digest_tc( Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ ); diff --git a/lib_com/options.h b/lib_com/options.h index 3c5fffb51..878782344 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -179,7 +179,6 @@ #ifdef NONBE_FIX_1058_DECODER_ERROR_WITH_REVERB_ROOM #define NONBE_FIX_AVG_IAC_CLDFB_REVERB #endif -#define FIX_1022_REMOVE_PARAMISM_DEC /* VA: issue 1022: remove unused function ivas_param_ism_dec() */ #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 */ diff --git a/lib_dec/ivas_ism_param_dec.c b/lib_dec/ivas_ism_param_dec.c index 79283b8bb..5803086c6 100644 --- a/lib_dec/ivas_ism_param_dec.c +++ b/lib_dec/ivas_ism_param_dec.c @@ -324,44 +324,6 @@ static void ivas_param_ism_render_slot( return; } -#ifndef FIX_1022_REMOVE_PARAMISM_DEC -static void ivas_param_ism_rendering( - PARAM_ISM_DEC_HANDLE hParamIsmDec, - SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom, - float Cldfb_RealBuffer_in[PARAM_ISM_MAX_DMX][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], - float Cldfb_ImagBuffer_in[PARAM_ISM_MAX_DMX][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], - float Cldfb_RealBuffer[PARAM_ISM_MAX_CHAN][4][CLDFB_NO_CHANNELS_MAX], - float Cldfb_ImagBuffer[PARAM_ISM_MAX_CHAN][4][CLDFB_NO_CHANNELS_MAX], - float mixing_matrix[CLDFB_NO_CHANNELS_MAX][PARAM_ISM_MAX_CHAN * PARAM_ISM_MAX_DMX], - const int16_t out_slot_idx, - const int16_t slot_idx, - const int16_t num_ch_LS, - const int16_t nchan_transport ) -{ - int16_t outchIdx, inchIdx, bin_idx; - float tmp_1, mixing_matrix_smooth; - - tmp_1 = hParamIsmDec->hParamIsmRendering->interpolator[slot_idx]; - - for ( bin_idx = 0; bin_idx < hSpatParamRendCom->num_freq_bands; bin_idx++ ) - { - /* smooth the mixing matrix */ - for ( outchIdx = 0; outchIdx < num_ch_LS; outchIdx++ ) - { - for ( inchIdx = 0; inchIdx < nchan_transport; inchIdx++ ) - { - mixing_matrix_smooth = tmp_1 * mixing_matrix[bin_idx][outchIdx + inchIdx * num_ch_LS] + - ( 1 - tmp_1 ) * hParamIsmDec->hParamIsmRendering->mixing_matrix_lin_old[bin_idx][outchIdx + inchIdx * num_ch_LS]; - - Cldfb_RealBuffer[outchIdx][out_slot_idx][bin_idx] += mixing_matrix_smooth * Cldfb_RealBuffer_in[inchIdx][slot_idx][bin_idx]; - Cldfb_ImagBuffer[outchIdx][out_slot_idx][bin_idx] += mixing_matrix_smooth * Cldfb_ImagBuffer_in[inchIdx][slot_idx][bin_idx]; - } - } - } - - return; -} -#endif static ivas_error ivas_param_ism_rendering_init( PARAM_ISM_RENDERING_HANDLE hParamIsmRendering, @@ -716,251 +678,6 @@ void ivas_param_ism_dec_close( return; } -#ifndef FIX_1022_REMOVE_PARAMISM_DEC -/*-------------------------------------------------------------------------* - * ivas_param_ism_dec() - * - * Param ISM decoder - *-------------------------------------------------------------------------*/ - -void ivas_param_ism_dec( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ - float *output_f[] /* i/o: synthesized core-coder transport channels/DirAC output*/ -) -{ - int16_t ch, nchan_transport, nchan_out, nchan_out_woLFE, i; - int16_t subframe_idx, slot_idx, index_slot, bin_idx; - int32_t ivas_total_brate; - int16_t output_frame; - float *p_tc[PARAM_ISM_MAX_DMX]; - float ref_power[CLDFB_NO_CHANNELS_MAX]; - float cx_diag[CLDFB_NO_CHANNELS_MAX][PARAM_ISM_MAX_DMX]; - /* CLDFB Input Buffers */ - float Cldfb_RealBuffer_in[PARAM_ISM_MAX_DMX][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; - float Cldfb_ImagBuffer_in[PARAM_ISM_MAX_DMX][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; - - /* CLDFB Output Buffers */ - float Cldfb_RealBuffer[PARAM_ISM_MAX_CHAN][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; - float Cldfb_ImagBuffer[PARAM_ISM_MAX_CHAN][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; - - /* Direct Response/EFAP Gains */ - float direct_response[MAX_NUM_OBJECTS][PARAM_ISM_MAX_CHAN]; - - /* Covariance Rendering */ - float mixing_matrix[CLDFB_NO_CHANNELS_MAX][PARAM_ISM_MAX_CHAN * PARAM_ISM_MAX_DMX]; - - PARAM_ISM_DEC_HANDLE hParamIsmDec; - SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom; - - IVAS_OUTPUT_SETUP hSetup; - - /* Initialization */ - hParamIsmDec = st_ivas->hParamIsmDec; - assert( hParamIsmDec ); - hSpatParamRendCom = st_ivas->hSpatParamRendCom; - assert( hSpatParamRendCom ); - for ( i = 0; i < PARAM_ISM_MAX_DMX; i++ ) - { - p_tc[i] = output_f[i]; - } - output_frame = (int16_t) ( st_ivas->hDecoderConfig->output_Fs / FRAMES_PER_SEC ); - - nchan_transport = st_ivas->nchan_transport; - if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) - { - nchan_out = st_ivas->nchan_ism; - nchan_out_woLFE = nchan_out; - st_ivas->hDecoderConfig->nchan_out = nchan_out; - } - else - { - nchan_out = st_ivas->hIntSetup.nchan_out_woLFE + st_ivas->hIntSetup.num_lfe; - nchan_out_woLFE = st_ivas->hIntSetup.nchan_out_woLFE; - } - - ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate; - - hSetup = st_ivas->hIntSetup; - - push_wmops( "ivas_param_ism_dec" ); - - /* set buffers to zero */ - for ( bin_idx = 0; bin_idx < CLDFB_NO_CHANNELS_MAX; bin_idx++ ) - { - set_zero( cx_diag[bin_idx], PARAM_ISM_MAX_DMX ); - } - set_zero( ref_power, CLDFB_NO_CHANNELS_MAX ); - - /* Frame-level Processing */ - /* De-quantization */ - if ( !( ivas_total_brate == IVAS_SID_5k2 || ivas_total_brate == FRAME_NO_DATA ) ) - { - ivas_param_ism_dec_dequant_DOA( hParamIsmDec, st_ivas->nchan_ism ); - ivas_param_ism_dec_dequant_powrat( hParamIsmDec ); - st_ivas->hISMDTX.dtx_flag = 0; - } - else - { - st_ivas->hISMDTX.dtx_flag = 1; - } - - /* obtain the direct response using EFAP */ - if ( !( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) ) - { - for ( i = 0; i < st_ivas->nchan_ism; i++ ) - { - efap_determine_gains( st_ivas->hEFAPdata, direct_response[i], hParamIsmDec->azimuth_values[i], hParamIsmDec->elevation_values[i], EFAP_MODE_EFAP ); - } - } - else - { - int16_t j; - - for ( i = 0; i < st_ivas->nchan_ism; i++ ) - { - for ( j = 0; j < nchan_out_woLFE; j++ ) - { - if ( i == j ) - { - direct_response[i][j] = 1.0f; - } - else - { - direct_response[i][j] = 0.0f; - } - } - } - - for ( j = 0; j < nchan_out_woLFE; j++ ) - { - if ( hParamIsmDec->azimuth_values[j] > 0.0f ) - { - hParamIsmDec->hParamIsmRendering->proto_matrix[j] = 1.0f; - hParamIsmDec->hParamIsmRendering->proto_matrix[nchan_out_woLFE + j] = 0.0f; - } - else - { - if ( hParamIsmDec->azimuth_values[j] < 0.0f ) - { - hParamIsmDec->hParamIsmRendering->proto_matrix[j] = 0.0f; - hParamIsmDec->hParamIsmRendering->proto_matrix[nchan_out_woLFE + j] = 1.0f; - } - else /* == 0.0f */ - { - hParamIsmDec->hParamIsmRendering->proto_matrix[j] = 0.5f; - hParamIsmDec->hParamIsmRendering->proto_matrix[nchan_out_woLFE + j] = 0.5f; - } - } - } - } - - ivas_ism_param_dec_tc_gain_ajust( st_ivas, output_frame, output_frame / 2, p_tc ); - - for ( ch = 0; ch < nchan_transport; ch++ ) - { - /* CLDFB Analysis */ - for ( slot_idx = 0; slot_idx < CLDFB_NO_COL_MAX; slot_idx++ ) - { - cldfbAnalysis_ts( &( output_f[ch][hSpatParamRendCom->num_freq_bands * slot_idx] ), Cldfb_RealBuffer_in[ch][slot_idx], Cldfb_ImagBuffer_in[ch][slot_idx], hSpatParamRendCom->num_freq_bands, st_ivas->cldfbAnaDec[ch] ); - - ivas_param_ism_collect_slot( hParamIsmDec, Cldfb_RealBuffer_in[ch][slot_idx], Cldfb_ImagBuffer_in[ch][slot_idx], ch, ref_power, cx_diag ); - } - } - - /* Obtain Mixing Matrix on a frame-level */ - for ( bin_idx = 0; bin_idx < hSpatParamRendCom->num_freq_bands; bin_idx++ ) - { - set_f( mixing_matrix[bin_idx], 0.0f, nchan_transport * nchan_out_woLFE ); - } - - /* Compute mixing matrix */ - ivas_param_ism_compute_mixing_matrix( st_ivas->nchan_ism, hParamIsmDec, st_ivas->hISMDTX, direct_response, nchan_transport, nchan_out_woLFE, cx_diag, ref_power, mixing_matrix ); - - /* subframe loop for synthesis*/ - for ( subframe_idx = 0; subframe_idx < hSpatParamRendCom->nb_subframes; subframe_idx++ ) - { - uint16_t slot_idx_start = subframe_idx * hSpatParamRendCom->subframe_nbslots[subframe_idx]; - uint16_t idx_in; - uint16_t idx_lfe; - - /* Set some memories to zero */ - for ( ch = 0; ch < nchan_out_woLFE; ch++ ) - { - for ( slot_idx = 0; slot_idx < hSpatParamRendCom->subframe_nbslots[subframe_idx]; slot_idx++ ) - { - set_f( Cldfb_RealBuffer[ch][slot_idx], 0.0f, hSpatParamRendCom->num_freq_bands ); - set_f( Cldfb_ImagBuffer[ch][slot_idx], 0.0f, hSpatParamRendCom->num_freq_bands ); - } - } - - for ( slot_idx = 0; slot_idx < hSpatParamRendCom->subframe_nbslots[subframe_idx]; slot_idx++ ) - { - index_slot = slot_idx_start + slot_idx; - - /* Compute bandwise rendering to target LS using covariance rendering */ - ivas_param_ism_rendering( hParamIsmDec, hSpatParamRendCom, Cldfb_RealBuffer_in, Cldfb_ImagBuffer_in, - Cldfb_RealBuffer, Cldfb_ImagBuffer, mixing_matrix, slot_idx, index_slot, - nchan_out_woLFE, nchan_transport ); - } - - /* CLDFB Synthesis */ - idx_in = 0; - idx_lfe = 0; - - for ( ch = 0; ch < nchan_out; ch++ ) - { - if ( ( hSetup.num_lfe > 0 ) && ( hSetup.index_lfe[idx_lfe] == ch ) ) - { - set_zero( &( output_f[ch][slot_idx_start * hSpatParamRendCom->num_freq_bands] ), hSpatParamRendCom->subframe_nbslots[subframe_idx] * hSpatParamRendCom->num_freq_bands ); - if ( idx_lfe < ( hSetup.num_lfe - 1 ) ) - { - idx_lfe++; - } - } - else - { - float *RealBuffer[16]; - float *ImagBuffer[16]; - - /* open CLDFB buffer up to CLDFB_NO_CHANNELS_MAX bands for 48kHz */ - for ( i = 0; i < hSpatParamRendCom->subframe_nbslots[subframe_idx]; i++ ) - { - RealBuffer[i] = Cldfb_RealBuffer[idx_in][i]; - ImagBuffer[i] = Cldfb_ImagBuffer[idx_in][i]; - } - - cldfbSynthesis( RealBuffer, ImagBuffer, &( output_f[ch][slot_idx_start * hSpatParamRendCom->num_freq_bands] ), - hSpatParamRendCom->num_freq_bands * hSpatParamRendCom->subframe_nbslots[subframe_idx], st_ivas->cldfbSynDec[ch] ); - - idx_in++; - } - } - } - - /* copy the memories */ - /* store mixing matrix for next subframe */ - ivas_param_ism_update_mixing_matrix( hParamIsmDec, mixing_matrix, nchan_transport, nchan_out_woLFE ); - - /* store MetaData parameters */ - for ( ch = 0; ch < st_ivas->nchan_ism; ch++ ) - { - if ( st_ivas->hParamIsmDec->azimuth_values[ch] > 180.0f ) - { - st_ivas->hIsmMetaData[ch]->azimuth = st_ivas->hParamIsmDec->azimuth_values[ch] - 360.0f; - } - else - { - st_ivas->hIsmMetaData[ch]->azimuth = st_ivas->hParamIsmDec->azimuth_values[ch]; - } - - st_ivas->hIsmMetaData[ch]->elevation = st_ivas->hParamIsmDec->elevation_values[ch]; - } - - pop_wmops(); - - return; -} -#endif /*-------------------------------------------------------------------------* * ivas_ism_dec_digest_tc() -- GitLab From 7550a40c77ac04a0a3b1a10a08afe43d5eaf016e Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Tue, 8 Jul 2025 14:54:10 +0200 Subject: [PATCH 04/13] [cleanup] accept FIX_1035_HT_OSBA --- lib_com/options.h | 1 - lib_dec/ivas_binRenderer_internal.c | 4 ---- 2 files changed, 5 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 878782344..b5288639b 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -190,7 +190,6 @@ #define NONBE_FIX_991_PARAMBIN_BINARY_HRTF /* Nokia: issue #991: fix using of binary file HRTF in ParamBin (to actiate when USE_NEW_HRTF_BINARY_FILE_FORMAT and FIX_777_COMBI_RENDER_CONFIG_FILE are on )*/ #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.c b/lib_dec/ivas_binRenderer_internal.c index b7ef9bedb..e1d6b9233 100644 --- a/lib_dec/ivas_binRenderer_internal.c +++ b/lib_dec/ivas_binRenderer_internal.c @@ -1049,11 +1049,7 @@ ivas_error ivas_binRenderer_open( /* Define of head rotation has to be done in binRendeder in CLDFB*/ hBinRenderer->rotInCldfb = 0; -#ifdef FIX_1035_HT_OSBA if ( st_ivas->ivas_format == MC_FORMAT || st_ivas->ivas_format == SBA_FORMAT || st_ivas->ivas_format == SBA_ISM_FORMAT ) -#else - if ( st_ivas->ivas_format == MC_FORMAT || st_ivas->ivas_format == SBA_FORMAT ) -#endif { hBinRenderer->rotInCldfb = 1; } -- GitLab From e9e84867661594e4055235f614723d95fbd80901 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Tue, 8 Jul 2025 14:54:15 +0200 Subject: [PATCH 05/13] [cleanup] accept NONBE_FIX_1021_ISM_BRIR_RS_FLUSH --- lib_com/ivas_prot.h | 2 -- lib_com/options.h | 1 - lib_dec/ivas_ism_renderer.c | 14 -------------- lib_dec/ivas_jbm_dec.c | 12 ------------ lib_dec/ivas_osba_dec.c | 4 ---- 5 files changed, 33 deletions(-) diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index ab817b6a1..8ec991e1b 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -5190,9 +5190,7 @@ void ivas_ism_renderer_close( void ivas_ism_render_sf( 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 float *output_f[], /* i/o: core-coder transport channels/object output */ const int16_t n_samples_to_render /* i : output frame length per channel */ ); diff --git a/lib_com/options.h b/lib_com/options.h index b5288639b..549bc14a1 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -189,7 +189,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 actiate when USE_NEW_HRTF_BINARY_FILE_FORMAT and FIX_777_COMBI_RENDER_CONFIG_FILE are on )*/ #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.c b/lib_dec/ivas_ism_renderer.c index 870629aa9..5664a611b 100644 --- a/lib_dec/ivas_ism_renderer.c +++ b/lib_dec/ivas_ism_renderer.c @@ -141,9 +141,7 @@ void ivas_ism_renderer_close( void ivas_ism_render_sf( 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 float *output_f[], /* i/o: core-coder transport channels/object output */ const int16_t n_samples_to_render /* i : output frame length per channel */ ) @@ -176,15 +174,7 @@ void ivas_ism_render_sf( assert( last_sf <= st_ivas->hTcBuffer->nb_subframes ); #endif -#ifdef NONBE_FIX_1021_ISM_BRIR_RS_FLUSH num_objects = st_ivas->nchan_ism; -#else - num_objects = st_ivas->nchan_transport; - if ( st_ivas->ivas_format == SBA_ISM_FORMAT ) - { - num_objects = st_ivas->nchan_ism; - } -#endif nchan_out_woLFE = st_ivas->hIntSetup.nchan_out_woLFE; @@ -289,11 +279,7 @@ void ivas_ism_render_sf( 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 ( renderer_type != RENDERER_BINAURAL_MIXER_CONV_ROOM ) -#else - if ( st_ivas->renderer_type != RENDERER_BINAURAL_MIXER_CONV_ROOM ) -#endif { st_ivas->hTcBuffer->subframes_rendered += 1; st_ivas->hTcBuffer->slots_rendered += st_ivas->hTcBuffer->subframe_nbslots[subframe_idx]; diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index 77fdb9dc8..094a861d1 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -1057,11 +1057,7 @@ ivas_error ivas_jbm_dec_render( if ( st_ivas->renderer_type == RENDERER_TD_PANNING || 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( st_ivas, st_ivas->renderer_type, p_output, *nSamplesRendered ); -#else - ivas_ism_render_sf( st_ivas, p_output, *nSamplesRendered ); -#endif } else if ( st_ivas->renderer_type == RENDERER_NON_DIEGETIC_DOWNMIX ) { @@ -1181,11 +1177,7 @@ ivas_error ivas_jbm_dec_render( } /* render objects */ -#ifdef NONBE_FIX_1021_ISM_BRIR_RS_FLUSH ivas_ism_render_sf( st_ivas, st_ivas->renderer_type, p_output, *nSamplesRendered ); -#else - ivas_ism_render_sf( st_ivas, p_output, *nSamplesRendered ); -#endif /* add already rendered SBA part */ for ( n = 0; n < nchan_out; n++ ) @@ -1554,11 +1546,7 @@ ivas_error ivas_jbm_dec_flush_renderer( /* Convert to CICPxx; used also for ISM->CICP19->binaural_room rendering */ set_f( st_ivas->hIsmRendererData->interpolator, 1.0f, hTcBuffer->n_samples_granularity ); -#ifdef NONBE_FIX_1021_ISM_BRIR_RS_FLUSH ivas_ism_render_sf( st_ivas, renderer_type_old, p_output, hTcBuffer->n_samples_granularity ); -#else - ivas_ism_render_sf( st_ivas, p_output, hTcBuffer->n_samples_granularity ); -#endif if ( ( error = ivas_rend_crendProcessSubframe( st_ivas->hCrendWrapper, IVAS_AUDIO_CONFIG_7_1_4, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR, st_ivas->hDecoderConfig, NULL, NULL, NULL, st_ivas->hTcBuffer, p_output, p_output, hTcBuffer->n_samples_granularity, st_ivas->hDecoderConfig->output_Fs, 0 ) ) != IVAS_ERR_OK ) diff --git a/lib_dec/ivas_osba_dec.c b/lib_dec/ivas_osba_dec.c index 60c2c8f8e..e3d4919ba 100644 --- a/lib_dec/ivas_osba_dec.c +++ b/lib_dec/ivas_osba_dec.c @@ -283,11 +283,7 @@ ivas_error ivas_osba_render_sf( if ( st_ivas->renderer_type != RENDERER_BINAURAL_FASTCONV_ROOM ) { -#ifdef NONBE_FIX_1021_ISM_BRIR_RS_FLUSH ivas_ism_render_sf( st_ivas, st_ivas->renderer_type, p_output_ism, *nSamplesRendered ); -#else - ivas_ism_render_sf( st_ivas, p_output_ism, *nSamplesRendered ); -#endif } for ( n = 0; n < st_ivas->hDecoderConfig->nchan_out; n++ ) -- GitLab From 5c8c8be71c538dfb717e3038cefde622a44bc832 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Tue, 8 Jul 2025 14:54:18 +0200 Subject: [PATCH 06/13] [cleanup] accept NONBE_FIX_1034_DRY_MASA_RATIOS --- lib_com/ivas_cnst.h | 4 ---- lib_com/options.h | 1 - lib_enc/ivas_masa_enc.c | 12 ------------ 3 files changed, 17 deletions(-) diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index a7825d2a1..802287c8d 100644 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -1188,11 +1188,7 @@ enum #define MASA_COHERENCE_TOLERANCE 0.1f #define MASA_COHERENCE_THRESHOLD 0.1f #define MASA_RATIO_TOLERANCE 0.1f -#ifdef NONBE_FIX_1034_DRY_MASA_RATIOS #define MASA_RATIO_THRESHOLD 0.015f -#else -#define MASA_RATIO_THRESHOLD 0.1f -#endif #define MASA_ANGLE_TOLERANCE 0.5f #define MASA_SUR_COH_THRESHOLD 1e-7f #define MASA_SUR_COH_PRECISION 1e7f diff --git a/lib_com/options.h b/lib_com/options.h index 549bc14a1..9b3351133 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -188,7 +188,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 actiate when USE_NEW_HRTF_BINARY_FILE_FORMAT and FIX_777_COMBI_RENDER_CONFIG_FILE are on )*/ -#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.c b/lib_enc/ivas_masa_enc.c index 9d1d3117b..ee6be5042 100644 --- a/lib_enc/ivas_masa_enc.c +++ b/lib_enc/ivas_masa_enc.c @@ -1241,9 +1241,7 @@ void ivas_masa_combine_directions( ambience2dir = 1.0f - ratioSum; hMeta->directional_meta[0].energy_ratio[j][i] = sumVecLen[j][i] / ( hMeta->directional_meta[0].energy_ratio[j][i] + hMeta->directional_meta[1].energy_ratio[j][i] + ambience2dir / 2.0f ); hMeta->directional_meta[1].energy_ratio[j][i] = 0.0f; -#ifdef NONBE_FIX_1034_DRY_MASA_RATIOS hMeta->common_meta.diffuse_to_total_ratio[j][i] = 1.0f - hMeta->directional_meta[0].energy_ratio[j][i]; -#endif if ( computeCoherence ) { ambience1dir = 1.0f - hMeta->directional_meta[0].energy_ratio[j][i]; @@ -1432,9 +1430,7 @@ static void detect_metadata_composition( { 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]; -#endif hMeta->directional_meta[0].azimuth[sf][band] = hMeta->directional_meta[1].azimuth[sf][band]; hMeta->directional_meta[0].elevation[sf][band] = hMeta->directional_meta[1].elevation[sf][band]; hMeta->directional_meta[0].energy_ratio[sf][band] = hMeta->directional_meta[1].energy_ratio[sf][band]; @@ -1511,11 +1507,7 @@ static void compensate_energy_ratios( uint8_t numDirs; hMeta = &( hMasa->masaMetadata ); -#ifdef NONBE_FIX_1034_DRY_MASA_RATIOS numDirs = hMasa->config.numberOfDirections; -#else - numDirs = hMeta->descriptive_meta.numberOfDirections + 1; -#endif for ( sf = 0; sf < MAX_PARAM_SPATIAL_SUBFRAMES; sf++ ) { @@ -2131,19 +2123,15 @@ static void copy_masa_metadata_subframe( ) { uint8_t dir; -#ifdef NONBE_FIX_1034_DRY_MASA_RATIOS uint8_t 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]; } -#endif mvr2r( hMetaFrom->directional_meta[dir].azimuth[sfFrom], hMetaTo->directional_meta[dir].azimuth[sfTo], MASA_FREQUENCY_BANDS ); mvr2r( hMetaFrom->directional_meta[dir].elevation[sfFrom], hMetaTo->directional_meta[dir].elevation[sfTo], MASA_FREQUENCY_BANDS ); mvr2r( hMetaFrom->directional_meta[dir].energy_ratio[sfFrom], hMetaTo->directional_meta[dir].energy_ratio[sfTo], MASA_FREQUENCY_BANDS ); -- GitLab From ada79919c344a73bf40734f4de61379c03d45f4e Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Tue, 8 Jul 2025 15:11:04 +0200 Subject: [PATCH 07/13] formatting --- lib_dec/ivas_ism_renderer.c | 6 +++--- lib_dec/ivas_mc_param_dec.c | 23 +++++++++++------------ 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/lib_dec/ivas_ism_renderer.c b/lib_dec/ivas_ism_renderer.c index 5664a611b..e5d8e0ffc 100644 --- a/lib_dec/ivas_ism_renderer.c +++ b/lib_dec/ivas_ism_renderer.c @@ -140,10 +140,10 @@ void ivas_ism_renderer_close( *-------------------------------------------------------------------------*/ void ivas_ism_render_sf( - 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 */ - float *output_f[], /* i/o: core-coder transport channels/object output */ - const int16_t n_samples_to_render /* i : output frame length per channel */ + float *output_f[], /* i/o: core-coder transport channels/object output */ + const int16_t n_samples_to_render /* i : output frame length per channel */ ) { int16_t i, j, k, j2; diff --git a/lib_dec/ivas_mc_param_dec.c b/lib_dec/ivas_mc_param_dec.c index c5f4a1856..a2cf2351a 100644 --- a/lib_dec/ivas_mc_param_dec.c +++ b/lib_dec/ivas_mc_param_dec.c @@ -1492,17 +1492,17 @@ void ivas_param_mc_dec_digest_tc( continue; } - /* generate mixing matrices */ - ivas_param_mc_get_mixing_matrices( hParamMC, - hSynthesisOutputSetup, - is_next_band ? cx_next_band : cx, - param_band_idx + is_next_band, - hParamMC->h_output_synthesis_cov_state.mixing_matrix, - hParamMC->h_output_synthesis_cov_state.mixing_matrix_res, - nchan_out_transport, - hParamMC->synthesis_conf, - nchan_transport, - nchan_out_cov ); + /* generate mixing matrices */ + ivas_param_mc_get_mixing_matrices( hParamMC, + hSynthesisOutputSetup, + is_next_band ? cx_next_band : cx, + param_band_idx + is_next_band, + hParamMC->h_output_synthesis_cov_state.mixing_matrix, + hParamMC->h_output_synthesis_cov_state.mixing_matrix_res, + nchan_out_transport, + hParamMC->synthesis_conf, + nchan_transport, + nchan_out_cov ); } } @@ -2431,7 +2431,6 @@ static void ivas_param_mc_get_mixing_matrices( } - /*------------------------------------------------------------------------- * param_mc_update_mixing_matrices() * -- GitLab From 6df7ffbd8262616ba1273ea9ad128c459b939072 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Tue, 8 Jul 2025 15:22:10 +0200 Subject: [PATCH 08/13] [cleanup] accept FIX_638_ENERGIE_IAC_ROM_TABLES --- lib_com/options.h | 1 - lib_rend/ivas_hrtf.c | 4 - lib_rend/ivas_objectRenderer_mix.c | 2 - lib_rend/ivas_rom_binaural_crend_head.c | 2 - lib_rend/ivas_rom_binaural_crend_head.h | 2 - lib_rend/ivas_rom_rend.c | 290 ------------------------ lib_rend/ivas_rom_rend.h | 13 -- lib_util/hrtf_file_reader.c | 4 - 8 files changed, 318 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 9b3351133..e7ccbd350 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -182,7 +182,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.c b/lib_rend/ivas_hrtf.c index 4bb146e5a..a4168fc9f 100644 --- a/lib_rend/ivas_hrtf.c +++ b/lib_rend/ivas_hrtf.c @@ -38,11 +38,7 @@ #include "wmc_auto.h" #include "ivas_prot.h" #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES #include "ivas_rom_binaural_crend_head.h" -#else -#include "ivas_rom_rend.h" -#endif #endif /*-----------------------------------------------------------------------* diff --git a/lib_rend/ivas_objectRenderer_mix.c b/lib_rend/ivas_objectRenderer_mix.c index 2f5ee1995..110633588 100644 --- a/lib_rend/ivas_objectRenderer_mix.c +++ b/lib_rend/ivas_objectRenderer_mix.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 #ifdef DEBUGGING #include "debug.h" #endif diff --git a/lib_rend/ivas_rom_binaural_crend_head.c b/lib_rend/ivas_rom_binaural_crend_head.c index 3d0cb08b7..559d1930d 100644 --- a/lib_rend/ivas_rom_binaural_crend_head.c +++ b/lib_rend/ivas_rom_binaural_crend_head.c @@ -7237,7 +7237,6 @@ const float CRendBin_Combined_BRIR_coeff_diffuse_im_16kHz[BINAURAL_CHANNELS][252 }; -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES /********************** default HRIR reverb rom tables **********************/ @@ -7582,7 +7581,6 @@ const float defaultHRIR_right_avg_power_16kHz[LR_IAC_LENGTH_NR_FC] = { }; #endif -#endif #undef WMC_TOOL_SKIP diff --git a/lib_rend/ivas_rom_binaural_crend_head.h b/lib_rend/ivas_rom_binaural_crend_head.h index a7d0ba1b7..0e4b616aa 100644 --- a/lib_rend/ivas_rom_binaural_crend_head.h +++ b/lib_rend/ivas_rom_binaural_crend_head.h @@ -348,7 +348,6 @@ extern float CRendBin_Combined_BRIR_coeff_im_16kHz[HRTF_LS_CHANNELS][BINAURAL_CH extern float CRendBin_Combined_BRIR_coeff_diffuse_re_16kHz[BINAURAL_CHANNELS][2522]; extern float CRendBin_Combined_BRIR_coeff_diffuse_im_16kHz[BINAURAL_CHANNELS][2522]; -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES /********************** default HRIR reverb rom tables **********************/ @@ -373,6 +372,5 @@ extern const float defaultHRIR_coherence_16kHz[LR_IAC_LENGTH_NR_FC]; extern const float defaultHRIR_left_avg_power_16kHz[LR_IAC_LENGTH_NR_FC]; extern const float defaultHRIR_right_avg_power_16kHz[LR_IAC_LENGTH_NR_FC]; #endif -#endif #endif /* _IVAS_ROM_BINAURAL_CREND_HEAD_ */ diff --git a/lib_rend/ivas_rom_rend.c b/lib_rend/ivas_rom_rend.c index 28621e211..4db36790f 100644 --- a/lib_rend/ivas_rom_rend.c +++ b/lib_rend/ivas_rom_rend.c @@ -300,296 +300,6 @@ const float SincTable[321] = 0.00000000f }; -#ifndef FIX_638_ENERGIE_IAC_ROM_TABLES - -const float defaultHRIR_coherence_48kHz[LR_IAC_LENGTH_NR_FC] = { - 0.983003f, 0.933450f, 0.789276f, 0.574420f, 0.340710f, 0.144220f, 0.018803f, 0.000000f, 0.000000f, - 0.000000f, 0.011939f, 0.035489f, 0.043188f, 0.042460f, 0.041788f, 0.038562f, 0.028911f, 0.017162f, - 0.011571f, 0.014176f, 0.019830f, 0.024590f, 0.029203f, 0.033346f, 0.033418f, 0.029627f, 0.027479f, - 0.027434f, 0.025152f, 0.019518f, 0.014728f, 0.014201f, 0.016131f, 0.016294f, 0.013154f, 0.008660f, - 0.005005f, 0.002594f, 0.001044f, 0.000207f, 0.000000f, 0.000000f, 0.000000f, 0.001110f, 0.003986f, - 0.007003f, 0.009546f, 0.011532f, 0.012412f, 0.011553f, 0.009156f, 0.006222f, 0.003565f, 0.001384f, - 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000032f, 0.000928f, 0.002118f, 0.003061f, 0.003575f, - 0.003780f, 0.003678f, 0.003110f, 0.002074f, 0.000856f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, - 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000217f, 0.000974f, 0.001807f, 0.002334f, - 0.002436f, 0.002105f, 0.001526f, 0.000907f, 0.000350f, 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.000238f, 0.000852f, 0.001293f, - 0.001529f, 0.001533f, 0.001314f, 0.000954f, 0.000521f, 0.000155f, 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.000025f, 0.000284f, 0.000620f, 0.000949f, 0.001274f, 0.001606f, 0.001922f, - 0.002195f, 0.002438f, 0.002687f, 0.002944f, 0.003172f, 0.003371f, 0.003577f, 0.003779f, 0.003915f, - 0.003973f, 0.003980f, 0.003925f, 0.003766f, 0.003501f, 0.003165f, 0.002778f, 0.002326f, 0.001806f, - 0.001257f, 0.000714f, 0.000211f, 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.000766f, 0.000537f, 0.000000f, - 0.001691f, 0.003307f, 0.001635f, 0.000000f, 0.001601f, 0.007549f, 0.000580f, 0.000000f, 0.002038f, - 0.010325f, 0.002155f, 0.000000f, 0.003524f, 0.009251f, 0.005131f, 0.000000f, 0.002286f, 0.006486f, - 0.005902f, 0.000000f, 0.000862f, 0.004570f, 0.004117f, 0.000000f, 0.000000f, 0.003237f, 0.001534f, - 0.000259f, 0.000199f, 0.001363f, 0.000878f, 0.000000f -}; - -const float defaultHRIR_left_avg_power_48kHz[LR_IAC_LENGTH_NR_FC] = { - 0.978675f, 0.972385f, 0.959650f, 0.951879f, 0.952823f, 0.955063f, 0.950664f, 0.942982f, 0.943810f, - 0.958261f, 0.974503f, 0.980941f, 0.976648f, 0.968551f, 0.962061f, 0.957250f, 0.952477f, 0.948144f, - 0.945467f, 0.943209f, 0.938266f, 0.930238f, 0.923288f, 0.921237f, 0.922151f, 0.920812f, 0.917157f, - 0.914639f, 0.914127f, 0.913461f, 0.911654f, 0.910596f, 0.912207f, 0.915559f, 0.917863f, 0.917787f, - 0.916699f, 0.916435f, 0.916819f, 0.916225f, 0.914005f, 0.911360f, 0.909508f, 0.908111f, 0.906186f, - 0.903433f, 0.900605f, 0.898518f, 0.896964f, 0.894917f, 0.891856f, 0.888506f, 0.885940f, 0.884055f, - 0.881583f, 0.877955f, 0.874417f, 0.872501f, 0.871444f, 0.869864f, 0.867858f, 0.866735f, 0.867122f, - 0.868200f, 0.868897f, 0.869335f, 0.870657f, 0.873538f, 0.877306f, 0.880880f, 0.884388f, 0.889165f, - 0.895880f, 0.903263f, 0.909833f, 0.916015f, 0.922891f, 0.930300f, 0.936807f, 0.941431f, 0.944709f, - 0.947777f, 0.950731f, 0.952379f, 0.951745f, 0.949423f, 0.946810f, 0.944141f, 0.940067f, 0.933702f, - 0.926635f, 0.920257f, 0.914054f, 0.906651f, 0.897863f, 0.888903f, 0.880740f, 0.872936f, 0.864423f, - 0.855129f, 0.846311f, 0.839117f, 0.833266f, 0.827747f, 0.822648f, 0.819728f, 0.819707f, 0.821561f, - 0.824008f, 0.827075f, 0.831626f, 0.837745f, 0.844233f, 0.849862f, 0.854703f, 0.859787f, 0.865473f, - 0.870700f, 0.874300f, 0.876656f, 0.879215f, 0.882133f, 0.883808f, 0.883431f, 0.881897f, 0.880360f, - 0.878707f, 0.875924f, 0.871595f, 0.866584f, 0.862066f, 0.858145f, 0.853844f, 0.848581f, 0.843210f, - 0.839021f, 0.835832f, 0.831948f, 0.826952f, 0.822178f, 0.818520f, 0.815229f, 0.811138f, 0.806307f, - 0.801887f, 0.798628f, 0.796047f, 0.793269f, 0.790369f, 0.788436f, 0.788212f, 0.789066f, 0.789775f, - 0.790300f, 0.791907f, 0.794977f, 0.798368f, 0.800889f, 0.802776f, 0.805127f, 0.808190f, 0.810879f, - 0.812195f, 0.812606f, 0.813423f, 0.814925f, 0.815870f, 0.815340f, 0.814251f, 0.814186f, 0.814754f, - 0.814664f, 0.813654f, 0.812703f, 0.812701f, 0.813418f, 0.813910f, 0.813739f, 0.813585f, 0.814454f, - 0.816299f, 0.817832f, 0.818221f, 0.818620f, 0.820797f, 0.824043f, 0.825888f, 0.826559f, 0.828411f, - 0.832083f, 0.835548f, 0.837384f, 0.838961f, 0.842275f, 0.846770f, 0.849996f, 0.851359f, 0.853124f, - 0.856257f, 0.857270f, 0.852207f, 0.842390f, 0.831251f, 0.816041f, 0.791907f, 0.759307f, 0.723333f, - 0.686290f, 0.644649f, 0.594838f, 0.539959f, 0.487712f, 0.440561f, 0.389905f, 0.323258f, 0.238454f, - 0.149256f, 0.077620f, 0.032652f, 0.010630f, 0.002462f, 0.000339f, 0.000025f, 0.000016f, 0.000016f, - 0.000015f, 0.000014f, 0.000011f, 0.000009f, 0.000009f, 0.000009f, 0.000007f, 0.000006f, 0.000006f, - 0.000007f, 0.000006f, 0.000005f, 0.000005f, 0.000006f, 0.000005f, 0.000005f, 0.000005f, 0.000005f, - 0.000005f, 0.000005f, 0.000005f, 0.000005f, 0.000005f, 0.000005f, 0.000005f, 0.000005f, 0.000005f, - 0.000005f, 0.000005f, 0.000005f, 0.000005f, 0.000005f -}; - -const float defaultHRIR_right_avg_power_48kHz[LR_IAC_LENGTH_NR_FC] = { - 0.978675f, 0.972385f, 0.959652f, 0.951882f, 0.952822f, 0.955062f, 0.950665f, 0.942984f, 0.943810f, - 0.958262f, 0.974501f, 0.980942f, 0.976647f, 0.968551f, 0.962062f, 0.957251f, 0.952476f, 0.948141f, - 0.945464f, 0.943208f, 0.938265f, 0.930238f, 0.923288f, 0.921237f, 0.922151f, 0.920812f, 0.917158f, - 0.914639f, 0.914125f, 0.913460f, 0.911652f, 0.910595f, 0.912207f, 0.915559f, 0.917865f, 0.917788f, - 0.916698f, 0.916433f, 0.916818f, 0.916224f, 0.914005f, 0.911361f, 0.909504f, 0.908110f, 0.906186f, - 0.903433f, 0.900605f, 0.898518f, 0.896965f, 0.894920f, 0.891858f, 0.888507f, 0.885940f, 0.884054f, - 0.881580f, 0.877954f, 0.874417f, 0.872502f, 0.871442f, 0.869862f, 0.867858f, 0.866735f, 0.867123f, - 0.868201f, 0.868897f, 0.869333f, 0.870655f, 0.873539f, 0.877309f, 0.880883f, 0.884387f, 0.889165f, - 0.895880f, 0.903264f, 0.909834f, 0.916014f, 0.922893f, 0.930302f, 0.936809f, 0.941431f, 0.944709f, - 0.947777f, 0.950731f, 0.952378f, 0.951746f, 0.949421f, 0.946811f, 0.944145f, 0.940067f, 0.933700f, - 0.926637f, 0.920257f, 0.914054f, 0.906653f, 0.897864f, 0.888905f, 0.880742f, 0.872937f, 0.864423f, - 0.855128f, 0.846312f, 0.839118f, 0.833269f, 0.827748f, 0.822649f, 0.819728f, 0.819710f, 0.821561f, - 0.824007f, 0.827074f, 0.831626f, 0.837745f, 0.844232f, 0.849861f, 0.854703f, 0.859787f, 0.865474f, - 0.870700f, 0.874300f, 0.876658f, 0.879216f, 0.882133f, 0.883807f, 0.883428f, 0.881895f, 0.880358f, - 0.878709f, 0.875925f, 0.871596f, 0.866586f, 0.862067f, 0.858144f, 0.853843f, 0.848581f, 0.843210f, - 0.839021f, 0.835833f, 0.831948f, 0.826952f, 0.822177f, 0.818518f, 0.815228f, 0.811137f, 0.806306f, - 0.801886f, 0.798627f, 0.796045f, 0.793268f, 0.790369f, 0.788437f, 0.788213f, 0.789064f, 0.789770f, - 0.790299f, 0.791906f, 0.794977f, 0.798369f, 0.800890f, 0.802778f, 0.805130f, 0.808191f, 0.810879f, - 0.812198f, 0.812607f, 0.813424f, 0.814926f, 0.815872f, 0.815339f, 0.814254f, 0.814188f, 0.814757f, - 0.814665f, 0.813653f, 0.812704f, 0.812700f, 0.813416f, 0.813908f, 0.813738f, 0.813584f, 0.814454f, - 0.816300f, 0.817832f, 0.818221f, 0.818620f, 0.820796f, 0.824044f, 0.825889f, 0.826559f, 0.828413f, - 0.832084f, 0.835548f, 0.837383f, 0.838960f, 0.842272f, 0.846766f, 0.849995f, 0.851358f, 0.853121f, - 0.856258f, 0.857268f, 0.852209f, 0.842391f, 0.831252f, 0.816040f, 0.791907f, 0.759307f, 0.723333f, - 0.686288f, 0.644648f, 0.594838f, 0.539959f, 0.487712f, 0.440562f, 0.389904f, 0.323259f, 0.238454f, - 0.149256f, 0.077620f, 0.032652f, 0.010630f, 0.002462f, 0.000339f, 0.000025f, 0.000016f, 0.000016f, - 0.000015f, 0.000014f, 0.000011f, 0.000009f, 0.000009f, 0.000009f, 0.000007f, 0.000006f, 0.000006f, - 0.000007f, 0.000006f, 0.000005f, 0.000005f, 0.000006f, 0.000005f, 0.000005f, 0.000005f, 0.000005f, - 0.000005f, 0.000005f, 0.000005f, 0.000005f, 0.000005f, 0.000005f, 0.000005f, 0.000005f, 0.000005f, - 0.000005f, 0.000005f, 0.000005f, 0.000005f, 0.000005f -}; - -const float defaultHRIR_coherence_32kHz[LR_IAC_LENGTH_NR_FC] = { - 0.976959f, 0.962817f, 0.892107f, 0.783427f, 0.649433f, 0.488372f, 0.336040f, 0.196803f, 0.094108f, - 0.016852f, 0.004815f, 0.000000f, 0.000000f, 0.000000f, 0.002703f, 0.009460f, 0.024631f, 0.038937f, - 0.041367f, 0.041308f, 0.039589f, 0.039056f, 0.037048f, 0.032828f, 0.024623f, 0.015933f, 0.009282f, - 0.007047f, 0.007754f, 0.011823f, 0.015553f, 0.018773f, 0.021834f, 0.024812f, 0.027619f, 0.028707f, - 0.028648f, 0.026125f, 0.024072f, 0.022724f, 0.022507f, 0.022144f, 0.020064f, 0.016587f, 0.012177f, - 0.009732f, 0.008764f, 0.010014f, 0.011423f, 0.012307f, 0.010938f, 0.008551f, 0.005485f, 0.002935f, - 0.001054f, 0.000176f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, - 0.000000f, 0.000000f, 0.000231f, 0.001386f, 0.003010f, 0.004946f, 0.006482f, 0.007843f, 0.008942f, - 0.009171f, 0.008905f, 0.007532f, 0.005772f, 0.003756f, 0.001923f, 0.000617f, 0.000103f, 0.000000f, - 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, - 0.000000f, 0.000265f, 0.000706f, 0.000947f, 0.001119f, 0.001185f, 0.001040f, 0.000772f, 0.000221f, - 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.000099f, 0.000345f, 0.000565f, 0.000710f, 0.000581f, 0.000331f, 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.000098f, 0.000341f, 0.000584f, 0.000793f, - 0.000876f, 0.000853f, 0.000759f, 0.000512f, 0.000273f, 0.000045f, 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.000011f, - 0.000039f, 0.000157f, 0.000303f, 0.000474f, 0.000664f, 0.000865f, 0.001073f, 0.001281f, 0.001488f, - 0.001698f, 0.001906f, 0.002099f, 0.002268f, 0.002421f, 0.002545f, 0.002666f, 0.002785f, 0.002898f, - 0.003010f, 0.003124f, 0.003262f, 0.003417f, 0.003642f, 0.003884f, 0.004155f, 0.004443f, 0.004744f, - 0.005073f, 0.005422f, 0.005784f, 0.006121f, 0.006428f, 0.006690f, 0.006905f, 0.007096f, 0.007241f, - 0.007305f, 0.007315f, 0.007117f, 0.006840f, 0.006446f, 0.005915f, 0.005314f, 0.004568f, 0.003781f, - 0.002967f, 0.002550f, 0.002355f, 0.002493f, 0.002520f -}; - -const float defaultHRIR_left_avg_power_32kHz[LR_IAC_LENGTH_NR_FC] = { - 1.042842f, 1.041052f, 1.032098f, 1.024347f, 1.017398f, 1.019204f, 1.022140f, 1.026773f, 1.026684f, - 1.024560f, 1.019019f, 1.016692f, 1.016507f, 1.025484f, 1.035123f, 1.045753f, 1.050401f, 1.052033f, - 1.047590f, 1.042551f, 1.037116f, 1.034266f, 1.031619f, 1.029278f, 1.025989f, 1.022575f, 1.019610f, - 1.017442f, 1.015805f, 1.012657f, 1.008261f, 1.001990f, 0.995937f, 0.990744f, 0.988777f, 0.988277f, - 0.988755f, 0.987563f, 0.985600f, 0.982481f, 0.980182f, 0.978414f, 0.977951f, 0.977129f, 0.976068f, - 0.974020f, 0.972563f, 0.971992f, 0.973446f, 0.975452f, 0.977643f, 0.978631f, 0.978818f, 0.977682f, - 0.976742f, 0.976096f, 0.975927f, 0.975729f, 0.974941f, 0.973370f, 0.971276f, 0.968762f, 0.966461f, - 0.964481f, 0.962731f, 0.960904f, 0.958549f, 0.955708f, 0.952543f, 0.949546f, 0.946857f, 0.944631f, - 0.942410f, 0.939997f, 0.936815f, 0.933278f, 0.929505f, 0.926271f, 0.923282f, 0.920659f, 0.917696f, - 0.914482f, 0.910602f, 0.906806f, 0.903065f, 0.900364f, 0.897894f, 0.895772f, 0.893323f, 0.890740f, - 0.887944f, 0.885641f, 0.883667f, 0.882835f, 0.882051f, 0.881336f, 0.880121f, 0.878813f, 0.877633f, - 0.877223f, 0.877327f, 0.878409f, 0.879421f, 0.880327f, 0.881091f, 0.882024f, 0.883779f, 0.886402f, - 0.889602f, 0.893152f, 0.896459f, 0.899400f, 0.902225f, 0.905146f, 0.908573f, 0.912109f, 0.915718f, - 0.918254f, 0.920227f, 0.921355f, 0.922089f, 0.922760f, 0.923576f, 0.924088f, 0.924398f, 0.923115f, - 0.921260f, 0.918548f, 0.915643f, 0.912707f, 0.909842f, 0.906416f, 0.902615f, 0.897332f, 0.891877f, - 0.886166f, 0.880998f, 0.875991f, 0.871078f, 0.865522f, 0.859537f, 0.852717f, 0.846083f, 0.839728f, - 0.833972f, 0.828308f, 0.822411f, 0.816009f, 0.809271f, 0.802578f, 0.796320f, 0.790714f, 0.785846f, - 0.781192f, 0.776652f, 0.772249f, 0.767940f, 0.764926f, 0.762667f, 0.761540f, 0.761326f, 0.761372f, - 0.761547f, 0.761950f, 0.762506f, 0.764263f, 0.766400f, 0.769105f, 0.771504f, 0.773644f, 0.775056f, - 0.776462f, 0.777865f, 0.779929f, 0.781942f, 0.783881f, 0.784915f, 0.785562f, 0.785567f, 0.785690f, - 0.785891f, 0.786286f, 0.786348f, 0.785912f, 0.784408f, 0.782509f, 0.780101f, 0.777798f, 0.775564f, - 0.773205f, 0.770446f, 0.767088f, 0.762953f, 0.758652f, 0.754459f, 0.750714f, 0.747266f, 0.743818f, - 0.740063f, 0.735847f, 0.731497f, 0.727285f, 0.723759f, 0.720587f, 0.717650f, 0.714166f, 0.710382f, - 0.706148f, 0.702029f, 0.698046f, 0.694494f, 0.690839f, 0.687115f, 0.682535f, 0.677735f, 0.672604f, - 0.667663f, 0.662868f, 0.658475f, 0.654061f, 0.649634f, 0.644689f, 0.639750f, 0.634821f, 0.630767f, - 0.627153f, 0.624422f, 0.621650f, 0.618850f, 0.615731f, 0.613069f, 0.611089f, 0.610598f, 0.610566f, - 0.610880f, 0.610933f, 0.610809f, 0.611930f, 0.614079f, 0.617771f, 0.622653f, 0.628199f, 0.635210f, - 0.645081f, 0.656860f, 0.669006f, 0.673510f, 0.666552f, 0.628172f, 0.575127f, 0.494850f, 0.413951f, - 0.332637f, 0.280816f, 0.241903f, 0.222353f, 0.218443f -}; - -const float defaultHRIR_right_avg_power_32kHz[LR_IAC_LENGTH_NR_FC] = { - 1.042841f, 1.041051f, 1.032097f, 1.024346f, 1.017399f, 1.019202f, 1.022138f, 1.026772f, 1.026684f, - 1.024560f, 1.019019f, 1.016691f, 1.016506f, 1.025485f, 1.035123f, 1.045752f, 1.050401f, 1.052035f, - 1.047590f, 1.042551f, 1.037115f, 1.034265f, 1.031619f, 1.029280f, 1.025989f, 1.022573f, 1.019609f, - 1.017441f, 1.015805f, 1.012660f, 1.008264f, 1.001991f, 0.995937f, 0.990744f, 0.988778f, 0.988278f, - 0.988755f, 0.987564f, 0.985601f, 0.982480f, 0.980182f, 0.978415f, 0.977953f, 0.977129f, 0.976065f, - 0.974019f, 0.972563f, 0.971995f, 0.973448f, 0.975452f, 0.977643f, 0.978632f, 0.978821f, 0.977685f, - 0.976745f, 0.976097f, 0.975927f, 0.975729f, 0.974941f, 0.973370f, 0.971276f, 0.968759f, 0.966458f, - 0.964480f, 0.962731f, 0.960906f, 0.958547f, 0.955706f, 0.952543f, 0.949546f, 0.946857f, 0.944629f, - 0.942409f, 0.939999f, 0.936815f, 0.933278f, 0.929507f, 0.926270f, 0.923280f, 0.920660f, 0.917696f, - 0.914481f, 0.910601f, 0.906806f, 0.903066f, 0.900365f, 0.897895f, 0.895772f, 0.893323f, 0.890740f, - 0.887942f, 0.885640f, 0.883669f, 0.882835f, 0.882049f, 0.881335f, 0.880120f, 0.878812f, 0.877632f, - 0.877223f, 0.877328f, 0.878410f, 0.879422f, 0.880327f, 0.881092f, 0.882026f, 0.883781f, 0.886402f, - 0.889601f, 0.893151f, 0.896457f, 0.899399f, 0.902224f, 0.905146f, 0.908576f, 0.912111f, 0.915716f, - 0.918254f, 0.920227f, 0.921354f, 0.922087f, 0.922759f, 0.923576f, 0.924090f, 0.924401f, 0.923115f, - 0.921259f, 0.918547f, 0.915643f, 0.912708f, 0.909842f, 0.906416f, 0.902617f, 0.897334f, 0.891879f, - 0.886168f, 0.881000f, 0.875992f, 0.871078f, 0.865522f, 0.859538f, 0.852719f, 0.846085f, 0.839728f, - 0.833973f, 0.828309f, 0.822411f, 0.816009f, 0.809271f, 0.802579f, 0.796321f, 0.790714f, 0.785846f, - 0.781192f, 0.776653f, 0.772250f, 0.767940f, 0.764926f, 0.762667f, 0.761541f, 0.761325f, 0.761371f, - 0.761548f, 0.761950f, 0.762504f, 0.764263f, 0.766400f, 0.769104f, 0.771504f, 0.773644f, 0.775054f, - 0.776461f, 0.777866f, 0.779929f, 0.781942f, 0.783879f, 0.784913f, 0.785561f, 0.785567f, 0.785690f, - 0.785891f, 0.786285f, 0.786348f, 0.785913f, 0.784409f, 0.782510f, 0.780103f, 0.777798f, 0.775563f, - 0.773206f, 0.770449f, 0.767090f, 0.762954f, 0.758652f, 0.754458f, 0.750712f, 0.747266f, 0.743818f, - 0.740062f, 0.735846f, 0.731497f, 0.727285f, 0.723759f, 0.720587f, 0.717649f, 0.714164f, 0.710381f, - 0.706148f, 0.702028f, 0.698044f, 0.694493f, 0.690838f, 0.687113f, 0.682535f, 0.677735f, 0.672602f, - 0.667662f, 0.662869f, 0.658475f, 0.654061f, 0.649632f, 0.644687f, 0.639749f, 0.634820f, 0.630767f, - 0.627154f, 0.624423f, 0.621650f, 0.618849f, 0.615732f, 0.613069f, 0.611090f, 0.610599f, 0.610566f, - 0.610881f, 0.610933f, 0.610811f, 0.611930f, 0.614078f, 0.617770f, 0.622653f, 0.628199f, 0.635210f, - 0.645082f, 0.656861f, 0.669007f, 0.673511f, 0.666551f, 0.628170f, 0.575125f, 0.494849f, 0.413951f, - 0.332639f, 0.280817f, 0.241904f, 0.222354f, 0.218443f -}; - -const float defaultHRIR_coherence_16kHz[LR_IAC_LENGTH_NR_FC] = { - 0.969495f, 0.969495f, 0.955351f, 0.919989f, 0.884627f, 0.842799f, 0.775108f, 0.707416f, 0.639724f, - 0.559264f, 0.478804f, 0.398344f, 0.327187f, 0.258355f, 0.189524f, 0.134064f, 0.087519f, 0.040974f, - 0.011416f, 0.007339f, 0.003262f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, - 0.000000f, 0.002562f, 0.005763f, 0.008965f, 0.014937f, 0.022756f, 0.030575f, 0.035595f, 0.036416f, - 0.037238f, 0.037747f, 0.037005f, 0.036264f, 0.035523f, 0.035506f, 0.035489f, 0.035472f, 0.034043f, - 0.032261f, 0.030479f, 0.027264f, 0.023092f, 0.018921f, 0.015179f, 0.012080f, 0.008982f, 0.006557f, - 0.006827f, 0.007098f, 0.007368f, 0.009187f, 0.011006f, 0.012825f, 0.014250f, 0.015575f, 0.016901f, - 0.018085f, 0.019174f, 0.020264f, 0.021306f, 0.022276f, 0.023246f, 0.023984f, 0.023794f, 0.023604f, - 0.023414f, 0.022260f, 0.021105f, 0.019951f, 0.019250f, 0.018662f, 0.018074f, 0.017860f, 0.017894f, - 0.017928f, 0.017558f, 0.016581f, 0.015604f, 0.014403f, 0.012303f, 0.010203f, 0.008103f, 0.006887f, - 0.005671f, 0.004455f, 0.004657f, 0.005213f, 0.005769f, 0.006365f, 0.006987f, 0.007608f, 0.007649f, - 0.006819f, 0.005989f, 0.004992f, 0.003328f, 0.001664f, 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.000038f, 0.000229f, - 0.000420f, 0.000610f, 0.001290f, 0.001970f, 0.002649f, 0.003127f, 0.003555f, 0.003982f, 0.004113f, - 0.004046f, 0.003978f, 0.003618f, 0.002820f, 0.002021f, 0.001296f, 0.000864f, 0.000432f, 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.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.000005f, 0.000011f, 0.000018f, 0.000743f, 0.001947f, 0.003152f, 0.004819f, - 0.007179f, 0.009539f, 0.012160f, 0.015826f, 0.019491f, 0.023157f, 0.028625f, 0.034093f, 0.039562f, - 0.046791f, 0.054462f, 0.062132f, 0.065200f, 0.065200f -}; - -const float defaultHRIR_left_avg_power_16kHz[LR_IAC_LENGTH_NR_FC] = { - 1.112848f, 1.112848f, 1.110615f, 1.105032f, 1.099449f, 1.094383f, 1.091385f, 1.088386f, 1.085388f, - 1.087986f, 1.090583f, 1.093181f, 1.095718f, 1.098238f, 1.100760f, 1.100829f, 1.099264f, 1.097699f, - 1.095677f, 1.092970f, 1.090263f, 1.088142f, 1.088367f, 1.088593f, 1.088819f, 1.092532f, 1.096246f, - 1.099959f, 1.104778f, 1.109873f, 1.114969f, 1.118806f, 1.121804f, 1.124803f, 1.125952f, 1.124327f, - 1.122702f, 1.120550f, 1.116291f, 1.112033f, 1.107774f, 1.105150f, 1.102527f, 1.099903f, 1.098607f, - 1.097642f, 1.096677f, 1.094771f, 1.092238f, 1.089705f, 1.086741f, 1.083131f, 1.079521f, 1.076294f, - 1.074604f, 1.072914f, 1.071224f, 1.070018f, 1.068812f, 1.067606f, 1.064075f, 1.059962f, 1.055849f, - 1.051324f, 1.046526f, 1.041727f, 1.038409f, 1.037312f, 1.036215f, 1.035479f, 1.036192f, 1.036905f, - 1.037618f, 1.035536f, 1.033453f, 1.031371f, 1.028051f, 1.024421f, 1.020792f, 1.018471f, 1.017022f, - 1.015574f, 1.014441f, 1.013780f, 1.013120f, 1.012053f, 1.009355f, 1.006658f, 1.003961f, 1.001331f, - 0.998701f, 0.996071f, 0.995600f, 0.995668f, 0.995737f, 0.996093f, 0.996641f, 0.997189f, 0.997005f, - 0.995722f, 0.994439f, 0.993136f, 0.991757f, 0.990377f, 0.988997f, 0.988491f, 0.987986f, 0.987480f, - 0.985997f, 0.984269f, 0.982542f, 0.980066f, 0.977092f, 0.974118f, 0.971621f, 0.969840f, 0.968058f, - 0.966366f, 0.965026f, 0.963687f, 0.962348f, 0.958809f, 0.955271f, 0.951732f, 0.947645f, 0.943422f, - 0.939198f, 0.936257f, 0.934171f, 0.932086f, 0.930008f, 0.927942f, 0.925876f, 0.923250f, 0.918385f, - 0.913521f, 0.908656f, 0.903702f, 0.898749f, 0.893795f, 0.891002f, 0.888749f, 0.886496f, 0.883996f, - 0.881331f, 0.878666f, 0.874814f, 0.869183f, 0.863553f, 0.858015f, 0.852851f, 0.847687f, 0.842523f, - 0.840022f, 0.837520f, 0.835019f, 0.831781f, 0.828359f, 0.824937f, 0.820011f, 0.814082f, 0.808153f, - 0.802713f, 0.798009f, 0.793305f, 0.789023f, 0.786429f, 0.783835f, 0.781241f, 0.777028f, 0.772815f, - 0.768602f, 0.763134f, 0.757353f, 0.751571f, 0.747112f, 0.743534f, 0.739956f, 0.736838f, 0.734410f, - 0.731982f, 0.729034f, 0.724009f, 0.718984f, 0.713959f, 0.708439f, 0.702918f, 0.697398f, 0.694412f, - 0.692061f, 0.689710f, 0.687330f, 0.684932f, 0.682534f, 0.678706f, 0.672732f, 0.666759f, 0.660939f, - 0.655737f, 0.650536f, 0.645334f, 0.644222f, 0.643110f, 0.641998f, 0.639788f, 0.637303f, 0.634818f, - 0.629683f, 0.622782f, 0.615880f, 0.609823f, 0.605032f, 0.600241f, 0.596372f, 0.596194f, 0.596015f, - 0.595837f, 0.592403f, 0.588969f, 0.585535f, 0.577842f, 0.569084f, 0.560326f, 0.553880f, 0.548977f, - 0.544074f, 0.541240f, 0.541511f, 0.541781f, 0.540837f, 0.535040f, 0.529243f, 0.523446f, 0.510870f, - 0.498293f, 0.485717f, 0.479851f, 0.475663f, 0.471475f, 0.473848f, 0.480595f, 0.487343f, 0.489727f, - 0.485566f, 0.481405f, 0.471747f, 0.440099f, 0.408451f, 0.376804f, 0.330744f, 0.284685f, 0.238626f, - 0.203638f, 0.171419f, 0.139199f, 0.126312f, 0.126312f -}; - -const float defaultHRIR_right_avg_power_16kHz[LR_IAC_LENGTH_NR_FC] = { - 1.112848f, 1.112848f, 1.110615f, 1.105033f, 1.099450f, 1.094384f, 1.091385f, 1.088385f, 1.085385f, - 1.087983f, 1.090582f, 1.093180f, 1.095717f, 1.098238f, 1.100758f, 1.100828f, 1.099264f, 1.097700f, - 1.095678f, 1.092969f, 1.090259f, 1.088138f, 1.088365f, 1.088592f, 1.088819f, 1.092533f, 1.096246f, - 1.099960f, 1.104778f, 1.109872f, 1.114967f, 1.118803f, 1.121802f, 1.124800f, 1.125950f, 1.124325f, - 1.122701f, 1.120550f, 1.116290f, 1.112030f, 1.107770f, 1.105148f, 1.102526f, 1.099904f, 1.098608f, - 1.097642f, 1.096677f, 1.094770f, 1.092237f, 1.089704f, 1.086740f, 1.083130f, 1.079521f, 1.076295f, - 1.074604f, 1.072914f, 1.071223f, 1.070018f, 1.068813f, 1.067608f, 1.064076f, 1.059963f, 1.055849f, - 1.051324f, 1.046525f, 1.041726f, 1.038407f, 1.037310f, 1.036213f, 1.035478f, 1.036191f, 1.036904f, - 1.037617f, 1.035535f, 1.033453f, 1.031372f, 1.028051f, 1.024421f, 1.020791f, 1.018470f, 1.017021f, - 1.015573f, 1.014440f, 1.013780f, 1.013121f, 1.012054f, 1.009357f, 1.006659f, 1.003962f, 1.001331f, - 0.998700f, 0.996070f, 0.995598f, 0.995666f, 0.995735f, 0.996091f, 0.996639f, 0.997188f, 0.997004f, - 0.995722f, 0.994439f, 0.993137f, 0.991758f, 0.990378f, 0.988998f, 0.988492f, 0.987987f, 0.987481f, - 0.985997f, 0.984269f, 0.982541f, 0.980065f, 0.977091f, 0.974118f, 0.971621f, 0.969841f, 0.968060f, - 0.966368f, 0.965029f, 0.963689f, 0.962350f, 0.958810f, 0.955270f, 0.951731f, 0.947643f, 0.943419f, - 0.939196f, 0.936255f, 0.934170f, 0.932086f, 0.930009f, 0.927943f, 0.925877f, 0.923251f, 0.918386f, - 0.913520f, 0.908655f, 0.903701f, 0.898748f, 0.893795f, 0.891001f, 0.888748f, 0.886495f, 0.883995f, - 0.881330f, 0.878665f, 0.874814f, 0.869184f, 0.863554f, 0.858016f, 0.852852f, 0.847687f, 0.842522f, - 0.840021f, 0.837520f, 0.835019f, 0.831781f, 0.828358f, 0.824936f, 0.820010f, 0.814081f, 0.808152f, - 0.802713f, 0.798009f, 0.793305f, 0.789024f, 0.786430f, 0.783837f, 0.781244f, 0.777029f, 0.772815f, - 0.768601f, 0.763133f, 0.757353f, 0.751572f, 0.747112f, 0.743534f, 0.739956f, 0.736837f, 0.734410f, - 0.731982f, 0.729034f, 0.724009f, 0.718984f, 0.713959f, 0.708439f, 0.702919f, 0.697399f, 0.694414f, - 0.692063f, 0.689712f, 0.687331f, 0.684932f, 0.682532f, 0.678704f, 0.672731f, 0.666759f, 0.660941f, - 0.655738f, 0.650534f, 0.645331f, 0.644220f, 0.643109f, 0.641999f, 0.639789f, 0.637304f, 0.634819f, - 0.629684f, 0.622783f, 0.615881f, 0.609824f, 0.605033f, 0.600242f, 0.596373f, 0.596194f, 0.596015f, - 0.595837f, 0.592403f, 0.588969f, 0.585535f, 0.577842f, 0.569083f, 0.560324f, 0.553879f, 0.548977f, - 0.544074f, 0.541241f, 0.541511f, 0.541781f, 0.540838f, 0.535041f, 0.529243f, 0.523446f, 0.510869f, - 0.498293f, 0.485717f, 0.479851f, 0.475663f, 0.471475f, 0.473848f, 0.480595f, 0.487343f, 0.489727f, - 0.485566f, 0.481405f, 0.471746f, 0.440098f, 0.408450f, 0.376802f, 0.330743f, 0.284685f, 0.238626f, - 0.203638f, 0.171419f, 0.139199f, 0.126311f, 0.126311f -}; -#endif /*----------------------------------------------------------------------------------* * t-design and SN3D normalization table diff --git a/lib_rend/ivas_rom_rend.h b/lib_rend/ivas_rom_rend.h index 5f1f2e476..e4d4c4f91 100644 --- a/lib_rend/ivas_rom_rend.h +++ b/lib_rend/ivas_rom_rend.h @@ -96,19 +96,6 @@ extern const int16_t HRTF_MODEL_N_CPTS_VAR[HRTF_MODEL_N_SECTIONS]; extern const float SincTable[321]; -#ifndef FIX_638_ENERGIE_IAC_ROM_TABLES -extern const float defaultHRIR_coherence_48kHz[LR_IAC_LENGTH_NR_FC]; -extern const float defaultHRIR_left_avg_power_48kHz[LR_IAC_LENGTH_NR_FC]; -extern const float defaultHRIR_right_avg_power_48kHz[LR_IAC_LENGTH_NR_FC]; - -extern const float defaultHRIR_coherence_32kHz[LR_IAC_LENGTH_NR_FC]; -extern const float defaultHRIR_left_avg_power_32kHz[LR_IAC_LENGTH_NR_FC]; -extern const float defaultHRIR_right_avg_power_32kHz[LR_IAC_LENGTH_NR_FC]; - -extern const float defaultHRIR_coherence_16kHz[LR_IAC_LENGTH_NR_FC]; -extern const float defaultHRIR_left_avg_power_16kHz[LR_IAC_LENGTH_NR_FC]; -extern const float defaultHRIR_right_avg_power_16kHz[LR_IAC_LENGTH_NR_FC]; -#endif /*----------------------------------------------------------------------------------* * t-design and SN3D normalization table diff --git a/lib_util/hrtf_file_reader.c b/lib_util/hrtf_file_reader.c index 6b07eb5af..9a1f31f65 100644 --- a/lib_util/hrtf_file_reader.c +++ b/lib_util/hrtf_file_reader.c @@ -36,11 +36,7 @@ #include "ivas_prot_rend.h" #include "ivas_prot.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 3cd052d09d77d75cadfeea5521ba5bce845cc816 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Tue, 8 Jul 2025 15:22:12 +0200 Subject: [PATCH 09/13] [cleanup] accept FIX_INV_DIFFUSE_WEIGHT --- lib_com/options.h | 1 - lib_rend/ivas_crend.c | 196 ------------------------ lib_rend/ivas_rom_binaural_crend_head.c | 60 -------- lib_rend/ivas_rom_binaural_crend_head.h | 60 -------- lib_rend/ivas_stat_rend.h | 9 -- lib_util/hrtf_file_reader.c | 18 --- 6 files changed, 344 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index e7ccbd350..4e863a85b 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -183,7 +183,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_WARNING_RENDER_CONFIG /* Orange: fix warning on windows build */ -#define FIX_INV_DIFFUSE_WEIGHT /* Orange : Fix error in energy compensation in late binaural */ #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 actiate when USE_NEW_HRTF_BINARY_FILE_FORMAT and FIX_777_COMBI_RENDER_CONFIG_FILE are on )*/ diff --git a/lib_rend/ivas_crend.c b/lib_rend/ivas_crend.c index 62bc41fc3..9ba3d224f 100644 --- a/lib_rend/ivas_crend.c +++ b/lib_rend/ivas_crend.c @@ -69,21 +69,14 @@ ivas_error ivas_hrtf_init( hHrtf->max_num_iterations = 0; hHrtf->gain_lfe = 0; hHrtf->index_frequency_max_diffuse = 0; -#ifdef FIX_INV_DIFFUSE_WEIGHT hHrtf->same_inv_diffuse_weight = 1; -#endif for ( i = 0; i < MAX_INTERN_CHANNELS; i++ ) { -#ifndef FIX_INV_DIFFUSE_WEIGHT - hHrtf->inv_diffuse_weight[i] = 0; -#endif for ( j = 0; j < BINAURAL_CHANNELS; j++ ) { -#ifdef FIX_INV_DIFFUSE_WEIGHT hHrtf->inv_diffuse_weight[j][i] = 0; -#endif hHrtf->num_iterations[i][j] = 0; hHrtf->pIndex_frequency_max[i][j] = NULL; hHrtf->pOut_to_bin_re[i][j] = NULL; @@ -361,23 +354,11 @@ static ivas_error ivas_rend_initCrend( if ( output_Fs == 48000 ) { -#ifndef FIX_INV_DIFFUSE_WEIGHT - if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) - { - hHrtf->inv_diffuse_weight[i] = CRendBin_Combined_BRIR_inv_diffuse_weight_48kHz[tmp]; - } - else - { - hHrtf->inv_diffuse_weight[i] = CRendBin_Combined_HRIR_inv_diffuse_weight_48kHz[tmp]; - } -#endif for ( j = 0; j < BINAURAL_CHANNELS; j++ ) { if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) { -#ifdef FIX_INV_DIFFUSE_WEIGHT hHrtf->inv_diffuse_weight[j][i] = CRendBin_Combined_BRIR_inv_diffuse_weight_48kHz[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]; hHrtf->pOut_to_bin_re[i][j] = CRendBin_Combined_BRIR_coeff_re_48kHz[tmp][j]; @@ -385,9 +366,7 @@ static ivas_error ivas_rend_initCrend( } else { -#ifdef FIX_INV_DIFFUSE_WEIGHT hHrtf->inv_diffuse_weight[j][i] = CRendBin_Combined_HRIR_inv_diffuse_weight_48kHz[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]; hHrtf->pOut_to_bin_re[i][j] = CRendBin_Combined_HRIR_coeff_re_48kHz[tmp][j]; @@ -397,23 +376,11 @@ static ivas_error ivas_rend_initCrend( } else if ( output_Fs == 32000 ) { -#ifndef FIX_INV_DIFFUSE_WEIGHT - if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) - { - hHrtf->inv_diffuse_weight[i] = CRendBin_Combined_BRIR_inv_diffuse_weight_32kHz[tmp]; - } - else - { - hHrtf->inv_diffuse_weight[i] = CRendBin_Combined_HRIR_inv_diffuse_weight_32kHz[tmp]; - } -#endif for ( j = 0; j < BINAURAL_CHANNELS; j++ ) { if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) { -#ifdef FIX_INV_DIFFUSE_WEIGHT hHrtf->inv_diffuse_weight[j][i] = CRendBin_Combined_BRIR_inv_diffuse_weight_32kHz[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]; hHrtf->pOut_to_bin_re[i][j] = CRendBin_Combined_BRIR_coeff_re_32kHz[tmp][j]; @@ -421,9 +388,7 @@ static ivas_error ivas_rend_initCrend( } else { -#ifdef FIX_INV_DIFFUSE_WEIGHT hHrtf->inv_diffuse_weight[j][i] = CRendBin_Combined_HRIR_inv_diffuse_weight_32kHz[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]; hHrtf->pOut_to_bin_re[i][j] = CRendBin_Combined_HRIR_coeff_re_32kHz[tmp][j]; @@ -433,23 +398,11 @@ static ivas_error ivas_rend_initCrend( } else if ( output_Fs == 16000 ) { -#ifndef FIX_INV_DIFFUSE_WEIGHT - if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) - { - hHrtf->inv_diffuse_weight[i] = CRendBin_Combined_BRIR_inv_diffuse_weight_16kHz[tmp]; - } - else - { - hHrtf->inv_diffuse_weight[i] = CRendBin_Combined_HRIR_inv_diffuse_weight_16kHz[tmp]; - } -#endif for ( j = 0; j < BINAURAL_CHANNELS; j++ ) { if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) { -#ifdef FIX_INV_DIFFUSE_WEIGHT hHrtf->inv_diffuse_weight[j][i] = CRendBin_Combined_BRIR_inv_diffuse_weight_16kHz[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]; @@ -458,9 +411,7 @@ static ivas_error ivas_rend_initCrend( } else { -#ifdef FIX_INV_DIFFUSE_WEIGHT hHrtf->inv_diffuse_weight[j][i] = CRendBin_Combined_HRIR_inv_diffuse_weight_16kHz[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]; @@ -488,14 +439,9 @@ static ivas_error ivas_rend_initCrend( for ( i = 0; i < hHrtf->max_num_ir; i++ ) { -#ifndef FIX_INV_DIFFUSE_WEIGHT - hHrtf->inv_diffuse_weight[i] = CRendBin_HOA3_HRIR_inv_diffuse_weight_48kHz[i]; -#endif for ( j = 0; j < BINAURAL_CHANNELS; j++ ) { -#ifdef FIX_INV_DIFFUSE_WEIGHT hHrtf->inv_diffuse_weight[j][i] = CRendBin_HOA3_HRIR_inv_diffuse_weight_48kHz[j][i]; -#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]; hHrtf->pOut_to_bin_re[i][j] = CRendBin_HOA3_HRIR_coeff_re_48kHz[i][j]; @@ -518,15 +464,10 @@ static ivas_error ivas_rend_initCrend( for ( i = 0; i < hHrtf->max_num_ir; i++ ) { -#ifndef FIX_INV_DIFFUSE_WEIGHT - hHrtf->inv_diffuse_weight[i] = CRendBin_HOA3_HRIR_inv_diffuse_weight_32kHz[i]; -#endif for ( j = 0; j < BINAURAL_CHANNELS; j++ ) { -#ifdef FIX_INV_DIFFUSE_WEIGHT hHrtf->inv_diffuse_weight[j][i] = CRendBin_HOA3_HRIR_inv_diffuse_weight_32kHz[j][i]; -#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]; hHrtf->pOut_to_bin_re[i][j] = CRendBin_HOA3_HRIR_coeff_re_32kHz[i][j]; @@ -550,14 +491,9 @@ static ivas_error ivas_rend_initCrend( for ( i = 0; i < hHrtf->max_num_ir; i++ ) { -#ifndef FIX_INV_DIFFUSE_WEIGHT - hHrtf->inv_diffuse_weight[i] = CRendBin_HOA3_HRIR_inv_diffuse_weight_16kHz[i]; -#endif for ( j = 0; j < BINAURAL_CHANNELS; j++ ) { -#ifdef FIX_INV_DIFFUSE_WEIGHT hHrtf->inv_diffuse_weight[j][i] = CRendBin_HOA3_HRIR_inv_diffuse_weight_16kHz[j][i]; -#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]; hHrtf->pOut_to_bin_re[i][j] = CRendBin_HOA3_HRIR_coeff_re_16kHz[i][j]; @@ -588,15 +524,10 @@ static ivas_error ivas_rend_initCrend( for ( i = 0; i < hHrtf->max_num_ir; i++ ) { -#ifndef FIX_INV_DIFFUSE_WEIGHT - hHrtf->inv_diffuse_weight[i] = CRendBin_HOA2_HRIR_inv_diffuse_weight_48kHz[i]; -#endif for ( j = 0; j < BINAURAL_CHANNELS; j++ ) { -#ifdef FIX_INV_DIFFUSE_WEIGHT hHrtf->inv_diffuse_weight[j][i] = CRendBin_HOA2_HRIR_inv_diffuse_weight_48kHz[j][i]; -#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]; hHrtf->pOut_to_bin_re[i][j] = CRendBin_HOA2_HRIR_coeff_re_48kHz[i][j]; @@ -619,15 +550,10 @@ static ivas_error ivas_rend_initCrend( for ( i = 0; i < hHrtf->max_num_ir; i++ ) { -#ifndef FIX_INV_DIFFUSE_WEIGHT - hHrtf->inv_diffuse_weight[i] = CRendBin_HOA2_HRIR_inv_diffuse_weight_32kHz[i]; -#endif for ( j = 0; j < BINAURAL_CHANNELS; j++ ) { -#ifdef FIX_INV_DIFFUSE_WEIGHT hHrtf->inv_diffuse_weight[j][i] = CRendBin_HOA2_HRIR_inv_diffuse_weight_32kHz[j][i]; -#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]; hHrtf->pOut_to_bin_re[i][j] = CRendBin_HOA2_HRIR_coeff_re_32kHz[i][j]; @@ -651,14 +577,9 @@ static ivas_error ivas_rend_initCrend( for ( i = 0; i < hHrtf->max_num_ir; i++ ) { -#ifndef FIX_INV_DIFFUSE_WEIGHT - hHrtf->inv_diffuse_weight[i] = CRendBin_HOA2_HRIR_inv_diffuse_weight_16kHz[i]; -#endif for ( j = 0; j < BINAURAL_CHANNELS; j++ ) { -#ifdef FIX_INV_DIFFUSE_WEIGHT hHrtf->inv_diffuse_weight[j][i] = CRendBin_HOA2_HRIR_inv_diffuse_weight_16kHz[j][i]; -#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]; hHrtf->pOut_to_bin_re[i][j] = CRendBin_HOA2_HRIR_coeff_re_16kHz[i][j]; @@ -689,14 +610,9 @@ static ivas_error ivas_rend_initCrend( for ( i = 0; i < hHrtf->max_num_ir; i++ ) { -#ifndef FIX_INV_DIFFUSE_WEIGHT - hHrtf->inv_diffuse_weight[i] = CRendBin_FOA_HRIR_inv_diffuse_weight_48kHz[i]; -#endif for ( j = 0; j < BINAURAL_CHANNELS; j++ ) { -#ifdef FIX_INV_DIFFUSE_WEIGHT hHrtf->inv_diffuse_weight[j][i] = CRendBin_FOA_HRIR_inv_diffuse_weight_48kHz[j][i]; -#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]; hHrtf->pOut_to_bin_re[i][j] = CRendBin_FOA_HRIR_coeff_re_48kHz[i][j]; @@ -719,14 +635,9 @@ static ivas_error ivas_rend_initCrend( for ( i = 0; i < hHrtf->max_num_ir; i++ ) { -#ifndef FIX_INV_DIFFUSE_WEIGHT - hHrtf->inv_diffuse_weight[i] = CRendBin_FOA_HRIR_inv_diffuse_weight_32kHz[i]; -#endif for ( j = 0; j < BINAURAL_CHANNELS; j++ ) { -#ifdef FIX_INV_DIFFUSE_WEIGHT hHrtf->inv_diffuse_weight[j][i] = CRendBin_FOA_HRIR_inv_diffuse_weight_32kHz[j][i]; -#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]; hHrtf->pOut_to_bin_re[i][j] = CRendBin_FOA_HRIR_coeff_re_32kHz[i][j]; @@ -750,14 +661,9 @@ static ivas_error ivas_rend_initCrend( for ( i = 0; i < hHrtf->max_num_ir; i++ ) { -#ifndef FIX_INV_DIFFUSE_WEIGHT - hHrtf->inv_diffuse_weight[i] = CRendBin_FOA_HRIR_inv_diffuse_weight_16kHz[i]; -#endif for ( j = 0; j < BINAURAL_CHANNELS; j++ ) { -#ifdef FIX_INV_DIFFUSE_WEIGHT hHrtf->inv_diffuse_weight[j][i] = CRendBin_FOA_HRIR_inv_diffuse_weight_16kHz[j][i]; -#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]; hHrtf->pOut_to_bin_re[i][j] = CRendBin_FOA_HRIR_coeff_re_16kHz[i][j]; @@ -861,23 +767,11 @@ static ivas_error ivas_rend_initCrend( { return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Error: Channel configuration not specified!\n\n" ); } -#ifndef FIX_INV_DIFFUSE_WEIGHT - if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) - { - hHrtf->inv_diffuse_weight[i] = hSetOfHRTF->hHRTF_brir_combined->inv_diffuse_weight[tmp]; - } - else - { - hHrtf->inv_diffuse_weight[i] = hSetOfHRTF->hHRTF_hrir_combined->inv_diffuse_weight[tmp]; - } -#endif for ( j = 0; j < BINAURAL_CHANNELS; j++ ) { if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) { -#ifdef FIX_INV_DIFFUSE_WEIGHT hHrtf->inv_diffuse_weight[j][i] = hSetOfHRTF->hHRTF_brir_combined->inv_diffuse_weight[j][tmp]; -#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]; hHrtf->pOut_to_bin_re[i][j] = hSetOfHRTF->hHRTF_brir_combined->pOut_to_bin_re[tmp][j]; @@ -885,9 +779,7 @@ static ivas_error ivas_rend_initCrend( } else { -#ifdef FIX_INV_DIFFUSE_WEIGHT hHrtf->inv_diffuse_weight[j][i] = hSetOfHRTF->hHRTF_hrir_combined->inv_diffuse_weight[j][tmp]; -#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]; hHrtf->pOut_to_bin_re[i][j] = hSetOfHRTF->hHRTF_hrir_combined->pOut_to_bin_re[tmp][j]; @@ -910,15 +802,10 @@ static ivas_error ivas_rend_initCrend( for ( i = 0; i < hHrtf->max_num_ir; i++ ) { -#ifndef FIX_INV_DIFFUSE_WEIGHT - hHrtf->inv_diffuse_weight[i] = hSetOfHRTF->hHRTF_hrir_hoa3->inv_diffuse_weight[i]; -#endif for ( j = 0; j < BINAURAL_CHANNELS; j++ ) { -#ifdef FIX_INV_DIFFUSE_WEIGHT hHrtf->inv_diffuse_weight[j][i] = hSetOfHRTF->hHRTF_hrir_hoa3->inv_diffuse_weight[j][i]; -#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]; hHrtf->pOut_to_bin_re[i][j] = hSetOfHRTF->hHRTF_hrir_hoa3->pOut_to_bin_re[i][j]; @@ -945,15 +832,10 @@ static ivas_error ivas_rend_initCrend( for ( i = 0; i < hHrtf->max_num_ir; i++ ) { -#ifndef FIX_INV_DIFFUSE_WEIGHT - hHrtf->inv_diffuse_weight[i] = hSetOfHRTF->hHRTF_hrir_hoa2->inv_diffuse_weight[i]; -#endif for ( j = 0; j < BINAURAL_CHANNELS; j++ ) { -#ifdef FIX_INV_DIFFUSE_WEIGHT hHrtf->inv_diffuse_weight[j][i] = hSetOfHRTF->hHRTF_hrir_hoa2->inv_diffuse_weight[j][i]; -#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]; hHrtf->pOut_to_bin_re[i][j] = hSetOfHRTF->hHRTF_hrir_hoa2->pOut_to_bin_re[i][j]; @@ -980,15 +862,10 @@ static ivas_error ivas_rend_initCrend( for ( i = 0; i < hHrtf->max_num_ir; i++ ) { -#ifndef FIX_INV_DIFFUSE_WEIGHT - hHrtf->inv_diffuse_weight[i] = hSetOfHRTF->hHRTF_hrir_foa->inv_diffuse_weight[i]; -#endif for ( j = 0; j < BINAURAL_CHANNELS; j++ ) { -#ifdef FIX_INV_DIFFUSE_WEIGHT hHrtf->inv_diffuse_weight[j][i] = hSetOfHRTF->hHRTF_hrir_foa->inv_diffuse_weight[j][i]; -#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]; hHrtf->pOut_to_bin_re[i][j] = hSetOfHRTF->hHRTF_hrir_foa->pOut_to_bin_re[i][j]; @@ -1010,7 +887,6 @@ static ivas_error ivas_rend_initCrend( } } -#ifdef FIX_INV_DIFFUSE_WEIGHT hHrtf->same_inv_diffuse_weight = 1; for ( i = 0; i < hHrtf->max_num_ir; i++ ) { @@ -1023,7 +899,6 @@ static ivas_error ivas_rend_initCrend( } } } -#endif pCrend->hHrtfCrend = hHrtf; @@ -1300,15 +1175,10 @@ ivas_error ivas_rend_initCrendWrapper( hCrend->prev_out_buffer[i] = NULL; } -#ifdef FIX_INV_DIFFUSE_WEIGHT hCrend->freq_buffer_re_diffuse[0] = NULL; hCrend->freq_buffer_re_diffuse[1] = NULL; hCrend->freq_buffer_im_diffuse[0] = NULL; hCrend->freq_buffer_im_diffuse[1] = NULL; -#else - hCrend->freq_buffer_re_diffuse = NULL; - hCrend->freq_buffer_im_diffuse = NULL; -#endif hCrend->hReverb = NULL; hCrend->reflections = NULL; hCrend->delay_line_rw_index = 0; @@ -1433,7 +1303,6 @@ ivas_error ivas_rend_openCrend( if ( max_total_ir_len > 0 ) { -#ifdef FIX_INV_DIFFUSE_WEIGHT if ( ( hCrend->freq_buffer_re_diffuse[0] = (float *) malloc( sizeof( float ) * max_total_ir_len ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend" ); @@ -1449,22 +1318,11 @@ ivas_error ivas_rend_openCrend( { hCrend->freq_buffer_re_diffuse[1] = NULL; } -#else - if ( ( hCrend->freq_buffer_re_diffuse = (float *) malloc( sizeof( float ) * 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_zero_l( hCrend->freq_buffer_re_diffuse[0], max_total_ir_len ); if ( hCrend->freq_buffer_re_diffuse[1] != NULL ) { set_zero_l( hCrend->freq_buffer_re_diffuse[1], max_total_ir_len ); } -#else - set_zero_l( hCrend->freq_buffer_re_diffuse, max_total_ir_len ); -#endif -#ifdef FIX_INV_DIFFUSE_WEIGHT if ( ( hCrend->freq_buffer_im_diffuse[0] = (float *) malloc( sizeof( float ) * max_total_ir_len ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend" ); @@ -1480,33 +1338,18 @@ ivas_error ivas_rend_openCrend( { hCrend->freq_buffer_im_diffuse[1] = NULL; } -#else - if ( ( hCrend->freq_buffer_im_diffuse = (float *) malloc( sizeof( float ) * 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_zero_l( hCrend->freq_buffer_im_diffuse[0], max_total_ir_len ); if ( hCrend->freq_buffer_im_diffuse[1] != NULL ) { set_zero_l( hCrend->freq_buffer_im_diffuse[1], max_total_ir_len ); } -#else - set_zero_l( hCrend->freq_buffer_im_diffuse, max_total_ir_len ); -#endif } else { -#ifdef FIX_INV_DIFFUSE_WEIGHT hCrend->freq_buffer_re_diffuse[0] = NULL; hCrend->freq_buffer_im_diffuse[0] = NULL; hCrend->freq_buffer_re_diffuse[1] = NULL; hCrend->freq_buffer_im_diffuse[1] = NULL; -#else - hCrend->freq_buffer_re_diffuse = NULL; - hCrend->freq_buffer_im_diffuse = NULL; -#endif } max_total_ir_len = (int16_t) ( hHrtf->latency_s * output_Fs + 0.5f ) + subframe_length; @@ -1641,7 +1484,6 @@ void ivas_rend_closeCrend( free( hCrend->lfe_delay_line ); hCrend->lfe_delay_line = NULL; } -#ifdef FIX_INV_DIFFUSE_WEIGHT if ( hCrend->freq_buffer_re_diffuse[0] != NULL ) { free( hCrend->freq_buffer_re_diffuse[0] ); @@ -1665,19 +1507,6 @@ void ivas_rend_closeCrend( free( hCrend->freq_buffer_im_diffuse[1] ); hCrend->freq_buffer_im_diffuse[1] = NULL; } -#else - if ( hCrend->freq_buffer_re_diffuse != NULL ) - { - free( hCrend->freq_buffer_re_diffuse ); - hCrend->freq_buffer_re_diffuse = NULL; - } - - if ( hCrend->freq_buffer_im_diffuse != NULL ) - { - free( hCrend->freq_buffer_im_diffuse ); - hCrend->freq_buffer_im_diffuse = NULL; - } -#endif if ( hCrend->hTrack != NULL ) { @@ -1764,9 +1593,7 @@ static ivas_error ivas_rend_crendConvolver( int16_t nchan_in, nchan_out; const float *pIn; float *pFreq_buf_re, *pFreq_buf_im; -#ifdef FIX_INV_DIFFUSE_WEIGHT float *pFreq_buf2_re, *pFreq_buf2_im; -#endif const float *pFreq_filt_re, *pFreq_filt_im; float pOut[L_FRAME48k * 2]; float tmp_out_re[L_FRAME48k], tmp_out_im[L_FRAME48k]; @@ -1805,7 +1632,6 @@ static ivas_error ivas_rend_crendConvolver( if ( pCrend->hHrtfCrend->num_iterations_diffuse[0] > 0 ) { -#ifdef FIX_INV_DIFFUSE_WEIGHT set_zero( &hCrend->freq_buffer_re_diffuse[0][offset_diffuse], subframe_length ); set_zero( &hCrend->freq_buffer_im_diffuse[0][offset_diffuse], subframe_length ); if ( pCrend->hHrtfCrend->same_inv_diffuse_weight == 0 ) @@ -1813,10 +1639,6 @@ static ivas_error ivas_rend_crendConvolver( set_zero( &hCrend->freq_buffer_re_diffuse[1][offset_diffuse], subframe_length ); set_zero( &hCrend->freq_buffer_im_diffuse[1][offset_diffuse], subframe_length ); } -#else - set_zero( &hCrend->freq_buffer_re_diffuse[offset_diffuse], subframe_length ); - set_zero( &hCrend->freq_buffer_im_diffuse[offset_diffuse], subframe_length ); -#endif } i = 0; @@ -1827,7 +1649,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[0][offset_diffuse]; @@ -1858,18 +1679,6 @@ static ivas_error ivas_rend_crendConvolver( pFreq_buf2_im[k] += pFreq_filt_im[k] * pCrend->hHrtfCrend->inv_diffuse_weight[1][i]; } } -#else - pFreq_buf_re = &hCrend->freq_buffer_re_diffuse[offset_diffuse]; - pFreq_buf_im = &hCrend->freq_buffer_im_diffuse[offset_diffuse]; - pFreq_filt_re = &hCrend->freq_buffer_re[i][offset]; - pFreq_filt_im = &hCrend->freq_buffer_im[i][offset]; - - for ( k = 0; k < pCrend->hHrtfCrend->index_frequency_max_diffuse; k++ ) - { - pFreq_buf_re[k] += pFreq_filt_re[k] * pCrend->hHrtfCrend->inv_diffuse_weight[i]; - pFreq_buf_im[k] += pFreq_filt_im[k] * pCrend->hHrtfCrend->inv_diffuse_weight[i]; - } -#endif } pFreq_buf_re = &hCrend->freq_buffer_re[i][offset]; @@ -1918,7 +1727,6 @@ static ivas_error ivas_rend_crendConvolver( offset_diffuse = ( hCrend->diffuse_delay_line_rw_index + m + 1 ); offset_diffuse = offset_diffuse % pCrend->hHrtfCrend->num_iterations_diffuse[0]; offset_diffuse = offset_diffuse * subframe_length; -#ifdef FIX_INV_DIFFUSE_WEIGHT if ( pCrend->hHrtfCrend->same_inv_diffuse_weight ) { pFreq_buf_re = &hCrend->freq_buffer_re_diffuse[0][offset_diffuse]; @@ -1929,10 +1737,6 @@ static ivas_error ivas_rend_crendConvolver( pFreq_buf_re = &hCrend->freq_buffer_re_diffuse[j][offset_diffuse]; pFreq_buf_im = &hCrend->freq_buffer_im_diffuse[j][offset_diffuse]; } -#else - pFreq_buf_re = &hCrend->freq_buffer_re_diffuse[offset_diffuse]; - pFreq_buf_im = &hCrend->freq_buffer_im_diffuse[offset_diffuse]; -#endif pFreq_filt_re = &pCrend->hHrtfCrend->pOut_to_bin_diffuse_re[j][offset]; pFreq_filt_im = &pCrend->hHrtfCrend->pOut_to_bin_diffuse_im[j][offset]; diff --git a/lib_rend/ivas_rom_binaural_crend_head.c b/lib_rend/ivas_rom_binaural_crend_head.c index 559d1930d..a213ef7d6 100644 --- a/lib_rend/ivas_rom_binaural_crend_head.c +++ b/lib_rend/ivas_rom_binaural_crend_head.c @@ -62,11 +62,7 @@ const uint16_t CRendBin_Combined_HRIR_num_iterations_48kHz[HRTF_LS_CHANNELS][BIN const uint16_t CRendBin_Combined_HRIR_num_iterations_diffuse_48kHz[BINAURAL_CHANNELS] = {0, 0}; const uint16_t 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 uint16_t CRendBin_Combined_HRIR_index_frequency_max_diffuse_48kHz = 0; -#ifdef FIX_INV_DIFFUSE_WEIGHT const float CRendBin_Combined_HRIR_inv_diffuse_weight_48kHz[BINAURAL_CHANNELS][HRTF_LS_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, 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}}; -#else -const float CRendBin_Combined_HRIR_inv_diffuse_weight_48kHz[HRTF_LS_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}; -#endif const uint16_t *CRendBin_Combined_HRIR_pIndex_frequency_max_diffuse_48kHz[BINAURAL_CHANNELS]={NULL,NULL}; const float CRendBin_Combined_HRIR_coeff_re_48kHz[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][240]={ { @@ -322,11 +318,7 @@ const uint16_t CRendBin_Combined_HRIR_num_iterations_32kHz[HRTF_LS_CHANNELS][BIN const uint16_t CRendBin_Combined_HRIR_num_iterations_diffuse_32kHz[BINAURAL_CHANNELS] = {0, 0}; const uint16_t 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 uint16_t CRendBin_Combined_HRIR_index_frequency_max_diffuse_32kHz = 0; -#ifdef FIX_INV_DIFFUSE_WEIGHT const float CRendBin_Combined_HRIR_inv_diffuse_weight_32kHz[BINAURAL_CHANNELS][HRTF_LS_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, 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}}; -#else -const float CRendBin_Combined_HRIR_inv_diffuse_weight_32kHz[HRTF_LS_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}; -#endif const uint16_t *CRendBin_Combined_HRIR_pIndex_frequency_max_diffuse_32kHz[BINAURAL_CHANNELS]={NULL,NULL}; const float CRendBin_Combined_HRIR_coeff_re_32kHz[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][160]={ { @@ -522,11 +514,7 @@ const uint16_t CRendBin_Combined_HRIR_num_iterations_16kHz[HRTF_LS_CHANNELS][BIN const uint16_t CRendBin_Combined_HRIR_num_iterations_diffuse_16kHz[BINAURAL_CHANNELS] = {0, 0}; const uint16_t 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 uint16_t CRendBin_Combined_HRIR_index_frequency_max_diffuse_16kHz = 0; -#ifdef FIX_INV_DIFFUSE_WEIGHT const float CRendBin_Combined_HRIR_inv_diffuse_weight_16kHz[BINAURAL_CHANNELS][HRTF_LS_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, 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}}; -#else -const float CRendBin_Combined_HRIR_inv_diffuse_weight_16kHz[HRTF_LS_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}; -#endif const uint16_t *CRendBin_Combined_HRIR_pIndex_frequency_max_diffuse_16kHz[BINAURAL_CHANNELS]={NULL,NULL}; const float CRendBin_Combined_HRIR_coeff_re_16kHz[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][80]={ { @@ -669,11 +657,7 @@ const uint16_t CRendBin_FOA_HRIR_num_iterations_48kHz[FOA_CHANNELS][BINAURAL_CHA const uint16_t CRendBin_FOA_HRIR_num_iterations_diffuse_48kHz[BINAURAL_CHANNELS] = {0, 0}; const uint16_t CRendBin_FOA_HRIR_pIndex_frequency_max_48kHz[FOA_CHANNELS][BINAURAL_CHANNELS][1]={{{240},{240}},{{240},{240}},{{240},{240}},{{240},{240}}}; const uint16_t CRendBin_FOA_HRIR_index_frequency_max_diffuse_48kHz = 0; -#ifdef FIX_INV_DIFFUSE_WEIGHT const float CRendBin_FOA_HRIR_inv_diffuse_weight_48kHz[BINAURAL_CHANNELS][FOA_CHANNELS]={{0.000000f, 0.000000f, 0.000000f, 0.000000f},{0.000000f, 0.000000f, 0.000000f, 0.000000f}}; -#else -const float CRendBin_FOA_HRIR_inv_diffuse_weight_48kHz[FOA_CHANNELS]={0.000000f, 0.000000f, 0.000000f, 0.000000f}; -#endif const uint16_t *CRendBin_FOA_HRIR_pIndex_frequency_max_diffuse_48kHz[BINAURAL_CHANNELS]={NULL,NULL}; const float CRendBin_FOA_HRIR_coeff_re_48kHz[FOA_CHANNELS][BINAURAL_CHANNELS][240]={ { @@ -753,11 +737,7 @@ const uint16_t CRendBin_FOA_HRIR_num_iterations_32kHz[FOA_CHANNELS][BINAURAL_CHA const uint16_t CRendBin_FOA_HRIR_num_iterations_diffuse_32kHz[BINAURAL_CHANNELS] = {0, 0}; const uint16_t CRendBin_FOA_HRIR_pIndex_frequency_max_32kHz[FOA_CHANNELS][BINAURAL_CHANNELS][1]={{{160},{160}},{{160},{160}},{{160},{160}},{{160},{160}}}; const uint16_t CRendBin_FOA_HRIR_index_frequency_max_diffuse_32kHz = 0; -#ifdef FIX_INV_DIFFUSE_WEIGHT const float CRendBin_FOA_HRIR_inv_diffuse_weight_32kHz[BINAURAL_CHANNELS][FOA_CHANNELS]={{0.000000f, 0.000000f, 0.000000f, 0.000000f},{0.000000f, 0.000000f, 0.000000f, 0.000000f}}; -#else -const float CRendBin_FOA_HRIR_inv_diffuse_weight_32kHz[FOA_CHANNELS]={0.000000f, 0.000000f, 0.000000f, 0.000000f}; -#endif const uint16_t *CRendBin_FOA_HRIR_pIndex_frequency_max_diffuse_32kHz[BINAURAL_CHANNELS]={NULL,NULL}; const float CRendBin_FOA_HRIR_coeff_re_32kHz[FOA_CHANNELS][BINAURAL_CHANNELS][160]={ { @@ -821,11 +801,7 @@ const uint16_t CRendBin_FOA_HRIR_num_iterations_16kHz[FOA_CHANNELS][BINAURAL_CHA const uint16_t CRendBin_FOA_HRIR_num_iterations_diffuse_16kHz[BINAURAL_CHANNELS] = {0, 0}; const uint16_t CRendBin_FOA_HRIR_pIndex_frequency_max_16kHz[FOA_CHANNELS][BINAURAL_CHANNELS][1]={{{80},{80}},{{80},{80}},{{80},{80}},{{80},{80}}}; const uint16_t CRendBin_FOA_HRIR_index_frequency_max_diffuse_16kHz = 0; -#ifdef FIX_INV_DIFFUSE_WEIGHT const float CRendBin_FOA_HRIR_inv_diffuse_weight_16kHz[BINAURAL_CHANNELS][FOA_CHANNELS]={{0.000000f, 0.000000f, 0.000000f, 0.000000f},{0.000000f, 0.000000f, 0.000000f, 0.000000f}}; -#else -const float CRendBin_FOA_HRIR_inv_diffuse_weight_16kHz[FOA_CHANNELS]={0.000000f, 0.000000f, 0.000000f, 0.000000f}; -#endif const uint16_t *CRendBin_FOA_HRIR_pIndex_frequency_max_diffuse_16kHz[BINAURAL_CHANNELS]={NULL,NULL}; const float CRendBin_FOA_HRIR_coeff_re_16kHz[FOA_CHANNELS][BINAURAL_CHANNELS][80]={ { @@ -879,11 +855,7 @@ const uint16_t CRendBin_HOA2_HRIR_num_iterations_48kHz[HOA2_CHANNELS][BINAURAL_C const uint16_t CRendBin_HOA2_HRIR_num_iterations_diffuse_48kHz[BINAURAL_CHANNELS] = {0, 0}; const uint16_t 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 uint16_t CRendBin_HOA2_HRIR_index_frequency_max_diffuse_48kHz = 0; -#ifdef FIX_INV_DIFFUSE_WEIGHT const float CRendBin_HOA2_HRIR_inv_diffuse_weight_48kHz[BINAURAL_CHANNELS][HOA2_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, 0.000000f, 0.000000f}}; -#else -const float CRendBin_HOA2_HRIR_inv_diffuse_weight_48kHz[HOA2_CHANNELS]={0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f}; -#endif const uint16_t *CRendBin_HOA2_HRIR_pIndex_frequency_max_diffuse_48kHz[BINAURAL_CHANNELS]={NULL,NULL}; const float CRendBin_HOA2_HRIR_coeff_re_48kHz[HOA2_CHANNELS][BINAURAL_CHANNELS][240]={ { @@ -1043,11 +1015,7 @@ const uint16_t CRendBin_HOA2_HRIR_num_iterations_32kHz[HOA2_CHANNELS][BINAURAL_C const uint16_t CRendBin_HOA2_HRIR_num_iterations_diffuse_32kHz[BINAURAL_CHANNELS] = {0, 0}; const uint16_t 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 uint16_t CRendBin_HOA2_HRIR_index_frequency_max_diffuse_32kHz = 0; -#ifdef FIX_INV_DIFFUSE_WEIGHT const float CRendBin_HOA2_HRIR_inv_diffuse_weight_32kHz[BINAURAL_CHANNELS][HOA2_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, 0.000000f, 0.000000f}}; -#else -const float CRendBin_HOA2_HRIR_inv_diffuse_weight_32kHz[HOA2_CHANNELS]={0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f}; -#endif const uint16_t *CRendBin_HOA2_HRIR_pIndex_frequency_max_diffuse_32kHz[BINAURAL_CHANNELS]={NULL,NULL}; const float CRendBin_HOA2_HRIR_coeff_re_32kHz[HOA2_CHANNELS][BINAURAL_CHANNELS][160]={ { @@ -1171,11 +1139,7 @@ const uint16_t CRendBin_HOA2_HRIR_num_iterations_16kHz[HOA2_CHANNELS][BINAURAL_C const uint16_t CRendBin_HOA2_HRIR_num_iterations_diffuse_16kHz[BINAURAL_CHANNELS] = {0, 0}; const uint16_t 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 uint16_t CRendBin_HOA2_HRIR_index_frequency_max_diffuse_16kHz = 0; -#ifdef FIX_INV_DIFFUSE_WEIGHT const float CRendBin_HOA2_HRIR_inv_diffuse_weight_16kHz[BINAURAL_CHANNELS][HOA2_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, 0.000000f, 0.000000f}}; -#else -const float CRendBin_HOA2_HRIR_inv_diffuse_weight_16kHz[HOA2_CHANNELS]={0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f}; -#endif const uint16_t *CRendBin_HOA2_HRIR_pIndex_frequency_max_diffuse_16kHz[BINAURAL_CHANNELS]={NULL,NULL}; const float CRendBin_HOA2_HRIR_coeff_re_16kHz[HOA2_CHANNELS][BINAURAL_CHANNELS][80]={ { @@ -1269,11 +1233,7 @@ const uint16_t CRendBin_HOA3_HRIR_num_iterations_48kHz[HOA3_CHANNELS][BINAURAL_C const uint16_t CRendBin_HOA3_HRIR_num_iterations_diffuse_48kHz[BINAURAL_CHANNELS] = {0, 0}; const uint16_t 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 uint16_t CRendBin_HOA3_HRIR_index_frequency_max_diffuse_48kHz = 0; -#ifdef FIX_INV_DIFFUSE_WEIGHT const float CRendBin_HOA3_HRIR_inv_diffuse_weight_48kHz[BINAURAL_CHANNELS][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},{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}}; -#else -const float CRendBin_HOA3_HRIR_inv_diffuse_weight_48kHz[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 uint16_t *CRendBin_HOA3_HRIR_pIndex_frequency_max_diffuse_48kHz[BINAURAL_CHANNELS]={NULL,NULL}; const float CRendBin_HOA3_HRIR_coeff_re_48kHz[HOA3_CHANNELS][BINAURAL_CHANNELS][240]={ { @@ -1545,11 +1505,7 @@ const uint16_t CRendBin_HOA3_HRIR_num_iterations_32kHz[HOA3_CHANNELS][BINAURAL_C const uint16_t CRendBin_HOA3_HRIR_num_iterations_diffuse_32kHz[BINAURAL_CHANNELS] = {0, 0}; const uint16_t 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 uint16_t CRendBin_HOA3_HRIR_index_frequency_max_diffuse_32kHz = 0; -#ifdef FIX_INV_DIFFUSE_WEIGHT const float CRendBin_HOA3_HRIR_inv_diffuse_weight_32kHz[BINAURAL_CHANNELS][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},{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}}; -#else -const float CRendBin_HOA3_HRIR_inv_diffuse_weight_32kHz[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 uint16_t *CRendBin_HOA3_HRIR_pIndex_frequency_max_diffuse_32kHz[BINAURAL_CHANNELS]={NULL,NULL}; const float CRendBin_HOA3_HRIR_coeff_re_32kHz[HOA3_CHANNELS][BINAURAL_CHANNELS][160]={ { @@ -1757,11 +1713,7 @@ const uint16_t CRendBin_HOA3_HRIR_num_iterations_16kHz[HOA3_CHANNELS][BINAURAL_C const uint16_t CRendBin_HOA3_HRIR_num_iterations_diffuse_16kHz[BINAURAL_CHANNELS] = {0, 0}; const uint16_t 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 uint16_t CRendBin_HOA3_HRIR_index_frequency_max_diffuse_16kHz = 0; -#ifdef FIX_INV_DIFFUSE_WEIGHT const float CRendBin_HOA3_HRIR_inv_diffuse_weight_16kHz[BINAURAL_CHANNELS][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},{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}}; -#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 uint16_t *CRendBin_HOA3_HRIR_pIndex_frequency_max_diffuse_16kHz[BINAURAL_CHANNELS]={NULL,NULL}; const float CRendBin_HOA3_HRIR_coeff_re_16kHz[HOA3_CHANNELS][BINAURAL_CHANNELS][80]={ { @@ -1911,11 +1863,7 @@ const uint16_t CRendBin_Combined_BRIR_num_iterations_48kHz[HRTF_LS_CHANNELS][BIN const uint16_t CRendBin_Combined_BRIR_num_iterations_diffuse_48kHz[BINAURAL_CHANNELS] = {40, 40}; const uint16_t 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 uint16_t 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}}; -#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}; -#endif const uint16_t 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}}; const float CRendBin_Combined_BRIR_coeff_re_48kHz[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][2955]={ { @@ -3951,11 +3899,7 @@ const uint16_t CRendBin_Combined_BRIR_num_iterations_32kHz[HRTF_LS_CHANNELS][BIN const uint16_t CRendBin_Combined_BRIR_num_iterations_diffuse_32kHz[BINAURAL_CHANNELS] = {40, 40}; const uint16_t 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 uint16_t 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}}; -#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}; -#endif const uint16_t 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}}; const float CRendBin_Combined_BRIR_coeff_re_32kHz[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][2819]={ { @@ -5915,11 +5859,7 @@ const uint16_t CRendBin_Combined_BRIR_num_iterations_16kHz[HRTF_LS_CHANNELS][BIN const uint16_t CRendBin_Combined_BRIR_num_iterations_diffuse_16kHz[BINAURAL_CHANNELS] = {40, 40}; const uint16_t 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 uint16_t 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}}; -#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}; -#endif const uint16_t 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}}; const float CRendBin_Combined_BRIR_coeff_re_16kHz[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][1774]={ { diff --git a/lib_rend/ivas_rom_binaural_crend_head.h b/lib_rend/ivas_rom_binaural_crend_head.h index 0e4b616aa..10af7ff18 100644 --- a/lib_rend/ivas_rom_binaural_crend_head.h +++ b/lib_rend/ivas_rom_binaural_crend_head.h @@ -60,11 +60,7 @@ extern uint16_t CRendBin_Combined_HRIR_num_iterations_48kHz[HRTF_LS_CHANNELS][BI extern uint16_t CRendBin_Combined_HRIR_num_iterations_diffuse_48kHz[BINAURAL_CHANNELS]; extern uint16_t CRendBin_Combined_HRIR_pIndex_frequency_max_48kHz[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][1]; extern uint16_t CRendBin_Combined_HRIR_index_frequency_max_diffuse_48kHz; -#ifdef FIX_INV_DIFFUSE_WEIGHT extern float CRendBin_Combined_HRIR_inv_diffuse_weight_48kHz[BINAURAL_CHANNELS][15]; -#else -extern float CRendBin_Combined_HRIR_inv_diffuse_weight_48kHz[15]; -#endif extern uint16_t *CRendBin_Combined_HRIR_pIndex_frequency_max_diffuse_48kHz[BINAURAL_CHANNELS]; extern float CRendBin_Combined_HRIR_coeff_re_48kHz[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][240]; extern float CRendBin_Combined_HRIR_coeff_im_48kHz[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][240]; @@ -78,11 +74,7 @@ extern uint16_t CRendBin_Combined_HRIR_num_iterations_32kHz[HRTF_LS_CHANNELS][BI extern uint16_t CRendBin_Combined_HRIR_num_iterations_diffuse_32kHz[BINAURAL_CHANNELS]; extern uint16_t CRendBin_Combined_HRIR_pIndex_frequency_max_32kHz[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][1]; extern uint16_t CRendBin_Combined_HRIR_index_frequency_max_diffuse_32kHz; -#ifdef FIX_INV_DIFFUSE_WEIGHT extern float CRendBin_Combined_HRIR_inv_diffuse_weight_32kHz[BINAURAL_CHANNELS][15]; -#else -extern float CRendBin_Combined_HRIR_inv_diffuse_weight_32kHz[15]; -#endif extern uint16_t *CRendBin_Combined_HRIR_pIndex_frequency_max_diffuse_32kHz[BINAURAL_CHANNELS]; extern float CRendBin_Combined_HRIR_coeff_re_32kHz[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][160]; extern float CRendBin_Combined_HRIR_coeff_im_32kHz[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][160]; @@ -96,11 +88,7 @@ extern uint16_t CRendBin_Combined_HRIR_num_iterations_16kHz[HRTF_LS_CHANNELS][BI extern uint16_t CRendBin_Combined_HRIR_num_iterations_diffuse_16kHz[BINAURAL_CHANNELS]; extern uint16_t CRendBin_Combined_HRIR_pIndex_frequency_max_16kHz[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][1]; extern uint16_t CRendBin_Combined_HRIR_index_frequency_max_diffuse_16kHz; -#ifdef FIX_INV_DIFFUSE_WEIGHT extern float CRendBin_Combined_HRIR_inv_diffuse_weight_16kHz[BINAURAL_CHANNELS][15]; -#else -extern float CRendBin_Combined_HRIR_inv_diffuse_weight_16kHz[15]; -#endif extern uint16_t *CRendBin_Combined_HRIR_pIndex_frequency_max_diffuse_16kHz[BINAURAL_CHANNELS]; extern float CRendBin_Combined_HRIR_coeff_re_16kHz[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][80]; extern float CRendBin_Combined_HRIR_coeff_im_16kHz[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][80]; @@ -121,11 +109,7 @@ extern uint16_t CRendBin_FOA_HRIR_num_iterations_48kHz[FOA_CHANNELS][BINAURAL_CH extern uint16_t CRendBin_FOA_HRIR_num_iterations_diffuse_48kHz[BINAURAL_CHANNELS]; extern uint16_t CRendBin_FOA_HRIR_pIndex_frequency_max_48kHz[FOA_CHANNELS][BINAURAL_CHANNELS][1]; extern uint16_t CRendBin_FOA_HRIR_index_frequency_max_diffuse_48kHz; -#ifdef FIX_INV_DIFFUSE_WEIGHT extern float CRendBin_FOA_HRIR_inv_diffuse_weight_48kHz[BINAURAL_CHANNELS][4]; -#else -extern float CRendBin_FOA_HRIR_inv_diffuse_weight_48kHz[4]; -#endif extern uint16_t *CRendBin_FOA_HRIR_pIndex_frequency_max_diffuse_48kHz[BINAURAL_CHANNELS]; extern float CRendBin_FOA_HRIR_coeff_re_48kHz[FOA_CHANNELS][BINAURAL_CHANNELS][240]; extern float CRendBin_FOA_HRIR_coeff_im_48kHz[FOA_CHANNELS][BINAURAL_CHANNELS][240]; @@ -139,11 +123,7 @@ extern uint16_t CRendBin_FOA_HRIR_num_iterations_32kHz[FOA_CHANNELS][BINAURAL_CH extern uint16_t CRendBin_FOA_HRIR_num_iterations_diffuse_32kHz[BINAURAL_CHANNELS]; extern uint16_t CRendBin_FOA_HRIR_pIndex_frequency_max_32kHz[FOA_CHANNELS][BINAURAL_CHANNELS][1]; extern uint16_t CRendBin_FOA_HRIR_index_frequency_max_diffuse_32kHz; -#ifdef FIX_INV_DIFFUSE_WEIGHT extern float CRendBin_FOA_HRIR_inv_diffuse_weight_32kHz[BINAURAL_CHANNELS][4]; -#else -extern float CRendBin_FOA_HRIR_inv_diffuse_weight_32kHz[4]; -#endif extern uint16_t *CRendBin_FOA_HRIR_pIndex_frequency_max_diffuse_32kHz[BINAURAL_CHANNELS]; extern float CRendBin_FOA_HRIR_coeff_re_32kHz[FOA_CHANNELS][BINAURAL_CHANNELS][160]; extern float CRendBin_FOA_HRIR_coeff_im_32kHz[FOA_CHANNELS][BINAURAL_CHANNELS][160]; @@ -157,11 +137,7 @@ extern uint16_t CRendBin_FOA_HRIR_num_iterations_16kHz[FOA_CHANNELS][BINAURAL_CH extern uint16_t CRendBin_FOA_HRIR_num_iterations_diffuse_16kHz[BINAURAL_CHANNELS]; extern uint16_t CRendBin_FOA_HRIR_pIndex_frequency_max_16kHz[FOA_CHANNELS][BINAURAL_CHANNELS][1]; extern uint16_t CRendBin_FOA_HRIR_index_frequency_max_diffuse_16kHz; -#ifdef FIX_INV_DIFFUSE_WEIGHT extern float CRendBin_FOA_HRIR_inv_diffuse_weight_16kHz[BINAURAL_CHANNELS][4]; -#else -extern float CRendBin_FOA_HRIR_inv_diffuse_weight_16kHz[4]; -#endif extern uint16_t *CRendBin_FOA_HRIR_pIndex_frequency_max_diffuse_16kHz[BINAURAL_CHANNELS]; extern float CRendBin_FOA_HRIR_coeff_re_16kHz[FOA_CHANNELS][BINAURAL_CHANNELS][80]; extern float CRendBin_FOA_HRIR_coeff_im_16kHz[FOA_CHANNELS][BINAURAL_CHANNELS][80]; @@ -181,11 +157,7 @@ extern uint16_t CRendBin_HOA2_HRIR_num_iterations_48kHz[HOA2_CHANNELS][BINAURAL_ extern uint16_t CRendBin_HOA2_HRIR_num_iterations_diffuse_48kHz[BINAURAL_CHANNELS]; extern uint16_t CRendBin_HOA2_HRIR_pIndex_frequency_max_48kHz[HOA2_CHANNELS][BINAURAL_CHANNELS][1]; extern uint16_t CRendBin_HOA2_HRIR_index_frequency_max_diffuse_48kHz; -#ifdef FIX_INV_DIFFUSE_WEIGHT extern float CRendBin_HOA2_HRIR_inv_diffuse_weight_48kHz[BINAURAL_CHANNELS][9]; -#else -extern float CRendBin_HOA2_HRIR_inv_diffuse_weight_48kHz[9]; -#endif extern uint16_t *CRendBin_HOA2_HRIR_pIndex_frequency_max_diffuse_48kHz[BINAURAL_CHANNELS]; extern float CRendBin_HOA2_HRIR_coeff_re_48kHz[HOA2_CHANNELS][BINAURAL_CHANNELS][240]; extern float CRendBin_HOA2_HRIR_coeff_im_48kHz[HOA2_CHANNELS][BINAURAL_CHANNELS][240]; @@ -199,11 +171,7 @@ extern uint16_t CRendBin_HOA2_HRIR_num_iterations_32kHz[HOA2_CHANNELS][BINAURAL_ extern uint16_t CRendBin_HOA2_HRIR_num_iterations_diffuse_32kHz[BINAURAL_CHANNELS]; extern uint16_t CRendBin_HOA2_HRIR_pIndex_frequency_max_32kHz[HOA2_CHANNELS][BINAURAL_CHANNELS][1]; extern uint16_t CRendBin_HOA2_HRIR_index_frequency_max_diffuse_32kHz; -#ifdef FIX_INV_DIFFUSE_WEIGHT extern float CRendBin_HOA2_HRIR_inv_diffuse_weight_32kHz[BINAURAL_CHANNELS][9]; -#else -extern float CRendBin_HOA2_HRIR_inv_diffuse_weight_32kHz[9]; -#endif extern uint16_t *CRendBin_HOA2_HRIR_pIndex_frequency_max_diffuse_32kHz[BINAURAL_CHANNELS]; extern float CRendBin_HOA2_HRIR_coeff_re_32kHz[HOA2_CHANNELS][BINAURAL_CHANNELS][160]; extern float CRendBin_HOA2_HRIR_coeff_im_32kHz[HOA2_CHANNELS][BINAURAL_CHANNELS][160]; @@ -217,11 +185,7 @@ extern uint16_t CRendBin_HOA2_HRIR_num_iterations_16kHz[HOA2_CHANNELS][BINAURAL_ extern uint16_t CRendBin_HOA2_HRIR_num_iterations_diffuse_16kHz[BINAURAL_CHANNELS]; extern uint16_t CRendBin_HOA2_HRIR_pIndex_frequency_max_16kHz[HOA2_CHANNELS][BINAURAL_CHANNELS][1]; extern uint16_t CRendBin_HOA2_HRIR_index_frequency_max_diffuse_16kHz; -#ifdef FIX_INV_DIFFUSE_WEIGHT extern float CRendBin_HOA2_HRIR_inv_diffuse_weight_16kHz[BINAURAL_CHANNELS][9]; -#else -extern float CRendBin_HOA2_HRIR_inv_diffuse_weight_16kHz[9]; -#endif extern uint16_t *CRendBin_HOA2_HRIR_pIndex_frequency_max_diffuse_16kHz[BINAURAL_CHANNELS]; extern float CRendBin_HOA2_HRIR_coeff_re_16kHz[HOA2_CHANNELS][BINAURAL_CHANNELS][80]; extern float CRendBin_HOA2_HRIR_coeff_im_16kHz[HOA2_CHANNELS][BINAURAL_CHANNELS][80]; @@ -241,11 +205,7 @@ extern uint16_t CRendBin_HOA3_HRIR_num_iterations_48kHz[HOA3_CHANNELS][BINAURAL_ extern uint16_t CRendBin_HOA3_HRIR_num_iterations_diffuse_48kHz[BINAURAL_CHANNELS]; extern uint16_t CRendBin_HOA3_HRIR_pIndex_frequency_max_48kHz[HOA3_CHANNELS][BINAURAL_CHANNELS][1]; extern uint16_t CRendBin_HOA3_HRIR_index_frequency_max_diffuse_48kHz; -#ifdef FIX_INV_DIFFUSE_WEIGHT extern float CRendBin_HOA3_HRIR_inv_diffuse_weight_48kHz[BINAURAL_CHANNELS][16]; -#else -extern float CRendBin_HOA3_HRIR_inv_diffuse_weight_48kHz[16]; -#endif extern uint16_t *CRendBin_HOA3_HRIR_pIndex_frequency_max_diffuse_48kHz[BINAURAL_CHANNELS]; extern float CRendBin_HOA3_HRIR_coeff_re_48kHz[HOA3_CHANNELS][BINAURAL_CHANNELS][240]; extern float CRendBin_HOA3_HRIR_coeff_im_48kHz[HOA3_CHANNELS][BINAURAL_CHANNELS][240]; @@ -259,11 +219,7 @@ extern uint16_t CRendBin_HOA3_HRIR_num_iterations_32kHz[HOA3_CHANNELS][BINAURAL_ extern uint16_t CRendBin_HOA3_HRIR_num_iterations_diffuse_32kHz[BINAURAL_CHANNELS]; extern uint16_t CRendBin_HOA3_HRIR_pIndex_frequency_max_32kHz[HOA3_CHANNELS][BINAURAL_CHANNELS][1]; extern uint16_t CRendBin_HOA3_HRIR_index_frequency_max_diffuse_32kHz; -#ifdef FIX_INV_DIFFUSE_WEIGHT extern float CRendBin_HOA3_HRIR_inv_diffuse_weight_32kHz[BINAURAL_CHANNELS][16]; -#else -extern float CRendBin_HOA3_HRIR_inv_diffuse_weight_32kHz[16]; -#endif extern uint16_t *CRendBin_HOA3_HRIR_pIndex_frequency_max_diffuse_32kHz[BINAURAL_CHANNELS]; extern float CRendBin_HOA3_HRIR_coeff_re_32kHz[HOA3_CHANNELS][BINAURAL_CHANNELS][160]; extern float CRendBin_HOA3_HRIR_coeff_im_32kHz[HOA3_CHANNELS][BINAURAL_CHANNELS][160]; @@ -277,11 +233,7 @@ extern uint16_t CRendBin_HOA3_HRIR_num_iterations_16kHz[HOA3_CHANNELS][BINAURAL_ extern uint16_t CRendBin_HOA3_HRIR_num_iterations_diffuse_16kHz[BINAURAL_CHANNELS]; extern uint16_t CRendBin_HOA3_HRIR_pIndex_frequency_max_16kHz[HOA3_CHANNELS][BINAURAL_CHANNELS][1]; extern uint16_t CRendBin_HOA3_HRIR_index_frequency_max_diffuse_16kHz; -#ifdef FIX_INV_DIFFUSE_WEIGHT extern float CRendBin_HOA3_HRIR_inv_diffuse_weight_16kHz[BINAURAL_CHANNELS][16]; -#else -extern float CRendBin_HOA3_HRIR_inv_diffuse_weight_16kHz[16]; -#endif extern uint16_t *CRendBin_HOA3_HRIR_pIndex_frequency_max_diffuse_16kHz[BINAURAL_CHANNELS]; extern float CRendBin_HOA3_HRIR_coeff_re_16kHz[HOA3_CHANNELS][BINAURAL_CHANNELS][80]; extern float CRendBin_HOA3_HRIR_coeff_im_16kHz[HOA3_CHANNELS][BINAURAL_CHANNELS][80]; @@ -301,11 +253,7 @@ extern uint16_t CRendBin_Combined_BRIR_num_iterations_48kHz[HRTF_LS_CHANNELS][BI extern uint16_t CRendBin_Combined_BRIR_num_iterations_diffuse_48kHz[BINAURAL_CHANNELS]; extern uint16_t CRendBin_Combined_BRIR_pIndex_frequency_max_48kHz[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][22]; extern uint16_t CRendBin_Combined_BRIR_index_frequency_max_diffuse_48kHz; -#ifdef FIX_INV_DIFFUSE_WEIGHT extern float CRendBin_Combined_BRIR_inv_diffuse_weight_48kHz[BINAURAL_CHANNELS][15]; -#else -extern float CRendBin_Combined_BRIR_inv_diffuse_weight_48kHz[15]; -#endif extern uint16_t CRendBin_Combined_BRIR_pIndex_frequency_max_diffuse_48kHz[BINAURAL_CHANNELS][40]; extern float CRendBin_Combined_BRIR_coeff_re_48kHz[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][2955]; extern float CRendBin_Combined_BRIR_coeff_im_48kHz[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][2955]; @@ -319,11 +267,7 @@ extern uint16_t CRendBin_Combined_BRIR_num_iterations_32kHz[HRTF_LS_CHANNELS][BI extern uint16_t CRendBin_Combined_BRIR_num_iterations_diffuse_32kHz[BINAURAL_CHANNELS]; extern uint16_t CRendBin_Combined_BRIR_pIndex_frequency_max_32kHz[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][22]; extern uint16_t CRendBin_Combined_BRIR_index_frequency_max_diffuse_32kHz; -#ifdef FIX_INV_DIFFUSE_WEIGHT extern float CRendBin_Combined_BRIR_inv_diffuse_weight_32kHz[BINAURAL_CHANNELS][15]; -#else -extern float CRendBin_Combined_BRIR_inv_diffuse_weight_32kHz[15]; -#endif extern uint16_t CRendBin_Combined_BRIR_pIndex_frequency_max_diffuse_32kHz[BINAURAL_CHANNELS][40]; extern float CRendBin_Combined_BRIR_coeff_re_32kHz[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][2819]; extern float CRendBin_Combined_BRIR_coeff_im_32kHz[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][2819]; @@ -337,11 +281,7 @@ extern uint16_t CRendBin_Combined_BRIR_num_iterations_16kHz[HRTF_LS_CHANNELS][BI extern uint16_t CRendBin_Combined_BRIR_num_iterations_diffuse_16kHz[BINAURAL_CHANNELS]; extern uint16_t CRendBin_Combined_BRIR_pIndex_frequency_max_16kHz[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][23]; extern uint16_t CRendBin_Combined_BRIR_index_frequency_max_diffuse_16kHz; -#ifdef FIX_INV_DIFFUSE_WEIGHT extern float CRendBin_Combined_BRIR_inv_diffuse_weight_16kHz[BINAURAL_CHANNELS][15]; -#else -extern float CRendBin_Combined_BRIR_inv_diffuse_weight_16kHz[15]; -#endif extern uint16_t CRendBin_Combined_BRIR_pIndex_frequency_max_diffuse_16kHz[BINAURAL_CHANNELS][40]; extern float CRendBin_Combined_BRIR_coeff_re_16kHz[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][1774]; extern float CRendBin_Combined_BRIR_coeff_im_16kHz[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][1774]; diff --git a/lib_rend/ivas_stat_rend.h b/lib_rend/ivas_stat_rend.h index 794103d66..07e7edc13 100644 --- a/lib_rend/ivas_stat_rend.h +++ b/lib_rend/ivas_stat_rend.h @@ -1192,12 +1192,8 @@ typedef struct ivas_hrtfs_structure uint16_t index_frequency_max_diffuse; int16_t max_num_ir; int16_t max_num_iterations; -#ifdef FIX_INV_DIFFUSE_WEIGHT float inv_diffuse_weight[BINAURAL_CHANNELS][MAX_INTERN_CHANNELS]; /* inverse diffuse weights array, access one inverse weight by pInvDiffuseWeight[channel] */ int16_t same_inv_diffuse_weight; -#else - float inv_diffuse_weight[MAX_INTERN_CHANNELS]; /* inverse diffuse weights array, access one inverse weight by pInvDiffuseWeight[channel] */ -#endif int16_t init_from_rom; float gain_lfe; @@ -1209,13 +1205,8 @@ typedef struct ivas_crend_state_t { float *freq_buffer_re[MAX_INTERN_CHANNELS]; float *freq_buffer_im[MAX_INTERN_CHANNELS]; -#ifdef FIX_INV_DIFFUSE_WEIGHT float *freq_buffer_re_diffuse[BINAURAL_CHANNELS]; float *freq_buffer_im_diffuse[BINAURAL_CHANNELS]; -#else - float *freq_buffer_re_diffuse; - float *freq_buffer_im_diffuse; -#endif float *prev_out_buffer[BINAURAL_CHANNELS]; float *lfe_delay_line; float m_fYaw; diff --git a/lib_util/hrtf_file_reader.c b/lib_util/hrtf_file_reader.c index 9a1f31f65..201f72b84 100644 --- a/lib_util/hrtf_file_reader.c +++ b/lib_util/hrtf_file_reader.c @@ -1131,7 +1131,6 @@ static ivas_error create_HRTF_from_rawdata( hrtf_data_rptr += sizeof( uint16_t ); #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[0][i] = *( (float *) ( hrtf_data_rptr ) ); @@ -1143,15 +1142,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[i] = *( (float *) ( hrtf_data_rptr ) ); - 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++ ) { @@ -1159,14 +1149,6 @@ static ivas_error create_HRTF_from_rawdata( ( *hHRTF )->inv_diffuse_weight[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] = *( (float *) ( hrtf_data_rptr ) ); - hrtf_data_rptr += sizeof( float ); - } -#endif #endif -- GitLab From 8310d128d2e75157d4291bd840ff7527c9e79a27 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Tue, 8 Jul 2025 15:22:15 +0200 Subject: [PATCH 10/13] [cleanup] accept NONBE_FIX_AVG_IAC_CLDFB_REVERB --- lib_com/ivas_cnst.h | 4 - lib_com/options.h | 1 - lib_rend/ivas_reverb_utils.c | 4 - lib_rend/ivas_rom_binaural_crend_head.c | 99 ------------------------- lib_rend/ivas_rom_binaural_crend_head.h | 6 -- lib_util/hrtf_file_reader.c | 37 --------- 6 files changed, 151 deletions(-) diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index 802287c8d..07d70b083 100644 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -1590,15 +1590,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 4e863a85b..4e661f307 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -177,7 +177,6 @@ #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_reverb_utils.c b/lib_rend/ivas_reverb_utils.c index c45c03cf9..89d36dd4e 100644 --- a/lib_rend/ivas_reverb_utils.c +++ b/lib_rend/ivas_reverb_utils.c @@ -532,11 +532,7 @@ static ivas_error ivas_reverb_get_fastconv_hrtf_set_energies( ivas_error error; #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.c b/lib_rend/ivas_rom_binaural_crend_head.c index a213ef7d6..65d487bd0 100644 --- a/lib_rend/ivas_rom_binaural_crend_head.c +++ b/lib_rend/ivas_rom_binaural_crend_head.c @@ -7371,7 +7371,6 @@ const float defaultHRIR_right_avg_power_32kHz[LR_IAC_LENGTH_NR_FC] = 0.667421f, 0.666896f, 0.666880f, 0.667103f, 0.667228f}; /* Sample Rate = 16000 */ -#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB const float defaultHRIR_coherence_16kHz[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, @@ -7423,104 +7422,6 @@ const float defaultHRIR_right_avg_power_16kHz[LR_IAC_LENGTH_NR_FC_16KHZ] = 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 float defaultHRIR_coherence_16kHz[LR_IAC_LENGTH_NR_FC] = { - 0.969495f, 0.969495f, 0.955351f, 0.919989f, 0.884627f, 0.842799f, 0.775108f, 0.707416f, 0.639724f, - 0.559264f, 0.478804f, 0.398344f, 0.327187f, 0.258355f, 0.189524f, 0.134064f, 0.087519f, 0.040974f, - 0.011416f, 0.007339f, 0.003262f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, - 0.000000f, 0.002562f, 0.005763f, 0.008965f, 0.014937f, 0.022756f, 0.030575f, 0.035595f, 0.036416f, - 0.037238f, 0.037747f, 0.037005f, 0.036264f, 0.035523f, 0.035506f, 0.035489f, 0.035472f, 0.034043f, - 0.032261f, 0.030479f, 0.027264f, 0.023092f, 0.018921f, 0.015179f, 0.012080f, 0.008982f, 0.006557f, - 0.006827f, 0.007098f, 0.007368f, 0.009187f, 0.011006f, 0.012825f, 0.014250f, 0.015575f, 0.016901f, - 0.018085f, 0.019174f, 0.020264f, 0.021306f, 0.022276f, 0.023246f, 0.023984f, 0.023794f, 0.023604f, - 0.023414f, 0.022260f, 0.021105f, 0.019951f, 0.019250f, 0.018662f, 0.018074f, 0.017860f, 0.017894f, - 0.017928f, 0.017558f, 0.016581f, 0.015604f, 0.014403f, 0.012303f, 0.010203f, 0.008103f, 0.006887f, - 0.005671f, 0.004455f, 0.004657f, 0.005213f, 0.005769f, 0.006365f, 0.006987f, 0.007608f, 0.007649f, - 0.006819f, 0.005989f, 0.004992f, 0.003328f, 0.001664f, 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.000038f, 0.000229f, - 0.000420f, 0.000610f, 0.001290f, 0.001970f, 0.002649f, 0.003127f, 0.003555f, 0.003982f, 0.004113f, - 0.004046f, 0.003978f, 0.003618f, 0.002820f, 0.002021f, 0.001296f, 0.000864f, 0.000432f, 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.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.000005f, 0.000011f, 0.000018f, 0.000743f, 0.001947f, 0.003152f, 0.004819f, - 0.007179f, 0.009539f, 0.012160f, 0.015826f, 0.019491f, 0.023157f, 0.028625f, 0.034093f, 0.039562f, - 0.046791f, 0.054462f, 0.062132f, 0.065200f, 0.065200f -}; - -const float defaultHRIR_left_avg_power_16kHz[LR_IAC_LENGTH_NR_FC] = { - 1.112848f, 1.112848f, 1.110615f, 1.105032f, 1.099449f, 1.094383f, 1.091385f, 1.088386f, 1.085388f, - 1.087986f, 1.090583f, 1.093181f, 1.095718f, 1.098238f, 1.100760f, 1.100829f, 1.099264f, 1.097699f, - 1.095677f, 1.092970f, 1.090263f, 1.088142f, 1.088367f, 1.088593f, 1.088819f, 1.092532f, 1.096246f, - 1.099959f, 1.104778f, 1.109873f, 1.114969f, 1.118806f, 1.121804f, 1.124803f, 1.125952f, 1.124327f, - 1.122702f, 1.120550f, 1.116291f, 1.112033f, 1.107774f, 1.105150f, 1.102527f, 1.099903f, 1.098607f, - 1.097642f, 1.096677f, 1.094771f, 1.092238f, 1.089705f, 1.086741f, 1.083131f, 1.079521f, 1.076294f, - 1.074604f, 1.072914f, 1.071224f, 1.070018f, 1.068812f, 1.067606f, 1.064075f, 1.059962f, 1.055849f, - 1.051324f, 1.046526f, 1.041727f, 1.038409f, 1.037312f, 1.036215f, 1.035479f, 1.036192f, 1.036905f, - 1.037618f, 1.035536f, 1.033453f, 1.031371f, 1.028051f, 1.024421f, 1.020792f, 1.018471f, 1.017022f, - 1.015574f, 1.014441f, 1.013780f, 1.013120f, 1.012053f, 1.009355f, 1.006658f, 1.003961f, 1.001331f, - 0.998701f, 0.996071f, 0.995600f, 0.995668f, 0.995737f, 0.996093f, 0.996641f, 0.997189f, 0.997005f, - 0.995722f, 0.994439f, 0.993136f, 0.991757f, 0.990377f, 0.988997f, 0.988491f, 0.987986f, 0.987480f, - 0.985997f, 0.984269f, 0.982542f, 0.980066f, 0.977092f, 0.974118f, 0.971621f, 0.969840f, 0.968058f, - 0.966366f, 0.965026f, 0.963687f, 0.962348f, 0.958809f, 0.955271f, 0.951732f, 0.947645f, 0.943422f, - 0.939198f, 0.936257f, 0.934171f, 0.932086f, 0.930008f, 0.927942f, 0.925876f, 0.923250f, 0.918385f, - 0.913521f, 0.908656f, 0.903702f, 0.898749f, 0.893795f, 0.891002f, 0.888749f, 0.886496f, 0.883996f, - 0.881331f, 0.878666f, 0.874814f, 0.869183f, 0.863553f, 0.858015f, 0.852851f, 0.847687f, 0.842523f, - 0.840022f, 0.837520f, 0.835019f, 0.831781f, 0.828359f, 0.824937f, 0.820011f, 0.814082f, 0.808153f, - 0.802713f, 0.798009f, 0.793305f, 0.789023f, 0.786429f, 0.783835f, 0.781241f, 0.777028f, 0.772815f, - 0.768602f, 0.763134f, 0.757353f, 0.751571f, 0.747112f, 0.743534f, 0.739956f, 0.736838f, 0.734410f, - 0.731982f, 0.729034f, 0.724009f, 0.718984f, 0.713959f, 0.708439f, 0.702918f, 0.697398f, 0.694412f, - 0.692061f, 0.689710f, 0.687330f, 0.684932f, 0.682534f, 0.678706f, 0.672732f, 0.666759f, 0.660939f, - 0.655737f, 0.650536f, 0.645334f, 0.644222f, 0.643110f, 0.641998f, 0.639788f, 0.637303f, 0.634818f, - 0.629683f, 0.622782f, 0.615880f, 0.609823f, 0.605032f, 0.600241f, 0.596372f, 0.596194f, 0.596015f, - 0.595837f, 0.592403f, 0.588969f, 0.585535f, 0.577842f, 0.569084f, 0.560326f, 0.553880f, 0.548977f, - 0.544074f, 0.541240f, 0.541511f, 0.541781f, 0.540837f, 0.535040f, 0.529243f, 0.523446f, 0.510870f, - 0.498293f, 0.485717f, 0.479851f, 0.475663f, 0.471475f, 0.473848f, 0.480595f, 0.487343f, 0.489727f, - 0.485566f, 0.481405f, 0.471747f, 0.440099f, 0.408451f, 0.376804f, 0.330744f, 0.284685f, 0.238626f, - 0.203638f, 0.171419f, 0.139199f, 0.126312f, 0.126312f -}; - -const float defaultHRIR_right_avg_power_16kHz[LR_IAC_LENGTH_NR_FC] = { - 1.112848f, 1.112848f, 1.110615f, 1.105033f, 1.099450f, 1.094384f, 1.091385f, 1.088385f, 1.085385f, - 1.087983f, 1.090582f, 1.093180f, 1.095717f, 1.098238f, 1.100758f, 1.100828f, 1.099264f, 1.097700f, - 1.095678f, 1.092969f, 1.090259f, 1.088138f, 1.088365f, 1.088592f, 1.088819f, 1.092533f, 1.096246f, - 1.099960f, 1.104778f, 1.109872f, 1.114967f, 1.118803f, 1.121802f, 1.124800f, 1.125950f, 1.124325f, - 1.122701f, 1.120550f, 1.116290f, 1.112030f, 1.107770f, 1.105148f, 1.102526f, 1.099904f, 1.098608f, - 1.097642f, 1.096677f, 1.094770f, 1.092237f, 1.089704f, 1.086740f, 1.083130f, 1.079521f, 1.076295f, - 1.074604f, 1.072914f, 1.071223f, 1.070018f, 1.068813f, 1.067608f, 1.064076f, 1.059963f, 1.055849f, - 1.051324f, 1.046525f, 1.041726f, 1.038407f, 1.037310f, 1.036213f, 1.035478f, 1.036191f, 1.036904f, - 1.037617f, 1.035535f, 1.033453f, 1.031372f, 1.028051f, 1.024421f, 1.020791f, 1.018470f, 1.017021f, - 1.015573f, 1.014440f, 1.013780f, 1.013121f, 1.012054f, 1.009357f, 1.006659f, 1.003962f, 1.001331f, - 0.998700f, 0.996070f, 0.995598f, 0.995666f, 0.995735f, 0.996091f, 0.996639f, 0.997188f, 0.997004f, - 0.995722f, 0.994439f, 0.993137f, 0.991758f, 0.990378f, 0.988998f, 0.988492f, 0.987987f, 0.987481f, - 0.985997f, 0.984269f, 0.982541f, 0.980065f, 0.977091f, 0.974118f, 0.971621f, 0.969841f, 0.968060f, - 0.966368f, 0.965029f, 0.963689f, 0.962350f, 0.958810f, 0.955270f, 0.951731f, 0.947643f, 0.943419f, - 0.939196f, 0.936255f, 0.934170f, 0.932086f, 0.930009f, 0.927943f, 0.925877f, 0.923251f, 0.918386f, - 0.913520f, 0.908655f, 0.903701f, 0.898748f, 0.893795f, 0.891001f, 0.888748f, 0.886495f, 0.883995f, - 0.881330f, 0.878665f, 0.874814f, 0.869184f, 0.863554f, 0.858016f, 0.852852f, 0.847687f, 0.842522f, - 0.840021f, 0.837520f, 0.835019f, 0.831781f, 0.828358f, 0.824936f, 0.820010f, 0.814081f, 0.808152f, - 0.802713f, 0.798009f, 0.793305f, 0.789024f, 0.786430f, 0.783837f, 0.781244f, 0.777029f, 0.772815f, - 0.768601f, 0.763133f, 0.757353f, 0.751572f, 0.747112f, 0.743534f, 0.739956f, 0.736837f, 0.734410f, - 0.731982f, 0.729034f, 0.724009f, 0.718984f, 0.713959f, 0.708439f, 0.702919f, 0.697399f, 0.694414f, - 0.692063f, 0.689712f, 0.687331f, 0.684932f, 0.682532f, 0.678704f, 0.672731f, 0.666759f, 0.660941f, - 0.655738f, 0.650534f, 0.645331f, 0.644220f, 0.643109f, 0.641999f, 0.639789f, 0.637304f, 0.634819f, - 0.629684f, 0.622783f, 0.615881f, 0.609824f, 0.605033f, 0.600242f, 0.596373f, 0.596194f, 0.596015f, - 0.595837f, 0.592403f, 0.588969f, 0.585535f, 0.577842f, 0.569083f, 0.560324f, 0.553879f, 0.548977f, - 0.544074f, 0.541241f, 0.541511f, 0.541781f, 0.540838f, 0.535041f, 0.529243f, 0.523446f, 0.510869f, - 0.498293f, 0.485717f, 0.479851f, 0.475663f, 0.471475f, 0.473848f, 0.480595f, 0.487343f, 0.489727f, - 0.485566f, 0.481405f, 0.471746f, 0.440098f, 0.408450f, 0.376802f, 0.330743f, 0.284685f, 0.238626f, - 0.203638f, 0.171419f, 0.139199f, 0.126311f, 0.126311f -}; - -#endif #undef WMC_TOOL_SKIP diff --git a/lib_rend/ivas_rom_binaural_crend_head.h b/lib_rend/ivas_rom_binaural_crend_head.h index 10af7ff18..be9058021 100644 --- a/lib_rend/ivas_rom_binaural_crend_head.h +++ b/lib_rend/ivas_rom_binaural_crend_head.h @@ -303,14 +303,8 @@ extern const float defaultHRIR_left_avg_power_32kHz[LR_IAC_LENGTH_NR_FC]; extern const float defaultHRIR_right_avg_power_32kHz[LR_IAC_LENGTH_NR_FC]; /* Sample Rate = 16000 */ -#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB extern const float defaultHRIR_coherence_16kHz[LR_IAC_LENGTH_NR_FC_16KHZ]; extern const float defaultHRIR_left_avg_power_16kHz[LR_IAC_LENGTH_NR_FC_16KHZ]; extern const float defaultHRIR_right_avg_power_16kHz[LR_IAC_LENGTH_NR_FC_16KHZ]; -#else -extern const float defaultHRIR_coherence_16kHz[LR_IAC_LENGTH_NR_FC]; -extern const float defaultHRIR_left_avg_power_16kHz[LR_IAC_LENGTH_NR_FC]; -extern const float defaultHRIR_right_avg_power_16kHz[LR_IAC_LENGTH_NR_FC]; -#endif #endif /* _IVAS_ROM_BINAURAL_CREND_HEAD_ */ diff --git a/lib_util/hrtf_file_reader.c b/lib_util/hrtf_file_reader.c index 201f72b84..1e3f6e165 100644 --- a/lib_util/hrtf_file_reader.c +++ b/lib_util/hrtf_file_reader.c @@ -472,32 +472,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[i] = (float *) malloc( lr_iac_len * sizeof( float ) ); -#else - HrFiltSet_p->lr_energy_and_iac_dyn[i] = (float *) malloc( LR_IAC_LENGTH_NR_FC * sizeof( float ) ); -#endif if ( HrFiltSet_p->lr_energy_and_iac_dyn[i] == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for hrtf data" ); @@ -516,15 +508,9 @@ static ivas_error set_default_reverb_iac_energy( mvr2r( defaultHRIR_coherence_32kHz, HrFiltSet_p->lr_energy_and_iac_dyn[2], LR_IAC_LENGTH_NR_FC ); break; case 16000: -#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB mvr2r( defaultHRIR_left_avg_power_16kHz, HrFiltSet_p->lr_energy_and_iac_dyn[0], lr_iac_len ); mvr2r( defaultHRIR_right_avg_power_16kHz, HrFiltSet_p->lr_energy_and_iac_dyn[1], lr_iac_len ); mvr2r( defaultHRIR_coherence_16kHz, HrFiltSet_p->lr_energy_and_iac_dyn[2], lr_iac_len ); -#else - mvr2r( defaultHRIR_left_avg_power_16kHz, HrFiltSet_p->lr_energy_and_iac_dyn[0], LR_IAC_LENGTH_NR_FC ); - mvr2r( defaultHRIR_right_avg_power_16kHz, HrFiltSet_p->lr_energy_and_iac_dyn[1], LR_IAC_LENGTH_NR_FC ); - mvr2r( defaultHRIR_coherence_16kHz, HrFiltSet_p->lr_energy_and_iac_dyn[2], LR_IAC_LENGTH_NR_FC ); -#endif break; } } @@ -591,7 +577,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 @@ -600,7 +585,6 @@ static ivas_error load_reverb_from_binary( { lr_iac_len = LR_IAC_LENGTH_NR_FC_16KHZ; } -#endif header_check_result = IVAS_ERR_OK; @@ -670,30 +654,9 @@ static ivas_error load_reverb_from_binary( hHrtfStatistics->average_energy_l = hHrtfStatistics->average_energy_l_dyn; 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( hHrtfStatistics->average_energy_l_dyn, sizeof( const float ), lr_iac_len, f_hrtf ); fread( hHrtfStatistics->average_energy_r_dyn, sizeof( const float ), lr_iac_len, f_hrtf ); fread( hHrtfStatistics->inter_aural_coherence_dyn, sizeof( const float ), lr_iac_len, f_hrtf ); -#else - switch ( sampleRate ) - { - case 48000: - memcpy( hHrtfStatistics->average_energy_l_dyn, defaultHRIR_left_avg_power_48kHz, sizeof( float ) * lr_iac_len ); - memcpy( hHrtfStatistics->average_energy_r_dyn, defaultHRIR_left_avg_power_48kHz, sizeof( float ) * lr_iac_len ); - memcpy( hHrtfStatistics->inter_aural_coherence, defaultHRIR_left_avg_power_48kHz, sizeof( float ) * lr_iac_len ); - break; - case 32000: - memcpy( hHrtfStatistics->average_energy_l_dyn, defaultHRIR_left_avg_power_32kHz, sizeof( float ) * lr_iac_len ); - memcpy( hHrtfStatistics->average_energy_r_dyn, defaultHRIR_left_avg_power_32kHz, sizeof( float ) * lr_iac_len ); - memcpy( hHrtfStatistics->inter_aural_coherence, defaultHRIR_left_avg_power_32kHz, sizeof( float ) * lr_iac_len ); - break; - case 16000: - memcpy( hHrtfStatistics->average_energy_l_dyn, defaultHRIR_left_avg_power_16kHz, sizeof( float ) * lr_iac_len ); - memcpy( hHrtfStatistics->average_energy_r_dyn, defaultHRIR_left_avg_power_16kHz, sizeof( float ) * lr_iac_len ); - memcpy( hHrtfStatistics->inter_aural_coherence, defaultHRIR_left_avg_power_16kHz, sizeof( float ) * lr_iac_len ); - break; - } -#endif hHrtfStatistics->fromROM = FALSE; #else /* left/right energy and interaural coherence for late reverb */ -- GitLab From 55bb0166a5445cb024b787e93b82d5f767d2e822 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Tue, 8 Jul 2025 15:22:17 +0200 Subject: [PATCH 11/13] [cleanup] accept NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES --- apps/decoder.c | 25 -- apps/renderer.c | 16 - lib_com/common_api_types.h | 2 - lib_com/options.h | 1 - lib_dec/ivas_binRenderer_internal.c | 4 - lib_dec/ivas_init_dec.c | 17 - lib_dec/ivas_ism_dec.c | 8 - lib_dec/ivas_mct_dec.c | 4 - lib_dec/ivas_stat_dec.h | 2 - lib_dec/lib_dec.c | 2 - lib_dec/lib_dec.h | 2 - lib_rend/ivas_crend.c | 10 - lib_rend/ivas_dirac_dec_binaural_functions.c | 5 - lib_rend/ivas_hrtf.c | 4 - lib_rend/ivas_objectRenderer_mix.c | 21 - lib_rend/ivas_prot_rend.h | 62 --- lib_rend/ivas_reverb.c | 171 -------- lib_rend/ivas_reverb_filter_design.c | 177 -------- lib_rend/ivas_reverb_utils.c | 407 ------------------- lib_rend/ivas_stat_rend.h | 7 - lib_rend/lib_rend.c | 92 ----- lib_rend/lib_rend.h | 2 - lib_util/hrtf_file_reader.c | 131 ------ lib_util/hrtf_file_reader.h | 6 - 24 files changed, 1178 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index affee0411..7ad7441f0 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -189,9 +189,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 DEBUGGING int32_t noClipping; int32_t cnt_frames_limited; @@ -711,16 +709,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 ) { @@ -782,7 +770,6 @@ int main( } -#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 ) ); @@ -800,16 +787,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 } /*------------------------------------------------------------------------------------------* @@ -892,10 +869,8 @@ cleanup: { destroy_SetOfHRTF( hSetOfHRTF ); } -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES IVAS_DEC_GetHrtfStatisticsHandle( hIvasDec, &hHrtfStatistics ); destroy_hrtf_statistics( hHrtfStatistics ); -#endif } IVAS_DEC_Close( &hIvasDec ); diff --git a/apps/renderer.c b/apps/renderer.c index 584b7bd7d..26fc9a7f0 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -659,9 +659,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; @@ -952,16 +950,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 ) { @@ -1020,7 +1008,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" ); @@ -1038,7 +1025,6 @@ int main( destroy_hrtf_statistics( hHrtfStatistics ); } } -#endif } hrtfFileReader_close( &hrtfFileReader ); @@ -1973,9 +1959,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 6046bc2a5..551c5036d 100644 --- a/lib_com/common_api_types.h +++ b/lib_com/common_api_types.h @@ -169,9 +169,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 4e661f307..76cc36657 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -180,7 +180,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 */ #define FIX_777_COMBI_RENDER_CONFIG_FILE /* Philips: Fix for combined renderer config file support */ diff --git a/lib_dec/ivas_binRenderer_internal.c b/lib_dec/ivas_binRenderer_internal.c index e1d6b9233..78d0115cd 100644 --- a/lib_dec/ivas_binRenderer_internal.c +++ b/lib_dec/ivas_binRenderer_internal.c @@ -1172,11 +1172,7 @@ ivas_error ivas_binRenderer_open( /* Allocate memories needed for reverb module */ if ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM || ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV && st_ivas->hOutSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) { -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( ( 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, st_ivas->hHrtfFastConv->fastconvReverberationEneCorrections ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_binaural_reverb_open_fastconv( &( 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.c b/lib_dec/ivas_init_dec.c index e5551c374..7ee397f5a 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -992,12 +992,10 @@ ivas_error ivas_init_decoder_front( return error; } -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( ( error = ivas_HRTF_statistics_binary_open( &st_ivas->hHrtfStatistics ) ) != IVAS_ERR_OK ) { return error; } -#endif } /*-------------------------------------------------------------------* @@ -1148,7 +1146,6 @@ ivas_error ivas_init_decoder( } } -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES /*--------------------------------------------------------------------* * Allocate and initialize HRTF Statistics handle *--------------------------------------------------------------------*/ @@ -1160,7 +1157,6 @@ ivas_error ivas_init_decoder( return error; } } -#endif /*-----------------------------------------------------------------* * Initialize binuaral split rendering @@ -1913,11 +1909,7 @@ ivas_error ivas_init_decoder( if ( st_ivas->hOutSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( ( error = ivas_reverb_open( &st_ivas->hReverb, st_ivas->hHrtfStatistics, st_ivas->hRenderConfig, st_ivas->hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_reverb_open( &st_ivas->hReverb, st_ivas->hDecoderConfig->output_config, NULL, st_ivas->hBinRendererTd->HrFiltSet_p->lr_energy_and_iac, st_ivas->hRenderConfig, st_ivas->hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -1955,13 +1947,8 @@ ivas_error ivas_init_decoder( } } -#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; } @@ -2401,9 +2388,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; @@ -2629,10 +2614,8 @@ void ivas_destroy_dec( /* Parametric binauralizer HRTF filters */ ivas_HRTF_parambin_binary_close( &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.c b/lib_dec/ivas_ism_dec.c index 0f138fd94..330999862 100644 --- a/lib_dec/ivas_ism_dec.c +++ b/lib_dec/ivas_ism_dec.c @@ -185,11 +185,7 @@ static ivas_error ivas_ism_bitrate_switching_dec( } if ( st_ivas->hOutSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( ( error = ivas_reverb_open( &st_ivas->hReverb, st_ivas->hHrtfStatistics, st_ivas->hRenderConfig, st_ivas->hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_reverb_open( &st_ivas->hReverb, st_ivas->hDecoderConfig->output_config, NULL, st_ivas->hBinRendererTd->HrFiltSet_p->lr_energy_and_iac, st_ivas->hRenderConfig, st_ivas->hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK ) -#endif { return error; @@ -214,11 +210,7 @@ static ivas_error ivas_ism_bitrate_switching_dec( ivas_dirac_dec_close_binaural_data( st_ivas->hDiracDecBin ); /* Open Crend Binaural renderer */ -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( ( 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 ( ( 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 { return error; } diff --git a/lib_dec/ivas_mct_dec.c b/lib_dec/ivas_mct_dec.c index 1f5ab85dd..02e2da6eb 100644 --- a/lib_dec/ivas_mct_dec.c +++ b/lib_dec/ivas_mct_dec.c @@ -1245,11 +1245,7 @@ static ivas_error ivas_mc_dec_reconfig( } else if ( st_ivas->hCrendWrapper == NULL && ( st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV || 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 58b90dfee..de3589fb1 100644 --- a/lib_dec/ivas_stat_dec.h +++ b/lib_dec/ivas_stat_dec.h @@ -1075,9 +1075,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 */ float *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.c b/lib_dec/lib_dec.c index ea140b8de..715262e1f 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -1976,7 +1976,6 @@ ivas_error IVAS_DEC_GetHrtfParamBinHandle( } -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES /*---------------------------------------------------------------------* * IVAS_DEC_GetHrtfStatisticsHandle( ) * @@ -1997,7 +1996,6 @@ ivas_error IVAS_DEC_GetHrtfStatisticsHandle( return IVAS_ERR_OK; } -#endif /*---------------------------------------------------------------------* * copyRendererConfigStruct( ) diff --git a/lib_dec/lib_dec.h b/lib_dec/lib_dec.h index 3b0e003c8..9db87b64c 100644 --- a/lib_dec/lib_dec.h +++ b/lib_dec/lib_dec.h @@ -414,12 +414,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_rend/ivas_crend.c b/lib_rend/ivas_crend.c index 9ba3d224f..6a7482ee3 100644 --- a/lib_rend/ivas_crend.c +++ b/lib_rend/ivas_crend.c @@ -1211,11 +1211,7 @@ 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; } @@ -1236,9 +1232,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 int32_t output_Fs, const int16_t num_poses ) { @@ -1368,11 +1362,7 @@ ivas_error ivas_rend_openCrend( if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( ( error = ivas_reverb_open( &( hCrend->hReverb ), hHrtfStatistics, hRendCfg, output_Fs ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_reverb_open( &( 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.c b/lib_rend/ivas_dirac_dec_binaural_functions.c index 459bcc310..28b793e35 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions.c @@ -245,15 +245,10 @@ ivas_error ivas_dirac_dec_init_binaural_data( 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 ( ( 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, ( *phHrtfParambin )->parametricReverberationEneCorrections ) ) != 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, st_ivas->hHrtfParambin->parametricReverberationEneCorrections ) ) != 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.c b/lib_rend/ivas_hrtf.c index a4168fc9f..0d46ab8e4 100644 --- a/lib_rend/ivas_hrtf.c +++ b/lib_rend/ivas_hrtf.c @@ -37,9 +37,7 @@ #include "ivas_error.h" #include "wmc_auto.h" #include "ivas_prot.h" -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES #include "ivas_rom_binaural_crend_head.h" -#endif /*-----------------------------------------------------------------------* * ivas_HRTF_binary_open() @@ -214,7 +212,6 @@ void ivas_HRTF_parambin_binary_close( return; } -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES /*-----------------------------------------------------------------------* * ivas_HRTF_statistics_binary_open() * @@ -307,4 +304,3 @@ ivas_error ivas_HRTF_statistics_init( return IVAS_ERR_OK; } -#endif diff --git a/lib_rend/ivas_objectRenderer_mix.c b/lib_rend/ivas_objectRenderer_mix.c index 110633588..90a63ac11 100644 --- a/lib_rend/ivas_objectRenderer_mix.c +++ b/lib_rend/ivas_objectRenderer_mix.c @@ -391,27 +391,6 @@ static ivas_error DefaultBSplineModel( 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[0] = defaultHRIR_left_avg_power_48kHz; - HrFiltSet_p->lr_energy_and_iac[1] = defaultHRIR_right_avg_power_48kHz; - HrFiltSet_p->lr_energy_and_iac[2] = defaultHRIR_coherence_48kHz; - break; - case 32000: - HrFiltSet_p->lr_energy_and_iac[0] = defaultHRIR_left_avg_power_32kHz; - HrFiltSet_p->lr_energy_and_iac[1] = defaultHRIR_right_avg_power_32kHz; - HrFiltSet_p->lr_energy_and_iac[2] = defaultHRIR_coherence_32kHz; - break; - case 16000: - HrFiltSet_p->lr_energy_and_iac[0] = defaultHRIR_left_avg_power_16kHz; - HrFiltSet_p->lr_energy_and_iac[1] = defaultHRIR_right_avg_power_16kHz; - HrFiltSet_p->lr_energy_and_iac[2] = defaultHRIR_coherence_16kHz; - break; - } -#endif /* Set ROM flag for correct deallocation */ diff --git a/lib_rend/ivas_prot_rend.h b/lib_rend/ivas_prot_rend.h index 3bf8bfb31..876a6f91c 100644 --- a/lib_rend/ivas_prot_rend.h +++ b/lib_rend/ivas_prot_rend.h @@ -581,7 +581,6 @@ void ivas_HRTF_CRend_binary_close( 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 */ @@ -595,7 +594,6 @@ ivas_error ivas_HRTF_statistics_binary_open( HRTFS_STATISTICS **hHrtfStatistics /* i/o: HRTF statistics structure */ ); -#endif /*----------------------------------------------------------------------------------* * TD object renderer @@ -868,9 +866,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 int32_t output_Fs, const int16_t num_poses ); @@ -913,43 +909,17 @@ ivas_error ivas_rend_crendProcessSubframe( *----------------------------------------------------------------------------------*/ -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES ivas_error ivas_binaural_reverb_init( -#else -ivas_error ivas_binaural_reverb_open_fastconv( -#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 int16_t numBins, /* i : number of CLDFB bins */ const int16_t 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 int32_t sampling_rate, /* i : sampling rate */ -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES const float *defaultTimes, /* i : default reverberation times */ const float *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 int16_t numBins, /* i : number of CLDFB bins */ - const int16_t numCldfbSlotsPerFrame, /* i : number of CLDFB slots per frame */ - IVAS_ROOM_ACOUSTICS_CONFIG_DATA *roomAcoustics, /* i/o: room acoustics parameters */ - const int32_t sampling_rate, /* i : sampling rate */ - const HRTFS_PARAMBIN_HANDLE hHrtfParambin /* i : Parametric binauralizer HRTF handle */ -); -#endif void ivas_binaural_reverb_close( REVERB_STRUCT_HANDLE *hReverb /* i/o: binaural reverb handle */ @@ -967,13 +937,7 @@ void ivas_binaural_reverb_processSubframe( ivas_error ivas_reverb_open( 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 float *lr_energy_and_iac[], /* i : precomuputed lr energies and iac */ -#endif RENDER_CONFIG_DATA *pConfig, /* i : Reverb configuration */ const int32_t output_Fs /* i : output sampling rate */ ); @@ -1130,23 +1094,12 @@ void ivas_reverb_calc_color_levels( float *pTarget_color_R ); -#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( const int16_t input_table_size, @@ -1159,21 +1112,6 @@ void ivas_reverb_interpolate_acoustic_data( float *pOutput_dsr ); -#ifndef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES -void ivas_reverb_get_hrtf_set_properties( - float **ppHrtf_set_L_re, - float **ppHrtf_set_L_im, - float **ppHrtf_set_R_re, - float **ppHrtf_set_R_im, - const AUDIO_CONFIG input_audio_config, - const int16_t hrtf_count, - const int16_t in_freq_count, - const int16_t out_freq_count, - float *pOut_avg_pwr_L, - float *pOut_avg_pwr_R, - float *pOut_i_a_coherence -); -#endif /*---------------------------------------------------------------------------------* * Shoebox Prototypes diff --git a/lib_rend/ivas_reverb.c b/lib_rend/ivas_reverb.c index 87400c5df..b04655b71 100644 --- a/lib_rend/ivas_reverb.c +++ b/lib_rend/ivas_reverb.c @@ -939,69 +939,13 @@ static void set_fft_and_datablock_sizes( static void set_reverb_acoustic_data( 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 int16_t subframe_len, -#endif const int16_t nr_fc_input, const int16_t nr_fc_fft_filter ) { -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES int16_t bin_idx; -#else - int16_t nr_out_ch, hrtf_idx, offset, iter_idx, bin_idx; -#endif float ln_1e6_inverted, delay_diff, exp_argument; -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES -#else - float *pHrtf_set_l_re[MAX_INTERN_CHANNELS]; - float *pHrtf_set_l_im[MAX_INTERN_CHANNELS]; - float *pHrtf_set_r_re[MAX_INTERN_CHANNELS]; - float *pHrtf_set_r_im[MAX_INTERN_CHANNELS]; - - /* 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; - for ( iter_idx = 0; iter_idx < hHrtf->num_iterations[hrtf_idx][nr_out_ch] - 1; iter_idx++ ) - { - offset += hHrtf->pIndex_frequency_max[hrtf_idx][nr_out_ch][iter_idx]; - } - - if ( nr_out_ch == 0 ) - { - pHrtf_set_l_re[hrtf_idx] = &hHrtf->pOut_to_bin_re[hrtf_idx][0][offset]; - pHrtf_set_l_im[hrtf_idx] = &hHrtf->pOut_to_bin_im[hrtf_idx][0][offset]; - } - else - { - pHrtf_set_r_re[hrtf_idx] = &hHrtf->pOut_to_bin_re[hrtf_idx][1][offset]; - pHrtf_set_r_im[hrtf_idx] = &hHrtf->pOut_to_bin_im[hrtf_idx][1][offset]; - } - } - } - - /* Compute HRTF set properties using frequency-domain HRTF data */ - ivas_reverb_get_hrtf_set_properties( pHrtf_set_l_re, pHrtf_set_l_im, pHrtf_set_r_re, pHrtf_set_r_im, input_audio_config, hHrtf->max_num_ir, subframe_len, - nr_fc_fft_filter, pParams->pHrtf_avg_pwr_response_l, pParams->pHrtf_avg_pwr_response_r, pParams->pHrtf_inter_aural_coherence ); - - pParams->pHrtf_avg_pwr_response_l_const = (const float *) pParams->pHrtf_avg_pwr_response_l; - pParams->pHrtf_avg_pwr_response_r_const = (const float *) pParams->pHrtf_avg_pwr_response_r; - pParams->pHrtf_inter_aural_coherence_const = (const float *) pParams->pHrtf_inter_aural_coherence; - } -#endif /* interpolate input table data for T60 and DSR to the FFT filter grid */ ivas_reverb_interpolate_acoustic_data( nr_fc_input, pRoomAcoustics->pFc_input, pRoomAcoustics->pAcoustic_rt60, pRoomAcoustics->pAcoustic_dsr, @@ -1097,13 +1041,7 @@ static ivas_error setup_FDN_branches( ivas_error ivas_reverb_open( 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 float *lr_energy_and_iac[], /* i : precomuputed lr energies and iac */ -#endif RENDER_CONFIG_HANDLE hRenderConfig, /* i : Renderer configuration handle */ const int32_t output_Fs /* i : output sampling rate */ ) @@ -1177,21 +1115,10 @@ ivas_error ivas_reverb_open( params.pFc[bin_idx] = freq_step * bin_idx; } -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES set_reverb_acoustic_data( ¶ms, &hRenderConfig->roomAcoustics, nr_fc_input, nr_fc_fft_filter ); params.pHrtf_avg_pwr_response_l_const = hHrtfStatistics->average_energy_l; params.pHrtf_avg_pwr_response_r_const = hHrtfStatistics->average_energy_r; params.pHrtf_inter_aural_coherence_const = hHrtfStatistics->inter_aural_coherence; -#else - if ( hHrtf == NULL && lr_energy_and_iac != NULL ) - { - params.pHrtf_avg_pwr_response_l_const = lr_energy_and_iac[0]; - params.pHrtf_avg_pwr_response_r_const = lr_energy_and_iac[1]; - params.pHrtf_inter_aural_coherence_const = lr_energy_and_iac[2]; - } - /* set up reverb acoustic data on the basis of HRTF data and renderer config */ - set_reverb_acoustic_data( ¶ms, input_audio_config, hHrtf, &hRenderConfig->roomAcoustics, subframe_len, nr_fc_input, nr_fc_fft_filter ); -#endif /* set reverb acoustic configuration based on renderer config */ #ifdef DEBUGGING @@ -1904,7 +1831,6 @@ static ivas_error ivas_binaural_reverb_open( return IVAS_ERR_OK; } -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES /*------------------------------------------------------------------------- * ivas_binaural_reverb_init() * @@ -1953,103 +1879,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( - REVERB_STRUCT_HANDLE *hReverbPr, /* i/o: binaural reverb handle */ - const int16_t numBins, /* i : number of CLDFB bins */ - const int16_t 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 int32_t sampling_rate, /* i : sampling rate */ - const HRTFS_FASTCONV_HANDLE hHrtfFastConv /* i : FastConv HRTF handle */ -) -{ - ivas_error error; - const float *revTimes; - const float *revEne; - float t60[CLDFB_NO_CHANNELS_MAX]; - float ene[CLDFB_NO_CHANNELS_MAX]; - int16_t preDelay; - - error = IVAS_ERR_OK; - - if ( ( roomAcoustics != NULL ) && roomAcoustics->override ) - { - revTimes = t60; - revEne = ene; - if ( ( error = ivas_reverb_prepare_cldfb_params( roomAcoustics, hHrtfFastConv, internal_config, false, sampling_rate, t60, ene ) ) != IVAS_ERR_OK ) - { - return error; - } - preDelay = (int16_t) roundf( 48000.0f * roomAcoustics->acousticPreDelay / CLDFB_NO_CHANNELS_MAX ); - } - else - { - revTimes = hHrtfFastConv->fastconvReverberationTimes; - revEne = hHrtfFastConv->fastconvReverberationEneCorrections; - preDelay = 10; - } - - error = ivas_binaural_reverb_open( 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 int16_t numBins, /* i : number of CLDFB bins */ - const int16_t numCldfbSlotsPerFrame, /* i : number of CLDFB slots per frame */ - IVAS_ROOM_ACOUSTICS_CONFIG_DATA *roomAcoustics, /* i/o: room acoustics parameters */ - const int32_t sampling_rate, /* i : sampling rate */ - const HRTFS_PARAMBIN_HANDLE hHrtfParambin /* i : Parametric binauralizer HRTF handle */ -) -{ - ivas_error error; - const float *revTimes; - const float *revEne; - float t60[CLDFB_NO_CHANNELS_MAX]; - float ene[CLDFB_NO_CHANNELS_MAX]; - int16_t preDelay; - - error = IVAS_ERR_OK; - - if ( ( roomAcoustics != NULL ) && roomAcoustics->override ) - { - revTimes = t60; - revEne = ene; - /* Todo Philips: This needs a suitable function for ParamBin here. */ - // if ( ( error = ivas_reverb_prepare_cldfb_params( roomAcoustics, hHrtfFastConv, internal_config, false, sampling_rate, t60, ene ) ) != IVAS_ERR_OK ) - // { - // return error; - // } - preDelay = (int16_t) roundf( 48000.0f * roomAcoustics->acousticPreDelay / CLDFB_NO_CHANNELS_MAX ); - } - else - { - revTimes = hHrtfParambin->parametricReverberationTimes; - revEne = hHrtfParambin->parametricReverberationEneCorrections; - preDelay = 10; - } - - error = ivas_binaural_reverb_open( hReverbPr, numBins, numCldfbSlotsPerFrame, sampling_rate, revTimes, revEne, preDelay ); - - return error; -} -#endif /*------------------------------------------------------------------------- * ivas_binaural_reverb_close() diff --git a/lib_rend/ivas_reverb_filter_design.c b/lib_rend/ivas_reverb_filter_design.c index 64cda8141..0d068dff6 100644 --- a/lib_rend/ivas_reverb_filter_design.c +++ b/lib_rend/ivas_reverb_filter_design.c @@ -655,180 +655,3 @@ void ivas_reverb_interpolate_acoustic_data( } -#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( - float **ppHrtf_set_L_re, - float **ppHrtf_set_L_im, - float **ppHrtf_set_R_re, - float **ppHrtf_set_R_im, - const AUDIO_CONFIG input_audio_config, - const int16_t hrtf_count, - const int16_t in_freq_count, - const int16_t out_freq_count, - float *pOut_avg_pwr_L, - float *pOut_avg_pwr_R, - float *out_i_a_coherence ) -{ - const float foa_sum_coeffs[4][3] = { - { 1.0, 1.0f, 0.0f }, - { 1.0, -1.0f, 0.0f }, - { 1.0, 0.0f, 1.0f }, - { 1.0, 0.0f, -1.0f } - }; - const float inp_freq_step = 0.5f / (float) in_freq_count; - const float inp_freq_offset = 0.5f * inp_freq_step; - const float out_freq_step = 0.5f / (float) ( out_freq_count - 1 ); - - int16_t used_hrtf_count, base_idx, freq_idx, hrtf_idx, out_bin_idx, ch_index, is_ambisonics; - float hrtf_count_inverted, relative_pos, weight_1st; - float avg_pwr_left[2]; - float avg_pwr_right[2]; - float IA_coherence[2]; - - if ( input_audio_config == IVAS_AUDIO_CONFIG_FOA || input_audio_config == IVAS_AUDIO_CONFIG_HOA2 || input_audio_config == IVAS_AUDIO_CONFIG_HOA3 ) - { - is_ambisonics = 1; - used_hrtf_count = 4; /* Using only 1st order HRTFs */ - } - else - { - is_ambisonics = 0; - used_hrtf_count = hrtf_count; - } - - /* Interpolation (linear to a new grid) */ - base_idx = 0; - relative_pos = 0.0f; - hrtf_count_inverted = 1.0f / (float) used_hrtf_count; - - /* 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 float norm_freq = out_freq_step * out_bin_idx; - - /* Computing the bin index in the source data */ - const float tbl_index = ( norm_freq - inp_freq_offset ) / inp_freq_step; - - if ( tbl_index <= 0.0f ) /* In case of extrapolation (below 1st bin), choose nearest */ - { - base_idx = 0; - relative_pos = 0.0f; - } - else - { - base_idx = (int16_t) floorf( tbl_index ); - relative_pos = tbl_index - base_idx; - if ( base_idx > ( in_freq_count - 2 ) ) /* In case of extrapolation (above last bin), choose nearest */ - { - base_idx = in_freq_count - 2; - relative_pos = 1.0f; - } - } - - /* Computing 2 bins data for later interpolation */ - - /* Zeroing before accumalation for average value computing */ - avg_pwr_left[0] = 0.0f; - avg_pwr_left[1] = 0.0f; - avg_pwr_right[0] = 0.0f; - avg_pwr_right[1] = 0.0f; - IA_coherence[0] = 0.0f; - IA_coherence[1] = 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 < used_hrtf_count; hrtf_idx++ ) - { - /* Pointers to current HRTF data */ - float *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 */ - float combined_channels_L_re[2]; - float combined_channels_L_im[2]; - float combined_channels_R_re[2]; - float 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; - current_base_R_ptr_re = ppHrtf_set_R_re[hrtf_idx] + base_idx; - current_base_L_ptr_im = ppHrtf_set_L_im[hrtf_idx] + base_idx; - current_base_R_ptr_im = ppHrtf_set_R_im[hrtf_idx] + base_idx; - } - - /* 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.0f; - combined_channels_R_re[freq_idx] = 0.0f; - combined_channels_L_im[freq_idx] = 0.0f; - combined_channels_R_im[freq_idx] = 0.0f; - - for ( ch_index = 0; ch_index < 3; ch_index++ ) - { - combined_channels_L_re[freq_idx] += foa_sum_coeffs[hrtf_idx][ch_index] * ppHrtf_set_L_re[ch_index][base_idx + freq_idx]; - combined_channels_R_re[freq_idx] += foa_sum_coeffs[hrtf_idx][ch_index] * ppHrtf_set_R_re[ch_index][base_idx + freq_idx]; - combined_channels_L_im[freq_idx] += foa_sum_coeffs[hrtf_idx][ch_index] * ppHrtf_set_L_im[ch_index][base_idx + freq_idx]; - combined_channels_R_im[freq_idx] += foa_sum_coeffs[hrtf_idx][ch_index] * ppHrtf_set_R_im[ch_index][base_idx + freq_idx]; - } - } - - current_base_L_ptr_re = &combined_channels_L_re[0]; - current_base_R_ptr_re = &combined_channels_R_re[0]; - current_base_L_ptr_im = &combined_channels_L_im[0]; - current_base_R_ptr_im = &combined_channels_R_im[0]; - } - - for ( freq_idx = 0; freq_idx < 2; freq_idx++ ) - { - float L_re, L_im, R_re, R_im, C_re; - - L_re = current_base_L_ptr_re[freq_idx]; - R_re = current_base_R_ptr_re[freq_idx]; - L_im = current_base_L_ptr_im[freq_idx]; - R_im = current_base_R_ptr_im[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; - - /* Cross product (Re part) */ - C_re = L_re * R_re + L_im * R_im; - IA_coherence[freq_idx] += C_re; - } - } - - /* Compute the averages and the IA coherence */ - for ( freq_idx = 0; freq_idx < 2; freq_idx++ ) - { - avg_pwr_left[freq_idx] *= hrtf_count_inverted; - avg_pwr_right[freq_idx] *= hrtf_count_inverted; - IA_coherence[freq_idx] = hrtf_count_inverted * IA_coherence[freq_idx] / - sqrtf( avg_pwr_left[freq_idx] * avg_pwr_right[freq_idx] ); - - /* Limiting to (0...1) range in case of small numerical errors or negative values */ - IA_coherence[freq_idx] = min( IA_coherence[freq_idx], 1.0f ); - IA_coherence[freq_idx] = max( IA_coherence[freq_idx], 0.0f ); - } - - /* Computing weighted average of 2 nearest values (1 below + 1 above) for linear interpolation */ - weight_1st = 1.0f - relative_pos; - pOut_avg_pwr_L[out_bin_idx] = weight_1st * avg_pwr_left[0] + relative_pos * avg_pwr_left[1]; - pOut_avg_pwr_R[out_bin_idx] = weight_1st * avg_pwr_right[0] + relative_pos * avg_pwr_right[1]; - out_i_a_coherence[out_bin_idx] = weight_1st * IA_coherence[0] + relative_pos * IA_coherence[1]; - } - - return; -} -#endif diff --git a/lib_rend/ivas_reverb_utils.c b/lib_rend/ivas_reverb_utils.c index 89d36dd4e..e47c3fa8a 100644 --- a/lib_rend/ivas_reverb_utils.c +++ b/lib_rend/ivas_reverb_utils.c @@ -67,11 +67,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 float *avg_pwr_l, const float *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() @@ -81,15 +77,8 @@ static ivas_error ivas_reverb_get_fastconv_hrtf_set_energies( const HRTFS_FASTCO ivas_error ivas_reverb_prepare_cldfb_params( -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES const IVAS_ROOM_ACOUSTICS_CONFIG_DATA *pInput_params, const HRTFS_STATISTICS_HANDLE hHrtfStatistics, -#else - IVAS_ROOM_ACOUSTICS_CONFIG_DATA *pInput_params, - const HRTFS_FASTCONV_HANDLE hHrtfFastConv, - const AUDIO_CONFIG input_audio_config, - const int16_t use_brir, -#endif const int32_t output_Fs, float *pOutput_t60, float *pOutput_ene ) @@ -101,9 +90,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 for ( idx = 0; idx < CLDFB_NO_CHANNELS_MAX; idx++ ) { @@ -124,14 +110,7 @@ ivas_error ivas_reverb_prepare_cldfb_params( 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++ ) { @@ -142,354 +121,8 @@ ivas_error ivas_reverb_prepare_cldfb_params( } -#ifndef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES -/*-----------------------------------------------------------------------------------------* - * Function ivas_cldfb_convolver() - * - * Function for convolving CLDFB-domain data with filter taps - *-----------------------------------------------------------------------------------------*/ - -static void ivas_cldfb_convolver( - cldfb_convolver_state *convolver_state, /* i/o: pointer to convolver state structure */ - float out_CLDFB_real[BINAURAL_CHANNELS][CLDFB_NO_CHANNELS_MAX], /* o : real part of binaural signals */ - float out_CLDFB_imag[BINAURAL_CHANNELS][CLDFB_NO_CHANNELS_MAX], /* o : imag part of binaural signals */ - float in_CLDFB_real[CLDFB_NO_CHANNELS_MAX], /* i : real part of input signals */ - float in_CLDFB_imag[CLDFB_NO_CHANNELS_MAX], /* i : imag part of input signals */ - const int16_t num_conv_bands, /* i : number of convolution bands */ - const int16_t num_taps /* i : number of filter taps */ -) -{ - int16_t band_idx, tap_idx; - float *filter_states_real_ptr, *filter_states_imag_ptr; - const float *filter_taps_left_re_ptr, *filter_taps_left_im_ptr, *filter_taps_right_re_ptr, *filter_taps_right_im_ptr; - - for ( band_idx = 0; band_idx < num_conv_bands; band_idx++ ) - { - float out_real_left, out_real_right, out_imag_left, out_imag_right; - out_real_left = 0.0f; - out_real_right = 0.0f; - out_imag_left = 0.0f; - out_imag_right = 0.0f; - - filter_states_real_ptr = (float *) &( convolver_state->filter_states_re[band_idx][0] ); - filter_states_imag_ptr = (float *) &( convolver_state->filter_states_im[band_idx][0] ); - - filter_taps_left_re_ptr = convolver_state->filter_taps_left_re[band_idx]; - filter_taps_left_im_ptr = convolver_state->filter_taps_left_im[band_idx]; - filter_taps_right_re_ptr = convolver_state->filter_taps_right_re[band_idx]; - filter_taps_right_im_ptr = convolver_state->filter_taps_right_im[band_idx]; - - for ( tap_idx = num_taps - 1; tap_idx > 0; tap_idx-- ) - { - filter_states_real_ptr[tap_idx] = filter_states_real_ptr[tap_idx - 1]; - filter_states_imag_ptr[tap_idx] = filter_states_imag_ptr[tap_idx - 1]; - - /* Left real and imag */ - out_real_left += ( filter_states_real_ptr[tap_idx] * filter_taps_left_re_ptr[tap_idx] ) - ( filter_states_imag_ptr[tap_idx] * filter_taps_left_im_ptr[tap_idx] ); - out_imag_left += ( filter_states_real_ptr[tap_idx] * filter_taps_left_im_ptr[tap_idx] ) + ( filter_states_imag_ptr[tap_idx] * filter_taps_left_re_ptr[tap_idx] ); - - /* Right real and imag*/ - out_real_right += ( filter_states_real_ptr[tap_idx] * filter_taps_right_re_ptr[tap_idx] ) - ( filter_states_imag_ptr[tap_idx] * filter_taps_right_im_ptr[tap_idx] ); - out_imag_right += ( filter_states_real_ptr[tap_idx] * filter_taps_right_im_ptr[tap_idx] ) + ( filter_states_imag_ptr[tap_idx] * filter_taps_right_re_ptr[tap_idx] ); - } - - filter_states_real_ptr[0] = in_CLDFB_real[band_idx]; - filter_states_imag_ptr[0] = in_CLDFB_imag[band_idx]; - - /* Left real and imag */ - out_CLDFB_real[0][band_idx] += out_real_left + ( filter_states_real_ptr[0] * filter_taps_left_re_ptr[0] ) - ( filter_states_imag_ptr[0] * filter_taps_left_im_ptr[0] ); - out_CLDFB_imag[0][band_idx] += out_imag_left + ( filter_states_real_ptr[0] * filter_taps_left_im_ptr[0] ) + ( filter_states_imag_ptr[0] * filter_taps_left_re_ptr[0] ); - - /* Right real and imag */ - out_CLDFB_real[1][band_idx] += out_real_right + ( filter_states_real_ptr[0] * filter_taps_right_re_ptr[0] ) - ( filter_states_imag_ptr[0] * filter_taps_right_im_ptr[0] ); - out_CLDFB_imag[1][band_idx] += out_imag_right + ( filter_states_real_ptr[0] * filter_taps_right_im_ptr[0] ) + ( filter_states_imag_ptr[0] * filter_taps_right_re_ptr[0] ); - } - - return; -} - - -/*-----------------------------------------------------------------------------------------* - * Function get_IR_from_filter_taps() - * - * Function converts CLDFB filter taps into time-domain data - *-----------------------------------------------------------------------------------------*/ - -static ivas_error get_IR_from_filter_taps( - const HRTFS_FASTCONV_HANDLE hHrtfFastConv, - const int16_t hrtf_idx, - const AUDIO_CONFIG input_audio_config, - const int16_t use_brir, - const int32_t sampling_rate, - const int16_t pulse_length, - float *pOut_l, - float *pOut_r ) -{ - int16_t i, j, band_idx, block_idx, block_len, block_count, input_sample_idx, output_sample_idx, array_idx; - HANDLE_CLDFB_FILTER_BANK handle_cldfb_analysis, handle_cldfb_synthesis_l, handle_cldfb_synthesis_r; - cldfb_convolver_state convolver_state; - float real_buffer_in[CLDFB_NO_CHANNELS_MAX]; - float imag_buffer_in[CLDFB_NO_CHANNELS_MAX]; - float out_CLDFB_real[BINAURAL_CHANNELS][CLDFB_NO_CHANNELS_MAX]; /* o : real part of Binaural signals */ - float out_CLDFB_imag[BINAURAL_CHANNELS][CLDFB_NO_CHANNELS_MAX]; /* o : imag part of Binaural signals */ - float dirac_pls[CLDFB_NO_CHANNELS_MAX + 1]; - ivas_error error; - - block_len = (int16_t) ( sampling_rate * INV_CLDFB_BANDWIDTH ); - block_count = N_INITIAL_IGNORED_FRAMES + ( pulse_length / block_len ); - - set_f( dirac_pls, 0, block_len + 1 ); - dirac_pls[0] = 1.0f; - input_sample_idx = 0; - output_sample_idx = 0; - - /* Assign CLDFB taps */ - if ( input_audio_config == IVAS_AUDIO_CONFIG_HOA3 ) - { - for ( band_idx = 0; band_idx < BINAURAL_CONVBANDS; band_idx++ ) - { - convolver_state.filter_taps_left_re[band_idx] = hHrtfFastConv->leftHRIRReal_HOA3[band_idx][hrtf_idx]; - convolver_state.filter_taps_left_im[band_idx] = hHrtfFastConv->leftHRIRImag_HOA3[band_idx][hrtf_idx]; - convolver_state.filter_taps_right_re[band_idx] = hHrtfFastConv->rightHRIRReal_HOA3[band_idx][hrtf_idx]; - convolver_state.filter_taps_right_im[band_idx] = hHrtfFastConv->rightHRIRImag_HOA3[band_idx][hrtf_idx]; - } - } - else if ( input_audio_config == IVAS_AUDIO_CONFIG_HOA2 ) - { - for ( band_idx = 0; band_idx < BINAURAL_CONVBANDS; band_idx++ ) - { - convolver_state.filter_taps_left_re[band_idx] = hHrtfFastConv->leftHRIRReal_HOA2[band_idx][hrtf_idx]; - convolver_state.filter_taps_left_im[band_idx] = hHrtfFastConv->leftHRIRImag_HOA2[band_idx][hrtf_idx]; - convolver_state.filter_taps_right_re[band_idx] = hHrtfFastConv->rightHRIRReal_HOA2[band_idx][hrtf_idx]; - convolver_state.filter_taps_right_im[band_idx] = hHrtfFastConv->rightHRIRImag_HOA2[band_idx][hrtf_idx]; - } - } - else if ( input_audio_config == IVAS_AUDIO_CONFIG_FOA ) - { - for ( band_idx = 0; band_idx < BINAURAL_CONVBANDS; band_idx++ ) - { - convolver_state.filter_taps_left_re[band_idx] = hHrtfFastConv->leftHRIRReal_FOA[band_idx][hrtf_idx]; - convolver_state.filter_taps_left_im[band_idx] = hHrtfFastConv->leftHRIRImag_FOA[band_idx][hrtf_idx]; - convolver_state.filter_taps_right_re[band_idx] = hHrtfFastConv->rightHRIRReal_FOA[band_idx][hrtf_idx]; - convolver_state.filter_taps_right_im[band_idx] = hHrtfFastConv->rightHRIRImag_FOA[band_idx][hrtf_idx]; - } - } - else - { - array_idx = 0; - if ( input_audio_config == IVAS_AUDIO_CONFIG_5_1 ) - { - array_idx = channelIndex_CICP6[hrtf_idx]; - } - else if ( input_audio_config == IVAS_AUDIO_CONFIG_7_1 ) - { - array_idx = channelIndex_CICP12[hrtf_idx]; - } - else if ( input_audio_config == IVAS_AUDIO_CONFIG_5_1_2 ) - { - array_idx = channelIndex_CICP14[hrtf_idx]; - } - else if ( input_audio_config == IVAS_AUDIO_CONFIG_5_1_4 ) - { - array_idx = channelIndex_CICP16[hrtf_idx]; - } - else if ( input_audio_config == IVAS_AUDIO_CONFIG_7_1_4 ) - { - array_idx = channelIndex_CICP19[hrtf_idx]; - } - - if ( use_brir ) - { - for ( band_idx = 0; band_idx < BINAURAL_CONVBANDS; band_idx++ ) - { - convolver_state.filter_taps_left_re[band_idx] = hHrtfFastConv->leftBRIRReal[band_idx][array_idx]; - convolver_state.filter_taps_left_im[band_idx] = hHrtfFastConv->leftBRIRImag[band_idx][array_idx]; - convolver_state.filter_taps_right_re[band_idx] = hHrtfFastConv->rightBRIRReal[band_idx][array_idx]; - convolver_state.filter_taps_right_im[band_idx] = hHrtfFastConv->rightBRIRImag[band_idx][array_idx]; - } - } - else - { - for ( band_idx = 0; band_idx < BINAURAL_CONVBANDS; band_idx++ ) - { - convolver_state.filter_taps_left_re[band_idx] = hHrtfFastConv->leftHRIRReal[band_idx][array_idx]; - convolver_state.filter_taps_left_im[band_idx] = hHrtfFastConv->leftHRIRImag[band_idx][array_idx]; - convolver_state.filter_taps_right_re[band_idx] = hHrtfFastConv->rightHRIRReal[band_idx][array_idx]; - convolver_state.filter_taps_right_im[band_idx] = hHrtfFastConv->rightHRIRImag[band_idx][array_idx]; - } - } - } - - for ( i = 0; i < BINAURAL_CONVBANDS; i++ ) - { - for ( j = 0; j < CLDFB_CONVOLVER_NTAPS_MAX; j++ ) - { - convolver_state.filter_states_re[i][j] = 0; - convolver_state.filter_states_im[i][j] = 0; - } - } - - if ( ( error = openCldfb( &handle_cldfb_analysis, CLDFB_ANALYSIS, sampling_rate, CLDFB_PROTOTYPE_5_00MS ) ) != IVAS_ERR_OK ) - { - return error; - } - if ( ( error = openCldfb( &handle_cldfb_synthesis_l, CLDFB_SYNTHESIS, sampling_rate, CLDFB_PROTOTYPE_5_00MS ) ) != IVAS_ERR_OK ) - { - return error; - } - if ( ( error = openCldfb( &handle_cldfb_synthesis_r, CLDFB_SYNTHESIS, sampling_rate, CLDFB_PROTOTYPE_5_00MS ) ) != IVAS_ERR_OK ) - { - return error; - } - - /* Main loop for convolving dirac pulse with CLDFB filter taps */ - for ( block_idx = 0; block_idx < block_count; block_idx++ ) - { - float *ppRealBuf[1]; - float *ppImagBuf[1]; - - cldfbAnalysis_ts( &dirac_pls[input_sample_idx], real_buffer_in, imag_buffer_in, block_len, handle_cldfb_analysis ); - - /* Perform convolution */ - - for ( i = 0; i < BINAURAL_CHANNELS; i++ ) - { - for ( j = 0; j < CLDFB_NO_CHANNELS_MAX; j++ ) - { - out_CLDFB_real[i][j] = 0; - out_CLDFB_imag[i][j] = 0; - } - } - - ivas_cldfb_convolver( &convolver_state, out_CLDFB_real, out_CLDFB_imag, real_buffer_in, imag_buffer_in, BINAURAL_CONVBANDS, BINAURAL_NTAPS ); - - ppRealBuf[0] = out_CLDFB_real[0]; - ppImagBuf[0] = out_CLDFB_imag[0]; - cldfbSynthesis( ppRealBuf, ppImagBuf, &pOut_l[output_sample_idx], block_len, handle_cldfb_synthesis_l ); - - ppRealBuf[0] = out_CLDFB_real[1]; - ppImagBuf[0] = out_CLDFB_imag[1]; - cldfbSynthesis( ppRealBuf, ppImagBuf, &pOut_r[output_sample_idx], block_len, handle_cldfb_synthesis_r ); - - if ( input_sample_idx == 0 ) - { - input_sample_idx = 1; - } - - if ( block_idx >= N_INITIAL_IGNORED_FRAMES ) - { - output_sample_idx += block_len; - } - } - - deleteCldfb( &handle_cldfb_analysis ); - deleteCldfb( &handle_cldfb_synthesis_l ); - deleteCldfb( &handle_cldfb_synthesis_r ); - - return IVAS_ERR_OK; -} - - -/*-----------------------------------------------------------------------------------------* - * 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, IR_length, log2_fft_size, half_fft_size, freq_count; - ivas_error error; - - fft_size = RV_FILTER_MAX_FFT_SIZE; - 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++ ) - { - if ( ( error = get_IR_from_filter_taps( hHrtfFastConv, hrtf_idx, input_audio_config, use_brir, sampling_rate, IR_length, current_HRTF_data_L, current_HRTF_data_R ) ) != IVAS_ERR_OK ) - { - return error; - } - /* 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() * @@ -500,65 +133,25 @@ static ivas_error ivas_reverb_get_cldfb_hrtf_set_properties( static void ivas_reverb_set_energies( const float *avg_pwr_l, const float *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; const int16_t cldfb_freq_halfstep = MAX_SAMPLING_RATE / ( 4 * CLDFB_NO_CHANNELS_MAX ); -#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]; float output_fc[CLDFB_NO_CHANNELS_MAX]; -#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++ ) { input_fc[freq_idx] = freq_idx * ( 0.5f * sampling_rate / (float) ( avg_pwr_len - 1 ) ); } -#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 for ( freq_idx = 0; freq_idx < CLDFB_NO_CHANNELS_MAX; freq_idx++ ) { output_fc[freq_idx] = (float) ( ( 2 * freq_idx + 1 ) * cldfb_freq_halfstep ); } -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES ivas_reverb_interpolate_acoustic_data( avg_pwr_len, input_fc, avg_pwr_l, avg_pwr_r, CLDFB_NO_CHANNELS_MAX, output_fc, avg_pwr_left, avg_pwr_right ); -#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; - } - - ivas_reverb_interpolate_acoustic_data( FFT_SPECTRUM_SIZE, input_fc, avg_pwr_left_fft, avg_pwr_right_fft, CLDFB_NO_CHANNELS_MAX, output_fc, avg_pwr_left, avg_pwr_right ); - - return IVAS_ERR_OK; -#endif } diff --git a/lib_rend/ivas_stat_rend.h b/lib_rend/ivas_stat_rend.h index 07e7edc13..a8a435a56 100644 --- a/lib_rend/ivas_stat_rend.h +++ b/lib_rend/ivas_stat_rend.h @@ -1061,11 +1061,6 @@ typedef struct TDREND_HRFILT_FiltSet_struct ModelParamsITD_t ModelParamsITD; TDREND_HRFILT_Method_t FilterMethod; /* HR filtering method */ float latency_s; -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES -#else - const float *lr_energy_and_iac[3]; /* left/right energy and interaural coherence for late reverb */ - float *lr_energy_and_iac_dyn[3]; -#endif } TDREND_HRFILT_FiltSet_t; @@ -1324,7 +1319,6 @@ typedef struct ivas_hrtfs_parambin_struct } HRTFS_PARAMBIN, *HRTFS_PARAMBIN_HANDLE; #endif -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES typedef struct ivas_hrtfs_statistics_struct { const float *average_energy_l; @@ -1335,7 +1329,6 @@ typedef struct ivas_hrtfs_statistics_struct float *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 /*----------------------------------------------------------------------------------* * Binaural split rendering structures diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index e6acb212a..439133fed 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -184,9 +184,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 @@ -228,11 +226,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 ivas_error renderSbaToMultiBinauralCldfb( @@ -1376,22 +1370,14 @@ static ivas_error setRendInputActiveIsm( if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( ( error = ivas_reverb_open( &( inputIsm->hReverb ), hrtfs->hHrtfStatistics, hRendCfg, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_reverb_open( &( inputIsm->hReverb ), outConfig, NULL, inputIsm->tdRendWrapper.hBinRendererTd->HrFiltSet_p->lr_energy_and_iac, 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 ( ( 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 ( ( 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; } @@ -2067,9 +2053,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; @@ -2156,11 +2140,7 @@ static ivas_error initMcBinauralRendering( if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB && inputMc->hReverb == NULL ) { -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( ( error = ivas_reverb_open( &( inputMc->hReverb ), hHrtfStatistics, hRendCfg, outSampleRate ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_reverb_open( &( inputMc->hReverb ), outConfig, NULL, inputMc->tdRendWrapper.hBinRendererTd->HrFiltSet_p->lr_energy_and_iac, hRendCfg, outSampleRate ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -2169,14 +2149,8 @@ static ivas_error initMcBinauralRendering( else if ( !useTDRend && inputMc->crendWrapper == NULL ) { /* open CREND */ -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( ( 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 ( ( error = ivas_rend_openCrend( &inputMc->crendWrapper, ( 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; } @@ -2357,13 +2331,7 @@ static ivas_error setRendInputActiveMc( if ( getAudioConfigType( outConfig ) == IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL ) { -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( ( error = initMcBinauralRendering( inputMc, inConfig, outConfig, hRendCfg, hrtfs->hSetOfHRTF, hrtfs->hHrtfStatistics, FALSE ) ) != IVAS_ERR_OK ) -#else - if ( ( error = initMcBinauralRendering( inputMc, inConfig, outConfig, hRendCfg, - hrtfs->hSetOfHRTF, - FALSE ) ) != IVAS_ERR_OK ) -#endif { return error; @@ -2523,10 +2491,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 ) { ivas_error error; @@ -2583,11 +2549,7 @@ static ivas_error updateSbaPanGains( } else { -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( ( error = ivas_rend_openCrend( &inputSba->crendWrapper, inConfig, outConfig, hRendCfg, hMixconv, hHrtfStatistics, *rendCtx.pOutSampleRate, rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_rend_openCrend( &inputSba->crendWrapper, inConfig, outConfig, hRendCfg, hMixconv, *rendCtx.pOutSampleRate, rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -2600,11 +2562,7 @@ static ivas_error updateSbaPanGains( { return error; } -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( ( 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 ( ( 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; } @@ -2695,11 +2653,7 @@ static ivas_error setRendInputActiveSba( } } -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( ( error = updateSbaPanGains( inputSba, outConfig, hRendCfg, hrtfs->hSetOfHRTF, hrtfs->hHrtfStatistics ) ) != IVAS_ERR_OK ) -#else - if ( ( error = updateSbaPanGains( inputSba, outConfig, hRendCfg, hrtfs->hSetOfHRTF ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -2739,11 +2693,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; @@ -2754,9 +2704,6 @@ static ivas_error setRendInputActiveMasa( inputMasa = (input_masa *) input; rendCtx = inputMasa->base.ctx; outConfig = *rendCtx.pOutConfig; -#ifndef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES - (void) hRendCfg; /* Suppress warning */ -#endif if ( !isIoConfigPairSupported( inConfig, outConfig ) ) { @@ -2784,11 +2731,7 @@ static ivas_error setRendInputActiveMasa( } else { -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( ( error = initMasaExtRenderer( inputMasa, outConfig, hRendCfg, hrtfs ) ) != IVAS_ERR_OK ) -#else - if ( ( error = initMasaExtRenderer( inputMasa, outConfig, hrtfs ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -2975,9 +2918,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 ( ( error = ivas_HRTF_binary_open( &( hIvasRend->hHrtfs.hHrtfTD ) ) ) != IVAS_ERR_OK ) @@ -2997,19 +2938,15 @@ ivas_error IVAS_REND_Open( return error; } -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( ( error = ivas_HRTF_statistics_binary_open( &( hIvasRend->hHrtfs.hHrtfStatistics ) ) ) != IVAS_ERR_OK ) { return error; } -#endif } -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( ( error = ivas_HRTF_statistics_init( &( hIvasRend->hHrtfs.hHrtfStatistics ), hIvasRend->sampleRateOut ) ) != IVAS_ERR_OK ) { return error; } -#endif return IVAS_ERR_OK; } @@ -3154,11 +3091,7 @@ ivas_error IVAS_REND_ConfigureCustomOutputLoudspeakerLayout( /* Input inactive, skip. */ continue; } -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( ( error = updateSbaPanGains( inputSba, hIvasRend->outputConfig, hIvasRend->hRendererConfig, NULL, NULL ) ) != IVAS_ERR_OK ) -#else - if ( ( error = updateSbaPanGains( inputSba, hIvasRend->outputConfig, hIvasRend->hRendererConfig, NULL ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -3629,9 +3562,7 @@ ivas_error IVAS_REND_ConfigureCustomInputLoudspeakerLayout( hIvasRend->hRendererConfig, hIvasRend->hHrtfs.hSetOfHRTF, -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES hIvasRend->hHrtfs.hHrtfStatistics, -#endif FALSE ) ) != IVAS_ERR_OK ) { return error; @@ -4386,9 +4317,7 @@ ivas_error IVAS_REND_SetHeadRotation( hIvasRend->outputConfig, hIvasRend->hRendererConfig, hIvasRend->hHrtfs.hSetOfHRTF, -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES hIvasRend->hHrtfs.hHrtfStatistics, -#endif TRUE ) ) != IVAS_ERR_OK ) { return error; @@ -4453,9 +4382,7 @@ ivas_error IVAS_REND_DisableHeadRotation( hIvasRend->hRendererConfig, hIvasRend->hHrtfs.hSetOfHRTF, -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES hIvasRend->hHrtfs.hHrtfStatistics, -#endif TRUE ) ) != IVAS_ERR_OK ) { @@ -7609,9 +7536,7 @@ void IVAS_REND_Close( ivas_HRTF_CRend_binary_close( &( hIvasRend->hHrtfs.hSetOfHRTF ) ); ivas_HRTF_fastconv_binary_close( &( hIvasRend->hHrtfs.hHrtfFastConv ) ); ivas_HRTF_parambin_binary_close( &( hIvasRend->hHrtfs.hHrtfParambin ) ); -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES ivas_HRTF_statistics_close( &( hIvasRend->hHrtfs.hHrtfStatistics ) ); -#endif free( hIvasRend ); *phIvasRend = NULL; @@ -7852,7 +7777,6 @@ ivas_error IVAS_REND_GetHrtfParamBinHandle( } -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES /*---------------------------------------------------------------------* * IVAS_REND_GetHrtfStatisticsHandle( ) * @@ -7873,7 +7797,6 @@ ivas_error IVAS_REND_GetHrtfStatisticsHandle( return IVAS_ERR_OK; } -#endif static ivas_error ivas_masa_ext_rend_dirac_rend_init( input_masa *inputMasa ) @@ -8236,13 +8159,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; @@ -8340,15 +8259,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 ( ( error = ivas_binaural_reverb_init( &hDiracDecBin->hReverb, hHrtfStatistics, nBins, CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES, &( hRendCfg->roomAcoustics ), output_Fs, ( *phHrtfParambin )->parametricReverberationTimes, ( *phHrtfParambin )->parametricReverberationEneCorrections ) ) != IVAS_ERR_OK ) #else if ( ( error = ivas_binaural_reverb_init( &hDiracDecBin->hReverb, hHrtfStatistics, nBins, CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES, &( hRendCfg->roomAcoustics ), output_Fs, hHrtfParambin->parametricReverberationTimes, hHrtfParambin->parametricReverberationEneCorrections ) ) != 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 ( ( 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; @@ -8399,9 +8313,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 ) { int16_t i; @@ -8524,11 +8436,7 @@ static ivas_error initMasaExtRenderer( return error; } } -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( ( error = ivas_masa_ext_rend_parambin_init( inputMasa, hRendCfg, hrtfs->hHrtfStatistics ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_masa_ext_rend_parambin_init( inputMasa ) ) != IVAS_ERR_OK ) -#endif { return error; } diff --git a/lib_rend/lib_rend.h b/lib_rend/lib_rend.h index 918e19b1b..21c7df9bb 100644 --- a/lib_rend/lib_rend.h +++ b/lib_rend/lib_rend.h @@ -202,12 +202,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_util/hrtf_file_reader.c b/lib_util/hrtf_file_reader.c index 1e3f6e165..c3e13422c 100644 --- a/lib_util/hrtf_file_reader.c +++ b/lib_util/hrtf_file_reader.c @@ -460,85 +460,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[i] = (float *) malloc( lr_iac_len * sizeof( float ) ); - if ( HrFiltSet_p->lr_energy_and_iac_dyn[i] == NULL ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for hrtf data" ); - } - } - switch ( HrFiltSet_p->SampleRate ) - { - case 48000: - mvr2r( defaultHRIR_left_avg_power_48kHz, HrFiltSet_p->lr_energy_and_iac_dyn[0], LR_IAC_LENGTH_NR_FC ); - mvr2r( defaultHRIR_right_avg_power_48kHz, HrFiltSet_p->lr_energy_and_iac_dyn[1], LR_IAC_LENGTH_NR_FC ); - mvr2r( defaultHRIR_coherence_48kHz, HrFiltSet_p->lr_energy_and_iac_dyn[2], LR_IAC_LENGTH_NR_FC ); - break; - case 32000: - mvr2r( defaultHRIR_left_avg_power_32kHz, HrFiltSet_p->lr_energy_and_iac_dyn[0], LR_IAC_LENGTH_NR_FC ); - mvr2r( defaultHRIR_right_avg_power_32kHz, HrFiltSet_p->lr_energy_and_iac_dyn[1], LR_IAC_LENGTH_NR_FC ); - mvr2r( defaultHRIR_coherence_32kHz, HrFiltSet_p->lr_energy_and_iac_dyn[2], LR_IAC_LENGTH_NR_FC ); - break; - case 16000: - mvr2r( defaultHRIR_left_avg_power_16kHz, HrFiltSet_p->lr_energy_and_iac_dyn[0], lr_iac_len ); - mvr2r( defaultHRIR_right_avg_power_16kHz, HrFiltSet_p->lr_energy_and_iac_dyn[1], lr_iac_len ); - mvr2r( defaultHRIR_coherence_16kHz, HrFiltSet_p->lr_energy_and_iac_dyn[2], lr_iac_len ); - break; - } - } - else - { - switch ( HrFiltSet_p->SampleRate ) - { - case 48000: - HrFiltSet_p->lr_energy_and_iac[0] = defaultHRIR_left_avg_power_48kHz; - HrFiltSet_p->lr_energy_and_iac[1] = defaultHRIR_right_avg_power_48kHz; - HrFiltSet_p->lr_energy_and_iac[2] = defaultHRIR_coherence_48kHz; - break; - case 32000: - HrFiltSet_p->lr_energy_and_iac[0] = defaultHRIR_left_avg_power_32kHz; - HrFiltSet_p->lr_energy_and_iac[1] = defaultHRIR_right_avg_power_32kHz; - HrFiltSet_p->lr_energy_and_iac[2] = defaultHRIR_coherence_32kHz; - break; - case 16000: - HrFiltSet_p->lr_energy_and_iac[0] = defaultHRIR_left_avg_power_16kHz; - HrFiltSet_p->lr_energy_and_iac[1] = defaultHRIR_right_avg_power_16kHz; - HrFiltSet_p->lr_energy_and_iac[2] = defaultHRIR_coherence_16kHz; - break; - } - } - - return IVAS_ERR_OK; -} -#endif /*-------------------------------------------------------------------* * load_reverb_from_binary() @@ -547,18 +468,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; @@ -567,21 +481,13 @@ static ivas_error load_reverb_from_binary( int32_t hrtf_data_size_max; char *hrtf_data; int16_t lr_iac_len; -#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; } @@ -642,7 +548,6 @@ static ivas_error load_reverb_from_binary( if ( is_reverb ) { -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES hHrtfStatistics->average_energy_l_dyn = (float *) malloc( lr_iac_len * sizeof( float ) ); hHrtfStatistics->average_energy_r_dyn = (float *) malloc( lr_iac_len * sizeof( float ) ); hHrtfStatistics->inter_aural_coherence_dyn = (float *) malloc( lr_iac_len * sizeof( float ) ); @@ -658,29 +563,9 @@ static ivas_error load_reverb_from_binary( fread( hHrtfStatistics->average_energy_r_dyn, sizeof( const float ), lr_iac_len, f_hrtf ); fread( hHrtfStatistics->inter_aural_coherence_dyn, sizeof( const float ), lr_iac_len, f_hrtf ); 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[i] = (float *) malloc( lr_iac_len * sizeof( float ) ); - if ( HrFiltSet_p->lr_energy_and_iac_dyn[i] == NULL ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for hrtf data" ); - } - fread( HrFiltSet_p->lr_energy_and_iac_dyn[i], sizeof( const float ), lr_iac_len, f_hrtf ); - HrFiltSet_p->lr_energy_and_iac[i] = (const float *) HrFiltSet_p->lr_energy_and_iac_dyn[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; } @@ -694,22 +579,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 } /*-------------------------------------------------------------------* @@ -965,12 +842,6 @@ void destroy_td_hrtf( free( ( *hHrtf )->ModelEval.hrfModR ); -#ifndef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES - for ( i = 0; i < 3; i++ ) - { - free( ( *hHrtf )->lr_energy_and_iac_dyn[i] ); - } -#endif } ivas_HRTF_binary_close( hHrtf ); @@ -2087,7 +1958,6 @@ void destroy_parambin_hrtf( } -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES /*---------------------------------------------------------------------* * destroy_hrtf_statistics() * @@ -2116,4 +1986,3 @@ void destroy_hrtf_statistics( ivas_HRTF_statistics_close( hHrtfStatistics ); } -#endif diff --git a/lib_util/hrtf_file_reader.h b/lib_util/hrtf_file_reader.h index 2d0eeeb41..a6a9a5ae5 100644 --- a/lib_util/hrtf_file_reader.h +++ b/lib_util/hrtf_file_reader.h @@ -98,12 +98,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 */ ); @@ -189,7 +185,6 @@ void destroy_td_hrtf( IVAS_DEC_HRTF_HANDLE *hHRTF /* i/o: HRTF handle */ ); -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES /*---------------------------------------------------------------------* * destroy_hrtf_statistics() * @@ -199,7 +194,6 @@ void destroy_td_hrtf( void destroy_hrtf_statistics( IVAS_DEC_HRTF_STATISTICS_HANDLE *hHrtfStatistics /* i/o: HRTF statistics handle */ ); -#endif #endif /* IVAS_HRTF_FILE_READER_H */ -- GitLab From 7fb8ffb3e4710c6f324b8f857251b512795cf0df Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Tue, 8 Jul 2025 15:22:20 +0200 Subject: [PATCH 12/13] [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 76cc36657..d28fa86b2 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -182,7 +182,6 @@ #define USE_NEW_HRTF_BINARY_FILE_FORMAT /* Orange: to activate when decided to change the hrtf binary file format */ #define FIX_WARNING_RENDER_CONFIG /* Orange: fix warning on windows build */ -#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 actiate when USE_NEW_HRTF_BINARY_FILE_FORMAT and FIX_777_COMBI_RENDER_CONFIG_FILE are on )*/ /* #################### End BASOP porting switches ############################ */ diff --git a/lib_util/render_config_reader.c b/lib_util/render_config_reader.c index 82d134040..25cefcfbe 100644 --- a/lib_util/render_config_reader.c +++ b/lib_util/render_config_reader.c @@ -2299,11 +2299,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; @@ -2313,11 +2309,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 fac45fae3b96d9a9df0477b4bda815daf0f47755 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Tue, 8 Jul 2025 15:22:43 +0200 Subject: [PATCH 13/13] formatting --- lib_rend/ivas_objectRenderer_mix.c | 1 - lib_rend/ivas_reverb.c | 6 +++--- lib_rend/ivas_reverb_filter_design.c | 2 -- lib_rend/ivas_reverb_utils.c | 2 -- lib_rend/lib_rend.c | 9 +++------ lib_util/hrtf_file_reader.c | 6 ++---- lib_util/hrtf_file_reader.h | 2 +- 7 files changed, 9 insertions(+), 19 deletions(-) diff --git a/lib_rend/ivas_objectRenderer_mix.c b/lib_rend/ivas_objectRenderer_mix.c index 90a63ac11..28c520614 100644 --- a/lib_rend/ivas_objectRenderer_mix.c +++ b/lib_rend/ivas_objectRenderer_mix.c @@ -392,7 +392,6 @@ static ivas_error DefaultBSplineModel( modelITD = &( HrFiltSet_p->ModelParamsITD ); - /* Set ROM flag for correct deallocation */ model->modelROM = TRUE; diff --git a/lib_rend/ivas_reverb.c b/lib_rend/ivas_reverb.c index b04655b71..502883c5a 100644 --- a/lib_rend/ivas_reverb.c +++ b/lib_rend/ivas_reverb.c @@ -1040,10 +1040,10 @@ static ivas_error setup_FDN_branches( *------------------------------------------------------------------------*/ ivas_error ivas_reverb_open( - 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 */ - const int32_t output_Fs /* i : output sampling rate */ + RENDER_CONFIG_HANDLE hRenderConfig, /* i : Renderer configuration handle */ + const int32_t output_Fs /* i : output sampling rate */ ) { ivas_error error; diff --git a/lib_rend/ivas_reverb_filter_design.c b/lib_rend/ivas_reverb_filter_design.c index 0d068dff6..252db4a67 100644 --- a/lib_rend/ivas_reverb_filter_design.c +++ b/lib_rend/ivas_reverb_filter_design.c @@ -653,5 +653,3 @@ void ivas_reverb_interpolate_acoustic_data( return; } - - diff --git a/lib_rend/ivas_reverb_utils.c b/lib_rend/ivas_reverb_utils.c index e47c3fa8a..36a84bd1a 100644 --- a/lib_rend/ivas_reverb_utils.c +++ b/lib_rend/ivas_reverb_utils.c @@ -121,8 +121,6 @@ ivas_error ivas_reverb_prepare_cldfb_params( } - - /*-----------------------------------------------------------------------------------------* * Function ivas_reverb_set_energies() * diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 439133fed..65dbc3ff5 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -2490,10 +2490,8 @@ static ivas_error updateSbaPanGains( input_sba *inputSba, const AUDIO_CONFIG outConfig, RENDER_CONFIG_DATA *hRendCfg, - IVAS_DEC_HRTF_CREND_HANDLE hMixconv - , - IVAS_DEC_HRTF_STATISTICS_HANDLE hHrtfStatistics -) + IVAS_DEC_HRTF_CREND_HANDLE hMixconv, + IVAS_DEC_HRTF_STATISTICS_HANDLE hHrtfStatistics ) { ivas_error error; AUDIO_CONFIG inConfig; @@ -2692,8 +2690,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 c3e13422c..16a1e8e32 100644 --- a/lib_util/hrtf_file_reader.c +++ b/lib_util/hrtf_file_reader.c @@ -470,7 +470,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; @@ -581,7 +581,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 ); @@ -840,8 +840,6 @@ void destroy_td_hrtf( free( ( *hHrtf )->ModelEval.hrfModL ); free( ( *hHrtf )->ModelEval.hrfModR ); - - } ivas_HRTF_binary_close( hHrtf ); diff --git a/lib_util/hrtf_file_reader.h b/lib_util/hrtf_file_reader.h index a6a9a5ae5..fbb280405 100644 --- a/lib_util/hrtf_file_reader.h +++ b/lib_util/hrtf_file_reader.h @@ -100,7 +100,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