Skip to content
Commits on Source (370)
...@@ -4,7 +4,7 @@ variables: ...@@ -4,7 +4,7 @@ variables:
BUILD_OUTPUT: "build_output.txt" BUILD_OUTPUT: "build_output.txt"
EVS_BE_TEST_DIR: "/usr/local/be_2_evs_test" EVS_BE_TEST_DIR: "/usr/local/be_2_evs_test"
EVS_BE_WIN_TEST_DIR: "C:/Users/gitlab-runner/testvec" EVS_BE_WIN_TEST_DIR: "C:/Users/gitlab-runner/testvec"
SANITIZER_TESTS: "CLANG1 CLANG2" SANITIZER_TESTS: "CLANG1 CLANG2 CLANG3"
OUT_FORMATS_CHANNEL_BASED: "stereo mono 5_1 5_1_2 5_1_4 7_1 7_1_4" OUT_FORMATS_CHANNEL_BASED: "stereo mono 5_1 5_1_2 5_1_4 7_1 7_1_4"
OUT_FORMATS_SCENE_BASED: "FOA HOA2 HOA3" OUT_FORMATS_SCENE_BASED: "FOA HOA2 HOA3"
OUT_FORMATS_BINAURAL: "BINAURAL BINAURAL_ROOM_IR BINAURAL_ROOM_REVERB" OUT_FORMATS_BINAURAL: "BINAURAL BINAURAL_ROOM_IR BINAURAL_ROOM_REVERB"
...@@ -244,6 +244,7 @@ stages: ...@@ -244,6 +244,7 @@ stages:
extends: .test-job-linux extends: .test-job-linux
before_script: before_script:
- if [ ! -d "$TESTV_DIR" ]; then mkdir -p $TESTV_DIR; fi - if [ ! -d "$TESTV_DIR" ]; then mkdir -p $TESTV_DIR; fi
- python3 scripts/prepare_combined_format_inputs.py
- cp -r scripts/testv/* $TESTV_DIR/ - cp -r scripts/testv/* $TESTV_DIR/
# --------------------------------------------------------------- # ---------------------------------------------------------------
...@@ -325,11 +326,12 @@ build-codec-instrumented-linux: ...@@ -325,11 +326,12 @@ build-codec-instrumented-linux:
extends: extends:
- .build-job-linux - .build-job-linux
- .rules-basis - .rules-basis
timeout: "6 minutes" timeout: "7 minutes"
script: script:
- *print-common-info - *print-common-info
- *activate-Werror-linux - *activate-Werror-linux
- bash ci/build_codec_instrumented_linux.sh - ./scripts/prepare_instrumentation.sh
- make -j -C scripts/c-code_instrument
# make sure that the codec builds with msan, asan and usan # make sure that the codec builds with msan, asan and usan
build-codec-sanitizers-linux: build-codec-sanitizers-linux:
...@@ -439,7 +441,7 @@ codec-smoke-test: ...@@ -439,7 +441,7 @@ codec-smoke-test:
# code selftest testvectors with memory-sanitizer binaries # code selftest testvectors with memory-sanitizer binaries
codec-msan: codec-msan:
extends: extends:
- .test-job-linux - .test-job-linux-needs-testv-dir
- .rules-merge-request - .rules-merge-request
stage: test stage: test
needs: ["build-codec-sanitizers-linux"] needs: ["build-codec-sanitizers-linux"]
...@@ -462,7 +464,7 @@ codec-msan: ...@@ -462,7 +464,7 @@ codec-msan:
# code selftest testvectors with address-sanitizer binaries # code selftest testvectors with address-sanitizer binaries
codec-asan: codec-asan:
extends: extends:
- .test-job-linux - .test-job-linux-needs-testv-dir
- .rules-merge-request - .rules-merge-request
stage: test stage: test
needs: ["build-codec-sanitizers-linux"] needs: ["build-codec-sanitizers-linux"]
...@@ -485,7 +487,7 @@ codec-asan: ...@@ -485,7 +487,7 @@ codec-asan:
# code selftest testvectors with address-sanitizer binaries # code selftest testvectors with address-sanitizer binaries
codec-usan: codec-usan:
extends: extends:
- .test-job-linux - .test-job-linux-needs-testv-dir
- .rules-merge-request - .rules-merge-request
stage: test stage: test
needs: ["build-codec-sanitizers-linux"] needs: ["build-codec-sanitizers-linux"]
...@@ -514,7 +516,8 @@ renderer-smoke-test: ...@@ -514,7 +516,8 @@ renderer-smoke-test:
stage: test stage: test
script: script:
- make -j IVAS_rend - make -j IVAS_rend
- python3 -m pytest -q -n auto -rA --junit-xml=report-junit.xml tests/renderer/test_renderer.py - testcase_timeout=60
- python3 -m pytest -q -n auto -rA --junit-xml=report-junit.xml tests/renderer/test_renderer.py --testcase_timeout=$testcase_timeout
artifacts: artifacts:
name: "mr-$CI_MERGE_REQUEST_IID--sha-$CI_COMMIT_SHORT_SHA--job-$CI_JOB_NAME--results" name: "mr-$CI_MERGE_REQUEST_IID--sha-$CI_COMMIT_SHORT_SHA--job-$CI_JOB_NAME--results"
expire_in: 1 week expire_in: 1 week
...@@ -536,7 +539,8 @@ renderer-asan: ...@@ -536,7 +539,8 @@ renderer-asan:
script: script:
- cmake -B cmake-build -G "Unix Makefiles" -DCLANG=asan -DCOPY_EXECUTABLES_FROM_BUILD_DIR=true - cmake -B cmake-build -G "Unix Makefiles" -DCLANG=asan -DCOPY_EXECUTABLES_FROM_BUILD_DIR=true
- cmake --build cmake-build -- -j - cmake --build cmake-build -- -j
- python3 -m pytest -q -n auto -rA --junit-xml=report-junit.xml tests/renderer/test_renderer.py - testcase_timeout=180
- python3 -m pytest -q -n auto -rA --junit-xml=report-junit.xml tests/renderer/test_renderer.py --testcase_timeout=$testcase_timeout
artifacts: artifacts:
name: "mr-$CI_MERGE_REQUEST_IID--sha-$CI_COMMIT_SHORT_SHA--job-$CI_JOB_NAME--results" name: "mr-$CI_MERGE_REQUEST_IID--sha-$CI_COMMIT_SHORT_SHA--job-$CI_JOB_NAME--results"
...@@ -559,7 +563,8 @@ renderer-msan: ...@@ -559,7 +563,8 @@ renderer-msan:
script: script:
- cmake -B cmake-build -G "Unix Makefiles" -DCLANG=msan -DCOPY_EXECUTABLES_FROM_BUILD_DIR=true - cmake -B cmake-build -G "Unix Makefiles" -DCLANG=msan -DCOPY_EXECUTABLES_FROM_BUILD_DIR=true
- cmake --build cmake-build -- -j - cmake --build cmake-build -- -j
- python3 -m pytest -q -n auto -rA --junit-xml=report-junit.xml tests/renderer/test_renderer.py - testcase_timeout=180
- python3 -m pytest -q -n auto -rA --junit-xml=report-junit.xml tests/renderer/test_renderer.py --testcase_timeout=$testcase_timeout
artifacts: artifacts:
name: "mr-$CI_MERGE_REQUEST_IID--sha-$CI_COMMIT_SHORT_SHA--job-$CI_JOB_NAME--results" name: "mr-$CI_MERGE_REQUEST_IID--sha-$CI_COMMIT_SHORT_SHA--job-$CI_JOB_NAME--results"
...@@ -582,7 +587,8 @@ renderer-usan: ...@@ -582,7 +587,8 @@ renderer-usan:
script: script:
- cmake -B cmake-build -G "Unix Makefiles" -DCLANG=usan -DCOPY_EXECUTABLES_FROM_BUILD_DIR=true - cmake -B cmake-build -G "Unix Makefiles" -DCLANG=usan -DCOPY_EXECUTABLES_FROM_BUILD_DIR=true
- cmake --build cmake-build -- -j - cmake --build cmake-build -- -j
- UBSAN_OPTIONS=suppressions=scripts/ubsan.supp,report_error_type=1,log_path=usan_log_catchall python3 -m pytest -q -n auto -rA --junit-xml=report-junit.xml tests/renderer/test_renderer.py - testcase_timeout=180
- UBSAN_OPTIONS=suppressions=scripts/ubsan.supp,report_error_type=1,log_path=usan_log_catchall python3 -m pytest -q -n auto -rA --junit-xml=report-junit.xml tests/renderer/test_renderer.py --testcase_timeout=$testcase_timeout
- grep_exit_code=0 - grep_exit_code=0
- touch usan_log_empty # Creates an empty file, this is to avoid "grep: usan_log_*: No such file or directory" in case no USAN failures are reported from pytest - touch usan_log_empty # Creates an empty file, this is to avoid "grep: usan_log_*: No such file or directory" in case no USAN failures are reported from pytest
- grep UndefinedBehaviorSanitizer usan_log_* || grep_exit_code=$? - grep UndefinedBehaviorSanitizer usan_log_* || grep_exit_code=$?
...@@ -602,7 +608,7 @@ renderer-usan: ...@@ -602,7 +608,7 @@ renderer-usan:
# compare renderer bitexactness between target and source branch # compare renderer bitexactness between target and source branch
renderer-pytest-on-merge-request: renderer-pytest-on-merge-request:
extends: extends:
- .test-job-linux - .test-job-linux-needs-testv-dir
- .rules-merge-request - .rules-merge-request
needs: ["build-codec-linux-make"] needs: ["build-codec-linux-make"]
# TODO: set reasonable timeout, will most likely take less # TODO: set reasonable timeout, will most likely take less
...@@ -624,13 +630,14 @@ renderer-pytest-on-merge-request: ...@@ -624,13 +630,14 @@ renderer-pytest-on-merge-request:
- if [ $ref_using_main == 0 ]; then git checkout $source_branch_commit_sha; fi - if [ $ref_using_main == 0 ]; then git checkout $source_branch_commit_sha; fi
- exit_code=0 - exit_code=0
- python3 -m pytest -q --log-level ERROR -n auto -rA --html=report.html --self-contained-html --junit-xml=report-junit.xml tests/renderer/test_renderer.py --create_ref || exit_code=$? - testcase_timeout=60
- python3 -m pytest -q --log-level ERROR -n auto -rA --html=report.html --self-contained-html --junit-xml=report-junit.xml tests/renderer/test_renderer.py --create_ref --testcase_timeout=$testcase_timeout || exit_code=$?
### Run test using branch scripts and input ### Run test using branch scripts and input
- if [ $ref_using_main == 1 ]; then git checkout $source_branch_commit_sha; fi - if [ $ref_using_main == 1 ]; then git checkout $source_branch_commit_sha; fi
# run test # run test
- python3 -m pytest -q --log-level ERROR -n auto -rA --html=report.html --self-contained-html --junit-xml=report-junit.xml tests/renderer/test_renderer_.py --create_cut || exit_code=$? - python3 -m pytest -q --log-level ERROR -n auto -rA --html=report.html --self-contained-html --junit-xml=report-junit.xml tests/renderer/test_renderer_.py --create_cut --testcase_timeout=$testcase_timeout || exit_code=$?
- zero_errors=$(cat report-junit.xml | grep -c 'errors="0"') || true - zero_errors=$(cat report-junit.xml | grep -c 'errors="0"') || true
- *merge-request-comparison-check - *merge-request-comparison-check
...@@ -660,7 +667,8 @@ split-rendering-smoke-test: ...@@ -660,7 +667,8 @@ split-rendering-smoke-test:
script: script:
- *enable-split-rendering - *enable-split-rendering
- make -j INCLUDE_SPLIT=1 - make -j INCLUDE_SPLIT=1
- python3 -m pytest -q -n auto -rA --junit-xml=report-junit.xml tests/split_rendering/test_split_rendering.py - testcase_timeout=10
- python3 -m pytest -q -n auto -rA --junit-xml=report-junit.xml tests/split_rendering/test_split_rendering.py --testcase_timeout=$testcase_timeout
artifacts: artifacts:
name: "mr-$CI_MERGE_REQUEST_IID--sha-$CI_COMMIT_SHORT_SHA--job-$CI_JOB_NAME--results" name: "mr-$CI_MERGE_REQUEST_IID--sha-$CI_COMMIT_SHORT_SHA--job-$CI_JOB_NAME--results"
expire_in: 1 week expire_in: 1 week
...@@ -675,7 +683,7 @@ split-rendering-smoke-test: ...@@ -675,7 +683,7 @@ split-rendering-smoke-test:
# compare split-rendering bitexactness between target and source branch # compare split-rendering bitexactness between target and source branch
split-rendering-pytest-on-merge-request: split-rendering-pytest-on-merge-request:
extends: extends:
- .test-job-linux - .test-job-linux-needs-testv-dir
- .rules-merge-request - .rules-merge-request
needs: ["build-codec-linux-make"] needs: ["build-codec-linux-make"]
# TODO: set reasonable timeout, will most likely take less # TODO: set reasonable timeout, will most likely take less
...@@ -710,7 +718,8 @@ split-rendering-pytest-on-merge-request: ...@@ -710,7 +718,8 @@ split-rendering-pytest-on-merge-request:
- if [ $ref_using_main == 0 ]; then git restore lib_com/options.h; fi # Revert changes back before checking out another branch to avoid conflicts - if [ $ref_using_main == 0 ]; then git restore lib_com/options.h; fi # Revert changes back before checking out another branch to avoid conflicts
- if [ $ref_using_main == 0 ]; then git checkout $source_branch_commit_sha; fi - if [ $ref_using_main == 0 ]; then git checkout $source_branch_commit_sha; fi
- exit_code=0 - exit_code=0
- python3 -m pytest -q --log-level ERROR -n auto -rA --html=report.html --self-contained-html --junit-xml=report-junit.xml tests/split_rendering/test_split_rendering.py --create_ref || exit_code=$? - testcase_timeout=60
- python3 -m pytest -q --log-level ERROR -n auto -rA --html=report.html --self-contained-html --junit-xml=report-junit.xml tests/split_rendering/test_split_rendering.py --create_ref --testcase_timeout=$testcase_timeout || exit_code=$?
# back to source branch # back to source branch
- git restore lib_com/options.h # Revert changes back before checking out another branch to avoid conflicts - git restore lib_com/options.h # Revert changes back before checking out another branch to avoid conflicts
...@@ -724,7 +733,7 @@ split-rendering-pytest-on-merge-request: ...@@ -724,7 +733,7 @@ split-rendering-pytest-on-merge-request:
- if [ $ref_using_main == 1 ]; then git checkout $source_branch_commit_sha; fi - if [ $ref_using_main == 1 ]; then git checkout $source_branch_commit_sha; fi
# run test # run test
- python3 -m pytest -q --log-level ERROR -n auto -rA --html=report.html --self-contained-html --junit-xml=report-junit.xml tests/split_rendering/test_split_rendering.py --create_cut || exit_code=$? - python3 -m pytest -q --log-level ERROR -n auto -rA --html=report.html --self-contained-html --junit-xml=report-junit.xml tests/split_rendering/test_split_rendering.py --create_cut --testcase_timeout=$testcase_timeout || exit_code=$?
- zero_errors=$(cat report-junit.xml | grep -c 'errors="0"') || true - zero_errors=$(cat report-junit.xml | grep -c 'errors="0"') || true
- *merge-request-comparison-check - *merge-request-comparison-check
...@@ -747,11 +756,11 @@ split-rendering-pytest-on-merge-request: ...@@ -747,11 +756,11 @@ split-rendering-pytest-on-merge-request:
# compare bit exactness between target and source branch # compare bit exactness between target and source branch
ivas-pytest-on-merge-request: ivas-pytest-on-merge-request:
extends: extends:
- .test-job-linux - .test-job-linux-needs-testv-dir
- .rules-merge-request - .rules-merge-request
stage: compare stage: compare
needs: ["build-codec-linux-cmake", "codec-smoke-test"] needs: ["build-codec-linux-cmake", "codec-smoke-test"]
timeout: "10 minutes" timeout: "14 minutes"
script: script:
- *print-common-info - *print-common-info
- *get-commits-behind-count - *get-commits-behind-count
...@@ -779,7 +788,8 @@ ivas-pytest-on-merge-request: ...@@ -779,7 +788,8 @@ ivas-pytest-on-merge-request:
### run pytest ### run pytest
- exit_code=0 - exit_code=0
- python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR -v --html=report.html --self-contained-html --junit-xml=report-junit.xml || exit_code=$? - 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=$?
- zero_errors=$(cat report-junit.xml | grep -c 'errors="0"') || true - zero_errors=$(cat report-junit.xml | grep -c 'errors="0"') || true
- *merge-request-comparison-check - *merge-request-comparison-check
...@@ -803,7 +813,7 @@ ivas-pytest-on-merge-request: ...@@ -803,7 +813,7 @@ ivas-pytest-on-merge-request:
# Check interop IVAS_cod_test -> IVAS_dec_ref # Check interop IVAS_cod_test -> IVAS_dec_ref
ivas-interop-on-merge-request: ivas-interop-on-merge-request:
extends: extends:
- .test-job-linux - .test-job-linux-needs-testv-dir
- .rules-merge-request - .rules-merge-request
stage: test stage: test
needs: ["build-codec-linux-cmake"] needs: ["build-codec-linux-cmake"]
...@@ -879,14 +889,15 @@ evs-pytest-on-merge-request: ...@@ -879,14 +889,15 @@ evs-pytest-on-merge-request:
### prepare pytest ### prepare pytest
# create references # create references
- python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR/test_param_file.py -v --update_ref 1 -m create_ref --param_file scripts/config/self_test_evs.prm - testcase_timeout=60
- python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR/test_param_file.py -v --update_ref 1 -m create_ref --param_file scripts/config/self_test_evs.prm --testcase_timeout=$testcase_timeout
### Run test using branch scripts and input ### Run test using branch scripts and input
- if [ $ref_using_main == 1 ]; then git checkout $source_branch_commit_sha; fi - if [ $ref_using_main == 1 ]; then git checkout $source_branch_commit_sha; fi
### run pytest for EVS cases ### run pytest for EVS cases
- exit_code=0 - exit_code=0
- python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR/test_param_file.py -v --param_file scripts/config/self_test_evs.prm --html=report.html --self-contained-html --junit-xml=report-junit-evs.xml || exit_code=$? - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR/test_param_file.py -v --param_file scripts/config/self_test_evs.prm --html=report.html --self-contained-html --junit-xml=report-junit-evs.xml --testcase_timeout=$testcase_timeout || exit_code=$?
- zero_errors=$(cat report-junit-evs.xml | grep -c 'errors="0"') || true - zero_errors=$(cat report-junit-evs.xml | grep -c 'errors="0"') || true
- *merge-request-comparison-check - *merge-request-comparison-check
...@@ -988,11 +999,11 @@ check-first-frame-is-sid: ...@@ -988,11 +999,11 @@ check-first-frame-is-sid:
# run all modes and cut bitstream to start with an SID. Use stereo output to limit runtime, test is only about decoding # run all modes and cut bitstream to start with an SID. Use stereo output to limit runtime, test is only about decoding
- ism_md_cmd="--ism_metadata_files /usr/local/ltv/ltvISM1.csv /usr/local/ltv/ltvISM2.csv /usr/local/ltv/ltvISM3.csv /usr/local/ltv/ltvISM4.csv" - ism_md_cmd="--ism_metadata_files /usr/local/ltv/ltvISM1.csv /usr/local/ltv/ltvISM2.csv /usr/local/ltv/ltvISM3.csv /usr/local/ltv/ltvISM4.csv"
- modes=$(scripts/runIvasCodec.py -l | grep dtx | grep -vE "FOA|HOA" ) - modes=$(scripts/runIvasCodec.py -l | grep dtx | grep -vE "FOA|HOA" )
- scripts/runIvasCodec.py -z console -p scripts/config/ci_linux_sidstart_test.json -m $modes -s --bs_length 200 -U 0:20 --oc stereo $ism_md_cmd || exit_code_no_sba=$? - scripts/runIvasCodec.py -z console -p scripts/config/ci_linux_sidstart_test.json -m $modes -s --bs_length 200 -U 0:20 --oc stereo $ism_md_cmd --timeout 10 || exit_code_no_sba=$?
- modes=$(scripts/runIvasCodec.py -l | grep dtx | grep -E "HOA") - modes=$(scripts/runIvasCodec.py -l | grep dtx | grep -E "HOA")
- scripts/runIvasCodec.py -z console -p scripts/config/ci_linux_sidstart_test.json -m $modes -s --bs_length 100 -U 70:80 --oc stereo || exit_code_hoa=$? - scripts/runIvasCodec.py -z console -p scripts/config/ci_linux_sidstart_test.json -m $modes -s --bs_length 100 -U 70:80 --oc stereo --timeout 10 || exit_code_hoa=$?
- modes=$(scripts/runIvasCodec.py -l | grep dtx | grep "FOA") - modes=$(scripts/runIvasCodec.py -l | grep dtx | grep "FOA")
- scripts/runIvasCodec.py -z console -p scripts/config/ci_linux_sidstart_test.json -m $modes -s --bs_length 100 -U 75:110 --oc stereo || exit_code_foa=$? - scripts/runIvasCodec.py -z console -p scripts/config/ci_linux_sidstart_test.json -m $modes -s --bs_length 100 -U 75:110 --oc stereo timeout 10 || exit_code_foa=$?
- if [ $exit_code_no_sba -ne 0 ] || [ $exit_code_hoa -ne 0 ] || [ $exit_code_hoa -ne 0 ]; then exit 1; fi - if [ $exit_code_no_sba -ne 0 ] || [ $exit_code_hoa -ne 0 ] || [ $exit_code_hoa -ne 0 ]; then exit 1; fi
artifacts: artifacts:
...@@ -1075,7 +1086,7 @@ be-2-evs-linux: ...@@ -1075,7 +1086,7 @@ be-2-evs-linux:
codec-comparison-on-main-push: codec-comparison-on-main-push:
extends: extends:
- .test-job-linux - .test-job-linux-needs-testv-dir
- .rules-main-push - .rules-main-push
stage: compare stage: compare
needs: ["build-codec-linux-cmake"] needs: ["build-codec-linux-cmake"]
...@@ -1128,15 +1139,16 @@ codec-comparison-on-main-push: ...@@ -1128,15 +1139,16 @@ codec-comparison-on-main-push:
- mv IVAS_cod_test IVAS_cod - mv IVAS_cod_test IVAS_cod
- mv IVAS_dec_test IVAS_dec - mv IVAS_dec_test IVAS_dec
# create references # create references
- python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR -v --update_ref 1 -m create_ref - testcase_timeout=60
- python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR -v --update_ref 1 -m create_ref_part2 - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR -v --update_ref 1 -m create_ref --testcase_timeout=$testcase_timeout
- python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR -v --update_ref 1 -m create_ref_part2 --testcase_timeout=$testcase_timeout
### re-checkout the latest commit here, if ref_using_main is set ### re-checkout the latest commit here, if ref_using_main is set
- if [ $ref_using_main -eq 1 ]; then git checkout $latest_commit;fi - if [ $ref_using_main -eq 1 ]; then git checkout $latest_commit;fi
### run pytest ### run pytest
- exit_code=0 - exit_code=0
- python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR -v --html=report.html --self-contained-html --junit-xml=report-junit.xml || 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 || exit_code=$?
- if [ $exit_code -eq 1 ] && [ $non_be_flag == 0 ]; then echo "pytest run had failures and non-BE flag not present"; exit $EXIT_CODE_FAIL; fi - if [ $exit_code -eq 1 ] && [ $non_be_flag == 0 ]; then echo "pytest run had failures and non-BE flag not present"; exit $EXIT_CODE_FAIL; fi
- zero_errors=$(cat report-junit.xml | grep -c 'errors="0"') || true - zero_errors=$(cat report-junit.xml | grep -c 'errors="0"') || true
- if [ $exit_code -eq 1 ] && [ $zero_errors == 1 ]; then echo "pytest run had failures, but no errors and non-BE flag present"; exit $EXIT_CODE_NON_BE; fi - if [ $exit_code -eq 1 ] && [ $zero_errors == 1 ]; then echo "pytest run had failures, but no errors and non-BE flag present"; exit $EXIT_CODE_NON_BE; fi
...@@ -1230,11 +1242,12 @@ test-long-self-test: ...@@ -1230,11 +1242,12 @@ test-long-self-test:
# create references # create references
- exit_code_ref=0 - exit_code_ref=0
- python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR/test_param_file.py -v --update_ref 1 -m create_ref --param_file scripts/config/self_test_ltv.prm || exit_code_ref=$? - testcase_timeout=300
- python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR/test_param_file.py -v --update_ref 1 -m create_ref --param_file scripts/config/self_test_ltv.prm --testcase_timeout=$testcase_timeout || exit_code_ref=$?
### run pytest self-test using long test vectors ### run pytest self-test using long test vectors
- exit_code=0 - exit_code=0
- python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR/test_param_file.py -v --param_file scripts/config/self_test_ltv.prm --html=report-ltv.html --self-contained-html --junit-xml=report-junit-ltv.xml || exit_code=$? - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR/test_param_file.py -v --param_file scripts/config/self_test_ltv.prm --html=report-ltv.html --self-contained-html --junit-xml=report-junit-ltv.xml --testcase_timeout=$testcase_timeout || exit_code=$?
- zero_errors=$(cat report-junit-ltv.xml | grep -c 'errors="0"') || true - zero_errors=$(cat report-junit-ltv.xml | grep -c 'errors="0"') || true
- if [ $zero_errors != 1 ]; then echo "Run errors encountered!"; exit $EXIT_CODE_FAIL; fi - if [ $zero_errors != 1 ]; then echo "Run errors encountered!"; exit $EXIT_CODE_FAIL; fi
...@@ -1267,10 +1280,11 @@ test-long-self-test: ...@@ -1267,10 +1280,11 @@ test-long-self-test:
- ivas-linux-fast - ivas-linux-fast
artifacts: artifacts:
name: "$CI_JOB_NAME--main--sha-$CI_COMMIT_SHORT_SHA" name: "$CI_JOB_NAME--main--sha-$CI_COMMIT_SHORT_SHA"
expire_in: 1 week expire_in: 2 weeks
when: always when: always
paths: paths:
- ep_015.g192 - ep_015.g192
- dly_profile.dat
- ./LOGS_PLC - ./LOGS_PLC
- ./LOGS_noPLC - ./LOGS_noPLC
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
### Bug description ### Bug description
Clang (msan/asan?) sanitizer test in pipeline found an error: Clang (m,a,u)san sanitizer test in pipeline found an error:
<!--- Copy sanitizer traceback from command line here --> <!--- Copy sanitizer traceback from command line here -->
``` ```
...@@ -20,7 +20,7 @@ Using the [scripts](https://forge.3gpp.org/rep/ivas-codec-pc/ivas-codec/-/wikis/ ...@@ -20,7 +20,7 @@ Using the [scripts](https://forge.3gpp.org/rep/ivas-codec-pc/ivas-codec/-/wikis/
<!--- check correct sanitizer type --> <!--- check correct sanitizer type -->
<!--- add error pattern if needed --> <!--- add error pattern if needed -->
``` ```
python3 scripts/IvasBuildAndRunChecks.py --checks CLANGX -m MODE -p /path/to/my/local/ci_linux_ltv_local.json python3 scripts/IvasBuildAndRunChecks.py --checks CLANGX -m MODE -p /path/to/my/local/ci_linux_ltv_local.json --usan_supp_file scripts/ubsan.supp
``` ```
or directly: or directly:
......
...@@ -196,6 +196,10 @@ int main( ...@@ -196,6 +196,10 @@ int main(
RenderConfigReader *renderConfigReader = NULL; RenderConfigReader *renderConfigReader = NULL;
int16_t *pcmBuf = NULL; int16_t *pcmBuf = NULL;
IVAS_RENDER_FRAMESIZE asked_frame_size; 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;
#endif
#ifdef DEBUGGING #ifdef DEBUGGING
int32_t noClipping; int32_t noClipping;
int32_t cnt_frames_limited; int32_t cnt_frames_limited;
...@@ -708,58 +712,142 @@ int main( ...@@ -708,58 +712,142 @@ int main(
if ( arg.hrtfReaderEnabled ) if ( arg.hrtfReaderEnabled )
{ {
#ifndef NONBE_FIX_BINARY_BINAURAL_READING
IVAS_DEC_HRTF_HANDLE hHrtfTD = NULL; IVAS_DEC_HRTF_HANDLE hHrtfTD = NULL;
#endif
if ( ( error = IVAS_DEC_GetHrtfHandle( hIvasDec, &hHrtfTD ) ) != IVAS_ERR_OK ) if ( ( error = IVAS_DEC_GetHrtfHandle( hIvasDec, &hHrtfTD ) ) != IVAS_ERR_OK )
{ {
fprintf( stderr, "\nIVAS_DEC_GetHrtfHandle failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); fprintf( stderr, "\nIVAS_DEC_GetHrtfHandle failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) );
goto cleanup; 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 )
{
fprintf( stderr, "\nError in loading HRTF binary file %s \n\n", arg.hrtfFileName );
goto cleanup;
}
else
{
destroy_td_hrtf( hHrtfTD );
}
}
#else
if ( ( error = load_HRTF_binary( hHrtfTD, hrtfReader ) ) != IVAS_ERR_OK ) if ( ( error = load_HRTF_binary( hHrtfTD, hrtfReader ) ) != IVAS_ERR_OK )
{ {
fprintf( stderr, "\nError in loading HRTF binary file %s \n\n", arg.hrtfFileName ); fprintf( stderr, "\nError in loading HRTF binary file %s \n\n", arg.hrtfFileName );
goto cleanup; goto cleanup;
} }
#endif
#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 )
{
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;
}
}
#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; IVAS_DEC_HRTF_CREND_HANDLE hSetOfHRTF = NULL;
#endif
if ( ( error = IVAS_DEC_GetHrtfCRendHandle( hIvasDec, &hSetOfHRTF ) ) != IVAS_ERR_OK ) if ( ( error = IVAS_DEC_GetHrtfCRendHandle( hIvasDec, &hSetOfHRTF ) ) != IVAS_ERR_OK )
{ {
fprintf( stderr, "\nIVAS_DEC_GetHrtfCRendHandle failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); fprintf( stderr, "\nIVAS_DEC_GetHrtfCRendHandle failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) );
goto cleanup; goto cleanup;
} }
if ( ( error = create_SetOfHRTF_from_binary( hSetOfHRTF, hrtfReader, arg.output_Fs ) ) != IVAS_ERR_OK ) #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 )
{ {
fprintf( stderr, "\nError in loading HRTF binary file %s for CRend \n\n", arg.hrtfFileName ); fprintf( stderr, "\nError in loading HRTF binary file %s \n\n", arg.hrtfFileName );
goto cleanup; goto cleanup;
} }
else
{
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; IVAS_DEC_HRTF_FASTCONV_HANDLE hHrtfFastConv = NULL;
#endif
if ( ( error = IVAS_DEC_GetHrtfFastConvHandle( hIvasDec, &hHrtfFastConv ) ) != IVAS_ERR_OK ) if ( ( error = IVAS_DEC_GetHrtfFastConvHandle( hIvasDec, &hHrtfFastConv ) ) != IVAS_ERR_OK )
{ {
fprintf( stderr, "\nIVAS_DEC_GetHrtfFastConvHandle failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); fprintf( stderr, "\nIVAS_DEC_GetHrtfFastConvHandle failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) );
goto cleanup; 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 )
{
fprintf( stderr, "\nError in loading HRTF binary file %s \n\n", arg.hrtfFileName );
goto cleanup;
}
else
{
destroy_fastconv_hrtf( hHrtfFastConv );
}
}
#else
if ( ( error = load_fastconv_HRTF_from_binary( hHrtfFastConv, hrtfReader ) ) != IVAS_ERR_OK ) 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 ); fprintf( stderr, "\nError in loading HRTF binary file %s for FastConv \n\n", arg.hrtfFileName );
goto cleanup; goto cleanup;
} }
#endif
#ifdef NONBE_FIX_BINARY_BINAURAL_READING
IVAS_DEC_HRTF_PARAMBIN_HANDLE *hHrtfParambin = NULL;
#else
IVAS_DEC_HRTF_PARAMBIN_HANDLE hHrtfParambin = NULL; IVAS_DEC_HRTF_PARAMBIN_HANDLE hHrtfParambin = NULL;
#endif
if ( ( error = IVAS_DEC_GetHrtfParamBinHandle( hIvasDec, &hHrtfParambin ) ) != IVAS_ERR_OK ) if ( ( error = IVAS_DEC_GetHrtfParamBinHandle( hIvasDec, &hHrtfParambin ) ) != IVAS_ERR_OK )
{ {
fprintf( stderr, "\nIVAS_DEC_GetHrtfParamBinHandle failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); fprintf( stderr, "\nIVAS_DEC_GetHrtfParamBinHandle failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) );
goto cleanup; 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 )
{
fprintf( stderr, "\nError in loading HRTF binary file %s \n\n", arg.hrtfFileName );
goto cleanup;
}
else
{
destroy_parambin_hrtf( hHrtfParambin );
}
}
#else
if ( ( error = load_parambin_HRTF_from_binary( hHrtfParambin, hrtfReader ) ) != IVAS_ERR_OK ) 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 ); fprintf( stderr, "\nError in loading HRTF binary file %s for parametric binauralizer \n\n", arg.hrtfFileName );
goto cleanup; goto cleanup;
} }
#endif
} }
/*------------------------------------------------------------------------------------------* /*------------------------------------------------------------------------------------------*
...@@ -836,10 +924,19 @@ cleanup: ...@@ -836,10 +924,19 @@ cleanup:
#endif #endif
if ( arg.hrtfReaderEnabled ) if ( arg.hrtfReaderEnabled )
{ {
#ifndef NONBE_FIX_BINARY_BINAURAL_READING
IVAS_DEC_HRTF_HANDLE hHrtfTD = NULL; IVAS_DEC_HRTF_HANDLE hHrtfTD = NULL;
#endif
IVAS_DEC_GetHrtfHandle( hIvasDec, &hHrtfTD ); IVAS_DEC_GetHrtfHandle( hIvasDec, &hHrtfTD );
#ifdef NONBE_FIX_BINARY_BINAURAL_READING
destroy_td_hrtf( hHrtfTD );
#else
dealloc_HRTF_binary( hHrtfTD ); dealloc_HRTF_binary( hHrtfTD );
#endif
#ifndef NONBE_FIX_BINARY_BINAURAL_READING
IVAS_DEC_HRTF_CREND_HANDLE hSetOfHRTF = NULL; IVAS_DEC_HRTF_CREND_HANDLE hSetOfHRTF = NULL;
#endif
IVAS_DEC_GetHrtfCRendHandle( hIvasDec, &hSetOfHRTF ); IVAS_DEC_GetHrtfCRendHandle( hIvasDec, &hSetOfHRTF );
destroy_SetOfHRTF( hSetOfHRTF ); destroy_SetOfHRTF( hSetOfHRTF );
} }
...@@ -1492,7 +1589,23 @@ static bool parseCmdlIVAS_dec( ...@@ -1492,7 +1589,23 @@ static bool parseCmdlIVAS_dec(
* Mandatory input arguments * Mandatory input arguments
*-----------------------------------------------------------------*/ *-----------------------------------------------------------------*/
if ( i < argc - 3 ) if ( i < argc - 4 )
{
for ( i = 1; i < argc; i++ )
{
if ( argv[i][0] == '-' )
{
fprintf( stderr, "Error: Wrong order of command-line arguments (optional arguments are first)\n\n" );
usage_dec();
return false;
}
}
fprintf( stderr, "Error: Too many mandatory command-line arguments\n\n" );
usage_dec();
return false;
}
else if ( i < argc - 3 )
{ {
arg->outputConfig = cmdline2config( argv[i] ); arg->outputConfig = cmdline2config( argv[i] );
if ( arg->outputConfig == IVAS_AUDIO_CONFIG_LS_CUSTOM ) if ( arg->outputConfig == IVAS_AUDIO_CONFIG_LS_CUSTOM )
......
...@@ -743,6 +743,12 @@ int main( ...@@ -743,6 +743,12 @@ int main(
#endif #endif
Vector3PairFileReader *referenceVectorReader = NULL; Vector3PairFileReader *referenceVectorReader = NULL;
hrtfFileReader *hrtfFileReader = 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;
#endif
IsmPositionProvider *positionProvider; IsmPositionProvider *positionProvider;
LfeRoutingConfig *lfeRoutingConfigs[RENDERER_MAX_MC_INPUTS]; LfeRoutingConfig *lfeRoutingConfigs[RENDERER_MAX_MC_INPUTS];
RenderConfigReader *renderConfigReader = NULL; RenderConfigReader *renderConfigReader = NULL;
...@@ -762,7 +768,7 @@ int main( ...@@ -762,7 +768,7 @@ int main(
int16_t *outInt16Buffer; int16_t *outInt16Buffer;
float *outFloatBuffer; float *outFloatBuffer;
#ifdef SPLIT_REND_WITH_HEAD_ROT #ifdef SPLIT_REND_WITH_HEAD_ROT
uint8_t *bitsBufferData; uint8_t *bitsBufferData = NULL;
#endif #endif
IVAS_REND_AudioBuffer inBuffer; IVAS_REND_AudioBuffer inBuffer;
IVAS_REND_AudioBuffer outBuffer; IVAS_REND_AudioBuffer outBuffer;
...@@ -795,6 +801,10 @@ int main( ...@@ -795,6 +801,10 @@ int main(
#ifdef SPLIT_REND_WITH_HEAD_ROT #ifdef SPLIT_REND_WITH_HEAD_ROT
hSplitRendFileReadWrite = NULL; hSplitRendFileReadWrite = NULL;
#ifdef NONBE_FIX_BINARY_BINAURAL_READING
CLDFBframeSize_smpls = 0;
cldfb_in_flag = 0;
#endif
#endif #endif
for ( i = 0; i < RENDERER_MAX_MC_INPUTS; ++i ) for ( i = 0; i < RENDERER_MAX_MC_INPUTS; ++i )
{ {
...@@ -868,6 +878,7 @@ int main( ...@@ -868,6 +878,7 @@ int main(
} }
} }
#ifndef NONBE_FIX_BINARY_BINAURAL_READING
if ( !isEmptyString( args.customHrtfFilePath ) ) if ( !isEmptyString( args.customHrtfFilePath ) )
{ {
if ( hrtfFileReader_open( args.customHrtfFilePath, &hrtfFileReader ) != IVAS_ERR_OK ) if ( hrtfFileReader_open( args.customHrtfFilePath, &hrtfFileReader ) != IVAS_ERR_OK )
...@@ -876,6 +887,7 @@ int main( ...@@ -876,6 +887,7 @@ int main(
exit( -1 ); exit( -1 );
} }
} }
#endif
if ( !isEmptyString( args.renderConfigFilePath ) ) if ( !isEmptyString( args.renderConfigFilePath ) )
{ {
...@@ -1001,24 +1013,132 @@ int main( ...@@ -1001,24 +1013,132 @@ int main(
#endif #endif
const int16_t frameSize_smpls = (int16_t) ( ( args.render_framesize ) * args.sampleRate * 5 / ( 1000 ) ); 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 ) 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 ) ); fprintf( stderr, "Error opening renderer handle: %s\n", ivas_error_to_string( error ) );
exit( -1 ); exit( -1 );
} }
#ifdef 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 );
}
if ( hrtfFileReader != NULL )
{
if ( ( error = IVAS_REND_GetHrtfHandle( hIvasRend, &hHrtfTD ) ) != IVAS_ERR_OK )
{
fprintf( stderr, "\nIVAS_REND_GetHrtfHandle failed: %s\n\n", ivas_error_to_string( error ) );
goto cleanup;
}
if ( ( error = load_HRTF_binary( *hHrtfTD, hrtfFileReader ) ) != IVAS_ERR_OK )
{
if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA )
{
fprintf( stderr, "\nError in loading HRTF binary file %s: %s \n\n", args.customHrtfFilePath, ivas_error_to_string( error ) );
goto cleanup;
}
else
{
destroy_td_hrtf( hHrtfTD );
}
}
#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 )
{
fprintf( stderr, "\nError in loading HRTF binary file %s: %s \n\n", args.customHrtfFilePath, ivas_error_to_string( error ) );
goto cleanup;
}
}
#endif
if ( ( error = IVAS_REND_GetHrtfCRendHandle( hIvasRend, &hSetOfHRTF ) ) != IVAS_ERR_OK )
{
fprintf( stderr, "\nIVAS_Rend_GetHrtfCRendHandle failed: %s\n\n", ivas_error_to_string( error ) );
goto cleanup;
}
if ( ( error = create_SetOfHRTF_from_binary( *hSetOfHRTF, hrtfFileReader, args.sampleRate ) ) != IVAS_ERR_OK )
{
if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA )
{
fprintf( stderr, "\nError in loading HRTF binary file %s:%s \n\n", args.customHrtfFilePath, ivas_error_to_string( error ) );
goto cleanup;
}
else
{
destroy_SetOfHRTF( hSetOfHRTF );
}
}
if ( ( error = IVAS_REND_GetHrtfFastConvHandle( hIvasRend, &hHrtfFastConv ) ) != IVAS_ERR_OK )
{
fprintf( stderr, "\nIVAS_REND_GetHrtfFastConvHandle failed: %s\n\n", ivas_error_to_string( error ) );
goto cleanup;
}
if ( ( error = load_fastconv_HRTF_from_binary( *hHrtfFastConv, hrtfFileReader ) ) != IVAS_ERR_OK )
{
if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA )
{
fprintf( stderr, "\nError in loading HRTF binary file %s:%s \n\n", args.customHrtfFilePath, ivas_error_to_string( error ) );
goto cleanup;
}
else
{
destroy_fastconv_hrtf( hHrtfFastConv );
}
}
if ( ( error = IVAS_REND_GetHrtfParamBinHandle( hIvasRend, &hHrtfParambin ) ) != IVAS_ERR_OK )
{
fprintf( stderr, "\nIVAS_DEC_GetHrtfParamBinHandle failed: %s\n\n", ivas_error_to_string( error ) );
goto cleanup;
}
if ( ( error = load_parambin_HRTF_from_binary( *hHrtfParambin, hrtfFileReader ) ) != IVAS_ERR_OK )
{
if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA )
{
fprintf( stderr, "\nError in loading HRTF binary file %s: %s \n\n", args.customHrtfFilePath, ivas_error_to_string( error ) );
goto cleanup;
}
else
{
destroy_parambin_hrtf( hHrtfParambin );
}
}
}
hrtfFileReader_close( &hrtfFileReader );
}
#endif
/* === Configure === */ /* === Configure === */
if ( ( error = IVAS_REND_InitConfig( hIvasRend, args.outConfig.audioConfig ) ) != IVAS_ERR_OK ) if ( ( error = IVAS_REND_InitConfig( hIvasRend, args.outConfig.audioConfig ) ) != IVAS_ERR_OK )
{ {
fprintf( stderr, "Error in Renderer Config Init\n" ); fprintf( stderr, "Error in Renderer Config Init: %s\n", ivas_error_to_string( error ) );
exit( -1 ); exit( -1 );
} }
#ifndef NONBE_FIX_BINARY_BINAURAL_READING
#ifdef SPLIT_REND_WITH_HEAD_ROT #ifdef SPLIT_REND_WITH_HEAD_ROT
CLDFBframeSize_smpls = 0; CLDFBframeSize_smpls = 0;
cldfb_in_flag = 0; cldfb_in_flag = 0;
#endif #endif
#endif
if ( args.renderConfigFilePath[0] != '\0' ) if ( args.renderConfigFilePath[0] != '\0' )
{ {
IVAS_RENDER_CONFIG_DATA renderConfig; IVAS_RENDER_CONFIG_DATA renderConfig;
...@@ -2079,6 +2199,11 @@ int main( ...@@ -2079,6 +2199,11 @@ int main(
free( inFloatBuffer ); free( inFloatBuffer );
free( outInt16Buffer ); free( outInt16Buffer );
free( outFloatBuffer ); free( outFloatBuffer );
#ifdef NONBE_FIX_BINARY_BINAURAL_READING
cleanup:
#endif
#ifdef SPLIT_REND_WITH_HEAD_ROT #ifdef SPLIT_REND_WITH_HEAD_ROT
if ( bitsBufferData != NULL ) if ( bitsBufferData != NULL )
{ {
...@@ -2110,7 +2235,13 @@ int main( ...@@ -2110,7 +2235,13 @@ int main(
RotationFileReader_close( &externalOrientationFileReader ); RotationFileReader_close( &externalOrientationFileReader );
RotationFileReader_close( &referenceRotReader ); RotationFileReader_close( &referenceRotReader );
Vector3PairFileReader_close( &referenceVectorReader ); Vector3PairFileReader_close( &referenceVectorReader );
#ifndef NONBE_FIX_BINARY_BINAURAL_READING
hrtfFileReader_close( &hrtfFileReader ); hrtfFileReader_close( &hrtfFileReader );
#endif
#ifdef NONBE_FIX_BINARY_BINAURAL_READING
destroy_td_hrtf( hHrtfTD );
destroy_SetOfHRTF( hSetOfHRTF );
#endif
IVAS_REND_Close( &hIvasRend ); IVAS_REND_Close( &hIvasRend );
IsmPositionProvider_close( positionProvider ); IsmPositionProvider_close( positionProvider );
RenderConfigReader_close( &renderConfigReader ); RenderConfigReader_close( &renderConfigReader );
......
#!/usr/bin/env python3
"""
(C) 2022-2023 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB,
Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD.,
Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange,
Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other
contributors to this repository. All Rights Reserved.
This software is protected by copyright law and by international treaties.
The IVAS codec Public Collaboration consisting of Dolby International AB, Ericsson AB,
Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD.,
Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange,
Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other
contributors to this repository retain full ownership rights in their respective contributions in
the software. This notice grants no license of any kind, including but not limited to patent
license, nor is any license granted by implication, estoppel or otherwise.
Contributors are required to enter into the IVAS codec Public Collaboration agreement before making
contributions.
This software is provided "AS IS", without any express or implied warranties. The software is in the
development stage. It is intended exclusively for experts who have experience with such software and
solely for the purpose of inspection. All implied warranties of non-infringement, merchantability
and fitness for a particular purpose are hereby disclaimed and excluded.
Any dispute, controversy or claim arising under or in relation to providing this software shall be
submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in
accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and
the United Nations Convention on Contracts on the International Sales of Goods.
"""
import argparse
import numpy as np
ERR_MAGIC_NUM_DLY_PROF = -1
ERR_MAGIC_NUM_G192 = 27424
def combine_error_profiles(genpatt_file, jbm_dly_profile, output_file):
ep = np.fromfile(genpatt_file, dtype="int16")
with open(jbm_dly_profile) as f:
dly = np.asarray([int(l.strip()) for l in f.readlines()])
# if one wants to differently-sized files, add wraparound/shorten logic here
# in ci, file lengths will match
assert len(ep) == len(dly)
# remove lost frames already in the dly profile
# replace with no delay (not there in the profile files, except the all-zero one)
err_idx = np.where(dly == ERR_MAGIC_NUM_DLY_PROF)[0]
dly[err_idx] = 0
# insert lost frames based on .g192 file
err_idx = np.where(ep == ERR_MAGIC_NUM_G192)[0]
dly[err_idx] = -1
with open(output_file, "w") as f:
for d in dly:
f.write(f"{int(d)}\n")
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("genpatt_file")
parser.add_argument("jbm_dly_profile")
parser.add_argument("output_file")
args = parser.parse_args()
combine_error_profiles(**vars(args))
...@@ -40,18 +40,22 @@ from collect_artifacts import ( ...@@ -40,18 +40,22 @@ from collect_artifacts import (
find_failed_files_for_sanitizer_test, find_failed_files_for_sanitizer_test,
collect_for_sanitizer_test, collect_for_sanitizer_test,
) )
from combine_genpatt_and_jbm_profile import combine_error_profiles
SCRIPT_DIR = pathlib.Path("./scripts").resolve()
DURATION = "120" DURATION = "120"
CFG = "ci_linux_ltv.json" CFG = "ci_linux_ltv.json"
SUPPORTED_TESTS = ["CLANG1", "CLANG2", "CLANG3", "VALGRIND"] SUPPORTED_TESTS = ["CLANG1", "CLANG2", "CLANG3"]
USAN_SUPP_FILE = str(SCRIPT_DIR.joinpath("ubsan.supp"))
EP_FILE = "ep_015.g192" EP_FILE = "ep_015.g192"
GENPATT_CMD = f"gen-patt -tailstat -fer -g192 -gamma 0 -rate 0.15 -tol 0.001 -reset -n {int(DURATION) * 50} {EP_FILE}" DLY_PROFILE_IN = SCRIPT_DIR.joinpath("dly_error_profiles/dly_error_profile_5.dat")
EIDXOR_CMD = "eid-xor -vbr -fer {bitstream} {ep_file} {out_file}" DLY_PROFILE_OUT = "dly_profile.dat"
N_FRAMES_DLY_PROFILE = 7500
GENPATT_CMD = f"gen-patt -tailstat -fer -g192 -gamma 0 -rate 0.15 -tol 0.001 -reset -n {N_FRAMES_DLY_PROFILE} {EP_FILE}"
MC_MODES = ["5_1", "5_1_2", "5_1_4", "7_1", "7_1_4"] MC_MODES = ["5_1", "5_1_2", "5_1_4", "7_1", "7_1_4"]
AMBISONICS_MODES = ["HOA3", "HOA2", "FOA", "PlanarHOA3", "PlanarHOA2", "PlanarFOA"] AMBISONICS_MODES = ["HOA3", "HOA2", "FOA", "PlanarHOA3", "PlanarHOA2", "PlanarFOA"]
TIMEOUT = 60 * 15 # timeout of 15 minutes per en/decoding to safeguard against endless loops
SCRIPT_DIR = pathlib.Path("./scripts").resolve()
CONSOLE_OUT_FILE = "output_san.txt" CONSOLE_OUT_FILE = "output_san.txt"
...@@ -143,6 +147,10 @@ def run_check(in_format: str, out_formats: list, tests: list, run_fec: bool = Tr ...@@ -143,6 +147,10 @@ def run_check(in_format: str, out_formats: list, tests: list, run_fec: bool = Tr
"--oc", "--oc",
*out_formats, *out_formats,
*md_file_command, *md_file_command,
"--usan_supp_file",
USAN_SUPP_FILE,
"--timeout",
str(TIMEOUT),
] ]
print( print(
...@@ -186,6 +194,7 @@ def run_check(in_format: str, out_formats: list, tests: list, run_fec: bool = Tr ...@@ -186,6 +194,7 @@ def run_check(in_format: str, out_formats: list, tests: list, run_fec: bool = Tr
# generate error pattern # generate error pattern
subprocess.call(GENPATT_CMD.split()) subprocess.call(GENPATT_CMD.split())
combine_error_profiles(EP_FILE, DLY_PROFILE_IN, DLY_PROFILE_OUT)
# cleanup to avoid script errors # cleanup to avoid script errors
# we want "logs" and "dec" subfolders to be empty -> delete "dec" and rename "log" # we want "logs" and "dec" subfolders to be empty -> delete "dec" and rename "log"
...@@ -203,10 +212,10 @@ def run_check(in_format: str, out_formats: list, tests: list, run_fec: bool = Tr ...@@ -203,10 +212,10 @@ def run_check(in_format: str, out_formats: list, tests: list, run_fec: bool = Tr
# need empty log folder to avoid crashes # need empty log folder to avoid crashes
path.mkdir() path.mkdir()
cmd_fec = cmd_no_fec + ["--decoder_only", "-f", EP_FILE] cmd_fec = cmd_no_fec + ["--decoder_only", "-J", DLY_PROFILE_OUT]
print( print(
"======== Script command line WITH plc: ========\n{}".format( "======== Script command line WITH plc: ========\n{}".format(
" ".join(cmd_no_fec) " ".join(cmd_fec)
) )
) )
......
...@@ -56,6 +56,7 @@ dly_profile=./scripts/dly_error_profiles/dly_error_profile_10.dat ...@@ -56,6 +56,7 @@ dly_profile=./scripts/dly_error_profiles/dly_error_profile_10.dat
ism_md_cmd="--ism_metadata_files /usr/local/ltv/ltvISM1.csv /usr/local/ltv/ltvISM2.csv /usr/local/ltv/ltvISM3.csv /usr/local/ltv/ltvISM4.csv" ism_md_cmd="--ism_metadata_files /usr/local/ltv/ltvISM1.csv /usr/local/ltv/ltvISM2.csv /usr/local/ltv/ltvISM3.csv /usr/local/ltv/ltvISM4.csv"
duration_arg="-U 1:2" duration_arg="-U 1:2"
verbosity_cmd="-z console" verbosity_cmd="-z console"
timeout_cmd="--timeout 5"
ep_file="ci/complexity_measurements/ep_10pct_fer.g192" ep_file="ci/complexity_measurements/ep_10pct_fer.g192"
if [ $BUILD -eq 1 ];then if [ $BUILD -eq 1 ];then
...@@ -84,21 +85,21 @@ echo "\n======================= 0. preparing combined format test inputs ======= ...@@ -84,21 +85,21 @@ echo "\n======================= 0. preparing combined format test inputs =======
ism_modes=$(./scripts/runIvasCodec.py -l | grep ^ISM) ism_modes=$(./scripts/runIvasCodec.py -l | grep ^ISM)
non_ism_modes=$(./scripts/runIvasCodec.py -l | grep -v ^ISM) non_ism_modes=$(./scripts/runIvasCodec.py -l | grep -v ^ISM)
echo "\n======================= 1. non-ism modes no FEC =======================\n\n" echo "\n======================= 1. non-ism modes no FEC =======================\n\n"
./scripts/runIvasCodec.py $verbosity_cmd -m $non_ism_modes -p $cfg $duration_arg | tee smoke_test_output.txt ./scripts/runIvasCodec.py $verbosity_cmd -m $non_ism_modes -p $cfg $duration_arg $timeout_cmd | tee smoke_test_output.txt
echo "\n======================= 2. ism modes no FEC =======================\n\n" echo "\n======================= 2. ism modes no FEC =======================\n\n"
./scripts/runIvasCodec.py $verbosity_cmd -m $ism_modes -p $cfg $duration_arg $ism_md_cmd | tee smoke_test_output.txt ./scripts/runIvasCodec.py $verbosity_cmd -m $ism_modes -p $cfg $duration_arg $ism_md_cmd $timeout_cmd | tee smoke_test_output.txt
# run the decoding again, but with 15% frame loss # run the decoding again, but with 15% frame loss
echo "\n======================= 3. all modes with FEC =======================\n\n" echo "\n======================= 3. all modes with FEC =======================\n\n"
./scripts/runIvasCodec.py $verbosity_cmd -p $cfg $duration_arg -f="$ep_file" --decoder_only | tee smoke_test_output_plc.txt ./scripts/runIvasCodec.py $verbosity_cmd -p $cfg $duration_arg -f="$ep_file" --decoder_only $timeout_cmd | tee smoke_test_output_plc.txt
# run JBM modes - EXT is excluded as not supported yet # run JBM modes - EXT is excluded as not supported yet
# OMASA disabled for now # OMASA disabled for now
modes_with_no_ext_out=$(./scripts/runIvasCodec.py -l | grep -v ^MASA | grep -v ^ISM | grep -v OMASA) modes_with_no_ext_out=$(./scripts/runIvasCodec.py -l | grep -v ^MASA | grep -v ^ISM | grep -v OMASA)
modes_with_ext_out=$(./scripts/runIvasCodec.py -l | grep 'MASA\|ISM' | grep -v ^ISM+ | grep -v OMASA) modes_with_ext_out=$(./scripts/runIvasCodec.py -l | grep 'MASA\|ISM' | grep -v ^ISM+ | grep -v OMASA)
echo "\n======================= 4. JBM, modes with no EXT =======================\n\n" echo "\n======================= 4. JBM, modes with no EXT =======================\n\n"
./scripts/runIvasCodec.py $verbosity_cmd -m $modes_with_no_ext_out -p $cfg $duration_arg --decoder_only --jbm_file $dly_profile | tee smoke_test_output_jbm_noEXT.txt ./scripts/runIvasCodec.py $verbosity_cmd -m $modes_with_no_ext_out -p $cfg $duration_arg --decoder_only --jbm_file $dly_profile $timeout_cmd | tee smoke_test_output_jbm_noEXT.txt
echo "\n======================= 5. JBM, modes with EXT =======================\n\n" echo "\n======================= 5. JBM, modes with EXT =======================\n\n"
./scripts/runIvasCodec.py $verbosity_cmd -m $modes_with_ext_out -p $cfg $duration_arg --decoder_only --jbm_file $dly_profile --oc BINAURAL BINAURAL_ROOM_IR mono stereo FOA HOA3 5_1 7_1_4 | tee -a smoke_test_output_jbm_noEXT.txt ./scripts/runIvasCodec.py $verbosity_cmd -m $modes_with_ext_out -p $cfg $duration_arg --decoder_only --jbm_file $dly_profile --oc BINAURAL BINAURAL_ROOM_IR mono stereo FOA HOA3 5_1 7_1_4 $timeout_cmd | tee -a smoke_test_output_jbm_noEXT.txt
# run all modes with binaural output using external files # run all modes with binaural output using external files
modes_with_bin_out="FOA HOA2 HOA3 PlanarFOA PlanarHOA2 PlanarHOA3 MASA MC ISM1 ISM2 ISM3 ISM4" modes_with_bin_out="FOA HOA2 HOA3 PlanarFOA PlanarHOA2 PlanarHOA3 MASA MC ISM1 ISM2 ISM3 ISM4"
...@@ -107,14 +108,14 @@ bin_out_modes="BINAURAL BINAURAL_ROOM_IR" ...@@ -107,14 +108,14 @@ bin_out_modes="BINAURAL BINAURAL_ROOM_IR"
echo "\n======================= 6. binaural out with HRTF files - WB =======================\n\n" echo "\n======================= 6. binaural out with HRTF files - WB =======================\n\n"
wb_modes=$(./scripts/runIvasCodec.py -l -C $modes_with_bin_out | grep _wb_) wb_modes=$(./scripts/runIvasCodec.py -l -C $modes_with_bin_out | grep _wb_)
hrtf_wb="../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_16kHz.bin" hrtf_wb="../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_16kHz.bin"
./scripts/runIvasCodec.py $verbosity_cmd -p $cfg -m $wb_modes $duration_arg -D="-hrtf ${hrtf_wb}" --decoder_only --oc $bin_out_modes | tee -a smoke_test_output_hrtf.txt ./scripts/runIvasCodec.py $verbosity_cmd -p $cfg -m $wb_modes $duration_arg -D="-hrtf ${hrtf_wb}" --decoder_only --oc $bin_out_modes $timeout_cmd | tee -a smoke_test_output_hrtf.txt
echo "\n======================= 7. binaural out with HRTF files - SWB =======================\n\n" echo "\n======================= 7. binaural out with HRTF files - SWB =======================\n\n"
swb_modes=$(./scripts/runIvasCodec.py -l -C $modes_with_bin_out | grep _swb_) swb_modes=$(./scripts/runIvasCodec.py -l -C $modes_with_bin_out | grep _swb_)
hrtf_swb="../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_32kHz.bin" hrtf_swb="../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_32kHz.bin"
./scripts/runIvasCodec.py $verbosity_cmd -p $cfg -m $swb_modes $duration_arg -D="-hrtf ${hrtf_swb}" --decoder_only --oc $bin_out_modes | tee -a smoke_test_output_hrtf.txt ./scripts/runIvasCodec.py $verbosity_cmd -p $cfg -m $swb_modes $duration_arg -D="-hrtf ${hrtf_swb}" --decoder_only --oc $bin_out_modes $timeout_cmd | tee -a smoke_test_output_hrtf.txt
echo "\n======================= 8. binaural out with HRTF files - FB =======================\n\n" echo "\n======================= 8. binaural out with HRTF files - FB =======================\n\n"
fb_modes=$(./scripts/runIvasCodec.py -l -C $modes_with_bin_out | grep _fb_) fb_modes=$(./scripts/runIvasCodec.py -l -C $modes_with_bin_out | grep _fb_)
hrtf_fb="../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_48kHz.bin" hrtf_fb="../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_48kHz.bin"
./scripts/runIvasCodec.py $verbosity_cmd -p $cfg -m $fb_modes $duration_arg -D="-hrtf ${hrtf_fb}" --decoder_only --oc $bin_out_modes | tee -a smoke_test_output_hrtf.txt ./scripts/runIvasCodec.py $verbosity_cmd -p $cfg -m $fb_modes $duration_arg -D="-hrtf ${hrtf_fb}" --decoder_only --oc $bin_out_modes $timeout_cmd | tee -a smoke_test_output_hrtf.txt
...@@ -328,6 +328,8 @@ typedef enum ...@@ -328,6 +328,8 @@ typedef enum
#define ISM_Q_STEP 2.5f #define ISM_Q_STEP 2.5f
#define ISM_Q_STEP_BORDER 5.0f #define ISM_Q_STEP_BORDER 5.0f
#define ISM_FEC_MAX 10
#define ISM_RADIUS_NBITS 6 #define ISM_RADIUS_NBITS 6
#define ISM_RADIUS_MIN 0.0f #define ISM_RADIUS_MIN 0.0f
#define ISM_RADIUS_DELTA 0.25f /* Max radius = (2^ISM_RADIUS_NBITS-1)*0.25 = 15.75 */ #define ISM_RADIUS_DELTA 0.25f /* Max radius = (2^ISM_RADIUS_NBITS-1)*0.25 = 15.75 */
...@@ -1552,6 +1554,7 @@ typedef enum ...@@ -1552,6 +1554,7 @@ typedef enum
#define MAX_SPLIT_MD_SUBFRAMES 1 #define MAX_SPLIT_MD_SUBFRAMES 1
#define COMPLEX_MD_BAND_THRESH MAX_SPLIT_REND_MD_BANDS #define COMPLEX_MD_BAND_THRESH MAX_SPLIT_REND_MD_BANDS
#define COMPLEX_MD_BAND_THRESH_LOW 5 #define COMPLEX_MD_BAND_THRESH_LOW 5
#define SPLIT_REND_RO_MD_BAND_THRESH 4
#define IVAS_SPLIT_REND_NUM_QUANT_STRATS 4 #define IVAS_SPLIT_REND_NUM_QUANT_STRATS 4
#define IVAS_SPLIT_REND_PRED_63QUANT_PNTS 63 #define IVAS_SPLIT_REND_PRED_63QUANT_PNTS 63
...@@ -1609,8 +1612,6 @@ typedef enum ...@@ -1609,8 +1612,6 @@ typedef enum
#define MAX_ANGULAR_STEP_INV ( 1.0f / MAX_ANGULAR_STEP ) #define MAX_ANGULAR_STEP_INV ( 1.0f / MAX_ANGULAR_STEP )
#define MAX_INTERPOLATION_STEPS 12 #define MAX_INTERPOLATION_STEPS 12
#define LR_IAC_LENGTH_NR_FC ( RV_LENGTH_NR_FC )
/* ----- Enums - TD Renderer ----- */ /* ----- Enums - TD Renderer ----- */
typedef enum typedef enum
...@@ -1662,9 +1663,16 @@ typedef enum ...@@ -1662,9 +1663,16 @@ typedef enum
#define RV_FILTER_MAX_FFT_SIZE ( 512 ) #define RV_FILTER_MAX_FFT_SIZE ( 512 )
#define RV_FILTER_MAX_HISTORY ( 512 - 160 ) /* for longest history */ #define RV_FILTER_MAX_HISTORY ( 512 - 160 ) /* for longest history */
#define RV_LENGTH_NR_FC ( RV_FILTER_MAX_FFT_SIZE / 2 ) + 1 #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 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
/*----------------------------------------------------------------------------------* /*----------------------------------------------------------------------------------*
* FB mixer constants * FB mixer constants
......
...@@ -78,6 +78,9 @@ typedef enum ...@@ -78,6 +78,9 @@ typedef enum
IVAS_ERR_DIRECTIVITY_NOT_SUPPORTED, IVAS_ERR_DIRECTIVITY_NOT_SUPPORTED,
IVAS_ERR_ACOUSTIC_ENVIRONMENT_NOT_SUPPORTED, IVAS_ERR_ACOUSTIC_ENVIRONMENT_NOT_SUPPORTED,
IVAS_ERR_INVALID_HRTF, 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_INPUT_FORMAT,
IVAS_ERR_INVALID_INDEX, IVAS_ERR_INVALID_INDEX,
IVAS_ERR_NOT_SUPPORTED_OPTION, IVAS_ERR_NOT_SUPPORTED_OPTION,
...@@ -257,6 +260,10 @@ static inline const char *ivas_error_to_string( ivas_error error_code ) ...@@ -257,6 +260,10 @@ static inline const char *ivas_error_to_string( ivas_error error_code )
return "Acoustic environment not supported"; return "Acoustic environment not supported";
case IVAS_ERR_INVALID_HRTF: case IVAS_ERR_INVALID_HRTF:
return "Unsupported HRTF filter set"; 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: case IVAS_ERR_INVALID_INPUT_FORMAT:
return "Invalid input format"; return "Invalid input format";
case IVAS_ERR_INVALID_INDEX: case IVAS_ERR_INVALID_INDEX:
......
...@@ -5469,7 +5469,11 @@ void ivas_mono_dmx_renderer_close( ...@@ -5469,7 +5469,11 @@ void ivas_mono_dmx_renderer_close(
MONO_DOWNMIX_RENDERER_HANDLE *hMonoDmxRenderer /* i/ i/o: Mono downmix structure */ 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( void ivas_mono_downmix_render_passive(
#endif
Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */
float *output_f[], /* i/o: synthesized core-coder transport channels/mono output */ float *output_f[], /* i/o: synthesized core-coder transport channels/mono output */
const int16_t output_frame /* i : output frame length */ const int16_t output_frame /* i : output frame length */
......
...@@ -151,8 +151,13 @@ ...@@ -151,8 +151,13 @@
/*#define FIX_I4_OL_PITCH*/ /* fix open-loop pitch used for EVS core switching */ /*#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 SPLIT_REND_WITH_HEAD_ROT */ /* Dlb,FhG: Split Rendering contributions 21 and 35 */
#define FIX_911_REMOVE_CREND_DUPLICATION /* VA: issue 911: resolve duplication of CRend binaural external renderer function */ #define FIX_638_ENERGIE_IAC_ROM_TABLES /* Orange : Missing left/right and coherence late reverb tables in binary format*/
#define FIX_938_GCC_12_WARNINGS /* VA: issue #938: remove set_f(.,.,0) call in which length is always 0 to remove GCC 12.0 warning */ #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 */
#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 */
/* #################### End BE switches ################################## */ /* #################### End BE switches ################################## */
...@@ -160,8 +165,14 @@ ...@@ -160,8 +165,14 @@
/* any switch which is non-be wrt selection floating point code */ /* any switch which is non-be wrt selection floating point code */
/* all switches in this category should start with "NONBE_" */ /* all switches in this category should start with "NONBE_" */
#define NONBE_FIX_856_TCX_LTP_SYNTH_FILTER /* FhG: issue 856: correct filtering length for tcx-ltp synth filtering*/ #define NONBE_FIX_BINARY_BINAURAL_READING /* Orange: Add support for reading binaural binary file */
#define NONBE_FIX_943_RECONFIG_IGF_AFTER_SETTING_BW /* FhG: issue 943: fix crash in BW switchin from WB in MDCT-Stereo core encoder */ #define NONBE_FIX_AVG_IAC_CLDFB_REVERB /* Orange: Add computation avg energy and iac tables for rom and binaural binary file */
#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 */
#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 BE_FIX_567_DOUBLE_STEREO_DMX /* NTT: Fix formal issues */ #define BE_FIX_567_DOUBLE_STEREO_DMX /* NTT: Fix formal issues */
#define NONBE_FIX_567_DOUBLE_STEREO_DMX /* Orange: Double-precision replaced by single-precision */ #define NONBE_FIX_567_DOUBLE_STEREO_DMX /* Orange: Double-precision replaced by single-precision */
......
...@@ -740,11 +740,7 @@ static void tcx_ltp_synth_filter_11_unequal_pitch( ...@@ -740,11 +740,7 @@ static void tcx_ltp_synth_filter_11_unequal_pitch(
gain = prev_gain; gain = prev_gain;
gain_step = -prev_gain / length; gain_step = -prev_gain / length;
#ifdef NONBE_FIX_856_TCX_LTP_SYNTH_FILTER
for ( j = 0; j < length; j++ ) for ( j = 0; j < length; j++ )
#else
for ( j = 0; j < length + L; j++ )
#endif
{ {
s = 0; s = 0;
s2 = 0; s2 = 0;
...@@ -765,14 +761,9 @@ static void tcx_ltp_synth_filter_11_unequal_pitch( ...@@ -765,14 +761,9 @@ static void tcx_ltp_synth_filter_11_unequal_pitch(
gain += gain_step; gain += gain_step;
} }
#ifdef NONBE_FIX_856_TCX_LTP_SYNTH_FILTER
mvr2r( out - L, temp_buf, length + L ); mvr2r( out - L, temp_buf, length + L );
mvr2r( in + length, temp_buf + length + L, L ); mvr2r( in + length, temp_buf + length + L, L );
temp_ptr = &temp_buf[0] + L; temp_ptr = &temp_buf[0] + L;
#else
mvr2r( out - MAX_TCX_LTP_FILTER_LEN, temp_buf, MAX_TRANSITION_LEN + 2 * MAX_TCX_LTP_FILTER_LEN );
temp_ptr = &temp_buf[0] + MAX_TCX_LTP_FILTER_LEN;
#endif
m0 = temp_ptr; m0 = temp_ptr;
m1 = temp_ptr - 1; m1 = temp_ptr - 1;
......
...@@ -211,7 +211,12 @@ static void decode_sfe_vector( ...@@ -211,7 +211,12 @@ static void decode_sfe_vector(
| c b | c b
| e --> t | e --> t
*/ */
#ifdef FIX_969_USAN_IGF_ARITH
int16_t pred;
uint16_t pred_tmp;
#else
uint16_t pred; uint16_t pred;
#endif
int16_t f, ctx, ctx_f, ctx_t; int16_t f, ctx, ctx_f, ctx_t;
for ( f = 0; f < length; f++ ) for ( f = 0; f < length; f++ )
...@@ -221,7 +226,12 @@ static void decode_sfe_vector( ...@@ -221,7 +226,12 @@ static void decode_sfe_vector(
if ( f == 0 ) if ( f == 0 )
{ {
/* decode one of the IGF_SYMBOLS_IN_TABLE == 27 alphabet symbols using the new raw AC function */ /* 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 ); ari_decode_14bits_s27_ext( st, &pred, &hPrivateData->acState, hPrivateData->cf_se00 );
#endif
x[f] = pred << 2; x[f] = pred << 2;
x[f] += arith_decode_bits( &hPrivateData->acState, st, 2 ); /* LSBs as 2 bit raw */ x[f] += arith_decode_bits( &hPrivateData->acState, st, 2 ); /* LSBs as 2 bit raw */
} }
......
...@@ -1535,6 +1535,7 @@ void ivas_binaural_add_LFE( ...@@ -1535,6 +1535,7 @@ void ivas_binaural_add_LFE(
{ {
int16_t render_lfe, idx_lfe; int16_t render_lfe, idx_lfe;
float gain; float gain;
float lfe_tc[L_FRAME48k];
if ( st_ivas->hBinRenderer != NULL ) if ( st_ivas->hBinRenderer != NULL )
{ {
...@@ -1558,10 +1559,10 @@ void ivas_binaural_add_LFE( ...@@ -1558,10 +1559,10 @@ void ivas_binaural_add_LFE(
for ( idx_lfe = 0; idx_lfe < st_ivas->hIntSetup.num_lfe; idx_lfe++ ) for ( idx_lfe = 0; idx_lfe < st_ivas->hIntSetup.num_lfe; idx_lfe++ )
{ {
v_multc( input_f[st_ivas->hIntSetup.index_lfe[idx_lfe]], gain, input_f[st_ivas->hIntSetup.index_lfe[idx_lfe]], output_frame ); v_multc( input_f[st_ivas->hIntSetup.index_lfe[idx_lfe]], gain, lfe_tc, output_frame );
/* copy LFE to left and right channels */ /* copy LFE to left and right channels */
v_add( output_f[0], input_f[st_ivas->hIntSetup.index_lfe[idx_lfe]], output_f[0], output_frame ); v_add( output_f[0], lfe_tc, output_f[0], output_frame );
v_add( output_f[1], input_f[st_ivas->hIntSetup.index_lfe[idx_lfe]], output_f[1], output_frame ); v_add( output_f[1], lfe_tc, output_f[1], output_frame );
} }
} }
......
...@@ -2685,7 +2685,12 @@ void ivas_destroy_dec( ...@@ -2685,7 +2685,12 @@ void ivas_destroy_dec(
{ {
ivas_td_binaural_close( &st_ivas->hBinRendererTd ); 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 ) else if ( st_ivas->hHrtfTD != NULL )
#endif
{ {
BSplineModelEvalDealloc( &st_ivas->hHrtfTD->ModelParams, &st_ivas->hHrtfTD->ModelEval ); BSplineModelEvalDealloc( &st_ivas->hHrtfTD->ModelParams, &st_ivas->hHrtfTD->ModelEval );
......
...@@ -154,6 +154,24 @@ void ivas_ism_render_sf( ...@@ -154,6 +154,24 @@ void ivas_ism_render_sf(
float gain, prev_gain; float gain, prev_gain;
float tc_local[MAX_NUM_OBJECTS][L_FRAME48k]; float tc_local[MAX_NUM_OBJECTS][L_FRAME48k];
float *p_tc[MAX_NUM_OBJECTS]; 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;
last_sf = first_sf;
n_samples_rendered_loop = 0;
while ( slots_to_render > 0 )
{
slots_to_render -= st_ivas->hTcBuffer->subframe_nbslots[last_sf];
last_sf++;
}
#endif
num_objects = st_ivas->nchan_transport; num_objects = st_ivas->nchan_transport;
if ( st_ivas->ivas_format == SBA_ISM_FORMAT ) if ( st_ivas->ivas_format == SBA_ISM_FORMAT )
...@@ -166,6 +184,18 @@ void ivas_ism_render_sf( ...@@ -166,6 +184,18 @@ void ivas_ism_render_sf(
tc_offset = st_ivas->hTcBuffer->n_samples_rendered; tc_offset = st_ivas->hTcBuffer->n_samples_rendered;
interp_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 )
{
ism_md_subframe_update_jbm = max( 0, st_ivas->hTcBuffer->nb_subframes - 3 );
}
else
{
ism_md_subframe_update_jbm = st_ivas->hTcBuffer->nb_subframes - 2;
}
#endif
if ( st_ivas->hDecoderConfig->Opt_tsm ) if ( st_ivas->hDecoderConfig->Opt_tsm )
{ {
for ( i = 0; i < num_objects; i++ ) for ( i = 0; i < num_objects; i++ )
...@@ -187,9 +217,21 @@ void ivas_ism_render_sf( ...@@ -187,9 +217,21 @@ void ivas_ism_render_sf(
set_f( output_f[i], 0.0f, n_samples_to_render ); 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 ) 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 ); ivas_jbm_dec_get_adapted_linear_interpolator( n_samples_to_render, n_samples_to_render, st_ivas->hIsmRendererData->interpolator );
#endif
interp_offset = 0; interp_offset = 0;
} }
...@@ -198,8 +240,18 @@ void ivas_ism_render_sf( ...@@ -198,8 +240,18 @@ void ivas_ism_render_sf(
/* Combined rotation: rotate the object positions depending the head and external orientations */ /* 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 ) 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 );
}
else
{
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 ); 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 ) if ( st_ivas->hEFAPdata != NULL )
{ {
efap_determine_gains( st_ivas->hEFAPdata, st_ivas->hIsmRendererData->gains[i], azimuth, elevation, EFAP_MODE_EFAP ); efap_determine_gains( st_ivas->hEFAPdata, st_ivas->hIsmRendererData->gains[i], azimuth, elevation, EFAP_MODE_EFAP );
...@@ -220,10 +272,18 @@ void ivas_ism_render_sf( ...@@ -220,10 +272,18 @@ void ivas_ism_render_sf(
{ {
g1 = &st_ivas->hIsmRendererData->interpolator[interp_offset]; g1 = &st_ivas->hIsmRendererData->interpolator[interp_offset];
tc = p_tc[i]; 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++ ) for ( k = 0; k < n_samples_to_render; k++ )
#endif
{ {
g2 = 1.0f - *g1; 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++ ); output_f[j2][k] += ( *( g1++ ) * gain + g2 * prev_gain ) * *( tc++ );
#endif
} }
} }
...@@ -233,10 +293,29 @@ void ivas_ism_render_sf( ...@@ -233,10 +293,29 @@ void ivas_ism_render_sf(
st_ivas->hIsmRendererData->prev_gains[i][j] = gain; 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 */ /* 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 ); 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 )
{
st_ivas->hTcBuffer->subframes_rendered += 1;
st_ivas->hTcBuffer->slots_rendered += st_ivas->hTcBuffer->subframe_nbslots[subframe_idx];
}
tc_offset += n_samples_in_subframe;
interp_offset += n_samples_in_subframe;
}
#endif
return; return;
} }
......
...@@ -196,7 +196,11 @@ ivas_error ivas_jbm_dec_tc( ...@@ -196,7 +196,11 @@ ivas_error ivas_jbm_dec_tc(
if ( st_ivas->renderer_type == RENDERER_MONO_DOWNMIX ) 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 ); 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 ) ) 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 ) )
{ {
...@@ -388,7 +392,11 @@ ivas_error ivas_jbm_dec_tc( ...@@ -388,7 +392,11 @@ ivas_error ivas_jbm_dec_tc(
if ( st_ivas->renderer_type == RENDERER_MONO_DOWNMIX ) 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 ); ivas_mono_downmix_render_passive( st_ivas, p_output, output_frame );
#endif
} }
else if ( output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) else if ( output_config == IVAS_AUDIO_CONFIG_EXTERNAL )
{ {
...@@ -512,7 +520,11 @@ ivas_error ivas_jbm_dec_tc( ...@@ -512,7 +520,11 @@ ivas_error ivas_jbm_dec_tc(
} }
else if ( st_ivas->renderer_type == RENDERER_MONO_DOWNMIX && st_ivas->ism_mode == ISM_SBA_MODE_DISC ) 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 ); ivas_mono_downmix_render_passive( st_ivas, p_output, output_frame );
#endif
/* add W */ /* add W */
for ( n = 0; n < nchan_out; n++ ) for ( n = 0; n < nchan_out; n++ )
...@@ -1030,11 +1042,6 @@ ivas_error ivas_jbm_dec_render( ...@@ -1030,11 +1042,6 @@ ivas_error ivas_jbm_dec_render(
{ {
ivas_dirac_dec_binaural_render( st_ivas, nSamplesAskedLocal, nSamplesRendered, nSamplesAvailableNext, st_ivas->nchan_transport, p_output ); ivas_dirac_dec_binaural_render( st_ivas, nSamplesAskedLocal, nSamplesRendered, nSamplesAvailableNext, st_ivas->nchan_transport, p_output );
} }
else if ( st_ivas->renderer_type == RENDERER_NON_DIEGETIC_DOWNMIX )
{
*nSamplesRendered = min( st_ivas->hTcBuffer->n_samples_available, nSamplesAskedLocal );
ivas_apply_non_diegetic_panning( p_output, st_ivas->hDecoderConfig->non_diegetic_pan_gain, *nSamplesRendered );
}
else if ( st_ivas->renderer_type == RENDERER_PARAM_ISM || st_ivas->renderer_type == RENDERER_SBA_LINEAR_ENC ) else if ( st_ivas->renderer_type == RENDERER_PARAM_ISM || st_ivas->renderer_type == RENDERER_SBA_LINEAR_ENC )
{ {
ivas_param_ism_dec_render( st_ivas, nSamplesAskedLocal, nSamplesRendered, nSamplesAvailableNext, p_output ); ivas_param_ism_dec_render( st_ivas, nSamplesAskedLocal, nSamplesRendered, nSamplesAvailableNext, p_output );
...@@ -1060,11 +1067,23 @@ ivas_error ivas_jbm_dec_render( ...@@ -1060,11 +1067,23 @@ ivas_error ivas_jbm_dec_render(
{ {
ivas_apply_non_diegetic_panning( p_output, st_ivas->hDecoderConfig->non_diegetic_pan_gain, *nSamplesRendered ); 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
else if ( st_ivas->renderer_type == RENDERER_SBA_LINEAR_ENC )
#endif
{
/* 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 ) 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 */ /* 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 ); 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 */ /* Binaural rendering */
if ( st_ivas->renderer_type == RENDERER_BINAURAL_OBJECTS_TD ) if ( st_ivas->renderer_type == RENDERER_BINAURAL_OBJECTS_TD )
...@@ -1119,6 +1138,7 @@ ivas_error ivas_jbm_dec_render( ...@@ -1119,6 +1138,7 @@ ivas_error ivas_jbm_dec_render(
} }
else if ( st_ivas->ivas_format == MASA_FORMAT ) else if ( st_ivas->ivas_format == MASA_FORMAT )
{ {
#ifndef FIX_959_MASA_LINEAR_REND
if ( st_ivas->renderer_type == RENDERER_SBA_LINEAR_DEC ) if ( st_ivas->renderer_type == RENDERER_SBA_LINEAR_DEC )
{ {
*nSamplesRendered = min( st_ivas->hTcBuffer->n_samples_available, nSamplesAskedLocal ); *nSamplesRendered = min( st_ivas->hTcBuffer->n_samples_available, nSamplesAskedLocal );
...@@ -1133,6 +1153,9 @@ ivas_error ivas_jbm_dec_render( ...@@ -1133,6 +1153,9 @@ ivas_error ivas_jbm_dec_render(
} }
} }
else if ( st_ivas->renderer_type == RENDERER_DIRAC ) 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 ); ivas_dirac_dec_render( st_ivas, nchan_remapped, nSamplesAskedLocal, nSamplesRendered, nSamplesAvailableNext, p_output );
} }
...@@ -1260,6 +1283,10 @@ ivas_error ivas_jbm_dec_render( ...@@ -1260,6 +1283,10 @@ ivas_error ivas_jbm_dec_render(
} }
else if ( st_ivas->ivas_format == MC_FORMAT ) else if ( st_ivas->ivas_format == MC_FORMAT )
{ {
for ( n = 0; n < st_ivas->hTcBuffer->nchan_buffer_full; n++ )
{
p_tc[n] = &st_ivas->hTcBuffer->tc[n][st_ivas->hTcBuffer->n_samples_rendered];
}
if ( st_ivas->mc_mode == MC_MODE_MCT ) if ( st_ivas->mc_mode == MC_MODE_MCT )
{ {
int16_t crendInPlaceRotation = FALSE; int16_t crendInPlaceRotation = FALSE;
......
...@@ -117,6 +117,15 @@ void ivas_mc_paramupmix_dec_read_BS( ...@@ -117,6 +117,15 @@ void ivas_mc_paramupmix_dec_read_BS(
hMCParamUpmix->betas[i][k] = hMCParamUpmix->beta_prev[i][k]; hMCParamUpmix->betas[i][k] = hMCParamUpmix->beta_prev[i][k];
} }
} }
#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; hMCParamUpmix->first_frame = 1;
} }
else /* if (!st->bfi) */ else /* if (!st->bfi) */
...@@ -135,6 +144,17 @@ void ivas_mc_paramupmix_dec_read_BS( ...@@ -135,6 +144,17 @@ void ivas_mc_paramupmix_dec_read_BS(
st0->bits_frame = min( MAX_BITS_METADATA, last_bit_pos + 1 ); st0->bits_frame = min( MAX_BITS_METADATA, last_bit_pos + 1 );
st0->total_brate = st_ivas->hDecoderConfig->ivas_total_brate; /* to avoid BER detect */ 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++ )
{
mvr2r( hMCParamUpmix->alphas[i], hMCParamUpmix->alpha_prev[i], IVAS_MAX_NUM_BANDS );
mvr2r( hMCParamUpmix->betas[i], hMCParamUpmix->beta_prev[i], IVAS_MAX_NUM_BANDS );
}
}
#endif
for ( i = 0; i < MC_PARAMUPMIX_COMBINATIONS; i++ ) for ( i = 0; i < MC_PARAMUPMIX_COMBINATIONS; i++ )
{ {
get_ec_data( st0, ALPHA, hMCParamUpmix->alpha_quant[i], alpha_quant, hMCParamUpmix->alphas[i] ); get_ec_data( st0, ALPHA, hMCParamUpmix->alpha_quant[i], alpha_quant, hMCParamUpmix->alphas[i] );
...@@ -154,6 +174,14 @@ void ivas_mc_paramupmix_dec_read_BS( ...@@ -154,6 +174,14 @@ void ivas_mc_paramupmix_dec_read_BS(
} }
hMCParamUpmix->first_frame = 0; 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(); pop_wmops();
...@@ -245,12 +273,13 @@ void ivas_mc_paramupmix_dec_render( ...@@ -245,12 +273,13 @@ void ivas_mc_paramupmix_dec_render(
assert( slots_to_render == 0 ); assert( slots_to_render == 0 );
#endif #endif
{ {
#ifndef NONBE_FIX_952_MC_PARAMUPMIX_5MS
for ( ch = 0; ch < MC_PARAMUPMIX_COMBINATIONS; ch++ ) for ( ch = 0; ch < MC_PARAMUPMIX_COMBINATIONS; ch++ )
{ {
mvr2r( hMCParamUpmix->alpha_prev[ch], hMCParamUpmix->alpha_sf[ch], IVAS_MAX_NUM_BANDS ); 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 ); mvr2r( hMCParamUpmix->beta_prev[ch], hMCParamUpmix->beta_sf[ch], IVAS_MAX_NUM_BANDS );
} }
#endif
#ifdef SPLIT_REND_WITH_HEAD_ROT #ifdef SPLIT_REND_WITH_HEAD_ROT
slot_index_start = 0; slot_index_start = 0;
...@@ -275,12 +304,13 @@ void ivas_mc_paramupmix_dec_render( ...@@ -275,12 +304,13 @@ void ivas_mc_paramupmix_dec_render(
/* update combined orientation access index */ /* update combined orientation access index */
ivas_combined_orientation_update_index( st_ivas->hCombinedOrientationData, n_samples_sf ); 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++ ) for ( ch = 0; ch < MC_PARAMUPMIX_COMBINATIONS; ch++ )
{ {
mvr2r( hMCParamUpmix->alphas[ch], hMCParamUpmix->alpha_prev[ch], IVAS_MAX_NUM_BANDS ); mvr2r( hMCParamUpmix->alphas[ch], hMCParamUpmix->alpha_prev[ch], IVAS_MAX_NUM_BANDS );
mvr2r( hMCParamUpmix->betas[ch], hMCParamUpmix->beta_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; *nSamplesAvailable = ( st_ivas->hTcBuffer->num_slots - st_ivas->hTcBuffer->slots_rendered ) * slot_size;
......
...@@ -48,7 +48,9 @@ ...@@ -48,7 +48,9 @@
#define DOWNMIX_ALPHA 0.95f /* Smoothing coefficient */ #define DOWNMIX_ALPHA 0.95f /* Smoothing coefficient */
#define DOWNMIX_MAX_GAIN 4.0f /* Maximum allowed gain */ #define DOWNMIX_MAX_GAIN 4.0f /* Maximum allowed gain */
#define MONO_DOWNMIX_RENDERER_MAX_INPUT_CHANS 4 #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
/*------------------------------------------------------------------------- /*-------------------------------------------------------------------------
...@@ -99,12 +101,16 @@ void ivas_mono_dmx_renderer_close( ...@@ -99,12 +101,16 @@ void ivas_mono_dmx_renderer_close(
/*------------------------------------------------------------------------- /*-------------------------------------------------------------------------
* ivas_mono_downmix_render_passive() * ivas_ism_mono_dmx()
* *
* Downmix process * Downmix process
*------------------------------------------------------------------------*/ *------------------------------------------------------------------------*/
#ifdef NONBE_FIX_967_ISM_MONO_DMX
void ivas_ism_mono_dmx(
#else
void ivas_mono_downmix_render_passive( void ivas_mono_downmix_render_passive(
#endif
Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */
float *output_f[], /* i/o: synthesized core-coder transport channels/mono output */ float *output_f[], /* i/o: synthesized core-coder transport channels/mono output */
const int16_t output_frame /* i : output frame length */ const int16_t output_frame /* i : output frame length */
...@@ -112,6 +118,9 @@ void ivas_mono_downmix_render_passive( ...@@ -112,6 +118,9 @@ void ivas_mono_downmix_render_passive(
{ {
int16_t i, j, numInputChannels; int16_t i, j, numInputChannels;
float proto_signal[L_FRAME48k], eq; float proto_signal[L_FRAME48k], eq;
#ifdef NONBE_FIX_967_ISM_MONO_DMX
float inputEnergy_local, protoEnergy_local;
#endif
MONO_DOWNMIX_RENDERER_HANDLE hDownmix; MONO_DOWNMIX_RENDERER_HANDLE hDownmix;
numInputChannels = st_ivas->nSCE; numInputChannels = st_ivas->nSCE;
...@@ -134,6 +143,10 @@ void ivas_mono_downmix_render_passive( ...@@ -134,6 +143,10 @@ void ivas_mono_downmix_render_passive(
hDownmix = st_ivas->hMonoDmxRenderer; hDownmix = st_ivas->hMonoDmxRenderer;
set_zero( proto_signal, output_frame ); set_zero( proto_signal, output_frame );
#ifdef NONBE_FIX_967_ISM_MONO_DMX
inputEnergy_local = 0;
protoEnergy_local = 0;
#endif
/* Compute the Proto Signal */ /* Compute the Proto Signal */
for ( i = 0; i < numInputChannels; i++ ) for ( i = 0; i < numInputChannels; i++ )
...@@ -141,6 +154,18 @@ void ivas_mono_downmix_render_passive( ...@@ -141,6 +154,18 @@ void ivas_mono_downmix_render_passive(
v_add( output_f[i], proto_signal, proto_signal, output_frame ); 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++ )
{
protoEnergy_local += proto_signal[i] * proto_signal[i];
for ( j = 0; j < numInputChannels; j++ )
{
inputEnergy_local += ( output_f[j][i] * output_f[j][i] );
}
}
#else
/* compute the input energy, proto energy after smoothing */ /* compute the input energy, proto energy after smoothing */
hDownmix->inputEnergy *= DOWNMIX_ALPHA; hDownmix->inputEnergy *= DOWNMIX_ALPHA;
hDownmix->protoEnergy *= DOWNMIX_ALPHA; hDownmix->protoEnergy *= DOWNMIX_ALPHA;
...@@ -153,6 +178,13 @@ void ivas_mono_downmix_render_passive( ...@@ -153,6 +178,13 @@ void ivas_mono_downmix_render_passive(
hDownmix->inputEnergy += ( output_f[j][i] * output_f[j][i] ); 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 */ /* compute the eq factor */
eq = min( DOWNMIX_MAX_GAIN, sqrtf( hDownmix->inputEnergy / ( EPSILON + hDownmix->protoEnergy ) ) ); eq = min( DOWNMIX_MAX_GAIN, sqrtf( hDownmix->inputEnergy / ( EPSILON + hDownmix->protoEnergy ) ) );
......
...@@ -342,6 +342,16 @@ ivas_error ivas_td_binaural_renderer_sf_splitBinaural( ...@@ -342,6 +342,16 @@ ivas_error ivas_td_binaural_renderer_sf_splitBinaural(
{ {
return error; return error;
} }
if ( st_ivas->ivas_format == MC_FORMAT )
{
float *p_tc[MAX_TRANSPORT_CHANNELS];
for ( i = 0; i < st_ivas->nchan_transport; i++ )
{
p_tc[i] = st_ivas->hTcBuffer->tc[i] + st_ivas->hTcBuffer->n_samples_rendered;
}
ivas_binaural_add_LFE( st_ivas, nSamplesRendered, p_tc, p_bin_output );
}
} }
for ( i = 0; i < pMultiBinPoseData->num_poses * BINAURAL_CHANNELS; i++ ) for ( i = 0; i < pMultiBinPoseData->num_poses * BINAURAL_CHANNELS; i++ )
......