diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 97fc0c0fafb8b6839eeb19d07398530da028d199..2eec5d03328810050267330bcc06af2a4d15890c 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -11,43 +11,46 @@ include:
# This sets when pipelines are created. Jobs have more specific rules to restrict them.
workflow:
- name: '$IVAS_PIPELINE_NAME'
+ name: "$IVAS_PIPELINE_NAME"
rules:
# see https://docs.gitlab.com/ee/ci/yaml/workflow.html#switch-between-branch-pipelines-and-merge-request-pipelines
- if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS && $CI_PIPELINE_SOURCE == "push"
when: never
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
variables:
- IVAS_PIPELINE_NAME: 'MR pipeline: $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME'
+ IVAS_PIPELINE_NAME: "MR pipeline: $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME"
- if: $CI_PIPELINE_SOURCE == 'push' && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH # Pushes to main
variables:
- IVAS_PIPELINE_NAME: 'Push pipeline: $CI_COMMIT_BRANCH'
+ IVAS_PIPELINE_NAME: "Push pipeline: $CI_COMMIT_BRANCH"
- if: $CI_PIPELINE_SOURCE == 'schedule' && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH # Scheduled in main
variables:
- IVAS_PIPELINE_NAME: 'Scheduled pipeline: $CI_COMMIT_BRANCH'
+ IVAS_PIPELINE_NAME: "Scheduled pipeline: $CI_COMMIT_BRANCH"
- if: $CI_PIPELINE_SOURCE == 'web' && $MANUAL_PIPELINE_TYPE == 'default' # for testing
variables:
- IVAS_PIPELINE_NAME: 'Web run pipeline: $CI_COMMIT_BRANCH'
+ IVAS_PIPELINE_NAME: "Web run pipeline: $CI_COMMIT_BRANCH"
- if: $CI_PIPELINE_SOURCE == 'web' && $MANUAL_PIPELINE_TYPE == 'test-be-release'
variables:
- IVAS_PIPELINE_NAME: 'Test BE to release pipeline: $CI_COMMIT_BRANCH'
+ IVAS_PIPELINE_NAME: "Test BE to release pipeline: $CI_COMMIT_BRANCH"
- if: $CI_PIPELINE_SOURCE == 'web' && $MANUAL_PIPELINE_TYPE == 'test-long-self-test'
variables:
- IVAS_PIPELINE_NAME: 'Test long self-test against main pipeline: $CI_COMMIT_BRANCH'
+ IVAS_PIPELINE_NAME: "Test long self-test against main pipeline: $CI_COMMIT_BRANCH"
- if: $CI_PIPELINE_SOURCE == 'web' && $MANUAL_PIPELINE_TYPE == 'ivas-conformance'
variables:
- IVAS_PIPELINE_NAME: 'Draft IVAS Conformance test: $CI_COMMIT_BRANCH'
+ IVAS_PIPELINE_NAME: "Draft IVAS Conformance test: $CI_COMMIT_BRANCH"
- if: $CI_PIPELINE_SOURCE == 'trigger'
- if: $CI_PIPELINE_SOURCE == 'web' && $MANUAL_PIPELINE_TYPE == 'ivas-conformance-linux'
variables:
- IVAS_PIPELINE_NAME: 'Draft IVAS Conformance test -- Linux: $CI_COMMIT_BRANCH'
+ IVAS_PIPELINE_NAME: "Draft IVAS Conformance test -- Linux: $CI_COMMIT_BRANCH"
- if: $CI_PIPELINE_SOURCE == 'trigger'
- if: $CI_PIPELINE_SOURCE == 'web' && $MANUAL_PIPELINE_TYPE == 'check-clipping'
variables:
- IVAS_PIPELINE_NAME: 'Check core input clipping: $CI_COMMIT_BRANCH'
+ IVAS_PIPELINE_NAME: "Check core input clipping: $CI_COMMIT_BRANCH"
- if: $CI_PIPELINE_SOURCE == 'web' && $MANUAL_PIPELINE_TYPE == 'test-branch-vs-input-passthrough'
variables:
- IVAS_PIPELINE_NAME: 'Pass-through comparison vs input: $CI_COMMIT_BRANCH'
+ IVAS_PIPELINE_NAME: "Pass-through comparison vs input: $CI_COMMIT_BRANCH"
+ - if: $MANUAL_PIPELINE_TYPE == 'coverage'
+ variables:
+ IVAS_PIPELINE_NAME: "Coverage measurement"
# ---------------------------------------------------------------
# Generic script anchors
@@ -126,9 +129,9 @@ workflow:
- Pop-Location
.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
+ - cp $LTV_DIR_WIN\*.wav scripts\testv
+ - cp $LTV_DIR_WIN\*.met scripts\testv
+ - cp $LTV_DIR_WIN\*.csv scripts\testv
.activate-WX-windows: &activate-WX-windows
- (Get-Content -Path "CMakeLists.txt") -replace '# \(add_compile_options\("\/WX"\)\)', '$1' | Set-Content -Path "CMakeLists.txt"
@@ -161,7 +164,6 @@ workflow:
- if [ $exit_code20 -ne 0 ] || [ $exit_code10 -ne 0 ] || [ $exit_code5 -ne 0 ]; then exit 1; fi
-
# ---------------------------------------------------------------
# .pre jobs for setting up things
# ---------------------------------------------------------------
@@ -363,7 +365,6 @@ build-codec-instrumented-linux:
paths:
- wmc_tool_output.txt
-
# make sure that the codec builds with msan, asan and usan
build-codec-sanitizers-linux:
extends:
@@ -406,7 +407,13 @@ codec-smoke-test:
tags:
- ivas-linux-fast
stage: test
- needs: ["build-codec-linux-cmake", "build-codec-linux-make", "build-codec-instrumented-linux", "build-codec-sanitizers-linux"]
+ needs:
+ [
+ "build-codec-linux-cmake",
+ "build-codec-linux-make",
+ "build-codec-instrumented-linux",
+ "build-codec-sanitizers-linux",
+ ]
script:
- bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/print-common-info.sh
# LTV update needed as ltv ISM metadata files are used
@@ -485,7 +492,13 @@ pytest-compare-20ms-and-5ms-rendering:
- .test-job-linux
- .rules-merge-request-to-main
stage: test
- needs: ["build-codec-linux-cmake", "build-codec-linux-make", "build-codec-instrumented-linux", "build-codec-sanitizers-linux"]
+ needs:
+ [
+ "build-codec-linux-cmake",
+ "build-codec-linux-make",
+ "build-codec-instrumented-linux",
+ "build-codec-sanitizers-linux",
+ ]
script:
- bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/print-common-info.sh
- bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/disable-limiter.sh
@@ -581,7 +594,6 @@ renderer-asan:
artifacts:
expose_as: "renderer asan result"
-
# test renderer executable with cmake + msan
renderer-msan:
extends:
@@ -593,7 +605,6 @@ renderer-msan:
artifacts:
expose_as: "renderer msan result"
-
# test renderer executable with cmake + usan
renderer-usan:
extends:
@@ -605,7 +616,6 @@ renderer-usan:
artifacts:
expose_as: "renderer usan result"
-
# compare renderer bitexactness between target and source branch
renderer-pytest-on-merge-request:
extends:
@@ -838,7 +848,6 @@ ivas-pytest-on-merge-request:
junit:
- report-junit.xml
-
# Check interop IVAS_cod_test -> IVAS_dec_ref
ivas-interop-on-merge-request:
extends:
@@ -1085,7 +1094,6 @@ check-bitexactness-ext-and-transport-format:
expose_as: "logs-ext-sanity-check"
expire_in: "5 days"
-
# ---------------------------------------------------------------
# Test jobs for main branch
# ---------------------------------------------------------------
@@ -1225,7 +1233,6 @@ be-2-evs-windows:
# reports:
# junit: report-junit.xml
-
# ---------------------------------------------------------------
# Manual jobs
# ---------------------------------------------------------------
@@ -1239,7 +1246,6 @@ test-be-to-release:
rules:
- if: $CI_PIPELINE_SOURCE == 'web' && $MANUAL_PIPELINE_TYPE == 'test-be-release'
script:
-
- echo "$CI_COMMIT_BRANCH"
- MSBuild.exe -maxcpucount .\Workspace_msvc\Workspace_msvc.sln /property:Configuration=Debug /p:Platform=win32 /m | tee -variable winoutdata
@@ -1256,7 +1262,6 @@ test-be-to-release:
- logs/
expose_as: "test-be-to-release results"
-
ivas-conformance:
tags:
- ivas-windows
@@ -1269,13 +1274,13 @@ ivas-conformance:
exit_codes:
- 123
script:
- - *print-common-info-windows
- - MSBuild.exe -maxcpucount .\Workspace_msvc\Workspace_msvc.sln /property:Configuration=Debug
+ - *print-common-info-windows
+ - MSBuild.exe -maxcpucount .\Workspace_msvc\Workspace_msvc.sln /property:Configuration=Debug
- cp -force IVAS_cod.exe IVAS_cod_ref.exe
- cp -force IVAS_dec.exe IVAS_dec_ref.exe
- - cp -force IVAS_rend.exe IVAS_rend_ref.exe
+ - cp -force IVAS_rend.exe IVAS_rend_ref.exe
- cp -force ISAR_post_rend.exe ISAR_post_rend_ref.exe
-
+
# Reference creation
- python scripts/prepare_combined_format_inputs.py
- $TEST_SET = "tests/codec_be_on_mr_nonselection", "tests/renderer/test_renderer.py", "tests/split_rendering/test_split_rendering.py"
@@ -1284,21 +1289,21 @@ ivas-conformance:
# Output creation
- python -m pytest $TEST_SET -v -n auto --keep_files --create_cut --html=report_cmd.html --self-contained-html
- python scripts/parse_commands.py report_cmd.html Readme_IVAS.txt
-
+
# Copy input data and output ref data
- if (Test-Path testvec) {rm -r -force testvec}
- if (Test-Path TMP_DEC) {rm -r -force TMP_DEC}
- - if (Test-Path TMP_ENC) {rm -r -force TMP_ENC}
+ - if (Test-Path TMP_ENC) {rm -r -force TMP_ENC}
- if (Test-Path TMP_JBM) {rm -r -force TMP_JBM}
- if (Test-Path TMP_REND) {rm -r -force TMP_REND}
- - if (Test-Path TMP_ISAR_POST_REND) {rm -r -force TMP_ISAR_POST_REND}
- - if (Test-Path TMP_DEC_ISAR) {rm -r -force TMP_DEC_ISAR}
+ - if (Test-Path TMP_ISAR_POST_REND) {rm -r -force TMP_ISAR_POST_REND}
+ - if (Test-Path TMP_DEC_ISAR) {rm -r -force TMP_DEC_ISAR}
- mkdir testvec
- mkdir testvec/binauralRenderer_interface
- mkdir testvec/testv
- mkdir testvec/testv/renderer
- - mkdir testvec/testv/split_rendering
- - mkdir testvec/bin
+ - mkdir testvec/testv/split_rendering
+ - mkdir testvec/bin
- cp -force -ErrorAction Ignore scripts/testv/* testvec/testv
- cp -r -force -ErrorAction Ignore scripts/ls_layouts testvec
- cp -r -force -ErrorAction Ignore scripts/object_edit testvec
@@ -1308,29 +1313,28 @@ ivas-conformance:
- cp -r -force -ErrorAction Ignore tests/ref testvec/testv/ref
- cp -r -force -ErrorAction Ignore tests/dut/* testvec/testv/ref
- cp -r -force -ErrorAction Ignore tests/renderer/cut testvec/testv/renderer/ref
- - cp -r -force -ErrorAction Ignore tests/split_rendering/cut testvec/testv/split_rendering/ref
- - cp -r -force -ErrorAction Ignore tests/split_rendering/renderer_configs testvec/testv/split_rendering/renderer_configs
- - cp -r -force -ErrorAction Ignore tests/split_rendering/error_patterns testvec/testv/split_rendering/error_patterns
-
- # Remove redundant files
+ - cp -r -force -ErrorAction Ignore tests/split_rendering/cut testvec/testv/split_rendering/ref
+ - cp -r -force -ErrorAction Ignore tests/split_rendering/renderer_configs testvec/testv/split_rendering/renderer_configs
+ - cp -r -force -ErrorAction Ignore tests/split_rendering/error_patterns testvec/testv/split_rendering/error_patterns
+
+ # Remove redundant files
- python scripts/cleanup_26252.py
# Copy test script files
- cp -r -force -ErrorAction Ignore tests/conformance-test testvec/
- cp Readme_IVAS_dec.txt testvec
- - cp Readme_IVAS_enc.txt testvec
+ - cp Readme_IVAS_enc.txt testvec
- cp Readme_IVAS_rend.txt testvec
- cp Readme_IVAS_JBM_dec.txt testvec
- - cp Readme_IVAS_ISAR_dec.txt testvec
- - cp Readme_IVAS_ISAR_post_rend.txt testvec
+ - cp Readme_IVAS_ISAR_dec.txt testvec
+ - cp Readme_IVAS_ISAR_post_rend.txt testvec
- cp IVAS_cod.exe testvec/bin
- cp IVAS_dec.exe testvec/bin
- cp IVAS_rend.exe testvec/bin
- - cp ISAR_post_rend.exe testvec/bin
-
-
+ - cp ISAR_post_rend.exe testvec/bin
+
# Test run generated scripts in testvec
- - cd testvec
+ - cd testvec
- python -m pytest conformance-test/test_26252.py --junit-xml=report-junit.xml --html=report.html --self-contained-html
- mv report.html ..
- mv report-junit.xml ..
@@ -1343,12 +1347,12 @@ ivas-conformance:
- report_cmd.html
- report-junit.xml
- report.html
- - Readme_IVAS_dec.txt
- - Readme_IVAS_enc.txt
+ - Readme_IVAS_dec.txt
+ - Readme_IVAS_enc.txt
- Readme_IVAS_rend.txt
- Readme_IVAS_JBM_dec.txt
- - Readme_IVAS_ISAR_dec.txt
- - Readme_IVAS_ISAR_post_rend.txt
+ - Readme_IVAS_ISAR_dec.txt
+ - Readme_IVAS_ISAR_post_rend.txt
expose_as: "Draft IVAS conformance"
reports:
junit: report-junit.xml
@@ -1360,9 +1364,15 @@ ivas-conformance-linux:
timeout: "90 minutes"
rules:
- if: ($CI_PIPELINE_SOURCE == 'web' || $CI_PIPELINE_SOURCE == 'trigger') && $MANUAL_PIPELINE_TYPE == 'ivas-conformance-linux'
+ - if: $MANUAL_PIPELINE_TYPE == "coverage"
+ - if: $COVERAGE_TEST
allow_failure:
exit_codes:
- 123
+ variables:
+ COVERAGE_OUTPUT_FILE: "$COVERAGE_OUTPUT_FILE_CONFORMANCE"
+ COVERAGE_OUTPUT_DIR: "coverage_conformance"
+ COVERAGE_TITLE: "conformance test test_26252.py"
script:
- bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/print-common-info.sh
- make -j
@@ -1370,24 +1380,24 @@ ivas-conformance-linux:
- cp IVAS_dec IVAS_dec_ref
- cp IVAS_rend IVAS_rend_ref
- cp ISAR_post_rend ISAR_post_rend_ref
-
+
# Reference creation
- python3 scripts/prepare_combined_format_inputs.py
- TEST_SET="tests/codec_be_on_mr_nonselection tests/renderer/test_renderer.py tests/split_rendering/test_split_rendering.py"
- - python3 -m pytest $TEST_SET -v -n auto --update_ref 1 --create_ref --keep_files
+ - python3 -m pytest -q $TEST_SET -v -n auto --update_ref 1 --create_ref --keep_files
# Output creation
- - python3 -m pytest $TEST_SET -v -n auto --keep_files --create_cut --html=report_cmd.html --self-contained-html
+ - python3 -m pytest -q $TEST_SET -v -n auto --keep_files --create_cut --html=report_cmd.html --self-contained-html
- python3 scripts/parse_commands.py report_cmd.html Readme_IVAS.txt
-
+
# Copy input data and output ref data
- rm -rf testvec
- mkdir testvec
- mkdir testvec/binauralRenderer_interface
- mkdir testvec/testv
- mkdir testvec/testv/renderer
- - mkdir testvec/testv/split_rendering
- - mkdir testvec/bin
+ - mkdir testvec/testv/split_rendering
+ - mkdir testvec/bin
- cp -r scripts/testv/* testvec/testv
- cp -r scripts/ls_layouts testvec
- cp -r scripts/object_edit testvec
@@ -1397,49 +1407,45 @@ ivas-conformance-linux:
- cp -r tests/ref testvec/testv/ref
- cp -r tests/dut/* testvec/testv/ref
- cp -r tests/renderer/cut testvec/testv/renderer/ref
- - cp -r tests/split_rendering/cut testvec/testv/split_rendering/ref
- - cp -r tests/split_rendering/renderer_configs testvec/testv/split_rendering/renderer_configs
- - cp -r tests/split_rendering/error_patterns testvec/testv/split_rendering/error_patterns
-
- # Remove redundant files
+ - cp -r tests/split_rendering/cut testvec/testv/split_rendering/ref
+ - cp -r tests/split_rendering/renderer_configs testvec/testv/split_rendering/renderer_configs
+ - cp -r tests/split_rendering/error_patterns testvec/testv/split_rendering/error_patterns
+
+ # Remove redundant files
- python3 scripts/cleanup_26252.py
-
+
# Copy test script files
- cp -r tests/conformance-test testvec/
- cp Readme_IVAS_dec.txt testvec
- - cp Readme_IVAS_enc.txt testvec
+ - cp Readme_IVAS_enc.txt testvec
- cp Readme_IVAS_rend.txt testvec
- cp Readme_IVAS_JBM_dec.txt testvec
- - cp Readme_IVAS_ISAR_dec.txt testvec
- - cp Readme_IVAS_ISAR_post_rend.txt testvec
-
+ - cp Readme_IVAS_ISAR_dec.txt testvec
+ - cp Readme_IVAS_ISAR_post_rend.txt testvec
+
# Create GCOV execs for coverage analysis
- make clean
- make GCOV=1 -j
-
+
- cp IVAS_cod testvec/bin
- cp IVAS_dec testvec/bin
- cp IVAS_rend testvec/bin
- - cp ISAR_post_rend testvec/bin
-
+ - cp ISAR_post_rend testvec/bin
+
# Test run generated scripts in testvec
- - cd testvec
- - exit_code=0
- - python3 -m pytest conformance-test/test_26252.py --junit-xml=report-junit.xml --html=report.html --self-contained-html || exit_code=$?
+ - cd testvec
+ - exit_code=0
+ - python3 -m pytest -q conformance-test/test_26252.py --junit-xml=report-junit.xml --html=report.html --self-contained-html || exit_code=$?
- mv report.html ..
- mv report-junit.xml ..
# Collect coverage
- cd -
- - lcov -c -d obj -o coverage.info
- - lcov -r coverage.info "*apps*" -o coverage.info
- - lcov -r coverage.info "*lib_util*" -o coverage.info
- - commit_sha=$(git rev-parse HEAD)
- - genhtml coverage.info -o coverage -t "Coverage on main @ $commit_sha"
+ - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/collect-coverage.sh --obj-dir obj --output-file $COVERAGE_OUTPUT_FILE --output-dir $COVERAGE_OUTPUT_DIR --title "Coverage on main -- $COVERAGE_TITLE"
# Check for failures
- if [ $exit_code -ne 0 ]; then echo "Test failures encountered"; exit $EXIT_CODE_FAIL; fi
-
+
artifacts:
name: "ivas-conformance-linux-$CI_COMMIT_SHORT_SHA"
expire_in: 1 week
@@ -1448,19 +1454,18 @@ ivas-conformance-linux:
- report_cmd.html
- report-junit.xml
- report.html
- - Readme_IVAS_dec.txt
- - Readme_IVAS_enc.txt
+ - Readme_IVAS_dec.txt
+ - Readme_IVAS_enc.txt
- Readme_IVAS_rend.txt
- Readme_IVAS_JBM_dec.txt
- - Readme_IVAS_ISAR_dec.txt
- - Readme_IVAS_ISAR_post_rend.txt
- - coverage.info
- - coverage
+ - Readme_IVAS_ISAR_dec.txt
+ - Readme_IVAS_ISAR_post_rend.txt
+ - $COVERAGE_OUTPUT_FILE
+ - $COVERAGE_OUTPUT_DIR
expose_as: "Draft IVAS conformance -- Linux"
reports:
junit: report-junit.xml
-
test-long-self-test:
extends:
- .job-linux
@@ -1518,7 +1523,6 @@ test-long-self-test:
- if [ $exit_code -ne 0 ]; then echo "Non-bitexact cases encountered!"; exit $EXIT_CODE_NON_BE; fi
- exit 0
-
artifacts:
name: "test-long-self-test--sha-$CI_COMMIT_SHORT_SHA--results"
when: always
@@ -1967,7 +1971,6 @@ sanitizer-test-omasa-ism4:
- 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
-
### --- sanitizer schedule C ---
.sanitizer-test-schedule-C:
@@ -2180,10 +2183,8 @@ sanitizer-test-osba-planar-hoa3-ism4:
- 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
-
-
# GCOV/LCOV coverage analysis of self_test suite
-coverage-test-on-main-scheduled:
+.coverage-test-template:
extends:
- .test-job-linux-needs-testv-dir
- .rules-main-scheduled
@@ -2191,53 +2192,133 @@ coverage-test-on-main-scheduled:
- ivas-linux-fast
stage: test
rules:
- # only run in scheduled pipeline that passes this env vars
- if: $COVERAGE_TEST
- timeout: 3 hours
- script:
+ - if: $MANUAL_PIPELINE_TYPE == "coverage"
+ timeout: 6 hours
+ before_script:
+ - !reference [.job-linux, before_script]
+ - set -e
+ - 'trap ''echo "Command failed at line $LINENO: $BASH_COMMAND"'' ERR'
- 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
+ # compile with coverage enabled
+ - cmake -B cmake-build -G "Unix Makefiles" -DCOPY_EXECUTABLES_FROM_BUILD_DIR=true -DGCOV=ON
+ - cmake --build cmake-build -- -j
+ # copy executables to ref to be able to run some --create_ref tests
+ - cp IVAS_cod IVAS_cod_ref
+ - cp IVAS_dec IVAS_dec_ref
+ - cp IVAS_rend IVAS_rend_ref
+ - cp ISAR_post_rend ISAR_post_rend_ref
+ after_script:
+ - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/collect-coverage.sh --obj-dir cmake-build --output-file $COVERAGE_OUTPUT_FILE --output-dir $COVERAGE_OUTPUT_DIR --title "Coverage on main -- $COVERAGE_TITLE"
+ artifacts:
+ name: "main-$COVERAGE_OUTPUT_DIR-sha-$CI_COMMIT_SHORT_SHA"
+ when: always
+ expire_in: 1 week
- # -- Run short test vector suite to check coverage of that first
- - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR -v -n auto --update_ref 1 --ref_encoder_path ./IVAS_cod --ref_decoder_path ./IVAS_dec
+coverage-merge:
+ extends: .rules-main-scheduled
+ tags:
+ - ivas-linux-fast
+ stage: test
+ rules:
+ - if: $COVERAGE_TEST
+ - if: $MANUAL_PIPELINE_TYPE == "coverage"
+ needs:
+ - job: coverage-test-on-main-scheduled-stv
+ artifacts: true
+ - job: coverage-test-on-main-scheduled-ltv
+ artifacts: true
+ - job: ivas-conformance-linux
+ artifacts: true
+ variables:
+ COVERAGE_OUTPUT_FILE: "$COVERAGE_OUTPUT_FILE_MERGED"
+ COVERAGE_OUTPUT_DIR: "coverage-merged"
+ COVERAGE_TITLE: "merged total coverage"
+ script:
+ - echo "Merging coverage reports..."
+ - lcov -a $COVERAGE_OUTPUT_FILE_CONFORMANCE -a $COVERAGE_OUTPUT_FILE_STV -a $COVERAGE_OUTPUT_FILE_LTV -o "$COVERAGE_OUTPUT_FILE_MERGED"
+ - commit_sha=$(git rev-parse HEAD)
+ - genhtml $COVERAGE_OUTPUT_FILE_MERGED -o $COVERAGE_OUTPUT_DIR -t "Coverage on main -- $COVERAGE_TITLE @ $commit_sha"
+ artifacts:
+ name: "merged-coverage-sha-$CI_COMMIT_SHORT_SHA"
+ when: always
+ expire_in: 1 week
+ paths:
+ - $COVERAGE_OUTPUT_FILE
+ - $COVERAGE_OUTPUT_DIR
+coverage-test-on-main-scheduled-stv:
+ extends: .coverage-test-template
+ variables:
+ COVERAGE_OUTPUT_FILE: "$COVERAGE_OUTPUT_FILE_STV"
+ COVERAGE_OUTPUT_DIR: "coverage_stv"
+ COVERAGE_TITLE: "short test vectors"
+ script:
+ # -- Run short test vector suite to check coverage of that first
+ # codec smoke test
+ - bash ci/smoke_test.sh coverage
+ # default renderer framesize is 20ms
+ - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR -v -n auto -q --tb=no --update_ref 1 --ref_encoder_path ./IVAS_cod --ref_decoder_path ./IVAS_dec
+ # for different renderer framesizes, only the decoder needs to be tested, so use --decoder_only
# need to ignore non-zero exit codes as limiter is active and thus the different framesiszes will not be BE in all cases
- - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR -v --dut_encoder_path ./IVAS_cod --dut_decoder_path ./IVAS_dec --dut_fr 5 --decoder_only || true
- - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR -v --dut_encoder_path ./IVAS_cod --dut_decoder_path ./IVAS_dec --dut_fr 10 --decoder_only || true
- - python3 -m pytest -q -n auto tests/renderer/test_renderer.py --create_ref
- - python3 -m pytest -q -n auto tests/renderer/test_renderer.py --create_cut
- - lcov -c -d obj -o coverage_stv.info # extract coverage of short test vectors here
- # remove apps and lib_util files from coverage
- - lcov -r coverage_stv.info "*apps*" -o coverage_stv.info
- - lcov -r coverage_stv.info "*lib_util*" -o coverage_stv.info
+ - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR -v -n auto -q --tb=no --dut_encoder_path ./IVAS_cod --dut_decoder_path ./IVAS_dec --dut_fr 5 --decoder_only || true
+ - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR -v -n auto -q --tb=no --dut_encoder_path ./IVAS_cod --dut_decoder_path ./IVAS_dec --dut_fr 10 --decoder_only || true
+ # run renderer smoke test - needed for REFVEC tests
+ - python3 -m pytest -n auto -q --tb=no tests/renderer/test_renderer.py
+ # run renderer test only with REF creation stage - no CUT needed since executables are identical
+ - python3 -m pytest -n auto -q --tb=no tests/renderer/test_renderer.py --create_ref
+ # run split rendering smoke test and REF creation
+ - python3 -m pytest -n auto -q --tb=no tests/split_rendering/test_split_rendering.py
+ - python3 -m pytest -n auto -q --tb=no tests/split_rendering/test_split_rendering.py --create_ref
+ # VoIP BE test
+ - python3 -m pytest -q --tb=no tests/test_be_for_jbm_neutral_dly_profile.py
+ # split rendering VoIP BE test
+ - python3 -m pytest -n auto -q --tb=no tests/split_rendering/test_voip_be_splitrend_vs_binaural.py
+ # TODO first frame SID - this script runs a `make clean` and needs to be checked/adapted
+ # - bash ci/run-first-frame-is-sid-test.sh
+ # TODO consider HRTF binary loading test, or probably already covered by PRM files
+ # - python3 -m pytest -q --tb=no tests/hrtf_binary_loading
+ # run BE vs EXT test
+ - python3 tests/create_short_testvectors.py --cut_len 1.0
+ - python3 -m pytest -q --tb=no tests/test_be_for_ext_outputs.py
+ # run LC3plus wrapper unit test
+ - scripts/split_rendering/lc3plus_float/ivas_lc3plus_unit_test
+ # TODO consider including check-clipping, but this scales ALL testv files. could be added at end of this job
+ artifacts:
+ paths:
+ - $COVERAGE_OUTPUT_FILE
+ - $COVERAGE_OUTPUT_DIR
+coverage-test-on-main-scheduled-ltv:
+ extends: .coverage-test-template
+ variables:
+ COVERAGE_OUTPUT_FILE: "$COVERAGE_OUTPUT_FILE_LTV"
+ COVERAGE_OUTPUT_DIR: "coverage_ltv"
+ COVERAGE_TITLE: "long test vectors"
+ script:
# -- Add extended coverage of EVS test and long test vectors
- - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR/test_param_file.py -v -n auto --update_ref 1 --param_file scripts/config/self_test_evs.prm --ref_encoder_path ./IVAS_cod --ref_decoder_path ./IVAS_dec
- - bash ci/smoke_test.sh coverage
- - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR/test_param_file.py -v -n auto --update_ref 1 --param_file scripts/config/self_test_ltv.prm --ref_encoder_path ./IVAS_cod --ref_decoder_path ./IVAS_dec
- - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR/test_sba.py -v -n auto --update_ref 1 --ref_encoder_path ./IVAS_cod --ref_decoder_path ./IVAS_dec --use_ltv
- - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR/test_sba.py -v --dut_encoder_path ./IVAS_cod --dut_decoder_path ./IVAS_dec --dut_fr 5 --decoder_only --use_ltv || true
- - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR/test_sba.py -v --dut_encoder_path ./IVAS_cod --dut_decoder_path ./IVAS_dec --dut_fr 10 --decoder_only --use_ltv || true
- - python3 -m pytest tests/test_be_for_jbm_neutral_dly_profile.py
- - lcov -c -d obj -o coverage.info
- # remove apps and lib_util files from coverage
- - lcov -r coverage.info "*apps*" -o coverage.info
- - lcov -r coverage.info "*lib_util*" -o coverage.info
- - commit_sha=$(git rev-parse HEAD)
- - genhtml coverage.info -o coverage -t "Coverage on main @ $commit_sha"
- - genhtml coverage_stv.info -o coverage_stv -t "Coverage on main -- short test vectors @ $commit_sha"
+ - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR/test_param_file.py -v -n auto -q --tb=no --update_ref 1 --param_file scripts/config/self_test_evs.prm --ref_encoder_path ./IVAS_cod --ref_decoder_path ./IVAS_dec
+ # default renderer framesize is 20ms
+ - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR/test_param_file.py -v -n auto -q --tb=no --update_ref 1 --param_file scripts/config/self_test_ltv.prm --ref_encoder_path ./IVAS_cod --ref_decoder_path ./IVAS_dec
+ # for different renderer framesizes, only the decoder needs to be tested, so use --decoder_only
+ # need to ignore non-zero exit codes as limiter is active and thus the different framesiszes will not be BE in all cases
+ - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR/test_param_file.py -v -n auto -q --tb=no --param_file scripts/config/self_test_ltv.prm --dut_decoder_path ./IVAS_dec --decoder_only --dut_fr 5 || true
+ - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR/test_param_file.py -v -n auto -q --tb=no --param_file scripts/config/self_test_ltv.prm --dut_decoder_path ./IVAS_dec --decoder_only --dut_fr 10 || true
+ - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR/test_sba.py -v -n auto -q --tb=no --update_ref 1 --ref_encoder_path ./IVAS_cod --ref_decoder_path ./IVAS_dec --use_ltv
+ - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR/test_sba.py -v -n auto -q --tb=no --dut_encoder_path ./IVAS_cod --dut_decoder_path ./IVAS_dec --dut_fr 5 --decoder_only --use_ltv || true
+ - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR/test_sba.py -v -n auto -q --tb=no --dut_encoder_path ./IVAS_cod --dut_decoder_path ./IVAS_dec --dut_fr 10 --decoder_only --use_ltv || true
+ # run renderer smoke test - needed for REFVEC tests
+ - ls -altr scripts/testv
+ # LTV smoketest is the same as REF creation stage for renderer
+ - python3 -m pytest -n auto -q --tb=no tests/renderer/test_renderer.py --use_ltv
+ # split rendering test doesn't support LTV - skipped here
+ # VoIP BE tests don't support LTV - skipped here
artifacts:
- name: "main-coverage-sha-$CI_COMMIT_SHORT_SHA"
- when: always
- expire_in: 1 week
paths:
- - coverage.info
- - coverage_stv.info
- - coverage
- - coverage_stv
+ - $COVERAGE_OUTPUT_FILE
+ - $COVERAGE_OUTPUT_DIR
# ---------------------------------------------------------------
# Complexity measurement jobs
diff --git a/.gitlab-ci/variables.yml b/.gitlab-ci/variables.yml
index 9e60194a6c7cbe29dba20cbbcc6de430961cb571..b70de66596b69cf9aef46b56d71ec8f392b0fe28 100644
--- a/.gitlab-ci/variables.yml
+++ b/.gitlab-ci/variables.yml
@@ -18,6 +18,7 @@ variables:
- 'ivas-conformance-linux'
- 'check-clipping'
- 'test-branch-vs-input-passthrough'
+ - 'coverage'
PYTEST_ARGS: ""
LONG_TEST_SUITE: "tests/codec_be_on_mr_nonselection tests/renderer --param_file scripts/config/self_test_ltv.prm --use_ltv"
@@ -28,3 +29,7 @@ variables:
TEST_SUITE: ""
# note: currently overwrites default value from ci repo
TESTCASE_TIMEOUT_STV_SANITIZERS: 240
+ COVERAGE_OUTPUT_FILE_STV: "coverage-stv.info"
+ COVERAGE_OUTPUT_FILE_LTV: "coverage-ltv.info"
+ COVERAGE_OUTPUT_FILE_CONFORMANCE: "coverage-conformance.info"
+ COVERAGE_OUTPUT_FILE_MERGED: "coverage-merged.info"
diff --git a/Workspace_msvc/lib_util.vcxproj b/Workspace_msvc/lib_util.vcxproj
index bead7110f33c5f14f0318980c52e315d490a5d9b..85859e257cb0d7e5ebb4efb670a53c44e7cd6361 100644
--- a/Workspace_msvc/lib_util.vcxproj
+++ b/Workspace_msvc/lib_util.vcxproj
@@ -110,6 +110,12 @@
+
+
+
+
+
+
@@ -123,7 +129,6 @@
-
@@ -139,6 +144,14 @@
+
+
+
+
+
+
+
+
@@ -152,7 +165,6 @@
-
diff --git a/Workspace_msvc/lib_util.vcxproj.filters b/Workspace_msvc/lib_util.vcxproj.filters
index 8fc8082d1a4d9a3ab8790074ae02daf283a9ba20..07c8fdfe435e4f5835dd69ec4c25598d4e67e0f4 100644
--- a/Workspace_msvc/lib_util.vcxproj.filters
+++ b/Workspace_msvc/lib_util.vcxproj.filters
@@ -67,9 +67,6 @@
util_c
-
- util_c
-
util_c
@@ -82,6 +79,24 @@
util_c
+
+ util_c
+
+
+ util_c
+
+
+ util_c
+
+
+ util_c
+
+
+ util_c
+
+
+ util_c
+
@@ -150,9 +165,6 @@
util_h
-
- util_h
-
util_h
@@ -171,6 +183,30 @@
util_h
+
+ util_h
+
+
+ util_h
+
+
+ util_h
+
+
+ util_h
+
+
+ util_h
+
+
+ util_h
+
+
+ util_h
+
+
+ util_h
+
diff --git a/apps/decoder.c b/apps/decoder.c
index 63f68854776e937077ec9ef0522af8eeca6c3d7f..ed96f7919618ff1fc2c47531da14f77b5b81b8de 100644
--- a/apps/decoder.c
+++ b/apps/decoder.c
@@ -38,6 +38,9 @@
#include "bitstream_reader.h"
#include "evs_rtp_payload.h"
#include "ism_file_writer.h"
+#ifdef IVAS_RTPDUMP
+#include "ivas_rtp_file.h"
+#endif
#include "jbm_file_writer.h"
#include "hrtf_file_reader.h"
#include "ls_custom_file_reader.h"
@@ -129,6 +132,9 @@ typedef struct
IVAS_DEC_COMPLEXITY_LEVEL complexityLevel;
bool tsmEnabled;
IVAS_RENDER_FRAMESIZE renderFramesize;
+#ifdef IVAS_RTPDUMP
+ char *piOutputFilename;
+#endif
#ifdef DEBUGGING
#ifdef DEBUG_FOA_AGC
FILE *agcBitstream; /* temporary */
@@ -738,6 +744,7 @@ int main(
if ( arg.voipMode )
{
+
#ifdef FIX_1119_SPLIT_RENDERING_VOIP
error = decodeVoIP( arg, hBsReader, &hHrtfBinary, headRotReader, externalOrientationFileReader, refRotReader, referenceVectorReader, objectEditFileReader, &splitRendBits, hIvasDec, pcmBuf );
#else
@@ -968,6 +975,9 @@ static bool parseCmdlIVAS_dec(
arg->referenceVectorTrajFileName = NULL;
arg->enableExternalOrientation = false;
arg->externalOrientationTrajFileName = NULL;
+#ifdef IVAS_RTPDUMP
+ arg->piOutputFilename = NULL;
+#endif
#ifdef SUPPORT_JBM_TRACEFILE
arg->jbmTraceFilename = NULL;
@@ -1054,6 +1064,20 @@ static bool parseCmdlIVAS_dec(
arg->inputFormat = IVAS_DEC_INPUT_FORMAT_RTPDUMP_HF;
i++;
}
+#ifdef IVAS_RTPDUMP
+ else if ( strcmp( argv_to_upper, "-PIDATAFILE" ) == 0 )
+ {
+ i++;
+ if ( argc - i <= 3 || argv[i][0] == '-' )
+ {
+ fprintf( stderr, "Error: PI Data Output file name not specified!\n\n" );
+ usage_dec();
+ return false;
+ }
+
+ arg->piOutputFilename = argv[i++];
+ }
+#endif
#ifdef SUPPORT_JBM_TRACEFILE
else if ( strcmp( argv_to_upper, "-TRACEFILE" ) == 0 )
{
@@ -1638,10 +1662,19 @@ static void usage_dec( void )
fprintf( stdout, "--------\n" );
fprintf( stdout, "-VOIP : VoIP mode: RTP in G192\n" );
fprintf( stdout, "-VOIP_hf_only=0 : VoIP mode: EVS RTP Payload Format hf_only=0 in rtpdump\n" );
+#ifdef IVAS_RTPDUMP
+ fprintf( stdout, "-VOIP_hf_only=1 : VoIP mode: EVS or IVAS RTP Payload Format hf_only=1 in rtpdump\n" );
+ fprintf( stdout, " The decoder may read rtpdump files containing TS26.445 Annex A.2.2\n" );
+ fprintf( stdout, " EVS RTP Payload Format or rtpdump files containing TS26.253 Annex A\n" );
+ fprintf( stdout, " IVAS RTP Payload Format. The SDP parameter hf_only is required.\n" );
+ fprintf( stdout, " Reading RFC4867 AMR/AMR-WB RTP payload format is not supported.\n" );
+ fprintf( stdout, "-PiDataFile PF Log the timestampped PI data.\n" );
+#else
fprintf( stdout, "-VOIP_hf_only=1 : VoIP mode: EVS RTP Payload Format hf_only=1 in rtpdump\n" );
fprintf( stdout, " The decoder may read rtpdump files containing TS26.445 Annex A.2.2\n" );
fprintf( stdout, " EVS RTP Payload Format. The SDP parameter hf_only is required.\n" );
fprintf( stdout, " Reading RFC4867 AMR/AMR-WB RTP payload format is not supported.\n" );
+#endif
#ifdef SUPPORT_JBM_TRACEFILE
fprintf( stdout, "-Tracefile TF : VoIP mode: Generate trace file named TF. Requires -no_delay_cmp to\n" );
fprintf( stdout, " be enabled so that trace contents remain in sync with audio output.\n" );
@@ -2881,24 +2914,40 @@ static ivas_error printBitstreamInfoVoip(
{
bool previewFailed = true;
ivas_error error = IVAS_ERR_OK;
+#ifdef IVAS_RTPDUMP
+ IVAS_RTP ivasRtp;
+ uint8_t au[( IVAS_MAX_BITS_PER_FRAME + 7 ) >> 3];
+ int16_t auSizeBits;
+ uint8_t *auPtr = NULL;
+#else
FILE *f_rtpstream = NULL;
EVS_RTPDUMP_DEPACKER rtpdumpDepacker;
EVS_RTPDUMP_DEPACKER_ERROR rtpdumpDepackerError = EVS_RTPDUMP_DEPACKER_NO_ERROR;
+ bool isAMRWB_IOmode;
+ uint16_t frameTypeIndex;
uint8_t au[( IVAS_MAX_BITS_PER_FRAME + 7 ) >> 3];
int16_t auSizeBits;
uint8_t *auPtr = NULL;
- bool isAMRWB_IOmode;
- uint16_t frameTypeIndex;
+#endif
bool qBit;
uint32_t nextPacketRcvTime_ms = 0;
uint16_t rtpSequenceNumber;
uint32_t rtpTimeStamp;
+#ifndef IVAS_RTPDUMP
rtpdumpDepacker.rtpdump = NULL;
+#endif
switch ( arg.inputFormat )
{
case IVAS_DEC_INPUT_FORMAT_RTPDUMP:
case IVAS_DEC_INPUT_FORMAT_RTPDUMP_HF:
+#ifdef IVAS_RTPDUMP
+ if ( ( error = IVAS_RTP_READER_Init( &ivasRtp, arg.inputBitstreamFilename, arg.piOutputFilename ) ) != IVAS_ERR_OK )
+ {
+ fprintf( stderr, "error in IVAS_RTP_READER_Init(): %d\n", error );
+ goto cleanup;
+ }
+#else
f_rtpstream = fopen( arg.inputBitstreamFilename, "r" );
if ( f_rtpstream == NULL )
@@ -2913,6 +2962,7 @@ static ivas_error printBitstreamInfoVoip(
fprintf( stderr, "error in EVS_RTPDUMP_DEPACKER_open(): %d\n", rtpdumpDepackerError );
goto cleanup;
}
+#endif
break;
case IVAS_DEC_INPUT_FORMAT_G192:
auPtr = au;
@@ -2933,12 +2983,20 @@ static ivas_error printBitstreamInfoVoip(
else
{
auPtr = au; /* might have been set to RTP packet in prev call */
+#ifdef IVAS_RTPDUMP
+ error = IVAS_RTP_ReadNextFrame( &ivasRtp, auPtr, &auSizeBits, &rtpTimeStamp, &rtpSequenceNumber, &nextPacketRcvTime_ms, &qBit );
+#else
rtpdumpDepackerError = EVS_RTPDUMP_DEPACKER_readNextFrame( &rtpdumpDepacker, &rtpSequenceNumber, &rtpTimeStamp, &nextPacketRcvTime_ms, &isAMRWB_IOmode, &frameTypeIndex, &qBit, &auPtr, (uint16_t *) &auSizeBits );
+#endif
/* EVS RTP payload format has timescale 16000, JBM uses 1000 internally */
rtpTimeStamp = rtpTimeStamp / 16;
}
+#ifdef IVAS_RTPDUMP
+ if ( error != IVAS_ERR_OK )
+#else
if ( error != IVAS_ERR_OK || rtpdumpDepackerError != EVS_RTPDUMP_DEPACKER_NO_ERROR )
+#endif
{
fprintf( stderr, "failed to read first RTP packet\n" );
goto cleanup;
@@ -2957,7 +3015,11 @@ static ivas_error printBitstreamInfoVoip(
cleanup:
+#ifdef IVAS_RTPDUMP
+ IVAS_RTP_Term( &ivasRtp );
+#else
EVS_RTPDUMP_DEPACKER_close( &rtpdumpDepacker );
+#endif
if ( previewFailed && error == IVAS_ERR_OK )
{
@@ -3026,12 +3088,18 @@ static ivas_error decodeVoIP(
int16_t delayNumSamples = -1;
int32_t delayTimeScale = -1;
int16_t i;
+#ifdef IVAS_RTPDUMP
+ IVAS_RTP ivasRtp = { 0 };
+#else
FILE *f_rtpstream = NULL;
EVS_RTPDUMP_DEPACKER rtpdumpDepacker;
EVS_RTPDUMP_DEPACKER_ERROR rtpdumpDepackerError = EVS_RTPDUMP_DEPACKER_NO_ERROR;
+#endif
uint8_t *auPtr = NULL;
+#ifndef IVAS_RTPDUMP
bool isAMRWB_IOmode;
uint16_t frameTypeIndex;
+#endif
bool qBit;
IVAS_DEC_BS_FORMAT bsFormat = IVAS_DEC_BS_UNKOWN;
@@ -3092,11 +3160,20 @@ static ivas_error decodeVoIP(
delayNumSamples_orig[0] = -1;
+#ifndef IVAS_RTPDUMP
rtpdumpDepacker.rtpdump = NULL;
+#endif
switch ( arg.inputFormat )
{
case IVAS_DEC_INPUT_FORMAT_RTPDUMP:
case IVAS_DEC_INPUT_FORMAT_RTPDUMP_HF:
+#ifdef IVAS_RTPDUMP
+ if ( ( error = IVAS_RTP_READER_Init( &ivasRtp, arg.inputBitstreamFilename, arg.piOutputFilename ) ) != IVAS_ERR_OK )
+ {
+ fprintf( stderr, "error in IVAS_RTP_READER_Init(): %d\n", error );
+ goto cleanup;
+ }
+#else
f_rtpstream = fopen( arg.inputBitstreamFilename, "r" );
if ( f_rtpstream == NULL )
@@ -3111,6 +3188,7 @@ static ivas_error decodeVoIP(
fprintf( stderr, "error in EVS_RTPDUMP_DEPACKER_open(): %d\n", rtpdumpDepackerError );
goto cleanup;
}
+#endif
break;
case IVAS_DEC_INPUT_FORMAT_G192:
auPtr = au;
@@ -3152,12 +3230,20 @@ static ivas_error decodeVoIP(
else
{
auPtr = au; /* might have been set to RTP packet in prev call */
+#ifdef IVAS_RTPDUMP
+ error = IVAS_RTP_ReadNextFrame( &ivasRtp, auPtr, &auSize, &rtpTimeStamp, &rtpSequenceNumber, &nextPacketRcvTime_ms, &qBit );
+#else
rtpdumpDepackerError = EVS_RTPDUMP_DEPACKER_readNextFrame( &rtpdumpDepacker, &rtpSequenceNumber, &rtpTimeStamp, &nextPacketRcvTime_ms, &isAMRWB_IOmode, &frameTypeIndex, &qBit, &auPtr, (uint16_t *) &auSize );
+#endif
/* EVS RTP payload format has timescale 16000, JBM uses 1000 internally */
rtpTimeStamp = rtpTimeStamp / 16;
}
+#ifdef IVAS_RTPDUMP
+ if ( error != IVAS_ERR_OK )
+#else
if ( error != IVAS_ERR_OK || rtpdumpDepackerError != EVS_RTPDUMP_DEPACKER_NO_ERROR )
+#endif
{
fprintf( stderr, "failed to read first RTP packet\n" );
goto cleanup;
@@ -3327,19 +3413,34 @@ static ivas_error decodeVoIP(
else
{
auPtr = au; /* might have been set to RTP packet in prev call */
+#ifdef IVAS_RTPDUMP
+ error = IVAS_RTP_ReadNextFrame( &ivasRtp, au, &auSize, &rtpTimeStamp, &rtpSequenceNumber, &nextPacketRcvTime_ms, &qBit );
+
+ /* IVAS RTP payload format has timescale 16000, JBM uses 1000 internally */
+ rtpTimeStamp = rtpTimeStamp / 16;
+#else
rtpdumpDepackerError = EVS_RTPDUMP_DEPACKER_readNextFrame( &rtpdumpDepacker, &rtpSequenceNumber, &rtpTimeStamp,
&nextPacketRcvTime_ms,
&isAMRWB_IOmode, &frameTypeIndex, &qBit,
&auPtr, (uint16_t *) &auSize );
/* EVS RTP payload format has timescale 16000, JBM uses 1000 internally */
rtpTimeStamp = rtpTimeStamp / 16;
+#endif
}
+#ifdef IVAS_RTPDUMP
+ if ( error == IVAS_ERR_END_OF_FILE )
+#else
if ( error == IVAS_ERR_END_OF_FILE || rtpdumpDepackerError == EVS_RTPDUMP_DEPACKER_EOF )
+#endif
{
/* finished reading */
nextPacketRcvTime_ms = (uint32_t) -1;
}
+#ifdef IVAS_RTPDUMP
+ else if ( error != IVAS_ERR_OK )
+#else
else if ( error != IVAS_ERR_OK || rtpdumpDepackerError != EVS_RTPDUMP_DEPACKER_NO_ERROR )
+#endif
{
fprintf( stderr, "\nError in BS_Reader_ReadVoipFrame_compact, error code: %d\n", error );
goto cleanup;
@@ -3735,7 +3836,11 @@ static ivas_error decodeVoIP(
cleanup:
+#ifdef IVAS_RTPDUMP
+ IVAS_RTP_Term( &ivasRtp );
+#else
EVS_RTPDUMP_DEPACKER_close( &rtpdumpDepacker );
+#endif
AudioFileWriter_close( &afWriter );
#ifdef FIX_1119_SPLIT_RENDERING_VOIP
split_rend_reader_writer_close( &splitRendWriter );
diff --git a/apps/encoder.c b/apps/encoder.c
index 4d9626edc3f972407ac59ce47074f613529597d1..44fda79373b257c91adccbe9d0e54191c78e7383 100644
--- a/apps/encoder.c
+++ b/apps/encoder.c
@@ -38,6 +38,10 @@
#include "ism_file_reader.h"
#include "jbm_file_reader.h"
#include "masa_file_reader.h"
+#ifdef IVAS_RTPDUMP
+#include "rotation_file_reader.h"
+#include "ivas_rtp_file.h"
+#endif
#ifdef DEBUGGING
#include "debug.h"
#endif
@@ -149,6 +153,12 @@ typedef struct
#endif
bool pca;
bool ism_extended_metadata;
+#ifdef IVAS_RTPDUMP
+ bool rtpdumpOutput;
+ uint32_t numFramesPerPacket;
+ char *sceneOrientationTrajFileName;
+ char *deviceOrientationTrajFileName;
+#endif
} EncArguments;
@@ -192,6 +202,10 @@ int main(
MasaFileReader *masaReader = NULL;
IsmFileReader *ismReaders[IVAS_MAX_NUM_OBJECTS] = { NULL, NULL, NULL, NULL };
int16_t *pcmBuf = NULL;
+#ifdef IVAS_RTPDUMP
+ RotFileReader *sceneOrientationFileReader = NULL;
+ RotFileReader *deviceOrientationFileReader = NULL;
+#endif
#ifdef DEBUGGING
FILE *f_forcedModeProfile = NULL;
#ifdef DEBUG_SBA
@@ -212,6 +226,11 @@ int main(
enable_float_exception_trap( FLE_MASK_DENORM | FLE_MASK_UNDERFLOW );
#endif
+#ifdef IVAS_RTPDUMP
+ uint8_t au[IVAS_MAX_BITS_PER_FRAME / 8];
+ IVAS_RTP ivasRtp = { 0 };
+#endif
+
/*------------------------------------------------------------------------------------------*
* Parse command-line arguments
*------------------------------------------------------------------------------------------*/
@@ -240,7 +259,11 @@ int main(
const BS_WRITER_FORMAT bsWriterFormat = arg.mimeOutput ? BS_WRITER_FORMAT_MIME : BS_WRITER_FORMAT_G192;
+#ifdef IVAS_RTPDUMP
+ if ( !arg.rtpdumpOutput && BS_Writer_Open_filename( &hBsWriter, arg.outputBitstreamFilename, bsWriterFormat ) != IVAS_ERR_OK )
+#else
if ( BS_Writer_Open_filename( &hBsWriter, arg.outputBitstreamFilename, bsWriterFormat ) != IVAS_ERR_OK )
+#endif
{
fprintf( stderr, "\nCan't open %s\n\n", arg.outputBitstreamFilename );
goto cleanup;
@@ -598,6 +621,47 @@ int main(
}
}
+#ifdef IVAS_RTPDUMP
+ /*------------------------------------------------------------------------------------------*
+ * RTPDump
+ *------------------------------------------------------------------------------------------*/
+
+ if ( arg.rtpdumpOutput )
+ {
+ if ( ( error = IVAS_RTP_WRITER_Init( &ivasRtp, arg.outputBitstreamFilename, arg.numFramesPerPacket ) ) != IVAS_ERR_OK )
+ {
+ fprintf( stderr, "\nError: Can't open output bitstream file for RTP output %s \n\n", arg.outputBitstreamFilename );
+ goto cleanup;
+ }
+ }
+
+ /*------------------------------------------------------------------------------------------*
+ * Open scene orientation file
+ *------------------------------------------------------------------------------------------*/
+
+ if ( arg.sceneOrientationTrajFileName != NULL )
+ {
+ if ( ( error = RotationFileReader_open( arg.sceneOrientationTrajFileName, &sceneOrientationFileReader ) ) != IVAS_ERR_OK )
+ {
+ fprintf( stderr, "\nError: Can't open scene orientation file %s \n\n", arg.sceneOrientationTrajFileName );
+ goto cleanup;
+ }
+ }
+
+ /*------------------------------------------------------------------------------------------*
+ * Open device orientation file
+ *------------------------------------------------------------------------------------------*/
+
+ if ( arg.deviceOrientationTrajFileName != NULL )
+ {
+ if ( ( error = RotationFileReader_open( arg.deviceOrientationTrajFileName, &deviceOrientationFileReader ) ) != IVAS_ERR_OK )
+ {
+ fprintf( stderr, "\nError: Can't open device orientation file %s \n\n", arg.deviceOrientationTrajFileName );
+ goto cleanup;
+ }
+ }
+#endif
+
int16_t numSamplesRead = 0;
uint16_t bitStream[IVAS_MAX_BITS_PER_FRAME];
uint16_t numBits = 0;
@@ -762,18 +826,78 @@ int main(
}
/* *** Encode one frame *** */
- if ( ( error = IVAS_ENC_EncodeFrameToSerial( hIvasEnc, pcmBuf, pcmBufSize, bitStream, &numBits ) ) != IVAS_ERR_OK )
+#ifdef IVAS_RTPDUMP
+ if ( ivasRtp.hPack )
{
- fprintf( stderr, "\nencodeFrame failed: %s\n\n", IVAS_ENC_GetErrorMessage( error ) );
- goto cleanup;
- }
+ bool isMono = ( arg.inputFormat == IVAS_ENC_INPUT_MONO );
+ bool forcePacket = ( numSamplesRead < pcmBufSize ); /* If EoF force Packet generation */
+
+ ivasRtp.nWrittenPiData = 0;
+
+ /* scene orientation */
+ if ( sceneOrientationFileReader )
+ {
+ PIDATA_TS *piDataTs = &ivasRtp.piData[ivasRtp.nWrittenPiData++];
+ IVAS_PIDATA_ORIENTATION *scene = &piDataTs->data.scene;
+
+ memset( piDataTs, 0, sizeof( PIDATA_TS ) );
+ scene->size = sizeof( IVAS_PIDATA_ORIENTATION );
+ scene->piDataType = IVAS_PI_SCENE_ORIENTATION;
+
+ if ( ( error = HeadRotationFileReading( sceneOrientationFileReader, &scene->orientation, NULL ) ) != IVAS_ERR_OK )
+ {
+ fprintf( stderr, "\nError %s while reading scene orientation from %s\n", IVAS_ENC_GetErrorMessage( error ), RotationFileReader_getFilePath( sceneOrientationFileReader ) );
+ goto cleanup;
+ }
+ }
+
+ /* device orientation */
+ if ( deviceOrientationFileReader )
+ {
+ PIDATA_TS *piDataTs = &ivasRtp.piData[ivasRtp.nWrittenPiData++];
+ IVAS_PIDATA_ORIENTATION *device = &piDataTs->data.deviceUnCompensated;
+
+ memset( piDataTs, 0, sizeof( PIDATA_TS ) );
+ device->size = sizeof( IVAS_PIDATA_ORIENTATION );
+ device->piDataType = IVAS_PI_DEVICE_ORIENTATION_COMPENSATED;
+
+ if ( ( error = HeadRotationFileReading( deviceOrientationFileReader, &device->orientation, NULL ) ) != IVAS_ERR_OK )
+ {
+ fprintf( stderr, "\nError %s while reading device orientation from %s\n", IVAS_ENC_GetErrorMessage( error ), RotationFileReader_getFilePath( deviceOrientationFileReader ) );
+ goto cleanup;
+ }
+ }
- /* write bitstream */
- if ( ( error = BS_Writer_WriteFrame_short( hBsWriter, bitStream, numBits, totalBitrate ) ) != IVAS_ERR_OK )
+ if ( ( error = IVAS_ENC_EncodeFrameToCompact( hIvasEnc, pcmBuf, pcmBufSize, au, &numBits ) ) != IVAS_ERR_OK )
+ {
+ fprintf( stderr, "\nencodeFrame failed: %s\n\n", IVAS_ENC_GetErrorMessage( error ) );
+ goto cleanup;
+ }
+
+ if ( ( error = IVAS_RTP_WriteNextFrame( &ivasRtp, au, numBits, isMono, forcePacket ) ) != IVAS_ERR_OK )
+ {
+ fprintf( stderr, "\nError %s while pushing audio frame to RTP pack\n", IVAS_ENC_GetErrorMessage( error ) );
+ goto cleanup;
+ }
+ }
+ else
{
- fprintf( stderr, "\nBS_Writer_WriteFrame_short failed, error code %d\n\n", error );
- goto cleanup;
+#endif
+ if ( ( error = IVAS_ENC_EncodeFrameToSerial( hIvasEnc, pcmBuf, pcmBufSize, bitStream, &numBits ) ) != IVAS_ERR_OK )
+ {
+ fprintf( stderr, "\nencodeFrame failed: %s\n\n", IVAS_ENC_GetErrorMessage( error ) );
+ goto cleanup;
+ }
+
+ /* write bitstream */
+ if ( ( error = BS_Writer_WriteFrame_short( hBsWriter, bitStream, numBits, totalBitrate ) ) != IVAS_ERR_OK )
+ {
+ fprintf( stderr, "\nBS_Writer_WriteFrame_short failed, error code %d\n\n", error );
+ goto cleanup;
+ }
+#ifdef IVAS_RTPDUMP
}
+#endif
frame++;
if ( !arg.quietModeEnabled )
@@ -851,6 +975,20 @@ cleanup:
fclose( f_bitrateProfile );
}
+#ifdef IVAS_RTPDUMP
+ if ( sceneOrientationFileReader )
+ {
+ RotationFileReader_close( &sceneOrientationFileReader );
+ }
+
+ if ( deviceOrientationFileReader )
+ {
+ RotationFileReader_close( &deviceOrientationFileReader );
+ }
+
+ IVAS_RTP_Term( &ivasRtp );
+#endif
+
IVAS_ENC_Close( &hIvasEnc );
#ifdef WMOPS
@@ -921,6 +1059,11 @@ static bool parseCmdlIVAS_enc(
arg->mimeOutput = false;
arg->ism_extended_metadata = false;
arg->complexityLevel = IVAS_ENC_COMPLEXITY_LEVEL_THREE;
+#ifdef IVAS_RTPDUMP
+ arg->rtpdumpOutput = false;
+ arg->sceneOrientationTrajFileName = NULL;
+ arg->deviceOrientationTrajFileName = NULL;
+#endif
#ifdef DEBUGGING
arg->forcedMode = IVAS_ENC_FORCE_UNFORCED;
@@ -1715,6 +1858,71 @@ static bool parseCmdlIVAS_enc(
i++;
}
+#ifdef IVAS_RTPDUMP
+ /*-----------------------------------------------------------------*
+ * RTPDump output
+ *-----------------------------------------------------------------*/
+
+ else if ( strcmp( argv_to_upper, "-RTPDUMP" ) == 0 )
+ {
+ i++;
+ arg->rtpdumpOutput = true;
+ if ( i < argc - 4 )
+ {
+ if ( !is_digits_only( argv[i] ) )
+ {
+ arg->numFramesPerPacket = 1; /* Default to 1 frame per packet */
+ }
+ else
+ {
+ arg->numFramesPerPacket = atoi( argv[i++] );
+ if ( arg->numFramesPerPacket > IVAS_MAX_FRAMES_PER_RTP_PACKET )
+ {
+ fprintf( stderr, "numFramesPerPacket(%d) exceeds max frames per packet (%d) \n", arg->numFramesPerPacket, IVAS_MAX_FRAMES_PER_RTP_PACKET );
+ arg->numFramesPerPacket = 1;
+ }
+ }
+ }
+ fprintf( stdout, "Output format: RTPDump using %d frames/packet \n", arg->numFramesPerPacket );
+ }
+
+ /*-----------------------------------------------------------------*
+ * Scene orientation
+ *-----------------------------------------------------------------*/
+
+ else if ( strcmp( argv_to_upper, "-SCENE_ORIENTATION" ) == 0 )
+ {
+ i++;
+ if ( argc - i <= 4 || argv[i][0] == '-' )
+ {
+ fprintf( stderr, "Error: Scene orientation file name not specified!\n\n" );
+ usage_enc();
+ return false;
+ }
+
+ arg->sceneOrientationTrajFileName = argv[i];
+ i++;
+ }
+
+ /*-----------------------------------------------------------------*
+ * Device orientation
+ *-----------------------------------------------------------------*/
+
+ else if ( strcmp( argv_to_upper, "-DEVICE_ORIENTATION" ) == 0 )
+ {
+ i++;
+ if ( argc - i <= 4 || argv[i][0] == '-' )
+ {
+ fprintf( stderr, "Error: Device orientation file name not specified!\n\n" );
+ usage_enc();
+ return false;
+ }
+
+ arg->deviceOrientationTrajFileName = argv[i];
+ i++;
+ }
+
+#endif
/*-----------------------------------------------------------------*
* Option not recognized
*-----------------------------------------------------------------*/
@@ -1726,6 +1934,21 @@ static bool parseCmdlIVAS_enc(
}
} /* end of while */
+#ifdef IVAS_RTPDUMP
+ if ( arg->sceneOrientationTrajFileName != NULL && arg->rtpdumpOutput == false )
+ {
+ fprintf( stderr, "Error: Scene orientations are only enabled with rtpdump output!\n\n" );
+ usage_enc();
+ return false;
+ }
+ if ( arg->deviceOrientationTrajFileName != NULL && arg->rtpdumpOutput == false )
+ {
+ fprintf( stderr, "Error: Device orientations are only enabled with rtpdump output!\n\n" );
+ usage_enc();
+ return false;
+ }
+
+#endif
/*-----------------------------------------------------------------*
* Mandatory input arguments
*-----------------------------------------------------------------*/
@@ -1932,6 +2155,14 @@ static void usage_enc( void )
#endif
fprintf( stdout, "-q : Quiet mode, no frame counters\n" );
fprintf( stdout, " default is deactivated\n" );
+#ifdef IVAS_RTPDUMP
+ fprintf( stdout, "-rtpdump : RTPDump output, hf_only=1 by default. The encoder will packetize the \n" );
+ fprintf( stdout, " bitstream frames into TS26.253 Annex A IVAS RTP Payload Format packets and \n" );
+ fprintf( stdout, " writes those to the output file. In EVS mono operating mode, TS26.445 Annex A.2.2 \n" );
+ fprintf( stdout, " EVS RTP Payload Format is used. Optional N represents number of frames per RTP packet\n" );
+ fprintf( stdout, "-scene_orientation : Scene orientation trajectory file. Only used with rtpdump output.\n" );
+ fprintf( stdout, "-device_orientation : Device orientation trajectory file. Only used with rtpdump output.\n" );
+#endif
fprintf( stdout, "\n" );
return;
diff --git a/ci/index-pages.html b/ci/index-pages.html
index 510e2031155ac1b2a2296b1066d29c37cb1344f7..390f06631d57664149ea2149ad62860cc859058a 100644
--- a/ci/index-pages.html
+++ b/ci/index-pages.html
@@ -11,9 +11,6 @@
Test Coverage
-
+ {}