From d3413dd59d61a5038af81c2d84501de833b4e7d1 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 7 Feb 2024 20:49:19 +0100 Subject: [PATCH 01/16] [cleanup] accept FIX_638_ENERGIE_IAC_ROM_TABLES --- apps/decoder.c | 4 - apps/renderer.c | 4 - lib_com/options.h | 1 - lib_rend/ivas_objectRenderer_mix.c | 2 - lib_rend/ivas_rom_binaural_crend_head.c | 2 - lib_rend/ivas_rom_binaural_crend_head.h | 2 - lib_rend/ivas_rom_rend.c | 291 ------------------ lib_rend/ivas_rom_rend.h | 13 - lib_util/hrtf_file_reader.c | 86 ------ lib_util/hrtf_file_reader.h | 4 - .../generate_tables_from_rom_to_bin.c | 167 ---------- .../generate_crend_ivas_tables_from_sofa.c | 40 --- 12 files changed, 616 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index 91450bd5c0..ba01a78d2f 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -746,7 +746,6 @@ int main( #endif #ifndef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES #ifdef NONBE_FIX_BINARY_BINAURAL_READING if ( ( *hHrtfTD != NULL ) && ( error = load_reverb_binary( *hHrtfTD, hrtfReader ) ) != IVAS_ERR_OK ) { @@ -764,7 +763,6 @@ int main( } #endif #endif -#endif #ifndef NONBE_FIX_BINARY_BINAURAL_READING IVAS_DEC_HRTF_CREND_HANDLE hSetOfHRTF = NULL; @@ -855,7 +853,6 @@ int main( #endif #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES #ifdef NONBE_FIX_BINARY_BINAURAL_READING if ( ( error = IVAS_DEC_GetHrtfStatisticsHandle( hIvasDec, &hHrtfStatistics ) ) != IVAS_ERR_OK ) { @@ -881,7 +878,6 @@ int main( goto cleanup; } #endif -#endif #endif } diff --git a/apps/renderer.c b/apps/renderer.c index cd80a05c5c..9a5088afdb 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -1057,7 +1057,6 @@ int main( } #ifndef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES if ( ( hHrtfTD != NULL ) && ( error = load_reverb_binary( *hHrtfTD, hrtfFileReader ) ) != IVAS_ERR_OK ) { if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA ) @@ -1066,7 +1065,6 @@ int main( goto cleanup; } } -#endif #endif if ( ( error = IVAS_REND_GetHrtfCRendHandle( hIvasRend, &hSetOfHRTF ) ) != IVAS_ERR_OK ) @@ -1127,7 +1125,6 @@ int main( } #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES if ( ( error = IVAS_REND_GetHrtfStatisticsHandle( hIvasRend, &hHrtfStatistics ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nIVAS_REND_GetHrtfStatisticsHandle failed\n\n" ); @@ -1145,7 +1142,6 @@ int main( destroy_hrtf_statistics( hHrtfStatistics ); } } -#endif #endif } diff --git a/lib_com/options.h b/lib_com/options.h index cd786074fa..1c28244593 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -151,7 +151,6 @@ /*#define FIX_I4_OL_PITCH*/ /* fix open-loop pitch used for EVS core switching */ /*#define SPLIT_REND_WITH_HEAD_ROT */ /* Dlb,FhG: Split Rendering contributions 21 and 35 */ -#define FIX_638_ENERGIE_IAC_ROM_TABLES /* Orange: Missing left/right and coherence late reverb tables in binary format*/ #define FIX_WARNING_SPLIT_RENDER /* Orange: fix warning on windows build vscode */ #define FIX_INV_DIFFUSE_WEIGHT /* Orange : Fix error in energy compensation in late binaural reverb*/ #define FIX_20_MS_FRAME_LEN_TABLES_CONVERTER /* Orange : generate_tables_converter tools can generate rom for 5 and 20 ms frame length */ diff --git a/lib_rend/ivas_objectRenderer_mix.c b/lib_rend/ivas_objectRenderer_mix.c index 72d1921d62..9b5d2ba03e 100644 --- a/lib_rend/ivas_objectRenderer_mix.c +++ b/lib_rend/ivas_objectRenderer_mix.c @@ -38,9 +38,7 @@ #include "ivas_error.h" #include "wmc_auto.h" #include "ivas_rom_rend.h" -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES #include "ivas_rom_binaural_crend_head.h" -#endif #ifdef DEBUGGING #include "debug.h" #endif diff --git a/lib_rend/ivas_rom_binaural_crend_head.c b/lib_rend/ivas_rom_binaural_crend_head.c index 6cb087fa30..8d7be0295e 100644 --- a/lib_rend/ivas_rom_binaural_crend_head.c +++ b/lib_rend/ivas_rom_binaural_crend_head.c @@ -7228,7 +7228,6 @@ const float CRendBin_Combined_BRIR_coeff_diffuse_im_16kHz[BINAURAL_CHANNELS][247 }; -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES /********************** default HRIR reverb rom tables **********************/ @@ -7475,7 +7474,6 @@ const float defaultHRIR_right_avg_power_16kHz[LR_IAC_LENGTH_NR_FC_16KHZ] = 0.408843f, 0.386537f, 0.364127f, 0.342285f, 0.321676f, 0.302809f, 0.286016f, 0.271535f, 0.259640f, 0.250692f, 0.245099f, 0.243192f}; -#endif #undef WMC_TOOL_SKIP diff --git a/lib_rend/ivas_rom_binaural_crend_head.h b/lib_rend/ivas_rom_binaural_crend_head.h index 4c9f3587f5..ee16e94cd9 100644 --- a/lib_rend/ivas_rom_binaural_crend_head.h +++ b/lib_rend/ivas_rom_binaural_crend_head.h @@ -348,7 +348,6 @@ extern float CRendBin_Combined_BRIR_coeff_diffuse_re_16kHz[BINAURAL_CHANNELS][24 extern float CRendBin_Combined_BRIR_coeff_diffuse_im_16kHz[BINAURAL_CHANNELS][2474]; - #ifdef FIX_638_ENERGIE_IAC_ROM_TABLES /********************** default HRIR reverb rom tables **********************/ @@ -368,7 +367,6 @@ extern float defaultHRIR_coherence_16kHz[LR_IAC_LENGTH_NR_FC_16KHZ]; extern float defaultHRIR_left_avg_power_16kHz[LR_IAC_LENGTH_NR_FC_16KHZ]; extern float defaultHRIR_right_avg_power_16kHz[LR_IAC_LENGTH_NR_FC_16KHZ]; -#endif #endif /* _IVAS_ROM_BINAURAL_CREND_HEAD_ */ diff --git a/lib_rend/ivas_rom_rend.c b/lib_rend/ivas_rom_rend.c index b2e5ff7bfd..7dcfc4d061 100644 --- a/lib_rend/ivas_rom_rend.c +++ b/lib_rend/ivas_rom_rend.c @@ -300,297 +300,6 @@ const float SincTable[321] = 0.00000000f }; -#ifndef FIX_638_ENERGIE_IAC_ROM_TABLES - -const float defaultHRIR_coherence_48kHz[LR_IAC_LENGTH_NR_FC] = { - 0.983003f, 0.933450f, 0.789276f, 0.574420f, 0.340710f, 0.144220f, 0.018803f, 0.000000f, 0.000000f, - 0.000000f, 0.011939f, 0.035489f, 0.043188f, 0.042460f, 0.041788f, 0.038562f, 0.028911f, 0.017162f, - 0.011571f, 0.014176f, 0.019830f, 0.024590f, 0.029203f, 0.033346f, 0.033418f, 0.029627f, 0.027479f, - 0.027434f, 0.025152f, 0.019518f, 0.014728f, 0.014201f, 0.016131f, 0.016294f, 0.013154f, 0.008660f, - 0.005005f, 0.002594f, 0.001044f, 0.000207f, 0.000000f, 0.000000f, 0.000000f, 0.001110f, 0.003986f, - 0.007003f, 0.009546f, 0.011532f, 0.012412f, 0.011553f, 0.009156f, 0.006222f, 0.003565f, 0.001384f, - 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000032f, 0.000928f, 0.002118f, 0.003061f, 0.003575f, - 0.003780f, 0.003678f, 0.003110f, 0.002074f, 0.000856f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, - 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000217f, 0.000974f, 0.001807f, 0.002334f, - 0.002436f, 0.002105f, 0.001526f, 0.000907f, 0.000350f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, - 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, - 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000238f, 0.000852f, 0.001293f, - 0.001529f, 0.001533f, 0.001314f, 0.000954f, 0.000521f, 0.000155f, 0.000000f, 0.000000f, 0.000000f, - 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, - 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, - 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, - 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, - 0.000000f, 0.000000f, 0.000025f, 0.000284f, 0.000620f, 0.000949f, 0.001274f, 0.001606f, 0.001922f, - 0.002195f, 0.002438f, 0.002687f, 0.002944f, 0.003172f, 0.003371f, 0.003577f, 0.003779f, 0.003915f, - 0.003973f, 0.003980f, 0.003925f, 0.003766f, 0.003501f, 0.003165f, 0.002778f, 0.002326f, 0.001806f, - 0.001257f, 0.000714f, 0.000211f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, - 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, - 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, - 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, - 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000766f, 0.000537f, 0.000000f, - 0.001691f, 0.003307f, 0.001635f, 0.000000f, 0.001601f, 0.007549f, 0.000580f, 0.000000f, 0.002038f, - 0.010325f, 0.002155f, 0.000000f, 0.003524f, 0.009251f, 0.005131f, 0.000000f, 0.002286f, 0.006486f, - 0.005902f, 0.000000f, 0.000862f, 0.004570f, 0.004117f, 0.000000f, 0.000000f, 0.003237f, 0.001534f, - 0.000259f, 0.000199f, 0.001363f, 0.000878f, 0.000000f -}; - -const float defaultHRIR_left_avg_power_48kHz[LR_IAC_LENGTH_NR_FC] = { - 0.978675f, 0.972385f, 0.959650f, 0.951879f, 0.952823f, 0.955063f, 0.950664f, 0.942982f, 0.943810f, - 0.958261f, 0.974503f, 0.980941f, 0.976648f, 0.968551f, 0.962061f, 0.957250f, 0.952477f, 0.948144f, - 0.945467f, 0.943209f, 0.938266f, 0.930238f, 0.923288f, 0.921237f, 0.922151f, 0.920812f, 0.917157f, - 0.914639f, 0.914127f, 0.913461f, 0.911654f, 0.910596f, 0.912207f, 0.915559f, 0.917863f, 0.917787f, - 0.916699f, 0.916435f, 0.916819f, 0.916225f, 0.914005f, 0.911360f, 0.909508f, 0.908111f, 0.906186f, - 0.903433f, 0.900605f, 0.898518f, 0.896964f, 0.894917f, 0.891856f, 0.888506f, 0.885940f, 0.884055f, - 0.881583f, 0.877955f, 0.874417f, 0.872501f, 0.871444f, 0.869864f, 0.867858f, 0.866735f, 0.867122f, - 0.868200f, 0.868897f, 0.869335f, 0.870657f, 0.873538f, 0.877306f, 0.880880f, 0.884388f, 0.889165f, - 0.895880f, 0.903263f, 0.909833f, 0.916015f, 0.922891f, 0.930300f, 0.936807f, 0.941431f, 0.944709f, - 0.947777f, 0.950731f, 0.952379f, 0.951745f, 0.949423f, 0.946810f, 0.944141f, 0.940067f, 0.933702f, - 0.926635f, 0.920257f, 0.914054f, 0.906651f, 0.897863f, 0.888903f, 0.880740f, 0.872936f, 0.864423f, - 0.855129f, 0.846311f, 0.839117f, 0.833266f, 0.827747f, 0.822648f, 0.819728f, 0.819707f, 0.821561f, - 0.824008f, 0.827075f, 0.831626f, 0.837745f, 0.844233f, 0.849862f, 0.854703f, 0.859787f, 0.865473f, - 0.870700f, 0.874300f, 0.876656f, 0.879215f, 0.882133f, 0.883808f, 0.883431f, 0.881897f, 0.880360f, - 0.878707f, 0.875924f, 0.871595f, 0.866584f, 0.862066f, 0.858145f, 0.853844f, 0.848581f, 0.843210f, - 0.839021f, 0.835832f, 0.831948f, 0.826952f, 0.822178f, 0.818520f, 0.815229f, 0.811138f, 0.806307f, - 0.801887f, 0.798628f, 0.796047f, 0.793269f, 0.790369f, 0.788436f, 0.788212f, 0.789066f, 0.789775f, - 0.790300f, 0.791907f, 0.794977f, 0.798368f, 0.800889f, 0.802776f, 0.805127f, 0.808190f, 0.810879f, - 0.812195f, 0.812606f, 0.813423f, 0.814925f, 0.815870f, 0.815340f, 0.814251f, 0.814186f, 0.814754f, - 0.814664f, 0.813654f, 0.812703f, 0.812701f, 0.813418f, 0.813910f, 0.813739f, 0.813585f, 0.814454f, - 0.816299f, 0.817832f, 0.818221f, 0.818620f, 0.820797f, 0.824043f, 0.825888f, 0.826559f, 0.828411f, - 0.832083f, 0.835548f, 0.837384f, 0.838961f, 0.842275f, 0.846770f, 0.849996f, 0.851359f, 0.853124f, - 0.856257f, 0.857270f, 0.852207f, 0.842390f, 0.831251f, 0.816041f, 0.791907f, 0.759307f, 0.723333f, - 0.686290f, 0.644649f, 0.594838f, 0.539959f, 0.487712f, 0.440561f, 0.389905f, 0.323258f, 0.238454f, - 0.149256f, 0.077620f, 0.032652f, 0.010630f, 0.002462f, 0.000339f, 0.000025f, 0.000016f, 0.000016f, - 0.000015f, 0.000014f, 0.000011f, 0.000009f, 0.000009f, 0.000009f, 0.000007f, 0.000006f, 0.000006f, - 0.000007f, 0.000006f, 0.000005f, 0.000005f, 0.000006f, 0.000005f, 0.000005f, 0.000005f, 0.000005f, - 0.000005f, 0.000005f, 0.000005f, 0.000005f, 0.000005f, 0.000005f, 0.000005f, 0.000005f, 0.000005f, - 0.000005f, 0.000005f, 0.000005f, 0.000005f, 0.000005f -}; - -const float defaultHRIR_right_avg_power_48kHz[LR_IAC_LENGTH_NR_FC] = { - 0.978675f, 0.972385f, 0.959652f, 0.951882f, 0.952822f, 0.955062f, 0.950665f, 0.942984f, 0.943810f, - 0.958262f, 0.974501f, 0.980942f, 0.976647f, 0.968551f, 0.962062f, 0.957251f, 0.952476f, 0.948141f, - 0.945464f, 0.943208f, 0.938265f, 0.930238f, 0.923288f, 0.921237f, 0.922151f, 0.920812f, 0.917158f, - 0.914639f, 0.914125f, 0.913460f, 0.911652f, 0.910595f, 0.912207f, 0.915559f, 0.917865f, 0.917788f, - 0.916698f, 0.916433f, 0.916818f, 0.916224f, 0.914005f, 0.911361f, 0.909504f, 0.908110f, 0.906186f, - 0.903433f, 0.900605f, 0.898518f, 0.896965f, 0.894920f, 0.891858f, 0.888507f, 0.885940f, 0.884054f, - 0.881580f, 0.877954f, 0.874417f, 0.872502f, 0.871442f, 0.869862f, 0.867858f, 0.866735f, 0.867123f, - 0.868201f, 0.868897f, 0.869333f, 0.870655f, 0.873539f, 0.877309f, 0.880883f, 0.884387f, 0.889165f, - 0.895880f, 0.903264f, 0.909834f, 0.916014f, 0.922893f, 0.930302f, 0.936809f, 0.941431f, 0.944709f, - 0.947777f, 0.950731f, 0.952378f, 0.951746f, 0.949421f, 0.946811f, 0.944145f, 0.940067f, 0.933700f, - 0.926637f, 0.920257f, 0.914054f, 0.906653f, 0.897864f, 0.888905f, 0.880742f, 0.872937f, 0.864423f, - 0.855128f, 0.846312f, 0.839118f, 0.833269f, 0.827748f, 0.822649f, 0.819728f, 0.819710f, 0.821561f, - 0.824007f, 0.827074f, 0.831626f, 0.837745f, 0.844232f, 0.849861f, 0.854703f, 0.859787f, 0.865474f, - 0.870700f, 0.874300f, 0.876658f, 0.879216f, 0.882133f, 0.883807f, 0.883428f, 0.881895f, 0.880358f, - 0.878709f, 0.875925f, 0.871596f, 0.866586f, 0.862067f, 0.858144f, 0.853843f, 0.848581f, 0.843210f, - 0.839021f, 0.835833f, 0.831948f, 0.826952f, 0.822177f, 0.818518f, 0.815228f, 0.811137f, 0.806306f, - 0.801886f, 0.798627f, 0.796045f, 0.793268f, 0.790369f, 0.788437f, 0.788213f, 0.789064f, 0.789770f, - 0.790299f, 0.791906f, 0.794977f, 0.798369f, 0.800890f, 0.802778f, 0.805130f, 0.808191f, 0.810879f, - 0.812198f, 0.812607f, 0.813424f, 0.814926f, 0.815872f, 0.815339f, 0.814254f, 0.814188f, 0.814757f, - 0.814665f, 0.813653f, 0.812704f, 0.812700f, 0.813416f, 0.813908f, 0.813738f, 0.813584f, 0.814454f, - 0.816300f, 0.817832f, 0.818221f, 0.818620f, 0.820796f, 0.824044f, 0.825889f, 0.826559f, 0.828413f, - 0.832084f, 0.835548f, 0.837383f, 0.838960f, 0.842272f, 0.846766f, 0.849995f, 0.851358f, 0.853121f, - 0.856258f, 0.857268f, 0.852209f, 0.842391f, 0.831252f, 0.816040f, 0.791907f, 0.759307f, 0.723333f, - 0.686288f, 0.644648f, 0.594838f, 0.539959f, 0.487712f, 0.440562f, 0.389904f, 0.323259f, 0.238454f, - 0.149256f, 0.077620f, 0.032652f, 0.010630f, 0.002462f, 0.000339f, 0.000025f, 0.000016f, 0.000016f, - 0.000015f, 0.000014f, 0.000011f, 0.000009f, 0.000009f, 0.000009f, 0.000007f, 0.000006f, 0.000006f, - 0.000007f, 0.000006f, 0.000005f, 0.000005f, 0.000006f, 0.000005f, 0.000005f, 0.000005f, 0.000005f, - 0.000005f, 0.000005f, 0.000005f, 0.000005f, 0.000005f, 0.000005f, 0.000005f, 0.000005f, 0.000005f, - 0.000005f, 0.000005f, 0.000005f, 0.000005f, 0.000005f -}; - -const float defaultHRIR_coherence_32kHz[LR_IAC_LENGTH_NR_FC] = { - 0.976959f, 0.962817f, 0.892107f, 0.783427f, 0.649434f, 0.488372f, 0.336040f, 0.196803f, 0.094108f, - 0.016852f, 0.004815f, 0.000000f, 0.000000f, 0.000000f, 0.002703f, 0.009460f, 0.024631f, 0.038937f, - 0.041367f, 0.041308f, 0.039589f, 0.039056f, 0.037048f, 0.032828f, 0.024623f, 0.015933f, 0.009282f, - 0.007047f, 0.007754f, 0.011823f, 0.015553f, 0.018773f, 0.021834f, 0.024812f, 0.027619f, 0.028707f, - 0.028648f, 0.026125f, 0.024072f, 0.022724f, 0.022507f, 0.022144f, 0.020064f, 0.016587f, 0.012177f, - 0.009732f, 0.008764f, 0.010014f, 0.011423f, 0.012307f, 0.010938f, 0.008551f, 0.005485f, 0.002935f, - 0.001054f, 0.000176f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, - 0.000000f, 0.000000f, 0.000231f, 0.001386f, 0.003010f, 0.004946f, 0.006482f, 0.007843f, 0.008942f, - 0.009171f, 0.008905f, 0.007532f, 0.005772f, 0.003756f, 0.001923f, 0.000617f, 0.000103f, 0.000000f, - 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, - 0.000000f, 0.000265f, 0.000706f, 0.000947f, 0.001119f, 0.001185f, 0.001040f, 0.000772f, 0.000221f, - 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, - 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, - 0.000000f, 0.000099f, 0.000345f, 0.000565f, 0.000710f, 0.000581f, 0.000331f, 0.000000f, 0.000000f, - 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, - 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, - 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, - 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000098f, 0.000341f, 0.000584f, 0.000793f, - 0.000876f, 0.000853f, 0.000759f, 0.000512f, 0.000273f, 0.000045f, 0.000000f, 0.000000f, 0.000000f, - 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, - 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, - 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, - 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000011f, - 0.000039f, 0.000157f, 0.000303f, 0.000474f, 0.000664f, 0.000865f, 0.001073f, 0.001281f, 0.001488f, - 0.001698f, 0.001906f, 0.002099f, 0.002268f, 0.002421f, 0.002545f, 0.002666f, 0.002785f, 0.002898f, - 0.003010f, 0.003124f, 0.003262f, 0.003417f, 0.003642f, 0.003884f, 0.004155f, 0.004443f, 0.004744f, - 0.005073f, 0.005422f, 0.005784f, 0.006121f, 0.006428f, 0.006690f, 0.006905f, 0.007096f, 0.007241f, - 0.007305f, 0.007315f, 0.007117f, 0.006840f, 0.006446f, 0.005915f, 0.005314f, 0.004568f, 0.003781f, - 0.002967f, 0.002550f, 0.002355f, 0.002493f, 0.002520f -}; - -const float defaultHRIR_left_avg_power_32kHz[LR_IAC_LENGTH_NR_FC] = { - 1.042842f, 1.041052f, 1.032098f, 1.024347f, 1.017398f, 1.019204f, 1.022140f, 1.026773f, 1.026684f, - 1.024560f, 1.019019f, 1.016691f, 1.016507f, 1.025484f, 1.035123f, 1.045753f, 1.050401f, 1.052033f, - 1.047590f, 1.042551f, 1.037116f, 1.034266f, 1.031619f, 1.029278f, 1.025989f, 1.022575f, 1.019610f, - 1.017441f, 1.015805f, 1.012657f, 1.008261f, 1.001990f, 0.995937f, 0.990744f, 0.988777f, 0.988277f, - 0.988755f, 0.987563f, 0.985600f, 0.982481f, 0.980182f, 0.978414f, 0.977951f, 0.977129f, 0.976068f, - 0.974020f, 0.972563f, 0.971992f, 0.973446f, 0.975452f, 0.977643f, 0.978631f, 0.978818f, 0.977682f, - 0.976742f, 0.976096f, 0.975927f, 0.975729f, 0.974942f, 0.973370f, 0.971276f, 0.968762f, 0.966461f, - 0.964481f, 0.962731f, 0.960904f, 0.958549f, 0.955708f, 0.952543f, 0.949546f, 0.946857f, 0.944631f, - 0.942410f, 0.939998f, 0.936815f, 0.933278f, 0.929505f, 0.926271f, 0.923282f, 0.920659f, 0.917696f, - 0.914482f, 0.910602f, 0.906806f, 0.903065f, 0.900364f, 0.897894f, 0.895772f, 0.893323f, 0.890740f, - 0.887944f, 0.885641f, 0.883667f, 0.882835f, 0.882051f, 0.881336f, 0.880121f, 0.878813f, 0.877633f, - 0.877223f, 0.877327f, 0.878410f, 0.879421f, 0.880327f, 0.881091f, 0.882024f, 0.883779f, 0.886402f, - 0.889602f, 0.893152f, 0.896459f, 0.899400f, 0.902225f, 0.905146f, 0.908573f, 0.912109f, 0.915718f, - 0.918254f, 0.920227f, 0.921355f, 0.922089f, 0.922760f, 0.923576f, 0.924088f, 0.924398f, 0.923115f, - 0.921260f, 0.918548f, 0.915643f, 0.912707f, 0.909842f, 0.906416f, 0.902615f, 0.897332f, 0.891877f, - 0.886166f, 0.880998f, 0.875991f, 0.871078f, 0.865522f, 0.859537f, 0.852717f, 0.846083f, 0.839728f, - 0.833972f, 0.828308f, 0.822411f, 0.816009f, 0.809271f, 0.802578f, 0.796320f, 0.790714f, 0.785846f, - 0.781192f, 0.776652f, 0.772249f, 0.767939f, 0.764926f, 0.762667f, 0.761540f, 0.761326f, 0.761372f, - 0.761547f, 0.761950f, 0.762506f, 0.764263f, 0.766400f, 0.769105f, 0.771504f, 0.773645f, 0.775056f, - 0.776463f, 0.777865f, 0.779929f, 0.781942f, 0.783881f, 0.784915f, 0.785562f, 0.785567f, 0.785690f, - 0.785891f, 0.786286f, 0.786348f, 0.785912f, 0.784408f, 0.782509f, 0.780101f, 0.777798f, 0.775564f, - 0.773205f, 0.770446f, 0.767088f, 0.762953f, 0.758652f, 0.754459f, 0.750714f, 0.747266f, 0.743818f, - 0.740063f, 0.735847f, 0.731497f, 0.727285f, 0.723759f, 0.720587f, 0.717650f, 0.714166f, 0.710382f, - 0.706148f, 0.702029f, 0.698046f, 0.694494f, 0.690839f, 0.687115f, 0.682535f, 0.677735f, 0.672604f, - 0.667663f, 0.662868f, 0.658475f, 0.654061f, 0.649634f, 0.644689f, 0.639750f, 0.634821f, 0.630767f, - 0.627153f, 0.624422f, 0.621650f, 0.618850f, 0.615731f, 0.613069f, 0.611089f, 0.610598f, 0.610566f, - 0.610880f, 0.610933f, 0.610810f, 0.611930f, 0.614079f, 0.617771f, 0.622653f, 0.628199f, 0.635210f, - 0.645081f, 0.656860f, 0.669006f, 0.673510f, 0.666552f, 0.628172f, 0.575128f, 0.494850f, 0.413951f, - 0.332637f, 0.280816f, 0.241903f, 0.222353f, 0.218443f -}; - -const float defaultHRIR_right_avg_power_32kHz[LR_IAC_LENGTH_NR_FC] = { - 1.042841f, 1.041051f, 1.032097f, 1.024346f, 1.017399f, 1.019202f, 1.022138f, 1.026772f, 1.026684f, - 1.024560f, 1.019019f, 1.016691f, 1.016506f, 1.025485f, 1.035123f, 1.045752f, 1.050401f, 1.052034f, - 1.047590f, 1.042551f, 1.037115f, 1.034265f, 1.031619f, 1.029280f, 1.025989f, 1.022573f, 1.019609f, - 1.017441f, 1.015805f, 1.012660f, 1.008264f, 1.001991f, 0.995937f, 0.990744f, 0.988778f, 0.988278f, - 0.988755f, 0.987564f, 0.985601f, 0.982480f, 0.980182f, 0.978415f, 0.977952f, 0.977129f, 0.976065f, - 0.974019f, 0.972563f, 0.971995f, 0.973448f, 0.975452f, 0.977643f, 0.978632f, 0.978821f, 0.977685f, - 0.976745f, 0.976097f, 0.975927f, 0.975729f, 0.974941f, 0.973370f, 0.971276f, 0.968759f, 0.966457f, - 0.964480f, 0.962731f, 0.960906f, 0.958547f, 0.955706f, 0.952543f, 0.949546f, 0.946857f, 0.944629f, - 0.942409f, 0.939999f, 0.936815f, 0.933278f, 0.929507f, 0.926271f, 0.923280f, 0.920660f, 0.917696f, - 0.914481f, 0.910601f, 0.906806f, 0.903066f, 0.900365f, 0.897895f, 0.895772f, 0.893323f, 0.890740f, - 0.887942f, 0.885641f, 0.883669f, 0.882835f, 0.882049f, 0.881335f, 0.880120f, 0.878812f, 0.877632f, - 0.877223f, 0.877328f, 0.878410f, 0.879422f, 0.880327f, 0.881092f, 0.882026f, 0.883781f, 0.886402f, - 0.889601f, 0.893150f, 0.896457f, 0.899399f, 0.902224f, 0.905146f, 0.908576f, 0.912111f, 0.915716f, - 0.918254f, 0.920227f, 0.921354f, 0.922087f, 0.922759f, 0.923576f, 0.924090f, 0.924401f, 0.923115f, - 0.921259f, 0.918547f, 0.915643f, 0.912708f, 0.909842f, 0.906416f, 0.902617f, 0.897334f, 0.891879f, - 0.886167f, 0.881000f, 0.875992f, 0.871078f, 0.865522f, 0.859538f, 0.852719f, 0.846085f, 0.839728f, - 0.833972f, 0.828309f, 0.822411f, 0.816009f, 0.809271f, 0.802579f, 0.796321f, 0.790714f, 0.785846f, - 0.781192f, 0.776653f, 0.772250f, 0.767940f, 0.764926f, 0.762667f, 0.761541f, 0.761325f, 0.761371f, - 0.761548f, 0.761950f, 0.762504f, 0.764263f, 0.766400f, 0.769105f, 0.771504f, 0.773644f, 0.775054f, - 0.776461f, 0.777866f, 0.779929f, 0.781942f, 0.783879f, 0.784913f, 0.785561f, 0.785567f, 0.785690f, - 0.785891f, 0.786285f, 0.786348f, 0.785913f, 0.784409f, 0.782510f, 0.780102f, 0.777798f, 0.775563f, - 0.773206f, 0.770449f, 0.767089f, 0.762954f, 0.758652f, 0.754458f, 0.750712f, 0.747266f, 0.743818f, - 0.740062f, 0.735846f, 0.731497f, 0.727286f, 0.723759f, 0.720587f, 0.717649f, 0.714164f, 0.710381f, - 0.706148f, 0.702028f, 0.698044f, 0.694493f, 0.690838f, 0.687113f, 0.682535f, 0.677735f, 0.672602f, - 0.667662f, 0.662869f, 0.658476f, 0.654061f, 0.649632f, 0.644687f, 0.639749f, 0.634820f, 0.630767f, - 0.627154f, 0.624423f, 0.621650f, 0.618849f, 0.615732f, 0.613069f, 0.611090f, 0.610599f, 0.610566f, - 0.610881f, 0.610933f, 0.610811f, 0.611930f, 0.614078f, 0.617770f, 0.622653f, 0.628199f, 0.635210f, - 0.645082f, 0.656861f, 0.669007f, 0.673511f, 0.666551f, 0.628170f, 0.575125f, 0.494849f, 0.413951f, - 0.332639f, 0.280817f, 0.241904f, 0.222354f, 0.218443f -}; - - -const float defaultHRIR_coherence_16kHz[LR_IAC_LENGTH_NR_FC] = { - 0.969495f, 0.969495f, 0.955351f, 0.919989f, 0.884627f, 0.842799f, 0.775108f, 0.707416f, 0.639724f, - 0.559264f, 0.478804f, 0.398344f, 0.327187f, 0.258355f, 0.189524f, 0.134064f, 0.087519f, 0.040974f, - 0.011416f, 0.007339f, 0.003262f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, - 0.000000f, 0.002562f, 0.005763f, 0.008965f, 0.014937f, 0.022756f, 0.030575f, 0.035595f, 0.036416f, - 0.037238f, 0.037747f, 0.037005f, 0.036264f, 0.035523f, 0.035506f, 0.035489f, 0.035472f, 0.034043f, - 0.032261f, 0.030479f, 0.027264f, 0.023092f, 0.018921f, 0.015179f, 0.012080f, 0.008982f, 0.006557f, - 0.006827f, 0.007098f, 0.007368f, 0.009187f, 0.011006f, 0.012825f, 0.014250f, 0.015575f, 0.016901f, - 0.018085f, 0.019174f, 0.020264f, 0.021306f, 0.022276f, 0.023246f, 0.023984f, 0.023794f, 0.023604f, - 0.023414f, 0.022260f, 0.021105f, 0.019951f, 0.019250f, 0.018662f, 0.018074f, 0.017860f, 0.017894f, - 0.017928f, 0.017558f, 0.016581f, 0.015604f, 0.014403f, 0.012303f, 0.010203f, 0.008103f, 0.006887f, - 0.005671f, 0.004455f, 0.004657f, 0.005213f, 0.005769f, 0.006365f, 0.006987f, 0.007608f, 0.007649f, - 0.006819f, 0.005989f, 0.004992f, 0.003328f, 0.001664f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, - 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, - 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, - 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000038f, 0.000229f, - 0.000420f, 0.000610f, 0.001290f, 0.001970f, 0.002649f, 0.003127f, 0.003555f, 0.003982f, 0.004113f, - 0.004046f, 0.003978f, 0.003618f, 0.002820f, 0.002021f, 0.001296f, 0.000864f, 0.000432f, 0.000000f, - 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, - 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, - 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, - 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, - 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, - 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, - 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, - 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, - 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, - 0.000000f, 0.000000f, 0.000005f, 0.000011f, 0.000018f, 0.000743f, 0.001947f, 0.003152f, 0.004819f, - 0.007179f, 0.009539f, 0.012160f, 0.015826f, 0.019491f, 0.023157f, 0.028625f, 0.034093f, 0.039562f, - 0.046791f, 0.054462f, 0.062132f, 0.065200f, 0.065200f -}; - -const float defaultHRIR_left_avg_power_16kHz[LR_IAC_LENGTH_NR_FC] = { - 1.112848f, 1.112848f, 1.110615f, 1.105032f, 1.099449f, 1.094383f, 1.091385f, 1.088386f, 1.085388f, - 1.087986f, 1.090583f, 1.093181f, 1.095718f, 1.098238f, 1.100760f, 1.100829f, 1.099264f, 1.097699f, - 1.095677f, 1.092970f, 1.090263f, 1.088142f, 1.088367f, 1.088593f, 1.088819f, 1.092532f, 1.096246f, - 1.099959f, 1.104778f, 1.109873f, 1.114969f, 1.118806f, 1.121804f, 1.124803f, 1.125952f, 1.124327f, - 1.122702f, 1.120550f, 1.116291f, 1.112033f, 1.107774f, 1.105150f, 1.102527f, 1.099903f, 1.098607f, - 1.097642f, 1.096677f, 1.094771f, 1.092238f, 1.089705f, 1.086741f, 1.083131f, 1.079521f, 1.076294f, - 1.074604f, 1.072914f, 1.071224f, 1.070018f, 1.068812f, 1.067606f, 1.064075f, 1.059962f, 1.055849f, - 1.051324f, 1.046526f, 1.041727f, 1.038409f, 1.037312f, 1.036215f, 1.035479f, 1.036192f, 1.036905f, - 1.037618f, 1.035536f, 1.033453f, 1.031371f, 1.028051f, 1.024421f, 1.020792f, 1.018471f, 1.017022f, - 1.015574f, 1.014441f, 1.013780f, 1.013120f, 1.012053f, 1.009355f, 1.006658f, 1.003961f, 1.001331f, - 0.998701f, 0.996071f, 0.995600f, 0.995668f, 0.995737f, 0.996093f, 0.996641f, 0.997189f, 0.997005f, - 0.995722f, 0.994439f, 0.993136f, 0.991757f, 0.990377f, 0.988997f, 0.988491f, 0.987986f, 0.987480f, - 0.985997f, 0.984269f, 0.982542f, 0.980066f, 0.977092f, 0.974118f, 0.971621f, 0.969840f, 0.968058f, - 0.966366f, 0.965026f, 0.963687f, 0.962348f, 0.958809f, 0.955271f, 0.951732f, 0.947645f, 0.943422f, - 0.939198f, 0.936257f, 0.934171f, 0.932086f, 0.930008f, 0.927942f, 0.925876f, 0.923250f, 0.918385f, - 0.913521f, 0.908656f, 0.903702f, 0.898749f, 0.893795f, 0.891002f, 0.888749f, 0.886496f, 0.883996f, - 0.881331f, 0.878666f, 0.874814f, 0.869183f, 0.863553f, 0.858015f, 0.852851f, 0.847687f, 0.842523f, - 0.840022f, 0.837520f, 0.835019f, 0.831781f, 0.828359f, 0.824937f, 0.820011f, 0.814082f, 0.808153f, - 0.802713f, 0.798009f, 0.793305f, 0.789023f, 0.786429f, 0.783835f, 0.781241f, 0.777028f, 0.772815f, - 0.768602f, 0.763134f, 0.757353f, 0.751571f, 0.747112f, 0.743534f, 0.739956f, 0.736838f, 0.734410f, - 0.731982f, 0.729034f, 0.724009f, 0.718984f, 0.713959f, 0.708439f, 0.702918f, 0.697398f, 0.694412f, - 0.692061f, 0.689710f, 0.687330f, 0.684932f, 0.682534f, 0.678706f, 0.672732f, 0.666759f, 0.660939f, - 0.655737f, 0.650536f, 0.645334f, 0.644222f, 0.643110f, 0.641998f, 0.639788f, 0.637303f, 0.634818f, - 0.629683f, 0.622782f, 0.615880f, 0.609823f, 0.605032f, 0.600241f, 0.596372f, 0.596194f, 0.596015f, - 0.595837f, 0.592403f, 0.588969f, 0.585535f, 0.577842f, 0.569084f, 0.560326f, 0.553880f, 0.548977f, - 0.544074f, 0.541240f, 0.541511f, 0.541781f, 0.540837f, 0.535040f, 0.529243f, 0.523446f, 0.510870f, - 0.498293f, 0.485717f, 0.479851f, 0.475663f, 0.471475f, 0.473848f, 0.480595f, 0.487343f, 0.489727f, - 0.485566f, 0.481405f, 0.471747f, 0.440099f, 0.408451f, 0.376804f, 0.330744f, 0.284685f, 0.238626f, - 0.203638f, 0.171419f, 0.139199f, 0.126312f, 0.126312f -}; - -const float defaultHRIR_right_avg_power_16kHz[LR_IAC_LENGTH_NR_FC] = { - 1.112848f, 1.112848f, 1.110615f, 1.105033f, 1.099450f, 1.094384f, 1.091385f, 1.088385f, 1.085385f, - 1.087983f, 1.090582f, 1.093180f, 1.095717f, 1.098238f, 1.100758f, 1.100828f, 1.099264f, 1.097700f, - 1.095678f, 1.092969f, 1.090259f, 1.088138f, 1.088365f, 1.088592f, 1.088819f, 1.092533f, 1.096246f, - 1.099960f, 1.104778f, 1.109872f, 1.114967f, 1.118803f, 1.121802f, 1.124800f, 1.125950f, 1.124325f, - 1.122701f, 1.120550f, 1.116290f, 1.112030f, 1.107770f, 1.105148f, 1.102526f, 1.099904f, 1.098608f, - 1.097642f, 1.096677f, 1.094770f, 1.092237f, 1.089704f, 1.086740f, 1.083130f, 1.079521f, 1.076295f, - 1.074604f, 1.072914f, 1.071223f, 1.070018f, 1.068813f, 1.067608f, 1.064076f, 1.059963f, 1.055849f, - 1.051324f, 1.046525f, 1.041726f, 1.038407f, 1.037310f, 1.036213f, 1.035478f, 1.036191f, 1.036904f, - 1.037617f, 1.035535f, 1.033453f, 1.031372f, 1.028051f, 1.024421f, 1.020791f, 1.018470f, 1.017021f, - 1.015573f, 1.014440f, 1.013780f, 1.013121f, 1.012054f, 1.009357f, 1.006659f, 1.003962f, 1.001331f, - 0.998700f, 0.996070f, 0.995598f, 0.995666f, 0.995735f, 0.996091f, 0.996639f, 0.997188f, 0.997004f, - 0.995722f, 0.994439f, 0.993137f, 0.991758f, 0.990378f, 0.988998f, 0.988492f, 0.987987f, 0.987481f, - 0.985997f, 0.984269f, 0.982541f, 0.980065f, 0.977091f, 0.974118f, 0.971621f, 0.969841f, 0.968060f, - 0.966368f, 0.965029f, 0.963689f, 0.962350f, 0.958810f, 0.955270f, 0.951731f, 0.947643f, 0.943419f, - 0.939196f, 0.936255f, 0.934170f, 0.932086f, 0.930009f, 0.927943f, 0.925877f, 0.923251f, 0.918386f, - 0.913520f, 0.908655f, 0.903701f, 0.898748f, 0.893795f, 0.891001f, 0.888748f, 0.886495f, 0.883995f, - 0.881330f, 0.878665f, 0.874814f, 0.869184f, 0.863554f, 0.858016f, 0.852852f, 0.847687f, 0.842522f, - 0.840021f, 0.837520f, 0.835019f, 0.831781f, 0.828358f, 0.824936f, 0.820010f, 0.814081f, 0.808152f, - 0.802713f, 0.798009f, 0.793305f, 0.789024f, 0.786430f, 0.783837f, 0.781244f, 0.777029f, 0.772815f, - 0.768601f, 0.763133f, 0.757353f, 0.751572f, 0.747112f, 0.743534f, 0.739956f, 0.736837f, 0.734410f, - 0.731982f, 0.729034f, 0.724009f, 0.718984f, 0.713959f, 0.708439f, 0.702919f, 0.697399f, 0.694414f, - 0.692063f, 0.689712f, 0.687331f, 0.684932f, 0.682532f, 0.678704f, 0.672731f, 0.666759f, 0.660941f, - 0.655738f, 0.650534f, 0.645331f, 0.644220f, 0.643109f, 0.641999f, 0.639789f, 0.637304f, 0.634819f, - 0.629684f, 0.622783f, 0.615881f, 0.609824f, 0.605033f, 0.600242f, 0.596373f, 0.596194f, 0.596015f, - 0.595837f, 0.592403f, 0.588969f, 0.585535f, 0.577842f, 0.569083f, 0.560324f, 0.553879f, 0.548977f, - 0.544074f, 0.541241f, 0.541511f, 0.541781f, 0.540838f, 0.535041f, 0.529243f, 0.523446f, 0.510869f, - 0.498293f, 0.485717f, 0.479851f, 0.475663f, 0.471475f, 0.473848f, 0.480595f, 0.487343f, 0.489727f, - 0.485566f, 0.481405f, 0.471746f, 0.440098f, 0.408450f, 0.376802f, 0.330743f, 0.284685f, 0.238626f, - 0.203638f, 0.171419f, 0.139199f, 0.126311f, 0.126311f -}; -#endif /*----------------------------------------------------------------------------------* * t-design and SN3D normalization table diff --git a/lib_rend/ivas_rom_rend.h b/lib_rend/ivas_rom_rend.h index 8aa9a626b9..ee2f0e75df 100644 --- a/lib_rend/ivas_rom_rend.h +++ b/lib_rend/ivas_rom_rend.h @@ -96,19 +96,6 @@ extern const int16_t HRTF_MODEL_N_CPTS_VAR[HRTF_MODEL_N_SECTIONS]; extern const float SincTable[321]; -#ifndef FIX_638_ENERGIE_IAC_ROM_TABLES -extern const float defaultHRIR_coherence_48kHz[LR_IAC_LENGTH_NR_FC]; -extern const float defaultHRIR_left_avg_power_48kHz[LR_IAC_LENGTH_NR_FC]; -extern const float defaultHRIR_right_avg_power_48kHz[LR_IAC_LENGTH_NR_FC]; - -extern const float defaultHRIR_coherence_32kHz[LR_IAC_LENGTH_NR_FC]; -extern const float defaultHRIR_left_avg_power_32kHz[LR_IAC_LENGTH_NR_FC]; -extern const float defaultHRIR_right_avg_power_32kHz[LR_IAC_LENGTH_NR_FC]; - -extern const float defaultHRIR_coherence_16kHz[LR_IAC_LENGTH_NR_FC]; -extern const float defaultHRIR_left_avg_power_16kHz[LR_IAC_LENGTH_NR_FC]; -extern const float defaultHRIR_right_avg_power_16kHz[LR_IAC_LENGTH_NR_FC]; -#endif /*----------------------------------------------------------------------------------* * t-design and SN3D normalization table diff --git a/lib_util/hrtf_file_reader.c b/lib_util/hrtf_file_reader.c index 362498dd45..ea1dcb868c 100644 --- a/lib_util/hrtf_file_reader.c +++ b/lib_util/hrtf_file_reader.c @@ -35,9 +35,7 @@ #include "prot.h" #include "ivas_prot_rend.h" #include "ivas_prot.h" -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES #include "ivas_rom_binaural_crend_head.h" -#endif /*---------------------------------------------------------------------* * Local structures @@ -189,7 +187,6 @@ static ivas_error check_hrtf_binary_header( ivas_hrtfs_header_t *hrtf_header ) { /* Check the renderer type */ -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES if ( ( hrtf_header->rend_type != HRTF_READER_RENDERER_BINAURAL_MIXER_CONV ) && ( hrtf_header->rend_type != HRTF_READER_RENDERER_BINAURAL_MIXER_CONV_ROOM ) && ( hrtf_header->rend_type != HRTF_READER_RENDERER_BINAURAL_FASTCONV ) && ( hrtf_header->rend_type != HRTF_READER_RENDERER_BINAURAL_FASTCONV_ROOM ) && ( hrtf_header->rend_type != HRTF_READER_RENDERER_BINAURAL_PARAMETRIC ) && ( hrtf_header->rend_type != HRTF_READER_RENDERER_BINAURAL_PARAMETRIC_ROOM ) && @@ -197,15 +194,6 @@ static ivas_error check_hrtf_binary_header( { return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Header of HRTF binary file not compliant (renderer type)" ); } -#else - if ( ( hrtf_header->rend_type != RENDERER_BINAURAL_MIXER_CONV ) && ( hrtf_header->rend_type != RENDERER_BINAURAL_MIXER_CONV_ROOM ) && - ( hrtf_header->rend_type != RENDERER_BINAURAL_FASTCONV ) && ( hrtf_header->rend_type != RENDERER_BINAURAL_FASTCONV_ROOM ) && - ( hrtf_header->rend_type != RENDERER_BINAURAL_PARAMETRIC ) && ( hrtf_header->rend_type != RENDERER_BINAURAL_PARAMETRIC_ROOM ) && - ( hrtf_header->rend_type != RENDERER_BINAURAL_OBJECTS_TD ) ) - { - return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Header of HRTF binary file not compliant (renderer type)" ); - } -#endif /* Check the output format of the decoder */ @@ -444,25 +432,10 @@ static ivas_error LoadBSplineBinary( LoadBSplineBinaryITD( &HrFiltSet_p->ModelParamsITD, f_hrtf ); } -#ifndef FIX_638_ENERGIE_IAC_ROM_TABLES - /* left/right energy and interaural coherence for late reverb */ - for ( i = 0; i < 3; i++ ) - { - HrFiltSet_p->lr_energy_and_iac_dyn[i] = (float *) malloc( LR_IAC_LENGTH_NR_FC * sizeof( float ) ); - if ( HrFiltSet_p->lr_energy_and_iac_dyn[i] == NULL ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for hrtf data" ); - } - fread( HrFiltSet_p->lr_energy_and_iac_dyn[i], sizeof( const float ), LR_IAC_LENGTH_NR_FC, f_hrtf ); - HrFiltSet_p->lr_energy_and_iac[i] = (const float *) HrFiltSet_p->lr_energy_and_iac_dyn[i]; - } - -#endif return IVAS_ERR_OK; } -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES #ifndef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES /*-------------------------------------------------------------------* * set_default_reverb_iac_energy() @@ -501,12 +474,10 @@ static ivas_error set_default_reverb_iac_energy( #else HrFiltSet_p->lr_energy_and_iac_dyn[i] = (float *) malloc( LR_IAC_LENGTH_NR_FC * sizeof( float ) ); #endif -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES if ( HrFiltSet_p->lr_energy_and_iac_dyn[i] == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for hrtf data" ); } -#endif } switch ( HrFiltSet_p->SampleRate ) { @@ -559,7 +530,6 @@ static ivas_error set_default_reverb_iac_energy( } #endif -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES /*-------------------------------------------------------------------* * load_reverb_from_binary() @@ -682,22 +652,18 @@ static ivas_error load_reverb_from_binary( { #ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB HrFiltSet_p->lr_energy_and_iac_dyn[i] = (float *) malloc( lr_iac_len * sizeof( float ) ); -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES if ( HrFiltSet_p->lr_energy_and_iac_dyn[i] == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for hrtf data" ); } -#endif fread( HrFiltSet_p->lr_energy_and_iac_dyn[i], sizeof( const float ), lr_iac_len, f_hrtf ); HrFiltSet_p->lr_energy_and_iac[i] = (const float *) HrFiltSet_p->lr_energy_and_iac_dyn[i]; #else HrFiltSet_p->lr_energy_and_iac_dyn[i] = (float *) malloc( LR_IAC_LENGTH_NR_FC * sizeof( float ) ); -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES if ( HrFiltSet_p->lr_energy_and_iac_dyn[i] == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for hrtf data" ); } -#endif fread( HrFiltSet_p->lr_energy_and_iac_dyn[i], sizeof( const float ), LR_IAC_LENGTH_NR_FC, f_hrtf ); HrFiltSet_p->lr_energy_and_iac[i] = (const float *) HrFiltSet_p->lr_energy_and_iac_dyn[i]; #endif @@ -722,7 +688,6 @@ static ivas_error load_reverb_from_binary( return IVAS_ERR_OK; } -#endif /*---------------------------------------------------------------------* * load_reverb_binary() @@ -748,7 +713,6 @@ ivas_error load_reverb_binary( return load_reverb_from_binary( hHrtf, hrtfReader->file ); #endif } -#endif /*-------------------------------------------------------------------* @@ -834,11 +798,7 @@ static ivas_error TDREND_MIX_LoadHRTF( return header_check_result; } -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES is_tdrend = ( hrtf_header.rend_type == HRTF_READER_RENDERER_BINAURAL_OBJECTS_TD ); -#else - is_tdrend = ( hrtf_header.rend_type == RENDERER_BINAURAL_OBJECTS_TD ); -#endif if ( !is_tdrend ) { if ( fread( hrtf_data, 1, hrtf_header.data_size, f_hrtf ) != hrtf_header.data_size ) @@ -1363,23 +1323,16 @@ static ivas_error create_HRTF_from_rawdata( static ivas_error create_fastconv_HRTF_from_rawdata( HRTFS_FASTCONV_HANDLE *hHRTF, /* i/o: HRTF FastConv handle */ char *hrtf_data, /* i : pointer to binary file */ -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES HRTF_READER_RENDERER_TYPE rend_type, /* i : Renderer type */ -#else - RENDERER_TYPE rend_type, /* i : Renderer type */ -#endif BINAURAL_INPUT_AUDIO_CONFIG input_cfg /* i : Input binaural config */ ) { int16_t i, j; char *hrtf_data_rptr; -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES ivas_error error; -#endif ( *hHRTF )->allocate_init_flag = 0; -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES if ( rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV ) { if ( ( error = ivas_allocate_binaural_hrtf( *hHRTF, 0, input_cfg, RENDERER_BINAURAL_FASTCONV, ( *hHRTF )->allocate_init_flag ) ) != IVAS_ERR_OK ) @@ -1398,9 +1351,6 @@ static ivas_error create_fastconv_HRTF_from_rawdata( { return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "renderer type not compliant" ); } -#else - ivas_allocate_binaural_hrtf( *hHRTF, 0, input_cfg, rend_type, ( *hHRTF )->allocate_init_flag ); -#endif hrtf_data_rptr = hrtf_data; @@ -1414,11 +1364,7 @@ static ivas_error create_fastconv_HRTF_from_rawdata( #endif /* HRIR */ -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES if ( rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV && input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_COMBINED ) -#else - if ( rend_type == RENDERER_BINAURAL_FASTCONV && input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_COMBINED ) -#endif { ( *hHRTF )->FASTCONV_HRIR_latency_s = *( (float *) ( hrtf_data_rptr ) ); hrtf_data_rptr += sizeof( float ); @@ -1476,11 +1422,7 @@ static ivas_error create_fastconv_HRTF_from_rawdata( } } } -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES else if ( rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV && input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_HOA3 ) -#else - else if ( rend_type == RENDERER_BINAURAL_FASTCONV && input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_HOA3 ) -#endif { /* HRIR_HOA3 */ ( *hHRTF )->FASTCONV_HOA3_latency_s = *( (float *) ( hrtf_data_rptr ) ); @@ -1538,11 +1480,7 @@ static ivas_error create_fastconv_HRTF_from_rawdata( } } } -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES else if ( rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV && input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_HOA2 ) -#else - else if ( rend_type == RENDERER_BINAURAL_FASTCONV && input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_HOA2 ) -#endif { /* HRIR_HOA2 */ ( *hHRTF )->FASTCONV_HOA2_latency_s = *( (float *) ( hrtf_data_rptr ) ); @@ -1601,11 +1539,7 @@ static ivas_error create_fastconv_HRTF_from_rawdata( } } } -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES else if ( rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV && input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_FOA ) -#else - else if ( rend_type == RENDERER_BINAURAL_FASTCONV && input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_FOA ) -#endif { /* HRIR_FOA */ ( *hHRTF )->FASTCONV_FOA_latency_s = *( (float *) ( hrtf_data_rptr ) ); @@ -1665,11 +1599,7 @@ static ivas_error create_fastconv_HRTF_from_rawdata( } } /* BRIR */ -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES else if ( rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV_ROOM && input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_COMBINED ) -#else - else if ( rend_type == RENDERER_BINAURAL_FASTCONV_ROOM && input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_COMBINED ) -#endif { ( *hHRTF )->FASTCONV_BRIR_latency_s = *( (float *) ( hrtf_data_rptr ) ); hrtf_data_rptr += sizeof( float ); @@ -1798,11 +1728,7 @@ ivas_error load_fastconv_HRTF_from_binary( return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "HRTF binary file not compliant (number of HRTF)" ); } -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES if ( ( hrtf_header.rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV ) || ( hrtf_header.rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV_ROOM ) ) -#else - if ( ( hrtf_header.rend_type == RENDERER_BINAURAL_FASTCONV ) || ( hrtf_header.rend_type == RENDERER_BINAURAL_FASTCONV_ROOM ) ) -#endif { if ( fread( hrtf_data, 1, hrtf_header.data_size, f_hrtf ) != hrtf_header.data_size ) { @@ -1968,11 +1894,7 @@ ivas_error load_parambin_HRTF_from_binary( return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "HRTF binary file not compliant (number of HRTF)" ); } -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES if ( hrtf_header.rend_type == HRTF_READER_RENDERER_BINAURAL_PARAMETRIC_ROOM ) /* Parametric binauralizer data is represented as single entity */ -#else - if ( hrtf_header.rend_type == RENDERER_BINAURAL_PARAMETRIC_ROOM ) /* Parametric binauralizer data is represented as single entity */ -#endif { if ( fread( hrtf_data, 1, hrtf_header.data_size, f_hrtf ) != hrtf_header.data_size ) { @@ -2070,11 +1992,7 @@ ivas_error create_SetOfHRTF_from_binary( hHRTF = NULL; if ( hrtf_header.frequency == output_Fs ) { -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES if ( hrtf_header.rend_type == HRTF_READER_RENDERER_BINAURAL_MIXER_CONV ) -#else - if ( hrtf_header.rend_type == RENDERER_BINAURAL_MIXER_CONV ) -#endif { if ( hrtf_header.input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_COMBINED ) { @@ -2093,11 +2011,7 @@ ivas_error create_SetOfHRTF_from_binary( hHRTF = &( ( *hSetOfHRTF ).hHRTF_hrir_foa ); } } -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES else if ( hrtf_header.rend_type == HRTF_READER_RENDERER_BINAURAL_MIXER_CONV_ROOM ) -#else - else if ( hrtf_header.rend_type == RENDERER_BINAURAL_MIXER_CONV_ROOM ) -#endif { if ( hrtf_header.input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_COMBINED ) { diff --git a/lib_util/hrtf_file_reader.h b/lib_util/hrtf_file_reader.h index a86bddd876..3416c5b7d1 100644 --- a/lib_util/hrtf_file_reader.h +++ b/lib_util/hrtf_file_reader.h @@ -37,7 +37,6 @@ typedef struct hrtfFileReader hrtfFileReader; -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES typedef enum { HRTF_READER_RENDERER_BINAURAL_INVALID, @@ -50,7 +49,6 @@ typedef enum HRTF_READER_RENDERER_BINAURAL_MIXER_CONV_ROOM, HRTF_READER_RENDERER_BINAURAL_REVERB_ALL } HRTF_READER_RENDERER_TYPE; -#endif typedef struct ivas_hrtfs_header_t { @@ -93,7 +91,6 @@ ivas_error load_HRTF_binary( const hrtfFileReader *hrtfReader /* i/o: pointer to hrtfFileReader handle */ ); -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES /*---------------------------------------------------------------------* * load_reverb_from_binary() * @@ -109,7 +106,6 @@ ivas_error load_reverb_binary( #endif const hrtfFileReader *hrtfReader /* i/o: pointer to hrtfFileReader handle */ ); -#endif /*---------------------------------------------------------------------* * create_SetOfHRTF_from_binary() * diff --git a/scripts/binauralRenderer_interface/Table_Format_Converter/generate_tables_from_rom_to_bin.c b/scripts/binauralRenderer_interface/Table_Format_Converter/generate_tables_from_rom_to_bin.c index 4b3faa5780..6bc8f28098 100644 --- a/scripts/binauralRenderer_interface/Table_Format_Converter/generate_tables_from_rom_to_bin.c +++ b/scripts/binauralRenderer_interface/Table_Format_Converter/generate_tables_from_rom_to_bin.c @@ -57,16 +57,11 @@ #define DEFAULT_BIN_FILE_EXT ".bin" -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES #define IVAS_NB_RENDERER_TYPE 7 -#else -#define IVAS_NB_RENDERER_TYPE 6 -#endif #define IVAS_NB_AUDIO_CONFIG 4 #define IVAS_NB_SAMPLERATE 3 -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES const HRTF_READER_RENDERER_TYPE rend_types[IVAS_NB_RENDERER_TYPE] = { HRTF_READER_RENDERER_BINAURAL_FASTCONV, HRTF_READER_RENDERER_BINAURAL_FASTCONV_ROOM, @@ -76,16 +71,6 @@ const HRTF_READER_RENDERER_TYPE rend_types[IVAS_NB_RENDERER_TYPE] = { HRTF_READER_RENDERER_BINAURAL_OBJECTS_TD, HRTF_READER_RENDERER_BINAURAL_REVERB_ALL }; -#else -const RENDERER_TYPE rend_types[IVAS_NB_RENDERER_TYPE] = { - RENDERER_BINAURAL_FASTCONV, - RENDERER_BINAURAL_FASTCONV_ROOM, - RENDERER_BINAURAL_PARAMETRIC, - RENDERER_BINAURAL_MIXER_CONV, - RENDERER_BINAURAL_MIXER_CONV_ROOM, - RENDERER_BINAURAL_OBJECTS_TD -}; -#endif const BINAURAL_INPUT_AUDIO_CONFIG input_cfgs[IVAS_NB_AUDIO_CONFIG] = { BINAURAL_INPUT_AUDIO_CONFIG_COMBINED, @@ -141,31 +126,17 @@ void rom2bin_terminat( void ); char *to_upper( char *str ); void convert_backslash( char *str ); -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES char *create_reverb( int32_t frequency, int32_t *hrtf_size ); -#endif -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES char *create_hrtf_crend( HRTF_READER_RENDERER_TYPE rend_type, BINAURAL_INPUT_AUDIO_CONFIG input_cfg, int32_t frequency, int32_t *hrtf_size /*OUT*/ ); char *create_hrtf_fastconv( HRTF_READER_RENDERER_TYPE rend_type, BINAURAL_INPUT_AUDIO_CONFIG input_cfg, int32_t *hrtf_size ); -#else -char *create_hrtf_crend( RENDERER_TYPE rend_type, BINAURAL_INPUT_AUDIO_CONFIG input_cfg, int32_t frequency, int32_t *hrtf_size /*OUT*/ ); -char *create_hrtf_fastconv( RENDERER_TYPE rend_type, BINAURAL_INPUT_AUDIO_CONFIG input_cfg, int32_t *hrtf_size ); -#endif char *create_hrtf_parametric( int32_t *hrtf_size ); char *create_hrtf_tdrend( int32_t frequency, int32_t *hrtf_size /*OUT*/ ); int32_t read_hrtf_size( char *hrtf ); int16_t check_bin_file( FILE *hrtf_bin_file ); -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES int16_t check_hrtf_data( HRTF_READER_RENDERER_TYPE rend_type, BINAURAL_INPUT_AUDIO_CONFIG input_cfg, int32_t frequency, char *hrtf_data_in, int32_t hrtf_size_in ); /*---------------------------------------------------------------------*/ int16_t get_crend_hrtf_tables( HRTF_READER_RENDERER_TYPE rend_type, BINAURAL_INPUT_AUDIO_CONFIG input_cfg, int32_t frequency, crend_hrtf_tables_pointers *hrtf_table_ptrs /*OUT*/, crend_hrtf_tables_dimensions *hrtf_table_dims /*OUT*/ ); -#else -int16_t check_hrtf_data( RENDERER_TYPE rend_type, BINAURAL_INPUT_AUDIO_CONFIG input_cfg, int32_t frequency, char *hrtf_data_in, int32_t hrtf_size_in ); -/*---------------------------------------------------------------------*/ - -int16_t get_crend_hrtf_tables( RENDERER_TYPE rend_type, BINAURAL_INPUT_AUDIO_CONFIG input_cfg, int32_t frequency, crend_hrtf_tables_pointers *hrtf_table_ptrs /*OUT*/, crend_hrtf_tables_dimensions *hrtf_table_dims /*OUT*/ ); -#endif int32_t compute_crend_hrtf_data_size( crend_hrtf_tables_pointers *hrtf_table_ptrs, crend_hrtf_tables_dimensions *hrtf_table_dims ); /*---------------------------------------------------------------------* @@ -192,10 +163,8 @@ void usage_tables_format_converter( void ) "-48 : Select 48 kHz sampling frequency (no multiple values, all frequencies by default).\n" ); fprintf( stdout, "-input_td_file_path : if exist path of binary files for time-domain renderer.\n" ); fprintf( stdout, "-input_td_file_name : if exist common name of input td file with extension.\n" ); -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES fprintf( stdout, "-input_reverb_file_path : if exist path of binary files for reverb.\n" ); fprintf( stdout, "-input_reverb_file_name : if exist name of input reverb file with extension.\n" ); -#endif fprintf( stdout, "-input_fastconv_file_path : if exist path of binary file for fastconv renderer.\n" ); fprintf( stdout, "-input_fastconv_file_name : if exist name of input fastconv file with extension.\n" ); fprintf( stdout, "-input_param_file_path : if exist path of binary file for parametric renderer.\n" ); @@ -235,10 +204,8 @@ char *input_mixerconv_bin_hrir_path = NULL; char *input_mixerconv_bin_brir_path = NULL; char *input_mixerconv_bin_hrir_file_name = NULL; char *input_mixerconv_bin_brir_file_name = NULL; -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES char *input_reverb_file_path = NULL; char *input_reverb_file_name = NULL; -#endif int16_t nb_freq = IVAS_NB_SAMPLERATE; const int32_t *freq_ptr = sample_rates; @@ -288,12 +255,10 @@ int main( int argc, char *argv[] ) { nbHRTFMax += IVAS_NB_SAMPLERATE; } -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES if ( input_reverb_file_name != NULL ) { nbHRTFMax += IVAS_NB_SAMPLERATE; } -#endif startFreq = 0; if ( selected_frequency != 0 ) @@ -349,11 +314,7 @@ int main( int argc, char *argv[] ) hrtf_size = 0; switch ( rend_types[i] ) { -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES case HRTF_READER_RENDERER_BINAURAL_FASTCONV: -#else - case RENDERER_BINAURAL_FASTCONV: -#endif if ( ( input_fastconv_bin_path != NULL ) && ( input_fastconv_bin_file_name != NULL ) ) { for ( j = 0; j < IVAS_NB_AUDIO_CONFIG; j++ ) @@ -384,11 +345,7 @@ int main( int argc, char *argv[] ) } } break; -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES case HRTF_READER_RENDERER_BINAURAL_FASTCONV_ROOM: -#else - case RENDERER_BINAURAL_FASTCONV_ROOM: -#endif if ( ( input_fastconv_bin_path != NULL ) && ( input_fastconv_bin_file_name != NULL ) ) { /* Only one freq. for fastconv */ @@ -416,11 +373,7 @@ int main( int argc, char *argv[] ) } } break; -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES case HRTF_READER_RENDERER_BINAURAL_PARAMETRIC: -#else - case RENDERER_BINAURAL_PARAMETRIC: -#endif /* Parametric will always have just one set regardless of input and frequency. */ if ( ( input_param_bin_path != NULL ) && ( input_param_bin_file_name != NULL ) ) { @@ -448,11 +401,7 @@ int main( int argc, char *argv[] ) } } break; -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES case HRTF_READER_RENDERER_BINAURAL_MIXER_CONV: -#else - case RENDERER_BINAURAL_MIXER_CONV: -#endif if ( ( input_mixerconv_bin_hrir_path != NULL ) && ( input_mixerconv_bin_hrir_file_name != NULL ) ) { int start_nbHRTF = nbHRTF; @@ -483,11 +432,7 @@ int main( int argc, char *argv[] ) } } break; -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES case HRTF_READER_RENDERER_BINAURAL_MIXER_CONV_ROOM: -#else - case RENDERER_BINAURAL_MIXER_CONV_ROOM: -#endif if ( ( input_mixerconv_bin_brir_path != NULL ) && ( input_mixerconv_bin_brir_file_name != NULL ) ) { setOfHRTF[nbHRTF] = create_hrtf_crend( rend_types[i], BINAURAL_INPUT_AUDIO_CONFIG_COMBINED, freq_ptr[k], &hrtf_size ); @@ -515,11 +460,7 @@ int main( int argc, char *argv[] ) } } break; -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES case HRTF_READER_RENDERER_BINAURAL_OBJECTS_TD: -#else - case RENDERER_BINAURAL_OBJECTS_TD: -#endif if ( ( input_td_bin_path != NULL ) && ( input_td_bin_file_name != NULL ) ) { setOfHRTF[nbHRTF] = create_hrtf_tdrend( freq_ptr[k], &hrtf_size ); @@ -546,7 +487,6 @@ int main( int argc, char *argv[] ) } } break; -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES case HRTF_READER_RENDERER_BINAURAL_REVERB_ALL: if ( ( input_reverb_file_path != NULL ) && ( input_reverb_file_name != NULL ) ) { @@ -574,7 +514,6 @@ int main( int argc, char *argv[] ) } } break; -#endif default: break; } @@ -670,11 +609,7 @@ int main( int argc, char *argv[] ) * create_hrtf_crend() * *---------------------------------------------------------------------*/ -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES char *create_hrtf_crend( HRTF_READER_RENDERER_TYPE rend_type, BINAURAL_INPUT_AUDIO_CONFIG input_cfg, int32_t frequency, int32_t *hrtf_size ) -#else -char *create_hrtf_crend( RENDERER_TYPE rend_type, BINAURAL_INPUT_AUDIO_CONFIG input_cfg, int32_t frequency, int32_t *hrtf_size ) -#endif { int32_t mixerconv_hrtf_header_size, mixerconv_hrtf_data_size; char *mixerconv_hrtf = NULL, *mixerconv_hrtf_wptr; @@ -688,11 +623,7 @@ char *create_hrtf_crend( RENDERER_TYPE rend_type, BINAURAL_INPUT_AUDIO_CONFIG in char *configuration_name = ""; // Example : ivas_hrfilters_mixerconv_Combined_HRIR_48kHz.bin -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES if ( rend_type == HRTF_READER_RENDERER_BINAURAL_MIXER_CONV ) -#else - if ( rend_type == RENDERER_BINAURAL_MIXER_CONV ) -#endif { if ( input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_COMBINED ) { @@ -717,11 +648,7 @@ char *create_hrtf_crend( RENDERER_TYPE rend_type, BINAURAL_INPUT_AUDIO_CONFIG in sprintf( full_in_mixerconv_path, "%s/%s_%s_%dkHz%s", input_mixerconv_bin_hrir_path, input_mixerconv_bin_hrir_file_name, configuration_name, frequency / 1000, DEFAULT_BIN_FILE_EXT ); #endif } -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES else if ( rend_type == HRTF_READER_RENDERER_BINAURAL_MIXER_CONV_ROOM ) -#else - else if ( rend_type == RENDERER_BINAURAL_MIXER_CONV_ROOM ) -#endif { if ( input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_COMBINED ) { @@ -832,11 +759,6 @@ char *create_hrtf_tdrend( int32_t frequency, int32_t *hrtf_size ) char *td_hrtf = NULL, *td_hrtf_wptr, *full_in_td_path = NULL; // left/right and coherences for late reverb table sizes -#ifndef FIX_638_ENERGIE_IAC_ROM_TABLES - int32_t td_hrtf_coh_and_ener_size; - int32_t data_size_tmp; - int32_t td_hrtf_data_size_new; -#endif *hrtf_size = 0; @@ -870,13 +792,7 @@ char *create_hrtf_tdrend( int32_t frequency, int32_t *hrtf_size ) // Raw data size (4 bytes) td_hrtf_header_size = sizeof( int32_t ) + sizeof( int32_t ) + sizeof( int32_t ) + sizeof( uint32_t ); -#ifndef FIX_638_ENERGIE_IAC_ROM_TABLES - td_hrtf_coh_and_ener_size = sizeof( float ) * 3 * LR_IAC_LENGTH_NR_FC; - td_hrtf_data_size_new = td_hrtf_data_size + td_hrtf_coh_and_ener_size; - *hrtf_size = td_hrtf_header_size + td_hrtf_data_size_new; -#else *hrtf_size = td_hrtf_header_size + td_hrtf_data_size; -#endif td_hrtf = (char *) malloc( *hrtf_size ); if ( td_hrtf == NULL ) @@ -895,11 +811,7 @@ char *create_hrtf_tdrend( int32_t frequency, int32_t *hrtf_size ) // Get the HRTF header // Renderer type -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES *( (int32_t *) ( td_hrtf_wptr ) ) = HRTF_READER_RENDERER_BINAURAL_OBJECTS_TD; -#else - *( (int32_t *) ( td_hrtf_wptr ) ) = RENDERER_BINAURAL_OBJECTS_TD; -#endif td_hrtf_wptr += sizeof( int32_t ); // Decoder output format @@ -911,11 +823,7 @@ char *create_hrtf_tdrend( int32_t frequency, int32_t *hrtf_size ) td_hrtf_wptr += sizeof( int32_t ); // Raw data size -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES memcpy( td_hrtf_wptr, &( td_hrtf_data_size ), sizeof( uint32_t ) ); -#else - memcpy( td_hrtf_wptr, &( td_hrtf_data_size_new ), sizeof( uint32_t ) ); -#endif td_hrtf_wptr += sizeof( uint32_t ); // Get the HRTF raw data @@ -933,37 +841,6 @@ char *create_hrtf_tdrend( int32_t frequency, int32_t *hrtf_size ) } td_hrtf_wptr += td_hrtf_data_size; -#ifndef FIX_638_ENERGIE_IAC_ROM_TABLES - // Left/right and coherence late reverb tables - data_size_tmp = sizeof( float ) * LR_IAC_LENGTH_NR_FC; - if ( frequency == 48000 ) - { - memcpy( td_hrtf_wptr, &( defaultHRIR_left_avg_power_48kHz ), data_size_tmp ); - td_hrtf_wptr += data_size_tmp; - memcpy( td_hrtf_wptr, &( defaultHRIR_right_avg_power_48kHz ), data_size_tmp ); - td_hrtf_wptr += data_size_tmp; - memcpy( td_hrtf_wptr, &( defaultHRIR_coherence_48kHz ), data_size_tmp ); - td_hrtf_wptr += data_size_tmp; - } - else if ( frequency == 32000 ) - { - memcpy( td_hrtf_wptr, &( defaultHRIR_left_avg_power_32kHz ), data_size_tmp ); - td_hrtf_wptr += data_size_tmp; - memcpy( td_hrtf_wptr, &( defaultHRIR_right_avg_power_32kHz ), data_size_tmp ); - td_hrtf_wptr += data_size_tmp; - memcpy( td_hrtf_wptr, &( defaultHRIR_coherence_32kHz ), data_size_tmp ); - td_hrtf_wptr += data_size_tmp; - } - else if ( frequency == 16000 ) - { - memcpy( td_hrtf_wptr, &( defaultHRIR_left_avg_power_16kHz ), data_size_tmp ); - td_hrtf_wptr += data_size_tmp; - memcpy( td_hrtf_wptr, &( defaultHRIR_right_avg_power_16kHz ), data_size_tmp ); - td_hrtf_wptr += data_size_tmp; - memcpy( td_hrtf_wptr, &( defaultHRIR_coherence_16kHz ), data_size_tmp ); - td_hrtf_wptr += data_size_tmp; - } -#endif fclose( input_td_bin_file ); input_td_bin_file = NULL; } @@ -979,7 +856,6 @@ char *create_hrtf_tdrend( int32_t frequency, int32_t *hrtf_size ) return td_hrtf; } -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES /*---------------------------------------------------------------------* * create_reverb() * @@ -1086,16 +962,11 @@ char *create_reverb( int32_t frequency, int32_t *hrtf_size ) full_in_reverb_path = NULL; return reverb; } -#endif /*---------------------------------------------------------------------* * create_hrtf_fastconv() * *---------------------------------------------------------------------*/ -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES char *create_hrtf_fastconv( HRTF_READER_RENDERER_TYPE rend_type, BINAURAL_INPUT_AUDIO_CONFIG input_cfg, int32_t *hrtf_size ) -#else -char *create_hrtf_fastconv( RENDERER_TYPE rend_type, BINAURAL_INPUT_AUDIO_CONFIG input_cfg, int32_t *hrtf_size ) -#endif { char *fastconv_hrtf = NULL, *fastconv_hrtf_wptr; int32_t fastconv_hrtf_data_size; @@ -1147,11 +1018,7 @@ char *create_hrtf_fastconv( RENDERER_TYPE rend_type, BINAURAL_INPUT_AUDIO_CONFIG char *full_in_fastconv_path = NULL; FILE *input_fastconv_bin_file = NULL; -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES if ( ( rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV_ROOM ) && ( ( input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_HOA3 ) || ( input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_HOA2 ) || ( input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_FOA ) ) ) -#else - if ( ( rend_type == RENDERER_BINAURAL_FASTCONV_ROOM ) && ( ( input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_HOA3 ) || ( input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_HOA2 ) || ( input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_FOA ) ) ) -#endif { /* No FOA, HOA2, HOA3 BRIRs */ return NULL; @@ -1480,11 +1347,7 @@ char *create_hrtf_parametric( int32_t *hrtf_size ) hrtf_wptr = hrtf; // Renderer type - we use only parametric room type here to cover both cases -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES *( (int32_t *) ( hrtf_wptr ) ) = HRTF_READER_RENDERER_BINAURAL_PARAMETRIC_ROOM; -#else - *( (int32_t *) ( hrtf_wptr ) ) = RENDERER_BINAURAL_PARAMETRIC_ROOM; -#endif hrtf_wptr += sizeof( int32_t ); // Decoder output format - not relevant parametric binaural renderer @@ -1570,11 +1433,7 @@ char *create_hrtf_parametric( int32_t *hrtf_size ) * get_crend_hrtf_tables() * *---------------------------------------------------------------------*/ -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES int16_t get_crend_hrtf_tables( HRTF_READER_RENDERER_TYPE rend_type, BINAURAL_INPUT_AUDIO_CONFIG input_cfg, int32_t frequency, crend_hrtf_tables_pointers *hrtf_table_ptrs /*OUT*/, crend_hrtf_tables_dimensions *hrtf_table_dims /*OUT*/ ) -#else -int16_t get_crend_hrtf_tables( RENDERER_TYPE rend_type, BINAURAL_INPUT_AUDIO_CONFIG input_cfg, int32_t frequency, crend_hrtf_tables_pointers *hrtf_table_ptrs /*OUT*/, crend_hrtf_tables_dimensions *hrtf_table_dims /*OUT*/ ) -#endif { int16_t result = -1; uint16_t iChan, iIR, iIter, iIndex, max_num_iterations; @@ -1586,11 +1445,7 @@ int16_t get_crend_hrtf_tables( RENDERER_TYPE rend_type, BINAURAL_INPUT_AUDIO_CON memset( &hrtf_table_ptrs_out, 0x00, sizeof( crend_hrtf_tables_pointers ) ); memset( &hrtf_table_dims_out, 0x00, sizeof( crend_hrtf_tables_dimensions ) ); -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES if ( rend_type == HRTF_READER_RENDERER_BINAURAL_MIXER_CONV ) -#else - if ( rend_type == RENDERER_BINAURAL_MIXER_CONV ) -#endif { if ( input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_COMBINED ) { @@ -1832,11 +1687,7 @@ int16_t get_crend_hrtf_tables( RENDERER_TYPE rend_type, BINAURAL_INPUT_AUDIO_CON hrtf_table_dims_out.max_num_ir = 4; } } -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES else if ( rend_type == HRTF_READER_RENDERER_BINAURAL_MIXER_CONV_ROOM ) -#else - else if ( rend_type == RENDERER_BINAURAL_MIXER_CONV_ROOM ) -#endif { if ( input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_COMBINED ) { @@ -2179,11 +2030,7 @@ int16_t check_bin_file( FILE *hrtf_bin_file ) * *---------------------------------------------------------------------*/ -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES int16_t check_hrtf_data( HRTF_READER_RENDERER_TYPE rend_type, BINAURAL_INPUT_AUDIO_CONFIG input_cfg, int32_t frequency, char *hrtf_data_in, int32_t hrtf_size_in ) -#else -int16_t check_hrtf_data( RENDERER_TYPE rend_type, BINAURAL_INPUT_AUDIO_CONFIG input_cfg, int32_t frequency, char *hrtf_data_in, int32_t hrtf_size_in ) -#endif { int16_t result; int32_t hrtf_data_size, ctrl_size, iChan, iIR, iIndex, iIter; @@ -2193,22 +2040,12 @@ int16_t check_hrtf_data( RENDERER_TYPE rend_type, BINAURAL_INPUT_AUDIO_CONFIG in crend_hrtf_tables_dimensions tabs_dims; crend_hrtf_tables_pointers tabs_ptrs; -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES if ( rend_type == HRTF_READER_RENDERER_BINAURAL_OBJECTS_TD || rend_type == HRTF_READER_RENDERER_BINAURAL_REVERB_ALL || rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV || rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV_ROOM || rend_type == HRTF_READER_RENDERER_BINAURAL_PARAMETRIC || rend_type == HRTF_READER_RENDERER_BINAURAL_PARAMETRIC_ROOM ) { return 0; } -#else - if ( rend_type == RENDERER_BINAURAL_OBJECTS_TD || - rend_type == RENDERER_BINAURAL_FASTCONV || rend_type == RENDERER_BINAURAL_FASTCONV_ROOM || - rend_type == RENDERER_BINAURAL_PARAMETRIC || rend_type == RENDERER_BINAURAL_PARAMETRIC_ROOM ) - { - return 0; - } - -#endif memset( &tabs_dims, 0x00, sizeof( crend_hrtf_tables_dimensions ) ); memset( &tabs_ptrs, 0x00, sizeof( crend_hrtf_tables_pointers ) ); @@ -2616,7 +2453,6 @@ int rom2bin_init( int argc, char *argv[] ) #endif i++; } -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES else if ( strcmp( to_upper( argv[i] ), "-INPUT_REVERB_FILE_PATH" ) == 0 ) { i++; @@ -2642,7 +2478,6 @@ int rom2bin_init( int argc, char *argv[] ) #endif i++; } -#endif else if ( strcmp( to_upper( argv[i] ), "-INPUT_MIXERCONV_HRIR_FILE_PATH" ) == 0 ) { i++; @@ -2743,7 +2578,6 @@ int rom2bin_init( int argc, char *argv[] ) #endif i++; } -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES else if ( strcmp( to_upper( argv[i] ), "-INPUT_REVERB_FILE_NAME" ) == 0 ) { i++; @@ -2757,7 +2591,6 @@ int rom2bin_init( int argc, char *argv[] ) strcpy( input_reverb_file_name, argv[i] ); i++; } -#endif else if ( strcmp( to_upper( argv[i] ), "-INPUT_TD_FILE_NAME" ) == 0 ) { i++; diff --git a/scripts/binauralRenderer_interface/generate_crend_ivas_tables_from_sofa.c b/scripts/binauralRenderer_interface/generate_crend_ivas_tables_from_sofa.c index cdf5501e9d..f27fce819e 100644 --- a/scripts/binauralRenderer_interface/generate_crend_ivas_tables_from_sofa.c +++ b/scripts/binauralRenderer_interface/generate_crend_ivas_tables_from_sofa.c @@ -133,19 +133,15 @@ void get_ls_layout_config( AUDIO_CONFIG ls_layout_config, struct ivas_layout_con int generate_crend_ivas_tables_from_sofa( const char *sofa_file_path, ConfigReader *cfgReader ); void update_h_file( HRTFS_DATA *hrtf, struct ivas_layout_config lscfg, const int32_t samplerate, const int16_t frame_len ); void update_c_file( HRTFS_DATA *hrtf, struct ivas_layout_config lscfg, const int32_t samplerate, const int16_t frame_len ); -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES int generate_reverb_ivas_tables_from_sofa( const char *file_path ); void update_h_file_with_reverb( const int32_t samplerate ); void update_c_file_with_reverb( float *pEner_l, float *pEner_r, float *pCoherence, const int32_t samplerate, const int16_t len ); -#endif void get_binary_tables_dimensions( HRTFS_DATA *hrtf, crend_hrtf_tables_dimensions *hrtf_table_dims /*OUT*/ ); uint32_t compute_binary_size( HRTFS_DATA *hrtf, crend_hrtf_tables_dimensions *hrtf_table_dims ); void write_binary_file( HRTFS_DATA *hrtf, struct ivas_layout_config lscfg, const int32_t samplerate, const int16_t frame_len ); -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES void write_reverb_to_binary_file( float *pEner_l, float *pEner_r, float *pCoherence, const int32_t samplerate ); -#endif /*---------------------------------------------------------------------* * @@ -214,9 +210,7 @@ void usage_gen_crend_tables( void ) fprintf( stdout, "-lib_rend_path : path where header and c files will be created (if missing rom files not generated)\n" ); fprintf( stdout, "-binary_files_path : path where binary files will be created (if missing binary files not generated)\n" ); fprintf( stdout, "-binary_common_file_name : common name for binary files that will be created (crend_hrir-53_brir-Fhg for example)\n" ); -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES fprintf( stdout, "-compute_reverb_rom sofa_file_path : if present reverb rom tables and binary files are computed using sofa_file_path as input HRIRs\n" ); -#endif fprintf( stdout, "-brir_optim_config_path config_file_path : if present brir optimisation process uses parameters stored in config_file_path \n\t\t\t\t\t\tConfiguration example files are provided in folder :\n\t\t\t\t\t\t-brir_no_optim.cfg : for exact convolution of the BRIR by IVAS decoder or renderer\n\t\t\t\t\t\t-brir_default_optim.cfg : default values BRIR optimisation used by IVAS decoder or renderer\n\t\t\t\t\t\t-brir_low_complexity_optim.cfg : values for BRIR optimisation reducing IVAS decoder or renderer complexity\n" ); fprintf( stdout, "example:\n" ); #ifdef _WIN32 @@ -260,9 +254,7 @@ int main( int argc, char *argv[] ) char *binary_common_file_name = NULL; int binPathNotEndingWithSeparator = 0; char *brir_optim_config_path = NULL; -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES char *sofa_file_path_for_reverb = NULL; -#endif bool add_define = false; int notEndingWithFileSeparator = 0; char *sofa_name = NULL; @@ -305,7 +297,6 @@ int main( int argc, char *argv[] ) notEndingWithFileSeparator = ( ( argv[i][strlen( argv[i] ) - 1] == '\\' ) || ( ( argv[i][strlen( argv[i] ) - 1] == '/' ) ) ) ? 0 : 1; i++; } -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES else if ( strcmp( to_upper( argv[i] ), "-COMPUTE_REVERB_ROM" ) == 0 ) { i++; @@ -320,7 +311,6 @@ int main( int argc, char *argv[] ) strcpy( sofa_file_path_for_reverb, argv[i] ); i++; } -#endif else if ( strcmp( to_upper( argv[i] ), "-BINARY_FILES_PATH" ) == 0 ) { i++; @@ -393,10 +383,8 @@ int main( int argc, char *argv[] ) free( binary_path ); if ( binary_common_file_name ) free( binary_common_file_name ); -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES if ( sofa_file_path_for_reverb ) free( sofa_file_path_for_reverb ); -#endif return -1; } frame_len_ms = atoi( argv[i++] ); @@ -411,10 +399,8 @@ int main( int argc, char *argv[] ) free( binary_path ); if ( binary_common_file_name ) free( binary_common_file_name ); -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES if ( sofa_file_path_for_reverb ) free( sofa_file_path_for_reverb ); -#endif return -1; } @@ -434,10 +420,8 @@ int main( int argc, char *argv[] ) free( binary_path ); if ( binary_common_file_name ) free( binary_common_file_name ); -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES if ( sofa_file_path_for_reverb ) free( sofa_file_path_for_reverb ); -#endif return -1; } @@ -473,10 +457,8 @@ int main( int argc, char *argv[] ) free( binary_path ); if ( binary_common_file_name ) free( binary_common_file_name ); -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES if ( sofa_file_path_for_reverb ) free( sofa_file_path_for_reverb ); -#endif return -1; } fp = fopen( c_file_path, "w" ); @@ -492,10 +474,8 @@ int main( int argc, char *argv[] ) free( binary_path ); if ( binary_common_file_name ) free( binary_common_file_name ); -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES if ( sofa_file_path_for_reverb ) free( sofa_file_path_for_reverb ); -#endif return -1; } fclose( fp ); @@ -532,10 +512,8 @@ int main( int argc, char *argv[] ) free( binary_path ); if ( binary_common_file_name ) free( binary_common_file_name ); -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES if ( sofa_file_path_for_reverb ) free( sofa_file_path_for_reverb ); -#endif return -1; } fp = fopen( h_file_path, "w" ); @@ -553,10 +531,8 @@ int main( int argc, char *argv[] ) free( binary_path ); if ( binary_common_file_name ) free( binary_common_file_name ); -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES if ( sofa_file_path_for_reverb ) free( sofa_file_path_for_reverb ); -#endif return -1; } fclose( fp ); @@ -617,10 +593,8 @@ int main( int argc, char *argv[] ) free( binary_path ); if ( binary_common_file_name ) free( binary_common_file_name ); -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES if ( sofa_file_path_for_reverb ) free( sofa_file_path_for_reverb ); -#endif return -1; } } @@ -803,14 +777,12 @@ int main( int argc, char *argv[] ) } } -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES if ( sofa_file_path_for_reverb != NULL ) { err = generate_reverb_ivas_tables_from_sofa( sofa_file_path_for_reverb ); if ( err != 0 ) return err; } -#endif if ( ( h_file_path != NULL ) && ( c_file_path != NULL ) ) { @@ -842,10 +814,8 @@ int main( int argc, char *argv[] ) if ( binary_file_path ) free( binary_file_path ); -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES if ( sofa_file_path_for_reverb ) free( sofa_file_path_for_reverb ); -#endif return err; } @@ -1359,7 +1329,6 @@ int generate_crend_ivas_tables_from_sofa( const char *file_path, ConfigReader *c return 0; } -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES #ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB @@ -1901,12 +1870,10 @@ int generate_reverb_ivas_tables_from_sofa( const char *file_path ) update_h_file_with_reverb( sample_rates[indSR] ); update_c_file_with_reverb( p_avg_lr, &p_avg_lr[nr_fc_fft_filter], pCoherence, sample_rates[indSR], nr_fc_fft_filter ); -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES if ( binary_file_path != NULL ) { write_reverb_to_binary_file( p_avg_lr, &p_avg_lr[nr_fc_fft_filter], pCoherence, sample_rates[indSR] ); } -#endif for ( int i = 0; i < sofa_M; i++ ) { @@ -1958,7 +1925,6 @@ int generate_reverb_ivas_tables_from_sofa( const char *file_path ) mxDestroyArray( sofa ); return 0; } -#endif /*---------------------------------------------------------------------* *write_array_float_to_file(); @@ -2064,7 +2030,6 @@ void write_array_uint16_to_file( FILE *fp, uint16_t *vec, int32_t size_vec, int3 fprintf( fp, "}" ); } -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES /*---------------------------------------------------------------------* *update_c_file_with_reverb(); *---------------------------------------------------------------------*/ @@ -2139,7 +2104,6 @@ void update_c_file_with_reverb( float *pEner_l, float *pEner_r, float *pCoherenc return; } -#endif /*---------------------------------------------------------------------* *update_c_file(); *---------------------------------------------------------------------*/ @@ -2359,7 +2323,6 @@ void update_c_file( HRTFS_DATA *hrtf, struct ivas_layout_config lscfg, const int return; } -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES /*---------------------------------------------------------------------* *update_h_file_with_reverb @@ -2418,7 +2381,6 @@ void update_h_file_with_reverb( int32_t samplerate ) return; } -#endif /*---------------------------------------------------------------------* *update_h_file(); *---------------------------------------------------------------------*/ @@ -2931,7 +2893,6 @@ void write_binary_file( HRTFS_DATA *hrtf, struct ivas_layout_config lscfg, const free( hrtf_bin ); free( binary_file_full_path ); } -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES /*---------------------------------------------------------------------* * write_binary_file(); *---------------------------------------------------------------------*/ @@ -3032,7 +2993,6 @@ void write_reverb_to_binary_file( float *pEner_l, float *pEner_r, float *pCohere free( hrtf_bin ); free( binary_file_full_path ); } -#endif /*---------------------------------------------------------------------* *get_ls_layout_config( AUDIO_CONFIG_CONFIG ls_layout_config, struct ivas_layout_config *ls_struct ) -- GitLab From 6ae239c4847506643ee1b64d8aaebbeff69088af Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 7 Feb 2024 20:50:06 +0100 Subject: [PATCH 02/16] [cleanup] accept FIX_WARNING_SPLIT_RENDER --- lib_com/options.h | 1 - lib_util/split_render_file_read_write.c | 4 ---- 2 files changed, 5 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 1c28244593..0ab39c6b81 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -151,7 +151,6 @@ /*#define FIX_I4_OL_PITCH*/ /* fix open-loop pitch used for EVS core switching */ /*#define SPLIT_REND_WITH_HEAD_ROT */ /* Dlb,FhG: Split Rendering contributions 21 and 35 */ -#define FIX_WARNING_SPLIT_RENDER /* Orange: fix warning on windows build vscode */ #define FIX_INV_DIFFUSE_WEIGHT /* Orange : Fix error in energy compensation in late binaural reverb*/ #define FIX_20_MS_FRAME_LEN_TABLES_CONVERTER /* Orange : generate_tables_converter tools can generate rom for 5 and 20 ms frame length */ #define FIX_955_FASTCONV_REND_IN_ISM /* VA: put FastConv rendering call under DEBUGGING */ diff --git a/lib_util/split_render_file_read_write.c b/lib_util/split_render_file_read_write.c index 8ed9736a59..e7cecf3133 100644 --- a/lib_util/split_render_file_read_write.c +++ b/lib_util/split_render_file_read_write.c @@ -298,11 +298,7 @@ ivas_error split_rend_read_bits_from_file( return IVAS_ERR_FAILED_FILE_READ; } -#ifdef FIX_WARNING_SPLIT_RENDER header_len = (int32_t) strlen( header ); -#else - header_len = strlen( header ); -#endif /* read frame header */ for ( i = 0; i < header_len; i++ ) -- GitLab From d89158b5ec32871c9d9eb342a573dcea918a9553 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 7 Feb 2024 20:53:07 +0100 Subject: [PATCH 03/16] [cleanup] accept FIX_INV_DIFFUSE_WEIGHT --- lib_com/options.h | 1 - lib_rend/ivas_crend.c | 199 ------------------ lib_rend/ivas_rom_binaural_crend_head.c | 60 ------ lib_rend/ivas_rom_binaural_crend_head.h | 60 ------ lib_rend/ivas_stat_rend.h | 9 - lib_util/hrtf_file_reader.c | 8 - .../generate_tables_from_rom_to_bin.c | 8 - .../generate_crend_ivas_tables_from_sofa.c | 27 --- .../ivas_crend_binaural_filter_design.c | 12 -- 9 files changed, 384 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 0ab39c6b81..3ef7426998 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -151,7 +151,6 @@ /*#define FIX_I4_OL_PITCH*/ /* fix open-loop pitch used for EVS core switching */ /*#define SPLIT_REND_WITH_HEAD_ROT */ /* Dlb,FhG: Split Rendering contributions 21 and 35 */ -#define FIX_INV_DIFFUSE_WEIGHT /* Orange : Fix error in energy compensation in late binaural reverb*/ #define FIX_20_MS_FRAME_LEN_TABLES_CONVERTER /* Orange : generate_tables_converter tools can generate rom for 5 and 20 ms frame length */ #define FIX_955_FASTCONV_REND_IN_ISM /* VA: put FastConv rendering call under DEBUGGING */ #define FIX_969_USAN_IGF_ARITH /* FhG: issue 969: fix USAN error in igf_sce_dec; same issue as #962 */ diff --git a/lib_rend/ivas_crend.c b/lib_rend/ivas_crend.c index fedb722b4e..e53535cdfc 100644 --- a/lib_rend/ivas_crend.c +++ b/lib_rend/ivas_crend.c @@ -69,20 +69,13 @@ ivas_error ivas_hrtf_init( hHrtf->max_num_iterations = 0; hHrtf->gain_lfe = 0; hHrtf->index_frequency_max_diffuse = 0; -#ifdef FIX_INV_DIFFUSE_WEIGHT hHrtf->same_inv_diffuse_weight = 1; -#endif for ( i = 0; i < MAX_INTERN_CHANNELS; i++ ) { -#ifndef FIX_INV_DIFFUSE_WEIGHT - hHrtf->inv_diffuse_weight[i] = 0; -#endif for ( j = 0; j < BINAURAL_CHANNELS; j++ ) { -#ifdef FIX_INV_DIFFUSE_WEIGHT hHrtf->inv_diffuse_weight[j][i] = 0; -#endif hHrtf->num_iterations[i][j] = 0; hHrtf->pIndex_frequency_max[i][j] = NULL; hHrtf->pOut_to_bin_re[i][j] = NULL; @@ -372,23 +365,11 @@ static ivas_error ivas_rend_initCrend( if ( output_Fs == 48000 ) { -#ifndef FIX_INV_DIFFUSE_WEIGHT - if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) - { - hHrtf->inv_diffuse_weight[i] = CRendBin_Combined_BRIR_inv_diffuse_weight_48kHz[tmp]; - } - else - { - hHrtf->inv_diffuse_weight[i] = CRendBin_Combined_HRIR_inv_diffuse_weight_48kHz[tmp]; - } -#endif for ( j = 0; j < BINAURAL_CHANNELS; j++ ) { if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) { -#ifdef FIX_INV_DIFFUSE_WEIGHT hHrtf->inv_diffuse_weight[j][i] = CRendBin_Combined_BRIR_inv_diffuse_weight_48kHz[j][tmp]; -#endif hHrtf->num_iterations[i][j] = CRendBin_Combined_BRIR_num_iterations_48kHz[tmp][j]; hHrtf->pIndex_frequency_max[i][j] = CRendBin_Combined_BRIR_pIndex_frequency_max_48kHz[tmp][j]; hHrtf->pOut_to_bin_re[i][j] = CRendBin_Combined_BRIR_coeff_re_48kHz[tmp][j]; @@ -396,9 +377,7 @@ static ivas_error ivas_rend_initCrend( } else { -#ifdef FIX_INV_DIFFUSE_WEIGHT hHrtf->inv_diffuse_weight[j][i] = CRendBin_Combined_HRIR_inv_diffuse_weight_48kHz[j][tmp]; -#endif hHrtf->num_iterations[i][j] = CRendBin_Combined_HRIR_num_iterations_48kHz[tmp][j]; hHrtf->pIndex_frequency_max[i][j] = CRendBin_Combined_HRIR_pIndex_frequency_max_48kHz[tmp][j]; hHrtf->pOut_to_bin_re[i][j] = CRendBin_Combined_HRIR_coeff_re_48kHz[tmp][j]; @@ -408,23 +387,11 @@ static ivas_error ivas_rend_initCrend( } else if ( output_Fs == 32000 ) { -#ifndef FIX_INV_DIFFUSE_WEIGHT - if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) - { - hHrtf->inv_diffuse_weight[i] = CRendBin_Combined_BRIR_inv_diffuse_weight_32kHz[tmp]; - } - else - { - hHrtf->inv_diffuse_weight[i] = CRendBin_Combined_HRIR_inv_diffuse_weight_32kHz[tmp]; - } -#endif for ( j = 0; j < BINAURAL_CHANNELS; j++ ) { if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) { -#ifdef FIX_INV_DIFFUSE_WEIGHT hHrtf->inv_diffuse_weight[j][i] = CRendBin_Combined_BRIR_inv_diffuse_weight_32kHz[j][tmp]; -#endif hHrtf->num_iterations[i][j] = CRendBin_Combined_BRIR_num_iterations_32kHz[tmp][j]; hHrtf->pIndex_frequency_max[i][j] = CRendBin_Combined_BRIR_pIndex_frequency_max_32kHz[tmp][j]; hHrtf->pOut_to_bin_re[i][j] = CRendBin_Combined_BRIR_coeff_re_32kHz[tmp][j]; @@ -432,9 +399,7 @@ static ivas_error ivas_rend_initCrend( } else { -#ifdef FIX_INV_DIFFUSE_WEIGHT hHrtf->inv_diffuse_weight[j][i] = CRendBin_Combined_HRIR_inv_diffuse_weight_32kHz[j][tmp]; -#endif hHrtf->num_iterations[i][j] = CRendBin_Combined_HRIR_num_iterations_32kHz[tmp][j]; hHrtf->pIndex_frequency_max[i][j] = CRendBin_Combined_HRIR_pIndex_frequency_max_32kHz[tmp][j]; hHrtf->pOut_to_bin_re[i][j] = CRendBin_Combined_HRIR_coeff_re_32kHz[tmp][j]; @@ -444,23 +409,11 @@ static ivas_error ivas_rend_initCrend( } else if ( output_Fs == 16000 ) { -#ifndef FIX_INV_DIFFUSE_WEIGHT - if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) - { - hHrtf->inv_diffuse_weight[i] = CRendBin_Combined_BRIR_inv_diffuse_weight_16kHz[tmp]; - } - else - { - hHrtf->inv_diffuse_weight[i] = CRendBin_Combined_HRIR_inv_diffuse_weight_16kHz[tmp]; - } -#endif for ( j = 0; j < BINAURAL_CHANNELS; j++ ) { if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) { -#ifdef FIX_INV_DIFFUSE_WEIGHT hHrtf->inv_diffuse_weight[j][i] = CRendBin_Combined_BRIR_inv_diffuse_weight_16kHz[j][tmp]; -#endif hHrtf->num_iterations[i][j] = CRendBin_Combined_BRIR_num_iterations_16kHz[tmp][j]; hHrtf->pIndex_frequency_max[i][j] = CRendBin_Combined_BRIR_pIndex_frequency_max_16kHz[tmp][j]; hHrtf->pOut_to_bin_re[i][j] = CRendBin_Combined_BRIR_coeff_re_16kHz[tmp][j]; @@ -468,9 +421,7 @@ static ivas_error ivas_rend_initCrend( } else { -#ifdef FIX_INV_DIFFUSE_WEIGHT hHrtf->inv_diffuse_weight[j][i] = CRendBin_Combined_HRIR_inv_diffuse_weight_16kHz[j][tmp]; -#endif hHrtf->num_iterations[i][j] = CRendBin_Combined_HRIR_num_iterations_16kHz[tmp][j]; hHrtf->pIndex_frequency_max[i][j] = CRendBin_Combined_HRIR_pIndex_frequency_max_16kHz[tmp][j]; hHrtf->pOut_to_bin_re[i][j] = CRendBin_Combined_HRIR_coeff_re_16kHz[tmp][j]; @@ -496,14 +447,9 @@ static ivas_error ivas_rend_initCrend( for ( i = 0; i < hHrtf->max_num_ir; i++ ) { -#ifndef FIX_INV_DIFFUSE_WEIGHT - hHrtf->inv_diffuse_weight[i] = CRendBin_HOA3_HRIR_inv_diffuse_weight_48kHz[i]; -#endif for ( j = 0; j < BINAURAL_CHANNELS; j++ ) { -#ifdef FIX_INV_DIFFUSE_WEIGHT hHrtf->inv_diffuse_weight[j][i] = CRendBin_HOA3_HRIR_inv_diffuse_weight_48kHz[j][i]; -#endif hHrtf->num_iterations[i][j] = CRendBin_HOA3_HRIR_num_iterations_48kHz[i][j]; hHrtf->pIndex_frequency_max[i][j] = CRendBin_HOA3_HRIR_pIndex_frequency_max_48kHz[i][j]; hHrtf->pOut_to_bin_re[i][j] = CRendBin_HOA3_HRIR_coeff_re_48kHz[i][j]; @@ -526,14 +472,9 @@ static ivas_error ivas_rend_initCrend( for ( i = 0; i < hHrtf->max_num_ir; i++ ) { -#ifndef FIX_INV_DIFFUSE_WEIGHT - hHrtf->inv_diffuse_weight[i] = CRendBin_HOA3_HRIR_inv_diffuse_weight_32kHz[i]; -#endif for ( j = 0; j < BINAURAL_CHANNELS; j++ ) { -#ifdef FIX_INV_DIFFUSE_WEIGHT hHrtf->inv_diffuse_weight[j][i] = CRendBin_HOA3_HRIR_inv_diffuse_weight_32kHz[j][i]; -#endif hHrtf->num_iterations[i][j] = CRendBin_HOA3_HRIR_num_iterations_32kHz[i][j]; hHrtf->pIndex_frequency_max[i][j] = CRendBin_HOA3_HRIR_pIndex_frequency_max_32kHz[i][j]; hHrtf->pOut_to_bin_re[i][j] = CRendBin_HOA3_HRIR_coeff_re_32kHz[i][j]; @@ -557,14 +498,9 @@ static ivas_error ivas_rend_initCrend( for ( i = 0; i < hHrtf->max_num_ir; i++ ) { -#ifndef FIX_INV_DIFFUSE_WEIGHT - hHrtf->inv_diffuse_weight[i] = CRendBin_HOA3_HRIR_inv_diffuse_weight_16kHz[i]; -#endif for ( j = 0; j < BINAURAL_CHANNELS; j++ ) { -#ifdef FIX_INV_DIFFUSE_WEIGHT hHrtf->inv_diffuse_weight[j][i] = CRendBin_HOA3_HRIR_inv_diffuse_weight_16kHz[j][i]; -#endif hHrtf->num_iterations[i][j] = CRendBin_HOA3_HRIR_num_iterations_16kHz[i][j]; hHrtf->pIndex_frequency_max[i][j] = CRendBin_HOA3_HRIR_pIndex_frequency_max_16kHz[i][j]; hHrtf->pOut_to_bin_re[i][j] = CRendBin_HOA3_HRIR_coeff_re_16kHz[i][j]; @@ -595,14 +531,9 @@ static ivas_error ivas_rend_initCrend( for ( i = 0; i < hHrtf->max_num_ir; i++ ) { -#ifndef FIX_INV_DIFFUSE_WEIGHT - hHrtf->inv_diffuse_weight[i] = CRendBin_HOA2_HRIR_inv_diffuse_weight_48kHz[i]; -#endif for ( j = 0; j < BINAURAL_CHANNELS; j++ ) { -#ifdef FIX_INV_DIFFUSE_WEIGHT hHrtf->inv_diffuse_weight[j][i] = CRendBin_HOA2_HRIR_inv_diffuse_weight_48kHz[j][i]; -#endif hHrtf->num_iterations[i][j] = CRendBin_HOA2_HRIR_num_iterations_48kHz[i][j]; hHrtf->pIndex_frequency_max[i][j] = CRendBin_HOA2_HRIR_pIndex_frequency_max_48kHz[i][j]; hHrtf->pOut_to_bin_re[i][j] = CRendBin_HOA2_HRIR_coeff_re_48kHz[i][j]; @@ -625,14 +556,9 @@ static ivas_error ivas_rend_initCrend( for ( i = 0; i < hHrtf->max_num_ir; i++ ) { -#ifndef FIX_INV_DIFFUSE_WEIGHT - hHrtf->inv_diffuse_weight[i] = CRendBin_HOA2_HRIR_inv_diffuse_weight_32kHz[i]; -#endif for ( j = 0; j < BINAURAL_CHANNELS; j++ ) { -#ifdef FIX_INV_DIFFUSE_WEIGHT hHrtf->inv_diffuse_weight[j][i] = CRendBin_HOA2_HRIR_inv_diffuse_weight_32kHz[j][i]; -#endif hHrtf->num_iterations[i][j] = CRendBin_HOA2_HRIR_num_iterations_32kHz[i][j]; hHrtf->pIndex_frequency_max[i][j] = CRendBin_HOA2_HRIR_pIndex_frequency_max_32kHz[i][j]; hHrtf->pOut_to_bin_re[i][j] = CRendBin_HOA2_HRIR_coeff_re_32kHz[i][j]; @@ -656,14 +582,9 @@ static ivas_error ivas_rend_initCrend( for ( i = 0; i < hHrtf->max_num_ir; i++ ) { -#ifndef FIX_INV_DIFFUSE_WEIGHT - hHrtf->inv_diffuse_weight[i] = CRendBin_HOA2_HRIR_inv_diffuse_weight_16kHz[i]; -#endif for ( j = 0; j < BINAURAL_CHANNELS; j++ ) { -#ifdef FIX_INV_DIFFUSE_WEIGHT hHrtf->inv_diffuse_weight[j][i] = CRendBin_HOA2_HRIR_inv_diffuse_weight_16kHz[j][i]; -#endif hHrtf->num_iterations[i][j] = CRendBin_HOA2_HRIR_num_iterations_16kHz[i][j]; hHrtf->pIndex_frequency_max[i][j] = CRendBin_HOA2_HRIR_pIndex_frequency_max_16kHz[i][j]; hHrtf->pOut_to_bin_re[i][j] = CRendBin_HOA2_HRIR_coeff_re_16kHz[i][j]; @@ -694,14 +615,9 @@ static ivas_error ivas_rend_initCrend( for ( i = 0; i < hHrtf->max_num_ir; i++ ) { -#ifndef FIX_INV_DIFFUSE_WEIGHT - hHrtf->inv_diffuse_weight[i] = CRendBin_FOA_HRIR_inv_diffuse_weight_48kHz[i]; -#endif for ( j = 0; j < BINAURAL_CHANNELS; j++ ) { -#ifdef FIX_INV_DIFFUSE_WEIGHT hHrtf->inv_diffuse_weight[j][i] = CRendBin_FOA_HRIR_inv_diffuse_weight_48kHz[j][i]; -#endif hHrtf->num_iterations[i][j] = CRendBin_FOA_HRIR_num_iterations_48kHz[i][j]; hHrtf->pIndex_frequency_max[i][j] = CRendBin_FOA_HRIR_pIndex_frequency_max_48kHz[i][j]; hHrtf->pOut_to_bin_re[i][j] = CRendBin_FOA_HRIR_coeff_re_48kHz[i][j]; @@ -724,14 +640,9 @@ static ivas_error ivas_rend_initCrend( for ( i = 0; i < hHrtf->max_num_ir; i++ ) { -#ifndef FIX_INV_DIFFUSE_WEIGHT - hHrtf->inv_diffuse_weight[i] = CRendBin_FOA_HRIR_inv_diffuse_weight_32kHz[i]; -#endif for ( j = 0; j < BINAURAL_CHANNELS; j++ ) { -#ifdef FIX_INV_DIFFUSE_WEIGHT hHrtf->inv_diffuse_weight[j][i] = CRendBin_FOA_HRIR_inv_diffuse_weight_32kHz[j][i]; -#endif hHrtf->num_iterations[i][j] = CRendBin_FOA_HRIR_num_iterations_32kHz[i][j]; hHrtf->pIndex_frequency_max[i][j] = CRendBin_FOA_HRIR_pIndex_frequency_max_32kHz[i][j]; hHrtf->pOut_to_bin_re[i][j] = CRendBin_FOA_HRIR_coeff_re_32kHz[i][j]; @@ -755,14 +666,9 @@ static ivas_error ivas_rend_initCrend( for ( i = 0; i < hHrtf->max_num_ir; i++ ) { -#ifndef FIX_INV_DIFFUSE_WEIGHT - hHrtf->inv_diffuse_weight[i] = CRendBin_FOA_HRIR_inv_diffuse_weight_16kHz[i]; -#endif for ( j = 0; j < BINAURAL_CHANNELS; j++ ) { -#ifdef FIX_INV_DIFFUSE_WEIGHT hHrtf->inv_diffuse_weight[j][i] = CRendBin_FOA_HRIR_inv_diffuse_weight_16kHz[j][i]; -#endif hHrtf->num_iterations[i][j] = CRendBin_FOA_HRIR_num_iterations_16kHz[i][j]; hHrtf->pIndex_frequency_max[i][j] = CRendBin_FOA_HRIR_pIndex_frequency_max_16kHz[i][j]; hHrtf->pOut_to_bin_re[i][j] = CRendBin_FOA_HRIR_coeff_re_16kHz[i][j]; @@ -872,24 +778,12 @@ static ivas_error ivas_rend_initCrend( { return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Error: Channel configuration not specified!\n\n" ); } -#ifndef FIX_INV_DIFFUSE_WEIGHT - if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) - { - hHrtf->inv_diffuse_weight[i] = hSetOfHRTF->hHRTF_brir_combined->inv_diffuse_weight[tmp]; - } - else - { - hHrtf->inv_diffuse_weight[i] = hSetOfHRTF->hHRTF_hrir_combined->inv_diffuse_weight[tmp]; - } -#endif for ( j = 0; j < BINAURAL_CHANNELS; j++ ) { if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) { -#ifdef FIX_INV_DIFFUSE_WEIGHT hHrtf->inv_diffuse_weight[j][i] = hSetOfHRTF->hHRTF_brir_combined->inv_diffuse_weight[j][tmp]; -#endif hHrtf->num_iterations[i][j] = hSetOfHRTF->hHRTF_brir_combined->num_iterations[tmp][j]; hHrtf->pIndex_frequency_max[i][j] = hSetOfHRTF->hHRTF_brir_combined->pIndex_frequency_max[tmp][j]; hHrtf->pOut_to_bin_re[i][j] = hSetOfHRTF->hHRTF_brir_combined->pOut_to_bin_re[tmp][j]; @@ -897,9 +791,7 @@ static ivas_error ivas_rend_initCrend( } else { -#ifdef FIX_INV_DIFFUSE_WEIGHT hHrtf->inv_diffuse_weight[j][i] = hSetOfHRTF->hHRTF_hrir_combined->inv_diffuse_weight[j][tmp]; -#endif hHrtf->num_iterations[i][j] = hSetOfHRTF->hHRTF_hrir_combined->num_iterations[tmp][j]; hHrtf->pIndex_frequency_max[i][j] = hSetOfHRTF->hHRTF_hrir_combined->pIndex_frequency_max[tmp][j]; hHrtf->pOut_to_bin_re[i][j] = hSetOfHRTF->hHRTF_hrir_combined->pOut_to_bin_re[tmp][j]; @@ -924,14 +816,9 @@ static ivas_error ivas_rend_initCrend( for ( i = 0; i < hHrtf->max_num_ir; i++ ) { -#ifndef FIX_INV_DIFFUSE_WEIGHT - hHrtf->inv_diffuse_weight[i] = hSetOfHRTF->hHRTF_hrir_hoa3->inv_diffuse_weight[i]; -#endif for ( j = 0; j < BINAURAL_CHANNELS; j++ ) { -#ifdef FIX_INV_DIFFUSE_WEIGHT hHrtf->inv_diffuse_weight[j][i] = hSetOfHRTF->hHRTF_hrir_hoa3->inv_diffuse_weight[j][i]; -#endif hHrtf->num_iterations[i][j] = hSetOfHRTF->hHRTF_hrir_hoa3->num_iterations[i][j]; hHrtf->pIndex_frequency_max[i][j] = hSetOfHRTF->hHRTF_hrir_hoa3->pIndex_frequency_max[i][j]; hHrtf->pOut_to_bin_re[i][j] = hSetOfHRTF->hHRTF_hrir_hoa3->pOut_to_bin_re[i][j]; @@ -960,14 +847,9 @@ static ivas_error ivas_rend_initCrend( for ( i = 0; i < hHrtf->max_num_ir; i++ ) { -#ifndef FIX_INV_DIFFUSE_WEIGHT - hHrtf->inv_diffuse_weight[i] = hSetOfHRTF->hHRTF_hrir_hoa2->inv_diffuse_weight[i]; -#endif for ( j = 0; j < BINAURAL_CHANNELS; j++ ) { -#ifdef FIX_INV_DIFFUSE_WEIGHT hHrtf->inv_diffuse_weight[j][i] = hSetOfHRTF->hHRTF_hrir_hoa2->inv_diffuse_weight[j][i]; -#endif hHrtf->num_iterations[i][j] = hSetOfHRTF->hHRTF_hrir_hoa2->num_iterations[i][j]; hHrtf->pIndex_frequency_max[i][j] = hSetOfHRTF->hHRTF_hrir_hoa2->pIndex_frequency_max[i][j]; hHrtf->pOut_to_bin_re[i][j] = hSetOfHRTF->hHRTF_hrir_hoa2->pOut_to_bin_re[i][j]; @@ -996,14 +878,9 @@ static ivas_error ivas_rend_initCrend( for ( i = 0; i < hHrtf->max_num_ir; i++ ) { -#ifndef FIX_INV_DIFFUSE_WEIGHT - hHrtf->inv_diffuse_weight[i] = hSetOfHRTF->hHRTF_hrir_foa->inv_diffuse_weight[i]; -#endif for ( j = 0; j < BINAURAL_CHANNELS; j++ ) { -#ifdef FIX_INV_DIFFUSE_WEIGHT hHrtf->inv_diffuse_weight[j][i] = hSetOfHRTF->hHRTF_hrir_foa->inv_diffuse_weight[j][i]; -#endif hHrtf->num_iterations[i][j] = hSetOfHRTF->hHRTF_hrir_foa->num_iterations[i][j]; hHrtf->pIndex_frequency_max[i][j] = hSetOfHRTF->hHRTF_hrir_foa->pIndex_frequency_max[i][j]; hHrtf->pOut_to_bin_re[i][j] = hSetOfHRTF->hHRTF_hrir_foa->pOut_to_bin_re[i][j]; @@ -1025,7 +902,6 @@ static ivas_error ivas_rend_initCrend( } } -#ifdef FIX_INV_DIFFUSE_WEIGHT hHrtf->same_inv_diffuse_weight = 1; for ( i = 0; i < hHrtf->max_num_ir; i++ ) { @@ -1037,7 +913,6 @@ static ivas_error ivas_rend_initCrend( } } } -#endif pCrend->hHrtfCrend = hHrtf; @@ -1323,15 +1198,10 @@ ivas_error ivas_rend_initCrendWrapper( hCrend->prev_out_buffer[i] = NULL; } -#ifdef FIX_INV_DIFFUSE_WEIGHT hCrend->freq_buffer_re_diffuse[0] = NULL; hCrend->freq_buffer_re_diffuse[1] = NULL; hCrend->freq_buffer_im_diffuse[0] = NULL; hCrend->freq_buffer_im_diffuse[1] = NULL; -#else - hCrend->freq_buffer_re_diffuse = NULL; - hCrend->freq_buffer_im_diffuse = NULL; -#endif hCrend->hReverb = NULL; hCrend->reflections = NULL; hCrend->delay_line_rw_index = 0; @@ -1482,7 +1352,6 @@ ivas_error ivas_rend_openCrend( if ( max_total_ir_len > 0 ) { -#ifdef FIX_INV_DIFFUSE_WEIGHT if ( ( hCrend->freq_buffer_re_diffuse[0] = (float *) malloc( sizeof( float ) * max_total_ir_len ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend" ); @@ -1498,23 +1367,12 @@ ivas_error ivas_rend_openCrend( { hCrend->freq_buffer_re_diffuse[1] = NULL; } -#else - if ( ( hCrend->freq_buffer_re_diffuse = (float *) malloc( sizeof( float ) * max_total_ir_len ) ) == NULL ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend" ); - } -#endif -#ifdef FIX_INV_DIFFUSE_WEIGHT set_zero_l( hCrend->freq_buffer_re_diffuse[0], max_total_ir_len ); if ( hCrend->freq_buffer_re_diffuse[1] != NULL ) { set_zero_l( hCrend->freq_buffer_re_diffuse[1], max_total_ir_len ); } -#else - set_zero_l( hCrend->freq_buffer_re_diffuse, max_total_ir_len ); -#endif -#ifdef FIX_INV_DIFFUSE_WEIGHT if ( ( hCrend->freq_buffer_im_diffuse[0] = (float *) malloc( sizeof( float ) * max_total_ir_len ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend" ); @@ -1530,33 +1388,18 @@ ivas_error ivas_rend_openCrend( { hCrend->freq_buffer_im_diffuse[1] = NULL; } -#else - if ( ( hCrend->freq_buffer_im_diffuse = (float *) malloc( sizeof( float ) * max_total_ir_len ) ) == NULL ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend" ); - } -#endif -#ifdef FIX_INV_DIFFUSE_WEIGHT set_zero_l( hCrend->freq_buffer_im_diffuse[0], max_total_ir_len ); if ( hCrend->freq_buffer_im_diffuse[1] != NULL ) { set_zero_l( hCrend->freq_buffer_im_diffuse[1], max_total_ir_len ); } -#else - set_zero_l( hCrend->freq_buffer_im_diffuse, max_total_ir_len ); -#endif } else { -#ifdef FIX_INV_DIFFUSE_WEIGHT hCrend->freq_buffer_re_diffuse[0] = NULL; hCrend->freq_buffer_im_diffuse[0] = NULL; hCrend->freq_buffer_re_diffuse[1] = NULL; hCrend->freq_buffer_im_diffuse[1] = NULL; -#else - hCrend->freq_buffer_re_diffuse = NULL; - hCrend->freq_buffer_im_diffuse = NULL; -#endif } max_total_ir_len = (int16_t) ( hHrtf->latency_s * output_Fs + 0.5f ) + subframe_length; @@ -1708,7 +1551,6 @@ void ivas_rend_closeCrend( free( hCrend->lfe_delay_line ); hCrend->lfe_delay_line = NULL; } -#ifdef FIX_INV_DIFFUSE_WEIGHT if ( hCrend->freq_buffer_re_diffuse[0] != NULL ) { free( hCrend->freq_buffer_re_diffuse[0] ); @@ -1732,19 +1574,6 @@ void ivas_rend_closeCrend( free( hCrend->freq_buffer_im_diffuse[1] ); hCrend->freq_buffer_im_diffuse[1] = NULL; } -#else - if ( hCrend->freq_buffer_re_diffuse != NULL ) - { - free( hCrend->freq_buffer_re_diffuse ); - hCrend->freq_buffer_re_diffuse = NULL; - } - - if ( hCrend->freq_buffer_im_diffuse != NULL ) - { - free( hCrend->freq_buffer_im_diffuse ); - hCrend->freq_buffer_im_diffuse = NULL; - } -#endif if ( hCrend->hTrack != NULL ) { @@ -1842,9 +1671,7 @@ static ivas_error ivas_rend_crendConvolver( int16_t nchan_in, nchan_out; const float *pIn; float *pFreq_buf_re, *pFreq_buf_im; -#ifdef FIX_INV_DIFFUSE_WEIGHT float *pFreq_buf2_re, *pFreq_buf2_im; -#endif const float *pFreq_filt_re, *pFreq_filt_im; float pOut[L_FRAME48k * 2]; float tmp_out_re[L_FRAME48k], tmp_out_im[L_FRAME48k]; @@ -1887,7 +1714,6 @@ static ivas_error ivas_rend_crendConvolver( if ( pCrend->hHrtfCrend->num_iterations_diffuse[0] > 0 ) { -#ifdef FIX_INV_DIFFUSE_WEIGHT set_zero( &hCrend->freq_buffer_re_diffuse[0][offset_diffuse], subframe_length ); set_zero( &hCrend->freq_buffer_im_diffuse[0][offset_diffuse], subframe_length ); if ( pCrend->hHrtfCrend->same_inv_diffuse_weight == 0 ) @@ -1895,10 +1721,6 @@ static ivas_error ivas_rend_crendConvolver( set_zero( &hCrend->freq_buffer_re_diffuse[1][offset_diffuse], subframe_length ); set_zero( &hCrend->freq_buffer_im_diffuse[1][offset_diffuse], subframe_length ); } -#else - set_zero( &hCrend->freq_buffer_re_diffuse[offset_diffuse], subframe_length ); - set_zero( &hCrend->freq_buffer_im_diffuse[offset_diffuse], subframe_length ); -#endif } i = 0; @@ -1907,7 +1729,6 @@ static ivas_error ivas_rend_crendConvolver( pIn = &pcm_in[idx_in][i_ts * subframe_length]; if ( idx_in != lfe_idx_in ) { -#ifdef FIX_INV_DIFFUSE_WEIGHT if ( pCrend->hHrtfCrend->num_iterations_diffuse[0] > 0 ) { if ( pCrend->hHrtfCrend->same_inv_diffuse_weight ) @@ -1941,21 +1762,6 @@ static ivas_error ivas_rend_crendConvolver( } } } -#else - if ( pCrend->hHrtfCrend->num_iterations_diffuse[0] > 0 ) - { - pFreq_buf_re = &hCrend->freq_buffer_re_diffuse[offset_diffuse]; - pFreq_buf_im = &hCrend->freq_buffer_im_diffuse[offset_diffuse]; - pFreq_filt_re = &hCrend->freq_buffer_re[i][offset]; - pFreq_filt_im = &hCrend->freq_buffer_im[i][offset]; - - for ( k = 0; k < pCrend->hHrtfCrend->index_frequency_max_diffuse; k++ ) - { - pFreq_buf_re[k] += pFreq_filt_re[k] * pCrend->hHrtfCrend->inv_diffuse_weight[i]; - pFreq_buf_im[k] += pFreq_filt_im[k] * pCrend->hHrtfCrend->inv_diffuse_weight[i]; - } - } -#endif pFreq_buf_re = &hCrend->freq_buffer_re[i][offset]; pFreq_buf_im = &hCrend->freq_buffer_im[i][offset]; @@ -2003,7 +1809,6 @@ static ivas_error ivas_rend_crendConvolver( offset_diffuse = ( hCrend->diffuse_delay_line_rw_index + m + 1 ); offset_diffuse = offset_diffuse % pCrend->hHrtfCrend->num_iterations_diffuse[0]; offset_diffuse = offset_diffuse * subframe_length; -#ifdef FIX_INV_DIFFUSE_WEIGHT if ( pCrend->hHrtfCrend->same_inv_diffuse_weight ) { pFreq_buf_re = &hCrend->freq_buffer_re_diffuse[0][offset_diffuse]; @@ -2014,10 +1819,6 @@ static ivas_error ivas_rend_crendConvolver( pFreq_buf_re = &hCrend->freq_buffer_re_diffuse[j][offset_diffuse]; pFreq_buf_im = &hCrend->freq_buffer_im_diffuse[j][offset_diffuse]; } -#else - pFreq_buf_re = &hCrend->freq_buffer_re_diffuse[offset_diffuse]; - pFreq_buf_im = &hCrend->freq_buffer_im_diffuse[offset_diffuse]; -#endif pFreq_filt_re = &pCrend->hHrtfCrend->pOut_to_bin_diffuse_re[j][offset]; pFreq_filt_im = &pCrend->hHrtfCrend->pOut_to_bin_diffuse_im[j][offset]; diff --git a/lib_rend/ivas_rom_binaural_crend_head.c b/lib_rend/ivas_rom_binaural_crend_head.c index 8d7be0295e..a53b22773d 100644 --- a/lib_rend/ivas_rom_binaural_crend_head.c +++ b/lib_rend/ivas_rom_binaural_crend_head.c @@ -62,11 +62,7 @@ const uint16_t CRendBin_Combined_HRIR_num_iterations_48kHz[HRTF_LS_CHANNELS][BIN const uint16_t CRendBin_Combined_HRIR_num_iterations_diffuse_48kHz[BINAURAL_CHANNELS] = {0, 0}; const uint16_t CRendBin_Combined_HRIR_pIndex_frequency_max_48kHz[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][1]={{{240},{240}},{{240},{240}},{{240},{240}},{{240},{240}},{{240},{240}},{{240},{240}},{{240},{240}},{{240},{240}},{{240},{240}},{{240},{240}},{{240},{240}},{{240},{240}},{{240},{240}},{{240},{240}},{{240},{240}}}; const uint16_t CRendBin_Combined_HRIR_index_frequency_max_diffuse_48kHz = 0; -#ifdef FIX_INV_DIFFUSE_WEIGHT const float CRendBin_Combined_HRIR_inv_diffuse_weight_48kHz[BINAURAL_CHANNELS][HRTF_LS_CHANNELS]={{0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f},{0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f}}; -#else -const float CRendBin_Combined_HRIR_inv_diffuse_weight_48kHz[HRTF_LS_CHANNELS]={0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f}; -#endif const uint16_t *CRendBin_Combined_HRIR_pIndex_frequency_max_diffuse_48kHz[BINAURAL_CHANNELS]={NULL,NULL}; const float CRendBin_Combined_HRIR_coeff_re_48kHz[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][240]={ { @@ -322,11 +318,7 @@ const uint16_t CRendBin_Combined_HRIR_num_iterations_32kHz[HRTF_LS_CHANNELS][BIN const uint16_t CRendBin_Combined_HRIR_num_iterations_diffuse_32kHz[BINAURAL_CHANNELS] = {0, 0}; const uint16_t CRendBin_Combined_HRIR_pIndex_frequency_max_32kHz[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][1]={{{160},{160}},{{160},{160}},{{160},{160}},{{160},{160}},{{160},{160}},{{160},{160}},{{160},{160}},{{160},{160}},{{160},{160}},{{160},{160}},{{160},{160}},{{160},{160}},{{160},{160}},{{160},{160}},{{160},{160}}}; const uint16_t CRendBin_Combined_HRIR_index_frequency_max_diffuse_32kHz = 0; -#ifdef FIX_INV_DIFFUSE_WEIGHT const float CRendBin_Combined_HRIR_inv_diffuse_weight_32kHz[BINAURAL_CHANNELS][HRTF_LS_CHANNELS]={{0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f},{0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f}}; -#else -const float CRendBin_Combined_HRIR_inv_diffuse_weight_32kHz[HRTF_LS_CHANNELS]={0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f}; -#endif const uint16_t *CRendBin_Combined_HRIR_pIndex_frequency_max_diffuse_32kHz[BINAURAL_CHANNELS]={NULL,NULL}; const float CRendBin_Combined_HRIR_coeff_re_32kHz[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][160]={ { @@ -522,11 +514,7 @@ const uint16_t CRendBin_Combined_HRIR_num_iterations_16kHz[HRTF_LS_CHANNELS][BIN const uint16_t CRendBin_Combined_HRIR_num_iterations_diffuse_16kHz[BINAURAL_CHANNELS] = {0, 0}; const uint16_t CRendBin_Combined_HRIR_pIndex_frequency_max_16kHz[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][1]={{{80},{80}},{{80},{80}},{{80},{80}},{{80},{80}},{{80},{80}},{{80},{80}},{{80},{80}},{{80},{80}},{{80},{80}},{{80},{80}},{{80},{80}},{{80},{80}},{{80},{80}},{{80},{80}},{{80},{80}}}; const uint16_t CRendBin_Combined_HRIR_index_frequency_max_diffuse_16kHz = 0; -#ifdef FIX_INV_DIFFUSE_WEIGHT const float CRendBin_Combined_HRIR_inv_diffuse_weight_16kHz[BINAURAL_CHANNELS][HRTF_LS_CHANNELS]={{0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f},{0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f}}; -#else -const float CRendBin_Combined_HRIR_inv_diffuse_weight_16kHz[HRTF_LS_CHANNELS]={0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f}; -#endif const uint16_t *CRendBin_Combined_HRIR_pIndex_frequency_max_diffuse_16kHz[BINAURAL_CHANNELS]={NULL,NULL}; const float CRendBin_Combined_HRIR_coeff_re_16kHz[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][80]={ { @@ -668,11 +656,7 @@ const uint16_t CRendBin_FOA_HRIR_num_iterations_48kHz[FOA_CHANNELS][BINAURAL_CHA const uint16_t CRendBin_FOA_HRIR_num_iterations_diffuse_48kHz[BINAURAL_CHANNELS] = {0, 0}; const uint16_t CRendBin_FOA_HRIR_pIndex_frequency_max_48kHz[FOA_CHANNELS][BINAURAL_CHANNELS][1]={{{240},{240}},{{240},{240}},{{240},{240}},{{240},{240}}}; const uint16_t CRendBin_FOA_HRIR_index_frequency_max_diffuse_48kHz = 0; -#ifdef FIX_INV_DIFFUSE_WEIGHT const float CRendBin_FOA_HRIR_inv_diffuse_weight_48kHz[BINAURAL_CHANNELS][FOA_CHANNELS]={{0.000000f, 0.000000f, 0.000000f, 0.000000f},{0.000000f, 0.000000f, 0.000000f, 0.000000f}}; -#else -const float CRendBin_FOA_HRIR_inv_diffuse_weight_48kHz[FOA_CHANNELS]={0.000000f, 0.000000f, 0.000000f, 0.000000f}; -#endif const uint16_t *CRendBin_FOA_HRIR_pIndex_frequency_max_diffuse_48kHz[BINAURAL_CHANNELS]={NULL,NULL}; const float CRendBin_FOA_HRIR_coeff_re_48kHz[FOA_CHANNELS][BINAURAL_CHANNELS][240]={ { @@ -752,11 +736,7 @@ const uint16_t CRendBin_FOA_HRIR_num_iterations_32kHz[FOA_CHANNELS][BINAURAL_CHA const uint16_t CRendBin_FOA_HRIR_num_iterations_diffuse_32kHz[BINAURAL_CHANNELS] = {0, 0}; const uint16_t CRendBin_FOA_HRIR_pIndex_frequency_max_32kHz[FOA_CHANNELS][BINAURAL_CHANNELS][1]={{{160},{160}},{{160},{160}},{{160},{160}},{{160},{160}}}; const uint16_t CRendBin_FOA_HRIR_index_frequency_max_diffuse_32kHz = 0; -#ifdef FIX_INV_DIFFUSE_WEIGHT const float CRendBin_FOA_HRIR_inv_diffuse_weight_32kHz[BINAURAL_CHANNELS][FOA_CHANNELS]={{0.000000f, 0.000000f, 0.000000f, 0.000000f},{0.000000f, 0.000000f, 0.000000f, 0.000000f}}; -#else -const float CRendBin_FOA_HRIR_inv_diffuse_weight_32kHz[FOA_CHANNELS]={0.000000f, 0.000000f, 0.000000f, 0.000000f}; -#endif const uint16_t *CRendBin_FOA_HRIR_pIndex_frequency_max_diffuse_32kHz[BINAURAL_CHANNELS]={NULL,NULL}; const float CRendBin_FOA_HRIR_coeff_re_32kHz[FOA_CHANNELS][BINAURAL_CHANNELS][160]={ { @@ -820,11 +800,7 @@ const uint16_t CRendBin_FOA_HRIR_num_iterations_16kHz[FOA_CHANNELS][BINAURAL_CHA const uint16_t CRendBin_FOA_HRIR_num_iterations_diffuse_16kHz[BINAURAL_CHANNELS] = {0, 0}; const uint16_t CRendBin_FOA_HRIR_pIndex_frequency_max_16kHz[FOA_CHANNELS][BINAURAL_CHANNELS][1]={{{80},{80}},{{80},{80}},{{80},{80}},{{80},{80}}}; const uint16_t CRendBin_FOA_HRIR_index_frequency_max_diffuse_16kHz = 0; -#ifdef FIX_INV_DIFFUSE_WEIGHT const float CRendBin_FOA_HRIR_inv_diffuse_weight_16kHz[BINAURAL_CHANNELS][FOA_CHANNELS]={{0.000000f, 0.000000f, 0.000000f, 0.000000f},{0.000000f, 0.000000f, 0.000000f, 0.000000f}}; -#else -const float CRendBin_FOA_HRIR_inv_diffuse_weight_16kHz[FOA_CHANNELS]={0.000000f, 0.000000f, 0.000000f, 0.000000f}; -#endif const uint16_t *CRendBin_FOA_HRIR_pIndex_frequency_max_diffuse_16kHz[BINAURAL_CHANNELS]={NULL,NULL}; const float CRendBin_FOA_HRIR_coeff_re_16kHz[FOA_CHANNELS][BINAURAL_CHANNELS][80]={ { @@ -878,11 +854,7 @@ const uint16_t CRendBin_HOA2_HRIR_num_iterations_48kHz[HOA2_CHANNELS][BINAURAL_C const uint16_t CRendBin_HOA2_HRIR_num_iterations_diffuse_48kHz[BINAURAL_CHANNELS] = {0, 0}; const uint16_t CRendBin_HOA2_HRIR_pIndex_frequency_max_48kHz[HOA2_CHANNELS][BINAURAL_CHANNELS][1]={{{240},{240}},{{240},{240}},{{240},{240}},{{240},{240}},{{240},{240}},{{240},{240}},{{240},{240}},{{240},{240}},{{240},{240}}}; const uint16_t CRendBin_HOA2_HRIR_index_frequency_max_diffuse_48kHz = 0; -#ifdef FIX_INV_DIFFUSE_WEIGHT const float CRendBin_HOA2_HRIR_inv_diffuse_weight_48kHz[BINAURAL_CHANNELS][HOA2_CHANNELS]={{0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f},{0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f}}; -#else -const float CRendBin_HOA2_HRIR_inv_diffuse_weight_48kHz[HOA2_CHANNELS]={0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f}; -#endif const uint16_t *CRendBin_HOA2_HRIR_pIndex_frequency_max_diffuse_48kHz[BINAURAL_CHANNELS]={NULL,NULL}; const float CRendBin_HOA2_HRIR_coeff_re_48kHz[HOA2_CHANNELS][BINAURAL_CHANNELS][240]={ { @@ -1042,11 +1014,7 @@ const uint16_t CRendBin_HOA2_HRIR_num_iterations_32kHz[HOA2_CHANNELS][BINAURAL_C const uint16_t CRendBin_HOA2_HRIR_num_iterations_diffuse_32kHz[BINAURAL_CHANNELS] = {0, 0}; const uint16_t CRendBin_HOA2_HRIR_pIndex_frequency_max_32kHz[HOA2_CHANNELS][BINAURAL_CHANNELS][1]={{{160},{160}},{{160},{160}},{{160},{160}},{{160},{160}},{{160},{160}},{{160},{160}},{{160},{160}},{{160},{160}},{{160},{160}}}; const uint16_t CRendBin_HOA2_HRIR_index_frequency_max_diffuse_32kHz = 0; -#ifdef FIX_INV_DIFFUSE_WEIGHT const float CRendBin_HOA2_HRIR_inv_diffuse_weight_32kHz[BINAURAL_CHANNELS][HOA2_CHANNELS]={{0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f},{0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f}}; -#else -const float CRendBin_HOA2_HRIR_inv_diffuse_weight_32kHz[HOA2_CHANNELS]={0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f}; -#endif const uint16_t *CRendBin_HOA2_HRIR_pIndex_frequency_max_diffuse_32kHz[BINAURAL_CHANNELS]={NULL,NULL}; const float CRendBin_HOA2_HRIR_coeff_re_32kHz[HOA2_CHANNELS][BINAURAL_CHANNELS][160]={ { @@ -1170,11 +1138,7 @@ const uint16_t CRendBin_HOA2_HRIR_num_iterations_16kHz[HOA2_CHANNELS][BINAURAL_C const uint16_t CRendBin_HOA2_HRIR_num_iterations_diffuse_16kHz[BINAURAL_CHANNELS] = {0, 0}; const uint16_t CRendBin_HOA2_HRIR_pIndex_frequency_max_16kHz[HOA2_CHANNELS][BINAURAL_CHANNELS][1]={{{80},{80}},{{80},{80}},{{80},{80}},{{80},{80}},{{80},{80}},{{80},{80}},{{80},{80}},{{80},{80}},{{80},{80}}}; const uint16_t CRendBin_HOA2_HRIR_index_frequency_max_diffuse_16kHz = 0; -#ifdef FIX_INV_DIFFUSE_WEIGHT const float CRendBin_HOA2_HRIR_inv_diffuse_weight_16kHz[BINAURAL_CHANNELS][HOA2_CHANNELS]={{0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f},{0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f}}; -#else -const float CRendBin_HOA2_HRIR_inv_diffuse_weight_16kHz[HOA2_CHANNELS]={0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f}; -#endif const uint16_t *CRendBin_HOA2_HRIR_pIndex_frequency_max_diffuse_16kHz[BINAURAL_CHANNELS]={NULL,NULL}; const float CRendBin_HOA2_HRIR_coeff_re_16kHz[HOA2_CHANNELS][BINAURAL_CHANNELS][80]={ { @@ -1268,11 +1232,7 @@ const uint16_t CRendBin_HOA3_HRIR_num_iterations_48kHz[HOA3_CHANNELS][BINAURAL_C const uint16_t CRendBin_HOA3_HRIR_num_iterations_diffuse_48kHz[BINAURAL_CHANNELS] = {0, 0}; const uint16_t CRendBin_HOA3_HRIR_pIndex_frequency_max_48kHz[HOA3_CHANNELS][BINAURAL_CHANNELS][1]={{{240},{240}},{{240},{240}},{{240},{240}},{{240},{240}},{{240},{240}},{{240},{240}},{{240},{240}},{{240},{240}},{{240},{240}},{{240},{240}},{{240},{240}},{{240},{240}},{{240},{240}},{{240},{240}},{{240},{240}},{{240},{240}}}; const uint16_t CRendBin_HOA3_HRIR_index_frequency_max_diffuse_48kHz = 0; -#ifdef FIX_INV_DIFFUSE_WEIGHT const float CRendBin_HOA3_HRIR_inv_diffuse_weight_48kHz[BINAURAL_CHANNELS][HOA3_CHANNELS]={{0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f},{0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f}}; -#else -const float CRendBin_HOA3_HRIR_inv_diffuse_weight_48kHz[HOA3_CHANNELS]={0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f}; -#endif const uint16_t *CRendBin_HOA3_HRIR_pIndex_frequency_max_diffuse_48kHz[BINAURAL_CHANNELS]={NULL,NULL}; const float CRendBin_HOA3_HRIR_coeff_re_48kHz[HOA3_CHANNELS][BINAURAL_CHANNELS][240]={ { @@ -1544,11 +1504,7 @@ const uint16_t CRendBin_HOA3_HRIR_num_iterations_32kHz[HOA3_CHANNELS][BINAURAL_C const uint16_t CRendBin_HOA3_HRIR_num_iterations_diffuse_32kHz[BINAURAL_CHANNELS] = {0, 0}; const uint16_t CRendBin_HOA3_HRIR_pIndex_frequency_max_32kHz[HOA3_CHANNELS][BINAURAL_CHANNELS][1]={{{160},{160}},{{160},{160}},{{160},{160}},{{160},{160}},{{160},{160}},{{160},{160}},{{160},{160}},{{160},{160}},{{160},{160}},{{160},{160}},{{160},{160}},{{160},{160}},{{160},{160}},{{160},{160}},{{160},{160}},{{160},{160}}}; const uint16_t CRendBin_HOA3_HRIR_index_frequency_max_diffuse_32kHz = 0; -#ifdef FIX_INV_DIFFUSE_WEIGHT const float CRendBin_HOA3_HRIR_inv_diffuse_weight_32kHz[BINAURAL_CHANNELS][HOA3_CHANNELS]={{0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f},{0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f}}; -#else -const float CRendBin_HOA3_HRIR_inv_diffuse_weight_32kHz[HOA3_CHANNELS]={0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f}; -#endif const uint16_t *CRendBin_HOA3_HRIR_pIndex_frequency_max_diffuse_32kHz[BINAURAL_CHANNELS]={NULL,NULL}; const float CRendBin_HOA3_HRIR_coeff_re_32kHz[HOA3_CHANNELS][BINAURAL_CHANNELS][160]={ { @@ -1756,11 +1712,7 @@ const uint16_t CRendBin_HOA3_HRIR_num_iterations_16kHz[HOA3_CHANNELS][BINAURAL_C const uint16_t CRendBin_HOA3_HRIR_num_iterations_diffuse_16kHz[BINAURAL_CHANNELS] = {0, 0}; const uint16_t CRendBin_HOA3_HRIR_pIndex_frequency_max_16kHz[HOA3_CHANNELS][BINAURAL_CHANNELS][1]={{{80},{80}},{{80},{80}},{{80},{80}},{{80},{80}},{{80},{80}},{{80},{80}},{{80},{80}},{{80},{80}},{{80},{80}},{{80},{80}},{{80},{80}},{{80},{80}},{{80},{80}},{{80},{80}},{{80},{80}},{{80},{80}}}; const uint16_t CRendBin_HOA3_HRIR_index_frequency_max_diffuse_16kHz = 0; -#ifdef FIX_INV_DIFFUSE_WEIGHT const float CRendBin_HOA3_HRIR_inv_diffuse_weight_16kHz[BINAURAL_CHANNELS][HOA3_CHANNELS]={{0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f},{0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f}}; -#else -const float CRendBin_HOA3_HRIR_inv_diffuse_weight_16kHz[HOA3_CHANNELS]={0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f}; -#endif const uint16_t *CRendBin_HOA3_HRIR_pIndex_frequency_max_diffuse_16kHz[BINAURAL_CHANNELS]={NULL,NULL}; const float CRendBin_HOA3_HRIR_coeff_re_16kHz[HOA3_CHANNELS][BINAURAL_CHANNELS][80]={ { @@ -1910,11 +1862,7 @@ const uint16_t CRendBin_Combined_BRIR_num_iterations_48kHz[HRTF_LS_CHANNELS][BIN const uint16_t CRendBin_Combined_BRIR_num_iterations_diffuse_48kHz[BINAURAL_CHANNELS] = {40, 40}; const uint16_t CRendBin_Combined_BRIR_pIndex_frequency_max_48kHz[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][22]={{{116, 118, 117, 121, 112, 119, 121, 131, 134, 131, 137, 127, 134, 135, 134, 135, 129, 139, 135, 130, 128, 240},{116, 118, 117, 121, 112, 119, 121, 131, 134, 131, 137, 127, 134, 135, 134, 135, 129, 139, 135, 130, 128, 240}},{{122, 106, 121, 114, 121, 123, 119, 126, 123, 126, 127, 130, 128, 136, 132, 131, 129, 141, 137, 131, 129, 240},{122, 106, 121, 114, 121, 123, 119, 126, 123, 126, 127, 130, 128, 136, 132, 131, 129, 141, 137, 131, 129, 240}},{{118, 104, 116, 104, 123, 123, 122, 125, 130, 128, 132, 135, 131, 132, 131, 132, 135, 137, 144, 129, 129, 240},{118, 104, 116, 104, 123, 123, 122, 125, 130, 128, 132, 135, 131, 132, 131, 132, 135, 137, 144, 129, 129, 240}},{{102, 117, 116, 121, 117, 114, 115, 125, 126, 124, 125, 142, 133, 124, 129, 132, 134, 137, 143, 125, 125, 240},{102, 117, 116, 121, 117, 114, 115, 125, 126, 124, 125, 142, 133, 124, 129, 132, 134, 137, 143, 125, 125, 240}},{{116, 115, 117, 120, 121, 119, 125, 129, 123, 129, 124, 127, 128, 143, 133, 131, 136, 141, 158, 127, 131, 240},{116, 115, 117, 120, 121, 119, 125, 129, 123, 129, 124, 127, 128, 143, 133, 131, 136, 141, 158, 127, 131, 240}},{{112, 106, 118, 123, 115, 120, 129, 123, 130, 127, 130, 130, 131, 131, 131, 135, 134, 153, 138, 132, 127, 240},{112, 106, 118, 123, 115, 120, 129, 123, 130, 127, 130, 130, 131, 131, 131, 135, 134, 153, 138, 132, 127, 240}},{{107, 112, 111, 120, 115, 125, 122, 123, 132, 123, 133, 138, 125, 134, 130, 131, 135, 137, 136, 127, 121, 240},{107, 112, 111, 120, 115, 125, 122, 123, 132, 123, 133, 138, 125, 134, 130, 131, 135, 137, 136, 127, 121, 240}},{{111, 113, 132, 115, 121, 123, 121, 127, 135, 128, 129, 128, 133, 130, 133, 138, 134, 137, 152, 138, 124, 240},{111, 113, 132, 115, 121, 123, 121, 127, 135, 128, 129, 128, 133, 130, 133, 138, 134, 137, 152, 138, 124, 240}},{{114, 104, 114, 117, 125, 127, 123, 129, 123, 127, 144, 131, 138, 132, 129, 129, 132, 134, 136, 127, 121, 240},{114, 104, 114, 117, 125, 127, 123, 129, 123, 127, 144, 131, 138, 132, 129, 129, 132, 134, 136, 127, 121, 240}},{{100, 102, 112, 118, 115, 116, 118, 116, 121, 124, 125, 121, 125, 130, 127, 132, 133, 134, 134, 129, 132, 240},{100, 102, 112, 118, 115, 116, 118, 116, 121, 124, 125, 121, 125, 130, 127, 132, 133, 134, 134, 129, 132, 240}},{{106, 93, 103, 108, 124, 111, 114, 115, 120, 121, 119, 123, 131, 130, 132, 132, 132, 131, 140, 129, 131, 240},{106, 93, 103, 108, 124, 111, 114, 115, 120, 121, 119, 123, 131, 130, 132, 132, 132, 131, 140, 129, 131, 240}},{{108, 101, 115, 115, 115, 110, 121, 124, 124, 120, 122, 129, 124, 128, 125, 132, 135, 133, 138, 160, 119, 240},{108, 101, 115, 115, 115, 110, 121, 124, 124, 120, 122, 129, 124, 128, 125, 132, 135, 133, 138, 160, 119, 240}},{{112, 106, 114, 110, 128, 117, 120, 126, 124, 128, 126, 132, 129, 127, 133, 134, 136, 133, 154, 197, 129, 240},{112, 106, 114, 110, 128, 117, 120, 126, 124, 128, 126, 132, 129, 127, 133, 134, 136, 133, 154, 197, 129, 240}},{{102, 107, 111, 116, 116, 120, 118, 115, 120, 119, 128, 131, 131, 130, 128, 126, 126, 132, 145, 136, 133, 240},{102, 107, 111, 116, 116, 120, 118, 115, 120, 119, 128, 131, 131, 130, 128, 126, 126, 132, 145, 136, 133, 240}},{{111, 117, 106, 120, 123, 121, 125, 125, 130, 125, 123, 123, 127, 131, 125, 131, 135, 134, 148, 134, 132, 240},{111, 117, 106, 120, 123, 121, 125, 125, 130, 125, 123, 123, 127, 131, 125, 131, 135, 134, 148, 134, 132, 240}}}; const uint16_t CRendBin_Combined_BRIR_index_frequency_max_diffuse_48kHz = 98; -#ifdef FIX_INV_DIFFUSE_WEIGHT const float CRendBin_Combined_BRIR_inv_diffuse_weight_48kHz[BINAURAL_CHANNELS][HRTF_LS_CHANNELS]={{0.224183f, 0.227455f, 0.241830f, 0.207155f, 0.218087f, 0.222942f, 0.232158f, 0.248203f, 0.249262f, 0.261591f, 0.246276f, 0.279163f, 0.285701f, 0.262541f, 0.271844f},{0.224183f, 0.227455f, 0.241830f, 0.207155f, 0.218087f, 0.222942f, 0.232158f, 0.248203f, 0.249262f, 0.261591f, 0.246276f, 0.279163f, 0.285701f, 0.262541f, 0.271844f}}; -#else -const float CRendBin_Combined_BRIR_inv_diffuse_weight_48kHz[HRTF_LS_CHANNELS]={0.224183f, 0.227455f, 0.241830f, 0.207155f, 0.218087f, 0.222942f, 0.232158f, 0.248203f, 0.249262f, 0.261591f, 0.246276f, 0.279163f, 0.285701f, 0.262541f, 0.271844f}; -#endif const uint16_t CRendBin_Combined_BRIR_pIndex_frequency_max_diffuse_48kHz[BINAURAL_CHANNELS][40]={{47, 47, 47, 47, 47, 47, 51, 51, 58, 58, 58, 65, 65, 65, 65, 65, 72, 72, 72, 74, 74, 77, 77, 79, 81, 81, 81, 81, 87, 87, 87, 87, 87, 87, 91, 91, 93, 93, 93, 98},{47, 47, 47, 47, 47, 47, 51, 51, 58, 58, 58, 65, 65, 65, 65, 65, 72, 72, 72, 74, 74, 77, 77, 79, 81, 81, 81, 81, 87, 87, 87, 87, 87, 87, 91, 91, 93, 93, 93, 98}}; const float CRendBin_Combined_BRIR_coeff_re_48kHz[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][2955]={ { @@ -3950,11 +3898,7 @@ const uint16_t CRendBin_Combined_BRIR_num_iterations_32kHz[HRTF_LS_CHANNELS][BIN const uint16_t CRendBin_Combined_BRIR_num_iterations_diffuse_32kHz[BINAURAL_CHANNELS] = {40, 40}; const uint16_t CRendBin_Combined_BRIR_pIndex_frequency_max_32kHz[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][22]={{{115, 117, 117, 120, 112, 118, 121, 130, 126, 130, 136, 127, 133, 135, 132, 133, 129, 136, 134, 129, 128, 160},{115, 117, 117, 120, 112, 118, 121, 130, 126, 130, 136, 127, 133, 135, 132, 133, 129, 136, 134, 129, 128, 160}},{{121, 106, 119, 113, 120, 123, 114, 126, 123, 125, 127, 128, 127, 134, 132, 130, 129, 138, 132, 131, 128, 160},{121, 106, 119, 113, 120, 123, 114, 126, 123, 125, 127, 128, 127, 134, 132, 130, 129, 138, 132, 131, 128, 160}},{{113, 103, 116, 104, 123, 123, 122, 124, 130, 128, 132, 131, 131, 132, 130, 132, 130, 135, 137, 128, 127, 160},{113, 103, 116, 104, 123, 123, 122, 124, 130, 128, 132, 131, 131, 132, 130, 132, 130, 135, 137, 128, 127, 160}},{{102, 116, 116, 121, 116, 114, 115, 121, 125, 122, 124, 130, 132, 122, 127, 131, 131, 135, 133, 124, 124, 160},{102, 116, 116, 121, 116, 114, 115, 121, 125, 122, 124, 130, 132, 122, 127, 131, 131, 135, 133, 124, 124, 160}},{{115, 115, 115, 119, 121, 119, 124, 127, 123, 129, 122, 126, 128, 134, 130, 130, 131, 139, 146, 127, 131, 160},{115, 115, 115, 119, 121, 119, 124, 127, 123, 129, 122, 126, 128, 134, 130, 130, 131, 139, 146, 127, 131, 160}},{{112, 106, 118, 121, 115, 117, 128, 123, 128, 125, 130, 129, 131, 131, 130, 134, 133, 148, 130, 132, 126, 160},{112, 106, 118, 121, 115, 117, 128, 123, 128, 125, 130, 129, 131, 131, 130, 134, 133, 148, 130, 132, 126, 160}},{{107, 112, 110, 119, 114, 124, 121, 121, 132, 122, 131, 134, 123, 133, 130, 129, 134, 134, 135, 127, 120, 160},{107, 112, 110, 119, 114, 124, 121, 121, 132, 122, 131, 134, 123, 133, 130, 129, 134, 134, 135, 127, 120, 160}},{{110, 113, 123, 113, 121, 120, 120, 125, 131, 122, 127, 128, 132, 130, 132, 136, 133, 136, 135, 128, 124, 160},{110, 113, 123, 113, 121, 120, 120, 125, 131, 122, 127, 128, 132, 130, 132, 136, 133, 136, 135, 128, 124, 160}},{{114, 101, 113, 113, 124, 126, 123, 128, 122, 127, 132, 126, 136, 128, 126, 127, 132, 132, 129, 125, 121, 160},{114, 101, 113, 113, 124, 126, 123, 128, 122, 127, 132, 126, 136, 128, 126, 127, 132, 132, 129, 125, 121, 160}},{{99, 100, 111, 117, 114, 113, 118, 116, 121, 123, 124, 121, 125, 130, 127, 132, 132, 129, 133, 128, 131, 160},{99, 100, 111, 117, 114, 113, 118, 116, 121, 123, 124, 121, 125, 130, 127, 132, 132, 129, 133, 128, 131, 160}},{{105, 93, 103, 108, 119, 110, 111, 114, 120, 121, 119, 122, 130, 128, 130, 131, 132, 131, 135, 127, 129, 160},{105, 93, 103, 108, 119, 110, 111, 114, 120, 121, 119, 122, 130, 128, 130, 131, 132, 131, 135, 127, 129, 160}},{{105, 100, 112, 114, 115, 108, 116, 120, 123, 117, 122, 129, 124, 128, 124, 132, 135, 131, 138, 154, 116, 160},{105, 100, 112, 114, 115, 108, 116, 120, 123, 117, 122, 129, 124, 128, 124, 132, 135, 131, 138, 154, 116, 160}},{{110, 106, 113, 110, 122, 116, 118, 125, 123, 127, 125, 127, 128, 127, 133, 129, 132, 132, 142, 147, 127, 160},{110, 106, 113, 110, 122, 116, 118, 125, 123, 127, 125, 127, 128, 127, 133, 129, 132, 132, 142, 147, 127, 160}},{{102, 107, 110, 112, 115, 117, 117, 115, 120, 118, 127, 130, 130, 129, 126, 126, 125, 130, 141, 134, 126, 160},{102, 107, 110, 112, 115, 117, 117, 115, 120, 118, 127, 130, 130, 129, 126, 126, 125, 130, 141, 134, 126, 160}},{{110, 117, 106, 118, 118, 115, 121, 124, 128, 125, 122, 121, 126, 130, 124, 130, 133, 131, 137, 133, 131, 160},{110, 117, 106, 118, 118, 115, 121, 124, 128, 125, 122, 121, 126, 130, 124, 130, 133, 131, 137, 133, 131, 160}}}; const uint16_t CRendBin_Combined_BRIR_index_frequency_max_diffuse_32kHz = 97; -#ifdef FIX_INV_DIFFUSE_WEIGHT const float CRendBin_Combined_BRIR_inv_diffuse_weight_32kHz[BINAURAL_CHANNELS][HRTF_LS_CHANNELS]={{0.224196f, 0.227460f, 0.241819f, 0.207160f, 0.218132f, 0.222950f, 0.232154f, 0.248179f, 0.249232f, 0.261592f, 0.246334f, 0.279153f, 0.285801f, 0.262550f, 0.271878f},{0.224196f, 0.227460f, 0.241819f, 0.207160f, 0.218132f, 0.222950f, 0.232154f, 0.248179f, 0.249232f, 0.261592f, 0.246334f, 0.279153f, 0.285801f, 0.262550f, 0.271878f}}; -#else -const float CRendBin_Combined_BRIR_inv_diffuse_weight_32kHz[HRTF_LS_CHANNELS]={0.224196f, 0.227460f, 0.241819f, 0.207160f, 0.218132f, 0.222950f, 0.232154f, 0.248179f, 0.249232f, 0.261592f, 0.246334f, 0.279153f, 0.285801f, 0.262550f, 0.271878f}; -#endif const uint16_t CRendBin_Combined_BRIR_pIndex_frequency_max_diffuse_32kHz[BINAURAL_CHANNELS][40]={{47, 47, 47, 47, 47, 47, 50, 50, 56, 56, 56, 62, 62, 63, 63, 63, 72, 72, 72, 74, 74, 77, 77, 79, 81, 81, 81, 81, 87, 87, 87, 87, 87, 87, 93, 93, 93, 93, 93, 97},{47, 47, 47, 47, 47, 47, 50, 50, 56, 56, 56, 62, 62, 63, 63, 63, 72, 72, 72, 74, 74, 77, 77, 79, 81, 81, 81, 81, 87, 87, 87, 87, 87, 87, 93, 93, 93, 93, 93, 97}}; const float CRendBin_Combined_BRIR_coeff_re_32kHz[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][2818]={ { @@ -5910,11 +5854,7 @@ const uint16_t CRendBin_Combined_BRIR_num_iterations_16kHz[HRTF_LS_CHANNELS][BIN const uint16_t CRendBin_Combined_BRIR_num_iterations_diffuse_16kHz[BINAURAL_CHANNELS] = {40, 40}; const uint16_t CRendBin_Combined_BRIR_pIndex_frequency_max_16kHz[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][23]={{{77, 77, 77, 79, 77, 78, 79, 79, 79, 77, 78, 77, 78, 78, 77, 79, 79, 79, 79, 78, 79, 77, 80},{77, 77, 77, 79, 77, 78, 79, 79, 79, 77, 78, 77, 78, 78, 77, 79, 79, 79, 79, 78, 79, 77, 80}},{{78, 77, 78, 78, 79, 79, 78, 78, 79, 79, 77, 79, 78, 79, 76, 79, 78, 78, 76, 79, 79, 78, 80},{78, 77, 78, 78, 79, 79, 78, 78, 79, 79, 77, 79, 78, 79, 76, 79, 78, 78, 76, 79, 79, 78, 80}},{{77, 76, 74, 79, 74, 77, 77, 77, 76, 79, 77, 78, 76, 78, 76, 78, 79, 78, 79, 79, 78, 78, 80},{77, 76, 74, 79, 74, 77, 77, 77, 76, 79, 77, 78, 76, 78, 76, 78, 79, 78, 79, 79, 78, 78, 80}},{{76, 78, 78, 78, 78, 79, 76, 77, 79, 78, 77, 79, 79, 79, 78, 79, 78, 77, 78, 79, 78, 78, 80},{76, 78, 78, 78, 78, 79, 76, 77, 79, 78, 77, 79, 79, 79, 78, 79, 78, 77, 78, 79, 78, 78, 80}},{{78, 77, 77, 76, 79, 77, 79, 78, 76, 78, 78, 78, 79, 79, 78, 78, 79, 78, 78, 79, 78, 77, 80},{78, 77, 77, 76, 79, 77, 79, 78, 76, 78, 78, 78, 79, 79, 78, 78, 79, 78, 78, 79, 78, 77, 80}},{{78, 76, 78, 77, 78, 78, 78, 78, 79, 78, 79, 79, 78, 78, 78, 77, 79, 77, 78, 79, 78, 78, 80},{78, 76, 78, 77, 78, 78, 78, 78, 79, 78, 79, 79, 78, 78, 78, 77, 79, 77, 78, 79, 78, 78, 80}},{{78, 76, 75, 78, 76, 78, 79, 77, 79, 78, 77, 77, 79, 79, 78, 77, 78, 79, 78, 79, 76, 78, 80},{78, 76, 75, 78, 76, 78, 79, 77, 79, 78, 77, 77, 79, 79, 78, 77, 78, 79, 78, 79, 76, 78, 80}},{{78, 76, 78, 77, 75, 77, 77, 79, 79, 79, 78, 79, 78, 79, 79, 78, 78, 79, 79, 79, 79, 76, 80},{78, 76, 78, 77, 75, 77, 77, 79, 79, 79, 78, 79, 78, 79, 79, 78, 78, 79, 79, 79, 79, 76, 80}},{{78, 79, 78, 76, 77, 78, 77, 77, 78, 78, 79, 79, 76, 78, 78, 79, 79, 79, 78, 79, 78, 77, 80},{78, 79, 78, 76, 77, 78, 77, 77, 78, 78, 79, 79, 76, 78, 78, 79, 79, 79, 78, 79, 78, 77, 80}},{{75, 75, 78, 78, 78, 79, 78, 78, 78, 78, 78, 79, 76, 78, 78, 78, 79, 79, 78, 79, 79, 76, 80},{75, 75, 78, 78, 78, 79, 78, 78, 78, 78, 78, 79, 76, 78, 78, 78, 79, 79, 78, 79, 79, 76, 80}},{{76, 76, 77, 76, 79, 79, 76, 79, 76, 77, 79, 77, 79, 77, 78, 75, 78, 79, 78, 79, 78, 79, 80},{76, 76, 77, 76, 79, 79, 76, 79, 76, 77, 79, 77, 79, 77, 78, 75, 78, 79, 78, 79, 78, 79, 80}},{{76, 79, 76, 74, 78, 78, 77, 77, 78, 79, 78, 78, 77, 77, 79, 77, 79, 78, 79, 79, 77, 78, 80},{76, 79, 76, 74, 78, 78, 77, 77, 78, 79, 78, 78, 77, 77, 79, 77, 79, 78, 79, 79, 77, 78, 80}},{{76, 78, 79, 78, 76, 78, 78, 78, 77, 78, 74, 77, 79, 78, 78, 79, 79, 79, 79, 79, 77, 79, 80},{76, 78, 79, 78, 76, 78, 78, 78, 77, 78, 74, 77, 79, 78, 78, 79, 79, 79, 79, 79, 77, 79, 80}},{{75, 78, 78, 76, 78, 77, 78, 78, 77, 78, 78, 79, 79, 79, 75, 77, 79, 79, 79, 76, 79, 77, 80},{75, 78, 78, 76, 78, 77, 78, 78, 77, 78, 78, 79, 79, 79, 75, 77, 79, 79, 79, 76, 79, 77, 80}},{{78, 77, 77, 78, 76, 78, 78, 76, 78, 79, 79, 79, 79, 79, 76, 79, 79, 79, 79, 76, 78, 79, 80},{78, 77, 77, 78, 76, 78, 78, 76, 78, 79, 79, 79, 79, 79, 76, 79, 79, 79, 79, 76, 78, 79, 80}}}; const uint16_t CRendBin_Combined_BRIR_index_frequency_max_diffuse_16kHz = 77; -#ifdef FIX_INV_DIFFUSE_WEIGHT const float CRendBin_Combined_BRIR_inv_diffuse_weight_16kHz[BINAURAL_CHANNELS][HRTF_LS_CHANNELS]={{0.222851f, 0.226528f, 0.249241f, 0.208677f, 0.219855f, 0.219498f, 0.230603f, 0.248624f, 0.251270f, 0.263876f, 0.243763f, 0.281177f, 0.282748f, 0.261662f, 0.273417f},{0.222851f, 0.226528f, 0.249241f, 0.208677f, 0.219855f, 0.219498f, 0.230603f, 0.248624f, 0.251270f, 0.263876f, 0.243763f, 0.281177f, 0.282748f, 0.261662f, 0.273417f}}; -#else -const float CRendBin_Combined_BRIR_inv_diffuse_weight_16kHz[HRTF_LS_CHANNELS]={0.222851f, 0.226528f, 0.249241f, 0.208677f, 0.219855f, 0.219498f, 0.230603f, 0.248624f, 0.251270f, 0.263876f, 0.243763f, 0.281177f, 0.282748f, 0.261662f, 0.273417f}; -#endif const uint16_t CRendBin_Combined_BRIR_pIndex_frequency_max_diffuse_16kHz[BINAURAL_CHANNELS][40]={{46, 46, 46, 46, 46, 46, 46, 49, 49, 53, 53, 53, 54, 54, 59, 59, 59, 65, 65, 65, 65, 65, 65, 65, 65, 71, 71, 71, 71, 72, 73, 73, 73, 73, 73, 73, 73, 73, 73, 77},{46, 46, 46, 46, 46, 46, 46, 49, 49, 53, 53, 53, 54, 54, 59, 59, 59, 65, 65, 65, 65, 65, 65, 65, 65, 71, 71, 71, 71, 72, 73, 73, 73, 73, 73, 73, 73, 73, 73, 77}}; const float CRendBin_Combined_BRIR_coeff_re_16kHz[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][1799]={ { diff --git a/lib_rend/ivas_rom_binaural_crend_head.h b/lib_rend/ivas_rom_binaural_crend_head.h index ee16e94cd9..abbf51f01d 100644 --- a/lib_rend/ivas_rom_binaural_crend_head.h +++ b/lib_rend/ivas_rom_binaural_crend_head.h @@ -60,11 +60,7 @@ extern uint16_t CRendBin_Combined_HRIR_num_iterations_48kHz[HRTF_LS_CHANNELS][BI extern uint16_t CRendBin_Combined_HRIR_num_iterations_diffuse_48kHz[BINAURAL_CHANNELS]; extern uint16_t CRendBin_Combined_HRIR_pIndex_frequency_max_48kHz[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][1]; extern uint16_t CRendBin_Combined_HRIR_index_frequency_max_diffuse_48kHz; -#ifdef FIX_INV_DIFFUSE_WEIGHT extern float CRendBin_Combined_HRIR_inv_diffuse_weight_48kHz[BINAURAL_CHANNELS][HRTF_LS_CHANNELS]; -#else -extern float CRendBin_Combined_HRIR_inv_diffuse_weight_48kHz[HRTF_LS_CHANNELS]; -#endif extern uint16_t *CRendBin_Combined_HRIR_pIndex_frequency_max_diffuse_48kHz[BINAURAL_CHANNELS]; extern float CRendBin_Combined_HRIR_coeff_re_48kHz[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][240]; extern float CRendBin_Combined_HRIR_coeff_im_48kHz[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][240]; @@ -78,11 +74,7 @@ extern uint16_t CRendBin_Combined_HRIR_num_iterations_32kHz[HRTF_LS_CHANNELS][BI extern uint16_t CRendBin_Combined_HRIR_num_iterations_diffuse_32kHz[BINAURAL_CHANNELS]; extern uint16_t CRendBin_Combined_HRIR_pIndex_frequency_max_32kHz[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][1]; extern uint16_t CRendBin_Combined_HRIR_index_frequency_max_diffuse_32kHz; -#ifdef FIX_INV_DIFFUSE_WEIGHT extern float CRendBin_Combined_HRIR_inv_diffuse_weight_32kHz[BINAURAL_CHANNELS][HRTF_LS_CHANNELS]; -#else -extern float CRendBin_Combined_HRIR_inv_diffuse_weight_32kHz[HRTF_LS_CHANNELS]; -#endif extern uint16_t *CRendBin_Combined_HRIR_pIndex_frequency_max_diffuse_32kHz[BINAURAL_CHANNELS]; extern float CRendBin_Combined_HRIR_coeff_re_32kHz[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][160]; extern float CRendBin_Combined_HRIR_coeff_im_32kHz[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][160]; @@ -96,11 +88,7 @@ extern uint16_t CRendBin_Combined_HRIR_num_iterations_16kHz[HRTF_LS_CHANNELS][BI extern uint16_t CRendBin_Combined_HRIR_num_iterations_diffuse_16kHz[BINAURAL_CHANNELS]; extern uint16_t CRendBin_Combined_HRIR_pIndex_frequency_max_16kHz[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][1]; extern uint16_t CRendBin_Combined_HRIR_index_frequency_max_diffuse_16kHz; -#ifdef FIX_INV_DIFFUSE_WEIGHT extern float CRendBin_Combined_HRIR_inv_diffuse_weight_16kHz[BINAURAL_CHANNELS][HRTF_LS_CHANNELS]; -#else -extern float CRendBin_Combined_HRIR_inv_diffuse_weight_16kHz[HRTF_LS_CHANNELS]; -#endif extern uint16_t *CRendBin_Combined_HRIR_pIndex_frequency_max_diffuse_16kHz[BINAURAL_CHANNELS]; extern float CRendBin_Combined_HRIR_coeff_re_16kHz[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][80]; extern float CRendBin_Combined_HRIR_coeff_im_16kHz[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][80]; @@ -120,11 +108,7 @@ extern uint16_t CRendBin_FOA_HRIR_num_iterations_48kHz[FOA_CHANNELS][BINAURAL_CH extern uint16_t CRendBin_FOA_HRIR_num_iterations_diffuse_48kHz[BINAURAL_CHANNELS]; extern uint16_t CRendBin_FOA_HRIR_pIndex_frequency_max_48kHz[FOA_CHANNELS][BINAURAL_CHANNELS][1]; extern uint16_t CRendBin_FOA_HRIR_index_frequency_max_diffuse_48kHz; -#ifdef FIX_INV_DIFFUSE_WEIGHT extern float CRendBin_FOA_HRIR_inv_diffuse_weight_48kHz[BINAURAL_CHANNELS][FOA_CHANNELS]; -#else -extern float CRendBin_FOA_HRIR_inv_diffuse_weight_48kHz[FOA_CHANNELS]; -#endif extern uint16_t *CRendBin_FOA_HRIR_pIndex_frequency_max_diffuse_48kHz[BINAURAL_CHANNELS]; extern float CRendBin_FOA_HRIR_coeff_re_48kHz[FOA_CHANNELS][BINAURAL_CHANNELS][240]; extern float CRendBin_FOA_HRIR_coeff_im_48kHz[FOA_CHANNELS][BINAURAL_CHANNELS][240]; @@ -138,11 +122,7 @@ extern uint16_t CRendBin_FOA_HRIR_num_iterations_32kHz[FOA_CHANNELS][BINAURAL_CH extern uint16_t CRendBin_FOA_HRIR_num_iterations_diffuse_32kHz[BINAURAL_CHANNELS]; extern uint16_t CRendBin_FOA_HRIR_pIndex_frequency_max_32kHz[FOA_CHANNELS][BINAURAL_CHANNELS][1]; extern uint16_t CRendBin_FOA_HRIR_index_frequency_max_diffuse_32kHz; -#ifdef FIX_INV_DIFFUSE_WEIGHT extern float CRendBin_FOA_HRIR_inv_diffuse_weight_32kHz[BINAURAL_CHANNELS][FOA_CHANNELS]; -#else -extern float CRendBin_FOA_HRIR_inv_diffuse_weight_32kHz[FOA_CHANNELS]; -#endif extern uint16_t *CRendBin_FOA_HRIR_pIndex_frequency_max_diffuse_32kHz[BINAURAL_CHANNELS]; extern float CRendBin_FOA_HRIR_coeff_re_32kHz[FOA_CHANNELS][BINAURAL_CHANNELS][160]; extern float CRendBin_FOA_HRIR_coeff_im_32kHz[FOA_CHANNELS][BINAURAL_CHANNELS][160]; @@ -156,11 +136,7 @@ extern uint16_t CRendBin_FOA_HRIR_num_iterations_16kHz[FOA_CHANNELS][BINAURAL_CH extern uint16_t CRendBin_FOA_HRIR_num_iterations_diffuse_16kHz[BINAURAL_CHANNELS]; extern uint16_t CRendBin_FOA_HRIR_pIndex_frequency_max_16kHz[FOA_CHANNELS][BINAURAL_CHANNELS][1]; extern uint16_t CRendBin_FOA_HRIR_index_frequency_max_diffuse_16kHz; -#ifdef FIX_INV_DIFFUSE_WEIGHT extern float CRendBin_FOA_HRIR_inv_diffuse_weight_16kHz[BINAURAL_CHANNELS][FOA_CHANNELS]; -#else -extern float CRendBin_FOA_HRIR_inv_diffuse_weight_16kHz[FOA_CHANNELS]; -#endif extern uint16_t *CRendBin_FOA_HRIR_pIndex_frequency_max_diffuse_16kHz[BINAURAL_CHANNELS]; extern float CRendBin_FOA_HRIR_coeff_re_16kHz[FOA_CHANNELS][BINAURAL_CHANNELS][80]; extern float CRendBin_FOA_HRIR_coeff_im_16kHz[FOA_CHANNELS][BINAURAL_CHANNELS][80]; @@ -180,11 +156,7 @@ extern uint16_t CRendBin_HOA2_HRIR_num_iterations_48kHz[HOA2_CHANNELS][BINAURAL_ extern uint16_t CRendBin_HOA2_HRIR_num_iterations_diffuse_48kHz[BINAURAL_CHANNELS]; extern uint16_t CRendBin_HOA2_HRIR_pIndex_frequency_max_48kHz[HOA2_CHANNELS][BINAURAL_CHANNELS][1]; extern uint16_t CRendBin_HOA2_HRIR_index_frequency_max_diffuse_48kHz; -#ifdef FIX_INV_DIFFUSE_WEIGHT extern float CRendBin_HOA2_HRIR_inv_diffuse_weight_48kHz[BINAURAL_CHANNELS][HOA2_CHANNELS]; -#else -extern float CRendBin_HOA2_HRIR_inv_diffuse_weight_48kHz[HOA2_CHANNELS]; -#endif extern uint16_t *CRendBin_HOA2_HRIR_pIndex_frequency_max_diffuse_48kHz[BINAURAL_CHANNELS]; extern float CRendBin_HOA2_HRIR_coeff_re_48kHz[HOA2_CHANNELS][BINAURAL_CHANNELS][240]; extern float CRendBin_HOA2_HRIR_coeff_im_48kHz[HOA2_CHANNELS][BINAURAL_CHANNELS][240]; @@ -198,11 +170,7 @@ extern uint16_t CRendBin_HOA2_HRIR_num_iterations_32kHz[HOA2_CHANNELS][BINAURAL_ extern uint16_t CRendBin_HOA2_HRIR_num_iterations_diffuse_32kHz[BINAURAL_CHANNELS]; extern uint16_t CRendBin_HOA2_HRIR_pIndex_frequency_max_32kHz[HOA2_CHANNELS][BINAURAL_CHANNELS][1]; extern uint16_t CRendBin_HOA2_HRIR_index_frequency_max_diffuse_32kHz; -#ifdef FIX_INV_DIFFUSE_WEIGHT extern float CRendBin_HOA2_HRIR_inv_diffuse_weight_32kHz[BINAURAL_CHANNELS][HOA2_CHANNELS]; -#else -extern float CRendBin_HOA2_HRIR_inv_diffuse_weight_32kHz[HOA2_CHANNELS]; -#endif extern uint16_t *CRendBin_HOA2_HRIR_pIndex_frequency_max_diffuse_32kHz[BINAURAL_CHANNELS]; extern float CRendBin_HOA2_HRIR_coeff_re_32kHz[HOA2_CHANNELS][BINAURAL_CHANNELS][160]; extern float CRendBin_HOA2_HRIR_coeff_im_32kHz[HOA2_CHANNELS][BINAURAL_CHANNELS][160]; @@ -216,11 +184,7 @@ extern uint16_t CRendBin_HOA2_HRIR_num_iterations_16kHz[HOA2_CHANNELS][BINAURAL_ extern uint16_t CRendBin_HOA2_HRIR_num_iterations_diffuse_16kHz[BINAURAL_CHANNELS]; extern uint16_t CRendBin_HOA2_HRIR_pIndex_frequency_max_16kHz[HOA2_CHANNELS][BINAURAL_CHANNELS][1]; extern uint16_t CRendBin_HOA2_HRIR_index_frequency_max_diffuse_16kHz; -#ifdef FIX_INV_DIFFUSE_WEIGHT extern float CRendBin_HOA2_HRIR_inv_diffuse_weight_16kHz[BINAURAL_CHANNELS][HOA2_CHANNELS]; -#else -extern float CRendBin_HOA2_HRIR_inv_diffuse_weight_16kHz[HOA2_CHANNELS]; -#endif extern uint16_t *CRendBin_HOA2_HRIR_pIndex_frequency_max_diffuse_16kHz[BINAURAL_CHANNELS]; extern float CRendBin_HOA2_HRIR_coeff_re_16kHz[HOA2_CHANNELS][BINAURAL_CHANNELS][80]; extern float CRendBin_HOA2_HRIR_coeff_im_16kHz[HOA2_CHANNELS][BINAURAL_CHANNELS][80]; @@ -240,11 +204,7 @@ extern uint16_t CRendBin_HOA3_HRIR_num_iterations_48kHz[HOA3_CHANNELS][BINAURAL_ extern uint16_t CRendBin_HOA3_HRIR_num_iterations_diffuse_48kHz[BINAURAL_CHANNELS]; extern uint16_t CRendBin_HOA3_HRIR_pIndex_frequency_max_48kHz[HOA3_CHANNELS][BINAURAL_CHANNELS][1]; extern uint16_t CRendBin_HOA3_HRIR_index_frequency_max_diffuse_48kHz; -#ifdef FIX_INV_DIFFUSE_WEIGHT extern float CRendBin_HOA3_HRIR_inv_diffuse_weight_48kHz[BINAURAL_CHANNELS][HOA3_CHANNELS]; -#else -extern float CRendBin_HOA3_HRIR_inv_diffuse_weight_48kHz[HOA3_CHANNELS]; -#endif extern uint16_t *CRendBin_HOA3_HRIR_pIndex_frequency_max_diffuse_48kHz[BINAURAL_CHANNELS]; extern float CRendBin_HOA3_HRIR_coeff_re_48kHz[HOA3_CHANNELS][BINAURAL_CHANNELS][240]; extern float CRendBin_HOA3_HRIR_coeff_im_48kHz[HOA3_CHANNELS][BINAURAL_CHANNELS][240]; @@ -258,11 +218,7 @@ extern uint16_t CRendBin_HOA3_HRIR_num_iterations_32kHz[HOA3_CHANNELS][BINAURAL_ extern uint16_t CRendBin_HOA3_HRIR_num_iterations_diffuse_32kHz[BINAURAL_CHANNELS]; extern uint16_t CRendBin_HOA3_HRIR_pIndex_frequency_max_32kHz[HOA3_CHANNELS][BINAURAL_CHANNELS][1]; extern uint16_t CRendBin_HOA3_HRIR_index_frequency_max_diffuse_32kHz; -#ifdef FIX_INV_DIFFUSE_WEIGHT extern float CRendBin_HOA3_HRIR_inv_diffuse_weight_32kHz[BINAURAL_CHANNELS][HOA3_CHANNELS]; -#else -extern float CRendBin_HOA3_HRIR_inv_diffuse_weight_32kHz[HOA3_CHANNELS]; -#endif extern uint16_t *CRendBin_HOA3_HRIR_pIndex_frequency_max_diffuse_32kHz[BINAURAL_CHANNELS]; extern float CRendBin_HOA3_HRIR_coeff_re_32kHz[HOA3_CHANNELS][BINAURAL_CHANNELS][160]; extern float CRendBin_HOA3_HRIR_coeff_im_32kHz[HOA3_CHANNELS][BINAURAL_CHANNELS][160]; @@ -276,11 +232,7 @@ extern uint16_t CRendBin_HOA3_HRIR_num_iterations_16kHz[HOA3_CHANNELS][BINAURAL_ extern uint16_t CRendBin_HOA3_HRIR_num_iterations_diffuse_16kHz[BINAURAL_CHANNELS]; extern uint16_t CRendBin_HOA3_HRIR_pIndex_frequency_max_16kHz[HOA3_CHANNELS][BINAURAL_CHANNELS][1]; extern uint16_t CRendBin_HOA3_HRIR_index_frequency_max_diffuse_16kHz; -#ifdef FIX_INV_DIFFUSE_WEIGHT extern float CRendBin_HOA3_HRIR_inv_diffuse_weight_16kHz[BINAURAL_CHANNELS][HOA3_CHANNELS]; -#else -extern float CRendBin_HOA3_HRIR_inv_diffuse_weight_16kHz[HOA3_CHANNELS]; -#endif extern uint16_t *CRendBin_HOA3_HRIR_pIndex_frequency_max_diffuse_16kHz[BINAURAL_CHANNELS]; extern float CRendBin_HOA3_HRIR_coeff_re_16kHz[HOA3_CHANNELS][BINAURAL_CHANNELS][80]; extern float CRendBin_HOA3_HRIR_coeff_im_16kHz[HOA3_CHANNELS][BINAURAL_CHANNELS][80]; @@ -300,11 +252,7 @@ extern uint16_t CRendBin_Combined_BRIR_num_iterations_48kHz[HRTF_LS_CHANNELS][BI extern uint16_t CRendBin_Combined_BRIR_num_iterations_diffuse_48kHz[BINAURAL_CHANNELS]; extern uint16_t CRendBin_Combined_BRIR_pIndex_frequency_max_48kHz[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][22]; extern uint16_t CRendBin_Combined_BRIR_index_frequency_max_diffuse_48kHz; -#ifdef FIX_INV_DIFFUSE_WEIGHT extern float CRendBin_Combined_BRIR_inv_diffuse_weight_48kHz[BINAURAL_CHANNELS][HRTF_LS_CHANNELS]; -#else -extern float CRendBin_Combined_BRIR_inv_diffuse_weight_48kHz[HRTF_LS_CHANNELS]; -#endif extern uint16_t CRendBin_Combined_BRIR_pIndex_frequency_max_diffuse_48kHz[BINAURAL_CHANNELS][40]; extern float CRendBin_Combined_BRIR_coeff_re_48kHz[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][2955]; extern float CRendBin_Combined_BRIR_coeff_im_48kHz[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][2955]; @@ -318,11 +266,7 @@ extern uint16_t CRendBin_Combined_BRIR_num_iterations_32kHz[HRTF_LS_CHANNELS][BI extern uint16_t CRendBin_Combined_BRIR_num_iterations_diffuse_32kHz[BINAURAL_CHANNELS]; extern uint16_t CRendBin_Combined_BRIR_pIndex_frequency_max_32kHz[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][22]; extern uint16_t CRendBin_Combined_BRIR_index_frequency_max_diffuse_32kHz; -#ifdef FIX_INV_DIFFUSE_WEIGHT extern float CRendBin_Combined_BRIR_inv_diffuse_weight_32kHz[BINAURAL_CHANNELS][HRTF_LS_CHANNELS]; -#else -extern float CRendBin_Combined_BRIR_inv_diffuse_weight_32kHz[HRTF_LS_CHANNELS]; -#endif extern uint16_t CRendBin_Combined_BRIR_pIndex_frequency_max_diffuse_32kHz[BINAURAL_CHANNELS][40]; extern float CRendBin_Combined_BRIR_coeff_re_32kHz[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][2818]; extern float CRendBin_Combined_BRIR_coeff_im_32kHz[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][2818]; @@ -336,11 +280,7 @@ extern uint16_t CRendBin_Combined_BRIR_num_iterations_16kHz[HRTF_LS_CHANNELS][BI extern uint16_t CRendBin_Combined_BRIR_num_iterations_diffuse_16kHz[BINAURAL_CHANNELS]; extern uint16_t CRendBin_Combined_BRIR_pIndex_frequency_max_16kHz[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][23]; extern uint16_t CRendBin_Combined_BRIR_index_frequency_max_diffuse_16kHz; -#ifdef FIX_INV_DIFFUSE_WEIGHT extern float CRendBin_Combined_BRIR_inv_diffuse_weight_16kHz[BINAURAL_CHANNELS][HRTF_LS_CHANNELS]; -#else -extern float CRendBin_Combined_BRIR_inv_diffuse_weight_16kHz[HRTF_LS_CHANNELS]; -#endif extern uint16_t CRendBin_Combined_BRIR_pIndex_frequency_max_diffuse_16kHz[BINAURAL_CHANNELS][40]; extern float CRendBin_Combined_BRIR_coeff_re_16kHz[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][1799]; extern float CRendBin_Combined_BRIR_coeff_im_16kHz[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][1799]; diff --git a/lib_rend/ivas_stat_rend.h b/lib_rend/ivas_stat_rend.h index aa37b22ae7..35ee806739 100644 --- a/lib_rend/ivas_stat_rend.h +++ b/lib_rend/ivas_stat_rend.h @@ -1204,12 +1204,8 @@ typedef struct ivas_hrtfs_structure #ifdef NONBE_FIX_BINARY_BINAURAL_READING int16_t init_from_rom; #endif -#ifdef FIX_INV_DIFFUSE_WEIGHT float inv_diffuse_weight[BINAURAL_CHANNELS][MAX_INTERN_CHANNELS]; /* inverse diffuse weights array, access one inverse weight by pInvDiffuseWeight[channel] */ int16_t same_inv_diffuse_weight; -#else - float inv_diffuse_weight[MAX_INTERN_CHANNELS]; /* inverse diffuse weights array, access one inverse weight by pInvDiffuseWeight[channel] */ -#endif float gain_lfe; } HRTFS_DATA, *HRTFS_HANDLE; @@ -1220,13 +1216,8 @@ typedef struct ivas_crend_state_t { float *freq_buffer_re[MAX_INTERN_CHANNELS]; float *freq_buffer_im[MAX_INTERN_CHANNELS]; -#ifdef FIX_INV_DIFFUSE_WEIGHT float *freq_buffer_re_diffuse[BINAURAL_CHANNELS]; float *freq_buffer_im_diffuse[BINAURAL_CHANNELS]; -#else - float *freq_buffer_re_diffuse; - float *freq_buffer_im_diffuse; -#endif float *prev_out_buffer[BINAURAL_CHANNELS]; float *lfe_delay_line; float m_fYaw; diff --git a/lib_util/hrtf_file_reader.c b/lib_util/hrtf_file_reader.c index ea1dcb868c..206ca9019b 100644 --- a/lib_util/hrtf_file_reader.c +++ b/lib_util/hrtf_file_reader.c @@ -1196,7 +1196,6 @@ static ivas_error create_HRTF_from_rawdata( hrtf_data_rptr += sizeof( uint16_t ); /* inv_diffuse_weight */ -#ifdef FIX_INV_DIFFUSE_WEIGHT for ( i = 0; i < ( *hHRTF )->max_num_ir; i++ ) { ( *hHRTF )->inv_diffuse_weight[0][i] = *( (float *) ( hrtf_data_rptr ) ); @@ -1207,13 +1206,6 @@ static ivas_error create_HRTF_from_rawdata( ( *hHRTF )->inv_diffuse_weight[1][i] = *( (float *) ( hrtf_data_rptr ) ); hrtf_data_rptr += sizeof( float ); } -#else - for ( i = 0; i < ( *hHRTF )->max_num_ir; i++ ) - { - ( *hHRTF )->inv_diffuse_weight[i] = *( (float *) ( hrtf_data_rptr ) ); - hrtf_data_rptr += sizeof( float ); - } -#endif /* max_total_num_fsamp_per_iteration */ max_total_num_fsamp_per_iteration = *( (uint16_t *) ( hrtf_data_rptr ) ); diff --git a/scripts/binauralRenderer_interface/Table_Format_Converter/generate_tables_from_rom_to_bin.c b/scripts/binauralRenderer_interface/Table_Format_Converter/generate_tables_from_rom_to_bin.c index 6bc8f28098..848c3cfe1b 100644 --- a/scripts/binauralRenderer_interface/Table_Format_Converter/generate_tables_from_rom_to_bin.c +++ b/scripts/binauralRenderer_interface/Table_Format_Converter/generate_tables_from_rom_to_bin.c @@ -1877,11 +1877,7 @@ int32_t compute_crend_hrtf_data_size( crend_hrtf_tables_pointers *hrtf_table_ptr } hrtf_data_size += sizeof( uint16_t ); // index_frequency_max_diffuse -#ifdef FIX_INV_DIFFUSE_WEIGHT hrtf_data_size += hrtf_table_dims->max_num_ir * BINAURAL_CHANNELS * sizeof( float ); // inv_diffuse_weight -#else - hrtf_data_size += hrtf_table_dims->max_num_ir * sizeof( float ); // inv_diffuse_weight -#endif hrtf_data_size += sizeof( uint16_t ); // max_total_num_fsamp_per_iteration // coeff_re & coeff_im : The size depends on pIndex_frequency_max for ( iIR = 0, iIndex = 0; iIR < hrtf_table_dims->max_num_ir; iIR++ ) @@ -2168,11 +2164,7 @@ int16_t check_hrtf_data( HRTF_READER_RENDERER_TYPE rend_type, BINAURAL_INPUT_AUD hrtf_data_in_rptr += sizeof( uint16_t ); // inv_diffuse_weight -#ifdef FIX_INV_DIFFUSE_WEIGHT ctrl_size = tabs_dims.max_num_ir * BINAURAL_CHANNELS * sizeof( float ); -#else - ctrl_size = tabs_dims.max_num_ir * sizeof( float ); -#endif if ( memcmp( tabs_ptrs.inv_diffuse_weight, hrtf_data_in_rptr, ctrl_size ) != 0 ) { fprintf( stderr, "check_hrtf_data of binary file failed: bad inv_diffuse_weight!\n\n" ); diff --git a/scripts/binauralRenderer_interface/generate_crend_ivas_tables_from_sofa.c b/scripts/binauralRenderer_interface/generate_crend_ivas_tables_from_sofa.c index f27fce819e..8836a9edb3 100644 --- a/scripts/binauralRenderer_interface/generate_crend_ivas_tables_from_sofa.c +++ b/scripts/binauralRenderer_interface/generate_crend_ivas_tables_from_sofa.c @@ -339,7 +339,6 @@ int main( int argc, char *argv[] ) strcpy( binary_common_file_name, argv[i] ); i++; } -#ifdef FIX_INV_DIFFUSE_WEIGHT else if ( strcmp( to_upper( argv[i] ), "-BRIR_OPTIM_CONFIG_PATH" ) == 0 ) { i++; @@ -359,7 +358,6 @@ int main( int argc, char *argv[] ) } i++; } -#endif else if ( strcmp( to_upper( argv[i] ), "-ADD_DEFINE" ) == 0 ) { add_define = true; @@ -2212,7 +2210,6 @@ void update_c_file( HRTFS_DATA *hrtf, struct ivas_layout_config lscfg, const int /* uint16_t index_frequency_max_diffuse; */ fprintf( fp, "\nconst uint16_t %s_%s_index_frequency_max_diffuse_%2dkHz = %d;", DECLARATION_NAME, lscfg.name, samplerate / 1000, hrtf->index_frequency_max_diffuse ); -#ifdef FIX_INV_DIFFUSE_WEIGHT /* float inv_diffuse_weight[BINAURAL_CHANNELS][MAX_INTERN_CHANNELS]; */ fprintf( fp, "\n#ifdef FIX_INV_DIFFUSE_WEIGHT" ); fprintf( fp, "\nconst float %s_%s_inv_diffuse_weight_%2dkHz[BINAURAL_CHANNELS][%s]=", DECLARATION_NAME, lscfg.name, samplerate / 1000, lscfg.output_config_num_channel_name ); @@ -2227,12 +2224,6 @@ void update_c_file( HRTFS_DATA *hrtf, struct ivas_layout_config lscfg, const int write_array_float_to_file( fp, hrtf->inv_diffuse_weight[0], hrtf->max_num_ir, hrtf->max_num_ir, FORMAT_FLOAT, 0, TAB_WITH_SPACE_OR_NOT ); fprintf( fp, ";" ); fprintf( fp, "\n#endif" ); -#else - /* float inv_diffuse_weight[MAX_INTERN_CHANNELS]; */ - fprintf( fp, "\nconst float %s_%s_inv_diffuse_weight_%2dkHz[%s]=", DECLARATION_NAME, lscfg.name, samplerate / 1000, lscfg.output_config_num_channel_name ); - write_array_float_to_file( fp, hrtf->inv_diffuse_weight, hrtf->max_num_ir, hrtf->max_num_ir, FORMAT_FLOAT, 0, TAB_WITH_SPACE_OR_NOT ); - fprintf( fp, ";" ); -#endif /* uint16_t *pIndex_frequency_max_diffuse[BINAURAL_CHANNELS];*/ if ( hrtf->pIndex_frequency_max_diffuse[0] == NULL ) @@ -2468,17 +2459,12 @@ void update_h_file( HRTFS_DATA *hrtf, struct ivas_layout_config lscfg, const int /* uint16_t index_frequency_max_diffuse; */ fprintf( fp, "\nextern uint16_t %s_%s_index_frequency_max_diffuse_%2dkHz;", DECLARATION_NAME, lscfg.name, samplerate / 1000 ); -#ifdef FIX_INV_DIFFUSE_WEIGHT /* float inv_diffuse_weight[BINAURAL_CHANNELS][MAX_INTERN_CHANNELS]; */ fprintf( fp, "\n#ifdef FIX_INV_DIFFUSE_WEIGHT" ); fprintf( fp, "\nextern float %s_%s_inv_diffuse_weight_%2dkHz[BINAURAL_CHANNELS][%s];", DECLARATION_NAME, lscfg.name, samplerate / 1000, lscfg.output_config_num_channel_name ); fprintf( fp, "\n#else" ); fprintf( fp, "\nextern float %s_%s_inv_diffuse_weight_%2dkHz[%s];", DECLARATION_NAME, lscfg.name, samplerate / 1000, lscfg.output_config_num_channel_name ); fprintf( fp, "\n#endif" ); -#else - /* float inv_diffuse_weight[MAX_INTERN_CHANNELS]; */ - fprintf( fp, "\nextern float %s_%s_inv_diffuse_weight_%2dkHz[%s];", DECLARATION_NAME, lscfg.name, samplerate / 1000, lscfg.output_config_num_channel_name ); -#endif /* uint16_t *pIndex_frequency_max_diffuse[BINAURAL_CHANNELS];*/ if ( hrtf->pIndex_frequency_max_diffuse[0] == NULL ) { @@ -2613,11 +2599,7 @@ uint32_t compute_binary_size( HRTFS_DATA *hrtf, crend_hrtf_tables_dimensions *hr } hrtf_data_size += sizeof( uint16_t ); // index_frequency_max_diffuse -#ifdef FIX_INV_DIFFUSE_WEIGHT hrtf_data_size += hrtf->max_num_ir * sizeof( float ) * BINAURAL_CHANNELS; // inv_diffuse_weight -#else - hrtf_data_size += hrtf->max_num_ir * sizeof( float ); // inv_diffuse_weight -#endif hrtf_data_size += sizeof( uint16_t ); // max_total_num_fsamp_per_iteration @@ -2764,7 +2746,6 @@ void write_binary_file( HRTFS_DATA *hrtf, struct ivas_layout_config lscfg, const memcpy( hrtf_bin_wptr, &( hrtf->index_frequency_max_diffuse ), sizeof( uint16_t ) ); // index_frequency_max_diffuse hrtf_bin_wptr += sizeof( uint16_t ); -#ifdef FIX_INV_DIFFUSE_WEIGHT for ( iIR = 0; iIR < hrtf->max_num_ir; iIR++ ) { sprintf( tmpStr, FORMAT_FLOAT, hrtf->inv_diffuse_weight[0][iIR] ); @@ -2776,14 +2757,6 @@ void write_binary_file( HRTFS_DATA *hrtf, struct ivas_layout_config lscfg, const sscanf( tmpStr, "%f", &( (float *) hrtf_bin_wptr )[hrtf->max_num_ir + iIR] ); } data_size_tmp = hrtf->max_num_ir * sizeof( float ) * BINAURAL_CHANNELS; -#else - for ( iIR = 0; iIR < hrtf->max_num_ir; iIR++ ) - { - sprintf( tmpStr, FORMAT_FLOAT, hrtf->inv_diffuse_weight[iIR] ); - sscanf( tmpStr, "%f", &( (float *) hrtf_bin_wptr )[iIR] ); - } - data_size_tmp = hrtf->max_num_ir * sizeof( float ); -#endif hrtf_bin_wptr += data_size_tmp; memcpy( hrtf_bin_wptr, &( hrtf_table_dims.max_total_num_fsamp_per_iteration ), sizeof( uint16_t ) ); // max_total_num_fsamp_per_iteration diff --git a/scripts/binauralRenderer_interface/ivas_crend_binaural_filter_design.c b/scripts/binauralRenderer_interface/ivas_crend_binaural_filter_design.c index 7a1c698ad2..f272d8fac5 100644 --- a/scripts/binauralRenderer_interface/ivas_crend_binaural_filter_design.c +++ b/scripts/binauralRenderer_interface/ivas_crend_binaural_filter_design.c @@ -146,12 +146,8 @@ static void printfAudioBufferOutFilterParams( printf( "\nmax Diffuse Fc : %u", pParam->index_frequency_max_diffuse ); printf( "\n" ); printf( "\nInverse Diffuse Weights :" ); -#ifdef FIX_INV_DIFFUSE_WEIGHT printBuf_float32( pParam->inv_diffuse_weight[0], pParam->max_num_ir ); printBuf_float32( pParam->inv_diffuse_weight[1], pParam->max_num_ir ); -#else - printBuf_float32( pParam->inv_diffuse_weight, pParam->max_num_ir ); -#endif printf( "\n" ); /*if (pParam->numDiffuseBlock > 0) @@ -1097,7 +1093,6 @@ ivas_error ivas_crend_binaural_filter_design_set_hrtf_fr( { if ( ppDiffuseWeight[i_chan][0] != -1 && ppDiffuseWeight[i_chan][1] != -1 ) { -#ifdef FIX_INV_DIFFUSE_WEIGHT if ( cfgReader != NULL ) { if ( cfgReader->harmonizeLateReverbBinauralGain ) @@ -1116,18 +1111,11 @@ ivas_error ivas_crend_binaural_filter_design_set_hrtf_fr( pParam->inv_diffuse_weight[0][i_chan] = 2.f / ( ppDiffuseWeight[i_chan][0] + ppDiffuseWeight[i_chan][1] ); pParam->inv_diffuse_weight[1][i_chan] = pParam->inv_diffuse_weight[0][i_chan]; } -#else - pParam->inv_diffuse_weight[i_chan] = 2.f / ( ppDiffuseWeight[i_chan][0] + ppDiffuseWeight[i_chan][1] ); -#endif } else { -#ifdef FIX_INV_DIFFUSE_WEIGHT pParam->inv_diffuse_weight[0][i_chan] = 0; /* pathological case ppEnergyDiffuseFilter[i_ear][i_chan]=0 */ pParam->inv_diffuse_weight[1][i_chan] = 0; /* pathological case ppEnergyDiffuseFilter[i_ear][i_chan]=0 */ -#else - pParam->inv_diffuse_weight[i_chan] = 0; /* pathological case ppEnergyDiffuseFilter[i_ear][i_chan]=0 */ -#endif } } -- GitLab From 79e8caa0e4a22bec4f5aab0f5082f4c656c2f33f Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 7 Feb 2024 20:55:30 +0100 Subject: [PATCH 04/16] [cleanup] accept FIX_20_MS_FRAME_LEN_TABLES_CONVERTER --- lib_com/options.h | 1 - .../config_reader.c | 6 ----- .../config_reader.h | 4 --- .../generate_crend_ivas_tables_from_sofa.c | 12 --------- .../ivas_crend_binaural_filter_design.c | 25 ------------------- .../ivas_crend_binaural_filter_design.h | 8 ------ 6 files changed, 56 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 3ef7426998..0cab5cddc8 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -151,7 +151,6 @@ /*#define FIX_I4_OL_PITCH*/ /* fix open-loop pitch used for EVS core switching */ /*#define SPLIT_REND_WITH_HEAD_ROT */ /* Dlb,FhG: Split Rendering contributions 21 and 35 */ -#define FIX_20_MS_FRAME_LEN_TABLES_CONVERTER /* Orange : generate_tables_converter tools can generate rom for 5 and 20 ms frame length */ #define FIX_955_FASTCONV_REND_IN_ISM /* VA: put FastConv rendering call under DEBUGGING */ #define FIX_969_USAN_IGF_ARITH /* FhG: issue 969: fix USAN error in igf_sce_dec; same issue as #962 */ #define FIX_959_MASA_LINEAR_REND /* VA: issue 959: remove unused calling of ivas_sba_linear_renderer() in MASA rendering */ diff --git a/scripts/binauralRenderer_interface/config_reader.c b/scripts/binauralRenderer_interface/config_reader.c index cfff0669fd..3e6da6438f 100644 --- a/scripts/binauralRenderer_interface/config_reader.c +++ b/scripts/binauralRenderer_interface/config_reader.c @@ -104,7 +104,6 @@ static ivas_error read_txt_float( return IVAS_ERR_OK; } -#ifdef FIX_20_MS_FRAME_LEN_TABLES_CONVERTER /*-----------------------------------------------------------------------------------------* * Function read_txt_uint32() * Reads a float value from a line @@ -124,7 +123,6 @@ static ivas_error read_txt_int32( return IVAS_ERR_OK; } -#endif /*-----------------------------------------------------------------------------------------* * Function read_txt_vector() @@ -294,10 +292,8 @@ ivas_error ConfigReader_read( hRenderConfig->diffuseEnergyThreshold = DEFAULT_DIFFUSE_ENERGY_THRESHOLD; hRenderConfig->diffuseCutOffFreqThreshold = DEFAULT_DIFFUSE_CUT_OFF_FREQ_THRESHOLD; hRenderConfig->directCutOffFreqThreshold = DEFAULT_DIRECT_CUT_OFF_FREQ_THRESHOLD; -#ifdef FIX_20_MS_FRAME_LEN_TABLES_CONVERTER hRenderConfig->maxNumDirectBlocks = DEFAULT_MAX_NUM_DIRECT_BLOCKS; hRenderConfig->maxNumDiffuseBlocks = DEFAULT_MAX_NUM_DIFFUSE_BLOCKS; -#endif /* read file line by line */ while ( fgets( pConfig_str, file_size, pConfigFile ) != NULL ) { @@ -416,7 +412,6 @@ ivas_error ConfigReader_read( return IVAS_ERR_INVALID_RENDER_CONFIG; } } -#ifdef FIX_20_MS_FRAME_LEN_TABLES_CONVERTER else if ( strcmp( item, "MAXNUMDIRECTBLOCKS" ) == 0 ) { if ( read_txt_int32( pValue, &hRenderConfig->maxNumDirectBlocks ) != IVAS_ERR_OK ) @@ -433,7 +428,6 @@ ivas_error ConfigReader_read( return IVAS_ERR_INVALID_RENDER_CONFIG; } } -#endif } free( pValue ); } diff --git a/scripts/binauralRenderer_interface/config_reader.h b/scripts/binauralRenderer_interface/config_reader.h index 58c4b4fbb5..a3cf38cd74 100644 --- a/scripts/binauralRenderer_interface/config_reader.h +++ b/scripts/binauralRenderer_interface/config_reader.h @@ -44,10 +44,8 @@ #define DEFAULT_DIFFUSE_ENERGY_THRESHOLD ( -25.f ) #define DEFAULT_DIFFUSE_CUT_OFF_FREQ_THRESHOLD ( -20.f ) #define DEFAULT_DIRECT_CUT_OFF_FREQ_THRESHOLD ( -20.f ) -#ifdef FIX_20_MS_FRAME_LEN_TABLES_CONVERTER #define DEFAULT_MAX_NUM_DIRECT_BLOCKS ( 40 ) #define DEFAULT_MAX_NUM_DIFFUSE_BLOCKS ( 40 ) -#endif typedef struct ConfigReader @@ -61,10 +59,8 @@ typedef struct ConfigReader float diffuseEnergyThreshold; /* use to find the time end limit of the diffuse part (te). diffuse part. It is a ratio in dB between diffuse part after te and complete diffuse HRIR/BRIR energies. The more the value is near zero the smallest is te, complexity decrease. */ float diffuseCutOffFreqThreshold; /* threshold in dB to determine the cut off (fcdiff) frequency for each slice of the diffuse IR. ratio in dB between the energy after fcdiff and the total energy. The more the value is near zero the smallest is fcdiff, complexity decrease */ float directCutOffFreqThreshold; /* threshold in dB to determine the cut off (fcdirect) frequency for each slice of the direct IR. Do not applied to first slice. ratio in dB between the energy after fcdirect and the total energy. The more the value is near zero the smallest is fcdirect, complexity decrease */ -#ifdef FIX_20_MS_FRAME_LEN_TABLES_CONVERTER int32_t maxNumDirectBlocks; /* max number of direct blocks */ int32_t maxNumDiffuseBlocks; /* max number of diffuse blocks */ -#endif } ConfigReader, *ConfigReaderHandle; typedef enum diff --git a/scripts/binauralRenderer_interface/generate_crend_ivas_tables_from_sofa.c b/scripts/binauralRenderer_interface/generate_crend_ivas_tables_from_sofa.c index 8836a9edb3..eb7a473fbf 100644 --- a/scripts/binauralRenderer_interface/generate_crend_ivas_tables_from_sofa.c +++ b/scripts/binauralRenderer_interface/generate_crend_ivas_tables_from_sofa.c @@ -268,10 +268,8 @@ int main( int argc, char *argv[] ) cfgBrirOptim.endEnergyThreshold = DEFAULT_END_ENERGY_THRESHOLD; cfgBrirOptim.harmonizeLateReverbBinauralGain = 1; cfgBrirOptim.optimize = 1; -#ifdef FIX_20_MS_FRAME_LEN_TABLES_CONVERTER cfgBrirOptim.maxNumDirectBlocks = DEFAULT_MAX_NUM_DIRECT_BLOCKS; cfgBrirOptim.maxNumDiffuseBlocks = DEFAULT_MAX_NUM_DIFFUSE_BLOCKS; -#endif for ( i = 0; i < MAX_INTERN_CHANNELS; i++ ) { @@ -1111,9 +1109,7 @@ int generate_crend_ivas_tables_from_sofa( const char *file_path, ConfigReader *c { uint16_t frame_len = L_FRAME48k; int32_t maxDel = maxDel48kHz * DEFAULT_SAMPLERATE / sample_rates[indSR]; -#ifdef FIX_20_MS_FRAME_LEN_TABLES_CONVERTER float mdft_scale_fact; -#endif switch ( sample_rates[indSR] ) { case 8000: @@ -1130,15 +1126,11 @@ int generate_crend_ivas_tables_from_sofa( const char *file_path, ConfigReader *c frame_len = L_FRAME48k; break; } -#ifdef FIX_20_MS_FRAME_LEN_TABLES_CONVERTER mdft_scale_fact = (float) L_FRAME48k / (float) frame_len; -#endif if ( frame_len_ms == 5 ) { frame_len = frame_len >> 2; -#ifdef FIX_20_MS_FRAME_LEN_TABLES_CONVERTER mdft_scale_fact = (float) ( L_FRAME48k * 0.25f ) / (float) frame_len; -#endif } data_IR_current = sofa_data_IR_val_48k; @@ -1254,18 +1246,14 @@ int generate_crend_ivas_tables_from_sofa( const char *file_path, ConfigReader *c { ivas_crend_binaural_filter_design_compute_filters_params( ivas_hrtf, frame_len, &hrtf_data, &index_start, &index_end, &max_ir_len, cfgReader ); ivas_crend_binaural_filter_design_set_hrtf_fr( ivas_hrtf, frame_len, -#ifdef FIX_20_MS_FRAME_LEN_TABLES_CONVERTER mdft_scale_fact, -#endif &hrtf_data, index_start, index_end, &max_ir_len, cfgReader ); } else { ivas_set_hrtf_fr( &hrtf_data, ivas_hrtf, frame_len -#ifdef FIX_20_MS_FRAME_LEN_TABLES_CONVERTER , mdft_scale_fact -#endif ); } hrtf_data.latency_s += 0.000000001f; diff --git a/scripts/binauralRenderer_interface/ivas_crend_binaural_filter_design.c b/scripts/binauralRenderer_interface/ivas_crend_binaural_filter_design.c index f272d8fac5..826d4c7672 100644 --- a/scripts/binauralRenderer_interface/ivas_crend_binaural_filter_design.c +++ b/scripts/binauralRenderer_interface/ivas_crend_binaural_filter_design.c @@ -559,20 +559,12 @@ ivas_error ivas_crend_binaural_filter_design_compute_filters_params( { pParam->num_iterations[i_chan][0]++; } -#ifdef FIX_20_MS_FRAME_LEN_TABLES_CONVERTER /* max MAX_LENGTH_DIRECT_FILTER */ if ( pParam->num_iterations[i_chan][0] > cfgReader->maxNumDirectBlocks ) { pParam->num_iterations[i_chan][0] = cfgReader->maxNumDirectBlocks; } pParam->num_iterations[i_chan][1] = pParam->num_iterations[i_chan][0]; -#else - pParam->num_iterations[i_chan][1] = pParam->num_iterations[i_chan][0]; - if ( pParam->num_iterations[i_chan][0] > IVAS_MAX_NUM_DIRECT_BLOCKS ) - { - pParam->num_iterations[i_chan][0] = IVAS_MAX_NUM_DIRECT_BLOCKS; - } -#endif } pParam->max_num_iterations = 0; @@ -662,17 +654,10 @@ ivas_error ivas_crend_binaural_filter_design_compute_filters_params( } /* max MAX_NUM_DIFFUSE_BLOCKS */ -#ifdef FIX_20_MS_FRAME_LEN_TABLES_CONVERTER if ( numDiffuseBlock > cfgReader->maxNumDiffuseBlocks ) { numDiffuseBlock = cfgReader->maxNumDiffuseBlocks; } -#else - if ( numDiffuseBlock > IVAS_MAX_NUM_DIFFUSE_BLOCKS ) - { - numDiffuseBlock = IVAS_MAX_NUM_DIFFUSE_BLOCKS; - } -#endif for ( i_ear = 0; i_ear < 2; ++i_ear ) { @@ -702,9 +687,7 @@ ivas_error ivas_crend_binaural_filter_design_compute_filters_params( ivas_error ivas_crend_binaural_filter_design_set_hrtf_fr( ivas_hrtf_t *pFirData, const int16_t frame_len, -#ifdef FIX_20_MS_FRAME_LEN_TABLES_CONVERTER float mdft_scale_fact, -#endif HRTFS_DATA *pParam, int32_t index_start, int32_t index_end, @@ -732,9 +715,6 @@ ivas_error ivas_crend_binaural_filter_design_set_hrtf_fr( float ppEnergyDiffuseFilter[MAX_INTERN_CHANNELS][BINAURAL_CHANNELS] = { { 0 } }; /* diffuse filter energies ( ppEnergyDiffuseFilter[ear][channel] ) */ float ppDiffuseWeight[MAX_INTERN_CHANNELS][BINAURAL_CHANNELS] = { { 0 } }; /* diffuse weights ( ppDiffuseWeight[ear][channel] ) */ float delayf; -#ifndef FIX_20_MS_FRAME_LEN_TABLES_CONVERTER - float mdft_scale_fact = ( (float) L_FRAME48k * 0.25f ) / frame_len; -#endif if ( cfgReader != NULL ) { @@ -1325,19 +1305,14 @@ ivas_error ivas_set_hrtf_fr( HRTFS_DATA *crend_hrtf, ivas_hrtf_t *hrtf, const int16_t output_frame -#ifdef FIX_20_MS_FRAME_LEN_TABLES_CONVERTER , float mdft_scale_fact -#endif ) { int32_t i, j, m, n; float data_ir_flt[L_FRAME48k] = { 0.0f }; int32_t tmp_ir_len, in_len, k; -#ifndef FIX_20_MS_FRAME_LEN_TABLES_CONVERTER - float mdft_scale_fact = ( (float) L_FRAME48k * 0.25f ) / output_frame; -#endif crend_hrtf->max_num_ir = (int16_t) hrtf->m; diff --git a/scripts/binauralRenderer_interface/ivas_crend_binaural_filter_design.h b/scripts/binauralRenderer_interface/ivas_crend_binaural_filter_design.h index 3cab89cdfd..7769e9e1f1 100644 --- a/scripts/binauralRenderer_interface/ivas_crend_binaural_filter_design.h +++ b/scripts/binauralRenderer_interface/ivas_crend_binaural_filter_design.h @@ -40,10 +40,6 @@ #define IVAS_SOFA_MAX_VAL_R ( 2 ) #define IVAS_SOFA_MAX_VAL_N ( 48000 ) #define IVAS_SOFA_MAX_VAL_I ( 1 ) -#ifndef FIX_20_MS_FRAME_LEN_TABLES_CONVERTER -#define IVAS_MAX_NUM_DIRECT_BLOCKS ( 40 ) /* max number of direct blocks */ -#define IVAS_MAX_NUM_DIFFUSE_BLOCKS ( 40 ) /* max number of diffuse blocks */ -#endif #define IVAS_MAX_HRTF_LATENCY_MS ( 0.1 ) /* max hrtf latency */ typedef struct ivas_hrtf_t @@ -63,17 +59,13 @@ typedef struct ivas_hrtf_t ivas_error ivas_get_hrtf_lens( ivas_hrtf_t *hrtf, HRTFS_DATA *crend_hrtf, const int16_t frame_len ); ivas_error ivas_set_hrtf_fr( HRTFS_DATA *crend_hrtf, ivas_hrtf_t *hrtf, const int16_t frame_len -#ifdef FIX_20_MS_FRAME_LEN_TABLES_CONVERTER , float mdft_scale_fact -#endif ); ivas_error ivas_crend_binaural_filter_design_compute_filters_params( ivas_hrtf_t *pFirData, const int16_t framelen, HRTFS_DATA *pParam, int32_t *index_start, int32_t *index_end, int32_t *max_ir_len, ConfigReader *cfgReader ); ivas_error ivas_crend_binaural_filter_design_set_hrtf_fr( ivas_hrtf_t *pFirData, const int16_t frame_len, -#ifdef FIX_20_MS_FRAME_LEN_TABLES_CONVERTER float mdft_scale_fact, -#endif HRTFS_DATA *pParam, int32_t index_start, int32_t index_end, -- GitLab From 01eeafdd4369d284505bd1801d747d1a6106e95b Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 7 Feb 2024 20:56:32 +0100 Subject: [PATCH 05/16] [cleanup] accept FIX_955_FASTCONV_REND_IN_ISM --- lib_com/options.h | 1 - lib_dec/ivas_jbm_dec.c | 8 -------- 2 files changed, 9 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 0cab5cddc8..d35d7aa59b 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -151,7 +151,6 @@ /*#define FIX_I4_OL_PITCH*/ /* fix open-loop pitch used for EVS core switching */ /*#define SPLIT_REND_WITH_HEAD_ROT */ /* Dlb,FhG: Split Rendering contributions 21 and 35 */ -#define FIX_955_FASTCONV_REND_IN_ISM /* VA: put FastConv rendering call under DEBUGGING */ #define FIX_969_USAN_IGF_ARITH /* FhG: issue 969: fix USAN error in igf_sce_dec; same issue as #962 */ #define FIX_959_MASA_LINEAR_REND /* VA: issue 959: remove unused calling of ivas_sba_linear_renderer() in MASA rendering */ #define FIX_963_USAN_ERROR /* Eri: Issue 963: USAN error in Stereo CNG, division by zero */ diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index 06447722c4..b1ce3d481c 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -1071,7 +1071,6 @@ ivas_error ivas_jbm_dec_render( { ivas_apply_non_diegetic_panning( p_output, st_ivas->hDecoderConfig->non_diegetic_pan_gain, *nSamplesRendered ); } -#ifdef FIX_955_FASTCONV_REND_IN_ISM #ifdef DEBUGGING else if ( st_ivas->renderer_type == RENDERER_SBA_LINEAR_ENC || st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV ) #else @@ -1081,13 +1080,6 @@ ivas_error ivas_jbm_dec_render( /* Convert to Ambisonics */ ivas_ism2sba_sf( st_ivas->hTcBuffer->tc, p_output, st_ivas->hIsmRendererData, st_ivas->nchan_transport, *nSamplesRendered, st_ivas->hTcBuffer->n_samples_rendered, st_ivas->hIntSetup.ambisonics_order ); } -#else - else if ( st_ivas->renderer_type == RENDERER_SBA_LINEAR_ENC || st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV ) - { - /* Convert to Ambisonics; used also for ISM->HOA3->binaural rendering */ - ivas_ism2sba_sf( st_ivas->hTcBuffer->tc, p_output, st_ivas->hIsmRendererData, st_ivas->nchan_transport, *nSamplesRendered, st_ivas->hTcBuffer->n_samples_rendered, st_ivas->hIntSetup.ambisonics_order ); - } -#endif /* Binaural rendering */ if ( st_ivas->renderer_type == RENDERER_BINAURAL_OBJECTS_TD ) -- GitLab From 584d76c998d7ec966acfeea9f8f0c9c5c3d40d86 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 7 Feb 2024 20:57:11 +0100 Subject: [PATCH 06/16] [cleanup] accept FIX_969_USAN_IGF_ARITH --- lib_com/options.h | 1 - lib_dec/igf_scf_dec.c | 8 -------- 2 files changed, 9 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index d35d7aa59b..a33e9fcbb6 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -151,7 +151,6 @@ /*#define FIX_I4_OL_PITCH*/ /* fix open-loop pitch used for EVS core switching */ /*#define SPLIT_REND_WITH_HEAD_ROT */ /* Dlb,FhG: Split Rendering contributions 21 and 35 */ -#define FIX_969_USAN_IGF_ARITH /* FhG: issue 969: fix USAN error in igf_sce_dec; same issue as #962 */ #define FIX_959_MASA_LINEAR_REND /* VA: issue 959: remove unused calling of ivas_sba_linear_renderer() in MASA rendering */ #define FIX_963_USAN_ERROR /* Eri: Issue 963: USAN error in Stereo CNG, division by zero */ #define FIX_971_LOG2_IDX_GAIN_0 /* VA: prevent -Inf due to log2(ratio==0) */ diff --git a/lib_dec/igf_scf_dec.c b/lib_dec/igf_scf_dec.c index a8162c6443..6a62a332bc 100755 --- a/lib_dec/igf_scf_dec.c +++ b/lib_dec/igf_scf_dec.c @@ -211,12 +211,8 @@ static void decode_sfe_vector( | c b | e --> t */ -#ifdef FIX_969_USAN_IGF_ARITH int16_t pred; uint16_t pred_tmp; -#else - uint16_t pred; -#endif int16_t f, ctx, ctx_f, ctx_t; for ( f = 0; f < length; f++ ) @@ -226,12 +222,8 @@ static void decode_sfe_vector( if ( f == 0 ) { /* decode one of the IGF_SYMBOLS_IN_TABLE == 27 alphabet symbols using the new raw AC function */ -#ifdef FIX_969_USAN_IGF_ARITH ari_decode_14bits_s27_ext( st, &pred_tmp, &hPrivateData->acState, hPrivateData->cf_se00 ); pred = (int16_t) pred_tmp; -#else - ari_decode_14bits_s27_ext( st, &pred, &hPrivateData->acState, hPrivateData->cf_se00 ); -#endif x[f] = pred << 2; x[f] += arith_decode_bits( &hPrivateData->acState, st, 2 ); /* LSBs as 2 bit raw */ } -- GitLab From 6355bea61cdddbf82542fa0f1c6e4939ecad9c5f Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 7 Feb 2024 20:57:48 +0100 Subject: [PATCH 07/16] [cleanup] accept FIX_959_MASA_LINEAR_REND --- lib_com/options.h | 1 - lib_dec/ivas_jbm_dec.c | 17 ----------------- lib_dec/ivas_output_config.c | 4 ---- 3 files changed, 22 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index a33e9fcbb6..15aeeb449f 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -151,7 +151,6 @@ /*#define FIX_I4_OL_PITCH*/ /* fix open-loop pitch used for EVS core switching */ /*#define SPLIT_REND_WITH_HEAD_ROT */ /* Dlb,FhG: Split Rendering contributions 21 and 35 */ -#define FIX_959_MASA_LINEAR_REND /* VA: issue 959: remove unused calling of ivas_sba_linear_renderer() in MASA rendering */ #define FIX_963_USAN_ERROR /* Eri: Issue 963: USAN error in Stereo CNG, division by zero */ #define FIX_971_LOG2_IDX_GAIN_0 /* VA: prevent -Inf due to log2(ratio==0) */ diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index b1ce3d481c..3554697282 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -1134,24 +1134,7 @@ ivas_error ivas_jbm_dec_render( } else if ( st_ivas->ivas_format == MASA_FORMAT ) { -#ifndef FIX_959_MASA_LINEAR_REND - if ( st_ivas->renderer_type == RENDERER_SBA_LINEAR_DEC ) - { - *nSamplesRendered = min( st_ivas->hTcBuffer->n_samples_available, nSamplesAskedLocal ); - for ( n = 0; n < nchan_remapped; n++ ) - { - mvr2r( st_ivas->hTcBuffer->tc[n] + st_ivas->hTcBuffer->n_samples_rendered, p_output[n], *nSamplesRendered ); - } - - if ( ( error = ivas_sba_linear_renderer( p_output, *nSamplesRendered, nchan_remapped, 0, output_config, st_ivas->hOutSetup ) ) != IVAS_ERR_OK ) - { - return error; - } - } - else if ( st_ivas->renderer_type == RENDERER_DIRAC ) -#else if ( st_ivas->renderer_type == RENDERER_DIRAC ) -#endif { ivas_dirac_dec_render( st_ivas, nchan_remapped, nSamplesAskedLocal, nSamplesRendered, nSamplesAvailableNext, p_output ); } diff --git a/lib_dec/ivas_output_config.c b/lib_dec/ivas_output_config.c index f050edde6a..f2241ac808 100644 --- a/lib_dec/ivas_output_config.c +++ b/lib_dec/ivas_output_config.c @@ -375,11 +375,7 @@ void ivas_renderer_select( { *internal_config = IVAS_AUDIO_CONFIG_HOA3; } -#ifdef FIX_959_MASA_LINEAR_REND *renderer_type = RENDERER_SBA_LINEAR_DEC; -#else - st_ivas->renderer_type = RENDERER_SBA_LINEAR_DEC; -#endif } else if ( ( ivas_format == MASA_FORMAT && output_config == IVAS_AUDIO_CONFIG_MONO && st_ivas->nchan_transport == 1 ) || ( ivas_format == SBA_FORMAT && ( output_config == IVAS_AUDIO_CONFIG_STEREO || output_config == IVAS_AUDIO_CONFIG_MONO ) ) ) -- GitLab From e2f57c77317a2e0d139f6056c3bce14443b07eea Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 7 Feb 2024 20:58:34 +0100 Subject: [PATCH 08/16] [cleanup] accept NONBE_FIX_BINARY_BINAURAL_READING --- apps/decoder.c | 68 ----------- apps/renderer.c | 33 ------ lib_com/ivas_error.h | 4 - lib_com/options.h | 1 - lib_dec/ivas_init_dec.c | 4 - lib_dec/lib_dec.c | 32 ----- lib_dec/lib_dec.h | 16 --- lib_rend/ivas_crend.c | 20 ---- lib_rend/ivas_hrtf.c | 4 - lib_rend/ivas_objectRenderer.c | 4 - lib_rend/ivas_objectRenderer_mix.c | 11 -- lib_rend/ivas_stat_rend.h | 12 -- lib_rend/lib_rend.c | 166 -------------------------- lib_rend/lib_rend.h | 4 - lib_util/hrtf_file_reader.c | 180 ----------------------------- lib_util/hrtf_file_reader.h | 21 ---- 16 files changed, 580 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index ba01a78d2f..00efa03735 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -196,13 +196,11 @@ int main( RenderConfigReader *renderConfigReader = NULL; int16_t *pcmBuf = NULL; IVAS_RENDER_FRAMESIZE asked_frame_size; -#ifdef NONBE_FIX_BINARY_BINAURAL_READING IVAS_DEC_HRTF_HANDLE *hHrtfTD = NULL; IVAS_DEC_HRTF_CREND_HANDLE *hSetOfHRTF = NULL; #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES IVAS_DEC_HRTF_STATISTICS_HANDLE *hHrtfStatistics = NULL; #endif -#endif #ifdef DEBUGGING int32_t noClipping; int32_t cnt_frames_limited; @@ -715,16 +713,12 @@ int main( if ( arg.hrtfReaderEnabled ) { -#ifndef NONBE_FIX_BINARY_BINAURAL_READING - IVAS_DEC_HRTF_HANDLE hHrtfTD = NULL; -#endif if ( ( error = IVAS_DEC_GetHrtfHandle( hIvasDec, &hHrtfTD ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nIVAS_DEC_GetHrtfHandle failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } -#ifdef NONBE_FIX_BINARY_BINAURAL_READING if ( ( error = load_HRTF_binary( *hHrtfTD, hrtfReader ) ) != IVAS_ERR_OK ) { if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA ) @@ -737,16 +731,8 @@ int main( destroy_td_hrtf( hHrtfTD ); } } -#else - if ( ( error = load_HRTF_binary( hHrtfTD, hrtfReader ) ) != IVAS_ERR_OK ) - { - fprintf( stderr, "\nError in loading HRTF binary file %s \n\n", arg.hrtfFileName ); - goto cleanup; - } -#endif #ifndef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES -#ifdef NONBE_FIX_BINARY_BINAURAL_READING if ( ( *hHrtfTD != NULL ) && ( error = load_reverb_binary( *hHrtfTD, hrtfReader ) ) != IVAS_ERR_OK ) { if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA ) @@ -755,25 +741,14 @@ int main( goto cleanup; } } -#else - if ( ( hHrtfTD != NULL ) && ( error = load_reverb_binary( hHrtfTD, hrtfReader ) ) != IVAS_ERR_OK ) - { - fprintf( stderr, "\nError in loading HRTF binary file %s \n\n", arg.hrtfFileName ); - goto cleanup; - } -#endif #endif -#ifndef NONBE_FIX_BINARY_BINAURAL_READING - IVAS_DEC_HRTF_CREND_HANDLE hSetOfHRTF = NULL; -#endif if ( ( error = IVAS_DEC_GetHrtfCRendHandle( hIvasDec, &hSetOfHRTF ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nIVAS_DEC_GetHrtfCRendHandle failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } -#ifdef NONBE_FIX_BINARY_BINAURAL_READING if ( ( error = create_SetOfHRTF_from_binary( *hSetOfHRTF, hrtfReader, arg.output_Fs ) ) != IVAS_ERR_OK ) { if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA ) @@ -786,20 +761,14 @@ int main( destroy_SetOfHRTF( hSetOfHRTF ); } } -#endif -#ifdef NONBE_FIX_BINARY_BINAURAL_READING IVAS_DEC_HRTF_FASTCONV_HANDLE *hHrtfFastConv = NULL; -#else - IVAS_DEC_HRTF_FASTCONV_HANDLE hHrtfFastConv = NULL; -#endif if ( ( error = IVAS_DEC_GetHrtfFastConvHandle( hIvasDec, &hHrtfFastConv ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nIVAS_DEC_GetHrtfFastConvHandle failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } -#ifdef NONBE_FIX_BINARY_BINAURAL_READING if ( ( error = load_fastconv_HRTF_from_binary( *hHrtfFastConv, hrtfReader ) ) != IVAS_ERR_OK ) { if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA ) @@ -812,26 +781,14 @@ int main( destroy_fastconv_hrtf( hHrtfFastConv ); } } -#else - if ( ( error = load_fastconv_HRTF_from_binary( hHrtfFastConv, hrtfReader ) ) != IVAS_ERR_OK ) - { - fprintf( stderr, "\nError in loading HRTF binary file %s for FastConv \n\n", arg.hrtfFileName ); - goto cleanup; - } -#endif -#ifdef NONBE_FIX_BINARY_BINAURAL_READING IVAS_DEC_HRTF_PARAMBIN_HANDLE *hHrtfParambin = NULL; -#else - IVAS_DEC_HRTF_PARAMBIN_HANDLE hHrtfParambin = NULL; -#endif if ( ( error = IVAS_DEC_GetHrtfParamBinHandle( hIvasDec, &hHrtfParambin ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nIVAS_DEC_GetHrtfParamBinHandle failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } -#ifdef NONBE_FIX_BINARY_BINAURAL_READING if ( ( error = load_parambin_HRTF_from_binary( *hHrtfParambin, hrtfReader ) ) != IVAS_ERR_OK ) { if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA ) @@ -844,16 +801,8 @@ int main( destroy_parambin_hrtf( hHrtfParambin ); } } -#else - if ( ( error = load_parambin_HRTF_from_binary( hHrtfParambin, hrtfReader ) ) != IVAS_ERR_OK ) - { - fprintf( stderr, "\nError in loading HRTF binary file %s for parametric binauralizer \n\n", arg.hrtfFileName ); - goto cleanup; - } -#endif #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES -#ifdef NONBE_FIX_BINARY_BINAURAL_READING if ( ( error = IVAS_DEC_GetHrtfStatisticsHandle( hIvasDec, &hHrtfStatistics ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nIVAS_DEC_GetHrtfHandle failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); @@ -871,13 +820,6 @@ int main( destroy_hrtf_statistics( hHrtfStatistics ); } } -#else - if ( ( hHrtfTD != NULL ) && ( error = load_reverb_binary( hHrtfTD, hrtfReader ) ) != IVAS_ERR_OK ) - { - fprintf( stderr, "\nError in loading HRTF binary file %s \n\n", arg.hrtfFileName ); - goto cleanup; - } -#endif #endif } @@ -955,19 +897,9 @@ cleanup: #endif if ( arg.hrtfReaderEnabled ) { -#ifndef NONBE_FIX_BINARY_BINAURAL_READING - IVAS_DEC_HRTF_HANDLE hHrtfTD = NULL; -#endif IVAS_DEC_GetHrtfHandle( hIvasDec, &hHrtfTD ); -#ifdef NONBE_FIX_BINARY_BINAURAL_READING destroy_td_hrtf( hHrtfTD ); -#else - dealloc_HRTF_binary( hHrtfTD ); -#endif -#ifndef NONBE_FIX_BINARY_BINAURAL_READING - IVAS_DEC_HRTF_CREND_HANDLE hSetOfHRTF = NULL; -#endif IVAS_DEC_GetHrtfCRendHandle( hIvasDec, &hSetOfHRTF ); destroy_SetOfHRTF( hSetOfHRTF ); diff --git a/apps/renderer.c b/apps/renderer.c index 9a5088afdb..e95f5d5adb 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -743,14 +743,12 @@ int main( #endif Vector3PairFileReader *referenceVectorReader = NULL; hrtfFileReader *hrtfFileReader = NULL; -#ifdef NONBE_FIX_BINARY_BINAURAL_READING IVAS_DEC_HRTF_CREND_HANDLE *hSetOfHRTF = NULL; IVAS_DEC_HRTF_FASTCONV_HANDLE *hHrtfFastConv = NULL; IVAS_DEC_HRTF_PARAMBIN_HANDLE *hHrtfParambin = NULL; IVAS_DEC_HRTF_HANDLE *hHrtfTD = NULL; #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES IVAS_DEC_HRTF_STATISTICS_HANDLE *hHrtfStatistics = NULL; -#endif #endif IsmPositionProvider *positionProvider; LfeRoutingConfig *lfeRoutingConfigs[RENDERER_MAX_MC_INPUTS]; @@ -804,10 +802,8 @@ int main( #ifdef SPLIT_REND_WITH_HEAD_ROT hSplitRendFileReadWrite = NULL; -#ifdef NONBE_FIX_BINARY_BINAURAL_READING CLDFBframeSize_smpls = 0; cldfb_in_flag = 0; -#endif #endif for ( i = 0; i < RENDERER_MAX_MC_INPUTS; ++i ) { @@ -881,16 +877,6 @@ int main( } } -#ifndef NONBE_FIX_BINARY_BINAURAL_READING - if ( !isEmptyString( args.customHrtfFilePath ) ) - { - if ( hrtfFileReader_open( args.customHrtfFilePath, &hrtfFileReader ) != IVAS_ERR_OK ) - { - fprintf( stderr, "Error opening file: %s\n", args.customHrtfFilePath ); - exit( -1 ); - } - } -#endif if ( !isEmptyString( args.renderConfigFilePath ) ) { @@ -1016,17 +1002,12 @@ int main( #endif const int16_t frameSize_smpls = (int16_t) ( ( args.render_framesize ) * args.sampleRate * 5 / ( 1000 ) ); -#ifdef NONBE_FIX_BINARY_BINAURAL_READING if ( ( error = IVAS_REND_Open( &hIvasRend, args.sampleRate, args.outConfig.audioConfig, !isEmptyString( args.customHrtfFilePath ), args.nonDiegeticPan, args.nonDiegeticPanGain, (int16_t) args.render_framesize ) ) != IVAS_ERR_OK ) -#else - if ( ( error = IVAS_REND_Open( &hIvasRend, args.sampleRate, args.outConfig.audioConfig, args.nonDiegeticPan, args.nonDiegeticPanGain, (int16_t) args.render_framesize ) ) != IVAS_ERR_OK ) -#endif { fprintf( stderr, "Error opening renderer handle: %s\n", ivas_error_to_string( error ) ); exit( -1 ); } -#ifdef NONBE_FIX_BINARY_BINAURAL_READING if ( !isEmptyString( args.customHrtfFilePath ) ) { if ( hrtfFileReader_open( args.customHrtfFilePath, &hrtfFileReader ) != IVAS_ERR_OK ) @@ -1147,7 +1128,6 @@ int main( hrtfFileReader_close( &hrtfFileReader ); } -#endif /* === Configure === */ if ( ( error = IVAS_REND_InitConfig( hIvasRend, args.outConfig.audioConfig ) ) != IVAS_ERR_OK ) @@ -1156,12 +1136,6 @@ int main( exit( -1 ); } -#ifndef NONBE_FIX_BINARY_BINAURAL_READING -#ifdef SPLIT_REND_WITH_HEAD_ROT - CLDFBframeSize_smpls = 0; - cldfb_in_flag = 0; -#endif -#endif if ( args.renderConfigFilePath[0] != '\0' ) { IVAS_RENDER_CONFIG_DATA renderConfig; @@ -2223,9 +2197,7 @@ int main( free( outInt16Buffer ); free( outFloatBuffer ); -#ifdef NONBE_FIX_BINARY_BINAURAL_READING cleanup: -#endif #ifdef SPLIT_REND_WITH_HEAD_ROT if ( bitsBufferData != NULL ) @@ -2258,15 +2230,10 @@ cleanup: RotationFileReader_close( &externalOrientationFileReader ); RotationFileReader_close( &referenceRotReader ); Vector3PairFileReader_close( &referenceVectorReader ); -#ifndef NONBE_FIX_BINARY_BINAURAL_READING - hrtfFileReader_close( &hrtfFileReader ); -#endif -#ifdef NONBE_FIX_BINARY_BINAURAL_READING destroy_td_hrtf( hHrtfTD ); destroy_SetOfHRTF( hSetOfHRTF ); #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES destroy_hrtf_statistics( hHrtfStatistics ); -#endif #endif IVAS_REND_Close( &hIvasRend ); IsmPositionProvider_close( positionProvider ); diff --git a/lib_com/ivas_error.h b/lib_com/ivas_error.h index 36d3fd3933..8440a13e0f 100644 --- a/lib_com/ivas_error.h +++ b/lib_com/ivas_error.h @@ -78,9 +78,7 @@ typedef enum IVAS_ERR_DIRECTIVITY_NOT_SUPPORTED, IVAS_ERR_ACOUSTIC_ENVIRONMENT_NOT_SUPPORTED, IVAS_ERR_INVALID_HRTF, -#ifdef NONBE_FIX_BINARY_BINAURAL_READING IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA, -#endif IVAS_ERR_INVALID_INPUT_FORMAT, IVAS_ERR_INVALID_INDEX, IVAS_ERR_NOT_SUPPORTED_OPTION, @@ -260,10 +258,8 @@ static inline const char *ivas_error_to_string( ivas_error error_code ) return "Acoustic environment not supported"; case IVAS_ERR_INVALID_HRTF: return "Unsupported HRTF filter set"; -#ifdef NONBE_FIX_BINARY_BINAURAL_READING case IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA: return "Renderer data missing in HRTF binary file"; -#endif case IVAS_ERR_INVALID_INPUT_FORMAT: return "Invalid input format"; case IVAS_ERR_INVALID_INDEX: diff --git a/lib_com/options.h b/lib_com/options.h index 15aeeb449f..037cea8e5b 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -160,7 +160,6 @@ /* any switch which is non-be wrt selection floating point code */ /* all switches in this category should start with "NONBE_" */ -#define NONBE_FIX_BINARY_BINAURAL_READING /* Orange: Add support for reading binaural binary file */ #define NONBE_FIX_AVG_IAC_CLDFB_REVERB /* Orange: Add computation avg energy and iac tables for rom and binaural binary file */ #define NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES /* Philips: Use pre-computed HRTF average L/R energies and IAC in all renderers */ #define NONBE_FIX_935_EARLY_REFLECTIONS_WRONG_ORDER /* Qualcomm: issue 953: fix order or ER channels in LC mode*/ diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index 24ba618a3c..dacc54670a 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -2723,12 +2723,8 @@ void ivas_destroy_dec( { ivas_td_binaural_close( &st_ivas->hBinRendererTd ); } -#ifdef NONBE_FIX_BINARY_BINAURAL_READING if ( st_ivas->hHrtfTD != NULL ) -#else - else if ( st_ivas->hHrtfTD != NULL ) -#endif { BSplineModelEvalDealloc( &st_ivas->hHrtfTD->ModelParams, &st_ivas->hHrtfTD->ModelEval ); diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index 405a7bf997..afba5a8aff 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -1882,11 +1882,7 @@ ivas_error IVAS_DEC_FeedCustomLsData( ivas_error IVAS_DEC_GetHrtfHandle( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ -#ifdef NONBE_FIX_BINARY_BINAURAL_READING IVAS_DEC_HRTF_HANDLE **hHrtfTD /* o : HRTF handle */ -#else - IVAS_DEC_HRTF_HANDLE *hHrtfTD /* o : HRTF handle */ -#endif ) { if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL || hIvasDec->st_ivas->hHrtfTD == NULL ) @@ -1894,11 +1890,7 @@ ivas_error IVAS_DEC_GetHrtfHandle( return IVAS_ERR_UNEXPECTED_NULL_POINTER; } -#ifdef NONBE_FIX_BINARY_BINAURAL_READING *hHrtfTD = &hIvasDec->st_ivas->hHrtfTD; -#else - *hHrtfTD = hIvasDec->st_ivas->hHrtfTD; -#endif return IVAS_ERR_OK; } @@ -1912,11 +1904,7 @@ ivas_error IVAS_DEC_GetHrtfHandle( ivas_error IVAS_DEC_GetHrtfCRendHandle( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ -#ifdef NONBE_FIX_BINARY_BINAURAL_READING IVAS_DEC_HRTF_CREND_HANDLE **hSetOfHRTF /* o : Set of HRTF handle */ -#else - IVAS_DEC_HRTF_CREND_HANDLE *hSetOfHRTF /* o : Set of HRTF handle */ -#endif ) { if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL || hIvasDec->st_ivas->hSetOfHRTF == NULL ) @@ -1924,11 +1912,7 @@ ivas_error IVAS_DEC_GetHrtfCRendHandle( return IVAS_ERR_WRONG_PARAMS; } -#ifdef NONBE_FIX_BINARY_BINAURAL_READING *hSetOfHRTF = &hIvasDec->st_ivas->hSetOfHRTF; -#else - *hSetOfHRTF = hIvasDec->st_ivas->hSetOfHRTF; -#endif return IVAS_ERR_OK; } @@ -1942,11 +1926,7 @@ ivas_error IVAS_DEC_GetHrtfCRendHandle( ivas_error IVAS_DEC_GetHrtfFastConvHandle( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ -#ifdef NONBE_FIX_BINARY_BINAURAL_READING IVAS_DEC_HRTF_FASTCONV_HANDLE **hHrtfFastConv /* o : FASTCONV HRTF handle */ -#else - IVAS_DEC_HRTF_FASTCONV_HANDLE *hHrtfFastConv /* o : FASTCONV HRTF handle */ -#endif ) { if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL || hIvasDec->st_ivas->hHrtfFastConv == NULL ) @@ -1954,11 +1934,7 @@ ivas_error IVAS_DEC_GetHrtfFastConvHandle( return IVAS_ERR_WRONG_PARAMS; } -#ifdef NONBE_FIX_BINARY_BINAURAL_READING *hHrtfFastConv = &hIvasDec->st_ivas->hHrtfFastConv; -#else - *hHrtfFastConv = hIvasDec->st_ivas->hHrtfFastConv; -#endif return IVAS_ERR_OK; } @@ -1972,11 +1948,7 @@ ivas_error IVAS_DEC_GetHrtfFastConvHandle( ivas_error IVAS_DEC_GetHrtfParamBinHandle( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ -#ifdef NONBE_FIX_BINARY_BINAURAL_READING IVAS_DEC_HRTF_PARAMBIN_HANDLE **hHrtfParambin /* o : Parametric binauralizer HRTF handle */ -#else - IVAS_DEC_HRTF_PARAMBIN_HANDLE *hHrtfParambin /* o : Parametric binauralizer HRTF handle */ -#endif ) { if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL || hIvasDec->st_ivas->hHrtfParambin == NULL ) @@ -1984,11 +1956,7 @@ ivas_error IVAS_DEC_GetHrtfParamBinHandle( return IVAS_ERR_WRONG_PARAMS; } -#ifdef NONBE_FIX_BINARY_BINAURAL_READING *hHrtfParambin = &hIvasDec->st_ivas->hHrtfParambin; -#else - *hHrtfParambin = hIvasDec->st_ivas->hHrtfParambin; -#endif return IVAS_ERR_OK; } diff --git a/lib_dec/lib_dec.h b/lib_dec/lib_dec.h index 882ac57f22..eafd391b14 100644 --- a/lib_dec/lib_dec.h +++ b/lib_dec/lib_dec.h @@ -406,39 +406,23 @@ ivas_error IVAS_DEC_FeedCustomLsData( /*! r: error code */ ivas_error IVAS_DEC_GetHrtfHandle( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ -#ifdef NONBE_FIX_BINARY_BINAURAL_READING IVAS_DEC_HRTF_HANDLE **hHrtfTD /* o : HRTF handle */ -#else - IVAS_DEC_HRTF_HANDLE *hHrtfTD /* o : HRTF handle */ -#endif ); /*! r: error code */ ivas_error IVAS_DEC_GetHrtfCRendHandle( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ -#ifdef NONBE_FIX_BINARY_BINAURAL_READING IVAS_DEC_HRTF_CREND_HANDLE **hSetOfHRTF /* o : Set of HRTF handle */ -#else - IVAS_DEC_HRTF_CREND_HANDLE *hSetOfHRTF /* o : Set of HRTF handle */ -#endif ); ivas_error IVAS_DEC_GetHrtfFastConvHandle( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ -#ifdef NONBE_FIX_BINARY_BINAURAL_READING IVAS_DEC_HRTF_FASTCONV_HANDLE **hHrtfFastConv/* o : FASTCONV HRTF handle */ -#else - IVAS_DEC_HRTF_FASTCONV_HANDLE *hHrtfFastConv /* o : FASTCONV HRTF handle */ -#endif ); ivas_error IVAS_DEC_GetHrtfParamBinHandle( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ -#ifdef NONBE_FIX_BINARY_BINAURAL_READING IVAS_DEC_HRTF_PARAMBIN_HANDLE **hHrtfParambin/* o : Parametric binauralizer HRTF handle */ -#else - IVAS_DEC_HRTF_PARAMBIN_HANDLE *hHrtfParambin /* o : Parametric binauralizer HRTF handle */ -#endif ); #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES diff --git a/lib_rend/ivas_crend.c b/lib_rend/ivas_crend.c index e53535cdfc..988a9ecde7 100644 --- a/lib_rend/ivas_crend.c +++ b/lib_rend/ivas_crend.c @@ -91,9 +91,7 @@ ivas_error ivas_hrtf_init( hHrtf->pOut_to_bin_diffuse_im[j] = NULL; } -#ifdef NONBE_FIX_BINARY_BINAURAL_READING hHrtf->init_from_rom = 1; -#endif return IVAS_ERR_OK; } @@ -212,7 +210,6 @@ static ivas_error ivas_rend_initCrend( return IVAS_ERR_INTERNAL_FATAL; } -#ifdef NONBE_FIX_BINARY_BINAURAL_READING if ( ( hSetOfHRTF == NULL ) || ( ( hSetOfHRTF->hHRTF_hrir_combined == NULL ) && ( inConfigType == IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED ) && ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) || ( ( hSetOfHRTF->hHRTF_hrir_combined == NULL ) && ( inConfigType == IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED ) && ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL ) ) || @@ -220,13 +217,8 @@ static ivas_error ivas_rend_initCrend( ( ( hSetOfHRTF->hHRTF_hrir_foa == NULL ) && ( inConfig == IVAS_AUDIO_CONFIG_FOA ) ) || ( ( hSetOfHRTF->hHRTF_hrir_hoa2 == NULL ) && ( inConfig == IVAS_AUDIO_CONFIG_HOA2 ) ) || ( ( hSetOfHRTF->hHRTF_hrir_hoa3 == NULL ) && ( inConfig == IVAS_AUDIO_CONFIG_HOA3 ) ) ) -#else - if ( hSetOfHRTF == NULL ) -#endif { -#ifdef NONBE_FIX_BINARY_BINAURAL_READING hHrtf->init_from_rom = 1; -#endif if ( inConfigType == IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED ) { hHrtf->max_num_ir -= 1; /* subtract LFE */ @@ -701,9 +693,7 @@ static ivas_error ivas_rend_initCrend( } else { -#ifdef NONBE_FIX_BINARY_BINAURAL_READING hHrtf->init_from_rom = 0; -#endif if ( inConfigType == IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED ) { hHrtf->max_num_ir -= 1; /* subtract LFE */ @@ -711,24 +701,20 @@ static ivas_error ivas_rend_initCrend( if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) { -#ifdef NONBE_FIX_BINARY_BINAURAL_READING if ( hSetOfHRTF->hHRTF_brir_combined == NULL ) { return IVAS_ERROR( IVAS_ERR_UNEXPECTED_NULL_POINTER, "Invalid function parameters " ); } -#endif hHrtf->latency_s = hSetOfHRTF->hHRTF_brir_combined->latency_s; hHrtf->max_num_iterations = hSetOfHRTF->hHRTF_brir_combined->max_num_iterations; hHrtf->index_frequency_max_diffuse = hSetOfHRTF->hHRTF_brir_combined->index_frequency_max_diffuse; } else { -#ifdef NONBE_FIX_BINARY_BINAURAL_READING if ( hSetOfHRTF->hHRTF_hrir_combined == NULL ) { return IVAS_ERROR( IVAS_ERR_UNEXPECTED_NULL_POINTER, "Invalid function parameters" ); } -#endif hHrtf->latency_s = hSetOfHRTF->hHRTF_hrir_combined->latency_s; hHrtf->max_num_iterations = hSetOfHRTF->hHRTF_hrir_combined->max_num_iterations; hHrtf->index_frequency_max_diffuse = hSetOfHRTF->hHRTF_hrir_combined->index_frequency_max_diffuse; @@ -804,12 +790,10 @@ static ivas_error ivas_rend_initCrend( { if ( inConfig == IVAS_AUDIO_CONFIG_HOA3 ) { -#ifdef NONBE_FIX_BINARY_BINAURAL_READING if ( hSetOfHRTF->hHRTF_hrir_hoa3 == NULL ) { return IVAS_ERROR( IVAS_ERR_UNEXPECTED_NULL_POINTER, "Invalid function parameters" ); } -#endif hHrtf->latency_s = hSetOfHRTF->hHRTF_hrir_hoa3->latency_s; hHrtf->max_num_iterations = hSetOfHRTF->hHRTF_hrir_hoa3->max_num_iterations; hHrtf->index_frequency_max_diffuse = hSetOfHRTF->hHRTF_hrir_hoa3->index_frequency_max_diffuse; @@ -835,12 +819,10 @@ static ivas_error ivas_rend_initCrend( } else if ( inConfig == IVAS_AUDIO_CONFIG_HOA2 ) { -#ifdef NONBE_FIX_BINARY_BINAURAL_READING if ( hSetOfHRTF->hHRTF_hrir_hoa2 == NULL ) { return IVAS_ERROR( IVAS_ERR_UNEXPECTED_NULL_POINTER, "Invalid function parameters" ); } -#endif hHrtf->latency_s = hSetOfHRTF->hHRTF_hrir_hoa2->latency_s; hHrtf->max_num_iterations = hSetOfHRTF->hHRTF_hrir_hoa2->max_num_iterations; hHrtf->index_frequency_max_diffuse = hSetOfHRTF->hHRTF_hrir_hoa2->index_frequency_max_diffuse; @@ -866,12 +848,10 @@ static ivas_error ivas_rend_initCrend( } else if ( inConfig == IVAS_AUDIO_CONFIG_FOA ) { -#ifdef NONBE_FIX_BINARY_BINAURAL_READING if ( hSetOfHRTF->hHRTF_hrir_foa == NULL ) { return IVAS_ERROR( IVAS_ERR_UNEXPECTED_NULL_POINTER, "Invalid function parameters" ); } -#endif hHrtf->latency_s = hSetOfHRTF->hHRTF_hrir_foa->latency_s; hHrtf->max_num_iterations = hSetOfHRTF->hHRTF_hrir_foa->max_num_iterations; hHrtf->index_frequency_max_diffuse = hSetOfHRTF->hHRTF_hrir_foa->index_frequency_max_diffuse; diff --git a/lib_rend/ivas_hrtf.c b/lib_rend/ivas_hrtf.c index 1f943595be..ec40720466 100644 --- a/lib_rend/ivas_hrtf.c +++ b/lib_rend/ivas_hrtf.c @@ -57,9 +57,7 @@ ivas_error ivas_HRTF_binary_open( return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for HRTF binary!" ); } -#ifdef NONBE_FIX_BINARY_BINAURAL_READING set_c( (int8_t *) ( *hHrtfTD ), 0, (int32_t) sizeof( TDREND_HRFILT_FiltSet_t ) ); -#endif return IVAS_ERR_OK; } @@ -190,9 +188,7 @@ ivas_error ivas_HRTF_parambin_binary_open( return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for parametric binauralizer HRTF tables!" ); } -#ifdef NONBE_FIX_BINARY_BINAURAL_READING set_c( (int8_t *) ( *hHrtfParambin ), 0, (int32_t) sizeof( HRTFS_PARAMBIN ) ); -#endif return IVAS_ERR_OK; } diff --git a/lib_rend/ivas_objectRenderer.c b/lib_rend/ivas_objectRenderer.c index 4cf67ea6e0..2ba42cac6d 100644 --- a/lib_rend/ivas_objectRenderer.c +++ b/lib_rend/ivas_objectRenderer.c @@ -672,11 +672,7 @@ ivas_error ivas_td_binaural_open_ext( directivity = hRendCfg->directivity; } -#ifdef NONBE_FIX_BINARY_BINAURAL_READING return ivas_td_binaural_open_unwrap( pTDRend->hHrtfTD, outFs, nchan_transport, ivas_format, transport_config, directivity, hTransSetup, &pTDRend->hBinRendererTd, &pTDRend->binaural_latency_ns ); -#else - return ivas_td_binaural_open_unwrap( &pTDRend->hHrtfTD, outFs, nchan_transport, ivas_format, transport_config, directivity, hTransSetup, &pTDRend->hBinRendererTd, &pTDRend->binaural_latency_ns ); -#endif } diff --git a/lib_rend/ivas_objectRenderer_mix.c b/lib_rend/ivas_objectRenderer_mix.c index 9b5d2ba03e..7fb2a06ad3 100644 --- a/lib_rend/ivas_objectRenderer_mix.c +++ b/lib_rend/ivas_objectRenderer_mix.c @@ -145,11 +145,7 @@ void TDREND_MIX_Dealloc( hBinRendererTd->Listener_p = NULL; } /* Dealloc HR filter set */ -#ifdef NONBE_FIX_BINARY_BINAURAL_READING if ( ( *hBinRendererTd->pHrFiltSet_p != NULL ) && ( hBinRendererTd->HrFiltSet_p != NULL ) ) -#else - if ( hBinRendererTd->HrFiltSet_p != NULL ) -#endif { if ( hBinRendererTd->HrFiltSet_p->FilterMethod == TDREND_HRFILT_Method_BSplineModel ) { @@ -179,17 +175,12 @@ void TDREND_MIX_Dealloc( } } -#ifdef NONBE_FIX_BINARY_BINAURAL_READING if ( hBinRendererTd->HrFiltSet_p->ModelParams.modelROM == 1 ) { free( hBinRendererTd->HrFiltSet_p ); hBinRendererTd->HrFiltSet_p = NULL; *hBinRendererTd->pHrFiltSet_p = NULL; } -#else - free( hBinRendererTd->HrFiltSet_p ); - hBinRendererTd->HrFiltSet_p = NULL; -#endif } return; @@ -253,9 +244,7 @@ ivas_error TDREND_MIX_Init( hBinRendererTd->HrFiltSet_p = *hHrtfTD; } -#ifdef NONBE_FIX_BINARY_BINAURAL_READING hBinRendererTd->pHrFiltSet_p = hHrtfTD; -#endif if ( hBinRendererTd->HrFiltSet_p->SampleRate != output_Fs ) { diff --git a/lib_rend/ivas_stat_rend.h b/lib_rend/ivas_stat_rend.h index 35ee806739..fde7b70bc1 100644 --- a/lib_rend/ivas_stat_rend.h +++ b/lib_rend/ivas_stat_rend.h @@ -1160,9 +1160,7 @@ typedef struct ivas_binaural_td_rendering_struct float Gain; /* Mixer gain */ TDREND_MIX_Listener_t *Listener_p; /* The virtual listener */ TDREND_HRFILT_FiltSet_t *HrFiltSet_p; /* HR filter set */ -#ifdef NONBE_FIX_BINARY_BINAURAL_READING TDREND_HRFILT_FiltSet_t **pHrFiltSet_p; /* pointer to HR filter set */ -#endif int16_t UseCommonDistAttenModel; /* Use common dist atten model (TRUE/FALSE) */ int16_t DistAttenEnabled; /* (TRUE/FALSE) */ @@ -1174,11 +1172,7 @@ typedef struct { int32_t binaural_latency_ns; BINAURAL_TD_OBJECT_RENDERER_HANDLE hBinRendererTd; -#ifdef NONBE_FIX_BINARY_BINAURAL_READING TDREND_HRFILT_FiltSet_t **hHrtfTD; -#else - TDREND_HRFILT_FiltSet_t *hHrtfTD; -#endif } TDREND_WRAPPER, *TDREND_WRAPPER_HANDLE; @@ -1201,9 +1195,7 @@ typedef struct ivas_hrtfs_structure uint16_t index_frequency_max_diffuse; int16_t max_num_ir; int16_t max_num_iterations; -#ifdef NONBE_FIX_BINARY_BINAURAL_READING int16_t init_from_rom; -#endif float inv_diffuse_weight[BINAURAL_CHANNELS][MAX_INTERN_CHANNELS]; /* inverse diffuse weights array, access one inverse weight by pInvDiffuseWeight[channel] */ int16_t same_inv_diffuse_weight; float gain_lfe; @@ -1650,11 +1642,7 @@ typedef struct ivas_masa_external_rendering_struct #endif REVERB_STRUCT_HANDLE hReverb; -#ifdef NONBE_FIX_BINARY_BINAURAL_READING HRTFS_PARAMBIN_HANDLE *hHrtfParambin; -#else - HRTFS_PARAMBIN_HANDLE hHrtfParambin; -#endif VBAP_HANDLE hVBAPdata; float *hoa_dec_mtx; diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index bbc8441067..ea12814700 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -66,11 +66,7 @@ #define MAX_BUFFER_LENGTH ( MAX_BUFFER_LENGTH_PER_CHANNEL * MAX_INPUT_CHANNELS ) #endif -#ifdef NONBE_FIX_BINARY_BINAURAL_READING #define MAX_BIN_DELAY_SAMPLES 150 /* Maximum supported rendering latency for binaural IRs */ -#else -#define MAX_BIN_DELAY_SAMPLES 50 /* Maximum supported rendering latency for binaural IRs */ -#endif /* Frame size required when rendering to binaural */ #define BINAURAL_RENDERING_FRAME_SIZE_MS 5 @@ -227,7 +223,6 @@ typedef struct MASA_PREREND_HANDLE hMasaPrerend; } input_masa; -#ifdef NONBE_FIX_BINARY_BINAURAL_READING typedef struct hrtf_handles { IVAS_DEC_HRTF_CREND_HANDLE hSetOfHRTF; @@ -238,7 +233,6 @@ typedef struct hrtf_handles IVAS_DEC_HRTF_STATISTICS_HANDLE hHrtfStatistics; #endif } hrtf_handles; -#endif struct IVAS_REND { @@ -278,14 +272,7 @@ struct IVAS_REND RENDER_CONFIG_DATA *hRendererConfig; /* Renderer config pointer */ int16_t num_subframes; -#ifdef NONBE_FIX_BINARY_BINAURAL_READING hrtf_handles hHrtfs; -#else - IVAS_DEC_HRTF_CREND_HANDLE hSetOfHRTF; - IVAS_DEC_HRTF_FASTCONV_HANDLE hHrtfFastConv; - IVAS_DEC_HRTF_PARAMBIN_HANDLE hHrtfParambin; - IVAS_DEC_HRTF_HANDLE hHrtfTD; -#endif }; @@ -293,15 +280,11 @@ struct IVAS_REND * Local function prototypes *-------------------------------------------------------------------*/ -#ifdef NONBE_FIX_BINARY_BINAURAL_READING #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES static ivas_error initMasaExtRenderer( input_masa *inputMasa, const AUDIO_CONFIG outConfig, const RENDER_CONFIG_DATA *hRendCfg, hrtf_handles *hHrtfs ); #else static ivas_error initMasaExtRenderer( input_masa *inputMasa, const AUDIO_CONFIG outConfig, hrtf_handles *hHrtfs ); #endif -#else -static ivas_error initMasaExtRenderer( input_masa *inputMasa, const AUDIO_CONFIG outConfig ); -#endif static void freeMasaExtRenderer( MASA_EXT_REND_HANDLE *hMasaExtRendOut ); @@ -1354,9 +1337,6 @@ static ivas_error initIsmMasaRendering( if ( inputIsm->tdRendWrapper.hBinRendererTd != NULL ) { ivas_td_binaural_close( &inputIsm->tdRendWrapper.hBinRendererTd ); -#ifndef NONBE_FIX_BINARY_BINAURAL_READING - inputIsm->tdRendWrapper.hHrtfTD = NULL; -#endif } #ifdef SPLIT_REND_WITH_HEAD_ROT @@ -1380,12 +1360,8 @@ static ivas_error setRendInputActiveIsm( void *input, const AUDIO_CONFIG inConfig, const IVAS_REND_InputId id, -#ifdef NONBE_FIX_BINARY_BINAURAL_READING RENDER_CONFIG_DATA *hRendCfg, hrtf_handles *hrtfs -#else - RENDER_CONFIG_DATA *hRendCfg -#endif ) { ivas_error error; @@ -1425,18 +1401,14 @@ static ivas_error setRendInputActiveIsm( for ( i = 0; i < (int16_t) ( sizeof( inputIsm->splitTdRendWrappers ) / sizeof( *inputIsm->splitTdRendWrappers ) ); ++i ) { inputIsm->splitTdRendWrappers[i] = defaultTdRendWrapper(); -#ifdef NONBE_FIX_BINARY_BINAURAL_READING inputIsm->splitTdRendWrappers[i].hHrtfTD = &hrtfs->hHrtfTD; -#endif } #endif inputIsm->hOMasa = NULL; error = IVAS_ERR_OK; -#ifdef NONBE_FIX_BINARY_BINAURAL_READING inputIsm->tdRendWrapper.hHrtfTD = &hrtfs->hHrtfTD; -#endif #ifdef SPLIT_REND_WITH_HEAD_ROT if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL || outConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || outConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) @@ -1445,14 +1417,10 @@ static ivas_error setRendInputActiveIsm( #endif { #ifndef SPLIT_REND_WITH_HEAD_ROT -#ifdef NONBE_FIX_BINARY_BINAURAL_READING #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( ( error = ivas_rend_openCrend( &inputIsm->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, hrtfs->hSetOfHRTF, hrtfs->hHrtfStatistics, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) #else if ( ( error = ivas_rend_openCrend( &inputIsm->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, hrtfs->hSetOfHRTF, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) -#endif -#else - if ( ( error = ivas_rend_openCrend( &inputIsm->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) #endif { return error; @@ -1521,14 +1489,10 @@ static ivas_error setRendInputActiveIsm( } else if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) { -#ifdef NONBE_FIX_BINARY_BINAURAL_READING #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( ( error = ivas_rend_openCrend( &inputIsm->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, hrtfs->hSetOfHRTF, hrtfs->hHrtfStatistics, *rendCtx.pOutSampleRate, rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses ) ) != IVAS_ERR_OK ) #else if ( ( error = ivas_rend_openCrend( &inputIsm->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, hrtfs->hSetOfHRTF, *rendCtx.pOutSampleRate, rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses ) ) != IVAS_ERR_OK ) -#endif -#else - if ( ( error = ivas_rend_openCrend( &inputIsm->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate, rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses ) ) != IVAS_ERR_OK ) #endif { return error; @@ -1566,18 +1530,12 @@ static void clearInputIsm( if ( inputIsm->tdRendWrapper.hBinRendererTd != NULL ) { ivas_td_binaural_close( &inputIsm->tdRendWrapper.hBinRendererTd ); -#ifndef NONBE_FIX_BINARY_BINAURAL_READING - inputIsm->tdRendWrapper.hHrtfTD = NULL; -#endif } #ifdef SPLIT_REND_WITH_HEAD_ROT for ( i = 0; i < (int16_t) ( sizeof( inputIsm->splitTdRendWrappers ) / sizeof( *inputIsm->splitTdRendWrappers ) ); ++i ) { ivas_td_binaural_close( &inputIsm->splitTdRendWrappers[i].hBinRendererTd ); -#ifndef NONBE_FIX_BINARY_BINAURAL_READING - inputIsm->splitTdRendWrappers[i].hHrtfTD = NULL; -#endif } #endif @@ -2221,11 +2179,9 @@ static ivas_error initMcBinauralRendering( const AUDIO_CONFIG inConfig, const AUDIO_CONFIG outConfig, RENDER_CONFIG_DATA *hRendCfg, -#ifdef NONBE_FIX_BINARY_BINAURAL_READING IVAS_DEC_HRTF_CREND_HANDLE hMixconv, #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES HRTFS_STATISTICS_HANDLE hHrtfStatistics, -#endif #endif uint8_t reconfigureFlag ) { @@ -2257,9 +2213,6 @@ static ivas_error initMcBinauralRendering( if ( !reconfigureFlag || ( !useTDRend && inputMc->tdRendWrapper.hBinRendererTd != NULL ) ) { ivas_td_binaural_close( &inputMc->tdRendWrapper.hBinRendererTd ); -#ifndef NONBE_FIX_BINARY_BINAURAL_READING - inputMc->tdRendWrapper.hHrtfTD = NULL; -#endif } #ifdef SPLIT_REND_WITH_HEAD_ROT @@ -2270,9 +2223,6 @@ static ivas_error initMcBinauralRendering( if ( inputMc->splitTdRendWrappers[i].hBinRendererTd != NULL ) { ivas_td_binaural_close( &inputMc->splitTdRendWrappers[i].hBinRendererTd ); -#ifndef NONBE_FIX_BINARY_BINAURAL_READING - inputMc->splitTdRendWrappers[i].hHrtfTD = NULL; -#endif } } } @@ -2343,7 +2293,6 @@ static ivas_error initMcBinauralRendering( { /* open CREND */ #ifdef SPLIT_REND_WITH_HEAD_ROT -#ifdef NONBE_FIX_BINARY_BINAURAL_READING #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( ( error = ivas_rend_openCrend( &inputMc->crendWrapper, ( inConfig == IVAS_AUDIO_CONFIG_LS_CUSTOM ) ? IVAS_AUDIO_CONFIG_7_1_4 : inConfig, outConfig, hRendCfg, hMixconv, hHrtfStatistics, outSampleRate, ( ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) || ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) ) ? inputMc->base.ctx.pSplitRendWrapper->multiBinPoseData.num_poses : 1 ) ) != IVAS_ERR_OK ) @@ -2352,19 +2301,11 @@ static ivas_error initMcBinauralRendering( outSampleRate, ( ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) || ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) ) ? inputMc->base.ctx.pSplitRendWrapper->multiBinPoseData.num_poses : 1 ) ) != IVAS_ERR_OK ) #endif #else - if ( ( error = ivas_rend_openCrend( &inputMc->crendWrapper, ( inConfig == IVAS_AUDIO_CONFIG_LS_CUSTOM ) ? IVAS_AUDIO_CONFIG_7_1_4 : inConfig, outConfig, hRendCfg, NULL, - outSampleRate, ( ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) || ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) ) ? inputMc->base.ctx.pSplitRendWrapper->multiBinPoseData.num_poses : 1 ) ) != IVAS_ERR_OK ) -#endif -#else -#ifdef NONBE_FIX_BINARY_BINAURAL_READING #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( ( error = ivas_rend_openCrend( &inputMc->crendWrapper, ( inConfig == IVAS_AUDIO_CONFIG_LS_CUSTOM ) ? IVAS_AUDIO_CONFIG_7_1_4 : inConfig, outConfig, hRendCfg, hMixconv, hHrtfStatistics, outSampleRate ) ) != IVAS_ERR_OK ) #else if ( ( error = ivas_rend_openCrend( &inputMc->crendWrapper, ( inConfig == IVAS_AUDIO_CONFIG_LS_CUSTOM ) ? IVAS_AUDIO_CONFIG_7_1_4 : inConfig, outConfig, hRendCfg, hMixconv, outSampleRate ) ) != IVAS_ERR_OK ) #endif -#else - if ( ( error = ivas_rend_openCrend( &inputMc->crendWrapper, ( inConfig == IVAS_AUDIO_CONFIG_LS_CUSTOM ) ? IVAS_AUDIO_CONFIG_7_1_4 : inConfig, outConfig, hRendCfg, NULL, outSampleRate ) ) != IVAS_ERR_OK ) -#endif #endif { return error; @@ -2403,9 +2344,6 @@ static ivas_error initMcMasaRendering( if ( inputMc->tdRendWrapper.hBinRendererTd != NULL ) { ivas_td_binaural_close( &inputMc->tdRendWrapper.hBinRendererTd ); -#ifndef NONBE_FIX_BINARY_BINAURAL_READING - inputMc->tdRendWrapper.hHrtfTD = NULL; -#endif } #ifdef SPLIT_REND_WITH_HEAD_ROT @@ -2493,12 +2431,8 @@ static ivas_error setRendInputActiveMc( void *input, const AUDIO_CONFIG inConfig, const IVAS_REND_InputId id, -#ifdef NONBE_FIX_BINARY_BINAURAL_READING RENDER_CONFIG_DATA *hRendCfg, hrtf_handles *hrtfs -#else - RENDER_CONFIG_DATA *hRendCfg -#endif ) { #ifdef SPLIT_REND_WITH_HEAD_ROT @@ -2536,13 +2470,11 @@ static ivas_error setRendInputActiveMc( inputMc->customLsInput = defaultCustomLs(); inputMc->tdRendWrapper = defaultTdRendWrapper(); -#ifdef NONBE_FIX_BINARY_BINAURAL_READING if ( hrtfs->hHrtfTD ) { inputMc->tdRendWrapper.binaural_latency_ns = (int32_t) ( hrtfs->hHrtfTD->latency_s * 1000000000.f ); } inputMc->tdRendWrapper.hHrtfTD = &hrtfs->hHrtfTD; -#endif inputMc->crendWrapper = NULL; inputMc->hReverb = NULL; inputMc->hMcMasa = NULL; @@ -2563,13 +2495,11 @@ static ivas_error setRendInputActiveMc( for ( i = 0; i < (int16_t) ( sizeof( inputMc->splitTdRendWrappers ) / sizeof( *inputMc->splitTdRendWrappers ) ); ++i ) { inputMc->splitTdRendWrappers[i] = defaultTdRendWrapper(); -#ifdef NONBE_FIX_BINARY_BINAURAL_READING if ( hrtfs->hHrtfTD ) { inputMc->splitTdRendWrappers[i].binaural_latency_ns = (int32_t) ( hrtfs->hHrtfTD->latency_s * 1000000000.f ); } inputMc->splitTdRendWrappers[i].hHrtfTD = &hrtfs->hHrtfTD; -#endif } if ( getAudioConfigType( outConfig ) == IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL ) @@ -2577,14 +2507,10 @@ static ivas_error setRendInputActiveMc( if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL || outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR || outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) #endif { -#ifdef NONBE_FIX_BINARY_BINAURAL_READING #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( ( error = initMcBinauralRendering( inputMc, inConfig, outConfig, hRendCfg, hrtfs->hSetOfHRTF, hrtfs->hHrtfStatistics, FALSE ) ) != IVAS_ERR_OK ) #else if ( ( error = initMcBinauralRendering( inputMc, inConfig, outConfig, hRendCfg, hrtfs->hSetOfHRTF, FALSE ) ) != IVAS_ERR_OK ) -#endif -#else - if ( ( error = initMcBinauralRendering( inputMc, inConfig, outConfig, hRendCfg, FALSE ) ) != IVAS_ERR_OK ) #endif { return error; @@ -2639,9 +2565,6 @@ static void clearInputMc( if ( inputMc->tdRendWrapper.hBinRendererTd != NULL ) { ivas_td_binaural_close( &inputMc->tdRendWrapper.hBinRendererTd ); -#ifndef NONBE_FIX_BINARY_BINAURAL_READING - inputMc->tdRendWrapper.hHrtfTD = NULL; -#endif } #ifdef SPLIT_REND_WITH_HEAD_ROT @@ -2650,9 +2573,6 @@ static void clearInputMc( if ( inputMc->splitTdRendWrappers[i].hBinRendererTd != NULL ) { ivas_td_binaural_close( &inputMc->splitTdRendWrappers[i].hBinRendererTd ); -#ifndef NONBE_FIX_BINARY_BINAURAL_READING - inputMc->splitTdRendWrappers[i].hHrtfTD = NULL; -#endif } } #endif @@ -2785,16 +2705,12 @@ static ivas_error updateSplitPostRendPanGains( static ivas_error updateSbaPanGains( input_sba *inputSba, const AUDIO_CONFIG outConfig, -#ifdef NONBE_FIX_BINARY_BINAURAL_READING RENDER_CONFIG_DATA *hRendCfg, IVAS_DEC_HRTF_CREND_HANDLE hMixconv #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES , IVAS_DEC_HRTF_STATISTICS_HANDLE hHrtfStatistics #endif -#else - RENDER_CONFIG_DATA *hRendCfg -#endif ) { ivas_error error; @@ -2854,7 +2770,6 @@ static ivas_error updateSbaPanGains( else #endif { -#ifdef NONBE_FIX_BINARY_BINAURAL_READING #ifdef SPLIT_REND_WITH_HEAD_ROT #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( ( error = ivas_rend_openCrend( &inputSba->crendWrapper, inConfig, outConfig, hRendCfg, hMixconv, hHrtfStatistics, *rendCtx.pOutSampleRate, rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses ) ) != IVAS_ERR_OK ) @@ -2867,13 +2782,6 @@ static ivas_error updateSbaPanGains( #else if ( ( error = ivas_rend_openCrend( &inputSba->crendWrapper, inConfig, outConfig, hRendCfg, hMixconv, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) #endif -#endif -#else -#ifdef SPLIT_REND_WITH_HEAD_ROT - if ( ( error = ivas_rend_openCrend( &inputSba->crendWrapper, inConfig, outConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate, rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_rend_openCrend( &inputSba->crendWrapper, inConfig, outConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) -#endif #endif { return error; @@ -2887,7 +2795,6 @@ static ivas_error updateSbaPanGains( return error; } -#ifdef NONBE_FIX_BINARY_BINAURAL_READING #ifdef SPLIT_REND_WITH_HEAD_ROT #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( ( error = ivas_rend_openCrend( &inputSba->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, hMixconv, hHrtfStatistics, *rendCtx.pOutSampleRate, rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses ) ) != IVAS_ERR_OK ) @@ -2900,13 +2807,6 @@ static ivas_error updateSbaPanGains( #else if ( ( error = ivas_rend_openCrend( &inputSba->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, hMixconv, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) #endif -#endif -#else -#ifdef SPLIT_REND_WITH_HEAD_ROT - if ( ( error = ivas_rend_openCrend( &inputSba->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate, rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_rend_openCrend( &inputSba->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) -#endif #endif { return error; @@ -2939,7 +2839,6 @@ static ivas_error setRendInputActiveSplitPostRend( const AUDIO_CONFIG inConfig, const IVAS_REND_InputId id, RENDER_CONFIG_DATA *hRendCfg -#ifdef NONBE_FIX_BINARY_BINAURAL_READING , #if defined _MSC_VER && !defined __clang__ #ifdef _MSC_VER @@ -2952,7 +2851,6 @@ static ivas_error setRendInputActiveSplitPostRend( #else hrtf_handles *hrtfs __attribute__( ( unused ) ) /* avoid unused parameter warning when compiling with clang */ #endif -#endif ) { ivas_error error; @@ -3007,12 +2905,8 @@ static ivas_error setRendInputActiveSba( void *input, const AUDIO_CONFIG inConfig, const IVAS_REND_InputId id, -#ifdef NONBE_FIX_BINARY_BINAURAL_READING RENDER_CONFIG_DATA *hRendCfg, hrtf_handles *hrtfs -#else - RENDER_CONFIG_DATA *hRendCfg -#endif ) { ivas_error error; @@ -3055,9 +2949,7 @@ static ivas_error setRendInputActiveSba( { initRotGains( inputSba->rot_gains_prev[pos_idx] ); } -#ifdef NONBE_FIX_BINARY_BINAURAL_READING inputSba->cldfbRendWrapper.hHrtfFastConv = hrtfs->hHrtfFastConv; -#endif #else inputSba->crendWrapper = NULL; inputSba->hDirAC = NULL; @@ -3072,14 +2964,10 @@ static ivas_error setRendInputActiveSba( } } -#ifdef NONBE_FIX_BINARY_BINAURAL_READING #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( ( error = updateSbaPanGains( inputSba, outConfig, hRendCfg, hrtfs->hSetOfHRTF, hrtfs->hHrtfStatistics ) ) != IVAS_ERR_OK ) #else if ( ( error = updateSbaPanGains( inputSba, outConfig, hRendCfg, hrtfs->hSetOfHRTF ) ) != IVAS_ERR_OK ) -#endif -#else - if ( ( error = updateSbaPanGains( inputSba, outConfig, hRendCfg ) ) != IVAS_ERR_OK ) #endif { return error; @@ -3154,12 +3042,8 @@ static ivas_error setRendInputActiveMasa( void *input, const AUDIO_CONFIG inConfig, const IVAS_REND_InputId id, -#ifdef NONBE_FIX_BINARY_BINAURAL_READING RENDER_CONFIG_DATA *hRendCfg, hrtf_handles *hrtfs -#else - RENDER_CONFIG_DATA *hRendCfg -#endif #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES ) #else @@ -3205,14 +3089,10 @@ static ivas_error setRendInputActiveMasa( } else { -#ifdef NONBE_FIX_BINARY_BINAURAL_READING #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( ( error = initMasaExtRenderer( inputMasa, outConfig, hRendCfg, hrtfs ) ) != IVAS_ERR_OK ) #else if ( ( error = initMasaExtRenderer( inputMasa, outConfig, hrtfs ) ) != IVAS_ERR_OK ) -#endif -#else - if ( ( error = initMasaExtRenderer( inputMasa, outConfig ) ) != IVAS_ERR_OK ) #endif { return error; @@ -3309,9 +3189,7 @@ ivas_error IVAS_REND_Open( IVAS_REND_HANDLE *phIvasRend, const int32_t outputSampleRate, const AUDIO_CONFIG outConfig, -#ifdef NONBE_FIX_BINARY_BINAURAL_READING const bool asHrtfBinary, -#endif const int16_t nonDiegeticPan, const float nonDiegeticPanGain, const int16_t num_subframes ) @@ -3478,7 +3356,6 @@ ivas_error IVAS_REND_Open( } #endif -#ifdef NONBE_FIX_BINARY_BINAURAL_READING hIvasRend->hHrtfs.hHrtfFastConv = NULL; hIvasRend->hHrtfs.hHrtfParambin = NULL; hIvasRend->hHrtfs.hHrtfTD = NULL; @@ -3516,7 +3393,6 @@ ivas_error IVAS_REND_Open( { return error; } -#endif #endif return IVAS_ERR_OK; @@ -3663,14 +3539,10 @@ ivas_error IVAS_REND_ConfigureCustomOutputLoudspeakerLayout( continue; } -#ifdef NONBE_FIX_BINARY_BINAURAL_READING #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( ( error = updateSbaPanGains( inputSba, hIvasRend->outputConfig, hIvasRend->hRendererConfig, NULL, NULL ) ) != IVAS_ERR_OK ) #else if ( ( error = updateSbaPanGains( inputSba, hIvasRend->outputConfig, hIvasRend->hRendererConfig, NULL ) ) != IVAS_ERR_OK ) -#endif -#else - if ( ( error = updateSbaPanGains( inputSba, hIvasRend->outputConfig, hIvasRend->hRendererConfig ) ) != IVAS_ERR_OK ) #endif { return error; @@ -3997,11 +3869,7 @@ ivas_error IVAS_REND_AddInput( int32_t maxNumInputsOfType; void *inputsArray; int32_t inputStructSize; -#ifdef NONBE_FIX_BINARY_BINAURAL_READING ivas_error ( *activateInput )( void *, AUDIO_CONFIG, IVAS_REND_InputId, RENDER_CONFIG_DATA *, hrtf_handles * ); -#else - ivas_error ( *activateInput )( void *, AUDIO_CONFIG, IVAS_REND_InputId, RENDER_CONFIG_DATA * ); -#endif int32_t inputIndex; /* Validate function arguments */ @@ -4073,11 +3941,7 @@ ivas_error IVAS_REND_AddInput( } *inputId = makeInputId( inConfig, inputIndex ); -#ifdef NONBE_FIX_BINARY_BINAURAL_READING if ( ( error = activateInput( (uint8_t *) inputsArray + inputStructSize * inputIndex, inConfig, *inputId, hIvasRend->hRendererConfig, &hIvasRend->hHrtfs ) ) != IVAS_ERR_OK ) -#else - if ( ( error = activateInput( (uint8_t *) inputsArray + inputStructSize * inputIndex, inConfig, *inputId, hIvasRend->hRendererConfig ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -4146,11 +4010,9 @@ ivas_error IVAS_REND_ConfigureCustomInputLoudspeakerLayout( inputMc->base.inConfig, hIvasRend->outputConfig, hIvasRend->hRendererConfig, -#ifdef NONBE_FIX_BINARY_BINAURAL_READING hIvasRend->hHrtfs.hSetOfHRTF, #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES hIvasRend->hHrtfs.hHrtfStatistics, -#endif #endif FALSE ) ) != IVAS_ERR_OK ) { @@ -4995,11 +4857,9 @@ ivas_error IVAS_REND_SetHeadRotation( hIvasRend->inputsMc[i].base.inConfig, hIvasRend->outputConfig, hIvasRend->hRendererConfig, -#ifdef NONBE_FIX_BINARY_BINAURAL_READING hIvasRend->hHrtfs.hSetOfHRTF, #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES hIvasRend->hHrtfs.hHrtfStatistics, -#endif #endif TRUE ) ) != IVAS_ERR_OK ) { @@ -5065,11 +4925,9 @@ ivas_error IVAS_REND_DisableHeadRotation( hIvasRend->inputsMc[i].base.inConfig, hIvasRend->outputConfig, hIvasRend->hRendererConfig, -#ifdef NONBE_FIX_BINARY_BINAURAL_READING hIvasRend->hHrtfs.hSetOfHRTF, #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES hIvasRend->hHrtfs.hHrtfStatistics, -#endif #endif TRUE ) ) != IVAS_ERR_OK ) { @@ -8737,7 +8595,6 @@ void IVAS_REND_Close( ivas_external_orientation_close( &hIvasRend->hExternalOrientationData ); ivas_combined_orientation_close( &hIvasRend->hCombinedOrientationData ); -#ifdef NONBE_FIX_BINARY_BINAURAL_READING /* Fastconv HRTF memories */ ivas_binaural_hrtf_close( &hIvasRend->hHrtfs.hHrtfFastConv ); @@ -8748,7 +8605,6 @@ void IVAS_REND_Close( ivas_HRTF_parambin_binary_close( &( hIvasRend->hHrtfs.hHrtfParambin ) ); #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES ivas_HRTF_statistics_close( &( hIvasRend->hHrtfs.hHrtfStatistics ) ); -#endif #endif free( hIvasRend ); @@ -8904,7 +8760,6 @@ int32_t IVAS_REND_GetCntFramesLimited( #endif -#ifdef NONBE_FIX_BINARY_BINAURAL_READING /*---------------------------------------------------------------------* * IVAS_REND_GetHrtfHandle( ) * @@ -8991,7 +8846,6 @@ ivas_error IVAS_REND_GetHrtfParamBinHandle( return IVAS_ERR_OK; } -#endif #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES /*---------------------------------------------------------------------* @@ -9401,11 +9255,7 @@ static ivas_error ivas_masa_ext_rend_parambin_init( error = IVAS_ERR_OK; -#ifdef NONBE_FIX_BINARY_BINAURAL_READING hHrtfParambin = *( inputMasa->hMasaExtRend->hHrtfParambin ); -#else - hHrtfParambin = inputMasa->hMasaExtRend->hHrtfParambin; -#endif /* Set common variables and defaults */ output_Fs = *( inputMasa->base.ctx.pOutSampleRate ); @@ -9541,15 +9391,11 @@ static ivas_error ivas_masa_ext_rend_parambin_init( static ivas_error initMasaExtRenderer( input_masa *inputMasa, -#ifdef NONBE_FIX_BINARY_BINAURAL_READING const AUDIO_CONFIG outConfig, #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES const RENDER_CONFIG_DATA *hRendCfg, #endif hrtf_handles *hrtfs -#else - const AUDIO_CONFIG outConfig -#endif ) { int16_t i; @@ -9578,11 +9424,7 @@ static ivas_error initMasaExtRenderer( hMasaExtRend->hDiracDecBin = NULL; #endif hMasaExtRend->hReverb = NULL; -#ifdef NONBE_FIX_BINARY_BINAURAL_READING hMasaExtRend->hHrtfParambin = &hrtfs->hHrtfParambin; -#else - hMasaExtRend->hHrtfParambin = NULL; -#endif hMasaExtRend->hVBAPdata = NULL; hMasaExtRend->hoa_dec_mtx = NULL; @@ -9673,11 +9515,7 @@ static ivas_error initMasaExtRenderer( { if ( hMasaExtRend->renderer_type != RENDERER_STEREO_PARAMETRIC ) { -#ifdef NONBE_FIX_BINARY_BINAURAL_READING if ( ( error = ivas_dirac_dec_binaural_copy_hrtfs( inputMasa->hMasaExtRend->hHrtfParambin ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_dirac_dec_binaural_copy_hrtfs( &inputMasa->hMasaExtRend->hHrtfParambin ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -9775,11 +9613,7 @@ static void freeMasaExtRenderer( if ( hMasaExtRend->hHrtfParambin != NULL ) { -#ifdef NONBE_FIX_BINARY_BINAURAL_READING ivas_HRTF_parambin_binary_close( hMasaExtRend->hHrtfParambin ); -#else - ivas_HRTF_parambin_binary_close( &hMasaExtRend->hHrtfParambin ); -#endif } if ( hMasaExtRend->hVBAPdata != NULL ) diff --git a/lib_rend/lib_rend.h b/lib_rend/lib_rend.h index 1a4a6abc08..ff5536299e 100644 --- a/lib_rend/lib_rend.h +++ b/lib_rend/lib_rend.h @@ -128,9 +128,7 @@ ivas_error IVAS_REND_Open( IVAS_REND_HANDLE *phIvasRend, /* i/o: Pointer to renderer handle */ const int32_t outputSampleRate, /* i : output sampling rate */ const IVAS_AUDIO_CONFIG outConfig, /* i : output audio config */ -#ifdef NONBE_FIX_BINARY_BINAURAL_READING const bool asHrtfBinary, /* i : load hrtf binary file */ -#endif const int16_t nonDiegeticPan, /* i : non-diegetic object flag */ const float nonDiegeticPanGain, /* i : non-diegetic panning gain */ const int16_t num_subframes /* i : number of subframes */ @@ -200,7 +198,6 @@ ivas_error IVAS_REND_GetDelay( int32_t *timeScale /* o : Time scale of the delay, equal to renderer output sampling rate */ ); -#ifdef NONBE_FIX_BINARY_BINAURAL_READING /*! r: error code */ ivas_error IVAS_REND_GetHrtfHandle( IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS render handle */ @@ -229,7 +226,6 @@ ivas_error IVAS_REND_GetHrtfStatisticsHandle( IVAS_DEC_HRTF_STATISTICS_HANDLE **hHrtfStatistics /* o : HRTF statistics handle */ ); #endif -#endif /* Functions to be called during rendering */ diff --git a/lib_util/hrtf_file_reader.c b/lib_util/hrtf_file_reader.c index 206ca9019b..eeb91167f2 100644 --- a/lib_util/hrtf_file_reader.c +++ b/lib_util/hrtf_file_reader.c @@ -679,11 +679,7 @@ static ivas_error load_reverb_from_binary( return header_check_result; } #endif -#ifdef NONBE_FIX_BINARY_BINAURAL_READING return IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA; -#else - return IVAS_ERR_FAILED_FILE_READ; -#endif } return IVAS_ERR_OK; @@ -727,9 +723,6 @@ static ivas_error TDREND_MIX_LoadHRTF( ) { int16_t tmp; -#ifndef NONBE_FIX_BINARY_BINAURAL_READING - ivas_error error; -#endif bool is_tdrend; ivas_error header_check_result; ivas_hrtfs_file_header_t hrtfs_file_header; @@ -738,15 +731,10 @@ static ivas_error TDREND_MIX_LoadHRTF( int32_t hrtf_data_size_max; char *hrtf_data; -#ifdef NONBE_FIX_BINARY_BINAURAL_READING header_check_result = IVAS_ERR_OK; -#else - error = IVAS_ERR_OK; -#endif if ( ( header_check_result = read_and_check_hrtf_binary_file_header( &hrtfs_file_header, f_hrtf ) ) != IVAS_ERR_OK ) { -#ifdef NONBE_FIX_BINARY_BINAURAL_READING /* try if it is old format for BE tests*/ fseek( f_hrtf, 0, SEEK_SET ); @@ -767,7 +755,6 @@ static ivas_error TDREND_MIX_LoadHRTF( } return header_check_result; -#endif } is_tdrend = FALSE; @@ -821,34 +808,18 @@ static ivas_error TDREND_MIX_LoadHRTF( if ( HrFiltSet_p->FilterMethod != TDREND_HRFILT_Method_BSplineModel ) { -#ifdef NONBE_FIX_BINARY_BINAURAL_READING header_check_result = IVAS_ERROR( IVAS_ERR_INVALID_HRTF, "The HR filter set file is not a supported type." ); -#else - error = IVAS_ERROR( IVAS_ERR_INVALID_HRTF, "The HR filter set file is not a supported type." ); -#endif } else { -#ifdef NONBE_FIX_BINARY_BINAURAL_READING header_check_result = LoadBSplineBinary( HrFiltSet_p, f_hrtf ); -#else - error = LoadBSplineBinary( HrFiltSet_p, f_hrtf ); -#endif } } else { -#ifdef NONBE_FIX_BINARY_BINAURAL_READING return IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA; -#else - return IVAS_ERROR( IVAS_ERR_INVALID_HRTF, "HR filter not found in binary file." ); -#endif } -#ifdef NONBE_FIX_BINARY_BINAURAL_READING return header_check_result; -#else - return error; -#endif } @@ -931,7 +902,6 @@ static void HRTF_energy_sections_precalc( } -#ifdef NONBE_FIX_BINARY_BINAURAL_READING /*---------------------------------------------------------------------* * destroy_td_hrtf() * @@ -1002,76 +972,6 @@ void destroy_td_hrtf( return; } -#else -/*---------------------------------------------------------------------* - * dealloc_HRTF_binary() - * - * Deallocated memory allocated by load_HRTF_binary - *---------------------------------------------------------------------*/ - -ivas_error dealloc_HRTF_binary( - IVAS_DEC_HRTF_HANDLE hHrtf /* i/o: HRTF handle */ -) -{ - int16_t i; - ivas_error error; - error = IVAS_ERR_OK; - - if ( hHrtf == NULL ) - { - return error; - } - - if ( !hHrtf->ModelParams.modelROM ) - { - if ( hHrtf->ModelParams.UseItdModel ) - { - free( hHrtf->ModelParamsITD.elevKSeq_dyn ); - free( hHrtf->ModelParamsITD.azimKSeq_dyn ); - free( hHrtf->ModelParamsITD.W_dyn ); - free( hHrtf->ModelParamsITD.azimBsShape_dyn ); - free( hHrtf->ModelParamsITD.elevBsShape_dyn ); - } - free( hHrtf->ModelParams.elevKSeq_dyn ); - free( hHrtf->ModelParams.azim_start_idx_dyn ); - free( hHrtf->ModelParams.azimDim2_dyn ); - free( hHrtf->ModelParams.azimDim3_dyn ); - free( hHrtf->ModelParams.AlphaL_dyn ); - free( hHrtf->ModelParams.AlphaR_dyn ); - free( hHrtf->ModelParams.azimSegSamples_dyn ); - - free( hHrtf->ModelParams.azimShapeIdx_dyn ); - free( hHrtf->ModelParams.azimShapeSampFactor_dyn ); - free( hHrtf->ModelParams.elevBsShape_dyn ); - - for ( i = 0; i < hHrtf->ModelParams.num_unique_azim_splines; i++ ) - { - free( hHrtf->ModelParams.azimBsShape_dyn[i] ); - free( &hHrtf->ModelParams.azimBsShape_dyn[i] ); - } - - free( (void *) hHrtf->ModelParams.azimBsShape ); /* void* cast needed to please both gcc and Visual studio compilers. Deallocating const float** should be fine and gcc agrees, but Visual studio complains. */ - for ( i = 0; i < hHrtf->ModelParams.elevDim3; i++ ) - { - free( hHrtf->ModelParams.azimKSeq[i] ); - } - free( hHrtf->ModelParams.azimKSeq ); - - free( hHrtf->ModelParams.EL_dyn ); - free( hHrtf->ModelParams.ER_dyn ); - - free( hHrtf->ModelEval.hrfModL ); - free( hHrtf->ModelEval.hrfModR ); - - for ( i = 0; i < 3; i++ ) - { - free( hHrtf->lr_energy_and_iac_dyn[i] ); - } - } - - return error; -} -#endif /*---------------------------------------------------------------------* @@ -1097,11 +997,7 @@ static ivas_error create_HRTF_from_rawdata( { if ( ( ( *hHRTF ) = (HRTFS_HANDLE) malloc( sizeof( HRTFS_DATA ) ) ) == NULL ) { -#ifdef NONBE_FIX_BINARY_BINAURAL_READING return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for HRTF binary data\n" ); -#else - return IVAS_ERROR( IVAS_ERR_UNEXPECTED_NULL_POINTER, "Can not allocate memory for HRTF binary data\n" ); -#endif } if ( ( error = ivas_hrtf_init( *hHRTF ) ) != IVAS_ERR_OK ) @@ -1114,9 +1010,7 @@ static ivas_error create_HRTF_from_rawdata( return IVAS_ERR_INTERNAL; } -#ifdef NONBE_FIX_BINARY_BINAURAL_READING ( *hHRTF )->init_from_rom = 0; -#endif hrtf_data_rptr = hrtf_data; /* latency_s */ @@ -1346,28 +1240,17 @@ static ivas_error create_fastconv_HRTF_from_rawdata( hrtf_data_rptr = hrtf_data; -#ifndef NONBE_FIX_BINARY_BINAURAL_READING - /* BINAURAL_CONVBANDS */ - if ( BINAURAL_CONVBANDS != *( (uint16_t *) ( hrtf_data_rptr ) ) ) - { - return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "HRTF binary file not compliant (BINAURAL_CONVBANDS)" ); - } - hrtf_data_rptr += sizeof( uint16_t ); - -#endif /* HRIR */ if ( rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV && input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_COMBINED ) { ( *hHRTF )->FASTCONV_HRIR_latency_s = *( (float *) ( hrtf_data_rptr ) ); hrtf_data_rptr += sizeof( float ); -#ifdef NONBE_FIX_BINARY_BINAURAL_READING if ( BINAURAL_CONVBANDS != *( (uint16_t *) ( hrtf_data_rptr ) ) ) { return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "HRTF binary file not compliant (BINAURAL_CONVBANDS)" ); } hrtf_data_rptr += sizeof( uint16_t ); -#endif if ( HRTF_LS_CHANNELS != *( (uint16_t *) ( hrtf_data_rptr ) ) ) { @@ -1420,13 +1303,11 @@ static ivas_error create_fastconv_HRTF_from_rawdata( ( *hHRTF )->FASTCONV_HOA3_latency_s = *( (float *) ( hrtf_data_rptr ) ); hrtf_data_rptr += sizeof( float ); -#ifdef NONBE_FIX_BINARY_BINAURAL_READING if ( BINAURAL_CONVBANDS != *( (uint16_t *) ( hrtf_data_rptr ) ) ) { return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "HRTF binary file not compliant (BINAURAL_CONVBANDS)" ); } hrtf_data_rptr += sizeof( uint16_t ); -#endif if ( HOA3_CHANNELS != *( (uint16_t *) ( hrtf_data_rptr ) ) ) { @@ -1478,13 +1359,11 @@ static ivas_error create_fastconv_HRTF_from_rawdata( ( *hHRTF )->FASTCONV_HOA2_latency_s = *( (float *) ( hrtf_data_rptr ) ); hrtf_data_rptr += sizeof( float ); -#ifdef NONBE_FIX_BINARY_BINAURAL_READING if ( BINAURAL_CONVBANDS != *( (uint16_t *) ( hrtf_data_rptr ) ) ) { return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "HRTF binary file not compliant (BINAURAL_CONVBANDS)" ); } hrtf_data_rptr += sizeof( uint16_t ); -#endif if ( HOA2_CHANNELS != *( (uint16_t *) ( hrtf_data_rptr ) ) ) { @@ -1537,13 +1416,11 @@ static ivas_error create_fastconv_HRTF_from_rawdata( ( *hHRTF )->FASTCONV_FOA_latency_s = *( (float *) ( hrtf_data_rptr ) ); hrtf_data_rptr += sizeof( float ); -#ifdef NONBE_FIX_BINARY_BINAURAL_READING if ( BINAURAL_CONVBANDS != *( (uint16_t *) ( hrtf_data_rptr ) ) ) { return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "HRTF binary file not compliant (BINAURAL_CONVBANDS)" ); } hrtf_data_rptr += sizeof( uint16_t ); -#endif if ( FOA_CHANNELS != *( (uint16_t *) ( hrtf_data_rptr ) ) ) { @@ -1596,13 +1473,11 @@ static ivas_error create_fastconv_HRTF_from_rawdata( ( *hHRTF )->FASTCONV_BRIR_latency_s = *( (float *) ( hrtf_data_rptr ) ); hrtf_data_rptr += sizeof( float ); -#ifdef NONBE_FIX_BINARY_BINAURAL_READING if ( BINAURAL_CONVBANDS != *( (uint16_t *) ( hrtf_data_rptr ) ) ) { return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "HRTF binary file not compliant (BINAURAL_CONVBANDS)" ); } hrtf_data_rptr += sizeof( uint16_t ); -#endif if ( HRTF_LS_CHANNELS != *( (uint16_t *) ( hrtf_data_rptr ) ) ) { @@ -1685,9 +1560,7 @@ ivas_error load_fastconv_HRTF_from_binary( ivas_error header_check_result; ivas_hrtfs_file_header_t hrtfs_file_header; int16_t hrtf_id; -#ifdef NONBE_FIX_BINARY_BINAURAL_READING int16_t asFastconv = 0; -#endif f_hrtf = hrtfReader->file; @@ -1735,9 +1608,7 @@ ivas_error load_fastconv_HRTF_from_binary( return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Could not create HRTF from binary file" ); } -#ifdef NONBE_FIX_BINARY_BINAURAL_READING asFastconv = 1; -#endif } else { @@ -1746,7 +1617,6 @@ ivas_error load_fastconv_HRTF_from_binary( } free( hrtf_data ); -#ifdef NONBE_FIX_BINARY_BINAURAL_READING if ( asFastconv ) { return IVAS_ERR_OK; @@ -1755,9 +1625,6 @@ ivas_error load_fastconv_HRTF_from_binary( { return IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA; } -#else - return IVAS_ERR_OK; -#endif } @@ -1849,9 +1716,7 @@ ivas_error load_parambin_HRTF_from_binary( ivas_error header_check_result; ivas_hrtfs_file_header_t hrtfs_file_header; int16_t hrtf_id; -#ifdef NONBE_FIX_BINARY_BINAURAL_READING int16_t asParam = 0; -#endif f_hrtf = hrtfReader->file; @@ -1901,9 +1766,7 @@ ivas_error load_parambin_HRTF_from_binary( return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Could not create HRTF from binary file" ); } -#ifdef NONBE_FIX_BINARY_BINAURAL_READING asParam = 1; -#endif } else { @@ -1912,7 +1775,6 @@ ivas_error load_parambin_HRTF_from_binary( } free( hrtf_data ); -#ifdef NONBE_FIX_BINARY_BINAURAL_READING if ( asParam ) { return IVAS_ERR_OK; @@ -1921,9 +1783,6 @@ ivas_error load_parambin_HRTF_from_binary( { return IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA; } -#else - return IVAS_ERR_OK; -#endif } @@ -2030,15 +1889,6 @@ ivas_error create_SetOfHRTF_from_binary( } free( hrtf_data ); -#ifndef NONBE_FIX_BINARY_BINAURAL_READING - if ( ( ( *hSetOfHRTF ).hHRTF_hrir_combined == NULL ) || ( ( *hSetOfHRTF ).hHRTF_brir_combined == NULL ) || ( ( *hSetOfHRTF ).hHRTF_hrir_foa == NULL ) || ( ( *hSetOfHRTF ).hHRTF_hrir_hoa2 == NULL ) || ( ( *hSetOfHRTF ).hHRTF_hrir_hoa3 == NULL ) ) - { - if ( destroy_SetOfHRTF( hSetOfHRTF ) != IVAS_ERR_OK ) - { - return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Could not create all the HRTF from binary file" ); - } - } -#endif return IVAS_ERR_OK; } @@ -2050,21 +1900,13 @@ ivas_error create_SetOfHRTF_from_binary( * Destroy the HRTF CRend handle *---------------------------------------------------------------------*/ -#ifdef NONBE_FIX_BINARY_BINAURAL_READING static void destroy_HRTF( -#else -static ivas_error destroy_HRTF( -#endif HRTFS_HANDLE *hHRTF /* i/o: HRTF CRend handle */ ) { uint16_t i, j; -#ifdef NONBE_FIX_BINARY_BINAURAL_READING if ( *hHRTF != NULL && hHRTF != NULL && ( *hHRTF )->init_from_rom == 0 ) -#else - if ( *hHRTF != NULL && hHRTF != NULL ) -#endif { for ( i = 0; i < MAX_INTERN_CHANNELS; i++ ) { @@ -2104,15 +1946,10 @@ static ivas_error destroy_HRTF( *hHRTF = NULL; } -#ifdef NONBE_FIX_BINARY_BINAURAL_READING return; -#else - return IVAS_ERR_OK; -#endif } -#ifdef NONBE_FIX_BINARY_BINAURAL_READING /*---------------------------------------------------------------------* * destroy_SetOfHRTF() * @@ -2171,23 +2008,6 @@ void destroy_parambin_hrtf( return; } -#else -ivas_error destroy_SetOfHRTF( - HRTFS_CREND_HANDLE hSetOfHRTF /* i/o: Set of HRTF CRend handle */ -) -{ - if ( hSetOfHRTF != NULL ) - { - destroy_HRTF( &( hSetOfHRTF->hHRTF_hrir_combined ) ); - destroy_HRTF( &( hSetOfHRTF->hHRTF_hrir_hoa3 ) ); - destroy_HRTF( &( hSetOfHRTF->hHRTF_hrir_hoa2 ) ); - destroy_HRTF( &( hSetOfHRTF->hHRTF_hrir_foa ) ); - destroy_HRTF( &( hSetOfHRTF->hHRTF_brir_combined ) ); - } - - return IVAS_ERR_OK; -} -#endif #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES /*---------------------------------------------------------------------* * destroy_hrtf_statistics() diff --git a/lib_util/hrtf_file_reader.h b/lib_util/hrtf_file_reader.h index 3416c5b7d1..0048def686 100644 --- a/lib_util/hrtf_file_reader.h +++ b/lib_util/hrtf_file_reader.h @@ -124,15 +124,9 @@ ivas_error create_SetOfHRTF_from_binary( * Destroy the HRTF data set. *---------------------------------------------------------------------*/ -#ifdef NONBE_FIX_BINARY_BINAURAL_READING void destroy_SetOfHRTF( IVAS_DEC_HRTF_CREND_HANDLE *hSetOfHRTF /* i/o: Set of HRTF CRend handle */ ); -#else -ivas_error destroy_SetOfHRTF( - IVAS_DEC_HRTF_CREND_HANDLE hSetOfHRTF /* i/o: Set of HRTF CRend handle */ -); -#endif /*---------------------------------------------------------------------* @@ -146,7 +140,6 @@ ivas_error load_fastconv_HRTF_from_binary( const hrtfFileReader *hrtfReader /* i : pointer to hrtfFileReader handle */ ); -#ifdef NONBE_FIX_BINARY_BINAURAL_READING /*---------------------------------------------------------------------* * destroy_fastconv_hrtf() * @@ -156,7 +149,6 @@ ivas_error load_fastconv_HRTF_from_binary( void destroy_fastconv_hrtf( IVAS_DEC_HRTF_FASTCONV_HANDLE *hHrtfFastConv /* i/o: FastConv HRTF handle */ ); -#endif /*---------------------------------------------------------------------* * load_parambin_HRTF_from_binary() @@ -170,7 +162,6 @@ ivas_error load_parambin_HRTF_from_binary( ); -#ifdef NONBE_FIX_BINARY_BINAURAL_READING /*---------------------------------------------------------------------* * destroy_parambin_hrtf() * @@ -203,16 +194,4 @@ ivas_error destroy_hrtf_statistics( ); #endif -#else -/*---------------------------------------------------------------------* - * dealloc_HRTF_binary() - * - * Deallocated memory allocated by load_HRTF_binary - *---------------------------------------------------------------------*/ - -ivas_error dealloc_HRTF_binary( - IVAS_DEC_HRTF_HANDLE hHrtf /* i/o: HRTF handle */ -); - -#endif #endif /* IVAS_HRTF_FILE_READER_H */ -- GitLab From a9cd220d158de1fcd6a46f509eec2c845a95b468 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 7 Feb 2024 21:00:41 +0100 Subject: [PATCH 09/16] [cleanup] accept NONBE_FIX_AVG_IAC_CLDFB_REVERB --- lib_com/ivas_cnst.h | 4 - lib_com/options.h | 1 - lib_rend/ivas_reverb_filter_design.c | 4 - lib_util/hrtf_file_reader.c | 26 ------ .../generate_crend_ivas_tables_from_sofa.c | 79 ------------------- 5 files changed, 114 deletions(-) diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index 38e9518e61..cfd26f7725 100755 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -1663,15 +1663,11 @@ typedef enum #define RV_FILTER_MAX_FFT_SIZE ( 512 ) #define RV_FILTER_MAX_HISTORY ( 512 - 160 ) /* for longest history */ #define RV_LENGTH_NR_FC ( RV_FILTER_MAX_FFT_SIZE / 2 ) + 1 -#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB #define RV_LENGTH_NR_FC_16KHZ ( RV_FILTER_MAX_FFT_SIZE / 4 ) + 1 -#endif #define IVAS_REVERB_DEFAULT_N_BANDS 31 #define LR_IAC_LENGTH_NR_FC ( RV_LENGTH_NR_FC ) -#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB #define LR_IAC_LENGTH_NR_FC_16KHZ ( RV_LENGTH_NR_FC_16KHZ ) -#endif /*----------------------------------------------------------------------------------* diff --git a/lib_com/options.h b/lib_com/options.h index 037cea8e5b..00be7fb6bf 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -160,7 +160,6 @@ /* any switch which is non-be wrt selection floating point code */ /* all switches in this category should start with "NONBE_" */ -#define NONBE_FIX_AVG_IAC_CLDFB_REVERB /* Orange: Add computation avg energy and iac tables for rom and binaural binary file */ #define NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES /* Philips: Use pre-computed HRTF average L/R energies and IAC in all renderers */ #define NONBE_FIX_935_EARLY_REFLECTIONS_WRONG_ORDER /* Qualcomm: issue 953: fix order or ER channels in LC mode*/ #define NONBE_FIX_935_SBA_REVERB /* FhG: issue 935: fix MSAN error for SBA related to BINAURAL_ROOM_REVERB */ diff --git a/lib_rend/ivas_reverb_filter_design.c b/lib_rend/ivas_reverb_filter_design.c index e90efe1307..20d9502c2e 100644 --- a/lib_rend/ivas_reverb_filter_design.c +++ b/lib_rend/ivas_reverb_filter_design.c @@ -714,14 +714,12 @@ void ivas_reverb_get_hrtf_set_properties( const float norm_freq = out_freq_step * out_bin_idx; /* Computing the bin index in the source data */ -#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB if ( in_freq_count == out_freq_count ) { base_idx = out_bin_idx; } else { -#endif const float tbl_index = ( norm_freq - inp_freq_offset ) / inp_freq_step; if ( tbl_index <= 0.0f ) /* In case of extrapolation (below 1st bin), choose nearest */ @@ -739,9 +737,7 @@ void ivas_reverb_get_hrtf_set_properties( relative_pos = 1.0f; } } -#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB } -#endif /* Computing 2 bins data for later interpolation */ diff --git a/lib_util/hrtf_file_reader.c b/lib_util/hrtf_file_reader.c index eeb91167f2..3eca568142 100644 --- a/lib_util/hrtf_file_reader.c +++ b/lib_util/hrtf_file_reader.c @@ -448,32 +448,24 @@ static ivas_error set_default_reverb_iac_energy( ) { int16_t i; -#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB int16_t lr_iac_len; -#endif if ( HrFiltSet_p == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; } -#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB lr_iac_len = LR_IAC_LENGTH_NR_FC; if ( HrFiltSet_p->SampleRate == 16000 ) { lr_iac_len = LR_IAC_LENGTH_NR_FC_16KHZ; } -#endif if ( HrFiltSet_p->ModelParams.modelROM == 0 ) { for ( i = 0; i < 3; i++ ) { -#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB HrFiltSet_p->lr_energy_and_iac_dyn[i] = (float *) malloc( lr_iac_len * sizeof( float ) ); -#else - HrFiltSet_p->lr_energy_and_iac_dyn[i] = (float *) malloc( LR_IAC_LENGTH_NR_FC * sizeof( float ) ); -#endif if ( HrFiltSet_p->lr_energy_and_iac_dyn[i] == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for hrtf data" ); @@ -492,15 +484,9 @@ static ivas_error set_default_reverb_iac_energy( mvr2r( defaultHRIR_coherence_32kHz, HrFiltSet_p->lr_energy_and_iac_dyn[2], LR_IAC_LENGTH_NR_FC ); break; case 16000: -#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB mvr2r( defaultHRIR_left_avg_power_16kHz, HrFiltSet_p->lr_energy_and_iac_dyn[0], lr_iac_len ); mvr2r( defaultHRIR_right_avg_power_16kHz, HrFiltSet_p->lr_energy_and_iac_dyn[1], lr_iac_len ); mvr2r( defaultHRIR_coherence_16kHz, HrFiltSet_p->lr_energy_and_iac_dyn[2], lr_iac_len ); -#else - mvr2r( defaultHRIR_left_avg_power_16kHz, HrFiltSet_p->lr_energy_and_iac_dyn[0], LR_IAC_LENGTH_NR_FC ); - mvr2r( defaultHRIR_right_avg_power_16kHz, HrFiltSet_p->lr_energy_and_iac_dyn[1], LR_IAC_LENGTH_NR_FC ); - mvr2r( defaultHRIR_coherence_16kHz, HrFiltSet_p->lr_energy_and_iac_dyn[2], LR_IAC_LENGTH_NR_FC ); -#endif break; } } @@ -557,7 +543,6 @@ static ivas_error load_reverb_from_binary( ivas_hrtfs_header_t hrtf_header; int32_t hrtf_data_size_max; char *hrtf_data; -#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB int16_t lr_iac_len; #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES @@ -578,7 +563,6 @@ static ivas_error load_reverb_from_binary( { lr_iac_len = LR_IAC_LENGTH_NR_FC_16KHZ; } -#endif header_check_result = IVAS_ERR_OK; @@ -650,7 +634,6 @@ static ivas_error load_reverb_from_binary( /* left/right energy and interaural coherence for late reverb */ for ( i = 0; i < 3; i++ ) { -#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB HrFiltSet_p->lr_energy_and_iac_dyn[i] = (float *) malloc( lr_iac_len * sizeof( float ) ); if ( HrFiltSet_p->lr_energy_and_iac_dyn[i] == NULL ) { @@ -658,15 +641,6 @@ static ivas_error load_reverb_from_binary( } fread( HrFiltSet_p->lr_energy_and_iac_dyn[i], sizeof( const float ), lr_iac_len, f_hrtf ); HrFiltSet_p->lr_energy_and_iac[i] = (const float *) HrFiltSet_p->lr_energy_and_iac_dyn[i]; -#else - HrFiltSet_p->lr_energy_and_iac_dyn[i] = (float *) malloc( LR_IAC_LENGTH_NR_FC * sizeof( float ) ); - if ( HrFiltSet_p->lr_energy_and_iac_dyn[i] == NULL ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for hrtf data" ); - } - fread( HrFiltSet_p->lr_energy_and_iac_dyn[i], sizeof( const float ), LR_IAC_LENGTH_NR_FC, f_hrtf ); - HrFiltSet_p->lr_energy_and_iac[i] = (const float *) HrFiltSet_p->lr_energy_and_iac_dyn[i]; -#endif } #endif } diff --git a/scripts/binauralRenderer_interface/generate_crend_ivas_tables_from_sofa.c b/scripts/binauralRenderer_interface/generate_crend_ivas_tables_from_sofa.c index eb7a473fbf..2c76002b63 100644 --- a/scripts/binauralRenderer_interface/generate_crend_ivas_tables_from_sofa.c +++ b/scripts/binauralRenderer_interface/generate_crend_ivas_tables_from_sofa.c @@ -1316,7 +1316,6 @@ int generate_crend_ivas_tables_from_sofa( const char *file_path, ConfigReader *c } -#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB #define IVAS_REVERB_FFT_SIZE_48K ( 512 ) #define IVAS_REVERB_FFT_SIZE_32K ( 512 ) @@ -1351,7 +1350,6 @@ static uint16_t get_fft_size( return 0; } -#endif /*-------------------------------------------------------------------* * ivas_reverb_get_hrtf_set_properties() @@ -1412,14 +1410,12 @@ void ivas_reverb_get_hrtf_set_properties( const float norm_freq = out_freq_step * out_bin_idx; /* Computing the bin index in the source data */ -#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB if ( in_freq_count == out_freq_count ) { base_idx = out_bin_idx; } else { -#endif const float tbl_index = ( norm_freq - inp_freq_offset ) / inp_freq_step; if ( tbl_index <= 0.0f ) /* In case of extrapolation (below 1st bin), choose nearest */ @@ -1437,9 +1433,7 @@ void ivas_reverb_get_hrtf_set_properties( relative_pos = 1.0f; } } -#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB } -#endif /* Computing 2 bins data for later interpolation */ /* Zeroing before accumalation for average value computing */ @@ -1744,9 +1738,7 @@ int generate_reverb_ivas_tables_from_sofa( const char *file_path ) if ( frame_len_ms == 5 ) frame_len = frame_len >> 2; -#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB frame_len = get_fft_size( frame_len ); -#endif data_IR_current = sofa_data_IR_val_48k; sofa_N = sofa_N_48k; @@ -1788,7 +1780,6 @@ int generate_reverb_ivas_tables_from_sofa( const char *file_path ) float **pHrtf_set_r_im = NULL; float *pTemp = NULL; int16_t nr_fc_fft_filter = LR_IAC_LENGTH_NR_FC; -#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB nr_fc_fft_filter = ( frame_len >> 1 ) + 1; float *p_avg_lr = NULL; float *pCoherence = NULL; @@ -1796,10 +1787,6 @@ int generate_reverb_ivas_tables_from_sofa( const char *file_path ) pCoherence = (float *) malloc( sizeof( float * ) * nr_fc_fft_filter ); memset( p_avg_lr, 0, sizeof( float ) * nr_fc_fft_filter * 2 ); memset( pCoherence, 0, sizeof( float ) * nr_fc_fft_filter ); -#else - float p_avg_lr[LR_IAC_LENGTH_NR_FC * 2] = { 0 }; - float pCoherence[LR_IAC_LENGTH_NR_FC] = { 0 }; -#endif pHrtf_set_l_re = (float **) malloc( sizeof( float * ) * sofa_M ); pHrtf_set_l_im = (float **) malloc( sizeof( float * ) * sofa_M ); @@ -1818,14 +1805,10 @@ int generate_reverb_ivas_tables_from_sofa( const char *file_path ) { pTemp[n] = (float) ( data_IR_current[size * i + n] * (double) mdft_scale_fact ); } -#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB memcpy( pHrtf_set_l_re[i], pTemp, frame_len ); memset( pHrtf_set_l_im[i], 0, frame_len ); DoRTFTn( pHrtf_set_l_re[i], pHrtf_set_l_im[i], frame_len ); -#else - ivas_mdft( pTemp, pHrtf_set_l_re[i], pHrtf_set_l_im[i], frame_len, frame_len ); -#endif pHrtf_set_r_re[i] = (float *) malloc( sizeof( float ) * ( frame_len ) ); memset( pHrtf_set_r_re[i], 0, sizeof( float ) * frame_len ); @@ -1836,22 +1819,14 @@ int generate_reverb_ivas_tables_from_sofa( const char *file_path ) { pTemp[n] = (float) ( data_IR_current[size * i + sofa_N + n] * (double) mdft_scale_fact ); } -#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB memcpy( pHrtf_set_r_re[i], pTemp, frame_len ); memset( pHrtf_set_r_im[i], 0, frame_len ); DoRTFTn( pHrtf_set_r_re[i], pHrtf_set_r_im[i], frame_len ); -#else - ivas_mdft( pTemp, pHrtf_set_r_re[i], pHrtf_set_r_im[i], frame_len, frame_len ); -#endif } -#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB ivas_reverb_get_hrtf_set_properties( pHrtf_set_l_re, pHrtf_set_l_im, pHrtf_set_r_re, pHrtf_set_r_im, IVAS_AUDIO_CONFIG_5_1, sofa_M, nr_fc_fft_filter, nr_fc_fft_filter, p_avg_lr, &p_avg_lr[nr_fc_fft_filter], pCoherence ); -#else - ivas_reverb_get_hrtf_set_properties( pHrtf_set_l_re, pHrtf_set_l_im, pHrtf_set_r_re, pHrtf_set_r_im, IVAS_AUDIO_CONFIG_5_1, sofa_M, frame_len, nr_fc_fft_filter, p_avg_lr, &p_avg_lr[nr_fc_fft_filter], pCoherence ); -#endif update_h_file_with_reverb( sample_rates[indSR] ); update_c_file_with_reverb( p_avg_lr, &p_avg_lr[nr_fc_fft_filter], pCoherence, sample_rates[indSR], nr_fc_fft_filter ); @@ -1889,7 +1864,6 @@ int generate_reverb_ivas_tables_from_sofa( const char *file_path ) free( pTemp ); pTemp = NULL; } -#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB if ( pCoherence ) { free( pCoherence ); @@ -1900,7 +1874,6 @@ int generate_reverb_ivas_tables_from_sofa( const char *file_path ) free( p_avg_lr ); p_avg_lr = NULL; } -#endif } /* close the file */ @@ -2021,13 +1994,11 @@ void write_array_uint16_to_file( FILE *fp, uint16_t *vec, int32_t size_vec, int3 *---------------------------------------------------------------------*/ void update_c_file_with_reverb( float *pEner_l, float *pEner_r, float *pCoherence, const int32_t samplerate, const int16_t len ) { -#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB char len_str[26] = "LR_IAC_LENGTH_NR_FC"; if ( samplerate == 16000 ) { strcpy( len_str, "LR_IAC_LENGTH_NR_FC_16KHZ" ); } -#endif if ( c_file_path == NULL ) return; @@ -2055,29 +2026,17 @@ void update_c_file_with_reverb( float *pEner_l, float *pEner_r, float *pCoherenc fprintf( fp, "\n/* Sample Rate = %ld */\n", (long) samplerate ); /* float *defaultHRIR_right_avg_power_[LR_IAC_LENGTH_NR_FC];*/ -#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB fprintf( fp, "\nconst float defaultHRIR_coherence_%dkHz[%s] = \n", samplerate / 1000, len_str ); -#else - fprintf( fp, "\nconst float defaultHRIR_coherence_%dkHz[LR_IAC_LENGTH_NR_FC] = \n", samplerate / 1000 ); -#endif write_array_float_to_file( fp, pCoherence, len, NUM_SAMPLES_PER_LINES_REVERB, FORMAT_FLOAT, 2, TAB_WITH_SPACE_OR_NOT ); fprintf( fp, ";\n" ); /* float *defaultHRIR_left_avg_power_[LR_IAC_LENGTH_NR_FC];*/ -#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB fprintf( fp, "\nconst float defaultHRIR_left_avg_power_%dkHz[%s] = \n", samplerate / 1000, len_str ); -#else - fprintf( fp, "\nconst float defaultHRIR_left_avg_power_%dkHz[LR_IAC_LENGTH_NR_FC] = \n", samplerate / 1000 ); -#endif write_array_float_to_file( fp, pEner_l, len, NUM_SAMPLES_PER_LINES_REVERB, FORMAT_FLOAT, 2, TAB_WITH_SPACE_OR_NOT ); fprintf( fp, ";\n" ); /* float *defaultHRIR_right_avg_power_[LR_IAC_LENGTH_NR_FC];*/ -#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB fprintf( fp, "\nconst float defaultHRIR_right_avg_power_%dkHz[%s] = \n", samplerate / 1000, len_str ); -#else - fprintf( fp, "\nconst float defaultHRIR_right_avg_power_%dkHz[LR_IAC_LENGTH_NR_FC] = \n", samplerate / 1000 ); -#endif write_array_float_to_file( fp, pEner_r, len, NUM_SAMPLES_PER_LINES_REVERB, FORMAT_FLOAT, 2, TAB_WITH_SPACE_OR_NOT ); fprintf( fp, ";\n" ); @@ -2308,13 +2267,11 @@ void update_c_file( HRTFS_DATA *hrtf, struct ivas_layout_config lscfg, const int *---------------------------------------------------------------------*/ void update_h_file_with_reverb( int32_t samplerate ) { -#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB char len_str[26] = "LR_IAC_LENGTH_NR_FC"; if ( samplerate == 16000 ) { strcpy( len_str, "LR_IAC_LENGTH_NR_FC_16KHZ" ); } -#endif if ( h_file_path == NULL ) return; @@ -2334,22 +2291,10 @@ void update_h_file_with_reverb( int32_t samplerate ) fprintf( fp, "\n/* Sample Rate = %ld */\n", (long) samplerate ); /* float *defaultHRIR_coherence_[MAX_INTERN_CHANNELS][BINAURAL_CHANNELS];*/ -#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB fprintf( fp, "\nextern float defaultHRIR_coherence_%dkHz[%s];", samplerate / 1000, len_str ); -#else - fprintf( fp, "\nextern float defaultHRIR_coherence_%dkHz[LR_IAC_LENGTH_NR_FC];", samplerate / 1000 ); -#endif /* float *defaultHRIR_left_avg_power[MAX_INTERN_CHANNELS][BINAURAL_CHANNELS];*/ -#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB fprintf( fp, "\nextern float defaultHRIR_left_avg_power_%dkHz[%s];", samplerate / 1000, len_str ); -#else - fprintf( fp, "\nextern float defaultHRIR_left_avg_power_%dkHz[LR_IAC_LENGTH_NR_FC];", samplerate / 1000 ); -#endif /* float *defaultHRIR_right_avg_power[MAX_INTERN_CHANNELS][BINAURAL_CHANNELS];*/ -#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB fprintf( fp, "\nextern float defaultHRIR_right_avg_power_%dkHz[%s];", samplerate / 1000, len_str ); -#else - fprintf( fp, "\nextern float defaultHRIR_right_avg_power_%dkHz[LR_IAC_LENGTH_NR_FC];", samplerate / 1000 ); -#endif if ( samplerate == LAST_SAMPLERATE ) { @@ -2869,13 +2814,11 @@ void write_reverb_to_binary_file( float *pEner_l, float *pEner_r, float *pCohere char *binary_file_full_path = NULL; -#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB int16_t len = LR_IAC_LENGTH_NR_FC; if ( samplerate == 16000 ) { len = LR_IAC_LENGTH_NR_FC_16KHZ; } -#endif if ( pEner_l == NULL ) return; @@ -2890,53 +2833,31 @@ void write_reverb_to_binary_file( float *pEner_l, float *pEner_r, float *pCohere return; hrtf_bin = NULL; -#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB hrtf_data_size = sizeof( float ) * 3 * len; -#else - hrtf_data_size = sizeof( float ) * 3 * LR_IAC_LENGTH_NR_FC; -#endif hrtf_bin = (char *) malloc( hrtf_data_size ); if ( hrtf_bin == NULL ) return; memset( hrtf_bin, 0x00, hrtf_data_size ); hrtf_bin_wptr = hrtf_bin; -#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB for ( iTap = 0; iTap < len; iTap++ ) -#else - for ( iTap = 0; iTap < LR_IAC_LENGTH_NR_FC; iTap++ ) -#endif { sprintf( tmpStr, FORMAT_FLOAT, pEner_l[iTap] ); sscanf( tmpStr, "%f", &( ( (float *) hrtf_bin_wptr )[iTap] ) ); } -#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB hrtf_bin_wptr += sizeof( float ) * len; for ( iTap = 0; iTap < len; iTap++ ) -#else - hrtf_bin_wptr += sizeof( float ) * LR_IAC_LENGTH_NR_FC; - for ( iTap = 0; iTap < LR_IAC_LENGTH_NR_FC; iTap++ ) -#endif { sprintf( tmpStr, FORMAT_FLOAT, pEner_r[iTap] ); sscanf( tmpStr, "%f", &( ( (float *) hrtf_bin_wptr )[iTap] ) ); } -#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB hrtf_bin_wptr += sizeof( float ) * len; for ( iTap = 0; iTap < len; iTap++ ) -#else - hrtf_bin_wptr += sizeof( float ) * LR_IAC_LENGTH_NR_FC; - for ( iTap = 0; iTap < LR_IAC_LENGTH_NR_FC; iTap++ ) -#endif { sprintf( tmpStr, FORMAT_FLOAT, pCoherence[iTap] ); sscanf( tmpStr, "%f", &( ( (float *) hrtf_bin_wptr )[iTap] ) ); } -#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB hrtf_bin_wptr += sizeof( float ) * len; -#else - hrtf_bin_wptr += sizeof( float ) * LR_IAC_LENGTH_NR_FC; -#endif binary_file_full_path = (char *) malloc( sizeof( char ) * ( strlen( binary_file_path ) + 1 + strlen( "Reverb" ) + 1 + 5 + 3 + 4 ) ); sprintf( binary_file_full_path, "%s_%s_%ikHz.bin", binary_file_path, "Reverb", samplerate / 1000 ); -- GitLab From 285b645fb1427f1b6d5757495375933f331ed299 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 7 Feb 2024 21:01:25 +0100 Subject: [PATCH 10/16] [cleanup] accept NONBE_FIX_935_EARLY_REFLECTIONS_WRONG_ORDER --- lib_com/options.h | 1 - lib_rend/ivas_reflections.c | 8 -------- 2 files changed, 9 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 00be7fb6bf..7f64491672 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -161,7 +161,6 @@ /* all switches in this category should start with "NONBE_" */ #define NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES /* Philips: Use pre-computed HRTF average L/R energies and IAC in all renderers */ -#define NONBE_FIX_935_EARLY_REFLECTIONS_WRONG_ORDER /* Qualcomm: issue 953: fix order or ER channels in LC mode*/ #define NONBE_FIX_935_SBA_REVERB /* FhG: issue 935: fix MSAN error for SBA related to BINAURAL_ROOM_REVERB */ #define NONBE_FIX_952_MC_PARAMUPMIX_5MS /* Dlb : issue 952 : Differences between 5ms and 20ms rendering for ParamUpmix*/ #define NONBE_FIX_967_ISM_MONO_DMX /* FhG: issue 967: accumulating energies in ISM mono DMX */ diff --git a/lib_rend/ivas_reflections.c b/lib_rend/ivas_reflections.c index 095f07de53..0b42a0b6ff 100644 --- a/lib_rend/ivas_reflections.c +++ b/lib_rend/ivas_reflections.c @@ -59,17 +59,9 @@ static uint16_t LC_mixing_7_1[7] = { 0, 1, 2, 3, 4, 3, 4 }; static uint16_t LC_mixing_5_1_2[7] = { 0, 1, 2, 3, 4, 0, 1 }; -#ifdef NONBE_FIX_935_EARLY_REFLECTIONS_WRONG_ORDER static uint16_t LC_mixing_5_1_4[9] = { 0, 1, 2, 3, 4, 0, 1, 3, 4 }; -#else -static uint16_t LC_mixing_5_1_4[9] = { 0, 1, 2, 3, 4, 0, 1, 2, 3 }; -#endif -#ifdef NONBE_FIX_935_EARLY_REFLECTIONS_WRONG_ORDER static uint16_t LC_mixing_7_1_4[11] = { 0, 1, 2, 3, 4, 3, 4, 0, 1, 3, 4 }; -#else -static uint16_t LC_mixing_7_1_4[11] = { 0, 1, 2, 3, 4, 3, 4, 0, 1, 2, 3 }; -#endif /*-----------------------------------------------------------------------------------------* * Function ivas_er_init() -- GitLab From 6f8d51a458b41304e2c0ed253bc26e3c49d81291 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 7 Feb 2024 21:02:10 +0100 Subject: [PATCH 11/16] [cleanup] accept NONBE_FIX_935_SBA_REVERB --- lib_com/options.h | 1 - lib_dec/ivas_output_config.c | 4 ---- lib_dec/ivas_sba_dec.c | 4 ---- lib_dec/ivas_spar_decoder.c | 4 ---- 4 files changed, 13 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 7f64491672..60824eb763 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -161,7 +161,6 @@ /* all switches in this category should start with "NONBE_" */ #define NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES /* Philips: Use pre-computed HRTF average L/R energies and IAC in all renderers */ -#define NONBE_FIX_935_SBA_REVERB /* FhG: issue 935: fix MSAN error for SBA related to BINAURAL_ROOM_REVERB */ #define NONBE_FIX_952_MC_PARAMUPMIX_5MS /* Dlb : issue 952 : Differences between 5ms and 20ms rendering for ParamUpmix*/ #define NONBE_FIX_967_ISM_MONO_DMX /* FhG: issue 967: accumulating energies in ISM mono DMX */ #define NONBE_FIX_968_ISM_BRIR_WITH_HEADROTATION_5MS_FIX /* FhG : issue #968: differences between 5ms and 20ms rendering for discrete ISM with BRIR and head rotation*/ diff --git a/lib_dec/ivas_output_config.c b/lib_dec/ivas_output_config.c index f2241ac808..1bbe35b6cf 100644 --- a/lib_dec/ivas_output_config.c +++ b/lib_dec/ivas_output_config.c @@ -160,11 +160,7 @@ void ivas_renderer_select( { *internal_config = IVAS_AUDIO_CONFIG_HOA3; -#ifdef NONBE_FIX_935_SBA_REVERB if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL -#else - if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB -#endif #ifdef SPLIT_REND_WITH_HEAD_ROT || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM #endif diff --git a/lib_dec/ivas_sba_dec.c b/lib_dec/ivas_sba_dec.c index bb4f17c381..d8433ab8b7 100644 --- a/lib_dec/ivas_sba_dec.c +++ b/lib_dec/ivas_sba_dec.c @@ -194,11 +194,7 @@ ivas_error ivas_sba_dec_reconfigure( } else { -#ifdef NONBE_FIX_935_SBA_REVERB if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL -#else - if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB -#endif #ifdef SPLIT_REND_WITH_HEAD_ROT || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM #endif diff --git a/lib_dec/ivas_spar_decoder.c b/lib_dec/ivas_spar_decoder.c index 9769c6e569..c3faa8bd31 100644 --- a/lib_dec/ivas_spar_decoder.c +++ b/lib_dec/ivas_spar_decoder.c @@ -250,11 +250,7 @@ ivas_error ivas_spar_dec_open( } if ( st_ivas->ivas_format == SBA_ISM_FORMAT && -#ifdef NONBE_FIX_935_SBA_REVERB st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL && -#else - ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) && -#endif st_ivas->ism_mode == ISM_SBA_MODE_DISC ) { /* get correct granularity in case of binaural rendering of the discrete objects with the td obj renderer */ -- GitLab From 92370ac27d2a84ebfa544a75c71957afad0d8817 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 7 Feb 2024 21:02:48 +0100 Subject: [PATCH 12/16] [cleanup] accept NONBE_FIX_952_MC_PARAMUPMIX_5MS --- lib_com/options.h | 1 - lib_dec/ivas_mc_paramupmix_dec.c | 20 -------------------- 2 files changed, 21 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 60824eb763..5bc449bf44 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -161,7 +161,6 @@ /* all switches in this category should start with "NONBE_" */ #define NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES /* Philips: Use pre-computed HRTF average L/R energies and IAC in all renderers */ -#define NONBE_FIX_952_MC_PARAMUPMIX_5MS /* Dlb : issue 952 : Differences between 5ms and 20ms rendering for ParamUpmix*/ #define NONBE_FIX_967_ISM_MONO_DMX /* FhG: issue 967: accumulating energies in ISM mono DMX */ #define NONBE_FIX_968_ISM_BRIR_WITH_HEADROTATION_5MS_FIX /* FhG : issue #968: differences between 5ms and 20ms rendering for discrete ISM with BRIR and head rotation*/ #define NONBE_FIX_977_OSBA_GAIN_MISMATCH /* Dlb : issue 977 : Output gain mismatch for different bit rates in OSBA */ diff --git a/lib_dec/ivas_mc_paramupmix_dec.c b/lib_dec/ivas_mc_paramupmix_dec.c index e6eadb43d2..b623c9fc46 100644 --- a/lib_dec/ivas_mc_paramupmix_dec.c +++ b/lib_dec/ivas_mc_paramupmix_dec.c @@ -118,13 +118,11 @@ void ivas_mc_paramupmix_dec_read_BS( } } -#ifdef NONBE_FIX_952_MC_PARAMUPMIX_5MS for ( i = 0; i < MC_PARAMUPMIX_COMBINATIONS; i++ ) { mvr2r( hMCParamUpmix->alpha_prev[i], hMCParamUpmix->alpha_sf[i], IVAS_MAX_NUM_BANDS ); mvr2r( hMCParamUpmix->beta_prev[i], hMCParamUpmix->beta_sf[i], IVAS_MAX_NUM_BANDS ); } -#endif hMCParamUpmix->first_frame = 1; } @@ -144,7 +142,6 @@ void ivas_mc_paramupmix_dec_read_BS( st0->bits_frame = min( MAX_BITS_METADATA, last_bit_pos + 1 ); st0->total_brate = st_ivas->hDecoderConfig->ivas_total_brate; /* to avoid BER detect */ -#ifdef NONBE_FIX_952_MC_PARAMUPMIX_5MS if ( hMCParamUpmix->first_frame == 0 ) { for ( i = 0; i < MC_PARAMUPMIX_COMBINATIONS; i++ ) @@ -153,7 +150,6 @@ void ivas_mc_paramupmix_dec_read_BS( mvr2r( hMCParamUpmix->betas[i], hMCParamUpmix->beta_prev[i], IVAS_MAX_NUM_BANDS ); } } -#endif for ( i = 0; i < MC_PARAMUPMIX_COMBINATIONS; i++ ) { @@ -175,13 +171,11 @@ void ivas_mc_paramupmix_dec_read_BS( hMCParamUpmix->first_frame = 0; } -#ifdef NONBE_FIX_952_MC_PARAMUPMIX_5MS for ( i = 0; i < MC_PARAMUPMIX_COMBINATIONS; i++ ) { mvr2r( hMCParamUpmix->alpha_prev[i], hMCParamUpmix->alpha_sf[i], IVAS_MAX_NUM_BANDS ); mvr2r( hMCParamUpmix->beta_prev[i], hMCParamUpmix->beta_sf[i], IVAS_MAX_NUM_BANDS ); } -#endif } pop_wmops(); @@ -273,13 +267,6 @@ void ivas_mc_paramupmix_dec_render( assert( slots_to_render == 0 ); #endif { -#ifndef NONBE_FIX_952_MC_PARAMUPMIX_5MS - for ( ch = 0; ch < MC_PARAMUPMIX_COMBINATIONS; ch++ ) - { - mvr2r( hMCParamUpmix->alpha_prev[ch], hMCParamUpmix->alpha_sf[ch], IVAS_MAX_NUM_BANDS ); - mvr2r( hMCParamUpmix->beta_prev[ch], hMCParamUpmix->beta_sf[ch], IVAS_MAX_NUM_BANDS ); - } -#endif #ifdef SPLIT_REND_WITH_HEAD_ROT slot_index_start = 0; @@ -304,13 +291,6 @@ void ivas_mc_paramupmix_dec_render( /* update combined orientation access index */ ivas_combined_orientation_update_index( st_ivas->hCombinedOrientationData, n_samples_sf ); } -#ifndef NONBE_FIX_952_MC_PARAMUPMIX_5MS - for ( ch = 0; ch < MC_PARAMUPMIX_COMBINATIONS; ch++ ) - { - mvr2r( hMCParamUpmix->alphas[ch], hMCParamUpmix->alpha_prev[ch], IVAS_MAX_NUM_BANDS ); - mvr2r( hMCParamUpmix->betas[ch], hMCParamUpmix->beta_prev[ch], IVAS_MAX_NUM_BANDS ); - } -#endif } *nSamplesAvailable = ( st_ivas->hTcBuffer->num_slots - st_ivas->hTcBuffer->slots_rendered ) * slot_size; -- GitLab From 96d8c66faf485cc783c86a0234c03edb007839ea Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 7 Feb 2024 21:03:29 +0100 Subject: [PATCH 13/16] [cleanup] accept NONBE_FIX_967_ISM_MONO_DMX --- lib_com/ivas_prot.h | 4 ---- lib_com/options.h | 1 - lib_dec/ivas_jbm_dec.c | 12 ------------ lib_dec/ivas_mono_dmx_renderer.c | 28 ---------------------------- 4 files changed, 45 deletions(-) diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index a8b5e90570..a989dddc8e 100755 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -5472,11 +5472,7 @@ void ivas_mono_dmx_renderer_close( MONO_DOWNMIX_RENDERER_HANDLE *hMonoDmxRenderer /* i/ i/o: Mono downmix structure */ ); -#ifdef NONBE_FIX_967_ISM_MONO_DMX void ivas_ism_mono_dmx( -#else -void ivas_mono_downmix_render_passive( -#endif Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ float *output_f[], /* i/o: synthesized core-coder transport channels/mono output */ const int16_t output_frame /* i : output frame length */ diff --git a/lib_com/options.h b/lib_com/options.h index 5bc449bf44..c70665b416 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -161,7 +161,6 @@ /* all switches in this category should start with "NONBE_" */ #define NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES /* Philips: Use pre-computed HRTF average L/R energies and IAC in all renderers */ -#define NONBE_FIX_967_ISM_MONO_DMX /* FhG: issue 967: accumulating energies in ISM mono DMX */ #define NONBE_FIX_968_ISM_BRIR_WITH_HEADROTATION_5MS_FIX /* FhG : issue #968: differences between 5ms and 20ms rendering for discrete ISM with BRIR and head rotation*/ #define NONBE_FIX_977_OSBA_GAIN_MISMATCH /* Dlb : issue 977 : Output gain mismatch for different bit rates in OSBA */ #define NONBE_FIX_973_HODIRAC_BAND_GROUPING /* FhG: issue 973: empty parameter band in DirAC */ diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index 3554697282..7c6f1fdfa6 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -196,11 +196,7 @@ ivas_error ivas_jbm_dec_tc( if ( st_ivas->renderer_type == RENDERER_MONO_DOWNMIX ) { -#ifdef NONBE_FIX_967_ISM_MONO_DMX ivas_ism_mono_dmx( st_ivas, p_output, output_frame ); -#else - ivas_mono_downmix_render_passive( st_ivas, p_output, output_frame ); -#endif } else if ( st_ivas->ism_mode == ISM_MODE_PARAM && ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM || st_ivas->renderer_type == RENDERER_STEREO_PARAMETRIC ) ) { @@ -392,11 +388,7 @@ ivas_error ivas_jbm_dec_tc( if ( st_ivas->renderer_type == RENDERER_MONO_DOWNMIX ) { -#ifdef NONBE_FIX_967_ISM_MONO_DMX ivas_ism_mono_dmx( st_ivas, p_output, output_frame ); -#else - ivas_mono_downmix_render_passive( st_ivas, p_output, output_frame ); -#endif } else if ( output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) { @@ -520,11 +512,7 @@ ivas_error ivas_jbm_dec_tc( } else if ( st_ivas->renderer_type == RENDERER_MONO_DOWNMIX && st_ivas->ism_mode == ISM_SBA_MODE_DISC ) { -#ifdef NONBE_FIX_967_ISM_MONO_DMX ivas_ism_mono_dmx( st_ivas, p_output, output_frame ); -#else - ivas_mono_downmix_render_passive( st_ivas, p_output, output_frame ); -#endif /* add W */ for ( n = 0; n < nchan_out; n++ ) diff --git a/lib_dec/ivas_mono_dmx_renderer.c b/lib_dec/ivas_mono_dmx_renderer.c index 1da119f000..ffccaa93f8 100644 --- a/lib_dec/ivas_mono_dmx_renderer.c +++ b/lib_dec/ivas_mono_dmx_renderer.c @@ -48,9 +48,6 @@ #define DOWNMIX_ALPHA 0.95f /* Smoothing coefficient */ #define DOWNMIX_MAX_GAIN 4.0f /* Maximum allowed gain */ -#ifndef NONBE_FIX_967_ISM_MONO_DMX -#define MONO_DOWNMIX_RENDERER_MAX_INPUT_CHANS 4 // FhG esr: this seems to be obsolete; not related to issue 967 -#endif /*------------------------------------------------------------------------- @@ -106,11 +103,7 @@ void ivas_mono_dmx_renderer_close( * Downmix process *------------------------------------------------------------------------*/ -#ifdef NONBE_FIX_967_ISM_MONO_DMX void ivas_ism_mono_dmx( -#else -void ivas_mono_downmix_render_passive( -#endif Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ float *output_f[], /* i/o: synthesized core-coder transport channels/mono output */ const int16_t output_frame /* i : output frame length */ @@ -118,9 +111,7 @@ void ivas_mono_downmix_render_passive( { int16_t i, j, numInputChannels; float proto_signal[L_FRAME48k], eq; -#ifdef NONBE_FIX_967_ISM_MONO_DMX float inputEnergy_local, protoEnergy_local; -#endif MONO_DOWNMIX_RENDERER_HANDLE hDownmix; numInputChannels = st_ivas->nSCE; @@ -143,10 +134,8 @@ void ivas_mono_downmix_render_passive( hDownmix = st_ivas->hMonoDmxRenderer; set_zero( proto_signal, output_frame ); -#ifdef NONBE_FIX_967_ISM_MONO_DMX inputEnergy_local = 0; protoEnergy_local = 0; -#endif /* Compute the Proto Signal */ for ( i = 0; i < numInputChannels; i++ ) @@ -154,7 +143,6 @@ void ivas_mono_downmix_render_passive( v_add( output_f[i], proto_signal, proto_signal, output_frame ); } -#ifdef NONBE_FIX_967_ISM_MONO_DMX /* compute the input energy, proto energy */ for ( i = 0; i < output_frame; i++ ) { @@ -165,26 +153,10 @@ void ivas_mono_downmix_render_passive( inputEnergy_local += ( output_f[j][i] * output_f[j][i] ); } } -#else - /* compute the input energy, proto energy after smoothing */ - hDownmix->inputEnergy *= DOWNMIX_ALPHA; - hDownmix->protoEnergy *= DOWNMIX_ALPHA; - for ( i = 0; i < output_frame; i++ ) - { - hDownmix->protoEnergy += proto_signal[i] * proto_signal[i]; - - for ( j = 0; j < numInputChannels; j++ ) - { - hDownmix->inputEnergy += ( output_f[j][i] * output_f[j][i] ); - } - } -#endif -#ifdef NONBE_FIX_967_ISM_MONO_DMX hDownmix->inputEnergy *= DOWNMIX_ALPHA; hDownmix->protoEnergy *= DOWNMIX_ALPHA; hDownmix->inputEnergy += ( 1.0f - DOWNMIX_ALPHA ) * inputEnergy_local; hDownmix->protoEnergy += ( 1.0f - DOWNMIX_ALPHA ) * protoEnergy_local; -#endif /* compute the eq factor */ eq = min( DOWNMIX_MAX_GAIN, sqrtf( hDownmix->inputEnergy / ( EPSILON + hDownmix->protoEnergy ) ) ); -- GitLab From 1c41671d3a0d8d143848d6aa9b223e31b874066b Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 7 Feb 2024 21:04:17 +0100 Subject: [PATCH 14/16] [cleanup] accept NONBE_FIX_968_ISM_BRIR_WITH_HEADROTATION_5MS_FIX --- lib_com/options.h | 1 - lib_dec/ivas_ism_renderer.c | 32 -------------------------------- 2 files changed, 33 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index c70665b416..06beed1f4b 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -161,7 +161,6 @@ /* all switches in this category should start with "NONBE_" */ #define NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES /* Philips: Use pre-computed HRTF average L/R energies and IAC in all renderers */ -#define NONBE_FIX_968_ISM_BRIR_WITH_HEADROTATION_5MS_FIX /* FhG : issue #968: differences between 5ms and 20ms rendering for discrete ISM with BRIR and head rotation*/ #define NONBE_FIX_977_OSBA_GAIN_MISMATCH /* Dlb : issue 977 : Output gain mismatch for different bit rates in OSBA */ #define NONBE_FIX_973_HODIRAC_BAND_GROUPING /* FhG: issue 973: empty parameter band in DirAC */ #define NONBE_FIX_951_MCMASA_5MS_RENDERING /* Nokia: issue #951: Differences for 5ms and 20ms rendering for McMASA at 13.2 kbps to BINAURAL */ diff --git a/lib_dec/ivas_ism_renderer.c b/lib_dec/ivas_ism_renderer.c index 5fa4d78eb4..9fcb8f9f43 100644 --- a/lib_dec/ivas_ism_renderer.c +++ b/lib_dec/ivas_ism_renderer.c @@ -154,12 +154,9 @@ void ivas_ism_render_sf( float gain, prev_gain; float tc_local[MAX_NUM_OBJECTS][L_FRAME48k]; float *p_tc[MAX_NUM_OBJECTS]; -#ifdef NONBE_FIX_968_ISM_BRIR_WITH_HEADROTATION_5MS_FIX int16_t ism_md_subframe_update_jbm, slots_to_render, first_sf, last_sf, subframe_idx; int16_t n_samples_rendered_loop; -#endif -#ifdef NONBE_FIX_968_ISM_BRIR_WITH_HEADROTATION_5MS_FIX /* loop for synthesis, assume we always have to render in multiples of 5ms subframes with spills */ slots_to_render = min( st_ivas->hTcBuffer->num_slots - st_ivas->hTcBuffer->slots_rendered, n_samples_to_render / st_ivas->hTcBuffer->n_samples_granularity ); first_sf = st_ivas->hTcBuffer->subframes_rendered; @@ -171,7 +168,6 @@ void ivas_ism_render_sf( slots_to_render -= st_ivas->hTcBuffer->subframe_nbslots[last_sf]; last_sf++; } -#endif num_objects = st_ivas->nchan_transport; if ( st_ivas->ivas_format == SBA_ISM_FORMAT ) @@ -184,7 +180,6 @@ void ivas_ism_render_sf( tc_offset = st_ivas->hTcBuffer->n_samples_rendered; interp_offset = st_ivas->hTcBuffer->n_samples_rendered; -#ifdef NONBE_FIX_968_ISM_BRIR_WITH_HEADROTATION_5MS_FIX /* Number of subframes to delay metadata to sync with audio */ if ( st_ivas->hDecoderConfig->Opt_delay_comp ) { @@ -194,7 +189,6 @@ void ivas_ism_render_sf( { ism_md_subframe_update_jbm = st_ivas->hTcBuffer->nb_subframes - 2; } -#endif if ( st_ivas->hDecoderConfig->Opt_tsm ) { @@ -217,21 +211,15 @@ void ivas_ism_render_sf( set_f( output_f[i], 0.0f, n_samples_to_render ); } -#ifdef NONBE_FIX_968_ISM_BRIR_WITH_HEADROTATION_5MS_FIX for ( subframe_idx = first_sf; subframe_idx < last_sf; subframe_idx++ ) { int16_t n_samples_in_subframe; n_samples_in_subframe = st_ivas->hTcBuffer->n_samples_granularity * st_ivas->hTcBuffer->subframe_nbslots[subframe_idx]; -#endif if ( st_ivas->hCombinedOrientationData && st_ivas->hCombinedOrientationData->enableCombinedOrientation[st_ivas->hCombinedOrientationData->subframe_idx] == 1 ) { -#ifdef NONBE_FIX_968_ISM_BRIR_WITH_HEADROTATION_5MS_FIX ivas_jbm_dec_get_adapted_linear_interpolator( n_samples_in_subframe, n_samples_in_subframe, st_ivas->hIsmRendererData->interpolator ); -#else - ivas_jbm_dec_get_adapted_linear_interpolator( n_samples_to_render, n_samples_to_render, st_ivas->hIsmRendererData->interpolator ); -#endif interp_offset = 0; } @@ -240,7 +228,6 @@ void ivas_ism_render_sf( /* Combined rotation: rotate the object positions depending the head and external orientations */ if ( st_ivas->hCombinedOrientationData != NULL && st_ivas->hCombinedOrientationData->enableCombinedOrientation[st_ivas->hCombinedOrientationData->subframe_idx] == 1 ) { -#ifdef NONBE_FIX_968_ISM_BRIR_WITH_HEADROTATION_5MS_FIX if ( subframe_idx >= ism_md_subframe_update_jbm ) { rotateAziEle( st_ivas->hIsmMetaData[i]->azimuth, st_ivas->hIsmMetaData[i]->elevation, &azimuth, &elevation, st_ivas->hCombinedOrientationData->Rmat[st_ivas->hCombinedOrientationData->subframe_idx], st_ivas->hIntSetup.is_planar_setup ); @@ -249,9 +236,6 @@ void ivas_ism_render_sf( { rotateAziEle( st_ivas->hIsmMetaData[i]->last_azimuth, st_ivas->hIsmMetaData[i]->last_elevation, &azimuth, &elevation, st_ivas->hCombinedOrientationData->Rmat[st_ivas->hCombinedOrientationData->subframe_idx], st_ivas->hIntSetup.is_planar_setup ); } -#else - rotateAziEle( st_ivas->hIsmMetaData[i]->azimuth, st_ivas->hIsmMetaData[i]->elevation, &azimuth, &elevation, st_ivas->hCombinedOrientationData->Rmat[0], st_ivas->hIntSetup.is_planar_setup ); -#endif if ( st_ivas->hEFAPdata != NULL ) { efap_determine_gains( st_ivas->hEFAPdata, st_ivas->hIsmRendererData->gains[i], azimuth, elevation, EFAP_MODE_EFAP ); @@ -272,18 +256,10 @@ void ivas_ism_render_sf( { g1 = &st_ivas->hIsmRendererData->interpolator[interp_offset]; tc = p_tc[i]; -#ifdef NONBE_FIX_968_ISM_BRIR_WITH_HEADROTATION_5MS_FIX for ( k = 0; k < n_samples_in_subframe; k++ ) -#else - for ( k = 0; k < n_samples_to_render; k++ ) -#endif { g2 = 1.0f - *g1; -#ifdef NONBE_FIX_968_ISM_BRIR_WITH_HEADROTATION_5MS_FIX output_f[j2][k + n_samples_rendered_loop] += ( *( g1++ ) * gain + g2 * prev_gain ) * *( tc++ ); -#else - output_f[j2][k] += ( *( g1++ ) * gain + g2 * prev_gain ) * *( tc++ ); -#endif } } @@ -293,19 +269,12 @@ void ivas_ism_render_sf( st_ivas->hIsmRendererData->prev_gains[i][j] = gain; } } -#ifdef NONBE_FIX_968_ISM_BRIR_WITH_HEADROTATION_5MS_FIX p_tc[i] += n_samples_in_subframe; -#endif } /* update combined orientation access index */ -#ifdef NONBE_FIX_968_ISM_BRIR_WITH_HEADROTATION_5MS_FIX ivas_combined_orientation_update_index( st_ivas->hCombinedOrientationData, n_samples_in_subframe ); -#else - ivas_combined_orientation_update_index( st_ivas->hCombinedOrientationData, n_samples_to_render ); -#endif -#ifdef NONBE_FIX_968_ISM_BRIR_WITH_HEADROTATION_5MS_FIX n_samples_rendered_loop += n_samples_in_subframe; if ( st_ivas->renderer_type == RENDERER_TD_PANNING ) { @@ -315,7 +284,6 @@ void ivas_ism_render_sf( tc_offset += n_samples_in_subframe; interp_offset += n_samples_in_subframe; } -#endif return; } -- GitLab From 3e395de1f9e7b80f0205e3caff41dfc24a6e74c9 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 7 Feb 2024 21:05:01 +0100 Subject: [PATCH 15/16] [cleanup] accept NONBE_FIX_977_OSBA_GAIN_MISMATCH --- lib_com/options.h | 1 - lib_enc/ivas_osba_enc.c | 17 ----------------- 2 files changed, 18 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 06beed1f4b..e1eaa1221c 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -161,7 +161,6 @@ /* all switches in this category should start with "NONBE_" */ #define NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES /* Philips: Use pre-computed HRTF average L/R energies and IAC in all renderers */ -#define NONBE_FIX_977_OSBA_GAIN_MISMATCH /* Dlb : issue 977 : Output gain mismatch for different bit rates in OSBA */ #define NONBE_FIX_973_HODIRAC_BAND_GROUPING /* FhG: issue 973: empty parameter band in DirAC */ #define NONBE_FIX_951_MCMASA_5MS_RENDERING /* Nokia: issue #951: Differences for 5ms and 20ms rendering for McMASA at 13.2 kbps to BINAURAL */ #define NONBE_FIX_979_OSBA_STEREO_5MS /* FhG : issue #979 : 5ms and 20ms output different for OSBA and stereo */ diff --git a/lib_enc/ivas_osba_enc.c b/lib_enc/ivas_osba_enc.c index bcff38b21d..e2416ab3f7 100644 --- a/lib_enc/ivas_osba_enc.c +++ b/lib_enc/ivas_osba_enc.c @@ -72,11 +72,7 @@ static void ivas_merge_sba_transports( { for ( j = 0; j < input_frame; j++ ) { -#ifdef NONBE_FIX_977_OSBA_GAIN_MISMATCH data_out_f[i][j] = 0.5f * ( data_in_f1[i][j] + data_in_f2[i][j] ); -#else - data_out_f[i][j] = ( data_in_f1[i][j] + data_in_f2[i][j] ); -#endif } } @@ -447,9 +443,6 @@ static void ivas_osba_render_ism_to_sba( int16_t azimuth, elevation; float gains[MAX_INPUT_CHANNELS]; float g1, g2; -#ifndef NONBE_FIX_977_OSBA_GAIN_MISMATCH - float output_gain; -#endif int16_t nchan_sba; @@ -484,16 +477,6 @@ static void ivas_osba_render_ism_to_sba( } /* Gain with loudness-matching gains */ -#ifndef NONBE_FIX_977_OSBA_GAIN_MISMATCH - output_gain = 0.7499f; - for ( j = 0; j < nchan_sba; j++ ) - { - for ( k = 0; k < input_frame; k++ ) - { - data_out_f[j][k] *= output_gain; - } - } -#endif return; } -- GitLab From bf7e8aef816a086b08490113e9e675c6cc995fc6 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 7 Feb 2024 21:07:20 +0100 Subject: [PATCH 16/16] formatting --- lib_dec/lib_dec.c | 10 +++++----- lib_rend/ivas_stat_rend.h | 6 +++--- lib_rend/lib_rend.c | 19 +++++++------------ lib_util/hrtf_file_reader.c | 6 +++--- 4 files changed, 18 insertions(+), 23 deletions(-) diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index afba5a8aff..564543a800 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -1672,7 +1672,7 @@ ivas_error IVAS_DEC_FeedHeadTrackData( const int16_t subframe_idx, /* i : subframe index */ const IVAS_SPLIT_REND_ROT_AXIS rot_axis /* i : external control for rotation axis for split rendering */ #else - const int16_t subframe_idx /* i : subframe index */ + const int16_t subframe_idx /* i : subframe index */ #endif ) { @@ -1881,7 +1881,7 @@ ivas_error IVAS_DEC_FeedCustomLsData( *---------------------------------------------------------------------*/ ivas_error IVAS_DEC_GetHrtfHandle( - IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ + IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ IVAS_DEC_HRTF_HANDLE **hHrtfTD /* o : HRTF handle */ ) { @@ -1903,7 +1903,7 @@ ivas_error IVAS_DEC_GetHrtfHandle( *---------------------------------------------------------------------*/ ivas_error IVAS_DEC_GetHrtfCRendHandle( - IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ + IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ IVAS_DEC_HRTF_CREND_HANDLE **hSetOfHRTF /* o : Set of HRTF handle */ ) { @@ -1925,7 +1925,7 @@ ivas_error IVAS_DEC_GetHrtfCRendHandle( *---------------------------------------------------------------------*/ ivas_error IVAS_DEC_GetHrtfFastConvHandle( - IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ + IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ IVAS_DEC_HRTF_FASTCONV_HANDLE **hHrtfFastConv /* o : FASTCONV HRTF handle */ ) { @@ -1947,7 +1947,7 @@ ivas_error IVAS_DEC_GetHrtfFastConvHandle( *---------------------------------------------------------------------*/ ivas_error IVAS_DEC_GetHrtfParamBinHandle( - IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ + IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ IVAS_DEC_HRTF_PARAMBIN_HANDLE **hHrtfParambin /* o : Parametric binauralizer HRTF handle */ ) { diff --git a/lib_rend/ivas_stat_rend.h b/lib_rend/ivas_stat_rend.h index fde7b70bc1..e95ff21a38 100644 --- a/lib_rend/ivas_stat_rend.h +++ b/lib_rend/ivas_stat_rend.h @@ -1157,9 +1157,9 @@ typedef struct ivas_binaural_td_rendering_struct TDREND_SRC_t *Sources[MAX_NUM_TDREND_CHANNELS]; - float Gain; /* Mixer gain */ - TDREND_MIX_Listener_t *Listener_p; /* The virtual listener */ - TDREND_HRFILT_FiltSet_t *HrFiltSet_p; /* HR filter set */ + float Gain; /* Mixer gain */ + TDREND_MIX_Listener_t *Listener_p; /* The virtual listener */ + TDREND_HRFILT_FiltSet_t *HrFiltSet_p; /* HR filter set */ TDREND_HRFILT_FiltSet_t **pHrFiltSet_p; /* pointer to HR filter set */ int16_t UseCommonDistAttenModel; /* Use common dist atten model (TRUE/FALSE) */ diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index ea12814700..d107f0216e 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -1361,8 +1361,7 @@ static ivas_error setRendInputActiveIsm( const AUDIO_CONFIG inConfig, const IVAS_REND_InputId id, RENDER_CONFIG_DATA *hRendCfg, - hrtf_handles *hrtfs -) + hrtf_handles *hrtfs ) { ivas_error error; rendering_context rendCtx; @@ -2432,8 +2431,7 @@ static ivas_error setRendInputActiveMc( const AUDIO_CONFIG inConfig, const IVAS_REND_InputId id, RENDER_CONFIG_DATA *hRendCfg, - hrtf_handles *hrtfs -) + hrtf_handles *hrtfs ) { #ifdef SPLIT_REND_WITH_HEAD_ROT int16_t i; @@ -2778,9 +2776,9 @@ static ivas_error updateSbaPanGains( #endif #else #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES - if ( ( error = ivas_rend_openCrend( &inputSba->crendWrapper, inConfig, outConfig, hRendCfg, hMixconv, hHrtfStatistics, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_rend_openCrend( &inputSba->crendWrapper, inConfig, outConfig, hRendCfg, hMixconv, hHrtfStatistics, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) #else - if ( ( error = ivas_rend_openCrend( &inputSba->crendWrapper, inConfig, outConfig, hRendCfg, hMixconv, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_rend_openCrend( &inputSba->crendWrapper, inConfig, outConfig, hRendCfg, hMixconv, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) #endif #endif { @@ -2838,8 +2836,7 @@ static ivas_error setRendInputActiveSplitPostRend( void *input, const AUDIO_CONFIG inConfig, const IVAS_REND_InputId id, - RENDER_CONFIG_DATA *hRendCfg - , + RENDER_CONFIG_DATA *hRendCfg, #if defined _MSC_VER && !defined __clang__ #ifdef _MSC_VER #pragma warning( disable : 4100 ) @@ -2906,8 +2903,7 @@ static ivas_error setRendInputActiveSba( const AUDIO_CONFIG inConfig, const IVAS_REND_InputId id, RENDER_CONFIG_DATA *hRendCfg, - hrtf_handles *hrtfs -) + hrtf_handles *hrtfs ) { ivas_error error; rendering_context rendCtx; @@ -9395,8 +9391,7 @@ static ivas_error initMasaExtRenderer( #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES const RENDER_CONFIG_DATA *hRendCfg, #endif - hrtf_handles *hrtfs -) + hrtf_handles *hrtfs ) { int16_t i; ivas_error error; diff --git a/lib_util/hrtf_file_reader.c b/lib_util/hrtf_file_reader.c index 3eca568142..3d455495e0 100644 --- a/lib_util/hrtf_file_reader.c +++ b/lib_util/hrtf_file_reader.c @@ -1181,9 +1181,9 @@ static ivas_error create_HRTF_from_rawdata( static ivas_error create_fastconv_HRTF_from_rawdata( - HRTFS_FASTCONV_HANDLE *hHRTF, /* i/o: HRTF FastConv handle */ - char *hrtf_data, /* i : pointer to binary file */ - HRTF_READER_RENDERER_TYPE rend_type, /* i : Renderer type */ + HRTFS_FASTCONV_HANDLE *hHRTF, /* i/o: HRTF FastConv handle */ + char *hrtf_data, /* i : pointer to binary file */ + HRTF_READER_RENDERER_TYPE rend_type, /* i : Renderer type */ BINAURAL_INPUT_AUDIO_CONFIG input_cfg /* i : Input binaural config */ ) { -- GitLab