From 82d3cc46ad007e0df954111585810576727707b7 Mon Sep 17 00:00:00 2001 From: Serdar Buyuksarac <31622564+sbsarac@users.noreply.github.com> Date: Thu, 26 Oct 2023 13:25:49 +0200 Subject: [PATCH 1/6] Add ivas_reverb_prepare_cldfb_params implementation for ParamBin --- lib_rend/ivas_dirac_dec_binaural_functions.c | 2 +- lib_rend/ivas_prot_rend.h | 11 ++- lib_rend/ivas_reverb.c | 14 ++-- lib_rend/ivas_reverb_utils.c | 81 ++++++++++++++++++++ lib_rend/lib_rend.c | 2 +- 5 files changed, 101 insertions(+), 9 deletions(-) diff --git a/lib_rend/ivas_dirac_dec_binaural_functions.c b/lib_rend/ivas_dirac_dec_binaural_functions.c index 1b912d686f..74f5c6e9df 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions.c @@ -235,7 +235,7 @@ ivas_error ivas_dirac_dec_init_binaural_data( #endif { /* 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 ) + if ( ( error = ivas_binaural_reverb_open_parambin( &hDiracDecBin->hReverb, nBins, CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES, &( st_ivas->hRenderConfig->roomAcoustics ), output_Fs, st_ivas->hHrtfParambin, st_ivas->hBinRendererTd->HrFiltSet_p->lr_energy_and_iac ) ) != IVAS_ERR_OK ) { return error; } diff --git a/lib_rend/ivas_prot_rend.h b/lib_rend/ivas_prot_rend.h index b1063ccf33..5c854bb727 100644 --- a/lib_rend/ivas_prot_rend.h +++ b/lib_rend/ivas_prot_rend.h @@ -915,7 +915,8 @@ ivas_error ivas_binaural_reverb_open_parambin( 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 */ + const HRTFS_PARAMBIN_HANDLE hHrtfParambin, /* i : Parametric binauralizer HRTF handle */ + const float *lr_energy_and_iac[] /* i : precomuputed lr energies and iac */ ); void ivas_binaural_reverb_close( @@ -1102,6 +1103,14 @@ ivas_error ivas_reverb_prepare_cldfb_params( float *pOutput_t60, float *pOutput_ene ); +ivas_error ivas_reverb_prepare_cldfb_params_parametric( + IVAS_ROOM_ACOUSTICS_CONFIG_DATA *pInput_params, + const int32_t output_Fs, + const float *avg_pwr_l, + const float *avg_pwr_r, + float *pOutput_t60, + float *pOutput_ene ); + void ivas_reverb_interpolate_acoustic_data( const int16_t input_table_size, const float *pInput_fc, diff --git a/lib_rend/ivas_reverb.c b/lib_rend/ivas_reverb.c index 2a34a24c48..7fc6109af5 100644 --- a/lib_rend/ivas_reverb.c +++ b/lib_rend/ivas_reverb.c @@ -1940,7 +1940,8 @@ ivas_error ivas_binaural_reverb_open_parambin( 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 */ + const HRTFS_PARAMBIN_HANDLE hHrtfParambin, /* i : Parametric binauralizer HRTF handle */ + const float *lr_energy_and_iac[] /* i : precomuputed lr energies and iac */ ) { ivas_error error; @@ -1956,11 +1957,12 @@ ivas_error ivas_binaural_reverb_open_parambin( { 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; - // } + + if ( ( error = ivas_reverb_prepare_cldfb_params_parametric( roomAcoustics, sampling_rate, lr_energy_and_iac[0], lr_energy_and_iac[1], t60, ene ) ) != IVAS_ERR_OK ) + { + return error; + } + preDelay = (int16_t) roundf( 48000.0f * roomAcoustics->acousticPreDelay / CLDFB_NO_CHANNELS_MAX ); } else diff --git a/lib_rend/ivas_reverb_utils.c b/lib_rend/ivas_reverb_utils.c index 23d7592ce6..8a748006c0 100644 --- a/lib_rend/ivas_reverb_utils.c +++ b/lib_rend/ivas_reverb_utils.c @@ -127,6 +127,87 @@ ivas_error ivas_reverb_prepare_cldfb_params( } +/*-----------------------------------------------------------------------------------------* + * Function ivas_reverb_parametric_set_energies() + * + * Function gets the precalculated left/right energies in FFT spectrum and computes avarage + * left/right energies to CLDFB bin center frequencies. + *-----------------------------------------------------------------------------------------*/ + +static void ivas_reverb_parametric_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 ) +{ + int16_t freq_idx; + const int16_t cldfb_freq_halfstep = MAX_SAMPLING_RATE / ( 4 * CLDFB_NO_CHANNELS_MAX ); + float input_fc[FFT_SPECTRUM_SIZE]; + float output_fc[CLDFB_NO_CHANNELS_MAX]; + + 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 ) ); + } + + for ( freq_idx = 0; freq_idx < CLDFB_NO_CHANNELS_MAX; freq_idx++ ) + { + output_fc[freq_idx] = (float) ( ( 2 * freq_idx + 1 ) * cldfb_freq_halfstep ); + } + + ivas_reverb_interpolate_acoustic_data( FFT_SPECTRUM_SIZE, input_fc, avg_pwr_l, avg_pwr_r, CLDFB_NO_CHANNELS_MAX, output_fc, avg_pwr_l_out, avg_pwr_r_out ); +} + +/*-----------------------------------------------------------------------------------------* + * Function ivas_reverb_prepare_cldfb_params_parametric() + * + * Prepares reverb parameters for CLDFB-based parametric reverberator + *-----------------------------------------------------------------------------------------*/ + +ivas_error ivas_reverb_prepare_cldfb_params_parametric( + IVAS_ROOM_ACOUSTICS_CONFIG_DATA *pInput_params, + const int32_t output_Fs, + const float *avg_pwr_l, + const float *avg_pwr_r, + float *pOutput_t60, + float *pOutput_ene ) +{ + int16_t idx; + float fc[CLDFB_NO_CHANNELS_MAX]; + 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; + ivas_error error; + + for ( idx = 0; idx < CLDFB_NO_CHANNELS_MAX; idx++ ) + { + fc[idx] = ( (float) idx + 0.5f ) * ( (float) MAX_SAMPLING_RATE / (float) ( 2 * CLDFB_NO_CHANNELS_MAX ) ); + } + + ivas_reverb_interpolate_acoustic_data( pInput_params->nBands, pInput_params->pFc_input, pInput_params->pAcoustic_rt60, pInput_params->pAcoustic_dsr, CLDFB_NO_CHANNELS_MAX, fc, pOutput_t60, pOutput_ene ); + + /* adjust DSR for the delay difference */ + delay_diff = pInput_params->inputPreDelay - pInput_params->acousticPreDelay; + ln_1e6_inverted = 1.0f / logf( 1e06f ); + for ( idx = 0; idx < CLDFB_NO_CHANNELS_MAX; idx++ ) + { + exp_argument = delay_diff / ( pOutput_t60[idx] * ln_1e6_inverted ); + /* Limit exponent to approx +/-100 dB in case of incoherent value of delay_diff, to prevent overflow */ + exp_argument = min( exp_argument, 23.0f ); + exp_argument = max( exp_argument, -23.0f ); + pOutput_ene[idx] *= expf( exp_argument ); + } + + float avg_pwr_l_out[CLDFB_NO_CHANNELS_MAX]; + float avg_pwr_r_out[CLDFB_NO_CHANNELS_MAX]; + + ivas_reverb_parametric_set_energies( avg_pwr_l, avg_pwr_r, output_Fs, avg_pwr_l_out, avg_pwr_r_out ); + + for ( idx = 0; idx < CLDFB_NO_CHANNELS_MAX; idx++ ) + { + pOutput_ene[idx] *= 0.5f * ( avg_pwr_l_out[idx] + avg_pwr_r_out[idx] ) * dmx_gain_2; + } + + return IVAS_ERR_OK; +} + + /*-----------------------------------------------------------------------------------------* * Function ivas_cldfb_convolver() * diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index b9ea0bae43..261969dad7 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -8976,7 +8976,7 @@ static ivas_error ivas_masa_ext_rend_parambin_init( #endif { /* 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 ) + if ( ( error = ivas_binaural_reverb_open_parambin( &hDiracDecBin->hReverb, nBins, CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES, NULL, output_Fs, hHrtfParambin, NULL ) ) != IVAS_ERR_OK ) { return error; } -- GitLab From d73979938c1bea64200a19979df7be65863cf9a3 Mon Sep 17 00:00:00 2001 From: Serdar Buyuksarac <31622564+sbsarac@users.noreply.github.com> Date: Mon, 30 Oct 2023 10:41:01 +0100 Subject: [PATCH 2/6] Add pre-computed energies to HRTFS_PARAMBIN_HANDLE --- lib_dec/ivas_dirac_dec.c | 2 +- lib_dec/ivas_init_dec.c | 2 +- lib_dec/ivas_ism_dec.c | 4 +-- lib_rend/ivas_dirac_dec_binaural_functions.c | 26 +++++++++++++++++--- lib_rend/ivas_prot_rend.h | 6 ++--- lib_rend/ivas_reverb.c | 7 +++--- lib_rend/ivas_stat_rend.h | 2 ++ lib_rend/lib_rend.c | 6 ++--- 8 files changed, 37 insertions(+), 18 deletions(-) diff --git a/lib_dec/ivas_dirac_dec.c b/lib_dec/ivas_dirac_dec.c index 2f7c925d5e..1e01abb015 100644 --- a/lib_dec/ivas_dirac_dec.c +++ b/lib_dec/ivas_dirac_dec.c @@ -868,7 +868,7 @@ ivas_error ivas_dirac_dec_config( { if ( st_ivas->renderer_type != RENDERER_STEREO_PARAMETRIC ) { - if ( ( error = ivas_dirac_dec_binaural_copy_hrtfs( &st_ivas->hHrtfParambin ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_dirac_dec_binaural_copy_hrtfs( &st_ivas->hHrtfParambin, output_Fs ) ) != IVAS_ERR_OK ) { return error; } diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index 7ed132c87b..386edd1806 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -1955,7 +1955,7 @@ ivas_error ivas_init_decoder( { if ( st_ivas->renderer_type != RENDERER_STEREO_PARAMETRIC ) { - if ( ( error = ivas_dirac_dec_binaural_copy_hrtfs( &st_ivas->hHrtfParambin ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_dirac_dec_binaural_copy_hrtfs( &st_ivas->hHrtfParambin, st_ivas->hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK ) { return error; } diff --git a/lib_dec/ivas_ism_dec.c b/lib_dec/ivas_ism_dec.c index 7d22eb50ba..56950040da 100644 --- a/lib_dec/ivas_ism_dec.c +++ b/lib_dec/ivas_ism_dec.c @@ -261,7 +261,7 @@ static ivas_error ivas_ism_bitrate_switching_dec( ) { /* open the parametric binaural renderer */ - if ( ( error = ivas_dirac_dec_binaural_copy_hrtfs( &st_ivas->hHrtfParambin ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_dirac_dec_binaural_copy_hrtfs( &st_ivas->hHrtfParambin, st_ivas->hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK ) { return error; } @@ -292,7 +292,7 @@ static ivas_error ivas_ism_bitrate_switching_dec( if ( st_ivas->hOutSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) { /* open the parametric binaural renderer */ - if ( ( error = ivas_dirac_dec_binaural_copy_hrtfs( &st_ivas->hHrtfParambin ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_dirac_dec_binaural_copy_hrtfs( &st_ivas->hHrtfParambin, st_ivas->hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK ) { return error; } diff --git a/lib_rend/ivas_dirac_dec_binaural_functions.c b/lib_rend/ivas_dirac_dec_binaural_functions.c index cd27872ec2..543138929e 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions.c @@ -241,8 +241,7 @@ ivas_error ivas_dirac_dec_init_binaural_data( if ( hDiracDecBin->hReverb == NULL ) #endif { - /* 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, &( st_ivas->hRenderConfig->roomAcoustics ), output_Fs, st_ivas->hHrtfParambin, st_ivas->hBinRendererTd->HrFiltSet_p->lr_energy_and_iac ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_binaural_reverb_open_parambin( &hDiracDecBin->hReverb, nBins, CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES, &( st_ivas->hRenderConfig->roomAcoustics ), output_Fs, st_ivas->hHrtfParambin ) ) != IVAS_ERR_OK ) { return error; } @@ -411,8 +410,8 @@ void ivas_dirac_dec_close_binaural_data( *------------------------------------------------------------------------*/ ivas_error ivas_dirac_dec_binaural_copy_hrtfs( - HRTFS_PARAMBIN_HANDLE *hHrtfParambin /* i/o: HRTF structure for rendering */ -) + HRTFS_PARAMBIN_HANDLE *hHrtfParambin, /* i/o: HRTF structure for rendering */ + const int32_t output_Fs /* output sampling rate */ ) { int16_t i, j; if ( hHrtfParambin != NULL && *hHrtfParambin != NULL ) @@ -443,6 +442,25 @@ ivas_error ivas_dirac_dec_binaural_copy_hrtfs( mvr2r( parametricReverberationEneCorrections, hrtfParambin->parametricReverberationEneCorrections, CLDFB_NO_CHANNELS_MAX ); mvr2r( parametricEarlyPartEneCorrection, hrtfParambin->parametricEarlyPartEneCorrection, CLDFB_NO_CHANNELS_MAX ); + switch ( output_Fs ) + { + case 48000: + hrtfParambin->lr_energy_and_iac[0] = defaultHRIR_left_avg_power_48kHz; + hrtfParambin->lr_energy_and_iac[1] = defaultHRIR_right_avg_power_48kHz; + hrtfParambin->lr_energy_and_iac[2] = defaultHRIR_coherence_48kHz; + break; + case 32000: + hrtfParambin->lr_energy_and_iac[0] = defaultHRIR_left_avg_power_32kHz; + hrtfParambin->lr_energy_and_iac[1] = defaultHRIR_right_avg_power_32kHz; + hrtfParambin->lr_energy_and_iac[2] = defaultHRIR_coherence_32kHz; + break; + case 16000: + hrtfParambin->lr_energy_and_iac[0] = defaultHRIR_left_avg_power_16kHz; + hrtfParambin->lr_energy_and_iac[1] = defaultHRIR_right_avg_power_16kHz; + hrtfParambin->lr_energy_and_iac[2] = defaultHRIR_coherence_16kHz; + break; + } + *hHrtfParambin = hrtfParambin; } diff --git a/lib_rend/ivas_prot_rend.h b/lib_rend/ivas_prot_rend.h index 40699fa7f5..034c5aaf0b 100644 --- a/lib_rend/ivas_prot_rend.h +++ b/lib_rend/ivas_prot_rend.h @@ -225,7 +225,8 @@ void ivas_dirac_dec_close_binaural_data( ); ivas_error ivas_dirac_dec_binaural_copy_hrtfs( - HRTFS_PARAMBIN_HANDLE *hHrtfParambin /* i/o: HRTF structure for rendering */ + HRTFS_PARAMBIN_HANDLE *hHrtfParambin, /* i/o: HRTF structure for rendering */ + const int32_t output_Fs /* output sampling rate */ ); /*! r: Configured reqularization factor value */ @@ -979,8 +980,7 @@ ivas_error ivas_binaural_reverb_open_parambin( 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 */ - const float *lr_energy_and_iac[] /* i : precomuputed lr energies and iac */ + const HRTFS_PARAMBIN_HANDLE hHrtfParambin /* i : Parametric binauralizer HRTF handle */ ); void ivas_binaural_reverb_close( diff --git a/lib_rend/ivas_reverb.c b/lib_rend/ivas_reverb.c index a0f3b4ccb7..34951f2242 100644 --- a/lib_rend/ivas_reverb.c +++ b/lib_rend/ivas_reverb.c @@ -1941,8 +1941,7 @@ ivas_error ivas_binaural_reverb_open_parambin( 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 */ - const float *lr_energy_and_iac[] /* i : precomuputed lr energies and iac */ + const HRTFS_PARAMBIN_HANDLE hHrtfParambin /* i : Parametric binauralizer HRTF handle */ ) { ivas_error error; @@ -1954,12 +1953,12 @@ ivas_error ivas_binaural_reverb_open_parambin( error = IVAS_ERR_OK; - if ( ( roomAcoustics != NULL ) && roomAcoustics->override ) + if ( ( roomAcoustics != NULL ) /*&& roomAcoustics->override*/ ) { revTimes = t60; revEne = ene; - if ( ( error = ivas_reverb_prepare_cldfb_params_parametric( roomAcoustics, sampling_rate, lr_energy_and_iac[0], lr_energy_and_iac[1], t60, ene ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_reverb_prepare_cldfb_params_parametric( roomAcoustics, sampling_rate, hHrtfParambin->lr_energy_and_iac[0], hHrtfParambin->lr_energy_and_iac[1], t60, ene ) ) != IVAS_ERR_OK ) { return error; } diff --git a/lib_rend/ivas_stat_rend.h b/lib_rend/ivas_stat_rend.h index 634025e11e..e08ac8b970 100644 --- a/lib_rend/ivas_stat_rend.h +++ b/lib_rend/ivas_stat_rend.h @@ -1298,6 +1298,8 @@ typedef struct ivas_hrtfs_parambin_struct float parametricReverberationEneCorrections[CLDFB_NO_CHANNELS_MAX]; float parametricEarlyPartEneCorrection[CLDFB_NO_CHANNELS_MAX]; + const float *lr_energy_and_iac[3]; /* left/right energy and interaural coherence for late reverb */ + } HRTFS_PARAMBIN, *HRTFS_PARAMBIN_HANDLE; diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 9e02a24728..7310e4a33e 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -3135,7 +3135,7 @@ static ivas_error initMasaDummyDecForBinauralOut( } decDummy->hSpatParamRendCom->dirac_bs_md_write_idx = 0; - if ( ( error = ivas_dirac_dec_binaural_copy_hrtfs( &decDummy->hHrtfParambin ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_dirac_dec_binaural_copy_hrtfs( &decDummy->hHrtfParambin, decDummy->hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK ) { return error; } @@ -9758,7 +9758,7 @@ static ivas_error ivas_masa_ext_rend_parambin_init( #endif { /* 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, NULL ) ) != IVAS_ERR_OK ) + 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 ) { return error; } @@ -9930,7 +9930,7 @@ static ivas_error initMasaExtRenderer( { if ( hMasaExtRend->renderer_type != RENDERER_STEREO_PARAMETRIC ) { - if ( ( error = ivas_dirac_dec_binaural_copy_hrtfs( &inputMasa->hMasaExtRend->hHrtfParambin ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_dirac_dec_binaural_copy_hrtfs( &inputMasa->hMasaExtRend->hHrtfParambin, 0 /* ?? output_Fs ?? */ ) ) != IVAS_ERR_OK ) { return error; } -- GitLab From f65744290bc0b3239def909f1020cc8e334e0e76 Mon Sep 17 00:00:00 2001 From: Serdar Buyuksarac <31622564+sbsarac@users.noreply.github.com> Date: Mon, 30 Oct 2023 11:13:05 +0100 Subject: [PATCH 3/6] Fix compilation warning --- lib_rend/ivas_reverb_utils.c | 1 - 1 file changed, 1 deletion(-) diff --git a/lib_rend/ivas_reverb_utils.c b/lib_rend/ivas_reverb_utils.c index 8a748006c0..c6af6cb208 100644 --- a/lib_rend/ivas_reverb_utils.c +++ b/lib_rend/ivas_reverb_utils.c @@ -173,7 +173,6 @@ ivas_error ivas_reverb_prepare_cldfb_params_parametric( 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; - ivas_error error; for ( idx = 0; idx < CLDFB_NO_CHANNELS_MAX; idx++ ) { -- GitLab From a3b1881ef6747e2faa7898ef1aa041962bcda7f0 Mon Sep 17 00:00:00 2001 From: Serdar Buyuksarac <31622564+sbsarac@users.noreply.github.com> Date: Mon, 30 Oct 2023 13:23:40 +0100 Subject: [PATCH 4/6] Try a fix for Job build-codec-instrumented-linux --- lib_rend/ivas_reverb_utils.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib_rend/ivas_reverb_utils.c b/lib_rend/ivas_reverb_utils.c index c6af6cb208..96202c891e 100644 --- a/lib_rend/ivas_reverb_utils.c +++ b/lib_rend/ivas_reverb_utils.c @@ -170,6 +170,8 @@ ivas_error ivas_reverb_prepare_cldfb_params_parametric( { int16_t idx; float fc[CLDFB_NO_CHANNELS_MAX]; + float avg_pwr_l_out[CLDFB_NO_CHANNELS_MAX]; + float avg_pwr_r_out[CLDFB_NO_CHANNELS_MAX]; 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; @@ -193,9 +195,6 @@ ivas_error ivas_reverb_prepare_cldfb_params_parametric( pOutput_ene[idx] *= expf( exp_argument ); } - float avg_pwr_l_out[CLDFB_NO_CHANNELS_MAX]; - float avg_pwr_r_out[CLDFB_NO_CHANNELS_MAX]; - ivas_reverb_parametric_set_energies( avg_pwr_l, avg_pwr_r, output_Fs, avg_pwr_l_out, avg_pwr_r_out ); for ( idx = 0; idx < CLDFB_NO_CHANNELS_MAX; idx++ ) -- GitLab From 915e0d747a69c045ac539aa536b3704f7b9af4dd Mon Sep 17 00:00:00 2001 From: Serdar Buyuksarac <31622564+sbsarac@users.noreply.github.com> Date: Wed, 1 Nov 2023 09:28:15 +0100 Subject: [PATCH 5/6] Remove test code --- lib_rend/ivas_reverb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_rend/ivas_reverb.c b/lib_rend/ivas_reverb.c index 34951f2242..1e5ea9f2cc 100644 --- a/lib_rend/ivas_reverb.c +++ b/lib_rend/ivas_reverb.c @@ -1953,7 +1953,7 @@ ivas_error ivas_binaural_reverb_open_parambin( error = IVAS_ERR_OK; - if ( ( roomAcoustics != NULL ) /*&& roomAcoustics->override*/ ) + if ( ( roomAcoustics != NULL ) && roomAcoustics->override ) { revTimes = t60; revEne = ene; -- GitLab From 38aceeed2df2872a6ff0431cfdd8a71084340577 Mon Sep 17 00:00:00 2001 From: Serdar Buyuksarac <31622564+sbsarac@users.noreply.github.com> Date: Wed, 1 Nov 2023 09:49:49 +0100 Subject: [PATCH 6/6] Add pOutSampleRate to ivas_dirac_dec_binaural_copy_hrtfs call in initMasaExtRenderer. --- lib_rend/lib_rend.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 7310e4a33e..d270cbd3b7 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -9930,7 +9930,7 @@ static ivas_error initMasaExtRenderer( { if ( hMasaExtRend->renderer_type != RENDERER_STEREO_PARAMETRIC ) { - if ( ( error = ivas_dirac_dec_binaural_copy_hrtfs( &inputMasa->hMasaExtRend->hHrtfParambin, 0 /* ?? output_Fs ?? */ ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_dirac_dec_binaural_copy_hrtfs( &inputMasa->hMasaExtRend->hHrtfParambin, *inputMasa->base.ctx.pOutSampleRate ) ) != IVAS_ERR_OK ) { return error; } -- GitLab