diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b9395d824894f6721d529a017cdea0eba1fb641e..163187500bbd8072b80f1c0d7659ba20f33103ec 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,47 +1,13 @@ variables: - TESTV_DIR: "/usr/local/testv" - LTV_DIR: "/usr/local/ltv" - BUILD_OUTPUT: "build_output.txt" - EVS_BE_TEST_DIR: "/usr/local/be_2_evs_test" - EVS_BE_WIN_TEST_DIR: "C:/Users/gitlab-runner/testvec" - EXIT_CODE_NON_BE: 123 - EXIT_CODE_FAIL: 1 - PROCESSING_SCRIPTS_BIN_DIR: "/test-bin" - TESTS_DIR_CODEC_BE_ON_MR: "tests/codec_be_on_mr_nonselection" - 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_SCENE_BASED: "FOA HOA2 HOA3" - OUT_FORMATS_BINAURAL: "BINAURAL BINAURAL_ROOM_IR BINAURAL_ROOM_REVERB" - OUT_FORMATS_ALL: "$OUT_FORMATS_CHANNEL_BASED $OUT_FORMATS_SCENE_BASED $OUT_FORMATS_BINAURAL EXT" - IVAS_PIPELINE_NAME: '' - MANUAL_PIPELINE_TYPE: - description: "Type for the manual pipeline run. Use 'test-be-release' to run BE test against release codec." - value: 'default' - options: - - 'default' - - 'test-be-release' - - 'test-long-self-test' - - 'ivas-conformance' - - 'ivas-conformance-linux' - - 'check-clipping' - - 'test-branch-vs-input-passthrough' - - GIT_CLEAN_FLAGS: -ffdxq - TESTCASE_TIMEOUT_STV_SANITIZERS: 240 - TESTCASE_TIMEOUT_LTV_SANITIZERS: 2400 - BASOP_REFERENCE_BRANCH: "ivas-float-update" - SCALE_FACTOR: "3.162" - PYTEST_ARGS: "" - LONG_TEST_SUITE: "tests/codec_be_on_mr_nonselection tests/renderer --param_file scripts/config/self_test_ltv.prm --use_ltv" - LONG_TEST_SUITE_NO_RENDERER: "tests/codec_be_on_mr_nonselection --param_file scripts/config/self_test_ltv.prm --use_ltv" - SHORT_TEST_SUITE: "tests/codec_be_on_mr_nonselection" - SHORT_TEST_SUITE_ENCODER: "tests/codec_be_on_mr_nonselection/test_param_file.py --param_file scripts/config/self_test_basop_encoder.prm" - LONG_TEST_SUITE_ENCODER: "tests/codec_be_on_mr_nonselection/test_param_file.py --param_file scripts/config/self_test_ltv_basop_encoder.prm" - TEST_SUITE: "" - - -default: - interruptible: true # Make all jobs by default interruptible + # note: GitLab cannot reference variables defined by users in the include ref:, we need to use a YAML anchor for this + # see https://docs.gitlab.com/ci/yaml/includes/#use-variables-with-include for more information + IVAS_CODEC_CI_REF: &IVAS_CODEC_CI_REF 4eb4c0dfbdc845280a9994b5f7540f69c737537b + +include: + - local: .gitlab-ci/variables.yml + - project: ivas-codec-pc/ivas-codec-ci + ref: *IVAS_CODEC_CI_REF + file: main.yml # This sets when pipelines are created. Jobs have more specific rules to restrict them. workflow: @@ -83,30 +49,12 @@ workflow: variables: IVAS_PIPELINE_NAME: 'Pass-through comparison vs input: $CI_COMMIT_BRANCH' -stages: - - .pre - - maintenance - - prevalidate - - build - - test - - compare - - postvalidate - - deploy - # --------------------------------------------------------------- # Generic script anchors # --------------------------------------------------------------- # These can be used later on to do common tasks -# Prints useful information for every job and should be used at the beginning of each job -.print-common-info: &print-common-info - - | - echo "Printing common information for build job." - echo "Current job is run on commit $CI_COMMIT_SHA" - echo "Commit time was $CI_COMMIT_TIMESTAMP" - date | xargs echo "System time is" - .print-common-info-windows: &print-common-info-windows - | echo "Printing common information for build job." @@ -114,31 +62,6 @@ stages: echo "Commit time was $CI_COMMIT_TIMESTAMP" ("echo 'System time is'", "Get-Date -Format 'dddd dd/MM/yyyy HH:mm K'") | Invoke-Expression -.get-previous-merge-commit-sha: &get-previous-merge-commit-sha - - previous_merge_commit=$(git --no-pager log --merges HEAD~1 -n 1 --pretty=format:%H) - -.mr-fetch-target-branch: &mr-fetch-target-branch - # first delete local target branch to avoid conflicts when branch is cached and there are merge conflicts during fetching - # depending on chaching, the branch may not be there, so prevent failure of this command -> should maybe be done smarter later - - git branch -D $CI_MERGE_REQUEST_TARGET_BRANCH_NAME || true - # needed when depth is lower than the number of commits in the branch - - git fetch origin $CI_MERGE_REQUEST_TARGET_BRANCH_NAME:$CI_MERGE_REQUEST_TARGET_BRANCH_NAME - -.mr-get-target-commit: &mr-get-target-commit # compare to last target branch commit before pipeline was created - - target_commit=$(git log $CI_MERGE_REQUEST_TARGET_BRANCH_NAME -1 --oneline --before=${CI_PIPELINE_CREATED_AT} --format=%H) - -.check-for-testvectors: &check-for-testvectors # check if the testvector files specified in scripts/config/ci_linux*.json are present - - python3 -m pytest ci/test_vectors_available.py - -.disable-debugging-macro: &disable-debugging-macro -# automatically disable #DEBUGGING macro in options.h using /**/-comment - - sed -i.bak -e "s/^[[:space:]]*\(#define[[:space:]]*DEBUGGING\)/\/\*\1\*\//g" lib_com/options.h - -.enable-debugging-macro: &enable-debugging-macro -# automatically enable #DEBUGGING macro in options.h using either /**/-comment or //-comment - - sed -i.bak -e "s/\/\*\ *\(#define\ *DEBUGGING\ *\)\*\//\1/g" lib_com/options.h - - sed -i.bak -e "s/\/\/\ *\(#define\ *DEBUGGING\ *\)/\1/g" lib_com/options.h - .get-basop-float-reference: &get-basop-float-reference - git clone -b $BASOP_REFERENCE_BRANCH https://forge.3gpp.org/rep/sa4/audio/ivas-basop.git --single-branch --depth 1 ivas-basop - cd ivas-basop @@ -151,7 +74,7 @@ stages: .merge-request-comparison-setup-codec: &merge-request-comparison-setup-codec ### build test binaries, initial clean for paranoia reasons - - *disable-debugging-macro + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/disable-debugging-macro.sh - make clean - mkdir build - cd build @@ -168,13 +91,13 @@ stages: - source_branch_commit_sha=$(git rev-parse HEAD) ### checkout version to compare against - - *mr-fetch-target-branch - - *mr-get-target-commit + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/mr-fetch-target-branch.sh + - target_commit="$("${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/mr-get-target-commit.sh)" - git checkout $target_commit - echo "Building reference codec at commit $target_commit" ### build reference binaries - - *disable-debugging-macro + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/disable-debugging-macro.sh - cd build - cmake .. - make -j @@ -196,53 +119,27 @@ stages: - if [ $exit_code -ne 0 ] && [ $non_be_flag != 0 ]; then echo "Non-bitexact cases with non-BE tag encountered"; exit $EXIT_CODE_NON_BE; fi - exit 0 -.update-ltv-repo: &update-ltv-repo - - cd $LTV_DIR - - git pull - - cd - - .update-ltv-repo-win: &update-ltv-repo-win - Push-Location - cd $LTV_DIR_WIN - git pull - Pop-Location -.disable-limiter: &disable-limiter -# automatically enable #define DISABLE_LIMITER in options.h, handling both /**/-comment and //-comment - - sed -i.bak -e "s/\/\*[[:space:]]*\(#define[[:space:]]*DISABLE_LIMITER\)[[:space:]]*\*\//\1/g" ./lib_com/options.h - -.get-commits-behind-count: &get-commits-behind-count - - echo $CI_COMMIT_SHA - - echo $CI_MERGE_REQUEST_TARGET_BRANCH_NAME - - commits_behind_count=$(git rev-list --count $CI_COMMIT_SHA..origin/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME) - -.check-commits-behind-count-in-compare-jobs: &check-commits-behind-count-in-compare-jobs - - if [ $commits_behind_count -ne 0 ]; then echo "Your branch is not up-to-date with main -> Compare tests will not run as they can contain false negatives this way.\nMain might have changed during your pipeline run. Run 'git merge origin/main' to update."; exit 1; fi - -.copy-ltv-files-to-testv-dir: ©-ltv-files-to-testv-dir - - cp "$LTV_DIR"/*.wav scripts/testv/ - - cp "$LTV_DIR"/*.met scripts/testv/ - - cp "$LTV_DIR"/*.csv scripts/testv/ - .copy-ltv-files-to-testv-dir-win: ©-ltv-files-to-testv-dir-win - cp $LTV_DIR_WIN\*.wav scripts\testv - cp $LTV_DIR_WIN\*.met scripts\testv - cp $LTV_DIR_WIN\*.csv scripts\testv -.activate-Werror-linux: &activate-Werror-linux - - sed -i.bak "s/^# \(CFLAGS += -Werror\)/\1/" Makefile - - sed -i.bak "s/# \(set(CMAKE_C_FLAGS \"\${CMAKE_C_FLAGS} -Werror\")\)/\1/" CMakeLists.txt - .activate-WX-windows: &activate-WX-windows - (Get-Content -Path "CMakeLists.txt") -replace '# \(add_compile_options\("\/WX"\)\)', '$1' | Set-Content -Path "CMakeLists.txt" - Get-ChildItem -Path "Workspace_msvc" -Filter "*.vcxproj" | ForEach-Object { (Get-Content -Path $_.FullName) -replace 'false', 'true' | Set-Content -Path $_.FullName } # to be reused in MR and LTV-scheduled sanitizer test jobs # set CLANG_NUM, SELFTEST_SANITY_TIMEOUT and SELF_TEST_PRM_FILE in before_script section -.sanitizer-selftest-anchor: &sanitizer-selftest-anchor +.sanitizer-selftest-anchor: script: - - *print-common-info - - *copy-ltv-files-to-testv-dir + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/print-common-info.sh + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/copy-ltv-files-to-testv-dir.sh - make clean - make -j CLANG=$CLANG_NUM - testcase_timeout=$SELFTEST_SANITY_TIMEOUT @@ -265,140 +162,6 @@ stages: - if [ $exit_code20 -ne 0 ] || [ $exit_code10 -ne 0 ] || [ $exit_code5 -ne 0 ]; then exit 1; fi -# --------------------------------------------------------------- -# Job templates -# --------------------------------------------------------------- - -# When designing templates, try not to use too much inheritance and -# if multiple templates and extended on, remember that on conflict, -# latest overwrites the parameter. - -# templates for rules -.rules-basis: - rules: - - if: $MIRROR_ACCESS_TOKEN # Don't run in the mirror update pipeline (only then MIRROR_ACCESS_TOKEN is defined) - when: never - - if: $CI_PIPELINE_SOURCE == 'schedule' # Don't run in any scheduled pipelines by default (use schedule templates below to enable again for certain conditions) - when: never - - if: $CI_PIPELINE_SOURCE == 'trigger' # Don't run triggered pipeline by default - when: never - - if: $MANUAL_PIPELINE_TYPE == 'test-be-release' # Skip all the normal jobs when testing manually against release codec - when: never - - if: $MANUAL_PIPELINE_TYPE == 'test-long-self-test' # Skip all the normal jobs when testing manually against release codec - when: never - - if: $MANUAL_PIPELINE_TYPE == 'ivas-conformance' - when: never - - if: $MANUAL_PIPELINE_TYPE == 'ivas-conformance-linux' - when: never - - if: $MANUAL_PIPELINE_TYPE == 'check-clipping' - when: never - - if: $MANUAL_PIPELINE_TYPE == 'test-branch-vs-input-passthrough' - when: never - - when: on_success - -.rules-merge-request-to-main: - extends: .rules-basis - rules: - - if: $CI_PIPELINE_SOURCE == 'merge_request_event' && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "main" - - if: $CI_PIPELINE_SOURCE == 'push' - when: never - -.rules-merge-request-to-basop-ci-branch: - extends: .rules-basis - rules: - - if: $CI_PIPELINE_SOURCE == 'merge_request_event' && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "basop-ci-branch" - - if: $CI_PIPELINE_SOURCE == 'push' - when: never - -.rules-merge-request-to-basop-ci-branch-or-main: - extends: .rules-basis - rules: - - if: $CI_PIPELINE_SOURCE == 'merge_request_event' && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "basop-ci-branch" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "main") - - if: $CI_PIPELINE_SOURCE == 'push' - when: never - -.rules-main-push: - extends: .rules-basis - rules: - - if: $CI_PIPELINE_SOURCE == 'push' && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH - -.rules-main-scheduled: - extends: .rules-basis - rules: - - if: $CI_PIPELINE_SOURCE == 'schedule' && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH - -# templates to define stages and platforms -.test-job-linux: - tags: - - ivas-linux - -.build-job-linux: - stage: build - timeout: "4 minutes" - needs: [] - tags: - - ivas-linux - -.build-job-windows: - stage: build - needs: [] - timeout: "4 minutes" - tags: - - ivas-windows - -# template for test jobs on linux that need the TESTV_DIR -.test-job-linux-needs-testv-dir: - extends: .test-job-linux - before_script: - - if [ ! -d "$TESTV_DIR" ]; then mkdir -p $TESTV_DIR; fi - - python3 scripts/prepare_combined_format_inputs.py - - cp -r scripts/testv/* $TESTV_DIR/ - -.sanitizer-selftest-on-mr: - stage: test - extends: - - .test-job-linux-needs-testv-dir - - .rules-merge-request-to-main - artifacts: - name: "mr-$CI_MERGE_REQUEST_IID--sha-$CI_COMMIT_SHORT_SHA--stage-$CI_JOB_STAGE--results" - expire_in: 1 week - when: always - paths: - - report-junit-20ms.xml - - report-junit-10ms.xml - - report-junit-5ms.xml - - report-20ms.html - - report-10ms.html - - report-5ms.html - expose_as: "Sanitizer selftest results" - reports: - junit: - - report-junit-20ms.xml - - report-junit-10ms.xml - - report-junit-5ms.xml - -.sanitizer-selftest-ltv: - stage: test - extends: - - .test-job-linux-needs-testv-dir - artifacts: - name: "$CI_JOB_NAME--sha-$CI_COMMIT_SHORT_SHA--results" - expire_in: 2 week - when: always - paths: - - report-junit-20ms.xml - - report-junit-10ms.xml - - report-junit-5ms.xml - - report-20ms.html - - report-10ms.html - - report-5ms.html - expose_as: "Sanitizer selftest results" - reports: - junit: - - report-junit-20ms.xml - - report-junit-10ms.xml - - report-junit-5ms.xml - # --------------------------------------------------------------- # .pre jobs for setting up things # --------------------------------------------------------------- @@ -428,45 +191,49 @@ uninterruptible: branch-is-up-to-date-with-main-pre: extends: - .rules-merge-request-to-main + - .job-linux stage: prevalidate needs: [] - tags: - - ivas-linux script: - - *get-commits-behind-count - - echo $commits_behind_count - - if [ $commits_behind_count -eq 0 ]; then exit 0; else echo "Your branch is behind main, run 'git merge origin/main' to update."; exit 1; fi; + - | + commits_behind_count="$(bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/get-commits-behind-count.sh)" + echo "Commits behind: $commits_behind_count" + if [ "$commits_behind_count" -ne 0 ]; then + echo "Your branch is behind main, run 'git merge origin/main' to update." + exit 1 + fi check-self-test-names-pre: extends: - .rules-merge-request-to-main + - .job-linux stage: prevalidate needs: [] - tags: - - ivas-linux script: - python3 ci/check_self_test_names.py scripts/config/self_test.prm 135 check-no-duplicates-in-self-tests: extends: - .rules-merge-request-to-main + - .job-linux stage: prevalidate needs: [] - tags: - - ivas-linux script: - python3 ci/find_duplicates_in_prm_files.py branch-is-up-to-date-with-main-post: extends: - .rules-merge-request-to-main + - .job-linux stage: postvalidate - tags: - - ivas-linux script: - - *get-commits-behind-count - - echo $commits_behind_count - - if [ $commits_behind_count -eq 0 ]; then exit 0; else echo "Your branch is behind main, possibly main changed during your pipeline run, run 'git merge origin/main' to update." exit 1; fi; + - | + commits_behind_count="$(bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/get-commits-behind-count.sh)" + echo "Commits behind: $commits_behind_count" + if [ "$commits_behind_count" -ne 0 ]; then + echo "Your branch is behind main, possibly main changed during your pipeline run, run 'git merge origin/main' to update." + exit 1 + fi .basop-ci-branch-compat-template: extends: @@ -475,12 +242,13 @@ branch-is-up-to-date-with-main-post: tags: - ivas-linux before_script: + - !reference [.job-linux, before_script] - python3 ci/remove_unsupported_testcases.py scripts/config/self_test.prm scripts/config/self_test_ltv.prm - python3 tests/create_short_testvectors.py - python3 scripts/prepare_combined_format_inputs.py - - *update-ltv-repo - - *copy-ltv-files-to-testv-dir + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/update-ltv-repo.sh + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/copy-ltv-files-to-testv-dir.sh - *get-basop-float-reference @@ -562,8 +330,8 @@ build-codec-linux-make: - .build-job-linux - .rules-basis script: - - *print-common-info - - *activate-Werror-linux + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/print-common-info.sh + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/activate-Werror-linux.sh - make -j build-codec-linux-cmake: @@ -571,8 +339,8 @@ build-codec-linux-cmake: - .build-job-linux - .rules-basis script: - - *print-common-info - - *activate-Werror-linux + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/print-common-info.sh + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/activate-Werror-linux.sh - mkdir build - cd build - cmake .. @@ -585,7 +353,7 @@ build-codec-instrumented-linux: - .rules-basis timeout: "10 minutes" script: - - *print-common-info + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/print-common-info.sh - ./scripts/prepare_instrumentation.sh - make -j -C scripts/c-code_instrument @@ -595,8 +363,8 @@ build-codec-sanitizers-linux: - .build-job-linux - .rules-basis script: - - *print-common-info - - *activate-Werror-linux + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/print-common-info.sh + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/activate-Werror-linux.sh - bash ci/build_codec_sanitizers_linux.sh build-codec-windows-cmake: @@ -633,9 +401,9 @@ codec-smoke-test: stage: test needs: ["build-codec-linux-cmake", "build-codec-linux-make", "build-codec-instrumented-linux", "build-codec-sanitizers-linux"] script: - - *print-common-info + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/print-common-info.sh # LTV update needed as ltv ISM metadata files are used - - *update-ltv-repo + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/update-ltv-repo.sh # for MRs to basop-ci-branch, we want to test with the BASOP float reference build # per default, the smoke test builds the current repo again with WMOPS activated to catch unbalanced instrumentation macros @@ -668,38 +436,41 @@ codec-smoke-test: codec-msan: extends: - .sanitizer-selftest-on-mr + - .sanitizer-selftest-anchor tags: - ivas-linux-fast before_script: + - !reference [.job-linux, before_script] - CLANG_NUM=1 - SELFTEST_SANITY_TIMEOUT=$TESTCASE_TIMEOUT_STV_SANITIZERS - SELF_TEST_PRM_FILE="scripts/config/self_test.prm" - USE_LTV="" - <<: *sanitizer-selftest-anchor # code selftest testvectors with address-sanitizer binaries codec-asan: extends: - .sanitizer-selftest-on-mr + - .sanitizer-selftest-anchor before_script: + - !reference [.job-linux, before_script] - CLANG_NUM=2 - SELFTEST_SANITY_TIMEOUT=$TESTCASE_TIMEOUT_STV_SANITIZERS - SELF_TEST_PRM_FILE="scripts/config/self_test.prm" - USE_LTV="" - <<: *sanitizer-selftest-anchor # code selftest testvectors with undefined-behaviour-sanitizer binaries codec-usan: extends: - .sanitizer-selftest-on-mr + - .sanitizer-selftest-anchor tags: - ivas-linux-fast before_script: + - !reference [.job-linux, before_script] - CLANG_NUM=3 - SELFTEST_SANITY_TIMEOUT=$TESTCASE_TIMEOUT_STV_SANITIZERS - SELF_TEST_PRM_FILE="scripts/config/self_test.prm" - USE_LTV="" - <<: *sanitizer-selftest-anchor # compare bit-exactness between 5ms and 20 on the branch pytest-compare-20ms-and-5ms-rendering: @@ -709,8 +480,8 @@ pytest-compare-20ms-and-5ms-rendering: stage: test needs: ["build-codec-linux-cmake", "build-codec-linux-make", "build-codec-instrumented-linux", "build-codec-sanitizers-linux"] script: - - *print-common-info - - *disable-limiter + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/print-common-info.sh + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/float/disable-limiter.sh - make clean - make -j ### prepare pytest @@ -856,9 +627,8 @@ renderer-pytest-on-merge-request: timeout: "20 minutes" stage: compare script: - - *print-common-info - - *get-commits-behind-count - - *check-commits-behind-count-in-compare-jobs + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/print-common-info.sh + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/float/check-commits-behind-count-in-compare-jobs.sh - *merge-request-comparison-setup-codec # some helper variables - "|| true" to prevent failures from grep not finding anything @@ -941,9 +711,9 @@ split-rendering-pytest-on-merge-request: timeout: "30 minutes" stage: compare script: - - *print-common-info - - *get-commits-behind-count - - *check-commits-behind-count-in-compare-jobs + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/print-common-info.sh + - commits_behind_count="$(bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/get-commits-behind-count.sh)" + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/float/check-commits-behind-count-in-compare-jobs.sh # some helper variables - "|| true" to prevent failures from grep not finding anything # write to temporary file as workaround for failures observed with piping echo @@ -954,8 +724,8 @@ split-rendering-pytest-on-merge-request: # store the current commit hash - source_branch_commit_sha=$(git rev-parse HEAD) - - *mr-fetch-target-branch - - *mr-get-target-commit + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/mr-fetch-target-branch.sh + - target_commit="$("${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/mr-get-target-commit.sh)" - git checkout $target_commit - echo "Building reference codec at commit $target_commit" @@ -1012,9 +782,9 @@ ivas-pytest-on-merge-request: needs: ["build-codec-linux-cmake", "codec-smoke-test"] timeout: "14 minutes" script: - - *print-common-info - - *get-commits-behind-count - - *check-commits-behind-count-in-compare-jobs + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/print-common-info.sh + - commits_behind_count="$(bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/get-commits-behind-count.sh)" + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/float/check-commits-behind-count-in-compare-jobs.sh - *merge-request-comparison-setup-codec # some helper variables - "|| true" to prevent failures from grep not finding anything @@ -1066,9 +836,9 @@ ivas-interop-on-merge-request: needs: ["build-codec-linux-cmake"] timeout: "10 minutes" script: - - *print-common-info - - *get-commits-behind-count - - *check-commits-behind-count-in-compare-jobs + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/print-common-info.sh + - commits_behind_count="$(bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/get-commits-behind-count.sh)" + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/float/check-commits-behind-count-in-compare-jobs.sh - *merge-request-comparison-setup-codec # the next line is dependent on ref-using-main flag in the other tests, but here the flag does not make sense - git checkout $source_branch_commit_sha @@ -1115,9 +885,9 @@ evs-pytest-on-merge-request: needs: ["build-codec-linux-cmake", "codec-smoke-test"] timeout: "10 minutes" script: - - *print-common-info - - *get-commits-behind-count - - *check-commits-behind-count-in-compare-jobs + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/print-common-info.sh + - commits_behind_count="$(bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/get-commits-behind-count.sh)" + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/float/check-commits-behind-count-in-compare-jobs.sh - *merge-request-comparison-setup-codec # some helper variables - "|| true" to prevent failures from grep not finding anything @@ -1167,7 +937,7 @@ voip-be-on-merge-request: needs: ["build-codec-linux-make"] timeout: "10 minutes" script: - - *print-common-info + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/print-common-info.sh - make clean - make -j - python3 -m pytest tests/test_be_for_jbm_neutral_dly_profile.py @@ -1223,16 +993,14 @@ check-first-frame-is-sid: extends: - .test-job-linux-needs-testv-dir - .rules-merge-request-to-main - tags: - - ivas-linux stage: test needs: ["build-codec-linux-cmake"] script: - - *print-common-info - - *update-ltv-repo + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/print-common-info.sh + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/update-ltv-repo.sh # this rm makes check-for-testvectors only check for the signals we actually need in this test - rm scripts/config/ci_linux_ltv.json scripts/config/ci_linux.json - - *check-for-testvectors + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/check-for-testvectors.sh - bash ci/run-first-frame-is-sid-test.sh artifacts: @@ -1269,7 +1037,7 @@ check-bitexactness-hrtf-rom-and-file: needs: ["build-codec-linux-cmake"] timeout: "5 minutes" script: - - *print-common-info + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/print-common-info.sh - cmake . - make -j - python3 tests/create_short_testvectors.py --cut_len 1.0 @@ -1291,7 +1059,7 @@ check-bitexactness-ext-and-transport-format: needs: ["build-codec-linux-cmake"] timeout: "5 minutes" script: - - *print-common-info + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/print-common-info.sh - cmake . - make -j - python3 tests/create_short_testvectors.py --cut_len 1.0 @@ -1345,7 +1113,7 @@ be-2-evs-linux: needs: ["build-codec-linux-cmake"] timeout: "20 minutes" # To be revisited script: - - *print-common-info + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/print-common-info.sh - mkdir build - cd build @@ -1369,9 +1137,9 @@ codec-comparison-on-main-push: needs: ["build-codec-linux-cmake"] timeout: "30 minutes" # To be revisited script: - - *print-common-info + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/print-common-info.sh - latest_commit=$(git rev-parse HEAD) # Latest commit - - *get-previous-merge-commit-sha # Stored in previous_merge_commit shell variable now + - previous_merge_commit=$(git --no-pager log --merges HEAD~1 -n 1 --pretty=format:%H) - echo "Comparing changes from $previous_merge_commit to $latest_commit" - git --no-pager diff --stat $previous_merge_commit..$latest_commit @@ -1569,8 +1337,8 @@ ivas-conformance: junit: report-junit.xml ivas-conformance-linux: - tags: - - ivas-linux + extends: + - .job-linux stage: test timeout: "90 minutes" rules: @@ -1579,7 +1347,7 @@ ivas-conformance-linux: exit_codes: - 123 script: - - *print-common-info + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/print-common-info.sh - make -j - cp IVAS_cod IVAS_cod_ref - cp IVAS_dec IVAS_dec_ref @@ -1676,8 +1444,8 @@ ivas-conformance-linux: test-long-self-test: - tags: - - ivas-linux-fast + extends: + - .job-linux stage: compare resource_group: ivas-long-self-test-resource timeout: "50 minutes" @@ -1687,8 +1455,8 @@ test-long-self-test: exit_codes: - 123 script: - - *print-common-info - - *update-ltv-repo + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/print-common-info.sh + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/update-ltv-repo.sh ### build branch binaries - cmake . -Bbuild-test @@ -1716,7 +1484,7 @@ test-long-self-test: ### prepare pytest # Copy test vectors from LTV to TESTV - - *copy-ltv-files-to-testv-dir + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/copy-ltv-files-to-testv-dir.sh # create references - exit_code_ref=0 @@ -1746,8 +1514,8 @@ test-long-self-test: - report-junit-ltv.xml check-clipping: - tags: - - ivas-linux + extends: + - .job-linux stage: test timeout: "30 minutes" rules: @@ -1756,8 +1524,8 @@ check-clipping: exit_codes: - 123 script: - - *print-common-info - - *enable-debugging-macro + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/print-common-info.sh + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/enable-debugging-macro.sh - make -j - tests/scale_pcm.py ./scripts/testv/ $SCALE_FACTOR # Default: 3.162 (+10 dB). Can be set in manual trigger. - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR -v --update_ref 1 --html=report.html --self-contained-html --junit-xml=report-junit.xml --ref_encoder_path ./IVAS_cod --ref_decoder_path ./IVAS_dec @@ -1776,8 +1544,8 @@ check-clipping: - report-junit.xml test-branch-vs-input-passthrough: - tags: - - ivas-linux + extends: + - .job-linux stage: compare timeout: "30 minutes" # TBD rules: @@ -1786,7 +1554,7 @@ test-branch-vs-input-passthrough: exit_codes: - 123 script: - - *print-common-info + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/print-common-info.sh - make -j - exit_code=0 @@ -1818,22 +1586,24 @@ test-branch-vs-input-passthrough: ltv-msan: extends: - .sanitizer-selftest-ltv + - .sanitizer-selftest-anchor rules: - if: $SANITIZER_SCHEDULE_E timeout: 4 hours tags: - ivas-linux-fast before_script: + - !reference [.job-linux, before_script] - CLANG_NUM=1 - SELFTEST_SANITY_TIMEOUT=$TESTCASE_TIMEOUT_LTV_SANITIZERS - SELF_TEST_PRM_FILE="scripts/config/self_test_ltv.prm" - USE_LTV="--use_ltv" - <<: *sanitizer-selftest-anchor # code selftest long testvectors with address-sanitizer binaries ltv-asan: extends: - .sanitizer-selftest-ltv + - .sanitizer-selftest-anchor rules: - if: $SANITIZER_SCHEDULE_E when: delayed @@ -1842,16 +1612,17 @@ ltv-asan: - ivas-linux-fast timeout: 4 hours before_script: + - !reference [.job-linux, before_script] - CLANG_NUM=2 - SELFTEST_SANITY_TIMEOUT=$TESTCASE_TIMEOUT_LTV_SANITIZERS - SELF_TEST_PRM_FILE="scripts/config/self_test_ltv.prm" - USE_LTV="--use_ltv" - <<: *sanitizer-selftest-anchor # code selftest long testvectors with undefined-behaviour-sanitizer binaries ltv-usan: extends: - .sanitizer-selftest-ltv + - .sanitizer-selftest-anchor rules: - if: $SANITIZER_SCHEDULE_E when: delayed @@ -1860,11 +1631,11 @@ ltv-usan: - ivas-linux-fast timeout: 4 hours before_script: + - !reference [.job-linux, before_script] - CLANG_NUM=3 - SELFTEST_SANITY_TIMEOUT=$TESTCASE_TIMEOUT_LTV_SANITIZERS - SELF_TEST_PRM_FILE="scripts/config/self_test_ltv.prm" - USE_LTV="--use_ltv" - <<: *sanitizer-selftest-anchor .sanitizer-test-template: extends: @@ -1897,7 +1668,7 @@ sanitizer-test-mono: - if: $SANITIZER_SCHEDULE_A timeout: 1.25 hours script: - - *update-ltv-repo + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/update-ltv-repo.sh - python3 ci/run_scheduled_sanitizer_test.py mono mono --tests $SANITIZER_TESTS sanitizer-test-stereo: @@ -1908,7 +1679,7 @@ sanitizer-test-stereo: start_in: 1.25 hours timeout: 2.5 hours script: - - *update-ltv-repo + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/update-ltv-repo.sh - python3 ci/run_scheduled_sanitizer_test.py stereo $OUT_FORMATS_CHANNEL_BASED EXT --tests $SANITIZER_TESTS sanitizer-test-stereodmxevs: @@ -1919,7 +1690,7 @@ sanitizer-test-stereodmxevs: start_in: 3.75 hours timeout: 1.25 hours script: - - *update-ltv-repo + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/update-ltv-repo.sh - python3 ci/run_scheduled_sanitizer_test.py StereoDmxEVS mono --tests $SANITIZER_TESTS sanitizer-test-mc-5_1: @@ -1930,7 +1701,7 @@ sanitizer-test-mc-5_1: start_in: 5 hours timeout: 2.5 hours script: - - *update-ltv-repo + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/update-ltv-repo.sh - python3 ci/run_scheduled_sanitizer_test.py 5_1 $OUT_FORMATS_ALL --tests $SANITIZER_TESTS sanitizer-test-mc-5_1_2: @@ -1941,7 +1712,7 @@ sanitizer-test-mc-5_1_2: start_in: 7.5 hours timeout: 2.5 hours script: - - *update-ltv-repo + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/update-ltv-repo.sh - python3 ci/run_scheduled_sanitizer_test.py 5_1_2 $OUT_FORMATS_ALL --tests $SANITIZER_TESTS sanitizer-test-mc-5_1_4: @@ -1952,7 +1723,7 @@ sanitizer-test-mc-5_1_4: start_in: 10 hours timeout: 3.75 hours script: - - *update-ltv-repo + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/update-ltv-repo.sh - python3 ci/run_scheduled_sanitizer_test.py 5_1_4 $OUT_FORMATS_ALL --tests $SANITIZER_TESTS sanitizer-test-mc-7_1: @@ -1963,7 +1734,7 @@ sanitizer-test-mc-7_1: start_in: 13.75 hours timeout: 2.5 hours script: - - *update-ltv-repo + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/update-ltv-repo.sh - python3 ci/run_scheduled_sanitizer_test.py 7_1 $OUT_FORMATS_ALL --tests $SANITIZER_TESTS sanitizer-test-mc-7_1_4: @@ -1974,7 +1745,7 @@ sanitizer-test-mc-7_1_4: start_in: 16.25 hours timeout: 5 hours script: - - *update-ltv-repo + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/update-ltv-repo.sh - python3 ci/run_scheduled_sanitizer_test.py 7_1_4 $OUT_FORMATS_ALL --tests $SANITIZER_TESTS sanitizer-test-ism+1: @@ -1985,7 +1756,7 @@ sanitizer-test-ism+1: start_in: 21.25 hours timeout: 1.25 hours script: - - *update-ltv-repo + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/update-ltv-repo.sh - python3 ci/run_scheduled_sanitizer_test.py ISM1 $OUT_FORMATS_ALL --tests $SANITIZER_TESTS sanitizer-test-ism+2: @@ -1996,7 +1767,7 @@ sanitizer-test-ism+2: start_in: 22.5 hours timeout: 2.5 hours script: - - *update-ltv-repo + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/update-ltv-repo.sh - python3 ci/run_scheduled_sanitizer_test.py ISM2 $OUT_FORMATS_ALL --tests $SANITIZER_TESTS sanitizer-test-ism+3: @@ -2007,7 +1778,7 @@ sanitizer-test-ism+3: start_in: 25 hours timeout: 3.75 hour script: - - *update-ltv-repo + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/update-ltv-repo.sh - python3 ci/run_scheduled_sanitizer_test.py ISM3 $OUT_FORMATS_ALL --tests $SANITIZER_TESTS sanitizer-test-ism+4: @@ -2018,7 +1789,7 @@ sanitizer-test-ism+4: start_in: 28.75 hours timeout: 5 hours script: - - *update-ltv-repo + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/update-ltv-repo.sh - python3 ci/run_scheduled_sanitizer_test.py ISM4 $OUT_FORMATS_ALL --tests $SANITIZER_TESTS sanitizer-test-masa: @@ -2029,7 +1800,7 @@ sanitizer-test-masa: start_in: 33.75 hours timeout: 10 hours script: - - *update-ltv-repo + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/update-ltv-repo.sh - python3 ci/run_scheduled_sanitizer_test.py MASA $OUT_FORMATS_ALL --tests $SANITIZER_TESTS ### --- sanitizer schedule B --- @@ -2044,7 +1815,7 @@ sanitizer-test-foa: rules: - if: $SANITIZER_SCHEDULE_B script: - - *update-ltv-repo + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/update-ltv-repo.sh - python3 ci/run_scheduled_sanitizer_test.py FOA $OUT_FORMATS_ALL --tests $SANITIZER_TESTS sanitizer-test-hoa2: @@ -2054,7 +1825,7 @@ sanitizer-test-hoa2: when: delayed start_in: 7.5 hours script: - - *update-ltv-repo + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/update-ltv-repo.sh - python3 ci/run_scheduled_sanitizer_test.py HOA2 $OUT_FORMATS_ALL --tests $SANITIZER_TESTS sanitizer-test-hoa3: @@ -2064,7 +1835,7 @@ sanitizer-test-hoa3: when: delayed start_in: 15 hours script: - - *update-ltv-repo + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/update-ltv-repo.sh - python3 ci/run_scheduled_sanitizer_test.py HOA3 $OUT_FORMATS_ALL --tests $SANITIZER_TESTS sanitizer-test-osba-foa-ism1: @@ -2074,7 +1845,7 @@ sanitizer-test-osba-foa-ism1: when: delayed start_in: 22.5 hours script: - - *update-ltv-repo + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/update-ltv-repo.sh - python3 ci/run_scheduled_sanitizer_test.py FOA-ISM1 $OUT_FORMATS_ALL --tests $SANITIZER_TESTS sanitizer-test-osba-foa-ism2: @@ -2084,7 +1855,7 @@ sanitizer-test-osba-foa-ism2: when: delayed start_in: 30 hours script: - - *update-ltv-repo + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/update-ltv-repo.sh - python3 ci/run_scheduled_sanitizer_test.py FOA-ISM2 $OUT_FORMATS_ALL --tests $SANITIZER_TESTS sanitizer-test-osba-foa-ism3: @@ -2094,7 +1865,7 @@ sanitizer-test-osba-foa-ism3: when: delayed start_in: 37.5 hours script: - - *update-ltv-repo + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/update-ltv-repo.sh - python3 ci/run_scheduled_sanitizer_test.py FOA-ISM3 $OUT_FORMATS_ALL --tests $SANITIZER_TESTS sanitizer-test-osba-foa-ism4: @@ -2104,7 +1875,7 @@ sanitizer-test-osba-foa-ism4: when: delayed start_in: 45 hours script: - - *update-ltv-repo + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/update-ltv-repo.sh - python3 ci/run_scheduled_sanitizer_test.py FOA-ISM4 $OUT_FORMATS_ALL --tests $SANITIZER_TESTS sanitizer-test-osba-hoa2-ism1: @@ -2114,7 +1885,7 @@ sanitizer-test-osba-hoa2-ism1: when: delayed start_in: 52.5 hours script: - - *update-ltv-repo + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/update-ltv-repo.sh - python3 ci/run_scheduled_sanitizer_test.py HOA2-ISM1 $OUT_FORMATS_ALL --tests $SANITIZER_TESTS sanitizer-test-osba-hoa2-ism2: @@ -2124,7 +1895,7 @@ sanitizer-test-osba-hoa2-ism2: when: delayed start_in: 60 hours script: - - *update-ltv-repo + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/update-ltv-repo.sh - python3 ci/run_scheduled_sanitizer_test.py HOA2-ISM2 $OUT_FORMATS_ALL --tests $SANITIZER_TESTS sanitizer-test-osba-hoa2-ism3: @@ -2134,7 +1905,7 @@ sanitizer-test-osba-hoa2-ism3: when: delayed start_in: 67.5 hours script: - - *update-ltv-repo + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/update-ltv-repo.sh - python3 ci/run_scheduled_sanitizer_test.py HOA2-ISM3 $OUT_FORMATS_ALL --tests $SANITIZER_TESTS sanitizer-test-osba-hoa2-ism4: @@ -2144,7 +1915,7 @@ sanitizer-test-osba-hoa2-ism4: when: delayed start_in: 75 hours script: - - *update-ltv-repo + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/update-ltv-repo.sh - python3 ci/run_scheduled_sanitizer_test.py HOA2-ISM4 $OUT_FORMATS_ALL --tests $SANITIZER_TESTS sanitizer-test-osba-hoa3-ism1: @@ -2154,7 +1925,7 @@ sanitizer-test-osba-hoa3-ism1: when: delayed start_in: 82.5 hours script: - - *update-ltv-repo + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/update-ltv-repo.sh - python3 ci/run_scheduled_sanitizer_test.py HOA3-ISM1 $OUT_FORMATS_ALL --tests $SANITIZER_TESTS sanitizer-test-osba-hoa3-ism2: @@ -2164,7 +1935,7 @@ sanitizer-test-osba-hoa3-ism2: when: delayed start_in: 90 hours script: - - *update-ltv-repo + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/update-ltv-repo.sh - python3 ci/run_scheduled_sanitizer_test.py HOA3-ISM2 $OUT_FORMATS_ALL --tests $SANITIZER_TESTS sanitizer-test-omasa-ism4: @@ -2175,7 +1946,7 @@ sanitizer-test-omasa-ism4: start_in: 97.5 hours timeout: 10 hours script: - - *update-ltv-repo + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/update-ltv-repo.sh - python3 ci/run_scheduled_sanitizer_test.py MASA-ISM4 $OUT_FORMATS_ALL --tests $SANITIZER_TESTS @@ -2191,7 +1962,7 @@ sanitizer-test-omasa-ism1: rules: - if: $SANITIZER_SCHEDULE_C script: - - *update-ltv-repo + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/update-ltv-repo.sh - python3 ci/run_scheduled_sanitizer_test.py MASA-ISM1 $OUT_FORMATS_ALL --tests $SANITIZER_TESTS sanitizer-test-omasa-ism2: @@ -2201,7 +1972,7 @@ sanitizer-test-omasa-ism2: when: delayed start_in: 10 hours script: - - *update-ltv-repo + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/update-ltv-repo.sh - python3 ci/run_scheduled_sanitizer_test.py MASA-ISM2 $OUT_FORMATS_ALL --tests $SANITIZER_TESTS sanitizer-test-omasa-ism3: @@ -2211,7 +1982,7 @@ sanitizer-test-omasa-ism3: when: delayed start_in: 20 hours script: - - *update-ltv-repo + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/update-ltv-repo.sh - python3 ci/run_scheduled_sanitizer_test.py MASA-ISM3 $OUT_FORMATS_ALL --tests $SANITIZER_TESTS sanitizer-test-osba-hoa3-ism3: @@ -2222,7 +1993,7 @@ sanitizer-test-osba-hoa3-ism3: start_in: 30 hours timeout: 7.5 hours script: - - *update-ltv-repo + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/update-ltv-repo.sh - python3 ci/run_scheduled_sanitizer_test.py HOA3-ISM3 $OUT_FORMATS_ALL --tests $SANITIZER_TESTS sanitizer-test-osba-hoa3-ism4: @@ -2233,7 +2004,7 @@ sanitizer-test-osba-hoa3-ism4: start_in: 37.5 hours timeout: 7.5 hours script: - - *update-ltv-repo + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/update-ltv-repo.sh - python3 ci/run_scheduled_sanitizer_test.py HOA3-ISM4 $OUT_FORMATS_ALL --tests $SANITIZER_TESTS ### --- sanitizer schedule D --- @@ -2248,7 +2019,7 @@ sanitizer-test-planar-foa: rules: - if: $SANITIZER_SCHEDULE_D script: - - *update-ltv-repo + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/update-ltv-repo.sh - python3 ci/run_scheduled_sanitizer_test.py PlanarFOA $OUT_FORMATS_ALL --tests $SANITIZER_TESTS sanitizer-test-planar-hoa2: @@ -2258,7 +2029,7 @@ sanitizer-test-planar-hoa2: when: delayed start_in: 7.5 hours script: - - *update-ltv-repo + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/update-ltv-repo.sh - python3 ci/run_scheduled_sanitizer_test.py PlanarHOA2 $OUT_FORMATS_ALL --tests $SANITIZER_TESTS sanitizer-test-planar-hoa3: @@ -2268,7 +2039,7 @@ sanitizer-test-planar-hoa3: when: delayed start_in: 15 hours script: - - *update-ltv-repo + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/update-ltv-repo.sh - python3 ci/run_scheduled_sanitizer_test.py PlanarHOA3 $OUT_FORMATS_ALL --tests $SANITIZER_TESTS sanitizer-test-osba-planar-foa-ism1: @@ -2278,7 +2049,7 @@ sanitizer-test-osba-planar-foa-ism1: when: delayed start_in: 22.5 hours script: - - *update-ltv-repo + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/update-ltv-repo.sh - python3 ci/run_scheduled_sanitizer_test.py PlanarFOA-ISM1 $OUT_FORMATS_ALL --tests $SANITIZER_TESTS sanitizer-test-osba-planar-foa-ism2: @@ -2288,7 +2059,7 @@ sanitizer-test-osba-planar-foa-ism2: when: delayed start_in: 30 hours script: - - *update-ltv-repo + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/update-ltv-repo.sh - python3 ci/run_scheduled_sanitizer_test.py PlanarFOA-ISM2 $OUT_FORMATS_ALL --tests $SANITIZER_TESTS sanitizer-test-osba-planar-foa-ism3: @@ -2298,7 +2069,7 @@ sanitizer-test-osba-planar-foa-ism3: when: delayed start_in: 37.5 hours script: - - *update-ltv-repo + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/update-ltv-repo.sh - python3 ci/run_scheduled_sanitizer_test.py PlanarFOA-ISM3 $OUT_FORMATS_ALL --tests $SANITIZER_TESTS sanitizer-test-osba-planar-foa-ism4: @@ -2308,7 +2079,7 @@ sanitizer-test-osba-planar-foa-ism4: when: delayed start_in: 45 hours script: - - *update-ltv-repo + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/update-ltv-repo.sh - python3 ci/run_scheduled_sanitizer_test.py PlanarFOA-ISM4 $OUT_FORMATS_ALL --tests $SANITIZER_TESTS sanitizer-test-osba-planar-hoa2-ism1: @@ -2318,7 +2089,7 @@ sanitizer-test-osba-planar-hoa2-ism1: when: delayed start_in: 52.5 hours script: - - *update-ltv-repo + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/update-ltv-repo.sh - python3 ci/run_scheduled_sanitizer_test.py PlanarHOA2-ISM1 $OUT_FORMATS_ALL --tests $SANITIZER_TESTS sanitizer-test-osba-planar-hoa2-ism2: @@ -2328,7 +2099,7 @@ sanitizer-test-osba-planar-hoa2-ism2: when: delayed start_in: 60 hours script: - - *update-ltv-repo + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/update-ltv-repo.sh - python3 ci/run_scheduled_sanitizer_test.py PlanarHOA2-ISM2 $OUT_FORMATS_ALL --tests $SANITIZER_TESTS sanitizer-test-osba-planar-hoa2-ism3: @@ -2338,7 +2109,7 @@ sanitizer-test-osba-planar-hoa2-ism3: when: delayed start_in: 67.5 hours script: - - *update-ltv-repo + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/update-ltv-repo.sh - python3 ci/run_scheduled_sanitizer_test.py PlanarHOA2-ISM3 $OUT_FORMATS_ALL --tests $SANITIZER_TESTS sanitizer-test-osba-planar-hoa2-ism4: @@ -2348,7 +2119,7 @@ sanitizer-test-osba-planar-hoa2-ism4: when: delayed start_in: 75 hours script: - - *update-ltv-repo + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/update-ltv-repo.sh - python3 ci/run_scheduled_sanitizer_test.py PlanarHOA2-ISM4 $OUT_FORMATS_ALL --tests $SANITIZER_TESTS sanitizer-test-osba-planar-hoa3-ism1: @@ -2358,7 +2129,7 @@ sanitizer-test-osba-planar-hoa3-ism1: when: delayed start_in: 82.5 hours script: - - *update-ltv-repo + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/update-ltv-repo.sh - python3 ci/run_scheduled_sanitizer_test.py PlanarHOA3-ISM1 $OUT_FORMATS_ALL --tests $SANITIZER_TESTS sanitizer-test-osba-planar-hoa3-ism2: @@ -2368,7 +2139,7 @@ sanitizer-test-osba-planar-hoa3-ism2: when: delayed start_in: 90 hours script: - - *update-ltv-repo + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/update-ltv-repo.sh - python3 ci/run_scheduled_sanitizer_test.py PlanarHOA3-ISM2 $OUT_FORMATS_ALL --tests $SANITIZER_TESTS sanitizer-test-osba-planar-hoa3-ism3: @@ -2378,7 +2149,7 @@ sanitizer-test-osba-planar-hoa3-ism3: when: delayed start_in: 97.5 hours script: - - *update-ltv-repo + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/update-ltv-repo.sh - python3 ci/run_scheduled_sanitizer_test.py PlanarHOA3-ISM3 $OUT_FORMATS_ALL --tests $SANITIZER_TESTS sanitizer-test-osba-planar-hoa3-ism4: @@ -2388,7 +2159,7 @@ sanitizer-test-osba-planar-hoa3-ism4: when: delayed start_in: 105 hours script: - - *update-ltv-repo + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/update-ltv-repo.sh - python3 ci/run_scheduled_sanitizer_test.py PlanarHOA3-ISM4 $OUT_FORMATS_ALL --tests $SANITIZER_TESTS @@ -2406,9 +2177,9 @@ coverage-test-on-main-scheduled: - if: $COVERAGE_TEST timeout: 3 hours script: - - *print-common-info - - *update-ltv-repo - - *copy-ltv-files-to-testv-dir + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/print-common-info.sh + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/update-ltv-repo.sh + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/copy-ltv-files-to-testv-dir.sh - make GCOV=1 -j - cp IVAS_rend IVAS_rend_ref # Copy exec to be able to run renderer script @@ -2513,8 +2284,9 @@ coverage-test-on-main-scheduled: timeout: 3 hours 30 minutes stage: test before_script: - - *print-common-info - - *update-ltv-repo + - !reference [.job-linux, before_script] + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/print-common-info.sh + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/update-ltv-repo.sh - *complexity-measurements-setup allow_failure: exit_codes: @@ -2831,8 +2603,8 @@ complexity-osba-in-binaural_room_ir-out: # job that sets up gitlab pages website pages: stage: deploy - tags: - - ivas-linux + extends: + - .job-linux rules: - if: $UPDATE_PAGES script: diff --git a/.gitlab-ci/variables.yml b/.gitlab-ci/variables.yml new file mode 100644 index 0000000000000000000000000000000000000000..9e60194a6c7cbe29dba20cbbcc6de430961cb571 --- /dev/null +++ b/.gitlab-ci/variables.yml @@ -0,0 +1,30 @@ +variables: + EVS_BE_TEST_DIR: "/usr/local/be_2_evs_test" + EVS_BE_WIN_TEST_DIR: "C:/Users/gitlab-runner/testvec" + PROCESSING_SCRIPTS_BIN_DIR: "/test-bin" + 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_SCENE_BASED: "FOA HOA2 HOA3" + OUT_FORMATS_BINAURAL: "BINAURAL BINAURAL_ROOM_IR BINAURAL_ROOM_REVERB" + OUT_FORMATS_ALL: "$OUT_FORMATS_CHANNEL_BASED $OUT_FORMATS_SCENE_BASED $OUT_FORMATS_BINAURAL EXT" + MANUAL_PIPELINE_TYPE: + description: "Type for the manual pipeline run. Use 'test-be-release' to run BE test against release codec." + value: 'default' + options: + - 'default' + - 'test-be-release' + - 'test-long-self-test' + - 'ivas-conformance' + - 'ivas-conformance-linux' + - 'check-clipping' + - 'test-branch-vs-input-passthrough' + + PYTEST_ARGS: "" + LONG_TEST_SUITE: "tests/codec_be_on_mr_nonselection tests/renderer --param_file scripts/config/self_test_ltv.prm --use_ltv" + LONG_TEST_SUITE_NO_RENDERER: "tests/codec_be_on_mr_nonselection --param_file scripts/config/self_test_ltv.prm --use_ltv" + SHORT_TEST_SUITE: "tests/codec_be_on_mr_nonselection" + SHORT_TEST_SUITE_ENCODER: "tests/codec_be_on_mr_nonselection/test_param_file.py --param_file scripts/config/self_test_basop_encoder.prm" + LONG_TEST_SUITE_ENCODER: "tests/codec_be_on_mr_nonselection/test_param_file.py --param_file scripts/config/self_test_ltv_basop_encoder.prm" + TEST_SUITE: "" + # note: currently overwrites default value from ci repo + TESTCASE_TIMEOUT_STV_SANITIZERS: 240 diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index d2c2db4900af8458e78632f5d67bbd3674a80d58..d42da1b4228054c9f9db503821a9ebab1d86a9e7 100755 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -175,7 +175,11 @@ typedef enum #define MAX_JBM_L_FRAME48k 1920 #define MAX_JBM_L_FRAME_NS 40000000L #define MAX_SPAR_INTERNAL_CHANNELS IVAS_SPAR_MAX_CH +#ifdef UNIFIED_DECODING_PATHS_LEFTOVERS +#define MAX_CLDFB_DIGEST_CHANNELS 3 /* == maximum of ParamISM TCs and ParamMC TCs */ +#else #define MAX_CLDFB_DIGEST_CHANNELS (FOA_CHANNELS + MAX_NUM_OBJECTS) +#endif typedef enum { diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index f5e239f3b0634de8f42f932e8399101cb4b6af2a..e0dbc245d7330874fcf609d890e9674f7a56d0d7 100755 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -868,12 +868,13 @@ void ivas_jbm_dec_get_md_map( int16_t ivas_jbm_dec_get_num_tc_channels( Decoder_Struct *st_ivas /* i : IVAS decoder handle */ ); - +#ifndef UNIFIED_DECODING_PATHS_LEFTOVERS void ivas_jbm_dec_copy_tc_no_tsm( Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ float *tc[], /* i : transport channels */ const int16_t output_frame /* i : output frame size */ ); +#endif void ivas_jbm_dec_get_md_map_even_spacing( const int16_t len, /* i : length of the modfied frames in metadata slots */ @@ -1116,7 +1117,7 @@ void ivas_ism_dec_digest_tc( void ivas_param_ism_dec_digest_tc( Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ const uint16_t nCldfbSlots, /* i : number of CLDFB slots in transport channels */ - float *transport_channels_f[] /* i : synthesized core-coder transport channels/DirAC output */ + float *p_data_f[] /* i : synthesized core-coder transport channels/DirAC output */ ); void ivas_param_ism_dec_dequant_md( @@ -1128,13 +1129,14 @@ void ivas_param_ism_dec_prepare_renderer( const uint16_t nCldfbSlots /* i : number of CLDFB slots in transport channels */ ); +#ifndef UNIFIED_DECODING_PATHS_LEFTOVERS void ivas_ism_param_dec_tc_gain_ajust( Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ const uint16_t nSamples, /* i : number of samples to be compensate */ const uint16_t nFadeLength, /* i : length of the crossfade in samples */ - float *transport_channels_f[] /* i : synthesized core-coder transport channels/DirAC output */ + float *p_data_f[] /* i : synthesized core-coder transport channels/DirAC output */ ); - +#endif void ivas_param_ism_dec_render( Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ const uint16_t nSamplesAsked, /* i : number of CLDFB slots requested */ @@ -3875,7 +3877,7 @@ void ivas_param_mc_dec_read_BS( void ivas_param_mc_dec_digest_tc( Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ const uint8_t nCldfbSlots, /* i : number of CLDFB slots in transport channels */ - float *transport_channels_f[] /* i/o: synthesized core-coder transport channels/DirAC output*/ + float *p_data_f[] /* i/o: synthesized core-coder transport channels/DirAC output*/ ); void ivas_param_mc_dec_prepare_renderer( diff --git a/lib_com/options.h b/lib_com/options.h index 80cd7a383bbd806dfa0f5fa82fac8262234d7590..904e462921b017897641630066290f06d3d987be 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -160,6 +160,7 @@ /*#define FIX_I4_OL_PITCH*/ /* fix open-loop pitch used for EVS core switching */ #define TMP_FIX_1119_SPLIT_RENDERING_VOIP /* FhG: Add error check for unsupported config: split rendering with VoIP mode */ +#define UNIFIED_DECODING_PATHS_LEFTOVERS /* VA: issue 880: remove leftovers after NONBE_UNIFIED_DECODING_PATHS */ /* #################### End BE switches ################################## */ @@ -171,7 +172,7 @@ #define NONBE_1244_FIX_SWB_BWE_MEMORY /* VA: issue 1244: fix to SWB BWE memory in case of switching from FB coding - pending a review by Huawei */ #define NONBE_1122_KEEP_EVS_MODE_UNCHANGED /* FhG: Disables fix for issue 1122 in EVS mode to keep BE tests green. This switch should be removed once the 1122 fix is added to EVS via a CR. */ - +#define NONBE_1300_TDREND_LARGE_ITD /* Eri: issue 1300: There was a bug feeding 1.25 ms frames to the TD renderer, causing out-of-buffer access. This was resolved. However, it is still possible that modeled HRTF with large ITDs could trigger out-of-buffer access. This adds a check to prevent this.*/ /* ##################### End NON-BE switches ########################### */ diff --git a/lib_dec/ivas_dirac_dec.c b/lib_dec/ivas_dirac_dec.c index 6ce9439d4b6c40cbaa2f220eb924ea086796468d..cfc4b0bc308c94f2b0cb9fc2f994a0f89d8ca291 100644 --- a/lib_dec/ivas_dirac_dec.c +++ b/lib_dec/ivas_dirac_dec.c @@ -1554,7 +1554,7 @@ void ivas_dirac_dec_render( uint16_t slot_size, n_samples_sf, ch, nchan_intern; SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom; float *output_f_local[MAX_OUTPUT_CHANNELS]; - float output_f_local_buff[MAX_OUTPUT_CHANNELS][L_FRAME48k]; // VE2SB: TBV + float output_f_local_buff[MAX_OUTPUT_CHANNELS][L_FRAME48k]; hSpatParamRendCom = st_ivas->hSpatParamRendCom; diff --git a/lib_dec/ivas_ism_param_dec.c b/lib_dec/ivas_ism_param_dec.c index 52e9bd0d4c42e8dfc9577de9cdd84b85bc2cfb8f..a5a6f90f02cc859148455d9167175498198daf13 100644 --- a/lib_dec/ivas_ism_param_dec.c +++ b/lib_dec/ivas_ism_param_dec.c @@ -45,12 +45,20 @@ #include "wmc_auto.h" +#ifdef UNIFIED_DECODING_PATHS_LEFTOVERS +/*-----------------------------------------------------------------------* + * Local function declarations + *-----------------------------------------------------------------------*/ + +static void ivas_ism_param_dec_tc_gain_adjust( Decoder_Struct *st_ivas, const int16_t nSamples, const int16_t nFadeLength, float *p_data_f[] ); + +#endif /*-----------------------------------------------------------------------* * Local function definitions *-----------------------------------------------------------------------*/ static void ivas_param_ism_dec_dequant_DOA( - PARAM_ISM_DEC_HANDLE hParamIsmDec, /* i/o: decoder ParamISM handle */ + PARAM_ISM_DEC_HANDLE hParamIsmDec, /* i/o: decoder ParamISM handle */ const int16_t nchan_ism /* i : number of ISM channels */ ) { @@ -791,19 +799,33 @@ void ivas_ism_dec_digest_tc( *-------------------------------------------------------------------------*/ void ivas_param_ism_dec_digest_tc( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ - const uint16_t nCldfbSlots, /* i : number of CLDFB slots in transport channels */ - float *transport_channels_f[] /* i/o: synthesized core-coder transport channels/DirAC output */ + Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ + const uint16_t nCldfbSlots, /* i : number of CLDFB slots in transport channels */ + float *p_data_f[] /* i/o: synthesized core-coder transport channels/DirAC output */ ) { +#ifdef UNIFIED_DECODING_PATHS_LEFTOVERS + int16_t ch, slot_idx, output_frame; + int16_t num_freq_bands, cldfb_ch, n_ch_cldfb; + float *cldfb_real_buffer, *cldfb_imag_buffer; +#else int16_t ch, nchan_transport; int16_t slot_idx; int16_t output_frame; PARAM_ISM_DEC_HANDLE hParamIsmDec; SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom; int16_t fade_len; +#endif /* Initialization */ +#ifdef UNIFIED_DECODING_PATHS_LEFTOVERS + num_freq_bands = st_ivas->hSpatParamRendCom->num_freq_bands; + output_frame = nCldfbSlots * num_freq_bands; + n_ch_cldfb = st_ivas->hTcBuffer->nchan_transport_jbm - st_ivas->hTcBuffer->nchan_buffer_full; + + cldfb_real_buffer = st_ivas->hParamIsmDec->hParamIsmRendering->Cldfb_RealBuffer_tc; + cldfb_imag_buffer = st_ivas->hParamIsmDec->hParamIsmRendering->Cldfb_ImagBuffer_tc; +#else hParamIsmDec = st_ivas->hParamIsmDec; assert( hParamIsmDec ); hSpatParamRendCom = st_ivas->hSpatParamRendCom; @@ -812,15 +834,31 @@ void ivas_param_ism_dec_digest_tc( fade_len = output_frame / 2; nchan_transport = st_ivas->nchan_transport; +#endif - push_wmops( "ivas_param_ism_dec_digest_tc" ); - +#ifdef UNIFIED_DECODING_PATHS_LEFTOVERS + ivas_ism_param_dec_tc_gain_adjust( st_ivas, output_frame, output_frame / 2, p_data_f ); +#else if ( st_ivas->hDecoderConfig->Opt_tsm ) { /*TODO : FhG to check*/ - ivas_ism_param_dec_tc_gain_ajust( st_ivas, output_frame, fade_len, transport_channels_f ); + ivas_ism_param_dec_tc_gain_ajust( st_ivas, output_frame, fade_len, p_data_f ); } +#endif +#ifdef UNIFIED_DECODING_PATHS_LEFTOVERS + /* CLDFB Analysis */ + for ( ch = 0, cldfb_ch = 0; cldfb_ch < n_ch_cldfb; cldfb_ch++, ch++ ) + { + for ( slot_idx = 0; slot_idx < nCldfbSlots; slot_idx++ ) + { + cldfbAnalysis_ts( &( p_data_f[ch][num_freq_bands * slot_idx] ), + &cldfb_real_buffer[slot_idx * num_freq_bands * n_ch_cldfb + cldfb_ch * num_freq_bands], + &cldfb_imag_buffer[slot_idx * num_freq_bands * n_ch_cldfb + cldfb_ch * num_freq_bands], + num_freq_bands, st_ivas->cldfbAnaDec[cldfb_ch] ); + } + } +#else for ( ch = 0; ch < nchan_transport; ch++ ) { /* CLDFB Analysis */ @@ -831,15 +869,13 @@ void ivas_param_ism_dec_digest_tc( float RealBuffer[CLDFB_NO_CHANNELS_MAX]; float ImagBuffer[CLDFB_NO_CHANNELS_MAX]; - cldfbAnalysis_ts( &( transport_channels_f[ch][hSpatParamRendCom->num_freq_bands * slot_idx] ), RealBuffer, ImagBuffer, hSpatParamRendCom->num_freq_bands, st_ivas->cldfbAnaDec[ch] ); + cldfbAnalysis_ts( &( p_data_f[ch][hSpatParamRendCom->num_freq_bands * slot_idx] ), RealBuffer, ImagBuffer, hSpatParamRendCom->num_freq_bands, st_ivas->cldfbAnaDec[ch] ); mvr2r( RealBuffer, &hParamIsmDec->hParamIsmRendering->Cldfb_RealBuffer_tc[slot_idx * hSpatParamRendCom->num_freq_bands * nchan_transport + ch * hSpatParamRendCom->num_freq_bands], hSpatParamRendCom->num_freq_bands ); mvr2r( ImagBuffer, &hParamIsmDec->hParamIsmRendering->Cldfb_ImagBuffer_tc[slot_idx * hSpatParamRendCom->num_freq_bands * nchan_transport + ch * hSpatParamRendCom->num_freq_bands], hSpatParamRendCom->num_freq_bands ); } } } - - - pop_wmops(); +#endif return; } @@ -911,8 +947,6 @@ void ivas_param_ism_dec_prepare_renderer( nchan_out_woLFE = st_ivas->hIntSetup.nchan_out_woLFE; } - push_wmops( "ivas_param_ism_dec_digest_tc" ); - /* general setup */ ivas_jbm_dec_get_adapted_linear_interpolator( DEFAULT_JBM_CLDFB_TIMESLOTS, nCldfbSlots, hParamIsmDec->hParamIsmRendering->interpolator ); @@ -993,23 +1027,30 @@ void ivas_param_ism_dec_prepare_renderer( /* Compute mixing matrix */ ivas_param_ism_compute_mixing_matrix( st_ivas->nchan_ism, hParamIsmDec, st_ivas->hISMDTX, direct_response, nchan_transport, nchan_out_woLFE, cx_diag, ref_power, hParamIsmDec->hParamIsmRendering->mixing_matrix_lin ); - pop_wmops(); - return; } /*-------------------------------------------------------------------------* - * ivas_ism_param_dec_tc_gain_ajust() + * ivas_ism_param_dec_tc_gain_adjust() * * *-------------------------------------------------------------------------*/ +#ifdef UNIFIED_DECODING_PATHS_LEFTOVERS +static void ivas_ism_param_dec_tc_gain_adjust( +#else void ivas_ism_param_dec_tc_gain_ajust( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ - const uint16_t nSamples, /* i : number of samples to be compensate */ - const uint16_t nFadeLength, /* i : length of the crossfade in samples */ - float *transport_channels_f[] /* i : synthesized core-coder transport channels/DirAC output*/ +#endif + Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ +#ifdef UNIFIED_DECODING_PATHS_LEFTOVERS + const int16_t nSamples, /* i : number of samples to be compensate */ + const int16_t nFadeLength, /* i : length of the crossfade in samples */ +#else + const uint16_t nSamples, /* i : number of samples to be compensate */ + const uint16_t nFadeLength, /* i : length of the crossfade in samples */ +#endif + float *p_data_f[] /* i : synthesized core-coder transport channels/DirAC output*/ ) { @@ -1023,8 +1064,8 @@ void ivas_ism_param_dec_tc_gain_ajust( for ( i = 0; i < nSamples; i++ ) { - ene_tc += transport_channels_f[0][i] * transport_channels_f[0][i] + transport_channels_f[1][i] * transport_channels_f[1][i]; /* L*L + R*R */ - ene_sum += ( transport_channels_f[0][i] + transport_channels_f[1][i] ) * ( transport_channels_f[0][i] + transport_channels_f[1][i] ); /* (L+R)*(L+R) */ + ene_tc += p_data_f[0][i] * p_data_f[0][i] + p_data_f[1][i] * p_data_f[1][i]; /* L*L + R*R */ + ene_sum += ( p_data_f[0][i] + p_data_f[1][i] ) * ( p_data_f[0][i] + p_data_f[1][i] ); /* (L+R)*(L+R) */ } gain = sqrtf( ene_tc / ( ene_sum + EPSILON ) ); if ( st_ivas->hSCE[0]->hCoreCoder[0]->ini_frame > 1 ) @@ -1035,21 +1076,21 @@ void ivas_ism_param_dec_tc_gain_ajust( grad = ( gain - last_gain ) / (float) nFadeLength; /* slope between two consecutive gains, 480 samples length */ for ( i = 0; i < ( nFadeLength ); i++ ) { - transport_channels_f[0][i] *= ( last_gain + i * grad ); - transport_channels_f[1][i] *= ( last_gain + i * grad ); + p_data_f[0][i] *= ( last_gain + i * grad ); + p_data_f[1][i] *= ( last_gain + i * grad ); } for ( ; i < nSamples; i++ ) { - transport_channels_f[0][i] *= gain; - transport_channels_f[1][i] *= gain; + p_data_f[0][i] *= gain; + p_data_f[1][i] *= gain; } } else { for ( i = 0; i < nSamples; i++ ) { - transport_channels_f[0][i] *= gain; - transport_channels_f[1][i] *= gain; + p_data_f[0][i] *= gain; + p_data_f[1][i] *= gain; } } diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index 9b310da630365a96347b4530682ead30941514de..68e9099896673f29978f32dff136fb22c62f002a 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -50,8 +50,9 @@ * Local function prototypes *-----------------------------------------------------------------------*/ +#ifndef UNIFIED_DECODING_PATHS_LEFTOVERS static void ivas_jbm_dec_copy_tc( Decoder_Struct *st_ivas, const int16_t nSamplesForRendering, int16_t *nSamplesResidual, float *data, float *tc_digest_f[] ); - +#endif static void ivas_jbm_dec_tc_buffer_playout( Decoder_Struct *st_ivas, const uint16_t nSamplesAsked, uint16_t *nSamplesRendered, float *output[] ); static void ivas_jbm_dec_copy_masa_meta_to_buffer( Decoder_Struct *st_ivas ); @@ -93,6 +94,7 @@ ivas_error ivas_jbm_dec_tc( output_frame = (int16_t) ( output_Fs / FRAMES_PER_SEC ); + /* set pointers to transport channels audio */ for ( n = 0; n < MAX_TRANSPORT_CHANNELS; n++ ) { p_output[n] = st_ivas->p_output_f[n]; @@ -208,11 +210,12 @@ ivas_error ivas_jbm_dec_tc( { return error; } - +#ifndef UNIFIED_DECODING_PATHS_LEFTOVERS if ( output_config == IVAS_AUDIO_CONFIG_EXTERNAL && st_ivas->hDecoderConfig->Opt_tsm ) { ivas_jbm_dec_copy_masa_meta_to_buffer( st_ivas ); } +#endif } else if ( st_ivas->ivas_format == SBA_FORMAT ) { @@ -308,7 +311,7 @@ ivas_error ivas_jbm_dec_tc( ivas_masa_prerender( st_ivas, p_output, output_frame, nchan_remapped ); /* external output */ - if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL && st_ivas->hMasa->config.input_ivas_format == MASA_ISM_FORMAT ) + if ( output_config == IVAS_AUDIO_CONFIG_EXTERNAL && st_ivas->hMasa->config.input_ivas_format == MASA_ISM_FORMAT ) { for ( n = 0; n < st_ivas->nchan_ism; n++ ) { @@ -407,11 +410,12 @@ ivas_error ivas_jbm_dec_tc( /* Extract objects from MASA, output MASA + all objects (i.e., extracted and separated objects) */ ivas_omasa_render_objects_from_mix( st_ivas, p_output, st_ivas->nchan_ism, output_frame ); } - +#ifndef UNIFIED_DECODING_PATHS_LEFTOVERS if ( st_ivas->hDecoderConfig->Opt_tsm ) { ivas_jbm_dec_copy_masa_meta_to_buffer( st_ivas ); } +#endif } } else if ( st_ivas->ivas_format == SBA_ISM_FORMAT ) @@ -722,6 +726,7 @@ ivas_error ivas_jbm_dec_tc( } } +#ifndef UNIFIED_DECODING_PATHS_LEFTOVERS /*----------------------------------------------------------------* * Write IVAS transport channels *----------------------------------------------------------------*/ @@ -732,6 +737,7 @@ ivas_error ivas_jbm_dec_tc( ivas_jbm_dec_copy_tc_no_tsm( st_ivas, p_output, output_frame ); } +#endif /*----------------------------------------------------------------* * Common updates *----------------------------------------------------------------*/ @@ -767,6 +773,111 @@ ivas_error ivas_jbm_dec_tc( return IVAS_ERR_OK; } +#ifdef UNIFIED_DECODING_PATHS_LEFTOVERS + +/*--------------------------------------------------------------------------* + * ivas_dec_feed_tc_to_renderer() + * + * Feed decoded transport channels to the IVAS renderer routine + * + digest TC channels in ParamISM and ParamMC + *--------------------------------------------------------------------------*/ + +void ivas_jbm_dec_feed_tc_to_renderer( + Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ + const int16_t nSamplesForRendering, /* i : number of TC samples available for rendering */ + int16_t *nSamplesResidual, /* o : number of samples not fitting into the renderer grid and buffer for the next call*/ + float *data /* i : transport channels */ +) +{ + float data_f[MAX_CLDFB_DIGEST_CHANNELS][MAX_JBM_L_FRAME48k]; /* 'float' buffer for transport channels that will be directly converted with the CLDFB */ + float *p_data_f[MAX_CLDFB_DIGEST_CHANNELS]; + int16_t n, n_render_timeslots, n_ch_cldfb; + int16_t ch; + DECODER_TC_BUFFER_HANDLE hTcBuffer; + + hTcBuffer = st_ivas->hTcBuffer; + n_ch_cldfb = hTcBuffer->nchan_transport_jbm - hTcBuffer->nchan_buffer_full; + + if ( st_ivas->hDecoderConfig->Opt_tsm ) + { + int16_t n_samples_still_available, m; + int16_t n_ch_full_copy; + int16_t n_ch_res_copy; + + for ( n = 0; n < n_ch_cldfb; n++ ) + { + p_data_f[n] = &data_f[n][0]; + } + + n_samples_still_available = hTcBuffer->n_samples_buffered - hTcBuffer->n_samples_rendered; + hTcBuffer->n_samples_buffered = n_samples_still_available + nSamplesForRendering + hTcBuffer->n_samples_discard; + hTcBuffer->n_samples_available = hTcBuffer->n_samples_granularity * ( hTcBuffer->n_samples_buffered / hTcBuffer->n_samples_granularity ); + *nSamplesResidual = hTcBuffer->n_samples_buffered - hTcBuffer->n_samples_available; + n_ch_full_copy = min( hTcBuffer->nchan_transport_jbm, hTcBuffer->nchan_buffer_full ); + n_ch_res_copy = hTcBuffer->nchan_transport_jbm - hTcBuffer->nchan_buffer_full; + + for ( ch = 0; ch < n_ch_full_copy; ch++ ) + { + set_zero( hTcBuffer->tc[ch], hTcBuffer->n_samples_discard ); + mvr2r( hTcBuffer->tc[ch] + hTcBuffer->n_samples_rendered, hTcBuffer->tc[ch] + hTcBuffer->n_samples_discard, n_samples_still_available ); + for ( m = 0; m < nSamplesForRendering; m++ ) + { + hTcBuffer->tc[ch][n_samples_still_available + hTcBuffer->n_samples_discard + m] = data[m * hTcBuffer->nchan_transport_jbm + ch]; + } + } + + if ( n_ch_res_copy > 0 ) + { + for ( ; ch < hTcBuffer->nchan_transport_jbm; ch++ ) + { + mvr2r( hTcBuffer->tc[ch], p_data_f[ch], n_samples_still_available ); + + for ( m = 0; m < nSamplesForRendering; m++ ) + { + p_data_f[ch][n_samples_still_available + m] = data[m * hTcBuffer->nchan_transport_jbm + ch]; + } + mvr2r( p_data_f[ch] + hTcBuffer->n_samples_available, hTcBuffer->tc[ch], *nSamplesResidual ); + } + } + + n_render_timeslots = hTcBuffer->n_samples_available / hTcBuffer->n_samples_granularity; + } + else + { + for ( n = 0; n < n_ch_cldfb; n++ ) + { + p_data_f[n] = &st_ivas->p_output_f[n][0]; + } + + for ( n = 0; n < ivas_get_nchan_buffers_dec( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); n++ ) + { + hTcBuffer->tc[n] = st_ivas->p_output_f[n]; /* note: buffers needed in the TD decorellator */ + } + + hTcBuffer->n_samples_buffered = nSamplesForRendering; + hTcBuffer->n_samples_available = hTcBuffer->n_samples_buffered; + *nSamplesResidual = 0; + + n_render_timeslots = DEFAULT_JBM_CLDFB_TIMESLOTS; + } + + /* CLDFB analysis for ParamMC/ParamISM */ + if ( st_ivas->ivas_format == ISM_FORMAT && st_ivas->ism_mode == ISM_MODE_PARAM && ( st_ivas->renderer_type == RENDERER_PARAM_ISM || st_ivas->renderer_type == RENDERER_SBA_LINEAR_ENC ) ) + { + ivas_param_ism_dec_digest_tc( st_ivas, n_render_timeslots, p_data_f ); + } + else if ( st_ivas->ivas_format == MC_FORMAT && st_ivas->mc_mode == MC_MODE_PARAMMC && hTcBuffer->tc_buffer_mode == TC_BUFFER_MODE_RENDERER ) + { + ivas_param_mc_dec_digest_tc( st_ivas, (uint8_t) n_render_timeslots, p_data_f ); + } + + hTcBuffer->n_samples_rendered = 0; + hTcBuffer->subframes_rendered = 0; + + return; +} + +#else /*--------------------------------------------------------------------------* * ivas_jbm_dec_feed_tc_to_renderer() @@ -832,6 +943,7 @@ void ivas_jbm_dec_feed_tc_to_renderer( return; } +#endif /*--------------------------------------------------------------------------* * ivas_dec_render() @@ -857,7 +969,9 @@ ivas_error ivas_jbm_dec_render( ivas_error error; float *p_output[MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS]; float *p_tc[MAX_TRANSPORT_CHANNELS + MAX_NUM_OBJECTS]; +#ifndef UNIFIED_DECODING_PATHS_LEFTOVERS SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom; +#endif int16_t nchan_out_syn_output; push_wmops( "ivas_dec_render" ); @@ -865,7 +979,9 @@ ivas_error ivas_jbm_dec_render( * Initialization of local vars after struct has been set *----------------------------------------------------------------*/ +#ifndef UNIFIED_DECODING_PATHS_LEFTOVERS hSpatParamRendCom = st_ivas->hSpatParamRendCom; +#endif output_Fs = st_ivas->hDecoderConfig->output_Fs; nchan_out = st_ivas->hDecoderConfig->nchan_out; nchan_transport = st_ivas->hTcBuffer->nchan_transport_jbm; @@ -879,23 +995,30 @@ ivas_error ivas_jbm_dec_render( if ( !st_ivas->hDecoderConfig->Opt_tsm ) { +#ifndef UNIFIED_DECODING_PATHS_LEFTOVERS for ( n = 0; n < st_ivas->hTcBuffer->nchan_buffer_full; n++ ) { p_tc[n] = &p_output[n][st_ivas->hTcBuffer->n_samples_rendered]; } +#endif for ( n = 0; n < MAX_TRANSPORT_CHANNELS + MAX_NUM_OBJECTS; n++ ) { st_ivas->hTcBuffer->tc[n] = p_output[n]; } } +#ifndef UNIFIED_DECODING_PATHS_LEFTOVERS else { +#endif + 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]; } +#ifndef UNIFIED_DECODING_PATHS_LEFTOVERS } +#endif /*----------------------------------------------------------------* * Update combined orientation access index @@ -971,7 +1094,11 @@ ivas_error ivas_jbm_dec_render( #endif { /* Convert to Ambisonics */ +#ifdef UNIFIED_DECODING_PATHS_LEFTOVERS + ivas_ism2sba_sf( p_tc, p_output, st_ivas->hIsmRendererData, st_ivas->nchan_transport, *nSamplesRendered, st_ivas->hTcBuffer->n_samples_rendered, st_ivas->hIntSetup.ambisonics_order ); +#else 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 */ @@ -1100,7 +1227,7 @@ ivas_error ivas_jbm_dec_render( return error; } } - else if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) /*EXT output = individual objects + HOA3*/ + else if ( output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) /*EXT output = individual objects + HOA3*/ { if ( ( error = ivas_sba_dec_render( st_ivas, nSamplesAskedLocal, nSamplesRendered, nSamplesAvailableNext, &p_output[st_ivas->nchan_ism] ) ) != IVAS_ERR_OK ) { @@ -1109,7 +1236,11 @@ ivas_error ivas_jbm_dec_render( for ( n = 0; n < st_ivas->nchan_ism; n++ ) { +#ifdef UNIFIED_DECODING_PATHS_LEFTOVERS + mvr2r( p_tc[n], p_output[n], *nSamplesRendered ); +#else mvr2r( st_ivas->hTcBuffer->tc[n] + st_ivas->hTcBuffer->n_samples_rendered, p_output[n], *nSamplesRendered ); +#endif } } else @@ -1131,7 +1262,7 @@ ivas_error ivas_jbm_dec_render( return error; } - if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) + if ( output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) { #ifdef DEBUGGING assert( st_ivas->ism_mode == ISM_MODE_NONE ); @@ -1149,10 +1280,12 @@ ivas_error ivas_jbm_dec_render( } else if ( st_ivas->ivas_format == MC_FORMAT ) { +#ifndef UNIFIED_DECODING_PATHS_LEFTOVERS 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]; } +#endif if ( st_ivas->mc_mode == MC_MODE_MCT ) { int16_t crendInPlaceRotation = FALSE; @@ -1181,7 +1314,6 @@ ivas_error ivas_jbm_dec_render( { if ( ( error = ivas_rend_crendProcessSubframe( st_ivas->hCrendWrapper, st_ivas->intern_config, st_ivas->hOutSetup.output_config, st_ivas->hDecoderConfig, st_ivas->hCombinedOrientationData, &st_ivas->hIntSetup, st_ivas->hEFAPdata, st_ivas->hTcBuffer, crendInPlaceRotation ? p_output : p_tc, p_output, *nSamplesRendered, output_Fs, 0 ) ) != IVAS_ERR_OK ) - { return error; } @@ -1247,7 +1379,9 @@ ivas_error ivas_jbm_dec_render( } else if ( st_ivas->mc_mode == MC_MODE_MCMASA ) { +#ifndef UNIFIED_DECODING_PATHS_LEFTOVERS int16_t offset = hSpatParamRendCom->slots_rendered * hSpatParamRendCom->slot_size; +#endif nchan_remapped = st_ivas->nchan_transport; if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM || st_ivas->renderer_type == RENDERER_STEREO_PARAMETRIC ) { @@ -1262,7 +1396,11 @@ ivas_error ivas_jbm_dec_render( /* we still need to copy the separate channel if available */ if ( st_ivas->hOutSetup.separateChannelEnabled ) { +#ifdef UNIFIED_DECODING_PATHS_LEFTOVERS + mvr2r( p_tc[LFE_CHANNEL - 1], p_output[st_ivas->hOutSetup.separateChannelIndex], *nSamplesRendered ); +#else mvr2r( st_ivas->hTcBuffer->tc[LFE_CHANNEL - 1] + offset, p_output[st_ivas->hOutSetup.separateChannelIndex], *nSamplesRendered ); +#endif } ivas_mc2sba( st_ivas->hIntSetup, p_output, p_output, *nSamplesRendered, st_ivas->hOutSetup.ambisonics_order, 0.f ); @@ -1283,13 +1421,22 @@ ivas_error ivas_jbm_dec_render( output_config == IVAS_AUDIO_CONFIG_5_1_4 || output_config == IVAS_AUDIO_CONFIG_7_1_4 || output_config == IVAS_AUDIO_CONFIG_5_1_2 || ( output_config == IVAS_AUDIO_CONFIG_LS_CUSTOM && st_ivas->hOutSetup.num_lfe > 0 ) ) { +#ifdef UNIFIED_DECODING_PATHS_LEFTOVERS + mvr2r( p_tc[LFE_CHANNEL], p_output[LFE_CHANNEL], *nSamplesRendered ); + mvr2r( p_tc[LFE_CHANNEL - 1], p_output[st_ivas->hOutSetup.separateChannelIndex], *nSamplesRendered ); +#else mvr2r( st_ivas->hTcBuffer->tc[LFE_CHANNEL] + offset, p_output[LFE_CHANNEL], *nSamplesRendered ); mvr2r( st_ivas->hTcBuffer->tc[LFE_CHANNEL - 1] + offset, p_output[st_ivas->hOutSetup.separateChannelIndex], *nSamplesRendered ); +#endif } else if ( output_config == IVAS_AUDIO_CONFIG_LS_CUSTOM && st_ivas->hOutSetup.num_lfe == 0 ) { +#ifdef UNIFIED_DECODING_PATHS_LEFTOVERS + mvr2r( p_tc[LFE_CHANNEL - 1], p_output[st_ivas->hOutSetup.separateChannelIndex], *nSamplesRendered ); +#else /* Delay the separated channel to sync with the DirAC rendering */ mvr2r( st_ivas->hTcBuffer->tc[LFE_CHANNEL - 1] + offset, p_output[st_ivas->hOutSetup.separateChannelIndex], *nSamplesRendered ); +#endif } } } @@ -2006,7 +2153,7 @@ int16_t ivas_jbm_dec_get_num_tc_channels( return num_tc; } - +#ifndef UNIFIED_DECODING_PATHS_LEFTOVERS /*--------------------------------------------------------------------------* * ivas_jbm_dec_copy_tc() * @@ -2064,7 +2211,7 @@ static void ivas_jbm_dec_copy_tc( return; } - +#endif /*--------------------------------------------------------------------------* * ivas_jbm_dec_get_render_granularity() @@ -2562,7 +2709,7 @@ TC_BUFFER_MODE ivas_jbm_dec_get_tc_buffer_mode( return buffer_mode; } - +#ifndef UNIFIED_DECODING_PATHS_LEFTOVERS /*--------------------------------------------------------------------------* * ivas_jbm_dec_copy_tc_no_tsm() * @@ -2635,7 +2782,7 @@ void ivas_jbm_dec_copy_tc_no_tsm( return; } - +#endif /*--------------------------------------------------------------------------* * ivas_jbm_dec_metadata_open() @@ -2725,6 +2872,10 @@ static void ivas_jbm_masa_sf_to_slot_map( int16_t slot_idx; int16_t write_idx, sf_index; +#ifdef UNIFIED_DECODING_PATHS_LEFTOVERS + ivas_jbm_dec_copy_masa_meta_to_buffer( st_ivas ); + +#endif /* Set values */ hJbmMetadata = st_ivas->hJbmMetadata; num_slots_in_subfr = CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES; diff --git a/lib_dec/ivas_mc_param_dec.c b/lib_dec/ivas_mc_param_dec.c index 8b33aebe631dc14a7eb9d46b4c851fbddba3aa0a..643781bfccf630d912ba540ad8ae61aac41fd294 100644 --- a/lib_dec/ivas_mc_param_dec.c +++ b/lib_dec/ivas_mc_param_dec.c @@ -1325,22 +1325,47 @@ void ivas_param_mc_dec_read_BS( *------------------------------------------------------------------------*/ void ivas_param_mc_dec_digest_tc( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ - const uint8_t nCldfbSlots, /* i : number of CLDFB slots in transport channels */ - float *transport_channels_f[] /* i/o: synthesized core-coder transport channels/DirAC output */ + Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ + const uint8_t nCldfbSlots, /* i : number of CLDFB slots in transport channels */ + float *p_data_f[] /* i/o: synthesized core-coder transport channels/DirAC output */ ) { +#ifdef UNIFIED_DECODING_PATHS_LEFTOVERS + int16_t ch, num_freq_bands, slot_idx, cldfb_ch, n_ch_cldfb; + float *cldfb_real_buffer, *cldfb_imag_buffer; +#else PARAM_MC_DEC_HANDLE hParamMC; int16_t ch, slot_idx; int16_t nchan_transport; +#endif + + /* Initialization */ +#ifdef UNIFIED_DECODING_PATHS_LEFTOVERS + num_freq_bands = st_ivas->hParamMC->num_freq_bands; + n_ch_cldfb = st_ivas->hTcBuffer->nchan_transport_jbm - st_ivas->hTcBuffer->nchan_buffer_full; + cldfb_real_buffer = st_ivas->hParamMC->Cldfb_RealBuffer_tc; + cldfb_imag_buffer = st_ivas->hParamMC->Cldfb_ImagBuffer_tc; +#else hParamMC = st_ivas->hParamMC; assert( hParamMC ); - push_wmops( "param_mc_dec_digest_tc" ); - nchan_transport = st_ivas->nchan_transport; +#endif +#ifdef UNIFIED_DECODING_PATHS_LEFTOVERS + /* CLDFB Analysis */ + for ( ch = 0, cldfb_ch = 0; cldfb_ch < n_ch_cldfb; cldfb_ch++, ch++ ) + { + for ( slot_idx = 0; slot_idx < nCldfbSlots; slot_idx++ ) + { + cldfbAnalysis_ts( &( p_data_f[ch][num_freq_bands * slot_idx] ), + &cldfb_real_buffer[slot_idx * num_freq_bands * n_ch_cldfb + cldfb_ch * num_freq_bands], + &cldfb_imag_buffer[slot_idx * num_freq_bands * n_ch_cldfb + cldfb_ch * num_freq_bands], + num_freq_bands, st_ivas->cldfbAnaDec[cldfb_ch] ); + } + } +#else /* slot loop for gathering the input data */ for ( slot_idx = 0; slot_idx < nCldfbSlots; slot_idx++ ) { @@ -1352,15 +1377,14 @@ void ivas_param_mc_dec_digest_tc( /* CLDFB Analysis*/ for ( ch = 0; ch < nchan_transport; ch++ ) { - cldfbAnalysis_ts( &( transport_channels_f[ch][hParamMC->num_freq_bands * slot_idx] ), RealBuffer, ImagBuffer, hParamMC->num_freq_bands, st_ivas->cldfbAnaDec[ch] ); + cldfbAnalysis_ts( &( p_data_f[ch][hParamMC->num_freq_bands * slot_idx] ), RealBuffer, ImagBuffer, hParamMC->num_freq_bands, st_ivas->cldfbAnaDec[ch] ); mvr2r( RealBuffer, &hParamMC->Cldfb_RealBuffer_tc[slot_idx * hParamMC->num_freq_bands * nchan_transport + ch * hParamMC->num_freq_bands], hParamMC->num_freq_bands ); mvr2r( ImagBuffer, &hParamMC->Cldfb_ImagBuffer_tc[slot_idx * hParamMC->num_freq_bands * nchan_transport + ch * hParamMC->num_freq_bands], hParamMC->num_freq_bands ); } } } - - pop_wmops(); +#endif return; } diff --git a/lib_dec/ivas_osba_dec.c b/lib_dec/ivas_osba_dec.c index 0bc478c4a9526499efcc29b019a0170fc386bff8..afa273fdbbe25ec2021be6237c0233efd30f5d57 100644 --- a/lib_dec/ivas_osba_dec.c +++ b/lib_dec/ivas_osba_dec.c @@ -134,7 +134,7 @@ ivas_error ivas_osba_dirac_td_binaural_jbm( { int16_t n; ivas_error error; - float output_separated_objects[BINAURAL_CHANNELS][L_FRAME48k]; // VE2SB: TBV + float output_separated_objects[BINAURAL_CHANNELS][L_FRAME48k]; float *p_sepobj[BINAURAL_CHANNELS]; int16_t channel_offset; int16_t slot_idx_start; diff --git a/lib_dec/ivas_sba_rendering_internal.c b/lib_dec/ivas_sba_rendering_internal.c index 06410aa54227f90f8d5e241de96b96e8ae22bf14..1aece93bb9febcd24cba7498d47ed39f221da904 100644 --- a/lib_dec/ivas_sba_rendering_internal.c +++ b/lib_dec/ivas_sba_rendering_internal.c @@ -358,7 +358,7 @@ void ivas_ism2sba_sf( { int16_t i, j, k; float g1, *g2, *tc, *out, gain, prev_gain; - float buffer_tmp[HOA3_CHANNELS][L_FRAME48k]; // VE2SB: TBV + float buffer_tmp[HOA3_CHANNELS][L_FRAME48k]; int16_t sba_num_chans; assert( ( sba_order <= 3 ) && "Only order up to 3 is supported!" ); @@ -376,7 +376,11 @@ void ivas_ism2sba_sf( for ( j = 0; j < sba_num_chans; j++ ) { g2 = hIsmRendererData->interpolator + offset; +#ifdef UNIFIED_DECODING_PATHS_LEFTOVERS + tc = buffer_in[i]; +#else tc = buffer_in[i] + offset; +#endif out = buffer_tmp[j]; gain = hIsmRendererData->gains[i][j]; prev_gain = hIsmRendererData->prev_gains[i][j]; diff --git a/lib_dec/ivas_stat_dec.h b/lib_dec/ivas_stat_dec.h index 8d5f16762048868c77fcebddb540777217835130..89d53452bb5c449e2577ccf17c2a48ee2fcddae3 100644 --- a/lib_dec/ivas_stat_dec.h +++ b/lib_dec/ivas_stat_dec.h @@ -944,16 +944,16 @@ typedef struct ivas_masa_ism_data_structure typedef struct decoder_tc_buffer_structure { - float *tc_buffer; /* the buffer itself */ - float *tc[MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS]; /* pointers into the buffer to the beginning of each tc */ // VE2SB: TBV - TC_BUFFER_MODE tc_buffer_mode; /* mode of the buffer (no buffering, render buffering, out buffering) */ - int16_t nchan_transport_jbm; /* number of TCs after TC decoding */ - int16_t nchan_transport_internal; /* total number of TC buffer channels, can include e.g. TD decorr data */ - int16_t nchan_buffer_full; /* number of channels to be fully buffered */ - int16_t n_samples_available; /* samples still available for rendering in the current frame */ - int16_t n_samples_buffered; /* full number of samples in the buffer (including spill to next frame) */ - int16_t n_samples_rendered; /* samples already rendered in the current frame */ - int16_t n_samples_granularity; /* render granularity */ + float *tc_buffer; /* the buffer itself */ + float *tc[MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS]; /* pointers into the buffer to the beginning of each tc */ + TC_BUFFER_MODE tc_buffer_mode; /* mode of the buffer (no buffering, render buffering, out buffering) */ + int16_t nchan_transport_jbm; /* number of TCs after TC decoding */ + int16_t nchan_transport_internal; /* total number of TC buffer channels, can include e.g. TD decorr data */ + int16_t nchan_buffer_full; /* number of channels to be fully buffered */ + int16_t n_samples_available; /* samples still available for rendering in the current frame */ + int16_t n_samples_buffered; /* full number of samples in the buffer (including spill to next frame) */ + int16_t n_samples_rendered; /* samples already rendered in the current frame */ + int16_t n_samples_granularity; /* render granularity */ int16_t n_samples_flushed; int16_t subframe_nbslots[MAX_JBM_SUBFRAMES_5MS]; int16_t nb_subframes; diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index 984f22cb053bd63d8cba866d5a2c848e708c922b..ae919c218419e91fa4fe1ef50415d986b270e484 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -4271,10 +4271,12 @@ static ivas_error evs_dec_main( mvs2r( pcm_buf_local, p_output[ch], nOutSamples ); } } +#ifndef UNIFIED_DECODING_PATHS_LEFTOVERS else // ToDo: the 'else' branch can be removed once UNIFIED_DECODING_PATHS_LEFTOVERS is merged { ivas_jbm_dec_copy_tc_no_tsm( st_ivas, p_output, nOutSamples ); } +#endif return IVAS_ERR_OK; } diff --git a/lib_rend/ivas_objectRenderer.c b/lib_rend/ivas_objectRenderer.c index 4be6fda15639eb9b14e6cf929fd884ae99a11e62..df7c0d7a63e09e6ac5cac9061229e44767682a53 100644 --- a/lib_rend/ivas_objectRenderer.c +++ b/lib_rend/ivas_objectRenderer.c @@ -437,6 +437,9 @@ ivas_error TDREND_GetMix( float hrf_left_delta[SFX_SPAT_BIN_MAX_FILTER_LENGTH]; float hrf_right_delta[SFX_SPAT_BIN_MAX_FILTER_LENGTH]; int16_t intp_count; +#ifdef NONBE_1300_TDREND_LARGE_ITD + int16_t currShift, prevShift, transition_len, length_in2; +#endif error = IVAS_ERR_OK; @@ -462,6 +465,21 @@ ivas_error TDREND_GetMix( { TDREND_SRC_REND_UpdateFiltersFromSpatialParams( hBinRendererTd, SrcRend_p, SrcSpatial_p, Src_p->hrf_left_prev, Src_p->hrf_right_prev, hrf_left_delta, hrf_right_delta, &intp_count, &Src_p->filterlength, &Src_p->itd, &Src_p->Gain, Src_p ); +#ifdef NONBE_1300_TDREND_LARGE_ITD + /* For large ITD values at lower sampling rate, check if the transition can be done */ + if ( Src_p->itd * Src_p->previtd < 0 ) + { + currShift = (int16_t) abs( Src_p->itd ); + prevShift = (int16_t) abs( Src_p->previtd ); + transition_len = subframe_length - max( 0, SFX_SPAT_BIN_SINC_M - currShift ); + length_in2 = transition_len - (int16_t) ( ( (float) ( transition_len * prevShift ) / ( (float) ( prevShift + currShift ) ) ) + 0.5f ) - currShift; + if ( length_in2 <= 0 ) + { + /* Subframe too short for ITD transition -- change to ITD=0 and push the rest of the transition to next subframe */ + Src_p->itd = 0; + } + } +#endif } /* Render source if needed */ diff --git a/tests/constants.py b/tests/constants.py index 5fc9b3f50d19b5e3e21bebac3202262f7e95472f..794f977b00b66ec87876299d9ec4b826c09ef83b 100644 --- a/tests/constants.py +++ b/tests/constants.py @@ -22,7 +22,7 @@ DMX_MLD = "DMX_MLD" DMX_SSNR = "DMX_SSNR" # regex patterns for parsing the output from comparisons -> mainly for BASOP ci -MLD_PATTERN = r"MLD: ([\d\.]*)" +MLD_PATTERN = r"MLD: (\d+\.*\d*[eE]*[-+]*\d*)" MAX_DIFF_PATTERN = r"MAX_ABS_DIFF: (\d*)" ODG_PATTERN_PQEVALAUDIO = r"Objective Difference Grade: (-*\d*\.\d*)" ODG_PATTERN = r"(?