From 71bfd77ab1c7c7dccf1a4fd645dfbd46afc1985a Mon Sep 17 00:00:00 2001 From: Devansh Kandpal <43807487+mrkandpal@users.noreply.github.com> Date: Tue, 10 Jun 2025 13:55:21 +0200 Subject: [PATCH 01/20] Enabled compiler switch + changed target branch for CI --- .gitlab-ci.yml | 2 +- lib_com/options.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index abeb54b40..d1b37b29a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -18,7 +18,7 @@ variables: REF_DECODER_PATH: "./IVAS_dec_ref" LEVEL_SCALING: "1.0" IVAS_PIPELINE_NAME: '' - BASOP_CI_BRANCH_PC_REPO: "basop-ci-branch" + BASOP_CI_BRANCH_PC_REPO: "main" PRM_FILES: "scripts/config/self_test.prm scripts/config/self_test_ltv.prm" TESTCASE_TIMEOUT_STV: 900 TESTCASE_TIMEOUT_LTV: 2400 diff --git a/lib_com/options.h b/lib_com/options.h index 595a15810..9b76d4793 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -187,7 +187,7 @@ #endif -//#define USE_NEW_HRTF_BINARY_FILE_FORMAT /* Orange: to activate when decided to change the hrtf binary file format */ +#define USE_NEW_HRTF_BINARY_FILE_FORMAT /* Orange: to activate when decided to change the hrtf binary file format */ #ifdef USE_NEW_HRTF_BINARY_FILE_FORMAT #define NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES /* Philips: Use pre-computed HRTF average L/R energies and IAC in all renderers */ #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES -- GitLab From 9cce921beeba78dd0019183a9b122f6cc9904d2b Mon Sep 17 00:00:00 2001 From: Devansh Kandpal <43807487+mrkandpal@users.noreply.github.com> Date: Tue, 10 Jun 2025 14:07:06 +0200 Subject: [PATCH 02/20] restart pipeline -- GitLab From fc98ff8a95699fad955ec5eedfb0050db4485167 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Tue, 10 Jun 2025 15:54:49 +0200 Subject: [PATCH 03/20] Restore to using basop-ci-branch, just get the new HRTF binary files --- .gitlab-ci.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d1b37b29a..251aae1b1 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -18,7 +18,7 @@ variables: REF_DECODER_PATH: "./IVAS_dec_ref" LEVEL_SCALING: "1.0" IVAS_PIPELINE_NAME: '' - BASOP_CI_BRANCH_PC_REPO: "main" + BASOP_CI_BRANCH_PC_REPO: "basop-ci-branch" PRM_FILES: "scripts/config/self_test.prm scripts/config/self_test_ltv.prm" TESTCASE_TIMEOUT_STV: 900 TESTCASE_TIMEOUT_LTV: 2400 @@ -240,6 +240,11 @@ stages: - git checkout "$BASOP_CI_BRANCH_PC_REPO" - git reset --hard origin/"$BASOP_CI_BRANCH_PC_REPO" - git pull + +# Restore new format of HRTF binary + - git fetch origin main + - git checkout origin/main -- scripts/binauralRenderer_interface/binaural_renderers_hrtf_data + - cd - - cp -r $SCRIPTS_DIR/ci . - cp -r $SCRIPTS_DIR/scripts . -- GitLab From 4d692bbf9ea02debddac7e0a2e82197f97f5632f Mon Sep 17 00:00:00 2001 From: Devansh Kandpal <43807487+mrkandpal@users.noreply.github.com> Date: Wed, 11 Jun 2025 09:22:49 +0200 Subject: [PATCH 04/20] bug fix for segfault in decoder initialisation --- lib_dec/ivas_init_dec.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index e4f5df6e1..8a77341b4 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -2012,7 +2012,8 @@ ivas_error ivas_init_decoder( #ifdef SPLIT_REND_WITH_HEAD_ROT #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES - if ( ( error = ivas_reverb_open( &st_ivas->hReverb, st_ivas->hHrtfStatistics, st_ivas->hRenderConfig, st_ivas->hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), st_ivas->intern_config, st_ivas->hDecoderConfig->output_config, + st_ivas->hRenderConfig, st_ivas->hSetOfHRTF, st_ivas->hHrtfStatistics, st_ivas->hDecoderConfig->output_Fs, st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses ) ) != IVAS_ERR_OK ) #else if ( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), st_ivas->intern_config, st_ivas->hDecoderConfig->output_config, st_ivas->hRenderConfig, st_ivas->hSetOfHRTF, st_ivas->hDecoderConfig->output_Fs, ( st_ivas->hSplitBinRend == NULL ) ? 1 : st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses ) ) != IVAS_ERR_OK ) -- GitLab From 55c0110731983d7801b7d55a4edd80e2f683823b Mon Sep 17 00:00:00 2001 From: Devansh Kandpal <43807487+mrkandpal@users.noreply.github.com> Date: Wed, 11 Jun 2025 12:07:39 +0200 Subject: [PATCH 05/20] Added fix for nullptr in ivas_init_dec.c --- lib_dec/ivas_init_dec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index 8a77341b4..c0b6a3aae 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -2013,7 +2013,7 @@ ivas_error ivas_init_decoder( #ifdef SPLIT_REND_WITH_HEAD_ROT #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), st_ivas->intern_config, st_ivas->hDecoderConfig->output_config, - st_ivas->hRenderConfig, st_ivas->hSetOfHRTF, st_ivas->hHrtfStatistics, st_ivas->hDecoderConfig->output_Fs, st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses ) ) != IVAS_ERR_OK ) + st_ivas->hRenderConfig, st_ivas->hSetOfHRTF, st_ivas->hHrtfStatistics, st_ivas->hDecoderConfig->output_Fs, ( st_ivas->hSplitBinRend == NULL ) ? 1 : st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses ) ) != IVAS_ERR_OK ) #else if ( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), st_ivas->intern_config, st_ivas->hDecoderConfig->output_config, st_ivas->hRenderConfig, st_ivas->hSetOfHRTF, st_ivas->hDecoderConfig->output_Fs, ( st_ivas->hSplitBinRend == NULL ) ? 1 : st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses ) ) != IVAS_ERR_OK ) -- GitLab From 31de1dd6b85932bc2ddab38f049aca2d26b7d5bb Mon Sep 17 00:00:00 2001 From: Devansh Kandpal <43807487+mrkandpal@users.noreply.github.com> Date: Wed, 11 Jun 2025 12:25:41 +0200 Subject: [PATCH 06/20] nullptr bug fixes --- lib_dec/ivas_ism_dec.c | 2 +- lib_dec/ivas_mct_dec.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib_dec/ivas_ism_dec.c b/lib_dec/ivas_ism_dec.c index 072f79a07..75c436c96 100644 --- a/lib_dec/ivas_ism_dec.c +++ b/lib_dec/ivas_ism_dec.c @@ -240,7 +240,7 @@ static ivas_error ivas_ism_bitrate_switching_dec( /* Open Crend Binaural renderer */ #ifdef SPLIT_REND_WITH_HEAD_ROT #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES - if ( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), st_ivas->intern_config, st_ivas->hOutSetup.output_config, st_ivas->hRenderConfig, st_ivas->hSetOfHRTF, st_ivas->hHrtfStatistics, st_ivas->hDecoderConfig->output_Fs, st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), st_ivas->intern_config, st_ivas->hOutSetup.output_config, st_ivas->hRenderConfig, st_ivas->hSetOfHRTF, st_ivas->hHrtfStatistics, st_ivas->hDecoderConfig->output_Fs, ( st_ivas->hSplitBinRend == NULL ) ? 1 : st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses ) ) != IVAS_ERR_OK ) #else if ( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), st_ivas->intern_config, st_ivas->hOutSetup.output_config, st_ivas->hRenderConfig, st_ivas->hSetOfHRTF, st_ivas->hDecoderConfig->output_Fs, ( st_ivas->hSplitBinRend == NULL ) ? 1 : st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses ) ) != IVAS_ERR_OK ) #endif diff --git a/lib_dec/ivas_mct_dec.c b/lib_dec/ivas_mct_dec.c index 1d23be888..ab866fd5a 100644 --- a/lib_dec/ivas_mct_dec.c +++ b/lib_dec/ivas_mct_dec.c @@ -1304,7 +1304,7 @@ static ivas_error ivas_mc_dec_reconfig( { #ifdef SPLIT_REND_WITH_HEAD_ROT #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES - if ( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), st_ivas->intern_config, st_ivas->hDecoderConfig->output_config, st_ivas->hRenderConfig, st_ivas->hSetOfHRTF, st_ivas->hHrtfStatistics, st_ivas->hDecoderConfig->output_Fs, st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), st_ivas->intern_config, st_ivas->hDecoderConfig->output_config, st_ivas->hRenderConfig, st_ivas->hSetOfHRTF, st_ivas->hHrtfStatistics, st_ivas->hDecoderConfig->output_Fs, ( st_ivas->hSplitBinRend == NULL ) ? 1 : st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses ) ) != IVAS_ERR_OK ) #else if ( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), st_ivas->intern_config, st_ivas->hDecoderConfig->output_config, st_ivas->hRenderConfig, st_ivas->hSetOfHRTF, st_ivas->hDecoderConfig->output_Fs, ( st_ivas->hSplitBinRend == NULL ) ? 1 : st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses ) ) != IVAS_ERR_OK ) #endif -- GitLab From 131285ed921310e71aee5de47b86e4bc028a73f9 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Wed, 11 Jun 2025 14:08:09 +0200 Subject: [PATCH 07/20] Add main to scripts repo to be able to retrieve new format HRTFs --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 251aae1b1..905fa361b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -235,6 +235,7 @@ stages: - cd $SCRIPTS_DIR - sed -i '/fetch/d' .git/config # Remove all fetch lines to clean out dead links - git remote set-branches --add origin "$BASOP_CI_BRANCH_PC_REPO" # Add currently used branch + - git remote set-branches --add origin main # Add main to be able to load new format HRTFs - git fetch - git restore . # Just as a precaution - git checkout "$BASOP_CI_BRANCH_PC_REPO" -- GitLab From 09e5ad8e14a7b03a236ace17b64c8f091156e42a Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Wed, 11 Jun 2025 19:14:58 +0200 Subject: [PATCH 08/20] Disable FIX_OLD_BINARY_FORMAT and FIX_OLD_BINARY_FILE --- lib_com/options.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 9b76d4793..24b8ae9dc 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -200,8 +200,8 @@ #ifdef FIX_638_ENERGIE_IAC_ROM_TABLES #define NONBE_FIX_AVG_IAC_CLDFB_REVERB #endif -#define FIX_OLD_BINARY_FORMAT /* Orange: trick to make tests succesful when changing hrtf binary format between ref and new branch*/ -#define FIX_OLD_BINARY_FILE /* Orange: current hrtf binary file in ref branch contains wrong values for fastconv value. This switch can be activated to compre running codec with and without hrtf file*/ +/*#define FIX_OLD_BINARY_FORMAT*/ /* Orange: trick to make tests succesful when changing hrtf binary format between ref and new branch*/ +/*#define FIX_OLD_BINARY_FILE*/ /* Orange: current hrtf binary file in ref branch contains wrong values for fastconv value. This switch can be activated to compre running codec with and without hrtf file*/ #define FIX_WARNING_RENDER_CONFIG /* Orange: fix warning on windows build */ #define FIX_INV_DIFFUSE_WEIGHT /* Orange : Fix error in energy compensation in late binaural */ #endif -- GitLab From 6ee403d24781ca1acc1361ad6a0562f4b385fafb Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Thu, 12 Jun 2025 15:02:19 +0200 Subject: [PATCH 09/20] Set HRTF model file version to 78154d0b (Feb 2024) --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 905fa361b..b2de7d8bc 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -244,7 +244,7 @@ stages: # Restore new format of HRTF binary - git fetch origin main - - git checkout origin/main -- scripts/binauralRenderer_interface/binaural_renderers_hrtf_data + - git checkout 78154d0b3f1b2c6c8ff8a234f3f7cf865d467d35 -- scripts/binauralRenderer_interface/binaural_renderers_hrtf_data - cd - - cp -r $SCRIPTS_DIR/ci . -- GitLab From f20103ae39de7030106d088b766194871443268c Mon Sep 17 00:00:00 2001 From: Jan Kiene Date: Mon, 16 Jun 2025 09:46:05 +0200 Subject: [PATCH 10/20] remove HRTF model from file testcases from BE check job --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0ba70b04f..1b05d9310 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2037,7 +2037,7 @@ ivas-pytest-on-merge-request: ### prepare pytest # create references - - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR -v --update_ref 1 + - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR -v --update_ref 1 -k "not model" ### Run test using branch scripts and input - if [ $ref_using_target == 1 ]; then git checkout $source_branch_commit_sha; fi @@ -2045,7 +2045,7 @@ ivas-pytest-on-merge-request: ### run pytest - exit_code=0 - testcase_timeout=60 - - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR -v --html=report.html --self-contained-html --junit-xml=report-junit.xml --testcase_timeout=$testcase_timeout || exit_code=$? + - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR -v --html=report.html --self-contained-html --junit-xml=report-junit.xml --testcase_timeout=$testcase_timeout -k "not model" || exit_code=$? - zero_errors=$(cat report-junit.xml | grep -c 'errors="0"') || true - *merge-request-comparison-check -- GitLab From e5d0806a725c1991fa26d96afb29b7d86de82fb9 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Tue, 17 Jun 2025 07:29:02 +0200 Subject: [PATCH 11/20] Add USE_NEW_HRTF_BINARY_FILE_FORMAT_FIXES to separate Non-BE fixes from activation of new HRTF file format --- lib_com/options.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib_com/options.h b/lib_com/options.h index 68149e222..41989178d 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -184,7 +184,8 @@ #define FIX_960_SYN_OUTPUT /* VA: issue 960: unused function syn_output() is removed */ #define USE_NEW_HRTF_BINARY_FILE_FORMAT /* Orange: to activate when decided to change the hrtf binary file format */ -#ifdef USE_NEW_HRTF_BINARY_FILE_FORMAT +/* #define USE_NEW_HRTF_BINARY_FILE_FORMAT_FIXES */ /* Additional fixes related to USE_NEW_HRTF_BINARY_FILE_FORMAT */ +#ifdef USE_NEW_HRTF_BINARY_FILE_FORMAT_FIXES #define NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES /* Philips: Use pre-computed HRTF average L/R energies and IAC in all renderers */ #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES #define FIX_638_ENERGIE_IAC_ROM_TABLES /* Orange: Missing left/right and coherence late reverb tables in binary format */ -- GitLab From 20073108ac9b770d85daeae21519a6130e200a3c Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Tue, 17 Jun 2025 07:51:59 +0200 Subject: [PATCH 12/20] Change setting on fixes for HRTF model file format --- lib_com/options.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 37aa7164e..d1e6fe52a 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -184,9 +184,8 @@ #define FIX_960_SYN_OUTPUT /* VA: issue 960: unused function syn_output() is removed */ #define USE_NEW_HRTF_BINARY_FILE_FORMAT /* Orange: to activate when decided to change the hrtf binary file format */ -/* #define USE_NEW_HRTF_BINARY_FILE_FORMAT_FIXES */ /* Additional fixes related to USE_NEW_HRTF_BINARY_FILE_FORMAT */ -#ifdef USE_NEW_HRTF_BINARY_FILE_FORMAT_FIXES -#define NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES /* Philips: Use pre-computed HRTF average L/R energies and IAC in all renderers */ +#ifdef USE_NEW_HRTF_BINARY_FILE_FORMAT +/* #define NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES */ /* Philips: Use pre-computed HRTF average L/R energies and IAC in all renderers */ #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES #define FIX_638_ENERGIE_IAC_ROM_TABLES /* Orange: Missing left/right and coherence late reverb tables in binary format */ #ifdef FIX_638_ENERGIE_IAC_ROM_TABLES -- GitLab From c708e13d2629e9f1dea8fa68c17f76d5ce70c7d4 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Tue, 17 Jun 2025 09:24:15 +0200 Subject: [PATCH 13/20] Re-enable NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES --- lib_com/options.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_com/options.h b/lib_com/options.h index d1e6fe52a..e6d8cade4 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -185,7 +185,7 @@ #define USE_NEW_HRTF_BINARY_FILE_FORMAT /* Orange: to activate when decided to change the hrtf binary file format */ #ifdef USE_NEW_HRTF_BINARY_FILE_FORMAT -/* #define NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES */ /* Philips: Use pre-computed HRTF average L/R energies and IAC in all renderers */ +#define NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES /* Philips: Use pre-computed HRTF average L/R energies and IAC in all renderers */ #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES #define FIX_638_ENERGIE_IAC_ROM_TABLES /* Orange: Missing left/right and coherence late reverb tables in binary format */ #ifdef FIX_638_ENERGIE_IAC_ROM_TABLES -- GitLab From c34b67a6627ca1468a16b98623733bfaf14cbaef Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Tue, 17 Jun 2025 16:54:28 +0200 Subject: [PATCH 14/20] Cleanup of switches in options.h --- lib_com/options.h | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index e6d8cade4..201b4ca4c 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -184,24 +184,17 @@ #define FIX_960_SYN_OUTPUT /* VA: issue 960: unused function syn_output() is removed */ #define USE_NEW_HRTF_BINARY_FILE_FORMAT /* Orange: to activate when decided to change the hrtf binary file format */ -#ifdef USE_NEW_HRTF_BINARY_FILE_FORMAT -#define NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES /* Philips: Use pre-computed HRTF average L/R energies and IAC in all renderers */ -#ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES -#define FIX_638_ENERGIE_IAC_ROM_TABLES /* Orange: Missing left/right and coherence late reverb tables in binary format */ -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES -#define NONBE_FIX_AVG_IAC_CLDFB_REVERB -#endif -#endif -#define FIX_638_ENERGIE_IAC_ROM_TABLES /* Orange: Missing left/right and coherence late reverb tables in binary format*/ -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES -#define NONBE_FIX_AVG_IAC_CLDFB_REVERB -#endif +#define USE_NEW_HRTF_BINARY_FILE_FORMAT_FIXES /* Fixes related to USE_NEW_HRTF_BINARY_FILE_FORMAT */ +#ifdef USE_NEW_HRTF_BINARY_FILE_FORMAT_FIXES +//#define NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES /* Philips: Use pre-computed HRTF average L/R energies and IAC in all renderers */ +#define FIX_638_ENERGIE_IAC_ROM_TABLES /* Orange: Missing left/right and coherence late reverb tables in binary format */ /*#define FIX_OLD_BINARY_FORMAT*/ /* Orange: trick to make tests succesful when changing hrtf binary format between ref and new branch*/ /*#define FIX_OLD_BINARY_FILE*/ /* Orange: current hrtf binary file in ref branch contains wrong values for fastconv value. This switch can be activated to compre running codec with and without hrtf file*/ -#define FIX_WARNING_RENDER_CONFIG /* Orange: fix warning on windows build */ +//#define FIX_WARNING_RENDER_CONFIG /* Orange: fix warning on windows build */ #define FIX_INV_DIFFUSE_WEIGHT /* Orange : Fix error in energy compensation in late binaural */ #endif + #define FIX_1002_DEC_PHASE_ECU_USAN_OF_PHASE /* Eri: issue #1002, usan-value-out-of-range-for-int16, kept BE for PLC-conditions */ //#define FIX_777_COMBI_RENDER_CONFIG_FILE /* Philips: Fix for combined renderer config file support */ #define NONBE_FIX_1004_USAN_DTX_MASA_NO_DIRS /* Nokia: fix USAN error caused by non-setting of correctly the number of MASA directions in DTX */ -- GitLab From 918221d46a80b0205702f6a7647c922ce39dae2e Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Wed, 18 Jun 2025 07:07:38 +0200 Subject: [PATCH 15/20] Clean up switches --- lib_com/options.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 201b4ca4c..3e6e26700 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -184,15 +184,12 @@ #define FIX_960_SYN_OUTPUT /* VA: issue 960: unused function syn_output() is removed */ #define USE_NEW_HRTF_BINARY_FILE_FORMAT /* Orange: to activate when decided to change the hrtf binary file format */ -#define USE_NEW_HRTF_BINARY_FILE_FORMAT_FIXES /* Fixes related to USE_NEW_HRTF_BINARY_FILE_FORMAT */ -#ifdef USE_NEW_HRTF_BINARY_FILE_FORMAT_FIXES //#define NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES /* Philips: Use pre-computed HRTF average L/R energies and IAC in all renderers */ #define FIX_638_ENERGIE_IAC_ROM_TABLES /* Orange: Missing left/right and coherence late reverb tables in binary format */ /*#define FIX_OLD_BINARY_FORMAT*/ /* Orange: trick to make tests succesful when changing hrtf binary format between ref and new branch*/ /*#define FIX_OLD_BINARY_FILE*/ /* Orange: current hrtf binary file in ref branch contains wrong values for fastconv value. This switch can be activated to compre running codec with and without hrtf file*/ -//#define FIX_WARNING_RENDER_CONFIG /* Orange: fix warning on windows build */ +#define FIX_WARNING_RENDER_CONFIG /* Orange: fix warning on windows build */ #define FIX_INV_DIFFUSE_WEIGHT /* Orange : Fix error in energy compensation in late binaural */ -#endif #define FIX_1002_DEC_PHASE_ECU_USAN_OF_PHASE /* Eri: issue #1002, usan-value-out-of-range-for-int16, kept BE for PLC-conditions */ -- GitLab From 3e499f8b85eea49c6165d5b303dfda1bc114d12c Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Wed, 18 Jun 2025 07:25:42 +0200 Subject: [PATCH 16/20] Enable NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES since it cannot be disabled in basop variant --- lib_com/options.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_com/options.h b/lib_com/options.h index 3e6e26700..295356d87 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -184,7 +184,7 @@ #define FIX_960_SYN_OUTPUT /* VA: issue 960: unused function syn_output() is removed */ #define USE_NEW_HRTF_BINARY_FILE_FORMAT /* Orange: to activate when decided to change the hrtf binary file format */ -//#define NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES /* Philips: Use pre-computed HRTF average L/R energies and IAC in all renderers */ +#define NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES /* Philips: Use pre-computed HRTF average L/R energies and IAC in all renderers */ #define FIX_638_ENERGIE_IAC_ROM_TABLES /* Orange: Missing left/right and coherence late reverb tables in binary format */ /*#define FIX_OLD_BINARY_FORMAT*/ /* Orange: trick to make tests succesful when changing hrtf binary format between ref and new branch*/ /*#define FIX_OLD_BINARY_FILE*/ /* Orange: current hrtf binary file in ref branch contains wrong values for fastconv value. This switch can be activated to compre running codec with and without hrtf file*/ -- GitLab From 91212866ac43b3930796ee4cdb9fb02ed38a03af Mon Sep 17 00:00:00 2001 From: marc emerit Date: Mon, 23 Jun 2025 14:27:44 +0200 Subject: [PATCH 17/20] tested, switchs USE_NEW_HRTF_BINARY_FILE_FORMAT, FIX_INV_DIFFUSE_WEIGHT, FIX_638_ENERGIE_IAC_ROM_TABLES and NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES --- apps/decoder.c | 13 +++--- apps/renderer.c | 4 -- lib_com/options.h | 9 ++-- lib_rend/ivas_hrtf.c | 4 ++ lib_util/hrtf_file_reader.c | 88 +++++++++++++++++-------------------- 5 files changed, 56 insertions(+), 62 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index db9c49695..70a3b5f9a 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -735,7 +735,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, hrtfReader ) ) != IVAS_ERR_OK ) { if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA ) @@ -744,7 +743,6 @@ int main( goto cleanup; } } -#endif #endif if ( ( error = IVAS_DEC_GetHrtfCRendHandle( hIvasDec, &hSetOfHRTF ) ) != IVAS_ERR_OK ) @@ -832,7 +830,6 @@ int main( #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES if ( ( error = IVAS_DEC_GetHrtfStatisticsHandle( hIvasDec, &hHrtfStatistics ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nIVAS_DEC_GetHrtfHandle failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); @@ -851,12 +848,14 @@ int main( } } #else - if ( ( hHrtfTD != NULL ) && ( error = load_reverb_binary( hHrtfTD, hrtfReader ) ) != IVAS_ERR_OK ) + if ( ( hHrtfTD != NULL ) && ( *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; + if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA ) + { + fprintf( stderr, "\nError in loading HRTF binary file %s \n\n", arg.hrtfFileName ); + goto cleanup; + } } -#endif #endif } diff --git a/apps/renderer.c b/apps/renderer.c index d65a7b68e..58b6fdbba 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -933,7 +933,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 ) @@ -942,7 +941,6 @@ int main( goto cleanup; } } -#endif #endif if ( ( error = IVAS_REND_GetHrtfCRendHandle( hIvasRend, &hSetOfHRTF ) ) != IVAS_ERR_OK ) @@ -1026,7 +1024,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" ); @@ -1044,7 +1041,6 @@ int main( destroy_hrtf_statistics( hHrtfStatistics ); } } -#endif #endif } diff --git a/lib_com/options.h b/lib_com/options.h index 295356d87..acbfe38e6 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -184,10 +184,11 @@ #define FIX_960_SYN_OUTPUT /* VA: issue 960: unused function syn_output() is removed */ #define USE_NEW_HRTF_BINARY_FILE_FORMAT /* Orange: to activate when decided to change the hrtf binary file format */ -#define NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES /* Philips: Use pre-computed HRTF average L/R energies and IAC in all renderers */ -#define FIX_638_ENERGIE_IAC_ROM_TABLES /* Orange: Missing left/right and coherence late reverb tables in binary format */ -/*#define FIX_OLD_BINARY_FORMAT*/ /* Orange: trick to make tests succesful when changing hrtf binary format between ref and new branch*/ -/*#define FIX_OLD_BINARY_FILE*/ /* Orange: current hrtf binary file in ref branch contains wrong values for fastconv value. This switch can be activated to compre running codec with and without hrtf file*/ +#ifdef USE_NEW_HRTF_BINARY_FILE_FORMAT +#define FIX_OLD_BINARY_FORMAT /* Orange: trick to make tests succesful when changing hrtf binary format between ref and new branch*/ +#endif +//#define NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES /* Philips: Use pre-computed HRTF average L/R energies and IAC in all renderers */ +//#define FIX_638_ENERGIE_IAC_ROM_TABLES /* Orange: Missing left/right and coherence late reverb tables in binary format */ #define FIX_WARNING_RENDER_CONFIG /* Orange: fix warning on windows build */ #define FIX_INV_DIFFUSE_WEIGHT /* Orange : Fix error in energy compensation in late binaural */ diff --git a/lib_rend/ivas_hrtf.c b/lib_rend/ivas_hrtf.c index a4168fc9f..4bb146e5a 100644 --- a/lib_rend/ivas_hrtf.c +++ b/lib_rend/ivas_hrtf.c @@ -38,7 +38,11 @@ #include "wmc_auto.h" #include "ivas_prot.h" #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES +#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES #include "ivas_rom_binaural_crend_head.h" +#else +#include "ivas_rom_rend.h" +#endif #endif /*-----------------------------------------------------------------------* diff --git a/lib_util/hrtf_file_reader.c b/lib_util/hrtf_file_reader.c index 1a0f1eaa0..80af6cfd8 100644 --- a/lib_util/hrtf_file_reader.c +++ b/lib_util/hrtf_file_reader.c @@ -38,6 +38,8 @@ #include "ivas_prot.h" #ifdef FIX_638_ENERGIE_IAC_ROM_TABLES #include "ivas_rom_binaural_crend_head.h" +#else +#include "ivas_rom_rend.h" #endif /*---------------------------------------------------------------------* @@ -191,7 +193,7 @@ static ivas_error check_hrtf_binary_header( { /* Check the renderer type */ -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES +#ifdef USE_NEW_HRTF_BINARY_FILE_FORMAT 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 ) && @@ -445,7 +447,7 @@ static ivas_error LoadBSplineBinary( LoadBSplineBinaryITD( &HrFiltSet_p->ModelParamsITD, f_hrtf ); } -#ifndef FIX_638_ENERGIE_IAC_ROM_TABLES +#ifndef USE_NEW_HRTF_BINARY_FILE_FORMAT /* left/right energy and interaural coherence for late reverb */ for ( i = 0; i < 3; i++ ) { @@ -462,7 +464,6 @@ static ivas_error LoadBSplineBinary( 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 +502,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,8 +558,6 @@ static ivas_error set_default_reverb_iac_energy( } #endif -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES - /*-------------------------------------------------------------------* * load_reverb_from_binary() * @@ -587,9 +584,7 @@ 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 if ( hHrtfStatistics == NULL ) #else @@ -600,6 +595,7 @@ static ivas_error load_reverb_from_binary( } lr_iac_len = LR_IAC_LENGTH_NR_FC; +#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB #ifdef NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES if ( sampleRate == 16000 ) #else @@ -647,7 +643,11 @@ static ivas_error load_reverb_from_binary( return header_check_result; } +#ifdef USE_NEW_HRTF_BINARY_FILE_FORMAT + is_reverb = ( hrtf_header.rend_type == HRTF_READER_RENDERER_BINAURAL_REVERB_ALL ); +#else is_reverb = ( hrtf_header.rend_type == HRTF_READER_RENDERER_BINAURAL_REVERB_ALL ); +#endif if ( !is_reverb ) { if ( fread( hrtf_data, 1, hrtf_header.data_size, f_hrtf ) != hrtf_header.data_size ) @@ -682,27 +682,13 @@ 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 ) ); -#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 } #endif } @@ -720,7 +706,6 @@ static ivas_error load_reverb_from_binary( return IVAS_ERR_OK; } -#endif /*---------------------------------------------------------------------* * load_reverb_binary() @@ -746,7 +731,6 @@ ivas_error load_reverb_binary( return load_reverb_from_binary( hHrtf, hrtfReader->file ); #endif } -#endif /*-------------------------------------------------------------------* * TDREND_MIX_LoadHRTF() @@ -822,7 +806,7 @@ static ivas_error TDREND_MIX_LoadHRTF( return header_check_result; } -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES +#ifdef USE_NEW_HRTF_BINARY_FILE_FORMAT is_tdrend = ( hrtf_header.rend_type == HRTF_READER_RENDERER_BINAURAL_OBJECTS_TD ); #else is_tdrend = ( hrtf_header.rend_type == RENDERER_BINAURAL_OBJECTS_TD ); @@ -1129,7 +1113,7 @@ static ivas_error create_HRTF_from_rawdata( ( *hHRTF )->index_frequency_max_diffuse = *( (uint16_t *) ( hrtf_data_rptr ) ); hrtf_data_rptr += sizeof( uint16_t ); - +#ifdef USE_NEW_HRTF_BINARY_FILE_FORMAT #ifdef FIX_INV_DIFFUSE_WEIGHT for ( i = 0; i < ( *hHRTF )->max_num_ir; i++ ) { @@ -1141,6 +1125,23 @@ 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 ); + } + hrtf_data_rptr += sizeof( float ) * ( *hHRTF )->max_num_ir; +#endif +#else +#ifdef FIX_INV_DIFFUSE_WEIGHT + /* inv_diffuse_weight */ + for ( i = 0; i < ( *hHRTF )->max_num_ir; i++ ) + { + ( *hHRTF )->inv_diffuse_weight[0][i] = *( (float *) ( hrtf_data_rptr ) ); + ( *hHRTF )->inv_diffuse_weight[1][i] = ( *hHRTF )->inv_diffuse_weight[0][i]; + hrtf_data_rptr += sizeof( float ); + } #else /* inv_diffuse_weight */ for ( i = 0; i < ( *hHRTF )->max_num_ir; i++ ) @@ -1149,6 +1150,7 @@ static ivas_error create_HRTF_from_rawdata( hrtf_data_rptr += sizeof( float ); } #endif +#endif #ifdef FIX_OLD_BINARY_FORMAT #ifdef FIX_INV_DIFFUSE_WEIGHT @@ -1270,7 +1272,7 @@ 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 +#ifdef USE_NEW_HRTF_BINARY_FILE_FORMAT HRTF_READER_RENDERER_TYPE rend_type, /* i : Renderer type */ #else RENDERER_TYPE rend_type, /* i : Renderer type */ @@ -1280,13 +1282,13 @@ static ivas_error create_fastconv_HRTF_from_rawdata( { int16_t i, j; char *hrtf_data_rptr; -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES +#ifdef USE_NEW_HRTF_BINARY_FILE_FORMAT ivas_error error; #endif ( *hHRTF )->allocate_init_flag = 0; -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES +#ifdef USE_NEW_HRTF_BINARY_FILE_FORMAT 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 ) @@ -1321,7 +1323,7 @@ static ivas_error create_fastconv_HRTF_from_rawdata( #endif /* HRIR */ -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES +#ifdef USE_NEW_HRTF_BINARY_FILE_FORMAT 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 ) @@ -1383,7 +1385,7 @@ static ivas_error create_fastconv_HRTF_from_rawdata( } } } -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES +#ifdef USE_NEW_HRTF_BINARY_FILE_FORMAT 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 ) @@ -1445,7 +1447,7 @@ static ivas_error create_fastconv_HRTF_from_rawdata( } } } -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES +#ifdef USE_NEW_HRTF_BINARY_FILE_FORMAT 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 ) @@ -1508,7 +1510,7 @@ static ivas_error create_fastconv_HRTF_from_rawdata( } } } -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES +#ifdef USE_NEW_HRTF_BINARY_FILE_FORMAT 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 ) @@ -1573,7 +1575,7 @@ static ivas_error create_fastconv_HRTF_from_rawdata( } } /* BRIR */ -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES +#ifdef USE_NEW_HRTF_BINARY_FILE_FORMAT 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 ) @@ -1642,18 +1644,10 @@ static ivas_error create_fastconv_HRTF_from_rawdata( } hrtf_data_rptr += sizeof( uint16_t ); -#ifdef FIX_OLD_BINARY_FILE // old binary file contains wrong value use default one instead - extern const Word32 fastconvReverberationTimes[CLDFB_NO_CHANNELS_MAX]; - memcpy( ( *hHRTF )->fastconvReverberationEneCorrections, hrtf_data_rptr, CLDFB_NO_CHANNELS_MAX * sizeof( float ) ); - hrtf_data_rptr += CLDFB_NO_CHANNELS_MAX * sizeof( float ); - memcpy( ( *hHRTF )->fastconvReverberationTimes, fastconvReverberationTimes, CLDFB_NO_CHANNELS_MAX * sizeof( float ) ); - hrtf_data_rptr += CLDFB_NO_CHANNELS_MAX * sizeof( float ); -#else memcpy( ( *hHRTF )->fastconvReverberationTimes, hrtf_data_rptr, CLDFB_NO_CHANNELS_MAX * sizeof( float ) ); hrtf_data_rptr += CLDFB_NO_CHANNELS_MAX * sizeof( float ); memcpy( ( *hHRTF )->fastconvReverberationEneCorrections, hrtf_data_rptr, CLDFB_NO_CHANNELS_MAX * sizeof( float ) ); hrtf_data_rptr += CLDFB_NO_CHANNELS_MAX * sizeof( float ); -#endif } return IVAS_ERR_OK; @@ -1710,7 +1704,7 @@ ivas_error load_fastconv_HRTF_from_binary( free( hrtf_data ); return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "HRTF binary file not compliant (number of HRTF)" ); } -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES +#ifdef USE_NEW_HRTF_BINARY_FILE_FORMAT 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 ) ) @@ -1872,7 +1866,7 @@ ivas_error load_parambin_HRTF_from_binary( } -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES +#ifdef USE_NEW_HRTF_BINARY_FILE_FORMAT 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 */ @@ -1966,7 +1960,7 @@ ivas_error create_SetOfHRTF_from_binary( hHRTF = NULL; if ( hrtf_header.frequency == output_Fs ) { -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES +#ifdef USE_NEW_HRTF_BINARY_FILE_FORMAT if ( hrtf_header.rend_type == HRTF_READER_RENDERER_BINAURAL_MIXER_CONV ) #else if ( hrtf_header.rend_type == RENDERER_BINAURAL_MIXER_CONV ) @@ -1989,7 +1983,7 @@ ivas_error create_SetOfHRTF_from_binary( hHRTF = &( ( *hSetOfHRTF ).hHRTF_hrir_foa ); } } -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES +#ifdef USE_NEW_HRTF_BINARY_FILE_FORMAT 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 ) -- GitLab From 639fd90d9f063109a8ed44ff7f8a42358d296f3f Mon Sep 17 00:00:00 2001 From: marc emerit Date: Mon, 23 Jun 2025 14:28:07 +0200 Subject: [PATCH 18/20] add missing change --- lib_util/hrtf_file_reader.h | 5 ----- 1 file changed, 5 deletions(-) diff --git a/lib_util/hrtf_file_reader.h b/lib_util/hrtf_file_reader.h index 673ce38b3..1ab193a34 100644 --- a/lib_util/hrtf_file_reader.h +++ b/lib_util/hrtf_file_reader.h @@ -46,8 +46,6 @@ typedef struct ivas_hrtfs_header_t uint32_t data_size; } ivas_hrtfs_header_t; - -#ifdef FIX_638_ENERGIE_IAC_ROM_TABLES typedef enum { HRTF_READER_RENDERER_BINAURAL_INVALID, @@ -60,7 +58,6 @@ typedef enum HRTF_READER_RENDERER_BINAURAL_MIXER_CONV_ROOM, HRTF_READER_RENDERER_BINAURAL_REVERB_ALL } HRTF_READER_RENDERER_TYPE; -#endif /*---------------------------------------------------------------------* * hrtfFileReader_open() @@ -94,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_binary() * @@ -110,7 +106,6 @@ ivas_error load_reverb_binary( #endif const hrtfFileReader *hrtfReader /* i/o: pointer to hrtfFileReader handle */ ); -#endif /*---------------------------------------------------------------------* * create_SetOfHRTF_from_binary() -- GitLab From a4386c04d739887eb3680e2b5a70013d68a94cac Mon Sep 17 00:00:00 2001 From: marc emerit Date: Mon, 23 Jun 2025 17:38:00 +0200 Subject: [PATCH 19/20] switch NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES is dependant from USE_NEW_HRTF_BINARY_FILE_FORMAT --- lib_com/options.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index acbfe38e6..3e25179ab 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -186,9 +186,9 @@ #define USE_NEW_HRTF_BINARY_FILE_FORMAT /* Orange: to activate when decided to change the hrtf binary file format */ #ifdef USE_NEW_HRTF_BINARY_FILE_FORMAT #define FIX_OLD_BINARY_FORMAT /* Orange: trick to make tests succesful when changing hrtf binary format between ref and new branch*/ -#endif //#define NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES /* Philips: Use pre-computed HRTF average L/R energies and IAC in all renderers */ -//#define FIX_638_ENERGIE_IAC_ROM_TABLES /* Orange: Missing left/right and coherence late reverb tables in binary format */ +#endif +#define FIX_638_ENERGIE_IAC_ROM_TABLES /* Orange: Missing left/right and coherence late reverb tables in binary format */ #define FIX_WARNING_RENDER_CONFIG /* Orange: fix warning on windows build */ #define FIX_INV_DIFFUSE_WEIGHT /* Orange : Fix error in energy compensation in late binaural */ -- GitLab From f9283f4ee922b988f673f67faa5c5ae069b6804b Mon Sep 17 00:00:00 2001 From: marc emerit Date: Mon, 23 Jun 2025 19:22:17 +0200 Subject: [PATCH 20/20] fin non BE reverb switch --- lib_com/options.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_com/options.h b/lib_com/options.h index 3e25179ab..4cd497a76 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -188,7 +188,7 @@ #define FIX_OLD_BINARY_FORMAT /* Orange: trick to make tests succesful when changing hrtf binary format between ref and new branch*/ //#define NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES /* Philips: Use pre-computed HRTF average L/R energies and IAC in all renderers */ #endif -#define FIX_638_ENERGIE_IAC_ROM_TABLES /* Orange: Missing left/right and coherence late reverb tables in binary format */ +//#define FIX_638_ENERGIE_IAC_ROM_TABLES /* Orange: Missing left/right and coherence late reverb tables in binary format */ #define FIX_WARNING_RENDER_CONFIG /* Orange: fix warning on windows build */ #define FIX_INV_DIFFUSE_WEIGHT /* Orange : Fix error in energy compensation in late binaural */ -- GitLab