From 94bcc129dadcf5f7ed7771edfe8e5e7ed595c67c Mon Sep 17 00:00:00 2001 From: Charles Kinuthia Date: Wed, 9 Aug 2023 18:04:49 +0200 Subject: [PATCH 1/2] fix issue 675 under define FIX_674_MISSING_TABLES_FOR_TDREND_REVERB - add 32kHz and 16kHz rom tables used for reverb in td renderer path - update 48kHz tables - update generate_tables_from_rom_to_bin.c to write the rom tables to bin - update hrtf binaries in scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_*.bin - read tables from bin if reading hrtf from binary file --- lib_com/ivas_cnst.h | 4 + lib_com/options.h | 1 + lib_dec/ivas_init_dec.c | 4 + lib_dec/ivas_ism_dec.c | 4 + lib_rend/ivas_crend.c | 4 + lib_rend/ivas_objectRenderer_mix.c | 24 ++ lib_rend/ivas_prot_rend.h | 3 + lib_rend/ivas_reverb.c | 17 +- lib_rend/ivas_rom_rend.c | 284 +++++++++++++++++- lib_rend/ivas_rom_rend.h | 15 +- lib_rend/ivas_stat_rend.h | 4 + lib_rend/lib_rend.c | 12 + lib_util/hrtf_file_reader.c | 17 ++ .../Table_Format_Converter/CMakeLists.txt | 9 +- .../generate_tables_from_rom_to_bin.c | 56 ++++ .../ivas_binaural_16kHz.bin | 4 +- .../ivas_binaural_32kHz.bin | 4 +- .../ivas_binaural_48kHz.bin | 4 +- 18 files changed, 456 insertions(+), 14 deletions(-) diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index 6d89e222ec..fe06f62aac 100644 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -1683,6 +1683,10 @@ typedef enum #define MAX_ANGULAR_STEP_INV ( 1.0f / MAX_ANGULAR_STEP ) #define MAX_INTERPOLATION_STEPS 12 +#ifdef FIX_674_MISSING_TABLES_FOR_TDREND_REVERB +#define LR_IAC_LENGTH_NR_FC ( RV_LENGTH_NR_FC ) +#endif + /* ----- Enums - TD Renderer ----- */ typedef enum diff --git a/lib_com/options.h b/lib_com/options.h index 7a60330ace..2b0eb7bab0 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -220,6 +220,7 @@ #define FIX_653_BUG_IN_SKIP_MATRIX /* Dlb: fix for issue #653, bug in the ivas_spar_get_skip_mat function*/ #define FIX_663_PARAM_ISM_EXT /* FhG: Issue 663: ParamISM EXT output improvement */ +#define FIX_674_MISSING_TABLES_FOR_TDREND_REVERB /* Eri: add tables for 32kHz, 16kHz (and update 48kHz) for left/right energies and coherence for late reverb in TD renderer path. Also read tables from binary when hrtf binaries are used. */ /* ################## End BE DEVELOPMENT switches ######################### */ diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index 73c66b5379..010ff14771 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -1654,7 +1654,11 @@ ivas_error ivas_init_decoder( if ( st_ivas->hIntSetup.output_config == AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { +#ifdef FIX_674_MISSING_TABLES_FOR_TDREND_REVERB + 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 ) +#else if ( ( error = ivas_reverb_open( &st_ivas->hReverb, st_ivas->hDecoderConfig->output_config, NULL, st_ivas->hRenderConfig, st_ivas->hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK ) +#endif { return error; } diff --git a/lib_dec/ivas_ism_dec.c b/lib_dec/ivas_ism_dec.c index 50d1a91de6..d776026664 100644 --- a/lib_dec/ivas_ism_dec.c +++ b/lib_dec/ivas_ism_dec.c @@ -198,7 +198,11 @@ static ivas_error ivas_ism_bitrate_switching( #ifdef FIX_571_REVERB_NOT_ACTIVATED_ISM if ( st_ivas->hIntSetup.output_config == AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { +#ifdef FIX_674_MISSING_TABLES_FOR_TDREND_REVERB + 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 ) +#else if ( ( error = ivas_reverb_open( &st_ivas->hReverb, st_ivas->hDecoderConfig->output_config, NULL, st_ivas->hRenderConfig, st_ivas->hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK ) +#endif { return error; } diff --git a/lib_rend/ivas_crend.c b/lib_rend/ivas_crend.c index e333043560..7aaefa2cb8 100644 --- a/lib_rend/ivas_crend.c +++ b/lib_rend/ivas_crend.c @@ -1135,7 +1135,11 @@ ivas_error ivas_rend_openCrend( if ( outConfig == AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { +#ifdef FIX_674_MISSING_TABLES_FOR_TDREND_REVERB + if ( ( error = ivas_reverb_open( &( hCrend->hReverb ), inConfig, ( *pCrend )->hHrtfCrend, NULL, hRendCfg, output_Fs ) ) != IVAS_ERR_OK ) +#else if ( ( error = ivas_reverb_open( &( hCrend->hReverb ), inConfig, ( *pCrend )->hHrtfCrend, hRendCfg, output_Fs ) ) != IVAS_ERR_OK ) +#endif { return error; } diff --git a/lib_rend/ivas_objectRenderer_mix.c b/lib_rend/ivas_objectRenderer_mix.c index 7f3edb41af..15773b699b 100644 --- a/lib_rend/ivas_objectRenderer_mix.c +++ b/lib_rend/ivas_objectRenderer_mix.c @@ -37,6 +37,9 @@ #include "ivas_rom_TdBinauralRenderer.h" #include "ivas_error.h" #include "wmc_auto.h" +#ifdef FIX_674_MISSING_TABLES_FOR_TDREND_REVERB +#include "ivas_rom_rend.h" +#endif #ifdef DEBUGGING #include "debug.h" #endif @@ -387,6 +390,27 @@ static ivas_error DefaultBSplineModel( model = &( HrFiltSet_p->ModelParams ); modelITD = &( HrFiltSet_p->ModelParamsITD ); +#ifdef FIX_674_MISSING_TABLES_FOR_TDREND_REVERB + switch ( output_Fs ) + { + case 48000: + HrFiltSet_p->lr_energy_and_iac[0] = orange53_left_avg_power_48kHz; + HrFiltSet_p->lr_energy_and_iac[1] = orange53_right_avg_power_48kHz; + HrFiltSet_p->lr_energy_and_iac[2] = orange53_coherence_48kHz; + break; + case 32000: + HrFiltSet_p->lr_energy_and_iac[0] = orange53_left_avg_power_32kHz; + HrFiltSet_p->lr_energy_and_iac[1] = orange53_right_avg_power_32kHz; + HrFiltSet_p->lr_energy_and_iac[2] = orange53_coherence_32kHz; + break; + case 16000: + HrFiltSet_p->lr_energy_and_iac[0] = orange53_left_avg_power_16kHz; + HrFiltSet_p->lr_energy_and_iac[1] = orange53_right_avg_power_16kHz; + HrFiltSet_p->lr_energy_and_iac[2] = orange53_coherence_16kHz; + break; + } +#endif + /* Set ROM flag for correct deallocation */ model->modelROM = TRUE; diff --git a/lib_rend/ivas_prot_rend.h b/lib_rend/ivas_prot_rend.h index 50b363f192..f8d44254f2 100644 --- a/lib_rend/ivas_prot_rend.h +++ b/lib_rend/ivas_prot_rend.h @@ -1013,6 +1013,9 @@ ivas_error ivas_reverb_open( REVERB_HANDLE *hReverb, /* i/o: Reverberator handle */ const AUDIO_CONFIG input_audio_config, /* i : reverb. input audio configuration */ const HRTFS_HANDLE hHrtf, /* i : HRTF handle */ +#ifdef FIX_674_MISSING_TABLES_FOR_TDREND_REVERB + const float *lr_energy_and_iac[], /* precomuputed lr energies and iac*/ +#endif RENDER_CONFIG_DATA *pConfig, /* i : Reverb configuration */ const int32_t output_Fs /* i : output sampling rate */ ); diff --git a/lib_rend/ivas_reverb.c b/lib_rend/ivas_reverb.c index fd485ffbce..47d7d66d23 100644 --- a/lib_rend/ivas_reverb.c +++ b/lib_rend/ivas_reverb.c @@ -996,12 +996,14 @@ static void set_reverb_acoustic_data( 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; } +#ifndef FIX_674_MISSING_TABLES_FOR_TDREND_REVERB else { pParams->pHrtf_avg_pwr_response_l_const = orange53_left_avg_power; pParams->pHrtf_avg_pwr_response_r_const = orange53_right_avg_power; pParams->pHrtf_inter_aural_coherence_const = orange53_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, @@ -1099,8 +1101,11 @@ ivas_error ivas_reverb_open( REVERB_HANDLE *hReverb, /* i/o: Reverberator handle */ const AUDIO_CONFIG input_audio_config, /* i : reverb. input audio configuration */ const HRTFS_HANDLE hHrtf, /* i : HRTF handle */ - RENDER_CONFIG_HANDLE hRenderConfig, /* i : Renderer configuration handle */ - const int32_t output_Fs /* i : output sampling rate */ +#ifdef FIX_674_MISSING_TABLES_FOR_TDREND_REVERB + const float *lr_energy_and_iac[], /* precomuputed lr energies and iac*/ +#endif + RENDER_CONFIG_HANDLE hRenderConfig, /* i : Renderer configuration handle */ + const int32_t output_Fs /* i : output sampling rate */ ) { ivas_error error; @@ -1172,6 +1177,14 @@ ivas_error ivas_reverb_open( params.pFc[bin_idx] = freq_step * bin_idx; } +#ifdef FIX_674_MISSING_TABLES_FOR_TDREND_REVERB + 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]; + } +#endif /* 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 ); diff --git a/lib_rend/ivas_rom_rend.c b/lib_rend/ivas_rom_rend.c index dd8ca99d80..2cacb02b10 100644 --- a/lib_rend/ivas_rom_rend.c +++ b/lib_rend/ivas_rom_rend.c @@ -156,7 +156,287 @@ const float SincTable[321] = 0.00203440f, 0.00177795f, 0.00152168f, 0.00126584f, 0.00101062f, 0.00075625f, 0.00050289f, 0.00025075f, 0.00000000f }; - +#ifdef FIX_674_MISSING_TABLES_FOR_TDREND_REVERB +const float orange53_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 orange53_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 orange53_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 orange53_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 orange53_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 orange53_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 orange53_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 orange53_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 orange53_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 +}; +#else const float orange53_left_avg_power[257] = { 0.999231100f, 0.992580175f, 0.969233215f, 0.925614893f, 0.871408045f, 0.826101780f, 0.803222895f, 0.800087631f, 0.802672029f, 0.801490188f, 0.796555817f, 0.790879488f, 0.784882724f, 0.777585745f, 0.769326210f, 0.761789441f, 0.756145239f, 0.752754092f, @@ -252,7 +532,7 @@ const float orange53_coherence[257] = { 0.000086255f, 0.000083183f, 0.000080804f, 0.000079026f, 0.000077552f, 0.000076117f, 0.000074693f, 0.000073431f, 0.000072456f, 0.000071701f, 0.000071002f, 0.000070286f, 0.000069692f, 0.000069457f }; - +#endif /*----------------------------------------------------------------------------------* * t-design and SN3D normalization table *----------------------------------------------------------------------------------*/ diff --git a/lib_rend/ivas_rom_rend.h b/lib_rend/ivas_rom_rend.h index ae1bb654e6..f34af35545 100644 --- a/lib_rend/ivas_rom_rend.h +++ b/lib_rend/ivas_rom_rend.h @@ -74,10 +74,23 @@ extern const int16_t HRTF_MODEL_N_CPTS_VAR[HRTF_MODEL_N_SECTIONS]; extern const float SincTable[321]; +#ifdef FIX_674_MISSING_TABLES_FOR_TDREND_REVERB +extern const float orange53_coherence_48kHz[LR_IAC_LENGTH_NR_FC]; +extern const float orange53_left_avg_power_48kHz[LR_IAC_LENGTH_NR_FC]; +extern const float orange53_right_avg_power_48kHz[LR_IAC_LENGTH_NR_FC]; + +extern const float orange53_coherence_32kHz[LR_IAC_LENGTH_NR_FC]; +extern const float orange53_left_avg_power_32kHz[LR_IAC_LENGTH_NR_FC]; +extern const float orange53_right_avg_power_32kHz[LR_IAC_LENGTH_NR_FC]; + +extern const float orange53_coherence_16kHz[LR_IAC_LENGTH_NR_FC]; +extern const float orange53_left_avg_power_16kHz[LR_IAC_LENGTH_NR_FC]; +extern const float orange53_right_avg_power_16kHz[LR_IAC_LENGTH_NR_FC]; +#else extern const float orange53_left_avg_power[257]; extern const float orange53_right_avg_power[257]; extern const float orange53_coherence[257]; - +#endif /*----------------------------------------------------------------------------------* * t-design and SN3D normalization table diff --git a/lib_rend/ivas_stat_rend.h b/lib_rend/ivas_stat_rend.h index 4a034eecb4..7216506b6a 100644 --- a/lib_rend/ivas_stat_rend.h +++ b/lib_rend/ivas_stat_rend.h @@ -1165,6 +1165,10 @@ typedef struct TDREND_HRFILT_FiltSet_struct ModelParamsITD_t ModelParamsITD; TDREND_HRFILT_Method_t FilterMethod; /* HR filtering method */ float latency_s; +#ifdef FIX_674_MISSING_TABLES_FOR_TDREND_REVERB + 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; diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 147c5e2127..b110ef65d3 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -1453,7 +1453,11 @@ static ivas_error setRendInputActiveIsm( } if ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { +#ifdef FIX_674_MISSING_TABLES_FOR_TDREND_REVERB + if ( ( error = ivas_reverb_open( &( inputIsm->hReverb ), getIvasAudioConfigFromRendAudioConfig( outConfig ), NULL, &inputIsm->tdRendWrapper.hBinRendererTd->HrFiltSet_p->lr_energy_and_iac, hRendCfg, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) +#else if ( ( error = ivas_reverb_open( &( inputIsm->hReverb ), getIvasAudioConfigFromRendAudioConfig( outConfig ), NULL, hRendCfg, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) +#endif { return error; } @@ -1465,8 +1469,12 @@ static ivas_error setRendInputActiveIsm( } if ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { +#ifdef FIX_674_MISSING_TABLES_FOR_TDREND_REVERB + if ( ( error = ivas_reverb_open( &( inputIsm->hReverb ), getIvasAudioConfigFromRendAudioConfig( outConfig ), NULL, inputIsm->tdRendWrapper.hBinRendererTd->HrFiltSet_p->lr_energy_and_iac, hRendCfg, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) +#else if ( ( error = ivas_reverb_open( &( inputIsm->hReverb ), getIvasAudioConfigFromRendAudioConfig( outConfig ), NULL, hRendCfg, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) +#endif { return error; } @@ -2264,7 +2272,11 @@ static ivas_error initMcBinauralRendering( #endif if ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { +#ifdef FIX_674_MISSING_TABLES_FOR_TDREND_REVERB + if ( ( error = ivas_reverb_open( &( inputMc->hReverb ), getIvasAudioConfigFromRendAudioConfig( outConfig ), NULL, inputMc->tdRendWrapper.hBinRendererTd->HrFiltSet_p->lr_energy_and_iac, hRendCfg, outSampleRate ) ) != IVAS_ERR_OK ) +#else if ( ( error = ivas_reverb_open( &( inputMc->hReverb ), getIvasAudioConfigFromRendAudioConfig( outConfig ), NULL, hRendCfg, outSampleRate ) ) != IVAS_ERR_OK ) +#endif { return error; } diff --git a/lib_util/hrtf_file_reader.c b/lib_util/hrtf_file_reader.c index df2c5c66f3..3870e71d66 100644 --- a/lib_util/hrtf_file_reader.c +++ b/lib_util/hrtf_file_reader.c @@ -434,6 +434,16 @@ static ivas_error LoadBSplineBinary( LoadBSplineBinaryITD( &HrFiltSet_p->ModelParamsITD, f_hrtf ); } +#ifdef FIX_674_MISSING_TABLES_FOR_TDREND_REVERB + /* 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_LENGTH_NR_FC * sizeof( float ) ); + fread( HrFiltSet_p->lr_energy_and_iac_dyn[i], sizeof( const float ), LR_IAC_LENGTH_NR_FC, f_hrtf ); + HrFiltSet_p->lr_energy_and_iac[i] = (const float *) HrFiltSet_p->lr_energy_and_iac_dyn[i]; + } +#endif + return IVAS_ERR_OK; } @@ -672,6 +682,13 @@ ivas_error dealloc_HRTF_binary( free( hHrtf->ModelEval.hrfModL ); free( hHrtf->ModelEval.hrfModR ); + +#ifdef FIX_674_MISSING_TABLES_FOR_TDREND_REVERB + for ( i = 0; i < 3; i++ ) + { + free( hHrtf->lr_energy_and_iac_dyn[i] ); + } +#endif } return error; diff --git a/scripts/binauralRenderer_interface/Table_Format_Converter/CMakeLists.txt b/scripts/binauralRenderer_interface/Table_Format_Converter/CMakeLists.txt index 259e3b97b6..47216e6aa2 100644 --- a/scripts/binauralRenderer_interface/Table_Format_Converter/CMakeLists.txt +++ b/scripts/binauralRenderer_interface/Table_Format_Converter/CMakeLists.txt @@ -18,17 +18,20 @@ set(IVAS_DEC_PATH ${IVAS_PATH}/lib_dec) set(IVAS_ENC_PATH ${IVAS_PATH}/lib_enc) set(IVAS_COM_PATH ${IVAS_PATH}/lib_com) set(IVAS_REND_PATH ${IVAS_PATH}/lib_rend) +set(IVAS_LC3PLUS_PATH ${IVAS_PATH}/lc3plus) set(IVAS_DEBUG_PATH ${IVAS_PATH}/lib_debug) -include_directories(${IVAS_UTIL_PATH} ${IVAS_ENC_PATH} ${IVAS_DEC_PATH} ${IVAS_COM_PATH} ${IVAS_REND_PATH} ${IVAS_DEBUG_PATH}) +include_directories(${IVAS_UTIL_PATH} ${IVAS_ENC_PATH} ${IVAS_DEC_PATH} ${IVAS_COM_PATH} ${IVAS_LC3PLUS_PATH} ${IVAS_REND_PATH} ${IVAS_DEBUG_PATH}) set(SOURCE_FILES_C ${IVAS_REND_PATH}/ivas_rom_binauralRenderer.c - ${IVAS_REND_PATH}/ivas_rom_binaural_crend_head.c) + ${IVAS_REND_PATH}/ivas_rom_binaural_crend_head.c + ${IVAS_REND_PATH}/ivas_rom_rend.c) set(SOURCE_FILES_H ${IVAS_REND_PATH}/ivas_rom_binauralRenderer.h - ${IVAS_REND_PATH}/ivas_rom_binaural_crend_head.h) + ${IVAS_REND_PATH}/ivas_rom_binaural_crend_head.h + ${IVAS_REND_PATH}/ivas_rom_rend.h) add_library(${PROJECT_NAME}_lib STATIC ${SOURCE_FILES_C} ${SOURCE_FILES_H}) diff --git a/scripts/binauralRenderer_interface/Table_Format_Converter/generate_tables_from_rom_to_bin.c b/scripts/binauralRenderer_interface/Table_Format_Converter/generate_tables_from_rom_to_bin.c index 00520bb924..abcc07d4be 100644 --- a/scripts/binauralRenderer_interface/Table_Format_Converter/generate_tables_from_rom_to_bin.c +++ b/scripts/binauralRenderer_interface/Table_Format_Converter/generate_tables_from_rom_to_bin.c @@ -39,6 +39,9 @@ #include "lib_rend.h" #include "ivas_stat_dec.h" #include "hrtf_file_reader.h" +#ifdef FIX_674_MISSING_TABLES_FOR_TDREND_REVERB +#include "ivas_rom_rend.h" +#endif #define FILE_HEADER @@ -674,6 +677,13 @@ char *create_hrtf_tdrend( int32_t frequency, int32_t *hrtf_size ) int32_t td_hrtf_header_size, td_hrtf_data_size; char *td_hrtf = NULL, *td_hrtf_wptr; +#ifdef FIX_674_MISSING_TABLES_FOR_TDREND_REVERB + // left/right and coherences for late reverb table sizes + int32_t td_hrtf_coh_and_ener_size; + int32_t data_size_tmp; + int32_t td_hrtf_data_size_new; +#endif + *hrtf_size = 0; sprintf( full_in_td_path, "%s%s_%dkHz%s", input_td_bin_path, input_td_bin_file_name, frequency / 1000, DEFAULT_BIN_FILE_EXT ); @@ -693,7 +703,13 @@ char *create_hrtf_tdrend( int32_t frequency, int32_t *hrtf_size ) // Raw data size (4 bytes) td_hrtf_header_size = sizeof( int32_t ) + sizeof( int32_t ) + sizeof( int32_t ) + sizeof( uint32_t ); +#ifdef FIX_674_MISSING_TABLES_FOR_TDREND_REVERB + td_hrtf_coh_and_ener_size = sizeof( float ) * 3 * LR_IAC_LENGTH_NR_FC; + td_hrtf_data_size_new = td_hrtf_data_size + td_hrtf_coh_and_ener_size; + *hrtf_size = td_hrtf_header_size + td_hrtf_data_size_new; +#else *hrtf_size = td_hrtf_header_size + td_hrtf_data_size; +#endif td_hrtf = (char *) malloc( *hrtf_size ); if ( td_hrtf == NULL ) @@ -722,8 +738,13 @@ char *create_hrtf_tdrend( int32_t frequency, int32_t *hrtf_size ) td_hrtf_wptr += sizeof( int32_t ); // Raw data size +#ifdef FIX_674_MISSING_TABLES_FOR_TDREND_REVERB + memcpy( td_hrtf_wptr, &( td_hrtf_data_size_new ), sizeof( uint32_t ) ); + td_hrtf_wptr += sizeof( uint32_t ); +#else memcpy( td_hrtf_wptr, &( td_hrtf_data_size ), sizeof( uint32_t ) ); td_hrtf_wptr += sizeof( uint32_t ); +#endif // Get the HRTF raw data @@ -737,6 +758,41 @@ char *create_hrtf_tdrend( int32_t frequency, int32_t *hrtf_size ) return NULL; } +#ifdef FIX_674_MISSING_TABLES_FOR_TDREND_REVERB + td_hrtf_wptr += td_hrtf_data_size; + + // Left/right and coherence late reverb tables + data_size_tmp = sizeof( float ) * LR_IAC_LENGTH_NR_FC; + + if ( frequency == 48000 ) + { + memcpy( td_hrtf_wptr, &( orange53_left_avg_power_48kHz ), data_size_tmp ); + td_hrtf_wptr += data_size_tmp; + memcpy( td_hrtf_wptr, &( orange53_right_avg_power_48kHz ), data_size_tmp ); + td_hrtf_wptr += data_size_tmp; + memcpy( td_hrtf_wptr, &( orange53_coherence_48kHz ), data_size_tmp ); + td_hrtf_wptr += data_size_tmp; + } + else if ( frequency == 32000 ) + { + memcpy( td_hrtf_wptr, &( orange53_left_avg_power_32kHz ), data_size_tmp ); + td_hrtf_wptr += data_size_tmp; + memcpy( td_hrtf_wptr, &( orange53_right_avg_power_32kHz ), data_size_tmp ); + td_hrtf_wptr += data_size_tmp; + memcpy( td_hrtf_wptr, &( orange53_coherence_32kHz ), data_size_tmp ); + td_hrtf_wptr += data_size_tmp; + } + else if ( frequency == 16000 ) + { + memcpy( td_hrtf_wptr, &( orange53_left_avg_power_16kHz ), data_size_tmp ); + td_hrtf_wptr += data_size_tmp; + memcpy( td_hrtf_wptr, &( orange53_right_avg_power_16kHz ), data_size_tmp ); + td_hrtf_wptr += data_size_tmp; + memcpy( td_hrtf_wptr, &( orange53_coherence_16kHz ), data_size_tmp ); + td_hrtf_wptr += data_size_tmp; + } +#endif + fclose( input_td_bin_file ); input_td_bin_file = NULL; } diff --git a/scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_16kHz.bin b/scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_16kHz.bin index 980668c27e..d11ee532af 100644 --- a/scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_16kHz.bin +++ b/scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_16kHz.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:07d2de62c345650f19a404001c5502e64f72277e6c689064e204a7031779bc0e -size 2072948 +oid sha256:fdfd1e56fc95c96a53d6a3234fd1dd3c65797d131675e1e4301e8d658f5119b4 +size 2076032 diff --git a/scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_32kHz.bin b/scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_32kHz.bin index 9659006ef6..c641fbbf9c 100644 --- a/scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_32kHz.bin +++ b/scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_32kHz.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d2c8461458ca23f86f592acf102edfec4eb80bbb935bb324e04ab1c535d0dd94 -size 2573320 +oid sha256:8fb487ea68fe5c25c1f42895865a5a8d327ab93473c77744dfd7e81589ad4ca9 +size 2576404 diff --git a/scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_48kHz.bin b/scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_48kHz.bin index d2dee97c34..a007100b10 100644 --- a/scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_48kHz.bin +++ b/scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_48kHz.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:80043c85556218c5444c87aa2a86498ab4158fc40c6f4c3190caa182af1553e5 -size 2852056 +oid sha256:17d16c9eba241d93f7f00f012b304c7af00373da8b7afac006897a2b1bbaf73b +size 2855140 -- GitLab From f06f1f6f353c38917729c97be5117ac21f83655f Mon Sep 17 00:00:00 2001 From: Charles Kinuthia Date: Fri, 11 Aug 2023 12:00:10 +0200 Subject: [PATCH 2/2] add missing #else statement --- lib_rend/ivas_rom_rend.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_rend/ivas_rom_rend.h b/lib_rend/ivas_rom_rend.h index abd4a6d6e6..6ba1b02ec9 100644 --- a/lib_rend/ivas_rom_rend.h +++ b/lib_rend/ivas_rom_rend.h @@ -105,7 +105,7 @@ extern const float orange53_right_avg_power_16kHz[LR_IAC_LENGTH_NR_FC]; extern const float defaultHRIR_left_avg_power[257]; extern const float defaultHRIR_right_avg_power[257]; extern const float defaultHRIR_coherence[257]; - +#else extern const float orange53_left_avg_power[257]; extern const float orange53_right_avg_power[257]; extern const float orange53_coherence[257]; -- GitLab