From f22253281acdbff87e291a31fd45009475e4826d Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Tue, 24 Jun 2025 11:24:46 +0200 Subject: [PATCH 01/12] Enable switches NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES, FIX_638_ENERGIE_IAC_ROM_TABLES and FIX_777_COMBI_RENDER_CONFIG_FILE --- lib_com/options.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 662fb2be2..0c8f23d2a 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -110,18 +110,16 @@ #endif #define USE_NEW_HRTF_BINARY_FILE_FORMAT /* Orange: to activate when decided to change the hrtf binary file format */ -#ifdef USE_NEW_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 */ -#endif +#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_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 */ #define FIX_993_REMOVE_SBA_GET_ORDER /* VA: issue 993: remove unused function ivas_sba_get_order() */ -//#define FIX_777_COMBI_RENDER_CONFIG_FILE /* Philips: Fix for combined renderer config file support */ +#define FIX_777_COMBI_RENDER_CONFIG_FILE /* Philips: Fix for combined renderer config file support */ #define NONBE_FIX_1004_USAN_DTX_MASA_NO_DIRS /* Nokia: fix USAN error caused by non-setting of correctly the number of MASA directions in DTX */ /* #define NONBE_FIX_991_PARAMBIN_BINARY_HRTF */ /* Nokia: issue #991: fix using of binary file HRTF in ParamBin (to activate when USE_NEW_HRTF_BINARY_FILE_FORMAT and FIX_777_COMBI_RENDER_CONFIG_FILE are on ) */ #define FIX_1009_ISM_NONDIEGETIC_PANNING /* FhG: issue #1009: use correct object buffer for ISM1 non-diegetic pan */ -- GitLab From a33dd79600b1fe69bd5f51d61a2ec585269de99a Mon Sep 17 00:00:00 2001 From: Devansh Kandpal <43807487+mrkandpal@users.noreply.github.com> Date: Tue, 24 Jun 2025 15:23:35 +0200 Subject: [PATCH 02/12] Changed Q values for 16kHz HRTF binary --- lib_rend/ivas_hrtf_fx.c | 6 +++--- lib_util/hrtf_file_reader.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib_rend/ivas_hrtf_fx.c b/lib_rend/ivas_hrtf_fx.c index 845b61cb1..0b82a8e19 100644 --- a/lib_rend/ivas_hrtf_fx.c +++ b/lib_rend/ivas_hrtf_fx.c @@ -315,9 +315,9 @@ ivas_error ivas_HRTF_statistics_init( { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for hrtf data" ); } - floatToFixed_arr32( defaultHRIR_left_avg_power_16kHz_fx, HrtfStatistics->average_energy_l_dyn, Q27, LR_IAC_LENGTH_NR_FC_16KHZ ); /* tables from which lr_energy_and_iac is updated has Q27 for i=2 */ - floatToFixed_arr32( defaultHRIR_right_avg_power_16kHz_fx, HrtfStatistics->average_energy_r_dyn, Q27, LR_IAC_LENGTH_NR_FC_16KHZ ); /* tables from which lr_energy_and_iac is updated has Q27 for i=2 */ - floatToFixed_arr32( defaultHRIR_coherence_16kHz_fx, HrtfStatistics->inter_aural_coherence_dyn, Q27, LR_IAC_LENGTH_NR_FC_16KHZ ); /* tables from which lr_energy_and_iac is updated has Q27 for i=2 */ + floatToFixed_arr32( defaultHRIR_left_avg_power_16kHz_fx, HrtfStatistics->average_energy_l_dyn, Q23, LR_IAC_LENGTH_NR_FC_16KHZ ); /* tables from which lr_energy_and_iac is updated has Q27 for i=2 */ + floatToFixed_arr32( defaultHRIR_right_avg_power_16kHz_fx, HrtfStatistics->average_energy_r_dyn, Q23, LR_IAC_LENGTH_NR_FC_16KHZ ); /* tables from which lr_energy_and_iac is updated has Q27 for i=2 */ + floatToFixed_arr32( defaultHRIR_coherence_16kHz_fx, HrtfStatistics->inter_aural_coherence_dyn, Q23, LR_IAC_LENGTH_NR_FC_16KHZ ); /* tables from which lr_energy_and_iac is updated has Q27 for i=2 */ HrtfStatistics->average_energy_l = (const Word32 *) HrtfStatistics->average_energy_l_dyn; HrtfStatistics->average_energy_r = (const Word32 *) HrtfStatistics->average_energy_r_dyn; HrtfStatistics->inter_aural_coherence = (const Word32 *) HrtfStatistics->inter_aural_coherence_dyn; diff --git a/lib_util/hrtf_file_reader.c b/lib_util/hrtf_file_reader.c index 0d4dd8619..31f75e876 100644 --- a/lib_util/hrtf_file_reader.c +++ b/lib_util/hrtf_file_reader.c @@ -811,10 +811,10 @@ static ivas_error load_reverb_from_binary( hHrtfStatistics->inter_aural_coherence = hHrtfStatistics->inter_aural_coherence_dyn; fread( f_tmp_lr_energy_and_iac_dyn, sizeof( float ), lr_iac_len, f_hrtf ); - floatToFixed_arr32( f_tmp_lr_energy_and_iac_dyn, hHrtfStatistics->average_energy_l_dyn, Q27, lr_iac_len ); + floatToFixed_arr32( f_tmp_lr_energy_and_iac_dyn, hHrtfStatistics->average_energy_l_dyn, Q23, lr_iac_len ); fread( f_tmp_lr_energy_and_iac_dyn, sizeof( float ), lr_iac_len, f_hrtf ); - floatToFixed_arr32( f_tmp_lr_energy_and_iac_dyn, hHrtfStatistics->average_energy_r_dyn, Q27, lr_iac_len ); + floatToFixed_arr32( f_tmp_lr_energy_and_iac_dyn, hHrtfStatistics->average_energy_r_dyn, Q23, lr_iac_len ); fread( f_tmp_lr_energy_and_iac_dyn, sizeof( float ), lr_iac_len, f_hrtf ); floatToFixed_arr32( f_tmp_lr_energy_and_iac_dyn, hHrtfStatistics->inter_aural_coherence_dyn, Q23, lr_iac_len ); -- GitLab From ac343713076ad1ec5cf875a1c43028d5fa90e77e Mon Sep 17 00:00:00 2001 From: Devansh Kandpal <43807487+mrkandpal@users.noreply.github.com> Date: Wed, 25 Jun 2025 16:06:45 +0200 Subject: [PATCH 03/12] Added fx ROM tables for 16kHz HRTF + comparison conditions for HRTFs at all sampling frequenies --- lib_rend/ivas_hrtf_fx.c | 118 ++++++++- lib_rend/ivas_rom_binaural_crend_head.h | 18 +- lib_rend/ivas_rom_binaural_crend_head_fx.c | 265 ++++++++++++++++++++- 3 files changed, 391 insertions(+), 10 deletions(-) diff --git a/lib_rend/ivas_hrtf_fx.c b/lib_rend/ivas_hrtf_fx.c index 0b82a8e19..5729337d4 100644 --- a/lib_rend/ivas_hrtf_fx.c +++ b/lib_rend/ivas_hrtf_fx.c @@ -289,14 +289,105 @@ ivas_error ivas_HRTF_statistics_init( switch ( sampleRate ) { case 48000: +#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB + HrtfStatistics->average_energy_l_dyn = (Word32 *) malloc( LR_IAC_LENGTH_NR_FC * sizeof( float ) ); + if ( HrtfStatistics->average_energy_l_dyn == NULL ) + { + return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for hrtf data" ); + } + HrtfStatistics->average_energy_r_dyn = (Word32 *) malloc( LR_IAC_LENGTH_NR_FC * sizeof( float ) ); + if ( HrtfStatistics->average_energy_r_dyn == NULL ) + { + return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for hrtf data" ); + } + HrtfStatistics->inter_aural_coherence_dyn = (Word32 *) malloc( LR_IAC_LENGTH_NR_FC * sizeof( float ) ); + if ( HrtfStatistics->inter_aural_coherence_dyn == NULL ) + { + return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for hrtf data" ); + } + floatToFixed_arr32( (float*) defaultHRIR_left_avg_power_48kHz, HrtfStatistics->average_energy_l_dyn, Q23, LR_IAC_LENGTH_NR_FC ); /* tables from which lr_energy_and_iac is updated has Q23 for i=2 */ + floatToFixed_arr32( (float*) defaultHRIR_right_avg_power_48kHz, HrtfStatistics->average_energy_r_dyn, Q23, LR_IAC_LENGTH_NR_FC ); /* tables from which lr_energy_and_iac is updated has Q23 for i=2 */ + floatToFixed_arr32( (float*) defaultHRIR_coherence_48kHz, HrtfStatistics->inter_aural_coherence_dyn, Q27, LR_IAC_LENGTH_NR_FC ); /* tables from which lr_energy_and_iac is updated has Q27 for i=2 */ + HrtfStatistics->average_energy_l = (const Word32 *) HrtfStatistics->average_energy_l_dyn; + HrtfStatistics->average_energy_r = (const Word32 *) HrtfStatistics->average_energy_r_dyn; + HrtfStatistics->inter_aural_coherence = (const Word32 *) HrtfStatistics->inter_aural_coherence_dyn; + // TODO: dump the converted fixed point arrays to an array + printf( "average_energy_l = {\n" ); + for ( int i = 0; i < LR_IAC_LENGTH_NR_FC; i++ ) + { + printf( "%d, ", HrtfStatistics->average_energy_l_dyn[i] ); + } + printf( "};\n" ); + + printf( "average_energy_r = {\n" ); + for ( int i = 0; i < LR_IAC_LENGTH_NR_FC; i++ ) + { + printf( "%d, ", HrtfStatistics->average_energy_r_dyn[i] ); + } + printf( "};\n" ); + + printf( "inter_aural_coherence = {\n" ); + for ( int i = 0; i < LR_IAC_LENGTH_NR_FC; i++ ) + { + printf( "%d, ", HrtfStatistics->inter_aural_coherence_dyn[i] ); + } + printf( "};\n" ); +#else HrtfStatistics->average_energy_l = defaultHRIR_left_avg_power_48kHz_fx; HrtfStatistics->average_energy_r = defaultHRIR_right_avg_power_48kHz_fx; HrtfStatistics->inter_aural_coherence = defaultHRIR_coherence_48kHz_fx; +#endif break; case 32000: +#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB + HrtfStatistics->average_energy_l_dyn = (Word32 *) malloc( LR_IAC_LENGTH_NR_FC * sizeof( float ) ); + if ( HrtfStatistics->average_energy_l_dyn == NULL ) + { + return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for hrtf data" ); + } + HrtfStatistics->average_energy_r_dyn = (Word32 *) malloc( LR_IAC_LENGTH_NR_FC * sizeof( float ) ); + if ( HrtfStatistics->average_energy_r_dyn == NULL ) + { + return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for hrtf data" ); + } + HrtfStatistics->inter_aural_coherence_dyn = (Word32 *) malloc( LR_IAC_LENGTH_NR_FC * sizeof( float ) ); + if ( HrtfStatistics->inter_aural_coherence_dyn == NULL ) + { + return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for hrtf data" ); + } + floatToFixed_arr32( (float*) defaultHRIR_left_avg_power_32kHz, HrtfStatistics->average_energy_l_dyn, Q23, LR_IAC_LENGTH_NR_FC ); /* tables from which lr_energy_and_iac is updated has Q23 for i=2 */ + floatToFixed_arr32( (float *) defaultHRIR_right_avg_power_32kHz, HrtfStatistics->average_energy_r_dyn, Q23, LR_IAC_LENGTH_NR_FC ); /* tables from which lr_energy_and_iac is updated has Q23 for i=2 */ + floatToFixed_arr32( (float *) defaultHRIR_coherence_32kHz, HrtfStatistics->inter_aural_coherence_dyn, Q27, LR_IAC_LENGTH_NR_FC ); /* tables from which lr_energy_and_iac is updated has Q27 for i=2 */ + HrtfStatistics->average_energy_l = (const Word32 *) HrtfStatistics->average_energy_l_dyn; + HrtfStatistics->average_energy_r = (const Word32 *) HrtfStatistics->average_energy_r_dyn; + HrtfStatistics->inter_aural_coherence = (const Word32 *) HrtfStatistics->inter_aural_coherence_dyn; + // TODO: dump the converted fixed point arrays to a string + + printf( "average_energy_l = {\n" ); + for ( int i = 0; i < LR_IAC_LENGTH_NR_FC; i++ ) + { + printf( "%d, ", HrtfStatistics->average_energy_l_dyn[i] ); + } + printf( "};\n" ); + + printf( "average_energy_r = {\n" ); + for ( int i = 0; i < LR_IAC_LENGTH_NR_FC; i++ ) + { + printf( "%d, ", HrtfStatistics->average_energy_r_dyn[i] ); + } + printf( "};\n" ); + + printf( "inter_aural_coherence = {\n" ); + for ( int i = 0; i < LR_IAC_LENGTH_NR_FC; i++ ) + { + printf( "%d, ", HrtfStatistics->inter_aural_coherence_dyn[i] ); + } + printf( "};\n" ); +#else HrtfStatistics->average_energy_l = defaultHRIR_left_avg_power_32kHz_fx; HrtfStatistics->average_energy_r = defaultHRIR_right_avg_power_32kHz_fx; HrtfStatistics->inter_aural_coherence = defaultHRIR_coherence_32kHz_fx; +#endif break; case 16000: #ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB @@ -315,12 +406,33 @@ ivas_error ivas_HRTF_statistics_init( { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for hrtf data" ); } - floatToFixed_arr32( defaultHRIR_left_avg_power_16kHz_fx, HrtfStatistics->average_energy_l_dyn, Q23, LR_IAC_LENGTH_NR_FC_16KHZ ); /* tables from which lr_energy_and_iac is updated has Q27 for i=2 */ - floatToFixed_arr32( defaultHRIR_right_avg_power_16kHz_fx, HrtfStatistics->average_energy_r_dyn, Q23, LR_IAC_LENGTH_NR_FC_16KHZ ); /* tables from which lr_energy_and_iac is updated has Q27 for i=2 */ - floatToFixed_arr32( defaultHRIR_coherence_16kHz_fx, HrtfStatistics->inter_aural_coherence_dyn, Q23, LR_IAC_LENGTH_NR_FC_16KHZ ); /* tables from which lr_energy_and_iac is updated has Q27 for i=2 */ + floatToFixed_arr32( (float*) defaultHRIR_left_avg_power_16kHz, HrtfStatistics->average_energy_l_dyn, Q23, LR_IAC_LENGTH_NR_FC_16KHZ ); /* tables from which lr_energy_and_iac is updated has Q23 for i=2 */ + floatToFixed_arr32( (float*) defaultHRIR_right_avg_power_16kHz, HrtfStatistics->average_energy_r_dyn, Q23, LR_IAC_LENGTH_NR_FC_16KHZ ); /* tables from which lr_energy_and_iac is updated has Q23 for i=2 */ + floatToFixed_arr32( (float*) defaultHRIR_coherence_16kHz, HrtfStatistics->inter_aural_coherence_dyn, Q27, LR_IAC_LENGTH_NR_FC_16KHZ ); /* tables from which lr_energy_and_iac is updated has Q27 for i=2 */ HrtfStatistics->average_energy_l = (const Word32 *) HrtfStatistics->average_energy_l_dyn; HrtfStatistics->average_energy_r = (const Word32 *) HrtfStatistics->average_energy_r_dyn; HrtfStatistics->inter_aural_coherence = (const Word32 *) HrtfStatistics->inter_aural_coherence_dyn; + + printf( "\naverage_energy_l = {\n" ); + for ( int i = 0; i < LR_IAC_LENGTH_NR_FC_16KHZ; i++ ) + { + printf( "%d, ", HrtfStatistics->average_energy_l_dyn[i] ); + } + printf( "};\n" ); + + printf( "average_energy_r = {\n" ); + for ( int i = 0; i < LR_IAC_LENGTH_NR_FC_16KHZ; i++ ) + { + printf( "%d, ", HrtfStatistics->average_energy_r_dyn[i] ); + } + printf( "};\n" ); + + printf( "inter_aural_coherence = {\n" ); + for ( int i = 0; i < LR_IAC_LENGTH_NR_FC_16KHZ; i++ ) + { + printf( "%d, ", HrtfStatistics->inter_aural_coherence_dyn[i] ); + } + printf( "};\n" ); #else HrtfStatistics->average_energy_l = defaultHRIR_left_avg_power_16kHz_fx; diff --git a/lib_rend/ivas_rom_binaural_crend_head.h b/lib_rend/ivas_rom_binaural_crend_head.h index 183a025a8..017703460 100644 --- a/lib_rend/ivas_rom_binaural_crend_head.h +++ b/lib_rend/ivas_rom_binaural_crend_head.h @@ -357,10 +357,22 @@ extern const Word32 defaultHRIR_coherence_32kHz_fx[LR_IAC_LENGTH_NR_FC]; / extern const Word32 defaultHRIR_left_avg_power_32kHz_fx[LR_IAC_LENGTH_NR_FC]; /*Q-23*/ extern const Word32 defaultHRIR_right_avg_power_32kHz_fx[LR_IAC_LENGTH_NR_FC]; /*Q-23*/ +extern const Word32 defaultHRIR_coherence_16kHz_fx[LR_IAC_LENGTH_NR_FC_16KHZ]; /*Q-27*/ +extern const Word32 defaultHRIR_left_avg_power_16kHz_fx[LR_IAC_LENGTH_NR_FC_16KHZ]; /*Q-23*/ +extern const Word32 defaultHRIR_right_avg_power_16kHz_fx[LR_IAC_LENGTH_NR_FC_16KHZ]; /*Q-23*/ + #ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB -extern float defaultHRIR_coherence_16kHz_fx[LR_IAC_LENGTH_NR_FC_16KHZ]; /*Q-27*/ -extern float defaultHRIR_left_avg_power_16kHz_fx[LR_IAC_LENGTH_NR_FC_16KHZ]; /*Q-23*/ -extern float defaultHRIR_right_avg_power_16kHz_fx[LR_IAC_LENGTH_NR_FC_16KHZ]; /*Q-23*/ +extern const float defaultHRIR_coherence_16kHz[LR_IAC_LENGTH_NR_FC_16KHZ]; /*Q-27*/ +extern const float defaultHRIR_left_avg_power_16kHz[LR_IAC_LENGTH_NR_FC_16KHZ]; /*Q-23*/ +extern const float defaultHRIR_right_avg_power_16kHz[LR_IAC_LENGTH_NR_FC_16KHZ]; /*Q-23*/ + +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_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]; #else extern const Word32 defaultHRIR_coherence_16kHz_fx[LR_IAC_LENGTH_NR_FC]; /*Q-27*/ extern const Word32 defaultHRIR_left_avg_power_16kHz_fx[LR_IAC_LENGTH_NR_FC]; /*Q-23*/ diff --git a/lib_rend/ivas_rom_binaural_crend_head_fx.c b/lib_rend/ivas_rom_binaural_crend_head_fx.c index b4ebfe6e5..405f26ca7 100644 --- a/lib_rend/ivas_rom_binaural_crend_head_fx.c +++ b/lib_rend/ivas_rom_binaural_crend_head_fx.c @@ -59934,9 +59934,203 @@ const Word32 defaultHRIR_right_avg_power_16kHz_fx[LR_IAC_LENGTH_NR_FC] /*Q-23*/ 1708239,1437966,1167685,1059573,1059573 }; #else -/* Sample Rate = 16000 */ -const float defaultHRIR_coherence_16kHz_fx[LR_IAC_LENGTH_NR_FC_16KHZ] = +/********************** default HRIR reverb rom tables **********************/ + +/* Sample Rate = 48000 */ + +const float defaultHRIR_coherence_48kHz[LR_IAC_LENGTH_NR_FC] = + {0.997092f, 0.947391f, 0.799213f, 0.575216f, 0.335047f, 0.138324f, 0.007933f, 0.000000f, 0.000000f, + 0.000000f, 0.008438f, 0.037607f, 0.044493f, 0.042149f, 0.041877f, 0.039860f, 0.029404f, 0.015898f, + 0.010316f, 0.014065f, 0.020005f, 0.024518f, 0.029292f, 0.033522f, 0.033418f, 0.029630f, 0.027260f, + 0.027515f, 0.025682f, 0.019571f, 0.013977f, 0.013695f, 0.016531f, 0.016882f, 0.013257f, 0.008483f, + 0.004883f, 0.002525f, 0.001004f, 0.000180f, 0.000000f, 0.000000f, 0.000000f, 0.000785f, 0.003979f, + 0.007082f, 0.009598f, 0.011665f, 0.012700f, 0.011794f, 0.009192f, 0.006164f, 0.003527f, 0.001284f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000894f, 0.002136f, 0.003127f, 0.003616f, + 0.003810f, 0.003754f, 0.003186f, 0.002091f, 0.000823f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.001007f, 0.001843f, 0.002400f, + 0.002505f, 0.002133f, 0.001524f, 0.000903f, 0.000317f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000202f, 0.000867f, 0.001309f, + 0.001553f, 0.001563f, 0.001334f, 0.000961f, 0.000530f, 0.000033f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000278f, 0.000621f, 0.000951f, 0.001272f, 0.001608f, 0.001931f, + 0.002199f, 0.002435f, 0.002687f, 0.002947f, 0.003173f, 0.003370f, 0.003577f, 0.003781f, 0.003920f, + 0.003978f, 0.003985f, 0.003937f, 0.003783f, 0.003511f, 0.003170f, 0.002788f, 0.002337f, 0.001808f, + 0.001255f, 0.000716f, 0.000166f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.003551f, 0.000000f, 0.000000f, + 0.000000f, 0.005564f, 0.000000f, 0.000000f, 0.000000f, 0.008736f, 0.000000f, 0.000000f, 0.001007f, + 0.011608f, 0.002316f, 0.000000f, 0.000000f, 0.011987f, 0.005591f, 0.000000f, 0.000000f, 0.008714f, + 0.005905f, 0.000000f, 0.000000f, 0.005316f, 0.003972f, 0.000000f, 0.000000f, 0.003403f, 0.002041f, + 0.000000f, 0.000000f, 0.002140f, 0.000245f, 0.000000f}; + +const float defaultHRIR_left_avg_power_48kHz[LR_IAC_LENGTH_NR_FC] = + {0.981018f, 0.973361f, 0.958480f, 0.950611f, 0.953039f, 0.955845f, 0.950660f, 0.942556f, 0.943810f, + 0.958014f, 0.974983f, 0.982099f, 0.977269f, 0.968243f, 0.961714f, 0.957355f, 0.952468f, 0.947771f, + 0.945396f, 0.943711f, 0.938609f, 0.929975f, 0.922937f, 0.921202f, 0.922151f, 0.920926f, 0.917154f, + 0.914393f, 0.914067f, 0.913705f, 0.911632f, 0.910100f, 0.911873f, 0.915812f, 0.918271f, 0.917846f, + 0.916545f, 0.916408f, 0.916915f, 0.916273f, 0.914005f, 0.911339f, 0.909453f, 0.908137f, 0.906301f, + 0.903476f, 0.900479f, 0.898396f, 0.897057f, 0.895115f, 0.891879f, 0.888353f, 0.885879f, 0.884157f, + 0.881651f, 0.877929f, 0.874417f, 0.872453f, 0.871459f, 0.869941f, 0.867796f, 0.866504f, 0.866990f, + 0.868298f, 0.868985f, 0.869170f, 0.870398f, 0.873460f, 0.877373f, 0.880867f, 0.884271f, 0.889105f, + 0.895880f, 0.903280f, 0.909888f, 0.915965f, 0.922776f, 0.930375f, 0.937111f, 0.941667f, 0.944690f, + 0.947747f, 0.950950f, 0.952712f, 0.951893f, 0.949398f, 0.946830f, 0.944212f, 0.940067f, 0.933749f, + 0.926604f, 0.920193f, 0.914164f, 0.906886f, 0.897913f, 0.888731f, 0.880661f, 0.873093f, 0.864556f, + 0.855014f, 0.846098f, 0.839027f, 0.833268f, 0.827720f, 0.822648f, 0.819628f, 0.819557f, 0.821500f, + 0.823986f, 0.826902f, 0.831352f, 0.837670f, 0.844414f, 0.850004f, 0.854617f, 0.859684f, 0.865573f, + 0.870873f, 0.874346f, 0.876636f, 0.879215f, 0.882152f, 0.883944f, 0.883578f, 0.881897f, 0.880319f, + 0.878855f, 0.876201f, 0.871708f, 0.866458f, 0.861964f, 0.858239f, 0.853971f, 0.848551f, 0.843114f, + 0.839005f, 0.835832f, 0.831994f, 0.826972f, 0.822069f, 0.818424f, 0.815337f, 0.811300f, 0.806249f, + 0.801664f, 0.798529f, 0.796124f, 0.793286f, 0.790217f, 0.788277f, 0.788174f, 0.789082f, 0.789775f, + 0.790281f, 0.791803f, 0.794902f, 0.798467f, 0.801024f, 0.802713f, 0.804961f, 0.808244f, 0.811142f, + 0.812318f, 0.812488f, 0.813349f, 0.815025f, 0.815968f, 0.815334f, 0.814250f, 0.814149f, 0.814776f, + 0.814769f, 0.813685f, 0.812567f, 0.812562f, 0.813456f, 0.814055f, 0.813739f, 0.813391f, 0.814325f, + 0.816394f, 0.817949f, 0.818173f, 0.818552f, 0.820798f, 0.824070f, 0.826010f, 0.826515f, 0.828132f, + 0.832036f, 0.835874f, 0.837493f, 0.838582f, 0.842046f, 0.847074f, 0.850262f, 0.851182f, 0.852997f, + 0.856510f, 0.857491f, 0.852207f, 0.842444f, 0.831373f, 0.816756f, 0.793031f, 0.759822f, 0.723220f, + 0.686833f, 0.646128f, 0.595684f, 0.539241f, 0.486856f, 0.441279f, 0.391675f, 0.324292f, 0.238341f, + 0.149255f, 0.076756f, 0.031022f, 0.009191f, 0.001733f, 0.000140f, 0.000010f, 0.000019f, 0.000015f, + 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.981020f, 0.973360f, 0.958481f, 0.950613f, 0.953040f, 0.955848f, 0.950658f, 0.942557f, 0.943810f, + 0.958017f, 0.974981f, 0.982098f, 0.977271f, 0.968244f, 0.961715f, 0.957356f, 0.952467f, 0.947770f, + 0.945398f, 0.943710f, 0.938610f, 0.929975f, 0.922938f, 0.921205f, 0.922151f, 0.920926f, 0.917152f, + 0.914393f, 0.914069f, 0.913705f, 0.911630f, 0.910101f, 0.911874f, 0.915811f, 0.918272f, 0.917846f, + 0.916542f, 0.916408f, 0.916918f, 0.916272f, 0.914004f, 0.911340f, 0.909452f, 0.908136f, 0.906302f, + 0.903479f, 0.900480f, 0.898395f, 0.897055f, 0.895119f, 0.891880f, 0.888352f, 0.885878f, 0.884154f, + 0.881649f, 0.877926f, 0.874417f, 0.872450f, 0.871458f, 0.869943f, 0.867797f, 0.866503f, 0.866987f, + 0.868297f, 0.868981f, 0.869171f, 0.870394f, 0.873460f, 0.877377f, 0.880866f, 0.884272f, 0.889105f, + 0.895880f, 0.903282f, 0.909886f, 0.915965f, 0.922778f, 0.930375f, 0.937113f, 0.941665f, 0.944689f, + 0.947744f, 0.950952f, 0.952711f, 0.951895f, 0.949398f, 0.946830f, 0.944209f, 0.940067f, 0.933750f, + 0.926601f, 0.920191f, 0.914167f, 0.906884f, 0.897916f, 0.888731f, 0.880663f, 0.873093f, 0.864559f, + 0.855017f, 0.846098f, 0.839028f, 0.833267f, 0.827717f, 0.822649f, 0.819631f, 0.819558f, 0.821499f, + 0.823985f, 0.826902f, 0.831353f, 0.837669f, 0.844416f, 0.850003f, 0.854616f, 0.859686f, 0.865572f, + 0.870872f, 0.874347f, 0.876635f, 0.879216f, 0.882154f, 0.883942f, 0.883576f, 0.881895f, 0.880318f, + 0.878857f, 0.876202f, 0.871706f, 0.866459f, 0.861965f, 0.858241f, 0.853968f, 0.848548f, 0.843114f, + 0.839005f, 0.835832f, 0.831994f, 0.826974f, 0.822068f, 0.818424f, 0.815335f, 0.811299f, 0.806245f, + 0.801662f, 0.798530f, 0.796124f, 0.793287f, 0.790217f, 0.788273f, 0.788173f, 0.789081f, 0.789770f, + 0.790279f, 0.791801f, 0.794900f, 0.798466f, 0.801028f, 0.802711f, 0.804962f, 0.808246f, 0.811143f, + 0.812318f, 0.812490f, 0.813348f, 0.815027f, 0.815969f, 0.815335f, 0.814254f, 0.814150f, 0.814776f, + 0.814772f, 0.813686f, 0.812569f, 0.812558f, 0.813456f, 0.814055f, 0.813736f, 0.813389f, 0.814324f, + 0.816395f, 0.817948f, 0.818173f, 0.818549f, 0.820796f, 0.824069f, 0.826013f, 0.826514f, 0.828134f, + 0.832033f, 0.835874f, 0.837493f, 0.838582f, 0.842047f, 0.847077f, 0.850263f, 0.851184f, 0.852998f, + 0.856513f, 0.857491f, 0.852209f, 0.842446f, 0.831375f, 0.816757f, 0.793032f, 0.759821f, 0.723221f, + 0.686832f, 0.646128f, 0.595684f, 0.539241f, 0.486856f, 0.441280f, 0.391676f, 0.324293f, 0.238342f, + 0.149255f, 0.076756f, 0.031022f, 0.009191f, 0.001733f, 0.000140f, 0.000010f, 0.000019f, 0.000015f, + 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}; + +/* Sample Rate = 32000 */ + +const float defaultHRIR_coherence_32kHz[LR_IAC_LENGTH_NR_FC] = + {0.992805f, 0.970760f, 0.904274f, 0.794804f, 0.650716f, 0.489140f, 0.331131f, 0.193608f, 0.084875f, + 0.006016f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.006084f, 0.028478f, 0.040113f, + 0.042718f, 0.041091f, 0.039575f, 0.039321f, 0.038312f, 0.033935f, 0.025743f, 0.016207f, 0.009052f, + 0.006651f, 0.008629f, 0.012678f, 0.016595f, 0.019686f, 0.022543f, 0.025721f, 0.028716f, 0.030244f, + 0.029496f, 0.027051f, 0.024537f, 0.023327f, 0.023382f, 0.023280f, 0.021454f, 0.017604f, 0.013058f, + 0.009830f, 0.009160f, 0.010653f, 0.012635f, 0.013369f, 0.012139f, 0.009418f, 0.006248f, 0.003470f, + 0.001368f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.001485f, 0.003632f, 0.005492f, 0.007105f, 0.008527f, 0.009629f, + 0.010103f, 0.009685f, 0.008382f, 0.006502f, 0.004466f, 0.002568f, 0.000890f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000067f, 0.000797f, 0.001293f, 0.001577f, 0.001732f, 0.001797f, 0.001717f, 0.001403f, 0.000826f, + 0.000060f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000318f, 0.000795f, 0.001124f, 0.001249f, 0.001151f, 0.000871f, 0.000495f, 0.000102f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000206f, 0.000612f, 0.000908f, 0.001107f, + 0.001211f, 0.001209f, 0.001095f, 0.000883f, 0.000607f, 0.000298f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000029f, 0.000144f, 0.000254f, 0.000368f, 0.000486f, 0.000599f, + 0.000706f, 0.000810f, 0.000925f, 0.001059f, 0.001209f, 0.001367f, 0.001526f, 0.001686f, 0.001850f, + 0.002018f, 0.002181f, 0.002324f, 0.002440f, 0.002532f, 0.002614f, 0.002696f, 0.002779f, 0.002860f, + 0.002941f, 0.003036f, 0.003166f, 0.003347f, 0.003580f, 0.003855f, 0.004158f, 0.004487f, 0.004850f, + 0.005251f, 0.005688f, 0.006141f, 0.006591f, 0.007029f, 0.007462f, 0.007902f, 0.008351f, 0.008798f, + 0.009224f, 0.009620f, 0.009991f, 0.010352f, 0.010711f, 0.011057f, 0.011367f, 0.011621f, 0.011817f, + 0.011973f, 0.012106f, 0.012223f, 0.012309f, 0.012340f}; + + +const float defaultHRIR_left_avg_power_32kHz[LR_IAC_LENGTH_NR_FC] = + {1.030501f, 1.026884f, 1.017950f, 1.008331f, 1.002600f, 1.002689f, 1.006923f, 1.011298f, 1.012169f, + 1.008564f, 1.002836f, 0.999190f, 1.001098f, 1.009190f, 1.020853f, 1.031695f, 1.037922f, 1.038190f, + 1.033894f, 1.027913f, 1.022760f, 1.019333f, 1.016935f, 1.014341f, 1.010980f, 1.007343f, 1.004372f, + 1.002476f, 1.000944f, 0.998381f, 0.993744f, 0.987300f, 0.980631f, 0.975661f, 0.973406f, 0.973314f, + 0.973708f, 0.972973f, 0.970597f, 0.967379f, 0.964640f, 0.963173f, 0.962707f, 0.962251f, 0.960983f, + 0.959006f, 0.957269f, 0.956892f, 0.958263f, 0.960779f, 0.963180f, 0.964405f, 0.964185f, 0.963091f, + 0.962007f, 0.961501f, 0.961514f, 0.961497f, 0.960845f, 0.959307f, 0.957094f, 0.954689f, 0.952548f, + 0.950838f, 0.949382f, 0.947807f, 0.945783f, 0.943211f, 0.940296f, 0.937430f, 0.934938f, 0.932866f, + 0.930925f, 0.928674f, 0.925802f, 0.922364f, 0.918772f, 0.915508f, 0.912798f, 0.910417f, 0.907879f, + 0.904771f, 0.901065f, 0.897182f, 0.893708f, 0.890989f, 0.888922f, 0.887041f, 0.884873f, 0.882294f, + 0.879602f, 0.877334f, 0.875865f, 0.875169f, 0.874822f, 0.874316f, 0.873406f, 0.872264f, 0.871377f, + 0.871228f, 0.871946f, 0.873284f, 0.874764f, 0.876044f, 0.877146f, 0.878469f, 0.880494f, 0.883471f, + 0.887228f, 0.891261f, 0.895055f, 0.898401f, 0.901497f, 0.904769f, 0.908500f, 0.912597f, 0.916577f, + 0.919848f, 0.922085f, 0.923416f, 0.924327f, 0.925296f, 0.926465f, 0.927512f, 0.927876f, 0.927108f, + 0.925203f, 0.922559f, 0.919733f, 0.917037f, 0.914341f, 0.911186f, 0.907145f, 0.902128f, 0.896510f, + 0.890876f, 0.885647f, 0.880803f, 0.875934f, 0.870521f, 0.864338f, 0.857593f, 0.850818f, 0.844491f, + 0.838728f, 0.833217f, 0.827473f, 0.821173f, 0.814417f, 0.807660f, 0.801457f, 0.796095f, 0.791458f, + 0.787181f, 0.782928f, 0.778681f, 0.774802f, 0.771808f, 0.770061f, 0.769530f, 0.769827f, 0.770454f, + 0.771132f, 0.771943f, 0.773228f, 0.775315f, 0.778206f, 0.781513f, 0.784677f, 0.787274f, 0.789288f, + 0.791065f, 0.793055f, 0.795463f, 0.798095f, 0.800470f, 0.802135f, 0.802987f, 0.803318f, 0.803610f, + 0.804182f, 0.804958f, 0.805536f, 0.805434f, 0.804413f, 0.802618f, 0.800482f, 0.798381f, 0.796424f, + 0.794397f, 0.791922f, 0.788779f, 0.785087f, 0.781262f, 0.777778f, 0.774863f, 0.772372f, 0.769886f, + 0.767005f, 0.763613f, 0.759968f, 0.756518f, 0.753595f, 0.751171f, 0.748880f, 0.746246f, 0.743010f, + 0.739317f, 0.735608f, 0.732307f, 0.729533f, 0.727006f, 0.724256f, 0.720938f, 0.717104f, 0.713138f, + 0.709525f, 0.706513f, 0.703976f, 0.701515f, 0.698771f, 0.695693f, 0.692572f, 0.689860f, 0.687867f, + 0.686574f, 0.685644f, 0.684672f, 0.683452f, 0.682093f, 0.680935f, 0.680291f, 0.680231f, 0.680501f, + 0.680700f, 0.680500f, 0.679869f, 0.679047f, 0.678394f, 0.678091f, 0.678035f, 0.677888f, 0.677314f, + 0.676218f, 0.674814f, 0.673484f, 0.672514f, 0.671917f, 0.671422f, 0.670711f, 0.669654f, 0.668436f, + 0.667417f, 0.666896f, 0.666879f, 0.667100f, 0.667225f}; + +const float defaultHRIR_right_avg_power_32kHz[LR_IAC_LENGTH_NR_FC] = + {1.030502f, 1.026883f, 1.017953f, 1.008327f, 1.002600f, 1.002691f, 1.006922f, 1.011300f, 1.012168f, + 1.008564f, 1.002837f, 0.999188f, 1.001094f, 1.009186f, 1.020854f, 1.031695f, 1.037923f, 1.038191f, + 1.033893f, 1.027913f, 1.022760f, 1.019332f, 1.016931f, 1.014338f, 1.010982f, 1.007343f, 1.004370f, + 1.002473f, 1.000948f, 0.998380f, 0.993744f, 0.987300f, 0.980628f, 0.975661f, 0.973406f, 0.973316f, + 0.973710f, 0.972971f, 0.970599f, 0.967380f, 0.964639f, 0.963173f, 0.962708f, 0.962246f, 0.960984f, + 0.959004f, 0.957270f, 0.956889f, 0.958265f, 0.960778f, 0.963180f, 0.964406f, 0.964189f, 0.963091f, + 0.962005f, 0.961500f, 0.961514f, 0.961496f, 0.960845f, 0.959306f, 0.957092f, 0.954688f, 0.952548f, + 0.950838f, 0.949380f, 0.947808f, 0.945783f, 0.943212f, 0.940298f, 0.937430f, 0.934937f, 0.932865f, + 0.930925f, 0.928674f, 0.925801f, 0.922365f, 0.918770f, 0.915509f, 0.912795f, 0.910417f, 0.907881f, + 0.904769f, 0.901065f, 0.897183f, 0.893709f, 0.890990f, 0.888922f, 0.887040f, 0.884874f, 0.882293f, + 0.879603f, 0.877335f, 0.875867f, 0.875169f, 0.874820f, 0.874318f, 0.873404f, 0.872263f, 0.871381f, + 0.871226f, 0.871950f, 0.873283f, 0.874763f, 0.876042f, 0.877147f, 0.878470f, 0.880494f, 0.883473f, + 0.887227f, 0.891261f, 0.895053f, 0.898401f, 0.901500f, 0.904769f, 0.908500f, 0.912599f, 0.916578f, + 0.919847f, 0.922084f, 0.923417f, 0.924328f, 0.925296f, 0.926463f, 0.927512f, 0.927872f, 0.927107f, + 0.925199f, 0.922559f, 0.919735f, 0.917037f, 0.914339f, 0.911186f, 0.907142f, 0.902131f, 0.896510f, + 0.890876f, 0.885644f, 0.880802f, 0.875934f, 0.870524f, 0.864337f, 0.857594f, 0.850819f, 0.844491f, + 0.838727f, 0.833219f, 0.827473f, 0.821173f, 0.814415f, 0.807662f, 0.801459f, 0.796094f, 0.791462f, + 0.787182f, 0.782926f, 0.778681f, 0.774803f, 0.771810f, 0.770061f, 0.769529f, 0.769825f, 0.770456f, + 0.771131f, 0.771940f, 0.773230f, 0.775319f, 0.778206f, 0.781513f, 0.784675f, 0.787274f, 0.789285f, + 0.791065f, 0.793054f, 0.795465f, 0.798097f, 0.800468f, 0.802133f, 0.802987f, 0.803319f, 0.803610f, + 0.804179f, 0.804959f, 0.805538f, 0.805434f, 0.804411f, 0.802621f, 0.800480f, 0.798379f, 0.796426f, + 0.794398f, 0.791920f, 0.788777f, 0.785087f, 0.781263f, 0.777777f, 0.774862f, 0.772372f, 0.769886f, + 0.767004f, 0.763614f, 0.759968f, 0.756517f, 0.753593f, 0.751172f, 0.748881f, 0.746246f, 0.743011f, + 0.739318f, 0.735608f, 0.732306f, 0.729532f, 0.727006f, 0.724254f, 0.720939f, 0.717103f, 0.713136f, + 0.709524f, 0.706514f, 0.703976f, 0.701513f, 0.698772f, 0.695692f, 0.692570f, 0.689859f, 0.687869f, + 0.686573f, 0.685642f, 0.684671f, 0.683452f, 0.682094f, 0.680934f, 0.680290f, 0.680228f, 0.680501f, + 0.680699f, 0.680498f, 0.679867f, 0.679050f, 0.678395f, 0.678093f, 0.678035f, 0.677889f, 0.677315f, + 0.676220f, 0.674814f, 0.673485f, 0.672517f, 0.671918f, 0.671424f, 0.670712f, 0.669657f, 0.668437f, + 0.667421f, 0.666896f, 0.666880f, 0.667103f, 0.667228f}; + +/* Sample Rate = 16000 */ +// Floating point +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, 0.037785f, 0.035991f, 0.034784f, 0.035091f, 0.034683f, 0.030849f, 0.023146f, 0.014061f, 0.007275f, @@ -59953,7 +60147,7 @@ const float defaultHRIR_coherence_16kHz_fx[LR_IAC_LENGTH_NR_FC_16KHZ] = 0.000000f, 0.002101f, 0.004247f, 0.006330f, 0.008300f, 0.010110f, 0.011735f, 0.013165f, 0.014384f, 0.015345f, 0.015972f, 0.016191f}; -const float defaultHRIR_left_avg_power_16kHz_fx[LR_IAC_LENGTH_NR_FC_16KHZ] = +const float defaultHRIR_left_avg_power_16kHz[LR_IAC_LENGTH_NR_FC_16KHZ] = {1.118974f, 1.115256f, 1.106210f, 1.096901f, 1.092316f, 1.094422f, 1.101140f, 1.107775f, 1.110000f, 1.106535f, 1.099921f, 1.094914f, 1.095643f, 1.103178f, 1.114955f, 1.126292f, 1.132973f, 1.133288f, 1.128471f, 1.121439f, 1.114842f, 1.109721f, 1.105480f, 1.100966f, 1.095650f, 1.090074f, 1.085225f, @@ -59970,7 +60164,7 @@ const float defaultHRIR_left_avg_power_16kHz_fx[LR_IAC_LENGTH_NR_FC_16KHZ] = 0.408842f, 0.386537f, 0.364126f, 0.342284f, 0.321675f, 0.302809f, 0.286016f, 0.271536f, 0.259639f, 0.250691f, 0.245099f, 0.243192f}; -const float defaultHRIR_right_avg_power_16kHz_fx[LR_IAC_LENGTH_NR_FC_16KHZ] = +const float defaultHRIR_right_avg_power_16kHz[LR_IAC_LENGTH_NR_FC_16KHZ] = {1.118974f, 1.115254f, 1.106207f, 1.096903f, 1.092317f, 1.094425f, 1.101145f, 1.107775f, 1.109999f, 1.106540f, 1.099921f, 1.094912f, 1.095644f, 1.103178f, 1.114952f, 1.126292f, 1.132973f, 1.133288f, 1.128472f, 1.121439f, 1.114842f, 1.109719f, 1.105481f, 1.100965f, 1.095650f, 1.090072f, 1.085224f, @@ -59987,6 +60181,69 @@ const float defaultHRIR_right_avg_power_16kHz_fx[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}; +// Fixed-point +const Word32 defaultHRIR_coherence_16kHz_fx[LR_IAC_LENGTH_NR_FC_16KHZ] = +{ + 131941936, 128955584, 119957896, 105171136, 85760160, 64067220, 42933432, 24612042, + 10188334, 0, 0, 0, 0, 0, 0, 515664, + 3394098, 4816537, 5071417, 4830630, 4668629, 4709834, 4655073, 4140482, + 3106603, 1887235, 976434, 678202, 930128, 1421231, 1866297, 2186138, + 2470143, 2798305, 3109019, 3241224, 3100161, 2769582, 2459539, 2332838, + 2363708, 2353373, 2100507, 1581890, 985426, 575794, 500900, 690952, + 917780, 962609, 748800, 353261, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 31943, 233270, 404129, 524791, + 552977, 455534, 237431, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 281991, 570022, + 849598, 1114007, 1356941, 1575045, 1766976, 1930587, 2059571, 2143725, + 2173119 +}; + +const Word32 defaultHRIR_left_avg_power_16kHz_fx[LR_IAC_LENGTH_NR_FC_16KHZ] = +{ + 9386634, 9355445, 9279562, 9201473, 9163011, 9180677, 9237032, 9292690, + 9311355, 9282288, 9226806, 9184804, 9190920, 9254128, 9352920, 9448022, + 9504066, 9506709, 9466301, 9407312, 9351973, 9309014, 9273438, 9235572, + 9190978, 9144203, 9103527, 9072489, 9045159, 9009583, 8957163, 8890574, + 8823608, 8772571, 8745384, 8736165, 8729244, 8709816, 8673066, 8625888, + 8580254, 8543915, 8515712, 8488416, 8456111, 8420166, 8388541, 8369901, + 8366370, 8371495, 8374003, 8364927, 8342521, 8312129, 8281292, 8254415, + 8230340, 8203924, 8170085, 8127194, 8077516, 8025297, 7974076, 7924542, + 7874755, 7821529, 7762583, 7697915, 7630009, 7562422, 7497771, 7436123, + 7374886, 7310361, 7240560, 7166262, 7091175, 7019084, 6951270, 6885512, + 6817531, 6744105, 6665286, 6584654, 6506481, 6433064, 6363086, 6292764, + 6218727, 6140494, 6060970, 5984324, 5913289, 5847338, 5783265, 5717474, + 5648469, 5577845, 5508824, 5444181, 5383817, 5324753, 5262652, 5194159, + 5118611, 5037577, 4952986, 4864990, 4771121, 4667287, 4549888, 4417843, + 4272779, 4117833, 3955581, 3787012, 3611715, 3429615, 3242507, 3054510, + 2871286, 2698405, 2540146, 2399276, 2277809, 2178009, 2102948, 2056039, + 2040042 +}; + +const Word32 defaultHRIR_right_avg_power_16kHz_fx[LR_IAC_LENGTH_NR_FC_16KHZ] = +{ + 9386634, 9355429, 9279537, 9201489, 9163019, 9180702, 9237074, 9292690, + 9311346, 9282330, 9226806, 9184788, 9190928, 9254128, 9352895, 9448022, + 9504066, 9506709, 9466309, 9407312, 9351973, 9308998, 9273447, 9235564, + 9190978, 9144187, 9103519, 9072506, 9045184, 9009575, 8957146, 8890582, + 8823608, 8772571, 8745401, 8736173, 8729278, 8709825, 8673074, 8625888, + 8580237, 8543898, 8515721, 8488424, 8456136, 8420166, 8388566, 8369893, + 8366370, 8371487, 8374003, 8364935, 8342546, 8312129, 8281267, 8254415, + 8230340, 8203916, 8170076, 8127185, 8077508, 8025289, 7974068, 7924558, + 7874764, 7821529, 7762591, 7697907, 7630001, 7562422, 7497771, 7436132, + 7374870, 7310395, 7240526, 7166270, 7091175, 7019084, 6951270, 6885503, + 6817522, 6744113, 6665311, 6584646, 6506464, 6433072, 6363094, 6292781, + 6218727, 6140503, 6060962, 5984332, 5913297, 5847338, 5783257, 5717465, + 5648486, 5577837, 5508849, 5444190, 5383825, 5324769, 5262635, 5194159, + 5118619, 5037585, 4952986, 4864998, 4771130, 4667279, 4549888, 4417827, + 4272779, 4117825, 3955589, 3787003, 3611715, 3429623, 3242507, 3054518, + 2871294, 2698413, 2540146, 2399276, 2277800, 2178018, 2102957, 2056039, + 2040042 +}; #endif #endif -- GitLab From f8edfde8bfa607f535f83affcf8ac6178ac2fb31 Mon Sep 17 00:00:00 2001 From: Devansh Kandpal <43807487+mrkandpal@users.noreply.github.com> Date: Wed, 25 Jun 2025 16:36:43 +0200 Subject: [PATCH 04/12] Code Cleanup --- lib_rend/ivas_hrtf_fx.c | 137 -------- lib_rend/ivas_rom_binaural_crend_head_fx.c | 345 --------------------- 2 files changed, 482 deletions(-) diff --git a/lib_rend/ivas_hrtf_fx.c b/lib_rend/ivas_hrtf_fx.c index 5729337d4..13b5ae5cb 100644 --- a/lib_rend/ivas_hrtf_fx.c +++ b/lib_rend/ivas_hrtf_fx.c @@ -289,156 +289,19 @@ ivas_error ivas_HRTF_statistics_init( switch ( sampleRate ) { case 48000: -#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB - HrtfStatistics->average_energy_l_dyn = (Word32 *) malloc( LR_IAC_LENGTH_NR_FC * sizeof( float ) ); - if ( HrtfStatistics->average_energy_l_dyn == NULL ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for hrtf data" ); - } - HrtfStatistics->average_energy_r_dyn = (Word32 *) malloc( LR_IAC_LENGTH_NR_FC * sizeof( float ) ); - if ( HrtfStatistics->average_energy_r_dyn == NULL ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for hrtf data" ); - } - HrtfStatistics->inter_aural_coherence_dyn = (Word32 *) malloc( LR_IAC_LENGTH_NR_FC * sizeof( float ) ); - if ( HrtfStatistics->inter_aural_coherence_dyn == NULL ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for hrtf data" ); - } - floatToFixed_arr32( (float*) defaultHRIR_left_avg_power_48kHz, HrtfStatistics->average_energy_l_dyn, Q23, LR_IAC_LENGTH_NR_FC ); /* tables from which lr_energy_and_iac is updated has Q23 for i=2 */ - floatToFixed_arr32( (float*) defaultHRIR_right_avg_power_48kHz, HrtfStatistics->average_energy_r_dyn, Q23, LR_IAC_LENGTH_NR_FC ); /* tables from which lr_energy_and_iac is updated has Q23 for i=2 */ - floatToFixed_arr32( (float*) defaultHRIR_coherence_48kHz, HrtfStatistics->inter_aural_coherence_dyn, Q27, LR_IAC_LENGTH_NR_FC ); /* tables from which lr_energy_and_iac is updated has Q27 for i=2 */ - HrtfStatistics->average_energy_l = (const Word32 *) HrtfStatistics->average_energy_l_dyn; - HrtfStatistics->average_energy_r = (const Word32 *) HrtfStatistics->average_energy_r_dyn; - HrtfStatistics->inter_aural_coherence = (const Word32 *) HrtfStatistics->inter_aural_coherence_dyn; - // TODO: dump the converted fixed point arrays to an array - printf( "average_energy_l = {\n" ); - for ( int i = 0; i < LR_IAC_LENGTH_NR_FC; i++ ) - { - printf( "%d, ", HrtfStatistics->average_energy_l_dyn[i] ); - } - printf( "};\n" ); - - printf( "average_energy_r = {\n" ); - for ( int i = 0; i < LR_IAC_LENGTH_NR_FC; i++ ) - { - printf( "%d, ", HrtfStatistics->average_energy_r_dyn[i] ); - } - printf( "};\n" ); - - printf( "inter_aural_coherence = {\n" ); - for ( int i = 0; i < LR_IAC_LENGTH_NR_FC; i++ ) - { - printf( "%d, ", HrtfStatistics->inter_aural_coherence_dyn[i] ); - } - printf( "};\n" ); -#else HrtfStatistics->average_energy_l = defaultHRIR_left_avg_power_48kHz_fx; HrtfStatistics->average_energy_r = defaultHRIR_right_avg_power_48kHz_fx; HrtfStatistics->inter_aural_coherence = defaultHRIR_coherence_48kHz_fx; -#endif break; case 32000: -#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB - HrtfStatistics->average_energy_l_dyn = (Word32 *) malloc( LR_IAC_LENGTH_NR_FC * sizeof( float ) ); - if ( HrtfStatistics->average_energy_l_dyn == NULL ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for hrtf data" ); - } - HrtfStatistics->average_energy_r_dyn = (Word32 *) malloc( LR_IAC_LENGTH_NR_FC * sizeof( float ) ); - if ( HrtfStatistics->average_energy_r_dyn == NULL ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for hrtf data" ); - } - HrtfStatistics->inter_aural_coherence_dyn = (Word32 *) malloc( LR_IAC_LENGTH_NR_FC * sizeof( float ) ); - if ( HrtfStatistics->inter_aural_coherence_dyn == NULL ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for hrtf data" ); - } - floatToFixed_arr32( (float*) defaultHRIR_left_avg_power_32kHz, HrtfStatistics->average_energy_l_dyn, Q23, LR_IAC_LENGTH_NR_FC ); /* tables from which lr_energy_and_iac is updated has Q23 for i=2 */ - floatToFixed_arr32( (float *) defaultHRIR_right_avg_power_32kHz, HrtfStatistics->average_energy_r_dyn, Q23, LR_IAC_LENGTH_NR_FC ); /* tables from which lr_energy_and_iac is updated has Q23 for i=2 */ - floatToFixed_arr32( (float *) defaultHRIR_coherence_32kHz, HrtfStatistics->inter_aural_coherence_dyn, Q27, LR_IAC_LENGTH_NR_FC ); /* tables from which lr_energy_and_iac is updated has Q27 for i=2 */ - HrtfStatistics->average_energy_l = (const Word32 *) HrtfStatistics->average_energy_l_dyn; - HrtfStatistics->average_energy_r = (const Word32 *) HrtfStatistics->average_energy_r_dyn; - HrtfStatistics->inter_aural_coherence = (const Word32 *) HrtfStatistics->inter_aural_coherence_dyn; - // TODO: dump the converted fixed point arrays to a string - - printf( "average_energy_l = {\n" ); - for ( int i = 0; i < LR_IAC_LENGTH_NR_FC; i++ ) - { - printf( "%d, ", HrtfStatistics->average_energy_l_dyn[i] ); - } - printf( "};\n" ); - - printf( "average_energy_r = {\n" ); - for ( int i = 0; i < LR_IAC_LENGTH_NR_FC; i++ ) - { - printf( "%d, ", HrtfStatistics->average_energy_r_dyn[i] ); - } - printf( "};\n" ); - - printf( "inter_aural_coherence = {\n" ); - for ( int i = 0; i < LR_IAC_LENGTH_NR_FC; i++ ) - { - printf( "%d, ", HrtfStatistics->inter_aural_coherence_dyn[i] ); - } - printf( "};\n" ); -#else HrtfStatistics->average_energy_l = defaultHRIR_left_avg_power_32kHz_fx; HrtfStatistics->average_energy_r = defaultHRIR_right_avg_power_32kHz_fx; HrtfStatistics->inter_aural_coherence = defaultHRIR_coherence_32kHz_fx; -#endif break; case 16000: -#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB - HrtfStatistics->average_energy_l_dyn = (Word32 *) malloc( LR_IAC_LENGTH_NR_FC_16KHZ * sizeof( float ) ); - if ( HrtfStatistics->average_energy_l_dyn == NULL ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for hrtf data" ); - } - HrtfStatistics->average_energy_r_dyn = (Word32 *) malloc( LR_IAC_LENGTH_NR_FC_16KHZ * sizeof( float ) ); - if ( HrtfStatistics->average_energy_r_dyn == NULL ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for hrtf data" ); - } - HrtfStatistics->inter_aural_coherence_dyn = (Word32 *) malloc( LR_IAC_LENGTH_NR_FC_16KHZ * sizeof( float ) ); - if ( HrtfStatistics->inter_aural_coherence_dyn == NULL ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for hrtf data" ); - } - floatToFixed_arr32( (float*) defaultHRIR_left_avg_power_16kHz, HrtfStatistics->average_energy_l_dyn, Q23, LR_IAC_LENGTH_NR_FC_16KHZ ); /* tables from which lr_energy_and_iac is updated has Q23 for i=2 */ - floatToFixed_arr32( (float*) defaultHRIR_right_avg_power_16kHz, HrtfStatistics->average_energy_r_dyn, Q23, LR_IAC_LENGTH_NR_FC_16KHZ ); /* tables from which lr_energy_and_iac is updated has Q23 for i=2 */ - floatToFixed_arr32( (float*) defaultHRIR_coherence_16kHz, HrtfStatistics->inter_aural_coherence_dyn, Q27, LR_IAC_LENGTH_NR_FC_16KHZ ); /* tables from which lr_energy_and_iac is updated has Q27 for i=2 */ - HrtfStatistics->average_energy_l = (const Word32 *) HrtfStatistics->average_energy_l_dyn; - HrtfStatistics->average_energy_r = (const Word32 *) HrtfStatistics->average_energy_r_dyn; - HrtfStatistics->inter_aural_coherence = (const Word32 *) HrtfStatistics->inter_aural_coherence_dyn; - - printf( "\naverage_energy_l = {\n" ); - for ( int i = 0; i < LR_IAC_LENGTH_NR_FC_16KHZ; i++ ) - { - printf( "%d, ", HrtfStatistics->average_energy_l_dyn[i] ); - } - printf( "};\n" ); - - printf( "average_energy_r = {\n" ); - for ( int i = 0; i < LR_IAC_LENGTH_NR_FC_16KHZ; i++ ) - { - printf( "%d, ", HrtfStatistics->average_energy_r_dyn[i] ); - } - printf( "};\n" ); - - printf( "inter_aural_coherence = {\n" ); - for ( int i = 0; i < LR_IAC_LENGTH_NR_FC_16KHZ; i++ ) - { - printf( "%d, ", HrtfStatistics->inter_aural_coherence_dyn[i] ); - } - printf( "};\n" ); -#else - HrtfStatistics->average_energy_l = defaultHRIR_left_avg_power_16kHz_fx; HrtfStatistics->average_energy_r = defaultHRIR_right_avg_power_16kHz_fx; HrtfStatistics->inter_aural_coherence = defaultHRIR_coherence_16kHz_fx; -#endif break; } HrtfStatistics->fromROM = TRUE; diff --git a/lib_rend/ivas_rom_binaural_crend_head_fx.c b/lib_rend/ivas_rom_binaural_crend_head_fx.c index 405f26ca7..df78d5b25 100644 --- a/lib_rend/ivas_rom_binaural_crend_head_fx.c +++ b/lib_rend/ivas_rom_binaural_crend_head_fx.c @@ -59838,350 +59838,6 @@ const Word32 defaultHRIR_right_avg_power_32kHz_fx[LR_IAC_LENGTH_NR_FC] /*Q-23*/ 2790378,2355663,2029237,1865240,1832432 }; -#ifndef NONBE_FIX_AVG_IAC_CLDFB_REVERB - -const Word32 defaultHRIR_coherence_16kHz_fx[LR_IAC_LENGTH_NR_FC] /*Q-27*/ = { - 130123416,130123416,128225040,123478832,118732624,113118568,104033232,94947768,85862304, - 75063144,64263984,53464828,43914296,34675820,25437480,17993766,11746601,5499437, - 1532229,985023,437818,0,0,0,0,0,0, - 0,343865,773496,1203261,2004810,3054258,4103707,4777480,4887673, - 4998000,5066316,4966727,4867271,4767816,4765534,4763253,4760971,4569174, - 4329998,4090822,3659312,3099355,2539533,2037290,1621350,1205543,880065, - 916304,952677,988916,1233058,1477200,1721342,1912602,2090441,2268413, - 2427327,2573490,2719788,2859643,2989834,3120025,3219078,3193576,3168075, - 3142574,2987686,2832665,2677778,2583691,2504771,2425851,2397128,2401692, - 2406255,2356594,2225464,2094333,1933137,1651280,1369423,1087566,924357, - 761148,597940,625051,699677,774302,854295,937779,1021128,1026631, - 915230,803830,670014,446676,223338,0,0,0,0, - 0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,5100,30735, - 56371,81872,173140,264408,355542,419698,477144,534455,552037, - 543044,533918,485599,378494,271254,173946,115964,57982,0, - 0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0, - 0,0,671,1476,2415,99723,261321,423054,646795, - 963549,1280302,1632087,2124129,2616037,3108080,3841982,4575885,5309922, - 6280181,7309766,8339216,8750996,8750996 -}; -const Word32 defaultHRIR_left_avg_power_16kHz_fx[LR_IAC_LENGTH_NR_FC] /*Q-23*/ = { - 9335246,9335246,9316514,9269680,9222847,9180350,9155201,9130044,9104894, - 9126688,9148473,9170267,9191549,9212688,9233844,9234423,9221295,9208167, - 9191205,9168497,9145789,9127997,9129884,9131780,9133676,9164823,9195978, - 9227125,9267550,9310290,9353038,9385225,9410374,9435531,9445170,9431538, - 9417907,9399855,9364128,9328409,9292682,9270670,9248667,9226655,9215783, - 9207688,9199593,9183605,9162356,9141108,9116244,9085961,9055678,9028608, - 9014432,9000255,8986078,8975962,8965845,8955728,8926108,8891606,8857103, - 8819145,8778896,8738639,8710806,8701604,8692401,8686227,8692209,8698190, - 8704171,8686706,8669232,8651767,8623917,8593466,8563024,8543554,8531399, - 8519252,8509748,8504203,8498667,8489716,8467083,8444459,8421835,8399773, - 8377711,8355649,8351698,8352268,8352847,8355833,8360430,8365027,8363484, - 8352721,8341959,8331028,8319460,8307884,8296308,8292063,8287827,8283582, - 8271142,8256647,8242159,8221389,8196442,8171494,8150547,8135607,8120659, - 8106465,8095225,8083992,8072760,8043073,8013394,7983706,7949422,7913997, - 7878564,7853893,7836394,7818904,7801472,7784141,7766811,7744782,7703972, - 7663169,7622359,7580802,7539253,7497696,7474266,7455367,7436467,7415496, - 7393140,7370784,7338471,7291235,7244007,7197551,7154232,7110914,7067595, - 7046615,7025627,7004647,6977485,6948779,6920073,6878751,6829015,6779278, - 6733644,6694184,6654724,6618804,6597044,6575284,6553524,6518183,6482842, - 6447501,6401632,6353137,6304634,6267229,6237215,6207201,6181045,6160677, - 6140310,6115580,6073427,6031275,5989122,5942817,5896503,5850198,5825150, - 5805428,5785707,5765742,5745626,5725510,5693398,5643285,5593180,5544358, - 5500720,5457091,5413454,5404126,5394797,5385469,5366930,5346085,5325239, - 5282164,5224274,5166376,5115566,5075376,5035186,5002731,5001238,4999736, - 4998243,4969436,4940630,4911823,4847290,4773822,4700355,4646282,4605153, - 4564023,4540250,4542523,4544788,4536869,4488241,4439612,4390983,4285488, - 4179984,4074489,4025282,3990150,3955019,3974925,4031523,4088129,4108127, - 4073222,4038317,3957300,3691818,3426335,3160861,2774481,2388110,2001740, - 1708239,1437966,1167685,1059581,1059581 -}; -const Word32 defaultHRIR_right_avg_power_16kHz_fx[LR_IAC_LENGTH_NR_FC] /*Q-23*/ = { - 9335246,9335246,9316514,9269689,9222855,9180358,9155201,9130035,9104869, - 9126663,9148465,9170258,9191540,9212688,9233827,9234415,9221295,9208175, - 9191213,9168488,9145755,9127963,9129867,9131772,9133676,9164831,9195978, - 9227133,9267550,9310281,9353021,9385200,9410357,9435506,9445153,9431522, - 9417899,9399855,9364119,9328384,9292648,9270653,9248658,9226663,9215792, - 9207688,9199593,9183596,9162348,9141100,9116236,9085953,9055678,9028617, - 9014432,9000255,8986070,8975962,8965853,8955745,8926116,8891614,8857103, - 8819145,8778888,8738631,8710789,8701587,8692385,8686219,8692200,8698181, - 8704162,8686697,8669232,8651775,8623917,8593466,8563016,8543546,8531390, - 8519244,8509739,8504203,8498675,8489724,8467100,8444468,8421844,8399773, - 8377703,8355641,8351681,8352252,8352830,8355817,8360414,8365019,8363475, - 8352721,8341959,8331037,8319469,8307893,8296316,8292072,8287835,8283591, - 8271142,8256647,8242151,8221381,8196433,8171494,8150547,8135616,8120676, - 8106482,8095250,8084009,8072777,8043081,8013385,7983698,7949405,7913972, - 7878547,7853876,7836386,7818904,7801481,7784150,7766819,7744790,7703980, - 7663161,7622350,7580793,7539244,7497696,7474258,7455358,7436459,7415487, - 7393132,7370776,7338471,7291244,7244016,7197560,7154241,7110914,7067587, - 7046607,7025627,7004647,6977485,6948770,6920064,6878742,6829006,6779270, - 6733644,6694184,6654724,6618813,6597053,6575301,6553549,6518191,6482842, - 6447492,6401623,6353137,6304643,6267229,6237215,6207201,6181037,6160677, - 6140310,6115580,6073427,6031275,5989122,5942817,5896512,5850207,5825167, - 5805445,5785723,5765750,5745626,5725493,5693382,5643276,5593180,5544375, - 5500729,5457074,5413429,5404109,5394789,5385478,5366939,5346093,5325247, - 5282172,5224282,5166384,5115574,5075384,5035195,5002739,5001238,4999736, - 4998243,4969436,4940630,4911823,4847290,4773814,4700338,4646274,4605153, - 4564023,4540258,4542523,4544788,4536878,4488249,4439612,4390983,4285480, - 4179984,4074489,4025282,3990150,3955019,3974925,4031523,4088129,4108127, - 4073222,4038317,3957292,3691809,3426327,3160844,2774473,2388110,2001740, - 1708239,1437966,1167685,1059573,1059573 -}; -#else - -/********************** default HRIR reverb rom tables **********************/ - -/* Sample Rate = 48000 */ - -const float defaultHRIR_coherence_48kHz[LR_IAC_LENGTH_NR_FC] = - {0.997092f, 0.947391f, 0.799213f, 0.575216f, 0.335047f, 0.138324f, 0.007933f, 0.000000f, 0.000000f, - 0.000000f, 0.008438f, 0.037607f, 0.044493f, 0.042149f, 0.041877f, 0.039860f, 0.029404f, 0.015898f, - 0.010316f, 0.014065f, 0.020005f, 0.024518f, 0.029292f, 0.033522f, 0.033418f, 0.029630f, 0.027260f, - 0.027515f, 0.025682f, 0.019571f, 0.013977f, 0.013695f, 0.016531f, 0.016882f, 0.013257f, 0.008483f, - 0.004883f, 0.002525f, 0.001004f, 0.000180f, 0.000000f, 0.000000f, 0.000000f, 0.000785f, 0.003979f, - 0.007082f, 0.009598f, 0.011665f, 0.012700f, 0.011794f, 0.009192f, 0.006164f, 0.003527f, 0.001284f, - 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000894f, 0.002136f, 0.003127f, 0.003616f, - 0.003810f, 0.003754f, 0.003186f, 0.002091f, 0.000823f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, - 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.001007f, 0.001843f, 0.002400f, - 0.002505f, 0.002133f, 0.001524f, 0.000903f, 0.000317f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, - 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, - 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000202f, 0.000867f, 0.001309f, - 0.001553f, 0.001563f, 0.001334f, 0.000961f, 0.000530f, 0.000033f, 0.000000f, 0.000000f, 0.000000f, - 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, - 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, - 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, - 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, - 0.000000f, 0.000000f, 0.000000f, 0.000278f, 0.000621f, 0.000951f, 0.001272f, 0.001608f, 0.001931f, - 0.002199f, 0.002435f, 0.002687f, 0.002947f, 0.003173f, 0.003370f, 0.003577f, 0.003781f, 0.003920f, - 0.003978f, 0.003985f, 0.003937f, 0.003783f, 0.003511f, 0.003170f, 0.002788f, 0.002337f, 0.001808f, - 0.001255f, 0.000716f, 0.000166f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, - 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, - 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, - 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, - 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.003551f, 0.000000f, 0.000000f, - 0.000000f, 0.005564f, 0.000000f, 0.000000f, 0.000000f, 0.008736f, 0.000000f, 0.000000f, 0.001007f, - 0.011608f, 0.002316f, 0.000000f, 0.000000f, 0.011987f, 0.005591f, 0.000000f, 0.000000f, 0.008714f, - 0.005905f, 0.000000f, 0.000000f, 0.005316f, 0.003972f, 0.000000f, 0.000000f, 0.003403f, 0.002041f, - 0.000000f, 0.000000f, 0.002140f, 0.000245f, 0.000000f}; - -const float defaultHRIR_left_avg_power_48kHz[LR_IAC_LENGTH_NR_FC] = - {0.981018f, 0.973361f, 0.958480f, 0.950611f, 0.953039f, 0.955845f, 0.950660f, 0.942556f, 0.943810f, - 0.958014f, 0.974983f, 0.982099f, 0.977269f, 0.968243f, 0.961714f, 0.957355f, 0.952468f, 0.947771f, - 0.945396f, 0.943711f, 0.938609f, 0.929975f, 0.922937f, 0.921202f, 0.922151f, 0.920926f, 0.917154f, - 0.914393f, 0.914067f, 0.913705f, 0.911632f, 0.910100f, 0.911873f, 0.915812f, 0.918271f, 0.917846f, - 0.916545f, 0.916408f, 0.916915f, 0.916273f, 0.914005f, 0.911339f, 0.909453f, 0.908137f, 0.906301f, - 0.903476f, 0.900479f, 0.898396f, 0.897057f, 0.895115f, 0.891879f, 0.888353f, 0.885879f, 0.884157f, - 0.881651f, 0.877929f, 0.874417f, 0.872453f, 0.871459f, 0.869941f, 0.867796f, 0.866504f, 0.866990f, - 0.868298f, 0.868985f, 0.869170f, 0.870398f, 0.873460f, 0.877373f, 0.880867f, 0.884271f, 0.889105f, - 0.895880f, 0.903280f, 0.909888f, 0.915965f, 0.922776f, 0.930375f, 0.937111f, 0.941667f, 0.944690f, - 0.947747f, 0.950950f, 0.952712f, 0.951893f, 0.949398f, 0.946830f, 0.944212f, 0.940067f, 0.933749f, - 0.926604f, 0.920193f, 0.914164f, 0.906886f, 0.897913f, 0.888731f, 0.880661f, 0.873093f, 0.864556f, - 0.855014f, 0.846098f, 0.839027f, 0.833268f, 0.827720f, 0.822648f, 0.819628f, 0.819557f, 0.821500f, - 0.823986f, 0.826902f, 0.831352f, 0.837670f, 0.844414f, 0.850004f, 0.854617f, 0.859684f, 0.865573f, - 0.870873f, 0.874346f, 0.876636f, 0.879215f, 0.882152f, 0.883944f, 0.883578f, 0.881897f, 0.880319f, - 0.878855f, 0.876201f, 0.871708f, 0.866458f, 0.861964f, 0.858239f, 0.853971f, 0.848551f, 0.843114f, - 0.839005f, 0.835832f, 0.831994f, 0.826972f, 0.822069f, 0.818424f, 0.815337f, 0.811300f, 0.806249f, - 0.801664f, 0.798529f, 0.796124f, 0.793286f, 0.790217f, 0.788277f, 0.788174f, 0.789082f, 0.789775f, - 0.790281f, 0.791803f, 0.794902f, 0.798467f, 0.801024f, 0.802713f, 0.804961f, 0.808244f, 0.811142f, - 0.812318f, 0.812488f, 0.813349f, 0.815025f, 0.815968f, 0.815334f, 0.814250f, 0.814149f, 0.814776f, - 0.814769f, 0.813685f, 0.812567f, 0.812562f, 0.813456f, 0.814055f, 0.813739f, 0.813391f, 0.814325f, - 0.816394f, 0.817949f, 0.818173f, 0.818552f, 0.820798f, 0.824070f, 0.826010f, 0.826515f, 0.828132f, - 0.832036f, 0.835874f, 0.837493f, 0.838582f, 0.842046f, 0.847074f, 0.850262f, 0.851182f, 0.852997f, - 0.856510f, 0.857491f, 0.852207f, 0.842444f, 0.831373f, 0.816756f, 0.793031f, 0.759822f, 0.723220f, - 0.686833f, 0.646128f, 0.595684f, 0.539241f, 0.486856f, 0.441279f, 0.391675f, 0.324292f, 0.238341f, - 0.149255f, 0.076756f, 0.031022f, 0.009191f, 0.001733f, 0.000140f, 0.000010f, 0.000019f, 0.000015f, - 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.981020f, 0.973360f, 0.958481f, 0.950613f, 0.953040f, 0.955848f, 0.950658f, 0.942557f, 0.943810f, - 0.958017f, 0.974981f, 0.982098f, 0.977271f, 0.968244f, 0.961715f, 0.957356f, 0.952467f, 0.947770f, - 0.945398f, 0.943710f, 0.938610f, 0.929975f, 0.922938f, 0.921205f, 0.922151f, 0.920926f, 0.917152f, - 0.914393f, 0.914069f, 0.913705f, 0.911630f, 0.910101f, 0.911874f, 0.915811f, 0.918272f, 0.917846f, - 0.916542f, 0.916408f, 0.916918f, 0.916272f, 0.914004f, 0.911340f, 0.909452f, 0.908136f, 0.906302f, - 0.903479f, 0.900480f, 0.898395f, 0.897055f, 0.895119f, 0.891880f, 0.888352f, 0.885878f, 0.884154f, - 0.881649f, 0.877926f, 0.874417f, 0.872450f, 0.871458f, 0.869943f, 0.867797f, 0.866503f, 0.866987f, - 0.868297f, 0.868981f, 0.869171f, 0.870394f, 0.873460f, 0.877377f, 0.880866f, 0.884272f, 0.889105f, - 0.895880f, 0.903282f, 0.909886f, 0.915965f, 0.922778f, 0.930375f, 0.937113f, 0.941665f, 0.944689f, - 0.947744f, 0.950952f, 0.952711f, 0.951895f, 0.949398f, 0.946830f, 0.944209f, 0.940067f, 0.933750f, - 0.926601f, 0.920191f, 0.914167f, 0.906884f, 0.897916f, 0.888731f, 0.880663f, 0.873093f, 0.864559f, - 0.855017f, 0.846098f, 0.839028f, 0.833267f, 0.827717f, 0.822649f, 0.819631f, 0.819558f, 0.821499f, - 0.823985f, 0.826902f, 0.831353f, 0.837669f, 0.844416f, 0.850003f, 0.854616f, 0.859686f, 0.865572f, - 0.870872f, 0.874347f, 0.876635f, 0.879216f, 0.882154f, 0.883942f, 0.883576f, 0.881895f, 0.880318f, - 0.878857f, 0.876202f, 0.871706f, 0.866459f, 0.861965f, 0.858241f, 0.853968f, 0.848548f, 0.843114f, - 0.839005f, 0.835832f, 0.831994f, 0.826974f, 0.822068f, 0.818424f, 0.815335f, 0.811299f, 0.806245f, - 0.801662f, 0.798530f, 0.796124f, 0.793287f, 0.790217f, 0.788273f, 0.788173f, 0.789081f, 0.789770f, - 0.790279f, 0.791801f, 0.794900f, 0.798466f, 0.801028f, 0.802711f, 0.804962f, 0.808246f, 0.811143f, - 0.812318f, 0.812490f, 0.813348f, 0.815027f, 0.815969f, 0.815335f, 0.814254f, 0.814150f, 0.814776f, - 0.814772f, 0.813686f, 0.812569f, 0.812558f, 0.813456f, 0.814055f, 0.813736f, 0.813389f, 0.814324f, - 0.816395f, 0.817948f, 0.818173f, 0.818549f, 0.820796f, 0.824069f, 0.826013f, 0.826514f, 0.828134f, - 0.832033f, 0.835874f, 0.837493f, 0.838582f, 0.842047f, 0.847077f, 0.850263f, 0.851184f, 0.852998f, - 0.856513f, 0.857491f, 0.852209f, 0.842446f, 0.831375f, 0.816757f, 0.793032f, 0.759821f, 0.723221f, - 0.686832f, 0.646128f, 0.595684f, 0.539241f, 0.486856f, 0.441280f, 0.391676f, 0.324293f, 0.238342f, - 0.149255f, 0.076756f, 0.031022f, 0.009191f, 0.001733f, 0.000140f, 0.000010f, 0.000019f, 0.000015f, - 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}; - -/* Sample Rate = 32000 */ - -const float defaultHRIR_coherence_32kHz[LR_IAC_LENGTH_NR_FC] = - {0.992805f, 0.970760f, 0.904274f, 0.794804f, 0.650716f, 0.489140f, 0.331131f, 0.193608f, 0.084875f, - 0.006016f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.006084f, 0.028478f, 0.040113f, - 0.042718f, 0.041091f, 0.039575f, 0.039321f, 0.038312f, 0.033935f, 0.025743f, 0.016207f, 0.009052f, - 0.006651f, 0.008629f, 0.012678f, 0.016595f, 0.019686f, 0.022543f, 0.025721f, 0.028716f, 0.030244f, - 0.029496f, 0.027051f, 0.024537f, 0.023327f, 0.023382f, 0.023280f, 0.021454f, 0.017604f, 0.013058f, - 0.009830f, 0.009160f, 0.010653f, 0.012635f, 0.013369f, 0.012139f, 0.009418f, 0.006248f, 0.003470f, - 0.001368f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, - 0.000000f, 0.000000f, 0.000000f, 0.001485f, 0.003632f, 0.005492f, 0.007105f, 0.008527f, 0.009629f, - 0.010103f, 0.009685f, 0.008382f, 0.006502f, 0.004466f, 0.002568f, 0.000890f, 0.000000f, 0.000000f, - 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, - 0.000067f, 0.000797f, 0.001293f, 0.001577f, 0.001732f, 0.001797f, 0.001717f, 0.001403f, 0.000826f, - 0.000060f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, - 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, - 0.000000f, 0.000318f, 0.000795f, 0.001124f, 0.001249f, 0.001151f, 0.000871f, 0.000495f, 0.000102f, - 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, - 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, - 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, - 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000206f, 0.000612f, 0.000908f, 0.001107f, - 0.001211f, 0.001209f, 0.001095f, 0.000883f, 0.000607f, 0.000298f, 0.000000f, 0.000000f, 0.000000f, - 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, - 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, - 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, - 0.000000f, 0.000000f, 0.000000f, 0.000029f, 0.000144f, 0.000254f, 0.000368f, 0.000486f, 0.000599f, - 0.000706f, 0.000810f, 0.000925f, 0.001059f, 0.001209f, 0.001367f, 0.001526f, 0.001686f, 0.001850f, - 0.002018f, 0.002181f, 0.002324f, 0.002440f, 0.002532f, 0.002614f, 0.002696f, 0.002779f, 0.002860f, - 0.002941f, 0.003036f, 0.003166f, 0.003347f, 0.003580f, 0.003855f, 0.004158f, 0.004487f, 0.004850f, - 0.005251f, 0.005688f, 0.006141f, 0.006591f, 0.007029f, 0.007462f, 0.007902f, 0.008351f, 0.008798f, - 0.009224f, 0.009620f, 0.009991f, 0.010352f, 0.010711f, 0.011057f, 0.011367f, 0.011621f, 0.011817f, - 0.011973f, 0.012106f, 0.012223f, 0.012309f, 0.012340f}; - - -const float defaultHRIR_left_avg_power_32kHz[LR_IAC_LENGTH_NR_FC] = - {1.030501f, 1.026884f, 1.017950f, 1.008331f, 1.002600f, 1.002689f, 1.006923f, 1.011298f, 1.012169f, - 1.008564f, 1.002836f, 0.999190f, 1.001098f, 1.009190f, 1.020853f, 1.031695f, 1.037922f, 1.038190f, - 1.033894f, 1.027913f, 1.022760f, 1.019333f, 1.016935f, 1.014341f, 1.010980f, 1.007343f, 1.004372f, - 1.002476f, 1.000944f, 0.998381f, 0.993744f, 0.987300f, 0.980631f, 0.975661f, 0.973406f, 0.973314f, - 0.973708f, 0.972973f, 0.970597f, 0.967379f, 0.964640f, 0.963173f, 0.962707f, 0.962251f, 0.960983f, - 0.959006f, 0.957269f, 0.956892f, 0.958263f, 0.960779f, 0.963180f, 0.964405f, 0.964185f, 0.963091f, - 0.962007f, 0.961501f, 0.961514f, 0.961497f, 0.960845f, 0.959307f, 0.957094f, 0.954689f, 0.952548f, - 0.950838f, 0.949382f, 0.947807f, 0.945783f, 0.943211f, 0.940296f, 0.937430f, 0.934938f, 0.932866f, - 0.930925f, 0.928674f, 0.925802f, 0.922364f, 0.918772f, 0.915508f, 0.912798f, 0.910417f, 0.907879f, - 0.904771f, 0.901065f, 0.897182f, 0.893708f, 0.890989f, 0.888922f, 0.887041f, 0.884873f, 0.882294f, - 0.879602f, 0.877334f, 0.875865f, 0.875169f, 0.874822f, 0.874316f, 0.873406f, 0.872264f, 0.871377f, - 0.871228f, 0.871946f, 0.873284f, 0.874764f, 0.876044f, 0.877146f, 0.878469f, 0.880494f, 0.883471f, - 0.887228f, 0.891261f, 0.895055f, 0.898401f, 0.901497f, 0.904769f, 0.908500f, 0.912597f, 0.916577f, - 0.919848f, 0.922085f, 0.923416f, 0.924327f, 0.925296f, 0.926465f, 0.927512f, 0.927876f, 0.927108f, - 0.925203f, 0.922559f, 0.919733f, 0.917037f, 0.914341f, 0.911186f, 0.907145f, 0.902128f, 0.896510f, - 0.890876f, 0.885647f, 0.880803f, 0.875934f, 0.870521f, 0.864338f, 0.857593f, 0.850818f, 0.844491f, - 0.838728f, 0.833217f, 0.827473f, 0.821173f, 0.814417f, 0.807660f, 0.801457f, 0.796095f, 0.791458f, - 0.787181f, 0.782928f, 0.778681f, 0.774802f, 0.771808f, 0.770061f, 0.769530f, 0.769827f, 0.770454f, - 0.771132f, 0.771943f, 0.773228f, 0.775315f, 0.778206f, 0.781513f, 0.784677f, 0.787274f, 0.789288f, - 0.791065f, 0.793055f, 0.795463f, 0.798095f, 0.800470f, 0.802135f, 0.802987f, 0.803318f, 0.803610f, - 0.804182f, 0.804958f, 0.805536f, 0.805434f, 0.804413f, 0.802618f, 0.800482f, 0.798381f, 0.796424f, - 0.794397f, 0.791922f, 0.788779f, 0.785087f, 0.781262f, 0.777778f, 0.774863f, 0.772372f, 0.769886f, - 0.767005f, 0.763613f, 0.759968f, 0.756518f, 0.753595f, 0.751171f, 0.748880f, 0.746246f, 0.743010f, - 0.739317f, 0.735608f, 0.732307f, 0.729533f, 0.727006f, 0.724256f, 0.720938f, 0.717104f, 0.713138f, - 0.709525f, 0.706513f, 0.703976f, 0.701515f, 0.698771f, 0.695693f, 0.692572f, 0.689860f, 0.687867f, - 0.686574f, 0.685644f, 0.684672f, 0.683452f, 0.682093f, 0.680935f, 0.680291f, 0.680231f, 0.680501f, - 0.680700f, 0.680500f, 0.679869f, 0.679047f, 0.678394f, 0.678091f, 0.678035f, 0.677888f, 0.677314f, - 0.676218f, 0.674814f, 0.673484f, 0.672514f, 0.671917f, 0.671422f, 0.670711f, 0.669654f, 0.668436f, - 0.667417f, 0.666896f, 0.666879f, 0.667100f, 0.667225f}; - -const float defaultHRIR_right_avg_power_32kHz[LR_IAC_LENGTH_NR_FC] = - {1.030502f, 1.026883f, 1.017953f, 1.008327f, 1.002600f, 1.002691f, 1.006922f, 1.011300f, 1.012168f, - 1.008564f, 1.002837f, 0.999188f, 1.001094f, 1.009186f, 1.020854f, 1.031695f, 1.037923f, 1.038191f, - 1.033893f, 1.027913f, 1.022760f, 1.019332f, 1.016931f, 1.014338f, 1.010982f, 1.007343f, 1.004370f, - 1.002473f, 1.000948f, 0.998380f, 0.993744f, 0.987300f, 0.980628f, 0.975661f, 0.973406f, 0.973316f, - 0.973710f, 0.972971f, 0.970599f, 0.967380f, 0.964639f, 0.963173f, 0.962708f, 0.962246f, 0.960984f, - 0.959004f, 0.957270f, 0.956889f, 0.958265f, 0.960778f, 0.963180f, 0.964406f, 0.964189f, 0.963091f, - 0.962005f, 0.961500f, 0.961514f, 0.961496f, 0.960845f, 0.959306f, 0.957092f, 0.954688f, 0.952548f, - 0.950838f, 0.949380f, 0.947808f, 0.945783f, 0.943212f, 0.940298f, 0.937430f, 0.934937f, 0.932865f, - 0.930925f, 0.928674f, 0.925801f, 0.922365f, 0.918770f, 0.915509f, 0.912795f, 0.910417f, 0.907881f, - 0.904769f, 0.901065f, 0.897183f, 0.893709f, 0.890990f, 0.888922f, 0.887040f, 0.884874f, 0.882293f, - 0.879603f, 0.877335f, 0.875867f, 0.875169f, 0.874820f, 0.874318f, 0.873404f, 0.872263f, 0.871381f, - 0.871226f, 0.871950f, 0.873283f, 0.874763f, 0.876042f, 0.877147f, 0.878470f, 0.880494f, 0.883473f, - 0.887227f, 0.891261f, 0.895053f, 0.898401f, 0.901500f, 0.904769f, 0.908500f, 0.912599f, 0.916578f, - 0.919847f, 0.922084f, 0.923417f, 0.924328f, 0.925296f, 0.926463f, 0.927512f, 0.927872f, 0.927107f, - 0.925199f, 0.922559f, 0.919735f, 0.917037f, 0.914339f, 0.911186f, 0.907142f, 0.902131f, 0.896510f, - 0.890876f, 0.885644f, 0.880802f, 0.875934f, 0.870524f, 0.864337f, 0.857594f, 0.850819f, 0.844491f, - 0.838727f, 0.833219f, 0.827473f, 0.821173f, 0.814415f, 0.807662f, 0.801459f, 0.796094f, 0.791462f, - 0.787182f, 0.782926f, 0.778681f, 0.774803f, 0.771810f, 0.770061f, 0.769529f, 0.769825f, 0.770456f, - 0.771131f, 0.771940f, 0.773230f, 0.775319f, 0.778206f, 0.781513f, 0.784675f, 0.787274f, 0.789285f, - 0.791065f, 0.793054f, 0.795465f, 0.798097f, 0.800468f, 0.802133f, 0.802987f, 0.803319f, 0.803610f, - 0.804179f, 0.804959f, 0.805538f, 0.805434f, 0.804411f, 0.802621f, 0.800480f, 0.798379f, 0.796426f, - 0.794398f, 0.791920f, 0.788777f, 0.785087f, 0.781263f, 0.777777f, 0.774862f, 0.772372f, 0.769886f, - 0.767004f, 0.763614f, 0.759968f, 0.756517f, 0.753593f, 0.751172f, 0.748881f, 0.746246f, 0.743011f, - 0.739318f, 0.735608f, 0.732306f, 0.729532f, 0.727006f, 0.724254f, 0.720939f, 0.717103f, 0.713136f, - 0.709524f, 0.706514f, 0.703976f, 0.701513f, 0.698772f, 0.695692f, 0.692570f, 0.689859f, 0.687869f, - 0.686573f, 0.685642f, 0.684671f, 0.683452f, 0.682094f, 0.680934f, 0.680290f, 0.680228f, 0.680501f, - 0.680699f, 0.680498f, 0.679867f, 0.679050f, 0.678395f, 0.678093f, 0.678035f, 0.677889f, 0.677315f, - 0.676220f, 0.674814f, 0.673485f, 0.672517f, 0.671918f, 0.671424f, 0.670712f, 0.669657f, 0.668437f, - 0.667421f, 0.666896f, 0.666880f, 0.667103f, 0.667228f}; - -/* Sample Rate = 16000 */ -// Floating point -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, - 0.037785f, 0.035991f, 0.034784f, 0.035091f, 0.034683f, 0.030849f, 0.023146f, 0.014061f, 0.007275f, - 0.005053f, 0.006930f, 0.010589f, 0.013905f, 0.016288f, 0.018404f, 0.020849f, 0.023164f, 0.024149f, - 0.023098f, 0.020635f, 0.018325f, 0.017381f, 0.017611f, 0.017534f, 0.015650f, 0.011786f, 0.007342f, - 0.004290f, 0.003732f, 0.005148f, 0.006838f, 0.007172f, 0.005579f, 0.002632f, 0.000000f, 0.000000f, - 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, - 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000238f, 0.001738f, 0.003011f, 0.003910f, - 0.004120f, 0.003394f, 0.001769f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, - 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, - 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, - 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, - 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, - 0.000000f, 0.002101f, 0.004247f, 0.006330f, 0.008300f, 0.010110f, 0.011735f, 0.013165f, 0.014384f, - 0.015345f, 0.015972f, 0.016191f}; - -const float defaultHRIR_left_avg_power_16kHz[LR_IAC_LENGTH_NR_FC_16KHZ] = - {1.118974f, 1.115256f, 1.106210f, 1.096901f, 1.092316f, 1.094422f, 1.101140f, 1.107775f, 1.110000f, - 1.106535f, 1.099921f, 1.094914f, 1.095643f, 1.103178f, 1.114955f, 1.126292f, 1.132973f, 1.133288f, - 1.128471f, 1.121439f, 1.114842f, 1.109721f, 1.105480f, 1.100966f, 1.095650f, 1.090074f, 1.085225f, - 1.081525f, 1.078267f, 1.074026f, 1.067777f, 1.059839f, 1.051856f, 1.045772f, 1.042531f, 1.041432f, - 1.040607f, 1.038291f, 1.033910f, 1.028286f, 1.022846f, 1.018514f, 1.015152f, 1.011898f, 1.008047f, - 1.003762f, 0.999992f, 0.997770f, 0.997349f, 0.997960f, 0.998259f, 0.997177f, 0.994506f, 0.990883f, - 0.987207f, 0.984003f, 0.981133f, 0.977984f, 0.973950f, 0.968837f, 0.962915f, 0.956690f, 0.950584f, - 0.944679f, 0.938744f, 0.932399f, 0.925372f, 0.917663f, 0.909568f, 0.901511f, 0.893804f, 0.886455f, - 0.879155f, 0.871463f, 0.863142f, 0.854285f, 0.845334f, 0.836740f, 0.828656f, 0.820817f, 0.812713f, - 0.803960f, 0.794564f, 0.784952f, 0.775633f, 0.766881f, 0.758539f, 0.750156f, 0.741330f, 0.732004f, - 0.722524f, 0.713387f, 0.704919f, 0.697057f, 0.689419f, 0.681576f, 0.673350f, 0.664931f, 0.656703f, - 0.648997f, 0.641801f, 0.634760f, 0.627357f, 0.619192f, 0.610186f, 0.600526f, 0.590442f, 0.579952f, - 0.568762f, 0.556384f, 0.542389f, 0.526648f, 0.509355f, 0.490884f, 0.471542f, 0.451447f, 0.430550f, - 0.408842f, 0.386537f, 0.364126f, 0.342284f, 0.321675f, 0.302809f, 0.286016f, 0.271536f, 0.259639f, - 0.250691f, 0.245099f, 0.243192f}; - -const float defaultHRIR_right_avg_power_16kHz[LR_IAC_LENGTH_NR_FC_16KHZ] = - {1.118974f, 1.115254f, 1.106207f, 1.096903f, 1.092317f, 1.094425f, 1.101145f, 1.107775f, 1.109999f, - 1.106540f, 1.099921f, 1.094912f, 1.095644f, 1.103178f, 1.114952f, 1.126292f, 1.132973f, 1.133288f, - 1.128472f, 1.121439f, 1.114842f, 1.109719f, 1.105481f, 1.100965f, 1.095650f, 1.090072f, 1.085224f, - 1.081527f, 1.078270f, 1.074025f, 1.067775f, 1.059840f, 1.051856f, 1.045772f, 1.042533f, 1.041433f, - 1.040611f, 1.038292f, 1.033911f, 1.028286f, 1.022844f, 1.018512f, 1.015153f, 1.011899f, 1.008050f, - 1.003762f, 0.999995f, 0.997769f, 0.997349f, 0.997959f, 0.998259f, 0.997178f, 0.994509f, 0.990883f, - 0.987204f, 0.984003f, 0.981133f, 0.977983f, 0.973949f, 0.968836f, 0.962914f, 0.956689f, 0.950583f, - 0.944681f, 0.938745f, 0.932399f, 0.925373f, 0.917662f, 0.909567f, 0.901511f, 0.893804f, 0.886456f, - 0.879153f, 0.871467f, 0.863138f, 0.854286f, 0.845334f, 0.836740f, 0.828656f, 0.820816f, 0.812712f, - 0.803961f, 0.794567f, 0.784951f, 0.775631f, 0.766882f, 0.758540f, 0.750158f, 0.741330f, 0.732005f, - 0.722523f, 0.713388f, 0.704920f, 0.697057f, 0.689418f, 0.681575f, 0.673352f, 0.664930f, 0.656706f, - 0.648998f, 0.641802f, 0.634762f, 0.627355f, 0.619192f, 0.610187f, 0.600527f, 0.590442f, 0.579953f, - 0.568763f, 0.556383f, 0.542389f, 0.526646f, 0.509355f, 0.490883f, 0.471543f, 0.451446f, 0.430550f, - 0.408843f, 0.386537f, 0.364127f, 0.342285f, 0.321676f, 0.302809f, 0.286016f, 0.271535f, 0.259640f, - 0.250692f, 0.245099f, 0.243192f}; - -// Fixed-point const Word32 defaultHRIR_coherence_16kHz_fx[LR_IAC_LENGTH_NR_FC_16KHZ] = { 131941936, 128955584, 119957896, 105171136, 85760160, 64067220, 42933432, 24612042, @@ -60245,7 +59901,6 @@ const Word32 defaultHRIR_right_avg_power_16kHz_fx[LR_IAC_LENGTH_NR_FC_16KHZ] = 2040042 }; -#endif #endif Word32 sine_table_Q31 [361] = { -- GitLab From ead644bcbb9d5f739ab15baffa70b85c5ac82dee Mon Sep 17 00:00:00 2001 From: marc emerit Date: Thu, 26 Jun 2025 18:02:15 +0200 Subject: [PATCH 05/12] for iac and energy values of reverb use float values in rom and do the fix point conversion at init. Initialisation in Q28 for energy and Q26 for coherence --- lib_rend/ivas_hrtf_fx.c | 72 ++++ lib_rend/ivas_reverb_fx.c | 11 + lib_rend/ivas_reverb_utils_fx.c | 14 +- lib_rend/ivas_rom_binaural_crend_head.h | 30 +- lib_rend/ivas_rom_binaural_crend_head_fx.c | 402 ++++++++++++++++++--- lib_util/hrtf_file_reader.c | 12 +- 6 files changed, 459 insertions(+), 82 deletions(-) diff --git a/lib_rend/ivas_hrtf_fx.c b/lib_rend/ivas_hrtf_fx.c index 13b5ae5cb..58dc54b26 100644 --- a/lib_rend/ivas_hrtf_fx.c +++ b/lib_rend/ivas_hrtf_fx.c @@ -288,6 +288,77 @@ ivas_error ivas_HRTF_statistics_init( switch ( sampleRate ) { +#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB + case 48000: + HrtfStatistics->average_energy_l_dyn = (Word32 *) malloc( LR_IAC_LENGTH_NR_FC * sizeof( Word32 ) ); + if ( HrtfStatistics->average_energy_l_dyn == NULL ) + { + return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for hrtf data" ); + } + HrtfStatistics->average_energy_r_dyn = (Word32 *) malloc( LR_IAC_LENGTH_NR_FC * sizeof( Word32 ) ); + if ( HrtfStatistics->average_energy_r_dyn == NULL ) + { + return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for hrtf data" ); + } + HrtfStatistics->inter_aural_coherence_dyn = (Word32 *) malloc( LR_IAC_LENGTH_NR_FC * sizeof( Word32 ) ); + if ( HrtfStatistics->inter_aural_coherence_dyn == NULL ) + { + return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for hrtf data" ); + } + floatToFixed_arr32( defaultHRIR_left_avg_power_48kHz_fx, HrtfStatistics->average_energy_l_dyn, Q28, LR_IAC_LENGTH_NR_FC ); /* tables from which lr_energy_and_iac is updated has Q27 for i=2 */ + floatToFixed_arr32( defaultHRIR_right_avg_power_48kHz_fx, HrtfStatistics->average_energy_r_dyn, Q28, LR_IAC_LENGTH_NR_FC ); /* tables from which lr_energy_and_iac is updated has Q27 for i=2 */ + floatToFixed_arr32( defaultHRIR_coherence_48kHz_fx, HrtfStatistics->inter_aural_coherence_dyn, Q26, LR_IAC_LENGTH_NR_FC ); /* tables from which lr_energy_and_iac is updated has Q27 for i=2 */ + HrtfStatistics->average_energy_l = (const Word32 *) HrtfStatistics->average_energy_l_dyn; + HrtfStatistics->average_energy_r = (const Word32 *) HrtfStatistics->average_energy_r_dyn; + HrtfStatistics->inter_aural_coherence = (const Word32 *) HrtfStatistics->inter_aural_coherence_dyn; + break; + case 32000: + HrtfStatistics->average_energy_l_dyn = (Word32 *) malloc( LR_IAC_LENGTH_NR_FC * sizeof( Word32 ) ); + if ( HrtfStatistics->average_energy_l_dyn == NULL ) + { + return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for hrtf data" ); + } + HrtfStatistics->average_energy_r_dyn = (Word32 *) malloc( LR_IAC_LENGTH_NR_FC * sizeof( Word32 ) ); + if ( HrtfStatistics->average_energy_r_dyn == NULL ) + { + return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for hrtf data" ); + } + HrtfStatistics->inter_aural_coherence_dyn = (Word32 *) malloc( LR_IAC_LENGTH_NR_FC * sizeof( Word32 ) ); + if ( HrtfStatistics->inter_aural_coherence_dyn == NULL ) + { + return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for hrtf data" ); + } + floatToFixed_arr32( defaultHRIR_left_avg_power_32kHz_fx, HrtfStatistics->average_energy_l_dyn, Q28, LR_IAC_LENGTH_NR_FC ); /* tables from which lr_energy_and_iac is updated has Q27 for i=2 */ + floatToFixed_arr32( defaultHRIR_right_avg_power_32kHz_fx, HrtfStatistics->average_energy_r_dyn, Q28, LR_IAC_LENGTH_NR_FC ); /* tables from which lr_energy_and_iac is updated has Q27 for i=2 */ + floatToFixed_arr32( defaultHRIR_coherence_32kHz_fx, HrtfStatistics->inter_aural_coherence_dyn, Q26, LR_IAC_LENGTH_NR_FC ); /* tables from which lr_energy_and_iac is updated has Q27 for i=2 */ + HrtfStatistics->average_energy_l = (const Word32 *) HrtfStatistics->average_energy_l_dyn; + HrtfStatistics->average_energy_r = (const Word32 *) HrtfStatistics->average_energy_r_dyn; + HrtfStatistics->inter_aural_coherence = (const Word32 *) HrtfStatistics->inter_aural_coherence_dyn; + break; + case 16000: + HrtfStatistics->average_energy_l_dyn = (Word32 *) malloc( LR_IAC_LENGTH_NR_FC_16KHZ * sizeof( Word32 ) ); + if ( HrtfStatistics->average_energy_l_dyn == NULL ) + { + return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for hrtf data" ); + } + HrtfStatistics->average_energy_r_dyn = (Word32 *) malloc( LR_IAC_LENGTH_NR_FC_16KHZ * sizeof( Word32 ) ); + if ( HrtfStatistics->average_energy_r_dyn == NULL ) + { + return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for hrtf data" ); + } + HrtfStatistics->inter_aural_coherence_dyn = (Word32 *) malloc( LR_IAC_LENGTH_NR_FC_16KHZ * sizeof( Word32 ) ); + if ( HrtfStatistics->inter_aural_coherence_dyn == NULL ) + { + return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for hrtf data" ); + } + floatToFixed_arr32( defaultHRIR_left_avg_power_16kHz_fx, HrtfStatistics->average_energy_l_dyn, Q28, LR_IAC_LENGTH_NR_FC_16KHZ ); /* tables from which lr_energy_and_iac is updated has Q27 for i=2 */ + floatToFixed_arr32( defaultHRIR_right_avg_power_16kHz_fx, HrtfStatistics->average_energy_r_dyn, Q28, LR_IAC_LENGTH_NR_FC_16KHZ ); /* tables from which lr_energy_and_iac is updated has Q27 for i=2 */ + floatToFixed_arr32( defaultHRIR_coherence_16kHz_fx, HrtfStatistics->inter_aural_coherence_dyn, Q26, LR_IAC_LENGTH_NR_FC_16KHZ ); /* tables from which lr_energy_and_iac is updated has Q27 for i=2 */ + HrtfStatistics->average_energy_l = (const Word32 *) HrtfStatistics->average_energy_l_dyn; + HrtfStatistics->average_energy_r = (const Word32 *) HrtfStatistics->average_energy_r_dyn; + HrtfStatistics->inter_aural_coherence = (const Word32 *) HrtfStatistics->inter_aural_coherence_dyn; + break; +#else case 48000: HrtfStatistics->average_energy_l = defaultHRIR_left_avg_power_48kHz_fx; HrtfStatistics->average_energy_r = defaultHRIR_right_avg_power_48kHz_fx; @@ -303,6 +374,7 @@ ivas_error ivas_HRTF_statistics_init( HrtfStatistics->average_energy_r = defaultHRIR_right_avg_power_16kHz_fx; HrtfStatistics->inter_aural_coherence = defaultHRIR_coherence_16kHz_fx; break; +#endif } HrtfStatistics->fromROM = TRUE; diff --git a/lib_rend/ivas_reverb_fx.c b/lib_rend/ivas_reverb_fx.c index 00513d30e..4e054b699 100644 --- a/lib_rend/ivas_reverb_fx.c +++ b/lib_rend/ivas_reverb_fx.c @@ -1644,10 +1644,17 @@ ivas_error ivas_reverb_open_fx( { params.pDsr_fx[i] = L_shl( params.pDsr_fx[i], params.pDsr_e[i] ); move32(); +#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB + pHrtf_avg_pwr_response_l_const[i] = params.pHrtf_avg_pwr_response_l_const_fx[i]; /*Q28*/ + move32(); + pHrtf_avg_pwr_response_r_const[i] = params.pHrtf_avg_pwr_response_r_const_fx[i]; /*Q23+5*/ + move32(); +#else pHrtf_avg_pwr_response_l_const[i] = L_shl( params.pHrtf_avg_pwr_response_l_const_fx[i], 5 ); /*Q23+5*/ move32(); pHrtf_avg_pwr_response_r_const[i] = L_shl( params.pHrtf_avg_pwr_response_r_const_fx[i], 5 ); /*Q23+5*/ move32(); +#endif } FOR( i = 0; i < lenT60_filter_coeff; i++ ) { @@ -1695,7 +1702,11 @@ ivas_error ivas_reverb_open_fx( Word32 *pHrtf_inter_aural_coherence_const = (Word32 *) malloc( nr_fc_fft_filter * sizeof( Word32 ) ); FOR( i = 0; i < nr_fc_fft_filter; i++ ) { +#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB pHrtf_inter_aural_coherence_const[i] = L_shl( params.pHrtf_inter_aural_coherence_const_fx[i], 3 ); /*Scaling up to Q30*/ +#else + pHrtf_inter_aural_coherence_const[i] = params.pHrtf_inter_aural_coherence_const_fx[i]; /*Scaling up to Q30*/ +#endif move32(); } ivas_reverb_calc_correl_filters_fx( pHrtf_inter_aural_coherence_const, pTime_window_fx, pState->fft_size, pFft_wf_filter_ch0_fx, pFft_wf_filter_ch1_fx, &q_pFft_wf_filter_ch0_fx, &q_pFft_wf_filter_ch1_fx ); diff --git a/lib_rend/ivas_reverb_utils_fx.c b/lib_rend/ivas_reverb_utils_fx.c index f673fdc7d..4a3c0477c 100644 --- a/lib_rend/ivas_reverb_utils_fx.c +++ b/lib_rend/ivas_reverb_utils_fx.c @@ -311,7 +311,11 @@ static ivas_error ivas_reverb_get_fastconv_hrtf_set_energies( #endif #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES +#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB const int16_t avg_pwr_len = sampling_rate == 16000 ? LR_IAC_LENGTH_NR_FC_16KHZ : LR_IAC_LENGTH_NR_FC; +#else + const int16_t avg_pwr_len = LR_IAC_LENGTH_NR_FC; +#endif for ( freq_idx = 0; freq_idx < avg_pwr_len; freq_idx++ ) { @@ -328,11 +332,11 @@ static ivas_error ivas_reverb_get_fastconv_hrtf_set_energies( Word32 *input_fc_fx = (Word32 *) malloc( 60 * sizeof( Word32 ) ); - Word32 *output_fc_fx = (Word32 *) malloc( 257 * sizeof( Word32 ) ); - Word16 *avg_pwr_left_e = (Word16 *) malloc( 257 * sizeof( Word16 ) ); - Word16 *avg_pwr_right_e = (Word16 *) malloc( 257 * sizeof( Word16 ) ); - Word32 *avg_pwr_left_fx = (Word32 *) malloc( 257 * sizeof( Word32 ) ); - Word32 *avg_pwr_right_fx = (Word32 *) malloc( 257 * sizeof( Word32 ) ); + Word32 *output_fc_fx = (Word32 *) malloc( avg_pwr_len * sizeof( Word32 ) ); + Word16 *avg_pwr_left_e = (Word16 *) malloc( avg_pwr_len * sizeof( Word16 ) ); + Word16 *avg_pwr_right_e = (Word16 *) malloc( avg_pwr_len * sizeof( Word16 ) ); + Word32 *avg_pwr_left_fx = (Word32 *) malloc( avg_pwr_len * sizeof( Word32 ) ); + Word32 *avg_pwr_right_fx = (Word32 *) malloc( avg_pwr_len * sizeof( Word32 ) ); for ( int i = 0; i < 60; i++ ) { diff --git a/lib_rend/ivas_rom_binaural_crend_head.h b/lib_rend/ivas_rom_binaural_crend_head.h index 017703460..4f40c2ed7 100644 --- a/lib_rend/ivas_rom_binaural_crend_head.h +++ b/lib_rend/ivas_rom_binaural_crend_head.h @@ -349,6 +349,19 @@ extern Word32 CRendBin_Combined_BRIR_coeff_diffuse_re_16kHz_fx[BINAURAL_CHANNELS extern Word32 CRendBin_Combined_BRIR_coeff_diffuse_im_16kHz_fx[BINAURAL_CHANNELS][2522]; #ifdef FIX_638_ENERGIE_IAC_ROM_TABLES +#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB +extern float defaultHRIR_coherence_48kHz_fx[LR_IAC_LENGTH_NR_FC]; /*Q-27*/ +extern float defaultHRIR_left_avg_power_48kHz_fx[LR_IAC_LENGTH_NR_FC]; /*Q-23*/ +extern float defaultHRIR_right_avg_power_48kHz_fx[LR_IAC_LENGTH_NR_FC]; /*Q-23*/ + +extern float defaultHRIR_coherence_32kHz_fx[LR_IAC_LENGTH_NR_FC]; /*Q-27*/ +extern float defaultHRIR_left_avg_power_32kHz_fx[LR_IAC_LENGTH_NR_FC]; /*Q-23*/ +extern float defaultHRIR_right_avg_power_32kHz_fx[LR_IAC_LENGTH_NR_FC]; /*Q-23*/ + +extern float defaultHRIR_coherence_16kHz_fx[LR_IAC_LENGTH_NR_FC_16KHZ]; /*Q-27*/ +extern float defaultHRIR_left_avg_power_16kHz_fx[LR_IAC_LENGTH_NR_FC_16KHZ]; /*Q-23*/ +extern float defaultHRIR_right_avg_power_16kHz_fx[LR_IAC_LENGTH_NR_FC_16KHZ]; /*Q-23*/ +#else extern const Word32 defaultHRIR_coherence_48kHz_fx[LR_IAC_LENGTH_NR_FC]; /*Q-27*/ extern const Word32 defaultHRIR_left_avg_power_48kHz_fx[LR_IAC_LENGTH_NR_FC]; /*Q-23*/ extern const Word32 defaultHRIR_right_avg_power_48kHz_fx[LR_IAC_LENGTH_NR_FC]; /*Q-23*/ @@ -357,23 +370,6 @@ extern const Word32 defaultHRIR_coherence_32kHz_fx[LR_IAC_LENGTH_NR_FC]; / extern const Word32 defaultHRIR_left_avg_power_32kHz_fx[LR_IAC_LENGTH_NR_FC]; /*Q-23*/ extern const Word32 defaultHRIR_right_avg_power_32kHz_fx[LR_IAC_LENGTH_NR_FC]; /*Q-23*/ -extern const Word32 defaultHRIR_coherence_16kHz_fx[LR_IAC_LENGTH_NR_FC_16KHZ]; /*Q-27*/ -extern const Word32 defaultHRIR_left_avg_power_16kHz_fx[LR_IAC_LENGTH_NR_FC_16KHZ]; /*Q-23*/ -extern const Word32 defaultHRIR_right_avg_power_16kHz_fx[LR_IAC_LENGTH_NR_FC_16KHZ]; /*Q-23*/ - -#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB -extern const float defaultHRIR_coherence_16kHz[LR_IAC_LENGTH_NR_FC_16KHZ]; /*Q-27*/ -extern const float defaultHRIR_left_avg_power_16kHz[LR_IAC_LENGTH_NR_FC_16KHZ]; /*Q-23*/ -extern const float defaultHRIR_right_avg_power_16kHz[LR_IAC_LENGTH_NR_FC_16KHZ]; /*Q-23*/ - -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_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]; -#else extern const Word32 defaultHRIR_coherence_16kHz_fx[LR_IAC_LENGTH_NR_FC]; /*Q-27*/ extern const Word32 defaultHRIR_left_avg_power_16kHz_fx[LR_IAC_LENGTH_NR_FC]; /*Q-23*/ extern const Word32 defaultHRIR_right_avg_power_16kHz_fx[LR_IAC_LENGTH_NR_FC]; /*Q-23*/ diff --git a/lib_rend/ivas_rom_binaural_crend_head_fx.c b/lib_rend/ivas_rom_binaural_crend_head_fx.c index df78d5b25..436ba60f6 100644 --- a/lib_rend/ivas_rom_binaural_crend_head_fx.c +++ b/lib_rend/ivas_rom_binaural_crend_head_fx.c @@ -59651,6 +59651,257 @@ const Word32 CRendBin_Combined_BRIR_coeff_diffuse_im_16kHz_fx[BINAURAL_CHANNELS] }; #ifdef FIX_638_ENERGIE_IAC_ROM_TABLES + +#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB +/********************** defaultHRIR reverb rom tables at sampling rate 48kHz **********************/ + +const float defaultHRIR_coherence_48kHz_fx[LR_IAC_LENGTH_NR_FC] = + {0.997092f, 0.947391f, 0.799213f, 0.575216f, 0.335047f, 0.138324f, 0.007933f, 0.000000f, 0.000000f, + 0.000000f, 0.008438f, 0.037607f, 0.044493f, 0.042149f, 0.041877f, 0.039860f, 0.029404f, 0.015898f, + 0.010316f, 0.014065f, 0.020005f, 0.024518f, 0.029292f, 0.033522f, 0.033418f, 0.029630f, 0.027260f, + 0.027515f, 0.025682f, 0.019571f, 0.013977f, 0.013695f, 0.016531f, 0.016882f, 0.013257f, 0.008483f, + 0.004883f, 0.002525f, 0.001004f, 0.000180f, 0.000000f, 0.000000f, 0.000000f, 0.000785f, 0.003979f, + 0.007082f, 0.009598f, 0.011665f, 0.012700f, 0.011794f, 0.009192f, 0.006164f, 0.003527f, 0.001284f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000894f, 0.002136f, 0.003127f, 0.003616f, + 0.003810f, 0.003754f, 0.003186f, 0.002091f, 0.000823f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.001007f, 0.001843f, 0.002400f, + 0.002505f, 0.002133f, 0.001524f, 0.000903f, 0.000317f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000202f, 0.000867f, 0.001309f, + 0.001553f, 0.001563f, 0.001334f, 0.000961f, 0.000530f, 0.000033f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000278f, 0.000621f, 0.000951f, 0.001272f, 0.001608f, 0.001931f, + 0.002199f, 0.002435f, 0.002687f, 0.002947f, 0.003173f, 0.003370f, 0.003577f, 0.003781f, 0.003920f, + 0.003978f, 0.003985f, 0.003937f, 0.003783f, 0.003511f, 0.003170f, 0.002788f, 0.002337f, 0.001808f, + 0.001255f, 0.000716f, 0.000166f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.003551f, 0.000000f, 0.000000f, + 0.000000f, 0.005564f, 0.000000f, 0.000000f, 0.000000f, 0.008736f, 0.000000f, 0.000000f, 0.001007f, + 0.011608f, 0.002316f, 0.000000f, 0.000000f, 0.011987f, 0.005591f, 0.000000f, 0.000000f, 0.008714f, + 0.005905f, 0.000000f, 0.000000f, 0.005316f, 0.003972f, 0.000000f, 0.000000f, 0.003403f, 0.002041f, + 0.000000f, 0.000000f, 0.002140f, 0.000245f, 0.000000f}; + +const float defaultHRIR_left_avg_power_48kHz_fx[LR_IAC_LENGTH_NR_FC] = + {0.981018f, 0.973361f, 0.958480f, 0.950611f, 0.953039f, 0.955845f, 0.950660f, 0.942556f, 0.943810f, + 0.958014f, 0.974983f, 0.982099f, 0.977269f, 0.968243f, 0.961714f, 0.957355f, 0.952468f, 0.947771f, + 0.945396f, 0.943711f, 0.938609f, 0.929975f, 0.922937f, 0.921202f, 0.922151f, 0.920926f, 0.917154f, + 0.914393f, 0.914067f, 0.913705f, 0.911632f, 0.910100f, 0.911873f, 0.915812f, 0.918271f, 0.917846f, + 0.916545f, 0.916408f, 0.916915f, 0.916273f, 0.914005f, 0.911339f, 0.909453f, 0.908137f, 0.906301f, + 0.903476f, 0.900479f, 0.898396f, 0.897057f, 0.895115f, 0.891879f, 0.888353f, 0.885879f, 0.884157f, + 0.881651f, 0.877929f, 0.874417f, 0.872453f, 0.871459f, 0.869941f, 0.867796f, 0.866504f, 0.866990f, + 0.868298f, 0.868985f, 0.869170f, 0.870398f, 0.873460f, 0.877373f, 0.880867f, 0.884271f, 0.889105f, + 0.895880f, 0.903280f, 0.909888f, 0.915965f, 0.922776f, 0.930375f, 0.937111f, 0.941667f, 0.944690f, + 0.947747f, 0.950950f, 0.952712f, 0.951893f, 0.949398f, 0.946830f, 0.944212f, 0.940067f, 0.933749f, + 0.926604f, 0.920193f, 0.914164f, 0.906886f, 0.897913f, 0.888731f, 0.880661f, 0.873093f, 0.864556f, + 0.855014f, 0.846098f, 0.839027f, 0.833268f, 0.827720f, 0.822648f, 0.819628f, 0.819557f, 0.821500f, + 0.823986f, 0.826902f, 0.831352f, 0.837670f, 0.844414f, 0.850004f, 0.854617f, 0.859684f, 0.865573f, + 0.870873f, 0.874346f, 0.876636f, 0.879215f, 0.882152f, 0.883944f, 0.883578f, 0.881897f, 0.880319f, + 0.878855f, 0.876201f, 0.871708f, 0.866458f, 0.861964f, 0.858239f, 0.853971f, 0.848551f, 0.843114f, + 0.839005f, 0.835832f, 0.831994f, 0.826972f, 0.822069f, 0.818424f, 0.815337f, 0.811300f, 0.806249f, + 0.801664f, 0.798529f, 0.796124f, 0.793286f, 0.790217f, 0.788277f, 0.788174f, 0.789082f, 0.789775f, + 0.790281f, 0.791803f, 0.794902f, 0.798467f, 0.801024f, 0.802713f, 0.804961f, 0.808244f, 0.811142f, + 0.812318f, 0.812488f, 0.813349f, 0.815025f, 0.815968f, 0.815334f, 0.814250f, 0.814149f, 0.814776f, + 0.814769f, 0.813685f, 0.812567f, 0.812562f, 0.813456f, 0.814055f, 0.813739f, 0.813391f, 0.814325f, + 0.816394f, 0.817949f, 0.818173f, 0.818552f, 0.820798f, 0.824070f, 0.826010f, 0.826515f, 0.828132f, + 0.832036f, 0.835874f, 0.837493f, 0.838582f, 0.842046f, 0.847074f, 0.850262f, 0.851182f, 0.852997f, + 0.856510f, 0.857491f, 0.852207f, 0.842444f, 0.831373f, 0.816756f, 0.793031f, 0.759822f, 0.723220f, + 0.686833f, 0.646128f, 0.595684f, 0.539241f, 0.486856f, 0.441279f, 0.391675f, 0.324292f, 0.238341f, + 0.149255f, 0.076756f, 0.031022f, 0.009191f, 0.001733f, 0.000140f, 0.000010f, 0.000019f, 0.000015f, + 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_fx[LR_IAC_LENGTH_NR_FC] = + {0.981020f, 0.973360f, 0.958481f, 0.950613f, 0.953040f, 0.955848f, 0.950658f, 0.942557f, 0.943810f, + 0.958017f, 0.974981f, 0.982098f, 0.977271f, 0.968244f, 0.961715f, 0.957356f, 0.952467f, 0.947770f, + 0.945398f, 0.943710f, 0.938610f, 0.929975f, 0.922938f, 0.921205f, 0.922151f, 0.920926f, 0.917152f, + 0.914393f, 0.914069f, 0.913705f, 0.911630f, 0.910101f, 0.911874f, 0.915811f, 0.918272f, 0.917846f, + 0.916542f, 0.916408f, 0.916918f, 0.916272f, 0.914004f, 0.911340f, 0.909452f, 0.908136f, 0.906302f, + 0.903479f, 0.900480f, 0.898395f, 0.897055f, 0.895119f, 0.891880f, 0.888352f, 0.885878f, 0.884154f, + 0.881649f, 0.877926f, 0.874417f, 0.872450f, 0.871458f, 0.869943f, 0.867797f, 0.866503f, 0.866987f, + 0.868297f, 0.868981f, 0.869171f, 0.870394f, 0.873460f, 0.877377f, 0.880866f, 0.884272f, 0.889105f, + 0.895880f, 0.903282f, 0.909886f, 0.915965f, 0.922778f, 0.930375f, 0.937113f, 0.941665f, 0.944689f, + 0.947744f, 0.950952f, 0.952711f, 0.951895f, 0.949398f, 0.946830f, 0.944209f, 0.940067f, 0.933750f, + 0.926601f, 0.920191f, 0.914167f, 0.906884f, 0.897916f, 0.888731f, 0.880663f, 0.873093f, 0.864559f, + 0.855017f, 0.846098f, 0.839028f, 0.833267f, 0.827717f, 0.822649f, 0.819631f, 0.819558f, 0.821499f, + 0.823985f, 0.826902f, 0.831353f, 0.837669f, 0.844416f, 0.850003f, 0.854616f, 0.859686f, 0.865572f, + 0.870872f, 0.874347f, 0.876635f, 0.879216f, 0.882154f, 0.883942f, 0.883576f, 0.881895f, 0.880318f, + 0.878857f, 0.876202f, 0.871706f, 0.866459f, 0.861965f, 0.858241f, 0.853968f, 0.848548f, 0.843114f, + 0.839005f, 0.835832f, 0.831994f, 0.826974f, 0.822068f, 0.818424f, 0.815335f, 0.811299f, 0.806245f, + 0.801662f, 0.798530f, 0.796124f, 0.793287f, 0.790217f, 0.788273f, 0.788173f, 0.789081f, 0.789770f, + 0.790279f, 0.791801f, 0.794900f, 0.798466f, 0.801028f, 0.802711f, 0.804962f, 0.808246f, 0.811143f, + 0.812318f, 0.812490f, 0.813348f, 0.815027f, 0.815969f, 0.815335f, 0.814254f, 0.814150f, 0.814776f, + 0.814772f, 0.813686f, 0.812569f, 0.812558f, 0.813456f, 0.814055f, 0.813736f, 0.813389f, 0.814324f, + 0.816395f, 0.817948f, 0.818173f, 0.818549f, 0.820796f, 0.824069f, 0.826013f, 0.826514f, 0.828134f, + 0.832033f, 0.835874f, 0.837493f, 0.838582f, 0.842047f, 0.847077f, 0.850263f, 0.851184f, 0.852998f, + 0.856513f, 0.857491f, 0.852209f, 0.842446f, 0.831375f, 0.816757f, 0.793032f, 0.759821f, 0.723221f, + 0.686832f, 0.646128f, 0.595684f, 0.539241f, 0.486856f, 0.441280f, 0.391676f, 0.324293f, 0.238342f, + 0.149255f, 0.076756f, 0.031022f, 0.009191f, 0.001733f, 0.000140f, 0.000010f, 0.000019f, 0.000015f, + 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}; + + +/********************** defaultHRIR reverb rom tables at sampling rate 32kHz **********************/ + +const float defaultHRIR_coherence_32kHz_fx[LR_IAC_LENGTH_NR_FC] = + {0.992805f, 0.970760f, 0.904274f, 0.794804f, 0.650716f, 0.489140f, 0.331131f, 0.193608f, 0.084875f, + 0.006016f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.006084f, 0.028478f, 0.040113f, + 0.042718f, 0.041091f, 0.039575f, 0.039321f, 0.038312f, 0.033935f, 0.025743f, 0.016207f, 0.009052f, + 0.006651f, 0.008629f, 0.012678f, 0.016595f, 0.019686f, 0.022543f, 0.025721f, 0.028716f, 0.030244f, + 0.029496f, 0.027051f, 0.024537f, 0.023327f, 0.023382f, 0.023280f, 0.021454f, 0.017604f, 0.013058f, + 0.009830f, 0.009160f, 0.010653f, 0.012635f, 0.013369f, 0.012139f, 0.009418f, 0.006248f, 0.003470f, + 0.001368f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.001485f, 0.003632f, 0.005492f, 0.007105f, 0.008527f, 0.009629f, + 0.010103f, 0.009685f, 0.008382f, 0.006502f, 0.004466f, 0.002568f, 0.000890f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000067f, 0.000797f, 0.001293f, 0.001577f, 0.001732f, 0.001797f, 0.001717f, 0.001403f, 0.000826f, + 0.000060f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000318f, 0.000795f, 0.001124f, 0.001249f, 0.001151f, 0.000871f, 0.000495f, 0.000102f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000206f, 0.000612f, 0.000908f, 0.001107f, + 0.001211f, 0.001209f, 0.001095f, 0.000883f, 0.000607f, 0.000298f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000029f, 0.000144f, 0.000254f, 0.000368f, 0.000486f, 0.000599f, + 0.000706f, 0.000810f, 0.000925f, 0.001059f, 0.001209f, 0.001367f, 0.001526f, 0.001686f, 0.001850f, + 0.002018f, 0.002181f, 0.002324f, 0.002440f, 0.002532f, 0.002614f, 0.002696f, 0.002779f, 0.002860f, + 0.002941f, 0.003036f, 0.003166f, 0.003347f, 0.003580f, 0.003855f, 0.004158f, 0.004487f, 0.004850f, + 0.005251f, 0.005688f, 0.006141f, 0.006591f, 0.007029f, 0.007462f, 0.007902f, 0.008351f, 0.008798f, + 0.009224f, 0.009620f, 0.009991f, 0.010352f, 0.010711f, 0.011057f, 0.011367f, 0.011621f, 0.011817f, + 0.011973f, 0.012106f, 0.012223f, 0.012309f, 0.012340f}; + +const float defaultHRIR_left_avg_power_32kHz_fx[LR_IAC_LENGTH_NR_FC] = + {1.030501f, 1.026884f, 1.017950f, 1.008331f, 1.002600f, 1.002689f, 1.006923f, 1.011298f, 1.012169f, + 1.008564f, 1.002836f, 0.999190f, 1.001098f, 1.009190f, 1.020853f, 1.031695f, 1.037922f, 1.038190f, + 1.033894f, 1.027913f, 1.022760f, 1.019333f, 1.016935f, 1.014341f, 1.010980f, 1.007343f, 1.004372f, + 1.002476f, 1.000944f, 0.998381f, 0.993744f, 0.987300f, 0.980631f, 0.975661f, 0.973406f, 0.973314f, + 0.973708f, 0.972973f, 0.970597f, 0.967379f, 0.964640f, 0.963173f, 0.962707f, 0.962251f, 0.960983f, + 0.959006f, 0.957269f, 0.956892f, 0.958263f, 0.960779f, 0.963180f, 0.964405f, 0.964185f, 0.963091f, + 0.962007f, 0.961501f, 0.961514f, 0.961497f, 0.960845f, 0.959307f, 0.957094f, 0.954689f, 0.952548f, + 0.950838f, 0.949382f, 0.947807f, 0.945783f, 0.943211f, 0.940296f, 0.937430f, 0.934938f, 0.932866f, + 0.930925f, 0.928674f, 0.925802f, 0.922364f, 0.918772f, 0.915508f, 0.912798f, 0.910417f, 0.907879f, + 0.904771f, 0.901065f, 0.897182f, 0.893708f, 0.890989f, 0.888922f, 0.887041f, 0.884873f, 0.882294f, + 0.879602f, 0.877334f, 0.875865f, 0.875169f, 0.874822f, 0.874316f, 0.873406f, 0.872264f, 0.871377f, + 0.871228f, 0.871946f, 0.873284f, 0.874764f, 0.876044f, 0.877146f, 0.878469f, 0.880494f, 0.883471f, + 0.887228f, 0.891261f, 0.895055f, 0.898401f, 0.901497f, 0.904769f, 0.908500f, 0.912597f, 0.916577f, + 0.919848f, 0.922085f, 0.923416f, 0.924327f, 0.925296f, 0.926465f, 0.927512f, 0.927876f, 0.927108f, + 0.925203f, 0.922559f, 0.919733f, 0.917037f, 0.914341f, 0.911186f, 0.907145f, 0.902128f, 0.896510f, + 0.890876f, 0.885647f, 0.880803f, 0.875934f, 0.870521f, 0.864338f, 0.857593f, 0.850818f, 0.844491f, + 0.838728f, 0.833217f, 0.827473f, 0.821173f, 0.814417f, 0.807660f, 0.801457f, 0.796095f, 0.791458f, + 0.787181f, 0.782928f, 0.778681f, 0.774802f, 0.771808f, 0.770061f, 0.769530f, 0.769827f, 0.770454f, + 0.771132f, 0.771943f, 0.773228f, 0.775315f, 0.778206f, 0.781513f, 0.784677f, 0.787274f, 0.789288f, + 0.791065f, 0.793055f, 0.795463f, 0.798095f, 0.800470f, 0.802135f, 0.802987f, 0.803318f, 0.803610f, + 0.804182f, 0.804958f, 0.805536f, 0.805434f, 0.804413f, 0.802618f, 0.800482f, 0.798381f, 0.796424f, + 0.794397f, 0.791922f, 0.788779f, 0.785087f, 0.781262f, 0.777778f, 0.774863f, 0.772372f, 0.769886f, + 0.767005f, 0.763613f, 0.759968f, 0.756518f, 0.753595f, 0.751171f, 0.748880f, 0.746246f, 0.743010f, + 0.739317f, 0.735608f, 0.732307f, 0.729533f, 0.727006f, 0.724256f, 0.720938f, 0.717104f, 0.713138f, + 0.709525f, 0.706513f, 0.703976f, 0.701515f, 0.698771f, 0.695693f, 0.692572f, 0.689860f, 0.687867f, + 0.686574f, 0.685644f, 0.684672f, 0.683452f, 0.682093f, 0.680935f, 0.680291f, 0.680231f, 0.680501f, + 0.680700f, 0.680500f, 0.679869f, 0.679047f, 0.678394f, 0.678091f, 0.678035f, 0.677888f, 0.677314f, + 0.676218f, 0.674814f, 0.673484f, 0.672514f, 0.671917f, 0.671422f, 0.670711f, 0.669654f, 0.668436f, + 0.667417f, 0.666896f, 0.666879f, 0.667100f, 0.667225f}; + +const float defaultHRIR_right_avg_power_32kHz_fx[LR_IAC_LENGTH_NR_FC] = + {1.030502f, 1.026883f, 1.017953f, 1.008327f, 1.002600f, 1.002691f, 1.006922f, 1.011300f, 1.012168f, + 1.008564f, 1.002837f, 0.999188f, 1.001094f, 1.009186f, 1.020854f, 1.031695f, 1.037923f, 1.038191f, + 1.033893f, 1.027913f, 1.022760f, 1.019332f, 1.016931f, 1.014338f, 1.010982f, 1.007343f, 1.004370f, + 1.002473f, 1.000948f, 0.998380f, 0.993744f, 0.987300f, 0.980628f, 0.975661f, 0.973406f, 0.973316f, + 0.973710f, 0.972971f, 0.970599f, 0.967380f, 0.964639f, 0.963173f, 0.962708f, 0.962246f, 0.960984f, + 0.959004f, 0.957270f, 0.956889f, 0.958265f, 0.960778f, 0.963180f, 0.964406f, 0.964189f, 0.963091f, + 0.962005f, 0.961500f, 0.961514f, 0.961496f, 0.960845f, 0.959306f, 0.957092f, 0.954688f, 0.952548f, + 0.950838f, 0.949380f, 0.947808f, 0.945783f, 0.943212f, 0.940298f, 0.937430f, 0.934937f, 0.932865f, + 0.930925f, 0.928674f, 0.925801f, 0.922365f, 0.918770f, 0.915509f, 0.912795f, 0.910417f, 0.907881f, + 0.904769f, 0.901065f, 0.897183f, 0.893709f, 0.890990f, 0.888922f, 0.887040f, 0.884874f, 0.882293f, + 0.879603f, 0.877335f, 0.875867f, 0.875169f, 0.874820f, 0.874318f, 0.873404f, 0.872263f, 0.871381f, + 0.871226f, 0.871950f, 0.873283f, 0.874763f, 0.876042f, 0.877147f, 0.878470f, 0.880494f, 0.883473f, + 0.887227f, 0.891261f, 0.895053f, 0.898401f, 0.901500f, 0.904769f, 0.908500f, 0.912599f, 0.916578f, + 0.919847f, 0.922084f, 0.923417f, 0.924328f, 0.925296f, 0.926463f, 0.927512f, 0.927872f, 0.927107f, + 0.925199f, 0.922559f, 0.919735f, 0.917037f, 0.914339f, 0.911186f, 0.907142f, 0.902131f, 0.896510f, + 0.890876f, 0.885644f, 0.880802f, 0.875934f, 0.870524f, 0.864337f, 0.857594f, 0.850819f, 0.844491f, + 0.838727f, 0.833219f, 0.827473f, 0.821173f, 0.814415f, 0.807662f, 0.801459f, 0.796094f, 0.791462f, + 0.787182f, 0.782926f, 0.778681f, 0.774803f, 0.771810f, 0.770061f, 0.769529f, 0.769825f, 0.770456f, + 0.771131f, 0.771940f, 0.773230f, 0.775319f, 0.778206f, 0.781513f, 0.784675f, 0.787274f, 0.789285f, + 0.791065f, 0.793054f, 0.795465f, 0.798097f, 0.800468f, 0.802133f, 0.802987f, 0.803319f, 0.803610f, + 0.804179f, 0.804959f, 0.805538f, 0.805434f, 0.804411f, 0.802621f, 0.800480f, 0.798379f, 0.796426f, + 0.794398f, 0.791920f, 0.788777f, 0.785087f, 0.781263f, 0.777777f, 0.774862f, 0.772372f, 0.769886f, + 0.767004f, 0.763614f, 0.759968f, 0.756517f, 0.753593f, 0.751172f, 0.748881f, 0.746246f, 0.743011f, + 0.739318f, 0.735608f, 0.732306f, 0.729532f, 0.727006f, 0.724254f, 0.720939f, 0.717103f, 0.713136f, + 0.709524f, 0.706514f, 0.703976f, 0.701513f, 0.698772f, 0.695692f, 0.692570f, 0.689859f, 0.687869f, + 0.686573f, 0.685642f, 0.684671f, 0.683452f, 0.682094f, 0.680934f, 0.680290f, 0.680228f, 0.680501f, + 0.680699f, 0.680498f, 0.679867f, 0.679050f, 0.678395f, 0.678093f, 0.678035f, 0.677889f, 0.677315f, + 0.676220f, 0.674814f, 0.673485f, 0.672517f, 0.671918f, 0.671424f, 0.670712f, 0.669657f, 0.668437f, + 0.667421f, 0.666896f, 0.666880f, 0.667103f, 0.667228f}; + + + +/********************** defaultHRIR reverb rom tables at sampling rate 16kHz **********************/ + +const float defaultHRIR_coherence_16kHz_fx[LR_IAC_LENGTH_NR_FC_16KHZ] = + {0.983044f, 0.960794f, 0.893756f, 0.783586f, 0.638963f, 0.477338f, 0.319879f, 0.183374f, 0.075909f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.003842f, 0.025288f, 0.035886f, + 0.037785f, 0.035991f, 0.034784f, 0.035091f, 0.034683f, 0.030849f, 0.023146f, 0.014061f, 0.007275f, + 0.005053f, 0.006930f, 0.010589f, 0.013905f, 0.016288f, 0.018404f, 0.020849f, 0.023164f, 0.024149f, + 0.023098f, 0.020635f, 0.018325f, 0.017381f, 0.017611f, 0.017534f, 0.015650f, 0.011786f, 0.007342f, + 0.004290f, 0.003732f, 0.005148f, 0.006838f, 0.007172f, 0.005579f, 0.002632f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000238f, 0.001738f, 0.003011f, 0.003910f, + 0.004120f, 0.003394f, 0.001769f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.002101f, 0.004247f, 0.006330f, 0.008300f, 0.010110f, 0.011735f, 0.013165f, 0.014384f, + 0.015345f, 0.015972f, 0.016191f}; + +const float defaultHRIR_left_avg_power_16kHz_fx[LR_IAC_LENGTH_NR_FC_16KHZ] = + {1.118974f, 1.115256f, 1.106210f, 1.096901f, 1.092316f, 1.094422f, 1.101140f, 1.107775f, 1.110000f, + 1.106535f, 1.099921f, 1.094914f, 1.095643f, 1.103178f, 1.114955f, 1.126292f, 1.132973f, 1.133288f, + 1.128471f, 1.121439f, 1.114842f, 1.109721f, 1.105480f, 1.100966f, 1.095650f, 1.090074f, 1.085225f, + 1.081525f, 1.078267f, 1.074026f, 1.067777f, 1.059839f, 1.051856f, 1.045772f, 1.042531f, 1.041432f, + 1.040607f, 1.038291f, 1.033910f, 1.028286f, 1.022846f, 1.018514f, 1.015152f, 1.011898f, 1.008047f, + 1.003762f, 0.999992f, 0.997770f, 0.997349f, 0.997960f, 0.998259f, 0.997177f, 0.994506f, 0.990883f, + 0.987207f, 0.984003f, 0.981133f, 0.977984f, 0.973950f, 0.968837f, 0.962915f, 0.956690f, 0.950584f, + 0.944679f, 0.938744f, 0.932399f, 0.925372f, 0.917663f, 0.909568f, 0.901511f, 0.893804f, 0.886455f, + 0.879155f, 0.871463f, 0.863142f, 0.854285f, 0.845334f, 0.836740f, 0.828656f, 0.820817f, 0.812713f, + 0.803960f, 0.794564f, 0.784952f, 0.775633f, 0.766881f, 0.758539f, 0.750156f, 0.741330f, 0.732004f, + 0.722524f, 0.713387f, 0.704919f, 0.697057f, 0.689419f, 0.681576f, 0.673350f, 0.664931f, 0.656703f, + 0.648997f, 0.641801f, 0.634760f, 0.627357f, 0.619192f, 0.610186f, 0.600526f, 0.590442f, 0.579952f, + 0.568762f, 0.556384f, 0.542389f, 0.526648f, 0.509355f, 0.490884f, 0.471542f, 0.451447f, 0.430550f, + 0.408842f, 0.386537f, 0.364126f, 0.342284f, 0.321675f, 0.302809f, 0.286016f, 0.271536f, 0.259639f, + 0.250691f, 0.245099f, 0.243192f}; + +const float defaultHRIR_right_avg_power_16kHz_fx[LR_IAC_LENGTH_NR_FC_16KHZ] = + {1.118974f, 1.115254f, 1.106207f, 1.096903f, 1.092317f, 1.094425f, 1.101145f, 1.107775f, 1.109999f, + 1.106540f, 1.099921f, 1.094912f, 1.095644f, 1.103178f, 1.114952f, 1.126292f, 1.132973f, 1.133288f, + 1.128472f, 1.121439f, 1.114842f, 1.109719f, 1.105481f, 1.100965f, 1.095650f, 1.090072f, 1.085224f, + 1.081527f, 1.078270f, 1.074025f, 1.067775f, 1.059840f, 1.051856f, 1.045772f, 1.042533f, 1.041433f, + 1.040611f, 1.038292f, 1.033911f, 1.028286f, 1.022844f, 1.018512f, 1.015153f, 1.011899f, 1.008050f, + 1.003762f, 0.999995f, 0.997769f, 0.997349f, 0.997959f, 0.998259f, 0.997178f, 0.994509f, 0.990883f, + 0.987204f, 0.984003f, 0.981133f, 0.977983f, 0.973949f, 0.968836f, 0.962914f, 0.956689f, 0.950583f, + 0.944681f, 0.938745f, 0.932399f, 0.925373f, 0.917662f, 0.909567f, 0.901511f, 0.893804f, 0.886456f, + 0.879153f, 0.871467f, 0.863138f, 0.854286f, 0.845334f, 0.836740f, 0.828656f, 0.820816f, 0.812712f, + 0.803961f, 0.794567f, 0.784951f, 0.775631f, 0.766882f, 0.758540f, 0.750158f, 0.741330f, 0.732005f, + 0.722523f, 0.713388f, 0.704920f, 0.697057f, 0.689418f, 0.681575f, 0.673352f, 0.664930f, 0.656706f, + 0.648998f, 0.641802f, 0.634762f, 0.627355f, 0.619192f, 0.610187f, 0.600527f, 0.590442f, 0.579953f, + 0.568763f, 0.556383f, 0.542389f, 0.526646f, 0.509355f, 0.490883f, 0.471543f, 0.451446f, 0.430550f, + 0.408843f, 0.386537f, 0.364127f, 0.342285f, 0.321676f, 0.302809f, 0.286016f, 0.271535f, 0.259640f, + 0.250692f, 0.245099f, 0.243192f}; + + +#else + const Word32 defaultHRIR_coherence_48kHz_fx[LR_IAC_LENGTH_NR_FC] /*Q-27*/ = { 131936432,125285536,105934832,77097344,45729324,19356880,2523696,0,0, 0,1602425,4763253,5796595,5698884,5608690,5175704,3880368,2303444, @@ -59838,70 +60089,103 @@ const Word32 defaultHRIR_right_avg_power_32kHz_fx[LR_IAC_LENGTH_NR_FC] /*Q-23*/ 2790378,2355663,2029237,1865240,1832432 }; -const Word32 defaultHRIR_coherence_16kHz_fx[LR_IAC_LENGTH_NR_FC_16KHZ] = -{ - 131941936, 128955584, 119957896, 105171136, 85760160, 64067220, 42933432, 24612042, - 10188334, 0, 0, 0, 0, 0, 0, 515664, - 3394098, 4816537, 5071417, 4830630, 4668629, 4709834, 4655073, 4140482, - 3106603, 1887235, 976434, 678202, 930128, 1421231, 1866297, 2186138, - 2470143, 2798305, 3109019, 3241224, 3100161, 2769582, 2459539, 2332838, - 2363708, 2353373, 2100507, 1581890, 985426, 575794, 500900, 690952, - 917780, 962609, 748800, 353261, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 31943, 233270, 404129, 524791, - 552977, 455534, 237431, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 281991, 570022, - 849598, 1114007, 1356941, 1575045, 1766976, 1930587, 2059571, 2143725, - 2173119 +const Word32 defaultHRIR_coherence_16kHz_fx[LR_IAC_LENGTH_NR_FC] /*Q-27*/ = { + 130123416,130123416,128225040,123478832,118732624,113118568,104033232,94947768,85862304, + 75063144,64263984,53464828,43914296,34675820,25437480,17993766,11746601,5499437, + 1532229,985023,437818,0,0,0,0,0,0, + 0,343865,773496,1203261,2004810,3054258,4103707,4777480,4887673, + 4998000,5066316,4966727,4867271,4767816,4765534,4763253,4760971,4569174, + 4329998,4090822,3659312,3099355,2539533,2037290,1621350,1205543,880065, + 916304,952677,988916,1233058,1477200,1721342,1912602,2090441,2268413, + 2427327,2573490,2719788,2859643,2989834,3120025,3219078,3193576,3168075, + 3142574,2987686,2832665,2677778,2583691,2504771,2425851,2397128,2401692, + 2406255,2356594,2225464,2094333,1933137,1651280,1369423,1087566,924357, + 761148,597940,625051,699677,774302,854295,937779,1021128,1026631, + 915230,803830,670014,446676,223338,0,0,0,0, + 0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,5100,30735, + 56371,81872,173140,264408,355542,419698,477144,534455,552037, + 543044,533918,485599,378494,271254,173946,115964,57982,0, + 0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0, + 0,0,671,1476,2415,99723,261321,423054,646795, + 963549,1280302,1632087,2124129,2616037,3108080,3841982,4575885,5309922, + 6280181,7309766,8339216,8750996,8750996 }; - -const Word32 defaultHRIR_left_avg_power_16kHz_fx[LR_IAC_LENGTH_NR_FC_16KHZ] = -{ - 9386634, 9355445, 9279562, 9201473, 9163011, 9180677, 9237032, 9292690, - 9311355, 9282288, 9226806, 9184804, 9190920, 9254128, 9352920, 9448022, - 9504066, 9506709, 9466301, 9407312, 9351973, 9309014, 9273438, 9235572, - 9190978, 9144203, 9103527, 9072489, 9045159, 9009583, 8957163, 8890574, - 8823608, 8772571, 8745384, 8736165, 8729244, 8709816, 8673066, 8625888, - 8580254, 8543915, 8515712, 8488416, 8456111, 8420166, 8388541, 8369901, - 8366370, 8371495, 8374003, 8364927, 8342521, 8312129, 8281292, 8254415, - 8230340, 8203924, 8170085, 8127194, 8077516, 8025297, 7974076, 7924542, - 7874755, 7821529, 7762583, 7697915, 7630009, 7562422, 7497771, 7436123, - 7374886, 7310361, 7240560, 7166262, 7091175, 7019084, 6951270, 6885512, - 6817531, 6744105, 6665286, 6584654, 6506481, 6433064, 6363086, 6292764, - 6218727, 6140494, 6060970, 5984324, 5913289, 5847338, 5783265, 5717474, - 5648469, 5577845, 5508824, 5444181, 5383817, 5324753, 5262652, 5194159, - 5118611, 5037577, 4952986, 4864990, 4771121, 4667287, 4549888, 4417843, - 4272779, 4117833, 3955581, 3787012, 3611715, 3429615, 3242507, 3054510, - 2871286, 2698405, 2540146, 2399276, 2277809, 2178009, 2102948, 2056039, - 2040042 +const Word32 defaultHRIR_left_avg_power_16kHz_fx[LR_IAC_LENGTH_NR_FC] /*Q-23*/ = { + 9335246,9335246,9316514,9269680,9222847,9180350,9155201,9130044,9104894, + 9126688,9148473,9170267,9191549,9212688,9233844,9234423,9221295,9208167, + 9191205,9168497,9145789,9127997,9129884,9131780,9133676,9164823,9195978, + 9227125,9267550,9310290,9353038,9385225,9410374,9435531,9445170,9431538, + 9417907,9399855,9364128,9328409,9292682,9270670,9248667,9226655,9215783, + 9207688,9199593,9183605,9162356,9141108,9116244,9085961,9055678,9028608, + 9014432,9000255,8986078,8975962,8965845,8955728,8926108,8891606,8857103, + 8819145,8778896,8738639,8710806,8701604,8692401,8686227,8692209,8698190, + 8704171,8686706,8669232,8651767,8623917,8593466,8563024,8543554,8531399, + 8519252,8509748,8504203,8498667,8489716,8467083,8444459,8421835,8399773, + 8377711,8355649,8351698,8352268,8352847,8355833,8360430,8365027,8363484, + 8352721,8341959,8331028,8319460,8307884,8296308,8292063,8287827,8283582, + 8271142,8256647,8242159,8221389,8196442,8171494,8150547,8135607,8120659, + 8106465,8095225,8083992,8072760,8043073,8013394,7983706,7949422,7913997, + 7878564,7853893,7836394,7818904,7801472,7784141,7766811,7744782,7703972, + 7663169,7622359,7580802,7539253,7497696,7474266,7455367,7436467,7415496, + 7393140,7370784,7338471,7291235,7244007,7197551,7154232,7110914,7067595, + 7046615,7025627,7004647,6977485,6948779,6920073,6878751,6829015,6779278, + 6733644,6694184,6654724,6618804,6597044,6575284,6553524,6518183,6482842, + 6447501,6401632,6353137,6304634,6267229,6237215,6207201,6181045,6160677, + 6140310,6115580,6073427,6031275,5989122,5942817,5896503,5850198,5825150, + 5805428,5785707,5765742,5745626,5725510,5693398,5643285,5593180,5544358, + 5500720,5457091,5413454,5404126,5394797,5385469,5366930,5346085,5325239, + 5282164,5224274,5166376,5115566,5075376,5035186,5002731,5001238,4999736, + 4998243,4969436,4940630,4911823,4847290,4773822,4700355,4646282,4605153, + 4564023,4540250,4542523,4544788,4536869,4488241,4439612,4390983,4285488, + 4179984,4074489,4025282,3990150,3955019,3974925,4031523,4088129,4108127, + 4073222,4038317,3957300,3691818,3426335,3160861,2774481,2388110,2001740, + 1708239,1437966,1167685,1059581,1059581 }; - -const Word32 defaultHRIR_right_avg_power_16kHz_fx[LR_IAC_LENGTH_NR_FC_16KHZ] = -{ - 9386634, 9355429, 9279537, 9201489, 9163019, 9180702, 9237074, 9292690, - 9311346, 9282330, 9226806, 9184788, 9190928, 9254128, 9352895, 9448022, - 9504066, 9506709, 9466309, 9407312, 9351973, 9308998, 9273447, 9235564, - 9190978, 9144187, 9103519, 9072506, 9045184, 9009575, 8957146, 8890582, - 8823608, 8772571, 8745401, 8736173, 8729278, 8709825, 8673074, 8625888, - 8580237, 8543898, 8515721, 8488424, 8456136, 8420166, 8388566, 8369893, - 8366370, 8371487, 8374003, 8364935, 8342546, 8312129, 8281267, 8254415, - 8230340, 8203916, 8170076, 8127185, 8077508, 8025289, 7974068, 7924558, - 7874764, 7821529, 7762591, 7697907, 7630001, 7562422, 7497771, 7436132, - 7374870, 7310395, 7240526, 7166270, 7091175, 7019084, 6951270, 6885503, - 6817522, 6744113, 6665311, 6584646, 6506464, 6433072, 6363094, 6292781, - 6218727, 6140503, 6060962, 5984332, 5913297, 5847338, 5783257, 5717465, - 5648486, 5577837, 5508849, 5444190, 5383825, 5324769, 5262635, 5194159, - 5118619, 5037585, 4952986, 4864998, 4771130, 4667279, 4549888, 4417827, - 4272779, 4117825, 3955589, 3787003, 3611715, 3429623, 3242507, 3054518, - 2871294, 2698413, 2540146, 2399276, 2277800, 2178018, 2102957, 2056039, - 2040042 +const Word32 defaultHRIR_right_avg_power_16kHz_fx[LR_IAC_LENGTH_NR_FC] /*Q-23*/ = { + 9335246,9335246,9316514,9269689,9222855,9180358,9155201,9130035,9104869, + 9126663,9148465,9170258,9191540,9212688,9233827,9234415,9221295,9208175, + 9191213,9168488,9145755,9127963,9129867,9131772,9133676,9164831,9195978, + 9227133,9267550,9310281,9353021,9385200,9410357,9435506,9445153,9431522, + 9417899,9399855,9364119,9328384,9292648,9270653,9248658,9226663,9215792, + 9207688,9199593,9183596,9162348,9141100,9116236,9085953,9055678,9028617, + 9014432,9000255,8986070,8975962,8965853,8955745,8926116,8891614,8857103, + 8819145,8778888,8738631,8710789,8701587,8692385,8686219,8692200,8698181, + 8704162,8686697,8669232,8651775,8623917,8593466,8563016,8543546,8531390, + 8519244,8509739,8504203,8498675,8489724,8467100,8444468,8421844,8399773, + 8377703,8355641,8351681,8352252,8352830,8355817,8360414,8365019,8363475, + 8352721,8341959,8331037,8319469,8307893,8296316,8292072,8287835,8283591, + 8271142,8256647,8242151,8221381,8196433,8171494,8150547,8135616,8120676, + 8106482,8095250,8084009,8072777,8043081,8013385,7983698,7949405,7913972, + 7878547,7853876,7836386,7818904,7801481,7784150,7766819,7744790,7703980, + 7663161,7622350,7580793,7539244,7497696,7474258,7455358,7436459,7415487, + 7393132,7370776,7338471,7291244,7244016,7197560,7154241,7110914,7067587, + 7046607,7025627,7004647,6977485,6948770,6920064,6878742,6829006,6779270, + 6733644,6694184,6654724,6618813,6597053,6575301,6553549,6518191,6482842, + 6447492,6401623,6353137,6304643,6267229,6237215,6207201,6181037,6160677, + 6140310,6115580,6073427,6031275,5989122,5942817,5896512,5850207,5825167, + 5805445,5785723,5765750,5745626,5725493,5693382,5643276,5593180,5544375, + 5500729,5457074,5413429,5404109,5394789,5385478,5366939,5346093,5325247, + 5282172,5224282,5166384,5115574,5075384,5035195,5002739,5001238,4999736, + 4998243,4969436,4940630,4911823,4847290,4773814,4700338,4646274,4605153, + 4564023,4540258,4542523,4544788,4536878,4488249,4439612,4390983,4285480, + 4179984,4074489,4025282,3990150,3955019,3974925,4031523,4088129,4108127, + 4073222,4038317,3957292,3691809,3426327,3160844,2774473,2388110,2001740, + 1708239,1437966,1167685,1059573,1059573 }; #endif +#endif + Word32 sine_table_Q31 [361] = { 187, diff --git a/lib_util/hrtf_file_reader.c b/lib_util/hrtf_file_reader.c index 31f75e876..8648cfa73 100644 --- a/lib_util/hrtf_file_reader.c +++ b/lib_util/hrtf_file_reader.c @@ -810,6 +810,16 @@ static ivas_error load_reverb_from_binary( hHrtfStatistics->average_energy_r = hHrtfStatistics->average_energy_r_dyn; hHrtfStatistics->inter_aural_coherence = hHrtfStatistics->inter_aural_coherence_dyn; +#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB + fread( f_tmp_lr_energy_and_iac_dyn, sizeof( float ), lr_iac_len, f_hrtf ); + floatToFixed_arr32( f_tmp_lr_energy_and_iac_dyn, hHrtfStatistics->average_energy_l_dyn, Q28, lr_iac_len ); + + fread( f_tmp_lr_energy_and_iac_dyn, sizeof( float ), lr_iac_len, f_hrtf ); + floatToFixed_arr32( f_tmp_lr_energy_and_iac_dyn, hHrtfStatistics->average_energy_r_dyn, Q28, lr_iac_len ); + + fread( f_tmp_lr_energy_and_iac_dyn, sizeof( float ), lr_iac_len, f_hrtf ); + floatToFixed_arr32( f_tmp_lr_energy_and_iac_dyn, hHrtfStatistics->inter_aural_coherence_dyn, Q26, lr_iac_len ); +#else fread( f_tmp_lr_energy_and_iac_dyn, sizeof( float ), lr_iac_len, f_hrtf ); floatToFixed_arr32( f_tmp_lr_energy_and_iac_dyn, hHrtfStatistics->average_energy_l_dyn, Q23, lr_iac_len ); @@ -818,7 +828,7 @@ static ivas_error load_reverb_from_binary( fread( f_tmp_lr_energy_and_iac_dyn, sizeof( float ), lr_iac_len, f_hrtf ); floatToFixed_arr32( f_tmp_lr_energy_and_iac_dyn, hHrtfStatistics->inter_aural_coherence_dyn, Q23, lr_iac_len ); - +#endif hHrtfStatistics->fromROM = FALSE; #else /* left/right energy and interaural coherence for late reverb */ -- GitLab From 407b6c41d6fb55d5bd64e924f0c070eba6815209 Mon Sep 17 00:00:00 2001 From: Marek Szczerba Date: Fri, 27 Jun 2025 16:59:25 +0200 Subject: [PATCH 06/12] Updated Q-format fixed-point representation for RT60 reverberation times (Q31 -> Q27) --- .../3.31.5/CompilerIdC/CMakeCCompilerId.c | 904 ++++++++++++++++++ lib_com/options.h | 1 + .../ivas_dirac_dec_binaural_functions_fx.c | 4 + lib_rend/ivas_reverb_fx.c | 30 + lib_rend/ivas_rom_binauralRenderer.h | 8 + lib_rend/ivas_rom_binauralRenderer_fx.c | 29 + lib_rend/ivas_stat_rend.h | 12 + lib_util/hrtf_file_reader.c | 8 + 8 files changed, 996 insertions(+) create mode 100644 build/CMakeFiles/3.31.5/CompilerIdC/CMakeCCompilerId.c diff --git a/build/CMakeFiles/3.31.5/CompilerIdC/CMakeCCompilerId.c b/build/CMakeFiles/3.31.5/CompilerIdC/CMakeCCompilerId.c new file mode 100644 index 000000000..8d8bb038b --- /dev/null +++ b/build/CMakeFiles/3.31.5/CompilerIdC/CMakeCCompilerId.c @@ -0,0 +1,904 @@ +#ifdef __cplusplus +# error "A C++ compiler has been selected for C." +#endif + +#if defined(__18CXX) +# define ID_VOID_MAIN +#endif +#if defined(__CLASSIC_C__) +/* cv-qualifiers did not exist in K&R C */ +# define const +# define volatile +#endif + +#if !defined(__has_include) +/* If the compiler does not have __has_include, pretend the answer is + always no. */ +# define __has_include(x) 0 +#endif + + +/* Version number components: V=Version, R=Revision, P=Patch + Version date components: YYYY=Year, MM=Month, DD=Day */ + +#if defined(__INTEL_COMPILER) || defined(__ICC) +# define COMPILER_ID "Intel" +# if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +# endif +# if defined(__GNUC__) +# define SIMULATE_ID "GNU" +# endif + /* __INTEL_COMPILER = VRP prior to 2021, and then VVVV for 2021 and later, + except that a few beta releases use the old format with V=2021. */ +# if __INTEL_COMPILER < 2021 || __INTEL_COMPILER == 202110 || __INTEL_COMPILER == 202111 +# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100) +# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10) +# if defined(__INTEL_COMPILER_UPDATE) +# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER_UPDATE) +# else +# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10) +# endif +# else +# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER) +# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER_UPDATE) + /* The third version component from --version is an update index, + but no macro is provided for it. */ +# define COMPILER_VERSION_PATCH DEC(0) +# endif +# if defined(__INTEL_COMPILER_BUILD_DATE) + /* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */ +# define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE) +# endif +# if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +# endif +# if defined(__GNUC__) +# define SIMULATE_VERSION_MAJOR DEC(__GNUC__) +# elif defined(__GNUG__) +# define SIMULATE_VERSION_MAJOR DEC(__GNUG__) +# endif +# if defined(__GNUC_MINOR__) +# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__) +# endif +# if defined(__GNUC_PATCHLEVEL__) +# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) +# endif + +#elif (defined(__clang__) && defined(__INTEL_CLANG_COMPILER)) || defined(__INTEL_LLVM_COMPILER) +# define COMPILER_ID "IntelLLVM" +#if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +#endif +#if defined(__GNUC__) +# define SIMULATE_ID "GNU" +#endif +/* __INTEL_LLVM_COMPILER = VVVVRP prior to 2021.2.0, VVVVRRPP for 2021.2.0 and + * later. Look for 6 digit vs. 8 digit version number to decide encoding. + * VVVV is no smaller than the current year when a version is released. + */ +#if __INTEL_LLVM_COMPILER < 1000000L +# define COMPILER_VERSION_MAJOR DEC(__INTEL_LLVM_COMPILER/100) +# define COMPILER_VERSION_MINOR DEC(__INTEL_LLVM_COMPILER/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__INTEL_LLVM_COMPILER % 10) +#else +# define COMPILER_VERSION_MAJOR DEC(__INTEL_LLVM_COMPILER/10000) +# define COMPILER_VERSION_MINOR DEC(__INTEL_LLVM_COMPILER/100 % 100) +# define COMPILER_VERSION_PATCH DEC(__INTEL_LLVM_COMPILER % 100) +#endif +#if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +#endif +#if defined(__GNUC__) +# define SIMULATE_VERSION_MAJOR DEC(__GNUC__) +#elif defined(__GNUG__) +# define SIMULATE_VERSION_MAJOR DEC(__GNUG__) +#endif +#if defined(__GNUC_MINOR__) +# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__) +#endif +#if defined(__GNUC_PATCHLEVEL__) +# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) +#endif + +#elif defined(__PATHCC__) +# define COMPILER_ID "PathScale" +# define COMPILER_VERSION_MAJOR DEC(__PATHCC__) +# define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__) +# if defined(__PATHCC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__) +# endif + +#elif defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__) +# define COMPILER_ID "Embarcadero" +# define COMPILER_VERSION_MAJOR HEX(__CODEGEARC_VERSION__>>24 & 0x00FF) +# define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF) +# define COMPILER_VERSION_PATCH DEC(__CODEGEARC_VERSION__ & 0xFFFF) + +#elif defined(__BORLANDC__) +# define COMPILER_ID "Borland" + /* __BORLANDC__ = 0xVRR */ +# define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8) +# define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF) + +#elif defined(__WATCOMC__) && __WATCOMC__ < 1200 +# define COMPILER_ID "Watcom" + /* __WATCOMC__ = VVRR */ +# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100) +# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) +# if (__WATCOMC__ % 10) > 0 +# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) +# endif + +#elif defined(__WATCOMC__) +# define COMPILER_ID "OpenWatcom" + /* __WATCOMC__ = VVRP + 1100 */ +# define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100) +# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) +# if (__WATCOMC__ % 10) > 0 +# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) +# endif + +#elif defined(__SUNPRO_C) +# define COMPILER_ID "SunPro" +# if __SUNPRO_C >= 0x5100 + /* __SUNPRO_C = 0xVRRP */ +# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>12) +# define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xFF) +# define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF) +# else + /* __SUNPRO_CC = 0xVRP */ +# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>8) +# define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xF) +# define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF) +# endif + +#elif defined(__HP_cc) +# define COMPILER_ID "HP" + /* __HP_cc = VVRRPP */ +# define COMPILER_VERSION_MAJOR DEC(__HP_cc/10000) +# define COMPILER_VERSION_MINOR DEC(__HP_cc/100 % 100) +# define COMPILER_VERSION_PATCH DEC(__HP_cc % 100) + +#elif defined(__DECC) +# define COMPILER_ID "Compaq" + /* __DECC_VER = VVRRTPPPP */ +# define COMPILER_VERSION_MAJOR DEC(__DECC_VER/10000000) +# define COMPILER_VERSION_MINOR DEC(__DECC_VER/100000 % 100) +# define COMPILER_VERSION_PATCH DEC(__DECC_VER % 10000) + +#elif defined(__IBMC__) && defined(__COMPILER_VER__) +# define COMPILER_ID "zOS" + /* __IBMC__ = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) +# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) + +#elif defined(__open_xl__) && defined(__clang__) +# define COMPILER_ID "IBMClang" +# define COMPILER_VERSION_MAJOR DEC(__open_xl_version__) +# define COMPILER_VERSION_MINOR DEC(__open_xl_release__) +# define COMPILER_VERSION_PATCH DEC(__open_xl_modification__) +# define COMPILER_VERSION_TWEAK DEC(__open_xl_ptf_fix_level__) + + +#elif defined(__ibmxl__) && defined(__clang__) +# define COMPILER_ID "XLClang" +# define COMPILER_VERSION_MAJOR DEC(__ibmxl_version__) +# define COMPILER_VERSION_MINOR DEC(__ibmxl_release__) +# define COMPILER_VERSION_PATCH DEC(__ibmxl_modification__) +# define COMPILER_VERSION_TWEAK DEC(__ibmxl_ptf_fix_level__) + + +#elif defined(__IBMC__) && !defined(__COMPILER_VER__) && __IBMC__ >= 800 +# define COMPILER_ID "XL" + /* __IBMC__ = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) +# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) + +#elif defined(__IBMC__) && !defined(__COMPILER_VER__) && __IBMC__ < 800 +# define COMPILER_ID "VisualAge" + /* __IBMC__ = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) +# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) + +#elif defined(__NVCOMPILER) +# define COMPILER_ID "NVHPC" +# define COMPILER_VERSION_MAJOR DEC(__NVCOMPILER_MAJOR__) +# define COMPILER_VERSION_MINOR DEC(__NVCOMPILER_MINOR__) +# if defined(__NVCOMPILER_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__NVCOMPILER_PATCHLEVEL__) +# endif + +#elif defined(__PGI) +# define COMPILER_ID "PGI" +# define COMPILER_VERSION_MAJOR DEC(__PGIC__) +# define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__) +# if defined(__PGIC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__) +# endif + +#elif defined(__clang__) && defined(__cray__) +# define COMPILER_ID "CrayClang" +# define COMPILER_VERSION_MAJOR DEC(__cray_major__) +# define COMPILER_VERSION_MINOR DEC(__cray_minor__) +# define COMPILER_VERSION_PATCH DEC(__cray_patchlevel__) +# define COMPILER_VERSION_INTERNAL_STR __clang_version__ + + +#elif defined(_CRAYC) +# define COMPILER_ID "Cray" +# define COMPILER_VERSION_MAJOR DEC(_RELEASE_MAJOR) +# define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR) + +#elif defined(__TI_COMPILER_VERSION__) +# define COMPILER_ID "TI" + /* __TI_COMPILER_VERSION__ = VVVRRRPPP */ +# define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000) +# define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000) +# define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000) + +#elif defined(__CLANG_FUJITSU) +# define COMPILER_ID "FujitsuClang" +# define COMPILER_VERSION_MAJOR DEC(__FCC_major__) +# define COMPILER_VERSION_MINOR DEC(__FCC_minor__) +# define COMPILER_VERSION_PATCH DEC(__FCC_patchlevel__) +# define COMPILER_VERSION_INTERNAL_STR __clang_version__ + + +#elif defined(__FUJITSU) +# define COMPILER_ID "Fujitsu" +# if defined(__FCC_version__) +# define COMPILER_VERSION __FCC_version__ +# elif defined(__FCC_major__) +# define COMPILER_VERSION_MAJOR DEC(__FCC_major__) +# define COMPILER_VERSION_MINOR DEC(__FCC_minor__) +# define COMPILER_VERSION_PATCH DEC(__FCC_patchlevel__) +# endif +# if defined(__fcc_version) +# define COMPILER_VERSION_INTERNAL DEC(__fcc_version) +# elif defined(__FCC_VERSION) +# define COMPILER_VERSION_INTERNAL DEC(__FCC_VERSION) +# endif + + +#elif defined(__ghs__) +# define COMPILER_ID "GHS" +/* __GHS_VERSION_NUMBER = VVVVRP */ +# ifdef __GHS_VERSION_NUMBER +# define COMPILER_VERSION_MAJOR DEC(__GHS_VERSION_NUMBER / 100) +# define COMPILER_VERSION_MINOR DEC(__GHS_VERSION_NUMBER / 10 % 10) +# define COMPILER_VERSION_PATCH DEC(__GHS_VERSION_NUMBER % 10) +# endif + +#elif defined(__TASKING__) +# define COMPILER_ID "Tasking" + # define COMPILER_VERSION_MAJOR DEC(__VERSION__/1000) + # define COMPILER_VERSION_MINOR DEC(__VERSION__ % 100) +# define COMPILER_VERSION_INTERNAL DEC(__VERSION__) + +#elif defined(__ORANGEC__) +# define COMPILER_ID "OrangeC" +# define COMPILER_VERSION_MAJOR DEC(__ORANGEC_MAJOR__) +# define COMPILER_VERSION_MINOR DEC(__ORANGEC_MINOR__) +# define COMPILER_VERSION_PATCH DEC(__ORANGEC_PATCHLEVEL__) + +#elif defined(__TINYC__) +# define COMPILER_ID "TinyCC" + +#elif defined(__BCC__) +# define COMPILER_ID "Bruce" + +#elif defined(__SCO_VERSION__) +# define COMPILER_ID "SCO" + +#elif defined(__ARMCC_VERSION) && !defined(__clang__) +# define COMPILER_ID "ARMCC" +#if __ARMCC_VERSION >= 1000000 + /* __ARMCC_VERSION = VRRPPPP */ + # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/1000000) + # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 100) + # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) +#else + /* __ARMCC_VERSION = VRPPPP */ + # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/100000) + # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 10) + # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) +#endif + + +#elif defined(__clang__) && defined(__apple_build_version__) +# define COMPILER_ID "AppleClang" +# if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +# endif +# define COMPILER_VERSION_MAJOR DEC(__clang_major__) +# define COMPILER_VERSION_MINOR DEC(__clang_minor__) +# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) +# if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +# endif +# define COMPILER_VERSION_TWEAK DEC(__apple_build_version__) + +#elif defined(__clang__) && defined(__ARMCOMPILER_VERSION) +# define COMPILER_ID "ARMClang" + # define COMPILER_VERSION_MAJOR DEC(__ARMCOMPILER_VERSION/1000000) + # define COMPILER_VERSION_MINOR DEC(__ARMCOMPILER_VERSION/10000 % 100) + # define COMPILER_VERSION_PATCH DEC(__ARMCOMPILER_VERSION/100 % 100) +# define COMPILER_VERSION_INTERNAL DEC(__ARMCOMPILER_VERSION) + +#elif defined(__clang__) && defined(__ti__) +# define COMPILER_ID "TIClang" + # define COMPILER_VERSION_MAJOR DEC(__ti_major__) + # define COMPILER_VERSION_MINOR DEC(__ti_minor__) + # define COMPILER_VERSION_PATCH DEC(__ti_patchlevel__) +# define COMPILER_VERSION_INTERNAL DEC(__ti_version__) + +#elif defined(__clang__) +# define COMPILER_ID "Clang" +# if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +# endif +# define COMPILER_VERSION_MAJOR DEC(__clang_major__) +# define COMPILER_VERSION_MINOR DEC(__clang_minor__) +# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) +# if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +# endif + +#elif defined(__LCC__) && (defined(__GNUC__) || defined(__GNUG__) || defined(__MCST__)) +# define COMPILER_ID "LCC" +# define COMPILER_VERSION_MAJOR DEC(__LCC__ / 100) +# define COMPILER_VERSION_MINOR DEC(__LCC__ % 100) +# if defined(__LCC_MINOR__) +# define COMPILER_VERSION_PATCH DEC(__LCC_MINOR__) +# endif +# if defined(__GNUC__) && defined(__GNUC_MINOR__) +# define SIMULATE_ID "GNU" +# define SIMULATE_VERSION_MAJOR DEC(__GNUC__) +# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__) +# if defined(__GNUC_PATCHLEVEL__) +# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) +# endif +# endif + +#elif defined(__GNUC__) +# define COMPILER_ID "GNU" +# define COMPILER_VERSION_MAJOR DEC(__GNUC__) +# if defined(__GNUC_MINOR__) +# define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__) +# endif +# if defined(__GNUC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) +# endif + +#elif defined(_MSC_VER) +# define COMPILER_ID "MSVC" + /* _MSC_VER = VVRR */ +# define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100) +# define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100) +# if defined(_MSC_FULL_VER) +# if _MSC_VER >= 1400 + /* _MSC_FULL_VER = VVRRPPPPP */ +# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000) +# else + /* _MSC_FULL_VER = VVRRPPPP */ +# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000) +# endif +# endif +# if defined(_MSC_BUILD) +# define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD) +# endif + +#elif defined(_ADI_COMPILER) +# define COMPILER_ID "ADSP" +#if defined(__VERSIONNUM__) + /* __VERSIONNUM__ = 0xVVRRPPTT */ +# define COMPILER_VERSION_MAJOR DEC(__VERSIONNUM__ >> 24 & 0xFF) +# define COMPILER_VERSION_MINOR DEC(__VERSIONNUM__ >> 16 & 0xFF) +# define COMPILER_VERSION_PATCH DEC(__VERSIONNUM__ >> 8 & 0xFF) +# define COMPILER_VERSION_TWEAK DEC(__VERSIONNUM__ & 0xFF) +#endif + +#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) +# define COMPILER_ID "IAR" +# if defined(__VER__) && defined(__ICCARM__) +# define COMPILER_VERSION_MAJOR DEC((__VER__) / 1000000) +# define COMPILER_VERSION_MINOR DEC(((__VER__) / 1000) % 1000) +# define COMPILER_VERSION_PATCH DEC((__VER__) % 1000) +# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) +# elif defined(__VER__) && (defined(__ICCAVR__) || defined(__ICCRX__) || defined(__ICCRH850__) || defined(__ICCRL78__) || defined(__ICC430__) || defined(__ICCRISCV__) || defined(__ICCV850__) || defined(__ICC8051__) || defined(__ICCSTM8__)) +# define COMPILER_VERSION_MAJOR DEC((__VER__) / 100) +# define COMPILER_VERSION_MINOR DEC((__VER__) - (((__VER__) / 100)*100)) +# define COMPILER_VERSION_PATCH DEC(__SUBVERSION__) +# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) +# endif + +#elif defined(__SDCC_VERSION_MAJOR) || defined(SDCC) +# define COMPILER_ID "SDCC" +# if defined(__SDCC_VERSION_MAJOR) +# define COMPILER_VERSION_MAJOR DEC(__SDCC_VERSION_MAJOR) +# define COMPILER_VERSION_MINOR DEC(__SDCC_VERSION_MINOR) +# define COMPILER_VERSION_PATCH DEC(__SDCC_VERSION_PATCH) +# else + /* SDCC = VRP */ +# define COMPILER_VERSION_MAJOR DEC(SDCC/100) +# define COMPILER_VERSION_MINOR DEC(SDCC/10 % 10) +# define COMPILER_VERSION_PATCH DEC(SDCC % 10) +# endif + + +/* These compilers are either not known or too old to define an + identification macro. Try to identify the platform and guess that + it is the native compiler. */ +#elif defined(__hpux) || defined(__hpua) +# define COMPILER_ID "HP" + +#else /* unknown compiler */ +# define COMPILER_ID "" +#endif + +/* Construct the string literal in pieces to prevent the source from + getting matched. Store it in a pointer rather than an array + because some compilers will just produce instructions to fill the + array rather than assigning a pointer to a static array. */ +char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]"; +#ifdef SIMULATE_ID +char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]"; +#endif + +#ifdef __QNXNTO__ +char const* qnxnto = "INFO" ":" "qnxnto[]"; +#endif + +#if defined(__CRAYXT_COMPUTE_LINUX_TARGET) +char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]"; +#endif + +#define STRINGIFY_HELPER(X) #X +#define STRINGIFY(X) STRINGIFY_HELPER(X) + +/* Identify known platforms by name. */ +#if defined(__linux) || defined(__linux__) || defined(linux) +# define PLATFORM_ID "Linux" + +#elif defined(__MSYS__) +# define PLATFORM_ID "MSYS" + +#elif defined(__CYGWIN__) +# define PLATFORM_ID "Cygwin" + +#elif defined(__MINGW32__) +# define PLATFORM_ID "MinGW" + +#elif defined(__APPLE__) +# define PLATFORM_ID "Darwin" + +#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32) +# define PLATFORM_ID "Windows" + +#elif defined(__FreeBSD__) || defined(__FreeBSD) +# define PLATFORM_ID "FreeBSD" + +#elif defined(__NetBSD__) || defined(__NetBSD) +# define PLATFORM_ID "NetBSD" + +#elif defined(__OpenBSD__) || defined(__OPENBSD) +# define PLATFORM_ID "OpenBSD" + +#elif defined(__sun) || defined(sun) +# define PLATFORM_ID "SunOS" + +#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__) +# define PLATFORM_ID "AIX" + +#elif defined(__hpux) || defined(__hpux__) +# define PLATFORM_ID "HP-UX" + +#elif defined(__HAIKU__) +# define PLATFORM_ID "Haiku" + +#elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS) +# define PLATFORM_ID "BeOS" + +#elif defined(__QNX__) || defined(__QNXNTO__) +# define PLATFORM_ID "QNX" + +#elif defined(__tru64) || defined(_tru64) || defined(__TRU64__) +# define PLATFORM_ID "Tru64" + +#elif defined(__riscos) || defined(__riscos__) +# define PLATFORM_ID "RISCos" + +#elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__) +# define PLATFORM_ID "SINIX" + +#elif defined(__UNIX_SV__) +# define PLATFORM_ID "UNIX_SV" + +#elif defined(__bsdos__) +# define PLATFORM_ID "BSDOS" + +#elif defined(_MPRAS) || defined(MPRAS) +# define PLATFORM_ID "MP-RAS" + +#elif defined(__osf) || defined(__osf__) +# define PLATFORM_ID "OSF1" + +#elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv) +# define PLATFORM_ID "SCO_SV" + +#elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX) +# define PLATFORM_ID "ULTRIX" + +#elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX) +# define PLATFORM_ID "Xenix" + +#elif defined(__WATCOMC__) +# if defined(__LINUX__) +# define PLATFORM_ID "Linux" + +# elif defined(__DOS__) +# define PLATFORM_ID "DOS" + +# elif defined(__OS2__) +# define PLATFORM_ID "OS2" + +# elif defined(__WINDOWS__) +# define PLATFORM_ID "Windows3x" + +# elif defined(__VXWORKS__) +# define PLATFORM_ID "VxWorks" + +# else /* unknown platform */ +# define PLATFORM_ID +# endif + +#elif defined(__INTEGRITY) +# if defined(INT_178B) +# define PLATFORM_ID "Integrity178" + +# else /* regular Integrity */ +# define PLATFORM_ID "Integrity" +# endif + +# elif defined(_ADI_COMPILER) +# define PLATFORM_ID "ADSP" + +#else /* unknown platform */ +# define PLATFORM_ID + +#endif + +/* For windows compilers MSVC and Intel we can determine + the architecture of the compiler being used. This is because + the compilers do not have flags that can change the architecture, + but rather depend on which compiler is being used +*/ +#if defined(_WIN32) && defined(_MSC_VER) +# if defined(_M_IA64) +# define ARCHITECTURE_ID "IA64" + +# elif defined(_M_ARM64EC) +# define ARCHITECTURE_ID "ARM64EC" + +# elif defined(_M_X64) || defined(_M_AMD64) +# define ARCHITECTURE_ID "x64" + +# elif defined(_M_IX86) +# define ARCHITECTURE_ID "X86" + +# elif defined(_M_ARM64) +# define ARCHITECTURE_ID "ARM64" + +# elif defined(_M_ARM) +# if _M_ARM == 4 +# define ARCHITECTURE_ID "ARMV4I" +# elif _M_ARM == 5 +# define ARCHITECTURE_ID "ARMV5I" +# else +# define ARCHITECTURE_ID "ARMV" STRINGIFY(_M_ARM) +# endif + +# elif defined(_M_MIPS) +# define ARCHITECTURE_ID "MIPS" + +# elif defined(_M_SH) +# define ARCHITECTURE_ID "SHx" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__WATCOMC__) +# if defined(_M_I86) +# define ARCHITECTURE_ID "I86" + +# elif defined(_M_IX86) +# define ARCHITECTURE_ID "X86" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) +# if defined(__ICCARM__) +# define ARCHITECTURE_ID "ARM" + +# elif defined(__ICCRX__) +# define ARCHITECTURE_ID "RX" + +# elif defined(__ICCRH850__) +# define ARCHITECTURE_ID "RH850" + +# elif defined(__ICCRL78__) +# define ARCHITECTURE_ID "RL78" + +# elif defined(__ICCRISCV__) +# define ARCHITECTURE_ID "RISCV" + +# elif defined(__ICCAVR__) +# define ARCHITECTURE_ID "AVR" + +# elif defined(__ICC430__) +# define ARCHITECTURE_ID "MSP430" + +# elif defined(__ICCV850__) +# define ARCHITECTURE_ID "V850" + +# elif defined(__ICC8051__) +# define ARCHITECTURE_ID "8051" + +# elif defined(__ICCSTM8__) +# define ARCHITECTURE_ID "STM8" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__ghs__) +# if defined(__PPC64__) +# define ARCHITECTURE_ID "PPC64" + +# elif defined(__ppc__) +# define ARCHITECTURE_ID "PPC" + +# elif defined(__ARM__) +# define ARCHITECTURE_ID "ARM" + +# elif defined(__x86_64__) +# define ARCHITECTURE_ID "x64" + +# elif defined(__i386__) +# define ARCHITECTURE_ID "X86" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__clang__) && defined(__ti__) +# if defined(__ARM_ARCH) +# define ARCHITECTURE_ID "Arm" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__TI_COMPILER_VERSION__) +# if defined(__TI_ARM__) +# define ARCHITECTURE_ID "ARM" + +# elif defined(__MSP430__) +# define ARCHITECTURE_ID "MSP430" + +# elif defined(__TMS320C28XX__) +# define ARCHITECTURE_ID "TMS320C28x" + +# elif defined(__TMS320C6X__) || defined(_TMS320C6X) +# define ARCHITECTURE_ID "TMS320C6x" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +# elif defined(__ADSPSHARC__) +# define ARCHITECTURE_ID "SHARC" + +# elif defined(__ADSPBLACKFIN__) +# define ARCHITECTURE_ID "Blackfin" + +#elif defined(__TASKING__) + +# if defined(__CTC__) || defined(__CPTC__) +# define ARCHITECTURE_ID "TriCore" + +# elif defined(__CMCS__) +# define ARCHITECTURE_ID "MCS" + +# elif defined(__CARM__) +# define ARCHITECTURE_ID "ARM" + +# elif defined(__CARC__) +# define ARCHITECTURE_ID "ARC" + +# elif defined(__C51__) +# define ARCHITECTURE_ID "8051" + +# elif defined(__CPCP__) +# define ARCHITECTURE_ID "PCP" + +# else +# define ARCHITECTURE_ID "" +# endif + +#else +# define ARCHITECTURE_ID +#endif + +/* Convert integer to decimal digit literals. */ +#define DEC(n) \ + ('0' + (((n) / 10000000)%10)), \ + ('0' + (((n) / 1000000)%10)), \ + ('0' + (((n) / 100000)%10)), \ + ('0' + (((n) / 10000)%10)), \ + ('0' + (((n) / 1000)%10)), \ + ('0' + (((n) / 100)%10)), \ + ('0' + (((n) / 10)%10)), \ + ('0' + ((n) % 10)) + +/* Convert integer to hex digit literals. */ +#define HEX(n) \ + ('0' + ((n)>>28 & 0xF)), \ + ('0' + ((n)>>24 & 0xF)), \ + ('0' + ((n)>>20 & 0xF)), \ + ('0' + ((n)>>16 & 0xF)), \ + ('0' + ((n)>>12 & 0xF)), \ + ('0' + ((n)>>8 & 0xF)), \ + ('0' + ((n)>>4 & 0xF)), \ + ('0' + ((n) & 0xF)) + +/* Construct a string literal encoding the version number. */ +#ifdef COMPILER_VERSION +char const* info_version = "INFO" ":" "compiler_version[" COMPILER_VERSION "]"; + +/* Construct a string literal encoding the version number components. */ +#elif defined(COMPILER_VERSION_MAJOR) +char const info_version[] = { + 'I', 'N', 'F', 'O', ':', + 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[', + COMPILER_VERSION_MAJOR, +# ifdef COMPILER_VERSION_MINOR + '.', COMPILER_VERSION_MINOR, +# ifdef COMPILER_VERSION_PATCH + '.', COMPILER_VERSION_PATCH, +# ifdef COMPILER_VERSION_TWEAK + '.', COMPILER_VERSION_TWEAK, +# endif +# endif +# endif + ']','\0'}; +#endif + +/* Construct a string literal encoding the internal version number. */ +#ifdef COMPILER_VERSION_INTERNAL +char const info_version_internal[] = { + 'I', 'N', 'F', 'O', ':', + 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','_', + 'i','n','t','e','r','n','a','l','[', + COMPILER_VERSION_INTERNAL,']','\0'}; +#elif defined(COMPILER_VERSION_INTERNAL_STR) +char const* info_version_internal = "INFO" ":" "compiler_version_internal[" COMPILER_VERSION_INTERNAL_STR "]"; +#endif + +/* Construct a string literal encoding the version number components. */ +#ifdef SIMULATE_VERSION_MAJOR +char const info_simulate_version[] = { + 'I', 'N', 'F', 'O', ':', + 's','i','m','u','l','a','t','e','_','v','e','r','s','i','o','n','[', + SIMULATE_VERSION_MAJOR, +# ifdef SIMULATE_VERSION_MINOR + '.', SIMULATE_VERSION_MINOR, +# ifdef SIMULATE_VERSION_PATCH + '.', SIMULATE_VERSION_PATCH, +# ifdef SIMULATE_VERSION_TWEAK + '.', SIMULATE_VERSION_TWEAK, +# endif +# endif +# endif + ']','\0'}; +#endif + +/* Construct the string literal in pieces to prevent the source from + getting matched. Store it in a pointer rather than an array + because some compilers will just produce instructions to fill the + array rather than assigning a pointer to a static array. */ +char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]"; +char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]"; + + + +#define C_STD_99 199901L +#define C_STD_11 201112L +#define C_STD_17 201710L +#define C_STD_23 202311L + +#ifdef __STDC_VERSION__ +# define C_STD __STDC_VERSION__ +#endif + +#if !defined(__STDC__) && !defined(__clang__) +# if defined(_MSC_VER) || defined(__ibmxl__) || defined(__IBMC__) +# define C_VERSION "90" +# else +# define C_VERSION +# endif +#elif C_STD > C_STD_17 +# define C_VERSION "23" +#elif C_STD > C_STD_11 +# define C_VERSION "17" +#elif C_STD > C_STD_99 +# define C_VERSION "11" +#elif C_STD >= C_STD_99 +# define C_VERSION "99" +#else +# define C_VERSION "90" +#endif +const char* info_language_standard_default = + "INFO" ":" "standard_default[" C_VERSION "]"; + +const char* info_language_extensions_default = "INFO" ":" "extensions_default[" +#if (defined(__clang__) || defined(__GNUC__) || defined(__xlC__) || \ + defined(__TI_COMPILER_VERSION__)) && \ + !defined(__STRICT_ANSI__) + "ON" +#else + "OFF" +#endif +"]"; + +/*--------------------------------------------------------------------------*/ + +#ifdef ID_VOID_MAIN +void main() {} +#else +# if defined(__CLASSIC_C__) +int main(argc, argv) int argc; char *argv[]; +# else +int main(int argc, char* argv[]) +# endif +{ + int require = 0; + require += info_compiler[argc]; + require += info_platform[argc]; + require += info_arch[argc]; +#ifdef COMPILER_VERSION_MAJOR + require += info_version[argc]; +#endif +#ifdef COMPILER_VERSION_INTERNAL + require += info_version_internal[argc]; +#endif +#ifdef SIMULATE_ID + require += info_simulate[argc]; +#endif +#ifdef SIMULATE_VERSION_MAJOR + require += info_simulate_version[argc]; +#endif +#if defined(__CRAYXT_COMPUTE_LINUX_TARGET) + require += info_cray[argc]; +#endif + require += info_language_standard_default[argc]; + require += info_language_extensions_default[argc]; + (void)argv; + return require; +} +#endif diff --git a/lib_com/options.h b/lib_com/options.h index 8b1f827bb..f262bea81 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -122,6 +122,7 @@ /* #define NONBE_FIX_991_PARAMBIN_BINARY_HRTF */ /* Nokia: issue #991: fix using of binary file HRTF in ParamBin (to activate when USE_NEW_HRTF_BINARY_FILE_FORMAT and FIX_777_COMBI_RENDER_CONFIG_FILE are on ) */ #define FIX_1024_REMOVE_PARAMMC_MIXING_MAT /* VA: issue 1024: remove unused function ivas_param_mc_get_mono_stereo_mixing_matrices() */ +#define FIX_1741_REVERB_TIMES_Q_FORMAT /* Philips: reverberation times in Q27 format instead of Q31 */ /* #################### End BASOP porting switches ############################ */ diff --git a/lib_rend/ivas_dirac_dec_binaural_functions_fx.c b/lib_rend/ivas_dirac_dec_binaural_functions_fx.c index a1d3a4908..0b9e3750a 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions_fx.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions_fx.c @@ -503,7 +503,11 @@ ivas_error ivas_dirac_dec_binaural_copy_hrtfs_fx( Copy( hrtfShCoeffsIm_fx[i][j], hrtfParambin->hrtfShCoeffsIm_fx[i][j], HRTF_NUM_BINS ); /*Q14*/ } } +#ifdef FIX_1741_REVERB_TIMES_Q_FORMAT + Copy32( parametricReverberationTimes_fx, hrtfParambin->parametricReverberationTimes_fx, CLDFB_NO_CHANNELS_MAX ); /*Q27*/ +#else Copy32( parametricReverberationTimes_fx, hrtfParambin->parametricReverberationTimes_fx, CLDFB_NO_CHANNELS_MAX ); /*Q31*/ +#endif Copy32( parametricReverberationEneCorrections_fx, hrtfParambin->parametricReverberationEneCorrections_fx, CLDFB_NO_CHANNELS_MAX ); /*Q31*/ Copy32( parametricEarlyPartEneCorrection_fx, hrtfParambin->parametricEarlyPartEneCorrection_fx, CLDFB_NO_CHANNELS_MAX ); /*Q28*/ *hHrtfParambin = hrtfParambin; diff --git a/lib_rend/ivas_reverb_fx.c b/lib_rend/ivas_reverb_fx.c index 4e054b699..8fbe82abf 100644 --- a/lib_rend/ivas_reverb_fx.c +++ b/lib_rend/ivas_reverb_fx.c @@ -219,7 +219,11 @@ static void ivas_binaural_reverb_setPreDelay_fx( static void ivas_binaural_reverb_setReverbTimes_fx( REVERB_STRUCT_HANDLE hReverb, /* i/o: binaural reverb handle */ const Word32 output_Fs, /* i : sampling_rate */ +#ifdef FIX_1741_REVERB_TIMES_Q_FORMAT + const Word32 *revTimes_fx, /*Q27 i : reverberation times T60 for each CLDFB bin in seconds */ +#else const Word32 *revTimes_fx, /*Q31 i : reverberation times T60 for each CLDFB bin in seconds */ +#endif const Word32 *revEnes_fx /*Q31 i : spectrum for reverberated sound at each CLDFB bin */ ) { @@ -324,7 +328,11 @@ static void ivas_binaural_reverb_setReverbTimes_fx( /* Determine attenuation factor that generates the appropriate energy decay according to reverberation time */ L_tmp = Mpy_32_32( 1677721600, revTimes_fx[bin] ); // e10 --> 800 * 2^21, + e0 tmp = BASOP_Util_Divide3232_Scale( 1073741824, L_tmp, &scale ); +#ifdef FIX_1741_REVERB_TIMES_Q_FORMAT + scale = add( scale, sub( 1, 14 ) ); // revTimes_fx in Q27 +#else scale = add( scale, sub( 1, 10 ) ); +#endif L_tmp = Mpy_32_16_1( -1610612736, tmp ); // * -3 scale = add( 2, scale ); L_tmp = Mpy_32_32( 1783446563, L_tmp ); // scale + 2 @@ -2386,7 +2394,11 @@ static ivas_error ivas_binaural_reverb_open_fx( const Word16 numBins, /* i : Q0 number of CLDFB bins */ const Word16 numCldfbSlotsPerFrame, /* i : Q0 number of CLDFB slots per frame */ const Word32 sampling_rate, /* i : Q0 sampling rate */ +#ifdef FIX_1741_REVERB_TIMES_Q_FORMAT + const Word32 *revTimes_fx, /* i : Q27 reverberation times T60 for each CLDFB bin in seconds */ +#else const Word32 *revTimes_fx, /* i : Q31 reverberation times T60 for each CLDFB bin in seconds */ +#endif const Word32 *revEnes_fx, /* i : Q31 spectrum for reverberated sound at each CLDFB bin */ const Word16 preDelay /* i : Q0 reverb pre-delay in CLDFB slots */ ) @@ -2446,9 +2458,15 @@ static ivas_error ivas_binaural_reverb_open_fx( * but not excessively long loops to generate reverberation. */ /* Note: the resulted length is very sensitive to the precision of the constants below (e.g. 1.45 vs. 1.45f) */ // hReverb->loopBufLength[bin] = (int16_t) ( 1.45 * (int16_t) ( revTimes[bin] * 150.0 ) + 1 ); +#ifdef FIX_1741_REVERB_TIMES_Q_FORMAT + Word32 L_tmp_BufLength = L_shl( L_shr( Mpy_32_32( revTimes_fx[bin], 1258291200 /*150.0 in Q23*/ ), 19 ), 19 ); + L_tmp_BufLength = L_add( Mpy_32_32( 1556925645 /*1.45 in Q30*/, L_tmp_BufLength ), ONE_IN_Q18 ); + hReverb->loopBufLength[bin] = (Word16) L_shr( L_tmp_BufLength, 18 ); /*Q0*/ +#else Word32 L_tmp_BufLength = L_shl( L_shr( Mpy_32_32( revTimes_fx[bin], 1258291200 /*150.0 in Q23*/ ), 23 ), 23 ); L_tmp_BufLength = L_add( Mpy_32_32( 1556925645 /*1.45 in Q30*/, L_tmp_BufLength ), ONE_IN_Q22 ); hReverb->loopBufLength[bin] = (Word16) L_shr( L_tmp_BufLength, 22 ); /*Q0*/ +#endif move16(); hReverb->loopBufLength[bin] = s_min( hReverb->loopBufLength[bin], hReverb->loopBufLengthMax[bin] ); @@ -2541,7 +2559,11 @@ ivas_error ivas_binaural_reverb_init( } preDelay = (int16_t) roundf( 48000.0f * roomAcoustics->acousticPreDelay / CLDFB_NO_CHANNELS_MAX ); +#ifdef FIX_1741_REVERB_TIMES_Q_FORMAT + floatToFixed_arrL( t60_temp, t60, Q27, CLDFB_NO_CHANNELS_MAX ); +#else floatToFixed_arrL( t60_temp, t60, Q31, CLDFB_NO_CHANNELS_MAX ); +#endif floatToFixed_arrL( ene_temp, ene, Q31, CLDFB_NO_CHANNELS_MAX ); } else @@ -2601,7 +2623,11 @@ ivas_error ivas_binaural_reverb_open_fastconv_fx( } ELSE { +#ifdef FIX_1741_REVERB_TIMES_Q_FORMAT + revTimes = hHrtfFastConv->fastconvReverberationTimes_fx; /*Q27*/ +#else revTimes = hHrtfFastConv->fastconvReverberationTimes_fx; /*Q31*/ +#endif revEne = hHrtfFastConv->fastconvReverberationEneCorrections_fx; /*Q31*/ preDelay = 10; move16(); @@ -2646,7 +2672,11 @@ ivas_error ivas_binaural_reverb_open_parambin( } ELSE { +#ifdef FIX_1741_REVERB_TIMES_Q_FORMAT + revTimes = hHrtfParambin->parametricReverberationTimes_fx; /*Q27*/ +#else revTimes = hHrtfParambin->parametricReverberationTimes_fx; /*Q31*/ +#endif revEne = hHrtfParambin->parametricReverberationEneCorrections_fx; /*Q31*/ preDelay = 10; move16(); diff --git a/lib_rend/ivas_rom_binauralRenderer.h b/lib_rend/ivas_rom_binauralRenderer.h index 4b1428ac8..39dd9556d 100644 --- a/lib_rend/ivas_rom_binauralRenderer.h +++ b/lib_rend/ivas_rom_binauralRenderer.h @@ -72,12 +72,20 @@ extern Word32 rightBRIRReal_fx[BINAURAL_CONVBANDS][HRTF_LS_CHANNELS][BINAURAL_NT extern Word32 rightBRIRImag_fx[BINAURAL_CONVBANDS][HRTF_LS_CHANNELS][BINAURAL_NTAPS_MAX]; /* Q29 */ /* Reverberation parameters based on BRIRs for fastconv */ +#ifdef FIX_1741_REVERB_TIMES_Q_FORMAT +extern Word32 fastconvReverberationTimes_fx[CLDFB_NO_CHANNELS_MAX]; /* Q27 */ +#else extern Word32 fastconvReverberationTimes_fx[CLDFB_NO_CHANNELS_MAX]; /* Q31 */ +#endif extern Word32 fastconvReverberationEneCorrections_fx[CLDFB_NO_CHANNELS_MAX]; /* Q31 */ /* Binaural rendering data set based on BRIRs, to be used in a combined manner * with the above binaural rendering data set based on HRIRs for parametric * renderer */ +#ifdef FIX_1741_REVERB_TIMES_Q_FORMAT +extern const Word32 parametricReverberationTimes_fx[CLDFB_NO_CHANNELS_MAX]; /* Q27 */ +#else extern const Word32 parametricReverberationTimes_fx[CLDFB_NO_CHANNELS_MAX]; /* Q31 */ +#endif extern const Word32 parametricReverberationEneCorrections_fx[CLDFB_NO_CHANNELS_MAX]; /* Q31 */ extern const Word32 parametricEarlyPartEneCorrection_fx[CLDFB_NO_CHANNELS_MAX]; /* Q28 */ diff --git a/lib_rend/ivas_rom_binauralRenderer_fx.c b/lib_rend/ivas_rom_binauralRenderer_fx.c index e7dbbae70..dbec56202 100644 --- a/lib_rend/ivas_rom_binauralRenderer_fx.c +++ b/lib_rend/ivas_rom_binauralRenderer_fx.c @@ -47155,10 +47155,25 @@ const Word32 rightBRIRImag_fx[BINAURAL_CONVBANDS][HRTF_LS_CHANNELS][BINAURAL_NTA }, }; + +#ifdef FIX_1741_REVERB_TIMES_Q_FORMAT +const Word32 fastconvReverberationTimes_fx[CLDFB_NO_CHANNELS_MAX] /* Q27 */ = +{ + 57606384, 27529398, 27157346, 27968692, 28945932, 31748532, 30950340, 30655330, + 30530104, 29387776, 30344346, 29622122, 29729360, 29993770, 30025176, 30475880, + 30588086, 29940082, 29527900, 29337714, 29583868, 29293020, 28621930, 28230418, + 27839038, 26675774, 26340230, 26161316, 25546062, 24763170, 24203886, 23644734, + 23689428, 23834786, 24640094, 26295534, 27279754, 27973256, 28812118, 29527900, + 29919414, 30926046, 31397284, 31359570, 31720078, 31867046, 32430896, 32362310, + 32057502, 32532230, 33056752, 33010582, 33030982, 32936494, 32742548, 32765634, + 32114276, 32410092, 31517544, 33962452 +}; +#else const Word32 fastconvReverberationTimes_fx[CLDFB_NO_CHANNELS_MAX] /* Q31 */= { 921702144, 440470368, 434517536, 447499072, 463134912, 507976512, 495205440, 490485280, 488481664, 470204416, 485509536, 473953952, 475669760, 479900320, 480402816, 487614080, 489409376, 479041312, 472446400, 469403424, 473341888, 468688320, 457950880, 451686688, 445424608, 426812384, 421443680, 418581056, 408736992, 396210720, 387262176, 378315744, 379030848, 381356576, 394241504, 420728544, 436476064, 447572096, 460993888, 472446400, 478710624, 494816736, 502356544, 501753120, 507521248, 509872736, 518894336, 517796960, 512920032, 520515680, 528908032, 528169312, 528495712, 526983904, 523880768, 524250144, 513828416, 518561472, 504280704, 543399232 }; +#endif const Word32 fastconvReverberationEneCorrections_fx[CLDFB_NO_CHANNELS_MAX] /* Q31 */= @@ -47167,6 +47182,19 @@ const Word32 fastconvReverberationEneCorrections_fx[CLDFB_NO_CHANNELS_MAX] /* Q }; +#ifdef FIX_1741_REVERB_TIMES_Q_FORMAT +const Word32 parametricReverberationTimes_fx[CLDFB_NO_CHANNELS_MAX] /* Q27 */ = +{ + 46371420, 42876392, 44689268, 48442264, 50237560, 49764848, 48133832, 46721592, + 46051312, 44473180, 42480180, 40933052, 39574768, 38594172, 37570228, 36275964, + 35439116, 34413964, 33540876, 32486058, 31551098, 30822698, 30028532, 29366168, + 28534554, 27875546, 27122986, 26587726, 26025756, 24952150, 24518492, 24422258, + 24130736, 24035844, 23695066, 23129472, 22965056, 22542002, 22545088, 22710848, + 22459994, 22270210, 21953322, 21683948, 21260760, 21025342, 20850858, 20613158, + 20344186, 20127694, 19891604, 19655650, 19419694, 19183740, 18947786, 18711830, + 18475742, 18239786, 18003832, 17767878 +}; +#else const Word32 parametricReverberationTimes_fx[CLDFB_NO_CHANNELS_MAX] /* Q31 */= { 741942720,686022272,715028288,775076224,803800960,796237568,770141312,747545472,736820992, @@ -47177,6 +47205,7 @@ const Word32 parametricReverberationTimes_fx[CLDFB_NO_CHANNELS_MAX] /* Q31 */= 336405472,333613728,329810528,325506976,322043104,318265664,314490400,310715104,306939840, 303164576,299389280,295611872,291836576,288061312,284286048 }; +#endif const Word32 parametricReverberationEneCorrections_fx[CLDFB_NO_CHANNELS_MAX] /* Q31 */= diff --git a/lib_rend/ivas_stat_rend.h b/lib_rend/ivas_stat_rend.h index fd1945a3f..945421179 100644 --- a/lib_rend/ivas_stat_rend.h +++ b/lib_rend/ivas_stat_rend.h @@ -610,7 +610,11 @@ typedef struct ivas_hrtfs_parambin_struct Word16 hrtfShCoeffsRe_fx[BINAURAL_CHANNELS][HRTF_SH_CHANNELS][HRTF_NUM_BINS]; /* Q14 */ Word16 hrtfShCoeffsIm_fx[BINAURAL_CHANNELS][HRTF_SH_CHANNELS][HRTF_NUM_BINS]; /* Q14 */ +#ifdef FIX_1741_REVERB_TIMES_Q_FORMAT + Word32 parametricReverberationTimes_fx[CLDFB_NO_CHANNELS_MAX]; /* Q27 */ +#else Word32 parametricReverberationTimes_fx[CLDFB_NO_CHANNELS_MAX]; /* Q31 */ +#endif Word32 parametricReverberationEneCorrections_fx[CLDFB_NO_CHANNELS_MAX]; /* Q31 */ Word32 parametricEarlyPartEneCorrection_fx[CLDFB_NO_CHANNELS_MAX]; /* Q28 */ @@ -1454,7 +1458,11 @@ typedef struct ivas_hrtfs_fastconv_struct Word16 allocate_init_flag; /*Memory allocation flag 0: if the hrtf pointers are allocated at application level , 1: of allocated at ivas_binaural_hrtf_open() */ +#ifdef FIX_1741_REVERB_TIMES_Q_FORMAT + Word32 fastconvReverberationTimes_fx[CLDFB_NO_CHANNELS_MAX]; /* Q27 */ +#else Word32 fastconvReverberationTimes_fx[CLDFB_NO_CHANNELS_MAX]; /* Q31 */ +#endif Word32 fastconvReverberationEneCorrections_fx[CLDFB_NO_CHANNELS_MAX]; /* Q31 */ } HRTFS_FASTCONV, *HRTFS_FASTCONV_HANDLE; @@ -1465,7 +1473,11 @@ typedef struct ivas_hrtfs_parambin_struct Word16 hrtfShCoeffsRe_fx[BINAURAL_CHANNELS][HRTF_SH_CHANNELS][HRTF_NUM_BINS]; /* Q14 */ Word16 hrtfShCoeffsIm_fx[BINAURAL_CHANNELS][HRTF_SH_CHANNELS][HRTF_NUM_BINS]; /* Q14 */ +#ifdef FIX_1741_REVERB_TIMES_Q_FORMAT + Word32 parametricReverberationTimes_fx[CLDFB_NO_CHANNELS_MAX]; /* Q27 */ +#else Word32 parametricReverberationTimes_fx[CLDFB_NO_CHANNELS_MAX]; /* Q31 */ +#endif Word32 parametricReverberationEneCorrections_fx[CLDFB_NO_CHANNELS_MAX]; /* Q31 */ Word32 parametricEarlyPartEneCorrection_fx[CLDFB_NO_CHANNELS_MAX]; /* Q28 */ diff --git a/lib_util/hrtf_file_reader.c b/lib_util/hrtf_file_reader.c index 8648cfa73..b4f54ea40 100644 --- a/lib_util/hrtf_file_reader.c +++ b/lib_util/hrtf_file_reader.c @@ -1880,7 +1880,11 @@ static ivas_error create_fastconv_HRTF_from_rawdata( memcpy( f_tmp_brir_reverb, hrtf_data_rptr, CLDFB_NO_CHANNELS_MAX * sizeof( float ) ); hrtf_data_rptr += CLDFB_NO_CHANNELS_MAX * sizeof( float ); +#ifdef FIX_1741_REVERB_TIMES_Q_FORMAT + floatToFixed_arrL( f_tmp_brir_reverb, ( *hHRTF )->fastconvReverberationTimes_fx, Q27, CLDFB_NO_CHANNELS_MAX ); +#else floatToFixed_arrL( f_tmp_brir_reverb, ( *hHRTF )->fastconvReverberationTimes_fx, Q31, CLDFB_NO_CHANNELS_MAX ); +#endif memcpy( f_tmp_brir_reverb, hrtf_data_rptr, CLDFB_NO_CHANNELS_MAX * sizeof( float ) ); floatToFixed_arrL( f_tmp_brir_reverb, ( *hHRTF )->fastconvReverberationEneCorrections_fx, Q31, CLDFB_NO_CHANNELS_MAX ); @@ -2044,7 +2048,11 @@ static ivas_error create_parambin_HRTF_from_rawdata( memcpy( f_tmp_reverb, hrtf_data_rptr, CLDFB_NO_CHANNELS_MAX * sizeof( float ) ); hrtf_data_rptr += CLDFB_NO_CHANNELS_MAX * sizeof( float ); /*adding conversion as file reading is done in float*/ +#ifdef FIX_1741_REVERB_TIMES_Q_FORMAT + floatToFixed_arrL( f_tmp_reverb, ( *hHRTF )->parametricReverberationTimes_fx, Q27, CLDFB_NO_CHANNELS_MAX ); +#else floatToFixed_arrL( f_tmp_reverb, ( *hHRTF )->parametricReverberationTimes_fx, Q31, CLDFB_NO_CHANNELS_MAX ); +#endif memcpy( f_tmp_reverb, hrtf_data_rptr, CLDFB_NO_CHANNELS_MAX * sizeof( float ) ); hrtf_data_rptr += CLDFB_NO_CHANNELS_MAX * sizeof( float ); -- GitLab From bcf32b297b796bc03b3de49f28c13ec4c970f5b0 Mon Sep 17 00:00:00 2001 From: Marek Szczerba Date: Fri, 27 Jun 2025 17:10:57 +0200 Subject: [PATCH 07/12] Minor update --- .../3.31.5/CompilerIdC/CMakeCCompilerId.c | 904 ------------------ 1 file changed, 904 deletions(-) delete mode 100644 build/CMakeFiles/3.31.5/CompilerIdC/CMakeCCompilerId.c diff --git a/build/CMakeFiles/3.31.5/CompilerIdC/CMakeCCompilerId.c b/build/CMakeFiles/3.31.5/CompilerIdC/CMakeCCompilerId.c deleted file mode 100644 index 8d8bb038b..000000000 --- a/build/CMakeFiles/3.31.5/CompilerIdC/CMakeCCompilerId.c +++ /dev/null @@ -1,904 +0,0 @@ -#ifdef __cplusplus -# error "A C++ compiler has been selected for C." -#endif - -#if defined(__18CXX) -# define ID_VOID_MAIN -#endif -#if defined(__CLASSIC_C__) -/* cv-qualifiers did not exist in K&R C */ -# define const -# define volatile -#endif - -#if !defined(__has_include) -/* If the compiler does not have __has_include, pretend the answer is - always no. */ -# define __has_include(x) 0 -#endif - - -/* Version number components: V=Version, R=Revision, P=Patch - Version date components: YYYY=Year, MM=Month, DD=Day */ - -#if defined(__INTEL_COMPILER) || defined(__ICC) -# define COMPILER_ID "Intel" -# if defined(_MSC_VER) -# define SIMULATE_ID "MSVC" -# endif -# if defined(__GNUC__) -# define SIMULATE_ID "GNU" -# endif - /* __INTEL_COMPILER = VRP prior to 2021, and then VVVV for 2021 and later, - except that a few beta releases use the old format with V=2021. */ -# if __INTEL_COMPILER < 2021 || __INTEL_COMPILER == 202110 || __INTEL_COMPILER == 202111 -# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100) -# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10) -# if defined(__INTEL_COMPILER_UPDATE) -# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER_UPDATE) -# else -# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10) -# endif -# else -# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER) -# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER_UPDATE) - /* The third version component from --version is an update index, - but no macro is provided for it. */ -# define COMPILER_VERSION_PATCH DEC(0) -# endif -# if defined(__INTEL_COMPILER_BUILD_DATE) - /* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */ -# define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE) -# endif -# if defined(_MSC_VER) - /* _MSC_VER = VVRR */ -# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) -# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) -# endif -# if defined(__GNUC__) -# define SIMULATE_VERSION_MAJOR DEC(__GNUC__) -# elif defined(__GNUG__) -# define SIMULATE_VERSION_MAJOR DEC(__GNUG__) -# endif -# if defined(__GNUC_MINOR__) -# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__) -# endif -# if defined(__GNUC_PATCHLEVEL__) -# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) -# endif - -#elif (defined(__clang__) && defined(__INTEL_CLANG_COMPILER)) || defined(__INTEL_LLVM_COMPILER) -# define COMPILER_ID "IntelLLVM" -#if defined(_MSC_VER) -# define SIMULATE_ID "MSVC" -#endif -#if defined(__GNUC__) -# define SIMULATE_ID "GNU" -#endif -/* __INTEL_LLVM_COMPILER = VVVVRP prior to 2021.2.0, VVVVRRPP for 2021.2.0 and - * later. Look for 6 digit vs. 8 digit version number to decide encoding. - * VVVV is no smaller than the current year when a version is released. - */ -#if __INTEL_LLVM_COMPILER < 1000000L -# define COMPILER_VERSION_MAJOR DEC(__INTEL_LLVM_COMPILER/100) -# define COMPILER_VERSION_MINOR DEC(__INTEL_LLVM_COMPILER/10 % 10) -# define COMPILER_VERSION_PATCH DEC(__INTEL_LLVM_COMPILER % 10) -#else -# define COMPILER_VERSION_MAJOR DEC(__INTEL_LLVM_COMPILER/10000) -# define COMPILER_VERSION_MINOR DEC(__INTEL_LLVM_COMPILER/100 % 100) -# define COMPILER_VERSION_PATCH DEC(__INTEL_LLVM_COMPILER % 100) -#endif -#if defined(_MSC_VER) - /* _MSC_VER = VVRR */ -# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) -# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) -#endif -#if defined(__GNUC__) -# define SIMULATE_VERSION_MAJOR DEC(__GNUC__) -#elif defined(__GNUG__) -# define SIMULATE_VERSION_MAJOR DEC(__GNUG__) -#endif -#if defined(__GNUC_MINOR__) -# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__) -#endif -#if defined(__GNUC_PATCHLEVEL__) -# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) -#endif - -#elif defined(__PATHCC__) -# define COMPILER_ID "PathScale" -# define COMPILER_VERSION_MAJOR DEC(__PATHCC__) -# define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__) -# if defined(__PATHCC_PATCHLEVEL__) -# define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__) -# endif - -#elif defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__) -# define COMPILER_ID "Embarcadero" -# define COMPILER_VERSION_MAJOR HEX(__CODEGEARC_VERSION__>>24 & 0x00FF) -# define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF) -# define COMPILER_VERSION_PATCH DEC(__CODEGEARC_VERSION__ & 0xFFFF) - -#elif defined(__BORLANDC__) -# define COMPILER_ID "Borland" - /* __BORLANDC__ = 0xVRR */ -# define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8) -# define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF) - -#elif defined(__WATCOMC__) && __WATCOMC__ < 1200 -# define COMPILER_ID "Watcom" - /* __WATCOMC__ = VVRR */ -# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100) -# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) -# if (__WATCOMC__ % 10) > 0 -# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) -# endif - -#elif defined(__WATCOMC__) -# define COMPILER_ID "OpenWatcom" - /* __WATCOMC__ = VVRP + 1100 */ -# define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100) -# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) -# if (__WATCOMC__ % 10) > 0 -# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) -# endif - -#elif defined(__SUNPRO_C) -# define COMPILER_ID "SunPro" -# if __SUNPRO_C >= 0x5100 - /* __SUNPRO_C = 0xVRRP */ -# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>12) -# define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xFF) -# define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF) -# else - /* __SUNPRO_CC = 0xVRP */ -# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>8) -# define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xF) -# define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF) -# endif - -#elif defined(__HP_cc) -# define COMPILER_ID "HP" - /* __HP_cc = VVRRPP */ -# define COMPILER_VERSION_MAJOR DEC(__HP_cc/10000) -# define COMPILER_VERSION_MINOR DEC(__HP_cc/100 % 100) -# define COMPILER_VERSION_PATCH DEC(__HP_cc % 100) - -#elif defined(__DECC) -# define COMPILER_ID "Compaq" - /* __DECC_VER = VVRRTPPPP */ -# define COMPILER_VERSION_MAJOR DEC(__DECC_VER/10000000) -# define COMPILER_VERSION_MINOR DEC(__DECC_VER/100000 % 100) -# define COMPILER_VERSION_PATCH DEC(__DECC_VER % 10000) - -#elif defined(__IBMC__) && defined(__COMPILER_VER__) -# define COMPILER_ID "zOS" - /* __IBMC__ = VRP */ -# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) -# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) -# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) - -#elif defined(__open_xl__) && defined(__clang__) -# define COMPILER_ID "IBMClang" -# define COMPILER_VERSION_MAJOR DEC(__open_xl_version__) -# define COMPILER_VERSION_MINOR DEC(__open_xl_release__) -# define COMPILER_VERSION_PATCH DEC(__open_xl_modification__) -# define COMPILER_VERSION_TWEAK DEC(__open_xl_ptf_fix_level__) - - -#elif defined(__ibmxl__) && defined(__clang__) -# define COMPILER_ID "XLClang" -# define COMPILER_VERSION_MAJOR DEC(__ibmxl_version__) -# define COMPILER_VERSION_MINOR DEC(__ibmxl_release__) -# define COMPILER_VERSION_PATCH DEC(__ibmxl_modification__) -# define COMPILER_VERSION_TWEAK DEC(__ibmxl_ptf_fix_level__) - - -#elif defined(__IBMC__) && !defined(__COMPILER_VER__) && __IBMC__ >= 800 -# define COMPILER_ID "XL" - /* __IBMC__ = VRP */ -# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) -# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) -# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) - -#elif defined(__IBMC__) && !defined(__COMPILER_VER__) && __IBMC__ < 800 -# define COMPILER_ID "VisualAge" - /* __IBMC__ = VRP */ -# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) -# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) -# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) - -#elif defined(__NVCOMPILER) -# define COMPILER_ID "NVHPC" -# define COMPILER_VERSION_MAJOR DEC(__NVCOMPILER_MAJOR__) -# define COMPILER_VERSION_MINOR DEC(__NVCOMPILER_MINOR__) -# if defined(__NVCOMPILER_PATCHLEVEL__) -# define COMPILER_VERSION_PATCH DEC(__NVCOMPILER_PATCHLEVEL__) -# endif - -#elif defined(__PGI) -# define COMPILER_ID "PGI" -# define COMPILER_VERSION_MAJOR DEC(__PGIC__) -# define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__) -# if defined(__PGIC_PATCHLEVEL__) -# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__) -# endif - -#elif defined(__clang__) && defined(__cray__) -# define COMPILER_ID "CrayClang" -# define COMPILER_VERSION_MAJOR DEC(__cray_major__) -# define COMPILER_VERSION_MINOR DEC(__cray_minor__) -# define COMPILER_VERSION_PATCH DEC(__cray_patchlevel__) -# define COMPILER_VERSION_INTERNAL_STR __clang_version__ - - -#elif defined(_CRAYC) -# define COMPILER_ID "Cray" -# define COMPILER_VERSION_MAJOR DEC(_RELEASE_MAJOR) -# define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR) - -#elif defined(__TI_COMPILER_VERSION__) -# define COMPILER_ID "TI" - /* __TI_COMPILER_VERSION__ = VVVRRRPPP */ -# define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000) -# define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000) -# define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000) - -#elif defined(__CLANG_FUJITSU) -# define COMPILER_ID "FujitsuClang" -# define COMPILER_VERSION_MAJOR DEC(__FCC_major__) -# define COMPILER_VERSION_MINOR DEC(__FCC_minor__) -# define COMPILER_VERSION_PATCH DEC(__FCC_patchlevel__) -# define COMPILER_VERSION_INTERNAL_STR __clang_version__ - - -#elif defined(__FUJITSU) -# define COMPILER_ID "Fujitsu" -# if defined(__FCC_version__) -# define COMPILER_VERSION __FCC_version__ -# elif defined(__FCC_major__) -# define COMPILER_VERSION_MAJOR DEC(__FCC_major__) -# define COMPILER_VERSION_MINOR DEC(__FCC_minor__) -# define COMPILER_VERSION_PATCH DEC(__FCC_patchlevel__) -# endif -# if defined(__fcc_version) -# define COMPILER_VERSION_INTERNAL DEC(__fcc_version) -# elif defined(__FCC_VERSION) -# define COMPILER_VERSION_INTERNAL DEC(__FCC_VERSION) -# endif - - -#elif defined(__ghs__) -# define COMPILER_ID "GHS" -/* __GHS_VERSION_NUMBER = VVVVRP */ -# ifdef __GHS_VERSION_NUMBER -# define COMPILER_VERSION_MAJOR DEC(__GHS_VERSION_NUMBER / 100) -# define COMPILER_VERSION_MINOR DEC(__GHS_VERSION_NUMBER / 10 % 10) -# define COMPILER_VERSION_PATCH DEC(__GHS_VERSION_NUMBER % 10) -# endif - -#elif defined(__TASKING__) -# define COMPILER_ID "Tasking" - # define COMPILER_VERSION_MAJOR DEC(__VERSION__/1000) - # define COMPILER_VERSION_MINOR DEC(__VERSION__ % 100) -# define COMPILER_VERSION_INTERNAL DEC(__VERSION__) - -#elif defined(__ORANGEC__) -# define COMPILER_ID "OrangeC" -# define COMPILER_VERSION_MAJOR DEC(__ORANGEC_MAJOR__) -# define COMPILER_VERSION_MINOR DEC(__ORANGEC_MINOR__) -# define COMPILER_VERSION_PATCH DEC(__ORANGEC_PATCHLEVEL__) - -#elif defined(__TINYC__) -# define COMPILER_ID "TinyCC" - -#elif defined(__BCC__) -# define COMPILER_ID "Bruce" - -#elif defined(__SCO_VERSION__) -# define COMPILER_ID "SCO" - -#elif defined(__ARMCC_VERSION) && !defined(__clang__) -# define COMPILER_ID "ARMCC" -#if __ARMCC_VERSION >= 1000000 - /* __ARMCC_VERSION = VRRPPPP */ - # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/1000000) - # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 100) - # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) -#else - /* __ARMCC_VERSION = VRPPPP */ - # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/100000) - # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 10) - # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) -#endif - - -#elif defined(__clang__) && defined(__apple_build_version__) -# define COMPILER_ID "AppleClang" -# if defined(_MSC_VER) -# define SIMULATE_ID "MSVC" -# endif -# define COMPILER_VERSION_MAJOR DEC(__clang_major__) -# define COMPILER_VERSION_MINOR DEC(__clang_minor__) -# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) -# if defined(_MSC_VER) - /* _MSC_VER = VVRR */ -# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) -# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) -# endif -# define COMPILER_VERSION_TWEAK DEC(__apple_build_version__) - -#elif defined(__clang__) && defined(__ARMCOMPILER_VERSION) -# define COMPILER_ID "ARMClang" - # define COMPILER_VERSION_MAJOR DEC(__ARMCOMPILER_VERSION/1000000) - # define COMPILER_VERSION_MINOR DEC(__ARMCOMPILER_VERSION/10000 % 100) - # define COMPILER_VERSION_PATCH DEC(__ARMCOMPILER_VERSION/100 % 100) -# define COMPILER_VERSION_INTERNAL DEC(__ARMCOMPILER_VERSION) - -#elif defined(__clang__) && defined(__ti__) -# define COMPILER_ID "TIClang" - # define COMPILER_VERSION_MAJOR DEC(__ti_major__) - # define COMPILER_VERSION_MINOR DEC(__ti_minor__) - # define COMPILER_VERSION_PATCH DEC(__ti_patchlevel__) -# define COMPILER_VERSION_INTERNAL DEC(__ti_version__) - -#elif defined(__clang__) -# define COMPILER_ID "Clang" -# if defined(_MSC_VER) -# define SIMULATE_ID "MSVC" -# endif -# define COMPILER_VERSION_MAJOR DEC(__clang_major__) -# define COMPILER_VERSION_MINOR DEC(__clang_minor__) -# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) -# if defined(_MSC_VER) - /* _MSC_VER = VVRR */ -# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) -# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) -# endif - -#elif defined(__LCC__) && (defined(__GNUC__) || defined(__GNUG__) || defined(__MCST__)) -# define COMPILER_ID "LCC" -# define COMPILER_VERSION_MAJOR DEC(__LCC__ / 100) -# define COMPILER_VERSION_MINOR DEC(__LCC__ % 100) -# if defined(__LCC_MINOR__) -# define COMPILER_VERSION_PATCH DEC(__LCC_MINOR__) -# endif -# if defined(__GNUC__) && defined(__GNUC_MINOR__) -# define SIMULATE_ID "GNU" -# define SIMULATE_VERSION_MAJOR DEC(__GNUC__) -# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__) -# if defined(__GNUC_PATCHLEVEL__) -# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) -# endif -# endif - -#elif defined(__GNUC__) -# define COMPILER_ID "GNU" -# define COMPILER_VERSION_MAJOR DEC(__GNUC__) -# if defined(__GNUC_MINOR__) -# define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__) -# endif -# if defined(__GNUC_PATCHLEVEL__) -# define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) -# endif - -#elif defined(_MSC_VER) -# define COMPILER_ID "MSVC" - /* _MSC_VER = VVRR */ -# define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100) -# define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100) -# if defined(_MSC_FULL_VER) -# if _MSC_VER >= 1400 - /* _MSC_FULL_VER = VVRRPPPPP */ -# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000) -# else - /* _MSC_FULL_VER = VVRRPPPP */ -# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000) -# endif -# endif -# if defined(_MSC_BUILD) -# define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD) -# endif - -#elif defined(_ADI_COMPILER) -# define COMPILER_ID "ADSP" -#if defined(__VERSIONNUM__) - /* __VERSIONNUM__ = 0xVVRRPPTT */ -# define COMPILER_VERSION_MAJOR DEC(__VERSIONNUM__ >> 24 & 0xFF) -# define COMPILER_VERSION_MINOR DEC(__VERSIONNUM__ >> 16 & 0xFF) -# define COMPILER_VERSION_PATCH DEC(__VERSIONNUM__ >> 8 & 0xFF) -# define COMPILER_VERSION_TWEAK DEC(__VERSIONNUM__ & 0xFF) -#endif - -#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) -# define COMPILER_ID "IAR" -# if defined(__VER__) && defined(__ICCARM__) -# define COMPILER_VERSION_MAJOR DEC((__VER__) / 1000000) -# define COMPILER_VERSION_MINOR DEC(((__VER__) / 1000) % 1000) -# define COMPILER_VERSION_PATCH DEC((__VER__) % 1000) -# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) -# elif defined(__VER__) && (defined(__ICCAVR__) || defined(__ICCRX__) || defined(__ICCRH850__) || defined(__ICCRL78__) || defined(__ICC430__) || defined(__ICCRISCV__) || defined(__ICCV850__) || defined(__ICC8051__) || defined(__ICCSTM8__)) -# define COMPILER_VERSION_MAJOR DEC((__VER__) / 100) -# define COMPILER_VERSION_MINOR DEC((__VER__) - (((__VER__) / 100)*100)) -# define COMPILER_VERSION_PATCH DEC(__SUBVERSION__) -# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) -# endif - -#elif defined(__SDCC_VERSION_MAJOR) || defined(SDCC) -# define COMPILER_ID "SDCC" -# if defined(__SDCC_VERSION_MAJOR) -# define COMPILER_VERSION_MAJOR DEC(__SDCC_VERSION_MAJOR) -# define COMPILER_VERSION_MINOR DEC(__SDCC_VERSION_MINOR) -# define COMPILER_VERSION_PATCH DEC(__SDCC_VERSION_PATCH) -# else - /* SDCC = VRP */ -# define COMPILER_VERSION_MAJOR DEC(SDCC/100) -# define COMPILER_VERSION_MINOR DEC(SDCC/10 % 10) -# define COMPILER_VERSION_PATCH DEC(SDCC % 10) -# endif - - -/* These compilers are either not known or too old to define an - identification macro. Try to identify the platform and guess that - it is the native compiler. */ -#elif defined(__hpux) || defined(__hpua) -# define COMPILER_ID "HP" - -#else /* unknown compiler */ -# define COMPILER_ID "" -#endif - -/* Construct the string literal in pieces to prevent the source from - getting matched. Store it in a pointer rather than an array - because some compilers will just produce instructions to fill the - array rather than assigning a pointer to a static array. */ -char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]"; -#ifdef SIMULATE_ID -char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]"; -#endif - -#ifdef __QNXNTO__ -char const* qnxnto = "INFO" ":" "qnxnto[]"; -#endif - -#if defined(__CRAYXT_COMPUTE_LINUX_TARGET) -char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]"; -#endif - -#define STRINGIFY_HELPER(X) #X -#define STRINGIFY(X) STRINGIFY_HELPER(X) - -/* Identify known platforms by name. */ -#if defined(__linux) || defined(__linux__) || defined(linux) -# define PLATFORM_ID "Linux" - -#elif defined(__MSYS__) -# define PLATFORM_ID "MSYS" - -#elif defined(__CYGWIN__) -# define PLATFORM_ID "Cygwin" - -#elif defined(__MINGW32__) -# define PLATFORM_ID "MinGW" - -#elif defined(__APPLE__) -# define PLATFORM_ID "Darwin" - -#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32) -# define PLATFORM_ID "Windows" - -#elif defined(__FreeBSD__) || defined(__FreeBSD) -# define PLATFORM_ID "FreeBSD" - -#elif defined(__NetBSD__) || defined(__NetBSD) -# define PLATFORM_ID "NetBSD" - -#elif defined(__OpenBSD__) || defined(__OPENBSD) -# define PLATFORM_ID "OpenBSD" - -#elif defined(__sun) || defined(sun) -# define PLATFORM_ID "SunOS" - -#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__) -# define PLATFORM_ID "AIX" - -#elif defined(__hpux) || defined(__hpux__) -# define PLATFORM_ID "HP-UX" - -#elif defined(__HAIKU__) -# define PLATFORM_ID "Haiku" - -#elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS) -# define PLATFORM_ID "BeOS" - -#elif defined(__QNX__) || defined(__QNXNTO__) -# define PLATFORM_ID "QNX" - -#elif defined(__tru64) || defined(_tru64) || defined(__TRU64__) -# define PLATFORM_ID "Tru64" - -#elif defined(__riscos) || defined(__riscos__) -# define PLATFORM_ID "RISCos" - -#elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__) -# define PLATFORM_ID "SINIX" - -#elif defined(__UNIX_SV__) -# define PLATFORM_ID "UNIX_SV" - -#elif defined(__bsdos__) -# define PLATFORM_ID "BSDOS" - -#elif defined(_MPRAS) || defined(MPRAS) -# define PLATFORM_ID "MP-RAS" - -#elif defined(__osf) || defined(__osf__) -# define PLATFORM_ID "OSF1" - -#elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv) -# define PLATFORM_ID "SCO_SV" - -#elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX) -# define PLATFORM_ID "ULTRIX" - -#elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX) -# define PLATFORM_ID "Xenix" - -#elif defined(__WATCOMC__) -# if defined(__LINUX__) -# define PLATFORM_ID "Linux" - -# elif defined(__DOS__) -# define PLATFORM_ID "DOS" - -# elif defined(__OS2__) -# define PLATFORM_ID "OS2" - -# elif defined(__WINDOWS__) -# define PLATFORM_ID "Windows3x" - -# elif defined(__VXWORKS__) -# define PLATFORM_ID "VxWorks" - -# else /* unknown platform */ -# define PLATFORM_ID -# endif - -#elif defined(__INTEGRITY) -# if defined(INT_178B) -# define PLATFORM_ID "Integrity178" - -# else /* regular Integrity */ -# define PLATFORM_ID "Integrity" -# endif - -# elif defined(_ADI_COMPILER) -# define PLATFORM_ID "ADSP" - -#else /* unknown platform */ -# define PLATFORM_ID - -#endif - -/* For windows compilers MSVC and Intel we can determine - the architecture of the compiler being used. This is because - the compilers do not have flags that can change the architecture, - but rather depend on which compiler is being used -*/ -#if defined(_WIN32) && defined(_MSC_VER) -# if defined(_M_IA64) -# define ARCHITECTURE_ID "IA64" - -# elif defined(_M_ARM64EC) -# define ARCHITECTURE_ID "ARM64EC" - -# elif defined(_M_X64) || defined(_M_AMD64) -# define ARCHITECTURE_ID "x64" - -# elif defined(_M_IX86) -# define ARCHITECTURE_ID "X86" - -# elif defined(_M_ARM64) -# define ARCHITECTURE_ID "ARM64" - -# elif defined(_M_ARM) -# if _M_ARM == 4 -# define ARCHITECTURE_ID "ARMV4I" -# elif _M_ARM == 5 -# define ARCHITECTURE_ID "ARMV5I" -# else -# define ARCHITECTURE_ID "ARMV" STRINGIFY(_M_ARM) -# endif - -# elif defined(_M_MIPS) -# define ARCHITECTURE_ID "MIPS" - -# elif defined(_M_SH) -# define ARCHITECTURE_ID "SHx" - -# else /* unknown architecture */ -# define ARCHITECTURE_ID "" -# endif - -#elif defined(__WATCOMC__) -# if defined(_M_I86) -# define ARCHITECTURE_ID "I86" - -# elif defined(_M_IX86) -# define ARCHITECTURE_ID "X86" - -# else /* unknown architecture */ -# define ARCHITECTURE_ID "" -# endif - -#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) -# if defined(__ICCARM__) -# define ARCHITECTURE_ID "ARM" - -# elif defined(__ICCRX__) -# define ARCHITECTURE_ID "RX" - -# elif defined(__ICCRH850__) -# define ARCHITECTURE_ID "RH850" - -# elif defined(__ICCRL78__) -# define ARCHITECTURE_ID "RL78" - -# elif defined(__ICCRISCV__) -# define ARCHITECTURE_ID "RISCV" - -# elif defined(__ICCAVR__) -# define ARCHITECTURE_ID "AVR" - -# elif defined(__ICC430__) -# define ARCHITECTURE_ID "MSP430" - -# elif defined(__ICCV850__) -# define ARCHITECTURE_ID "V850" - -# elif defined(__ICC8051__) -# define ARCHITECTURE_ID "8051" - -# elif defined(__ICCSTM8__) -# define ARCHITECTURE_ID "STM8" - -# else /* unknown architecture */ -# define ARCHITECTURE_ID "" -# endif - -#elif defined(__ghs__) -# if defined(__PPC64__) -# define ARCHITECTURE_ID "PPC64" - -# elif defined(__ppc__) -# define ARCHITECTURE_ID "PPC" - -# elif defined(__ARM__) -# define ARCHITECTURE_ID "ARM" - -# elif defined(__x86_64__) -# define ARCHITECTURE_ID "x64" - -# elif defined(__i386__) -# define ARCHITECTURE_ID "X86" - -# else /* unknown architecture */ -# define ARCHITECTURE_ID "" -# endif - -#elif defined(__clang__) && defined(__ti__) -# if defined(__ARM_ARCH) -# define ARCHITECTURE_ID "Arm" - -# else /* unknown architecture */ -# define ARCHITECTURE_ID "" -# endif - -#elif defined(__TI_COMPILER_VERSION__) -# if defined(__TI_ARM__) -# define ARCHITECTURE_ID "ARM" - -# elif defined(__MSP430__) -# define ARCHITECTURE_ID "MSP430" - -# elif defined(__TMS320C28XX__) -# define ARCHITECTURE_ID "TMS320C28x" - -# elif defined(__TMS320C6X__) || defined(_TMS320C6X) -# define ARCHITECTURE_ID "TMS320C6x" - -# else /* unknown architecture */ -# define ARCHITECTURE_ID "" -# endif - -# elif defined(__ADSPSHARC__) -# define ARCHITECTURE_ID "SHARC" - -# elif defined(__ADSPBLACKFIN__) -# define ARCHITECTURE_ID "Blackfin" - -#elif defined(__TASKING__) - -# if defined(__CTC__) || defined(__CPTC__) -# define ARCHITECTURE_ID "TriCore" - -# elif defined(__CMCS__) -# define ARCHITECTURE_ID "MCS" - -# elif defined(__CARM__) -# define ARCHITECTURE_ID "ARM" - -# elif defined(__CARC__) -# define ARCHITECTURE_ID "ARC" - -# elif defined(__C51__) -# define ARCHITECTURE_ID "8051" - -# elif defined(__CPCP__) -# define ARCHITECTURE_ID "PCP" - -# else -# define ARCHITECTURE_ID "" -# endif - -#else -# define ARCHITECTURE_ID -#endif - -/* Convert integer to decimal digit literals. */ -#define DEC(n) \ - ('0' + (((n) / 10000000)%10)), \ - ('0' + (((n) / 1000000)%10)), \ - ('0' + (((n) / 100000)%10)), \ - ('0' + (((n) / 10000)%10)), \ - ('0' + (((n) / 1000)%10)), \ - ('0' + (((n) / 100)%10)), \ - ('0' + (((n) / 10)%10)), \ - ('0' + ((n) % 10)) - -/* Convert integer to hex digit literals. */ -#define HEX(n) \ - ('0' + ((n)>>28 & 0xF)), \ - ('0' + ((n)>>24 & 0xF)), \ - ('0' + ((n)>>20 & 0xF)), \ - ('0' + ((n)>>16 & 0xF)), \ - ('0' + ((n)>>12 & 0xF)), \ - ('0' + ((n)>>8 & 0xF)), \ - ('0' + ((n)>>4 & 0xF)), \ - ('0' + ((n) & 0xF)) - -/* Construct a string literal encoding the version number. */ -#ifdef COMPILER_VERSION -char const* info_version = "INFO" ":" "compiler_version[" COMPILER_VERSION "]"; - -/* Construct a string literal encoding the version number components. */ -#elif defined(COMPILER_VERSION_MAJOR) -char const info_version[] = { - 'I', 'N', 'F', 'O', ':', - 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[', - COMPILER_VERSION_MAJOR, -# ifdef COMPILER_VERSION_MINOR - '.', COMPILER_VERSION_MINOR, -# ifdef COMPILER_VERSION_PATCH - '.', COMPILER_VERSION_PATCH, -# ifdef COMPILER_VERSION_TWEAK - '.', COMPILER_VERSION_TWEAK, -# endif -# endif -# endif - ']','\0'}; -#endif - -/* Construct a string literal encoding the internal version number. */ -#ifdef COMPILER_VERSION_INTERNAL -char const info_version_internal[] = { - 'I', 'N', 'F', 'O', ':', - 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','_', - 'i','n','t','e','r','n','a','l','[', - COMPILER_VERSION_INTERNAL,']','\0'}; -#elif defined(COMPILER_VERSION_INTERNAL_STR) -char const* info_version_internal = "INFO" ":" "compiler_version_internal[" COMPILER_VERSION_INTERNAL_STR "]"; -#endif - -/* Construct a string literal encoding the version number components. */ -#ifdef SIMULATE_VERSION_MAJOR -char const info_simulate_version[] = { - 'I', 'N', 'F', 'O', ':', - 's','i','m','u','l','a','t','e','_','v','e','r','s','i','o','n','[', - SIMULATE_VERSION_MAJOR, -# ifdef SIMULATE_VERSION_MINOR - '.', SIMULATE_VERSION_MINOR, -# ifdef SIMULATE_VERSION_PATCH - '.', SIMULATE_VERSION_PATCH, -# ifdef SIMULATE_VERSION_TWEAK - '.', SIMULATE_VERSION_TWEAK, -# endif -# endif -# endif - ']','\0'}; -#endif - -/* Construct the string literal in pieces to prevent the source from - getting matched. Store it in a pointer rather than an array - because some compilers will just produce instructions to fill the - array rather than assigning a pointer to a static array. */ -char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]"; -char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]"; - - - -#define C_STD_99 199901L -#define C_STD_11 201112L -#define C_STD_17 201710L -#define C_STD_23 202311L - -#ifdef __STDC_VERSION__ -# define C_STD __STDC_VERSION__ -#endif - -#if !defined(__STDC__) && !defined(__clang__) -# if defined(_MSC_VER) || defined(__ibmxl__) || defined(__IBMC__) -# define C_VERSION "90" -# else -# define C_VERSION -# endif -#elif C_STD > C_STD_17 -# define C_VERSION "23" -#elif C_STD > C_STD_11 -# define C_VERSION "17" -#elif C_STD > C_STD_99 -# define C_VERSION "11" -#elif C_STD >= C_STD_99 -# define C_VERSION "99" -#else -# define C_VERSION "90" -#endif -const char* info_language_standard_default = - "INFO" ":" "standard_default[" C_VERSION "]"; - -const char* info_language_extensions_default = "INFO" ":" "extensions_default[" -#if (defined(__clang__) || defined(__GNUC__) || defined(__xlC__) || \ - defined(__TI_COMPILER_VERSION__)) && \ - !defined(__STRICT_ANSI__) - "ON" -#else - "OFF" -#endif -"]"; - -/*--------------------------------------------------------------------------*/ - -#ifdef ID_VOID_MAIN -void main() {} -#else -# if defined(__CLASSIC_C__) -int main(argc, argv) int argc; char *argv[]; -# else -int main(int argc, char* argv[]) -# endif -{ - int require = 0; - require += info_compiler[argc]; - require += info_platform[argc]; - require += info_arch[argc]; -#ifdef COMPILER_VERSION_MAJOR - require += info_version[argc]; -#endif -#ifdef COMPILER_VERSION_INTERNAL - require += info_version_internal[argc]; -#endif -#ifdef SIMULATE_ID - require += info_simulate[argc]; -#endif -#ifdef SIMULATE_VERSION_MAJOR - require += info_simulate_version[argc]; -#endif -#if defined(__CRAYXT_COMPUTE_LINUX_TARGET) - require += info_cray[argc]; -#endif - require += info_language_standard_default[argc]; - require += info_language_extensions_default[argc]; - (void)argv; - return require; -} -#endif -- GitLab From 1fadc6836f9ea3f09f617cdd5b262c71485080f3 Mon Sep 17 00:00:00 2001 From: Marek Szczerba Date: Fri, 27 Jun 2025 17:20:46 +0200 Subject: [PATCH 08/12] To make clang happy --- .../ivas_dirac_dec_binaural_functions_fx.c | 4 ++-- lib_rend/ivas_reverb_fx.c | 18 +++++++++--------- lib_rend/ivas_rom_binauralRenderer.h | 8 ++++---- lib_rend/ivas_stat_rend.h | 12 ++++++------ 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/lib_rend/ivas_dirac_dec_binaural_functions_fx.c b/lib_rend/ivas_dirac_dec_binaural_functions_fx.c index 0b9e3750a..dbbe3ebd7 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions_fx.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions_fx.c @@ -504,9 +504,9 @@ ivas_error ivas_dirac_dec_binaural_copy_hrtfs_fx( } } #ifdef FIX_1741_REVERB_TIMES_Q_FORMAT - Copy32( parametricReverberationTimes_fx, hrtfParambin->parametricReverberationTimes_fx, CLDFB_NO_CHANNELS_MAX ); /*Q27*/ + Copy32( parametricReverberationTimes_fx, hrtfParambin->parametricReverberationTimes_fx, CLDFB_NO_CHANNELS_MAX ); /*Q27*/ #else - Copy32( parametricReverberationTimes_fx, hrtfParambin->parametricReverberationTimes_fx, CLDFB_NO_CHANNELS_MAX ); /*Q31*/ + Copy32( parametricReverberationTimes_fx, hrtfParambin->parametricReverberationTimes_fx, CLDFB_NO_CHANNELS_MAX ); /*Q31*/ #endif Copy32( parametricReverberationEneCorrections_fx, hrtfParambin->parametricReverberationEneCorrections_fx, CLDFB_NO_CHANNELS_MAX ); /*Q31*/ Copy32( parametricEarlyPartEneCorrection_fx, hrtfParambin->parametricEarlyPartEneCorrection_fx, CLDFB_NO_CHANNELS_MAX ); /*Q28*/ diff --git a/lib_rend/ivas_reverb_fx.c b/lib_rend/ivas_reverb_fx.c index 8fbe82abf..096517afc 100644 --- a/lib_rend/ivas_reverb_fx.c +++ b/lib_rend/ivas_reverb_fx.c @@ -220,11 +220,11 @@ static void ivas_binaural_reverb_setReverbTimes_fx( REVERB_STRUCT_HANDLE hReverb, /* i/o: binaural reverb handle */ const Word32 output_Fs, /* i : sampling_rate */ #ifdef FIX_1741_REVERB_TIMES_Q_FORMAT - const Word32 *revTimes_fx, /*Q27 i : reverberation times T60 for each CLDFB bin in seconds */ + const Word32 *revTimes_fx, /*Q27 i : reverberation times T60 for each CLDFB bin in seconds */ #else - const Word32 *revTimes_fx, /*Q31 i : reverberation times T60 for each CLDFB bin in seconds */ + const Word32 *revTimes_fx, /*Q31 i : reverberation times T60 for each CLDFB bin in seconds */ #endif - const Word32 *revEnes_fx /*Q31 i : spectrum for reverberated sound at each CLDFB bin */ + const Word32 *revEnes_fx /*Q31 i : spectrum for reverberated sound at each CLDFB bin */ ) { Word16 bin, ch, tap, sample; @@ -2395,12 +2395,12 @@ static ivas_error ivas_binaural_reverb_open_fx( const Word16 numCldfbSlotsPerFrame, /* i : Q0 number of CLDFB slots per frame */ const Word32 sampling_rate, /* i : Q0 sampling rate */ #ifdef FIX_1741_REVERB_TIMES_Q_FORMAT - const Word32 *revTimes_fx, /* i : Q27 reverberation times T60 for each CLDFB bin in seconds */ + const Word32 *revTimes_fx, /* i : Q27 reverberation times T60 for each CLDFB bin in seconds */ #else - const Word32 *revTimes_fx, /* i : Q31 reverberation times T60 for each CLDFB bin in seconds */ + const Word32 *revTimes_fx, /* i : Q31 reverberation times T60 for each CLDFB bin in seconds */ #endif - const Word32 *revEnes_fx, /* i : Q31 spectrum for reverberated sound at each CLDFB bin */ - const Word16 preDelay /* i : Q0 reverb pre-delay in CLDFB slots */ + const Word32 *revEnes_fx, /* i : Q31 spectrum for reverberated sound at each CLDFB bin */ + const Word16 preDelay /* i : Q0 reverb pre-delay in CLDFB slots */ ) { Word16 bin, chIdx, k, len, scale, tmp; @@ -2626,7 +2626,7 @@ ivas_error ivas_binaural_reverb_open_fastconv_fx( #ifdef FIX_1741_REVERB_TIMES_Q_FORMAT revTimes = hHrtfFastConv->fastconvReverberationTimes_fx; /*Q27*/ #else - revTimes = hHrtfFastConv->fastconvReverberationTimes_fx; /*Q31*/ + revTimes = hHrtfFastConv->fastconvReverberationTimes_fx; /*Q31*/ #endif revEne = hHrtfFastConv->fastconvReverberationEneCorrections_fx; /*Q31*/ preDelay = 10; @@ -2675,7 +2675,7 @@ ivas_error ivas_binaural_reverb_open_parambin( #ifdef FIX_1741_REVERB_TIMES_Q_FORMAT revTimes = hHrtfParambin->parametricReverberationTimes_fx; /*Q27*/ #else - revTimes = hHrtfParambin->parametricReverberationTimes_fx; /*Q31*/ + revTimes = hHrtfParambin->parametricReverberationTimes_fx; /*Q31*/ #endif revEne = hHrtfParambin->parametricReverberationEneCorrections_fx; /*Q31*/ preDelay = 10; diff --git a/lib_rend/ivas_rom_binauralRenderer.h b/lib_rend/ivas_rom_binauralRenderer.h index 39dd9556d..b4c05f9ff 100644 --- a/lib_rend/ivas_rom_binauralRenderer.h +++ b/lib_rend/ivas_rom_binauralRenderer.h @@ -73,9 +73,9 @@ extern Word32 rightBRIRImag_fx[BINAURAL_CONVBANDS][HRTF_LS_CHANNELS][BINAURAL_NT /* Reverberation parameters based on BRIRs for fastconv */ #ifdef FIX_1741_REVERB_TIMES_Q_FORMAT -extern Word32 fastconvReverberationTimes_fx[CLDFB_NO_CHANNELS_MAX]; /* Q27 */ +extern Word32 fastconvReverberationTimes_fx[CLDFB_NO_CHANNELS_MAX]; /* Q27 */ #else -extern Word32 fastconvReverberationTimes_fx[CLDFB_NO_CHANNELS_MAX]; /* Q31 */ +extern Word32 fastconvReverberationTimes_fx[CLDFB_NO_CHANNELS_MAX]; /* Q31 */ #endif extern Word32 fastconvReverberationEneCorrections_fx[CLDFB_NO_CHANNELS_MAX]; /* Q31 */ @@ -83,9 +83,9 @@ extern Word32 fastconvReverberationEneCorrections_fx[CLDFB_NO_CHANNELS_MAX]; /* * with the above binaural rendering data set based on HRIRs for parametric * renderer */ #ifdef FIX_1741_REVERB_TIMES_Q_FORMAT -extern const Word32 parametricReverberationTimes_fx[CLDFB_NO_CHANNELS_MAX]; /* Q27 */ +extern const Word32 parametricReverberationTimes_fx[CLDFB_NO_CHANNELS_MAX]; /* Q27 */ #else -extern const Word32 parametricReverberationTimes_fx[CLDFB_NO_CHANNELS_MAX]; /* Q31 */ +extern const Word32 parametricReverberationTimes_fx[CLDFB_NO_CHANNELS_MAX]; /* Q31 */ #endif extern const Word32 parametricReverberationEneCorrections_fx[CLDFB_NO_CHANNELS_MAX]; /* Q31 */ extern const Word32 parametricEarlyPartEneCorrection_fx[CLDFB_NO_CHANNELS_MAX]; /* Q28 */ diff --git a/lib_rend/ivas_stat_rend.h b/lib_rend/ivas_stat_rend.h index 945421179..ce8f9438d 100644 --- a/lib_rend/ivas_stat_rend.h +++ b/lib_rend/ivas_stat_rend.h @@ -611,9 +611,9 @@ typedef struct ivas_hrtfs_parambin_struct Word16 hrtfShCoeffsIm_fx[BINAURAL_CHANNELS][HRTF_SH_CHANNELS][HRTF_NUM_BINS]; /* Q14 */ #ifdef FIX_1741_REVERB_TIMES_Q_FORMAT - Word32 parametricReverberationTimes_fx[CLDFB_NO_CHANNELS_MAX]; /* Q27 */ + Word32 parametricReverberationTimes_fx[CLDFB_NO_CHANNELS_MAX]; /* Q27 */ #else - Word32 parametricReverberationTimes_fx[CLDFB_NO_CHANNELS_MAX]; /* Q31 */ + Word32 parametricReverberationTimes_fx[CLDFB_NO_CHANNELS_MAX]; /* Q31 */ #endif Word32 parametricReverberationEneCorrections_fx[CLDFB_NO_CHANNELS_MAX]; /* Q31 */ Word32 parametricEarlyPartEneCorrection_fx[CLDFB_NO_CHANNELS_MAX]; /* Q28 */ @@ -1459,9 +1459,9 @@ typedef struct ivas_hrtfs_fastconv_struct Word16 allocate_init_flag; /*Memory allocation flag 0: if the hrtf pointers are allocated at application level , 1: of allocated at ivas_binaural_hrtf_open() */ #ifdef FIX_1741_REVERB_TIMES_Q_FORMAT - Word32 fastconvReverberationTimes_fx[CLDFB_NO_CHANNELS_MAX]; /* Q27 */ + Word32 fastconvReverberationTimes_fx[CLDFB_NO_CHANNELS_MAX]; /* Q27 */ #else - Word32 fastconvReverberationTimes_fx[CLDFB_NO_CHANNELS_MAX]; /* Q31 */ + Word32 fastconvReverberationTimes_fx[CLDFB_NO_CHANNELS_MAX]; /* Q31 */ #endif Word32 fastconvReverberationEneCorrections_fx[CLDFB_NO_CHANNELS_MAX]; /* Q31 */ @@ -1474,9 +1474,9 @@ typedef struct ivas_hrtfs_parambin_struct Word16 hrtfShCoeffsIm_fx[BINAURAL_CHANNELS][HRTF_SH_CHANNELS][HRTF_NUM_BINS]; /* Q14 */ #ifdef FIX_1741_REVERB_TIMES_Q_FORMAT - Word32 parametricReverberationTimes_fx[CLDFB_NO_CHANNELS_MAX]; /* Q27 */ + Word32 parametricReverberationTimes_fx[CLDFB_NO_CHANNELS_MAX]; /* Q27 */ #else - Word32 parametricReverberationTimes_fx[CLDFB_NO_CHANNELS_MAX]; /* Q31 */ + Word32 parametricReverberationTimes_fx[CLDFB_NO_CHANNELS_MAX]; /* Q31 */ #endif Word32 parametricReverberationEneCorrections_fx[CLDFB_NO_CHANNELS_MAX]; /* Q31 */ Word32 parametricEarlyPartEneCorrection_fx[CLDFB_NO_CHANNELS_MAX]; /* Q28 */ -- GitLab From dc8a3c11e603cf0a50ceae017d19745675823248 Mon Sep 17 00:00:00 2001 From: Marek Szczerba Date: Mon, 30 Jun 2025 08:33:52 +0200 Subject: [PATCH 09/12] Updated Q-format fixed-point representation for RT60 reverberation times (Q27 -> Q26) --- lib_com/options.h | 2 +- .../ivas_dirac_dec_binaural_functions_fx.c | 2 +- lib_rend/ivas_reverb_fx.c | 20 +++++------ lib_rend/ivas_rom_binauralRenderer.h | 6 ++-- lib_rend/ivas_rom_binauralRenderer_fx.c | 35 +++++++++---------- lib_rend/ivas_stat_rend.h | 6 ++-- lib_util/hrtf_file_reader.c | 4 +-- 7 files changed, 37 insertions(+), 38 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index f262bea81..489192b1c 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -122,7 +122,7 @@ /* #define NONBE_FIX_991_PARAMBIN_BINARY_HRTF */ /* Nokia: issue #991: fix using of binary file HRTF in ParamBin (to activate when USE_NEW_HRTF_BINARY_FILE_FORMAT and FIX_777_COMBI_RENDER_CONFIG_FILE are on ) */ #define FIX_1024_REMOVE_PARAMMC_MIXING_MAT /* VA: issue 1024: remove unused function ivas_param_mc_get_mono_stereo_mixing_matrices() */ -#define FIX_1741_REVERB_TIMES_Q_FORMAT /* Philips: reverberation times in Q27 format instead of Q31 */ +#define FIX_1741_REVERB_TIMES_Q_FORMAT /* Philips: reverberation times in Q26 format instead of Q31 */ /* #################### End BASOP porting switches ############################ */ diff --git a/lib_rend/ivas_dirac_dec_binaural_functions_fx.c b/lib_rend/ivas_dirac_dec_binaural_functions_fx.c index dbbe3ebd7..75a8d4b23 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions_fx.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions_fx.c @@ -504,7 +504,7 @@ ivas_error ivas_dirac_dec_binaural_copy_hrtfs_fx( } } #ifdef FIX_1741_REVERB_TIMES_Q_FORMAT - Copy32( parametricReverberationTimes_fx, hrtfParambin->parametricReverberationTimes_fx, CLDFB_NO_CHANNELS_MAX ); /*Q27*/ + Copy32( parametricReverberationTimes_fx, hrtfParambin->parametricReverberationTimes_fx, CLDFB_NO_CHANNELS_MAX ); /*Q26*/ #else Copy32( parametricReverberationTimes_fx, hrtfParambin->parametricReverberationTimes_fx, CLDFB_NO_CHANNELS_MAX ); /*Q31*/ #endif diff --git a/lib_rend/ivas_reverb_fx.c b/lib_rend/ivas_reverb_fx.c index 096517afc..6ac12a98d 100644 --- a/lib_rend/ivas_reverb_fx.c +++ b/lib_rend/ivas_reverb_fx.c @@ -220,7 +220,7 @@ static void ivas_binaural_reverb_setReverbTimes_fx( REVERB_STRUCT_HANDLE hReverb, /* i/o: binaural reverb handle */ const Word32 output_Fs, /* i : sampling_rate */ #ifdef FIX_1741_REVERB_TIMES_Q_FORMAT - const Word32 *revTimes_fx, /*Q27 i : reverberation times T60 for each CLDFB bin in seconds */ + const Word32 *revTimes_fx, /*Q26 i : reverberation times T60 for each CLDFB bin in seconds */ #else const Word32 *revTimes_fx, /*Q31 i : reverberation times T60 for each CLDFB bin in seconds */ #endif @@ -329,7 +329,7 @@ static void ivas_binaural_reverb_setReverbTimes_fx( L_tmp = Mpy_32_32( 1677721600, revTimes_fx[bin] ); // e10 --> 800 * 2^21, + e0 tmp = BASOP_Util_Divide3232_Scale( 1073741824, L_tmp, &scale ); #ifdef FIX_1741_REVERB_TIMES_Q_FORMAT - scale = add( scale, sub( 1, 14 ) ); // revTimes_fx in Q27 + scale = add( scale, sub( 1, 15 ) ); // revTimes_fx in Q26 #else scale = add( scale, sub( 1, 10 ) ); #endif @@ -2395,7 +2395,7 @@ static ivas_error ivas_binaural_reverb_open_fx( const Word16 numCldfbSlotsPerFrame, /* i : Q0 number of CLDFB slots per frame */ const Word32 sampling_rate, /* i : Q0 sampling rate */ #ifdef FIX_1741_REVERB_TIMES_Q_FORMAT - const Word32 *revTimes_fx, /* i : Q27 reverberation times T60 for each CLDFB bin in seconds */ + const Word32 *revTimes_fx, /* i : Q26 reverberation times T60 for each CLDFB bin in seconds */ #else const Word32 *revTimes_fx, /* i : Q31 reverberation times T60 for each CLDFB bin in seconds */ #endif @@ -2459,9 +2459,9 @@ static ivas_error ivas_binaural_reverb_open_fx( /* Note: the resulted length is very sensitive to the precision of the constants below (e.g. 1.45 vs. 1.45f) */ // hReverb->loopBufLength[bin] = (int16_t) ( 1.45 * (int16_t) ( revTimes[bin] * 150.0 ) + 1 ); #ifdef FIX_1741_REVERB_TIMES_Q_FORMAT - Word32 L_tmp_BufLength = L_shl( L_shr( Mpy_32_32( revTimes_fx[bin], 1258291200 /*150.0 in Q23*/ ), 19 ), 19 ); - L_tmp_BufLength = L_add( Mpy_32_32( 1556925645 /*1.45 in Q30*/, L_tmp_BufLength ), ONE_IN_Q18 ); - hReverb->loopBufLength[bin] = (Word16) L_shr( L_tmp_BufLength, 18 ); /*Q0*/ + Word32 L_tmp_BufLength = L_shl( L_shr( Mpy_32_32( revTimes_fx[bin], 1258291200 /*150.0 in Q23*/ ), 18 ), 18 ); + L_tmp_BufLength = L_add( Mpy_32_32( 1556925645 /*1.45 in Q30*/, L_tmp_BufLength ), ONE_IN_Q17 ); + hReverb->loopBufLength[bin] = (Word16) L_shr( L_tmp_BufLength, 17 ); /*Q0*/ #else Word32 L_tmp_BufLength = L_shl( L_shr( Mpy_32_32( revTimes_fx[bin], 1258291200 /*150.0 in Q23*/ ), 23 ), 23 ); L_tmp_BufLength = L_add( Mpy_32_32( 1556925645 /*1.45 in Q30*/, L_tmp_BufLength ), ONE_IN_Q22 ); @@ -2560,7 +2560,7 @@ ivas_error ivas_binaural_reverb_init( preDelay = (int16_t) roundf( 48000.0f * roomAcoustics->acousticPreDelay / CLDFB_NO_CHANNELS_MAX ); #ifdef FIX_1741_REVERB_TIMES_Q_FORMAT - floatToFixed_arrL( t60_temp, t60, Q27, CLDFB_NO_CHANNELS_MAX ); + floatToFixed_arrL( t60_temp, t60, Q26, CLDFB_NO_CHANNELS_MAX ); #else floatToFixed_arrL( t60_temp, t60, Q31, CLDFB_NO_CHANNELS_MAX ); #endif @@ -2624,9 +2624,9 @@ ivas_error ivas_binaural_reverb_open_fastconv_fx( ELSE { #ifdef FIX_1741_REVERB_TIMES_Q_FORMAT - revTimes = hHrtfFastConv->fastconvReverberationTimes_fx; /*Q27*/ + revTimes = hHrtfFastConv->fastconvReverberationTimes_fx; /*Q26*/ #else - revTimes = hHrtfFastConv->fastconvReverberationTimes_fx; /*Q31*/ + revTimes = hHrtfFastConv->fastconvReverberationTimes_fx; /*Q31*/ #endif revEne = hHrtfFastConv->fastconvReverberationEneCorrections_fx; /*Q31*/ preDelay = 10; @@ -2673,7 +2673,7 @@ ivas_error ivas_binaural_reverb_open_parambin( ELSE { #ifdef FIX_1741_REVERB_TIMES_Q_FORMAT - revTimes = hHrtfParambin->parametricReverberationTimes_fx; /*Q27*/ + revTimes = hHrtfParambin->parametricReverberationTimes_fx; /*Q26*/ #else revTimes = hHrtfParambin->parametricReverberationTimes_fx; /*Q31*/ #endif diff --git a/lib_rend/ivas_rom_binauralRenderer.h b/lib_rend/ivas_rom_binauralRenderer.h index b4c05f9ff..27980b3f5 100644 --- a/lib_rend/ivas_rom_binauralRenderer.h +++ b/lib_rend/ivas_rom_binauralRenderer.h @@ -73,9 +73,9 @@ extern Word32 rightBRIRImag_fx[BINAURAL_CONVBANDS][HRTF_LS_CHANNELS][BINAURAL_NT /* Reverberation parameters based on BRIRs for fastconv */ #ifdef FIX_1741_REVERB_TIMES_Q_FORMAT -extern Word32 fastconvReverberationTimes_fx[CLDFB_NO_CHANNELS_MAX]; /* Q27 */ +extern Word32 fastconvReverberationTimes_fx[CLDFB_NO_CHANNELS_MAX]; /* Q26 */ #else -extern Word32 fastconvReverberationTimes_fx[CLDFB_NO_CHANNELS_MAX]; /* Q31 */ +extern Word32 fastconvReverberationTimes_fx[CLDFB_NO_CHANNELS_MAX]; /* Q31 */ #endif extern Word32 fastconvReverberationEneCorrections_fx[CLDFB_NO_CHANNELS_MAX]; /* Q31 */ @@ -83,7 +83,7 @@ extern Word32 fastconvReverberationEneCorrections_fx[CLDFB_NO_CHANNELS_MAX]; /* * with the above binaural rendering data set based on HRIRs for parametric * renderer */ #ifdef FIX_1741_REVERB_TIMES_Q_FORMAT -extern const Word32 parametricReverberationTimes_fx[CLDFB_NO_CHANNELS_MAX]; /* Q27 */ +extern const Word32 parametricReverberationTimes_fx[CLDFB_NO_CHANNELS_MAX]; /* Q26 */ #else extern const Word32 parametricReverberationTimes_fx[CLDFB_NO_CHANNELS_MAX]; /* Q31 */ #endif diff --git a/lib_rend/ivas_rom_binauralRenderer_fx.c b/lib_rend/ivas_rom_binauralRenderer_fx.c index dbec56202..7333868b0 100644 --- a/lib_rend/ivas_rom_binauralRenderer_fx.c +++ b/lib_rend/ivas_rom_binauralRenderer_fx.c @@ -47157,16 +47157,15 @@ const Word32 rightBRIRImag_fx[BINAURAL_CONVBANDS][HRTF_LS_CHANNELS][BINAURAL_NTA #ifdef FIX_1741_REVERB_TIMES_Q_FORMAT -const Word32 fastconvReverberationTimes_fx[CLDFB_NO_CHANNELS_MAX] /* Q27 */ = +const Word32 fastconvReverberationTimes_fx[CLDFB_NO_CHANNELS_MAX] /* Q26 */ = { - 57606384, 27529398, 27157346, 27968692, 28945932, 31748532, 30950340, 30655330, - 30530104, 29387776, 30344346, 29622122, 29729360, 29993770, 30025176, 30475880, - 30588086, 29940082, 29527900, 29337714, 29583868, 29293020, 28621930, 28230418, - 27839038, 26675774, 26340230, 26161316, 25546062, 24763170, 24203886, 23644734, - 23689428, 23834786, 24640094, 26295534, 27279754, 27973256, 28812118, 29527900, - 29919414, 30926046, 31397284, 31359570, 31720078, 31867046, 32430896, 32362310, - 32057502, 32532230, 33056752, 33010582, 33030982, 32936494, 32742548, 32765634, - 32114276, 32410092, 31517544, 33962452 + 28803192, 13764699, 13578673, 13984346, 14472966, 15874266, 15475170, 15327665, + 15265052, 14693888, 15172173, 14811061, 14864680, 14996885, 15012588, 15237940, + 15294043, 14970041, 14763950, 14668857, 14791934, 14646510, 14310965, 14115209, + 13919519, 13337887, 13170115, 13080658, 12773031, 12381585, 12101943, 11822367, + 11844714, 11917393, 12320047, 13147767, 13639877, 13986628, 14406059, 14763950, + 14959707, 15463023, 15698642, 15679785, 15860039, 15933523, 16215448, 16181155, + 16028751, 16266115, 16528376, 16505291, 16515491, 16468247, 16371274, 16382817 }; #else const Word32 fastconvReverberationTimes_fx[CLDFB_NO_CHANNELS_MAX] /* Q31 */= @@ -47183,16 +47182,16 @@ const Word32 fastconvReverberationEneCorrections_fx[CLDFB_NO_CHANNELS_MAX] /* Q #ifdef FIX_1741_REVERB_TIMES_Q_FORMAT -const Word32 parametricReverberationTimes_fx[CLDFB_NO_CHANNELS_MAX] /* Q27 */ = +const Word32 parametricReverberationTimes_fx[CLDFB_NO_CHANNELS_MAX] /* Q26 */ = { - 46371420, 42876392, 44689268, 48442264, 50237560, 49764848, 48133832, 46721592, - 46051312, 44473180, 42480180, 40933052, 39574768, 38594172, 37570228, 36275964, - 35439116, 34413964, 33540876, 32486058, 31551098, 30822698, 30028532, 29366168, - 28534554, 27875546, 27122986, 26587726, 26025756, 24952150, 24518492, 24422258, - 24130736, 24035844, 23695066, 23129472, 22965056, 22542002, 22545088, 22710848, - 22459994, 22270210, 21953322, 21683948, 21260760, 21025342, 20850858, 20613158, - 20344186, 20127694, 19891604, 19655650, 19419694, 19183740, 18947786, 18711830, - 18475742, 18239786, 18003832, 17767878 + 23185710, 21438196, 22344634, 24221132, 25118780, 24882424, 24066916, 23360796, + 23025656, 22236590, 21240090, 20466526, 19787384, 19297086, 18785114, 18137982, + 17719558, 17206982, 16770438, 16243029, 15775549, 15411349, 15014266, 14683084, + 14267277, 13937773, 13561493, 13293863, 13012878, 12476075, 12259246, 12211129, + 12065368, 12017922, 11847533, 11564736, 11482528, 11271001, 11272544, 11355424, + 11229997, 11135105, 10976661, 10841974, 10630380, 10512671, 10425429, 10306579, + 10172093, 10063847, 9945802, 9827825, 9709847, 9591870, 9473893, 9355915, + 9237871, 9119893, 9001916, 8883939 }; #else const Word32 parametricReverberationTimes_fx[CLDFB_NO_CHANNELS_MAX] /* Q31 */= diff --git a/lib_rend/ivas_stat_rend.h b/lib_rend/ivas_stat_rend.h index ce8f9438d..963d6dd8d 100644 --- a/lib_rend/ivas_stat_rend.h +++ b/lib_rend/ivas_stat_rend.h @@ -611,7 +611,7 @@ typedef struct ivas_hrtfs_parambin_struct Word16 hrtfShCoeffsIm_fx[BINAURAL_CHANNELS][HRTF_SH_CHANNELS][HRTF_NUM_BINS]; /* Q14 */ #ifdef FIX_1741_REVERB_TIMES_Q_FORMAT - Word32 parametricReverberationTimes_fx[CLDFB_NO_CHANNELS_MAX]; /* Q27 */ + Word32 parametricReverberationTimes_fx[CLDFB_NO_CHANNELS_MAX]; /* Q26 */ #else Word32 parametricReverberationTimes_fx[CLDFB_NO_CHANNELS_MAX]; /* Q31 */ #endif @@ -1459,7 +1459,7 @@ typedef struct ivas_hrtfs_fastconv_struct Word16 allocate_init_flag; /*Memory allocation flag 0: if the hrtf pointers are allocated at application level , 1: of allocated at ivas_binaural_hrtf_open() */ #ifdef FIX_1741_REVERB_TIMES_Q_FORMAT - Word32 fastconvReverberationTimes_fx[CLDFB_NO_CHANNELS_MAX]; /* Q27 */ + Word32 fastconvReverberationTimes_fx[CLDFB_NO_CHANNELS_MAX]; /* Q26 */ #else Word32 fastconvReverberationTimes_fx[CLDFB_NO_CHANNELS_MAX]; /* Q31 */ #endif @@ -1474,7 +1474,7 @@ typedef struct ivas_hrtfs_parambin_struct Word16 hrtfShCoeffsIm_fx[BINAURAL_CHANNELS][HRTF_SH_CHANNELS][HRTF_NUM_BINS]; /* Q14 */ #ifdef FIX_1741_REVERB_TIMES_Q_FORMAT - Word32 parametricReverberationTimes_fx[CLDFB_NO_CHANNELS_MAX]; /* Q27 */ + Word32 parametricReverberationTimes_fx[CLDFB_NO_CHANNELS_MAX]; /* Q26 */ #else Word32 parametricReverberationTimes_fx[CLDFB_NO_CHANNELS_MAX]; /* Q31 */ #endif diff --git a/lib_util/hrtf_file_reader.c b/lib_util/hrtf_file_reader.c index b4f54ea40..33f4e366e 100644 --- a/lib_util/hrtf_file_reader.c +++ b/lib_util/hrtf_file_reader.c @@ -1881,7 +1881,7 @@ static ivas_error create_fastconv_HRTF_from_rawdata( memcpy( f_tmp_brir_reverb, hrtf_data_rptr, CLDFB_NO_CHANNELS_MAX * sizeof( float ) ); hrtf_data_rptr += CLDFB_NO_CHANNELS_MAX * sizeof( float ); #ifdef FIX_1741_REVERB_TIMES_Q_FORMAT - floatToFixed_arrL( f_tmp_brir_reverb, ( *hHRTF )->fastconvReverberationTimes_fx, Q27, CLDFB_NO_CHANNELS_MAX ); + floatToFixed_arrL( f_tmp_brir_reverb, ( *hHRTF )->fastconvReverberationTimes_fx, Q26, CLDFB_NO_CHANNELS_MAX ); #else floatToFixed_arrL( f_tmp_brir_reverb, ( *hHRTF )->fastconvReverberationTimes_fx, Q31, CLDFB_NO_CHANNELS_MAX ); #endif @@ -2049,7 +2049,7 @@ static ivas_error create_parambin_HRTF_from_rawdata( hrtf_data_rptr += CLDFB_NO_CHANNELS_MAX * sizeof( float ); /*adding conversion as file reading is done in float*/ #ifdef FIX_1741_REVERB_TIMES_Q_FORMAT - floatToFixed_arrL( f_tmp_reverb, ( *hHRTF )->parametricReverberationTimes_fx, Q27, CLDFB_NO_CHANNELS_MAX ); + floatToFixed_arrL( f_tmp_reverb, ( *hHRTF )->parametricReverberationTimes_fx, Q26, CLDFB_NO_CHANNELS_MAX ); #else floatToFixed_arrL( f_tmp_reverb, ( *hHRTF )->parametricReverberationTimes_fx, Q31, CLDFB_NO_CHANNELS_MAX ); #endif -- GitLab From 1f39091542b1020be9e4f4ccaf977aa30400f81a Mon Sep 17 00:00:00 2001 From: Marek Szczerba Date: Mon, 30 Jun 2025 08:42:20 +0200 Subject: [PATCH 10/12] To make clang happy --- lib_rend/ivas_reverb_fx.c | 6 +++--- lib_rend/ivas_rom_binauralRenderer.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib_rend/ivas_reverb_fx.c b/lib_rend/ivas_reverb_fx.c index 6ac12a98d..d7dd26ec3 100644 --- a/lib_rend/ivas_reverb_fx.c +++ b/lib_rend/ivas_reverb_fx.c @@ -2624,9 +2624,9 @@ ivas_error ivas_binaural_reverb_open_fastconv_fx( ELSE { #ifdef FIX_1741_REVERB_TIMES_Q_FORMAT - revTimes = hHrtfFastConv->fastconvReverberationTimes_fx; /*Q26*/ + revTimes = hHrtfFastConv->fastconvReverberationTimes_fx; /*Q26*/ #else - revTimes = hHrtfFastConv->fastconvReverberationTimes_fx; /*Q31*/ + revTimes = hHrtfFastConv->fastconvReverberationTimes_fx; /*Q31*/ #endif revEne = hHrtfFastConv->fastconvReverberationEneCorrections_fx; /*Q31*/ preDelay = 10; @@ -2673,7 +2673,7 @@ ivas_error ivas_binaural_reverb_open_parambin( ELSE { #ifdef FIX_1741_REVERB_TIMES_Q_FORMAT - revTimes = hHrtfParambin->parametricReverberationTimes_fx; /*Q26*/ + revTimes = hHrtfParambin->parametricReverberationTimes_fx; /*Q26*/ #else revTimes = hHrtfParambin->parametricReverberationTimes_fx; /*Q31*/ #endif diff --git a/lib_rend/ivas_rom_binauralRenderer.h b/lib_rend/ivas_rom_binauralRenderer.h index 27980b3f5..4992cbb1f 100644 --- a/lib_rend/ivas_rom_binauralRenderer.h +++ b/lib_rend/ivas_rom_binauralRenderer.h @@ -75,7 +75,7 @@ extern Word32 rightBRIRImag_fx[BINAURAL_CONVBANDS][HRTF_LS_CHANNELS][BINAURAL_NT #ifdef FIX_1741_REVERB_TIMES_Q_FORMAT extern Word32 fastconvReverberationTimes_fx[CLDFB_NO_CHANNELS_MAX]; /* Q26 */ #else -extern Word32 fastconvReverberationTimes_fx[CLDFB_NO_CHANNELS_MAX]; /* Q31 */ +extern Word32 fastconvReverberationTimes_fx[CLDFB_NO_CHANNELS_MAX]; /* Q31 */ #endif extern Word32 fastconvReverberationEneCorrections_fx[CLDFB_NO_CHANNELS_MAX]; /* Q31 */ -- GitLab From 743d1c3b9230bce12688b2d267a177021ad8716f Mon Sep 17 00:00:00 2001 From: Marek Szczerba Date: Mon, 30 Jun 2025 14:49:38 +0200 Subject: [PATCH 11/12] Added ivas_reverb_interpolate_energies_fx, fixes in ivas_reverb_set_energies for the frequency grids --- lib_rend/ivas_prot_rend_fx.h | 14 +++++ lib_rend/ivas_reverb_filter_design_fx.c | 83 +++++++++++++++++++++++++ lib_rend/ivas_reverb_utils_fx.c | 30 +++++++++ 3 files changed, 127 insertions(+) diff --git a/lib_rend/ivas_prot_rend_fx.h b/lib_rend/ivas_prot_rend_fx.h index 9524f0904..3fc299761 100644 --- a/lib_rend/ivas_prot_rend_fx.h +++ b/lib_rend/ivas_prot_rend_fx.h @@ -1158,6 +1158,20 @@ void ivas_reverb_interpolate_acoustic_data_fx( Word16 *pOutput_t60_e, //output e Word16 *pOutput_dsr_e //output e ); +#ifdef FIX_1741_REVERB_TIMES_Q_FORMAT +void ivas_reverb_interpolate_energies_fx( + const Word16 input_table_size, + const Word32 *pInput_fc, //input in Q16 + const Word32 *pInput_ene_l, //input in Q28 + const Word32 *pInput_ene_r, //input in Q28 + const Word16 output_table_size, + const Word32 *pOutput_fc, + Word32 *pOutput_ene_l_m, // output m + Word32 *pOutput_ene_r_m, // output m + Word16 *pOutput_ene_l_e, //output e + Word16 *pOutput_ene_r_e //output e +); +#endif #ifndef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES void ivas_reverb_get_hrtf_set_properties_fx( Word32 **ppHrtf_set_L_re, diff --git a/lib_rend/ivas_reverb_filter_design_fx.c b/lib_rend/ivas_reverb_filter_design_fx.c index 757108755..f2e03b800 100644 --- a/lib_rend/ivas_reverb_filter_design_fx.c +++ b/lib_rend/ivas_reverb_filter_design_fx.c @@ -920,6 +920,89 @@ void ivas_reverb_interpolate_acoustic_data_fx( return; } +#ifdef FIX_1741_REVERB_TIMES_Q_FORMAT +/*-------------------------------------------------------------------* + * ivas_reverb_interpolate_energies_fx() + * + * Interpolates data from the input average energy to the FFT pFilter uniform grid + * Note: the fc frequencies both for the input and the output must be in the ascending order + *-------------------------------------------------------------------*/ + + +void ivas_reverb_interpolate_energies_fx( + const Word16 input_table_size, + const Word32 *pInput_fc, // input in Q16 + const Word32 *pInput_ene_l, // input in Q28 + const Word32 *pInput_ene_r, // input in Q28 + const Word16 output_table_size, + const Word32 *pOutput_fc, // Q16 + Word32 *pOutput_ene_l_m, + Word32 *pOutput_ene_r_m, + Word16 *pOutput_ene_l_e, + Word16 *pOutput_ene_r_e +) +{ + Word16 input_idx, output_idx; + Word32 rel_offset; + Word16 rel_offset_e; + input_idx = 0; + move16(); + + FOR( output_idx = 0; output_idx < output_table_size; output_idx++ ) + { + /* if the bin frequency is lower than the 1st frequency point in the input table, take this 1st point */ + IF( LT_32( pOutput_fc[output_idx], pInput_fc[0] ) ) + { + input_idx = 0; + move16(); + rel_offset = 0; + move32(); + rel_offset_e = 0; + move16(); + } + ELSE + { + /* if the bin frequency is higher than the last frequency point in the input table, take this last point */ + IF( GT_32( pOutput_fc[output_idx], pInput_fc[input_table_size - 1] ) ) + { + input_idx = sub( input_table_size, 2 ); + rel_offset = ONE_IN_Q30; // Q30; + move32(); + rel_offset_e = 1; + move16(); + } + /* otherwise use linear interpolation between 2 consecutive points in the input table */ + ELSE + { + WHILE( GT_32( pOutput_fc[output_idx], pInput_fc[input_idx + 1] ) ) + { + input_idx = add( input_idx, 1 ); + } + rel_offset = BASOP_Util_Divide3232_Scale( L_sub( pOutput_fc[output_idx], pInput_fc[input_idx] ), L_sub( pInput_fc[input_idx + 1], pInput_fc[input_idx] ), &rel_offset_e ); // q15 + rel_offset = L_shl_sat( rel_offset, add( 16, rel_offset_e ) ); + rel_offset_e = 0; + move16(); + } + } + Word32 mult1; + Word16 mult_e = 0; + move16(); + mult1 = Mpy_32_32( rel_offset, L_sub( pInput_ene_l[input_idx + 1], pInput_ene_l[input_idx] ) ); + pOutput_ene_l_m[output_idx] = BASOP_Util_Add_Mant32Exp( pInput_ene_l[input_idx], 3, mult1, add( 3, rel_offset_e ), &mult_e ); // 31 - (31 - rel_offset_e + 28 - 31) + move32(); + pOutput_ene_l_e[output_idx] = mult_e; + move16(); + + mult1 = Mpy_32_32( rel_offset, L_sub( pInput_ene_r[input_idx + 1], pInput_ene_r[input_idx] ) ); + pOutput_ene_r_m[output_idx] = BASOP_Util_Add_Mant32Exp( pInput_ene_r[input_idx], 3, mult1, add( 3, rel_offset_e ), &mult_e ); // 31 - (31 - rel_offset_e + 28 - 31) + move32(); + pOutput_ene_r_e[output_idx] = mult_e; + move16(); + } + + return; +} +#endif #ifndef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES /*-------------------------------------------------------------------* diff --git a/lib_rend/ivas_reverb_utils_fx.c b/lib_rend/ivas_reverb_utils_fx.c index 4a3c0477c..2c61d54df 100644 --- a/lib_rend/ivas_reverb_utils_fx.c +++ b/lib_rend/ivas_reverb_utils_fx.c @@ -305,6 +305,15 @@ static ivas_error ivas_reverb_get_fastconv_hrtf_set_energies( float avg_pwr_right_fft[FFT_SPECTRUM_SIZE]; #endif float input_fc[FFT_SPECTRUM_SIZE]; +#ifdef FIX_1741_REVERB_TIMES_Q_FORMAT + Word32 input_fc_fx[FFT_SPECTRUM_SIZE]; + Word32 output_fc_fx[CLDFB_NO_CHANNELS_MAX]; + Word32 avg_pwr_left_fx[CLDFB_NO_CHANNELS_MAX]; + Word16 avg_pwr_left_e[CLDFB_NO_CHANNELS_MAX]; + Word32 avg_pwr_right_fx[CLDFB_NO_CHANNELS_MAX]; + Word16 avg_pwr_right_e[CLDFB_NO_CHANNELS_MAX]; + const Word16 cldfb_freq_halfstep = MAX_SAMPLING_RATE / ( 4 * CLDFB_NO_CHANNELS_MAX ); +#endif #ifndef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES ivas_error error; @@ -320,7 +329,17 @@ static ivas_error ivas_reverb_get_fastconv_hrtf_set_energies( 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 ) ); +#ifdef FIX_1741_REVERB_TIMES_Q_FORMAT + input_fc_fx[freq_idx] = input_fc[freq_idx] * ONE_IN_Q16; +#endif + } + +#ifdef FIX_1741_REVERB_TIMES_Q_FORMAT + for ( freq_idx = 0; freq_idx < CLDFB_NO_CHANNELS_MAX; freq_idx++ ) + { + output_fc_fx[freq_idx] = ( ( freq_idx << 1 ) + 1 ) * cldfb_freq_halfstep * ONE_IN_Q16; } +#endif #else for ( freq_idx = 0; freq_idx < FFT_SPECTRUM_SIZE; freq_idx++ ) { @@ -329,6 +348,7 @@ static ivas_error ivas_reverb_get_fastconv_hrtf_set_energies( #endif #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES +#ifndef FIX_1741_REVERB_TIMES_Q_FORMAT Word32 *input_fc_fx = (Word32 *) malloc( 60 * sizeof( Word32 ) ); @@ -337,7 +357,9 @@ static ivas_error ivas_reverb_get_fastconv_hrtf_set_energies( Word16 *avg_pwr_right_e = (Word16 *) malloc( avg_pwr_len * sizeof( Word16 ) ); Word32 *avg_pwr_left_fx = (Word32 *) malloc( avg_pwr_len * sizeof( Word32 ) ); Word32 *avg_pwr_right_fx = (Word32 *) malloc( avg_pwr_len * sizeof( Word32 ) ); +#endif +#ifndef FIX_1741_REVERB_TIMES_Q_FORMAT for ( int i = 0; i < 60; i++ ) { input_fc_fx[i] = (Word32) input_fc[i] * ( 1 << 16 ); @@ -347,9 +369,15 @@ static ivas_error ivas_reverb_get_fastconv_hrtf_set_energies( { output_fc_fx[i] = (Word32) input_fc[i] * ONE_IN_Q16; } +#endif +#ifdef FIX_1741_REVERB_TIMES_Q_FORMAT + ivas_reverb_interpolate_energies_fx( avg_pwr_len, input_fc_fx, avg_pwr_l, avg_pwr_r, + CLDFB_NO_CHANNELS_MAX, output_fc_fx, avg_pwr_left_fx, avg_pwr_right_fx, avg_pwr_left_e, avg_pwr_right_e ); +#else ivas_reverb_interpolate_acoustic_data_fx( FFT_SPECTRUM_SIZE, input_fc_fx, avg_pwr_l, avg_pwr_r, CLDFB_NO_CHANNELS_MAX, output_fc_fx, avg_pwr_left_fx, avg_pwr_right_fx, avg_pwr_left_e, avg_pwr_right_e ); +#endif for ( int i = 0; i < 60; i++ ) { @@ -357,12 +385,14 @@ static ivas_error ivas_reverb_get_fastconv_hrtf_set_energies( avg_pwr_right[i] = (float) fabs( me2f( avg_pwr_right_fx[i], avg_pwr_right_e[i] ) ); } +#ifndef FIX_1741_REVERB_TIMES_Q_FORMAT free( input_fc_fx ); free( output_fc_fx ); free( avg_pwr_left_e ); free( avg_pwr_right_e ); free( avg_pwr_left_fx ); free( avg_pwr_right_fx ); +#endif #else if ( ( error = ivas_reverb_get_cldfb_hrtf_set_properties( input_audio_config, hHrtfFastConv, use_brir, sampling_rate, avg_pwr_left_fft, avg_pwr_right_fft ) ) != IVAS_ERR_OK ) -- GitLab From 63f05e3b060632fb2fbe4f51776bdc9a5b6bc582 Mon Sep 17 00:00:00 2001 From: Marek Szczerba Date: Mon, 30 Jun 2025 15:10:50 +0200 Subject: [PATCH 12/12] To make clang happy --- lib_rend/ivas_reverb_filter_design_fx.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib_rend/ivas_reverb_filter_design_fx.c b/lib_rend/ivas_reverb_filter_design_fx.c index f2e03b800..aacfb2009 100644 --- a/lib_rend/ivas_reverb_filter_design_fx.c +++ b/lib_rend/ivas_reverb_filter_design_fx.c @@ -931,7 +931,7 @@ void ivas_reverb_interpolate_acoustic_data_fx( void ivas_reverb_interpolate_energies_fx( const Word16 input_table_size, - const Word32 *pInput_fc, // input in Q16 + const Word32 *pInput_fc, // input in Q16 const Word32 *pInput_ene_l, // input in Q28 const Word32 *pInput_ene_r, // input in Q28 const Word16 output_table_size, @@ -939,8 +939,7 @@ void ivas_reverb_interpolate_energies_fx( Word32 *pOutput_ene_l_m, Word32 *pOutput_ene_r_m, Word16 *pOutput_ene_l_e, - Word16 *pOutput_ene_r_e -) + Word16 *pOutput_ene_r_e ) { Word16 input_idx, output_idx; Word32 rel_offset; -- GitLab