diff --git a/.gitignore b/.gitignore index 20c6aa6fdca441305fac4bc2c10afabcefc84d5e..9097b50575b947590d9c1439255513de9cafc3e4 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ IVAS_cod IVAS_dec IVAS_rend ISAR_post_rend +ambi_converter obj/ *.a *.o @@ -18,6 +19,7 @@ IVAS_cod.exe IVAS_dec.exe IVAS_rend.exe ISAR_post_rend.exe +ambi_converter.exe *.user .vs/ Debug_*/ diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1a4448046e775c2f2a9c69ae43cf5760599e6997..0c5f72c3344ae2a5a4c3bb871914340a281db724 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 @@ -125,9 +128,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" @@ -142,7 +145,7 @@ workflow: - make clean - make -j CLANG=$CLANG_NUM - testcase_timeout=$SELFTEST_SANITY_TIMEOUT - - export UBSAN_OPTIONS=suppressions=scripts/ubsan.supp,report_error_type=1 + - export UBSAN_OPTIONS=suppressions=scripts/ubsan.supp,report_error_type=1,print_stacktrace=1 - exit_code20=0 - exit_code10=0 @@ -160,7 +163,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 # --------------------------------------------------------------- @@ -359,7 +361,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: @@ -402,7 +403,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 @@ -481,7 +488,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 @@ -550,7 +563,7 @@ renderer-smoke-test: - .rules-merge-request-to-main needs: ["build-codec-linux-cmake"] stage: test - timeout: "1 hour" + timeout: "90 minutes" artifacts: name: "mr-$CI_MERGE_REQUEST_IID--sha-$CI_COMMIT_SHORT_SHA--job-$CI_JOB_NAME--results" expire_in: 1 week @@ -564,12 +577,6 @@ renderer-smoke-test: before_script: - cmake -B cmake-build -G "Unix Makefiles" -DCLANG=$SANITIZER_BUILD_STRING -DCOPY_EXECUTABLES_FROM_BUILD_DIR=true - cmake --build cmake-build -- -j - # rename files to fit naming convention - # en- and decoder needed because of split rendering testcases - - mv IVAS_cod IVAS_cod_ref - - mv IVAS_dec IVAS_dec_ref - - mv IVAS_rend IVAS_rend_ref - - mv ISAR_post_rend ISAR_post_rend_ref - testcase_timeout=180 # test renderer executable with cmake + asan @@ -579,11 +586,10 @@ renderer-asan: variables: SANITIZER_BUILD_STRING: "asan" script: - - python3 -m pytest -q --tb=no -n auto --html=report.html --self-contained-html --junit-xml=report-junit.xml tests/renderer/test_renderer.py tests/split_rendering/test_split_rendering.py --create_ref --testcase_timeout=$testcase_timeout + - python3 -m pytest -q --tb=no -n auto --html=report.html --self-contained-html --junit-xml=report-junit.xml tests/renderer/test_renderer.py tests/split_rendering/test_split_rendering.py --testcase_timeout=$testcase_timeout artifacts: expose_as: "renderer asan result" - # test renderer executable with cmake + msan renderer-msan: extends: @@ -591,11 +597,10 @@ renderer-msan: variables: SANITIZER_BUILD_STRING: "msan" script: - - python3 -m pytest -q --tb=no -n auto --html=report.html --self-contained-html --junit-xml=report-junit.xml tests/renderer/test_renderer.py tests/split_rendering/test_split_rendering.py --create_ref --testcase_timeout=$testcase_timeout + - python3 -m pytest -q --tb=no -n auto --html=report.html --self-contained-html --junit-xml=report-junit.xml tests/renderer/test_renderer.py tests/split_rendering/test_split_rendering.py --testcase_timeout=$testcase_timeout artifacts: expose_as: "renderer msan result" - # test renderer executable with cmake + usan renderer-usan: extends: @@ -603,11 +608,10 @@ renderer-usan: variables: SANITIZER_BUILD_STRING: "usan" script: - - UBSAN_OPTIONS=suppressions=scripts/ubsan.supp,report_error_type=1 python3 -m pytest -q --tb=no -n auto --html=report.html --self-contained-html --junit-xml=report-junit.xml tests/renderer/test_renderer.py tests/split_rendering/test_split_rendering.py --create_ref --testcase_timeout=$testcase_timeout + - UBSAN_OPTIONS=suppressions=scripts/ubsan.supp,report_error_type=1,print_stacktrace=1 python3 -m pytest -q --tb=no -n auto --html=report.html --self-contained-html --junit-xml=report-junit.xml tests/renderer/test_renderer.py tests/split_rendering/test_split_rendering.py --testcase_timeout=$testcase_timeout artifacts: expose_as: "renderer usan result" - # compare renderer bitexactness between target and source branch renderer-pytest-on-merge-request: extends: @@ -681,6 +685,51 @@ split-rendering-smoke-test: junit: - report-junit.xml +# test split rendering in VoIP mode against BINAURAL output +split-rendering-voip-be-to-binaural: + extends: + - .test-job-linux + - .rules-merge-request-to-main + needs: ["build-codec-linux-make"] + stage: test + script: + - make -j + - testcase_timeout=30 + - python3 -m pytest -q -n auto -rA --junit-xml=report-junit.xml tests/split_rendering/test_voip_be_splitrend_vs_binaural.py --testcase_timeout=$testcase_timeout + artifacts: + name: "mr-$CI_MERGE_REQUEST_IID--sha-$CI_COMMIT_SHORT_SHA--job-$CI_JOB_NAME--results" + expire_in: 1 week + when: always + paths: + - report-junit.xml + expose_as: "VoIP split rendering vs BINAURAL make pytest results" + reports: + junit: + - report-junit.xml + +# test rtpdump +rtpdump-test: + extends: + - .test-job-linux + - .rules-merge-request-to-main + needs: ["build-codec-linux-make"] + stage: test + script: + - make -j + - testcase_timeout=15 + - python3 -m pytest -q --tb=no -n auto -rA --html=report.html --self-contained-html --junit-xml=report-junit.xml tests/rtp/test_rtp.py --testcase_timeout=$testcase_timeout + artifacts: + name: "mr-$CI_MERGE_REQUEST_IID--sha-$CI_COMMIT_SHORT_SHA--job-$CI_JOB_NAME--results" + expire_in: 1 week + when: always + paths: + - report-junit.xml + - report.html + expose_as: "rtpdump pytest results" + reports: + junit: + - report-junit.xml + lc3-wrapper-unit-test: extends: - .test-job-linux @@ -824,7 +873,6 @@ ivas-pytest-on-merge-request: junit: - report-junit.xml - # Check interop IVAS_cod_test -> IVAS_dec_ref ivas-interop-on-merge-request: extends: @@ -1071,7 +1119,6 @@ check-bitexactness-ext-and-transport-format: expose_as: "logs-ext-sanity-check" expire_in: "5 days" - # --------------------------------------------------------------- # Test jobs for main branch # --------------------------------------------------------------- @@ -1100,114 +1147,115 @@ be-2-evs-windows: - cd evs_be_win_test - python ../ci/run_evs_be_win_test.py +# TODO: turn into manual job if needed # check bitexactness to EVS -be-2-evs-linux: - extends: - - .test-job-linux - - .rules-main-push - tags: - - be-2-evs-temp - stage: test - needs: ["build-codec-linux-cmake"] - timeout: "20 minutes" # To be revisited - script: - - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/print-common-info.sh - - - mkdir build - - cd build - - cmake .. - - make -j - - cd .. - - # copy over to never change the testvector dir - - cp -r $EVS_BE_TEST_DIR ./evs_be_test - - cp build/IVAS_cod ./evs_be_test/bin/EVS_cod - - cp build/IVAS_dec ./evs_be_test/bin/EVS_dec - - - cd evs_be_test - - python3 ../ci/run_evs_be_test.py - -codec-comparison-on-main-push: - extends: - - .test-job-linux-needs-testv-dir - - .rules-main-push - stage: compare - needs: ["build-codec-linux-cmake"] - timeout: "30 minutes" # To be revisited - script: - - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/print-common-info.sh - - latest_commit=$(git rev-parse HEAD) # Latest commit - - 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 - - # Rest is more or less placeholder adapted from MR self test. This should be replaced with more complex tests. - - ### build test binaries, initial clean for paranoia reasons - - make clean - - mkdir build - - cd build - - cmake .. - - make -j - - mv IVAS_cod ../IVAS_cod_test - - mv IVAS_dec ../IVAS_dec_test - - cd .. - - rm -rf build/* - - ### compare to the previous merge commit in the main branch - - git fetch origin main - - git checkout $previous_merge_commit - - echo "Building reference codec at commit $previous_merge_commit" - - ### build reference binaries - - cd build - - cmake .. - - make -j - - mv IVAS_cod ../IVAS_cod_ref - - mv IVAS_dec ../IVAS_dec_ref - - cd .. - - # helper variable - "|| true" to prevent failures from grep not finding anything - # write to temporary file as workaround for failures observed with piping echo - - echo $CI_COMMIT_MESSAGE > tmp.txt - - non_be_flag=$(grep -c --ignore-case "\[non[ -]*be\]" tmp.txt) || true - - ref_using_main=$(grep -c --ignore-case "\[ref[ -]*using[ -]*main\]" tmp.txt) || true - - ### re-checkout the latest commit in the main branch, if ref_using_main is not set - - if [ $ref_using_main == 0 ]; then git checkout $latest_commit;fi - - ### prepare pytest - # rename test binaries back - - mv IVAS_cod_test IVAS_cod - - mv IVAS_dec_test IVAS_dec - # create references - - testcase_timeout=60 - - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR -v --update_ref 1 --testcase_timeout=$testcase_timeout - - ### re-checkout the latest commit here, if ref_using_main is set - - if [ $ref_using_main -eq 1 ]; then git checkout $latest_commit;fi - - ### run pytest - - exit_code=0 - - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR -v --html=report.html --self-contained-html --junit-xml=report-junit.xml --testcase_timeout=$testcase_timeout || exit_code=$? - - if [ $exit_code -ne 0 ] && [ $non_be_flag == 0 ]; then echo "pytest run had failures and non-BE flag not present"; exit $EXIT_CODE_FAIL; fi - - zero_errors=$(cat report-junit.xml | grep -c 'errors="0"') || true - - if [ $exit_code -ne 0 ] && [ $zero_errors == 1 ]; then echo "pytest run had failures, but no errors and non-BE flag present"; exit $EXIT_CODE_NON_BE; fi - - if [ $exit_code -ne 0 ]; then echo "pytest run had errors"; exit $EXIT_CODE_FAIL; fi; - allow_failure: - exit_codes: - - 123 - artifacts: - name: "main-push--sha-$CI_COMMIT_SHORT_SHA--job-$CI_JOB_NAME--results" - expire_in: 1 week - when: always - paths: - - report-junit.xml - - report.html - expose_as: "Results of comparison to previous merge commit" - reports: - junit: report-junit.xml - +# be-2-evs-linux: +# extends: +# - .test-job-linux +# - .rules-main-push +# tags: +# - be-2-evs-temp +# stage: test +# needs: ["build-codec-linux-cmake"] +# timeout: "20 minutes" # To be revisited +# script: +# - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/print-common-info.sh +# +# - mkdir build +# - cd build +# - cmake .. +# - make -j +# - cd .. +# +# # copy over to never change the testvector dir +# - cp -r $EVS_BE_TEST_DIR ./evs_be_test +# - cp build/IVAS_cod ./evs_be_test/bin/EVS_cod +# - cp build/IVAS_dec ./evs_be_test/bin/EVS_dec +# +# - cd evs_be_test +# - python3 ../ci/run_evs_be_test.py + +# TODO: do we still need this? +# codec-comparison-on-main-push: +# extends: +# - .test-job-linux-needs-testv-dir +# - .rules-main-push +# stage: compare +# needs: ["build-codec-linux-cmake"] +# timeout: "30 minutes" # To be revisited +# script: +# - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/print-common-info.sh +# - latest_commit=$(git rev-parse HEAD) # Latest commit +# - 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 +# +# # Rest is more or less placeholder adapted from MR self test. This should be replaced with more complex tests. +# +# ### build test binaries, initial clean for paranoia reasons +# - make clean +# - mkdir build +# - cd build +# - cmake .. +# - make -j +# - mv IVAS_cod ../IVAS_cod_test +# - mv IVAS_dec ../IVAS_dec_test +# - cd .. +# - rm -rf build/* +# +# ### compare to the previous merge commit in the main branch +# - git fetch origin main +# - git checkout $previous_merge_commit +# - echo "Building reference codec at commit $previous_merge_commit" +# +# ### build reference binaries +# - cd build +# - cmake .. +# - make -j +# - mv IVAS_cod ../IVAS_cod_ref +# - mv IVAS_dec ../IVAS_dec_ref +# - cd .. +# +# # helper variable - "|| true" to prevent failures from grep not finding anything +# # write to temporary file as workaround for failures observed with piping echo +# - echo $CI_COMMIT_MESSAGE > tmp.txt +# - non_be_flag=$(grep -c --ignore-case "\[non[ -]*be\]" tmp.txt) || true +# - ref_using_main=$(grep -c --ignore-case "\[ref[ -]*using[ -]*main\]" tmp.txt) || true +# +# ### re-checkout the latest commit in the main branch, if ref_using_main is not set +# - if [ $ref_using_main == 0 ]; then git checkout $latest_commit;fi +# +# ### prepare pytest +# # rename test binaries back +# - mv IVAS_cod_test IVAS_cod +# - mv IVAS_dec_test IVAS_dec +# # create references +# - testcase_timeout=60 +# - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR -v --update_ref 1 --testcase_timeout=$testcase_timeout +# +# ### re-checkout the latest commit here, if ref_using_main is set +# - if [ $ref_using_main -eq 1 ]; then git checkout $latest_commit;fi +# +# ### run pytest +# - exit_code=0 +# - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR -v --html=report.html --self-contained-html --junit-xml=report-junit.xml --testcase_timeout=$testcase_timeout || exit_code=$? +# - if [ $exit_code -ne 0 ] && [ $non_be_flag == 0 ]; then echo "pytest run had failures and non-BE flag not present"; exit $EXIT_CODE_FAIL; fi +# - zero_errors=$(cat report-junit.xml | grep -c 'errors="0"') || true +# - if [ $exit_code -ne 0 ] && [ $zero_errors == 1 ]; then echo "pytest run had failures, but no errors and non-BE flag present"; exit $EXIT_CODE_NON_BE; fi +# - if [ $exit_code -ne 0 ]; then echo "pytest run had errors"; exit $EXIT_CODE_FAIL; fi; +# allow_failure: +# exit_codes: +# - 123 +# artifacts: +# name: "main-push--sha-$CI_COMMIT_SHORT_SHA--job-$CI_JOB_NAME--results" +# expire_in: 1 week +# when: always +# paths: +# - report-junit.xml +# - report.html +# expose_as: "Results of comparison to previous merge commit" +# reports: +# junit: report-junit.xml # --------------------------------------------------------------- # Manual jobs @@ -1222,7 +1270,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 @@ -1239,7 +1286,6 @@ test-be-to-release: - logs/ expose_as: "test-be-to-release results" - ivas-conformance: tags: - ivas-windows @@ -1252,36 +1298,33 @@ 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" - - python -m pytest $TEST_SET -v -n auto --update_ref 1 --create_ref --keep_files - - # Output creation - - python -m pytest $TEST_SET -v -n auto --keep_files --create_cut --html=report_cmd.html --self-contained-html + - $TEST_SET = "tests/codec_be_on_mr_nonselection", "tests/renderer_short/test_renderer.py", "tests/split_rendering/test_split_rendering.py" + - python -m pytest -q $TEST_SET -v -n auto --update_ref 1 --create_ref --keep_files --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/renderer_short + - 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 @@ -1289,31 +1332,29 @@ ivas-conformance: - cp -r -force -ErrorAction Ignore scripts/trajectories testvec - cp -r -force -ErrorAction Ignore scripts/binauralRenderer_interface/binaural_renderers_hrtf_data testvec/binauralRenderer_interface - 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/renderer_short/ref testvec/testv/renderer_short/ref + - cp -r -force -ErrorAction Ignore tests/split_rendering/ref 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 .. @@ -1326,12 +1367,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 @@ -1343,9 +1384,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 @@ -1353,24 +1400,21 @@ 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 - - # Output creation - - python3 -m pytest $TEST_SET -v -n auto --keep_files --create_cut --html=report_cmd.html --self-contained-html + - TEST_SET="tests/codec_be_on_mr_nonselection tests/renderer_short/test_renderer.py tests/split_rendering/test_split_rendering.py" + - python3 -m pytest -q $TEST_SET -v -n auto --update_ref 1 --create_ref --keep_files --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/renderer_short + - 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 @@ -1378,51 +1422,46 @@ ivas-conformance-linux: - cp -r scripts/trajectories testvec - cp -r scripts/binauralRenderer_interface/binaural_renderers_hrtf_data testvec/binauralRenderer_interface - 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/renderer_short/ref testvec/testv/renderer_short/ref + - cp -r tests/split_rendering/ref 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 @@ -1431,25 +1470,26 @@ 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 stage: compare resource_group: ivas-long-self-test-resource timeout: "50 minutes" + tags: + - ivas-linux-fast rules: - if: $CI_PIPELINE_SOURCE == 'web' && $MANUAL_PIPELINE_TYPE == 'test-long-self-test' allow_failure: @@ -1501,7 +1541,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 @@ -1950,7 +1989,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: @@ -2163,10 +2201,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 @@ -2174,53 +2210,135 @@ 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 + - .test-job-linux-needs-testv-dir + 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/CMakeLists.txt b/CMakeLists.txt index fe516c9ec8bd55971abf1ff8c1c8b954f5646a9f..bae6fa624ebf843f67e5bad98d09961d4465519c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -165,7 +165,7 @@ file(GLOB libDecSrcs "lib_dec/*.c") file(GLOB libDecHeaders "lib_dec/*.h") add_library(lib_dec ${libDecSrcs} ${libDecHeaders}) target_link_libraries(lib_dec lib_com lib_rend lib_debug lib_isar) -target_include_directories(lib_dec PUBLIC lib_dec lib_rend PRIVATE lib_enc lib_isar) +target_include_directories(lib_dec PUBLIC lib_dec lib_rend PRIVATE lib_enc lib_isar lib_util) file(GLOB libUtilSrcs "lib_util/*.c") file(GLOB libUtilHeaders "lib_util/*.h") diff --git a/Makefile b/Makefile index c72aaacd8dbf36dbf8bc00552745d666a442b100..48c102c6ab77c320ca893b47c94ade5998c41580 100644 --- a/Makefile +++ b/Makefile @@ -71,6 +71,9 @@ LDLIBS += -lm # Clang sanitizer compiler options CCCLANG = clang +ifeq "$(CLANG)" "0" +CC = $(CCCLANG) +endif ifeq "$(CLANG)" "1" CC = $(CCCLANG) CFLAGS += -fsanitize=memory diff --git a/Workspace_msvc/lib_dec.vcxproj b/Workspace_msvc/lib_dec.vcxproj index 3c7ea3e597de37d9377fc8ad745a158d37ca713c..5f60decb0897b11ebf8cc0f4c70413da41322f0e 100644 --- a/Workspace_msvc/lib_dec.vcxproj +++ b/Workspace_msvc/lib_dec.vcxproj @@ -68,7 +68,7 @@ Disabled - ..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;..\lib_isar;..\lib_rend;..\lib_lc3plus;%(AdditionalIncludeDirectories) + ..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;..\lib_isar;..\lib_rend;..\lib_lc3plus;..\lib_util;%(AdditionalIncludeDirectories) _CRT_SECURE_NO_WARNINGS;$(Macros);WIN32;%(PreprocessorDefinitions) EnableFastChecks @@ -109,7 +109,7 @@ Neither false false - ..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;..\lib_isar;..\lib_rend;..\lib_lc3plus;%(AdditionalIncludeDirectories) + ..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;..\lib_isar;..\lib_rend;..\lib_lc3plus;..\lib_util;%(AdditionalIncludeDirectories) _CRT_SECURE_NO_WARNINGS;$(Macros);WIN32;%(PreprocessorDefinitions) true diff --git a/Workspace_msvc/lib_isar.vcxproj b/Workspace_msvc/lib_isar.vcxproj index fceeb731ced2445a5434805d422d30654718782a..5bee827041dc1972467edee3601f784b4573bba5 100644 --- a/Workspace_msvc/lib_isar.vcxproj +++ b/Workspace_msvc/lib_isar.vcxproj @@ -197,4 +197,4 @@ - + \ No newline at end of file diff --git a/Workspace_msvc/lib_lc3plus.vcxproj b/Workspace_msvc/lib_lc3plus.vcxproj index 3f1527357ad6c96d8629a85f7ab3937e82fb3bb0..7b434ae10a13c7d2fe1385b28d941bb484f63b75 100644 --- a/Workspace_msvc/lib_lc3plus.vcxproj +++ b/Workspace_msvc/lib_lc3plus.vcxproj @@ -107,6 +107,7 @@ + diff --git a/Workspace_msvc/lib_rend.vcxproj b/Workspace_msvc/lib_rend.vcxproj index 854c99a979e4ae274d9c002b2ca6686a96e75870..1d55ed1942020a6c9b8e85bb05eb8bcd93cdd398 100644 --- a/Workspace_msvc/lib_rend.vcxproj +++ b/Workspace_msvc/lib_rend.vcxproj @@ -138,6 +138,7 @@ + diff --git a/Workspace_msvc/lib_rend.vcxproj.filters b/Workspace_msvc/lib_rend.vcxproj.filters index 2d1d7d46c0b86e517f6f5a9a35d3c5a985a4caac..f290958973e373f377ef6d8c71668ec1155027ad 100644 --- a/Workspace_msvc/lib_rend.vcxproj.filters +++ b/Workspace_msvc/lib_rend.vcxproj.filters @@ -119,6 +119,9 @@ rend_c + + rend_c + 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/ambi_converter.c b/apps/ambi_converter.c index affd3cf5a80b4f12b2f5fdd318ec41f51a911d55..ea880d26a95507365b016dcc7910b18e89412a56 100644 --- a/apps/ambi_converter.c +++ b/apps/ambi_converter.c @@ -52,33 +52,34 @@ int main( int argc, char *argv[] ) uint32_t samplingRate; uint32_t samplesInFile; - uint32_t numSamples = L_FRAME48k; + uint32_t numSamples = AMBI_MAX_FRAME_LENGTH; uint32_t numSamplesRead32 = 0; uint32_t numSamplesClipped = 0; int16_t bps; - int16_t samples[L_FRAME48k * AMBI_MAX_CHANNELS]; + int16_t samples[AMBI_MAX_FRAME_LENGTH * AMBI_MAX_CHANNELS]; int16_t order = 0; int16_t numChannels; + const char *name_conventions[6] = { "ACN-SN3D", "ACN-N3D", "FuMa-MaxN", "FuMa-FuMa", "SID-SN3D", "SID-N3D" }; AMBI_FMT in_format, out_format; - float samples_f_in[L_FRAME48k * AMBI_MAX_CHANNELS]; - float samples_f_out[L_FRAME48k * AMBI_MAX_CHANNELS]; + float samples_f_in[AMBI_MAX_FRAME_LENGTH * AMBI_MAX_CHANNELS]; + float samples_f_out[AMBI_MAX_FRAME_LENGTH * AMBI_MAX_CHANNELS]; float *in[AMBI_MAX_CHANNELS], *out[AMBI_MAX_CHANNELS]; for ( int16_t j = 0; j < AMBI_MAX_CHANNELS; j++ ) { - in[j] = &samples_f_in[j * L_FRAME48k]; - out[j] = &samples_f_out[j * L_FRAME48k]; + in[j] = &samples_f_in[j * AMBI_MAX_FRAME_LENGTH]; + out[j] = &samples_f_out[j * AMBI_MAX_FRAME_LENGTH]; } + printf( "Ambisonics converter program\n" ); if ( argc != 5 ) { - printf( "Ambisonics converter program\n" ); printf( "----------------------------------------------------------------------------------\n" ); printf( "Usage:\n" ); - printf( "./ambi_conveter input_file output_file input_convention output_convention\n" ); + printf( "./ambi_converter input_file output_file input_convention output_convention\n" ); printf( "\n" ); printf( "input_convention and output convention must be an integer number in [0,5]\n" ); printf( "the following conventions are supported:\n" ); @@ -97,8 +98,12 @@ int main( int argc, char *argv[] ) fileName_out = argv[2]; in_format = atoi( argv[3] ); out_format = atoi( argv[4] ); - - printf( "In %d, Out: %d\n", in_format, out_format ); + if ( in_format < 0 || out_format < 0 || in_format > 5 || out_format > 5 ) + { + printf( "input_convention and output convention must be an integer number in [0,5]\n" ); + return -1; + } + printf( "In: [%s], Out: [%s]\n", name_conventions[in_format], name_conventions[out_format] ); wavFile_in = OpenWav( fileName_in, &samplingRate, &numChannels, &samplesInFile, &bps ); if ( !wavFile_in ) @@ -117,6 +122,7 @@ int main( int argc, char *argv[] ) order = (int16_t) sqrtf( numChannels ) - 1; assert( order > 0 && order <= 3 ); + numSamples = ( samplingRate * 20 * numChannels ) / 1000; /* 20ms worth of samples */ while ( ReadWavShort( wavFile_in, samples, numSamples, &numSamplesRead32 ) == __TWI_SUCCESS ) { int32_t err = 0; @@ -126,7 +132,7 @@ int main( int argc, char *argv[] ) break; } - for ( uint16_t i = 0; i < numSamplesRead32; i++ ) + for ( uint16_t i = 0; i < (uint16_t) numSamplesRead32 / numChannels; i++ ) { for ( int16_t j = 0; j < numChannels; j++ ) { @@ -134,14 +140,14 @@ int main( int argc, char *argv[] ) } } - if ( ( err = convert_ambi_format( in, out, order, in_format, out_format ) ) != 0 ) + if ( ( err = convert_ambi_format( in, out, order, in_format, out_format, ( const uint16_t )( numSamples / numChannels ) ) ) != 0 ) { printf( "Error converting the input signal!\n" ); return err; } - for ( uint16_t i = 0; i < numSamplesRead32; i++ ) + for ( uint16_t i = 0; i < (uint16_t) numSamplesRead32 / numChannels; i++ ) { for ( int16_t j = 0; j < numChannels; j++ ) { diff --git a/apps/decoder.c b/apps/decoder.c index 4a28b4470b7c26a1673b05209a6c3d834a0882df..6f7b929cd2eccb2451bb5b6146cfcd531a8a14ba 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" @@ -56,7 +59,13 @@ #include "debug.h" #endif #include "wmc_auto.h" +#ifdef FLP_EXCEPTION_TRAP +#include "flp_debug.h" +#endif +#ifdef FIXED_RTP_SEQUENCE_NUM +#define RANDOM_INITSEED_DEC ( 0xFEEDFADE ) +#endif #define WMC_TOOL_SKIP @@ -126,8 +135,12 @@ typedef struct IVAS_DEC_COMPLEXITY_LEVEL complexityLevel; bool tsmEnabled; IVAS_RENDER_FRAMESIZE renderFramesize; +#ifdef IVAS_RTPDUMP + bool applyPiData; + char *piOutputFilename; + bool rtpOutSR; +#endif #ifdef DEBUGGING - IVAS_DEC_FORCED_REND_MODE forcedRendMode; #ifdef DEBUG_FOA_AGC FILE *agcBitstream; /* temporary */ #endif @@ -150,7 +163,7 @@ typedef struct hrtfFileReader *hrtfReader; char *hrtfFileName; - IVAS_DEC_HRTF_HANDLE *hHrtfTD; + IVAS_DEC_HRTF_TD_HANDLE *hHrtfTD; IVAS_DEC_HRTF_STATISTICS_HANDLE *hHrtfStatistics; @@ -171,12 +184,15 @@ typedef struct static bool parseCmdlIVAS_dec( int16_t argc, char **argv, DecArguments *arg ); static void usage_dec( void ); static ivas_error decodeG192( DecArguments arg, BS_READER_HANDLE hBsReader, IVAS_DEC_HRTF_BINARY_WRAPPER *hHrtf, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, ObjectEditFileReader *objectEditFileReader, ISAR_SPLIT_REND_BITS_DATA *splitRendBits, IVAS_DEC_HANDLE hIvasDec, int16_t *pcmBuf ); +#ifdef FIX_1119_SPLIT_RENDERING_VOIP +static ivas_error decodeVoIP( DecArguments arg, BS_READER_HANDLE hBsReader, IVAS_DEC_HRTF_BINARY_WRAPPER *hHrtf, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, ObjectEditFileReader *objectEditFileReader, ISAR_SPLIT_REND_BITS_DATA *splitRendBits, IVAS_DEC_HANDLE hIvasDec, int16_t *pcmBuf ); +#else static ivas_error decodeVoIP( DecArguments arg, BS_READER_HANDLE hBsReader, IVAS_DEC_HRTF_BINARY_WRAPPER *hHrtf, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, ObjectEditFileReader *objectEditFileReader, IVAS_DEC_HANDLE hIvasDec, int16_t *pcmBuf ); +#endif static ivas_error load_hrtf_from_file( IVAS_DEC_HRTF_BINARY_WRAPPER *hHrtfBinary, IVAS_DEC_HANDLE hIvasDec, const IVAS_AUDIO_CONFIG OutputConfig, const int32_t output_Fs ); #ifdef DEBUGGING static ivas_error printBitstreamInfoVoip( DecArguments arg, BS_READER_HANDLE hBsReader, IVAS_DEC_HANDLE hIvasDec ); static int16_t app_own_random( int16_t *seed ); -static IVAS_DEC_FORCED_REND_MODE parseForcedRendModeDec( char *forcedRendModeChar ); #endif static void do_object_editing( IVAS_EDITABLE_PARAMETERS *editableParameters, ObjectEditFileReader *objectEditFileReader ); @@ -225,6 +241,9 @@ int main( reset_wmops(); reset_mem( USE_BYTES ); #endif +#ifdef FLP_EXCEPTION_TRAP + enable_float_exception_trap( FLE_MASK_DENORM | FLE_MASK_UNDERFLOW ); +#endif hHrtfBinary.hHrtfTD = NULL; /* just to avoid compilation warning */ hHrtfBinary.hHrtfStatistics = NULL; /* just to avoid compilation warning */ @@ -433,6 +452,9 @@ int main( asked_frame_size = arg.renderFramesize; uint16_t aeID = arg.aeSequence.count > 0 ? arg.aeSequence.pID[0] : 65535; +#ifdef IVAS_RTPDUMP + arg.enableHeadRotation = arg.enableHeadRotation || arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM; +#endif if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputConfig, arg.renderFramesize, arg.customLsOutputEnabled, arg.hrtfReaderEnabled, arg.enableHeadRotation, arg.enableExternalOrientation, arg.orientation_tracking, arg.renderConfigEnabled, arg.non_diegetic_pan_enabled, arg.non_diegetic_pan_gain, arg.dpidEnabled, aeID, arg.objEditEnabled, arg.delayCompensationEnabled ) ) != IVAS_ERR_OK ) @@ -471,7 +493,9 @@ int main( goto cleanup; } +#ifndef IVAS_RTPDUMP arg.enableHeadRotation = true; +#endif } /*------------------------------------------------------------------------------------------* @@ -533,28 +557,6 @@ int main( #endif } - /*------------------------------------------------------------------------------------------* - * Binaural rendering mode: set and print info - *------------------------------------------------------------------------------------------*/ - - if ( arg.forcedRendMode != IVAS_DEC_FORCE_REND_UNFORCED ) - { - if ( ( error = IVAS_DEC_SetForcedRendMode( hIvasDec, arg.forcedRendMode ) ) != IVAS_ERR_OK ) - { - fprintf( stderr, "\nError: Forcing binaural rendering mode failed (only TDREND and CLDFBREND are expected).\n\n" ); - goto cleanup; - } - - if ( arg.forcedRendMode == IVAS_DEC_FORCE_REND_TD_RENDERER ) - { - fprintf( stdout, "Forcing rendering to: TD renderer\n" ); - } - else if ( arg.forcedRendMode == IVAS_DEC_FORCE_REND_CLDFB_RENDERER ) - { - fprintf( stdout, "Forcing rendering to: CLDFB renderer\n" ); - } - } - /*-----------------------------------------------------------------* * Open Error pattern file for simulation *-----------------------------------------------------------------*/ @@ -752,7 +754,12 @@ 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 error = decodeVoIP( arg, hBsReader, &hHrtfBinary, headRotReader, externalOrientationFileReader, refRotReader, referenceVectorReader, objectEditFileReader, hIvasDec, pcmBuf ); +#endif } else { @@ -957,7 +964,6 @@ static bool parseCmdlIVAS_dec( #ifdef DEBUGGING float ftmp; - arg->forcedRendMode = IVAS_DEC_FORCE_REND_UNFORCED; #ifdef DEBUG_FOA_AGC arg->agcBitstream = NULL; #endif @@ -979,6 +985,11 @@ static bool parseCmdlIVAS_dec( arg->referenceVectorTrajFileName = NULL; arg->enableExternalOrientation = false; arg->externalOrientationTrajFileName = NULL; +#ifdef IVAS_RTPDUMP + arg->applyPiData = false; + arg->piOutputFilename = NULL; + arg->rtpOutSR = false; +#endif #ifdef SUPPORT_JBM_TRACEFILE arg->jbmTraceFilename = NULL; @@ -1065,6 +1076,30 @@ 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++]; + } + else if ( strcmp( argv_to_upper, "-APPLYPIDATA" ) == 0 ) + { + arg->applyPiData = true; + i++; + } + else if ( strcmp( argv_to_upper, "-RTPOUTSR" ) == 0 ) + { + arg->rtpOutSR = true; + i++; + } +#endif #ifdef SUPPORT_JBM_TRACEFILE else if ( strcmp( argv_to_upper, "-TRACEFILE" ) == 0 ) { @@ -1127,17 +1162,6 @@ static bool parseCmdlIVAS_dec( } i += 2; } - else if ( strcmp( argv_to_upper, "-FORCE" ) == 0 ) - { - i++; - if ( i < argc - 3 ) - { - strncpy( argv_to_upper, argv[i], sizeof( argv_to_upper ) - 1 ); - argv_to_upper[sizeof( argv_to_upper ) - 1] = '\0'; - arg->forcedRendMode = parseForcedRendModeDec( argv_to_upper ); - i++; - } - } #ifdef DEBUG_MODE_INFO #ifdef DEBUG_MODE_INFO_TWEAK /* Define additional subfolder for debug info output in ./res */ @@ -1660,10 +1684,21 @@ 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" ); + fprintf( stdout, "-ApplyPiData Apply the PI data found in the rtp packet.\n" ); + fprintf( stdout, "-rtpOutSR : Split Rendering bitstream RTPDump output \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" ); @@ -1766,6 +1801,9 @@ static ivas_error initOnFirstGoodFrame( IsmFileWriter *ismWriters[IVAS_MAX_NUM_OBJECTS], /* o : */ int16_t *pNumOutChannels, /* o : */ uint16_t *pNumObj, /* o : */ +#ifdef IVAS_RTPDUMP + IVAS_RTP *srRtp, /* o : */ +#endif SplitFileReadWrite **splitRendWriter ) { int16_t isSplitRend, isSplitCoded; @@ -1817,6 +1855,14 @@ static ivas_error initOnFirstGoodFrame( ISAR_SPLIT_REND_POSE_CORRECTION_MODE poseCorrection; int16_t splitRendIsarFrameSizeMs; int16_t lc3plusHighRes; +#ifdef FIXED_RTP_SEQUENCE_NUM + /* Ideally ssrc is negotiated via SDP and sequence number is radomized but we + use fixed seed for random num generator for regression based tests. Any realtime + application should implement this initialization seperately */ + srand( RANDOM_INITSEED_DEC ); + uint32_t ssrc = ( (uint32_t) rand() & 0x0000FFFF ) | ( (uint32_t) rand() << 16 ); + uint16_t seqNumInitVal = (uint16_t) ( rand() & 0xFFFF ); +#endif if ( ( error = IVAS_DEC_GetDelay( hIvasDec, delayNumSamples_temp, &delayTimeScale_temp ) ) != IVAS_ERR_OK ) { @@ -1830,7 +1876,45 @@ static ivas_error initOnFirstGoodFrame( return error; } +#ifdef IVAS_RTPDUMP + /* Split Rendering RTPDump Output file */ + if ( arg.rtpOutSR && srRtp != NULL ) + { + FILE *fParamsSR = NULL; + char srParamsFile[FILENAME_MAX], *ext = ".sr.txt"; + strncpy( srParamsFile, arg.outputWavFilename, FILENAME_MAX - sizeof( ext ) ); + strncat( srParamsFile, ext, sizeof( ext ) + 1 ); + + /* Write the Split Rendering Params passed from SDP to srParamsFile */ + fParamsSR = fopen( srParamsFile, "w" ); + if ( NULL != fParamsSR ) + { + fprintf( fParamsSR, "CODEC = %s;\nDOF = %d;\nFRAMESIZE = %d;\nRENDERSIZE = %d;\nLC3PLUS_HIGHRES = %d;\n", + splitRendCodec == ISAR_SPLIT_REND_CODEC_LC3PLUS ? "LC3PLUS" : "LCLD", + poseCorrection, + splitRendCodecFrameSizeMs, + splitRendIsarFrameSizeMs, + lc3plusHighRes ); + fclose( fParamsSR ); + fParamsSR = NULL; + } + + + /* Split Rendering RTPDump Output file */ +#ifdef FIXED_RTP_SEQUENCE_NUM + if ( ( error = IVAS_RTP_WRITER_Init( srRtp, arg.outputWavFilename, 1000 / ( IVAS_NUM_FRAMES_PER_SEC * splitRendCodecFrameSizeMs ), ssrc, seqNumInitVal ) ) != IVAS_ERR_OK ) +#else + if ( ( error = IVAS_RTP_WRITER_Init( srRtp, arg.outputWavFilename, 1000 / ( IVAS_NUM_FRAMES_PER_SEC * splitRendCodecFrameSizeMs ) ) ) != IVAS_ERR_OK ) +#endif + { + fprintf( stderr, "\nError: Can't open SR output bitstream file for RTP output %s \n\n", arg.outputWavFilename ); + return error; + } + } + else if ( isSplitCoded ) +#else if ( isSplitCoded ) +#endif { if ( ( error = split_rend_writer_open( splitRendWriter, arg.outputWavFilename, delayNumSamples_temp[0], delayTimeScale_temp, splitRendCodec, poseCorrection, splitRendCodecFrameSizeMs, splitRendIsarFrameSizeMs, arg.output_Fs, lc3plusHighRes ) ) != IVAS_ERR_OK ) { @@ -1864,6 +1948,74 @@ static ivas_error initOnFirstGoodFrame( } } +#ifdef IVAS_RTPDUMP + if ( !arg.rtpOutSR ) + { + int16_t pcmFrameSize; + if ( ( error = IVAS_DEC_GetOutputBufferSize( hIvasDec, &pcmFrameSize ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nError in IVAS_DEC_GetOutputBufferSize, error code: %d\n", error ); + return error; + } + + /* Write zeros to the output audio buffer */ + int16_t *zeroBuf = calloc( pcmFrameSize, sizeof( int16_t ) ); + if ( zeroBuf == NULL ) + { + fprintf( stdout, "Error: Unable to allocate memory for output buffer.\n" ); + return IVAS_ERR_FAILED_ALLOC; + } + + for ( int16_t i = 0; i < numInitialBadFrames; ++i ) + { +#ifdef FIX_1119_SPLIT_RENDERING_VOIP + if ( isSplitRend ) +#else + if ( *splitRendWriter != NULL ) +#endif + { + ISAR_SPLIT_REND_BITS_DATA splitRendBitsZero; + splitRendBitsZero.bits_buf = NULL; + splitRendBitsZero.bits_read = 0; + splitRendBitsZero.bits_written = 0; + splitRendBitsZero.buf_len = 0; + splitRendBitsZero.codec = ISAR_SPLIT_REND_CODEC_DEFAULT; + splitRendBitsZero.pose_correction = ISAR_SPLIT_REND_POSE_CORRECTION_MODE_NONE; + splitRendBitsZero.codec_frame_size_ms = 0; + splitRendBitsZero.isar_frame_size_ms = 20; + + if ( split_rend_write_bitstream_to_file( *splitRendWriter, splitRendBitsZero.bits_buf, &splitRendBitsZero.bits_read, &splitRendBitsZero.bits_written ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nUnable to write to bitstream file!\n" ); + return error; + } + } + +#ifdef FIX_1119_SPLIT_RENDERING_VOIP + if ( !isSplitCoded ) +#else + else +#endif + { + if ( *pRemainingDelayNumSamples < *numOutSamples ) + { + if ( ( error = AudioFileWriter_write( *ppAfWriter, zeroBuf, *numOutSamples * *pNumOutChannels - ( *pRemainingDelayNumSamples * *pNumOutChannels ) ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nOutput audio file writer error\n" ); + return error; + } + *pRemainingDelayNumSamples = 0; + } + else + { + *pRemainingDelayNumSamples -= *numOutSamples; + } + } + } + + free( zeroBuf ); + } +#else int16_t pcmFrameSize; if ( ( error = IVAS_DEC_GetOutputBufferSize( hIvasDec, &pcmFrameSize ) ) != IVAS_ERR_OK ) { @@ -1881,7 +2033,11 @@ static ivas_error initOnFirstGoodFrame( for ( int16_t i = 0; i < numInitialBadFrames; ++i ) { +#ifdef FIX_1119_SPLIT_RENDERING_VOIP + if ( isSplitRend ) +#else if ( *splitRendWriter != NULL ) +#endif { ISAR_SPLIT_REND_BITS_DATA splitRendBitsZero; splitRendBitsZero.bits_buf = NULL; @@ -1899,7 +2055,12 @@ static ivas_error initOnFirstGoodFrame( return error; } } + +#ifdef FIX_1119_SPLIT_RENDERING_VOIP + if ( !isSplitCoded ) +#else else +#endif { if ( *pRemainingDelayNumSamples < *numOutSamples ) { @@ -1919,6 +2080,8 @@ static ivas_error initOnFirstGoodFrame( free( zeroBuf ); +#endif + /* Open other output files if EXT output config - now details about ISM or MASA are known */ if ( arg.outputConfig == IVAS_AUDIO_CONFIG_EXTERNAL ) { @@ -2011,7 +2174,11 @@ static ivas_error initOnFirstGoodFrame( } } +#ifdef IVAS_RTPDUMP + if ( arg.rtpOutSR || *splitRendWriter != NULL ) +#else if ( *splitRendWriter != NULL ) +#endif { if ( numOutSamples == NULL || vec_pos_len == NULL ) { @@ -2106,6 +2273,14 @@ static ivas_error decodeG192( return error; } +#ifdef FIX_1119_SPLIT_RENDERING_VOIP + if ( !isSplitRend ) + { + /* Ensure split rendering output struct is not used when not outputting to a split rendering output configuration */ + splitRendBits = NULL; + } +#endif + if ( ( error = IVAS_DEC_is_split_rendering_coded_out( hIvasDec, &isSplitCoded ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError in IVAS_DEC_is_split_rendering_coded_out, code: %d\n", error ); @@ -2441,7 +2616,11 @@ static ivas_error decodeG192( } /* decode transport channels, do TSM and feed to renderer */ +#ifdef FIX_1119_SPLIT_RENDERING_VOIP + if ( ( error = IVAS_DEC_GetSamplesDecoder( hIvasDec, splitRendBits ) ) != IVAS_ERR_OK ) +#else if ( ( error = IVAS_DEC_GetSamplesDecoder( hIvasDec, isSplitRend, splitRendBits ) ) != IVAS_ERR_OK ) +#endif { return error; } @@ -2543,7 +2722,11 @@ static ivas_error decodeG192( /* Once good frame decoded, catch up */ if ( decodedGoodFrame ) { +#ifdef IVAS_RTPDUMP + if ( ( error = initOnFirstGoodFrame( hIvasDec, arg, numInitialBadFrames, &nOutSamples, &vec_pos_len, delayNumSamples_orig, &delayNumSamples, &delayTimeScale, &bsFormat, &afWriter, &masaWriter, ismWriters, &nOutChannels, &numObj, NULL, &splitRendWriter ) ) != IVAS_ERR_OK ) +#else if ( ( error = initOnFirstGoodFrame( hIvasDec, arg, numInitialBadFrames, &nOutSamples, &vec_pos_len, delayNumSamples_orig, &delayNumSamples, &delayTimeScale, &bsFormat, &afWriter, &masaWriter, ismWriters, &nOutChannels, &numObj, &splitRendWriter ) ) != IVAS_ERR_OK ) +#endif { goto cleanup; } @@ -2882,24 +3065,44 @@ 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 +#ifdef RTP_S4_251135_CR26253_0016_REV1 + if ( ( error = IVAS_RTP_READER_Init( &ivasRtp, 0, arg.inputBitstreamFilename, arg.piOutputFilename, arg.outputConfig == IVAS_AUDIO_CONFIG_EXTERNAL, arg.outputWavFilename ) ) != IVAS_ERR_OK ) +#else + if ( ( error = IVAS_RTP_READER_Init( &ivasRtp, arg.inputBitstreamFilename, arg.piOutputFilename, arg.outputConfig == IVAS_AUDIO_CONFIG_EXTERNAL, arg.outputWavFilename ) ) != IVAS_ERR_OK ) +#endif + { + fprintf( stderr, "error in IVAS_RTP_READER_Init(): %d\n", error ); + goto cleanup; + } +#else f_rtpstream = fopen( arg.inputBitstreamFilename, "r" ); if ( f_rtpstream == NULL ) @@ -2914,6 +3117,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; @@ -2934,12 +3138,24 @@ static ivas_error printBitstreamInfoVoip( else { auPtr = au; /* might have been set to RTP packet in prev call */ +#ifdef IVAS_RTPDUMP +#ifdef RTP_S4_251135_CR26253_0016_REV1 + error = IVAS_RTP_ReadNextFrame( &ivasRtp, auPtr, &auSizeBits, &rtpTimeStamp, &rtpSequenceNumber, &nextPacketRcvTime_ms, NULL, &qBit ); +#else + error = IVAS_RTP_ReadNextFrame( &ivasRtp, auPtr, &auSizeBits, &rtpTimeStamp, &rtpSequenceNumber, &nextPacketRcvTime_ms, &qBit ); +#endif +#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; @@ -2958,7 +3174,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 ) { @@ -2992,6 +3212,9 @@ static ivas_error decodeVoIP( RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, ObjectEditFileReader *objectEditFileReader, +#ifdef FIX_1119_SPLIT_RENDERING_VOIP + ISAR_SPLIT_REND_BITS_DATA *splitRendBits, +#endif IVAS_DEC_HANDLE hIvasDec, int16_t *pcmBuf ) { @@ -3024,12 +3247,21 @@ static ivas_error decodeVoIP( int16_t delayNumSamples = -1; int32_t delayTimeScale = -1; int16_t i; +#ifdef IVAS_RTPDUMP + IVAS_RTP ivasRtp = { 0 }; + IVAS_RTP srRtp = { 0 }; + IVAS_RTP_SR_INFO srInfo = { true, false, 0, IVAS_SR_TRANSPORT_LCLD }; + int32_t initialTsOffsetSystemAndRTP = 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; @@ -3043,6 +3275,29 @@ static ivas_error decodeVoIP( bool parametersAvailableForEditing = false; uint16_t nSamplesRendered = 0; +#ifdef FIX_1119_SPLIT_RENDERING_VOIP + SplitFileReadWrite *splitRendWriter = NULL; + int16_t isSplitRend, isSplitCoded; + + if ( ( error = IVAS_DEC_is_split_rendering_enabled( hIvasDec, &isSplitRend ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nError in IVAS_DEC_is_split_rendering_enabled, code: %d\n", error ); + return error; + } + + if ( !isSplitRend ) + { + /* Ensure split rendering output struct is not used when not outputting to a split rendering format */ + splitRendBits = NULL; + } + + if ( ( error = IVAS_DEC_is_split_rendering_coded_out( hIvasDec, &isSplitCoded ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nError in IVAS_DEC_is_split_rendering_coded_out, code: %d\n", error ); + return error; + } +#endif + vec_pos_update = 0; if ( ( error = IVAS_DEC_GetRenderFramesizeMs( hIvasDec, &systemTimeInc_ms ) ) != IVAS_ERR_OK ) { @@ -3067,11 +3322,24 @@ 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 +#ifdef RTP_S4_251135_CR26253_0016_REV1 + if ( ( error = IVAS_RTP_READER_Init( &ivasRtp, 0, arg.inputBitstreamFilename, arg.piOutputFilename, arg.outputConfig == IVAS_AUDIO_CONFIG_EXTERNAL, arg.outputWavFilename ) ) != IVAS_ERR_OK ) +#else + if ( ( error = IVAS_RTP_READER_Init( &ivasRtp, arg.inputBitstreamFilename, arg.piOutputFilename, arg.outputConfig == IVAS_AUDIO_CONFIG_EXTERNAL, arg.outputWavFilename ) ) != IVAS_ERR_OK ) +#endif + { + fprintf( stderr, "error in IVAS_RTP_READER_Init(): %d\n", error ); + goto cleanup; + } +#else f_rtpstream = fopen( arg.inputBitstreamFilename, "r" ); if ( f_rtpstream == NULL ) @@ -3086,6 +3354,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; @@ -3127,12 +3396,25 @@ static ivas_error decodeVoIP( else { auPtr = au; /* might have been set to RTP packet in prev call */ +#ifdef IVAS_RTPDUMP +#ifdef RTP_S4_251135_CR26253_0016_REV1 + error = IVAS_RTP_ReadNextFrame( &ivasRtp, auPtr, &auSize, &rtpTimeStamp, &rtpSequenceNumber, &nextPacketRcvTime_ms, NULL, &qBit ); +#else + error = IVAS_RTP_ReadNextFrame( &ivasRtp, auPtr, &auSize, &rtpTimeStamp, &rtpSequenceNumber, &nextPacketRcvTime_ms, &qBit ); +#endif + initialTsOffsetSystemAndRTP = rtpTimeStamp - systemTime_ms * 16; /* For time mapping */ +#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; @@ -3302,19 +3584,38 @@ static ivas_error decodeVoIP( else { auPtr = au; /* might have been set to RTP packet in prev call */ +#ifdef IVAS_RTPDUMP +#ifdef RTP_S4_251135_CR26253_0016_REV1 + error = IVAS_RTP_ReadNextFrame( &ivasRtp, au, &auSize, &rtpTimeStamp, &rtpSequenceNumber, &nextPacketRcvTime_ms, NULL, &qBit ); +#else + error = IVAS_RTP_ReadNextFrame( &ivasRtp, au, &auSize, &rtpTimeStamp, &rtpSequenceNumber, &nextPacketRcvTime_ms, &qBit ); +#endif + + /* 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; @@ -3333,15 +3634,56 @@ static ivas_error decodeVoIP( /* decode and get samples */ while ( nSamplesRendered < nOutSamples ) { +#ifdef IVAS_RTPDUMP + if ( arg.applyPiData ) + { + /* Rudimentry Time Mapping to map system time to rtp timestamp */ + uint32_t piTs = systemTime_ms * 16 + initialTsOffsetSystemAndRTP; + uint32_t numPiData = 0; + + while ( ivasRtp.nProcPiData + numPiData < ivasRtp.nReadPiData && + ivasRtp.piData[ivasRtp.nProcPiData + numPiData].timestamp <= piTs ) + { + numPiData++; + } + + if ( ( error = IVAS_RTP_FeedPiDataToDecoder( hIvasDec, &ivasRtp.piData[ivasRtp.nProcPiData], numPiData ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nError in IVAS_DEC_VoIP_GetSamples: %s\n", IVAS_DEC_GetErrorMessage( error ) ); + goto cleanup; + } + + ivasRtp.nProcPiData += numPiData; + } +#endif +#ifdef FIX_1119_SPLIT_RENDERING_VOIP + if ( isSplitRend ) + { #ifdef SUPPORT_JBM_TRACEFILE - if ( ( error = IVAS_DEC_VoIP_GetSamples( hIvasDec, nOutSamples, IVAS_DEC_PCM_INT16, (void *) pcmBuf, writeJbmTraceFileFrameWrapper, jbmTraceWriter, &bitstreamReadDone, &nSamplesRendered, ¶metersAvailableForEditing, systemTime_ms ) ) != IVAS_ERR_OK ) + if ( ( error = IVAS_DEC_VoIP_GetSplitBinauralBitstream( hIvasDec, (void *) pcmBuf, splitRendBits, writeJbmTraceFileFrameWrapper, jbmTraceWriter, &bitstreamReadDone, &nSamplesRendered, ¶metersAvailableForEditing, systemTime_ms ) ) != IVAS_ERR_OK ) #else - if ( ( error = IVAS_DEC_VoIP_GetSamples( hIvasDec, nOutSamples, IVAS_DEC_PCM_INT16, (void *) pcmBuf, &bitstreamReadDone, &nSamplesRendered, ¶meterAvailableForEditing, systemTime_ms ) ) != IVAS_ERR_OK ) + if ( ( error = IVAS_DEC_VoIP_GetSplitBinauralBitstream( hIvasDec, (void *) pcmBuf, splitRendBits, &bitstreamReadDone, &nSamplesRendered, ¶metersAvailableForEditing, systemTime_ms ) ) != IVAS_ERR_OK ) #endif + { + fprintf( stderr, "\nError in IVAS_DEC_VoIP_GetSplitBinauralBitstream: %s\n", IVAS_DEC_GetErrorMessage( error ) ); + goto cleanup; + } + } + else { - fprintf( stderr, "\nError in IVAS_DEC_VoIP_GetSamples: %s\n", IVAS_DEC_GetErrorMessage( error ) ); - goto cleanup; +#endif +#ifdef SUPPORT_JBM_TRACEFILE + if ( ( error = IVAS_DEC_VoIP_GetSamples( hIvasDec, nOutSamples, IVAS_DEC_PCM_INT16, (void *) pcmBuf, writeJbmTraceFileFrameWrapper, jbmTraceWriter, &bitstreamReadDone, &nSamplesRendered, ¶metersAvailableForEditing, systemTime_ms ) ) != IVAS_ERR_OK ) +#else + if ( ( error = IVAS_DEC_VoIP_GetSamples( hIvasDec, nOutSamples, IVAS_DEC_PCM_INT16, (void *) pcmBuf, &bitstreamReadDone, &nSamplesRendered, ¶meterAvailableForEditing, systemTime_ms ) ) != IVAS_ERR_OK ) +#endif + { + fprintf( stderr, "\nError in IVAS_DEC_VoIP_GetSamples: %s\n", IVAS_DEC_GetErrorMessage( error ) ); + goto cleanup; + } +#ifdef FIX_1119_SPLIT_RENDERING_VOIP } +#endif if ( bitstreamReadDone == true ) { @@ -3421,10 +3763,20 @@ static ivas_error decodeVoIP( /* Once good frame decoded, catch up */ if ( decodedGoodFrame ) { +#ifndef FIX_1119_SPLIT_RENDERING_VOIP SplitFileReadWrite *splitRendWriter = NULL; +#endif +#ifdef FIX_1119_SPLIT_RENDERING_VOIP + if ( ( error = initOnFirstGoodFrame( hIvasDec, arg, numInitialBadFrames, &nOutSamples, &vec_pos_len, delayNumSamples_orig, &delayNumSamples, &delayTimeScale, +#else if ( ( error = initOnFirstGoodFrame( hIvasDec, arg, numInitialBadFrames, &nOutSamples, NULL, delayNumSamples_orig, &delayNumSamples, &delayTimeScale, +#endif +#ifdef IVAS_RTPDUMP + &bsFormat, &afWriter, &masaWriter, ismWriters, &nOutChannels, &numObj, &srRtp, &splitRendWriter ) ) != IVAS_ERR_OK ) +#else &bsFormat, &afWriter, &masaWriter, ismWriters, &nOutChannels, &numObj, &splitRendWriter ) ) != IVAS_ERR_OK ) +#endif { fprintf( stderr, "Error in initOnFirstGoodFrame(): %s\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; @@ -3437,21 +3789,41 @@ static ivas_error decodeVoIP( } /* Write current frame */ +#ifdef IVAS_RTPDUMP + if ( !srRtp.hPack && decodedGoodFrame ) +#else if ( decodedGoodFrame ) +#endif { - if ( delayNumSamples < nOutSamples ) +#ifdef FIX_1119_SPLIT_RENDERING_VOIP + if ( isSplitRend ) { - if ( ( error = AudioFileWriter_write( afWriter, &pcmBuf[delayNumSamples * nOutChannels], nOutSamples * nOutChannels - ( delayNumSamples * nOutChannels ) ) ) != IVAS_ERR_OK ) + if ( split_rend_write_bitstream_to_file( splitRendWriter, splitRendBits->bits_buf, &splitRendBits->bits_read, &splitRendBits->bits_written ) != IVAS_ERR_OK ) { - fprintf( stderr, "\nOutput audio file writer error\n" ); + fprintf( stderr, "\nUnable to write to bitstream file!\n" ); goto cleanup; } - delayNumSamples = 0; } - else + + if ( !isSplitCoded ) { - delayNumSamples -= nOutSamples; +#endif + if ( delayNumSamples < nOutSamples ) + { + if ( ( error = AudioFileWriter_write( afWriter, &pcmBuf[delayNumSamples * nOutChannels], nOutSamples * nOutChannels - ( delayNumSamples * nOutChannels ) ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nOutput audio file writer error\n" ); + goto cleanup; + } + delayNumSamples = 0; + } + else + { + delayNumSamples -= nOutSamples; + } +#ifdef FIX_1119_SPLIT_RENDERING_VOIP } +#endif /* Write ISM metadata to external file(s) */ if ( decodedGoodFrame && arg.outputConfig == IVAS_AUDIO_CONFIG_EXTERNAL ) @@ -3506,8 +3878,25 @@ static ivas_error decodeVoIP( goto cleanup; } } + + IVAS_RTP_WriteExtPiData( ivasRtp.f_piExtOut, ivasRtp.piData, ivasRtp.nReadPiData, numObj ); + } + } +#ifdef IVAS_RTPDUMP + else if ( decodedGoodFrame ) + { + srInfo.bitrateKbps = splitRendBits->bits_written * 1000 / splitRendBits->codec_frame_size_ms; + srInfo.codec = ( splitRendBits->codec == ISAR_SPLIT_REND_CODEC_LC3PLUS ) ? IVAS_SR_TRANSPORT_LC3PLUS : IVAS_SR_TRANSPORT_LCLD; + if ( ( error = IVAS_RTP_WriteNextFrame( &srRtp, splitRendBits->bits_buf, &srInfo, (int16_t) splitRendBits->bits_written, false, false ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nError %s while pushing SR audio bitstream to RTP pack\n", ivas_error_to_string( error ) ); + goto cleanup; } + splitRendBits->bits_written = 0; + splitRendBits->bits_read = 0; } +#endif + vec_pos_update = ( vec_pos_update + 1 ) % vec_pos_len; if ( vec_pos_update == 0 ) @@ -3540,7 +3929,11 @@ static ivas_error decodeVoIP( goto cleanup; } +#ifdef FIX_1119_SPLIT_RENDERING_VOIP + if ( nSamplesFlushed && !isSplitCoded ) +#else if ( nSamplesFlushed ) +#endif { /* Write current frame */ if ( ( error = AudioFileWriter_write( afWriter, pcmBuf, nSamplesFlushed * nOutChannels ) ) != IVAS_ERR_OK ) @@ -3602,6 +3995,8 @@ static ivas_error decodeVoIP( goto cleanup; } } + + IVAS_RTP_WriteExtPiData( ivasRtp.f_piExtOut, ivasRtp.piData, ivasRtp.nReadPiData, numObj ); } } @@ -3610,11 +4005,19 @@ static ivas_error decodeVoIP( *------------------------------------------------------------------------------------------*/ memset( pcmBuf, 0, delayNumSamples_orig[0] * nOutChannels * sizeof( int16_t ) ); - if ( ( error = AudioFileWriter_write( afWriter, pcmBuf, delayNumSamples_orig[0] * nOutChannels ) ) != IVAS_ERR_OK ) + +#ifdef FIX_1119_SPLIT_RENDERING_VOIP + if ( afWriter != NULL ) { - fprintf( stderr, "\nError writing output file: %s\n", ivas_error_to_string( error ) ); - goto cleanup; +#endif + if ( ( error = AudioFileWriter_write( afWriter, pcmBuf, delayNumSamples_orig[0] * nOutChannels ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nError writing output file: %s\n", ivas_error_to_string( error ) ); + goto cleanup; + } +#ifdef FIX_1119_SPLIT_RENDERING_VOIP } +#endif /*------------------------------------------------------------------------------------------* * Printouts after decoding has finished @@ -3647,6 +4050,8 @@ static ivas_error decodeVoIP( { fprintf( stdout, "\nOutput MASA metadata file: %s\n", MasaFileWriter_getFilePath( masaWriter ) ); } + + fprintf( stdout, "\nOutput PI data file: %s\n", IVAS_RTP_GetExtPiFilePath( &ivasRtp ) ); } /*------------------------------------------------------------------------------------------* @@ -3657,8 +4062,16 @@ static ivas_error decodeVoIP( cleanup: +#ifdef IVAS_RTPDUMP + IVAS_RTP_Term( &srRtp ); + 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 ); +#endif JbmOffsetFileWriter_close( &jbmOffsetWriter ); #ifdef SUPPORT_JBM_TRACEFILE JbmTraceFileWriter_close( &jbmTraceWriter ); @@ -3789,31 +4202,6 @@ static void do_object_editing( } -#ifdef DEBUGGING - -/*---------------------------------------------------------------------* - * parseForcedRendModeDec() - * - * - *---------------------------------------------------------------------*/ - -static IVAS_DEC_FORCED_REND_MODE parseForcedRendModeDec( - char *forcedRendModeChar ) -{ - if ( ( strcmp( to_upper( forcedRendModeChar ), "TDREND" ) == 0 ) ) - { - return IVAS_DEC_FORCE_REND_TD_RENDERER; - } - if ( ( strcmp( to_upper( forcedRendModeChar ), "CLDFBREND" ) == 0 ) ) - { - return IVAS_DEC_FORCE_REND_CLDFB_RENDERER; - } - - return IVAS_DEC_FORCE_REND_UNDEFINED; -} -#endif - - /*---------------------------------------------------------------------* * load_hrtf_from_file() * diff --git a/apps/encoder.c b/apps/encoder.c index 61bb8ebb3f0d24c4835755b0b69ced48636add72..162ac9a19dfd4e83a2fbbd46d30e81ca78a7f45e 100644 --- a/apps/encoder.c +++ b/apps/encoder.c @@ -15,7 +15,6 @@ the software. This notice grants no license of any kind, including but not limited to patent license, nor is any license granted by implication, estoppel or otherwise. - Contributors are required to enter into the IVAS codec Public Collaboration agreement before making Contributors are required to enter into the IVAS codec Public Collaboration agreement before making contributions. @@ -39,11 +38,21 @@ #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 #include "wmc_auto.h" +#ifdef FLP_EXCEPTION_TRAP +#include "flp_debug.h" +#endif +#ifdef FIXED_RTP_SEQUENCE_NUM +#define RANDOM_INITSEED_ENC ( 0xFEEDDEAF ) +#endif #define WMC_TOOL_SKIP @@ -147,6 +156,12 @@ typedef struct #endif bool pca; bool ism_extended_metadata; +#ifdef IVAS_RTPDUMP + bool rtpdumpOutput; + uint32_t numFramesPerPacket; + char *sceneOrientationTrajFileName; + char *deviceOrientationTrajFileName; +#endif } EncArguments; @@ -190,6 +205,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 @@ -206,6 +225,23 @@ int main( reset_wmops(); reset_mem( USE_BYTES ); #endif +#ifdef FLP_EXCEPTION_TRAP + 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 + +#ifdef FIXED_RTP_SEQUENCE_NUM + /* Ideally ssrc is negotiated via SDP and sequence number is radomized but we + use fixed seed for random num generator for regression based tests. Any realtime + application should implement this initialization seperately */ + srand( RANDOM_INITSEED_ENC ); + uint32_t ssrc = ( (uint32_t) rand() & 0x0000FFFF ) | ( (uint32_t) rand() << 16 ); + uint16_t seqNumInitVal = (uint16_t) ( rand() & 0xFFFF ); +#endif /*------------------------------------------------------------------------------------------* * Parse command-line arguments @@ -235,7 +271,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; @@ -593,6 +633,51 @@ int main( } } +#ifdef IVAS_RTPDUMP + /*------------------------------------------------------------------------------------------* + * RTPDump + *------------------------------------------------------------------------------------------*/ + + if ( arg.rtpdumpOutput ) + { +#ifdef FIXED_RTP_SEQUENCE_NUM + if ( ( error = IVAS_RTP_WRITER_Init( &ivasRtp, arg.outputBitstreamFilename, arg.numFramesPerPacket, ssrc, seqNumInitVal ) ) != IVAS_ERR_OK ) +#else + if ( ( error = IVAS_RTP_WRITER_Init( &ivasRtp, arg.outputBitstreamFilename, arg.numFramesPerPacket ) ) != IVAS_ERR_OK ) +#endif + { + 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; @@ -757,18 +842,82 @@ 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; - /* write bitstream */ - if ( ( error = BS_Writer_WriteFrame_short( hBsWriter, bitStream, numBits, totalBitrate ) ) != IVAS_ERR_OK ) + 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; + } + } + + 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; + } + +#ifdef RTP_S4_251135_CR26253_0016_REV1 + if ( ( error = IVAS_RTP_WriteNextFrame( &ivasRtp, au, NULL, numBits, isMono, forcePacket ) ) != IVAS_ERR_OK ) +#else + if ( ( error = IVAS_RTP_WriteNextFrame( &ivasRtp, au, numBits, isMono, forcePacket ) ) != IVAS_ERR_OK ) +#endif + { + 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 ) @@ -846,6 +995,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 @@ -916,6 +1079,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; @@ -1710,6 +1878,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 *-----------------------------------------------------------------*/ @@ -1721,6 +1954,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 *-----------------------------------------------------------------*/ @@ -1927,6 +2175,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/apps/isar_post_rend.c b/apps/isar_post_rend.c index 2744c3bbe5855eb06393bc3ac5a418cfef302c3e..7d8fd0939fe88432bceb8c600130ad9ba0794c52 100644 --- a/apps/isar_post_rend.c +++ b/apps/isar_post_rend.c @@ -48,6 +48,9 @@ #include "debug.h" #endif #include "wmc_auto.h" +#ifdef RTP_S4_251135_CR26253_0016_REV1 +#include "ivas_rtp_file.h" +#endif #define WMC_TOOL_SKIP @@ -78,6 +81,9 @@ static typedef struct { +#ifdef RTP_S4_251135_CR26253_0016_REV1 + bool srRtp; +#endif IVAS_AUDIO_CONFIG audioConfig; int32_t inputChannelIndex; float gain_dB; @@ -99,6 +105,9 @@ typedef struct char executableName[POST_REND_MAX_CLI_ARG_LENGTH]; char inputFilePath[POST_REND_MAX_CLI_ARG_LENGTH]; char outputFilePath[POST_REND_MAX_CLI_ARG_LENGTH]; +#ifdef RTP_S4_251135_CR26253_0016_REV1 + char srParamsFilePath[POST_REND_MAX_CLI_ARG_LENGTH]; +#endif int32_t sampleRate; InputConfig inConfig; OutputConfig outConfig; @@ -128,6 +137,9 @@ typedef enum CmdLnOptionId_listFormats, CmdLnOptionId_SplitRendBFIFile, CmdLnOptionId_framing, +#ifdef RTP_S4_251135_CR26253_0016_REV1 + CmdLnOptionId_srParamsFile, +#endif } CmdLnOptionId; static const CmdLnParser_Option cliOptions[] = { @@ -203,6 +215,14 @@ static const CmdLnParser_Option cliOptions[] = { .matchShort = "fr", .description = "Set Render audio framing.", }, +#ifdef RTP_S4_251135_CR26253_0016_REV1 + { + .id = CmdLnOptionId_srParamsFile, + .match = "sr_params", + .matchShort = "s", + .description = "Path to the split rendering init params file", + }, +#endif }; @@ -214,7 +234,11 @@ static const int32_t numCliOptions = sizeof( cliOptions ) / sizeof( CmdLnParser_ static void printSupportedAudioConfigs( void ); +#ifdef RTP_S4_251135_CR26253_0016_REV1 +static IVAS_AUDIO_CONFIG parseAudioConfig( const char *configString, bool *srRtp ); +#else static IVAS_AUDIO_CONFIG parseAudioConfig( const char *configString ); +#endif static void convertOutputBuffer( const float *floatBuffer, const int16_t numSamplesPerChannel, const int16_t numChannels, int16_t *intBuffer ); @@ -302,12 +326,20 @@ static bool parseInConfig( } /* Check for single-format inputs. The given string should map to a member of AUDIO_CONFIG enum. */ +#ifdef RTP_S4_251135_CR26253_0016_REV1 + bool srRtp = false; + IVAS_AUDIO_CONFIG audioConfig = parseAudioConfig( inFormatStr, &srRtp ); +#else IVAS_AUDIO_CONFIG audioConfig = parseAudioConfig( inFormatStr ); +#endif switch ( audioConfig ) { case IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED: case IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM: inConfig->numBinBuses = 1; +#ifdef RTP_S4_251135_CR26253_0016_REV1 + inConfig->binBuses[0].srRtp = srRtp; +#endif inConfig->binBuses[0].audioConfig = audioConfig; inConfig->binBuses[0].inputChannelIndex = 0; inConfig->binBuses[0].gain_dB = 0.0f; @@ -358,11 +390,19 @@ static bool parseRenderFramesize( static IVAS_AUDIO_CONFIG parseAudioConfig( +#ifdef RTP_S4_251135_CR26253_0016_REV1 + const char *configString, + bool *srRtp ) +#else const char *configString ) +#endif { char charBuf[25]; charBuf[24] = '\0'; +#ifdef RTP_S4_251135_CR26253_0016_REV1 + *srRtp = false; +#endif strncpy( charBuf, configString, sizeof( charBuf ) - 1 ); charBuf[sizeof( charBuf ) - 1] = '\0'; to_upper( charBuf ); @@ -379,6 +419,13 @@ static IVAS_AUDIO_CONFIG parseAudioConfig( { return IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED; } +#ifdef RTP_S4_251135_CR26253_0016_REV1 + if ( strcmp( charBuf, "RTPDUMP" ) == 0 ) + { + *srRtp = true; + return IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED; + } +#endif return IVAS_AUDIO_CONFIG_INVALID; } @@ -435,6 +482,9 @@ static CmdlnArgs defaultArgs( strncpy( args.executableName, executableName, POST_REND_MAX_CLI_ARG_LENGTH ); clearString( args.inputFilePath ); clearString( args.outputFilePath ); +#ifdef RTP_S4_251135_CR26253_0016_REV1 + clearString( args.srParamsFilePath ); +#endif args.sampleRate = 0; args.outConfig.audioConfig = IVAS_AUDIO_CONFIG_INVALID; @@ -542,6 +592,12 @@ static void parseOption( } break; +#ifdef RTP_S4_251135_CR26253_0016_REV1 + case CmdLnOptionId_srParamsFile: + assert( numOptionValues == 1 ); + strncpy( args->srParamsFilePath, optionValues[0], POST_REND_MAX_CLI_ARG_LENGTH - 1 ); + break; +#endif default: assert( 0 && "This should be unreachable - all command line options should be explicitly handled." ); break; @@ -578,6 +634,9 @@ static void printSupportedAudioConfigs( void ) "BINAURAL (output only)", "BINAURAL_SPLIT_PCM", "BINAURAL_SPLIT_CODED", +#ifdef RTP_S4_251135_CR26253_0016_REV1 + "RTPDUMP", +#endif }; fprintf( stdout, "Supported audio formats:\n" ); @@ -670,6 +729,96 @@ static void convertOutputBuffer( return; } +#ifdef RTP_S4_251135_CR26253_0016_REV1 +static void trim( char *str ) +{ + char c; + int r = 0, w = 0; + while ( ( c = str[r] ) != 0 && ( c == ' ' || c == '\t' || c == ';' ) ) + { + r++; + } + + while ( ( c = str[r] ) != 0 && ( c != ' ' && c != '\t' && c != ';' ) ) + { + str[w++] = c; + r++; + } + str[w] = 0; +} + +static ivas_error parseSRParamsFile( + const char *srParamsFilePath, + ISAR_SPLIT_REND_CODEC *codec, + ISAR_SPLIT_REND_POSE_CORRECTION_MODE *poseCorrection, + int16_t *codec_frame_size_ms, + int16_t *isar_frame_size_ms, + int16_t *lc3plusHighRes ) +{ + FILE *fParamSR = fopen( srParamsFilePath, "r" ); + if ( NULL == fParamSR ) + { + fprintf( stderr, "error in opening srParams File %s)\n", srParamsFilePath ); + return IVAS_ERR_FAILED_FILE_OPEN; + } + + *codec = ISAR_SPLIT_REND_CODEC_NONE; + *poseCorrection = ISAR_SPLIT_REND_POSE_CORRECTION_MODE_NONE; + *codec_frame_size_ms = 5; + *lc3plusHighRes = 0; + + while ( !feof( fParamSR ) ) + { + char key[16], value[16]; + if ( 2 == fscanf( fParamSR, "%15s = %15s", key, value ) ) + { + trim( key ); + trim( value ); + + if ( 0 == strncmp( key, "CODEC", 5 ) ) + { + *codec = ( 0 == strncmp( value, "LCLD", 4 ) ) ? ISAR_SPLIT_REND_CODEC_LCLD : *codec; + *codec = ( 0 == strncmp( value, "LC3PLUS", 7 ) ) ? ISAR_SPLIT_REND_CODEC_LC3PLUS : *codec; + } + else if ( 0 == strncmp( key, "DOF", 3 ) ) + { + int val = atoi( value ); + if ( val == 0 || val == 1 ) + { + *poseCorrection = ( val == 0 ) ? ISAR_SPLIT_REND_POSE_CORRECTION_MODE_NONE : ISAR_SPLIT_REND_POSE_CORRECTION_MODE_CLDFB; + } + } + else if ( 0 == strncmp( key, "FRAMESIZE", 9 ) ) + { + int val = atoi( value ); + if ( val == 5 || val == 10 || val == 20 ) + { + *codec_frame_size_ms = (int16_t) val; + } + } + else if ( 0 == strncmp( key, "RENDERSIZE", 9 ) ) + { + int val = atoi( value ); + if ( val == 5 || val == 10 || val == 20 ) + { + *isar_frame_size_ms = (int16_t) val; + } + } + else if ( 0 == strncmp( key, "LC3PLUS_HIGHRES", 15 ) ) + { + int val = atoi( value ); + if ( val == 0 || val == 1 ) + { + *lc3plusHighRes = (int16_t) val; + } + } + } + } + + fclose( fParamSR ); + return IVAS_ERR_OK; +} +#endif /*------------------------------------------------------------------------------------------* * main() @@ -710,6 +859,9 @@ int main( int16_t i, numChannels; ivas_error error = IVAS_ERR_OK; bool splitBinNeedsNewFrame = true; +#ifdef RTP_S4_251135_CR26253_0016_REV1 + IVAS_RTP srRTP = { 0 }; +#endif #ifdef WMOPS reset_wmops(); @@ -736,6 +888,9 @@ int main( convert_backslash( args.inputFilePath ); convert_backslash( args.outputFilePath ); convert_backslash( args.headRotationFilePath ); +#ifdef RTP_S4_251135_CR26253_0016_REV1 + convert_backslash( args.srParamsFilePath ); +#endif /*------------------------------------------------------------------------------------------* * Open head-rotation file @@ -790,8 +945,34 @@ int main( } } +#ifdef RTP_S4_251135_CR26253_0016_REV1 + if ( ( args.inConfig.numBinBuses > 0 ) && ( args.inConfig.binBuses[0].srRtp ) ) + { + error = parseSRParamsFile( args.srParamsFilePath, + &bitsBuffer.config.codec, + &bitsBuffer.config.poseCorrection, + &bitsBuffer.config.codec_frame_size_ms, + &bitsBuffer.config.isar_frame_size_ms, + &bitsBuffer.config.lc3plusHighRes ); + if ( error != IVAS_ERR_OK ) + { + fprintf( stderr, "\nCould not open split rend params file %s\n", args.srParamsFilePath ); + goto cleanup; + } + + if ( ( error = IVAS_RTP_READER_Init( &srRTP, (uint32_t) bitsBuffer.config.codec_frame_size_ms, args.inputFilePath, NULL, false, NULL ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "error in IVAS_RTP_READER_Init(): %d\n", error ); + goto cleanup; + } + audioReader = NULL; + } + /*if split renderer is running in post renderer mode*/ + else if ( ( args.inConfig.numBinBuses > 0 ) && ( args.inConfig.binBuses[0].audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) ) +#else /*if split renderer is running in post renderer mode*/ if ( ( args.inConfig.numBinBuses > 0 ) && ( args.inConfig.binBuses[0].audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) ) +#endif { error = split_rend_reader_open( &hSplitRendFileReadWrite, args.inputFilePath, @@ -991,7 +1172,53 @@ int main( num_in_channels = inBuffer.config.numChannels; numSamplesRead = 0; +#ifdef RTP_S4_251135_CR26253_0016_REV1 + if ( srRTP.hRtpFile && splitBinNeedsNewFrame ) + { + IVAS_RTP_SR_INFO srInfo = { 0 }; + uint32_t rtpTimeStamp = 0, nextPacketRcvTime_ms = 0; + uint16_t rtpSequenceNumber = 0; + int16_t auSizeBits = 0; + bool qBit = false; + uint8_t *bitBuffer = bitsBuffer.bits; + int16_t frameMS = 0; + + numSamplesRead = (int16_t) inBufferSize; + bitsBuffer.config.bitsRead = 0; + bitsBuffer.config.bitsWritten = 0; + + while ( frameMS < bitsBuffer.config.isar_frame_size_ms ) + { + error = IVAS_RTP_ReadNextFrame( &srRTP, bitBuffer, &auSizeBits, &rtpTimeStamp, &rtpSequenceNumber, &nextPacketRcvTime_ms, &srInfo, &qBit ); + if ( error != IVAS_ERR_OK ) + { + if ( error == IVAS_ERR_END_OF_FILE ) + { + numSamplesRead = 0; + } + else + { + fprintf( stderr, "\nUnable to read from bitstream file!\n" ); + goto cleanup; + } + } + /* Ensure a SR RTP stream was received */ + if ( !srInfo.valid ) + { + fprintf( stderr, "\nNon-SR RTP stream detected !\n" ); + goto cleanup; + } + + bitBuffer += ( auSizeBits + 7 ) / 8; + bitsBuffer.config.bitsWritten += auSizeBits; + bitsBuffer.config.codec = srInfo.codec == IVAS_SR_TRANSPORT_LC3PLUS ? ISAR_SPLIT_REND_CODEC_LC3PLUS : ISAR_SPLIT_REND_CODEC_LCLD; + frameMS += bitsBuffer.config.codec_frame_size_ms; + } + } + else if ( ( hSplitRendFileReadWrite != NULL ) && splitBinNeedsNewFrame ) +#else if ( ( hSplitRendFileReadWrite != NULL ) && splitBinNeedsNewFrame ) +#endif { ivas_error error_tmp; @@ -1104,6 +1331,19 @@ int main( fprintf( stderr, "\nISAR_POST_REND_FeedSplitBinauralBitstream failed: %s\n", ivas_error_to_string( error ) ); goto cleanup; } + +#ifdef FIX_1119_SPLIT_RENDERING_VOIP + /* Set BFI if frame is empty */ + int16_t frameEmpty = (int16_t) ( bitsBuffer.config.bitsWritten == 0 ); + if ( frameEmpty ) + { + if ( ( error = ISAR_POST_REND_SetSplitRendBFI( hIsarPostRend, 1 ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "Error in ISAR_POST_REND_SetSplitRendBFI(): %s\n", ivas_error_to_string( error ) ); + goto cleanup; + } + } +#endif } } diff --git a/apps/renderer.c b/apps/renderer.c index 917a6f3a907f7e7be7fc0f7f63967f723babd166..e434c0ca2a2193c674c2919cf2737efab37db3ed 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -33,6 +33,9 @@ #include "lib_rend.h" #include #include +#ifdef RENDERER_MD_SYNC_DELAY_TO_INTEGER +#include +#endif #include #include "audio_file_reader.h" #include "audio_file_writer.h" @@ -53,6 +56,9 @@ #include "debug.h" #endif #include "wmc_auto.h" +#ifdef FLP_EXCEPTION_TRAP +#include "flp_debug.h" +#endif #define WMC_TOOL_SKIP @@ -186,7 +192,11 @@ typedef struct float lfeConfigElevation; bool lfeCustomRoutingEnabled; char inLfePanningMatrixFile[RENDERER_MAX_CLI_ARG_LENGTH]; +#ifdef RENDERER_MD_SYNC_DELAY_TO_INTEGER + int16_t syncMdDelay; +#else float syncMdDelay; +#endif IVAS_RENDER_FRAMESIZE render_framesize; uint16_t directivityPatternId[RENDERER_MAX_ISM_INPUTS]; AcousticEnvironmentSequence aeSequence; @@ -682,7 +692,7 @@ int main( IVAS_DEC_HRTF_CREND_HANDLE *hHrtfCrend = NULL; IVAS_DEC_HRTF_FASTCONV_HANDLE *hHrtfFastConv = NULL; IVAS_DEC_HRTF_PARAMBIN_HANDLE *hHrtfParambin = NULL; - IVAS_DEC_HRTF_HANDLE *hHrtfTD = NULL; + IVAS_DEC_HRTF_TD_HANDLE *hHrtfTD = NULL; IVAS_DEC_HRTF_STATISTICS_HANDLE *hHrtfStatistics = NULL; IsmPositionProvider *positionProvider = NULL; LfeRoutingConfig *lfeRoutingConfigs[RENDERER_MAX_MC_INPUTS]; @@ -723,6 +733,9 @@ int main( reset_wmops(); reset_mem( USE_BYTES ); #endif +#ifdef FLP_EXCEPTION_TRAP + enable_float_exception_trap( FLE_MASK_DENORM | FLE_MASK_UNDERFLOW ); +#endif for ( i = 0; i < RENDERER_MAX_MASA_INPUTS; ++i ) { @@ -961,9 +974,9 @@ int main( if ( hrtfFileReader != NULL ) { - if ( ( error = IVAS_REND_GetHrtfHandle( hIvasRend, &hHrtfTD ) ) != IVAS_ERR_OK ) + if ( ( error = IVAS_REND_GetHrtfTdHandle( hIvasRend, &hHrtfTD ) ) != IVAS_ERR_OK ) { - fprintf( stderr, "\nIVAS_REND_GetHrtfHandle failed: %s\n\n", ivas_error_to_string( error ) ); + fprintf( stderr, "\nIVAS_REND_GetHrtfTdHandle failed: %s\n\n", ivas_error_to_string( error ) ); goto cleanup; } @@ -1229,7 +1242,11 @@ int main( masaIds[i] = 0u; } - IVAS_REND_SetObjectIDs( hIvasRend ); + if ( ( error = IVAS_REND_SetObjectIDs( hIvasRend ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nIVAS_REND_SetObjectIDs: %s\n", ivas_error_to_string( error ) ); + goto cleanup; + } for ( i = 0; i < args.inConfig.numMultiChannelBuses; ++i ) { @@ -2603,7 +2620,10 @@ static CmdlnArgs defaultArgs( args.outConfig.audioConfig = IVAS_AUDIO_CONFIG_INVALID; args.outConfig.outSetupCustom.num_spk = 0; args.outConfig.outSetupCustom.num_lfe = 0; - args.inConfig.ambisonicsBuses->audioConfig = IVAS_AUDIO_CONFIG_INVALID; + for ( i = 0; i < RENDERER_MAX_SBA_INPUTS; ++i ) + { + args.inConfig.ambisonicsBuses[i].audioConfig = IVAS_AUDIO_CONFIG_INVALID; + } for ( i = 0; i < RENDERER_MAX_ISM_INPUTS + RENDERER_MAX_MASA_INPUTS; ++i ) { @@ -2831,7 +2851,11 @@ static void parseOption( case CmdLnOptionId_syncMdDelay: assert( numOptionValues == 1 ); /* Metadata Delay to sync with audio delay in ms */ +#ifdef RENDERER_MD_SYNC_DELAY_TO_INTEGER + args->syncMdDelay = (int16_t) strtol( optionValues[0], NULL, 10 ); +#else args->syncMdDelay = strtof( optionValues[0], NULL ); +#endif break; default: assert( 0 && "This should be unreachable - all command line options should be explicitly handled." ); diff --git a/ci/create_trajectories.py b/ci/create_trajectories.py index 6b957df0926bdb2f08a43727571d160ea164894a..522a26461d1afe804bc13a67e43f74fc576c8172 100644 --- a/ci/create_trajectories.py +++ b/ci/create_trajectories.py @@ -1,13 +1,15 @@ import numpy as np +from scipy.spatial.transform import Rotation FRAMES_PER_SEC = 50 +MAGIC_VAL_TO_SIGNAL_EULER_ANGLES = -3 def random_trajectory(duration_sec): n_frames = int(FRAMES_PER_SEC * duration_sec) trj = np.random.random((n_frames, 4)) - trj[:, 0] = -3 + trj[:, 0] = MAGIC_VAL_TO_SIGNAL_EULER_ANGLES trj[:, 1] *= 180 trj[:, 2] *= 90 trj[:, 3] *= 180 @@ -17,9 +19,24 @@ def random_trajectory(duration_sec): def constant_trajectory(duration_sec, yaw=0, pitch=0, roll=0): n_frames = int(FRAMES_PER_SEC * duration_sec) trj = np.empty((n_frames, 4)) - trj[:, 0] = -3 + trj[:, 0] = MAGIC_VAL_TO_SIGNAL_EULER_ANGLES trj[:, 1] = yaw trj[:, 2] = pitch trj[:, 3] = roll return trj + +def random_trajectory_quat(duration_sec): + n_frames = int(FRAMES_PER_SEC * duration_sec) + trj = Rotation.random(n_frames).as_quat() + return trj + + +def constant_trajectory_quat(duration_sec, w=1, x=0, y=0, z=0): + n_frames = int(FRAMES_PER_SEC * duration_sec) + trj = np.empty((n_frames, 4)) + trj[:, 0] = w + trj[:, 1] = x + trj[:, 2] = y + trj[:, 3] = z + return trj 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

- + {} diff --git a/ci/run_scheduled_sanitizer_test.py b/ci/run_scheduled_sanitizer_test.py index c2d3f30d1134047c5bf560d00c51140729900844..071270610f8a71048a6dc60acd1020d83f98ba34 100755 --- a/ci/run_scheduled_sanitizer_test.py +++ b/ci/run_scheduled_sanitizer_test.py @@ -1,38 +1,39 @@ #!/usr/bin/env python3 """ - (C) 2022-2025 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB, - Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., - Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, - Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other - contributors to this repository. All Rights Reserved. - - This software is protected by copyright law and by international treaties. - The IVAS codec Public Collaboration consisting of Dolby International AB, Ericsson AB, - Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., - Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, - Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other - contributors to this repository retain full ownership rights in their respective contributions in - the software. This notice grants no license of any kind, including but not limited to patent - license, nor is any license granted by implication, estoppel or otherwise. - - Contributors are required to enter into the IVAS codec Public Collaboration agreement before making - contributions. - - This software is provided "AS IS", without any express or implied warranties. The software is in the - development stage. It is intended exclusively for experts who have experience with such software and - solely for the purpose of inspection. All implied warranties of non-infringement, merchantability - and fitness for a particular purpose are hereby disclaimed and excluded. - - Any dispute, controversy or claim arising under or in relation to providing this software shall be - submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in - accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and - the United Nations Convention on Contracts on the International Sales of Goods. +(C) 2022-2025 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB, +Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., +Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, +Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other +contributors to this repository. All Rights Reserved. + +This software is protected by copyright law and by international treaties. +The IVAS codec Public Collaboration consisting of Dolby International AB, Ericsson AB, +Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., +Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, +Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other +contributors to this repository retain full ownership rights in their respective contributions in +the software. This notice grants no license of any kind, including but not limited to patent +license, nor is any license granted by implication, estoppel or otherwise. + +Contributors are required to enter into the IVAS codec Public Collaboration agreement before making +contributions. + +This software is provided "AS IS", without any express or implied warranties. The software is in the +development stage. It is intended exclusively for experts who have experience with such software and +solely for the purpose of inspection. All implied warranties of non-infringement, merchantability +and fitness for a particular purpose are hereby disclaimed and excluded. + +Any dispute, controversy or claim arising under or in relation to providing this software shall be +submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in +accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and +the United Nations Convention on Contracts on the International Sales of Goods. """ import argparse import pathlib import subprocess import sys +import os import numpy as np import json @@ -43,7 +44,7 @@ from collect_artifacts import ( find_failed_files_for_sanitizer_test, ) from combine_genpatt_and_jbm_profile import combine_error_profiles -from create_trajectories import random_trajectory +from create_trajectories import random_trajectory, random_trajectory_quat SCRIPT_DIR = pathlib.Path("./scripts").resolve() @@ -75,12 +76,17 @@ ARGS_FOR_OC = { "BINAURAL_ROOM_REVERB": BINAURAL_OUT_ARGS, } +SEED_FOR_RANDOM = int(os.environ.get("CI_JOB_ID", 0)) + def main(args): in_format = args.in_format out_formats = args.out_formats tests = args.tests run_fec = not args.skip_fec + seed = SEED_FOR_RANDOM if args.inject_seed is None else args.inject_seed + + np.random.seed(seed) assert all([t in SUPPORTED_TESTS for t in tests]) @@ -92,7 +98,6 @@ def main(args): def get_modes(in_format: str) -> list: - in_format_for_script = in_format if in_format in MC_MODES: in_format_for_script = "MC" @@ -134,7 +139,6 @@ def assemble_oc_dict(out_formats: list): def get_md_file_command(in_format: str) -> list: - cmd = list() if "ISM" in in_format: cmd.append("--ism_metadata_files") @@ -145,8 +149,7 @@ def get_md_file_command(in_format: str) -> list: return cmd -def run_check(in_format: str, out_formats: list, tests: list, run_fec: bool = True): - +def run_check(in_format: str, out_formats: list, tests: list, run_fec: bool): modes = get_modes(in_format) if len(modes) == 0: return 0 @@ -156,10 +159,10 @@ def run_check(in_format: str, out_formats: list, tests: list, run_fec: bool = Tr # create random trajectory files if "BINAURAL" in oc_str: - trajectory_files = [HEAD_TRAJ_FILE, EXOF_TRAJ_FILE] - for tf in trajectory_files: - traj = random_trajectory(int(DURATION)) - np.savetxt(tf, traj, fmt="%.2f", delimiter=",") + traj = random_trajectory(int(DURATION)) + np.savetxt(HEAD_TRAJ_FILE, traj, fmt="%.2f", delimiter=",") + traj_exof = random_trajectory_quat(int(DURATION)) + np.savetxt(EXOF_TRAJ_FILE, traj_exof, fmt="%.2f", delimiter=",") ### always run encoder and decoder with no frameloss cmd_no_fec = [ @@ -187,7 +190,7 @@ def run_check(in_format: str, out_formats: list, tests: list, run_fec: bool = Tr # resue decoder part of StereDmxEVS mode (it is basically a duplicate of "normal" mono run) if in_format == "StereoDmxEVS": panning = np.random.randint(-90, 91) - cmd_no_fec += [f'-D=-non_diegetic_pan {panning}'] + cmd_no_fec += [f"-D=-non_diegetic_pan {panning}"] print( "======== Script command line WITHOUT plc: ========\n{}".format( @@ -277,5 +280,11 @@ if __name__ == "__main__": parser.add_argument("out_formats", type=str, nargs="+") parser.add_argument("--tests", type=str, nargs="+", default=["CLANG1", "CLANG2"]) parser.add_argument("--skip_fec", action="store_true") + parser.add_argument( + "--inject_seed", + type=int, + default=None, + help="Value to use for seeding random generators", + ) sys.exit(main(parser.parse_args())) diff --git a/ci/setup_pages.py b/ci/setup_pages.py index df350d856890d0a1e0b2f4ff69f676e2b7bea442..1a1c1ea7352a07d907aa838a63b777884d29d333 100755 --- a/ci/setup_pages.py +++ b/ci/setup_pages.py @@ -40,7 +40,10 @@ JOBS_FLOAT_REPO = { "complexity-osba-in-binaural_room_ir-out": "OSBA in, BINAURAL_ROOM_IR out", "complexity-StereoDmxEVS-stereo-in-mono-out": "StereoDmxEVS, Stereo in, Mono out", # "timeless" jobs (not complexity) - "coverage-test-on-main-scheduled": "Coverage", + "coverage-test-on-main-scheduled-stv": "Short test vector coverage (~ merge request pipelines)", + "coverage-test-on-main-scheduled-ltv": "Long test vector coverage (for test_param_file.py, test_sba.py and test_renderer.py)", + "ivas-conformance-linux": "Conformance test coverage", + "coverage-merge": "Merged coverage (all of the above combined)", } JOBS_BASOP_REPO = { "ivas-pytest-compare_ref-long-dec": "Pytest decoder compare to ref LTV", @@ -77,6 +80,13 @@ JOBS_FOR_PROJECT_ID = { PROJECT_ID_BASOP_REPO: JOBS_BASOP_REPO, } +ARTIFACT_FOLDER_4_COVERAGE_JOBS = { + "coverage-test-on-main-scheduled-stv": "coverage_stv", + "coverage-test-on-main-scheduled-ltv": "coverage_ltv", + "ivas-conformance-linux": "coverage_conformance", + "coverage-merge": "coverage-merged", +} + ARTIFACTS = "artifacts.zip" API_URL_BASE = "https://forge.3gpp.org/rep/api/v4/projects/{}/jobs" PUBLIC_FOLDER = pathlib.Path("./public").absolute() @@ -104,15 +114,20 @@ def main(): def create_landing_page(jobs, index_html, project_id): # dynamically create the complexity links on the landing page - link_html = list() - link_html = ["
    "] + link_html_complexity = ["
      "] + link_html_coverage = ["
        "] for job, link_text in jobs.items(): if job.startswith("complexity"): line = f'
      • {link_text}
      • ' - link_html.append(line) - link_html.append("
      ") - link_html_text = "\n".join(link_html) + link_html_complexity.append(line) + elif job.startswith("coverage") or job == "ivas-conformance-linux": + artifact_folder = ARTIFACT_FOLDER_4_COVERAGE_JOBS[job] + line = f'
    • {link_text}
    • ' + link_html_coverage.append(line) + + link_html_complexity.append("
    ") + link_html_coverage.append("
") if project_id == PROJECT_ID_FLOAT_REPO: index_template = "index-pages.html" @@ -126,14 +141,18 @@ def create_landing_page(jobs, index_html, project_id): with open(index_pages_tmpl_path) as f: index_pages_tmpl = f.read() - index_pages_tmpl = index_pages_tmpl.format(link_html_text) + link_html_complexity_text = "\n".join(link_html_complexity) + link_html_coverage_text = "\n".join(link_html_coverage) + index_pages_tmpl = index_pages_tmpl.format( + link_html_complexity_text, link_html_coverage_text + ) with open(index_html, "w") as f: f.write(index_pages_tmpl) def get_artifacts_for_jobs_and_return_num_failed( - jobs: list, project_id: int, success_only: bool + jobs: dict, project_id: int, success_only: bool ) -> int: """ Get specified artifact folders for all jobs given and put them into the public folder. diff --git a/ivas_be_conf_test_gen.sh b/ivas_be_conf_test_gen.sh new file mode 100644 index 0000000000000000000000000000000000000000..db23621c4a7060e471fde05dc10531b34ea443d1 --- /dev/null +++ b/ivas_be_conf_test_gen.sh @@ -0,0 +1,46 @@ +#! /bin/sh + +set -e + +make -f Makefile clean +make -f Makefile -j"$(nproc)" CLANG=0 +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 +python3 scripts/prepare_combined_format_inputs.py +python3 -m pytest -q tests/codec_be_on_mr_nonselection tests/renderer_short/test_renderer.py tests/split_rendering/test_split_rendering.py -v -n auto --update_ref 1 --create_ref --keep_files --html=report_cmd.html --self-contained-html +python3 scripts/parse_commands.py report_cmd.html Readme_IVAS.txt +rm -rf testvec +mkdir testvec +mkdir testvec/binauralRenderer_interface +mkdir testvec/testv +mkdir testvec/testv/renderer_short +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 +cp -r scripts/switchPaths testvec +cp -r scripts/trajectories testvec +cp -r scripts/binauralRenderer_interface/binaural_renderers_hrtf_data testvec/binauralRenderer_interface +cp -r tests/ref testvec/testv/ref +cp -r tests/renderer_short/ref testvec/testv/renderer_short/ref +cp -r tests/split_rendering/ref 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 + +python3 scripts/cleanup_26252.py + +cp -r tests/conformance-test testvec/ +cp Readme_IVAS_dec.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 IVAS_cod testvec/bin +cp IVAS_dec testvec/bin +cp IVAS_rend testvec/bin +cp ISAR_post_rend testvec/bin diff --git a/lib_com/bitstream.c b/lib_com/bitstream.c index 5309e6735d19f30a7871025d798920974ce0fe21..bd8bf608de9651819136470a456120d076bf3298 100644 --- a/lib_com/bitstream.c +++ b/lib_com/bitstream.c @@ -5409,7 +5409,7 @@ void evs_dec_previewFrame( return; } - +#ifndef NONBE_MDCT_ST_DTX_FIX_SUBOPT_SPATIAL_CNG void dtx_read_padding_bits( DEC_CORE_HANDLE st, @@ -5425,3 +5425,4 @@ void dtx_read_padding_bits( return; } +#endif diff --git a/lib_com/common_api_types.h b/lib_com/common_api_types.h index f5b13c0dea05c0ffb7dec08f670352afe428112d..80c90d6b3152a5ace3ef0f0f205ac0c61784a356 100644 --- a/lib_com/common_api_types.h +++ b/lib_com/common_api_types.h @@ -176,7 +176,7 @@ typedef enum typedef struct ivas_masa_metadata_frame_struct *IVAS_MASA_METADATA_HANDLE; typedef struct ivas_masa_decoder_ext_out_meta_struct *IVAS_MASA_DECODER_EXT_OUT_META_HANDLE; -typedef struct ivas_hrtf_TDREND_HRFILT_FiltSet_struct *IVAS_DEC_HRTF_HANDLE; +typedef struct ivas_hrtf_TDREND_HRFILT_FiltSet_struct *IVAS_DEC_HRTF_TD_HANDLE; typedef struct ivas_hrtf_crend_structure *IVAS_DEC_HRTF_CREND_HANDLE; typedef struct ivas_hrtf_fastconv_struct *IVAS_DEC_HRTF_FASTCONV_HANDLE; typedef struct ivas_hrtf_parambin_struct *IVAS_DEC_HRTF_PARAMBIN_HANDLE; diff --git a/lib_com/edct.c b/lib_com/edct.c index d7af669c6598d25ec74b5d5d05af7d5fe667f7a5..09e6a99765bece44267f95c674d7aae9aaa6e183 100644 --- a/lib_com/edct.c +++ b/lib_com/edct.c @@ -44,6 +44,7 @@ #include "prot.h" #include "wmc_auto.h" #include /* for cosf, sinf */ +#include static ivas_error get_edct_table( const float **edct_table, @@ -226,7 +227,6 @@ void edst( return; } -#define FAST_EDXT /* optimized FFT-based DCT/DST algorithm */ /*-------------------------------------------------------------------------* * edxt() @@ -243,9 +243,8 @@ void edxt( ) { const float pi_len = EVS_PI / length; - int16_t k, m; + int16_t k; -#ifdef FAST_EDXT if ( kernelType == MDST_II || kernelType == MDCT_II ) { const int16_t Nm1 = length - 1; @@ -276,8 +275,14 @@ void edxt( { for ( k = Nm1 >> 1; k > 0; k-- ) { +#ifdef NONBE_FIX_NONBE_BETWEEN_OPTIMIZATION_LEVELS_2 + volatile float angle_tmp = scale * k; + const float wRe = cosf( angle_tmp ); + const float wIm = sinf( angle_tmp ); +#else const float wRe = cosf( scale * k ); const float wIm = sinf( scale * k ); +#endif y[k] /*pt 1*/ = wRe * re[k] + wIm * im[k]; y[length - k] = wIm * re[k] - wRe * im[k]; @@ -288,8 +293,14 @@ void edxt( { for ( k = Nm1 >> 1; k > 0; k-- ) { +#ifdef NONBE_FIX_NONBE_BETWEEN_OPTIMIZATION_LEVELS_2 + volatile float angle_tmp = scale * k; + const float wRe = cosf( angle_tmp ); + const float wIm = sinf( angle_tmp ); +#else const float wRe = cosf( scale * k ); const float wIm = sinf( scale * k ); +#endif y[Nm1 - k] = wRe * re[k] + wIm * im[k]; y[k - 1] = wIm * re[k] - wRe * im[k]; @@ -305,8 +316,14 @@ void edxt( { for ( k = Nm1 >> 1; k > 0; k-- ) { +#ifdef NONBE_FIX_NONBE_BETWEEN_OPTIMIZATION_LEVELS_2 + volatile float angle_tmp = scale * k; + const float wRe = cosf( angle_tmp ) * 0.5f; + const float wIm = sinf( angle_tmp ) * 0.5f; +#else const float wRe = cosf( scale * k ) * 0.5f; const float wIm = sinf( scale * k ) * 0.5f; +#endif re[k] = wRe * x[k] + wIm * x[length - k]; im[k] = wRe * x[length - k] - wIm * x[k]; @@ -317,8 +334,14 @@ void edxt( { for ( k = Nm1 >> 1; k > 0; k-- ) { +#ifdef NONBE_FIX_NONBE_BETWEEN_OPTIMIZATION_LEVELS_2 + volatile float angle_tmp = scale * k; + const float wRe = cosf( angle_tmp ) * 0.5f; + const float wIm = sinf( angle_tmp ) * 0.5f; +#else const float wRe = cosf( scale * k ) * 0.5f; const float wIm = sinf( scale * k ) * 0.5f; +#endif re[k] = wRe * x[Nm1 - k] + wIm * x[k - 1]; im[k] = wRe * x[k - 1] - wIm * x[Nm1 - k]; @@ -351,42 +374,8 @@ void edxt( } } else -#endif - if ( kernelType & 1 ) /* DST */ { - const float offK = ( kernelType == MDST_II && synthesis ? 0.5f : 1.0f - 0.5f * ( kernelType >> 1 ) ); - const float offM = ( kernelType == MDST_II && synthesis ? 1.0f : 0.5f ); - - for ( k = 0; k < length; k++ ) - { - y[k] = 0.f; - for ( m = 0; m < length; m++ ) - { - y[k] += x[m] * sinf( pi_len * ( m + offM ) * ( k + offK ) ); - } - } - if ( offK == 1.f ) - { - y[length - 1] *= 0.5f; /* scale Nyquist sample */ - } - } - else /* kernelType 0, 2: DCT */ - { - const float offK = ( kernelType == MDCT_II && synthesis ? 0.5f : 0.5f - 0.5f * ( kernelType >> 1 ) ); - const float offM = ( kernelType == MDCT_II && synthesis ? 0.0f : 0.5f ); - - for ( k = 0; k < length; k++ ) - { - y[k] = 0.f; - for ( m = 0; m < length; m++ ) - { - y[k] += x[m] * cosf( pi_len * ( m + offM ) * ( k + offK ) ); - } - } - if ( offK == 0.f ) - { - y[0] *= 0.5f; /* scale lowest (i.e. DC) sample */ - } + assert( !"Unsupported Kernel type in edxt()" ); } v_multc( y, ( kernelType == MDCT_II ? -1.f : 1.f ) * sqrtf( 2.f / length ), y, length ); diff --git a/lib_com/fd_cng_com.c b/lib_com/fd_cng_com.c index 4f57ceaed93781138cb7dc673e6ba5c3790c6397..608e2ed50e9057f55d5f4ac8ed2c006c3951a456 100644 --- a/lib_com/fd_cng_com.c +++ b/lib_com/fd_cng_com.c @@ -34,6 +34,7 @@ EVS Codec 3GPP TS26.443 Nov 04, 2021. Version 12.14.0 / 13.10.0 / 14.6.0 / 15.4.0 / 16.3.0 ====================================================================================*/ +#include "ivas_cnst.h" #include #include #include "options.h" @@ -140,7 +141,11 @@ void initFdCngCom( hFdCngCom->msMinBufferPtr = 0; set_f( hFdCngCom->msAlphaCor, 0.3f, 2 ); +#ifdef NONBE_MDCT_ST_DTX_FIX_SUBOPT_SPATIAL_CNG + set_f( hFdCngCom->coherence, 0.5f, MDCT_ST_DTX_NUM_COHERENCE_BANDS ); +#else hFdCngCom->coherence = 0.5f; +#endif return; } diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index cbc9961c7383d5e5b4580d90f0652799b8b98015..cb3675dd21457002afaddc3b67a0c5f304795b1e 100755 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -229,6 +229,7 @@ typedef enum /* format signaling in SID frames */ #define SID_FORMAT_NBITS 3 /* Bit 0 | Bit 1 | Bit 2 */ /*-------|-------|------ */ +#define SID_FORMAT_NONE (-0x1) /* n/a| n/a| n/a*/ #define SID_DFT_STEREO 0x0 /* 0| 0| 0 */ #define SID_MDCT_STEREO 0x1 /* 1| 0| 0 */ #define SID_ISM 0x2 /* 0| 1| 0 */ @@ -849,6 +850,11 @@ enum fea_names #define MDCT_ST_PLC_FADEOUT_TO_ZERO_LEN 20 #define MDCT_ST_PLC_FADEOUT_DELAY_4_LSP_FADE 3 +#ifdef NONBE_MDCT_ST_DTX_FIX_SUBOPT_SPATIAL_CNG +#define MDCT_ST_DTX_NUM_COHERENCE_BANDS 5 +#define MDCT_ST_DTX_FIRST_BAND_OFFSET 2 +#endif + typedef enum { NOISE_GEN_MODE_UNDEF = -1, EQUAL_CORES = 0, @@ -1220,6 +1226,9 @@ enum #define OMASA_GAIN_EDIT_THR 0.06f /* OMASA gain change threshold */ #define OMASA_AZI_EDIT_THR 1.0f /* OMASA-DISC azimuth change threshold */ #define OMASA_ELE_EDIT_THR 2.0f /* OMASA-DISC elevation change threshold */ +#ifdef NONBE_1380_OMASA_BUILD_DIFF +#define OMASA_PAN_TBL_LEN 601 +#endif #define MASA_JBM_RINGBUFFER_FRAMES 3 diff --git a/lib_com/ivas_error.h b/lib_com/ivas_error.h index 563b10e39112c34c9c5093d1d50bde1242ca558a..4a5249934ce8cd4167a9d3a39b410dc9c9bee7b2 100644 --- a/lib_com/ivas_error.h +++ b/lib_com/ivas_error.h @@ -151,6 +151,14 @@ typedef enum IVAS_ERR_LC3PLUS_INVALID_BITRATE, IVAS_ERR_INVALID_SPLIT_REND_CONFIG, + /*----------------------------------------* + * rtp errors * + *----------------------------------------*/ + IVAS_ERR_RTP_UNDERFLOW = 0x7000, + IVAS_ERR_RTP_INSUFFICIENT_OUTPUT_SIZE, + IVAS_ERR_RTP_UNPACK_PI_DATA, + IVAS_ERR_RTP_UNSUPPORTED_FRAME, + /*----------------------------------------* * unknown error * *----------------------------------------*/ @@ -288,6 +296,22 @@ static inline const char *ivas_error_to_string( ivas_error error_code ) { return "data error"; } + if ( ( error_code & 0x7000 ) == 0x7000 ) + { + switch ( error_code ) + { + case IVAS_ERR_RTP_UNDERFLOW: + return "RTP Undeflow in reading frame/packet"; + case IVAS_ERR_RTP_INSUFFICIENT_OUTPUT_SIZE: + return "Output buffer size is insufficient"; + case IVAS_ERR_RTP_UNPACK_PI_DATA: + return "Unpacking PI data failure"; + case IVAS_ERR_RTP_UNSUPPORTED_FRAME: + return "Unsupported RTP frame"; + default: + return "rtp error"; + } + } return "Unknown error"; } diff --git a/lib_com/ivas_omasa_com.c b/lib_com/ivas_omasa_com.c index 4042dd959b6e5a5e0ce4c18ca96f9685c118933e..a66e0e5c6b90130930482c74ef2b0d8da3359b88 100644 --- a/lib_com/ivas_omasa_com.c +++ b/lib_com/ivas_omasa_com.c @@ -61,7 +61,11 @@ #define GAMMA_ISM_MEDIUM_IMP4 1.0f #define GAMMA_ISM_HIGH_IMP4 1.2f - +#ifdef NONBE_1380_OMASA_BUILD_DIFF +#define PAN_MAX_DEG 30.0f +#define ONE_OVER_PAN_STEP_DEG 10.0f +#define SIN_LS_ANGLE 0.5f /* sinf( 30.0f * PI_OVER_180 ) */ +#endif /*--------------------------------------------------------------- * ivas_omasa_ism_mode_select() * @@ -496,6 +500,64 @@ void ivas_get_stereo_panning_gains( const float eleDeg, float panningGains[2] ) { +#ifdef NONBE_1380_OMASA_BUILD_DIFF + float aziPlusEle, aziMinusEle, y; + + /* use identity sin(A+B) + sin(A−B) = 2 sinA cosB */ + aziPlusEle = aziDeg + eleDeg; + aziMinusEle = aziDeg - eleDeg; + + /* wrap into -180..+180 */ + while ( aziPlusEle > 180.0f ) + { + aziPlusEle -= 360.0f; + } + while ( aziPlusEle < -180.0f ) + { + aziPlusEle += 360.0f; + } + while ( aziMinusEle > 180.0f ) + { + aziMinusEle -= 360.0f; + } + while ( aziMinusEle < -180.0f ) + { + aziMinusEle += 360.0f; + } + + /* compute Y-coordinate corresponding to the azimuth and elevation: y = sin(azi) * cos(ele) = (sin(azi+ele) + sin(azi-ele)) / 2 */ + y = ( sinf( aziPlusEle * PI_OVER_180 ) + sinf( aziMinusEle * PI_OVER_180 ) ) * 0.5f; + + if ( y >= SIN_LS_ANGLE ) + { /* Left side */ + panningGains[0] = 1.0f; + panningGains[1] = 0.0f; + } + else if ( y <= -SIN_LS_ANGLE ) + { /* Right side */ + panningGains[0] = 0.0f; + panningGains[1] = 1.0f; + } + else /* Tangent panning law */ + { + /* from sin(angle) to index assuming range -30..+30 degrees with 0.1-degree spacing */ + float angleDeg, pos; + int16_t idx; + + /* Convert azi and ele to an azi value of the cone of confusion */ + angleDeg = asinf( y ) * _180_OVER_PI; + angleDeg = fmaxf( fminf( angleDeg, PAN_MAX_DEG ), -PAN_MAX_DEG ); + + /* compute the panning gains from the mapped azimuth using a look-up table */ + pos = ( angleDeg + PAN_MAX_DEG ) * ONE_OVER_PAN_STEP_DEG; /* ideal floating index */ + idx = (int16_t) roundf( pos ); + + idx = max( 0, min( idx, OMASA_PAN_TBL_LEN - 1 ) ); + + panningGains[0] = ivas_tan_panning_gain_tbl[idx]; + panningGains[1] = ivas_tan_panning_gain_tbl[OMASA_PAN_TBL_LEN - 1 - idx]; + } +#else float aziRad, eleRad; float y, mappedX, aziRadMapped, A, A2, A3; const float LsAngleRad = 30.0f * PI_OVER_180; @@ -524,6 +586,7 @@ void ivas_get_stereo_panning_gains( panningGains[0] = sqrtf( A3 ); panningGains[1] = sqrtf( 1.0f - A3 ); } +#endif return; } diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 49c817012448c627db9b0118f39cbb959cccaaaa..d39d1b143b3cd8ae25b84926413dced00420348d 100755 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -806,12 +806,14 @@ Word16 matrix_product_q30_fx( Word32 *Z_fx /* o : resulting matrix after the matrix multiplication Q30*/ ); +#ifndef NONBE_MDCT_ST_DTX_FIX_SUBOPT_SPATIAL_CNG void dtx_read_padding_bits( DEC_CORE_HANDLE st, const int16_t num_bits ); +#endif void ivas_apply_non_diegetic_panning( float *input_f, /* i : non-diegetic object */ float *output_f[], /* o : core-coder transport mono channel/stereo output */ @@ -819,7 +821,19 @@ void ivas_apply_non_diegetic_panning( const int16_t output_frame /* i : output frame length per channel */ ); +#ifdef IVAS_RTPDUMP +void QuaternionProduct( + const IVAS_QUATERNION q1, + const IVAS_QUATERNION q2, + IVAS_QUATERNION *const r +); + +void QuaternionInverse( + const IVAS_QUATERNION q, + IVAS_QUATERNION *const r +); +#endif /*----------------------------------------------------------------------------------* * decoder->rendering TC buffer prototypes *----------------------------------------------------------------------------------*/ @@ -5174,20 +5188,6 @@ ivas_error ivas_allocate_binaural_hrtf( const int16_t allocate_init_flag /* i : Memory allocation flag */ ); -#ifdef DEBUGGING -void ivas_binaural_cldfb( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ - float *output_f[] /* i/o: synthesized core-coder transport channels/DirAC output */ -); - -void ivas_binaural_cldfb_sf( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ - const int16_t n_samples_to_render, /* i : output frame length per channel */ - const int16_t slot_size, /* i : JBM slot size */ - float *output_f[] /* i/o: synthesized core-coder transport channels/DirAC output */ -); -#endif - void ivas_binRenderer( BINAURAL_RENDERER_HANDLE hBinRenderer, /* i/o: binaural renderer handle */ const MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData, /* i/o: pose correction data handle */ @@ -5209,6 +5209,43 @@ void ivas_binaural_add_LFE( float *output_f[] /* o : synthesized core-coder transport channels/DirAC output */ ); +#ifdef FIX_1119_SPLIT_RENDERING_VOIP + +/*---------------------------------------------------------------------------------* + * Multi-pose ring buffer Prototypes +*-----------------------------------------------------------------------------------*/ + +ivas_error ivas_CLDFB_RINGBUF_Open( + ISAR_CLDFB_RINGBUF_HANDLE *ph, + const int16_t capacity_columns +); + +void ivas_CLDFB_RINGBUF_Close( + ISAR_CLDFB_RINGBUF_HANDLE *ph +); + +void ivas_CLDFB_RINGBUF_Push( + ISAR_CLDFB_RINGBUF_HANDLE h, + const float *real, + const float *imag, + const int16_t num_bands +); + +void ivas_CLDFB_RINGBUF_Pop( + ISAR_CLDFB_RINGBUF_HANDLE h, + float *real, + float *imag, + const int16_t num_bands +); + +void ivas_CLDFB_RINGBUF_GetByIdx( + ISAR_CLDFB_RINGBUF_HANDLE h, + float **p_real, + float **p_imag, + const int16_t idx +); + +#endif /*----------------------------------------------------------------------------------* * renderer prototypes diff --git a/lib_com/ivas_rom_com.c b/lib_com/ivas_rom_com.c index 237583bb589061e11db0b5fd7d0259ecf8605907..039dee13c5bb829a839ba2e29eef384e4a318204 100644 --- a/lib_com/ivas_rom_com.c +++ b/lib_com/ivas_rom_com.c @@ -793,6 +793,12 @@ const float nf_tw_smoothing_coeffs[N_LTP_GAIN_MEMS] = 0.4f,0.2f,0.2f,0.2f }; +#ifdef NONBE_MDCT_ST_DTX_FIX_SUBOPT_SPATIAL_CNG +const int16_t mdct_stereo_dtx_coherence_bandlengths[MDCT_ST_DTX_NUM_COHERENCE_BANDS] = { + 6, /* 8 - MDCT_ST_DTX_FIRST_BAND_OFFSET */ 8, 16, 16, 80 +}; +#endif + /*----------------------------------------------------------------------------------* * Stereo DTX tables @@ -2863,6 +2869,133 @@ const float dct12[12*12]= 0.2887f, -0.4048f, 0.3943f, -0.3772f, 0.3536f, -0.3239f, 0.2887f, -0.2485f, 0.2041f, -0.1562f, 0.1057f, -0.0533f }; +#ifdef NONBE_1380_OMASA_BUILD_DIFF +const float ivas_tan_panning_gain_tbl[OMASA_PAN_TBL_LEN] = +{ + 0.0000000f, 0.0020142f, 0.0040283f, 0.0060425f, 0.0080872f, + 0.0101013f, 0.0121460f, 0.0141907f, 0.0162354f, 0.0182800f, + 0.0203552f, 0.0223999f, 0.0244751f, 0.0265198f, 0.0285950f, + 0.0306702f, 0.0327454f, 0.0348206f, 0.0369263f, 0.0390015f, + 0.0411072f, 0.0432129f, 0.0453186f, 0.0474243f, 0.0495300f, + 0.0516357f, 0.0537415f, 0.0558777f, 0.0580139f, 0.0601196f, + 0.0622559f, 0.0643921f, 0.0665588f, 0.0686951f, 0.0708313f, + 0.0729980f, 0.0751648f, 0.0773315f, 0.0794983f, 0.0816650f, + 0.0838318f, 0.0859985f, 0.0881958f, 0.0903625f, 0.0925598f, + 0.0947571f, 0.0969543f, 0.0991516f, 0.1013489f, 0.1035767f, + 0.1057739f, 0.1080017f, 0.1102295f, 0.1124573f, 0.1146851f, + 0.1169128f, 0.1191406f, 0.1213684f, 0.1236267f, 0.1258850f, + 0.1281128f, 0.1303711f, 0.1326294f, 0.1348877f, 0.1371765f, + 0.1394348f, 0.1416931f, 0.1439819f, 0.1462708f, 0.1485596f, + 0.1508484f, 0.1531372f, 0.1554260f, 0.1577148f, 0.1600342f, + 0.1623230f, 0.1646423f, 0.1669617f, 0.1692505f, 0.1715698f, + 0.1739197f, 0.1762390f, 0.1785583f, 0.1809082f, 0.1832275f, + 0.1855774f, 0.1879272f, 0.1902466f, 0.1925964f, 0.1949768f, + 0.1973267f, 0.1996765f, 0.2020569f, 0.2044067f, 0.2067871f, + 0.2091370f, 0.2115173f, 0.2138977f, 0.2162781f, 0.2186584f, + 0.2210693f, 0.2234497f, 0.2258301f, 0.2282410f, 0.2306519f, + 0.2330322f, 0.2354431f, 0.2378540f, 0.2402649f, 0.2426758f, + 0.2450867f, 0.2475281f, 0.2499390f, 0.2523499f, 0.2547913f, + 0.2572327f, 0.2596436f, 0.2620850f, 0.2645264f, 0.2669678f, + 0.2694092f, 0.2718506f, 0.2742920f, 0.2767639f, 0.2792053f, + 0.2816772f, 0.2841187f, 0.2865906f, 0.2890320f, 0.2915039f, + 0.2939758f, 0.2964478f, 0.2989197f, 0.3013916f, 0.3038635f, + 0.3063354f, 0.3088074f, 0.3113098f, 0.3137817f, 0.3162537f, + 0.3187561f, 0.3212280f, 0.3237305f, 0.3262329f, 0.3287048f, + 0.3312073f, 0.3337097f, 0.3362122f, 0.3387146f, 0.3412170f, + 0.3437195f, 0.3462219f, 0.3487244f, 0.3512268f, 0.3537292f, + 0.3562317f, 0.3587646f, 0.3612671f, 0.3637695f, 0.3663025f, + 0.3688049f, 0.3713074f, 0.3738403f, 0.3763428f, 0.3788757f, + 0.3814087f, 0.3839111f, 0.3864441f, 0.3889465f, 0.3914795f, + 0.3940125f, 0.3965149f, 0.3990479f, 0.4015808f, 0.4041138f, + 0.4066162f, 0.4091492f, 0.4116821f, 0.4142151f, 0.4167175f, + 0.4192505f, 0.4217834f, 0.4243164f, 0.4268188f, 0.4293518f, + 0.4318848f, 0.4344177f, 0.4369202f, 0.4394531f, 0.4419861f, + 0.4445190f, 0.4470215f, 0.4495544f, 0.4520874f, 0.4545898f, + 0.4571228f, 0.4596558f, 0.4621582f, 0.4646912f, 0.4671936f, + 0.4697266f, 0.4722290f, 0.4747620f, 0.4772644f, 0.4797668f, + 0.4822998f, 0.4848022f, 0.4873047f, 0.4898071f, 0.4923096f, + 0.4948425f, 0.4973450f, 0.4998474f, 0.5023193f, 0.5048218f, + 0.5073242f, 0.5098267f, 0.5123291f, 0.5148010f, 0.5173035f, + 0.5197754f, 0.5222778f, 0.5247498f, 0.5272217f, 0.5297241f, + 0.5321960f, 0.5346680f, 0.5371399f, 0.5396118f, 0.5420837f, + 0.5445251f, 0.5469971f, 0.5494385f, 0.5519104f, 0.5543518f, + 0.5568237f, 0.5592651f, 0.5617065f, 0.5641479f, 0.5665894f, + 0.5690002f, 0.5714417f, 0.5738831f, 0.5762939f, 0.5787048f, + 0.5811462f, 0.5835571f, 0.5859680f, 0.5883789f, 0.5907593f, + 0.5931702f, 0.5955505f, 0.5979614f, 0.6003418f, 0.6027222f, + 0.6051025f, 0.6074829f, 0.6098633f, 0.6122131f, 0.6145935f, + 0.6169434f, 0.6192932f, 0.6216431f, 0.6239929f, 0.6263428f, + 0.6286621f, 0.6309814f, 0.6333313f, 0.6356506f, 0.6379700f, + 0.6402588f, 0.6425781f, 0.6448669f, 0.6471863f, 0.6494751f, + 0.6517639f, 0.6540527f, 0.6563110f, 0.6585999f, 0.6608582f, + 0.6631165f, 0.6653748f, 0.6676025f, 0.6698608f, 0.6720886f, + 0.6743164f, 0.6765442f, 0.6787720f, 0.6809998f, 0.6831970f, + 0.6853943f, 0.6875916f, 0.6897888f, 0.6919861f, 0.6941528f, + 0.6963196f, 0.6984863f, 0.7006531f, 0.7027893f, 0.7049561f, + 0.7070923f, 0.7092285f, 0.7113647f, 0.7134705f, 0.7155762f, + 0.7177124f, 0.7197876f, 0.7218933f, 0.7239685f, 0.7260742f, + 0.7281494f, 0.7301941f, 0.7322693f, 0.7343140f, 0.7363586f, + 0.7384033f, 0.7404480f, 0.7424622f, 0.7444763f, 0.7464905f, + 0.7485046f, 0.7504883f, 0.7524719f, 0.7544556f, 0.7564392f, + 0.7583923f, 0.7603455f, 0.7622986f, 0.7642517f, 0.7662048f, + 0.7681274f, 0.7700500f, 0.7719421f, 0.7738647f, 0.7757568f, + 0.7776489f, 0.7795410f, 0.7814026f, 0.7832642f, 0.7851257f, + 0.7869873f, 0.7888184f, 0.7906494f, 0.7924805f, 0.7943115f, + 0.7961121f, 0.7979126f, 0.7997131f, 0.8015137f, 0.8032837f, + 0.8050537f, 0.8068237f, 0.8085632f, 0.8103027f, 0.8120422f, + 0.8137817f, 0.8154907f, 0.8171997f, 0.8189087f, 0.8206177f, + 0.8222961f, 0.8239746f, 0.8256531f, 0.8273010f, 0.8289795f, + 0.8306274f, 0.8322449f, 0.8338928f, 0.8355103f, 0.8370972f, + 0.8387146f, 0.8403015f, 0.8418884f, 0.8434753f, 0.8450317f, + 0.8465881f, 0.8481445f, 0.8497009f, 0.8512268f, 0.8527527f, + 0.8542786f, 0.8557739f, 0.8572693f, 0.8587646f, 0.8602600f, + 0.8617249f, 0.8631897f, 0.8646545f, 0.8660889f, 0.8675232f, + 0.8689575f, 0.8703918f, 0.8717957f, 0.8731995f, 0.8746033f, + 0.8759766f, 0.8773804f, 0.8787231f, 0.8800964f, 0.8814392f, + 0.8827820f, 0.8841248f, 0.8854675f, 0.8867798f, 0.8880920f, + 0.8893738f, 0.8906860f, 0.8919678f, 0.8932190f, 0.8945007f, + 0.8957520f, 0.8970032f, 0.8982544f, 0.8994751f, 0.9006958f, + 0.9019165f, 0.9031067f, 0.9042969f, 0.9054871f, 0.9066772f, + 0.9078369f, 0.9089966f, 0.9101562f, 0.9113159f, 0.9124451f, + 0.9135742f, 0.9147034f, 0.9158020f, 0.9169006f, 0.9179993f, + 0.9190979f, 0.9201660f, 0.9212341f, 0.9223022f, 0.9233398f, + 0.9243774f, 0.9254150f, 0.9264526f, 0.9274597f, 0.9284973f, + 0.9294739f, 0.9304810f, 0.9314575f, 0.9324341f, 0.9334106f, + 0.9343872f, 0.9353333f, 0.9362793f, 0.9371948f, 0.9381409f, + 0.9390564f, 0.9399719f, 0.9408569f, 0.9417725f, 0.9426575f, + 0.9435425f, 0.9443970f, 0.9452820f, 0.9461365f, 0.9469910f, + 0.9478149f, 0.9486389f, 0.9494629f, 0.9502869f, 0.9511108f, + 0.9519043f, 0.9526978f, 0.9534912f, 0.9542542f, 0.9550171f, + 0.9557800f, 0.9565430f, 0.9573059f, 0.9580383f, 0.9587708f, + 0.9595032f, 0.9602051f, 0.9609070f, 0.9616089f, 0.9623108f, + 0.9630127f, 0.9636841f, 0.9643555f, 0.9650269f, 0.9656677f, + 0.9663391f, 0.9669800f, 0.9676208f, 0.9682312f, 0.9688721f, + 0.9694824f, 0.9700928f, 0.9707031f, 0.9712830f, 0.9718628f, + 0.9724426f, 0.9730225f, 0.9735718f, 0.9741516f, 0.9747009f, + 0.9752502f, 0.9757690f, 0.9763184f, 0.9768372f, 0.9773560f, + 0.9778748f, 0.9783630f, 0.9788818f, 0.9793701f, 0.9798279f, + 0.9803162f, 0.9808044f, 0.9812622f, 0.9817200f, 0.9821777f, + 0.9826050f, 0.9830627f, 0.9834900f, 0.9839172f, 0.9843445f, + 0.9847412f, 0.9851379f, 0.9855652f, 0.9859619f, 0.9863281f, + 0.9867249f, 0.9870911f, 0.9874573f, 0.9878235f, 0.9881897f, + 0.9885559f, 0.9888916f, 0.9892273f, 0.9895630f, 0.9898987f, + 0.9902039f, 0.9905396f, 0.9908447f, 0.9911499f, 0.9914551f, + 0.9917297f, 0.9920349f, 0.9923096f, 0.9925842f, 0.9928589f, + 0.9931335f, 0.9933777f, 0.9936523f, 0.9938965f, 0.9941406f, + 0.9943848f, 0.9945984f, 0.9948425f, 0.9950562f, 0.9952698f, + 0.9954834f, 0.9956970f, 0.9958801f, 0.9960938f, 0.9962769f, + 0.9964600f, 0.9966431f, 0.9968262f, 0.9969788f, 0.9971619f, + 0.9973145f, 0.9974670f, 0.9976196f, 0.9977722f, 0.9978943f, + 0.9980469f, 0.9981689f, 0.9982910f, 0.9984131f, 0.9985352f, + 0.9986572f, 0.9987488f, 0.9988708f, 0.9989624f, 0.9990540f, + 0.9991455f, 0.9992371f, 0.9992981f, 0.9993896f, 0.9994507f, + 0.9995117f, 0.9995728f, 0.9996338f, 0.9996948f, 0.9997253f, + 0.9997864f, 0.9998169f, 0.9998474f, 0.9998779f, 0.9999084f, + 0.9999390f, 0.9999390f, 0.9999695f, 0.9999695f, 0.9999695f, + 0.9999695f +}; +#endif + /*----------------------------------------------------------------------------------* * ISM ROM tables *----------------------------------------------------------------------------------*/ diff --git a/lib_com/ivas_rom_com.h b/lib_com/ivas_rom_com.h index c68e16ba9af30cb5ae1938ad35098899261479c2..9ef4737c59c6cdfeaf73782c43095ac7fecfb317 100644 --- a/lib_com/ivas_rom_com.h +++ b/lib_com/ivas_rom_com.h @@ -138,6 +138,9 @@ extern const SpectrumWarping sw32000Hz[]; /* PsychLPC */ extern const MDCTStereoBands_config mdctStereoBands_32000_640[]; extern const float nf_tw_smoothing_coeffs[N_LTP_GAIN_MEMS]; +#ifdef NONBE_MDCT_ST_DTX_FIX_SUBOPT_SPATIAL_CNG +extern const int16_t mdct_stereo_dtx_coherence_bandlengths[MDCT_ST_DTX_NUM_COHERENCE_BANDS]; +#endif /*----------------------------------------------------------------------------------* * Stereo DTX ROM tables @@ -333,6 +336,9 @@ extern const float dct4[]; extern const float dct5[]; extern const float dct8[]; extern const float dct12[]; +#ifdef NONBE_1380_OMASA_BUILD_DIFF +extern const float ivas_tan_panning_gain_tbl[]; +#endif /*----------------------------------------------------------------------------------* * ISM ROM tables diff --git a/lib_com/options.h b/lib_com/options.h old mode 100644 new mode 100755 index 77f6098c215953cc6703b9e6f4ea927f64e19cc7..a98f995caace1d62781b56c3f8ece92d70c7bb24 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -55,6 +55,7 @@ /*#define WMOPS_DETAIL*/ /* Output detailed complexity printout for every function. Increases runtime overhead */ /*#define WMOPS_WC_FRAME_ANALYSIS*/ /* Output detailed complexity analysis for the worst-case frame */ /*#define MEM_COUNT_DETAILS*/ /* Output detailed memory analysis for the worst-case frame (writes to the file "mem_analysis.csv") */ +/*#define FLP_EXCEPTION_TRAP*/ /* Enable trap for floating-point exceptions (e.g., denormals, underflow, overflow, ...) */ #ifdef DEBUGGING /*#define DBG_BITSTREAM_ANALYSIS*/ /* Write bitstream with annotations to a text file */ @@ -158,11 +159,18 @@ /* ################## Start DEVELOPMENT switches ######################### */ +#define RTP_S4_251135_CR26253_0016_REV1 /* RTP Pack/Unpack API corresponding to CR 26253 */ +#define IVAS_RTPDUMP /* RTPDUMP writing and reading for IVAS payloads */ +#define FIXED_RTP_SEQUENCE_NUM /* Remove random sequence number initialization */ + /* ################### Start BE switches ################################# */ /* only BE switches wrt selection floating point code */ /*#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 FIX_1119_SPLIT_RENDERING_VOIP /* FhG: Add split rendering support to decoder in VoIP mode */ +#define TMP_1342_WORKAROUND_DEC_FLUSH_BROKEN_IN_SR /* FhG: Temporary workaround for incorrect implementation of decoder flush with split rendering */ +#define FIX_1413_IGF_INIT_PRINTOUT /* FhG: use correct variable for IGF initiliazation */ +#define RENDERER_MD_SYNC_DELAY_TO_INTEGER /* FhG: change data type of metadata sync delay in ext renderer to int16_t for better BASOP portability (and nicer code) */ /* #################### End BE switches ################################## */ @@ -174,8 +182,17 @@ #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_1328_FIX_NON_LINEARITY /* VA: Fix possible issue when computing bwe_exc_extended and previous frame were almost 0 */ +#define NONBE_1399_1400_FIX_OBJ_EDIT_ISSUES /* Nokia: Fix for issues 1399: obj edit broken with MC/SBA output in VOIP, and 1400: negative energy estimate used for gaining. */ +#define FIX_1411_IGF_CRASH_BW_SWITCHING /* FhG: Fix for issue 1411: fixes crash that can happen for IGF with BW switching and DTX*/ + +#define NONBE_1412_AVOID_ROUNDING_AZ_ELEV /* FhG: Avoid rounding when passing azimuth and elevation to efap_determine_gains() */ +#define NONBE_MDCT_ST_DTX_FIX_SUBOPT_SPATIAL_CNG /* FhG: Fix MDCT-Stereo comfort noise for certain noise types */ +#define NONBE_FIX_NONBE_BETWEEN_OPTIMIZATION_LEVELS /* FhG: fix non-BE in DFT stereo encoder between optimization levels */ +#define NONBE_FIX_NONBE_BETWEEN_OPTIMIZATION_LEVELS_2 /* FhG: fix even more non-BEnesses */ + +/*#define NONBE_1324_TC_BUFFER_MEMOERY_KEEP*/ /* VA: issue 1324: do not reset TSM memory in JBM bitrate switching */ +#define NONBE_1380_OMASA_BUILD_DIFF /* Nokia: Fix for issue #1380: Large differences in OMASA output between Debug and Release builds */ /* ##################### End NON-BE switches ########################### */ diff --git a/lib_com/prot.h b/lib_com/prot.h index efb77f0a3f8067eae9f448e8a7c78e2ec5782e92..c624212fc3060e0b874a32170932fbf5c9183f11 100644 --- a/lib_com/prot.h +++ b/lib_com/prot.h @@ -2247,14 +2247,12 @@ void read_next_force( #endif ivas_error init_encoder( - Encoder_State *st, /* i/o: state structure */ - Encoder_Struct *st_ivas, /* i/o: encoder state structure */ - const int16_t idchan, /* i : channel ID */ - const int16_t var_SID_rate_flag, /* i : flag for variable SID update rate */ - const int16_t interval_SID, /* i : interval for SID update */ - const int16_t vad_only_flag, /* i : flag to indicate front-VAD structure */ - const ISM_MODE ism_mode, /* i : ISM mode */ - const int32_t element_brate /* element bitrate */ + Encoder_State *st, /* i/o: state structure */ + Encoder_Struct *st_ivas, /* i/o: encoder state structure */ + const int16_t idchan, /* i : channel ID */ + const int16_t vad_only_flag, /* i : flag to indicate front-VAD structure */ + const ISM_MODE ism_mode, /* i : ISM mode */ + const int32_t element_brate /* element bitrate */ ); void LPDmem_enc_init( @@ -2645,18 +2643,15 @@ void flip_and_downmix_generic( ); void non_linearity( - const float input[], /* i : input signal */ - float output[], /* i : output signal */ - float old_bwe_exc_extended[], /* i/o: memory bugffer */ - const int16_t length, /* i : input length */ - float *prev_scale, /* i/o: memory */ - const int16_t coder_type, /* i : Coder Type */ - const float *voice_factors, /* i : Voice Factors */ - const int16_t L_frame /* i : ACELP frame length */ -#ifdef NONBE_1328_FIX_NON_LINEARITY - , - const int16_t element_mode /* i : element_mode to differentiate EVS and IVAS */ -#endif + const float input[], /* i : input signal */ + float output[], /* i : output signal */ + float old_bwe_exc_extended[], /* i/o: memory bugffer */ + const int16_t length, /* i : input length */ + float *prev_scale, /* i/o: memory */ + const int16_t coder_type, /* i : Coder Type */ + const float *voice_factors, /* i : Voice Factors */ + const int16_t L_frame, /* i : ACELP frame length */ + const int16_t element_mode /* i : element_mode to differentiate EVS and IVAS*/ ); void interp_code_5over2( diff --git a/lib_com/stat_com.h b/lib_com/stat_com.h index 4f459ef531af9409ffe1733321edba991b965cad..2eb9b5ee95ff0da883c98dbab81a3e0fea2dba7f 100644 --- a/lib_com/stat_com.h +++ b/lib_com/stat_com.h @@ -38,6 +38,7 @@ #ifndef STAT_COM_H #define STAT_COM_H +#include "ivas_cnst.h" #include #include "options.h" #include "typedef.h" @@ -404,7 +405,11 @@ typedef struct int16_t flag_noisy_speech; float likelihood_noisy_speech; - float coherence; /* inter-channel coherence of noise */ +#ifdef NONBE_MDCT_ST_DTX_FIX_SUBOPT_SPATIAL_CNG + float coherence[MDCT_ST_DTX_NUM_COHERENCE_BANDS]; /* inter-channel coherence of noise */ +#else + float coherence; /* inter-channel coherence of noise */ +#endif int16_t no_side_flag; /* indicates whether the side noise shape should be zeroed-out or not */ } FD_CNG_COM, *HANDLE_FD_CNG_COM; diff --git a/lib_com/swb_tbe_com.c b/lib_com/swb_tbe_com.c index ed06e57636c1bb4fa0f19df5422c1125585b5edb..2104e5cdee89af298c6c2a8d9df5c9fd39feda0e 100644 --- a/lib_com/swb_tbe_com.c +++ b/lib_com/swb_tbe_com.c @@ -1345,18 +1345,15 @@ void ScaleShapedSHB( * -------------------------------------------------------------------*/ void non_linearity( - const float input[], /* i : input signal */ - float output[], /* o : output signal */ - float old_bwe_exc_extended[], /* i/o: memory bugffer */ - const int16_t length, /* i : input length */ - float *prev_scale, /* i/o: memory */ - const int16_t coder_type, /* i : Coder Type */ - const float *voice_factors, /* i : Voice Factors */ - const int16_t L_frame /* i : ACELP frame length */ -#ifdef NONBE_1328_FIX_NON_LINEARITY - , - const int16_t element_mode /* i : element_mode to differentiate EVS and IVAS */ -#endif + const float input[], /* i : input signal */ + float output[], /* o : output signal */ + float old_bwe_exc_extended[], /* i/o: memory bugffer */ + const int16_t length, /* i : input length */ + float *prev_scale, /* i/o: memory */ + const int16_t coder_type, /* i : Coder Type */ + const float *voice_factors, /* i : Voice Factors */ + const int16_t L_frame, /* i : ACELP frame length */ + const int16_t element_mode /* i : element_mode to differentiate EVS and IVAS*/ ) { int16_t i, j; @@ -1369,17 +1366,16 @@ void non_linearity( int16_t en_abs = 0; float v_fac = 0, ths; int16_t nframes; -#ifdef NONBE_1328_FIX_NON_LINEARITY float sc_factor; -#endif + if ( L_frame == L_FRAME16k ) { - nframes = 5; + nframes = NB_SUBFR16k; ths = 0.87f; } else { - nframes = 4; + nframes = NB_SUBFR; ths = 0.94f; } @@ -1416,17 +1412,14 @@ void non_linearity( scale = 0.67f; } -#ifdef NONBE_1328_FIX_NON_LINEARITY sc_factor = 1024.0f; if ( element_mode > EVS_MONO ) { sc_factor = (float) ( 1 << max( 13 - norm_s( j + 1 ), 0 ) ); /* Adapt the scaling factor allowed depending of max position */ sc_factor = max( sc_factor, 2.0f ); } + if ( *prev_scale <= 0.0 || *prev_scale > sc_factor * scale ) -#else - if ( *prev_scale <= 0.0 || *prev_scale > 1024.0f * scale ) -#endif { scale_step = 1.0; *prev_scale = scale; @@ -1483,17 +1476,14 @@ void non_linearity( scale = 0.67f; } -#ifdef NONBE_1328_FIX_NON_LINEARITY sc_factor = 1024.0f; if ( element_mode > EVS_MONO ) { sc_factor = (float) ( 1 << max( 12 - norm_s( j - length / 2 + 1 ), 0 ) ); /* allowed intra frame jump is smaller */ sc_factor = max( sc_factor, 2.0f ); } + if ( *prev_scale <= 0.0 || *prev_scale > sc_factor * scale ) -#else - if ( *prev_scale <= 0.0 || *prev_scale > 1024.0f * scale ) -#endif { scale_step = 1.0; *prev_scale = scale; diff --git a/lib_com/tcx_utils.c b/lib_com/tcx_utils.c index 458a43d72bf7b49254959d4897d88f997ce6e922..d37ecf207bdd514e006a0dd87022f875d0109ac0 100644 --- a/lib_com/tcx_utils.c +++ b/lib_com/tcx_utils.c @@ -568,14 +568,11 @@ void lpc2mdct( if ( noInverse ) { - for ( i = 0; i < length; i++ ) - { - mdct_gains[i] = (float) ( sqrt( RealData[i] * RealData[i] + ImagData[i] * ImagData[i] ) ); - } + assert( !"not supported option in lpc2mdct()" ); } else - /* Get amplitude */ { + /* Get amplitude */ for ( i = 0; i < length; i++ ) { mdct_gains[i] = (float) ( 1.0f / max( EPSILON, sqrt( RealData[i] * RealData[i] + ImagData[i] * ImagData[i] ) ) ); diff --git a/lib_debug/flp_debug.h b/lib_debug/flp_debug.h new file mode 100644 index 0000000000000000000000000000000000000000..d0fd894a2ef0a824eb2da87a77c2bb63e1e8163f --- /dev/null +++ b/lib_debug/flp_debug.h @@ -0,0 +1,263 @@ +/****************************************************************************************************** + + (C) 2022-2025 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB, + Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., + Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, + Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other + contributors to this repository. All Rights Reserved. + + This software is protected by copyright law and by international treaties. + The IVAS codec Public Collaboration consisting of Dolby International AB, Ericsson AB, + Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., + Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, + Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other + contributors to this repository retain full ownership rights in their respective contributions in + the software. This notice grants no license of any kind, including but not limited to patent + license, nor is any license granted by implication, estoppel or otherwise. + + Contributors are required to enter into the IVAS codec Public Collaboration agreement before making + contributions. + + This software is provided "AS IS", without any express or implied warranties. The software is in the + development stage. It is intended exclusively for experts who have experience with such software and + solely for the purpose of inspection. All implied warranties of non-infringement, merchantability + and fitness for a particular purpose are hereby disclaimed and excluded. + + Any dispute, controversy or claim arising under or in relation to providing this software shall be + submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in + accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and + the United Nations Convention on Contracts on the International Sales of Goods. + +*******************************************************************************************************/ + +#include + +#if defined( _MSC_VER ) +// MSVC, x87 +#include +#elif defined( __GNUC__ ) && ( defined( __SSE__ ) || defined( __SSE2__ ) || defined( __AVX__ ) ) +// GCC/Clang, x86 SSE/AVX +#include +#endif + +#define FLE_MASK_INVALID 0x080 +#define FLE_MASK_DENORM 0x100 +#define FLE_MASK_DIV_ZERO 0x200 +#define FLE_MASK_OVERFLOW 0x400 +#define FLE_MASK_UNDERFLOW 0x800 + +/* + detect underflow execption, which results in a denormal; + this will not detect each and every denormal - otherwise, + all FLP values would have to be tested for denormals using + e.g. fpclassify()/fpstatus or bitmasks +*/ + + +static inline void enable_float_exception_trap( uint32_t fle_mask ) +{ + +#if defined( _MSC_VER ) + + // MSVC, x87 + unsigned int cw = _controlfp( 0, 0 ); + + if ( fle_mask & FLE_MASK_INVALID ) + { + cw &= ~_EM_INVALID; + } + if ( fle_mask & FLE_MASK_DENORM ) + { + cw &= ~_EM_DENORMAL; + } + if ( fle_mask & FLE_MASK_DIV_ZERO ) + { + cw &= ~_EM_ZERODIVIDE; + } + if ( fle_mask & FLE_MASK_OVERFLOW ) + { + cw &= ~_EM_OVERFLOW; + } + if ( fle_mask & FLE_MASK_UNDERFLOW ) + { + cw &= ~_EM_UNDERFLOW; + } + + _controlfp( cw, _MCW_EM ); + +#elif defined( __GNUC__ ) && ( defined( __SSE__ ) || defined( __SSE2__ ) || defined( __AVX__ ) ) + + // GCC/Clang, x86 SSE/AVX + unsigned int mx = _mm_getcsr(); + + if ( fle_mask & FLE_MASK_INVALID ) + { + mx &= ~_MM_MASK_INVALID; + } + if ( fle_mask & FLE_MASK_DENORM ) + { + mx &= ~_MM_MASK_DENORM; + } + if ( fle_mask & FLE_MASK_DIV_ZERO ) + { + mx &= ~_MM_MASK_DIV_ZERO; + } + if ( fle_mask & FLE_MASK_OVERFLOW ) + { + mx &= ~_MM_MASK_OVERFLOW; + } + if ( fle_mask & FLE_MASK_UNDERFLOW ) + { + mx &= ~_MM_MASK_UNDERFLOW; + } + + _mm_setcsr( mx ); + +#elif defined( __aarch64__ ) + + // AArch64 (e.g., Apple Silicon) + uint64_t fpcr; + __asm__ volatile( "mrs %0, fpcr" + : "=r"( fpcr ) ); + + // disable sits 24(FZ) & 25(DN) --> allow denormals to happen + fpcr &= ~( ( 1ull << 24 ) | ( 1ull << 25 ) ); + + if ( fle_mask & FLE_MASK_INVALID ) + { + // set bit 8 (IOE) to unmask invalid operations exceptions + fpcr |= ( 1ull << 8 ); + } + if ( fle_mask & FLE_MASK_DENORM ) + { + // set bit 15 (IDE) to unmask input denormal exceptions + fpcr |= ( 1ull << 15 ); + } + if ( fle_mask & FLE_MASK_DIV_ZERO ) + { + // set bit 9 (DZE) to unmask div_zero exceptions + fpcr |= ( 1ull << 9 ); + } + if ( fle_mask & FLE_MASK_OVERFLOW ) + { + // set bit 10 (OFE) to unmask overflow exceptions + fpcr |= ( 1ull << 10 ); + } + if ( fle_mask & FLE_MASK_UNDERFLOW ) + { + // set bit 11 (UFE) to unmask underflow exceptions + fpcr |= ( 1ull << 11 ); + } + + __asm__ volatile( "msr fpcr, %0" ::"r"( fpcr ) ); + +#else + fprintf( stderr, "enable_float_exception_trap() not supported on platform!\n" ); +#endif +} + +static inline void disable_float_exception_trap( uint32_t fle_mask ) +{ + +#if defined( _MSC_VER ) + + // MSVC, x87 + unsigned int cw = _controlfp( 0, 0 ); + + if ( fle_mask & FLE_MASK_INVALID ) + { + cw |= _EM_INVALID; + } + if ( fle_mask & FLE_MASK_DENORM ) + { + cw |= _EM_DENORMAL; + } + if ( fle_mask & FLE_MASK_DIV_ZERO ) + { + cw |= _EM_ZERODIVIDE; + } + if ( fle_mask & FLE_MASK_OVERFLOW ) + { + cw |= _EM_OVERFLOW; + } + if ( fle_mask & FLE_MASK_UNDERFLOW ) + { + cw |= _EM_UNDERFLOW; + } + + _controlfp( cw, _MCW_EM ); + +#elif defined( __GNUC__ ) && ( defined( __SSE__ ) || defined( __SSE2__ ) || defined( __AVX__ ) ) + + // GCC/Clang, x86 SSE/AVX + unsigned int mx = _mm_getcsr(); + + if ( fle_mask & FLE_MASK_INVALID ) + { + mx |= _MM_MASK_INVALID; + } + if ( fle_mask & FLE_MASK_DENORM ) + { + mx |= _MM_MASK_DENORM; + } + if ( fle_mask & FLE_MASK_DIV_ZERO ) + { + mx |= _MM_MASK_DIV_ZERO; + } + if ( fle_mask & FLE_MASK_OVERFLOW ) + { + mx |= _MM_MASK_OVERFLOW; + } + if ( fle_mask & FLE_MASK_UNDERFLOW ) + { + mx |= _MM_MASK_UNDERFLOW; + } + + _mm_setcsr( mx ); + +#elif defined( __aarch64__ ) + + // AArch64 (Apple Silicon) + uint64_t fpcr; + __asm__ volatile( "mrs %0, fpcr" + : "=r"( fpcr ) ); + + if ( fle_mask & FLE_MASK_INVALID ) + { + // unset bit 8 (IOE) to mask invalid operations exceptions + fpcr &= ~( 1ull << 8 ); + } + if ( fle_mask & FLE_MASK_DENORM ) + { + // unset bit 15 (IDE) to mask input denormal exceptions + fpcr &= ~( 1ull << 15 ); + } + if ( fle_mask & FLE_MASK_DIV_ZERO ) + { + // unset bit 9 (DZE) to mask div_zero exceptions + fpcr &= ~( 1ull << 9 ); + } + if ( fle_mask & FLE_MASK_OVERFLOW ) + { + // unset bit 10 (OFE) to mask overflow exceptions + fpcr &= ~( 1ull << 10 ); + } + if ( fle_mask & FLE_MASK_UNDERFLOW ) + { + // unset bit 11 (UFE) to mask underflow exceptions + fpcr &= ~( 1ull << 11 ); + } + + + // set bits 24/25 (FZ/DN) again + fpcr |= ( 1ull << 24 ) | ( 1ull << 25 ); + fprintf( stderr, "float_exception_trap(): Setting bits 24/25 (FZ/DN) again\n" ); + + __asm__ volatile( "msr fpcr, %0" ::"r"( fpcr ) ); + +#else + + fprintf( stderr, "float_exception_trap() not supported on platform!\n" ); + +#endif +} diff --git a/lib_dec/acelp_core_dec.c b/lib_dec/acelp_core_dec.c index d488d4479efb0225490c17226df1ef6c3e79afa9..8824a6f840dacbcf36a95e2a5cb73d668bfa7c14 100644 --- a/lib_dec/acelp_core_dec.c +++ b/lib_dec/acelp_core_dec.c @@ -1414,12 +1414,7 @@ ivas_error acelp_core_dec( if ( !st->ppp_mode_dec && ( st->idchan == 0 || st->element_mode != IVAS_CPE_TD || ( st->idchan == 1 && st->element_mode == IVAS_CPE_TD && st->tdm_LRTD_flag ) ) ) { - non_linearity( bwe_exc, bwe_exc_extended, st->hBWE_TD->old_bwe_exc_extended, L_FRAME32k, &st->hBWE_TD->bwe_non_lin_prev_scale, st->coder_type, voice_factors, st->L_frame -#ifdef NONBE_1328_FIX_NON_LINEARITY - , - st->element_mode -#endif - ); + non_linearity( bwe_exc, bwe_exc_extended, st->hBWE_TD->old_bwe_exc_extended, L_FRAME32k, &st->hBWE_TD->bwe_non_lin_prev_scale, st->coder_type, voice_factors, st->L_frame, st->element_mode ); } if ( st->core_brate == FRAME_NO_DATA || st->core_brate == SID_2k40 ) diff --git a/lib_dec/dec_acelp_tcx_main.c b/lib_dec/dec_acelp_tcx_main.c index a591157e44e72a87adab547256f7e80b5326acca..95a3f3275b0e403918159b7d4e6a8a33f3f1214b 100644 --- a/lib_dec/dec_acelp_tcx_main.c +++ b/lib_dec/dec_acelp_tcx_main.c @@ -425,12 +425,7 @@ void dec_acelp_tcx_frame( if ( st->core == ACELP_CORE && st->igf && st->con_tcx == 0 ) { - non_linearity( ptr_bwe_exc, bwe_exc_extended, st->hBWE_TD->old_bwe_exc_extended, L_FRAME32k, &st->hBWE_TD->bwe_non_lin_prev_scale, st->coder_type, voice_factors, st->L_frame -#ifdef NONBE_1328_FIX_NON_LINEARITY - , - st->element_mode -#endif - ); + non_linearity( ptr_bwe_exc, bwe_exc_extended, st->hBWE_TD->old_bwe_exc_extended, L_FRAME32k, &st->hBWE_TD->bwe_non_lin_prev_scale, st->coder_type, voice_factors, st->L_frame, st->element_mode ); /* update the old BWE exe memory */ mvr2r( &old_bwe_exc[L_FRAME32k], st->hBWE_TD->old_bwe_exc, PIT16k_MAX * 2 ); diff --git a/lib_dec/fd_cng_dec.c b/lib_dec/fd_cng_dec.c index 535af8b39cd1963eed0969ac87d24a31a8a18d4c..adca10685d6e1e3bb9e214522e92c5bc7bab6655 100644 --- a/lib_dec/fd_cng_dec.c +++ b/lib_dec/fd_cng_dec.c @@ -34,6 +34,8 @@ EVS Codec 3GPP TS26.443 Nov 04, 2021. Version 12.14.0 / 13.10.0 / 14.6.0 / 15.4.0 / 16.3.0 ====================================================================================*/ +#include "ivas_cnst.h" +#include "ivas_rom_com.h" #include #include #include "options.h" @@ -1100,8 +1102,13 @@ void generate_comfort_noise_dec( scale = 1.f; scaleCldfb = CLDFB_SCALING / hFdCngCom->scalingFactor; +#ifdef NONBE_MDCT_ST_DTX_FIX_SUBOPT_SPATIAL_CNG + c1 = (float) sqrt( hFdCngCom->coherence[0] ); + c2 = (float) sqrt( 1 - hFdCngCom->coherence[0] ); +#else c1 = (float) sqrt( hFdCngCom->coherence ); c2 = (float) sqrt( 1 - hFdCngCom->coherence ); +#endif seed2 = &( hFdCngCom->seed2 ); if ( st->element_mode == IVAS_CPE_MDCT && st->idchan == 1 ) @@ -1114,7 +1121,11 @@ void generate_comfort_noise_dec( if ( hFdCngCom->startBand == 0 ) { +#ifdef NONBE_MDCT_ST_DTX_FIX_SUBOPT_SPATIAL_CNG + if ( ( st->element_mode == IVAS_CPE_MDCT && nchan_out != 1 ) || ( st->element_mode == IVAS_SCE && st->cng_ism_flag ) ) +#else if ( st->element_mode == IVAS_CPE_MDCT || ( st->element_mode == IVAS_SCE && st->cng_ism_flag ) ) +#endif { rand_gauss( &tmp1, seed ); rand_gauss( &tmp2, seed2 ); @@ -1136,10 +1147,102 @@ void generate_comfort_noise_dec( } ptr_i = ptr_r + 1; +#ifdef NONBE_MDCT_ST_DTX_FIX_SUBOPT_SPATIAL_CNG + if ( st->element_mode == IVAS_CPE_MDCT && nchan_out != 1 ) + { + int16_t band_len_accu; + + band_len_accu = 0; + i = 0; + for ( int16_t b = 0; b < MDCT_ST_DTX_NUM_COHERENCE_BANDS; b++ ) + { + band_len_accu += mdct_stereo_dtx_coherence_bandlengths[b]; + + /* First band needs to be shortened. The offset from encoder-side estimation is already in, so add it back here */ + if ( b == 0 ) + { + band_len_accu += MDCT_ST_DTX_FIRST_BAND_OFFSET - hFdCngCom->startBand; + } + + /* + * for last band, we need to keep going until the end of the fft section - if there is still any + * this way, the coherence value of the last band is used for eveyrthing above as well + */ + if ( b == MDCT_ST_DTX_NUM_COHERENCE_BANDS - 1 ) + { + band_len_accu = max( band_len_accu, hFdCngCom->stopFFTbin - hFdCngCom->startBand ); + } + + /* mixing values for coherence is now frequency-dependent */ + c1 = (float) sqrt( hFdCngCom->coherence[b] ); + c2 = (float) sqrt( 1 - hFdCngCom->coherence[b] ); + + for ( ; i < band_len_accu; i++ ) + { + float val_level; + val_level = (float) sqrt( ( scale * *ptr_level ) * 0.5f ); + + /* Real part in FFT bins */ + rand_gauss( &tmp1, seed ); + rand_gauss( &tmp2, seed2 ); + *ptr_r = tmp1 * c1 + tmp2 * c2; + ( *ptr_r ) *= val_level; + + /* Imaginary part in FFT bins */ + rand_gauss( &tmp1, seed ); + rand_gauss( &tmp2, seed2 ); + *ptr_i = tmp1 * c1 + tmp2 * c2; + ( *ptr_i ) *= val_level; + + /* advance all pointers together here */ + ptr_r += 2; + ptr_i += 2; + ptr_level++; + } + } + } + else + { + for ( ; ptr_level < cngNoiseLevel + hFdCngCom->stopFFTbin - hFdCngCom->startBand; ptr_level++ ) + { + /* Real part in FFT bins */ + if ( st->element_mode == IVAS_SCE && st->cng_ism_flag ) + { + rand_gauss( &tmp1, seed ); + rand_gauss( &tmp2, seed2 ); + *ptr_r = tmp1 * c1 + tmp2 * c2; + } + else + { + rand_gauss( ptr_r, seed ); + } + ( *ptr_r ) *= (float) sqrt( ( scale * *ptr_level ) * 0.5f ); + ptr_r += 2; + + /* Imaginary part in FFT bins */ + if ( st->element_mode == IVAS_SCE && st->cng_ism_flag ) + { + rand_gauss( &tmp1, seed ); + rand_gauss( &tmp2, seed2 ); + *ptr_i = tmp1 * c1 + tmp2 * c2; + } + else + { + rand_gauss( ptr_i, seed ); + } + ( *ptr_i ) *= (float) sqrt( ( scale * *ptr_level ) * 0.5f ); + ptr_i += 2; + } + } +#else for ( ; ptr_level < cngNoiseLevel + hFdCngCom->stopFFTbin - hFdCngCom->startBand; ptr_level++ ) { /* Real part in FFT bins */ +#ifdef NONBE_MDCT_ST_DTX_FIX_SUBOPT_SPATIAL_CNG + if ( ( st->element_mode == IVAS_CPE_MDCT && nchan_out != 1 ) || ( st->element_mode == IVAS_SCE && st->cng_ism_flag ) ) +#else if ( st->element_mode == IVAS_CPE_MDCT || ( st->element_mode == IVAS_SCE && st->cng_ism_flag ) ) +#endif { rand_gauss( &tmp1, seed ); rand_gauss( &tmp2, seed2 ); @@ -1153,7 +1256,11 @@ void generate_comfort_noise_dec( ptr_r += 2; /* Imaginary part in FFT bins */ +#ifdef NONBE_MDCT_ST_DTX_FIX_SUBOPT_SPATIAL_CNG + if ( ( st->element_mode == IVAS_CPE_MDCT && nchan_out != 1 ) || ( st->element_mode == IVAS_SCE && st->cng_ism_flag ) ) +#else if ( st->element_mode == IVAS_CPE_MDCT || ( st->element_mode == IVAS_SCE && st->cng_ism_flag ) ) +#endif { rand_gauss( &tmp1, seed ); rand_gauss( &tmp2, seed2 ); @@ -1166,6 +1273,7 @@ void generate_comfort_noise_dec( ( *ptr_i ) *= (float) sqrt( ( scale * *ptr_level ) * 0.5f ); ptr_i += 2; } +#endif /* Remaining FFT bins are set to zero */ set_f( fftBuffer + 2 * hFdCngCom->stopFFTbin, 0.0f, hFdCngCom->fftlen - 2 * hFdCngCom->stopFFTbin ); @@ -1224,6 +1332,13 @@ void generate_comfort_noise_dec( /* Generate Gaussian random noise in real and imaginary parts of the CLDFB bands Amplitudes are adjusted to the estimated noise level cngNoiseLevel in each band */ +#ifdef NONBE_MDCT_ST_DTX_FIX_SUBOPT_SPATIAL_CNG + /* + * Note: for the stereo DTX noise mixing, c1 and c2 at this point are set to the value calculated for the last band + * as all the coherence bands are in the FFT region, we do not need the special handling here + */ +#endif + if ( bufferReal != NULL && hFdCngCom->numCoreBands < hFdCngCom->regularStopBand ) { for ( j = hFdCngCom->numCoreBands; j < hFdCngCom->regularStopBand; j++ ) @@ -1231,7 +1346,11 @@ void generate_comfort_noise_dec( for ( i = 0; i < hFdCngCom->numSlots; i++ ) { /* Real part in CLDFB band */ +#ifdef NONBE_MDCT_ST_DTX_FIX_SUBOPT_SPATIAL_CNG + if ( ( st->element_mode == IVAS_CPE_MDCT && nchan_out != 1 ) || ( st->element_mode == IVAS_SCE && st->cng_ism_flag ) ) +#else if ( st->element_mode == IVAS_CPE_MDCT || ( st->element_mode == IVAS_SCE && st->cng_ism_flag ) ) +#endif { rand_gauss( &tmp1, seed ); rand_gauss( &tmp2, seed2 ); @@ -1244,7 +1363,11 @@ void generate_comfort_noise_dec( bufferReal[i][j] *= (float) sqrt( ( scaleCldfb * *ptr_level ) * 0.5f ); /* Imaginary part in CLDFB band */ +#ifdef NONBE_MDCT_ST_DTX_FIX_SUBOPT_SPATIAL_CNG + if ( ( st->element_mode == IVAS_CPE_MDCT && nchan_out != 1 ) || ( st->element_mode == IVAS_SCE && st->cng_ism_flag ) ) +#else if ( st->element_mode == IVAS_CPE_MDCT || ( st->element_mode == IVAS_SCE && st->cng_ism_flag ) ) +#endif { rand_gauss( &tmp1, seed ); rand_gauss( &tmp2, seed2 ); @@ -1361,8 +1484,14 @@ void generate_comfort_noise_dec_hf( { seed2 = &( hFdCngCom->seed2 ); +#ifdef NONBE_MDCT_ST_DTX_FIX_SUBOPT_SPATIAL_CNG + /* alwas use the value for the last band - frequency-wise we are here always above */ + c1 = (float) sqrt( hFdCngCom->coherence[MDCT_ST_DTX_NUM_COHERENCE_BANDS - 1] ); + c2 = (float) sqrt( 1 - hFdCngCom->coherence[MDCT_ST_DTX_NUM_COHERENCE_BANDS - 1] ); +#else c1 = (float) sqrt( hFdCngCom->coherence ); c2 = (float) sqrt( 1 - hFdCngCom->coherence ); +#endif } ptr_level = hFdCngCom->cngNoiseLevel + hFdCngCom->stopFFTbin - hFdCngCom->startBand; @@ -2106,7 +2235,9 @@ void FdCngDecodeMDCTStereoSID( int16_t is_out_ms; float *invTrfMatrix; float tmpRAM[FDCNG_VQ_MAX_LEN][FDCNG_VQ_DCT_MAXTRUNC]; - +#ifdef NONBE_MDCT_ST_DTX_FIX_SUBOPT_SPATIAL_CNG + int32_t tmp; +#endif invTrfMatrix = (float *) tmpRAM; create_IDCT_N_Matrix( invTrfMatrix, FDCNG_VQ_MAX_LEN, FDCNG_VQ_DCT_MAXTRUNC, sizeof( tmpRAM ) / ( sizeof( float ) ) ); @@ -2156,7 +2287,22 @@ void FdCngDecodeMDCTStereoSID( msvq_dec( cdk_37bits_ivas, NULL, NULL, stages, N, FD_CNG_maxN_37bits, indices, 1, invTrfMatrix, ms_ptr[ch], NULL ); } +#ifdef NONBE_MDCT_ST_DTX_FIX_SUBOPT_SPATIAL_CNG + tmp = sts[1]->total_brate; + sts[1]->total_brate = sts[1]->total_brate + 16 * FRAMES_PER_SEC; + /* read the four additional coherence values */ + for ( int16_t b = 1; b < MDCT_ST_DTX_NUM_COHERENCE_BANDS; b++ ) + { + uint16_t tmp_bit; + + tmp_bit = get_next_indice( sts[1], 4 ); + sts[0]->hFdCngDec->hFdCngCom->coherence[b] = (float) tmp_bit / 15.f; + sts[1]->hFdCngDec->hFdCngCom->coherence[b] = sts[0]->hFdCngDec->hFdCngCom->coherence[b]; + } + sts[1]->total_brate = tmp; +#else dtx_read_padding_bits( sts[1], ( IVAS_SID_5k2 - 4400 ) / FRAMES_PER_SEC ); +#endif if ( sts[0]->hFdCngDec->hFdCngCom->no_side_flag ) { @@ -2267,8 +2413,16 @@ void FdCngDecodeDiracMDCTStereoSID( lpc_from_spectrum( hFdCngCom, hFdCngCom->startBand, hFdCngCom->stopFFTbin, sts[ch]->preemph_fac ); } +#ifdef NONBE_MDCT_ST_DTX_FIX_SUBOPT_SPATIAL_CNG + for ( i = 0; i < MDCT_ST_DTX_NUM_COHERENCE_BANDS; i++ ) + { + sts[0]->hFdCngDec->hFdCngCom->coherence[i] = 0.0f; + sts[1]->hFdCngDec->hFdCngCom->coherence[i] = 0.0f; + } +#else sts[0]->hFdCngDec->hFdCngCom->coherence = 0.0f; sts[1]->hFdCngDec->hFdCngCom->coherence = 0.0f; +#endif if ( hCPE->nchan_out == 1 ) { diff --git a/lib_dec/igf_dec.c b/lib_dec/igf_dec.c index dac1f0278798fbd1917b81843c226da15fb77eb8..8f91c43fb2282956044fa51d42850d9407e7a44f 100755 --- a/lib_dec/igf_dec.c +++ b/lib_dec/igf_dec.c @@ -1573,6 +1573,7 @@ void IGFDecRestoreTCX10SubFrameData( return; } + /*-----------------------------------------------------------------------* * init_igf_dec() * @@ -1592,6 +1593,7 @@ void init_igf_dec( hIGFDec->flag_sparse = &hIGFDec->flag_sparseBuf[0]; hIGFDec->infoTCXNoise = &hIGFDec->infoTCXNoiseBuf[0]; hIGFDec->virtualSpec = &hIGFDec->virtualSpecBuf[0]; + hIGFDec->infoIGFStopFreq = 0; return; } diff --git a/lib_dec/ivas_binRenderer_internal.c b/lib_dec/ivas_binRenderer_internal.c index 8cda55017c4e8c4a8be270e89da91b594acade35..60808714ca483d496c57d63a40762cf7a116930a 100644 --- a/lib_dec/ivas_binRenderer_internal.c +++ b/lib_dec/ivas_binRenderer_internal.c @@ -795,8 +795,6 @@ ivas_error ivas_rend_openCldfbRend( int16_t convBand; ivas_error error; - error = IVAS_ERR_OK; - /*-----------------------------------------------------------------* * prepare library opening *-----------------------------------------------------------------*/ @@ -866,7 +864,7 @@ ivas_error ivas_rend_openCldfbRend( pCldfbRend->hCldfbRend = hBinRenderer; - return error; + return IVAS_ERR_OK; } @@ -885,8 +883,6 @@ ivas_error ivas_binRenderer_open( ivas_error error; const IVAS_ROOM_ACOUSTICS_CONFIG_DATA *pRoomAcoustics; - error = IVAS_ERR_OK; - /*-----------------------------------------------------------------* * prepare library opening *-----------------------------------------------------------------*/ @@ -1030,7 +1026,11 @@ ivas_error ivas_binRenderer_open( ivas_dirac_dec_get_response( (int16_t) ls_azimuth_CICP19[k], (int16_t) ls_elevation_CICP19[k], hBinRenderer->hReverb->foa_enc[k], 1 ); } } +#ifdef IVAS_RTPDUMP + else if ( st_ivas->ivas_format == MC_FORMAT && ( st_ivas->hDecoderConfig->Opt_Headrotation || st_ivas->hDecoderConfig->Opt_ExternalOrientation || st_ivas->hCombinedOrientationData ) ) +#else else if ( st_ivas->ivas_format == MC_FORMAT && ( st_ivas->hDecoderConfig->Opt_Headrotation || st_ivas->hDecoderConfig->Opt_ExternalOrientation ) ) +#endif { if ( ( error = efap_init_data( &( st_ivas->hEFAPdata ), st_ivas->hIntSetup.ls_azimuth, st_ivas->hIntSetup.ls_elevation, st_ivas->hIntSetup.nchan_out_woLFE, EFAP_MODE_EFAP ) ) != IVAS_ERR_OK ) { @@ -1045,7 +1045,7 @@ ivas_error ivas_binRenderer_open( /* Copy the handles to main handle */ st_ivas->hBinRenderer = hBinRenderer; - return error; + return IVAS_ERR_OK; } @@ -1285,293 +1285,6 @@ void ivas_binaural_add_LFE( } -#ifdef DEBUGGING -/*-------------------------------------------------------------------------* - * ivas_binaural_cldfb() - * - * Perform CLDFB analysis, fastconv binaural rendering and CLDFB synthesis - *-------------------------------------------------------------------------*/ - -void ivas_binaural_cldfb( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ - float *output_f[] /* i/o: synthesized core-coder transport channels/DirAC output */ -) -{ - float Cldfb_RealBuffer[MAX_INTERN_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; - float Cldfb_ImagBuffer[MAX_INTERN_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; - float Cldfb_RealBuffer_Binaural[MAX_HEAD_ROT_POSES][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; - float Cldfb_ImagBuffer_Binaural[MAX_HEAD_ROT_POSES][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; - int16_t slot_idx, subframeIdx, index_slot, idx_in, idx_lfe, maxBand, ch; - - /* Implement a 5 msec loops */ - maxBand = (int16_t) ( ( CLDFB_NO_CHANNELS_MAX * st_ivas->hDecoderConfig->output_Fs ) / 48000 ); - - for ( subframeIdx = 0; subframeIdx < ( CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES ); subframeIdx++ ) - { - for ( slot_idx = 0; slot_idx < MAX_PARAM_SPATIAL_SUBFRAMES; slot_idx++ ) - { - index_slot = subframeIdx * MAX_PARAM_SPATIAL_SUBFRAMES + slot_idx; - - /* Implement CLDFB analysis */ - idx_in = 0; - idx_lfe = 0; - - for ( ch = 0; ch < ( st_ivas->hIntSetup.nchan_out_woLFE + st_ivas->hIntSetup.num_lfe ); ch++ ) - { - if ( ( st_ivas->hIntSetup.num_lfe > 0 ) && ( st_ivas->hIntSetup.index_lfe[idx_lfe] == ch ) ) - { - if ( idx_lfe < ( st_ivas->hIntSetup.num_lfe - 1 ) ) - { - idx_lfe++; - } - } - else - { - cldfbAnalysis_ts( &( output_f[ch][maxBand * index_slot] ), Cldfb_RealBuffer[idx_in][slot_idx], Cldfb_ImagBuffer[idx_in][slot_idx], maxBand, st_ivas->cldfbAnaDec[idx_in] ); - idx_in++; - } - } - /*LFE handling for split rendering cases*/ - if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) - { - for ( idx_lfe = 0; idx_lfe < st_ivas->hIntSetup.num_lfe; idx_lfe++ ) - { - ch = st_ivas->hIntSetup.index_lfe[idx_lfe]; - cldfbAnalysis_ts( &( output_f[ch][maxBand * index_slot] ), Cldfb_RealBuffer[idx_in][slot_idx], Cldfb_ImagBuffer[idx_in][slot_idx], maxBand, st_ivas->cldfbAnaDec[idx_in] ); - idx_in++; - } - - if ( st_ivas->hSplitBinRend->hCldfbDataOut != NULL ) - { - for ( ch = 0; ch < ( st_ivas->hIntSetup.nchan_out_woLFE + st_ivas->hIntSetup.num_lfe ); ch++ ) - { - mvr2r( Cldfb_RealBuffer[ch][slot_idx], st_ivas->hSplitBinRend->hCldfbDataOut->Cldfb_RealBuffer[ch][( subframeIdx * JBM_CLDFB_SLOTS_IN_SUBFRAME ) + slot_idx], maxBand ); - mvr2r( Cldfb_ImagBuffer[ch][slot_idx], st_ivas->hSplitBinRend->hCldfbDataOut->Cldfb_ImagBuffer[ch][( subframeIdx * JBM_CLDFB_SLOTS_IN_SUBFRAME ) + slot_idx], maxBand ); - } - st_ivas->hSplitBinRend->hCldfbDataOut->config = st_ivas->hIntSetup.output_config; - } - } - } - - /* Implement binaural rendering */ - ivas_binRenderer( - st_ivas->hBinRenderer, - &st_ivas->hSplitBinRend->splitrend.multiBinPoseData, - st_ivas->hCombinedOrientationData, - JBM_CLDFB_SLOTS_IN_SUBFRAME, -#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG - NULL, -#endif - Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, - Cldfb_RealBuffer, Cldfb_ImagBuffer ); - - if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) - { - int16_t pos_idx; - for ( slot_idx = 0; slot_idx < JBM_CLDFB_SLOTS_IN_SUBFRAME; slot_idx++ ) - { - if ( st_ivas->hIntSetup.num_lfe > 0 ) - { - v_multc( Cldfb_RealBuffer[st_ivas->hIntSetup.nchan_out_woLFE][slot_idx], GAIN_LFE, Cldfb_RealBuffer[st_ivas->hIntSetup.nchan_out_woLFE][slot_idx], maxBand ); - v_multc( Cldfb_ImagBuffer[st_ivas->hIntSetup.nchan_out_woLFE][slot_idx], GAIN_LFE, Cldfb_ImagBuffer[st_ivas->hIntSetup.nchan_out_woLFE][slot_idx], maxBand ); - } - } - - for ( pos_idx = 0; pos_idx < st_ivas->hBinRenderer->numPoses; pos_idx++ ) - { - for ( slot_idx = 0; slot_idx < JBM_CLDFB_SLOTS_IN_SUBFRAME; slot_idx++ ) - { - for ( ch = 0; ch < st_ivas->hDecoderConfig->nchan_out; ch++ ) - { - if ( st_ivas->hIntSetup.num_lfe > 0 ) - { - v_add( Cldfb_RealBuffer_Binaural[pos_idx][ch][slot_idx], - Cldfb_RealBuffer[st_ivas->hIntSetup.nchan_out_woLFE][slot_idx], - Cldfb_RealBuffer_Binaural[pos_idx][ch][slot_idx], - maxBand ); - - v_add( Cldfb_ImagBuffer_Binaural[pos_idx][ch][slot_idx], - Cldfb_ImagBuffer[st_ivas->hIntSetup.nchan_out_woLFE][slot_idx], - Cldfb_ImagBuffer_Binaural[pos_idx][ch][slot_idx], - maxBand ); - } - - mvr2r( Cldfb_RealBuffer_Binaural[pos_idx][ch][slot_idx], st_ivas->hSplitBinRend->hMultiBinCldfbData->Cldfb_RealBuffer_Binaural[( pos_idx * BINAURAL_CHANNELS ) + ch][( subframeIdx * JBM_CLDFB_SLOTS_IN_SUBFRAME ) + slot_idx], maxBand ); - mvr2r( Cldfb_ImagBuffer_Binaural[pos_idx][ch][slot_idx], st_ivas->hSplitBinRend->hMultiBinCldfbData->Cldfb_ImagBuffer_Binaural[( pos_idx * BINAURAL_CHANNELS ) + ch][( subframeIdx * JBM_CLDFB_SLOTS_IN_SUBFRAME ) + slot_idx], maxBand ); - } - } - } - } - - /* update combined orientation access index */ - ivas_combined_orientation_update_index( st_ivas->hCombinedOrientationData, maxBand * MAX_PARAM_SPATIAL_SUBFRAMES ); - - /* Implement CLDFB synthesis */ - for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) - { - float *RealBuffer[MAX_PARAM_SPATIAL_SUBFRAMES]; - float *ImagBuffer[MAX_PARAM_SPATIAL_SUBFRAMES]; - - index_slot = subframeIdx * MAX_PARAM_SPATIAL_SUBFRAMES; - - for ( slot_idx = 0; slot_idx < MAX_PARAM_SPATIAL_SUBFRAMES; slot_idx++ ) - { - RealBuffer[slot_idx] = Cldfb_RealBuffer_Binaural[0][ch][slot_idx]; - ImagBuffer[slot_idx] = Cldfb_ImagBuffer_Binaural[0][ch][slot_idx]; - } - - cldfbSynthesis( RealBuffer, ImagBuffer, &( output_f[ch][index_slot * maxBand] ), maxBand * MAX_PARAM_SPATIAL_SUBFRAMES, st_ivas->cldfbSynDec[ch] ); - } - } - - return; -} - - -/*-------------------------------------------------------------------------* - * ivas_binaural_cldfb_sf() - * - * Perform CLDFB analysis, fastconv binaural rendering and CLDFB synthesis - *-------------------------------------------------------------------------*/ - -void ivas_binaural_cldfb_sf( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ - const int16_t n_samples_to_render, /* i : output frame length per channel */ - const int16_t slot_size, /* i : JBM slot size */ - float *output_f[] /* i/o: synthesized core-coder transport channels/DirAC output */ -) -{ - float Cldfb_RealBuffer[MAX_INTERN_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; - float Cldfb_ImagBuffer[MAX_INTERN_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; - float Cldfb_RealBuffer_Binaural[MAX_HEAD_ROT_POSES][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; - float Cldfb_ImagBuffer_Binaural[MAX_HEAD_ROT_POSES][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; - int16_t slot_idx, subframeIdx, index_slot, idx_in, idx_lfe, maxBand, ch; - int16_t slots_to_render, first_sf, last_sf; - int16_t slot_index_start, slot_index_start_cldfb; - - /* Implement a 5 msec loops */ - maxBand = (int16_t) ( ( CLDFB_NO_CHANNELS_MAX * st_ivas->hDecoderConfig->output_Fs ) / 48000 ); - - /* loop for synthesis, assume we always have to render in multiples of 5ms subframes with spills */ - slots_to_render = min( st_ivas->hTcBuffer->num_slots - st_ivas->hTcBuffer->slots_rendered, n_samples_to_render / slot_size ); - first_sf = st_ivas->hTcBuffer->subframes_rendered; - last_sf = first_sf; - slot_index_start = st_ivas->hTcBuffer->slots_rendered; - slot_index_start_cldfb = 0; - st_ivas->hTcBuffer->slots_rendered += slots_to_render; - - while ( slots_to_render > 0 ) - { - slots_to_render -= st_ivas->hTcBuffer->subframe_nbslots[last_sf]; - last_sf++; - } - for ( subframeIdx = first_sf; subframeIdx < last_sf; subframeIdx++ ) - { - for ( slot_idx = 0; slot_idx < st_ivas->hTcBuffer->subframe_nbslots[subframeIdx]; slot_idx++ ) - { - index_slot = slot_index_start + slot_idx; - - /* Implement CLDFB analysis */ - idx_in = 0; - idx_lfe = 0; - - for ( ch = 0; ch < ( st_ivas->hIntSetup.nchan_out_woLFE + st_ivas->hIntSetup.num_lfe ); ch++ ) - { - if ( ( st_ivas->hIntSetup.num_lfe > 0 ) && ( st_ivas->hIntSetup.index_lfe[idx_lfe] == ch ) ) - { - if ( idx_lfe < ( st_ivas->hIntSetup.num_lfe - 1 ) ) - { - idx_lfe++; - } - } - else - { - cldfbAnalysis_ts( &( st_ivas->hTcBuffer->tc[ch][maxBand * index_slot] ), Cldfb_RealBuffer[idx_in][slot_idx], Cldfb_ImagBuffer[idx_in][slot_idx], maxBand, st_ivas->cldfbAnaDec[idx_in] ); - idx_in++; - } - } - - /*LFE handling for split rendering cases*/ - if ( ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || - ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) - { - for ( idx_lfe = 0; idx_lfe < st_ivas->hIntSetup.num_lfe; idx_lfe++ ) - { - ch = st_ivas->hIntSetup.index_lfe[idx_lfe]; - cldfbAnalysis_ts( &( output_f[ch][maxBand * index_slot] ), Cldfb_RealBuffer[idx_in][slot_idx], Cldfb_ImagBuffer[idx_in][slot_idx], maxBand, st_ivas->cldfbAnaDec[idx_in] ); - idx_in++; - } - - if ( st_ivas->hSplitBinRend->hCldfbDataOut != NULL ) - { - for ( ch = 0; ch < ( st_ivas->hIntSetup.nchan_out_woLFE + st_ivas->hIntSetup.num_lfe ); ch++ ) - { - mvr2r( Cldfb_RealBuffer[ch][slot_idx], st_ivas->hSplitBinRend->hCldfbDataOut->Cldfb_RealBuffer[ch][slot_index_start + slot_idx], maxBand ); - mvr2r( Cldfb_ImagBuffer[ch][slot_idx], st_ivas->hSplitBinRend->hCldfbDataOut->Cldfb_ImagBuffer[ch][slot_index_start + slot_idx], maxBand ); - } - st_ivas->hSplitBinRend->hCldfbDataOut->config = st_ivas->hIntSetup.output_config; - } - } - } - - /* Implement binaural rendering */ - ivas_binRenderer( - st_ivas->hBinRenderer, - &st_ivas->hSplitBinRend->splitrend.multiBinPoseData, - st_ivas->hCombinedOrientationData, - st_ivas->hTcBuffer->subframe_nbslots[subframeIdx], -#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG - NULL, -#endif - Cldfb_RealBuffer_Binaural, - Cldfb_ImagBuffer_Binaural, - Cldfb_RealBuffer, - Cldfb_ImagBuffer ); - - if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) - { - int16_t pos_idx; - for ( pos_idx = 0; pos_idx < st_ivas->hBinRenderer->numPoses; pos_idx++ ) - { - for ( slot_idx = 0; slot_idx < st_ivas->hTcBuffer->subframe_nbslots[subframeIdx]; slot_idx++ ) - { - for ( ch = 0; ch < st_ivas->hDecoderConfig->nchan_out; ch++ ) - { - mvr2r( Cldfb_RealBuffer_Binaural[pos_idx][ch][slot_idx], st_ivas->hSplitBinRend->hMultiBinCldfbData->Cldfb_RealBuffer_Binaural[( pos_idx * BINAURAL_CHANNELS ) + ch][slot_index_start + slot_idx], maxBand ); - mvr2r( Cldfb_ImagBuffer_Binaural[pos_idx][ch][slot_idx], st_ivas->hSplitBinRend->hMultiBinCldfbData->Cldfb_ImagBuffer_Binaural[( pos_idx * BINAURAL_CHANNELS ) + ch][slot_index_start + slot_idx], maxBand ); - } - } - } - } - - /* update combined orientation access index */ - ivas_combined_orientation_update_index( st_ivas->hCombinedOrientationData, maxBand * st_ivas->hTcBuffer->subframe_nbslots[subframeIdx] ); - - /* Implement CLDFB synthesis */ - for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) - { - float *RealBuffer[MAX_PARAM_SPATIAL_SUBFRAMES]; - float *ImagBuffer[MAX_PARAM_SPATIAL_SUBFRAMES]; - - for ( slot_idx = 0; slot_idx < st_ivas->hTcBuffer->subframe_nbslots[subframeIdx]; slot_idx++ ) - { - RealBuffer[slot_idx] = Cldfb_RealBuffer_Binaural[0][ch][slot_idx]; - ImagBuffer[slot_idx] = Cldfb_ImagBuffer_Binaural[0][ch][slot_idx]; - } - - cldfbSynthesis( RealBuffer, ImagBuffer, &( output_f[ch][slot_index_start_cldfb * maxBand] ), maxBand * st_ivas->hTcBuffer->subframe_nbslots[subframeIdx], st_ivas->cldfbSynDec[ch] ); - } - slot_index_start += st_ivas->hTcBuffer->subframe_nbslots[subframeIdx]; - slot_index_start_cldfb += st_ivas->hTcBuffer->subframe_nbslots[subframeIdx]; - } - - st_ivas->hTcBuffer->subframes_rendered = last_sf; - - return; -} -#endif - - /*------------------------------------------------------------------------- * ivas_binRenderer() * diff --git a/lib_dec/ivas_decision_matrix_dec.c b/lib_dec/ivas_decision_matrix_dec.c index 47e862786584657e426502a02d519f1ad2d6e8f5..da624d5a66125d9c37d193e8f65c276e6d6556dd 100644 --- a/lib_dec/ivas_decision_matrix_dec.c +++ b/lib_dec/ivas_decision_matrix_dec.c @@ -104,7 +104,11 @@ void ivas_decision_matrix_dec( else if ( st->total_brate == SID_2k40 && st->idchan == 1 && st->element_mode == IVAS_CPE_MDCT && st->cng_sba_flag == 0 ) { /* read channel coherence */ +#ifdef NONBE_MDCT_ST_DTX_FIX_SUBOPT_SPATIAL_CNG + st->hFdCngDec->hFdCngCom->coherence[0] = (float) get_next_indice( st, 4 ) / 15.f; +#else st->hFdCngDec->hFdCngCom->coherence = (float) get_next_indice( st, 4 ) / 15.f; +#endif /* read flag for no side noise shape */ st->hFdCngDec->hFdCngCom->no_side_flag = get_next_indice( st, 1 ); diff --git a/lib_dec/ivas_dirac_dec.c b/lib_dec/ivas_dirac_dec.c index afec2bf9579aadc77d0ef89f94e97186cc096c48..caa956051caa0c803556029fe925ed12a3d182ca 100644 --- a/lib_dec/ivas_dirac_dec.c +++ b/lib_dec/ivas_dirac_dec.c @@ -1636,7 +1636,9 @@ static void binRenderer_split( float Cldfb_ImagBuffer_Binaural[][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* o : Rotated Binaural signals */ float RealBuffer[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* i : LS signals */ float ImagBuffer[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* i : LS signals */ +#ifndef FIX_1119_SPLIT_RENDERING_VOIP const int16_t slot_idx_start, +#endif const int16_t num_freq_bands, const int16_t nchan_out ) { @@ -1666,8 +1668,16 @@ static void binRenderer_split( { for ( ch = 0; ch < nchan_out; ch++ ) { +#ifdef FIX_1119_SPLIT_RENDERING_VOIP + ivas_CLDFB_RINGBUF_Push( + hSplitBinRend->hMultiBinCldfbData[pos_idx * BINAURAL_CHANNELS + ch], + Cldfb_RealBuffer_Binaural_loc[pos_idx][ch][slot_idx], + Cldfb_ImagBuffer_Binaural_loc[pos_idx][ch][slot_idx], + num_freq_bands ); +#else mvr2r( Cldfb_RealBuffer_Binaural_loc[pos_idx][ch][slot_idx], hSplitBinRend->hMultiBinCldfbData->Cldfb_RealBuffer_Binaural[( pos_idx * BINAURAL_CHANNELS ) + ch][slot_idx_start + slot_idx], num_freq_bands ); mvr2r( Cldfb_ImagBuffer_Binaural_loc[pos_idx][ch][slot_idx], hSplitBinRend->hMultiBinCldfbData->Cldfb_ImagBuffer_Binaural[( pos_idx * BINAURAL_CHANNELS ) + ch][slot_idx_start + slot_idx], num_freq_bands ); +#endif } } } @@ -2071,7 +2081,11 @@ void ivas_dirac_dec_render_sf( { mvs2s( &hSpatParamRendCom->azimuth[md_idx][hDirAC->hConfig->enc_param_start_band], &azimuth[hDirAC->hConfig->enc_param_start_band], hSpatParamRendCom->num_freq_bands - hDirAC->hConfig->enc_param_start_band ); mvs2s( &hSpatParamRendCom->elevation[md_idx][hDirAC->hConfig->enc_param_start_band], &elevation[hDirAC->hConfig->enc_param_start_band], hSpatParamRendCom->num_freq_bands - hDirAC->hConfig->enc_param_start_band ); +#ifdef IVAS_RTPDUMP + if ( ( st_ivas->hDecoderConfig->Opt_Headrotation || st_ivas->hDecoderConfig->Opt_ExternalOrientation || st_ivas->hCombinedOrientationData ) && st_ivas->hCombinedOrientationData->shd_rot_max_order == 0 ) +#else if ( ( st_ivas->hDecoderConfig->Opt_Headrotation || st_ivas->hDecoderConfig->Opt_ExternalOrientation ) && st_ivas->hCombinedOrientationData->shd_rot_max_order == 0 ) +#endif { num_freq_bands = hDirAC->band_grouping[hDirAC->hConfig->enc_param_start_band]; rotateAziEle_DirAC( azimuth, elevation, num_freq_bands, hSpatParamRendCom->num_freq_bands, p_Rmat ); @@ -2388,7 +2402,11 @@ void ivas_dirac_dec_render_sf( if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { binRenderer_split( st_ivas->hBinRenderer, st_ivas->hSplitBinRend, st_ivas->hCombinedOrientationData, hSpatParamRendCom->subframe_nbslots[subframe_idx], - Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, Cldfb_RealBuffer, Cldfb_ImagBuffer, slot_idx_start, hSpatParamRendCom->num_freq_bands, st_ivas->hDecoderConfig->nchan_out ); + Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, Cldfb_RealBuffer, Cldfb_ImagBuffer, +#ifndef FIX_1119_SPLIT_RENDERING_VOIP + slot_idx_start, +#endif + hSpatParamRendCom->num_freq_bands, st_ivas->hDecoderConfig->nchan_out ); } else { diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index fcb13d2f174b23cf3fd34fcc8879ddebc4009333..cfd999e74ad75acf80a8fd6ad419d6e97beb4c27 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -1154,6 +1154,7 @@ ivas_error ivas_init_decoder_front( st_ivas->ism_mode = ISM_MODE_NONE; st_ivas->mc_mode = MC_MODE_NONE; + st_ivas->sid_format = SID_FORMAT_NONE; st_ivas->sba_dirac_stereo_flag = 0; /* HRTF binauralization latency in ns */ @@ -1161,8 +1162,6 @@ ivas_error ivas_init_decoder_front( #ifdef DEBUGGING st_ivas->noClipping = 0; - - st_ivas->hDecoderConfig->force_rend = -1; #endif /*-------------------------------------------------------------------* * Allocate and initialize Custom loudspeaker layout handle @@ -1234,6 +1233,10 @@ ivas_error ivas_init_decoder_front( } } +#ifdef TMP_1342_WORKAROUND_DEC_FLUSH_BROKEN_IN_SR + st_ivas->flushing = 0; +#endif + return error; } @@ -2145,7 +2148,11 @@ ivas_error ivas_init_decoder( } else if ( st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV || st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV_ROOM ) { - if ( st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV_ROOM && st_ivas->ivas_format == MC_FORMAT && ( hDecoderConfig->Opt_Headrotation || hDecoderConfig->Opt_ExternalOrientation ) ) +#ifdef IVAS_RTPDUMP + if ( st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV_ROOM && st_ivas->ivas_format == MC_FORMAT && ( st_ivas->hDecoderConfig->Opt_Headrotation || st_ivas->hDecoderConfig->Opt_ExternalOrientation || st_ivas->hCombinedOrientationData ) ) +#else + if ( st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV_ROOM && st_ivas->ivas_format == MC_FORMAT && ( st_ivas->hDecoderConfig->Opt_Headrotation || st_ivas->hDecoderConfig->Opt_ExternalOrientation ) ) +#endif { if ( ( error = efap_init_data( &( st_ivas->hEFAPdata ), st_ivas->hIntSetup.ls_azimuth, st_ivas->hIntSetup.ls_elevation, st_ivas->hIntSetup.nchan_out_woLFE, EFAP_MODE_EFAP ) ) != IVAS_ERR_OK ) { @@ -2154,7 +2161,7 @@ ivas_error ivas_init_decoder( } if ( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), st_ivas->intern_config, output_config, - st_ivas->hRenderConfig, st_ivas->hHrtfCrend, st_ivas->hHrtfStatistics, st_ivas->hDecoderConfig->output_Fs, 0, ( st_ivas->hSplitBinRend == NULL ) ? 1 : st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses ) ) != IVAS_ERR_OK ) + st_ivas->hRenderConfig, st_ivas->hHrtfCrend, st_ivas->hHrtfStatistics, output_Fs, 0, ( st_ivas->hSplitBinRend == NULL ) ? 1 : st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses ) ) != IVAS_ERR_OK ) { return error; } @@ -3194,21 +3201,10 @@ static ivas_error doSanityChecks_IVAS( } } - if ( st_ivas->hDecoderConfig->Opt_ObjEdit_on & st_ivas->hDecoderConfig->Opt_non_diegetic_pan ) + if ( st_ivas->hDecoderConfig->Opt_ObjEdit_on && st_ivas->hDecoderConfig->Opt_non_diegetic_pan ) { return IVAS_ERROR( IVAS_ERR_OBJECTS_EDITING_AND_PANNING_NOT_SUPPORTED, "Wrong set-up: Only object editing or Non-diegetic panning can be used." ); } -#ifdef DEBUGGING - if ( ( st_ivas->hDecoderConfig->force_rend == FORCE_TD_RENDERER ) && ( ( st_ivas->ivas_format != MC_FORMAT && st_ivas->ivas_format != ISM_FORMAT ) || ( output_config != IVAS_AUDIO_CONFIG_BINAURAL && output_config != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) || ( st_ivas->ivas_format == ISM_FORMAT && st_ivas->ism_mode == ISM_MODE_PARAM ) || ( st_ivas->ivas_format == MC_FORMAT && st_ivas->mc_mode != MC_MODE_MCT ) ) ) - { - return IVAS_ERROR( IVAS_ERR_INVALID_OUTPUT_FORMAT, "Incorrect output configuration: Time Domain object renderer not supported in this configuration" ); - } - - if ( ( st_ivas->hHrtfTD != NULL && st_ivas->hDecoderConfig->force_rend == FORCE_CLDFB_RENDERER ) ) - { - return IVAS_ERROR( IVAS_ERR_INVALID_FORCE_MODE, "Incorrect debug configuration: Cannot force CLDFB renderer in combination with TD renderer HRTF file" ); - } -#endif return IVAS_ERR_OK; } diff --git a/lib_dec/ivas_ism_metadata_dec.c b/lib_dec/ivas_ism_metadata_dec.c index 1a1e4161d4d923b2853d0df30f46308240ec037e..5f65826b5ba9f0b5e74ec39808f32279f563e647 100644 --- a/lib_dec/ivas_ism_metadata_dec.c +++ b/lib_dec/ivas_ism_metadata_dec.c @@ -1057,18 +1057,40 @@ void ivas_ism_metadata_sid_dec( { if ( ch == *sce_id_dtx ) { +#ifdef NONBE_MDCT_ST_DTX_FIX_SUBOPT_SPATIAL_CNG + for ( i = 0; i < MDCT_ST_DTX_NUM_COHERENCE_BANDS; i++ ) + { + hSCE[ch]->hCoreCoder[0]->hFdCngDec->hFdCngCom->coherence[i] = 1.0f; + } +#else hSCE[ch]->hCoreCoder[0]->hFdCngDec->hFdCngCom->coherence = 1.0f; +#endif continue; } idx = get_next_indice( st0, nBits_coh ); +#ifdef NONBE_MDCT_ST_DTX_FIX_SUBOPT_SPATIAL_CNG + hSCE[ch]->hCoreCoder[0]->hFdCngDec->hFdCngCom->coherence[0] = (float) ( idx ) / (float) ( ( 1 << nBits_coh ) - 1 ); + for ( i = 1; i < MDCT_ST_DTX_NUM_COHERENCE_BANDS; i++ ) + { + hSCE[ch]->hCoreCoder[0]->hFdCngDec->hFdCngCom->coherence[i] = hSCE[ch]->hCoreCoder[0]->hFdCngDec->hFdCngCom->coherence[0]; + } +#else hSCE[ch]->hCoreCoder[0]->hFdCngDec->hFdCngCom->coherence = (float) ( idx ) / (float) ( ( 1 << nBits_coh ) - 1 ); +#endif } } if ( ism_mode == ISM_MODE_PARAM ) { +#ifdef NONBE_MDCT_ST_DTX_FIX_SUBOPT_SPATIAL_CNG + for ( i = 0; i < MDCT_ST_DTX_NUM_COHERENCE_BANDS; i++ ) + { + hSCE[*sce_id_dtx]->hCoreCoder[0]->hFdCngDec->hFdCngCom->coherence[i] = hSCE[!*sce_id_dtx]->hCoreCoder[0]->hFdCngDec->hFdCngCom->coherence[i]; + } +#else hSCE[*sce_id_dtx]->hCoreCoder[0]->hFdCngDec->hFdCngCom->coherence = hSCE[!*sce_id_dtx]->hCoreCoder[0]->hFdCngDec->hFdCngCom->coherence; +#endif } /*----------------------------------------------------------------* diff --git a/lib_dec/ivas_ism_param_dec.c b/lib_dec/ivas_ism_param_dec.c index aef6407bb625fb588a50204d2c340f1474923af4..f62e4d98d8980a4d2e02aa20d92ee1f4d3827ff8 100644 --- a/lib_dec/ivas_ism_param_dec.c +++ b/lib_dec/ivas_ism_param_dec.c @@ -709,8 +709,9 @@ void ivas_ism_dec_digest_tc( ( st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV_ROOM && st_ivas->hDecoderConfig->Opt_Headrotation == 0 ) ) { int16_t i; +#ifndef NONBE_1412_AVOID_ROUNDING_AZ_ELEV int16_t azimuth, elevation; - +#endif /* we have a full frame interpolator, adapt it */ /* for BE testing */ if ( ( st_ivas->hDecoderConfig->output_Fs / FRAMES_PER_SEC ) == st_ivas->hTcBuffer->n_samples_available ) @@ -753,24 +754,36 @@ void ivas_ism_dec_digest_tc( } else { +#ifndef NONBE_1412_AVOID_ROUNDING_AZ_ELEV // TODO tmu review when #215 is resolved azimuth = (int16_t) floorf( st_ivas->hIsmMetaData[i]->edited_azimuth + 0.5f ); elevation = (int16_t) floorf( st_ivas->hIsmMetaData[i]->edited_elevation + 0.5f ); - +#endif if ( ( st_ivas->renderer_type == RENDERER_TD_PANNING || st_ivas->renderer_type == RENDERER_OSBA_LS || st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV_ROOM || ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM && st_ivas->ivas_format == SBA_ISM_FORMAT && st_ivas->ism_mode == ISM_SBA_MODE_DISC ) ) && st_ivas->hCombinedOrientationData == NULL ) { +#ifdef NONBE_1412_AVOID_ROUNDING_AZ_ELEV + float elevation = st_ivas->hIsmMetaData[i]->edited_elevation; +#endif if ( st_ivas->hIntSetup.is_planar_setup ) { /* If no elevation support in output format, then rendering should be done with zero elevation */ +#ifdef NONBE_1412_AVOID_ROUNDING_AZ_ELEV + elevation = 0.f; +#else elevation = 0; +#endif } if ( st_ivas->hEFAPdata != NULL ) { +#ifdef NONBE_1412_AVOID_ROUNDING_AZ_ELEV + efap_determine_gains( st_ivas->hEFAPdata, st_ivas->hIsmRendererData->gains[i], st_ivas->hIsmMetaData[i]->edited_azimuth, elevation, EFAP_MODE_EFAP ); +#else efap_determine_gains( st_ivas->hEFAPdata, st_ivas->hIsmRendererData->gains[i], azimuth, elevation, EFAP_MODE_EFAP ); +#endif v_multc( st_ivas->hIsmRendererData->gains[i], st_ivas->hIsmMetaData[i]->edited_gain, st_ivas->hIsmRendererData->gains[i], st_ivas->hEFAPdata->numSpk ); } } @@ -778,6 +791,13 @@ void ivas_ism_dec_digest_tc( st_ivas->renderer_type == RENDERER_OSBA_AMBI || st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV ) { +#ifdef NONBE_1412_AVOID_ROUNDING_AZ_ELEV + // TODO tmu review when #215 is resolved + int16_t azimuth, elevation; + + azimuth = (int16_t) floorf( st_ivas->hIsmMetaData[i]->edited_azimuth + 0.5f ); + elevation = (int16_t) floorf( st_ivas->hIsmMetaData[i]->edited_elevation + 0.5f ); +#endif /*get HOA gets for direction (ACN/SN3D)*/ ivas_dirac_dec_get_response( azimuth, elevation, st_ivas->hIsmRendererData->gains[i], st_ivas->hIntSetup.ambisonics_order ); v_multc( st_ivas->hIsmRendererData->gains[i], st_ivas->hIsmMetaData[i]->edited_gain, st_ivas->hIsmRendererData->gains[i], ivas_sba_get_nchan( st_ivas->hIntSetup.ambisonics_order, 0 ) ); @@ -1268,7 +1288,11 @@ void ivas_param_ism_params_to_masa_param_mapping( if ( st_ivas->hISMDTX.dtx_flag ) { float energy_ratio; +#ifdef NONBE_MDCT_ST_DTX_FIX_SUBOPT_SPATIAL_CNG + energy_ratio = powf( st_ivas->hSCE[0]->hCoreCoder[0]->hFdCngDec->hFdCngCom->coherence[0], 2.0f ); +#else energy_ratio = powf( st_ivas->hSCE[0]->hCoreCoder[0]->hFdCngDec->hFdCngCom->coherence, 2.0f ); +#endif hSpatParamRendCom->numSimultaneousDirections = 1; azimuth[0] = (int16_t) roundf( hParamIsmDec->azimuth_values[0] ); diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index 62de06ba286c5e24b2a30a51f4a357be6ef77e7e..cac44973fe793e25c51ae28eb00bd8cfeff7e702 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -1013,12 +1013,6 @@ ivas_error ivas_dec_render( return error; } } -#ifdef DEBUGGING - else if ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV || st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM ) - { - ivas_binaural_cldfb_sf( st_ivas, *nSamplesRendered, st_ivas->hTcBuffer->nb_subframes, p_output ); - } -#endif } } else if ( st_ivas->ivas_format == SBA_FORMAT || st_ivas->ivas_format == MASA_FORMAT ) @@ -1334,6 +1328,12 @@ ivas_error ivas_dec_render( if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { nchan_out_syn_output = BINAURAL_CHANNELS * st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses; +#ifdef TMP_1342_WORKAROUND_DEC_FLUSH_BROKEN_IN_SR + if ( st_ivas->flushing ) + { + nchan_out_syn_output = BINAURAL_CHANNELS; + } +#endif } else { @@ -2290,13 +2290,16 @@ ivas_error ivas_dec_tc_buffer_reconfigure( const int16_t n_samples_granularity /* i : new granularity of the renderer/buffer */ ) { +#ifdef NONBE_1324_TC_BUFFER_MEMOERY_KEEP int16_t ch_idx, num_tc_buffer_mem, n_samples_still_available; float tc_buffer_mem[MAX_INTERN_CHANNELS][L_FRAME48k / MAX_PARAM_SPATIAL_SUBFRAMES - 1]; +#endif ivas_error error; DECODER_TC_BUFFER_HANDLE hTcBuffer; hTcBuffer = st_ivas->hTcBuffer; +#ifdef NONBE_1324_TC_BUFFER_MEMOERY_KEEP num_tc_buffer_mem = 0; n_samples_still_available = 0; @@ -2315,6 +2318,7 @@ ivas_error ivas_dec_tc_buffer_reconfigure( } } +#endif /* if granularity changes, adapt subframe_nb_slots */ if ( n_samples_granularity != hTcBuffer->n_samples_granularity ) { @@ -2354,6 +2358,12 @@ ivas_error ivas_dec_tc_buffer_reconfigure( hTcBuffer->nchan_buffer_full = nchan_full; hTcBuffer->n_samples_granularity = n_samples_granularity; +#ifndef NONBE_1324_TC_BUFFER_MEMOERY_KEEP +#ifdef DEBUGGING + /* what is remaining from last frames needs always be smaller than n_samples_granularity */ + assert( ( hTcBuffer->n_samples_buffered - hTcBuffer->n_samples_rendered ) < n_samples_granularity ); +#endif +#endif /* reallocate TC audio buffers */ ivas_dec_tc_audio_deallocate( hTcBuffer ); @@ -2363,12 +2373,14 @@ ivas_error ivas_dec_tc_buffer_reconfigure( return error; } +#ifdef NONBE_1324_TC_BUFFER_MEMOERY_KEEP /* propagate samples of the TC buffer from the previous frame */ for ( ch_idx = 0; ch_idx < num_tc_buffer_mem; ch_idx++ ) { mvr2r( tc_buffer_mem[ch_idx], hTcBuffer->tc_buffer_old[ch_idx], n_samples_still_available ); } +#endif return IVAS_ERR_OK; } @@ -2920,6 +2932,20 @@ void ivas_dec_prepare_renderer( nchan_transport_ism = st_ivas->nchan_ism; } +#ifdef NONBE_1399_1400_FIX_OBJ_EDIT_ISSUES + if ( st_ivas->hDecoderConfig->Opt_tsm && st_ivas->ism_mode == ISM_MASA_MODE_DISC && st_ivas->renderer_type == RENDERER_DIRAC ) + { + /* Gain MASA part, if edited */ + if ( st_ivas->hMasaIsmData->masa_gain_is_edited ) + { + for ( n = 0; n < CPE_CHANNELS; n++ ) + { + v_multc( st_ivas->hTcBuffer->tc[n], st_ivas->hMasaIsmData->gain_masa_edited, st_ivas->hTcBuffer->tc[n], st_ivas->hTcBuffer->n_samples_available ); + } + } + } +#endif + for ( n = 0; n < nchan_transport_ism; n++ ) { if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC && st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC ) diff --git a/lib_dec/ivas_mc_param_dec.c b/lib_dec/ivas_mc_param_dec.c index aeb5a6045f95b94051b5b005a23b6fb8bc554f27..dfa4f7025ea16c7d0dfe0462269c002a46a8409a 100644 --- a/lib_dec/ivas_mc_param_dec.c +++ b/lib_dec/ivas_mc_param_dec.c @@ -401,7 +401,11 @@ ivas_error ivas_param_mc_dec_open( ivas_param_mc_dec_compute_interpolator( 0, 0, DEFAULT_JBM_CLDFB_TIMESLOTS, hParamMC->h_output_synthesis_params.interpolator ); /* Head or external rotation */ +#ifdef IVAS_RTPDUMP + if ( ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV || st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM ) && ( st_ivas->hDecoderConfig->Opt_Headrotation || st_ivas->hDecoderConfig->Opt_ExternalOrientation || st_ivas->hCombinedOrientationData ) ) +#else if ( ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV || st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM ) && ( st_ivas->hDecoderConfig->Opt_Headrotation || st_ivas->hDecoderConfig->Opt_ExternalOrientation ) ) +#endif { if ( ( hParamMC->hoa_encoder = (float *) malloc( st_ivas->hTransSetup.nchan_out_woLFE * MAX_INTERN_CHANNELS * sizeof( float ) ) ) == NULL ) { @@ -1787,8 +1791,16 @@ void ivas_param_mc_dec_render( { for ( ch = 0; ch < nchan_out_cldfb; ch++ ) { +#ifdef FIX_1119_SPLIT_RENDERING_VOIP + ivas_CLDFB_RINGBUF_Push( + st_ivas->hSplitBinRend->hMultiBinCldfbData[pos_idx * BINAURAL_CHANNELS + ch], + Cldfb_RealBuffer_Binaural[pos_idx][ch][slot_idx], + Cldfb_ImagBuffer_Binaural[pos_idx][ch][slot_idx], + hParamMC->num_freq_bands ); +#else mvr2r( Cldfb_RealBuffer_Binaural[pos_idx][ch][slot_idx], st_ivas->hSplitBinRend->hMultiBinCldfbData->Cldfb_RealBuffer_Binaural[( pos_idx * BINAURAL_CHANNELS ) + ch][slot_idx_start + slot_idx], hParamMC->num_freq_bands ); mvr2r( Cldfb_ImagBuffer_Binaural[pos_idx][ch][slot_idx], st_ivas->hSplitBinRend->hMultiBinCldfbData->Cldfb_ImagBuffer_Binaural[( pos_idx * BINAURAL_CHANNELS ) + ch][slot_idx_start + slot_idx], hParamMC->num_freq_bands ); +#endif } } } diff --git a/lib_dec/ivas_mc_paramupmix_dec.c b/lib_dec/ivas_mc_paramupmix_dec.c index 4c681e80ef3cb0171190a4b1014e75ee78bf587e..55e962b5224f6893677cdb9dcc3e608c290ef2f7 100644 --- a/lib_dec/ivas_mc_paramupmix_dec.c +++ b/lib_dec/ivas_mc_paramupmix_dec.c @@ -349,7 +349,11 @@ ivas_error ivas_mc_paramupmix_dec_open( } /* Head or external rotation */ +#ifdef IVAS_RTPDUMP + if ( ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV || st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM ) && ( st_ivas->hDecoderConfig->Opt_Headrotation || st_ivas->hDecoderConfig->Opt_ExternalOrientation || st_ivas->hCombinedOrientationData ) ) +#else if ( ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV || st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM ) && ( st_ivas->hDecoderConfig->Opt_Headrotation || st_ivas->hDecoderConfig->Opt_ExternalOrientation ) ) +#endif { if ( ( hMCParamUpmix->hoa_encoder = (float *) malloc( st_ivas->hTransSetup.nchan_out_woLFE * MAX_INTERN_CHANNELS * sizeof( float ) ) ) == NULL ) { @@ -791,8 +795,16 @@ static void ivas_mc_paramupmix_dec_sf( { for ( ch = 0; ch < st_ivas->hDecoderConfig->nchan_out; ch++ ) { +#ifdef FIX_1119_SPLIT_RENDERING_VOIP + ivas_CLDFB_RINGBUF_Push( + st_ivas->hSplitBinRend->hMultiBinCldfbData[pos_idx * BINAURAL_CHANNELS + ch], + Cldfb_RealBuffer_Binaural[pos_idx][ch][slot_idx], + Cldfb_ImagBuffer_Binaural[pos_idx][ch][slot_idx], + maxBand ); +#else mvr2r( Cldfb_RealBuffer_Binaural[pos_idx][ch][slot_idx], st_ivas->hSplitBinRend->hMultiBinCldfbData->Cldfb_RealBuffer_Binaural[( pos_idx * BINAURAL_CHANNELS ) + ch][slot_index_start + slot_idx], maxBand ); mvr2r( Cldfb_ImagBuffer_Binaural[pos_idx][ch][slot_idx], st_ivas->hSplitBinRend->hMultiBinCldfbData->Cldfb_ImagBuffer_Binaural[( pos_idx * BINAURAL_CHANNELS ) + ch][slot_index_start + slot_idx], maxBand ); +#endif } } } diff --git a/lib_dec/ivas_mct_dec.c b/lib_dec/ivas_mct_dec.c index 55d1e7d2f4546dad43e5798e1687300ca29a1489..c1664cc5dfb26840aa6322f3cd11e6064c6afe7d 100755 --- a/lib_dec/ivas_mct_dec.c +++ b/lib_dec/ivas_mct_dec.c @@ -1144,7 +1144,11 @@ static ivas_error ivas_mc_dec_reconfig( { ivas_binRenderer_close( &st_ivas->hBinRenderer ); +#ifdef IVAS_RTPDUMP + if ( ( st_ivas->hDecoderConfig->Opt_Headrotation || st_ivas->hDecoderConfig->Opt_ExternalOrientation || st_ivas->hCombinedOrientationData ) ) +#else if ( ( st_ivas->hDecoderConfig->Opt_Headrotation || st_ivas->hDecoderConfig->Opt_ExternalOrientation ) ) +#endif { efap_free_data( &st_ivas->hEFAPdata ); } diff --git a/lib_dec/ivas_mdct_core_dec.c b/lib_dec/ivas_mdct_core_dec.c index 4e7f54eecf52e544508e6174210d44a49c113fa6..9cf401aba420831ffb4701c627136ca1345cb345 100644 --- a/lib_dec/ivas_mdct_core_dec.c +++ b/lib_dec/ivas_mdct_core_dec.c @@ -532,6 +532,7 @@ void ivas_mdct_core_invQ( set_s( total_nbbits, 0, CPE_CHANNELS ); set_s( bitsRead, 0, CPE_CHANNELS ); tmp_concealment_method = 0; + prm_sqQ = NULL; /* set prm_sqQ to NULL - in case of bfi == 1 it's not set or needed, but it triggers sanitizers */ for ( ch = 0; ch < CPE_CHANNELS; ch++ ) { diff --git a/lib_dec/ivas_omasa_dec.c b/lib_dec/ivas_omasa_dec.c index 9d0aa7f753d2dfa3cfc00c652fed13e3e37e20f0..e5035c7a8ac7e7fcc4ba27c3f96283e4b751c788 100644 --- a/lib_dec/ivas_omasa_dec.c +++ b/lib_dec/ivas_omasa_dec.c @@ -680,7 +680,11 @@ void ivas_omasa_dirac_rend( { mvr2r( &output_f[CPE_CHANNELS][st_ivas->hTcBuffer->n_samples_rendered], data_separated_objects[0], *nSamplesRendered ); +#ifdef NONBE_1399_1400_FIX_OBJ_EDIT_ISSUES + if ( st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) +#else if ( !st_ivas->hDecoderConfig->Opt_tsm && st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) +#endif { /* Gain separated object, if edited */ for ( n = 0; n < st_ivas->nchan_ism; n++ ) @@ -699,18 +703,22 @@ void ivas_omasa_dirac_rend( mvr2r( &output_f[n + CPE_CHANNELS][st_ivas->hTcBuffer->n_samples_rendered], data_separated_objects[n], *nSamplesRendered ); /* Gain discrete objects, if edited */ +#ifdef NONBE_1399_1400_FIX_OBJ_EDIT_ISSUES + if ( st_ivas->hMasaIsmData->ism_gain_is_edited[n] ) +#else if ( !st_ivas->hDecoderConfig->Opt_tsm && st_ivas->hMasaIsmData->ism_gain_is_edited[n] ) +#endif { v_multc( data_separated_objects[n], st_ivas->hMasaIsmData->gain_ism_edited[n], data_separated_objects[n], *nSamplesRendered ); } } - /* Gain MASA part, if edited */ + /* Gain MASA part, if edited in G192. MASA gaining with VOIP is done in ivas_dec_prepare_renderer() */ if ( !st_ivas->hDecoderConfig->Opt_tsm && st_ivas->hMasaIsmData->masa_gain_is_edited ) { - for ( int16_t ch = 0; ch < 2; ch++ ) + for ( n = 0; n < CPE_CHANNELS; n++ ) { - v_multc( output_f[ch], st_ivas->hMasaIsmData->gain_masa_edited, output_f[ch], *nSamplesRendered ); + v_multc( output_f[n], st_ivas->hMasaIsmData->gain_masa_edited, output_f[n], *nSamplesRendered ); } } } @@ -744,9 +752,13 @@ ivas_error ivas_omasa_dirac_td_binaural( float data_separated_objects[BINAURAL_CHANNELS][L_FRAME48k]; ivas_error error; float *p_sepobj[BINAURAL_CHANNELS]; +#ifdef FIX_1119_SPLIT_RENDERING_VOIP + float *re, *im; +#else int16_t slot_idx_start; slot_idx_start = st_ivas->hSpatParamRendCom->slots_rendered; +#endif for ( n = 0; n < BINAURAL_CHANNELS; n++ ) { @@ -787,9 +799,14 @@ ivas_error ivas_omasa_dirac_td_binaural( { cldfbAnalysis_ts( &( p_rend_obj[n][num_cldfb_bands * slot_idx] ), Cldfb_RealBuffer, Cldfb_ImagBuffer, num_cldfb_bands, st_ivas->hSplitBinRend->splitrend.hCldfbHandles->cldfbAna[n] ); - /* note: this intentionally differs from OSBA by: no scaling by 0.5 */ +#ifdef FIX_1119_SPLIT_RENDERING_VOIP + ivas_CLDFB_RINGBUF_GetByIdx( st_ivas->hSplitBinRend->hMultiBinCldfbData[n], &re, &im, slot_idx - cldfb_slots ); + v_add( re, Cldfb_RealBuffer, re, num_cldfb_bands ); + v_add( im, Cldfb_ImagBuffer, im, num_cldfb_bands ); +#else v_add( st_ivas->hSplitBinRend->hMultiBinCldfbData->Cldfb_RealBuffer_Binaural[n][slot_idx_start + slot_idx], Cldfb_RealBuffer, st_ivas->hSplitBinRend->hMultiBinCldfbData->Cldfb_RealBuffer_Binaural[n][slot_idx_start + slot_idx], num_cldfb_bands ); v_add( st_ivas->hSplitBinRend->hMultiBinCldfbData->Cldfb_ImagBuffer_Binaural[n][slot_idx_start + slot_idx], Cldfb_ImagBuffer, st_ivas->hSplitBinRend->hMultiBinCldfbData->Cldfb_ImagBuffer_Binaural[n][slot_idx_start + slot_idx], num_cldfb_bands ); +#endif } } } diff --git a/lib_dec/ivas_osba_dec.c b/lib_dec/ivas_osba_dec.c index 7ad4d652f6cf69c0b6c5fe63e5866a4cc7f844fd..c151dede5b266bbe2815e54772baf7b6cfe2572b 100644 --- a/lib_dec/ivas_osba_dec.c +++ b/lib_dec/ivas_osba_dec.c @@ -137,9 +137,13 @@ ivas_error ivas_osba_dirac_td_binaural( float output_separated_objects[BINAURAL_CHANNELS][L_FRAME48k]; float *p_sepobj[BINAURAL_CHANNELS]; int16_t channel_offset; +#ifdef FIX_1119_SPLIT_RENDERING_VOIP + float *re, *im; +#else int16_t slot_idx_start; slot_idx_start = st_ivas->hSpatParamRendCom->slots_rendered; +#endif for ( n = 0; n < BINAURAL_CHANNELS; n++ ) { @@ -157,7 +161,10 @@ ivas_error ivas_osba_dirac_td_binaural( if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { - int16_t slot_idx, num_cldfb_bands, b, nchan_transport_orig; + int16_t slot_idx, num_cldfb_bands, nchan_transport_orig; +#ifndef FIX_1119_SPLIT_RENDERING_VOIP + int16_t b; +#endif int16_t cldfb_slots; float Cldfb_RealBuffer[CLDFB_NO_CHANNELS_MAX]; float Cldfb_ImagBuffer[CLDFB_NO_CHANNELS_MAX]; @@ -180,6 +187,11 @@ ivas_error ivas_osba_dirac_td_binaural( { cldfbAnalysis_ts( &( output_f[n][num_cldfb_bands * slot_idx] ), Cldfb_RealBuffer, Cldfb_ImagBuffer, num_cldfb_bands, st_ivas->hSplitBinRend->splitrend.hCldfbHandles->cldfbAna[n] ); +#ifdef FIX_1119_SPLIT_RENDERING_VOIP + ivas_CLDFB_RINGBUF_GetByIdx( st_ivas->hSplitBinRend->hMultiBinCldfbData[n], &re, &im, slot_idx - cldfb_slots ); + v_add( re, Cldfb_RealBuffer, re, num_cldfb_bands ); + v_add( im, Cldfb_ImagBuffer, im, num_cldfb_bands ); +#else for ( b = 0; b < num_cldfb_bands; b++ ) { st_ivas->hSplitBinRend->hMultiBinCldfbData->Cldfb_RealBuffer_Binaural[n][slot_idx_start + slot_idx][b] = @@ -189,6 +201,7 @@ ivas_error ivas_osba_dirac_td_binaural( st_ivas->hSplitBinRend->hMultiBinCldfbData->Cldfb_ImagBuffer_Binaural[n][slot_idx_start + slot_idx][b] + Cldfb_ImagBuffer[b]; } +#endif } } } diff --git a/lib_dec/ivas_output_config.c b/lib_dec/ivas_output_config.c index b0acefc17eb7815e28206ff7495a974e839a323f..b4b241815dd11075e142dd2a595cfa0935b692c3 100644 --- a/lib_dec/ivas_output_config.c +++ b/lib_dec/ivas_output_config.c @@ -71,7 +71,11 @@ void ivas_renderer_select( * Binaural rendering configurations *-----------------------------------------------------------------*/ +#ifdef IVAS_RTPDUMP + if ( st_ivas->hDecoderConfig->Opt_Headrotation || st_ivas->hDecoderConfig->Opt_ExternalOrientation || st_ivas->hCombinedOrientationData ) +#else if ( st_ivas->hDecoderConfig->Opt_Headrotation || st_ivas->hDecoderConfig->Opt_ExternalOrientation ) +#endif { st_ivas->hCombinedOrientationData->shd_rot_max_order = -1; } @@ -95,21 +99,8 @@ void ivas_renderer_select( { if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { -#ifdef DEBUGGING - if ( st_ivas->hDecoderConfig->force_rend == FORCE_CLDFB_RENDERER ) - { - *renderer_type = RENDERER_BINAURAL_FASTCONV; - *internal_config = IVAS_AUDIO_CONFIG_HOA3; /* Render ISM to HOA3 before binauralization*/ - } - else - { - *renderer_type = RENDERER_BINAURAL_OBJECTS_TD; - *internal_config = output_config; - } -#else *renderer_type = RENDERER_BINAURAL_OBJECTS_TD; *internal_config = output_config; -#endif } else { @@ -155,7 +146,11 @@ void ivas_renderer_select( *internal_config = IVAS_AUDIO_CONFIG_7_1_4; } +#ifdef IVAS_RTPDUMP + if ( st_ivas->hDecoderConfig->Opt_Headrotation || st_ivas->hDecoderConfig->Opt_ExternalOrientation || st_ivas->hCombinedOrientationData ) +#else if ( st_ivas->hDecoderConfig->Opt_Headrotation || st_ivas->hDecoderConfig->Opt_ExternalOrientation ) +#endif { nchan_internal = ivas_sba_get_nchan_metadata( st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); @@ -198,8 +193,8 @@ void ivas_renderer_select( if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) { -#ifdef DEBUGGING - if ( ( ( ( st_ivas->transport_config == IVAS_AUDIO_CONFIG_5_1 || st_ivas->transport_config == IVAS_AUDIO_CONFIG_7_1 ) && ( st_ivas->hDecoderConfig->Opt_Headrotation || st_ivas->hDecoderConfig->Opt_ExternalOrientation ) ) || ( st_ivas->hDecoderConfig->force_rend == FORCE_TD_RENDERER ) ) && st_ivas->mc_mode == MC_MODE_MCT && st_ivas->hDecoderConfig->force_rend != FORCE_CLDFB_RENDERER ) +#ifdef IVAS_RTPDUMP + if ( ( st_ivas->transport_config == IVAS_AUDIO_CONFIG_5_1 || st_ivas->transport_config == IVAS_AUDIO_CONFIG_7_1 ) && ( st_ivas->hDecoderConfig->Opt_Headrotation || st_ivas->hDecoderConfig->Opt_ExternalOrientation || st_ivas->hCombinedOrientationData ) && st_ivas->mc_mode == MC_MODE_MCT ) #else if ( ( st_ivas->transport_config == IVAS_AUDIO_CONFIG_5_1 || st_ivas->transport_config == IVAS_AUDIO_CONFIG_7_1 ) && ( st_ivas->hDecoderConfig->Opt_Headrotation || st_ivas->hDecoderConfig->Opt_ExternalOrientation ) && st_ivas->mc_mode == MC_MODE_MCT ) #endif @@ -217,7 +212,11 @@ void ivas_renderer_select( *renderer_type = RENDERER_BINAURAL_FASTCONV; } +#ifdef IVAS_RTPDUMP + if ( st_ivas->hDecoderConfig->Opt_Headrotation || st_ivas->hDecoderConfig->Opt_ExternalOrientation || st_ivas->hCombinedOrientationData ) +#else if ( st_ivas->hDecoderConfig->Opt_Headrotation || st_ivas->hDecoderConfig->Opt_ExternalOrientation ) +#endif { /* force HOA3 domain for rotation*/ *internal_config = IVAS_AUDIO_CONFIG_HOA3; @@ -499,11 +498,21 @@ RENDERER_TYPE ivas_renderer_secondary_select( renderer_type = RENDERER_DISABLE; output_config = st_ivas->hDecoderConfig->output_config; - if ( st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->ism_mode == ISM_MASA_MODE_DISC && output_config == IVAS_AUDIO_CONFIG_BINAURAL ) + if ( st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->ism_mode == ISM_MASA_MODE_DISC && +#ifdef FIX_1119_SPLIT_RENDERING_VOIP + ( output_config == IVAS_AUDIO_CONFIG_BINAURAL || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) +#else + output_config == IVAS_AUDIO_CONFIG_BINAURAL +#endif + ) { renderer_type = RENDERER_BINAURAL_OBJECTS_TD; } +#ifdef FIX_1119_SPLIT_RENDERING_VOIP + else if ( st_ivas->ivas_format == SBA_ISM_FORMAT && st_ivas->ism_mode == ISM_SBA_MODE_DISC && ( output_config == IVAS_AUDIO_CONFIG_BINAURAL || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) +#else else if ( st_ivas->ivas_format == SBA_ISM_FORMAT && st_ivas->ism_mode == ISM_SBA_MODE_DISC && ( output_config == IVAS_AUDIO_CONFIG_BINAURAL || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) +#endif { renderer_type = RENDERER_BINAURAL_OBJECTS_TD; } diff --git a/lib_dec/ivas_stat_dec.h b/lib_dec/ivas_stat_dec.h index 481b046a7aadede8fc9b60a631e1ef167216d8dc..62d053ed89d7cb22e75f42f57cd0d1e323a1f44a 100644 --- a/lib_dec/ivas_stat_dec.h +++ b/lib_dec/ivas_stat_dec.h @@ -821,6 +821,7 @@ typedef struct renderer_struct * IVAS decoder specific ISAR wrapper structures *----------------------------------------------------------------------------------*/ +#ifndef FIX_1119_SPLIT_RENDERING_VOIP typedef struct { float Cldfb_RealBuffer_Binaural[MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; @@ -828,18 +829,29 @@ typedef struct } ISAR_DEC_SPLIT_REND_MULTI_BIN_CLDFB_DATA, *ISAR_DEC_SPLIT_REND_MULTI_BIN_CLDFB_DATA_HANDLE; +#endif typedef struct { +#ifdef FIX_1119_SPLIT_RENDERING_VOIP + float Cldfb_RealBuffer[MAX_OUTPUT_CHANNELS][2 * CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; /* Double space to account for TSM */ + float Cldfb_ImagBuffer[MAX_OUTPUT_CHANNELS][2 * CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; +#else float Cldfb_RealBuffer[MAX_OUTPUT_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; float Cldfb_ImagBuffer[MAX_OUTPUT_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; +#endif IVAS_AUDIO_CONFIG config; } ISAR_DEC_SPLIT_REND_CLDFB_OUT_DATA, *ISAR_DEC_SPLIT_REND_CLDFB_OUT_DATA_HANDLE; typedef struct { +#ifdef FIX_1119_SPLIT_RENDERING_VOIP + TD_RINGBUF_HANDLE hMultiBinTdData; + ISAR_CLDFB_RINGBUF_HANDLE hMultiBinCldfbData[MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS]; +#else ISAR_DEC_SPLIT_REND_MULTI_BIN_CLDFB_DATA_HANDLE hMultiBinCldfbData; /*scratch buffer for frame by frame processing*/ - ISAR_SPLIT_REND_BITS_HANDLE hSplitRendBits; /*scratch buffer for frame by frame processing*/ +#endif + ISAR_SPLIT_REND_BITS_HANDLE hSplitRendBits; /*scratch buffer for frame by frame processing*/ SPLIT_REND_WRAPPER splitrend; ISAR_DEC_SPLIT_REND_CLDFB_OUT_DATA_HANDLE hCldfbDataOut; /*buffer to store cldfb data before binauralization*/ int16_t numTdSamplesPerChannelCached; @@ -1017,11 +1029,7 @@ typedef struct decoder_config_structure int16_t Opt_dpid_on; /* indicates whether Directivity pattern option is used */ int16_t Opt_aeid_on; /* indicates whether Acoustic environment option is used */ int16_t Opt_ObjEdit_on; /* indicates whether object editing option is used */ -#ifdef DEBUGGING - /* temp. development parameters */ - int16_t force_rend; /* forced TD/CLDFB binaural renderer (for ISM and MC) */ -#endif - int16_t Opt_tsm; /* indicates whether time scaling modification is activated */ + int16_t Opt_tsm; /* indicates whether time scaling modification is activated */ IVAS_RENDER_FRAMESIZE render_framesize; int16_t Opt_delay_comp; /* flag indicating delay compensation active */ @@ -1140,6 +1148,10 @@ typedef struct Decoder_Struct int16_t ism_extmeta_active; /* Extended metadata active in decoder */ int16_t ism_extmeta_cnt; /* Change frame counter for extended metadata */ +#ifdef TMP_1342_WORKAROUND_DEC_FLUSH_BROKEN_IN_SR + int16_t flushing; +#endif + } Decoder_Struct; /* clang-format on */ diff --git a/lib_dec/ivas_stereo_dft_dec.c b/lib_dec/ivas_stereo_dft_dec.c index 47f880ded31611fd68a70f86bc9a1ed0446b6854..7b86528878d457d4cbf031126a20d4a22d5082f2 100644 --- a/lib_dec/ivas_stereo_dft_dec.c +++ b/lib_dec/ivas_stereo_dft_dec.c @@ -1384,8 +1384,16 @@ void stereo_dft_dec( if ( pgIpd[0] != 0.f ) { +#ifdef NONBE_FIX_NONBE_BETWEEN_OPTIMIZATION_LEVELS_2 + volatile float pgIpd_tmp; + + pgIpd_tmp = pgIpd[0]; + c0 = cosf( pgIpd_tmp ); + s0 = sinf( pgIpd_tmp ); +#else c0 = cosf( pgIpd[0] ); s0 = sinf( pgIpd[0] ); +#endif for ( i = hStereoDft->band_limits[b]; i < hStereoDft->band_limits[b + 1]; i++ ) { /*rotate L*/ @@ -1566,8 +1574,16 @@ void stereo_dft_dec( /* Active Upmix */ if ( pgIpd[0] != 0.f ) { +#ifdef NONBE_FIX_NONBE_BETWEEN_OPTIMIZATION_LEVELS_2 + volatile float pgIpd_tmp; + + pgIpd_tmp = pgIpd[0]; + c0 = cosf( pgIpd_tmp ); + s0 = sinf( pgIpd_tmp ); +#else c0 = cosf( pgIpd[0] ); s0 = sinf( pgIpd[0] ); +#endif for ( i = hStereoDft->band_limits[b]; i < hStereoDft->band_limits[b + 1]; i++ ) { /*rotate L*/ diff --git a/lib_dec/ivas_stereo_dft_plc.c b/lib_dec/ivas_stereo_dft_plc.c index 2186aa1b1cff6f5a85042535552f4d508ac74f19..f311b60affc41eef7041b45068cbe504653db20c 100644 --- a/lib_dec/ivas_stereo_dft_plc.c +++ b/lib_dec/ivas_stereo_dft_plc.c @@ -251,6 +251,9 @@ void stereo_dft_res_subst_spec( /* Apply phase adjustment of identified peaks, including Np=1 peak neighbors on each side */ for ( i = *num_plocs - 1; i >= 0; i-- ) { +#ifdef NONBE_FIX_NONBE_BETWEEN_OPTIMIZATION_LEVELS_2 + volatile float corr_phase_tmp; +#endif if ( k == 0 ) { /* For 1st subframe, apply reversed time ECU to get correct analysis window */ @@ -268,8 +271,14 @@ void stereo_dft_res_subst_spec( conj_sign = 1.0f; } +#ifdef NONBE_FIX_NONBE_BETWEEN_OPTIMIZATION_LEVELS_2 + corr_phase_tmp = corr_phase; + cos_F = cosf( corr_phase_tmp ); + sin_F = sinf( corr_phase_tmp ); +#else cos_F = cosf( corr_phase ); sin_F = sinf( corr_phase ); +#endif idx = max( 0, plocs[i] - Np ); /* Iterate over plocs[i]-1:plocs[i]+1, considering the edges of the spectrum */ while ( ( idx < plocs[i] + Np + 1 ) && ( idx < L_res ) ) diff --git a/lib_dec/ivas_stereo_mdct_stereo_dec.c b/lib_dec/ivas_stereo_mdct_stereo_dec.c index f41ffb495d13b6c780fbae7e3bb2faf2b37caed5..3fd4b3184f854bf915c6ee21b11d44cc8c143d63 100644 --- a/lib_dec/ivas_stereo_mdct_stereo_dec.c +++ b/lib_dec/ivas_stereo_mdct_stereo_dec.c @@ -523,7 +523,11 @@ void synchonize_channels_mdct_sid( sts[1]->L_frame = sts[0]->L_frame; sts[1]->cng_type = sts[0]->cng_type; sts[1]->bwidth = sts[0]->bwidth; +#ifdef NONBE_MDCT_ST_DTX_FIX_SUBOPT_SPATIAL_CNG + sts[0]->hFdCngDec->hFdCngCom->coherence[0] = sts[1]->hFdCngDec->hFdCngCom->coherence[0]; /* coherence is stored in sts[1] - see ivas_decision_matrix_dec() and FdCngDecodeMDCTStereoSID() */ +#else sts[0]->hFdCngDec->hFdCngCom->coherence = sts[1]->hFdCngDec->hFdCngCom->coherence; /* coherence is stored in sts[1] - see ivas_decision_matrix_dec() */ +#endif sts[0]->hFdCngDec->hFdCngCom->no_side_flag = sts[1]->hFdCngDec->hFdCngCom->no_side_flag; /* configure when there is a switching from DFT CNG to MDCT CNG */ diff --git a/lib_dec/ivas_tcx_core_dec.c b/lib_dec/ivas_tcx_core_dec.c index fc66dbc22a5228c4f34252c1009d803ce0f1ff17..634ac0f6d7d77e7991bddddb74137efdbdf8ec26 100644 --- a/lib_dec/ivas_tcx_core_dec.c +++ b/lib_dec/ivas_tcx_core_dec.c @@ -277,7 +277,7 @@ void stereo_tcx_core_dec( } /*--------------------------------------------------------------------------------* - * LPC PARAMETERS + * LPC envelope decoding *--------------------------------------------------------------------------------*/ st->acelp_cfg.midLpc = 0; @@ -288,14 +288,7 @@ void stereo_tcx_core_dec( { int16_t tcx_lpc_cdk; - if ( bfi && st->use_partial_copy && st->rf_frame_type == RF_TCXFD ) - { - tcx_lpc_cdk = tcxlpc_get_cdk( GENERIC ); - } - else - { - tcx_lpc_cdk = tcxlpc_get_cdk( st->coder_type ); - } + tcx_lpc_cdk = tcxlpc_get_cdk( st->coder_type ); mvr2r( st->lsf_old, &lsf[0], M ); mvr2r( st->lsp_old, &lsp[0], M ); @@ -394,11 +387,6 @@ void stereo_tcx_core_dec( lsp2a_stab( st->lsp_old, st->old_Aq_12_8, M ); } - if ( st->enablePlcWaveadjust && bfi ) - { - st->hPlcInfo->nbLostCmpt++; - } - /*--------------------------------------------------------------------------------* * TD-TCX concealment *--------------------------------------------------------------------------------*/ @@ -532,24 +520,6 @@ void stereo_tcx_core_dec( if ( st->core == TCX_10_CORE || st->core == TCX_20_CORE ) { - if ( st->enablePlcWaveadjust || /* bfi */ - ( st->last_total_brate >= HQ_48k && /* recovery */ - st->last_codec_mode == MODE2 ) ) - { - /* waveform adjustment */ - concealment_signal_tuning( st, bfi, synthFB, st->last_core_bfi ); - - if ( ( bfi || st->prev_bfi ) && st->hPlcInfo->Pitch && st->hPlcInfo->concealment_method == TCX_NONTONAL ) - { - lerp( synthFB, synth, st->L_frame, hTcxDec->L_frameTCX ); - - if ( !bfi && st->prev_bfi ) - { - st->hPlcInfo->Pitch = 0; - } - } - } - if ( !bfi && st->hTonalMDCTConc != NULL ) { TonalMDCTConceal_SaveTimeSignal( st->hTonalMDCTConc, synthFB, hTcxDec->L_frameTCX ); @@ -673,11 +643,6 @@ void stereo_tcx_core_dec( if ( !bfi ) { - if ( st->enablePlcWaveadjust ) - { - st->hPlcInfo->nbLostCmpt = 0; - } - if ( param[1 + NOISE_FILL_RANGES] != 0 ) { set_f( pitch_buf, hTcxLtpDec->tcxltp_pitch_int + (float) hTcxLtpDec->tcxltp_pitch_fr / (float) st->pit_res_max, NB_SUBFR16k ); @@ -834,7 +799,7 @@ static void dec_prm_tcx( getTCXMode( st, st, 0 /* <- MCT_flag */ ); /* last_core for error concealment */ - if ( !st->use_partial_copy && st->element_mode != IVAS_CPE_MDCT ) + if ( st->element_mode != IVAS_CPE_MDCT ) { st->last_core_from_bs = get_next_indice( st, 1 ); /* Store decoder memory of last_core */ if ( st->last_core == ACELP_CORE && st->last_core_from_bs != ACELP_CORE ) @@ -860,20 +825,16 @@ static void dec_prm_tcx( } } - if ( !st->use_partial_copy ) + if ( st->element_mode != IVAS_CPE_MDCT ) { - if ( st->element_mode != IVAS_CPE_MDCT ) - { - getTCXWindowing( st->core, st->last_core, st->element_mode, st->hTcxCfg, st ); - } - st->flagGuidedAcelp = 0; - - if ( st->dec_glr ) - { - st->dec_glr_idx = -1; - } + getTCXWindowing( st->core, st->last_core, st->element_mode, st->hTcxCfg, st ); } + st->flagGuidedAcelp = 0; + if ( st->dec_glr ) + { + st->dec_glr_idx = -1; + } #ifdef DEBUG_MODE_TCX fprintf( pF, "\t TCX Header: %d bits: %d %d %d %d\n", st->next_bit_pos - start_bit_pos, st->tcxonly, st->core, st->tcxonly ? st->clas_dec : st->hTcxCfg->coder_type, st->hTcxCfg->tcx_curr_overlap_mode ); nbits_tcx = st->next_bit_pos; @@ -895,25 +856,20 @@ static void dec_prm_tcx( * TCX20/10 parameters *--------------------------------------------------------------------------------*/ - if ( st->use_partial_copy == 0 ) - { - getTCXparam( st, st, hm_cfg, param, bits_common, start_bit_pos, NULL, NULL, NULL, -1 ); - } + getTCXparam( st, st, hm_cfg, param, bits_common, start_bit_pos, NULL, NULL, NULL, -1 ); - if ( !st->use_partial_copy ) + if ( *total_nbbits - bitsRead[0] < ( st->next_bit_pos - start_bit_pos ) ) { - if ( *total_nbbits - bitsRead[0] < ( st->next_bit_pos - start_bit_pos ) ) - { - st->BER_detect = 1; - st->next_bit_pos = start_bit_pos + *total_nbbits - bitsRead[0]; - } - - bitsRead[0] = st->next_bit_pos - start_bit_pos; + st->BER_detect = 1; + st->next_bit_pos = start_bit_pos + *total_nbbits - bitsRead[0]; } + bitsRead[0] = st->next_bit_pos - start_bit_pos; + return; } + /*-----------------------------------------------------------------* * Function stereo_tcx_dec_mode_switch_reconf() * diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index f016ee88c27f170d6be5244a46adb3d9f7a29bc3..0f32f6f34980ade613174f696e2a0acb3c57c9c6 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -114,7 +114,11 @@ static void store_JbmData( IVAS_DEC_VOIP *hVoIP, JB4_DATAUNIT_HANDLE dataUnit, c static ivas_error evs_dec_main( Decoder_Struct *st_ivas ); static ivas_error input_format_API_to_internal( IVAS_DEC_INPUT_FORMAT input_format, int16_t *bitstream_format_internal, int16_t *sdp_hf_only, const bool is_voip_enabled ); static void init_decoder_config( DECODER_CONFIG_HANDLE hDecoderConfig ); +#ifdef FIX_1119_SPLIT_RENDERING_VOIP +static ivas_error ivas_dec_setup_all( IVAS_DEC_HANDLE hIvasDec, uint8_t *nTransportChannels, ISAR_SPLIT_REND_BITS_DATA *splitRendBits ); +#else static ivas_error ivas_dec_setup_all( IVAS_DEC_HANDLE hIvasDec, uint8_t *nTransportChannels, const int16_t isSplitRend, ISAR_SPLIT_REND_BITS_DATA *splitRendBits ); +#endif static ivas_error apa_setup( IVAS_DEC_HANDLE hIvasDec, const bool isInitialized_voip, const uint16_t nTransportChannels ); static PCM_RESOLUTION pcm_type_API_to_internal( const IVAS_DEC_PCM_TYPE pcmType ); static void *pcm_buffer_offset( void *buffer, const IVAS_DEC_PCM_TYPE pcmType, const int32_t offset ); @@ -125,6 +129,10 @@ static ivas_error ivas_dec_init_split_rend( Decoder_Struct *st_ivas ); static ivas_error ivas_create_handle_isar( ISAR_DEC_SPLIT_REND_WRAPPER_HANDLE *hSplitBinRend_out ); static void ivas_destroy_handle_isar( ISAR_DEC_SPLIT_REND_WRAPPER_HANDLE *hSplitBinRend_out ); static int16_t get_render_frame_size_ms( IVAS_RENDER_FRAMESIZE render_framesize ); +#ifdef FIX_1119_SPLIT_RENDERING_VOIP +static int16_t get_render_frame_size_samples( const DECODER_CONFIG_HANDLE hDecoderConfig ); +static int16_t ivas_dec_split_rend_cldfb_in( const RENDERER_TYPE renderer_type ); +#endif static void update_voip_rendered20ms( IVAS_DEC_HANDLE hIvasDec, const int16_t nSamplesRendered ); @@ -338,11 +346,17 @@ void IVAS_DEC_Close( ( *phIvasDec )->hVoIP = NULL; } +#ifndef IVAS_RTPDUMP /* destroy Split binaural renderer (ISAR) handle */ ivas_destroy_handle_isar( &( *phIvasDec )->st_ivas->hSplitBinRend ); +#endif if ( ( *phIvasDec )->st_ivas ) { +#ifdef IVAS_RTPDUMP + /* destroy Split binaural renderer (ISAR) handle */ + ivas_destroy_handle_isar( &( *phIvasDec )->st_ivas->hSplitBinRend ); +#endif ivas_destroy_dec( ( *phIvasDec )->st_ivas ); ( *phIvasDec )->st_ivas = NULL; } @@ -633,6 +647,23 @@ ivas_error IVAS_DEC_GetRenderFramesize( return IVAS_ERR_OK; } + +#ifdef FIX_1119_SPLIT_RENDERING_VOIP +/*---------------------------------------------------------------------* + * get_render_frame_size_samples( ) + * + * + *---------------------------------------------------------------------*/ + +static int16_t get_render_frame_size_samples( + const DECODER_CONFIG_HANDLE hDecoderConfig /* i : configuration structure */ +) +{ + return (int16_t) ( hDecoderConfig->output_Fs * hDecoderConfig->render_framesize / ( FRAMES_PER_SEC * IVAS_MAX_PARAM_SPATIAL_SUBFRAMES ) ); +} +#endif + + /*---------------------------------------------------------------------* * IVAS_DEC_GetGetRenderFramesizeSamples( ) * @@ -649,11 +680,16 @@ ivas_error IVAS_DEC_GetRenderFramesizeSamples( return IVAS_ERR_UNEXPECTED_NULL_POINTER; } +#ifdef FIX_1119_SPLIT_RENDERING_VOIP + *render_framesize = get_render_frame_size_samples( hIvasDec->st_ivas->hDecoderConfig ); +#else *render_framesize = (int16_t) ( hIvasDec->st_ivas->hDecoderConfig->output_Fs * hIvasDec->st_ivas->hDecoderConfig->render_framesize / ( FRAMES_PER_SEC * IVAS_MAX_PARAM_SPATIAL_SUBFRAMES ) ); +#endif return IVAS_ERR_OK; } + /*---------------------------------------------------------------------* * IVAS_DEC_GetGetRenderFramesizeMs( ) * @@ -827,12 +863,19 @@ ivas_error IVAS_DEC_FeedFrame_Serial( { ivas_error error; + if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL ) + { + return IVAS_ERR_UNEXPECTED_NULL_POINTER; + } + if ( !hIvasDec->isInitialized ) { /* Once first frame is fed, finish initialization in EVS Mono. * In IVAS mode, initialization is done in ivas_dec(). */ if ( hIvasDec->mode == IVAS_DEC_MODE_EVS ) { + hIvasDec->st_ivas->hDecoderConfig->ivas_total_brate = ACELP_8k00; + if ( ( error = ivas_init_decoder( hIvasDec->st_ivas ) ) != IVAS_ERR_OK ) { return error; @@ -845,10 +888,7 @@ ivas_error IVAS_DEC_FeedFrame_Serial( st->prev_use_partial_copy = 0; hIvasDec->st_ivas->hDecoderConfig->ivas_total_brate = hIvasDec->hVoIP->hCurrentDataUnit->dataSize * FRAMES_PER_SEC; } - else - { - hIvasDec->st_ivas->hDecoderConfig->ivas_total_brate = ACELP_8k00; - } + hIvasDec->isInitialized = true; } } @@ -878,6 +918,7 @@ ivas_error IVAS_DEC_FeedFrame_Serial( bfi = 2; } } + if ( ( error = read_indices( hIvasDec->st_ivas, serial, num_bits, &hIvasDec->prev_ft_speech, &hIvasDec->CNG, bfi ) ) != IVAS_ERR_OK ) { return error; @@ -1101,8 +1142,10 @@ ivas_error IVAS_DEC_ReadFormat( *---------------------------------------------------------------------*/ ivas_error IVAS_DEC_GetSamplesDecoder( - IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ - const int16_t isSplitRend, /* i : split rendering enabled flag */ + IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ +#ifndef FIX_1119_SPLIT_RENDERING_VOIP + const int16_t isSplitRend, /* i : split rendering enabled flag */ +#endif ISAR_SPLIT_REND_BITS_DATA *splitRendBits /* o : output split rendering bits */ ) { @@ -1133,7 +1176,11 @@ ivas_error IVAS_DEC_GetSamplesDecoder( * Setup all decoder parts (IVAS decoder, ISAR) *-----------------------------------------------------------------*/ +#ifdef FIX_1119_SPLIT_RENDERING_VOIP + if ( ( error = ivas_dec_setup_all( hIvasDec, &nTransportChannels, splitRendBits ) ) != IVAS_ERR_OK ) +#else if ( ( error = ivas_dec_setup_all( hIvasDec, &nTransportChannels, isSplitRend, splitRendBits ) ) != IVAS_ERR_OK ) +#endif { return error; } @@ -1822,6 +1869,199 @@ ivas_error IVAS_DEC_GetSamplesRenderer( } +#ifdef FIX_1119_SPLIT_RENDERING_VOIP +/*---------------------------------------------------------------------* + * isar_get_frame_size( ) + * + * + *---------------------------------------------------------------------*/ + +static int16_t isar_get_frame_size( + Decoder_Struct *st_ivas /* i : IVAS decoder handle */ +) +{ + int32_t output_Fs; + int16_t nSamplesPerChannel; + + output_Fs = st_ivas->hDecoderConfig->output_Fs; + + if ( st_ivas->hDecoderConfig->render_framesize != IVAS_RENDER_FRAMESIZE_20MS && + ( st_ivas->hRenderConfig->split_rend_config.poseCorrectionMode == ISAR_SPLIT_REND_POSE_CORRECTION_MODE_NONE || + st_ivas->hRenderConfig->split_rend_config.dof == 0 ) ) + { + nSamplesPerChannel = (int16_t) ( output_Fs / FRAMES_PER_SEC / MAX_PARAM_SPATIAL_SUBFRAMES ); + nSamplesPerChannel *= (int16_t) st_ivas->hDecoderConfig->render_framesize; + } + else + { + nSamplesPerChannel = (int16_t) ( output_Fs / FRAMES_PER_SEC ); + } + + return nSamplesPerChannel; +} + + +/*---------------------------------------------------------------------* + * isar_render_poses( ) + * + * + *---------------------------------------------------------------------*/ + +static ivas_error isar_render_poses( + IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ + const int16_t nSamplesAsked, /* i : number of samples wanted by the caller */ + int16_t *nOutSamples, /* o : number of samples per channel written to output buffer */ + bool *needNewFrame /* o : indication that the decoder needs a new frame */ +) +{ + float pcmBuf[BINAURAL_CHANNELS * MAX_HEAD_ROT_POSES * L_FRAME48k]; + Decoder_Struct *st_ivas; + ivas_error error; + int16_t numPoses; + + if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL ) + { + return IVAS_ERR_UNEXPECTED_NULL_POINTER; + } + + *needNewFrame = false; + + st_ivas = hIvasDec->st_ivas; + + numPoses = st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses; + + /* init flush buffer for rate switch if not already initizalized */ + if ( hIvasDec->flushbuffer == NULL ) + { + hIvasDec->flushbuffer = (void *) malloc( numPoses * BINAURAL_CHANNELS * hIvasDec->nSamplesFrame / IVAS_MAX_PARAM_SPATIAL_SUBFRAMES * sizeof( float ) ); + if ( hIvasDec->flushbuffer == NULL ) + { + return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate flush buffer" ); + } + hIvasDec->pcmType = IVAS_DEC_PCM_FLOAT; + set_zero( (float *) hIvasDec->flushbuffer, numPoses * BINAURAL_CHANNELS * hIvasDec->nSamplesFrame / IVAS_MAX_PARAM_SPATIAL_SUBFRAMES ); + } + + /* render */ + if ( ( error = IVAS_DEC_GetSamplesRenderer( hIvasDec, nSamplesAsked, IVAS_DEC_PCM_FLOAT, pcmBuf, nOutSamples, needNewFrame ) ) != IVAS_ERR_OK ) + { + return error; + } + + if ( !hIvasDec->hasBeenFedFirstGoodFrame ) + { + return IVAS_ERR_OK; + } + + if ( !ivas_dec_split_rend_cldfb_in( st_ivas->renderer_type ) ) + { + ivas_TD_RINGBUF_PushInterleaved( st_ivas->hSplitBinRend->hMultiBinTdData, pcmBuf, *nOutSamples ); + } + + return error; +} + + +/*---------------------------------------------------------------------* + * isar_generate_metadata_and_bitstream( ) + * + * + *---------------------------------------------------------------------*/ + +static ivas_error isar_generate_metadata_and_bitstream( + Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ + float **p_head_pose_buf, /* i/o: PCM buffer with head-pose data */ + int16_t nSamples, /* i : duration of audio (in samples per channel) for which metadata should be generated */ + ISAR_SPLIT_REND_BITS_DATA *splitRendBits /* o : output split rendering bits */ +) +{ + ivas_error error; + ISAR_DEC_SPLIT_REND_WRAPPER_HANDLE hSplitBinRend; + int16_t max_band; + int16_t pcm_out_flag; + int16_t cldfb_in_flag; + int16_t ro_md_flag; + IVAS_QUATERNION Quaternion; + int16_t i, j, num_poses, num_cldfb_slots, n_samples_in_cldfb_slot; + float *p_Cldfb_RealBuffer_Binaural[MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS][CLDFB_NO_COL_MAX]; + float *p_Cldfb_ImagBuffer_Binaural[MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS][CLDFB_NO_COL_MAX]; + + hSplitBinRend = st_ivas->hSplitBinRend; + + max_band = (int16_t) ( ( BINAURAL_MAXBANDS * st_ivas->hDecoderConfig->output_Fs ) / 48000 ); + pcm_out_flag = ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0; + cldfb_in_flag = ivas_dec_split_rend_cldfb_in( st_ivas->renderer_type ); + + if ( cldfb_in_flag ) + { + n_samples_in_cldfb_slot = NS2SA( st_ivas->hDecoderConfig->output_Fs, CLDFB_SLOT_NS ); + assert( nSamples % n_samples_in_cldfb_slot == 0 ); + num_cldfb_slots = nSamples / n_samples_in_cldfb_slot; + + num_poses = hSplitBinRend->splitrend.multiBinPoseData.num_poses; + + for ( i = 0; i < BINAURAL_CHANNELS * num_poses; ++i ) + { + for ( j = 0; j < num_cldfb_slots; ++j ) + { + /* Save pointers to first CLDFB column in the ring buffer. Allows us to save + * significant amounts of memory by not copying CLDFB values into a separate buffer. */ + ivas_CLDFB_RINGBUF_GetByIdx( hSplitBinRend->hMultiBinCldfbData[i], &p_Cldfb_RealBuffer_Binaural[i][j], &p_Cldfb_ImagBuffer_Binaural[i][j], 0 ); + + /* Pop the CLDFB column we just saved pointers to. This is fine as long as we use + * the saved columns only before any new columns are pushed to the buffer - the new + * columns could potentially overwrite the old columns we wanted to use. + * This requirement is fulfilled in this case. */ + ivas_CLDFB_RINGBUF_Pop( hSplitBinRend->hMultiBinCldfbData[i], NULL, NULL, CLDFB_NO_CHANNELS_MAX ); + } + } + } + else + { + ivas_TD_RINGBUF_PopChannels( st_ivas->hSplitBinRend->hMultiBinTdData, p_head_pose_buf, nSamples ); + } + + + if ( st_ivas->hBinRendererTd != NULL ) + { + ro_md_flag = 1; + } + else + { + ro_md_flag = 0; + } + + if ( st_ivas->hHeadTrackData != NULL ) + { + Quaternion = st_ivas->hHeadTrackData->Quaternions[0]; + } + else + { + Quaternion.w = -3.0f; + Quaternion.x = 0.0f; + Quaternion.y = 0.0f; + Quaternion.z = 0.0f; + } + + if ( ( error = ISAR_PRE_REND_MultiBinToSplitBinaural( &hSplitBinRend->splitrend, + Quaternion, + st_ivas->hRenderConfig->split_rend_config.splitRendBitRate, + st_ivas->hRenderConfig->split_rend_config.codec, + st_ivas->hRenderConfig->split_rend_config.isar_frame_size_ms, + st_ivas->hRenderConfig->split_rend_config.codec_frame_size_ms, + splitRendBits, + p_Cldfb_RealBuffer_Binaural, + p_Cldfb_ImagBuffer_Binaural, + max_band, p_head_pose_buf, 1, cldfb_in_flag, pcm_out_flag, ro_md_flag ) ) != IVAS_ERR_OK ) + { + return error; + } + + return IVAS_ERR_OK; +} +#endif /* FIX_1119_SPLIT_RENDERING_VOIP */ + + /*---------------------------------------------------------------------* * IVAS_DEC_GetSplitBinauralBitstream( ) * @@ -1836,6 +2076,70 @@ ivas_error IVAS_DEC_GetSplitBinauralBitstream( bool *needNewFrame /* o : indication that the decoder needs a new frame */ ) { +#ifdef FIX_1119_SPLIT_RENDERING_VOIP + Decoder_Struct *st_ivas; + ivas_error error; + float head_pose_buf[BINAURAL_CHANNELS * MAX_HEAD_ROT_POSES][L_FRAME48k]; + float *p_head_pose_buf[BINAURAL_CHANNELS * MAX_HEAD_ROT_POSES]; + int16_t i; + int16_t pcm_out_flag; + int16_t numSamplesPerChannelToOutput; + + if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL ) + { + return IVAS_ERR_UNEXPECTED_NULL_POINTER; + } + + st_ivas = hIvasDec->st_ivas; + + if ( is_split_rendering_enabled( st_ivas->hDecoderConfig, st_ivas->hRenderConfig ) == 0 ) + { + return IVAS_ERR_WRONG_PARAMS; + } + + pcm_out_flag = ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0; + numSamplesPerChannelToOutput = isar_get_frame_size( st_ivas ); + + if ( ( error = isar_render_poses( hIvasDec, numSamplesPerChannelToOutput, nOutSamples, needNewFrame ) ) != IVAS_ERR_OK ) + { + return error; + } + + if ( !hIvasDec->hasBeenFedFirstGoodFrame ) + { + return IVAS_ERR_OK; + } + + for ( i = 0; i < BINAURAL_CHANNELS * MAX_HEAD_ROT_POSES; ++i ) + { + p_head_pose_buf[i] = head_pose_buf[i]; + } + + if ( ( error = isar_generate_metadata_and_bitstream( st_ivas, p_head_pose_buf, *nOutSamples, splitRendBits ) ) != IVAS_ERR_OK ) + { + return error; + } + + /* convert to int16 with limiting for BINAURAL_SPLIT_PCM */ + if ( pcm_out_flag ) + { + if ( st_ivas->hDecoderConfig->render_framesize == IVAS_RENDER_FRAMESIZE_5MS ) + { +#ifndef DISABLE_LIMITER + ivas_limiter_dec( st_ivas->hLimiter, p_head_pose_buf, st_ivas->hDecoderConfig->nchan_out, numSamplesPerChannelToOutput, st_ivas->BER_detect ); +#endif + } + else + { + ivas_limiter_dec( st_ivas->hLimiter, p_head_pose_buf, st_ivas->hDecoderConfig->nchan_out, numSamplesPerChannelToOutput, st_ivas->BER_detect ); + } + +#ifdef DEBUGGING + st_ivas->noClipping += +#endif + ivas_syn_output( p_head_pose_buf, numSamplesPerChannelToOutput, st_ivas->hDecoderConfig->nchan_out, (int16_t *) pcmBuf_out ); + } +#else Decoder_Struct *st_ivas; AUDIO_CONFIG output_config; int32_t output_Fs; @@ -2022,8 +2326,9 @@ ivas_error IVAS_DEC_GetSplitBinauralBitstream( #endif ivas_syn_output( pOutput, numSamplesPerChannelToDecode, st_ivas->hDecoderConfig->nchan_out, (int16_t *) pcmBuf_out ); } +#endif - return error; + return IVAS_ERR_OK; } @@ -2034,9 +2339,11 @@ ivas_error IVAS_DEC_GetSplitBinauralBitstream( *---------------------------------------------------------------------*/ static ivas_error ivas_dec_setup_all( - IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ - uint8_t *nTransportChannels, /* o : number of decoded transport PCM channels */ - const int16_t isSplitRend, /* i : split rendering enabled flag */ + IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ + uint8_t *nTransportChannels, /* o : number of decoded transport PCM channels */ +#ifndef FIX_1119_SPLIT_RENDERING_VOIP + const int16_t isSplitRend, /* i : split rendering enabled flag */ +#endif ISAR_SPLIT_REND_BITS_DATA *splitRendBits /* o : output split rendering bits */ ) { @@ -2060,7 +2367,11 @@ static ivas_error ivas_dec_setup_all( st_ivas = hIvasDec->st_ivas; /* Setup IVAS split rendering */ +#ifdef FIX_1119_SPLIT_RENDERING_VOIP + if ( splitRendBits != NULL ) +#else if ( isSplitRend ) +#endif { if ( ( error = isar_set_split_rend_setup( st_ivas->hSplitBinRend, &st_ivas->hRenderConfig->split_rend_config, st_ivas->hCombinedOrientationData, splitRendBits ) ) != IVAS_ERR_OK ) { @@ -2092,7 +2403,11 @@ static ivas_error ivas_dec_setup_all( * - reconfigure the ISAR handle in case of bitrate switching (renderer might change) *-----------------------------------------------------------------*/ +#ifdef FIX_1119_SPLIT_RENDERING_VOIP + if ( st_ivas->ini_frame == 0 && splitRendBits != NULL ) +#else if ( st_ivas->ini_frame == 0 && isSplitRend ) +#endif { if ( ( error = ivas_dec_init_split_rend( st_ivas ) ) != IVAS_ERR_OK ) { @@ -2639,8 +2954,8 @@ ivas_error IVAS_DEC_FeedCustomLsData( *---------------------------------------------------------------------*/ ivas_error IVAS_DEC_GetHrtfTDrendHandle( - IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ - IVAS_DEC_HRTF_HANDLE **hHrtfTD /* o : HRTF handle */ + IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ + IVAS_DEC_HRTF_TD_HANDLE **hHrtfTD /* o : HRTF handle */ ) { if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL || hIvasDec->st_ivas->hHrtfTD == NULL ) @@ -3408,26 +3723,44 @@ ivas_error IVAS_DEC_TSM_SetQuality( #endif +#ifdef FIX_1119_SPLIT_RENDERING_VOIP + +/*---------------------------------------------------------------------* + * ivas_dec_voip_get_samples_common( ) + * + * Main function to output one frame in VoIP. Holds common code for + * regular output configs and split rendering configs. + *---------------------------------------------------------------------*/ + +static ivas_error ivas_dec_voip_get_samples_common + +#else /*---------------------------------------------------------------------* * IVAS_DEC_VoIP_GetSamples( ) * * Main function to decode one frame in VoIP *---------------------------------------------------------------------*/ -ivas_error IVAS_DEC_VoIP_GetSamples( - IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ - uint16_t nSamplesPerChannel, /* i : number of samples per channel requested to be written to output buffer */ - const IVAS_DEC_PCM_TYPE pcmType, /* i : type for the decoded PCM resolution */ - void *pcmBuf, /* o : output synthesis signal */ +ivas_error IVAS_DEC_VoIP_GetSamples +#endif + ( + IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ + uint16_t nSamplesPerChannel, /* i : number of samples per channel requested to be written to output buffer */ + const IVAS_DEC_PCM_TYPE pcmType, /* i : type for the decoded PCM resolution */ + void *pcmBuf, /* o : output synthesis signal */ +#ifdef FIX_1119_SPLIT_RENDERING_VOIP + ISAR_SPLIT_REND_BITS_DATA *splitRendBits, /* o : output split rendering bits */ + float **p_head_pose_buf, /* i : PCM buffer with head-pose data */ +#endif #ifdef SUPPORT_JBM_TRACEFILE - JbmTraceFileWriterFn jbmWriterFn, - void *jbmWriter, + JbmTraceFileWriterFn jbmWriterFn, + void *jbmWriter, #endif - bool *bitstreamReadDone, /* o : flag indicating that bitstream was read */ - uint16_t *nSamplesRendered, /* o : number of samples rendered */ - bool *parametersAvailableForEditing, /* o : indicates whether objects editing is available */ - const uint32_t systemTimestamp_ms /* i : current system timestamp */ -) + bool *bitstreamReadDone, /* o : flag indicating that bitstream was read */ + uint16_t *nSamplesRendered, /* o : number of samples rendered */ + bool *parametersAvailableForEditing, /* o : indicates whether objects editing is available */ + const uint32_t systemTimestamp_ms /* i : current system timestamp */ + ) { Decoder_Struct *st_ivas; DECODER_CONFIG_HANDLE hDecoderConfig; @@ -3455,12 +3788,20 @@ ivas_error IVAS_DEC_VoIP_GetSamples( return IVAS_ERR_WRONG_PARAMS; } -#ifdef TMP_FIX_1119_SPLIT_RENDERING_VOIP +#ifdef FIX_1119_SPLIT_RENDERING_VOIP + if ( ( hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM || + hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) && + splitRendBits == NULL ) + { + return IVAS_ERR_UNEXPECTED_NULL_POINTER; + } +#else if ( hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM || hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) { return IVAS_ERROR( IVAS_ERR_NOT_IMPLEMENTED, "Split rendering is not integrated with VoIP mode" ); } + #endif /* make sure that the FIFO after decoder/scaler contains at least one sound card frame (i.e. 20ms) */ @@ -3484,7 +3825,6 @@ ivas_error IVAS_DEC_VoIP_GetSamples( extBufferedTime_ms = extBufferedSamples * 1000 / hDecoderConfig->output_Fs; dataUnit = NULL; - /* pop one access unit from the jitter buffer */ result = JB4_PopDataUnit( hVoIP->hJBM, systemTimestamp_ms, extBufferedTime_ms, &dataUnit, &scale, &maxScaling ); if ( result != 0 ) @@ -3608,7 +3948,11 @@ ivas_error IVAS_DEC_VoIP_GetSamples( { if ( hIvasDec->nSamplesAvailableNext == 0 || hIvasDec->nSamplesAvailableNext == hIvasDec->nSamplesFrame ) { +#ifdef FIX_1119_SPLIT_RENDERING_VOIP + if ( ( error = IVAS_DEC_GetSamplesDecoder( hIvasDec, splitRendBits ) ) != IVAS_ERR_OK ) +#else if ( ( error = IVAS_DEC_GetSamplesDecoder( hIvasDec, 0, NULL ) ) != IVAS_ERR_OK ) +#endif { return error; } @@ -3630,20 +3974,164 @@ ivas_error IVAS_DEC_VoIP_GetSamples( } } - /* render IVAS frames directly to the output buffer */ - if ( ( error = IVAS_DEC_GetSamplesRenderer( hIvasDec, nSamplesToRender, pcmType, pcm_buffer_offset( pcmBuf, pcmType, *nSamplesRendered * nOutChannels ), &nSamplesRendered_loop, &tmp ) ) != IVAS_ERR_OK ) +#ifdef FIX_1119_SPLIT_RENDERING_VOIP + if ( splitRendBits != NULL ) { - return error; + /* Render head poses from time-scaled transport channels */ + if ( ( error = isar_render_poses( hIvasDec, nSamplesToRender, &nSamplesRendered_loop, &tmp ) ) != IVAS_ERR_OK ) + { + return error; + } + } + else + { +#endif + /* render IVAS frames directly to the output buffer */ + if ( ( error = IVAS_DEC_GetSamplesRenderer( hIvasDec, nSamplesToRender, pcmType, pcm_buffer_offset( pcmBuf, pcmType, *nSamplesRendered * nOutChannels ), &nSamplesRendered_loop, &tmp ) ) != IVAS_ERR_OK ) + { + return error; + } +#ifdef FIX_1119_SPLIT_RENDERING_VOIP } +#endif *nSamplesRendered += nSamplesRendered_loop; update_voip_rendered20ms( hIvasDec, nSamplesRendered_loop ); } } +#ifdef FIX_1119_SPLIT_RENDERING_VOIP + if ( hIvasDec->hasDecodedFirstGoodFrame && splitRendBits != NULL ) + { + /* Analyse head poses over entire frame, generate ISAR metadata and maybe encode if split coded */ + if ( ( error = isar_generate_metadata_and_bitstream( st_ivas, p_head_pose_buf, *nSamplesRendered, splitRendBits ) ) != IVAS_ERR_OK ) + { + return error; + } + + /* Synthesise PCM output if split PCM */ + if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) + { + if ( st_ivas->hDecoderConfig->render_framesize == IVAS_RENDER_FRAMESIZE_5MS ) + { +#ifndef DISABLE_LIMITER + ivas_limiter_dec( st_ivas->hLimiter, p_head_pose_buf, st_ivas->hDecoderConfig->nchan_out, *nSamplesRendered, st_ivas->BER_detect ); +#endif + } + else + { + ivas_limiter_dec( st_ivas->hLimiter, p_head_pose_buf, st_ivas->hDecoderConfig->nchan_out, *nSamplesRendered, st_ivas->BER_detect ); + } + +#ifdef DEBUGGING + st_ivas->noClipping += +#endif + ivas_syn_output( p_head_pose_buf, *nSamplesRendered, st_ivas->hDecoderConfig->nchan_out, (int16_t *) pcmBuf ); + } + } +#endif + return IVAS_ERR_OK; } +#ifdef FIX_1119_SPLIT_RENDERING_VOIP + +/*---------------------------------------------------------------------* + * IVAS_DEC_VoIP_GetSamples( ) + * + * Main function to decode one frame in VoIP + *---------------------------------------------------------------------*/ + +ivas_error IVAS_DEC_VoIP_GetSamples( + IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ + uint16_t nSamplesPerChannel, /* i : number of samples per channel requested to be written to output buffer */ + const IVAS_DEC_PCM_TYPE pcmType, /* i : type for the decoded PCM resolution */ + void *pcmBuf, /* o : output synthesis signal */ +#ifdef SUPPORT_JBM_TRACEFILE + JbmTraceFileWriterFn jbmWriterFn, + void *jbmWriter, +#endif + bool *bitstreamReadDone, /* o : flag indicating that bitstream was read */ + uint16_t *nSamplesRendered, /* o : number of samples rendered */ + bool *parametersAvailableForEditing, /* o : indicates whether objects editing is available */ + const uint32_t systemTimestamp_ms /* i : current system timestamp */ +) +{ + return ivas_dec_voip_get_samples_common( + hIvasDec, + nSamplesPerChannel, + pcmType, + pcmBuf, + NULL, + NULL, +#ifdef SUPPORT_JBM_TRACEFILE + jbmWriterFn, + jbmWriter, +#endif + bitstreamReadDone, + nSamplesRendered, + parametersAvailableForEditing, + systemTimestamp_ms ); +} + + +/*---------------------------------------------------------------------* + * IVAS_DEC_VoIP_GetSplitBinauralBitstream( ) + * + * Main function to decode one split-rendering frame in VoIP + *---------------------------------------------------------------------*/ + +/*! r: error code */ +ivas_error IVAS_DEC_VoIP_GetSplitBinauralBitstream( + IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ + /* const IVAS_DEC_PCM_TYPE pcmType, */ /* i : type for the decoded PCM resolution */ + void *pcmBuf, /* o : output synthesis signal */ + ISAR_SPLIT_REND_BITS_DATA *splitRendBits, /* o : output split rendering bits */ +#ifdef SUPPORT_JBM_TRACEFILE + JbmTraceFileWriterFn jbmWriterFn, + void *jbmWriter, +#endif + bool *bitstreamReadDone, /* o : flag indicating that bitstream was read */ + uint16_t *nSamplesRendered, /* o : number of samples rendered */ + bool *parametersAvailableForEditing, /* o : indicates whether objects editing is available */ + const uint32_t systemTimestamp_ms /* i : current system timestamp */ +) +{ + int16_t i; + float head_pose_buf[BINAURAL_CHANNELS * MAX_HEAD_ROT_POSES][L_FRAME48k]; + float *pp_head_pose_buf[BINAURAL_CHANNELS * MAX_HEAD_ROT_POSES]; + ivas_error error = IVAS_ERR_UNKNOWN; + int16_t nSamplesPerChannel = 0; + + if ( ( error = IVAS_DEC_GetRenderFramesizeSamples( hIvasDec, &nSamplesPerChannel ) ) != IVAS_ERR_OK ) + { + return error; + } + + /* Set pointers to beginning of head pose buffers */ + for ( i = 0; i < BINAURAL_CHANNELS * MAX_HEAD_ROT_POSES; ++i ) + { + pp_head_pose_buf[i] = head_pose_buf[i]; + } + + return ivas_dec_voip_get_samples_common( + hIvasDec, + nSamplesPerChannel, + IVAS_DEC_PCM_INT16, + pcmBuf, + splitRendBits, + pp_head_pose_buf, +#ifdef SUPPORT_JBM_TRACEFILE + jbmWriterFn, + jbmWriter, +#endif + bitstreamReadDone, + nSamplesRendered, + parametersAvailableForEditing, + systemTimestamp_ms ); +} +#endif + /*---------------------------------------------------------------------* * update_voip_rendered20ms( ) @@ -3694,6 +4182,10 @@ ivas_error IVAS_DEC_Flush( return IVAS_ERR_UNEXPECTED_NULL_POINTER; } +#ifdef TMP_1342_WORKAROUND_DEC_FLUSH_BROKEN_IN_SR + hIvasDec->st_ivas->flushing = 1; +#endif + *nSamplesFlushed = min( nSamplesPerChannel, hIvasDec->nSamplesAvailableNext ); nSamplesToRender = (uint16_t) *nSamplesFlushed; @@ -3709,6 +4201,10 @@ ivas_error IVAS_DEC_Flush( *nSamplesFlushed = 0; } +#ifdef TMP_1342_WORKAROUND_DEC_FLUSH_BROKEN_IN_SR + hIvasDec->st_ivas->flushing = 0; +#endif + return error; } @@ -4318,65 +4814,6 @@ int32_t IVAS_DEC_GetCntFramesLimited( } } - -/*---------------------------------------------------------------------* - * forcedRendModeApiToInternalDec() - * - * - *---------------------------------------------------------------------*/ - -static ivas_error forcedRendModeApiToInternalDec( - const IVAS_DEC_FORCED_REND_MODE forcedRendMode, - int16_t *forcedModeInternal ) -{ - switch ( forcedRendMode ) - { - case IVAS_DEC_FORCE_REND_TD_RENDERER: - *forcedModeInternal = FORCE_TD_RENDERER; - break; - case IVAS_DEC_FORCE_REND_CLDFB_RENDERER: - *forcedModeInternal = FORCE_CLDFB_RENDERER; - break; - case IVAS_DEC_FORCE_REND_UNFORCED: - *forcedModeInternal = -1; - break; - default: - return IVAS_ERR_INVALID_FORCE_MODE; - break; - } - - return IVAS_ERR_OK; -} - - -/*---------------------------------------------------------------------* - * IVAS_DEC_SetForcedRendMode() - * - * - *---------------------------------------------------------------------*/ - -ivas_error IVAS_DEC_SetForcedRendMode( - IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ - const IVAS_DEC_FORCED_REND_MODE forcedRendMode /* i : forced renderer mode */ -) -{ - int16_t newForcedRend; - ivas_error error; - - if ( ( error = forcedRendModeApiToInternalDec( forcedRendMode, &newForcedRend ) ) != IVAS_ERR_OK ) - { - return error; - } - - if ( hIvasDec->st_ivas->hDecoderConfig->force_rend != newForcedRend ) - { - hIvasDec->st_ivas->hDecoderConfig->force_rend = newForcedRend; - } - - return IVAS_ERR_OK; -} - - #ifdef DEBUG_SBA_AUDIO_DUMP /*---------------------------------------------------------------------* * IVAS_DEC_GetSbaDebugParams( ) @@ -4726,6 +5163,9 @@ static ivas_error ivas_create_handle_isar( ) { ISAR_DEC_SPLIT_REND_WRAPPER_HANDLE hSplitBinRend; +#ifdef FIX_1119_SPLIT_RENDERING_VOIP + int16_t i; +#endif if ( ( hSplitBinRend = (ISAR_DEC_SPLIT_REND_WRAPPER_HANDLE) malloc( sizeof( ISAR_DEC_SPLIT_REND_WRAPPER ) ) ) == NULL ) { @@ -4734,7 +5174,15 @@ static ivas_error ivas_create_handle_isar( isar_init_split_rend_handles( &hSplitBinRend->splitrend ); +#ifdef FIX_1119_SPLIT_RENDERING_VOIP + hSplitBinRend->hMultiBinTdData = NULL; + for ( i = 0; i < MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS; ++i ) + { + hSplitBinRend->hMultiBinCldfbData[i] = NULL; + } +#else hSplitBinRend->hMultiBinCldfbData = NULL; +#endif hSplitBinRend->hCldfbDataOut = NULL; hSplitBinRend->numTdSamplesPerChannelCached = 0; @@ -4754,10 +5202,28 @@ static void ivas_destroy_handle_isar( ISAR_DEC_SPLIT_REND_WRAPPER_HANDLE *hSplitBinRend /* i/o: ISAR split binaural rendering handle */ ) { +#ifdef FIX_1119_SPLIT_RENDERING_VOIP + int16_t i; +#endif + if ( *hSplitBinRend != NULL ) { +#ifdef FIX_1119_SPLIT_RENDERING_VOIP + if ( ( *hSplitBinRend )->hMultiBinTdData != NULL ) + { + ivas_TD_RINGBUF_Close( &( *hSplitBinRend )->hMultiBinTdData ); + } + for ( i = 0; i < MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS; ++i ) + { + if ( ( *hSplitBinRend )->hMultiBinCldfbData[i] != NULL ) + { + ivas_CLDFB_RINGBUF_Close( &( *hSplitBinRend )->hMultiBinCldfbData[i] ); + } + } +#else free( ( *hSplitBinRend )->hMultiBinCldfbData ); ( *hSplitBinRend )->hMultiBinCldfbData = NULL; +#endif ISAR_PRE_REND_close( &( *hSplitBinRend )->splitrend, NULL ); @@ -4932,6 +5398,32 @@ static ivas_error ivas_dec_reconfig_split_rend( } +#ifdef FIX_1119_SPLIT_RENDERING_VOIP +/*-------------------------------------------------------------------* + * ivas_dec_split_rend_cldfb_in() + * + * + *-------------------------------------------------------------------*/ + +static int16_t ivas_dec_split_rend_cldfb_in( + const RENDERER_TYPE renderer_type /* i : renderer type */ +) +{ + if ( renderer_type == RENDERER_BINAURAL_FASTCONV || + renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM || + renderer_type == RENDERER_BINAURAL_PARAMETRIC || + renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM ) + { + return 1; + } + else + { + return 0; + } +} +#endif + + /*-------------------------------------------------------------------* * ivas_dec_init_split_rend() * @@ -4945,10 +5437,16 @@ static ivas_error ivas_dec_init_split_rend( ivas_error error; int16_t cldfb_in_flag, pcm_out_flag; int16_t mixed_td_cldfb_flag; +#ifdef FIX_1119_SPLIT_RENDERING_VOIP + int16_t i, num_poses; +#endif pcm_out_flag = ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0; cldfb_in_flag = 0; +#ifdef FIX_1119_SPLIT_RENDERING_VOIP + cldfb_in_flag = ivas_dec_split_rend_cldfb_in( st_ivas->renderer_type ); +#else if ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV || st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || @@ -4956,7 +5454,33 @@ static ivas_error ivas_dec_init_split_rend( { cldfb_in_flag = 1; } +#endif +#ifdef FIX_1119_SPLIT_RENDERING_VOIP + ISAR_PRE_REND_GetMultiBinPoseData( &st_ivas->hRenderConfig->split_rend_config, &st_ivas->hSplitBinRend->splitrend.multiBinPoseData, ( st_ivas->hHeadTrackData != NULL ) ? st_ivas->hHeadTrackData->sr_pose_pred_axis : DEFAULT_AXIS ); + + num_poses = st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses; + assert( num_poses <= MAX_HEAD_ROT_POSES ); + + if ( cldfb_in_flag ) + { + for ( i = 0; i < num_poses * BINAURAL_CHANNELS; ++i ) + { + /* note: this is intra-frame heap memory */ + if ( ( error = ivas_CLDFB_RINGBUF_Open( &st_ivas->hSplitBinRend->hMultiBinCldfbData[i], CLDFB_NO_COL_MAX ) ) != IVAS_ERR_OK ) + { + return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Cannot allocate memory for split rendering structure" ); + } + } + } + else + { + if ( ( error = ivas_TD_RINGBUF_Open( &st_ivas->hSplitBinRend->hMultiBinTdData, get_render_frame_size_samples( st_ivas->hDecoderConfig ), num_poses * BINAURAL_CHANNELS ) ) != IVAS_ERR_OK ) + { + return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Cannot allocate memory for split rendering structure" ); + } + } +#else /* note: this is intra-frame heap memory */ if ( ( st_ivas->hSplitBinRend->hMultiBinCldfbData = (ISAR_DEC_SPLIT_REND_MULTI_BIN_CLDFB_DATA_HANDLE) malloc( sizeof( ISAR_DEC_SPLIT_REND_MULTI_BIN_CLDFB_DATA ) ) ) == NULL ) { @@ -4964,6 +5488,7 @@ static ivas_error ivas_dec_init_split_rend( } ISAR_PRE_REND_GetMultiBinPoseData( &st_ivas->hRenderConfig->split_rend_config, &st_ivas->hSplitBinRend->splitrend.multiBinPoseData, ( st_ivas->hHeadTrackData != NULL ) ? st_ivas->hHeadTrackData->sr_pose_pred_axis : DEFAULT_AXIS ); +#endif if ( cldfb_in_flag == 1 && ( st_ivas->hSplitBinRend->splitrend.multiBinPoseData.poseCorrectionMode == ISAR_SPLIT_REND_POSE_CORRECTION_MODE_NONE ) ) { @@ -5017,3 +5542,132 @@ ivas_error IVAS_DEC_is_split_rendering_coded_out( return IVAS_ERR_OK; } + +/*---------------------------------------------------------------------* + * IVAS_DEC_feedSinglePIorientation( ) + * + * Feed a single orientation PI data to external orientation handle. + *---------------------------------------------------------------------*/ + +static ivas_error IVAS_DEC_feedSinglePIorientation( + IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ + bool isOrientationSaved, /* i : flag to indicate if an orientation for this PI type was previously saved */ + IVAS_QUATERNION *savedOrientation /* i : previously saved orientation for this PI type */ +) +{ + int16_t i; + ivas_error error = IVAS_ERR_OK; + IVAS_QUATERNION savedInvOrientation; + + if ( isOrientationSaved ) + { + if ( !hIvasDec->st_ivas->hExtOrientationData ) + { + if ( ( error = ivas_external_orientation_open( &( hIvasDec->st_ivas->hExtOrientationData ), hIvasDec->st_ivas->hDecoderConfig->render_framesize ) ) != IVAS_ERR_OK ) + { + return error; + } + } + + if ( !hIvasDec->st_ivas->hCombinedOrientationData ) + { + if ( ( error = ivas_combined_orientation_open( &( hIvasDec->st_ivas->hCombinedOrientationData ), hIvasDec->st_ivas->hDecoderConfig->output_Fs, hIvasDec->st_ivas->hDecoderConfig->render_framesize ) ) != IVAS_ERR_OK ) + { + return error; + } + } + + QuaternionInverse( *savedOrientation, &savedInvOrientation ); + + /* use the new PI orientation or the previously saved orientation in processing */ + for ( i = 0; i < hIvasDec->st_ivas->hExtOrientationData->num_subframes; i++ ) + { + QuaternionProduct( hIvasDec->st_ivas->hExtOrientationData->Quaternions[i], savedInvOrientation, + &hIvasDec->st_ivas->hExtOrientationData->Quaternions[i] ); + hIvasDec->st_ivas->hExtOrientationData->enableExternalOrientation[i] = true; + } + hIvasDec->updateOrientation = true; + } + return error; +} + + +#ifdef RTP_S4_251135_CR26253_0016_REV1 +/*---------------------------------------------------------------------* + * IVAS_DEC_setDiegeticInput( ) + * + * Set isDiegeticInput flag for combined orientation handle based on PI data. + *---------------------------------------------------------------------*/ + +static void IVAS_DEC_setDiegeticInputPI( + IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ + const bool *diegeticPIValues /* i : diegetic values for the input stream */ +) +{ + if ( hIvasDec->st_ivas->hCombinedOrientationData != NULL ) + { + int8_t i; + for ( i = 0; i < ( 1 + IVAS_MAX_NUM_OBJECTS ); i++ ) + { + hIvasDec->st_ivas->hCombinedOrientationData->isDiegeticInputPI[i] = diegeticPIValues[i]; + } + hIvasDec->st_ivas->hCombinedOrientationData->isDiegeticInputPISet = true; + } +} +#endif + +#ifdef IVAS_RTPDUMP +ivas_error IVAS_RTP_FeedPiDataToDecoder( IVAS_DEC_HANDLE hIvasDec, PIDATA_TS *piData, uint32_t numPiData ) +{ + ivas_error error = IVAS_ERR_OK; + while ( numPiData-- ) + { + uint32_t piDataType = piData->data.noPiData.piDataType; + switch ( piDataType ) + { + case IVAS_PI_SCENE_ORIENTATION: + { + IVAS_QUATERNION *quat = &piData->data.scene.orientation; +#ifdef DEBUGGING + fprintf( stdout, "PI_SCENE_ORIENTATION : %f, %f, %f, %f\n", quat->w, quat->x, quat->y, quat->z ); +#endif + error = IVAS_DEC_feedSinglePIorientation( hIvasDec, true, quat ); + } + break; + + case IVAS_PI_DEVICE_ORIENTATION_COMPENSATED: + { + IVAS_QUATERNION *quat = &piData->data.deviceCompensated.orientation; +#ifdef DEBUGGING + fprintf( stdout, "PI_DEVICE_ORIENTATION : %f, %f, %f, %f\n", quat->w, quat->x, quat->y, quat->z ); +#endif + error = IVAS_DEC_feedSinglePIorientation( hIvasDec, true, quat ); + } + break; + +#ifdef RTP_S4_251135_CR26253_0016_REV1 + case IVAS_PI_DIEGETIC_TYPE: + { +#ifdef DEBUGGING + fprintf( stdout, "PI_DIEGETIC_TYPE : %d, %d, %d, %d, %d\n", piData->data.digeticIndicator.isDiegetic[0], piData->data.digeticIndicator.isDiegetic[1], piData->data.digeticIndicator.isDiegetic[2], piData->data.digeticIndicator.isDiegetic[3], piData->data.digeticIndicator.isDiegetic[4] ); +#endif + IVAS_DEC_setDiegeticInputPI( hIvasDec, piData->data.digeticIndicator.isDiegetic ); + } + break; +#endif + + default: + { + /* NOT HANDLED PI DATA - DO NOTHING */ + } + break; + } + if ( error != IVAS_ERR_OK ) + { + return error; + } + piData++; + } + return error; +} +#endif diff --git a/lib_dec/lib_dec.h b/lib_dec/lib_dec.h index f28279d86b17e8142d579461c1c09b9e84b9ad56..d0d2b501d847425d71c701665cda87ba15f71d36 100644 --- a/lib_dec/lib_dec.h +++ b/lib_dec/lib_dec.h @@ -64,16 +64,6 @@ typedef enum _IVAS_DEC_COMPLEXITY_LEVEL } IVAS_DEC_COMPLEXITY_LEVEL; -#ifdef DEBUGGING -typedef enum _IVAS_DEC_FORCED_REND_MODE -{ - IVAS_DEC_FORCE_REND_CLDFB_RENDERER, - IVAS_DEC_FORCE_REND_TD_RENDERER, - IVAS_DEC_FORCE_REND_UNFORCED, - IVAS_DEC_FORCE_REND_UNDEFINED = 0xffff -} IVAS_DEC_FORCED_REND_MODE; -#endif - typedef enum _IVAS_DEC_PCM_TYPE { IVAS_DEC_PCM_INT16, @@ -162,7 +152,9 @@ ivas_error IVAS_DEC_ReadFormat( /*! r: decoder error code */ ivas_error IVAS_DEC_GetSamplesDecoder( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ +#ifndef FIX_1119_SPLIT_RENDERING_VOIP const int16_t isSplitRend, /* i : split rendering enabled flag */ +#endif ISAR_SPLIT_REND_BITS_DATA *splitRendBits /* o : output split rendering bits */ ); @@ -321,6 +313,24 @@ ivas_error IVAS_DEC_VoIP_GetSamples( const uint32_t systemTimestamp_ms /* i : current system timestamp */ ); +#ifdef FIX_1119_SPLIT_RENDERING_VOIP +/*! r: error code */ +ivas_error IVAS_DEC_VoIP_GetSplitBinauralBitstream( + IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ + /* const IVAS_DEC_PCM_TYPE pcmType, */ /* i : type for the decoded PCM resolution */ + void *pcmBuf, /* o : output synthesis signal */ + ISAR_SPLIT_REND_BITS_DATA *splitRendBits, /* o : output split rendering bits */ +#ifdef SUPPORT_JBM_TRACEFILE + JbmTraceFileWriterFn jbmWriterFn, + void* jbmWriter, +#endif + bool *bitstreamReadDone, /* o : flag indicating that bitstream was read */ + uint16_t *nSamplesRendered, /* o : number of samples rendered */ + bool *parametersAvailableForEditing, /* o : indicates whether objects editing is available */ + const uint32_t systemTimestamp_ms /* i : current system timestamp */ +); +#endif + ivas_error IVAS_DEC_Flush( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ const int16_t nSamplesPerChannel, /* i : number of samples per channel requested to be written to output buffer */ @@ -386,12 +396,6 @@ int32_t IVAS_DEC_GetCntFramesLimited( IVAS_DEC_HANDLE hIvasDec /* i : IVAS decoder handle */ ); -/*! r: error code */ -ivas_error IVAS_DEC_SetForcedRendMode( - IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ - const IVAS_DEC_FORCED_REND_MODE forcedRendMode /* i : forced renderer mode */ -); - #ifdef DEBUG_SBA_AUDIO_DUMP ivas_error IVAS_DEC_GetSbaDebugParams( const IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ @@ -437,7 +441,7 @@ ivas_error IVAS_DEC_FeedCustomLsData( /*! r: error code */ ivas_error IVAS_DEC_GetHrtfTDrendHandle( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ - IVAS_DEC_HRTF_HANDLE **hHrtfTD /* o : HRTF handle */ + IVAS_DEC_HRTF_TD_HANDLE **hHrtfTD /* o : HRTF handle */ ); /*! r: error code */ @@ -553,6 +557,11 @@ void IVAS_DEC_PrintDisclaimer( void ); +#ifdef IVAS_RTPDUMP +#include "ivas_rtp_pi_data.h" +ivas_error IVAS_RTP_FeedPiDataToDecoder( IVAS_DEC_HANDLE hIvasDec, PIDATA_TS *piData, uint32_t numPiData ); +#endif + /* clang-format on */ #endif diff --git a/lib_enc/acelp_core_enc.c b/lib_enc/acelp_core_enc.c index 33bef3e67a26bc212898ab133ba1c5a5ad420f4a..ccc96242b19b326a4b65592e24c62e04118e7cb0 100644 --- a/lib_enc/acelp_core_enc.c +++ b/lib_enc/acelp_core_enc.c @@ -695,12 +695,7 @@ ivas_error acelp_core_enc( if ( !st->Opt_SC_VBR && ( st->idchan == 0 || st->element_mode != IVAS_CPE_TD || ( st->idchan == 1 && st->element_mode == IVAS_CPE_TD && st->tdm_LRTD_flag ) ) ) { /* Apply a non linearity to the SHB excitation */ - non_linearity( bwe_exc, bwe_exc_extended, st->hBWE_TD->old_bwe_exc_extended, L_FRAME32k, &st->hBWE_TD->bwe_non_lin_prev_scale, st->coder_type, voice_factors, st->L_frame -#ifdef NONBE_1328_FIX_NON_LINEARITY - , - st->element_mode -#endif - ); + non_linearity( bwe_exc, bwe_exc_extended, st->hBWE_TD->old_bwe_exc_extended, L_FRAME32k, &st->hBWE_TD->bwe_non_lin_prev_scale, st->coder_type, voice_factors, st->L_frame, st->element_mode ); } if ( st->core_brate == SID_2k40 || st->core_brate == FRAME_NO_DATA ) diff --git a/lib_enc/cod_tcx.c b/lib_enc/cod_tcx.c index 89282ed8b47aeaef18e90e2af78df893a5eb9bb7..87e703d16051d917003691d7ea6f89b87164f69b 100644 --- a/lib_enc/cod_tcx.c +++ b/lib_enc/cod_tcx.c @@ -332,6 +332,13 @@ void TNSAnalysisStereo( pFilter[0]->order = pFilter[1]->order = maxOrder; } + else + { + pFilter[0]->filterType = TNS_FILTER_OFF; + pFilter[1]->filterType = TNS_FILTER_OFF; + sts[0]->hTcxEnc->tnsData[k].nFilters = 0; + sts[1]->hTcxEnc->tnsData[k].nFilters = 0; + } } } } diff --git a/lib_enc/enc_acelp_tcx_main.c b/lib_enc/enc_acelp_tcx_main.c index 8851d9be5e0c358e9470583a923ad7836d14c09b..f2dc342a0e0f2854faa2c579cb2aee3b7704a682 100644 --- a/lib_enc/enc_acelp_tcx_main.c +++ b/lib_enc/enc_acelp_tcx_main.c @@ -99,12 +99,7 @@ void enc_acelp_tcx_main( /* Apply non linearity to the SHB excitation */ if ( st->core == ACELP_CORE && st->igf ) { - non_linearity( ptr_bwe_exc, bwe_exc_extended, st->hBWE_TD->old_bwe_exc_extended, L_FRAME32k, &st->hBWE_TD->bwe_non_lin_prev_scale, st->coder_type, voice_factors, st->L_frame -#ifdef NONBE_1328_FIX_NON_LINEARITY - , - st->element_mode -#endif - ); + non_linearity( ptr_bwe_exc, bwe_exc_extended, st->hBWE_TD->old_bwe_exc_extended, L_FRAME32k, &st->hBWE_TD->bwe_non_lin_prev_scale, st->coder_type, voice_factors, st->L_frame, st->element_mode ); /* update the old_BWE_exc memory */ mvr2r( &old_bwe_exc[L_FRAME32k], st->hBWE_TD->old_bwe_exc, PIT16k_MAX * 2 ); diff --git a/lib_enc/fd_cng_enc.c b/lib_enc/fd_cng_enc.c index da13d3deb865684a8068f023e6dd7e2bdf06d08a..84282281a4e658bd22482147e4499c319d87f564 100644 --- a/lib_enc/fd_cng_enc.c +++ b/lib_enc/fd_cng_enc.c @@ -34,6 +34,8 @@ EVS Codec 3GPP TS26.443 Nov 04, 2021. Version 12.14.0 / 13.10.0 / 14.6.0 / 15.4.0 / 16.3.0 ====================================================================================*/ +#include "cnst.h" +#include "ivas_cnst.h" #include #include #include "options.h" @@ -43,6 +45,9 @@ #include #include "rom_enc.h" #include "rom_com.h" +#ifdef NONBE_MDCT_ST_DTX_FIX_SUBOPT_SPATIAL_CNG +#include "ivas_rom_com.h" +#endif #include "prot.h" #include "ivas_prot.h" #include "stat_enc.h" @@ -154,7 +159,14 @@ void initFdCngEnc( set_f( hFdCngEnc->msLogPeriodog, 0.0f, NPART ); set_f( hFdCngEnc->msLogNoiseEst, 0.0f, NPART ); +#ifdef NONBE_MDCT_ST_DTX_FIX_SUBOPT_SPATIAL_CNG + for ( int16_t i = 0; i < MDCT_ST_DTX_NUM_COHERENCE_BANDS; i++ ) + { + set_f( hFdCngEnc->mem_coherence[i], EPSILON, 4 ); + } +#else set_f( hFdCngEnc->mem_coherence, EPSILON, 4 ); +#endif return; } @@ -891,7 +903,14 @@ void stereoFdCngCoherence( if ( last_element_mode != IVAS_CPE_MDCT ) { +#ifdef NONBE_MDCT_ST_DTX_FIX_SUBOPT_SPATIAL_CNG + for ( i = 0; i < MDCT_ST_DTX_NUM_COHERENCE_BANDS; i++ ) + { + set_f( sts[0]->hFdCngEnc->mem_coherence[i], EPSILON, 4 ); + } +#else set_f( sts[0]->hFdCngEnc->mem_coherence, EPSILON, 4 ); +#endif } if ( sts[0]->core_brate == -1 || sts[1]->core_brate == -1 ) @@ -941,8 +960,65 @@ void stereoFdCngCoherence( pt_fftL = fft_buff[0]; pt_fftR = fft_buff[1]; +#ifndef NONBE_MDCT_ST_DTX_FIX_SUBOPT_SPATIAL_CNG mem = sts[0]->hFdCngEnc->mem_coherence; +#endif + + /* only estimate coherence in inactive frames (or in the first 50 frames to build an initial value) */ + if ( !( sts[0]->ini_frame <= 50 || ( sts[0]->vad_flag == 0 && sts[1]->vad_flag == 0 ) ) ) + { + return; + } +#ifdef NONBE_MDCT_ST_DTX_FIX_SUBOPT_SPATIAL_CNG + for ( i_subfr = 0; i_subfr < 2; i_subfr++ ) + { + int16_t band_len_cum; + + band_len_cum = 0; + i = MDCT_ST_DTX_FIRST_BAND_OFFSET; + + for ( int16_t b = 0; b < MDCT_ST_DTX_NUM_COHERENCE_BANDS; b++ ) + { + band_len_cum += mdct_stereo_dtx_coherence_bandlengths[b]; + cr = ci = eL = eR = EPSILON; + mem = sts[0]->hFdCngEnc->mem_coherence[b]; + + /* for last band, we need to make adjustments to fit with the FFT buffer layout */ + /* do the calculations for fftbin 0 (not anymore as it is skipped - we only calculate coherence above the 2nd bin) and L_FFT/2 outside the loop - imaginary part is always zero there, but not part of the buffer */ + if ( b == MDCT_ST_DTX_NUM_COHERENCE_BANDS - 1 ) + { + /* this calculates values for fft bin at L_FFT/2 - no imaginary value there, not even part of the array */ + cr += pt_fftL[L_FFT / 2] * pt_fftR[L_FFT / 2]; + eL += pt_fftL[L_FFT / 2] * pt_fftL[L_FFT / 2]; + eR += pt_fftR[L_FFT / 2] * pt_fftR[L_FFT / 2]; + + /* skip last fft bin (fs/2 Hz) bin in the loop later */ + --band_len_cum; + } + + for ( ; i < band_len_cum; i++ ) + { + cr += pt_fftL[i] * pt_fftR[i] + pt_fftL[L_FFT - i] * pt_fftR[L_FFT - i]; + ci += -pt_fftL[i] * pt_fftR[L_FFT - i] + pt_fftR[i] * pt_fftL[L_FFT - i]; + eL += pt_fftL[i] * pt_fftL[i] + pt_fftL[L_FFT - i] * pt_fftL[L_FFT - i]; + eR += pt_fftR[i] * pt_fftR[i] + pt_fftR[L_FFT - i] * pt_fftR[L_FFT - i]; + } + + mem[0] = 0.95f * mem[0] + 0.05f * cr; + mem[1] = 0.95f * mem[1] + 0.05f * ci; + mem[2] = 0.95f * mem[2] + 0.05f * eL; + mem[3] = 0.95f * mem[3] + 0.05f * eR; + + /* could be done outside the loop, as the second assignment overwrites the first, but this would mean a second loop over bands */ + sts[0]->hFdCngEnc->hFdCngCom->coherence[b] = sqrtf( ( mem[0] * mem[0] + mem[1] * mem[1] ) / ( mem[2] * mem[3] ) ); + } + + pt_fftL += L_FFT; + pt_fftR += L_FFT; + } + +#else for ( i_subfr = 0; i_subfr < 2; i_subfr++ ) { cr = ci = eL = eR = EPSILON; @@ -970,8 +1046,10 @@ void stereoFdCngCoherence( pt_fftL += L_FFT; pt_fftR += L_FFT; } - +#endif +#ifndef NONBE_MDCT_ST_DTX_FIX_SUBOPT_SPATIAL_CNG sts[0]->hFdCngEnc->hFdCngCom->coherence = sqrtf( ( mem[0] * mem[0] + mem[1] * mem[1] ) / ( mem[2] * mem[3] ) ); +#endif return; } @@ -1172,7 +1250,11 @@ void FdCngEncodeMDCTStereoSID( } /* quantize channel coherence */ +#ifdef NONBE_MDCT_ST_DTX_FIX_SUBOPT_SPATIAL_CNG + coh_idx = (int16_t) floor( sts[0]->hFdCngEnc->hFdCngCom->coherence[0] * 15.f + 0.5f ); +#else coh_idx = (int16_t) floor( sts[0]->hFdCngEnc->hFdCngCom->coherence * 15.f + 0.5f ); +#endif coh_idx = max( 0, min( coh_idx, 15 ) ); /* ---- Write SID bitstream ---- */ @@ -1206,8 +1288,18 @@ void FdCngEncodeMDCTStereoSID( push_indice( sts[ch]->hBstr, IND_ENERGY, gain_idx[ch], 7 ); } +#ifdef NONBE_MDCT_ST_DTX_FIX_SUBOPT_SPATIAL_CNG + /* write the four additional coherence values */ + for ( int16_t b = 1; b < MDCT_ST_DTX_NUM_COHERENCE_BANDS; b++ ) + { + coh_idx = (int16_t) floor( sts[0]->hFdCngEnc->hFdCngCom->coherence[b] * 15.f + 0.5f ); + coh_idx = max( 0, min( coh_idx, 15 ) ); + push_indice( sts[1]->hBstr, IND_ENERGY, coh_idx, 4 ); + } +#else /* pad with zeros to reach common SID frame size */ push_indice( sts[1]->hBstr, IND_ENERGY, 0, ( IVAS_SID_5k2 - 4400 ) / FRAMES_PER_SEC ); +#endif return; @@ -1348,8 +1440,13 @@ void FdCngEncodeDiracMDCTStereoSID( sts[ch]->hDtxEnc->last_CNG_L_frame = sts[ch]->L_frame; } +#ifdef NONBE_MDCT_ST_DTX_FIX_SUBOPT_SPATIAL_CNG + sts[0]->hFdCngEnc->hFdCngCom->coherence[0] = 0.0f; + sts[1]->hFdCngEnc->hFdCngCom->coherence[0] = 0.0f; +#else sts[0]->hFdCngEnc->hFdCngCom->coherence = 0.0f; sts[1]->hFdCngEnc->hFdCngCom->coherence = 0.0f; +#endif /* ---- Write SID bitstream ---- */ diff --git a/lib_enc/init_enc.c b/lib_enc/init_enc.c index e920f21bc9ff957a3f3787e2a88d7ef484b452e8..f5aab5580bbb8dd954fe3a2ae17b064ebf8bbf6d 100755 --- a/lib_enc/init_enc.c +++ b/lib_enc/init_enc.c @@ -54,21 +54,19 @@ *-----------------------------------------------------------------------*/ ivas_error init_encoder( - Encoder_State *st, /* i/o: state structure */ - Encoder_Struct *st_ivas, /* i/o: encoder state structure */ - const int16_t idchan, /* i : channel ID */ - const int16_t var_SID_rate_flag, /* i : flag for variable SID update rate */ - const int16_t interval_SID, /* i : interval for SID update */ - const int16_t vad_only_flag, /* i : flag to indicate front-VAD structure */ - const ISM_MODE ism_mode, /* i : ISM mode */ - const int32_t element_brate /* i : element bitrate */ + Encoder_State *st, /* i/o: state structure */ + Encoder_Struct *st_ivas, /* i/o: encoder state structure */ + const int16_t idchan, /* i : channel ID */ + const int16_t vad_only_flag, /* i : flag to indicate front-VAD structure */ + const ISM_MODE ism_mode, /* i : ISM mode */ + const int32_t element_brate /* i : element bitrate */ ) { - int16_t i; + int16_t i, input_frame; ivas_error error; int32_t igf_brate; - error = IVAS_ERR_OK; + input_frame = (int16_t) ( st->input_Fs / FRAMES_PER_SEC ); /*-----------------------------------------------------------------* * General parameters @@ -303,11 +301,11 @@ ivas_error init_encoder( st->old_input_signal = st->input_buff; if ( st->element_mode == EVS_MONO ) { - st->input = st->input_buff + st->input_Fs / FRAMES_PER_SEC + NS2SA( st->input_Fs, DELAY_FIR_RESAMPL_NS ); + st->input = st->input_buff + input_frame + NS2SA( st->input_Fs, DELAY_FIR_RESAMPL_NS ); } else { - st->input = st->input_buff + st->input_Fs / FRAMES_PER_SEC; + st->input = st->input_buff + input_frame; } } else @@ -438,7 +436,7 @@ ivas_error init_encoder( { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DTX variables\n" ) ); } - dtx_enc_init( st, var_SID_rate_flag, interval_SID ); + dtx_enc_init( st, st_ivas->hEncoderConfig->var_SID_rate_flag, st_ivas->hEncoderConfig->interval_SID ); } else { @@ -475,7 +473,7 @@ ivas_error init_encoder( st->core = -1; st->rf_mode = 0; - return error; + return IVAS_ERR_OK; } /*-----------------------------------------------------------------* @@ -862,11 +860,11 @@ ivas_error init_encoder( if ( st->element_mode > EVS_MONO ) { - InitTransientDetection( (int16_t) ( st->input_Fs / FRAMES_PER_SEC ), 0, st->hTranDet, 1 ); + InitTransientDetection( input_frame, 0, st->hTranDet, 1 ); } else { - InitTransientDetection( (int16_t) ( st->input_Fs / FRAMES_PER_SEC ), NS2SA( st->input_Fs, DELAY_FIR_RESAMPL_NS ), st->hTranDet, 0 ); + InitTransientDetection( input_frame, NS2SA( st->input_Fs, DELAY_FIR_RESAMPL_NS ), st->hTranDet, 0 ); } /*-----------------------------------------------------------------* @@ -878,7 +876,7 @@ ivas_error init_encoder( st->bits_frame_channel = 0; st->side_bits_frame_channel = 0; - return error; + return IVAS_ERR_OK; } diff --git a/lib_enc/ivas_cpe_enc.c b/lib_enc/ivas_cpe_enc.c index 7c5b66cb8ca5f650ab98d7c24ccafb800a315059..188ea1ea348c0e50e88c660a3e0024d08008bee2 100644 --- a/lib_enc/ivas_cpe_enc.c +++ b/lib_enc/ivas_cpe_enc.c @@ -528,43 +528,59 @@ ivas_error ivas_cpe_enc( * Core codec configuration *----------------------------------------------------------------*/ - if ( hCPE->element_mode == IVAS_CPE_MDCT && st_ivas->hMCT == NULL ) +#ifdef FIX_1411_IGF_CRASH_BW_SWITCHING + if ( !( sts[0]->core_brate == SID_2k40 || sts[0]->core_brate == FRAME_NO_DATA ) ) /* Reconfigurations not needed with DTX*/ { - /* set coded BW for MDCT stereo */ - set_bw_stereo( hCPE ); - - /* reconfiguration of MDCT stereo */ - if ( sts[0]->bwidth != sts[0]->last_bwidth || ( ( hCPE->last_element_brate != hCPE->element_brate || hCPE->last_element_mode != hCPE->element_mode ) && sts[0]->bwidth != max_bwidth ) ) +#endif + if ( hCPE->element_mode == IVAS_CPE_MDCT && st_ivas->hMCT == NULL ) { - initMdctStereoEncData( hCPE->hStereoMdct, ivas_format, hCPE->element_mode, hCPE->element_brate, sts[0]->bwidth, 0, NULL, 0 ); - hCPE->hStereoMdct->isSBAStereoMode = ( ( ivas_format == SBA_FORMAT || ivas_format == SBA_ISM_FORMAT ) && ( st_ivas->nchan_transport == 2 ) ); + /* set coded BW for MDCT stereo */ + set_bw_stereo( hCPE ); - if ( hCPE->element_brate <= MAX_MDCT_ITD_BRATE && ivas_format == STEREO_FORMAT ) + /* reconfiguration of MDCT stereo */ + if ( sts[0]->bwidth != sts[0]->last_bwidth || ( ( hCPE->last_element_brate != hCPE->element_brate || hCPE->last_element_mode != hCPE->element_mode ) && sts[0]->bwidth != max_bwidth ) ) { - if ( ( error = initMdctItdHandling( hCPE->hStereoMdct, input_Fs ) ) != IVAS_ERR_OK ) + initMdctStereoEncData( hCPE->hStereoMdct, ivas_format, hCPE->element_mode, hCPE->element_brate, sts[0]->bwidth, 0, NULL, 0 ); + hCPE->hStereoMdct->isSBAStereoMode = ( ( ivas_format == SBA_FORMAT || ivas_format == SBA_ISM_FORMAT ) && ( st_ivas->nchan_transport == 2 ) ); + + if ( hCPE->element_brate <= MAX_MDCT_ITD_BRATE && ivas_format == STEREO_FORMAT ) { - return error; + if ( ( error = initMdctItdHandling( hCPE->hStereoMdct, input_Fs ) ) != IVAS_ERR_OK ) + { + return error; + } } } } - } - /* IGF reconfiguration */ - for ( n = 0; n < n_CoreChannels; n++ ) - { - if ( ( hCPE->last_element_brate != hCPE->element_brate || hCPE->element_mode != hCPE->last_element_mode || ( hCPE->element_mode == IVAS_CPE_TD && sts[0]->bits_frame_nominal != last_bits_frame_nominal ) || sts[n]->last_bwidth != sts[n]->bwidth ) && ( n == 0 || hCPE->element_mode == IVAS_CPE_MDCT ) ) + /* IGF reconfiguration */ + for ( n = 0; n < n_CoreChannels; n++ ) { - int16_t igf; - int16_t bw; + if ( ( hCPE->last_element_brate != hCPE->element_brate || hCPE->element_mode != hCPE->last_element_mode || ( hCPE->element_mode == IVAS_CPE_TD && sts[0]->bits_frame_nominal != last_bits_frame_nominal ) || sts[n]->last_bwidth != sts[n]->bwidth +#ifdef FIX_1411_IGF_CRASH_BW_SWITCHING + || ( sts[n]->last_core_brate == SID_2k40 || sts[n]->last_core_brate == FRAME_NO_DATA ) +#endif + ) && + ( n == 0 || hCPE->element_mode == IVAS_CPE_MDCT ) ) + { + int16_t igf; + int16_t bw; - bw = ( hCPE->element_mode == IVAS_CPE_MDCT ) ? sts[n]->bwidth : max_bwidth; - igf = getIgfPresent( sts[n]->element_mode, sts[n]->bits_frame_nominal * FRAMES_PER_SEC, bw, sts[n]->rf_mode ); + bw = ( hCPE->element_mode == IVAS_CPE_MDCT ) ? sts[n]->bwidth : max_bwidth; + igf = getIgfPresent( sts[n]->element_mode, sts[n]->bits_frame_nominal * FRAMES_PER_SEC, bw, sts[n]->rf_mode ); +#ifdef FIX_1413_IGF_INIT_PRINTOUT + if ( ( error = IGF_Reconfig( &sts[n]->hIGFEnc, igf, 0, sts[n]->bits_frame_nominal * FRAMES_PER_SEC, bw, sts[n]->element_mode, sts[n]->rf_mode ) ) != IVAS_ERR_OK ) +#else if ( ( error = IGF_Reconfig( &sts[n]->hIGFEnc, igf, 0, sts[n]->bits_frame_nominal * FRAMES_PER_SEC, max_bwidth, sts[n]->element_mode, sts[n]->rf_mode ) ) != IVAS_ERR_OK ) - { - return error; +#endif + { + return error; + } } } +#ifdef FIX_1411_IGF_CRASH_BW_SWITCHING } +#endif /* set ACELP@12k8 / ACELP@16k flag for flexible ACELP core */ for ( n = 0; n < n_CoreChannels; n++ ) @@ -925,7 +941,7 @@ ivas_error create_cpe_enc( st->total_brate = hCPE->element_brate / ( st_ivas->nCPE > 1 ? 1 : CPE_CHANNELS ); /* dummy initialization for getting right pointers initialization of input buffers in init_coder_ace_plus() */ st->mct_chan_mode = MCT_CHAN_MODE_REGULAR; - if ( ( error = init_encoder( st, st_ivas, n, hEncoderConfig->var_SID_rate_flag, hEncoderConfig->interval_SID, 0, ISM_MODE_NONE, hCPE->element_brate ) ) != IVAS_ERR_OK ) + if ( ( error = init_encoder( st, st_ivas, n, 0, ISM_MODE_NONE, hCPE->element_brate ) ) != IVAS_ERR_OK ) { return error; } diff --git a/lib_enc/ivas_init_enc.c b/lib_enc/ivas_init_enc.c index 54e0a8c7e5cda49456c97f85bf217b811b0742e8..336e5fcbfe905367258a625a89215ad678aba837 100644 --- a/lib_enc/ivas_init_enc.c +++ b/lib_enc/ivas_init_enc.c @@ -782,7 +782,7 @@ ivas_error ivas_init_encoder( { st_ivas->mc_mode = ivas_mc_mode_select( hEncoderConfig->mc_input_setup, ivas_total_brate ); - if ( ( error = ivas_create_lfe_lpf_enc( &st_ivas->hLfeLpf, hEncoderConfig->input_Fs ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_create_lfe_lpf_enc( &st_ivas->hLfeLpf, input_Fs ) ) != IVAS_ERR_OK ) { return error; } diff --git a/lib_enc/ivas_sce_enc.c b/lib_enc/ivas_sce_enc.c index 913fe907542f53f549525d32fd9ce63a3930eedc..5d1f56ab30c3243eb0f0187e1b32761ee14979d7 100644 --- a/lib_enc/ivas_sce_enc.c +++ b/lib_enc/ivas_sce_enc.c @@ -367,7 +367,7 @@ ivas_error create_sce_enc( st->total_brate = hSCE->element_brate; /* dummy initialization for getting right pointers initialization of input buffers in init_coder_ace_plus() */ st->mct_chan_mode = MCT_CHAN_MODE_REGULAR; - if ( ( error = init_encoder( st, st_ivas, 0, st_ivas->hEncoderConfig->var_SID_rate_flag, st_ivas->hEncoderConfig->interval_SID, 0, st_ivas->ism_mode, hSCE->element_brate ) ) != IVAS_ERR_OK ) + if ( ( error = init_encoder( st, st_ivas, 0, 0, st_ivas->ism_mode, hSCE->element_brate ) ) != IVAS_ERR_OK ) { return error; } diff --git a/lib_enc/ivas_spar_encoder.c b/lib_enc/ivas_spar_encoder.c index 1d0459a3331cddc71b7a80b46489aabf3cd14974..79b00113fcc57bcd55e3951aac232820daa1e3bf 100644 --- a/lib_enc/ivas_spar_encoder.c +++ b/lib_enc/ivas_spar_encoder.c @@ -223,7 +223,7 @@ ivas_error ivas_spar_enc_open( hSpar->hCoreCoderVAD->total_brate = hEncoderConfig->ivas_total_brate; /* dummy initialization for getting right pointers initialization of input buffers in init_coder_ace_plus() */ hSpar->hCoreCoderVAD->mct_chan_mode = MCT_CHAN_MODE_IGNORE; - if ( ( error = init_encoder( hSpar->hCoreCoderVAD, st_ivas, 0, hEncoderConfig->var_SID_rate_flag, hEncoderConfig->interval_SID, 1, st_ivas->ism_mode, hSpar->hCoreCoderVAD->total_brate ) ) != IVAS_ERR_OK ) + if ( ( error = init_encoder( hSpar->hCoreCoderVAD, st_ivas, 0, 1, st_ivas->ism_mode, hSpar->hCoreCoderVAD->total_brate ) ) != IVAS_ERR_OK ) { return error; } diff --git a/lib_enc/ivas_stereo_dft_enc.c b/lib_enc/ivas_stereo_dft_enc.c old mode 100755 new mode 100644 index 0ae36724d89b7ea3237ae4f4e897a6569f518e2c..e59dfa7c98607f6ac5ea789d39c12b3c6b720bee --- a/lib_enc/ivas_stereo_dft_enc.c +++ b/lib_enc/ivas_stereo_dft_enc.c @@ -1316,12 +1316,24 @@ void stereo_dft_enc_process( if ( hStereoDft->hItd->deltaItd[k_offset] != 0 && hStereoDft->hConfig->dmx_active ) { +#ifdef NONBE_FIX_NONBE_BETWEEN_OPTIMIZATION_LEVELS + /* Note: this variable is used as an in-between step when passing the angle to the trig functions. + * this keeps the compilter from applying optimizations at higher optimizaton levels which can break bit-exactness */ + volatile float alpha_tmp; +#endif /*time shift channels*/ alpha = -2.0f * EVS_PI * hStereoDft->hItd->deltaItd[k_offset] / hStereoDft->NFFT; c = 1.f; /*cos(0)*/ s = 0.f; /*sin(0)*/ +#ifdef NONBE_FIX_NONBE_BETWEEN_OPTIMIZATION_LEVELS + + alpha_tmp = alpha; + c1 = cosf( alpha_tmp ); + s1 = sinf( alpha_tmp ); +#else c1 = cosf( alpha ); s1 = sinf( alpha ); +#endif if ( alpha >= 0 ) { @@ -1441,8 +1453,16 @@ void stereo_dft_enc_process( if ( pgIpd[0] != 0.f ) { +#ifdef NONBE_FIX_NONBE_BETWEEN_OPTIMIZATION_LEVELS_2 + volatile float pgIpd_tmp; + + pgIpd_tmp = pgIpd[0]; + c = cosf( pgIpd_tmp ); + s = sinf( pgIpd_tmp ); +#else c = cosf( pgIpd[0] ); s = sinf( pgIpd[0] ); +#endif for ( i = hStereoDft->band_limits_dmx[b]; i < hStereoDft->band_limits_dmx[b + 1]; i++ ) { /*rotate L*/ diff --git a/lib_enc/ivas_stereo_dft_enc_itd.c b/lib_enc/ivas_stereo_dft_enc_itd.c index a095124f780e8606b5cb3e0deea24add3c4d157a..839cc3b104be11bc323a5c99c9e960b12bee6f9d 100644 --- a/lib_enc/ivas_stereo_dft_enc_itd.c +++ b/lib_enc/ivas_stereo_dft_enc_itd.c @@ -869,9 +869,18 @@ void stereo_dft_enc_compute_itd( if ( hCPE->element_mode == IVAS_CPE_DFT && ( hItd->td_itd[k_offset] - hItd->td_itd[k_offset - 1] ) ) { float alphaD, c, s, c1, s1, ctmp, vtmp; +#ifdef NONBE_FIX_NONBE_BETWEEN_OPTIMIZATION_LEVELS_2 + volatile float alphaD_tmp; +#endif alphaD = -2.f * EVS_PI * ( (float) hItd->td_itd[k_offset] - hItd->td_itd[k_offset - 1] ) / hStereoDft->NFFT; +#ifdef NONBE_FIX_NONBE_BETWEEN_OPTIMIZATION_LEVELS_2 + alphaD_tmp = alphaD; + c1 = cosf( alphaD_tmp ); + s1 = sinf( alphaD_tmp ); +#else c1 = cosf( alphaD ); s1 = sinf( alphaD ); +#endif c = 1.f; /* cos(0) */ s = 0.f; /* sin(0) */ diff --git a/lib_enc/ivas_tcx_core_enc.c b/lib_enc/ivas_tcx_core_enc.c index 91adac9a0fbe1c49d145762b1c825190f0dc7533..60a79ea77175adc78bb7826d2e48ca883156209c 100644 --- a/lib_enc/ivas_tcx_core_enc.c +++ b/lib_enc/ivas_tcx_core_enc.c @@ -310,7 +310,7 @@ void stereo_tcx_core_enc( } /*--------------------------------------------------------------* - * Envelope Quantization and FDNS + * LPC Envelope Quantization and FDNS *---------------------------------------------------------------*/ if ( !st->enableTcxLpc ) @@ -336,6 +336,7 @@ void stereo_tcx_core_enc( } } + st->acelp_cfg.midLpc = 0; last_core_orig = st->last_core; for ( n = 0; n < n_subframes; n++ ) { diff --git a/lib_enc/stat_enc.h b/lib_enc/stat_enc.h index 19a87b6a1ddcf3c1fad3c3f444a0efe7eb8c82fd..4d6fe1134b9949118a1002114335f8c0b140ec0a 100755 --- a/lib_enc/stat_enc.h +++ b/lib_enc/stat_enc.h @@ -359,7 +359,11 @@ typedef struct fd_cng_enc_structure int16_t nFFTpartDec; int16_t partDec[NPART]; +#ifdef NONBE_MDCT_ST_DTX_FIX_SUBOPT_SPATIAL_CNG + float mem_coherence[MDCT_ST_DTX_NUM_COHERENCE_BANDS][4]; +#else float mem_coherence[4]; +#endif } FD_CNG_ENC, *HANDLE_FD_CNG_ENC; diff --git a/lib_isar/isar_lc3plus_common.c b/lib_isar/isar_lc3plus_common.c index a186908990ca5366ef81bb6e5a5b53c8726eb6fc..f7fe0db32ebeba38eeec378a57c47154a8031046 100644 --- a/lib_isar/isar_lc3plus_common.c +++ b/lib_isar/isar_lc3plus_common.c @@ -92,3 +92,27 @@ ivas_error IVAS_LC3PLUS_LC3plusRtpErrToIvasErr( return IVAS_ERR_UNKNOWN; } + +/*-----------------------------------------------------------------------------------------* + * Function IVAS_LC3PLUS_UsToLC3plusFrameDuration() + * + * + *-----------------------------------------------------------------------------------------*/ + +LC3PLUS_FrameDuration IVAS_LC3PLUS_UsToLC3plusFrameDuration( + const int16_t lc3PlusFrameDurationUs ) +{ + switch ( lc3PlusFrameDurationUs ) + { + case 2500: + return LC3PLUS_FRAME_DURATION_2p5MS; + case 5000: + return LC3PLUS_FRAME_DURATION_5MS; + case 10000: + return LC3PLUS_FRAME_DURATION_10MS; + default: + break; + } + + return LC3PLUS_FRAME_DURATION_UNDEFINED; +} diff --git a/lib_isar/isar_lc3plus_common.h b/lib_isar/isar_lc3plus_common.h index eb3e7b0ad2d7d245c046cd7fc7699d7a178b8b78..3b52e5b3f15c0ce29c25f7d640140530db05afb6 100644 --- a/lib_isar/isar_lc3plus_common.h +++ b/lib_isar/isar_lc3plus_common.h @@ -61,4 +61,7 @@ ivas_error ISAR_LC3PLUS_LC3plusErrToIvasErr( const LC3PLUS_Error lc3PlusError ); /*! utility function to convert LC3PLUS_Errors to the suitable ivas_error */ ivas_error IVAS_LC3PLUS_LC3plusRtpErrToIvasErr( const LC3PLUS_RTP_ERR lc3PlusRtpError ); +/*! utility function to convert a value in microseconds to an LC3PLUS_FrameDuration */ +LC3PLUS_FrameDuration IVAS_LC3PLUS_UsToLC3plusFrameDuration( const int16_t lc3PlusFrameDuration ); + #endif /* ISAR_LC3PLUS_COM_H */ diff --git a/lib_isar/isar_lc3plus_dec.c b/lib_isar/isar_lc3plus_dec.c index c5d78f444684b1433894114ea9f1377ee9a49e4b..0455144381e2b9cf8f8f30b55b53841dbe4a2246 100644 --- a/lib_isar/isar_lc3plus_dec.c +++ b/lib_isar/isar_lc3plus_dec.c @@ -135,7 +135,7 @@ ivas_error ISAR_LC3PLUS_DEC_Open( return IVAS_ERROR( ISAR_LC3PLUS_LC3plusErrToIvasErr( err ), "lc3plus_dec_init failed\n" ); } - err = lc3plus_dec_set_frame_dms( ( *handle )->handles[iCh], config.lc3plus_frame_duration_us / 100 ); + err = lc3plus_dec_set_frame_dms( ( *handle )->handles[iCh], IVAS_LC3PLUS_UsToLC3plusFrameDuration( config.lc3plus_frame_duration_us ) ); if ( LC3PLUS_OK != err ) { ISAR_LC3PLUS_DEC_Close( handle ); diff --git a/lib_isar/isar_lc3plus_enc.c b/lib_isar/isar_lc3plus_enc.c index c6e2d31334271169367f7f0695806256a7f4c049..4be070b95778c1be5796d5a6a5d434d40d3b556d 100644 --- a/lib_isar/isar_lc3plus_enc.c +++ b/lib_isar/isar_lc3plus_enc.c @@ -168,7 +168,7 @@ ivas_error ISAR_LC3PLUS_ENC_Open( return IVAS_ERROR( ISAR_LC3PLUS_LC3plusErrToIvasErr( err ), "lc3plus_enc_init failed\n" ); } - err = lc3plus_enc_set_frame_dms( ( *handle )->handles[iCh], config.lc3plus_frame_duration_us / 100 ); + err = lc3plus_enc_set_frame_dms( ( *handle )->handles[iCh], IVAS_LC3PLUS_UsToLC3plusFrameDuration( config.lc3plus_frame_duration_us ) ); if ( err != LC3PLUS_OK ) { ISAR_LC3PLUS_ENC_Close( handle ); diff --git a/lib_isar/isar_prot.h b/lib_isar/isar_prot.h index 7f66b317b50df80400c5baf296bd9a011114ca21..53d70184f04a4bb3a684912de2dcebd1343bf5ca 100644 --- a/lib_isar/isar_prot.h +++ b/lib_isar/isar_prot.h @@ -67,8 +67,13 @@ void isar_splitBinPreRendClose( void lc3plusTimeAlignCldfbPoseCorr( SPLIT_REND_WRAPPER *hSplitBin, /* i/o: Split renderer pre-renderer handle */ +#ifdef FIX_1119_SPLIT_RENDERING_VOIP + float *Cldfb_In_BinReal[][CLDFB_NO_COL_MAX], /* i/o: Binaural signals, real part */ + float *Cldfb_In_BinImag[][CLDFB_NO_COL_MAX] /* i/o: Binaural signals, imag. part */ +#else float Cldfb_In_BinReal[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* i/o: Binaural signals, real part */ float Cldfb_In_BinImag[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX] /* i/o: Binaural signals, imag. part */ +#endif ); ivas_error splitRendLc3plusEncodeAndWrite( @@ -183,9 +188,14 @@ void isar_splitBinLCLDEncClose( void isar_splitBinLCLDEncProcess( ISAR_BIN_HR_SPLIT_LCLD_ENC_HANDLE hSplitBinLCLDEnc, /* i/o: ISAR LCLD encoder handle */ +#ifdef FIX_1119_SPLIT_RENDERING_VOIP + float *Cldfb_In_Real[][CLDFB_NO_COL_MAX], /* i/o: Binaural signals, real part */ + float *Cldfb_In_Imag[][CLDFB_NO_COL_MAX], /* i/o: Binaural signals, imag. part */ +#else float Cldfb_In_Real[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], float Cldfb_In_Imag[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], - const int32_t available_bits, +#endif + const int32_t available_bits, /* i : available bit-budget */ ISAR_SPLIT_REND_BITS_HANDLE pBits /* i/o: ISAR bits handle */ ); @@ -271,8 +281,13 @@ void isar_rend_CldfbSplitPreRendProcess( const ISAR_BIN_HR_SPLIT_PRE_REND_HANDLE hBinHrSplitPreRend, /* i : binaural pre-renderer handle */ const IVAS_QUATERNION headPosition, /* i : head rotation QUATERNION */ MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData, /* i/o: pose correction data handle */ +#ifdef FIX_1119_SPLIT_RENDERING_VOIP + float* Cldfb_In_BinReal[][CLDFB_NO_COL_MAX], /* i : Binaural signals, real part */ + float* Cldfb_In_BinImag[][CLDFB_NO_COL_MAX], /* i : Binaural signals, imag. part */ +#else float Cldfb_In_BinReal[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* i : Binaural signals, real part */ float Cldfb_In_BinImag[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* i : Binaural signals, imag. part */ +#endif ISAR_SPLIT_REND_BITS_HANDLE pBits, /* i/o: ISAR bits handle */ const int32_t target_md_bits, /* i : ISAR MD bitrate */ const int16_t low_res_pre_rend_rot, /* i : low time resolution pre-renderer flag */ diff --git a/lib_isar/isar_splitRend_lcld_enc.c b/lib_isar/isar_splitRend_lcld_enc.c index ac43233e1a5813567871592b30357200304e4ce7..1ecb83887b7927708f7c161cb6655b9cfc9e557f 100644 --- a/lib_isar/isar_splitRend_lcld_enc.c +++ b/lib_isar/isar_splitRend_lcld_enc.c @@ -158,10 +158,15 @@ void isar_splitBinLCLDEncClose( void isar_splitBinLCLDEncProcess( ISAR_BIN_HR_SPLIT_LCLD_ENC_HANDLE hSplitBinLCLDEnc, /* i/o: ISAR LCLD encoder handle */ +#ifdef FIX_1119_SPLIT_RENDERING_VOIP + float *Cldfb_In_Real[][CLDFB_NO_COL_MAX], /* i/o: Binaural signals, real part */ + float *Cldfb_In_Imag[][CLDFB_NO_COL_MAX], /* i/o: Binaural signals, imag. part */ +#else float Cldfb_In_Real[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], float Cldfb_In_Imag[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], - const int32_t available_bits, - ISAR_SPLIT_REND_BITS_HANDLE pBits /* i/o: ISAR bits handle */ +#endif + const int32_t available_bits, /* i : available bit-budget */ + ISAR_SPLIT_REND_BITS_HANDLE pBits /* i/o: ISAR bits handle */ ) { int32_t iBitsWritten, itr, available_bits_itr, rem_itr, available_bits_local; diff --git a/lib_isar/isar_splitRendererPre.c b/lib_isar/isar_splitRendererPre.c index c7098f997f5f94263258d78579e744a4acc2f414..370e02398d5a9cb2eae31418e531083b7490fd94 100644 --- a/lib_isar/isar_splitRendererPre.c +++ b/lib_isar/isar_splitRendererPre.c @@ -53,7 +53,16 @@ * Local function declarations *---------------------------------------------------------------------*/ -static void isar_SplitRenderer_GetRotMd( ISAR_BIN_HR_SPLIT_PRE_REND_HANDLE hBinHrSplitPreRend, MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData, float Cldfb_RealBuffer_Ref_Binaural[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], float Cldfb_ImagBuffer_Ref_Binaural[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], const int16_t low_res, const int16_t ro_md_flag ); +static void isar_SplitRenderer_GetRotMd( ISAR_BIN_HR_SPLIT_PRE_REND_HANDLE hBinHrSplitPreRend, MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData, +#ifdef FIX_1119_SPLIT_RENDERING_VOIP + float *Cldfb_RealBuffer_Ref_Binaural[][CLDFB_NO_COL_MAX], + float *Cldfb_ImagBuffer_Ref_Binaural[][CLDFB_NO_COL_MAX], +#else + float Cldfb_RealBuffer_Ref_Binaural[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], + float Cldfb_ImagBuffer_Ref_Binaural[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], +#endif + const int16_t low_res, + const int16_t ro_md_flag ); /*------------------------------------------------------------------------- @@ -271,11 +280,21 @@ static void ComputePostPredCov( static void ComputeBandedCrossCov( +#ifdef FIX_1119_SPLIT_RENDERING_VOIP + float *Cldfb_RealBuffer1[][CLDFB_NO_COL_MAX], + float *Cldfb_ImagBuffer1[][CLDFB_NO_COL_MAX], +#else float Cldfb_RealBuffer1[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], float Cldfb_ImagBuffer1[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], +#endif const int16_t ch_start_idx1, +#ifdef FIX_1119_SPLIT_RENDERING_VOIP + float *Cldfb_RealBuffer2[][CLDFB_NO_COL_MAX], + float *Cldfb_ImagBuffer2[][CLDFB_NO_COL_MAX], +#else float Cldfb_RealBuffer2[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], float Cldfb_ImagBuffer2[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], +#endif const int16_t ch_start_idx2, float out_cov_re[BINAURAL_CHANNELS][BINAURAL_CHANNELS], float out_cov_im[BINAURAL_CHANNELS][BINAURAL_CHANNELS], @@ -340,8 +359,13 @@ static void ComputeBandedCrossCov( static void ComputeBandedCov( +#ifdef FIX_1119_SPLIT_RENDERING_VOIP + float *Cldfb_RealBuffer[][CLDFB_NO_COL_MAX], + float *Cldfb_ImagBuffer[][CLDFB_NO_COL_MAX], +#else float Cldfb_RealBuffer[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], float Cldfb_ImagBuffer[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], +#endif const int16_t ch_start_idx, float out_cov_re[][BINAURAL_CHANNELS], float out_cov_im[][BINAURAL_CHANNELS], @@ -1345,10 +1369,15 @@ static void isar_SplitRenderer_quant_code( *------------------------------------------------------------------------*/ static void isar_SplitRenderer_GetRotMd( - ISAR_BIN_HR_SPLIT_PRE_REND_HANDLE hBinHrSplitPreRend, /* i/o: binaural renderer handle */ - MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData, /* i/o: pose correction data handle */ + ISAR_BIN_HR_SPLIT_PRE_REND_HANDLE hBinHrSplitPreRend, /* i/o: binaural renderer handle */ + MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData, /* i/o: pose correction data handle */ +#ifdef FIX_1119_SPLIT_RENDERING_VOIP + float *Cldfb_RealBuffer_Ref_Binaural[][CLDFB_NO_COL_MAX], /* o : Reference Binaural signals */ + float *Cldfb_ImagBuffer_Ref_Binaural[][CLDFB_NO_COL_MAX], /* o : Reference Binaural signals */ +#else float Cldfb_RealBuffer_Ref_Binaural[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* o : Reference Binaural signals */ float Cldfb_ImagBuffer_Ref_Binaural[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* o : Reference Binaural signals */ +#endif const int16_t low_res, const int16_t ro_md_flag /* i : Flag to indicate real only metadata for yaw */ ) @@ -1430,15 +1459,20 @@ static void isar_SplitRenderer_GetRotMd( *------------------------------------------------------------------------*/ void isar_rend_CldfbSplitPreRendProcess( - const ISAR_BIN_HR_SPLIT_PRE_REND_HANDLE hBinHrSplitPreRend, /* i : binaural pre-renderer handle */ - const IVAS_QUATERNION headPosition, /* i : head rotation QUATERNION */ - MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData, /* i/o: pose correction data handle */ - float Cldfb_In_BinReal[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* i : Binaural signals, real part */ - float Cldfb_In_BinImag[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* i : Binaural signals, imag. part */ - ISAR_SPLIT_REND_BITS_HANDLE pBits, /* i/o: ISAR bits handle */ - const int32_t target_md_bits, /* i : ISAR MD bitrate */ - const int16_t low_res_pre_rend_rot, /* i : low time resolution pre-renderer flag */ - const int16_t ro_md_flag /* i : real only metadata for yaw flag */ + const ISAR_BIN_HR_SPLIT_PRE_REND_HANDLE hBinHrSplitPreRend, /* i : binaural pre-renderer handle */ + const IVAS_QUATERNION headPosition, /* i : head rotation QUATERNION */ + MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData, /* i/o: pose correction data handle */ +#ifdef FIX_1119_SPLIT_RENDERING_VOIP + float *Cldfb_In_BinReal[][CLDFB_NO_COL_MAX], /* i : Binaural signals, real part */ + float *Cldfb_In_BinImag[][CLDFB_NO_COL_MAX], /* i : Binaural signals, imag. part */ +#else + float Cldfb_In_BinReal[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* i : Binaural signals, real part */ + float Cldfb_In_BinImag[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* i : Binaural signals, imag. part */ +#endif + ISAR_SPLIT_REND_BITS_HANDLE pBits, /* i/o: ISAR bits handle */ + const int32_t target_md_bits, /* i : ISAR MD bitrate */ + const int16_t low_res_pre_rend_rot, /* i : low time resolution pre-renderer flag */ + const int16_t ro_md_flag /* i : real only metadata for yaw flag */ ) { push_wmops( "isar_rend_CldfbSplitPreRendProcess" ); @@ -1893,6 +1927,11 @@ ivas_error isar_renderMultiTDBinToSplitBinaural( uint8_t useLc3plus; float *in_delayed[MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS]; int16_t i; +#ifdef FIX_1119_SPLIT_RENDERING_VOIP + int16_t j; + float *p_Cldfb_In_BinReal[MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS][CLDFB_NO_COL_MAX]; + float *p_Cldfb_In_BinImag[MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS][CLDFB_NO_COL_MAX]; +#endif int32_t num_slots; push_wmops( "isar_renderMultiTDBinToSplitBinaural" ); @@ -1902,6 +1941,17 @@ ivas_error isar_renderMultiTDBinToSplitBinaural( useLc3plus = hSplitBin->hLc3plusEnc != NULL; +#ifdef FIX_1119_SPLIT_RENDERING_VOIP + for ( i = 0; i < MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS; ++i ) + { + for ( j = 0; j < CLDFB_NO_COL_MAX; ++j ) + { + p_Cldfb_In_BinReal[i][j] = Cldfb_In_BinReal[i][j]; + p_Cldfb_In_BinImag[i][j] = Cldfb_In_BinImag[i][j]; + } + } +#endif + if ( useLc3plus ) { /*this should always have the time resolution of pose correction MD. Note that this does not change frame size of LC3plus*/ @@ -1963,7 +2013,21 @@ ivas_error isar_renderMultiTDBinToSplitBinaural( { target_md_bits = isar_get_split_rend_md_target_brate( SplitRendBitRate, pcm_out_flag ) * L_FRAME48k / 48000; - isar_rend_CldfbSplitPreRendProcess( hSplitBin->hBinHrSplitPreRend, headPosition, &hSplitBin->multiBinPoseData, Cldfb_In_BinReal, Cldfb_In_BinImag, pBits, target_md_bits, low_res_pre_rend_rot, ro_md_flag ); + isar_rend_CldfbSplitPreRendProcess( + hSplitBin->hBinHrSplitPreRend, + headPosition, + &hSplitBin->multiBinPoseData, +#ifdef FIX_1119_SPLIT_RENDERING_VOIP + p_Cldfb_In_BinReal, + p_Cldfb_In_BinImag, +#else + Cldfb_In_BinReal, + Cldfb_In_BinImag, +#endif + pBits, + target_md_bits, + low_res_pre_rend_rot, + ro_md_flag ); } if ( pcm_out_flag == 0 ) @@ -1978,7 +2042,17 @@ ivas_error isar_renderMultiTDBinToSplitBinaural( pBits->codec_frame_size_ms = codec_frame_size_ms; pBits->isar_frame_size_ms = isar_frame_size_ms; - isar_splitBinLCLDEncProcess( hSplitBin->hSplitBinLCLDEnc, Cldfb_In_BinReal, Cldfb_In_BinImag, available_bits, pBits ); + isar_splitBinLCLDEncProcess( + hSplitBin->hSplitBinLCLDEnc, +#ifdef FIX_1119_SPLIT_RENDERING_VOIP + p_Cldfb_In_BinReal, + p_Cldfb_In_BinImag, +#else + Cldfb_In_BinReal, + Cldfb_In_BinImag, +#endif + available_bits, + pBits ); } else { @@ -2039,9 +2113,14 @@ ivas_error isar_renderMultiTDBinToSplitBinaural( *------------------------------------------------------------------------*/ void lc3plusTimeAlignCldfbPoseCorr( - SPLIT_REND_WRAPPER *hSplitBin, /* i/o: Split renderer pre-renderer handle */ + SPLIT_REND_WRAPPER *hSplitBin, /* i/o: Split renderer pre-renderer handle */ +#ifdef FIX_1119_SPLIT_RENDERING_VOIP + float *Cldfb_In_BinReal[][CLDFB_NO_COL_MAX], /* i/o: Binaural signals, real part */ + float *Cldfb_In_BinImag[][CLDFB_NO_COL_MAX] /* i/o: Binaural signals, imag. part */ +#else float Cldfb_In_BinReal[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* i/o: Binaural signals, real part */ float Cldfb_In_BinImag[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX] /* ii/: Binaural signals, imag. part */ +#endif ) { float Cldfb_In_BinReal_tmp[MAX_HEAD_ROT_POSES][BINAURAL_CHANNELS][2][CLDFB_NO_CHANNELS_MAX]; diff --git a/lib_isar/isar_stat.h b/lib_isar/isar_stat.h index 587c3c8ea7309fc6a4fe0fe3cbc66dbebfdcd0f8..b244370dd3eceed843c49f02de1087c21a0e0b9e 100644 --- a/lib_isar/isar_stat.h +++ b/lib_isar/isar_stat.h @@ -345,4 +345,17 @@ typedef struct } SPLIT_REND_WRAPPER; +#ifdef FIX_1119_SPLIT_RENDERING_VOIP +typedef struct +{ + float *real; + float *imag; + uint32_t capacity; + uint32_t write_pos; + uint32_t read_pos; + int16_t is_full; + +} ISAR_CLDFB_RINGBUF, *ISAR_CLDFB_RINGBUF_HANDLE; +#endif + #endif /* ISAR_STAT_H */ diff --git a/lib_isar/lib_isar_pre_rend.c b/lib_isar/lib_isar_pre_rend.c index d24bc94de7411889db57dd0757fbd50945d41dcf..5318d217b26a49fc302653656ce747b162b54988 100644 --- a/lib_isar/lib_isar_pre_rend.c +++ b/lib_isar/lib_isar_pre_rend.c @@ -272,21 +272,26 @@ void ISAR_PRE_REND_GetMultiBinPoseData( *------------------------------------------------------------------------*/ ivas_error ISAR_PRE_REND_MultiBinToSplitBinaural( - SPLIT_REND_WRAPPER *hSplitBin, /* i/o: Split renderer pre-renerer handle */ - const IVAS_QUATERNION headPosition, /* i : head rotation QUATERNION */ - const int32_t SplitRendBitRate, /* i : Split renderer bitrate */ - ISAR_SPLIT_REND_CODEC splitCodec, /* i/o: Split renderer codec */ - const int16_t isar_frame_size_ms, /* i : ISAR framesize */ - int16_t codec_frame_size_ms, /* i/o: ISAR transport codec framesize */ - ISAR_SPLIT_REND_BITS_HANDLE pBits, /* i/o: ISAR bits struct handle */ + SPLIT_REND_WRAPPER *hSplitBin, /* i/o: Split renderer pre-renerer handle */ + const IVAS_QUATERNION headPosition, /* i : head rotation QUATERNION */ + const int32_t SplitRendBitRate, /* i : Split renderer bitrate */ + ISAR_SPLIT_REND_CODEC splitCodec, /* i/o: Split renderer codec */ + const int16_t isar_frame_size_ms, /* i : ISAR framesize */ + int16_t codec_frame_size_ms, /* i/o: ISAR transport codec framesize */ + ISAR_SPLIT_REND_BITS_HANDLE pBits, /* i/o: ISAR bits struct handle */ +#ifdef FIX_1119_SPLIT_RENDERING_VOIP + float *Cldfb_In_BinReal[][CLDFB_NO_COL_MAX], /* i/o: CLDFB real buffer */ + float *Cldfb_In_BinImag[][CLDFB_NO_COL_MAX], /* i/o: CLDFB imag buffer */ +#else float Cldfb_In_BinReal[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* i/o: CLDFB real buffer */ float Cldfb_In_BinImag[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* i/o: CLDFB imag buffer */ - const int16_t max_bands, /* i : CLDFB bands */ - float *output[], /* i/o: PCM in/out buffer */ - const int16_t low_res_pre_rend_rot, /* i : low time resolution pre-renderer flag */ - const int16_t cldfb_in_flag, /* i : Flag to indicate CLDFB or time domain input */ - const int16_t pcm_out_flag, /* i : Flag to indicate PCM output */ - const int16_t ro_md_flag /* i : Flag to indicate real only metadata for yaw */ +#endif + const int16_t max_bands, /* i : CLDFB bands */ + float *output[], /* i/o: PCM in/out buffer */ + const int16_t low_res_pre_rend_rot, /* i : low time resolution pre-renderer flag */ + const int16_t cldfb_in_flag, /* i : Flag to indicate CLDFB or time domain input */ + const int16_t pcm_out_flag, /* i : Flag to indicate PCM output */ + const int16_t ro_md_flag /* i : Flag to indicate real only metadata for yaw */ ) { ivas_error error; @@ -374,20 +379,22 @@ ivas_error ISAR_PRE_REND_MultiBinToSplitBinaural( } else { - int16_t ch, slot_idx; + int16_t ch, slot_idx, num_slots; + num_slots = (int16_t) ( isar_frame_size_ms * 1000000 / CLDFB_SLOT_NS ); + /* CLDFB synthesis of main pose */ for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) { float *Cldfb_In_BinReal_p[CLDFB_NO_COL_MAX]; float *Cldfb_In_BinImag_p[CLDFB_NO_COL_MAX]; - for ( slot_idx = 0; slot_idx < CLDFB_NO_COL_MAX; slot_idx++ ) + for ( slot_idx = 0; slot_idx < num_slots; slot_idx++ ) { Cldfb_In_BinReal_p[slot_idx] = Cldfb_In_BinReal[ch][slot_idx]; Cldfb_In_BinImag_p[slot_idx] = Cldfb_In_BinImag[ch][slot_idx]; } - cldfbSynthesis( Cldfb_In_BinReal_p, Cldfb_In_BinImag_p, output[ch], hSplitBin->hCldfbHandles->cldfbSyn[0]->no_channels * CLDFB_NO_COL_MAX, hSplitBin->hCldfbHandles->cldfbSyn[ch] ); + cldfbSynthesis( Cldfb_In_BinReal_p, Cldfb_In_BinImag_p, output[ch], hSplitBin->hCldfbHandles->cldfbSyn[0]->no_channels * num_slots, hSplitBin->hCldfbHandles->cldfbSyn[ch] ); } pBits->pose_correction = hSplitBin->multiBinPoseData.poseCorrectionMode; diff --git a/lib_isar/lib_isar_pre_rend.h b/lib_isar/lib_isar_pre_rend.h index 9f9f098f3906f5f724a7ba1e69655dcdca92a131..e1124a714cba32b68e23c2f900692d1f82e0efbf 100644 --- a/lib_isar/lib_isar_pre_rend.h +++ b/lib_isar/lib_isar_pre_rend.h @@ -71,8 +71,13 @@ ivas_error ISAR_PRE_REND_MultiBinToSplitBinaural( const int16_t isar_frame_size_ms, /* i : ISAR framesize */ int16_t codec_frame_size_ms, /* i/o: ISAR transport codec framesize */ ISAR_SPLIT_REND_BITS_HANDLE pBits, /* i/o: ISAR bits struct handle */ +#ifdef FIX_1119_SPLIT_RENDERING_VOIP + float* Cldfb_In_BinReal[][CLDFB_NO_COL_MAX], /* i/o: CLDFB real buffer */ + float* Cldfb_In_BinImag[][CLDFB_NO_COL_MAX], /* i/o: CLDFB imag buffer */ +#else float Cldfb_In_BinReal[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* i/o: CLDFB real buffer */ float Cldfb_In_BinImag[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* i/o: CLDFB imag buffer */ +#endif const int16_t max_bands, /* i : CLDFB bands */ float *output[], /* i/o: PCM in/out buffer */ const int16_t low_res_pre_rend_rot, /* i : low time resolution pre-renderer flag */ diff --git a/lib_lc3plus/adjust_global_gain.c b/lib_lc3plus/adjust_global_gain.c index d5c122d525bb06ddb3cc68b370f59cd7fa51058f..1de3585fcdf6637bda406a965cc6599d9d951bd2 100644 --- a/lib_lc3plus/adjust_global_gain.c +++ b/lib_lc3plus/adjust_global_gain.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.5.1 * +* ETSI TS 103 634 V1.6.1 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -12,7 +12,7 @@ #include "functions.h" void processAdjustGlobalGain_fl(LC3_INT* gg_idx, LC3_INT gg_idx_min, LC3_INT gg_idx_off, LC3_FLOAT* gain, LC3_INT target, LC3_INT nBits, LC3_INT* gainChange, LC3_INT fs_idx - , LC3_INT16 hrmode, LC3_INT16 frame_dms + , LC3_INT16 hrmode, LC3PLUS_FrameDuration frame_dms ) { LC3_FLOAT delta; @@ -20,7 +20,7 @@ void processAdjustGlobalGain_fl(LC3_INT* gg_idx, LC3_INT gg_idx_min, LC3_INT gg_ LC3_INT gg_idx_inc; LC3_FLOAT factor; - if (frame_dms == 25) + if (frame_dms == LC3PLUS_FRAME_DURATION_2p5MS) { if (target < 520) { @@ -28,11 +28,11 @@ void processAdjustGlobalGain_fl(LC3_INT* gg_idx, LC3_INT gg_idx_min, LC3_INT gg_ } else { factor = 4; } - } else if (frame_dms == 50) + } else if (frame_dms == LC3PLUS_FRAME_DURATION_5MS) { factor = 2; } - else if (frame_dms == 75) + else if (frame_dms == LC3PLUS_FRAME_DURATION_7p5MS) { factor = 1.2; } diff --git a/lib_lc3plus/al_fec_fl.c b/lib_lc3plus/al_fec_fl.c index adae19dc394aa7e04cffb95af2257f03433cd073..9b7276f23732ccd64bc458351930e5c226529731 100644 --- a/lib_lc3plus/al_fec_fl.c +++ b/lib_lc3plus/al_fec_fl.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.5.1 * +* ETSI TS 103 634 V1.6.1 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -500,11 +500,12 @@ void fec_encoder(LC3_INT16 mode, LC3_INT16 epmr, LC3_UINT8 *iobuf, LC3_INT16 dat assert((slot_bytes >= FEC_SLOT_BYTES_MIN && slot_bytes <= FEC_SLOT_BYTES_MAX) && "fec_encoder: slot_bytes out of range"); - tmp -= mode == 1 ? 1 : n_codewords * (mode - 1); // reed solomon redundancy - tmp -= slot_bytes == 40 ? crc1_bytes_by_mode0[mode] : crc1_bytes_by_mode1[mode]; // crc1 - tmp -= (n_pccw > 0) && (mode > 1) ? crc2_bytes_by_mode[mode] : 0; // crc2 + tmp -= mode == 1 ? 1 : n_codewords * (mode - 1); /* reed solomon redundancy */ + tmp -= slot_bytes == 40 ? crc1_bytes_by_mode0[mode] : crc1_bytes_by_mode1[mode]; /* crc1 */ + tmp -= (n_pccw > 0) && (mode > 1) ? crc2_bytes_by_mode[mode] : 0; /* crc2 */ assert(data_bytes == tmp && "fec_encoder: inconsistent payload size"); assert(n_codewords - n_pccw >= 6); + (void)tmp; } /* data preproc: re-ordering and hash extension */ @@ -1194,7 +1195,7 @@ FEC_STATIC LC3_INT32 rs16_detect_and_correct(LC3_UINT8 *iobuf, LC3_INT32 n_symb, } } } - assert(n_mode_candidates <= 4); // suppress false gcc warning when OPTIM=3 + assert(n_mode_candidates <= 4); /* suppress false gcc warning when OPTIM=3 */ /* sort mode candidates by risk */ for (i = 0; i < n_mode_candidates; i++) diff --git a/lib_lc3plus/apply_global_gain.c b/lib_lc3plus/apply_global_gain.c index 48305676cd334408aec56e6d22f3a2e493c11dcd..107a9ff497e5341f6a72bad957ba8b561b366360 100644 --- a/lib_lc3plus/apply_global_gain.c +++ b/lib_lc3plus/apply_global_gain.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.5.1 * +* ETSI TS 103 634 V1.6.1 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * diff --git a/lib_lc3plus/ari_codec.c b/lib_lc3plus/ari_codec.c index 2a76ecac8338b848957fd73b96f480d930038317..4721a4c1e69b5b365e01b7ebec6d74a5a7808eef 100644 --- a/lib_lc3plus/ari_codec.c +++ b/lib_lc3plus/ari_codec.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.5.1 * +* ETSI TS 103 634 V1.6.1 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -90,7 +90,9 @@ static LC3_INT16 pc_check_bytes(LC3_INT32* bp, Decoder_State_fl* st_fl, LC3_INT3 { bp_side_local = bp_side_local + 1; } - } else { + } + else + { bp_local = bp_local - 1; } @@ -131,12 +133,16 @@ static LC3_INT16 pc_check_bytes(LC3_INT32* bp, Decoder_State_fl* st_fl, LC3_INT3 if (st_fl->pc_bfi == 2) { - +#ifdef CR13_B_FIX_PC_BINS + if (st_fl->pc_c_bp_side && (*bp_side + 1) <= st_fl->pc_be_bp_right) +#else if ((st_fl->pc_c_bp && (*bp + 1) >= st_fl->pc_be_bp_left) || (st_fl->pc_c_bp_side && (*bp_side + 1) <= st_fl->pc_be_bp_right)) +#endif { st_fl->pc_inv_bin = cur_bin; return 1; - } else if ((st_fl->pc_c_bp && *bp >= 0) || (st_fl->pc_c_bp_side && *bp_side <= (st_fl->pc_bytes - 1))) + } + else if ((st_fl->pc_c_bp && *bp >= 0) || (st_fl->pc_c_bp_side && *bp_side <= (st_fl->pc_bytes - 1))) { st_fl->pc_inv_bin = MIN(st_fl->pc_inv_bin, cur_bin); return 0; @@ -147,9 +153,56 @@ static LC3_INT16 pc_check_bytes(LC3_INT32* bp, Decoder_State_fl* st_fl, LC3_INT3 #ifdef WMOPS pop_wmops(); -#endif +#endif + return 0; +} + +#ifdef CR13_B_FIX_PC_BINS +static LC3_INT16 pc_check_bytes_ac_decode(LC3_INT32* bp, Decoder_State_fl* st_fl, LC3_INT32 from_left, LC3_INT32 mask_side, LC3_INT32* bp_side, LC3_INT16 cur_bin) +{ + LC3_INT32 bp_local, bp_side_local; +#ifdef WMOPS + push_wmops("pc_check_bytes"); +#endif + + if (st_fl->pc_bytes > 0) + { + bp_local = *bp; + bp_side_local = *bp_side; + + if (from_left) + { + if (mask_side == 1) + { + bp_side_local = bp_side_local + 1; + } + } + else + { + bp_local = bp_local - 1; + } + + + if (!st_fl->pc_enc && st_fl->pc_b_right > -1) + { + + if (st_fl->pc_bfi == 2) + { + if ((st_fl->pc_c_bp && (*bp) > st_fl->pc_be_bp_left)) + { + st_fl->pc_inv_bin = cur_bin; + return 1; + } + } + } + } + +#ifdef WMOPS + pop_wmops(); +#endif return 0; } +#endif void ac_dec_init_fl(LC3_UINT8* ptr, LC3_INT* bp, Decoder_State_fl* st_fl, LC3_INT from_left, LC3_INT mask_side, LC3_INT *bp_side) { @@ -184,15 +237,25 @@ LC3_INT32 ac_decode_fl(Decoder_State_fl* st, const LC3_INT16* freq, LC3_INT32 nu push_wmops("ac_decode_fl"); #endif +#ifdef CR13_B_FIX_PC_BINS + if (pc_check_bytes_ac_decode(bp, st, from_left, mask_side, bp_side, cur_bin) != 0) + { + st->BER_detect = 1; + return 0; + } +#endif + tmp = st->ac_range_fl >> 10; - if (st->ac_low_fl >= (LC3_UINT32)(tmp << 10)) { + if (st->ac_low_fl >= (LC3_UINT32)(tmp << 10)) + { st->BER_detect = 1; } val = num_sym - 1; - while (st->ac_low_fl < (LC3_UINT32)(tmp * freq[val])) { + while (st->ac_low_fl < (LC3_UINT32)(tmp * freq[val])) + { val--; } @@ -201,7 +264,8 @@ LC3_INT32 ac_decode_fl(Decoder_State_fl* st, const LC3_INT16* freq, LC3_INT32 nu st->ac_low_fl = st->ac_low_fl - tmp * freq[val]; st->ac_range_fl = tmp * symfreq_loc; - while (st->ac_range_fl < 65536) { + while (st->ac_range_fl < 65536) + { st->ac_low_fl = ((LC3_INT32)st->ac_low_fl) & ((LC3_INT32)(16777215)); if(pc_check_bytes(bp, st, from_left, mask_side, bp_side, cur_bin) != 0) @@ -209,7 +273,7 @@ LC3_INT32 ac_decode_fl(Decoder_State_fl* st, const LC3_INT16* freq, LC3_INT32 nu st->BER_detect = 1; return 1; } - + st->ac_low_fl = st->ac_low_fl << 8; st->ac_low_fl = st->ac_low_fl + ptr[*bp]; *bp = *bp + 1; @@ -241,7 +305,7 @@ void read_bit_fl(LC3_UINT8* ptr, LC3_INT* mask_side, LC3_INT* bp_side, LC3_INT* void processAriDecoder_fl(LC3_UINT8* bytes, LC3_INT bp_side, LC3_INT mask_side, LC3_INT L_spec, LC3_INT fs_idx, LC3_INT enable_lpc_weighting, LC3_INT tns_numfilters, LC3_INT lsbMode, LC3_INT lastnz, LC3_INT* bfi, LC3_INT* tns_order, LC3_INT fac_ns_idx, LC3_INT gg_idx, uint8_t * resBits, LC3_INT* x, LC3_INT* nf_seed, LC3_INT* tns_idx, LC3_INT* zero_frame, LC3_INT numbytes, - LC3_INT* nbits_residual, LC3_INT* residualPresent, LC3_INT frame_dms, + LC3_INT* nbits_residual, LC3_INT* residualPresent, LC3PLUS_FrameDuration frame_dms, LC3_INT32 n_pc, LC3_INT32 be_bp_left, LC3_INT32 be_bp_right, LC3_INT32 enc, LC3_INT32 *b_left, LC3_INT32 *spec_inv_idx, LC3_INT hrmode ) @@ -298,7 +362,7 @@ void processAriDecoder_fl(LC3_UINT8* bytes, LC3_INT bp_side, LC3_INT mask_side, tmp = MAXLAG; - if (frame_dms <= 50) + if (frame_dms <= LC3PLUS_FRAME_DURATION_5MS) { tmp /= 2; } @@ -334,11 +398,13 @@ void processAriDecoder_fl(LC3_UINT8* bytes, LC3_INT bp_side, LC3_INT mask_side, } /* Spectral data */ - for (k = 0; k < lastnz; k = k + 2) { + for (k = 0; k < lastnz; k = k + 2) + { /* Context */ t = c + rateFlag; - if (k > (L_spec >> 1)) { + if (k > (L_spec >> 1)) + { t = t + 256; } @@ -346,23 +412,29 @@ void processAriDecoder_fl(LC3_UINT8* bytes, LC3_INT bp_side, LC3_INT mask_side, x[k] = 0; x[k + 1] = 0; - if (hrmode == 1) { + if (hrmode == 1) + { max_lev = 13 + 8; - } else { + } + else + { max_lev = 13; } - for (lev = 0; lev <= max_lev; lev++) { + for (lev = 0; lev <= max_lev; lev++) + { lev1 = MIN(lev, 3); pki = ari_spec_lookup_fl[t + lev1 * 1024]; sym = ac_decode_fl(&st, &ari_spec_cumfreq_fl[pki][0], 17, ptr, &bp, 1, mask_side, &bp_side, k); - if (sym < 16) { + if (sym < 16) + { break; } - if (lsbMode == 0 || lev > 0) { + if (lsbMode == 0 || lev > 0) + { if(pc_check_bytes(&bp, &st, 0, mask_side, &bp_side, k) != 0) { goto ber_detect; @@ -495,6 +567,12 @@ void processAriDecoder_fl(LC3_UINT8* bytes, LC3_INT bp_side, LC3_INT mask_side, { idx_len *= EXT_RES_ITER_MAX; } +#ifdef CR9_C_ADD_1p25MS + if (frame_dms == LC3PLUS_FRAME_DURATION_1p25MS) { + idx_len *= 3; + } +#endif + *nbits_residual = MIN(*nbits_residual, idx_len); *residualPresent = 1; diff --git a/lib_lc3plus/attack_detector.c b/lib_lc3plus/attack_detector.c index 10e3617c8b1e6d53fbde11f5f81143b76aebb486..b74a320563c5aa7750c600b104d86cdf457d8fea 100644 --- a/lib_lc3plus/attack_detector.c +++ b/lib_lc3plus/attack_detector.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.5.1 * +* ETSI TS 103 634 V1.6.1 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * diff --git a/lib_lc3plus/clib.h b/lib_lc3plus/clib.h index 7d2fb7bb10ee010a4abd381340c9a370b0fd5525..51970ef1465511dc6b0ef324b7f7d438e3e727e2 100644 --- a/lib_lc3plus/clib.h +++ b/lib_lc3plus/clib.h @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.5.1 * +* ETSI TS 103 634 V1.6.1 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * diff --git a/lib_lc3plus/com_entropy.c b/lib_lc3plus/com_entropy.c new file mode 100644 index 0000000000000000000000000000000000000000..da7ee8edaa89db77882e811c08dbdbc4de5355dd --- /dev/null +++ b/lib_lc3plus/com_entropy.c @@ -0,0 +1,29 @@ +/****************************************************************************** +* ETSI TS 103 634 V1.6.1 * +* Low Complexity Communication Codec Plus (LC3plus) * +* * +* Copyright licence is solely granted through ETSI Intellectual Property * +* Rights Policy, 3rd April 2019. No patent licence is granted by implication, * +* estoppel or otherwise. * +******************************************************************************/ + +#include "options.h" +#include "wmc_auto.h" +#include "functions.h" + +LC3_INT16 getLastNzBits (LC3_INT16 N) +{ + LC3_INT16 minBits; + + minBits = ceil(LC3_LOGTWO(N >> 1)); +#ifdef CR9_C_ADD_1p25MS + /* minimum of 2 spare bits */ + if (((1 << minBits) - (N >> 1)) < 2) + { + minBits++; + } +#endif + + return minBits; +} + diff --git a/lib_lc3plus/constants.c b/lib_lc3plus/constants.c index 047b21226d4c1503f1e6735b860c56831dc62a09..1040d0098af1917fd973bd93cfa3a78ef52d2d02 100644 --- a/lib_lc3plus/constants.c +++ b/lib_lc3plus/constants.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.5.1 * +* ETSI TS 103 634 V1.6.1 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -11,6 +11,731 @@ #include "wmc_auto.h" #include "functions.h" + +#ifdef CR9_C_ADD_1p25MS_LRSNS +/* Stage 1 section A */ +const LC3_FLOAT lrsns_st1A_topTab_1bitNoDC[2 * 16] = { /*[2][16] = */ + /* idx0 --> flat: no additional perceptual weighting than tilt */ + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + + /* : idx1 */ /* Q11 quantized */ + +1.187011718750000e+00, +1.014160156250000e+00, +7.773437500000000e-01, +4.023437500000000e-01, +7.812500000000000e-03, -2.636718750000000e-01, -2.734375000000000e-01, -2.617187500000000e-01, + -7.519531250000000e-02, +1.879882812500000e-01, +4.526367187500000e-01, +5.512695312500000e-01, +2.221679687500000e-01, -3.710937500000000e-01, -1.253417968750000e+00, -2.304199218750000e+00 +}; + +/* compressed c_domain indexes for merged CB st1B */ + +const LC3_INT16 lrsns_st1B_merged170orderSortedSegmCnt[4] = { + 88, 42, 24, 16 +}; +const LC3_INT16 lrsns_st1B_merged170orderSortedSegmCum[5] = { + 0, 88, 130, 154, 170 +}; + +/* each index point to two vectors in the split 2x32 stage 1 cb , lower 12 bits in use [1][5][1][5] */ +/* bits b13,b12 are ff,fr,rf,rr , handled by counting the cumulative idx */ +const LC3_INT16 lrsns_st1B_merged170orderSort12bitIdx[170] = { + 15, 19, 119, 162, 177, 185, 227, 296, 297, 353, 357, 369, 370, 372, 377, 416, 418, + 420, 515, 529, 561, 569, 603, 625, 627, 673, 680, 754, 756, 777, 786, 801, 809, 834, + 837, 848, 849, 850, 852, 864, 865, 866, 872, 904, 908, 913, 914, 924, 928, 978, 996, + 1041, 1082, 1088, 1089, 1090, 1139, 1651, 1751, 1982, 1999, 2066, 2120, 2194, 2247, 2391, 2495, 2579, + 2626, 2632, 2649, 2959, 3071, 3107, 3223, 3331, 3395, 3415, 3548, 3641, 3675, 3703, 3820, 3825, 3849, + 3853, 3865, 3916, 45, 107, 110, 151, 168, 169, 247, 305, 313, 323, 357, 361, 777, 785, + 841, 1096, 1123, 1347, 1427, 1498, 1555, 1617, 1643, 1646, 1651, 1774, 2051, 2087, 2265, 2296, 2371, + 2971, 3022, 3241, 3287, 3319, 3331, 3543, 3601, 3683, 3689, 3697, 122, 259, 274, 387, 401, 496, + 657, 707, 739, 850, 857, 928, 929, 932, 996, 1123, 1270, 1303, 1609, 2151, 2193, 2371, 2632, + 2633, 55, 119, 291, 299, 343, 681, 1001, 1307, 1427, 1609, 1646, 1683, 2157, 2222, 3331, 4060 +}; + + +/* Q11 quntized LF+HF tables as already available in existing 10ms BASOP */ +const LC3_INT16 st1SCF0_7_base5_32x8_Q11[8 * 32] = { + 4634 , 1666, -1086, -2778, -3276, -2951, -2343, -1547, 6032, + 4939 , 1967, -908, -2517, -3186, -3066, -2287, + -4477, -4038, -3660, -3929, -3674, -2780, -1445, -98, + 1421, 1957, 1178, -235, -1323, -1950, -2200, -1553, + -2657, -1516, -707, -642, -825, -762, -160, 199, + 1873, 3570, 3910, 3162, 2239, 1326, 74, -608, + -5149, -5922, -4105, -1538, 904, 2462, 2719, 2500, + -1889, 1295, 2227, 1246, 269, -607, -424, 276, + 1619, 1287, 805, 983, 917, 430, 13, -176, 2965, 5579, 4733, 1915, -563, -1847, -1927, -1298, + 1625, 29, -1163, -1341, -982, -356, 139, 604, 5579, 6061, 3788, 1154, 287, 737, 1412, 1310, + -1087, -436, 12, 870, 969, 1759, 2439, 2040, 3456, 4989, 4772, 3645, 2958, 3113, 3015, 2002, + -6045, -3264, -225, 796, 1050, 1286, 1685, 1794, 209, 1208, 1268, 2595, 4955, 4612, 1078, -812, + 5494, 2718, 267, -693, -754, -393, -317, -480, 9886, 6389, 2857, 513, -806, -1318, -1316, -1481, + 180, -1167, -2345, -3420, -3779, -3204, -2289, -1094, 2849, 4058, 2279, -451, -1587, -1217, 280, 1676, + 788, -329, -1105, -1084, 390, 5244, 5773, 1345, 3957, 6165, 6278, 5122, 3954, 1172, -1662, -2409, + 359, -1537, -2129, -2326, -2134, -31, 4240, 7024, -2433, 751, 2682, 3447, 2562, 1930, 1692, 901, + 5188, 4327, 2586, 1560, 1069, 243, -926, -1434, 8190, 8354, 5781, 3535, 1325, -678, -1811, -2308, + 1040, 3253, 3541, 2062, 772, 976, 2227, 2227, 6489, 6673, 4961, 3675, 3117, 2400, 1002, -128, + 3879, 2562, 1209, 1246, 1798, 2292, 2086, 1271, 1943, 4367, 5578, 5673, 5208, 4138, 1700, -56, + -3851, -2589, 638, 3762, 4621, 4195, 4496, 4150, 505, 1957, 3114, 4048, 3974, 4575, 4072, 2606 }; + +const LC3_INT16 st1SCF8_15_base5_32x8_Q11[8 * 32] = { + 475, -2066, -4387, -4865, -4568, -4456, -4691, -5187, -2652, -3685, -3865, -3707, -3611, -3756, -3696, -3557, + 285, -529, -1333, -2188, -3316, -4480, -5402, -6101, -648, -978, -1129, -993, -488, -293, 140, 181, + 1801, 611, -1875, -4519, -5614, -5860, -5915, -6045, -608, -1997, -2782, -2015, -1337, -2027, -3307, -4930, + 698, 551, 115, 102, -195, -1557, -4767, -7724, -2892, -3042, -2429, -1280, 315, 1180, 1628, 1222, + -469, -683, -1657, -3350, -3860, -3369, -2878, -3004, -2194, -2903, -3172, -2976, -2113, -1414, -878, -1014, + -1210, -146, 708, 616, -2291, -4999, -4564, -3881, -1738, -1194, 184, 1731, 2183, 1511, 525, -1008, + 2336, 1974, 781, -989, -3720, -5740, -6623, -7084, -771, 87, 1058, 516, -443, -1094, -1312, -1781, + 1362, 2249, 2833, 2751, 1685, 442, -829, -2192, -1692, -1375, -468, 1063, 2800, 4465, 5194, 4508, + 2888, 1545, -2674, -3832, -2540, -2595, -4171, -5933, 740, -45, -1187, -1801, -1742, -1596, -1500, -1819, + 896, 626, -15, -1015, -1652, -2507, -3485, -4598, 1327, 1397, 519, 151, 644, 481, 296, -140, + 2292, 2529, 1207, -2810, -4856, -4112, -3414, -3945, 291, -227, -579, -14, 586, 94, -1234, -4640, + 1032, 1694, 2293, 2415, 2212, 1429, -1869, -7325, -1026, -667, 58, 537, 738, 1302, 1964, 2678, + 7679, 3120, -937, -1636, -792, -770, -1347, -2625, -2361, -2269, -1152, -452, -716, -1543, -2025, -2638, + 2106, 2248, 1574, 422, -702, -1546, -2134, -3079, 264, 1412, 2301, 2682, 2775, 2915, 2370, 832, + 2745, 2847, 2140, 1302, -563, -3173, -5002, -6194, 4380, 8698, 5934, 1910, -600, -1660, -1616, -1916, + 1157, 3260, 4911, 6220, 5456, 2853, 827, -1344, -865, 668, 2850, 4570, 5349, 5459, 4917, 3603 +}; + + +/* harmonically trained st1C with pitch info */ +/* Q11 values, to enable BE in synthesis */ +/* st1C mean for pitch_rx==0 && ltpf_rx==* */ +const LC3_FLOAT lrsns_st1C_pitch0_mp0Q11[16] = { ++1.119628906250000e+00f, +1.270507812500000e+00f, +9.570312500000000e-01f, +5.668945312500000e-01f, +4.296875000000000e-01f, +2.036132812500000e-01f, +1.660156250000000e-02f, -8.251953125000000e-02f, +-1.796875000000000e-01f, -2.641601562500000e-01f, -2.949218750000000e-01f, -1.552734375000000e-01f, -1.401367187500000e-01f, -4.677734375000000e-01f, -1.143066406250000e+00f, -1.835449218750000e+00f +}; + +/* st1C mean for pitch_rx==1 && ltpf_rx==0 */ +float lrsns_st1C_pitch1_mp1Q11[16] = { ++1.259765625000000e-01f, +3.930664062500000e-01f, +3.852539062500000e-01f, +2.602539062500000e-01f, +2.475585937500000e-01f, +6.005859375000000e-02f, +8.935546875000000e-02f, +7.568359375000000e-02f, ++4.296875000000000e-02f, +7.373046875000000e-02f, +2.612304687500000e-01f, +4.975585937500000e-01f, +4.995117187500000e-01f, +2.832031250000000e-02f, -9.829101562500000e-01f, -2.056152343750000e+00f +}; + +#ifdef LRSNS_CBC_NO_LTPF_DEPENDENCY +/* lrsns_st1C_Both_fullTableResWord8 */ +const LC3_FLOAT* lrsns_st1CTrainedMapMeans[2] = { lrsns_st1C_pitch0_mp0Q11 ,lrsns_st1C_pitch1_mp1Q11 }; +#else +/* st1C mean for pitch_rx==1 && ltpf_rx==1 */ +const LC3_FLOAT lrsns_st1C_pitch2_mp2Q11[16] = { +-2.055664062500000e-01f, +1.005859375000000e-01f, +1.948242187500000e-01f, +1.577148437500000e-01f, +1.870117187500000e-01f, +1.220703125000000e-02f, +1.137695312500000e-01f, +1.284179687500000e-01f, ++1.171875000000000e-01f, +1.860351562500000e-01f, +4.462890625000000e-01f, +7.148437500000000e-01f, +7.128906250000000e-01f, +1.938476562500000e-01f, -9.296875000000000e-01f, -2.129394531250000e+00f +}; + +/* lrsns_st1C_Both_fullTableResWord8 */ +const LC3_FLOAT* lrsns_st1CTrainedMapMeans[3] = { lrsns_st1C_pitch0_mp0Q11 ,lrsns_st1C_pitch1_mp1Q11,lrsns_st1C_pitch2_mp2Q11 }; +#endif +/* float tables BE representable in Q11 after Q4*Q7 multiplication */ +const LC3_FLOAT lrsns_st1C_Both_scaleQ4_7p4bits[2] = { ++5.375f, +86.0 /* exact BASOP Q4 value, used in synthesis */ +}; +const LC3_FLOAT lrsns_st1C_Both_inv_scaleQ15_7p4bits[2] = { ++1.860351562500000e-01f , +6096.0 /* BASOP Q15 value, invScale used in encoder side for target creation */ +}; + +/* BASOP table for stage1C BE representable in Q11 after Q4*Q7 multiplication */ +const LC3_INT16 lrsns_st1C_Both_scaleQ4_7p4bits_fx[2] = { +-1, 86 /* exact BASOP Q4 value, used in synthesis */ +}; +const LC3_INT16 lrsns_st1C_Both_inv_scaleQ15_7p4bits_fx[2] = { +-1 , 6096 /* BASOP Q15 value, invScale used in encoder side target creation */ +}; + +/* Word8 storage of ST1 C codebook to save ROM in BASOP */ +const LC3_INT8 lrsns_st1C_Both_Word8[170 * 16] = { + -88, -78, -57, -39, -27, -15, -6, 3, 11, 17, 20, 23, 32, 47, 69, 88, + -86, -40, -7, 4, 1, 5, 10, 10, 0, -5, -5, 4, 9, 23, 38, 39, + -71, -69, -65, -49, -29, -5, 16, 30, 21, -8, -3, 15, 27, 40, 63, 87, + -71, -36, -10, -5, 2, 17, 15, 18, 24, 24, 13, 7, 11, 2, -6, -7, + -70, -23, 13, 12, 0, 7, 19, 14, 1, -1, 6, 3, -2, 1, 9, 13, + -68, -79, -67, -42, -26, -17, 8, 29, 38, 34, 32, 33, 32, 36, 36, 21, + -62, -66, -56, -41, -33, -13, 11, 17, 16, 17, 28, 39, 40, 41, 40, 23, + -61, -62, -51, -31, -26, -25, -23, -15, -3, 12, 24, 30, 33, 43, 68, 85, + -60, -63, -47, -28, -17, -9, 13, 30, 36, 31, 25, 24, 27, 28, 17, -6, + -57, -47, -25, -11, -17, -12, -1, -7, -4, -1, -7, 1, 23, 44, 58, 60, + -54, -59, -61, -50, -22, -1, 25, 37, 37, 31, 21, 13, 21, 31, 27, 4, + -53, -36, -14, 3, 13, 12, 14, 19, 26, 31, 30, 22, 3, -12, -21, -36, + -53, -52, -39, -24, -12, 2, 23, 34, 32, 27, 16, 8, 11, 21, 14, -9, + -45, -46, -31, -16, -8, -5, 6, 21, 31, 32, 26, 22, 18, 11, 1, -17, + -40, -11, 7, 11, 4, 13, 5, -13, -28, -20, -10, 0, 8, 19, 23, 32, + -40, -32, -18, -2, 6, 12, 8, 1, 2, 4, 9, 15, 20, 13, 3, -1, + -40, -9, 11, 7, 6, 6, 0, -13, -13, -1, 7, 12, 8, 4, 6, 9, + -39, 5, 19, 12, 13, 9, 4, 3, -2, -6, -4, 2, 3, -2, -6, -13, + -38, -13, 1, 1, 4, 17, 16, 12, 8, 0, -9, -23, -20, 0, 18, 24, + -38, -25, -13, -12, -24, -17, -6, 4, 10, 6, -17, -13, 6, 35, 51, 53, + -38, -34, -30, -24, -9, 7, 17, 18, 14, 9, 11, 14, 18, 18, 12, -3, + -38, -36, -19, 2, 20, 28, 28, 33, 31, 16, 6, 4, -4, -12, -23, -36, + -38, -46, -38, -22, -17, -22, -11, 18, 35, 34, 27, 25, 24, 22, 12, -3, + -37, 3, 34, 16, -8, -30, -54, -45, -23, -9, -3, 14, 12, 15, 42, 72, + -35, -55, -53, -38, -30, -20, -5, 6, 13, 16, 21, 25, 29, 41, 48, 36, + -35, -45, -50, -47, -48, -41, -31, -16, -1, 9, 20, 21, 29, 51, 81, 104, + -35, -46, -46, -35, -24, -11, 9, 27, 34, 33, 27, 25, 21, 17, 9, -6, + -34, -24, -20, -13, -11, -7, 2, 2, -13, -4, 23, 31, 21, 16, 16, 16, + -33, -54, -66, -58, -43, -23, -16, -10, 1, 18, 23, 18, 28, 51, 74, 89, + -31, 16, 51, 48, 30, 18, 12, 2, -7, -17, -23, -26, -29, -26, -17, -1, + -31, -20, -18, -20, -13, -8, 1, 13, 20, 2, -13, -8, 12, 27, 31, 25, + -30, -33, -40, -36, -30, -11, 3, 10, 14, 15, 24, 29, 31, 27, 20, 8, + -30, -45, -40, -20, -14, -21, -31, -23, -10, 1, 12, 15, 22, 39, 64, 83, + -29, -15, 0, 4, 8, 16, 17, 11, 5, 4, 2, 1, 11, 7, -13, -29, + -29, -29, -20, -3, 15, 27, 27, 18, 17, 29, 31, 19, -3, -19, -35, -44, + -28, -21, -26, -26, 2, 22, 30, 37, 34, 18, 8, 2, 0, -9, -18, -25, + -28, -19, -11, -7, -1, 8, 13, 17, 21, 25, 30, 23, 5, -9, -26, -42, + -27, -9, 3, 2, 3, 11, -7, -14, 9, 25, 14, -6, -4, -1, 0, 2, + -27, -27, -25, -17, -18, -10, -8, -16, -18, 1, 16, 20, 29, 35, 38, 27, + -26, -44, -8, 8, -12, -5, -6, -9, 1, 13, 17, 15, 35, 42, 6, -29, + -24, -22, -16, -13, -12, 0, 10, 15, 19, 8, 5, 13, 26, 18, -5, -21, + -24, -42, -47, -33, -31, -32, -19, 2, 13, 13, 9, 4, 16, 35, 58, 80, + -24, -16, -7, -4, -7, -6, -8, -9, -3, 5, 11, 15, 23, 22, 12, -2, + -23, -13, 1, 1, -19, -17, 7, 21, 29, 29, 20, 12, 0, -9, -15, -26, + -23, -39, -40, -26, -19, -13, -4, -10, -21, -20, 0, 18, 26, 39, 57, 73, + -22, -26, -25, -25, -28, -21, -3, 23, 35, 38, 31, 20, 10, 5, 2, -13, + -21, 3, 27, 20, -9, -8, 4, 3, -3, -10, -18, -16, -4, 8, 11, 13, + -21, -13, -5, 1, 15, 22, 23, 27, 31, 25, 13, -1, -18, -28, -33, -40, + -20, -15, 0, 10, 9, 13, 12, 0, -15, -8, 7, 9, 4, 0, -2, -6, + -20, -15, -9, -6, -2, -14, -40, -5, 34, 49, 45, 29, -7, -16, -7, -18, + -19, 13, 24, 22, 27, 17, 2, -1, -8, -17, -26, -16, 0, 1, -4, -15, + -18, -14, -7, 6, 19, 21, 20, 22, 20, 16, 17, 14, -5, -27, -39, -44, + -17, 30, 76, 76, 57, 44, 11, -23, -43, -54, -57, -58, -53, -33, 5, 40, + -17, -19, -22, -34, -39, -15, 12, 23, 21, 17, 18, 22, 20, 13, 6, -7, + -17, -12, -8, 6, 19, 4, -15, 0, 21, 32, 30, 8, -9, -15, -20, -24, + -16, 33, 77, 82, 55, 23, -2, -11, -20, -39, -58, -65, -58, -33, 0, 32, + -16, -21, -26, -21, -7, 7, 10, 8, 11, 16, 22, 20, 12, 3, -4, -16, + -15, 8, 29, 23, 11, -9, -29, -23, -14, -5, -2, -2, 4, 10, 9, 3, + -14, -17, -19, -22, -11, 2, 15, 27, 33, 27, 20, 14, 3, -10, -20, -27, + -13, -2, 6, 3, -7, -7, 4, 26, 31, 19, 13, 12, -4, -23, -29, -32, + -13, -6, 6, 18, 21, 18, 12, 7, 5, 5, 5, -1, -7, -15, -23, -33, + -12, -7, 0, 3, 5, 0, -5, 4, 18, 24, 25, 16, 1, -13, -25, -34, + -12, -3, 0, -4, -3, 10, 9, -3, -5, -6, -6, -3, 14, 20, 5, -14, + -12, -11, -15, -14, -7, 2, 12, 6, -10, -21, -4, 11, 22, 22, 15, 4, + -11, -12, -13, -5, 11, 16, 11, 6, 5, 15, 22, 20, 3, -12, -23, -33, + -11, -10, -8, -11, -3, 13, 19, 18, 11, -1, -12, -8, 6, 7, 0, -12, + -11, -17, -20, -20, -16, -9, -2, 7, 24, 32, 32, 26, 14, 0, -14, -27, + -10, -11, -11, -20, -26, -25, -7, 7, 20, 29, 19, 6, 5, 15, 9, 0, + -10, -5, -7, -9, -4, 9, 10, 0, -17, -28, -21, -7, 12, 28, 29, 22, + -8, -20, -30, -25, -28, -26, -18, -9, 7, 15, 24, 26, 30, 33, 24, 5, + -8, -17, -19, -17, -16, -7, -7, -7, 3, 4, 4, 6, 21, 28, 22, 10, + -8, 35, 62, 60, 43, 21, 6, -4, -21, -34, -37, -42, -43, -32, -12, 6, + -8, -6, -3, -1, 1, 0, -5, -5, 2, 11, 23, 21, 8, -2, -11, -24, + -7, -21, -21, -13, 1, 18, 28, 30, 30, 34, 33, 18, 0, -21, -52, -57, + -6, -31, -40, -39, -36, -27, -20, -22, -19, -4, 10, 12, 19, 38, 69, 95, + -6, -38, -48, -42, -37, -27, -13, 2, 7, 9, 17, 23, 33, 45, 46, 28, + -6, -18, -39, -58, -59, -34, -15, -6, 0, 4, 15, 22, 24, 38, 59, 71, + -4, 6, 6, 11, 15, 9, 1, -7, 2, 11, 16, 10, -5, -14, -26, -31, + -4, 2, 7, -6, -59, -49, -4, -1, 1, 15, 9, -19, -19, 11, 52, 64, + -2, 31, 53, 43, 20, 8, -2, -17, -24, -21, -22, -25, -22, -14, -8, 1, + 1, -3, -3, 4, 6, 9, -4, -31, -39, -17, -5, -1, 6, 16, 27, 34, + 1, 10, 15, 12, -5, -20, -21, -10, 12, 27, 23, 10, -4, -12, -17, -23, + 3, 13, 23, 25, 20, 14, 3, 7, 11, -4, -31, -43, -35, -21, -1, 19, + 3, -3, -9, -16, -19, -7, 1, 7, 11, -2, -5, 5, 23, 20, 2, -10, + 4, -22, -27, -23, -23, -11, 7, 14, 15, 15, 6, -3, -9, -6, 19, 44, + 5, -5, -9, -8, -9, -7, 0, 17, 29, 22, 12, 12, 6, -8, -23, -32, + 6, -31, -58, -64, -41, -12, -1, 3, 2, 0, 3, 6, 21, 37, 55, 74, + 7, 12, 10, 1, 2, 6, 2, -5, -7, -3, -2, 0, 1, 1, -6, -19, + 9, 1, 2, 12, 15, 11, -11, -33, -17, 13, 20, 9, 0, -7, -11, -13, + 10, 21, 26, 24, 18, 4, -5, -13, -14, -6, 4, 7, -7, -19, -25, -25, + 11, 1, -4, -7, -17, -28, -18, 4, 19, 27, 21, 12, 6, 2, -8, -20, + 11, 4, -17, -36, -48, -39, -18, 0, 3, 1, 3, 6, 15, 27, 39, 49, + 11, 3, -12, -26, -20, -2, 11, 16, 14, 9, 18, 19, 6, -7, -15, -25, + 12, 0, -12, -7, -5, -15, -21, -14, -5, 4, 13, 22, 22, 13, 3, -8, + 14, 17, 19, 17, 17, 16, 1, -9, -8, -5, -13, -11, -6, -7, -14, -27, + 14, 33, 52, 50, 32, 12, -1, -6, -8, -14, -23, -30, -36, -35, -26, -13, + 16, 11, 10, 15, 21, 13, 13, 10, 8, 4, 6, 6, -6, -25, -50, -52, + 17, 9, 9, 23, 23, 10, 5, 16, 20, 13, 2, -18, -35, -39, -30, -23, + 17, 31, 47, 49, 42, 32, 22, 8, -7, -21, -31, -30, -43, -53, -42, -21, + 19, 37, 50, 42, 28, 24, 15, -8, -22, -22, -19, -28, -39, -39, -26, -12, + 19, 39, 47, 31, 10, 0, 1, 1, -6, -15, -21, -23, -26, -25, -18, -13, + 19, 12, 0, -7, -3, 1, -2, -12, -19, -19, -11, -1, 9, 14, 12, 5, + 19, 33, 47, 55, 47, 23, -6, -18, -23, -24, -14, -9, -22, -34, -42, -33, + 19, 13, -1, -20, -24, -13, -6, -6, -11, -16, -21, -24, -15, 9, 45, 71, + 21, 15, 8, 4, 5, 6, 3, 4, -2, -17, -20, -8, 12, 9, -12, -28, + 22, 10, 9, 20, 18, -4, -6, 1, 5, 9, 16, 18, -1, -22, -47, -48, + 22, 22, 27, 42, 41, 33, 21, 0, -17, -27, -28, -37, -39, -32, -19, -8, + 23, 4, -28, -27, -16, -5, 9, 28, 28, 0, -52, -61, -12, 18, 35, 56, + 23, -6, -26, -22, -18, -18, -20, -28, -23, -3, 9, 3, 1, 17, 44, 66, + 23, 21, 12, 10, 6, -5, 3, 8, 4, -1, 8, 11, -2, -16, -40, -43, + 24, 11, -4, -9, -8, -10, -21, -37, -44, -26, 0, 8, 17, 29, 36, 35, + 25, 11, 3, 7, 13, 14, 9, 2, -7, -13, -17, -12, -10, -10, -7, -8, + 25, 24, 17, 12, 20, 7, -11, -10, -15, -16, -16, -5, 3, -4, -11, -21, + 27, 26, 17, 6, -5, -16, -12, 2, -1, -9, -16, -7, 3, 3, -2, -15, + 28, 15, -10, -29, -30, -17, 4, 16, 33, 29, 15, 6, -5, -18, -18, -18, + 28, 12, 4, 16, 23, 12, 6, -1, -6, -7, 2, 8, -2, -19, -38, -37, + 29, 16, -1, -15, -25, -15, -12, -9, 18, 29, 23, 12, -1, -13, -16, -20, + 29, 28, 25, 33, 32, 6, -13, -20, -8, 4, 7, 0, -14, -25, -43, -40, + 29, 25, 19, 17, 20, 8, -12, -34, -34, -19, -14, -6, 2, 4, 3, -9, + 30, 28, 22, 14, 17, 16, 15, 8, -5, -19, -13, -4, -7, -20, -40, -41, + 30, 1, -20, -4, -6, -32, -37, -28, -18, -11, -7, -3, 8, 21, 44, 63, + 30, 42, 57, 45, 22, 6, 8, 2, -10, -27, -43, -50, -45, -33, -13, 9, + 32, 25, 20, 24, 23, 6, 3, -2, -10, -8, 4, 8, -8, -27, -47, -45, + 32, 40, 44, 29, 12, 0, -10, -18, -24, -20, -18, -23, -25, -19, -5, 4, + 34, 45, 56, 51, 33, 16, 10, 6, -8, -21, -25, -42, -55, -52, -33, -16, + 34, 53, 63, 61, 58, 44, 12, -26, -62, -68, -60, -61, -47, -18, 9, 9, + 34, 28, 22, 17, 16, 16, 9, 0, -6, -12, -26, -31, -21, -13, -13, -19, + 34, 23, 10, -15, -33, -24, -17, -15, -7, 0, -5, -10, -4, 5, 23, 35, + 35, 23, 12, 0, -16, -22, -17, 0, 17, 19, 14, 7, -5, -16, -24, -27, + 35, 32, -23, -51, -12, 33, 23, 0, -10, 1, -12, -29, -13, 9, 17, 0, + 36, 69, 78, 62, 30, -9, -40, -49, -49, -44, -48, -51, -37, -10, 19, 44, + 36, 21, 8, 11, 18, 8, 9, 8, 7, 3, 2, 1, -13, -28, -46, -44, + 37, 27, 11, 6, 14, 5, -6, -1, -9, -26, -37, -18, 3, 5, 0, -11, + 39, 31, 20, 13, 12, 6, -8, -12, -16, -16, -22, -18, -9, -6, -5, -10, + 39, 33, 25, 21, 22, 18, 7, -4, -24, -33, -33, -20, -9, -8, -14, -22, + 39, 52, 61, 57, 40, 27, 9, -12, -27, -37, -46, -50, -48, -40, -23, -2, + 40, 31, 20, 18, 14, -8, -5, 4, 8, 4, -1, -2, -14, -28, -42, -38, + 40, 29, 17, 19, 15, -9, -20, -18, -7, 1, 10, 9, -5, -15, -33, -33, + 41, 33, 23, 18, 20, 2, -13, -6, -6, -9, -16, -13, -12, -18, -21, -21, + 41, 58, 71, 51, 33, 19, -13, -42, -56, -58, -65, -67, -53, -17, 32, 65, + 41, 31, 15, 10, 4, -16, -7, 5, 7, 8, 12, 8, -7, -26, -44, -40, + 43, 40, 28, 23, 23, 6, -13, -20, -26, -18, -2, 3, -2, -13, -34, -36, + 43, 23, -11, -15, 2, 3, 6, 5, 3, 4, 11, 11, -2, -17, -33, -32, + 43, 54, 61, 49, 24, -1, -8, -3, -8, -21, -32, -43, -46, -39, -21, -9, + 43, 30, 9, -8, -2, 0, -10, -12, -14, -12, -12, -2, 4, 2, -3, -14, + 43, 35, 23, 15, 12, -8, -33, -27, -16, -12, -14, -4, 5, 0, -6, -13, + 44, 31, 19, 12, 4, -5, 1, -1, -10, -14, -1, 5, -3, -15, -33, -34, + 44, 28, 8, 8, 18, 13, 7, -3, -10, -8, -3, -3, -13, -23, -33, -31, + 46, 40, 9, -22, -17, 6, 18, 19, 6, -11, -14, -5, 5, -9, -35, -35, + 47, 47, 53, 51, 27, -3, -46, -65, -46, -33, -32, -29, -28, -17, 17, 56, + 47, 43, 27, 25, 24, 2, -2, -1, -17, -19, -1, 6, -11, -33, -50, -40, + 48, 50, 47, 34, 9, -7, -10, -9, -10, -12, -17, -28, -33, -30, -19, -12, + 48, 51, 51, 41, 25, 7, -18, -39, -47, -47, -44, -36, -21, -2, 14, 17, + 48, 23, -3, 10, 21, -2, -9, -6, -4, -2, 8, 15, 0, -23, -40, -36, + 50, 25, 2, -3, 4, 16, 13, -4, -21, -30, -30, -29, -20, -2, 13, 17, + 59, 44, 18, 13, 23, 18, 8, -7, -28, -26, -8, -3, -10, -24, -42, -35, + 61, 47, 30, 22, 25, 21, 8, -2, -16, -25, -14, -5, -15, -39, -56, -43, + 62, 46, 31, 37, 38, 16, -13, -33, -25, -7, -1, -3, -20, -39, -51, -38, + 63, 47, 23, 9, 5, -2, -13, -12, -8, -7, -14, -20, -26, -25, -15, -6, + 63, 42, 20, 9, 7, 0, -10, -18, -21, -22, -24, -24, -22, -16, 0, 17, + 64, 54, 43, 22, -17, -38, -42, -38, -37, -23, -17, -20, -15, -2, 22, 42, + 64, 51, 36, 34, 35, 21, 6, -9, -34, -41, -20, -7, -18, -35, -48, -36, + 66, 66, 65, 55, 35, 8, -9, -18, -29, -35, -39, -45, -47, -39, -24, -9, + 67, 38, -11, -47, -53, -27, -14, -19, -21, -21, 0, 6, 9, 19, 31, 45, + 70, 60, 50, 45, 32, 3, -17, -33, -34, -24, -10, -9, -22, -36, -44, -30, + 75, 57, 34, 30, 34, 20, -7, -29, -42, -36, -21, -15, -19, -28, -32, -20, + 76, 61, 27, -11, -30, -32, -29, -24, -24, -22, -18, -21, -16, 1, 22, 42, + 96, 77, 40, 5, -17, -27, -30, -28, -25, -24, -22, -23, -23, -16, 1, 16, + 99, 86, 61, 28, -5, -26, -39, -35, -34, -20, -5, -15, -34, -40, -22, 2, + 127, 101, 43, -12, -35, -34, -40, -42, -40, -40, -41, -40, -31, -6, 28, 61 +}; +#endif /* 1.25ms LRSNS */ + +#ifdef CR9_C_ADD_1p25MS_LRSNS + +const LC3_FLOAT lrsns_gains_Q11[3][8] = { + { +1.8125 , +2.5 ,+3.3125, +4.3125, 0.0, 0.0, 0.0, 0.0}, /*4 splitLF Q11 */ + { +1.4375 , +1.8125 , +2.125 , +2.5 , +2.9375 , +3.5 , +4.0625 , +4.9375 }, /*8 full Q11 */ + { +1.375 , +1.75 , +2.0 , +2.3125 , +2.625 , +3.0625 , +3.5625 , +4.4375 } /*8 fix-env Q11 */ +}; + + +/* BASOP optimized fixenv tables */ +const LC3_INT16 env_Qs[SNSLR_N_FIXENV] = { 4, 4 , 4, 4 }; /* Q values for fix0 .. fix3 env searchrepresentation */ +const LC3_FLOAT env_Qscale[SNSLR_N_FIXENV] = { 1.0 / 16.0, 1.0 / 16.0 , 1.0 / 16.0,1.0 / 16.0 }; /* Qscaling values for fix0 .. fix3 env searchrepresentation */ + + +const LC3_INT16 signs_fix[SNSLR_N_FIXENV] = { 12, 12, 12, 10 }; + +const LC3_INT32 long_bell[M - 1 + 4] = { + 6, 6, 7, 7, 8 , + 8, 8, 7, 7, 6 , + 6, 5, 5, 5, 5 , + 5, 5, 5, 5 }; + +const LC3_INT32 decay[M - 1] = { /* floor((25:-1:11 -i)/2)*/ + 12,12,11,11,10, + 10, 9, 9, 8, 8, + 7, 7, 6, 6, 5 }; + +const LC3_INT32* env_ptrs[4] = { &(long_bell[4]), decay, &(long_bell[2]), long_bell }; + + +const LC3_FLOAT shift_en_norm_factors[SNSLR_N_FIXENV][SNSLR_N_FIXENV_SHIFTS] = +{ /* shift0, shift1, shift2, shift3 */ + /*12x init_bellamps , 1/sqrt( ), 1.0 / sqrt( ), 1.0 / sqrt( ), 1/sqrt( ) */ + {1485.0 / 32768.0, 1548.0 / 32768.0, 1620.0 / 32768.0, 1704.0 / 32768.0 } , + + /*12*decay: 1/sqrt( ), 1.0 / sqrt( ), 1.0 / sqrt( ),*/ + {980.0 / 32768.0 , 1031.0 / 32768.0 , 1091.0 / 32768.0 , 1154.0 / 32768.0}, + + + /*12x start bellamps , 1/sqrt( ), 1.0 / sqrt( ), 1.0 / sqrt( ), 1/sqrt( ) */ + { 1417.0 / 32768.0 , 1450.0 / 32768.0 , 1485.0 / 32768.0 , 1548.0 / 32768.0 }, + + + /*10x early_bellamps , 1/sqrt( ), 1.0 / sqrt( ), 1.0 / sqrt( ), 1/sqrt( ) */ + {1471.0 / 32768.0 , 1471.0 / 32768.0 , 1488.0 / 32768.0 , 1526.0 / 32768.0 } , +}; + +#endif + +#ifdef CR9_C_ADD_1p25MS + +#ifdef NEW_SIGNALLING_SCHEME_1p25 +const LC3_INT16 lrsns_ltp_bits[8] = { + 2, /*00(x=0) , ltp=0 ltpf=0 x is next param */ + 2, /*00(x=1) x is next param */ + 3 + 4, /*010 ltp=1 ltpf=0, phaseA or PhaseB(phaseB with reduced resolution) */ + 3 + 4, /*011 ltp=1 ltpf=0, PhaseB(phaseB with reduced resolution) */ + 2 + 4, /*10(x=0) ltp=1 ltpf=1, phase A , +extra bit */ + 2 + 4, /*10(x=1) */ + 2 + 5, /*11(x=0) ltp=1 ltpf=1, phase B , +extra bit */ + 2 + 5 /*11(x=1) */ +}; +#endif + + +const LC3_FLOAT MDCT_WINDOW_80_1_25ms[20] = { + 0.078459095727845, + 0.233445363855905, + 0.382683432365090, + 0.522498564715949, + 0.649448048330184, + 0.760405965600031, + 0.852640164354092, + 0.923879532511287, + 0.972369920397677, + 0.996917333733128, + 0.996917333733128, + 0.972369920397677, + 0.923879532511287, + 0.852640164354092, + 0.760405965600031, + 0.649448048330184, + 0.522498564715949, + 0.382683432365090, + 0.233445363855906, + 0.078459095727845 +}; + +const LC3_FLOAT MDCT_WINDOW_160_1_25ms[40] = { + 0.039259815759069, + 0.117537397457838, + 0.195090322016128, + 0.271440449865074, + 0.346117057077493, + 0.418659737537428, + 0.488621241496955, + 0.555570233019602, + 0.619093949309834, + 0.678800745532942, + 0.734322509435686, + 0.785316930880745, + 0.831469612302545, + 0.872496007072797, + 0.908143173825081, + 0.938191335922484, + 0.962455236453647, + 0.980785280403230, + 0.993068456954926, + 0.999229036240723, + 0.999229036240723, + 0.993068456954926, + 0.980785280403230, + 0.962455236453647, + 0.938191335922484, + 0.908143173825081, + 0.872496007072797, + 0.831469612302545, + 0.785316930880745, + 0.734322509435686, + 0.678800745532942, + 0.619093949309834, + 0.555570233019603, + 0.488621241496955, + 0.418659737537428, + 0.346117057077493, + 0.271440449865075, + 0.195090322016129, + 0.117537397457838, + 0.039259815759069 +}; + +const LC3_FLOAT MDCT_WINDOW_240_1_25ms[60] = { + 0.026176948307873, + 0.078459095727845, + 0.130526192220052, + 0.182235525492147, + 0.233445363855905, + 0.284015344703923, + 0.333806859233771, + 0.382683432365090, + 0.430511096808295, + 0.477158760259608, + 0.522498564715949, + 0.566406236924833, + 0.608761429008721, + 0.649448048330184, + 0.688354575693754, + 0.725374371012288, + 0.760405965600031, + 0.793353340291235, + 0.824126188622016, + 0.852640164354092, + 0.878817112661965, + 0.902585284349861, + 0.923879532511287, + 0.942641491092178, + 0.958819734868193, + 0.972369920397677, + 0.983254907563955, + 0.991444861373810, + 0.996917333733128, + 0.999657324975557, + 0.999657324975557, + 0.996917333733128, + 0.991444861373810, + 0.983254907563955, + 0.972369920397677, + 0.958819734868193, + 0.942641491092178, + 0.923879532511287, + 0.902585284349861, + 0.878817112661965, + 0.852640164354092, + 0.824126188622015, + 0.793353340291235, + 0.760405965600031, + 0.725374371012288, + 0.688354575693754, + 0.649448048330184, + 0.608761429008720, + 0.566406236924833, + 0.522498564715949, + 0.477158760259609, + 0.430511096808296, + 0.382683432365090, + 0.333806859233771, + 0.284015344703923, + 0.233445363855906, + 0.182235525492148, + 0.130526192220052, + 0.078459095727845, + 0.026176948307873 +}; + +const LC3_FLOAT MDCT_WINDOW_320_1_25ms[80] = { + 0.019633692460628, + 0.058870803651189, + 0.098017140329561, + 0.137012341681968, + 0.175796279934355, + 0.214309153065051, + 0.252491577015158, + 0.290284677254462, + 0.327630179561693, + 0.364470499879150, + 0.400748833103141, + 0.436409240673342, + 0.471396736825998, + 0.505657373377985, + 0.539138322911000, + 0.571787960227612, + 0.603555941953571, + 0.634393284163645, + 0.664252437911282, + 0.693087362545636, + 0.720853596702919, + 0.747508326862597, + 0.773010453362737, + 0.797320653772707, + 0.820401443525513, + 0.842217233716286, + 0.862734385977792, + 0.881921264348355, + 0.899748284052221, + 0.916187957117136, + 0.931214934758804, + 0.944806046466878, + 0.956940335732209, + 0.967599092360260, + 0.976765881320872, + 0.984426568089892, + 0.990569340443577, + 0.995184726672197, + 0.998265610184716, + 0.999807240482065, + 0.999807240482065, + 0.998265610184716, + 0.995184726672197, + 0.990569340443577, + 0.984426568089892, + 0.976765881320872, + 0.967599092360260, + 0.956940335732209, + 0.944806046466878, + 0.931214934758804, + 0.916187957117136, + 0.899748284052222, + 0.881921264348355, + 0.862734385977792, + 0.842217233716287, + 0.820401443525514, + 0.797320653772707, + 0.773010453362737, + 0.747508326862597, + 0.720853596702919, + 0.693087362545636, + 0.664252437911282, + 0.634393284163646, + 0.603555941953572, + 0.571787960227612, + 0.539138322911000, + 0.505657373377985, + 0.471396736825998, + 0.436409240673342, + 0.400748833103141, + 0.364470499879150, + 0.327630179561694, + 0.290284677254462, + 0.252491577015158, + 0.214309153065051, + 0.175796279934355, + 0.137012341681968, + 0.098017140329561, + 0.058870803651189, + 0.019633692460629 +}; + +const LC3_FLOAT MDCT_WINDOW_480_1_25ms[120] = { + 0.013089595571344, + 0.039259815759069, + 0.065403129230143, + 0.091501618663402, + 0.117537397457838, + 0.143492621991179, + 0.169349503849025, + 0.195090322016128, + 0.220697435021501, + 0.246153293028993, + 0.271440449865074, + 0.296541574975571, + 0.321439465303162, + 0.346117057077493, + 0.370557437509836, + 0.394743856384267, + 0.418659737537428, + 0.442288690219001, + 0.465614520325111, + 0.488621241496955, + 0.511293086077052, + 0.533614515915611, + 0.555570233019602, + 0.577145190037234, + 0.598324600570659, + 0.619093949309834, + 0.639439001980585, + 0.659345815100069, + 0.678800745532942, + 0.697790459841680, + 0.716301943424654, + 0.734322509435686, + 0.751839807478977, + 0.768841832073459, + 0.785316930880745, + 0.801253812691061, + 0.816641555161679, + 0.831469612302545, + 0.845727821703973, + 0.859406411501453, + 0.872496007072797, + 0.884987637463042, + 0.896872741532688, + 0.908143173825081, + 0.918791210148898, + 0.928809552871924, + 0.938191335922484, + 0.946930129495106, + 0.955019944457187, + 0.962455236453647, + 0.969230909706754, + 0.975342320508513, + 0.980785280403230, + 0.985556059058078, + 0.989651386819670, + 0.993068456954926, + 0.995804927574662, + 0.997858923238603, + 0.999229036240723, + 0.999914327574007, + 0.999914327574007, + 0.999229036240723, + 0.997858923238603, + 0.995804927574662, + 0.993068456954926, + 0.989651386819670, + 0.985556059058078, + 0.980785280403230, + 0.975342320508513, + 0.969230909706754, + 0.962455236453647, + 0.955019944457187, + 0.946930129495106, + 0.938191335922484, + 0.928809552871924, + 0.918791210148898, + 0.908143173825081, + 0.896872741532688, + 0.884987637463042, + 0.872496007072797, + 0.859406411501453, + 0.845727821703973, + 0.831469612302545, + 0.816641555161679, + 0.801253812691061, + 0.785316930880745, + 0.768841832073460, + 0.751839807478978, + 0.734322509435685, + 0.716301943424654, + 0.697790459841680, + 0.678800745532942, + 0.659345815100069, + 0.639439001980585, + 0.619093949309834, + 0.598324600570659, + 0.577145190037234, + 0.555570233019603, + 0.533614515915612, + 0.511293086077052, + 0.488621241496955, + 0.465614520325112, + 0.442288690219001, + 0.418659737537428, + 0.394743856384267, + 0.370557437509836, + 0.346117057077493, + 0.321439465303162, + 0.296541574975571, + 0.271440449865074, + 0.246153293028993, + 0.220697435021501, + 0.195090322016129, + 0.169349503849025, + 0.143492621991180, + 0.117537397457838, + 0.091501618663403, + 0.065403129230143, + 0.039259815759069, + 0.013089595571345 +}; +#endif /* CR9_C_ADD_1p25MS */ + +#ifdef CR9_C_ADD_1p25MS +const LC3_INT BW_cutoff_bin_all_1_25ms[] = {10, 20, 30, 40, 50, 50}; +#endif + +#ifdef CR9_C_ADD_1p25MS +const LC3_FLOAT sns_preemph_maxTilt_32[64] = /*Q19 in Word32*/ { ++0.000000000000000e+00, +4.260444641113281e-02, +9.552001953125000e-02, +1.606330871582031e-01, +2.401504516601562e-01, +3.366279602050781e-01, +4.530467987060547e-01, +5.928611755371094e-01, +7.600822448730469e-01, +9.593582153320312e-01, +1.196073532104492e+00, +1.476461410522461e+00, +1.807731628417969e+00, +2.198219299316406e+00, +2.657554626464844e+00, +3.196861267089844e+00, +3.828969955444336e+00, +4.568693161010742e+00, +5.433101654052734e+00, +6.441873550415039e+00, +7.617681503295898e+00, +8.986635208129883e+00, +1.057879638671875e+01, +1.242875480651855e+01, +1.457631111145020e+01, +1.706723594665527e+01, +1.995415306091309e+01, +2.329755401611328e+01, +2.716694641113281e+01, +3.164218902587891e+01, +3.681499481201172e+01, +4.279068374633789e+01, +4.969015884399414e+01, +5.765219688415527e+01, +6.683605003356934e+01, +7.742443466186523e+01, +8.962694740295410e+01, +1.036839809417725e+02, +1.198712043762207e+02, +1.385046882629395e+02, +1.599467639923096e+02, +1.846127471923828e+02, +2.129786052703857e+02, +2.455897598266602e+02, +2.830711212158203e+02, +3.261386032104492e+02, +3.756122741699219e+02, +4.324314041137695e+02, +4.976716747283936e+02, +5.725648708343506e+02, +6.585213947296143e+02, +7.571560096740723e+02, +8.703172912597656e+02, +1.000121299743652e+03, +1.148990077972412e+03, +1.319695686340332e+03, +1.515410537719727e+03, +1.739764961242676e+03, +1.996912996292114e+03, +2.291607635498047e+03, +2.629286834716797e+03, +3.016171834945679e+03, +3.459379568099976e+03, +3.967051151275635e+03 +}; +#else +const LC3_FLOAT sns_preemph_maxTilt_32[64] = { 1.0000000000, 1.1422936900, 1.3048348743, 1.4905046434, 1.7025940491, 1.9448624389, 2.2216040920, 2.5377243360, 2.8988264960, 3.3113112148, 3.7824899064, 4.3207143526, 4.9355247414, 5.6378187690, 6.4400448053, 7.3564225446, 8.4031950538, 9.5989166860, 10.9647819614, 12.5250012470, 14.3072298919, 16.3430584272, 18.6685725171, 21.3249925879, 24.3594044729, 27.8255940221, 31.7850004725, 36.3078054770, 41.4741770949, 47.3756907943, 54.1169526546, 61.8174535405, 70.6136871125, 80.6615692177, 92.1392015445, 105.2500285278, 120.2264434617, 137.3339077399, 156.8756562372, 179.1980722375, 204.6968271808, 233.8238940558, 267.0955587559, 305.1015713993, 348.5155998248, 398.1071705535, 454.7553088751, 519.4641198313, 593.3805862753, 677.8148994829, 774.2636826811, 884.4365191386, 1010.2862550356, 1154.0436142415, 1318.2567385564, 1505.8363542798, 1720.1073656972, 1964.8677899935, 2244.4560782338, 2563.8280156944, 2928.6445646252, 3345.3722064839, 3821.3975622362, 4365.1583224017 }; +#endif + +#ifdef CR9_C_ADD_1p25MS +const LC3_FLOAT sns_preemph_maxTilt_48[64] = /*Q17 in Word32 */ +{+0.000000000000000e+00, +5.003356933593750e-02, +1.141586303710938e-01, +1.953964233398438e-01, +2.973327636718750e-01, +4.242401123046875e-01, +5.811920166015625e-01, +7.742080688476562e-01, +1.010452270507812e+00, +1.298377990722656e+00, +1.648010253906250e+00, +2.071212768554688e+00, +2.581977844238281e+00, +3.196861267089844e+00, +3.935371398925781e+00, +4.820526123046875e+00, +5.879447937011719e+00, +7.144096374511719e+00, +8.652076721191406e+00, +1.044763946533203e+01, +1.258283996582031e+01, +1.511886596679688e+01, +1.812760925292969e+01, +2.169351959228516e+01, +2.591576385498047e+01, +3.091072845458984e+01, +3.681499481201172e+01, +4.378875732421875e+01, +5.201988220214844e+01, +6.172859954833984e+01, +7.317304229736328e+01, +8.665567016601562e+01, +1.025307922363281e+02, +1.212133789062500e+02, +1.431893615722656e+02, +1.690275802612305e+02, +1.993938980102539e+02, +2.350675277709961e+02, +2.769602203369141e+02, +3.261386032104492e+02, +3.838503112792969e+02, +4.515544738769531e+02, +5.309573440551758e+02, +6.240538558959961e+02, +7.331761932373047e+02, +8.610504531860352e+02, +1.010862823486328e+03, +1.186336814880371e+03, +1.391823417663574e+03, +1.632406326293945e+03, +1.914024772644043e+03, +2.243616851806641e+03, +2.629286834716797e+03, +3.080500373840332e+03, +3.608312332153320e+03, +4.225632614135742e+03, +4.947536384582520e+03, +5.791625976562500e+03, +6.778453254699707e+03, +7.932012306213379e+03, +9.280314323425293e+03, +1.085605828857422e+04, +1.269741340637207e+04, +1.484893192291260e+04 +}; +#else +const LC3_FLOAT sns_preemph_maxTilt_48[64] = {0.0000000000, 0.0500304087, 0.1141593061, 0.1953976981, 0.2973340176, 0.4242389512, 0.5811887026, 0.7742098746, 1.0104496903, 1.2983759103, 1.6480115389, 2.0712102820, 2.5819797245, 3.1968603815, 3.9353701523, 4.8205253208, 5.8794511276, 7.1440971377, 8.6520751946, 10.4476407528, 12.5828418809, 15.1188643151, 18.1276057212, 21.6935178910, 25.9157621116, 30.9107305378, 36.8149952662, 43.7887571592, 52.0198785456, 61.7285980240, 73.1730420472, 86.6556671708, 102.5307892527, 121.2133820430, 143.1893581115, 169.0275806671, 199.3938963586, 235.0675276210, 276.9602196730, 326.1386032534, 383.8503111474, 451.5544763518, 530.9573444802, 624.0538552089, 733.1761901174, 861.0504505627, 1010.8628231966, 1186.3368169939, 1391.8234195728, 1632.4063284191, 1914.0247716809, 2243.6168519816, 2629.2868351532, 3080.5003754823, 3608.3123335035, 4225.6326173056, 4947.5363821034, 5791.6259768788, 6778.4532561811, 7932.0123088052, 9280.3143269988, 10856.0582896592, 12697.4134068387, 14848.9319246111}; +#endif + +const LC3_FLOAT *sns_preemph_adaptMaxTilt_all[6] = {NULL, NULL, NULL, sns_preemph_maxTilt_32, sns_preemph_maxTilt_48, NULL}; + +#ifdef CR9_C_ADD_1p25MS +const LC3_INT bands_number_1_25ms[] = {10, 20, 27, 31, 33}; +#endif + /* DCT */ #define ENTRY_DCT2_1 {0.353553, 0.000000} #define ENTRY_DCT2_2 {0.351851, -0.034654} @@ -540,22 +1265,24 @@ const LC3_FLOAT sns_HFCB[8][32] = { -1.28790471791471, -1.50335652955529, 0.406319437516838, -3.02457606944550, -0.935353148761338, -0.656270971328114, 1.75920379670881}}; -const LC3_INT pvq_enc_A[16][11] = {{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, - {0, 1, 3, 5, 7, 9, 11, 13, 15, 17, 19}, - {0, 1, 5, 13, 25, 41, 61, 85, 113, 145, 181}, - {0, 1, 7, 25, 63, 129, 231, 377, 575, 833, 1159}, - {0, 1, 9, 41, 129, 321, 681, 1289, 2241, 3649, 5641}, - {0, 1, 11, 61, 231, 681, 1683, 3653, 7183, 13073, 22363}, - {0, 1, 13, 85, 377, 1289, 3653, 8989, 19825, 40081, 75517}, - {0, 1, 15, 113, 575, 2241, 7183, 19825, 48639, 108545, 224143}, - {0, 1, 17, 145, 833, 3649, 13073, 40081, 108545, 265729, 598417}, - {0, 1, 19, 181, 1159, 5641, 22363, 75517, 224143, 598417, 1462563}, - {0, 1, 21, 221, 1561, 8361, 36365, 134245, 433905, 1256465, 3317445}, - {0, 1, 23, 265, 2047, 11969, 56695, 227305, 795455, 2485825, 7059735}, - {0, 1, 25, 313, 2625, 16641, 85305, 369305, 1392065, 4673345, 14218905}, - {0, 1, 27, 365, 3303, 22569, 124515, 579125, 2340495, 8405905, 27298155}, - {0, 1, 29, 421, 4089, 29961, 177045, 880685, 3800305, 14546705, 50250765}, - {0, 1, 31, 481, 4991, 39041, 246047, 1303777, 5984767, 24331777, 89129247}}; +const LC3_UINT32 pvq_enc_A[16][11] = { + { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }, + { 0, 1, 3, 5, 7, 9, 11, 13, 15, 17, 19 }, + { 0, 1, 5, 13, 25, 41, 61, 85, 113, 145, 181 }, + { 0, 1, 7, 25, 63, 129, 231, 377, 575, 833, 1159 }, + { 0, 1, 9, 41, 129, 321, 681, 1289, 2241, 3649, 5641 }, + { 0, 1, 11, 61, 231, 681, 1683, 3653, 7183, 13073, 22363 }, + { 0, 1, 13, 85, 377, 1289, 3653, 8989, 19825, 40081, 75517 }, + { 0, 1, 15, 113, 575, 2241, 7183, 19825, 48639, 108545, 224143 }, + { 0, 1, 17, 145, 833, 3649, 13073, 40081, 108545, 265729, 598417 }, + { 0, 1, 19, 181, 1159, 5641, 22363, 75517, 224143, 598417, 1462563 }, + { 0, 1, 21, 221, 1561, 8361, 36365, 134245, 433905, 1256465, 3317445 }, + { 0, 1, 23, 265, 2047, 11969, 56695, 227305, 795455, 2485825, 7059735 }, + { 0, 1, 25, 313, 2625, 16641, 85305, 369305, 1392065, 4673345, 14218905 }, + { 0, 1, 27, 365, 3303, 22569, 124515, 579125, 2340495, 8405905, 27298155 }, + { 0, 1, 29, 421, 4089, 29961, 177045, 880685, 3800305, 14546705, 50250765 }, + { 0, 1, 31, 481, 4991, 39041, 246047, 1303777, 5984767, 24331777, 89129247 } +}; const LC3_FLOAT lp_scale_factors[6] = {1, 1, 0.6666666666666666, .5, 0.3333333333333333, 0.16666666666666666}; @@ -4696,6 +5423,7 @@ const LC3_FLOAT MDCT_HRA_WINDOW_480_5ms[480] = { 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, + 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00}; @@ -6315,4 +7043,45 @@ const LC3_INT32 mdct_grp_bins[10] = { 4, 14, 24, 44, 84, 164, 244, 324, 404, 484 const LC3_INT16 plc_fadeout_param_maxlen[4] = {800, 400, 266, 200}; const LC3_INT16 plc_fadeout_param_maxbytes[4] = {27, 14, 9, 7}; +#ifdef CR9_C_ADD_1p25MS +const LC3_FLOAT* MDCT_WINS_1_25ms[2][6] = { + {MDCT_WINDOW_80_1_25ms, MDCT_WINDOW_160_1_25ms, MDCT_WINDOW_240_1_25ms, MDCT_WINDOW_320_1_25ms, MDCT_WINDOW_480_1_25ms, NULL}, + {NULL, NULL, NULL, NULL, NULL, NULL}}; +const LC3_INT MDCT_la_zeroes_1_25ms[6] = {0, 0, 0, 0, 0, 0}; +#endif /* CR9_C_ADD_1p25MS */ +#ifdef CR9_C_ADD_1p25MS +const LC3_INT MDCT_WINDOWS_LENGTHS_1_25ms[6] = {20, 40, 60, 80, 120, 240}; +#endif +#ifdef CR9_C_ADD_1p25MS +const LC3_INT ACC_COEFF_PER_BAND_8_1_25ms[11] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; + +const LC3_INT ACC_COEFF_PER_BAND_16_1_25ms[21] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20}; + +const LC3_INT ACC_COEFF_PER_BAND_24_1_25ms[28] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 26, 28, 30}; + +const LC3_INT ACC_COEFF_PER_BAND_32_1_25ms[32] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 25, 27, 29, 31, 33, 35, 37, 40}; + +const LC3_INT ACC_COEFF_PER_BAND_48_1_25ms[34] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 43, 46, 50}; + +const LC3_INT ACC_COEFF_PER_BAND_PLC_8_1_25ms[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; + +const LC3_INT ACC_COEFF_PER_BAND_PLC_16_1_25ms[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20}; + +const LC3_INT ACC_COEFF_PER_BAND_PLC_24_1_25ms[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30}; + +const LC3_INT ACC_COEFF_PER_BAND_PLC_32_1_25ms[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40}; + +const LC3_INT ACC_COEFF_PER_BAND_PLC_48_1_25ms[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60}; + +const LC3_INT* ACC_COEFF_PER_BAND_PLC_1_25ms[] = { + ACC_COEFF_PER_BAND_PLC_8_1_25ms, ACC_COEFF_PER_BAND_PLC_16_1_25ms, ACC_COEFF_PER_BAND_PLC_24_1_25ms, ACC_COEFF_PER_BAND_PLC_32_1_25ms, ACC_COEFF_PER_BAND_PLC_48_1_25ms}; +#endif /* CR9_C_ADD_1p25MS */ + +#ifdef CR9_C_ADD_1p25MS +const LC3_INT* ACC_COEFF_PER_BAND_1_25ms[5] = {ACC_COEFF_PER_BAND_8_1_25ms, ACC_COEFF_PER_BAND_16_1_25ms, + ACC_COEFF_PER_BAND_24_1_25ms, ACC_COEFF_PER_BAND_32_1_25ms, + ACC_COEFF_PER_BAND_48_1_25ms}; +#endif + + const LC3_INT16 PLC_FADEOUT_TYPE_2_SELECTOR = 10; /* can take values from 0 to 10, default is 10 for longer fadeout */ diff --git a/lib_lc3plus/constants.h b/lib_lc3plus/constants.h index 88d9ed137d7dee795e4393918bc144fad3ebac37..853303e59e161e2d14ea237e6432d7b1fece5d65 100644 --- a/lib_lc3plus/constants.h +++ b/lib_lc3plus/constants.h @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.5.1 * +* ETSI TS 103 634 V1.6.1 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -15,6 +15,45 @@ #include "defines.h" #include "structs.h" +#ifdef CR9_C_ADD_1p25MS_LRSNS +extern const LC3_FLOAT lrsns_st1A_topTab_1bitNoDC[2 * 16]; +extern const LC3_INT16 lrsns_ltp_bits[8]; + +/* BASOP table SNSLR st1B_idx search variables */ +extern const LC3_INT16 st1SCF0_7_base5_32x8_Q11[32 * 8]; /* legacy 10ms quantized BASOP SNS stage1 LF tables 32x8=256 values */ +extern const LC3_INT16 st1SCF8_15_base5_32x8_Q11[32 * 8]; /* legacy 10ms quntized BASOP SNS stage1 HF tables 32x8=256 values */ + +/* LRSNS st1B, tables to construct from legacy BASOP st1(LF,HF) tables */ +extern const LC3_INT16 lrsns_st1B_merged170orderSortedSegmCnt[4]; +extern const LC3_INT16 lrsns_st1B_merged170orderSortedSegmCum[5]; +extern const LC3_INT16 lrsns_st1B_merged170orderSort12bitIdx[170]; + + +/* LRSNS tables to construct st1C from Word8in Q7 and a Q4 scalefactor */ +#ifdef LRSNS_CBC_NO_LTPF_DEPENDENCY +extern const LC3_FLOAT * lrsns_st1CTrainedMapMeans[2]; +#else +extern const LC3_FLOAT * lrsns_st1CTrainedMapMeans[3]; +#endif +extern const LC3_INT8 lrsns_st1C_Both_Word8[170 * 16]; + +extern const LC3_INT16 lrsns_st1C_Both_scaleQ4_7p4bits_fx[2]; +extern const LC3_INT16 lrsns_st1C_Both_inv_scaleQ15_7p4bits_fx[2]; + +#endif /* CR9_C_ADD_1p25MS_LRSNS */ + +#ifdef CR9_C_ADD_1p25MS_LRSNS + +extern const LC3_FLOAT lrsns_gains_Q11[3][8]; /* both enc and dec */ + +extern const LC3_INT16 signs_fix[SNSLR_N_FIXENV]; +extern const LC3_INT16 env_Qs[SNSLR_N_FIXENV]; +extern const LC3_FLOAT env_Qscale[SNSLR_N_FIXENV]; +extern const LC3_FLOAT shift_en_norm_factors[SNSLR_N_FIXENV][SNSLR_N_FIXENV_SHIFTS]; +extern const LC3_INT32* env_ptrs[SNSLR_N_FIXENV]; +#endif + +extern const LC3_FLOAT *sns_preemph_adaptMaxTilt_all[6]; /* DCT */ extern const Complex dct2_16[16]; @@ -30,7 +69,7 @@ extern const LC3_FLOAT sns_W[6]; extern const LC3_FLOAT *sns_preemph_all[6]; extern const LC3_FLOAT sns_LFCB[8][32]; extern const LC3_FLOAT sns_HFCB[8][32]; -extern const LC3_INT pvq_enc_A[16][11]; +extern const LC3_UINT32 pvq_enc_A[16][11]; extern const LC3_FLOAT idct_lookup[M][M]; /* 12.8 kHz resampler */ @@ -113,6 +152,11 @@ extern const LC3_INT bands_number_2_5ms_HR[6]; extern const LC3_INT BW_cutoff_bin_all_2_5ms[MAX_BW_BANDS_NUMBER]; extern const LC3_INT bands_number_2_5ms[5]; +#ifdef CR9_C_ADD_1p25MS +extern const LC3_INT bands_number_1_25ms[5]; +extern const LC3_INT BW_cutoff_bin_all_1_25ms[]; +#endif + extern const LC3_INT BW_warp_idx_start_16k_5ms[4]; extern const LC3_INT BW_warp_idx_stop_16k_5ms[4]; extern const LC3_INT BW_warp_idx_start_24k_5ms[4]; @@ -168,6 +212,19 @@ extern const LC3_FLOAT MDCT_WINDOW_480_5ms[480]; extern const LC3_FLOAT* MDCT_WINS_5ms[2][6]; extern const LC3_INT MDCT_la_zeroes_5ms[6]; +#ifdef CR9_C_ADD_1p25MS +extern const LC3_FLOAT MDCT_WINDOW_80_1_25ms[20]; +extern const LC3_FLOAT MDCT_WINDOW_160_1_25ms[40]; +extern const LC3_FLOAT MDCT_WINDOW_240_1_25ms[60]; +extern const LC3_FLOAT MDCT_WINDOW_320_1_25ms[80]; +extern const LC3_FLOAT MDCT_WINDOW_480_1_25ms[120]; +extern const LC3_FLOAT* MDCT_WINS_1_25ms[2][6]; +extern const LC3_INT MDCT_la_zeroes_1_25ms[6]; +#ifdef NEW_SIGNALLING_SCHEME_1p25 +extern const LC3_INT16 lrsns_ltp_bits[8]; +#endif +#endif /* CR9_C_ADD_1p25MS */ + extern const LC3_FLOAT* MDCT_WINS_7_5ms[2][6]; extern const LC3_INT32 MDCT_la_zeroes_7_5ms[6]; @@ -176,7 +233,16 @@ extern const LC3_INT MDCT_WINDOWS_LENGTHS_7_5ms[6]; extern const LC3_INT MDCT_WINDOWS_LENGTHS_5ms[6]; extern const LC3_INT MDCT_WINDOWS_LENGTHS_2_5ms[6]; +#ifdef CR9_C_ADD_1p25MS +extern const LC3_INT MDCT_WINDOWS_LENGTHS_1_25ms[6]; +#endif + /* Per band energy */ +#ifdef CR9_C_ADD_1p25MS +extern const LC3_INT* ACC_COEFF_PER_BAND_1_25ms[5]; +extern const LC3_INT* ACC_COEFF_PER_BAND_PLC_1_25ms[5]; +#endif + extern const LC3_INT* ACC_COEFF_PER_BAND[6]; extern const LC3_INT* ACC_COEFF_PER_BAND_HR[6]; diff --git a/lib_lc3plus/cutoff_bandwidth.c b/lib_lc3plus/cutoff_bandwidth.c index a2a617bd0daa57c8ced379a607703d8239de111b..a498dc65e79265b1768ad3f2ccf1ee8f8bc80ad7 100644 --- a/lib_lc3plus/cutoff_bandwidth.c +++ b/lib_lc3plus/cutoff_bandwidth.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.5.1 * +* ETSI TS 103 634 V1.6.1 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * diff --git a/lib_lc3plus/dct4.c b/lib_lc3plus/dct4.c index 4b4a3f6a0f344b45c50624eaf7d59ffe1f26c9fa..d90d7f5f5fe6c251017742b0919bfa8dde4570b3 100644 --- a/lib_lc3plus/dct4.c +++ b/lib_lc3plus/dct4.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.5.1 * +* ETSI TS 103 634 V1.6.1 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -52,8 +52,8 @@ void dct4_init(Dct4* dct, int length) int i; assert(length <= MAX_LEN); dct->length = length; - dct->twid1 = calloc(sizeof(*dct->twid1), length / 2); - dct->twid2 = calloc(sizeof(*dct->twid2), length / 2); + dct->twid1 = calloc(length / 2, sizeof(*dct->twid1)); + dct->twid2 = calloc(length / 2, sizeof(*dct->twid2)); for (i = 0; i < length / 2; i++) { dct->twid1[i] = cexpi(-(LC3_FLOAT)M_PI_LC3PLUS * (i + (LC3_FLOAT)0.25) / length); dct->twid2[i] = cexpi(-(LC3_FLOAT)M_PI_LC3PLUS * i / length); diff --git a/lib_lc3plus/dec_entropy.c b/lib_lc3plus/dec_entropy.c index cd82570a8181fe6df0b838248b5440fd166cdcac..ae39df0169379d4d387275d1a1512218e9b512f1 100644 --- a/lib_lc3plus/dec_entropy.c +++ b/lib_lc3plus/dec_entropy.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.5.1 * +* ETSI TS 103 634 V1.6.1 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -11,9 +11,23 @@ #include "wmc_auto.h" #include "functions.h" +static const LC3_INT32 gainMSBbits[4] = {1, 1, 2, 2}; + static void read_bit_fl(LC3_UINT8* ptr, LC3_INT* mask_side, LC3_INT* bp_side, LC3_INT* bit); static void read_uint_fl(LC3_INT nbits, LC3_UINT8* ptr, LC3_INT* mask_side, LC3_INT* bp_side, LC3_INT* val); +#ifdef CR9_C_ADD_1p25MS_LRSNS +void readSNSData_fl(LC3_UINT8* ptr, LC3_INT32* bfi, LC3_INT32* mask_side_local, LC3_INT32* bp_side_local, const LC3_INT32* ltpf_idx_2_lrsns, LC3_INT32* sns_vq_idx, LC3PLUS_FrameDuration frame_dms, LC3_INT32 plc_trigger_SNS1, LC3_INT32 plc_trigger_SNS2); +#else +void readSNSData_fl(LC3_UINT8* ptr, LC3_INT32* bfi, LC3_INT32* mask_side_local, LC3_INT32* bp_side_local, LC3_INT32* sns_vq_idx, LC3PLUS_FrameDuration frame_dms, LC3_INT32* plc_trigger_SNS1, LC3_INT32* plc_trigger_SNS2); +#endif + + + +#ifdef NEW_SIGNALLING_SCHEME_1p25 +void readLtpData_fl(LC3_UINT8* ptr, LC3_INT32* bfiPtr, LC3_INT32* mask_side, LC3_INT32* bp_side, LC3_INT32* ltpf_idx, LC3_INT32* rx_status, LC3_INT32* ltpfinfo_frame_cntr, LC3_INT16* mem_continuation); +#endif + void read_bit_fl(LC3_UINT8* ptr, LC3_INT* mask_side, LC3_INT* bp_side, LC3_INT* bit) { if (ptr[*bp_side] & *mask_side) { @@ -54,13 +68,13 @@ LC3_INT paddingDec_fl(LC3_UINT8* bytes, LC3_INT nbbits, LC3_INT L_spec, LC3_INT LC3_INT nbbytes = nbbits >> 3; LC3_INT lastnz; LC3_INT bw_cutoff_idx; - LC3_INT nbits = ceil(LC3_LOGTWO(L_spec / 2)); - + LC3_INT nbits = getLastNzBits (L_spec); + if (nbits > nbbits) { return 1; } - + *np_zero = 0; *total_padding = 0; @@ -71,7 +85,7 @@ LC3_INT paddingDec_fl(LC3_UINT8* bytes, LC3_INT nbbits, LC3_INT L_spec, LC3_INT if (bp_side < 19 || bp_side >= LC3PLUS_MAX_BYTES) { return 1; } - + ptr = bytes; if (bw_cutoff_bits > 0) { @@ -90,7 +104,7 @@ LC3_INT paddingDec_fl(LC3_UINT8* bytes, LC3_INT nbbits, LC3_INT L_spec, LC3_INT /* Read 4 reserved bits */ read_uint_fl(4, ptr, &mask_side, &bp_side, &val); - + if (ep_enabled == 0) { /* Discard padding length bytes */ @@ -102,7 +116,7 @@ LC3_INT paddingDec_fl(LC3_UINT8* bytes, LC3_INT nbbits, LC3_INT L_spec, LC3_INT *total_padding = *total_padding + 2; *np_zero = *np_zero + padding_len; } - + /* check if minimum payload size is reached */ if ((nbbytes - (*total_padding + *np_zero)) < 20) { return 1; @@ -115,26 +129,435 @@ LC3_INT paddingDec_fl(LC3_UINT8* bytes, LC3_INT nbbits, LC3_INT L_spec, LC3_INT read_uint_fl(nbits, ptr, &mask_side, &bp_side, &lastnz); } - + if (ep_enabled != 0) { *total_padding = *total_padding + *np_zero; } - + return 0; } #endif + +#ifdef NEW_SIGNALLING_SCHEME_1p25 +void readLtpData_fl( + LC3_UINT8* ptr, + LC3_INT32* bfiPtr, + LC3_INT32* mask_side, + LC3_INT32* bp_side, + LC3_INT32* ltpf_idx, + LC3_INT32* rx_status, + LC3_INT32* ltpfinfo_frame_cntr, + LC3_INT16* mem_continuation +) +{ + LC3_INT32 rx_current_status = -1; + LC3_INT32 tmp, MSBs, LSBs; + + /* Hdr, information , bits used + 00 , no lag info , no phase info sum=2 + 010, PhaseA,LTPF=0, lagAbits=4 , sum=7 : PLC may be activated, 4 MSbs + 011, PhaseB,LTPF=0, lagBbits=4*, sum=7* : PLC may be activated, 4* = reduced lag resolution in Q_ltpf_Idx domain for PLC-activation + 10 , PhaseA,LTPF=1, lagAbits=4 , sum=6 : LTPF activated + 11 , PhaseB,LTPF=1, lagBbits=5 , sum=7 : LTPF activated + */ + + ltpf_idx[2] = -1; /* no ready lag available, conditionally decoded if phase is B, and consecutive A/B has arrived */ + + read_uint_fl(2, ptr, mask_side, bp_side, &tmp); + if (tmp == 0) /* "00" */ + { + ltpf_idx[0] = 0; /* ltp ltpf/lag was not transmitted */ + ltpf_idx[1] = 0; /* ltpf activation bit zeroed */ + + rx_status[0] = -32768; /* set unknown phase A , due to rx LTP==0 */ + rx_status[1] = -1; /* set unknown phase A MSBs content */ + *ltpfinfo_frame_cntr = -32768; + assert(ltpf_idx[2] < 0); /* ltpf_idx[2] = -1; , no ready lag available */ +#ifdef FIX_LTPF_1p25 + *mem_continuation = 0; /* also kill lag continuation state */ +#endif + } + else if (tmp == 1) /* "01" */ + { + ltpf_idx[0] = 1; + ltpf_idx[1] = 0; /* LTP=1, LTPF=0, inactive ltpf */ + read_bit_fl(ptr, mask_side, bp_side, &rx_current_status); + + if (rx_current_status == 0) + { + rx_status[0] = 0; /* phaseA */ + read_uint_fl(4, ptr, mask_side, bp_side, &(rx_status[1])); /* read four MSBs, and store in rx_status[1] */ +#ifdef FIX_LTPF_1p25 + if (*mem_continuation == 0) + { + *mem_continuation = 1; + } +#endif + *ltpfinfo_frame_cntr = 0; /*same as rx_status [0] */ + } + else + { /* LSB part of delta coded lag information */ + assert(rx_current_status == 1); + read_uint_fl(4, ptr, mask_side, bp_side, &LSBs); + LSBs = (LSBs << 1); /* NB Least Signifcant bit is on purpose always zero, truncation on encoder side */ + if ( rx_status[1] < 0 ) + { + *bfiPtr = 1; + return; + } + ltpf_idx[2] = ((rx_status[1] << 5) | LSBs); /* bitwise OR */ + + /* check frame cntr info to not combine oldA with a newB */ + if (*ltpfinfo_frame_cntr != 1) + { + rx_status[0] = -32768; /*even number of bfi frames may have happened */ + ltpf_idx[1] = 0; + ltpf_idx[2] = -1; /* send signal of non-decoded lag to PLC and LTPF decoder */ + } +#ifdef FIX_LTPF_MEM_CONTINUATION + else + { + *mem_continuation = 0; + } + # endif + rx_status[0] = -32768; + *ltpfinfo_frame_cntr = -32678; + } + } + else + { /* 2 or 3 */ + ltpf_idx[0] = 1; + ltpf_idx[1] = 1; /* active ltpf */ + + if (tmp == 2) /* 2="10" */ + { + /* phaseA */ + read_uint_fl(4, ptr, mask_side, bp_side, &MSBs); + + rx_status[0] = 0; + rx_status[1] = MSBs; /* remember the four MSBs */ +#ifdef FIX_LTPF_1p25 + if (*mem_continuation == 0) + { + *mem_continuation = 1; + } +#endif + *ltpfinfo_frame_cntr = 0; + assert(ltpf_idx[2] < 0); /* ltpf_idx[2] = -1; , no ready lag available */ + } + else + { /* 3="11" */ + assert(tmp == 3); /* phaseB */ + read_uint_fl(5, ptr, mask_side, bp_side, &LSBs); /* all 5 LSBs available*/ + if ( rx_status[1] < 0 ) + { + *bfiPtr = 1; + return; + } + ltpf_idx[2] = ((rx_status[1] << 5) | LSBs); /* bitwise OR */ + + /* check frame cntr info to not combine oldA with a newB */ + if (*ltpfinfo_frame_cntr != 1) + { + ltpf_idx[1] = 0; /* turn off LTPF activation for now, so that ltpf_idx[2] is not read */ + ltpf_idx[2] = -1; /* send signal to PLC and ltpf_decoder, that phase B could not be decoded */ + } + *ltpfinfo_frame_cntr = -32678; /*cntr init in phaseA*/ + rx_status[0] = -32768; /* phase init in phaseA*/ + +#ifdef FIX_LTPF_MEM_CONTINUATION + *mem_continuation = 0; +#endif + } + } + +} +#endif + + +#ifdef CR9_C_ADD_1p25MS_LRSNS +void readSNSData_fl(LC3_UINT8* ptr, LC3_INT32* bfi, LC3_INT32* mask_side_local, LC3_INT32* bp_side_local, const LC3_INT32* ltpf_idx_2_lrsns, + LC3_INT32* sns_vq_idx, LC3PLUS_FrameDuration frame_dms, + LC3_INT32 plc_trigger_SNS1, LC3_INT32 plc_trigger_SNS2) +#else +void readSNSData_fl(LC3_UINT8* ptr, LC3_INT32* bfi, LC3_INT32* mask_side_local, LC3_INT32* bp_side_local, LC3_INT32* sns_vq_idx, + LC3PLUS_FrameDuration frame_dms, LC3_INT32* plc_trigger_SNS1, LC3_INT32* plc_trigger_SNS2) +#endif +{ + LC3_INT32 tmp, submodeMSB, idxBorGainLSB, submodeLSB; +#ifndef CR9_C_ADD_1p25MS + (void) frame_dms; +#endif +#ifdef CR9_C_ADD_1p25MS_LRSNS + LC3_INT32 read_legacy_sns_vq_bits; +#endif + + + UNUSED(frame_dms); + +#ifdef CR9_C_ADD_1p25MS_LRSNS + read_legacy_sns_vq_bits = 1; + if (frame_dms == LC3PLUS_FRAME_DURATION_1p25MS) + { + read_legacy_sns_vq_bits = 0; /* decode 9, 10, or 29/30 bits */ + } + + if (read_legacy_sns_vq_bits != 0) + { +#endif + /* SNS-VQ 1st stage */ + read_uint_fl(5, ptr, mask_side_local, bp_side_local, &sns_vq_idx[SNS_IDX_LF]); + read_uint_fl(5, ptr, mask_side_local, bp_side_local, &sns_vq_idx[SNS_IDX_HF]); + + /* SNS-VQ 2nd stage side-info (3-4 bits) */ + read_bit_fl(ptr, mask_side_local, bp_side_local, &submodeMSB); + + read_uint_fl(gainMSBbits[submodeMSB * 2], ptr, mask_side_local, bp_side_local, &sns_vq_idx[SNS_IDX_GAIN]); + read_bit_fl(ptr, mask_side_local, bp_side_local, &sns_vq_idx[SNS_IDX_LS_INDA]); + + /* SNS-VQ 2nd stage VQ decoding (24-25 bits) */ + if (submodeMSB == 0) + { + read_uint_fl(25, ptr, mask_side_local, bp_side_local, &tmp); + if (tmp >= 33460056) + { +#ifdef CR9_C_ADD_1p25MS_LRSNS + *bfi = plc_trigger_SNS1; +#else + *bfi = *plc_trigger_SNS1; +#endif + if (*bfi) + { + return; + } + } + idxBorGainLSB = floor(tmp / 2390004); + sns_vq_idx[SNS_IDX_A] = tmp - idxBorGainLSB * 2390004; + + if (idxBorGainLSB < 2) + { + submodeLSB = 1; + sns_vq_idx[SNS_IDX_GAIN] = sns_vq_idx[SNS_IDX_GAIN] * 2 + idxBorGainLSB; + sns_vq_idx[SNS_IDX_BORGAINLSB] = -2; + } + else + { + submodeLSB = 0; + sns_vq_idx[SNS_IDX_BORGAINLSB] = idxBorGainLSB - 2; + } + } + else + { + read_uint_fl(24, ptr, mask_side_local, bp_side_local, &tmp); + if (tmp >= 16708096) + { +#ifdef CR9_C_ADD_1p25MS_LRSNS + *bfi = plc_trigger_SNS2; +#else + *bfi = *plc_trigger_SNS2; +#endif + if (*bfi) + { + return; + } + } + + if (tmp >= 15158272) + { + submodeLSB = 1; + tmp -= 15158272; + sns_vq_idx[SNS_IDX_GAIN] = sns_vq_idx[SNS_IDX_GAIN] * 2 + (tmp & 1); + sns_vq_idx[SNS_IDX_A] = floor(tmp / 2); + sns_vq_idx[SNS_IDX_BORGAINLSB] = -2; + } + else + { + submodeLSB = 0; + sns_vq_idx[SNS_IDX_A] = tmp; + sns_vq_idx[SNS_IDX_BORGAINLSB] = -1; + } + } + + sns_vq_idx[SNS_IDX_SHAPEJ] = submodeMSB * 2 + submodeLSB; + +#ifdef CR9_C_ADD_1p25MS_LRSNS + } + + if (read_legacy_sns_vq_bits == 0) + { + LC3_INT32 shape_idx = -1; + LC3_INT32 gain_idx = -1; + LC3_INT32 aux_idx = -1; + LC3_INT32 tmp_shape = -1; + LC3_INT32 stop_bit = -1; + /* SNS-VQ 1st stage in 9-10 bits */ + read_uint_fl(9, ptr, mask_side_local, bp_side_local, &sns_vq_idx[SNS_IDX_LF]); + if (sns_vq_idx[SNS_IDX_LF] >= 510) /* stage 1A */ + { + assert(sns_vq_idx[SNS_IDX_LF] < 512); + sns_vq_idx[SNS_IDX_LF] -= 510; /* send only idx 0,1 */ + sns_vq_idx[SNS_IDX_HF] = -32768; /* unused */ + shape_idx = -9; + sns_vq_idx[2] = shape_idx; /* actual signal to LR SNS vector reconstruction */ + } + else + { + /* read stop bit */ + read_uint_fl(1, ptr, mask_side_local, bp_side_local, &stop_bit); + sns_vq_idx[SNS_IDX_HF] = -32768; /* unused */ + + if (sns_vq_idx[SNS_IDX_LF] < (2 * 170) && stop_bit != 0) + { + /*B or C , keep values 0...339 in sns_vq_idx[0] , so that stage1 B vs stage1 C can be determined later in the DecLR function */ + sns_vq_idx[2] = -10; + sns_vq_idx[3] = ltpf_idx_2_lrsns[0]; /* forward LTP active flag */ + sns_vq_idx[4] = ltpf_idx_2_lrsns[1]; /* forward LTPF active flag */ + } + else + { /* stage1B + stage2 */ + /*0...169 in sns_vq_idx[0]*/ + if (sns_vq_idx[SNS_IDX_LF] < (2 * 170) && stop_bit == 0) + { + aux_idx = 0; + if (sns_vq_idx[SNS_IDX_LF] >= (170)) + { + aux_idx = 1; + sns_vq_idx[SNS_IDX_LF] -= 170; + } + sns_vq_idx[SNS_IDX_HF] = aux_idx; /* aux bit for , LR_Split_LF, 29 bits */ + + shape_idx = 0; /* point to splitLF parsing */ + sns_vq_idx[2] = shape_idx; + + read_uint_fl(2, ptr, mask_side_local, bp_side_local, &gain_idx); + sns_vq_idx[3] = gain_idx; + + /* stage2 shape demux for LR_splitLF */ + read_uint_fl(10, ptr, mask_side_local, bp_side_local, &sns_vq_idx[4]); /* 10bits mPVQ(N=5,K=6) */ + + if (sns_vq_idx[4] >= (SNSLR_NPVQ_L5K6 >> 1) + (1 << 5)) /* some limited bit error detection possible here */ + { + *bfi = plc_trigger_SNS1; + if (*bfi != 0) + { + return; + } + } + + /* determine section of splitLF mpvq(5,6)+P(8,2)+P(2,0) or mpvq(5,8)+P(10,0) */ + if (sns_vq_idx[4] < (SNSLR_NPVQ_L5K6 >> 1)) + { + read_uint_fl(1, ptr, mask_side_local, bp_side_local, &tmp_shape); /* LS (8,2) */ + read_uint_fl(6, ptr, mask_side_local, bp_side_local, &sns_vq_idx[5]); /* mPVQ(8,2) */ + sns_vq_idx[5] = (sns_vq_idx[5] << 1) + tmp_shape; /* P(8,2) LS put as lsb */ + } + else + { + sns_vq_idx[4] = sns_vq_idx[4] - (SNSLR_NPVQ_L5K6 >> 1); /* 5 LSBs of mpvq (5,8) */ + + read_uint_fl(7, ptr, mask_side_local, bp_side_local, &sns_vq_idx[5]); /* 7 msbs of mPVQ(5,8) */ + sns_vq_idx[4] = (sns_vq_idx[5] << 5) | sns_vq_idx[4]; /* merge MSB's and LSBs */ + sns_vq_idx[5] = -8; /* signal to sns_decoder split_LF subshape to decode 8 lf pulses, and no hf pulses */ + + if (sns_vq_idx[4] >= (SNSLR_NPVQ_L5K8 >> 1)) { + *bfi = plc_trigger_SNS1; + if (*bfi != 0) { + return; + } + } + } + } + else if (sns_vq_idx[SNS_IDX_LF] >= (2 * 170)) + { + aux_idx = stop_bit; + sns_vq_idx[SNS_IDX_LF] -= (2 * 170); + sns_vq_idx[1] = aux_idx; + + shape_idx = 1; /* point to full parsing */ + sns_vq_idx[2] = shape_idx; /* LR_full , 30 bits */ + + read_uint_fl(3, ptr, mask_side_local, bp_side_local, &gain_idx); + sns_vq_idx[3] = gain_idx; + + /* stage2 shape demux for LR_full */ + read_uint_fl(17, ptr, mask_side_local, bp_side_local, &sns_vq_idx[4]); /* 16.666 bits mPVQ(N=15,K=5) */ + + if (sns_vq_idx[4] >= (SNSLR_NPVQ_L15K5 >> 1)) + { /* fixenv shapes demultiplexing */ + sns_vq_idx[5] = (sns_vq_idx[4] - (SNSLR_NPVQ_L15K5 >> 1)); + if (sns_vq_idx[5] < (3 * (1 << 13))) + { /*fix_env's "0,1,2" with 2 shiftbits and 11 remaining sign bits s1..s11 */ + sns_vq_idx[4] = 0; + while (sns_vq_idx[5] >= (1 << 13)) { + sns_vq_idx[5] = sns_vq_idx[5] - (1 << 13); + sns_vq_idx[4] += 1; + } + assert(sns_vq_idx[4] >= 0 && sns_vq_idx[4] <= 3); + assert(sns_vq_idx[5] >= 0 && sns_vq_idx[5] < (1 << 13)); + } + else if (sns_vq_idx[5] < (3 * (1 << 13) + (1 << 11))) + { + sns_vq_idx[4] = 3; /*smaller fix_env "3" with 2 shiftbits and 9 remaining sign bits s1..s9 */ + sns_vq_idx[5] = sns_vq_idx[5] - (3 * (1 << 13)); + assert(sns_vq_idx[5] >= 0 && sns_vq_idx[5] < (1 << 11)); + } + else + { /* bit error */ + *bfi = plc_trigger_SNS2; + if (*bfi != 0) + { + return; + } + } + shape_idx = sns_vq_idx[4] + 2; + sns_vq_idx[2] = shape_idx; + } /* fixenv */ + }/*full*/ + }/*stage1B* + stage2 */ + } /*10+ bits*/ + } +#endif +#ifdef LRSNS_PC_SIGNAL_FIX + assert(*bfi == 0 || *bfi == 1 ); /* local SNS BFI-flag output check */ +#endif +} + void processDecoderEntropy_fl(LC3_UINT8* bytes, LC3_INT numbytes, LC3_INT* mask_side, LC3_INT* bp_side, LC3_INT N, LC3_INT fs_idx, - LC3_INT bw_cutoff_bits, LC3_INT* bfi, LC3_INT* gg_idx, LC3_INT* scf_idx, LC3_INT* fac_ns_idx, + LC3_INT bw_cutoff_bits, LC3_INT* bfi, LC3_INT* gg_idx, LC3_INT* sns_vq_idx, LC3_INT* fac_ns_idx, LC3_INT* tns_numfilters, LC3_INT* tns_order, LC3_INT* ltpf_idx, LC3_INT* bw_cutoff_idx, LC3_INT* lastnz, - LC3_INT* lsbMode, LC3_INT frame_dms) + LC3_INT* lsbMode, LC3PLUS_FrameDuration frame_dms +#ifdef CR9_C_ADD_1p25MS + , LC3_INT32 rx_status[2], LC3_INT16* mem_continuation +#ifdef NEW_SIGNALLING_SCHEME_1p25 + , LC3_INT32 *ltpfinfo_frame_cntr /* set here , but also increased outside by bfi for the channel */ +#endif +#endif + ) { - LC3_INT plc_trigger_bw, plc_trigger_last_nz, plc_trigger_SNS1, plc_trigger_SNS2, tmp, bit, - submodeMSB, i, ltpf_tmp[3], ind, submodeLSB, bp_side_local, mask_side_local; - LC3_UINT8* ptr; - LC3_INT gainMSBbits[4] = {1, 1, 2, 2}; +#ifdef CR9_C_ADD_1p25MS_LRSNS + LC3_INT32 plc_trigger_bw, plc_trigger_last_nz, plc_trigger_SNS1, plc_trigger_SNS2, bit, + i, ltpf_tmp[3], bp_side_local, mask_side_local, rx_current_status, ltpf_idx_2_lrsns[3]; + LC3_UINT8 * ptr; +#ifdef LRSNS_PC_SIGNAL_FIX + LC3_INT bfiSNS; +#endif + + //UNUSED(rx_status); + //UNUSED(mem_continuation); + UNUSED(rx_current_status); +#else + LC3_INT32 plc_trigger_bw, plc_trigger_last_nz, plc_trigger_SNS1, plc_trigger_SNS2, bit, + i, ltpf_tmp[3], bp_side_local, mask_side_local, rx_current_status; + LC3_UINT8 * ptr; + UNUSED(rx_current_status); +#endif + +#ifdef NEW_SIGNALLING_SCHEME_1p25 + UNUSED(rx_current_status); +#endif *bp_side = -1; bp_side_local = numbytes - 1; /* Matlab offset by 1 */ @@ -146,11 +569,13 @@ void processDecoderEntropy_fl(LC3_UINT8* bytes, LC3_INT numbytes, LC3_INT* mask_ plc_trigger_bw = 1; /* Bandwidth */ plc_trigger_last_nz = 1; /* Last non-zero tuple */ - plc_trigger_SNS1 = 1; /* SNS-VQ 2nd stage MPVQ data (24-25 bits) */ - plc_trigger_SNS2 = 1; /* SNS-VQ 2nd stage MPVQ data (24-25 bits) */ - - + plc_trigger_SNS1 = 1; /* SNS-VQ 2nd stage MPVQ data (24-25 bits) */ +#ifdef LRSNS_10MS_BFISIGNAL_FIX + plc_trigger_SNS2 = 1; /* SNS-VQ 2nd stage MPVQ data (10-16 bits) */ +#else + plc_trigger_SNS2 = 2; /* SNS-VQ 2nd stage MPVQ data (10-16 bits) */ +#endif /* Bandwidth */ if (bw_cutoff_bits > 0) { read_uint_fl(bw_cutoff_bits, ptr, &mask_side_local, &bp_side_local, bw_cutoff_idx); @@ -167,14 +592,22 @@ void processDecoderEntropy_fl(LC3_UINT8* bytes, LC3_INT numbytes, LC3_INT* mask_ } /* Number of TNS filters */ - if (*bw_cutoff_idx < 3 || frame_dms == 25) { - *tns_numfilters = 1; +#ifdef CR9_C_ADD_1p25MS + if (frame_dms == LC3PLUS_FRAME_DURATION_1p25MS) { + *tns_numfilters = 0; } else { - *tns_numfilters = 2; +#endif + if (*bw_cutoff_idx < 3 || frame_dms == LC3PLUS_FRAME_DURATION_2p5MS) { + *tns_numfilters = 1; + } else { + *tns_numfilters = 2; + } +#ifdef CR9_C_ADD_1p25MS } +#endif /* Last non-zero tuple */ - read_uint_fl(ceil(LC3_LOGTWO(N >> 1)), ptr, &mask_side_local, &bp_side_local, lastnz); + read_uint_fl(getLastNzBits (N), ptr, &mask_side_local, &bp_side_local, lastnz); *lastnz = (*lastnz + 1) * 2; if (*lastnz > N) { @@ -197,73 +630,85 @@ void processDecoderEntropy_fl(LC3_UINT8* bytes, LC3_INT numbytes, LC3_INT* mask_ } /* LTPF activation flag */ +#ifdef NEW_SIGNALLING_SCHEME_1p25 + ltpf_tmp[1] = 0; /* ltpf activation idx */ + ltpf_tmp[2] = 0; /* quantized lag idx */ + if (frame_dms != LC3PLUS_FRAME_DURATION_1p25MS) + { + read_bit_fl(ptr, &mask_side_local, &bp_side_local, <pf_tmp[0]); + } + else + { /* read one of {2, 6, 7} bits into ltp/ltpf/lag variable ltpf_idx[ 0 ... 2] */ + readLtpData_fl(ptr, bfi, &mask_side_local, &bp_side_local, ltpf_tmp, rx_status, ltpfinfo_frame_cntr, mem_continuation); + } /* ! LC3PLUS_FRAME_DURATION_1p25MS */ +#else read_bit_fl(ptr, &mask_side_local, &bp_side_local, <pf_tmp[0]); +#endif - /* SNS-VQ 1st stage */ - read_uint_fl(5, ptr, &mask_side_local, &bp_side_local, &scf_idx[0]); - read_uint_fl(5, ptr, &mask_side_local, &bp_side_local, &scf_idx[1]); - - /* SNS-VQ 2nd stage side-info (3-4 bits) */ - read_bit_fl(ptr, &mask_side_local, &bp_side_local, &submodeMSB); - scf_idx[2] = submodeMSB * 2; - - read_uint_fl(gainMSBbits[scf_idx[2]], ptr, &mask_side_local, &bp_side_local, &scf_idx[3]); - read_bit_fl(ptr, &mask_side_local, &bp_side_local, &scf_idx[4]); - - /* SNS-VQ 2nd stage MPVQ data (24-25 bits) */ - if (submodeMSB == 0) { - read_uint_fl(25, ptr, &mask_side_local, &bp_side_local, &tmp); - if (tmp >= 33460056) { - *bfi = plc_trigger_SNS1; - if (*bfi) { - return; - } - } - - ind = floor(tmp / 2390004); - scf_idx[5] = tmp - ind * 2390004; + /* read SNS data */ +#ifdef CR9_C_ADD_1p25MS_LRSNS + ltpf_idx_2_lrsns[0] = ltpf_tmp[0]; /* raw LTP flag input to LRSNS */ + ltpf_idx_2_lrsns[1] = ltpf_tmp[1]; /* raw LTPF flag input to LRSNS */ +#ifdef LRSNS_PC_SIGNAL_FIX + bfiSNS = 0; /* Local BFI flag for Errors SNS bit area */ + readSNSData_fl(ptr, &bfiSNS, &mask_side_local, &bp_side_local, ltpf_idx_2_lrsns, sns_vq_idx, frame_dms, plc_trigger_SNS1, plc_trigger_SNS2); + if (bfiSNS != 0 ) + { /* corrupt SNSbits triggers PLC through global PLC flag. + *bfi==2 and bfiSNS == 0 maintains bfi==2 for PC + */ + *bfi = 1; + return; + } - if (ind < 2) { - submodeLSB = 1; - scf_idx[3] = scf_idx[3] * 2 + ind; - scf_idx[6] = -2; - } else { - submodeLSB = 0; - scf_idx[6] = ind - 2; + if (frame_dms == LC3PLUS_FRAME_DURATION_1p25MS) + { /* for 1.25ms and previously detected bit errors --> handle frame as a completely corrupt bad frame */ + if (*bfi == 2) + { + *bfi = 1; + return; } + } - } else { - read_uint_fl(24, ptr, &mask_side_local, &bp_side_local, &tmp); - - if (tmp >= 16708096) { - *bfi = plc_trigger_SNS2; - if (*bfi) { - return; - } - } +#else + readSNSData_fl(ptr, bfi, &mask_side_local, &bp_side_local, ltpf_idx_2_lrsns, sns_vq_idx, frame_dms, plc_trigger_SNS1, plc_trigger_SNS2); + if (*bfi != 0) + { + *bfi = 1; + return; + } +#endif +#else + readSNSData_fl(ptr, bfi, &mask_side_local, &bp_side_local, sns_vq_idx, frame_dms, &plc_trigger_SNS1, &plc_trigger_SNS2); +#endif - if (tmp >= 15158272) { - submodeLSB = 1; - scf_idx[3] = scf_idx[3] * 2 + ((tmp - 15158272) & 1); - scf_idx[5] = floor((tmp - 15158272) / 2); - scf_idx[6] = -2; - } else { - submodeLSB = 0; - scf_idx[5] = tmp; - scf_idx[6] = -1; + /* LTPF data */ +#ifdef CR9_C_ADD_1p25MS +#ifdef NEW_SIGNALLING_SCHEME_1p25 + if ( frame_dms != LC3PLUS_FRAME_DURATION_1p25MS ) + { + ltpf_tmp[1] = 0; + ltpf_tmp[2] = 0; + if (ltpf_tmp[0] == 1) + { + read_bit_fl(ptr, &mask_side_local, &bp_side_local, <pf_tmp[1]); + read_uint_fl(9, ptr, &mask_side_local, &bp_side_local, <pf_tmp[2]); } } +#endif +#endif - scf_idx[2] = scf_idx[2] + submodeLSB; - - /* LTPF data */ - if (ltpf_tmp[0] == 1) { +#ifndef CR9_C_ADD_1p25MS + if (ltpf_tmp[0] == 1) + { read_bit_fl(ptr, &mask_side_local, &bp_side_local, <pf_tmp[1]); read_uint_fl(9, ptr, &mask_side_local, &bp_side_local, <pf_tmp[2]); - } else { + } + else + { ltpf_tmp[1] = 0; ltpf_tmp[2] = 0; } +#endif /* CR9_C_ADD_1p25MS */ for (i = 0; i < 3; i++) { ltpf_idx[i] = ltpf_tmp[i]; @@ -271,7 +716,7 @@ void processDecoderEntropy_fl(LC3_UINT8* bytes, LC3_INT numbytes, LC3_INT* mask_ /* Noise factor */ read_uint_fl(3, ptr, &mask_side_local, &bp_side_local, fac_ns_idx); - + *bp_side = bp_side_local; *mask_side = mask_side_local; } diff --git a/lib_lc3plus/dec_lc3_fl.c b/lib_lc3plus/dec_lc3_fl.c index f86eff3430dd64fd952c316e0e27aca0da0a8d62..3606077cefd22062f04d5cb5e5c904ec30807cc0 100644 --- a/lib_lc3plus/dec_lc3_fl.c +++ b/lib_lc3plus/dec_lc3_fl.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.5.1 * +* ETSI TS 103 634 V1.6.1 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -19,9 +19,13 @@ static int Dec_LC3PLUS_Channel_fl(LC3PLUS_Dec* decoder, int channel, uint8_t* bs i = 0, tns_order[2] = {0}, sqQdec[MAX_LEN] = {0}; LC3_INT b_left; LC3_FLOAT stab_fac = 0; +#ifdef CR9_C_ADD_1p25MS_LRSNS + LC3_INT32 pitch_rx; + LC3_INT32 ltpf_rx; +#endif h_DecSetup = decoder->channel_setup[channel]; - + memset(h_DecSetup->tns_idx, 0, sizeof(*h_DecSetup->tns_idx) * TNS_NUMFILTERS_MAX * MAXLAG); bfi = bfi_ext; @@ -33,15 +37,31 @@ static int Dec_LC3PLUS_Channel_fl(LC3PLUS_Dec* decoder, int channel, uint8_t* bs decoder->rframe = 1; } +#ifdef NEW_SIGNALLING_SCHEME_1p25 + h_DecSetup->ltpfinfo_frame_cntr = MIN(32767, h_DecSetup->ltpfinfo_frame_cntr + 1); /*increased always, also for bfi==1 */ /* set or reset inside processDecoderEntropy_fl */ +#endif + /* Entropy decoding */ if (bfi != 1) { processDecoderEntropy_fl(bs_in, h_DecSetup->targetBytes, &mask_side, &bp_side, decoder->yLen, decoder->fs_idx, decoder->BW_cutoff_bits, &bfi, &gg_idx, h_DecSetup->scf_idx, &fac_ns_idx, &tns_numfilters, tns_order, h_DecSetup->ltpf_param, &bw_cutoff_idx, &lastnz, &lsbMode, decoder->frame_dms + + +#ifdef CR9_C_ADD_1p25MS +#ifdef FIX_TX_RX_STRUCT_STEREO + , h_DecSetup->ltpf_rx_status, &h_DecSetup->ltpf_mem_continuation +#else + , decoder->ltpf_rx_status, &h_DecSetup->ltpf_mem_continuation +#endif +#ifdef NEW_SIGNALLING_SCHEME_1p25 + , &h_DecSetup->ltpfinfo_frame_cntr /* set here, but also increased outside during/when bfi for the channel */ +#endif +#endif ); h_DecSetup->BW_cutoff_idx_nf = bw_cutoff_idx; } - + /* Arithmetic decoding */ if (bfi != 1) { processAriDecoder_fl(bs_in, bp_side, mask_side, decoder->yLen, decoder->fs_idx, @@ -50,26 +70,33 @@ static int Dec_LC3PLUS_Channel_fl(LC3PLUS_Dec* decoder, int channel, uint8_t* bs decoder->n_pc, decoder->be_bp_left, decoder->be_bp_right, 0, &b_left, &h_DecSetup->spec_inv_idx, decoder->hrmode ); - + if (decoder->rframe == 1 && zero_frame == 0 && bfi != 1) { LC3_INT32 max_bw_stopband = BW_cutoff_bin_all[bw_cutoff_idx]; bfi = 2; switch (decoder->frame_dms) { - case 25: +#ifdef CR9_C_ADD_1p25MS + case LC3PLUS_FRAME_DURATION_1p25MS: + max_bw_stopband = max_bw_stopband >> 3; + break; +#endif + case LC3PLUS_FRAME_DURATION_2p5MS: max_bw_stopband = max_bw_stopband >> 2; break; - case 50: + case LC3PLUS_FRAME_DURATION_5MS: max_bw_stopband = max_bw_stopband >> 1; break; - case 75: + case LC3PLUS_FRAME_DURATION_7p5MS: max_bw_stopband = 3 * (max_bw_stopband >> 2); break; - case 100: + case LC3PLUS_FRAME_DURATION_10MS: break; + case LC3PLUS_FRAME_DURATION_UNDEFINED: + assert(0); } - + h_DecSetup->spec_inv_idx = MAX(lastnz, max_bw_stopband); } @@ -78,18 +105,33 @@ static int Dec_LC3PLUS_Channel_fl(LC3PLUS_Dec* decoder, int channel, uint8_t* bs h_DecSetup->sqQdec_fl[i] = (LC3_FLOAT)sqQdec[i]; } } - + if (bfi != 1) { /* SNS Quantize Decoder */ +#ifdef CR9_C_ADD_1p25MS_LRSNS + if (decoder->frame_dms == LC3PLUS_FRAME_DURATION_1p25MS) /* 9,10,29,30 bit low rate SNS VQ */ + { + pitch_rx = ( h_DecSetup->ltpf_param[0] != 0 ); + ltpf_rx = ( h_DecSetup->ltpf_param[1] != 0 ) ; + + snsQuantScfDecLR(h_DecSetup->scf_idx, h_DecSetup->scf_q, pitch_rx, ltpf_rx); /* 9,12,29,30, bits decoding including pitch_rx, ltpf_rx info */ + } + else + { + process_snsQuantizesScf_Dec(h_DecSetup->scf_idx, h_DecSetup->scf_q); /* 38 bits decoded */ + } +#else + /* SNS Quantize Decoder */ process_snsQuantizesScf_Dec(h_DecSetup->scf_idx, h_DecSetup->scf_q); +#endif } if (h_DecSetup->PlcAdvSetup) { processPlcComputeStabFacMain_fl(h_DecSetup->scf_q, h_DecSetup->PlcAdvSetup->scf_q_old, h_DecSetup->PlcAdvSetup->scf_q_old_old, bfi, h_DecSetup->PlcSetup.prevBfi, h_DecSetup->PlcSetup.prevprevBfi, &h_DecSetup->PlcAdvSetup->stabFac); } - + if ( bfi != 1 ) { stab_fac = 1; @@ -103,28 +145,52 @@ static int Dec_LC3PLUS_Channel_fl(LC3PLUS_Dec* decoder, int channel, uint8_t* bs fac_ns_idx, &h_DecSetup->statePC, h_DecSetup->spec_inv_idx, decoder->yLen); } +#ifdef CR9_C_ADD_1p25MS + if ( bfi == 1 ) + { +#ifdef FIX_TX_RX_STRUCT_STEREO + h_DecSetup->ltpf_rx_status[0] = 0; + h_DecSetup->ltpf_rx_status[1] = 0; +#else + decoder->ltpf_rx_status[0] = 0; + decoder->ltpf_rx_status[1] = 0; +#endif + } +#endif + /* Decoding only if no bit error detected */ if (bfi != 1) { /* Residual decoding */ if (residualPresent) { - processResidualDecoding_fl(&bitsRead, h_DecSetup->sqQdec_fl, decoder->yLen, h_DecSetup->resBits, - nbits_residual - , decoder->hrmode + processResidualDecoding_fl(&bitsRead, h_DecSetup->sqQdec_fl, decoder->yLen, h_DecSetup->resBits, nbits_residual, decoder->hrmode +#ifdef ENABLE_12p5_DMS_MODE + , decoder->frame_dms +#endif ); } - - + /* Noise filling */ - if (zero_frame == 0) { +#ifdef CR9_C_ADD_1p25MS + if (zero_frame == 0 && decoder->cutoffBins != NULL) +#else + if (zero_frame == 0) +#endif + { processNoiseFilling_fl(h_DecSetup->sqQdec_fl, nf_seed, fac_ns_idx, decoder->cutoffBins[h_DecSetup->BW_cutoff_idx_nf], decoder->frame_dms, h_DecSetup->prev_fac_ns, h_DecSetup->spec_inv_idx); } - + /* Application of global gain */ processApplyGlobalGain_fl(h_DecSetup->sqQdec_fl, decoder->yLen, gg_idx, h_DecSetup->quantizedGainOff); /* TNS decoder */ +#ifdef CR9_C_ADD_1p25MS + if (tns_numfilters > 0) { +#endif processTnsDecoder_fl(h_DecSetup->sqQdec_fl, h_DecSetup->tns_idx, tns_order, tns_numfilters, decoder->cutoffBins[bw_cutoff_idx], h_DecSetup->N_red_tns, h_DecSetup->fs_red_tns); +#ifdef CR9_C_ADD_1p25MS + } +#endif /* SNS interpolation */ processSnsInterpolateScf_fl(h_DecSetup->scf_q, 0, decoder->bands_number, h_DecSetup->int_scf); @@ -132,7 +198,7 @@ static int Dec_LC3PLUS_Channel_fl(LC3PLUS_Dec* decoder, int channel, uint8_t* bs /* MDCT shaping */ processMdctShaping_fl(h_DecSetup->sqQdec_fl, h_DecSetup->int_scf, decoder->bands_offset, decoder->bands_number); } - + /* PLC */ processPlcMain_fl(h_DecSetup->sqQdec_fl, h_DecSetup->x_fl, decoder, h_DecSetup, bfi, h_DecSetup->PlcAdvSetup, &h_DecSetup->PlcSetup, decoder->plcMeth, h_DecSetup->ltpf_mem_pitch, h_DecSetup->ltpf_mem_pitch_fr, decoder->tilt, decoder->bands_offset, @@ -147,7 +213,7 @@ static int Dec_LC3PLUS_Channel_fl(LC3PLUS_Dec* decoder, int channel, uint8_t* bs &h_DecSetup->PlcAdvSetup->cum_fflcAtten , h_DecSetup->PlcAdvSetup->plc_fadeout_type ); - + /* IMDCT */ if (h_DecSetup->concealMethod == 4 || bfi != 1 ) { @@ -158,15 +224,20 @@ static int Dec_LC3PLUS_Channel_fl(LC3PLUS_Dec* decoder, int channel, uint8_t* bs processPlcUpdate_fl(h_DecSetup->PlcAdvSetup , decoder->frame_length, h_DecSetup->x_fl, h_DecSetup->scf_q, &h_DecSetup->PlcSetup.nbLostCmpt, &h_DecSetup->PlcNsSetup.cum_alpha, bfi, &h_DecSetup->PlcSetup.prevBfi, &h_DecSetup->PlcSetup.prevprevBfi); - + /* LTPF decoder */ process_ltpf_decoder_fl(h_DecSetup->x_fl, decoder->frame_length, h_DecSetup->x_fl, decoder->fs, h_DecSetup->ltpf_mem_x, h_DecSetup->ltpf_mem_y, &h_DecSetup->ltpf_mem_pitch, &h_DecSetup->ltpf_mem_pitch_fr, &h_DecSetup->ltpf_mem_gain, &h_DecSetup->ltpf_mem_beta_idx, bfi, h_DecSetup->ltpf_param, h_DecSetup->ltpf_param_mem, h_DecSetup->ltpf_conf_beta_idx, - h_DecSetup->ltpf_conf_beta, h_DecSetup->concealMethod, h_DecSetup->alpha + &h_DecSetup->ltpf_conf_beta, h_DecSetup->concealMethod, h_DecSetup->alpha , &h_DecSetup->ltpf_mem_active , &h_DecSetup->rel_pitch_change, decoder->hrmode, decoder->frame_dms +#ifdef CR9_C_ADD_1p25MS + , &h_DecSetup->ltpf_mem_continuation, h_DecSetup->ltpf_param_mem_prev, + &h_DecSetup->ltpf_mem_pitch_prev, &h_DecSetup->ltpf_mem_pitch_fr_prev, &h_DecSetup->ltpf_mem_beta_idx_prev, &h_DecSetup->ltpf_mem_gain_prev, + &h_DecSetup->ltpf_pitch_stability_counter, &h_DecSetup->ltpf_gain_step, h_DecSetup->ltpf_conf_beta_max +#endif ); { @@ -193,17 +264,18 @@ LC3PLUS_Error Dec_LC3PLUS_fl(LC3PLUS_Dec* decoder, uint8_t* input, LC3_INT32 num LC3_INT32 fec_num_bytes; LC3_INT32 lc3_channel_num_bytes; LC3_INT32 channel_bfi, out_bfi; + LC3_INT32 chan_error_report; LC3PLUS_EpModeRequest channel_epmr; - + bfi = bfi_ext; lc3_num_bytes = 0; err = LC3PLUS_OK; - + if (bfi == 0) { bfi = !num_bytes; } - + if (decoder->ep_enabled) { decoder->combined_channel_coding = decoder->channels > 1 && num_bytes <= 160; @@ -231,7 +303,7 @@ LC3PLUS_Error Dec_LC3PLUS_fl(LC3PLUS_Dec* decoder, uint8_t* input, LC3_INT32 num } else { - decoder->channel_setup[ch]->last_size = lc3_channel_num_bytes; + decoder->channel_setup[ch]->last_size = lc3_channel_num_bytes; } } @@ -246,20 +318,27 @@ LC3PLUS_Error Dec_LC3PLUS_fl(LC3PLUS_Dec* decoder, uint8_t* input, LC3_INT32 num { decoder->epmr = LC3PLUS_EPMR_HIGH_NC; out_bfi = 0; + decoder->error_report = 0; for (ch = 0; ch < decoder->channels; ch++) { fec_num_bytes = num_bytes / decoder->channels + (ch < (num_bytes % decoder->channels)); - channel_bfi = bfi; + channel_bfi = bfi; - decoder->error_report = fec_decoder(input, fec_num_bytes, &lc3_num_bytes, &channel_epmr, + chan_error_report = fec_decoder(input, fec_num_bytes, &lc3_num_bytes, &channel_epmr, decoder->combined_channel_coding, &decoder->n_pccw, &channel_bfi, &decoder->be_bp_left, &decoder->be_bp_right, &decoder->n_pc, &decoder->m_fec); + + if (chan_error_report < 0 || decoder->error_report < 0) { + decoder->error_report = -1; + } else { + decoder->error_report += chan_error_report; + } decoder->epmr = MIN((LC3PLUS_EpModeRequest) decoder->epmr, channel_epmr); - + #ifdef ENABLE_PADDING if (channel_bfi != 1) { @@ -274,9 +353,9 @@ LC3PLUS_Error Dec_LC3PLUS_fl(LC3PLUS_Dec* decoder, uint8_t* input, LC3_INT32 num { input = input + np_zero; } - + decoder->n_pc = MAX(decoder->n_pc - (2 * np_zero), 0); - + if (channel_bfi == 2) { if (decoder->be_bp_right < (8 * np_zero)) @@ -337,7 +416,7 @@ LC3PLUS_Error Dec_LC3PLUS_fl(LC3PLUS_Dec* decoder, uint8_t* input, LC3_INT32 num bfi = 1; decoder->last_error = LC3PLUS_PADDING_ERROR; } - + lc3_num_bytes = lc3_num_bytes - padding_len; if (lc3_num_bytes < 20 || lc3_num_bytes > LC3PLUS_MAX_BYTES) { @@ -345,8 +424,8 @@ LC3PLUS_Error Dec_LC3PLUS_fl(LC3PLUS_Dec* decoder, uint8_t* input, LC3_INT32 num decoder->last_error = FRAMESIZE_ERROR; } } -#endif - +#endif + if (bfi != 1 && lc3_num_bytes != decoder->channel_setup[ch]->last_size) { err = update_dec_bitrate(decoder, ch, lc3_num_bytes); diff --git a/lib_lc3plus/defines.h b/lib_lc3plus/defines.h index 48c89f9ca02b2f2d25701b72b414fe54d168d58c..de7b1be260049947aa74718d612d532603f5e8c6 100644 --- a/lib_lc3plus/defines.h +++ b/lib_lc3plus/defines.h @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.5.1 * +* ETSI TS 103 634 V1.6.1 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -42,8 +42,52 @@ typedef uint32_t LC3_UINT32; #ifndef NO_POST_REL_CHANGES /* Post-release non-bitexact changes */ +#define CR13_B_FIX_PC_BINS +#define CR13_C_RESET_CLASSIFIER_AFTER_BAD_FRAMES +#define CR12_D_FIX_BITRATE_LIMITS + +#define CR9_C_ADD_1p25MS +#ifdef CR9_C_ADD_1p25MS +#define ENABLE_12p5_DMS_MODE +#define CR9_C_ADD_1p25MS_LRSNS +#define FIX_LTPF_PITCH_1p25 + +#endif + #endif /* NO_POST_REL_CHANGES */ +#ifdef CR9_C_ADD_1p25MS_LRSNS +#define LRSNS_PC_SIGNAL_FIX /*correct handling of incoming bfi==2 to DEC_ENTROPY for conformance */ +#define LRSNS_10MS_BFISIGNAL_FIX /* correct signaling of detected BER in SNS/LRSNS */ +#define LRSNS_WMC_FIX +/*#define LRSNS_CBC_NO_LTPF_DEPENDENCY */ /* turn off LRSNS CB_C dependency on LTPF activation flag */ + +#define SNSLR_N_FIXENV 4 /* 4 fix envelopes multiplexed inside the full codeword */ +#define SNSLR_N_FIXENV_SHIFTS 4 /* 2 bits */ +#define SNSLR_MAX_PVQ_CAND 6 /* splitLF(0), full(1), fixed_env 2+{0,1,2,3 }, */ +#define SNSLR_MAX_PVQ_SEARCH_CAND (SNSLR_MAX_PVQ_CAND-SNSLR_N_FIXENV+1) /* 3 = splitLF(0), full(1), fixed_envs(2), */ + + + +#endif + +#ifdef CR9_C_ADD_1p25MS_LRSNS +#define LC3_CONST_FLOATMAX FLT_MAX +#endif + +#ifdef CR9_C_ADD_1p25MS_LRSNS +#undef SNS_VQ_MAX_IDX +#define SNS_VQ_MAX_IDX 8 + +#define SNSLR_NST1 170 /* 3*170 + 2 = 512 */ +#define SNSLR_NPVQ_L5K6 1970 /* mux into 11 bits 2048 pos , 78 slots remaining, 6 whole bits */ +#define SNSLR_NPVQ_L5K8 5890 /* additional split LF part muxed into 13 bits, log2(5980)= 12.5241 */ +#define SNSLR_NPVQ_L5K5 1002 /* mux into 10 bits 1024 pos , 22 slots remainging 4 whole bits */ +#define SNSLR_NPVQ_L8K2 128 /* 1+ 6 = 7 bits */ +#define SNSLR_NPVQ_L15K5 207006 /* 1+ 16.6593 bits */ + +#endif + #define MAX_UINT8 255 #define THRESH_100_DMS_TDC_CNT 9 #define THRESH_100_DMS_NS_CNT 7 @@ -61,6 +105,68 @@ typedef uint32_t LC3_UINT32; #define PLC_LONGTERM_ANALYSIS_MS 200 /* Analysis window 2000 ms / 10 ms */ #define PLC_LONGTERM_ANALYSIS_STARTUP_FILL 0.5f /* required buffer fill amount, set to 0.0 to not require any fill at all */ + + +#define SNS_IDX_LF 0 +#define SNS_IDX_HF 1 +#define SNS_IDX_SHAPEJ 2 +#define SNS_IDX_GAIN 3 +#define SNS_IDX_LS_INDA 4 +#define SNS_IDX_A 5 +#define SNS_IDX_BORGAINLSB 6 + +#ifdef CR9_C_ADD_1p25MS + +/* master integration fixes for 1p25 */ +#define FIX_FLOAT_ENC_QUANTIZE_1P25MS_512KBPS /* add two last MDCT coeffs into the last quadruple for global_gain _energy_ analysis */ +#define FIX_FLOAT_LT_NORMCORR_INIT /*align state to BASOP start value of ~.5 as it has an effect on SNS_compute */ + +#define FIX_BOTH_1p25_WB_GLOBGAINOFFSET_NONBE /* 1p25 curve tilt calulation corrected and made into BASOP */ +#define FIX_BOTH_1p25_WB_GLOBGAINOFFSET_LOWLIM_NONBE -135 /* 1p25 curve tilt calulation limited to value -135 kbps for NB&WB */ +#define FIX_BOTH_1p25_TEST_NEW_GG_EST2 /* GG_EST2_will use bands with two coeffs in each instead of four, for 1p25 WB and 1p25 SSWB , note only active for regular, hrmode==0 */ + +#ifdef FIX_BOTH_1p25_TEST_NEW_GG_EST2 +#define FIX_BOTH_1p25_GG_EST_SWB_FB /* 1.25ms GG_EST update for SWB/FB, better RD curve float and BASOP , active for hrmode==0 */ +#endif + +/* defines to activate 2 or 3 tuple 1.25ms loops for all or any of WB,SSWB,SWB,FB */ +#define FIX_1p25_GG_EST_TUPLES /* 1.25 ms will use 2 or 3 tuples, note only active for regular, hrmode==0 */ +#ifdef FIX_1p25_GG_EST_TUPLES +#define GG_1p25_WB_TUPLES 2 +#define GG_1p25_SSWB_TUPLES 2 +#define GG_1p25_SWB_TUPLES 2 +#define GG_1p25_FB_TUPLES 3 +#define GG_1p25_MAX_TUPLES MAX(MAX(GG_1p25_WB_TUPLES ,GG_1p25_SSWB_TUPLES ), MAX(GG_1p25_SWB_TUPLES ,GG_1p25_FB_TUPLES)) /* used to control common energy loop */ + +#ifndef FIX_BOTH_1p25_ALLOC_SPECTRUM +#define FIX_BOTH_1p25_ALLOC_SPECTRUM +#endif + +#endif + + +#define LTPF_ADAPTIVE_GAIN_RATE 20 /* Number of frames it must take to reach maximum beta from the default value, provided the pitch remains constant */ +#define LTPF_ADAPTIVE_GAIN + +#ifdef LTPF_ADAPTIVE_GAIN +#define LTPF_PITCH_STABILITY_THRESHOLD 5 /* Number of frames for which the pitch must be constant for adaptive gain and pitch correction to be applied */ +#define LTPF_ADAPTIVE_GAIN_RATE 20 /* Number of frames it must take to reach maximum beta from the default value, provided the pitch remains constant */ + +#define LTPF_ADAPTIVE_GAIN_WITH_NORM_CORR +#endif + +#ifdef CR9_C_ADD_1p25MS +#define FIX_LTPF_MEM_CONTINUATION +#define FIX_LTPF_PITCH_MEM_LEN +#define FIX_PLC_CONFORM_ISSUES +#define FIX_TDC_BURST_ERROR +#define FIX_LTPF_DEC_FLFX_MISMATCH +#define FIX_TX_RX_STRUCT_STEREO +#define FIX_ADDITONAL_1p25_ISSUES +#define NEW_SIGNALLING_SCHEME_1p25 +#define FIX_LTPF_1p25 +#endif +#endif /* Precision Defines */ #define LC3_FABS(x) (fabsf(x)) @@ -71,16 +177,23 @@ typedef uint32_t LC3_UINT32; #define LC3_SIN(x) (sin(x)) #define LC3_SQRT(x) (sqrtf(x)) #define LC3_EXP(x) (expf(x)) +#define LC3_FMIN(x, y) (fminf(x, y)) +#define LC3_FMAX(x, y) (fmaxf(x, y)) -#define MAX_BR 320000 /* 400 * 800 */ -#define MIN_BR_100DMS 16000 /* 20 * 800 * 100/100 */ -#define MIN_BR_025DMS 64000 /* 20 * 800 * 100/ 25 */ -#define MIN_BR_050DMS 32000 /* 20 * 800 * 100/ 50 */ +#define MAX_BR 320000 /* 400 * 800 */ +#define MIN_BR_100DMS 16000 /* 20 * 800 * 100/100 */ +#define MIN_BR_025DMS 64000 /* 20 * 800 * 100/ 25 */ +#define MIN_BR_050DMS 32000 /* 20 * 800 * 100/ 50 */ #define MAX_BR_050DMS_NB 260800 /* 163 * 800 * 100/ 50 */ #define MAX_BR_100DMS_NB 114400 /* for 100ms at 8kHz */ #define MAX_BR_100DMS_WB 221600 /* for 100ms at 16kHz */ #define MAX_BR_100DMS_SSWB 314400 /* for 100ms at 24kHz */ +#ifdef CR9_C_ADD_1p25MS +#define MIN_BR_0125DMS 128000 /* 20 * 800 * 100/ 12.5 */ +#define MAX_BR_0125DMS 512000 +#endif + #define MIN_BR_075DMS_48KHZ_HR ((int)124800/ 800/2)* 800 #define MIN_BR_075DMS_96KHZ_HR ((int)149600/ 800/2)* 800 #define MIN_BR_075DMS 21334 /* ceil( 20 * 800 * 100/ 75) */ @@ -148,8 +261,24 @@ typedef int32_t LC3_INT32; #define PLC34_ATTEN_FAC_050 0.7071 /* attenuation factor for NS and TDC @ 5.0 ms*/ #define PLC34_ATTEN_FAC_025 0.8409 /* attenuation factor for NS and TDC @ 2.5 ms*/ +#ifdef CR9_C_ADD_1p25MS +#define PLC34_ATTEN_FAC_0125 0.9995 /* attenuation factor for NS and TDC @ 1.25 ms*/ +#endif + #define FEC_SLOT_BYTES_MIN 40 #define FEC_SLOT_BYTES_MAX 400 +#ifdef CR12_D_FIX_BITRATE_LIMITS +#ifdef ENABLE_HR_MODE_FL +#define FEC_SLOT_BYTES_MIN_025DMS_48KHZ_HR 54 +#define FEC_SLOT_BYTES_MIN_025DMS_96KHZ_HR 61 +#define FEC_SLOT_BYTES_MIN_050DMS_48KHZ_HR 87 +#define FEC_SLOT_BYTES_MIN_050DMS_96KHZ_HR 101 +#define FEC_SLOT_BYTES_MIN_075DMS_48KHZ_HR 110 +#define FEC_SLOT_BYTES_MIN_075DMS_96KHZ_HR 126 +#define FEC_SLOT_BYTES_MIN_100DMS_48KHZ_HR 140 +#define FEC_SLOT_BYTES_MIN_100DMS_96KHZ_HR 164 +#endif +#endif #define LC3_CONST_POW_2_M15 3.051757812500000e-05 #define LC3_CONST_POW_2_23 8388608 @@ -166,13 +295,12 @@ typedef int32_t LC3_INT32; #define G192_ONE 0x0081 #define READ_G192FER /* Allow C executable to also read G192 formatted FER files */ -#ifdef DEBUG +#ifdef DEBUG #ifdef READ_G192FER -#define READ_G192_FER_BYTE /* Allow C executable to also read G192 byte formatted FER files 0x20=BAD , 0x21=Good */ +#define READ_G192_FER_BYTE /* Allow C executable to also read G192 byte formatted FER files 0x20=BAD , 0x21=Good */ #endif #endif - #define LC3_EPS (1.1e-7f) #define M_PI_LC3PLUS 3.14159265358979323846 @@ -221,6 +349,7 @@ typedef int32_t LC3_INT32; #define MIN_BR_100MS_48KHZ_HR ((int)124800/800/2)*800 #define MIN_BR_100MS_96KHZ_HR ((int)149600/800/2)*800 #endif /* ENABLE_HR_MODE */ + #define MAX_NBYTES2 625 #define BYTESBUFSIZE (MAX_NBYTES2 * MAX_CHANNELS) #define MAX_BW_BIN 400 @@ -245,8 +374,21 @@ typedef int32_t LC3_INT32; 7 /* (L+H) + submode_MSB +gain+(Ia_leads+Ia_mpvq)+(Ib_joint_mpvq), \ submode-LSB */ -/* RESIDUAL CODING */ -#define NPRM_RESQ 5 * MAX_LEN +#ifdef CR9_C_ADD_1p25MS +#undef SNS_VQ_MAX_IDX +#define SNS_VQ_MAX_IDX 8 + +#define SNSLR_NST1 170 /*, 3*170 + 2 = 512 */ +#define SNSLR_NPVQ_L5K6 1970 /* mux into 11 bits 2048 pos , 78 slots remaining, 6 whole bits */ +#define SNSLR_NPVQ_L5K5 1002 /* mux into 10 bits 1024 pos , 22 slots remainging 4 whole bits */ +#define SNSLR_NPVQ_L8K2 128 /* 1+6 = 7 bits */ +#define SNSLR_NPVQ_L15K5 207006 /* 1+ 16.6593 bits , */ + +#define SNSLR_ST1_SCALEC (round(1.5*16384.0)/16384.0 ) /* SNS_ST1_SCALEC 1.5 in Q1.14 */ +#define SNSLR_ST1_INVSCALEC (round((2.0/3.0)*(32768.0))/32768.0) /* SNSLR_ST1_INVSCALEC 0.66667 in Q0.15 */ + +#endif /* CR9_C_ADD_1p25MS */ + /* MDCT */ #define MDCT_MEM_LEN_MAX (MAX_LEN - ((180 * MAX_LEN) / 480)) @@ -266,7 +408,11 @@ typedef int32_t LC3_INT32; #define RES2_PITCH_12K8 157 #define RES4_PITCH_12K8 127 #define LTPF_MEMIN_LEN (MAX_PITCH_12K8 + 4) - +#ifdef CR9_C_ADD_1p25MS +#define LEN_MEM_NORMCORR 5 +#else +#define LEN_MEM_NORMCORR 2 +#endif /* Advanced PLC */ diff --git a/lib_lc3plus/detect_cutoff_warped.c b/lib_lc3plus/detect_cutoff_warped.c index 4005c68e74446270079ca0028b4c41d5fda2a5ee..f5ccc45ed69d2471a5a09fe5570b2665815063e3 100644 --- a/lib_lc3plus/detect_cutoff_warped.c +++ b/lib_lc3plus/detect_cutoff_warped.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.5.1 * +* ETSI TS 103 634 V1.6.1 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -11,7 +11,7 @@ #include "wmc_auto.h" #include "functions.h" -void processDetectCutoffWarped_fl(LC3_FLOAT* d2, LC3_INT fs_idx, LC3_INT frame_dms, LC3_INT* bw_idx) +void processDetectCutoffWarped_fl(LC3_FLOAT* d2, LC3_INT fs_idx, LC3PLUS_FrameDuration frame_dms, LC3_INT* bw_idx) { const LC3_INT *warp_idx_start, *warp_idx_stop; LC3_INT counter, brickwall = 0, i, stop, dist; @@ -23,26 +23,33 @@ void processDetectCutoffWarped_fl(LC3_FLOAT* d2, LC3_INT fs_idx, LC3_INT frame_d switch (frame_dms) { - case 25: +#ifdef CR9_C_ADD_1p25MS + case LC3PLUS_FRAME_DURATION_1p25MS: + assert (0); + break; +#endif + case LC3PLUS_FRAME_DURATION_2p5MS: warp_idx_start = BW_warp_idx_start_all_2_5ms[fs_idx - 1]; warp_idx_stop = BW_warp_idx_stop_all_2_5ms[fs_idx - 1]; bw_dist = brickwall_dist; break; - case 50: + case LC3PLUS_FRAME_DURATION_5MS: warp_idx_start = BW_warp_idx_start_all_5ms[fs_idx - 1]; warp_idx_stop = BW_warp_idx_stop_all_5ms[fs_idx - 1]; bw_dist = brickwall_dist; break; - case 75: + case LC3PLUS_FRAME_DURATION_7p5MS: warp_idx_start = BW_warp_idx_start_all_7_5ms[fs_idx - 1]; warp_idx_stop = BW_warp_idx_stop_all_7_5ms[fs_idx - 1]; bw_dist = brickwall_dist_7_5ms; break; - case 100: + case LC3PLUS_FRAME_DURATION_10MS: warp_idx_start = BW_warp_idx_start_all[fs_idx - 1]; warp_idx_stop = BW_warp_idx_stop_all[fs_idx - 1]; bw_dist = brickwall_dist; break; + case LC3PLUS_FRAME_DURATION_UNDEFINED: + assert(0); } counter = fs_idx; diff --git a/lib_lc3plus/enc_entropy.c b/lib_lc3plus/enc_entropy.c index 28e3cea69cde99ee361c6d6701aca9556ec09866..51f9ddb1bfee2874f6d29bfc9b0cc63477430ff7 100644 --- a/lib_lc3plus/enc_entropy.c +++ b/lib_lc3plus/enc_entropy.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.5.1 * +* ETSI TS 103 634 V1.6.1 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -11,21 +11,352 @@ #include "wmc_auto.h" #include "functions.h" -static const LC3_INT gainMSBbits[4] = {1, 1, 2, 2}; -static const LC3_INT gainLSBbits[4] = {0, 1, 0, 1}; +#ifdef CR9_C_ADD_1p25MS + +#ifdef NEW_SIGNALLING_SCHEME_1p25 +void writeLtpData_fl( LC3_UINT8* ptr, LC3_INT* bp_side, LC3_INT* mask_side, LC3_INT32* ltpf_idx, LC3_INT16* Tx_ltpf ); +#endif + +void writeSNSData_fl(LC3_UINT8* ptr, LC3_INT* bp_side, LC3_INT* mask_side, LC3PLUS_FrameDuration frame_dms, LC3_INT32* scf_idx); +#else /* CR9_C_ADD_1p25MS */ +void writeSNSData_fl(LC3_UINT8* ptr, LC3_INT* bp_side, LC3_INT* mask_side, LC3_INT32* scf_idx); +#endif /* CR9_C_ADD_1p25MS */ + + +static const LC3_INT32 gainMSBbits[4] = {1, 1, 2, 2}; +static const LC3_INT32 gainLSBbits[4] = {0, 1, 0, 1}; + + +#ifdef CR9_C_ADD_1p25MS +#ifdef NEW_SIGNALLING_SCHEME_1p25 +void writeLtpData_fl( + LC3_UINT8* ptr, + LC3_INT* bp_side, + LC3_INT* mask_side, + LC3_INT32* ltpf_idx, + LC3_INT16* Tx_ltpf +) +{ + LC3_INT32 tmp; + LC3_INT32 bitsTx; + /* Hdr, information , bits used + 00 , no lag info , no phase info sum=2 + 010, PhaseA,LTPF=0, lagAbits=4 , sum=7 : pitch-PLC may be activated with old lag , 4 MSbs + 011, PhaseB,LTPF=0, lagBbits=4*, sum=7* : pitch-PLC may be activated with fresh lag, 4* = reduced lag resolution in Quantized ltpf_idx domain for PLC + 10 , PhaseA,LTPF=1, lagAbits=4 , sum=6 : LTPF may be activated with old lag + 11 , PhaseB,LTPF=1, lagBbits=5 , sum=7 : LTPF activated with fresh lag +*/ + + + tmp = MIN(*Tx_ltpf, 1); /*phaseA==0, phaseB==1*/ + + if (ltpf_idx[0] == 0) + { + write_bit_backward_fl(ptr, bp_side, mask_side, 0); /* "00" */ + write_bit_backward_fl(ptr, bp_side, mask_side, 0); + + *Tx_ltpf = 0; + /* *Tx_ltpf A/B state forced to zero or kept at zero */ + /* decoder will discard any sofar in phase received phaseA MSB bits */ + } + else if (ltpf_idx[1] == 0) + { + /* no current LTPF activation, + lag transmitted for PLC, or for next frame LTPF activation */ + assert(ltpf_idx[0] != 0); + + /* A "010" 3 bits Hdr transmitted */ + /* B "011" 3 bits Hdr transmitted*/ + + write_uint_backward_fl(ptr, bp_side, mask_side, 1, 2); /* "01"*/ + write_bit_backward_fl(ptr, bp_side, mask_side, tmp); /* phase A or phaseB */ + + if (*Tx_ltpf == 0) + { /* phase A transmission */ + assert(tmp == 0); + assert((ltpf_idx[2] & ~(0x01ff)) == 0); /* only 9 bits info allowed within ltpf_idx[2] */ + tmp = (ltpf_idx[2] >> 5 ); /* shift_out LSBS, send 4 MSBs */ + *Tx_ltpf = (0x200 | ltpf_idx[2]); /* remember full lag, as phaseB sentinel in bit 10, */ + } + else + { /* phase B */ + assert(tmp == 1); + assert(*Tx_ltpf > 511); /*sentinel in b10 should have been set in previous phaseA frame */ + tmp = ((*Tx_ltpf & 0x001f) >> 1); /* B send 4* LSBs, 1 bit truncated */ + *Tx_ltpf = 0; /* clear sentinel in b10 and the old remebered lag value */ + } + write_uint_backward_fl(ptr, bp_side, mask_side, tmp, 4); /* 4 bits lag info Tx, when LTPF is deactivated */ + } + else + { /* LTPF activated */ + /* A "10" 2 bits Hdr */ + /* B "11" 2 bits Hdr */ + assert(ltpf_idx[0] != 0 && ltpf_idx[1] != 0); + + tmp |= 0x02; + write_uint_backward_fl(ptr, bp_side, mask_side, tmp, 2); + + if (*Tx_ltpf == 0) + { + bitsTx = 4; + assert((ltpf_idx[2] & ~(0x01ff)) == 0); /* only 9 bits info allowed within ltpf_idx[2] */ + tmp = (ltpf_idx[2] >> 5); /* shift away 5 LBS, LTPF active, send phaseA 4 MSBs */ + + *Tx_ltpf = 0x0200 | ltpf_idx[2]; /* remember full lag in state *Tx_ltpf, add phaseB Tx state sentinel in bit 10 */ + } + else + { + bitsTx = 5; + tmp = (*Tx_ltpf & 0x001f); /* LTPF active B send 5 LSBs , full regular resolution */ + *Tx_ltpf = 0; /* clear sentinel in b10 and also the old remebered lag value */ + } + + write_uint_backward_fl(ptr, bp_side, mask_side, tmp, bitsTx); /* ltp==1 , ltpf==1, 4(A,MSBs) or 5(b, LSBs) bits */ + } +} +#endif /* NEW_SIGNALLING_SCHEME_1p25 */ +void writeSNSData_fl(LC3_UINT8* ptr, LC3_INT* bp_side, LC3_INT* mask_side, LC3PLUS_FrameDuration frame_dms, LC3_INT32* scf_idx) +#else +void writeSNSData_fl(LC3_UINT8* ptr, LC3_INT* bp_side, LC3_INT* mask_side, LC3_INT32* scf_idx) +#endif +{ +#ifdef CR9_C_ADD_1p25MS_LRSNS + + LC3_INT32 submodeMSB, submodeLSB, tmp, gainMSB, gainLSB; + LC3_INT16 write_legacy_sns_vq_bits; + LC3_INT32 aux_idx; + LC3_INT32 shape_idx; + LC3_INT32 env_shape_idx; + LC3_INT32 gain_idx; + LC3_INT16 n5k; + +#else + LC3_INT32 submodeMSB, submodeLSB, tmp, gainMSB, gainLSB; +#endif + +#if defined(CR9_C_ADD_1p25MS) && !defined( CR9_C_ADD_1p25MS_LRSNS) +UNUSED(frame_dms); +#endif + +#ifdef CR9_C_ADD_1p25MS_LRSNS + write_legacy_sns_vq_bits = 1; + if (frame_dms == LC3PLUS_FRAME_DURATION_1p25MS) /* 9,10,29/30 */ + { + write_legacy_sns_vq_bits = 0; + } + if (write_legacy_sns_vq_bits != 0) + { +#endif + /* SNS-VQ 1st stage */ + write_uint_backward_fl(ptr, bp_side, mask_side, scf_idx[0], 5); + write_uint_backward_fl(ptr, bp_side, mask_side, scf_idx[1], 5); + + /* SNS-VQ 2nd stage side-info (3-4 bits) */ + submodeMSB = scf_idx[2] / 2; + submodeLSB = scf_idx[2] & 1; + write_bit_backward_fl(ptr, bp_side, mask_side, submodeMSB); + gainMSB = scf_idx[3] >> (gainLSBbits[scf_idx[2]]); + gainLSB = scf_idx[3] & 1; + write_uint_backward_fl(ptr, bp_side, mask_side, gainMSB, gainMSBbits[scf_idx[2]]); + write_bit_backward_fl(ptr, bp_side, mask_side, scf_idx[4]); + + /* SNS-VQ 2nd stage MPVQ data (24-25 bits) */ + if (submodeMSB == 0) + { + if (submodeLSB == 0) + { + tmp = scf_idx[6] + 2; + } + else + { + tmp = gainLSB; + } + + tmp = tmp * 2390004 + scf_idx[5]; + write_uint_backward_fl(ptr, bp_side, mask_side, tmp, 25); + } + else + { + tmp = scf_idx[5]; + + if (submodeLSB != 0) + { + tmp = 2 * tmp + gainLSB + 15158272; + } + write_uint_backward_fl(ptr, bp_side, mask_side, tmp, 24); + } +#ifdef CR9_C_ADD_1p25MS_LRSNS + } + if (write_legacy_sns_vq_bits == 0) + { + /* SNS-VQ 1st stage is jointly multiplexed into 9 bits or 10 bits */ + /* input scf_idx[0], has the stage1 index for one of BCA or B* */ + aux_idx = scf_idx[1]; /* aux value: we have the LS, or the s0 sign bit */ + shape_idx = scf_idx[2]; /* st2 shape 0 .. 5 , where [2.3.4.5] are fixed FESS shapes */ + gain_idx = scf_idx[3]; /* idx of 2-3 bits valued gains */ + + if (shape_idx == 0 && scf_idx[0] >= 0) + { /*aux==2 --> split mode st1B (aux==2), + a 2 bit gain + P(5,6)10.96b + P(8,2)7b */ + assert(shape_idx == 0 && gain_idx < 4); + } + if ((shape_idx == 1) && scf_idx[0] >= 0) + { /* regular mode st1B , + a 3 bit gain + P(15,5) */ + assert(shape_idx == 1 && gain_idx >= 0 && gain_idx < 8); + } + if ((shape_idx >= 2) && scf_idx[0] >= 0) + { /* regular mode st1B , + a 3 bit gain + fixenv */ + assert(shape_idx >= 2 && shape_idx <= 5 && gain_idx >= 0 && gain_idx < 8); + } + + /* b0-b8 b9 + segm , idx9b , stop bit, comment use + -----+--------+--------- + A | 510,511| n/a, 2 entries, 9 bit total + ------+--------+-------- + B | 0--169 | 1 , 170 entries, 10 bit total + ------+--------+-------- + C | 170-339| 1 , 170 entries, 10 bit total + ------+--------+--------+------------ + */ + + if (scf_idx[0] >= 510) + { /* stage1A */ + assert(scf_idx[0] < (1 << 9)); + write_uint_backward_fl(ptr, bp_side, mask_side, scf_idx[0], 9); /* currently writes 510 or 511 */ + shape_idx = -9; /* only crude stage 1 A , no more bits to send */ + } + else if ( (scf_idx[0] < 2 * 170) && (shape_idx < 0) ) + { + if (scf_idx[0] < 170) + { + write_uint_backward_fl(ptr, bp_side, mask_side, scf_idx[0] + 0 * 170, 9); /* 1B */ + } + else if (scf_idx[0] < 2 * 170) + { + write_uint_backward_fl(ptr, bp_side, mask_side, (scf_idx[0] - 170) + 1 * 170, 9); /* 1C */ + } + /* write the stop bit value sentinel value "1", so that the demux dec_entropy can stop already at (9+1)=10 bits */ + + write_uint_backward_fl(ptr, bp_side, mask_side, 1, 1); /* dec_entropy will read a 1 "stop" bit */ + + /* pitch_rx and ltpf_rx handled separately */ + } + else if (shape_idx == 0) + { + /* aux info as a part of (9+1) 10 initial bits */ + /* b0-b8 b9 + segm , idx9b , stop bit, comment use + -----+--------+--------- + B* | 0--169 | 0 , --> aux=0, 170, 2b+17b for stage2 'LR_SplitLF', 29 bit total + ------+--------+--------+------- + B* | 170-339| 0 , --> aux=1, 170, 2b+17b for stage2 'LR_SplitLF', 29 bit total + ------+--------+--------+------- + */ + /* 29 bit total LR_splitLF */ + assert(scf_idx[0] >= 0 && scf_idx[0] < 170); /* st1B range */ + assert(aux_idx >= 0 && aux_idx <= 1); /* aux_bit can only be 1 or 0 */ + write_uint_backward_fl(ptr, bp_side, mask_side, scf_idx[0] + aux_idx * 170, 9); /* aux_bit defined by region 0..339 region in decoder */ + write_uint_backward_fl(ptr, bp_side, mask_side, 0, 1); /* "stop" bit. always zero for 'LR_splitLF' */ + + write_uint_backward_fl(ptr, bp_side, mask_side, gain_idx, 2); /* always 2bits == 4 gain levels for the splitLF mode */ + + n5k = 6; + if (scf_idx[5] < 0) { + assert(scf_idx[5] == -8 ); + n5k = 8; + } + + if (n5k == 6) + { /* multiplex remaining 10 + 1+6 bit */ + write_uint_backward_fl(ptr, bp_side, mask_side, scf_idx[4], 10); /* 29b P(5,6)=10.94 in LS+10 bits, */ + write_uint_backward_fl(ptr, bp_side, mask_side, scf_idx[5] & 0x1, 1); /* LS for P(8,2)=7 */ + write_uint_backward_fl(ptr, bp_side, mask_side, scf_idx[5] >> 1, 6); /* mPVQ(8,2) in 6 */ + } + else + { /* LF is PVQ(N=5,K=8), HF is all zero , multiplexed as top section in stage2 10b , + 7b */ + /* scf_idx[4] is in the range [0 ... (SNSLR_NPVQ_L5K8 >>1)[, [0 .. 2945[ , 11.52 bits */ + /* 985 - 1024 = 39 entries where we now use only 32 (5 bits) */ + /* index_to_send = (SNSLR_NPVQ_L5K6 >> 1) + (scf_idx[4] & 0x001f) , range [985 .. 1017[ , i.e. 7 values are not sent:[1018 ... 1023] */ + write_uint_backward_fl(ptr, bp_side, mask_side, (SNSLR_NPVQ_L5K6 >> 1) + (scf_idx[4] & 0x001f), 10); /* 5 lsb's as top in the 10b */ + assert((scf_idx[4] >> 5) < (1 << 7)); + write_uint_backward_fl(ptr, bp_side, mask_side, scf_idx[4] >> 5, 7); /* 7 msb's of mpvq(5,8)*/ + } + } + else if (shape_idx == 1) + { + /* b0-b8 b9 + segm , idx9b , stop bit, comment use + ------+--------+--------+------------ + B* | 340-509| 1 --> aux=1, 170, 3b+17b for stage2 'LR_full', 30 bit total + ------+--------+--------+------- + B* | 340-509| 0 --> aux=0, 170, 3b+17b for stage2 'LR_full', 30 bit total + ------+--------+--------+------- + */ + assert(scf_idx[0] >= 0 && scf_idx[0] < 170); /* st1B* range */ + + write_uint_backward_fl(ptr, bp_side, mask_side, scf_idx[0] + 2 * 170, 9); /* stage1B* signal */ + write_uint_backward_fl(ptr, bp_side, mask_side, aux_idx, 1); /* auxbit transmitted in the stop bit location */ + + write_uint_backward_fl(ptr, bp_side, mask_side, gain_idx, 3); /*30b always 8 gain levels in 3 bits for the full mode */ + /* the next 17 bit index is used to decode submode 1==full or one of submode 2,3,4,5 == fix */ + assert(scf_idx[4] >= 0 && scf_idx[4] < ((SNSLR_NPVQ_L15K5 >> 1))); + write_uint_backward_fl(ptr, bp_side, mask_side, scf_idx[4], 17); /* P(15,5) without the leading sign, 16.6593 bits, written */ + } + else + { /* Fixed shapes 2(ones, env0) and 3(env1) , 4(env2), and later 5(env3) */ + assert(shape_idx >= 2 && shape_idx <= 5); + /* env 0,1,2, : s0(in aux) + shift(2bits)+ 11 signs , section size 8192 + env 3 : s0(in aux) + shift(2bits)+ 9 signs , section size 2048 + */ + env_shape_idx = scf_idx[4]; + assert(env_shape_idx == (shape_idx - 2)); /*scf_idx[4] has the fixed env index*/ + + assert(scf_idx[0] >= 0 && scf_idx[0] < 170); /* st1B* range */ + + write_uint_backward_fl(ptr, bp_side, mask_side, scf_idx[0] + 2 * 170, 9); /* stage1B* signal */ + write_uint_backward_fl(ptr, bp_side, mask_side, aux_idx, 1); /* auxbit transmitted in the stop bit location */ + + write_uint_backward_fl(ptr, bp_side, mask_side, gain_idx, 3); /* for 30bit its is always 3 gain bits */ + + if (shape_idx < 5) /*2,3,4*/ + { + assert(scf_idx[5] >= 0 && scf_idx[5] < (1 << 13)); + assert((SNSLR_NPVQ_L15K5 >> 1) + env_shape_idx * (1 << 13) + scf_idx[5] < (1 << 17)); + /* offset is PVQ(15,5) without leading sign */ + /* int32_t tmp_idx = (SNSLR_NPVQ_L15K5 >> 1) + env_shape_idx * (1 << 13) + scf_idx[5]; */ + write_uint_backward_fl(ptr, bp_side, mask_side, (SNSLR_NPVQ_L15K5 >> 1) + env_shape_idx * (1 << 13) + scf_idx[5], 17); + } + else + { + assert(shape_idx == 5); + assert(env_shape_idx == 3); + assert(scf_idx[5] < (1 << 11)); + assert(((SNSLR_NPVQ_L15K5 >> 1) + 3 * (1 << 13) + scf_idx[5]) < (1 << 17)); + /* offset is (15,5) without leading sign */ + write_uint_backward_fl(ptr, bp_side, mask_side, (SNSLR_NPVQ_L15K5 >> 1) + 3 * (1 << 13) + scf_idx[5], 17); + } + } + } +#endif +} void processEncoderEntropy_fl(LC3_UINT8* bytes, LC3_INT* bp_side, LC3_INT* mask_side, LC3_INT numbytes, LC3_INT bw_cutoff_bits, LC3_INT bw_cutoff_idx, LC3_INT lastnz, LC3_INT N, LC3_INT lsbMode, LC3_INT gg_idx, LC3_INT num_tns_filters, - LC3_INT* tns_order, LC3_INT* ltpf_idx, LC3_INT* scf_idx, LC3_INT fac_ns_idx - , LC3_INT bfi_ext, LC3_INT fs_idx + LC3_INT* tns_order, LC3_INT* ltpf_idx, LC3_INT* scf_idx, LC3_INT fac_ns_idx, + LC3_INT bfi_ext, LC3_INT fs_idx +#ifdef CR9_C_ADD_1p25MS + , LC3PLUS_FrameDuration frame_dms, LC3_INT16* Tx_ltpf +#endif ) { LC3_UINT8* ptr; - LC3_INT i, submodeMSB, submodeLSB, tmp, gainMSB, gainLSB; + LC3_INT i; - LC3_INT16 lastnzTrigger[5] = {63, 127, 127, 255, 255}; +#if defined(CR9_C_ADD_1p25MS) && !defined(CR9_C_ADD_1p25MS_LRSNS) + UNUSED(Tx_ltpf); +#endif *bp_side = numbytes - 1; *mask_side = 1; ptr = bytes; @@ -37,11 +368,11 @@ void processEncoderEntropy_fl(LC3_UINT8* bytes, LC3_INT* bp_side, LC3_INT* mask_ /* Last non zero touple */ if (bfi_ext == 1) { - write_uint_backward_fl(ptr, bp_side, mask_side, lastnzTrigger[fs_idx], ceil(LC3_LOGTWO(N >> 1))); + write_uint_backward_fl(ptr, bp_side, mask_side, lastnzTrigger[fs_idx], getLastNzBits (N)); } else { - write_uint_backward_fl(ptr, bp_side, mask_side, lastnz / 2 - 1, ceil(LC3_LOGTWO(N >> 1))); + write_uint_backward_fl(ptr, bp_side, mask_side, lastnz / 2 - 1, getLastNzBits (N)); } /* LSB mode bit */ @@ -56,46 +387,43 @@ void processEncoderEntropy_fl(LC3_UINT8* bytes, LC3_INT* bp_side, LC3_INT* mask_ } /* LTPF activation flag */ +#ifdef CR9_C_ADD_1p25MS +#ifdef NEW_SIGNALLING_SCHEME_1p25 + if (frame_dms == LC3PLUS_FRAME_DURATION_1p25MS) + { + writeLtpData_fl(ptr, bp_side, mask_side, ltpf_idx, Tx_ltpf); /* LTP and LTPF-active and interleaved lag-idx */ + } + else + { + write_bit_backward_fl(ptr, bp_side, mask_side, ltpf_idx[0]); /* ltp tx bit */ + } +#endif +#else write_bit_backward_fl(ptr, bp_side, mask_side, ltpf_idx[0]); +#endif /* CR9_C_ADD_1p25MS */ - /* SNS-VQ 1st stage */ - write_uint_backward_fl(ptr, bp_side, mask_side, scf_idx[0], 5); - write_uint_backward_fl(ptr, bp_side, mask_side, scf_idx[1], 5); - - /* SNS-VQ 2nd stage side-info (3-4 bits) */ - submodeMSB = scf_idx[2] / 2; - submodeLSB = scf_idx[2] & 1; - write_bit_backward_fl(ptr, bp_side, mask_side, submodeMSB); - gainMSB = scf_idx[3] >> (gainLSBbits[scf_idx[2]]); - gainLSB = scf_idx[3] & 1; - write_uint_backward_fl(ptr, bp_side, mask_side, gainMSB, gainMSBbits[scf_idx[2]]); - write_bit_backward_fl(ptr, bp_side, mask_side, scf_idx[4]); - - /* SNS-VQ 2nd stage MPVQ data (24-25 bits) */ - if (submodeMSB == 0) { - if (submodeLSB == 0) { - tmp = scf_idx[6] + 2; - } else { - tmp = gainLSB; - } - - tmp = tmp * 2390004 + scf_idx[5]; - write_uint_backward_fl(ptr, bp_side, mask_side, tmp, 25); - } else { - tmp = scf_idx[5]; - - if (submodeLSB != 0) { - tmp = 2 * tmp + gainLSB + 15158272; - } - - write_uint_backward_fl(ptr, bp_side, mask_side, tmp, 24); - } + /* SNS data*/ +#ifdef CR9_C_ADD_1p25MS + writeSNSData_fl(ptr, bp_side, mask_side, frame_dms, scf_idx); +#else + writeSNSData_fl(ptr, bp_side, mask_side, scf_idx); +#endif /* LTPF data */ +#ifdef CR9_C_ADD_1p25MS +#ifdef NEW_SIGNALLING_SCHEME_1p25 + if ((frame_dms != LC3PLUS_FRAME_DURATION_1p25MS ) && (ltpf_idx[0] == 1) ) + { + write_uint_backward_fl( ptr, bp_side, mask_side, ltpf_idx[1], 1 ); + write_uint_backward_fl( ptr, bp_side, mask_side, ltpf_idx[2], 9 ); + } +#endif +#else /* CR9_C_ADD_1p25MS */ if (ltpf_idx[0] == 1) { write_uint_backward_fl(ptr, bp_side, mask_side, ltpf_idx[1], 1); write_uint_backward_fl(ptr, bp_side, mask_side, ltpf_idx[2], 9); } +#endif /* CR9_C_ADD_1p25MS */ /* Noise factor */ write_uint_backward_fl(ptr, bp_side, mask_side, fac_ns_idx, 3); diff --git a/lib_lc3plus/enc_lc3_fl.c b/lib_lc3plus/enc_lc3_fl.c index 0729df98dcdff9450f4ab2a418f055eb2d940a31..7d2ec43d326012e73c520c3f6094d53f8df5be17 100644 --- a/lib_lc3plus/enc_lc3_fl.c +++ b/lib_lc3plus/enc_lc3_fl.c @@ -1,16 +1,20 @@ /****************************************************************************** -* ETSI TS 103 634 V1.5.1 * +* ETSI TS 103 634 V1.6.1 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * * Rights Policy, 3rd April 2019. No patent licence is granted by implication, * * estoppel or otherwise. * ******************************************************************************/ - + #include "options.h" #include "wmc_auto.h" #include "functions.h" +#ifdef FIX_BOTH_1p25_ALLOC_SPECTRUM +#include +#endif + static void Enc_LC3PLUS_Channel_fl(LC3PLUS_Enc* encoder, int channel, int32_t* s_in, uint8_t* bytes, int bps , LC3_INT32 bfi_ext ) @@ -21,15 +25,28 @@ static void Enc_LC3PLUS_Channel_fl(LC3PLUS_Enc* encoder, int channel, int32_t* s quantizedGainMin = 0, nbits = 0, nbits2 = 0, lastnz = 0, lsbMode = 0, gainChange = 0, bp_side = 0, mask_side = 0, fac_ns_idx = 0, numResBits = 0, tns_order[2] = {0}, i = 0; LC3_FLOAT normcorr = 0, gain = 0; - LC3_FLOAT d_fl[MAX_LEN] = {0}; LC3_INT q_d[MAX_LEN] = {0}; LC3_INT indexes[TNS_NUMFILTERS_MAX * MAXLAG] = {0}; +#ifdef CR9_C_ADD_1p25MS_LRSNS + LC3_INT16 envelope_bits = -1; + LC3_INT32 pitch_rx = -1; /* pitch_rx status flag */ + LC3_INT32 ltpf_rx = -1; +#endif + h_EncSetup = encoder->channel_setup[channel]; memset(bytes, 0, sizeof(uint8_t) * h_EncSetup->targetBytes); +#ifdef FIX_BOTH_1p25_ALLOC_SPECTRUM + if (encoder->frame_dms == LC3PLUS_FRAME_DURATION_1p25MS) + { + assert(MAX_LEN >= (GG_1p25_MAX_TUPLES - 1) + (encoder->yLen)); + /*make sure that there extra tail coeffs in d_fl for Global gain estimation routine */ + } +#endif + if (bps == 24) { for (i = 0; i < encoder->frame_length; i++) { int32_t tmp = ((int32_t*)s_in)[i]; @@ -62,17 +79,33 @@ static void Enc_LC3PLUS_Channel_fl(LC3PLUS_Enc* encoder, int channel, int32_t* s /* Pitch estimation */ processOlpa_fl(h_EncSetup->s_12k8, h_EncSetup->olpa_mem_s12k8, h_EncSetup->olpa_mem_s6k4, - &h_EncSetup->olpa_mem_pitch, - &h_EncSetup->pitch_flag, + &h_EncSetup->olpa_mem_pitch, + &h_EncSetup->pitch_flag, &T0_out, &normcorr, s_12k8_len, encoder->frame_dms); /* LTPF encoder */ process_ltpf_coder_fl(h_EncSetup->s_12k8, s_12k8_len + 1, h_EncSetup->ltpf_enable, T0_out, normcorr, encoder->frame_dms, h_EncSetup->ltpf_mem_in, encoder->ltpf_mem_in_len, - &h_EncSetup->ltpf_mem_normcorr, &h_EncSetup->ltpf_mem_ltpf_on, +#ifdef CR9_C_ADD_1p25MS + h_EncSetup->ltpf_mem_normcorr, +#else + &h_EncSetup->ltpf_mem_normcorr, +#endif + &h_EncSetup->ltpf_mem_ltpf_on, &h_EncSetup->ltpf_mem_pitch, h_EncSetup->ltpf_param, &h_EncSetup->ltpf_mem_mem_normcorr, <pfBits , encoder->hrmode +#ifdef CR9_C_ADD_1p25MS +#ifdef FIX_TX_RX_STRUCT_STEREO +#ifdef NEW_SIGNALLING_SCHEME_1p25 + ,&h_EncSetup->Tx_ltpf +#else + ,h_EncSetup->Tx_ltpf +#endif +#else + , encoder->Tx_ltpf +#endif +#endif ); /* Attack detector */ @@ -83,8 +116,8 @@ static void Enc_LC3PLUS_Channel_fl(LC3PLUS_Enc* encoder, int channel, int32_t* s /* Per-band energy */ processPerBandEnergy_fl(encoder->bands_number, encoder->bands_offset, encoder->hrmode, encoder->frame_dms, h_EncSetup->ener, d_fl); /* Near Nyquist detector */ - processNearNyquistdetector_fl(&encoder->near_nyquist_flag, encoder->fs_idx, encoder->near_nyquist_index, encoder->bands_number, h_EncSetup->ener - , encoder->frame_dms, encoder->hrmode ); + processNearNyquistdetector_fl(&encoder->near_nyquist_flag, encoder->fs_idx, encoder->near_nyquist_index, encoder->bands_number, h_EncSetup->ener + , encoder->frame_dms, encoder->hrmode ); /* Disable LTPF if nyquist detector triggers or -lfe mode is active*/ if (encoder->near_nyquist_flag != 0 || h_EncSetup->lfe == 1) { @@ -105,25 +138,52 @@ static void Enc_LC3PLUS_Channel_fl(LC3PLUS_Enc* encoder, int channel, int32_t* s } processSnsComputeScf_fl(h_EncSetup->ener, encoder->bands_number, h_EncSetup->scf, - h_EncSetup->attdec_detected, encoder->sns_damping, encoder->attdec_damping, encoder->fs_idx); + h_EncSetup->attdec_detected, encoder->sns_damping, encoder->attdec_damping, encoder->fs_idx +#ifdef CR9_C_ADD_1p25MS + , encoder->frame_dms, &encoder->long_term_norm_corr, normcorr +#endif + ); /* SNS Quantizer */ +#ifdef CR9_C_ADD_1p25MS_LRSNS + if (encoder->frame_dms == LC3PLUS_FRAME_DURATION_1p25MS) + { + /* 9,10, 29,30 bit LRSNS quantizer */ + pitch_rx = h_EncSetup->ltpf_param[0]; /* pitch_rx status flag */ + ltpf_rx = h_EncSetup->ltpf_param[1]; /* ltpf active flag, LTPF lag data information is split over two 1.25 ms frames */ + assert(ltpfBits == 2 || ltpfBits == 6 || ltpfBits == 7); + assert((pitch_rx != 0 && ltpf_rx == 0) || (pitch_rx != 0 && ltpf_rx != 0) || (pitch_rx == 0 && ltpf_rx == 0)); + + envelope_bits = snsQuantScfEncLR(h_EncSetup->scf, h_EncSetup->L_scf_idx, h_EncSetup->scf_q, h_EncSetup->dct2StructSNS, pitch_rx, ltpf_rx); + } + else + { /* legacy 38 bit SNS VQ */ + assert(ltpfBits == 1 || ltpfBits == 11); + process_snsQuantizesScf_Enc(h_EncSetup->scf, h_EncSetup->L_scf_idx, h_EncSetup->scf_q, h_EncSetup->dct2StructSNS); + envelope_bits = 38; + } +#else process_snsQuantizesScf_Enc(h_EncSetup->scf, h_EncSetup->L_scf_idx, h_EncSetup->scf_q, h_EncSetup->dct2StructSNS); +#endif /* SNS Interpolation */ processSnsInterpolateScf_fl(h_EncSetup->scf_q, 1, encoder->bands_number, h_EncSetup->int_scf); /* MDCT shaping */ processMdctShaping_fl(d_fl, h_EncSetup->int_scf, encoder->bands_offset, encoder->bands_number); - + /* Bandwidth controller */ if (encoder->bandwidth < encoder->fs / 2) { process_cutoff_bandwidth(d_fl, encoder->yLen, encoder->bw_ctrl_cutoff_bin); BW_cutoff_idx = MIN(BW_cutoff_idx, encoder->bw_index); } - + /* TNS encoder */ +#ifdef CR9_C_ADD_1p25MS + if (h_EncSetup->lfe == 0 && encoder->frame_dms > LC3PLUS_FRAME_DURATION_1p25MS) +#else if (h_EncSetup->lfe == 0) +#endif { processTnsCoder_fl(d_fl, BW_cutoff_idx, encoder->cutoffBins[BW_cutoff_idx], encoder->fs, encoder->frame_length, encoder->frame_dms, h_EncSetup->total_bits, tns_order, indexes, &tns_numfilters, @@ -134,20 +194,25 @@ static void Enc_LC3PLUS_Channel_fl(LC3PLUS_Enc* encoder, int channel, int32_t* s else { tns_numfilters = 1; +#ifdef CR9_C_ADD_1p25MS + if (encoder->frame_dms == LC3PLUS_FRAME_DURATION_1p25MS) { + tns_numfilters = 0; + } +#endif tns_order[0] = 0; h_EncSetup->tns_bits = tns_numfilters; } /* Global Gain Estimation */ h_EncSetup->targetBitsQuant = h_EncSetup->targetBitsInit - (h_EncSetup->tns_bits + ltpfBits); - if (h_EncSetup->targetBitsQuant < 0 && ltpfBits > 1) +#ifdef CR9_C_ADD_1p25MS_LRSNS + if ( encoder->frame_dms == LC3PLUS_FRAME_DURATION_1p25MS) { - /* Disable LTPF */ - h_EncSetup->ltpf_mem_ltpf_on = 0; - h_EncSetup->ltpf_param[1] = 0; - ltpfBits = 1; - h_EncSetup->targetBitsQuant = h_EncSetup->targetBitsInit - (h_EncSetup->tns_bits + ltpfBits); + h_EncSetup->targetBitsQuant += 38; /* 38 was already subtracted in h_EncSetup->targetBitsInit setup */ + assert(envelope_bits >= 9 && envelope_bits <= 30); + h_EncSetup->targetBitsQuant -= envelope_bits; /* 9,10, 29,30 */ } +#endif processEstimateGlobalGain_fl(d_fl, encoder->yLen, h_EncSetup->targetBitsQuant, &gain, &quantizedGain, &quantizedGainMin, h_EncSetup->quantizedGainOff, &h_EncSetup->targetBitsOff, @@ -173,7 +238,7 @@ static void Enc_LC3PLUS_Channel_fl(LC3PLUS_Enc* encoder, int channel, int32_t* s if (gainChange) { processQuantizeSpec_fl(d_fl, gain, q_d, encoder->yLen, h_EncSetup->total_bits, &nbits, &nbits2, encoder->fs, &lastnz, - h_EncSetup->codingdata, + h_EncSetup->codingdata, &lsbMode, 0, h_EncSetup->targetBitsQuant , encoder->hrmode ); @@ -181,10 +246,9 @@ static void Enc_LC3PLUS_Channel_fl(LC3PLUS_Enc* encoder, int channel, int32_t* s /* Noise factor */ if (h_EncSetup->lfe == 0) - { - processNoiseFactor_fl(&fac_ns_idx, d_fl, q_d, gain, encoder->cutoffBins[BW_cutoff_idx], encoder->frame_dms, - h_EncSetup->targetBytes - ); + { + processNoiseFactor_fl(&fac_ns_idx, d_fl, q_d, gain, encoder->cutoffBins[BW_cutoff_idx], encoder->frame_dms, + h_EncSetup->targetBytes); } else { @@ -192,9 +256,10 @@ static void Enc_LC3PLUS_Channel_fl(LC3PLUS_Enc* encoder, int channel, int32_t* s } /* Residual Coding */ if (lsbMode == 0) { - processResidualCoding_fl(d_fl, q_d, gain, encoder->yLen, h_EncSetup->targetBitsQuant, nbits2, - h_EncSetup->resBits, &numResBits - , encoder->hrmode + processResidualCoding_fl(d_fl, q_d, gain, encoder->yLen, h_EncSetup->targetBitsQuant, nbits2, h_EncSetup->resBits, &numResBits, encoder->hrmode +#ifdef ENABLE_12p5_DMS_MODE + , encoder->frame_dms +#endif ); } else { numResBits = 0; @@ -203,31 +268,38 @@ static void Enc_LC3PLUS_Channel_fl(LC3PLUS_Enc* encoder, int channel, int32_t* s /* Entropy encoding */ processEncoderEntropy_fl(bytes, &bp_side, &mask_side, h_EncSetup->targetBytes, encoder->BW_cutoff_bits, BW_cutoff_idx, lastnz, encoder->yLen, lsbMode, quantizedGain, tns_numfilters, tns_order, - h_EncSetup->ltpf_param, h_EncSetup->L_scf_idx, fac_ns_idx - , bfi_ext, encoder->fs_idx + h_EncSetup->ltpf_param, h_EncSetup->L_scf_idx, fac_ns_idx, + bfi_ext, encoder->fs_idx +#ifdef CR9_C_ADD_1p25MS +#ifdef FIX_TX_RX_STRUCT_STEREO + , encoder->frame_dms, &h_EncSetup->Tx_ltpf +#else + , encoder->frame_dms, &encoder->Tx_ltpf +#endif +#endif ); /* Artithmetic encoding */ processAriEncoder_fl(bytes, bp_side, mask_side, q_d, tns_order, tns_numfilters, indexes, lastnz, - h_EncSetup->codingdata, + h_EncSetup->codingdata, h_EncSetup->resBits, numResBits, lsbMode, h_EncSetup->targetBitsAri, h_EncSetup->enable_lpc_weighting); - + if (encoder->combined_channel_coding == 0 && h_EncSetup->n_pc > 0) { LC3_INT32 xbuf[MAX_LEN] = {0}, nf_seed, tns_idx[M], zero_frame, nbits_residual, residualPresent, b_left, spec_inv_idx; - + memset(h_EncSetup->resBits, 0, sizeof(*(h_EncSetup->resBits)) * MAX_RESBITS_LEN); - + processAriDecoder_fl(bytes, bp_side, mask_side, encoder->yLen, encoder->fs_idx, h_EncSetup->enable_lpc_weighting, tns_numfilters, lsbMode, lastnz, &bfi_ext, tns_order, fac_ns_idx, quantizedGain, h_EncSetup->resBits, xbuf, &nf_seed, tns_idx, &zero_frame, h_EncSetup->targetBytes, &nbits_residual, &residualPresent, encoder->frame_dms, h_EncSetup->n_pc, 0, h_EncSetup->total_bits >> 3, 1, &b_left, &spec_inv_idx, encoder->hrmode); - + processReorderBitstream_fl(bytes, h_EncSetup->n_pccw, h_EncSetup->n_pc, b_left, h_EncSetup->targetBytes); } - + } int Enc_LC3PLUS_fl(LC3PLUS_Enc* encoder, void** input, uint8_t* output, int bps @@ -239,7 +311,7 @@ int Enc_LC3PLUS_fl(LC3PLUS_Enc* encoder, void** input, uint8_t* output, int bps LC3_INT32 totalBytes; LC3_INT32 output_size2, input_size; - + totalBytes = encoder->bitrate * encoder->frame_length / (8 * encoder->fs_in); for (ch = 0; ch < encoder->channels; ch++) @@ -269,6 +341,6 @@ int Enc_LC3PLUS_fl(LC3PLUS_Enc* encoder, void** input, uint8_t* output, int bps fec_encoder(encoder->epmode, encoder->epmr, output, input_size, output_size, encoder->channel_setup[0]->n_pccw); } - + return output_size; } diff --git a/lib_lc3plus/estimate_global_gain.c b/lib_lc3plus/estimate_global_gain.c index c32d85c363016cb28552f0f71f101e81728add55..956402e73360c10ef314846533eebcd462aad269 100644 --- a/lib_lc3plus/estimate_global_gain.c +++ b/lib_lc3plus/estimate_global_gain.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.5.1 * +* ETSI TS 103 634 V1.6.1 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -15,7 +15,7 @@ void processEstimateGlobalGain_fl(LC3_FLOAT x[], LC3_INT lg, LC3_INT nbitsSQ, LC3_FLOAT* gain, LC3_INT* quantizedGain, LC3_INT* quantizedGainMin, LC3_INT quantizedGainOff, LC3_FLOAT* targetBitsOff, LC3_INT* old_targetBits, LC3_INT old_specBits - , LC3_INT hrmode , LC3_INT regBits, LC3_FLOAT frame_ms + , LC3_INT hrmode , LC3_INT regBits, LC3PLUS_FrameDuration frame_ms ) { @@ -23,7 +23,47 @@ void processEstimateGlobalGain_fl(LC3_FLOAT x[], LC3_INT lg, LC3_INT nbitsSQ, LC LC3_FLOAT g_min, x_max, tmp, ind, ind_min, target, ener; LC3_FLOAT en[MAX_LEN / 4]; LC3_FLOAT reg_val = 4.656612873077393e-10; +#ifdef FIX_1p25_GG_EST_TUPLES + LC3_INT tuples[1 + 4] = { -1, GG_1p25_WB_TUPLES, GG_1p25_SSWB_TUPLES, GG_1p25_SWB_TUPLES, GG_1p25_FB_TUPLES }; + LC3_INT bw_idx; +#endif +#ifdef FIX_1p25_GG_EST_TUPLES + LC3_INT32 lg_extra; + if (frame_ms == LC3PLUS_FRAME_DURATION_1p25MS) + { + assert((MAX_LEN) >= ((lg / GG_1p25_MAX_TUPLES) + 1)*GG_1p25_MAX_TUPLES); /* en size check, for 1p25ms max tuple size*/ + } +#else +#ifdef FIX_BOTH_1p25_TEST_NEW_GG_EST2 + assert( (MAX_LEN / 4) >= ((8*4 + 2) / 2)); /* en size check, for 1p25ms SSWB */ +#endif +#endif + +#ifdef FIX_1p25_GG_EST_TUPLES + lg_extra = 0; + bw_idx = MIN((lg / 10) - 1, 4); + + if (frame_ms == LC3PLUS_FRAME_DURATION_1p25MS) + { + lg_extra = tuples[bw_idx] * (( lg + (tuples[bw_idx] - 1)) / tuples[bw_idx]) - lg; + /*x buffer is assert checked in enc_lc3_fl.c() for 1.25ms energy calculation */ + for (i = lg; i < (lg + lg_extra); i++) + { + x[i] = 0.0; /* zero extended tail if a truncated tuple-block exists */ + } + } +#else +#ifdef FIX_FLOAT_ENC_QUANTIZE_1P25MS_512KBPS + LC3_INT32 lg_extra; + + lg_extra = lg - 4 * (lg / 4); + for ( i=lg; i< (lg+lg_extra); i++) + { + x[i] = 0.0; /* zero tail if a truncated quadruple exists */ + } +#endif +#endif if (*old_targetBits < 0) { *targetBitsOff = 0; } else { @@ -39,7 +79,7 @@ void processEstimateGlobalGain_fl(LC3_FLOAT x[], LC3_INT lg, LC3_INT nbitsSQ, LC if (hrmode && regBits > 0) { LC3_FLOAT M0 = 1e-5, M1 = 1e-5, rB_offset; - LC3_FLOAT thresh = 2*frame_ms; + LC3_FLOAT thresh = 2*frame_ms*1.25; for (i = 0; i < lg; i++) { M0 += fabs(x[i]); @@ -55,75 +95,338 @@ void processEstimateGlobalGain_fl(LC3_FLOAT x[], LC3_INT lg, LC3_INT nbitsSQ, LC ind_min = quantizedGainOff; ind = 0; *old_targetBits = -1; - } else { + } + else { if (hrmode == 1) { g_min = x_max / (32768 * 256 - 2); - } else { + } + else { g_min = x_max / (32767 - 0.375); } /* Prevent positive rounding errors from LC3_LOG10 function */ ind_min = 28.0 * LC3_LOGTEN(g_min); ind_min = ceil(ind_min + LC3_FABS(ind_min) * LC3_EPS); - + assert(LC3_POW(10, ind_min / 28.0) >= g_min); assert(ind_min <= (255 + quantizedGainOff)); +#ifdef FIX_FLOAT_ENC_QUANTIZE_1P25MS_512KBPS + N = lg + lg_extra; +#else N = lg; +#endif - j = 0; - for (i = 0; i < N; i = i + 4) { - tmp = x[i] * x[i]; - tmp += x[i + 1] * x[i + 1]; - tmp += x[i + 2] * x[i + 2]; - tmp += x[i + 3] * x[i + 3]; - en[j] = (28.0 / 20.0) * (7 + 10.0 * LC3_LOGTEN(tmp + reg_val)); - j++; - } - target = (28.0 / 20.0) * (1.4) * nbitsSQ; - fac = 256; - offset = 255 + quantizedGainOff; - - for (i = 0; i < 8; i++) +#ifndef FIX_1p25_GG_EST_TUPLES +#ifdef FIX_BOTH_1p25_TEST_NEW_GG_EST2 + /* increase to at least 10 analysis bands for WB, SSWB 1p25ms */ + if (frame_ms == LC3PLUS_FRAME_DURATION_1p25MS && lg <= 30) { - fac = fac >> 1; - offset = offset - fac; - ener = 0; - iszero = 1; + j = 0; + for (i = 0; i < N; i = i + 2) /* steps of 2 for 1.25ms frame lengths */ + { + tmp = x[i] * x[i]; + tmp += x[i + 1] * x[i + 1]; + en[j] = (28.0 / 20.0) * (7 * 0.5 + 10.0 * LC3_LOGTEN(tmp + reg_val)); /* offset of 7 per 4 coeff band now changed to 3.5 per 2 coeff band */ + j++; + } - for (j = N / 4 - 1; j >= 0; j--) { - tmp = en[j] - offset; + target = (28.0 / 20.0) * (1.4) * nbitsSQ; /* global index domain sum over all 10 bands */ - if (tmp < (7.0) * (28.0 / 20.0)) { - if (iszero == 0) { - ener = ener + (2.7) * (28.0 / 20.0); + fac = 256; + offset = 255 + quantizedGainOff; + + for (i = 0; i < 8; i++) + { + fac = fac >> 1; + offset = offset - fac; + ener = 0; + iszero = 1; + + /* we sum up energy from the top, to not add up noisefilled coeffs */ + for (j = N / 2 - 1; j >= 0; j--) + { + tmp = en[j] - offset; + + if (tmp < ((7.0) * (28.0 / 20.0) * 0.5)) + { + if (iszero == 0) + { + ener = ener + ((2.7) * (28.0 / 20.0)* 0.5); /* low cost in coded band zero */ + } } - } else { - if (tmp > (50.0) * (28.0 / 20.0)) { - ener = ener + 2.0 * tmp - (50.0) * (28.0 / 20.0); - } else { - ener = ener + tmp; + else + { + if (tmp > ((50.0) * (28.0 / 20.0)*0.5)) + { + /* high value with many escapes */ + + ener = ener + 2.0 * tmp - (50.0) * (28.0 / 20.0)*0.5; + + } + else + { + ener = ener + (tmp*1.0); + } + iszero = 0; } + } /* loop over over band N/2-1 ... 0 */ - iszero = 0; + if (ener > target && iszero == 0) + { + offset = offset + fac; } - } - if (ener > target && iszero == 0) { - offset = offset + fac; + } /* over 8 splits/iterations to handle all 256 possible shifts */ + + if (offset < ind_min) + { + *old_targetBits = -1; } - } - if (offset < ind_min) { - *old_targetBits = -1; + ind = MAX(ind_min, offset) - quantizedGainOff; } + else +#endif +#endif + + + +#ifdef FIX_1p25_GG_EST_TUPLES + +#if GG_1p25_MAX_TUPLES == 2 + /* the tuple/2-block with halved limits, is here separated from the 4-block loop , + optionally they can be parametrized into one function */ + if (frame_ms == LC3PLUS_FRAME_DURATION_1p25MS) +#else + if (frame_ms == LC3PLUS_FRAME_DURATION_1p25MS && tuples[bw_idx] == 2) +#endif + { + assert(((lg / 2) * 2) == lg); + + j = 0; + for (i = 0; i < N; i = i + 2) + { + tmp = x[i] * x[i]; + tmp += x[i + 1] * x[i + 1]; + en[j] = (28.0 / 20.0) * (7 * 0.5 + 10.0 * LC3_LOGTEN(tmp + reg_val)); /* offset of 7 per 4 coeff band now changed to 3.5 per 2 coeff band */ + j++; + } + + target = (28.0 / 20.0) * (1.4) * nbitsSQ; /* global index domain sum over all bands */ + + fac = 256; + offset = 255 + quantizedGainOff; + + for (i = 0; i < 8; i++) + { + fac = fac >> 1; + offset = offset - fac; + ener = 0; + iszero = 1; + + /* we sum up energy from the top, to not add up noisefilled coeffs */ + for (j = N / 2 - 1; j >= 0; j--) + { + tmp = en[j] - offset; - ind = MAX(ind_min, offset) - quantizedGainOff; + if (tmp < ((7.0) * (28.0 / 20.0) * 0.5)) + { + if (iszero == 0) + { + ener = ener + ((2.7) * (28.0 / 20.0)* 0.5); /* low cost in coded band zero */ + } + } + else + { + if (tmp > ((50.0) * (28.0 / 20.0)*0.5)) + { + /* high value with many escapes */ + + ener = ener + 2.0 * tmp - (50.0) * (28.0 / 20.0)*0.5; + + } + else + { + ener = ener + (tmp*1.0); + } + iszero = 0; + } + } /* loop over over band N/2-1 ... 0 */ + + if (ener > target && iszero == 0) + { + offset = offset + fac; + } + + } /* over 8 splits/iterations to handle all 256 possible shifts */ + + if (offset < ind_min) + { + *old_targetBits = -1; + } + + ind = MAX(ind_min, offset) - quantizedGainOff; + } + else + +#if GG_1p25_MAX_TUPLES == 3 + /* the 3tuple -block with modified limits, is here separated from the quadruple/4-block loop , + optionally they can be parametrized into one function */ + if (frame_ms == LC3PLUS_FRAME_DURATION_1p25MS) +#else + + if (frame_ms == LC3PLUS_FRAME_DURATION_1p25MS && tuples[bw_idx] == 3) +#endif + { /* 3 tuple loop */ + N = 3 * (int)ceil(lg / 3.0); + + assert(lg == 50 || lg == 40 || lg == 30 || lg == 20); + assert(N == (17 * 3) || N == (14 * 3) || N == (10 * 3) || N == (7 * 3)); + + j = 0; + for (i = 0; i < N; i = i + 3) + { + tmp = x[i] * x[i]; + tmp += x[i + 1] * x[i + 1]; + tmp += x[i + 2] * x[i + 2]; + en[j] = (28.0 / 20.0) * (7 * 0.75 + 10.0 * LC3_LOGTEN(tmp + reg_val)); /* offset of 7*0.75 per 3 coeff band n */ + j++; + } + + target = (28.0 / 20.0) * (1.4) * nbitsSQ; /* global index domain sum over all bands */ + + fac = 256; + offset = 255 + quantizedGainOff; + + for (i = 0; i < 8; i++) + { + fac = fac >> 1; + offset = offset - fac; + ener = 0; + iszero = 1; + + /* we sum up energy from the top, to not add up noisefilled coeffs */ + for (j = N / 3 - 1; j >= 0; j--) + { + tmp = en[j] - offset; + + if (tmp < ((7.0) * (28.0 / 20.0) * 0.75)) + { + if (iszero == 0) + { + ener = ener + ((2.7) * (28.0 / 20.0)* 0.75); /* low cost in coded band zero */ + } + } + else + { + if (tmp > ((50.0) * (28.0 / 20.0)*0.75)) + { + /* high value with many escapes */ + + ener = ener + 2.0 * tmp - (50.0) * (28.0 / 20.0)*0.75; + + } + else + { + ener = ener + (tmp*1.0); + } + iszero = 0; + } + } /* loop over over band N/3-1 ... 0 */ + + if (ener > target && iszero == 0) + { + offset = offset + fac; + } + + } /* over 8 splits/iterations to handle all 256 possible shifts */ + + if (offset < ind_min) + { + *old_targetBits = -1; + } + + ind = MAX(ind_min, offset) - quantizedGainOff; + } + else + +#endif /* end 2, 3 tuple loops */ + +#ifdef FIX_1p25_GG_EST_TUPLES + { /* brackets for 4 tuple loop */ + assert((((lg + lg_extra) / 4) * 4) == (lg + lg_extra)); +#endif +#ifndef FIX_1p25_GG_EST_TUPLES +#ifdef FIX_BOTH_1p25_TEST_NEW_GG_EST2 + { +#endif +#endif + + j = 0; + for (i = 0; i < N; i = i + 4) { + tmp = x[i] * x[i]; + tmp += x[i + 1] * x[i + 1]; + tmp += x[i + 2] * x[i + 2]; + tmp += x[i + 3] * x[i + 3]; + en[j] = (28.0 / 20.0) * (7 + 10.0 * LC3_LOGTEN(tmp + reg_val)); + j++; + } + + target = (28.0 / 20.0) * (1.4) * nbitsSQ; + fac = 256; + offset = 255 + quantizedGainOff; + + for (i = 0; i < 8; i++) + { + fac = fac >> 1; + offset = offset - fac; + ener = 0; + iszero = 1; + + for (j = N / 4 - 1; j >= 0; j--) { + tmp = en[j] - offset; + + if (tmp < (7.0) * (28.0 / 20.0)) { + if (iszero == 0) { + ener = ener + (2.7) * (28.0 / 20.0); + } + } + else { + if (tmp > (50.0) * (28.0 / 20.0)) { + ener = ener + 2.0 * tmp - (50.0) * (28.0 / 20.0); + } + else { + ener = ener + tmp; + } + + iszero = 0; + } + } + + if (ener > target && iszero == 0) { + offset = offset + fac; + } + } + + if (offset < ind_min) { + *old_targetBits = -1; + } + + ind = MAX(ind_min, offset) - quantizedGainOff; + } +#ifdef FIX_1p25_GG_EST_TUPLES + } + /* end bracket for 4 tuple loop */ +#else +#ifdef FIX_BOTH_1p25_TEST_NEW_GG_EST2 } +#endif +#endif *quantizedGainMin = ind_min; - *quantizedGain = ind; + *quantizedGain = ind; *gain = LC3_POW(10.0, ((ind + quantizedGainOff) / 28.0)); } diff --git a/lib_lc3plus/fft/cfft.c b/lib_lc3plus/fft/cfft.c index 6ec89eb2992142e6899c773ddd43f8d5a6464907..ae8e5813bbf695fdcda4324e3aba01cde6a8d1e5 100644 --- a/lib_lc3plus/fft/cfft.c +++ b/lib_lc3plus/fft/cfft.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.5.1 * +* ETSI TS 103 634 V1.6.1 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -129,7 +129,9 @@ static void scramble(LC3_FLOAT* re, LC3_FLOAT* im, LC3_INT n, LC3_INT s) for (m = 1, j = 0; m < (n - 1); m++) { { for (k = n >> 1; (!((j ^= k) & k)); k >>= 1) + { ; + } } if (j > m) { diff --git a/lib_lc3plus/fft/cfft.h b/lib_lc3plus/fft/cfft.h index a67d66f057aec75a329745723c6814139e4829dc..5794d48ceae6bc00cbcb9ec5f22370f85e258213 100644 --- a/lib_lc3plus/fft/cfft.h +++ b/lib_lc3plus/fft/cfft.h @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.5.1 * +* ETSI TS 103 634 V1.6.1 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * diff --git a/lib_lc3plus/fft/fft_15_16.h b/lib_lc3plus/fft/fft_15_16.h index ced87c6671b6f664a8fae68bcf8be9b70139da70..a338ae24a68b2087decc95b02c380e861bf18638 100644 --- a/lib_lc3plus/fft/fft_15_16.h +++ b/lib_lc3plus/fft/fft_15_16.h @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.5.1 * +* ETSI TS 103 634 V1.6.1 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * diff --git a/lib_lc3plus/fft/fft_240_480.h b/lib_lc3plus/fft/fft_240_480.h index 40969ba48e88a749e56070a3612410d16cd5701f..92f67cb1e0da062c437fb61adb088630136ed929 100644 --- a/lib_lc3plus/fft/fft_240_480.h +++ b/lib_lc3plus/fft/fft_240_480.h @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.5.1 * +* ETSI TS 103 634 V1.6.1 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * diff --git a/lib_lc3plus/fft/fft_2_9.h b/lib_lc3plus/fft/fft_2_9.h index 0166ad43d75abbbf681199818925b5e150fc01d0..6080729fa0dd25cd27fc1dfd0df5f7ea3f2c4783 100644 --- a/lib_lc3plus/fft/fft_2_9.h +++ b/lib_lc3plus/fft/fft_2_9.h @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.5.1 * +* ETSI TS 103 634 V1.6.1 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * diff --git a/lib_lc3plus/fft/fft_32.h b/lib_lc3plus/fft/fft_32.h index 39cffc69775ca21ee2c2514ceb19932a2a01db2f..8523d4b4527c14d81542a924ed36db5bd1db6e2f 100644 --- a/lib_lc3plus/fft/fft_32.h +++ b/lib_lc3plus/fft/fft_32.h @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.5.1 * +* ETSI TS 103 634 V1.6.1 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * diff --git a/lib_lc3plus/fft/fft_384_768.h b/lib_lc3plus/fft/fft_384_768.h index 404ef79492e9b1879da06eabb893b5d0c5d590ec..805fbdb70cafa548c8f52c83b45563283af27a15 100644 --- a/lib_lc3plus/fft/fft_384_768.h +++ b/lib_lc3plus/fft/fft_384_768.h @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.5.1 * +* ETSI TS 103 634 V1.6.1 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * diff --git a/lib_lc3plus/fft/fft_60_128.h b/lib_lc3plus/fft/fft_60_128.h index e2b17450e7b6d69ce36edf5b14f7416d89e2f698..da8922a709393e1750888ff1f7923d261b77575e 100644 --- a/lib_lc3plus/fft/fft_60_128.h +++ b/lib_lc3plus/fft/fft_60_128.h @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.5.1 * +* ETSI TS 103 634 V1.6.1 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * diff --git a/lib_lc3plus/fft/fft_generic.h b/lib_lc3plus/fft/fft_generic.h index 32030b5ca413f20dccf0b3811d68ce9b9c865d2a..b17860de28cb24fef940ff1fcd0fcdfad8731c69 100644 --- a/lib_lc3plus/fft/fft_generic.h +++ b/lib_lc3plus/fft/fft_generic.h @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.5.1 * +* ETSI TS 103 634 V1.6.1 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * diff --git a/lib_lc3plus/fft/iis_fft.c b/lib_lc3plus/fft/iis_fft.c index 085e60635cf83bdd559028b5a636958cbb8b1a03..9ead28b4afff9bf5491a5598078726a823bfa5f2 100644 --- a/lib_lc3plus/fft/iis_fft.c +++ b/lib_lc3plus/fft/iis_fft.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.5.1 * +* ETSI TS 103 634 V1.6.1 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * diff --git a/lib_lc3plus/fft/iis_fft.h b/lib_lc3plus/fft/iis_fft.h index d68b27d8911a5816fd78cb039f4ca9e063002f48..3be02950fc3bd792d2045eff904bc0cc77dde9c2 100644 --- a/lib_lc3plus/fft/iis_fft.h +++ b/lib_lc3plus/fft/iis_fft.h @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.5.1 * +* ETSI TS 103 634 V1.6.1 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * diff --git a/lib_lc3plus/fft/iisfft.c b/lib_lc3plus/fft/iisfft.c index aaca87db9f07b92d05d33d03b2ae90612afd8ac1..2889c9ae25f07e8ea538f096eed4f388c1020481 100644 --- a/lib_lc3plus/fft/iisfft.c +++ b/lib_lc3plus/fft/iisfft.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.5.1 * +* ETSI TS 103 634 V1.6.1 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * diff --git a/lib_lc3plus/fft/iisfft.h b/lib_lc3plus/fft/iisfft.h index 4fe8f3abc3490ce2327ea8efc48ffab515746906..c8809a3123c7e713944858abb82e65a70afafac4 100644 --- a/lib_lc3plus/fft/iisfft.h +++ b/lib_lc3plus/fft/iisfft.h @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.5.1 * +* ETSI TS 103 634 V1.6.1 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -23,26 +23,14 @@ the restrict keyword only gives a improvelent if more than one pointers are passed to a function. also note that the MSVC __restrict behaves differently from c99, the restrict property is not transferred to aliases. +*/ - alloca is a bit problematic because behavior is not defined in case of stack - overflow. most probably the program will crash. it might be possible to catch - those errors but it depends on compiler support. msvc has a safer _malloca - but gcc has nothing similar. */ #if defined _MSC_VER || defined __INTEL_COMPILER -#include -#define ALLOCA(size) _alloca(size) -#define restrict __restrict -#define inline __inline + #define restrict __restrict + #define inline __inline #elif defined __GNUC__ || defined __clang__ -#define ALLOCA(size) __builtin_alloca(size) -#define restrict __restrict__ -#define inline __inline -#elif defined __TI_COMPILER_VERSION__ -#include -#define ALLOCA(size) (assert(0 && "ALLOCA is not present for your compiler"), NULL) -#warn "no stack allocation for you compiler" -#else -#error "no stack allocation for your compiler" + #define restrict __restrict__ + #define inline __inline #endif diff --git a/lib_lc3plus/functions.h b/lib_lc3plus/functions.h index a2f4857b2ae4a3d10511b5e08249d95a73634be4..d26c1ff04854d22285f50084d60320f007eac734 100644 --- a/lib_lc3plus/functions.h +++ b/lib_lc3plus/functions.h @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.5.1 * +* ETSI TS 103 634 V1.6.1 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -21,6 +21,30 @@ #include "structs.h" #include "util.h" +#ifdef CR9_C_ADD_1p25MS_LRSNS +LC3_INT16 snsQuantScfEncLR(LC3_FLOAT* env, LC3_INT32* L_index, LC3_FLOAT* envq, Dct2 dct2structSNS, LC3_INT32 pitch_rx, LC3_INT32 ltpf_rx); +#endif + +#ifdef CR9_C_ADD_1p25MS_LRSNS +/* needed in both encoder and decoder */ +LC3_FLOAT snslr_remove_st1_DC_fQ11(LC3_FLOAT *scfq, LC3_INT32 len); +void snslr_st1B_vector_dec(LC3_INT16 idx, const LC3_INT16* LFCB, const LC3_INT16 *HFCB, const LC3_INT16* seg_cnt_cum, const LC3_INT16* idx12b_cb, LC3_FLOAT *st1B_vector); +void snslr_st1C_vector_dec(LC3_INT16 idx, const LC3_INT8* CBW8, LC3_INT16 scaleQ4, LC3_INT16 inv_scaleQ15, LC3_INT32 v_len, LC3_INT32 cb_len, LC3_FLOAT *st1C_vector); +#endif + +#ifdef CR9_C_ADD_1p25MS_LRSNS +LC3_INT32 MSEsearchGeneric(LC3_FLOAT *scf, const LC3_FLOAT *sns_CB, LC3_INT32 v_len, LC3_INT32 cb_len, LC3_FLOAT* min_mse); +LC3_INT32 MSEsearchCbBIdxMap(const LC3_FLOAT *scf, const LC3_INT16 *LFCB, const LC3_INT16 *HFCB, const LC3_INT16 *seg_cnt_cum, const LC3_INT16* idx12b_cb, LC3_INT32 v_len, LC3_INT32 cb_len, LC3_FLOAT* min_mse); +LC3_INT32 MSEsearchGenericScaledW8(LC3_FLOAT *scf, const LC3_INT8 *sns_CBW8, LC3_INT16 scaleQ4, LC3_INT16 inv_scaleQ15, LC3_INT32 v_len, LC3_INT32 cb_len, LC3_FLOAT* min_mse); +#endif + +#ifdef CR9_C_ADD_1p25MS_LRSNS +void snsQuantScfDecLR(LC3_INT32* sns_vq_idx, LC3_FLOAT* scf_q, LC3_INT32 pitch_rx, LC3_INT32 ltpf_rx); +#endif + +/* Common */ +LC3_INT16 getLastNzBits (LC3_INT16 N); + /* FFT */ #include "fft/iisfft.h" @@ -48,7 +72,7 @@ void dct4_free(Dct4* dct); void dct4_apply(Dct4* dct, const LC3_FLOAT* input, LC3_FLOAT* output); /* mdct.c */ -void mdct_init(Mdct* mdct, LC3_INT length, LC3_INT frame_dms, LC3_INT fs_idx, LC3_INT hrmode); +void mdct_init(Mdct* mdct, LC3_INT length, LC3PLUS_FrameDuration frame_dms, LC3_INT fs_idx, LC3_INT hrmode); void mdct_free(Mdct* mdct); void mdct_apply(const LC3_FLOAT* input, LC3_FLOAT* output, Mdct* mdct); @@ -58,13 +82,22 @@ LC3_INT paddingDec_fl(LC3_UINT8* bytes, LC3_INT nbbits, LC3_INT L_spec, LC3_INT void processEncoderEntropy_fl(LC3_UINT8* bytes, LC3_INT* bp_side, LC3_INT* mask_side, LC3_INT numbytes, LC3_INT bw_cutoff_bits, LC3_INT bw_cutoff_idx, LC3_INT lastnz, LC3_INT N, LC3_INT lsbMode, LC3_INT gg_idx, LC3_INT num_tns_filters, - LC3_INT* tns_order, LC3_INT* ltpf_idx, LC3_INT* scf_idx, LC3_INT fac_ns_idx - , LC3_INT bfi_ext, LC3_INT fs_idx + LC3_INT* tns_order, LC3_INT* ltpf_idx, LC3_INT* scf_idx, LC3_INT fac_ns_idx, + LC3_INT bfi_ext, LC3_INT fs_idx +#ifdef CR9_C_ADD_1p25MS + , LC3PLUS_FrameDuration frame_dms, LC3_INT16* Tx_ltpf +#endif ); void processDecoderEntropy_fl(LC3_UINT8* bytes, LC3_INT numbytes, LC3_INT* mask_side, LC3_INT* bp_side, LC3_INT N, LC3_INT fs_idx, LC3_INT bw_cutoff_bits, LC3_INT* bfi, LC3_INT* gg_idx, LC3_INT* scf_idx, LC3_INT* fac_ns_idx, LC3_INT* tns_numfilters, LC3_INT* tns_order, LC3_INT* ltpf_idx, LC3_INT* bw_cutoff_idx, LC3_INT* lastnz, - LC3_INT* lsbMode, LC3_INT frame_dms + LC3_INT* lsbMode, LC3PLUS_FrameDuration frame_dms +#ifdef CR9_C_ADD_1p25MS + , LC3_INT32 rx_status[2], LC3_INT16* mem_continuation +#ifdef NEW_SIGNALLING_SCHEME_1p25 + , LC3_INT32 *ltpfinfo_frame_cntr /* set/reset here, but increased outside during/when bfi for the channel */ +#endif +#endif ); void processQuantizeSpec_fl(LC3_FLOAT x[], LC3_FLOAT gain, LC3_INT xq[], LC3_INT nt, LC3_INT totalBits, LC3_INT* nbits, LC3_INT* nbits2, LC3_INT fs, LC3_INT* lastnzout, LC3_INT* codingdata, LC3_INT* lsbMode, LC3_INT mode, LC3_INT target, LC3_INT hrmode); @@ -72,46 +105,50 @@ void processQuantizeSpec_fl(LC3_FLOAT x[], LC3_FLOAT gain, LC3_INT xq[], LC3_INT void processEstimateGlobalGain_fl(LC3_FLOAT x[], LC3_INT lg, LC3_INT nbitsSQ, LC3_FLOAT* gain, LC3_INT* quantizedGain, LC3_INT* quantizedGainMin, LC3_INT quantizedGainOff, LC3_FLOAT* targetBitsOff, LC3_INT* old_targetBits, LC3_INT old_specBits, LC3_INT bq_mode - , LC3_INT regBits, LC3_FLOAT frame_ms + , LC3_INT regBits, LC3PLUS_FrameDuration frame_ms ); void processAriDecoder_fl(LC3_UINT8* bytes, LC3_INT bp_side, LC3_INT mask_side, LC3_INT L_spec, LC3_INT fs_idx, LC3_INT enable_lpc_weighting, LC3_INT tns_numfilters, LC3_INT lsbMode, LC3_INT lastnz, LC3_INT* bfi, LC3_INT* tns_order, LC3_INT fac_ns_idx, LC3_INT gg_idx, uint8_t* resBits, LC3_INT* x, LC3_INT* nf_seed, LC3_INT* tns_idx, LC3_INT* zero_frame, LC3_INT numbytes, - LC3_INT* nbits_residual, LC3_INT* residualPresent, LC3_INT frame_dms, + LC3_INT* nbits_residual, LC3_INT* residualPresent, LC3PLUS_FrameDuration frame_dms, LC3_INT32 n_pc, LC3_INT32 be_bp_left, LC3_INT32 be_bp_right, LC3_INT32 enc, LC3_INT32 *b_left, LC3_INT32 *spec_inv_idx, LC3_INT hrmode ); void processMdctShaping_fl(LC3_FLOAT x[], LC3_FLOAT gains[], const LC3_INT bands_offset[], LC3_INT fdns_npts); -void processResidualCoding_fl(LC3_FLOAT x[], LC3_INT xq[], LC3_FLOAT gain, LC3_INT L_spec, LC3_INT targetBits, LC3_INT nBits, uint8_t * resBits, - LC3_INT* numResBits - , LC3_INT hrmode +void processResidualCoding_fl(LC3_FLOAT x[], LC3_INT xq[], LC3_FLOAT gain, LC3_INT L_spec, LC3_INT targetBits, LC3_INT nBits, uint8_t * resBits, LC3_INT* numResBits, LC3_INT hrmode +#ifdef ENABLE_12p5_DMS_MODE + , LC3PLUS_FrameDuration frame_dms +#endif ); void processResidualDecoding_fl(LC3_INT* bitsRead, LC3_FLOAT x[], LC3_INT L_spec, uint8_t prm[], LC3_INT resQBits , LC3_INT hrmode +#ifdef ENABLE_12p5_DMS_MODE + , LC3PLUS_FrameDuration frame_dms +#endif ); void processAdjustGlobalGain_fl(LC3_INT* gg_idx, LC3_INT gg_idx_min, LC3_INT gg_idx_off, LC3_FLOAT* gain, LC3_INT target, LC3_INT nBits, LC3_INT* gainChange, LC3_INT fs_idx - , LC3_INT16 hrmode, LC3_INT16 frame_dms + , LC3_INT16 hrmode, LC3PLUS_FrameDuration frame_dms ); void processApplyGlobalGain_fl(LC3_FLOAT x[], LC3_INT xLen, LC3_INT global_gain_idx, LC3_INT global_gain_off); -void processNoiseFactor_fl(LC3_INT* fac_ns_idx, LC3_FLOAT x[], LC3_INT xq[], LC3_FLOAT gg, LC3_INT BW_cutoff_idx, LC3_INT frame_dms, +void processNoiseFactor_fl(LC3_INT* fac_ns_idx, LC3_FLOAT x[], LC3_INT xq[], LC3_FLOAT gg, LC3_INT BW_cutoff_idx, LC3PLUS_FrameDuration frame_dms, LC3_INT target_bytes ); -void processNoiseFilling_fl(LC3_FLOAT xq[], LC3_INT nfseed, LC3_INT fac_ns_idx, LC3_INT bw_stopband, LC3_INT frame_dms, LC3_FLOAT fac_ns_pc, LC3_INT spec_inv_idx); +void processNoiseFilling_fl(LC3_FLOAT xq[], LC3_INT nfseed, LC3_INT fac_ns_idx, LC3_INT bw_stopband, LC3PLUS_FrameDuration frame_dms, LC3_FLOAT fac_ns_pc, LC3_INT spec_inv_idx); void processOlpa_fl(LC3_FLOAT* s_12k8, LC3_FLOAT* mem_s12k8, LC3_FLOAT* mem_s6k4, LC3_INT* mem_old_T0, LC3_INT* pitch_flag, - LC3_INT* T0_out,LC3_FLOAT* normcorr_out, LC3_INT len, LC3_INT frame_dms); + LC3_INT* T0_out,LC3_FLOAT* normcorr_out, LC3_INT len, LC3PLUS_FrameDuration frame_dms); -void processTnsCoder_fl(LC3_FLOAT* x, LC3_INT bw_cutoff_idx, LC3_INT bw_fcbin, LC3_INT fs, LC3_INT N, LC3_INT frame_dms, LC3_INT nBits, +void processTnsCoder_fl(LC3_FLOAT* x, LC3_INT bw_cutoff_idx, LC3_INT bw_fcbin, LC3_INT fs, LC3_INT N, LC3PLUS_FrameDuration frame_dms, LC3_INT nBits, LC3_INT* order_out, LC3_INT* rc_idx, LC3_INT* tns_numfilters, LC3_INT* bits_out , LC3_INT16 near_nyquist_flag ); @@ -119,36 +156,58 @@ void levinsonDurbin(LC3_FLOAT* r, LC3_FLOAT* out_lev, LC3_FLOAT* rc_unq, LC3_FLO void processTnsDecoder_fl(LC3_FLOAT* x, LC3_INT* rc_idx, LC3_INT* order, LC3_INT numfilters, LC3_INT bw_fcbin, LC3_INT N, LC3_INT fs); -void processSnsComputeScf_fl(LC3_FLOAT* x, LC3_INT xLen, LC3_FLOAT* gains, LC3_INT smooth, LC3_FLOAT sns_damping, LC3_FLOAT attdec_damping_factor, LC3_INT fs_idx); +void processSnsComputeScf_fl(LC3_FLOAT* x, LC3_INT xLen, LC3_FLOAT* gains, LC3_INT smooth, LC3_FLOAT sns_damping, LC3_FLOAT attdec_damping_factor, LC3_INT fs_idx +#ifdef CR9_C_ADD_1p25MS + , LC3PLUS_FrameDuration frame_dms, LC3_FLOAT *LT_normcorr, LC3_FLOAT normcorr +#endif +); void processSnsInterpolateScf_fl(LC3_FLOAT* gains, LC3_INT encoder_side, LC3_INT bands_number, LC3_FLOAT* gains_LC3_INT); -void processDetectCutoffWarped_fl(LC3_FLOAT* d2, LC3_INT fs_idx, LC3_INT frame_dms, LC3_INT* bw_idx); +void processDetectCutoffWarped_fl(LC3_FLOAT* d2, LC3_INT fs_idx, LC3PLUS_FrameDuration frame_dms, LC3_INT* bw_idx); void processNearNyquistdetector_fl(LC3_INT16* near_nyquist_flag, const LC3_INT fs_idx, const LC3_INT near_nyquist_index, - const LC3_INT bands_number, const LC3_FLOAT* ener - , const LC3_INT16 frame_dms, const LC3_INT16 hrmode ); -void processPerBandEnergy_fl(LC3_INT bands_number, const LC3_INT* acc_coeff_per_band, LC3_INT16 hrmode, LC3_INT16 frame_dms, LC3_FLOAT* d2, LC3_FLOAT* d); + const LC3_INT bands_number, const LC3_FLOAT* ener + , const LC3PLUS_FrameDuration frame_dms, const LC3_INT16 hrmode ); +void processPerBandEnergy_fl(LC3_INT bands_number, const LC3_INT* acc_coeff_per_band, LC3_INT16 hrmode, LC3PLUS_FrameDuration frame_dms, LC3_FLOAT* d2, LC3_FLOAT* d); void ProcessingIMDCT_fl(LC3_FLOAT* y, LC3_INT yLen, const LC3_FLOAT* win, LC3_INT winLen, LC3_INT last_zeros, LC3_FLOAT* mem, LC3_FLOAT* x, Dct4* dct); void ProcessingITDA_WIN_OLA_fl(LC3_FLOAT* x_tda, LC3_INT32 yLen, const LC3_FLOAT* win, LC3_INT32 winLen, LC3_INT32 last_zeros, LC3_FLOAT* mem, LC3_FLOAT* x); -void process_ltpf_coder_fl(LC3_FLOAT* xin, LC3_INT xLen, LC3_INT ltpf_enable, LC3_INT pitch_ol, LC3_FLOAT pitch_ol_norm_corr, LC3_INT frame_dms, +void process_ltpf_coder_fl(LC3_FLOAT* xin, LC3_INT xLen, LC3_INT ltpf_enable, LC3_INT pitch_ol, LC3_FLOAT pitch_ol_norm_corr, LC3PLUS_FrameDuration frame_dms, LC3_FLOAT* mem_old_x, LC3_INT memLen, LC3_FLOAT* mem_norm_corr_past, LC3_INT* mem_on, LC3_FLOAT* mem_pitch, LC3_INT* param, LC3_FLOAT* mem_norm_corr_past_past, LC3_INT* bits - , LC3_INT16 hrmode + , LC3_INT16 hrmode +#ifdef CR9_C_ADD_1p25MS +#ifdef NEW_SIGNALLING_SCHEME_1p25 + ,LC3_INT16* Tx_ltpf +#else + ,LC3_INT16 Tx_ltpf +#endif +#endif ); +#ifdef CR9_C_ADD_1p25MS +void processTdcZeroCleanup(LC3_FLOAT *energies, LC3_INT32 n_bands, LC3PLUS_FrameDuration frame_dms); +#endif + void process_ltpf_decoder_fl(LC3_FLOAT* x, LC3_INT xLen, LC3_FLOAT* y, LC3_INT fs, LC3_FLOAT* mem_old_x, LC3_FLOAT* mem_old_y, LC3_INT* mem_pitch_LC3_INT, LC3_INT* mem_pitch_fr, LC3_FLOAT* mem_gain, LC3_INT* mem_beta_idx, LC3_INT bfi, - LC3_INT* param, LC3_INT* mem_param, LC3_INT conf_beta_idx, LC3_FLOAT conf_beta, LC3_INT concealMethod, LC3_FLOAT damping + LC3_INT* param, LC3_INT* mem_param, LC3_INT conf_beta_idx, LC3_FLOAT *conf_beta, LC3_INT concealMethod, LC3_FLOAT damping , LC3_INT *mem_ltpf_active - , LC3_FLOAT *rel_pitch_change, LC3_INT hrmode, LC3_INT frame_dms + , LC3_FLOAT *rel_pitch_change, LC3_INT hrmode, LC3PLUS_FrameDuration frame_dms +#ifdef CR9_C_ADD_1p25MS + , LC3_INT16* mem_continuation, LC3_INT32* mem_param_prev, LC3_INT16* mem_pitch_int_prev, + LC3_INT16* mem_pitch_fr_prev, LC3_INT32* mem_beta_idx_prev, LC3_FLOAT* mem_gain_prev, + LC3_INT16* pitch_stability_counter, + LC3_FLOAT* gain_step, + LC3_FLOAT conf_beta_max +#endif ); void process_resamp12k8_fl(LC3_FLOAT x[], LC3_INT x_len, LC3_FLOAT mem_in[], LC3_INT mem_in_len, LC3_FLOAT mem_50[], LC3_FLOAT mem_out[], - LC3_INT mem_out_len, LC3_FLOAT y[], LC3_INT* y_len, LC3_INT fs_idx, LC3_INT frame_dms, LC3_INT fs); + LC3_INT mem_out_len, LC3_FLOAT y[], LC3_INT* y_len, LC3_INT fs_idx, LC3PLUS_FrameDuration frame_dms, LC3_INT fs); void write_bit_backward_fl(LC3_UINT8* ptr, LC3_INT* bp_side, LC3_INT* mask_side, LC3_INT bit); void write_uint_backward_fl(LC3_UINT8* ptr, LC3_INT* bp_side, LC3_INT* mask_side, LC3_INT val, LC3_INT numbits); @@ -187,6 +246,10 @@ LC3PLUS_Error Dec_LC3PLUS_fl(LC3PLUS_Dec* decoder, LC3_UINT8* input, int input_b void* balloc(void* base, size_t* base_size, size_t size); +#ifdef FIX_BOTH_1p25_WB_GLOBGAINOFFSET_NONBE +LC3_INT16 calc_GGainOffset_1p25(LC3_INT16 total_bits, LC3_INT16 fs_idx); +#endif + void processPlcMain_fl(LC3_FLOAT *q_d_fl_c, LC3_FLOAT *syntM_fl_c, LC3PLUS_Dec* decoder, DecSetup* h_DecSetup, LC3_INT bfi, PlcAdvSetup *PlcAdvSetup, PlcSetup *PlcSetup, LC3_INT plcMeth, LC3_INT ltpf_pitch_int, LC3_INT ltpf_pitch_fr, LC3_INT tilt, const LC3_INT *bands_offset, LC3_INT bands_number, const LC3_INT *bands_offsetPLC, @@ -213,13 +276,13 @@ LC3_INT32 fec_decoder(LC3_UINT8 *iobuf, LC3_INT16 slot_bytes, LC3_INT32 *data_by LC3_FLOAT array_max_abs(LC3_FLOAT *in, LC3_INT32 len); -void processPcClassify_fl(LC3_INT32 pitch_present, LC3_INT32 frame_dms, LC3_FLOAT *q_d_prev, LC3_FLOAT *q_old_res, LC3_INT32 yLen, LC3_INT32 spec_inv_idx, LC3_FLOAT stab_fac, LC3_INT32 *bfi); +void processPcClassify_fl(LC3_INT32 pitch_present, LC3PLUS_FrameDuration frame_dms, LC3_FLOAT *q_d_prev, LC3_FLOAT *q_old_res, LC3_INT32 yLen, LC3_INT32 spec_inv_idx, LC3_FLOAT stab_fac, LC3_INT32 *bfi); void processPcMain_fl(LC3_INT32 *bfi, LC3PLUS_Dec* decoder, LC3_FLOAT *sqQdec, DecSetup* h_DecSetup, LC3_INT32 pitch_present, LC3_FLOAT stab_fac, LC3_INT32 gg_idx, LC3_INT32 gg_idx_off, LC3_INT32 fac_ns_idx, pcState *statePC, LC3_INT32 spec_inv_idx, LC3_INT32 yLen); void processPcUpdate_fl(LC3_INT32 bfi, LC3_FLOAT *q_res, LC3_INT32 gg_idx, LC3_INT32 gg_idx_off, LC3_INT32 rframe, LC3_INT32 *BW_cutoff_idx_nf, LC3_INT32 *prev_BW_cutoff_idx_nf, LC3_INT32 fac_ns_idx, LC3_FLOAT *prev_fac_ns, LC3_FLOAT *fac, LC3_FLOAT *q_old_res, LC3_FLOAT *prev_gg, LC3_INT32 spec_inv_idx, LC3_INT32 yLen); void processPcApply_fl(LC3_FLOAT *q_res, LC3_FLOAT *q_old_res, LC3_FLOAT *q_d_prev, LC3_INT32 spec_inv_idx, LC3_INT32 yLen, LC3_INT32 gg_idx, LC3_INT32 gg_idx_off, LC3_FLOAT *prev_gg, LC3_FLOAT *fac, LC3_INT32 *pc_nbLostCmpt); void processPlcClassify_fl(LC3_INT plcMeth, LC3_INT *concealMethod, LC3_INT32 *nbLostCmpt, LC3_INT32 bfi, - LC3_FLOAT *xcorr, LC3_INT32 framelength, LC3_INT32 frame_dms, LC3_INT32 pitch_int, + LC3_FLOAT *xcorr, LC3_INT32 framelength, LC3PLUS_FrameDuration frame_dms, LC3_INT32 pitch_int, LC3_INT32 fs, const LC3_INT *band_offsets, LC3_INT32 bands_number, LC3_INT32 tilt, PlcAdvSetup *plcAd , LC3_INT32 hrmode ); @@ -229,20 +292,20 @@ void processPlcDampingScramblingMain_fl(LC3_INT32 *ns_seed, LC3_INT32 *pc_seed, LC3_INT32 ns_nbLostCmpt_pc, LC3_INT32 ns_nbLostCmpt, LC3_FLOAT *stabFac, LC3_FLOAT *cum_fading_slow, LC3_FLOAT *cum_fading_fast, LC3_FLOAT *spec_prev, LC3_FLOAT *spec, LC3_INT32 spec_inv_idx, LC3_INT32 yLen, LC3_INT32 bfi, - LC3_INT32 frame_dms, LC3_INT32 concealMethod, LC3_INT32 pitch_present_bfi1, LC3_INT32 pitch_present_bfi2, + LC3PLUS_FrameDuration frame_dms, LC3_INT32 concealMethod, LC3_INT32 pitch_present_bfi1, LC3_INT32 pitch_present_bfi2, LC3_FLOAT *cum_fflcAtten , LC3_UINT8 plc_fadeout_type ); void processPlcDampingScrambling_fl(LC3_FLOAT *spec, LC3_INT32 yLen, LC3_INT32 nbLostCmpt, LC3_FLOAT *stabFac, LC3_INT32 processDampScramb, - LC3_FLOAT *cum_fflcAtten, LC3_INT32 pitch_present, LC3_INT32 frame_dms, LC3_FLOAT *cum_fading_slow, + LC3_FLOAT *cum_fflcAtten, LC3_INT32 pitch_present, LC3PLUS_FrameDuration frame_dms, LC3_FLOAT *cum_fading_slow, LC3_FLOAT *cum_fading_fast, LC3_INT32 *seed, LC3_INT32 spec_inv_idx , LC3_UINT8 plc_fadeout_type ); void plc_phEcu_F0_refine_first(LC3_INT32 *plocs, LC3_INT32 n_plocs, LC3_FLOAT *f0est, const LC3_INT32 Xabs_len, LC3_FLOAT *f0binPtr, LC3_FLOAT *f0gainPtr, const LC3_INT32 nSubm); -void processTdcLpcEstimation_fl(LC3_FLOAT *r, LC3_INT32 fs_idx, LC3_INT32 len, LC3_FLOAT *A, LC3_INT32 frame_dms); +void processTdcLpcEstimation_fl(LC3_FLOAT *r, LC3_INT32 fs_idx, LC3_INT32 len, LC3_FLOAT *A, LC3PLUS_FrameDuration frame_dms); LC3_FLOAT plc_phEcuSetF0Hz(LC3_INT32 fs, LC3_FLOAT *old_pitchPtr); @@ -314,14 +377,14 @@ void processTdcPreemphasis_fl(LC3_FLOAT *in, LC3_FLOAT *pre_emph_factor, LC3_INT void processTdcTdac_fl(const LC3_FLOAT *synth_inp, const LC3_FLOAT *win, LC3_INT32 frame_length, LC3_INT32 la_zeroes, LC3_FLOAT *ola_mem); void processTdcInverseOdft_fl(LC3_FLOAT *in, LC3_INT32 n_bands, LC3_FLOAT *out, LC3_INT32 lpc_order); -void processTdcApply_fl(const LC3_INT32 pitch_LC3_INT, const LC3_FLOAT *preemphFac, const LC3_FLOAT* A, const LC3_INT32 lpc_order, const LC3_FLOAT* pcmbufHist, const LC3_INT32 max_len_pcm_plc, const LC3_INT32 N, const LC3_INT32 frame_dms, +void processTdcApply_fl(const LC3_INT32 pitch_LC3_INT, const LC3_FLOAT *preemphFac, const LC3_FLOAT* A, const LC3_INT32 lpc_order, const LC3_FLOAT* pcmbufHist, const LC3_INT32 max_len_pcm_plc, const LC3_INT32 N, const LC3PLUS_FrameDuration frame_dms, const LC3_INT32 SampRate, const LC3_INT32 nbLostCmpt, const LC3_INT32 overlap, const LC3_FLOAT *stabFac, LC3_FLOAT harmonicBuf[MAX_PITCH], LC3_FLOAT synthHist[M], LC3_INT32* fract, LC3_INT16* seed, LC3_FLOAT* gain_c, LC3_FLOAT* alpha, LC3_FLOAT* synth - ,LC3_UINT8 plc_fadeout_type + , LC3_UINT8 plc_fadeout_type ,LC3_FLOAT* alpha_type_2_table ); void* balloc(void* base, size_t* base_size, size_t size); -LC3_FLOAT type_2_fadeout(LC3_INT32 nbLostFramesInRow, LC3_INT32 frame_dms); +LC3_FLOAT type_2_fadeout(LC3_INT32 nbLostFramesInRow, LC3PLUS_FrameDuration frame_dms); #endif diff --git a/lib_lc3plus/imdct.c b/lib_lc3plus/imdct.c index b8fc4e7985b2199ce23b6c68c2c503b5ced4ceb0..b99ef8c206f05760d34fa510c1c7207ef8b9a05c 100644 --- a/lib_lc3plus/imdct.c +++ b/lib_lc3plus/imdct.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.5.1 * +* ETSI TS 103 634 V1.6.1 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * diff --git a/lib_lc3plus/lc3plus.c b/lib_lc3plus/lc3plus.c index d208cfb1512bfd8a028e01bca5b8db1bfa0efbfa..594683cd2c7ea80bec716871779ed4e1b0d8b0e1 100644 --- a/lib_lc3plus/lc3plus.c +++ b/lib_lc3plus/lc3plus.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.5.1 * +* ETSI TS 103 634 V1.6.1 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -65,16 +65,21 @@ static int lc3plus_plc_mode_supported(LC3PLUS_PlcMode plc_mode) return 0; } -static int lc3plus_frame_size_supported(float frame_ms) +static int lc3plus_frame_size_supported(LC3PLUS_FrameDuration frame_dms) { - switch ((int)(ceil(frame_ms * 10))) + switch (frame_dms) { - case 25: /* fallthru */ - case 50: /* fallthru */ - case 75: /* fallthru */ - case 100: return 1; +#ifdef CR9_C_ADD_1p25MS + case LC3PLUS_FRAME_DURATION_1p25MS: /* fallthru */ +#endif + case LC3PLUS_FRAME_DURATION_2p5MS: /* fallthru */ + case LC3PLUS_FRAME_DURATION_5MS: /* fallthru */ + case LC3PLUS_FRAME_DURATION_7p5MS: /* fallthru */ + case LC3PLUS_FRAME_DURATION_10MS: + return 1; default: break; } + return 0; } @@ -151,6 +156,9 @@ int lc3plus_enc_get_real_bitrate(const LC3PLUS_Enc *encoder) { int ch = 0, totalBytes = 0; int bitrate; +#ifdef CR9_C_ADD_1p25MS + int frame_ns; +#endif RETURN_IF(encoder == NULL, 0); RETURN_IF(!encoder->lc3_br_set, LC3PLUS_BITRATE_UNSET_ERROR); @@ -158,9 +166,12 @@ int lc3plus_enc_get_real_bitrate(const LC3PLUS_Enc *encoder) { totalBytes += encoder->channel_setup[ch]->targetBytes; } - +#ifdef CR9_C_ADD_1p25MS + frame_ns = (int)(1250L * encoder->frame_dms); + bitrate = (int) ((totalBytes*8L) * 1000000L + (frame_ns - 1) ) / (frame_ns); +#else bitrate = (totalBytes * 80000.0 + encoder->frame_dms - 1) / encoder->frame_dms; - +#endif if (encoder->fs_in == 44100) { int rem = bitrate % 480; @@ -187,13 +198,18 @@ int lc3plus_enc_get_delay(const LC3PLUS_Enc *encoder) return encoder->frame_length - 2 * encoder->la_zeroes; } -LC3PLUS_Error lc3plus_enc_set_frame_dms(LC3PLUS_Enc *encoder, int frame_dms) +LC3PLUS_Error lc3plus_enc_set_frame_dms(LC3PLUS_Enc *encoder, LC3PLUS_FrameDuration frame_dms) { RETURN_IF(encoder == NULL, LC3PLUS_NULL_ERROR); - RETURN_IF(!lc3plus_frame_size_supported(frame_dms / 10.0), LC3PLUS_FRAMEMS_ERROR); + RETURN_IF(!lc3plus_frame_size_supported(frame_dms), LC3PLUS_FRAMEMS_ERROR); RETURN_IF(encoder->lc3_br_set, LC3PLUS_BITRATE_SET_ERROR); +#ifdef CR9_C_ADD_1p25MS + RETURN_IF(encoder->fs == 8000 && frame_dms == LC3PLUS_FRAME_DURATION_1p25MS, LC3PLUS_SAMPLERATE_ERROR); +#endif + encoder->frame_dms = frame_dms; - encoder->frame_ms = frame_dms / 10.0; + encoder->frame_ms = frame_dms; + set_enc_frame_params(encoder); return LC3PLUS_OK; } @@ -279,14 +295,18 @@ int lc3plus_dec_get_scratch_size(const LC3PLUS_Dec *decoder) return 0; } -LC3PLUS_Error lc3plus_dec_set_frame_dms(LC3PLUS_Dec *decoder, int frame_dms) +LC3PLUS_Error lc3plus_dec_set_frame_dms(LC3PLUS_Dec *decoder, LC3PLUS_FrameDuration frame_dms) { RETURN_IF(decoder == NULL, LC3PLUS_NULL_ERROR); - RETURN_IF(!lc3plus_frame_size_supported(frame_dms / 10.0), LC3PLUS_FRAMEMS_ERROR); - RETURN_IF(decoder->plcMeth == 2 && frame_dms != 100, LC3PLUS_FRAMEMS_ERROR); - + RETURN_IF(!lc3plus_frame_size_supported(frame_dms), LC3PLUS_FRAMEMS_ERROR); + RETURN_IF(decoder->plcMeth == 2 && frame_dms != LC3PLUS_FRAME_DURATION_10MS, LC3PLUS_FRAMEMS_ERROR); +#ifdef CR9_C_ADD_1p25MS + RETURN_IF(decoder->fs == 8000 && frame_dms == LC3PLUS_FRAME_DURATION_1p25MS, LC3PLUS_SAMPLERATE_ERROR); +#endif + decoder->frame_dms = frame_dms; - decoder->frame_ms = frame_dms / 10.0; + decoder->frame_ms = frame_dms; + set_dec_frame_params(decoder); return LC3PLUS_OK; } @@ -403,7 +423,7 @@ LC3PLUS_Error lc3plus_enc_set_ep_mode(LC3PLUS_Enc *encoder, LC3PLUS_EpMode epmod error = encoder->lc3_br_set ? update_enc_bitrate(encoder, encoder->bitrate) : LC3PLUS_OK; if (error != LC3PLUS_OK) { - encoder->epmode = oldEpmode; // preserve old epmode in case of failure + encoder->epmode = oldEpmode; /* preserve old epmode in case of failure */ } return error; } diff --git a/lib_lc3plus/lc3plus.h b/lib_lc3plus/lc3plus.h index 063714467da07d43f63d214cbfcec5eb13ff507c..955e22fe78a70c5b79259a176a38621b0fa266d3 100644 --- a/lib_lc3plus/lc3plus.h +++ b/lib_lc3plus/lc3plus.h @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.5.1 * +* ETSI TS 103 634 V1.6.1 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -23,9 +23,11 @@ #ifndef LC3PLUS_H #define LC3PLUS_H -#ifndef _MSC_VER #include "options.h" #include "wmc_auto.h" +#include "defines.h" /* Required for CR9_C_ADD_1p25MS */ + +#ifndef _MSC_VER #include #else typedef unsigned char uint8_t; @@ -37,7 +39,7 @@ typedef __int32 int32_t; #define LC3PLUS_VERSION_INT(major, minor, micro) (((major) << 16) | ((minor) << 8) | (micro)) /*! Version number to ensure header and binary are matching. */ -#define LC3PLUS_VERSION LC3PLUS_VERSION_INT(1, 7, 4) +#define LC3PLUS_VERSION LC3PLUS_VERSION_INT(1, 8, 0) /*! Maximum number of supported channels. The actual binary might support * less, use lc3plus_channels_supported() to check. */ @@ -57,6 +59,20 @@ typedef __int32 int32_t; #define LC3PLUS_DEC_MAX_SIZE 87528 /*! Error codes returned by functions. */ + +typedef enum { + LC3PLUS_FRAME_DURATION_UNDEFINED = 0, /* Invalid */ +#ifdef CR9_C_ADD_1p25MS + LC3PLUS_FRAME_DURATION_1p25MS = 1, /* 1.25 ms */ +#endif + LC3PLUS_FRAME_DURATION_2p5MS = 2, /* 2.5 ms */ + LC3PLUS_FRAME_DURATION_5MS = 4, /* 5 ms */ + LC3PLUS_FRAME_DURATION_7p5MS = 6, /* 7.5 ms */ + LC3PLUS_FRAME_DURATION_10MS = 8, /* 10 ms */ +} LC3PLUS_FrameDuration; + + + typedef enum { LC3PLUS_PLC_ADVANCED = 1 /*!< Enhanced concealment method */ @@ -286,7 +302,7 @@ int lc3plus_enc_get_delay(const LC3PLUS_Enc *encoder); * \param[in] frame_ms Frame length in ms. * \return LC3PLUS_OK on success or appropriate error code. */ -LC3PLUS_Error lc3plus_enc_set_frame_dms(LC3PLUS_Enc *encoder, int frame_ms); +LC3PLUS_Error lc3plus_enc_set_frame_dms(LC3PLUS_Enc *encoder, LC3PLUS_FrameDuration frame_ms); /*! Set encoder Low-frequency effect moded. deactivates LTPF, TNS, NF @@ -448,7 +464,7 @@ int lc3plus_dec_get_delay(const LC3PLUS_Dec* decoder); * \param[in] frame_ms Frame length in ms. * \return LC3PLUS_OK on success or appropriate error code. */ -LC3PLUS_Error lc3plus_dec_set_frame_dms(LC3PLUS_Dec *decoder, int frame_ms); +LC3PLUS_Error lc3plus_dec_set_frame_dms(LC3PLUS_Dec *decoder, LC3PLUS_FrameDuration frame_ms); /*! Free memory allocated within LC3plus decoder struct. diff --git a/lib_lc3plus/lc3plus_fft.c b/lib_lc3plus/lc3plus_fft.c index 75f8787e25ffdfc7b76bd29060db07c467ae17d9..b2c6b66dd092fccd80b195b86ccb89fd496413fe 100644 --- a/lib_lc3plus/lc3plus_fft.c +++ b/lib_lc3plus/lc3plus_fft.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.5.1 * +* ETSI TS 103 634 V1.6.1 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -18,13 +18,13 @@ void fft_init(Fft* fft, int length) { HANDLE_IIS_FFT handle = NULL; IIS_FFT_ERROR error = 0; - assert(length % 2 == 0); fft->length = length; error = LC3_IIS_CFFT_Create(&handle, length, IIS_FFT_FWD); assert(error == IIS_FFT_NO_ERROR); + (void) error; fft->handle = handle; } @@ -38,6 +38,8 @@ void fft_free(Fft* fft) assert(error == IIS_FFT_NO_ERROR); memset(fft, 0, sizeof(*fft)); } + + (void) error; } void real_fft_free(Fft* fft) @@ -50,6 +52,8 @@ void real_fft_free(Fft* fft) assert(error == IIS_FFT_NO_ERROR); memset(fft, 0, sizeof(*fft)); } + + (void) error; } void real_fft_init(Fft* fft, LC3_INT32 length, HANDLE_IIS_FFT *handle) @@ -62,6 +66,8 @@ void real_fft_init(Fft* fft, LC3_INT32 length, HANDLE_IIS_FFT *handle) error = LC3_IIS_RFFT_Create(handle, length, IIS_FFT_FWD); assert(error == IIS_FFT_NO_ERROR); fft->handle = *handle; + + (void) error; } @@ -76,6 +82,8 @@ void real_ifft_init(Fft* fft, LC3_INT32 length, HANDLE_IIS_FFT *handle) assert(error == IIS_FFT_NO_ERROR); fft->handle = *handle; + + (void) error; } void fft_apply(Fft* fft, const Complex* input, Complex* output) @@ -84,6 +92,8 @@ void fft_apply(Fft* fft, const Complex* input, Complex* output) error = LC3_IIS_FFT_Apply_CFFT(fft->handle, input, output); assert(error == IIS_FFT_NO_ERROR); + + (void) error; } @@ -96,5 +106,7 @@ void real_fft_apply(Fft* fft, const LC3_FLOAT* input, LC3_FLOAT* output) error = LC3_IIS_FFT_Apply_RFFT(fft->handle, input, output); assert(error == IIS_FFT_NO_ERROR); + + (void) error; } diff --git a/lib_lc3plus/license.h b/lib_lc3plus/license.h index 0ea743b404b1111761c7522591c007311b731b71..2c5e6ceae41ab717d471c666f76606161294ae28 100644 --- a/lib_lc3plus/license.h +++ b/lib_lc3plus/license.h @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.5.1 * +* ETSI TS 103 634 V1.6.1 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -13,7 +13,7 @@ static const char *const LICENSE = "*******************************************************************************\n" - "* ETSI TS 103 634 V1.5.1 *\n" + "* ETSI TS 103 634 V1.6.1 *\n" "* Low Complexity Communication Codec Plus (LC3plus) *\n" "* Floating Point Software V%i.%i.%iETSI, " __DATE__ " *\n" "* Copyright licence is solely granted through ETSI Intellectual Property *\n" diff --git a/lib_lc3plus/ltpf_coder.c b/lib_lc3plus/ltpf_coder.c index 3457b6ba66bd36e54cc7c98796919e82e898dfb5..c4a8ee57648779e9db0845750dab85d7de1a346d 100644 --- a/lib_lc3plus/ltpf_coder.c +++ b/lib_lc3plus/ltpf_coder.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.5.1 * +* ETSI TS 103 634 V1.6.1 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -32,10 +32,17 @@ LC3_INT searchMaxIndice(LC3_FLOAT* in, LC3_INT len) return max_i; } -void process_ltpf_coder_fl(LC3_FLOAT* xin, LC3_INT xLen, LC3_INT ltpf_enable, LC3_INT pitch_ol, LC3_FLOAT pitch_ol_norm_corr, LC3_INT frame_dms, +void process_ltpf_coder_fl(LC3_FLOAT* xin, LC3_INT xLen, LC3_INT ltpf_enable, LC3_INT pitch_ol, LC3_FLOAT pitch_ol_norm_corr, LC3PLUS_FrameDuration frame_dms, LC3_FLOAT* mem_old_x, LC3_INT memLen, LC3_FLOAT* mem_norm_corr_past, LC3_INT* mem_on, LC3_FLOAT* mem_pitch, LC3_INT* param, LC3_FLOAT* mem_norm_corr_past_past, LC3_INT* bits - , LC3_INT16 hrmode + , LC3_INT16 hrmode +#ifdef CR9_C_ADD_1p25MS +#ifdef NEW_SIGNALLING_SCHEME_1p25 + ,LC3_INT16* Tx_ltpf +#else + ,LC3_INT16 Tx_ltpf +#endif +#endif ) { LC3_FLOAT buffer[LTPF_MEMIN_LEN + LEN_12K8 + 1 + (LEN_12K8 >> 2)], sum = 0, cor_up[(MAX_PITCH_12K8 - MIN_PITCH_12K8) / 2] = {0}, *x; @@ -45,8 +52,13 @@ void process_ltpf_coder_fl(LC3_FLOAT* xin, LC3_INT xLen, LC3_INT ltpf_enable, LC delta_up = 0, delta_down = 0, pitch_index = 0, gain = 0, acflen = 0; LC3_FLOAT cor_tmp, cor_int_tmp, norm_corr = 0, cor[MAX_LEN_NR], cor_int[MAX_LEN_NR], sum1 = 0, sum2 = 0, sum3 = 0; LC3_FLOAT pitch = 0; + LC3_FLOAT normCorrTh = 0.0f; +#if defined (CR9_C_ADD_1p25MS) + LC3_INT16 activation_due_to_past_corr, activation_due_to_stable_pitch, activation; +#endif + + UNUSED(mem_norm_corr_past_past); - LC3_FLOAT normCorrTh = 0.0f; if (hrmode) { normCorrTh = 0.4; } else { @@ -55,11 +67,28 @@ void process_ltpf_coder_fl(LC3_FLOAT* xin, LC3_INT xLen, LC3_INT ltpf_enable, LC /* Signal Buffer */ N = xLen - 1; + acflen = N; + + if (frame_dms == LC3PLUS_FRAME_DURATION_5MS) + { + acflen = 2 * N; + } + if (frame_dms == LC3PLUS_FRAME_DURATION_2p5MS) + { + acflen = 4 * N; + } +#ifdef CR9_C_ADD_1p25MS + if (frame_dms == LC3PLUS_FRAME_DURATION_1p25MS) + { + acflen = 8 * N; + } +#endif + x = &buffer[memLen]; - move_float(buffer, mem_old_x, memLen); - move_float(x, xin, xLen); - move_float(mem_old_x, &buffer[N], xLen + memLen - N); + move_float( buffer, mem_old_x, memLen ); + move_float( x, xin, xLen ); + move_float( mem_old_x, &buffer[N], xLen + memLen - N ); ltpf_active = 0; norm_corr = 0; @@ -74,17 +103,29 @@ void process_ltpf_coder_fl(LC3_FLOAT* xin, LC3_INT xLen, LC3_INT ltpf_enable, LC t0_max = pitch_ol + pitch_search_delta; t0_min = MAX(t0_min, MIN_PITCH_12K8); t0_max = MIN(t0_max, MAX_PITCH_12K8); + + /* Cross-Correlation Bounds */ + t_min = t0_min - pitch_search_L_interpol1; + t_max = t0_max + pitch_search_L_interpol1; + +#ifndef FIX_LTPF_PITCH_MEM_LEN acflen = N; - - if (frame_dms == 25) + + if ( frame_dms == LC3PLUS_FRAME_DURATION_2p5MS ) { acflen = 2 * N; x = x - N; } - - /* Cross-Correlation Bounds */ - t_min = t0_min - pitch_search_L_interpol1; - t_max = t0_max + pitch_search_L_interpol1; +#ifdef CR9_C_ADD_1p25MS + if ( frame_dms == LC3PLUS_FRAME_DURATION_1p25MS ) + { + acflen = 4 * N; + x = x - 80; + } +#endif +#else + x = x - (memLen - LTPF_MEMIN_LEN); +#endif /* Compute norm */ sum1 = sum2 = 0; @@ -92,13 +133,13 @@ void process_ltpf_coder_fl(LC3_FLOAT* xin, LC3_INT xLen, LC3_INT ltpf_enable, LC sum1 += x[j] * x[j]; sum2 += x[j - t_min] * x[j - t_min]; } - + /* Do first iteration outside of loop */ sum = mac_loop(x, &x[-t_min], acflen); sum3 = LC3_SQRT(sum1 * sum2) + 1.00e-05; norm_corr = sum / sum3; - + norm_corr = MAX(0, norm_corr); cor[0] = norm_corr; @@ -111,7 +152,7 @@ void process_ltpf_coder_fl(LC3_FLOAT* xin, LC3_INT xLen, LC3_INT ltpf_enable, LC sum3 = LC3_SQRT(sum1 * sum2) + 1.00e-05; norm_corr = sum / sum3; - + norm_corr = MAX(0, norm_corr); cor[i - t_min] = norm_corr; @@ -129,7 +170,7 @@ void process_ltpf_coder_fl(LC3_FLOAT* xin, LC3_INT xLen, LC3_INT ltpf_enable, LC pitch_fr = 0; } else { j = 0; - + for (i = 0; i < pitch_search_upsamp * (t_max - t_min) + 1; i = i + pitch_search_upsamp) { cor_up[i] = cor[j]; j++; @@ -155,7 +196,7 @@ void process_ltpf_coder_fl(LC3_FLOAT* xin, LC3_INT xLen, LC3_INT ltpf_enable, LC } else { delta_down = pitch_search_upsamp - step; } - + j = 0; for (i = midpoint - delta_down - 1; i <= midpoint + delta_up; i = i + step) { cor[j] = cor_int[i]; @@ -178,7 +219,7 @@ void process_ltpf_coder_fl(LC3_FLOAT* xin, LC3_INT xLen, LC3_INT ltpf_enable, LC (pitch_int < RES2_PITCH_12K8 && pitch_int >= RES4_PITCH_12K8 && (pitch_fr == 0 || pitch_fr == 2)) || (pitch_int < RES4_PITCH_12K8 && pitch_int >= MIN_PITCH_12K8 && (pitch_fr == 0 || pitch_fr == 1 || pitch_fr == 2 || pitch_fr == 3))); - + if (pitch_int < RES4_PITCH_12K8) { pitch_index = pitch_int * 4 + pitch_fr - (MIN_PITCH_12K8 * 4); } else if (pitch_int < RES2_PITCH_12K8) { @@ -189,7 +230,7 @@ void process_ltpf_coder_fl(LC3_FLOAT* xin, LC3_INT xLen, LC3_INT ltpf_enable, LC assert(pitch_index >= 0 && pitch_index < 512); pitch = (LC3_FLOAT) pitch_int + (LC3_FLOAT) pitch_fr / 4.0; - + /* Normalized Correlation */ sum1 = sum2 = sum3 = 0; @@ -203,7 +244,7 @@ void process_ltpf_coder_fl(LC3_FLOAT* xin, LC3_INT xLen, LC3_INT ltpf_enable, LC x[n - pitch_int] * enc_inter_filter[pitch_fr][1] + x[n - pitch_int - 1] * enc_inter_filter[pitch_fr][2] + x[n - pitch_int - 2] * enc_inter_filter[pitch_fr][3]; - + sum1 += cor_tmp * cor_int_tmp; sum2 += cor_tmp * cor_tmp; sum3 += cor_int_tmp * cor_int_tmp; @@ -218,19 +259,42 @@ void process_ltpf_coder_fl(LC3_FLOAT* xin, LC3_INT xLen, LC3_INT ltpf_enable, LC norm_corr = 0; } - if (ltpf_enable == 1) { + if (ltpf_enable == 1) + { /* Decision if ltpf active */ - if ((*mem_on == 0 && (frame_dms == 100 || *mem_norm_corr_past_past > 0.94) && *mem_norm_corr_past > 0.94 && +#if defined (CR9_C_ADD_1p25MS) + activation_due_to_past_corr = mem_norm_corr_past[1] > 0.94; + activation_due_to_stable_pitch = 1; + if (frame_dms == LC3PLUS_FRAME_DURATION_1p25MS) + { + activation_due_to_past_corr &= (mem_norm_corr_past[2] > 0.94); + activation_due_to_past_corr &= (mem_norm_corr_past[3] > 0.94); + activation_due_to_past_corr &= (mem_norm_corr_past[4] > 0.94); + + activation_due_to_stable_pitch = LC3_FMAX(pitch, *mem_pitch) * 0.7f < LC3_FMIN(pitch, *mem_pitch); + } + activation = activation_due_to_past_corr && activation_due_to_stable_pitch; + if ((*mem_on == 0 && (frame_dms == LC3PLUS_FRAME_DURATION_10MS || activation) && mem_norm_corr_past[0] > 0.94 && + norm_corr > 0.94) || + ((*mem_on == 1 && norm_corr > 0.9) && activation_due_to_stable_pitch) || + (*mem_on == 1 && LC3_FABS(pitch - *mem_pitch) < 2 && (norm_corr - mem_norm_corr_past[0]) > -0.1 && + norm_corr > 0.84)) + { + ltpf_active = 1; + } +#else + if ((*mem_on == 0 && (frame_dms == LC3PLUS_FRAME_DURATION_10MS || *mem_norm_corr_past_past > 0.94) && *mem_norm_corr_past > 0.94 && norm_corr > 0.94) || (*mem_on == 1 && norm_corr > 0.9) || (*mem_on == 1 && LC3_FABS(pitch - *mem_pitch) < 2 && (norm_corr - *mem_norm_corr_past) > -0.1 && - norm_corr > 0.84)) { + norm_corr > 0.84)) + { ltpf_active = 1; } +#endif } gain = 4; - } else { gain = 0; norm_corr = pitch_ol_norm_corr; @@ -248,8 +312,60 @@ void process_ltpf_coder_fl(LC3_FLOAT* xin, LC3_INT xLen, LC3_INT ltpf_enable, LC *bits = 1; } - if (frame_dms < 100) { + +#ifdef CR9_C_ADD_1p25MS +#ifdef NEW_SIGNALLING_SCHEME_1p25 + if (frame_dms == LC3PLUS_FRAME_DURATION_1p25MS) + { + LC3_INT32 tmp = MIN(*Tx_ltpf, 1); /* 0 == phaseA, 1==PhaseB ) */ + /* tmp [0 or 1} will points to 2 ltp bits in any case */ + if ( param[0] == 0 && tmp != 0 ) + { + /* pitch correlation dropped from high(ltp active || ltpf_active) to low (no ltp info at all ), + we select to NOT transmit the remaining phaseB lag info for potential use in a next possible PLC frame */ + *Tx_ltpf = 0; /* kill the lag transmission state from the encoder side */ + /* tmp stays 0 or 1 */ + } + + /* 00 (ltp=0, ltpf=0, no Phase 2b), + 010 (ltp=1, ltpf=0, phaseA, 7b), + 011 (ltp=1, ltpf=0, phaseB , 7b), lowered lag res for PLC + 10x (ltp=1, ltpf=1) phaseA 6b) + 11x (ltp=1, ltpf=1) phaseB 7b) + */ + + if (param[0] != 0) + { + if (param[1] == 0) + { /* ltp active, PLC usage case LTPF inactive 01[PhaseA]=010=2, or 01[phaseB]=011=3 + path ltp active and ltpf inactive */ + tmp = (0x02 | tmp); /* phase Info in LSB b0, LTPFactive in b1, tmp becomes 2 or 3 */ + } + else + { /*param[1] != 0*/ /* ltp active, ltpf active */ + assert(param[2] >= 0 && param[2] <= 511); + tmp = (0x04 | (tmp << 1)); /* LTPF in b2, phase b1, always zero in b0 , tmp becomes 4 or 6 */ + /* 100=4 for phase A */ + /* 110=6 for phase B */ + } + } + assert(tmp >= 0 && tmp < 8); + *bits = lrsns_ltp_bits[tmp]; /* one of { 2,2, 7,7 , 6,6, 7,7} */ + /* tmp=idx is 0,1 2,3 4,5, 6,7 */ + + assert(*bits == 2 || *bits == 6 || *bits == 7); + } +#endif +#else + assert(*bits == 1 || *bits == 11); +#endif + + if (frame_dms < LC3PLUS_FRAME_DURATION_10MS) { +#if defined (CR9_C_ADD_1p25MS) + move_float(&mem_norm_corr_past[1], &mem_norm_corr_past[0], LEN_MEM_NORMCORR-1); +#else *mem_norm_corr_past_past = *mem_norm_corr_past; +#endif } *mem_norm_corr_past = norm_corr; diff --git a/lib_lc3plus/ltpf_decoder.c b/lib_lc3plus/ltpf_decoder.c index 3ccd452bcb2f367c69ea1e9de832243cc309a81e..48aa9a2d706044eadff0ad1f69d38c3d44319c8f 100644 --- a/lib_lc3plus/ltpf_decoder.c +++ b/lib_lc3plus/ltpf_decoder.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.5.1 * +* ETSI TS 103 634 V1.6.1 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -11,30 +11,130 @@ #include "wmc_auto.h" #include "functions.h" +#ifdef CR9_C_ADD_1p25MS +static LC3_INT16 get_continuation (LC3_INT32 fading_case, LC3PLUS_FrameDuration frame_dms, LC3_INT32 pos, LC3_INT32 total) +{ + LC3_INT16 retval; + + if ( frame_dms != LC3PLUS_FRAME_DURATION_1p25MS ) + { + retval = 0; + } + else + { + if ( pos == total ) + { + retval = 0; + } + else + { + retval = fading_case; + } + } + + return retval; +} +#endif + +#ifdef LTPF_ADAPTIVE_GAIN_WITH_NORM_CORR +#ifdef LTPF_PRINT_PARAMS +static bool compare_normalized_corrs(LC3_FLOAT const *sig, LC3_INT32 len, LC3_INT32 pitch_int, LC3_INT32 mem_pitch_int, LC3_FLOAT *corr, LC3_FLOAT *corr_prev) +#else +static bool compare_normalized_corrs(LC3_FLOAT const *sig, LC3_INT32 len, LC3_INT32 pitch_int, LC3_INT32 mem_pitch_int) +#endif +{ + LC3_FLOAT norm_0, norm_t, norm_t_prev, xcorr, xcorr_prev; + norm_0 = norm_t = norm_t_prev = xcorr = xcorr_prev = 0; + + for ( int i=0; i < len; i++ ) + { + norm_0 += sig[i] * sig[i]; + norm_t += sig[i - pitch_int] * sig[i - pitch_int]; + xcorr += sig[i] * sig[i - pitch_int]; + + norm_t_prev += sig[i - mem_pitch_int] * sig[i - mem_pitch_int]; + xcorr_prev += sig[i] * sig[i - mem_pitch_int]; + } + + xcorr = MIN( 1.f, MAX( 0.f, xcorr / ( LC3_SQRT( norm_0 * norm_t ) + 1.00e-05f ) ) ); + xcorr_prev = MIN( 1.f, MAX( 0.f, xcorr_prev / ( LC3_SQRT( norm_0 * norm_t_prev ) + 1.00e-05f ) ) ); + +#ifdef LTPF_PRINT_PARAMS + *corr = xcorr; + *corr_prev = xcorr_prev; +#endif + + if ( xcorr_prev - xcorr > 5e-4 ) + { + return true; + } + + return false; +} +#endif + void process_ltpf_decoder_fl(LC3_FLOAT* x, LC3_INT xLen, LC3_FLOAT* y, LC3_INT fs, LC3_FLOAT* mem_old_x, LC3_FLOAT* mem_old_y, LC3_INT* mem_pitch_int, LC3_INT* mem_pitch_fr, LC3_FLOAT* mem_gain, LC3_INT* mem_beta_idx, LC3_INT bfi, - LC3_INT* param, LC3_INT* mem_param, LC3_INT conf_beta_idx, LC3_FLOAT conf_beta, LC3_INT concealMethod, - LC3_FLOAT damping - , LC3_INT *mem_ltpf_active - , LC3_FLOAT *rel_pitch_change, LC3_INT hrmode, LC3_INT frame_dms -) + LC3_INT* param, LC3_INT* mem_param, LC3_INT conf_beta_idx, LC3_FLOAT *conf_beta, LC3_INT concealMethod, LC3_FLOAT damping + , LC3_INT *mem_ltpf_active + , LC3_FLOAT *rel_pitch_change, LC3_INT hrmode, LC3PLUS_FrameDuration frame_dms +#ifdef CR9_C_ADD_1p25MS + , LC3_INT16* mem_continuation, LC3_INT32* mem_param_prev, LC3_INT16* mem_pitch_int_prev, + LC3_INT16* mem_pitch_fr_prev, LC3_INT32* mem_beta_idx_prev, LC3_FLOAT* mem_gain_prev, + LC3_INT16* pitch_stability_counter, + LC3_FLOAT* gain_step, + LC3_FLOAT conf_beta_max +#endif + ) { LC3_INT i, j, n, N, L_past_x, N4, N34, pitch_int, pitch_fr, p1, p2, L_past_y, inter_len, tilt_len = 0, - tilt_len_r, inter_len_r, old_x_len, old_y_len; + tilt_len_r, inter_len_r, old_x_len, old_y_len, fading_case, N4_D, N4_S; LC3_FLOAT conf_alpha, gain, a1[12], a2[12], b1[11], b2[11], buf_x[4 * MAX_LEN], buf_y[4 * MAX_LEN], buf_z[4 * MAX_LEN], pitch, sum1, sum2; LC3_FLOAT *p_x, *p_y, *p_y2, *p_x_init, *p_y_init, *p_a1, *p_b1, *p_a2, *p_b2, fade_fac, current_fade_fac_up, current_fade_fac_down; - LC3_FLOAT pitch_fl_c_old, pitch_delta; + LC3_FLOAT pitch_delta; const LC3_FLOAT *inter_filter[4], *tilt_filter[4]; +#ifdef LTPF_ADAPTIVE_GAIN + bool ltpf_active = false; + bool ltpf_active_prev = false; + bool pitch_changed = false; + bool pitch_was_stable = false; +#endif +#ifdef LTPF_ADAPTIVE_GAIN + LC3_INT32 original_param[3]; + LC3_INT32 original_pitch_int, original_pitch_fr; + LC3_FLOAT original_gain; + +#ifdef LTPF_PRINT_PARAMS + static int local_frame = 0; +#ifdef LTPF_ADAPTIVE_GAIN_WITH_NORM_CORR + LC3_FLOAT xcorr, xcorr_prev; +#endif +#endif +#endif + +#ifdef FIX_LTPF_DEC_FLFX_MISMATCH + UNUSED(mem_ltpf_active); + fading_case = 0; +#endif + tilt_len = 0; + conf_alpha = 0.85; + p1 = 0; + p2 = 0; + #ifdef WMOPS push_wmops("process_ltpf_decoder_fl"); #endif - pitch_fl_c_old = (LC3_FLOAT) *mem_pitch_int + (LC3_FLOAT)*mem_pitch_fr / 4.0; - conf_alpha = 0.85; - + +#ifdef FIX_LTPF_1p25 + if (param[2] == -1) { + param[1] = 0; + param[0] = 0; + } +#endif if (bfi != 1) { /* Decode pitch */ if (param[0] == 1) { @@ -55,7 +155,7 @@ void process_ltpf_decoder_fl(LC3_FLOAT* x, LC3_INT xLen, LC3_FLOAT* y, LC3_INT f pitch = ((LC3_FLOAT)pitch_int + (LC3_FLOAT)pitch_fr / 4.0) * (LC3_FLOAT)fs / 12800.0; pitch = round(pitch * 4.0) / 4.0; pitch_int = floor(pitch); - pitch_fr = (LC3_INT)((pitch - (LC3_FLOAT)pitch_int) * 4.0); + pitch_fr = (LC3_INT)((pitch - (LC3_FLOAT)pitch_int) * 4.0); } else { pitch_int = 0; pitch_fr = 0; @@ -67,12 +167,16 @@ void process_ltpf_decoder_fl(LC3_FLOAT* x, LC3_INT xLen, LC3_FLOAT* y, LC3_INT f } if (param[1] == 1) { - gain = conf_beta; + gain = *conf_beta; } else { gain = 0; } } - else if (concealMethod > 0) { + else if ((concealMethod > 0) +#ifdef CR9_C_ADD_1p25MS + && (*mem_continuation == 0) +#endif + ) { if (conf_beta_idx < 0) { if (mem_param[1] && *mem_beta_idx >= 0) { @@ -92,9 +196,40 @@ void process_ltpf_decoder_fl(LC3_FLOAT* x, LC3_INT xLen, LC3_FLOAT* y, LC3_INT f pitch_fr = *mem_pitch_fr; gain = (LC3_FLOAT) *mem_gain * damping; } + +#ifdef CR9_C_ADD_1p25MS + if (*mem_continuation) + { +#ifdef LTPF_ADAPTIVE_GAIN + /* Save original LTPF parameters */ + move_int(original_param, param, 3); + original_pitch_int = pitch_int; + original_pitch_fr = pitch_fr; + original_gain = gain; +#endif - if ((conf_beta <= 0) && (*mem_ltpf_active == 0)) - { + fading_case = *mem_continuation; + move_int(param, mem_param, 3); + pitch_int = *mem_pitch_int; + pitch_fr = *mem_pitch_fr; + gain = *mem_gain; +#ifdef FIX_LTPF_1p25 + conf_beta_idx = *mem_beta_idx; +#endif + + move_int(mem_param, mem_param_prev, 3); + *mem_pitch_int = *mem_pitch_int_prev; + *mem_pitch_fr = *mem_pitch_fr_prev; + *mem_gain = *mem_gain_prev; +#ifdef FIX_LTPF_1p25 + *mem_beta_idx = *mem_beta_idx_prev; +#endif + + } +#endif + + if ( fs <= 48000 ) + { if (fs == 8000 || fs == 16000) { tilt_len = 4 - 2; } @@ -108,16 +243,196 @@ void process_ltpf_decoder_fl(LC3_FLOAT* x, LC3_INT xLen, LC3_FLOAT* y, LC3_INT f tilt_len = 12 - 2; } + inter_len = MAX(fs, 16000) / 8000; + + /* Init buffers */ + N = xLen; + old_x_len = tilt_len; + old_y_len = ceil(228.0 * fs / 12800.0) + inter_len; + L_past_x = old_x_len; + + move_float(buf_x, mem_old_x, old_x_len); + move_float(&buf_x[old_x_len], x, xLen); + L_past_y = old_y_len; + move_float(buf_y, mem_old_y, old_y_len); + move_float(&buf_y[old_y_len], x, xLen); + } +#ifdef LTPF_ADAPTIVE_GAIN + if ( frame_dms == LC3PLUS_FRAME_DURATION_1p25MS ) + { + conf_alpha = 0.98; + + /* Control variables */ + ltpf_active = param[1]; + ltpf_active_prev = mem_param[1]; + pitch_changed = !( ( pitch_int == *mem_pitch_int ) && ( pitch_fr == *mem_pitch_fr ) ); + pitch_was_stable = ( ( *pitch_stability_counter >= LTPF_PITCH_STABILITY_THRESHOLD ) ); + +#ifdef CR9_C_ADD_1p25MS + if ( *mem_continuation == 0 ) + { +#endif +#ifdef LTPF_ADAPTIVE_GAIN_WITH_NORM_CORR + if ( !pitch_was_stable && pitch_changed && pitch_int != 0 && *mem_pitch_int != 0 ) + { +#ifdef LTPF_PRINT_PARAMS + pitch_was_stable = compare_normalized_corrs(buf_y + L_past_y, xLen, pitch_int, *mem_pitch_int, &xcorr, &xcorr_prev); +#else + pitch_was_stable = compare_normalized_corrs(buf_y + L_past_y, xLen, pitch_int, *mem_pitch_int); +#endif + } +#endif + + if ( ltpf_active && !pitch_changed ) + { + /* increment gain and increment pitch stability counter */ + gain = pitch_was_stable ? MIN( conf_beta_max, MAX( gain, *mem_gain ) + *gain_step ) : MAX( gain, *mem_gain ); + ( *pitch_stability_counter )++; + } + else if ( ltpf_active && pitch_changed && !pitch_was_stable ) + { + /* decrement gain and reset pitch stability counter */ + gain = ( *mem_gain > gain ) ? MAX( gain, *mem_gain - ( conf_beta_max / LTPF_ADAPTIVE_GAIN_RATE ) ) : gain; + *pitch_stability_counter = 0; + } + else if ( !ltpf_active && !pitch_was_stable && ltpf_active_prev && pitch_changed ) + { + /* decrement gain, use previous pitch and reset pitch stability counter */ + gain = *mem_gain - *gain_step; + +#ifdef FIX_LTPF_1p25 + if (*conf_beta > 0 && (gain - *conf_beta) > -(20.f/(1<<15))) +#else + if ( (gain - *conf_beta) > -(20.f/(1<<15))) +#endif + { + move_int( param, mem_param, 3 ); + pitch_int = *mem_pitch_int; + pitch_fr = *mem_pitch_fr; + } + else + { + gain = 0.f; + } + *pitch_stability_counter = 0; + } + else if ( ( ltpf_active && pitch_changed && pitch_was_stable ) || ( !ltpf_active && pitch_was_stable ) || ( !ltpf_active && !pitch_was_stable && ltpf_active_prev && !pitch_changed ) ) + { + /* use previous pitch and gain and reset pitch stability counter */ + move_int( param, mem_param, 3 ); + pitch_int = *mem_pitch_int; + pitch_fr = *mem_pitch_fr; + gain = *mem_gain; + *pitch_stability_counter = 0; + } +#ifdef CR9_C_ADD_1p25MS /* This is added here for the future when adaptive gain will be enabled for other frame sizes. */ + } + else if ( *mem_continuation != 0 && original_param[1] == 1 +#ifdef FIX_PLC_CONFORM_ISSUES + && bfi == 0 +#endif + ) + { + /* Code enters this block if LTPF is reenabled when adaptive gain is being applied. */ + /* In this case, use new LTPF parameters but with a smaller gain than in the prev frame.*/ + fading_case = 0; + *mem_continuation = 0; + + move_int( mem_param_prev, mem_param, 3 ); + *mem_pitch_int_prev = *mem_pitch_int; + *mem_pitch_fr_prev = *mem_pitch_fr; + *mem_gain_prev = *mem_gain; + + move_int( mem_param, param, 3 ); + *mem_pitch_int = pitch_int; + *mem_pitch_fr = pitch_fr; + *mem_gain = gain; + + move_int( param, original_param, 3 ); + pitch_int = original_pitch_int; + pitch_fr = original_pitch_fr; + gain = original_gain; + + /* if prev gain > curr gain, then decrease gain slowly. */ + gain = ( *mem_gain > gain) ? MAX( gain, *mem_gain - ( conf_beta_max / LTPF_ADAPTIVE_GAIN_RATE ) ) : gain; + + *pitch_stability_counter = 0; + } +#endif + } +#endif /* LTPF_ADAPTIVE_GAIN */ + if ( mem_param[1] && *mem_beta_idx < 0 ) + { + mem_param[1] = 0; + } + + if ( param[1] && conf_beta_idx < 0 ) + { + param[1] = 0; + } + + if ( fs <= 48000 ) + { +#ifdef FIX_LTPF_MEM_CONTINUATION +#ifdef FIX_LTPF_DEC_FLFX_MISMATCH + if ( (( param[1] == 0 ) && ( mem_param[1] == 0 )) || fading_case == 1 ) +#else + if ( (( *conf_beta <= 0 ) && ( *mem_ltpf_active == 0 )) || fading_case == 1 ) +#endif +#else + if ( ( *conf_beta <= 0 ) && ( *mem_ltpf_active == 0 ) ) +#endif + { +#ifndef LTPF_ADAPTIVE_GAIN_WITH_NORM_CORR + if ( fs == 8000 || fs == 16000 ) + { + tilt_len = 4 - 2; + } + else if ( fs == 24000 ) + { + tilt_len = 6 - 2; + } + else if ( fs == 32000 ) + { + tilt_len = 8 - 2; + } + else if ( fs == 44100 || fs == 48000 ) + { + tilt_len = 12 - 2; + } N = xLen; old_x_len = tilt_len; inter_len = MAX(fs, 16000) / 8000; old_y_len = ceilf((LC3_FLOAT)228.0 * fs / 12800.0) + inter_len; /* 228.0 needed to make use of ceil */ +#endif + +#ifdef FIX_LTPF_MEM_CONTINUATION +#ifdef CR9_C_ADD_1p25MS + fading_case = 1; + N4 = fs * 0.0025; + N4_S = 0; + N4_D = N4; + if ( frame_dms == LC3PLUS_FRAME_DURATION_1p25MS ) + { + N4_D = 2 * N4; + if ( *mem_continuation ) + { + N4_S = N4; + } + } + *mem_continuation = get_continuation( fading_case, frame_dms, ( N4 + N4_S ), N4_D ); +#endif +#endif move_float(mem_old_y, &mem_old_y[N], (old_y_len - N)); move_float(&mem_old_y[old_y_len - N], x, N); move_float(mem_old_x, &x[N - old_x_len], old_x_len); +#ifdef FIX_LTPF_DEC_FLFX_MISMATCH + mem_param[1] = 0; +#else *mem_ltpf_active = 0; +#endif } else { @@ -133,8 +448,10 @@ void process_ltpf_decoder_fl(LC3_FLOAT* x, LC3_INT xLen, LC3_FLOAT* y, LC3_INT f tilt_filter[1] = conf_tilt_filter_16[1]; tilt_filter[2] = conf_tilt_filter_16[2]; tilt_filter[3] = conf_tilt_filter_16[3]; - tilt_len = 4 - 2; - tilt_len_r = 3; +#ifndef LTPF_ADAPTIVE_GAIN_WITH_NORM_CORR + tilt_len = 4 - 2; +#endif + tilt_len_r = 3; } else if (fs == 24000) { inter_filter[0] = conf_inter_filter_24[0]; inter_filter[1] = conf_inter_filter_24[1]; @@ -146,8 +463,10 @@ void process_ltpf_decoder_fl(LC3_FLOAT* x, LC3_INT xLen, LC3_FLOAT* y, LC3_INT f tilt_filter[1] = conf_tilt_filter_24[1]; tilt_filter[2] = conf_tilt_filter_24[2]; tilt_filter[3] = conf_tilt_filter_24[3]; - tilt_len = 6 - 2; - tilt_len_r = 5; +#ifndef LTPF_ADAPTIVE_GAIN_WITH_NORM_CORR + tilt_len = 6 - 2; +#endif + tilt_len_r = 5; } else if (fs == 32000) { inter_filter[0] = conf_inter_filter_32[0]; inter_filter[1] = conf_inter_filter_32[1]; @@ -159,8 +478,10 @@ void process_ltpf_decoder_fl(LC3_FLOAT* x, LC3_INT xLen, LC3_FLOAT* y, LC3_INT f tilt_filter[1] = conf_tilt_filter_32[1]; tilt_filter[2] = conf_tilt_filter_32[2]; tilt_filter[3] = conf_tilt_filter_32[3]; - tilt_len = 8 - 2; - tilt_len_r = 7; +#ifndef LTPF_ADAPTIVE_GAIN_WITH_NORM_CORR + tilt_len = 8 - 2; +#endif + tilt_len_r = 7; } else if (fs == 44100 || fs == 48000) { inter_filter[0] = conf_inter_filter_48[0]; inter_filter[1] = conf_inter_filter_48[1]; @@ -172,11 +493,14 @@ void process_ltpf_decoder_fl(LC3_FLOAT* x, LC3_INT xLen, LC3_FLOAT* y, LC3_INT f tilt_filter[1] = conf_tilt_filter_48[1]; tilt_filter[2] = conf_tilt_filter_48[2]; tilt_filter[3] = conf_tilt_filter_48[3]; - tilt_len = 12 - 2; - tilt_len_r = 11; +#ifndef LTPF_ADAPTIVE_GAIN_WITH_NORM_CORR + tilt_len = 12 - 2; +#endif + tilt_len_r = 11; } - inter_len = MAX(fs, 16000) / 8000; +#ifndef LTPF_ADAPTIVE_GAIN_WITH_NORM_CORR + inter_len = MAX( fs, 16000 ) / 8000; /* Init buffers */ N = xLen; @@ -187,9 +511,13 @@ void process_ltpf_decoder_fl(LC3_FLOAT* x, LC3_INT xLen, LC3_FLOAT* y, LC3_INT f move_float(&buf_x[old_x_len], x, xLen); L_past_y = old_y_len; move_float(buf_y, mem_old_y, old_y_len); - zero_float(&buf_y[old_y_len], xLen); + zero_float( &buf_y[old_y_len], xLen ); +#endif N4 = fs * 0.0025; +#ifdef CR9_C_ADD_1p25MS + N4 = MIN(N4, xLen); +#endif N34 = N - N4; /* Init filter parameters */ @@ -198,6 +526,7 @@ void process_ltpf_decoder_fl(LC3_FLOAT* x, LC3_INT xLen, LC3_FLOAT* y, LC3_INT f a1[i] = *mem_gain * inter_filter[*mem_pitch_fr][i]; } + assert( *mem_beta_idx >= 0 ); for (i = 0; i < tilt_len_r; i++) { b1[i] = conf_alpha * (*mem_gain) * tilt_filter[*mem_beta_idx][i]; } @@ -206,6 +535,7 @@ void process_ltpf_decoder_fl(LC3_FLOAT* x, LC3_INT xLen, LC3_FLOAT* y, LC3_INT f } if (param[1] == 1) { + assert( conf_beta_idx >= 0 ); for (i = 0; i < tilt_len_r; i++) { b2[i] = conf_alpha * gain * tilt_filter[conf_beta_idx][i]; } @@ -216,17 +546,53 @@ void process_ltpf_decoder_fl(LC3_FLOAT* x, LC3_INT xLen, LC3_FLOAT* y, LC3_INT f p2 = pitch_int; } + +#ifdef CR9_C_ADD_1p25MS + if (*mem_continuation == 0) { +#endif + /* check fading case */ + if (mem_param[1] == 0 && param[1] == 0) { + fading_case = 1; + } else if (mem_param[1] == 1 && param[1] == 0) { + fading_case = 3; + } else if (mem_param[1] == 0 && param[1] == 1) { + fading_case = 2; + } else if (*mem_pitch_int == pitch_int && *mem_pitch_fr == pitch_fr) { + fading_case = 4; + } else { + fading_case = 5; + } +#ifdef CR9_C_ADD_1p25MS + } +#endif + + N4_D = N4; + UNUSED(N4_D); UNUSED(N4_S); + N4_S = 0; +#ifdef CR9_C_ADD_1p25MS + if (frame_dms == LC3PLUS_FRAME_DURATION_1p25MS) + { + N4_D = 2*N4; + if (*mem_continuation) + { + N4_S = N4; + } + } +#endif /* First quarter of the current frame: cross-fading */ - fade_fac = 1. / (LC3_FLOAT) N4; - current_fade_fac_up = 0.f; - current_fade_fac_down = 1.f; + fade_fac = 1. / (LC3_FLOAT) N4_D; + current_fade_fac_up = N4_S*fade_fac; + current_fade_fac_down = 1.f - current_fade_fac_up; (void) p_x; (void) p_y; (void) p_a1; (void) p_b1; - if (mem_param[1] == 0 && param[1] == 0) { + if (fading_case == 1) { + memmove(&buf_y[L_past_y], &buf_x[L_past_x], sizeof(LC3_FLOAT) * N4); - - } else if (mem_param[1] == 1 && param[1] == 0) { +#if defined( CR9_C_ADD_1p25MS ) && defined( FIX_LTPF_MEM_CONTINUATION ) + *mem_continuation = get_continuation(fading_case, frame_dms, (N4+N4_S), N4_D); +#endif + } else if (fading_case == 3) { for (n = 0; n < N4; n++) { sum1 = 0; sum2 = 0; @@ -246,8 +612,10 @@ void process_ltpf_decoder_fl(LC3_FLOAT* x, LC3_INT xLen, LC3_FLOAT* y, LC3_INT f current_fade_fac_down * sum2; current_fade_fac_down -= fade_fac; } - - } else if (mem_param[1] == 0 && param[1] == 1) { +#ifdef CR9_C_ADD_1p25MS + *mem_continuation = get_continuation(fading_case, frame_dms, (n+N4_S), N4_D); +#endif + } else if (fading_case == 2) { for (n = 0; n < N4; n++) { sum1 = 0; sum2 = 0; @@ -266,7 +634,10 @@ void process_ltpf_decoder_fl(LC3_FLOAT* x, LC3_INT xLen, LC3_FLOAT* y, LC3_INT f buf_y[L_past_y + n] = buf_x[L_past_x + n] - current_fade_fac_up * sum1 + current_fade_fac_up * sum2; current_fade_fac_up += fade_fac; } - } else if (*mem_pitch_int == pitch_int && *mem_pitch_fr == pitch_fr) { +#ifdef CR9_C_ADD_1p25MS + *mem_continuation = get_continuation(fading_case, frame_dms, (n+N4_S), N4_D); +#endif + } else if (fading_case == 4) { for (n = 0; n < N4; n++) { sum1 = 0; sum2 = 0; @@ -284,6 +655,9 @@ void process_ltpf_decoder_fl(LC3_FLOAT* x, LC3_INT xLen, LC3_FLOAT* y, LC3_INT f buf_y[L_past_y + n] = buf_x[L_past_x + n] - sum1 + sum2; } +#ifdef CR9_C_ADD_1p25MS + *mem_continuation = get_continuation(fading_case, frame_dms, (n+N4_S), N4_D); +#endif } else { p_x_init = &buf_x[L_past_x]; p_y_init = &buf_y[L_past_y - p1 + inter_len - 1]; @@ -346,6 +720,9 @@ void process_ltpf_decoder_fl(LC3_FLOAT* x, LC3_INT xLen, LC3_FLOAT* y, LC3_INT f p_y_init++; p_y2++; } +#ifdef CR9_C_ADD_1p25MS + *mem_continuation = get_continuation(fading_case, frame_dms, (n+N4_S), N4_D); +#endif } /* Second quarter of the current frame */ @@ -389,19 +766,37 @@ void process_ltpf_decoder_fl(LC3_FLOAT* x, LC3_INT xLen, LC3_FLOAT* y, LC3_INT f move_float(mem_old_x, &buf_x[N], old_x_len); move_float(mem_old_y, &buf_y[N], old_y_len); - *mem_ltpf_active = (conf_beta > 0); +#ifndef FIX_LTPF_DEC_FLFX_MISMATCH + *mem_ltpf_active = ( *conf_beta > 0 ); +#endif + } + } + + + if ( bfi == 0 && hrmode == 1 && ( frame_dms == LC3PLUS_FRAME_DURATION_5MS || frame_dms == LC3PLUS_FRAME_DURATION_2p5MS ) ) + { + pitch_delta = LC3_FABS( (LC3_FLOAT) *mem_pitch_int + (LC3_FLOAT) ( *mem_pitch_fr / 4.0 ) - (LC3_FLOAT) pitch_int - (LC3_FLOAT) ( pitch_fr / 4.0 ) ); + *rel_pitch_change = pitch_delta / MAX( (LC3_FLOAT) *mem_pitch_int + (LC3_FLOAT) ( *mem_pitch_fr / 4.0 ), 1 ); } +#ifdef CR9_C_ADD_1p25MS + if (frame_dms == LC3PLUS_FRAME_DURATION_1p25MS) + { + move_int(mem_param_prev, mem_param, 3); + *mem_pitch_int_prev = *mem_pitch_int; + *mem_pitch_fr_prev = *mem_pitch_fr; + *mem_gain_prev = *mem_gain; + *mem_beta_idx_prev = *mem_beta_idx; + } +#endif + /* Update ltpf param memory */ move_int(mem_param, param, 3); *mem_pitch_int = pitch_int; *mem_pitch_fr = pitch_fr; *mem_gain = gain; *mem_beta_idx = conf_beta_idx; - if (bfi == 0 && hrmode == 1 && (frame_dms == 50 || frame_dms == 25)){ - pitch_delta = LC3_FABS(pitch_fl_c_old - (LC3_FLOAT)pitch_int - (LC3_FLOAT)(pitch_fr / 4.0)); - *rel_pitch_change = pitch_delta / MAX(pitch_fl_c_old, 1); - } + #ifdef WMOPS pop_wmops(); diff --git a/lib_lc3plus/mdct.c b/lib_lc3plus/mdct.c index 4698afd4bfb043409a1736db099373ea210d7eb5..94e6cada27a2692e28db77ccf9dcd1d4e0a2de7b 100644 --- a/lib_lc3plus/mdct.c +++ b/lib_lc3plus/mdct.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.5.1 * +* ETSI TS 103 634 V1.6.1 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -11,9 +11,9 @@ #include "wmc_auto.h" #include "functions.h" -static const LC3_FLOAT* mdct_window(LC3_INT length, LC3_INT frame_dms, LC3_INT hrmode) +static const LC3_FLOAT* mdct_window(LC3_INT length, LC3PLUS_FrameDuration frame_dms, LC3_INT hrmode) { - if (frame_dms == 100) { + if (frame_dms == LC3PLUS_FRAME_DURATION_10MS) { switch (length) { case 80: return MDCT_WINS_10ms[hrmode][0]; @@ -31,7 +31,7 @@ static const LC3_FLOAT* mdct_window(LC3_INT length, LC3_INT frame_dms, LC3_INT h return NULL; } } - else if (frame_dms == 75) { + else if (frame_dms == LC3PLUS_FRAME_DURATION_7p5MS) { switch (length) { case 60: return MDCT_WINS_7_5ms[hrmode][0]; @@ -49,7 +49,7 @@ static const LC3_FLOAT* mdct_window(LC3_INT length, LC3_INT frame_dms, LC3_INT h return NULL; } } - else if (frame_dms == 50) { + else if (frame_dms == LC3PLUS_FRAME_DURATION_5MS) { switch (length) { case 40: return MDCT_WINS_5ms[hrmode][0]; @@ -67,7 +67,7 @@ static const LC3_FLOAT* mdct_window(LC3_INT length, LC3_INT frame_dms, LC3_INT h return NULL; } } - else if (frame_dms == 25) { + else if (frame_dms == LC3PLUS_FRAME_DURATION_2p5MS) { switch (length) { case 20: return MDCT_WINS_2_5ms[hrmode][0]; @@ -85,31 +85,56 @@ static const LC3_FLOAT* mdct_window(LC3_INT length, LC3_INT frame_dms, LC3_INT h return NULL; } } +#ifdef CR9_C_ADD_1p25MS + else if (frame_dms == LC3PLUS_FRAME_DURATION_1p25MS) { + switch (length) { + case 10: + return MDCT_WINS_1_25ms[hrmode][0]; + case 20: + return MDCT_WINS_1_25ms[hrmode][1]; + case 30: + return MDCT_WINS_1_25ms[hrmode][2]; + case 40: + return MDCT_WINS_1_25ms[hrmode][3]; + case 60: + return MDCT_WINS_1_25ms[hrmode][4]; + default: + return NULL; + } + } +#endif return NULL; } -void mdct_init(Mdct* mdct, LC3_INT length, LC3_INT frame_dms, LC3_INT fs_idx, LC3_INT hrmode) +void mdct_init(Mdct* mdct, LC3_INT length, LC3PLUS_FrameDuration frame_dms, LC3_INT fs_idx, LC3_INT hrmode) { - if (frame_dms == 100) { - mdct->leading_zeros = MDCT_la_zeroes[fs_idx]; - } - else if (frame_dms == 75) { - mdct->leading_zeros = MDCT_la_zeroes_7_5ms[fs_idx]; - } - else if (frame_dms == 50) { - mdct->leading_zeros = MDCT_la_zeroes_5ms[fs_idx]; - } - else if (frame_dms == 25) { + switch (frame_dms) + { +#ifdef CR9_C_ADD_1p25MS + case LC3PLUS_FRAME_DURATION_1p25MS: + mdct->leading_zeros = MDCT_la_zeroes_1_25ms[fs_idx]; + break; +#endif + case LC3PLUS_FRAME_DURATION_2p5MS: mdct->leading_zeros = MDCT_la_zeroes_2_5ms[fs_idx]; - } - else { + break; + case LC3PLUS_FRAME_DURATION_5MS: + mdct->leading_zeros = MDCT_la_zeroes_5ms[fs_idx]; + break; + case LC3PLUS_FRAME_DURATION_7p5MS: + mdct->leading_zeros = MDCT_la_zeroes_7_5ms[fs_idx]; + break; + case LC3PLUS_FRAME_DURATION_10MS: + mdct->leading_zeros = MDCT_la_zeroes[fs_idx]; + break; + case LC3PLUS_FRAME_DURATION_UNDEFINED: assert(!"invalid frame_ms"); } mdct->length = length; mdct->mem_length = length - mdct->leading_zeros; mdct->window = mdct_window(length, frame_dms, hrmode); - mdct->mem = calloc(sizeof(*mdct->mem), mdct->mem_length); + mdct->mem = calloc(mdct->mem_length, sizeof(*mdct->mem)); dct4_init(&mdct->dct, length); } diff --git a/lib_lc3plus/mdct_shaping.c b/lib_lc3plus/mdct_shaping.c index 296a8cd454980560dd31f199cffabbf729f8602f..6c1b0f5dbb81a6439aa2c51e5ec4db4ade3722c7 100644 --- a/lib_lc3plus/mdct_shaping.c +++ b/lib_lc3plus/mdct_shaping.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.5.1 * +* ETSI TS 103 634 V1.6.1 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * diff --git a/lib_lc3plus/near_nyquist_detector.c b/lib_lc3plus/near_nyquist_detector.c index 5d81392b214e9c599defa76f20afdfbebf1db3bb..56f66937d2950354059acb50b66d6f45a76e5e14 100644 --- a/lib_lc3plus/near_nyquist_detector.c +++ b/lib_lc3plus/near_nyquist_detector.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.5.1 * +* ETSI TS 103 634 V1.6.1 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -12,7 +12,8 @@ #include "functions.h" void processNearNyquistdetector_fl(LC3_INT16* near_nyquist_flag, const LC3_INT fs_idx, const LC3_INT near_nyquist_index, - const LC3_INT bands_number, const LC3_FLOAT* ener , const LC3_INT16 frame_dms, const LC3_INT16 hrmode) + const LC3_INT bands_number, const LC3_FLOAT* ener + , const LC3PLUS_FrameDuration frame_dms, const LC3_INT16 hrmode) { *near_nyquist_flag = 0; if (hrmode == 0){ @@ -36,36 +37,43 @@ void processNearNyquistdetector_fl(LC3_INT16* near_nyquist_flag, const LC3_INT f } } } - else // hrmode == 1 + else /* hrmode == 1 */ { - // inverse spectral flatness = mean(energy) ./ 2^(mean(log2(energy))); + /* inverse spectral flatness = mean(energy) ./ 2^(mean(log2(energy))); */ LC3_INT32 td_thresh, i = 0; LC3_FLOAT mean_ener = 0, mean_ener_log2 = 0, inv_flatness = 0; switch (frame_dms) { - case 25: +#ifdef CR9_C_ADD_1p25MS + case LC3PLUS_FRAME_DURATION_1p25MS: + assert(0); + break; +#endif + case LC3PLUS_FRAME_DURATION_2p5MS: td_thresh = TD_HR_thresh_2_5ms; break; - case 50: + case LC3PLUS_FRAME_DURATION_5MS: td_thresh = TD_HR_thresh_5ms; break; - case 75: + case LC3PLUS_FRAME_DURATION_7p5MS: td_thresh = TD_HR_thresh_7_5ms; break; - default: /* 100 */ + case LC3PLUS_FRAME_DURATION_10MS: td_thresh = TD_HR_thresh_10ms; break; + case LC3PLUS_FRAME_DURATION_UNDEFINED: + assert(0); } - // calculate arithmetic mean + /* calculate arithmetic mean */ for (i = 0; i < bands_number; i++) { mean_ener += ener[i]; } mean_ener = mean_ener / bands_number; - // calculate geometric mean + /* calculate geometric mean */ for (i = 0; i < bands_number; i++) { if (ener[i] != 0) { diff --git a/lib_lc3plus/noise_factor.c b/lib_lc3plus/noise_factor.c index 72b2602251430320fa436f899263786b1564a7e5..80adaf399cf7d675cecf1890a20cbf9df970cdbf 100644 --- a/lib_lc3plus/noise_factor.c +++ b/lib_lc3plus/noise_factor.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.5.1 * +* ETSI TS 103 634 V1.6.1 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -11,7 +11,7 @@ #include "wmc_auto.h" #include "functions.h" -void processNoiseFactor_fl(LC3_INT* fac_ns_idx, LC3_FLOAT x[], LC3_INT xq[], LC3_FLOAT gg, LC3_INT BW_cutoff_idx, LC3_INT frame_dms, +void processNoiseFactor_fl(LC3_INT* fac_ns_idx, LC3_FLOAT x[], LC3_INT xq[], LC3_FLOAT gg, LC3_INT BW_cutoff_idx, LC3PLUS_FrameDuration frame_dms, LC3_INT target_bytes ) { @@ -21,22 +21,30 @@ void processNoiseFactor_fl(LC3_INT* fac_ns_idx, LC3_FLOAT x[], LC3_INT xq[], LC3 switch (frame_dms) { - case 25: +#ifdef CR9_C_ADD_1p25MS + case LC3PLUS_FRAME_DURATION_1p25MS: nTransWidth = 1; startOffset = 6; break; - case 50: +#endif + case LC3PLUS_FRAME_DURATION_2p5MS: + nTransWidth = 1; + startOffset = 6; + break; + case LC3PLUS_FRAME_DURATION_5MS: nTransWidth = 1; startOffset = 12; break; - case 75: + case LC3PLUS_FRAME_DURATION_7p5MS: nTransWidth = 2; startOffset = 18; break; - case 100: + case LC3PLUS_FRAME_DURATION_10MS: nTransWidth = 3; startOffset = 24; break; + case LC3PLUS_FRAME_DURATION_UNDEFINED: + assert(0); } for (k = startOffset - nTransWidth; k < startOffset + nTransWidth; k++) @@ -91,7 +99,7 @@ void processNoiseFactor_fl(LC3_INT* fac_ns_idx, LC3_FLOAT x[], LC3_INT xq[], LC3 - if (kZeroLines > 1 && target_bytes <= 20 && frame_dms == 100) { + if (kZeroLines > 1 && target_bytes <= 20 && frame_dms == LC3PLUS_FRAME_DURATION_10MS) { j = 0, k = 0, nsf1 = 0, nsf2 = 0, sumZeroLines = 0; diff --git a/lib_lc3plus/noise_filling.c b/lib_lc3plus/noise_filling.c index f929338d0cabb0903ef6d4339496410e6bab3bbd..77eca88c810365623db5eee5a74fe1dfabb1a54c 100644 --- a/lib_lc3plus/noise_filling.c +++ b/lib_lc3plus/noise_filling.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.5.1 * +* ETSI TS 103 634 V1.6.1 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -11,30 +11,38 @@ #include "wmc_auto.h" #include "functions.h" -void processNoiseFilling_fl(LC3_FLOAT xq[], LC3_INT nfseed, LC3_INT fac_ns_idx, LC3_INT bw_stopband, LC3_INT frame_dms, LC3_FLOAT fac_ns_pc, LC3_INT spec_inv_idx) +void processNoiseFilling_fl(LC3_FLOAT xq[], LC3_INT nfseed, LC3_INT fac_ns_idx, LC3_INT bw_stopband, LC3PLUS_FrameDuration frame_dms, LC3_FLOAT fac_ns_pc, LC3_INT spec_inv_idx) { LC3_INT zeroLines[MAX_LEN]; - LC3_INT nTransWidth, startOffset, j, k, nzeros = 0, kZeroLines; + LC3_INT nTransWidth = 0, startOffset = 0, j, k, nzeros = 0, kZeroLines; LC3_FLOAT fac_ns = 0; switch (frame_dms) { - case 25: +#ifdef CR9_C_ADD_1p25MS + case LC3PLUS_FRAME_DURATION_1p25MS: nTransWidth = 1; startOffset = 6; break; - case 50: +#endif + case LC3PLUS_FRAME_DURATION_2p5MS: + nTransWidth = 1; + startOffset = 6; + break; + case LC3PLUS_FRAME_DURATION_5MS: nTransWidth = 1; startOffset = 12; break; - case 75: + case LC3PLUS_FRAME_DURATION_7p5MS: nTransWidth = 2; startOffset = 18; break; - case 100: + case LC3PLUS_FRAME_DURATION_10MS: nTransWidth = 3; startOffset = 24; break; + case LC3PLUS_FRAME_DURATION_UNDEFINED: + assert(0); } fac_ns = (8.0 - fac_ns_idx) / 16.0; diff --git a/lib_lc3plus/olpa.c b/lib_lc3plus/olpa.c index 976f0a177e059c26a1b14ff3261c13742751506c..aacbdd34fbcbdc2a42d87798f57666998320f30d 100644 --- a/lib_lc3plus/olpa.c +++ b/lib_lc3plus/olpa.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.5.1 * +* ETSI TS 103 634 V1.6.1 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -46,8 +46,8 @@ LC3_INT searchMaxIndice(LC3_FLOAT* in, LC3_INT len) } void processOlpa_fl(LC3_FLOAT* s_12k8, LC3_FLOAT* mem_s12k8, LC3_FLOAT* mem_s6k4, LC3_INT* mem_old_T0, - LC3_INT* pitch_flag, - LC3_INT* T0_out, LC3_FLOAT* normcorr_out, LC3_INT len, LC3_INT frame_dms) + LC3_INT* pitch_flag, + LC3_INT* T0_out, LC3_FLOAT* normcorr_out, LC3_INT len, LC3PLUS_FrameDuration frame_dms) { LC3_FLOAT norm_corr = 0, sum = 0, sum0 = 0, sum1 = 0, sum2 = 0, norm_corr2 = 0, *s6k4; LC3_FLOAT buf[LEN_6K4 + MAX_PITCH_6K4 + MAX_LEN], R0[RANGE_PITCH_6K4]; /* constant length */ @@ -56,15 +56,21 @@ void processOlpa_fl(LC3_FLOAT* s_12k8, LC3_FLOAT* mem_s12k8, LC3_FLOAT* mem_s6k4 len2 = len / 2; switch(frame_dms) { - case 50: + case LC3PLUS_FRAME_DURATION_5MS: delta = len / 2; acflen = len2 * 2; break; - case 25: + case LC3PLUS_FRAME_DURATION_2p5MS: delta = 3*(len /2); acflen = len2*4; break; +#ifdef CR9_C_ADD_1p25MS + case LC3PLUS_FRAME_DURATION_1p25MS: + delta = 7 * (len / 2); + acflen = len2 * 8; + break; +#endif default: delta = 0; @@ -84,6 +90,7 @@ void processOlpa_fl(LC3_FLOAT* s_12k8, LC3_FLOAT* mem_s12k8, LC3_FLOAT* mem_s6k4 move_float(&buf[mem_in_len], R0, len2); move_float(buf, mem_s6k4, mem_in_len); move_float(mem_s6k4, &buf[len2], mem_in_len); + for (i = MIN_PITCH_6K4; i <= MAX_PITCH_6K4; i++) { sum = mac_loop(s6k4, &s6k4[-i], acflen); R0[i - MIN_PITCH_6K4] = sum; @@ -137,10 +144,10 @@ void processOlpa_fl(LC3_FLOAT* s_12k8, LC3_FLOAT* mem_s12k8, LC3_FLOAT* mem_s6k4 switch(frame_dms) { - case 50: + case LC3PLUS_FRAME_DURATION_5MS: if (*pitch_flag == 1) { - *mem_old_T0 = T0; + *mem_old_T0 = T0; *pitch_flag = 0; } else @@ -149,10 +156,10 @@ void processOlpa_fl(LC3_FLOAT* s_12k8, LC3_FLOAT* mem_s12k8, LC3_FLOAT* mem_s6k4 } break; - case 25: + case LC3PLUS_FRAME_DURATION_2p5MS: if (*pitch_flag == 3) { - *mem_old_T0 = T0; + *mem_old_T0 = T0; *pitch_flag = 0; } else @@ -160,6 +167,19 @@ void processOlpa_fl(LC3_FLOAT* s_12k8, LC3_FLOAT* mem_s12k8, LC3_FLOAT* mem_s6k4 *pitch_flag += 1; } break; +#ifdef CR9_C_ADD_1p25MS + case LC3PLUS_FRAME_DURATION_1p25MS: + if (*pitch_flag == 7) + { + *mem_old_T0 = T0; + *pitch_flag = 0; + } + else + { + *pitch_flag += 1; + } + break; +#endif default: *mem_old_T0 = T0; @@ -167,5 +187,4 @@ void processOlpa_fl(LC3_FLOAT* s_12k8, LC3_FLOAT* mem_s12k8, LC3_FLOAT* mem_s6k4 *T0_out = T0 * 2.0; *normcorr_out = norm_corr; - } diff --git a/lib_lc3plus/pc_apply.c b/lib_lc3plus/pc_apply.c index a7113f1bc781f7e35e3d5852a95482591bac0ab3..9ae4a724dab81cb84b3b3f90553bde2c622b9ba8 100644 --- a/lib_lc3plus/pc_apply.c +++ b/lib_lc3plus/pc_apply.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.5.1 * +* ETSI TS 103 634 V1.6.1 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * diff --git a/lib_lc3plus/pc_classify.c b/lib_lc3plus/pc_classify.c index adb8a59713ef84fcd84f8abf7a6481a08030be38..628cb9d12d525b8f00bcaf90b4e5d164b6d1122c 100644 --- a/lib_lc3plus/pc_classify.c +++ b/lib_lc3plus/pc_classify.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.5.1 * +* ETSI TS 103 634 V1.6.1 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -13,14 +13,14 @@ LC3_FLOAT pc_peak_detector(LC3_FLOAT *q_d_prev, LC3_INT32 yLen); -void processPcClassify_fl(LC3_INT32 pitch_present, LC3_INT32 frame_dms, LC3_FLOAT *q_d_prev, LC3_FLOAT *q_old_res, LC3_INT32 yLen, LC3_INT32 spec_inv_idx, LC3_FLOAT stab_fac, LC3_INT32 *bfi) +void processPcClassify_fl(LC3_INT32 pitch_present, LC3PLUS_FrameDuration frame_dms, LC3_FLOAT *q_d_prev, LC3_FLOAT *q_old_res, LC3_INT32 yLen, LC3_INT32 spec_inv_idx, LC3_FLOAT stab_fac, LC3_INT32 *bfi) { LC3_INT32 maxPitchBin, xover, i; LC3_FLOAT part_nrg, full_nrg; part_nrg = 0; full_nrg = 0; - if (spec_inv_idx < (4 * frame_dms / 10)) + if (spec_inv_idx < (4 * frame_dms * 1.25)) { if (stab_fac < 0.5) { @@ -28,7 +28,7 @@ void processPcClassify_fl(LC3_INT32 pitch_present, LC3_INT32 frame_dms, LC3_FLOA } else if (pitch_present == 1) { maxPitchBin = 8; - if (frame_dms == 50) + if (frame_dms == LC3PLUS_FRAME_DURATION_5MS) { maxPitchBin = 4; } diff --git a/lib_lc3plus/pc_main.c b/lib_lc3plus/pc_main.c index 5ef1676d4838b5a814c5f51e1ceb5373184a5837..28c065f6dbfc542fc010c499da7f3751d651069a 100644 --- a/lib_lc3plus/pc_main.c +++ b/lib_lc3plus/pc_main.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.5.1 * +* ETSI TS 103 634 V1.6.1 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * diff --git a/lib_lc3plus/pc_update.c b/lib_lc3plus/pc_update.c index b24b2ea62a6848a876b85917fc41e6a090e82a2b..35166e1780d4d6e2453f20542a772baa78c5274b 100644 --- a/lib_lc3plus/pc_update.c +++ b/lib_lc3plus/pc_update.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.5.1 * +* ETSI TS 103 634 V1.6.1 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * diff --git a/lib_lc3plus/per_band_energy.c b/lib_lc3plus/per_band_energy.c index 413b6cfd844e28d319d9fbd59032f95ff9dd5df4..fe1e31f66f92df48ddff29b382e0003007f72c8c 100644 --- a/lib_lc3plus/per_band_energy.c +++ b/lib_lc3plus/per_band_energy.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.5.1 * +* ETSI TS 103 634 V1.6.1 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -11,7 +11,7 @@ #include "wmc_auto.h" #include "functions.h" -void processPerBandEnergy_fl(LC3_INT bands_number, const LC3_INT* acc_coeff_per_band, LC3_INT16 hrmode, LC3_INT16 frame_dms, LC3_FLOAT* d2, LC3_FLOAT* d) +void processPerBandEnergy_fl(LC3_INT bands_number, const LC3_INT* acc_coeff_per_band, LC3_INT16 hrmode, LC3PLUS_FrameDuration frame_dms, LC3_FLOAT* d2, LC3_FLOAT* d) { LC3_INT i, j, start, stop, maxBwBin; LC3_FLOAT sum; @@ -30,15 +30,24 @@ void processPerBandEnergy_fl(LC3_INT bands_number, const LC3_INT* acc_coeff_per_ } switch (frame_dms) { - case 25: +#ifdef CR9_C_ADD_1p25MS + case LC3PLUS_FRAME_DURATION_1p25MS: + maxBwBin = maxBwBin >> 3; + break; +#endif + case LC3PLUS_FRAME_DURATION_2p5MS: maxBwBin = maxBwBin >> 2; break; - case 50: + case LC3PLUS_FRAME_DURATION_5MS: maxBwBin = maxBwBin >> 1; break; - case 75: + case LC3PLUS_FRAME_DURATION_7p5MS: maxBwBin = (maxBwBin >> 2) * 3; break; + case LC3PLUS_FRAME_DURATION_10MS: + break; + case LC3PLUS_FRAME_DURATION_UNDEFINED: + assert(0); } for (i = 0; i < bands_number; i++) { diff --git a/lib_lc3plus/plc_classify.c b/lib_lc3plus/plc_classify.c index f1f1878d4bf644657eaaa09bbdcce8f976b633d6..6ab043abe827a83e9f35e084bb9430777c023690 100644 --- a/lib_lc3plus/plc_classify.c +++ b/lib_lc3plus/plc_classify.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.5.1 * +* ETSI TS 103 634 V1.6.1 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -83,23 +83,58 @@ static void array_calculate(LC3_INT32 *array_tdc, LC3_INT32 *array_ns, int lengt *counter_ns = counter_loc_ns; } -static void plc_xcorr_lc(LC3_FLOAT *pcmbufHist, LC3_INT32 max_len_pcm_plc, LC3_INT32 pitch_int, LC3_INT32 framelength, LC3_INT32 frame_dms, LC3_INT32 fs, LC3_FLOAT *xcorr); +static void plc_xcorr_lc(LC3_FLOAT *pcmbufHist, LC3_INT32 max_len_pcm_plc, LC3_INT32 pitch_int, LC3_INT32 framelength, LC3PLUS_FrameDuration frame_dms, LC3_INT32 fs, LC3_FLOAT *xcorr); static void spectral_centroid_lc(LC3_FLOAT *gains, LC3_INT32 tilt, const LC3_INT *bands_offset, LC3_INT32 bands_number, LC3_INT32 framelength, LC3_INT32 fs, LC3_FLOAT *sc); void processPlcClassify_fl(LC3_INT plcMeth, LC3_INT *concealMethod, LC3_INT32 *nbLostCmpt, LC3_INT32 bfi, - LC3_FLOAT *xcorr, LC3_INT32 framelength, LC3_INT32 frame_dms, LC3_INT32 pitch_int, + LC3_FLOAT *xcorr, LC3_INT32 framelength, LC3PLUS_FrameDuration frame_dms, LC3_INT32 pitch_int, LC3_INT32 fs, const LC3_INT *band_offsets, LC3_INT32 bands_number, LC3_INT32 tilt, PlcAdvSetup *plcAd , LC3_INT32 hrmode ) { LC3_FLOAT sc, class; int fs_idx_tmp; +#ifdef CR13_C_RESET_CLASSIFIER_AFTER_BAD_FRAMES + LC3_INT16 resetClassifierThreshold = 0; + LC3_INT16 updateStatistics = 0; +#endif if (plcAd) { *xcorr = 0; } +#ifdef CR13_C_RESET_CLASSIFIER_AFTER_BAD_FRAMES + switch (frame_dms) + { +#ifdef CR9_C_ADD_1p25MS + case LC3PLUS_FRAME_DURATION_1p25MS: + resetClassifierThreshold = 16; + break; +#endif + case LC3PLUS_FRAME_DURATION_2p5MS: + resetClassifierThreshold = 8; + break; + case LC3PLUS_FRAME_DURATION_5MS: + resetClassifierThreshold = 4; + break; + case LC3PLUS_FRAME_DURATION_7p5MS: + resetClassifierThreshold = 3; + break; + case LC3PLUS_FRAME_DURATION_10MS: + resetClassifierThreshold = 2; + break; + case LC3PLUS_FRAME_DURATION_UNDEFINED: assert(0); + } + + if (plcAd->numberOfGoodFrames > resetClassifierThreshold) + { + updateStatistics = 1; + } else { + updateStatistics = 0; + } +#endif + fs_idx_tmp = FS2FS_IDX(fs); /* Save statistics for 24 kHz, 48 kHz and 96 kHz */ if ((bfi == 1) || ((bfi >= 0) && (bfi <= 2) && ((fs_idx_tmp == 2) || (fs_idx_tmp == 4) || (fs_idx_tmp == 5)))) /* Partial Concealment PC(bfi==2) requires allowing value 2 to pass thru as well */ @@ -126,34 +161,70 @@ void processPlcClassify_fl(LC3_INT plcMeth, LC3_INT *concealMethod, LC3_INT32 *n if (class <= 0) { - if (frame_dms == 100 && hrmode == 0) + if (frame_dms == LC3PLUS_FRAME_DURATION_10MS && hrmode == 0) { *concealMethod = 2; /* PhaseEcu selected */ - array_insert_and_shift(plcAd->plc_longterm_advc_tdc, 0, plcAd->longterm_analysis_counter_max, &plcAd->overall_counter, &plcAd->longterm_counter_byte_position, &plcAd->longterm_counter_bit_position); - array_insert_and_shift(plcAd->plc_longterm_advc_ns, 0, plcAd->longterm_analysis_counter_max, NULL, &plcAd->longterm_counter_byte_position, &plcAd->longterm_counter_bit_position); + +#ifdef CR13_C_RESET_CLASSIFIER_AFTER_BAD_FRAMES + if (updateStatistics == 1) +#endif + { + array_insert_and_shift(plcAd->plc_longterm_advc_tdc, 0, plcAd->longterm_analysis_counter_max, &plcAd->overall_counter, &plcAd->longterm_counter_byte_position, &plcAd->longterm_counter_bit_position); + array_insert_and_shift(plcAd->plc_longterm_advc_ns, 0, plcAd->longterm_analysis_counter_max, NULL, &plcAd->longterm_counter_byte_position, &plcAd->longterm_counter_bit_position); + } } else { - array_insert_and_shift(plcAd->plc_longterm_advc_tdc, 0, plcAd->longterm_analysis_counter_max, &plcAd->overall_counter, &plcAd->longterm_counter_byte_position, &plcAd->longterm_counter_bit_position); - array_insert_and_shift(plcAd->plc_longterm_advc_ns, 0, plcAd->longterm_analysis_counter_max, NULL, &plcAd->longterm_counter_byte_position, &plcAd->longterm_counter_bit_position); +#ifdef CR13_C_RESET_CLASSIFIER_AFTER_BAD_FRAMES + if (updateStatistics == 1) +#endif + { + array_insert_and_shift(plcAd->plc_longterm_advc_tdc, 0, plcAd->longterm_analysis_counter_max, &plcAd->overall_counter, &plcAd->longterm_counter_byte_position, &plcAd->longterm_counter_bit_position); + array_insert_and_shift(plcAd->plc_longterm_advc_ns, 0, plcAd->longterm_analysis_counter_max, NULL, &plcAd->longterm_counter_byte_position, &plcAd->longterm_counter_bit_position); + } } } else { - array_insert_and_shift(plcAd->plc_longterm_advc_tdc, 1, plcAd->longterm_analysis_counter_max, &plcAd->overall_counter, &plcAd->longterm_counter_byte_position, &plcAd->longterm_counter_bit_position); - array_insert_and_shift(plcAd->plc_longterm_advc_ns, 0, plcAd->longterm_analysis_counter_max, NULL, &plcAd->longterm_counter_byte_position, &plcAd->longterm_counter_bit_position); +#ifdef CR13_C_RESET_CLASSIFIER_AFTER_BAD_FRAMES + if (updateStatistics == 1) +#endif + { + array_insert_and_shift(plcAd->plc_longterm_advc_tdc, 1, plcAd->longterm_analysis_counter_max, &plcAd->overall_counter, &plcAd->longterm_counter_byte_position, &plcAd->longterm_counter_bit_position); + array_insert_and_shift(plcAd->plc_longterm_advc_ns, 0, plcAd->longterm_analysis_counter_max, NULL, &plcAd->longterm_counter_byte_position, &plcAd->longterm_counter_bit_position); + } } } else { *concealMethod = 4; /* Noise Substitution */ - array_insert_and_shift(plcAd->plc_longterm_advc_tdc, 0, plcAd->longterm_analysis_counter_max, &plcAd->overall_counter, &plcAd->longterm_counter_byte_position, &plcAd->longterm_counter_bit_position); - array_insert_and_shift(plcAd->plc_longterm_advc_ns, 1, plcAd->longterm_analysis_counter_max, NULL, &plcAd->longterm_counter_byte_position, &plcAd->longterm_counter_bit_position); + +#ifdef CR13_C_RESET_CLASSIFIER_AFTER_BAD_FRAMES + if (updateStatistics == 1) +#endif + { + array_insert_and_shift(plcAd->plc_longterm_advc_tdc, 0, plcAd->longterm_analysis_counter_max, &plcAd->overall_counter, &plcAd->longterm_counter_byte_position, &plcAd->longterm_counter_bit_position); + array_insert_and_shift(plcAd->plc_longterm_advc_ns, 1, plcAd->longterm_analysis_counter_max, NULL, &plcAd->longterm_counter_byte_position, &plcAd->longterm_counter_bit_position); + } } - array_calculate(plcAd->plc_longterm_advc_tdc, plcAd->plc_longterm_advc_ns, plcAd->longterm_analysis_counter_max_bytebuffer, &plcAd->longterm_counter_plcTdc, &plcAd->longterm_counter_plcNsAdv, plcAd->longterm_analysis_counter_max); - update_bit_and_byte_positions(plcAd->longterm_analysis_counter_max_bytebuffer, &plcAd->longterm_counter_byte_position, &plcAd->longterm_counter_bit_position); +#ifdef CR13_C_RESET_CLASSIFIER_AFTER_BAD_FRAMES + if (updateStatistics == 1) +#endif + { + array_calculate(plcAd->plc_longterm_advc_tdc, plcAd->plc_longterm_advc_ns, plcAd->longterm_analysis_counter_max_bytebuffer, &plcAd->longterm_counter_plcTdc, &plcAd->longterm_counter_plcNsAdv, plcAd->longterm_analysis_counter_max); + update_bit_and_byte_positions(plcAd->longterm_analysis_counter_max_bytebuffer, &plcAd->longterm_counter_byte_position, &plcAd->longterm_counter_bit_position); + } } } + +#ifdef CR13_C_RESET_CLASSIFIER_AFTER_BAD_FRAMES + if (bfi == 1) + { + plcAd->numberOfGoodFrames = 0; + } else { + plcAd->numberOfGoodFrames = plcAd->numberOfGoodFrames + 1; + } +#endif } static void spectral_centroid_lc(LC3_FLOAT *gains, LC3_INT32 tilt, const LC3_INT *band_offsets, LC3_INT32 bands_number, LC3_INT32 framelength, LC3_INT32 fs, LC3_FLOAT *sc) @@ -234,7 +305,7 @@ static void spectral_centroid_lc(LC3_FLOAT *gains, LC3_INT32 tilt, const LC3_INT } static void plc_xcorr_lc(LC3_FLOAT *pcmbufHist, LC3_INT32 max_len_pcm_plc, LC3_INT32 pitch_int, LC3_INT32 framelength, - LC3_INT32 frame_dms, LC3_INT32 fs, LC3_FLOAT *xcorr) + LC3PLUS_FrameDuration frame_dms, LC3_INT32 fs, LC3_FLOAT *xcorr) { LC3_INT32 max_corr_len, pitch_min, corr_len, min_corr_len, pcm_max_corr_len, range1Start, range2Start, i; LC3_FLOAT norm_w, norm_w_t; @@ -252,7 +323,7 @@ static void plc_xcorr_lc(LC3_FLOAT *pcmbufHist, LC3_INT32 max_len_pcm_plc, LC3_I pcm_max_corr_len = max_len_pcm_plc - pitch_int; min_corr_len = 2 * pitch_min; /* at least 5 ms (=2*pitchmin*) corr length */ - max_corr_len = framelength*100/frame_dms; /* maximum 10 ms */ + max_corr_len = framelength*100/(frame_dms*1.25*10); /* maximum 10 ms */ max_corr_len = MIN( max_corr_len, pcm_max_corr_len ); corr_len = MIN( max_corr_len, pitch_int ); /* pitch_int is prefered, but maximum 10ms or left pcm buf size */ diff --git a/lib_lc3plus/plc_compute_stab_fac.c b/lib_lc3plus/plc_compute_stab_fac.c index 121c2f06a22d58316ff9259997dd435c3b8b7b2d..cd5a95441b438fc2b6429bb8a18d82898d09c9ad 100644 --- a/lib_lc3plus/plc_compute_stab_fac.c +++ b/lib_lc3plus/plc_compute_stab_fac.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.5.1 * +* ETSI TS 103 634 V1.6.1 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * diff --git a/lib_lc3plus/plc_damping_scrambling.c b/lib_lc3plus/plc_damping_scrambling.c index ac4526b4ec698c7a90fca4e71c832dbf54245117..edd430335d5c77305c6e2ae7957d6166f887ac62 100644 --- a/lib_lc3plus/plc_damping_scrambling.c +++ b/lib_lc3plus/plc_damping_scrambling.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.5.1 * +* ETSI TS 103 634 V1.6.1 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -15,7 +15,7 @@ void processPlcDampingScramblingMain_fl(LC3_INT32 *ns_seed, LC3_INT32 *pc_seed, LC3_INT32 ns_nbLostCmpt_pc, LC3_INT32 ns_nbLostCmpt, LC3_FLOAT *stabFac, LC3_FLOAT *cum_fading_slow, LC3_FLOAT *cum_fading_fast, LC3_FLOAT *spec_prev, LC3_FLOAT *spec, LC3_INT32 spec_inv_idx, LC3_INT32 yLen, LC3_INT32 bfi, - LC3_INT32 frame_dms, LC3_INT32 concealMethod, LC3_INT32 pitch_present_bfi1, LC3_INT32 pitch_present_bfi2, + LC3PLUS_FrameDuration frame_dms, LC3_INT32 concealMethod, LC3_INT32 pitch_present_bfi1, LC3_INT32 pitch_present_bfi2, LC3_FLOAT *cum_fflcAtten , LC3_UINT8 plc_fadeout_type ) @@ -59,7 +59,7 @@ void processPlcDampingScramblingMain_fl(LC3_INT32 *ns_seed, } void processPlcDampingScrambling_fl(LC3_FLOAT *spec, LC3_INT32 yLen, LC3_INT32 nbLostCmpt, LC3_FLOAT *stabFac, LC3_INT32 processDampScramb, - LC3_FLOAT *cum_fflcAtten, LC3_INT32 pitch_present, LC3_INT32 frame_dms, LC3_FLOAT *cum_fading_slow, + LC3_FLOAT *cum_fflcAtten, LC3_INT32 pitch_present, LC3PLUS_FrameDuration frame_dms, LC3_FLOAT *cum_fading_slow, LC3_FLOAT *cum_fading_fast, LC3_INT32 *seed, LC3_INT32 spec_inv_idx , LC3_UINT8 plc_fadeout_type ) @@ -74,18 +74,28 @@ void processPlcDampingScrambling_fl(LC3_FLOAT *spec, LC3_INT32 yLen, LC3_INT32 n switch (frame_dms) { - case 25: - slow = LC3_SQRT(LC3_SQRT(slow)); - fast = LC3_SQRT(LC3_SQRT(fast)); - break; - case 50: - slow = LC3_SQRT(slow); - fast = LC3_SQRT(fast); - break; - case 75: - slow = LC3_SQRT(LC3_SQRT(slow*slow*slow)); - fast = LC3_SQRT(LC3_SQRT(fast*fast*fast)); - break; +#ifdef CR9_C_ADD_1p25MS + case LC3PLUS_FRAME_DURATION_1p25MS: + slow = LC3_SQRT(LC3_SQRT(LC3_SQRT(slow))); + fast = LC3_SQRT(LC3_SQRT(LC3_SQRT(fast))); + break; +#endif + case LC3PLUS_FRAME_DURATION_2p5MS: + slow = LC3_SQRT(LC3_SQRT(slow)); + fast = LC3_SQRT(LC3_SQRT(fast)); + break; + case LC3PLUS_FRAME_DURATION_5MS: + slow = LC3_SQRT(slow); + fast = LC3_SQRT(fast); + break; + case LC3PLUS_FRAME_DURATION_7p5MS: + slow = LC3_SQRT(LC3_SQRT(slow*slow*slow)); + fast = LC3_SQRT(LC3_SQRT(fast*fast*fast)); + break; + case LC3PLUS_FRAME_DURATION_10MS: + break; + case LC3PLUS_FRAME_DURATION_UNDEFINED: + assert(0); } if (plc_fadeout_type == 0) @@ -98,10 +108,10 @@ void processPlcDampingScrambling_fl(LC3_FLOAT *spec, LC3_INT32 yLen, LC3_INT32 n { if (plc_fadeout_type != 0) { - if (nbLostCmpt < (4 * (100.0 / (LC3_FLOAT)frame_dms))) { + if (nbLostCmpt < (4 * (100.0 / (LC3_FLOAT)(frame_dms*1.25*10)))) { cum_fading_slow_local = 1.0; } - else if (nbLostCmpt < (8 * (100.0 / (LC3_FLOAT)frame_dms))) { + else if (nbLostCmpt < (8 * (100.0 / (LC3_FLOAT)(frame_dms*1.25*10)))) { cum_fading_slow_local = 0.9; } else { @@ -118,23 +128,27 @@ void processPlcDampingScrambling_fl(LC3_FLOAT *spec, LC3_INT32 yLen, LC3_INT32 n if (spec_inv_idx == 0) { - if (nbLostCmpt * frame_dms > PLC_FADEOUT_IN_MS * 10) + if (nbLostCmpt * frame_dms * 1.25 * 10 > PLC_FADEOUT_IN_MS * 10) { fflcAtten = 0; *cum_fflcAtten = 0; } - else if (nbLostCmpt * frame_dms > 200) + else if (nbLostCmpt * frame_dms * 1.25 * 10 > 200) { switch (frame_dms) { - case 25: fflcAtten = PLC34_ATTEN_FAC_025; break; - case 50: fflcAtten = PLC34_ATTEN_FAC_050; break; - case 75: fflcAtten = PLC34_ATTEN_FAC_075; break; - case 100: fflcAtten = PLC34_ATTEN_FAC_100; break; +#ifdef CR9_C_ADD_1p25MS + case LC3PLUS_FRAME_DURATION_1p25MS: fflcAtten = PLC34_ATTEN_FAC_0125; break; +#endif + case LC3PLUS_FRAME_DURATION_2p5MS: fflcAtten = PLC34_ATTEN_FAC_025; break; + case LC3PLUS_FRAME_DURATION_5MS: fflcAtten = PLC34_ATTEN_FAC_050; break; + case LC3PLUS_FRAME_DURATION_7p5MS: fflcAtten = PLC34_ATTEN_FAC_075; break; + case LC3PLUS_FRAME_DURATION_10MS: fflcAtten = PLC34_ATTEN_FAC_100; break; + case LC3PLUS_FRAME_DURATION_UNDEFINED: + assert(0); } } - *cum_fflcAtten = *cum_fflcAtten * fflcAtten; cum_fading_slow_local = *cum_fading_slow * *cum_fflcAtten; cum_fading_fast_local = *cum_fading_fast * *cum_fflcAtten; @@ -145,10 +159,10 @@ void processPlcDampingScrambling_fl(LC3_FLOAT *spec, LC3_INT32 yLen, LC3_INT32 n plc_start_inFrames = 1; } else { - plc_start_inFrames = floor(PLC4_TRANSIT_START_IN_MS / (frame_dms / 10.0)); + plc_start_inFrames = floor(PLC4_TRANSIT_START_IN_MS / (frame_dms * 1.25)); } - plc_end_inFrames = floor(PLC4_TRANSIT_END_IN_MS / (frame_dms / 10.0)); + plc_end_inFrames = floor(PLC4_TRANSIT_END_IN_MS / (frame_dms * 1.25)); plc_duration_inFrames = plc_end_inFrames - plc_start_inFrames; if (nbLostCmpt <= plc_start_inFrames) diff --git a/lib_lc3plus/plc_main.c b/lib_lc3plus/plc_main.c index 01fe7b237c11233b5d490cb83ad291b016da4560..507e78d128f64a4af3800a9881c471d1e74356d7 100644 --- a/lib_lc3plus/plc_main.c +++ b/lib_lc3plus/plc_main.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.5.1 * +* ETSI TS 103 634 V1.6.1 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -55,23 +55,29 @@ void processPlcMain_fl(LC3_FLOAT *q_d_fl_c, LC3_FLOAT *syntM_fl_c, LC3PLUS_Dec* { switch(decoder->frame_dms) { - case 25: - consecutiveLostThreshold = 16; +#ifdef FIX_ADDITONAL_1p25_ISSUES + case LC3PLUS_FRAME_DURATION_1p25MS: consecutiveLostThreshold = 32; + thresh_tdc_cnt = THRESH_025_DMS_TDC_CNT; + thresh_ns_cnt = THRESH_025_DMS_NS_CNT; + thresh_tdc_ns_cnt = THRESH_025_DMS_TDC_NS_CNT; + break; +#endif + case LC3PLUS_FRAME_DURATION_2p5MS: consecutiveLostThreshold = 16; thresh_tdc_cnt = THRESH_025_DMS_TDC_CNT; thresh_ns_cnt = THRESH_025_DMS_NS_CNT; thresh_tdc_ns_cnt = THRESH_025_DMS_TDC_NS_CNT; break; - case 50: consecutiveLostThreshold = 8; + case LC3PLUS_FRAME_DURATION_5MS: consecutiveLostThreshold = 8; thresh_tdc_cnt = THRESH_050_DMS_TDC_CNT; thresh_ns_cnt = THRESH_050_DMS_NS_CNT; thresh_tdc_ns_cnt = THRESH_050_DMS_TDC_NS_CNT; break; - case 75: consecutiveLostThreshold = 6; + case LC3PLUS_FRAME_DURATION_7p5MS: consecutiveLostThreshold = 6; thresh_tdc_cnt = THRESH_075_DMS_TDC_CNT; thresh_ns_cnt = THRESH_075_DMS_NS_CNT; thresh_tdc_ns_cnt = THRESH_075_DMS_TDC_NS_CNT; break; - case 100: consecutiveLostThreshold = 4; + case LC3PLUS_FRAME_DURATION_10MS: consecutiveLostThreshold = 4; thresh_tdc_cnt = THRESH_100_DMS_TDC_CNT; thresh_ns_cnt = THRESH_100_DMS_NS_CNT; thresh_tdc_ns_cnt = THRESH_100_DMS_TDC_NS_CNT; @@ -98,7 +104,7 @@ void processPlcMain_fl(LC3_FLOAT *q_d_fl_c, LC3_FLOAT *syntM_fl_c, LC3PLUS_Dec* { PlcAdvSetup->plc_fadeout_type = 0; } - if (h_DecSetup->rel_pitch_change > REL_PITCH_THRESH && hrmode == 1 && (decoder->frame_dms == 50 || decoder->frame_dms == 25) ){ + if (h_DecSetup->rel_pitch_change > REL_PITCH_THRESH && hrmode == 1 && (decoder->frame_dms == LC3PLUS_FRAME_DURATION_5MS || decoder->frame_dms == LC3PLUS_FRAME_DURATION_2p5MS) ){ PlcAdvSetup->plc_fadeout_type = 2; } else if ( h_DecSetup->concealMethod != 2 ) { @@ -120,9 +126,9 @@ void processPlcMain_fl(LC3_FLOAT *q_d_fl_c, LC3_FLOAT *syntM_fl_c, LC3PLUS_Dec* assert(decoder->fs_idx == floor(decoder->fs / 10000)); /* phaseECU supports only 10ms framing*/ - assert(PlcSetup->nbLostCmpt != 0 || decoder->frame_dms == 100); + assert(PlcSetup->nbLostCmpt != 0 || decoder->frame_dms == LC3PLUS_FRAME_DURATION_10MS); - if (decoder->frame_dms != 100) + if (decoder->frame_dms != LC3PLUS_FRAME_DURATION_10MS) { /* muting, if frame size changed during phaseECU concealment */ memset(q_d_fl_c, 0, sizeof(LC3_FLOAT) * decoder->frame_length); @@ -262,7 +268,7 @@ void processPlcMain_fl(LC3_FLOAT *q_d_fl_c, LC3_FLOAT *syntM_fl_c, LC3PLUS_Dec* } yLen = MIN(decoder->frame_length, MAX_PLC_LMEM); - if (PlcAdvSetup != NULL && (decoder->frame_dms == 100) && (hrmode == 0)) + if (PlcAdvSetup != NULL && (decoder->frame_dms == LC3PLUS_FRAME_DURATION_10MS) && (hrmode == 0)) { /* BASOP processPLCspec2shape_fx(prev_bfi, bfi, q_old_d_fx, yLen, plcAd->PhECU_oold_grp_shape_fx, plcAd->PhECU_old_grp_shape_fx);*/ plc_phEcu_processPLCspec2shape(prev_bfi_plc2, bfi, q_d_fl_c, yLen, diff --git a/lib_lc3plus/plc_noise_substitution.c b/lib_lc3plus/plc_noise_substitution.c index dc8e4d56fc6d5b7f2d9980ec7fd2c580d35aa3c8..89ae0a5bbe55e481f91811a2ec322d60797782c9 100644 --- a/lib_lc3plus/plc_noise_substitution.c +++ b/lib_lc3plus/plc_noise_substitution.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.5.1 * +* ETSI TS 103 634 V1.6.1 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * diff --git a/lib_lc3plus/plc_phecu_f0_refine_first.c b/lib_lc3plus/plc_phecu_f0_refine_first.c index 7abb19813ca56889a2b025de577738de0f24d9f2..4752591bd6af3dabdfd57d2f0231e6ad74f9d772 100644 --- a/lib_lc3plus/plc_phecu_f0_refine_first.c +++ b/lib_lc3plus/plc_phecu_f0_refine_first.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.5.1 * +* ETSI TS 103 634 V1.6.1 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * diff --git a/lib_lc3plus/plc_phecu_fec_hq.c b/lib_lc3plus/plc_phecu_fec_hq.c index bb7be94bf06ceea303394020cc999654054372eb..3d41a14057b0cf5067cd3de32db490fe169b162f 100644 --- a/lib_lc3plus/plc_phecu_fec_hq.c +++ b/lib_lc3plus/plc_phecu_fec_hq.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.5.1 * +* ETSI TS 103 634 V1.6.1 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * diff --git a/lib_lc3plus/plc_phecu_hq_ecu.c b/lib_lc3plus/plc_phecu_hq_ecu.c index 8b2b981582dce5c62a3048e82145821ccabd6f7b..24da271224d6ba736bc9b0abcb6790cf24e2aa72 100644 --- a/lib_lc3plus/plc_phecu_hq_ecu.c +++ b/lib_lc3plus/plc_phecu_hq_ecu.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.5.1 * +* ETSI TS 103 634 V1.6.1 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * diff --git a/lib_lc3plus/plc_phecu_lf_peak_analysis.c b/lib_lc3plus/plc_phecu_lf_peak_analysis.c index a53b6a4352ffd7d53cb0e48fbcddfe055333b78b..869efb9f3d324180b1ef80ee22004661c7673b49 100644 --- a/lib_lc3plus/plc_phecu_lf_peak_analysis.c +++ b/lib_lc3plus/plc_phecu_lf_peak_analysis.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.5.1 * +* ETSI TS 103 634 V1.6.1 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * diff --git a/lib_lc3plus/plc_phecu_rec_frame.c b/lib_lc3plus/plc_phecu_rec_frame.c index 412c5205ca5a45a2d989a958021b16c8438fd605..cb693fadbbc968832b999c9eca50780865caed0c 100644 --- a/lib_lc3plus/plc_phecu_rec_frame.c +++ b/lib_lc3plus/plc_phecu_rec_frame.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.5.1 * +* ETSI TS 103 634 V1.6.1 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * diff --git a/lib_lc3plus/plc_phecu_setf0hz.c b/lib_lc3plus/plc_phecu_setf0hz.c index c67f96d41028d366871894be7936f5e87fe52602..2f9752e50ee7494f18e6527ce1c7bb2f28f138ac 100644 --- a/lib_lc3plus/plc_phecu_setf0hz.c +++ b/lib_lc3plus/plc_phecu_setf0hz.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.5.1 * +* ETSI TS 103 634 V1.6.1 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * diff --git a/lib_lc3plus/plc_phecu_spec_ana.c b/lib_lc3plus/plc_phecu_spec_ana.c index c8b46309ba6a36d452aa4b1b2781f23f8145dcfb..6e63844ca1f91b55ac27035241dbf28e95c932be 100644 --- a/lib_lc3plus/plc_phecu_spec_ana.c +++ b/lib_lc3plus/plc_phecu_spec_ana.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.5.1 * +* ETSI TS 103 634 V1.6.1 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -473,8 +473,8 @@ static void plc_phEcu_peak_locator_fxlike(const LC3_INT16 *inp, /* i: vector wit { tmp = sub(tmp, 1); } - num_pairs = tmp / 2; // shr(tmp, 1); - n_tail_values = sub(tmp, num_pairs * 2); // shl(num_pairs, 1)); + num_pairs = tmp / 2; + n_tail_values = sub(tmp, num_pairs * 2); /* filter preliminary sign changes into sensitivity filtered sign changes */ diff --git a/lib_lc3plus/plc_phecu_subst_spec.c b/lib_lc3plus/plc_phecu_subst_spec.c index 62a1d4434e8737437bdcbfa55727ca9e59e07006..b65d791d12afc20e3d5b64469389ae3bb959ac22 100644 --- a/lib_lc3plus/plc_phecu_subst_spec.c +++ b/lib_lc3plus/plc_phecu_subst_spec.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.5.1 * +* ETSI TS 103 634 V1.6.1 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -54,7 +54,7 @@ void plc_phEcu_subst_spec(LC3_INT32* plocs, LC3_INT32 n_plocs, LC3_FLOAT* f0est, corr_phase[i] = (LC3_FLOAT)2.0 * (LC3_FLOAT)M_PI_LC3PLUS * (f0est[i]/Lprot)*(LC3_FLOAT)t_adv; } - // EVOLVE PHASE ----------------- + /* EVOLVE PHASE -----------------*/ one_peak_flag_mask = -1; fs_idx = (LC3_INT16)LC3_FLOOR((LC3_FLOAT)Lprot / 160.0); /* aquire, fs_idx for 10 ms frame sizes */ diff --git a/lib_lc3plus/plc_phecu_tba_per_band_gain.c b/lib_lc3plus/plc_phecu_tba_per_band_gain.c index 8bf33b88535a618bcf0a46a73f22533ef9f67172..3d5109f5c722ee4d9c9e4a2447dd20c8e842be53 100644 --- a/lib_lc3plus/plc_phecu_tba_per_band_gain.c +++ b/lib_lc3plus/plc_phecu_tba_per_band_gain.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.5.1 * +* ETSI TS 103 634 V1.6.1 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * diff --git a/lib_lc3plus/plc_phecu_tba_spect_Xavg.c b/lib_lc3plus/plc_phecu_tba_spect_Xavg.c index ca58ade71e7e11e8f2ec7ba230455a157699a188..55e9f577935b2ebf208cf935b9416fb37039aa8a 100644 --- a/lib_lc3plus/plc_phecu_tba_spect_Xavg.c +++ b/lib_lc3plus/plc_phecu_tba_spect_Xavg.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.5.1 * +* ETSI TS 103 634 V1.6.1 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * diff --git a/lib_lc3plus/plc_phecu_tba_trans_dect_gains.c b/lib_lc3plus/plc_phecu_tba_trans_dect_gains.c index 0ea04fe1af96c1fae63a43f9c1f7ec04b3593893..ba41eaeaa575e637dd776cee60294483a810e513 100644 --- a/lib_lc3plus/plc_phecu_tba_trans_dect_gains.c +++ b/lib_lc3plus/plc_phecu_tba_trans_dect_gains.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.5.1 * +* ETSI TS 103 634 V1.6.1 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * diff --git a/lib_lc3plus/plc_phecu_trans_burst_ana_sub.c b/lib_lc3plus/plc_phecu_trans_burst_ana_sub.c index 52bee02583081e61971ef8f5cbfe8735228da4b8..bafa6c5f575bd2cd026e5e85e69fa88e580e4aed 100644 --- a/lib_lc3plus/plc_phecu_trans_burst_ana_sub.c +++ b/lib_lc3plus/plc_phecu_trans_burst_ana_sub.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.5.1 * +* ETSI TS 103 634 V1.6.1 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * diff --git a/lib_lc3plus/plc_tdc.c b/lib_lc3plus/plc_tdc.c index d789a9df29da9f9ffaccb67e18a1d0e9e0d0a2ca..a48371853dff3b52af0d1ef096a591b41a91a7f3 100644 --- a/lib_lc3plus/plc_tdc.c +++ b/lib_lc3plus/plc_tdc.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.5.1 * +* ETSI TS 103 634 V1.6.1 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -19,7 +19,7 @@ static LC3_INT16 TDC_random_short(LC3_INT16 *seed); static LC3_FLOAT TDC_get_gainp(const LC3_FLOAT x[], const LC3_FLOAT y[], LC3_INT32 n); -static LC3_FLOAT TDC_get_gainc(const LC3_FLOAT x[], const LC3_FLOAT y[], const LC3_FLOAT *gain_p, const LC3_INT32 n, const LC3_INT32 frame_dms); +static LC3_FLOAT TDC_get_gainc(const LC3_FLOAT x[], const LC3_FLOAT y[], const LC3_FLOAT *gain_p, const LC3_INT32 n, const LC3PLUS_FrameDuration frame_dms); static void TDC_LPC_synthesis(const LC3_FLOAT a[], LC3_FLOAT x[], LC3_FLOAT y[], LC3_INT32 l, const LC3_FLOAT mem[], LC3_INT32 lpcorder, LC3_FLOAT *buf); static void TDC_LPC_residu(const LC3_FLOAT *a, LC3_FLOAT *x, LC3_FLOAT *y, LC3_INT32 l, LC3_INT32 lpcorder); static void TDC_highPassFiltering(const LC3_INT32 L_buffer, LC3_FLOAT exc2[], const LC3_FLOAT hp_filt[], const LC3_INT32 l_fir_fer); @@ -32,7 +32,23 @@ const LC3_FLOAT TDC_high_32_harm[TDC_L_FIR_HP] = {-0.0053f, -0.0037f, -0.0140f, static void TDC_levinson(LC3_FLOAT *acf, LC3_INT32 len, LC3_FLOAT *out); static void TDC_copyFLOAT(const LC3_FLOAT * X, LC3_FLOAT * Z, LC3_INT32 n); static LC3_FLOAT TDC_dotFLOAT(const LC3_FLOAT * X, const LC3_FLOAT * Y, LC3_INT32 n); -static LC3_FLOAT type_2_alpha_long(LC3_INT32 nbLostFramesInRow, LC3_INT32 frame_dms); +static LC3_FLOAT type_2_alpha_long(LC3_INT32 nbLostFramesInRow, LC3PLUS_FrameDuration frame_dms); +#ifdef FIX_TDC_BURST_ERROR +const LC3_INT32 beforeNextIncArray[5][8] = { + { 0, 0, 0, 0, 0, 0, 0, 1 }, + { 0, 0, 0, 1, 0, 0, 0, 1 }, + { 0, 1, 0, 1, 0, 1, 0, 1 }, + { 0, 1, 1, 1, 0, 1, 1, 1 }, + { 1, 1, 1, 1, 1, 1, 1, 1 } +}; +const LC3_INT32 nextIncArray[5][8] = { + { 1, 0, 0, 0, 0, 0, 0, 0 }, + { 1, 0, 0, 0, 1, 0, 0, 0 }, + { 1, 0, 1, 0, 1, 0, 1, 0 }, + { 1, 0, 1, 1, 1, 0, 1, 1 }, + { 1, 1, 1, 1, 1, 1, 1, 1 } +}; +#else const LC3_INT32 beforeNextIncArray[4][4] = {{0,0,0,1}, {0,1,0,1}, {0,1,1,1}, @@ -41,7 +57,7 @@ const LC3_INT32 nextIncArray[4][4] = {{1,0,0,0}, {1,0,1,0}, {1,0,1,1}, {1,1,1,1}}; - +#endif void processTdcApply_fl(const LC3_INT32 pitch_int, const LC3_FLOAT *preemphFac, const LC3_FLOAT* A, @@ -49,7 +65,7 @@ void processTdcApply_fl(const LC3_INT32 pitch_int, const LC3_FLOAT* pcmbufHist, const LC3_INT32 max_len_pcm_plc, const LC3_INT32 N, - const LC3_INT32 frame_dms, + const LC3PLUS_FrameDuration frame_dms, const LC3_INT32 SampRate, const LC3_INT32 nbLostFramesInRow, const LC3_INT32 overlap, @@ -62,7 +78,7 @@ void processTdcApply_fl(const LC3_INT32 pitch_int, LC3_FLOAT* alpha, LC3_FLOAT* synth , LC3_UINT8 plc_fadeout_type - , LC3_FLOAT* alpha_type_2_table + ,LC3_FLOAT* alpha_type_2_table ) { LC3_FLOAT step, step_n; @@ -87,9 +103,18 @@ void processTdcApply_fl(const LC3_INT32 pitch_int, /* len of synthesized signal */ len = N + overlap; - nbLostCmpt_loc = floor(frame_dms/100.0 * (nbLostFramesInRow - 1) + 1); - frame_dms_idx = frame_dms / 25 - 1; /* 0,1,2,3 */ - nbLostFramesInRow_mod = (nbLostFramesInRow - 1) % 4; + nbLostCmpt_loc = floor(frame_dms*1.25*10/100.0 * (nbLostFramesInRow - 1) + 1); + +#ifdef FIX_TDC_BURST_ERROR + if (frame_dms == 1) + frame_dms_idx = 0; + else + frame_dms_idx = frame_dms / 2; + nbLostFramesInRow_mod = ( nbLostFramesInRow - 1 ) % 8; +#else + frame_dms_idx = frame_dms*1.25*10 / 25 - 1; /* 0,1,2,3 */ + nbLostFramesInRow_mod = (nbLostFramesInRow - 1) % 4; +#endif beforeNextInc = beforeNextIncArray[frame_dms_idx][nbLostFramesInRow_mod]; nextInc = nextIncArray [frame_dms_idx][nbLostFramesInRow_mod]; @@ -245,10 +270,14 @@ void processTdcApply_fl(const LC3_INT32 pitch_int, { switch (frame_dms) { - case 25: *alpha *= PLC34_ATTEN_FAC_025; break; - case 50: *alpha *= PLC34_ATTEN_FAC_025; break; - case 75: *alpha *= PLC34_ATTEN_FAC_075; break; - case 100: *alpha *= PLC34_ATTEN_FAC_100; break; +#ifdef CR9_C_ADD_1p25MS + case LC3PLUS_FRAME_DURATION_1p25MS: *alpha *= PLC34_ATTEN_FAC_0125; break; +#endif + case LC3PLUS_FRAME_DURATION_2p5MS: *alpha *= PLC34_ATTEN_FAC_025; break; + case LC3PLUS_FRAME_DURATION_5MS: *alpha *= PLC34_ATTEN_FAC_025; break; + case LC3PLUS_FRAME_DURATION_7p5MS: *alpha *= PLC34_ATTEN_FAC_075; break; + case LC3PLUS_FRAME_DURATION_10MS: *alpha *= PLC34_ATTEN_FAC_100; break; + case LC3PLUS_FRAME_DURATION_UNDEFINED: assert(0); } } @@ -469,14 +498,14 @@ void processTdcPreemphasis_fl(LC3_FLOAT *in, LC3_FLOAT *pre_emph_factor, LC3_INT } } -void processTdcLpcEstimation_fl(LC3_FLOAT *r, LC3_INT32 fs_idx, LC3_INT32 len, LC3_FLOAT *A, LC3_INT32 frame_dms) +void processTdcLpcEstimation_fl(LC3_FLOAT *r, LC3_INT32 fs_idx, LC3_INT32 len, LC3_FLOAT *A, LC3PLUS_FrameDuration frame_dms) { LC3_INT32 i; const LC3_FLOAT *lpc_array; lpc_array = plc_tdc_lpc_all[fs_idx]; - if (fs_idx == 0 && frame_dms == 25) + if (fs_idx == 0 && frame_dms == LC3PLUS_FRAME_DURATION_2p5MS) { lpc_array = plc_tdc_lpc_8_25ms; } @@ -532,7 +561,7 @@ static LC3_FLOAT TDC_get_gainc( /* output: gain of code const LC3_FLOAT y[], /* input : shifted input signal */ const LC3_FLOAT *gain_p, /* input : gain of pitch */ const LC3_INT32 n, /* input : vector length */ - const LC3_INT32 frame_dms /* input : frame length in dms */ + const LC3PLUS_FrameDuration frame_dms /* input : frame length in dms */ ) { LC3_FLOAT gain_c; @@ -546,7 +575,7 @@ static LC3_FLOAT TDC_get_gainc( /* output: gain of code gain_c += ( x[-i] - *gain_p * y[-i] ) * ( x[-i] - *gain_p * y[-i] ); } - if (frame_dms < 100) + if (frame_dms < LC3PLUS_FRAME_DURATION_10MS) { for (i = 0; i < n; i++) { @@ -777,24 +806,24 @@ static void TDC_levinson(LC3_FLOAT *acf, LC3_INT32 len, LC3_FLOAT *out) } } -static LC3_FLOAT type_2_alpha_long(LC3_INT32 nbLostFramesInRow, LC3_INT32 frame_dms) +static LC3_FLOAT type_2_alpha_long(LC3_INT32 nbLostFramesInRow, LC3PLUS_FrameDuration frame_dms) { - if (nbLostFramesInRow <= 3*100.0/frame_dms){ - return LC3_POW(0.95,(nbLostFramesInRow + (100.0/frame_dms) - 1) * frame_dms/100.0); + if (nbLostFramesInRow <= 3*100.0/(frame_dms*1.25*10)){ + return LC3_POW(0.95,(nbLostFramesInRow + (100.0/(frame_dms*1.25*10)) - 1) * (frame_dms*1.25*10)/100.0); } else { - LC3_INT32 n_shift = (nbLostFramesInRow - 3*100.0/frame_dms) * 50/frame_dms; - return LC3_POW(0.7,(n_shift + 100.0/frame_dms - 1) * frame_dms/100.0); + LC3_INT32 n_shift = (nbLostFramesInRow - 3*100.0/(frame_dms*1.25*10)) * 50/(frame_dms*1.25*10); + return LC3_POW(0.7,(n_shift + 100.0/(frame_dms*1.25*10) - 1) * (frame_dms*1.25*10)/100.0); } } -LC3_FLOAT type_2_fadeout(LC3_INT32 nbLostFramesInRow, LC3_INT32 frame_dms) +LC3_FLOAT type_2_fadeout(LC3_INT32 nbLostFramesInRow, LC3PLUS_FrameDuration frame_dms) { - LC3_FLOAT selector = PLC_FADEOUT_TYPE_2_SELECTOR * 2 * 100/frame_dms; + LC3_FLOAT selector = PLC_FADEOUT_TYPE_2_SELECTOR * 2 * 100/(frame_dms*1.25*10); if (selector >= nbLostFramesInRow){ return type_2_alpha_long(nbLostFramesInRow, frame_dms); } else { - return LC3_POW(0.5,(nbLostFramesInRow + (100.0/frame_dms) - 1) * frame_dms/100.0); + return LC3_POW(0.5,(nbLostFramesInRow + (100.0/(frame_dms*1.25*10)) - 1) * (frame_dms*1.25*10)/100.0); } } diff --git a/lib_lc3plus/plc_tdc_tdac.c b/lib_lc3plus/plc_tdc_tdac.c index 5aa4248bdff0d249c41e1f9f2677a37c41ebc9d9..bcb0e1770fdb9529610ce1772f907b6578d1e4a8 100644 --- a/lib_lc3plus/plc_tdc_tdac.c +++ b/lib_lc3plus/plc_tdc_tdac.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.5.1 * +* ETSI TS 103 634 V1.6.1 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * diff --git a/lib_lc3plus/plc_update.c b/lib_lc3plus/plc_update.c index f45afb40624dcdc007351bdd049de499bdb42aba..1f331c00a46298b52b3ddb85c45dbb2bdfc15bca 100644 --- a/lib_lc3plus/plc_update.c +++ b/lib_lc3plus/plc_update.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.5.1 * +* ETSI TS 103 634 V1.6.1 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * diff --git a/lib_lc3plus/quantize_spec.c b/lib_lc3plus/quantize_spec.c index 568dbe1fe1492a2bd14a7ce7abe58c0f8cb108cd..89aa6b9d2ca60a48f9036d0f296bfc3acd12c7c3 100644 --- a/lib_lc3plus/quantize_spec.c +++ b/lib_lc3plus/quantize_spec.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.5.1 * +* ETSI TS 103 634 V1.6.1 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -231,11 +231,11 @@ void processQuantizeSpec_fl(LC3_FLOAT x[], LC3_FLOAT gain, LC3_INT xq[], LC3_INT c = (c & 15) * 16 + t; } - *nbits = (bits + 2047) >> 11; // Exactly same as ceil((LC3_FLOAT)*nbits / 2048.0); + *nbits = (bits + 2047) >> 11; /* same as ceil((LC3_FLOAT)*nbits / 2048.0);*/ if (mode >= 0) { - *nbits2 = (bits2 + 2047) >> 11; //ceil((LC3_FLOAT)*nbits2 / 2048.0); + *nbits2 = (bits2 + 2047) >> 11; /* ceil((LC3_FLOAT)*nbits2 / 2048.0); */ } else { diff --git a/lib_lc3plus/reorder_bitstream.c b/lib_lc3plus/reorder_bitstream.c index 3ab549d04b3a221233c7a2bc93495cad3725edc9..48254976692f35dca24bc8f7865e79fab05c81ca 100644 --- a/lib_lc3plus/reorder_bitstream.c +++ b/lib_lc3plus/reorder_bitstream.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.5.1 * +* ETSI TS 103 634 V1.6.1 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * diff --git a/lib_lc3plus/resamp12k8.c b/lib_lc3plus/resamp12k8.c index 0909b67b9b5ff83854ca9726073502622b5ead2c..a5847c5e530fe5a7e4bac8433bc1eaf34507d2db 100644 --- a/lib_lc3plus/resamp12k8.c +++ b/lib_lc3plus/resamp12k8.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.5.1 * +* ETSI TS 103 634 V1.6.1 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -12,11 +12,11 @@ #include "functions.h" void process_resamp12k8_fl(LC3_FLOAT x[], LC3_INT x_len, LC3_FLOAT mem_in[], LC3_INT mem_in_len, LC3_FLOAT mem_50[], LC3_FLOAT mem_out[], - LC3_INT mem_out_len, LC3_FLOAT y[], LC3_INT* y_len, LC3_INT fs_idx, LC3_INT frame_dms, LC3_INT fs) + LC3_INT mem_out_len, LC3_FLOAT y[], LC3_INT* y_len, LC3_INT fs_idx, LC3PLUS_FrameDuration frame_dms, LC3_INT fs) { - LC3_INT len_12k8, N12k8, i, k; + LC3_INT len_12k8 = 0, N12k8, i, k; LC3_FLOAT mac, bufdown[128], buf[120 + MAX_LEN]; LC3_INT32 index_int, index_frac, resamp_upfac, resamp_delay, resamp_off_int, resamp_off_frac; LC3_FLOAT u_11, u_21, u_1, u_2; @@ -25,18 +25,25 @@ void process_resamp12k8_fl(LC3_FLOAT x[], LC3_INT x_len, LC3_FLOAT mem_in[], LC3 switch (frame_dms) { - case 25: +#ifdef CR9_C_ADD_1p25MS + case LC3PLUS_FRAME_DURATION_1p25MS: + len_12k8 = LEN_12K8 / 8; + break; +#endif + case LC3PLUS_FRAME_DURATION_2p5MS: len_12k8 = LEN_12K8 / 4; break; - case 50: + case LC3PLUS_FRAME_DURATION_5MS: len_12k8 = LEN_12K8 / 2; break; - case 75: + case LC3PLUS_FRAME_DURATION_7p5MS: len_12k8 = (LEN_12K8 / 4) * 3; break; - case 100: + case LC3PLUS_FRAME_DURATION_10MS: len_12k8 = LEN_12K8; break; + case LC3PLUS_FRAME_DURATION_UNDEFINED: + assert(0); } *y_len = len_12k8; diff --git a/lib_lc3plus/residual_coding.c b/lib_lc3plus/residual_coding.c index 282b7655e7224a021e4727b93291cf1e1dd1be50..1e788723f763f355439e0478df115c99946dea5e 100644 --- a/lib_lc3plus/residual_coding.c +++ b/lib_lc3plus/residual_coding.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.5.1 * +* ETSI TS 103 634 V1.6.1 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -11,13 +11,15 @@ #include "wmc_auto.h" #include "functions.h" -void processResidualCoding_fl(LC3_FLOAT x[], LC3_INT xq[], LC3_FLOAT gain, LC3_INT L_spec, LC3_INT targetBits, LC3_INT nBits, uint8_t* resBits, LC3_INT* numResBits - , LC3_INT hrmode +void processResidualCoding_fl(LC3_FLOAT x[], LC3_INT xq[], LC3_FLOAT gain, LC3_INT L_spec, LC3_INT targetBits, LC3_INT nBits, uint8_t* resBits, LC3_INT* numResBits, LC3_INT hrmode +#ifdef ENABLE_12p5_DMS_MODE + , LC3PLUS_FrameDuration frame_dms +#endif ) { LC3_INT n = 0, m = 0, k = 0; LC3_INT iter=0; - LC3_FLOAT offset; + LC3_FLOAT offset[3]; LC3_INT iter_max = 1; LC3_INT nz_idx[MAX_LEN]; LC3_INT N_nz = 0, idx = 0; @@ -33,12 +35,23 @@ void processResidualCoding_fl(LC3_FLOAT x[], LC3_INT xq[], LC3_FLOAT gain, LC3_I assert(m <= MAX_RESBITS); - offset = .25; + offset[2] = .5; if (hrmode) { iter_max = EXT_RES_ITER_MAX; - } +#ifdef ENABLE_12p5_DMS_MODE + else if (frame_dms == LC3PLUS_FRAME_DURATION_1p25MS) + { + iter_max = 3; + offset[2] = .375; + } +#endif + + /* init offset */ + offset[0] = offset[2] / 2.; + offset[1] = (1.-offset[2]) / 2.; + for (k = 0; k < L_spec; k ++) { if (xq[k]) @@ -56,12 +69,12 @@ void processResidualCoding_fl(LC3_FLOAT x[], LC3_INT xq[], LC3_FLOAT gain, LC3_I if (x[idx] >= (LC3_FLOAT)xq[idx] * gain) { resBits[n >> 3] |= 1 << (n & 7); - x[idx] -= gain * offset; + x[idx] -= gain * offset[x[idx] > 0]; } else { resBits[n >> 3] &= ~(1 << (n & 7)); - x[idx] += gain * offset; + x[idx] += gain * offset[x[idx] < 0]; } n++; @@ -69,7 +82,8 @@ void processResidualCoding_fl(LC3_FLOAT x[], LC3_INT xq[], LC3_FLOAT gain, LC3_I k++; } iter ++; - offset *= .5; + offset[0] *= .5; + offset[1] *= .5; } *numResBits = n; diff --git a/lib_lc3plus/residual_decoding.c b/lib_lc3plus/residual_decoding.c index 9970c094ba7909e664e663491485f2e24331a1d8..dff8bd64d7eb412e067ea63f023d515cebc5f1b4 100644 --- a/lib_lc3plus/residual_decoding.c +++ b/lib_lc3plus/residual_decoding.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.5.1 * +* ETSI TS 103 634 V1.6.1 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -11,8 +11,10 @@ #include "wmc_auto.h" #include "functions.h" -void processResidualDecoding_fl(LC3_INT* bitsRead, LC3_FLOAT x[], LC3_INT L_spec, uint8_t prm[], LC3_INT resQBits - , LC3_INT hrmode +void processResidualDecoding_fl(LC3_INT* bitsRead, LC3_FLOAT x[], LC3_INT L_spec, uint8_t prm[], LC3_INT resQBits, LC3_INT hrmode +#ifdef ENABLE_12p5_DMS_MODE + , LC3PLUS_FrameDuration frame_dms +#endif ) { LC3_INT k = 0, n = 0; @@ -33,9 +35,14 @@ void processResidualDecoding_fl(LC3_INT* bitsRead, LC3_FLOAT x[], LC3_INT L_spec offset1 = 0.1875; offset2 = 0.3125; } - - if (hrmode) + +#ifdef ENABLE_12p5_DMS_MODE + if (frame_dms == LC3PLUS_FRAME_DURATION_1p25MS) { + iter_max = 3; + } +#endif + /* enumerat non-zero coefficients */ for (k = 0; k < L_spec; k ++) { @@ -44,6 +51,10 @@ void processResidualDecoding_fl(LC3_INT* bitsRead, LC3_FLOAT x[], LC3_INT L_spec nz_idx[N_nz ++] = k; } } + + if (hrmode) + { + /* apply residual corrections */ while (n < resQBits && iter < iter_max) { @@ -71,26 +82,35 @@ void processResidualDecoding_fl(LC3_INT* bitsRead, LC3_FLOAT x[], LC3_INT L_spec } else { - while (k < L_spec && n < resQBits) { - if (x[k] != 0) { + UNUSED(offset); + + while (n < resQBits && iter < iter_max) { + for (k = 0; k < N_nz; k ++) + { + idx = nz_idx[k]; + if ((prm[n >> 3] & 1 << (n & 7)) == 0) { - if (x[k] > 0) { - x[k] -= offset1; + if (x[idx] > 0) { + x[idx] -= offset1; } else { - x[k] -= offset2; + x[idx] -= offset2; } } else { - if (x[k] > 0) { - x[k] += offset2; + if (x[idx] > 0) { + x[idx] += offset2; } else { - x[k] += offset1; + x[idx] += offset1; } } - n++; + if (++n >= resQBits) + { + break; + } } - - k++; + offset1 *= 0.5; + offset2 *= 0.5; + iter ++; } } *bitsRead = n; diff --git a/lib_lc3plus/setup_com_lc3plus.c b/lib_lc3plus/setup_com_lc3plus.c index f37af56a3109e415bed3f7d2d49507c99ffa5bed..055b6a0047f7a769857550a7e4fab9ad5a4c3022 100644 --- a/lib_lc3plus/setup_com_lc3plus.c +++ b/lib_lc3plus/setup_com_lc3plus.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.5.1 * +* ETSI TS 103 634 V1.6.1 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -11,6 +11,30 @@ #include "wmc_auto.h" #include "functions.h" +#ifdef FIX_BOTH_1p25_WB_GLOBGAINOFFSET_NONBE +/* tilt factor in gainOffset quantized and adjusted for low Fs and 1p25ms framing */ +LC3_INT16 calc_GGainOffset_1p25(LC3_INT16 total_bits, LC3_INT16 fs_idx) +{ + LC3_INT16 gain_off_tilt_1p25_Q19[6] = { 20480, 17408, 17476, 13107, 10486, 8738 }; /* vector of 1p25 tilts for NB to UB */ + /* Corresponding FLT = gain_off_tilt_1p25 = {0.039062500000000 0.033203125000000 0.033333333333333 0.025000000000000 0.020000000000000 0.016666666666667 }*/ + + + LC3_INT16 tmp1 = (LC3_INT16)( ( ((LC3_INT32)total_bits)*((LC3_INT32)gain_off_tilt_1p25_Q19[fs_idx]) ) >> (3 + 16) ); /*no rounding on purpose */ + LC3_INT16 tmp2 = 105 + 5 * (fs_idx + 1); + + tmp2 = -(MIN(115, tmp1) + tmp2); + +#ifdef FIX_BOTH_1p25_WB_GLOBGAINOFFSET_LOWLIM_NONBE + if (fs_idx <= 1) + { /* only NB and WB additionally limited to -135 */ + tmp2 = MAX(tmp2, FIX_BOTH_1p25_WB_GLOBGAINOFFSET_LOWLIM_NONBE); + } +#endif + + return tmp2; +} +#endif + LC3_FLOAT array_max_abs(LC3_FLOAT *in, LC3_INT32 len) { LC3_FLOAT max; diff --git a/lib_lc3plus/setup_dec_lc3plus.c b/lib_lc3plus/setup_dec_lc3plus.c index 9e9a5ea64e021c3669e4b439ac19bd22f9f1c43c..67a86bb027eb4a3076f539305382696034b69da4 100644 --- a/lib_lc3plus/setup_dec_lc3plus.c +++ b/lib_lc3plus/setup_dec_lc3plus.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.5.1 * +* ETSI TS 103 634 V1.6.1 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -34,7 +34,7 @@ int alloc_decoder(LC3PLUS_Dec* decoder, int samplerate, int channels) HANDLE_IIS_FFT handle_fft_phaseecu; HANDLE_IIS_FFT handle_ifft_phaseecu; LC3_FLOAT *q_old_res; - + LC3_INT32 * plc_longterm_advc_tdc = NULL, *plc_longterm_advc_ns = NULL; LC3_INT16 longterm_analysis_counter_max = 0, longterm_analysis_counter_max_bytebuffer = 0; @@ -51,16 +51,16 @@ int alloc_decoder(LC3PLUS_Dec* decoder, int samplerate, int channels) PhECU_xfp = balloc(decoder, &size, sizeof(LC3_FLOAT) *(frame_len * 16 / 10)); PhECU_X_sav_m = balloc(decoder, &size, sizeof(Complex) *(((frame_len * 16 / 10) / 2) + 1));/*MAX_PLC_LMSPEC*/ PhECU_plocs = balloc(decoder, &size, sizeof(LC3_INT32) * (((frame_len * 16 / 10) / 4) + 1 + 1)); /* BASOP Word16 *PhECU_plocs; */ - + handle_fft_phaseecu = balloc(decoder, &size, sizeof(IIS_FFT) * 1); handle_ifft_phaseecu = balloc(decoder, &size, sizeof(IIS_FFT) * 1); PhECU_f0est = balloc(decoder, &size, sizeof(LC3_FLOAT) * (((frame_len * 16 / 10) / 4) + 1)); /*BASOP Word32 *PhECU_f0est;*/ PhECU_mag_chg_1st = balloc(decoder, &size, sizeof(LC3_FLOAT) *MAX_LGW); /* BASOP Word16 PhECU_mag_chg_1st[MAX_LGW];*/ PhECU_Xavg = balloc(decoder, &size, sizeof(LC3_FLOAT) * MAX_LGW); /* BASOP Word16 PhECU_Xavg[MAX_LGW] ; */ - + sine_table1_phecu = balloc(decoder, &size, sizeof(LC3_FLOAT) * (((CODEC_FS(samplerate) * 16) / 1000) / 2 + 1)); sine_table2_phecu = balloc(decoder, &size, sizeof(LC3_FLOAT) * (((CODEC_FS(samplerate) * 16) / 1000) / 2 + 1)); - + longterm_analysis_counter_max = plc_fadeout_param_maxlen[0]; longterm_analysis_counter_max_bytebuffer = plc_fadeout_param_maxbytes[0]; @@ -71,6 +71,16 @@ int alloc_decoder(LC3PLUS_Dec* decoder, int samplerate, int channels) if (decoder) { decoder->channel_setup[ch] = setup; +#ifdef CR9_C_ADD_1p25MS + setup->ltpf_mem_continuation = 0; +#ifdef FIX_TX_RX_STRUCT_STEREO + setup->ltpf_rx_status[0] = 0; + setup->ltpf_rx_status[1] = 0; +#endif +#ifdef NEW_SIGNALLING_SCHEME_1p25 + setup->ltpfinfo_frame_cntr = -32768; +#endif +#endif setup->PlcAdvSetup = PlcAdvSetup; @@ -86,16 +96,16 @@ int alloc_decoder(LC3PLUS_Dec* decoder, int samplerate, int channels) setup->PlcAdvSetup->PlcPhEcuSetup.PhECU_Xavg = PhECU_Xavg; setup->PlcAdvSetup->PlcPhEcuSetup.handle_fft_phaseecu = handle_fft_phaseecu; setup->PlcAdvSetup->PlcPhEcuSetup.handle_ifft_phaseecu = handle_ifft_phaseecu; - + setup->PlcAdvSetup->PlcPhEcuSetup.handle_fft_phaseecu->sine_table = sine_table1_phecu; setup->PlcAdvSetup->PlcPhEcuSetup.handle_ifft_phaseecu->sine_table = sine_table2_phecu; - + setup->PlcAdvSetup->longterm_analysis_counter_max = longterm_analysis_counter_max; setup->PlcAdvSetup->longterm_analysis_counter_max_bytebuffer = longterm_analysis_counter_max_bytebuffer; - + setup->PlcAdvSetup->plc_longterm_advc_tdc = plc_longterm_advc_tdc; setup->PlcAdvSetup->plc_longterm_advc_ns = plc_longterm_advc_ns; - + setup->PlcAdvSetup->PlcPhEcuSetup.PhECU_Lprot = (CODEC_FS(samplerate) * 16) / 1000; real_fft_init(&(setup->PlcAdvSetup->PlcPhEcuSetup.PhEcu_Fft), setup->PlcAdvSetup->PlcPhEcuSetup.PhECU_Lprot, &(setup->PlcAdvSetup->PlcPhEcuSetup.handle_fft_phaseecu)); real_ifft_init(&(setup->PlcAdvSetup->PlcPhEcuSetup.PhEcu_Ifft), setup->PlcAdvSetup->PlcPhEcuSetup.PhECU_Lprot, &(setup->PlcAdvSetup->PlcPhEcuSetup.handle_ifft_phaseecu)); @@ -117,14 +127,14 @@ LC3PLUS_Error FillDecSetup(LC3PLUS_Dec* decoder, int samplerate, int channels, L decoder->fs_out = samplerate; decoder->fs_idx = FS2FS_IDX(decoder->fs); decoder->plcMeth = plc_mode; - + decoder->hrmode = hrmode != 0; decoder->channels = channels; - decoder->frame_ms = 10; - decoder->frame_dms = 100; + decoder->frame_ms = LC3PLUS_FRAME_DURATION_10MS; + decoder->frame_dms = LC3PLUS_FRAME_DURATION_10MS; decoder->BW_cutoff_bits = BW_cutoff_bits_all[decoder->fs_idx]; - + if (decoder->fs == 8000) { decoder->tilt = 14; } else if (decoder->fs == 16000) { @@ -143,14 +153,14 @@ LC3PLUS_Error FillDecSetup(LC3PLUS_Dec* decoder, int samplerate, int channels, L set_dec_frame_params(decoder); lc3plus_dec_set_ep_enabled(decoder, 0); - + return LC3PLUS_OK; } /* set frame config params */ void set_dec_frame_params(LC3PLUS_Dec* decoder) { - int ch = 0; + int ch = 0, idx = 0; int n; if (decoder->fs_idx == 5) @@ -168,34 +178,66 @@ void set_dec_frame_params(LC3PLUS_Dec* decoder) decoder->yLen = MIN(MAX_BW, decoder->frame_length); } +#ifndef FIX_TX_RX_STRUCT_STEREO + decoder->ltpf_rx_status[0] = 0; + decoder->ltpf_rx_status[1] = 0; +#endif + decoder->bands_number = 64; - if (decoder->frame_ms == 2.5) +#ifdef CR9_C_ADD_1p25MS + if (decoder->frame_ms == LC3PLUS_FRAME_DURATION_1p25MS) + { + decoder->frame_length = decoder->frame_length >> 3; + decoder->yLen /= 8; + + if (decoder->hrmode) + { + assert(0); + } + else + { + decoder->bands_number = bands_number_1_25ms[decoder->fs_idx]; + } + + decoder->bands_offset = ACC_COEFF_PER_BAND_1_25ms[decoder->fs_idx]; + decoder->BW_cutoff_bits = 0; + decoder->cutoffBins = BW_cutoff_bin_all_1_25ms; + + decoder->imdct_win = MDCT_WINS_1_25ms[decoder->hrmode][decoder->fs_idx]; + decoder->imdct_laZeros = MDCT_la_zeroes_1_25ms[decoder->fs_idx]; + decoder->imdct_winLen = MDCT_WINDOWS_LENGTHS_1_25ms[decoder->fs_idx]; + + decoder->bands_offsetPLC = ACC_COEFF_PER_BAND_PLC_1_25ms[decoder->fs_idx]; + decoder->n_bandsPLC = decoder->frame_length; + } +#endif + if (decoder->frame_ms == LC3PLUS_FRAME_DURATION_2p5MS) { decoder->frame_length = decoder->frame_length >> 2; decoder->yLen /= 4; if (decoder->hrmode) { decoder->bands_number = bands_number_2_5ms_HR[decoder->fs_idx]; - } + } else { decoder->bands_number = bands_number_2_5ms[decoder->fs_idx]; } } - if (decoder->frame_ms == 5) + if (decoder->frame_ms == LC3PLUS_FRAME_DURATION_5MS) { decoder->frame_length = decoder->frame_length >> 1; decoder->yLen /= 2; decoder->bands_number = bands_number_5ms[decoder->fs_idx]; } - if (decoder->frame_ms == 7.5) + if (decoder->frame_ms == LC3PLUS_FRAME_DURATION_7p5MS) { decoder->frame_length = (decoder->frame_length >> 2) * 3; - decoder->yLen = (decoder->yLen / 4) * 3; + decoder->yLen = (decoder->yLen / 4) * 3; if (decoder->hrmode) { decoder->bands_number = bands_number_7_5ms_HR[decoder->fs_idx]; - } + } else { decoder->bands_number = bands_number_7_5ms[decoder->fs_idx]; @@ -206,12 +248,18 @@ void set_dec_frame_params(LC3PLUS_Dec* decoder) { decoder->BW_cutoff_bits = 0; } +#ifdef CR9_C_ADD_1p25MS + else if (decoder->frame_ms == LC3PLUS_FRAME_DURATION_1p25MS) + { + decoder->BW_cutoff_bits = 0; + } +#endif else { decoder->BW_cutoff_bits = BW_cutoff_bits_all[decoder->fs_idx]; } - if (decoder->frame_ms == 10) + if (decoder->frame_ms == LC3PLUS_FRAME_DURATION_10MS) { if (decoder->hrmode) { @@ -223,7 +271,7 @@ void set_dec_frame_params(LC3PLUS_Dec* decoder) } decoder->cutoffBins = BW_cutoff_bin_all; } - else if (decoder->frame_ms == 2.5) + else if (decoder->frame_ms == LC3PLUS_FRAME_DURATION_2p5MS) { if (decoder->hrmode) { @@ -235,7 +283,7 @@ void set_dec_frame_params(LC3PLUS_Dec* decoder) } decoder->cutoffBins = BW_cutoff_bin_all_2_5ms; } - else if (decoder->frame_ms == 5) + else if (decoder->frame_ms == LC3PLUS_FRAME_DURATION_5MS) { if (decoder->hrmode) { @@ -247,7 +295,7 @@ void set_dec_frame_params(LC3PLUS_Dec* decoder) } decoder->cutoffBins = BW_cutoff_bin_all_5ms; } - else if (decoder->frame_ms == 7.5) + else if (decoder->frame_ms == LC3PLUS_FRAME_DURATION_7p5MS) { if (decoder->hrmode) { @@ -259,14 +307,14 @@ void set_dec_frame_params(LC3PLUS_Dec* decoder) } decoder->cutoffBins = BW_cutoff_bin_all_7_5ms; } - + decoder->n_bandsPLC = MIN(decoder->frame_length, 80); - - if (decoder->frame_ms == 10) + + if (decoder->frame_ms == LC3PLUS_FRAME_DURATION_10MS) { decoder->bands_offsetPLC = ACC_COEFF_PER_BAND_PLC[decoder->fs_idx]; } - else if (decoder->frame_ms == 5) + else if (decoder->frame_ms == LC3PLUS_FRAME_DURATION_5MS) { decoder->bands_offsetPLC = ACC_COEFF_PER_BAND_PLC_5ms[decoder->fs_idx]; @@ -275,7 +323,7 @@ void set_dec_frame_params(LC3PLUS_Dec* decoder) decoder->n_bandsPLC = 40; } } - else if (decoder->frame_ms == 2.5) + else if (decoder->frame_ms == LC3PLUS_FRAME_DURATION_2p5MS) { decoder->bands_offsetPLC = ACC_COEFF_PER_BAND_PLC_2_5ms[decoder->fs_idx]; @@ -284,38 +332,56 @@ void set_dec_frame_params(LC3PLUS_Dec* decoder) decoder->n_bandsPLC = 60; } } - else if (decoder->frame_ms == 7.5) +#ifdef CR9_C_ADD_1p25MS + else if (decoder->frame_ms == LC3PLUS_FRAME_DURATION_1p25MS) + { + decoder->bands_offsetPLC = ACC_COEFF_PER_BAND_PLC_1_25ms[decoder->fs_idx]; + + if (decoder->fs == 48000) + { + decoder->n_bandsPLC = 60; + } + } +#endif + else if (decoder->frame_ms == LC3PLUS_FRAME_DURATION_7p5MS) { decoder->bands_offsetPLC = ACC_COEFF_PER_BAND_PLC_7_5ms[decoder->fs_idx]; - + if (decoder->fs != 32000 && decoder->fs != 96000) { decoder->n_bandsPLC = 60; } } - + assert(decoder->bands_offsetPLC); - if (decoder->frame_ms == 10) { + if (decoder->frame_ms == LC3PLUS_FRAME_DURATION_10MS) { decoder->imdct_win = MDCT_WINS_10ms[decoder->hrmode][decoder->fs_idx]; decoder->imdct_laZeros = MDCT_la_zeroes[decoder->fs_idx]; decoder->imdct_winLen = MDCT_WINDOWS_LENGTHS_10ms[decoder->fs_idx]; } - else if (decoder->frame_ms == 2.5) { + else if (decoder->frame_ms == LC3PLUS_FRAME_DURATION_2p5MS) { decoder->imdct_win = MDCT_WINS_2_5ms[decoder->hrmode][decoder->fs_idx]; decoder->imdct_laZeros = MDCT_la_zeroes_2_5ms[decoder->fs_idx]; decoder->imdct_winLen = MDCT_WINDOWS_LENGTHS_2_5ms[decoder->fs_idx]; } - else if (decoder->frame_ms == 5) { + else if (decoder->frame_ms == LC3PLUS_FRAME_DURATION_5MS) { decoder->imdct_win = MDCT_WINS_5ms[decoder->hrmode][decoder->fs_idx]; decoder->imdct_laZeros = MDCT_la_zeroes_5ms[decoder->fs_idx]; decoder->imdct_winLen = MDCT_WINDOWS_LENGTHS_5ms[decoder->fs_idx]; } - else if (decoder->frame_ms == 7.5) { + else if (decoder->frame_ms == LC3PLUS_FRAME_DURATION_7p5MS) { decoder->imdct_win = MDCT_WINS_7_5ms[decoder->hrmode][decoder->fs_idx]; decoder->imdct_laZeros = MDCT_la_zeroes_7_5ms[decoder->fs_idx]; decoder->imdct_winLen = MDCT_WINDOWS_LENGTHS_7_5ms[decoder->fs_idx]; } +#ifdef CR9_C_ADD_1p25MS + else if (decoder->frame_ms == LC3PLUS_FRAME_DURATION_1p25MS) { + decoder->imdct_win = MDCT_WINS_1_25ms[decoder->hrmode][decoder->fs_idx]; + decoder->imdct_laZeros = MDCT_la_zeroes_1_25ms[decoder->fs_idx]; + decoder->imdct_winLen = MDCT_WINDOWS_LENGTHS_1_25ms[decoder->fs_idx]; + } +#endif decoder->la_zeroes = decoder->imdct_laZeros; @@ -323,9 +389,9 @@ void set_dec_frame_params(LC3PLUS_Dec* decoder) for (ch = 0; ch < decoder->channels; ch++) { DecSetup* setup = decoder->channel_setup[ch]; - + setup->ltpf_mem_beta_idx = -1; - + setup->statePC.seed = 24607; if (decoder) { @@ -336,7 +402,7 @@ void set_dec_frame_params(LC3PLUS_Dec* decoder) } else { dct4_init(&setup->dct4structImdct, decoder->frame_length); } - + setup->PlcNsSetup.cum_alpha = 1; setup->PlcNsSetup.seed = 24607; setup->alpha = 1; @@ -344,14 +410,14 @@ void set_dec_frame_params(LC3PLUS_Dec* decoder) { LC3_INT32 pitch_max = 0, pitch_ana_len = 0, tdc_synt_len = 0; pitch_max = ceil(228.0 * (LC3_FLOAT) decoder->fs / 12800.0); - pitch_ana_len = pitch_max + decoder->frame_length * (LC3_FLOAT) 100 / decoder->frame_dms; + pitch_ana_len = pitch_max + decoder->frame_length * (LC3_FLOAT) 100 / (decoder->frame_dms * 1.25 * 10); tdc_synt_len = 16 + 1 + pitch_max + ceil(decoder->frame_length / 2); setup->PlcAdvSetup->max_len_pcm_plc = MAX(pitch_ana_len, tdc_synt_len); setup->PlcAdvSetup->PlcTdcSetup.preemphFac = plc_preemph_fac[decoder->fs_idx]; setup->PlcAdvSetup->PlcTdcSetup.seed = 24607; setup->PlcAdvSetup->PlcTdcSetup.lpcorder = 16; - if (decoder->fs_idx == 0 && decoder->frame_dms == 25) + if ((decoder->fs_idx == 0 || decoder->frame_length <= 20) && decoder->frame_dms <= LC3PLUS_FRAME_DURATION_2p5MS) { setup->PlcAdvSetup->PlcTdcSetup.lpcorder = 8; } @@ -360,11 +426,12 @@ void set_dec_frame_params(LC3PLUS_Dec* decoder) setup->PlcAdvSetup->cum_fading_fast = 1; setup->PlcAdvSetup->cum_fading_slow = 1; setup->PlcAdvSetup->cum_fflcAtten = 1; - - setup->PlcAdvSetup->longterm_analysis_counter_max = plc_fadeout_param_maxlen[(decoder->frame_dms / 25) - 1]; - setup->PlcAdvSetup->longterm_analysis_counter_max_bytebuffer = plc_fadeout_param_maxbytes[(decoder->frame_dms / 25) - 1]; - if (decoder->fs_idx <= 4 && decoder->frame_dms == 100) + idx = (decoder->frame_dms * 1.25 * 10 / 25) - 1; + setup->PlcAdvSetup->longterm_analysis_counter_max = plc_fadeout_param_maxlen[idx]; + setup->PlcAdvSetup->longterm_analysis_counter_max_bytebuffer = plc_fadeout_param_maxbytes[idx]; + + if (decoder->fs_idx <= 4 && decoder->frame_dms == LC3PLUS_FRAME_DURATION_10MS) { setup->PlcAdvSetup->PlcPhEcuSetup.PhECU_Lprot = (decoder->fs * 16) / 1000; /* 16 ms of samples at fs*/ @@ -386,7 +453,7 @@ void set_dec_frame_params(LC3PLUS_Dec* decoder) setup->PlcAdvSetup->PlcPhEcuSetup.PhECU_beta_mute = (16384.0/32768.0); setup->PlcAdvSetup->PlcPhEcuSetup.PhECU_seed = 21845; - assert(decoder->frame_dms == 100); + assert(decoder->frame_dms == LC3PLUS_FRAME_DURATION_10MS); setup->PlcAdvSetup->PlcPhEcuSetup.PhECU_LDWIN_OLAP = (decoder->frame_length / 4 ); /* 2.5 ms for regular 10 ms MDCT */ setup->PlcAdvSetup->PlcPhEcuSetup.PhECU_t_adv = ( @@ -400,9 +467,9 @@ void set_dec_frame_params(LC3PLUS_Dec* decoder) } } } - for (n=0; n < LC3_ROUND(PLC_FADEOUT_TYPE_1_IN_MS*10/decoder->frame_dms);n++){ + for (n=0; n < LC3_ROUND(PLC_FADEOUT_TYPE_1_IN_MS*10/(decoder->frame_dms*1.25*10));n++){ decoder->alpha_type_2_table[n] = type_2_fadeout(n, decoder->frame_dms); - } + } } LC3PLUS_Error update_dec_bitrate(LC3PLUS_Dec* decoder, int ch, int nBytes) @@ -414,19 +481,26 @@ LC3PLUS_Error update_dec_bitrate(LC3PLUS_Dec* decoder, int ch, int nBytes) { switch (decoder->frame_dms) { - case 25: +#ifdef CR9_C_ADD_1p25MS + case LC3PLUS_FRAME_DURATION_1p25MS: + assert(0); + maxBytes = 210; + minBytes = MIN_NBYTES; + break; +#endif + case LC3PLUS_FRAME_DURATION_2p5MS: maxBytes = 210; minBytes = MIN_NBYTES; break; - case 50: + case LC3PLUS_FRAME_DURATION_5MS: maxBytes = 375; minBytes = MIN_NBYTES; break; - case 75: + case LC3PLUS_FRAME_DURATION_7p5MS: maxBytes = 625; minBytes = MIN_NBYTES; - break; - case 100: + break; + case LC3PLUS_FRAME_DURATION_10MS: maxBytes = 625; minBytes = MIN_NBYTES; break; @@ -437,7 +511,7 @@ LC3PLUS_Error update_dec_bitrate(LC3PLUS_Dec* decoder, int ch, int nBytes) else { minBytes = MIN_NBYTES; - maxBytes = MAX_NBYTES_100; /* for backward compatibility, MAX_NBYTES_100 is used for all frame lengths */ + maxBytes = MAX_NBYTES_100; /* for backward compatibility, MAX_NBYTES_100 is used for all frame lengths */ } channel_bytes = nBytes; @@ -448,12 +522,25 @@ LC3PLUS_Error update_dec_bitrate(LC3PLUS_Dec* decoder, int ch, int nBytes) { return LC3PLUS_NUMBYTES_ERROR; } - + setup->targetBytes = channel_bytes; setup->total_bits = setup->targetBytes << 3; setup->enable_lpc_weighting = (setup->total_bits < 480); + +#ifdef FIX_BOTH_1p25_WB_GLOBGAINOFFSET_NONBE + if (decoder->frame_dms == LC3PLUS_FRAME_DURATION_1p25MS) + { + setup->quantizedGainOff = calc_GGainOffset_1p25(setup->total_bits, decoder->fs_idx); /* enc/dec common function */ + } + else + { + setup->quantizedGainOff = + -(MIN(115, setup->total_bits / (10 * (decoder->fs_idx + 1))) + 105 + 5 * (decoder->fs_idx + 1)); + } +#else setup->quantizedGainOff = -(MIN(115, setup->total_bits / (10 * (decoder->fs_idx + 1))) + 105 + 5 * (decoder->fs_idx + 1)); +#endif if (decoder->hrmode && decoder->fs_idx == 5) { @@ -461,22 +548,28 @@ LC3PLUS_Error update_dec_bitrate(LC3PLUS_Dec* decoder, int ch, int nBytes) } totalBits = setup->total_bits; - - if (decoder->frame_ms == 2.5) { + +#ifdef CR9_C_ADD_1p25MS + if (decoder->frame_ms == LC3PLUS_FRAME_DURATION_1p25MS) { + setup->enable_lpc_weighting = setup->total_bits < 60; + totalBits = setup->total_bits * 8.0 * 0.42; + } +#endif + if (decoder->frame_ms == LC3PLUS_FRAME_DURATION_2p5MS) { setup->enable_lpc_weighting = setup->total_bits < 120; totalBits = setup->total_bits * 4.0 * (1.0 - 0.4); } - if (decoder->frame_ms == 5) { + if (decoder->frame_ms == LC3PLUS_FRAME_DURATION_5MS) { setup->enable_lpc_weighting = (setup->total_bits < 240); totalBits = setup->total_bits * 2 - 160; } - if (decoder->frame_ms == 7.5) { + if (decoder->frame_ms == LC3PLUS_FRAME_DURATION_7p5MS) { setup->enable_lpc_weighting = (setup->total_bits < 360); totalBits = round(setup->total_bits * 10 / 7.5); } - - if (decoder->frame_length > 40 * ((LC3_FLOAT) (decoder->frame_dms) / 10.0)) { - setup->N_red_tns = 40 * ((LC3_FLOAT) (decoder->frame_dms) / 10.0); + + if (decoder->frame_length > 40 * ((LC3_FLOAT) (decoder->frame_dms * 1.25 * 10) / 10.0)) { + setup->N_red_tns = 40 * ((LC3_FLOAT) (decoder->frame_dms * 1.25 * 10) / 10.0); setup->fs_red_tns = 40000; } else { setup->N_red_tns = decoder->frame_length; @@ -484,29 +577,48 @@ LC3PLUS_Error update_dec_bitrate(LC3PLUS_Dec* decoder, int ch, int nBytes) } bitsTmp = totalBits; - + if (bitsTmp < 400 + (decoder->fs_idx - 1) * 80) { setup->ltpf_conf_beta = 0.4; setup->ltpf_conf_beta_idx = 0; +#ifdef CR9_C_ADD_1p25MS + setup->ltpf_conf_beta_max = 0.6; +#endif } else if (bitsTmp < 480 + (decoder->fs_idx - 1) * 80) { setup->ltpf_conf_beta = 0.35; setup->ltpf_conf_beta_idx = 1; +#ifdef CR9_C_ADD_1p25MS + setup->ltpf_conf_beta_max = 0.55; +#endif } else if (bitsTmp < 560 + (decoder->fs_idx - 1) * 80) { setup->ltpf_conf_beta = 0.3; setup->ltpf_conf_beta_idx = 2; +#ifdef CR9_C_ADD_1p25MS + setup->ltpf_conf_beta_max = 0.5; +#endif } else if (bitsTmp < 640 + (decoder->fs_idx - 1) * 80) { setup->ltpf_conf_beta = 0.25; setup->ltpf_conf_beta_idx = 3; +#ifdef CR9_C_ADD_1p25MS + setup->ltpf_conf_beta_max = 0.45; +#endif } else { setup->ltpf_conf_beta = 0; setup->ltpf_conf_beta_idx = -1; +#ifdef CR9_C_ADD_1p25MS + setup->ltpf_conf_beta_max = 0; +#endif } +#ifdef CR9_C_ADD_1p25MS + setup->ltpf_gain_step = ( setup->ltpf_conf_beta_max - setup->ltpf_conf_beta ) / LTPF_ADAPTIVE_GAIN_RATE; +#endif + /* No LTPF in hrmode */ if (decoder->hrmode == 1) { setup->ltpf_conf_beta = 0; setup->ltpf_conf_beta_idx = -1; } - + return LC3PLUS_OK; } diff --git a/lib_lc3plus/setup_dec_lc3plus.h b/lib_lc3plus/setup_dec_lc3plus.h index c3d26ee8ebe8f0b9ab46380ed6d620d7577ee9d3..5dd3e676136aa9b5e94bb12725306aec94f3382c 100644 --- a/lib_lc3plus/setup_dec_lc3plus.h +++ b/lib_lc3plus/setup_dec_lc3plus.h @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.5.1 * +* ETSI TS 103 634 V1.6.1 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -13,6 +13,7 @@ #include "options.h" #include "wmc_auto.h" #include "constants.h" +#include "lc3plus.h" /* Channel state and bitrate-derived values go in this struct */ typedef struct { @@ -38,6 +39,24 @@ typedef struct { LC3_INT scf_idx[SCF_MAX_PARAM]; uint8_t resBits[MAX_RESBITS_LEN]; LC3_INT tns_idx[TNS_NUMFILTERS_MAX * MAXLAG]; +#ifdef CR9_C_ADD_1p25MS + /* 1.25 continuation */ + LC3_INT16 ltpf_mem_continuation; + LC3_INT32 ltpf_param_mem_prev[3]; + LC3_INT16 ltpf_mem_pitch_prev; + LC3_INT16 ltpf_mem_pitch_fr_prev; + LC3_INT32 ltpf_mem_beta_idx_prev; + LC3_FLOAT ltpf_conf_beta_max; + LC3_INT16 ltpf_pitch_stability_counter; + LC3_FLOAT ltpf_gain_step; + LC3_FLOAT ltpf_mem_gain_prev; +#ifdef FIX_TX_RX_STRUCT_STEREO + LC3_INT32 ltpf_rx_status[2]; +#endif +#ifdef NEW_SIGNALLING_SCHEME_1p25 + LC3_INT32 ltpfinfo_frame_cntr; /* individual cntr for each channel */ +#endif +#endif LC3_FLOAT prev_fac_ns; LC3_FLOAT ltpf_mem_x[3 * MAX_LEN]; @@ -62,7 +81,7 @@ typedef struct { /* Constants and sampling rate derived values go in this struct */ struct LC3PLUS_Dec { - LC3_FLOAT alpha_type_2_table[PLC_FADEOUT_TYPE_1_IN_MS*10/25]; /* [80] */ + LC3_FLOAT alpha_type_2_table[PLC_FADEOUT_TYPE_1_IN_MS*100/125]; /* [160] */ DecSetup* channel_setup[MAX_CHANNELS]; const LC3_INT* W_fx; const LC3_INT* bands_offset; @@ -73,8 +92,8 @@ struct LC3PLUS_Dec { LC3_INT fs_idx; /* sampling rate index */ LC3_INT frame_length; /* sampling rate index */ LC3_INT channels; /* number of channels */ - LC3_FLOAT frame_ms; /* frame length in ms (wrong for 44.1) */ - LC3_INT frame_dms; /* frame length in ms * 10 (wrong for 44.1) */ + LC3PLUS_FrameDuration frame_ms; /* frame length in ms (wrong for 44.1) */ + LC3PLUS_FrameDuration frame_dms; /* frame length in ms * 10 (wrong for 44.1) */ LC3_INT last_size; /* size of last frame, without error protection */ LC3_INT ep_enabled; /* error protection enabled */ LC3_INT error_report; /* corrected errors in last frame or -1 on error */ @@ -109,6 +128,9 @@ struct LC3PLUS_Dec { int epmr; LC3_INT16 combined_channel_coding; int last_error; +#ifndef FIX_TX_RX_STRUCT_STEREO + LC3_INT ltpf_rx_status[2]; +#endif }; #endif diff --git a/lib_lc3plus/setup_enc_lc3plus.c b/lib_lc3plus/setup_enc_lc3plus.c index 80bd909ab3268179e74cc61bf9c09e5223c570dc..438a721d061ee358695a07e550a8a641e15f535b 100644 --- a/lib_lc3plus/setup_enc_lc3plus.c +++ b/lib_lc3plus/setup_enc_lc3plus.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.5.1 * +* ETSI TS 103 634 V1.6.1 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -41,7 +41,7 @@ LC3PLUS_Error FillEncSetup(LC3PLUS_Enc* encoder, int samplerate, int channels encoder->fs = CODEC_FS(samplerate); encoder->fs_in = samplerate; encoder->fs_idx = FS2FS_IDX(encoder->fs); - encoder->frame_dms = 100; + encoder->frame_dms = LC3PLUS_FRAME_DURATION_10MS; if (encoder->fs_idx > 4) { encoder->fs_idx = 5; @@ -50,7 +50,7 @@ LC3PLUS_Error FillEncSetup(LC3PLUS_Enc* encoder, int samplerate, int channels encoder->hrmode = hrmode != 0; encoder->channels = channels; - encoder->frame_ms = 10; + encoder->frame_ms = LC3PLUS_FRAME_DURATION_10MS; encoder->envelope_bits = 38; encoder->global_gain_bits = 8; encoder->noise_fac_bits = 3; @@ -97,6 +97,15 @@ void set_enc_frame_params(LC3PLUS_Enc* encoder) int ch = 0; EncSetup* setup; +#ifdef CR9_C_ADD_1p25MS +#ifndef FIX_TX_RX_STRUCT_STEREO + encoder->Tx_ltpf = 0; +#endif +#endif +#ifdef FIX_FLOAT_LT_NORMCORR_INIT + encoder->long_term_norm_corr= (0xFFFF >> 2)/32768.0; +#endif + encoder->frame_length = ceil(encoder->fs * 10 / 1000); /* fs * 0.01*2^6 */ if (encoder->hrmode == 1) { @@ -129,7 +138,7 @@ void set_enc_frame_params(LC3PLUS_Enc* encoder) encoder->BW_cutoff_bits = BW_cutoff_bits_all[encoder->fs_idx]; } - if (encoder->frame_ms == 10) { + if (encoder->frame_ms == LC3PLUS_FRAME_DURATION_10MS) { encoder->la_zeroes = MDCT_la_zeroes[encoder->fs_idx]; if (encoder->hrmode) { @@ -145,7 +154,7 @@ void set_enc_frame_params(LC3PLUS_Enc* encoder) encoder->attdec_damping = 0.5; encoder->attdec_hangover_thresh = 2; } - else if (encoder->frame_ms == 7.5) { + else if (encoder->frame_ms == LC3PLUS_FRAME_DURATION_7p5MS) { if (encoder->hrmode) { encoder->bands_offset = ACC_COEFF_PER_BAND_7_5ms_HR[encoder->fs_idx]; @@ -176,7 +185,7 @@ void set_enc_frame_params(LC3PLUS_Enc* encoder) encoder->near_nyquist_index = encoder->bands_number - 4; encoder->r12k8_mem_out_len = ceil(2.0 * ((LC3_FLOAT) encoder->frame_length / 2.0 - (LC3_FLOAT) encoder->la_zeroes) * 12800.0 / (LC3_FLOAT) encoder->fs - 8.0); } - else if (encoder->frame_ms == 5) { + else if (encoder->frame_ms == LC3PLUS_FRAME_DURATION_5MS) { encoder->frame_length = encoder->frame_length >> 1; encoder->yLen /= 2; encoder->stEnc_mdct_mem_len = encoder->frame_length - encoder->la_zeroes; @@ -193,8 +202,11 @@ void set_enc_frame_params(LC3PLUS_Enc* encoder) encoder->bands_offset = ACC_COEFF_PER_BAND_5ms[encoder->fs_idx]; } encoder->cutoffBins = BW_cutoff_bin_all_5ms; +#ifdef FIX_LTPF_PITCH_MEM_LEN + encoder->ltpf_mem_in_len = LTPF_MEMIN_LEN + LEN_12K8 / 2; +#endif } - else if (encoder->frame_ms == 2.5) { + else if (encoder->frame_ms == LC3PLUS_FRAME_DURATION_2p5MS) { encoder->la_zeroes = MDCT_la_zeroes_2_5ms[encoder->fs_idx]; if (encoder->hrmode) { @@ -219,12 +231,53 @@ void set_enc_frame_params(LC3PLUS_Enc* encoder) encoder->nSubdivisions = 2; encoder->near_nyquist_index = encoder->bands_number - 2; +#ifdef FIX_LTPF_PITCH_MEM_LEN + encoder->ltpf_mem_in_len = LTPF_MEMIN_LEN + (3 * (LEN_12K8 / 4)); +#else encoder->ltpf_mem_in_len = LTPF_MEMIN_LEN + (LEN_12K8 >> 2); +#endif + } +#ifdef CR9_C_ADD_1p25MS + else if (encoder->frame_ms == LC3PLUS_FRAME_DURATION_1p25MS) { + encoder->la_zeroes = MDCT_la_zeroes_1_25ms[encoder->fs_idx]; + if (encoder->hrmode) + { + assert(0); + } + else + { + encoder->bands_offset = ACC_COEFF_PER_BAND_1_25ms[encoder->fs_idx]; + } + encoder->cutoffBins = BW_cutoff_bin_all_1_25ms; + encoder->frame_length = encoder->frame_length >> 3; + encoder->yLen /= 8; + encoder->stEnc_mdct_mem_len = encoder->frame_length - encoder->la_zeroes; + if (encoder->hrmode) + { + assert(0); + } + else + { + encoder->bands_number = bands_number_1_25ms[encoder->fs_idx]; + encoder->BW_cutoff_bits = 0; /* transmit no bw bits */ + encoder->bw_ctrl_active = 1; + } + + encoder->nSubdivisions = 2; + encoder->near_nyquist_index = encoder->bands_number - 2; +#ifdef FIX_LTPF_PITCH_MEM_LEN + encoder->ltpf_mem_in_len = LTPF_MEMIN_LEN + (7 * (LEN_12K8 / 8)); +#else + encoder->ltpf_mem_in_len = LTPF_MEMIN_LEN + (LEN_12K8 >> 1) + 16; +#endif + encoder->r12k8_mem_out_len = 8; + + encoder->attdec_damping = 32767.0/32768.0; } +#endif for (ch = 0; ch < encoder->channels; ch++) { setup = encoder->channel_setup[ch]; - setup->olpa_mem_pitch = 17; setup->pitch_flag = 0; if (setup->mdctStruct.mem != NULL) { @@ -246,32 +299,46 @@ void set_enc_frame_params(LC3PLUS_Enc* encoder) LC3PLUS_Error update_enc_bitrate(LC3PLUS_Enc* encoder, int bitrate) { int ch = 0, bitsTmp = 0, minBR = 0, maxBR = 0, totalBytes = 0; - LC3_INT channel_bytes = 0, max_bytes = 0; - + LC3_INT channel_bytes = 0; + #ifdef ENABLE_HR_MODE_FL +#ifdef CR12_D_FIX_BITRATE_LIMITS + LC3_INT fec_slot_bytes_min = 0, check_bytes = 0; +#else + LC3_INT max_bytes = 0; +#endif if (encoder->hrmode) { switch (encoder->frame_dms) { - case 25: +#ifdef CR9_C_ADD_1p25MS + case LC3PLUS_FRAME_DURATION_1p25MS: + assert(0); maxBR = 672000; if (encoder->fs == 48000) {minBR = MIN_BR_25MS_48KHZ_HR;} else if (encoder->fs == 96000) {minBR = MIN_BR_25MS_96KHZ_HR;} else { return LC3PLUS_HRMODE_ERROR;} break; - case 50: +#endif + case LC3PLUS_FRAME_DURATION_2p5MS: + maxBR = 672000; + if (encoder->fs == 48000) {minBR = MIN_BR_25MS_48KHZ_HR;} + else if (encoder->fs == 96000) {minBR = MIN_BR_25MS_96KHZ_HR;} + else { return LC3PLUS_HRMODE_ERROR;} + break; + case LC3PLUS_FRAME_DURATION_5MS: maxBR = 600000; if (encoder->fs == 48000) {minBR = MIN_BR_50MS_48KHZ_HR;} else if (encoder->fs == 96000) {minBR = MIN_BR_50MS_96KHZ_HR;} else { return LC3PLUS_HRMODE_ERROR;} break; - case 75: + case LC3PLUS_FRAME_DURATION_7p5MS: maxBR = 500000; if (encoder->fs == 48000) {minBR = MIN_BR_075DMS_48KHZ_HR;} else if (encoder->fs == 96000) {minBR = MIN_BR_075DMS_96KHZ_HR;} else {return LC3PLUS_HRMODE_ERROR;} break; - case 100: + case LC3PLUS_FRAME_DURATION_10MS: maxBR = 500000; if (encoder->fs == 48000) {minBR = MIN_BR_100MS_48KHZ_HR;} else if (encoder->fs == 96000) {minBR = MIN_BR_100MS_96KHZ_HR;} @@ -289,11 +356,17 @@ LC3PLUS_Error update_enc_bitrate(LC3PLUS_Enc* encoder, int bitrate) switch (encoder->frame_dms) { - case 25: +#ifdef CR9_C_ADD_1p25MS + case LC3PLUS_FRAME_DURATION_1p25MS: + minBR = MIN_BR_0125DMS; + maxBR = MAX_BR_0125DMS; + break; +#endif + case LC3PLUS_FRAME_DURATION_2p5MS: minBR = MIN_BR_025DMS; maxBR = MAX_BR; break; - case 50: + case LC3PLUS_FRAME_DURATION_5MS: minBR = MIN_BR_050DMS; maxBR = MAX_BR; /* have additional limitations for 5.0ms */ @@ -303,7 +376,7 @@ LC3PLUS_Error update_enc_bitrate(LC3PLUS_Enc* encoder, int bitrate) default: break; } break; - case 75: + case LC3PLUS_FRAME_DURATION_7p5MS: minBR = MIN_BR_075DMS; maxBR = MAX_BR_075DMS; /* have additional limitations for 7.5ms */ @@ -315,7 +388,7 @@ LC3PLUS_Error update_enc_bitrate(LC3PLUS_Enc* encoder, int bitrate) default: break; } break; - case 100: + case LC3PLUS_FRAME_DURATION_10MS: /* have additional limitations for 10ms */ minBR = MIN_BR_100DMS; maxBR = MAX_BR; @@ -327,7 +400,8 @@ LC3PLUS_Error update_enc_bitrate(LC3PLUS_Enc* encoder, int bitrate) default: maxBR = MAX_BR; break; } break; - default: return LC3PLUS_FRAMEMS_ERROR; + case LC3PLUS_FRAME_DURATION_UNDEFINED: + return LC3PLUS_FRAMEMS_ERROR; } maxBR *= (encoder->fs_in == 44100 ? 441. / 480 : 1); } @@ -346,8 +420,57 @@ LC3PLUS_Error update_enc_bitrate(LC3PLUS_Enc* encoder, int bitrate) if (encoder->epmode > 0) { +#ifdef CR12_D_FIX_BITRATE_LIMITS +#ifdef ENABLE_HR_MODE_FL + if (encoder->hrmode){ + switch( encoder->frame_dms ) + { + case LC3PLUS_FRAME_DURATION_2p5MS: + if( encoder->fs_in == 48000){ + fec_slot_bytes_min = FEC_SLOT_BYTES_MIN_025DMS_48KHZ_HR; + } else { + fec_slot_bytes_min = FEC_SLOT_BYTES_MIN_025DMS_96KHZ_HR; + } + break; + case LC3PLUS_FRAME_DURATION_5MS: + if( encoder->fs_in == 48000){ + fec_slot_bytes_min = FEC_SLOT_BYTES_MIN_050DMS_48KHZ_HR; + } else { + fec_slot_bytes_min = FEC_SLOT_BYTES_MIN_050DMS_96KHZ_HR; + } + break; + case LC3PLUS_FRAME_DURATION_7p5MS: + if( encoder->fs_in == 48000){ + fec_slot_bytes_min = FEC_SLOT_BYTES_MIN_075DMS_48KHZ_HR; + } else { + fec_slot_bytes_min = FEC_SLOT_BYTES_MIN_075DMS_96KHZ_HR; + } + break; + case LC3PLUS_FRAME_DURATION_10MS: + if( encoder->fs_in == 48000){ + fec_slot_bytes_min = FEC_SLOT_BYTES_MIN_100DMS_48KHZ_HR; + } else { + fec_slot_bytes_min = FEC_SLOT_BYTES_MIN_100DMS_96KHZ_HR; + } + break; + default: + return LC3PLUS_FRAMEMS_ERROR; + } + } + else +#endif + { + fec_slot_bytes_min = FEC_SLOT_BYTES_MIN; + } + + + check_bytes = bitrate * encoder->frame_length / ( 8 * encoder->fs_in * encoder->channels ); + maxBR = FEC_SLOT_BYTES_MAX * ( 8 * encoder->fs_in * encoder->channels ) / encoder->frame_length; + if ( check_bytes < fec_slot_bytes_min || bitrate > maxBR ) +#else max_bytes = bitrate * encoder->frame_length / (8 * encoder->fs_in * encoder->channels); if (max_bytes < FEC_SLOT_BYTES_MIN || max_bytes > FEC_SLOT_BYTES_MAX) +#endif /* CR12_D_FIX_BITRATE_LIMITS */ { encoder->lc3_br_set = 0; return LC3PLUS_BITRATE_ERROR; @@ -371,7 +494,7 @@ LC3PLUS_Error update_enc_bitrate(LC3PLUS_Enc* encoder, int bitrate) totalBytes = bitrate * encoder->frame_length / (8 * encoder->fs_in); } - if (encoder->frame_dms <= 50) + if (encoder->frame_dms <= LC3PLUS_FRAME_DURATION_5MS) { encoder->tnsMaxOrder = 4; } else { @@ -400,8 +523,8 @@ LC3PLUS_Error update_enc_bitrate(LC3PLUS_Enc* encoder, int bitrate) setup->n_pccw = fec_get_n_pccw(channel_bytes, encoder->epmode, encoder->combined_channel_coding); setup->n_pc = fec_get_n_pc(encoder->epmode, setup->n_pccw, channel_bytes); } - // reduce bandwith to 12kHz if bitrate is low - if (encoder->frame_dms == 100 && + /* reduce bandwith to 12kHz if bitrate is low */ + if (encoder->frame_dms == LC3PLUS_FRAME_DURATION_10MS && ((setup->targetBytes < 40 && encoder->fs == 48000) || (setup->targetBytes < 36 && encoder->fs == 32000))) { @@ -413,12 +536,12 @@ LC3PLUS_Error update_enc_bitrate(LC3PLUS_Enc* encoder, int bitrate) For a second channel with lower targetBytes, bandwidth is overwritten */ encoder->bandwidth = encoder->bandwidth_preset; } - encoder->bw_ctrl_cutoff_bin = encoder->bandwidth * encoder->frame_dms / 5000; + encoder->bw_ctrl_cutoff_bin = encoder->bandwidth * (encoder->frame_dms * 1.25 * 10) / 5000; encoder->bw_index = (encoder->bandwidth / 4000) - 1; setup->total_bits = setup->targetBytes << 3; setup->targetBitsInit = setup->total_bits - encoder->envelope_bits - encoder->global_gain_bits - encoder->noise_fac_bits - encoder->BW_cutoff_bits - - ceil(LC3_LOGTWO(encoder->frame_length / 2)) - 2 - 1; + getLastNzBits (encoder->frame_length) - 2 - 1; if (setup->total_bits > 1280) { setup->targetBitsInit = setup->targetBitsInit - 1; @@ -435,30 +558,45 @@ LC3PLUS_Error update_enc_bitrate(LC3PLUS_Enc* encoder, int bitrate) setup->targetBitsAri = setup->total_bits; setup->enable_lpc_weighting = setup->total_bits < 480; - if (encoder->frame_ms == 7.5) { + if (encoder->frame_ms == LC3PLUS_FRAME_DURATION_7p5MS) { setup->enable_lpc_weighting = setup->total_bits < 360; } - if (encoder->frame_ms == 5) { + if (encoder->frame_ms == LC3PLUS_FRAME_DURATION_5MS) { setup->enable_lpc_weighting = setup->total_bits < 240; } - if (encoder->frame_ms == 2.5) { + if (encoder->frame_ms == LC3PLUS_FRAME_DURATION_2p5MS) { setup->enable_lpc_weighting = setup->total_bits < 120; } - +#ifdef CR9_C_ADD_1p25MS + if (encoder->frame_ms == LC3PLUS_FRAME_DURATION_1p25MS) { + setup->enable_lpc_weighting = setup->total_bits < 60; + } +#endif +#ifdef FIX_BOTH_1p25_WB_GLOBGAINOFFSET_NONBE + if (encoder->frame_dms == LC3PLUS_FRAME_DURATION_1p25MS) + { + setup->quantizedGainOff = calc_GGainOffset_1p25(setup->total_bits, encoder->fs_idx); /* enc/dec common function */ + } + else + { + setup->quantizedGainOff = + -(MIN(115, setup->total_bits / (10 * (encoder->fs_idx + 1))) + 105 + 5 * (encoder->fs_idx + 1)); + } +#else setup->quantizedGainOff = -(MIN(115, setup->total_bits / (10 * (encoder->fs_idx + 1))) + 105 + 5 * (encoder->fs_idx + 1)); - +#endif if (encoder->hrmode && encoder->fs_idx == 5) { setup->quantizedGainOff = MAX(setup->quantizedGainOff, -181); } - if (encoder->frame_ms == 10 && ((encoder->fs_in >= 44100 && setup->targetBytes >= 100) || + if (encoder->frame_ms == LC3PLUS_FRAME_DURATION_10MS && ((encoder->fs_in >= 44100 && setup->targetBytes >= 100) || (encoder->fs_in == 32000 && setup->targetBytes >= 81)) && setup->targetBytes < 340 && encoder->hrmode == 0) { setup->attack_handling = 1; } - else if (encoder->frame_dms == 75 && ((encoder->fs_in >= 44100 && setup->targetBytes >= 75) || + else if (encoder->frame_dms == LC3PLUS_FRAME_DURATION_7p5MS && ((encoder->fs_in >= 44100 && setup->targetBytes >= 75) || (encoder->fs_in == 32000 && setup->targetBytes >= 61)) && setup->targetBytes < 150 && encoder->hrmode == 0) { setup->attack_handling = 1; @@ -477,13 +615,18 @@ LC3PLUS_Error update_enc_bitrate(LC3PLUS_Enc* encoder, int bitrate) } bitsTmp = setup->total_bits; - if (encoder->frame_ms == 2.5) { +#ifdef CR9_C_ADD_1p25MS + if (encoder->frame_ms == LC3PLUS_FRAME_DURATION_1p25MS) { + bitsTmp = bitsTmp * 8.0 * 0.42; + } +#endif + if (encoder->frame_ms == LC3PLUS_FRAME_DURATION_2p5MS) { bitsTmp = bitsTmp * 4.0 * (1.0 - 0.4); } - if (encoder->frame_ms == 5) { + if (encoder->frame_ms == LC3PLUS_FRAME_DURATION_5MS) { bitsTmp = bitsTmp * 2 - 160; } - if (encoder->frame_ms == 7.5) { + if (encoder->frame_ms == LC3PLUS_FRAME_DURATION_7p5MS) { bitsTmp = round(bitsTmp * 10 / 7.5); } @@ -508,68 +651,89 @@ LC3PLUS_Error update_enc_bitrate(LC3PLUS_Enc* encoder, int bitrate) } else { encoder->sns_damping = 0.6; if (encoder->fs_idx >= 4) { - if (encoder->frame_ms == 10) + if (encoder->frame_ms == LC3PLUS_FRAME_DURATION_10MS) { if (setup->total_bits > 4400) { encoder->sns_damping = 6881.0/32768.0; } } - if (encoder->frame_ms == 7.5) + if (encoder->frame_ms == LC3PLUS_FRAME_DURATION_7p5MS) { if (setup->total_bits > 3*4400/4) { encoder->sns_damping = 5898.0/32768.0; } } - if (encoder->frame_ms == 5) + if (encoder->frame_ms == LC3PLUS_FRAME_DURATION_5MS) { if (setup->total_bits > 4600/2) { encoder->sns_damping = 4915.0/32768.0; } } - if (encoder->frame_ms == 2.5) + if (encoder->frame_ms == LC3PLUS_FRAME_DURATION_2p5MS) { if (setup->total_bits > 4600/4) { encoder->sns_damping = 4915.0/32768.0; } } +#ifdef CR9_C_ADD_1p25MS + if (encoder->frame_ms == LC3PLUS_FRAME_DURATION_1p25MS) + { + assert(0); + if (setup->total_bits > 4600/4) { + encoder->sns_damping = 4915.0/32768.0; + } + } +#endif } } if (encoder->hrmode && encoder->fs_idx >= 4) { - int real_rate = setup->targetBytes * 8000 / encoder->frame_ms; + int real_rate = setup->targetBytes * 8000 / (encoder->frame_ms * 1.25); setup->regBits = real_rate / 12500; if (encoder->fs_idx == 5) { - if (encoder->frame_ms == 10) + if (encoder->frame_ms == LC3PLUS_FRAME_DURATION_10MS) { setup->regBits +=2; } - if (encoder->frame_ms == 7.5) + if (encoder->frame_ms == LC3PLUS_FRAME_DURATION_7p5MS) { setup->regBits +=1; } - if (encoder->frame_ms == 2.5) + if (encoder->frame_ms == LC3PLUS_FRAME_DURATION_2p5MS) { setup->regBits -= 6; } +#ifdef CR9_C_ADD_1p25MS + if (encoder->frame_ms == LC3PLUS_FRAME_DURATION_1p25MS) + { + assert(0); + } +#endif } else { - if (encoder->frame_ms == 2.5) +#ifdef CR9_C_ADD_1p25MS + if (encoder->frame_ms == LC3PLUS_FRAME_DURATION_1p25MS) + { + assert(0); + } +#endif + if (encoder->frame_ms == LC3PLUS_FRAME_DURATION_2p5MS) { setup->regBits -= 6; } - else if (encoder->frame_ms == 5) + else if (encoder->frame_ms == LC3PLUS_FRAME_DURATION_5MS) { setup->regBits += 0; } - if (encoder->frame_ms == 7.5) + if (encoder->frame_ms == LC3PLUS_FRAME_DURATION_7p5MS) { setup->regBits +=2; } - if (encoder->frame_ms == 10) + if (encoder->frame_ms == LC3PLUS_FRAME_DURATION_10MS) { setup->regBits += 5; } diff --git a/lib_lc3plus/setup_enc_lc3plus.h b/lib_lc3plus/setup_enc_lc3plus.h index 7947a0e649dc352909a54ff500c9165082f02763..1f1656f36510afc6ff44c0300c20e49981543fcb 100644 --- a/lib_lc3plus/setup_enc_lc3plus.h +++ b/lib_lc3plus/setup_enc_lc3plus.h @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.5.1 * +* ETSI TS 103 634 V1.6.1 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -13,11 +13,19 @@ #include "options.h" #include "wmc_auto.h" #include "constants.h" +#include "lc3plus.h" /* Channel state and bitrate-derived values go in this struct */ typedef struct { LC3_FLOAT targetBitsOff; +#ifdef CR9_C_ADD_1p25MS + LC3_FLOAT ltpf_mem_normcorr[LEN_MEM_NORMCORR]; +#else LC3_FLOAT ltpf_mem_normcorr; +#endif +#ifdef FIX_TX_RX_STRUCT_STEREO + LC3_INT16 Tx_ltpf; +#endif LC3_FLOAT ltpf_mem_mem_normcorr; LC3_FLOAT attdec_filter_mem[2]; LC3_FLOAT attdec_acc_energy; @@ -83,8 +91,8 @@ struct LC3PLUS_Enc { LC3_INT frame_length; /* audio samples / frame */ LC3_INT channels; /* number of channels */ LC3_INT epmode; /* error protection mode */ - LC3_FLOAT frame_ms; /* frame length in ms (wrong for 44.1) */ - LC3_INT frame_dms; /* frame length in ms * 10 (wrong for 44.1) */ + LC3PLUS_FrameDuration frame_ms; /* enum for frame length in ms (wrong for 44.1) */ + LC3PLUS_FrameDuration frame_dms; /* enum for frame length in ms * 10 (wrong for 44.1) */ LC3_INT tilt; LC3_INT lc3_br_set; LC3_INT yLen; @@ -109,10 +117,14 @@ struct LC3PLUS_Enc { LC3_INT bw_ctrl_active; LC3_INT bw_ctrl_cutoff_bin; LC3_INT bw_index; - LC3_FLOAT sns_damping; LC3_INT attdec_nblocks; - LC3_FLOAT attdec_damping; LC3_INT attdec_hangover_thresh; +#ifndef FIX_TX_RX_STRUCT_STEREO + LC3_INT16 Tx_ltpf; +#endif + LC3_FLOAT long_term_norm_corr; + LC3_FLOAT attdec_damping; + LC3_FLOAT sns_damping; LC3_INT16 combined_channel_coding; LC3_INT16 epmr; diff --git a/lib_lc3plus/sns_compute_scf.c b/lib_lc3plus/sns_compute_scf.c index d81c61c42acaf4e68a585cac3776f8284cb21980..6358985e8bbf5273178a6c42b78b32063c6618f9 100644 --- a/lib_lc3plus/sns_compute_scf.c +++ b/lib_lc3plus/sns_compute_scf.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.5.1 * +* ETSI TS 103 634 V1.6.1 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -11,18 +11,53 @@ #include "wmc_auto.h" #include "functions.h" -void processSnsComputeScf_fl(LC3_FLOAT* x, LC3_INT xLen, LC3_FLOAT* gains, LC3_INT smooth, LC3_FLOAT sns_damping, LC3_FLOAT attdec_damping_factor, LC3_INT fs_idx) +#ifdef CR9_C_ADD_1p25MS +static float limitShaping (LC3_FLOAT* xl4 ) { + LC3_FLOAT fac; + LC3_FLOAT score; + LC3_FLOAT min_fac; + LC3_FLOAT max_fac; + LC3_FLOAT start; + LC3_FLOAT stop; + + min_fac = 1.f; + max_fac = 0.3f; + start = 5.f; + stop = 8.f; + + score = ((2.f*(xl4[0]-xl4[1])) + (xl4[0]-xl4[2])) / 2.f; + score = fmin(fmax(score, start), stop); + + fac = (stop-score)/(stop-start); + return ((min_fac - max_fac) * fac + max_fac); +} +#endif + +void processSnsComputeScf_fl(LC3_FLOAT* x, LC3_INT xLen, LC3_FLOAT* gains, LC3_INT smooth, LC3_FLOAT sns_damping, LC3_FLOAT attdec_damping_factor, LC3_INT fs_idx +#ifdef CR9_C_ADD_1p25MS + , LC3PLUS_FrameDuration frame_dms, LC3_FLOAT *LT_normcorr, LC3_FLOAT normcorr +#endif + ) { LC3_INT bands_number, d, i, j, n, n2, n4, mapping[64]; - LC3_FLOAT x_tmp1[MAX_LEN], sum, mean, nf, gains_smooth[M], ratio; - LC3_FLOAT sum_gains_smooth; - const LC3_FLOAT* sns_preemph; + LC3_FLOAT x_tmp1[MAX_LEN], sum = 0, mean, nf, gains_smooth[M], ratio; + LC3_FLOAT sum_gains_smooth = 0; +#ifdef CR9_C_ADD_1p25MS + LC3_FLOAT fac; + LC3_FLOAT start; + LC3_FLOAT limiterGain; +#endif + const LC3_FLOAT *sns_preemph_adapt, *sns_preemph; + bands_number = xLen; - sum_gains_smooth = 0; sum = 0; sns_preemph = sns_preemph_all[fs_idx]; - bands_number = xLen; - assert(bands_number <= 64); +#ifdef CR9_C_ADD_1p25MS + limiterGain = 1.f; + sns_preemph_adapt = sns_preemph_adaptMaxTilt_all[fs_idx]; +#else + (void) sns_preemph_adapt; +#endif /* 5 ms */ if (bands_number < 64) { @@ -90,9 +125,29 @@ void processSnsComputeScf_fl(LC3_FLOAT* x, LC3_INT xLen, LC3_FLOAT* gains, LC3_I x[63] = 0.5 * x[63] + 0.25 * (x_tmp1[63] + x[63]); /* Pre-emphasis */ +#ifdef CR9_C_ADD_1p25MS + if (sns_preemph_adapt != NULL && frame_dms == LC3PLUS_FRAME_DURATION_1p25MS) + { + *LT_normcorr = normcorr * 0.125f + *LT_normcorr * 0.875f; + + start = 0.8f; /* adaptive preemphasis active from start to 1.0 */ + fac = (fmax(*LT_normcorr - start, 0) * (1. / (1.-start))); + + for (i = 0; i < 64; i++) { + x[i] = x[i] * (sns_preemph[i] + fac*sns_preemph_adapt[i]); + } + } + else + { + for (i = 0; i < 64; i++) { + x[i] = x[i] * sns_preemph[i]; + } + } +#else for (i = 0; i < 64; i++) { x[i] = x[i] * sns_preemph[i]; } +#endif /* Noise floor at -40dB */ for (i = 0; i < 64; i++) { @@ -139,17 +194,57 @@ void processSnsComputeScf_fl(LC3_FLOAT* x, LC3_INT xLen, LC3_FLOAT* gains, LC3_I gains_smooth[n] = sum; sum_gains_smooth += sum; } - - +#ifdef CR9_C_ADD_1p25MS + /* limit shaping */ + if (frame_dms == LC3PLUS_FRAME_DURATION_1p25MS) { + limiterGain *= limitShaping(gains_smooth); + } +#endif /* Remove mean and scaling */ mean = sum_gains_smooth / 16.0; for (i = 0; i < 16; i++) { +#ifdef CR9_C_ADD_1p25MS + gains[i] = limiterGain * sns_damping * (gains_smooth[i] - mean); +#else gains[i] = sns_damping * (gains_smooth[i] - mean); +#endif } /* Smoothing */ - if (smooth) { +#ifdef CR9_C_ADD_1p25MS_LRSNS + if (frame_dms == LC3PLUS_FRAME_DURATION_1p25MS) + { /* smoothing loop for 1.25 ms */ + + const LC3_FLOAT A0 = 3.0 / 16.0; /* 2/16= 0.125, 3/16 = 0.1875 */ + const LC3_FLOAT A1 = (1.0 - 2 * A0); + const LC3_FLOAT A2 = A0; + + gains_smooth[0] = A0 * (gains[0] + gains[1]) * 0.5 + A1 * gains[0] + A2 * gains[1]; + /* BASOP-loop:: preload gains[-1] with 0.5*(gains[0]+gains[1]) */ + for (i = 1; i < (M - 1); i++) + { + gains_smooth[i] = A0 * gains[i - 1] + A1 * gains[i] + A2 * gains[i + 1]; + } + gains_smooth[M - 1] = A0 * gains[M - 2] + A1 * gains[M - 1] + A2 * 0.5 * (gains[M - 2] + gains[M - 1]); + /* BASOP-loop :: preload gains[M] with 0.5*(gains[M-2]+gains[M-1]) */ + sum = 0; + for (i = 0; i < M; i++) + { + sum += gains_smooth[i]; + } + + mean = sum / (LC3_FLOAT)M; + for (i = 0; i < M; i++) + { + gains[i] = attdec_damping_factor * (gains_smooth[i] - mean); + } + } + else if (smooth == 1) /* original attack smoothing */ +#else + if (smooth) +#endif + { gains_smooth[0] = (gains[0] + gains[1] + gains[2]) / 3.0; gains_smooth[1] = (gains[0] + gains[1] + gains[2] + gains[3]) / 4.0; diff --git a/lib_lc3plus/sns_interpolate_scf.c b/lib_lc3plus/sns_interpolate_scf.c index 15ae55c12a8598bba030bcdae43da4fc53315144..d421154f5354c3c28118d6da679073ba7a00137d 100644 --- a/lib_lc3plus/sns_interpolate_scf.c +++ b/lib_lc3plus/sns_interpolate_scf.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.5.1 * +* ETSI TS 103 634 V1.6.1 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -70,7 +70,8 @@ void processSnsInterpolateScf_fl(LC3_FLOAT* gains, LC3_INT encoder_side, LC3_INT } move_float(gains_int, tmp, bands_number); - } else { + } + else { assert(0 && "Unsupported number of bands!"); } } diff --git a/lib_lc3plus/sns_quantize_scf.c b/lib_lc3plus/sns_quantize_scf.c index 96d8cdb4b604b43fb319e52a4f012a184b8989a4..9079217128488b8964e5849fe08213c7b3504059 100644 --- a/lib_lc3plus/sns_quantize_scf.c +++ b/lib_lc3plus/sns_quantize_scf.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.5.1 * +* ETSI TS 103 634 V1.6.1 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -11,8 +11,158 @@ #include "wmc_auto.h" #include "functions.h" +#ifdef CR9_C_ADD_1p25MS_LRSNS + +static LC3_INT16 get_lead_sign( LC3_UINT32* ind_in ); +static void mind2vec_one( LC3_UINT8 k_val_in, LC3_INT16 leading_sign, LC3_INT32* vec_out ); + +LC3_INT16 get_lead_sign( LC3_UINT32* ind_in ) +{ + LC3_INT16 leading_sign; + leading_sign = +1; + if ( ( ( *ind_in ) & 0x1 ) != 0 ) + { + leading_sign = -1; + } + ( *ind_in ) = ( *ind_in >> 1 ); + + return leading_sign; +} + +void mind2vec_one( LC3_UINT8 k_val_in, /* i: nb unit pulses */ + LC3_INT16 leading_sign, /* i: leading sign -1, 1 */ + LC3_INT32* vec_out /* o: updated pulse train */ ) +{ + LC3_INT32 amp; + amp = k_val_in; + if ( leading_sign < 0 ) + { + amp = -k_val_in; + } + *vec_out = amp; +} + +static LC3_UINT8 setval_update_sign( LC3_INT16 k_delta, LC3_UINT8 k_max_local_in, LC3_INT16* leading_sign, LC3_UINT32* ind_in, LC3_INT32* vec_out ); + +static void mind2vec_tab( LC3_UINT8 dim_in, LC3_UINT8 k_max_local, LC3_INT16 leading_sign, LC3_UINT32 ind, LC3_INT32* vec_out ); + +#endif + +#ifdef CR9_C_ADD_1p25MS_LRSNS +static void MPVQdeenum( LC3_UINT8 dim_in, LC3_UINT8 k_val_in, LC3_INT32 LS_ind, LC3_INT32 MPVQ_ind, LC3_INT32* vec_out ); +#endif + +#ifdef CR9_C_ADD_1p25MS_LRSNS + +LC3_UINT8 setval_update_sign( LC3_INT16 k_delta, /* i */ + LC3_UINT8 k_max_local_in, /* i */ + LC3_INT16* leading_sign, /* i/o */ + LC3_UINT32* ind_in, /* i/o */ + LC3_INT32* vec_out /* i/o */ ) +{ + LC3_UINT8 k_max_local_out; + k_max_local_out = k_max_local_in; + if ( k_delta != 0 ) + { + mind2vec_one( k_delta, *leading_sign, vec_out ); + *leading_sign = get_lead_sign( ind_in ); + k_max_local_out -= k_delta; + } + + return k_max_local_out; +} + +#endif + +#ifdef CR9_C_ADD_1p25MS_LRSNS + +void mind2vec_tab( LC3_UINT8 dim_in, /* i: dimension */ + LC3_UINT8 k_max_local, /* i: nb unit pulses */ + LC3_INT16 leading_sign, /* i: leading sign */ + LC3_UINT32 ind, /* i: MPVQ-index */ + LC3_INT32* vec_out /* o: pulse train */ ) +{ + /* pvq_enc_A = MPVQ_offsets */ + LC3_UINT8 pos, k_acc; + LC3_UINT32 UL_tmp_offset; + LC3_INT32 UL_diff; + LC3_INT16 wrap_flag, k_delta; + const LC3_UINT32* h_row_ptr; + /* init */ + h_row_ptr = &( pvq_enc_A[( dim_in - 1 )][0] ); + k_acc = k_max_local; + + /* loop over positions */ + for ( pos = 0; pos < dim_in; pos++ ) + { + if ( ind != 0 ) + { + k_acc = k_max_local; + UL_tmp_offset = h_row_ptr[k_acc]; + + wrap_flag = ( ind < UL_tmp_offset ); + UL_diff = (LC3_INT32) ( (LC3_INT32) ind - (LC3_INT32) UL_tmp_offset ); + + while ( wrap_flag != 0 ) + { + k_acc--; + wrap_flag = ( ind < h_row_ptr[k_acc] ); + UL_diff = (LC3_INT32) ( (LC3_INT32) ind - (LC3_INT32) h_row_ptr[k_acc] ); + } + ind = UL_diff; + k_delta = k_max_local - k_acc; + } + else + { + mind2vec_one( k_max_local, leading_sign, &vec_out[pos] ); + break; + } + k_max_local = setval_update_sign( k_delta, k_max_local, &leading_sign, &ind, &vec_out[pos] ); + h_row_ptr -= 11; /* reduce dimension in MPVQ_offsets table */ + } +} + +#endif + +#ifdef CR9_C_ADD_1p25MS_LRSNS + +void MPVQdeenum( LC3_UINT8 dim_in, /* i : dimension of vec_out */ + LC3_UINT8 k_val_in, /* i : number of unit pulses */ + LC3_INT32 LS_ind, /* i : leading sign index */ + LC3_INT32 MPVQ_ind, /* i : MPVQ shape index */ + LC3_INT32* vec_out /* o : PVQ integer pulse train */ ) +{ + LC3_INT32 leading_sign; + + + leading_sign = 1; + if ( LS_ind != 0 ) + { + leading_sign = -1; + } + + mind2vec_tab( dim_in, k_val_in, leading_sign, MPVQ_ind, vec_out ); +} + +/* local funcs*/ + +static void FESSdeenum(LC3_UINT8 dim_in, /* i : dimension of vec_out */ + LC3_UINT8 n_env, /* i : number envelopes */ + LC3_UINT8 n_shift, /* i : number shifts */ + LC3_UINT8 n_signs, /* i : number signs */ + LC3_INT32 env_ind, /* i:indx */ + LC3_INT32 shift_ind, /* i:indx */ + LC3_INT32 sign_ind, /* i:indx */ + LC3_INT32* vec_out /* o : FESS integer pulse train */); + +LC3_INT32 snsQuantScfEncLRSt1ABC(LC3_FLOAT* env, LC3_INT32* L_index, LC3_FLOAT *min_mse_saveBCA_ptr, + LC3_INT32* ind_saveB_ptr, LC3_FLOAT* st1_vectors, + LC3_INT32 pitch_rx, LC3_INT32 ltpf_rx); + +#endif /* CR9_C_ADD_1p25MS_LRSNS*/ + static void pvq_dec(LC3_INT k, LC3_INT m, LC3_INT LS_ind, LC3_INT MPVQ_ind, LC3_INT* pulses); -static LC3_INT find_last_indice_le(LC3_INT compare, const LC3_INT* array, LC3_INT len); +static LC3_INT find_last_indice_le(LC3_INT compare, const LC3_UINT32* array, LC3_INT len); static void idct_II(LC3_FLOAT* in, LC3_FLOAT* out, LC3_INT len); void idct_II(LC3_FLOAT* in, LC3_FLOAT* out, LC3_INT len) @@ -28,6 +178,87 @@ void idct_II(LC3_FLOAT* in, LC3_FLOAT* out, LC3_INT len) } } +#ifdef FIX_FLOAT_ENC_PVQ_PULSE_LOOP +static LC3_INT32 pvq_pulse_search_lc(LC3_FLOAT* xabs, LC3_FLOAT* ener, LC3_FLOAT* corr, LC3_INT32* y, LC3_INT32 start, LC3_INT32 end) +{ + Dyn_Mem_Deluxe_In( + LC3_INT32 i; + LC3_INT32 nBest; + LC3_FLOAT max_norm_ratio, cand_norm_ratio; + LC3_FLOAT currCorr; + LC3_INT32 currEnInt; + const LC3_FLOAT* isqrt_QxTab; + ); + + const LC3_INT16 isqrt_Q16tab[1 + 64] = { /* table generated using ISqrt16 function + shift to Q16 */ + 32767, 32767, 32767, 32767, 32766, 29308, 26754, 24770, 23169, 21844, + 20723, 19759, 18918, 18176, 17515, 16921, 16383, 15894, 15446, 15034, + 14654, 14300, 13972, 13665, 13377, 13107, 12852, 12612, 12385, 12169, + 11965, 11770, 11584, 11407, 11238, 11077, 10922, 10773, 10631, 10493, + 10361, 10234, 10112, 9993, 9879, 9769, 9662, 9559, 9459, 9362, + 9268, 9176, 9088, 9001, 8918, 8836, 8757, 8680, 8605, 8532, + 8460, 8390, 8323, 8256, 8191 + }; + LC3_FLOAT isqrt_Q16tabFlt[1 + 64]; + + const LC3_INT16 isqrt_Q15tab[1 + 6] = { + /* onepulse_search_tab based search , Q15 table generated using isqrt_Q16tab table for idx=[8(4*2),16(4*4), 20(4*5),24(4*6) ] */ + /* this slighly suboptimal inv_sqrt(x) table is used to enable optional exact use of the ROM saving BASOP ISqrt16() function */ + + 32767/*0*/, 32766/*1*/, 23169 /*2*/, 18918 /*3*/ , 16384/*4*/ , 14654 /*5*/, 13377/*6*/ + /* i.e. value in isqrt_Q15tab[n=0..6] == isqrt_Q16tab[4*n] */ + }; + LC3_FLOAT isqrt_Q15tabFlt[1 + 6]; + + for ( i = 0; i <= 64; i++ ) + { + isqrt_Q16tabFlt[i] = isqrt_Q16tab[i] / 65536.0; + } + for (i = 0; i <= 6; i++) + { + isqrt_Q15tabFlt[i] = isqrt_Q15tab[i] / 32768.0; + } + + + isqrt_QxTab = isqrt_Q16tabFlt; /* Q16 table valid for energies 4...64 */ + + assert( *ener >= 0.0 ); + *ener += 1.0; /* Added once for the entire loop */ + if (*ener <= 3.0 ) /* +1 for the inloop value of *ener was preadded before */ + { + isqrt_QxTab = isqrt_Q15tabFlt; /* energies: 1...6 */ + } + + nBest = -1; + max_norm_ratio = -1.0; + /* Iterative max search using tabulated inv sqrt */ + for ( i = start; i < end; i++) + { + currCorr = *corr + xabs[i]; + currEnInt = ((LC3_INT32) *ener) + (2 * y[i]); + + cand_norm_ratio = currCorr * isqrt_QxTab[currEnInt]; + + if ( cand_norm_ratio >= max_norm_ratio ) + { + nBest = i; + } + max_norm_ratio = LC3_FMAX(max_norm_ratio, cand_norm_ratio); /* always update */ + } + + *corr += xabs[nBest]; + *ener += (2 * y[nBest]); + + assert(nBest >= 0); + assert(nBest <=M); + assert(*ener <= 64.0); + y[nBest] += 1; /* Add the selected unit pulse */ + + Dyn_Mem_Deluxe_Out(); + return nBest; +} +#endif + static LC3_INT pvq_pulse_search(LC3_FLOAT *xabs, LC3_FLOAT *ener, LC3_FLOAT *corr, LC3_INT *y, LC3_INT start, LC3_INT end) { LC3_INT i; @@ -39,7 +270,7 @@ static LC3_INT pvq_pulse_search(LC3_FLOAT *xabs, LC3_FLOAT *ener, LC3_FLOAT *cor bestCorrSq = 0.0; bestEn = 0.0; - *ener += 1; // Added once for the entire loop + *ener += 1; /* Added once for the entire loop */ i = start; @@ -194,7 +425,7 @@ static void pvq_enc_search(LC3_FLOAT* x_in, LC3_INT y[4][M]) return; } -static inline LC3_FLOAT calc_mse(LC3_FLOAT *t2rot, LC3_FLOAT *y, LC3_FLOAT gain, LC3_INT N) +static LC3_FLOAT calc_mse(LC3_FLOAT *t2rot, LC3_FLOAT *y, LC3_FLOAT gain, LC3_INT N) { LC3_FLOAT mse; LC3_INT i; @@ -402,12 +633,12 @@ void process_snsQuantizesScf_Enc(LC3_FLOAT* env, LC3_INT* index, LC3_FLOAT* envq } } -LC3_INT find_last_indice_le(LC3_INT compare, const LC3_INT* array, LC3_INT len) +LC3_INT find_last_indice_le(LC3_INT compare, const LC3_UINT32* array, LC3_INT len) { LC3_INT idx = 0, i = 0; for (i = 0; i < len; i++) { - if (compare >= array[i]) { + if ((LC3_UINT32)compare >= array[i]) { idx++; } } @@ -510,3 +741,1345 @@ void process_snsQuantizesScf_Dec(LC3_INT* scf_idx, LC3_FLOAT* scf_q) scf_q[i] += st2_vector_idct[i] * sns_dec_gains[submode][scf_idx[3]]; } } + +#ifdef CR9_C_ADD_1p25MS_LRSNS + +/* 29/30 bits optimized search functions for PVQ and FESS */ +/* stage 2 submode shape 0: "splitLF" (N=5,K=6)(N=8,K=2) or (N=5,K=8)(N=8,K=0) , 4 gains */ +/* stage 2 submode shape 1: "full" FB (N=15,K=5), 4xfixed , 8 gains */ +/* stage 2 submode shape 2-5: "fixed env " (N=13-15,K=10-12), 4xfixed , 8 gains */ + +static void pvq_fess_enc_search(LC3_FLOAT* x_in /* i: 0...M-1 */ + , LC3_INT32 y[SNSLR_MAX_PVQ_SEARCH_CAND][M], /* o: [3]*[0...M-1] */ + LC3_INT32 *fixShapeNb /* o: [-1, 0...3] */ +) +{ + LC3_INT32 i, j, curr_cand; + LC3_INT32 NcandLF, Ngrp, Kgrp, Ktop_LF, Ntop_LF; + LC3_INT32 NcandFB, Kfull; + LC3_INT32 NcandFix, Kfix, Nsigns_fix; + + LC3_INT32 N, K, pulse_total, top_pulses; + LC3_FLOAT abs_sum, projfac; + LC3_FLOAT yy, xy; /* in-loop energy and corr */ + + LC3_FLOAT yy_n5k8, xy_n5k8; + LC3_FLOAT xabs[M]; + LC3_INT32 y_tmp_n5k8[M]; + LC3_INT32 y_tmp[M]; + LC3_INT16 n, fix_ind, shift_ind; + LC3_INT16 best_env_ind; + LC3_INT16 best_shift_ind; + LC3_INT16 best_ind; + LC3_INT16 pulse_total_n5k8; + LC3_FLOAT f_normcorr_fixenv[SNSLR_N_FIXENV][SNSLR_N_FIXENV_SHIFTS]; + LC3_FLOAT *p; + const LC3_INT32* env_ptr; + +#define SC 1 /*Starting coeff position of PVQ target , (we have no DC) */ + { + /* no DC coeff , only coeff 1..15 is quantized in the range 0..15 */ + NcandLF = 1; + + Ngrp = 5; /* PVQ(5, 6) = 10.94b , + P(8,2)=7b + P(2,0)=0b */ + Kgrp = 6; + Ntop_LF = 8; /* allow to encode less than M-sc -Ngrp */ + Ktop_LF = 2; /* fill a few unit pulses in the HF region */ + /* P(5,8)+P(10,0) will also fit in 13 bits */ + /* Fullband safety net */ + NcandFB = 1; + Kfull = 5; ; /* PVQ(15,5)= 16.65 bits , */ + + /*fixed env */ + NcandFix = 4; /* 4th only has 10 signs */ + Kfix = 12; /* number of signs */ + Nsigns_fix = 12; /* area to cover and number of signs */ + } + + for (i = SC; i < (M); i++) + { + xabs[i] = LC3_FABS(x_in[i]); + } + xabs[0] = 0; + + /* splitLF LFfocus subshape idx 0 */ + if (Kgrp > 0 && NcandLF > 0) + { + curr_cand = 0; + /* Projection to LF pyramid N=Ngrp, K=Kgrp */ + abs_sum = 0.0; + N = Ngrp; + K = Kgrp; + pulse_total = 0; + + for (i = SC; i < (SC + N); i++) + { + abs_sum += xabs[i]; + } + projfac = (K - 1) / abs_sum; + + if (abs_sum == 0.0) + { + projfac = 0.0; + } + + yy = xy = 0.0f; + for (i = SC; i < (SC + N); i++) + { + y_tmp[i] = LC3_FLOOR(xabs[i] * projfac); /* local projection within group over N coeffs used here */ + + pulse_total += y_tmp[i]; + + yy += (y_tmp[i] * y_tmp[i]); + xy += (xabs[i] * y_tmp[i]); + } + + /* LF Adding unit pulses up to K in LF */ + for (; pulse_total < K; pulse_total++) + { + pvq_pulse_search(xabs, &yy, &xy, y_tmp, SC, SC + N); + } + + { + /* allow (N=5,K=(6+2)=8) in low band only, higher part is then zeroed */ + /* can be multiplexed put in 13 bits */ + yy_n5k8 = yy; + xy_n5k8 = xy; + pulse_total_n5k8 = pulse_total; + + memset(y_tmp_n5k8, 0, sizeof(*y_tmp_n5k8)*M); + memcpy(y_tmp_n5k8, y_tmp, sizeof(*y_tmp)*(SC + N)); /* cpy LF initial search result for n5k6 to n5k8 output */ + + for (; pulse_total_n5k8 < (K + 2); pulse_total_n5k8++) + { + pvq_pulse_search(xabs, &yy_n5k8, &xy_n5k8, y_tmp_n5k8, SC, SC + N); + } + } + + + /* split HF : longer M vector */ + memset(y[curr_cand], 0, sizeof(*y_tmp)*M); /*zero full candidate vector */ + memcpy(&(y[curr_cand]), y_tmp, sizeof(*y_tmp)*(SC + N)); /* cpy LF-part to output */ + + + if (Ktop_LF && (M - Ngrp - SC >= Ntop_LF)) + { + + /* xy = 0.0; yy = 0.0; */ + memset(&(y_tmp[Ngrp]), 0, (M - SC - Ngrp) * sizeof(*y_tmp)); + top_pulses = 0; + + for (; top_pulses < Ktop_LF; top_pulses++) + { + pvq_pulse_search(xabs, &yy, &xy, y_tmp, SC + N, SC + N + Ntop_LF); + } + + for (j = SC + N; j < (SC + N + Ntop_LF); j++) + { + y[curr_cand][j] = y_tmp[j]; + } + } + + { + /* shape 0 : decide on best split alternative "0a" n5k6 + n8k2 + n2k0 or "0b" n5k8 + n10k0, + shape only assessed , i.e. assume same gain quantizer */ + if ((xy_n5k8*xy_n5k8)*yy > (xy*xy)*yy_n5k8) + { + /* use n5k8, with zeroed high band */ + /* i.e. better to put two additional pulses in the n5 low band than in the higher band */ + memcpy(&(y[curr_cand]), y_tmp_n5k8, sizeof(*y_tmp_n5k8)*(M)); /* cpy LFonly to output */ + } + } + + /* assign signs to the cand vector from x_in */ + for (i = SC; i < (M); i++) + { + if (x_in[i] < 0) + { + y[curr_cand][i] *= -1; + } + } + y[curr_cand][0] = 0; /* DC */ + + } + + /* shape 1 : Full band shape analysis */ + if (Kfull > 0 && NcandFB > 0) + { + curr_cand = 1; + N = M - SC; + K = Kfull; + + /* project */ + pulse_total = 0; + yy = xy = 0.0f; + abs_sum = 0.0; + for (i = SC; i < SC + N; i++) + { + abs_sum += xabs[i];/* over N */ + } + + projfac = (K - 1) / abs_sum; + if (abs_sum == 0.0) + { + projfac = 0.0; + } + + + memset(y_tmp, 0, sizeof(*y_tmp)*M); + for (i = SC; i < SC + N; i++) + { + y_tmp[i] = LC3_FLOOR(xabs[i] * projfac); /* projection over N coeffs */ + pulse_total += y_tmp[i]; + yy += (y_tmp[i] * y_tmp[i]); + xy += (xabs[i] * y_tmp[i]); + } + + for (; pulse_total < K; pulse_total++) + { + pvq_pulse_search(xabs, &yy, &xy, y_tmp, SC, SC + N); + } + memcpy(&(y[curr_cand]), y_tmp, sizeof(*y_tmp)*M); /* cpy to output */ + + /* Step: Add signs to each of the full vector from input */ + for (i = SC; i < M; i++) + { + if (x_in[i] < 0) + { + y[curr_cand][i] *= -1; ; + } + } + y[curr_cand][0] = 0; + } /* Fullband */ + + + { /* fixed envelopes shifted signs shapes 2 ... 5 */ + best_env_ind = -1; + best_shift_ind = -1; + + /* search fixed env shapes first */ + /* search shape of all fixed flat-ish envelopes using an optimal nb_env*nbshifts shape analysis */ + if (Kfix > 0 && NcandFix > 0) + { + curr_cand = 2; + N = Nsigns_fix; + K = Kfix; + + /* find the minimum shape error across all possible 4 fixed envelopes and all 4 shifts */ + /* maximise normalized cross correlation target*y *(1/sqrt(y^2)) to minimize shape error */ + + for (fix_ind = 0; fix_ind < SNSLR_N_FIXENV; fix_ind++) + { + for (shift_ind = 0; shift_ind < SNSLR_N_FIXENV_SHIFTS; shift_ind++) + { + f_normcorr_fixenv[fix_ind][shift_ind] = 0.0; + for (n = 0; n < signs_fix[fix_ind]; n++) + { + f_normcorr_fixenv[fix_ind][shift_ind] += (xabs[SC + n + shift_ind] * env_ptrs[fix_ind][n + shift_ind]); + } + /* energy normalize, for the specific shift and env, + otherwise it is not possible to compare among the shifted envelopes properly */ + + f_normcorr_fixenv[fix_ind][shift_ind] *= shift_en_norm_factors[fix_ind][shift_ind]; + } + } + + /* now actually pick the env[0,1,2,3] and env shift[0,1,2,3] option which maximizes the normcorr + (minimizes shape mse as all fixed envelopes have the same gain quantizer) */ + p = &(f_normcorr_fixenv[0][0]); + best_ind = 0; + for (n = 1; n < (SNSLR_N_FIXENV * SNSLR_N_FIXENV_SHIFTS); n++) + { + if (p[n] > p[best_ind]) + { + best_ind = n; + } + } + best_env_ind = best_ind / SNSLR_N_FIXENV_SHIFTS; + best_shift_ind = best_ind - best_env_ind * SNSLR_N_FIXENV; + assert(best_env_ind >= 0 && best_env_ind < SNSLR_N_FIXENV); + assert(best_shift_ind >= 0 && best_shift_ind < SNSLR_N_FIXENV_SHIFTS); + } + /* o: best_shift_ind; o: best_env_ind */ + + *fixShapeNb = best_env_ind; /* best normalized correlation out of the 4x4 = 16 envelope options */ + /*best shift ind, later re-established/found via output vector y[2] */ + + /* Fixed envelope "flat-ish" signband coding , including sign coding of shifted block */ + /* submode idx 2,3,4 , "1"/env 1(s0)+ 2(shift)+ 11bits(s1..s11) + always a 3 bits gain */ + /* submode idx 5 , "1"/env 1(s0)+ 2(shift)+ 9bits(s1..s9) + always a 3 bits gain */ + /* + 2, init_bell_12signs , [ 8,8,8, 7,7 ... ] + 3, decaying envelope 12 signs, [ 12,12,11,11, ... ] + 4, start_bell_12signs ,[ 7,7,8,8,8, 7,... ] + 5, early_bell_10signs,[ 6,6, 7,7,8,8,8,7,... ] + */ + + { + /* construct the selected fix shape with its corresponding shift */ + memset(y[curr_cand], 0, sizeof(LC3_INT32)*M); /* zero output */ + env_ptr = env_ptrs[best_env_ind]; + + Nsigns_fix = signs_fix[best_env_ind]; + + /* now assign unit amplitude and signs to each of the fixed env vector from x_in in the band */ + for (i = best_shift_ind; i < (Nsigns_fix + best_shift_ind); i++) + { + y[curr_cand][SC + i] = env_ptr[i]; + } + for (i = (SC + best_shift_ind); i < (SC + Nsigns_fix + best_shift_ind); i++) + { + if (x_in[i] < 0) + { + y[curr_cand][i] *= -1; + } + } + y[curr_cand][0] = 0; + } + } + + return; +} + +static void lrsns_quant_shape_gain( + LC3_FLOAT* t2rot, LC3_INT32 y[SNSLR_MAX_PVQ_SEARCH_CAND][M], + LC3_INT32* gain_idx, LC3_INT32 *shape_idx, LC3_FLOAT* y_norm, LC3_FLOAT* scq_gain, LC3_INT32 n_cand ) +{ + LC3_INT32 gidx, sidx; + LC3_FLOAT min_mse, mse; + + LC3_INT32 i; + LC3_INT16 start_shape; + LC3_INT16 end_shape; + LC3_INT32 gain_levels[SNSLR_MAX_PVQ_SEARCH_CAND]; + LC3_FLOAT yCur[SNSLR_MAX_PVQ_SEARCH_CAND][M]; + const LC3_FLOAT *lrsns_vq_gains[SNSLR_MAX_PVQ_SEARCH_CAND]; + + gain_levels[0] = 4; /* splitLF */ + gain_levels[1] = 8; /* full */ + gain_levels[2] = 8; /* Fix-env{ 0,1,2,3,4} */ + + lrsns_vq_gains[0] = &(lrsns_gains_Q11[0][0]); + lrsns_vq_gains[1] = &(lrsns_gains_Q11[1][0]); + lrsns_vq_gains[2] = &(lrsns_gains_Q11[2][0]); + + min_mse = LC3_CONST_FLOATMAX; + + + *gain_idx = 0; + *shape_idx = 0; + start_shape = 0; + end_shape = n_cand; + + for (sidx = start_shape; sidx < end_shape; sidx++) + { + /* Normalize the vectors */ + for (i = 0; i < M; i++) + { + yCur[sidx][i] = (LC3_FLOAT)y[sidx][i]; + } + pvq_enc_vec_normalize(yCur[sidx], M); + + for (gidx = 0; gidx < gain_levels[sidx]; gidx++) + { + mse = calc_mse(t2rot, yCur[sidx], lrsns_vq_gains[sidx][gidx], M); + + if (mse < min_mse) + { + *gain_idx = gidx; + *shape_idx = sidx; + min_mse = mse; + } + } + + } + + for (i = 0; i < M; i++) + { + y_norm[i] = yCur[*shape_idx][i]; + } + + *scq_gain = lrsns_vq_gains[*shape_idx][*gain_idx]; + + return; +} + +LC3_INT32 MSEsearchGeneric(LC3_FLOAT *scf, const LC3_FLOAT *sns_CB, LC3_INT32 v_len, LC3_INT32 cb_len, LC3_FLOAT* min_mse) +{ + + LC3_FLOAT f_tmp, mse; + LC3_INT32 i, n, ind; + + ind = -1; + + *min_mse = (LC3_FLOAT)LC3_CONST_POW_2_100; + for (i = 0; i < cb_len; i++) + { + mse = 0; + for (n = 0; n < v_len; n++) + { + f_tmp = (scf[n] - sns_CB[i * v_len + n]); + mse += (f_tmp * f_tmp); + } + + if (mse < *min_mse) + { + *min_mse = mse; + ind = i; + } + } + assert(ind >= 0 && ind < cb_len); + + return ind; +} + +void snslr_st1B_vector_dec(LC3_INT16 idx, const LC3_INT16* LFCB, const LC3_INT16 *HFCB, const LC3_INT16* seg_cnt_cum, const LC3_INT16* idx12b_cb, LC3_FLOAT *st1B_vector) +{ + /* decompose the received 0 ... 169 index , into the correct intger and float st1B vector */ + LC3_INT32 i, seg; /*counters*/ + const LC3_INT16 *lf_cb, *hf_cb; + LC3_INT16 idx_12b, lf_sign, hf_sign; + LC3_INT16 idx_LF, idx_HF; + LC3_INT16 buf[M]; + LC3_INT16 st1B_W16Q11[M]; + LC3_FLOAT f_Q11_scale = (1.0 / 2048.0); + + assert(idx >= 0 && idx < 170); + seg = 0; + while (seg_cnt_cum[seg + 1] <= idx) { + seg++; + } + assert(seg >= 0 && seg < 4); + + idx_12b = idx12b_cb[idx]; /* from sequential value to a coded 12b index*/ + + lf_sign = 1; /* assume a 0 bit -> "+" */ + if ((0x0800 & idx_12b) != 0) { + lf_sign = -1; /* assume a 1 bit -> " -" */ + } + + hf_sign = 1; /* assume a 0 bit -> "+" */ + if ((0x0400 & idx_12b) != 0) { + hf_sign = -1; /* assume a 1 bit -> "-" */ + } + idx_LF = (0x03e0 & idx_12b) >> 5; + idx_HF = (0x001f & idx_12b); + + /* extseg0 f,f */ + lf_cb = &(LFCB[idx_LF*(M / 2)]); + hf_cb = &(HFCB[idx_HF*(M / 2)]); + for (i = 0; i < (M / 2); i++) + { + st1B_W16Q11[i] = lf_sign * lf_cb[i]; /* imult() or negate */ + st1B_W16Q11[M / 2 + i] = hf_sign * hf_cb[i]; + } + memcpy(buf, st1B_W16Q11, sizeof(*buf)*M); /* buffer cpy needed for reversal sections */ + + if ((seg & 0x0002) != 0) + { /* r,* */ /* flip LF */ + for (i = 0; i < (M / 2); i++) + { + st1B_W16Q11[i] = buf[(M / 2 - 1) - i]; + } + } + + if ((seg & 0x0001) != 0) + { /* *,r */ /* flip HF */ + for (i = 0; i < (M / 2); i++) + { + st1B_W16Q11[(M / 2) + i] = buf[(M - 1) - i]; + } + } + + /* Cfloat: convert the 16bit integer Q11 values from LFCB, and HFCB into floats */ + for (i = 0; i < M; i++) + { + st1B_vector[i] = ((LC3_FLOAT)st1B_W16Q11[i]) * f_Q11_scale; + } +} + +LC3_INT32 MSEsearchCbBIdxMap(const LC3_FLOAT *scf, const LC3_INT16 *LFCB, const LC3_INT16 *HFCB, const LC3_INT16 *seg_cnt_cum, const LC3_INT16* idx12b_cb, LC3_INT32 v_len, LC3_INT32 cb_len, LC3_FLOAT* min_mse) +{ + LC3_INT32 seg, i, j; /*counters */ + LC3_INT32 L_mse; + LC3_INT16 scfLF_Q11[M], tmp_buf[M]; + LC3_INT16* scfHF_Q11; + const LC3_INT16 *lf_cb, *hf_cb; + LC3_INT16 err, best_ind, idx_12b, signbitLF, signbitHF, idx_LF, idx_HF; + LC3_INT32 L_mse_best = INT_MAX; /*a huge positive number */ + + UNUSED(cb_len); /*cb_len only used for assert/verification */ + + assert(v_len == M); + + scfHF_Q11 = (&scfLF_Q11[v_len / 2]); /* ptr init */ + + /*set up fwd,fwd search */ + for (i = 0; i < M; i++) + { + tmp_buf[i] = (LC3_INT16)LC3_ROUND(scf[i] * 2048.0); /* scf target moved to BASOP signed Word16Q11 integer domain */ + } + + best_ind = -1; /*for debug*/ + for (seg = 0; seg < 4; seg++) + { + memcpy(scfLF_Q11, tmp_buf, M * sizeof(*scfLF_Q11)); /* M * move16() */ + /*seg==0: fwd, fwd */ + /*seg==1: fwd, rev */ + /*seg==2: fwd, fwd */ + /*seg==3: rev, rev */ + + if ((seg & 0x0002) != 0) + { /* {r,*} */ /* flip LF */ + for (i = 0; i < (M / 2); i++) + { + scfLF_Q11[i] = tmp_buf[(M / 2 - 1) - i]; + } + } + if ((seg & 0x0001) != 0) + { /* {*,r} */ /* flip HF */ + for (i = 0; i < (M / 2); i++) + { + scfLF_Q11[M / 2 + i] = tmp_buf[(M - 1) - i]; + } + } + + for (i = seg_cnt_cum[seg]; i < seg_cnt_cum[seg + 1]; i++) + { + idx_12b = idx12b_cb[i]; /* indirect adressing lookup of 12b index pointing to LF and HF + individual sign swaps */ + signbitLF = (0x0800 & idx_12b); /* b11 logical */ + signbitHF = (0x0400 & idx_12b); /* b10 logical */ + idx_LF = (0x03e0 & idx_12b) >> 5; /* b9...b5 */ + idx_HF = (0x001f & idx_12b); /* b4..b0 lowest 5 bits */ + + lf_cb = &(LFCB[idx_LF * M / 2]); /* ptr init */ + hf_cb = &(HFCB[idx_HF * M / 2]); /* ptr init */ + + L_mse = 0; /* move32() */ /* we accumulate energies on the positive side */ + for (j = 0; j < (M / 2); j++) + { + err = (scfLF_Q11[j] - lf_cb[j]); /* a "+"sign, LF err in Q11 */ + if (signbitLF != 0) + { /* negate LF*/ + err = (scfLF_Q11[j] + lf_cb[j]); /* "-""-" --> "+" LF err in Q11 ,single BASOP */ + } + L_mse += (err * err); /* simulate L_mac0 , accumulate towards max positive side */ + + err = (scfHF_Q11[j] - hf_cb[j]); /* a "+"sign, HF err in Q11 */ + if (signbitHF != 0) + { /* negate HF */ + err = (scfHF_Q11[j] + hf_cb[j]); /* -- --> "+", LF err in Q11 ,single BASOP */ + } + L_mse += (err * err); /*simulate L_mac0 */ /* now total error */ + } + + L_mse_best = MIN(L_mse, L_mse_best); /* 1 cycle BASOP preupdate best */ + if ((L_mse - L_mse_best) == 0) + { + best_ind = i; /* update winner, single BASOP */ + } + } + }/* segment seg */ + + *min_mse = (LC3_FLOAT)((double)L_mse_best) / (2048.0*2048.0); /* Word32 mse -> Cfloat output calculation */ + + assert(best_ind >= 0 && best_ind < cb_len); + + return (LC3_INT32)best_ind; +} + +void snslr_st1C_vector_dec(LC3_INT16 idx, const LC3_INT8* CBW8, LC3_INT16 scaleQ4, LC3_INT16 inv_scaleQ15, LC3_INT32 v_len, LC3_INT32 cb_len, LC3_FLOAT *st1C_vector) +{ + /* decompose the received 0... 169 index , into the correct (integer and) float st1C vector */ + /* even in C-float the st1C coeffs are put into a S16Q11 final integers domain */ + /* Enables BE compatibility between {BASOP, float, double} arithmetic implmentations */ + + + LC3_INT32 i; /*counter*/ + const LC3_INT8 *cb; + LC3_INT32 L_tmp; + LC3_INT16 s_tmp, st1C_Q11[M]; + + UNUSED(v_len); + UNUSED(cb_len); + UNUSED(inv_scaleQ15); /* req for debugging only */ + assert(idx >= 0 && idx < cb_len); + assert(v_len == M); + + cb = &(CBW8[idx*M]); /* pointer init */ + for (i = 0; i < (M); i++) + { + /* BASOP: L_tmp = L_mult0((int16_t)cb[i], scaleQ4 ); */ /*S8Q7 * S15Q4 */ /*sign+7bit, sign+4 bits --> sign+11bit .lt sign+23 bits*/ + L_tmp = ((int16_t)cb[i] /*S8Q7*/ * scaleQ4 /* S16Q4 */); /* S32Q11 */ + + /* Cfloat: convert to Word16 Q11 integer as Word16 Q11 SNS domain bits, and then into floats */ + assert(L_tmp >= -32768L && L_tmp <= 32767L); /* INT16 domain check*/ + s_tmp = (int16_t)(L_tmp); + st1C_Q11[i] = s_tmp; + } + + /* Cfloat: convert the Word16 Q11 SNS domain bits, and then into floats */ + for (i = 0; i < M; i++) + { + st1C_vector[i] = ((LC3_FLOAT)st1C_Q11[i])*(1.0 / 2048.0); + } +} + +LC3_INT32 MSEsearchGenericScaledW8(LC3_FLOAT *scf, const LC3_INT8 *sns_CBW8, LC3_INT16 scaleQ4, LC3_INT16 inv_scaleQ15, LC3_INT32 v_len, LC3_INT32 cb_len, LC3_FLOAT* min_mse) +{ + /* scf float input values are typically in the range +12.0 to -12.0. + ROM table stored in WORD8 [+127,-128], format corresponding to ]+1.0 .. -1.0 ] + inv_scaleQ15, [downscaling value in Q15] applied before search + scaleQ12 upscaling value quantized in Q12, used in the mse calulation and in the common float and BASOP synthesis routines + + L_mse evaluated here in a positive integer Word32 domain to match BASOP + + Fuzzing/saturation considerations + max M==16 values (4 bits) yields 16*(256*256)=>2^(4+8+8)=2^20 .lt 2^31, + IntegerWord32 is a safe search domain + + a WC input analysis would be when half target entries are "-256" and half +255 + + */ + LC3_INT32 i, n, best_ind; /*counters*/ + LC3_INT32 L_mse, L_mse_best; + LC3_INT16 targetW16[M], err; + LC3_FLOAT f_tmp, f_scale; + const LC3_INT8 * cbW8; + + f_scale = ((LC3_FLOAT)inv_scaleQ15) / 32768.0; + for (i = 0; i < v_len; i++) { + f_tmp = (scf[i] * f_scale); + assert(f_tmp >= -4.0 && f_tmp < 4.0); /* check for about 2 bit integer margin in the target */ + targetW16[i] = (LC3_INT16)LC3_FLOOR(f_tmp*128.0); /*cast to INT16 W8Q7 */ + }; + /* in BASOP 1/32768 and *128 is handled by one single shift) */ + + L_mse_best = INT_MAX; /* largest possible positive number in INT32 */ + best_ind = -1; + + for (i = 0; i < cb_len; i++) { + L_mse = (0L); /* move32() */ + /* we accumulate energies on the positive side Word8 vectors do not have any issue with saturation (16*256*256) ==2^(4+8+8) .lt 2^31 MAX_INT */ + + cbW8 = &sns_CBW8[i*v_len]; /*ptr init */ + for (n = 0; n < v_len; n++) + { + err = (targetW16[n] - ((LC3_INT16)cbW8[n])); /* cast from Word8 to Word16 is not for free, + actual cost in a Word16 architecture is a L_and(x,0x00ffff) or a shr(x,8) */ + + L_mse += (err*err); /* L_mse = L_mac0(L_mse, err, err); */ + } + + if ((L_mse - L_mse_best) <= 0) + { /* a value closer to 0 */ + best_ind = i; /* single BASOP for best idx update */ + } + L_mse_best = MIN(L_mse, L_mse_best); /* always update best MSE using L_min() in the idx loop, reduces WC WMOPS */ + } + assert(best_ind >= 0 && best_ind < cb_len); + + + *min_mse = (LC3_FLOAT)((double)(L_mse_best)) / (128.0*128.0); /* Word32 L_mse in Q7 -> Cfloat output calculation */ + + f_tmp = (((double)scaleQ4) / 16.0); + *min_mse *= (f_tmp*f_tmp); /* make gain scaling a part of Word32 L_mse -> Cfloat output calculation */ + + return best_ind; +} + +/* LRSNS stage 1 functionality */ +LC3_INT32 snsQuantScfEncLRSt1ABC(LC3_FLOAT* env, LC3_INT32* L_index, LC3_FLOAT *min_mse_saveBCA_ptr, + LC3_INT32* ind_saveB_ptr, LC3_FLOAT* st1_vectors, LC3_INT32 pitch_rx, LC3_INT32 ltpf_rx) +{ + + LC3_INT32 i; + LC3_FLOAT *st1_vector, *st1_vectorA, *st1_vectorB, *st1_vectorC, target[M]; + LC3_FLOAT st1_vectorBC[M]; + LC3_FLOAT min_mse_saveA, min_mse_saveB, min_mse_saveC, min_mse_saveBC; + LC3_INT32 ind_saveA, ind_saveC; + const LC3_FLOAT *cb; + LC3_INT16 stage1_mode; /*0=A, 1=B, 2=C. -1==fail*/ + LC3_FLOAT min_mse_saveB_fxlike; + LC3_INT32 ind_saveB_fxlike = -1; + LC3_FLOAT st1_vectorB_idx[M]; + LC3_FLOAT st1C_lim; + LC3_FLOAT f_mse_tmp; + LC3_INT32 ind_saveC_ScaledW8 = -1; + LC3_FLOAT min_mse_saveC_ScaledW8; + +#ifdef LRSNS_CBC_NO_LTPF_DEPENDENCY + UNUSED(ltpf_rx); +#endif + + stage1_mode = -1; /* output mode */ + + st1_vectorA = &(st1_vectors[0]); + st1_vectorB = &(st1_vectors[1 * M]); + st1_vectorC = &(st1_vectors[2 * M]); + st1_vector = &(st1_vectors[3 * M]); + + /* snslr stage1 B(170) and C(170), A(2) evaluation */ + /* b0-b8 b9 + segm , idx9b , stop bit, comment use + -----+--------+--------- + A | 510,511| n/a, 2 entries, 9 bit total + ------+--------+-------- + ------+--------+--------+------- + B | 0--169 | 1 , 170 entries, 10 bit total + ------+--------+-------- + C | 170-339| 1 , 170 entries, 10 bit total + ------+--------+--------+------------ + ------+--------+--------+------------ + B* | 340-509| 1 --> aux=1, 170, 3b+17b for stage2 'LR_full/LR_fix', 30 bit total + ------+--------+--------+------- + B* | 0--169 | 0 , --> aux=0, 170, 2b+17b for stage2 'LR_SplitLF' , 29 bit total + ------+--------+--------+------- + B* | 170-339| 0 , --> aux=1, 170, 2b+17b for stage2 'LR_SplitLF',29 bit total + ------+--------+--------+------- + B* | 340-509| 0 --> aux=0, 170, 3b+17b for stage2 'LR_full/LR_fix', 30 bit total + ------+--------+--------+------- + */ + + { /* stage 1 section A(2), a very small 2xM entry cb */ + cb = lrsns_st1A_topTab_1bitNoDC; + + memcpy(target, env, sizeof(LC3_FLOAT)*M); + + ind_saveA = MSEsearchGeneric(target, cb, M, 2, &min_mse_saveA); + memcpy(st1_vectorA, &(cb[ind_saveA*M]), sizeof(LC3_FLOAT)*M); + } + + min_mse_saveB = LC3_CONST_FLOATMAX; /*safety init*/ + + { /* stage1 section B(170) MSE analysis */ + memcpy(target, env, sizeof(LC3_FLOAT)*M); + *ind_saveB_ptr = -1; + + ind_saveB_fxlike = MSEsearchCbBIdxMap(target, st1SCF0_7_base5_32x8_Q11, st1SCF8_15_base5_32x8_Q11, + lrsns_st1B_merged170orderSortedSegmCum, lrsns_st1B_merged170orderSort12bitIdx, M, 170, &min_mse_saveB_fxlike); /*st1B LF,HF idx lookup search 170 ,170 Word16s , 0.34kB ROM */ + snslr_st1B_vector_dec(ind_saveB_fxlike, st1SCF0_7_base5_32x8_Q11, st1SCF8_15_base5_32x8_Q11, lrsns_st1B_merged170orderSortedSegmCum, lrsns_st1B_merged170orderSort12bitIdx, + st1_vectorB_idx); + + *ind_saveB_ptr = ind_saveB_fxlike; + min_mse_saveB = min_mse_saveB_fxlike; + memcpy(st1_vectorB, st1_vectorB_idx, sizeof(LC3_FLOAT)*M); /*use low ROM version */ + + { + /* remove DC that can remain in the LF,HF index stored stage cb B structure */ + /* a very slight offline decrease in perf 0.001 dB in AvSD when searching with DC above, + but it allows much better stage1 ROM-reuse performance + */ + LC3_FLOAT dc = snslr_remove_st1_DC_fQ11(st1_vectorB, M); /* inplace removal of dc in st1_vectorB */ + LC3_FLOAT f_tmp; + assert(min_mse_saveB >= 0.0); + + f_tmp = min_mse_saveB - M * (dc*dc); + min_mse_saveB = MAX(f_tmp, 0.0); /* truncation in DC removal can cause negative MSE, limit to 0 */ + } + } /* end of stage 1 section B , search */ + + + + st1C_lim = 3.97; /* corresponding to an SD limit of = 1.5 */ + f_mse_tmp = MIN(min_mse_saveA*0.875, min_mse_saveB); + + if (f_mse_tmp < st1C_lim) /* skip C search if SD is already low enough < 1.5dB) to save average WMOPS */ + + { + min_mse_saveC = 2 * 5.579999923706055; /*disable C selection in consecutive logic */ + ind_saveC = 0; /* a valid index that will not be used */ + } + else + { /* search stage1 C */ + /* search another set (pitch dependent section C) of 170 mean residual vectors */ + /* pitch_info rx selects a mean and then employ a trained residual 1x170W8 based harmonic outlier table */ + + /* float means are based on Word16 S16Q11 values, so that BASOP and float always may become BE in synthesis*/ + int16_t CBCmeanp_ind = pitch_rx; /* 0 or 1 */ + +#ifndef LRSNS_CBC_NO_LTPF_DEPENDENCY + if (pitch_rx != 0 && ltpf_rx != 0) + { + CBCmeanp_ind = CBCmeanp_ind + 1; /*LTPF_rx is also active */ + } +#else + /* CbC only dependent on LTP transmission on/off */ +#endif + + for (i = 0; i < M; i++) + { + target[i] = env[i] - lrsns_st1CTrainedMapMeans[CBCmeanp_ind][i]; + } + + ind_saveC_ScaledW8 = MSEsearchGenericScaledW8(target, lrsns_st1C_Both_Word8, + lrsns_st1C_Both_scaleQ4_7p4bits_fx[1], lrsns_st1C_Both_inv_scaleQ15_7p4bits_fx[1], + M, 170, &(min_mse_saveC_ScaledW8)); + + snslr_st1C_vector_dec(ind_saveC_ScaledW8, lrsns_st1C_Both_Word8, lrsns_st1C_Both_scaleQ4_7p4bits_fx[1], lrsns_st1C_Both_inv_scaleQ15_7p4bits_fx[1], + M, 170, st1_vectorC); + /* integer based decoder side synthesis of scaled W8 table for best possible interop */ + + ind_saveC = ind_saveC_ScaledW8; + min_mse_saveC = min_mse_saveC_ScaledW8; + + for (i = 0; i < M; i++) { + st1_vectorC[i] += lrsns_st1CTrainedMapMeans[CBCmeanp_ind][i]; /* Q11 means*/ + } + } + + /* BC stage1 comparison */ + /* initially assume B as stage 1 winner */ + min_mse_saveBC = min_mse_saveB; + L_index[0] = *ind_saveB_ptr; /* 0...169 */ + + memcpy(st1_vector, st1_vectorB, sizeof(LC3_FLOAT)*M); /* stage 1 segmentB result without DC copied as base for st2 */ + + + if (min_mse_saveC < min_mse_saveBC) + { /* C better than B */ + min_mse_saveBC = min_mse_saveC; + L_index[0] = 170 + ind_saveC; /* [2x 170] (9+1)b [170-339] , ">=170" is a signal to multiplexor */ + memcpy(st1_vector, st1_vectorC, sizeof(LC3_FLOAT)*M); + } + + memcpy(st1_vectorBC, st1_vector, sizeof(LC3_FLOAT)*M); + L_index[1] = -10; + assert(min_mse_saveBC >= 0.0); + + /* (9(A)<->10(BC) bit weighted comparison */ + *min_mse_saveBCA_ptr = min_mse_saveBC; + if (min_mse_saveA*0.875 < min_mse_saveBC) /* a minor favouring of the 9b vector results sqrt(0.875) => approx 0.6dB level domain */ + { + L_index[0] = 510 + ind_saveA; /* only [510, 511] possible */ + L_index[1] = -9; + + cb = lrsns_st1A_topTab_1bitNoDC; + memcpy(st1_vectorA, &(cb[ind_saveA*M]), sizeof(LC3_FLOAT)*M); + memcpy(st1_vector, st1_vectorA, sizeof(LC3_FLOAT)*M); + + *min_mse_saveBCA_ptr = min_mse_saveA * 0.875;; + } + + /* index0_saveBCA = index[0];*/ /* 0 ... 511 */ + /* index1_saveBCA = index[1];*/ /* -9 or -10 */ + + stage1_mode = 2; /* C , assumed */ + if (L_index[0] >= 510) + { + stage1_mode = 0; /* A */ + } + if (L_index[0] <= 169) { + stage1_mode = 1; /* B */ + } + + return stage1_mode; /* return best stage1 mode */ +} + +LC3_INT16 snsQuantScfEncLR(LC3_FLOAT* env, LC3_INT32* L_index, LC3_FLOAT* envq, Dct2 dct2structSNS, LC3_INT32 pitch_rx, LC3_INT32 ltpf_rx) +{ + LC3_INT32 i; + LC3_FLOAT min_mse_saveBCA; + LC3_INT32 ind_saveB; + LC3_INT16 st1_mode; + + LC3_FLOAT stage2_en1_norm_sub[M]; + LC3_FLOAT st1_vectors[(SNSLR_MAX_PVQ_SEARCH_CAND+1)*M], *st1_vectorA, *st1_vectorB, *st1_vectorC, *st1_vector; + LC3_FLOAT pvq_target_pre[M]; + LC3_FLOAT pvq_target[M]; +#ifdef LRSNS_WMC_FIX + LC3_INT32 y[SNSLR_MAX_PVQ_SEARCH_CAND][M]; /* o: [3]*[0...M-1] */ +#else + LC3_INT32 y_tmp[3*M]; +#endif + LC3_FLOAT stage2_en1_norm_pre_sub[M]; + LC3_FLOAT envq_st1B_st2[M]; + LC3_FLOAT mse_st1B_st2; + LC3_FLOAT mse_st1B_st2_dct_domain; + LC3_INT32 gain_idx, shape; + LC3_FLOAT scfq_gain; + LC3_INT32 fix_shape_idx; + LC3_INT16 envelope_bits; /* function output */ + LC3_INT32 fix_shift_ind, fix_shift_bits, fix_end_sign, LS_tmp_ind; + LC3_INT32 shape_local; + + UNUSED(fix_shift_bits); /* used for assert */ + +#ifndef LRSNS_WMC_FIX + LC3_INT32(*y)[M]; /* C-construct to allow matrix adressing into a scratch area */ +#endif + envelope_bits = -1; /* output : 9,10, 29/30 */ + gain_idx = 1; /* stage 2 gain idx range 0 ... 7 , or 0 ... 3 */ + shape = -1; /* stage 2 shape range 0 ... 5 */ + + st1_vectorA = &(st1_vectors[0]); + st1_vectorB = &(st1_vectors[1 * M]); + st1_vectorC = &(st1_vectors[2 * M]); + st1_vector = &(st1_vectors[3 * M]); + + +#ifndef LRSNS_WMC_FIX + y = (LC3_INT32(*)[M]) &(y_tmp[0]); /* y is an NxM Matrix Ptr */ +#endif + { /* stage1 A,B,C */ + + ind_saveB = -1; + min_mse_saveBCA = M * 32.0*32.0; + st1_mode = snsQuantScfEncLRSt1ABC( + env, L_index, &min_mse_saveBCA, &ind_saveB, st1_vectors, pitch_rx, ltpf_rx); + + if (ind_saveB < 0 || ind_saveB > 169) + { + assert(ind_saveB >= 0 && ind_saveB <= 169); /* idxB always needed in case stage2 is activated */ + } + + if (st1_mode == 0) + { + envelope_bits = 9; + memcpy(st1_vector, st1_vectorA, sizeof(LC3_FLOAT)*M); + assert(L_index[0] >= 510 && L_index[0] <= 511); + } + + if (st1_mode == 1) + { + envelope_bits = 10; + memcpy(st1_vector, st1_vectorB, sizeof(LC3_FLOAT)*M); + assert(L_index[0] >= 0 && L_index[0] <= 169); + } + + if (st1_mode == 2) + { + envelope_bits = 10; + memcpy(st1_vector, st1_vectorC, sizeof(LC3_FLOAT)*M); + assert(L_index[0] >= 170 && L_index[0] < 2 * 170); + } + + L_index[1] = -910; /* aux */ + L_index[2] = -envelope_bits; /* signal shape */ + + } + /* only run stage 2 when necessary */ + + { + LC3_FLOAT mse_lim_smooth; + mse_lim_smooth = (5.41); /* 1.75 SD */ + + mse_st1B_st2 = 2.0* min_mse_saveBCA + 1.0; /* indicate that st1B+st2 is not used by setting a higher MSE than st1BCA */ + + if (min_mse_saveBCA > mse_lim_smooth) + { + /* run and evaluate STAGE 2, using vector B as stage 1 */ + for (i = 0; i < M; i++) + { + pvq_target_pre[i] = env[i] - st1_vectorB[i]; + } + + dct2_apply(&dct2structSNS, pvq_target_pre, pvq_target); + + pvq_target[0] = 0.0; /* DC always zero */ + + fix_shape_idx = -1; + pvq_fess_enc_search(pvq_target, y, &fix_shape_idx); /* best shape search splitLF, full, best_fess_env */ + + assert(y[0][0] == 0 && y[1][0] == 0 && y[2][0] == 0); + lrsns_quant_shape_gain(pvq_target, y, &gain_idx, &shape, stage2_en1_norm_pre_sub, &scfq_gain, 2 + 1); + + if (shape == 2) + { + shape = 2 + fix_shape_idx; + } + + /* check if MSE after stage 2 is better already here in dct domain, avoid unnecessary IDCT-II calls */ + envq_st1B_st2[0] = 0; + for (i = 1; i < M; i++) + { + envq_st1B_st2[i] = (stage2_en1_norm_pre_sub[i] * scfq_gain); + } + + mse_st1B_st2_dct_domain = calc_mse(pvq_target, envq_st1B_st2, 1.0f, M); + + if (min_mse_saveBCA < mse_st1B_st2_dct_domain) + { + /* no need for an IDCT as stage2 was worse than only stage1 */ + mse_st1B_st2 = mse_st1B_st2_dct_domain; + } + else + { + /* Inverse transform */ + idct_II(stage2_en1_norm_pre_sub, stage2_en1_norm_sub, M); + + for (i = 0; i < M; i++) + { + envq_st1B_st2[i] = st1_vectorB[i] + (stage2_en1_norm_sub[i] * scfq_gain); + } + mse_st1B_st2 = calc_mse(env, envq_st1B_st2, 1.0f, M); + } + } + } /*end of stage2 search */ + + /* post-evaluate if one of (st1B, st1C, st1A) was actually better than st1B+stage2 */ + if (mse_st1B_st2 < min_mse_saveBCA) + { /* use stage1B + st2 at 29b/30b bits total */ + L_index[0] = ind_saveB; + L_index[1] = 2930; /* later stage2 aux value LS_splitLF or LS_full or s0, put here as a 0 or 1 */ + L_index[2] = shape; /* 0=splitLF, 1=full, ( 2=fixEnv0, 3=fixEnv1, 4: fixEnv2, 5: fixEnv3 ) */ + L_index[3] = gain_idx; /* gain_idx with a shape dependent number of levels (4 or 8 levels ) */ + + memcpy(envq, envq_st1B_st2, sizeof(LC3_FLOAT)*M); + memcpy(st1_vector, st1_vectorB, sizeof(LC3_FLOAT)*M); /* save final st1B result, st1 in combination with stage 2, for verification */ + envelope_bits = 29; /* 'LR_splitLF' */ + if (shape > 0) + { + envelope_bits += 1; /*30 'LR_full/LR_fixenv' */ + } + + { + /* DBG check values */ + assert(shape >= 0); + assert(envelope_bits >= 29); + assert(L_index[0] <= 170); /*only B allowed */ + assert(L_index[1] >= 0); + + assert(gain_idx >= 0); /*index*/ + assert(scfq_gain > 0.0); /* value */ + } + } + else + { /* stick to stage1(best of BCA) at 9 or 10 bits */ + assert(L_index[1] < 0 && L_index[0] >= 0 && L_index[0] < 512); + envelope_bits = ((L_index[0] >= 510) ? 9 : 10); + shape = -envelope_bits; /* signal an invalid shape number to enc-entropy */ + + memcpy(envq, st1_vector, M * sizeof(LC3_FLOAT)); /* output */ + memset(stage2_en1_norm_sub, 0, M * sizeof(*stage2_en1_norm_sub)); + scfq_gain = 0.0f; + gain_idx = -1; /* L_index sentinel */ + L_index[2] = shape; + } + + /******************************************************************/ + /* signal to enc_entropy for LRSNS semi-fractional multiplexing */ + /******************************************************************/ + /* integer multiplexing 29/30 bit modes into intermediate unmuxed integer indeces 0...7 */ + /* a bit of fractional multiplexing for these indeces 0...7 is done later, in function enc_entropy() */ + if (shape >= 0) + { /* stage 2 multiplexing manipulations */ + + + if (shape == 0) + { /* splitLF */ + LC3_INT32 n5k = 0; + for (i = 0; i < 5; i++) + { + n5k += abs(y[shape][1 + i]); + } + + if (n5k == 6) + { + MPVQ_enum(5, &(y[shape][1]), &(L_index[4]), &LS_tmp_ind); /* P(N=5,K=6) (10)=10 bit L_index */ + L_index[1] = LS_tmp_ind; /* set the aux bit for the splitLF path, plant the first LS as aux */ + assert((L_index[4] >= 0) && (L_index[4] < (SNSLR_NPVQ_L5K6 >> 1))); + + MPVQ_enum(8, &(y[shape][1 + 5]), &(L_index[5]), &LS_tmp_ind); + L_index[5] = (L_index[5] << 1) + LS_tmp_ind; /* A full PVQ 7 bit index for the P(N=8,K=2) B config*/ + assert((L_index[5] >= 0) && (L_index[5] < (1 << 7))); + } + else + { + MPVQ_enum(5, &(y[shape][1]), &(L_index[4]), &LS_tmp_ind); /* PVQ(N=5,K=8) (12.x in total, i.e. LS+ 11.x ) */ + L_index[1] = LS_tmp_ind; /* aux bit for the splitLF path , plant the first LS as aux */ + assert((L_index[4] >= 0) && (L_index[4] < (SNSLR_NPVQ_L5K8 >> 1))); + L_index[5] = -8; /* signal LF PVQ(5,8) and zeroed HF(10,0) */ + } + } + if (shape == 1) + { /* full (15,5) , LS kept separated */ + /* indicate a stage2 path in the 9 bit stage1 index */ + MPVQ_enum(15, &(y[shape][1]), &(L_index[4]), &LS_tmp_ind); /* mPVQ 16.66 bits in index[4], and LS 1 bit in index[1] */ + L_index[1] = LS_tmp_ind; /*aux bit location, 0 or 1 , we plant the LS there */ + assert((L_index[4] >= 0) && (L_index[4] < (SNSLR_NPVQ_L15K5 >> 1))); + } + if (shape >= 2 && shape <= 5) + { + /* fixEnv0, fixEnv1, fixEnv2, fixEnv3 */ + /* send the fixed env subshape mode to enc_entropy */ + L_index[4] = (shape - 2); /* env shape, 0-->"1" , 1--> "env1" */ /* L_index[2] has original shape 0...5 */ + + shape_local = 2; /*a single y shape vector for all fixed env */ + + fix_shift_ind = 0; + while (y[shape_local][1 + fix_shift_ind] == 0) + { + fix_shift_ind += 1; + } + fix_shift_bits = 2; + + assert(fix_shift_ind < (1 << fix_shift_bits)); + + L_index[1] = (y[shape_local][1 + fix_shift_ind /* + 0*/] < 0); /* aux_bit : 0 (or 1) , will indicate the s0 sign in the FESS fix shape */ + + + fix_end_sign = 12; + if (shape == 5) + { + assert(L_index[4] == 3); + fix_end_sign = (fix_end_sign - 2); /* shape 4 has 2 bits shift and a total of 10 signs =2^10*2^2 = 2^12 = 4096 */ + } + + L_index[5] = fix_shift_ind; /* the two shift bits will be pushed up to b11,b12 , for 11 signs s1-s11 */ + + for (int sign_ind = 1; sign_ind < fix_end_sign; sign_ind++) /* push the remaining sequential signs s1-s11(or s1-s9), into a single idx */ + { /* s1 is in the MSB, and s11 is in the lsb*/ + L_index[5] = L_index[5] << 1; + if (y[shape_local][1 + fix_shift_ind + sign_ind] < 0) /*"1" means negative, "0" means positive */ + { + L_index[5] += 1; + } + } + assert(L_index[5] >= 0 && L_index[5] < (1 << (fix_shift_bits + (fix_end_sign - 1)))); + } + } /* end of stage2 premultiplexing */ + + { + assert(envelope_bits == 9 || envelope_bits == 10 || envelope_bits == 29 || envelope_bits == 30); + } + + return envelope_bits; +} + +void FESSdeenum(LC3_UINT8 dim_in, /* i : dimension of vec_out */ + LC3_UINT8 n_env, /* i : number of envelopes */ + LC3_UINT8 n_shift, /* i : number shifts */ + LC3_UINT8 n_signs, /* i : number signs */ + LC3_INT32 env_ind, /* i:indx */ + LC3_INT32 shift_ind, /* i:indx */ + LC3_INT32 sign_ind, /* i:indx */ + LC3_INT32* vec_out /* o : FESS integer pulse train */) +{ + + LC3_INT32 i; + LC3_INT32 sign_val; + + assert(n_env >= 1 && n_env <= 4); + assert(env_ind >= 0 && env_ind < n_env); + assert(shift_ind >= 0 && shift_ind < n_shift); + + UNUSED(n_env); + UNUSED(n_shift); + memset(vec_out, 0, sizeof(*vec_out)*dim_in); + + for (i = (shift_ind + n_signs - 1); i >= shift_ind; i--) + { + /* low numbered coeff signs are in the msb's */ + /* high numbered coeff signs are in the lsb's */ + assert(i < dim_in); + sign_val = 1 - 2 * (sign_ind & 0x01); + sign_ind = (sign_ind >> 1); + vec_out[i] = sign_val * env_ptrs[env_ind][i]; /* vec_out[i] = sign_val * amps[env_ind*(M - 1) + i]; */ + } +} + +void snsQuantScfDecLR(LC3_INT32* sns_vq_idx, LC3_FLOAT* scf_q, LC3_INT32 pitch_rx, LC3_INT32 ltpf_rx) +{ + LC3_INT32 i; + LC3_INT32 mPVQ_ind; /* can be 16-17 bits */ + LC3_INT16 shape_idx, gain_idx, cb_idx, aux_idx, LS_ind; + LC3_INT16 env_ind, shift_ind, sign_ind, n_signs; + + LC3_INT32 Y_shape_j[M]; + LC3_FLOAT Xq_shape_j[M], Xq_shape_j_idct[M], sum; + const LC3_FLOAT *cb; + const LC3_FLOAT *gainTab; + LC3_FLOAT st1_scf_q[M]; + LC3_INT16 CBCmeanp_ind = pitch_rx; /* 0 or 1 */ + const LC3_FLOAT *mean_cb; + LC3_INT16 sign_mask = 0x07ff; + + +#ifdef LRSNS_CBC_NO_LTPF_DEPENDENCY + UNUSED(ltpf_rx); +#endif + + sum = 0; + memset(Y_shape_j, 0, sizeof(LC3_INT32) * M); + + gainTab = &(lrsns_gains_Q11[0][0]); /* gcc warning init */ + gain_idx = 0; /* gcc warning init */ + + cb_idx = sns_vq_idx[0]; + aux_idx = sns_vq_idx[1]; + shape_idx = sns_vq_idx[2]; /* analysis order shape idx -9,-10, 0,1, 2,3,4,5 */ + gain_idx = sns_vq_idx[3]; /* stage 2 gain */ + + /* Stage1 cand */ + if (shape_idx == -9) + { + /* minminal 2*16 SNS codebook, no DC */ + cb = lrsns_st1A_topTab_1bitNoDC; + memcpy(scf_q, &(cb[cb_idx * M]), sizeof(LC3_FLOAT) * M); + } + else if (shape_idx == -10) + { /* 0..339 */ /* stage 1 only, transmitted in 9+1= 10 bits */ + if (cb_idx < 170) + { /*Stage 1B */ + snslr_st1B_vector_dec(cb_idx, st1SCF0_7_base5_32x8_Q11, st1SCF8_15_base5_32x8_Q11, lrsns_st1B_merged170orderSortedSegmCum, lrsns_st1B_merged170orderSort12bitIdx, scf_q); + snslr_remove_st1_DC_fQ11(scf_q, M); + } + else + { + cb_idx -= 170; + /* Stage 1C harm outlier CB with a pitch dependent mean */ + /* Q11 values , so that BASOP and float always becomes BE in synthesis*/ + assert(cb_idx >= 0 && cb_idx < 170); + snslr_st1C_vector_dec(cb_idx, lrsns_st1C_Both_Word8, lrsns_st1C_Both_scaleQ4_7p4bits_fx[1], lrsns_st1C_Both_inv_scaleQ15_7p4bits_fx[1], + M, 170, scf_q + ); + + + /* cbC add harmonic mean , based on pitch_info availability */ + pitch_rx = sns_vq_idx[3]; /* LTP active flag directly from dec_entropy */ +#ifdef LRSNS_CBC_NO_LTPF_DEPENDENCY + ltpf_rx = 0; /* CB_C has no dependency on LTPF active flag */ +#else + ltpf_rx = sns_vq_idx[4]; /* LTPF active flag LTP active flag directly from dec_entropy */ +#endif + CBCmeanp_ind = pitch_rx; /* 0 or 1 */ +#ifndef LRSNS_CBC_NO_LTPF_DEPENDENCY + if (pitch_rx != 0 && ltpf_rx != 0) + { + CBCmeanp_ind = CBCmeanp_ind + 1; /* high corr ltpf_rx is also active */ + } +#endif + + mean_cb = lrsns_st1CTrainedMapMeans[CBCmeanp_ind]; /* point to pitch dependent mean */ + for (i = 0; i < M; i++) + { + scf_q[i] += mean_cb[i]; + } + /* remove_DC() call is not required for section C */ + /* a very small DC can still exist though, due to Q7+Q4 quantization of values */ + } + } + else + { /* 0...169 */ /* st1B* used with a stage 2 shape submode */ + assert(shape_idx >= 0); + snslr_st1B_vector_dec(cb_idx, st1SCF0_7_base5_32x8_Q11, st1SCF8_15_base5_32x8_Q11, lrsns_st1B_merged170orderSortedSegmCum, lrsns_st1B_merged170orderSort12bitIdx, scf_q); + snslr_remove_st1_DC_fQ11(scf_q, M); /* DC needs removal for st1 part B */ + } + memcpy(st1_scf_q, scf_q, sizeof(LC3_FLOAT) * M); /* keep track of stage 1 contribution */ + + if (shape_idx >= 0) /* stage 2 shapes 0,1, 2,3,4,5 ( negative idx used for stage1 only */ + { + /* Stage 2 SNS VQ decoding */ + /* Decode shape_j */ + Y_shape_j[0] = 0; /* no DCT-II DC-coeff decoded */ + + switch (shape_idx) + { + case 0: /* splitLF 29 bits total */ + LS_ind = aux_idx; + mPVQ_ind = sns_vq_idx[4]; /* mPVQ(5,6) or mPVQ(5,8) */ + + if (sns_vq_idx[5] >= 0) + { + MPVQdeenum(5, 6, LS_ind, mPVQ_ind, &Y_shape_j[1]); + LS_ind = sns_vq_idx[5] & 0x1; + mPVQ_ind = sns_vq_idx[5] >> 1; + MPVQdeenum(8, 2, LS_ind, mPVQ_ind, &Y_shape_j[1 + 5]); + } + else + { + MPVQdeenum(5, 8, LS_ind, mPVQ_ind, &Y_shape_j[1]); + } + gainTab = &(lrsns_gains_Q11[0][0]);/* 4 levels in 2 bits */ + + break; + case 1: /* full 30 bits total */ + LS_ind = aux_idx; + mPVQ_ind = sns_vq_idx[4]; + MPVQdeenum(15, 5, LS_ind, mPVQ_ind, &Y_shape_j[1]); + gainTab = &(lrsns_gains_Q11[1][0]); /* 8 levels in 3 bits */ + + break; + case 2: /* fix env 0 , init_bell 12 signs */ + case 3: /* fix env 1 , decay 24-->13 12 signs */ + case 4: /* fix env 2 , start bell 12 signs */ + case 5: /* fix env 3 , early bell 10 signs */ + LS_ind = aux_idx; /* s0 */ + env_ind = sns_vq_idx[4]; + assert(env_ind == (shape_idx - 2)); + + n_signs = 12; /* including s0 */ + if (env_ind == 3) { + n_signs -= 2; + } + sign_mask = (sign_mask >> (12 - n_signs)); + + shift_ind = sns_vq_idx[5] >> (n_signs - 1); + sign_ind = sns_vq_idx[5] & sign_mask; + + /* put s0 , right next to s1 , to make the sign decoding loop easier */ + sign_ind = (sign_ind)+(LS_ind << (n_signs - 1)); /* s0 put as MSB at 12th position 2^11 , lsb at 2^0 */ + + /*FixEnvShiftSigns deenumeration */ + FESSdeenum(15, 4, 4, n_signs, env_ind, shift_ind, sign_ind, &Y_shape_j[1]); /*30b , 4xenv,4xshifts, 10 or12 signs, over 15 positions,*/ + gainTab = &(lrsns_gains_Q11[2][0]);; /* 8 levels in 3 bits */ + /* fix_envshift_nb = env_ind * 4 + shift_ind; */ /* index for fast normalization lookup */ + break; + default: + + break; + } + + /* Unit energy normalization of the received shape */ + for (i = 0; i < M; i++) + { + sum += (Y_shape_j[i] * Y_shape_j[i]); + } + + sum = 1.0 / LC3_SQRT(sum); /* all shapes will have tabled inv_sqrt() divisions as factors in BASOP */ + + for (i = 0; i < M; i++) + { + Xq_shape_j[i] = Y_shape_j[i] * sum; + } + + /* Reconstruction of the quantized SNS scale factors */ + idct_II(Xq_shape_j, Xq_shape_j_idct, M); + for (i = 0; i < M; i++) { + scf_q[i] += Xq_shape_j_idct[i] * gainTab[gain_idx]; + } + } + else + { /* -9, -10 */ + /* LRSNS stage 1 variations only */ + memcpy(scf_q, st1_scf_q, sizeof(LC3_FLOAT) * M); + } +} + +/* LRSNS integer precision based function needed in both encoder and decoder */ +LC3_FLOAT snslr_remove_st1_DC_fQ11(LC3_FLOAT *scfq, LC3_INT32 len) +{ + LC3_INT32 i; /*Counter*/ + LC3_INT32 L_dcQ11; + LC3_FLOAT f_dcQ11 = 0.0; + L_dcQ11 = 0L; + + for (i = 0; i < len; i++) { + L_dcQ11 += (LC3_INT32)(scfq[i] * 2048.0f); /* BE simulation of DC Q11 summation of truncated values in BASOP, preferably BE in synthesis in FLP/BASOP decoder */ + } + + assert(len == M); + { + L_dcQ11 = L_dcQ11 >> 4; /* make the average in integer domain , no rounding applied before shift, on purpose */ + f_dcQ11 = ((LC3_FLOAT)L_dcQ11) *(1.0f / 2048.0f); /* now a Q11 value to match the overall generic Q11 BASOP scaling of stage1 variables */ + } + + for (i = 0; i < len; i++) + { + scfq[i] -= f_dcQ11; /* result update */ + } + return f_dcQ11; /* output used for encoder side mse update*/ +} + +#endif diff --git a/lib_lc3plus/structs.h b/lib_lc3plus/structs.h index 357531c3e89683efde5ec7e3c12d1b62774008f7..b446c3a201732c65543c6fb4465cc6c0373c2e97 100644 --- a/lib_lc3plus/structs.h +++ b/lib_lc3plus/structs.h @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.5.1 * +* ETSI TS 103 634 V1.6.1 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -195,6 +195,9 @@ typedef struct { LC3_INT16 overall_counter; LC3_INT8 longterm_counter_byte_position; LC3_INT8 longterm_counter_bit_position; +#ifdef CR13_C_RESET_CLASSIFIER_AFTER_BAD_FRAMES + LC3_INT16 numberOfGoodFrames; +#endif } PlcAdvSetup; #endif diff --git a/lib_lc3plus/tns_coder.c b/lib_lc3plus/tns_coder.c index 9e3c3f6f206cd9ea92490640072bc4a476de82d6..3dbd1e9aa0564149b753eca6d9066a47ed43ebbf 100644 --- a/lib_lc3plus/tns_coder.c +++ b/lib_lc3plus/tns_coder.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.5.1 * +* ETSI TS 103 634 V1.6.1 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * @@ -142,7 +142,7 @@ void poly2rc(LC3_FLOAT* a, LC3_FLOAT* out, LC3_INT len) } -void processTnsCoder_fl(LC3_FLOAT* x, LC3_INT bw_cutoff_idx, LC3_INT bw_fcbin, LC3_INT fs, LC3_INT N, LC3_INT frame_dms, LC3_INT nBits, +void processTnsCoder_fl(LC3_FLOAT* x, LC3_INT bw_cutoff_idx, LC3_INT bw_fcbin, LC3_INT fs, LC3_INT N, LC3PLUS_FrameDuration frame_dms, LC3_INT nBits, LC3_INT* order_out, LC3_INT* rc_idx, LC3_INT* tns_numfilters, LC3_INT* bits_out , LC3_INT16 near_nyquist_flag ) @@ -159,16 +159,15 @@ void processTnsCoder_fl(LC3_FLOAT* x, LC3_INT bw_cutoff_idx, LC3_INT bw_fcbin, L /* Init */ - if (fs >= 32000 && frame_dms >= 50) { + if (fs >= 32000 && frame_dms >= LC3PLUS_FRAME_DURATION_5MS) { numfilters = 2; } else { numfilters = 1; } /* 40 * frame_dms / 10 = 4 * frame_dms */ - if (N > 4 * frame_dms) - { - N = 4 * frame_dms; + if (N > 40 * ((LC3_FLOAT) (frame_dms*1.25*10) / 10.0)) { + N = 40 * ((LC3_FLOAT) (frame_dms*1.25*10) / 10.0); fs = 40000; } @@ -184,27 +183,35 @@ void processTnsCoder_fl(LC3_FLOAT* x, LC3_INT bw_cutoff_idx, LC3_INT bw_fcbin, L switch (frame_dms) { - case 25: +#ifdef CR9_C_ADD_1p25MS + case LC3PLUS_FRAME_DURATION_1p25MS: + maxOrder = 4; + nSubdivisions = 2.0; + break; +#endif + case LC3PLUS_FRAME_DURATION_2p5MS: maxOrder = 4; nSubdivisions = 2.0; break; - case 50: + case LC3PLUS_FRAME_DURATION_5MS: maxOrder = 4; nSubdivisions = 2.0; break; - case 75: + case LC3PLUS_FRAME_DURATION_7p5MS: maxOrder = 8; nSubdivisions = 3; break; - case 100: + case LC3PLUS_FRAME_DURATION_10MS: maxOrder = 8; nSubdivisions = 3.0; break; + case LC3PLUS_FRAME_DURATION_UNDEFINED: + assert(0); } minPredictionGain = 1.5; - if (nBits >= 4.8 * frame_dms) { + if (nBits >= 4.8 * ((LC3_FLOAT) frame_dms * 1.25 * 10)) { order = order1_tns; } else { order = order2_tns; @@ -293,7 +300,7 @@ void processTnsCoder_fl(LC3_FLOAT* x, LC3_INT bw_cutoff_idx, LC3_INT bw_fcbin, L if (tns == 1) { minPGfac = 0.85; maxPG = 2; - if (nBits >= 4.8 * frame_dms) { + if (nBits >= 4.8 * frame_dms*1.25*10) { maxPG = minPredictionGain; } @@ -335,11 +342,11 @@ void processTnsCoder_fl(LC3_FLOAT* x, LC3_INT bw_cutoff_idx, LC3_INT bw_fcbin, L order_out[f] = order_tmp; - // Disable TNS if order is 0: + /* Disable TNS if order is 0: */ if (order_out[f] == 0) { tns = 0; - // Jump to else statement + /* Jump to else statement */ goto tns_disabled; } tmp = order[order_out[f] - 1]; diff --git a/lib_lc3plus/tns_decoder.c b/lib_lc3plus/tns_decoder.c index 05f8036fc4b99ed64a92e78eb44477adf60806a2..37e831d464c5ecc031056fb276beba5c346788a6 100644 --- a/lib_lc3plus/tns_decoder.c +++ b/lib_lc3plus/tns_decoder.c @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.5.1 * +* ETSI TS 103 634 V1.6.1 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * diff --git a/lib_lc3plus/util.h b/lib_lc3plus/util.h index 410b7db44b02527da3d2123816a82ff2a264909c..05fd54467bc93375ba1c8abdba8bb9e848b18f70 100644 --- a/lib_lc3plus/util.h +++ b/lib_lc3plus/util.h @@ -1,5 +1,5 @@ /****************************************************************************** -* ETSI TS 103 634 V1.5.1 * +* ETSI TS 103 634 V1.6.1 * * Low Complexity Communication Codec Plus (LC3plus) * * * * Copyright licence is solely granted through ETSI Intellectual Property * diff --git a/lib_rend/ivas_cldfb_ring_buffer.c b/lib_rend/ivas_cldfb_ring_buffer.c new file mode 100644 index 0000000000000000000000000000000000000000..5d1d2a055cbb50b71f732330d2091d252b3bf1d7 --- /dev/null +++ b/lib_rend/ivas_cldfb_ring_buffer.c @@ -0,0 +1,299 @@ +/****************************************************************************************************** + + (C) 2022-2025 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB, + Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., + Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, + Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other + contributors to this repository. All Rights Reserved. + + This software is protected by copyright law and by international treaties. + The IVAS codec Public Collaboration consisting of Dolby International AB, Ericsson AB, + Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., + Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, + Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other + contributors to this repository retain full ownership rights in their respective contributions in + the software. This notice grants no license of any kind, including but not limited to patent + license, nor is any license granted by implication, estoppel or otherwise. + + Contributors are required to enter into the IVAS codec Public Collaboration agreement before making + contributions. + + This software is provided "AS IS", without any express or implied warranties. The software is in the + development stage. It is intended exclusively for experts who have experience with such software and + solely for the purpose of inspection. All implied warranties of non-infringement, merchantability + and fitness for a particular purpose are hereby disclaimed and excluded. + + Any dispute, controversy or claim arising under or in relation to providing this software shall be + submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in + accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and + the United Nations Convention on Contracts on the International Sales of Goods. + +*******************************************************************************************************/ + +#include +#include "options.h" +#include "cnst.h" +#include "prot.h" +#include "ivas_prot.h" +#include +#ifdef DEBUGGING +#include "debug.h" +#endif +#include "wmc_auto.h" + +#ifdef FIX_1119_SPLIT_RENDERING_VOIP +/*---------------------------------------------------------------------* + * CLDFB ring-buffer functions needed in split-rendering outputs + *---------------------------------------------------------------------*/ + +/*---------------------------------------------------------------------* + * ivas_cldfb_ringbuf_IsEmpty() + * + * Returns 1 if the ring buffer is empty, or 0 otherwise. + *---------------------------------------------------------------------*/ + +static int16_t ivas_cldfb_ringbuf_IsEmpty( + ISAR_CLDFB_RINGBUF_HANDLE h ) +{ + return (int16_t) ( h->read_pos == h->write_pos && !h->is_full ); +} + + +/*---------------------------------------------------------------------* + * ivas_cldfb_ringbuf_IsFull() + * + * Returns 1 if the ring buffer is full, or 0 otherwise. + *---------------------------------------------------------------------*/ + +static int16_t ivas_cldfb_ringbuf_IsFull( + ISAR_CLDFB_RINGBUF_HANDLE h ) +{ + return h->is_full; +} + + +/*---------------------------------------------------------------------* + * ivas_CLDFB_RINGBUF_Open() + * + * Allocate a ring buffer for CLDFB data with the given capacity of CLDFB columns. + * Each column is expected to contain at most CLDFB_NO_CHANNELS_MAX frequency bands. + * + * May return IVAS_ERR_FAILED_ALLOC on failed allocation, or IVAS_ERR_OK otherwise. + *---------------------------------------------------------------------*/ + +ivas_error ivas_CLDFB_RINGBUF_Open( + ISAR_CLDFB_RINGBUF_HANDLE *ph, + const int16_t capacity_columns ) +{ + ISAR_CLDFB_RINGBUF_HANDLE h; + int32_t capacity; + + capacity = capacity_columns * CLDFB_NO_CHANNELS_MAX; + + if ( ( h = malloc( sizeof( ISAR_CLDFB_RINGBUF ) ) ) == NULL ) + { + return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Failed to allocate memory for CLDFB ring buffer\n" ); + } + h->real = NULL; + h->imag = NULL; + h->capacity = 0; + h->write_pos = 0; + h->read_pos = 0; + h->is_full = 0; + *ph = h; + + if ( ( h->real = malloc( capacity * sizeof( float ) ) ) == NULL ) + { + return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Failed to allocate memory for CLDFB ring buffer\n" ); + } + if ( ( h->imag = malloc( capacity * sizeof( float ) ) ) == NULL ) + { + return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Failed to allocate memory for CLDFB ring buffer\n" ); + } + h->capacity = capacity; + + return IVAS_ERR_OK; +} + + +/*---------------------------------------------------------------------* + * ivas_CLDFB_RINGBUF_Close() + * + * Dellocate CLDFB ring buffer. The given handle will be set to NULL. + *---------------------------------------------------------------------*/ + +void ivas_CLDFB_RINGBUF_Close( + ISAR_CLDFB_RINGBUF_HANDLE *ph ) +{ + ISAR_CLDFB_RINGBUF_HANDLE h; + + if ( ph == NULL ) + { + return; + } + h = *ph; + + if ( h == NULL ) + { + return; + } + + if ( h->real != NULL ) + { + free( h->real ); + } + if ( h->imag != NULL ) + { + free( h->imag ); + } + + free( h ); + *ph = NULL; + + return; +} + + +/*---------------------------------------------------------------------* + * ivas_CLDFB_RINGBUF_Push() + * + * Push a single column onto the back of the CLDFB ring buffer from real and imag arrays. + *---------------------------------------------------------------------*/ + +void ivas_CLDFB_RINGBUF_Push( + ISAR_CLDFB_RINGBUF_HANDLE h, + const float *real, + const float *imag, + const int16_t num_bands ) +{ + assert( num_bands <= CLDFB_NO_CHANNELS_MAX ); + assert( !ivas_cldfb_ringbuf_IsFull( h ) ); + + mvr2r( real, &h->real[h->write_pos], num_bands ); + mvr2r( imag, &h->imag[h->write_pos], num_bands ); + + h->write_pos += CLDFB_NO_CHANNELS_MAX; + if ( h->write_pos == h->capacity ) + { + h->write_pos = 0; + } + + if ( h->read_pos == h->write_pos ) + { + h->is_full = 1; + } + + return; +} + + +/*---------------------------------------------------------------------* + * ivas_CLDFB_RINGBUF_Pop() + * + * Pop a single column from the front of the CLDFB ring buffer into real and imag arrays. + *---------------------------------------------------------------------*/ + +void ivas_CLDFB_RINGBUF_Pop( + ISAR_CLDFB_RINGBUF_HANDLE h, + float *real, + float *imag, + const int16_t num_bands ) +{ + assert( num_bands <= CLDFB_NO_CHANNELS_MAX ); + assert( !ivas_cldfb_ringbuf_IsEmpty( h ) ); + + if ( real != NULL ) + { + mvr2r( &h->real[h->read_pos], real, num_bands ); + } + if ( imag != NULL ) + { + mvr2r( &h->imag[h->read_pos], imag, num_bands ); + } + + h->read_pos += CLDFB_NO_CHANNELS_MAX; + if ( h->read_pos == h->capacity ) + { + h->read_pos = 0; + } + + h->is_full = 0; + + return; +} + + +/*---------------------------------------------------------------------* + * ivas_cldfb_ringbuf_total_size() + * + * Returns total number of buffered samples (including number of channels) + *---------------------------------------------------------------------*/ + +static uint32_t ivas_cldfb_ringbuf_total_size( + ISAR_CLDFB_RINGBUF_HANDLE h ) +{ + if ( ivas_cldfb_ringbuf_IsFull( h ) ) + { + return h->capacity; + } + + if ( h->read_pos <= h->write_pos ) + { + return h->write_pos - h->read_pos; + } + + /* else wrap around */ + return h->write_pos + h->capacity - h->read_pos; +} + + +/*---------------------------------------------------------------------* + * ivas_CLDFB_RINGBUF_GetByIdx() + * + * Get pointers into a specific column in the CLDFB ring buffer based on given index. + * Non-negative indices access from the front of the ring buffer, negative indexes access + * from the back, similar to Python arrays. For example: + * + * - index 0 accesses the front of the buffer, i.e. the oldest CLDFB column in the queue. + * - index -1 accesses the back of the buffer, i.e. the newest (last pushed) CLDFB column in the queue. + *---------------------------------------------------------------------*/ + +void ivas_CLDFB_RINGBUF_GetByIdx( + ISAR_CLDFB_RINGBUF_HANDLE h, + float **p_real, + float **p_imag, + const int16_t col_idx ) +{ + int32_t idx = col_idx * CLDFB_NO_CHANNELS_MAX; + int32_t num_floats = (int32_t) ivas_cldfb_ringbuf_total_size( h ); + uint32_t offset, uidx; + + assert( -num_floats <= idx && idx <= num_floats ); + + if ( idx >= 0 ) + { + offset = h->read_pos + idx; + if ( h->capacity <= offset ) + { + offset -= h->capacity; + } + } + else + { + uidx = (uint32_t) -idx; + if ( uidx <= h->write_pos ) + { + offset = h->write_pos - uidx; + } + else + { + offset = h->write_pos + h->capacity - uidx; + } + } + + *p_real = &h->real[offset]; + *p_imag = &h->imag[offset]; + + return; +} +#endif diff --git a/lib_rend/ivas_crend.c b/lib_rend/ivas_crend.c index b735404a8b772a3d4b4a7e1013f11b1acd4d5e54..eb548948ccbac16db58993a4a7bc061796c7c4ea 100644 --- a/lib_rend/ivas_crend.c +++ b/lib_rend/ivas_crend.c @@ -104,15 +104,15 @@ ivas_error ivas_Crend_hrtf_init( *------------------------------------------------------------------------*/ static ivas_error ivas_hrtf_open( - HRTFS_HANDLE *hHrtf_out /* o : HRTF handle */ + HRTFS_CREND_HANDLE *hHrtf_out /* o : HRTF handle */ ) { - HRTFS_HANDLE hHrtf; + HRTFS_CREND_HANDLE hHrtf; ivas_error error; if ( *hHrtf_out == NULL ) { - if ( ( hHrtf = (HRTFS_HANDLE) malloc( sizeof( HRTFS_DATA ) ) ) == NULL ) + if ( ( hHrtf = (HRTFS_CREND_HANDLE) malloc( sizeof( HRTFS_CREND_DATA ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend HRTFS Handle\n" ); } @@ -140,7 +140,7 @@ static ivas_error ivas_hrtf_open( *------------------------------------------------------------------------*/ static void ivas_hrtf_close( - HRTFS_HANDLE *hHrtf /* i/o: HRTF handle */ + HRTFS_CREND_HANDLE *hHrtf /* i/o: Crend HRTF handle */ ) { if ( hHrtf == NULL || *hHrtf == NULL ) @@ -172,7 +172,7 @@ static ivas_error ivas_rend_initCrend( int16_t i, j, tmp, tmp2; int16_t nchan_in; IVAS_REND_AudioConfigType inConfigType; - HRTFS_HANDLE hHrtf; + HRTFS_CREND_HANDLE hHrtf; ivas_error error; inConfigType = getAudioConfigType( inConfig ); @@ -1158,13 +1158,11 @@ ivas_error ivas_rend_openCrend( { int16_t i, subframe_length; int32_t max_total_ir_len; - HRTFS_HANDLE hHrtf; + HRTFS_CREND_HANDLE hHrtf; CREND_HANDLE hCrend; ivas_error error; int16_t pos_idx; - error = IVAS_ERR_OK; - if ( ( error = ivas_rend_initCrendWrapper( pCrend, num_poses ) ) != IVAS_ERR_OK ) { return error; diff --git a/lib_rend/ivas_dirac_ana.c b/lib_rend/ivas_dirac_ana.c index f6273106de5b51828202c0d4b1704c2c95f34725..73c2db15c66c5e3f8ea51c99a22a9844e2cd0381 100644 --- a/lib_rend/ivas_dirac_ana.c +++ b/lib_rend/ivas_dirac_ana.c @@ -231,10 +231,15 @@ void ivas_dirac_ana( float spreadCoherence[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS]; float surroundingCoherence[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS]; - /* Estimate MASA parameters from the SBA signals */ ivas_dirac_param_est_ana( hDirAC, data_in_f, elevation_m_values, azimuth_m_values, energyRatio, spreadCoherence, surroundingCoherence, input_frame ); + /* Add zeros to higher bands in case of lower sampling rates */ + if ( hDirAC->nbands < MASA_FREQUENCY_BANDS ) + { + ivas_masa_zero_high_bands( hDirAC->nbands, elevation_m_values, azimuth_m_values, energyRatio, spreadCoherence, surroundingCoherence ); + } + /* Create MASA metadata buffer from the estimated values */ ivas_create_masa_out_meta( hDirAC->hMasaOut, hDirAC->sph_grid16, nchan_transport, elevation_m_values, azimuth_m_values, energyRatio, spreadCoherence, surroundingCoherence ); diff --git a/lib_rend/ivas_dirac_dec_binaural_functions.c b/lib_rend/ivas_dirac_dec_binaural_functions.c index e9178bbbb643b805e9c490050878102f05e7d40e..275b542171e16f4b42961bce2dadea9d2a61292f 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions.c @@ -795,8 +795,12 @@ static void ivas_dirac_dec_binaural_internal( { for ( i = 0; i < hSpatParamRendCom->subframe_nbslots[subframe]; i++ ) { +#ifdef FIX_1119_SPLIT_RENDERING_VOIP + ivas_CLDFB_RINGBUF_Push( st_ivas->hSplitBinRend->hMultiBinCldfbData[ch], tmp_Cldfb_out_re[ch][i], tmp_Cldfb_out_im[ch][i], CLDFB_NO_CHANNELS_MAX ); +#else mvr2r( tmp_Cldfb_out_re[ch][i], st_ivas->hSplitBinRend->hMultiBinCldfbData->Cldfb_RealBuffer_Binaural[ch][hSpatParamRendCom->slots_rendered + i], CLDFB_NO_CHANNELS_MAX ); mvr2r( tmp_Cldfb_out_im[ch][i], st_ivas->hSplitBinRend->hMultiBinCldfbData->Cldfb_ImagBuffer_Binaural[ch][hSpatParamRendCom->slots_rendered + i], CLDFB_NO_CHANNELS_MAX ); +#endif } } } @@ -846,14 +850,21 @@ static void ivas_dirac_dec_binaural_internal( mvr2r( st_ivas->hDiracDecBin[0]->ChCrossIm, hDiracDecBin->ChCrossIm, hSpatParamRendCom->num_freq_bands ); ivas_dirac_dec_binaural_formulate_target_covariance_matrices( hDiracDecBin, hSpatParamRendCom, &config_data, Rmat_local, subframe, +#ifdef FIX_1119_SPLIT_RENDERING_VOIP + hCombinedOrientationData && hCombinedOrientationData->enableCombinedOrientation[hCombinedOrientationData->subframe_idx] > 0, +#else hCombinedOrientationData && hCombinedOrientationData->enableCombinedOrientation[subframe] > 0, +#endif subFrameTotalEne, IIReneLimiter, st_ivas->hMasaIsmData ); ivas_dirac_dec_binaural_determine_processing_matrices( hDiracDecBin, hSpatParamRendCom, &config_data, max_band_decorr, Rmat_local, subframe, +#ifdef FIX_1119_SPLIT_RENDERING_VOIP + hCombinedOrientationData && hCombinedOrientationData->enableCombinedOrientation[hCombinedOrientationData->subframe_idx] > 0, +#else hCombinedOrientationData && hCombinedOrientationData->enableCombinedOrientation[subframe] > 0, +#endif nchanSeparateChannels, st_ivas->hMasaIsmData ); - /* re-use reverb and decorr from main direction for the sides */ ivas_dirac_dec_binaural_process_output( hDiracDecBin, hSpatParamRendCom, st_ivas->cldfbSynDec, output_f, Cldfb_RealBuffer_in, Cldfb_ImagBuffer_in, max_band_decorr, numInChannels, config_data.processReverb, subframe, tmp_Cldfb_out_re, tmp_Cldfb_out_im, @@ -864,8 +875,12 @@ static void ivas_dirac_dec_binaural_internal( { for ( i = 0; i < hSpatParamRendCom->subframe_nbslots[subframe]; i++ ) { +#ifdef FIX_1119_SPLIT_RENDERING_VOIP + ivas_CLDFB_RINGBUF_Push( st_ivas->hSplitBinRend->hMultiBinCldfbData[pos_idx * BINAURAL_CHANNELS + ch], tmp_Cldfb_out_re[ch][i], tmp_Cldfb_out_im[ch][i], CLDFB_NO_CHANNELS_MAX ); +#else mvr2r( tmp_Cldfb_out_re[ch][i], st_ivas->hSplitBinRend->hMultiBinCldfbData->Cldfb_RealBuffer_Binaural[pos_idx * BINAURAL_CHANNELS + ch][hSpatParamRendCom->slots_rendered + i], CLDFB_NO_CHANNELS_MAX ); mvr2r( tmp_Cldfb_out_im[ch][i], st_ivas->hSplitBinRend->hMultiBinCldfbData->Cldfb_ImagBuffer_Binaural[pos_idx * BINAURAL_CHANNELS + ch][hSpatParamRendCom->slots_rendered + i], CLDFB_NO_CHANNELS_MAX ); +#endif } } @@ -2751,7 +2766,7 @@ void ivas_omasa_preProcessStereoTransportsForEditedObjects( } /* MASA gaining */ - for ( ch = 0; ch < 2; ch++ ) + for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) { if ( masaGainEdited ) { @@ -2779,7 +2794,7 @@ void ivas_omasa_preProcessStereoTransportsForEditedObjects( nSlotDiv = 1.0f / ( (float) nSlots ); /* Use diagonal mixing matrix as the instant mixing matrix, to slowly fade away the editing during dtx */ - for ( ch = 0; ch < 2; ch++ ) + for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) { ismPreprocMtxNew[ch][ch] = 1.0f; ismPreprocMtxNew[1 - ch][ch] = 0.0f; @@ -2793,12 +2808,12 @@ void ivas_omasa_preProcessStereoTransportsForEditedObjects( } /* Init out array */ - for ( int k = 0; k < nSlots; k++ ) + for ( slot = 0; slot < nSlots; slot++ ) { for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) { - set_zero( outSlotRe[ch][k], CLDFB_NO_CHANNELS_MAX ); - set_zero( outSlotIm[ch][k], CLDFB_NO_CHANNELS_MAX ); + set_zero( outSlotRe[ch][slot], CLDFB_NO_CHANNELS_MAX ); + set_zero( outSlotIm[ch][slot], CLDFB_NO_CHANNELS_MAX ); } } @@ -2812,7 +2827,7 @@ void ivas_omasa_preProcessStereoTransportsForEditedObjects( totalTargetEne = 0.0f; for ( slot = 0; slot < nSlots; slot++ ) { - for ( ch = 0; ch < 2; ch++ ) + for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) { for ( bin = bin_lo; bin < bin_hi; bin++ ) { @@ -2823,9 +2838,9 @@ void ivas_omasa_preProcessStereoTransportsForEditedObjects( } /* Get increment value for temporal interpolation */ - for ( inCh = 0; inCh < 2; inCh++ ) + for ( inCh = 0; inCh < BINAURAL_CHANNELS; inCh++ ) { - for ( outCh = 0; outCh < 2; outCh++ ) + for ( outCh = 0; outCh < BINAURAL_CHANNELS; outCh++ ) { ismPreprocMtxIncrement[outCh][inCh] = ( ismPreprocMtxNew[outCh][inCh] - hMasaIsmData->ismPreprocMatrix[outCh][inCh][band_idx] ) * nSlotDiv; } @@ -2836,11 +2851,11 @@ void ivas_omasa_preProcessStereoTransportsForEditedObjects( hMasaIsmData->preprocEneRealized[band_idx] *= STEREO_PREPROCESS_IIR_FACTOR; hMasaIsmData->preprocEneTarget[band_idx] += totalTargetEne; - for ( outCh = 0; outCh < 2; outCh++ ) + for ( outCh = 0; outCh < BINAURAL_CHANNELS; outCh++ ) { for ( slot = 0; slot < nSlots; slot++ ) { - for ( inCh = 0; inCh < 2; inCh++ ) + for ( inCh = 0; inCh < BINAURAL_CHANNELS; inCh++ ) { hMasaIsmData->ismPreprocMatrix[outCh][inCh][band_idx] += ismPreprocMtxIncrement[outCh][inCh]; for ( bin = bin_lo; bin < bin_hi; bin++ ) @@ -2859,7 +2874,7 @@ void ivas_omasa_preProcessStereoTransportsForEditedObjects( eqVal = fminf( 4.0f, sqrtf( hMasaIsmData->preprocEneTarget[band_idx] / fmaxf( 1e-12f, hMasaIsmData->preprocEneRealized[band_idx] ) ) ); - for ( ch = 0; ch < 2; ch++ ) + for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) { for ( slot = 0; slot < nSlots; slot++ ) { @@ -2935,14 +2950,14 @@ void ivas_omasa_preProcessStereoTransportsForEditedObjects( else { /* When not edited, input and output pan gains are the same */ - for ( ch = 0; ch < 2; ch++ ) + for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) { panGainsOut[ismDirIndex][ch] = panGainsIn[ismDirIndex][ch]; } } /* Determine pan enes */ - for ( ch = 0; ch < 2; ch++ ) + for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) { panEnesOut[ismDirIndex][ch] = panGainsOut[ismDirIndex][ch] * panGainsOut[ismDirIndex][ch]; panEnesIn[ismDirIndex][ch] = panGainsIn[ismDirIndex][ch] * panGainsIn[ismDirIndex][ch]; @@ -2967,12 +2982,12 @@ void ivas_omasa_preProcessStereoTransportsForEditedObjects( } /* Init out array */ - for ( int k = 0; k < nSlots; k++ ) + for ( slot = 0; slot < nSlots; slot++ ) { for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) { - set_zero( outSlotRe[ch][k], CLDFB_NO_CHANNELS_MAX ); - set_zero( outSlotIm[ch][k], CLDFB_NO_CHANNELS_MAX ); + set_zero( outSlotRe[ch][slot], CLDFB_NO_CHANNELS_MAX ); + set_zero( outSlotIm[ch][slot], CLDFB_NO_CHANNELS_MAX ); } } @@ -3002,7 +3017,7 @@ void ivas_omasa_preProcessStereoTransportsForEditedObjects( /* Determine transport normalized energies and subframe energy */ for ( slot = 0; slot < nSlots; slot++ ) { - for ( ch = 0; ch < 2; ch++ ) + for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) { for ( bin = bin_lo; bin < bin_hi; bin++ ) { @@ -3025,7 +3040,7 @@ void ivas_omasa_preProcessStereoTransportsForEditedObjects( ratioAccOrig += ratio; /* Calculate MASA energy as a residual of original channel energies subtracted with ISM energies */ - for ( ch = 0; ch < 2; ch++ ) + for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) { masaEneThisCh[ch] -= panEnesIn[ismDirIndex][ch] * ratio * subframeEne; } @@ -3043,7 +3058,7 @@ void ivas_omasa_preProcessStereoTransportsForEditedObjects( ratio *= gainIsmThis * gainIsmThis; /* Determine panning energies and channel target energies */ - for ( ch = 0; ch < 2; ch++ ) + for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) { ismTargetEneThisCh[ch] = panEnesIn[ismDirIndex][ch] * ismTargetEneThis; /* Ism target energy per channel */ totalTargetEneCh[ch] -= panEnesIn[ismDirIndex][ch] * ismEneThis; /* Reduce original ism energy */ @@ -3084,7 +3099,7 @@ void ivas_omasa_preProcessStereoTransportsForEditedObjects( ratio *= gainMasaPow2; /* Calculate MASA target energies and add to total target energy estimation */ - for ( ch = 0; ch < 2; ch++ ) + for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) { masaEneThisCh[ch] = fmaxf( masaEneThisCh[ch], 0.0f ); /* MASA original energy per channel */ masaTargetEneThisCh[ch] = gainMasaPow2 * masaEneThisCh[ch]; /* MASA target energy per channel */ @@ -3097,6 +3112,13 @@ void ivas_omasa_preProcessStereoTransportsForEditedObjects( } /* Limit target energies to non-negative values */ +#ifdef NONBE_1399_1400_FIX_OBJ_EDIT_ISSUES + for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) + { + totalTargetEneCh[ch] = max( totalTargetEneCh[ch], 0.0f ); + } +#endif + /* due to rounding, the sum may exceed 1.0f ever so slightly, so clip it */ ratioAccOrig = min( ratioAccOrig, 1.0f ); if ( masaGainEdited ) @@ -3161,14 +3183,14 @@ void ivas_omasa_preProcessStereoTransportsForEditedObjects( if ( enableCentering ) { centeringFactor = fmaxf( 0.0f, 2.0f * fabsf( panEnesIn[ismDirIndex][0] - panEnesOut[ismDirIndex][0] ) - 1.0f ); - for ( ch = 0; ch < 2; ch++ ) + for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) { panEnesOut[ismDirIndex][ch] *= ( 1.0f - centeringFactor ); panEnesOut[ismDirIndex][ch] += 0.5f * centeringFactor; } } - for ( ch = 0; ch < 2; ch++ ) + for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) { eneMoveThis = fmaxf( 0.0f, panEnesIn[ismDirIndex][ch] - panEnesOut[ismDirIndex][ch] ); enePreserveThis = panEnesIn[ismDirIndex][ch] - eneMoveThis; @@ -3185,7 +3207,7 @@ void ivas_omasa_preProcessStereoTransportsForEditedObjects( remainderNormEne = fmaxf( 0.0f, ( 1.0f - ismRatioAcc ) - normEnes[0] - normEnes[1] ); /* Normalize */ - for ( ch = 0; ch < 2; ch++ ) + for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) { enePreserve[ch] += fmaxf( 0.0f, normEnes[ch] + remainderNormEne / 2.0f ); normVal = 1.0f / fmaxf( EPSILON, eneMove[ch] + enePreserve[ch] ); @@ -3200,7 +3222,7 @@ void ivas_omasa_preProcessStereoTransportsForEditedObjects( /* Temporally average energy moving and preserving, and generate the transport signal preprocessing matrix for * gaining objects and moving objects between left and right */ - for ( ch = 0; ch < 2; ch++ ) + for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) { hMasaIsmData->eneMoveIIR[ch][band_idx] *= STEREO_PREPROCESS_IIR_FACTOR; hMasaIsmData->eneMoveIIR[ch][band_idx] += eneMove[ch] * totalTargetEne; @@ -3212,9 +3234,9 @@ void ivas_omasa_preProcessStereoTransportsForEditedObjects( } /* Get increment value for temporal interpolation */ - for ( inCh = 0; inCh < 2; inCh++ ) + for ( inCh = 0; inCh < BINAURAL_CHANNELS; inCh++ ) { - for ( outCh = 0; outCh < 2; outCh++ ) + for ( outCh = 0; outCh < BINAURAL_CHANNELS; outCh++ ) { ismPreprocMtxIncrement[outCh][inCh] = ( ismPreprocMtxNew[outCh][inCh] - hMasaIsmData->ismPreprocMatrix[outCh][inCh][band_idx] ) * nSlotDiv; } @@ -3225,11 +3247,11 @@ void ivas_omasa_preProcessStereoTransportsForEditedObjects( hMasaIsmData->preprocEneRealized[band_idx] *= STEREO_PREPROCESS_IIR_FACTOR; hMasaIsmData->preprocEneTarget[band_idx] += totalTargetEne; - for ( outCh = 0; outCh < 2; outCh++ ) + for ( outCh = 0; outCh < BINAURAL_CHANNELS; outCh++ ) { for ( slot = 0; slot < nSlots; slot++ ) { - for ( inCh = 0; inCh < 2; inCh++ ) + for ( inCh = 0; inCh < BINAURAL_CHANNELS; inCh++ ) { hMasaIsmData->ismPreprocMatrix[outCh][inCh][band_idx] += ismPreprocMtxIncrement[outCh][inCh]; for ( bin = bin_lo; bin < bin_hi; bin++ ) @@ -3248,7 +3270,7 @@ void ivas_omasa_preProcessStereoTransportsForEditedObjects( eqVal = fminf( 4.0f, sqrtf( hMasaIsmData->preprocEneTarget[band_idx] / fmaxf( 1e-12f, hMasaIsmData->preprocEneRealized[band_idx] ) ) ); - for ( ch = 0; ch < 2; ch++ ) + for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) { for ( slot = 0; slot < nSlots; slot++ ) { diff --git a/lib_rend/ivas_masa_merge.c b/lib_rend/ivas_masa_merge.c index 37ee8cc7ef5620e987c5b30f8a854a66272ade8f..4432133cd4206f10ba9d42cafe73ded976b474b3 100644 --- a/lib_rend/ivas_masa_merge.c +++ b/lib_rend/ivas_masa_merge.c @@ -37,6 +37,7 @@ #include "ivas_prot.h" #include "ivas_cnst.h" #include "prot.h" +#include "ivas_rom_com.h" #include "wmc_auto.h" @@ -326,6 +327,7 @@ ivas_error masaPrerendOpen( { MASA_PREREND_HANDLE hMasaPrerend; int16_t i; + int16_t maxBin; ivas_error error; error = IVAS_ERR_OK; @@ -336,6 +338,21 @@ ivas_error masaPrerendOpen( return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for MASA prerenderer\n" ) ); } + /* Determine the number of bands and band grouping */ + hMasaPrerend->nbands = MASA_FREQUENCY_BANDS; + mvs2s( MASA_band_grouping_24, hMasaPrerend->band_grouping, MASA_FREQUENCY_BANDS + 1 ); + + maxBin = (int16_t) ( input_Fs * INV_CLDFB_BANDWIDTH + 0.5f ); + for ( i = 1; i < hMasaPrerend->nbands + 1; i++ ) + { + if ( hMasaPrerend->band_grouping[i] >= maxBin ) + { + hMasaPrerend->band_grouping[i] = maxBin; + hMasaPrerend->nbands = i; + break; + } + } + hMasaPrerend->num_Cldfb_instances = numTransports; for ( i = 0; i < hMasaPrerend->num_Cldfb_instances; i++ ) { diff --git a/lib_rend/ivas_mcmasa_ana.c b/lib_rend/ivas_mcmasa_ana.c index 78519210302b82b9c15d495a3c65b886069bc94b..1ed545b4fe13a2493b9341ad3a358fc6ed11a27d 100644 --- a/lib_rend/ivas_mcmasa_ana.c +++ b/lib_rend/ivas_mcmasa_ana.c @@ -393,6 +393,12 @@ void ivas_mcmasa_ana( /* Analysis */ ivas_mcmasa_param_est_ana( hMcMasa, data_f, elevation_m_values, azimuth_m_values, energyRatio, spreadCoherence, surroundingCoherence, input_frame, nchan_inp ); + /* Add zeros to higher bands in case of lower sampling rates */ + if ( hMcMasa->nbands < MASA_FREQUENCY_BANDS ) + { + ivas_masa_zero_high_bands( hMcMasa->nbands, elevation_m_values, azimuth_m_values, energyRatio, spreadCoherence, surroundingCoherence ); + } + /* Create MASA metadata buffer from the estimated values */ ivas_create_masa_out_meta( hMcMasa->hMasaOut, hMcMasa->sph_grid16, nchan_transport, elevation_m_values, azimuth_m_values, energyRatio, spreadCoherence, surroundingCoherence ); @@ -1131,3 +1137,36 @@ void ivas_create_masa_out_meta( return; } + + +/*------------------------------------------------------------------------- + * ivas_masa_zero_high_bands() + * + * + *------------------------------------------------------------------------*/ + +void ivas_masa_zero_high_bands( + const int16_t nbands, /* i : Number of frequency bands with estimated values */ + float elevation_m_values[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], /* i/o : Estimated elevation */ + float azimuth_m_values[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], /* i/o : Estimated azimuth */ + float energyRatio[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], /* i/o : Estimated direct-to-total ratio */ + float spreadCoherence[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], /* i/o : Estimated spread coherence */ + float surroundingCoherence[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS] /* i/o : Estimated surround coherence */ +) +{ + int16_t sf, band; + + for ( sf = 0; sf < MAX_PARAM_SPATIAL_SUBFRAMES; sf++ ) + { + for ( band = nbands; band < MASA_FREQUENCY_BANDS; band++ ) + { + elevation_m_values[sf][band] = 0.0f; + azimuth_m_values[sf][band] = 0.0f; + energyRatio[sf][band] = 0.0f; + spreadCoherence[sf][band] = 0.0f; + surroundingCoherence[sf][band] = 0.0f; + } + } + + return; +} diff --git a/lib_rend/ivas_omasa_ana.c b/lib_rend/ivas_omasa_ana.c index e7f58262edb660d75478f5e9c25733bb752f9487..d43c24f63b4cc17b1af58d6a2ffe9b22bb378c1a 100644 --- a/lib_rend/ivas_omasa_ana.c +++ b/lib_rend/ivas_omasa_ana.c @@ -261,6 +261,12 @@ void ivas_omasa_ana( /* Estimate MASA parameters from the objects */ ivas_omasa_param_est_ana( hOMasa, data_in_f, elevation_m_values, azimuth_m_values, energyRatio, spreadCoherence, surroundingCoherence, input_frame, nchan_ism ); + /* Add zeros to higher bands in case of lower sampling rates */ + if ( hOMasa->nbands < MASA_FREQUENCY_BANDS ) + { + ivas_masa_zero_high_bands( hOMasa->nbands, elevation_m_values, azimuth_m_values, energyRatio, spreadCoherence, surroundingCoherence ); + } + /* Create MASA metadata buffer from the estimated values */ ivas_create_masa_out_meta( hOMasa->hMasaOut, hOMasa->sph_grid16, nchan_transport, elevation_m_values, azimuth_m_values, energyRatio, spreadCoherence, surroundingCoherence ); diff --git a/lib_rend/ivas_prot_rend.h b/lib_rend/ivas_prot_rend.h index 60c91fdc6e06843772551f5e85da1add7229b360..5d0ef572206d678428678eb727bd40defd320bad 100644 --- a/lib_rend/ivas_prot_rend.h +++ b/lib_rend/ivas_prot_rend.h @@ -1348,6 +1348,7 @@ ivas_error ivas_render_config_init_from_rom( * Quaternion operations *----------------------------------------------------------------------------------*/ +#ifndef IVAS_RTPDUMP void QuaternionProduct( const IVAS_QUATERNION q1, const IVAS_QUATERNION q2, @@ -1359,6 +1360,7 @@ void QuaternionInverse( IVAS_QUATERNION *const r ); +#endif void QuaternionSlerp( const IVAS_QUATERNION q1, const IVAS_QUATERNION q2, @@ -1476,6 +1478,15 @@ void ivas_create_masa_out_meta( float surroundingCoherence[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS] /* i : Estimated surround coherence */ ); +void ivas_masa_zero_high_bands( + const int16_t nbands, /* i : Number of frequency bands with estimated values */ + float elevation_m_values[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], /* i/o: Estimated elevation */ + float azimuth_m_values[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], /* i/o: Estimated azimuth */ + float energyRatio[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], /* i/o: Estimated direct-to-total ratio */ + float spreadCoherence[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], /* i/o: Estimated spread coherence */ + float surroundingCoherence[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS] /* i/o: Estimated surround coherence */ +); + ivas_error ivas_dirac_ana_open( DIRAC_ANA_HANDLE *hDirACPtr, /* i/o: DIRAC data handle pointer */ int32_t input_Fs @@ -1596,6 +1607,31 @@ void ivas_TD_RINGBUF_Close( TD_RINGBUF_HANDLE *ph /* i/o: Ring buffer handle */ ); +#ifdef FIX_1119_SPLIT_RENDERING_VOIP +void ivas_TD_RINGBUF_PushInterleaved( + TD_RINGBUF_HANDLE h, /* i/o: Ring buffer handle */ + const float *data, /* i : Input audio in interleaved channels layout */ + const uint32_t num_samples_per_channel /* i : Number of samples per channel to push */ +); + +void ivas_TD_RINGBUF_PushChannels( + TD_RINGBUF_HANDLE h, /* i/o: Ring buffer handle */ + const float *p_channels[], /* i : Array of pointers to each input channel */ + const uint32_t num_samples_per_channel /* i : Number of samples per channel to store */ +); + +void ivas_TD_RINGBUF_PushConstant( + TD_RINGBUF_HANDLE h, /* i/o: Ring buffer handle */ + const float value, /* i : Value to push */ + const uint32_t num_samples_per_channel /* i : Number of samples per channel to push */ +); + +void ivas_TD_RINGBUF_PopChannels( + TD_RINGBUF_HANDLE h, /* i/o: Ring buffer handle */ + float *p_channels[], /* i : Array of pointers to each output channel */ + const uint32_t num_samples_per_channel /* i : Number of samples per channel to pop */ +); +#else void ivas_TD_RINGBUF_Push( TD_RINGBUF_HANDLE h, /* i/o: Ring buffer handle */ const float *data, /* i : Input data */ @@ -1612,6 +1648,7 @@ void ivas_TD_RINGBUF_Pop( float *data, /* i : Output data */ const uint32_t num_samples_per_channel /* i : Number of samples per channel to retrieve*/ ); +#endif uint32_t ivas_TD_RINGBUF_Size( const TD_RINGBUF_HANDLE h /* i : Ring buffer handle */ diff --git a/lib_rend/ivas_rotation.c b/lib_rend/ivas_rotation.c index 9385bc753e6d2b62dd5f216d1b0df3f52bc68cc7..95361e116a0128101eb30f9a3d1f73ee0213f0a4 100644 --- a/lib_rend/ivas_rotation.c +++ b/lib_rend/ivas_rotation.c @@ -706,6 +706,7 @@ ivas_error ivas_external_orientation_open( return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for external orientation memory\n" ) ); } ( *hExtOrientationData )->num_subframes = num_subframes; + /* Enable head rotation and disable external orientation as default */ for ( i = 0; i < MAX_PARAM_SPATIAL_SUBFRAMES; i++ ) { @@ -715,6 +716,7 @@ ivas_error ivas_external_orientation_open( ( *hExtOrientationData )->numFramesToTargetOrientation[i] = 0; ( *hExtOrientationData )->Quaternions[i] = identity; } + return IVAS_ERR_OK; } @@ -822,6 +824,14 @@ ivas_error ivas_combined_orientation_open( ( *hCombinedOrientationData )->subframe_idx = 0; ( *hCombinedOrientationData )->subframe_size = (int16_t) ( fs / ( FRAMES_PER_SEC * MAX_PARAM_SPATIAL_SUBFRAMES ) ); ( *hCombinedOrientationData )->cur_subframe_samples_rendered = 0; +#ifdef RTP_S4_251135_CR26253_0016_REV1 + + for ( i = 0; i < ( 1 + IVAS_MAX_NUM_OBJECTS ); i++ ) + { + ( *hCombinedOrientationData )->isDiegeticInputPI[i] = true; + } + ( *hCombinedOrientationData )->isDiegeticInputPISet = false; +#endif return IVAS_ERR_OK; } @@ -898,13 +908,10 @@ ivas_error combine_external_and_head_orientations_rend( int16_t i; sr_pose_pred_axis = DEFAULT_AXIS; - if ( hHeadTrackData != NULL ) + if ( hHeadTrackData->headRotEnabled ) { - if ( hHeadTrackData->headRotEnabled ) - { - headRotQuaternions = hHeadTrackData->headPositions; - listenerPos = hHeadTrackData->Pos; - } + headRotQuaternions = hHeadTrackData->headPositions; + listenerPos = hHeadTrackData->Pos; sr_pose_pred_axis = hHeadTrackData->sr_pose_pred_axis; } else if ( hExtOrientationData != NULL ) @@ -982,11 +989,30 @@ ivas_error combine_external_and_head_orientations( } else if ( hExtOrientationData == NULL && headRotQuaternions != NULL ) { +#ifdef RTP_S4_251135_CR26253_0016_REV1 + /* Disable head rotation if diegetic PI data indicating non-diegetic audio is received */ + if ( hCombinedOrientationData->isDiegeticInputPISet && !hCombinedOrientationData->isDiegeticInputPI[0] && !hCombinedOrientationData->isDiegeticInputPI[1] && !hCombinedOrientationData->isDiegeticInputPI[2] && !hCombinedOrientationData->isDiegeticInputPI[3] && !hCombinedOrientationData->isDiegeticInputPI[4] ) + { + for ( i = 0; i < hCombinedOrientationData->num_subframes; i++ ) + { + hCombinedOrientationData->Quaternions[i] = identity; + } + } + else + { + /* Head rotation only */ + for ( i = 0; i < hCombinedOrientationData->num_subframes; i++ ) + { + hCombinedOrientationData->Quaternions[i] = headRotQuaternions[i]; + } + } +#else /* Head rotation only */ for ( i = 0; i < hCombinedOrientationData->num_subframes; i++ ) { hCombinedOrientationData->Quaternions[i] = headRotQuaternions[i]; } +#endif } if ( hExtOrientationData != NULL ) @@ -1063,6 +1089,40 @@ ivas_error combine_external_and_head_orientations( hCombinedOrientationData->Quaternion_frozen_head = identity; hCombinedOrientationData->isHeadRotationFrozen = 0; } +#ifdef RTP_S4_251135_CR26253_0016_REV1 + /* Disable head rotation if diegetic PI data indicating non-diegetic audio is received */ + if ( hCombinedOrientationData->isDiegeticInputPISet && !hCombinedOrientationData->isDiegeticInputPI[0] && !hCombinedOrientationData->isDiegeticInputPI[1] && !hCombinedOrientationData->isDiegeticInputPI[2] && !hCombinedOrientationData->isDiegeticInputPI[3] && !hCombinedOrientationData->isDiegeticInputPI[4] ) + { + continue; + } + else + { + /* Use the most recent head rotation */ + if ( hExtOrientationData->enableHeadRotation[i] == 1 ) + { + if ( hExtOrientationData->enableExternalOrientation[i] > 0 ) + { + QuaternionProduct( hCombinedOrientationData->Quaternions[i], headRotQuaternions[i], &hCombinedOrientationData->Quaternions[i] ); + } + else + { + hCombinedOrientationData->Quaternions[i] = headRotQuaternions[i]; + } + } + /* Use the freezed head rotation */ + else if ( hExtOrientationData->enableHeadRotation[i] == 2 ) + { + if ( hExtOrientationData->enableExternalOrientation[i] > 0 ) + { + QuaternionProduct( hCombinedOrientationData->Quaternions[i], hCombinedOrientationData->Quaternion_frozen_head, &hCombinedOrientationData->Quaternions[i] ); + } + else + { + hCombinedOrientationData->Quaternions[i] = hCombinedOrientationData->Quaternion_frozen_head; + } + } + } +#else /* Use the most recent head rotation */ if ( hExtOrientationData->enableHeadRotation[i] == 1 ) { @@ -1087,6 +1147,7 @@ ivas_error combine_external_and_head_orientations( hCombinedOrientationData->Quaternions[i] = hCombinedOrientationData->Quaternion_frozen_head; } } +#endif /* Reset the combined orientations to identity */ if ( hExtOrientationData->enableHeadRotation[i] == 0 && hExtOrientationData->enableExternalOrientation[i] == 0 ) @@ -1185,6 +1246,16 @@ ivas_error combine_external_and_head_orientations( hCombinedOrientationData->subframe_idx_start = 0; hCombinedOrientationData->cur_subframe_samples_rendered_start = 0; +#ifdef IVAS_RTPDUMP + /* Reset external orientations */ + if ( hExtOrientationData != NULL ) + { + for ( i = 0; i < hCombinedOrientationData->num_subframes; i++ ) + { + hExtOrientationData->Quaternions[i] = identity; + } + } +#endif return IVAS_ERR_OK; } diff --git a/lib_rend/ivas_stat_rend.h b/lib_rend/ivas_stat_rend.h index 69fcb30fb803f590f19fb50517892a98ecc97f9c..6730875f6c39f5bc185b2323ca286e20576bc899 100644 --- a/lib_rend/ivas_stat_rend.h +++ b/lib_rend/ivas_stat_rend.h @@ -710,6 +710,10 @@ typedef struct ivas_combined_orientation_struct int16_t cur_subframe_samples_rendered; int16_t subframe_idx_start; int16_t cur_subframe_samples_rendered_start; +#ifdef RTP_S4_251135_CR26253_0016_REV1 + bool isDiegeticInputPI[1 + IVAS_MAX_NUM_OBJECTS]; + bool isDiegeticInputPISet; +#endif } COMBINED_ORIENTATION_DATA, *COMBINED_ORIENTATION_HANDLE; /*----------------------------------------------------------------------------------* @@ -1182,7 +1186,7 @@ typedef struct ivas_hrtf_crend_structure uint16_t *pIndex_frequency_max_dyn[MAX_INTERN_CHANNELS][BINAURAL_CHANNELS]; uint16_t *pIndex_frequency_max_diffuse_dyn[BINAURAL_CHANNELS]; -} HRTFS_DATA, *HRTFS_HANDLE, HRTFS_CREND_DATA, *HRTFS_CREND_HANDLE; // VE: all instance of HRTFS_DATAand *HRTFS_HANDLE should be renamed to HRTFS_CREND_DATA and *HRTFS_CREND_HANDLE +} HRTFS_CREND_DATA, *HRTFS_CREND_HANDLE; /* Main Crend structure */ typedef struct ivas_crend_state_t @@ -1209,7 +1213,7 @@ typedef struct ivas_binaural_crend_wrapper_struct { int32_t binaural_latency_ns; CREND_HANDLE hCrend[MAX_HEAD_ROT_POSES]; - HRTFS_HANDLE hHrtfCrend; + HRTFS_CREND_HANDLE hHrtfCrend; } CREND_WRAPPER, *CREND_WRAPPER_HANDLE; @@ -1272,6 +1276,7 @@ typedef struct ivas_hrtf_statistics_struct float *average_energy_r_dyn; float *inter_aural_coherence_dyn; int16_t fromROM; /* Flag that indicates that the pointers point to tables in ROM (controls init/dealloc).*/ + } HRTFS_STATISTICS, *HRTFS_STATISTICS_HANDLE; @@ -1526,6 +1531,9 @@ typedef struct ivas_dirac_ana_data_structure typedef struct ivas_masa_prerend_data_structure { + int16_t nbands; + int16_t band_grouping[MASA_FREQUENCY_BANDS + 1]; + /* CLDFB analysis */ int16_t num_Cldfb_instances; HANDLE_CLDFB_FILTER_BANK cldfbAnaEnc[MASA_MAX_TRANSPORT_CHANNELS]; diff --git a/lib_rend/ivas_td_ring_buffer.c b/lib_rend/ivas_td_ring_buffer.c index 5c9c6089bbc41150c6469cd8240a1df3741b38ce..f1fdab3af8143b15aaa1583ea998bca7d1c72a18 100644 --- a/lib_rend/ivas_td_ring_buffer.c +++ b/lib_rend/ivas_td_ring_buffer.c @@ -67,6 +67,42 @@ static int16_t ivas_td_ringbuf_has_space_for_num_samples( } +#ifdef FIX_1119_SPLIT_RENDERING_VOIP +static void ivas_td_ringbuf_push_interleaved( + TD_RINGBUF_HANDLE h, /* i/o: Ring buffer handle */ + const float *data, /* i : Input audio in interleaved channels layout */ + const uint32_t num_samples_per_channel, /* i : Number of samples per channel to push */ + const uint16_t read_stride /* i: : 1 for normal operation, 0 for reading from a single input value */ +) +{ + uint32_t s, read_s; + + assert( h != NULL ); + assert( data != NULL ); + assert( read_stride == 0 || read_stride == 1 ); + assert( ivas_td_ringbuf_has_space_for_num_samples( h, num_samples_per_channel * h->num_channels ) ); + + for ( s = 0, read_s = 0; s < num_samples_per_channel * h->num_channels; ++s, read_s += read_stride ) + { + h->data[h->write_pos] = data[read_s]; + ++h->write_pos; + + if ( h->write_pos == h->capacity ) + { + h->write_pos = 0; + } + } + + if ( h->read_pos == h->write_pos ) + { + h->is_full = 1; + } + + return; +} +#endif + + /*-----------------------------------------------------------------------* * Global function definitions *-----------------------------------------------------------------------*/ @@ -150,6 +186,37 @@ void ivas_TD_RINGBUF_Close( } +#ifdef FIX_1119_SPLIT_RENDERING_VOIP +/*---------------------------------------------------------------------* + * ivas_TD_RINGBUF_PushInterleaved() + * + * Push samples from a buffer with interleaved channel layout onto the back of the TD ring buffer. + *---------------------------------------------------------------------*/ + +void ivas_TD_RINGBUF_PushInterleaved( + TD_RINGBUF_HANDLE h, /* i/o: Ring buffer handle */ + const float *data, /* i : Input audio in interleaved channels layout */ + const uint32_t num_samples_per_channel /* i : Number of samples per channel to push */ +) +{ + ivas_td_ringbuf_push_interleaved( h, data, num_samples_per_channel, 1 ); + + return; +} + + +/*---------------------------------------------------------------------* + * ivas_TD_RINGBUF_PushChannels() + * + * Push samples from channel pointers onto the back of the TD ring buffer. + *---------------------------------------------------------------------*/ + +void ivas_TD_RINGBUF_PushChannels( + TD_RINGBUF_HANDLE h, /* i/o: Ring buffer handle */ + const float *p_channels[], /* i : Array of pointers to each input channel */ + const uint32_t num_samples_per_channel /* i : Number of samples per channel to push */ +) +#else /*---------------------------------------------------------------------* * ivas_TD_RINGBUF_Push() * @@ -162,17 +229,30 @@ void ivas_TD_RINGBUF_Push( const float *data, /* i : Input data */ const uint32_t num_samples_per_channel /* i : Number of samples per channel to store */ ) +#endif { uint32_t s; uint16_t c; +#ifdef FIX_1119_SPLIT_RENDERING_VOIP + assert( h != NULL ); + assert( p_channels != NULL ); + for ( c = 0; c < h->num_channels; ++c ) + { + assert( p_channels[c] != NULL ); + } +#endif assert( ivas_td_ringbuf_has_space_for_num_samples( h, num_samples_per_channel * h->num_channels ) ); for ( s = 0; s < num_samples_per_channel; ++s ) { for ( c = 0; c < h->num_channels; ++c ) { +#ifdef FIX_1119_SPLIT_RENDERING_VOIP + h->data[h->write_pos] = p_channels[c][s]; +#else h->data[h->write_pos] = *( data + c * num_samples_per_channel + s ); +#endif ++h->write_pos; if ( h->write_pos == h->capacity ) @@ -191,6 +271,24 @@ void ivas_TD_RINGBUF_Push( } +#ifdef FIX_1119_SPLIT_RENDERING_VOIP +/*---------------------------------------------------------------------* + * ivas_TD_RINGBUF_PushConstant() + * + * Push samples with a constant value onto the back of the TD ring buffer. + *---------------------------------------------------------------------*/ + +void ivas_TD_RINGBUF_PushConstant( + TD_RINGBUF_HANDLE h, /* i/o: Ring buffer handle */ + const float value, /* i : Value to push */ + const uint32_t num_samples_per_channel /* i : Number of samples per channel to push */ +) +{ + ivas_td_ringbuf_push_interleaved( h, &value, num_samples_per_channel, 0 ); + + return; +} +#else /*---------------------------------------------------------------------* * ivas_TD_RINGBUF_PushZeros() * @@ -232,8 +330,22 @@ void ivas_TD_RINGBUF_PushZeros( return; } +#endif +#ifdef FIX_1119_SPLIT_RENDERING_VOIP +/*---------------------------------------------------------------------* + * ivas_TD_RINGBUF_PopChannels() + * + * Pop samples from the front of the TD ring buffer to an array of channel pointers. + *---------------------------------------------------------------------*/ + +void ivas_TD_RINGBUF_PopChannels( + TD_RINGBUF_HANDLE h, /* i/o: Ring buffer handle */ + float *p_channels[], /* i : Array of pointers to each output channel */ + const uint32_t num_samples_per_channel /* i : Number of samples per channel to pop */ +) +#else /*---------------------------------------------------------------------* * ivas_TD_RINGBUF_Pop() * @@ -245,17 +357,30 @@ void ivas_TD_RINGBUF_Pop( float *data, /* i : Output data */ const uint32_t num_samples_per_channel /* i : Number of samples per channel to retrieve */ ) +#endif { uint32_t s; uint16_t c; +#ifdef FIX_1119_SPLIT_RENDERING_VOIP + assert( h != NULL ); + assert( p_channels != NULL ); + for ( c = 0; c < h->num_channels; ++c ) + { + assert( p_channels[c] != NULL ); + } +#endif assert( ivas_td_ringbuf_total_size( h ) >= num_samples_per_channel * h->num_channels ); for ( s = 0; s < num_samples_per_channel; ++s ) { for ( c = 0; c < h->num_channels; ++c ) { +#ifdef FIX_1119_SPLIT_RENDERING_VOIP + p_channels[c][s] = h->data[h->read_pos]; +#else *( data + c * num_samples_per_channel + s ) = h->data[h->read_pos]; +#endif ++h->read_pos; if ( h->read_pos == h->capacity ) @@ -265,10 +390,17 @@ void ivas_TD_RINGBUF_Pop( } } +#ifdef FIX_1119_SPLIT_RENDERING_VOIP + if ( num_samples_per_channel != 0 ) + { + h->is_full = 0; + } +#else if ( h->is_full ) { h->is_full = 0; } +#endif return; } diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 0f56db1ae3e700f771e8d0327037f91a03e77dcd..4bb1024aae19eae7aa5e70822b9296b8052eef83 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -44,6 +44,9 @@ #include #include #include "wmc_auto.h" +#ifdef RENDERER_MD_SYNC_DELAY_TO_INTEGER +#include +#endif /*-------------------------------------------------------------------* @@ -123,7 +126,11 @@ typedef struct OMASA_ANA_HANDLE hOMasa; uint16_t total_num_objects; int16_t object_id; +#ifdef RENDERER_MD_SYNC_DELAY_TO_INTEGER + int16_t ism_metadata_delay_ms; +#else float ism_metadata_delay_ms; +#endif } input_ism; typedef struct @@ -183,10 +190,10 @@ typedef struct typedef struct hrtf_handles { - IVAS_DEC_HRTF_CREND_HANDLE hSetOfHRTF; + IVAS_DEC_HRTF_CREND_HANDLE hHrtfCrend; IVAS_DEC_HRTF_FASTCONV_HANDLE hHrtfFastConv; IVAS_DEC_HRTF_PARAMBIN_HANDLE hHrtfParambin; - IVAS_DEC_HRTF_HANDLE hHrtfTD; + IVAS_DEC_HRTF_TD_HANDLE hHrtfTD; IVAS_DEC_HRTF_STATISTICS_HANDLE hHrtfStatistics; } hrtf_handles; @@ -1480,6 +1487,11 @@ static ivas_error alignInputDelay( int16_t maxGlobalDelaySamples; int32_t numSamplesToPush, numSamplesToPop; uint32_t ringBufferSize, preDelay; +#ifdef FIX_1119_SPLIT_RENDERING_VOIP + int16_t i; + const float *p_read_channels[MAX_INPUT_CHANNELS]; + float *p_write_channels[MAX_INPUT_CHANNELS]; +#endif maxGlobalDelaySamples = latencyNsToSamples( sampleRateOut, maxGlobalDelayNs ); maxGlobalDelaySamples *= cldfb2tdSampleFact; @@ -1502,13 +1514,21 @@ static ivas_error alignInputDelay( /* for the first frame we need to push zeros to align the input delay to the global delay * and then push a frame of actual data */ +#ifdef FIX_1119_SPLIT_RENDERING_VOIP + ivas_TD_RINGBUF_PushConstant( inputBase->delayBuffer, 0, preDelay ); +#else ivas_TD_RINGBUF_PushZeros( inputBase->delayBuffer, preDelay ); +#endif /* for ISM inputs, ensure the metadata sync delay is updated */ if ( getAudioConfigType( inputBase->inConfig ) == IVAS_REND_AUDIO_CONFIG_TYPE_OBJECT_BASED ) { inputIsm = (input_ism *) inputBase; +#ifdef RENDERER_MD_SYNC_DELAY_TO_INTEGER + inputIsm->ism_metadata_delay_ms = (int16_t) roundf( inputIsm->ism_metadata_delay_ms + maxGlobalDelayNs / 1e6f ); +#else inputIsm->ism_metadata_delay_ms = maxGlobalDelayNs / 1e6f; +#endif } } } @@ -1520,8 +1540,22 @@ static ivas_error alignInputDelay( numSamplesToPush = flushInputs ? 0 : inputAudio.config.numSamplesPerChannel; numSamplesToPop = flushInputs ? ivas_TD_RINGBUF_Size( inputBase->delayBuffer ) : (uint32_t) inputAudio.config.numSamplesPerChannel; +#ifdef FIX_1119_SPLIT_RENDERING_VOIP + for ( i = 0; i < inputAudio.config.numChannels; ++i ) + { + p_read_channels[i] = inputAudio.data + i * numSamplesToPush; + } + ivas_TD_RINGBUF_PushChannels( inputBase->delayBuffer, p_read_channels, numSamplesToPush ); + + for ( i = 0; i < inputAudio.config.numChannels; ++i ) + { + p_write_channels[i] = inputBase->inputBuffer.data + i * numSamplesToPop; + } + ivas_TD_RINGBUF_PopChannels( inputBase->delayBuffer, p_write_channels, numSamplesToPop ); +#else ivas_TD_RINGBUF_Push( inputBase->delayBuffer, inputAudio.data, numSamplesToPush ); ivas_TD_RINGBUF_Pop( inputBase->delayBuffer, inputBase->inputBuffer.data, numSamplesToPop ); +#endif } else { @@ -1649,7 +1683,7 @@ static ivas_error setRendInputActiveIsm( } else if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) { - if ( ( error = ivas_rend_openCrend( &inputIsm->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, hrtfs->hSetOfHRTF, hrtfs->hHrtfStatistics, *rendCtx.pOutSampleRate, 1, rendCtx.pSplitRendWrapper != NULL ? rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses : 1 ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_rend_openCrend( &inputIsm->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, hrtfs->hHrtfCrend, hrtfs->hHrtfStatistics, *rendCtx.pOutSampleRate, 1, rendCtx.pSplitRendWrapper != NULL ? rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses : 1 ) ) != IVAS_ERR_OK ) { return error; } @@ -2608,7 +2642,7 @@ static ivas_error setRendInputActiveMc( if ( getAudioConfigType( outConfig ) == IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL ) { - if ( ( error = initMcBinauralRendering( inputMc, inConfig, outConfig, hRendCfg, hrtfs->hSetOfHRTF, hrtfs->hHrtfStatistics, FALSE ) ) != IVAS_ERR_OK ) + if ( ( error = initMcBinauralRendering( inputMc, inConfig, outConfig, hRendCfg, hrtfs->hHrtfCrend, hrtfs->hHrtfStatistics, FALSE ) ) != IVAS_ERR_OK ) { return error; } @@ -2925,7 +2959,7 @@ static ivas_error setRendInputActiveSba( } } - if ( ( error = updateSbaPanGains( inputSba, outConfig, hRendCfg, hrtfs->hSetOfHRTF, hrtfs->hHrtfStatistics ) ) != IVAS_ERR_OK ) + if ( ( error = updateSbaPanGains( inputSba, outConfig, hRendCfg, hrtfs->hHrtfCrend, hrtfs->hHrtfStatistics ) ) != IVAS_ERR_OK ) { return error; } @@ -3218,7 +3252,7 @@ ivas_error IVAS_REND_Open( hIvasRend->hHrtfs.hHrtfFastConv = NULL; hIvasRend->hHrtfs.hHrtfParambin = NULL; hIvasRend->hHrtfs.hHrtfTD = NULL; - hIvasRend->hHrtfs.hSetOfHRTF = NULL; + hIvasRend->hHrtfs.hHrtfCrend = NULL; hIvasRend->hHrtfs.hHrtfStatistics = NULL; if ( asHrtfBinary ) { @@ -3226,7 +3260,7 @@ ivas_error IVAS_REND_Open( { return error; } - if ( ( error = ivas_HRTF_CRend_binary_open( &( hIvasRend->hHrtfs.hSetOfHRTF ) ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_HRTF_CRend_binary_open( &( hIvasRend->hHrtfs.hHrtfCrend ) ) ) != IVAS_ERR_OK ) { return error; } @@ -3924,7 +3958,7 @@ ivas_error IVAS_REND_ConfigureCustomInputLoudspeakerLayout( inputMc->base.inConfig, hIvasRend->outputConfig, hIvasRend->hRendererConfig, - hIvasRend->hHrtfs.hSetOfHRTF, + hIvasRend->hHrtfs.hHrtfCrend, hIvasRend->hHrtfs.hHrtfStatistics, FALSE ) ) != IVAS_ERR_OK ) { @@ -4784,7 +4818,7 @@ ivas_error IVAS_REND_SetHeadRotation( hIvasRend->inputsMc[i].base.inConfig, hIvasRend->outputConfig, hIvasRend->hRendererConfig, - hIvasRend->hHrtfs.hSetOfHRTF, + hIvasRend->hHrtfs.hHrtfCrend, hIvasRend->hHrtfs.hHrtfStatistics, TRUE ) ) != IVAS_ERR_OK ) { @@ -4848,7 +4882,7 @@ ivas_error IVAS_REND_DisableHeadRotation( hIvasRend->inputsMc[i].base.inConfig, hIvasRend->outputConfig, hIvasRend->hRendererConfig, - hIvasRend->hHrtfs.hSetOfHRTF, + hIvasRend->hHrtfs.hHrtfCrend, hIvasRend->hHrtfs.hHrtfStatistics, TRUE ) ) != IVAS_ERR_OK ) { @@ -5462,7 +5496,12 @@ static ivas_error renderIsmToBinaural( push_wmops( "renderIsmToBinaural" ); /* Metadata Delay to sync with audio delay converted from ms to 5ms (1000/50/4) subframe index */ +#ifdef RENDERER_MD_SYNC_DELAY_TO_INTEGER + ism_md_subframe_update_ext = (int16_t) roundf( ismInput->ism_metadata_delay_ms / (float) BINAURAL_RENDERING_FRAME_SIZE_MS ); +#else ism_md_subframe_update_ext = (int16_t) roundf( ismInput->ism_metadata_delay_ms / ( 1000.f / FRAMES_PER_SEC / MAX_PARAM_SPATIAL_SUBFRAMES ) ); +#endif + copyBufferTo2dArray( ismInput->base.inputBuffer, tmpTDRendBuffer ); if ( ( error = ivas_td_binaural_renderer_ext( &ismInput->tdRendWrapper, ismInput->base.inConfig, NULL, ismInput->base.ctx.pCombinedOrientationData, &ismInput->currentPos, ismInput->hReverb, ism_md_subframe_update_ext, @@ -5666,7 +5705,11 @@ static ivas_error renderIsmToBinauralReverb( push_wmops( "renderIsmToBinauralRoom" ); /* Metadata Delay to sync with audio delay converted from ms to 5ms (1000/50/4) subframe index */ +#ifdef RENDERER_MD_SYNC_DELAY_TO_INTEGER + ism_md_subframe_update_ext = (int16_t) roundf( ismInput->ism_metadata_delay_ms / (float) BINAURAL_RENDERING_FRAME_SIZE_MS ); +#else ism_md_subframe_update_ext = (int16_t) roundf( ismInput->ism_metadata_delay_ms / ( 1000.f / FRAMES_PER_SEC / MAX_PARAM_SPATIAL_SUBFRAMES ) ); +#endif copyBufferTo2dArray( ismInput->base.inputBuffer, tmpRendBuffer ); @@ -5846,7 +5889,11 @@ static ivas_error renderIsmToSplitBinaural( pMultiBinPoseData = &pSplitRendWrapper->multiBinPoseData; /* Metadata Delay to sync with audio delay converted from ms to 5ms (1000/50/4) subframe index */ +#ifdef RENDERER_MD_SYNC_DELAY_TO_INTEGER + ism_md_subframe_update_ext = (int16_t) roundf( ismInput->ism_metadata_delay_ms / (float) BINAURAL_RENDERING_FRAME_SIZE_MS ); +#else ism_md_subframe_update_ext = (int16_t) roundf( ismInput->ism_metadata_delay_ms / ( 1000.f / FRAMES_PER_SEC / MAX_PARAM_SPATIAL_SUBFRAMES ) ); +#endif pCombinedOrientationData = *ismInput->base.ctx.pCombinedOrientationData; @@ -7289,10 +7336,11 @@ static void renderMasaToMasa( } /* Compute channel energy for metadata processing */ - for ( band_m_idx = 0; band_m_idx < MASA_FREQUENCY_BANDS; band_m_idx++ ) + for ( band_m_idx = 0; band_m_idx < masaInput->hMasaPrerend->nbands; band_m_idx++ ) { - brange[0] = MASA_band_grouping_24[band_m_idx]; - brange[1] = MASA_band_grouping_24[band_m_idx + 1]; + brange[0] = masaInput->hMasaPrerend->band_grouping[band_m_idx]; + brange[1] = masaInput->hMasaPrerend->band_grouping[band_m_idx + 1]; + for ( j = brange[0]; j < brange[1]; j++ ) { for ( i = 0; i < numAnalysisChannels; i++ ) @@ -7661,7 +7709,11 @@ ivas_error IVAS_REND_SetTotalNumberOfObjects( ivas_error IVAS_REND_SetIsmMetadataDelay( IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS renderer handle */ - const float sync_md_delay /* i : ISM Metadata Delay in ms to sync with audio delay */ +#ifdef RENDERER_MD_SYNC_DELAY_TO_INTEGER + const int16_t sync_md_delay /* i : ISM Metadata Delay in ms to sync with audio delay */ +#else + const float sync_md_delay /* i : ISM Metadata Delay in ms to sync with audio delay */ +#endif ) { int16_t i; @@ -7791,7 +7843,6 @@ static ivas_error getSamplesInternal( return IVAS_ERR_OK; } - /*-------------------------------------------------------------------* * IVAS_REND_GetSamples() * @@ -7850,6 +7901,20 @@ ivas_error IVAS_REND_GetSplitBinauralBitstream( IVAS_REND_AudioBufferConfig *pSplitEncBufConfig; ISAR_SPLIT_REND_CONFIG_HANDLE pSplitRendConfig; ISAR_SPLIT_REND_BITS_DATA bits; +#ifdef FIX_1119_SPLIT_RENDERING_VOIP + float *p_Cldfb_RealBuffer_Binaural[MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS][CLDFB_NO_COL_MAX]; + float *p_Cldfb_ImagBuffer_Binaural[MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS][CLDFB_NO_COL_MAX]; + int16_t j; + + for ( i = 0; i < BINAURAL_CHANNELS * MAX_HEAD_ROT_POSES; ++i ) + { + for ( j = 0; j < CLDFB_NO_COL_MAX; ++j ) + { + p_Cldfb_RealBuffer_Binaural[i][j] = Cldfb_RealBuffer_Binaural[i][j]; + p_Cldfb_ImagBuffer_Binaural[i][j] = Cldfb_ImagBuffer_Binaural[i][j]; + } + } +#endif for ( ch = 0; ch < MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS; ch++ ) { @@ -7918,8 +7983,13 @@ ivas_error IVAS_REND_GetSplitBinauralBitstream( pSplitRendConfig->isar_frame_size_ms, pSplitRendConfig->codec_frame_size_ms, &bits, +#ifdef FIX_1119_SPLIT_RENDERING_VOIP + p_Cldfb_RealBuffer_Binaural, + p_Cldfb_ImagBuffer_Binaural, +#else Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, +#endif ( const int16_t )( ( BINAURAL_MAXBANDS * hIvasRend->sampleRateOut ) / 48000 ), tmpBinaural, 1, @@ -8052,7 +8122,7 @@ void IVAS_REND_Close( /* Parametric binauralizer HRTF filters */ ivas_HRTF_binary_close( &( hIvasRend->hHrtfs.hHrtfTD ) ); - ivas_HRTF_CRend_binary_close( &( hIvasRend->hHrtfs.hSetOfHRTF ) ); + ivas_HRTF_CRend_binary_close( &( hIvasRend->hHrtfs.hHrtfCrend ) ); ivas_HRTF_fastconv_binary_close( &( hIvasRend->hHrtfs.hHrtfFastConv ) ); ivas_HRTF_parambin_binary_close( &( hIvasRend->hHrtfs.hHrtfParambin ) ); ivas_HRTF_statistics_close( &( hIvasRend->hHrtfs.hHrtfStatistics ) ); @@ -8209,14 +8279,14 @@ int32_t IVAS_REND_GetCntFramesLimited( /*---------------------------------------------------------------------* - * IVAS_REND_GetHrtfHandle( ) + * IVAS_REND_GetHrtfTdHandle( ) * * *---------------------------------------------------------------------*/ -ivas_error IVAS_REND_GetHrtfHandle( - IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS renderer handle */ - IVAS_DEC_HRTF_HANDLE **hHrtfTD /* o : HRTF handle */ +ivas_error IVAS_REND_GetHrtfTdHandle( + IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS renderer handle */ + IVAS_DEC_HRTF_TD_HANDLE **hHrtfTD /* o : TD rend. HRTF handle */ ) { if ( hIvasRend == NULL || hIvasRend->hHrtfs.hHrtfTD == NULL ) @@ -8238,15 +8308,15 @@ ivas_error IVAS_REND_GetHrtfHandle( ivas_error IVAS_REND_GetHrtfCRendHandle( IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS renderer handle */ - IVAS_DEC_HRTF_CREND_HANDLE **hSetOfHRTF /* o : Set of HRTF handle */ + IVAS_DEC_HRTF_CREND_HANDLE **hHrtfCrend /* o : Crend HRTF handle */ ) { - if ( hIvasRend == NULL || hIvasRend->hHrtfs.hSetOfHRTF == NULL ) + if ( hIvasRend == NULL || hIvasRend->hHrtfs.hHrtfCrend == NULL ) { return IVAS_ERR_WRONG_PARAMS; } - *hSetOfHRTF = &hIvasRend->hHrtfs.hSetOfHRTF; + *hHrtfCrend = &hIvasRend->hHrtfs.hHrtfCrend; return IVAS_ERR_OK; } diff --git a/lib_rend/lib_rend.h b/lib_rend/lib_rend.h index c03dd72485d2f084d9572c418236508570a58715..4d84f194f9ba18c7127b5e385a52e50de64fe3b7 100644 --- a/lib_rend/lib_rend.h +++ b/lib_rend/lib_rend.h @@ -194,15 +194,15 @@ ivas_error IVAS_REND_GetDelay( ); /*! r: error code */ -ivas_error IVAS_REND_GetHrtfHandle( +ivas_error IVAS_REND_GetHrtfTdHandle( IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS render handle */ - IVAS_DEC_HRTF_HANDLE **hHrtfTD /* o : HRTF handle */ + IVAS_DEC_HRTF_TD_HANDLE **hHrtfTD /* o : TD rend. HRTF handle */ ); /*! r: error code */ ivas_error IVAS_REND_GetHrtfCRendHandle( IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS renderer handle */ - IVAS_DEC_HRTF_CREND_HANDLE **hSetOfHRTF /* o : Set of HRTF handle */ + IVAS_DEC_HRTF_CREND_HANDLE **hHrtfCrend /* o : Crend HRTF handle */ ); ivas_error IVAS_REND_GetHrtfFastConvHandle( @@ -371,7 +371,11 @@ ivas_error IVAS_REND_SetTotalNumberOfObjects( ivas_error IVAS_REND_SetIsmMetadataDelay( IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS renderer handle */ +#ifdef RENDERER_MD_SYNC_DELAY_TO_INTEGER + const int16_t sync_md_delay /* i : Metadata Delay in ms to sync with audio delay */ +#else const float sync_md_delay /* i : Metadata Delay in ms to sync with audio delay */ +#endif ); ivas_error IVAS_REND_GetNumAllObjects( diff --git a/lib_util/ambi_convert.c b/lib_util/ambi_convert.c index 282f4a08726273423d57d4986c8cad17d2666b1e..e91dd0f989bd0fcd62e6f0a19a7eb79ef490f759 100644 --- a/lib_util/ambi_convert.c +++ b/lib_util/ambi_convert.c @@ -124,15 +124,16 @@ static const int16_t REORDER_ACN_SID[AMBI_MAX_CHANNELS] = { 0, --------------------------------------------------------------------------*/ AMBI_CONVERT_ERROR convert_ambi_format( - float *in[], /* i: input ambisonics channels */ - float *out[], /* o: output ambisonics channels */ - int16_t order, /* i: ambisonics order */ - AMBI_FMT in_format, /* i: input ambisonics format */ - AMBI_FMT out_format /* i: output ambisonics format */ + float *in[], /* i: input ambisonics channels */ + float *out[], /* o: output ambisonics channels */ + const int16_t order, /* i: ambisonics order */ + const AMBI_FMT in_format, /* i: input ambisonics format */ + const AMBI_FMT out_format, /* i: output ambisonics format */ + const int16_t frame_length /* i: input/output frame length */ ) { - float tmp[AMBI_MAX_CHANNELS * L_FRAME48k]; + float tmp[AMBI_MAX_CHANNELS * AMBI_MAX_FRAME_LENGTH]; float *p_tmp[AMBI_MAX_CHANNELS]; AMBI_CONVERT_ERROR err = AMBI_CONVERT_OK; @@ -144,6 +145,11 @@ AMBI_CONVERT_ERROR convert_ambi_format( assert( order <= 3 ); + if ( frame_length > AMBI_MAX_FRAME_LENGTH ) + { + return AMBI_CONVERT_UNSUPPORTED_FRAME_LENGTH; + } + if ( in_format != AMBI_FMT_ACN_SN3D && out_format != AMBI_FMT_ACN_SN3D ) { assert( 0 && "Conversion only supported to and from ACN-SN3D" ); @@ -151,7 +157,7 @@ AMBI_CONVERT_ERROR convert_ambi_format( for ( int16_t j = 0; j < AMBI_MAX_CHANNELS; j++ ) { - p_tmp[j] = &tmp[j * L_FRAME48k]; + p_tmp[j] = &tmp[j * frame_length]; } switch ( in_format ) @@ -218,18 +224,18 @@ AMBI_CONVERT_ERROR convert_ambi_format( { if ( ch_ord_in != ch_ord_out ) { - if ( ( err = renormalize_channels( in, p_tmp, order, ch_norm_in, ch_norm_out ) ) != AMBI_CONVERT_OK ) + if ( ( err = renormalize_channels( in, p_tmp, order, ch_norm_in, ch_norm_out, frame_length ) ) != AMBI_CONVERT_OK ) { return err; } - if ( ( err = reorder_channels( p_tmp, out, order, ch_ord_in, ch_ord_out ) ) != AMBI_CONVERT_OK ) + if ( ( err = reorder_channels( p_tmp, out, order, ch_ord_in, ch_ord_out, frame_length ) ) != AMBI_CONVERT_OK ) { return err; } } else { - if ( ( err = renormalize_channels( in, out, order, ch_norm_in, ch_norm_out ) ) != AMBI_CONVERT_OK ) + if ( ( err = renormalize_channels( in, out, order, ch_norm_in, ch_norm_out, frame_length ) ) != AMBI_CONVERT_OK ) { return err; } @@ -237,7 +243,7 @@ AMBI_CONVERT_ERROR convert_ambi_format( } else if ( in_format == AMBI_FMT_ACN_SN3D && ch_ord_in != ch_ord_out ) { - if ( ( err = reorder_channels( in, out, order, ch_ord_in, ch_ord_out ) ) != AMBI_CONVERT_OK ) + if ( ( err = reorder_channels( in, out, order, ch_ord_in, ch_ord_out, frame_length ) ) != AMBI_CONVERT_OK ) { return err; } @@ -246,18 +252,18 @@ AMBI_CONVERT_ERROR convert_ambi_format( { if ( ch_ord_in != ch_ord_out ) { - if ( ( err = reorder_channels( in, p_tmp, order, ch_ord_in, ch_ord_out ) ) != AMBI_CONVERT_OK ) + if ( ( err = reorder_channels( in, p_tmp, order, ch_ord_in, ch_ord_out, frame_length ) ) != AMBI_CONVERT_OK ) { return err; } - if ( ( err = renormalize_channels( p_tmp, out, order, ch_norm_in, ch_norm_out ) ) != AMBI_CONVERT_OK ) + if ( ( err = renormalize_channels( p_tmp, out, order, ch_norm_in, ch_norm_out, frame_length ) ) != AMBI_CONVERT_OK ) { return err; } } else { - if ( ( err = renormalize_channels( in, out, order, ch_norm_in, ch_norm_out ) ) != AMBI_CONVERT_OK ) + if ( ( err = renormalize_channels( in, out, order, ch_norm_in, ch_norm_out, frame_length ) ) != AMBI_CONVERT_OK ) { return err; } @@ -265,7 +271,7 @@ AMBI_CONVERT_ERROR convert_ambi_format( } else if ( out_format == AMBI_FMT_ACN_SN3D && ch_ord_in != ch_ord_out ) { - if ( ( err = reorder_channels( in, out, order, ch_ord_in, ch_ord_out ) ) != AMBI_CONVERT_OK ) + if ( ( err = reorder_channels( in, out, order, ch_ord_in, ch_ord_out, frame_length ) ) != AMBI_CONVERT_OK ) { return err; } @@ -278,7 +284,7 @@ AMBI_CONVERT_ERROR convert_ambi_format( for ( i_chan = 0; i_chan < n_chan; i_chan++ ) { int16_t i = 0; - for ( i = 0; i < L_FRAME48k; i++ ) + for ( i = 0; i < frame_length; i++ ) { out[i_chan][i] = in[i_chan][i]; } @@ -299,11 +305,12 @@ AMBI_CONVERT_ERROR convert_ambi_format( --------------------------------------------------------------------------*/ AMBI_CONVERT_ERROR renormalize_channels( - float *in[], /* i: input ambisonics channels */ - float *out[], /* o: output ambisonics channels */ - int16_t order, /* i: ambisonics order */ - AMBI_CHANNEL_NORM in_format, /* i: input ambisonics format */ - AMBI_CHANNEL_NORM out_format /* i: output ambisonics format */ + float *in[], /* i: input ambisonics channels */ + float *out[], /* o: output ambisonics channels */ + const int16_t order, /* i: ambisonics order */ + const AMBI_CHANNEL_NORM in_format, /* i: input ambisonics format */ + const AMBI_CHANNEL_NORM out_format, /* i: output ambisonics format */ + const int16_t frame_length /* i: input/output frame length */ ) { int16_t n_chan = ( order + 1 ) * ( order + 1 ); @@ -358,7 +365,7 @@ AMBI_CONVERT_ERROR renormalize_channels( for ( i_chan = 0; i_chan < n_chan; i_chan++ ) { float conversion_factor = conversion_table[i_chan]; - for ( i = 0; i < L_FRAME48k; i++ ) + for ( i = 0; i < frame_length; i++ ) { out[i_chan][i] = in[i_chan][i] * conversion_factor; } @@ -374,11 +381,12 @@ AMBI_CONVERT_ERROR renormalize_channels( --------------------------------------------------------------------------*/ AMBI_CONVERT_ERROR reorder_channels( - float *in[], /* i: input ambisonics channels */ - float *out[], /* o: output ambisonics channels */ - int16_t order, /* i: ambisonics order */ - AMBI_CHANNEL_ORDER in_format, /* i: input ambisonics format */ - AMBI_CHANNEL_ORDER out_format /* i: output ambisonics format */ + float *in[], /* i: input ambisonics channels */ + float *out[], /* o: output ambisonics channels */ + const int16_t order, /* i: ambisonics order */ + const AMBI_CHANNEL_ORDER in_format, /* i: input ambisonics format */ + const AMBI_CHANNEL_ORDER out_format, /* i: output ambisonics format */ + const int16_t frame_length /* i: input/output frame length */ ) { int16_t n_chan = ( order + 1 ) * ( order + 1 ); @@ -421,7 +429,7 @@ AMBI_CONVERT_ERROR reorder_channels( return AMBI_CONVERT_UNSUPPORTED_CONVERSION; } - for ( i = 0; i < L_FRAME48k; i++ ) + for ( i = 0; i < frame_length; i++ ) { for ( i_chan = 0; i_chan < n_chan; i_chan++ ) { diff --git a/lib_util/ambi_convert.h b/lib_util/ambi_convert.h index 825d65127c3a1e8bd922d68f737ab1258390679e..1b2ffb8c607acc39a812b67b20c250a2b564d7ed 100644 --- a/lib_util/ambi_convert.h +++ b/lib_util/ambi_convert.h @@ -35,8 +35,8 @@ #include -#define L_FRAME48k 960 -#define AMBI_MAX_CHANNELS 16 +#define AMBI_MAX_FRAME_LENGTH 960 /* 20ms at 48 kHz Sampling rate */ +#define AMBI_MAX_CHANNELS 16 typedef enum { @@ -66,30 +66,34 @@ typedef enum typedef enum { AMBI_CONVERT_OK = 0, - AMBI_CONVERT_UNSUPPORTED_CONVERSION + AMBI_CONVERT_UNSUPPORTED_CONVERSION, + AMBI_CONVERT_UNSUPPORTED_FRAME_LENGTH } AMBI_CONVERT_ERROR; AMBI_CONVERT_ERROR convert_ambi_format( - float *in[], /* i: input ambisonics channels */ - float *out[], /* o: output ambisonics channels */ - int16_t order, /* i: ambisonics order */ - AMBI_FMT in_format, /* i: input ambisonics format */ - AMBI_FMT out_format /* i: output ambisonics format */ + float *in[], /* i: input ambisonics channels */ + float *out[], /* o: output ambisonics channels */ + const int16_t order, /* i: ambisonics order */ + const AMBI_FMT in_format, /* i: input ambisonics format */ + const AMBI_FMT out_format, /* i: output ambisonics format */ + const int16_t frame_length /* i: input/output frame length */ ); AMBI_CONVERT_ERROR renormalize_channels( - float *in[], /* i: input ambisonics channels */ - float *out[], /* o: output ambisonics channels */ - int16_t order, /* i: ambisonics order */ - AMBI_CHANNEL_NORM in_format, /* i: input ambisonics format */ - AMBI_CHANNEL_NORM out_format /* i: output ambisonics format */ + float *in[], /* i: input ambisonics channels */ + float *out[], /* o: output ambisonics channels */ + const int16_t order, /* i: ambisonics order */ + const AMBI_CHANNEL_NORM in_format, /* i: input ambisonics format */ + const AMBI_CHANNEL_NORM out_format, /* i: output ambisonics format */ + const int16_t frame_length /* i: input/output frame length */ ); AMBI_CONVERT_ERROR reorder_channels( - float *in[], /* i: input ambisonics channels */ - float *out[], /* o: output ambisonics channels */ - int16_t order, /* i: ambisonics order */ - AMBI_CHANNEL_ORDER in_format, /* i: input ambisonics format */ - AMBI_CHANNEL_ORDER out_format /* i: output ambisonics format */ + float *in[], /* i: input ambisonics channels */ + float *out[], /* o: output ambisonics channels */ + const int16_t order, /* i: ambisonics order */ + const AMBI_CHANNEL_ORDER in_format, /* i: input ambisonics format */ + const AMBI_CHANNEL_ORDER out_format, /* i: output ambisonics format */ + const int16_t frame_length /* i: input/output frame length */ ); #endif diff --git a/lib_util/cmdl_tools.c b/lib_util/cmdl_tools.c index bec772ce42f96eb8373d44aebc6cba944cdb288e..625db1273342f1b56eb20e12c5e31ffbf5ec7bc5 100644 --- a/lib_util/cmdl_tools.c +++ b/lib_util/cmdl_tools.c @@ -185,16 +185,16 @@ void convert_backslash( void remove_cr( char *str ) { - char *pos; + int32_t n, p = 0; /* remove all \r characters from the string */ - pos = strchr( str, '\r' ); - while ( pos != NULL ) + for ( n = 0; str[n] != 0; n++ ) { - strcpy( pos, pos + 1 ); - pos = strchr( pos, '\r' ); + char c = str[n]; + str[p] = c; + p += ( c == '\r' ) ? 0 : 1; } - + str[p] = 0; return; } diff --git a/lib_util/g192.c b/lib_util/g192.c index a96a8ee56dc1ea4997e164f35c70beedd178dad7..a5eb030a4fd4bb37dcb9fbd96d7f8b67d0e61121 100644 --- a/lib_util/g192.c +++ b/lib_util/g192.c @@ -482,7 +482,11 @@ G192_ERROR G192_WriteVoipFrame_short( const uint16_t *serial, const int16_t numBits, uint16_t const rtpSequenceNumber, +#ifdef IVAS_RTPDUMP + uint32_t const rtpTimeStamp, +#else uint16_t const rtpTimeStamp, +#endif uint32_t const rcvTime_ms ) { int16_t G192_HEADER[2], G192_DATA[IVAS_MAX_BITS_PER_FRAME]; diff --git a/lib_util/g192.h b/lib_util/g192.h index 751f1324fb286131ba1cd8fd23d68622e69fce3c..0c22b739b9ff372d2939c423615a13458d31e7fd 100644 --- a/lib_util/g192.h +++ b/lib_util/g192.h @@ -93,7 +93,13 @@ G192_ERROR G192_Writer_Open_filename( G192_HANDLE *phG192, const char *filename G192_ERROR G192_WriteFrame( G192_HANDLE const hG192, const uint16_t *serial, const int16_t numBits ); -G192_ERROR G192_WriteVoipFrame_short( G192_HANDLE const hG192, const uint16_t *serial, const int16_t num_bits, uint16_t const rtpSequenceNumber, uint16_t const rtpTimeStamp, uint32_t const rcvTime_ms ); +G192_ERROR G192_WriteVoipFrame_short( G192_HANDLE const hG192, const uint16_t *serial, const int16_t num_bits, uint16_t const rtpSequenceNumber, +#ifdef IVAS_RTPDUMP + uint32_t const rtpTimeStamp, +#else + uint16_t const rtpTimeStamp, +#endif + uint32_t const rcvTime_ms ); G192_ERROR G192_Writer_Close( G192_HANDLE *phG192 ); diff --git a/lib_util/hrtf_file_reader.c b/lib_util/hrtf_file_reader.c index 3347a0c9ab5999930526f84ad7ae3df1465e3e4a..164120d79dba7e7b422967b01a79a287bf68572c 100644 --- a/lib_util/hrtf_file_reader.c +++ b/lib_util/hrtf_file_reader.c @@ -436,8 +436,8 @@ static ivas_error TDREND_LoadBSplineBinaryITD( --------------------------------------------------------------------*/ static ivas_error TDREND_LoadBSplineBinary( - IVAS_DEC_HRTF_HANDLE HrFiltSet_p, /* i/o: HR filter model parameter structure */ - FILE *f_hrtf /* i : HR filter data file handle */ + IVAS_DEC_HRTF_TD_HANDLE HrFiltSet_p, /* i/o: HR filter model parameter structure */ + FILE *f_hrtf /* i : HR filter data file handle */ ) { ModelParams_t *model; @@ -816,7 +816,7 @@ static ivas_error load_reverb_from_binary( hHrtfStatistics->average_energy_r_dyn = (float *) malloc( lr_iac_len * sizeof( float ) ); hHrtfStatistics->inter_aural_coherence_dyn = (float *) malloc( lr_iac_len * sizeof( float ) ); - if ( hHrtfStatistics->average_energy_l_dyn == NULL || hHrtfStatistics->average_energy_l_dyn == NULL || hHrtfStatistics->inter_aural_coherence_dyn == NULL ) + if ( hHrtfStatistics->average_energy_l_dyn == NULL || hHrtfStatistics->average_energy_r_dyn == NULL || hHrtfStatistics->inter_aural_coherence_dyn == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for hrtf data" ); } @@ -882,9 +882,9 @@ ivas_error load_reverb_binary( --------------------------------------------------------------------*/ static ivas_error TDREND_MIX_LoadHRTF( - FILE *f_hrtf, /* i/o: File pointer to HRTF file */ - const int32_t sampleRate, /* i : sample rate */ - IVAS_DEC_HRTF_HANDLE HrFiltSet_p /* o : Loaded HR filter set */ + FILE *f_hrtf, /* i/o: File pointer to HRTF file */ + const int32_t sampleRate, /* i : sample rate */ + IVAS_DEC_HRTF_TD_HANDLE HrFiltSet_p /* o : Loaded HR filter set */ ) { int16_t tmp; @@ -1006,7 +1006,7 @@ static ivas_error TDREND_MIX_LoadHRTF( *---------------------------------------------------------------------*/ ivas_error load_TDrend_HRTF_binary( - IVAS_DEC_HRTF_HANDLE hHrtf, /* i/o: HRTF handle */ + IVAS_DEC_HRTF_TD_HANDLE hHrtf, /* i/o: TD rend. HRTF handle */ const int32_t sampleRate, /* i : sample rate */ const hrtfFileReader *hrtfReader /* i : pointer to hrtfFileReader handle */ ) @@ -1029,7 +1029,7 @@ ivas_error load_TDrend_HRTF_binary( *---------------------------------------------------------------------*/ void destroy_td_hrtf( - IVAS_DEC_HRTF_HANDLE *hHrtf /* i/o: HRTF handle */ + IVAS_DEC_HRTF_TD_HANDLE *hHrtf /* i/o: TD rend. HRTF handle */ ) { int16_t i; @@ -1099,8 +1099,8 @@ void destroy_td_hrtf( *---------------------------------------------------------------------*/ static ivas_error create_Crend_HRTF_from_rawdata( - HRTFS_HANDLE *hHRTF, /* i/o: HRTF CRend handle */ - char *hrtf_data /* i : pointer to binary file */ + HRTFS_CREND_HANDLE *hHRTF, /* i/o: HRTF CRend handle */ + char *hrtf_data /* i : pointer to binary file */ ) { int16_t i, j, k; @@ -1112,7 +1112,6 @@ static ivas_error create_Crend_HRTF_from_rawdata( ivas_error error; Word16 factorQ; - if ( hrtf_data == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; @@ -1254,7 +1253,6 @@ static ivas_error create_Crend_HRTF_from_rawdata( } } - /* coeff_im (the size depends on pIndex_frequency_max) */ for ( i = 0; i < ( *hHRTF )->max_num_ir; i++ ) { @@ -2095,7 +2093,6 @@ void destroy_hrtf_statistics( IVAS_DEC_HRTF_STATISTICS_HANDLE *hHrtfStatistics /* i/o: HRTF statistics handle */ ) { - if ( ( hHrtfStatistics != NULL ) && ( *hHrtfStatistics != NULL ) && ( ( *hHrtfStatistics )->fromROM == FALSE ) ) { if ( ( *hHrtfStatistics )->average_energy_l != NULL ) diff --git a/lib_util/hrtf_file_reader.h b/lib_util/hrtf_file_reader.h index 727e660dfb926c98983caff10cadee0872ee3407..938b5c1595024042c0ebc845fdfe9439d11b9c1c 100644 --- a/lib_util/hrtf_file_reader.h +++ b/lib_util/hrtf_file_reader.h @@ -99,7 +99,7 @@ void hrtfFileReader_close( *---------------------------------------------------------------------*/ ivas_error load_TDrend_HRTF_binary( - IVAS_DEC_HRTF_HANDLE hHrtf, /* i/o: HRTF handle */ + IVAS_DEC_HRTF_TD_HANDLE hHrtf, /* i/o: TD rend. HRTF handle */ const int32_t sampleRate, /* i : sample rate */ const hrtfFileReader *hrtfReader /* i : pointer to hrtfFileReader handle */ ); @@ -192,7 +192,7 @@ void destroy_parambin_hrtf( *---------------------------------------------------------------------*/ void destroy_td_hrtf( - IVAS_DEC_HRTF_HANDLE *hHRTF /* i/o: HRTF handle */ + IVAS_DEC_HRTF_TD_HANDLE *hHRTF /* i/o: TD rend. HRTF handle */ ); /*---------------------------------------------------------------------* diff --git a/lib_util/ivas_bpool.c b/lib_util/ivas_bpool.c new file mode 100644 index 0000000000000000000000000000000000000000..9db909f535e17a2911ab7e809c3a27caaf277edd --- /dev/null +++ b/lib_util/ivas_bpool.c @@ -0,0 +1,153 @@ +/****************************************************************************************************** + + (C) 2022-2025 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB, + Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., + Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, + Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other + contributors to this repository. All Rights Reserved. + + This software is protected by copyright law and by international treaties. + The IVAS codec Public Collaboration consisting of Dolby International AB, Ericsson AB, + Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., + Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, + Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other + contributors to this repository retain full ownership rights in their respective contributions in + the software. This notice grants no license of any kind, including but not limited to patent + license, nor is any license granted by implication, estoppel or otherwise. + + Contributors are required to enter into the IVAS codec Public Collaboration agreement before making + contributions. + + This software is provided "AS IS", without any express or implied warranties. The software is in the + development stage. It is intended exclusively for experts who have experience with such software and + solely for the purpose of inspection. All implied warranties of non-infringement, merchantability + and fitness for a particular purpose are hereby disclaimed and excluded. + + Any dispute, controversy or claim arising under or in relation to providing this software shall be + submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in + accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and + the United Nations Convention on Contracts on the International Sales of Goods. + +*******************************************************************************************************/ +#include +#include +#include "ivas_bpool.h" +#include "ivas_error_utils.h" +#include "mutex.h" + +struct BPOOL +{ + mtx_t lock; + uint32_t bufferSize; + uint32_t numBuffers; + uint32_t numFreeBuffers; + void **freeBuffers; +}; + +ivas_error BPOOL_Create( BPOOL_HANDLE *pHandle, size_t bufferSize, uint32_t numBuffers ) +{ + uint32_t n; + uint8_t *base = NULL; + BPOOL_HANDLE handle; + size_t allocSize = sizeof( struct BPOOL ); + + if ( pHandle == NULL ) + { + return IVAS_ERROR( IVAS_ERR_WRONG_PARAMS, "Invalid pointer to Buffer Pool Handle" ); + } + + *pHandle = NULL; + + allocSize += bufferSize * numBuffers; /* pool memory */ + allocSize += sizeof( void * ) * numBuffers; /* free buffers stack */ + + base = calloc( allocSize, sizeof( uint8_t ) ); + if ( base == NULL ) + { + return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Couldn't allocate Buffer pool" ); + } + + handle = (BPOOL_HANDLE) base; + base += sizeof( struct BPOOL ); + + mtx_init( &handle->lock, 0 ); + handle->bufferSize = bufferSize; + handle->numBuffers = numBuffers; + handle->numFreeBuffers = numBuffers; + handle->freeBuffers = (void **) base; + base += ( sizeof( void * ) * numBuffers ); + for ( n = 0; n < numBuffers; n++ ) + { + handle->freeBuffers[n] = base; + base += bufferSize; + } + + *pHandle = handle; + return IVAS_ERR_OK; +} + +void BPOOL_Destroy( BPOOL_HANDLE *pHandle ) +{ + if ( ( pHandle != NULL ) && ( *pHandle != NULL ) ) + { + mtx_destroy( &( *pHandle )->lock ); + free( *pHandle ); + *pHandle = NULL; + } +} + +ivas_error BPOOL_GetBuffer( BPOOL_HANDLE handle, void **dataPtr ) +{ + uint32_t idx = 0; + bool isFree = false; + + if ( handle == NULL || dataPtr == NULL ) + { + return IVAS_ERROR( IVAS_ERR_WRONG_PARAMS, "Invalid pointer args in GetBuffer" ); + } + + mtx_lock( &handle->lock ); + isFree = ( handle->numFreeBuffers > 0 ); + if ( isFree ) + { + idx = --handle->numFreeBuffers; + } + mtx_unlock( &handle->lock ); + + if ( !isFree ) + { + return IVAS_ERROR( IVAS_ERR_RTP_UNDERFLOW, "Underflow, no free buffers in pool" ); + } + + *dataPtr = handle->freeBuffers[idx]; + return IVAS_ERR_OK; +} + +/* return the buffer back to pool */ +ivas_error BPOOL_FreeBuffer( BPOOL_HANDLE handle, void *dataPtr ) +{ + uint32_t idx; + + if ( handle == NULL || dataPtr == NULL ) + { + return IVAS_ERROR( IVAS_ERR_WRONG_PARAMS, "Invalid pointer args in GetBuffer" ); + } + + mtx_lock( &handle->lock ); + idx = handle->numFreeBuffers++; + mtx_unlock( &handle->lock ); + + handle->freeBuffers[idx] = dataPtr; + + return IVAS_ERR_OK; +} + +/* return the number of free buffers available atm in the pool */ +uint32_t BPOOL_AvailableBuffers( BPOOL_HANDLE handle ) +{ + uint32_t numFreeBuffers; + mtx_lock( &handle->lock ); + numFreeBuffers = handle->numFreeBuffers; + mtx_unlock( &handle->lock ); + return numFreeBuffers; +} diff --git a/lib_util/ivas_bpool.h b/lib_util/ivas_bpool.h new file mode 100644 index 0000000000000000000000000000000000000000..30cf4962b5198fd2a22a522061e8ce4cff2be915 --- /dev/null +++ b/lib_util/ivas_bpool.h @@ -0,0 +1,57 @@ +/****************************************************************************************************** + + (C) 2022-2025 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB, + Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., + Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, + Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other + contributors to this repository. All Rights Reserved. + + This software is protected by copyright law and by international treaties. + The IVAS codec Public Collaboration consisting of Dolby International AB, Ericsson AB, + Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., + Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, + Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other + contributors to this repository retain full ownership rights in their respective contributions in + the software. This notice grants no license of any kind, including but not limited to patent + license, nor is any license granted by implication, estoppel or otherwise. + + Contributors are required to enter into the IVAS codec Public Collaboration agreement before making + contributions. + + This software is provided "AS IS", without any express or implied warranties. The software is in the + development stage. It is intended exclusively for experts who have experience with such software and + solely for the purpose of inspection. All implied warranties of non-infringement, merchantability + and fitness for a particular purpose are hereby disclaimed and excluded. + + Any dispute, controversy or claim arising under or in relation to providing this software shall be + submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in + accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and + the United Nations Convention on Contracts on the International Sales of Goods. + +*******************************************************************************************************/ + +#ifndef IVAS_BPOOL_H +#define IVAS_BPOOL_H + +#include +#include "common_api_types.h" + +/* Forward declaraiton of opaque buffer pool handle */ +typedef struct BPOOL *BPOOL_HANDLE; + +/* Create a buffer pool with given element size and max number of buffers */ +ivas_error BPOOL_Create( BPOOL_HANDLE *pHandle, size_t bufferSize, uint32_t numBuffers ); + +/* Destroy the buffer pool and all free-up all allocated memory */ +void BPOOL_Destroy( BPOOL_HANDLE *pHandle ); + +/* request a buffer from the pool */ +ivas_error BPOOL_GetBuffer( BPOOL_HANDLE handle, void **dataPtr ); + +/* return the buffer back to pool */ +ivas_error BPOOL_FreeBuffer( BPOOL_HANDLE handle, void *dataPtr ); + +/* return the number of free buffers available atm in the pool */ +uint32_t BPOOL_AvailableBuffers( BPOOL_HANDLE handle ); + +#endif /* IVAS_BPOOL_H */ diff --git a/lib_util/ivas_queue.c b/lib_util/ivas_queue.c new file mode 100644 index 0000000000000000000000000000000000000000..b17cf3e21a6e0222b439ba0826780dd031551670 --- /dev/null +++ b/lib_util/ivas_queue.c @@ -0,0 +1,137 @@ +/****************************************************************************************************** + + (C) 2022-2025 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB, + Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., + Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, + Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other + contributors to this repository. All Rights Reserved. + + This software is protected by copyright law and by international treaties. + The IVAS codec Public Collaboration consisting of Dolby International AB, Ericsson AB, + Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., + Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, + Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other + contributors to this repository retain full ownership rights in their respective contributions in + the software. This notice grants no license of any kind, including but not limited to patent + license, nor is any license granted by implication, estoppel or otherwise. + + Contributors are required to enter into the IVAS codec Public Collaboration agreement before making + contributions. + + This software is provided "AS IS", without any express or implied warranties. The software is in the + development stage. It is intended exclusively for experts who have experience with such software and + solely for the purpose of inspection. All implied warranties of non-infringement, merchantability + and fitness for a particular purpose are hereby disclaimed and excluded. + + Any dispute, controversy or claim arising under or in relation to providing this software shall be + submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in + accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and + the United Nations Convention on Contracts on the International Sales of Goods. + +*******************************************************************************************************/ + +#include +#include "ivas_queue.h" +#include "ivas_error_utils.h" +#include "mutex.h" + +struct QUEUE +{ + mtx_t lock; + NODE *front; + NODE *back; + uint32_t size; +}; + +ivas_error QUEUE_Create( QUEUE_HANDLE *pHandle ) +{ + QUEUE_HANDLE handle = NULL; + *pHandle = NULL; + + if ( pHandle == NULL ) + { + return IVAS_ERROR( IVAS_ERR_WRONG_PARAMS, "Invalid pointer to Buffer Pool Handle" ); + } + + handle = calloc( 1, sizeof( struct QUEUE ) ); + if ( handle != NULL ) + { + mtx_init( &handle->lock, 0 ); + } + + *pHandle = handle; + return IVAS_ERR_OK; +} + +/* Destroy the queue and free-up all allocated memory */ +void QUEUE_Destroy( QUEUE_HANDLE *pHandle ) +{ + if ( ( pHandle != NULL ) && ( *pHandle != NULL ) ) + { + mtx_destroy( &( *pHandle )->lock ); + free( *pHandle ); + *pHandle = NULL; + } +} + +void QUEUE_Push( QUEUE_HANDLE handle, NODE *node ) +{ + mtx_lock( &handle->lock ); + if ( handle->back == NULL ) + { + handle->front = node; + } + else + { + handle->back->next = node; + } + handle->back = node; + handle->size++; + mtx_unlock( &handle->lock ); +} + +/* return the buffer back to pool */ +NODE *QUEUE_Pop( QUEUE_HANDLE handle ) +{ + NODE *node; + mtx_lock( &handle->lock ); + node = handle->front; + handle->front = handle->front->next; + if ( NULL == handle->front ) + { + handle->back = NULL; + } + handle->size--; + mtx_unlock( &handle->lock ); + return node; +} + +/* returns the first element in the queue */ +NODE *QUEUE_Front( QUEUE_HANDLE handle ) +{ + NODE *node; + mtx_lock( &handle->lock ); + node = handle->front; + mtx_unlock( &handle->lock ); + return node; +} + +/* returns the last element in the queue */ +NODE *QUEUE_Back( QUEUE_HANDLE handle ) +{ + NODE *node; + mtx_lock( &handle->lock ); + node = handle->back; + mtx_unlock( &handle->lock ); + return node; +} + +/* return the number of elements in the queue */ +size_t QUEUE_Size( QUEUE_HANDLE handle ) +{ + uint32_t numNodes; + mtx_lock( &handle->lock ); + numNodes = handle->size; + mtx_unlock( &handle->lock ); + return numNodes; +} diff --git a/lib_util/ivas_queue.h b/lib_util/ivas_queue.h new file mode 100644 index 0000000000000000000000000000000000000000..1c6b77504e501b6f0ec680839cd52f3f10b04ca8 --- /dev/null +++ b/lib_util/ivas_queue.h @@ -0,0 +1,68 @@ +/****************************************************************************************************** + + (C) 2022-2025 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB, + Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., + Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, + Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other + contributors to this repository. All Rights Reserved. + + This software is protected by copyright law and by international treaties. + The IVAS codec Public Collaboration consisting of Dolby International AB, Ericsson AB, + Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., + Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, + Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other + contributors to this repository retain full ownership rights in their respective contributions in + the software. This notice grants no license of any kind, including but not limited to patent + license, nor is any license granted by implication, estoppel or otherwise. + + Contributors are required to enter into the IVAS codec Public Collaboration agreement before making + contributions. + + This software is provided "AS IS", without any express or implied warranties. The software is in the + development stage. It is intended exclusively for experts who have experience with such software and + solely for the purpose of inspection. All implied warranties of non-infringement, merchantability + and fitness for a particular purpose are hereby disclaimed and excluded. + + Any dispute, controversy or claim arising under or in relation to providing this software shall be + submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in + accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and + the United Nations Convention on Contracts on the International Sales of Goods. + +*******************************************************************************************************/ + +#ifndef IVAS_QUEUE_H +#define IVAS_QUEUE_H + +#include +#include "common_api_types.h" + +typedef struct NODE +{ + struct NODE *next; +} NODE; + +/* Forward declaraiton of opaque queue handle */ +typedef struct QUEUE *QUEUE_HANDLE; + +/* Create a queue with given element size and max number of buffers */ +ivas_error QUEUE_Create( QUEUE_HANDLE *pHandle ); + +/* Destroy the queue and all free-up all allocated memory */ +void QUEUE_Destroy( QUEUE_HANDLE *pHandle ); + +/* push a buffer to a queue */ +void QUEUE_Push( QUEUE_HANDLE handle, NODE *data ); + +/* pop the buffer from the front */ +NODE *QUEUE_Pop( QUEUE_HANDLE handle ); + +/* returns the first element from the front */ +NODE *QUEUE_Front( QUEUE_HANDLE handle ); + +/* returns the last element from the back */ +NODE *QUEUE_Back( QUEUE_HANDLE handle ); + +/* return the number of elements in the queue */ +size_t QUEUE_Size( QUEUE_HANDLE handle ); + +#endif /* IVAS_QUEUE_H */ diff --git a/lib_util/ivas_rtp_api.h b/lib_util/ivas_rtp_api.h new file mode 100644 index 0000000000000000000000000000000000000000..8e551c5ffcf303a9314a438aaa12eadb7357c086 --- /dev/null +++ b/lib_util/ivas_rtp_api.h @@ -0,0 +1,607 @@ +/****************************************************************************************************** + + (C) 2022-2025 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB, + Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., + Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, + Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other + contributors to this repository. All Rights Reserved. + + This software is protected by copyright law and by international treaties. + The IVAS codec Public Collaboration consisting of Dolby International AB, Ericsson AB, + Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., + Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, + Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other + contributors to this repository retain full ownership rights in their respective contributions in + the software. This notice grants no license of any kind, including but not limited to patent + license, nor is any license granted by implication, estoppel or otherwise. + + Contributors are required to enter into the IVAS codec Public Collaboration agreement before making + contributions. + + This software is provided "AS IS", without any express or implied warranties. The software is in the + development stage. It is intended exclusively for experts who have experience with such software and + solely for the purpose of inspection. All implied warranties of non-infringement, merchantability + and fitness for a particular purpose are hereby disclaimed and excluded. + + Any dispute, controversy or claim arising under or in relation to providing this software shall be + submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in + accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and + the United Nations Convention on Contracts on the International Sales of Goods. + +*******************************************************************************************************/ + +#ifndef IVAS_RTP_API_H +#define IVAS_RTP_API_H + +#include +#include "common_api_types.h" + +/* + * +-----------------------+---------------------+--------------------+----------+ + * | RTP Header (+ HDREXT) | payload header | frame data | PI data | + * +-----------------------+---------------------+--------------------+----------+ + * \--------------------\ /------------------------------/ + * IVAS payload + * + * This api provides a mechanism to generate/unpack the IVAS payload. The RTP Header + * and header extension fields must be handled by caller. + * + * IVAS General Payload structure + * =============================== + * + * 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 + * H H H H F H + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * |1| T | D |1| ET1 |x x x x|1| ET2 |x x x x|0|1|0 1| BR |1| ET3 |x x x x|… + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * \--------------/\--------------/\--------------/\--------------/\--------------/ + * Initial E byte Subsqnt Ebyte1 Subsqnt Ebyte2 ToC1 Subsqnt Ebyte3 + * + * H F + * +-+-+-+-+-+-+-+-+-------------------------- ---+-------------------- ---+-------+ + * …|0|0|0 1| BR | IVAS frame 1 ... | IVAS frame 2 ... |PI data| + * +-+-+-+-+-+-+-+-+-------------------------- ---+-------------------- ---+-------+ + * \--------------/ + * ToC2 + * + */ + +#define IVAS_MAX_FRAMES_PER_RTP_PACKET ( 8 ) /* Max supported frames per RTP packet */ + +/* It is difficult to decide the RTP Payload buffer's capacity intrinsically however computing + * using the maximum frame size and all currently supported PI data present gives a crude + * estimate or RTP packet size per frame. The additional PI data is assumed to add upto a 20% + * overhead in bitrate for the computation. + */ +#define NOMINAL_BUFFER_SIZE( numFramesPerPacket ) ( ( IVAS_MAX_BITS_PER_FRAME + ( IVAS_MAX_BITS_PER_FRAME / 5 ) ) * ( numFramesPerPacket ) / 8 ) + +#define DEFAULT_MAX_PACKET_BYTES ( 1400 ) /* Typical MTU size of 4G/5G Cellular Interfaces */ + +#define NO_BITRATE_REQ ( 0u ) /* If no bitrate is requested from remote */ + +/* IVAS Codec Types */ +typedef enum +{ + IVAS_RTP_EVS, /* EVS */ + IVAS_RTP_IVAS /* IVAS */ +} IVAS_RTP_CODEC; + +/* IVAS Bandwidth Requests */ +typedef enum +{ + IVAS_BANDWIDTH_NB, /* Narrowband */ + IVAS_BANDWIDTH_WB, /* Wideband*/ + IVAS_BANDWIDTH_SWB, /* SuperWideband*/ + IVAS_BANDWIDTH_FB, /* Fullband */ + IVAS_BANDWIDTH_NO_REQ, /* No Preference */ +} IVAS_RTP_BANDWIDTH; + +/* Channel Aware Coding */ +typedef enum +{ + IVAS_RTP_CA_LO_O2, /* FER=LO, OFFSET=2 */ + IVAS_RTP_CA_LO_O3, /* FER=LO, OFFSET=3 */ + IVAS_RTP_CA_LO_O5, /* FER=LO, OFFSET=5 */ + IVAS_RTP_CA_LO_O7, /* FER=LO, OFFSET=7 */ + IVAS_RTP_CA_HI_O2, /* FER=HI, OFFSET=2 */ + IVAS_RTP_CA_HI_O3, /* FER=HI, OFFSET=3 */ + IVAS_RTP_CA_HI_O5, /* FER=HI, OFFSET=5 */ + IVAS_RTP_CA_HI_O7, /* FER=HI, OFFSET=7 */ + IVAS_RTP_CA_NO_REQ /* No request */ +} IVAS_RTP_CA_MODE; + +/* Coded Format Requests */ +typedef enum +{ + IVAS_FMT_STEREO, /* Stereo */ + IVAS_FMT_SBA, /* Scene Based Audio */ + IVAS_FMT_MASA, /* Metadata Assisted Spatial Audio */ + IVAS_FMT_ISM, /* Object Based Audio */ + IVAS_FMT_MC, /* Multichannel Audio */ + IVAS_FMT_OMASA, /* Object + MASA */ + IVAS_FMT_OSBA, /* Object + SBA */ + IVAS_FMT_NO_REQ, /* No preference */ +} IVAS_RTP_FORMAT; + +#ifdef RTP_S4_251135_CR26253_0016_REV1 +/* Coded Subformat Requests */ +typedef enum +{ + IVAS_SUBFMT_FOA_PLANAR, + IVAS_SUBFMT_HOA2_PLANAR, + IVAS_SUBFMT_HOA3_PLANAR, + IVAS_SUBFMT_FOA, + IVAS_SUBFMT_HOA2, + IVAS_SUBFMT_HOA3, + IVAS_SUBFMT_MASA1, + IVAS_SUBFMT_MASA2, + IVAS_SUBFMT_ISM1, + IVAS_SUBFMT_ISM2, + IVAS_SUBFMT_ISM3, + IVAS_SUBFMT_ISM4, + IVAS_SUBFMT_ISM1_EXTENDED_METADATA, + IVAS_SUBFMT_ISM2_EXTENDED_METADATA, + IVAS_SUBFMT_ISM3_EXTENDED_METADATA, + IVAS_SUBFMT_ISM4_EXTENDED_METADATA, + IVAS_SUBFMT_MC_5_1, + IVAS_SUBFMT_MC_7_1, + IVAS_SUBFMT_MC_5_1_2, + IVAS_SUBFMT_MC_5_1_4, + IVAS_SUBFMT_MC_7_1_4, + IVAS_SUBFMT_RESERVED_21, + IVAS_SUBFMT_RESERVED_22, + IVAS_SUBFMT_RESERVED_23, + IVAS_SUBFMT_RESERVED_24, + IVAS_SUBFMT_RESERVED_25, + IVAS_SUBFMT_RESERVED_26, + IVAS_SUBFMT_RESERVED_27, + IVAS_SUBFMT_RESERVED_28, + IVAS_SUBFMT_RESERVED_29, + IVAS_SUBFMT_RESERVED_30, + IVAS_SUBFMT_RESERVED_31, + IVAS_SUBFMT_OMASA_ISM1_1TC, + IVAS_SUBFMT_OMASA_ISM2_1TC, + IVAS_SUBFMT_OMASA_ISM3_1TC, + IVAS_SUBFMT_OMASA_ISM4_1TC, + IVAS_SUBFMT_OMASA_ISM1_2TC, + IVAS_SUBFMT_OMASA_ISM2_2TC, + IVAS_SUBFMT_OMASA_ISM3_2TC, + IVAS_SUBFMT_OMASA_ISM4_2TC, + IVAS_SUBFMT_OSBA_ISM1_FOA_PLANAR, + IVAS_SUBFMT_OSBA_ISM2_FOA_PLANAR, + IVAS_SUBFMT_OSBA_ISM3_FOA_PLANAR, + IVAS_SUBFMT_OSBA_ISM4_FOA_PLANAR, + IVAS_SUBFMT_OSBA_ISM1_FOA, + IVAS_SUBFMT_OSBA_ISM2_FOA, + IVAS_SUBFMT_OSBA_ISM3_FOA, + IVAS_SUBFMT_OSBA_ISM4_FOA, + IVAS_SUBFMT_OSBA_ISM1_HOA2_PLANAR, + IVAS_SUBFMT_OSBA_ISM2_HOA2_PLANAR, + IVAS_SUBFMT_OSBA_ISM3_HOA2_PLANAR, + IVAS_SUBFMT_OSBA_ISM4_HOA2_PLANAR, + IVAS_SUBFMT_OSBA_ISM1_HOA2, + IVAS_SUBFMT_OSBA_ISM2_HOA2, + IVAS_SUBFMT_OSBA_ISM3_HOA2, + IVAS_SUBFMT_OSBA_ISM4_HOA2, + IVAS_SUBFMT_OSBA_ISM1_HOA3_PLANAR, + IVAS_SUBFMT_OSBA_ISM2_HOA3_PLANAR, + IVAS_SUBFMT_OSBA_ISM3_HOA3_PLANAR, + IVAS_SUBFMT_OSBA_ISM4_HOA3_PLANAR, + IVAS_SUBFMT_OSBA_ISM1_HOA3, + IVAS_SUBFMT_OSBA_ISM2_HOA3, + IVAS_SUBFMT_OSBA_ISM3_HOA3, + IVAS_SUBFMT_OSBA_ISM4_HOA3, + IVAS_SUBFMT_NO_REQ +} IVAS_RTP_SUBFORMAT; + +/* Split Rendering Requests */ +typedef struct +{ + uint32_t valid : 1; /* is split rendering request valid */ + uint32_t diegetic : 1; /* enabling diegetic support for Split Rendering */ + uint32_t yaw : 1; /* transmission metadata for correction around yaw axis */ + uint32_t pitch : 1; /* transmission metadata for correction around pitch axis */ + uint32_t roll : 1; /* transmission metadata for correction around roll axis */ + uint32_t reserved : 27; /* reserved */ +} IVAS_RTP_SPLITRENDER; +#endif /* RTP_S4_251135_CR26253_0016_REV1 */ + +/* Remote Requests Types (Keys) */ +typedef enum +{ + IVAS_REQUEST_CODEC, /* Request codec type, value of type IVAS_RTP_CODEC */ + IVAS_REQUEST_BITRATE, /* Request bitrate, value of type uint32_t in kbps */ + IVAS_REQUEST_BANDWIDTH, /* Request bandwidth, value of type IVAS_RTP_BANDWIDTH */ + IVAS_REQUEST_FORMAT, /* Request format, value of type IVAS_RTP_FORMAT */ + IVAS_REQUEST_CA_MODE, /* Request channel awareness, value of type IVAS_RTP_CA_MODE */ +#ifdef RTP_S4_251135_CR26253_0016_REV1 + IVAS_REQUEST_SUBFORMAT, /* Request subFormat, value of type IVAS_RTP_SUBFORMAT */ + IVAS_REQUEST_SR_CONFIG, /* Request spit rendering, value of type IVAS_RTP_SPLITRENDER */ +#endif /* RTP_S4_251135_CR26253_0016_REV1 */ + IVAS_REQUEST_MAX /* Max number of requests */ +} IVAS_RTP_REQUEST_TYPE; + +/* Remote Request Values */ +typedef union +{ + uint32_t bitrate; /* bitrate in kbps when request type is IVAS_REQUEST_BITRATE */ + IVAS_RTP_CODEC codec; /* codec id when request type is IVAS_REQUEST_CODEC */ + IVAS_RTP_BANDWIDTH bandwidth; /* badwidth when request type is IVAS_REQUEST_BANDWIDTH */ + IVAS_RTP_FORMAT formatType; /* format type when request type is IVAS_REQUEST_FORMAT */ + IVAS_RTP_CA_MODE caMode; /* channel aware mode when request type is IVAS_REQUEST_CA_MODE */ +#ifdef RTP_S4_251135_CR26253_0016_REV1 + IVAS_RTP_SUBFORMAT subFormatType; /* sub-format type when request type is IVAS_REQUEST_SUBFORMAT */ + IVAS_RTP_SPLITRENDER srConfig; /* split rendering config when request type is IVAS_REQUEST_SR_CONFIG */ +#endif /* RTP_S4_251135_CR26253_0016_REV1 */ +} IVAS_RTP_REQUEST_VALUE; + +/* Template for pi data types, all defined pi data follow this template + * for example scene orientation pi data can be represented as :- + * + * typedef struct { + * size_t size; // sizeof(IVAS_PIDATA_SCENE_ORIENTATION) + * uint32_t piDataType; // IVAS_PI_SCENE_ORIENTATION + * float w, x, y, z; // pi data of scene orientation in quaternions + * } IVAS_PIDATA_SCENE_ORIENTATION; + * + */ +typedef struct +{ + size_t size; /* size of this structure */ + uint32_t piDataType; /* IVAS PI data type */ + uint8_t data[1]; /* Variable length array */ +} IVAS_PIDATA_GENERIC; + +/* Generic data buffer for sending/receiving coded frames / rtp payloads + * data buffer is owned and initialized by caller, rtp api will ensure + * buffer write does not exceed capacity. + */ +typedef struct +{ + size_t capacity; /* allocated size of the data buffer */ + size_t length; /* length of the initialized data in the buffer */ + uint8_t *buffer; /* pointer to the payload buffer */ +} IVAS_DATA_BUFFER; + +#ifdef RTP_S4_251135_CR26253_0016_REV1 +typedef enum +{ + IVAS_SR_TRANSPORT_LCLD, + IVAS_SR_TRANSPORT_LC3PLUS +} IVAS_RTP_SR_TRANSPORT; + +typedef struct +{ + bool valid; /* Valid Split Rendering Info for/in the ToC */ + bool diegetic; /* SR content digetic */ + uint32_t bitrateKbps; /* SR bitrate in kbps */ + IVAS_RTP_SR_TRANSPORT codec; /* SR Transport Codec used*/ +} IVAS_RTP_SR_INFO; +#endif /* RTP_S4_251135_CR26253_0016_REV1 */ + +/**********************************************/ +/* IVAS RTP PACKER API */ +/**********************************************/ + +/* Forward declaration of rtp pack/unpack handle types */ +typedef struct IVAS_RTP_PACK *IVAS_RTP_PACK_HANDLE; /* rtp packer handle type */ + +/* Initial configuration for rtp packer + * - maxFramesPerPacket is used to define if more than one frame should be packed + * in the same rtp packet. If zero, will use IVAS_MAX_FRAMES_PER_RTP_PACKET. + */ +typedef struct +{ + uint32_t maxFramesPerPacket; /* maximum no of frame per packet desired during the session */ +} IVAS_RTP_PACK_CONFIG; + +/* Open an instance of the RTP packer and return a handle to rtp packer on success + * error code is retured on failure and handle is set to NULL + */ +ivas_error IVAS_RTP_PACK_Open( + IVAS_RTP_PACK_HANDLE *phIvasPack, /* i/o: pointer to an IVAS rtp packer handle to be opened */ + const IVAS_RTP_PACK_CONFIG *config /* i : pointer to initial config for RTP Packer */ +); + +/* Close and free an existing instance of rtp packer */ +void IVAS_RTP_PACK_Close( + IVAS_RTP_PACK_HANDLE *phIvasPack /* i/o : pointer to an IVAS rtp packer handle to be closed */ +); + +/* Update the RTP Header structure */ +#ifdef FIXED_RTP_SEQUENCE_NUM +ivas_error IVAS_RTP_PACK_UpdateHeader( + IVAS_RTP_PACK_HANDLE hIvasPack, /* i/o: pointer to an IVAS rtp packer handle to be opened */ + uint16_t seqNumInitVal, /* i : Initial sequence number to be used for 1st packet */ + uint32_t ssrc, /* i : Unique 32-bit Source ID as negotiated during SDP */ + uint8_t numCC, /* i : numCC indicates no. of contributing sources */ + uint32_t *csrc, /* i : SSRCs of contributing Sources for a mixed stream */ + uint16_t extHeaderId, /* i : extension header ID */ + uint16_t numExtensionBytes, /* i : length of the extension data */ + uint8_t *extData /* i : extension data pointer */ +); +#else +ivas_error IVAS_RTP_PACK_UpdateHeader( + IVAS_RTP_PACK_HANDLE hIvasPack, /* i/o: pointer to an IVAS rtp packer handle to be opened */ + uint32_t ssrc, /* i : Unique 32-bit Source ID as negotiated during SDP */ + uint8_t numCC, /* i : numCC indicates no. of contributing sources */ + uint32_t *csrc, /* i : SSRCs of contributing Sources for a mixed stream */ + uint16_t extHeaderId, /* i : extension header ID */ + uint16_t numExtensionBytes, /* i : length of the extension data */ + uint8_t *extData /* i : extension data pointer */ +); +#endif + +/* Add requests for remote sender using a key value pair api + * each key must be provided with a corresponding value type + * + * Cross validation of some key,value pairs will not be done + * in this API. E.g. Codec ID and supported bitrates/bandwidths + * will not be performed at this level. + */ +ivas_error IVAS_RTP_PACK_PushRemoteRequest( + IVAS_RTP_PACK_HANDLE hIvasPack, /* i/o : IVAS rtp packer handle */ + IVAS_RTP_REQUEST_TYPE reqType, /* i : remote request type */ + IVAS_RTP_REQUEST_VALUE reqValue /* i : value of the requested type */ +); + +/* Push a single IVAS/EVS frame to rtp packer + * + * If multiple frames per RTP packet are desired, multiple frames must be explicitly + * pushed before a call to IVAS_RTP_PACK_GetPayload to generate a rtp payload. + * + * It is possible to have variable frames per packet until maxFramesPerPacket frames + * if IVAS_RTP_PACK_GetPayload is invoked asyncronously w.r.t this api. + * + */ +ivas_error IVAS_RTP_PACK_PushFrame( + IVAS_RTP_PACK_HANDLE hIvasPack, /* i/o : IVAS rtp packer handle */ + IVAS_RTP_CODEC codecId, /* i : Codec type (IVAS/EVS) */ +#ifdef RTP_S4_251135_CR26253_0016_REV1 + const IVAS_RTP_SR_INFO *srInfo, /* i : Split Rendering Info (NULL if absent) */ +#endif /* RTP_S4_251135_CR26253_0016_REV1 */ + const IVAS_DATA_BUFFER *frameBuffer /* i : packed frame bitstream for IVAS/EVS */ +); + +/* Get the number of frames in the FiFo currently */ +uint32_t IVAS_RTP_PACK_GetNumFrames( + IVAS_RTP_PACK_HANDLE hIvasPack /* i/o : IVAS rtp packer handle */ +); + +/* Push single PI data to rtp packer + * + * Provide PI data for a current RTP packet. All PI data is locally cached in the packer + * and set to the rtp payload with policy defined in initial configuration during call to + * IVAS_RTP_PACK_GetPayload. + * + */ +ivas_error IVAS_RTP_PACK_PushPiData( + IVAS_RTP_PACK_HANDLE hIvasPack, /* i/o : IVAS rtp packer handle */ + const IVAS_PIDATA_GENERIC *data /* i : pointer to the PIData stucture */ +); + +/* Generate a rtp payload using available pushed frames + * + * Available remote requests, pi data and frames will be packed into a rtp payload. The + * capacity field of payload is used to limits the maximum RTP packet size. + * + */ +ivas_error IVAS_RTP_PACK_GetPayload( + IVAS_RTP_PACK_HANDLE hIvasPack, /* i/o : IVAS rtp packer handle */ + IVAS_DATA_BUFFER *payload, /* o : encapsulated rtp payload */ + uint32_t *numFramesInPayload /* o : no. of frames in payload */ +); + +/* Generate a rtp packet using available pushed frames + * + * Available remote requests, pi data and frames will be packed into a rtp packet. If no + * frame is pushed before call to this api, NO_DATA_FRAME will be generated + * Takes care of updates to the RTP Header + * + */ +ivas_error IVAS_RTP_PACK_GetPacket( + IVAS_RTP_PACK_HANDLE hIvasPack, /* i/o : IVAS rtp packer handle */ + IVAS_DATA_BUFFER *packet, /* o : encapsulated rtp packet */ + uint32_t *numFramesInPacket /* o : no. of frames in packet */ +); + +/**********************************************/ +/* IVAS RTP UNPACKER API */ +/**********************************************/ + +/* Forward declaration of rtp unpack handle types */ +typedef struct IVAS_RTP_UNPACK *IVAS_RTP_UNPACK_HANDLE; /* rtp unpacker handle type */ + +/* Initial configuration for rtp unpacker + * - maxFramesPerPacket is used to define maximum supported frames per rtp packet + * to allow for internal memory allocaton, if zero, will use IVAS_MAX_FRAMES_PER_RTP_PACKET + */ + +typedef struct +{ + uint32_t maxFramesPerPacket; /* maximum no of frame per packet expected during the session */ +#ifdef RTP_S4_251135_CR26253_0016_REV1 + uint32_t srCodecFrameSizeMs; /* split rendering transport codec frame size in ms (5/10/20) set by sdp negotiation */ +#endif +} IVAS_RTP_UNPACK_CONFIG; + +/* Open an instance of the RTP unpacker and return a handle to rtp unpacker on success + * error code is retured on failure and handle is set to NULL + */ +ivas_error IVAS_RTP_UNPACK_Open( + IVAS_RTP_UNPACK_HANDLE *phIvasUnpack, /* i/o : rtp unpacker handle */ + const IVAS_RTP_UNPACK_CONFIG *config /* i : initial configuration for rtp unpacker */ +); + +/* Close and free an existing instance of rtp unpacker */ +void IVAS_RTP_UNPACK_Close( + IVAS_RTP_UNPACK_HANDLE *phIvasUnpack /* i/o : IVAS rtp unpacker handle */ +); + +/* Push a received rtp Ivas Payload to unpacker to extract number of frames, pi data and + * any remote request present in the payload. Caller must extract RTP header and header + * extension and feed Ivas Payload alongwith RTP Timestamp and sequence number. + * + * In case of DTX transmission modes, the number of frames in packet will be reduced by + * the number of NO_DATA frame received. All PullFrame calls for non NO_DATA frames shall + * be reported with timestamp jump indicating missing/NO_DATA IVAS frames. + * + * It is important to ensure IVAS_RTP_UNPACK_PushPayload, IVAS_RTP_UNPACK_PullFrame and + * IVAS_RTP_UNPACK_PullNextPiData API are invoked in same thread context or in a thread + * safe manner else a race condition can arise if new packet is pushed while frames/pidata + * are still being pulled out. The IVAS_RTP_UNPACK_PushPayload will gererate an error if + * new paylod is pushed before all frames/pidata are pulled out. + * + * Example usage : - + * ================== + * err = IVAS_RTP_UNPACK_PushPayload(hIvasUnpack, payload, rtpTs, seqNum, + * &nFrames, &nPiData, &reqBitmap); + * if (err != IVAS_ERR_OK) { return err; } + * + * // Read the frames in payload and feed to decoder + * while (nFrames-- > 0) { + * err = IVAS_RTP_UNPACK_PullFrame(hIvasUnpack, &recCodecId, &srInfo, &frame, &frameTs, &seqNum, &SpeechLostIndicated); + * if (err != IVAS_ERR_OK) { return err; } + * err = IVAS_DEC_VoIP_FeedFrame(hIvasDec, frame.buffer, frame.length, seqNum, frameTs, rcvTime, isGoodFrame); + * if (err != IVAS_ERR_OK) { return err; } + * } + * + * // Read PI Data + * while (nPiData-- > 0) { + * err = IVAS_RTP_UNPACK_PullNextPiData(hIvasUnpack, &piData, &piTs); + * if (err != IVAS_ERR_OK) { return err; } + * // handle pi data based on fwd/rev pi data types + * handlePIData(&piData, piTs) + * } + * + * // Read remote requests + * for (req = 0; req < IVAS_REQUEST_MAX; req++) { + * if (reqBitmap & (1u << req)) { + * err = IVAS_RTP_UNPACK_GetRequest(hIvasUnpack, req, &value); + * if (err != IVAS_ERR_OK) { return err; } + * switch(req) { + * case IVAS_REQUEST_CODEC : handleCodec(value.codec); break; + * case IVAS_REQUEST_BITRATE : handleBitrate(value.bitrate); break; + * case IVAS_REQUEST_BANDWIDTH : handleBandwidth(value.bandwidth); break; + * case IVAS_REQUEST_FORMAT : handleFormat(value.formatType); break; + * case IVAS_REQUEST_SUBFORMAT : handleSubFormat(value.subFormatType); break; + * case IVAS_REQUEST_CA_MODE : handleCAModevalue.caMode); break; + * case IVAS_REQUEST_SR_CONFIG : handleSRConfig(value.srConfig); break; + * } + * } + * } + * + */ +ivas_error IVAS_RTP_UNPACK_PushPayload( + IVAS_RTP_UNPACK_HANDLE hIvasUnpack, /* i/o : IVAS rtp unpacker handle */ + const IVAS_DATA_BUFFER *payload, /* i : received rtp payload */ + uint32_t timestamp, /* i : timestamp in RTP Clock @ 16KHz from rtp header */ + uint16_t sequenceNumber, /* i : sequence number from rtp header */ + uint32_t *numFramesInPacket, /* o : number of IVAS/EVS frames in rtp packet */ + uint32_t *numPiDataInPacket, /* o : number of PI data received in rtp packet */ + uint32_t *remoteRequestBitmap /* o : bitmap of available request in this packet */ +); + +/* Push a received rtp Ivas Packet to unpacker to extract number of frames, pi data and + * any remote request present in the Packet. + * + * In case of DTX transmission modes, the number of frames in packet will be reduced by + * the number of NO_DATA frame received. All PullFrame calls for non NO_DATA frames shall + * be reported with timestamp jump indicating missing/NO_DATA IVAS frames. + * + * It is important to ensure IVAS_RTP_UNPACK_PushPacket, IVAS_RTP_UNPACK_PullFrame and + * IVAS_RTP_UNPACK_PullNextPiData API are invoked in same thread context or in a thread + * safe manner else a race condition can arise if new packet is pushed while frames/pidata + * are still being pulled out. The IVAS_RTP_UNPACK_PushPacket will gererate an error if + * new packet is pushed before all frames/pidata are pulled out. + * + * Example usage : - + * ================== + * err = IVAS_RTP_UNPACK_PushPacket(hIvasUnpack, packet, &nFrames, &nPiData, &reqBitmap); + * if (err != IVAS_ERR_OK) { return err; } + * + * // Read the frames in packet and feed to decoder + * while (nFrames-- > 0) { + * err = IVAS_RTP_UNPACK_PullFrame(hIvasUnpack, &recCodecId, &srInfo, &frame, &frameTs, &seqNum, &SpeechLostIndicated); + * if (err != IVAS_ERR_OK) { return err; } + * err = IVAS_DEC_VoIP_FeedFrame(hIvasDec, frame.buffer, frame.length, seqNum, frameTs, rcvTime, isGoodFrame); + * if (err != IVAS_ERR_OK) { return err; } + * } + * + * // Read PI Data + * while (nPiData-- > 0) { + * err = IVAS_RTP_UNPACK_PullNextPiData(hIvasUnpack, &piData, &piTs); + * if (err != IVAS_ERR_OK) { return err; } + * // handle pi data based on fwd/rev pi data types + * handlePIData(&piData, piTs) + * } + * + * // Read remote requests + * for (req = 0; req < IVAS_REQUEST_MAX; req++) { + * if (reqBitmap & (1u << req)) { + * err = IVAS_RTP_UNPACK_GetRequest(hIvasUnpack, req, &value); + * if (err != IVAS_ERR_OK) { return err; } + * switch(req) { + * case IVAS_REQUEST_CODEC : handleCodec(value.codec); break; + * case IVAS_REQUEST_BITRATE : handleBitrate(value.bitrate); break; + * case IVAS_REQUEST_BANDWIDTH : handleBandwidth(value.bandwidth); break; + * case IVAS_REQUEST_FORMAT : handleFormat(value.formatType); break; + * case IVAS_REQUEST_SUBFORMAT : handleSubFormat(value.subFormatType); break; + * case IVAS_REQUEST_CA_MODE : handleCAModevalue.caMode); break; + * case IVAS_REQUEST_SR_CONFIG : handleSRConfig(value.srConfig); break; + * } + * } + * } + */ +ivas_error IVAS_RTP_UNPACK_PushPacket( + IVAS_RTP_UNPACK_HANDLE hIvasUnpack, /* i/o : IVAS rtp unpacker handle */ + const IVAS_DATA_BUFFER *packet, /* i : received rtp Packet */ + uint32_t *numFramesInPacket, /* o : number of IVAS/EVS frames in rtp packet */ + uint32_t *numPiDataInPacket, /* o : number of PI data received in rtp packet */ + uint32_t *remoteRequestBitmap /* o : bitmap of available request in this packet */ +); + +/* Fetch requests from sender using a key value pair api + * each key must be provided with a corresponding value storage type + * + * On call to IVAS_RTP_UNPACK_PushPayload(), remoteRequestBitmap can be used + * an indicator of new request available this frame + * + */ +ivas_error IVAS_RTP_UNPACK_GetRequest( + IVAS_RTP_UNPACK_HANDLE hIvasUnpack, /* i/o : IVAS rtp packer handle */ + IVAS_RTP_REQUEST_TYPE type, /* i : remote request type */ + IVAS_RTP_REQUEST_VALUE *value /* o : pointer of the requested type */ +); + +/* Extract a single IVAS/EVS frame from provided rtp payload alongwith rtp timestamp + * and sequence number + * + * If multiple frames per RTP packet are available, multiple calls to IVAS_RTP_UNPACK_PullFrame + * are needed. + */ +ivas_error IVAS_RTP_UNPACK_PullFrame( + IVAS_RTP_UNPACK_HANDLE hIvasUnpack, /* i/o : IVAS rtp unpacker handle */ + IVAS_RTP_CODEC *receivedCodecId, /* o : Codec type (IVAS/EVS) */ +#ifdef RTP_S4_251135_CR26253_0016_REV1 + IVAS_RTP_SR_INFO *srInfo, /* o : Split Rendering Info */ +#endif /* RTP_S4_251135_CR26253_0016_REV1 */ + IVAS_DATA_BUFFER *frameBuffer, /* o : packed frame bitstream for IVAS/EVS */ + int16_t *frameSizeInBits, /* o : exact frame size in bits (AMRWB IO) */ + uint32_t *timestamp, /* o : timestamp in RTP Clock @ 16KHz */ + uint16_t *sequenceNumber, /* o : sequence number from rtp header */ + bool *speechLostIndicated, /* o : Is current frame indicated as Lost */ + bool *isAMRWB_IOmode /* o : Is AMRWB_IO mode EVS frame */ +); + +/* Pull a single PI data from rtp unpacker instance for current packet + * Each Pi data is accompanied with a corresponding timestamp + */ +ivas_error IVAS_RTP_UNPACK_PullNextPiData( + IVAS_RTP_UNPACK_HANDLE hIvasUnpack, /* i/o : IVAS rtp unpacker handle */ + IVAS_PIDATA_GENERIC *data, /* o : output data buffer for the Pi data */ + size_t capacity, /* i : capacity of pi data buffer in bytes */ + uint32_t *timestamp /* o : timestamp in RTP Clock @ 16KHz */ +); + +#endif /* IVAS_RTP_API_H */ diff --git a/lib_util/ivas_rtp_file.c b/lib_util/ivas_rtp_file.c new file mode 100644 index 0000000000000000000000000000000000000000..f7d6d5d86717a7caf5f416ae15513390a8a978de --- /dev/null +++ b/lib_util/ivas_rtp_file.c @@ -0,0 +1,936 @@ +/****************************************************************************************************** + + (C) 2022-2025 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB, + Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., + Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, + Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other + contributors to this repository. All Rights Reserved. + + This software is protected by copyright law and by international treaties. + The IVAS codec Public Collaboration consisting of Dolby International AB, Ericsson AB, + Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., + Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, + Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other + contributors to this repository retain full ownership rights in their respective contributions in + the software. This notice grants no license of any kind, including but not limited to patent + license, nor is any license granted by implication, estoppel or otherwise. + + Contributors are required to enter into the IVAS codec Public Collaboration agreement before making + contributions. + + This software is provided "AS IS", without any express or implied warranties. The software is in the + development stage. It is intended exclusively for experts who have experience with such software and + solely for the purpose of inspection. All implied warranties of non-infringement, merchantability + and fitness for a particular purpose are hereby disclaimed and excluded. + + Any dispute, controversy or claim arising under or in relation to providing this software shall be + submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in + accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and + the United Nations Convention on Contracts on the International Sales of Goods. + +*******************************************************************************************************/ +#include +#include +#include "ivas_rtp_file.h" +#include "ivas_error_utils.h" + +struct IVAS_RTP_FILE +{ + bool isFileWriter; + FILE *f_rtpstream; +}; + +static ivas_error IvasRtpFile_Open( + const char *filePath, /* i : path to CA config file */ + bool isFileWriter, /* i : instance is a file writer else reader */ + IVAS_RTP_FILE_HANDLE *phRtpFile /* o : pointer to an IVAS file reader handle */ +) +{ + const char *mode = isFileWriter ? "wb" : "rb"; + FILE *f_rtpstream = fopen( filePath, mode ); + if ( f_rtpstream == NULL ) + { + return IVAS_ERROR( IVAS_ERR_FAILED_FILE_OPEN, "could not open: %s\n", filePath ); + } + + *phRtpFile = calloc( 1, sizeof( struct IVAS_RTP_FILE ) ); + if ( *phRtpFile != NULL ) + { + ( *phRtpFile )->isFileWriter = isFileWriter; + ( *phRtpFile )->f_rtpstream = f_rtpstream; + } + + return IVAS_ERR_OK; +} + +static ivas_error IvasRtpFile_Close( + IVAS_RTP_FILE_HANDLE *phReader /* i : pointer to an IVAS file reader handle */ +) +{ + if ( phReader != NULL && *phReader != NULL ) + { + if ( ( *phReader )->f_rtpstream != NULL ) + { + fclose( ( *phReader )->f_rtpstream ); + ( *phReader )->f_rtpstream = NULL; + } + free( *phReader ); + *phReader = NULL; + } + + return IVAS_ERR_OK; +} + +static ivas_error IvasRtpFile_Write( + IVAS_RTP_FILE_HANDLE hRtpFile, /* i : pointer to an IVAS file writer handle */ + const uint8_t *packet, /* i : rtp packet to be written to rtpdump file */ + size_t numBytes ) /* i : size in bytes of the rtp packet */ +{ + ivas_error error = IVAS_ERR_OK; + if ( hRtpFile->isFileWriter ) + { + uint32_t length = (uint32_t) numBytes; /* Max packet length is < 32 bits*/ + fwrite( &length, sizeof( uint32_t ), 1, hRtpFile->f_rtpstream ); + fwrite( packet, sizeof( uint8_t ), numBytes, hRtpFile->f_rtpstream ); + } + else + { + error = IVAS_ERR_WRONG_PARAMS; + } + return error; +} + +static ivas_error IvasRtpFile_Read( + IVAS_RTP_FILE_HANDLE hRtpFile, /* i : pointer to an IVAS file reader handle */ + uint8_t *packet, /* o : read rtp packet */ + size_t *numBytes, /* o : no of bytes in packet */ + size_t capacity /* i : max capacity of the packet buffer */ +) +{ + size_t nread = 0; + uint32_t length = 0; + if ( hRtpFile->isFileWriter ) + { + return IVAS_ERROR( IVAS_ERR_WRONG_PARAMS, "File open for writing cannot be read" ); + } + + nread = fread( &length, sizeof( uint32_t ), 1, hRtpFile->f_rtpstream ); /* Read Packet Length */ + if ( nread == 0 ) + { + return IVAS_ERR_END_OF_FILE; + } + + *numBytes = length; + if ( ( *numBytes ) > capacity ) + { + fprintf( stderr, "RTP packet > buffer capacity %lu bytes\n", capacity ); + return IVAS_ERR_INVALID_OUTPUT_BUFFER_SIZE; + } + + nread = fread( packet, sizeof( uint8_t ), ( *numBytes ), hRtpFile->f_rtpstream ); /* Read Packet */ + if ( nread < ( *numBytes ) ) + { + return IVAS_ERR_END_OF_FILE; + } + + return IVAS_ERR_OK; +} + +static const char *const PiDataNames[IVAS_PI_MAX_ID] = { + "SCENE_ORIENTATION", "DEVICE_ORIENTATION_COMPENSATED", "DEVICE_ORIENTATION_UNCOMPENSATED", + "ACOUSTIC_ENVIRONMENT", "AUDIO_DESCRIPTION", "ISM_NUM", "ISM_ID", "ISM_GAIN", "ISM_ORIENTATION", + "ISM_POSITION", "ISM_DISTANCE_ATTENUATION", "ISM_DIRECTIVITY", "DIEGETIC_TYPE", "DYNAMIC_AUDIO_SUPPRESSION_INDICATION", + "AUDIO_FOCUS_INDICATION", "RESERVED15", "PLAYBACK_DEVICE_ORIENTATION", "HEAD_ORIENTATION", "LISTENER_POSITION", + "DYNAMIC_AUDIO_SUPPRESSION_REQUEST", "AUDIO_FOCUS_REQUEST", "PI_LATENCY", "R_ISM_ID", "R_ISM_GAIN", + "R_ISM_ORIENTATION", "R_ISM_POSITION", "R_ISM_DIRECTION", "RESERVED27", "RESERVED28", "RESERVED29", + "RESERVED30", "NO_DATA" +}; + +void IVAS_RTP_LogPiData( + FILE *f_piDataOut, /* i/o : Output json file handle to dump PI data for debug/test */ + const PIDATA_TS *piData, /* i : PI Data + Timestamp array containing all PI data in current packet */ + uint32_t nPiDataPresent /* i : Number of valid elements in the piData array */ +) +{ + uint32_t timestamp = ~0u; + if ( f_piDataOut == NULL || piData == NULL || nPiDataPresent == 0 ) + { + return; + } + + if ( ftell( f_piDataOut ) > 2 ) + { + fprintf( f_piDataOut, ",\n" ); + } + + while ( nPiDataPresent-- > 0 ) + { + const PIDATA_TS *cur = piData++; + + if ( timestamp != ( ~0u ) && timestamp != cur->timestamp ) + { + fprintf( f_piDataOut, "\n\t},\n\t\"%d\": {\n", cur->timestamp ); + } + else if ( timestamp != cur->timestamp ) + { + fprintf( f_piDataOut, "\t\"%d\": {\n", cur->timestamp ); + } + else + { + fprintf( f_piDataOut, ",\n" ); + } + fprintf( f_piDataOut, "\t\t\"%s\" : ", PiDataNames[cur->data.noPiData.piDataType] ); + switch ( cur->data.noPiData.piDataType ) + { + case IVAS_PI_SCENE_ORIENTATION: + case IVAS_PI_DEVICE_ORIENTATION_COMPENSATED: + case IVAS_PI_DEVICE_ORIENTATION_UNCOMPENSATED: +#ifdef RTP_S4_251135_CR26253_0016_REV1 + case IVAS_PI_PLAYBACK_DEVICE_ORIENTATION: + case IVAS_PI_HEAD_ORIENTATION: + case IVAS_PI_R_ISM_ORIENTATION: +#endif + { + fprintf( f_piDataOut, "{\n\t\t\t\"w\": %f,\n\t\t\t\"x\": %f,\n\t\t\t\"y\": %f,\n\t\t\t\"z\": %f \n\t\t}", + cur->data.scene.orientation.w, cur->data.scene.orientation.x, cur->data.scene.orientation.y, cur->data.scene.orientation.z ); + } + break; + + case IVAS_PI_ACOUSTIC_ENVIRONMENT: + { + fprintf( f_piDataOut, "{\n\t\t\t\"aeid\": %d", cur->data.acousticEnv.aeid ); + if ( cur->data.acousticEnv.availLateReverb ) + { + fprintf( f_piDataOut, ",\n\t\t\t\"rt60\": [ %f, %f, %f ],\n", cur->data.acousticEnv.rt60[0], cur->data.acousticEnv.rt60[1], cur->data.acousticEnv.rt60[2] ); + fprintf( f_piDataOut, "\t\t\t\"dsr\": [ %f, %f, %f ]", cur->data.acousticEnv.dsr[0], cur->data.acousticEnv.dsr[1], cur->data.acousticEnv.dsr[2] ); + } + if ( cur->data.acousticEnv.availEarlyReflections ) + { + fprintf( f_piDataOut, ",\n\t\t\t\"dim\": [ %f, %f, %f ],\n", cur->data.acousticEnv.roomDimensions.x, cur->data.acousticEnv.roomDimensions.y, cur->data.acousticEnv.roomDimensions.z ); + fprintf( f_piDataOut, "\t\t\t\"abscoeff\": [ %f, %f, %f, %f, %f, %f ]", cur->data.acousticEnv.absorbCoeffs[0], cur->data.acousticEnv.absorbCoeffs[1], cur->data.acousticEnv.absorbCoeffs[2], cur->data.acousticEnv.absorbCoeffs[3], cur->data.acousticEnv.absorbCoeffs[4], cur->data.acousticEnv.absorbCoeffs[5] ); + } + fprintf( f_piDataOut, "\n\t\t}" ); + } + break; +#ifdef RTP_S4_251135_CR26253_0016_REV1 + case IVAS_PI_LISTENER_POSITION: + case IVAS_PI_R_ISM_POSITION: + { + fprintf( f_piDataOut, "{\n\t\t\t\"x\": %f,\n\t\t\t\"y\": %f,\n\t\t\t\"z\": %f \n\t\t}", + cur->data.listnerPosition.position.x, cur->data.listnerPosition.position.y, cur->data.listnerPosition.position.z ); + } + break; + case IVAS_PI_AUDIO_DESCRIPTION: + { + uint32_t nEntries = cur->data.audioDesc.nValidEntries; + const IVAS_AUDIO_ID *audioId = cur->data.audioDesc.audioId; + + fprintf( f_piDataOut, "[\n" ); + while ( nEntries-- > 0 ) + { + fprintf( f_piDataOut, "\t\t\t{\n" ); + fprintf( f_piDataOut, "\t\t\t\t\"isSpeech\": %s,\n", audioId->speech ? "true" : "false" ); + fprintf( f_piDataOut, "\t\t\t\t\"isMusic\": %s,\n", audioId->music ? "true" : "false" ); + fprintf( f_piDataOut, "\t\t\t\t\"isAmbiance\": %s,\n", audioId->ambiance ? "true" : "false" ); + fprintf( f_piDataOut, "\t\t\t\t\"isEditable\": %s,\n", audioId->editable ? "true" : "false" ); + fprintf( f_piDataOut, "\t\t\t\t\"isBinaural\": %s\n", audioId->binaural ? "true" : "false" ); + fprintf( f_piDataOut, "\t\t\t}%c\n", ( nEntries == 0 ) ? ' ' : ',' ); + audioId++; + } + fprintf( f_piDataOut, "\t\t]" ); + } + break; + case IVAS_PI_DIEGETIC_TYPE: + { + const bool *isDiegetic = cur->data.digeticIndicator.isDiegetic; + fprintf( f_piDataOut, "{\n" ); + fprintf( f_piDataOut, "\t\t\t\"isDigetic\": [\n" ); + fprintf( f_piDataOut, "\t\t\t\t%s,\n", isDiegetic[0] ? "true" : "false" ); + fprintf( f_piDataOut, "\t\t\t\t%s,\n", isDiegetic[1] ? "true" : "false" ); + fprintf( f_piDataOut, "\t\t\t\t%s,\n", isDiegetic[2] ? "true" : "false" ); + fprintf( f_piDataOut, "\t\t\t\t%s,\n", isDiegetic[3] ? "true" : "false" ); + fprintf( f_piDataOut, "\t\t\t\t%s\n", isDiegetic[4] ? "true" : "false" ); + fprintf( f_piDataOut, "\t\t\t]\n\t\t}" ); + } + break; + case IVAS_PI_AUDIO_FOCUS_INDICATION: + { + fprintf( f_piDataOut, "{" ); + if ( cur->data.focusIndication.availDirection ) + { + fprintf( f_piDataOut, "\n\t\t\t\"direction\": {\n" ); + fprintf( f_piDataOut, "\t\t\t\t\t\t\"w\": %f,\n\t\t\t\t\t\t\"x\": %f,\n\t\t\t\t\t\t\"y\": %f,\n\t\t\t\t\t\t\"z\": %f \n\t\t\t}", + cur->data.focusIndication.direction.w, cur->data.focusIndication.direction.x, cur->data.focusIndication.direction.y, cur->data.focusIndication.direction.z ); + if ( cur->data.focusIndication.availLevel ) + { + fprintf( f_piDataOut, "," ); + } + } + if ( cur->data.focusIndication.availLevel ) + { + fprintf( f_piDataOut, "\n\t\t\t\"level\": %d", cur->data.focusIndication.flvl ); + } + fprintf( f_piDataOut, "\n\t\t}" ); + } + break; + case IVAS_PI_DYNAMIC_AUDIO_SUPPRESSION_REQUEST: + { + const IVAS_PIDATA_DYNAMIC_SUPPRESSION *das = &cur->data.dynSuppressionRequest; + fprintf( f_piDataOut, "{\n" ); + fprintf( f_piDataOut, "\t\t\t\"preferSpeech\": %s,\n", das->speech ? "true" : "false" ); + fprintf( f_piDataOut, "\t\t\t\"preferMusic\": %s,\n", das->music ? "true" : "false" ); + fprintf( f_piDataOut, "\t\t\t\"preferAmbiance\": %s,\n", das->ambiance ? "true" : "false" ); + fprintf( f_piDataOut, "\t\t\t\"level\": %d", das->sli ); + fprintf( f_piDataOut, "\n\t\t}" ); + } + break; + case IVAS_PI_DYNAMIC_AUDIO_SUPPRESSION_INDICATION: + { + const IVAS_PIDATA_DYNAMIC_SUPPRESSION *das = &cur->data.dynSuppressionIndication; + fprintf( f_piDataOut, "{\n" ); + fprintf( f_piDataOut, "\t\t\t\"preferSpeech\": %s,\n", das->speech ? "true" : "false" ); + fprintf( f_piDataOut, "\t\t\t\"preferMusic\": %s,\n", das->music ? "true" : "false" ); + fprintf( f_piDataOut, "\t\t\t\"preferAmbiance\": %s,\n", das->ambiance ? "true" : "false" ); + fprintf( f_piDataOut, "\t\t\t\"level\": %d", das->sli ); + fprintf( f_piDataOut, "\n\t\t}" ); + } + break; + case IVAS_PI_AUDIO_FOCUS_REQUEST: + { + fprintf( f_piDataOut, "{" ); + if ( cur->data.focusRequest.availDirection ) + { + fprintf( f_piDataOut, "\n\t\t\t\"direction\": {\n" ); + fprintf( f_piDataOut, "\t\t\t\t\t\t\"w\": %f,\n\t\t\t\t\t\t\"x\": %f,\n\t\t\t\t\t\t\"y\": %f,\n\t\t\t\t\t\t\"z\": %f \n\t\t\t}", + cur->data.focusRequest.direction.w, cur->data.focusRequest.direction.x, cur->data.focusRequest.direction.y, cur->data.focusRequest.direction.z ); + if ( cur->data.focusRequest.availLevel ) + { + fprintf( f_piDataOut, "," ); + } + } + if ( cur->data.focusRequest.availLevel ) + { + fprintf( f_piDataOut, "\n\t\t\t\"level\": %d", cur->data.focusRequest.flvl ); + } + fprintf( f_piDataOut, "\n\t\t}" ); + } + break; + case IVAS_PI_RESERVED15: + case IVAS_PI_RESERVED27: + case IVAS_PI_RESERVED28: + case IVAS_PI_RESERVED29: + case IVAS_PI_RESERVED30: + { + fprintf( f_piDataOut, "{}" ); + } + break; + case IVAS_PI_ISM_NUM: + case IVAS_PI_ISM_ID: + case IVAS_PI_ISM_GAIN: + case IVAS_PI_ISM_ORIENTATION: + case IVAS_PI_ISM_POSITION: + case IVAS_PI_ISM_DISTANCE_ATTENUATION: + case IVAS_PI_ISM_DIRECTIVITY: + case IVAS_PI_PI_LATENCY: + case IVAS_PI_R_ISM_ID: + case IVAS_PI_R_ISM_GAIN: + case IVAS_PI_R_ISM_DIRECTION: +#endif /* RTP_S4_251135_CR26253_0016_REV1 */ + case IVAS_PI_NO_DATA: + { + fprintf( f_piDataOut, "{}" ); + } + break; + } + timestamp = cur->timestamp; + } + fprintf( f_piDataOut, "\n\t}" ); +} + +void IVAS_RTP_WriteExtPiData( + FILE *f_piDataOut, /* i/o : Output csv file handle to dump PI data for external output */ + const PIDATA_TS *piData, /* i : PI Data + Timestamp array containing all PI data in current packet */ + uint32_t nPiDataPresent, /* i : Number of valid elements in the piData array */ + uint16_t numObj /* i : Number of objects */ +) +{ + if ( f_piDataOut == NULL || piData == NULL || nPiDataPresent == 0 ) + { + return; + } + + int i = 0; + + while ( nPiDataPresent-- > 0 ) + { + const PIDATA_TS *cur = piData++; + + /* The writing follows the pattern of: timestamp, PI DATA TYPE, PI DATA */ + + fprintf( f_piDataOut, "%d,%s,", cur->timestamp, PiDataNames[cur->data.noPiData.piDataType] ); + switch ( cur->data.noPiData.piDataType ) + { + case IVAS_PI_SCENE_ORIENTATION: + { + fprintf( f_piDataOut, "%f,%f,%f,%f", cur->data.scene.orientation.w, cur->data.scene.orientation.x, cur->data.scene.orientation.y, cur->data.scene.orientation.z ); + } + break; + case IVAS_PI_DEVICE_ORIENTATION_COMPENSATED: + { + fprintf( f_piDataOut, "%f,%f,%f,%f", cur->data.deviceCompensated.orientation.w, cur->data.deviceCompensated.orientation.x, cur->data.deviceCompensated.orientation.y, cur->data.deviceCompensated.orientation.z ); + } + break; + case IVAS_PI_DEVICE_ORIENTATION_UNCOMPENSATED: + { + fprintf( f_piDataOut, "%f,%f,%f,%f", cur->data.deviceUnCompensated.orientation.w, cur->data.deviceUnCompensated.orientation.x, cur->data.deviceUnCompensated.orientation.y, cur->data.deviceUnCompensated.orientation.z ); + } + break; + case IVAS_PI_ACOUSTIC_ENVIRONMENT: + { + fprintf( f_piDataOut, "%d", cur->data.acousticEnv.aeid ); + if ( cur->data.acousticEnv.availLateReverb ) + { + fprintf( f_piDataOut, ",%f,%f,%f", cur->data.acousticEnv.rt60[0], cur->data.acousticEnv.rt60[1], cur->data.acousticEnv.rt60[2] ); + fprintf( f_piDataOut, ",%f,%f,%f", cur->data.acousticEnv.dsr[0], cur->data.acousticEnv.dsr[1], cur->data.acousticEnv.dsr[2] ); + } + if ( cur->data.acousticEnv.availEarlyReflections ) + { + fprintf( f_piDataOut, ",%f,%f,%f", cur->data.acousticEnv.roomDimensions.x, cur->data.acousticEnv.roomDimensions.y, cur->data.acousticEnv.roomDimensions.z ); + fprintf( f_piDataOut, ",%f,%f,%f,%f,%f,%f", cur->data.acousticEnv.absorbCoeffs[0], cur->data.acousticEnv.absorbCoeffs[1], cur->data.acousticEnv.absorbCoeffs[2], cur->data.acousticEnv.absorbCoeffs[3], cur->data.acousticEnv.absorbCoeffs[4], cur->data.acousticEnv.absorbCoeffs[5] ); + } + } + break; +#ifdef RTP_S4_251135_CR26253_0016_REV1 + case IVAS_PI_AUDIO_DESCRIPTION: + { + uint32_t nEntries = cur->data.audioDesc.nValidEntries; + const IVAS_AUDIO_ID *audioId = cur->data.audioDesc.audioId; + + while ( nEntries-- > 0 ) + { + fprintf( f_piDataOut, "%d,%d,%d,%d,%d", audioId->speech, audioId->music, audioId->ambiance, audioId->editable, audioId->binaural ); + audioId++; + } + } + break; + case IVAS_PI_ISM_NUM: + { + fprintf( f_piDataOut, "%d", cur->data.ismNum.numObjects ); + } + break; + case IVAS_PI_ISM_ID: + { + for ( i = 0; i < numObj; ++i ) + { + if ( i != 0 ) + { + fprintf( f_piDataOut, "," ); + } + fprintf( f_piDataOut, "%d", cur->data.ismId.id[i] ); + } + } + break; + case IVAS_PI_ISM_GAIN: + { + for ( i = 0; i < numObj; ++i ) + { + if ( i != 0 ) + { + fprintf( f_piDataOut, "," ); + } + fprintf( f_piDataOut, "%d", cur->data.ismGain.dB[i] ); + } + } + break; + case IVAS_PI_ISM_ORIENTATION: + { + for ( i = 0; i < numObj; ++i ) + { + if ( i != 0 ) + { + fprintf( f_piDataOut, "," ); + } + fprintf( f_piDataOut, "%f,%f,%f,%f", cur->data.ismOrientation.orientation[i].w, cur->data.ismOrientation.orientation[i].x, cur->data.ismOrientation.orientation[i].y, cur->data.ismOrientation.orientation[i].z ); + } + } + break; + case IVAS_PI_ISM_POSITION: + { + for ( i = 0; i < numObj; ++i ) + { + if ( i != 0 ) + { + fprintf( f_piDataOut, "," ); + } + fprintf( f_piDataOut, "%f,%f,%f", cur->data.ismPosition.position[i].x, cur->data.ismPosition.position[i].y, cur->data.ismPosition.position[i].z ); + } + } + break; + case IVAS_PI_ISM_DISTANCE_ATTENUATION: + { + for ( i = 0; i < numObj; ++i ) + { + if ( i != 0 ) + { + fprintf( f_piDataOut, "," ); + } + fprintf( f_piDataOut, "%f,%f,%f", cur->data.ismAttenuation.distAtten[i].ref_dist, cur->data.ismAttenuation.distAtten[i].max_dist, cur->data.ismAttenuation.distAtten[i].roll ); + } + } + break; + case IVAS_PI_ISM_DIRECTIVITY: + { + for ( i = 0; i < numObj; ++i ) + { + if ( i != 0 ) + { + fprintf( f_piDataOut, "," ); + } + fprintf( f_piDataOut, "%d,%d,%f", cur->data.ismDirectivity.directivity[i].innerConeAngle, cur->data.ismDirectivity.directivity[i].outerConeAngle, cur->data.ismDirectivity.directivity[i].outerAttenuationdB ); + } + } + break; + case IVAS_PI_DIEGETIC_TYPE: + { + const bool *isDiegetic = cur->data.digeticIndicator.isDiegetic; + fprintf( f_piDataOut, "%d,%d,%d,%d,%d", isDiegetic[0], isDiegetic[1], isDiegetic[2], isDiegetic[3], isDiegetic[4] ); + } + break; + case IVAS_PI_DYNAMIC_AUDIO_SUPPRESSION_INDICATION: + { + const IVAS_PIDATA_DYNAMIC_SUPPRESSION *das = &cur->data.dynSuppressionIndication; + fprintf( f_piDataOut, "%d,%d,%d,%d", das->speech, das->music, das->ambiance, das->sli ); + } + break; + case IVAS_PI_AUDIO_FOCUS_INDICATION: + { + if ( cur->data.focusIndication.availDirection ) + { + fprintf( f_piDataOut, "%f,%f,%f,%f", cur->data.focusIndication.direction.w, cur->data.focusIndication.direction.x, cur->data.focusIndication.direction.y, cur->data.focusIndication.direction.z ); + if ( cur->data.focusIndication.availLevel ) + { + fprintf( f_piDataOut, "," ); + } + } + if ( cur->data.focusIndication.availLevel ) + { + fprintf( f_piDataOut, "%d", cur->data.focusIndication.flvl ); + } + } + break; + case IVAS_PI_PLAYBACK_DEVICE_ORIENTATION: + { + fprintf( f_piDataOut, "%f,%f,%f,%f", cur->data.playbackOrientation.orientation.w, cur->data.playbackOrientation.orientation.x, cur->data.playbackOrientation.orientation.y, cur->data.playbackOrientation.orientation.z ); + } + break; + case IVAS_PI_HEAD_ORIENTATION: + { + fprintf( f_piDataOut, "%f,%f,%f,%f", cur->data.headOrientation.orientation.w, cur->data.headOrientation.orientation.x, cur->data.headOrientation.orientation.y, cur->data.headOrientation.orientation.z ); + } + break; + case IVAS_PI_LISTENER_POSITION: + { + fprintf( f_piDataOut, "%f,%f,%f", cur->data.listnerPosition.position.x, cur->data.listnerPosition.position.y, cur->data.listnerPosition.position.z ); + } + break; + case IVAS_PI_DYNAMIC_AUDIO_SUPPRESSION_REQUEST: + { + const IVAS_PIDATA_DYNAMIC_SUPPRESSION *das = &cur->data.dynSuppressionRequest; + fprintf( f_piDataOut, "%d,%d,%d,%d", das->speech, das->music, das->ambiance, das->sli ); + } + break; + case IVAS_PI_AUDIO_FOCUS_REQUEST: + { + + if ( cur->data.focusRequest.availDirection ) + { + fprintf( f_piDataOut, "%f,%f,%f,%f", cur->data.focusRequest.direction.w, cur->data.focusRequest.direction.x, cur->data.focusRequest.direction.y, cur->data.focusRequest.direction.z ); + if ( cur->data.focusRequest.availLevel ) + { + fprintf( f_piDataOut, "," ); + } + } + if ( cur->data.focusRequest.availLevel ) + { + fprintf( f_piDataOut, "%d", cur->data.focusRequest.flvl ); + } + } + break; + case IVAS_PI_PI_LATENCY: + { + fprintf( f_piDataOut, "%d", cur->data.piLatency.latency ); + } + break; + case IVAS_PI_R_ISM_ID: + { + fprintf( f_piDataOut, "%d", cur->data.ismEditId.id ); + } + break; + case IVAS_PI_R_ISM_GAIN: + { + fprintf( f_piDataOut, "%d", cur->data.ismEditGain.piDataType ); + } + break; + case IVAS_PI_R_ISM_ORIENTATION: + { + fprintf( f_piDataOut, "%f,%f,%f,%f", cur->data.ismEditOrientation.orientation.w, cur->data.ismEditOrientation.orientation.x, cur->data.ismEditOrientation.orientation.y, cur->data.ismEditOrientation.orientation.z ); + } + break; + case IVAS_PI_R_ISM_POSITION: + { + fprintf( f_piDataOut, "%f,%f,%f", cur->data.ismEditPosition.position.x, cur->data.ismEditPosition.position.y, cur->data.ismEditPosition.position.z ); + } + break; + case IVAS_PI_R_ISM_DIRECTION: + { + fprintf( f_piDataOut, "%f,%f", cur->data.ismEditDirection.azimuth, cur->data.ismEditDirection.elevation ); + } + break; + case IVAS_PI_RESERVED15: + case IVAS_PI_RESERVED27: + case IVAS_PI_RESERVED28: + case IVAS_PI_RESERVED29: + case IVAS_PI_RESERVED30: + break; +#endif /* RTP_S4_251135_CR26253_0016_REV1 */ + } + fprintf( f_piDataOut, "\n" ); + } +} + +const char *IVAS_RTP_GetExtPiFilePath( IVAS_RTP *rtp ) +{ + return rtp->piExtFilename; +} + +void IVAS_RTP_Term( + IVAS_RTP *rtp /* i/o : IVAS RTP File reader/writer handle */ +) +{ + if ( NULL != rtp ) + { + if ( rtp->hPack != NULL ) + { + /* Complete the last packet */ + if ( IVAS_RTP_PACK_GetNumFrames( rtp->hPack ) != 0 ) + { + ivas_error error = IVAS_ERR_OK; + uint32_t numFramesInPayload = 0; + + if ( ( error = IVAS_RTP_PACK_GetPacket( rtp->hPack, &rtp->rtpPacket, &numFramesInPayload ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nError %s while packing RTP Packet\n", ivas_error_to_string( error ) ); + } + else if ( numFramesInPayload > 0 ) + { + if ( ( error = IvasRtpFile_Write( rtp->hRtpFile, rtp->rtpPacket.buffer, rtp->rtpPacket.length ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nError %s while writing RTP packet\n", ivas_error_to_string( error ) ); + } + } + } + IVAS_RTP_PACK_Close( &rtp->hPack ); + } + + if ( rtp->hUnpack != NULL ) + { + IVAS_RTP_UNPACK_Close( &rtp->hUnpack ); + } + + if ( rtp->f_piDataOut != NULL ) + { + fprintf( rtp->f_piDataOut, "\n}\n" ); + fclose( rtp->f_piDataOut ); + rtp->f_piDataOut = NULL; + } + + if ( rtp->f_piExtOut != NULL ) + { + fclose( rtp->f_piExtOut ); + rtp->f_piExtOut = NULL; + } + + if ( rtp->hRtpFile != NULL ) + { + IvasRtpFile_Close( &rtp->hRtpFile ); + } + } +} + +ivas_error IVAS_RTP_WRITER_Init( + IVAS_RTP *rtp, /* i/o : IVAS RTP File writer handle */ + const char *outputBitstreamFilename, /* i : RTP Dump filename */ +#ifdef FIXED_RTP_SEQUENCE_NUM + uint32_t numFramesPerPacket, /* i : No. of frames per packet desired */ + uint32_t SSRC, /* i : SSRC for RTP Header */ + uint16_t seqNumInitVal /* i : Initial seq number in rtp header */ +#else + uint32_t numFramesPerPacket /* i : No. of frames per packet desired */ +#endif +) +{ +#ifndef FIXED_RTP_SEQUENCE_NUM + uint32_t SSRC = ( rand() & 0xFFFF ) | ( (uint32_t) rand() << 16 ); +#endif + ivas_error error = IVAS_ERR_OK; + + memset( rtp, 0, sizeof( IVAS_RTP ) ); + + rtp->packCfg.maxFramesPerPacket = numFramesPerPacket; + rtp->rtpPacket.buffer = rtp->packet; + rtp->rtpPacket.capacity = sizeof( rtp->packet ); + + error = IVAS_RTP_PACK_Open( &rtp->hPack, &rtp->packCfg ); + if ( error == IVAS_ERR_OK ) + { + /* Open the output file for RTPDump writing */ + error = IvasRtpFile_Open( outputBitstreamFilename, true, &rtp->hRtpFile ); + if ( error != IVAS_ERR_OK ) + { + return error; + } + +#ifdef FIXED_RTP_SEQUENCE_NUM + error = IVAS_RTP_PACK_UpdateHeader( rtp->hPack, seqNumInitVal, SSRC, 0, NULL, 0, 0, NULL ); +#else + error = IVAS_RTP_PACK_UpdateHeader( rtp->hPack, SSRC, 0, NULL, 0, 0, NULL ); +#endif + if ( error != IVAS_ERR_OK ) + { + fprintf( stderr, "error in IVAS_RTP_PACK_UpdateHeader(): %d\n", error ); + } + } + + return error; +} + +ivas_error IVAS_RTP_READER_Init( + IVAS_RTP *rtp, /* i/o : IVAS RTP File reader handle */ +#ifdef RTP_S4_251135_CR26253_0016_REV1 + uint32_t srCodecFrameSizeMs, /* i : SR Codec Framesize in ms */ +#endif + const char *inputBitstreamFilename, /* i : Input rtpdump filename */ + const char *piOutputFilename, /* i : Output PI data json filename */ + bool isExtOutput, /* i : External output mode */ + const char *outputWavFilename /* i : name of the output audio file */ +) +{ + ivas_error error = IVAS_ERR_OK; + + memset( rtp, 0, sizeof( IVAS_RTP ) ); + + rtp->unpackCfg.maxFramesPerPacket = IVAS_MAX_FRAMES_PER_RTP_PACKET; + rtp->unpackCfg.srCodecFrameSizeMs = srCodecFrameSizeMs; + rtp->rtpPacket.buffer = rtp->packet; + rtp->rtpPacket.capacity = sizeof( rtp->packet ); + + error = IVAS_RTP_UNPACK_Open( &rtp->hUnpack, &rtp->unpackCfg ); + if ( error == IVAS_ERR_OK ) + { + error = IvasRtpFile_Open( inputBitstreamFilename, false, &rtp->hRtpFile ); + if ( error != IVAS_ERR_OK ) + { + return error; + } + + if ( piOutputFilename != NULL ) + { + rtp->f_piDataOut = fopen( piOutputFilename, "w" ); + if ( rtp->f_piDataOut == NULL ) + { + fprintf( stderr, "could not open: %s\n", piOutputFilename ); + return IVAS_ERR_FAILED_FILE_OPEN; + } + fprintf( rtp->f_piDataOut, "{\n" ); + } + + if ( isExtOutput ) + { + char ext_pi[12]; + + /* sizeof( ext_pi ) accounts for terminating NULL, don't subtract extra 1 */ + const int32_t maxNameLenWithoutExt = FILENAME_MAX - (int32_t) sizeof( ext_pi ); + strncpy( rtp->piExtFilename, outputWavFilename, maxNameLenWithoutExt ); + snprintf( ext_pi, sizeof( ext_pi ), ".pidata.csv" ); + + /* strlen( metadata_filename[0] ) doesn't account for terminating NULL, subtract extra 1 */ + const int32_t maxNumCharactersToAppend = FILENAME_MAX - (int32_t) strlen( rtp->piExtFilename ) - 1; + strncat( rtp->piExtFilename, ext_pi, maxNumCharactersToAppend ); + + rtp->f_piExtOut = fopen( rtp->piExtFilename, "w" ); + if ( rtp->f_piExtOut == NULL ) + { + fprintf( stderr, "could not open: %s\n", rtp->piExtFilename ); + return IVAS_ERR_FAILED_FILE_OPEN; + } + } + } + + return error; +} + +ivas_error IVAS_RTP_WriteNextFrame( + IVAS_RTP *rtp, /* i/o : IVAS RTP File writer handle */ + uint8_t *au, /* i : IVAS Compressed AU (Packed frame) */ +#ifdef RTP_S4_251135_CR26253_0016_REV1 + const IVAS_RTP_SR_INFO *srInfo, /* i : Split rendering info in present, else NULL */ +#endif + int16_t auSizeBits, /* i : Frame size in bits */ + bool isMono, /* i : input was evs(true) or ivas(false) */ + bool forcePacket /* i : force packets with whatever frames pushed so far */ +) +{ + ivas_error error = IVAS_ERR_OK; + uint32_t nProcPiData = 0; + IVAS_DATA_BUFFER packedFrame = { 0, 0, NULL }; + + packedFrame.capacity = ( auSizeBits + 7 ) / 8; + packedFrame.length = ( auSizeBits + 7 ) / 8; + packedFrame.buffer = (uint8_t *) au; + rtp->rtpPacket.length = 0; + + /* Push Encoded Stream to */ + error = IVAS_RTP_PACK_PushFrame( rtp->hPack, + isMono ? IVAS_RTP_EVS : IVAS_RTP_IVAS, +#ifdef RTP_S4_251135_CR26253_0016_REV1 + srInfo, +#endif /* RTP_S4_251135_CR26253_0016_REV1 */ + &packedFrame ); + if ( error != IVAS_ERR_OK ) + { + return error; + } + + while ( rtp->nWrittenPiData > 0 ) + { + PIDATA_TS *piDataTs = &rtp->piData[nProcPiData++]; + if ( ( error = IVAS_RTP_PACK_PushPiData( rtp->hPack, (const IVAS_PIDATA_GENERIC *) &piDataTs->data ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nError %s while pushing scene orientation\n", ivas_error_to_string( error ) ); + return error; + } + rtp->nWrittenPiData--; + } + + if ( forcePacket || IVAS_RTP_PACK_GetNumFrames( rtp->hPack ) == rtp->packCfg.maxFramesPerPacket ) + { + uint32_t numFramesInPayload = 0; + + /* Generate RTP Packet */ + if ( ( error = IVAS_RTP_PACK_GetPacket( rtp->hPack, &rtp->rtpPacket, &numFramesInPayload ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nError %s while packing RTP Header\n", ivas_error_to_string( error ) ); + return error; + } + + if ( ( error = IvasRtpFile_Write( rtp->hRtpFile, rtp->rtpPacket.buffer, rtp->rtpPacket.length ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nError %s while writing RTP packet\n", ivas_error_to_string( error ) ); + return error; + } + } + + return error; +} + +ivas_error IVAS_RTP_ReadNextFrame( + IVAS_RTP *rtp, /* i/o : IVAS RTP File reader handle */ + uint8_t *au, /* o : Read next IVAS Compressed AU (Packed frame) */ + int16_t *auSizeBits, /* o : Reported Frame size in bits */ + uint32_t *rtpTimeStamp, /* o : RTP Timestamp for this frame */ + uint16_t *rtpSequenceNumber, /* o : RTP sequence number for this packet */ + uint32_t *nextPacketRcvTime_ms, /* i/o : Clock indicating packet receive times need in JBM */ +#ifdef RTP_S4_251135_CR26253_0016_REV1 + IVAS_RTP_SR_INFO *srInfo, /* o : Split Rendering info if SR RTP frame unpacked */ +#endif + bool *qBit /* o : AMRWB Q bite as indicated in the RTP packet */ +) +{ + ivas_error error = IVAS_ERR_OK; + IVAS_DATA_BUFFER packedFrame; + IVAS_RTP_CODEC codecId = IVAS_RTP_IVAS; + bool isAMRWB_IOmode = false; + + packedFrame.length = 0; + packedFrame.buffer = au; + packedFrame.capacity = ( IVAS_MAX_BITS_PER_FRAME / 8 ); + if ( rtp->numFramesInPacket == 0 ) + { + rtp->rtpPacket.length = 0; + if ( ( error = IvasRtpFile_Read( rtp->hRtpFile, rtp->rtpPacket.buffer, &rtp->rtpPacket.length, rtp->rtpPacket.capacity ) ) != IVAS_ERR_OK ) + { + return error; + } + + if ( ( error = IVAS_RTP_UNPACK_PushPacket( rtp->hUnpack, &rtp->rtpPacket, + &rtp->numFramesInPacket, &rtp->numPiDataInPacket, + &rtp->remoteRequestBitmap ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "failed to unpack RTP packet error = %s\n", ivas_error_to_string( error ) ); + return error; + } + + rtp->nReadPiData = 0; + rtp->nProcPiData = 0; + + /* Pre-read all PI data */ + while ( rtp->numPiDataInPacket != 0 ) + { + PIDATA_TS *piData = &rtp->piData[rtp->nReadPiData]; + if ( ( error = IVAS_RTP_UNPACK_PullNextPiData( rtp->hUnpack, (IVAS_PIDATA_GENERIC *) &piData->data, sizeof( piData->data ), &piData->timestamp ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "failed to pull PI Data, error = %s\n", ivas_error_to_string( error ) ); + return error; + } + rtp->nReadPiData++; + rtp->numPiDataInPacket--; + } + IVAS_RTP_LogPiData( rtp->f_piDataOut, rtp->piData, rtp->nReadPiData ); + } + +#ifdef RTP_S4_251135_CR26253_0016_REV1 + error = IVAS_RTP_UNPACK_PullFrame( rtp->hUnpack, &codecId, &rtp->srInfo, &packedFrame, auSizeBits, rtpTimeStamp, rtpSequenceNumber, &rtp->speechLostIndicated, &isAMRWB_IOmode ); +#else + error = IVAS_RTP_UNPACK_PullFrame( rtp->hUnpack, &codecId, &packedFrame, auSizeBits, rtpTimeStamp, rtpSequenceNumber, &rtp->speechLostIndicated, &isAMRWB_IOmode ); +#endif + if ( error != IVAS_ERR_OK ) + { + fprintf( stderr, "failed to pull frame after unpack\n" ); + return error; + } + + rtp->restartNeeded = false; + if ( *auSizeBits == 0 ) + { + /* NO_DATA_FRAME/SPEECH_LOST for IVAS and EVS is indicated by same bits + Do not restart decoder on codec/amrwb mode change in this case */ + } + else + { + rtp->restartNeeded = ( rtp->codecId != codecId ) || + ( codecId == IVAS_RTP_EVS && ( rtp->isAMRWB_IOmode != isAMRWB_IOmode ) ); + + if ( rtp->restartNeeded ) + { + fprintf( stdout, "\nRTP packet codec changed %s -> %s\n", + ( rtp->codecId == IVAS_RTP_EVS ) ? ( rtp->isAMRWB_IOmode ? "AMRWB_IO" : "EVS" ) : "IVAS", + ( codecId == IVAS_RTP_EVS ) ? ( isAMRWB_IOmode ? "AMRWB_IO" : "EVS" ) : "IVAS" ); + } + + rtp->codecId = codecId; + rtp->isAMRWB_IOmode = isAMRWB_IOmode; + } + +#ifdef RTP_S4_251135_CR26253_0016_REV1 + if ( srInfo != NULL ) + { + *srInfo = rtp->srInfo; + } +#endif + *qBit = !rtp->speechLostIndicated; + rtp->numFramesInPacket--; + rtp->numFramesProduced++; + *nextPacketRcvTime_ms += 20; + + return IVAS_ERR_OK; +} diff --git a/lib_util/ivas_rtp_file.h b/lib_util/ivas_rtp_file.h new file mode 100644 index 0000000000000000000000000000000000000000..70f8c99f0e076eaf4d4c9633513864bfbe6e763e --- /dev/null +++ b/lib_util/ivas_rtp_file.h @@ -0,0 +1,95 @@ +/****************************************************************************************************** + + (C) 2022-2025 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB, + Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., + Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, + Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other + contributors to this repository. All Rights Reserved. + + This software is protected by copyright law and by international treaties. + The IVAS codec Public Collaboration consisting of Dolby International AB, Ericsson AB, + Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., + Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, + Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other + contributors to this repository retain full ownership rights in their respective contributions in + the software. This notice grants no license of any kind, including but not limited to patent + license, nor is any license granted by implication, estoppel or otherwise. + + Contributors are required to enter into the IVAS codec Public Collaboration agreement before making + contributions. + + This software is provided "AS IS", without any express or implied warranties. The software is in the + development stage. It is intended exclusively for experts who have experience with such software and + solely for the purpose of inspection. All implied warranties of non-infringement, merchantability + and fitness for a particular purpose are hereby disclaimed and excluded. + + Any dispute, controversy or claim arising under or in relation to providing this software shall be + submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in + accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and + the United Nations Convention on Contracts on the International Sales of Goods. + +*******************************************************************************************************/ + +#ifndef IVAS_RTP_FILE_H +#define IVAS_RTP_FILE_H + +#include "common_api_types.h" +#include "ivas_rtp_api.h" +#include "ivas_rtp_pi_data.h" + +typedef struct IVAS_RTP_FILE *IVAS_RTP_FILE_HANDLE; + +typedef struct +{ + uint8_t packet[NOMINAL_BUFFER_SIZE( IVAS_MAX_FRAMES_PER_RTP_PACKET )]; + PIDATA_TS piData[IVAS_PI_MAX_ID * IVAS_MAX_FRAMES_PER_RTP_PACKET]; + + IVAS_RTP_FILE_HANDLE hRtpFile; + FILE *f_piDataOut; + FILE *f_piExtOut; + char piExtFilename[FILENAME_MAX]; + IVAS_RTP_CODEC codecId; + uint32_t nWrittenPiData; + uint32_t nReadPiData; + uint32_t nProcPiData; + uint32_t numFramesInPacket; + uint32_t numPiDataInPacket; + uint32_t remoteRequestBitmap; + bool speechLostIndicated; + bool restartNeeded; + bool isAMRWB_IOmode; + size_t numFramesProduced; + + IVAS_DATA_BUFFER rtpPacket; + IVAS_RTP_PACK_HANDLE hPack; + IVAS_RTP_UNPACK_HANDLE hUnpack; + IVAS_RTP_PACK_CONFIG packCfg; + IVAS_RTP_UNPACK_CONFIG unpackCfg; +#ifdef RTP_S4_251135_CR26253_0016_REV1 + IVAS_RTP_SR_INFO srInfo; +#endif +} IVAS_RTP; + +#ifdef FIXED_RTP_SEQUENCE_NUM +ivas_error IVAS_RTP_WRITER_Init( IVAS_RTP *rtp, const char *outputBitstreamFilename, uint32_t numFramesPerPacket, uint32_t SSRC, uint16_t seqNumInitVal ); +#else +ivas_error IVAS_RTP_WRITER_Init( IVAS_RTP *rtp, const char *outputBitstreamFilename, uint32_t numFramesPerPacket ); +#endif +#ifdef RTP_S4_251135_CR26253_0016_REV1 +ivas_error IVAS_RTP_READER_Init( IVAS_RTP *rtp, uint32_t srCodecFrameSizeMs, const char *inputBitstreamFilename, const char *piOutputFilename, bool isExtOutput, const char *outputWavFilename ); +#else +ivas_error IVAS_RTP_READER_Init( IVAS_RTP *rtp, const char *inputBitstreamFilename, const char *piOutputFilename, bool isExtOutput, const char *outputWavFilename ); +#endif +void IVAS_RTP_Term( IVAS_RTP *rtp ); +#ifdef RTP_S4_251135_CR26253_0016_REV1 +ivas_error IVAS_RTP_WriteNextFrame( IVAS_RTP *rtp, uint8_t *au, const IVAS_RTP_SR_INFO *srInfo, int16_t auSizeBits, bool isMono, bool forcePacket ); +ivas_error IVAS_RTP_ReadNextFrame( IVAS_RTP *rtp, uint8_t *au, int16_t *auSizeBits, uint32_t *rtpTimeStamp, uint16_t *rtpSequenceNumber, uint32_t *nextPacketRcvTime_ms, IVAS_RTP_SR_INFO *srInfo, bool *qBit ); +#else +ivas_error IVAS_RTP_WriteNextFrame( IVAS_RTP *rtp, uint8_t *au, int16_t auSizeBits, bool isMono, bool forcePacket ); +ivas_error IVAS_RTP_ReadNextFrame( IVAS_RTP *rtp, uint8_t *au, int16_t *auSizeBits, uint32_t *rtpTimeStamp, uint16_t *rtpSequenceNumber, uint32_t *nextPacketRcvTime_ms, bool *qBit ); +#endif +void IVAS_RTP_LogPiData( FILE *f_piDataOut, const PIDATA_TS *piData, uint32_t nPiDataPresent ); +void IVAS_RTP_WriteExtPiData( FILE *f_piDataOut, const PIDATA_TS *piData, uint32_t nPiDataPresent, uint16_t numObj ); +const char *IVAS_RTP_GetExtPiFilePath( IVAS_RTP *rtp ); + +#endif /* IVAS_RTP_FILE_H */ diff --git a/lib_util/ivas_rtp_internal.h b/lib_util/ivas_rtp_internal.h new file mode 100644 index 0000000000000000000000000000000000000000..dc3dd9c1292ced08e6e6edd6b2b0b30a8d917fe2 --- /dev/null +++ b/lib_util/ivas_rtp_internal.h @@ -0,0 +1,148 @@ +/****************************************************************************************************** + + (C) 2022-2025 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB, + Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., + Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, + Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other + contributors to this repository. All Rights Reserved. + + This software is protected by copyright law and by international treaties. + The IVAS codec Public Collaboration consisting of Dolby International AB, Ericsson AB, + Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., + Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, + Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other + contributors to this repository retain full ownership rights in their respective contributions in + the software. This notice grants no license of any kind, including but not limited to patent + license, nor is any license granted by implication, estoppel or otherwise. + + Contributors are required to enter into the IVAS codec Public Collaboration agreement before making + contributions. + + This software is provided "AS IS", without any express or implied warranties. The software is in the + development stage. It is intended exclusively for experts who have experience with such software and + solely for the purpose of inspection. All implied warranties of non-infringement, merchantability + and fitness for a particular purpose are hereby disclaimed and excluded. + + Any dispute, controversy or claim arising under or in relation to providing this software shall be + submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in + accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and + the United Nations Convention on Contracts on the International Sales of Goods. + +*******************************************************************************************************/ + +#ifndef IVAS_RTP_INTERNAL_H +#define IVAS_RTP_INTERNAL_H + +#include "ivas_rtp_api.h" +#include "ivas_rtp_pi_data.h" + +#ifdef IVAS_RTPDUMP + +enum MASK_BITS +{ + MASK_1BIT = 0x1, + MASK_2BIT = 0x3, + MASK_3BIT = 0x7, + MASK_4BIT = 0xF, + MASK_5BIT = 0x1F, + MASK_6BIT = 0x3F, + MASK_7BIT = 0x7F, + MASK_8BIT = 0xFF, + +}; + +/* tables */ +#define NBITS_AEID ( 7 ) +#define NBITS_RT60 ( 5 ) +#define NBITS_DSR ( 6 ) +#define NBITS_DIM ( 4 ) +#define NBITS_ABS ( 2 ) + +#define MASK_AEID ( ( 1u << NBITS_AEID ) - 1 ) +#define MASK_RT60 ( ( 1u << NBITS_RT60 ) - 1 ) +#define MASK_DSR ( ( 1u << NBITS_DSR ) - 1 ) +#define MASK_DIM ( ( 1u << NBITS_DIM ) - 1 ) +#define MASK_ABS ( ( 1u << NBITS_ABS ) - 1 ) + +#define MAX_PI_POSITION_METERS ( 327.68f ) +#define FLOAT_FROM_Q15( q15Val ) ( (float) ( q15Val ) / 32768.0f ) + +extern const float mapDSR[1u << NBITS_DSR]; +extern const float mapRT60[1u << NBITS_RT60]; +extern const float mapRoomDims[1u << NBITS_DIM]; +extern const float mapAbsorbtion[1u << NBITS_ABS]; + +enum IVAS_RTP_HEADER_BITS +{ + + EBYTE_TOC_HEADER_BIT = 0x80, /* Ebyte/ToC indicator H bit, 1 = EByte, 0 = ToC */ + + TOC_HEADER_FOLLOWS = 0x40, /* ToC header byte is followed by another header byte */ + TOC_INDICATE_NO_DATA_AMRWB = 0x3F, /* ToC byte indicates NO_DATA in DTX mode for AMRWB */ + TOC_INDICATE_NO_DATA = 0x0F, /* ToC header byte indicates NO_DATA in DTX mode */ + TOC_INDICATE_IVAS = 0x10, /* ToC header byte indicates IVAS data */ + TOC_INDICATE_EVS = 0x00, /* ToC header byte indicates EVS data */ + TOC_INDICATE_AMRWB = 0x30, /* ToC header byte indicates AMR-WB IO data */ + TOC_INDICATE_ARMWB_Q = 0x20, /* ToC header byte indicates AMR-WB IO lost frame */ + TOC_INDICATE_SR = 0x1E, /* Indicate Split Rendering in ToC bytes */ + + EBYTE_CMR_T_EVS_NB = 0x80, /* Initial E-byte indicating EVS NarrowBand modes */ + EBYTE_CMR_T_EVS_IO = 0x90, /* Initial E-byte indicating EVS AMRWB IO modes */ + EBYTE_CMR_T_EVS_WB = 0xA0, /* Initial E-byte indicating EVS WideBand modes */ + EBYTE_CMR_T_EVS_SWB = 0xB0, /* Initial E-byte indicating EVS SuperWideBand modes */ + EBYTE_CMR_T_EVS_FB = 0xC0, /* Initial E-byte indicating EVS FullBand modes */ + EBYTE_CMR_T_EVS_CA_WB = 0xD0, /* Initial E-byte indicating EVS CA WideBand modes */ + EBYTE_CMR_T_EVS_CA_SWB = 0xE0, /* Initial E-byte indicating EVS CA SuperWideBand modes */ + EBYTE_CMR_T_IVAS = 0xF0, /* Initial E-byte indicating IVAS modes */ + EBYTE_CMR_T_NO_REQ = 0xFF, /* If no bitrate and no CA mode requested for IVAS/EVS */ + +#ifdef RTP_S4_251135_CR26253_0016_REV1 + EBYTE_BANDWIDTH_REQUEST = 0x80, /* Subsequent E-byte for Bandwidth Request */ + EBYTE_FORMAT_REQUEST = 0x90, /* Subsequent E-byte for Format Request */ + EBYTE_SUBFORMAT_REQUEST = 0x9F, /* Subsequent E-byte for SubFormat Request */ + EBYTE_PI_INDICATOR = 0xA0, /* Subsequent E-byte for PI Indicator */ + EBYTE_SR_REQUEST = 0xB0, /* Subsequent E-byte for Split Rendering Request */ +#else + EBYTE_BANDWIDTH_REQUEST = 0x40, /* Subsequent E-byte for Bandwidth Request */ + EBYTE_FORMAT_REQUEST = 0x50, /* Subsequent E-byte for Format Request */ + EBYTE_SUBFORMAT_REQUEST = 0x9F, /* Subsequent E-byte for SubFormat Request */ + EBYTE_PI_INDICATOR = 0x60, /* Subsequent E-byte for PI Indicator */ + EBYTE_SR_REQUEST = 0x70, /* Subsequent E-byte for Split Rendering Request */ +#endif + + PI_HEADER_PF_LAST = 0x00, /* Last PI header of the Payload in PI Header */ + PI_HEADER_PF_NOT_LAST = 0x80, /* Another PI header follows after this in PI Header */ + PI_HEADER_PM_NOT_LAST = 0x20, /* PI Frame Marker, not the last PI Header in current frame */ + PI_HEADER_PM_LAST = 0x40, /* PI Frame Marker, the last PI Header in current frame */ + PI_HEADER_PM_GENERIC = 0x60, /* PI Frame Marker, Generic applied to all frames */ + + PI_AD_SPEECH_INDICATED = 0x80, /* Audio Description indicate Speech in Audio data */ + PI_AD_MUSIC_INDICATED = 0x40, /* Audio Description indicate Misuc in Audio data */ + PI_AD_AMBIANCE_INDICATED = 0x20, /* Audio Description indicate Ambiance in Audio data */ + PI_AD_EDITABLE_INDICATED = 0x10, /* Audio Description indicate metadata is editable */ + PI_AD_BINAURAL_INDICATED = 0x8, /* Audio Description indicate Stereo stream in Binaural */ + +}; + + +#define ERR_CHECK_RETURN( err ) \ + { \ + if ( ( err ) != IVAS_ERR_OK ) \ + { \ + return ( err ); \ + } \ + } + + +typedef struct +{ + uint32_t size; + uint8_t data[IVAS_PI_MAX_DATA_SIZE]; +} PIDATA_PACKED; + +ivas_error PI_PackData( const IVAS_PIDATA_GENERIC *piData, PIDATA_PACKED *packed, uint8_t pmBits ); +ivas_error PI_UnPackData( uint8_t piDataType, uint32_t piSize, const uint8_t *piDataBuffer, IVAS_PIDATA_GENERIC *piData ); + +#endif /* IVAS_RTPDUMP */ + +#endif /* IVAS_RTP_INTERNAL_H */ diff --git a/lib_util/ivas_rtp_payload.c b/lib_util/ivas_rtp_payload.c new file mode 100644 index 0000000000000000000000000000000000000000..98846adf847ea0b9cd930dd35ee18abd03f14564 --- /dev/null +++ b/lib_util/ivas_rtp_payload.c @@ -0,0 +1,1884 @@ +/****************************************************************************************************** + + (C) 2022-2025 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB, + Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., + Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, + Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other + contributors to this repository. All Rights Reserved. + + This software is protected by copyright law and by international treaties. + The IVAS codec Public Collaboration consisting of Dolby International AB, Ericsson AB, + Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., + Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, + Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other + contributors to this repository retain full ownership rights in their respective contributions in + the software. This notice grants no license of any kind, including but not limited to patent + license, nor is any license granted by implication, estoppel or otherwise. + + Contributors are required to enter into the IVAS codec Public Collaboration agreement before making + contributions. + + This software is provided "AS IS", without any express or implied warranties. The software is in the + development stage. It is intended exclusively for experts who have experience with such software and + solely for the purpose of inspection. All implied warranties of non-infringement, merchantability + and fitness for a particular purpose are hereby disclaimed and excluded. + + Any dispute, controversy or claim arising under or in relation to providing this software shall be + submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in + accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and + the United Nations Convention on Contracts on the International Sales of Goods. + +*******************************************************************************************************/ +#include +#include +#include +#ifndef FIXED_RTP_SEQUENCE_NUM +#include +#endif +#include "common_api_types.h" + +#ifdef IVAS_RTPDUMP + +#include "ivas_rtp_internal.h" +#include "ivas_bpool.h" +#include "ivas_queue.h" +#include "ivas_error_utils.h" +#include "mutex.h" + +#define IVAS_MAX_BYTES_PER_FRAME ( ( IVAS_MAX_BITS_PER_FRAME + 7 ) >> 3 ) +#define MAX_TOC_PER_FRAME ( 2u ) /* Main ToC Byte + SR-ToC byte */ + +/* Generic RTP Header + Header Extension data structure */ +typedef struct +{ + uint32_t ssrc; /* synchronization source id as negotiated in SDP */ + uint8_t version; /* version of RTP protocol, currently 2 */ + bool padding; /* false = no padding, true = zeoo padded payload (last byte = padding count) */ + bool extension; /* true = extension header is present before payload */ + uint8_t CC; /* if some streams mixed together, CC indicates no. of contributing sources (4 bits) */ + bool marker; /* Marker bit field */ + uint8_t payloadType; /* 7-bit payload type field indicating IVAS */ + uint16_t seqNumber; /* 16-bit sequence number for RTP packets */ + uint32_t timestamp; /* timer ticks @ 16KHz clock corrsponding to 1st frame in the Payload */ + uint32_t CSRC[15]; /* SSRC of contributing Sources for a mixed stream */ + uint16_t extHeaderId; /* extension header ID */ + uint16_t numExtUnits; /* length of the extension data in 32-bit words */ + uint8_t *extData; /* Extension data pointer */ +} RTP_HEADER; + +typedef struct +{ + PIDATA_PACKED piData[IVAS_PI_MAX_ID]; /* pi data per frame */ + uint32_t piDataBitmap; /* bitmap showing available pi */ + uint32_t numPiDataAvailable; /* number of pi data available */ +} PIDATA_FRAME; + +static void initRequests( IVAS_RTP_REQUEST_VALUE *requests ) +{ + requests[IVAS_REQUEST_CODEC].codec = IVAS_RTP_IVAS; + requests[IVAS_REQUEST_BITRATE].bitrate = 0; + requests[IVAS_REQUEST_BANDWIDTH].bandwidth = IVAS_BANDWIDTH_NO_REQ; + requests[IVAS_REQUEST_FORMAT].formatType = IVAS_FMT_NO_REQ; + requests[IVAS_REQUEST_CA_MODE].caMode = IVAS_RTP_CA_NO_REQ; +#ifdef RTP_S4_251135_CR26253_0016_REV1 + requests[IVAS_REQUEST_SUBFORMAT].subFormatType = IVAS_SUBFMT_NO_REQ; + requests[IVAS_REQUEST_SR_CONFIG].srConfig.valid = false; +#endif /* RTP_S4_251135_CR26253_0016_REV1 */ +} + +static void initPiDataFrame( PIDATA_FRAME *piDataFrm ) +{ + /* Add NO_PI_DATA by default */ + piDataFrm->numPiDataAvailable = 1; + piDataFrm->piDataBitmap = ( 1u << IVAS_PI_NO_DATA ); + piDataFrm->piData[IVAS_PI_NO_DATA].size = 2; + piDataFrm->piData[IVAS_PI_NO_DATA].data[0] = ( IVAS_PI_NO_DATA ); /* PF/PM populated during final packing */ + piDataFrm->piData[IVAS_PI_NO_DATA].data[1] = 0; /* NO_PI_DATA is 0 bytes */ +} + +typedef struct FRAME_NODE +{ + struct FRAME_NODE *next; /* next node */ + PIDATA_FRAME piDataFrame; /* PI data for this frame */ + uint8_t au[IVAS_MAX_BYTES_PER_FRAME]; /* ivas/evs packed frame (AU) */ + uint8_t toc[MAX_TOC_PER_FRAME]; /* ToC bytes for this frame */ + uint32_t auNumBits; /* Actual frame size in bits */ + uint32_t tocNumBytes; /* valid ToC bytes (1 or 2) */ +} FRAME_NODE; + +static void initFrameNode( FRAME_NODE *node ) +{ + node->next = NULL; + initPiDataFrame( &node->piDataFrame ); + node->auNumBits = 0; + node->tocNumBytes = 0; +} + +struct IVAS_RTP_PACK +{ + mtx_t apilock; /* Lock to handle concurrent API invocation */ + bool amrwbIOMode; /* If EVS is an AMRWB-IO mode frame */ + RTP_HEADER header; /* RTP Header Params */ + BPOOL_HANDLE packNodePool; /* Buffer pool to allocate FRAME_NODEs */ + PIDATA_FRAME piDataCache; /* temporary cache for PI data pushed before any frame is available in Queue */ + IVAS_RTP_PACK_CONFIG initConfig; /* Initial Configuration for Unpacker */ + IVAS_RTP_REQUEST_VALUE requests[IVAS_REQUEST_MAX]; /* Requests Storage */ + QUEUE_HANDLE frameQ; /* frames queue for FRAME_NODEs */ +}; + +typedef struct +{ + IVAS_RTP_CODEC codecId; /* Coded frame type (IVAS/EVS) */ + uint32_t auNumBits; /* Actual frame size in bits */ + bool speechLostIndicated; /* Speech Lost indicated */ + bool isAMRWB_IOmode; /* EVS frame is AMRWB_IO */ +#ifdef RTP_S4_251135_CR26253_0016_REV1 + IVAS_RTP_SR_INFO srInfo; /* Split Rendering Info */ +#endif /* RTP_S4_251135_CR26253_0016_REV1 */ +} TOC_INFO; + +typedef struct PIDATA_NODE +{ + struct PIDATA_NODE *next; /* next node is first element */ + PIDATA data; /* unpacked pi data per frame */ + uint32_t timestamp; /* rtp timestamp of this frame */ +} PIDATA_NODE; + +typedef struct UNPACK_NODE +{ + struct UNPACK_NODE *next; /* next node is first element */ + uint8_t au[IVAS_MAX_BYTES_PER_FRAME]; /* ivas/evs packed frame (AU) */ + TOC_INFO toc; /* unpacked ToC information */ + uint32_t timestamp; /* timestamp of this frame */ + uint16_t seqNumber; /* sequence number of the packet */ +} UNPACK_NODE; + +struct IVAS_RTP_UNPACK +{ + mtx_t apilock; /* Lock to handle concurrent API invocation */ + size_t maxNumberOfFrames; + size_t maxNumberOfPiData; + RTP_HEADER header; + BPOOL_HANDLE unpackNodePool; + BPOOL_HANDLE piDataPool; + IVAS_RTP_UNPACK_CONFIG initConfig; + IVAS_RTP_REQUEST_VALUE requests[IVAS_REQUEST_MAX]; + uint32_t numPiDataAvailable; /* number of pi data available */ + QUEUE_HANDLE frameQ; /* frame queue */ + QUEUE_HANDLE piDataQ; /* pi data queue */ +}; + +static const uint32_t ivasFrameSizeInBits[] = { + 264, 328, 488, 640, 960, 1280, 1600, 1920, 2560, 3200, 3840, 5120, 7680, 10240, 0, 104 +}; + +static const uint32_t evsFrameSizeInBits[] = { + 56, 144, 160, 192, 264, 328, 488, 640, 960, 1280, 1920, 2560, 48 +}; + +static const uint32_t amrWBIOFrameSizeInBits[] = { + 132, 177, 253, 285, 317, 365, 397, 461, 477, 35 +}; + + +/* Update the RTP Header structure */ +ivas_error IVAS_RTP_PACK_UpdateHeader( + IVAS_RTP_PACK_HANDLE hPack, /* i/o: pointer to an IVAS rtp packer handle to be opened */ +#ifdef FIXED_RTP_SEQUENCE_NUM + uint16_t seqNumInitVal, /* i : Initial sequence number to be used for 1st packet */ +#endif + uint32_t ssrc, /* i : Unique 32-bit Source ID as negotiated during SDP */ + uint8_t numCC, /* i : numCC indicates no. of contributing sources */ + uint32_t *csrc, /* i : SSRCs of contributing Sources for a mixed stream */ + uint16_t extHeaderId, /* i : extension header ID */ + uint16_t numExtensionBytes, /* i : length of the extension data */ + uint8_t *extData /* i : extension data pointer */ +) +{ + RTP_HEADER *header = &hPack->header; + + if ( numCC > 15 ) + { + return IVAS_ERROR( IVAS_ERR_WRONG_PARAMS, "CC must be less than 16" ); + } + +#ifdef FIXED_RTP_SEQUENCE_NUM + header->seqNumber = seqNumInitVal; +#endif + header->ssrc = ssrc; + header->CC = numCC; + if ( csrc != NULL ) + { + memcpy( header->CSRC, csrc, numCC & 0xF ); + } + + if ( ( numExtensionBytes > 0 ) && ( extData != NULL ) ) + { + header->extHeaderId = extHeaderId; + header->extData = realloc( header->extData, numExtensionBytes ); + if ( header->extData == NULL ) + { + return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "failed to allocate extdata" ); + } + memcpy( header->extData, extData, numExtensionBytes ); + header->extension = true; + header->numExtUnits = numExtensionBytes / sizeof( uint32_t ); + } + else + { + header->numExtUnits = 0; + header->extension = false; + } + + return IVAS_ERR_OK; +} + +static void InitRtpHeader( + RTP_HEADER *header /* RTP header structure */ +) +{ +#ifdef FIXED_RTP_SEQUENCE_NUM + memset( header, 0, sizeof( *header ) ); + header->version = 2; +#else + time_t t; + memset( header, 0, sizeof( *header ) ); + srand( (uint32_t) time( &t ) ); + header->version = 2; + header->seqNumber = rand() & 0xFFFF; +#endif +} + +static ivas_error PackRtpHeader( + RTP_HEADER *header, + IVAS_DATA_BUFFER *buf ) +{ + uint32_t nBytes = 0; + uint8_t CC = header->CC & MASK_4BIT; + uint32_t *CSRC = header->CSRC; + bool extension = header->extension && ( NULL != header->extData ); + uint32_t extensionLength = header->extension ? ( 1 + header->numExtUnits ) : 0; /* in u32 words */ + uint32_t packedLength = 12 + ( 4 * CC ) + ( 4 * extensionLength ); + + buf->length = 0; + if ( packedLength > buf->capacity ) + { + return IVAS_ERROR( IVAS_ERR_RTP_INSUFFICIENT_OUTPUT_SIZE, "Insufficient output buffer for RTP header packing" ); + } + + /* + +---+---+---+---+---+---+---+---+ + | V | V | P | X | CC (4 - bits) | + +---+---+---+---+---+---+---+---+ + */ + buf->buffer[nBytes++] = ( header->version << 6 ) | + ( (uint8_t) header->padding << 5 ) | + ( (uint8_t) extension << 4 ) | + CC; + /* + +---+---+---+---+---+---+---+---+ + | M | PT (7 - bits) | + +---+---+---+---+---+---+---+---+ + */ + buf->buffer[nBytes++] = ( (uint8_t) header->marker << 7 ) | + ( header->payloadType & MASK_7BIT ); + /* + +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ + | SEQUENCE NUMBER (16 bit) | + +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ + */ + buf->buffer[nBytes++] = (uint8_t) ( header->seqNumber >> 8 ); + buf->buffer[nBytes++] = (uint8_t) ( header->seqNumber ); + + /* Timestamp (32-bit) */ + buf->buffer[nBytes++] = (uint8_t) ( header->timestamp >> 24 ); + buf->buffer[nBytes++] = (uint8_t) ( header->timestamp >> 16 ); + buf->buffer[nBytes++] = (uint8_t) ( header->timestamp >> 8 ); + buf->buffer[nBytes++] = (uint8_t) ( header->timestamp >> 0 ); + + /* SSRC (32-bit) */ + buf->buffer[nBytes++] = (uint8_t) ( header->ssrc >> 24 ); + buf->buffer[nBytes++] = (uint8_t) ( header->ssrc >> 16 ); + buf->buffer[nBytes++] = (uint8_t) ( header->ssrc >> 8 ); + buf->buffer[nBytes++] = (uint8_t) ( header->ssrc >> 0 ); + + /* CSRC Identifiers */ + while ( CC ) + { + /* CSRC[n] (32-bit) */ + uint32_t id = *CSRC++; + buf->buffer[nBytes++] = (uint8_t) ( id >> 24 ); + buf->buffer[nBytes++] = (uint8_t) ( id >> 16 ); + buf->buffer[nBytes++] = (uint8_t) ( id >> 8 ); + buf->buffer[nBytes++] = (uint8_t) ( id >> 0 ); + CC--; + } + + if ( extension ) + { + buf->buffer[nBytes++] = (uint8_t) ( header->extHeaderId >> 8 ); + buf->buffer[nBytes++] = (uint8_t) ( header->extHeaderId >> 0 ); + buf->buffer[nBytes++] = (uint8_t) ( header->numExtUnits >> 8 ); + buf->buffer[nBytes++] = (uint8_t) ( header->numExtUnits >> 0 ); + + memcpy( &buf->buffer[nBytes], header->extData, header->numExtUnits * 4 ); + nBytes += header->numExtUnits; + } + + buf->length = nBytes; + return IVAS_ERR_OK; +} + +static void UpdateRtpHeader( + RTP_HEADER *header, /* RTP header structure */ + uint32_t timestampOffset /* Timestamp offset @ 16KHz clock for next frame */ +) +{ + header->seqNumber++; + header->timestamp += timestampOffset; +} + +static ivas_error UnpackRtpPacket( + const IVAS_DATA_BUFFER *packet, /* Input buffer with RTP Packet */ + RTP_HEADER *header, /* RTP header structure */ + uint32_t *numHeaderBytes /* No. of rtp header bytes */ +) +{ + uint32_t n = 0, nByte = 0, expectedSize = 12; + uint8_t byte; + + if ( packet->length < expectedSize ) + { + return IVAS_ERROR( IVAS_ERR_RTP_UNDERFLOW, "Insufficient input buffer for RTP header unpacking" ); + } + + /* + +---+---+---+---+---+---+---+---+ + | V | V | P | X | CC (4 - bits) | + +---+---+---+---+---+---+---+---+ + */ + byte = packet->buffer[nByte++]; + header->version = ( byte >> 6 ) & MASK_2BIT; + header->padding = ( byte >> 5 ) & MASK_1BIT; + header->extension = ( byte >> 4 ) & MASK_1BIT; + header->CC = ( byte & MASK_4BIT ); + + /* + +---+---+---+---+---+---+---+---+ + | M | PT (7 - bits) | + +---+---+---+---+---+---+---+---+ + */ + byte = packet->buffer[nByte++]; + header->marker = ( byte >> 7 ) & MASK_1BIT; + header->payloadType = byte & MASK_7BIT; + + /* + +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ + | SEQUENCE NUMBER (16 bit) | + +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ + */ + header->seqNumber = (uint16_t) packet->buffer[nByte++] << 8; + header->seqNumber |= (uint16_t) packet->buffer[nByte++] << 8; + + /* Timestamp (32-bit) */ + header->timestamp = ( (uint32_t) packet->buffer[nByte++] << 24 ); + header->timestamp |= ( (uint32_t) packet->buffer[nByte++] << 16 ); + header->timestamp |= ( (uint32_t) packet->buffer[nByte++] << 8 ); + header->timestamp |= ( (uint32_t) packet->buffer[nByte++] ); + + /* SSRC (32-bit) */ + header->ssrc = ( (uint32_t) packet->buffer[nByte++] << 24 ); + header->ssrc |= ( (uint32_t) packet->buffer[nByte++] << 16 ); + header->ssrc |= ( (uint32_t) packet->buffer[nByte++] << 8 ); + header->ssrc |= ( (uint32_t) packet->buffer[nByte++] ); + + expectedSize += ( header->CC ) * 4 + ( header->extension ? 4 : 0 ); + if ( packet->length < expectedSize ) + { + return IVAS_ERROR( IVAS_ERR_RTP_UNDERFLOW, "CC indicated but insufficient input buffer" ); + } + + /* CSRC Identifiers */ + for ( n = 0; n < header->CC; n++ ) + { + /* CSRC[n] (32-bit) */ + header->CSRC[n] = ( (uint32_t) packet->buffer[nByte++] << 24 ); + header->CSRC[n] |= ( (uint32_t) packet->buffer[nByte++] << 16 ); + header->CSRC[n] |= ( (uint32_t) packet->buffer[nByte++] << 8 ); + header->CSRC[n] |= ( (uint32_t) packet->buffer[nByte++] ); + } + + if ( header->extension ) + { + header->extHeaderId = ( (uint32_t) packet->buffer[nByte++] << 8 ); + header->extHeaderId |= ( (uint32_t) packet->buffer[nByte++] ); + header->numExtUnits = ( (uint32_t) packet->buffer[nByte++] << 8 ); + header->numExtUnits |= ( (uint32_t) packet->buffer[nByte++] ); + + expectedSize += header->numExtUnits * 4; + if ( packet->length < expectedSize ) + { + return IVAS_ERROR( IVAS_ERR_RTP_UNDERFLOW, "Extension Header indicated but insufficient input buffer" ); + } + + header->extData = realloc( header->extData, header->numExtUnits * 4 ); + if ( header->extData == NULL ) + { + return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "failed to allocate extdata" ); + } + memcpy( header->extData, &packet->buffer[nByte], header->numExtUnits * 4 ); + nByte += header->numExtUnits * 4; + } + + *numHeaderBytes = nByte; + return IVAS_ERR_OK; +} + +static ivas_error getBitrateFromCodecAndFrameSize( + IVAS_RTP_CODEC codecId, + uint32_t frameLengthBytes, + uint32_t *bitrateKbps, + uint32_t *frameLenInBits, + uint8_t *tocByte, + bool *isAmrwbIOMode ) +{ + size_t n; + *bitrateKbps = 0; + *frameLenInBits = 0; + if ( codecId == IVAS_RTP_IVAS ) + { + /* Validate the framelength is supported for ivas frame */ + for ( n = 0; n < sizeof( ivasFrameSizeInBits ) / sizeof( ivasFrameSizeInBits[0] ); n++ ) + { + if ( ivasFrameSizeInBits[n] == frameLengthBytes * 8 ) + { + *bitrateKbps = ( frameLengthBytes * IVAS_NUM_FRAMES_PER_SEC * 8 ); /* bitrate in kbps */ + *frameLenInBits = frameLengthBytes * 8; /* frame length in bits */ + *tocByte = TOC_INDICATE_IVAS | ( n & MASK_4BIT ); /* bitrate index */ + return IVAS_ERR_OK; + } + } + return IVAS_ERR_INVALID_BITRATE; + } + else + { + /* Try if frameLength is a supported EVS frame length */ + for ( n = 0; n < sizeof( evsFrameSizeInBits ) / sizeof( evsFrameSizeInBits[0] ); n++ ) + { + if ( evsFrameSizeInBits[n] == frameLengthBytes * 8 ) + { + *bitrateKbps = ( frameLengthBytes * IVAS_NUM_FRAMES_PER_SEC * 8 ); /* bitrate in kbps */ + *frameLenInBits = frameLengthBytes * 8; /* frame length in bits */ + *tocByte = TOC_INDICATE_EVS | ( n & MASK_4BIT ); /* bitrate index */ + return IVAS_ERR_OK; + } + } + /* Try if frameLength is a supported AMRWB-IO frame length */ + for ( n = 0; n < sizeof( amrWBIOFrameSizeInBits ) / sizeof( amrWBIOFrameSizeInBits[0] ); n++ ) + { + uint32_t lengthInBits = amrWBIOFrameSizeInBits[n]; + if ( ( ( lengthInBits + 7 ) / 8 ) == frameLengthBytes ) + { + *isAmrwbIOMode = true; + *bitrateKbps = ( lengthInBits * IVAS_NUM_FRAMES_PER_SEC ); /* bitrate in kbps */ + *frameLenInBits = lengthInBits; /* frame length in bits */ + *tocByte = TOC_INDICATE_AMRWB | ( n & MASK_4BIT ); /* bitrate index */ + return IVAS_ERR_OK; + } + } + return IVAS_ERR_INVALID_BITRATE; + } +} + +ivas_error IVAS_RTP_PACK_Open( + IVAS_RTP_PACK_HANDLE *phPack, /* i/o: pointer to an IVAS rtp packer handle to be opened */ + const IVAS_RTP_PACK_CONFIG *config /* i : pointer to initial config for RTP Packer */ +) +{ + ivas_error error; + IVAS_RTP_PACK_HANDLE hPack; + uint32_t numFramesPerPacket = ( config->maxFramesPerPacket == 0 ) ? IVAS_MAX_FRAMES_PER_RTP_PACKET : config->maxFramesPerPacket; + + if ( phPack == NULL ) + { + return IVAS_ERR_UNEXPECTED_NULL_POINTER; + } + + if ( numFramesPerPacket > IVAS_MAX_FRAMES_PER_RTP_PACKET ) + { + return IVAS_ERROR( IVAS_ERR_WRONG_PARAMS, "Max frame per packet exeeds %d", IVAS_MAX_FRAMES_PER_RTP_PACKET ); + } + + *phPack = NULL; + if ( ( hPack = (IVAS_RTP_PACK_HANDLE) calloc( 1, sizeof( struct IVAS_RTP_PACK ) ) ) == NULL ) + { + return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Cannot allocate memory for IVAS rtppack handle" ); + } + + error = BPOOL_Create( &hPack->packNodePool, sizeof( FRAME_NODE ), numFramesPerPacket * 4 ); + ERR_CHECK_RETURN( error ); + + error = QUEUE_Create( &hPack->frameQ ); + ERR_CHECK_RETURN( error ); + + mtx_init( &hPack->apilock, 0 ); + hPack->initConfig = *config; + initRequests( hPack->requests ); + InitRtpHeader( &hPack->header ); + initPiDataFrame( &hPack->piDataCache ); + *phPack = hPack; + return IVAS_ERR_OK; +} + +/* Close and free an existing instance of rtp packer */ +void IVAS_RTP_PACK_Close( + IVAS_RTP_PACK_HANDLE *phPack /* i/o : pointer to an IVAS rtp packer handle to be closed */ +) +{ + IVAS_RTP_PACK_HANDLE hPack; + + /* Free all memory */ + if ( phPack == NULL || *phPack == NULL ) + { + return; + } + + hPack = *phPack; + QUEUE_Destroy( &hPack->frameQ ); + mtx_destroy( &hPack->apilock ); + BPOOL_Destroy( &hPack->packNodePool ); + free( hPack->header.extData ); + free( hPack ); + *phPack = NULL; +} + +ivas_error IVAS_RTP_PACK_PushRemoteRequest( + IVAS_RTP_PACK_HANDLE hPack, /* i/o : IVAS rtp packer handle */ + IVAS_RTP_REQUEST_TYPE reqType, /* i : remote request type */ + IVAS_RTP_REQUEST_VALUE reqValue /* i : value of the requested type */ +) +{ + if ( reqType < 0 || reqType >= IVAS_REQUEST_MAX ) + { + return IVAS_ERROR( IVAS_ERR_WRONG_PARAMS, "Invalid request key provided" ); + } + + /* Sanity on API */ + switch ( reqType ) + { + case IVAS_REQUEST_CODEC: + { + uint32_t codec = reqValue.codec; + if ( codec != IVAS_RTP_IVAS && codec != IVAS_RTP_EVS ) + { + return IVAS_ERROR( IVAS_ERR_WRONG_PARAMS, "Unsupported codec id provided" ); + } + } + break; + case IVAS_REQUEST_BITRATE: + { + uint32_t bitrate = reqValue.bitrate; + if ( bitrate < 5900 || bitrate > 512000 ) + { + return IVAS_ERROR( IVAS_ERR_WRONG_PARAMS, "Unsupported bitrate provided" ); + } + } + break; + case IVAS_REQUEST_BANDWIDTH: + { + uint32_t bandwidth = reqValue.bandwidth; + if ( bandwidth > IVAS_BANDWIDTH_NO_REQ ) + { + return IVAS_ERROR( IVAS_ERR_WRONG_PARAMS, "Unsupported bandwidth provided" ); + } + } + break; + case IVAS_REQUEST_FORMAT: + { + uint32_t format = reqValue.formatType; + if ( format > IVAS_FMT_NO_REQ ) + { + return IVAS_ERROR( IVAS_ERR_WRONG_PARAMS, "Unsupported format provided" ); + } + } + break; + case IVAS_REQUEST_CA_MODE: + { + uint32_t caMode = reqValue.caMode; + if ( caMode > IVAS_RTP_CA_NO_REQ ) + { + return IVAS_ERROR( IVAS_ERR_WRONG_PARAMS, "Unsupported channel aware mode provided" ); + } + } + break; +#ifdef RTP_S4_251135_CR26253_0016_REV1 + case IVAS_REQUEST_SUBFORMAT: + { + uint32_t subFormat = reqValue.subFormatType; + if ( subFormat > IVAS_SUBFMT_NO_REQ ) + { + return IVAS_ERROR( IVAS_ERR_WRONG_PARAMS, "Unsupported subformat provided" ); + } + } + break; + case IVAS_REQUEST_SR_CONFIG: + { + IVAS_RTP_SPLITRENDER srConfig = reqValue.srConfig; + if ( srConfig.reserved != 0 ) + { + return IVAS_ERROR( IVAS_ERR_WRONG_PARAMS, "Unsupported reserved bits in SR config provided" ); + } + } + break; +#endif /* RTP_S4_251135_CR26253_0016_REV1 */ + default: + return IVAS_ERROR( IVAS_ERR_WRONG_PARAMS, "Unsupported request type" ); + } + + hPack->requests[reqType] = reqValue; + + return IVAS_ERR_OK; +} + +static bool isAmrWBIOMode( uint32_t bitrate, uint32_t *idx ) +{ + size_t n; + *idx = 0; + for ( n = 0; n < sizeof( amrWBIOFrameSizeInBits ) / sizeof( amrWBIOFrameSizeInBits[0] ); n++ ) + { + if ( bitrate == ( amrWBIOFrameSizeInBits[n] * IVAS_NUM_FRAMES_PER_SEC ) ) + { + *idx = n; + return true; + } + } + return false; +} + +static uint32_t getBitrateIdx( const uint32_t *table, uint32_t tableLen, uint32_t bitrate ) +{ + size_t n, idx = 0; + + for ( n = 0; n < tableLen; n++ ) + { + if ( bitrate > ( table[n] * IVAS_NUM_FRAMES_PER_SEC ) ) + { + idx = n; + } + else + { + return idx; + } + } + return idx; +} + +static void packEBytes( + IVAS_RTP_PACK_HANDLE hPack, /* i/o : IVAS rtp packer handle */ + bool piDataPresent, /* i : Signals if PI data present */ + size_t maxNumEBytes, /* i : max capacity of eByte buffer */ + uint8_t *eByte, /* o : output buffer for E-Bytes */ + size_t *nBytesWritten /* o : max capacity of eByte buffer */ +) +{ + /* Initial E-byte structure + * 0 1 2 3 4 5 6 7 + * +-+-+-+-+-+-+-+-+ + * |H|T|T|T| BR | + * +-+-+-+-+-+-+-+-+ + */ + uint32_t nByte = 0; + uint8_t T = EBYTE_CMR_T_IVAS; /* IVAS */ + uint8_t BR = 0; + + IVAS_RTP_CODEC codec = hPack->requests[IVAS_REQUEST_CODEC].codec; + IVAS_RTP_BANDWIDTH bandwidth = hPack->requests[IVAS_REQUEST_BANDWIDTH].bandwidth; + uint32_t bitrate = hPack->requests[IVAS_REQUEST_BITRATE].bitrate; + uint32_t bitrateIdx = 0; + + *nBytesWritten = 0; + + if ( codec == IVAS_RTP_EVS ) + { + /* If requesting EVS/AMRWB IO from farend, only Initial E-byte present */ + IVAS_RTP_CA_MODE caMode = hPack->requests[IVAS_REQUEST_CA_MODE].caMode; + + if ( caMode != IVAS_RTP_CA_NO_REQ ) + { + T = ( bandwidth == IVAS_BANDWIDTH_SWB ) ? EBYTE_CMR_T_EVS_CA_SWB : EBYTE_CMR_T_EVS_CA_WB; + BR = caMode & MASK_3BIT; /* only 8 valid values */ + if ( nByte < maxNumEBytes ) + { + eByte[nByte++] = ( T | BR ); + } + } + else if ( bitrate > 0 && isAmrWBIOMode( bitrate, &bitrateIdx ) ) + { + /* AMR WB IO Mode */ + T = EBYTE_CMR_T_EVS_IO; + BR = (uint8_t) bitrateIdx & MASK_4BIT; + if ( nByte < maxNumEBytes ) + { + eByte[nByte++] = ( T | BR ); + } + } + else if ( bitrate > 0 ) + { + /* EVS Modes */ + bitrate = ( bitrate > 128000 ) ? 128000 : bitrate; + bitrate = ( bitrate < 5900 ) ? 5900 : bitrate; + bitrateIdx = getBitrateIdx( evsFrameSizeInBits, sizeof( evsFrameSizeInBits ) / sizeof( evsFrameSizeInBits[0] ), bitrate ); + BR = (uint8_t) bitrateIdx & MASK_4BIT; + + /* If a bandwidth choice cannot be signalled for a given bitrate + preference is given to bitrate choice, bandwidth req is modified */ + switch ( bandwidth ) + { + case IVAS_BANDWIDTH_NB: + T = ( bitrate <= 24400u ) ? EBYTE_CMR_T_EVS_NB : EBYTE_CMR_T_EVS_SWB; + break; + case IVAS_BANDWIDTH_WB: + T = EBYTE_CMR_T_EVS_WB; + break; + case IVAS_BANDWIDTH_SWB: + T = ( bitrate >= 9600u ) ? EBYTE_CMR_T_EVS_SWB : EBYTE_CMR_T_EVS_WB; + break; + case IVAS_BANDWIDTH_FB: + T = ( bitrate >= 16400u ) ? EBYTE_CMR_T_EVS_FB : EBYTE_CMR_T_EVS_WB; + break; + default: /*IVAS_BANDWIDTH_NO_REQ */ + T = ( bitrate >= 9600u ) ? EBYTE_CMR_T_EVS_SWB : EBYTE_CMR_T_EVS_WB; + break; + } + if ( nByte < maxNumEBytes ) + { + eByte[nByte++] = ( T | BR ); + } + } + else if ( piDataPresent ) + { + /* Send an initial E-byte to allow for subsequent PI indication E-byte */ + if ( nByte < maxNumEBytes ) + { + eByte[nByte++] = EBYTE_CMR_T_NO_REQ; + } + } + } + else + { + /* Requesting IVAS from farend, Subsequent E-byte indicate BW, CFR, SR */ + IVAS_RTP_FORMAT format = hPack->requests[IVAS_REQUEST_FORMAT].formatType; + bool isBandwidthProvided = ( bandwidth != IVAS_BANDWIDTH_NO_REQ && bandwidth != IVAS_BANDWIDTH_NB ); + bool isFormatProvided = ( format != IVAS_FMT_NO_REQ ); + bool isSubFormatProvided = false; + bool isSRConfigProvided = false; + +#ifdef RTP_S4_251135_CR26253_0016_REV1 + IVAS_RTP_SUBFORMAT subFormat = hPack->requests[IVAS_REQUEST_SUBFORMAT].subFormatType; + IVAS_RTP_SPLITRENDER srConfig = hPack->requests[IVAS_REQUEST_SR_CONFIG].srConfig; + + isSubFormatProvided = ( subFormat != IVAS_SUBFMT_NO_REQ ); + isSRConfigProvided = srConfig.valid; +#endif + + /* Initial E-Byte only sent if either bitrate requested or subsequent E-byte is requested */ + if ( !( ( bitrate > 0 ) || isBandwidthProvided || isFormatProvided || + isSubFormatProvided || isSRConfigProvided || piDataPresent ) ) + { + return; + } + + if ( bitrate > 0 ) + { + /* Initial E-Byte */ + bitrate = ( bitrate > 512000 ) ? 512000 : bitrate; + bitrate = ( bitrate < 13200 ) ? 13200 : bitrate; + bitrateIdx = getBitrateIdx( ivasFrameSizeInBits, sizeof( ivasFrameSizeInBits ) / sizeof( ivasFrameSizeInBits[0] ), bitrate ); + BR = (uint8_t) bitrateIdx & MASK_4BIT; + if ( nByte < maxNumEBytes ) + { + eByte[nByte++] = ( EBYTE_CMR_T_IVAS | BR ); + } + } + else + { + if ( nByte < maxNumEBytes ) + { + eByte[nByte++] = EBYTE_CMR_T_NO_REQ; + } + } + + /* Subsequent E-bytes - Bandwidth Request */ + if ( isBandwidthProvided && nByte < maxNumEBytes ) + { + uint8_t bw = ( bandwidth - IVAS_BANDWIDTH_WB ) & MASK_2BIT; + eByte[nByte++] = ( EBYTE_BANDWIDTH_REQUEST | bw ); + } + + /* Subsequent E-bytes - Coded Format Request */ + if ( ( isFormatProvided || isSubFormatProvided ) && nByte < maxNumEBytes ) + { + uint8_t fmtEByte = ( EBYTE_FORMAT_REQUEST | ( (uint8_t) format & MASK_3BIT ) ); + eByte[nByte++] = isSubFormatProvided ? EBYTE_SUBFORMAT_REQUEST : fmtEByte; + } +#ifdef RTP_S4_251135_CR26253_0016_REV1 + if ( isSubFormatProvided && nByte < maxNumEBytes ) + { + eByte[nByte++] = ( (uint8_t) subFormat & MASK_6BIT ); /* Requested Coded subFormat */ + } + /* Subsequent E-bytes - Split Renderer Configuration Request */ + if ( isSRConfigProvided && nByte < maxNumEBytes ) + { + eByte[nByte++] = EBYTE_SR_REQUEST | + ( (uint8_t) srConfig.diegetic << 3 ) | ( (uint8_t) srConfig.yaw << 2 ) | + ( (uint8_t) srConfig.pitch << 1 ) | ( (uint8_t) srConfig.roll << 0 ); + } +#endif /* RTP_S4_251135_CR26253_0016_REV1 */ + } + + /* Final E-byte is the PI Indicator E-Byte */ + if ( piDataPresent && ( nByte < maxNumEBytes ) ) + { + eByte[nByte++] = EBYTE_PI_INDICATOR; /* PI Indication */ + } + + *nBytesWritten = nByte; +} + + +#ifdef RTP_S4_251135_CR26253_0016_REV1 +static ivas_error getSRToCByte( + const IVAS_RTP_SR_INFO *srInfo, /* i : Split Rendering Info */ + uint8_t *tocByte /* o : toc byte 2 */ +) +{ + uint8_t bitIdx, codecId, digetic; + if ( srInfo->bitrateKbps < 256000 || srInfo->bitrateKbps > 512000 ) + { + return IVAS_ERROR( IVAS_ERR_WRONG_PARAMS, "Unsupported bitrate for SR" ); + } + + bitIdx = ( ( srInfo->bitrateKbps / 128000u ) - 1 ) & MASK_2BIT; + codecId = (uint8_t) srInfo->codec; + digetic = srInfo->diegetic ? 1 : 0; + + *tocByte = ( digetic << 6 ) | ( codecId << 5 ) | ( bitIdx << 3 ); + + return IVAS_ERR_OK; +} +#endif /* RTP_S4_251135_CR26253_0016_REV1 */ + +static void addPackedPiDataToFrame( PIDATA_FRAME *piDataFrm, const PIDATA_PACKED *packedPiData, uint32_t piDataType ) +{ + piDataFrm->piData[piDataType].size = packedPiData->size; + memcpy( piDataFrm->piData[piDataType].data, packedPiData->data, packedPiData->size ); + + /* Indicate th PI data type presense in bitmap, If the same pi data type is + already pushed for this frame, it is overwritten with the newer data */ + if ( !( piDataFrm->piDataBitmap & ( 1u << piDataType ) ) ) + { + piDataFrm->piDataBitmap |= ( 1u << piDataType ); + piDataFrm->numPiDataAvailable++; + } + + /* Atleast one valid PI data is now pushed for this frame, clear No PI data + for this frame */ + if ( piDataFrm->piDataBitmap & ( 1u << IVAS_PI_NO_DATA ) ) + { + piDataFrm->piDataBitmap &= ~( 1u << IVAS_PI_NO_DATA ); + piDataFrm->numPiDataAvailable--; + } +} + +ivas_error IVAS_RTP_PACK_PushFrame( + IVAS_RTP_PACK_HANDLE hPack, /* i/o : IVAS rtp packer handle */ + IVAS_RTP_CODEC codecId, /* i : Codec type (IVAS/EVS) */ +#ifdef RTP_S4_251135_CR26253_0016_REV1 + const IVAS_RTP_SR_INFO *srInfo, /* i : Split Rendering Info */ +#endif /* RTP_S4_251135_CR26253_0016_REV1 */ + const IVAS_DATA_BUFFER *frameBuffer /* i : packed frame bitstream for IVAS/EVS */ +) +{ + ivas_error error = IVAS_ERR_OK; + uint32_t bitrate = 0; + uint32_t frameLengthInBits = 0; + uint8_t tocByte = 0; +#ifdef RTP_S4_251135_CR26253_0016_REV1 + uint8_t tocByte1 = 0; +#endif + FRAME_NODE *node = NULL; + PIDATA_FRAME *piDataFrame = &hPack->piDataCache; + uint32_t piDataType = 0; + + if ( frameBuffer == NULL || frameBuffer->length == 0 ) + { + /* Indicates a NO_DATA_FRAME in case of DTX mode */ + tocByte = ( hPack->amrwbIOMode ) ? TOC_INDICATE_NO_DATA_AMRWB : TOC_INDICATE_NO_DATA; + } +#ifdef RTP_S4_251135_CR26253_0016_REV1 + else if ( srInfo != NULL && srInfo->valid ) + { + tocByte = TOC_INDICATE_SR; + frameLengthInBits = frameBuffer->length * 8; + error = getSRToCByte( srInfo, &tocByte1 ); + ERR_CHECK_RETURN( error ); + } +#endif + else + { + error = getBitrateFromCodecAndFrameSize( codecId, frameBuffer->length, &bitrate, &frameLengthInBits, &tocByte, &hPack->amrwbIOMode ); + ERR_CHECK_RETURN( error ); + } + + /* Allocate a new frame node for this frame */ + error = BPOOL_GetBuffer( hPack->packNodePool, (void **) &node ); + ERR_CHECK_RETURN( error ); + + initFrameNode( node ); + + /* Set ToC byte & frame */ + node->toc[node->tocNumBytes++] = tocByte; +#ifdef RTP_S4_251135_CR26253_0016_REV1 + if ( srInfo != NULL && srInfo->valid ) + { + node->toc[node->tocNumBytes++] = tocByte1; + } +#endif + + node->auNumBits = frameLengthInBits; + if ( frameBuffer != NULL ) + { + memcpy( node->au, frameBuffer->buffer, frameBuffer->length ); + } + + /* If some Pi data is is Cache add to Frame Node's associated Pi Data */ + mtx_lock( &hPack->apilock ); /* Lock to prevent access to shared cache */ + if ( piDataFrame->numPiDataAvailable ) + { + uint32_t bitmap = piDataFrame->piDataBitmap; + for ( piDataType = 0; piDataType < 32 && ( bitmap != 0 ); piDataType++ ) + { + uint32_t mask = ( 1u << piDataType ); + if ( bitmap & mask ) + { + bitmap &= ~mask; /* Mask out this pi type to indicate processed */ + addPackedPiDataToFrame( &node->piDataFrame, &piDataFrame->piData[piDataType], piDataType ); + } + } + initPiDataFrame( piDataFrame ); /* Reset Cache */ + } + mtx_unlock( &hPack->apilock ); + + /* Add to frames FiFo */ + QUEUE_Push( hPack->frameQ, (NODE *) node ); + + return IVAS_ERR_OK; +} + +uint32_t IVAS_RTP_PACK_GetNumFrames( + IVAS_RTP_PACK_HANDLE hPack /* i/o : IVAS rtp packer handle */ +) +{ + uint32_t nFrames = 0; + if ( hPack ) + { + nFrames = QUEUE_Size( hPack->frameQ ); + } + return nFrames; +} + +/* Push single PI data to rtp packer + * + * Provide PI data for a current RTP Payload. All PI data is locally cached in the packer + * and set to the rtp packet with policy defined in initial configuration during call to + * IVAS_RTP_PACK_GetPacket. + * + */ +ivas_error IVAS_RTP_PACK_PushPiData( + IVAS_RTP_PACK_HANDLE hPack, /* i/o : IVAS rtp packer handle */ + const IVAS_PIDATA_GENERIC *data /* i : pointer to the PIData stucture */ +) +{ + ivas_error error = IVAS_ERR_OK; + PIDATA_PACKED packedPiData; + + if ( data == NULL || + data->piDataType >= IVAS_PI_NO_DATA || /* NO_PI_DATA cannot be provided by user, it is generated in packing */ + data->size > sizeof( PIDATA ) ) + { + return IVAS_ERROR( IVAS_ERR_WRONG_PARAMS, "Wrong PI Data provided" ); + } + + error = PI_PackData( data, &packedPiData, 0 ); + ERR_CHECK_RETURN( error ); + + mtx_lock( &hPack->apilock ); /* Lock to prevent access to shared cache */ + { + FRAME_NODE *node = (FRAME_NODE *) QUEUE_Back( hPack->frameQ ); + /* use cache if no frame in Queue to associate PI data */ + PIDATA_FRAME *piDataFrm = ( node != NULL ) ? &node->piDataFrame : &hPack->piDataCache; + addPackedPiDataToFrame( piDataFrm, &packedPiData, data->piDataType ); + } + mtx_unlock( &hPack->apilock ); + + return IVAS_ERR_OK; +} + +#define WRITE_BYTE_PAYLOAD_OR_EXIT( payload, byte ) \ + if ( payload->length < payload->capacity ) \ + { \ + uint8_t _byte = ( byte ); \ + payload->buffer[payload->length++] = _byte; \ + } \ + else \ + { \ + error = IVAS_ERROR( IVAS_ERR_RTP_INSUFFICIENT_OUTPUT_SIZE, "Insufficient memory to write RTP Payload" ); \ + goto err_exit; \ + } + +ivas_error IVAS_RTP_PACK_GetPayload( + IVAS_RTP_PACK_HANDLE hPack, /* i/o : IVAS rtp packer handle */ + IVAS_DATA_BUFFER *payload, /* o : encapsulated rtp payload */ + uint32_t *numFramesInPayload /* o : no. of frames in payload */ +) +{ + uint32_t n = 0, numFrame = 0; + ivas_error error = IVAS_ERR_OK; + uint32_t numPiDataPresent = 0; + FRAME_NODE *availableFrameNodes[IVAS_MAX_FRAMES_PER_RTP_PACKET]; + size_t numEBytes = 0; + + if ( payload == NULL ) + { + return IVAS_ERROR( IVAS_ERR_WRONG_PARAMS, "Output data buffer is NULL" ); + } + + /* Calculate number of frames to pack in this payload */ + numFrame = QUEUE_Size( hPack->frameQ ); + numFrame = ( numFrame > hPack->initConfig.maxFramesPerPacket ) ? hPack->initConfig.maxFramesPerPacket : numFrame; + *numFramesInPayload = numFrame; /* numFrames in Packet */ + + /* Collect all the frame nodes from FiFo */ + for ( n = 0; n < numFrame; n++ ) + { + FRAME_NODE *node = (FRAME_NODE *) QUEUE_Pop( hPack->frameQ ); + if ( node == NULL ) + { + assert( 0 ); /* catastrophic error, implementation issue somewhere */ + return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "NULL found in frame nodes" ); + } + /* Calculate number of PI data present in total */ + numPiDataPresent += node->piDataFrame.numPiDataAvailable; + availableFrameNodes[n] = node; + } + + /* IVAS Payload starts with E-Bytes */ + packEBytes( hPack, ( numPiDataPresent > 0 ), payload->capacity, &payload->buffer[payload->length], &numEBytes ); + payload->length += numEBytes; + + /* ToC bytes (atleast 1 byte per frame, 2 if SR )*/ + for ( n = 0; n < numFrame; n++ ) + { + FRAME_NODE *node = availableFrameNodes[n]; + uint8_t fBit = ( n != ( numFrame - 1 ) ) ? TOC_HEADER_FOLLOWS : 0; /* Next ToC present */ + + WRITE_BYTE_PAYLOAD_OR_EXIT( payload, ( node->toc[0] | fBit ) ); +#ifdef RTP_S4_251135_CR26253_0016_REV1 + if ( node->tocNumBytes == 2 ) + { + WRITE_BYTE_PAYLOAD_OR_EXIT( payload, node->toc[1] ); + } +#endif + } + + /* Frame Data */ + for ( n = 0; n < numFrame; n++ ) + { + FRAME_NODE *node = availableFrameNodes[n]; + size_t frameLength = ( node->auNumBits + 7 ) >> 3; /* zero padded length in bytes */ + if ( payload->length + frameLength <= payload->capacity ) + { + memcpy( &payload->buffer[payload->length], node->au, frameLength ); + } + else + { + error = IVAS_ERROR( IVAS_ERR_RTP_INSUFFICIENT_OUTPUT_SIZE, "Insufficient memory to write RTP Payload" ); + goto err_exit; + } + payload->length += frameLength; + } + + /* PI Data */ + if ( numPiDataPresent > 0 ) + { + bool skipPiData = false; + size_t nBytes = payload->length; + uint32_t numPiDataWritten = 0; + + for ( n = 0; n < numFrame; n++ ) + { + uint32_t piDataType = 0; + FRAME_NODE *node = availableFrameNodes[n]; + PIDATA_FRAME *piDataFrame = &node->piDataFrame; + uint32_t bitmap = piDataFrame->piDataBitmap; + uint8_t PM = 0, PF = 0; + + for ( piDataType = 0; piDataType < 32 && ( bitmap != 0 ); piDataType++ ) + { + uint32_t mask = ( 1u << piDataType ); + if ( bitmap & mask ) + { + bitmap &= ~mask; /* Mask out this pi type to indicate processing */ + /* Check if last PI data this frame */ + PM = piDataFrame->piData[piDataType].data[0] & 0x60; + PM = (uint8_t) ( ( bitmap == 0 && PM != PI_HEADER_PM_GENERIC ) ? PI_HEADER_PM_LAST : PM ); + /* Check if last PI data all frames */ + PF = (uint8_t) ( ( bitmap == 0 && ( numPiDataWritten + 1 == numPiDataPresent ) ) ? PI_HEADER_PF_LAST : PI_HEADER_PF_NOT_LAST ); /* Last PI in Payload */ + /* Update the first byte of PI Header with PF/PM */ + piDataFrame->piData[piDataType].data[0] |= ( PF | PM ); + if ( nBytes + piDataFrame->piData[piDataType].size < payload->capacity ) + { + memcpy( &payload->buffer[nBytes], piDataFrame->piData[piDataType].data, piDataFrame->piData[piDataType].size ); + nBytes += piDataFrame->piData[piDataType].size; + } + else + { + skipPiData = true; /* Not enough bytes in output for PI data */ + } + numPiDataWritten++; + } + } + } + if ( !skipPiData ) + { + payload->length = nBytes; /* update payload length after PI packing */ + } + } + +err_exit: + /* Pop frames from Queue */ + for ( n = 0; n < numFrame; n++ ) + { + if ( BPOOL_FreeBuffer( hPack->packNodePool, availableFrameNodes[n] ) != IVAS_ERR_OK ) + { + assert( 0 ); /* catastrophic error if this fails */ + return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "frame node could not be freed" ); + } + availableFrameNodes[n] = NULL; + } + + return error; +} + +ivas_error IVAS_RTP_PACK_GetPacket( + IVAS_RTP_PACK_HANDLE hPack, /* i/o : IVAS rtp packer handle */ + IVAS_DATA_BUFFER *packet, /* o : encapsulated rtp packet */ + uint32_t *numFramesInPacket /* o : no. of frames in packet */ +) +{ + ivas_error error = PackRtpHeader( &hPack->header, packet ); + ERR_CHECK_RETURN( error ); + + error = IVAS_RTP_PACK_GetPayload( hPack, packet, numFramesInPacket ); + ERR_CHECK_RETURN( error ); + + UpdateRtpHeader( &hPack->header, ( *numFramesInPacket ) * 320 ); + + return IVAS_ERR_OK; +} + +ivas_error IVAS_RTP_UNPACK_Open( + IVAS_RTP_UNPACK_HANDLE *phUnpack, /* i/o : rtp unpacker handle */ + const IVAS_RTP_UNPACK_CONFIG *config /* i : initial configuration for rtp unpacker */ +) +{ + ivas_error error = IVAS_ERR_OK; + IVAS_RTP_UNPACK_HANDLE hUnpack; + + if ( phUnpack == NULL || config == NULL ) + { + return IVAS_ERR_UNEXPECTED_NULL_POINTER; + } + + *phUnpack = NULL; + if ( ( hUnpack = (IVAS_RTP_UNPACK_HANDLE) calloc( 1, sizeof( struct IVAS_RTP_UNPACK ) ) ) == NULL ) + { + return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Cannot allocate memory for IVAS rtp unpack handle" ); + } + + if ( config->maxFramesPerPacket > IVAS_MAX_FRAMES_PER_RTP_PACKET ) + { + return IVAS_ERROR( IVAS_ERR_WRONG_PARAMS, "Max frame per packet exeeds %d", IVAS_MAX_FRAMES_PER_RTP_PACKET ); + } + + hUnpack->maxNumberOfFrames = ( config->maxFramesPerPacket == 0 ) ? IVAS_MAX_FRAMES_PER_RTP_PACKET : config->maxFramesPerPacket; + hUnpack->maxNumberOfPiData = hUnpack->maxNumberOfFrames * IVAS_PI_MAX_ID; + + error = BPOOL_Create( &hUnpack->unpackNodePool, sizeof( UNPACK_NODE ), hUnpack->maxNumberOfFrames ); + ERR_CHECK_RETURN( error ); + + error = BPOOL_Create( &hUnpack->piDataPool, sizeof( PIDATA_NODE ), hUnpack->maxNumberOfPiData ); + ERR_CHECK_RETURN( error ); + + error = QUEUE_Create( &hUnpack->frameQ ); + ERR_CHECK_RETURN( error ); + + error = QUEUE_Create( &hUnpack->piDataQ ); + ERR_CHECK_RETURN( error ); + + hUnpack->initConfig = *config; + mtx_init( &hUnpack->apilock, 0 ); + + initRequests( hUnpack->requests ); + + *phUnpack = hUnpack; + return IVAS_ERR_OK; +} + +/* Close and free an existing instance of rtp unpacker */ +void IVAS_RTP_UNPACK_Close( + IVAS_RTP_UNPACK_HANDLE *phUnpack /* i/o : IVAS rtp unpacker handle */ +) +{ + IVAS_RTP_UNPACK_HANDLE hUnpack; + + /* Free all memory */ + if ( phUnpack == NULL || *phUnpack == NULL ) + { + return; + } + + hUnpack = *phUnpack; + mtx_destroy( &hUnpack->apilock ); + QUEUE_Destroy( &hUnpack->frameQ ); + QUEUE_Destroy( &hUnpack->piDataQ ); + BPOOL_Destroy( &hUnpack->piDataPool ); + BPOOL_Destroy( &hUnpack->unpackNodePool ); + free( hUnpack->header.extData ); + free( hUnpack ); + *phUnpack = NULL; +} + +static void setEVSRequests( IVAS_RTP_BANDWIDTH bandwidth, uint32_t bitrate, IVAS_RTP_CA_MODE caMode, IVAS_RTP_REQUEST_VALUE *requests ) +{ + requests[IVAS_REQUEST_CODEC].codec = IVAS_RTP_EVS; + requests[IVAS_REQUEST_CA_MODE].caMode = caMode; + requests[IVAS_REQUEST_BITRATE].bitrate = bitrate; + requests[IVAS_REQUEST_BANDWIDTH].bandwidth = bandwidth; +} + +static uint32_t parseInitialEByte( const IVAS_DATA_BUFFER *payload, uint32_t nBytes, IVAS_RTP_REQUEST_VALUE *requests ) +{ + if ( nBytes < payload->length ) + { + uint8_t byte = payload->buffer[nBytes]; + uint8_t EvsIvasIndicator = ( byte & ( ~MASK_4BIT ) ); + uint8_t BR = ( byte & MASK_4BIT ); + + if ( ( byte & EBYTE_TOC_HEADER_BIT ) == 0 ) + { + return nBytes; + } + + nBytes++; /* Consume this e-byte */ + + switch ( EvsIvasIndicator ) + { + case EBYTE_CMR_T_EVS_NB: + if ( BR < 7 ) + { + uint32_t bitrate = evsFrameSizeInBits[BR] * IVAS_NUM_FRAMES_PER_SEC; + setEVSRequests( IVAS_BANDWIDTH_NB, bitrate, IVAS_RTP_CA_NO_REQ, requests ); + } + break; + case EBYTE_CMR_T_EVS_IO: /* AMRWB-IO */ + if ( BR < 9 ) + { + uint32_t bitrate = amrWBIOFrameSizeInBits[BR] * IVAS_NUM_FRAMES_PER_SEC; + setEVSRequests( IVAS_BANDWIDTH_NO_REQ, bitrate, IVAS_RTP_CA_NO_REQ, requests ); + } + break; + case EBYTE_CMR_T_EVS_CA_WB: + if ( BR < 8 ) + { + uint32_t bitrate = 13200; /* Fixed in CA Mode */ + setEVSRequests( IVAS_BANDWIDTH_WB, bitrate, BR, requests ); + } + break; + case EBYTE_CMR_T_EVS_CA_SWB: + if ( BR < 8 ) + { + uint32_t bitrate = 13200; /* Fixed in CA Mode */ + setEVSRequests( IVAS_BANDWIDTH_SWB, bitrate, BR, requests ); + } + break; + case EBYTE_CMR_T_EVS_WB: + if ( BR < 12 ) + { + uint32_t bitrate = evsFrameSizeInBits[BR] * IVAS_NUM_FRAMES_PER_SEC; + setEVSRequests( IVAS_BANDWIDTH_WB, bitrate, IVAS_RTP_CA_NO_REQ, requests ); + } + break; + case EBYTE_CMR_T_EVS_SWB: /* Intentional fall through */ + if ( BR < 12 && BR > 2 ) + { + uint32_t bitrate = evsFrameSizeInBits[BR] * IVAS_NUM_FRAMES_PER_SEC; + setEVSRequests( IVAS_BANDWIDTH_SWB, bitrate, IVAS_RTP_CA_NO_REQ, requests ); + } + break; + case EBYTE_CMR_T_EVS_FB: + if ( BR < 12 && BR > 4 ) + { + uint32_t bitrate = evsFrameSizeInBits[BR] * IVAS_NUM_FRAMES_PER_SEC; + setEVSRequests( IVAS_BANDWIDTH_FB, bitrate, IVAS_RTP_CA_NO_REQ, requests ); + } + break; + case EBYTE_CMR_T_IVAS: /* IVAS */ + if ( BR != 14 ) + { + requests[IVAS_REQUEST_CODEC].codec = IVAS_RTP_IVAS; + requests[IVAS_REQUEST_BITRATE].bitrate = ( BR == 0xF ) ? 0 : ivasFrameSizeInBits[BR] * IVAS_NUM_FRAMES_PER_SEC; + requests[IVAS_REQUEST_CA_MODE].caMode = IVAS_RTP_CA_NO_REQ; + } + break; + } + } + + return nBytes; +} + +static uint32_t parseSubsequentEByte( const IVAS_DATA_BUFFER *payload, uint32_t nBytes, IVAS_RTP_REQUEST_VALUE *requests, bool *piDataIndicated ) +{ + while ( nBytes < payload->length ) + { + uint8_t byte = payload->buffer[nBytes]; +#ifdef RTP_S4_251135_CR26253_0016_REV1 + uint8_t ET = ( byte & ( ~MASK_4BIT ) ); +#else + uint8_t ET = ( byte & ( ~MASK_3BIT ) ); +#endif + + if ( ( byte & EBYTE_TOC_HEADER_BIT ) == 0 ) + { + return nBytes; + } + + nBytes++; /* Consume this e-byte */ + + switch ( ET ) + { + case EBYTE_BANDWIDTH_REQUEST: /* Bandwidth Request */ + { + requests[IVAS_REQUEST_BANDWIDTH].bandwidth = IVAS_BANDWIDTH_WB + ( byte & MASK_2BIT ); + } + break; + case EBYTE_FORMAT_REQUEST: /* Format Request */ + { +#ifdef RTP_S4_251135_CR26253_0016_REV1 + bool S = ( byte >> 3 ) & MASK_1BIT; + if ( S ) + { + /* Use the next byte to extract SubFormat */ + if ( nBytes < payload->length ) + { + byte = payload->buffer[nBytes++]; + requests[IVAS_REQUEST_SUBFORMAT].subFormatType = byte & MASK_6BIT; + } + } +#endif + requests[IVAS_REQUEST_FORMAT].formatType = byte & MASK_3BIT; + } + break; + case EBYTE_PI_INDICATOR: /* PI Indication */ + *piDataIndicated = true; + break; +#ifdef RTP_S4_251135_CR26253_0016_REV1 + case EBYTE_SR_REQUEST: /* Split Rendering Request */ + { + IVAS_RTP_SPLITRENDER *srConfig = &requests[IVAS_REQUEST_SR_CONFIG].srConfig; + srConfig->diegetic = ( byte >> 3 ) & MASK_1BIT; + srConfig->yaw = ( byte >> 2 ) & MASK_1BIT; + srConfig->pitch = ( byte >> 1 ) & MASK_1BIT; + srConfig->roll = byte & MASK_1BIT; + srConfig->valid = true; + } + break; +#endif + default: /* Reserved for future use - unhandled atm */ + break; + } + } + + return nBytes; +} + +#ifdef RTP_S4_251135_CR26253_0016_REV1 +static ivas_error parseToCByte( const IVAS_DATA_BUFFER *payload, uint32_t *numBytes, uint32_t *numFrames, TOC_INFO *toc, uint32_t maxNumberOfToCBytes, uint32_t srCodecFrameSizeMs ) +#else +static ivas_error parseToCByte( const IVAS_DATA_BUFFER *payload, uint32_t *numBytes, uint32_t *numFrames, TOC_INFO *toc, uint32_t maxNumberOfToCBytes ) +#endif +{ + bool headerFollows = true; + uint32_t nBytes = *numBytes; + + *numFrames = 0; + while ( nBytes < payload->length && headerFollows ) + { + uint8_t byte = payload->buffer[nBytes]; + uint8_t BR = byte & MASK_4BIT; + uint8_t FT = byte & ( ( ~MASK_4BIT ) & MASK_6BIT ); + + headerFollows = ( byte & ( ~MASK_6BIT ) ) == TOC_HEADER_FOLLOWS; + + if ( ( byte & EBYTE_TOC_HEADER_BIT ) != 0 ) + { + return IVAS_ERROR( IVAS_ERR_RTP_UNSUPPORTED_FRAME, "Expected ToC byte missing" ); + } + + nBytes++; /* Consume this e-byte */ + + if ( *numFrames == maxNumberOfToCBytes ) + { + return IVAS_ERROR( IVAS_ERR_INTERNAL, "No of frames in packet exceed max defined" ); + } + + *numFrames += 1; + memset( toc, 0, sizeof( *toc ) ); + + if ( FT == TOC_INDICATE_ARMWB_Q || FT == TOC_INDICATE_AMRWB ) + { + toc->codecId = IVAS_RTP_EVS; + toc->isAMRWB_IOmode = true; + toc->speechLostIndicated = ( FT == TOC_INDICATE_ARMWB_Q ) ? true : false; /* Q bit = 0 for AMRWB, BR is valid */ + if ( BR <= 9 ) + { + toc->auNumBits = amrWBIOFrameSizeInBits[BR]; + } + else if ( BR < 14 ) + { + return IVAS_ERROR( IVAS_ERR_RTP_UNSUPPORTED_FRAME, "Reserved bitrate provided in AMRWB ToC" ); + } + else + { + toc->speechLostIndicated = ( BR == 14 ); /* SPEECH_LOST */ + toc->auNumBits = 0; + } + } + else if ( FT == TOC_INDICATE_IVAS ) + { + toc->codecId = IVAS_RTP_IVAS; + if ( BR == 14 ) + { +#ifdef RTP_S4_251135_CR26253_0016_REV1 + /* Read Unconditional SR-ToC byte */ + if ( nBytes < payload->length ) + { + uint8_t SR_BR; + byte = payload->buffer[nBytes++]; + SR_BR = ( byte >> 3 ) & MASK_2BIT; + if ( SR_BR == 0 ) + { + return IVAS_ERROR( IVAS_ERR_RTP_UNSUPPORTED_FRAME, "Reserved bitrate provided in SR ToC" ); + } + toc->srInfo.valid = true; + toc->srInfo.diegetic = ( byte >> 6 ) & MASK_1BIT; + toc->srInfo.codec = IVAS_SR_TRANSPORT_LCLD + ( ( byte >> 5 ) & MASK_1BIT ); + toc->srInfo.bitrateKbps = ( SR_BR + 1 ) * 128000u; + toc->auNumBits = toc->srInfo.bitrateKbps * srCodecFrameSizeMs / 1000; + } + else + { + return IVAS_ERROR( IVAS_ERR_RTP_UNDERFLOW, "Underflow during ToC SR byte" ); + } +#else + /* Reserved bit not expected */ + return IVAS_ERROR( IVAS_ERR_RTP_UNSUPPORTED_FRAME, "Reserved BR idx reported in ToC" ); +#endif + } + else + { + toc->auNumBits = ivasFrameSizeInBits[BR]; + } + } + else /* EVS */ + { + toc->codecId = IVAS_RTP_EVS; + toc->speechLostIndicated = ( FT == TOC_INDICATE_ARMWB_Q ) ? true : false; /* Q bit = 0 for AMRWB, BR is valid */ + if ( BR < 13 ) + { + toc->auNumBits = evsFrameSizeInBits[BR]; + } + else if ( BR == 13 ) + { + return IVAS_ERROR( IVAS_ERR_RTP_UNSUPPORTED_FRAME, "Reserved bitrate provided in EVS ToC" ); + } + else + { + toc->speechLostIndicated = ( BR == 14 ); /* SPEECH_LOST */ + toc->auNumBits = 0; + } + } + + toc++; + + /* Handle any frame specific E-Bytes here currently there are none, so we skip any E-Bytes here after */ + if ( headerFollows ) + { + while ( nBytes < payload->length ) + { + byte = payload->buffer[nBytes]; + if ( ( byte & EBYTE_TOC_HEADER_BIT ) == 0 ) + { + break; + } + nBytes++; + } + } + } + + *numBytes = nBytes; + return IVAS_ERR_OK; +} + +static ivas_error parsePIData( IVAS_RTP_UNPACK_HANDLE hUnpack, uint32_t rtpTimestamp, const IVAS_DATA_BUFFER *payload, uint32_t *numBytes, uint32_t *numPiDataInPacket ) +{ + bool PF = true; + uint32_t nBytes = *numBytes; + + while ( PF ) + { + uint8_t piHeader0, PM, piDataType, byte = 0; + uint32_t piSize = 0; + + if ( nBytes + 1 >= payload->length ) + { + return IVAS_ERROR( IVAS_ERR_RTP_UNDERFLOW, "Underflow during expected PI Header read" ); + } + + piHeader0 = payload->buffer[nBytes++]; + + PF = ( piHeader0 >> 7 ) & MASK_1BIT; /* New PI header follows this PI Data Frame */ + PM = ( piHeader0 & ( ~MASK_5BIT ) ) & MASK_7BIT; /* PI Marker Bits */ + piDataType = ( piHeader0 & MASK_5BIT ); + + do + { + byte = payload->buffer[nBytes++]; + piSize += byte; + if ( nBytes >= payload->length ) + { + return IVAS_ERROR( IVAS_ERR_RTP_UNDERFLOW, "Underflow during reading piSize" ); + } + } while ( byte == 255 ); + + if ( piDataType == IVAS_PI_NO_DATA ) + { + if ( piSize > 0 ) + { + return IVAS_ERROR( IVAS_ERR_RTP_UNPACK_PI_DATA, "NO_PI_DATA should be 0 sized" ); + } + + /* Do not add a node for NO_DATA */ + } + else if ( nBytes + piSize <= payload->length ) + { + PIDATA_NODE *node = NULL; + ivas_error error = BPOOL_GetBuffer( hUnpack->piDataPool, (void **) &node ); + ERR_CHECK_RETURN( error ); + + node->next = NULL; + + error = PI_UnPackData( piDataType, piSize, &payload->buffer[nBytes], (IVAS_PIDATA_GENERIC *) &node->data ); + ERR_CHECK_RETURN( error ); + + node->timestamp = rtpTimestamp; + + nBytes += piSize; + *numPiDataInPacket += 1; + + QUEUE_Push( hUnpack->piDataQ, (NODE *) node ); + } + else + { + return IVAS_ERROR( IVAS_ERR_RTP_UNDERFLOW, "Underflow during reading pi data" ); + } + + if ( PM == PI_HEADER_PM_LAST ) + { + rtpTimestamp += 16000 / IVAS_NUM_FRAMES_PER_SEC; + } + } + + *numBytes = nBytes; + return IVAS_ERR_OK; +} + +ivas_error IVAS_RTP_UNPACK_PushPayload( + IVAS_RTP_UNPACK_HANDLE hUnpack, /* i/o : IVAS rtp unpacker handle */ + const IVAS_DATA_BUFFER *payload, /* i : received rtp payload */ + uint32_t timestamp, /* i : timestamp in RTP Clock @ 16KHz from rtp header */ + uint16_t sequenceNumber, /* i : sequence number from rtp header */ + uint32_t *numFramesInPacket, /* o : number of IVAS/EVS frames in rtp packet */ + uint32_t *numPiDataInPacket, /* o : number of PI data received in rtp packet */ + uint32_t *remoteRequestBitmap /* o : bitmap of available request in this packet */ +) +{ + ivas_error error = IVAS_ERR_OK; + uint32_t nBytes = 0, numFrames = 0, numPiData = 0, n; + bool piDataIndicated = false; + TOC_INFO toc[IVAS_MAX_FRAMES_PER_RTP_PACKET]; + + IVAS_RTP_REQUEST_VALUE oldRequests[IVAS_REQUEST_MAX]; + + if ( hUnpack == NULL || payload == NULL ) + { + return IVAS_ERR_UNEXPECTED_NULL_POINTER; + } + + if ( remoteRequestBitmap != NULL ) + { + *remoteRequestBitmap = 0; + } + + if ( numFramesInPacket != NULL ) + { + *numFramesInPacket = 0; + } + + if ( numPiDataInPacket != NULL ) + { + *numPiDataInPacket = 0; + } + + /* Sanity check if any frame or PI data from last packet is still not pulled */ + if ( QUEUE_Size( hUnpack->frameQ ) > 0 || QUEUE_Size( hUnpack->piDataQ ) > 0 ) + { + assert( 0 ); + return IVAS_ERROR( IVAS_ERR_INTERNAL, "Previous packet data should be consumed before next packet is pushed" ); + } + + memcpy( oldRequests, hUnpack->requests, sizeof( oldRequests ) ); + + /* Unpack IVAS Payload, starting with the E-Bytes */ + nBytes = parseInitialEByte( payload, nBytes, hUnpack->requests ); + + /* Unpack any subsequent E-bytes */ + nBytes = parseSubsequentEByte( payload, nBytes, hUnpack->requests, &piDataIndicated ); + + /* Unpack the ToC Bytes => Extract number of frames in packet */ + +#ifdef RTP_S4_251135_CR26253_0016_REV1 + error = parseToCByte( payload, &nBytes, &numFrames, toc, sizeof( toc ) / sizeof( toc[0] ), hUnpack->initConfig.srCodecFrameSizeMs ); +#else + error = parseToCByte( payload, &nBytes, &numFrames, toc, sizeof( toc ) / sizeof( toc[0] ) ); +#endif + ERR_CHECK_RETURN( error ); + + /* Read frame bits */ + for ( n = 0; n < numFrames; n++ ) + { + uint32_t frameSizeBytes; + UNPACK_NODE *node = NULL; + + /* Get a new node */ + error = BPOOL_GetBuffer( hUnpack->unpackNodePool, (void **) &node ); + ERR_CHECK_RETURN( error ); + + node->next = NULL; + node->timestamp = timestamp + ( n * 320 ); + node->seqNumber = sequenceNumber; + node->toc = toc[n]; + + frameSizeBytes = ( node->toc.auNumBits + 7 ) / 8; + if ( nBytes + frameSizeBytes <= payload->length ) + { + memcpy( node->au, &payload->buffer[nBytes], frameSizeBytes ); + nBytes += frameSizeBytes; + } + else + { + return IVAS_ERROR( IVAS_ERR_RTP_UNDERFLOW, "Underflow during expected frame bits" ); + } + + /* Add to frames FiFo */ + QUEUE_Push( hUnpack->frameQ, (NODE *) node ); + } + + if ( piDataIndicated ) + { + error = parsePIData( hUnpack, timestamp, payload, &nBytes, &numPiData ); + if ( error != IVAS_ERR_OK ) + { + /* PI Parsing errors are not fatal => indicate no PI data in packet as workaround */ + numPiData = 0; + } + } + + if ( numFramesInPacket != NULL ) + { + *numFramesInPacket = numFrames; + } + + if ( numPiDataInPacket ) + { + *numPiDataInPacket = numPiData; + } + + if ( remoteRequestBitmap ) + { + for ( n = 0; n < IVAS_REQUEST_MAX; n++ ) + { + bool changed = ( memcmp( &hUnpack->requests[n], &oldRequests[n], sizeof( IVAS_RTP_REQUEST_VALUE ) ) != 0 ); + *remoteRequestBitmap |= changed ? ( 1u << n ) : 0; + } + } + + return IVAS_ERR_OK; +} + +ivas_error IVAS_RTP_UNPACK_PushPacket( + IVAS_RTP_UNPACK_HANDLE hUnpack, /* i/o : IVAS rtp unpacker handle */ + const IVAS_DATA_BUFFER *packet, /* i : received rtp Packet */ + uint32_t *numFramesInPacket, /* o : number of IVAS/EVS frames in rtp packet */ + uint32_t *numPiDataInPacket, /* o : number of PI data received in rtp packet */ + uint32_t *remoteRequestBitmap /* o : bitmap of available request in this packet */ +) +{ + ivas_error error = IVAS_ERR_OK; + uint32_t numHeaderBytes = 0; + IVAS_DATA_BUFFER payload; + + error = UnpackRtpPacket( packet, &hUnpack->header, &numHeaderBytes ); + ERR_CHECK_RETURN( error ); + + /* Offset to RTP Payload */ + payload.capacity = packet->capacity; + payload.buffer = packet->buffer + numHeaderBytes; + payload.length = packet->length - numHeaderBytes; + + return IVAS_RTP_UNPACK_PushPayload( + hUnpack, + &payload, + hUnpack->header.timestamp, + hUnpack->header.seqNumber, + numFramesInPacket, + numPiDataInPacket, + remoteRequestBitmap ); +} + +ivas_error IVAS_RTP_UNPACK_GetRequest( + IVAS_RTP_UNPACK_HANDLE hUnpack, /* i/o : IVAS rtp packer handle */ + IVAS_RTP_REQUEST_TYPE type, /* i : remote request type */ + IVAS_RTP_REQUEST_VALUE *value /* o : pointer of the requested type */ +) +{ + if ( type < 0 || type >= IVAS_REQUEST_MAX ) + { + return IVAS_ERROR( IVAS_ERR_WRONG_PARAMS, "Invalid request key provided" ); + } + *value = hUnpack->requests[type]; + return IVAS_ERR_OK; +} + +ivas_error IVAS_RTP_UNPACK_PullFrame( + IVAS_RTP_UNPACK_HANDLE hUnpack, /* i/o : IVAS rtp unpacker handle */ + IVAS_RTP_CODEC *receivedCodecId, /* o : Codec type (IVAS/EVS) */ +#ifdef RTP_S4_251135_CR26253_0016_REV1 + IVAS_RTP_SR_INFO *srInfo, /* o : Split Rendering Info */ +#endif /* RTP_S4_251135_CR26253_0016_REV1 */ + IVAS_DATA_BUFFER *frameBuffer, /* o : packed frame bitstream for IVAS/EVS */ + int16_t *frameSizeInBits, /* o : exact frame size in bits (AMRWB IO) */ + uint32_t *timestamp, /* o : timestamp in RTP Clock @ 16KHz */ + uint16_t *sequenceNumber, /* o : sequence number from rtp header */ + bool *speechLostIndicated, /* o : Is current frame indicated as Lost */ + bool *isAMRWB_IOmode /* o : Is AMRWB_IO mode EVS frame */ +) +{ + size_t length = 0; + UNPACK_NODE *node = (UNPACK_NODE *) QUEUE_Pop( hUnpack->frameQ ); + + /* Check if a node is available in FiFo */ + if ( node == NULL ) + { + return IVAS_ERROR( IVAS_ERR_RTP_UNDERFLOW, "No more frames in unpack fifo" ); + } + + length = ( node->toc.auNumBits + 7 ) / 8; + if ( frameBuffer != NULL && ( length <= frameBuffer->capacity ) ) + { + memcpy( frameBuffer->buffer, node->au, length ); + frameBuffer->length = length; + } + + if ( frameSizeInBits != NULL ) + { + *frameSizeInBits = (int16_t) node->toc.auNumBits; + } + + if ( receivedCodecId != NULL ) + { + *receivedCodecId = node->toc.codecId; + } + +#ifdef RTP_S4_251135_CR26253_0016_REV1 + if ( srInfo != NULL ) + { + *srInfo = node->toc.srInfo; + } +#endif /* RTP_S4_251135_CR26253_0016_REV1 */ + + if ( timestamp != NULL ) + { + *timestamp = node->timestamp; + } + + if ( sequenceNumber != NULL ) + { + *sequenceNumber = node->seqNumber; + } + + if ( speechLostIndicated != NULL ) + { + *speechLostIndicated = node->toc.speechLostIndicated; + } + + if ( isAMRWB_IOmode != NULL ) + { + *isAMRWB_IOmode = node->toc.isAMRWB_IOmode; + } + + return BPOOL_FreeBuffer( hUnpack->unpackNodePool, node ); +} + +ivas_error IVAS_RTP_UNPACK_PullNextPiData( + IVAS_RTP_UNPACK_HANDLE hUnpack, /* i/o : IVAS rtp unpacker handle */ + IVAS_PIDATA_GENERIC *data, /* o : output data buffer for the Pi data */ + size_t capacity, /* i : capacity of pi data buffer in bytes */ + uint32_t *timestamp /* o : timestamp in RTP Clock @ 16KHz */ +) +{ + IVAS_PIDATA_GENERIC *pi = NULL; + PIDATA_NODE *node = (PIDATA_NODE *) QUEUE_Pop( hUnpack->piDataQ ); + + /* Check if a node is available in FiFo */ + if ( node == NULL ) + { + return IVAS_ERROR( IVAS_ERR_RTP_UNDERFLOW, "No more pi data in unpack fifo" ); + } + + pi = (IVAS_PIDATA_GENERIC *) &node->data; + + if ( data != NULL && ( pi->size <= capacity ) ) + { + memcpy( data, pi, pi->size ); + } + + if ( timestamp != NULL ) + { + *timestamp = node->timestamp; + } + + return BPOOL_FreeBuffer( hUnpack->piDataPool, node ); +} + +#endif /* IVAS_RTPDUMP */ diff --git a/lib_util/ivas_rtp_pi_data.c b/lib_util/ivas_rtp_pi_data.c new file mode 100644 index 0000000000000000000000000000000000000000..8db9d41f9df241e317cdcf606e0fcc682c4a0a8c --- /dev/null +++ b/lib_util/ivas_rtp_pi_data.c @@ -0,0 +1,849 @@ +/****************************************************************************************************** + + (C) 2022-2025 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB, + Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., + Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, + Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other + contributors to this repository. All Rights Reserved. + + This software is protected by copyright law and by international treaties. + The IVAS codec Public Collaboration consisting of Dolby International AB, Ericsson AB, + Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., + Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, + Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other + contributors to this repository retain full ownership rights in their respective contributions in + the software. This notice grants no license of any kind, including but not limited to patent + license, nor is any license granted by implication, estoppel or otherwise. + + Contributors are required to enter into the IVAS codec Public Collaboration agreement before making + contributions. + + This software is provided "AS IS", without any express or implied warranties. The software is in the + development stage. It is intended exclusively for experts who have experience with such software and + solely for the purpose of inspection. All implied warranties of non-infringement, merchantability + and fitness for a particular purpose are hereby disclaimed and excluded. + + Any dispute, controversy or claim arising under or in relation to providing this software shall be + submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in + accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and + the United Nations Convention on Contracts on the International Sales of Goods. + +*******************************************************************************************************/ + +#include "ivas_error_utils.h" +#include "ivas_rtp_internal.h" + +#ifdef IVAS_RTPDUMP + +/* Generic PI data packing/unpacking functions */ +typedef ivas_error ( *PACK_PI_FN )( const IVAS_PIDATA_GENERIC *piData, uint8_t *buffer, uint32_t maxDataBytes, uint32_t *nBytesWritten ); +typedef ivas_error ( *UNPACK_PI_FN )( const uint8_t *buffer, uint32_t numDataBytes, IVAS_PIDATA_GENERIC *piData ); + +static __inline uint32_t writeInt16( uint8_t *buffer, uint32_t idx, int16_t val ) +{ + buffer[idx++] = (uint8_t) ( val >> 8 ); + buffer[idx++] = (uint8_t) ( val & 0x00FF ); + return idx; +} + +static __inline int16_t readInt16( const uint8_t *buffer ) +{ + return (int16_t) ( (uint16_t) buffer[0] << 8 ) | ( (uint16_t) buffer[1] ); +} + +/*-----------------------------------------------------------------------* + * ivasPayload_convertToQ15() + * + * Convert a float value into a Q15 encoded value. + *-----------------------------------------------------------------------*/ +static int16_t ivasPayload_convertToQ15( float value ) +{ + value = ( value * 32768.0f ); + value = value > +32767.0f ? +32767.0f : value; + value = value < -32768.0f ? -32768.0f : value; + return (int16_t) ( value ); +} + +static ivas_error packUnsupportedData( const IVAS_PIDATA_GENERIC *piData, uint8_t *buffer, uint32_t maxDataBytes, uint32_t *nBytesWritten ) +{ + (void) piData; + (void) buffer; + (void) maxDataBytes; + /* Skip packing */ + *nBytesWritten = 0; + return IVAS_ERR_OK; +} + +static ivas_error unpackUnsupportedData( const uint8_t *buffer, uint32_t numDataBytes, IVAS_PIDATA_GENERIC *piData ) +{ + (void) piData; + (void) buffer; + (void) numDataBytes; + /* Skip unpacking */ + return IVAS_ERR_OK; +} + +static ivas_error packNoPiData( const IVAS_PIDATA_GENERIC *piData, uint8_t *buffer, uint32_t maxDataBytes, uint32_t *nBytesWritten ) +{ + uint32_t nBytes = 0; + (void) piData; + + *nBytesWritten = 0; + + /* NO_PI_DATA is just PI header with no data */ + if ( maxDataBytes < 2 ) + { + return IVAS_ERROR( IVAS_ERR_RTP_INSUFFICIENT_OUTPUT_SIZE, "Insufficient space in PI data buffer for NO_PI_DATA" ); + } + + buffer[nBytes++] = ( IVAS_PI_NO_DATA ); /* PF/PM populated during final packing */ + buffer[nBytes++] = 0; /* NO_PI_DATA is 0 bytes */ + + *nBytesWritten = nBytes; + return IVAS_ERR_OK; +} + +static ivas_error unpackNoPiData( const uint8_t *buffer, uint32_t numDataBytes, IVAS_PIDATA_GENERIC *piData ) +{ + (void) buffer; + + if ( numDataBytes != 0 ) + { + return IVAS_ERROR( IVAS_ERR_RTP_UNPACK_PI_DATA, "NO_PI_DATA must be 0 byte" ); + } + + piData->size = sizeof( IVAS_PIDATA_NO_DATA ); + return IVAS_ERR_OK; +} + +static ivas_error packOrientation( const IVAS_PIDATA_GENERIC *piData, uint8_t *buffer, uint32_t maxDataBytes, uint32_t *nBytesWritten ) +{ + uint32_t nBytes = 0; + const IVAS_PIDATA_ORIENTATION *orientation = (const IVAS_PIDATA_ORIENTATION *) piData; + + *nBytesWritten = 0; + + if ( piData->size != sizeof( IVAS_PIDATA_ORIENTATION ) ) + { + return IVAS_ERROR( IVAS_ERR_WRONG_PARAMS, "Incorrect size in Orientation PI data" ); + } + + if ( ( piData->piDataType != IVAS_PI_SCENE_ORIENTATION ) && ( piData->piDataType != IVAS_PI_DEVICE_ORIENTATION_COMPENSATED ) && ( piData->piDataType != IVAS_PI_DEVICE_ORIENTATION_UNCOMPENSATED ) +#ifdef RTP_S4_251135_CR26253_0016_REV1 + && ( piData->piDataType != IVAS_PI_PLAYBACK_DEVICE_ORIENTATION ) && ( piData->piDataType != IVAS_PI_HEAD_ORIENTATION ) +#endif /* RTP_S4_251135_CR26253_0016_REV1 */ + ) + { + return IVAS_ERROR( IVAS_ERR_WRONG_PARAMS, "Incorrect PI ID in Orientation PI data" ); + } + + /* Orientation data is 8 bytes, header is 2 bytes */ + if ( maxDataBytes < 8 + 2 ) + { + return IVAS_ERROR( IVAS_ERR_RTP_INSUFFICIENT_OUTPUT_SIZE, "Insufficient space to pack Orientation PI data" ); + } + + buffer[nBytes++] = ( orientation->piDataType & MASK_5BIT ); /* PF/PM populated during final packing */ + buffer[nBytes++] = 8; + nBytes = writeInt16( buffer, nBytes, ivasPayload_convertToQ15( orientation->orientation.w ) ); + nBytes = writeInt16( buffer, nBytes, ivasPayload_convertToQ15( orientation->orientation.x ) ); + nBytes = writeInt16( buffer, nBytes, ivasPayload_convertToQ15( orientation->orientation.y ) ); + nBytes = writeInt16( buffer, nBytes, ivasPayload_convertToQ15( orientation->orientation.z ) ); + + *nBytesWritten = nBytes; + return IVAS_ERR_OK; +} + +static ivas_error unpackOrientation( const uint8_t *buffer, uint32_t numDataBytes, IVAS_PIDATA_GENERIC *piData ) +{ + IVAS_PIDATA_ORIENTATION *orientation = (IVAS_PIDATA_ORIENTATION *) piData; + + /* Orientation data is 8 bytes */ + if ( numDataBytes != 8 ) + { + return IVAS_ERROR( IVAS_ERR_RTP_UNPACK_PI_DATA, "Incorrect size to unpack Orientation PI data" ); + } + + piData->size = sizeof( IVAS_PIDATA_ORIENTATION ); + orientation->orientation.w = FLOAT_FROM_Q15( readInt16( &buffer[0] ) ); + orientation->orientation.x = FLOAT_FROM_Q15( readInt16( &buffer[2] ) ); + orientation->orientation.y = FLOAT_FROM_Q15( readInt16( &buffer[4] ) ); + orientation->orientation.z = FLOAT_FROM_Q15( readInt16( &buffer[6] ) ); + + return IVAS_ERR_OK; +} + +static uint32_t getIndexTable( const float *table, uint32_t tableLength, float value ) +{ + uint32_t idx = 0; + if ( value <= table[0] ) + { + return 0; + } + + for ( idx = 1; idx < tableLength; idx++ ) + { + if ( value < table[idx] ) + { + break; + } + } + return idx - 1; +} + +#define GET_IDX( table, nBits, value ) getIndexTable( table, ( 1u << ( nBits ) ), ( value ) ) + +static ivas_error packAcousticEnvironment( const IVAS_PIDATA_GENERIC *piData, uint8_t *buffer, uint32_t maxDataBytes, uint32_t *nBytesWritten ) +{ + uint32_t nBytes = 0; + uint8_t packedSize = 1; + const IVAS_PIDATA_ACOUSTIC_ENV *aeEnv = (const IVAS_PIDATA_ACOUSTIC_ENV *) piData; + + *nBytesWritten = 0; + + if ( piData->size != sizeof( IVAS_PIDATA_ACOUSTIC_ENV ) ) + { + return IVAS_ERROR( IVAS_ERR_WRONG_PARAMS, "Incorrect size in PI data of type Acoustic Environment" ); + } + + if ( aeEnv->availEarlyReflections ) + { + packedSize = 8; + } + else if ( aeEnv->availLateReverb ) + { + packedSize = 5; + } + + /* Acoustic Env data is packedSize bytes, header is 2 bytes */ + if ( maxDataBytes < (uint32_t) packedSize + 2 ) + { + return IVAS_ERROR( IVAS_ERR_WRONG_PARAMS, "Insufficient space to pack Orientation PI data" ); + } + + buffer[nBytes++] = ( IVAS_PI_ACOUSTIC_ENVIRONMENT ); /* PF/PM populated during final packing */ + buffer[nBytes++] = packedSize; + + if ( packedSize == 1 ) + { + buffer[nBytes++] = aeEnv->aeid & 0x7F; + } + else + { + uint64_t dWord = (uint64_t) aeEnv->aeid << 57; + + dWord |= (uint64_t) GET_IDX( mapRT60, NBITS_RT60, aeEnv->rt60[IVAS_PI_AE_LOW] ) << 52; + dWord |= (uint64_t) GET_IDX( mapDSR, NBITS_DSR, aeEnv->dsr[IVAS_PI_AE_LOW] ) << 46; + dWord |= (uint64_t) GET_IDX( mapRT60, NBITS_RT60, aeEnv->rt60[IVAS_PI_AE_MID] ) << 41; + dWord |= (uint64_t) GET_IDX( mapDSR, NBITS_DSR, aeEnv->dsr[IVAS_PI_AE_MID] ) << 35; + dWord |= (uint64_t) GET_IDX( mapRT60, NBITS_RT60, aeEnv->rt60[IVAS_PI_AE_HIGH] ) << 30; + dWord |= (uint64_t) GET_IDX( mapDSR, NBITS_DSR, aeEnv->dsr[IVAS_PI_AE_HIGH] ) << 24; + + buffer[nBytes++] = (uint8_t) ( dWord >> 56 ); + buffer[nBytes++] = (uint8_t) ( dWord >> 48 ); + buffer[nBytes++] = (uint8_t) ( dWord >> 40 ); + buffer[nBytes++] = (uint8_t) ( dWord >> 32 ); + buffer[nBytes++] = (uint8_t) ( dWord >> 24 ); + + if ( packedSize > 5 ) + { + dWord |= (uint64_t) GET_IDX( mapRoomDims, NBITS_DIM, aeEnv->roomDimensions.x ) << 20; + dWord |= (uint64_t) GET_IDX( mapRoomDims, NBITS_DIM, aeEnv->roomDimensions.y ) << 16; + dWord |= (uint64_t) GET_IDX( mapRoomDims, NBITS_DIM, aeEnv->roomDimensions.z ) << 12; + dWord |= (uint64_t) GET_IDX( mapAbsorbtion, NBITS_ABS, aeEnv->absorbCoeffs[IVAS_PI_AE_FRONT] ) << 10; + dWord |= (uint64_t) GET_IDX( mapAbsorbtion, NBITS_ABS, aeEnv->absorbCoeffs[IVAS_PI_AE_BACK] ) << 8; + dWord |= (uint64_t) GET_IDX( mapAbsorbtion, NBITS_ABS, aeEnv->absorbCoeffs[IVAS_PI_AE_LEFT] ) << 6; + dWord |= (uint64_t) GET_IDX( mapAbsorbtion, NBITS_ABS, aeEnv->absorbCoeffs[IVAS_PI_AE_RIGHT] ) << 4; + dWord |= (uint64_t) GET_IDX( mapAbsorbtion, NBITS_ABS, aeEnv->absorbCoeffs[IVAS_PI_AE_CEILING] ) << 2; + dWord |= (uint64_t) GET_IDX( mapAbsorbtion, NBITS_ABS, aeEnv->absorbCoeffs[IVAS_PI_AE_FLOOR] ); + + buffer[nBytes++] = (uint8_t) ( dWord >> 16 ); + buffer[nBytes++] = (uint8_t) ( dWord >> 8 ); + buffer[nBytes++] = (uint8_t) ( dWord ); + } + } + + *nBytesWritten = nBytes; + return IVAS_ERR_OK; +} + +static ivas_error unpackAcousticEnvironment( const uint8_t *buffer, uint32_t numDataBytes, IVAS_PIDATA_GENERIC *piData ) +{ + IVAS_PIDATA_ACOUSTIC_ENV *aeEnv = (IVAS_PIDATA_ACOUSTIC_ENV *) piData; + + /* Acooustic Env data is either 1, 5 or 8 bytes */ + if ( numDataBytes != 1 && numDataBytes != 5 && numDataBytes != 8 ) + { + return IVAS_ERROR( IVAS_ERR_RTP_UNPACK_PI_DATA, "Incorrect size to unpack PI data of type Acoustic Environment" ); + } + + piData->size = sizeof( IVAS_PIDATA_ACOUSTIC_ENV ); + aeEnv->availLateReverb = ( numDataBytes >= 5 ); + aeEnv->availEarlyReflections = ( numDataBytes == 8 ); + + if ( numDataBytes == 1 ) + { + aeEnv->aeid = buffer[0]; + } + else + { + uint64_t dWord = 0ull; + uint32_t n; + for ( n = 0; n < numDataBytes; n++ ) + { + dWord <<= 8; + dWord |= buffer[n]; + } + dWord <<= ( 8 - numDataBytes ) * 8; + + aeEnv->aeid = (uint8_t) ( ( dWord >> 57 ) & MASK_AEID ); + aeEnv->rt60[IVAS_PI_AE_LOW] = mapRT60[( dWord >> 52 ) & MASK_RT60]; + aeEnv->dsr[IVAS_PI_AE_LOW] = mapDSR[( dWord >> 46 ) & MASK_DSR]; + aeEnv->rt60[IVAS_PI_AE_MID] = mapRT60[( dWord >> 41 ) & MASK_RT60]; + aeEnv->dsr[IVAS_PI_AE_MID] = mapDSR[( dWord >> 35 ) & MASK_DSR]; + aeEnv->rt60[IVAS_PI_AE_HIGH] = mapRT60[( dWord >> 30 ) & MASK_RT60]; + aeEnv->dsr[IVAS_PI_AE_HIGH] = mapDSR[( dWord >> 24 ) & MASK_DSR]; + + aeEnv->roomDimensions.x = mapRoomDims[( dWord >> 20 ) & MASK_DIM]; + aeEnv->roomDimensions.y = mapRoomDims[( dWord >> 16 ) & MASK_DIM]; + aeEnv->roomDimensions.z = mapRoomDims[( dWord >> 12 ) & MASK_DIM]; + + aeEnv->absorbCoeffs[IVAS_PI_AE_FRONT] = mapAbsorbtion[( dWord >> 10 ) & MASK_ABS]; + aeEnv->absorbCoeffs[IVAS_PI_AE_BACK] = mapAbsorbtion[( dWord >> 8 ) & MASK_ABS]; + aeEnv->absorbCoeffs[IVAS_PI_AE_LEFT] = mapAbsorbtion[( dWord >> 6 ) & MASK_ABS]; + aeEnv->absorbCoeffs[IVAS_PI_AE_RIGHT] = mapAbsorbtion[( dWord >> 4 ) & MASK_ABS]; + aeEnv->absorbCoeffs[IVAS_PI_AE_CEILING] = mapAbsorbtion[( dWord >> 2 ) & MASK_ABS]; + aeEnv->absorbCoeffs[IVAS_PI_AE_FLOOR] = mapAbsorbtion[( dWord >> 0 ) & MASK_ABS]; + } + + return IVAS_ERR_OK; +} + +#ifdef RTP_S4_251135_CR26253_0016_REV1 +static ivas_error packAudioDescription( const IVAS_PIDATA_GENERIC *piData, uint8_t *buffer, uint32_t maxDataBytes, uint32_t *nBytesWritten ) +{ + uint32_t n; + uint32_t nBytes = 0; + const IVAS_PIDATA_AUDIO_DESC *audioDesc = (const IVAS_PIDATA_AUDIO_DESC *) piData; + uint32_t packedSize = audioDesc->nValidEntries; /* Each Entry is 1 byte */ + + *nBytesWritten = 0; + + if ( audioDesc->nValidEntries > ( IVAS_MAX_NUM_OBJECTS + 1 ) ) + { + return IVAS_ERROR( IVAS_ERR_RTP_UNSUPPORTED_FRAME, "Audio Description cannot have more than 5 entries" ); + } + + /* Audio Description data is max 5 bytes, 2 bytes header */ + if ( maxDataBytes < packedSize + 2 ) + { + return IVAS_ERROR( IVAS_ERR_RTP_INSUFFICIENT_OUTPUT_SIZE, "Insufficient space in Audio Description PI data buffer" ); + } + + buffer[nBytes++] = ( IVAS_PI_AUDIO_DESCRIPTION ); /* PF/PM populated during final packing */ + buffer[nBytes++] = (uint8_t) packedSize; + + for ( n = 0; n < audioDesc->nValidEntries; n++ ) + { + buffer[nBytes++] = ( audioDesc->audioId[n].speech ? PI_AD_SPEECH_INDICATED : 0 ) | + ( audioDesc->audioId[n].music ? PI_AD_MUSIC_INDICATED : 0 ) | + ( audioDesc->audioId[n].ambiance ? PI_AD_AMBIANCE_INDICATED : 0 ) | + ( audioDesc->audioId[n].editable ? PI_AD_EDITABLE_INDICATED : 0 ) | + ( audioDesc->audioId[n].binaural ? PI_AD_BINAURAL_INDICATED : 0 ); + } + + *nBytesWritten = nBytes; + return IVAS_ERR_OK; +} + +static ivas_error unpackAudioDescription( const uint8_t *buffer, uint32_t numDataBytes, IVAS_PIDATA_GENERIC *piData ) +{ + uint32_t n; + IVAS_PIDATA_AUDIO_DESC *audioDesc = (IVAS_PIDATA_AUDIO_DESC *) piData; + + /* Audio Description data is max 5 bytes */ + if ( numDataBytes > ( IVAS_MAX_NUM_OBJECTS + 1 ) ) + { + return IVAS_ERROR( IVAS_ERR_RTP_UNPACK_PI_DATA, "Incorrect size to unpack Orientation PI data" ); + } + + audioDesc->size = sizeof( IVAS_PIDATA_AUDIO_DESC ); + audioDesc->nValidEntries = numDataBytes; + audioDesc->piDataType = IVAS_PI_AUDIO_DESCRIPTION; + + for ( n = 0; n < audioDesc->nValidEntries; n++ ) + { + audioDesc->audioId[n].speech = ( buffer[n] & PI_AD_SPEECH_INDICATED ) != 0; + audioDesc->audioId[n].music = ( buffer[n] & PI_AD_MUSIC_INDICATED ) != 0; + audioDesc->audioId[n].ambiance = ( buffer[n] & PI_AD_AMBIANCE_INDICATED ) != 0; + audioDesc->audioId[n].editable = ( buffer[n] & PI_AD_EDITABLE_INDICATED ) != 0; + audioDesc->audioId[n].binaural = ( buffer[n] & PI_AD_BINAURAL_INDICATED ) != 0; + } + + return IVAS_ERR_OK; +} + +static ivas_error packDynamicSuppression( const IVAS_PIDATA_GENERIC *piData, uint8_t *buffer, uint32_t maxDataBytes, uint32_t *nBytesWritten ) +{ + uint32_t nBytes = 0; + const IVAS_PIDATA_DYNAMIC_SUPPRESSION *das = (const IVAS_PIDATA_DYNAMIC_SUPPRESSION *) piData; + + *nBytesWritten = 0; + + /* Dynamic Audio Suppression data is 2 bytes, 2 bytes header */ + if ( maxDataBytes < 2 + 2 ) + { + return IVAS_ERROR( IVAS_ERR_RTP_INSUFFICIENT_OUTPUT_SIZE, "Insufficient space in DAS PI data buffer" ); + } + + buffer[nBytes++] = ( das->piDataType & MASK_5BIT ); /* PF/PM populated during final packing */ + buffer[nBytes++] = 2u; + + buffer[nBytes++] = ( das->speech ? PI_AD_SPEECH_INDICATED : 0 ) | + ( das->music ? PI_AD_MUSIC_INDICATED : 0 ) | + ( das->ambiance ? PI_AD_AMBIANCE_INDICATED : 0 ); + buffer[nBytes++] = ( (uint8_t) das->sli & MASK_4BIT ) << 4; + + *nBytesWritten = nBytes; + return IVAS_ERR_OK; +} + +static ivas_error unpackDynamicSuppression( const uint8_t *buffer, uint32_t numDataBytes, IVAS_PIDATA_GENERIC *piData ) +{ + IVAS_PIDATA_DYNAMIC_SUPPRESSION *das = (IVAS_PIDATA_DYNAMIC_SUPPRESSION *) piData; + + /* Dynamic Suppression data is 2 bytes */ + if ( numDataBytes != 2 ) + { + return IVAS_ERROR( IVAS_ERR_RTP_UNPACK_PI_DATA, "Incorrect size to unpack DAS PI data" ); + } + + das->size = sizeof( IVAS_PIDATA_AUDIO_DESC ); + das->speech = ( buffer[0] & PI_AD_SPEECH_INDICATED ) != 0; + das->music = ( buffer[0] & PI_AD_MUSIC_INDICATED ) != 0; + das->ambiance = ( buffer[0] & PI_AD_AMBIANCE_INDICATED ) != 0; + das->sli = ( buffer[1] >> 4 ); + + return IVAS_ERR_OK; +} + +static ivas_error packListenerPosition( const IVAS_PIDATA_GENERIC *piData, uint8_t *buffer, uint32_t maxDataBytes, uint32_t *nBytesWritten ) +{ + uint32_t nBytes = 0; + const IVAS_PIDATA_LISTENER_POSITION *listener = (const IVAS_PIDATA_LISTENER_POSITION *) piData; + + *nBytesWritten = 0; + + if ( piData->size != sizeof( IVAS_PIDATA_LISTENER_POSITION ) ) + { + return IVAS_ERROR( IVAS_ERR_WRONG_PARAMS, "Incorrect size in LISTENER POSITION PI data" ); + } + + if ( piData->piDataType != IVAS_PI_LISTENER_POSITION ) + { + return IVAS_ERROR( IVAS_ERR_WRONG_PARAMS, "Incorrect PI ID in LISTENER POSITION PI data" ); + } + + /* Position data is 6 bytes, header is 2 bytes */ + if ( maxDataBytes < 6 + 2 ) + { + return IVAS_ERROR( IVAS_ERR_RTP_INSUFFICIENT_OUTPUT_SIZE, "Insufficient space to pack LISTENER POSITION PI data" ); + } + + buffer[nBytes++] = ( listener->piDataType & MASK_5BIT ); /* PF/PM populated during final packing */ + buffer[nBytes++] = 6; + nBytes = writeInt16( buffer, nBytes, ivasPayload_convertToQ15( listener->position.x / MAX_PI_POSITION_METERS ) ); + nBytes = writeInt16( buffer, nBytes, ivasPayload_convertToQ15( listener->position.y / MAX_PI_POSITION_METERS ) ); + nBytes = writeInt16( buffer, nBytes, ivasPayload_convertToQ15( listener->position.z / MAX_PI_POSITION_METERS ) ); + *nBytesWritten = nBytes; + return IVAS_ERR_OK; +} + +static ivas_error unpackListenerPosition( const uint8_t *buffer, uint32_t numDataBytes, IVAS_PIDATA_GENERIC *piData ) +{ + IVAS_PIDATA_LISTENER_POSITION *listener = (IVAS_PIDATA_LISTENER_POSITION *) piData; + + /* Position data is 6 bytes */ + if ( numDataBytes != 6 ) + { + return IVAS_ERROR( IVAS_ERR_RTP_UNPACK_PI_DATA, "Incorrect size to unpack LISTENER POSITION PI data" ); + } + + listener->size = sizeof( IVAS_PIDATA_LISTENER_POSITION ); + listener->piDataType = IVAS_PI_LISTENER_POSITION; + listener->position.x = FLOAT_FROM_Q15( readInt16( &buffer[0] ) ) * MAX_PI_POSITION_METERS; + listener->position.y = FLOAT_FROM_Q15( readInt16( &buffer[2] ) ) * MAX_PI_POSITION_METERS; + listener->position.z = FLOAT_FROM_Q15( readInt16( &buffer[4] ) ) * MAX_PI_POSITION_METERS; + return IVAS_ERR_OK; +} + +static ivas_error packDiegetic( const IVAS_PIDATA_GENERIC *piData, uint8_t *buffer, uint32_t maxDataBytes, uint32_t *nBytesWritten ) +{ + uint32_t nBytes = 0, n; + uint8_t byte = 0; + const IVAS_PIDATA_DIEGETIC *diegetic = (const IVAS_PIDATA_DIEGETIC *) piData; + + *nBytesWritten = 0; + + if ( piData->size != sizeof( IVAS_PIDATA_DIEGETIC ) ) + { + return IVAS_ERROR( IVAS_ERR_WRONG_PARAMS, "Incorrect size in Diegetic Type PI data" ); + } + + if ( piData->piDataType != IVAS_PI_DIEGETIC_TYPE ) + { + return IVAS_ERROR( IVAS_ERR_WRONG_PARAMS, "Incorrect PI ID in Diegetic Type PI data" ); + } + + /* Diegetic data is 1 bytes, header is 2 bytes */ + if ( maxDataBytes < 1 + 2 ) + { + return IVAS_ERROR( IVAS_ERR_RTP_INSUFFICIENT_OUTPUT_SIZE, "Insufficient space to pack Diegetic Type PI data" ); + } + + /* Valid bits must be based on active bits defined for the input format */ + for ( n = 0; n < ( IVAS_MAX_NUM_OBJECTS + 1 ); n++ ) + { + byte <<= 1; + byte |= ( diegetic->isDiegetic[n] ); + } + byte <<= 3; + + buffer[nBytes++] = ( diegetic->piDataType & MASK_5BIT ); /* PF/PM populated during final packing */ + buffer[nBytes++] = 1; + buffer[nBytes++] = byte; + *nBytesWritten = nBytes; + return IVAS_ERR_OK; +} + +static ivas_error unpackDiegetic( const uint8_t *buffer, uint32_t numDataBytes, IVAS_PIDATA_GENERIC *piData ) +{ + uint32_t n; + IVAS_PIDATA_DIEGETIC *diegetic = (IVAS_PIDATA_DIEGETIC *) piData; + uint8_t byte; + + /* Diegetic data is 1 bytes */ + if ( numDataBytes != 1 ) + { + return IVAS_ERROR( IVAS_ERR_RTP_UNPACK_PI_DATA, "Incorrect size to unpack Diegetic PI data" ); + } + + diegetic->size = sizeof( IVAS_PIDATA_DIEGETIC ); + diegetic->piDataType = IVAS_PI_DIEGETIC_TYPE; + + byte = buffer[0]; + /* Valid bits must be based on active bits defined for the input format */ + for ( n = 0; n < ( IVAS_MAX_NUM_OBJECTS + 1 ); n++ ) + { + diegetic->isDiegetic[n] = ( ( byte >> ( 7 - n ) ) & 1 ) != 0; + } + + return IVAS_ERR_OK; +} + +static ivas_error packAudioFocusCommon( const IVAS_PIDATA_GENERIC *piData, uint8_t *buffer, uint32_t maxDataBytes, uint32_t *nBytesWritten ) +{ + uint32_t nBytes = 0; + uint8_t packedSize = 1; + const IVAS_PIDATA_AUDIO_FOCUS *audioFocus = (const IVAS_PIDATA_AUDIO_FOCUS *) piData; + + *nBytesWritten = 0; + + if ( piData->size != sizeof( IVAS_PIDATA_AUDIO_FOCUS ) ) + { + return IVAS_ERROR( IVAS_ERR_WRONG_PARAMS, "Incorrect size in PI data of type Audio Focus" ); + } + + if ( audioFocus->availDirection && audioFocus->availLevel ) + { + packedSize = 9; + } + else if ( audioFocus->availDirection ) + { + packedSize = 8; + } + else if ( audioFocus->availLevel ) + { + packedSize = 1; + } + else + { + return IVAS_ERROR( IVAS_ERR_WRONG_PARAMS, "Neither direction or level is available for packing Audio Focus" ); + } + + /* Audio Focus data is packedSize bytes, header is 2 bytes */ + if ( maxDataBytes < (uint32_t) packedSize + 2 ) + { + return IVAS_ERROR( IVAS_ERR_WRONG_PARAMS, "Insufficient space to pack Audio Focus PI data" ); + } + + buffer[nBytes++] = ( audioFocus->piDataType & MASK_5BIT ); /* PF/PM populated during final packing */ + buffer[nBytes++] = packedSize; + + if ( packedSize == 9 || packedSize == 8 ) + { + nBytes = writeInt16( buffer, nBytes, ivasPayload_convertToQ15( audioFocus->direction.w ) ); + nBytes = writeInt16( buffer, nBytes, ivasPayload_convertToQ15( audioFocus->direction.x ) ); + nBytes = writeInt16( buffer, nBytes, ivasPayload_convertToQ15( audioFocus->direction.y ) ); + nBytes = writeInt16( buffer, nBytes, ivasPayload_convertToQ15( audioFocus->direction.z ) ); + } + if ( packedSize == 9 || packedSize == 1 ) + { + buffer[nBytes++] = ( (uint8_t) audioFocus->flvl & MASK_4BIT ) << 4; + } + + *nBytesWritten = nBytes; + return IVAS_ERR_OK; +} + +static ivas_error unpackAudioFocusCommon( const uint8_t *buffer, uint32_t numDataBytes, IVAS_PIDATA_GENERIC *piData ) +{ + IVAS_PIDATA_AUDIO_FOCUS *audioFocus = (IVAS_PIDATA_AUDIO_FOCUS *) piData; + + /* Audio Focus data is either 1, 8 or 9 bytes */ + if ( numDataBytes != 1 && numDataBytes != 8 && numDataBytes != 9 ) + { + return IVAS_ERROR( IVAS_ERR_RTP_UNPACK_PI_DATA, "Incorrect size to unpack PI data of type Audio Focus" ); + } + + piData->size = sizeof( IVAS_PIDATA_AUDIO_FOCUS ); + audioFocus->availDirection = ( numDataBytes >= 8 ); + audioFocus->availLevel = ( numDataBytes == 1 || numDataBytes == 9 ); + + if ( numDataBytes == 1 ) + { + audioFocus->flvl = ( buffer[0] >> 4 ); + } + else + { + audioFocus->direction.w = FLOAT_FROM_Q15( readInt16( &buffer[0] ) ); + audioFocus->direction.x = FLOAT_FROM_Q15( readInt16( &buffer[2] ) ); + audioFocus->direction.y = FLOAT_FROM_Q15( readInt16( &buffer[4] ) ); + audioFocus->direction.z = FLOAT_FROM_Q15( readInt16( &buffer[6] ) ); + + if ( numDataBytes == 9 ) + { + audioFocus->flvl = ( buffer[8] >> 4 ); + } + } + + return IVAS_ERR_OK; +} + + +#endif /* RTP_S4_251135_CR26253_0016_REV1 */ + +static const PACK_PI_FN packPiDataFuntions[IVAS_PI_MAX_ID] = { + packOrientation, /* SCENE_ORIENTATION */ + packOrientation, /* DEVICE_ORIENTATION_COMPENSATED */ + packOrientation, /* DEVICE_ORIENTATION_UNCOMPENSATED */ + packAcousticEnvironment, /* ACOUSTIC_ENVIRONMENT */ +#ifdef RTP_S4_251135_CR26253_0016_REV1 + packAudioDescription, /* AUDIO_DESCRIPTION */ +#else + packUnsupportedData, /* AUDIO_DESCRIPTION */ +#endif /* RTP_S4_251135_CR26253_0016_REV1 */ + packUnsupportedData, /* ISM_NUM */ + packUnsupportedData, /* ISM_ID */ + packUnsupportedData, /* ISM_GAIN */ + packUnsupportedData, /* ISM_ORIENTATION */ + packUnsupportedData, /* ISM_POSITION */ + packUnsupportedData, /* ISM_DISTANCE_ATTENUATION */ + packUnsupportedData, /* ISM_DIRECTIVITY */ +#ifdef RTP_S4_251135_CR26253_0016_REV1 + packDiegetic, /* DIEGETIC_TYPE */ +#else + packUnsupportedData, /* DIEGETIC_TYPE */ +#endif + packUnsupportedData, /* RESERVED13 */ +#ifdef RTP_S4_251135_CR26253_0016_REV1 + packAudioFocusCommon, /* AUDIO_FOCUS_INDICATION */ +#else + packUnsupportedData, /* AUDIO_FOCUS_INDICATION */ +#endif + packUnsupportedData, /* RESERVED15 */ +#ifdef RTP_S4_251135_CR26253_0016_REV1 + packOrientation, /* PLAYBACK_DEVICE_ORIENTATION */ + packOrientation, /* HEAD_ORIENTATION */ + packListenerPosition, /* LISTENER_POSITION */ + packDynamicSuppression, /* DYNAMIC_AUDIO_SUPPRESSION */ + packAudioFocusCommon, /* AUDIO_FOCUS_REQUEST */ +#else + packUnsupportedData, /* PLAYBACK_DEVICE_ORIENTATION */ + packUnsupportedData, /* HEAD_ORIENTATION */ + packUnsupportedData, /* LISTENER_POSITION */ + packUnsupportedData, /* DYNAMIC_AUDIO_SUPPRESSION */ + packUnsupportedData, /* AUDIO_FOCUS_DIRECTION */ +#endif + packUnsupportedData, /* PI_LATENCY */ + packUnsupportedData, /* R_ISM_ID */ + packUnsupportedData, /* R_ISM_GAIN */ +#ifdef RTP_S4_251135_CR26253_0016_REV1 + packOrientation, /* R_ISM_ORIENTATION */ +#else + packUnsupportedData, /* R_ISM_ORIENTATION */ +#endif + packUnsupportedData, /* R_ISM_POSITION */ + packUnsupportedData, /* R_ISM_DIRECTION */ + packUnsupportedData, /* RESERVED27 */ + packUnsupportedData, /* RESERVED28 */ + packUnsupportedData, /* RESERVED29 */ + packUnsupportedData, /* RESERVED30 */ + packNoPiData /* NO_DATA */ +}; + +static const UNPACK_PI_FN unpackPiDataFuntions[IVAS_PI_MAX_ID] = { + unpackOrientation, /* SCENE_ORIENTATION */ + unpackOrientation, /* DEVICE_ORIENTATION_COMPENSATED */ + unpackOrientation, /* DEVICE_ORIENTATION_UNCOMPENSATED */ + unpackAcousticEnvironment, /* ACOUSTIC_ENVIRONMENT */ +#ifdef RTP_S4_251135_CR26253_0016_REV1 + unpackAudioDescription, /* AUDIO_DESCRIPTION */ +#else + unpackUnsupportedData, /* AUDIO_DESCRIPTION */ +#endif + unpackUnsupportedData, /* ISM_NUM */ + unpackUnsupportedData, /* ISM_ID */ + unpackUnsupportedData, /* ISM_GAIN */ + unpackUnsupportedData, /* ISM_ORIENTATION */ + unpackUnsupportedData, /* ISM_POSITION */ + unpackUnsupportedData, /* ISM_DISTANCE_ATTENUATION */ + unpackUnsupportedData, /* ISM_DIRECTIVITY */ +#ifdef RTP_S4_251135_CR26253_0016_REV1 + unpackDiegetic, /* DIEGETIC_TYPE */ +#else + unpackUnsupportedData, /* DIEGETIC_TYPE */ +#endif + unpackUnsupportedData, /* RESERVED13 */ +#ifdef RTP_S4_251135_CR26253_0016_REV1 + unpackAudioFocusCommon, /* AUDIO_FOCUS_INDICATION */ +#else + unpackUnsupportedData, /* AUDIO_FOCUS_INDICATION */ +#endif + unpackUnsupportedData, /* RESERVED15 */ +#ifdef RTP_S4_251135_CR26253_0016_REV1 + unpackOrientation, /* PLAYBACK_DEVICE_ORIENTATION */ + unpackOrientation, /* HEAD_ORIENTATION */ + unpackListenerPosition, /* LISTENER_POSITION */ + unpackDynamicSuppression, /* DYNAMIC_AUDIO_SUPPRESSION */ + unpackAudioFocusCommon, /* AUDIO_FOCUS_REQUEST */ +#else + unpackUnsupportedData, /* PLAYBACK_DEVICE_ORIENTATION */ + unpackUnsupportedData, /* HEAD_ORIENTATION */ + unpackUnsupportedData, /* LISTENER_POSITION */ + unpackUnsupportedData, /* DYNAMIC_AUDIO_SUPPRESSION */ + unpackUnsupportedData, /* AUDIO_FOCUS_DIRECTION */ +#endif + unpackUnsupportedData, /* PI_LATENCY */ + unpackUnsupportedData, /* R_ISM_ID */ + unpackUnsupportedData, /* R_ISM_GAIN */ +#ifdef RTP_S4_251135_CR26253_0016_REV1 + unpackOrientation, /* R_ISM_ORIENTATION */ +#else + unpackUnsupportedData, /* R_ISM_ORIENTATION */ +#endif + unpackUnsupportedData, /* R_ISM_POSITION */ + unpackUnsupportedData, /* R_ISM_DIRECTION */ + unpackUnsupportedData, /* RESERVED27 */ + unpackUnsupportedData, /* RESERVED28 */ + unpackUnsupportedData, /* RESERVED29 */ + unpackUnsupportedData, /* RESERVED30 */ + unpackNoPiData /* NO_DATA */ +}; + +static const uint32_t maxPiDataSize[IVAS_PI_MAX_ID] = { + 8, /* IVAS_PI_SCENE_ORIENTATION */ + 8, /* IVAS_PI_DEVICE_ORIENTATION_COMPENSATED */ + 8, /* IVAS_PI_DEVICE_ORIENTATION_UNCOMPENSATED */ + 8, /* IVAS_PI_ACOUSTIC_ENVIRONMENT */ + 5, /* IVAS_PI_AUDIO_DESCRIPTION */ + 1, /* IVAS_PI_ISM_NUM */ + 4, /* IVAS_PI_ISM_ID */ + 4, /* IVAS_PI_ISM_GAIN */ + 32, /* IVAS_PI_ISM_ORIENTATION */ + 24, /* IVAS_PI_ISM_POSITION */ + 12, /* IVAS_PI_ISM_DISTANCE_ATTENUATION */ + 8, /* IVAS_PI_ISM_DIRECTIVITY */ + 1, /* IVAS_PI_DIEGETIC_TYPE */ + 0, /* IVAS_PI_RESERVED13 */ + 9, /* IVAS_PI_AUDIO_FOCUS_INDICATION */ + 0, /* IVAS_PI_RESERVED15 */ + 8, /* IVAS_PI_PLAYBACK_DEVICE_ORIENTATION */ + 8, /* IVAS_PI_HEAD_ORIENTATION */ + 6, /* IVAS_PI_LISTENER_POSITION */ + 2, /* IVAS_PI_DYNAMIC_AUDIO_SUPPRESSION */ + 9, /* IVAS_PI_AUDIO_FOCUS_REQUEST */ + 4, /* IVAS_PI_PI_LATENCY */ + 1, /* IVAS_PI_R_ISM_ID */ + 1, /* IVAS_PI_R_ISM_GAIN */ + 8, /* IVAS_PI_R_ISM_ORIENTATION */ + 6, /* IVAS_PI_R_ISM_POSITION */ + 2, /* IVAS_PI_R_ISM_DIRECTION */ + 0, /* IVAS_PI_RESERVED27 */ + 0, /* IVAS_PI_RESERVED28 */ + 0, /* IVAS_PI_RESERVED29 */ + 0, /* IVAS_PI_RESERVED30 */ + 0, /* IVAS_PI_NO_DATA = 31 */ +}; + +ivas_error PI_PackData( const IVAS_PIDATA_GENERIC *piData, PIDATA_PACKED *packed, uint8_t pmBits ) +{ + uint32_t type = (IVAS_PI_TYPE) ( piData->piDataType & MASK_5BIT ); + ivas_error error = packPiDataFuntions[type]( piData, packed->data, sizeof( packed->data ), &packed->size ); + if ( error == IVAS_ERR_OK ) + { + packed->data[0] |= pmBits; /* Update the PM bits */ + } + assert( packed->size != 0 ); + return error; +} + +ivas_error PI_UnPackData( uint8_t piDataType, uint32_t piSize, const uint8_t *piDataBuffer, IVAS_PIDATA_GENERIC *piData ) +{ + ivas_error error; + + /* Sanitize maximum sizes for each PI Type */ + if ( piSize > maxPiDataSize[piDataType] ) + { + return IVAS_ERROR( IVAS_ERR_RTP_UNPACK_PI_DATA, "Max size for PI Data type exceeded" ); + } + + error = unpackPiDataFuntions[piDataType]( piDataBuffer, piSize, piData ); + ERR_CHECK_RETURN( error ); + + /* since some pi data share piData structure, pi id are re-filled after unpacking */ + piData->piDataType = piDataType; + + return IVAS_ERR_OK; +} + +/* PIDATA Tables */ +const float mapRT60[1u << NBITS_RT60] = { + 0.01f, 0.0126f, 0.0159f, 0.02f, 0.0252f, 0.0317f, 0.04f, 0.0504f, + 0.0635f, 0.08f, 0.1008f, 0.1270f, 0.16f, 0.2016f, 0.2540f, 0.32f, + 0.4032f, 0.5080f, 0.64f, 0.8063f, 1.0159f, 1.28f, 1.6127f, 2.0319f, + 2.56f, 3.2254f, 4.0637f, 5.12f, 6.4508f, 8.1275f, 10.24f, 12.9016f +}; + +const float mapDSR[1u << NBITS_DSR] = { + -20.f, -21.f, -22.f, -23.f, -24.f, -25.f, -26.f, -27.f, + -28.f, -29.f, -30.f, -31.f, -32.f, -33.f, -34.f, -35.f, + -36.f, -37.f, -38.f, -39.f, -40.f, -41.f, -42.f, -43.f, + -44.f, -45.f, -46.f, -47.f, -48.f, -49.f, -50.f, -51.f, + -52.f, -53.f, -54.f, -55.f, -56.f, -57.f, -58.f, -59.f, + -60.f, -61.f, -62.f, -63.f, -64.f, -65.f, -66.f, -67.f, + -68.f, -69.f, -70.f, -71.f, -72.f, -73.f, -74.f, -75.f, + -76.f, -77.f, -78.f, -79.f, -80.f, -81.f, -82.f, -83.f +}; + +const float mapRoomDims[1u << NBITS_DIM] = { + 0.5f, 0.707f, 1.f, 1.4141f, 2, 2.8282f, 4.f, 5.6568f, + 8.f, 11.314f, 16.f, 22.627f, 32.f, 45.255f, 64.f, 90.51f +}; + +const float mapAbsorbtion[1u << NBITS_ABS] = { + 0.0800f, 0.1656f, 0.3430f, 0.7101f +}; + + +#endif /* IVAS_RTPDUMP */ diff --git a/lib_util/ivas_rtp_pi_data.h b/lib_util/ivas_rtp_pi_data.h new file mode 100644 index 0000000000000000000000000000000000000000..dc4c7f8bafd5eda274df74b419677fd28ec1c64a --- /dev/null +++ b/lib_util/ivas_rtp_pi_data.h @@ -0,0 +1,472 @@ +/****************************************************************************************************** + + (C) 2022-2025 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB, + Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., + Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, + Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other + contributors to this repository. All Rights Reserved. + + This software is protected by copyright law and by international treaties. + The IVAS codec Public Collaboration consisting of Dolby International AB, Ericsson AB, + Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., + Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, + Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other + contributors to this repository retain full ownership rights in their respective contributions in + the software. This notice grants no license of any kind, including but not limited to patent + license, nor is any license granted by implication, estoppel or otherwise. + + Contributors are required to enter into the IVAS codec Public Collaboration agreement before making + contributions. + + This software is provided "AS IS", without any express or implied warranties. The software is in the + development stage. It is intended exclusively for experts who have experience with such software and + solely for the purpose of inspection. All implied warranties of non-infringement, merchantability + and fitness for a particular purpose are hereby disclaimed and excluded. + + Any dispute, controversy or claim arising under or in relation to providing this software shall be + submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in + accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and + the United Nations Convention on Contracts on the International Sales of Goods. + +*******************************************************************************************************/ + +#ifndef IVAS_RTP_PI_DATA_H +#define IVAS_RTP_PI_DATA_H + +#include "common_api_types.h" + +#ifdef IVAS_RTPDUMP + +#define IVAS_PI_MAX_DATA_SIZE ( 32 + 2 ) /* max packed PI data bytes + pi header bytes */ + +/* IVAS PI Data Types */ +typedef enum +{ + /* Forward direction PI types */ + IVAS_PI_SCENE_ORIENTATION, /* orientation of audio scene in unit quaternions */ + IVAS_PI_DEVICE_ORIENTATION_COMPENSATED, /* orientation of device in unit quaternions (compensated) */ + IVAS_PI_DEVICE_ORIENTATION_UNCOMPENSATED, /* orientation of device in unit quaternions (un-compensated) */ + IVAS_PI_ACOUSTIC_ENVIRONMENT, /* describe the acoustic environment */ +#ifdef RTP_S4_251135_CR26253_0016_REV1 + IVAS_PI_AUDIO_DESCRIPTION, /* audio content description (voice/music/ambiance) */ + IVAS_PI_ISM_NUM, /* Number of objects */ + IVAS_PI_ISM_ID, /* id of each object */ + IVAS_PI_ISM_GAIN, /* gain of each object */ + IVAS_PI_ISM_ORIENTATION, /* orientation of each object */ + IVAS_PI_ISM_POSITION, /* position of each object */ + IVAS_PI_ISM_DISTANCE_ATTENUATION, /* distance attenuation for each object */ + IVAS_PI_ISM_DIRECTIVITY, /* directivity of each object */ + IVAS_PI_DIEGETIC_TYPE, /* digetic audio indication */ + IVAS_PI_DYNAMIC_AUDIO_SUPPRESSION_INDICATION, /* audio suppression indication */ + IVAS_PI_AUDIO_FOCUS_INDICATION, /* audio focus indication (direction in Quaternions and/or level) */ + IVAS_PI_RESERVED15, /* reserved */ + + /* Reverse direction PI types */ + IVAS_PI_PLAYBACK_DEVICE_ORIENTATION, /* orientation of the playback device in quaternions */ + IVAS_PI_HEAD_ORIENTATION, /* head orientation of the listener in Quaternions */ + IVAS_PI_LISTENER_POSITION, /* position of the listener in 3D space */ + IVAS_PI_DYNAMIC_AUDIO_SUPPRESSION_REQUEST, /* receiver’s preference with respect to audio suppression */ + IVAS_PI_AUDIO_FOCUS_REQUEST, /* direction of interest for the listener in Quaternions and/or audio focus level */ + IVAS_PI_PI_LATENCY, /* round-trip latency for PI frames */ + IVAS_PI_R_ISM_ID, /* id of an object for editing */ + IVAS_PI_R_ISM_GAIN, /* editing request for gain factor for received object */ + IVAS_PI_R_ISM_ORIENTATION, /* editing request for orientation for received object */ + IVAS_PI_R_ISM_POSITION, /* editing request for position for received object */ + IVAS_PI_R_ISM_DIRECTION, /* editing request for direction for received object */ + IVAS_PI_RESERVED27, /* reserved */ + IVAS_PI_RESERVED28, /* reserved */ + IVAS_PI_RESERVED29, /* reserved */ + IVAS_PI_RESERVED30, /* reserved */ +#endif /* RTP_S4_251135_CR26253_0016_REV1 */ + IVAS_PI_NO_DATA = 31, /* Indicates an empty PI data frame */ + IVAS_PI_MAX_ID /* Max number of PI data IDs supprted */ +} IVAS_PI_TYPE; + +/* cartesian coordinates (X,Y,Z) in 3D space */ +typedef struct +{ + float x, y, z; +} IVAS_COORDINATE; + +/* orientation data corresponding to any of the following pi data types :- + * - IVAS_PI_SCENE_ORIENTATION + * - IVAS_PI_DEVICE_ORIENTATION_COMPENSATED + * - IVAS_PI_DEVICE_ORIENTATION_UNCOMPENSATED + * - IVAS_PI_PLAYBACK_DEVICE_ORIENTATION + * - IVAS_PI_HEAD_ORIENTATION + * - IVAS_PI_R_ISM_ORIENTATION + * + * piDataType is used to identify the correct pi data type contained here + */ +typedef struct +{ + size_t size; /* sizeof(IVAS_PIDATA_SCENE_ORIENTATION) */ + uint32_t piDataType; /* one of supported orientation data types */ + IVAS_QUATERNION orientation; /* orientation data expressed as quartenions */ +} IVAS_PIDATA_ORIENTATION; + +/* Acoustic environment corresponding to IVAS_PI_ACOUSTIC_ENVIRONMENT + * + * acoustic environment ID + * late reverb parameters + * - RT60 – indicating the time that it takes for the reflections to reduce 60 dB in energy level, per frequency band + * - DSR – diffuse to source signal energy ratio, per frequency band + * - Pre-delay – delay at which the computation of DSR values was performed + * early reflections + * - 3D rectangular virtual room dimensions + * - Broadband energy absorption coefficient per wall surface + */ +typedef enum +{ + IVAS_PI_AE_LOW, /* center frequency 25 Hz */ + IVAS_PI_AE_MID, /* center frequency 250 Hz */ + IVAS_PI_AE_HIGH, /* center frequency 2.5 kHz */ + IVAS_PI_AE_NUM_BANDS /* number of ae bands */ +} IVAS_PI_AE_BANDS; + +typedef enum +{ + IVAS_PI_AE_FRONT, + IVAS_PI_AE_BACK, + IVAS_PI_AE_LEFT, + IVAS_PI_AE_RIGHT, + IVAS_PI_AE_CEILING, + IVAS_PI_AE_FLOOR, + IVAS_PI_AE_NUM_SURFACE +} IVAS_PI_AE_SURFACE; + +typedef struct +{ + size_t size; /* sizeof(IVAS_PIDATA_ACOUSTIC_ENV) */ + uint32_t piDataType; /* IVAS_PI_ACOUSTIC_ENVIRONMENT */ + bool availLateReverb; /* AE contains only late reverb parameters */ + bool availEarlyReflections; /* AE containing late reverb and simplified early reflections */ + uint8_t aeid; /* seven-bit acoustic environment identifier */ + + /* only valid if availLateReverb==true or availEarlyReflections==true */ + float rt60[IVAS_PI_AE_NUM_BANDS]; /* time for the reflections to reduce 60 dB per band in seconds */ + float dsr[IVAS_PI_AE_NUM_BANDS]; /* diffuse to source signal energy ratio per band in dB */ + + /* only valid if availEarlyReflections==true */ + IVAS_COORDINATE roomDimensions; /* room dimensions in meters length (x), width (y), height (z) */ + float absorbCoeffs[IVAS_PI_AE_NUM_SURFACE]; /* absorption coefficients for all surfaces */ +} IVAS_PIDATA_ACOUSTIC_ENV; + +#ifdef RTP_S4_251135_CR26253_0016_REV1 +/* Audio Description corresponding to IVAS_PI_AUDIO_DESCRIPTION + * Describe the following audio decriptors per object/type :- + * - audio content type is speech/music/ambiance + * - if audio rendering is editable + * - if stereo audio is binaural + * + * number of valid entries decide on basis of audio format:- + * - Stereo/SBA/MASA = 1 entry + * - MultiChannel = 2 entries (1 for center channel + 1 for all other channels) + * - ISM = Number of Object entries ( 1 per object ) + * - OMASA/OSBA = 1 + Num Discrete Coded Objects + * + */ +typedef struct +{ + bool speech; /* audio has voice/speech */ + bool music; /* audio has music */ + bool ambiance; /* audio has background ambiance */ + bool editable; /* rendering audio metadata is editable */ + bool binaural; /* stereo stream is binaural */ +} IVAS_AUDIO_ID; + +typedef struct +{ + size_t size; /* sizeof(IVAS_PIDATA_AUDIO_DESC) */ + uint32_t piDataType; /* IVAS_PI_AUDIO_DESCRIPTION */ + uint32_t nValidEntries; /* Number of valid audio IDs */ + IVAS_AUDIO_ID audioId[1 + IVAS_MAX_NUM_OBJECTS]; /* audio id as per format */ +} IVAS_PIDATA_AUDIO_DESC; + +/* ISM specific PI data related to PI types : - + * + * - IVAS_PI_ISM_NUM + * - IVAS_PI_ISM_ID + * - IVAS_PI_ISM_GAIN + * - IVAS_PI_ISM_ORIENTATION + * - IVAS_PI_ISM_POSITION + * - IVAS_PI_ISM_DISTANCE_ATTENUATION + * - IVAS_PI_ISM_DIRECTIVITY + */ + +/* Number of ISMs */ +typedef struct +{ + size_t size; /* sizeof(IVAS_PIDATA_ISM_NUM) */ + uint32_t piDataType; /* IVAS_PI_ISM_NUM */ + uint32_t numObjects; /* Number of ISM */ +} IVAS_PIDATA_ISM_NUM; + +/* ISM ID */ +typedef struct +{ + size_t size; /* sizeof(IVAS_PIDATA_ISM_ID) */ + uint32_t piDataType; /* IVAS_PI_ISM_ID */ + uint8_t id[IVAS_MAX_NUM_OBJECTS]; /* 8-bit ISM id of object */ +} IVAS_PIDATA_ISM_ID; + +/* ISM gain */ +typedef struct +{ + size_t size; /* sizeof(IVAS_PIDATA_ISM_GAIN) */ + uint32_t piDataType; /* IVAS_PI_ISM_GAIN */ + int8_t dB[IVAS_MAX_NUM_OBJECTS]; /* ISM gain in dB per object [-96, +3] */ +} IVAS_PIDATA_ISM_GAIN; + +/* ISM orientation */ +typedef struct +{ + size_t size; /* sizeof(IVAS_PIDATA_ISM_ORIENTATION) */ + uint32_t piDataType; /* IVAS_PI_ISM_ORIENTATION */ + IVAS_QUATERNION orientation[IVAS_MAX_NUM_OBJECTS]; /* Orientation of audio objects in ISM(s) */ +} IVAS_PIDATA_ISM_ORIENTATION; + +/* ISM position */ +typedef struct +{ + size_t size; /* sizeof(IVAS_PIDATA_ISM_POSITION) */ + uint32_t piDataType; /* IVAS_PI_ISM_POSITION */ + IVAS_COORDINATE position[IVAS_MAX_NUM_OBJECTS]; /* Position of audio objects in ISM(s) */ +} IVAS_PIDATA_ISM_POSITION; + +/* ISM distance attenuation comprising of following gains per ISM + * - reference distance + * - maximum distance + * - roll-off factor + */ +typedef struct +{ + float ref_dist; /* reference distance in meters */ + float max_dist; /* maximum distance in meters */ + float roll; /* roll-off factor values */ +} IVAS_DIST_ATTEN; + +typedef struct +{ + size_t size; /* sizeof(IVAS_PIDATA_ISM_ATTENUATION) */ + uint32_t piDataType; /* IVAS_PI_ISM_DISTANCE_ATTENUATION */ + IVAS_DIST_ATTEN distAtten[IVAS_MAX_NUM_OBJECTS]; /* Distance attenuation of audio objects */ +} IVAS_PIDATA_ISM_ATTENUATION; + +/* ISM Directivity comprising of following per ISM :- + * - inner cone angle determines the size of the main cone directed to the front of the object + * - outer cone angle determines the size of the outer (back) cone + * - outer attenuation gain determines the attenuation outside the outer cone + */ +typedef struct +{ + uint16_t innerConeAngle; /* inner cone angle in degrees (0 - 360) */ + uint16_t outerConeAngle; /* outer cone angle in degrees (0 - 360) */ + float outerAttenuationdB; /* attenuation outside the outer cone in dB */ +} IVAS_ISM_DIRECTIVITY; + +typedef struct +{ + size_t size; /* sizeof(IVAS_PIDATA_ISM_DIRECTIVITY) */ + uint32_t piDataType; /* IVAS_PI_ISM_DIRECTIVITY */ + IVAS_ISM_DIRECTIVITY directivity[IVAS_MAX_NUM_OBJECTS]; /* Directivity of audio objects */ +} IVAS_PIDATA_ISM_DIRECTIVITY; + +/* Diegetic and non-diegetic indication flag as per audio format + * + * number of valid entries decided on basis of audio format:- + * - Stereo/SBA/MASA/MultiChannel = 1 entry + * - ISM = Number of Object entries ( 1 per object ) + * - OMASA/OSBA = 1 (last) + Num Discrete Coded Objects + */ +typedef struct +{ + size_t size; /* sizeof(IVAS_PIDATA_DIEGETIC) */ + uint32_t piDataType; /* IVAS_PI_DIEGETIC_TYPE */ + bool isDiegetic[1 + IVAS_MAX_NUM_OBJECTS]; /* diegetic indication as per audio format */ +} IVAS_PIDATA_DIEGETIC; + +/* Audio focus direction indicates a direction of interest. + * The audio focus level indicates the amount of suppression applied to the + * directions other than the audio focus direction. + */ +typedef enum +{ + IVAS_FLVL_NO_AUDIO_FOCUS = 0, /* Apply no audio focus */ + IVAS_FLVL_FOCUS_LEVEL_LEVEL_1, /* Audio focus level 1 */ + IVAS_FLVL_FOCUS_LEVEL_LEVEL_2, /* Audio focus level 2 */ + IVAS_FLVL_FOCUS_LEVEL_LEVEL_3, /* Audio focus level 3 */ + IVAS_FLVL_FOCUS_LEVEL_LEVEL_4, /* Audio focus level 4 */ + IVAS_FLVL_FOCUS_LEVEL_LEVEL_5, /* Audio focus level 5 */ + IVAS_FLVL_FOCUS_LEVEL_LEVEL_6, /* Audio focus level 6 */ + IVAS_FLVL_FOCUS_LEVEL_LEVEL_7, /* Audio focus level 7 */ + IVAS_FLVL_FOCUS_LEVEL_LEVEL_8, /* Audio focus level 8 */ + IVAS_FLVL_FOCUS_LEVEL_LEVEL_9, /* Audio focus level 9 */ + IVAS_FLVL_FOCUS_LEVEL_LEVEL_10, /* Audio focus level 10 */ + IVAS_FLVL_FOCUS_LEVEL_LEVEL_11, /* Audio focus level 11 */ + IVAS_FLVL_FOCUS_LEVEL_LEVEL_12, /* Audio focus level 12 */ + IVAS_FLVL_MAX_AUDIO_FOCUS, /* Apply max audio focus */ + IVAS_FLVL_DEFAULT_AUDIO_FOCUS, /* Default audio focus */ + IVAS_FLVL_NO_PREFERENCE, /* No preference / No indication */ +} IVAS_FLVL; + +typedef struct +{ + size_t size; /* sizeof(IVAS_PIDATA_AUDIO_FOCUS) */ + uint32_t piDataType; /* IVAS_PI_AUDIO_FOCUS_INDCATION or IVAS_PI_AUDIO_FOCUS_REQUEST */ + bool availDirection; /* audio focus contains direction */ + bool availLevel; /* audio focus contains level */ + IVAS_QUATERNION direction; /* direction data expressed as quarternions */ + IVAS_FLVL flvl; /* audio focus level */ +} IVAS_PIDATA_AUDIO_FOCUS; + +/* Listener position */ +typedef struct +{ + size_t size; /* sizeof(IVAS_PIDATA_LISTENER_POSITION) */ + uint32_t piDataType; /* IVAS_PI_LISTENER_POSITION */ + IVAS_COORDINATE position; /* Position of audio objects in ISM(s) */ +} IVAS_PIDATA_LISTENER_POSITION; + + +/* Dynamic Audio Suppression describes receiver’s preference with respect to the + * type of audio content that should be enhanced and the amount of suppression to + * be applied to the background noise + */ +typedef enum +{ + IVAS_SLI_MIN_SUPPRESSION = 0, /* Apply min suppression */ + IVAS_SLI_SUPPRESSION_LEVEL_1, /* Suppression level 1 */ + IVAS_SLI_SUPPRESSION_LEVEL_2, /* Suppression level 2 */ + IVAS_SLI_SUPPRESSION_LEVEL_3, /* Suppression level 3 */ + IVAS_SLI_SUPPRESSION_LEVEL_4, /* Suppression level 4 */ + IVAS_SLI_SUPPRESSION_LEVEL_5, /* Suppression level 5 */ + IVAS_SLI_SUPPRESSION_LEVEL_6, /* Suppression level 6 */ + IVAS_SLI_SUPPRESSION_LEVEL_7, /* Suppression level 7 */ + IVAS_SLI_SUPPRESSION_LEVEL_8, /* Suppression level 8 */ + IVAS_SLI_SUPPRESSION_LEVEL_9, /* Suppression level 9 */ + IVAS_SLI_SUPPRESSION_LEVEL_10, /* Suppression level 10 */ + IVAS_SLI_SUPPRESSION_LEVEL_11, /* Suppression level 11 */ + IVAS_SLI_MAX_SUPPRESSION, /* Apply max suppression */ + IVAS_SLI_NO_SUPPRESSION, /* Apply no suppression */ + IVAS_SLI_DEFAULT_SUPPRESSION, /* Apply default suppression */ + IVAS_SLI_NO_PREFERENCE, /* No preference / No indication */ +} IVAS_SLI; + +typedef struct +{ + size_t size; /* sizeof(IVAS_PIDATA_DYNAMIC_SUPPRESSION) */ + uint32_t piDataType; /* IVAS_PI_DYNAMIC_AUDIO_SUPPRESSION_REQUEST or IVAS_PI_DYNAMIC_AUDIO_SUPPRESSION_INDICATION */ + bool speech; /* receiver's preference is voice/speech */ + bool music; /* receiver's preference is music */ + bool ambiance; /* receiver's preference is background ambiance */ + IVAS_SLI sli; /* suppression level indicator [0, 15] */ +} IVAS_PIDATA_DYNAMIC_SUPPRESSION; + +/* Reverse PI latency calculated as the elapsed time between the sent reverse PI data + * and received forward PI data. It is based on the receiving device experiencing the + * result of its sent data by receiving the corresponding data in forward direction as + * forward PI data + */ +typedef struct +{ + size_t size; /* sizeof(IVAS_PIDATA_REVERSE_PI_LATENCY) */ + uint32_t piDataType; /* IVAS_PI_PI_LATENCY */ + IVAS_PI_TYPE type; /* Reverse PI used for computation of Latency */ + int32_t latency; /* Latency as 27-bit int on RTP Clock @ 16KHz */ +} IVAS_PIDATA_REVERSE_PI_LATENCY; + +/* ISM specific PI data editing requests */ + +/* ISM ID in editing requests */ +typedef struct +{ + size_t size; /* sizeof(IVAS_PIDATA_ISM_EDIT_ID) */ + uint32_t piDataType; /* IVAS_PI_R_ISM_ID */ + uint8_t id; /* 8-bit ISM id of object to edit */ +} IVAS_PIDATA_ISM_EDIT_ID; + +/* Editing request for ISM gain */ +typedef struct +{ + size_t size; /* sizeof(IVAS_PIDATA_ISM_EDIT_GAIN) */ + uint32_t piDataType; /* IVAS_PI_R_ISM_GAIN */ + int8_t dB; /* Preferred ISM gain in dB [-96, +3] */ +} IVAS_PIDATA_ISM_EDIT_GAIN; + +/* Editing request for ISM orientation */ +typedef struct +{ + size_t size; /* sizeof(IVAS_PIDATA_ISM_EDIT_ORIENTATION) */ + uint32_t piDataType; /* IVAS_PI_R_ISM_ORIENTATION */ + IVAS_QUATERNION orientation; /* orientation editing request for received ISM */ +} IVAS_PIDATA_ISM_EDIT_ORIENTATION; + +/* Editing request for ISM position */ +typedef struct +{ + size_t size; /* sizeof(IVAS_PIDATA_ISM_EDIT_POSITION) */ + uint32_t piDataType; /* IVAS_PI_R_ISM_POSITION */ + IVAS_COORDINATE position; /* Positional editing request for received ISM */ +} IVAS_PIDATA_ISM_EDIT_POSITION; + +/* Editing request for ISM direction */ +typedef struct +{ + size_t size; /* sizeof(IVAS_PIDATA_ISM_EDIT_DIRECTION) */ + uint32_t piDataType; /* IVAS_PI_R_ISM_DIRECTION */ + float azimuth; /* azimuth angle in degrees [-180, 180] */ + float elevation; /* elevation angle in degrees [-90°, 90°] */ +} IVAS_PIDATA_ISM_EDIT_DIRECTION; +#endif /* RTP_S4_251135_CR26253_0016_REV1 */ + +typedef struct +{ + size_t size; /* sizeof(IVAS_PIDATA_NO_DATA) */ + uint32_t piDataType; /* IVAS_PI_NO_DATA */ +} IVAS_PIDATA_NO_DATA; + + +typedef union +{ + IVAS_PIDATA_ORIENTATION scene; + IVAS_PIDATA_ORIENTATION deviceCompensated; + IVAS_PIDATA_ORIENTATION deviceUnCompensated; + IVAS_PIDATA_ACOUSTIC_ENV acousticEnv; +#ifdef RTP_S4_251135_CR26253_0016_REV1 + IVAS_PIDATA_AUDIO_DESC audioDesc; + IVAS_PIDATA_ISM_NUM ismNum; + IVAS_PIDATA_ISM_ID ismId; + IVAS_PIDATA_ISM_GAIN ismGain; + IVAS_PIDATA_ISM_ORIENTATION ismOrientation; + IVAS_PIDATA_ISM_POSITION ismPosition; + IVAS_PIDATA_ISM_ATTENUATION ismAttenuation; + IVAS_PIDATA_ISM_DIRECTIVITY ismDirectivity; + IVAS_PIDATA_DIEGETIC digeticIndicator; + IVAS_PIDATA_DYNAMIC_SUPPRESSION dynSuppressionIndication; + IVAS_PIDATA_AUDIO_FOCUS focusIndication; + + IVAS_PIDATA_ORIENTATION playbackOrientation; + IVAS_PIDATA_ORIENTATION headOrientation; + IVAS_PIDATA_LISTENER_POSITION listnerPosition; + IVAS_PIDATA_DYNAMIC_SUPPRESSION dynSuppressionRequest; + IVAS_PIDATA_AUDIO_FOCUS focusRequest; + IVAS_PIDATA_REVERSE_PI_LATENCY piLatency; + IVAS_PIDATA_ISM_EDIT_ID ismEditId; + IVAS_PIDATA_ISM_EDIT_GAIN ismEditGain; + IVAS_PIDATA_ISM_EDIT_ORIENTATION ismEditOrientation; + IVAS_PIDATA_ISM_EDIT_POSITION ismEditPosition; + IVAS_PIDATA_ISM_EDIT_DIRECTION ismEditDirection; +#endif /* RTP_S4_251135_CR26253_0016_REV1 */ + IVAS_PIDATA_NO_DATA noPiData; +} PIDATA; + +typedef struct +{ + PIDATA data; + uint32_t timestamp; +} PIDATA_TS; + +#endif /* IVAS_RTPDUMP */ + +#endif /* IVAS_RTP_PI_DATA_H */ diff --git a/lib_util/mutex.h b/lib_util/mutex.h new file mode 100644 index 0000000000000000000000000000000000000000..82094b61c823e909f22282f982413abe037489f6 --- /dev/null +++ b/lib_util/mutex.h @@ -0,0 +1,104 @@ +/****************************************************************************************************** + + (C) 2022-2025 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB, + Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., + Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, + Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other + contributors to this repository. All Rights Reserved. + + This software is protected by copyright law and by international treaties. + The IVAS codec Public Collaboration consisting of Dolby International AB, Ericsson AB, + Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., + Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, + Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other + contributors to this repository retain full ownership rights in their respective contributions in + the software. This notice grants no license of any kind, including but not limited to patent + license, nor is any license granted by implication, estoppel or otherwise. + + Contributors are required to enter into the IVAS codec Public Collaboration agreement before making + contributions. + + This software is provided "AS IS", without any express or implied warranties. The software is in the + development stage. It is intended exclusively for experts who have experience with such software and + solely for the purpose of inspection. All implied warranties of non-infringement, merchantability + and fitness for a particular purpose are hereby disclaimed and excluded. + + Any dispute, controversy or claim arising under or in relation to providing this software shall be + submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in + accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and + the United Nations Convention on Contracts on the International Sales of Goods. + +*******************************************************************************************************/ + +/*==================================================================================== + EVS Codec 3GPP TS26.443 Nov 04, 2021. Version 12.14.0 / 13.10.0 / 14.6.0 / 15.4.0 / 16.3.0 + ====================================================================================*/ + +#ifndef _MUTEX_H +#define _MUTEX_H + +#if defined( __unix__ ) || defined( __linux__ ) || ( defined( __MACH__ ) && defined( __APPLE__ ) ) +#include +typedef pthread_mutex_t mtx_t; +#define _USE_POSIX ( 1 ) +#elif defined( _WIN32 ) || defined( _WIN64 ) +#include +typedef CRITICAL_SECTION mtx_t; +#define _USE_WIN ( 1 ) +#else +typedef int mtx_t; +#warning Mutex implementation to be defined for this platform here. +#endif + +static __inline int mtx_init( mtx_t *mutex, int type ) +{ + int err = 0; + (void) type; +#ifdef _USE_POSIX + err = pthread_mutex_init( mutex, NULL ); +#elif defined( _USE_WIN ) + InitializeCriticalSection( mutex ); +#else + (void) mutex; +#endif + return err; +} + +static __inline void mtx_destroy( mtx_t *mutex ) +{ +#if _USE_POSIX + pthread_mutex_destroy( mutex ); +#elif defined( _USE_WIN ) + DeleteCriticalSection( mutex ); +#else + (void) mutex; +#endif +} + +static __inline int mtx_lock( mtx_t *mutex ) +{ + int err = 0; +#if _USE_POSIX + err = pthread_mutex_lock( mutex ); +#elif defined( _USE_WIN ) + EnterCriticalSection( mutex ); +#else + (void) mutex; +#endif + return err; +} + +static __inline int mtx_unlock( mtx_t *mutex ) +{ + int err = 0; +#if _USE_POSIX + err = pthread_mutex_unlock( mutex ); +#elif defined( _USE_WIN ) + LeaveCriticalSection( mutex ); +#else + (void) mutex; +#endif + return err; +} + +#endif /* _MUTEX_H */ diff --git a/lib_util/rtpdump.c b/lib_util/rtpdump.c index 9b25633a9385f57d14922a659a9bfe932a5dd1d4..f89b36f82a686192ec0f843251a56bf23312dec1 100644 --- a/lib_util/rtpdump.c +++ b/lib_util/rtpdump.c @@ -110,10 +110,17 @@ static int readShort( FILE *file, unsigned short *value ) static int writeLong( FILE *file, unsigned int value ) { char buffer[4] = { 0 }; +#ifdef IVAS_RTPDUMP + buffer[3] = (char) ( value & 0xff ); + buffer[2] = (char) ( ( value >> 8 ) & 0xff ); + buffer[1] = (char) ( ( value >> 16 ) & 0xff ); + buffer[0] = (char) ( ( value >> 24 ) & 0xff ); +#else buffer[3] = value & 0xff; buffer[2] = ( value >> 8 ) & 0xff; buffer[1] = ( value >> 16 ) & 0xff; buffer[0] = ( value >> 24 ) & 0xff; +#endif if ( fwrite( buffer, 4, 1, file ) != 1U ) { return -1; @@ -125,8 +132,13 @@ static int writeLong( FILE *file, unsigned int value ) static int writeShort( FILE *file, unsigned short value ) { char buffer[2] = { 0 }; +#ifdef IVAS_RTPDUMP + buffer[1] = (char) ( value & 0xff ); + buffer[0] = (char) ( ( value >> 8 ) & 0xff ); +#else buffer[1] = value & 0xff; buffer[0] = ( value >> 8 ) & 0xff; +#endif if ( fwrite( buffer, 2, 1, file ) != 1U ) { return -1; diff --git a/readme.txt b/readme.txt index 8e471c429bb5a677a6671b17057ac8782e673a4f..54b602c99529e6fe8e3d6f797153023d32bcae91 100644 --- a/readme.txt +++ b/readme.txt @@ -249,6 +249,12 @@ EVS mono is default, for IVAS choose one of the following: -stereo, -ism, -sba, -level level : Complexity level, level = (1, 2, 3), will be defined after characterisation. Currently, all values default to level 3 (full functionality). -q : Quiet mode, limit printouts to terminal, default is deactivated +-rtpdump : RTPDump output, hf_only=1 by default. The encoder will packetize the + bitstream frames into TS26.253 Annex A IVAS RTP Payload Format packets and + writes those to the output file. In EVS mono operating mode, TS26.445 Annex A.2.2 + EVS RTP Payload Format is used. Optional N represents number of frames per RTP packet +-scene_orientation : Scene orientation trajectory file. Only used with rtpdump output. +-device_orientation : Device orientation trajectory file. Only used with rtpdump output. The usage of the "IVAS_dec" program is as follows: @@ -274,9 +280,10 @@ Options: -------- -VOIP : VoIP mode: RTP in G192 -VOIP_hf_only=0 : VoIP mode: EVS RTP Payload Format hf_only=0 in rtpdump --VOIP_hf_only=1 : VoIP mode: EVS RTP Payload Format hf_only=1 in rtpdump +-VOIP_hf_only=1 : VoIP mode: EVS or IVAS RTP Payload Format hf_only=1 in rtpdump The decoder may read rtpdump files containing TS26.445 Annex A.2.2 - EVS RTP Payload Format. The SDP parameter hf_only is required. + EVS RTP Payload Format or rtpdump files containing TS26.253 Annex A + IVAS RTP Payload Format. The SDP parameter hf_only is required. Reading RFC4867 AMR/AMR-WB RTP payload format is not supported. -Tracefile TF : VoIP mode: Generate trace file named TF. Requires -no_delay_cmp to be enabled so that trace contents remain in sync with audio output. diff --git a/scripts/config/self_test.prm b/scripts/config/self_test.prm index 28254ed77c2bd2dddb7b0857cf728d187f83ba3a..2f6f2efe4a10ac6e92980887002b0c826594e778 100644 --- a/scripts/config/self_test.prm +++ b/scripts/config/self_test.prm @@ -307,7 +307,6 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_dec EXT 48 bit testv/stvST48c.wav_stereo_sw_48-48_DTX_EXT.tst - // 1 ISM with metadata at 13.2 kbps, 48 kHz in, 48 kHz out, EXT out ../IVAS_cod -ism 1 testv/stvISM1.csv 13200 48 testv/stv1ISM48s.wav bit ../IVAS_dec EXT 48 bit testv/stv1ISM48s.wav_13200_48-48_EXT.tst @@ -581,7 +580,6 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_dec BINAURAL_ROOM_REVERB 48 bit testv/stv4ISM48n.wav_BINAURAL_ROOM_REVERB_128000_48-48.tst - // SBA at 13.2 kbps, 32kHz in, 32kHz out, HOA3 out, bandwidth switching ../IVAS_cod -max_band testv/ivas_bws_20fr_start_WB.txt -sba 3 13200 32 testv/stv3OA32c.wav bit ../IVAS_dec HOA3 32 bit testv/stv3OA32c.wav_SBA_13200_32-32_HOA3.tst @@ -628,17 +626,17 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_dec -t testv/headrot.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv -otr avg BINAURAL 32 bit testv/stv3OA32c.pcm_SBA_24400_32-32_Binaural_Headrot_EXOF_OtrAvg.tst // SBA at 24.4 kbps, 32kHz in, 32kHz out, DTX on, BINAURAL out, random FER at 5% -../IVAS_cod -sba 3 -dtx 24400 32 testv/stv3OA32c_cut_.004.wav bit +../IVAS_cod -sba 3 -dtx 24400 32 testv/stv3OA32n.wav bit eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error -../IVAS_dec BINAURAL 32 bit_error testv/stv3OA32c_cut.004.wav_SBA_24400_32-32_DTX_Binaural_FER5.tst +../IVAS_dec BINAURAL 32 bit_error testv/stv3OA32n.wav_SBA_24400_32-32_DTX_Binaural_FER5.tst // SBA at 24.4 kbps, 32kHz in, 32kHz out, DTX on, BINAURAL out, DTX on, HR -../IVAS_cod -sba 3 -dtx 24400 32 testv/stv3OA32c_cut_.004.wav bit -../IVAS_dec -t testv/headrot.csv BINAURAL 32 bit testv/stv3OA32c_cut_.004.wav_SBA_24400_32-32_DTX_Binaural_Headrot.tst +../IVAS_cod -sba 3 -dtx 24400 32 testv/stv3OA32n.wav bit +../IVAS_dec -t testv/headrot.csv BINAURAL 32 bit testv/stv3OA32n.wav_SBA_24400_32-32_DTX_Binaural_Headrot.tst // SBA at 24.4 kbps, 32kHz in, 32kHz out, DTX on, BINAURAL out, DTX on, HR, exo -../IVAS_cod -sba 3 -dtx 24400 32 testv/stv3OA32c_cut_.004.wav bit -../IVAS_dec -t testv/headrot.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv BINAURAL 32 bit testv/stv3OA32c_cut_.004.wav_SBA_24400_32-32_DTX_Binaural_Headrot_EXOF.tst +../IVAS_cod -sba 3 -dtx 24400 32 testv/stv3OA32n.wav bit +../IVAS_dec -t testv/headrot.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv BINAURAL 32 bit testv/stv3OA32n.wav_SBA_24400_32-32_DTX_Binaural_Headrot_EXOF.tst // SBA at 32 kbps, 32kHz in, 32kHz out, FOA out ../IVAS_cod -sba 1 32000 32 testv/stvFOA32c.wav bit @@ -654,8 +652,8 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_dec BINAURAL_ROOM_IR 32 bit testv/stvFOA32c.wav_SBA_32000_32-32_BINAURAL_ROOM.tst // SBA at 32 kbps, 48kHz in, 48kHz out, MONO out, DTX, bandwidth switching -../IVAS_cod -max_band testv/ivas_bws_20fr_start_FB.txt -dtx -sba 1 32000 48 testv/stvFOA48c_cut_.004.wav bit -../IVAS_dec MONO 48 bit testv/stvFOA48c_cut_.004.wav_SBA_32000_48-48_DTX_MONO.tst +../IVAS_cod -max_band testv/ivas_bws_20fr_start_FB.txt -dtx -sba 1 32000 48 testv/stvFOA48n.wav bit +../IVAS_dec MONO 48 bit testv/stvFOA48n.wav_SBA_32000_48-48_DTX_MONO.tst // SBA at 48 kbps, 32kHz in, 32kHz out, MONO out, random FER at 5% ../IVAS_cod -sba 3 48000 32 testv/stv3OA32c.wav bit @@ -703,26 +701,26 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_dec -t ../scripts/trajectories/full-circle-with-up-and-down-4s.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv -rvf ../scripts/trajectories/full-circle-with-up-and-down-4s-Vector3.csv -otr ref_vec_lev BINAURAL_ROOM_IR 32 bit testv/stv3OA32c.pcm_SBA_48000_32-32_BinauralRoom_Headrot_EXOF_OtrRefPosLev.tst // SBA at 48 kbps, 32kHz in, 32kHz out, DTX on, BINAURAL out, random FER at 5% -../IVAS_cod -sba 3 -dtx 48000 32 testv/stv3OA32c_cut_.004.wav bit +../IVAS_cod -sba 3 -dtx 48000 32 testv/stv3OA32n.wav bit eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error -../IVAS_dec BINAURAL 32 bit_error testv/stv3OA32c_cut_.004.wav_SBA_48000_32-32_DTX_Binaural_FER5.tst +../IVAS_dec BINAURAL 32 bit_error testv/stv3OA32n.wav_SBA_48000_32-32_DTX_Binaural_FER5.tst // SBA at 48 kbps, 32kHz in, 32kHz out, DTX on, BINAURAL out, DTX on, HR -../IVAS_cod -sba 3 -dtx 48000 32 testv/stv3OA32c_cut_.004.wav bit -../IVAS_dec -t testv/headrot.csv BINAURAL 32 bit testv/stv3OA32c_cut_.004.wav_SBA_48000_32-32_DTX_Binaural_Headrot.tst +../IVAS_cod -sba 3 -dtx 48000 32 testv/stv3OA32n.wav bit +../IVAS_dec -t testv/headrot.csv BINAURAL 32 bit testv/stv3OA32n.wav_SBA_48000_32-32_DTX_Binaural_Headrot.tst // SBA at 48 kbps, 32kHz in, 32kHz out, DTX on, BINAURAL out, DTX on, HR, exo -../IVAS_cod -sba 3 -dtx 48000 32 testv/stv3OA32c_cut_.004.wav bit -../IVAS_dec -t testv/headrot.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv BINAURAL 32 bit testv/stv3OA32c_cut_.004.wav_SBA_48000_32-32_DTX_Binaural_Headrot_EXOF.tst +../IVAS_cod -sba 3 -dtx 48000 32 testv/stv3OA32n.wav bit +../IVAS_dec -t testv/headrot.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv BINAURAL 32 bit testv/stv3OA32n.wav_SBA_48000_32-32_DTX_Binaural_Headrot_EXOF.tst // SBA at 48 kbps, 48kHz in, 48kHz out, 5_1_2 out ../IVAS_cod -sba 3 48000 48 testv/stv3OA48c.wav bit ../IVAS_dec 5_1_2 48 bit testv/stv3OA48c.wav_SBA_48000_48-48_5_1_2.tst // SBA at 64 kbps, 32kHz in, 32kHz out, FOA out, DTX, random FER at 5% -../IVAS_cod -dtx -sba 1 64000 32 testv/stvFOA32c_cut_.004.wav bit +../IVAS_cod -dtx -sba 1 64000 32 testv/stvFOA32n.wav bit eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error -../IVAS_dec FOA 32 bit_error testv/stvFOA32c.wav_SBA_64000_32-32_DTX_FOA_FER5.tst +../IVAS_dec FOA 32 bit_error testv/stvFOA32n.wav_SBA_64000_32-32_DTX_FOA_FER5.tst // SBA at 64 kbps, 48kHz in, 48kHz out, 5_1_4 out ../IVAS_cod -sba 1 64000 48 testv/stvFOA48c.wav bit @@ -733,12 +731,12 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_dec 7_1_4 48 bit testv/stvFOA48c.wav_SBA_64000_48-48_7_1_4.tst // SBA at 64 kpbs, 48kHz in, 48kHz out, BINAURAL out, DTX -../IVAS_cod -dtx -sba 1 64000 48 testv/stvFOA48c_cut_.004.wav bit -../IVAS_dec BINAURAL 48 bit testv/stvFOA48c_cut_.004.wav_SBA_64000_48-48_DTX_BINAURAL.tst +../IVAS_cod -dtx -sba 1 64000 48 testv/stvFOA48n.wav bit +../IVAS_dec BINAURAL 48 bit testv/stvFOA48n.wav_SBA_64000_48-48_DTX_BINAURAL.tst // SBA at 64 kpbs, 48kHz in, 48kHz out, BINAURAL_ROOM out, DTX -../IVAS_cod -dtx -sba 1 64000 48 testv/stvFOA48c_cut_.004.wav bit -../IVAS_dec BINAURAL_ROOM_IR 48 bit testv/stvFOA48c_cut_.004.wav_SBA_64000_48-48_DTX_BINAURAL_ROOM.tst +../IVAS_cod -dtx -sba 1 64000 48 testv/stvFOA48n.wav bit +../IVAS_dec BINAURAL_ROOM_IR 48 bit testv/stvFOA48n.wav_SBA_64000_48-48_DTX_BINAURAL_ROOM.tst // SBA at 80 kbps, 32kHz in, 32kHz out, HOA3 out ../IVAS_cod -sba 3 80000 32 testv/stv3OA32c.wav bit @@ -791,8 +789,8 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_dec HOA2 48 bit_error testv/stv3OA48c.wav_SBA_192000_48-48_HOA2_FER5.tst // SBA at 48 kbps, 48kHz in, 48kHz out, DTX on, 5_1 out -../IVAS_cod -sba 3 -dtx 48000 48 testv/stv3OA48c_cut_.004.wav bit -../IVAS_dec 5_1 48 bit testv/stv3OA48c_cut_.004.wav_SBA_48000_48-48_DTX_5_1.tst +../IVAS_cod -sba 3 -dtx 48000 48 testv/stv3OA48n.wav bit +../IVAS_dec 5_1 48 bit testv/stv3OA48n.wav_SBA_48000_48-48_DTX_5_1.tst // SBA at 160 kbps, 32kHz in, 32kHz out, FOA out ../IVAS_cod -sba 1 160000 32 testv/stvFOA32c.wav bit @@ -873,12 +871,12 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_dec 7_1_4 48 bit testv/stv3OA48c.wav_sw_48-48_7_1_4.tst // SBA FOA bitrate switching from 13.2 kbps to 192 kbps, 32kHz in, 32kHz out, DTX on, BINAURAL out -../IVAS_cod -dtx -sba 1 ../scripts/switchPaths/sw_13k2_192k_50fr.bin 32 testv/stvFOA32c_cut_.004.wav bit +../IVAS_cod -dtx -sba 1 ../scripts/switchPaths/sw_13k2_192k_50fr.bin 32 testv/stvFOA32n.wav bit ../IVAS_dec BINAURAL 32 bit testv/stvFOA32c.wav_sw_32-32_DTX_BINAURAL.tst // SBA 3OA bitrate switching from 13.2 kbps to 128 kbps, 32kHz in, 32kHz out, DTX on, HOA3 out -../IVAS_cod -dtx -sba 3 ../scripts/switchPaths/sw_13k2_to_128k_10fr.bin 32 testv/stv3OA32c_cut_.004.wav bit -../IVAS_dec HOA3 32 bit testv/stv3OA32c.wav_sw_32-32_DTX_HOA3.tst +../IVAS_cod -dtx -sba 3 ../scripts/switchPaths/sw_13k2_to_128k_10fr.bin 32 testv/stv3OA32n.wav bit +../IVAS_dec HOA3 32 bit testv/stv3OA32n.wav_sw_32-32_DTX_HOA3.tst // SBA FOA bitrate switching from 13.2 kbps to 512 kbps, 48kHz in, 48kHz out, FOA out ../IVAS_cod -sba 1 -max_band fb ../scripts/switchPaths/sw_13k2_512k.bin 48 testv/stvFOA48c.wav bit @@ -925,30 +923,30 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_dec BINAURAL 48 bit testv/stvFOA48c.wav_SBA_PCA_256000_48-48_BINAURAL.tst // SBA FOA bitrate switching from 13.2 kbps to 192 kbps, 32kHz in, 32kHz out, DTX on, EXT out -../IVAS_cod -dtx -sba 1 ../scripts/switchPaths/sw_13k2_192k_50fr.bin 32 testv/stvFOA32c_cut_.004.wav bit -../IVAS_dec EXT 32 bit testv/stvFOA32c_cut_.004.wav_sw_32-32_DTX_EXT.tst +../IVAS_cod -dtx -sba 1 ../scripts/switchPaths/sw_13k2_192k_50fr.bin 32 testv/stvFOA32n.wav bit +../IVAS_dec EXT 32 bit testv/stvFOA32n.wav_sw_32-32_DTX_EXT.tst // SBA planar 2OA bitrate switching from 13.2 kbps to 128 kbps, 32kHz in, 32kHz out, DTX on, EXT out -../IVAS_cod -dtx -sba -2 ../scripts/switchPaths/sw_13k2_to_128k_10fr.bin 32 testv/stv2OA32c_cut_.004.wav bit -../IVAS_dec EXT 32 bit testv/stv2OA32c_cut_.004.wav_sw_32-32_DTX_EXT.tst +../IVAS_cod -dtx -sba -2 ../scripts/switchPaths/sw_13k2_to_128k_10fr.bin 32 testv/stv2OA32n.wav bit +../IVAS_dec EXT 32 bit testv/stv2OA32n.wav_sw_32-32_DTX_EXT.tst // SBA 3OA bitrate switching from 13.2 kbps to 128 kbps, 48kHz in, 48kHz out, DTX on, random FER at 5%, EXT out -../IVAS_cod -dtx -sba 3 ../scripts/switchPaths/sw_13k2_to_128k_10fr.bin 48 testv/stv3OA48c_cut_.004.wav bit +../IVAS_cod -dtx -sba 3 ../scripts/switchPaths/sw_13k2_to_128k_10fr.bin 48 testv/stv3OA48n.wav bit eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error -../IVAS_dec EXT 48 bit_error testv/stv3OA48c_cut_.004.wav_sw_48-48_DTX_EXT_FER5.tst +../IVAS_dec EXT 48 bit_error testv/stv3OA48n.wav_sw_48-48_DTX_EXT_FER5.tst // SBA planar FOA bitrate switching from 13.2 kbps to 512 kbps, 32kHz in, 32kHz out, EXT out ../IVAS_cod -sba -1 ../scripts/switchPaths/sw_13k2_512k.bin 32 testv/stvFOA32c.wav bit -../IVAS_dec EXT 32 bit testv/stvFOA32c.wav_sw_32-32_DTX_EXT.tst +../IVAS_dec EXT 32 bit testv/stvFOA32c.wav_sw_32-32_EXT.tst // SBA 2OA bitrate switching from 13.2 kbps to 512 kbps, 32kHz in, 32kHz out, EXT out ../IVAS_cod -sba 2 ../scripts/switchPaths/sw_13k2_512k.bin 32 testv/stv2OA32c.wav bit -../IVAS_dec EXT 32 bit testv/stv2OA32c.wav_sw_32-32_DTX_EXT.tst +../IVAS_dec EXT 32 bit testv/stv2OA32c.wav_sw_32-32_EXT.tst // SBA planar 3OA bitrate switching from 13.2 kbps to 512 kbps, 48kHz in, 48kHz out, random FER at 5%, EXT out ../IVAS_cod -sba -3 ../scripts/switchPaths/sw_13k2_512k.bin 48 testv/stv3OA48c.wav bit eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error -../IVAS_dec EXT 48 bit_error testv/stv3OA48c.wav_sw_48-48_DTX_EXT_FER5.tst +../IVAS_dec EXT 48 bit_error testv/stv3OA48c.wav_sw_48-48_EXT_FER5.tst // SBA 3OA at 96 kbps, 48kHz in, 48kHz out, BINAURAL_ROOM_REVERB out default configuration ../IVAS_cod -sba 3 512000 48 testv/stv3OA48c.wav bit @@ -959,7 +957,6 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_dec -render_config testv/rend_config_recreation.cfg BINAURAL_ROOM_REVERB 48 bit testv/stv3OA48c.wav_BINAURAL_ROOM_REVERB_96000_48-48_custom_configuration.tst - // MASA 1dir 1TC at 13.2 kbps, 48kHz in, 48kHz out, BINAURAL out, bandwidth switching ../IVAS_cod -max_band testv/ivas_bws_20fr_start_SWB.txt -masa 1 testv/stv1MASA1TC48c.met 13200 48 testv/stv1MASA1TC48c.wav bit ../IVAS_dec BINAURAL 48 bit testv/stv1MASA1TC48c.wav_13200_48-48_BINAURAL.tst @@ -1239,7 +1236,6 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_dec -render_config testv/rend_config_combined.cfg -t testv/headrot.csv BINAURAL_ROOM_REVERB 48 bit testv/stv1MASA1TC48c.wav_BINAURAL_ROOM_REVERB_256000_48-48_Headrot_custom_config.tst - // Multi-channel 5_1 at 13.2 kbps, 48kHz in, 48kHz out ../IVAS_cod -mc 5_1 13200 48 testv/stv51MC48c.wav bit ../IVAS_dec 5_1 48 bit testv/stv51MC48c.wav_MC51_13200_48-48_5_1.tst @@ -1562,7 +1558,6 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_dec EXT 48 bit testv/stv714MC48c.wav_sw_48-48_EXT.tst - // Stereo downmix to bit-exact EVS at 13200 kbps, 32kHz in, 32kHz out ../IVAS_cod -stereo_dmx_evs 13200 32 testv/stvST32c.wav bit ../IVAS_dec 32 bit testv/stvST32c.wav_StereoDmxEVS_13200_32-32.tst @@ -1572,7 +1567,6 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_dec 48 bit testv/stvST48c.wav_StereoDmxEVS_24400_48-48.tst - // EVS non-diegetic panning at 64 kbps, 48kHz in, 48kHz out, STEREO out ../IVAS_cod 64000 48 testv/stv48c.wav bit ../IVAS_dec -non_diegetic_pan -50 48 bit testv/stv48c.pcm_EVS_64000_48-48_STEREO_NON-DIEGETIC-PAN_-50.tst @@ -1582,7 +1576,6 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_dec -non_diegetic_pan 80 STEREO 48 bit testv/stv1ISM48s.pcm_ISM_32000_48-48_STEREO_NON-DIEGETIC-PAN_80.tst - // stereo at 32 kbps, 48 kHz in, 32 kHz out, DTX on, JBM Prof 0 ../IVAS_cod -stereo -dtx 32000 48 testv/stvST48n.wav bit networkSimulator_g192 ../scripts/dly_error_profiles/dly_error_profile_0.dat bit netsimoutput tracefile_sim 2 0 @@ -1859,7 +1852,6 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_dec EXT 48 bit testv/stvOMASA_4ISM_2MASA2TC48c.wav_EXT_sw_48-48.tst - // OSBA FOA 1ISM at 32 kbps, 48kHz in, 48kHz out, BINAURAL out ../IVAS_cod -ism_sba 1 1 testv/stvISM1.csv 32000 48 testv/stvOSBA_1ISM_FOA48c.wav bit ../IVAS_dec BINAURAL 48 bit testv/stvOSBA_1ISM_FOA48c.wav_BINAURAL_32000_48-48.tst @@ -2058,3 +2050,40 @@ networkSimulator_g192 ../scripts/dly_error_profiles/dly_error_profile_5.dat bit ../IVAS_cod -ism 4 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv ../scripts/switchPaths/sw_48-32k_10fr.bin 48 testv/stv4ISM48s.wav bit networkSimulator_g192 ../scripts/dly_error_profiles/dly_error_profile_5.dat bit netsimoutput tracefile_sim 2 0 ../IVAS_dec -obj_edit ../scripts/object_edit/combined_edit.txt -no_delay_cmp -Tracefile tracefile_dec -VOIP BINAURAL 48 netsimoutput testv/stv4ISM48s.wav_sw_48-48_BINAURAL_OE_JBM5.tst + + +// stereo bitrate switching from 13.2 kbps to 128 kbps, 48kHz in, 48kHz out, DTX on, EXT out, rtpdump +../IVAS_cod -rtpdump 3 -dtx -stereo ../scripts/switchPaths/sw_13k2_to_128k_10fr.bin 48 testv/stvST48c.wav bit +../IVAS_dec -VOIP_hf_only=1 EXT 48 bit testv/stvST48c.wav_stereo_sw_48-48_DTX_EXT_rtpdump.tst + +// 4 ISM with metadata bitrate switching from 24.4 kbps to 512 kbps, 48 kHz in, 48 kHz out, DTX on, BINAURAL out, rtpdump, PI data +../IVAS_cod -rtpdump 3 -scene_orientation testv/headrot.csv -device_orientation testv/headrot_case00_3000_q.csv -dtx -ism 4 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv ../scripts/switchPaths/sw_24k4_512k.bin 48 testv/stv4ISM48s.wav bit +../IVAS_dec -VOIP_hf_only=1 BINAURAL 48 bit testv/stv4ISM48s.wav_brate_sw_48-48_DTX_BINAURAL_rtpdump_PIdata.tst + +// SBA FOA bitrate switching from 13.2 kbps to 512 kbps, 48kHz in, 48kHz out, DTX on, BINAURAL out, rtpdump, PI data +../IVAS_cod -rtpdump 3 -scene_orientation testv/headrot_case01_3000_q.csv -device_orientation testv/headrot_case02_3000_q.csv -dtx -sba 1 -max_band fb ../scripts/switchPaths/sw_13k2_512k.bin 48 testv/stvFOA48c.wav bit +../IVAS_dec -VOIP_hf_only=1 FOA 48 bit testv/stvFOA48c.wav_sw_48-48_DTX_BINAURAL_rtpdump_PIdata.tst + +// MASA 2dir 2TC bitrate switching from 13.2 kbps to 512 kbps, 48kHz in, 48kHz out, DTX on, BINAURAL out, rtpdump, PI data +../IVAS_cod -rtpdump 3 -scene_orientation testv/headrot_case03_3000_q.csv -device_orientation testv/headrot.csv -dtx -masa 2 testv/stv2MASA2TC48c.met ../scripts/switchPaths/sw_13k2_512k.bin 48 testv/stv2MASA2TC48c.wav bit +../IVAS_dec -VOIP_hf_only=1 BINAURAL 48 bit testv/stv2MASA2TC48c.wav_sw_48-48_DTX_BINAURAL_rtpdump_PIdata.tst + +// Multi-channel 5_1 bitrate switching from 13.2 kbps to 512 kbps, 48kHz in, 48kHz out, BINAURAL out, rtpdump, PI data +../IVAS_cod -rtpdump 3 -scene_orientation testv/headrot.csv -device_orientation testv/headrot_case02_3000_q.csv -mc 5_1 ../scripts/switchPaths/sw_mctech_5fr.bin 48 testv/stv51MC48c.wav bit +../IVAS_dec -VOIP_hf_only=1 BINAURAL 48 bit testv/stv51MC48c.wav_sw_48-48_BINAURAL_rtpdump_PIdata.tst + +// Stereo downmix to bit-exact EVS at 24400 kbps, 48kHz in, 48kHz out, rtpdump +../IVAS_cod -rtpdump 3 -stereo_dmx_evs 24400 48 testv/stvST48c.wav bit +../IVAS_dec -VOIP_hf_only=1 48 bit testv/stvST48c.wav_StereoDmxEVS_24400_48-48_rtpdump.tst + +// EVS at 13.2 kbps, 48kHz in, 48kHz out, STEREO out, rtpdump +../IVAS_cod -rtpdump 3 13200 48 testv/stv48c.wav bit +../IVAS_dec -VOIP_hf_only=1 48 bit testv/stv48c.pcm_EVS_13200_48-48_STEREO_rtpdump.tst + +// OMASA 2Dir2TC 3ISM at br sw techs 13.2 to 512 kbps start 160 kbps, 48kHz in, 48kHz out, BINAURAL out, rtpdump, PI data +../IVAS_cod -rtpdump 3 -scene_orientation testv/headrot_case01_3000_q.csv -device_orientation testv/headrot_case00_3000_q.csv -ism_masa 3 2 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stv2MASA2TC48c.met ../scripts/switchPaths/sw_13k2_512k_2fr_start_160k_omasatechs_3ism.bin 48 testv/stvOMASA_3ISM_2MASA2TC48c.wav bit +../IVAS_dec -VOIP_hf_only=1 BINAURAL 48 bit testv/stvOMASA_3ISM_2MASA2TC48c.wav_BINAURAL_sw_48-48_rtpdump_PIdata.tst + +// OSBA 2ISM 2OA at bitrate switching 13.2 to 512 kbps, 48kHz in, 48kHz out, BINAURAL out, rtpdump, PI data +../IVAS_cod -rtpdump 3 -scene_orientation testv/headrot_case00_3000_q.csv -device_orientation testv/headrot_case03_3000_q.csv -ism_sba 2 2 testv/stvISM1.csv testv/stvISM2.csv ../scripts/switchPaths/sw_13k2_512k.bin 48 testv/stvOSBA_2ISM_2OA48c.wav bit +../IVAS_dec -VOIP_hf_only=1 BINAURAL 48 bit testv/stvOSBA_2ISM_2OA48c.wav_BINAURAL_sw_48-48_rtpdump_PIdata.tst diff --git a/scripts/dec_header.txt b/scripts/dec_header.txt index 599c7e73ed9171ebb930dd06662ec195ff611448..68aff3635581bc8586825f3ceeb9ac7823cafa11 100644 --- a/scripts/dec_header.txt +++ b/scripts/dec_header.txt @@ -16,7 +16,7 @@ LOG_FILE=Readme_IVAS_dec_log.txt rm -rf tmp rm -rf $CUT_PATH mkdir -p $CUT_PATH -mkdir -p $CUT_PATH/dut/masa_test/dec_output -mkdir -p $CUT_PATH/dut/param_file/dec -mkdir -p $CUT_PATH/dut/sba_bs/raw +mkdir -p $CUT_PATH/ref/masa_test/dec_output +mkdir -p $CUT_PATH/ref/param_file/dec +mkdir -p $CUT_PATH/ref/sba_bs/raw diff --git a/scripts/dec_isar_header.txt b/scripts/dec_isar_header.txt index 454383382f916f091bebd25166b1dba9df32b651..0f449b21c2a70530fc6dbaac718cf2208d95a1af 100644 --- a/scripts/dec_isar_header.txt +++ b/scripts/dec_isar_header.txt @@ -16,6 +16,6 @@ LOG_FILE=Readme_IVAS_ISAR_dec_log.txt rm -rf tmp rm -rf $CUT_PATH mkdir -p $CUT_PATH -mkdir -p $CUT_PATH/split_rendering/cut +mkdir -p $CUT_PATH/split_rendering/ref diff --git a/scripts/enc_header.txt b/scripts/enc_header.txt index 18387a9326fc3a7342ad272283641a78263e70f3..76ebeee3e1b1ed66a64e8548364248019a2f1587 100644 --- a/scripts/enc_header.txt +++ b/scripts/enc_header.txt @@ -16,7 +16,7 @@ LOG_FILE=Readme_IVAS_enc_log.txt rm -rf tmp rm -rf $CUT_PATH mkdir -p $CUT_PATH -mkdir -p $CUT_PATH/dut/masa_test/bitstreams -mkdir -p $CUT_PATH/dut/param_file/enc -mkdir -p $CUT_PATH/dut/sba_bs/pkt +mkdir -p $CUT_PATH/ref/masa_test/bitstreams +mkdir -p $CUT_PATH/ref/param_file/enc +mkdir -p $CUT_PATH/ref/sba_bs/pkt diff --git a/scripts/strip_split_rendering.py b/scripts/find_fp_insn.sh old mode 100644 new mode 100755 similarity index 59% rename from scripts/strip_split_rendering.py rename to scripts/find_fp_insn.sh index 40da43bbcbb40ddff642319e2ff91692f783a7a1..fe0090a55efe9c1b8d5c11f1db4afc42c3b559fb --- a/scripts/strip_split_rendering.py +++ b/scripts/find_fp_insn.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/env bash # # (C) 2022-2025 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB, @@ -30,5 +30,64 @@ # the United Nations Convention on Contracts on the International Sales of Goods. # -import glob -import os +# fp_insn_finder.sh +# Usage: ./find_fp_insn.sh +# disassembles executable, lists common floating-point instructions + +set -euo pipefail + +if [ $# -ne 1 ]; then + echo "Usage: $0 " + echo "Find floating-point instructions in an executable based on assembler instructions" + echo "Pre-requisites: Perl or gawk" + exit 1 +fi + +EXE="$1" +if [ ! -x "$EXE" ]; then + echo "Error: '$EXE' is no executable" + exit 2 +fi + +perl_avail=0 +# check, whether we have perl installed +if command -v perl >/dev/null 2>&1; then + perl_avail=1 +fi + +gawk_avail=0 +awk_option="" +# check, whether we have awk (POSIX) or gawk (GNU) on the system +if command -v gawk >/dev/null 2>&1; then + gawk_avail=1 + awk_option="--posix" +fi + + +if [ $perl_avail -ne 0 ]; then + + objdump -d -Mintel "$EXE" \ + | perl -nE ' + # Regex for floating-point instructions + our $fp = qr/\b(?:fadd|fsub|fmul|fdiv|fld|fst|movss|movsd|addss|addsd|subss|subsd|mulss|mulsd|divss|divsd)\b/; + if (/^[0-9a-f]+ <([^>]+)>:/) { $func = $1 } + elsif (/$fp/) { say "$func: $_" } + ' + +else + + objdump -d -Mintel "$EXE" | + awk ${awk_option} ' + /^[0-9a-f]+ :.*$/, "") + func = $0 + next + } + /(^|[^[:alnum:]_])(fadd|fsub|fmul|fdiv|fld|fst|movss|movsd|addss|addsd|subss|subsd|mulss|mulsd|divss|divsd)($|[^[:alnum:]_])/ { + print func ": " $0 + } + ' + +fi diff --git a/scripts/isar_post_rend_header.txt b/scripts/isar_post_rend_header.txt index ed7eb2098866cbcbdcd8e3c4fc7c507ec3ba8415..99a84b6c36a0a476b9617c5b8befc5c449433a95 100644 --- a/scripts/isar_post_rend_header.txt +++ b/scripts/isar_post_rend_header.txt @@ -15,7 +15,7 @@ LOG_FILE=Readme_IVAS_isar_post_rend_log.txt rm -rf tmp rm -rf $CUT_PATH -mkdir -p $CUT_PATH/split_rendering/cut +mkdir -p $CUT_PATH/split_rendering/ref diff --git a/scripts/ivas_conformance/README.md b/scripts/ivas_conformance/README.md new file mode 100644 index 0000000000000000000000000000000000000000..e5fb0824ff9854e03a17ed52893398e94dc13e68 --- /dev/null +++ b/scripts/ivas_conformance/README.md @@ -0,0 +1,22 @@ +# IVAS conformance scripts + +This folder contains scripts for running IVAS conformance tests. This is a placeholder file for instructions. + +no-BE conformance USAGE + +Following CMDs needs to be executed from ivas-codec root folder: + +################generate testvec package and encoder refs (temporary step to obtain testvec package, this step will be removed in final delivery) ############ +sh ivas_be_conf_test_gen.sh +PYTHONPATH=scripts python scripts/ivas_conformance/runConformance.py --testvecDir $PWD/testvec --ref_build_path=testvec/ref_bin --cut_build_path=testvec/cut_bin --test-mode=ENC --regenerate-enc-refs + + + +Encoder conformance: + - PYTHONPATH=scripts python scripts/ivas_conformance/runConformance.py --testvecDir $PWD/testvec --ref_build_path=testvec/ref_bin --cut_build_path=testvec/cut_bin --test-mode=ENC +Decoder conformance: + - PYTHONPATH=scripts python scripts/ivas_conformance/runConformance.py --testvecDir $PWD/testvec --ref_build_path=testvec/ref_bin --cut_build_path=testvec/cut_bin --test-mode=DEC +Renderer conformance: + - PYTHONPATH=scripts python scripts/ivas_conformance/runConformance.py --testvecDir $PWD/testvec --ref_build_path=testvec/ref_bin --cut_build_path=testvec/cut_bin --test-mode=REND +Split renderer confomance: + - diff --git a/scripts/ivas_conformance/runConformance.py b/scripts/ivas_conformance/runConformance.py new file mode 100644 index 0000000000000000000000000000000000000000..15f9fbcd534704c4202dd7660a7deb3010488883 --- /dev/null +++ b/scripts/ivas_conformance/runConformance.py @@ -0,0 +1,630 @@ +#!/usr/bin/env python3 + +""" +(C) 2022-2025 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB, +Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., +Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, +Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other +contributors to this repository. All Rights Reserved. + +This software is protected by copyright law and by international treaties. +The IVAS codec Public Collaboration consisting of Dolby International AB, Ericsson AB, +Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., +Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, +Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other +contributors to this repository retain full ownership rights in their respective contributions in +the software. This notice grants no license of any kind, including but not limited to patent +license, nor is any license granted by implication, estoppel or otherwise. + +Contributors are required to enter into the IVAS codec Public Collaboration agreement before making +contributions. + +This software is provided "AS IS", without any express or implied warranties. The software is in the +development stage. It is intended exclusively for experts who have experience with such software and +solely for the purpose of inspection. All implied warranties of non-infringement, merchantability +and fitness for a particular purpose are hereby disclaimed and excluded. + +Any dispute, controversy or claim arising under or in relation to providing this software shall be +submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in +accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and +the United Nations Convention on Contracts on the International Sales of Goods. +""" +import argparse +import os +import platform +import re +import numpy as np +import subprocess +import tempfile +import sys +from typing import Optional +from multiprocessing import Process, Value +import shutil + +sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")) + +from pyaudio3dtools.audiofile import readfile, writefile +from pyaudio3dtools.audioarray import resample + + +class MLDConformance: + IVAS_Bins = { + "ENC": "IVAS_cod", + "DEC": "IVAS_dec", + "REND": "IVAS_rend", + "ISAR": "ISAR_post_rend", + } + + def setupCommon(self): + self.Commands = dict() + self.EncoderToDecoderCmdMap = dict() + for tag in MLDConformance.IVAS_Bins.keys(): + self.Commands[tag] = list() + + # CREATE OUTPUT DIRECTORY STRUCTURE : CLEAN PREV OUTPUT + self.outputDir = os.path.join(self.scriptsDir, "CUT_OUTPUTS") + if os.path.exists(self.outputDir): + shutil.rmtree(self.outputDir, ignore_errors=False) + os.makedirs(self.outputDir, exist_ok=True) + subdirs = ["enc", "dec", "renderer_short", "split_rendering"] + for odir in subdirs: + os.makedirs(os.path.join(self.outputDir, "ref", odir), exist_ok=True) + os.makedirs(os.path.join(self.outputDir, "dut", odir), exist_ok=True) + + self.logFile = os.path.join(self.outputDir, "runlog.txt") + self.failedCmdsFile = os.path.join(self.outputDir, "failedCmds.txt") + open(self.logFile, "w").close() + open(self.failedCmdsFile, "w").close() + + def setupDUT(self): + self.cut_build_path = args.cut_build_path + self.filter = args.filter + self.mldbin = os.path.join(self.toolsdir, platform.system(), "mld") + self.CutBins = dict() + self.mldcsv = dict() + self.sampleStats = dict() + + for tag in MLDConformance.IVAS_Bins.keys(): + self.CutBins[tag] = os.path.join( + self.cut_build_path, MLDConformance.IVAS_Bins[tag] + ) + self.mldcsv[tag] = os.path.join(self.outputDir, f"mld_{tag}.csv") + self.sampleStats[tag] = os.path.join( + self.outputDir, f"sampleStats_{tag}.csv" + ) + + def setupRef(self): + self.RefBins = dict() + self.ref_build_path = self.args.ref_build_path + for tag in MLDConformance.IVAS_Bins.keys(): + self.RefBins[tag] = os.path.join( + self.ref_build_path, MLDConformance.IVAS_Bins[tag] + ) + + def setup(self): + self.setupCommon() + self.setupRef() + if not self.args.regenerate_enc_refs: + self.setupDUT() + + def __init__(self, args) -> None: + self.args = args + self.scriptsDir = os.path.abspath(os.path.join(os.path.dirname(__file__), "..")) + self.testvecDir = args.testvecDir + self.toolsdir = os.path.join(self.scriptsDir, "tools") + self.testvDir = os.path.join(self.testvecDir, "testv") + self.executedTests = Value("i", 0) + self.failedTests = Value("i", 0) + self.setup() + + def accumulateCommands(self): + for root, _, files in os.walk(self.testvecDir): + for file_name in files: + basename, ext = os.path.splitext(file_name) + if ( + ("Readme_IVAS_" in basename) + and ext == ".txt" + and not ("ISAR" in basename) + ): + print(f"Accumulating commands from {file_name}") + file = os.path.join(root, file_name) + self.parseCommandsFile(file) + self.mapEncoderToDecoderCommands() + print("No of tests :") + for key in self.Commands.keys(): + print(f" {key} : {len(self.Commands[key])}") + + def parseCommandsFile(self, filePath): + with open(filePath) as fp: + for line in fp.readlines(): + m = re.search(r"^\$(CUT_.+_BIN) ", line) + if m: + tag = m.group(1).split("_")[1] + if tag in self.Commands.keys(): + self.Commands[tag].append(line) + + def getPcmPytestTag(self, command: str) -> str: + decInput = ( + os.path.basename(command.split()[-2]) + .replace(".fer", "") + .replace("_cut", "") + ) + return decInput.split(".")[-2] + + def getEncPytestTag(self, command: str) -> str: + return os.path.basename(command.split()[-1]).split(".")[-2] + + def mapEncoderToDecoderCommands(self): + decoderPyTestTags = dict() + encoderPyTestTags = dict() + for idx, command in enumerate(self.Commands["DEC"]): + decoderPyTestTags[self.getPcmPytestTag(command)] = idx + for idx, command in enumerate(self.Commands["ENC"]): + encoderPyTestTags[self.getEncPytestTag(command)] = idx + + for encTag in encoderPyTestTags.keys(): + if encTag in decoderPyTestTags.keys(): + self.EncoderToDecoderCmdMap[encoderPyTestTags[encTag]] = ( + decoderPyTestTags[encTag] + ) + if self.args.verbose: + print( + f"{encTag} {encoderPyTestTags[encTag]} -> {decoderPyTestTags[encTag]}" + ) + print(f"{self.Commands['ENC'][encoderPyTestTags[encTag]]}") + print(f"{self.Commands['DEC'][decoderPyTestTags[encTag]]}") + else: + print(f"{encTag} not fount in decoder") + print( + f"Mapped decoder tests for {len(self.EncoderToDecoderCmdMap)} encoder tests out of {len(self.Commands['ENC'])} tests" + ) + assert len(self.EncoderToDecoderCmdMap) == len( + self.Commands["ENC"] + ), "Failed to Map Encoder Commands to Decoder Commands" + + def genEncoderReferences(self, command: str, encCommandIdx: int): + # RUN ENCODER COMMAND LINE WITH REFERENCE ENCODER + refCommand = self.reformatCommand(command=command, ref=True) + refEncOutput = self.getOutputFile(refCommand) + if not os.path.exists(refEncOutput): + self.process( + command=self.setCommandExec(tag="ENC", command=refCommand, ref=True) + ) + + # FIND CORRESPONDING DECODER COMMAND + decCommandIdx = self.EncoderToDecoderCmdMap[encCommandIdx] + refDecOutputFile = refEncOutput.replace(".192", "_REFDECODED.wav") + + command = self.reformatCommand( + command=self.Commands["DEC"][decCommandIdx], ref=True + ) + command = command.replace("-VOIP", "") + refDecCmd = ( + [self.RefBins["DEC"]] + + command.split()[1:-2] + + [refEncOutput, refDecOutputFile] + ) + self.process(command=" ".join(refDecCmd)) + self.executedTests.value += 1 + self.stats() + + def runReferenceGeneration(self): + processes = list() # Multiprocess list + commands = conformance.Commands["ENC"] + self.totalTests = len(commands) + if not self.args.no_multi_processing: + for commandIdx, command in enumerate(commands): + p = Process( + target=self.genEncoderReferences, args=(command, commandIdx) + ) + processes.append(p) + p.start() + for p in processes: + p.join() + else: + for commandIdx, command in enumerate(commands): + conformance.genEncoderReferences(command, commandIdx) + + def runOneEncoderTest(self, command: str): + encPytestTag = self.getEncPytestTag(command) + refEncOutput = self.getOutputFile(command) + refEncOutput = refEncOutput.replace( + "$CUT_PATH/ref/param_file/enc/", + f"{self.testvecDir}/testv/ref/param_file/enc/", + ) + refEncOutput = refEncOutput.replace( + "$CUT_PATH/ref/sba_bs/pkt/", + f"{self.testvecDir}/testv/ref/sba_bs/pkt/", + ) + refDecOutputFile = refEncOutput.replace(".192", "_REFDECODED.wav") + + # Run CUT Encoder + encCommandIdx = self.Commands["ENC"].index(command) + command = self.reformatCommand(command=command, ref=False) + command = self.setCommandExec(tag="ENC", command=command, ref=False) + dutEncOutput = self.getOutputFile(command) + self.process(command=command) + assert ".192" in dutEncOutput, "Output file not identified" + + # Decode the encoded output with Reference decoder + dutDecOutputFile = dutEncOutput.replace(".192", "_CUT_REFDECODED.wav") + decCommandIdx = self.EncoderToDecoderCmdMap[encCommandIdx] + command = self.reformatCommand( + command=self.Commands["DEC"][decCommandIdx], ref=False + ) + command = command.replace("-VOIP", "") + dutDecCmd = ( + [self.RefBins["DEC"]] + + command.split()[1:-2] + + [dutEncOutput, dutDecOutputFile] + ) + self.process(command=" ".join(dutDecCmd)) + self.mld( + "ENC", encPytestTag, refFile=refDecOutputFile, dutFile=dutDecOutputFile + ) + + def runOneDecoderTest(self, tag: str, command: str): + dutPytestTag = self.getPcmPytestTag(command) + refInputFile = command.split()[-2].replace( + "$REF_PATH/ref", f"{self.testvDir}/ref" + ) + # refInputFile = refInputFile.replace("_cut.192.fer", ".192") + # refInputFile = refInputFile.replace(".fer.192", ".192").replace(".192.fer", ".192").replace("_cut.192.fer", ".192").replace("_cut.192", ".192") + refDecOutput = self.getOutputFile(command).replace( + "$CUT_PATH/ref", f"{self.testvDir}/ref" + ) + command = self.reformatCommand(command=command, ref=False) + # command = command.replace("-VOIP", "") + dutDecOutputFile = self.getOutputFile(command) + dutDecCmd = ( + [self.CutBins["DEC"]] + + command.split()[1:-2] + + [refInputFile, dutDecOutputFile] + ) + self.process(command=" ".join(dutDecCmd)) + + ##### skip MLD verification for files with only 1 frame as MLD does not run with such files. Possible solution: append 0s and then compare ##### + if refInputFile.find("_cut.192.fer") == -1: + self.mld( + "DEC", dutPytestTag, refFile=refDecOutput, dutFile=dutDecOutputFile + ) + + def getRendOutputFile(self, command: str): + cmds = command.split() + for idx, cmd in enumerate(cmds): + if cmd == "-o" and (idx + 1) < len(cmds): + return cmds[idx + 1] + assert False, "Outputname not found" + + def runOneRendererTest(self, tag: str, command: str): + refRendOutputFile = self.getRendOutputFile(command).replace( + "$CUT_PATH/renderer_short", f"{self.testvDir}/renderer_short" + ) + rendPytestTag = os.path.basename(refRendOutputFile).split(".")[-2] + command = self.reformatCommand(command=command, ref=False) + dutRendCmd = " ".join([self.CutBins["REND"]] + command.split()[1:]) + dutRendOutputFile = self.getRendOutputFile(dutRendCmd) + self.process(command=dutRendCmd) + self.mld( + "REND", rendPytestTag, refFile=refRendOutputFile, dutFile=dutRendOutputFile + ) + + def getOutputFile(self, command: str): + return command.split()[-1] + + def setCommandExec(self, tag: str, command, ref: bool): + exec = self.RefBins[tag] if ref else self.CutBins[tag] + commands = command.split() + return " ".join([exec, *commands[1:]]) + + def reformatCommand(self, command: str, ref: bool) -> str: + command = command.replace("$TESTV_PATH", self.scriptsDir) + command = command.replace( + "$REF_PATH/split_rendering", f"{self.testvecDir}/testv/split_rendering" + ) + + ################ HACKS ######################### + command = command.replace("_cut.192.fer", ".192") + command = command.replace("_cut.192", ".192") + command = command.replace(".fer.192", ".192") + command = command.replace(".192.fer", ".192") + ################################################## + command = command.replace( + "$REF_PATH/ref/param_file/", f"{self.testvDir}/ref/param_file/" + ) + command = command.replace( + "$REF_PATH/ref/sba_bs/pkt/", f"{self.testvDir}/ref/sba_bs/pkt/" + ) + if ref: + command = command.replace( + "$CUT_PATH/dut/sba_bs/pkt/", f"{self.testvDir}/ref/sba_bs/pkt/" + ) + command = command.replace( + "$CUT_PATH/dut/param_file/", f"{self.testvDir}/ref/param_file/" + ) + command = command.replace( + "$CUT_PATH/ref/param_file/", f"{self.testvDir}/ref/param_file/" + ) + command = command.replace( + "$CUT_PATH/renderer_short/ref/", f"{self.testvDir}/ref/renderer_short/" + ) + command = command.replace( + "$CUT_PATH/split_rendering/cut/", + f"{self.testvDir}/ref/split_rendering/", + ) + command = command.replace( + "$CUT_PATH/ref/sba_bs/", f"{self.testvDir}/ref/sba_bs/" + ) + else: + #command = command.replace( + # "$CUT_PATH/dut/sba_bs/pkt/", f"{self.outputDir}/dut/enc/" + #) + command = command.replace( + "$CUT_PATH/ref/param_file/enc/", f"{self.outputDir}/dut/enc/" + ) + command = command.replace( + "$CUT_PATH/ref/param_file/dec/", f"{self.outputDir}/dut/dec/" + ) + command = command.replace( + "$CUT_PATH/renderer_short/ref/", f"{self.outputDir}/dut/renderer_short/" + ) + command = command.replace( + "$CUT_PATH/split_rendering/cut/", + f"{self.outputDir}/dut/split_rendering/", + ) + command = command.replace( + "$CUT_PATH/ref/sba_bs/pkt/", f"{self.outputDir}/dut/enc/" + ) + command = command.replace( + "$CUT_PATH/ref/sba_bs/raw/", f"{self.outputDir}/dut/dec/" + ) + + return command + + def runOneCommand(self, tag: str, command: str): + if tag == "ENC": + self.runOneEncoderTest(command) + elif tag == "DEC": + self.runOneDecoderTest(tag, command) + elif tag == "REND": + self.runOneRendererTest(tag, command) + else: + assert False, f"Un-implemented Tag {tag}" + self.executedTests.value += 1 + self.stats() + + def runTag(self, tag: str): + self.executedTests.value = 0 + self.failedTests.value = 0 + # reset MLD, Sample Stats + open(self.mldcsv[tag], "w").close() + with open(self.sampleStats[tag], "w") as f: + f.write(f"PYTESTTAG, MAXDIFF, RMSdB, BEFRAMES_PERCENT, MAX_MLD\n") + + processes = list() # Multiprocess list + commands = list() + if self.filter: + for command in self.Commands[tag]: + if self.filter in command: + commands.append(command) + else: + commands = self.Commands[tag] + + self.totalTests = len(commands) + print( + f"Executing tests for {tag} {'Filter='+self.filter if self.filter else ''} ({self.totalTests} tests)" + ) + if not self.args.no_multi_processing: + for command in commands: + p = Process( + target=self.runOneCommand, + args=(tag, command), + ) + processes.append(p) + p.start() + for p in processes: + p.join() + else: + for command in commands: + self.runOneCommand(tag, command) + + def process(self, command) -> int: + if self.args.verbose: + print(command) + with open(self.logFile, "a") as fd: + fd.write(command + "\n") + + with open(self.logFile, "a") as fd: + if not self.args.dryrun: + c = subprocess.run( + command, stdout=fd, stderr=subprocess.STDOUT, text=True, shell=True + ) + if c.returncode: + with open(self.failedCmdsFile, "a") as f: + f.write(command + "\n") + self.failedTests.value += 1 + # c.check_returncode() + return 0 + + def stats(self): + print( + f"Executed: {self.executedTests.value} / {self.totalTests} Failed: {self.failedTests.value}", + end="\r", + ) + + def getSampleStats(self, refSamples: np.ndarray, dutSamples: np.ndarray): + nSamples = min(refSamples.shape[0], dutSamples.shape[0]) + diff = (refSamples[:nSamples] / 32768.0) - (dutSamples[:nSamples] / 32768.0) + beSamplesPercent = ( + 100.0 * np.sum(diff == 0) / refSamples.shape[0] / refSamples.shape[1] + ) + maxDiff = np.abs(diff).max() + rmsdB = ( + int(10.0 * np.log10(np.average(diff**2) + np.finfo(np.float64).eps) * 10) + / 10.0 + ) + return (maxDiff, rmsdB, beSamplesPercent) + + def mld(self, tag, pytestTag, refFile, dutFile): + mldThisFile = np.zeros(0) + with tempfile.TemporaryDirectory() as tmpdir: + refSamples, fsR = readfile(refFile, outdtype="float") + dutSamples, fsD = readfile(dutFile, outdtype="float") + assert ( + refSamples.shape[1] == dutSamples.shape[1] + ), "No of channels mismatch if ref vs cut" + maxDiff, rmsdB, beSamplesPercent = self.getSampleStats( + refSamples, dutSamples + ) + + nChans = refSamples.shape[1] + + if fsR != 48000: + refSamples = np.clip(resample(refSamples, fsR, 48000), -32768, 32767) + if fsD != 48000: + dutSamples = np.clip(resample(dutSamples, fsD, 48000), -32768, 32767) + + for ch in range(nChans): + mldFile = os.path.join( + tmpdir, f"{tempfile.gettempprefix()}_ch{ch}_MLD.csv" + ) + refFileMono = os.path.join( + tmpdir, os.path.basename(refFile).replace(".wav", f"_ch{ch}.wav") + ) + dutFileMono = os.path.join( + tmpdir, os.path.basename(dutFile).replace(".wav", f"_ch{ch}.wav") + ) + writefile(refFileMono, refSamples[:, ch], 48000) + writefile(dutFileMono, dutSamples[:, ch], 48000) + command = [ + self.mldbin, + "-o", + mldFile, + "-s", + refFileMono, + dutFileMono, + ] + self.process(" ".join(command)) + mldThisChan = np.loadtxt(mldFile, delimiter=" ", dtype=float) + if ch == 0: + mldThisFile = mldThisChan + else: + mldThisFile = np.maximum(mldThisFile, mldThisChan) + + if mldThisFile.size > 0: + with open(self.mldcsv[tag], "ab") as f: + np.savetxt(f, mldThisFile, delimiter=",") + with open(self.sampleStats[tag], "a") as f: + f.write( + f"{pytestTag}, {maxDiff}, {rmsdB}, {beSamplesPercent}, {mldThisFile.max()}\n" + ) + + def doAnalysis(self, selectTag="all"): + keys = MLDConformance.IVAS_Bins.keys() if selectTag == "all" else [selectTag] + for tag in keys: + if os.path.exists(self.mldcsv[tag]): + mdlValues = np.loadtxt(self.mldcsv[tag], delimiter=" ", dtype=float) + N = mdlValues.shape[0] + if N == 0: + continue + m0 = np.sum(mdlValues == 0) + m1 = np.sum(mdlValues <= 1.0) + m2 = np.sum(mdlValues <= 2.0) + m5 = np.sum(mdlValues <= 5.0) + + PCNT = lambda num: int(1000 * num / N) / 10.0 + print(f"\n##########################################################") + print(f"<{tag}> Total Frames: {N}") + print(f"<{tag}> MAX MLD across all frames : {mdlValues.max()}") + print(f"<{tag}> Frames with MLD == 0 : {m0} frames ({PCNT(m0)}%)") + print(f"<{tag}> Frames with MLD <= 1 : {m1} frames ({PCNT(m1)}%)") + print(f"<{tag}> Frames with MLD <= 2 : {m2} frames ({PCNT(m2)}%)") + print(f"<{tag}> Frames with MLD <= 5 : {m5} frames ({PCNT(m5)}%)") + print("##########################################################\n") + + +if __name__ == "__main__": + parser = argparse.ArgumentParser( + description="Compare .wav files in two folders using mld per frame" + ) + + parser.add_argument( + "--testvecDir", + type=str, + required=True, + help="Base folder containing a set of conformance scripts named Readme_IVAS_xxxx.txt", + ) + parser.add_argument( + "--ref_build_path", + type=str, + help="Path to the reference build folder containing IVAS Encoder, Decoder, Renderer and Post Render binaries", + ) + parser.add_argument( + "--cut_build_path", + type=str, + help="Path to the CUT build folder containing IVAS Encoder, Decoder, Renderer and Post Render binaries", + ) + parser.add_argument( + "--regenerate-enc-refs", + default=False, + action="store_true", + help="Regenerate the encoder reference bitstreams and decoded outputs", + ) + parser.add_argument( + "--verbose", + default=False, + action="store_true", + help="Enable verbose printing", + ) + parser.add_argument( + "--dryrun", + default=False, + action="store_true", + help="Do not run any processing, just dump command lines to runlog", + ) + + parser.add_argument( + "--filter", + type=str, + default=None, + help="Filter test based on text provided", + ) + parser.add_argument( + "--test-mode", + type=str, + default="ALL", + help='Choose tests to run ["ENC", "DEC", "REND", "ISAR", "ALL"]', + ) + parser.add_argument( + "--no-multi-processing", + default=False, + action="store_true", + help="Disable multi-processing for sequential test run (debugging)", + ) + parser.add_argument( + "--analyse-only", + default=False, + action="store_true", + help="Do not run DUT, use existing mld and bitdiff stats files to generate analysis only", + ) + + args = parser.parse_args() + + conformance = MLDConformance(args) + + conformance.accumulateCommands() + + if args.regenerate_enc_refs: + conformance.runReferenceGeneration() + sys.exit(0) + + testTags = ( + MLDConformance.IVAS_Bins.keys() if args.test_mode == "ALL" else [args.test_mode] + ) + for tag in testTags: + if tag == "ISAR": + # Not implemented yet + continue + if not args.analyse_only: + conformance.runTag(tag) + conformance.doAnalysis(selectTag=tag) diff --git a/scripts/jbm_header.txt b/scripts/jbm_header.txt index d244c83b3f63757139e057810c66b467f4941957..57f59809f9bd0cd076daa8f447803e9a8859daf4 100644 --- a/scripts/jbm_header.txt +++ b/scripts/jbm_header.txt @@ -16,7 +16,7 @@ LOG_FILE=Readme_IVAS_jbm_log.txt rm -rf tmp rm -rf $CUT_PATH mkdir -p $CUT_PATH -mkdir -p $CUT_PATH/dut/masa_test/dec_output -mkdir -p $CUT_PATH/dut/param_file/dec -mkdir -p $CUT_PATH/dut/sba_bs/raw +mkdir -p $CUT_PATH/ref/masa_test/dec_output +mkdir -p $CUT_PATH/ref/param_file/dec +mkdir -p $CUT_PATH/ref/sba_bs/raw diff --git a/scripts/lc3plus_lib_setup/get_lc3plus.sh b/scripts/lc3plus_lib_setup/get_lc3plus.sh index f654768707921d45b2f6cbfbe90881cc6a528649..2077484cc9178e9f0578e63ad25c3957c191e6ed 100755 --- a/scripts/lc3plus_lib_setup/get_lc3plus.sh +++ b/scripts/lc3plus_lib_setup/get_lc3plus.sh @@ -3,45 +3,36 @@ # This script shall only be used by automated continuous integration systems printf "Cleaning old version of LC3plus\n" -rm -rf lib_lc3plus +rm -rf lib_lc3plus/* printf "Downloading LC3plus code\n" -if true; then - # Waiting for official ETSI release. - # TODO: add new URL, remove `if false` when package goes public - curl -o ./lc3plus_sources.zip https://www.etsi.org/deliver/etsi_ts/103600_103699/103634/01.05.01_60/ts_103634v010501p0.zip - unzip lc3plus_sources.zip -d . - rm lc3plus_sources.zip - cp -r "ETSI_Release/LC3plus_ETSI_src_v5f640bd48cc_20240516/src/floating_point" lib_lc3plus - rm -r ETSI_Release -else - # Temp solution for downloading WIP ETSI package - # LC3_ETSI_REPO_URL must be define before running the script - git clone "$LC3_ETSI_REPO_URL" - cp -r lc3_etsi_release/src/floating_point lib_lc3plus - rm -rf lc3_etsi_release -fi + +curl -o ./lc3plus_sources.zip https://www.etsi.org/deliver/etsi_ts/103600_103699/103634/01.06.01_60/ts_103634v010601p0.zip +unzip -o lc3plus_sources.zip -d . -x "__MACOSX/*" "package.info" +rm lc3plus_sources.zip +cp -r LC3plus_ETSI_src_v527e88bdddb_20251022/src/floating_point/* lib_lc3plus +rm -r LC3plus_ETSI_src_v527e88bdddb_20251022 # Remove unneeded files printf "Removing unneeded files\n" -rm lib_lc3plus/codec_exe.c # Only used for executable -rm lib_lc3plus/makefile # Build handled at IVAS level -rm -r lib_lc3plus/msvc # Build handled at IVAS level +rm lib_lc3plus/codec_exe.c # Only used for executable +rm lib_lc3plus/makefile # Build handled at IVAS level +rm -r lib_lc3plus/msvc # Build handled at IVAS level rm lib_lc3plus/plc_noise_substitution0.c # Empty file -rm lib_lc3plus/tinywavein_c.h # Only used for executable -rm lib_lc3plus/tinywaveout_c.h # Only used for executable +rm lib_lc3plus/tinywavein_c.h # Only used for executable +rm lib_lc3plus/tinywaveout_c.h # Only used for executable # Limit file permissions printf "Limiting file permissions\n" -find lib_lc3plus -type f -print0 | \ -xargs -0 -I {} \ -chmod -x {} +find lib_lc3plus -type f -print0 | + xargs -0 -I {} \ + chmod -x {} # include options.h in all C files printf "Including options.h and wmc_auto.h in C files\n" -find lib_lc3plus -name '*.[ch]' -type f -print0 | \ -xargs -0 -I {} \ -sed -i ' +find lib_lc3plus -name '*.[ch]' -type f -print0 | + xargs -0 -I {} \ + sed -i ' # range: from 1st line to first match 1,/^#include/ { # insert lines before first match @@ -53,17 +44,21 @@ sed -i ' # Remove whitespace from preprocessor commands printf "Removing whitespace from preprocessor commands\n" -find lib_lc3plus -name '*.[ch]' -type f -print0 | \ -xargs -0 -I {} \ -sed -i 's/^#[[:space:]]\+/#/' {} +find lib_lc3plus -name '*.[ch]' -type f -print0 | + xargs -0 -I {} sh -c ' + sed -i "s/^#[[:space:]]\+/#/" "$1" + sed -i "s/^#\(define\|undef\|ifdef\|ifndef\|endif\|if\|else\|elif\|include\)[[:space:]]\+/#\1 /" "$1" + ' _ {} -# fix for sanitizer issues -sed -i 's/st->low << 8/(LC3_INT)((LC3_UINT32)st->low << 8)/' lib_lc3plus/ari_codec.c -sed -i 's/~3/(uintptr_t)(~3)/' lib_lc3plus/lc3plus.c +# delete define of NPRM_RESQ - not used anywhere in LC3plus but conflicts with IVAS +sed -i '/^\/\* RESIDUAL CODING \*\/$/d; /^#define NPRM_RESQ 5 \* MAX_LEN$/d' lib_lc3plus/defines.h # Add .clang-format file to lib_lc3plus to disable formatting there printf "Disabling clang-format in lib_lc3plus directory\n" printf ' DisableFormat: true SortIncludes: Never -' >> lib_lc3plus/.clang-format +' >lib_lc3plus/.clang-format + +# temporary until LC3plus release is updated +git apply scripts/lc3plus_lib_setup/lc3plus_float.patch diff --git a/scripts/lc3plus_lib_setup/get_lc3plus_fx.sh b/scripts/lc3plus_lib_setup/get_lc3plus_fx.sh new file mode 100644 index 0000000000000000000000000000000000000000..389fe76cadaa509c0472a09e5c5280344ed2219f --- /dev/null +++ b/scripts/lc3plus_lib_setup/get_lc3plus_fx.sh @@ -0,0 +1,174 @@ +#!/usr/bin/env bash + +# This script shall only be used by automated continuous integration systems + +set -ux + +printf "Cleaning old version of LC3plus\n" +rm -rf lib_lc3plus/* + +printf "Downloading LC3plus code\n" + +curl -o ./lc3plus_sources.zip https://www.etsi.org/deliver/etsi_ts/103600_103699/103634/01.06.01_60/ts_103634v010601p0.zip +unzip -o lc3plus_sources.zip -d . -x "__MACOSX/*" "package.info" +rm lc3plus_sources.zip +cp -r LC3plus_ETSI_src_v527e88bdddb_20251022/src/fixed_point/* lib_lc3plus +rm -r LC3plus_ETSI_src_v527e88bdddb_20251022 + +cd lib_lc3plus + +printf "Updating LC3plus code for IVAS BASOP compatibility\n" + +# rename files +mv basic_op/dynmem.[ch] . +mv basop_mpy.c basop_mpy_lc3plus.c +mv basop_mpy.h basop_mpy_lc3plus.h +mv basop_util.c basop_util_lc3plus.c +mv basop_util.h basop_util_lc3plus.h +mv fft.c fft_lc3plus.c +mv rom_basop_util.c rom_basop_util_lc3plus.c +mv rom_basop_util.h rom_basop_util_lc3plus.h + +# remove unneeded files +rm makefile +rm codec_exe.c +rm ccConvert.c +rm tinywavein_c.h +rm tinywaveout_c.h +rm -r basic_op +rm -r msvc +rm -r msvc_ccc + +# update header include guards to avoid conflict +sed -i 's|__BASOP_UTIL_H__|__BASOP_UTIL_LC3PLUS_H__|g' basop_util_lc3plus.h +sed -i 's|__BASOP_UTIL_ROM_H__|__BASOP_UTIL_ROM_LC3PLUS_H__|g' rom_basop_util_lc3plus.h + +# update includes for renamed files +sed -i 's|#include "basop_mpy.h"|#include "basop_mpy_lc3plus.h"|g' *.[ch] +sed -i 's|#include "basop_util.h"|#include "basop_util_lc3plus.h"|g' *.[ch] +sed -i 's|#include "rom_basop_util.h"|#include "rom_basop_util_lc3plus.h"|g' *.[ch] + +# deactivate DYNMEM_COUNT, conflicts with WMC tool +sed -i 's|#define DYNMEM_COUNT|// #define DYNMEM_COUNT /* conflicts with WMC tool */|g' defines.h + +# change BASOP_sub_start/end to push/pop_wmops wrapped in #ifdef WMOPS +sed -E -i 's|BASOP(_sub){1,2}_start|push_wmops|g' *.[ch] +sed -E -i 's|BASOP(_sub){1,2}_end|pop_wmops|g' *.[ch] +sed -E -i 's|^(.*p[uo][sp]h?_wmops.*)$|#ifdef WMOPS\n\1\n#endif|g' *.[ch] + +# rename conflicting BASOPs +sed -i 's|Isqrt|Isqrt_lc3plus|g' *.[ch] +sed -i 's|\bMpy_32_16(|Mpy_32_16_lc3plus(|g' *.[ch] +sed -i 's|\bMpy_32_32(|Mpy_32_32_lc3plus(|g' *.[ch] + +# suppress #pragma message() +sed -i 's/\#pragma message(/\/\/ \#pragma message(/g' lc3plus.c + +# add ENABLE_HR_MODE to lc3plus.h +sed -i '/\#define LC3PLUS_H/a\#define ENABLE_HR_MODE' lc3plus.h + +# add macros missing from IVAS at the bottom of the file +sed -i '/\#endif \/\* __BASOP_UTIL_LC3PLUS_H__ \*\//i\ +/* Macros missing from IVAS BASOP, used only in LC3plus */\ +#define L_shl_pos(x, y) (L_shl((x), (y)))\ +#define L_shr_pos(x, y) (L_shr((x), (y)))\ +#define L_shr_pos_pos(x, y) (L_shr((x), (y)))\ +\ +#define L_shr_r_pos(x, shift) (L_shr_r(x, shift))\ +\ +#define shl_pos(x, y) (shl((x), (y)))\ +#define shr_pos(x, y) (shr((x), (y)))\ +#define shr_pos_pos(x, y) (shr((x), (y)))\ +\ +#define lshl_pos(x, y) (lshl(x, y))\ +#define UL_lshr_pos(x, y) (UL_lshr(x, y))\ +#define UL_lshl_pos(x, y) (UL_lshl(x, y))' basop_util_lc3plus.h + +# locally redefine duplicate symbols +sed -i '/\#endif \/\* DEFINES_H \*\//i\ +#define FIX_IVAS_LC3PLUS_DUPLICATES\ +#ifdef FIX_IVAS_LC3PLUS_DUPLICATES\ +#define abs_s_sat abs_s\ +#define BASOP_cfft BASOP_cfft_lc3plus\ +#define BASOP_getTables BASOP_getTables_lc3plus\ +#define BASOP_Util_Add_Mant32Exp BASOP_Util_Add_Mant32Exp_lc3plus\ +#define BASOP_Util_Cmp_Mant32Exp BASOP_Util_Cmp_Mant32Exp_lc3plus\ +#define BASOP_Util_Divide1616_Scale BASOP_Util_Divide1616_Scale_lc3plus\ +#define BASOP_Util_Divide3216_Scale BASOP_Util_Divide3216_Scale_lc3plus\ +#define BASOP_Util_InvLog2 BASOP_Util_InvLog2_lc3plus\ +#define BASOP_Util_Log2 BASOP_Util_Log2_lc3plus\ +#define Copy_Scale_sig Copy_Scale_sig_lc3plus\ +#define exp2_tab_long exp2_tab_long_lc3plus\ +#define exp2w_tab_long exp2w_tab_long_lc3plus\ +#define exp2x_tab_long exp2x_tab_long_lc3plus\ +#define get_size_mpvq_calc_offset_fx get_size_mpvq_calc_offset_fx_lc3plus\ +#define getScaleFactor16 getScaleFactor16_lc3plus\ +#define getScaleFactor32 getScaleFactor32_lc3plus\ +#define i_mult DEPR_i_mult\ +#define Inv16 Inv16_lc3plus\ +#define InvDiffTable InvDiffTable_lc3plus\ +#define InvIntTable InvIntTable_lc3plus\ +#define InvTable InvTable_lc3plus\ +#define ISqrt16 ISqrt16_lc3plus\ +#define ISqrtDiffTable ISqrtDiffTable_lc3plus\ +#define ISqrtTable ISqrtTable_lc3plus\ +#define L_abs_sat L_abs\ +#define ldCoeff ldCoeff_lc3plus\ +#define Norm32Norm Norm32Norm_lc3plus\ +#define POW_ATT_TABLE0 POW_ATT_TABLE0_lc3plus\ +#define POW_ATT_TABLE1 POW_ATT_TABLE1_lc3plus\ +#define RotVector_320 RotVector_320_lc3plus\ +#define RotVector_480 RotVector_480_lc3plus\ +#define Scale_sig Scale_sig_lc3plus\ +#define SineTable320 SineTable320_lc3plus\ +#define SineWindow120 SineWindow120_lc3plus\ +#define SineWindow160 SineWindow160_lc3plus\ +#define SineWindow180 SineWindow180_lc3plus\ +#define SineWindow20 SineWindow20_lc3plus\ +#define SineWindow30 SineWindow30_lc3plus\ +#define SineWindow320 SineWindow320_lc3plus\ +#define SineWindow40 SineWindow40_lc3plus\ +#define SineWindow60 SineWindow60_lc3plus\ +#define SineWindow80 SineWindow80_lc3plus\ +#define Sqrt16 Sqrt16_lc3plus\ +#define SqrtDiffTable SqrtDiffTable_lc3plus\ +#define SqrtTable SqrtTable_lc3plus\ +#define Tab_esc_nb Tab_esc_nb_lc3plus\ +#define tnsAcfWindow tnsAcfWindow_lc3plus\ +#endif /* FIX_IVAS_LC3PLUS_DUPLICATES */' defines.h + +cd - + +# Limit file permissions +printf "Limiting file permissions\n" +find lib_lc3plus -type f -print0 | + xargs -0 -I {} \ + chmod -x {} + +# include options.h and wmc_auto.h in all C files +printf "Including options.h and wmc_auto.h in C files\n" +find lib_lc3plus -name '*.[ch]' -type f -print0 | + xargs -0 -I {} \ + sed -i ' +# range: from 1st line to first match +1,/^#include/ { + # insert lines before first match + /^#include/ i\ +#include "options.h"\ +#include "wmc_auto.h" +} +' {} + +# Remove whitespace from preprocessor commands +printf "Removing whitespace from preprocessor commands\n" +find lib_lc3plus -name '*.[ch]' -type f -print0 | + xargs -0 -I {} sh -c ' + sed -i "s/^#[[:space:]]\+/#/" "$1" + sed -i "s/^#\(define\|undef\|ifdef\|ifndef\|endif\|if\|else\|elif\|include\)[[:space:]]\+/#\1 /" "$1" + ' _ {} + +# Add .clang-format file to lib_lc3plus to disable formatting there +printf "Disabling clang-format in lib_lc3plus directory\n" +printf 'DisableFormat: true +SortIncludes: Never +' >lib_lc3plus/.clang-format diff --git a/scripts/lc3plus_lib_setup/lc3plus_float.patch b/scripts/lc3plus_lib_setup/lc3plus_float.patch new file mode 100644 index 0000000000000000000000000000000000000000..3d3a4beae6eca088b3b086f492982a3c62c4b295 --- /dev/null +++ b/scripts/lc3plus_lib_setup/lc3plus_float.patch @@ -0,0 +1,49 @@ +diff --git b/lib_lc3plus/lc3plus.c a/lib_lc3plus/lc3plus.c +index 7063c4e183..594683cd2c 100644 +--- b/lib_lc3plus/lc3plus.c ++++ a/lib_lc3plus/lc3plus.c +@@ -77,8 +77,10 @@ static int lc3plus_frame_size_supported(LC3PLUS_FrameDuration frame_dms) + case LC3PLUS_FRAME_DURATION_7p5MS: /* fallthru */ + case LC3PLUS_FRAME_DURATION_10MS: + return 1; +- default: return 0; ++ default: break; + } ++ ++ return 0; + } + + static int null_in_list(void **list, int n) +diff --git b/lib_lc3plus/ltpf_decoder.c a/lib_lc3plus/ltpf_decoder.c +index f6560d9710..48aa9a2d70 100644 +--- b/lib_lc3plus/ltpf_decoder.c ++++ a/lib_lc3plus/ltpf_decoder.c +@@ -14,21 +14,25 @@ + #ifdef CR9_C_ADD_1p25MS + static LC3_INT16 get_continuation (LC3_INT32 fading_case, LC3PLUS_FrameDuration frame_dms, LC3_INT32 pos, LC3_INT32 total) + { ++ LC3_INT16 retval; ++ + if ( frame_dms != LC3PLUS_FRAME_DURATION_1p25MS ) + { +- return 0; ++ retval = 0; + } + else + { + if ( pos == total ) + { +- return 0; ++ retval = 0; + } + else + { +- return fading_case; ++ retval = fading_case; + } + } ++ ++ return retval; + } + #endif + diff --git a/scripts/parse_commands.py b/scripts/parse_commands.py index 3a5fb6c1afbda1a07593b1c5a3e1c7867490fe00..38b0d92cdf24b7fcdafbeaa5bb3a7de6736d6712 100644 --- a/scripts/parse_commands.py +++ b/scripts/parse_commands.py @@ -13,7 +13,7 @@ if __name__ == '__main__': parser.add_argument('txt_file',type=str,help='Output txt file, e.g. output.txt') args = parser.parse_args() input = args.input - txt_file = args.txt_file + txt_file = args.txt_file TESTV_PATH='$TESTV_PATH' REF_PATH='$REF_PATH' @@ -26,6 +26,7 @@ if __name__ == '__main__': cmds_rend=[] cmds_isar_post_rend=[] + all_args = set() if path.isdir(input): input = Path(input).rglob('*.html') @@ -35,8 +36,8 @@ if __name__ == '__main__': with open(html_report,'r') as infile: for line in infile.readlines(): - cmds_enc.extend(re.findall(r"DUT encoder command:\\n\\t(.*?)\\n", line)) - cmds_dec.extend(re.findall(r"DUT decoder command:\\n\\t(.*?)\\n", line)) + cmds_enc.extend(re.findall(r"REF encoder command:\\n\\t(.*?)\\n", line)) + cmds_dec.extend(re.findall(r"REF decoder command:\\n\\t(.*?)\\n", line)) cmds_rend.extend(re.findall(r"Running command\\n(.*?)\\n", line)) cmds_isar_post_rend.extend(re.findall(r"Running ISAR post renderer command\\n(.*?)\\n", line)) @@ -49,23 +50,23 @@ if __name__ == '__main__': rend_cmd = False isar_post_rend_cmd = False for line in infile.readlines(): - line = line.split("
")[0] # Remove trailing html tags + line_trim = line.split("
")[0] # Remove trailing html tags if enc_cmd: - cmds_enc.append(line) + cmds_enc.append(line_trim) enc_cmd = False elif dec_cmd: - cmds_dec.append(line) + cmds_dec.append(line_trim) dec_cmd = False elif rend_cmd: - cmds_rend.append(line) + cmds_rend.append(line_trim) rend_cmd = False elif isar_post_rend_cmd: - cmds_isar_post_rend.append(line) + cmds_isar_post_rend.append(line_trim) isar_post_rend_cmd = False else: - if "DUT encoder command" in line: + if "REF encoder command" in line: enc_cmd = True - elif "DUT decoder command" in line: + elif "REF decoder command" in line: dec_cmd = True elif "Running command" in line: rend_cmd = True @@ -78,6 +79,18 @@ if __name__ == '__main__': cmds_rend.sort() cmds_isar_post_rend.sort() + # Remove duplicates from cmds_enc -- some decoder tests use same encoder options + # Relies on the list being sorted + i = 0 + while i + 1 < len(cmds_enc): + if " ".join(cmds_enc[i].split()[:-1]) == " ".join(cmds_enc[i+1].split()[:-1]): + del cmds_enc[i+1] + else: + i = i + 1 + + # Filter out networkSimulator_g192 commands from cmds_rend + cmds_rend = [cmd for cmd in cmds_rend if not "networkSimulator_g192" in cmd] + with open(txt_file.replace('.','_enc.'),'w', newline='\n') as outfile: with open('scripts/enc_header.txt','r') as header: outfile.write(header.read()) @@ -87,7 +100,7 @@ if __name__ == '__main__': # Adjust file arguments, pass other arguments as they are if path.exists(arg): arg = path.relpath(arg).replace('\\','/') - arg = re.sub('IVAS_cod(.exe)?', '$CUT_ENC_BIN', arg) + arg = re.sub('IVAS_cod_ref(.exe)?', '$CUT_ENC_BIN', arg) arg = re.sub('scripts', TESTV_PATH, arg) arg = re.sub('tests', CUT_PATH, arg) args.append(arg) @@ -95,7 +108,7 @@ if __name__ == '__main__': outfile.write(cmd+'\n') bts = re.search(r"\s(([\S]+)(.bts|.192|.pkt|.fer))$", cmd) if bts: - outfile.write('$DIFF_BIN '+bts.group(1).replace(CUT_PATH + r'/dut',REF_PATH + r'/ref')+' '+bts.group(1)+' >> $LOG_FILE 2>&1\n') + outfile.write('$DIFF_BIN '+bts.group(1).replace(CUT_PATH, REF_PATH)+' '+bts.group(1)+' >> $LOG_FILE 2>&1\n') outfile.write('\n') with open('scripts/script_footer.txt','r') as footer: outfile.write(footer.read()) @@ -111,22 +124,25 @@ if __name__ == '__main__': absolute_out = re.search(r"\s(([\S]+)(.wav))$", cmd) args = [] + input_set = False for arg in cmd.split(): # Adjust file arguments, pass other arguments as they are if path.exists(arg): arg = path.relpath(arg).replace('\\','/') - arg = re.sub('IVAS_dec(.exe)?', '$CUT_DEC_BIN', arg) + arg = re.sub('IVAS_dec_ref(.exe)?', '$CUT_DEC_BIN', arg) arg = re.sub('scripts', TESTV_PATH, arg) - arg = re.sub('tests/ref', REF_PATH + r'/ref', arg) # For .fer cases the bitstream is in ref - arg = re.sub('tests/split_rendering/renderer_configs', REF_PATH + r'/split_rendering/renderer_configs', arg) - if re.search("^tests.*192$",arg): - arg = re.sub('tests/split_rendering/cut', REF_PATH + r'/split_rendering/ref', arg) - if re.search("\.wav$",arg): - arg = re.sub('tests', CUT_PATH, arg) # Output argument for decoder ends with .wav - else: - arg = re.sub('tests/dut', REF_PATH + r'/ref', arg) # Input argument - if re.search("^tests.*bit$",arg): - arg = re.sub('tests', CUT_PATH, arg) # Output argument for decoder ends with .wav + # Identify input files + if '.txt' in arg: + arg = re.sub('tests', REF_PATH, arg) + # Identify special cases of output files: dectrace, spltmd.bit + if 'spltmd.bit' in arg or 'dectrace' in arg: + arg = re.sub('tests', CUT_PATH, arg) + if 'tests' in arg: + if not input_set: + arg = re.sub('tests', REF_PATH, arg) # First occurence of tests/* is the input file + input_set = True + else: + arg = re.sub('tests', CUT_PATH, arg) # Remaining occurences of tests/* are output files args.append(arg) cmd = ' '.join(args) @@ -146,12 +162,12 @@ if __name__ == '__main__': for output in glob.glob(absolute_out.group(1) + '*'): output = path.relpath(output).replace('\\','/') output = re.sub('tests', CUT_PATH, output) - diff_cmds.append('$DIFF_BIN '+output.replace(CUT_PATH + r'/dut',REF_PATH + r'/ref')+' '+output+' >> $LOG_FILE 2>&1') + diff_cmds.append('$DIFF_BIN '+output.replace(CUT_PATH, REF_PATH)+' '+output+' >> $LOG_FILE 2>&1') outfile.write(('; ').join(diff_cmds)) - if isar_out and "cut" in isar_out.group(1): - outfile.write('$DIFF_BIN '+isar_out.group(1).replace(CUT_PATH + r'/split_rendering/cut',REF_PATH + r'/split_rendering/ref')+' '+isar_out.group(1)+' >> $LOG_FILE 2>&1') - if isar_md_out and "cut" in isar_md_out.group(1): - outfile.write('; $DIFF_BIN '+isar_md_out.group(1).replace(CUT_PATH + r'/split_rendering/cut',REF_PATH + r'/split_rendering/ref')+' '+isar_md_out.group(1)+' >> $LOG_FILE 2>&1\n') + if isar_out and "ref" in isar_out.group(1): + outfile.write('$DIFF_BIN '+isar_out.group(1).replace(CUT_PATH, REF_PATH)+' '+isar_out.group(1)+' >> $LOG_FILE 2>&1') + if isar_md_out and "ref" in isar_md_out.group(1): + outfile.write('; $DIFF_BIN '+isar_md_out.group(1).replace(CUT_PATH, REF_PATH)+' '+isar_md_out.group(1)+' >> $LOG_FILE 2>&1\n') else: outfile.write('\n') outfile.write('\n\n') @@ -171,18 +187,18 @@ if __name__ == '__main__': # Adjust file arguments, pass other arguments as they are if path.exists(arg): arg = path.relpath(arg).replace('\\','/') - arg = re.sub('IVAS_rend(.exe)?', '$CUT_REND_BIN', arg) + arg = re.sub('IVAS_rend_ref(.exe)?', '$CUT_REND_BIN', arg) arg = re.sub('scripts', TESTV_PATH, arg) - arg = re.sub('tests/renderer/data', TESTV_PATH + r'renderer/data/', arg) + arg = re.sub('tests/renderer_short/data', TESTV_PATH + r'renderer_short/data/', arg) arg = re.sub('tests', CUT_PATH, arg) args.append(arg) cmd = ' '.join(args) - if "cut" in cmd: + if "ref" in cmd: outfile.write(cmd+'\n') out = re.search(r"-o\s(([\S]+)(.wav|.raw|.pcm))", cmd) - if out and "cut" in out.group(1): - outfile.write('$DIFF_BIN '+out.group(1).replace(CUT_PATH + r'/renderer/cut',REF_PATH + r'/renderer/ref')+' '+out.group(1)+' >> $LOG_FILE 2>&1\n') + if out and "ref" in out.group(1): + outfile.write('$DIFF_BIN '+out.group(1).replace(CUT_PATH + r'/renderer_short/ref',REF_PATH + r'/renderer_short/ref')+' '+out.group(1)+' >> $LOG_FILE 2>&1\n') outfile.write('\n') with open('scripts/script_footer.txt','r') as footer: outfile.write(footer.read()) @@ -196,19 +212,20 @@ if __name__ == '__main__': # Adjust file arguments, pass other arguments as they are if path.exists(arg): arg = path.relpath(arg).replace('\\','/') - arg = re.sub('ISAR_post_rend(.exe)?', '$CUT_ISAR_POST_REND_BIN', arg) + arg = re.sub('ISAR_post_rend_ref(.exe)?', '$CUT_ISAR_POST_REND_BIN', arg) arg = re.sub('scripts', TESTV_PATH, arg) if re.search("^tests.*bit$",arg): - arg = re.sub('tests/split_rendering/cut', REF_PATH + r'/split_rendering/ref', arg) + arg = re.sub('tests', REF_PATH, arg) arg = re.sub('tests', CUT_PATH, arg) args.append(arg) cmd = ' '.join(args) - if "cut" in cmd: + if "ref" in cmd: outfile.write(cmd+'\n') out = re.search(r"-o\s(([\S]+)(.wav|.raw|.pcm))", cmd) - if out and "cut" in out.group(1): - outfile.write('$DIFF_BIN '+out.group(1).replace(CUT_PATH + r'/split_rendering/cut',REF_PATH + r'/split_rendering/ref')+' '+out.group(1)+' >> $LOG_FILE 2>&1\n') + if out and "ref" in out.group(1): + outfile.write('$DIFF_BIN '+out.group(1).replace(CUT_PATH, REF_PATH)+' '+out.group(1)+' >> $LOG_FILE 2>&1\n') outfile.write('\n') with open('scripts/script_footer.txt','r') as footer: - outfile.write(footer.read()) \ No newline at end of file + outfile.write(footer.read()) + diff --git a/scripts/prepare_instrumentation.sh b/scripts/prepare_instrumentation.sh index 52549c77898b75a3a1a028eb4599f518a8aa92e2..906d85e785c19aae38b83e2f0c1949d8b173868e 100755 --- a/scripts/prepare_instrumentation.sh +++ b/scripts/prepare_instrumentation.sh @@ -156,7 +156,7 @@ if [ $ISAR -eq 1 ]; then echo " #define ENABLE_HR_MODE //#define DYNMEM_COUNT - #define CR10_A_ATTENUATION_CURVE_SELECTOR + //#define USE_LC3_OPERATORS #define SUBSET_NB #define SUBSET_WB #define SUBSET_SSWB @@ -200,6 +200,13 @@ if [ $? -ne 0 ]; then exit -1 fi +LIB_BASOP=0 +basop_dir="" +if [ -d $targetdir/lib_basop ]; then + LIB_BASOP=1 + basop_dir="$targetdir/lib_basop/*.c" +fi + # strip switches, to remove the macros (turn on extended globing to allow !(pattern*) matching) shopt -s extglob if coan_exists; then @@ -209,13 +216,16 @@ if coan_exists; then coan source --replace --no-transients -E -K --file $ifdef_list $targetdir/apps/*.[hc] if [ $ISAR -eq 0 ]; then - coan source --replace --no-transients -E -K --file $ifdef_list $targetdir/lib_{com,dec,enc,rend,util}/!(wmc_auto*).[hc] + coan source --replace --no-transients -E -K --file $ifdef_list $targetdir/lib_{com,dec,enc,rend,util,debug}/!(wmc_auto*).[hc] else coan source --replace --no-transients -E -K --file $ifdef_list $targetdir/lib_{com,dec,enc,isar,lc3plus,rend,util,debug}/!(wmc_auto*).[hc] if [ $LC3PLUS_FFT -eq 1 ]; then coan source --replace --no-transients -E -K --file $ifdef_list $targetdir/lib_lc3plus/fft/!(wmc_auto*).[hc] fi fi + if [ $LIB_BASOP -eq 1 ]; then + coan source --replace --no-transients -E -K --file $ifdef_list $targetdir/lib_basop/!(wmc_auto*).[hc] + fi coan source --replace --no-transients -E -K --file $ifdef_list $targetdir/lib_lc3plus/!(wmc_auto*).[hc] else $scriptdir/strip_defines_cppp.sh $targetdir $ifdef_list @@ -227,21 +237,22 @@ find $targetdir -name "*.[ch]" -exec sed -i.bak -e "s/\(0x[0-9a-fA-F]*\)UL/\(\(u # run wmc_tool, exit if the command fails set -e +rm -f wmc_tool_output.txt touch wmc_tool_output.txt trap 'echo "Error calling WMC tool: $?"; cat wmc_tool_output.txt' ERR -"$scriptdir/tools/$system/wmc_tool" $wmc_opt -m "$targetdir/apps/encoder.c" "$targetdir/lib_enc/*.c" "$targetdir/lib_com/*.c" >>wmc_tool_output.txt 2>&1 -"$scriptdir/tools/$system/wmc_tool" $wmc_opt -m "$targetdir/apps/decoder.c" "$targetdir/lib_dec/*.c" "$targetdir/lib_rend/*.c" >>wmc_tool_output.txt 2>&1 +"$scriptdir/tools/$system/wmc_tool" $wmc_opt -m "$targetdir/apps/encoder.c" "$targetdir/lib_enc/*.c" "$targetdir/lib_com/*.c" "$basop_dir" >>wmc_tool_output.txt 2>&1 +"$scriptdir/tools/$system/wmc_tool" $wmc_opt -m "$targetdir/apps/decoder.c" "$targetdir/lib_dec/*.c" "$targetdir/lib_rend/*.c" "$basop_dir" >>wmc_tool_output.txt 2>&1 for bak_file in $targetdir/lib_rend/*.bak; do mv "$bak_file" "${bak_file%.*}"; done # restore fresh .c files to avoid time-consuming des-instrumentation of files by the WMC tool if [ $ISAR -eq 0 ]; then - "$scriptdir/tools/$system/wmc_tool" $wmc_opt -m "$targetdir/apps/renderer.c" "$targetdir/lib_rend/*.c" >>wmc_tool_output.txt 2>&1 + "$scriptdir/tools/$system/wmc_tool" $wmc_opt -m "$targetdir/apps/renderer.c" "$targetdir/lib_rend/*.c" "$basop_dir" >>wmc_tool_output.txt 2>&1 else - "$scriptdir/tools/$system/wmc_tool" $wmc_opt -m "$targetdir/apps/renderer.c" "$targetdir/lib_rend/*.c" "$targetdir/lib_lc3plus/*.c" "$lc3plus_fftdir" >>wmc_tool_output.txt 2>&1 + "$scriptdir/tools/$system/wmc_tool" $wmc_opt -m "$targetdir/apps/renderer.c" "$targetdir/lib_rend/*.c" "$targetdir/lib_lc3plus/*.c" "$lc3plus_fftdir" "$basop_dir" >>wmc_tool_output.txt 2>&1 for bak_file in $targetdir/lib_lc3plus/*.bak; do mv "$bak_file" "${bak_file%.*}"; done # restore fresh .c files to avoid time-consuming des-instrumentation of files by the WMC tool if [ -n "$lc3plus_fftdir" ]; then for bak_file in $targetdir/lib_lc3plus/fft/*.bak; do mv "$bak_file" "${bak_file%.*}"; done # restore fresh .c files to avoid time-consuming des-instrumentation of files by the WMC tool fi # ISAR post rend - "$scriptdir/tools/$system/wmc_tool" $wmc_opt -m "$targetdir/apps/isar_post_rend.c" "$targetdir/lib_isar/*.c" "$targetdir/lib_lc3plus/*.c" "$lc3plus_fftdir" >>wmc_tool_output.txt 2>&1 + "$scriptdir/tools/$system/wmc_tool" $wmc_opt -m "$targetdir/apps/isar_post_rend.c" "$targetdir/lib_isar/*.c" "$targetdir/lib_lc3plus/*.c" "$lc3plus_fftdir" "$basop_dir" >>wmc_tool_output.txt 2>&1 fi trap - ERR set +e diff --git a/scripts/rend_header.txt b/scripts/rend_header.txt index c56eb17cb0844a882521f83377f146b1169231c2..ce2e274c6698bccd11aef138606b7106fa7167fd 100644 --- a/scripts/rend_header.txt +++ b/scripts/rend_header.txt @@ -15,7 +15,7 @@ LOG_FILE=Readme_IVAS_rend_log.txt rm -rf tmp rm -rf $CUT_PATH -mkdir -p $CUT_PATH/renderer/cut -mkdir -p $CUT_PATH/renderer/data +mkdir -p $CUT_PATH/renderer_short/ref +mkdir -p $CUT_PATH/renderer_short/data diff --git a/scripts/split_rendering/__init__.py b/scripts/split_rendering/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/scripts/split_rendering/isar_bstool.py b/scripts/split_rendering/isar_bstool.py new file mode 100755 index 0000000000000000000000000000000000000000..735d221f494a9c614271d0ed44eabf1adb10fa26 --- /dev/null +++ b/scripts/split_rendering/isar_bstool.py @@ -0,0 +1,384 @@ +#!/usr/bin/env python3 + +""" + (C) 2022-2025 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB, + Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., + Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, + Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other + contributors to this repository. All Rights Reserved. + + This software is protected by copyright law and by international treaties. + The IVAS codec Public Collaboration consisting of Dolby International AB, Ericsson AB, + Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., + Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, + Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other + contributors to this repository retain full ownership rights in their respective contributions in + the software. This notice grants no license of any kind, including but not limited to patent + license, nor is any license granted by implication, estoppel or otherwise. + + Contributors are required to enter into the IVAS codec Public Collaboration agreement before making + contributions. + + This software is provided "AS IS", without any express or implied warranties. The software is in the + development stage. It is intended exclusively for experts who have experience with such software and + solely for the purpose of inspection. All implied warranties of non-infringement, merchantability + and fitness for a particular purpose are hereby disclaimed and excluded. + + Any dispute, controversy or claim arising under or in relation to providing this software shall be + submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in + accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and + the United Nations Convention on Contracts on the International Sales of Goods. +""" + +from __future__ import annotations +import argparse +import math +import sys +from pathlib import Path + + +class IsarBstoolError(Exception): + pass + + +class IsarBitstream: + def __init__(self, file_path: Path) -> None: + self.file_path = file_path + + with open(file_path, "rb") as reader: + self.header = IsarFileHeader(reader) + self.frames = [] + + while reader.peek(1): + self.frames.append(IsarFileFrame(reader)) + + @property + def duration_seconds(self): + return self.num_frames * self.isar_frame_size_ms / 1000 + + @property + def duration_samples(self): + return int(self.duration_seconds * self.sample_rate) + + @property + def num_frames(self): + return len(self.frames) + + @property + def num_empty_frames(self): + return sum(frame.num_bits == 0 for frame in self.frames) + + @property + def sample_rate(self): + return self.header.sample_rate + + @property + def delay_ns(self): + return self.header.delay_ns + + @property + def delay_samples(self): + return round(self.header.delay_ns * self.sample_rate / 10**9) + + @property + def isar_frame_size_ms(self): + return self.header.isar_frame_size_ms + + @property + def isar_frame_size_samples(self): + return self.header.isar_frame_size_ms * self.sample_rate // 1000 + + @property + def pose_correction(self): + return self.header.pose_correction + + @property + def avg_bitrate_bps(self): + return sum(frame.num_bits for frame in self.frames) / self.duration_seconds + + @property + def avg_bitrate_non_empty_frames_bps(self): + return sum(frame.num_bits for frame in self.frames) / ( + (self.num_frames - self.num_empty_frames) * self.isar_frame_size_ms / 1000 + ) + + @property + def codec(self): + return self.header.codec + + @property + def codec_frame_size_ms(self): + return self.header.codec_frame_size_ms + + @property + def codec_frame_size_samples(self): + return self.header.codec_frame_size_ms * self.sample_rate // 1000 + + @property + def lc3plus_hires(self): + return self.header.lc3plus_hires + + def info(self): + return ( + "\n" + f"File : {self.file_path}\n" + f"Duration : {self.duration_seconds} s = {self.duration_samples} samples\n" + f"Frames : {self.num_frames} (incl. {self.num_empty_frames} empty)\n" + f"Sample Rate : {self.sample_rate} Hz\n" + f"Delay : {self.delay_ns} ns = {self.delay_samples} samples\n" + f"ISAR Frame Size : {self.isar_frame_size_ms} ms = {self.isar_frame_size_samples} samples\n" + f"Pose Correction : {self.pose_correction}\n" + f"Bitrate : {self.avg_bitrate_bps:.2f} bps (avg), {self.avg_bitrate_non_empty_frames_bps:.2f} bps (avg non-empty)\n" + f"Codec : {self.codec}\n" + f"Codec Frame Size : {self.codec_frame_size_ms} ms = {self.codec_frame_size_samples} samples\n" + f"LC3plus HIRES : {'ON' if self.lc3plus_hires else 'OFF'}\n" + ) + + def write(self, file_path: Path): + self.file_path = file_path + + with open(file_path, "wb") as writer: + writer.write(self.header.as_bytes) + + for frame in self.frames: + writer.write(frame.as_bytes) + + def trim(self, start_time_s: float, length_s: float | None = None) -> IsarBitstream: + if length_s is None: + length_s = self.duration_seconds + + start_time_ms = start_time_s * 1000 + length_ms = length_s * 1000 + + # Check for unusable values + if math.isinf(start_time_s) or math.isnan(start_time_s): + raise IsarBstoolError(f"start_time ({start_time_s} s) has unusable value") + if math.isinf(length_s) or math.isnan(length_s): + raise IsarBstoolError(f"length ({length_s} s) has unusable value") + + # Ensure times are not negative + if start_time_s < 0: + raise IsarBstoolError(f"start_time ({start_time_s} s) can't be negative") + if length_s < 0: + raise IsarBstoolError(f"length ({length_s} s) can't be negative") + + # We can only remove entire frames + if start_time_ms % self.isar_frame_size_ms != 0: + raise IsarBstoolError( + f"start_time ({start_time_s} s) must be an integer multiple of ISAR frame duration ({self.isar_frame_size_ms} ms)" + ) + if length_ms % self.isar_frame_size_ms != 0: + raise IsarBstoolError( + f"length ({length_s} s) must be an integer multiple of ISAR frame duration ({self.isar_frame_size_ms} ms)" + ) + + start_idx = int(start_time_ms / self.isar_frame_size_ms) + end_idx = start_idx + int(length_ms / self.isar_frame_size_ms) + self.frames = self.frames[start_idx : min(end_idx, len(self.frames))] + + return self + + def is_same_as(self, other: IsarBitstream) -> bool: + return self.header == other.header and self.frames == other.frames + + +class _AsBytes: + def __init__(self) -> None: + self.as_bytes = bytearray() + + def _read(self, reader, num_bytes): + bytes_ = reader.read(num_bytes) + self.as_bytes.extend(bytes_) + return bytes_ + + def __eq__(self, value: object, /) -> bool: + if not isinstance(value, _AsBytes): + return False + return self.as_bytes == value.as_bytes + + +class IsarFileHeader(_AsBytes): + def __init__(self, reader) -> None: + super().__init__() + + FILE_HEADER = b"MAIN_SPLITH" + file_header_top = self._read(reader, len(FILE_HEADER)) + if file_header_top != FILE_HEADER: + raise IsarBstoolError(f"Not a valid ISAR file: {reader.name}") + + self.delay_ns = _int_from_bytes(self._read(reader, 4)) + self.codec = _codec_from_bytes(self._read(reader, 4)) + self.pose_correction = _pose_corr_from_bytes(self._read(reader, 4)) + self.codec_frame_size_ms = _int_from_bytes(self._read(reader, 2)) + self.isar_frame_size_ms = _int_from_bytes(self._read(reader, 2)) + self.sample_rate = _int_from_bytes(self._read(reader, 4)) + self.lc3plus_hires = bool(_int_from_bytes(self._read(reader, 2))) + + +class IsarFileFrame(_AsBytes): + def __init__(self, reader) -> None: + super().__init__() + + FRAME_HEADER = b"SPLIT_FRAME" + frame_header = self._read(reader, len(FRAME_HEADER)) + if frame_header != FRAME_HEADER: + raise IsarBstoolError(f"Not a valid ISAR file: {reader.name}") + + version = _int_from_bytes(self._read(reader, 1)) + if version != 0: + raise IsarBstoolError( + f"Unupported version of ISAR file format: {reader.name}" + ) + + self.num_bits = _int_from_bytes(self._read(reader, 4)) + + payload_size = math.ceil(self.num_bits / 8) + self.payload = self._read(reader, payload_size) + + +###################################################################################### +# utilities +###################################################################################### + + +def _int_from_bytes(bytes_): + return int.from_bytes(bytes_, byteorder="little") + + +def _codec_from_bytes(bytes_): + # Refer to ISAR_SPLIT_REND_CODEC enum in C code + CODECS = ["LCLD", "LC3PLUS", "DEFAULT", "NONE"] + x = _int_from_bytes(bytes_) + + if x < len(CODECS): + return CODECS[x] + + return "UNKNOWN" + + +def _pose_corr_from_bytes(bytes_): + # Refer to ISAR_SPLIT_REND_POSE_CORRECTION_MODE enum in C code + POSE_CORR_MODES = ["NONE", "CLDFB"] + x = _int_from_bytes(bytes_) + + if x < len(POSE_CORR_MODES): + return POSE_CORR_MODES[x] + + return "UNKNOWN" + + +###################################################################################### +# subcommand functions +###################################################################################### + + +def _subcmd_info(args): + bs = IsarBitstream(args.file_in) + + match args.only: + case "duration_seconds": + print(bs.duration_seconds) + case "duration_samples": + print(bs.duration_samples) + case "num_frames": + print(bs.num_frames) + case "num_empty_frames": + print(bs.num_empty_frames) + case "sample_rate": + print(bs.sample_rate) + case "delay_ns": + print(bs.delay_ns) + case "delay_samples": + print(bs.delay_samples) + case "isar_frame_size_ms": + print(bs.isar_frame_size_ms) + case "isar_frame_size_samples": + print(bs.isar_frame_size_samples) + case "pose_correction": + print(bs.pose_correction) + case "avg_bitrate": + print(bs.avg_bitrate_bps) + case "avg_bitrate_non_empty_frames": + print(bs.avg_bitrate_non_empty_frames_bps) + case "codec": + print(bs.codec) + case "codec_frame_size_ms": + print(bs.codec_frame_size_ms) + case "codec_frame_size_samples": + print(bs.codec_frame_size_samples) + case "lc3plus_hires": + print("ON" if bs.lc3plus_hires else "OFF") + case None: + print(bs.info()) + case _: + raise IsarBstoolError(f"Not a valid parameter value: '{args.only}'") + + +def _subcmd_trim(args): + bs = IsarBitstream(args.file_in) + bs.trim(float(args.start_time), float(args.length) if args.length else None) + bs.write(args.file_out) + + +###################################################################################### +# main +###################################################################################### + +if __name__ == "__main__": + parser = argparse.ArgumentParser( + prog="isar_bstool", + description="Utility for inspecting and modifying ISAR bitstreams", + ) + parser.set_defaults(func=lambda _: parser.print_help()) + subparsers = parser.add_subparsers(title="Commands") + + info = subparsers.add_parser("info", help="Print information about a bitstream") + info.add_argument("file_in", help="Path to input file") + info.add_argument( + "--only", + help="Print only a specific parameter", + default=None, + choices=[ + "duration_seconds", + "duration_samples", + "num_frames", + "num_empty_frames", + "sample_rate", + "delay_ns", + "delay_samples", + "isar_frame_size_ms", + "isar_frame_size_samples", + "pose_correction", + "avg_bitrate", + "avg_bitrate_non_empty_frames", + "codec", + "codec_frame_size_ms", + "codec_frame_size_samples", + "lc3plus_hires", + ], + ) + info.set_defaults(func=_subcmd_info) + + trim = subparsers.add_parser( + "trim", help="Remove initial frames from a bitstream file" + ) + trim.add_argument("file_in", help="Path to input file") + trim.add_argument("file_out", help="Path to output file") + trim.add_argument( + "start_time", + help="Start point (in s) from which content should be copied to the output.", + ) + trim.add_argument( + "--length", + help="Amount of time (in s) to copy to the output. If not given, content is copied until the end of the input is reached.", + default=None, + ) + trim.set_defaults(func=_subcmd_trim) + + args = parser.parse_args() + + try: + args.func(args) + except (FileNotFoundError, PermissionError, IsarBstoolError) as e: + print(e, file=sys.stderr) + sys.exit(1) diff --git a/scripts/split_rendering/lc3plus_basop/ivas_lc3plus_unit_test.c b/scripts/split_rendering/lc3plus_basop/ivas_lc3plus_unit_test.c index 7cdda5634263cb52e123897c0bf9c0215507757d..6833a90fea791ec587b585297c3d1f729ea92807 100644 --- a/scripts/split_rendering/lc3plus_basop/ivas_lc3plus_unit_test.c +++ b/scripts/split_rendering/lc3plus_basop/ivas_lc3plus_unit_test.c @@ -41,7 +41,7 @@ the United Nations Convention on Contracts on the International Sales of Goods. #include "lc3plus.h" #define MAX_SAMPLES_PER_CHANNEL 960 / 4 -#define DEFAULT_BPS 256000 +#define DEFAULT_BPS 256000 #ifndef PCM_SAMPLE_TYPEDEF_DEFINED #define PCM_SAMPLE_TYPEDEF_DEFINED @@ -93,23 +93,23 @@ static int encodeAndDecodeOneStereoFrame( LC3PLUS_CONFIG config, uint32_t bps ) uint8_t *bitstream_out = malloc( bitstreamSizePerIvasFrame ); memset( bitstream_out, 0, bitstreamSizePerIvasFrame ); - int perChannelBitrate = lc3plus_enc_get_real_bitrate(encHandle->handles[0]); - int perLc3plusFrameDataBlockOctets = encHandle->num_ftds * perChannelBitrate / 8 / (1000*1000/config.lc3plus_frame_duration_us); - int targetOctets = bps / 8 / (1000*1000/config.isar_frame_duration_us); - printf("IVAS-FS=%i LC3plus-FS=%i ch=%i targetBps=%i targetOctets=%i\n", config.isar_frame_duration_us, config.lc3plus_frame_duration_us, config.channels, bps, targetOctets); - printf(" coreBps=%i corePerChBps=%i coreCodecOctets=%i nFtds=%i \n", perChannelBitrate * encHandle->num_encs, perChannelBitrate, perLc3plusFrameDataBlockOctets, encHandle->num_ftds); + int perChannelBitrate = lc3plus_enc_get_real_bitrate( encHandle->handles[0] ); + int perLc3plusFrameDataBlockOctets = encHandle->num_ftds * perChannelBitrate / 8 / ( 1000 * 1000 / config.lc3plus_frame_duration_us ); + int targetOctets = bps / 8 / ( 1000 * 1000 / config.isar_frame_duration_us ); + printf( "IVAS-FS=%i LC3plus-FS=%i ch=%i targetBps=%i targetOctets=%i\n", config.isar_frame_duration_us, config.lc3plus_frame_duration_us, config.channels, bps, targetOctets ); + printf( " coreBps=%i corePerChBps=%i coreCodecOctets=%i nFtds=%i \n", perChannelBitrate * encHandle->num_encs, perChannelBitrate, perLc3plusFrameDataBlockOctets, encHandle->num_ftds ); int pfOctets = bitstreamSizePerIvasFrame - perLc3plusFrameDataBlockOctets; - int pfBps = pfOctets * 8 * (1000*1000 / config.isar_frame_duration_us); - printf(" payloadFormatBps=%i payloadFormatOctets=%i \n\n", pfBps, pfOctets); - if(pfBps <= 0) + int pfBps = pfOctets * 8 * ( 1000 * 1000 / config.isar_frame_duration_us ); + printf( " payloadFormatBps=%i payloadFormatOctets=%i \n\n", pfBps, pfOctets ); + if ( pfBps <= 0 ) { ISAR_LC3PLUS_ENC_Close( &encHandle ); return err; } Word16 Q_in[16]; - memset(Q_in, 0, sizeof(Q_in) ); - err = ISAR_LC3PLUS_ENC_Encode( encHandle, pcm_in, bitstream_out, bitstreamSizePerIvasFrame, Q_in ); + memset( Q_in, 0, sizeof( Q_in ) ); + err = ISAR_LC3PLUS_ENC_Encode( encHandle, pcm_in, bitstream_out, bitstreamSizePerIvasFrame, Q_in ); if ( IVAS_ERR_OK != err ) { ISAR_LC3PLUS_ENC_Close( &encHandle ); @@ -218,19 +218,19 @@ static int tryOpenEncoderWithInvalidBitrate( void ) { return 1; } - limitedBitrate = lc3plus_enc_get_real_bitrate(encHandle->handles[0]); - if(limitedBitrate != 320000) + limitedBitrate = lc3plus_enc_get_real_bitrate( encHandle->handles[0] ); + if ( limitedBitrate != 320000 ) { return 1; } - ISAR_LC3PLUS_ENC_Close(&encHandle); + ISAR_LC3PLUS_ENC_Close( &encHandle ); err = ISAR_LC3PLUS_ENC_Open( config, invalid_low_bps, &encHandle ); /* setting an invalid bitrate should trigger an error - which is what we expect */ if ( IVAS_ERR_LC3PLUS_INVALID_BITRATE != err ) { return 1; } - ISAR_LC3PLUS_ENC_Close(&encHandle); + ISAR_LC3PLUS_ENC_Close( &encHandle ); return 0; } @@ -295,13 +295,13 @@ static int tryCallEncoderApiWithInvalidParams( void ) } ISAR_LC3PLUS_ENC_Close( &invalidEncHandle ); Word16 Q_in[16]; - memset(Q_in, 0, sizeof(Q_in) ); - if ( IVAS_ERR_UNEXPECTED_NULL_POINTER != ISAR_LC3PLUS_ENC_Encode( invalidEncHandle, invalidPcm_in, invalidBitstream_out, bsSize, Q_in ) ) + memset( Q_in, 0, sizeof( Q_in ) ); + if ( IVAS_ERR_UNEXPECTED_NULL_POINTER != ISAR_LC3PLUS_ENC_Encode( invalidEncHandle, invalidPcm_in, invalidBitstream_out, bsSize, Q_in ) ) { return 1; } - memset(Q_in, 0, sizeof(Q_in) ); - if ( IVAS_ERR_UNEXPECTED_NULL_POINTER != ISAR_LC3PLUS_ENC_Encode( invalidEncHandle, pcm_in, invalidBitstream_out, bsSize, Q_in) || IVAS_ERR_UNEXPECTED_NULL_POINTER != ISAR_LC3PLUS_ENC_Encode( invalidEncHandle, invalidPcm_in, bitstream_out, bsSize, Q_in ) || IVAS_ERR_UNEXPECTED_NULL_POINTER != ISAR_LC3PLUS_ENC_Encode( invalidEncHandle, pcm_in, bitstream_out, bsSize, Q_in ) ) + memset( Q_in, 0, sizeof( Q_in ) ); + if ( IVAS_ERR_UNEXPECTED_NULL_POINTER != ISAR_LC3PLUS_ENC_Encode( invalidEncHandle, pcm_in, invalidBitstream_out, bsSize, Q_in ) || IVAS_ERR_UNEXPECTED_NULL_POINTER != ISAR_LC3PLUS_ENC_Encode( invalidEncHandle, invalidPcm_in, bitstream_out, bsSize, Q_in ) || IVAS_ERR_UNEXPECTED_NULL_POINTER != ISAR_LC3PLUS_ENC_Encode( invalidEncHandle, pcm_in, bitstream_out, bsSize, Q_in ) ) { return 1; } @@ -448,7 +448,7 @@ static int encodeOneFrame( void ) uint8_t *bitstream_out = malloc( bitstreamSizePerIvasFrame ); memset( bitstream_out, 0, bitstreamSizePerIvasFrame ); Word16 Q_in[16]; - memset(Q_in, 0, sizeof(Q_in) ); + memset( Q_in, 0, sizeof( Q_in ) ); err = ISAR_LC3PLUS_ENC_Encode( encHandle, pcm, bitstream_out, bitstreamSizePerIvasFrame, Q_in ); if ( IVAS_ERR_OK != err ) @@ -488,8 +488,8 @@ static int encodeAndDecodeOneMonoFrame( void ) uint8_t *bitstream_out = malloc( bitstreamSizePerIvasFrame ); memset( bitstream_out, 0, bitstreamSizePerIvasFrame ); Word16 Q_in[16]; - memset(Q_in, 0, sizeof(Q_in) ); - err = ISAR_LC3PLUS_ENC_Encode( encHandle, pcm_in, bitstream_out, bitstreamSizePerIvasFrame, Q_in ); + memset( Q_in, 0, sizeof( Q_in ) ); + err = ISAR_LC3PLUS_ENC_Encode( encHandle, pcm_in, bitstream_out, bitstreamSizePerIvasFrame, Q_in ); if ( IVAS_ERR_OK != err ) return err; ISAR_LC3PLUS_ENC_Close( &encHandle ); @@ -582,25 +582,25 @@ static int encodeAndDecodeOneStereoFrameIvas20msLc3plus2_5ms_48kHz( void ) static int encodeAndDecodeOneStereoFrameIvas10msLc3_10ms_48kHz_80kbpsPerChannel( void ) { LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 10 * 1000, .isar_frame_duration_us = 10 * 1000, .channels = 2, .samplerate = 48000, .high_res_mode_enabled = 0 }; - return encodeAndDecodeOneStereoFrame( config, config.channels * 82*1000 ); + return encodeAndDecodeOneStereoFrame( config, config.channels * 82 * 1000 ); } static int encodeAndDecodeOneStereoFrameIvas10msLc3_10ms_48kHz_96kbpsPerChannel( void ) { LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 10 * 1000, .isar_frame_duration_us = 10 * 1000, .channels = 2, .samplerate = 48000, .high_res_mode_enabled = 0 }; - return encodeAndDecodeOneStereoFrame( config, config.channels * 98*1000 ); + return encodeAndDecodeOneStereoFrame( config, config.channels * 98 * 1000 ); } static int encodeAndDecodeOneStereoFrameIvas10msLc3_10ms_48kHz_124kbpsPerChannel( void ) { LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 10 * 1000, .isar_frame_duration_us = 10 * 1000, .channels = 2, .samplerate = 48000, .high_res_mode_enabled = 0 }; - return encodeAndDecodeOneStereoFrame( config, config.channels * 126*1000 ); + return encodeAndDecodeOneStereoFrame( config, config.channels * 126 * 1000 ); } static int encodeAndDecodeOneStereoFrameIvas10msLc3_10ms_48kHz_800kbpsPerChannel( void ) { LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 10 * 1000, .isar_frame_duration_us = 10 * 1000, .channels = 2, .samplerate = 48000, .high_res_mode_enabled = 0 }; - return encodeAndDecodeOneStereoFrame( config, config.channels * 800*1000 ); + return encodeAndDecodeOneStereoFrame( config, config.channels * 800 * 1000 ); } static int encodeAndDecodeOneStereoFrameIvas10msLc3_10ms_48kHz_204800bpsPerChannel( void ) @@ -633,8 +633,8 @@ int main( int argc, char *argv[] ) { - (void)argc; - (void)argv; + (void) argc; + (void) argv; int ret = 0; ret = openCloseEncoder(); if ( ret != 0 ) diff --git a/scripts/split_rendering/lc3plus_basop/ivas_lc3plus_unit_test_payload_format.c b/scripts/split_rendering/lc3plus_basop/ivas_lc3plus_unit_test_payload_format.c index 613441c8ac9ec8fc740fa88c0e53e6d4e953d5d0..5685dd1704cdd86f6964f11e0bc537b78b2fdf45 100644 --- a/scripts/split_rendering/lc3plus_basop/ivas_lc3plus_unit_test_payload_format.c +++ b/scripts/split_rendering/lc3plus_basop/ivas_lc3plus_unit_test_payload_format.c @@ -38,7 +38,6 @@ the United Nations Convention on Contracts on the International Sales of Goods. #include "isar_lc3plus_common.h" #include "options.h" -#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS /* included by ivas_lc3plus_unit_test.c */ @@ -448,4 +447,3 @@ static int run_all_payload_tests( void ) } return 0; } -#endif diff --git a/scripts/split_rendering/lc3plus_float/ivas_lc3plus_unit_test.c b/scripts/split_rendering/lc3plus_float/ivas_lc3plus_unit_test.c index c15f14b4ccfa6d8d0311950926fddb4c5cc0dc70..8c2f1a1495625fe68012ca0a9a358a66a8130f7d 100644 --- a/scripts/split_rendering/lc3plus_float/ivas_lc3plus_unit_test.c +++ b/scripts/split_rendering/lc3plus_float/ivas_lc3plus_unit_test.c @@ -41,7 +41,7 @@ the United Nations Convention on Contracts on the International Sales of Goods. #include "lc3plus.h" #define MAX_SAMPLES_PER_CHANNEL 960 / 4 -#define DEFAULT_BPS 256000 +#define DEFAULT_BPS 256000 static int encodeAndDecodeOneStereoFrame( LC3PLUS_CONFIG config, uint32_t bps ) { @@ -88,15 +88,15 @@ static int encodeAndDecodeOneStereoFrame( LC3PLUS_CONFIG config, uint32_t bps ) uint8_t *bitstream_out = malloc( bitstreamSizePerIvasFrame ); memset( bitstream_out, 0, bitstreamSizePerIvasFrame ); - int perChannelBitrate = lc3plus_enc_get_real_bitrate(encHandle->handles[0]); - int perLc3plusFrameDataBlockOctets = encHandle->num_ftds * perChannelBitrate / 8 / (1000*1000/config.lc3plus_frame_duration_us); - int targetOctets = bps / 8 / (1000*1000/config.isar_frame_duration_us); - printf("IVAS-FS=%i LC3plus-FS=%i ch=%i targetBps=%i targetOctets=%i\n", config.isar_frame_duration_us, config.lc3plus_frame_duration_us, config.channels, bps, targetOctets); - printf(" coreBps=%i corePerChBps=%i coreCodecOctets=%i nFtds=%i \n", perChannelBitrate * encHandle->num_encs, perChannelBitrate, perLc3plusFrameDataBlockOctets, encHandle->num_ftds); + int perChannelBitrate = lc3plus_enc_get_real_bitrate( encHandle->handles[0] ); + int perLc3plusFrameDataBlockOctets = encHandle->num_ftds * perChannelBitrate / 8 / ( 1000 * 1000 / config.lc3plus_frame_duration_us ); + int targetOctets = bps / 8 / ( 1000 * 1000 / config.isar_frame_duration_us ); + printf( "IVAS-FS=%i LC3plus-FS=%i ch=%i targetBps=%i targetOctets=%i\n", config.isar_frame_duration_us, config.lc3plus_frame_duration_us, config.channels, bps, targetOctets ); + printf( " coreBps=%i corePerChBps=%i coreCodecOctets=%i nFtds=%i \n", perChannelBitrate * encHandle->num_encs, perChannelBitrate, perLc3plusFrameDataBlockOctets, encHandle->num_ftds ); int pfOctets = bitstreamSizePerIvasFrame - perLc3plusFrameDataBlockOctets; - int pfBps = pfOctets * 8 * (1000*1000 / config.isar_frame_duration_us); - printf(" payloadFormatBps=%i payloadFormatOctets=%i \n\n", pfBps, pfOctets); - if(pfBps <= 0) + int pfBps = pfOctets * 8 * ( 1000 * 1000 / config.isar_frame_duration_us ); + printf( " payloadFormatBps=%i payloadFormatOctets=%i \n\n", pfBps, pfOctets ); + if ( pfBps <= 0 ) { ISAR_LC3PLUS_ENC_Close( &encHandle ); return err; @@ -211,19 +211,19 @@ static int tryOpenEncoderWithInvalidBitrate( void ) { return 1; } - limitedBitrate = lc3plus_enc_get_real_bitrate(encHandle->handles[0]); - if(limitedBitrate != 320000) + limitedBitrate = lc3plus_enc_get_real_bitrate( encHandle->handles[0] ); + if ( limitedBitrate != 320000 ) { return 1; } - ISAR_LC3PLUS_ENC_Close(&encHandle); + ISAR_LC3PLUS_ENC_Close( &encHandle ); err = ISAR_LC3PLUS_ENC_Open( config, invalid_low_bps, &encHandle ); /* setting an invalid bitrate should trigger an error - which is what we expect */ if ( IVAS_ERR_LC3PLUS_INVALID_BITRATE != err ) { return 1; } - ISAR_LC3PLUS_ENC_Close(&encHandle); + ISAR_LC3PLUS_ENC_Close( &encHandle ); return 0; } @@ -567,13 +567,13 @@ static int encodeAndDecodeOneStereoFrameIvas20msLc3plus2_5ms_48kHz( void ) static int encodeAndDecodeOneStereoFrameIvas10msLc3_10ms_48kHz_80kbpsPerChannel( void ) { LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 10 * 1000, .isar_frame_duration_us = 10 * 1000, .channels = 2, .samplerate = 48000, .high_res_mode_enabled = 0 }; - return encodeAndDecodeOneStereoFrame( config, config.channels * 82*1000 ); + return encodeAndDecodeOneStereoFrame( config, config.channels * 82 * 1000 ); } static int encodeAndDecodeOneStereoFrameIvas10msLc3_10ms_48kHz_96kbpsPerChannel( void ) { LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 10 * 1000, .isar_frame_duration_us = 10 * 1000, .channels = 2, .samplerate = 48000, .high_res_mode_enabled = 0 }; - return encodeAndDecodeOneStereoFrame( config, config.channels * 98*1000 ); + return encodeAndDecodeOneStereoFrame( config, config.channels * 98 * 1000 ); } #ifdef LC3PLUS_LEA_COMPAT_BITRATES_48_6 @@ -583,13 +583,13 @@ static int encodeAndDecodeOneStereoFrameIvas10msLc3_10ms_48kHz_124kbpsPerChannel #endif { LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 10 * 1000, .isar_frame_duration_us = 10 * 1000, .channels = 2, .samplerate = 48000, .high_res_mode_enabled = 0 }; - return encodeAndDecodeOneStereoFrame( config, config.channels * 126*1000 ); + return encodeAndDecodeOneStereoFrame( config, config.channels * 126 * 1000 ); } static int encodeAndDecodeOneStereoFrameIvas10msLc3_10ms_48kHz_800kbpsPerChannel( void ) { LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 10 * 1000, .isar_frame_duration_us = 10 * 1000, .channels = 2, .samplerate = 48000, .high_res_mode_enabled = 0 }; - return encodeAndDecodeOneStereoFrame( config, config.channels * 800*1000 ); + return encodeAndDecodeOneStereoFrame( config, config.channels * 800 * 1000 ); } static int encodeAndDecodeOneStereoFrameIvas10msLc3_10ms_48kHz_204800bpsPerChannel( void ) @@ -622,8 +622,8 @@ int main( int argc, char *argv[] ) { - (void)argc; - (void)argv; + (void) argc; + (void) argv; int ret = 0; ret = openCloseEncoder(); if ( ret != 0 ) diff --git a/scripts/strip_split_rendering.sh b/scripts/strip_split_rendering.sh deleted file mode 100755 index f663b7224345746f622e83b4990c9e3d153895a3..0000000000000000000000000000000000000000 --- a/scripts/strip_split_rendering.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash - -# -# (C) 2022-2025 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB, -# Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., -# Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, -# Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other -# contributors to this repository. All Rights Reserved. -# -# This software is protected by copyright law and by international treaties. -# The IVAS codec Public Collaboration consisting of Dolby International AB, Ericsson AB, -# Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., -# Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, -# Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other -# contributors to this repository retain full ownership rights in their respective contributions in -# the software. This notice grants no license of any kind, including but not limited to patent -# license, nor is any license granted by implication, estoppel or otherwise. -# -# Contributors are required to enter into the IVAS codec Public Collaboration agreement before making -# contributions. -# -# This software is provided "AS IS", without any express or implied warranties. The software is in the -# development stage. It is intended exclusively for experts who have experience with such software and -# solely for the purpose of inspection. All implied warranties of non-infringement, merchantability -# and fitness for a particular purpose are hereby disclaimed and excluded. -# -# Any dispute, controversy or claim arising under or in relation to providing this software shall be -# submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in -# accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and -# the United Nations Convention on Contracts on the International Sales of Goods. -# - -OUTDIR=$1 diff --git a/scripts/testv/mixed_mc714_foa_masa2_ism4.txt b/scripts/testv/mixed_mc714_foa_masa2_ism4.txt new file mode 100644 index 0000000000000000000000000000000000000000..800e88ae7cf96a208680d099d74bd91299a08d5e --- /dev/null +++ b/scripts/testv/mixed_mc714_foa_masa2_ism4.txt @@ -0,0 +1,24 @@ +mixed_mc714_foa_masa2_ism4.wav +7 +MC +1 +7_1_4 +SBA +13 +1 +MASA +17 +2 +stv2MASA2TC48c.met +ISM +19 +stvISM1.csv +ISM +20 +stvISM2.csv +ISM +21 +stvISM3.csv +ISM +22 +stvISM4.csv diff --git a/scripts/testv/mixed_mc714_foa_masa2_ism4.wav b/scripts/testv/mixed_mc714_foa_masa2_ism4.wav new file mode 100644 index 0000000000000000000000000000000000000000..c680493c22891dcedc83b3da85572dbf7d1c353f --- /dev/null +++ b/scripts/testv/mixed_mc714_foa_masa2_ism4.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:900feffb59cec3a831c23b07e6f2f305e74d382c4d64903e65cd7cc321bd7083 +size 6336044 diff --git a/scripts/testv/mixed_scene.txt b/scripts/testv/mixed_scene.txt new file mode 100644 index 0000000000000000000000000000000000000000..2501c75383abc8f7c27aa6b64beca353d721e33b --- /dev/null +++ b/scripts/testv/mixed_scene.txt @@ -0,0 +1,15 @@ +spectral_test_16ch_48kHz.wav +4 +ISM +1 +ism_0a_0e.csv +ISM +2 +1 +1,-30,0 +SBA +3 +1 +MC +7 +5_1_4 diff --git a/scripts/testv/mixed_scene_simple.txt b/scripts/testv/mixed_scene_simple.txt new file mode 100644 index 0000000000000000000000000000000000000000..85d38b8e939aac8cf9c06a5f1ef5dc780b8db2a1 --- /dev/null +++ b/scripts/testv/mixed_scene_simple.txt @@ -0,0 +1,12 @@ +spectral_test_4ch_48kHz.wav +3 +ISM +1 +ism_0a_0e.csv +ISM +2 +1 +1,-30,0 +MC +3 +STEREO diff --git a/scripts/testv/stv2OA32n.wav b/scripts/testv/stv2OA32n.wav new file mode 100755 index 0000000000000000000000000000000000000000..393307f6f9c2d5dda64ed86a4bca9d48b2b2bff6 --- /dev/null +++ b/scripts/testv/stv2OA32n.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:00f992140544aaec42a474dfee59e302d237087601402209d6206ac28230a3ac +size 3456080 diff --git a/scripts/testv/stv2OA48n.wav b/scripts/testv/stv2OA48n.wav new file mode 100755 index 0000000000000000000000000000000000000000..40c9723d699fc614c8cb6d2acb91738ea4812b02 --- /dev/null +++ b/scripts/testv/stv2OA48n.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:752df20b150420cea0a3add9a2ff78cd1bb5a02ff8975f1f0f1f909bd8542e86 +size 5184080 diff --git a/scripts/testv/stv3OA32n.wav b/scripts/testv/stv3OA32n.wav new file mode 100755 index 0000000000000000000000000000000000000000..9cfd62d787bb671cc6b19638be9d153eda4f8f11 --- /dev/null +++ b/scripts/testv/stv3OA32n.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:780182483a647741b37be8056e2cf05088f0518ab8150ec7e61a6a454b142452 +size 6144080 diff --git a/scripts/testv/stv3OA48n.wav b/scripts/testv/stv3OA48n.wav new file mode 100755 index 0000000000000000000000000000000000000000..31ad785ad218de28251b5434b23f2ab3bed4f127 --- /dev/null +++ b/scripts/testv/stv3OA48n.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cbf252c2508f0ff4916019f5864b9d50809b1dc5d280eb06c12c1b9c5b8ad7f7 +size 9216044 diff --git a/scripts/testv/stvFOA32n.wav b/scripts/testv/stvFOA32n.wav new file mode 100755 index 0000000000000000000000000000000000000000..fb09a47350e718630a9912223764df22102a0ef3 --- /dev/null +++ b/scripts/testv/stvFOA32n.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ceff91346cd6fd74413ab471226dd13c0b957905ab8cb59c07217d89dd7b25aa +size 1536080 diff --git a/scripts/testv/stvFOA48n.wav b/scripts/testv/stvFOA48n.wav new file mode 100755 index 0000000000000000000000000000000000000000..8ad69c1e8d8b9391c3609dea060fcbe83161d3d0 --- /dev/null +++ b/scripts/testv/stvFOA48n.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:89ba415ae230e162a937822d1150845bf13521b5cf5036e12581ef067651d3b7 +size 2304080 diff --git a/scripts/tools/Darwin/.gitattributes b/scripts/tools/Darwin/.gitattributes new file mode 100644 index 0000000000000000000000000000000000000000..4cbca5d86571272693c890903bfd983172f45b48 --- /dev/null +++ b/scripts/tools/Darwin/.gitattributes @@ -0,0 +1 @@ +wav-diff filter=lfs diff=lfs merge=lfs -text diff --git a/scripts/tools/Darwin/thirdPartyLegalnotices/licenses_wav-diff.html b/scripts/tools/Darwin/thirdPartyLegalnotices/licenses_wav-diff.html index 0b17bd169b1a4d1eeae710d99bcf6ce134216e86..dd386d5ea227e951f6ad03950b2af8895c09e353 100644 --- a/scripts/tools/Darwin/thirdPartyLegalnotices/licenses_wav-diff.html +++ b/scripts/tools/Darwin/thirdPartyLegalnotices/licenses_wav-diff.html @@ -44,8 +44,8 @@

Overview of licenses:

@@ -678,199 +678,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. - - -
  • -

    Apache License 2.0

    -

    Used by:

    - -
                                  Apache License
    -                        Version 2.0, January 2004
    -                     http://www.apache.org/licenses/
    -
    -TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
    -
    -1. Definitions.
    -
    -   "License" shall mean the terms and conditions for use, reproduction,
    -   and distribution as defined by Sections 1 through 9 of this document.
    -
    -   "Licensor" shall mean the copyright owner or entity authorized by
    -   the copyright owner that is granting the License.
    -
    -   "Legal Entity" shall mean the union of the acting entity and all
    -   other entities that control, are controlled by, or are under common
    -   control with that entity. For the purposes of this definition,
    -   "control" means (i) the power, direct or indirect, to cause the
    -   direction or management of such entity, whether by contract or
    -   otherwise, or (ii) ownership of fifty percent (50%) or more of the
    -   outstanding shares, or (iii) beneficial ownership of such entity.
    -
    -   "You" (or "Your") shall mean an individual or Legal Entity
    -   exercising permissions granted by this License.
    -
    -   "Source" form shall mean the preferred form for making modifications,
    -   including but not limited to software source code, documentation
    -   source, and configuration files.
    -
    -   "Object" form shall mean any form resulting from mechanical
    -   transformation or translation of a Source form, including but
    -   not limited to compiled object code, generated documentation,
    -   and conversions to other media types.
    -
    -   "Work" shall mean the work of authorship, whether in Source or
    -   Object form, made available under the License, as indicated by a
    -   copyright notice that is included in or attached to the work
    -   (an example is provided in the Appendix below).
    -
    -   "Derivative Works" shall mean any work, whether in Source or Object
    -   form, that is based on (or derived from) the Work and for which the
    -   editorial revisions, annotations, elaborations, or other modifications
    -   represent, as a whole, an original work of authorship. For the purposes
    -   of this License, Derivative Works shall not include works that remain
    -   separable from, or merely link (or bind by name) to the interfaces of,
    -   the Work and Derivative Works thereof.
    -
    -   "Contribution" shall mean any work of authorship, including
    -   the original version of the Work and any modifications or additions
    -   to that Work or Derivative Works thereof, that is intentionally
    -   submitted to Licensor for inclusion in the Work by the copyright owner
    -   or by an individual or Legal Entity authorized to submit on behalf of
    -   the copyright owner. For the purposes of this definition, "submitted"
    -   means any form of electronic, verbal, or written communication sent
    -   to the Licensor or its representatives, including but not limited to
    -   communication on electronic mailing lists, source code control systems,
    -   and issue tracking systems that are managed by, or on behalf of, the
    -   Licensor for the purpose of discussing and improving the Work, but
    -   excluding communication that is conspicuously marked or otherwise
    -   designated in writing by the copyright owner as "Not a Contribution."
    -
    -   "Contributor" shall mean Licensor and any individual or Legal Entity
    -   on behalf of whom a Contribution has been received by Licensor and
    -   subsequently incorporated within the Work.
    -
    -2. Grant of Copyright License. Subject to the terms and conditions of
    -   this License, each Contributor hereby grants to You a perpetual,
    -   worldwide, non-exclusive, no-charge, royalty-free, irrevocable
    -   copyright license to reproduce, prepare Derivative Works of,
    -   publicly display, publicly perform, sublicense, and distribute the
    -   Work and such Derivative Works in Source or Object form.
    -
    -3. Grant of Patent License. Subject to the terms and conditions of
    -   this License, each Contributor hereby grants to You a perpetual,
    -   worldwide, non-exclusive, no-charge, royalty-free, irrevocable
    -   (except as stated in this section) patent license to make, have made,
    -   use, offer to sell, sell, import, and otherwise transfer the Work,
    -   where such license applies only to those patent claims licensable
    -   by such Contributor that are necessarily infringed by their
    -   Contribution(s) alone or by combination of their Contribution(s)
    -   with the Work to which such Contribution(s) was submitted. If You
    -   institute patent litigation against any entity (including a
    -   cross-claim or counterclaim in a lawsuit) alleging that the Work
    -   or a Contribution incorporated within the Work constitutes direct
    -   or contributory patent infringement, then any patent licenses
    -   granted to You under this License for that Work shall terminate
    -   as of the date such litigation is filed.
    -
    -4. Redistribution. You may reproduce and distribute copies of the
    -   Work or Derivative Works thereof in any medium, with or without
    -   modifications, and in Source or Object form, provided that You
    -   meet the following conditions:
    -
    -   (a) You must give any other recipients of the Work or
    -       Derivative Works a copy of this License; and
    -
    -   (b) You must cause any modified files to carry prominent notices
    -       stating that You changed the files; and
    -
    -   (c) You must retain, in the Source form of any Derivative Works
    -       that You distribute, all copyright, patent, trademark, and
    -       attribution notices from the Source form of the Work,
    -       excluding those notices that do not pertain to any part of
    -       the Derivative Works; and
    -
    -   (d) If the Work includes a "NOTICE" text file as part of its
    -       distribution, then any Derivative Works that You distribute must
    -       include a readable copy of the attribution notices contained
    -       within such NOTICE file, excluding those notices that do not
    -       pertain to any part of the Derivative Works, in at least one
    -       of the following places: within a NOTICE text file distributed
    -       as part of the Derivative Works; within the Source form or
    -       documentation, if provided along with the Derivative Works; or,
    -       within a display generated by the Derivative Works, if and
    -       wherever such third-party notices normally appear. The contents
    -       of the NOTICE file are for informational purposes only and
    -       do not modify the License. You may add Your own attribution
    -       notices within Derivative Works that You distribute, alongside
    -       or as an addendum to the NOTICE text from the Work, provided
    -       that such additional attribution notices cannot be construed
    -       as modifying the License.
    -
    -   You may add Your own copyright statement to Your modifications and
    -   may provide additional or different license terms and conditions
    -   for use, reproduction, or distribution of Your modifications, or
    -   for any such Derivative Works as a whole, provided Your use,
    -   reproduction, and distribution of the Work otherwise complies with
    -   the conditions stated in this License.
    -
    -5. Submission of Contributions. Unless You explicitly state otherwise,
    -   any Contribution intentionally submitted for inclusion in the Work
    -   by You to the Licensor shall be under the terms and conditions of
    -   this License, without any additional terms or conditions.
    -   Notwithstanding the above, nothing herein shall supersede or modify
    -   the terms of any separate license agreement you may have executed
    -   with Licensor regarding such Contributions.
    -
    -6. Trademarks. This License does not grant permission to use the trade
    -   names, trademarks, service marks, or product names of the Licensor,
    -   except as required for reasonable and customary use in describing the
    -   origin of the Work and reproducing the content of the NOTICE file.
    -
    -7. Disclaimer of Warranty. Unless required by applicable law or
    -   agreed to in writing, Licensor provides the Work (and each
    -   Contributor provides its Contributions) on an "AS IS" BASIS,
    -   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
    -   implied, including, without limitation, any warranties or conditions
    -   of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
    -   PARTICULAR PURPOSE. You are solely responsible for determining the
    -   appropriateness of using or redistributing the Work and assume any
    -   risks associated with Your exercise of permissions under this License.
    -
    -8. Limitation of Liability. In no event and under no legal theory,
    -   whether in tort (including negligence), contract, or otherwise,
    -   unless required by applicable law (such as deliberate and grossly
    -   negligent acts) or agreed to in writing, shall any Contributor be
    -   liable to You for damages, including any direct, indirect, special,
    -   incidental, or consequential damages of any character arising as a
    -   result of this License or out of the use or inability to use the
    -   Work (including but not limited to damages for loss of goodwill,
    -   work stoppage, computer failure or malfunction, or any and all
    -   other commercial damages or losses), even if such Contributor
    -   has been advised of the possibility of such damages.
    -
    -9. Accepting Warranty or Additional Liability. While redistributing
    -   the Work or Derivative Works thereof, You may choose to offer,
    -   and charge a fee for, acceptance of support, warranty, indemnity,
    -   or other liability obligations and/or rights consistent with this
    -   License. However, in accepting such obligations, You may act only
    -   on Your own behalf and on Your sole responsibility, not on behalf
    -   of any other Contributor, and only if You agree to indemnify,
    -   defend, and hold each Contributor harmless for any liability
    -   incurred by, or claims asserted against, such Contributor by reason
    -   of your accepting any such warranty or additional liability.
    -
    -END OF TERMS AND CONDITIONS
     
  • @@ -1725,19 +1532,6 @@ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. - -
  • -
  • -

    Apache License 2.0

    -

    Used by:

    - -
    // Licensed under the Apache License, Version 2.0
    -// <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
    -// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option.
    -// All files in the project carrying such notice may not be copied, modified, or distributed
    -// except according to those terms.
     
  • @@ -1746,6 +1540,17 @@ limitations under the License. @@ -1822,44 +1627,6 @@ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. - -
  • -
  • -

    Apache License 2.0

    -

    Used by:

    - -
    Copyright 2015 Nicholas Allegra (comex).
    -
    -Licensed under the Apache License, Version 2.0 (the "License");
    -you may not use this file except in compliance with the License.
    -You may obtain a copy of the License at
    -
    -    http://www.apache.org/licenses/LICENSE-2.0
    -
    -Unless required by applicable law or agreed to in writing, software
    -distributed under the License is distributed on an "AS IS" BASIS,
    -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    -See the License for the specific language governing permissions and
    -limitations under the License.
    -
    -
  • -
  • -

    Apache License 2.0

    -

    Used by:

    - -
    Licensed under the Apache License, Version 2.0
    -<LICENSE-APACHE or
    -http://www.apache.org/licenses/LICENSE-2.0> or the MIT
    -license <LICENSE-MIT or http://opensource.org/licenses/MIT>,
    -at your option. All files in the project carrying such
    -notice may not be copied, modified, or distributed except
    -according to those terms.
     
  • @@ -2037,18 +1804,6 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -
  • -
  • -

    MIT License

    -

    Used by:

    - -
    This project is dual-licensed under the Unlicense and MIT licenses.
    -
    -You may use this code under the terms of either license.
     
  • diff --git a/scripts/tools/Darwin/wav-diff b/scripts/tools/Darwin/wav-diff index 8cc94205eef6c3df56a89a3a7041b10815ed6635..e1cc92d32e32cd5f05328098218046a35d39533a 100755 Binary files a/scripts/tools/Darwin/wav-diff and b/scripts/tools/Darwin/wav-diff differ diff --git a/scripts/tools/Linux/.gitattributes b/scripts/tools/Linux/.gitattributes new file mode 100644 index 0000000000000000000000000000000000000000..4cbca5d86571272693c890903bfd983172f45b48 --- /dev/null +++ b/scripts/tools/Linux/.gitattributes @@ -0,0 +1 @@ +wav-diff filter=lfs diff=lfs merge=lfs -text diff --git a/scripts/tools/Linux/thirdPartyLegalnotices/licenses_wav-diff.html b/scripts/tools/Linux/thirdPartyLegalnotices/licenses_wav-diff.html index 0b17bd169b1a4d1eeae710d99bcf6ce134216e86..dd386d5ea227e951f6ad03950b2af8895c09e353 100644 --- a/scripts/tools/Linux/thirdPartyLegalnotices/licenses_wav-diff.html +++ b/scripts/tools/Linux/thirdPartyLegalnotices/licenses_wav-diff.html @@ -44,8 +44,8 @@

    Overview of licenses:

    @@ -678,199 +678,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. - -
  • -
  • -

    Apache License 2.0

    -

    Used by:

    - -
                                  Apache License
    -                        Version 2.0, January 2004
    -                     http://www.apache.org/licenses/
    -
    -TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
    -
    -1. Definitions.
    -
    -   "License" shall mean the terms and conditions for use, reproduction,
    -   and distribution as defined by Sections 1 through 9 of this document.
    -
    -   "Licensor" shall mean the copyright owner or entity authorized by
    -   the copyright owner that is granting the License.
    -
    -   "Legal Entity" shall mean the union of the acting entity and all
    -   other entities that control, are controlled by, or are under common
    -   control with that entity. For the purposes of this definition,
    -   "control" means (i) the power, direct or indirect, to cause the
    -   direction or management of such entity, whether by contract or
    -   otherwise, or (ii) ownership of fifty percent (50%) or more of the
    -   outstanding shares, or (iii) beneficial ownership of such entity.
    -
    -   "You" (or "Your") shall mean an individual or Legal Entity
    -   exercising permissions granted by this License.
    -
    -   "Source" form shall mean the preferred form for making modifications,
    -   including but not limited to software source code, documentation
    -   source, and configuration files.
    -
    -   "Object" form shall mean any form resulting from mechanical
    -   transformation or translation of a Source form, including but
    -   not limited to compiled object code, generated documentation,
    -   and conversions to other media types.
    -
    -   "Work" shall mean the work of authorship, whether in Source or
    -   Object form, made available under the License, as indicated by a
    -   copyright notice that is included in or attached to the work
    -   (an example is provided in the Appendix below).
    -
    -   "Derivative Works" shall mean any work, whether in Source or Object
    -   form, that is based on (or derived from) the Work and for which the
    -   editorial revisions, annotations, elaborations, or other modifications
    -   represent, as a whole, an original work of authorship. For the purposes
    -   of this License, Derivative Works shall not include works that remain
    -   separable from, or merely link (or bind by name) to the interfaces of,
    -   the Work and Derivative Works thereof.
    -
    -   "Contribution" shall mean any work of authorship, including
    -   the original version of the Work and any modifications or additions
    -   to that Work or Derivative Works thereof, that is intentionally
    -   submitted to Licensor for inclusion in the Work by the copyright owner
    -   or by an individual or Legal Entity authorized to submit on behalf of
    -   the copyright owner. For the purposes of this definition, "submitted"
    -   means any form of electronic, verbal, or written communication sent
    -   to the Licensor or its representatives, including but not limited to
    -   communication on electronic mailing lists, source code control systems,
    -   and issue tracking systems that are managed by, or on behalf of, the
    -   Licensor for the purpose of discussing and improving the Work, but
    -   excluding communication that is conspicuously marked or otherwise
    -   designated in writing by the copyright owner as "Not a Contribution."
    -
    -   "Contributor" shall mean Licensor and any individual or Legal Entity
    -   on behalf of whom a Contribution has been received by Licensor and
    -   subsequently incorporated within the Work.
    -
    -2. Grant of Copyright License. Subject to the terms and conditions of
    -   this License, each Contributor hereby grants to You a perpetual,
    -   worldwide, non-exclusive, no-charge, royalty-free, irrevocable
    -   copyright license to reproduce, prepare Derivative Works of,
    -   publicly display, publicly perform, sublicense, and distribute the
    -   Work and such Derivative Works in Source or Object form.
    -
    -3. Grant of Patent License. Subject to the terms and conditions of
    -   this License, each Contributor hereby grants to You a perpetual,
    -   worldwide, non-exclusive, no-charge, royalty-free, irrevocable
    -   (except as stated in this section) patent license to make, have made,
    -   use, offer to sell, sell, import, and otherwise transfer the Work,
    -   where such license applies only to those patent claims licensable
    -   by such Contributor that are necessarily infringed by their
    -   Contribution(s) alone or by combination of their Contribution(s)
    -   with the Work to which such Contribution(s) was submitted. If You
    -   institute patent litigation against any entity (including a
    -   cross-claim or counterclaim in a lawsuit) alleging that the Work
    -   or a Contribution incorporated within the Work constitutes direct
    -   or contributory patent infringement, then any patent licenses
    -   granted to You under this License for that Work shall terminate
    -   as of the date such litigation is filed.
    -
    -4. Redistribution. You may reproduce and distribute copies of the
    -   Work or Derivative Works thereof in any medium, with or without
    -   modifications, and in Source or Object form, provided that You
    -   meet the following conditions:
    -
    -   (a) You must give any other recipients of the Work or
    -       Derivative Works a copy of this License; and
    -
    -   (b) You must cause any modified files to carry prominent notices
    -       stating that You changed the files; and
    -
    -   (c) You must retain, in the Source form of any Derivative Works
    -       that You distribute, all copyright, patent, trademark, and
    -       attribution notices from the Source form of the Work,
    -       excluding those notices that do not pertain to any part of
    -       the Derivative Works; and
    -
    -   (d) If the Work includes a "NOTICE" text file as part of its
    -       distribution, then any Derivative Works that You distribute must
    -       include a readable copy of the attribution notices contained
    -       within such NOTICE file, excluding those notices that do not
    -       pertain to any part of the Derivative Works, in at least one
    -       of the following places: within a NOTICE text file distributed
    -       as part of the Derivative Works; within the Source form or
    -       documentation, if provided along with the Derivative Works; or,
    -       within a display generated by the Derivative Works, if and
    -       wherever such third-party notices normally appear. The contents
    -       of the NOTICE file are for informational purposes only and
    -       do not modify the License. You may add Your own attribution
    -       notices within Derivative Works that You distribute, alongside
    -       or as an addendum to the NOTICE text from the Work, provided
    -       that such additional attribution notices cannot be construed
    -       as modifying the License.
    -
    -   You may add Your own copyright statement to Your modifications and
    -   may provide additional or different license terms and conditions
    -   for use, reproduction, or distribution of Your modifications, or
    -   for any such Derivative Works as a whole, provided Your use,
    -   reproduction, and distribution of the Work otherwise complies with
    -   the conditions stated in this License.
    -
    -5. Submission of Contributions. Unless You explicitly state otherwise,
    -   any Contribution intentionally submitted for inclusion in the Work
    -   by You to the Licensor shall be under the terms and conditions of
    -   this License, without any additional terms or conditions.
    -   Notwithstanding the above, nothing herein shall supersede or modify
    -   the terms of any separate license agreement you may have executed
    -   with Licensor regarding such Contributions.
    -
    -6. Trademarks. This License does not grant permission to use the trade
    -   names, trademarks, service marks, or product names of the Licensor,
    -   except as required for reasonable and customary use in describing the
    -   origin of the Work and reproducing the content of the NOTICE file.
    -
    -7. Disclaimer of Warranty. Unless required by applicable law or
    -   agreed to in writing, Licensor provides the Work (and each
    -   Contributor provides its Contributions) on an "AS IS" BASIS,
    -   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
    -   implied, including, without limitation, any warranties or conditions
    -   of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
    -   PARTICULAR PURPOSE. You are solely responsible for determining the
    -   appropriateness of using or redistributing the Work and assume any
    -   risks associated with Your exercise of permissions under this License.
    -
    -8. Limitation of Liability. In no event and under no legal theory,
    -   whether in tort (including negligence), contract, or otherwise,
    -   unless required by applicable law (such as deliberate and grossly
    -   negligent acts) or agreed to in writing, shall any Contributor be
    -   liable to You for damages, including any direct, indirect, special,
    -   incidental, or consequential damages of any character arising as a
    -   result of this License or out of the use or inability to use the
    -   Work (including but not limited to damages for loss of goodwill,
    -   work stoppage, computer failure or malfunction, or any and all
    -   other commercial damages or losses), even if such Contributor
    -   has been advised of the possibility of such damages.
    -
    -9. Accepting Warranty or Additional Liability. While redistributing
    -   the Work or Derivative Works thereof, You may choose to offer,
    -   and charge a fee for, acceptance of support, warranty, indemnity,
    -   or other liability obligations and/or rights consistent with this
    -   License. However, in accepting such obligations, You may act only
    -   on Your own behalf and on Your sole responsibility, not on behalf
    -   of any other Contributor, and only if You agree to indemnify,
    -   defend, and hold each Contributor harmless for any liability
    -   incurred by, or claims asserted against, such Contributor by reason
    -   of your accepting any such warranty or additional liability.
    -
    -END OF TERMS AND CONDITIONS
     
  • @@ -1725,19 +1532,6 @@ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. - -
  • -
  • -

    Apache License 2.0

    -

    Used by:

    - -
    // Licensed under the Apache License, Version 2.0
    -// <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
    -// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option.
    -// All files in the project carrying such notice may not be copied, modified, or distributed
    -// except according to those terms.
     
  • @@ -1746,6 +1540,17 @@ limitations under the License. @@ -1822,44 +1627,6 @@ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. - -
  • -
  • -

    Apache License 2.0

    -

    Used by:

    - -
    Copyright 2015 Nicholas Allegra (comex).
    -
    -Licensed under the Apache License, Version 2.0 (the "License");
    -you may not use this file except in compliance with the License.
    -You may obtain a copy of the License at
    -
    -    http://www.apache.org/licenses/LICENSE-2.0
    -
    -Unless required by applicable law or agreed to in writing, software
    -distributed under the License is distributed on an "AS IS" BASIS,
    -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    -See the License for the specific language governing permissions and
    -limitations under the License.
    -
    -
  • -
  • -

    Apache License 2.0

    -

    Used by:

    - -
    Licensed under the Apache License, Version 2.0
    -<LICENSE-APACHE or
    -http://www.apache.org/licenses/LICENSE-2.0> or the MIT
    -license <LICENSE-MIT or http://opensource.org/licenses/MIT>,
    -at your option. All files in the project carrying such
    -notice may not be copied, modified, or distributed except
    -according to those terms.
     
  • @@ -2037,18 +1804,6 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -
  • -
  • -

    MIT License

    -

    Used by:

    - -
    This project is dual-licensed under the Unlicense and MIT licenses.
    -
    -You may use this code under the terms of either license.
     
  • diff --git a/scripts/tools/Linux/wav-diff b/scripts/tools/Linux/wav-diff index ca9113cdb32624d8d1cb32c65346718b68fc0994..29e63f3d9a4bdf15321e09c65ba87a3f437436d5 100755 Binary files a/scripts/tools/Linux/wav-diff and b/scripts/tools/Linux/wav-diff differ diff --git a/scripts/tools/Win32/.gitattributes b/scripts/tools/Win32/.gitattributes new file mode 100644 index 0000000000000000000000000000000000000000..bdde0e8fc1909c00d609886ab08b6a2e97420b9b --- /dev/null +++ b/scripts/tools/Win32/.gitattributes @@ -0,0 +1 @@ +wav-diff.exe filter=lfs diff=lfs merge=lfs -text diff --git a/scripts/tools/Win32/thirdPartyLegalnotices/licenses_wav-diff.html b/scripts/tools/Win32/thirdPartyLegalnotices/licenses_wav-diff.html index 0b17bd169b1a4d1eeae710d99bcf6ce134216e86..dd386d5ea227e951f6ad03950b2af8895c09e353 100644 --- a/scripts/tools/Win32/thirdPartyLegalnotices/licenses_wav-diff.html +++ b/scripts/tools/Win32/thirdPartyLegalnotices/licenses_wav-diff.html @@ -44,8 +44,8 @@

    Overview of licenses:

    @@ -678,199 +678,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. - -
  • -
  • -

    Apache License 2.0

    -

    Used by:

    - -
                                  Apache License
    -                        Version 2.0, January 2004
    -                     http://www.apache.org/licenses/
    -
    -TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
    -
    -1. Definitions.
    -
    -   "License" shall mean the terms and conditions for use, reproduction,
    -   and distribution as defined by Sections 1 through 9 of this document.
    -
    -   "Licensor" shall mean the copyright owner or entity authorized by
    -   the copyright owner that is granting the License.
    -
    -   "Legal Entity" shall mean the union of the acting entity and all
    -   other entities that control, are controlled by, or are under common
    -   control with that entity. For the purposes of this definition,
    -   "control" means (i) the power, direct or indirect, to cause the
    -   direction or management of such entity, whether by contract or
    -   otherwise, or (ii) ownership of fifty percent (50%) or more of the
    -   outstanding shares, or (iii) beneficial ownership of such entity.
    -
    -   "You" (or "Your") shall mean an individual or Legal Entity
    -   exercising permissions granted by this License.
    -
    -   "Source" form shall mean the preferred form for making modifications,
    -   including but not limited to software source code, documentation
    -   source, and configuration files.
    -
    -   "Object" form shall mean any form resulting from mechanical
    -   transformation or translation of a Source form, including but
    -   not limited to compiled object code, generated documentation,
    -   and conversions to other media types.
    -
    -   "Work" shall mean the work of authorship, whether in Source or
    -   Object form, made available under the License, as indicated by a
    -   copyright notice that is included in or attached to the work
    -   (an example is provided in the Appendix below).
    -
    -   "Derivative Works" shall mean any work, whether in Source or Object
    -   form, that is based on (or derived from) the Work and for which the
    -   editorial revisions, annotations, elaborations, or other modifications
    -   represent, as a whole, an original work of authorship. For the purposes
    -   of this License, Derivative Works shall not include works that remain
    -   separable from, or merely link (or bind by name) to the interfaces of,
    -   the Work and Derivative Works thereof.
    -
    -   "Contribution" shall mean any work of authorship, including
    -   the original version of the Work and any modifications or additions
    -   to that Work or Derivative Works thereof, that is intentionally
    -   submitted to Licensor for inclusion in the Work by the copyright owner
    -   or by an individual or Legal Entity authorized to submit on behalf of
    -   the copyright owner. For the purposes of this definition, "submitted"
    -   means any form of electronic, verbal, or written communication sent
    -   to the Licensor or its representatives, including but not limited to
    -   communication on electronic mailing lists, source code control systems,
    -   and issue tracking systems that are managed by, or on behalf of, the
    -   Licensor for the purpose of discussing and improving the Work, but
    -   excluding communication that is conspicuously marked or otherwise
    -   designated in writing by the copyright owner as "Not a Contribution."
    -
    -   "Contributor" shall mean Licensor and any individual or Legal Entity
    -   on behalf of whom a Contribution has been received by Licensor and
    -   subsequently incorporated within the Work.
    -
    -2. Grant of Copyright License. Subject to the terms and conditions of
    -   this License, each Contributor hereby grants to You a perpetual,
    -   worldwide, non-exclusive, no-charge, royalty-free, irrevocable
    -   copyright license to reproduce, prepare Derivative Works of,
    -   publicly display, publicly perform, sublicense, and distribute the
    -   Work and such Derivative Works in Source or Object form.
    -
    -3. Grant of Patent License. Subject to the terms and conditions of
    -   this License, each Contributor hereby grants to You a perpetual,
    -   worldwide, non-exclusive, no-charge, royalty-free, irrevocable
    -   (except as stated in this section) patent license to make, have made,
    -   use, offer to sell, sell, import, and otherwise transfer the Work,
    -   where such license applies only to those patent claims licensable
    -   by such Contributor that are necessarily infringed by their
    -   Contribution(s) alone or by combination of their Contribution(s)
    -   with the Work to which such Contribution(s) was submitted. If You
    -   institute patent litigation against any entity (including a
    -   cross-claim or counterclaim in a lawsuit) alleging that the Work
    -   or a Contribution incorporated within the Work constitutes direct
    -   or contributory patent infringement, then any patent licenses
    -   granted to You under this License for that Work shall terminate
    -   as of the date such litigation is filed.
    -
    -4. Redistribution. You may reproduce and distribute copies of the
    -   Work or Derivative Works thereof in any medium, with or without
    -   modifications, and in Source or Object form, provided that You
    -   meet the following conditions:
    -
    -   (a) You must give any other recipients of the Work or
    -       Derivative Works a copy of this License; and
    -
    -   (b) You must cause any modified files to carry prominent notices
    -       stating that You changed the files; and
    -
    -   (c) You must retain, in the Source form of any Derivative Works
    -       that You distribute, all copyright, patent, trademark, and
    -       attribution notices from the Source form of the Work,
    -       excluding those notices that do not pertain to any part of
    -       the Derivative Works; and
    -
    -   (d) If the Work includes a "NOTICE" text file as part of its
    -       distribution, then any Derivative Works that You distribute must
    -       include a readable copy of the attribution notices contained
    -       within such NOTICE file, excluding those notices that do not
    -       pertain to any part of the Derivative Works, in at least one
    -       of the following places: within a NOTICE text file distributed
    -       as part of the Derivative Works; within the Source form or
    -       documentation, if provided along with the Derivative Works; or,
    -       within a display generated by the Derivative Works, if and
    -       wherever such third-party notices normally appear. The contents
    -       of the NOTICE file are for informational purposes only and
    -       do not modify the License. You may add Your own attribution
    -       notices within Derivative Works that You distribute, alongside
    -       or as an addendum to the NOTICE text from the Work, provided
    -       that such additional attribution notices cannot be construed
    -       as modifying the License.
    -
    -   You may add Your own copyright statement to Your modifications and
    -   may provide additional or different license terms and conditions
    -   for use, reproduction, or distribution of Your modifications, or
    -   for any such Derivative Works as a whole, provided Your use,
    -   reproduction, and distribution of the Work otherwise complies with
    -   the conditions stated in this License.
    -
    -5. Submission of Contributions. Unless You explicitly state otherwise,
    -   any Contribution intentionally submitted for inclusion in the Work
    -   by You to the Licensor shall be under the terms and conditions of
    -   this License, without any additional terms or conditions.
    -   Notwithstanding the above, nothing herein shall supersede or modify
    -   the terms of any separate license agreement you may have executed
    -   with Licensor regarding such Contributions.
    -
    -6. Trademarks. This License does not grant permission to use the trade
    -   names, trademarks, service marks, or product names of the Licensor,
    -   except as required for reasonable and customary use in describing the
    -   origin of the Work and reproducing the content of the NOTICE file.
    -
    -7. Disclaimer of Warranty. Unless required by applicable law or
    -   agreed to in writing, Licensor provides the Work (and each
    -   Contributor provides its Contributions) on an "AS IS" BASIS,
    -   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
    -   implied, including, without limitation, any warranties or conditions
    -   of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
    -   PARTICULAR PURPOSE. You are solely responsible for determining the
    -   appropriateness of using or redistributing the Work and assume any
    -   risks associated with Your exercise of permissions under this License.
    -
    -8. Limitation of Liability. In no event and under no legal theory,
    -   whether in tort (including negligence), contract, or otherwise,
    -   unless required by applicable law (such as deliberate and grossly
    -   negligent acts) or agreed to in writing, shall any Contributor be
    -   liable to You for damages, including any direct, indirect, special,
    -   incidental, or consequential damages of any character arising as a
    -   result of this License or out of the use or inability to use the
    -   Work (including but not limited to damages for loss of goodwill,
    -   work stoppage, computer failure or malfunction, or any and all
    -   other commercial damages or losses), even if such Contributor
    -   has been advised of the possibility of such damages.
    -
    -9. Accepting Warranty or Additional Liability. While redistributing
    -   the Work or Derivative Works thereof, You may choose to offer,
    -   and charge a fee for, acceptance of support, warranty, indemnity,
    -   or other liability obligations and/or rights consistent with this
    -   License. However, in accepting such obligations, You may act only
    -   on Your own behalf and on Your sole responsibility, not on behalf
    -   of any other Contributor, and only if You agree to indemnify,
    -   defend, and hold each Contributor harmless for any liability
    -   incurred by, or claims asserted against, such Contributor by reason
    -   of your accepting any such warranty or additional liability.
    -
    -END OF TERMS AND CONDITIONS
     
  • @@ -1725,19 +1532,6 @@ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. - -
  • -
  • -

    Apache License 2.0

    -

    Used by:

    - -
    // Licensed under the Apache License, Version 2.0
    -// <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
    -// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option.
    -// All files in the project carrying such notice may not be copied, modified, or distributed
    -// except according to those terms.
     
  • @@ -1746,6 +1540,17 @@ limitations under the License. @@ -1822,44 +1627,6 @@ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. - -
  • -
  • -

    Apache License 2.0

    -

    Used by:

    - -
    Copyright 2015 Nicholas Allegra (comex).
    -
    -Licensed under the Apache License, Version 2.0 (the "License");
    -you may not use this file except in compliance with the License.
    -You may obtain a copy of the License at
    -
    -    http://www.apache.org/licenses/LICENSE-2.0
    -
    -Unless required by applicable law or agreed to in writing, software
    -distributed under the License is distributed on an "AS IS" BASIS,
    -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    -See the License for the specific language governing permissions and
    -limitations under the License.
    -
    -
  • -
  • -

    Apache License 2.0

    -

    Used by:

    - -
    Licensed under the Apache License, Version 2.0
    -<LICENSE-APACHE or
    -http://www.apache.org/licenses/LICENSE-2.0> or the MIT
    -license <LICENSE-MIT or http://opensource.org/licenses/MIT>,
    -at your option. All files in the project carrying such
    -notice may not be copied, modified, or distributed except
    -according to those terms.
     
  • @@ -2037,18 +1804,6 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -
  • -
  • -

    MIT License

    -

    Used by:

    - -
    This project is dual-licensed under the Unlicense and MIT licenses.
    -
    -You may use this code under the terms of either license.
     
  • diff --git a/scripts/tools/Win32/wav-diff.exe b/scripts/tools/Win32/wav-diff.exe index c06f7bb8261401ed4823457cfa97de6fac8fa7d9..8ed1329aa2d049e07e1e3cb0df64bf2c0376cd00 100644 --- a/scripts/tools/Win32/wav-diff.exe +++ b/scripts/tools/Win32/wav-diff.exe @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:fbefe8e53d825cff13c5a88cd286b5f28307e60849123fde73ea7527f54e2765 -size 872448 +oid sha256:edb7f677278f8914109247673fca07c3a79ddede41a0cede61de8a435809b911 +size 880128 diff --git a/scripts/trajectories/rotate_euler_quaternion_30s.csv b/scripts/trajectories/rotate_euler_quaternion_30s.csv new file mode 100644 index 0000000000000000000000000000000000000000..d4fdb053c187faf80d5aed0fc36c8d10eeeac4ee --- /dev/null +++ b/scripts/trajectories/rotate_euler_quaternion_30s.csv @@ -0,0 +1,6000 @@ +-3,360,0,0 +-3,359.1,0,0 +-3,358.2,0,0 +-3,357.3,0,0 +-3,356.4,0,0 +-3,355.5,0,0 +-3,354.6,0,0 +-3,353.7,0,0 +-3,352.8,0,0 +-3,351.9,0,0 +-3,351,0,0 +-3,350.1,0,0 +-3,349.2,0,0 +-3,348.3,0,0 +-3,347.4,0,0 +-3,346.5,0,0 +-3,345.6,0,0 +-3,344.7,0,0 +-3,343.8,0,0 +-3,342.9,0,0 +-3,342,0,0 +-3,341.1,0,0 +-3,340.2,0,0 +-3,339.2,0,0 +-3,338.3,0,0 +-3,337.4,0,0 +-3,336.5,0,0 +-3,335.6,0,0 +-3,334.7,0,0 +-3,333.8,0,0 +-3,332.9,0,0 +-3,332,0,0 +-3,331.1,0,0 +-3,330.2,0,0 +-3,329.3,0,0 +-3,328.4,0,0 +-3,327.5,0,0 +-3,326.6,0,0 +-3,325.7,0,0 +-3,324.8,0,0 +-3,323.9,0,0 +-3,323,0,0 +-3,322.1,0,0 +-3,321.2,0,0 +-3,320.3,0,0 +-3,319.4,0,0 +-3,318.5,0,0 +-3,317.6,0,0 +-3,316.7,0,0 +-3,315.8,0,0 +-3,314.9,0,0 +-3,314,0,0 +-3,313.1,0,0 +-3,312.2,0,0 +-3,311.3,0,0 +-3,310.4,0,0 +-3,309.5,0,0 +-3,308.6,0,0 +-3,307.7,0,0 +-3,306.8,0,0 +-3,305.9,0,0 +-3,305,0,0 +-3,304.1,0,0 +-3,303.2,0,0 +-3,302.3,0,0 +-3,301.4,0,0 +-3,300.5,0,0 +-3,299.5,0,0 +-3,298.6,0,0 +-3,297.7,0,0 +-3,296.8,0,0 +-3,295.9,0,0 +-3,295,0,0 +-3,294.1,0,0 +-3,293.2,0,0 +-3,292.3,0,0 +-3,291.4,0,0 +-3,290.5,0,0 +-3,289.6,0,0 +-3,288.7,0,0 +-3,287.8,0,0 +-3,286.9,0,0 +-3,286,0,0 +-3,285.1,0,0 +-3,284.2,0,0 +-3,283.3,0,0 +-3,282.4,0,0 +-3,281.5,0,0 +-3,280.6,0,0 +-3,279.7,0,0 +-3,278.8,0,0 +-3,277.9,0,0 +-3,277,0,0 +-3,276.1,0,0 +-3,275.2,0,0 +-3,274.3,0,0 +-3,273.4,0,0 +-3,272.5,0,0 +-3,271.6,0,0 +-3,270.7,0,0 +-3,269.8,0,0 +-3,268.9,0,0 +-3,268,0,0 +-3,267.1,0,0 +-3,266.2,0,0 +-3,265.3,0,0 +-3,264.4,0,0 +-3,263.5,0,0 +-3,262.6,0,0 +-3,261.7,0,0 +-3,260.8,0,0 +-3,259.8,0,0 +-3,258.9,0,0 +-3,258,0,0 +-3,257.1,0,0 +-3,256.2,0,0 +-3,255.3,0,0 +-3,254.4,0,0 +-3,253.5,0,0 +-3,252.6,0,0 +-3,251.7,0,0 +-3,250.8,0,0 +-3,249.9,0,0 +-3,249,0,0 +-3,248.1,0,0 +-3,247.2,0,0 +-3,246.3,0,0 +-3,245.4,0,0 +-3,244.5,0,0 +-3,243.6,0,0 +-3,242.7,0,0 +-3,241.8,0,0 +-3,240.9,0,0 +-3,240,0,0 +-3,239.1,0,0 +-3,238.2,0,0 +-3,237.3,0,0 +-3,236.4,0,0 +-3,235.5,0,0 +-3,234.6,0,0 +-3,233.7,0,0 +-3,232.8,0,0 +-3,231.9,0,0 +-3,231,0,0 +-3,230.1,0,0 +-3,229.2,0,0 +-3,228.3,0,0 +-3,227.4,0,0 +-3,226.5,0,0 +-3,225.6,0,0 +-3,224.7,0,0 +-3,223.8,0,0 +-3,222.9,0,0 +-3,222,0,0 +-3,221.1,0,0 +-3,220.2,0,0 +-3,219.2,0,0 +-3,218.3,0,0 +-3,217.4,0,0 +-3,216.5,0,0 +-3,215.6,0,0 +-3,214.7,0,0 +-3,213.8,0,0 +-3,212.9,0,0 +-3,212,0,0 +-3,211.1,0,0 +-3,210.2,0,0 +-3,209.3,0,0 +-3,208.4,0,0 +-3,207.5,0,0 +-3,206.6,0,0 +-3,205.7,0,0 +-3,204.8,0,0 +-3,203.9,0,0 +-3,203,0,0 +-3,202.1,0,0 +-3,201.2,0,0 +-3,200.3,0,0 +-3,199.4,0,0 +-3,198.5,0,0 +-3,197.6,0,0 +-3,196.7,0,0 +-3,195.8,0,0 +-3,194.9,0,0 +-3,194,0,0 +-3,193.1,0,0 +-3,192.2,0,0 +-3,191.3,0,0 +-3,190.4,0,0 +-3,189.5,0,0 +-3,188.6,0,0 +-3,187.7,0,0 +-3,186.8,0,0 +-3,185.9,0,0 +-3,185,0,0 +-3,184.1,0,0 +-3,183.2,0,0 +-3,182.3,0,0 +-3,181.4,0,0 +-3,180.5,0,0 +-3,179.5,-90,0 +-3,178.6,-89.5,0 +-3,177.7,-89.1,0 +-3,176.8,-88.6,0 +-3,175.9,-88.2,0 +-3,175,-87.7,0 +-3,174.1,-87.3,0 +-3,173.2,-86.8,0 +-3,172.3,-86.4,0 +-3,171.4,-85.9,0 +-3,170.5,-85.5,0 +-3,169.6,-85,0 +-3,168.7,-84.6,0 +-3,167.8,-84.1,0 +-3,166.9,-83.7,0 +-3,166,-83.2,0 +-3,165.1,-82.8,0 +-3,164.2,-82.3,0 +-3,163.3,-81.9,0 +-3,162.4,-81.4,0 +-3,161.5,-81,0 +-3,160.6,-80.5,0 +-3,159.7,-80.1,0 +-3,158.8,-79.6,0 +-3,157.9,-79.1,0 +-3,157,-78.7,0 +-3,156.1,-78.2,0 +-3,155.2,-77.8,0 +-3,154.3,-77.3,0 +-3,153.4,-76.9,0 +-3,152.5,-76.4,0 +-3,151.6,-76,0 +-3,150.7,-75.5,0 +-3,149.8,-75.1,0 +-3,148.9,-74.6,0 +-3,148,-74.2,0 +-3,147.1,-73.7,0 +-3,146.2,-73.3,0 +-3,145.3,-72.8,0 +-3,144.4,-72.4,0 +-3,143.5,-71.9,0 +-3,142.6,-71.5,0 +-3,141.7,-71,0 +-3,140.8,-70.6,0 +-3,139.8,-70.1,0 +-3,138.9,-69.6,0 +-3,138,-69.2,0 +-3,137.1,-68.7,0 +-3,136.2,-68.3,0 +-3,135.3,-67.8,0 +-3,134.4,-67.4,0 +-3,133.5,-66.9,0 +-3,132.6,-66.5,0 +-3,131.7,-66,0 +-3,130.8,-65.6,0 +-3,129.9,-65.1,0 +-3,129,-64.7,0 +-3,128.1,-64.2,0 +-3,127.2,-63.8,0 +-3,126.3,-63.3,0 +-3,125.4,-62.9,0 +-3,124.5,-62.4,0 +-3,123.6,-62,0 +-3,122.7,-61.5,0 +-3,121.8,-61.1,0 +-3,120.9,-60.6,0 +-3,120,-60.2,0 +-3,119.1,-59.7,0 +-3,118.2,-59.2,0 +-3,117.3,-58.8,0 +-3,116.4,-58.3,0 +-3,115.5,-57.9,0 +-3,114.6,-57.4,0 +-3,113.7,-57,0 +-3,112.8,-56.5,0 +-3,111.9,-56.1,0 +-3,111,-55.6,0 +-3,110.1,-55.2,0 +-3,109.2,-54.7,0 +-3,108.3,-54.3,0 +-3,107.4,-53.8,0 +-3,106.5,-53.4,0 +-3,105.6,-52.9,0 +-3,104.7,-52.5,0 +-3,103.8,-52,0 +-3,102.9,-51.6,0 +-3,102,-51.1,0 +-3,101.1,-50.7,0 +-3,100.2,-50.2,0 +-3,99.2,-49.7,0 +-3,98.3,-49.3,0 +-3,97.4,-48.8,0 +-3,96.5,-48.4,0 +-3,95.6,-47.9,0 +-3,94.7,-47.5,0 +-3,93.8,-47,0 +-3,92.9,-46.6,0 +-3,92,-46.1,0 +-3,91.1,-45.7,0 +-3,90.2,-45.2,0 +-3,89.3,-44.8,90 +-3,88.4,-44.3,89.1 +-3,87.5,-43.9,88.2 +-3,86.6,-43.4,87.3 +-3,85.7,-43,86.4 +-3,84.8,-42.5,85.5 +-3,83.9,-42.1,84.5 +-3,83,-41.6,83.6 +-3,82.1,-41.2,82.7 +-3,81.2,-40.7,81.8 +-3,80.3,-40.3,80.9 +-3,79.4,-39.8,80 +-3,78.5,-39.3,79.1 +-3,77.6,-38.9,78.2 +-3,76.7,-38.4,77.3 +-3,75.8,-38,76.4 +-3,74.9,-37.5,75.5 +-3,74,-37.1,74.5 +-3,73.1,-36.6,73.6 +-3,72.2,-36.2,72.7 +-3,71.3,-35.7,71.8 +-3,70.4,-35.3,70.9 +-3,69.5,-34.8,70 +-3,68.6,-34.4,69.1 +-3,67.7,-33.9,68.2 +-3,66.8,-33.5,67.3 +-3,65.9,-33,66.4 +-3,65,-32.6,65.5 +-3,64.1,-32.1,64.5 +-3,63.2,-31.7,63.6 +-3,62.3,-31.2,62.7 +-3,61.4,-30.8,61.8 +-3,60.5,-30.3,60.9 +-3,59.5,-29.8,60 +-3,58.6,-29.4,59.1 +-3,57.7,-28.9,58.2 +-3,56.8,-28.5,57.3 +-3,55.9,-28,56.4 +-3,55,-27.6,55.5 +-3,54.1,-27.1,54.5 +-3,53.2,-26.7,53.6 +-3,52.3,-26.2,52.7 +-3,51.4,-25.8,51.8 +-3,50.5,-25.3,50.9 +-3,49.6,-24.9,50 +-3,48.7,-24.4,49.1 +-3,47.8,-24,48.2 +-3,46.9,-23.5,47.3 +-3,46,-23.1,46.4 +-3,45.1,-22.6,45.5 +-3,44.2,-22.2,44.5 +-3,43.3,-21.7,43.6 +-3,42.4,-21.3,42.7 +-3,41.5,-20.8,41.8 +-3,40.6,-20.4,40.9 +-3,39.7,-19.9,40 +-3,38.8,-19.4,39.1 +-3,37.9,-19,38.2 +-3,37,-18.5,37.3 +-3,36.1,-18.1,36.4 +-3,35.2,-17.6,35.5 +-3,34.3,-17.2,34.5 +-3,33.4,-16.7,33.6 +-3,32.5,-16.3,32.7 +-3,31.6,-15.8,31.8 +-3,30.7,-15.4,30.9 +-3,29.8,-14.9,30 +-3,28.9,-14.5,29.1 +-3,28,-14,28.2 +-3,27.1,-13.6,27.3 +-3,26.2,-13.1,26.4 +-3,25.3,-12.7,25.5 +-3,24.4,-12.2,24.5 +-3,23.5,-11.8,23.6 +-3,22.6,-11.3,22.7 +-3,21.7,-10.9,21.8 +-3,20.8,-10.4,20.9 +-3,19.8,-9.9,20 +-3,18.9,-9.5,19.1 +-3,18,-9,18.2 +-3,17.1,-8.6,17.3 +-3,16.2,-8.1,16.4 +-3,15.3,-7.7,15.5 +-3,14.4,-7.2,14.5 +-3,13.5,-6.8,13.6 +-3,12.6,-6.3,12.7 +-3,11.7,-5.9,11.8 +-3,10.8,-5.4,10.9 +-3,9.9,-5,10 +-3,9,-4.5,9.1 +-3,8.1,-4.1,8.2 +-3,7.2,-3.6,7.3 +-3,6.3,-3.2,6.4 +-3,5.4,-2.7,5.5 +-3,4.5,-2.3,4.5 +-3,3.6,-1.8,3.6 +-3,2.7,-1.4,2.7 +-3,1.8,-0.9,1.8 +-3,0.9,-0.5,0.9 +-3,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +0.9,0,0,0.3 +0.9,0,0,0.3 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.8,0,0,0.5 +0.8,0,0,0.5 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.5,0,0,0.8 +0.5,0,0,0.8 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.3,0,0,0.9 +0.3,0,0,0.9 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,0.9 +0.3,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.8 +0.5,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.7,0,0,0.8 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.8,0,0,0.7 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.5 +0.8,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.3 +0.9,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0 +-3,0,0,0 +-3,0.9,-0.5,0.9 +-3,1.8,-0.9,1.8 +-3,2.7,-1.4,2.7 +-3,3.6,-1.8,3.6 +-3,4.5,-2.3,4.5 +-3,5.4,-2.7,5.5 +-3,6.3,-3.2,6.4 +-3,7.2,-3.6,7.3 +-3,8.1,-4.1,8.2 +-3,9,-4.5,9.1 +-3,9.9,-5,10 +-3,10.8,-5.4,10.9 +-3,11.7,-5.9,11.8 +-3,12.6,-6.3,12.7 +-3,13.5,-6.8,13.6 +-3,14.4,-7.2,14.5 +-3,15.3,-7.7,15.5 +-3,16.2,-8.1,16.4 +-3,17.1,-8.6,17.3 +-3,18,-9,18.2 +-3,18.9,-9.5,19.1 +-3,19.8,-9.9,20 +-3,20.8,-10.4,20.9 +-3,21.7,-10.9,21.8 +-3,22.6,-11.3,22.7 +-3,23.5,-11.8,23.6 +-3,24.4,-12.2,24.5 +-3,25.3,-12.7,25.5 +-3,26.2,-13.1,26.4 +-3,27.1,-13.6,27.3 +-3,28,-14,28.2 +-3,28.9,-14.5,29.1 +-3,29.8,-14.9,30 +-3,30.7,-15.4,30.9 +-3,31.6,-15.8,31.8 +-3,32.5,-16.3,32.7 +-3,33.4,-16.7,33.6 +-3,34.3,-17.2,34.5 +-3,35.2,-17.6,35.5 +-3,36.1,-18.1,36.4 +-3,37,-18.5,37.3 +-3,37.9,-19,38.2 +-3,38.8,-19.4,39.1 +-3,39.7,-19.9,40 +-3,40.6,-20.4,40.9 +-3,41.5,-20.8,41.8 +-3,42.4,-21.3,42.7 +-3,43.3,-21.7,43.6 +-3,44.2,-22.2,44.5 +-3,45.1,-22.6,45.5 +-3,46,-23.1,46.4 +-3,46.9,-23.5,47.3 +-3,47.8,-24,48.2 +-3,48.7,-24.4,49.1 +-3,49.6,-24.9,50 +-3,50.5,-25.3,50.9 +-3,51.4,-25.8,51.8 +-3,52.3,-26.2,52.7 +-3,53.2,-26.7,53.6 +-3,54.1,-27.1,54.5 +-3,55,-27.6,55.5 +-3,55.9,-28,56.4 +-3,56.8,-28.5,57.3 +-3,57.7,-28.9,58.2 +-3,58.6,-29.4,59.1 +-3,59.5,-29.8,60 +-3,60.5,-30.3,60.9 +-3,61.4,-30.8,61.8 +-3,62.3,-31.2,62.7 +-3,63.2,-31.7,63.6 +-3,64.1,-32.1,64.5 +-3,65,-32.6,65.5 +-3,65.9,-33,66.4 +-3,66.8,-33.5,67.3 +-3,67.7,-33.9,68.2 +-3,68.6,-34.4,69.1 +-3,69.5,-34.8,70 +-3,70.4,-35.3,70.9 +-3,71.3,-35.7,71.8 +-3,72.2,-36.2,72.7 +-3,73.1,-36.6,73.6 +-3,74,-37.1,74.5 +-3,74.9,-37.5,75.5 +-3,75.8,-38,76.4 +-3,76.7,-38.4,77.3 +-3,77.6,-38.9,78.2 +-3,78.5,-39.3,79.1 +-3,79.4,-39.8,80 +-3,80.3,-40.3,80.9 +-3,81.2,-40.7,81.8 +-3,82.1,-41.2,82.7 +-3,83,-41.6,83.6 +-3,83.9,-42.1,84.5 +-3,84.8,-42.5,85.5 +-3,85.7,-43,86.4 +-3,86.6,-43.4,87.3 +-3,87.5,-43.9,88.2 +-3,88.4,-44.3,89.1 +-3,89.3,-44.8,90 +-3,90.2,-45.2,0 +-3,91.1,-45.7,0 +-3,92,-46.1,0 +-3,92.9,-46.6,0 +-3,93.8,-47,0 +-3,94.7,-47.5,0 +-3,95.6,-47.9,0 +-3,96.5,-48.4,0 +-3,97.4,-48.8,0 +-3,98.3,-49.3,0 +-3,99.2,-49.7,0 +-3,100.2,-50.2,0 +-3,101.1,-50.7,0 +-3,102,-51.1,0 +-3,102.9,-51.6,0 +-3,103.8,-52,0 +-3,104.7,-52.5,0 +-3,105.6,-52.9,0 +-3,106.5,-53.4,0 +-3,107.4,-53.8,0 +-3,108.3,-54.3,0 +-3,109.2,-54.7,0 +-3,110.1,-55.2,0 +-3,111,-55.6,0 +-3,111.9,-56.1,0 +-3,112.8,-56.5,0 +-3,113.7,-57,0 +-3,114.6,-57.4,0 +-3,115.5,-57.9,0 +-3,116.4,-58.3,0 +-3,117.3,-58.8,0 +-3,118.2,-59.2,0 +-3,119.1,-59.7,0 +-3,120,-60.2,0 +-3,120.9,-60.6,0 +-3,121.8,-61.1,0 +-3,122.7,-61.5,0 +-3,123.6,-62,0 +-3,124.5,-62.4,0 +-3,125.4,-62.9,0 +-3,126.3,-63.3,0 +-3,127.2,-63.8,0 +-3,128.1,-64.2,0 +-3,129,-64.7,0 +-3,129.9,-65.1,0 +-3,130.8,-65.6,0 +-3,131.7,-66,0 +-3,132.6,-66.5,0 +-3,133.5,-66.9,0 +-3,134.4,-67.4,0 +-3,135.3,-67.8,0 +-3,136.2,-68.3,0 +-3,137.1,-68.7,0 +-3,138,-69.2,0 +-3,138.9,-69.6,0 +-3,139.8,-70.1,0 +-3,140.8,-70.6,0 +-3,141.7,-71,0 +-3,142.6,-71.5,0 +-3,143.5,-71.9,0 +-3,144.4,-72.4,0 +-3,145.3,-72.8,0 +-3,146.2,-73.3,0 +-3,147.1,-73.7,0 +-3,148,-74.2,0 +-3,148.9,-74.6,0 +-3,149.8,-75.1,0 +-3,150.7,-75.5,0 +-3,151.6,-76,0 +-3,152.5,-76.4,0 +-3,153.4,-76.9,0 +-3,154.3,-77.3,0 +-3,155.2,-77.8,0 +-3,156.1,-78.2,0 +-3,157,-78.7,0 +-3,157.9,-79.1,0 +-3,158.8,-79.6,0 +-3,159.7,-80.1,0 +-3,160.6,-80.5,0 +-3,161.5,-81,0 +-3,162.4,-81.4,0 +-3,163.3,-81.9,0 +-3,164.2,-82.3,0 +-3,165.1,-82.8,0 +-3,166,-83.2,0 +-3,166.9,-83.7,0 +-3,167.8,-84.1,0 +-3,168.7,-84.6,0 +-3,169.6,-85,0 +-3,170.5,-85.5,0 +-3,171.4,-85.9,0 +-3,172.3,-86.4,0 +-3,173.2,-86.8,0 +-3,174.1,-87.3,0 +-3,175,-87.7,0 +-3,175.9,-88.2,0 +-3,176.8,-88.6,0 +-3,177.7,-89.1,0 +-3,178.6,-89.5,0 +-3,179.5,-90,0 +-3,180.5,0,0 +-3,181.4,0,0 +-3,182.3,0,0 +-3,183.2,0,0 +-3,184.1,0,0 +-3,185,0,0 +-3,185.9,0,0 +-3,186.8,0,0 +-3,187.7,0,0 +-3,188.6,0,0 +-3,189.5,0,0 +-3,190.4,0,0 +-3,191.3,0,0 +-3,192.2,0,0 +-3,193.1,0,0 +-3,194,0,0 +-3,194.9,0,0 +-3,195.8,0,0 +-3,196.7,0,0 +-3,197.6,0,0 +-3,198.5,0,0 +-3,199.4,0,0 +-3,200.3,0,0 +-3,201.2,0,0 +-3,202.1,0,0 +-3,203,0,0 +-3,203.9,0,0 +-3,204.8,0,0 +-3,205.7,0,0 +-3,206.6,0,0 +-3,207.5,0,0 +-3,208.4,0,0 +-3,209.3,0,0 +-3,210.2,0,0 +-3,211.1,0,0 +-3,212,0,0 +-3,212.9,0,0 +-3,213.8,0,0 +-3,214.7,0,0 +-3,215.6,0,0 +-3,216.5,0,0 +-3,217.4,0,0 +-3,218.3,0,0 +-3,219.2,0,0 +-3,220.2,0,0 +-3,221.1,0,0 +-3,222,0,0 +-3,222.9,0,0 +-3,223.8,0,0 +-3,224.7,0,0 +-3,225.6,0,0 +-3,226.5,0,0 +-3,227.4,0,0 +-3,228.3,0,0 +-3,229.2,0,0 +-3,230.1,0,0 +-3,231,0,0 +-3,231.9,0,0 +-3,232.8,0,0 +-3,233.7,0,0 +-3,234.6,0,0 +-3,235.5,0,0 +-3,236.4,0,0 +-3,237.3,0,0 +-3,238.2,0,0 +-3,239.1,0,0 +-3,240,0,0 +-3,240.9,0,0 +-3,241.8,0,0 +-3,242.7,0,0 +-3,243.6,0,0 +-3,244.5,0,0 +-3,245.4,0,0 +-3,246.3,0,0 +-3,247.2,0,0 +-3,248.1,0,0 +-3,249,0,0 +-3,249.9,0,0 +-3,250.8,0,0 +-3,251.7,0,0 +-3,252.6,0,0 +-3,253.5,0,0 +-3,254.4,0,0 +-3,255.3,0,0 +-3,256.2,0,0 +-3,257.1,0,0 +-3,258,0,0 +-3,258.9,0,0 +-3,259.8,0,0 +-3,260.8,0,0 +-3,261.7,0,0 +-3,262.6,0,0 +-3,263.5,0,0 +-3,264.4,0,0 +-3,265.3,0,0 +-3,266.2,0,0 +-3,267.1,0,0 +-3,268,0,0 +-3,268.9,0,0 +-3,269.8,0,0 +-3,270.7,0,0 +-3,271.6,0,0 +-3,272.5,0,0 +-3,273.4,0,0 +-3,274.3,0,0 +-3,275.2,0,0 +-3,276.1,0,0 +-3,277,0,0 +-3,277.9,0,0 +-3,278.8,0,0 +-3,279.7,0,0 +-3,280.6,0,0 +-3,281.5,0,0 +-3,282.4,0,0 +-3,283.3,0,0 +-3,284.2,0,0 +-3,285.1,0,0 +-3,286,0,0 +-3,286.9,0,0 +-3,287.8,0,0 +-3,288.7,0,0 +-3,289.6,0,0 +-3,290.5,0,0 +-3,291.4,0,0 +-3,292.3,0,0 +-3,293.2,0,0 +-3,294.1,0,0 +-3,295,0,0 +-3,295.9,0,0 +-3,296.8,0,0 +-3,297.7,0,0 +-3,298.6,0,0 +-3,299.5,0,0 +-3,300.5,0,0 +-3,301.4,0,0 +-3,302.3,0,0 +-3,303.2,0,0 +-3,304.1,0,0 +-3,305,0,0 +-3,305.9,0,0 +-3,306.8,0,0 +-3,307.7,0,0 +-3,308.6,0,0 +-3,309.5,0,0 +-3,310.4,0,0 +-3,311.3,0,0 +-3,312.2,0,0 +-3,313.1,0,0 +-3,314,0,0 +-3,314.9,0,0 +-3,315.8,0,0 +-3,316.7,0,0 +-3,317.6,0,0 +-3,318.5,0,0 +-3,319.4,0,0 +-3,320.3,0,0 +-3,321.2,0,0 +-3,322.1,0,0 +-3,323,0,0 +-3,323.9,0,0 +-3,324.8,0,0 +-3,325.7,0,0 +-3,326.6,0,0 +-3,327.5,0,0 +-3,328.4,0,0 +-3,329.3,0,0 +-3,330.2,0,0 +-3,331.1,0,0 +-3,332,0,0 +-3,332.9,0,0 +-3,333.8,0,0 +-3,334.7,0,0 +-3,335.6,0,0 +-3,336.5,0,0 +-3,337.4,0,0 +-3,338.3,0,0 +-3,339.2,0,0 +-3,340.2,0,0 +-3,341.1,0,0 +-3,342,0,0 +-3,342.9,0,0 +-3,343.8,0,0 +-3,344.7,0,0 +-3,345.6,0,0 +-3,346.5,0,0 +-3,347.4,0,0 +-3,348.3,0,0 +-3,349.2,0,0 +-3,350.1,0,0 +-3,351,0,0 +-3,351.9,0,0 +-3,352.8,0,0 +-3,353.7,0,0 +-3,354.6,0,0 +-3,355.5,0,0 +-3,356.4,0,0 +-3,357.3,0,0 +-3,358.2,0,0 +-3,359.1,0,0 +-3,360,0,0 +-3,360,0,0 +-3,359.1,0,0 +-3,358.2,0,0 +-3,357.3,0,0 +-3,356.4,0,0 +-3,355.5,0,0 +-3,354.6,0,0 +-3,353.7,0,0 +-3,352.8,0,0 +-3,351.9,0,0 +-3,351,0,0 +-3,350.1,0,0 +-3,349.2,0,0 +-3,348.3,0,0 +-3,347.4,0,0 +-3,346.5,0,0 +-3,345.6,0,0 +-3,344.7,0,0 +-3,343.8,0,0 +-3,342.9,0,0 +-3,342,0,0 +-3,341.1,0,0 +-3,340.2,0,0 +-3,339.2,0,0 +-3,338.3,0,0 +-3,337.4,0,0 +-3,336.5,0,0 +-3,335.6,0,0 +-3,334.7,0,0 +-3,333.8,0,0 +-3,332.9,0,0 +-3,332,0,0 +-3,331.1,0,0 +-3,330.2,0,0 +-3,329.3,0,0 +-3,328.4,0,0 +-3,327.5,0,0 +-3,326.6,0,0 +-3,325.7,0,0 +-3,324.8,0,0 +-3,323.9,0,0 +-3,323,0,0 +-3,322.1,0,0 +-3,321.2,0,0 +-3,320.3,0,0 +-3,319.4,0,0 +-3,318.5,0,0 +-3,317.6,0,0 +-3,316.7,0,0 +-3,315.8,0,0 +-3,314.9,0,0 +-3,314,0,0 +-3,313.1,0,0 +-3,312.2,0,0 +-3,311.3,0,0 +-3,310.4,0,0 +-3,309.5,0,0 +-3,308.6,0,0 +-3,307.7,0,0 +-3,306.8,0,0 +-3,305.9,0,0 +-3,305,0,0 +-3,304.1,0,0 +-3,303.2,0,0 +-3,302.3,0,0 +-3,301.4,0,0 +-3,300.5,0,0 +-3,299.5,0,0 +-3,298.6,0,0 +-3,297.7,0,0 +-3,296.8,0,0 +-3,295.9,0,0 +-3,295,0,0 +-3,294.1,0,0 +-3,293.2,0,0 +-3,292.3,0,0 +-3,291.4,0,0 +-3,290.5,0,0 +-3,289.6,0,0 +-3,288.7,0,0 +-3,287.8,0,0 +-3,286.9,0,0 +-3,286,0,0 +-3,285.1,0,0 +-3,284.2,0,0 +-3,283.3,0,0 +-3,282.4,0,0 +-3,281.5,0,0 +-3,280.6,0,0 +-3,279.7,0,0 +-3,278.8,0,0 +-3,277.9,0,0 +-3,277,0,0 +-3,276.1,0,0 +-3,275.2,0,0 +-3,274.3,0,0 +-3,273.4,0,0 +-3,272.5,0,0 +-3,271.6,0,0 +-3,270.7,0,0 +-3,269.8,0,0 +-3,268.9,0,0 +-3,268,0,0 +-3,267.1,0,0 +-3,266.2,0,0 +-3,265.3,0,0 +-3,264.4,0,0 +-3,263.5,0,0 +-3,262.6,0,0 +-3,261.7,0,0 +-3,260.8,0,0 +-3,259.8,0,0 +-3,258.9,0,0 +-3,258,0,0 +-3,257.1,0,0 +-3,256.2,0,0 +-3,255.3,0,0 +-3,254.4,0,0 +-3,253.5,0,0 +-3,252.6,0,0 +-3,251.7,0,0 +-3,250.8,0,0 +-3,249.9,0,0 +-3,249,0,0 +-3,248.1,0,0 +-3,247.2,0,0 +-3,246.3,0,0 +-3,245.4,0,0 +-3,244.5,0,0 +-3,243.6,0,0 +-3,242.7,0,0 +-3,241.8,0,0 +-3,240.9,0,0 +-3,240,0,0 +-3,239.1,0,0 +-3,238.2,0,0 +-3,237.3,0,0 +-3,236.4,0,0 +-3,235.5,0,0 +-3,234.6,0,0 +-3,233.7,0,0 +-3,232.8,0,0 +-3,231.9,0,0 +-3,231,0,0 +-3,230.1,0,0 +-3,229.2,0,0 +-3,228.3,0,0 +-3,227.4,0,0 +-3,226.5,0,0 +-3,225.6,0,0 +-3,224.7,0,0 +-3,223.8,0,0 +-3,222.9,0,0 +-3,222,0,0 +-3,221.1,0,0 +-3,220.2,0,0 +-3,219.2,0,0 +-3,218.3,0,0 +-3,217.4,0,0 +-3,216.5,0,0 +-3,215.6,0,0 +-3,214.7,0,0 +-3,213.8,0,0 +-3,212.9,0,0 +-3,212,0,0 +-3,211.1,0,0 +-3,210.2,0,0 +-3,209.3,0,0 +-3,208.4,0,0 +-3,207.5,0,0 +-3,206.6,0,0 +-3,205.7,0,0 +-3,204.8,0,0 +-3,203.9,0,0 +-3,203,0,0 +-3,202.1,0,0 +-3,201.2,0,0 +-3,200.3,0,0 +-3,199.4,0,0 +-3,198.5,0,0 +-3,197.6,0,0 +-3,196.7,0,0 +-3,195.8,0,0 +-3,194.9,0,0 +-3,194,0,0 +-3,193.1,0,0 +-3,192.2,0,0 +-3,191.3,0,0 +-3,190.4,0,0 +-3,189.5,0,0 +-3,188.6,0,0 +-3,187.7,0,0 +-3,186.8,0,0 +-3,185.9,0,0 +-3,185,0,0 +-3,184.1,0,0 +-3,183.2,0,0 +-3,182.3,0,0 +-3,181.4,0,0 +-3,180.5,0,0 +-3,179.5,-90,0 +-3,178.6,-89.5,0 +-3,177.7,-89.1,0 +-3,176.8,-88.6,0 +-3,175.9,-88.2,0 +-3,175,-87.7,0 +-3,174.1,-87.3,0 +-3,173.2,-86.8,0 +-3,172.3,-86.4,0 +-3,171.4,-85.9,0 +-3,170.5,-85.5,0 +-3,169.6,-85,0 +-3,168.7,-84.6,0 +-3,167.8,-84.1,0 +-3,166.9,-83.7,0 +-3,166,-83.2,0 +-3,165.1,-82.8,0 +-3,164.2,-82.3,0 +-3,163.3,-81.9,0 +-3,162.4,-81.4,0 +-3,161.5,-81,0 +-3,160.6,-80.5,0 +-3,159.7,-80.1,0 +-3,158.8,-79.6,0 +-3,157.9,-79.1,0 +-3,157,-78.7,0 +-3,156.1,-78.2,0 +-3,155.2,-77.8,0 +-3,154.3,-77.3,0 +-3,153.4,-76.9,0 +-3,152.5,-76.4,0 +-3,151.6,-76,0 +-3,150.7,-75.5,0 +-3,149.8,-75.1,0 +-3,148.9,-74.6,0 +-3,148,-74.2,0 +-3,147.1,-73.7,0 +-3,146.2,-73.3,0 +-3,145.3,-72.8,0 +-3,144.4,-72.4,0 +-3,143.5,-71.9,0 +-3,142.6,-71.5,0 +-3,141.7,-71,0 +-3,140.8,-70.6,0 +-3,139.8,-70.1,0 +-3,138.9,-69.6,0 +-3,138,-69.2,0 +-3,137.1,-68.7,0 +-3,136.2,-68.3,0 +-3,135.3,-67.8,0 +-3,134.4,-67.4,0 +-3,133.5,-66.9,0 +-3,132.6,-66.5,0 +-3,131.7,-66,0 +-3,130.8,-65.6,0 +-3,129.9,-65.1,0 +-3,129,-64.7,0 +-3,128.1,-64.2,0 +-3,127.2,-63.8,0 +-3,126.3,-63.3,0 +-3,125.4,-62.9,0 +-3,124.5,-62.4,0 +-3,123.6,-62,0 +-3,122.7,-61.5,0 +-3,121.8,-61.1,0 +-3,120.9,-60.6,0 +-3,120,-60.2,0 +-3,119.1,-59.7,0 +-3,118.2,-59.2,0 +-3,117.3,-58.8,0 +-3,116.4,-58.3,0 +-3,115.5,-57.9,0 +-3,114.6,-57.4,0 +-3,113.7,-57,0 +-3,112.8,-56.5,0 +-3,111.9,-56.1,0 +-3,111,-55.6,0 +-3,110.1,-55.2,0 +-3,109.2,-54.7,0 +-3,108.3,-54.3,0 +-3,107.4,-53.8,0 +-3,106.5,-53.4,0 +-3,105.6,-52.9,0 +-3,104.7,-52.5,0 +-3,103.8,-52,0 +-3,102.9,-51.6,0 +-3,102,-51.1,0 +-3,101.1,-50.7,0 +-3,100.2,-50.2,0 +-3,99.2,-49.7,0 +-3,98.3,-49.3,0 +-3,97.4,-48.8,0 +-3,96.5,-48.4,0 +-3,95.6,-47.9,0 +-3,94.7,-47.5,0 +-3,93.8,-47,0 +-3,92.9,-46.6,0 +-3,92,-46.1,0 +-3,91.1,-45.7,0 +-3,90.2,-45.2,0 +-3,89.3,-44.8,90 +-3,88.4,-44.3,89.1 +-3,87.5,-43.9,88.2 +-3,86.6,-43.4,87.3 +-3,85.7,-43,86.4 +-3,84.8,-42.5,85.5 +-3,83.9,-42.1,84.5 +-3,83,-41.6,83.6 +-3,82.1,-41.2,82.7 +-3,81.2,-40.7,81.8 +-3,80.3,-40.3,80.9 +-3,79.4,-39.8,80 +-3,78.5,-39.3,79.1 +-3,77.6,-38.9,78.2 +-3,76.7,-38.4,77.3 +-3,75.8,-38,76.4 +-3,74.9,-37.5,75.5 +-3,74,-37.1,74.5 +-3,73.1,-36.6,73.6 +-3,72.2,-36.2,72.7 +-3,71.3,-35.7,71.8 +-3,70.4,-35.3,70.9 +-3,69.5,-34.8,70 +-3,68.6,-34.4,69.1 +-3,67.7,-33.9,68.2 +-3,66.8,-33.5,67.3 +-3,65.9,-33,66.4 +-3,65,-32.6,65.5 +-3,64.1,-32.1,64.5 +-3,63.2,-31.7,63.6 +-3,62.3,-31.2,62.7 +-3,61.4,-30.8,61.8 +-3,60.5,-30.3,60.9 +-3,59.5,-29.8,60 +-3,58.6,-29.4,59.1 +-3,57.7,-28.9,58.2 +-3,56.8,-28.5,57.3 +-3,55.9,-28,56.4 +-3,55,-27.6,55.5 +-3,54.1,-27.1,54.5 +-3,53.2,-26.7,53.6 +-3,52.3,-26.2,52.7 +-3,51.4,-25.8,51.8 +-3,50.5,-25.3,50.9 +-3,49.6,-24.9,50 +-3,48.7,-24.4,49.1 +-3,47.8,-24,48.2 +-3,46.9,-23.5,47.3 +-3,46,-23.1,46.4 +-3,45.1,-22.6,45.5 +-3,44.2,-22.2,44.5 +-3,43.3,-21.7,43.6 +-3,42.4,-21.3,42.7 +-3,41.5,-20.8,41.8 +-3,40.6,-20.4,40.9 +-3,39.7,-19.9,40 +-3,38.8,-19.4,39.1 +-3,37.9,-19,38.2 +-3,37,-18.5,37.3 +-3,36.1,-18.1,36.4 +-3,35.2,-17.6,35.5 +-3,34.3,-17.2,34.5 +-3,33.4,-16.7,33.6 +-3,32.5,-16.3,32.7 +-3,31.6,-15.8,31.8 +-3,30.7,-15.4,30.9 +-3,29.8,-14.9,30 +-3,28.9,-14.5,29.1 +-3,28,-14,28.2 +-3,27.1,-13.6,27.3 +-3,26.2,-13.1,26.4 +-3,25.3,-12.7,25.5 +-3,24.4,-12.2,24.5 +-3,23.5,-11.8,23.6 +-3,22.6,-11.3,22.7 +-3,21.7,-10.9,21.8 +-3,20.8,-10.4,20.9 +-3,19.8,-9.9,20 +-3,18.9,-9.5,19.1 +-3,18,-9,18.2 +-3,17.1,-8.6,17.3 +-3,16.2,-8.1,16.4 +-3,15.3,-7.7,15.5 +-3,14.4,-7.2,14.5 +-3,13.5,-6.8,13.6 +-3,12.6,-6.3,12.7 +-3,11.7,-5.9,11.8 +-3,10.8,-5.4,10.9 +-3,9.9,-5,10 +-3,9,-4.5,9.1 +-3,8.1,-4.1,8.2 +-3,7.2,-3.6,7.3 +-3,6.3,-3.2,6.4 +-3,5.4,-2.7,5.5 +-3,4.5,-2.3,4.5 +-3,3.6,-1.8,3.6 +-3,2.7,-1.4,2.7 +-3,1.8,-0.9,1.8 +-3,0.9,-0.5,0.9 +-3,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +0.9,0,0,0.3 +0.9,0,0,0.3 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.8,0,0,0.5 +0.8,0,0,0.5 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.5,0,0,0.8 +0.5,0,0,0.8 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.3,0,0,0.9 +0.3,0,0,0.9 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,0.9 +0.3,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.8 +0.5,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.7,0,0,0.8 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.8,0,0,0.7 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.5 +0.8,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.3 +0.9,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0 +-3,0,0,0 +-3,0.9,-0.5,0.9 +-3,1.8,-0.9,1.8 +-3,2.7,-1.4,2.7 +-3,3.6,-1.8,3.6 +-3,4.5,-2.3,4.5 +-3,5.4,-2.7,5.5 +-3,6.3,-3.2,6.4 +-3,7.2,-3.6,7.3 +-3,8.1,-4.1,8.2 +-3,9,-4.5,9.1 +-3,9.9,-5,10 +-3,10.8,-5.4,10.9 +-3,11.7,-5.9,11.8 +-3,12.6,-6.3,12.7 +-3,13.5,-6.8,13.6 +-3,14.4,-7.2,14.5 +-3,15.3,-7.7,15.5 +-3,16.2,-8.1,16.4 +-3,17.1,-8.6,17.3 +-3,18,-9,18.2 +-3,18.9,-9.5,19.1 +-3,19.8,-9.9,20 +-3,20.8,-10.4,20.9 +-3,21.7,-10.9,21.8 +-3,22.6,-11.3,22.7 +-3,23.5,-11.8,23.6 +-3,24.4,-12.2,24.5 +-3,25.3,-12.7,25.5 +-3,26.2,-13.1,26.4 +-3,27.1,-13.6,27.3 +-3,28,-14,28.2 +-3,28.9,-14.5,29.1 +-3,29.8,-14.9,30 +-3,30.7,-15.4,30.9 +-3,31.6,-15.8,31.8 +-3,32.5,-16.3,32.7 +-3,33.4,-16.7,33.6 +-3,34.3,-17.2,34.5 +-3,35.2,-17.6,35.5 +-3,36.1,-18.1,36.4 +-3,37,-18.5,37.3 +-3,37.9,-19,38.2 +-3,38.8,-19.4,39.1 +-3,39.7,-19.9,40 +-3,40.6,-20.4,40.9 +-3,41.5,-20.8,41.8 +-3,42.4,-21.3,42.7 +-3,43.3,-21.7,43.6 +-3,44.2,-22.2,44.5 +-3,45.1,-22.6,45.5 +-3,46,-23.1,46.4 +-3,46.9,-23.5,47.3 +-3,47.8,-24,48.2 +-3,48.7,-24.4,49.1 +-3,49.6,-24.9,50 +-3,50.5,-25.3,50.9 +-3,51.4,-25.8,51.8 +-3,52.3,-26.2,52.7 +-3,53.2,-26.7,53.6 +-3,54.1,-27.1,54.5 +-3,55,-27.6,55.5 +-3,55.9,-28,56.4 +-3,56.8,-28.5,57.3 +-3,57.7,-28.9,58.2 +-3,58.6,-29.4,59.1 +-3,59.5,-29.8,60 +-3,60.5,-30.3,60.9 +-3,61.4,-30.8,61.8 +-3,62.3,-31.2,62.7 +-3,63.2,-31.7,63.6 +-3,64.1,-32.1,64.5 +-3,65,-32.6,65.5 +-3,65.9,-33,66.4 +-3,66.8,-33.5,67.3 +-3,67.7,-33.9,68.2 +-3,68.6,-34.4,69.1 +-3,69.5,-34.8,70 +-3,70.4,-35.3,70.9 +-3,71.3,-35.7,71.8 +-3,72.2,-36.2,72.7 +-3,73.1,-36.6,73.6 +-3,74,-37.1,74.5 +-3,74.9,-37.5,75.5 +-3,75.8,-38,76.4 +-3,76.7,-38.4,77.3 +-3,77.6,-38.9,78.2 +-3,78.5,-39.3,79.1 +-3,79.4,-39.8,80 +-3,80.3,-40.3,80.9 +-3,81.2,-40.7,81.8 +-3,82.1,-41.2,82.7 +-3,83,-41.6,83.6 +-3,83.9,-42.1,84.5 +-3,84.8,-42.5,85.5 +-3,85.7,-43,86.4 +-3,86.6,-43.4,87.3 +-3,87.5,-43.9,88.2 +-3,88.4,-44.3,89.1 +-3,89.3,-44.8,90 +-3,90.2,-45.2,0 +-3,91.1,-45.7,0 +-3,92,-46.1,0 +-3,92.9,-46.6,0 +-3,93.8,-47,0 +-3,94.7,-47.5,0 +-3,95.6,-47.9,0 +-3,96.5,-48.4,0 +-3,97.4,-48.8,0 +-3,98.3,-49.3,0 +-3,99.2,-49.7,0 +-3,100.2,-50.2,0 +-3,101.1,-50.7,0 +-3,102,-51.1,0 +-3,102.9,-51.6,0 +-3,103.8,-52,0 +-3,104.7,-52.5,0 +-3,105.6,-52.9,0 +-3,106.5,-53.4,0 +-3,107.4,-53.8,0 +-3,108.3,-54.3,0 +-3,109.2,-54.7,0 +-3,110.1,-55.2,0 +-3,111,-55.6,0 +-3,111.9,-56.1,0 +-3,112.8,-56.5,0 +-3,113.7,-57,0 +-3,114.6,-57.4,0 +-3,115.5,-57.9,0 +-3,116.4,-58.3,0 +-3,117.3,-58.8,0 +-3,118.2,-59.2,0 +-3,119.1,-59.7,0 +-3,120,-60.2,0 +-3,120.9,-60.6,0 +-3,121.8,-61.1,0 +-3,122.7,-61.5,0 +-3,123.6,-62,0 +-3,124.5,-62.4,0 +-3,125.4,-62.9,0 +-3,126.3,-63.3,0 +-3,127.2,-63.8,0 +-3,128.1,-64.2,0 +-3,129,-64.7,0 +-3,129.9,-65.1,0 +-3,130.8,-65.6,0 +-3,131.7,-66,0 +-3,132.6,-66.5,0 +-3,133.5,-66.9,0 +-3,134.4,-67.4,0 +-3,135.3,-67.8,0 +-3,136.2,-68.3,0 +-3,137.1,-68.7,0 +-3,138,-69.2,0 +-3,138.9,-69.6,0 +-3,139.8,-70.1,0 +-3,140.8,-70.6,0 +-3,141.7,-71,0 +-3,142.6,-71.5,0 +-3,143.5,-71.9,0 +-3,144.4,-72.4,0 +-3,145.3,-72.8,0 +-3,146.2,-73.3,0 +-3,147.1,-73.7,0 +-3,148,-74.2,0 +-3,148.9,-74.6,0 +-3,149.8,-75.1,0 +-3,150.7,-75.5,0 +-3,151.6,-76,0 +-3,152.5,-76.4,0 +-3,153.4,-76.9,0 +-3,154.3,-77.3,0 +-3,155.2,-77.8,0 +-3,156.1,-78.2,0 +-3,157,-78.7,0 +-3,157.9,-79.1,0 +-3,158.8,-79.6,0 +-3,159.7,-80.1,0 +-3,160.6,-80.5,0 +-3,161.5,-81,0 +-3,162.4,-81.4,0 +-3,163.3,-81.9,0 +-3,164.2,-82.3,0 +-3,165.1,-82.8,0 +-3,166,-83.2,0 +-3,166.9,-83.7,0 +-3,167.8,-84.1,0 +-3,168.7,-84.6,0 +-3,169.6,-85,0 +-3,170.5,-85.5,0 +-3,171.4,-85.9,0 +-3,172.3,-86.4,0 +-3,173.2,-86.8,0 +-3,174.1,-87.3,0 +-3,175,-87.7,0 +-3,175.9,-88.2,0 +-3,176.8,-88.6,0 +-3,177.7,-89.1,0 +-3,178.6,-89.5,0 +-3,179.5,-90,0 +-3,180.5,0,0 +-3,181.4,0,0 +-3,182.3,0,0 +-3,183.2,0,0 +-3,184.1,0,0 +-3,185,0,0 +-3,185.9,0,0 +-3,186.8,0,0 +-3,187.7,0,0 +-3,188.6,0,0 +-3,189.5,0,0 +-3,190.4,0,0 +-3,191.3,0,0 +-3,192.2,0,0 +-3,193.1,0,0 +-3,194,0,0 +-3,194.9,0,0 +-3,195.8,0,0 +-3,196.7,0,0 +-3,197.6,0,0 +-3,198.5,0,0 +-3,199.4,0,0 +-3,200.3,0,0 +-3,201.2,0,0 +-3,202.1,0,0 +-3,203,0,0 +-3,203.9,0,0 +-3,204.8,0,0 +-3,205.7,0,0 +-3,206.6,0,0 +-3,207.5,0,0 +-3,208.4,0,0 +-3,209.3,0,0 +-3,210.2,0,0 +-3,211.1,0,0 +-3,212,0,0 +-3,212.9,0,0 +-3,213.8,0,0 +-3,214.7,0,0 +-3,215.6,0,0 +-3,216.5,0,0 +-3,217.4,0,0 +-3,218.3,0,0 +-3,219.2,0,0 +-3,220.2,0,0 +-3,221.1,0,0 +-3,222,0,0 +-3,222.9,0,0 +-3,223.8,0,0 +-3,224.7,0,0 +-3,225.6,0,0 +-3,226.5,0,0 +-3,227.4,0,0 +-3,228.3,0,0 +-3,229.2,0,0 +-3,230.1,0,0 +-3,231,0,0 +-3,231.9,0,0 +-3,232.8,0,0 +-3,233.7,0,0 +-3,234.6,0,0 +-3,235.5,0,0 +-3,236.4,0,0 +-3,237.3,0,0 +-3,238.2,0,0 +-3,239.1,0,0 +-3,240,0,0 +-3,240.9,0,0 +-3,241.8,0,0 +-3,242.7,0,0 +-3,243.6,0,0 +-3,244.5,0,0 +-3,245.4,0,0 +-3,246.3,0,0 +-3,247.2,0,0 +-3,248.1,0,0 +-3,249,0,0 +-3,249.9,0,0 +-3,250.8,0,0 +-3,251.7,0,0 +-3,252.6,0,0 +-3,253.5,0,0 +-3,254.4,0,0 +-3,255.3,0,0 +-3,256.2,0,0 +-3,257.1,0,0 +-3,258,0,0 +-3,258.9,0,0 +-3,259.8,0,0 +-3,260.8,0,0 +-3,261.7,0,0 +-3,262.6,0,0 +-3,263.5,0,0 +-3,264.4,0,0 +-3,265.3,0,0 +-3,266.2,0,0 +-3,267.1,0,0 +-3,268,0,0 +-3,268.9,0,0 +-3,269.8,0,0 +-3,270.7,0,0 +-3,271.6,0,0 +-3,272.5,0,0 +-3,273.4,0,0 +-3,274.3,0,0 +-3,275.2,0,0 +-3,276.1,0,0 +-3,277,0,0 +-3,277.9,0,0 +-3,278.8,0,0 +-3,279.7,0,0 +-3,280.6,0,0 +-3,281.5,0,0 +-3,282.4,0,0 +-3,283.3,0,0 +-3,284.2,0,0 +-3,285.1,0,0 +-3,286,0,0 +-3,286.9,0,0 +-3,287.8,0,0 +-3,288.7,0,0 +-3,289.6,0,0 +-3,290.5,0,0 +-3,291.4,0,0 +-3,292.3,0,0 +-3,293.2,0,0 +-3,294.1,0,0 +-3,295,0,0 +-3,295.9,0,0 +-3,296.8,0,0 +-3,297.7,0,0 +-3,298.6,0,0 +-3,299.5,0,0 +-3,300.5,0,0 +-3,301.4,0,0 +-3,302.3,0,0 +-3,303.2,0,0 +-3,304.1,0,0 +-3,305,0,0 +-3,305.9,0,0 +-3,306.8,0,0 +-3,307.7,0,0 +-3,308.6,0,0 +-3,309.5,0,0 +-3,310.4,0,0 +-3,311.3,0,0 +-3,312.2,0,0 +-3,313.1,0,0 +-3,314,0,0 +-3,314.9,0,0 +-3,315.8,0,0 +-3,316.7,0,0 +-3,317.6,0,0 +-3,318.5,0,0 +-3,319.4,0,0 +-3,320.3,0,0 +-3,321.2,0,0 +-3,322.1,0,0 +-3,323,0,0 +-3,323.9,0,0 +-3,324.8,0,0 +-3,325.7,0,0 +-3,326.6,0,0 +-3,327.5,0,0 +-3,328.4,0,0 +-3,329.3,0,0 +-3,330.2,0,0 +-3,331.1,0,0 +-3,332,0,0 +-3,332.9,0,0 +-3,333.8,0,0 +-3,334.7,0,0 +-3,335.6,0,0 +-3,336.5,0,0 +-3,337.4,0,0 +-3,338.3,0,0 +-3,339.2,0,0 +-3,340.2,0,0 +-3,341.1,0,0 +-3,342,0,0 +-3,342.9,0,0 +-3,343.8,0,0 +-3,344.7,0,0 +-3,345.6,0,0 +-3,346.5,0,0 +-3,347.4,0,0 +-3,348.3,0,0 +-3,349.2,0,0 +-3,350.1,0,0 +-3,351,0,0 +-3,351.9,0,0 +-3,352.8,0,0 +-3,353.7,0,0 +-3,354.6,0,0 +-3,355.5,0,0 +-3,356.4,0,0 +-3,357.3,0,0 +-3,358.2,0,0 +-3,359.1,0,0 +-3,360,0,0 +-3,360,0,0 +-3,359.1,0,0 +-3,358.2,0,0 +-3,357.3,0,0 +-3,356.4,0,0 +-3,355.5,0,0 +-3,354.6,0,0 +-3,353.7,0,0 +-3,352.8,0,0 +-3,351.9,0,0 +-3,351,0,0 +-3,350.1,0,0 +-3,349.2,0,0 +-3,348.3,0,0 +-3,347.4,0,0 +-3,346.5,0,0 +-3,345.6,0,0 +-3,344.7,0,0 +-3,343.8,0,0 +-3,342.9,0,0 +-3,342,0,0 +-3,341.1,0,0 +-3,340.2,0,0 +-3,339.2,0,0 +-3,338.3,0,0 +-3,337.4,0,0 +-3,336.5,0,0 +-3,335.6,0,0 +-3,334.7,0,0 +-3,333.8,0,0 +-3,332.9,0,0 +-3,332,0,0 +-3,331.1,0,0 +-3,330.2,0,0 +-3,329.3,0,0 +-3,328.4,0,0 +-3,327.5,0,0 +-3,326.6,0,0 +-3,325.7,0,0 +-3,324.8,0,0 +-3,323.9,0,0 +-3,323,0,0 +-3,322.1,0,0 +-3,321.2,0,0 +-3,320.3,0,0 +-3,319.4,0,0 +-3,318.5,0,0 +-3,317.6,0,0 +-3,316.7,0,0 +-3,315.8,0,0 +-3,314.9,0,0 +-3,314,0,0 +-3,313.1,0,0 +-3,312.2,0,0 +-3,311.3,0,0 +-3,310.4,0,0 +-3,309.5,0,0 +-3,308.6,0,0 +-3,307.7,0,0 +-3,306.8,0,0 +-3,305.9,0,0 +-3,305,0,0 +-3,304.1,0,0 +-3,303.2,0,0 +-3,302.3,0,0 +-3,301.4,0,0 +-3,300.5,0,0 +-3,299.5,0,0 +-3,298.6,0,0 +-3,297.7,0,0 +-3,296.8,0,0 +-3,295.9,0,0 +-3,295,0,0 +-3,294.1,0,0 +-3,293.2,0,0 +-3,292.3,0,0 +-3,291.4,0,0 +-3,290.5,0,0 +-3,289.6,0,0 +-3,288.7,0,0 +-3,287.8,0,0 +-3,286.9,0,0 +-3,286,0,0 +-3,285.1,0,0 +-3,284.2,0,0 +-3,283.3,0,0 +-3,282.4,0,0 +-3,281.5,0,0 +-3,280.6,0,0 +-3,279.7,0,0 +-3,278.8,0,0 +-3,277.9,0,0 +-3,277,0,0 +-3,276.1,0,0 +-3,275.2,0,0 +-3,274.3,0,0 +-3,273.4,0,0 +-3,272.5,0,0 +-3,271.6,0,0 +-3,270.7,0,0 +-3,269.8,0,0 +-3,268.9,0,0 +-3,268,0,0 +-3,267.1,0,0 +-3,266.2,0,0 +-3,265.3,0,0 +-3,264.4,0,0 +-3,263.5,0,0 +-3,262.6,0,0 +-3,261.7,0,0 +-3,260.8,0,0 +-3,259.8,0,0 +-3,258.9,0,0 +-3,258,0,0 +-3,257.1,0,0 +-3,256.2,0,0 +-3,255.3,0,0 +-3,254.4,0,0 +-3,253.5,0,0 +-3,252.6,0,0 +-3,251.7,0,0 +-3,250.8,0,0 +-3,249.9,0,0 +-3,249,0,0 +-3,248.1,0,0 +-3,247.2,0,0 +-3,246.3,0,0 +-3,245.4,0,0 +-3,244.5,0,0 +-3,243.6,0,0 +-3,242.7,0,0 +-3,241.8,0,0 +-3,240.9,0,0 +-3,240,0,0 +-3,239.1,0,0 +-3,238.2,0,0 +-3,237.3,0,0 +-3,236.4,0,0 +-3,235.5,0,0 +-3,234.6,0,0 +-3,233.7,0,0 +-3,232.8,0,0 +-3,231.9,0,0 +-3,231,0,0 +-3,230.1,0,0 +-3,229.2,0,0 +-3,228.3,0,0 +-3,227.4,0,0 +-3,226.5,0,0 +-3,225.6,0,0 +-3,224.7,0,0 +-3,223.8,0,0 +-3,222.9,0,0 +-3,222,0,0 +-3,221.1,0,0 +-3,220.2,0,0 +-3,219.2,0,0 +-3,218.3,0,0 +-3,217.4,0,0 +-3,216.5,0,0 +-3,215.6,0,0 +-3,214.7,0,0 +-3,213.8,0,0 +-3,212.9,0,0 +-3,212,0,0 +-3,211.1,0,0 +-3,210.2,0,0 +-3,209.3,0,0 +-3,208.4,0,0 +-3,207.5,0,0 +-3,206.6,0,0 +-3,205.7,0,0 +-3,204.8,0,0 +-3,203.9,0,0 +-3,203,0,0 +-3,202.1,0,0 +-3,201.2,0,0 +-3,200.3,0,0 +-3,199.4,0,0 +-3,198.5,0,0 +-3,197.6,0,0 +-3,196.7,0,0 +-3,195.8,0,0 +-3,194.9,0,0 +-3,194,0,0 +-3,193.1,0,0 +-3,192.2,0,0 +-3,191.3,0,0 +-3,190.4,0,0 +-3,189.5,0,0 +-3,188.6,0,0 +-3,187.7,0,0 +-3,186.8,0,0 +-3,185.9,0,0 +-3,185,0,0 +-3,184.1,0,0 +-3,183.2,0,0 +-3,182.3,0,0 +-3,181.4,0,0 +-3,180.5,0,0 +-3,179.5,-90,0 +-3,178.6,-89.5,0 +-3,177.7,-89.1,0 +-3,176.8,-88.6,0 +-3,175.9,-88.2,0 +-3,175,-87.7,0 +-3,174.1,-87.3,0 +-3,173.2,-86.8,0 +-3,172.3,-86.4,0 +-3,171.4,-85.9,0 +-3,170.5,-85.5,0 +-3,169.6,-85,0 +-3,168.7,-84.6,0 +-3,167.8,-84.1,0 +-3,166.9,-83.7,0 +-3,166,-83.2,0 +-3,165.1,-82.8,0 +-3,164.2,-82.3,0 +-3,163.3,-81.9,0 +-3,162.4,-81.4,0 +-3,161.5,-81,0 +-3,160.6,-80.5,0 +-3,159.7,-80.1,0 +-3,158.8,-79.6,0 +-3,157.9,-79.1,0 +-3,157,-78.7,0 +-3,156.1,-78.2,0 +-3,155.2,-77.8,0 +-3,154.3,-77.3,0 +-3,153.4,-76.9,0 +-3,152.5,-76.4,0 +-3,151.6,-76,0 +-3,150.7,-75.5,0 +-3,149.8,-75.1,0 +-3,148.9,-74.6,0 +-3,148,-74.2,0 +-3,147.1,-73.7,0 +-3,146.2,-73.3,0 +-3,145.3,-72.8,0 +-3,144.4,-72.4,0 +-3,143.5,-71.9,0 +-3,142.6,-71.5,0 +-3,141.7,-71,0 +-3,140.8,-70.6,0 +-3,139.8,-70.1,0 +-3,138.9,-69.6,0 +-3,138,-69.2,0 +-3,137.1,-68.7,0 +-3,136.2,-68.3,0 +-3,135.3,-67.8,0 +-3,134.4,-67.4,0 +-3,133.5,-66.9,0 +-3,132.6,-66.5,0 +-3,131.7,-66,0 +-3,130.8,-65.6,0 +-3,129.9,-65.1,0 +-3,129,-64.7,0 +-3,128.1,-64.2,0 +-3,127.2,-63.8,0 +-3,126.3,-63.3,0 +-3,125.4,-62.9,0 +-3,124.5,-62.4,0 +-3,123.6,-62,0 +-3,122.7,-61.5,0 +-3,121.8,-61.1,0 +-3,120.9,-60.6,0 +-3,120,-60.2,0 +-3,119.1,-59.7,0 +-3,118.2,-59.2,0 +-3,117.3,-58.8,0 +-3,116.4,-58.3,0 +-3,115.5,-57.9,0 +-3,114.6,-57.4,0 +-3,113.7,-57,0 +-3,112.8,-56.5,0 +-3,111.9,-56.1,0 +-3,111,-55.6,0 +-3,110.1,-55.2,0 +-3,109.2,-54.7,0 +-3,108.3,-54.3,0 +-3,107.4,-53.8,0 +-3,106.5,-53.4,0 +-3,105.6,-52.9,0 +-3,104.7,-52.5,0 +-3,103.8,-52,0 +-3,102.9,-51.6,0 +-3,102,-51.1,0 +-3,101.1,-50.7,0 +-3,100.2,-50.2,0 +-3,99.2,-49.7,0 +-3,98.3,-49.3,0 +-3,97.4,-48.8,0 +-3,96.5,-48.4,0 +-3,95.6,-47.9,0 +-3,94.7,-47.5,0 +-3,93.8,-47,0 +-3,92.9,-46.6,0 +-3,92,-46.1,0 +-3,91.1,-45.7,0 +-3,90.2,-45.2,0 +-3,89.3,-44.8,90 +-3,88.4,-44.3,89.1 +-3,87.5,-43.9,88.2 +-3,86.6,-43.4,87.3 +-3,85.7,-43,86.4 +-3,84.8,-42.5,85.5 +-3,83.9,-42.1,84.5 +-3,83,-41.6,83.6 +-3,82.1,-41.2,82.7 +-3,81.2,-40.7,81.8 +-3,80.3,-40.3,80.9 +-3,79.4,-39.8,80 +-3,78.5,-39.3,79.1 +-3,77.6,-38.9,78.2 +-3,76.7,-38.4,77.3 +-3,75.8,-38,76.4 +-3,74.9,-37.5,75.5 +-3,74,-37.1,74.5 +-3,73.1,-36.6,73.6 +-3,72.2,-36.2,72.7 +-3,71.3,-35.7,71.8 +-3,70.4,-35.3,70.9 +-3,69.5,-34.8,70 +-3,68.6,-34.4,69.1 +-3,67.7,-33.9,68.2 +-3,66.8,-33.5,67.3 +-3,65.9,-33,66.4 +-3,65,-32.6,65.5 +-3,64.1,-32.1,64.5 +-3,63.2,-31.7,63.6 +-3,62.3,-31.2,62.7 +-3,61.4,-30.8,61.8 +-3,60.5,-30.3,60.9 +-3,59.5,-29.8,60 +-3,58.6,-29.4,59.1 +-3,57.7,-28.9,58.2 +-3,56.8,-28.5,57.3 +-3,55.9,-28,56.4 +-3,55,-27.6,55.5 +-3,54.1,-27.1,54.5 +-3,53.2,-26.7,53.6 +-3,52.3,-26.2,52.7 +-3,51.4,-25.8,51.8 +-3,50.5,-25.3,50.9 +-3,49.6,-24.9,50 +-3,48.7,-24.4,49.1 +-3,47.8,-24,48.2 +-3,46.9,-23.5,47.3 +-3,46,-23.1,46.4 +-3,45.1,-22.6,45.5 +-3,44.2,-22.2,44.5 +-3,43.3,-21.7,43.6 +-3,42.4,-21.3,42.7 +-3,41.5,-20.8,41.8 +-3,40.6,-20.4,40.9 +-3,39.7,-19.9,40 +-3,38.8,-19.4,39.1 +-3,37.9,-19,38.2 +-3,37,-18.5,37.3 +-3,36.1,-18.1,36.4 +-3,35.2,-17.6,35.5 +-3,34.3,-17.2,34.5 +-3,33.4,-16.7,33.6 +-3,32.5,-16.3,32.7 +-3,31.6,-15.8,31.8 +-3,30.7,-15.4,30.9 +-3,29.8,-14.9,30 +-3,28.9,-14.5,29.1 +-3,28,-14,28.2 +-3,27.1,-13.6,27.3 +-3,26.2,-13.1,26.4 +-3,25.3,-12.7,25.5 +-3,24.4,-12.2,24.5 +-3,23.5,-11.8,23.6 +-3,22.6,-11.3,22.7 +-3,21.7,-10.9,21.8 +-3,20.8,-10.4,20.9 +-3,19.8,-9.9,20 +-3,18.9,-9.5,19.1 +-3,18,-9,18.2 +-3,17.1,-8.6,17.3 +-3,16.2,-8.1,16.4 +-3,15.3,-7.7,15.5 +-3,14.4,-7.2,14.5 +-3,13.5,-6.8,13.6 +-3,12.6,-6.3,12.7 +-3,11.7,-5.9,11.8 +-3,10.8,-5.4,10.9 +-3,9.9,-5,10 +-3,9,-4.5,9.1 +-3,8.1,-4.1,8.2 +-3,7.2,-3.6,7.3 +-3,6.3,-3.2,6.4 +-3,5.4,-2.7,5.5 +-3,4.5,-2.3,4.5 +-3,3.6,-1.8,3.6 +-3,2.7,-1.4,2.7 +-3,1.8,-0.9,1.8 +-3,0.9,-0.5,0.9 +-3,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +0.9,0,0,0.3 +0.9,0,0,0.3 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.8,0,0,0.5 +0.8,0,0,0.5 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.5,0,0,0.8 +0.5,0,0,0.8 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.3,0,0,0.9 +0.3,0,0,0.9 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,0.9 +0.3,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.8 +0.5,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.7,0,0,0.8 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.8,0,0,0.7 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.5 +0.8,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.3 +0.9,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0 +-3,0,0,0 +-3,0.9,-0.5,0.9 +-3,1.8,-0.9,1.8 +-3,2.7,-1.4,2.7 +-3,3.6,-1.8,3.6 +-3,4.5,-2.3,4.5 +-3,5.4,-2.7,5.5 +-3,6.3,-3.2,6.4 +-3,7.2,-3.6,7.3 +-3,8.1,-4.1,8.2 +-3,9,-4.5,9.1 +-3,9.9,-5,10 +-3,10.8,-5.4,10.9 +-3,11.7,-5.9,11.8 +-3,12.6,-6.3,12.7 +-3,13.5,-6.8,13.6 +-3,14.4,-7.2,14.5 +-3,15.3,-7.7,15.5 +-3,16.2,-8.1,16.4 +-3,17.1,-8.6,17.3 +-3,18,-9,18.2 +-3,18.9,-9.5,19.1 +-3,19.8,-9.9,20 +-3,20.8,-10.4,20.9 +-3,21.7,-10.9,21.8 +-3,22.6,-11.3,22.7 +-3,23.5,-11.8,23.6 +-3,24.4,-12.2,24.5 +-3,25.3,-12.7,25.5 +-3,26.2,-13.1,26.4 +-3,27.1,-13.6,27.3 +-3,28,-14,28.2 +-3,28.9,-14.5,29.1 +-3,29.8,-14.9,30 +-3,30.7,-15.4,30.9 +-3,31.6,-15.8,31.8 +-3,32.5,-16.3,32.7 +-3,33.4,-16.7,33.6 +-3,34.3,-17.2,34.5 +-3,35.2,-17.6,35.5 +-3,36.1,-18.1,36.4 +-3,37,-18.5,37.3 +-3,37.9,-19,38.2 +-3,38.8,-19.4,39.1 +-3,39.7,-19.9,40 +-3,40.6,-20.4,40.9 +-3,41.5,-20.8,41.8 +-3,42.4,-21.3,42.7 +-3,43.3,-21.7,43.6 +-3,44.2,-22.2,44.5 +-3,45.1,-22.6,45.5 +-3,46,-23.1,46.4 +-3,46.9,-23.5,47.3 +-3,47.8,-24,48.2 +-3,48.7,-24.4,49.1 +-3,49.6,-24.9,50 +-3,50.5,-25.3,50.9 +-3,51.4,-25.8,51.8 +-3,52.3,-26.2,52.7 +-3,53.2,-26.7,53.6 +-3,54.1,-27.1,54.5 +-3,55,-27.6,55.5 +-3,55.9,-28,56.4 +-3,56.8,-28.5,57.3 +-3,57.7,-28.9,58.2 +-3,58.6,-29.4,59.1 +-3,59.5,-29.8,60 +-3,60.5,-30.3,60.9 +-3,61.4,-30.8,61.8 +-3,62.3,-31.2,62.7 +-3,63.2,-31.7,63.6 +-3,64.1,-32.1,64.5 +-3,65,-32.6,65.5 +-3,65.9,-33,66.4 +-3,66.8,-33.5,67.3 +-3,67.7,-33.9,68.2 +-3,68.6,-34.4,69.1 +-3,69.5,-34.8,70 +-3,70.4,-35.3,70.9 +-3,71.3,-35.7,71.8 +-3,72.2,-36.2,72.7 +-3,73.1,-36.6,73.6 +-3,74,-37.1,74.5 +-3,74.9,-37.5,75.5 +-3,75.8,-38,76.4 +-3,76.7,-38.4,77.3 +-3,77.6,-38.9,78.2 +-3,78.5,-39.3,79.1 +-3,79.4,-39.8,80 +-3,80.3,-40.3,80.9 +-3,81.2,-40.7,81.8 +-3,82.1,-41.2,82.7 +-3,83,-41.6,83.6 +-3,83.9,-42.1,84.5 +-3,84.8,-42.5,85.5 +-3,85.7,-43,86.4 +-3,86.6,-43.4,87.3 +-3,87.5,-43.9,88.2 +-3,88.4,-44.3,89.1 +-3,89.3,-44.8,90 +-3,90.2,-45.2,0 +-3,91.1,-45.7,0 +-3,92,-46.1,0 +-3,92.9,-46.6,0 +-3,93.8,-47,0 +-3,94.7,-47.5,0 +-3,95.6,-47.9,0 +-3,96.5,-48.4,0 +-3,97.4,-48.8,0 +-3,98.3,-49.3,0 +-3,99.2,-49.7,0 +-3,100.2,-50.2,0 +-3,101.1,-50.7,0 +-3,102,-51.1,0 +-3,102.9,-51.6,0 +-3,103.8,-52,0 +-3,104.7,-52.5,0 +-3,105.6,-52.9,0 +-3,106.5,-53.4,0 +-3,107.4,-53.8,0 +-3,108.3,-54.3,0 +-3,109.2,-54.7,0 +-3,110.1,-55.2,0 +-3,111,-55.6,0 +-3,111.9,-56.1,0 +-3,112.8,-56.5,0 +-3,113.7,-57,0 +-3,114.6,-57.4,0 +-3,115.5,-57.9,0 +-3,116.4,-58.3,0 +-3,117.3,-58.8,0 +-3,118.2,-59.2,0 +-3,119.1,-59.7,0 +-3,120,-60.2,0 +-3,120.9,-60.6,0 +-3,121.8,-61.1,0 +-3,122.7,-61.5,0 +-3,123.6,-62,0 +-3,124.5,-62.4,0 +-3,125.4,-62.9,0 +-3,126.3,-63.3,0 +-3,127.2,-63.8,0 +-3,128.1,-64.2,0 +-3,129,-64.7,0 +-3,129.9,-65.1,0 +-3,130.8,-65.6,0 +-3,131.7,-66,0 +-3,132.6,-66.5,0 +-3,133.5,-66.9,0 +-3,134.4,-67.4,0 +-3,135.3,-67.8,0 +-3,136.2,-68.3,0 +-3,137.1,-68.7,0 +-3,138,-69.2,0 +-3,138.9,-69.6,0 +-3,139.8,-70.1,0 +-3,140.8,-70.6,0 +-3,141.7,-71,0 +-3,142.6,-71.5,0 +-3,143.5,-71.9,0 +-3,144.4,-72.4,0 +-3,145.3,-72.8,0 +-3,146.2,-73.3,0 +-3,147.1,-73.7,0 +-3,148,-74.2,0 +-3,148.9,-74.6,0 +-3,149.8,-75.1,0 +-3,150.7,-75.5,0 +-3,151.6,-76,0 +-3,152.5,-76.4,0 +-3,153.4,-76.9,0 +-3,154.3,-77.3,0 +-3,155.2,-77.8,0 +-3,156.1,-78.2,0 +-3,157,-78.7,0 +-3,157.9,-79.1,0 +-3,158.8,-79.6,0 +-3,159.7,-80.1,0 +-3,160.6,-80.5,0 +-3,161.5,-81,0 +-3,162.4,-81.4,0 +-3,163.3,-81.9,0 +-3,164.2,-82.3,0 +-3,165.1,-82.8,0 +-3,166,-83.2,0 +-3,166.9,-83.7,0 +-3,167.8,-84.1,0 +-3,168.7,-84.6,0 +-3,169.6,-85,0 +-3,170.5,-85.5,0 +-3,171.4,-85.9,0 +-3,172.3,-86.4,0 +-3,173.2,-86.8,0 +-3,174.1,-87.3,0 +-3,175,-87.7,0 +-3,175.9,-88.2,0 +-3,176.8,-88.6,0 +-3,177.7,-89.1,0 +-3,178.6,-89.5,0 +-3,179.5,-90,0 +-3,180.5,0,0 +-3,181.4,0,0 +-3,182.3,0,0 +-3,183.2,0,0 +-3,184.1,0,0 +-3,185,0,0 +-3,185.9,0,0 +-3,186.8,0,0 +-3,187.7,0,0 +-3,188.6,0,0 +-3,189.5,0,0 +-3,190.4,0,0 +-3,191.3,0,0 +-3,192.2,0,0 +-3,193.1,0,0 +-3,194,0,0 +-3,194.9,0,0 +-3,195.8,0,0 +-3,196.7,0,0 +-3,197.6,0,0 +-3,198.5,0,0 +-3,199.4,0,0 +-3,200.3,0,0 +-3,201.2,0,0 +-3,202.1,0,0 +-3,203,0,0 +-3,203.9,0,0 +-3,204.8,0,0 +-3,205.7,0,0 +-3,206.6,0,0 +-3,207.5,0,0 +-3,208.4,0,0 +-3,209.3,0,0 +-3,210.2,0,0 +-3,211.1,0,0 +-3,212,0,0 +-3,212.9,0,0 +-3,213.8,0,0 +-3,214.7,0,0 +-3,215.6,0,0 +-3,216.5,0,0 +-3,217.4,0,0 +-3,218.3,0,0 +-3,219.2,0,0 +-3,220.2,0,0 +-3,221.1,0,0 +-3,222,0,0 +-3,222.9,0,0 +-3,223.8,0,0 +-3,224.7,0,0 +-3,225.6,0,0 +-3,226.5,0,0 +-3,227.4,0,0 +-3,228.3,0,0 +-3,229.2,0,0 +-3,230.1,0,0 +-3,231,0,0 +-3,231.9,0,0 +-3,232.8,0,0 +-3,233.7,0,0 +-3,234.6,0,0 +-3,235.5,0,0 +-3,236.4,0,0 +-3,237.3,0,0 +-3,238.2,0,0 +-3,239.1,0,0 +-3,240,0,0 +-3,240.9,0,0 +-3,241.8,0,0 +-3,242.7,0,0 +-3,243.6,0,0 +-3,244.5,0,0 +-3,245.4,0,0 +-3,246.3,0,0 +-3,247.2,0,0 +-3,248.1,0,0 +-3,249,0,0 +-3,249.9,0,0 +-3,250.8,0,0 +-3,251.7,0,0 +-3,252.6,0,0 +-3,253.5,0,0 +-3,254.4,0,0 +-3,255.3,0,0 +-3,256.2,0,0 +-3,257.1,0,0 +-3,258,0,0 +-3,258.9,0,0 +-3,259.8,0,0 +-3,260.8,0,0 +-3,261.7,0,0 +-3,262.6,0,0 +-3,263.5,0,0 +-3,264.4,0,0 +-3,265.3,0,0 +-3,266.2,0,0 +-3,267.1,0,0 +-3,268,0,0 +-3,268.9,0,0 +-3,269.8,0,0 +-3,270.7,0,0 +-3,271.6,0,0 +-3,272.5,0,0 +-3,273.4,0,0 +-3,274.3,0,0 +-3,275.2,0,0 +-3,276.1,0,0 +-3,277,0,0 +-3,277.9,0,0 +-3,278.8,0,0 +-3,279.7,0,0 +-3,280.6,0,0 +-3,281.5,0,0 +-3,282.4,0,0 +-3,283.3,0,0 +-3,284.2,0,0 +-3,285.1,0,0 +-3,286,0,0 +-3,286.9,0,0 +-3,287.8,0,0 +-3,288.7,0,0 +-3,289.6,0,0 +-3,290.5,0,0 +-3,291.4,0,0 +-3,292.3,0,0 +-3,293.2,0,0 +-3,294.1,0,0 +-3,295,0,0 +-3,295.9,0,0 +-3,296.8,0,0 +-3,297.7,0,0 +-3,298.6,0,0 +-3,299.5,0,0 +-3,300.5,0,0 +-3,301.4,0,0 +-3,302.3,0,0 +-3,303.2,0,0 +-3,304.1,0,0 +-3,305,0,0 +-3,305.9,0,0 +-3,306.8,0,0 +-3,307.7,0,0 +-3,308.6,0,0 +-3,309.5,0,0 +-3,310.4,0,0 +-3,311.3,0,0 +-3,312.2,0,0 +-3,313.1,0,0 +-3,314,0,0 +-3,314.9,0,0 +-3,315.8,0,0 +-3,316.7,0,0 +-3,317.6,0,0 +-3,318.5,0,0 +-3,319.4,0,0 +-3,320.3,0,0 +-3,321.2,0,0 +-3,322.1,0,0 +-3,323,0,0 +-3,323.9,0,0 +-3,324.8,0,0 +-3,325.7,0,0 +-3,326.6,0,0 +-3,327.5,0,0 +-3,328.4,0,0 +-3,329.3,0,0 +-3,330.2,0,0 +-3,331.1,0,0 +-3,332,0,0 +-3,332.9,0,0 +-3,333.8,0,0 +-3,334.7,0,0 +-3,335.6,0,0 +-3,336.5,0,0 +-3,337.4,0,0 +-3,338.3,0,0 +-3,339.2,0,0 +-3,340.2,0,0 +-3,341.1,0,0 +-3,342,0,0 +-3,342.9,0,0 +-3,343.8,0,0 +-3,344.7,0,0 +-3,345.6,0,0 +-3,346.5,0,0 +-3,347.4,0,0 +-3,348.3,0,0 +-3,349.2,0,0 +-3,350.1,0,0 +-3,351,0,0 +-3,351.9,0,0 +-3,352.8,0,0 +-3,353.7,0,0 +-3,354.6,0,0 +-3,355.5,0,0 +-3,356.4,0,0 +-3,357.3,0,0 +-3,358.2,0,0 +-3,359.1,0,0 +-3,360,0,0 +-3,360,0,0 +-3,359.1,0,0 +-3,358.2,0,0 +-3,357.3,0,0 +-3,356.4,0,0 +-3,355.5,0,0 +-3,354.6,0,0 +-3,353.7,0,0 +-3,352.8,0,0 +-3,351.9,0,0 +-3,351,0,0 +-3,350.1,0,0 +-3,349.2,0,0 +-3,348.3,0,0 +-3,347.4,0,0 +-3,346.5,0,0 +-3,345.6,0,0 +-3,344.7,0,0 +-3,343.8,0,0 +-3,342.9,0,0 +-3,342,0,0 +-3,341.1,0,0 +-3,340.2,0,0 +-3,339.2,0,0 +-3,338.3,0,0 +-3,337.4,0,0 +-3,336.5,0,0 +-3,335.6,0,0 +-3,334.7,0,0 +-3,333.8,0,0 +-3,332.9,0,0 +-3,332,0,0 +-3,331.1,0,0 +-3,330.2,0,0 +-3,329.3,0,0 +-3,328.4,0,0 +-3,327.5,0,0 +-3,326.6,0,0 +-3,325.7,0,0 +-3,324.8,0,0 +-3,323.9,0,0 +-3,323,0,0 +-3,322.1,0,0 +-3,321.2,0,0 +-3,320.3,0,0 +-3,319.4,0,0 +-3,318.5,0,0 +-3,317.6,0,0 +-3,316.7,0,0 +-3,315.8,0,0 +-3,314.9,0,0 +-3,314,0,0 +-3,313.1,0,0 +-3,312.2,0,0 +-3,311.3,0,0 +-3,310.4,0,0 +-3,309.5,0,0 +-3,308.6,0,0 +-3,307.7,0,0 +-3,306.8,0,0 +-3,305.9,0,0 +-3,305,0,0 +-3,304.1,0,0 +-3,303.2,0,0 +-3,302.3,0,0 +-3,301.4,0,0 +-3,300.5,0,0 +-3,299.5,0,0 +-3,298.6,0,0 +-3,297.7,0,0 +-3,296.8,0,0 +-3,295.9,0,0 +-3,295,0,0 +-3,294.1,0,0 +-3,293.2,0,0 +-3,292.3,0,0 +-3,291.4,0,0 +-3,290.5,0,0 +-3,289.6,0,0 +-3,288.7,0,0 +-3,287.8,0,0 +-3,286.9,0,0 +-3,286,0,0 +-3,285.1,0,0 +-3,284.2,0,0 +-3,283.3,0,0 +-3,282.4,0,0 +-3,281.5,0,0 +-3,280.6,0,0 +-3,279.7,0,0 +-3,278.8,0,0 +-3,277.9,0,0 +-3,277,0,0 +-3,276.1,0,0 +-3,275.2,0,0 +-3,274.3,0,0 +-3,273.4,0,0 +-3,272.5,0,0 +-3,271.6,0,0 +-3,270.7,0,0 +-3,269.8,0,0 +-3,268.9,0,0 +-3,268,0,0 +-3,267.1,0,0 +-3,266.2,0,0 +-3,265.3,0,0 +-3,264.4,0,0 +-3,263.5,0,0 +-3,262.6,0,0 +-3,261.7,0,0 +-3,260.8,0,0 +-3,259.8,0,0 +-3,258.9,0,0 +-3,258,0,0 +-3,257.1,0,0 +-3,256.2,0,0 +-3,255.3,0,0 +-3,254.4,0,0 +-3,253.5,0,0 +-3,252.6,0,0 +-3,251.7,0,0 +-3,250.8,0,0 +-3,249.9,0,0 +-3,249,0,0 +-3,248.1,0,0 +-3,247.2,0,0 +-3,246.3,0,0 +-3,245.4,0,0 +-3,244.5,0,0 +-3,243.6,0,0 +-3,242.7,0,0 +-3,241.8,0,0 +-3,240.9,0,0 +-3,240,0,0 +-3,239.1,0,0 +-3,238.2,0,0 +-3,237.3,0,0 +-3,236.4,0,0 +-3,235.5,0,0 +-3,234.6,0,0 +-3,233.7,0,0 +-3,232.8,0,0 +-3,231.9,0,0 +-3,231,0,0 +-3,230.1,0,0 +-3,229.2,0,0 +-3,228.3,0,0 +-3,227.4,0,0 +-3,226.5,0,0 +-3,225.6,0,0 +-3,224.7,0,0 +-3,223.8,0,0 +-3,222.9,0,0 +-3,222,0,0 +-3,221.1,0,0 +-3,220.2,0,0 +-3,219.2,0,0 +-3,218.3,0,0 +-3,217.4,0,0 +-3,216.5,0,0 +-3,215.6,0,0 +-3,214.7,0,0 +-3,213.8,0,0 +-3,212.9,0,0 +-3,212,0,0 +-3,211.1,0,0 +-3,210.2,0,0 +-3,209.3,0,0 +-3,208.4,0,0 +-3,207.5,0,0 +-3,206.6,0,0 +-3,205.7,0,0 +-3,204.8,0,0 +-3,203.9,0,0 +-3,203,0,0 +-3,202.1,0,0 +-3,201.2,0,0 +-3,200.3,0,0 +-3,199.4,0,0 +-3,198.5,0,0 +-3,197.6,0,0 +-3,196.7,0,0 +-3,195.8,0,0 +-3,194.9,0,0 +-3,194,0,0 +-3,193.1,0,0 +-3,192.2,0,0 +-3,191.3,0,0 +-3,190.4,0,0 +-3,189.5,0,0 +-3,188.6,0,0 +-3,187.7,0,0 +-3,186.8,0,0 +-3,185.9,0,0 +-3,185,0,0 +-3,184.1,0,0 +-3,183.2,0,0 +-3,182.3,0,0 +-3,181.4,0,0 +-3,180.5,0,0 +-3,179.5,-90,0 +-3,178.6,-89.5,0 +-3,177.7,-89.1,0 +-3,176.8,-88.6,0 +-3,175.9,-88.2,0 +-3,175,-87.7,0 +-3,174.1,-87.3,0 +-3,173.2,-86.8,0 +-3,172.3,-86.4,0 +-3,171.4,-85.9,0 +-3,170.5,-85.5,0 +-3,169.6,-85,0 +-3,168.7,-84.6,0 +-3,167.8,-84.1,0 +-3,166.9,-83.7,0 +-3,166,-83.2,0 +-3,165.1,-82.8,0 +-3,164.2,-82.3,0 +-3,163.3,-81.9,0 +-3,162.4,-81.4,0 +-3,161.5,-81,0 +-3,160.6,-80.5,0 +-3,159.7,-80.1,0 +-3,158.8,-79.6,0 +-3,157.9,-79.1,0 +-3,157,-78.7,0 +-3,156.1,-78.2,0 +-3,155.2,-77.8,0 +-3,154.3,-77.3,0 +-3,153.4,-76.9,0 +-3,152.5,-76.4,0 +-3,151.6,-76,0 +-3,150.7,-75.5,0 +-3,149.8,-75.1,0 +-3,148.9,-74.6,0 +-3,148,-74.2,0 +-3,147.1,-73.7,0 +-3,146.2,-73.3,0 +-3,145.3,-72.8,0 +-3,144.4,-72.4,0 +-3,143.5,-71.9,0 +-3,142.6,-71.5,0 +-3,141.7,-71,0 +-3,140.8,-70.6,0 +-3,139.8,-70.1,0 +-3,138.9,-69.6,0 +-3,138,-69.2,0 +-3,137.1,-68.7,0 +-3,136.2,-68.3,0 +-3,135.3,-67.8,0 +-3,134.4,-67.4,0 +-3,133.5,-66.9,0 +-3,132.6,-66.5,0 +-3,131.7,-66,0 +-3,130.8,-65.6,0 +-3,129.9,-65.1,0 +-3,129,-64.7,0 +-3,128.1,-64.2,0 +-3,127.2,-63.8,0 +-3,126.3,-63.3,0 +-3,125.4,-62.9,0 +-3,124.5,-62.4,0 +-3,123.6,-62,0 +-3,122.7,-61.5,0 +-3,121.8,-61.1,0 +-3,120.9,-60.6,0 +-3,120,-60.2,0 +-3,119.1,-59.7,0 +-3,118.2,-59.2,0 +-3,117.3,-58.8,0 +-3,116.4,-58.3,0 +-3,115.5,-57.9,0 +-3,114.6,-57.4,0 +-3,113.7,-57,0 +-3,112.8,-56.5,0 +-3,111.9,-56.1,0 +-3,111,-55.6,0 +-3,110.1,-55.2,0 +-3,109.2,-54.7,0 +-3,108.3,-54.3,0 +-3,107.4,-53.8,0 +-3,106.5,-53.4,0 +-3,105.6,-52.9,0 +-3,104.7,-52.5,0 +-3,103.8,-52,0 +-3,102.9,-51.6,0 +-3,102,-51.1,0 +-3,101.1,-50.7,0 +-3,100.2,-50.2,0 +-3,99.2,-49.7,0 +-3,98.3,-49.3,0 +-3,97.4,-48.8,0 +-3,96.5,-48.4,0 +-3,95.6,-47.9,0 +-3,94.7,-47.5,0 +-3,93.8,-47,0 +-3,92.9,-46.6,0 +-3,92,-46.1,0 +-3,91.1,-45.7,0 +-3,90.2,-45.2,0 +-3,89.3,-44.8,90 +-3,88.4,-44.3,89.1 +-3,87.5,-43.9,88.2 +-3,86.6,-43.4,87.3 +-3,85.7,-43,86.4 +-3,84.8,-42.5,85.5 +-3,83.9,-42.1,84.5 +-3,83,-41.6,83.6 +-3,82.1,-41.2,82.7 +-3,81.2,-40.7,81.8 +-3,80.3,-40.3,80.9 +-3,79.4,-39.8,80 +-3,78.5,-39.3,79.1 +-3,77.6,-38.9,78.2 +-3,76.7,-38.4,77.3 +-3,75.8,-38,76.4 +-3,74.9,-37.5,75.5 +-3,74,-37.1,74.5 +-3,73.1,-36.6,73.6 +-3,72.2,-36.2,72.7 +-3,71.3,-35.7,71.8 +-3,70.4,-35.3,70.9 +-3,69.5,-34.8,70 +-3,68.6,-34.4,69.1 +-3,67.7,-33.9,68.2 +-3,66.8,-33.5,67.3 +-3,65.9,-33,66.4 +-3,65,-32.6,65.5 +-3,64.1,-32.1,64.5 +-3,63.2,-31.7,63.6 +-3,62.3,-31.2,62.7 +-3,61.4,-30.8,61.8 +-3,60.5,-30.3,60.9 +-3,59.5,-29.8,60 +-3,58.6,-29.4,59.1 +-3,57.7,-28.9,58.2 +-3,56.8,-28.5,57.3 +-3,55.9,-28,56.4 +-3,55,-27.6,55.5 +-3,54.1,-27.1,54.5 +-3,53.2,-26.7,53.6 +-3,52.3,-26.2,52.7 +-3,51.4,-25.8,51.8 +-3,50.5,-25.3,50.9 +-3,49.6,-24.9,50 +-3,48.7,-24.4,49.1 +-3,47.8,-24,48.2 +-3,46.9,-23.5,47.3 +-3,46,-23.1,46.4 +-3,45.1,-22.6,45.5 +-3,44.2,-22.2,44.5 +-3,43.3,-21.7,43.6 +-3,42.4,-21.3,42.7 +-3,41.5,-20.8,41.8 +-3,40.6,-20.4,40.9 +-3,39.7,-19.9,40 +-3,38.8,-19.4,39.1 +-3,37.9,-19,38.2 +-3,37,-18.5,37.3 +-3,36.1,-18.1,36.4 +-3,35.2,-17.6,35.5 +-3,34.3,-17.2,34.5 +-3,33.4,-16.7,33.6 +-3,32.5,-16.3,32.7 +-3,31.6,-15.8,31.8 +-3,30.7,-15.4,30.9 +-3,29.8,-14.9,30 +-3,28.9,-14.5,29.1 +-3,28,-14,28.2 +-3,27.1,-13.6,27.3 +-3,26.2,-13.1,26.4 +-3,25.3,-12.7,25.5 +-3,24.4,-12.2,24.5 +-3,23.5,-11.8,23.6 +-3,22.6,-11.3,22.7 +-3,21.7,-10.9,21.8 +-3,20.8,-10.4,20.9 +-3,19.8,-9.9,20 +-3,18.9,-9.5,19.1 +-3,18,-9,18.2 +-3,17.1,-8.6,17.3 +-3,16.2,-8.1,16.4 +-3,15.3,-7.7,15.5 +-3,14.4,-7.2,14.5 +-3,13.5,-6.8,13.6 +-3,12.6,-6.3,12.7 +-3,11.7,-5.9,11.8 +-3,10.8,-5.4,10.9 +-3,9.9,-5,10 +-3,9,-4.5,9.1 +-3,8.1,-4.1,8.2 +-3,7.2,-3.6,7.3 +-3,6.3,-3.2,6.4 +-3,5.4,-2.7,5.5 +-3,4.5,-2.3,4.5 +-3,3.6,-1.8,3.6 +-3,2.7,-1.4,2.7 +-3,1.8,-0.9,1.8 +-3,0.9,-0.5,0.9 +-3,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +0.9,0,0,0.3 +0.9,0,0,0.3 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.8,0,0,0.5 +0.8,0,0,0.5 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.5,0,0,0.8 +0.5,0,0,0.8 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.3,0,0,0.9 +0.3,0,0,0.9 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,0.9 +0.3,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.8 +0.5,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.7,0,0,0.8 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.8,0,0,0.7 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.5 +0.8,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.3 +0.9,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0 +-3,0,0,0 +-3,0.9,-0.5,0.9 +-3,1.8,-0.9,1.8 +-3,2.7,-1.4,2.7 +-3,3.6,-1.8,3.6 +-3,4.5,-2.3,4.5 +-3,5.4,-2.7,5.5 +-3,6.3,-3.2,6.4 +-3,7.2,-3.6,7.3 +-3,8.1,-4.1,8.2 +-3,9,-4.5,9.1 +-3,9.9,-5,10 +-3,10.8,-5.4,10.9 +-3,11.7,-5.9,11.8 +-3,12.6,-6.3,12.7 +-3,13.5,-6.8,13.6 +-3,14.4,-7.2,14.5 +-3,15.3,-7.7,15.5 +-3,16.2,-8.1,16.4 +-3,17.1,-8.6,17.3 +-3,18,-9,18.2 +-3,18.9,-9.5,19.1 +-3,19.8,-9.9,20 +-3,20.8,-10.4,20.9 +-3,21.7,-10.9,21.8 +-3,22.6,-11.3,22.7 +-3,23.5,-11.8,23.6 +-3,24.4,-12.2,24.5 +-3,25.3,-12.7,25.5 +-3,26.2,-13.1,26.4 +-3,27.1,-13.6,27.3 +-3,28,-14,28.2 +-3,28.9,-14.5,29.1 +-3,29.8,-14.9,30 +-3,30.7,-15.4,30.9 +-3,31.6,-15.8,31.8 +-3,32.5,-16.3,32.7 +-3,33.4,-16.7,33.6 +-3,34.3,-17.2,34.5 +-3,35.2,-17.6,35.5 +-3,36.1,-18.1,36.4 +-3,37,-18.5,37.3 +-3,37.9,-19,38.2 +-3,38.8,-19.4,39.1 +-3,39.7,-19.9,40 +-3,40.6,-20.4,40.9 +-3,41.5,-20.8,41.8 +-3,42.4,-21.3,42.7 +-3,43.3,-21.7,43.6 +-3,44.2,-22.2,44.5 +-3,45.1,-22.6,45.5 +-3,46,-23.1,46.4 +-3,46.9,-23.5,47.3 +-3,47.8,-24,48.2 +-3,48.7,-24.4,49.1 +-3,49.6,-24.9,50 +-3,50.5,-25.3,50.9 +-3,51.4,-25.8,51.8 +-3,52.3,-26.2,52.7 +-3,53.2,-26.7,53.6 +-3,54.1,-27.1,54.5 +-3,55,-27.6,55.5 +-3,55.9,-28,56.4 +-3,56.8,-28.5,57.3 +-3,57.7,-28.9,58.2 +-3,58.6,-29.4,59.1 +-3,59.5,-29.8,60 +-3,60.5,-30.3,60.9 +-3,61.4,-30.8,61.8 +-3,62.3,-31.2,62.7 +-3,63.2,-31.7,63.6 +-3,64.1,-32.1,64.5 +-3,65,-32.6,65.5 +-3,65.9,-33,66.4 +-3,66.8,-33.5,67.3 +-3,67.7,-33.9,68.2 +-3,68.6,-34.4,69.1 +-3,69.5,-34.8,70 +-3,70.4,-35.3,70.9 +-3,71.3,-35.7,71.8 +-3,72.2,-36.2,72.7 +-3,73.1,-36.6,73.6 +-3,74,-37.1,74.5 +-3,74.9,-37.5,75.5 +-3,75.8,-38,76.4 +-3,76.7,-38.4,77.3 +-3,77.6,-38.9,78.2 +-3,78.5,-39.3,79.1 +-3,79.4,-39.8,80 +-3,80.3,-40.3,80.9 +-3,81.2,-40.7,81.8 +-3,82.1,-41.2,82.7 +-3,83,-41.6,83.6 +-3,83.9,-42.1,84.5 +-3,84.8,-42.5,85.5 +-3,85.7,-43,86.4 +-3,86.6,-43.4,87.3 +-3,87.5,-43.9,88.2 +-3,88.4,-44.3,89.1 +-3,89.3,-44.8,90 +-3,90.2,-45.2,0 +-3,91.1,-45.7,0 +-3,92,-46.1,0 +-3,92.9,-46.6,0 +-3,93.8,-47,0 +-3,94.7,-47.5,0 +-3,95.6,-47.9,0 +-3,96.5,-48.4,0 +-3,97.4,-48.8,0 +-3,98.3,-49.3,0 +-3,99.2,-49.7,0 +-3,100.2,-50.2,0 +-3,101.1,-50.7,0 +-3,102,-51.1,0 +-3,102.9,-51.6,0 +-3,103.8,-52,0 +-3,104.7,-52.5,0 +-3,105.6,-52.9,0 +-3,106.5,-53.4,0 +-3,107.4,-53.8,0 +-3,108.3,-54.3,0 +-3,109.2,-54.7,0 +-3,110.1,-55.2,0 +-3,111,-55.6,0 +-3,111.9,-56.1,0 +-3,112.8,-56.5,0 +-3,113.7,-57,0 +-3,114.6,-57.4,0 +-3,115.5,-57.9,0 +-3,116.4,-58.3,0 +-3,117.3,-58.8,0 +-3,118.2,-59.2,0 +-3,119.1,-59.7,0 +-3,120,-60.2,0 +-3,120.9,-60.6,0 +-3,121.8,-61.1,0 +-3,122.7,-61.5,0 +-3,123.6,-62,0 +-3,124.5,-62.4,0 +-3,125.4,-62.9,0 +-3,126.3,-63.3,0 +-3,127.2,-63.8,0 +-3,128.1,-64.2,0 +-3,129,-64.7,0 +-3,129.9,-65.1,0 +-3,130.8,-65.6,0 +-3,131.7,-66,0 +-3,132.6,-66.5,0 +-3,133.5,-66.9,0 +-3,134.4,-67.4,0 +-3,135.3,-67.8,0 +-3,136.2,-68.3,0 +-3,137.1,-68.7,0 +-3,138,-69.2,0 +-3,138.9,-69.6,0 +-3,139.8,-70.1,0 +-3,140.8,-70.6,0 +-3,141.7,-71,0 +-3,142.6,-71.5,0 +-3,143.5,-71.9,0 +-3,144.4,-72.4,0 +-3,145.3,-72.8,0 +-3,146.2,-73.3,0 +-3,147.1,-73.7,0 +-3,148,-74.2,0 +-3,148.9,-74.6,0 +-3,149.8,-75.1,0 +-3,150.7,-75.5,0 +-3,151.6,-76,0 +-3,152.5,-76.4,0 +-3,153.4,-76.9,0 +-3,154.3,-77.3,0 +-3,155.2,-77.8,0 +-3,156.1,-78.2,0 +-3,157,-78.7,0 +-3,157.9,-79.1,0 +-3,158.8,-79.6,0 +-3,159.7,-80.1,0 +-3,160.6,-80.5,0 +-3,161.5,-81,0 +-3,162.4,-81.4,0 +-3,163.3,-81.9,0 +-3,164.2,-82.3,0 +-3,165.1,-82.8,0 +-3,166,-83.2,0 +-3,166.9,-83.7,0 +-3,167.8,-84.1,0 +-3,168.7,-84.6,0 +-3,169.6,-85,0 +-3,170.5,-85.5,0 +-3,171.4,-85.9,0 +-3,172.3,-86.4,0 +-3,173.2,-86.8,0 +-3,174.1,-87.3,0 +-3,175,-87.7,0 +-3,175.9,-88.2,0 +-3,176.8,-88.6,0 +-3,177.7,-89.1,0 +-3,178.6,-89.5,0 +-3,179.5,-90,0 +-3,180.5,0,0 +-3,181.4,0,0 +-3,182.3,0,0 +-3,183.2,0,0 +-3,184.1,0,0 +-3,185,0,0 +-3,185.9,0,0 +-3,186.8,0,0 +-3,187.7,0,0 +-3,188.6,0,0 +-3,189.5,0,0 +-3,190.4,0,0 +-3,191.3,0,0 +-3,192.2,0,0 +-3,193.1,0,0 +-3,194,0,0 +-3,194.9,0,0 +-3,195.8,0,0 +-3,196.7,0,0 +-3,197.6,0,0 +-3,198.5,0,0 +-3,199.4,0,0 +-3,200.3,0,0 +-3,201.2,0,0 +-3,202.1,0,0 +-3,203,0,0 +-3,203.9,0,0 +-3,204.8,0,0 +-3,205.7,0,0 +-3,206.6,0,0 +-3,207.5,0,0 +-3,208.4,0,0 +-3,209.3,0,0 +-3,210.2,0,0 +-3,211.1,0,0 +-3,212,0,0 +-3,212.9,0,0 +-3,213.8,0,0 +-3,214.7,0,0 +-3,215.6,0,0 +-3,216.5,0,0 +-3,217.4,0,0 +-3,218.3,0,0 +-3,219.2,0,0 +-3,220.2,0,0 +-3,221.1,0,0 +-3,222,0,0 +-3,222.9,0,0 +-3,223.8,0,0 +-3,224.7,0,0 +-3,225.6,0,0 +-3,226.5,0,0 +-3,227.4,0,0 +-3,228.3,0,0 +-3,229.2,0,0 +-3,230.1,0,0 +-3,231,0,0 +-3,231.9,0,0 +-3,232.8,0,0 +-3,233.7,0,0 +-3,234.6,0,0 +-3,235.5,0,0 +-3,236.4,0,0 +-3,237.3,0,0 +-3,238.2,0,0 +-3,239.1,0,0 +-3,240,0,0 +-3,240.9,0,0 +-3,241.8,0,0 +-3,242.7,0,0 +-3,243.6,0,0 +-3,244.5,0,0 +-3,245.4,0,0 +-3,246.3,0,0 +-3,247.2,0,0 +-3,248.1,0,0 +-3,249,0,0 +-3,249.9,0,0 +-3,250.8,0,0 +-3,251.7,0,0 +-3,252.6,0,0 +-3,253.5,0,0 +-3,254.4,0,0 +-3,255.3,0,0 +-3,256.2,0,0 +-3,257.1,0,0 +-3,258,0,0 +-3,258.9,0,0 +-3,259.8,0,0 +-3,260.8,0,0 +-3,261.7,0,0 +-3,262.6,0,0 +-3,263.5,0,0 +-3,264.4,0,0 +-3,265.3,0,0 +-3,266.2,0,0 +-3,267.1,0,0 +-3,268,0,0 +-3,268.9,0,0 +-3,269.8,0,0 +-3,270.7,0,0 +-3,271.6,0,0 +-3,272.5,0,0 +-3,273.4,0,0 +-3,274.3,0,0 +-3,275.2,0,0 +-3,276.1,0,0 +-3,277,0,0 +-3,277.9,0,0 +-3,278.8,0,0 +-3,279.7,0,0 +-3,280.6,0,0 +-3,281.5,0,0 +-3,282.4,0,0 +-3,283.3,0,0 +-3,284.2,0,0 +-3,285.1,0,0 +-3,286,0,0 +-3,286.9,0,0 +-3,287.8,0,0 +-3,288.7,0,0 +-3,289.6,0,0 +-3,290.5,0,0 +-3,291.4,0,0 +-3,292.3,0,0 +-3,293.2,0,0 +-3,294.1,0,0 +-3,295,0,0 +-3,295.9,0,0 +-3,296.8,0,0 +-3,297.7,0,0 +-3,298.6,0,0 +-3,299.5,0,0 +-3,300.5,0,0 +-3,301.4,0,0 +-3,302.3,0,0 +-3,303.2,0,0 +-3,304.1,0,0 +-3,305,0,0 +-3,305.9,0,0 +-3,306.8,0,0 +-3,307.7,0,0 +-3,308.6,0,0 +-3,309.5,0,0 +-3,310.4,0,0 +-3,311.3,0,0 +-3,312.2,0,0 +-3,313.1,0,0 +-3,314,0,0 +-3,314.9,0,0 +-3,315.8,0,0 +-3,316.7,0,0 +-3,317.6,0,0 +-3,318.5,0,0 +-3,319.4,0,0 +-3,320.3,0,0 +-3,321.2,0,0 +-3,322.1,0,0 +-3,323,0,0 +-3,323.9,0,0 +-3,324.8,0,0 +-3,325.7,0,0 +-3,326.6,0,0 +-3,327.5,0,0 +-3,328.4,0,0 +-3,329.3,0,0 +-3,330.2,0,0 +-3,331.1,0,0 +-3,332,0,0 +-3,332.9,0,0 +-3,333.8,0,0 +-3,334.7,0,0 +-3,335.6,0,0 +-3,336.5,0,0 +-3,337.4,0,0 +-3,338.3,0,0 +-3,339.2,0,0 +-3,340.2,0,0 +-3,341.1,0,0 +-3,342,0,0 +-3,342.9,0,0 +-3,343.8,0,0 +-3,344.7,0,0 +-3,345.6,0,0 +-3,346.5,0,0 +-3,347.4,0,0 +-3,348.3,0,0 +-3,349.2,0,0 +-3,350.1,0,0 +-3,351,0,0 +-3,351.9,0,0 +-3,352.8,0,0 +-3,353.7,0,0 +-3,354.6,0,0 +-3,355.5,0,0 +-3,356.4,0,0 +-3,357.3,0,0 +-3,358.2,0,0 +-3,359.1,0,0 +-3,360,0,0 +-3,360,0,0 +-3,359.1,0,0 +-3,358.2,0,0 +-3,357.3,0,0 +-3,356.4,0,0 +-3,355.5,0,0 +-3,354.6,0,0 +-3,353.7,0,0 +-3,352.8,0,0 +-3,351.9,0,0 +-3,351,0,0 +-3,350.1,0,0 +-3,349.2,0,0 +-3,348.3,0,0 +-3,347.4,0,0 +-3,346.5,0,0 +-3,345.6,0,0 +-3,344.7,0,0 +-3,343.8,0,0 +-3,342.9,0,0 +-3,342,0,0 +-3,341.1,0,0 +-3,340.2,0,0 +-3,339.2,0,0 +-3,338.3,0,0 +-3,337.4,0,0 +-3,336.5,0,0 +-3,335.6,0,0 +-3,334.7,0,0 +-3,333.8,0,0 +-3,332.9,0,0 +-3,332,0,0 +-3,331.1,0,0 +-3,330.2,0,0 +-3,329.3,0,0 +-3,328.4,0,0 +-3,327.5,0,0 +-3,326.6,0,0 +-3,325.7,0,0 +-3,324.8,0,0 +-3,323.9,0,0 +-3,323,0,0 +-3,322.1,0,0 +-3,321.2,0,0 +-3,320.3,0,0 +-3,319.4,0,0 +-3,318.5,0,0 +-3,317.6,0,0 +-3,316.7,0,0 +-3,315.8,0,0 +-3,314.9,0,0 +-3,314,0,0 +-3,313.1,0,0 +-3,312.2,0,0 +-3,311.3,0,0 +-3,310.4,0,0 +-3,309.5,0,0 +-3,308.6,0,0 +-3,307.7,0,0 +-3,306.8,0,0 +-3,305.9,0,0 +-3,305,0,0 +-3,304.1,0,0 +-3,303.2,0,0 +-3,302.3,0,0 +-3,301.4,0,0 +-3,300.5,0,0 +-3,299.5,0,0 +-3,298.6,0,0 +-3,297.7,0,0 +-3,296.8,0,0 +-3,295.9,0,0 +-3,295,0,0 +-3,294.1,0,0 +-3,293.2,0,0 +-3,292.3,0,0 +-3,291.4,0,0 +-3,290.5,0,0 +-3,289.6,0,0 +-3,288.7,0,0 +-3,287.8,0,0 +-3,286.9,0,0 +-3,286,0,0 +-3,285.1,0,0 +-3,284.2,0,0 +-3,283.3,0,0 +-3,282.4,0,0 +-3,281.5,0,0 +-3,280.6,0,0 +-3,279.7,0,0 +-3,278.8,0,0 +-3,277.9,0,0 +-3,277,0,0 +-3,276.1,0,0 +-3,275.2,0,0 +-3,274.3,0,0 +-3,273.4,0,0 +-3,272.5,0,0 +-3,271.6,0,0 +-3,270.7,0,0 +-3,269.8,0,0 +-3,268.9,0,0 +-3,268,0,0 +-3,267.1,0,0 +-3,266.2,0,0 +-3,265.3,0,0 +-3,264.4,0,0 +-3,263.5,0,0 +-3,262.6,0,0 +-3,261.7,0,0 +-3,260.8,0,0 +-3,259.8,0,0 +-3,258.9,0,0 +-3,258,0,0 +-3,257.1,0,0 +-3,256.2,0,0 +-3,255.3,0,0 +-3,254.4,0,0 +-3,253.5,0,0 +-3,252.6,0,0 +-3,251.7,0,0 +-3,250.8,0,0 +-3,249.9,0,0 +-3,249,0,0 +-3,248.1,0,0 +-3,247.2,0,0 +-3,246.3,0,0 +-3,245.4,0,0 +-3,244.5,0,0 +-3,243.6,0,0 +-3,242.7,0,0 +-3,241.8,0,0 +-3,240.9,0,0 +-3,240,0,0 +-3,239.1,0,0 +-3,238.2,0,0 +-3,237.3,0,0 +-3,236.4,0,0 +-3,235.5,0,0 +-3,234.6,0,0 +-3,233.7,0,0 +-3,232.8,0,0 +-3,231.9,0,0 +-3,231,0,0 +-3,230.1,0,0 +-3,229.2,0,0 +-3,228.3,0,0 +-3,227.4,0,0 +-3,226.5,0,0 +-3,225.6,0,0 +-3,224.7,0,0 +-3,223.8,0,0 +-3,222.9,0,0 +-3,222,0,0 +-3,221.1,0,0 +-3,220.2,0,0 +-3,219.2,0,0 +-3,218.3,0,0 +-3,217.4,0,0 +-3,216.5,0,0 +-3,215.6,0,0 +-3,214.7,0,0 +-3,213.8,0,0 +-3,212.9,0,0 +-3,212,0,0 +-3,211.1,0,0 +-3,210.2,0,0 +-3,209.3,0,0 +-3,208.4,0,0 +-3,207.5,0,0 +-3,206.6,0,0 +-3,205.7,0,0 +-3,204.8,0,0 +-3,203.9,0,0 +-3,203,0,0 +-3,202.1,0,0 +-3,201.2,0,0 +-3,200.3,0,0 +-3,199.4,0,0 +-3,198.5,0,0 +-3,197.6,0,0 +-3,196.7,0,0 +-3,195.8,0,0 +-3,194.9,0,0 +-3,194,0,0 +-3,193.1,0,0 +-3,192.2,0,0 +-3,191.3,0,0 +-3,190.4,0,0 +-3,189.5,0,0 +-3,188.6,0,0 +-3,187.7,0,0 +-3,186.8,0,0 +-3,185.9,0,0 +-3,185,0,0 +-3,184.1,0,0 +-3,183.2,0,0 +-3,182.3,0,0 +-3,181.4,0,0 +-3,180.5,0,0 +-3,179.5,-90,0 +-3,178.6,-89.5,0 +-3,177.7,-89.1,0 +-3,176.8,-88.6,0 +-3,175.9,-88.2,0 +-3,175,-87.7,0 +-3,174.1,-87.3,0 +-3,173.2,-86.8,0 +-3,172.3,-86.4,0 +-3,171.4,-85.9,0 +-3,170.5,-85.5,0 +-3,169.6,-85,0 +-3,168.7,-84.6,0 +-3,167.8,-84.1,0 +-3,166.9,-83.7,0 +-3,166,-83.2,0 +-3,165.1,-82.8,0 +-3,164.2,-82.3,0 +-3,163.3,-81.9,0 +-3,162.4,-81.4,0 +-3,161.5,-81,0 +-3,160.6,-80.5,0 +-3,159.7,-80.1,0 +-3,158.8,-79.6,0 +-3,157.9,-79.1,0 +-3,157,-78.7,0 +-3,156.1,-78.2,0 +-3,155.2,-77.8,0 +-3,154.3,-77.3,0 +-3,153.4,-76.9,0 +-3,152.5,-76.4,0 +-3,151.6,-76,0 +-3,150.7,-75.5,0 +-3,149.8,-75.1,0 +-3,148.9,-74.6,0 +-3,148,-74.2,0 +-3,147.1,-73.7,0 +-3,146.2,-73.3,0 +-3,145.3,-72.8,0 +-3,144.4,-72.4,0 +-3,143.5,-71.9,0 +-3,142.6,-71.5,0 +-3,141.7,-71,0 +-3,140.8,-70.6,0 +-3,139.8,-70.1,0 +-3,138.9,-69.6,0 +-3,138,-69.2,0 +-3,137.1,-68.7,0 +-3,136.2,-68.3,0 +-3,135.3,-67.8,0 +-3,134.4,-67.4,0 +-3,133.5,-66.9,0 +-3,132.6,-66.5,0 +-3,131.7,-66,0 +-3,130.8,-65.6,0 +-3,129.9,-65.1,0 +-3,129,-64.7,0 +-3,128.1,-64.2,0 +-3,127.2,-63.8,0 +-3,126.3,-63.3,0 +-3,125.4,-62.9,0 +-3,124.5,-62.4,0 +-3,123.6,-62,0 +-3,122.7,-61.5,0 +-3,121.8,-61.1,0 +-3,120.9,-60.6,0 +-3,120,-60.2,0 +-3,119.1,-59.7,0 +-3,118.2,-59.2,0 +-3,117.3,-58.8,0 +-3,116.4,-58.3,0 +-3,115.5,-57.9,0 +-3,114.6,-57.4,0 +-3,113.7,-57,0 +-3,112.8,-56.5,0 +-3,111.9,-56.1,0 +-3,111,-55.6,0 +-3,110.1,-55.2,0 +-3,109.2,-54.7,0 +-3,108.3,-54.3,0 +-3,107.4,-53.8,0 +-3,106.5,-53.4,0 +-3,105.6,-52.9,0 +-3,104.7,-52.5,0 +-3,103.8,-52,0 +-3,102.9,-51.6,0 +-3,102,-51.1,0 +-3,101.1,-50.7,0 +-3,100.2,-50.2,0 +-3,99.2,-49.7,0 +-3,98.3,-49.3,0 +-3,97.4,-48.8,0 +-3,96.5,-48.4,0 +-3,95.6,-47.9,0 +-3,94.7,-47.5,0 +-3,93.8,-47,0 +-3,92.9,-46.6,0 +-3,92,-46.1,0 +-3,91.1,-45.7,0 +-3,90.2,-45.2,0 +-3,89.3,-44.8,90 +-3,88.4,-44.3,89.1 +-3,87.5,-43.9,88.2 +-3,86.6,-43.4,87.3 +-3,85.7,-43,86.4 +-3,84.8,-42.5,85.5 +-3,83.9,-42.1,84.5 +-3,83,-41.6,83.6 +-3,82.1,-41.2,82.7 +-3,81.2,-40.7,81.8 +-3,80.3,-40.3,80.9 +-3,79.4,-39.8,80 +-3,78.5,-39.3,79.1 +-3,77.6,-38.9,78.2 +-3,76.7,-38.4,77.3 +-3,75.8,-38,76.4 +-3,74.9,-37.5,75.5 +-3,74,-37.1,74.5 +-3,73.1,-36.6,73.6 +-3,72.2,-36.2,72.7 +-3,71.3,-35.7,71.8 +-3,70.4,-35.3,70.9 +-3,69.5,-34.8,70 +-3,68.6,-34.4,69.1 +-3,67.7,-33.9,68.2 +-3,66.8,-33.5,67.3 +-3,65.9,-33,66.4 +-3,65,-32.6,65.5 +-3,64.1,-32.1,64.5 +-3,63.2,-31.7,63.6 +-3,62.3,-31.2,62.7 +-3,61.4,-30.8,61.8 +-3,60.5,-30.3,60.9 +-3,59.5,-29.8,60 +-3,58.6,-29.4,59.1 +-3,57.7,-28.9,58.2 +-3,56.8,-28.5,57.3 +-3,55.9,-28,56.4 +-3,55,-27.6,55.5 +-3,54.1,-27.1,54.5 +-3,53.2,-26.7,53.6 +-3,52.3,-26.2,52.7 +-3,51.4,-25.8,51.8 +-3,50.5,-25.3,50.9 +-3,49.6,-24.9,50 +-3,48.7,-24.4,49.1 +-3,47.8,-24,48.2 +-3,46.9,-23.5,47.3 +-3,46,-23.1,46.4 +-3,45.1,-22.6,45.5 +-3,44.2,-22.2,44.5 +-3,43.3,-21.7,43.6 +-3,42.4,-21.3,42.7 +-3,41.5,-20.8,41.8 +-3,40.6,-20.4,40.9 +-3,39.7,-19.9,40 +-3,38.8,-19.4,39.1 +-3,37.9,-19,38.2 +-3,37,-18.5,37.3 +-3,36.1,-18.1,36.4 +-3,35.2,-17.6,35.5 +-3,34.3,-17.2,34.5 +-3,33.4,-16.7,33.6 +-3,32.5,-16.3,32.7 +-3,31.6,-15.8,31.8 +-3,30.7,-15.4,30.9 +-3,29.8,-14.9,30 +-3,28.9,-14.5,29.1 +-3,28,-14,28.2 +-3,27.1,-13.6,27.3 +-3,26.2,-13.1,26.4 +-3,25.3,-12.7,25.5 +-3,24.4,-12.2,24.5 +-3,23.5,-11.8,23.6 +-3,22.6,-11.3,22.7 +-3,21.7,-10.9,21.8 +-3,20.8,-10.4,20.9 +-3,19.8,-9.9,20 +-3,18.9,-9.5,19.1 +-3,18,-9,18.2 +-3,17.1,-8.6,17.3 +-3,16.2,-8.1,16.4 +-3,15.3,-7.7,15.5 +-3,14.4,-7.2,14.5 +-3,13.5,-6.8,13.6 +-3,12.6,-6.3,12.7 +-3,11.7,-5.9,11.8 +-3,10.8,-5.4,10.9 +-3,9.9,-5,10 +-3,9,-4.5,9.1 +-3,8.1,-4.1,8.2 +-3,7.2,-3.6,7.3 +-3,6.3,-3.2,6.4 +-3,5.4,-2.7,5.5 +-3,4.5,-2.3,4.5 +-3,3.6,-1.8,3.6 +-3,2.7,-1.4,2.7 +-3,1.8,-0.9,1.8 +-3,0.9,-0.5,0.9 +-3,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +0.9,0,0,0.3 +0.9,0,0,0.3 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.8,0,0,0.5 +0.8,0,0,0.5 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.5,0,0,0.8 +0.5,0,0,0.8 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.3,0,0,0.9 +0.3,0,0,0.9 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,0.9 +0.3,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.8 +0.5,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.7,0,0,0.8 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.8,0,0,0.7 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.5 +0.8,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.3 +0.9,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0 +-3,0,0,0 +-3,0.9,-0.5,0.9 +-3,1.8,-0.9,1.8 +-3,2.7,-1.4,2.7 +-3,3.6,-1.8,3.6 +-3,4.5,-2.3,4.5 +-3,5.4,-2.7,5.5 +-3,6.3,-3.2,6.4 +-3,7.2,-3.6,7.3 +-3,8.1,-4.1,8.2 +-3,9,-4.5,9.1 +-3,9.9,-5,10 +-3,10.8,-5.4,10.9 +-3,11.7,-5.9,11.8 +-3,12.6,-6.3,12.7 +-3,13.5,-6.8,13.6 +-3,14.4,-7.2,14.5 +-3,15.3,-7.7,15.5 +-3,16.2,-8.1,16.4 +-3,17.1,-8.6,17.3 +-3,18,-9,18.2 +-3,18.9,-9.5,19.1 +-3,19.8,-9.9,20 +-3,20.8,-10.4,20.9 +-3,21.7,-10.9,21.8 +-3,22.6,-11.3,22.7 +-3,23.5,-11.8,23.6 +-3,24.4,-12.2,24.5 +-3,25.3,-12.7,25.5 +-3,26.2,-13.1,26.4 +-3,27.1,-13.6,27.3 +-3,28,-14,28.2 +-3,28.9,-14.5,29.1 +-3,29.8,-14.9,30 +-3,30.7,-15.4,30.9 +-3,31.6,-15.8,31.8 +-3,32.5,-16.3,32.7 +-3,33.4,-16.7,33.6 +-3,34.3,-17.2,34.5 +-3,35.2,-17.6,35.5 +-3,36.1,-18.1,36.4 +-3,37,-18.5,37.3 +-3,37.9,-19,38.2 +-3,38.8,-19.4,39.1 +-3,39.7,-19.9,40 +-3,40.6,-20.4,40.9 +-3,41.5,-20.8,41.8 +-3,42.4,-21.3,42.7 +-3,43.3,-21.7,43.6 +-3,44.2,-22.2,44.5 +-3,45.1,-22.6,45.5 +-3,46,-23.1,46.4 +-3,46.9,-23.5,47.3 +-3,47.8,-24,48.2 +-3,48.7,-24.4,49.1 +-3,49.6,-24.9,50 +-3,50.5,-25.3,50.9 +-3,51.4,-25.8,51.8 +-3,52.3,-26.2,52.7 +-3,53.2,-26.7,53.6 +-3,54.1,-27.1,54.5 +-3,55,-27.6,55.5 +-3,55.9,-28,56.4 +-3,56.8,-28.5,57.3 +-3,57.7,-28.9,58.2 +-3,58.6,-29.4,59.1 +-3,59.5,-29.8,60 +-3,60.5,-30.3,60.9 +-3,61.4,-30.8,61.8 +-3,62.3,-31.2,62.7 +-3,63.2,-31.7,63.6 +-3,64.1,-32.1,64.5 +-3,65,-32.6,65.5 +-3,65.9,-33,66.4 +-3,66.8,-33.5,67.3 +-3,67.7,-33.9,68.2 +-3,68.6,-34.4,69.1 +-3,69.5,-34.8,70 +-3,70.4,-35.3,70.9 +-3,71.3,-35.7,71.8 +-3,72.2,-36.2,72.7 +-3,73.1,-36.6,73.6 +-3,74,-37.1,74.5 +-3,74.9,-37.5,75.5 +-3,75.8,-38,76.4 +-3,76.7,-38.4,77.3 +-3,77.6,-38.9,78.2 +-3,78.5,-39.3,79.1 +-3,79.4,-39.8,80 +-3,80.3,-40.3,80.9 +-3,81.2,-40.7,81.8 +-3,82.1,-41.2,82.7 +-3,83,-41.6,83.6 +-3,83.9,-42.1,84.5 +-3,84.8,-42.5,85.5 +-3,85.7,-43,86.4 +-3,86.6,-43.4,87.3 +-3,87.5,-43.9,88.2 +-3,88.4,-44.3,89.1 +-3,89.3,-44.8,90 +-3,90.2,-45.2,0 +-3,91.1,-45.7,0 +-3,92,-46.1,0 +-3,92.9,-46.6,0 +-3,93.8,-47,0 +-3,94.7,-47.5,0 +-3,95.6,-47.9,0 +-3,96.5,-48.4,0 +-3,97.4,-48.8,0 +-3,98.3,-49.3,0 +-3,99.2,-49.7,0 +-3,100.2,-50.2,0 +-3,101.1,-50.7,0 +-3,102,-51.1,0 +-3,102.9,-51.6,0 +-3,103.8,-52,0 +-3,104.7,-52.5,0 +-3,105.6,-52.9,0 +-3,106.5,-53.4,0 +-3,107.4,-53.8,0 +-3,108.3,-54.3,0 +-3,109.2,-54.7,0 +-3,110.1,-55.2,0 +-3,111,-55.6,0 +-3,111.9,-56.1,0 +-3,112.8,-56.5,0 +-3,113.7,-57,0 +-3,114.6,-57.4,0 +-3,115.5,-57.9,0 +-3,116.4,-58.3,0 +-3,117.3,-58.8,0 +-3,118.2,-59.2,0 +-3,119.1,-59.7,0 +-3,120,-60.2,0 +-3,120.9,-60.6,0 +-3,121.8,-61.1,0 +-3,122.7,-61.5,0 +-3,123.6,-62,0 +-3,124.5,-62.4,0 +-3,125.4,-62.9,0 +-3,126.3,-63.3,0 +-3,127.2,-63.8,0 +-3,128.1,-64.2,0 +-3,129,-64.7,0 +-3,129.9,-65.1,0 +-3,130.8,-65.6,0 +-3,131.7,-66,0 +-3,132.6,-66.5,0 +-3,133.5,-66.9,0 +-3,134.4,-67.4,0 +-3,135.3,-67.8,0 +-3,136.2,-68.3,0 +-3,137.1,-68.7,0 +-3,138,-69.2,0 +-3,138.9,-69.6,0 +-3,139.8,-70.1,0 +-3,140.8,-70.6,0 +-3,141.7,-71,0 +-3,142.6,-71.5,0 +-3,143.5,-71.9,0 +-3,144.4,-72.4,0 +-3,145.3,-72.8,0 +-3,146.2,-73.3,0 +-3,147.1,-73.7,0 +-3,148,-74.2,0 +-3,148.9,-74.6,0 +-3,149.8,-75.1,0 +-3,150.7,-75.5,0 +-3,151.6,-76,0 +-3,152.5,-76.4,0 +-3,153.4,-76.9,0 +-3,154.3,-77.3,0 +-3,155.2,-77.8,0 +-3,156.1,-78.2,0 +-3,157,-78.7,0 +-3,157.9,-79.1,0 +-3,158.8,-79.6,0 +-3,159.7,-80.1,0 +-3,160.6,-80.5,0 +-3,161.5,-81,0 +-3,162.4,-81.4,0 +-3,163.3,-81.9,0 +-3,164.2,-82.3,0 +-3,165.1,-82.8,0 +-3,166,-83.2,0 +-3,166.9,-83.7,0 +-3,167.8,-84.1,0 +-3,168.7,-84.6,0 +-3,169.6,-85,0 +-3,170.5,-85.5,0 +-3,171.4,-85.9,0 +-3,172.3,-86.4,0 +-3,173.2,-86.8,0 +-3,174.1,-87.3,0 +-3,175,-87.7,0 +-3,175.9,-88.2,0 +-3,176.8,-88.6,0 +-3,177.7,-89.1,0 +-3,178.6,-89.5,0 +-3,179.5,-90,0 +-3,180.5,0,0 +-3,181.4,0,0 +-3,182.3,0,0 +-3,183.2,0,0 +-3,184.1,0,0 +-3,185,0,0 +-3,185.9,0,0 +-3,186.8,0,0 +-3,187.7,0,0 +-3,188.6,0,0 +-3,189.5,0,0 +-3,190.4,0,0 +-3,191.3,0,0 +-3,192.2,0,0 +-3,193.1,0,0 +-3,194,0,0 +-3,194.9,0,0 +-3,195.8,0,0 +-3,196.7,0,0 +-3,197.6,0,0 +-3,198.5,0,0 +-3,199.4,0,0 +-3,200.3,0,0 +-3,201.2,0,0 +-3,202.1,0,0 +-3,203,0,0 +-3,203.9,0,0 +-3,204.8,0,0 +-3,205.7,0,0 +-3,206.6,0,0 +-3,207.5,0,0 +-3,208.4,0,0 +-3,209.3,0,0 +-3,210.2,0,0 +-3,211.1,0,0 +-3,212,0,0 +-3,212.9,0,0 +-3,213.8,0,0 +-3,214.7,0,0 +-3,215.6,0,0 +-3,216.5,0,0 +-3,217.4,0,0 +-3,218.3,0,0 +-3,219.2,0,0 +-3,220.2,0,0 +-3,221.1,0,0 +-3,222,0,0 +-3,222.9,0,0 +-3,223.8,0,0 +-3,224.7,0,0 +-3,225.6,0,0 +-3,226.5,0,0 +-3,227.4,0,0 +-3,228.3,0,0 +-3,229.2,0,0 +-3,230.1,0,0 +-3,231,0,0 +-3,231.9,0,0 +-3,232.8,0,0 +-3,233.7,0,0 +-3,234.6,0,0 +-3,235.5,0,0 +-3,236.4,0,0 +-3,237.3,0,0 +-3,238.2,0,0 +-3,239.1,0,0 +-3,240,0,0 +-3,240.9,0,0 +-3,241.8,0,0 +-3,242.7,0,0 +-3,243.6,0,0 +-3,244.5,0,0 +-3,245.4,0,0 +-3,246.3,0,0 +-3,247.2,0,0 +-3,248.1,0,0 +-3,249,0,0 +-3,249.9,0,0 +-3,250.8,0,0 +-3,251.7,0,0 +-3,252.6,0,0 +-3,253.5,0,0 +-3,254.4,0,0 +-3,255.3,0,0 +-3,256.2,0,0 +-3,257.1,0,0 +-3,258,0,0 +-3,258.9,0,0 +-3,259.8,0,0 +-3,260.8,0,0 +-3,261.7,0,0 +-3,262.6,0,0 +-3,263.5,0,0 +-3,264.4,0,0 +-3,265.3,0,0 +-3,266.2,0,0 +-3,267.1,0,0 +-3,268,0,0 +-3,268.9,0,0 +-3,269.8,0,0 +-3,270.7,0,0 +-3,271.6,0,0 +-3,272.5,0,0 +-3,273.4,0,0 +-3,274.3,0,0 +-3,275.2,0,0 +-3,276.1,0,0 +-3,277,0,0 +-3,277.9,0,0 +-3,278.8,0,0 +-3,279.7,0,0 +-3,280.6,0,0 +-3,281.5,0,0 +-3,282.4,0,0 +-3,283.3,0,0 +-3,284.2,0,0 +-3,285.1,0,0 +-3,286,0,0 +-3,286.9,0,0 +-3,287.8,0,0 +-3,288.7,0,0 +-3,289.6,0,0 +-3,290.5,0,0 +-3,291.4,0,0 +-3,292.3,0,0 +-3,293.2,0,0 +-3,294.1,0,0 +-3,295,0,0 +-3,295.9,0,0 +-3,296.8,0,0 +-3,297.7,0,0 +-3,298.6,0,0 +-3,299.5,0,0 +-3,300.5,0,0 +-3,301.4,0,0 +-3,302.3,0,0 +-3,303.2,0,0 +-3,304.1,0,0 +-3,305,0,0 +-3,305.9,0,0 +-3,306.8,0,0 +-3,307.7,0,0 +-3,308.6,0,0 +-3,309.5,0,0 +-3,310.4,0,0 +-3,311.3,0,0 +-3,312.2,0,0 +-3,313.1,0,0 +-3,314,0,0 +-3,314.9,0,0 +-3,315.8,0,0 +-3,316.7,0,0 +-3,317.6,0,0 +-3,318.5,0,0 +-3,319.4,0,0 +-3,320.3,0,0 +-3,321.2,0,0 +-3,322.1,0,0 +-3,323,0,0 +-3,323.9,0,0 +-3,324.8,0,0 +-3,325.7,0,0 +-3,326.6,0,0 +-3,327.5,0,0 +-3,328.4,0,0 +-3,329.3,0,0 +-3,330.2,0,0 +-3,331.1,0,0 +-3,332,0,0 +-3,332.9,0,0 +-3,333.8,0,0 +-3,334.7,0,0 +-3,335.6,0,0 +-3,336.5,0,0 +-3,337.4,0,0 +-3,338.3,0,0 +-3,339.2,0,0 +-3,340.2,0,0 +-3,341.1,0,0 +-3,342,0,0 +-3,342.9,0,0 +-3,343.8,0,0 +-3,344.7,0,0 +-3,345.6,0,0 +-3,346.5,0,0 +-3,347.4,0,0 +-3,348.3,0,0 +-3,349.2,0,0 +-3,350.1,0,0 +-3,351,0,0 +-3,351.9,0,0 +-3,352.8,0,0 +-3,353.7,0,0 +-3,354.6,0,0 +-3,355.5,0,0 +-3,356.4,0,0 +-3,357.3,0,0 +-3,358.2,0,0 +-3,359.1,0,0 +-3,360,0,0 +-3,360,0,0 +-3,359.1,0,0 +-3,358.2,0,0 +-3,357.3,0,0 +-3,356.4,0,0 +-3,355.5,0,0 +-3,354.6,0,0 +-3,353.7,0,0 +-3,352.8,0,0 +-3,351.9,0,0 +-3,351,0,0 +-3,350.1,0,0 +-3,349.2,0,0 +-3,348.3,0,0 +-3,347.4,0,0 +-3,346.5,0,0 +-3,345.6,0,0 +-3,344.7,0,0 +-3,343.8,0,0 +-3,342.9,0,0 +-3,342,0,0 +-3,341.1,0,0 +-3,340.2,0,0 +-3,339.2,0,0 +-3,338.3,0,0 +-3,337.4,0,0 +-3,336.5,0,0 +-3,335.6,0,0 +-3,334.7,0,0 +-3,333.8,0,0 +-3,332.9,0,0 +-3,332,0,0 +-3,331.1,0,0 +-3,330.2,0,0 +-3,329.3,0,0 +-3,328.4,0,0 +-3,327.5,0,0 +-3,326.6,0,0 +-3,325.7,0,0 +-3,324.8,0,0 +-3,323.9,0,0 +-3,323,0,0 +-3,322.1,0,0 +-3,321.2,0,0 +-3,320.3,0,0 +-3,319.4,0,0 +-3,318.5,0,0 +-3,317.6,0,0 +-3,316.7,0,0 +-3,315.8,0,0 +-3,314.9,0,0 +-3,314,0,0 +-3,313.1,0,0 +-3,312.2,0,0 +-3,311.3,0,0 +-3,310.4,0,0 +-3,309.5,0,0 +-3,308.6,0,0 +-3,307.7,0,0 +-3,306.8,0,0 +-3,305.9,0,0 +-3,305,0,0 +-3,304.1,0,0 +-3,303.2,0,0 +-3,302.3,0,0 +-3,301.4,0,0 +-3,300.5,0,0 +-3,299.5,0,0 +-3,298.6,0,0 +-3,297.7,0,0 +-3,296.8,0,0 +-3,295.9,0,0 +-3,295,0,0 +-3,294.1,0,0 +-3,293.2,0,0 +-3,292.3,0,0 +-3,291.4,0,0 +-3,290.5,0,0 +-3,289.6,0,0 +-3,288.7,0,0 +-3,287.8,0,0 +-3,286.9,0,0 +-3,286,0,0 +-3,285.1,0,0 +-3,284.2,0,0 +-3,283.3,0,0 +-3,282.4,0,0 +-3,281.5,0,0 +-3,280.6,0,0 +-3,279.7,0,0 +-3,278.8,0,0 +-3,277.9,0,0 +-3,277,0,0 +-3,276.1,0,0 +-3,275.2,0,0 +-3,274.3,0,0 +-3,273.4,0,0 +-3,272.5,0,0 +-3,271.6,0,0 +-3,270.7,0,0 +-3,269.8,0,0 +-3,268.9,0,0 +-3,268,0,0 +-3,267.1,0,0 +-3,266.2,0,0 +-3,265.3,0,0 +-3,264.4,0,0 +-3,263.5,0,0 +-3,262.6,0,0 +-3,261.7,0,0 +-3,260.8,0,0 +-3,259.8,0,0 +-3,258.9,0,0 +-3,258,0,0 +-3,257.1,0,0 +-3,256.2,0,0 +-3,255.3,0,0 +-3,254.4,0,0 +-3,253.5,0,0 +-3,252.6,0,0 +-3,251.7,0,0 +-3,250.8,0,0 +-3,249.9,0,0 +-3,249,0,0 +-3,248.1,0,0 +-3,247.2,0,0 +-3,246.3,0,0 +-3,245.4,0,0 +-3,244.5,0,0 +-3,243.6,0,0 +-3,242.7,0,0 +-3,241.8,0,0 +-3,240.9,0,0 +-3,240,0,0 +-3,239.1,0,0 +-3,238.2,0,0 +-3,237.3,0,0 +-3,236.4,0,0 +-3,235.5,0,0 +-3,234.6,0,0 +-3,233.7,0,0 +-3,232.8,0,0 +-3,231.9,0,0 +-3,231,0,0 +-3,230.1,0,0 +-3,229.2,0,0 +-3,228.3,0,0 +-3,227.4,0,0 +-3,226.5,0,0 +-3,225.6,0,0 +-3,224.7,0,0 +-3,223.8,0,0 +-3,222.9,0,0 +-3,222,0,0 +-3,221.1,0,0 +-3,220.2,0,0 +-3,219.2,0,0 +-3,218.3,0,0 +-3,217.4,0,0 +-3,216.5,0,0 +-3,215.6,0,0 +-3,214.7,0,0 +-3,213.8,0,0 +-3,212.9,0,0 +-3,212,0,0 +-3,211.1,0,0 +-3,210.2,0,0 +-3,209.3,0,0 +-3,208.4,0,0 +-3,207.5,0,0 +-3,206.6,0,0 +-3,205.7,0,0 +-3,204.8,0,0 +-3,203.9,0,0 +-3,203,0,0 +-3,202.1,0,0 +-3,201.2,0,0 +-3,200.3,0,0 +-3,199.4,0,0 +-3,198.5,0,0 +-3,197.6,0,0 +-3,196.7,0,0 +-3,195.8,0,0 +-3,194.9,0,0 +-3,194,0,0 +-3,193.1,0,0 +-3,192.2,0,0 +-3,191.3,0,0 +-3,190.4,0,0 +-3,189.5,0,0 +-3,188.6,0,0 +-3,187.7,0,0 +-3,186.8,0,0 +-3,185.9,0,0 +-3,185,0,0 +-3,184.1,0,0 +-3,183.2,0,0 +-3,182.3,0,0 +-3,181.4,0,0 +-3,180.5,0,0 +-3,179.5,-90,0 +-3,178.6,-89.5,0 +-3,177.7,-89.1,0 +-3,176.8,-88.6,0 +-3,175.9,-88.2,0 +-3,175,-87.7,0 +-3,174.1,-87.3,0 +-3,173.2,-86.8,0 +-3,172.3,-86.4,0 +-3,171.4,-85.9,0 +-3,170.5,-85.5,0 +-3,169.6,-85,0 +-3,168.7,-84.6,0 +-3,167.8,-84.1,0 +-3,166.9,-83.7,0 +-3,166,-83.2,0 +-3,165.1,-82.8,0 +-3,164.2,-82.3,0 +-3,163.3,-81.9,0 +-3,162.4,-81.4,0 +-3,161.5,-81,0 +-3,160.6,-80.5,0 +-3,159.7,-80.1,0 +-3,158.8,-79.6,0 +-3,157.9,-79.1,0 +-3,157,-78.7,0 +-3,156.1,-78.2,0 +-3,155.2,-77.8,0 +-3,154.3,-77.3,0 +-3,153.4,-76.9,0 +-3,152.5,-76.4,0 +-3,151.6,-76,0 +-3,150.7,-75.5,0 +-3,149.8,-75.1,0 +-3,148.9,-74.6,0 +-3,148,-74.2,0 +-3,147.1,-73.7,0 +-3,146.2,-73.3,0 +-3,145.3,-72.8,0 +-3,144.4,-72.4,0 +-3,143.5,-71.9,0 +-3,142.6,-71.5,0 +-3,141.7,-71,0 +-3,140.8,-70.6,0 +-3,139.8,-70.1,0 +-3,138.9,-69.6,0 +-3,138,-69.2,0 +-3,137.1,-68.7,0 +-3,136.2,-68.3,0 +-3,135.3,-67.8,0 +-3,134.4,-67.4,0 +-3,133.5,-66.9,0 +-3,132.6,-66.5,0 +-3,131.7,-66,0 +-3,130.8,-65.6,0 +-3,129.9,-65.1,0 +-3,129,-64.7,0 +-3,128.1,-64.2,0 +-3,127.2,-63.8,0 +-3,126.3,-63.3,0 +-3,125.4,-62.9,0 +-3,124.5,-62.4,0 +-3,123.6,-62,0 +-3,122.7,-61.5,0 +-3,121.8,-61.1,0 +-3,120.9,-60.6,0 +-3,120,-60.2,0 +-3,119.1,-59.7,0 +-3,118.2,-59.2,0 +-3,117.3,-58.8,0 +-3,116.4,-58.3,0 +-3,115.5,-57.9,0 +-3,114.6,-57.4,0 +-3,113.7,-57,0 +-3,112.8,-56.5,0 +-3,111.9,-56.1,0 +-3,111,-55.6,0 +-3,110.1,-55.2,0 +-3,109.2,-54.7,0 +-3,108.3,-54.3,0 +-3,107.4,-53.8,0 +-3,106.5,-53.4,0 +-3,105.6,-52.9,0 +-3,104.7,-52.5,0 +-3,103.8,-52,0 +-3,102.9,-51.6,0 +-3,102,-51.1,0 +-3,101.1,-50.7,0 +-3,100.2,-50.2,0 +-3,99.2,-49.7,0 +-3,98.3,-49.3,0 +-3,97.4,-48.8,0 +-3,96.5,-48.4,0 +-3,95.6,-47.9,0 +-3,94.7,-47.5,0 +-3,93.8,-47,0 +-3,92.9,-46.6,0 +-3,92,-46.1,0 +-3,91.1,-45.7,0 +-3,90.2,-45.2,0 +-3,89.3,-44.8,90 +-3,88.4,-44.3,89.1 +-3,87.5,-43.9,88.2 +-3,86.6,-43.4,87.3 +-3,85.7,-43,86.4 +-3,84.8,-42.5,85.5 +-3,83.9,-42.1,84.5 +-3,83,-41.6,83.6 +-3,82.1,-41.2,82.7 +-3,81.2,-40.7,81.8 +-3,80.3,-40.3,80.9 +-3,79.4,-39.8,80 +-3,78.5,-39.3,79.1 +-3,77.6,-38.9,78.2 +-3,76.7,-38.4,77.3 +-3,75.8,-38,76.4 +-3,74.9,-37.5,75.5 +-3,74,-37.1,74.5 +-3,73.1,-36.6,73.6 +-3,72.2,-36.2,72.7 +-3,71.3,-35.7,71.8 +-3,70.4,-35.3,70.9 +-3,69.5,-34.8,70 +-3,68.6,-34.4,69.1 +-3,67.7,-33.9,68.2 +-3,66.8,-33.5,67.3 +-3,65.9,-33,66.4 +-3,65,-32.6,65.5 +-3,64.1,-32.1,64.5 +-3,63.2,-31.7,63.6 +-3,62.3,-31.2,62.7 +-3,61.4,-30.8,61.8 +-3,60.5,-30.3,60.9 +-3,59.5,-29.8,60 +-3,58.6,-29.4,59.1 +-3,57.7,-28.9,58.2 +-3,56.8,-28.5,57.3 +-3,55.9,-28,56.4 +-3,55,-27.6,55.5 +-3,54.1,-27.1,54.5 +-3,53.2,-26.7,53.6 +-3,52.3,-26.2,52.7 +-3,51.4,-25.8,51.8 +-3,50.5,-25.3,50.9 +-3,49.6,-24.9,50 +-3,48.7,-24.4,49.1 +-3,47.8,-24,48.2 +-3,46.9,-23.5,47.3 +-3,46,-23.1,46.4 +-3,45.1,-22.6,45.5 +-3,44.2,-22.2,44.5 +-3,43.3,-21.7,43.6 +-3,42.4,-21.3,42.7 +-3,41.5,-20.8,41.8 +-3,40.6,-20.4,40.9 +-3,39.7,-19.9,40 +-3,38.8,-19.4,39.1 +-3,37.9,-19,38.2 +-3,37,-18.5,37.3 +-3,36.1,-18.1,36.4 +-3,35.2,-17.6,35.5 +-3,34.3,-17.2,34.5 +-3,33.4,-16.7,33.6 +-3,32.5,-16.3,32.7 +-3,31.6,-15.8,31.8 +-3,30.7,-15.4,30.9 +-3,29.8,-14.9,30 +-3,28.9,-14.5,29.1 +-3,28,-14,28.2 +-3,27.1,-13.6,27.3 +-3,26.2,-13.1,26.4 +-3,25.3,-12.7,25.5 +-3,24.4,-12.2,24.5 +-3,23.5,-11.8,23.6 +-3,22.6,-11.3,22.7 +-3,21.7,-10.9,21.8 +-3,20.8,-10.4,20.9 +-3,19.8,-9.9,20 +-3,18.9,-9.5,19.1 +-3,18,-9,18.2 +-3,17.1,-8.6,17.3 +-3,16.2,-8.1,16.4 +-3,15.3,-7.7,15.5 +-3,14.4,-7.2,14.5 +-3,13.5,-6.8,13.6 +-3,12.6,-6.3,12.7 +-3,11.7,-5.9,11.8 +-3,10.8,-5.4,10.9 +-3,9.9,-5,10 +-3,9,-4.5,9.1 +-3,8.1,-4.1,8.2 +-3,7.2,-3.6,7.3 +-3,6.3,-3.2,6.4 +-3,5.4,-2.7,5.5 +-3,4.5,-2.3,4.5 +-3,3.6,-1.8,3.6 +-3,2.7,-1.4,2.7 +-3,1.8,-0.9,1.8 +-3,0.9,-0.5,0.9 +-3,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +0.9,0,0,0.3 +0.9,0,0,0.3 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.8,0,0,0.5 +0.8,0,0,0.5 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.5,0,0,0.8 +0.5,0,0,0.8 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.3,0,0,0.9 +0.3,0,0,0.9 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,0.9 +0.3,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.8 +0.5,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.7,0,0,0.8 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.8,0,0,0.7 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.5 +0.8,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.3 +0.9,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0 +-3,0,0,0 +-3,0.9,-0.5,0.9 +-3,1.8,-0.9,1.8 +-3,2.7,-1.4,2.7 +-3,3.6,-1.8,3.6 +-3,4.5,-2.3,4.5 +-3,5.4,-2.7,5.5 +-3,6.3,-3.2,6.4 +-3,7.2,-3.6,7.3 +-3,8.1,-4.1,8.2 +-3,9,-4.5,9.1 +-3,9.9,-5,10 +-3,10.8,-5.4,10.9 +-3,11.7,-5.9,11.8 +-3,12.6,-6.3,12.7 +-3,13.5,-6.8,13.6 +-3,14.4,-7.2,14.5 +-3,15.3,-7.7,15.5 +-3,16.2,-8.1,16.4 +-3,17.1,-8.6,17.3 +-3,18,-9,18.2 +-3,18.9,-9.5,19.1 +-3,19.8,-9.9,20 +-3,20.8,-10.4,20.9 +-3,21.7,-10.9,21.8 +-3,22.6,-11.3,22.7 +-3,23.5,-11.8,23.6 +-3,24.4,-12.2,24.5 +-3,25.3,-12.7,25.5 +-3,26.2,-13.1,26.4 +-3,27.1,-13.6,27.3 +-3,28,-14,28.2 +-3,28.9,-14.5,29.1 +-3,29.8,-14.9,30 +-3,30.7,-15.4,30.9 +-3,31.6,-15.8,31.8 +-3,32.5,-16.3,32.7 +-3,33.4,-16.7,33.6 +-3,34.3,-17.2,34.5 +-3,35.2,-17.6,35.5 +-3,36.1,-18.1,36.4 +-3,37,-18.5,37.3 +-3,37.9,-19,38.2 +-3,38.8,-19.4,39.1 +-3,39.7,-19.9,40 +-3,40.6,-20.4,40.9 +-3,41.5,-20.8,41.8 +-3,42.4,-21.3,42.7 +-3,43.3,-21.7,43.6 +-3,44.2,-22.2,44.5 +-3,45.1,-22.6,45.5 +-3,46,-23.1,46.4 +-3,46.9,-23.5,47.3 +-3,47.8,-24,48.2 +-3,48.7,-24.4,49.1 +-3,49.6,-24.9,50 +-3,50.5,-25.3,50.9 +-3,51.4,-25.8,51.8 +-3,52.3,-26.2,52.7 +-3,53.2,-26.7,53.6 +-3,54.1,-27.1,54.5 +-3,55,-27.6,55.5 +-3,55.9,-28,56.4 +-3,56.8,-28.5,57.3 +-3,57.7,-28.9,58.2 +-3,58.6,-29.4,59.1 +-3,59.5,-29.8,60 +-3,60.5,-30.3,60.9 +-3,61.4,-30.8,61.8 +-3,62.3,-31.2,62.7 +-3,63.2,-31.7,63.6 +-3,64.1,-32.1,64.5 +-3,65,-32.6,65.5 +-3,65.9,-33,66.4 +-3,66.8,-33.5,67.3 +-3,67.7,-33.9,68.2 +-3,68.6,-34.4,69.1 +-3,69.5,-34.8,70 +-3,70.4,-35.3,70.9 +-3,71.3,-35.7,71.8 +-3,72.2,-36.2,72.7 +-3,73.1,-36.6,73.6 +-3,74,-37.1,74.5 +-3,74.9,-37.5,75.5 +-3,75.8,-38,76.4 +-3,76.7,-38.4,77.3 +-3,77.6,-38.9,78.2 +-3,78.5,-39.3,79.1 +-3,79.4,-39.8,80 +-3,80.3,-40.3,80.9 +-3,81.2,-40.7,81.8 +-3,82.1,-41.2,82.7 +-3,83,-41.6,83.6 +-3,83.9,-42.1,84.5 +-3,84.8,-42.5,85.5 +-3,85.7,-43,86.4 +-3,86.6,-43.4,87.3 +-3,87.5,-43.9,88.2 +-3,88.4,-44.3,89.1 +-3,89.3,-44.8,90 +-3,90.2,-45.2,0 +-3,91.1,-45.7,0 +-3,92,-46.1,0 +-3,92.9,-46.6,0 +-3,93.8,-47,0 +-3,94.7,-47.5,0 +-3,95.6,-47.9,0 +-3,96.5,-48.4,0 +-3,97.4,-48.8,0 +-3,98.3,-49.3,0 +-3,99.2,-49.7,0 +-3,100.2,-50.2,0 +-3,101.1,-50.7,0 +-3,102,-51.1,0 +-3,102.9,-51.6,0 +-3,103.8,-52,0 +-3,104.7,-52.5,0 +-3,105.6,-52.9,0 +-3,106.5,-53.4,0 +-3,107.4,-53.8,0 +-3,108.3,-54.3,0 +-3,109.2,-54.7,0 +-3,110.1,-55.2,0 +-3,111,-55.6,0 +-3,111.9,-56.1,0 +-3,112.8,-56.5,0 +-3,113.7,-57,0 +-3,114.6,-57.4,0 +-3,115.5,-57.9,0 +-3,116.4,-58.3,0 +-3,117.3,-58.8,0 +-3,118.2,-59.2,0 +-3,119.1,-59.7,0 +-3,120,-60.2,0 +-3,120.9,-60.6,0 +-3,121.8,-61.1,0 +-3,122.7,-61.5,0 +-3,123.6,-62,0 +-3,124.5,-62.4,0 +-3,125.4,-62.9,0 +-3,126.3,-63.3,0 +-3,127.2,-63.8,0 +-3,128.1,-64.2,0 +-3,129,-64.7,0 +-3,129.9,-65.1,0 +-3,130.8,-65.6,0 +-3,131.7,-66,0 +-3,132.6,-66.5,0 +-3,133.5,-66.9,0 +-3,134.4,-67.4,0 +-3,135.3,-67.8,0 +-3,136.2,-68.3,0 +-3,137.1,-68.7,0 +-3,138,-69.2,0 +-3,138.9,-69.6,0 +-3,139.8,-70.1,0 +-3,140.8,-70.6,0 +-3,141.7,-71,0 +-3,142.6,-71.5,0 +-3,143.5,-71.9,0 +-3,144.4,-72.4,0 +-3,145.3,-72.8,0 +-3,146.2,-73.3,0 +-3,147.1,-73.7,0 +-3,148,-74.2,0 +-3,148.9,-74.6,0 +-3,149.8,-75.1,0 +-3,150.7,-75.5,0 +-3,151.6,-76,0 +-3,152.5,-76.4,0 +-3,153.4,-76.9,0 +-3,154.3,-77.3,0 +-3,155.2,-77.8,0 +-3,156.1,-78.2,0 +-3,157,-78.7,0 +-3,157.9,-79.1,0 +-3,158.8,-79.6,0 +-3,159.7,-80.1,0 +-3,160.6,-80.5,0 +-3,161.5,-81,0 +-3,162.4,-81.4,0 +-3,163.3,-81.9,0 +-3,164.2,-82.3,0 +-3,165.1,-82.8,0 +-3,166,-83.2,0 +-3,166.9,-83.7,0 +-3,167.8,-84.1,0 +-3,168.7,-84.6,0 +-3,169.6,-85,0 +-3,170.5,-85.5,0 +-3,171.4,-85.9,0 +-3,172.3,-86.4,0 +-3,173.2,-86.8,0 +-3,174.1,-87.3,0 +-3,175,-87.7,0 +-3,175.9,-88.2,0 +-3,176.8,-88.6,0 +-3,177.7,-89.1,0 +-3,178.6,-89.5,0 +-3,179.5,-90,0 +-3,180.5,0,0 +-3,181.4,0,0 +-3,182.3,0,0 +-3,183.2,0,0 +-3,184.1,0,0 +-3,185,0,0 +-3,185.9,0,0 +-3,186.8,0,0 +-3,187.7,0,0 +-3,188.6,0,0 +-3,189.5,0,0 +-3,190.4,0,0 +-3,191.3,0,0 +-3,192.2,0,0 +-3,193.1,0,0 +-3,194,0,0 +-3,194.9,0,0 +-3,195.8,0,0 +-3,196.7,0,0 +-3,197.6,0,0 +-3,198.5,0,0 +-3,199.4,0,0 +-3,200.3,0,0 +-3,201.2,0,0 +-3,202.1,0,0 +-3,203,0,0 +-3,203.9,0,0 +-3,204.8,0,0 +-3,205.7,0,0 +-3,206.6,0,0 +-3,207.5,0,0 +-3,208.4,0,0 +-3,209.3,0,0 +-3,210.2,0,0 +-3,211.1,0,0 +-3,212,0,0 +-3,212.9,0,0 +-3,213.8,0,0 +-3,214.7,0,0 +-3,215.6,0,0 +-3,216.5,0,0 +-3,217.4,0,0 +-3,218.3,0,0 +-3,219.2,0,0 +-3,220.2,0,0 +-3,221.1,0,0 +-3,222,0,0 +-3,222.9,0,0 +-3,223.8,0,0 +-3,224.7,0,0 +-3,225.6,0,0 +-3,226.5,0,0 +-3,227.4,0,0 +-3,228.3,0,0 +-3,229.2,0,0 +-3,230.1,0,0 +-3,231,0,0 +-3,231.9,0,0 +-3,232.8,0,0 +-3,233.7,0,0 +-3,234.6,0,0 +-3,235.5,0,0 +-3,236.4,0,0 +-3,237.3,0,0 +-3,238.2,0,0 +-3,239.1,0,0 +-3,240,0,0 +-3,240.9,0,0 +-3,241.8,0,0 +-3,242.7,0,0 +-3,243.6,0,0 +-3,244.5,0,0 +-3,245.4,0,0 +-3,246.3,0,0 +-3,247.2,0,0 +-3,248.1,0,0 +-3,249,0,0 +-3,249.9,0,0 +-3,250.8,0,0 +-3,251.7,0,0 +-3,252.6,0,0 +-3,253.5,0,0 +-3,254.4,0,0 +-3,255.3,0,0 +-3,256.2,0,0 +-3,257.1,0,0 +-3,258,0,0 +-3,258.9,0,0 +-3,259.8,0,0 +-3,260.8,0,0 +-3,261.7,0,0 +-3,262.6,0,0 +-3,263.5,0,0 +-3,264.4,0,0 +-3,265.3,0,0 +-3,266.2,0,0 +-3,267.1,0,0 +-3,268,0,0 +-3,268.9,0,0 +-3,269.8,0,0 +-3,270.7,0,0 +-3,271.6,0,0 +-3,272.5,0,0 +-3,273.4,0,0 +-3,274.3,0,0 +-3,275.2,0,0 +-3,276.1,0,0 +-3,277,0,0 +-3,277.9,0,0 +-3,278.8,0,0 +-3,279.7,0,0 +-3,280.6,0,0 +-3,281.5,0,0 +-3,282.4,0,0 +-3,283.3,0,0 +-3,284.2,0,0 +-3,285.1,0,0 +-3,286,0,0 +-3,286.9,0,0 +-3,287.8,0,0 +-3,288.7,0,0 +-3,289.6,0,0 +-3,290.5,0,0 +-3,291.4,0,0 +-3,292.3,0,0 +-3,293.2,0,0 +-3,294.1,0,0 +-3,295,0,0 +-3,295.9,0,0 +-3,296.8,0,0 +-3,297.7,0,0 +-3,298.6,0,0 +-3,299.5,0,0 +-3,300.5,0,0 +-3,301.4,0,0 +-3,302.3,0,0 +-3,303.2,0,0 +-3,304.1,0,0 +-3,305,0,0 +-3,305.9,0,0 +-3,306.8,0,0 +-3,307.7,0,0 +-3,308.6,0,0 +-3,309.5,0,0 +-3,310.4,0,0 +-3,311.3,0,0 +-3,312.2,0,0 +-3,313.1,0,0 +-3,314,0,0 +-3,314.9,0,0 +-3,315.8,0,0 +-3,316.7,0,0 +-3,317.6,0,0 +-3,318.5,0,0 +-3,319.4,0,0 +-3,320.3,0,0 +-3,321.2,0,0 +-3,322.1,0,0 +-3,323,0,0 +-3,323.9,0,0 +-3,324.8,0,0 +-3,325.7,0,0 +-3,326.6,0,0 +-3,327.5,0,0 +-3,328.4,0,0 +-3,329.3,0,0 +-3,330.2,0,0 +-3,331.1,0,0 +-3,332,0,0 +-3,332.9,0,0 +-3,333.8,0,0 +-3,334.7,0,0 +-3,335.6,0,0 +-3,336.5,0,0 +-3,337.4,0,0 +-3,338.3,0,0 +-3,339.2,0,0 +-3,340.2,0,0 +-3,341.1,0,0 +-3,342,0,0 +-3,342.9,0,0 +-3,343.8,0,0 +-3,344.7,0,0 +-3,345.6,0,0 +-3,346.5,0,0 +-3,347.4,0,0 +-3,348.3,0,0 +-3,349.2,0,0 +-3,350.1,0,0 +-3,351,0,0 +-3,351.9,0,0 +-3,352.8,0,0 +-3,353.7,0,0 +-3,354.6,0,0 +-3,355.5,0,0 +-3,356.4,0,0 +-3,357.3,0,0 +-3,358.2,0,0 +-3,359.1,0,0 +-3,360,0,0 diff --git a/scripts/trajectories/rotate_euler_quaternion_30s_delayed.csv b/scripts/trajectories/rotate_euler_quaternion_30s_delayed.csv new file mode 100644 index 0000000000000000000000000000000000000000..7df0cd9c9aa67e9a34426658e37bb2e16924cdb1 --- /dev/null +++ b/scripts/trajectories/rotate_euler_quaternion_30s_delayed.csv @@ -0,0 +1,6020 @@ +-3,360,0,0 +-3,360,0,0 +-3,360,0,0 +-3,360,0,0 +-3,360,0,0 +-3,360,0,0 +-3,360,0,0 +-3,360,0,0 +-3,360,0,0 +-3,360,0,0 +-3,360,0,0 +-3,360,0,0 +-3,360,0,0 +-3,360,0,0 +-3,360,0,0 +-3,360,0,0 +-3,360,0,0 +-3,360,0,0 +-3,360,0,0 +-3,360,0,0 +-3,360,0,0 +-3,359.1,0,0 +-3,358.2,0,0 +-3,357.3,0,0 +-3,356.4,0,0 +-3,355.5,0,0 +-3,354.6,0,0 +-3,353.7,0,0 +-3,352.8,0,0 +-3,351.9,0,0 +-3,351,0,0 +-3,350.1,0,0 +-3,349.2,0,0 +-3,348.3,0,0 +-3,347.4,0,0 +-3,346.5,0,0 +-3,345.6,0,0 +-3,344.7,0,0 +-3,343.8,0,0 +-3,342.9,0,0 +-3,342,0,0 +-3,341.1,0,0 +-3,340.2,0,0 +-3,339.2,0,0 +-3,338.3,0,0 +-3,337.4,0,0 +-3,336.5,0,0 +-3,335.6,0,0 +-3,334.7,0,0 +-3,333.8,0,0 +-3,332.9,0,0 +-3,332,0,0 +-3,331.1,0,0 +-3,330.2,0,0 +-3,329.3,0,0 +-3,328.4,0,0 +-3,327.5,0,0 +-3,326.6,0,0 +-3,325.7,0,0 +-3,324.8,0,0 +-3,323.9,0,0 +-3,323,0,0 +-3,322.1,0,0 +-3,321.2,0,0 +-3,320.3,0,0 +-3,319.4,0,0 +-3,318.5,0,0 +-3,317.6,0,0 +-3,316.7,0,0 +-3,315.8,0,0 +-3,314.9,0,0 +-3,314,0,0 +-3,313.1,0,0 +-3,312.2,0,0 +-3,311.3,0,0 +-3,310.4,0,0 +-3,309.5,0,0 +-3,308.6,0,0 +-3,307.7,0,0 +-3,306.8,0,0 +-3,305.9,0,0 +-3,305,0,0 +-3,304.1,0,0 +-3,303.2,0,0 +-3,302.3,0,0 +-3,301.4,0,0 +-3,300.5,0,0 +-3,299.5,0,0 +-3,298.6,0,0 +-3,297.7,0,0 +-3,296.8,0,0 +-3,295.9,0,0 +-3,295,0,0 +-3,294.1,0,0 +-3,293.2,0,0 +-3,292.3,0,0 +-3,291.4,0,0 +-3,290.5,0,0 +-3,289.6,0,0 +-3,288.7,0,0 +-3,287.8,0,0 +-3,286.9,0,0 +-3,286,0,0 +-3,285.1,0,0 +-3,284.2,0,0 +-3,283.3,0,0 +-3,282.4,0,0 +-3,281.5,0,0 +-3,280.6,0,0 +-3,279.7,0,0 +-3,278.8,0,0 +-3,277.9,0,0 +-3,277,0,0 +-3,276.1,0,0 +-3,275.2,0,0 +-3,274.3,0,0 +-3,273.4,0,0 +-3,272.5,0,0 +-3,271.6,0,0 +-3,270.7,0,0 +-3,269.8,0,0 +-3,268.9,0,0 +-3,268,0,0 +-3,267.1,0,0 +-3,266.2,0,0 +-3,265.3,0,0 +-3,264.4,0,0 +-3,263.5,0,0 +-3,262.6,0,0 +-3,261.7,0,0 +-3,260.8,0,0 +-3,259.8,0,0 +-3,258.9,0,0 +-3,258,0,0 +-3,257.1,0,0 +-3,256.2,0,0 +-3,255.3,0,0 +-3,254.4,0,0 +-3,253.5,0,0 +-3,252.6,0,0 +-3,251.7,0,0 +-3,250.8,0,0 +-3,249.9,0,0 +-3,249,0,0 +-3,248.1,0,0 +-3,247.2,0,0 +-3,246.3,0,0 +-3,245.4,0,0 +-3,244.5,0,0 +-3,243.6,0,0 +-3,242.7,0,0 +-3,241.8,0,0 +-3,240.9,0,0 +-3,240,0,0 +-3,239.1,0,0 +-3,238.2,0,0 +-3,237.3,0,0 +-3,236.4,0,0 +-3,235.5,0,0 +-3,234.6,0,0 +-3,233.7,0,0 +-3,232.8,0,0 +-3,231.9,0,0 +-3,231,0,0 +-3,230.1,0,0 +-3,229.2,0,0 +-3,228.3,0,0 +-3,227.4,0,0 +-3,226.5,0,0 +-3,225.6,0,0 +-3,224.7,0,0 +-3,223.8,0,0 +-3,222.9,0,0 +-3,222,0,0 +-3,221.1,0,0 +-3,220.2,0,0 +-3,219.2,0,0 +-3,218.3,0,0 +-3,217.4,0,0 +-3,216.5,0,0 +-3,215.6,0,0 +-3,214.7,0,0 +-3,213.8,0,0 +-3,212.9,0,0 +-3,212,0,0 +-3,211.1,0,0 +-3,210.2,0,0 +-3,209.3,0,0 +-3,208.4,0,0 +-3,207.5,0,0 +-3,206.6,0,0 +-3,205.7,0,0 +-3,204.8,0,0 +-3,203.9,0,0 +-3,203,0,0 +-3,202.1,0,0 +-3,201.2,0,0 +-3,200.3,0,0 +-3,199.4,0,0 +-3,198.5,0,0 +-3,197.6,0,0 +-3,196.7,0,0 +-3,195.8,0,0 +-3,194.9,0,0 +-3,194,0,0 +-3,193.1,0,0 +-3,192.2,0,0 +-3,191.3,0,0 +-3,190.4,0,0 +-3,189.5,0,0 +-3,188.6,0,0 +-3,187.7,0,0 +-3,186.8,0,0 +-3,185.9,0,0 +-3,185,0,0 +-3,184.1,0,0 +-3,183.2,0,0 +-3,182.3,0,0 +-3,181.4,0,0 +-3,180.5,0,0 +-3,179.5,-90,0 +-3,178.6,-89.5,0 +-3,177.7,-89.1,0 +-3,176.8,-88.6,0 +-3,175.9,-88.2,0 +-3,175,-87.7,0 +-3,174.1,-87.3,0 +-3,173.2,-86.8,0 +-3,172.3,-86.4,0 +-3,171.4,-85.9,0 +-3,170.5,-85.5,0 +-3,169.6,-85,0 +-3,168.7,-84.6,0 +-3,167.8,-84.1,0 +-3,166.9,-83.7,0 +-3,166,-83.2,0 +-3,165.1,-82.8,0 +-3,164.2,-82.3,0 +-3,163.3,-81.9,0 +-3,162.4,-81.4,0 +-3,161.5,-81,0 +-3,160.6,-80.5,0 +-3,159.7,-80.1,0 +-3,158.8,-79.6,0 +-3,157.9,-79.1,0 +-3,157,-78.7,0 +-3,156.1,-78.2,0 +-3,155.2,-77.8,0 +-3,154.3,-77.3,0 +-3,153.4,-76.9,0 +-3,152.5,-76.4,0 +-3,151.6,-76,0 +-3,150.7,-75.5,0 +-3,149.8,-75.1,0 +-3,148.9,-74.6,0 +-3,148,-74.2,0 +-3,147.1,-73.7,0 +-3,146.2,-73.3,0 +-3,145.3,-72.8,0 +-3,144.4,-72.4,0 +-3,143.5,-71.9,0 +-3,142.6,-71.5,0 +-3,141.7,-71,0 +-3,140.8,-70.6,0 +-3,139.8,-70.1,0 +-3,138.9,-69.6,0 +-3,138,-69.2,0 +-3,137.1,-68.7,0 +-3,136.2,-68.3,0 +-3,135.3,-67.8,0 +-3,134.4,-67.4,0 +-3,133.5,-66.9,0 +-3,132.6,-66.5,0 +-3,131.7,-66,0 +-3,130.8,-65.6,0 +-3,129.9,-65.1,0 +-3,129,-64.7,0 +-3,128.1,-64.2,0 +-3,127.2,-63.8,0 +-3,126.3,-63.3,0 +-3,125.4,-62.9,0 +-3,124.5,-62.4,0 +-3,123.6,-62,0 +-3,122.7,-61.5,0 +-3,121.8,-61.1,0 +-3,120.9,-60.6,0 +-3,120,-60.2,0 +-3,119.1,-59.7,0 +-3,118.2,-59.2,0 +-3,117.3,-58.8,0 +-3,116.4,-58.3,0 +-3,115.5,-57.9,0 +-3,114.6,-57.4,0 +-3,113.7,-57,0 +-3,112.8,-56.5,0 +-3,111.9,-56.1,0 +-3,111,-55.6,0 +-3,110.1,-55.2,0 +-3,109.2,-54.7,0 +-3,108.3,-54.3,0 +-3,107.4,-53.8,0 +-3,106.5,-53.4,0 +-3,105.6,-52.9,0 +-3,104.7,-52.5,0 +-3,103.8,-52,0 +-3,102.9,-51.6,0 +-3,102,-51.1,0 +-3,101.1,-50.7,0 +-3,100.2,-50.2,0 +-3,99.2,-49.7,0 +-3,98.3,-49.3,0 +-3,97.4,-48.8,0 +-3,96.5,-48.4,0 +-3,95.6,-47.9,0 +-3,94.7,-47.5,0 +-3,93.8,-47,0 +-3,92.9,-46.6,0 +-3,92,-46.1,0 +-3,91.1,-45.7,0 +-3,90.2,-45.2,0 +-3,89.3,-44.8,90 +-3,88.4,-44.3,89.1 +-3,87.5,-43.9,88.2 +-3,86.6,-43.4,87.3 +-3,85.7,-43,86.4 +-3,84.8,-42.5,85.5 +-3,83.9,-42.1,84.5 +-3,83,-41.6,83.6 +-3,82.1,-41.2,82.7 +-3,81.2,-40.7,81.8 +-3,80.3,-40.3,80.9 +-3,79.4,-39.8,80 +-3,78.5,-39.3,79.1 +-3,77.6,-38.9,78.2 +-3,76.7,-38.4,77.3 +-3,75.8,-38,76.4 +-3,74.9,-37.5,75.5 +-3,74,-37.1,74.5 +-3,73.1,-36.6,73.6 +-3,72.2,-36.2,72.7 +-3,71.3,-35.7,71.8 +-3,70.4,-35.3,70.9 +-3,69.5,-34.8,70 +-3,68.6,-34.4,69.1 +-3,67.7,-33.9,68.2 +-3,66.8,-33.5,67.3 +-3,65.9,-33,66.4 +-3,65,-32.6,65.5 +-3,64.1,-32.1,64.5 +-3,63.2,-31.7,63.6 +-3,62.3,-31.2,62.7 +-3,61.4,-30.8,61.8 +-3,60.5,-30.3,60.9 +-3,59.5,-29.8,60 +-3,58.6,-29.4,59.1 +-3,57.7,-28.9,58.2 +-3,56.8,-28.5,57.3 +-3,55.9,-28,56.4 +-3,55,-27.6,55.5 +-3,54.1,-27.1,54.5 +-3,53.2,-26.7,53.6 +-3,52.3,-26.2,52.7 +-3,51.4,-25.8,51.8 +-3,50.5,-25.3,50.9 +-3,49.6,-24.9,50 +-3,48.7,-24.4,49.1 +-3,47.8,-24,48.2 +-3,46.9,-23.5,47.3 +-3,46,-23.1,46.4 +-3,45.1,-22.6,45.5 +-3,44.2,-22.2,44.5 +-3,43.3,-21.7,43.6 +-3,42.4,-21.3,42.7 +-3,41.5,-20.8,41.8 +-3,40.6,-20.4,40.9 +-3,39.7,-19.9,40 +-3,38.8,-19.4,39.1 +-3,37.9,-19,38.2 +-3,37,-18.5,37.3 +-3,36.1,-18.1,36.4 +-3,35.2,-17.6,35.5 +-3,34.3,-17.2,34.5 +-3,33.4,-16.7,33.6 +-3,32.5,-16.3,32.7 +-3,31.6,-15.8,31.8 +-3,30.7,-15.4,30.9 +-3,29.8,-14.9,30 +-3,28.9,-14.5,29.1 +-3,28,-14,28.2 +-3,27.1,-13.6,27.3 +-3,26.2,-13.1,26.4 +-3,25.3,-12.7,25.5 +-3,24.4,-12.2,24.5 +-3,23.5,-11.8,23.6 +-3,22.6,-11.3,22.7 +-3,21.7,-10.9,21.8 +-3,20.8,-10.4,20.9 +-3,19.8,-9.9,20 +-3,18.9,-9.5,19.1 +-3,18,-9,18.2 +-3,17.1,-8.6,17.3 +-3,16.2,-8.1,16.4 +-3,15.3,-7.7,15.5 +-3,14.4,-7.2,14.5 +-3,13.5,-6.8,13.6 +-3,12.6,-6.3,12.7 +-3,11.7,-5.9,11.8 +-3,10.8,-5.4,10.9 +-3,9.9,-5,10 +-3,9,-4.5,9.1 +-3,8.1,-4.1,8.2 +-3,7.2,-3.6,7.3 +-3,6.3,-3.2,6.4 +-3,5.4,-2.7,5.5 +-3,4.5,-2.3,4.5 +-3,3.6,-1.8,3.6 +-3,2.7,-1.4,2.7 +-3,1.8,-0.9,1.8 +-3,0.9,-0.5,0.9 +-3,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +0.9,0,0,0.3 +0.9,0,0,0.3 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.8,0,0,0.5 +0.8,0,0,0.5 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.5,0,0,0.8 +0.5,0,0,0.8 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.3,0,0,0.9 +0.3,0,0,0.9 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,0.9 +0.3,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.8 +0.5,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.7,0,0,0.8 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.8,0,0,0.7 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.5 +0.8,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.3 +0.9,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0 +-3,0,0,0 +-3,0.9,-0.5,0.9 +-3,1.8,-0.9,1.8 +-3,2.7,-1.4,2.7 +-3,3.6,-1.8,3.6 +-3,4.5,-2.3,4.5 +-3,5.4,-2.7,5.5 +-3,6.3,-3.2,6.4 +-3,7.2,-3.6,7.3 +-3,8.1,-4.1,8.2 +-3,9,-4.5,9.1 +-3,9.9,-5,10 +-3,10.8,-5.4,10.9 +-3,11.7,-5.9,11.8 +-3,12.6,-6.3,12.7 +-3,13.5,-6.8,13.6 +-3,14.4,-7.2,14.5 +-3,15.3,-7.7,15.5 +-3,16.2,-8.1,16.4 +-3,17.1,-8.6,17.3 +-3,18,-9,18.2 +-3,18.9,-9.5,19.1 +-3,19.8,-9.9,20 +-3,20.8,-10.4,20.9 +-3,21.7,-10.9,21.8 +-3,22.6,-11.3,22.7 +-3,23.5,-11.8,23.6 +-3,24.4,-12.2,24.5 +-3,25.3,-12.7,25.5 +-3,26.2,-13.1,26.4 +-3,27.1,-13.6,27.3 +-3,28,-14,28.2 +-3,28.9,-14.5,29.1 +-3,29.8,-14.9,30 +-3,30.7,-15.4,30.9 +-3,31.6,-15.8,31.8 +-3,32.5,-16.3,32.7 +-3,33.4,-16.7,33.6 +-3,34.3,-17.2,34.5 +-3,35.2,-17.6,35.5 +-3,36.1,-18.1,36.4 +-3,37,-18.5,37.3 +-3,37.9,-19,38.2 +-3,38.8,-19.4,39.1 +-3,39.7,-19.9,40 +-3,40.6,-20.4,40.9 +-3,41.5,-20.8,41.8 +-3,42.4,-21.3,42.7 +-3,43.3,-21.7,43.6 +-3,44.2,-22.2,44.5 +-3,45.1,-22.6,45.5 +-3,46,-23.1,46.4 +-3,46.9,-23.5,47.3 +-3,47.8,-24,48.2 +-3,48.7,-24.4,49.1 +-3,49.6,-24.9,50 +-3,50.5,-25.3,50.9 +-3,51.4,-25.8,51.8 +-3,52.3,-26.2,52.7 +-3,53.2,-26.7,53.6 +-3,54.1,-27.1,54.5 +-3,55,-27.6,55.5 +-3,55.9,-28,56.4 +-3,56.8,-28.5,57.3 +-3,57.7,-28.9,58.2 +-3,58.6,-29.4,59.1 +-3,59.5,-29.8,60 +-3,60.5,-30.3,60.9 +-3,61.4,-30.8,61.8 +-3,62.3,-31.2,62.7 +-3,63.2,-31.7,63.6 +-3,64.1,-32.1,64.5 +-3,65,-32.6,65.5 +-3,65.9,-33,66.4 +-3,66.8,-33.5,67.3 +-3,67.7,-33.9,68.2 +-3,68.6,-34.4,69.1 +-3,69.5,-34.8,70 +-3,70.4,-35.3,70.9 +-3,71.3,-35.7,71.8 +-3,72.2,-36.2,72.7 +-3,73.1,-36.6,73.6 +-3,74,-37.1,74.5 +-3,74.9,-37.5,75.5 +-3,75.8,-38,76.4 +-3,76.7,-38.4,77.3 +-3,77.6,-38.9,78.2 +-3,78.5,-39.3,79.1 +-3,79.4,-39.8,80 +-3,80.3,-40.3,80.9 +-3,81.2,-40.7,81.8 +-3,82.1,-41.2,82.7 +-3,83,-41.6,83.6 +-3,83.9,-42.1,84.5 +-3,84.8,-42.5,85.5 +-3,85.7,-43,86.4 +-3,86.6,-43.4,87.3 +-3,87.5,-43.9,88.2 +-3,88.4,-44.3,89.1 +-3,89.3,-44.8,90 +-3,90.2,-45.2,0 +-3,91.1,-45.7,0 +-3,92,-46.1,0 +-3,92.9,-46.6,0 +-3,93.8,-47,0 +-3,94.7,-47.5,0 +-3,95.6,-47.9,0 +-3,96.5,-48.4,0 +-3,97.4,-48.8,0 +-3,98.3,-49.3,0 +-3,99.2,-49.7,0 +-3,100.2,-50.2,0 +-3,101.1,-50.7,0 +-3,102,-51.1,0 +-3,102.9,-51.6,0 +-3,103.8,-52,0 +-3,104.7,-52.5,0 +-3,105.6,-52.9,0 +-3,106.5,-53.4,0 +-3,107.4,-53.8,0 +-3,108.3,-54.3,0 +-3,109.2,-54.7,0 +-3,110.1,-55.2,0 +-3,111,-55.6,0 +-3,111.9,-56.1,0 +-3,112.8,-56.5,0 +-3,113.7,-57,0 +-3,114.6,-57.4,0 +-3,115.5,-57.9,0 +-3,116.4,-58.3,0 +-3,117.3,-58.8,0 +-3,118.2,-59.2,0 +-3,119.1,-59.7,0 +-3,120,-60.2,0 +-3,120.9,-60.6,0 +-3,121.8,-61.1,0 +-3,122.7,-61.5,0 +-3,123.6,-62,0 +-3,124.5,-62.4,0 +-3,125.4,-62.9,0 +-3,126.3,-63.3,0 +-3,127.2,-63.8,0 +-3,128.1,-64.2,0 +-3,129,-64.7,0 +-3,129.9,-65.1,0 +-3,130.8,-65.6,0 +-3,131.7,-66,0 +-3,132.6,-66.5,0 +-3,133.5,-66.9,0 +-3,134.4,-67.4,0 +-3,135.3,-67.8,0 +-3,136.2,-68.3,0 +-3,137.1,-68.7,0 +-3,138,-69.2,0 +-3,138.9,-69.6,0 +-3,139.8,-70.1,0 +-3,140.8,-70.6,0 +-3,141.7,-71,0 +-3,142.6,-71.5,0 +-3,143.5,-71.9,0 +-3,144.4,-72.4,0 +-3,145.3,-72.8,0 +-3,146.2,-73.3,0 +-3,147.1,-73.7,0 +-3,148,-74.2,0 +-3,148.9,-74.6,0 +-3,149.8,-75.1,0 +-3,150.7,-75.5,0 +-3,151.6,-76,0 +-3,152.5,-76.4,0 +-3,153.4,-76.9,0 +-3,154.3,-77.3,0 +-3,155.2,-77.8,0 +-3,156.1,-78.2,0 +-3,157,-78.7,0 +-3,157.9,-79.1,0 +-3,158.8,-79.6,0 +-3,159.7,-80.1,0 +-3,160.6,-80.5,0 +-3,161.5,-81,0 +-3,162.4,-81.4,0 +-3,163.3,-81.9,0 +-3,164.2,-82.3,0 +-3,165.1,-82.8,0 +-3,166,-83.2,0 +-3,166.9,-83.7,0 +-3,167.8,-84.1,0 +-3,168.7,-84.6,0 +-3,169.6,-85,0 +-3,170.5,-85.5,0 +-3,171.4,-85.9,0 +-3,172.3,-86.4,0 +-3,173.2,-86.8,0 +-3,174.1,-87.3,0 +-3,175,-87.7,0 +-3,175.9,-88.2,0 +-3,176.8,-88.6,0 +-3,177.7,-89.1,0 +-3,178.6,-89.5,0 +-3,179.5,-90,0 +-3,180.5,0,0 +-3,181.4,0,0 +-3,182.3,0,0 +-3,183.2,0,0 +-3,184.1,0,0 +-3,185,0,0 +-3,185.9,0,0 +-3,186.8,0,0 +-3,187.7,0,0 +-3,188.6,0,0 +-3,189.5,0,0 +-3,190.4,0,0 +-3,191.3,0,0 +-3,192.2,0,0 +-3,193.1,0,0 +-3,194,0,0 +-3,194.9,0,0 +-3,195.8,0,0 +-3,196.7,0,0 +-3,197.6,0,0 +-3,198.5,0,0 +-3,199.4,0,0 +-3,200.3,0,0 +-3,201.2,0,0 +-3,202.1,0,0 +-3,203,0,0 +-3,203.9,0,0 +-3,204.8,0,0 +-3,205.7,0,0 +-3,206.6,0,0 +-3,207.5,0,0 +-3,208.4,0,0 +-3,209.3,0,0 +-3,210.2,0,0 +-3,211.1,0,0 +-3,212,0,0 +-3,212.9,0,0 +-3,213.8,0,0 +-3,214.7,0,0 +-3,215.6,0,0 +-3,216.5,0,0 +-3,217.4,0,0 +-3,218.3,0,0 +-3,219.2,0,0 +-3,220.2,0,0 +-3,221.1,0,0 +-3,222,0,0 +-3,222.9,0,0 +-3,223.8,0,0 +-3,224.7,0,0 +-3,225.6,0,0 +-3,226.5,0,0 +-3,227.4,0,0 +-3,228.3,0,0 +-3,229.2,0,0 +-3,230.1,0,0 +-3,231,0,0 +-3,231.9,0,0 +-3,232.8,0,0 +-3,233.7,0,0 +-3,234.6,0,0 +-3,235.5,0,0 +-3,236.4,0,0 +-3,237.3,0,0 +-3,238.2,0,0 +-3,239.1,0,0 +-3,240,0,0 +-3,240.9,0,0 +-3,241.8,0,0 +-3,242.7,0,0 +-3,243.6,0,0 +-3,244.5,0,0 +-3,245.4,0,0 +-3,246.3,0,0 +-3,247.2,0,0 +-3,248.1,0,0 +-3,249,0,0 +-3,249.9,0,0 +-3,250.8,0,0 +-3,251.7,0,0 +-3,252.6,0,0 +-3,253.5,0,0 +-3,254.4,0,0 +-3,255.3,0,0 +-3,256.2,0,0 +-3,257.1,0,0 +-3,258,0,0 +-3,258.9,0,0 +-3,259.8,0,0 +-3,260.8,0,0 +-3,261.7,0,0 +-3,262.6,0,0 +-3,263.5,0,0 +-3,264.4,0,0 +-3,265.3,0,0 +-3,266.2,0,0 +-3,267.1,0,0 +-3,268,0,0 +-3,268.9,0,0 +-3,269.8,0,0 +-3,270.7,0,0 +-3,271.6,0,0 +-3,272.5,0,0 +-3,273.4,0,0 +-3,274.3,0,0 +-3,275.2,0,0 +-3,276.1,0,0 +-3,277,0,0 +-3,277.9,0,0 +-3,278.8,0,0 +-3,279.7,0,0 +-3,280.6,0,0 +-3,281.5,0,0 +-3,282.4,0,0 +-3,283.3,0,0 +-3,284.2,0,0 +-3,285.1,0,0 +-3,286,0,0 +-3,286.9,0,0 +-3,287.8,0,0 +-3,288.7,0,0 +-3,289.6,0,0 +-3,290.5,0,0 +-3,291.4,0,0 +-3,292.3,0,0 +-3,293.2,0,0 +-3,294.1,0,0 +-3,295,0,0 +-3,295.9,0,0 +-3,296.8,0,0 +-3,297.7,0,0 +-3,298.6,0,0 +-3,299.5,0,0 +-3,300.5,0,0 +-3,301.4,0,0 +-3,302.3,0,0 +-3,303.2,0,0 +-3,304.1,0,0 +-3,305,0,0 +-3,305.9,0,0 +-3,306.8,0,0 +-3,307.7,0,0 +-3,308.6,0,0 +-3,309.5,0,0 +-3,310.4,0,0 +-3,311.3,0,0 +-3,312.2,0,0 +-3,313.1,0,0 +-3,314,0,0 +-3,314.9,0,0 +-3,315.8,0,0 +-3,316.7,0,0 +-3,317.6,0,0 +-3,318.5,0,0 +-3,319.4,0,0 +-3,320.3,0,0 +-3,321.2,0,0 +-3,322.1,0,0 +-3,323,0,0 +-3,323.9,0,0 +-3,324.8,0,0 +-3,325.7,0,0 +-3,326.6,0,0 +-3,327.5,0,0 +-3,328.4,0,0 +-3,329.3,0,0 +-3,330.2,0,0 +-3,331.1,0,0 +-3,332,0,0 +-3,332.9,0,0 +-3,333.8,0,0 +-3,334.7,0,0 +-3,335.6,0,0 +-3,336.5,0,0 +-3,337.4,0,0 +-3,338.3,0,0 +-3,339.2,0,0 +-3,340.2,0,0 +-3,341.1,0,0 +-3,342,0,0 +-3,342.9,0,0 +-3,343.8,0,0 +-3,344.7,0,0 +-3,345.6,0,0 +-3,346.5,0,0 +-3,347.4,0,0 +-3,348.3,0,0 +-3,349.2,0,0 +-3,350.1,0,0 +-3,351,0,0 +-3,351.9,0,0 +-3,352.8,0,0 +-3,353.7,0,0 +-3,354.6,0,0 +-3,355.5,0,0 +-3,356.4,0,0 +-3,357.3,0,0 +-3,358.2,0,0 +-3,359.1,0,0 +-3,360,0,0 +-3,360,0,0 +-3,359.1,0,0 +-3,358.2,0,0 +-3,357.3,0,0 +-3,356.4,0,0 +-3,355.5,0,0 +-3,354.6,0,0 +-3,353.7,0,0 +-3,352.8,0,0 +-3,351.9,0,0 +-3,351,0,0 +-3,350.1,0,0 +-3,349.2,0,0 +-3,348.3,0,0 +-3,347.4,0,0 +-3,346.5,0,0 +-3,345.6,0,0 +-3,344.7,0,0 +-3,343.8,0,0 +-3,342.9,0,0 +-3,342,0,0 +-3,341.1,0,0 +-3,340.2,0,0 +-3,339.2,0,0 +-3,338.3,0,0 +-3,337.4,0,0 +-3,336.5,0,0 +-3,335.6,0,0 +-3,334.7,0,0 +-3,333.8,0,0 +-3,332.9,0,0 +-3,332,0,0 +-3,331.1,0,0 +-3,330.2,0,0 +-3,329.3,0,0 +-3,328.4,0,0 +-3,327.5,0,0 +-3,326.6,0,0 +-3,325.7,0,0 +-3,324.8,0,0 +-3,323.9,0,0 +-3,323,0,0 +-3,322.1,0,0 +-3,321.2,0,0 +-3,320.3,0,0 +-3,319.4,0,0 +-3,318.5,0,0 +-3,317.6,0,0 +-3,316.7,0,0 +-3,315.8,0,0 +-3,314.9,0,0 +-3,314,0,0 +-3,313.1,0,0 +-3,312.2,0,0 +-3,311.3,0,0 +-3,310.4,0,0 +-3,309.5,0,0 +-3,308.6,0,0 +-3,307.7,0,0 +-3,306.8,0,0 +-3,305.9,0,0 +-3,305,0,0 +-3,304.1,0,0 +-3,303.2,0,0 +-3,302.3,0,0 +-3,301.4,0,0 +-3,300.5,0,0 +-3,299.5,0,0 +-3,298.6,0,0 +-3,297.7,0,0 +-3,296.8,0,0 +-3,295.9,0,0 +-3,295,0,0 +-3,294.1,0,0 +-3,293.2,0,0 +-3,292.3,0,0 +-3,291.4,0,0 +-3,290.5,0,0 +-3,289.6,0,0 +-3,288.7,0,0 +-3,287.8,0,0 +-3,286.9,0,0 +-3,286,0,0 +-3,285.1,0,0 +-3,284.2,0,0 +-3,283.3,0,0 +-3,282.4,0,0 +-3,281.5,0,0 +-3,280.6,0,0 +-3,279.7,0,0 +-3,278.8,0,0 +-3,277.9,0,0 +-3,277,0,0 +-3,276.1,0,0 +-3,275.2,0,0 +-3,274.3,0,0 +-3,273.4,0,0 +-3,272.5,0,0 +-3,271.6,0,0 +-3,270.7,0,0 +-3,269.8,0,0 +-3,268.9,0,0 +-3,268,0,0 +-3,267.1,0,0 +-3,266.2,0,0 +-3,265.3,0,0 +-3,264.4,0,0 +-3,263.5,0,0 +-3,262.6,0,0 +-3,261.7,0,0 +-3,260.8,0,0 +-3,259.8,0,0 +-3,258.9,0,0 +-3,258,0,0 +-3,257.1,0,0 +-3,256.2,0,0 +-3,255.3,0,0 +-3,254.4,0,0 +-3,253.5,0,0 +-3,252.6,0,0 +-3,251.7,0,0 +-3,250.8,0,0 +-3,249.9,0,0 +-3,249,0,0 +-3,248.1,0,0 +-3,247.2,0,0 +-3,246.3,0,0 +-3,245.4,0,0 +-3,244.5,0,0 +-3,243.6,0,0 +-3,242.7,0,0 +-3,241.8,0,0 +-3,240.9,0,0 +-3,240,0,0 +-3,239.1,0,0 +-3,238.2,0,0 +-3,237.3,0,0 +-3,236.4,0,0 +-3,235.5,0,0 +-3,234.6,0,0 +-3,233.7,0,0 +-3,232.8,0,0 +-3,231.9,0,0 +-3,231,0,0 +-3,230.1,0,0 +-3,229.2,0,0 +-3,228.3,0,0 +-3,227.4,0,0 +-3,226.5,0,0 +-3,225.6,0,0 +-3,224.7,0,0 +-3,223.8,0,0 +-3,222.9,0,0 +-3,222,0,0 +-3,221.1,0,0 +-3,220.2,0,0 +-3,219.2,0,0 +-3,218.3,0,0 +-3,217.4,0,0 +-3,216.5,0,0 +-3,215.6,0,0 +-3,214.7,0,0 +-3,213.8,0,0 +-3,212.9,0,0 +-3,212,0,0 +-3,211.1,0,0 +-3,210.2,0,0 +-3,209.3,0,0 +-3,208.4,0,0 +-3,207.5,0,0 +-3,206.6,0,0 +-3,205.7,0,0 +-3,204.8,0,0 +-3,203.9,0,0 +-3,203,0,0 +-3,202.1,0,0 +-3,201.2,0,0 +-3,200.3,0,0 +-3,199.4,0,0 +-3,198.5,0,0 +-3,197.6,0,0 +-3,196.7,0,0 +-3,195.8,0,0 +-3,194.9,0,0 +-3,194,0,0 +-3,193.1,0,0 +-3,192.2,0,0 +-3,191.3,0,0 +-3,190.4,0,0 +-3,189.5,0,0 +-3,188.6,0,0 +-3,187.7,0,0 +-3,186.8,0,0 +-3,185.9,0,0 +-3,185,0,0 +-3,184.1,0,0 +-3,183.2,0,0 +-3,182.3,0,0 +-3,181.4,0,0 +-3,180.5,0,0 +-3,179.5,-90,0 +-3,178.6,-89.5,0 +-3,177.7,-89.1,0 +-3,176.8,-88.6,0 +-3,175.9,-88.2,0 +-3,175,-87.7,0 +-3,174.1,-87.3,0 +-3,173.2,-86.8,0 +-3,172.3,-86.4,0 +-3,171.4,-85.9,0 +-3,170.5,-85.5,0 +-3,169.6,-85,0 +-3,168.7,-84.6,0 +-3,167.8,-84.1,0 +-3,166.9,-83.7,0 +-3,166,-83.2,0 +-3,165.1,-82.8,0 +-3,164.2,-82.3,0 +-3,163.3,-81.9,0 +-3,162.4,-81.4,0 +-3,161.5,-81,0 +-3,160.6,-80.5,0 +-3,159.7,-80.1,0 +-3,158.8,-79.6,0 +-3,157.9,-79.1,0 +-3,157,-78.7,0 +-3,156.1,-78.2,0 +-3,155.2,-77.8,0 +-3,154.3,-77.3,0 +-3,153.4,-76.9,0 +-3,152.5,-76.4,0 +-3,151.6,-76,0 +-3,150.7,-75.5,0 +-3,149.8,-75.1,0 +-3,148.9,-74.6,0 +-3,148,-74.2,0 +-3,147.1,-73.7,0 +-3,146.2,-73.3,0 +-3,145.3,-72.8,0 +-3,144.4,-72.4,0 +-3,143.5,-71.9,0 +-3,142.6,-71.5,0 +-3,141.7,-71,0 +-3,140.8,-70.6,0 +-3,139.8,-70.1,0 +-3,138.9,-69.6,0 +-3,138,-69.2,0 +-3,137.1,-68.7,0 +-3,136.2,-68.3,0 +-3,135.3,-67.8,0 +-3,134.4,-67.4,0 +-3,133.5,-66.9,0 +-3,132.6,-66.5,0 +-3,131.7,-66,0 +-3,130.8,-65.6,0 +-3,129.9,-65.1,0 +-3,129,-64.7,0 +-3,128.1,-64.2,0 +-3,127.2,-63.8,0 +-3,126.3,-63.3,0 +-3,125.4,-62.9,0 +-3,124.5,-62.4,0 +-3,123.6,-62,0 +-3,122.7,-61.5,0 +-3,121.8,-61.1,0 +-3,120.9,-60.6,0 +-3,120,-60.2,0 +-3,119.1,-59.7,0 +-3,118.2,-59.2,0 +-3,117.3,-58.8,0 +-3,116.4,-58.3,0 +-3,115.5,-57.9,0 +-3,114.6,-57.4,0 +-3,113.7,-57,0 +-3,112.8,-56.5,0 +-3,111.9,-56.1,0 +-3,111,-55.6,0 +-3,110.1,-55.2,0 +-3,109.2,-54.7,0 +-3,108.3,-54.3,0 +-3,107.4,-53.8,0 +-3,106.5,-53.4,0 +-3,105.6,-52.9,0 +-3,104.7,-52.5,0 +-3,103.8,-52,0 +-3,102.9,-51.6,0 +-3,102,-51.1,0 +-3,101.1,-50.7,0 +-3,100.2,-50.2,0 +-3,99.2,-49.7,0 +-3,98.3,-49.3,0 +-3,97.4,-48.8,0 +-3,96.5,-48.4,0 +-3,95.6,-47.9,0 +-3,94.7,-47.5,0 +-3,93.8,-47,0 +-3,92.9,-46.6,0 +-3,92,-46.1,0 +-3,91.1,-45.7,0 +-3,90.2,-45.2,0 +-3,89.3,-44.8,90 +-3,88.4,-44.3,89.1 +-3,87.5,-43.9,88.2 +-3,86.6,-43.4,87.3 +-3,85.7,-43,86.4 +-3,84.8,-42.5,85.5 +-3,83.9,-42.1,84.5 +-3,83,-41.6,83.6 +-3,82.1,-41.2,82.7 +-3,81.2,-40.7,81.8 +-3,80.3,-40.3,80.9 +-3,79.4,-39.8,80 +-3,78.5,-39.3,79.1 +-3,77.6,-38.9,78.2 +-3,76.7,-38.4,77.3 +-3,75.8,-38,76.4 +-3,74.9,-37.5,75.5 +-3,74,-37.1,74.5 +-3,73.1,-36.6,73.6 +-3,72.2,-36.2,72.7 +-3,71.3,-35.7,71.8 +-3,70.4,-35.3,70.9 +-3,69.5,-34.8,70 +-3,68.6,-34.4,69.1 +-3,67.7,-33.9,68.2 +-3,66.8,-33.5,67.3 +-3,65.9,-33,66.4 +-3,65,-32.6,65.5 +-3,64.1,-32.1,64.5 +-3,63.2,-31.7,63.6 +-3,62.3,-31.2,62.7 +-3,61.4,-30.8,61.8 +-3,60.5,-30.3,60.9 +-3,59.5,-29.8,60 +-3,58.6,-29.4,59.1 +-3,57.7,-28.9,58.2 +-3,56.8,-28.5,57.3 +-3,55.9,-28,56.4 +-3,55,-27.6,55.5 +-3,54.1,-27.1,54.5 +-3,53.2,-26.7,53.6 +-3,52.3,-26.2,52.7 +-3,51.4,-25.8,51.8 +-3,50.5,-25.3,50.9 +-3,49.6,-24.9,50 +-3,48.7,-24.4,49.1 +-3,47.8,-24,48.2 +-3,46.9,-23.5,47.3 +-3,46,-23.1,46.4 +-3,45.1,-22.6,45.5 +-3,44.2,-22.2,44.5 +-3,43.3,-21.7,43.6 +-3,42.4,-21.3,42.7 +-3,41.5,-20.8,41.8 +-3,40.6,-20.4,40.9 +-3,39.7,-19.9,40 +-3,38.8,-19.4,39.1 +-3,37.9,-19,38.2 +-3,37,-18.5,37.3 +-3,36.1,-18.1,36.4 +-3,35.2,-17.6,35.5 +-3,34.3,-17.2,34.5 +-3,33.4,-16.7,33.6 +-3,32.5,-16.3,32.7 +-3,31.6,-15.8,31.8 +-3,30.7,-15.4,30.9 +-3,29.8,-14.9,30 +-3,28.9,-14.5,29.1 +-3,28,-14,28.2 +-3,27.1,-13.6,27.3 +-3,26.2,-13.1,26.4 +-3,25.3,-12.7,25.5 +-3,24.4,-12.2,24.5 +-3,23.5,-11.8,23.6 +-3,22.6,-11.3,22.7 +-3,21.7,-10.9,21.8 +-3,20.8,-10.4,20.9 +-3,19.8,-9.9,20 +-3,18.9,-9.5,19.1 +-3,18,-9,18.2 +-3,17.1,-8.6,17.3 +-3,16.2,-8.1,16.4 +-3,15.3,-7.7,15.5 +-3,14.4,-7.2,14.5 +-3,13.5,-6.8,13.6 +-3,12.6,-6.3,12.7 +-3,11.7,-5.9,11.8 +-3,10.8,-5.4,10.9 +-3,9.9,-5,10 +-3,9,-4.5,9.1 +-3,8.1,-4.1,8.2 +-3,7.2,-3.6,7.3 +-3,6.3,-3.2,6.4 +-3,5.4,-2.7,5.5 +-3,4.5,-2.3,4.5 +-3,3.6,-1.8,3.6 +-3,2.7,-1.4,2.7 +-3,1.8,-0.9,1.8 +-3,0.9,-0.5,0.9 +-3,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +0.9,0,0,0.3 +0.9,0,0,0.3 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.8,0,0,0.5 +0.8,0,0,0.5 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.5,0,0,0.8 +0.5,0,0,0.8 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.3,0,0,0.9 +0.3,0,0,0.9 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,0.9 +0.3,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.8 +0.5,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.7,0,0,0.8 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.8,0,0,0.7 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.5 +0.8,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.3 +0.9,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0 +-3,0,0,0 +-3,0.9,-0.5,0.9 +-3,1.8,-0.9,1.8 +-3,2.7,-1.4,2.7 +-3,3.6,-1.8,3.6 +-3,4.5,-2.3,4.5 +-3,5.4,-2.7,5.5 +-3,6.3,-3.2,6.4 +-3,7.2,-3.6,7.3 +-3,8.1,-4.1,8.2 +-3,9,-4.5,9.1 +-3,9.9,-5,10 +-3,10.8,-5.4,10.9 +-3,11.7,-5.9,11.8 +-3,12.6,-6.3,12.7 +-3,13.5,-6.8,13.6 +-3,14.4,-7.2,14.5 +-3,15.3,-7.7,15.5 +-3,16.2,-8.1,16.4 +-3,17.1,-8.6,17.3 +-3,18,-9,18.2 +-3,18.9,-9.5,19.1 +-3,19.8,-9.9,20 +-3,20.8,-10.4,20.9 +-3,21.7,-10.9,21.8 +-3,22.6,-11.3,22.7 +-3,23.5,-11.8,23.6 +-3,24.4,-12.2,24.5 +-3,25.3,-12.7,25.5 +-3,26.2,-13.1,26.4 +-3,27.1,-13.6,27.3 +-3,28,-14,28.2 +-3,28.9,-14.5,29.1 +-3,29.8,-14.9,30 +-3,30.7,-15.4,30.9 +-3,31.6,-15.8,31.8 +-3,32.5,-16.3,32.7 +-3,33.4,-16.7,33.6 +-3,34.3,-17.2,34.5 +-3,35.2,-17.6,35.5 +-3,36.1,-18.1,36.4 +-3,37,-18.5,37.3 +-3,37.9,-19,38.2 +-3,38.8,-19.4,39.1 +-3,39.7,-19.9,40 +-3,40.6,-20.4,40.9 +-3,41.5,-20.8,41.8 +-3,42.4,-21.3,42.7 +-3,43.3,-21.7,43.6 +-3,44.2,-22.2,44.5 +-3,45.1,-22.6,45.5 +-3,46,-23.1,46.4 +-3,46.9,-23.5,47.3 +-3,47.8,-24,48.2 +-3,48.7,-24.4,49.1 +-3,49.6,-24.9,50 +-3,50.5,-25.3,50.9 +-3,51.4,-25.8,51.8 +-3,52.3,-26.2,52.7 +-3,53.2,-26.7,53.6 +-3,54.1,-27.1,54.5 +-3,55,-27.6,55.5 +-3,55.9,-28,56.4 +-3,56.8,-28.5,57.3 +-3,57.7,-28.9,58.2 +-3,58.6,-29.4,59.1 +-3,59.5,-29.8,60 +-3,60.5,-30.3,60.9 +-3,61.4,-30.8,61.8 +-3,62.3,-31.2,62.7 +-3,63.2,-31.7,63.6 +-3,64.1,-32.1,64.5 +-3,65,-32.6,65.5 +-3,65.9,-33,66.4 +-3,66.8,-33.5,67.3 +-3,67.7,-33.9,68.2 +-3,68.6,-34.4,69.1 +-3,69.5,-34.8,70 +-3,70.4,-35.3,70.9 +-3,71.3,-35.7,71.8 +-3,72.2,-36.2,72.7 +-3,73.1,-36.6,73.6 +-3,74,-37.1,74.5 +-3,74.9,-37.5,75.5 +-3,75.8,-38,76.4 +-3,76.7,-38.4,77.3 +-3,77.6,-38.9,78.2 +-3,78.5,-39.3,79.1 +-3,79.4,-39.8,80 +-3,80.3,-40.3,80.9 +-3,81.2,-40.7,81.8 +-3,82.1,-41.2,82.7 +-3,83,-41.6,83.6 +-3,83.9,-42.1,84.5 +-3,84.8,-42.5,85.5 +-3,85.7,-43,86.4 +-3,86.6,-43.4,87.3 +-3,87.5,-43.9,88.2 +-3,88.4,-44.3,89.1 +-3,89.3,-44.8,90 +-3,90.2,-45.2,0 +-3,91.1,-45.7,0 +-3,92,-46.1,0 +-3,92.9,-46.6,0 +-3,93.8,-47,0 +-3,94.7,-47.5,0 +-3,95.6,-47.9,0 +-3,96.5,-48.4,0 +-3,97.4,-48.8,0 +-3,98.3,-49.3,0 +-3,99.2,-49.7,0 +-3,100.2,-50.2,0 +-3,101.1,-50.7,0 +-3,102,-51.1,0 +-3,102.9,-51.6,0 +-3,103.8,-52,0 +-3,104.7,-52.5,0 +-3,105.6,-52.9,0 +-3,106.5,-53.4,0 +-3,107.4,-53.8,0 +-3,108.3,-54.3,0 +-3,109.2,-54.7,0 +-3,110.1,-55.2,0 +-3,111,-55.6,0 +-3,111.9,-56.1,0 +-3,112.8,-56.5,0 +-3,113.7,-57,0 +-3,114.6,-57.4,0 +-3,115.5,-57.9,0 +-3,116.4,-58.3,0 +-3,117.3,-58.8,0 +-3,118.2,-59.2,0 +-3,119.1,-59.7,0 +-3,120,-60.2,0 +-3,120.9,-60.6,0 +-3,121.8,-61.1,0 +-3,122.7,-61.5,0 +-3,123.6,-62,0 +-3,124.5,-62.4,0 +-3,125.4,-62.9,0 +-3,126.3,-63.3,0 +-3,127.2,-63.8,0 +-3,128.1,-64.2,0 +-3,129,-64.7,0 +-3,129.9,-65.1,0 +-3,130.8,-65.6,0 +-3,131.7,-66,0 +-3,132.6,-66.5,0 +-3,133.5,-66.9,0 +-3,134.4,-67.4,0 +-3,135.3,-67.8,0 +-3,136.2,-68.3,0 +-3,137.1,-68.7,0 +-3,138,-69.2,0 +-3,138.9,-69.6,0 +-3,139.8,-70.1,0 +-3,140.8,-70.6,0 +-3,141.7,-71,0 +-3,142.6,-71.5,0 +-3,143.5,-71.9,0 +-3,144.4,-72.4,0 +-3,145.3,-72.8,0 +-3,146.2,-73.3,0 +-3,147.1,-73.7,0 +-3,148,-74.2,0 +-3,148.9,-74.6,0 +-3,149.8,-75.1,0 +-3,150.7,-75.5,0 +-3,151.6,-76,0 +-3,152.5,-76.4,0 +-3,153.4,-76.9,0 +-3,154.3,-77.3,0 +-3,155.2,-77.8,0 +-3,156.1,-78.2,0 +-3,157,-78.7,0 +-3,157.9,-79.1,0 +-3,158.8,-79.6,0 +-3,159.7,-80.1,0 +-3,160.6,-80.5,0 +-3,161.5,-81,0 +-3,162.4,-81.4,0 +-3,163.3,-81.9,0 +-3,164.2,-82.3,0 +-3,165.1,-82.8,0 +-3,166,-83.2,0 +-3,166.9,-83.7,0 +-3,167.8,-84.1,0 +-3,168.7,-84.6,0 +-3,169.6,-85,0 +-3,170.5,-85.5,0 +-3,171.4,-85.9,0 +-3,172.3,-86.4,0 +-3,173.2,-86.8,0 +-3,174.1,-87.3,0 +-3,175,-87.7,0 +-3,175.9,-88.2,0 +-3,176.8,-88.6,0 +-3,177.7,-89.1,0 +-3,178.6,-89.5,0 +-3,179.5,-90,0 +-3,180.5,0,0 +-3,181.4,0,0 +-3,182.3,0,0 +-3,183.2,0,0 +-3,184.1,0,0 +-3,185,0,0 +-3,185.9,0,0 +-3,186.8,0,0 +-3,187.7,0,0 +-3,188.6,0,0 +-3,189.5,0,0 +-3,190.4,0,0 +-3,191.3,0,0 +-3,192.2,0,0 +-3,193.1,0,0 +-3,194,0,0 +-3,194.9,0,0 +-3,195.8,0,0 +-3,196.7,0,0 +-3,197.6,0,0 +-3,198.5,0,0 +-3,199.4,0,0 +-3,200.3,0,0 +-3,201.2,0,0 +-3,202.1,0,0 +-3,203,0,0 +-3,203.9,0,0 +-3,204.8,0,0 +-3,205.7,0,0 +-3,206.6,0,0 +-3,207.5,0,0 +-3,208.4,0,0 +-3,209.3,0,0 +-3,210.2,0,0 +-3,211.1,0,0 +-3,212,0,0 +-3,212.9,0,0 +-3,213.8,0,0 +-3,214.7,0,0 +-3,215.6,0,0 +-3,216.5,0,0 +-3,217.4,0,0 +-3,218.3,0,0 +-3,219.2,0,0 +-3,220.2,0,0 +-3,221.1,0,0 +-3,222,0,0 +-3,222.9,0,0 +-3,223.8,0,0 +-3,224.7,0,0 +-3,225.6,0,0 +-3,226.5,0,0 +-3,227.4,0,0 +-3,228.3,0,0 +-3,229.2,0,0 +-3,230.1,0,0 +-3,231,0,0 +-3,231.9,0,0 +-3,232.8,0,0 +-3,233.7,0,0 +-3,234.6,0,0 +-3,235.5,0,0 +-3,236.4,0,0 +-3,237.3,0,0 +-3,238.2,0,0 +-3,239.1,0,0 +-3,240,0,0 +-3,240.9,0,0 +-3,241.8,0,0 +-3,242.7,0,0 +-3,243.6,0,0 +-3,244.5,0,0 +-3,245.4,0,0 +-3,246.3,0,0 +-3,247.2,0,0 +-3,248.1,0,0 +-3,249,0,0 +-3,249.9,0,0 +-3,250.8,0,0 +-3,251.7,0,0 +-3,252.6,0,0 +-3,253.5,0,0 +-3,254.4,0,0 +-3,255.3,0,0 +-3,256.2,0,0 +-3,257.1,0,0 +-3,258,0,0 +-3,258.9,0,0 +-3,259.8,0,0 +-3,260.8,0,0 +-3,261.7,0,0 +-3,262.6,0,0 +-3,263.5,0,0 +-3,264.4,0,0 +-3,265.3,0,0 +-3,266.2,0,0 +-3,267.1,0,0 +-3,268,0,0 +-3,268.9,0,0 +-3,269.8,0,0 +-3,270.7,0,0 +-3,271.6,0,0 +-3,272.5,0,0 +-3,273.4,0,0 +-3,274.3,0,0 +-3,275.2,0,0 +-3,276.1,0,0 +-3,277,0,0 +-3,277.9,0,0 +-3,278.8,0,0 +-3,279.7,0,0 +-3,280.6,0,0 +-3,281.5,0,0 +-3,282.4,0,0 +-3,283.3,0,0 +-3,284.2,0,0 +-3,285.1,0,0 +-3,286,0,0 +-3,286.9,0,0 +-3,287.8,0,0 +-3,288.7,0,0 +-3,289.6,0,0 +-3,290.5,0,0 +-3,291.4,0,0 +-3,292.3,0,0 +-3,293.2,0,0 +-3,294.1,0,0 +-3,295,0,0 +-3,295.9,0,0 +-3,296.8,0,0 +-3,297.7,0,0 +-3,298.6,0,0 +-3,299.5,0,0 +-3,300.5,0,0 +-3,301.4,0,0 +-3,302.3,0,0 +-3,303.2,0,0 +-3,304.1,0,0 +-3,305,0,0 +-3,305.9,0,0 +-3,306.8,0,0 +-3,307.7,0,0 +-3,308.6,0,0 +-3,309.5,0,0 +-3,310.4,0,0 +-3,311.3,0,0 +-3,312.2,0,0 +-3,313.1,0,0 +-3,314,0,0 +-3,314.9,0,0 +-3,315.8,0,0 +-3,316.7,0,0 +-3,317.6,0,0 +-3,318.5,0,0 +-3,319.4,0,0 +-3,320.3,0,0 +-3,321.2,0,0 +-3,322.1,0,0 +-3,323,0,0 +-3,323.9,0,0 +-3,324.8,0,0 +-3,325.7,0,0 +-3,326.6,0,0 +-3,327.5,0,0 +-3,328.4,0,0 +-3,329.3,0,0 +-3,330.2,0,0 +-3,331.1,0,0 +-3,332,0,0 +-3,332.9,0,0 +-3,333.8,0,0 +-3,334.7,0,0 +-3,335.6,0,0 +-3,336.5,0,0 +-3,337.4,0,0 +-3,338.3,0,0 +-3,339.2,0,0 +-3,340.2,0,0 +-3,341.1,0,0 +-3,342,0,0 +-3,342.9,0,0 +-3,343.8,0,0 +-3,344.7,0,0 +-3,345.6,0,0 +-3,346.5,0,0 +-3,347.4,0,0 +-3,348.3,0,0 +-3,349.2,0,0 +-3,350.1,0,0 +-3,351,0,0 +-3,351.9,0,0 +-3,352.8,0,0 +-3,353.7,0,0 +-3,354.6,0,0 +-3,355.5,0,0 +-3,356.4,0,0 +-3,357.3,0,0 +-3,358.2,0,0 +-3,359.1,0,0 +-3,360,0,0 +-3,360,0,0 +-3,359.1,0,0 +-3,358.2,0,0 +-3,357.3,0,0 +-3,356.4,0,0 +-3,355.5,0,0 +-3,354.6,0,0 +-3,353.7,0,0 +-3,352.8,0,0 +-3,351.9,0,0 +-3,351,0,0 +-3,350.1,0,0 +-3,349.2,0,0 +-3,348.3,0,0 +-3,347.4,0,0 +-3,346.5,0,0 +-3,345.6,0,0 +-3,344.7,0,0 +-3,343.8,0,0 +-3,342.9,0,0 +-3,342,0,0 +-3,341.1,0,0 +-3,340.2,0,0 +-3,339.2,0,0 +-3,338.3,0,0 +-3,337.4,0,0 +-3,336.5,0,0 +-3,335.6,0,0 +-3,334.7,0,0 +-3,333.8,0,0 +-3,332.9,0,0 +-3,332,0,0 +-3,331.1,0,0 +-3,330.2,0,0 +-3,329.3,0,0 +-3,328.4,0,0 +-3,327.5,0,0 +-3,326.6,0,0 +-3,325.7,0,0 +-3,324.8,0,0 +-3,323.9,0,0 +-3,323,0,0 +-3,322.1,0,0 +-3,321.2,0,0 +-3,320.3,0,0 +-3,319.4,0,0 +-3,318.5,0,0 +-3,317.6,0,0 +-3,316.7,0,0 +-3,315.8,0,0 +-3,314.9,0,0 +-3,314,0,0 +-3,313.1,0,0 +-3,312.2,0,0 +-3,311.3,0,0 +-3,310.4,0,0 +-3,309.5,0,0 +-3,308.6,0,0 +-3,307.7,0,0 +-3,306.8,0,0 +-3,305.9,0,0 +-3,305,0,0 +-3,304.1,0,0 +-3,303.2,0,0 +-3,302.3,0,0 +-3,301.4,0,0 +-3,300.5,0,0 +-3,299.5,0,0 +-3,298.6,0,0 +-3,297.7,0,0 +-3,296.8,0,0 +-3,295.9,0,0 +-3,295,0,0 +-3,294.1,0,0 +-3,293.2,0,0 +-3,292.3,0,0 +-3,291.4,0,0 +-3,290.5,0,0 +-3,289.6,0,0 +-3,288.7,0,0 +-3,287.8,0,0 +-3,286.9,0,0 +-3,286,0,0 +-3,285.1,0,0 +-3,284.2,0,0 +-3,283.3,0,0 +-3,282.4,0,0 +-3,281.5,0,0 +-3,280.6,0,0 +-3,279.7,0,0 +-3,278.8,0,0 +-3,277.9,0,0 +-3,277,0,0 +-3,276.1,0,0 +-3,275.2,0,0 +-3,274.3,0,0 +-3,273.4,0,0 +-3,272.5,0,0 +-3,271.6,0,0 +-3,270.7,0,0 +-3,269.8,0,0 +-3,268.9,0,0 +-3,268,0,0 +-3,267.1,0,0 +-3,266.2,0,0 +-3,265.3,0,0 +-3,264.4,0,0 +-3,263.5,0,0 +-3,262.6,0,0 +-3,261.7,0,0 +-3,260.8,0,0 +-3,259.8,0,0 +-3,258.9,0,0 +-3,258,0,0 +-3,257.1,0,0 +-3,256.2,0,0 +-3,255.3,0,0 +-3,254.4,0,0 +-3,253.5,0,0 +-3,252.6,0,0 +-3,251.7,0,0 +-3,250.8,0,0 +-3,249.9,0,0 +-3,249,0,0 +-3,248.1,0,0 +-3,247.2,0,0 +-3,246.3,0,0 +-3,245.4,0,0 +-3,244.5,0,0 +-3,243.6,0,0 +-3,242.7,0,0 +-3,241.8,0,0 +-3,240.9,0,0 +-3,240,0,0 +-3,239.1,0,0 +-3,238.2,0,0 +-3,237.3,0,0 +-3,236.4,0,0 +-3,235.5,0,0 +-3,234.6,0,0 +-3,233.7,0,0 +-3,232.8,0,0 +-3,231.9,0,0 +-3,231,0,0 +-3,230.1,0,0 +-3,229.2,0,0 +-3,228.3,0,0 +-3,227.4,0,0 +-3,226.5,0,0 +-3,225.6,0,0 +-3,224.7,0,0 +-3,223.8,0,0 +-3,222.9,0,0 +-3,222,0,0 +-3,221.1,0,0 +-3,220.2,0,0 +-3,219.2,0,0 +-3,218.3,0,0 +-3,217.4,0,0 +-3,216.5,0,0 +-3,215.6,0,0 +-3,214.7,0,0 +-3,213.8,0,0 +-3,212.9,0,0 +-3,212,0,0 +-3,211.1,0,0 +-3,210.2,0,0 +-3,209.3,0,0 +-3,208.4,0,0 +-3,207.5,0,0 +-3,206.6,0,0 +-3,205.7,0,0 +-3,204.8,0,0 +-3,203.9,0,0 +-3,203,0,0 +-3,202.1,0,0 +-3,201.2,0,0 +-3,200.3,0,0 +-3,199.4,0,0 +-3,198.5,0,0 +-3,197.6,0,0 +-3,196.7,0,0 +-3,195.8,0,0 +-3,194.9,0,0 +-3,194,0,0 +-3,193.1,0,0 +-3,192.2,0,0 +-3,191.3,0,0 +-3,190.4,0,0 +-3,189.5,0,0 +-3,188.6,0,0 +-3,187.7,0,0 +-3,186.8,0,0 +-3,185.9,0,0 +-3,185,0,0 +-3,184.1,0,0 +-3,183.2,0,0 +-3,182.3,0,0 +-3,181.4,0,0 +-3,180.5,0,0 +-3,179.5,-90,0 +-3,178.6,-89.5,0 +-3,177.7,-89.1,0 +-3,176.8,-88.6,0 +-3,175.9,-88.2,0 +-3,175,-87.7,0 +-3,174.1,-87.3,0 +-3,173.2,-86.8,0 +-3,172.3,-86.4,0 +-3,171.4,-85.9,0 +-3,170.5,-85.5,0 +-3,169.6,-85,0 +-3,168.7,-84.6,0 +-3,167.8,-84.1,0 +-3,166.9,-83.7,0 +-3,166,-83.2,0 +-3,165.1,-82.8,0 +-3,164.2,-82.3,0 +-3,163.3,-81.9,0 +-3,162.4,-81.4,0 +-3,161.5,-81,0 +-3,160.6,-80.5,0 +-3,159.7,-80.1,0 +-3,158.8,-79.6,0 +-3,157.9,-79.1,0 +-3,157,-78.7,0 +-3,156.1,-78.2,0 +-3,155.2,-77.8,0 +-3,154.3,-77.3,0 +-3,153.4,-76.9,0 +-3,152.5,-76.4,0 +-3,151.6,-76,0 +-3,150.7,-75.5,0 +-3,149.8,-75.1,0 +-3,148.9,-74.6,0 +-3,148,-74.2,0 +-3,147.1,-73.7,0 +-3,146.2,-73.3,0 +-3,145.3,-72.8,0 +-3,144.4,-72.4,0 +-3,143.5,-71.9,0 +-3,142.6,-71.5,0 +-3,141.7,-71,0 +-3,140.8,-70.6,0 +-3,139.8,-70.1,0 +-3,138.9,-69.6,0 +-3,138,-69.2,0 +-3,137.1,-68.7,0 +-3,136.2,-68.3,0 +-3,135.3,-67.8,0 +-3,134.4,-67.4,0 +-3,133.5,-66.9,0 +-3,132.6,-66.5,0 +-3,131.7,-66,0 +-3,130.8,-65.6,0 +-3,129.9,-65.1,0 +-3,129,-64.7,0 +-3,128.1,-64.2,0 +-3,127.2,-63.8,0 +-3,126.3,-63.3,0 +-3,125.4,-62.9,0 +-3,124.5,-62.4,0 +-3,123.6,-62,0 +-3,122.7,-61.5,0 +-3,121.8,-61.1,0 +-3,120.9,-60.6,0 +-3,120,-60.2,0 +-3,119.1,-59.7,0 +-3,118.2,-59.2,0 +-3,117.3,-58.8,0 +-3,116.4,-58.3,0 +-3,115.5,-57.9,0 +-3,114.6,-57.4,0 +-3,113.7,-57,0 +-3,112.8,-56.5,0 +-3,111.9,-56.1,0 +-3,111,-55.6,0 +-3,110.1,-55.2,0 +-3,109.2,-54.7,0 +-3,108.3,-54.3,0 +-3,107.4,-53.8,0 +-3,106.5,-53.4,0 +-3,105.6,-52.9,0 +-3,104.7,-52.5,0 +-3,103.8,-52,0 +-3,102.9,-51.6,0 +-3,102,-51.1,0 +-3,101.1,-50.7,0 +-3,100.2,-50.2,0 +-3,99.2,-49.7,0 +-3,98.3,-49.3,0 +-3,97.4,-48.8,0 +-3,96.5,-48.4,0 +-3,95.6,-47.9,0 +-3,94.7,-47.5,0 +-3,93.8,-47,0 +-3,92.9,-46.6,0 +-3,92,-46.1,0 +-3,91.1,-45.7,0 +-3,90.2,-45.2,0 +-3,89.3,-44.8,90 +-3,88.4,-44.3,89.1 +-3,87.5,-43.9,88.2 +-3,86.6,-43.4,87.3 +-3,85.7,-43,86.4 +-3,84.8,-42.5,85.5 +-3,83.9,-42.1,84.5 +-3,83,-41.6,83.6 +-3,82.1,-41.2,82.7 +-3,81.2,-40.7,81.8 +-3,80.3,-40.3,80.9 +-3,79.4,-39.8,80 +-3,78.5,-39.3,79.1 +-3,77.6,-38.9,78.2 +-3,76.7,-38.4,77.3 +-3,75.8,-38,76.4 +-3,74.9,-37.5,75.5 +-3,74,-37.1,74.5 +-3,73.1,-36.6,73.6 +-3,72.2,-36.2,72.7 +-3,71.3,-35.7,71.8 +-3,70.4,-35.3,70.9 +-3,69.5,-34.8,70 +-3,68.6,-34.4,69.1 +-3,67.7,-33.9,68.2 +-3,66.8,-33.5,67.3 +-3,65.9,-33,66.4 +-3,65,-32.6,65.5 +-3,64.1,-32.1,64.5 +-3,63.2,-31.7,63.6 +-3,62.3,-31.2,62.7 +-3,61.4,-30.8,61.8 +-3,60.5,-30.3,60.9 +-3,59.5,-29.8,60 +-3,58.6,-29.4,59.1 +-3,57.7,-28.9,58.2 +-3,56.8,-28.5,57.3 +-3,55.9,-28,56.4 +-3,55,-27.6,55.5 +-3,54.1,-27.1,54.5 +-3,53.2,-26.7,53.6 +-3,52.3,-26.2,52.7 +-3,51.4,-25.8,51.8 +-3,50.5,-25.3,50.9 +-3,49.6,-24.9,50 +-3,48.7,-24.4,49.1 +-3,47.8,-24,48.2 +-3,46.9,-23.5,47.3 +-3,46,-23.1,46.4 +-3,45.1,-22.6,45.5 +-3,44.2,-22.2,44.5 +-3,43.3,-21.7,43.6 +-3,42.4,-21.3,42.7 +-3,41.5,-20.8,41.8 +-3,40.6,-20.4,40.9 +-3,39.7,-19.9,40 +-3,38.8,-19.4,39.1 +-3,37.9,-19,38.2 +-3,37,-18.5,37.3 +-3,36.1,-18.1,36.4 +-3,35.2,-17.6,35.5 +-3,34.3,-17.2,34.5 +-3,33.4,-16.7,33.6 +-3,32.5,-16.3,32.7 +-3,31.6,-15.8,31.8 +-3,30.7,-15.4,30.9 +-3,29.8,-14.9,30 +-3,28.9,-14.5,29.1 +-3,28,-14,28.2 +-3,27.1,-13.6,27.3 +-3,26.2,-13.1,26.4 +-3,25.3,-12.7,25.5 +-3,24.4,-12.2,24.5 +-3,23.5,-11.8,23.6 +-3,22.6,-11.3,22.7 +-3,21.7,-10.9,21.8 +-3,20.8,-10.4,20.9 +-3,19.8,-9.9,20 +-3,18.9,-9.5,19.1 +-3,18,-9,18.2 +-3,17.1,-8.6,17.3 +-3,16.2,-8.1,16.4 +-3,15.3,-7.7,15.5 +-3,14.4,-7.2,14.5 +-3,13.5,-6.8,13.6 +-3,12.6,-6.3,12.7 +-3,11.7,-5.9,11.8 +-3,10.8,-5.4,10.9 +-3,9.9,-5,10 +-3,9,-4.5,9.1 +-3,8.1,-4.1,8.2 +-3,7.2,-3.6,7.3 +-3,6.3,-3.2,6.4 +-3,5.4,-2.7,5.5 +-3,4.5,-2.3,4.5 +-3,3.6,-1.8,3.6 +-3,2.7,-1.4,2.7 +-3,1.8,-0.9,1.8 +-3,0.9,-0.5,0.9 +-3,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +0.9,0,0,0.3 +0.9,0,0,0.3 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.8,0,0,0.5 +0.8,0,0,0.5 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.5,0,0,0.8 +0.5,0,0,0.8 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.3,0,0,0.9 +0.3,0,0,0.9 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,0.9 +0.3,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.8 +0.5,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.7,0,0,0.8 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.8,0,0,0.7 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.5 +0.8,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.3 +0.9,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0 +-3,0,0,0 +-3,0.9,-0.5,0.9 +-3,1.8,-0.9,1.8 +-3,2.7,-1.4,2.7 +-3,3.6,-1.8,3.6 +-3,4.5,-2.3,4.5 +-3,5.4,-2.7,5.5 +-3,6.3,-3.2,6.4 +-3,7.2,-3.6,7.3 +-3,8.1,-4.1,8.2 +-3,9,-4.5,9.1 +-3,9.9,-5,10 +-3,10.8,-5.4,10.9 +-3,11.7,-5.9,11.8 +-3,12.6,-6.3,12.7 +-3,13.5,-6.8,13.6 +-3,14.4,-7.2,14.5 +-3,15.3,-7.7,15.5 +-3,16.2,-8.1,16.4 +-3,17.1,-8.6,17.3 +-3,18,-9,18.2 +-3,18.9,-9.5,19.1 +-3,19.8,-9.9,20 +-3,20.8,-10.4,20.9 +-3,21.7,-10.9,21.8 +-3,22.6,-11.3,22.7 +-3,23.5,-11.8,23.6 +-3,24.4,-12.2,24.5 +-3,25.3,-12.7,25.5 +-3,26.2,-13.1,26.4 +-3,27.1,-13.6,27.3 +-3,28,-14,28.2 +-3,28.9,-14.5,29.1 +-3,29.8,-14.9,30 +-3,30.7,-15.4,30.9 +-3,31.6,-15.8,31.8 +-3,32.5,-16.3,32.7 +-3,33.4,-16.7,33.6 +-3,34.3,-17.2,34.5 +-3,35.2,-17.6,35.5 +-3,36.1,-18.1,36.4 +-3,37,-18.5,37.3 +-3,37.9,-19,38.2 +-3,38.8,-19.4,39.1 +-3,39.7,-19.9,40 +-3,40.6,-20.4,40.9 +-3,41.5,-20.8,41.8 +-3,42.4,-21.3,42.7 +-3,43.3,-21.7,43.6 +-3,44.2,-22.2,44.5 +-3,45.1,-22.6,45.5 +-3,46,-23.1,46.4 +-3,46.9,-23.5,47.3 +-3,47.8,-24,48.2 +-3,48.7,-24.4,49.1 +-3,49.6,-24.9,50 +-3,50.5,-25.3,50.9 +-3,51.4,-25.8,51.8 +-3,52.3,-26.2,52.7 +-3,53.2,-26.7,53.6 +-3,54.1,-27.1,54.5 +-3,55,-27.6,55.5 +-3,55.9,-28,56.4 +-3,56.8,-28.5,57.3 +-3,57.7,-28.9,58.2 +-3,58.6,-29.4,59.1 +-3,59.5,-29.8,60 +-3,60.5,-30.3,60.9 +-3,61.4,-30.8,61.8 +-3,62.3,-31.2,62.7 +-3,63.2,-31.7,63.6 +-3,64.1,-32.1,64.5 +-3,65,-32.6,65.5 +-3,65.9,-33,66.4 +-3,66.8,-33.5,67.3 +-3,67.7,-33.9,68.2 +-3,68.6,-34.4,69.1 +-3,69.5,-34.8,70 +-3,70.4,-35.3,70.9 +-3,71.3,-35.7,71.8 +-3,72.2,-36.2,72.7 +-3,73.1,-36.6,73.6 +-3,74,-37.1,74.5 +-3,74.9,-37.5,75.5 +-3,75.8,-38,76.4 +-3,76.7,-38.4,77.3 +-3,77.6,-38.9,78.2 +-3,78.5,-39.3,79.1 +-3,79.4,-39.8,80 +-3,80.3,-40.3,80.9 +-3,81.2,-40.7,81.8 +-3,82.1,-41.2,82.7 +-3,83,-41.6,83.6 +-3,83.9,-42.1,84.5 +-3,84.8,-42.5,85.5 +-3,85.7,-43,86.4 +-3,86.6,-43.4,87.3 +-3,87.5,-43.9,88.2 +-3,88.4,-44.3,89.1 +-3,89.3,-44.8,90 +-3,90.2,-45.2,0 +-3,91.1,-45.7,0 +-3,92,-46.1,0 +-3,92.9,-46.6,0 +-3,93.8,-47,0 +-3,94.7,-47.5,0 +-3,95.6,-47.9,0 +-3,96.5,-48.4,0 +-3,97.4,-48.8,0 +-3,98.3,-49.3,0 +-3,99.2,-49.7,0 +-3,100.2,-50.2,0 +-3,101.1,-50.7,0 +-3,102,-51.1,0 +-3,102.9,-51.6,0 +-3,103.8,-52,0 +-3,104.7,-52.5,0 +-3,105.6,-52.9,0 +-3,106.5,-53.4,0 +-3,107.4,-53.8,0 +-3,108.3,-54.3,0 +-3,109.2,-54.7,0 +-3,110.1,-55.2,0 +-3,111,-55.6,0 +-3,111.9,-56.1,0 +-3,112.8,-56.5,0 +-3,113.7,-57,0 +-3,114.6,-57.4,0 +-3,115.5,-57.9,0 +-3,116.4,-58.3,0 +-3,117.3,-58.8,0 +-3,118.2,-59.2,0 +-3,119.1,-59.7,0 +-3,120,-60.2,0 +-3,120.9,-60.6,0 +-3,121.8,-61.1,0 +-3,122.7,-61.5,0 +-3,123.6,-62,0 +-3,124.5,-62.4,0 +-3,125.4,-62.9,0 +-3,126.3,-63.3,0 +-3,127.2,-63.8,0 +-3,128.1,-64.2,0 +-3,129,-64.7,0 +-3,129.9,-65.1,0 +-3,130.8,-65.6,0 +-3,131.7,-66,0 +-3,132.6,-66.5,0 +-3,133.5,-66.9,0 +-3,134.4,-67.4,0 +-3,135.3,-67.8,0 +-3,136.2,-68.3,0 +-3,137.1,-68.7,0 +-3,138,-69.2,0 +-3,138.9,-69.6,0 +-3,139.8,-70.1,0 +-3,140.8,-70.6,0 +-3,141.7,-71,0 +-3,142.6,-71.5,0 +-3,143.5,-71.9,0 +-3,144.4,-72.4,0 +-3,145.3,-72.8,0 +-3,146.2,-73.3,0 +-3,147.1,-73.7,0 +-3,148,-74.2,0 +-3,148.9,-74.6,0 +-3,149.8,-75.1,0 +-3,150.7,-75.5,0 +-3,151.6,-76,0 +-3,152.5,-76.4,0 +-3,153.4,-76.9,0 +-3,154.3,-77.3,0 +-3,155.2,-77.8,0 +-3,156.1,-78.2,0 +-3,157,-78.7,0 +-3,157.9,-79.1,0 +-3,158.8,-79.6,0 +-3,159.7,-80.1,0 +-3,160.6,-80.5,0 +-3,161.5,-81,0 +-3,162.4,-81.4,0 +-3,163.3,-81.9,0 +-3,164.2,-82.3,0 +-3,165.1,-82.8,0 +-3,166,-83.2,0 +-3,166.9,-83.7,0 +-3,167.8,-84.1,0 +-3,168.7,-84.6,0 +-3,169.6,-85,0 +-3,170.5,-85.5,0 +-3,171.4,-85.9,0 +-3,172.3,-86.4,0 +-3,173.2,-86.8,0 +-3,174.1,-87.3,0 +-3,175,-87.7,0 +-3,175.9,-88.2,0 +-3,176.8,-88.6,0 +-3,177.7,-89.1,0 +-3,178.6,-89.5,0 +-3,179.5,-90,0 +-3,180.5,0,0 +-3,181.4,0,0 +-3,182.3,0,0 +-3,183.2,0,0 +-3,184.1,0,0 +-3,185,0,0 +-3,185.9,0,0 +-3,186.8,0,0 +-3,187.7,0,0 +-3,188.6,0,0 +-3,189.5,0,0 +-3,190.4,0,0 +-3,191.3,0,0 +-3,192.2,0,0 +-3,193.1,0,0 +-3,194,0,0 +-3,194.9,0,0 +-3,195.8,0,0 +-3,196.7,0,0 +-3,197.6,0,0 +-3,198.5,0,0 +-3,199.4,0,0 +-3,200.3,0,0 +-3,201.2,0,0 +-3,202.1,0,0 +-3,203,0,0 +-3,203.9,0,0 +-3,204.8,0,0 +-3,205.7,0,0 +-3,206.6,0,0 +-3,207.5,0,0 +-3,208.4,0,0 +-3,209.3,0,0 +-3,210.2,0,0 +-3,211.1,0,0 +-3,212,0,0 +-3,212.9,0,0 +-3,213.8,0,0 +-3,214.7,0,0 +-3,215.6,0,0 +-3,216.5,0,0 +-3,217.4,0,0 +-3,218.3,0,0 +-3,219.2,0,0 +-3,220.2,0,0 +-3,221.1,0,0 +-3,222,0,0 +-3,222.9,0,0 +-3,223.8,0,0 +-3,224.7,0,0 +-3,225.6,0,0 +-3,226.5,0,0 +-3,227.4,0,0 +-3,228.3,0,0 +-3,229.2,0,0 +-3,230.1,0,0 +-3,231,0,0 +-3,231.9,0,0 +-3,232.8,0,0 +-3,233.7,0,0 +-3,234.6,0,0 +-3,235.5,0,0 +-3,236.4,0,0 +-3,237.3,0,0 +-3,238.2,0,0 +-3,239.1,0,0 +-3,240,0,0 +-3,240.9,0,0 +-3,241.8,0,0 +-3,242.7,0,0 +-3,243.6,0,0 +-3,244.5,0,0 +-3,245.4,0,0 +-3,246.3,0,0 +-3,247.2,0,0 +-3,248.1,0,0 +-3,249,0,0 +-3,249.9,0,0 +-3,250.8,0,0 +-3,251.7,0,0 +-3,252.6,0,0 +-3,253.5,0,0 +-3,254.4,0,0 +-3,255.3,0,0 +-3,256.2,0,0 +-3,257.1,0,0 +-3,258,0,0 +-3,258.9,0,0 +-3,259.8,0,0 +-3,260.8,0,0 +-3,261.7,0,0 +-3,262.6,0,0 +-3,263.5,0,0 +-3,264.4,0,0 +-3,265.3,0,0 +-3,266.2,0,0 +-3,267.1,0,0 +-3,268,0,0 +-3,268.9,0,0 +-3,269.8,0,0 +-3,270.7,0,0 +-3,271.6,0,0 +-3,272.5,0,0 +-3,273.4,0,0 +-3,274.3,0,0 +-3,275.2,0,0 +-3,276.1,0,0 +-3,277,0,0 +-3,277.9,0,0 +-3,278.8,0,0 +-3,279.7,0,0 +-3,280.6,0,0 +-3,281.5,0,0 +-3,282.4,0,0 +-3,283.3,0,0 +-3,284.2,0,0 +-3,285.1,0,0 +-3,286,0,0 +-3,286.9,0,0 +-3,287.8,0,0 +-3,288.7,0,0 +-3,289.6,0,0 +-3,290.5,0,0 +-3,291.4,0,0 +-3,292.3,0,0 +-3,293.2,0,0 +-3,294.1,0,0 +-3,295,0,0 +-3,295.9,0,0 +-3,296.8,0,0 +-3,297.7,0,0 +-3,298.6,0,0 +-3,299.5,0,0 +-3,300.5,0,0 +-3,301.4,0,0 +-3,302.3,0,0 +-3,303.2,0,0 +-3,304.1,0,0 +-3,305,0,0 +-3,305.9,0,0 +-3,306.8,0,0 +-3,307.7,0,0 +-3,308.6,0,0 +-3,309.5,0,0 +-3,310.4,0,0 +-3,311.3,0,0 +-3,312.2,0,0 +-3,313.1,0,0 +-3,314,0,0 +-3,314.9,0,0 +-3,315.8,0,0 +-3,316.7,0,0 +-3,317.6,0,0 +-3,318.5,0,0 +-3,319.4,0,0 +-3,320.3,0,0 +-3,321.2,0,0 +-3,322.1,0,0 +-3,323,0,0 +-3,323.9,0,0 +-3,324.8,0,0 +-3,325.7,0,0 +-3,326.6,0,0 +-3,327.5,0,0 +-3,328.4,0,0 +-3,329.3,0,0 +-3,330.2,0,0 +-3,331.1,0,0 +-3,332,0,0 +-3,332.9,0,0 +-3,333.8,0,0 +-3,334.7,0,0 +-3,335.6,0,0 +-3,336.5,0,0 +-3,337.4,0,0 +-3,338.3,0,0 +-3,339.2,0,0 +-3,340.2,0,0 +-3,341.1,0,0 +-3,342,0,0 +-3,342.9,0,0 +-3,343.8,0,0 +-3,344.7,0,0 +-3,345.6,0,0 +-3,346.5,0,0 +-3,347.4,0,0 +-3,348.3,0,0 +-3,349.2,0,0 +-3,350.1,0,0 +-3,351,0,0 +-3,351.9,0,0 +-3,352.8,0,0 +-3,353.7,0,0 +-3,354.6,0,0 +-3,355.5,0,0 +-3,356.4,0,0 +-3,357.3,0,0 +-3,358.2,0,0 +-3,359.1,0,0 +-3,360,0,0 +-3,360,0,0 +-3,359.1,0,0 +-3,358.2,0,0 +-3,357.3,0,0 +-3,356.4,0,0 +-3,355.5,0,0 +-3,354.6,0,0 +-3,353.7,0,0 +-3,352.8,0,0 +-3,351.9,0,0 +-3,351,0,0 +-3,350.1,0,0 +-3,349.2,0,0 +-3,348.3,0,0 +-3,347.4,0,0 +-3,346.5,0,0 +-3,345.6,0,0 +-3,344.7,0,0 +-3,343.8,0,0 +-3,342.9,0,0 +-3,342,0,0 +-3,341.1,0,0 +-3,340.2,0,0 +-3,339.2,0,0 +-3,338.3,0,0 +-3,337.4,0,0 +-3,336.5,0,0 +-3,335.6,0,0 +-3,334.7,0,0 +-3,333.8,0,0 +-3,332.9,0,0 +-3,332,0,0 +-3,331.1,0,0 +-3,330.2,0,0 +-3,329.3,0,0 +-3,328.4,0,0 +-3,327.5,0,0 +-3,326.6,0,0 +-3,325.7,0,0 +-3,324.8,0,0 +-3,323.9,0,0 +-3,323,0,0 +-3,322.1,0,0 +-3,321.2,0,0 +-3,320.3,0,0 +-3,319.4,0,0 +-3,318.5,0,0 +-3,317.6,0,0 +-3,316.7,0,0 +-3,315.8,0,0 +-3,314.9,0,0 +-3,314,0,0 +-3,313.1,0,0 +-3,312.2,0,0 +-3,311.3,0,0 +-3,310.4,0,0 +-3,309.5,0,0 +-3,308.6,0,0 +-3,307.7,0,0 +-3,306.8,0,0 +-3,305.9,0,0 +-3,305,0,0 +-3,304.1,0,0 +-3,303.2,0,0 +-3,302.3,0,0 +-3,301.4,0,0 +-3,300.5,0,0 +-3,299.5,0,0 +-3,298.6,0,0 +-3,297.7,0,0 +-3,296.8,0,0 +-3,295.9,0,0 +-3,295,0,0 +-3,294.1,0,0 +-3,293.2,0,0 +-3,292.3,0,0 +-3,291.4,0,0 +-3,290.5,0,0 +-3,289.6,0,0 +-3,288.7,0,0 +-3,287.8,0,0 +-3,286.9,0,0 +-3,286,0,0 +-3,285.1,0,0 +-3,284.2,0,0 +-3,283.3,0,0 +-3,282.4,0,0 +-3,281.5,0,0 +-3,280.6,0,0 +-3,279.7,0,0 +-3,278.8,0,0 +-3,277.9,0,0 +-3,277,0,0 +-3,276.1,0,0 +-3,275.2,0,0 +-3,274.3,0,0 +-3,273.4,0,0 +-3,272.5,0,0 +-3,271.6,0,0 +-3,270.7,0,0 +-3,269.8,0,0 +-3,268.9,0,0 +-3,268,0,0 +-3,267.1,0,0 +-3,266.2,0,0 +-3,265.3,0,0 +-3,264.4,0,0 +-3,263.5,0,0 +-3,262.6,0,0 +-3,261.7,0,0 +-3,260.8,0,0 +-3,259.8,0,0 +-3,258.9,0,0 +-3,258,0,0 +-3,257.1,0,0 +-3,256.2,0,0 +-3,255.3,0,0 +-3,254.4,0,0 +-3,253.5,0,0 +-3,252.6,0,0 +-3,251.7,0,0 +-3,250.8,0,0 +-3,249.9,0,0 +-3,249,0,0 +-3,248.1,0,0 +-3,247.2,0,0 +-3,246.3,0,0 +-3,245.4,0,0 +-3,244.5,0,0 +-3,243.6,0,0 +-3,242.7,0,0 +-3,241.8,0,0 +-3,240.9,0,0 +-3,240,0,0 +-3,239.1,0,0 +-3,238.2,0,0 +-3,237.3,0,0 +-3,236.4,0,0 +-3,235.5,0,0 +-3,234.6,0,0 +-3,233.7,0,0 +-3,232.8,0,0 +-3,231.9,0,0 +-3,231,0,0 +-3,230.1,0,0 +-3,229.2,0,0 +-3,228.3,0,0 +-3,227.4,0,0 +-3,226.5,0,0 +-3,225.6,0,0 +-3,224.7,0,0 +-3,223.8,0,0 +-3,222.9,0,0 +-3,222,0,0 +-3,221.1,0,0 +-3,220.2,0,0 +-3,219.2,0,0 +-3,218.3,0,0 +-3,217.4,0,0 +-3,216.5,0,0 +-3,215.6,0,0 +-3,214.7,0,0 +-3,213.8,0,0 +-3,212.9,0,0 +-3,212,0,0 +-3,211.1,0,0 +-3,210.2,0,0 +-3,209.3,0,0 +-3,208.4,0,0 +-3,207.5,0,0 +-3,206.6,0,0 +-3,205.7,0,0 +-3,204.8,0,0 +-3,203.9,0,0 +-3,203,0,0 +-3,202.1,0,0 +-3,201.2,0,0 +-3,200.3,0,0 +-3,199.4,0,0 +-3,198.5,0,0 +-3,197.6,0,0 +-3,196.7,0,0 +-3,195.8,0,0 +-3,194.9,0,0 +-3,194,0,0 +-3,193.1,0,0 +-3,192.2,0,0 +-3,191.3,0,0 +-3,190.4,0,0 +-3,189.5,0,0 +-3,188.6,0,0 +-3,187.7,0,0 +-3,186.8,0,0 +-3,185.9,0,0 +-3,185,0,0 +-3,184.1,0,0 +-3,183.2,0,0 +-3,182.3,0,0 +-3,181.4,0,0 +-3,180.5,0,0 +-3,179.5,-90,0 +-3,178.6,-89.5,0 +-3,177.7,-89.1,0 +-3,176.8,-88.6,0 +-3,175.9,-88.2,0 +-3,175,-87.7,0 +-3,174.1,-87.3,0 +-3,173.2,-86.8,0 +-3,172.3,-86.4,0 +-3,171.4,-85.9,0 +-3,170.5,-85.5,0 +-3,169.6,-85,0 +-3,168.7,-84.6,0 +-3,167.8,-84.1,0 +-3,166.9,-83.7,0 +-3,166,-83.2,0 +-3,165.1,-82.8,0 +-3,164.2,-82.3,0 +-3,163.3,-81.9,0 +-3,162.4,-81.4,0 +-3,161.5,-81,0 +-3,160.6,-80.5,0 +-3,159.7,-80.1,0 +-3,158.8,-79.6,0 +-3,157.9,-79.1,0 +-3,157,-78.7,0 +-3,156.1,-78.2,0 +-3,155.2,-77.8,0 +-3,154.3,-77.3,0 +-3,153.4,-76.9,0 +-3,152.5,-76.4,0 +-3,151.6,-76,0 +-3,150.7,-75.5,0 +-3,149.8,-75.1,0 +-3,148.9,-74.6,0 +-3,148,-74.2,0 +-3,147.1,-73.7,0 +-3,146.2,-73.3,0 +-3,145.3,-72.8,0 +-3,144.4,-72.4,0 +-3,143.5,-71.9,0 +-3,142.6,-71.5,0 +-3,141.7,-71,0 +-3,140.8,-70.6,0 +-3,139.8,-70.1,0 +-3,138.9,-69.6,0 +-3,138,-69.2,0 +-3,137.1,-68.7,0 +-3,136.2,-68.3,0 +-3,135.3,-67.8,0 +-3,134.4,-67.4,0 +-3,133.5,-66.9,0 +-3,132.6,-66.5,0 +-3,131.7,-66,0 +-3,130.8,-65.6,0 +-3,129.9,-65.1,0 +-3,129,-64.7,0 +-3,128.1,-64.2,0 +-3,127.2,-63.8,0 +-3,126.3,-63.3,0 +-3,125.4,-62.9,0 +-3,124.5,-62.4,0 +-3,123.6,-62,0 +-3,122.7,-61.5,0 +-3,121.8,-61.1,0 +-3,120.9,-60.6,0 +-3,120,-60.2,0 +-3,119.1,-59.7,0 +-3,118.2,-59.2,0 +-3,117.3,-58.8,0 +-3,116.4,-58.3,0 +-3,115.5,-57.9,0 +-3,114.6,-57.4,0 +-3,113.7,-57,0 +-3,112.8,-56.5,0 +-3,111.9,-56.1,0 +-3,111,-55.6,0 +-3,110.1,-55.2,0 +-3,109.2,-54.7,0 +-3,108.3,-54.3,0 +-3,107.4,-53.8,0 +-3,106.5,-53.4,0 +-3,105.6,-52.9,0 +-3,104.7,-52.5,0 +-3,103.8,-52,0 +-3,102.9,-51.6,0 +-3,102,-51.1,0 +-3,101.1,-50.7,0 +-3,100.2,-50.2,0 +-3,99.2,-49.7,0 +-3,98.3,-49.3,0 +-3,97.4,-48.8,0 +-3,96.5,-48.4,0 +-3,95.6,-47.9,0 +-3,94.7,-47.5,0 +-3,93.8,-47,0 +-3,92.9,-46.6,0 +-3,92,-46.1,0 +-3,91.1,-45.7,0 +-3,90.2,-45.2,0 +-3,89.3,-44.8,90 +-3,88.4,-44.3,89.1 +-3,87.5,-43.9,88.2 +-3,86.6,-43.4,87.3 +-3,85.7,-43,86.4 +-3,84.8,-42.5,85.5 +-3,83.9,-42.1,84.5 +-3,83,-41.6,83.6 +-3,82.1,-41.2,82.7 +-3,81.2,-40.7,81.8 +-3,80.3,-40.3,80.9 +-3,79.4,-39.8,80 +-3,78.5,-39.3,79.1 +-3,77.6,-38.9,78.2 +-3,76.7,-38.4,77.3 +-3,75.8,-38,76.4 +-3,74.9,-37.5,75.5 +-3,74,-37.1,74.5 +-3,73.1,-36.6,73.6 +-3,72.2,-36.2,72.7 +-3,71.3,-35.7,71.8 +-3,70.4,-35.3,70.9 +-3,69.5,-34.8,70 +-3,68.6,-34.4,69.1 +-3,67.7,-33.9,68.2 +-3,66.8,-33.5,67.3 +-3,65.9,-33,66.4 +-3,65,-32.6,65.5 +-3,64.1,-32.1,64.5 +-3,63.2,-31.7,63.6 +-3,62.3,-31.2,62.7 +-3,61.4,-30.8,61.8 +-3,60.5,-30.3,60.9 +-3,59.5,-29.8,60 +-3,58.6,-29.4,59.1 +-3,57.7,-28.9,58.2 +-3,56.8,-28.5,57.3 +-3,55.9,-28,56.4 +-3,55,-27.6,55.5 +-3,54.1,-27.1,54.5 +-3,53.2,-26.7,53.6 +-3,52.3,-26.2,52.7 +-3,51.4,-25.8,51.8 +-3,50.5,-25.3,50.9 +-3,49.6,-24.9,50 +-3,48.7,-24.4,49.1 +-3,47.8,-24,48.2 +-3,46.9,-23.5,47.3 +-3,46,-23.1,46.4 +-3,45.1,-22.6,45.5 +-3,44.2,-22.2,44.5 +-3,43.3,-21.7,43.6 +-3,42.4,-21.3,42.7 +-3,41.5,-20.8,41.8 +-3,40.6,-20.4,40.9 +-3,39.7,-19.9,40 +-3,38.8,-19.4,39.1 +-3,37.9,-19,38.2 +-3,37,-18.5,37.3 +-3,36.1,-18.1,36.4 +-3,35.2,-17.6,35.5 +-3,34.3,-17.2,34.5 +-3,33.4,-16.7,33.6 +-3,32.5,-16.3,32.7 +-3,31.6,-15.8,31.8 +-3,30.7,-15.4,30.9 +-3,29.8,-14.9,30 +-3,28.9,-14.5,29.1 +-3,28,-14,28.2 +-3,27.1,-13.6,27.3 +-3,26.2,-13.1,26.4 +-3,25.3,-12.7,25.5 +-3,24.4,-12.2,24.5 +-3,23.5,-11.8,23.6 +-3,22.6,-11.3,22.7 +-3,21.7,-10.9,21.8 +-3,20.8,-10.4,20.9 +-3,19.8,-9.9,20 +-3,18.9,-9.5,19.1 +-3,18,-9,18.2 +-3,17.1,-8.6,17.3 +-3,16.2,-8.1,16.4 +-3,15.3,-7.7,15.5 +-3,14.4,-7.2,14.5 +-3,13.5,-6.8,13.6 +-3,12.6,-6.3,12.7 +-3,11.7,-5.9,11.8 +-3,10.8,-5.4,10.9 +-3,9.9,-5,10 +-3,9,-4.5,9.1 +-3,8.1,-4.1,8.2 +-3,7.2,-3.6,7.3 +-3,6.3,-3.2,6.4 +-3,5.4,-2.7,5.5 +-3,4.5,-2.3,4.5 +-3,3.6,-1.8,3.6 +-3,2.7,-1.4,2.7 +-3,1.8,-0.9,1.8 +-3,0.9,-0.5,0.9 +-3,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +0.9,0,0,0.3 +0.9,0,0,0.3 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.8,0,0,0.5 +0.8,0,0,0.5 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.5,0,0,0.8 +0.5,0,0,0.8 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.3,0,0,0.9 +0.3,0,0,0.9 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,0.9 +0.3,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.8 +0.5,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.7,0,0,0.8 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.8,0,0,0.7 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.5 +0.8,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.3 +0.9,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0 +-3,0,0,0 +-3,0.9,-0.5,0.9 +-3,1.8,-0.9,1.8 +-3,2.7,-1.4,2.7 +-3,3.6,-1.8,3.6 +-3,4.5,-2.3,4.5 +-3,5.4,-2.7,5.5 +-3,6.3,-3.2,6.4 +-3,7.2,-3.6,7.3 +-3,8.1,-4.1,8.2 +-3,9,-4.5,9.1 +-3,9.9,-5,10 +-3,10.8,-5.4,10.9 +-3,11.7,-5.9,11.8 +-3,12.6,-6.3,12.7 +-3,13.5,-6.8,13.6 +-3,14.4,-7.2,14.5 +-3,15.3,-7.7,15.5 +-3,16.2,-8.1,16.4 +-3,17.1,-8.6,17.3 +-3,18,-9,18.2 +-3,18.9,-9.5,19.1 +-3,19.8,-9.9,20 +-3,20.8,-10.4,20.9 +-3,21.7,-10.9,21.8 +-3,22.6,-11.3,22.7 +-3,23.5,-11.8,23.6 +-3,24.4,-12.2,24.5 +-3,25.3,-12.7,25.5 +-3,26.2,-13.1,26.4 +-3,27.1,-13.6,27.3 +-3,28,-14,28.2 +-3,28.9,-14.5,29.1 +-3,29.8,-14.9,30 +-3,30.7,-15.4,30.9 +-3,31.6,-15.8,31.8 +-3,32.5,-16.3,32.7 +-3,33.4,-16.7,33.6 +-3,34.3,-17.2,34.5 +-3,35.2,-17.6,35.5 +-3,36.1,-18.1,36.4 +-3,37,-18.5,37.3 +-3,37.9,-19,38.2 +-3,38.8,-19.4,39.1 +-3,39.7,-19.9,40 +-3,40.6,-20.4,40.9 +-3,41.5,-20.8,41.8 +-3,42.4,-21.3,42.7 +-3,43.3,-21.7,43.6 +-3,44.2,-22.2,44.5 +-3,45.1,-22.6,45.5 +-3,46,-23.1,46.4 +-3,46.9,-23.5,47.3 +-3,47.8,-24,48.2 +-3,48.7,-24.4,49.1 +-3,49.6,-24.9,50 +-3,50.5,-25.3,50.9 +-3,51.4,-25.8,51.8 +-3,52.3,-26.2,52.7 +-3,53.2,-26.7,53.6 +-3,54.1,-27.1,54.5 +-3,55,-27.6,55.5 +-3,55.9,-28,56.4 +-3,56.8,-28.5,57.3 +-3,57.7,-28.9,58.2 +-3,58.6,-29.4,59.1 +-3,59.5,-29.8,60 +-3,60.5,-30.3,60.9 +-3,61.4,-30.8,61.8 +-3,62.3,-31.2,62.7 +-3,63.2,-31.7,63.6 +-3,64.1,-32.1,64.5 +-3,65,-32.6,65.5 +-3,65.9,-33,66.4 +-3,66.8,-33.5,67.3 +-3,67.7,-33.9,68.2 +-3,68.6,-34.4,69.1 +-3,69.5,-34.8,70 +-3,70.4,-35.3,70.9 +-3,71.3,-35.7,71.8 +-3,72.2,-36.2,72.7 +-3,73.1,-36.6,73.6 +-3,74,-37.1,74.5 +-3,74.9,-37.5,75.5 +-3,75.8,-38,76.4 +-3,76.7,-38.4,77.3 +-3,77.6,-38.9,78.2 +-3,78.5,-39.3,79.1 +-3,79.4,-39.8,80 +-3,80.3,-40.3,80.9 +-3,81.2,-40.7,81.8 +-3,82.1,-41.2,82.7 +-3,83,-41.6,83.6 +-3,83.9,-42.1,84.5 +-3,84.8,-42.5,85.5 +-3,85.7,-43,86.4 +-3,86.6,-43.4,87.3 +-3,87.5,-43.9,88.2 +-3,88.4,-44.3,89.1 +-3,89.3,-44.8,90 +-3,90.2,-45.2,0 +-3,91.1,-45.7,0 +-3,92,-46.1,0 +-3,92.9,-46.6,0 +-3,93.8,-47,0 +-3,94.7,-47.5,0 +-3,95.6,-47.9,0 +-3,96.5,-48.4,0 +-3,97.4,-48.8,0 +-3,98.3,-49.3,0 +-3,99.2,-49.7,0 +-3,100.2,-50.2,0 +-3,101.1,-50.7,0 +-3,102,-51.1,0 +-3,102.9,-51.6,0 +-3,103.8,-52,0 +-3,104.7,-52.5,0 +-3,105.6,-52.9,0 +-3,106.5,-53.4,0 +-3,107.4,-53.8,0 +-3,108.3,-54.3,0 +-3,109.2,-54.7,0 +-3,110.1,-55.2,0 +-3,111,-55.6,0 +-3,111.9,-56.1,0 +-3,112.8,-56.5,0 +-3,113.7,-57,0 +-3,114.6,-57.4,0 +-3,115.5,-57.9,0 +-3,116.4,-58.3,0 +-3,117.3,-58.8,0 +-3,118.2,-59.2,0 +-3,119.1,-59.7,0 +-3,120,-60.2,0 +-3,120.9,-60.6,0 +-3,121.8,-61.1,0 +-3,122.7,-61.5,0 +-3,123.6,-62,0 +-3,124.5,-62.4,0 +-3,125.4,-62.9,0 +-3,126.3,-63.3,0 +-3,127.2,-63.8,0 +-3,128.1,-64.2,0 +-3,129,-64.7,0 +-3,129.9,-65.1,0 +-3,130.8,-65.6,0 +-3,131.7,-66,0 +-3,132.6,-66.5,0 +-3,133.5,-66.9,0 +-3,134.4,-67.4,0 +-3,135.3,-67.8,0 +-3,136.2,-68.3,0 +-3,137.1,-68.7,0 +-3,138,-69.2,0 +-3,138.9,-69.6,0 +-3,139.8,-70.1,0 +-3,140.8,-70.6,0 +-3,141.7,-71,0 +-3,142.6,-71.5,0 +-3,143.5,-71.9,0 +-3,144.4,-72.4,0 +-3,145.3,-72.8,0 +-3,146.2,-73.3,0 +-3,147.1,-73.7,0 +-3,148,-74.2,0 +-3,148.9,-74.6,0 +-3,149.8,-75.1,0 +-3,150.7,-75.5,0 +-3,151.6,-76,0 +-3,152.5,-76.4,0 +-3,153.4,-76.9,0 +-3,154.3,-77.3,0 +-3,155.2,-77.8,0 +-3,156.1,-78.2,0 +-3,157,-78.7,0 +-3,157.9,-79.1,0 +-3,158.8,-79.6,0 +-3,159.7,-80.1,0 +-3,160.6,-80.5,0 +-3,161.5,-81,0 +-3,162.4,-81.4,0 +-3,163.3,-81.9,0 +-3,164.2,-82.3,0 +-3,165.1,-82.8,0 +-3,166,-83.2,0 +-3,166.9,-83.7,0 +-3,167.8,-84.1,0 +-3,168.7,-84.6,0 +-3,169.6,-85,0 +-3,170.5,-85.5,0 +-3,171.4,-85.9,0 +-3,172.3,-86.4,0 +-3,173.2,-86.8,0 +-3,174.1,-87.3,0 +-3,175,-87.7,0 +-3,175.9,-88.2,0 +-3,176.8,-88.6,0 +-3,177.7,-89.1,0 +-3,178.6,-89.5,0 +-3,179.5,-90,0 +-3,180.5,0,0 +-3,181.4,0,0 +-3,182.3,0,0 +-3,183.2,0,0 +-3,184.1,0,0 +-3,185,0,0 +-3,185.9,0,0 +-3,186.8,0,0 +-3,187.7,0,0 +-3,188.6,0,0 +-3,189.5,0,0 +-3,190.4,0,0 +-3,191.3,0,0 +-3,192.2,0,0 +-3,193.1,0,0 +-3,194,0,0 +-3,194.9,0,0 +-3,195.8,0,0 +-3,196.7,0,0 +-3,197.6,0,0 +-3,198.5,0,0 +-3,199.4,0,0 +-3,200.3,0,0 +-3,201.2,0,0 +-3,202.1,0,0 +-3,203,0,0 +-3,203.9,0,0 +-3,204.8,0,0 +-3,205.7,0,0 +-3,206.6,0,0 +-3,207.5,0,0 +-3,208.4,0,0 +-3,209.3,0,0 +-3,210.2,0,0 +-3,211.1,0,0 +-3,212,0,0 +-3,212.9,0,0 +-3,213.8,0,0 +-3,214.7,0,0 +-3,215.6,0,0 +-3,216.5,0,0 +-3,217.4,0,0 +-3,218.3,0,0 +-3,219.2,0,0 +-3,220.2,0,0 +-3,221.1,0,0 +-3,222,0,0 +-3,222.9,0,0 +-3,223.8,0,0 +-3,224.7,0,0 +-3,225.6,0,0 +-3,226.5,0,0 +-3,227.4,0,0 +-3,228.3,0,0 +-3,229.2,0,0 +-3,230.1,0,0 +-3,231,0,0 +-3,231.9,0,0 +-3,232.8,0,0 +-3,233.7,0,0 +-3,234.6,0,0 +-3,235.5,0,0 +-3,236.4,0,0 +-3,237.3,0,0 +-3,238.2,0,0 +-3,239.1,0,0 +-3,240,0,0 +-3,240.9,0,0 +-3,241.8,0,0 +-3,242.7,0,0 +-3,243.6,0,0 +-3,244.5,0,0 +-3,245.4,0,0 +-3,246.3,0,0 +-3,247.2,0,0 +-3,248.1,0,0 +-3,249,0,0 +-3,249.9,0,0 +-3,250.8,0,0 +-3,251.7,0,0 +-3,252.6,0,0 +-3,253.5,0,0 +-3,254.4,0,0 +-3,255.3,0,0 +-3,256.2,0,0 +-3,257.1,0,0 +-3,258,0,0 +-3,258.9,0,0 +-3,259.8,0,0 +-3,260.8,0,0 +-3,261.7,0,0 +-3,262.6,0,0 +-3,263.5,0,0 +-3,264.4,0,0 +-3,265.3,0,0 +-3,266.2,0,0 +-3,267.1,0,0 +-3,268,0,0 +-3,268.9,0,0 +-3,269.8,0,0 +-3,270.7,0,0 +-3,271.6,0,0 +-3,272.5,0,0 +-3,273.4,0,0 +-3,274.3,0,0 +-3,275.2,0,0 +-3,276.1,0,0 +-3,277,0,0 +-3,277.9,0,0 +-3,278.8,0,0 +-3,279.7,0,0 +-3,280.6,0,0 +-3,281.5,0,0 +-3,282.4,0,0 +-3,283.3,0,0 +-3,284.2,0,0 +-3,285.1,0,0 +-3,286,0,0 +-3,286.9,0,0 +-3,287.8,0,0 +-3,288.7,0,0 +-3,289.6,0,0 +-3,290.5,0,0 +-3,291.4,0,0 +-3,292.3,0,0 +-3,293.2,0,0 +-3,294.1,0,0 +-3,295,0,0 +-3,295.9,0,0 +-3,296.8,0,0 +-3,297.7,0,0 +-3,298.6,0,0 +-3,299.5,0,0 +-3,300.5,0,0 +-3,301.4,0,0 +-3,302.3,0,0 +-3,303.2,0,0 +-3,304.1,0,0 +-3,305,0,0 +-3,305.9,0,0 +-3,306.8,0,0 +-3,307.7,0,0 +-3,308.6,0,0 +-3,309.5,0,0 +-3,310.4,0,0 +-3,311.3,0,0 +-3,312.2,0,0 +-3,313.1,0,0 +-3,314,0,0 +-3,314.9,0,0 +-3,315.8,0,0 +-3,316.7,0,0 +-3,317.6,0,0 +-3,318.5,0,0 +-3,319.4,0,0 +-3,320.3,0,0 +-3,321.2,0,0 +-3,322.1,0,0 +-3,323,0,0 +-3,323.9,0,0 +-3,324.8,0,0 +-3,325.7,0,0 +-3,326.6,0,0 +-3,327.5,0,0 +-3,328.4,0,0 +-3,329.3,0,0 +-3,330.2,0,0 +-3,331.1,0,0 +-3,332,0,0 +-3,332.9,0,0 +-3,333.8,0,0 +-3,334.7,0,0 +-3,335.6,0,0 +-3,336.5,0,0 +-3,337.4,0,0 +-3,338.3,0,0 +-3,339.2,0,0 +-3,340.2,0,0 +-3,341.1,0,0 +-3,342,0,0 +-3,342.9,0,0 +-3,343.8,0,0 +-3,344.7,0,0 +-3,345.6,0,0 +-3,346.5,0,0 +-3,347.4,0,0 +-3,348.3,0,0 +-3,349.2,0,0 +-3,350.1,0,0 +-3,351,0,0 +-3,351.9,0,0 +-3,352.8,0,0 +-3,353.7,0,0 +-3,354.6,0,0 +-3,355.5,0,0 +-3,356.4,0,0 +-3,357.3,0,0 +-3,358.2,0,0 +-3,359.1,0,0 +-3,360,0,0 +-3,360,0,0 +-3,359.1,0,0 +-3,358.2,0,0 +-3,357.3,0,0 +-3,356.4,0,0 +-3,355.5,0,0 +-3,354.6,0,0 +-3,353.7,0,0 +-3,352.8,0,0 +-3,351.9,0,0 +-3,351,0,0 +-3,350.1,0,0 +-3,349.2,0,0 +-3,348.3,0,0 +-3,347.4,0,0 +-3,346.5,0,0 +-3,345.6,0,0 +-3,344.7,0,0 +-3,343.8,0,0 +-3,342.9,0,0 +-3,342,0,0 +-3,341.1,0,0 +-3,340.2,0,0 +-3,339.2,0,0 +-3,338.3,0,0 +-3,337.4,0,0 +-3,336.5,0,0 +-3,335.6,0,0 +-3,334.7,0,0 +-3,333.8,0,0 +-3,332.9,0,0 +-3,332,0,0 +-3,331.1,0,0 +-3,330.2,0,0 +-3,329.3,0,0 +-3,328.4,0,0 +-3,327.5,0,0 +-3,326.6,0,0 +-3,325.7,0,0 +-3,324.8,0,0 +-3,323.9,0,0 +-3,323,0,0 +-3,322.1,0,0 +-3,321.2,0,0 +-3,320.3,0,0 +-3,319.4,0,0 +-3,318.5,0,0 +-3,317.6,0,0 +-3,316.7,0,0 +-3,315.8,0,0 +-3,314.9,0,0 +-3,314,0,0 +-3,313.1,0,0 +-3,312.2,0,0 +-3,311.3,0,0 +-3,310.4,0,0 +-3,309.5,0,0 +-3,308.6,0,0 +-3,307.7,0,0 +-3,306.8,0,0 +-3,305.9,0,0 +-3,305,0,0 +-3,304.1,0,0 +-3,303.2,0,0 +-3,302.3,0,0 +-3,301.4,0,0 +-3,300.5,0,0 +-3,299.5,0,0 +-3,298.6,0,0 +-3,297.7,0,0 +-3,296.8,0,0 +-3,295.9,0,0 +-3,295,0,0 +-3,294.1,0,0 +-3,293.2,0,0 +-3,292.3,0,0 +-3,291.4,0,0 +-3,290.5,0,0 +-3,289.6,0,0 +-3,288.7,0,0 +-3,287.8,0,0 +-3,286.9,0,0 +-3,286,0,0 +-3,285.1,0,0 +-3,284.2,0,0 +-3,283.3,0,0 +-3,282.4,0,0 +-3,281.5,0,0 +-3,280.6,0,0 +-3,279.7,0,0 +-3,278.8,0,0 +-3,277.9,0,0 +-3,277,0,0 +-3,276.1,0,0 +-3,275.2,0,0 +-3,274.3,0,0 +-3,273.4,0,0 +-3,272.5,0,0 +-3,271.6,0,0 +-3,270.7,0,0 +-3,269.8,0,0 +-3,268.9,0,0 +-3,268,0,0 +-3,267.1,0,0 +-3,266.2,0,0 +-3,265.3,0,0 +-3,264.4,0,0 +-3,263.5,0,0 +-3,262.6,0,0 +-3,261.7,0,0 +-3,260.8,0,0 +-3,259.8,0,0 +-3,258.9,0,0 +-3,258,0,0 +-3,257.1,0,0 +-3,256.2,0,0 +-3,255.3,0,0 +-3,254.4,0,0 +-3,253.5,0,0 +-3,252.6,0,0 +-3,251.7,0,0 +-3,250.8,0,0 +-3,249.9,0,0 +-3,249,0,0 +-3,248.1,0,0 +-3,247.2,0,0 +-3,246.3,0,0 +-3,245.4,0,0 +-3,244.5,0,0 +-3,243.6,0,0 +-3,242.7,0,0 +-3,241.8,0,0 +-3,240.9,0,0 +-3,240,0,0 +-3,239.1,0,0 +-3,238.2,0,0 +-3,237.3,0,0 +-3,236.4,0,0 +-3,235.5,0,0 +-3,234.6,0,0 +-3,233.7,0,0 +-3,232.8,0,0 +-3,231.9,0,0 +-3,231,0,0 +-3,230.1,0,0 +-3,229.2,0,0 +-3,228.3,0,0 +-3,227.4,0,0 +-3,226.5,0,0 +-3,225.6,0,0 +-3,224.7,0,0 +-3,223.8,0,0 +-3,222.9,0,0 +-3,222,0,0 +-3,221.1,0,0 +-3,220.2,0,0 +-3,219.2,0,0 +-3,218.3,0,0 +-3,217.4,0,0 +-3,216.5,0,0 +-3,215.6,0,0 +-3,214.7,0,0 +-3,213.8,0,0 +-3,212.9,0,0 +-3,212,0,0 +-3,211.1,0,0 +-3,210.2,0,0 +-3,209.3,0,0 +-3,208.4,0,0 +-3,207.5,0,0 +-3,206.6,0,0 +-3,205.7,0,0 +-3,204.8,0,0 +-3,203.9,0,0 +-3,203,0,0 +-3,202.1,0,0 +-3,201.2,0,0 +-3,200.3,0,0 +-3,199.4,0,0 +-3,198.5,0,0 +-3,197.6,0,0 +-3,196.7,0,0 +-3,195.8,0,0 +-3,194.9,0,0 +-3,194,0,0 +-3,193.1,0,0 +-3,192.2,0,0 +-3,191.3,0,0 +-3,190.4,0,0 +-3,189.5,0,0 +-3,188.6,0,0 +-3,187.7,0,0 +-3,186.8,0,0 +-3,185.9,0,0 +-3,185,0,0 +-3,184.1,0,0 +-3,183.2,0,0 +-3,182.3,0,0 +-3,181.4,0,0 +-3,180.5,0,0 +-3,179.5,-90,0 +-3,178.6,-89.5,0 +-3,177.7,-89.1,0 +-3,176.8,-88.6,0 +-3,175.9,-88.2,0 +-3,175,-87.7,0 +-3,174.1,-87.3,0 +-3,173.2,-86.8,0 +-3,172.3,-86.4,0 +-3,171.4,-85.9,0 +-3,170.5,-85.5,0 +-3,169.6,-85,0 +-3,168.7,-84.6,0 +-3,167.8,-84.1,0 +-3,166.9,-83.7,0 +-3,166,-83.2,0 +-3,165.1,-82.8,0 +-3,164.2,-82.3,0 +-3,163.3,-81.9,0 +-3,162.4,-81.4,0 +-3,161.5,-81,0 +-3,160.6,-80.5,0 +-3,159.7,-80.1,0 +-3,158.8,-79.6,0 +-3,157.9,-79.1,0 +-3,157,-78.7,0 +-3,156.1,-78.2,0 +-3,155.2,-77.8,0 +-3,154.3,-77.3,0 +-3,153.4,-76.9,0 +-3,152.5,-76.4,0 +-3,151.6,-76,0 +-3,150.7,-75.5,0 +-3,149.8,-75.1,0 +-3,148.9,-74.6,0 +-3,148,-74.2,0 +-3,147.1,-73.7,0 +-3,146.2,-73.3,0 +-3,145.3,-72.8,0 +-3,144.4,-72.4,0 +-3,143.5,-71.9,0 +-3,142.6,-71.5,0 +-3,141.7,-71,0 +-3,140.8,-70.6,0 +-3,139.8,-70.1,0 +-3,138.9,-69.6,0 +-3,138,-69.2,0 +-3,137.1,-68.7,0 +-3,136.2,-68.3,0 +-3,135.3,-67.8,0 +-3,134.4,-67.4,0 +-3,133.5,-66.9,0 +-3,132.6,-66.5,0 +-3,131.7,-66,0 +-3,130.8,-65.6,0 +-3,129.9,-65.1,0 +-3,129,-64.7,0 +-3,128.1,-64.2,0 +-3,127.2,-63.8,0 +-3,126.3,-63.3,0 +-3,125.4,-62.9,0 +-3,124.5,-62.4,0 +-3,123.6,-62,0 +-3,122.7,-61.5,0 +-3,121.8,-61.1,0 +-3,120.9,-60.6,0 +-3,120,-60.2,0 +-3,119.1,-59.7,0 +-3,118.2,-59.2,0 +-3,117.3,-58.8,0 +-3,116.4,-58.3,0 +-3,115.5,-57.9,0 +-3,114.6,-57.4,0 +-3,113.7,-57,0 +-3,112.8,-56.5,0 +-3,111.9,-56.1,0 +-3,111,-55.6,0 +-3,110.1,-55.2,0 +-3,109.2,-54.7,0 +-3,108.3,-54.3,0 +-3,107.4,-53.8,0 +-3,106.5,-53.4,0 +-3,105.6,-52.9,0 +-3,104.7,-52.5,0 +-3,103.8,-52,0 +-3,102.9,-51.6,0 +-3,102,-51.1,0 +-3,101.1,-50.7,0 +-3,100.2,-50.2,0 +-3,99.2,-49.7,0 +-3,98.3,-49.3,0 +-3,97.4,-48.8,0 +-3,96.5,-48.4,0 +-3,95.6,-47.9,0 +-3,94.7,-47.5,0 +-3,93.8,-47,0 +-3,92.9,-46.6,0 +-3,92,-46.1,0 +-3,91.1,-45.7,0 +-3,90.2,-45.2,0 +-3,89.3,-44.8,90 +-3,88.4,-44.3,89.1 +-3,87.5,-43.9,88.2 +-3,86.6,-43.4,87.3 +-3,85.7,-43,86.4 +-3,84.8,-42.5,85.5 +-3,83.9,-42.1,84.5 +-3,83,-41.6,83.6 +-3,82.1,-41.2,82.7 +-3,81.2,-40.7,81.8 +-3,80.3,-40.3,80.9 +-3,79.4,-39.8,80 +-3,78.5,-39.3,79.1 +-3,77.6,-38.9,78.2 +-3,76.7,-38.4,77.3 +-3,75.8,-38,76.4 +-3,74.9,-37.5,75.5 +-3,74,-37.1,74.5 +-3,73.1,-36.6,73.6 +-3,72.2,-36.2,72.7 +-3,71.3,-35.7,71.8 +-3,70.4,-35.3,70.9 +-3,69.5,-34.8,70 +-3,68.6,-34.4,69.1 +-3,67.7,-33.9,68.2 +-3,66.8,-33.5,67.3 +-3,65.9,-33,66.4 +-3,65,-32.6,65.5 +-3,64.1,-32.1,64.5 +-3,63.2,-31.7,63.6 +-3,62.3,-31.2,62.7 +-3,61.4,-30.8,61.8 +-3,60.5,-30.3,60.9 +-3,59.5,-29.8,60 +-3,58.6,-29.4,59.1 +-3,57.7,-28.9,58.2 +-3,56.8,-28.5,57.3 +-3,55.9,-28,56.4 +-3,55,-27.6,55.5 +-3,54.1,-27.1,54.5 +-3,53.2,-26.7,53.6 +-3,52.3,-26.2,52.7 +-3,51.4,-25.8,51.8 +-3,50.5,-25.3,50.9 +-3,49.6,-24.9,50 +-3,48.7,-24.4,49.1 +-3,47.8,-24,48.2 +-3,46.9,-23.5,47.3 +-3,46,-23.1,46.4 +-3,45.1,-22.6,45.5 +-3,44.2,-22.2,44.5 +-3,43.3,-21.7,43.6 +-3,42.4,-21.3,42.7 +-3,41.5,-20.8,41.8 +-3,40.6,-20.4,40.9 +-3,39.7,-19.9,40 +-3,38.8,-19.4,39.1 +-3,37.9,-19,38.2 +-3,37,-18.5,37.3 +-3,36.1,-18.1,36.4 +-3,35.2,-17.6,35.5 +-3,34.3,-17.2,34.5 +-3,33.4,-16.7,33.6 +-3,32.5,-16.3,32.7 +-3,31.6,-15.8,31.8 +-3,30.7,-15.4,30.9 +-3,29.8,-14.9,30 +-3,28.9,-14.5,29.1 +-3,28,-14,28.2 +-3,27.1,-13.6,27.3 +-3,26.2,-13.1,26.4 +-3,25.3,-12.7,25.5 +-3,24.4,-12.2,24.5 +-3,23.5,-11.8,23.6 +-3,22.6,-11.3,22.7 +-3,21.7,-10.9,21.8 +-3,20.8,-10.4,20.9 +-3,19.8,-9.9,20 +-3,18.9,-9.5,19.1 +-3,18,-9,18.2 +-3,17.1,-8.6,17.3 +-3,16.2,-8.1,16.4 +-3,15.3,-7.7,15.5 +-3,14.4,-7.2,14.5 +-3,13.5,-6.8,13.6 +-3,12.6,-6.3,12.7 +-3,11.7,-5.9,11.8 +-3,10.8,-5.4,10.9 +-3,9.9,-5,10 +-3,9,-4.5,9.1 +-3,8.1,-4.1,8.2 +-3,7.2,-3.6,7.3 +-3,6.3,-3.2,6.4 +-3,5.4,-2.7,5.5 +-3,4.5,-2.3,4.5 +-3,3.6,-1.8,3.6 +-3,2.7,-1.4,2.7 +-3,1.8,-0.9,1.8 +-3,0.9,-0.5,0.9 +-3,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +0.9,0,0,0.3 +0.9,0,0,0.3 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.8,0,0,0.5 +0.8,0,0,0.5 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.5,0,0,0.8 +0.5,0,0,0.8 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.3,0,0,0.9 +0.3,0,0,0.9 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,0.9 +0.3,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.8 +0.5,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.7,0,0,0.8 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.8,0,0,0.7 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.5 +0.8,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.3 +0.9,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0 +-3,0,0,0 +-3,0.9,-0.5,0.9 +-3,1.8,-0.9,1.8 +-3,2.7,-1.4,2.7 +-3,3.6,-1.8,3.6 +-3,4.5,-2.3,4.5 +-3,5.4,-2.7,5.5 +-3,6.3,-3.2,6.4 +-3,7.2,-3.6,7.3 +-3,8.1,-4.1,8.2 +-3,9,-4.5,9.1 +-3,9.9,-5,10 +-3,10.8,-5.4,10.9 +-3,11.7,-5.9,11.8 +-3,12.6,-6.3,12.7 +-3,13.5,-6.8,13.6 +-3,14.4,-7.2,14.5 +-3,15.3,-7.7,15.5 +-3,16.2,-8.1,16.4 +-3,17.1,-8.6,17.3 +-3,18,-9,18.2 +-3,18.9,-9.5,19.1 +-3,19.8,-9.9,20 +-3,20.8,-10.4,20.9 +-3,21.7,-10.9,21.8 +-3,22.6,-11.3,22.7 +-3,23.5,-11.8,23.6 +-3,24.4,-12.2,24.5 +-3,25.3,-12.7,25.5 +-3,26.2,-13.1,26.4 +-3,27.1,-13.6,27.3 +-3,28,-14,28.2 +-3,28.9,-14.5,29.1 +-3,29.8,-14.9,30 +-3,30.7,-15.4,30.9 +-3,31.6,-15.8,31.8 +-3,32.5,-16.3,32.7 +-3,33.4,-16.7,33.6 +-3,34.3,-17.2,34.5 +-3,35.2,-17.6,35.5 +-3,36.1,-18.1,36.4 +-3,37,-18.5,37.3 +-3,37.9,-19,38.2 +-3,38.8,-19.4,39.1 +-3,39.7,-19.9,40 +-3,40.6,-20.4,40.9 +-3,41.5,-20.8,41.8 +-3,42.4,-21.3,42.7 +-3,43.3,-21.7,43.6 +-3,44.2,-22.2,44.5 +-3,45.1,-22.6,45.5 +-3,46,-23.1,46.4 +-3,46.9,-23.5,47.3 +-3,47.8,-24,48.2 +-3,48.7,-24.4,49.1 +-3,49.6,-24.9,50 +-3,50.5,-25.3,50.9 +-3,51.4,-25.8,51.8 +-3,52.3,-26.2,52.7 +-3,53.2,-26.7,53.6 +-3,54.1,-27.1,54.5 +-3,55,-27.6,55.5 +-3,55.9,-28,56.4 +-3,56.8,-28.5,57.3 +-3,57.7,-28.9,58.2 +-3,58.6,-29.4,59.1 +-3,59.5,-29.8,60 +-3,60.5,-30.3,60.9 +-3,61.4,-30.8,61.8 +-3,62.3,-31.2,62.7 +-3,63.2,-31.7,63.6 +-3,64.1,-32.1,64.5 +-3,65,-32.6,65.5 +-3,65.9,-33,66.4 +-3,66.8,-33.5,67.3 +-3,67.7,-33.9,68.2 +-3,68.6,-34.4,69.1 +-3,69.5,-34.8,70 +-3,70.4,-35.3,70.9 +-3,71.3,-35.7,71.8 +-3,72.2,-36.2,72.7 +-3,73.1,-36.6,73.6 +-3,74,-37.1,74.5 +-3,74.9,-37.5,75.5 +-3,75.8,-38,76.4 +-3,76.7,-38.4,77.3 +-3,77.6,-38.9,78.2 +-3,78.5,-39.3,79.1 +-3,79.4,-39.8,80 +-3,80.3,-40.3,80.9 +-3,81.2,-40.7,81.8 +-3,82.1,-41.2,82.7 +-3,83,-41.6,83.6 +-3,83.9,-42.1,84.5 +-3,84.8,-42.5,85.5 +-3,85.7,-43,86.4 +-3,86.6,-43.4,87.3 +-3,87.5,-43.9,88.2 +-3,88.4,-44.3,89.1 +-3,89.3,-44.8,90 +-3,90.2,-45.2,0 +-3,91.1,-45.7,0 +-3,92,-46.1,0 +-3,92.9,-46.6,0 +-3,93.8,-47,0 +-3,94.7,-47.5,0 +-3,95.6,-47.9,0 +-3,96.5,-48.4,0 +-3,97.4,-48.8,0 +-3,98.3,-49.3,0 +-3,99.2,-49.7,0 +-3,100.2,-50.2,0 +-3,101.1,-50.7,0 +-3,102,-51.1,0 +-3,102.9,-51.6,0 +-3,103.8,-52,0 +-3,104.7,-52.5,0 +-3,105.6,-52.9,0 +-3,106.5,-53.4,0 +-3,107.4,-53.8,0 +-3,108.3,-54.3,0 +-3,109.2,-54.7,0 +-3,110.1,-55.2,0 +-3,111,-55.6,0 +-3,111.9,-56.1,0 +-3,112.8,-56.5,0 +-3,113.7,-57,0 +-3,114.6,-57.4,0 +-3,115.5,-57.9,0 +-3,116.4,-58.3,0 +-3,117.3,-58.8,0 +-3,118.2,-59.2,0 +-3,119.1,-59.7,0 +-3,120,-60.2,0 +-3,120.9,-60.6,0 +-3,121.8,-61.1,0 +-3,122.7,-61.5,0 +-3,123.6,-62,0 +-3,124.5,-62.4,0 +-3,125.4,-62.9,0 +-3,126.3,-63.3,0 +-3,127.2,-63.8,0 +-3,128.1,-64.2,0 +-3,129,-64.7,0 +-3,129.9,-65.1,0 +-3,130.8,-65.6,0 +-3,131.7,-66,0 +-3,132.6,-66.5,0 +-3,133.5,-66.9,0 +-3,134.4,-67.4,0 +-3,135.3,-67.8,0 +-3,136.2,-68.3,0 +-3,137.1,-68.7,0 +-3,138,-69.2,0 +-3,138.9,-69.6,0 +-3,139.8,-70.1,0 +-3,140.8,-70.6,0 +-3,141.7,-71,0 +-3,142.6,-71.5,0 +-3,143.5,-71.9,0 +-3,144.4,-72.4,0 +-3,145.3,-72.8,0 +-3,146.2,-73.3,0 +-3,147.1,-73.7,0 +-3,148,-74.2,0 +-3,148.9,-74.6,0 +-3,149.8,-75.1,0 +-3,150.7,-75.5,0 +-3,151.6,-76,0 +-3,152.5,-76.4,0 +-3,153.4,-76.9,0 +-3,154.3,-77.3,0 +-3,155.2,-77.8,0 +-3,156.1,-78.2,0 +-3,157,-78.7,0 +-3,157.9,-79.1,0 +-3,158.8,-79.6,0 +-3,159.7,-80.1,0 +-3,160.6,-80.5,0 +-3,161.5,-81,0 +-3,162.4,-81.4,0 +-3,163.3,-81.9,0 +-3,164.2,-82.3,0 +-3,165.1,-82.8,0 +-3,166,-83.2,0 +-3,166.9,-83.7,0 +-3,167.8,-84.1,0 +-3,168.7,-84.6,0 +-3,169.6,-85,0 +-3,170.5,-85.5,0 +-3,171.4,-85.9,0 +-3,172.3,-86.4,0 +-3,173.2,-86.8,0 +-3,174.1,-87.3,0 +-3,175,-87.7,0 +-3,175.9,-88.2,0 +-3,176.8,-88.6,0 +-3,177.7,-89.1,0 +-3,178.6,-89.5,0 +-3,179.5,-90,0 +-3,180.5,0,0 +-3,181.4,0,0 +-3,182.3,0,0 +-3,183.2,0,0 +-3,184.1,0,0 +-3,185,0,0 +-3,185.9,0,0 +-3,186.8,0,0 +-3,187.7,0,0 +-3,188.6,0,0 +-3,189.5,0,0 +-3,190.4,0,0 +-3,191.3,0,0 +-3,192.2,0,0 +-3,193.1,0,0 +-3,194,0,0 +-3,194.9,0,0 +-3,195.8,0,0 +-3,196.7,0,0 +-3,197.6,0,0 +-3,198.5,0,0 +-3,199.4,0,0 +-3,200.3,0,0 +-3,201.2,0,0 +-3,202.1,0,0 +-3,203,0,0 +-3,203.9,0,0 +-3,204.8,0,0 +-3,205.7,0,0 +-3,206.6,0,0 +-3,207.5,0,0 +-3,208.4,0,0 +-3,209.3,0,0 +-3,210.2,0,0 +-3,211.1,0,0 +-3,212,0,0 +-3,212.9,0,0 +-3,213.8,0,0 +-3,214.7,0,0 +-3,215.6,0,0 +-3,216.5,0,0 +-3,217.4,0,0 +-3,218.3,0,0 +-3,219.2,0,0 +-3,220.2,0,0 +-3,221.1,0,0 +-3,222,0,0 +-3,222.9,0,0 +-3,223.8,0,0 +-3,224.7,0,0 +-3,225.6,0,0 +-3,226.5,0,0 +-3,227.4,0,0 +-3,228.3,0,0 +-3,229.2,0,0 +-3,230.1,0,0 +-3,231,0,0 +-3,231.9,0,0 +-3,232.8,0,0 +-3,233.7,0,0 +-3,234.6,0,0 +-3,235.5,0,0 +-3,236.4,0,0 +-3,237.3,0,0 +-3,238.2,0,0 +-3,239.1,0,0 +-3,240,0,0 +-3,240.9,0,0 +-3,241.8,0,0 +-3,242.7,0,0 +-3,243.6,0,0 +-3,244.5,0,0 +-3,245.4,0,0 +-3,246.3,0,0 +-3,247.2,0,0 +-3,248.1,0,0 +-3,249,0,0 +-3,249.9,0,0 +-3,250.8,0,0 +-3,251.7,0,0 +-3,252.6,0,0 +-3,253.5,0,0 +-3,254.4,0,0 +-3,255.3,0,0 +-3,256.2,0,0 +-3,257.1,0,0 +-3,258,0,0 +-3,258.9,0,0 +-3,259.8,0,0 +-3,260.8,0,0 +-3,261.7,0,0 +-3,262.6,0,0 +-3,263.5,0,0 +-3,264.4,0,0 +-3,265.3,0,0 +-3,266.2,0,0 +-3,267.1,0,0 +-3,268,0,0 +-3,268.9,0,0 +-3,269.8,0,0 +-3,270.7,0,0 +-3,271.6,0,0 +-3,272.5,0,0 +-3,273.4,0,0 +-3,274.3,0,0 +-3,275.2,0,0 +-3,276.1,0,0 +-3,277,0,0 +-3,277.9,0,0 +-3,278.8,0,0 +-3,279.7,0,0 +-3,280.6,0,0 +-3,281.5,0,0 +-3,282.4,0,0 +-3,283.3,0,0 +-3,284.2,0,0 +-3,285.1,0,0 +-3,286,0,0 +-3,286.9,0,0 +-3,287.8,0,0 +-3,288.7,0,0 +-3,289.6,0,0 +-3,290.5,0,0 +-3,291.4,0,0 +-3,292.3,0,0 +-3,293.2,0,0 +-3,294.1,0,0 +-3,295,0,0 +-3,295.9,0,0 +-3,296.8,0,0 +-3,297.7,0,0 +-3,298.6,0,0 +-3,299.5,0,0 +-3,300.5,0,0 +-3,301.4,0,0 +-3,302.3,0,0 +-3,303.2,0,0 +-3,304.1,0,0 +-3,305,0,0 +-3,305.9,0,0 +-3,306.8,0,0 +-3,307.7,0,0 +-3,308.6,0,0 +-3,309.5,0,0 +-3,310.4,0,0 +-3,311.3,0,0 +-3,312.2,0,0 +-3,313.1,0,0 +-3,314,0,0 +-3,314.9,0,0 +-3,315.8,0,0 +-3,316.7,0,0 +-3,317.6,0,0 +-3,318.5,0,0 +-3,319.4,0,0 +-3,320.3,0,0 +-3,321.2,0,0 +-3,322.1,0,0 +-3,323,0,0 +-3,323.9,0,0 +-3,324.8,0,0 +-3,325.7,0,0 +-3,326.6,0,0 +-3,327.5,0,0 +-3,328.4,0,0 +-3,329.3,0,0 +-3,330.2,0,0 +-3,331.1,0,0 +-3,332,0,0 +-3,332.9,0,0 +-3,333.8,0,0 +-3,334.7,0,0 +-3,335.6,0,0 +-3,336.5,0,0 +-3,337.4,0,0 +-3,338.3,0,0 +-3,339.2,0,0 +-3,340.2,0,0 +-3,341.1,0,0 +-3,342,0,0 +-3,342.9,0,0 +-3,343.8,0,0 +-3,344.7,0,0 +-3,345.6,0,0 +-3,346.5,0,0 +-3,347.4,0,0 +-3,348.3,0,0 +-3,349.2,0,0 +-3,350.1,0,0 +-3,351,0,0 +-3,351.9,0,0 +-3,352.8,0,0 +-3,353.7,0,0 +-3,354.6,0,0 +-3,355.5,0,0 +-3,356.4,0,0 +-3,357.3,0,0 +-3,358.2,0,0 +-3,359.1,0,0 +-3,360,0,0 +-3,360,0,0 +-3,359.1,0,0 +-3,358.2,0,0 +-3,357.3,0,0 +-3,356.4,0,0 +-3,355.5,0,0 +-3,354.6,0,0 +-3,353.7,0,0 +-3,352.8,0,0 +-3,351.9,0,0 +-3,351,0,0 +-3,350.1,0,0 +-3,349.2,0,0 +-3,348.3,0,0 +-3,347.4,0,0 +-3,346.5,0,0 +-3,345.6,0,0 +-3,344.7,0,0 +-3,343.8,0,0 +-3,342.9,0,0 +-3,342,0,0 +-3,341.1,0,0 +-3,340.2,0,0 +-3,339.2,0,0 +-3,338.3,0,0 +-3,337.4,0,0 +-3,336.5,0,0 +-3,335.6,0,0 +-3,334.7,0,0 +-3,333.8,0,0 +-3,332.9,0,0 +-3,332,0,0 +-3,331.1,0,0 +-3,330.2,0,0 +-3,329.3,0,0 +-3,328.4,0,0 +-3,327.5,0,0 +-3,326.6,0,0 +-3,325.7,0,0 +-3,324.8,0,0 +-3,323.9,0,0 +-3,323,0,0 +-3,322.1,0,0 +-3,321.2,0,0 +-3,320.3,0,0 +-3,319.4,0,0 +-3,318.5,0,0 +-3,317.6,0,0 +-3,316.7,0,0 +-3,315.8,0,0 +-3,314.9,0,0 +-3,314,0,0 +-3,313.1,0,0 +-3,312.2,0,0 +-3,311.3,0,0 +-3,310.4,0,0 +-3,309.5,0,0 +-3,308.6,0,0 +-3,307.7,0,0 +-3,306.8,0,0 +-3,305.9,0,0 +-3,305,0,0 +-3,304.1,0,0 +-3,303.2,0,0 +-3,302.3,0,0 +-3,301.4,0,0 +-3,300.5,0,0 +-3,299.5,0,0 +-3,298.6,0,0 +-3,297.7,0,0 +-3,296.8,0,0 +-3,295.9,0,0 +-3,295,0,0 +-3,294.1,0,0 +-3,293.2,0,0 +-3,292.3,0,0 +-3,291.4,0,0 +-3,290.5,0,0 +-3,289.6,0,0 +-3,288.7,0,0 +-3,287.8,0,0 +-3,286.9,0,0 +-3,286,0,0 +-3,285.1,0,0 +-3,284.2,0,0 +-3,283.3,0,0 +-3,282.4,0,0 +-3,281.5,0,0 +-3,280.6,0,0 +-3,279.7,0,0 +-3,278.8,0,0 +-3,277.9,0,0 +-3,277,0,0 +-3,276.1,0,0 +-3,275.2,0,0 +-3,274.3,0,0 +-3,273.4,0,0 +-3,272.5,0,0 +-3,271.6,0,0 +-3,270.7,0,0 +-3,269.8,0,0 +-3,268.9,0,0 +-3,268,0,0 +-3,267.1,0,0 +-3,266.2,0,0 +-3,265.3,0,0 +-3,264.4,0,0 +-3,263.5,0,0 +-3,262.6,0,0 +-3,261.7,0,0 +-3,260.8,0,0 +-3,259.8,0,0 +-3,258.9,0,0 +-3,258,0,0 +-3,257.1,0,0 +-3,256.2,0,0 +-3,255.3,0,0 +-3,254.4,0,0 +-3,253.5,0,0 +-3,252.6,0,0 +-3,251.7,0,0 +-3,250.8,0,0 +-3,249.9,0,0 +-3,249,0,0 +-3,248.1,0,0 +-3,247.2,0,0 +-3,246.3,0,0 +-3,245.4,0,0 +-3,244.5,0,0 +-3,243.6,0,0 +-3,242.7,0,0 +-3,241.8,0,0 +-3,240.9,0,0 +-3,240,0,0 +-3,239.1,0,0 +-3,238.2,0,0 +-3,237.3,0,0 +-3,236.4,0,0 +-3,235.5,0,0 +-3,234.6,0,0 +-3,233.7,0,0 +-3,232.8,0,0 +-3,231.9,0,0 +-3,231,0,0 +-3,230.1,0,0 +-3,229.2,0,0 +-3,228.3,0,0 +-3,227.4,0,0 +-3,226.5,0,0 +-3,225.6,0,0 +-3,224.7,0,0 +-3,223.8,0,0 +-3,222.9,0,0 +-3,222,0,0 +-3,221.1,0,0 +-3,220.2,0,0 +-3,219.2,0,0 +-3,218.3,0,0 +-3,217.4,0,0 +-3,216.5,0,0 +-3,215.6,0,0 +-3,214.7,0,0 +-3,213.8,0,0 +-3,212.9,0,0 +-3,212,0,0 +-3,211.1,0,0 +-3,210.2,0,0 +-3,209.3,0,0 +-3,208.4,0,0 +-3,207.5,0,0 +-3,206.6,0,0 +-3,205.7,0,0 +-3,204.8,0,0 +-3,203.9,0,0 +-3,203,0,0 +-3,202.1,0,0 +-3,201.2,0,0 +-3,200.3,0,0 +-3,199.4,0,0 +-3,198.5,0,0 +-3,197.6,0,0 +-3,196.7,0,0 +-3,195.8,0,0 +-3,194.9,0,0 +-3,194,0,0 +-3,193.1,0,0 +-3,192.2,0,0 +-3,191.3,0,0 +-3,190.4,0,0 +-3,189.5,0,0 +-3,188.6,0,0 +-3,187.7,0,0 +-3,186.8,0,0 +-3,185.9,0,0 +-3,185,0,0 +-3,184.1,0,0 +-3,183.2,0,0 +-3,182.3,0,0 +-3,181.4,0,0 +-3,180.5,0,0 +-3,179.5,-90,0 +-3,178.6,-89.5,0 +-3,177.7,-89.1,0 +-3,176.8,-88.6,0 +-3,175.9,-88.2,0 +-3,175,-87.7,0 +-3,174.1,-87.3,0 +-3,173.2,-86.8,0 +-3,172.3,-86.4,0 +-3,171.4,-85.9,0 +-3,170.5,-85.5,0 +-3,169.6,-85,0 +-3,168.7,-84.6,0 +-3,167.8,-84.1,0 +-3,166.9,-83.7,0 +-3,166,-83.2,0 +-3,165.1,-82.8,0 +-3,164.2,-82.3,0 +-3,163.3,-81.9,0 +-3,162.4,-81.4,0 +-3,161.5,-81,0 +-3,160.6,-80.5,0 +-3,159.7,-80.1,0 +-3,158.8,-79.6,0 +-3,157.9,-79.1,0 +-3,157,-78.7,0 +-3,156.1,-78.2,0 +-3,155.2,-77.8,0 +-3,154.3,-77.3,0 +-3,153.4,-76.9,0 +-3,152.5,-76.4,0 +-3,151.6,-76,0 +-3,150.7,-75.5,0 +-3,149.8,-75.1,0 +-3,148.9,-74.6,0 +-3,148,-74.2,0 +-3,147.1,-73.7,0 +-3,146.2,-73.3,0 +-3,145.3,-72.8,0 +-3,144.4,-72.4,0 +-3,143.5,-71.9,0 +-3,142.6,-71.5,0 +-3,141.7,-71,0 +-3,140.8,-70.6,0 +-3,139.8,-70.1,0 +-3,138.9,-69.6,0 +-3,138,-69.2,0 +-3,137.1,-68.7,0 +-3,136.2,-68.3,0 +-3,135.3,-67.8,0 +-3,134.4,-67.4,0 +-3,133.5,-66.9,0 +-3,132.6,-66.5,0 +-3,131.7,-66,0 +-3,130.8,-65.6,0 +-3,129.9,-65.1,0 +-3,129,-64.7,0 +-3,128.1,-64.2,0 +-3,127.2,-63.8,0 +-3,126.3,-63.3,0 +-3,125.4,-62.9,0 +-3,124.5,-62.4,0 +-3,123.6,-62,0 +-3,122.7,-61.5,0 +-3,121.8,-61.1,0 +-3,120.9,-60.6,0 +-3,120,-60.2,0 +-3,119.1,-59.7,0 +-3,118.2,-59.2,0 +-3,117.3,-58.8,0 +-3,116.4,-58.3,0 +-3,115.5,-57.9,0 +-3,114.6,-57.4,0 +-3,113.7,-57,0 +-3,112.8,-56.5,0 +-3,111.9,-56.1,0 +-3,111,-55.6,0 +-3,110.1,-55.2,0 +-3,109.2,-54.7,0 +-3,108.3,-54.3,0 +-3,107.4,-53.8,0 +-3,106.5,-53.4,0 +-3,105.6,-52.9,0 +-3,104.7,-52.5,0 +-3,103.8,-52,0 +-3,102.9,-51.6,0 +-3,102,-51.1,0 +-3,101.1,-50.7,0 +-3,100.2,-50.2,0 +-3,99.2,-49.7,0 +-3,98.3,-49.3,0 +-3,97.4,-48.8,0 +-3,96.5,-48.4,0 +-3,95.6,-47.9,0 +-3,94.7,-47.5,0 +-3,93.8,-47,0 +-3,92.9,-46.6,0 +-3,92,-46.1,0 +-3,91.1,-45.7,0 +-3,90.2,-45.2,0 +-3,89.3,-44.8,90 +-3,88.4,-44.3,89.1 +-3,87.5,-43.9,88.2 +-3,86.6,-43.4,87.3 +-3,85.7,-43,86.4 +-3,84.8,-42.5,85.5 +-3,83.9,-42.1,84.5 +-3,83,-41.6,83.6 +-3,82.1,-41.2,82.7 +-3,81.2,-40.7,81.8 +-3,80.3,-40.3,80.9 +-3,79.4,-39.8,80 +-3,78.5,-39.3,79.1 +-3,77.6,-38.9,78.2 +-3,76.7,-38.4,77.3 +-3,75.8,-38,76.4 +-3,74.9,-37.5,75.5 +-3,74,-37.1,74.5 +-3,73.1,-36.6,73.6 +-3,72.2,-36.2,72.7 +-3,71.3,-35.7,71.8 +-3,70.4,-35.3,70.9 +-3,69.5,-34.8,70 +-3,68.6,-34.4,69.1 +-3,67.7,-33.9,68.2 +-3,66.8,-33.5,67.3 +-3,65.9,-33,66.4 +-3,65,-32.6,65.5 +-3,64.1,-32.1,64.5 +-3,63.2,-31.7,63.6 +-3,62.3,-31.2,62.7 +-3,61.4,-30.8,61.8 +-3,60.5,-30.3,60.9 +-3,59.5,-29.8,60 +-3,58.6,-29.4,59.1 +-3,57.7,-28.9,58.2 +-3,56.8,-28.5,57.3 +-3,55.9,-28,56.4 +-3,55,-27.6,55.5 +-3,54.1,-27.1,54.5 +-3,53.2,-26.7,53.6 +-3,52.3,-26.2,52.7 +-3,51.4,-25.8,51.8 +-3,50.5,-25.3,50.9 +-3,49.6,-24.9,50 +-3,48.7,-24.4,49.1 +-3,47.8,-24,48.2 +-3,46.9,-23.5,47.3 +-3,46,-23.1,46.4 +-3,45.1,-22.6,45.5 +-3,44.2,-22.2,44.5 +-3,43.3,-21.7,43.6 +-3,42.4,-21.3,42.7 +-3,41.5,-20.8,41.8 +-3,40.6,-20.4,40.9 +-3,39.7,-19.9,40 +-3,38.8,-19.4,39.1 +-3,37.9,-19,38.2 +-3,37,-18.5,37.3 +-3,36.1,-18.1,36.4 +-3,35.2,-17.6,35.5 +-3,34.3,-17.2,34.5 +-3,33.4,-16.7,33.6 +-3,32.5,-16.3,32.7 +-3,31.6,-15.8,31.8 +-3,30.7,-15.4,30.9 +-3,29.8,-14.9,30 +-3,28.9,-14.5,29.1 +-3,28,-14,28.2 +-3,27.1,-13.6,27.3 +-3,26.2,-13.1,26.4 +-3,25.3,-12.7,25.5 +-3,24.4,-12.2,24.5 +-3,23.5,-11.8,23.6 +-3,22.6,-11.3,22.7 +-3,21.7,-10.9,21.8 +-3,20.8,-10.4,20.9 +-3,19.8,-9.9,20 +-3,18.9,-9.5,19.1 +-3,18,-9,18.2 +-3,17.1,-8.6,17.3 +-3,16.2,-8.1,16.4 +-3,15.3,-7.7,15.5 +-3,14.4,-7.2,14.5 +-3,13.5,-6.8,13.6 +-3,12.6,-6.3,12.7 +-3,11.7,-5.9,11.8 +-3,10.8,-5.4,10.9 +-3,9.9,-5,10 +-3,9,-4.5,9.1 +-3,8.1,-4.1,8.2 +-3,7.2,-3.6,7.3 +-3,6.3,-3.2,6.4 +-3,5.4,-2.7,5.5 +-3,4.5,-2.3,4.5 +-3,3.6,-1.8,3.6 +-3,2.7,-1.4,2.7 +-3,1.8,-0.9,1.8 +-3,0.9,-0.5,0.9 +-3,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +0.9,0,0,0.3 +0.9,0,0,0.3 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.8,0,0,0.5 +0.8,0,0,0.5 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.5,0,0,0.8 +0.5,0,0,0.8 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.3,0,0,0.9 +0.3,0,0,0.9 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,0.9 +0.3,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.8 +0.5,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.7,0,0,0.8 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.8,0,0,0.7 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.5 +0.8,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.3 +0.9,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0 +-3,0,0,0 +-3,0.9,-0.5,0.9 +-3,1.8,-0.9,1.8 +-3,2.7,-1.4,2.7 +-3,3.6,-1.8,3.6 +-3,4.5,-2.3,4.5 +-3,5.4,-2.7,5.5 +-3,6.3,-3.2,6.4 +-3,7.2,-3.6,7.3 +-3,8.1,-4.1,8.2 +-3,9,-4.5,9.1 +-3,9.9,-5,10 +-3,10.8,-5.4,10.9 +-3,11.7,-5.9,11.8 +-3,12.6,-6.3,12.7 +-3,13.5,-6.8,13.6 +-3,14.4,-7.2,14.5 +-3,15.3,-7.7,15.5 +-3,16.2,-8.1,16.4 +-3,17.1,-8.6,17.3 +-3,18,-9,18.2 +-3,18.9,-9.5,19.1 +-3,19.8,-9.9,20 +-3,20.8,-10.4,20.9 +-3,21.7,-10.9,21.8 +-3,22.6,-11.3,22.7 +-3,23.5,-11.8,23.6 +-3,24.4,-12.2,24.5 +-3,25.3,-12.7,25.5 +-3,26.2,-13.1,26.4 +-3,27.1,-13.6,27.3 +-3,28,-14,28.2 +-3,28.9,-14.5,29.1 +-3,29.8,-14.9,30 +-3,30.7,-15.4,30.9 +-3,31.6,-15.8,31.8 +-3,32.5,-16.3,32.7 +-3,33.4,-16.7,33.6 +-3,34.3,-17.2,34.5 +-3,35.2,-17.6,35.5 +-3,36.1,-18.1,36.4 +-3,37,-18.5,37.3 +-3,37.9,-19,38.2 +-3,38.8,-19.4,39.1 +-3,39.7,-19.9,40 +-3,40.6,-20.4,40.9 +-3,41.5,-20.8,41.8 +-3,42.4,-21.3,42.7 +-3,43.3,-21.7,43.6 +-3,44.2,-22.2,44.5 +-3,45.1,-22.6,45.5 +-3,46,-23.1,46.4 +-3,46.9,-23.5,47.3 +-3,47.8,-24,48.2 +-3,48.7,-24.4,49.1 +-3,49.6,-24.9,50 +-3,50.5,-25.3,50.9 +-3,51.4,-25.8,51.8 +-3,52.3,-26.2,52.7 +-3,53.2,-26.7,53.6 +-3,54.1,-27.1,54.5 +-3,55,-27.6,55.5 +-3,55.9,-28,56.4 +-3,56.8,-28.5,57.3 +-3,57.7,-28.9,58.2 +-3,58.6,-29.4,59.1 +-3,59.5,-29.8,60 +-3,60.5,-30.3,60.9 +-3,61.4,-30.8,61.8 +-3,62.3,-31.2,62.7 +-3,63.2,-31.7,63.6 +-3,64.1,-32.1,64.5 +-3,65,-32.6,65.5 +-3,65.9,-33,66.4 +-3,66.8,-33.5,67.3 +-3,67.7,-33.9,68.2 +-3,68.6,-34.4,69.1 +-3,69.5,-34.8,70 +-3,70.4,-35.3,70.9 +-3,71.3,-35.7,71.8 +-3,72.2,-36.2,72.7 +-3,73.1,-36.6,73.6 +-3,74,-37.1,74.5 +-3,74.9,-37.5,75.5 +-3,75.8,-38,76.4 +-3,76.7,-38.4,77.3 +-3,77.6,-38.9,78.2 +-3,78.5,-39.3,79.1 +-3,79.4,-39.8,80 +-3,80.3,-40.3,80.9 +-3,81.2,-40.7,81.8 +-3,82.1,-41.2,82.7 +-3,83,-41.6,83.6 +-3,83.9,-42.1,84.5 +-3,84.8,-42.5,85.5 +-3,85.7,-43,86.4 +-3,86.6,-43.4,87.3 +-3,87.5,-43.9,88.2 +-3,88.4,-44.3,89.1 +-3,89.3,-44.8,90 +-3,90.2,-45.2,0 +-3,91.1,-45.7,0 +-3,92,-46.1,0 +-3,92.9,-46.6,0 +-3,93.8,-47,0 +-3,94.7,-47.5,0 +-3,95.6,-47.9,0 +-3,96.5,-48.4,0 +-3,97.4,-48.8,0 +-3,98.3,-49.3,0 +-3,99.2,-49.7,0 +-3,100.2,-50.2,0 +-3,101.1,-50.7,0 +-3,102,-51.1,0 +-3,102.9,-51.6,0 +-3,103.8,-52,0 +-3,104.7,-52.5,0 +-3,105.6,-52.9,0 +-3,106.5,-53.4,0 +-3,107.4,-53.8,0 +-3,108.3,-54.3,0 +-3,109.2,-54.7,0 +-3,110.1,-55.2,0 +-3,111,-55.6,0 +-3,111.9,-56.1,0 +-3,112.8,-56.5,0 +-3,113.7,-57,0 +-3,114.6,-57.4,0 +-3,115.5,-57.9,0 +-3,116.4,-58.3,0 +-3,117.3,-58.8,0 +-3,118.2,-59.2,0 +-3,119.1,-59.7,0 +-3,120,-60.2,0 +-3,120.9,-60.6,0 +-3,121.8,-61.1,0 +-3,122.7,-61.5,0 +-3,123.6,-62,0 +-3,124.5,-62.4,0 +-3,125.4,-62.9,0 +-3,126.3,-63.3,0 +-3,127.2,-63.8,0 +-3,128.1,-64.2,0 +-3,129,-64.7,0 +-3,129.9,-65.1,0 +-3,130.8,-65.6,0 +-3,131.7,-66,0 +-3,132.6,-66.5,0 +-3,133.5,-66.9,0 +-3,134.4,-67.4,0 +-3,135.3,-67.8,0 +-3,136.2,-68.3,0 +-3,137.1,-68.7,0 +-3,138,-69.2,0 +-3,138.9,-69.6,0 +-3,139.8,-70.1,0 +-3,140.8,-70.6,0 +-3,141.7,-71,0 +-3,142.6,-71.5,0 +-3,143.5,-71.9,0 +-3,144.4,-72.4,0 +-3,145.3,-72.8,0 +-3,146.2,-73.3,0 +-3,147.1,-73.7,0 +-3,148,-74.2,0 +-3,148.9,-74.6,0 +-3,149.8,-75.1,0 +-3,150.7,-75.5,0 +-3,151.6,-76,0 +-3,152.5,-76.4,0 +-3,153.4,-76.9,0 +-3,154.3,-77.3,0 +-3,155.2,-77.8,0 +-3,156.1,-78.2,0 +-3,157,-78.7,0 +-3,157.9,-79.1,0 +-3,158.8,-79.6,0 +-3,159.7,-80.1,0 +-3,160.6,-80.5,0 +-3,161.5,-81,0 +-3,162.4,-81.4,0 +-3,163.3,-81.9,0 +-3,164.2,-82.3,0 +-3,165.1,-82.8,0 +-3,166,-83.2,0 +-3,166.9,-83.7,0 +-3,167.8,-84.1,0 +-3,168.7,-84.6,0 +-3,169.6,-85,0 +-3,170.5,-85.5,0 +-3,171.4,-85.9,0 +-3,172.3,-86.4,0 +-3,173.2,-86.8,0 +-3,174.1,-87.3,0 +-3,175,-87.7,0 +-3,175.9,-88.2,0 +-3,176.8,-88.6,0 +-3,177.7,-89.1,0 +-3,178.6,-89.5,0 +-3,179.5,-90,0 +-3,180.5,0,0 +-3,181.4,0,0 +-3,182.3,0,0 +-3,183.2,0,0 +-3,184.1,0,0 +-3,185,0,0 +-3,185.9,0,0 +-3,186.8,0,0 +-3,187.7,0,0 +-3,188.6,0,0 +-3,189.5,0,0 +-3,190.4,0,0 +-3,191.3,0,0 +-3,192.2,0,0 +-3,193.1,0,0 +-3,194,0,0 +-3,194.9,0,0 +-3,195.8,0,0 +-3,196.7,0,0 +-3,197.6,0,0 +-3,198.5,0,0 +-3,199.4,0,0 +-3,200.3,0,0 +-3,201.2,0,0 +-3,202.1,0,0 +-3,203,0,0 +-3,203.9,0,0 +-3,204.8,0,0 +-3,205.7,0,0 +-3,206.6,0,0 +-3,207.5,0,0 +-3,208.4,0,0 +-3,209.3,0,0 +-3,210.2,0,0 +-3,211.1,0,0 +-3,212,0,0 +-3,212.9,0,0 +-3,213.8,0,0 +-3,214.7,0,0 +-3,215.6,0,0 +-3,216.5,0,0 +-3,217.4,0,0 +-3,218.3,0,0 +-3,219.2,0,0 +-3,220.2,0,0 +-3,221.1,0,0 +-3,222,0,0 +-3,222.9,0,0 +-3,223.8,0,0 +-3,224.7,0,0 +-3,225.6,0,0 +-3,226.5,0,0 +-3,227.4,0,0 +-3,228.3,0,0 +-3,229.2,0,0 +-3,230.1,0,0 +-3,231,0,0 +-3,231.9,0,0 +-3,232.8,0,0 +-3,233.7,0,0 +-3,234.6,0,0 +-3,235.5,0,0 +-3,236.4,0,0 +-3,237.3,0,0 +-3,238.2,0,0 +-3,239.1,0,0 +-3,240,0,0 +-3,240.9,0,0 +-3,241.8,0,0 +-3,242.7,0,0 +-3,243.6,0,0 +-3,244.5,0,0 +-3,245.4,0,0 +-3,246.3,0,0 +-3,247.2,0,0 +-3,248.1,0,0 +-3,249,0,0 +-3,249.9,0,0 +-3,250.8,0,0 +-3,251.7,0,0 +-3,252.6,0,0 +-3,253.5,0,0 +-3,254.4,0,0 +-3,255.3,0,0 +-3,256.2,0,0 +-3,257.1,0,0 +-3,258,0,0 +-3,258.9,0,0 +-3,259.8,0,0 +-3,260.8,0,0 +-3,261.7,0,0 +-3,262.6,0,0 +-3,263.5,0,0 +-3,264.4,0,0 +-3,265.3,0,0 +-3,266.2,0,0 +-3,267.1,0,0 +-3,268,0,0 +-3,268.9,0,0 +-3,269.8,0,0 +-3,270.7,0,0 +-3,271.6,0,0 +-3,272.5,0,0 +-3,273.4,0,0 +-3,274.3,0,0 +-3,275.2,0,0 +-3,276.1,0,0 +-3,277,0,0 +-3,277.9,0,0 +-3,278.8,0,0 +-3,279.7,0,0 +-3,280.6,0,0 +-3,281.5,0,0 +-3,282.4,0,0 +-3,283.3,0,0 +-3,284.2,0,0 +-3,285.1,0,0 +-3,286,0,0 +-3,286.9,0,0 +-3,287.8,0,0 +-3,288.7,0,0 +-3,289.6,0,0 +-3,290.5,0,0 +-3,291.4,0,0 +-3,292.3,0,0 +-3,293.2,0,0 +-3,294.1,0,0 +-3,295,0,0 +-3,295.9,0,0 +-3,296.8,0,0 +-3,297.7,0,0 +-3,298.6,0,0 +-3,299.5,0,0 +-3,300.5,0,0 +-3,301.4,0,0 +-3,302.3,0,0 +-3,303.2,0,0 +-3,304.1,0,0 +-3,305,0,0 +-3,305.9,0,0 +-3,306.8,0,0 +-3,307.7,0,0 +-3,308.6,0,0 +-3,309.5,0,0 +-3,310.4,0,0 +-3,311.3,0,0 +-3,312.2,0,0 +-3,313.1,0,0 +-3,314,0,0 +-3,314.9,0,0 +-3,315.8,0,0 +-3,316.7,0,0 +-3,317.6,0,0 +-3,318.5,0,0 +-3,319.4,0,0 +-3,320.3,0,0 +-3,321.2,0,0 +-3,322.1,0,0 +-3,323,0,0 +-3,323.9,0,0 +-3,324.8,0,0 +-3,325.7,0,0 +-3,326.6,0,0 +-3,327.5,0,0 +-3,328.4,0,0 +-3,329.3,0,0 +-3,330.2,0,0 +-3,331.1,0,0 +-3,332,0,0 +-3,332.9,0,0 +-3,333.8,0,0 +-3,334.7,0,0 +-3,335.6,0,0 +-3,336.5,0,0 +-3,337.4,0,0 +-3,338.3,0,0 +-3,339.2,0,0 +-3,340.2,0,0 +-3,341.1,0,0 +-3,342,0,0 +-3,342.9,0,0 +-3,343.8,0,0 +-3,344.7,0,0 +-3,345.6,0,0 +-3,346.5,0,0 +-3,347.4,0,0 +-3,348.3,0,0 +-3,349.2,0,0 +-3,350.1,0,0 +-3,351,0,0 +-3,351.9,0,0 +-3,352.8,0,0 +-3,353.7,0,0 +-3,354.6,0,0 +-3,355.5,0,0 +-3,356.4,0,0 +-3,357.3,0,0 +-3,358.2,0,0 +-3,359.1,0,0 +-3,360,0,0 diff --git a/scripts/trajectories/rotate_euler_quaternion_30s_delayed_voip.csv b/scripts/trajectories/rotate_euler_quaternion_30s_delayed_voip.csv new file mode 100644 index 0000000000000000000000000000000000000000..cd42f9f9ae2837af247098668144cac2956b543a --- /dev/null +++ b/scripts/trajectories/rotate_euler_quaternion_30s_delayed_voip.csv @@ -0,0 +1,6032 @@ +-3,360,0,0 +-3,360,0,0 +-3,360,0,0 +-3,360,0,0 +-3,360,0,0 +-3,360,0,0 +-3,360,0,0 +-3,360,0,0 +-3,360,0,0 +-3,360,0,0 +-3,360,0,0 +-3,360,0,0 +-3,360,0,0 +-3,360,0,0 +-3,360,0,0 +-3,360,0,0 +-3,360,0,0 +-3,360,0,0 +-3,360,0,0 +-3,360,0,0 +-3,360,0,0 +-3,360,0,0 +-3,360,0,0 +-3,360,0,0 +-3,360,0,0 +-3,360,0,0 +-3,360,0,0 +-3,360,0,0 +-3,360,0,0 +-3,360,0,0 +-3,360,0,0 +-3,360,0,0 +-3,360,0,0 +-3,359.1,0,0 +-3,358.2,0,0 +-3,357.3,0,0 +-3,356.4,0,0 +-3,355.5,0,0 +-3,354.6,0,0 +-3,353.7,0,0 +-3,352.8,0,0 +-3,351.9,0,0 +-3,351,0,0 +-3,350.1,0,0 +-3,349.2,0,0 +-3,348.3,0,0 +-3,347.4,0,0 +-3,346.5,0,0 +-3,345.6,0,0 +-3,344.7,0,0 +-3,343.8,0,0 +-3,342.9,0,0 +-3,342,0,0 +-3,341.1,0,0 +-3,340.2,0,0 +-3,339.2,0,0 +-3,338.3,0,0 +-3,337.4,0,0 +-3,336.5,0,0 +-3,335.6,0,0 +-3,334.7,0,0 +-3,333.8,0,0 +-3,332.9,0,0 +-3,332,0,0 +-3,331.1,0,0 +-3,330.2,0,0 +-3,329.3,0,0 +-3,328.4,0,0 +-3,327.5,0,0 +-3,326.6,0,0 +-3,325.7,0,0 +-3,324.8,0,0 +-3,323.9,0,0 +-3,323,0,0 +-3,322.1,0,0 +-3,321.2,0,0 +-3,320.3,0,0 +-3,319.4,0,0 +-3,318.5,0,0 +-3,317.6,0,0 +-3,316.7,0,0 +-3,315.8,0,0 +-3,314.9,0,0 +-3,314,0,0 +-3,313.1,0,0 +-3,312.2,0,0 +-3,311.3,0,0 +-3,310.4,0,0 +-3,309.5,0,0 +-3,308.6,0,0 +-3,307.7,0,0 +-3,306.8,0,0 +-3,305.9,0,0 +-3,305,0,0 +-3,304.1,0,0 +-3,303.2,0,0 +-3,302.3,0,0 +-3,301.4,0,0 +-3,300.5,0,0 +-3,299.5,0,0 +-3,298.6,0,0 +-3,297.7,0,0 +-3,296.8,0,0 +-3,295.9,0,0 +-3,295,0,0 +-3,294.1,0,0 +-3,293.2,0,0 +-3,292.3,0,0 +-3,291.4,0,0 +-3,290.5,0,0 +-3,289.6,0,0 +-3,288.7,0,0 +-3,287.8,0,0 +-3,286.9,0,0 +-3,286,0,0 +-3,285.1,0,0 +-3,284.2,0,0 +-3,283.3,0,0 +-3,282.4,0,0 +-3,281.5,0,0 +-3,280.6,0,0 +-3,279.7,0,0 +-3,278.8,0,0 +-3,277.9,0,0 +-3,277,0,0 +-3,276.1,0,0 +-3,275.2,0,0 +-3,274.3,0,0 +-3,273.4,0,0 +-3,272.5,0,0 +-3,271.6,0,0 +-3,270.7,0,0 +-3,269.8,0,0 +-3,268.9,0,0 +-3,268,0,0 +-3,267.1,0,0 +-3,266.2,0,0 +-3,265.3,0,0 +-3,264.4,0,0 +-3,263.5,0,0 +-3,262.6,0,0 +-3,261.7,0,0 +-3,260.8,0,0 +-3,259.8,0,0 +-3,258.9,0,0 +-3,258,0,0 +-3,257.1,0,0 +-3,256.2,0,0 +-3,255.3,0,0 +-3,254.4,0,0 +-3,253.5,0,0 +-3,252.6,0,0 +-3,251.7,0,0 +-3,250.8,0,0 +-3,249.9,0,0 +-3,249,0,0 +-3,248.1,0,0 +-3,247.2,0,0 +-3,246.3,0,0 +-3,245.4,0,0 +-3,244.5,0,0 +-3,243.6,0,0 +-3,242.7,0,0 +-3,241.8,0,0 +-3,240.9,0,0 +-3,240,0,0 +-3,239.1,0,0 +-3,238.2,0,0 +-3,237.3,0,0 +-3,236.4,0,0 +-3,235.5,0,0 +-3,234.6,0,0 +-3,233.7,0,0 +-3,232.8,0,0 +-3,231.9,0,0 +-3,231,0,0 +-3,230.1,0,0 +-3,229.2,0,0 +-3,228.3,0,0 +-3,227.4,0,0 +-3,226.5,0,0 +-3,225.6,0,0 +-3,224.7,0,0 +-3,223.8,0,0 +-3,222.9,0,0 +-3,222,0,0 +-3,221.1,0,0 +-3,220.2,0,0 +-3,219.2,0,0 +-3,218.3,0,0 +-3,217.4,0,0 +-3,216.5,0,0 +-3,215.6,0,0 +-3,214.7,0,0 +-3,213.8,0,0 +-3,212.9,0,0 +-3,212,0,0 +-3,211.1,0,0 +-3,210.2,0,0 +-3,209.3,0,0 +-3,208.4,0,0 +-3,207.5,0,0 +-3,206.6,0,0 +-3,205.7,0,0 +-3,204.8,0,0 +-3,203.9,0,0 +-3,203,0,0 +-3,202.1,0,0 +-3,201.2,0,0 +-3,200.3,0,0 +-3,199.4,0,0 +-3,198.5,0,0 +-3,197.6,0,0 +-3,196.7,0,0 +-3,195.8,0,0 +-3,194.9,0,0 +-3,194,0,0 +-3,193.1,0,0 +-3,192.2,0,0 +-3,191.3,0,0 +-3,190.4,0,0 +-3,189.5,0,0 +-3,188.6,0,0 +-3,187.7,0,0 +-3,186.8,0,0 +-3,185.9,0,0 +-3,185,0,0 +-3,184.1,0,0 +-3,183.2,0,0 +-3,182.3,0,0 +-3,181.4,0,0 +-3,180.5,0,0 +-3,179.5,-90,0 +-3,178.6,-89.5,0 +-3,177.7,-89.1,0 +-3,176.8,-88.6,0 +-3,175.9,-88.2,0 +-3,175,-87.7,0 +-3,174.1,-87.3,0 +-3,173.2,-86.8,0 +-3,172.3,-86.4,0 +-3,171.4,-85.9,0 +-3,170.5,-85.5,0 +-3,169.6,-85,0 +-3,168.7,-84.6,0 +-3,167.8,-84.1,0 +-3,166.9,-83.7,0 +-3,166,-83.2,0 +-3,165.1,-82.8,0 +-3,164.2,-82.3,0 +-3,163.3,-81.9,0 +-3,162.4,-81.4,0 +-3,161.5,-81,0 +-3,160.6,-80.5,0 +-3,159.7,-80.1,0 +-3,158.8,-79.6,0 +-3,157.9,-79.1,0 +-3,157,-78.7,0 +-3,156.1,-78.2,0 +-3,155.2,-77.8,0 +-3,154.3,-77.3,0 +-3,153.4,-76.9,0 +-3,152.5,-76.4,0 +-3,151.6,-76,0 +-3,150.7,-75.5,0 +-3,149.8,-75.1,0 +-3,148.9,-74.6,0 +-3,148,-74.2,0 +-3,147.1,-73.7,0 +-3,146.2,-73.3,0 +-3,145.3,-72.8,0 +-3,144.4,-72.4,0 +-3,143.5,-71.9,0 +-3,142.6,-71.5,0 +-3,141.7,-71,0 +-3,140.8,-70.6,0 +-3,139.8,-70.1,0 +-3,138.9,-69.6,0 +-3,138,-69.2,0 +-3,137.1,-68.7,0 +-3,136.2,-68.3,0 +-3,135.3,-67.8,0 +-3,134.4,-67.4,0 +-3,133.5,-66.9,0 +-3,132.6,-66.5,0 +-3,131.7,-66,0 +-3,130.8,-65.6,0 +-3,129.9,-65.1,0 +-3,129,-64.7,0 +-3,128.1,-64.2,0 +-3,127.2,-63.8,0 +-3,126.3,-63.3,0 +-3,125.4,-62.9,0 +-3,124.5,-62.4,0 +-3,123.6,-62,0 +-3,122.7,-61.5,0 +-3,121.8,-61.1,0 +-3,120.9,-60.6,0 +-3,120,-60.2,0 +-3,119.1,-59.7,0 +-3,118.2,-59.2,0 +-3,117.3,-58.8,0 +-3,116.4,-58.3,0 +-3,115.5,-57.9,0 +-3,114.6,-57.4,0 +-3,113.7,-57,0 +-3,112.8,-56.5,0 +-3,111.9,-56.1,0 +-3,111,-55.6,0 +-3,110.1,-55.2,0 +-3,109.2,-54.7,0 +-3,108.3,-54.3,0 +-3,107.4,-53.8,0 +-3,106.5,-53.4,0 +-3,105.6,-52.9,0 +-3,104.7,-52.5,0 +-3,103.8,-52,0 +-3,102.9,-51.6,0 +-3,102,-51.1,0 +-3,101.1,-50.7,0 +-3,100.2,-50.2,0 +-3,99.2,-49.7,0 +-3,98.3,-49.3,0 +-3,97.4,-48.8,0 +-3,96.5,-48.4,0 +-3,95.6,-47.9,0 +-3,94.7,-47.5,0 +-3,93.8,-47,0 +-3,92.9,-46.6,0 +-3,92,-46.1,0 +-3,91.1,-45.7,0 +-3,90.2,-45.2,0 +-3,89.3,-44.8,90 +-3,88.4,-44.3,89.1 +-3,87.5,-43.9,88.2 +-3,86.6,-43.4,87.3 +-3,85.7,-43,86.4 +-3,84.8,-42.5,85.5 +-3,83.9,-42.1,84.5 +-3,83,-41.6,83.6 +-3,82.1,-41.2,82.7 +-3,81.2,-40.7,81.8 +-3,80.3,-40.3,80.9 +-3,79.4,-39.8,80 +-3,78.5,-39.3,79.1 +-3,77.6,-38.9,78.2 +-3,76.7,-38.4,77.3 +-3,75.8,-38,76.4 +-3,74.9,-37.5,75.5 +-3,74,-37.1,74.5 +-3,73.1,-36.6,73.6 +-3,72.2,-36.2,72.7 +-3,71.3,-35.7,71.8 +-3,70.4,-35.3,70.9 +-3,69.5,-34.8,70 +-3,68.6,-34.4,69.1 +-3,67.7,-33.9,68.2 +-3,66.8,-33.5,67.3 +-3,65.9,-33,66.4 +-3,65,-32.6,65.5 +-3,64.1,-32.1,64.5 +-3,63.2,-31.7,63.6 +-3,62.3,-31.2,62.7 +-3,61.4,-30.8,61.8 +-3,60.5,-30.3,60.9 +-3,59.5,-29.8,60 +-3,58.6,-29.4,59.1 +-3,57.7,-28.9,58.2 +-3,56.8,-28.5,57.3 +-3,55.9,-28,56.4 +-3,55,-27.6,55.5 +-3,54.1,-27.1,54.5 +-3,53.2,-26.7,53.6 +-3,52.3,-26.2,52.7 +-3,51.4,-25.8,51.8 +-3,50.5,-25.3,50.9 +-3,49.6,-24.9,50 +-3,48.7,-24.4,49.1 +-3,47.8,-24,48.2 +-3,46.9,-23.5,47.3 +-3,46,-23.1,46.4 +-3,45.1,-22.6,45.5 +-3,44.2,-22.2,44.5 +-3,43.3,-21.7,43.6 +-3,42.4,-21.3,42.7 +-3,41.5,-20.8,41.8 +-3,40.6,-20.4,40.9 +-3,39.7,-19.9,40 +-3,38.8,-19.4,39.1 +-3,37.9,-19,38.2 +-3,37,-18.5,37.3 +-3,36.1,-18.1,36.4 +-3,35.2,-17.6,35.5 +-3,34.3,-17.2,34.5 +-3,33.4,-16.7,33.6 +-3,32.5,-16.3,32.7 +-3,31.6,-15.8,31.8 +-3,30.7,-15.4,30.9 +-3,29.8,-14.9,30 +-3,28.9,-14.5,29.1 +-3,28,-14,28.2 +-3,27.1,-13.6,27.3 +-3,26.2,-13.1,26.4 +-3,25.3,-12.7,25.5 +-3,24.4,-12.2,24.5 +-3,23.5,-11.8,23.6 +-3,22.6,-11.3,22.7 +-3,21.7,-10.9,21.8 +-3,20.8,-10.4,20.9 +-3,19.8,-9.9,20 +-3,18.9,-9.5,19.1 +-3,18,-9,18.2 +-3,17.1,-8.6,17.3 +-3,16.2,-8.1,16.4 +-3,15.3,-7.7,15.5 +-3,14.4,-7.2,14.5 +-3,13.5,-6.8,13.6 +-3,12.6,-6.3,12.7 +-3,11.7,-5.9,11.8 +-3,10.8,-5.4,10.9 +-3,9.9,-5,10 +-3,9,-4.5,9.1 +-3,8.1,-4.1,8.2 +-3,7.2,-3.6,7.3 +-3,6.3,-3.2,6.4 +-3,5.4,-2.7,5.5 +-3,4.5,-2.3,4.5 +-3,3.6,-1.8,3.6 +-3,2.7,-1.4,2.7 +-3,1.8,-0.9,1.8 +-3,0.9,-0.5,0.9 +-3,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +0.9,0,0,0.3 +0.9,0,0,0.3 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.8,0,0,0.5 +0.8,0,0,0.5 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.5,0,0,0.8 +0.5,0,0,0.8 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.3,0,0,0.9 +0.3,0,0,0.9 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,0.9 +0.3,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.8 +0.5,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.7,0,0,0.8 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.8,0,0,0.7 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.5 +0.8,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.3 +0.9,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0 +-3,0,0,0 +-3,0.9,-0.5,0.9 +-3,1.8,-0.9,1.8 +-3,2.7,-1.4,2.7 +-3,3.6,-1.8,3.6 +-3,4.5,-2.3,4.5 +-3,5.4,-2.7,5.5 +-3,6.3,-3.2,6.4 +-3,7.2,-3.6,7.3 +-3,8.1,-4.1,8.2 +-3,9,-4.5,9.1 +-3,9.9,-5,10 +-3,10.8,-5.4,10.9 +-3,11.7,-5.9,11.8 +-3,12.6,-6.3,12.7 +-3,13.5,-6.8,13.6 +-3,14.4,-7.2,14.5 +-3,15.3,-7.7,15.5 +-3,16.2,-8.1,16.4 +-3,17.1,-8.6,17.3 +-3,18,-9,18.2 +-3,18.9,-9.5,19.1 +-3,19.8,-9.9,20 +-3,20.8,-10.4,20.9 +-3,21.7,-10.9,21.8 +-3,22.6,-11.3,22.7 +-3,23.5,-11.8,23.6 +-3,24.4,-12.2,24.5 +-3,25.3,-12.7,25.5 +-3,26.2,-13.1,26.4 +-3,27.1,-13.6,27.3 +-3,28,-14,28.2 +-3,28.9,-14.5,29.1 +-3,29.8,-14.9,30 +-3,30.7,-15.4,30.9 +-3,31.6,-15.8,31.8 +-3,32.5,-16.3,32.7 +-3,33.4,-16.7,33.6 +-3,34.3,-17.2,34.5 +-3,35.2,-17.6,35.5 +-3,36.1,-18.1,36.4 +-3,37,-18.5,37.3 +-3,37.9,-19,38.2 +-3,38.8,-19.4,39.1 +-3,39.7,-19.9,40 +-3,40.6,-20.4,40.9 +-3,41.5,-20.8,41.8 +-3,42.4,-21.3,42.7 +-3,43.3,-21.7,43.6 +-3,44.2,-22.2,44.5 +-3,45.1,-22.6,45.5 +-3,46,-23.1,46.4 +-3,46.9,-23.5,47.3 +-3,47.8,-24,48.2 +-3,48.7,-24.4,49.1 +-3,49.6,-24.9,50 +-3,50.5,-25.3,50.9 +-3,51.4,-25.8,51.8 +-3,52.3,-26.2,52.7 +-3,53.2,-26.7,53.6 +-3,54.1,-27.1,54.5 +-3,55,-27.6,55.5 +-3,55.9,-28,56.4 +-3,56.8,-28.5,57.3 +-3,57.7,-28.9,58.2 +-3,58.6,-29.4,59.1 +-3,59.5,-29.8,60 +-3,60.5,-30.3,60.9 +-3,61.4,-30.8,61.8 +-3,62.3,-31.2,62.7 +-3,63.2,-31.7,63.6 +-3,64.1,-32.1,64.5 +-3,65,-32.6,65.5 +-3,65.9,-33,66.4 +-3,66.8,-33.5,67.3 +-3,67.7,-33.9,68.2 +-3,68.6,-34.4,69.1 +-3,69.5,-34.8,70 +-3,70.4,-35.3,70.9 +-3,71.3,-35.7,71.8 +-3,72.2,-36.2,72.7 +-3,73.1,-36.6,73.6 +-3,74,-37.1,74.5 +-3,74.9,-37.5,75.5 +-3,75.8,-38,76.4 +-3,76.7,-38.4,77.3 +-3,77.6,-38.9,78.2 +-3,78.5,-39.3,79.1 +-3,79.4,-39.8,80 +-3,80.3,-40.3,80.9 +-3,81.2,-40.7,81.8 +-3,82.1,-41.2,82.7 +-3,83,-41.6,83.6 +-3,83.9,-42.1,84.5 +-3,84.8,-42.5,85.5 +-3,85.7,-43,86.4 +-3,86.6,-43.4,87.3 +-3,87.5,-43.9,88.2 +-3,88.4,-44.3,89.1 +-3,89.3,-44.8,90 +-3,90.2,-45.2,0 +-3,91.1,-45.7,0 +-3,92,-46.1,0 +-3,92.9,-46.6,0 +-3,93.8,-47,0 +-3,94.7,-47.5,0 +-3,95.6,-47.9,0 +-3,96.5,-48.4,0 +-3,97.4,-48.8,0 +-3,98.3,-49.3,0 +-3,99.2,-49.7,0 +-3,100.2,-50.2,0 +-3,101.1,-50.7,0 +-3,102,-51.1,0 +-3,102.9,-51.6,0 +-3,103.8,-52,0 +-3,104.7,-52.5,0 +-3,105.6,-52.9,0 +-3,106.5,-53.4,0 +-3,107.4,-53.8,0 +-3,108.3,-54.3,0 +-3,109.2,-54.7,0 +-3,110.1,-55.2,0 +-3,111,-55.6,0 +-3,111.9,-56.1,0 +-3,112.8,-56.5,0 +-3,113.7,-57,0 +-3,114.6,-57.4,0 +-3,115.5,-57.9,0 +-3,116.4,-58.3,0 +-3,117.3,-58.8,0 +-3,118.2,-59.2,0 +-3,119.1,-59.7,0 +-3,120,-60.2,0 +-3,120.9,-60.6,0 +-3,121.8,-61.1,0 +-3,122.7,-61.5,0 +-3,123.6,-62,0 +-3,124.5,-62.4,0 +-3,125.4,-62.9,0 +-3,126.3,-63.3,0 +-3,127.2,-63.8,0 +-3,128.1,-64.2,0 +-3,129,-64.7,0 +-3,129.9,-65.1,0 +-3,130.8,-65.6,0 +-3,131.7,-66,0 +-3,132.6,-66.5,0 +-3,133.5,-66.9,0 +-3,134.4,-67.4,0 +-3,135.3,-67.8,0 +-3,136.2,-68.3,0 +-3,137.1,-68.7,0 +-3,138,-69.2,0 +-3,138.9,-69.6,0 +-3,139.8,-70.1,0 +-3,140.8,-70.6,0 +-3,141.7,-71,0 +-3,142.6,-71.5,0 +-3,143.5,-71.9,0 +-3,144.4,-72.4,0 +-3,145.3,-72.8,0 +-3,146.2,-73.3,0 +-3,147.1,-73.7,0 +-3,148,-74.2,0 +-3,148.9,-74.6,0 +-3,149.8,-75.1,0 +-3,150.7,-75.5,0 +-3,151.6,-76,0 +-3,152.5,-76.4,0 +-3,153.4,-76.9,0 +-3,154.3,-77.3,0 +-3,155.2,-77.8,0 +-3,156.1,-78.2,0 +-3,157,-78.7,0 +-3,157.9,-79.1,0 +-3,158.8,-79.6,0 +-3,159.7,-80.1,0 +-3,160.6,-80.5,0 +-3,161.5,-81,0 +-3,162.4,-81.4,0 +-3,163.3,-81.9,0 +-3,164.2,-82.3,0 +-3,165.1,-82.8,0 +-3,166,-83.2,0 +-3,166.9,-83.7,0 +-3,167.8,-84.1,0 +-3,168.7,-84.6,0 +-3,169.6,-85,0 +-3,170.5,-85.5,0 +-3,171.4,-85.9,0 +-3,172.3,-86.4,0 +-3,173.2,-86.8,0 +-3,174.1,-87.3,0 +-3,175,-87.7,0 +-3,175.9,-88.2,0 +-3,176.8,-88.6,0 +-3,177.7,-89.1,0 +-3,178.6,-89.5,0 +-3,179.5,-90,0 +-3,180.5,0,0 +-3,181.4,0,0 +-3,182.3,0,0 +-3,183.2,0,0 +-3,184.1,0,0 +-3,185,0,0 +-3,185.9,0,0 +-3,186.8,0,0 +-3,187.7,0,0 +-3,188.6,0,0 +-3,189.5,0,0 +-3,190.4,0,0 +-3,191.3,0,0 +-3,192.2,0,0 +-3,193.1,0,0 +-3,194,0,0 +-3,194.9,0,0 +-3,195.8,0,0 +-3,196.7,0,0 +-3,197.6,0,0 +-3,198.5,0,0 +-3,199.4,0,0 +-3,200.3,0,0 +-3,201.2,0,0 +-3,202.1,0,0 +-3,203,0,0 +-3,203.9,0,0 +-3,204.8,0,0 +-3,205.7,0,0 +-3,206.6,0,0 +-3,207.5,0,0 +-3,208.4,0,0 +-3,209.3,0,0 +-3,210.2,0,0 +-3,211.1,0,0 +-3,212,0,0 +-3,212.9,0,0 +-3,213.8,0,0 +-3,214.7,0,0 +-3,215.6,0,0 +-3,216.5,0,0 +-3,217.4,0,0 +-3,218.3,0,0 +-3,219.2,0,0 +-3,220.2,0,0 +-3,221.1,0,0 +-3,222,0,0 +-3,222.9,0,0 +-3,223.8,0,0 +-3,224.7,0,0 +-3,225.6,0,0 +-3,226.5,0,0 +-3,227.4,0,0 +-3,228.3,0,0 +-3,229.2,0,0 +-3,230.1,0,0 +-3,231,0,0 +-3,231.9,0,0 +-3,232.8,0,0 +-3,233.7,0,0 +-3,234.6,0,0 +-3,235.5,0,0 +-3,236.4,0,0 +-3,237.3,0,0 +-3,238.2,0,0 +-3,239.1,0,0 +-3,240,0,0 +-3,240.9,0,0 +-3,241.8,0,0 +-3,242.7,0,0 +-3,243.6,0,0 +-3,244.5,0,0 +-3,245.4,0,0 +-3,246.3,0,0 +-3,247.2,0,0 +-3,248.1,0,0 +-3,249,0,0 +-3,249.9,0,0 +-3,250.8,0,0 +-3,251.7,0,0 +-3,252.6,0,0 +-3,253.5,0,0 +-3,254.4,0,0 +-3,255.3,0,0 +-3,256.2,0,0 +-3,257.1,0,0 +-3,258,0,0 +-3,258.9,0,0 +-3,259.8,0,0 +-3,260.8,0,0 +-3,261.7,0,0 +-3,262.6,0,0 +-3,263.5,0,0 +-3,264.4,0,0 +-3,265.3,0,0 +-3,266.2,0,0 +-3,267.1,0,0 +-3,268,0,0 +-3,268.9,0,0 +-3,269.8,0,0 +-3,270.7,0,0 +-3,271.6,0,0 +-3,272.5,0,0 +-3,273.4,0,0 +-3,274.3,0,0 +-3,275.2,0,0 +-3,276.1,0,0 +-3,277,0,0 +-3,277.9,0,0 +-3,278.8,0,0 +-3,279.7,0,0 +-3,280.6,0,0 +-3,281.5,0,0 +-3,282.4,0,0 +-3,283.3,0,0 +-3,284.2,0,0 +-3,285.1,0,0 +-3,286,0,0 +-3,286.9,0,0 +-3,287.8,0,0 +-3,288.7,0,0 +-3,289.6,0,0 +-3,290.5,0,0 +-3,291.4,0,0 +-3,292.3,0,0 +-3,293.2,0,0 +-3,294.1,0,0 +-3,295,0,0 +-3,295.9,0,0 +-3,296.8,0,0 +-3,297.7,0,0 +-3,298.6,0,0 +-3,299.5,0,0 +-3,300.5,0,0 +-3,301.4,0,0 +-3,302.3,0,0 +-3,303.2,0,0 +-3,304.1,0,0 +-3,305,0,0 +-3,305.9,0,0 +-3,306.8,0,0 +-3,307.7,0,0 +-3,308.6,0,0 +-3,309.5,0,0 +-3,310.4,0,0 +-3,311.3,0,0 +-3,312.2,0,0 +-3,313.1,0,0 +-3,314,0,0 +-3,314.9,0,0 +-3,315.8,0,0 +-3,316.7,0,0 +-3,317.6,0,0 +-3,318.5,0,0 +-3,319.4,0,0 +-3,320.3,0,0 +-3,321.2,0,0 +-3,322.1,0,0 +-3,323,0,0 +-3,323.9,0,0 +-3,324.8,0,0 +-3,325.7,0,0 +-3,326.6,0,0 +-3,327.5,0,0 +-3,328.4,0,0 +-3,329.3,0,0 +-3,330.2,0,0 +-3,331.1,0,0 +-3,332,0,0 +-3,332.9,0,0 +-3,333.8,0,0 +-3,334.7,0,0 +-3,335.6,0,0 +-3,336.5,0,0 +-3,337.4,0,0 +-3,338.3,0,0 +-3,339.2,0,0 +-3,340.2,0,0 +-3,341.1,0,0 +-3,342,0,0 +-3,342.9,0,0 +-3,343.8,0,0 +-3,344.7,0,0 +-3,345.6,0,0 +-3,346.5,0,0 +-3,347.4,0,0 +-3,348.3,0,0 +-3,349.2,0,0 +-3,350.1,0,0 +-3,351,0,0 +-3,351.9,0,0 +-3,352.8,0,0 +-3,353.7,0,0 +-3,354.6,0,0 +-3,355.5,0,0 +-3,356.4,0,0 +-3,357.3,0,0 +-3,358.2,0,0 +-3,359.1,0,0 +-3,360,0,0 +-3,360,0,0 +-3,359.1,0,0 +-3,358.2,0,0 +-3,357.3,0,0 +-3,356.4,0,0 +-3,355.5,0,0 +-3,354.6,0,0 +-3,353.7,0,0 +-3,352.8,0,0 +-3,351.9,0,0 +-3,351,0,0 +-3,350.1,0,0 +-3,349.2,0,0 +-3,348.3,0,0 +-3,347.4,0,0 +-3,346.5,0,0 +-3,345.6,0,0 +-3,344.7,0,0 +-3,343.8,0,0 +-3,342.9,0,0 +-3,342,0,0 +-3,341.1,0,0 +-3,340.2,0,0 +-3,339.2,0,0 +-3,338.3,0,0 +-3,337.4,0,0 +-3,336.5,0,0 +-3,335.6,0,0 +-3,334.7,0,0 +-3,333.8,0,0 +-3,332.9,0,0 +-3,332,0,0 +-3,331.1,0,0 +-3,330.2,0,0 +-3,329.3,0,0 +-3,328.4,0,0 +-3,327.5,0,0 +-3,326.6,0,0 +-3,325.7,0,0 +-3,324.8,0,0 +-3,323.9,0,0 +-3,323,0,0 +-3,322.1,0,0 +-3,321.2,0,0 +-3,320.3,0,0 +-3,319.4,0,0 +-3,318.5,0,0 +-3,317.6,0,0 +-3,316.7,0,0 +-3,315.8,0,0 +-3,314.9,0,0 +-3,314,0,0 +-3,313.1,0,0 +-3,312.2,0,0 +-3,311.3,0,0 +-3,310.4,0,0 +-3,309.5,0,0 +-3,308.6,0,0 +-3,307.7,0,0 +-3,306.8,0,0 +-3,305.9,0,0 +-3,305,0,0 +-3,304.1,0,0 +-3,303.2,0,0 +-3,302.3,0,0 +-3,301.4,0,0 +-3,300.5,0,0 +-3,299.5,0,0 +-3,298.6,0,0 +-3,297.7,0,0 +-3,296.8,0,0 +-3,295.9,0,0 +-3,295,0,0 +-3,294.1,0,0 +-3,293.2,0,0 +-3,292.3,0,0 +-3,291.4,0,0 +-3,290.5,0,0 +-3,289.6,0,0 +-3,288.7,0,0 +-3,287.8,0,0 +-3,286.9,0,0 +-3,286,0,0 +-3,285.1,0,0 +-3,284.2,0,0 +-3,283.3,0,0 +-3,282.4,0,0 +-3,281.5,0,0 +-3,280.6,0,0 +-3,279.7,0,0 +-3,278.8,0,0 +-3,277.9,0,0 +-3,277,0,0 +-3,276.1,0,0 +-3,275.2,0,0 +-3,274.3,0,0 +-3,273.4,0,0 +-3,272.5,0,0 +-3,271.6,0,0 +-3,270.7,0,0 +-3,269.8,0,0 +-3,268.9,0,0 +-3,268,0,0 +-3,267.1,0,0 +-3,266.2,0,0 +-3,265.3,0,0 +-3,264.4,0,0 +-3,263.5,0,0 +-3,262.6,0,0 +-3,261.7,0,0 +-3,260.8,0,0 +-3,259.8,0,0 +-3,258.9,0,0 +-3,258,0,0 +-3,257.1,0,0 +-3,256.2,0,0 +-3,255.3,0,0 +-3,254.4,0,0 +-3,253.5,0,0 +-3,252.6,0,0 +-3,251.7,0,0 +-3,250.8,0,0 +-3,249.9,0,0 +-3,249,0,0 +-3,248.1,0,0 +-3,247.2,0,0 +-3,246.3,0,0 +-3,245.4,0,0 +-3,244.5,0,0 +-3,243.6,0,0 +-3,242.7,0,0 +-3,241.8,0,0 +-3,240.9,0,0 +-3,240,0,0 +-3,239.1,0,0 +-3,238.2,0,0 +-3,237.3,0,0 +-3,236.4,0,0 +-3,235.5,0,0 +-3,234.6,0,0 +-3,233.7,0,0 +-3,232.8,0,0 +-3,231.9,0,0 +-3,231,0,0 +-3,230.1,0,0 +-3,229.2,0,0 +-3,228.3,0,0 +-3,227.4,0,0 +-3,226.5,0,0 +-3,225.6,0,0 +-3,224.7,0,0 +-3,223.8,0,0 +-3,222.9,0,0 +-3,222,0,0 +-3,221.1,0,0 +-3,220.2,0,0 +-3,219.2,0,0 +-3,218.3,0,0 +-3,217.4,0,0 +-3,216.5,0,0 +-3,215.6,0,0 +-3,214.7,0,0 +-3,213.8,0,0 +-3,212.9,0,0 +-3,212,0,0 +-3,211.1,0,0 +-3,210.2,0,0 +-3,209.3,0,0 +-3,208.4,0,0 +-3,207.5,0,0 +-3,206.6,0,0 +-3,205.7,0,0 +-3,204.8,0,0 +-3,203.9,0,0 +-3,203,0,0 +-3,202.1,0,0 +-3,201.2,0,0 +-3,200.3,0,0 +-3,199.4,0,0 +-3,198.5,0,0 +-3,197.6,0,0 +-3,196.7,0,0 +-3,195.8,0,0 +-3,194.9,0,0 +-3,194,0,0 +-3,193.1,0,0 +-3,192.2,0,0 +-3,191.3,0,0 +-3,190.4,0,0 +-3,189.5,0,0 +-3,188.6,0,0 +-3,187.7,0,0 +-3,186.8,0,0 +-3,185.9,0,0 +-3,185,0,0 +-3,184.1,0,0 +-3,183.2,0,0 +-3,182.3,0,0 +-3,181.4,0,0 +-3,180.5,0,0 +-3,179.5,-90,0 +-3,178.6,-89.5,0 +-3,177.7,-89.1,0 +-3,176.8,-88.6,0 +-3,175.9,-88.2,0 +-3,175,-87.7,0 +-3,174.1,-87.3,0 +-3,173.2,-86.8,0 +-3,172.3,-86.4,0 +-3,171.4,-85.9,0 +-3,170.5,-85.5,0 +-3,169.6,-85,0 +-3,168.7,-84.6,0 +-3,167.8,-84.1,0 +-3,166.9,-83.7,0 +-3,166,-83.2,0 +-3,165.1,-82.8,0 +-3,164.2,-82.3,0 +-3,163.3,-81.9,0 +-3,162.4,-81.4,0 +-3,161.5,-81,0 +-3,160.6,-80.5,0 +-3,159.7,-80.1,0 +-3,158.8,-79.6,0 +-3,157.9,-79.1,0 +-3,157,-78.7,0 +-3,156.1,-78.2,0 +-3,155.2,-77.8,0 +-3,154.3,-77.3,0 +-3,153.4,-76.9,0 +-3,152.5,-76.4,0 +-3,151.6,-76,0 +-3,150.7,-75.5,0 +-3,149.8,-75.1,0 +-3,148.9,-74.6,0 +-3,148,-74.2,0 +-3,147.1,-73.7,0 +-3,146.2,-73.3,0 +-3,145.3,-72.8,0 +-3,144.4,-72.4,0 +-3,143.5,-71.9,0 +-3,142.6,-71.5,0 +-3,141.7,-71,0 +-3,140.8,-70.6,0 +-3,139.8,-70.1,0 +-3,138.9,-69.6,0 +-3,138,-69.2,0 +-3,137.1,-68.7,0 +-3,136.2,-68.3,0 +-3,135.3,-67.8,0 +-3,134.4,-67.4,0 +-3,133.5,-66.9,0 +-3,132.6,-66.5,0 +-3,131.7,-66,0 +-3,130.8,-65.6,0 +-3,129.9,-65.1,0 +-3,129,-64.7,0 +-3,128.1,-64.2,0 +-3,127.2,-63.8,0 +-3,126.3,-63.3,0 +-3,125.4,-62.9,0 +-3,124.5,-62.4,0 +-3,123.6,-62,0 +-3,122.7,-61.5,0 +-3,121.8,-61.1,0 +-3,120.9,-60.6,0 +-3,120,-60.2,0 +-3,119.1,-59.7,0 +-3,118.2,-59.2,0 +-3,117.3,-58.8,0 +-3,116.4,-58.3,0 +-3,115.5,-57.9,0 +-3,114.6,-57.4,0 +-3,113.7,-57,0 +-3,112.8,-56.5,0 +-3,111.9,-56.1,0 +-3,111,-55.6,0 +-3,110.1,-55.2,0 +-3,109.2,-54.7,0 +-3,108.3,-54.3,0 +-3,107.4,-53.8,0 +-3,106.5,-53.4,0 +-3,105.6,-52.9,0 +-3,104.7,-52.5,0 +-3,103.8,-52,0 +-3,102.9,-51.6,0 +-3,102,-51.1,0 +-3,101.1,-50.7,0 +-3,100.2,-50.2,0 +-3,99.2,-49.7,0 +-3,98.3,-49.3,0 +-3,97.4,-48.8,0 +-3,96.5,-48.4,0 +-3,95.6,-47.9,0 +-3,94.7,-47.5,0 +-3,93.8,-47,0 +-3,92.9,-46.6,0 +-3,92,-46.1,0 +-3,91.1,-45.7,0 +-3,90.2,-45.2,0 +-3,89.3,-44.8,90 +-3,88.4,-44.3,89.1 +-3,87.5,-43.9,88.2 +-3,86.6,-43.4,87.3 +-3,85.7,-43,86.4 +-3,84.8,-42.5,85.5 +-3,83.9,-42.1,84.5 +-3,83,-41.6,83.6 +-3,82.1,-41.2,82.7 +-3,81.2,-40.7,81.8 +-3,80.3,-40.3,80.9 +-3,79.4,-39.8,80 +-3,78.5,-39.3,79.1 +-3,77.6,-38.9,78.2 +-3,76.7,-38.4,77.3 +-3,75.8,-38,76.4 +-3,74.9,-37.5,75.5 +-3,74,-37.1,74.5 +-3,73.1,-36.6,73.6 +-3,72.2,-36.2,72.7 +-3,71.3,-35.7,71.8 +-3,70.4,-35.3,70.9 +-3,69.5,-34.8,70 +-3,68.6,-34.4,69.1 +-3,67.7,-33.9,68.2 +-3,66.8,-33.5,67.3 +-3,65.9,-33,66.4 +-3,65,-32.6,65.5 +-3,64.1,-32.1,64.5 +-3,63.2,-31.7,63.6 +-3,62.3,-31.2,62.7 +-3,61.4,-30.8,61.8 +-3,60.5,-30.3,60.9 +-3,59.5,-29.8,60 +-3,58.6,-29.4,59.1 +-3,57.7,-28.9,58.2 +-3,56.8,-28.5,57.3 +-3,55.9,-28,56.4 +-3,55,-27.6,55.5 +-3,54.1,-27.1,54.5 +-3,53.2,-26.7,53.6 +-3,52.3,-26.2,52.7 +-3,51.4,-25.8,51.8 +-3,50.5,-25.3,50.9 +-3,49.6,-24.9,50 +-3,48.7,-24.4,49.1 +-3,47.8,-24,48.2 +-3,46.9,-23.5,47.3 +-3,46,-23.1,46.4 +-3,45.1,-22.6,45.5 +-3,44.2,-22.2,44.5 +-3,43.3,-21.7,43.6 +-3,42.4,-21.3,42.7 +-3,41.5,-20.8,41.8 +-3,40.6,-20.4,40.9 +-3,39.7,-19.9,40 +-3,38.8,-19.4,39.1 +-3,37.9,-19,38.2 +-3,37,-18.5,37.3 +-3,36.1,-18.1,36.4 +-3,35.2,-17.6,35.5 +-3,34.3,-17.2,34.5 +-3,33.4,-16.7,33.6 +-3,32.5,-16.3,32.7 +-3,31.6,-15.8,31.8 +-3,30.7,-15.4,30.9 +-3,29.8,-14.9,30 +-3,28.9,-14.5,29.1 +-3,28,-14,28.2 +-3,27.1,-13.6,27.3 +-3,26.2,-13.1,26.4 +-3,25.3,-12.7,25.5 +-3,24.4,-12.2,24.5 +-3,23.5,-11.8,23.6 +-3,22.6,-11.3,22.7 +-3,21.7,-10.9,21.8 +-3,20.8,-10.4,20.9 +-3,19.8,-9.9,20 +-3,18.9,-9.5,19.1 +-3,18,-9,18.2 +-3,17.1,-8.6,17.3 +-3,16.2,-8.1,16.4 +-3,15.3,-7.7,15.5 +-3,14.4,-7.2,14.5 +-3,13.5,-6.8,13.6 +-3,12.6,-6.3,12.7 +-3,11.7,-5.9,11.8 +-3,10.8,-5.4,10.9 +-3,9.9,-5,10 +-3,9,-4.5,9.1 +-3,8.1,-4.1,8.2 +-3,7.2,-3.6,7.3 +-3,6.3,-3.2,6.4 +-3,5.4,-2.7,5.5 +-3,4.5,-2.3,4.5 +-3,3.6,-1.8,3.6 +-3,2.7,-1.4,2.7 +-3,1.8,-0.9,1.8 +-3,0.9,-0.5,0.9 +-3,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +0.9,0,0,0.3 +0.9,0,0,0.3 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.8,0,0,0.5 +0.8,0,0,0.5 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.5,0,0,0.8 +0.5,0,0,0.8 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.3,0,0,0.9 +0.3,0,0,0.9 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,0.9 +0.3,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.8 +0.5,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.7,0,0,0.8 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.8,0,0,0.7 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.5 +0.8,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.3 +0.9,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0 +-3,0,0,0 +-3,0.9,-0.5,0.9 +-3,1.8,-0.9,1.8 +-3,2.7,-1.4,2.7 +-3,3.6,-1.8,3.6 +-3,4.5,-2.3,4.5 +-3,5.4,-2.7,5.5 +-3,6.3,-3.2,6.4 +-3,7.2,-3.6,7.3 +-3,8.1,-4.1,8.2 +-3,9,-4.5,9.1 +-3,9.9,-5,10 +-3,10.8,-5.4,10.9 +-3,11.7,-5.9,11.8 +-3,12.6,-6.3,12.7 +-3,13.5,-6.8,13.6 +-3,14.4,-7.2,14.5 +-3,15.3,-7.7,15.5 +-3,16.2,-8.1,16.4 +-3,17.1,-8.6,17.3 +-3,18,-9,18.2 +-3,18.9,-9.5,19.1 +-3,19.8,-9.9,20 +-3,20.8,-10.4,20.9 +-3,21.7,-10.9,21.8 +-3,22.6,-11.3,22.7 +-3,23.5,-11.8,23.6 +-3,24.4,-12.2,24.5 +-3,25.3,-12.7,25.5 +-3,26.2,-13.1,26.4 +-3,27.1,-13.6,27.3 +-3,28,-14,28.2 +-3,28.9,-14.5,29.1 +-3,29.8,-14.9,30 +-3,30.7,-15.4,30.9 +-3,31.6,-15.8,31.8 +-3,32.5,-16.3,32.7 +-3,33.4,-16.7,33.6 +-3,34.3,-17.2,34.5 +-3,35.2,-17.6,35.5 +-3,36.1,-18.1,36.4 +-3,37,-18.5,37.3 +-3,37.9,-19,38.2 +-3,38.8,-19.4,39.1 +-3,39.7,-19.9,40 +-3,40.6,-20.4,40.9 +-3,41.5,-20.8,41.8 +-3,42.4,-21.3,42.7 +-3,43.3,-21.7,43.6 +-3,44.2,-22.2,44.5 +-3,45.1,-22.6,45.5 +-3,46,-23.1,46.4 +-3,46.9,-23.5,47.3 +-3,47.8,-24,48.2 +-3,48.7,-24.4,49.1 +-3,49.6,-24.9,50 +-3,50.5,-25.3,50.9 +-3,51.4,-25.8,51.8 +-3,52.3,-26.2,52.7 +-3,53.2,-26.7,53.6 +-3,54.1,-27.1,54.5 +-3,55,-27.6,55.5 +-3,55.9,-28,56.4 +-3,56.8,-28.5,57.3 +-3,57.7,-28.9,58.2 +-3,58.6,-29.4,59.1 +-3,59.5,-29.8,60 +-3,60.5,-30.3,60.9 +-3,61.4,-30.8,61.8 +-3,62.3,-31.2,62.7 +-3,63.2,-31.7,63.6 +-3,64.1,-32.1,64.5 +-3,65,-32.6,65.5 +-3,65.9,-33,66.4 +-3,66.8,-33.5,67.3 +-3,67.7,-33.9,68.2 +-3,68.6,-34.4,69.1 +-3,69.5,-34.8,70 +-3,70.4,-35.3,70.9 +-3,71.3,-35.7,71.8 +-3,72.2,-36.2,72.7 +-3,73.1,-36.6,73.6 +-3,74,-37.1,74.5 +-3,74.9,-37.5,75.5 +-3,75.8,-38,76.4 +-3,76.7,-38.4,77.3 +-3,77.6,-38.9,78.2 +-3,78.5,-39.3,79.1 +-3,79.4,-39.8,80 +-3,80.3,-40.3,80.9 +-3,81.2,-40.7,81.8 +-3,82.1,-41.2,82.7 +-3,83,-41.6,83.6 +-3,83.9,-42.1,84.5 +-3,84.8,-42.5,85.5 +-3,85.7,-43,86.4 +-3,86.6,-43.4,87.3 +-3,87.5,-43.9,88.2 +-3,88.4,-44.3,89.1 +-3,89.3,-44.8,90 +-3,90.2,-45.2,0 +-3,91.1,-45.7,0 +-3,92,-46.1,0 +-3,92.9,-46.6,0 +-3,93.8,-47,0 +-3,94.7,-47.5,0 +-3,95.6,-47.9,0 +-3,96.5,-48.4,0 +-3,97.4,-48.8,0 +-3,98.3,-49.3,0 +-3,99.2,-49.7,0 +-3,100.2,-50.2,0 +-3,101.1,-50.7,0 +-3,102,-51.1,0 +-3,102.9,-51.6,0 +-3,103.8,-52,0 +-3,104.7,-52.5,0 +-3,105.6,-52.9,0 +-3,106.5,-53.4,0 +-3,107.4,-53.8,0 +-3,108.3,-54.3,0 +-3,109.2,-54.7,0 +-3,110.1,-55.2,0 +-3,111,-55.6,0 +-3,111.9,-56.1,0 +-3,112.8,-56.5,0 +-3,113.7,-57,0 +-3,114.6,-57.4,0 +-3,115.5,-57.9,0 +-3,116.4,-58.3,0 +-3,117.3,-58.8,0 +-3,118.2,-59.2,0 +-3,119.1,-59.7,0 +-3,120,-60.2,0 +-3,120.9,-60.6,0 +-3,121.8,-61.1,0 +-3,122.7,-61.5,0 +-3,123.6,-62,0 +-3,124.5,-62.4,0 +-3,125.4,-62.9,0 +-3,126.3,-63.3,0 +-3,127.2,-63.8,0 +-3,128.1,-64.2,0 +-3,129,-64.7,0 +-3,129.9,-65.1,0 +-3,130.8,-65.6,0 +-3,131.7,-66,0 +-3,132.6,-66.5,0 +-3,133.5,-66.9,0 +-3,134.4,-67.4,0 +-3,135.3,-67.8,0 +-3,136.2,-68.3,0 +-3,137.1,-68.7,0 +-3,138,-69.2,0 +-3,138.9,-69.6,0 +-3,139.8,-70.1,0 +-3,140.8,-70.6,0 +-3,141.7,-71,0 +-3,142.6,-71.5,0 +-3,143.5,-71.9,0 +-3,144.4,-72.4,0 +-3,145.3,-72.8,0 +-3,146.2,-73.3,0 +-3,147.1,-73.7,0 +-3,148,-74.2,0 +-3,148.9,-74.6,0 +-3,149.8,-75.1,0 +-3,150.7,-75.5,0 +-3,151.6,-76,0 +-3,152.5,-76.4,0 +-3,153.4,-76.9,0 +-3,154.3,-77.3,0 +-3,155.2,-77.8,0 +-3,156.1,-78.2,0 +-3,157,-78.7,0 +-3,157.9,-79.1,0 +-3,158.8,-79.6,0 +-3,159.7,-80.1,0 +-3,160.6,-80.5,0 +-3,161.5,-81,0 +-3,162.4,-81.4,0 +-3,163.3,-81.9,0 +-3,164.2,-82.3,0 +-3,165.1,-82.8,0 +-3,166,-83.2,0 +-3,166.9,-83.7,0 +-3,167.8,-84.1,0 +-3,168.7,-84.6,0 +-3,169.6,-85,0 +-3,170.5,-85.5,0 +-3,171.4,-85.9,0 +-3,172.3,-86.4,0 +-3,173.2,-86.8,0 +-3,174.1,-87.3,0 +-3,175,-87.7,0 +-3,175.9,-88.2,0 +-3,176.8,-88.6,0 +-3,177.7,-89.1,0 +-3,178.6,-89.5,0 +-3,179.5,-90,0 +-3,180.5,0,0 +-3,181.4,0,0 +-3,182.3,0,0 +-3,183.2,0,0 +-3,184.1,0,0 +-3,185,0,0 +-3,185.9,0,0 +-3,186.8,0,0 +-3,187.7,0,0 +-3,188.6,0,0 +-3,189.5,0,0 +-3,190.4,0,0 +-3,191.3,0,0 +-3,192.2,0,0 +-3,193.1,0,0 +-3,194,0,0 +-3,194.9,0,0 +-3,195.8,0,0 +-3,196.7,0,0 +-3,197.6,0,0 +-3,198.5,0,0 +-3,199.4,0,0 +-3,200.3,0,0 +-3,201.2,0,0 +-3,202.1,0,0 +-3,203,0,0 +-3,203.9,0,0 +-3,204.8,0,0 +-3,205.7,0,0 +-3,206.6,0,0 +-3,207.5,0,0 +-3,208.4,0,0 +-3,209.3,0,0 +-3,210.2,0,0 +-3,211.1,0,0 +-3,212,0,0 +-3,212.9,0,0 +-3,213.8,0,0 +-3,214.7,0,0 +-3,215.6,0,0 +-3,216.5,0,0 +-3,217.4,0,0 +-3,218.3,0,0 +-3,219.2,0,0 +-3,220.2,0,0 +-3,221.1,0,0 +-3,222,0,0 +-3,222.9,0,0 +-3,223.8,0,0 +-3,224.7,0,0 +-3,225.6,0,0 +-3,226.5,0,0 +-3,227.4,0,0 +-3,228.3,0,0 +-3,229.2,0,0 +-3,230.1,0,0 +-3,231,0,0 +-3,231.9,0,0 +-3,232.8,0,0 +-3,233.7,0,0 +-3,234.6,0,0 +-3,235.5,0,0 +-3,236.4,0,0 +-3,237.3,0,0 +-3,238.2,0,0 +-3,239.1,0,0 +-3,240,0,0 +-3,240.9,0,0 +-3,241.8,0,0 +-3,242.7,0,0 +-3,243.6,0,0 +-3,244.5,0,0 +-3,245.4,0,0 +-3,246.3,0,0 +-3,247.2,0,0 +-3,248.1,0,0 +-3,249,0,0 +-3,249.9,0,0 +-3,250.8,0,0 +-3,251.7,0,0 +-3,252.6,0,0 +-3,253.5,0,0 +-3,254.4,0,0 +-3,255.3,0,0 +-3,256.2,0,0 +-3,257.1,0,0 +-3,258,0,0 +-3,258.9,0,0 +-3,259.8,0,0 +-3,260.8,0,0 +-3,261.7,0,0 +-3,262.6,0,0 +-3,263.5,0,0 +-3,264.4,0,0 +-3,265.3,0,0 +-3,266.2,0,0 +-3,267.1,0,0 +-3,268,0,0 +-3,268.9,0,0 +-3,269.8,0,0 +-3,270.7,0,0 +-3,271.6,0,0 +-3,272.5,0,0 +-3,273.4,0,0 +-3,274.3,0,0 +-3,275.2,0,0 +-3,276.1,0,0 +-3,277,0,0 +-3,277.9,0,0 +-3,278.8,0,0 +-3,279.7,0,0 +-3,280.6,0,0 +-3,281.5,0,0 +-3,282.4,0,0 +-3,283.3,0,0 +-3,284.2,0,0 +-3,285.1,0,0 +-3,286,0,0 +-3,286.9,0,0 +-3,287.8,0,0 +-3,288.7,0,0 +-3,289.6,0,0 +-3,290.5,0,0 +-3,291.4,0,0 +-3,292.3,0,0 +-3,293.2,0,0 +-3,294.1,0,0 +-3,295,0,0 +-3,295.9,0,0 +-3,296.8,0,0 +-3,297.7,0,0 +-3,298.6,0,0 +-3,299.5,0,0 +-3,300.5,0,0 +-3,301.4,0,0 +-3,302.3,0,0 +-3,303.2,0,0 +-3,304.1,0,0 +-3,305,0,0 +-3,305.9,0,0 +-3,306.8,0,0 +-3,307.7,0,0 +-3,308.6,0,0 +-3,309.5,0,0 +-3,310.4,0,0 +-3,311.3,0,0 +-3,312.2,0,0 +-3,313.1,0,0 +-3,314,0,0 +-3,314.9,0,0 +-3,315.8,0,0 +-3,316.7,0,0 +-3,317.6,0,0 +-3,318.5,0,0 +-3,319.4,0,0 +-3,320.3,0,0 +-3,321.2,0,0 +-3,322.1,0,0 +-3,323,0,0 +-3,323.9,0,0 +-3,324.8,0,0 +-3,325.7,0,0 +-3,326.6,0,0 +-3,327.5,0,0 +-3,328.4,0,0 +-3,329.3,0,0 +-3,330.2,0,0 +-3,331.1,0,0 +-3,332,0,0 +-3,332.9,0,0 +-3,333.8,0,0 +-3,334.7,0,0 +-3,335.6,0,0 +-3,336.5,0,0 +-3,337.4,0,0 +-3,338.3,0,0 +-3,339.2,0,0 +-3,340.2,0,0 +-3,341.1,0,0 +-3,342,0,0 +-3,342.9,0,0 +-3,343.8,0,0 +-3,344.7,0,0 +-3,345.6,0,0 +-3,346.5,0,0 +-3,347.4,0,0 +-3,348.3,0,0 +-3,349.2,0,0 +-3,350.1,0,0 +-3,351,0,0 +-3,351.9,0,0 +-3,352.8,0,0 +-3,353.7,0,0 +-3,354.6,0,0 +-3,355.5,0,0 +-3,356.4,0,0 +-3,357.3,0,0 +-3,358.2,0,0 +-3,359.1,0,0 +-3,360,0,0 +-3,360,0,0 +-3,359.1,0,0 +-3,358.2,0,0 +-3,357.3,0,0 +-3,356.4,0,0 +-3,355.5,0,0 +-3,354.6,0,0 +-3,353.7,0,0 +-3,352.8,0,0 +-3,351.9,0,0 +-3,351,0,0 +-3,350.1,0,0 +-3,349.2,0,0 +-3,348.3,0,0 +-3,347.4,0,0 +-3,346.5,0,0 +-3,345.6,0,0 +-3,344.7,0,0 +-3,343.8,0,0 +-3,342.9,0,0 +-3,342,0,0 +-3,341.1,0,0 +-3,340.2,0,0 +-3,339.2,0,0 +-3,338.3,0,0 +-3,337.4,0,0 +-3,336.5,0,0 +-3,335.6,0,0 +-3,334.7,0,0 +-3,333.8,0,0 +-3,332.9,0,0 +-3,332,0,0 +-3,331.1,0,0 +-3,330.2,0,0 +-3,329.3,0,0 +-3,328.4,0,0 +-3,327.5,0,0 +-3,326.6,0,0 +-3,325.7,0,0 +-3,324.8,0,0 +-3,323.9,0,0 +-3,323,0,0 +-3,322.1,0,0 +-3,321.2,0,0 +-3,320.3,0,0 +-3,319.4,0,0 +-3,318.5,0,0 +-3,317.6,0,0 +-3,316.7,0,0 +-3,315.8,0,0 +-3,314.9,0,0 +-3,314,0,0 +-3,313.1,0,0 +-3,312.2,0,0 +-3,311.3,0,0 +-3,310.4,0,0 +-3,309.5,0,0 +-3,308.6,0,0 +-3,307.7,0,0 +-3,306.8,0,0 +-3,305.9,0,0 +-3,305,0,0 +-3,304.1,0,0 +-3,303.2,0,0 +-3,302.3,0,0 +-3,301.4,0,0 +-3,300.5,0,0 +-3,299.5,0,0 +-3,298.6,0,0 +-3,297.7,0,0 +-3,296.8,0,0 +-3,295.9,0,0 +-3,295,0,0 +-3,294.1,0,0 +-3,293.2,0,0 +-3,292.3,0,0 +-3,291.4,0,0 +-3,290.5,0,0 +-3,289.6,0,0 +-3,288.7,0,0 +-3,287.8,0,0 +-3,286.9,0,0 +-3,286,0,0 +-3,285.1,0,0 +-3,284.2,0,0 +-3,283.3,0,0 +-3,282.4,0,0 +-3,281.5,0,0 +-3,280.6,0,0 +-3,279.7,0,0 +-3,278.8,0,0 +-3,277.9,0,0 +-3,277,0,0 +-3,276.1,0,0 +-3,275.2,0,0 +-3,274.3,0,0 +-3,273.4,0,0 +-3,272.5,0,0 +-3,271.6,0,0 +-3,270.7,0,0 +-3,269.8,0,0 +-3,268.9,0,0 +-3,268,0,0 +-3,267.1,0,0 +-3,266.2,0,0 +-3,265.3,0,0 +-3,264.4,0,0 +-3,263.5,0,0 +-3,262.6,0,0 +-3,261.7,0,0 +-3,260.8,0,0 +-3,259.8,0,0 +-3,258.9,0,0 +-3,258,0,0 +-3,257.1,0,0 +-3,256.2,0,0 +-3,255.3,0,0 +-3,254.4,0,0 +-3,253.5,0,0 +-3,252.6,0,0 +-3,251.7,0,0 +-3,250.8,0,0 +-3,249.9,0,0 +-3,249,0,0 +-3,248.1,0,0 +-3,247.2,0,0 +-3,246.3,0,0 +-3,245.4,0,0 +-3,244.5,0,0 +-3,243.6,0,0 +-3,242.7,0,0 +-3,241.8,0,0 +-3,240.9,0,0 +-3,240,0,0 +-3,239.1,0,0 +-3,238.2,0,0 +-3,237.3,0,0 +-3,236.4,0,0 +-3,235.5,0,0 +-3,234.6,0,0 +-3,233.7,0,0 +-3,232.8,0,0 +-3,231.9,0,0 +-3,231,0,0 +-3,230.1,0,0 +-3,229.2,0,0 +-3,228.3,0,0 +-3,227.4,0,0 +-3,226.5,0,0 +-3,225.6,0,0 +-3,224.7,0,0 +-3,223.8,0,0 +-3,222.9,0,0 +-3,222,0,0 +-3,221.1,0,0 +-3,220.2,0,0 +-3,219.2,0,0 +-3,218.3,0,0 +-3,217.4,0,0 +-3,216.5,0,0 +-3,215.6,0,0 +-3,214.7,0,0 +-3,213.8,0,0 +-3,212.9,0,0 +-3,212,0,0 +-3,211.1,0,0 +-3,210.2,0,0 +-3,209.3,0,0 +-3,208.4,0,0 +-3,207.5,0,0 +-3,206.6,0,0 +-3,205.7,0,0 +-3,204.8,0,0 +-3,203.9,0,0 +-3,203,0,0 +-3,202.1,0,0 +-3,201.2,0,0 +-3,200.3,0,0 +-3,199.4,0,0 +-3,198.5,0,0 +-3,197.6,0,0 +-3,196.7,0,0 +-3,195.8,0,0 +-3,194.9,0,0 +-3,194,0,0 +-3,193.1,0,0 +-3,192.2,0,0 +-3,191.3,0,0 +-3,190.4,0,0 +-3,189.5,0,0 +-3,188.6,0,0 +-3,187.7,0,0 +-3,186.8,0,0 +-3,185.9,0,0 +-3,185,0,0 +-3,184.1,0,0 +-3,183.2,0,0 +-3,182.3,0,0 +-3,181.4,0,0 +-3,180.5,0,0 +-3,179.5,-90,0 +-3,178.6,-89.5,0 +-3,177.7,-89.1,0 +-3,176.8,-88.6,0 +-3,175.9,-88.2,0 +-3,175,-87.7,0 +-3,174.1,-87.3,0 +-3,173.2,-86.8,0 +-3,172.3,-86.4,0 +-3,171.4,-85.9,0 +-3,170.5,-85.5,0 +-3,169.6,-85,0 +-3,168.7,-84.6,0 +-3,167.8,-84.1,0 +-3,166.9,-83.7,0 +-3,166,-83.2,0 +-3,165.1,-82.8,0 +-3,164.2,-82.3,0 +-3,163.3,-81.9,0 +-3,162.4,-81.4,0 +-3,161.5,-81,0 +-3,160.6,-80.5,0 +-3,159.7,-80.1,0 +-3,158.8,-79.6,0 +-3,157.9,-79.1,0 +-3,157,-78.7,0 +-3,156.1,-78.2,0 +-3,155.2,-77.8,0 +-3,154.3,-77.3,0 +-3,153.4,-76.9,0 +-3,152.5,-76.4,0 +-3,151.6,-76,0 +-3,150.7,-75.5,0 +-3,149.8,-75.1,0 +-3,148.9,-74.6,0 +-3,148,-74.2,0 +-3,147.1,-73.7,0 +-3,146.2,-73.3,0 +-3,145.3,-72.8,0 +-3,144.4,-72.4,0 +-3,143.5,-71.9,0 +-3,142.6,-71.5,0 +-3,141.7,-71,0 +-3,140.8,-70.6,0 +-3,139.8,-70.1,0 +-3,138.9,-69.6,0 +-3,138,-69.2,0 +-3,137.1,-68.7,0 +-3,136.2,-68.3,0 +-3,135.3,-67.8,0 +-3,134.4,-67.4,0 +-3,133.5,-66.9,0 +-3,132.6,-66.5,0 +-3,131.7,-66,0 +-3,130.8,-65.6,0 +-3,129.9,-65.1,0 +-3,129,-64.7,0 +-3,128.1,-64.2,0 +-3,127.2,-63.8,0 +-3,126.3,-63.3,0 +-3,125.4,-62.9,0 +-3,124.5,-62.4,0 +-3,123.6,-62,0 +-3,122.7,-61.5,0 +-3,121.8,-61.1,0 +-3,120.9,-60.6,0 +-3,120,-60.2,0 +-3,119.1,-59.7,0 +-3,118.2,-59.2,0 +-3,117.3,-58.8,0 +-3,116.4,-58.3,0 +-3,115.5,-57.9,0 +-3,114.6,-57.4,0 +-3,113.7,-57,0 +-3,112.8,-56.5,0 +-3,111.9,-56.1,0 +-3,111,-55.6,0 +-3,110.1,-55.2,0 +-3,109.2,-54.7,0 +-3,108.3,-54.3,0 +-3,107.4,-53.8,0 +-3,106.5,-53.4,0 +-3,105.6,-52.9,0 +-3,104.7,-52.5,0 +-3,103.8,-52,0 +-3,102.9,-51.6,0 +-3,102,-51.1,0 +-3,101.1,-50.7,0 +-3,100.2,-50.2,0 +-3,99.2,-49.7,0 +-3,98.3,-49.3,0 +-3,97.4,-48.8,0 +-3,96.5,-48.4,0 +-3,95.6,-47.9,0 +-3,94.7,-47.5,0 +-3,93.8,-47,0 +-3,92.9,-46.6,0 +-3,92,-46.1,0 +-3,91.1,-45.7,0 +-3,90.2,-45.2,0 +-3,89.3,-44.8,90 +-3,88.4,-44.3,89.1 +-3,87.5,-43.9,88.2 +-3,86.6,-43.4,87.3 +-3,85.7,-43,86.4 +-3,84.8,-42.5,85.5 +-3,83.9,-42.1,84.5 +-3,83,-41.6,83.6 +-3,82.1,-41.2,82.7 +-3,81.2,-40.7,81.8 +-3,80.3,-40.3,80.9 +-3,79.4,-39.8,80 +-3,78.5,-39.3,79.1 +-3,77.6,-38.9,78.2 +-3,76.7,-38.4,77.3 +-3,75.8,-38,76.4 +-3,74.9,-37.5,75.5 +-3,74,-37.1,74.5 +-3,73.1,-36.6,73.6 +-3,72.2,-36.2,72.7 +-3,71.3,-35.7,71.8 +-3,70.4,-35.3,70.9 +-3,69.5,-34.8,70 +-3,68.6,-34.4,69.1 +-3,67.7,-33.9,68.2 +-3,66.8,-33.5,67.3 +-3,65.9,-33,66.4 +-3,65,-32.6,65.5 +-3,64.1,-32.1,64.5 +-3,63.2,-31.7,63.6 +-3,62.3,-31.2,62.7 +-3,61.4,-30.8,61.8 +-3,60.5,-30.3,60.9 +-3,59.5,-29.8,60 +-3,58.6,-29.4,59.1 +-3,57.7,-28.9,58.2 +-3,56.8,-28.5,57.3 +-3,55.9,-28,56.4 +-3,55,-27.6,55.5 +-3,54.1,-27.1,54.5 +-3,53.2,-26.7,53.6 +-3,52.3,-26.2,52.7 +-3,51.4,-25.8,51.8 +-3,50.5,-25.3,50.9 +-3,49.6,-24.9,50 +-3,48.7,-24.4,49.1 +-3,47.8,-24,48.2 +-3,46.9,-23.5,47.3 +-3,46,-23.1,46.4 +-3,45.1,-22.6,45.5 +-3,44.2,-22.2,44.5 +-3,43.3,-21.7,43.6 +-3,42.4,-21.3,42.7 +-3,41.5,-20.8,41.8 +-3,40.6,-20.4,40.9 +-3,39.7,-19.9,40 +-3,38.8,-19.4,39.1 +-3,37.9,-19,38.2 +-3,37,-18.5,37.3 +-3,36.1,-18.1,36.4 +-3,35.2,-17.6,35.5 +-3,34.3,-17.2,34.5 +-3,33.4,-16.7,33.6 +-3,32.5,-16.3,32.7 +-3,31.6,-15.8,31.8 +-3,30.7,-15.4,30.9 +-3,29.8,-14.9,30 +-3,28.9,-14.5,29.1 +-3,28,-14,28.2 +-3,27.1,-13.6,27.3 +-3,26.2,-13.1,26.4 +-3,25.3,-12.7,25.5 +-3,24.4,-12.2,24.5 +-3,23.5,-11.8,23.6 +-3,22.6,-11.3,22.7 +-3,21.7,-10.9,21.8 +-3,20.8,-10.4,20.9 +-3,19.8,-9.9,20 +-3,18.9,-9.5,19.1 +-3,18,-9,18.2 +-3,17.1,-8.6,17.3 +-3,16.2,-8.1,16.4 +-3,15.3,-7.7,15.5 +-3,14.4,-7.2,14.5 +-3,13.5,-6.8,13.6 +-3,12.6,-6.3,12.7 +-3,11.7,-5.9,11.8 +-3,10.8,-5.4,10.9 +-3,9.9,-5,10 +-3,9,-4.5,9.1 +-3,8.1,-4.1,8.2 +-3,7.2,-3.6,7.3 +-3,6.3,-3.2,6.4 +-3,5.4,-2.7,5.5 +-3,4.5,-2.3,4.5 +-3,3.6,-1.8,3.6 +-3,2.7,-1.4,2.7 +-3,1.8,-0.9,1.8 +-3,0.9,-0.5,0.9 +-3,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +0.9,0,0,0.3 +0.9,0,0,0.3 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.8,0,0,0.5 +0.8,0,0,0.5 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.5,0,0,0.8 +0.5,0,0,0.8 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.3,0,0,0.9 +0.3,0,0,0.9 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,0.9 +0.3,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.8 +0.5,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.7,0,0,0.8 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.8,0,0,0.7 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.5 +0.8,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.3 +0.9,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0 +-3,0,0,0 +-3,0.9,-0.5,0.9 +-3,1.8,-0.9,1.8 +-3,2.7,-1.4,2.7 +-3,3.6,-1.8,3.6 +-3,4.5,-2.3,4.5 +-3,5.4,-2.7,5.5 +-3,6.3,-3.2,6.4 +-3,7.2,-3.6,7.3 +-3,8.1,-4.1,8.2 +-3,9,-4.5,9.1 +-3,9.9,-5,10 +-3,10.8,-5.4,10.9 +-3,11.7,-5.9,11.8 +-3,12.6,-6.3,12.7 +-3,13.5,-6.8,13.6 +-3,14.4,-7.2,14.5 +-3,15.3,-7.7,15.5 +-3,16.2,-8.1,16.4 +-3,17.1,-8.6,17.3 +-3,18,-9,18.2 +-3,18.9,-9.5,19.1 +-3,19.8,-9.9,20 +-3,20.8,-10.4,20.9 +-3,21.7,-10.9,21.8 +-3,22.6,-11.3,22.7 +-3,23.5,-11.8,23.6 +-3,24.4,-12.2,24.5 +-3,25.3,-12.7,25.5 +-3,26.2,-13.1,26.4 +-3,27.1,-13.6,27.3 +-3,28,-14,28.2 +-3,28.9,-14.5,29.1 +-3,29.8,-14.9,30 +-3,30.7,-15.4,30.9 +-3,31.6,-15.8,31.8 +-3,32.5,-16.3,32.7 +-3,33.4,-16.7,33.6 +-3,34.3,-17.2,34.5 +-3,35.2,-17.6,35.5 +-3,36.1,-18.1,36.4 +-3,37,-18.5,37.3 +-3,37.9,-19,38.2 +-3,38.8,-19.4,39.1 +-3,39.7,-19.9,40 +-3,40.6,-20.4,40.9 +-3,41.5,-20.8,41.8 +-3,42.4,-21.3,42.7 +-3,43.3,-21.7,43.6 +-3,44.2,-22.2,44.5 +-3,45.1,-22.6,45.5 +-3,46,-23.1,46.4 +-3,46.9,-23.5,47.3 +-3,47.8,-24,48.2 +-3,48.7,-24.4,49.1 +-3,49.6,-24.9,50 +-3,50.5,-25.3,50.9 +-3,51.4,-25.8,51.8 +-3,52.3,-26.2,52.7 +-3,53.2,-26.7,53.6 +-3,54.1,-27.1,54.5 +-3,55,-27.6,55.5 +-3,55.9,-28,56.4 +-3,56.8,-28.5,57.3 +-3,57.7,-28.9,58.2 +-3,58.6,-29.4,59.1 +-3,59.5,-29.8,60 +-3,60.5,-30.3,60.9 +-3,61.4,-30.8,61.8 +-3,62.3,-31.2,62.7 +-3,63.2,-31.7,63.6 +-3,64.1,-32.1,64.5 +-3,65,-32.6,65.5 +-3,65.9,-33,66.4 +-3,66.8,-33.5,67.3 +-3,67.7,-33.9,68.2 +-3,68.6,-34.4,69.1 +-3,69.5,-34.8,70 +-3,70.4,-35.3,70.9 +-3,71.3,-35.7,71.8 +-3,72.2,-36.2,72.7 +-3,73.1,-36.6,73.6 +-3,74,-37.1,74.5 +-3,74.9,-37.5,75.5 +-3,75.8,-38,76.4 +-3,76.7,-38.4,77.3 +-3,77.6,-38.9,78.2 +-3,78.5,-39.3,79.1 +-3,79.4,-39.8,80 +-3,80.3,-40.3,80.9 +-3,81.2,-40.7,81.8 +-3,82.1,-41.2,82.7 +-3,83,-41.6,83.6 +-3,83.9,-42.1,84.5 +-3,84.8,-42.5,85.5 +-3,85.7,-43,86.4 +-3,86.6,-43.4,87.3 +-3,87.5,-43.9,88.2 +-3,88.4,-44.3,89.1 +-3,89.3,-44.8,90 +-3,90.2,-45.2,0 +-3,91.1,-45.7,0 +-3,92,-46.1,0 +-3,92.9,-46.6,0 +-3,93.8,-47,0 +-3,94.7,-47.5,0 +-3,95.6,-47.9,0 +-3,96.5,-48.4,0 +-3,97.4,-48.8,0 +-3,98.3,-49.3,0 +-3,99.2,-49.7,0 +-3,100.2,-50.2,0 +-3,101.1,-50.7,0 +-3,102,-51.1,0 +-3,102.9,-51.6,0 +-3,103.8,-52,0 +-3,104.7,-52.5,0 +-3,105.6,-52.9,0 +-3,106.5,-53.4,0 +-3,107.4,-53.8,0 +-3,108.3,-54.3,0 +-3,109.2,-54.7,0 +-3,110.1,-55.2,0 +-3,111,-55.6,0 +-3,111.9,-56.1,0 +-3,112.8,-56.5,0 +-3,113.7,-57,0 +-3,114.6,-57.4,0 +-3,115.5,-57.9,0 +-3,116.4,-58.3,0 +-3,117.3,-58.8,0 +-3,118.2,-59.2,0 +-3,119.1,-59.7,0 +-3,120,-60.2,0 +-3,120.9,-60.6,0 +-3,121.8,-61.1,0 +-3,122.7,-61.5,0 +-3,123.6,-62,0 +-3,124.5,-62.4,0 +-3,125.4,-62.9,0 +-3,126.3,-63.3,0 +-3,127.2,-63.8,0 +-3,128.1,-64.2,0 +-3,129,-64.7,0 +-3,129.9,-65.1,0 +-3,130.8,-65.6,0 +-3,131.7,-66,0 +-3,132.6,-66.5,0 +-3,133.5,-66.9,0 +-3,134.4,-67.4,0 +-3,135.3,-67.8,0 +-3,136.2,-68.3,0 +-3,137.1,-68.7,0 +-3,138,-69.2,0 +-3,138.9,-69.6,0 +-3,139.8,-70.1,0 +-3,140.8,-70.6,0 +-3,141.7,-71,0 +-3,142.6,-71.5,0 +-3,143.5,-71.9,0 +-3,144.4,-72.4,0 +-3,145.3,-72.8,0 +-3,146.2,-73.3,0 +-3,147.1,-73.7,0 +-3,148,-74.2,0 +-3,148.9,-74.6,0 +-3,149.8,-75.1,0 +-3,150.7,-75.5,0 +-3,151.6,-76,0 +-3,152.5,-76.4,0 +-3,153.4,-76.9,0 +-3,154.3,-77.3,0 +-3,155.2,-77.8,0 +-3,156.1,-78.2,0 +-3,157,-78.7,0 +-3,157.9,-79.1,0 +-3,158.8,-79.6,0 +-3,159.7,-80.1,0 +-3,160.6,-80.5,0 +-3,161.5,-81,0 +-3,162.4,-81.4,0 +-3,163.3,-81.9,0 +-3,164.2,-82.3,0 +-3,165.1,-82.8,0 +-3,166,-83.2,0 +-3,166.9,-83.7,0 +-3,167.8,-84.1,0 +-3,168.7,-84.6,0 +-3,169.6,-85,0 +-3,170.5,-85.5,0 +-3,171.4,-85.9,0 +-3,172.3,-86.4,0 +-3,173.2,-86.8,0 +-3,174.1,-87.3,0 +-3,175,-87.7,0 +-3,175.9,-88.2,0 +-3,176.8,-88.6,0 +-3,177.7,-89.1,0 +-3,178.6,-89.5,0 +-3,179.5,-90,0 +-3,180.5,0,0 +-3,181.4,0,0 +-3,182.3,0,0 +-3,183.2,0,0 +-3,184.1,0,0 +-3,185,0,0 +-3,185.9,0,0 +-3,186.8,0,0 +-3,187.7,0,0 +-3,188.6,0,0 +-3,189.5,0,0 +-3,190.4,0,0 +-3,191.3,0,0 +-3,192.2,0,0 +-3,193.1,0,0 +-3,194,0,0 +-3,194.9,0,0 +-3,195.8,0,0 +-3,196.7,0,0 +-3,197.6,0,0 +-3,198.5,0,0 +-3,199.4,0,0 +-3,200.3,0,0 +-3,201.2,0,0 +-3,202.1,0,0 +-3,203,0,0 +-3,203.9,0,0 +-3,204.8,0,0 +-3,205.7,0,0 +-3,206.6,0,0 +-3,207.5,0,0 +-3,208.4,0,0 +-3,209.3,0,0 +-3,210.2,0,0 +-3,211.1,0,0 +-3,212,0,0 +-3,212.9,0,0 +-3,213.8,0,0 +-3,214.7,0,0 +-3,215.6,0,0 +-3,216.5,0,0 +-3,217.4,0,0 +-3,218.3,0,0 +-3,219.2,0,0 +-3,220.2,0,0 +-3,221.1,0,0 +-3,222,0,0 +-3,222.9,0,0 +-3,223.8,0,0 +-3,224.7,0,0 +-3,225.6,0,0 +-3,226.5,0,0 +-3,227.4,0,0 +-3,228.3,0,0 +-3,229.2,0,0 +-3,230.1,0,0 +-3,231,0,0 +-3,231.9,0,0 +-3,232.8,0,0 +-3,233.7,0,0 +-3,234.6,0,0 +-3,235.5,0,0 +-3,236.4,0,0 +-3,237.3,0,0 +-3,238.2,0,0 +-3,239.1,0,0 +-3,240,0,0 +-3,240.9,0,0 +-3,241.8,0,0 +-3,242.7,0,0 +-3,243.6,0,0 +-3,244.5,0,0 +-3,245.4,0,0 +-3,246.3,0,0 +-3,247.2,0,0 +-3,248.1,0,0 +-3,249,0,0 +-3,249.9,0,0 +-3,250.8,0,0 +-3,251.7,0,0 +-3,252.6,0,0 +-3,253.5,0,0 +-3,254.4,0,0 +-3,255.3,0,0 +-3,256.2,0,0 +-3,257.1,0,0 +-3,258,0,0 +-3,258.9,0,0 +-3,259.8,0,0 +-3,260.8,0,0 +-3,261.7,0,0 +-3,262.6,0,0 +-3,263.5,0,0 +-3,264.4,0,0 +-3,265.3,0,0 +-3,266.2,0,0 +-3,267.1,0,0 +-3,268,0,0 +-3,268.9,0,0 +-3,269.8,0,0 +-3,270.7,0,0 +-3,271.6,0,0 +-3,272.5,0,0 +-3,273.4,0,0 +-3,274.3,0,0 +-3,275.2,0,0 +-3,276.1,0,0 +-3,277,0,0 +-3,277.9,0,0 +-3,278.8,0,0 +-3,279.7,0,0 +-3,280.6,0,0 +-3,281.5,0,0 +-3,282.4,0,0 +-3,283.3,0,0 +-3,284.2,0,0 +-3,285.1,0,0 +-3,286,0,0 +-3,286.9,0,0 +-3,287.8,0,0 +-3,288.7,0,0 +-3,289.6,0,0 +-3,290.5,0,0 +-3,291.4,0,0 +-3,292.3,0,0 +-3,293.2,0,0 +-3,294.1,0,0 +-3,295,0,0 +-3,295.9,0,0 +-3,296.8,0,0 +-3,297.7,0,0 +-3,298.6,0,0 +-3,299.5,0,0 +-3,300.5,0,0 +-3,301.4,0,0 +-3,302.3,0,0 +-3,303.2,0,0 +-3,304.1,0,0 +-3,305,0,0 +-3,305.9,0,0 +-3,306.8,0,0 +-3,307.7,0,0 +-3,308.6,0,0 +-3,309.5,0,0 +-3,310.4,0,0 +-3,311.3,0,0 +-3,312.2,0,0 +-3,313.1,0,0 +-3,314,0,0 +-3,314.9,0,0 +-3,315.8,0,0 +-3,316.7,0,0 +-3,317.6,0,0 +-3,318.5,0,0 +-3,319.4,0,0 +-3,320.3,0,0 +-3,321.2,0,0 +-3,322.1,0,0 +-3,323,0,0 +-3,323.9,0,0 +-3,324.8,0,0 +-3,325.7,0,0 +-3,326.6,0,0 +-3,327.5,0,0 +-3,328.4,0,0 +-3,329.3,0,0 +-3,330.2,0,0 +-3,331.1,0,0 +-3,332,0,0 +-3,332.9,0,0 +-3,333.8,0,0 +-3,334.7,0,0 +-3,335.6,0,0 +-3,336.5,0,0 +-3,337.4,0,0 +-3,338.3,0,0 +-3,339.2,0,0 +-3,340.2,0,0 +-3,341.1,0,0 +-3,342,0,0 +-3,342.9,0,0 +-3,343.8,0,0 +-3,344.7,0,0 +-3,345.6,0,0 +-3,346.5,0,0 +-3,347.4,0,0 +-3,348.3,0,0 +-3,349.2,0,0 +-3,350.1,0,0 +-3,351,0,0 +-3,351.9,0,0 +-3,352.8,0,0 +-3,353.7,0,0 +-3,354.6,0,0 +-3,355.5,0,0 +-3,356.4,0,0 +-3,357.3,0,0 +-3,358.2,0,0 +-3,359.1,0,0 +-3,360,0,0 +-3,360,0,0 +-3,359.1,0,0 +-3,358.2,0,0 +-3,357.3,0,0 +-3,356.4,0,0 +-3,355.5,0,0 +-3,354.6,0,0 +-3,353.7,0,0 +-3,352.8,0,0 +-3,351.9,0,0 +-3,351,0,0 +-3,350.1,0,0 +-3,349.2,0,0 +-3,348.3,0,0 +-3,347.4,0,0 +-3,346.5,0,0 +-3,345.6,0,0 +-3,344.7,0,0 +-3,343.8,0,0 +-3,342.9,0,0 +-3,342,0,0 +-3,341.1,0,0 +-3,340.2,0,0 +-3,339.2,0,0 +-3,338.3,0,0 +-3,337.4,0,0 +-3,336.5,0,0 +-3,335.6,0,0 +-3,334.7,0,0 +-3,333.8,0,0 +-3,332.9,0,0 +-3,332,0,0 +-3,331.1,0,0 +-3,330.2,0,0 +-3,329.3,0,0 +-3,328.4,0,0 +-3,327.5,0,0 +-3,326.6,0,0 +-3,325.7,0,0 +-3,324.8,0,0 +-3,323.9,0,0 +-3,323,0,0 +-3,322.1,0,0 +-3,321.2,0,0 +-3,320.3,0,0 +-3,319.4,0,0 +-3,318.5,0,0 +-3,317.6,0,0 +-3,316.7,0,0 +-3,315.8,0,0 +-3,314.9,0,0 +-3,314,0,0 +-3,313.1,0,0 +-3,312.2,0,0 +-3,311.3,0,0 +-3,310.4,0,0 +-3,309.5,0,0 +-3,308.6,0,0 +-3,307.7,0,0 +-3,306.8,0,0 +-3,305.9,0,0 +-3,305,0,0 +-3,304.1,0,0 +-3,303.2,0,0 +-3,302.3,0,0 +-3,301.4,0,0 +-3,300.5,0,0 +-3,299.5,0,0 +-3,298.6,0,0 +-3,297.7,0,0 +-3,296.8,0,0 +-3,295.9,0,0 +-3,295,0,0 +-3,294.1,0,0 +-3,293.2,0,0 +-3,292.3,0,0 +-3,291.4,0,0 +-3,290.5,0,0 +-3,289.6,0,0 +-3,288.7,0,0 +-3,287.8,0,0 +-3,286.9,0,0 +-3,286,0,0 +-3,285.1,0,0 +-3,284.2,0,0 +-3,283.3,0,0 +-3,282.4,0,0 +-3,281.5,0,0 +-3,280.6,0,0 +-3,279.7,0,0 +-3,278.8,0,0 +-3,277.9,0,0 +-3,277,0,0 +-3,276.1,0,0 +-3,275.2,0,0 +-3,274.3,0,0 +-3,273.4,0,0 +-3,272.5,0,0 +-3,271.6,0,0 +-3,270.7,0,0 +-3,269.8,0,0 +-3,268.9,0,0 +-3,268,0,0 +-3,267.1,0,0 +-3,266.2,0,0 +-3,265.3,0,0 +-3,264.4,0,0 +-3,263.5,0,0 +-3,262.6,0,0 +-3,261.7,0,0 +-3,260.8,0,0 +-3,259.8,0,0 +-3,258.9,0,0 +-3,258,0,0 +-3,257.1,0,0 +-3,256.2,0,0 +-3,255.3,0,0 +-3,254.4,0,0 +-3,253.5,0,0 +-3,252.6,0,0 +-3,251.7,0,0 +-3,250.8,0,0 +-3,249.9,0,0 +-3,249,0,0 +-3,248.1,0,0 +-3,247.2,0,0 +-3,246.3,0,0 +-3,245.4,0,0 +-3,244.5,0,0 +-3,243.6,0,0 +-3,242.7,0,0 +-3,241.8,0,0 +-3,240.9,0,0 +-3,240,0,0 +-3,239.1,0,0 +-3,238.2,0,0 +-3,237.3,0,0 +-3,236.4,0,0 +-3,235.5,0,0 +-3,234.6,0,0 +-3,233.7,0,0 +-3,232.8,0,0 +-3,231.9,0,0 +-3,231,0,0 +-3,230.1,0,0 +-3,229.2,0,0 +-3,228.3,0,0 +-3,227.4,0,0 +-3,226.5,0,0 +-3,225.6,0,0 +-3,224.7,0,0 +-3,223.8,0,0 +-3,222.9,0,0 +-3,222,0,0 +-3,221.1,0,0 +-3,220.2,0,0 +-3,219.2,0,0 +-3,218.3,0,0 +-3,217.4,0,0 +-3,216.5,0,0 +-3,215.6,0,0 +-3,214.7,0,0 +-3,213.8,0,0 +-3,212.9,0,0 +-3,212,0,0 +-3,211.1,0,0 +-3,210.2,0,0 +-3,209.3,0,0 +-3,208.4,0,0 +-3,207.5,0,0 +-3,206.6,0,0 +-3,205.7,0,0 +-3,204.8,0,0 +-3,203.9,0,0 +-3,203,0,0 +-3,202.1,0,0 +-3,201.2,0,0 +-3,200.3,0,0 +-3,199.4,0,0 +-3,198.5,0,0 +-3,197.6,0,0 +-3,196.7,0,0 +-3,195.8,0,0 +-3,194.9,0,0 +-3,194,0,0 +-3,193.1,0,0 +-3,192.2,0,0 +-3,191.3,0,0 +-3,190.4,0,0 +-3,189.5,0,0 +-3,188.6,0,0 +-3,187.7,0,0 +-3,186.8,0,0 +-3,185.9,0,0 +-3,185,0,0 +-3,184.1,0,0 +-3,183.2,0,0 +-3,182.3,0,0 +-3,181.4,0,0 +-3,180.5,0,0 +-3,179.5,-90,0 +-3,178.6,-89.5,0 +-3,177.7,-89.1,0 +-3,176.8,-88.6,0 +-3,175.9,-88.2,0 +-3,175,-87.7,0 +-3,174.1,-87.3,0 +-3,173.2,-86.8,0 +-3,172.3,-86.4,0 +-3,171.4,-85.9,0 +-3,170.5,-85.5,0 +-3,169.6,-85,0 +-3,168.7,-84.6,0 +-3,167.8,-84.1,0 +-3,166.9,-83.7,0 +-3,166,-83.2,0 +-3,165.1,-82.8,0 +-3,164.2,-82.3,0 +-3,163.3,-81.9,0 +-3,162.4,-81.4,0 +-3,161.5,-81,0 +-3,160.6,-80.5,0 +-3,159.7,-80.1,0 +-3,158.8,-79.6,0 +-3,157.9,-79.1,0 +-3,157,-78.7,0 +-3,156.1,-78.2,0 +-3,155.2,-77.8,0 +-3,154.3,-77.3,0 +-3,153.4,-76.9,0 +-3,152.5,-76.4,0 +-3,151.6,-76,0 +-3,150.7,-75.5,0 +-3,149.8,-75.1,0 +-3,148.9,-74.6,0 +-3,148,-74.2,0 +-3,147.1,-73.7,0 +-3,146.2,-73.3,0 +-3,145.3,-72.8,0 +-3,144.4,-72.4,0 +-3,143.5,-71.9,0 +-3,142.6,-71.5,0 +-3,141.7,-71,0 +-3,140.8,-70.6,0 +-3,139.8,-70.1,0 +-3,138.9,-69.6,0 +-3,138,-69.2,0 +-3,137.1,-68.7,0 +-3,136.2,-68.3,0 +-3,135.3,-67.8,0 +-3,134.4,-67.4,0 +-3,133.5,-66.9,0 +-3,132.6,-66.5,0 +-3,131.7,-66,0 +-3,130.8,-65.6,0 +-3,129.9,-65.1,0 +-3,129,-64.7,0 +-3,128.1,-64.2,0 +-3,127.2,-63.8,0 +-3,126.3,-63.3,0 +-3,125.4,-62.9,0 +-3,124.5,-62.4,0 +-3,123.6,-62,0 +-3,122.7,-61.5,0 +-3,121.8,-61.1,0 +-3,120.9,-60.6,0 +-3,120,-60.2,0 +-3,119.1,-59.7,0 +-3,118.2,-59.2,0 +-3,117.3,-58.8,0 +-3,116.4,-58.3,0 +-3,115.5,-57.9,0 +-3,114.6,-57.4,0 +-3,113.7,-57,0 +-3,112.8,-56.5,0 +-3,111.9,-56.1,0 +-3,111,-55.6,0 +-3,110.1,-55.2,0 +-3,109.2,-54.7,0 +-3,108.3,-54.3,0 +-3,107.4,-53.8,0 +-3,106.5,-53.4,0 +-3,105.6,-52.9,0 +-3,104.7,-52.5,0 +-3,103.8,-52,0 +-3,102.9,-51.6,0 +-3,102,-51.1,0 +-3,101.1,-50.7,0 +-3,100.2,-50.2,0 +-3,99.2,-49.7,0 +-3,98.3,-49.3,0 +-3,97.4,-48.8,0 +-3,96.5,-48.4,0 +-3,95.6,-47.9,0 +-3,94.7,-47.5,0 +-3,93.8,-47,0 +-3,92.9,-46.6,0 +-3,92,-46.1,0 +-3,91.1,-45.7,0 +-3,90.2,-45.2,0 +-3,89.3,-44.8,90 +-3,88.4,-44.3,89.1 +-3,87.5,-43.9,88.2 +-3,86.6,-43.4,87.3 +-3,85.7,-43,86.4 +-3,84.8,-42.5,85.5 +-3,83.9,-42.1,84.5 +-3,83,-41.6,83.6 +-3,82.1,-41.2,82.7 +-3,81.2,-40.7,81.8 +-3,80.3,-40.3,80.9 +-3,79.4,-39.8,80 +-3,78.5,-39.3,79.1 +-3,77.6,-38.9,78.2 +-3,76.7,-38.4,77.3 +-3,75.8,-38,76.4 +-3,74.9,-37.5,75.5 +-3,74,-37.1,74.5 +-3,73.1,-36.6,73.6 +-3,72.2,-36.2,72.7 +-3,71.3,-35.7,71.8 +-3,70.4,-35.3,70.9 +-3,69.5,-34.8,70 +-3,68.6,-34.4,69.1 +-3,67.7,-33.9,68.2 +-3,66.8,-33.5,67.3 +-3,65.9,-33,66.4 +-3,65,-32.6,65.5 +-3,64.1,-32.1,64.5 +-3,63.2,-31.7,63.6 +-3,62.3,-31.2,62.7 +-3,61.4,-30.8,61.8 +-3,60.5,-30.3,60.9 +-3,59.5,-29.8,60 +-3,58.6,-29.4,59.1 +-3,57.7,-28.9,58.2 +-3,56.8,-28.5,57.3 +-3,55.9,-28,56.4 +-3,55,-27.6,55.5 +-3,54.1,-27.1,54.5 +-3,53.2,-26.7,53.6 +-3,52.3,-26.2,52.7 +-3,51.4,-25.8,51.8 +-3,50.5,-25.3,50.9 +-3,49.6,-24.9,50 +-3,48.7,-24.4,49.1 +-3,47.8,-24,48.2 +-3,46.9,-23.5,47.3 +-3,46,-23.1,46.4 +-3,45.1,-22.6,45.5 +-3,44.2,-22.2,44.5 +-3,43.3,-21.7,43.6 +-3,42.4,-21.3,42.7 +-3,41.5,-20.8,41.8 +-3,40.6,-20.4,40.9 +-3,39.7,-19.9,40 +-3,38.8,-19.4,39.1 +-3,37.9,-19,38.2 +-3,37,-18.5,37.3 +-3,36.1,-18.1,36.4 +-3,35.2,-17.6,35.5 +-3,34.3,-17.2,34.5 +-3,33.4,-16.7,33.6 +-3,32.5,-16.3,32.7 +-3,31.6,-15.8,31.8 +-3,30.7,-15.4,30.9 +-3,29.8,-14.9,30 +-3,28.9,-14.5,29.1 +-3,28,-14,28.2 +-3,27.1,-13.6,27.3 +-3,26.2,-13.1,26.4 +-3,25.3,-12.7,25.5 +-3,24.4,-12.2,24.5 +-3,23.5,-11.8,23.6 +-3,22.6,-11.3,22.7 +-3,21.7,-10.9,21.8 +-3,20.8,-10.4,20.9 +-3,19.8,-9.9,20 +-3,18.9,-9.5,19.1 +-3,18,-9,18.2 +-3,17.1,-8.6,17.3 +-3,16.2,-8.1,16.4 +-3,15.3,-7.7,15.5 +-3,14.4,-7.2,14.5 +-3,13.5,-6.8,13.6 +-3,12.6,-6.3,12.7 +-3,11.7,-5.9,11.8 +-3,10.8,-5.4,10.9 +-3,9.9,-5,10 +-3,9,-4.5,9.1 +-3,8.1,-4.1,8.2 +-3,7.2,-3.6,7.3 +-3,6.3,-3.2,6.4 +-3,5.4,-2.7,5.5 +-3,4.5,-2.3,4.5 +-3,3.6,-1.8,3.6 +-3,2.7,-1.4,2.7 +-3,1.8,-0.9,1.8 +-3,0.9,-0.5,0.9 +-3,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +0.9,0,0,0.3 +0.9,0,0,0.3 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.8,0,0,0.5 +0.8,0,0,0.5 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.5,0,0,0.8 +0.5,0,0,0.8 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.3,0,0,0.9 +0.3,0,0,0.9 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,0.9 +0.3,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.8 +0.5,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.7,0,0,0.8 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.8,0,0,0.7 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.5 +0.8,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.3 +0.9,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0 +-3,0,0,0 +-3,0.9,-0.5,0.9 +-3,1.8,-0.9,1.8 +-3,2.7,-1.4,2.7 +-3,3.6,-1.8,3.6 +-3,4.5,-2.3,4.5 +-3,5.4,-2.7,5.5 +-3,6.3,-3.2,6.4 +-3,7.2,-3.6,7.3 +-3,8.1,-4.1,8.2 +-3,9,-4.5,9.1 +-3,9.9,-5,10 +-3,10.8,-5.4,10.9 +-3,11.7,-5.9,11.8 +-3,12.6,-6.3,12.7 +-3,13.5,-6.8,13.6 +-3,14.4,-7.2,14.5 +-3,15.3,-7.7,15.5 +-3,16.2,-8.1,16.4 +-3,17.1,-8.6,17.3 +-3,18,-9,18.2 +-3,18.9,-9.5,19.1 +-3,19.8,-9.9,20 +-3,20.8,-10.4,20.9 +-3,21.7,-10.9,21.8 +-3,22.6,-11.3,22.7 +-3,23.5,-11.8,23.6 +-3,24.4,-12.2,24.5 +-3,25.3,-12.7,25.5 +-3,26.2,-13.1,26.4 +-3,27.1,-13.6,27.3 +-3,28,-14,28.2 +-3,28.9,-14.5,29.1 +-3,29.8,-14.9,30 +-3,30.7,-15.4,30.9 +-3,31.6,-15.8,31.8 +-3,32.5,-16.3,32.7 +-3,33.4,-16.7,33.6 +-3,34.3,-17.2,34.5 +-3,35.2,-17.6,35.5 +-3,36.1,-18.1,36.4 +-3,37,-18.5,37.3 +-3,37.9,-19,38.2 +-3,38.8,-19.4,39.1 +-3,39.7,-19.9,40 +-3,40.6,-20.4,40.9 +-3,41.5,-20.8,41.8 +-3,42.4,-21.3,42.7 +-3,43.3,-21.7,43.6 +-3,44.2,-22.2,44.5 +-3,45.1,-22.6,45.5 +-3,46,-23.1,46.4 +-3,46.9,-23.5,47.3 +-3,47.8,-24,48.2 +-3,48.7,-24.4,49.1 +-3,49.6,-24.9,50 +-3,50.5,-25.3,50.9 +-3,51.4,-25.8,51.8 +-3,52.3,-26.2,52.7 +-3,53.2,-26.7,53.6 +-3,54.1,-27.1,54.5 +-3,55,-27.6,55.5 +-3,55.9,-28,56.4 +-3,56.8,-28.5,57.3 +-3,57.7,-28.9,58.2 +-3,58.6,-29.4,59.1 +-3,59.5,-29.8,60 +-3,60.5,-30.3,60.9 +-3,61.4,-30.8,61.8 +-3,62.3,-31.2,62.7 +-3,63.2,-31.7,63.6 +-3,64.1,-32.1,64.5 +-3,65,-32.6,65.5 +-3,65.9,-33,66.4 +-3,66.8,-33.5,67.3 +-3,67.7,-33.9,68.2 +-3,68.6,-34.4,69.1 +-3,69.5,-34.8,70 +-3,70.4,-35.3,70.9 +-3,71.3,-35.7,71.8 +-3,72.2,-36.2,72.7 +-3,73.1,-36.6,73.6 +-3,74,-37.1,74.5 +-3,74.9,-37.5,75.5 +-3,75.8,-38,76.4 +-3,76.7,-38.4,77.3 +-3,77.6,-38.9,78.2 +-3,78.5,-39.3,79.1 +-3,79.4,-39.8,80 +-3,80.3,-40.3,80.9 +-3,81.2,-40.7,81.8 +-3,82.1,-41.2,82.7 +-3,83,-41.6,83.6 +-3,83.9,-42.1,84.5 +-3,84.8,-42.5,85.5 +-3,85.7,-43,86.4 +-3,86.6,-43.4,87.3 +-3,87.5,-43.9,88.2 +-3,88.4,-44.3,89.1 +-3,89.3,-44.8,90 +-3,90.2,-45.2,0 +-3,91.1,-45.7,0 +-3,92,-46.1,0 +-3,92.9,-46.6,0 +-3,93.8,-47,0 +-3,94.7,-47.5,0 +-3,95.6,-47.9,0 +-3,96.5,-48.4,0 +-3,97.4,-48.8,0 +-3,98.3,-49.3,0 +-3,99.2,-49.7,0 +-3,100.2,-50.2,0 +-3,101.1,-50.7,0 +-3,102,-51.1,0 +-3,102.9,-51.6,0 +-3,103.8,-52,0 +-3,104.7,-52.5,0 +-3,105.6,-52.9,0 +-3,106.5,-53.4,0 +-3,107.4,-53.8,0 +-3,108.3,-54.3,0 +-3,109.2,-54.7,0 +-3,110.1,-55.2,0 +-3,111,-55.6,0 +-3,111.9,-56.1,0 +-3,112.8,-56.5,0 +-3,113.7,-57,0 +-3,114.6,-57.4,0 +-3,115.5,-57.9,0 +-3,116.4,-58.3,0 +-3,117.3,-58.8,0 +-3,118.2,-59.2,0 +-3,119.1,-59.7,0 +-3,120,-60.2,0 +-3,120.9,-60.6,0 +-3,121.8,-61.1,0 +-3,122.7,-61.5,0 +-3,123.6,-62,0 +-3,124.5,-62.4,0 +-3,125.4,-62.9,0 +-3,126.3,-63.3,0 +-3,127.2,-63.8,0 +-3,128.1,-64.2,0 +-3,129,-64.7,0 +-3,129.9,-65.1,0 +-3,130.8,-65.6,0 +-3,131.7,-66,0 +-3,132.6,-66.5,0 +-3,133.5,-66.9,0 +-3,134.4,-67.4,0 +-3,135.3,-67.8,0 +-3,136.2,-68.3,0 +-3,137.1,-68.7,0 +-3,138,-69.2,0 +-3,138.9,-69.6,0 +-3,139.8,-70.1,0 +-3,140.8,-70.6,0 +-3,141.7,-71,0 +-3,142.6,-71.5,0 +-3,143.5,-71.9,0 +-3,144.4,-72.4,0 +-3,145.3,-72.8,0 +-3,146.2,-73.3,0 +-3,147.1,-73.7,0 +-3,148,-74.2,0 +-3,148.9,-74.6,0 +-3,149.8,-75.1,0 +-3,150.7,-75.5,0 +-3,151.6,-76,0 +-3,152.5,-76.4,0 +-3,153.4,-76.9,0 +-3,154.3,-77.3,0 +-3,155.2,-77.8,0 +-3,156.1,-78.2,0 +-3,157,-78.7,0 +-3,157.9,-79.1,0 +-3,158.8,-79.6,0 +-3,159.7,-80.1,0 +-3,160.6,-80.5,0 +-3,161.5,-81,0 +-3,162.4,-81.4,0 +-3,163.3,-81.9,0 +-3,164.2,-82.3,0 +-3,165.1,-82.8,0 +-3,166,-83.2,0 +-3,166.9,-83.7,0 +-3,167.8,-84.1,0 +-3,168.7,-84.6,0 +-3,169.6,-85,0 +-3,170.5,-85.5,0 +-3,171.4,-85.9,0 +-3,172.3,-86.4,0 +-3,173.2,-86.8,0 +-3,174.1,-87.3,0 +-3,175,-87.7,0 +-3,175.9,-88.2,0 +-3,176.8,-88.6,0 +-3,177.7,-89.1,0 +-3,178.6,-89.5,0 +-3,179.5,-90,0 +-3,180.5,0,0 +-3,181.4,0,0 +-3,182.3,0,0 +-3,183.2,0,0 +-3,184.1,0,0 +-3,185,0,0 +-3,185.9,0,0 +-3,186.8,0,0 +-3,187.7,0,0 +-3,188.6,0,0 +-3,189.5,0,0 +-3,190.4,0,0 +-3,191.3,0,0 +-3,192.2,0,0 +-3,193.1,0,0 +-3,194,0,0 +-3,194.9,0,0 +-3,195.8,0,0 +-3,196.7,0,0 +-3,197.6,0,0 +-3,198.5,0,0 +-3,199.4,0,0 +-3,200.3,0,0 +-3,201.2,0,0 +-3,202.1,0,0 +-3,203,0,0 +-3,203.9,0,0 +-3,204.8,0,0 +-3,205.7,0,0 +-3,206.6,0,0 +-3,207.5,0,0 +-3,208.4,0,0 +-3,209.3,0,0 +-3,210.2,0,0 +-3,211.1,0,0 +-3,212,0,0 +-3,212.9,0,0 +-3,213.8,0,0 +-3,214.7,0,0 +-3,215.6,0,0 +-3,216.5,0,0 +-3,217.4,0,0 +-3,218.3,0,0 +-3,219.2,0,0 +-3,220.2,0,0 +-3,221.1,0,0 +-3,222,0,0 +-3,222.9,0,0 +-3,223.8,0,0 +-3,224.7,0,0 +-3,225.6,0,0 +-3,226.5,0,0 +-3,227.4,0,0 +-3,228.3,0,0 +-3,229.2,0,0 +-3,230.1,0,0 +-3,231,0,0 +-3,231.9,0,0 +-3,232.8,0,0 +-3,233.7,0,0 +-3,234.6,0,0 +-3,235.5,0,0 +-3,236.4,0,0 +-3,237.3,0,0 +-3,238.2,0,0 +-3,239.1,0,0 +-3,240,0,0 +-3,240.9,0,0 +-3,241.8,0,0 +-3,242.7,0,0 +-3,243.6,0,0 +-3,244.5,0,0 +-3,245.4,0,0 +-3,246.3,0,0 +-3,247.2,0,0 +-3,248.1,0,0 +-3,249,0,0 +-3,249.9,0,0 +-3,250.8,0,0 +-3,251.7,0,0 +-3,252.6,0,0 +-3,253.5,0,0 +-3,254.4,0,0 +-3,255.3,0,0 +-3,256.2,0,0 +-3,257.1,0,0 +-3,258,0,0 +-3,258.9,0,0 +-3,259.8,0,0 +-3,260.8,0,0 +-3,261.7,0,0 +-3,262.6,0,0 +-3,263.5,0,0 +-3,264.4,0,0 +-3,265.3,0,0 +-3,266.2,0,0 +-3,267.1,0,0 +-3,268,0,0 +-3,268.9,0,0 +-3,269.8,0,0 +-3,270.7,0,0 +-3,271.6,0,0 +-3,272.5,0,0 +-3,273.4,0,0 +-3,274.3,0,0 +-3,275.2,0,0 +-3,276.1,0,0 +-3,277,0,0 +-3,277.9,0,0 +-3,278.8,0,0 +-3,279.7,0,0 +-3,280.6,0,0 +-3,281.5,0,0 +-3,282.4,0,0 +-3,283.3,0,0 +-3,284.2,0,0 +-3,285.1,0,0 +-3,286,0,0 +-3,286.9,0,0 +-3,287.8,0,0 +-3,288.7,0,0 +-3,289.6,0,0 +-3,290.5,0,0 +-3,291.4,0,0 +-3,292.3,0,0 +-3,293.2,0,0 +-3,294.1,0,0 +-3,295,0,0 +-3,295.9,0,0 +-3,296.8,0,0 +-3,297.7,0,0 +-3,298.6,0,0 +-3,299.5,0,0 +-3,300.5,0,0 +-3,301.4,0,0 +-3,302.3,0,0 +-3,303.2,0,0 +-3,304.1,0,0 +-3,305,0,0 +-3,305.9,0,0 +-3,306.8,0,0 +-3,307.7,0,0 +-3,308.6,0,0 +-3,309.5,0,0 +-3,310.4,0,0 +-3,311.3,0,0 +-3,312.2,0,0 +-3,313.1,0,0 +-3,314,0,0 +-3,314.9,0,0 +-3,315.8,0,0 +-3,316.7,0,0 +-3,317.6,0,0 +-3,318.5,0,0 +-3,319.4,0,0 +-3,320.3,0,0 +-3,321.2,0,0 +-3,322.1,0,0 +-3,323,0,0 +-3,323.9,0,0 +-3,324.8,0,0 +-3,325.7,0,0 +-3,326.6,0,0 +-3,327.5,0,0 +-3,328.4,0,0 +-3,329.3,0,0 +-3,330.2,0,0 +-3,331.1,0,0 +-3,332,0,0 +-3,332.9,0,0 +-3,333.8,0,0 +-3,334.7,0,0 +-3,335.6,0,0 +-3,336.5,0,0 +-3,337.4,0,0 +-3,338.3,0,0 +-3,339.2,0,0 +-3,340.2,0,0 +-3,341.1,0,0 +-3,342,0,0 +-3,342.9,0,0 +-3,343.8,0,0 +-3,344.7,0,0 +-3,345.6,0,0 +-3,346.5,0,0 +-3,347.4,0,0 +-3,348.3,0,0 +-3,349.2,0,0 +-3,350.1,0,0 +-3,351,0,0 +-3,351.9,0,0 +-3,352.8,0,0 +-3,353.7,0,0 +-3,354.6,0,0 +-3,355.5,0,0 +-3,356.4,0,0 +-3,357.3,0,0 +-3,358.2,0,0 +-3,359.1,0,0 +-3,360,0,0 +-3,360,0,0 +-3,359.1,0,0 +-3,358.2,0,0 +-3,357.3,0,0 +-3,356.4,0,0 +-3,355.5,0,0 +-3,354.6,0,0 +-3,353.7,0,0 +-3,352.8,0,0 +-3,351.9,0,0 +-3,351,0,0 +-3,350.1,0,0 +-3,349.2,0,0 +-3,348.3,0,0 +-3,347.4,0,0 +-3,346.5,0,0 +-3,345.6,0,0 +-3,344.7,0,0 +-3,343.8,0,0 +-3,342.9,0,0 +-3,342,0,0 +-3,341.1,0,0 +-3,340.2,0,0 +-3,339.2,0,0 +-3,338.3,0,0 +-3,337.4,0,0 +-3,336.5,0,0 +-3,335.6,0,0 +-3,334.7,0,0 +-3,333.8,0,0 +-3,332.9,0,0 +-3,332,0,0 +-3,331.1,0,0 +-3,330.2,0,0 +-3,329.3,0,0 +-3,328.4,0,0 +-3,327.5,0,0 +-3,326.6,0,0 +-3,325.7,0,0 +-3,324.8,0,0 +-3,323.9,0,0 +-3,323,0,0 +-3,322.1,0,0 +-3,321.2,0,0 +-3,320.3,0,0 +-3,319.4,0,0 +-3,318.5,0,0 +-3,317.6,0,0 +-3,316.7,0,0 +-3,315.8,0,0 +-3,314.9,0,0 +-3,314,0,0 +-3,313.1,0,0 +-3,312.2,0,0 +-3,311.3,0,0 +-3,310.4,0,0 +-3,309.5,0,0 +-3,308.6,0,0 +-3,307.7,0,0 +-3,306.8,0,0 +-3,305.9,0,0 +-3,305,0,0 +-3,304.1,0,0 +-3,303.2,0,0 +-3,302.3,0,0 +-3,301.4,0,0 +-3,300.5,0,0 +-3,299.5,0,0 +-3,298.6,0,0 +-3,297.7,0,0 +-3,296.8,0,0 +-3,295.9,0,0 +-3,295,0,0 +-3,294.1,0,0 +-3,293.2,0,0 +-3,292.3,0,0 +-3,291.4,0,0 +-3,290.5,0,0 +-3,289.6,0,0 +-3,288.7,0,0 +-3,287.8,0,0 +-3,286.9,0,0 +-3,286,0,0 +-3,285.1,0,0 +-3,284.2,0,0 +-3,283.3,0,0 +-3,282.4,0,0 +-3,281.5,0,0 +-3,280.6,0,0 +-3,279.7,0,0 +-3,278.8,0,0 +-3,277.9,0,0 +-3,277,0,0 +-3,276.1,0,0 +-3,275.2,0,0 +-3,274.3,0,0 +-3,273.4,0,0 +-3,272.5,0,0 +-3,271.6,0,0 +-3,270.7,0,0 +-3,269.8,0,0 +-3,268.9,0,0 +-3,268,0,0 +-3,267.1,0,0 +-3,266.2,0,0 +-3,265.3,0,0 +-3,264.4,0,0 +-3,263.5,0,0 +-3,262.6,0,0 +-3,261.7,0,0 +-3,260.8,0,0 +-3,259.8,0,0 +-3,258.9,0,0 +-3,258,0,0 +-3,257.1,0,0 +-3,256.2,0,0 +-3,255.3,0,0 +-3,254.4,0,0 +-3,253.5,0,0 +-3,252.6,0,0 +-3,251.7,0,0 +-3,250.8,0,0 +-3,249.9,0,0 +-3,249,0,0 +-3,248.1,0,0 +-3,247.2,0,0 +-3,246.3,0,0 +-3,245.4,0,0 +-3,244.5,0,0 +-3,243.6,0,0 +-3,242.7,0,0 +-3,241.8,0,0 +-3,240.9,0,0 +-3,240,0,0 +-3,239.1,0,0 +-3,238.2,0,0 +-3,237.3,0,0 +-3,236.4,0,0 +-3,235.5,0,0 +-3,234.6,0,0 +-3,233.7,0,0 +-3,232.8,0,0 +-3,231.9,0,0 +-3,231,0,0 +-3,230.1,0,0 +-3,229.2,0,0 +-3,228.3,0,0 +-3,227.4,0,0 +-3,226.5,0,0 +-3,225.6,0,0 +-3,224.7,0,0 +-3,223.8,0,0 +-3,222.9,0,0 +-3,222,0,0 +-3,221.1,0,0 +-3,220.2,0,0 +-3,219.2,0,0 +-3,218.3,0,0 +-3,217.4,0,0 +-3,216.5,0,0 +-3,215.6,0,0 +-3,214.7,0,0 +-3,213.8,0,0 +-3,212.9,0,0 +-3,212,0,0 +-3,211.1,0,0 +-3,210.2,0,0 +-3,209.3,0,0 +-3,208.4,0,0 +-3,207.5,0,0 +-3,206.6,0,0 +-3,205.7,0,0 +-3,204.8,0,0 +-3,203.9,0,0 +-3,203,0,0 +-3,202.1,0,0 +-3,201.2,0,0 +-3,200.3,0,0 +-3,199.4,0,0 +-3,198.5,0,0 +-3,197.6,0,0 +-3,196.7,0,0 +-3,195.8,0,0 +-3,194.9,0,0 +-3,194,0,0 +-3,193.1,0,0 +-3,192.2,0,0 +-3,191.3,0,0 +-3,190.4,0,0 +-3,189.5,0,0 +-3,188.6,0,0 +-3,187.7,0,0 +-3,186.8,0,0 +-3,185.9,0,0 +-3,185,0,0 +-3,184.1,0,0 +-3,183.2,0,0 +-3,182.3,0,0 +-3,181.4,0,0 +-3,180.5,0,0 +-3,179.5,-90,0 +-3,178.6,-89.5,0 +-3,177.7,-89.1,0 +-3,176.8,-88.6,0 +-3,175.9,-88.2,0 +-3,175,-87.7,0 +-3,174.1,-87.3,0 +-3,173.2,-86.8,0 +-3,172.3,-86.4,0 +-3,171.4,-85.9,0 +-3,170.5,-85.5,0 +-3,169.6,-85,0 +-3,168.7,-84.6,0 +-3,167.8,-84.1,0 +-3,166.9,-83.7,0 +-3,166,-83.2,0 +-3,165.1,-82.8,0 +-3,164.2,-82.3,0 +-3,163.3,-81.9,0 +-3,162.4,-81.4,0 +-3,161.5,-81,0 +-3,160.6,-80.5,0 +-3,159.7,-80.1,0 +-3,158.8,-79.6,0 +-3,157.9,-79.1,0 +-3,157,-78.7,0 +-3,156.1,-78.2,0 +-3,155.2,-77.8,0 +-3,154.3,-77.3,0 +-3,153.4,-76.9,0 +-3,152.5,-76.4,0 +-3,151.6,-76,0 +-3,150.7,-75.5,0 +-3,149.8,-75.1,0 +-3,148.9,-74.6,0 +-3,148,-74.2,0 +-3,147.1,-73.7,0 +-3,146.2,-73.3,0 +-3,145.3,-72.8,0 +-3,144.4,-72.4,0 +-3,143.5,-71.9,0 +-3,142.6,-71.5,0 +-3,141.7,-71,0 +-3,140.8,-70.6,0 +-3,139.8,-70.1,0 +-3,138.9,-69.6,0 +-3,138,-69.2,0 +-3,137.1,-68.7,0 +-3,136.2,-68.3,0 +-3,135.3,-67.8,0 +-3,134.4,-67.4,0 +-3,133.5,-66.9,0 +-3,132.6,-66.5,0 +-3,131.7,-66,0 +-3,130.8,-65.6,0 +-3,129.9,-65.1,0 +-3,129,-64.7,0 +-3,128.1,-64.2,0 +-3,127.2,-63.8,0 +-3,126.3,-63.3,0 +-3,125.4,-62.9,0 +-3,124.5,-62.4,0 +-3,123.6,-62,0 +-3,122.7,-61.5,0 +-3,121.8,-61.1,0 +-3,120.9,-60.6,0 +-3,120,-60.2,0 +-3,119.1,-59.7,0 +-3,118.2,-59.2,0 +-3,117.3,-58.8,0 +-3,116.4,-58.3,0 +-3,115.5,-57.9,0 +-3,114.6,-57.4,0 +-3,113.7,-57,0 +-3,112.8,-56.5,0 +-3,111.9,-56.1,0 +-3,111,-55.6,0 +-3,110.1,-55.2,0 +-3,109.2,-54.7,0 +-3,108.3,-54.3,0 +-3,107.4,-53.8,0 +-3,106.5,-53.4,0 +-3,105.6,-52.9,0 +-3,104.7,-52.5,0 +-3,103.8,-52,0 +-3,102.9,-51.6,0 +-3,102,-51.1,0 +-3,101.1,-50.7,0 +-3,100.2,-50.2,0 +-3,99.2,-49.7,0 +-3,98.3,-49.3,0 +-3,97.4,-48.8,0 +-3,96.5,-48.4,0 +-3,95.6,-47.9,0 +-3,94.7,-47.5,0 +-3,93.8,-47,0 +-3,92.9,-46.6,0 +-3,92,-46.1,0 +-3,91.1,-45.7,0 +-3,90.2,-45.2,0 +-3,89.3,-44.8,90 +-3,88.4,-44.3,89.1 +-3,87.5,-43.9,88.2 +-3,86.6,-43.4,87.3 +-3,85.7,-43,86.4 +-3,84.8,-42.5,85.5 +-3,83.9,-42.1,84.5 +-3,83,-41.6,83.6 +-3,82.1,-41.2,82.7 +-3,81.2,-40.7,81.8 +-3,80.3,-40.3,80.9 +-3,79.4,-39.8,80 +-3,78.5,-39.3,79.1 +-3,77.6,-38.9,78.2 +-3,76.7,-38.4,77.3 +-3,75.8,-38,76.4 +-3,74.9,-37.5,75.5 +-3,74,-37.1,74.5 +-3,73.1,-36.6,73.6 +-3,72.2,-36.2,72.7 +-3,71.3,-35.7,71.8 +-3,70.4,-35.3,70.9 +-3,69.5,-34.8,70 +-3,68.6,-34.4,69.1 +-3,67.7,-33.9,68.2 +-3,66.8,-33.5,67.3 +-3,65.9,-33,66.4 +-3,65,-32.6,65.5 +-3,64.1,-32.1,64.5 +-3,63.2,-31.7,63.6 +-3,62.3,-31.2,62.7 +-3,61.4,-30.8,61.8 +-3,60.5,-30.3,60.9 +-3,59.5,-29.8,60 +-3,58.6,-29.4,59.1 +-3,57.7,-28.9,58.2 +-3,56.8,-28.5,57.3 +-3,55.9,-28,56.4 +-3,55,-27.6,55.5 +-3,54.1,-27.1,54.5 +-3,53.2,-26.7,53.6 +-3,52.3,-26.2,52.7 +-3,51.4,-25.8,51.8 +-3,50.5,-25.3,50.9 +-3,49.6,-24.9,50 +-3,48.7,-24.4,49.1 +-3,47.8,-24,48.2 +-3,46.9,-23.5,47.3 +-3,46,-23.1,46.4 +-3,45.1,-22.6,45.5 +-3,44.2,-22.2,44.5 +-3,43.3,-21.7,43.6 +-3,42.4,-21.3,42.7 +-3,41.5,-20.8,41.8 +-3,40.6,-20.4,40.9 +-3,39.7,-19.9,40 +-3,38.8,-19.4,39.1 +-3,37.9,-19,38.2 +-3,37,-18.5,37.3 +-3,36.1,-18.1,36.4 +-3,35.2,-17.6,35.5 +-3,34.3,-17.2,34.5 +-3,33.4,-16.7,33.6 +-3,32.5,-16.3,32.7 +-3,31.6,-15.8,31.8 +-3,30.7,-15.4,30.9 +-3,29.8,-14.9,30 +-3,28.9,-14.5,29.1 +-3,28,-14,28.2 +-3,27.1,-13.6,27.3 +-3,26.2,-13.1,26.4 +-3,25.3,-12.7,25.5 +-3,24.4,-12.2,24.5 +-3,23.5,-11.8,23.6 +-3,22.6,-11.3,22.7 +-3,21.7,-10.9,21.8 +-3,20.8,-10.4,20.9 +-3,19.8,-9.9,20 +-3,18.9,-9.5,19.1 +-3,18,-9,18.2 +-3,17.1,-8.6,17.3 +-3,16.2,-8.1,16.4 +-3,15.3,-7.7,15.5 +-3,14.4,-7.2,14.5 +-3,13.5,-6.8,13.6 +-3,12.6,-6.3,12.7 +-3,11.7,-5.9,11.8 +-3,10.8,-5.4,10.9 +-3,9.9,-5,10 +-3,9,-4.5,9.1 +-3,8.1,-4.1,8.2 +-3,7.2,-3.6,7.3 +-3,6.3,-3.2,6.4 +-3,5.4,-2.7,5.5 +-3,4.5,-2.3,4.5 +-3,3.6,-1.8,3.6 +-3,2.7,-1.4,2.7 +-3,1.8,-0.9,1.8 +-3,0.9,-0.5,0.9 +-3,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +0.9,0,0,0.3 +0.9,0,0,0.3 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.8,0,0,0.5 +0.8,0,0,0.5 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.5,0,0,0.8 +0.5,0,0,0.8 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.3,0,0,0.9 +0.3,0,0,0.9 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,0.9 +0.3,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.8 +0.5,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.7,0,0,0.8 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.8,0,0,0.7 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.5 +0.8,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.3 +0.9,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0 +-3,0,0,0 +-3,0.9,-0.5,0.9 +-3,1.8,-0.9,1.8 +-3,2.7,-1.4,2.7 +-3,3.6,-1.8,3.6 +-3,4.5,-2.3,4.5 +-3,5.4,-2.7,5.5 +-3,6.3,-3.2,6.4 +-3,7.2,-3.6,7.3 +-3,8.1,-4.1,8.2 +-3,9,-4.5,9.1 +-3,9.9,-5,10 +-3,10.8,-5.4,10.9 +-3,11.7,-5.9,11.8 +-3,12.6,-6.3,12.7 +-3,13.5,-6.8,13.6 +-3,14.4,-7.2,14.5 +-3,15.3,-7.7,15.5 +-3,16.2,-8.1,16.4 +-3,17.1,-8.6,17.3 +-3,18,-9,18.2 +-3,18.9,-9.5,19.1 +-3,19.8,-9.9,20 +-3,20.8,-10.4,20.9 +-3,21.7,-10.9,21.8 +-3,22.6,-11.3,22.7 +-3,23.5,-11.8,23.6 +-3,24.4,-12.2,24.5 +-3,25.3,-12.7,25.5 +-3,26.2,-13.1,26.4 +-3,27.1,-13.6,27.3 +-3,28,-14,28.2 +-3,28.9,-14.5,29.1 +-3,29.8,-14.9,30 +-3,30.7,-15.4,30.9 +-3,31.6,-15.8,31.8 +-3,32.5,-16.3,32.7 +-3,33.4,-16.7,33.6 +-3,34.3,-17.2,34.5 +-3,35.2,-17.6,35.5 +-3,36.1,-18.1,36.4 +-3,37,-18.5,37.3 +-3,37.9,-19,38.2 +-3,38.8,-19.4,39.1 +-3,39.7,-19.9,40 +-3,40.6,-20.4,40.9 +-3,41.5,-20.8,41.8 +-3,42.4,-21.3,42.7 +-3,43.3,-21.7,43.6 +-3,44.2,-22.2,44.5 +-3,45.1,-22.6,45.5 +-3,46,-23.1,46.4 +-3,46.9,-23.5,47.3 +-3,47.8,-24,48.2 +-3,48.7,-24.4,49.1 +-3,49.6,-24.9,50 +-3,50.5,-25.3,50.9 +-3,51.4,-25.8,51.8 +-3,52.3,-26.2,52.7 +-3,53.2,-26.7,53.6 +-3,54.1,-27.1,54.5 +-3,55,-27.6,55.5 +-3,55.9,-28,56.4 +-3,56.8,-28.5,57.3 +-3,57.7,-28.9,58.2 +-3,58.6,-29.4,59.1 +-3,59.5,-29.8,60 +-3,60.5,-30.3,60.9 +-3,61.4,-30.8,61.8 +-3,62.3,-31.2,62.7 +-3,63.2,-31.7,63.6 +-3,64.1,-32.1,64.5 +-3,65,-32.6,65.5 +-3,65.9,-33,66.4 +-3,66.8,-33.5,67.3 +-3,67.7,-33.9,68.2 +-3,68.6,-34.4,69.1 +-3,69.5,-34.8,70 +-3,70.4,-35.3,70.9 +-3,71.3,-35.7,71.8 +-3,72.2,-36.2,72.7 +-3,73.1,-36.6,73.6 +-3,74,-37.1,74.5 +-3,74.9,-37.5,75.5 +-3,75.8,-38,76.4 +-3,76.7,-38.4,77.3 +-3,77.6,-38.9,78.2 +-3,78.5,-39.3,79.1 +-3,79.4,-39.8,80 +-3,80.3,-40.3,80.9 +-3,81.2,-40.7,81.8 +-3,82.1,-41.2,82.7 +-3,83,-41.6,83.6 +-3,83.9,-42.1,84.5 +-3,84.8,-42.5,85.5 +-3,85.7,-43,86.4 +-3,86.6,-43.4,87.3 +-3,87.5,-43.9,88.2 +-3,88.4,-44.3,89.1 +-3,89.3,-44.8,90 +-3,90.2,-45.2,0 +-3,91.1,-45.7,0 +-3,92,-46.1,0 +-3,92.9,-46.6,0 +-3,93.8,-47,0 +-3,94.7,-47.5,0 +-3,95.6,-47.9,0 +-3,96.5,-48.4,0 +-3,97.4,-48.8,0 +-3,98.3,-49.3,0 +-3,99.2,-49.7,0 +-3,100.2,-50.2,0 +-3,101.1,-50.7,0 +-3,102,-51.1,0 +-3,102.9,-51.6,0 +-3,103.8,-52,0 +-3,104.7,-52.5,0 +-3,105.6,-52.9,0 +-3,106.5,-53.4,0 +-3,107.4,-53.8,0 +-3,108.3,-54.3,0 +-3,109.2,-54.7,0 +-3,110.1,-55.2,0 +-3,111,-55.6,0 +-3,111.9,-56.1,0 +-3,112.8,-56.5,0 +-3,113.7,-57,0 +-3,114.6,-57.4,0 +-3,115.5,-57.9,0 +-3,116.4,-58.3,0 +-3,117.3,-58.8,0 +-3,118.2,-59.2,0 +-3,119.1,-59.7,0 +-3,120,-60.2,0 +-3,120.9,-60.6,0 +-3,121.8,-61.1,0 +-3,122.7,-61.5,0 +-3,123.6,-62,0 +-3,124.5,-62.4,0 +-3,125.4,-62.9,0 +-3,126.3,-63.3,0 +-3,127.2,-63.8,0 +-3,128.1,-64.2,0 +-3,129,-64.7,0 +-3,129.9,-65.1,0 +-3,130.8,-65.6,0 +-3,131.7,-66,0 +-3,132.6,-66.5,0 +-3,133.5,-66.9,0 +-3,134.4,-67.4,0 +-3,135.3,-67.8,0 +-3,136.2,-68.3,0 +-3,137.1,-68.7,0 +-3,138,-69.2,0 +-3,138.9,-69.6,0 +-3,139.8,-70.1,0 +-3,140.8,-70.6,0 +-3,141.7,-71,0 +-3,142.6,-71.5,0 +-3,143.5,-71.9,0 +-3,144.4,-72.4,0 +-3,145.3,-72.8,0 +-3,146.2,-73.3,0 +-3,147.1,-73.7,0 +-3,148,-74.2,0 +-3,148.9,-74.6,0 +-3,149.8,-75.1,0 +-3,150.7,-75.5,0 +-3,151.6,-76,0 +-3,152.5,-76.4,0 +-3,153.4,-76.9,0 +-3,154.3,-77.3,0 +-3,155.2,-77.8,0 +-3,156.1,-78.2,0 +-3,157,-78.7,0 +-3,157.9,-79.1,0 +-3,158.8,-79.6,0 +-3,159.7,-80.1,0 +-3,160.6,-80.5,0 +-3,161.5,-81,0 +-3,162.4,-81.4,0 +-3,163.3,-81.9,0 +-3,164.2,-82.3,0 +-3,165.1,-82.8,0 +-3,166,-83.2,0 +-3,166.9,-83.7,0 +-3,167.8,-84.1,0 +-3,168.7,-84.6,0 +-3,169.6,-85,0 +-3,170.5,-85.5,0 +-3,171.4,-85.9,0 +-3,172.3,-86.4,0 +-3,173.2,-86.8,0 +-3,174.1,-87.3,0 +-3,175,-87.7,0 +-3,175.9,-88.2,0 +-3,176.8,-88.6,0 +-3,177.7,-89.1,0 +-3,178.6,-89.5,0 +-3,179.5,-90,0 +-3,180.5,0,0 +-3,181.4,0,0 +-3,182.3,0,0 +-3,183.2,0,0 +-3,184.1,0,0 +-3,185,0,0 +-3,185.9,0,0 +-3,186.8,0,0 +-3,187.7,0,0 +-3,188.6,0,0 +-3,189.5,0,0 +-3,190.4,0,0 +-3,191.3,0,0 +-3,192.2,0,0 +-3,193.1,0,0 +-3,194,0,0 +-3,194.9,0,0 +-3,195.8,0,0 +-3,196.7,0,0 +-3,197.6,0,0 +-3,198.5,0,0 +-3,199.4,0,0 +-3,200.3,0,0 +-3,201.2,0,0 +-3,202.1,0,0 +-3,203,0,0 +-3,203.9,0,0 +-3,204.8,0,0 +-3,205.7,0,0 +-3,206.6,0,0 +-3,207.5,0,0 +-3,208.4,0,0 +-3,209.3,0,0 +-3,210.2,0,0 +-3,211.1,0,0 +-3,212,0,0 +-3,212.9,0,0 +-3,213.8,0,0 +-3,214.7,0,0 +-3,215.6,0,0 +-3,216.5,0,0 +-3,217.4,0,0 +-3,218.3,0,0 +-3,219.2,0,0 +-3,220.2,0,0 +-3,221.1,0,0 +-3,222,0,0 +-3,222.9,0,0 +-3,223.8,0,0 +-3,224.7,0,0 +-3,225.6,0,0 +-3,226.5,0,0 +-3,227.4,0,0 +-3,228.3,0,0 +-3,229.2,0,0 +-3,230.1,0,0 +-3,231,0,0 +-3,231.9,0,0 +-3,232.8,0,0 +-3,233.7,0,0 +-3,234.6,0,0 +-3,235.5,0,0 +-3,236.4,0,0 +-3,237.3,0,0 +-3,238.2,0,0 +-3,239.1,0,0 +-3,240,0,0 +-3,240.9,0,0 +-3,241.8,0,0 +-3,242.7,0,0 +-3,243.6,0,0 +-3,244.5,0,0 +-3,245.4,0,0 +-3,246.3,0,0 +-3,247.2,0,0 +-3,248.1,0,0 +-3,249,0,0 +-3,249.9,0,0 +-3,250.8,0,0 +-3,251.7,0,0 +-3,252.6,0,0 +-3,253.5,0,0 +-3,254.4,0,0 +-3,255.3,0,0 +-3,256.2,0,0 +-3,257.1,0,0 +-3,258,0,0 +-3,258.9,0,0 +-3,259.8,0,0 +-3,260.8,0,0 +-3,261.7,0,0 +-3,262.6,0,0 +-3,263.5,0,0 +-3,264.4,0,0 +-3,265.3,0,0 +-3,266.2,0,0 +-3,267.1,0,0 +-3,268,0,0 +-3,268.9,0,0 +-3,269.8,0,0 +-3,270.7,0,0 +-3,271.6,0,0 +-3,272.5,0,0 +-3,273.4,0,0 +-3,274.3,0,0 +-3,275.2,0,0 +-3,276.1,0,0 +-3,277,0,0 +-3,277.9,0,0 +-3,278.8,0,0 +-3,279.7,0,0 +-3,280.6,0,0 +-3,281.5,0,0 +-3,282.4,0,0 +-3,283.3,0,0 +-3,284.2,0,0 +-3,285.1,0,0 +-3,286,0,0 +-3,286.9,0,0 +-3,287.8,0,0 +-3,288.7,0,0 +-3,289.6,0,0 +-3,290.5,0,0 +-3,291.4,0,0 +-3,292.3,0,0 +-3,293.2,0,0 +-3,294.1,0,0 +-3,295,0,0 +-3,295.9,0,0 +-3,296.8,0,0 +-3,297.7,0,0 +-3,298.6,0,0 +-3,299.5,0,0 +-3,300.5,0,0 +-3,301.4,0,0 +-3,302.3,0,0 +-3,303.2,0,0 +-3,304.1,0,0 +-3,305,0,0 +-3,305.9,0,0 +-3,306.8,0,0 +-3,307.7,0,0 +-3,308.6,0,0 +-3,309.5,0,0 +-3,310.4,0,0 +-3,311.3,0,0 +-3,312.2,0,0 +-3,313.1,0,0 +-3,314,0,0 +-3,314.9,0,0 +-3,315.8,0,0 +-3,316.7,0,0 +-3,317.6,0,0 +-3,318.5,0,0 +-3,319.4,0,0 +-3,320.3,0,0 +-3,321.2,0,0 +-3,322.1,0,0 +-3,323,0,0 +-3,323.9,0,0 +-3,324.8,0,0 +-3,325.7,0,0 +-3,326.6,0,0 +-3,327.5,0,0 +-3,328.4,0,0 +-3,329.3,0,0 +-3,330.2,0,0 +-3,331.1,0,0 +-3,332,0,0 +-3,332.9,0,0 +-3,333.8,0,0 +-3,334.7,0,0 +-3,335.6,0,0 +-3,336.5,0,0 +-3,337.4,0,0 +-3,338.3,0,0 +-3,339.2,0,0 +-3,340.2,0,0 +-3,341.1,0,0 +-3,342,0,0 +-3,342.9,0,0 +-3,343.8,0,0 +-3,344.7,0,0 +-3,345.6,0,0 +-3,346.5,0,0 +-3,347.4,0,0 +-3,348.3,0,0 +-3,349.2,0,0 +-3,350.1,0,0 +-3,351,0,0 +-3,351.9,0,0 +-3,352.8,0,0 +-3,353.7,0,0 +-3,354.6,0,0 +-3,355.5,0,0 +-3,356.4,0,0 +-3,357.3,0,0 +-3,358.2,0,0 +-3,359.1,0,0 +-3,360,0,0 +-3,360,0,0 +-3,359.1,0,0 +-3,358.2,0,0 +-3,357.3,0,0 +-3,356.4,0,0 +-3,355.5,0,0 +-3,354.6,0,0 +-3,353.7,0,0 +-3,352.8,0,0 +-3,351.9,0,0 +-3,351,0,0 +-3,350.1,0,0 +-3,349.2,0,0 +-3,348.3,0,0 +-3,347.4,0,0 +-3,346.5,0,0 +-3,345.6,0,0 +-3,344.7,0,0 +-3,343.8,0,0 +-3,342.9,0,0 +-3,342,0,0 +-3,341.1,0,0 +-3,340.2,0,0 +-3,339.2,0,0 +-3,338.3,0,0 +-3,337.4,0,0 +-3,336.5,0,0 +-3,335.6,0,0 +-3,334.7,0,0 +-3,333.8,0,0 +-3,332.9,0,0 +-3,332,0,0 +-3,331.1,0,0 +-3,330.2,0,0 +-3,329.3,0,0 +-3,328.4,0,0 +-3,327.5,0,0 +-3,326.6,0,0 +-3,325.7,0,0 +-3,324.8,0,0 +-3,323.9,0,0 +-3,323,0,0 +-3,322.1,0,0 +-3,321.2,0,0 +-3,320.3,0,0 +-3,319.4,0,0 +-3,318.5,0,0 +-3,317.6,0,0 +-3,316.7,0,0 +-3,315.8,0,0 +-3,314.9,0,0 +-3,314,0,0 +-3,313.1,0,0 +-3,312.2,0,0 +-3,311.3,0,0 +-3,310.4,0,0 +-3,309.5,0,0 +-3,308.6,0,0 +-3,307.7,0,0 +-3,306.8,0,0 +-3,305.9,0,0 +-3,305,0,0 +-3,304.1,0,0 +-3,303.2,0,0 +-3,302.3,0,0 +-3,301.4,0,0 +-3,300.5,0,0 +-3,299.5,0,0 +-3,298.6,0,0 +-3,297.7,0,0 +-3,296.8,0,0 +-3,295.9,0,0 +-3,295,0,0 +-3,294.1,0,0 +-3,293.2,0,0 +-3,292.3,0,0 +-3,291.4,0,0 +-3,290.5,0,0 +-3,289.6,0,0 +-3,288.7,0,0 +-3,287.8,0,0 +-3,286.9,0,0 +-3,286,0,0 +-3,285.1,0,0 +-3,284.2,0,0 +-3,283.3,0,0 +-3,282.4,0,0 +-3,281.5,0,0 +-3,280.6,0,0 +-3,279.7,0,0 +-3,278.8,0,0 +-3,277.9,0,0 +-3,277,0,0 +-3,276.1,0,0 +-3,275.2,0,0 +-3,274.3,0,0 +-3,273.4,0,0 +-3,272.5,0,0 +-3,271.6,0,0 +-3,270.7,0,0 +-3,269.8,0,0 +-3,268.9,0,0 +-3,268,0,0 +-3,267.1,0,0 +-3,266.2,0,0 +-3,265.3,0,0 +-3,264.4,0,0 +-3,263.5,0,0 +-3,262.6,0,0 +-3,261.7,0,0 +-3,260.8,0,0 +-3,259.8,0,0 +-3,258.9,0,0 +-3,258,0,0 +-3,257.1,0,0 +-3,256.2,0,0 +-3,255.3,0,0 +-3,254.4,0,0 +-3,253.5,0,0 +-3,252.6,0,0 +-3,251.7,0,0 +-3,250.8,0,0 +-3,249.9,0,0 +-3,249,0,0 +-3,248.1,0,0 +-3,247.2,0,0 +-3,246.3,0,0 +-3,245.4,0,0 +-3,244.5,0,0 +-3,243.6,0,0 +-3,242.7,0,0 +-3,241.8,0,0 +-3,240.9,0,0 +-3,240,0,0 +-3,239.1,0,0 +-3,238.2,0,0 +-3,237.3,0,0 +-3,236.4,0,0 +-3,235.5,0,0 +-3,234.6,0,0 +-3,233.7,0,0 +-3,232.8,0,0 +-3,231.9,0,0 +-3,231,0,0 +-3,230.1,0,0 +-3,229.2,0,0 +-3,228.3,0,0 +-3,227.4,0,0 +-3,226.5,0,0 +-3,225.6,0,0 +-3,224.7,0,0 +-3,223.8,0,0 +-3,222.9,0,0 +-3,222,0,0 +-3,221.1,0,0 +-3,220.2,0,0 +-3,219.2,0,0 +-3,218.3,0,0 +-3,217.4,0,0 +-3,216.5,0,0 +-3,215.6,0,0 +-3,214.7,0,0 +-3,213.8,0,0 +-3,212.9,0,0 +-3,212,0,0 +-3,211.1,0,0 +-3,210.2,0,0 +-3,209.3,0,0 +-3,208.4,0,0 +-3,207.5,0,0 +-3,206.6,0,0 +-3,205.7,0,0 +-3,204.8,0,0 +-3,203.9,0,0 +-3,203,0,0 +-3,202.1,0,0 +-3,201.2,0,0 +-3,200.3,0,0 +-3,199.4,0,0 +-3,198.5,0,0 +-3,197.6,0,0 +-3,196.7,0,0 +-3,195.8,0,0 +-3,194.9,0,0 +-3,194,0,0 +-3,193.1,0,0 +-3,192.2,0,0 +-3,191.3,0,0 +-3,190.4,0,0 +-3,189.5,0,0 +-3,188.6,0,0 +-3,187.7,0,0 +-3,186.8,0,0 +-3,185.9,0,0 +-3,185,0,0 +-3,184.1,0,0 +-3,183.2,0,0 +-3,182.3,0,0 +-3,181.4,0,0 +-3,180.5,0,0 +-3,179.5,-90,0 +-3,178.6,-89.5,0 +-3,177.7,-89.1,0 +-3,176.8,-88.6,0 +-3,175.9,-88.2,0 +-3,175,-87.7,0 +-3,174.1,-87.3,0 +-3,173.2,-86.8,0 +-3,172.3,-86.4,0 +-3,171.4,-85.9,0 +-3,170.5,-85.5,0 +-3,169.6,-85,0 +-3,168.7,-84.6,0 +-3,167.8,-84.1,0 +-3,166.9,-83.7,0 +-3,166,-83.2,0 +-3,165.1,-82.8,0 +-3,164.2,-82.3,0 +-3,163.3,-81.9,0 +-3,162.4,-81.4,0 +-3,161.5,-81,0 +-3,160.6,-80.5,0 +-3,159.7,-80.1,0 +-3,158.8,-79.6,0 +-3,157.9,-79.1,0 +-3,157,-78.7,0 +-3,156.1,-78.2,0 +-3,155.2,-77.8,0 +-3,154.3,-77.3,0 +-3,153.4,-76.9,0 +-3,152.5,-76.4,0 +-3,151.6,-76,0 +-3,150.7,-75.5,0 +-3,149.8,-75.1,0 +-3,148.9,-74.6,0 +-3,148,-74.2,0 +-3,147.1,-73.7,0 +-3,146.2,-73.3,0 +-3,145.3,-72.8,0 +-3,144.4,-72.4,0 +-3,143.5,-71.9,0 +-3,142.6,-71.5,0 +-3,141.7,-71,0 +-3,140.8,-70.6,0 +-3,139.8,-70.1,0 +-3,138.9,-69.6,0 +-3,138,-69.2,0 +-3,137.1,-68.7,0 +-3,136.2,-68.3,0 +-3,135.3,-67.8,0 +-3,134.4,-67.4,0 +-3,133.5,-66.9,0 +-3,132.6,-66.5,0 +-3,131.7,-66,0 +-3,130.8,-65.6,0 +-3,129.9,-65.1,0 +-3,129,-64.7,0 +-3,128.1,-64.2,0 +-3,127.2,-63.8,0 +-3,126.3,-63.3,0 +-3,125.4,-62.9,0 +-3,124.5,-62.4,0 +-3,123.6,-62,0 +-3,122.7,-61.5,0 +-3,121.8,-61.1,0 +-3,120.9,-60.6,0 +-3,120,-60.2,0 +-3,119.1,-59.7,0 +-3,118.2,-59.2,0 +-3,117.3,-58.8,0 +-3,116.4,-58.3,0 +-3,115.5,-57.9,0 +-3,114.6,-57.4,0 +-3,113.7,-57,0 +-3,112.8,-56.5,0 +-3,111.9,-56.1,0 +-3,111,-55.6,0 +-3,110.1,-55.2,0 +-3,109.2,-54.7,0 +-3,108.3,-54.3,0 +-3,107.4,-53.8,0 +-3,106.5,-53.4,0 +-3,105.6,-52.9,0 +-3,104.7,-52.5,0 +-3,103.8,-52,0 +-3,102.9,-51.6,0 +-3,102,-51.1,0 +-3,101.1,-50.7,0 +-3,100.2,-50.2,0 +-3,99.2,-49.7,0 +-3,98.3,-49.3,0 +-3,97.4,-48.8,0 +-3,96.5,-48.4,0 +-3,95.6,-47.9,0 +-3,94.7,-47.5,0 +-3,93.8,-47,0 +-3,92.9,-46.6,0 +-3,92,-46.1,0 +-3,91.1,-45.7,0 +-3,90.2,-45.2,0 +-3,89.3,-44.8,90 +-3,88.4,-44.3,89.1 +-3,87.5,-43.9,88.2 +-3,86.6,-43.4,87.3 +-3,85.7,-43,86.4 +-3,84.8,-42.5,85.5 +-3,83.9,-42.1,84.5 +-3,83,-41.6,83.6 +-3,82.1,-41.2,82.7 +-3,81.2,-40.7,81.8 +-3,80.3,-40.3,80.9 +-3,79.4,-39.8,80 +-3,78.5,-39.3,79.1 +-3,77.6,-38.9,78.2 +-3,76.7,-38.4,77.3 +-3,75.8,-38,76.4 +-3,74.9,-37.5,75.5 +-3,74,-37.1,74.5 +-3,73.1,-36.6,73.6 +-3,72.2,-36.2,72.7 +-3,71.3,-35.7,71.8 +-3,70.4,-35.3,70.9 +-3,69.5,-34.8,70 +-3,68.6,-34.4,69.1 +-3,67.7,-33.9,68.2 +-3,66.8,-33.5,67.3 +-3,65.9,-33,66.4 +-3,65,-32.6,65.5 +-3,64.1,-32.1,64.5 +-3,63.2,-31.7,63.6 +-3,62.3,-31.2,62.7 +-3,61.4,-30.8,61.8 +-3,60.5,-30.3,60.9 +-3,59.5,-29.8,60 +-3,58.6,-29.4,59.1 +-3,57.7,-28.9,58.2 +-3,56.8,-28.5,57.3 +-3,55.9,-28,56.4 +-3,55,-27.6,55.5 +-3,54.1,-27.1,54.5 +-3,53.2,-26.7,53.6 +-3,52.3,-26.2,52.7 +-3,51.4,-25.8,51.8 +-3,50.5,-25.3,50.9 +-3,49.6,-24.9,50 +-3,48.7,-24.4,49.1 +-3,47.8,-24,48.2 +-3,46.9,-23.5,47.3 +-3,46,-23.1,46.4 +-3,45.1,-22.6,45.5 +-3,44.2,-22.2,44.5 +-3,43.3,-21.7,43.6 +-3,42.4,-21.3,42.7 +-3,41.5,-20.8,41.8 +-3,40.6,-20.4,40.9 +-3,39.7,-19.9,40 +-3,38.8,-19.4,39.1 +-3,37.9,-19,38.2 +-3,37,-18.5,37.3 +-3,36.1,-18.1,36.4 +-3,35.2,-17.6,35.5 +-3,34.3,-17.2,34.5 +-3,33.4,-16.7,33.6 +-3,32.5,-16.3,32.7 +-3,31.6,-15.8,31.8 +-3,30.7,-15.4,30.9 +-3,29.8,-14.9,30 +-3,28.9,-14.5,29.1 +-3,28,-14,28.2 +-3,27.1,-13.6,27.3 +-3,26.2,-13.1,26.4 +-3,25.3,-12.7,25.5 +-3,24.4,-12.2,24.5 +-3,23.5,-11.8,23.6 +-3,22.6,-11.3,22.7 +-3,21.7,-10.9,21.8 +-3,20.8,-10.4,20.9 +-3,19.8,-9.9,20 +-3,18.9,-9.5,19.1 +-3,18,-9,18.2 +-3,17.1,-8.6,17.3 +-3,16.2,-8.1,16.4 +-3,15.3,-7.7,15.5 +-3,14.4,-7.2,14.5 +-3,13.5,-6.8,13.6 +-3,12.6,-6.3,12.7 +-3,11.7,-5.9,11.8 +-3,10.8,-5.4,10.9 +-3,9.9,-5,10 +-3,9,-4.5,9.1 +-3,8.1,-4.1,8.2 +-3,7.2,-3.6,7.3 +-3,6.3,-3.2,6.4 +-3,5.4,-2.7,5.5 +-3,4.5,-2.3,4.5 +-3,3.6,-1.8,3.6 +-3,2.7,-1.4,2.7 +-3,1.8,-0.9,1.8 +-3,0.9,-0.5,0.9 +-3,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +0.9,0,0,0.3 +0.9,0,0,0.3 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.8,0,0,0.5 +0.8,0,0,0.5 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.5,0,0,0.8 +0.5,0,0,0.8 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.3,0,0,0.9 +0.3,0,0,0.9 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,0.9 +0.3,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.8 +0.5,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.7,0,0,0.8 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.8,0,0,0.7 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.5 +0.8,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.3 +0.9,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0 +-3,0,0,0 +-3,0.9,-0.5,0.9 +-3,1.8,-0.9,1.8 +-3,2.7,-1.4,2.7 +-3,3.6,-1.8,3.6 +-3,4.5,-2.3,4.5 +-3,5.4,-2.7,5.5 +-3,6.3,-3.2,6.4 +-3,7.2,-3.6,7.3 +-3,8.1,-4.1,8.2 +-3,9,-4.5,9.1 +-3,9.9,-5,10 +-3,10.8,-5.4,10.9 +-3,11.7,-5.9,11.8 +-3,12.6,-6.3,12.7 +-3,13.5,-6.8,13.6 +-3,14.4,-7.2,14.5 +-3,15.3,-7.7,15.5 +-3,16.2,-8.1,16.4 +-3,17.1,-8.6,17.3 +-3,18,-9,18.2 +-3,18.9,-9.5,19.1 +-3,19.8,-9.9,20 +-3,20.8,-10.4,20.9 +-3,21.7,-10.9,21.8 +-3,22.6,-11.3,22.7 +-3,23.5,-11.8,23.6 +-3,24.4,-12.2,24.5 +-3,25.3,-12.7,25.5 +-3,26.2,-13.1,26.4 +-3,27.1,-13.6,27.3 +-3,28,-14,28.2 +-3,28.9,-14.5,29.1 +-3,29.8,-14.9,30 +-3,30.7,-15.4,30.9 +-3,31.6,-15.8,31.8 +-3,32.5,-16.3,32.7 +-3,33.4,-16.7,33.6 +-3,34.3,-17.2,34.5 +-3,35.2,-17.6,35.5 +-3,36.1,-18.1,36.4 +-3,37,-18.5,37.3 +-3,37.9,-19,38.2 +-3,38.8,-19.4,39.1 +-3,39.7,-19.9,40 +-3,40.6,-20.4,40.9 +-3,41.5,-20.8,41.8 +-3,42.4,-21.3,42.7 +-3,43.3,-21.7,43.6 +-3,44.2,-22.2,44.5 +-3,45.1,-22.6,45.5 +-3,46,-23.1,46.4 +-3,46.9,-23.5,47.3 +-3,47.8,-24,48.2 +-3,48.7,-24.4,49.1 +-3,49.6,-24.9,50 +-3,50.5,-25.3,50.9 +-3,51.4,-25.8,51.8 +-3,52.3,-26.2,52.7 +-3,53.2,-26.7,53.6 +-3,54.1,-27.1,54.5 +-3,55,-27.6,55.5 +-3,55.9,-28,56.4 +-3,56.8,-28.5,57.3 +-3,57.7,-28.9,58.2 +-3,58.6,-29.4,59.1 +-3,59.5,-29.8,60 +-3,60.5,-30.3,60.9 +-3,61.4,-30.8,61.8 +-3,62.3,-31.2,62.7 +-3,63.2,-31.7,63.6 +-3,64.1,-32.1,64.5 +-3,65,-32.6,65.5 +-3,65.9,-33,66.4 +-3,66.8,-33.5,67.3 +-3,67.7,-33.9,68.2 +-3,68.6,-34.4,69.1 +-3,69.5,-34.8,70 +-3,70.4,-35.3,70.9 +-3,71.3,-35.7,71.8 +-3,72.2,-36.2,72.7 +-3,73.1,-36.6,73.6 +-3,74,-37.1,74.5 +-3,74.9,-37.5,75.5 +-3,75.8,-38,76.4 +-3,76.7,-38.4,77.3 +-3,77.6,-38.9,78.2 +-3,78.5,-39.3,79.1 +-3,79.4,-39.8,80 +-3,80.3,-40.3,80.9 +-3,81.2,-40.7,81.8 +-3,82.1,-41.2,82.7 +-3,83,-41.6,83.6 +-3,83.9,-42.1,84.5 +-3,84.8,-42.5,85.5 +-3,85.7,-43,86.4 +-3,86.6,-43.4,87.3 +-3,87.5,-43.9,88.2 +-3,88.4,-44.3,89.1 +-3,89.3,-44.8,90 +-3,90.2,-45.2,0 +-3,91.1,-45.7,0 +-3,92,-46.1,0 +-3,92.9,-46.6,0 +-3,93.8,-47,0 +-3,94.7,-47.5,0 +-3,95.6,-47.9,0 +-3,96.5,-48.4,0 +-3,97.4,-48.8,0 +-3,98.3,-49.3,0 +-3,99.2,-49.7,0 +-3,100.2,-50.2,0 +-3,101.1,-50.7,0 +-3,102,-51.1,0 +-3,102.9,-51.6,0 +-3,103.8,-52,0 +-3,104.7,-52.5,0 +-3,105.6,-52.9,0 +-3,106.5,-53.4,0 +-3,107.4,-53.8,0 +-3,108.3,-54.3,0 +-3,109.2,-54.7,0 +-3,110.1,-55.2,0 +-3,111,-55.6,0 +-3,111.9,-56.1,0 +-3,112.8,-56.5,0 +-3,113.7,-57,0 +-3,114.6,-57.4,0 +-3,115.5,-57.9,0 +-3,116.4,-58.3,0 +-3,117.3,-58.8,0 +-3,118.2,-59.2,0 +-3,119.1,-59.7,0 +-3,120,-60.2,0 +-3,120.9,-60.6,0 +-3,121.8,-61.1,0 +-3,122.7,-61.5,0 +-3,123.6,-62,0 +-3,124.5,-62.4,0 +-3,125.4,-62.9,0 +-3,126.3,-63.3,0 +-3,127.2,-63.8,0 +-3,128.1,-64.2,0 +-3,129,-64.7,0 +-3,129.9,-65.1,0 +-3,130.8,-65.6,0 +-3,131.7,-66,0 +-3,132.6,-66.5,0 +-3,133.5,-66.9,0 +-3,134.4,-67.4,0 +-3,135.3,-67.8,0 +-3,136.2,-68.3,0 +-3,137.1,-68.7,0 +-3,138,-69.2,0 +-3,138.9,-69.6,0 +-3,139.8,-70.1,0 +-3,140.8,-70.6,0 +-3,141.7,-71,0 +-3,142.6,-71.5,0 +-3,143.5,-71.9,0 +-3,144.4,-72.4,0 +-3,145.3,-72.8,0 +-3,146.2,-73.3,0 +-3,147.1,-73.7,0 +-3,148,-74.2,0 +-3,148.9,-74.6,0 +-3,149.8,-75.1,0 +-3,150.7,-75.5,0 +-3,151.6,-76,0 +-3,152.5,-76.4,0 +-3,153.4,-76.9,0 +-3,154.3,-77.3,0 +-3,155.2,-77.8,0 +-3,156.1,-78.2,0 +-3,157,-78.7,0 +-3,157.9,-79.1,0 +-3,158.8,-79.6,0 +-3,159.7,-80.1,0 +-3,160.6,-80.5,0 +-3,161.5,-81,0 +-3,162.4,-81.4,0 +-3,163.3,-81.9,0 +-3,164.2,-82.3,0 +-3,165.1,-82.8,0 +-3,166,-83.2,0 +-3,166.9,-83.7,0 +-3,167.8,-84.1,0 +-3,168.7,-84.6,0 +-3,169.6,-85,0 +-3,170.5,-85.5,0 +-3,171.4,-85.9,0 +-3,172.3,-86.4,0 +-3,173.2,-86.8,0 +-3,174.1,-87.3,0 +-3,175,-87.7,0 +-3,175.9,-88.2,0 +-3,176.8,-88.6,0 +-3,177.7,-89.1,0 +-3,178.6,-89.5,0 +-3,179.5,-90,0 +-3,180.5,0,0 +-3,181.4,0,0 +-3,182.3,0,0 +-3,183.2,0,0 +-3,184.1,0,0 +-3,185,0,0 +-3,185.9,0,0 +-3,186.8,0,0 +-3,187.7,0,0 +-3,188.6,0,0 +-3,189.5,0,0 +-3,190.4,0,0 +-3,191.3,0,0 +-3,192.2,0,0 +-3,193.1,0,0 +-3,194,0,0 +-3,194.9,0,0 +-3,195.8,0,0 +-3,196.7,0,0 +-3,197.6,0,0 +-3,198.5,0,0 +-3,199.4,0,0 +-3,200.3,0,0 +-3,201.2,0,0 +-3,202.1,0,0 +-3,203,0,0 +-3,203.9,0,0 +-3,204.8,0,0 +-3,205.7,0,0 +-3,206.6,0,0 +-3,207.5,0,0 +-3,208.4,0,0 +-3,209.3,0,0 +-3,210.2,0,0 +-3,211.1,0,0 +-3,212,0,0 +-3,212.9,0,0 +-3,213.8,0,0 +-3,214.7,0,0 +-3,215.6,0,0 +-3,216.5,0,0 +-3,217.4,0,0 +-3,218.3,0,0 +-3,219.2,0,0 +-3,220.2,0,0 +-3,221.1,0,0 +-3,222,0,0 +-3,222.9,0,0 +-3,223.8,0,0 +-3,224.7,0,0 +-3,225.6,0,0 +-3,226.5,0,0 +-3,227.4,0,0 +-3,228.3,0,0 +-3,229.2,0,0 +-3,230.1,0,0 +-3,231,0,0 +-3,231.9,0,0 +-3,232.8,0,0 +-3,233.7,0,0 +-3,234.6,0,0 +-3,235.5,0,0 +-3,236.4,0,0 +-3,237.3,0,0 +-3,238.2,0,0 +-3,239.1,0,0 +-3,240,0,0 +-3,240.9,0,0 +-3,241.8,0,0 +-3,242.7,0,0 +-3,243.6,0,0 +-3,244.5,0,0 +-3,245.4,0,0 +-3,246.3,0,0 +-3,247.2,0,0 +-3,248.1,0,0 +-3,249,0,0 +-3,249.9,0,0 +-3,250.8,0,0 +-3,251.7,0,0 +-3,252.6,0,0 +-3,253.5,0,0 +-3,254.4,0,0 +-3,255.3,0,0 +-3,256.2,0,0 +-3,257.1,0,0 +-3,258,0,0 +-3,258.9,0,0 +-3,259.8,0,0 +-3,260.8,0,0 +-3,261.7,0,0 +-3,262.6,0,0 +-3,263.5,0,0 +-3,264.4,0,0 +-3,265.3,0,0 +-3,266.2,0,0 +-3,267.1,0,0 +-3,268,0,0 +-3,268.9,0,0 +-3,269.8,0,0 +-3,270.7,0,0 +-3,271.6,0,0 +-3,272.5,0,0 +-3,273.4,0,0 +-3,274.3,0,0 +-3,275.2,0,0 +-3,276.1,0,0 +-3,277,0,0 +-3,277.9,0,0 +-3,278.8,0,0 +-3,279.7,0,0 +-3,280.6,0,0 +-3,281.5,0,0 +-3,282.4,0,0 +-3,283.3,0,0 +-3,284.2,0,0 +-3,285.1,0,0 +-3,286,0,0 +-3,286.9,0,0 +-3,287.8,0,0 +-3,288.7,0,0 +-3,289.6,0,0 +-3,290.5,0,0 +-3,291.4,0,0 +-3,292.3,0,0 +-3,293.2,0,0 +-3,294.1,0,0 +-3,295,0,0 +-3,295.9,0,0 +-3,296.8,0,0 +-3,297.7,0,0 +-3,298.6,0,0 +-3,299.5,0,0 +-3,300.5,0,0 +-3,301.4,0,0 +-3,302.3,0,0 +-3,303.2,0,0 +-3,304.1,0,0 +-3,305,0,0 +-3,305.9,0,0 +-3,306.8,0,0 +-3,307.7,0,0 +-3,308.6,0,0 +-3,309.5,0,0 +-3,310.4,0,0 +-3,311.3,0,0 +-3,312.2,0,0 +-3,313.1,0,0 +-3,314,0,0 +-3,314.9,0,0 +-3,315.8,0,0 +-3,316.7,0,0 +-3,317.6,0,0 +-3,318.5,0,0 +-3,319.4,0,0 +-3,320.3,0,0 +-3,321.2,0,0 +-3,322.1,0,0 +-3,323,0,0 +-3,323.9,0,0 +-3,324.8,0,0 +-3,325.7,0,0 +-3,326.6,0,0 +-3,327.5,0,0 +-3,328.4,0,0 +-3,329.3,0,0 +-3,330.2,0,0 +-3,331.1,0,0 +-3,332,0,0 +-3,332.9,0,0 +-3,333.8,0,0 +-3,334.7,0,0 +-3,335.6,0,0 +-3,336.5,0,0 +-3,337.4,0,0 +-3,338.3,0,0 +-3,339.2,0,0 +-3,340.2,0,0 +-3,341.1,0,0 +-3,342,0,0 +-3,342.9,0,0 +-3,343.8,0,0 +-3,344.7,0,0 +-3,345.6,0,0 +-3,346.5,0,0 +-3,347.4,0,0 +-3,348.3,0,0 +-3,349.2,0,0 +-3,350.1,0,0 +-3,351,0,0 +-3,351.9,0,0 +-3,352.8,0,0 +-3,353.7,0,0 +-3,354.6,0,0 +-3,355.5,0,0 +-3,356.4,0,0 +-3,357.3,0,0 +-3,358.2,0,0 +-3,359.1,0,0 +-3,360,0,0 diff --git a/scripts/trajectories/rotate_euler_quaternion_30s_voip.csv b/scripts/trajectories/rotate_euler_quaternion_30s_voip.csv new file mode 100644 index 0000000000000000000000000000000000000000..ee015a29bf541f2d135a0bca65f598fc53efdc8e --- /dev/null +++ b/scripts/trajectories/rotate_euler_quaternion_30s_voip.csv @@ -0,0 +1,6012 @@ +-3,0,0,0 +-3,0,0,0 +-3,0,0,0 +-3,0,0,0 +-3,0,0,0 +-3,0,0,0 +-3,0,0,0 +-3,0,0,0 +-3,0,0,0 +-3,0,0,0 +-3,0,0,0 +-3,0,0,0 +-3,360,0,0 +-3,359.1,0,0 +-3,358.2,0,0 +-3,357.3,0,0 +-3,356.4,0,0 +-3,355.5,0,0 +-3,354.6,0,0 +-3,353.7,0,0 +-3,352.8,0,0 +-3,351.9,0,0 +-3,351,0,0 +-3,350.1,0,0 +-3,349.2,0,0 +-3,348.3,0,0 +-3,347.4,0,0 +-3,346.5,0,0 +-3,345.6,0,0 +-3,344.7,0,0 +-3,343.8,0,0 +-3,342.9,0,0 +-3,342,0,0 +-3,341.1,0,0 +-3,340.2,0,0 +-3,339.2,0,0 +-3,338.3,0,0 +-3,337.4,0,0 +-3,336.5,0,0 +-3,335.6,0,0 +-3,334.7,0,0 +-3,333.8,0,0 +-3,332.9,0,0 +-3,332,0,0 +-3,331.1,0,0 +-3,330.2,0,0 +-3,329.3,0,0 +-3,328.4,0,0 +-3,327.5,0,0 +-3,326.6,0,0 +-3,325.7,0,0 +-3,324.8,0,0 +-3,323.9,0,0 +-3,323,0,0 +-3,322.1,0,0 +-3,321.2,0,0 +-3,320.3,0,0 +-3,319.4,0,0 +-3,318.5,0,0 +-3,317.6,0,0 +-3,316.7,0,0 +-3,315.8,0,0 +-3,314.9,0,0 +-3,314,0,0 +-3,313.1,0,0 +-3,312.2,0,0 +-3,311.3,0,0 +-3,310.4,0,0 +-3,309.5,0,0 +-3,308.6,0,0 +-3,307.7,0,0 +-3,306.8,0,0 +-3,305.9,0,0 +-3,305,0,0 +-3,304.1,0,0 +-3,303.2,0,0 +-3,302.3,0,0 +-3,301.4,0,0 +-3,300.5,0,0 +-3,299.5,0,0 +-3,298.6,0,0 +-3,297.7,0,0 +-3,296.8,0,0 +-3,295.9,0,0 +-3,295,0,0 +-3,294.1,0,0 +-3,293.2,0,0 +-3,292.3,0,0 +-3,291.4,0,0 +-3,290.5,0,0 +-3,289.6,0,0 +-3,288.7,0,0 +-3,287.8,0,0 +-3,286.9,0,0 +-3,286,0,0 +-3,285.1,0,0 +-3,284.2,0,0 +-3,283.3,0,0 +-3,282.4,0,0 +-3,281.5,0,0 +-3,280.6,0,0 +-3,279.7,0,0 +-3,278.8,0,0 +-3,277.9,0,0 +-3,277,0,0 +-3,276.1,0,0 +-3,275.2,0,0 +-3,274.3,0,0 +-3,273.4,0,0 +-3,272.5,0,0 +-3,271.6,0,0 +-3,270.7,0,0 +-3,269.8,0,0 +-3,268.9,0,0 +-3,268,0,0 +-3,267.1,0,0 +-3,266.2,0,0 +-3,265.3,0,0 +-3,264.4,0,0 +-3,263.5,0,0 +-3,262.6,0,0 +-3,261.7,0,0 +-3,260.8,0,0 +-3,259.8,0,0 +-3,258.9,0,0 +-3,258,0,0 +-3,257.1,0,0 +-3,256.2,0,0 +-3,255.3,0,0 +-3,254.4,0,0 +-3,253.5,0,0 +-3,252.6,0,0 +-3,251.7,0,0 +-3,250.8,0,0 +-3,249.9,0,0 +-3,249,0,0 +-3,248.1,0,0 +-3,247.2,0,0 +-3,246.3,0,0 +-3,245.4,0,0 +-3,244.5,0,0 +-3,243.6,0,0 +-3,242.7,0,0 +-3,241.8,0,0 +-3,240.9,0,0 +-3,240,0,0 +-3,239.1,0,0 +-3,238.2,0,0 +-3,237.3,0,0 +-3,236.4,0,0 +-3,235.5,0,0 +-3,234.6,0,0 +-3,233.7,0,0 +-3,232.8,0,0 +-3,231.9,0,0 +-3,231,0,0 +-3,230.1,0,0 +-3,229.2,0,0 +-3,228.3,0,0 +-3,227.4,0,0 +-3,226.5,0,0 +-3,225.6,0,0 +-3,224.7,0,0 +-3,223.8,0,0 +-3,222.9,0,0 +-3,222,0,0 +-3,221.1,0,0 +-3,220.2,0,0 +-3,219.2,0,0 +-3,218.3,0,0 +-3,217.4,0,0 +-3,216.5,0,0 +-3,215.6,0,0 +-3,214.7,0,0 +-3,213.8,0,0 +-3,212.9,0,0 +-3,212,0,0 +-3,211.1,0,0 +-3,210.2,0,0 +-3,209.3,0,0 +-3,208.4,0,0 +-3,207.5,0,0 +-3,206.6,0,0 +-3,205.7,0,0 +-3,204.8,0,0 +-3,203.9,0,0 +-3,203,0,0 +-3,202.1,0,0 +-3,201.2,0,0 +-3,200.3,0,0 +-3,199.4,0,0 +-3,198.5,0,0 +-3,197.6,0,0 +-3,196.7,0,0 +-3,195.8,0,0 +-3,194.9,0,0 +-3,194,0,0 +-3,193.1,0,0 +-3,192.2,0,0 +-3,191.3,0,0 +-3,190.4,0,0 +-3,189.5,0,0 +-3,188.6,0,0 +-3,187.7,0,0 +-3,186.8,0,0 +-3,185.9,0,0 +-3,185,0,0 +-3,184.1,0,0 +-3,183.2,0,0 +-3,182.3,0,0 +-3,181.4,0,0 +-3,180.5,0,0 +-3,179.5,-90,0 +-3,178.6,-89.5,0 +-3,177.7,-89.1,0 +-3,176.8,-88.6,0 +-3,175.9,-88.2,0 +-3,175,-87.7,0 +-3,174.1,-87.3,0 +-3,173.2,-86.8,0 +-3,172.3,-86.4,0 +-3,171.4,-85.9,0 +-3,170.5,-85.5,0 +-3,169.6,-85,0 +-3,168.7,-84.6,0 +-3,167.8,-84.1,0 +-3,166.9,-83.7,0 +-3,166,-83.2,0 +-3,165.1,-82.8,0 +-3,164.2,-82.3,0 +-3,163.3,-81.9,0 +-3,162.4,-81.4,0 +-3,161.5,-81,0 +-3,160.6,-80.5,0 +-3,159.7,-80.1,0 +-3,158.8,-79.6,0 +-3,157.9,-79.1,0 +-3,157,-78.7,0 +-3,156.1,-78.2,0 +-3,155.2,-77.8,0 +-3,154.3,-77.3,0 +-3,153.4,-76.9,0 +-3,152.5,-76.4,0 +-3,151.6,-76,0 +-3,150.7,-75.5,0 +-3,149.8,-75.1,0 +-3,148.9,-74.6,0 +-3,148,-74.2,0 +-3,147.1,-73.7,0 +-3,146.2,-73.3,0 +-3,145.3,-72.8,0 +-3,144.4,-72.4,0 +-3,143.5,-71.9,0 +-3,142.6,-71.5,0 +-3,141.7,-71,0 +-3,140.8,-70.6,0 +-3,139.8,-70.1,0 +-3,138.9,-69.6,0 +-3,138,-69.2,0 +-3,137.1,-68.7,0 +-3,136.2,-68.3,0 +-3,135.3,-67.8,0 +-3,134.4,-67.4,0 +-3,133.5,-66.9,0 +-3,132.6,-66.5,0 +-3,131.7,-66,0 +-3,130.8,-65.6,0 +-3,129.9,-65.1,0 +-3,129,-64.7,0 +-3,128.1,-64.2,0 +-3,127.2,-63.8,0 +-3,126.3,-63.3,0 +-3,125.4,-62.9,0 +-3,124.5,-62.4,0 +-3,123.6,-62,0 +-3,122.7,-61.5,0 +-3,121.8,-61.1,0 +-3,120.9,-60.6,0 +-3,120,-60.2,0 +-3,119.1,-59.7,0 +-3,118.2,-59.2,0 +-3,117.3,-58.8,0 +-3,116.4,-58.3,0 +-3,115.5,-57.9,0 +-3,114.6,-57.4,0 +-3,113.7,-57,0 +-3,112.8,-56.5,0 +-3,111.9,-56.1,0 +-3,111,-55.6,0 +-3,110.1,-55.2,0 +-3,109.2,-54.7,0 +-3,108.3,-54.3,0 +-3,107.4,-53.8,0 +-3,106.5,-53.4,0 +-3,105.6,-52.9,0 +-3,104.7,-52.5,0 +-3,103.8,-52,0 +-3,102.9,-51.6,0 +-3,102,-51.1,0 +-3,101.1,-50.7,0 +-3,100.2,-50.2,0 +-3,99.2,-49.7,0 +-3,98.3,-49.3,0 +-3,97.4,-48.8,0 +-3,96.5,-48.4,0 +-3,95.6,-47.9,0 +-3,94.7,-47.5,0 +-3,93.8,-47,0 +-3,92.9,-46.6,0 +-3,92,-46.1,0 +-3,91.1,-45.7,0 +-3,90.2,-45.2,0 +-3,89.3,-44.8,90 +-3,88.4,-44.3,89.1 +-3,87.5,-43.9,88.2 +-3,86.6,-43.4,87.3 +-3,85.7,-43,86.4 +-3,84.8,-42.5,85.5 +-3,83.9,-42.1,84.5 +-3,83,-41.6,83.6 +-3,82.1,-41.2,82.7 +-3,81.2,-40.7,81.8 +-3,80.3,-40.3,80.9 +-3,79.4,-39.8,80 +-3,78.5,-39.3,79.1 +-3,77.6,-38.9,78.2 +-3,76.7,-38.4,77.3 +-3,75.8,-38,76.4 +-3,74.9,-37.5,75.5 +-3,74,-37.1,74.5 +-3,73.1,-36.6,73.6 +-3,72.2,-36.2,72.7 +-3,71.3,-35.7,71.8 +-3,70.4,-35.3,70.9 +-3,69.5,-34.8,70 +-3,68.6,-34.4,69.1 +-3,67.7,-33.9,68.2 +-3,66.8,-33.5,67.3 +-3,65.9,-33,66.4 +-3,65,-32.6,65.5 +-3,64.1,-32.1,64.5 +-3,63.2,-31.7,63.6 +-3,62.3,-31.2,62.7 +-3,61.4,-30.8,61.8 +-3,60.5,-30.3,60.9 +-3,59.5,-29.8,60 +-3,58.6,-29.4,59.1 +-3,57.7,-28.9,58.2 +-3,56.8,-28.5,57.3 +-3,55.9,-28,56.4 +-3,55,-27.6,55.5 +-3,54.1,-27.1,54.5 +-3,53.2,-26.7,53.6 +-3,52.3,-26.2,52.7 +-3,51.4,-25.8,51.8 +-3,50.5,-25.3,50.9 +-3,49.6,-24.9,50 +-3,48.7,-24.4,49.1 +-3,47.8,-24,48.2 +-3,46.9,-23.5,47.3 +-3,46,-23.1,46.4 +-3,45.1,-22.6,45.5 +-3,44.2,-22.2,44.5 +-3,43.3,-21.7,43.6 +-3,42.4,-21.3,42.7 +-3,41.5,-20.8,41.8 +-3,40.6,-20.4,40.9 +-3,39.7,-19.9,40 +-3,38.8,-19.4,39.1 +-3,37.9,-19,38.2 +-3,37,-18.5,37.3 +-3,36.1,-18.1,36.4 +-3,35.2,-17.6,35.5 +-3,34.3,-17.2,34.5 +-3,33.4,-16.7,33.6 +-3,32.5,-16.3,32.7 +-3,31.6,-15.8,31.8 +-3,30.7,-15.4,30.9 +-3,29.8,-14.9,30 +-3,28.9,-14.5,29.1 +-3,28,-14,28.2 +-3,27.1,-13.6,27.3 +-3,26.2,-13.1,26.4 +-3,25.3,-12.7,25.5 +-3,24.4,-12.2,24.5 +-3,23.5,-11.8,23.6 +-3,22.6,-11.3,22.7 +-3,21.7,-10.9,21.8 +-3,20.8,-10.4,20.9 +-3,19.8,-9.9,20 +-3,18.9,-9.5,19.1 +-3,18,-9,18.2 +-3,17.1,-8.6,17.3 +-3,16.2,-8.1,16.4 +-3,15.3,-7.7,15.5 +-3,14.4,-7.2,14.5 +-3,13.5,-6.8,13.6 +-3,12.6,-6.3,12.7 +-3,11.7,-5.9,11.8 +-3,10.8,-5.4,10.9 +-3,9.9,-5,10 +-3,9,-4.5,9.1 +-3,8.1,-4.1,8.2 +-3,7.2,-3.6,7.3 +-3,6.3,-3.2,6.4 +-3,5.4,-2.7,5.5 +-3,4.5,-2.3,4.5 +-3,3.6,-1.8,3.6 +-3,2.7,-1.4,2.7 +-3,1.8,-0.9,1.8 +-3,0.9,-0.5,0.9 +-3,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +0.9,0,0,0.3 +0.9,0,0,0.3 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.8,0,0,0.5 +0.8,0,0,0.5 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.5,0,0,0.8 +0.5,0,0,0.8 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.3,0,0,0.9 +0.3,0,0,0.9 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,0.9 +0.3,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.8 +0.5,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.7,0,0,0.8 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.8,0,0,0.7 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.5 +0.8,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.3 +0.9,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0 +-3,0,0,0 +-3,0.9,-0.5,0.9 +-3,1.8,-0.9,1.8 +-3,2.7,-1.4,2.7 +-3,3.6,-1.8,3.6 +-3,4.5,-2.3,4.5 +-3,5.4,-2.7,5.5 +-3,6.3,-3.2,6.4 +-3,7.2,-3.6,7.3 +-3,8.1,-4.1,8.2 +-3,9,-4.5,9.1 +-3,9.9,-5,10 +-3,10.8,-5.4,10.9 +-3,11.7,-5.9,11.8 +-3,12.6,-6.3,12.7 +-3,13.5,-6.8,13.6 +-3,14.4,-7.2,14.5 +-3,15.3,-7.7,15.5 +-3,16.2,-8.1,16.4 +-3,17.1,-8.6,17.3 +-3,18,-9,18.2 +-3,18.9,-9.5,19.1 +-3,19.8,-9.9,20 +-3,20.8,-10.4,20.9 +-3,21.7,-10.9,21.8 +-3,22.6,-11.3,22.7 +-3,23.5,-11.8,23.6 +-3,24.4,-12.2,24.5 +-3,25.3,-12.7,25.5 +-3,26.2,-13.1,26.4 +-3,27.1,-13.6,27.3 +-3,28,-14,28.2 +-3,28.9,-14.5,29.1 +-3,29.8,-14.9,30 +-3,30.7,-15.4,30.9 +-3,31.6,-15.8,31.8 +-3,32.5,-16.3,32.7 +-3,33.4,-16.7,33.6 +-3,34.3,-17.2,34.5 +-3,35.2,-17.6,35.5 +-3,36.1,-18.1,36.4 +-3,37,-18.5,37.3 +-3,37.9,-19,38.2 +-3,38.8,-19.4,39.1 +-3,39.7,-19.9,40 +-3,40.6,-20.4,40.9 +-3,41.5,-20.8,41.8 +-3,42.4,-21.3,42.7 +-3,43.3,-21.7,43.6 +-3,44.2,-22.2,44.5 +-3,45.1,-22.6,45.5 +-3,46,-23.1,46.4 +-3,46.9,-23.5,47.3 +-3,47.8,-24,48.2 +-3,48.7,-24.4,49.1 +-3,49.6,-24.9,50 +-3,50.5,-25.3,50.9 +-3,51.4,-25.8,51.8 +-3,52.3,-26.2,52.7 +-3,53.2,-26.7,53.6 +-3,54.1,-27.1,54.5 +-3,55,-27.6,55.5 +-3,55.9,-28,56.4 +-3,56.8,-28.5,57.3 +-3,57.7,-28.9,58.2 +-3,58.6,-29.4,59.1 +-3,59.5,-29.8,60 +-3,60.5,-30.3,60.9 +-3,61.4,-30.8,61.8 +-3,62.3,-31.2,62.7 +-3,63.2,-31.7,63.6 +-3,64.1,-32.1,64.5 +-3,65,-32.6,65.5 +-3,65.9,-33,66.4 +-3,66.8,-33.5,67.3 +-3,67.7,-33.9,68.2 +-3,68.6,-34.4,69.1 +-3,69.5,-34.8,70 +-3,70.4,-35.3,70.9 +-3,71.3,-35.7,71.8 +-3,72.2,-36.2,72.7 +-3,73.1,-36.6,73.6 +-3,74,-37.1,74.5 +-3,74.9,-37.5,75.5 +-3,75.8,-38,76.4 +-3,76.7,-38.4,77.3 +-3,77.6,-38.9,78.2 +-3,78.5,-39.3,79.1 +-3,79.4,-39.8,80 +-3,80.3,-40.3,80.9 +-3,81.2,-40.7,81.8 +-3,82.1,-41.2,82.7 +-3,83,-41.6,83.6 +-3,83.9,-42.1,84.5 +-3,84.8,-42.5,85.5 +-3,85.7,-43,86.4 +-3,86.6,-43.4,87.3 +-3,87.5,-43.9,88.2 +-3,88.4,-44.3,89.1 +-3,89.3,-44.8,90 +-3,90.2,-45.2,0 +-3,91.1,-45.7,0 +-3,92,-46.1,0 +-3,92.9,-46.6,0 +-3,93.8,-47,0 +-3,94.7,-47.5,0 +-3,95.6,-47.9,0 +-3,96.5,-48.4,0 +-3,97.4,-48.8,0 +-3,98.3,-49.3,0 +-3,99.2,-49.7,0 +-3,100.2,-50.2,0 +-3,101.1,-50.7,0 +-3,102,-51.1,0 +-3,102.9,-51.6,0 +-3,103.8,-52,0 +-3,104.7,-52.5,0 +-3,105.6,-52.9,0 +-3,106.5,-53.4,0 +-3,107.4,-53.8,0 +-3,108.3,-54.3,0 +-3,109.2,-54.7,0 +-3,110.1,-55.2,0 +-3,111,-55.6,0 +-3,111.9,-56.1,0 +-3,112.8,-56.5,0 +-3,113.7,-57,0 +-3,114.6,-57.4,0 +-3,115.5,-57.9,0 +-3,116.4,-58.3,0 +-3,117.3,-58.8,0 +-3,118.2,-59.2,0 +-3,119.1,-59.7,0 +-3,120,-60.2,0 +-3,120.9,-60.6,0 +-3,121.8,-61.1,0 +-3,122.7,-61.5,0 +-3,123.6,-62,0 +-3,124.5,-62.4,0 +-3,125.4,-62.9,0 +-3,126.3,-63.3,0 +-3,127.2,-63.8,0 +-3,128.1,-64.2,0 +-3,129,-64.7,0 +-3,129.9,-65.1,0 +-3,130.8,-65.6,0 +-3,131.7,-66,0 +-3,132.6,-66.5,0 +-3,133.5,-66.9,0 +-3,134.4,-67.4,0 +-3,135.3,-67.8,0 +-3,136.2,-68.3,0 +-3,137.1,-68.7,0 +-3,138,-69.2,0 +-3,138.9,-69.6,0 +-3,139.8,-70.1,0 +-3,140.8,-70.6,0 +-3,141.7,-71,0 +-3,142.6,-71.5,0 +-3,143.5,-71.9,0 +-3,144.4,-72.4,0 +-3,145.3,-72.8,0 +-3,146.2,-73.3,0 +-3,147.1,-73.7,0 +-3,148,-74.2,0 +-3,148.9,-74.6,0 +-3,149.8,-75.1,0 +-3,150.7,-75.5,0 +-3,151.6,-76,0 +-3,152.5,-76.4,0 +-3,153.4,-76.9,0 +-3,154.3,-77.3,0 +-3,155.2,-77.8,0 +-3,156.1,-78.2,0 +-3,157,-78.7,0 +-3,157.9,-79.1,0 +-3,158.8,-79.6,0 +-3,159.7,-80.1,0 +-3,160.6,-80.5,0 +-3,161.5,-81,0 +-3,162.4,-81.4,0 +-3,163.3,-81.9,0 +-3,164.2,-82.3,0 +-3,165.1,-82.8,0 +-3,166,-83.2,0 +-3,166.9,-83.7,0 +-3,167.8,-84.1,0 +-3,168.7,-84.6,0 +-3,169.6,-85,0 +-3,170.5,-85.5,0 +-3,171.4,-85.9,0 +-3,172.3,-86.4,0 +-3,173.2,-86.8,0 +-3,174.1,-87.3,0 +-3,175,-87.7,0 +-3,175.9,-88.2,0 +-3,176.8,-88.6,0 +-3,177.7,-89.1,0 +-3,178.6,-89.5,0 +-3,179.5,-90,0 +-3,180.5,0,0 +-3,181.4,0,0 +-3,182.3,0,0 +-3,183.2,0,0 +-3,184.1,0,0 +-3,185,0,0 +-3,185.9,0,0 +-3,186.8,0,0 +-3,187.7,0,0 +-3,188.6,0,0 +-3,189.5,0,0 +-3,190.4,0,0 +-3,191.3,0,0 +-3,192.2,0,0 +-3,193.1,0,0 +-3,194,0,0 +-3,194.9,0,0 +-3,195.8,0,0 +-3,196.7,0,0 +-3,197.6,0,0 +-3,198.5,0,0 +-3,199.4,0,0 +-3,200.3,0,0 +-3,201.2,0,0 +-3,202.1,0,0 +-3,203,0,0 +-3,203.9,0,0 +-3,204.8,0,0 +-3,205.7,0,0 +-3,206.6,0,0 +-3,207.5,0,0 +-3,208.4,0,0 +-3,209.3,0,0 +-3,210.2,0,0 +-3,211.1,0,0 +-3,212,0,0 +-3,212.9,0,0 +-3,213.8,0,0 +-3,214.7,0,0 +-3,215.6,0,0 +-3,216.5,0,0 +-3,217.4,0,0 +-3,218.3,0,0 +-3,219.2,0,0 +-3,220.2,0,0 +-3,221.1,0,0 +-3,222,0,0 +-3,222.9,0,0 +-3,223.8,0,0 +-3,224.7,0,0 +-3,225.6,0,0 +-3,226.5,0,0 +-3,227.4,0,0 +-3,228.3,0,0 +-3,229.2,0,0 +-3,230.1,0,0 +-3,231,0,0 +-3,231.9,0,0 +-3,232.8,0,0 +-3,233.7,0,0 +-3,234.6,0,0 +-3,235.5,0,0 +-3,236.4,0,0 +-3,237.3,0,0 +-3,238.2,0,0 +-3,239.1,0,0 +-3,240,0,0 +-3,240.9,0,0 +-3,241.8,0,0 +-3,242.7,0,0 +-3,243.6,0,0 +-3,244.5,0,0 +-3,245.4,0,0 +-3,246.3,0,0 +-3,247.2,0,0 +-3,248.1,0,0 +-3,249,0,0 +-3,249.9,0,0 +-3,250.8,0,0 +-3,251.7,0,0 +-3,252.6,0,0 +-3,253.5,0,0 +-3,254.4,0,0 +-3,255.3,0,0 +-3,256.2,0,0 +-3,257.1,0,0 +-3,258,0,0 +-3,258.9,0,0 +-3,259.8,0,0 +-3,260.8,0,0 +-3,261.7,0,0 +-3,262.6,0,0 +-3,263.5,0,0 +-3,264.4,0,0 +-3,265.3,0,0 +-3,266.2,0,0 +-3,267.1,0,0 +-3,268,0,0 +-3,268.9,0,0 +-3,269.8,0,0 +-3,270.7,0,0 +-3,271.6,0,0 +-3,272.5,0,0 +-3,273.4,0,0 +-3,274.3,0,0 +-3,275.2,0,0 +-3,276.1,0,0 +-3,277,0,0 +-3,277.9,0,0 +-3,278.8,0,0 +-3,279.7,0,0 +-3,280.6,0,0 +-3,281.5,0,0 +-3,282.4,0,0 +-3,283.3,0,0 +-3,284.2,0,0 +-3,285.1,0,0 +-3,286,0,0 +-3,286.9,0,0 +-3,287.8,0,0 +-3,288.7,0,0 +-3,289.6,0,0 +-3,290.5,0,0 +-3,291.4,0,0 +-3,292.3,0,0 +-3,293.2,0,0 +-3,294.1,0,0 +-3,295,0,0 +-3,295.9,0,0 +-3,296.8,0,0 +-3,297.7,0,0 +-3,298.6,0,0 +-3,299.5,0,0 +-3,300.5,0,0 +-3,301.4,0,0 +-3,302.3,0,0 +-3,303.2,0,0 +-3,304.1,0,0 +-3,305,0,0 +-3,305.9,0,0 +-3,306.8,0,0 +-3,307.7,0,0 +-3,308.6,0,0 +-3,309.5,0,0 +-3,310.4,0,0 +-3,311.3,0,0 +-3,312.2,0,0 +-3,313.1,0,0 +-3,314,0,0 +-3,314.9,0,0 +-3,315.8,0,0 +-3,316.7,0,0 +-3,317.6,0,0 +-3,318.5,0,0 +-3,319.4,0,0 +-3,320.3,0,0 +-3,321.2,0,0 +-3,322.1,0,0 +-3,323,0,0 +-3,323.9,0,0 +-3,324.8,0,0 +-3,325.7,0,0 +-3,326.6,0,0 +-3,327.5,0,0 +-3,328.4,0,0 +-3,329.3,0,0 +-3,330.2,0,0 +-3,331.1,0,0 +-3,332,0,0 +-3,332.9,0,0 +-3,333.8,0,0 +-3,334.7,0,0 +-3,335.6,0,0 +-3,336.5,0,0 +-3,337.4,0,0 +-3,338.3,0,0 +-3,339.2,0,0 +-3,340.2,0,0 +-3,341.1,0,0 +-3,342,0,0 +-3,342.9,0,0 +-3,343.8,0,0 +-3,344.7,0,0 +-3,345.6,0,0 +-3,346.5,0,0 +-3,347.4,0,0 +-3,348.3,0,0 +-3,349.2,0,0 +-3,350.1,0,0 +-3,351,0,0 +-3,351.9,0,0 +-3,352.8,0,0 +-3,353.7,0,0 +-3,354.6,0,0 +-3,355.5,0,0 +-3,356.4,0,0 +-3,357.3,0,0 +-3,358.2,0,0 +-3,359.1,0,0 +-3,360,0,0 +-3,360,0,0 +-3,359.1,0,0 +-3,358.2,0,0 +-3,357.3,0,0 +-3,356.4,0,0 +-3,355.5,0,0 +-3,354.6,0,0 +-3,353.7,0,0 +-3,352.8,0,0 +-3,351.9,0,0 +-3,351,0,0 +-3,350.1,0,0 +-3,349.2,0,0 +-3,348.3,0,0 +-3,347.4,0,0 +-3,346.5,0,0 +-3,345.6,0,0 +-3,344.7,0,0 +-3,343.8,0,0 +-3,342.9,0,0 +-3,342,0,0 +-3,341.1,0,0 +-3,340.2,0,0 +-3,339.2,0,0 +-3,338.3,0,0 +-3,337.4,0,0 +-3,336.5,0,0 +-3,335.6,0,0 +-3,334.7,0,0 +-3,333.8,0,0 +-3,332.9,0,0 +-3,332,0,0 +-3,331.1,0,0 +-3,330.2,0,0 +-3,329.3,0,0 +-3,328.4,0,0 +-3,327.5,0,0 +-3,326.6,0,0 +-3,325.7,0,0 +-3,324.8,0,0 +-3,323.9,0,0 +-3,323,0,0 +-3,322.1,0,0 +-3,321.2,0,0 +-3,320.3,0,0 +-3,319.4,0,0 +-3,318.5,0,0 +-3,317.6,0,0 +-3,316.7,0,0 +-3,315.8,0,0 +-3,314.9,0,0 +-3,314,0,0 +-3,313.1,0,0 +-3,312.2,0,0 +-3,311.3,0,0 +-3,310.4,0,0 +-3,309.5,0,0 +-3,308.6,0,0 +-3,307.7,0,0 +-3,306.8,0,0 +-3,305.9,0,0 +-3,305,0,0 +-3,304.1,0,0 +-3,303.2,0,0 +-3,302.3,0,0 +-3,301.4,0,0 +-3,300.5,0,0 +-3,299.5,0,0 +-3,298.6,0,0 +-3,297.7,0,0 +-3,296.8,0,0 +-3,295.9,0,0 +-3,295,0,0 +-3,294.1,0,0 +-3,293.2,0,0 +-3,292.3,0,0 +-3,291.4,0,0 +-3,290.5,0,0 +-3,289.6,0,0 +-3,288.7,0,0 +-3,287.8,0,0 +-3,286.9,0,0 +-3,286,0,0 +-3,285.1,0,0 +-3,284.2,0,0 +-3,283.3,0,0 +-3,282.4,0,0 +-3,281.5,0,0 +-3,280.6,0,0 +-3,279.7,0,0 +-3,278.8,0,0 +-3,277.9,0,0 +-3,277,0,0 +-3,276.1,0,0 +-3,275.2,0,0 +-3,274.3,0,0 +-3,273.4,0,0 +-3,272.5,0,0 +-3,271.6,0,0 +-3,270.7,0,0 +-3,269.8,0,0 +-3,268.9,0,0 +-3,268,0,0 +-3,267.1,0,0 +-3,266.2,0,0 +-3,265.3,0,0 +-3,264.4,0,0 +-3,263.5,0,0 +-3,262.6,0,0 +-3,261.7,0,0 +-3,260.8,0,0 +-3,259.8,0,0 +-3,258.9,0,0 +-3,258,0,0 +-3,257.1,0,0 +-3,256.2,0,0 +-3,255.3,0,0 +-3,254.4,0,0 +-3,253.5,0,0 +-3,252.6,0,0 +-3,251.7,0,0 +-3,250.8,0,0 +-3,249.9,0,0 +-3,249,0,0 +-3,248.1,0,0 +-3,247.2,0,0 +-3,246.3,0,0 +-3,245.4,0,0 +-3,244.5,0,0 +-3,243.6,0,0 +-3,242.7,0,0 +-3,241.8,0,0 +-3,240.9,0,0 +-3,240,0,0 +-3,239.1,0,0 +-3,238.2,0,0 +-3,237.3,0,0 +-3,236.4,0,0 +-3,235.5,0,0 +-3,234.6,0,0 +-3,233.7,0,0 +-3,232.8,0,0 +-3,231.9,0,0 +-3,231,0,0 +-3,230.1,0,0 +-3,229.2,0,0 +-3,228.3,0,0 +-3,227.4,0,0 +-3,226.5,0,0 +-3,225.6,0,0 +-3,224.7,0,0 +-3,223.8,0,0 +-3,222.9,0,0 +-3,222,0,0 +-3,221.1,0,0 +-3,220.2,0,0 +-3,219.2,0,0 +-3,218.3,0,0 +-3,217.4,0,0 +-3,216.5,0,0 +-3,215.6,0,0 +-3,214.7,0,0 +-3,213.8,0,0 +-3,212.9,0,0 +-3,212,0,0 +-3,211.1,0,0 +-3,210.2,0,0 +-3,209.3,0,0 +-3,208.4,0,0 +-3,207.5,0,0 +-3,206.6,0,0 +-3,205.7,0,0 +-3,204.8,0,0 +-3,203.9,0,0 +-3,203,0,0 +-3,202.1,0,0 +-3,201.2,0,0 +-3,200.3,0,0 +-3,199.4,0,0 +-3,198.5,0,0 +-3,197.6,0,0 +-3,196.7,0,0 +-3,195.8,0,0 +-3,194.9,0,0 +-3,194,0,0 +-3,193.1,0,0 +-3,192.2,0,0 +-3,191.3,0,0 +-3,190.4,0,0 +-3,189.5,0,0 +-3,188.6,0,0 +-3,187.7,0,0 +-3,186.8,0,0 +-3,185.9,0,0 +-3,185,0,0 +-3,184.1,0,0 +-3,183.2,0,0 +-3,182.3,0,0 +-3,181.4,0,0 +-3,180.5,0,0 +-3,179.5,-90,0 +-3,178.6,-89.5,0 +-3,177.7,-89.1,0 +-3,176.8,-88.6,0 +-3,175.9,-88.2,0 +-3,175,-87.7,0 +-3,174.1,-87.3,0 +-3,173.2,-86.8,0 +-3,172.3,-86.4,0 +-3,171.4,-85.9,0 +-3,170.5,-85.5,0 +-3,169.6,-85,0 +-3,168.7,-84.6,0 +-3,167.8,-84.1,0 +-3,166.9,-83.7,0 +-3,166,-83.2,0 +-3,165.1,-82.8,0 +-3,164.2,-82.3,0 +-3,163.3,-81.9,0 +-3,162.4,-81.4,0 +-3,161.5,-81,0 +-3,160.6,-80.5,0 +-3,159.7,-80.1,0 +-3,158.8,-79.6,0 +-3,157.9,-79.1,0 +-3,157,-78.7,0 +-3,156.1,-78.2,0 +-3,155.2,-77.8,0 +-3,154.3,-77.3,0 +-3,153.4,-76.9,0 +-3,152.5,-76.4,0 +-3,151.6,-76,0 +-3,150.7,-75.5,0 +-3,149.8,-75.1,0 +-3,148.9,-74.6,0 +-3,148,-74.2,0 +-3,147.1,-73.7,0 +-3,146.2,-73.3,0 +-3,145.3,-72.8,0 +-3,144.4,-72.4,0 +-3,143.5,-71.9,0 +-3,142.6,-71.5,0 +-3,141.7,-71,0 +-3,140.8,-70.6,0 +-3,139.8,-70.1,0 +-3,138.9,-69.6,0 +-3,138,-69.2,0 +-3,137.1,-68.7,0 +-3,136.2,-68.3,0 +-3,135.3,-67.8,0 +-3,134.4,-67.4,0 +-3,133.5,-66.9,0 +-3,132.6,-66.5,0 +-3,131.7,-66,0 +-3,130.8,-65.6,0 +-3,129.9,-65.1,0 +-3,129,-64.7,0 +-3,128.1,-64.2,0 +-3,127.2,-63.8,0 +-3,126.3,-63.3,0 +-3,125.4,-62.9,0 +-3,124.5,-62.4,0 +-3,123.6,-62,0 +-3,122.7,-61.5,0 +-3,121.8,-61.1,0 +-3,120.9,-60.6,0 +-3,120,-60.2,0 +-3,119.1,-59.7,0 +-3,118.2,-59.2,0 +-3,117.3,-58.8,0 +-3,116.4,-58.3,0 +-3,115.5,-57.9,0 +-3,114.6,-57.4,0 +-3,113.7,-57,0 +-3,112.8,-56.5,0 +-3,111.9,-56.1,0 +-3,111,-55.6,0 +-3,110.1,-55.2,0 +-3,109.2,-54.7,0 +-3,108.3,-54.3,0 +-3,107.4,-53.8,0 +-3,106.5,-53.4,0 +-3,105.6,-52.9,0 +-3,104.7,-52.5,0 +-3,103.8,-52,0 +-3,102.9,-51.6,0 +-3,102,-51.1,0 +-3,101.1,-50.7,0 +-3,100.2,-50.2,0 +-3,99.2,-49.7,0 +-3,98.3,-49.3,0 +-3,97.4,-48.8,0 +-3,96.5,-48.4,0 +-3,95.6,-47.9,0 +-3,94.7,-47.5,0 +-3,93.8,-47,0 +-3,92.9,-46.6,0 +-3,92,-46.1,0 +-3,91.1,-45.7,0 +-3,90.2,-45.2,0 +-3,89.3,-44.8,90 +-3,88.4,-44.3,89.1 +-3,87.5,-43.9,88.2 +-3,86.6,-43.4,87.3 +-3,85.7,-43,86.4 +-3,84.8,-42.5,85.5 +-3,83.9,-42.1,84.5 +-3,83,-41.6,83.6 +-3,82.1,-41.2,82.7 +-3,81.2,-40.7,81.8 +-3,80.3,-40.3,80.9 +-3,79.4,-39.8,80 +-3,78.5,-39.3,79.1 +-3,77.6,-38.9,78.2 +-3,76.7,-38.4,77.3 +-3,75.8,-38,76.4 +-3,74.9,-37.5,75.5 +-3,74,-37.1,74.5 +-3,73.1,-36.6,73.6 +-3,72.2,-36.2,72.7 +-3,71.3,-35.7,71.8 +-3,70.4,-35.3,70.9 +-3,69.5,-34.8,70 +-3,68.6,-34.4,69.1 +-3,67.7,-33.9,68.2 +-3,66.8,-33.5,67.3 +-3,65.9,-33,66.4 +-3,65,-32.6,65.5 +-3,64.1,-32.1,64.5 +-3,63.2,-31.7,63.6 +-3,62.3,-31.2,62.7 +-3,61.4,-30.8,61.8 +-3,60.5,-30.3,60.9 +-3,59.5,-29.8,60 +-3,58.6,-29.4,59.1 +-3,57.7,-28.9,58.2 +-3,56.8,-28.5,57.3 +-3,55.9,-28,56.4 +-3,55,-27.6,55.5 +-3,54.1,-27.1,54.5 +-3,53.2,-26.7,53.6 +-3,52.3,-26.2,52.7 +-3,51.4,-25.8,51.8 +-3,50.5,-25.3,50.9 +-3,49.6,-24.9,50 +-3,48.7,-24.4,49.1 +-3,47.8,-24,48.2 +-3,46.9,-23.5,47.3 +-3,46,-23.1,46.4 +-3,45.1,-22.6,45.5 +-3,44.2,-22.2,44.5 +-3,43.3,-21.7,43.6 +-3,42.4,-21.3,42.7 +-3,41.5,-20.8,41.8 +-3,40.6,-20.4,40.9 +-3,39.7,-19.9,40 +-3,38.8,-19.4,39.1 +-3,37.9,-19,38.2 +-3,37,-18.5,37.3 +-3,36.1,-18.1,36.4 +-3,35.2,-17.6,35.5 +-3,34.3,-17.2,34.5 +-3,33.4,-16.7,33.6 +-3,32.5,-16.3,32.7 +-3,31.6,-15.8,31.8 +-3,30.7,-15.4,30.9 +-3,29.8,-14.9,30 +-3,28.9,-14.5,29.1 +-3,28,-14,28.2 +-3,27.1,-13.6,27.3 +-3,26.2,-13.1,26.4 +-3,25.3,-12.7,25.5 +-3,24.4,-12.2,24.5 +-3,23.5,-11.8,23.6 +-3,22.6,-11.3,22.7 +-3,21.7,-10.9,21.8 +-3,20.8,-10.4,20.9 +-3,19.8,-9.9,20 +-3,18.9,-9.5,19.1 +-3,18,-9,18.2 +-3,17.1,-8.6,17.3 +-3,16.2,-8.1,16.4 +-3,15.3,-7.7,15.5 +-3,14.4,-7.2,14.5 +-3,13.5,-6.8,13.6 +-3,12.6,-6.3,12.7 +-3,11.7,-5.9,11.8 +-3,10.8,-5.4,10.9 +-3,9.9,-5,10 +-3,9,-4.5,9.1 +-3,8.1,-4.1,8.2 +-3,7.2,-3.6,7.3 +-3,6.3,-3.2,6.4 +-3,5.4,-2.7,5.5 +-3,4.5,-2.3,4.5 +-3,3.6,-1.8,3.6 +-3,2.7,-1.4,2.7 +-3,1.8,-0.9,1.8 +-3,0.9,-0.5,0.9 +-3,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +0.9,0,0,0.3 +0.9,0,0,0.3 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.8,0,0,0.5 +0.8,0,0,0.5 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.5,0,0,0.8 +0.5,0,0,0.8 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.3,0,0,0.9 +0.3,0,0,0.9 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,0.9 +0.3,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.8 +0.5,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.7,0,0,0.8 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.8,0,0,0.7 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.5 +0.8,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.3 +0.9,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0 +-3,0,0,0 +-3,0.9,-0.5,0.9 +-3,1.8,-0.9,1.8 +-3,2.7,-1.4,2.7 +-3,3.6,-1.8,3.6 +-3,4.5,-2.3,4.5 +-3,5.4,-2.7,5.5 +-3,6.3,-3.2,6.4 +-3,7.2,-3.6,7.3 +-3,8.1,-4.1,8.2 +-3,9,-4.5,9.1 +-3,9.9,-5,10 +-3,10.8,-5.4,10.9 +-3,11.7,-5.9,11.8 +-3,12.6,-6.3,12.7 +-3,13.5,-6.8,13.6 +-3,14.4,-7.2,14.5 +-3,15.3,-7.7,15.5 +-3,16.2,-8.1,16.4 +-3,17.1,-8.6,17.3 +-3,18,-9,18.2 +-3,18.9,-9.5,19.1 +-3,19.8,-9.9,20 +-3,20.8,-10.4,20.9 +-3,21.7,-10.9,21.8 +-3,22.6,-11.3,22.7 +-3,23.5,-11.8,23.6 +-3,24.4,-12.2,24.5 +-3,25.3,-12.7,25.5 +-3,26.2,-13.1,26.4 +-3,27.1,-13.6,27.3 +-3,28,-14,28.2 +-3,28.9,-14.5,29.1 +-3,29.8,-14.9,30 +-3,30.7,-15.4,30.9 +-3,31.6,-15.8,31.8 +-3,32.5,-16.3,32.7 +-3,33.4,-16.7,33.6 +-3,34.3,-17.2,34.5 +-3,35.2,-17.6,35.5 +-3,36.1,-18.1,36.4 +-3,37,-18.5,37.3 +-3,37.9,-19,38.2 +-3,38.8,-19.4,39.1 +-3,39.7,-19.9,40 +-3,40.6,-20.4,40.9 +-3,41.5,-20.8,41.8 +-3,42.4,-21.3,42.7 +-3,43.3,-21.7,43.6 +-3,44.2,-22.2,44.5 +-3,45.1,-22.6,45.5 +-3,46,-23.1,46.4 +-3,46.9,-23.5,47.3 +-3,47.8,-24,48.2 +-3,48.7,-24.4,49.1 +-3,49.6,-24.9,50 +-3,50.5,-25.3,50.9 +-3,51.4,-25.8,51.8 +-3,52.3,-26.2,52.7 +-3,53.2,-26.7,53.6 +-3,54.1,-27.1,54.5 +-3,55,-27.6,55.5 +-3,55.9,-28,56.4 +-3,56.8,-28.5,57.3 +-3,57.7,-28.9,58.2 +-3,58.6,-29.4,59.1 +-3,59.5,-29.8,60 +-3,60.5,-30.3,60.9 +-3,61.4,-30.8,61.8 +-3,62.3,-31.2,62.7 +-3,63.2,-31.7,63.6 +-3,64.1,-32.1,64.5 +-3,65,-32.6,65.5 +-3,65.9,-33,66.4 +-3,66.8,-33.5,67.3 +-3,67.7,-33.9,68.2 +-3,68.6,-34.4,69.1 +-3,69.5,-34.8,70 +-3,70.4,-35.3,70.9 +-3,71.3,-35.7,71.8 +-3,72.2,-36.2,72.7 +-3,73.1,-36.6,73.6 +-3,74,-37.1,74.5 +-3,74.9,-37.5,75.5 +-3,75.8,-38,76.4 +-3,76.7,-38.4,77.3 +-3,77.6,-38.9,78.2 +-3,78.5,-39.3,79.1 +-3,79.4,-39.8,80 +-3,80.3,-40.3,80.9 +-3,81.2,-40.7,81.8 +-3,82.1,-41.2,82.7 +-3,83,-41.6,83.6 +-3,83.9,-42.1,84.5 +-3,84.8,-42.5,85.5 +-3,85.7,-43,86.4 +-3,86.6,-43.4,87.3 +-3,87.5,-43.9,88.2 +-3,88.4,-44.3,89.1 +-3,89.3,-44.8,90 +-3,90.2,-45.2,0 +-3,91.1,-45.7,0 +-3,92,-46.1,0 +-3,92.9,-46.6,0 +-3,93.8,-47,0 +-3,94.7,-47.5,0 +-3,95.6,-47.9,0 +-3,96.5,-48.4,0 +-3,97.4,-48.8,0 +-3,98.3,-49.3,0 +-3,99.2,-49.7,0 +-3,100.2,-50.2,0 +-3,101.1,-50.7,0 +-3,102,-51.1,0 +-3,102.9,-51.6,0 +-3,103.8,-52,0 +-3,104.7,-52.5,0 +-3,105.6,-52.9,0 +-3,106.5,-53.4,0 +-3,107.4,-53.8,0 +-3,108.3,-54.3,0 +-3,109.2,-54.7,0 +-3,110.1,-55.2,0 +-3,111,-55.6,0 +-3,111.9,-56.1,0 +-3,112.8,-56.5,0 +-3,113.7,-57,0 +-3,114.6,-57.4,0 +-3,115.5,-57.9,0 +-3,116.4,-58.3,0 +-3,117.3,-58.8,0 +-3,118.2,-59.2,0 +-3,119.1,-59.7,0 +-3,120,-60.2,0 +-3,120.9,-60.6,0 +-3,121.8,-61.1,0 +-3,122.7,-61.5,0 +-3,123.6,-62,0 +-3,124.5,-62.4,0 +-3,125.4,-62.9,0 +-3,126.3,-63.3,0 +-3,127.2,-63.8,0 +-3,128.1,-64.2,0 +-3,129,-64.7,0 +-3,129.9,-65.1,0 +-3,130.8,-65.6,0 +-3,131.7,-66,0 +-3,132.6,-66.5,0 +-3,133.5,-66.9,0 +-3,134.4,-67.4,0 +-3,135.3,-67.8,0 +-3,136.2,-68.3,0 +-3,137.1,-68.7,0 +-3,138,-69.2,0 +-3,138.9,-69.6,0 +-3,139.8,-70.1,0 +-3,140.8,-70.6,0 +-3,141.7,-71,0 +-3,142.6,-71.5,0 +-3,143.5,-71.9,0 +-3,144.4,-72.4,0 +-3,145.3,-72.8,0 +-3,146.2,-73.3,0 +-3,147.1,-73.7,0 +-3,148,-74.2,0 +-3,148.9,-74.6,0 +-3,149.8,-75.1,0 +-3,150.7,-75.5,0 +-3,151.6,-76,0 +-3,152.5,-76.4,0 +-3,153.4,-76.9,0 +-3,154.3,-77.3,0 +-3,155.2,-77.8,0 +-3,156.1,-78.2,0 +-3,157,-78.7,0 +-3,157.9,-79.1,0 +-3,158.8,-79.6,0 +-3,159.7,-80.1,0 +-3,160.6,-80.5,0 +-3,161.5,-81,0 +-3,162.4,-81.4,0 +-3,163.3,-81.9,0 +-3,164.2,-82.3,0 +-3,165.1,-82.8,0 +-3,166,-83.2,0 +-3,166.9,-83.7,0 +-3,167.8,-84.1,0 +-3,168.7,-84.6,0 +-3,169.6,-85,0 +-3,170.5,-85.5,0 +-3,171.4,-85.9,0 +-3,172.3,-86.4,0 +-3,173.2,-86.8,0 +-3,174.1,-87.3,0 +-3,175,-87.7,0 +-3,175.9,-88.2,0 +-3,176.8,-88.6,0 +-3,177.7,-89.1,0 +-3,178.6,-89.5,0 +-3,179.5,-90,0 +-3,180.5,0,0 +-3,181.4,0,0 +-3,182.3,0,0 +-3,183.2,0,0 +-3,184.1,0,0 +-3,185,0,0 +-3,185.9,0,0 +-3,186.8,0,0 +-3,187.7,0,0 +-3,188.6,0,0 +-3,189.5,0,0 +-3,190.4,0,0 +-3,191.3,0,0 +-3,192.2,0,0 +-3,193.1,0,0 +-3,194,0,0 +-3,194.9,0,0 +-3,195.8,0,0 +-3,196.7,0,0 +-3,197.6,0,0 +-3,198.5,0,0 +-3,199.4,0,0 +-3,200.3,0,0 +-3,201.2,0,0 +-3,202.1,0,0 +-3,203,0,0 +-3,203.9,0,0 +-3,204.8,0,0 +-3,205.7,0,0 +-3,206.6,0,0 +-3,207.5,0,0 +-3,208.4,0,0 +-3,209.3,0,0 +-3,210.2,0,0 +-3,211.1,0,0 +-3,212,0,0 +-3,212.9,0,0 +-3,213.8,0,0 +-3,214.7,0,0 +-3,215.6,0,0 +-3,216.5,0,0 +-3,217.4,0,0 +-3,218.3,0,0 +-3,219.2,0,0 +-3,220.2,0,0 +-3,221.1,0,0 +-3,222,0,0 +-3,222.9,0,0 +-3,223.8,0,0 +-3,224.7,0,0 +-3,225.6,0,0 +-3,226.5,0,0 +-3,227.4,0,0 +-3,228.3,0,0 +-3,229.2,0,0 +-3,230.1,0,0 +-3,231,0,0 +-3,231.9,0,0 +-3,232.8,0,0 +-3,233.7,0,0 +-3,234.6,0,0 +-3,235.5,0,0 +-3,236.4,0,0 +-3,237.3,0,0 +-3,238.2,0,0 +-3,239.1,0,0 +-3,240,0,0 +-3,240.9,0,0 +-3,241.8,0,0 +-3,242.7,0,0 +-3,243.6,0,0 +-3,244.5,0,0 +-3,245.4,0,0 +-3,246.3,0,0 +-3,247.2,0,0 +-3,248.1,0,0 +-3,249,0,0 +-3,249.9,0,0 +-3,250.8,0,0 +-3,251.7,0,0 +-3,252.6,0,0 +-3,253.5,0,0 +-3,254.4,0,0 +-3,255.3,0,0 +-3,256.2,0,0 +-3,257.1,0,0 +-3,258,0,0 +-3,258.9,0,0 +-3,259.8,0,0 +-3,260.8,0,0 +-3,261.7,0,0 +-3,262.6,0,0 +-3,263.5,0,0 +-3,264.4,0,0 +-3,265.3,0,0 +-3,266.2,0,0 +-3,267.1,0,0 +-3,268,0,0 +-3,268.9,0,0 +-3,269.8,0,0 +-3,270.7,0,0 +-3,271.6,0,0 +-3,272.5,0,0 +-3,273.4,0,0 +-3,274.3,0,0 +-3,275.2,0,0 +-3,276.1,0,0 +-3,277,0,0 +-3,277.9,0,0 +-3,278.8,0,0 +-3,279.7,0,0 +-3,280.6,0,0 +-3,281.5,0,0 +-3,282.4,0,0 +-3,283.3,0,0 +-3,284.2,0,0 +-3,285.1,0,0 +-3,286,0,0 +-3,286.9,0,0 +-3,287.8,0,0 +-3,288.7,0,0 +-3,289.6,0,0 +-3,290.5,0,0 +-3,291.4,0,0 +-3,292.3,0,0 +-3,293.2,0,0 +-3,294.1,0,0 +-3,295,0,0 +-3,295.9,0,0 +-3,296.8,0,0 +-3,297.7,0,0 +-3,298.6,0,0 +-3,299.5,0,0 +-3,300.5,0,0 +-3,301.4,0,0 +-3,302.3,0,0 +-3,303.2,0,0 +-3,304.1,0,0 +-3,305,0,0 +-3,305.9,0,0 +-3,306.8,0,0 +-3,307.7,0,0 +-3,308.6,0,0 +-3,309.5,0,0 +-3,310.4,0,0 +-3,311.3,0,0 +-3,312.2,0,0 +-3,313.1,0,0 +-3,314,0,0 +-3,314.9,0,0 +-3,315.8,0,0 +-3,316.7,0,0 +-3,317.6,0,0 +-3,318.5,0,0 +-3,319.4,0,0 +-3,320.3,0,0 +-3,321.2,0,0 +-3,322.1,0,0 +-3,323,0,0 +-3,323.9,0,0 +-3,324.8,0,0 +-3,325.7,0,0 +-3,326.6,0,0 +-3,327.5,0,0 +-3,328.4,0,0 +-3,329.3,0,0 +-3,330.2,0,0 +-3,331.1,0,0 +-3,332,0,0 +-3,332.9,0,0 +-3,333.8,0,0 +-3,334.7,0,0 +-3,335.6,0,0 +-3,336.5,0,0 +-3,337.4,0,0 +-3,338.3,0,0 +-3,339.2,0,0 +-3,340.2,0,0 +-3,341.1,0,0 +-3,342,0,0 +-3,342.9,0,0 +-3,343.8,0,0 +-3,344.7,0,0 +-3,345.6,0,0 +-3,346.5,0,0 +-3,347.4,0,0 +-3,348.3,0,0 +-3,349.2,0,0 +-3,350.1,0,0 +-3,351,0,0 +-3,351.9,0,0 +-3,352.8,0,0 +-3,353.7,0,0 +-3,354.6,0,0 +-3,355.5,0,0 +-3,356.4,0,0 +-3,357.3,0,0 +-3,358.2,0,0 +-3,359.1,0,0 +-3,360,0,0 +-3,360,0,0 +-3,359.1,0,0 +-3,358.2,0,0 +-3,357.3,0,0 +-3,356.4,0,0 +-3,355.5,0,0 +-3,354.6,0,0 +-3,353.7,0,0 +-3,352.8,0,0 +-3,351.9,0,0 +-3,351,0,0 +-3,350.1,0,0 +-3,349.2,0,0 +-3,348.3,0,0 +-3,347.4,0,0 +-3,346.5,0,0 +-3,345.6,0,0 +-3,344.7,0,0 +-3,343.8,0,0 +-3,342.9,0,0 +-3,342,0,0 +-3,341.1,0,0 +-3,340.2,0,0 +-3,339.2,0,0 +-3,338.3,0,0 +-3,337.4,0,0 +-3,336.5,0,0 +-3,335.6,0,0 +-3,334.7,0,0 +-3,333.8,0,0 +-3,332.9,0,0 +-3,332,0,0 +-3,331.1,0,0 +-3,330.2,0,0 +-3,329.3,0,0 +-3,328.4,0,0 +-3,327.5,0,0 +-3,326.6,0,0 +-3,325.7,0,0 +-3,324.8,0,0 +-3,323.9,0,0 +-3,323,0,0 +-3,322.1,0,0 +-3,321.2,0,0 +-3,320.3,0,0 +-3,319.4,0,0 +-3,318.5,0,0 +-3,317.6,0,0 +-3,316.7,0,0 +-3,315.8,0,0 +-3,314.9,0,0 +-3,314,0,0 +-3,313.1,0,0 +-3,312.2,0,0 +-3,311.3,0,0 +-3,310.4,0,0 +-3,309.5,0,0 +-3,308.6,0,0 +-3,307.7,0,0 +-3,306.8,0,0 +-3,305.9,0,0 +-3,305,0,0 +-3,304.1,0,0 +-3,303.2,0,0 +-3,302.3,0,0 +-3,301.4,0,0 +-3,300.5,0,0 +-3,299.5,0,0 +-3,298.6,0,0 +-3,297.7,0,0 +-3,296.8,0,0 +-3,295.9,0,0 +-3,295,0,0 +-3,294.1,0,0 +-3,293.2,0,0 +-3,292.3,0,0 +-3,291.4,0,0 +-3,290.5,0,0 +-3,289.6,0,0 +-3,288.7,0,0 +-3,287.8,0,0 +-3,286.9,0,0 +-3,286,0,0 +-3,285.1,0,0 +-3,284.2,0,0 +-3,283.3,0,0 +-3,282.4,0,0 +-3,281.5,0,0 +-3,280.6,0,0 +-3,279.7,0,0 +-3,278.8,0,0 +-3,277.9,0,0 +-3,277,0,0 +-3,276.1,0,0 +-3,275.2,0,0 +-3,274.3,0,0 +-3,273.4,0,0 +-3,272.5,0,0 +-3,271.6,0,0 +-3,270.7,0,0 +-3,269.8,0,0 +-3,268.9,0,0 +-3,268,0,0 +-3,267.1,0,0 +-3,266.2,0,0 +-3,265.3,0,0 +-3,264.4,0,0 +-3,263.5,0,0 +-3,262.6,0,0 +-3,261.7,0,0 +-3,260.8,0,0 +-3,259.8,0,0 +-3,258.9,0,0 +-3,258,0,0 +-3,257.1,0,0 +-3,256.2,0,0 +-3,255.3,0,0 +-3,254.4,0,0 +-3,253.5,0,0 +-3,252.6,0,0 +-3,251.7,0,0 +-3,250.8,0,0 +-3,249.9,0,0 +-3,249,0,0 +-3,248.1,0,0 +-3,247.2,0,0 +-3,246.3,0,0 +-3,245.4,0,0 +-3,244.5,0,0 +-3,243.6,0,0 +-3,242.7,0,0 +-3,241.8,0,0 +-3,240.9,0,0 +-3,240,0,0 +-3,239.1,0,0 +-3,238.2,0,0 +-3,237.3,0,0 +-3,236.4,0,0 +-3,235.5,0,0 +-3,234.6,0,0 +-3,233.7,0,0 +-3,232.8,0,0 +-3,231.9,0,0 +-3,231,0,0 +-3,230.1,0,0 +-3,229.2,0,0 +-3,228.3,0,0 +-3,227.4,0,0 +-3,226.5,0,0 +-3,225.6,0,0 +-3,224.7,0,0 +-3,223.8,0,0 +-3,222.9,0,0 +-3,222,0,0 +-3,221.1,0,0 +-3,220.2,0,0 +-3,219.2,0,0 +-3,218.3,0,0 +-3,217.4,0,0 +-3,216.5,0,0 +-3,215.6,0,0 +-3,214.7,0,0 +-3,213.8,0,0 +-3,212.9,0,0 +-3,212,0,0 +-3,211.1,0,0 +-3,210.2,0,0 +-3,209.3,0,0 +-3,208.4,0,0 +-3,207.5,0,0 +-3,206.6,0,0 +-3,205.7,0,0 +-3,204.8,0,0 +-3,203.9,0,0 +-3,203,0,0 +-3,202.1,0,0 +-3,201.2,0,0 +-3,200.3,0,0 +-3,199.4,0,0 +-3,198.5,0,0 +-3,197.6,0,0 +-3,196.7,0,0 +-3,195.8,0,0 +-3,194.9,0,0 +-3,194,0,0 +-3,193.1,0,0 +-3,192.2,0,0 +-3,191.3,0,0 +-3,190.4,0,0 +-3,189.5,0,0 +-3,188.6,0,0 +-3,187.7,0,0 +-3,186.8,0,0 +-3,185.9,0,0 +-3,185,0,0 +-3,184.1,0,0 +-3,183.2,0,0 +-3,182.3,0,0 +-3,181.4,0,0 +-3,180.5,0,0 +-3,179.5,-90,0 +-3,178.6,-89.5,0 +-3,177.7,-89.1,0 +-3,176.8,-88.6,0 +-3,175.9,-88.2,0 +-3,175,-87.7,0 +-3,174.1,-87.3,0 +-3,173.2,-86.8,0 +-3,172.3,-86.4,0 +-3,171.4,-85.9,0 +-3,170.5,-85.5,0 +-3,169.6,-85,0 +-3,168.7,-84.6,0 +-3,167.8,-84.1,0 +-3,166.9,-83.7,0 +-3,166,-83.2,0 +-3,165.1,-82.8,0 +-3,164.2,-82.3,0 +-3,163.3,-81.9,0 +-3,162.4,-81.4,0 +-3,161.5,-81,0 +-3,160.6,-80.5,0 +-3,159.7,-80.1,0 +-3,158.8,-79.6,0 +-3,157.9,-79.1,0 +-3,157,-78.7,0 +-3,156.1,-78.2,0 +-3,155.2,-77.8,0 +-3,154.3,-77.3,0 +-3,153.4,-76.9,0 +-3,152.5,-76.4,0 +-3,151.6,-76,0 +-3,150.7,-75.5,0 +-3,149.8,-75.1,0 +-3,148.9,-74.6,0 +-3,148,-74.2,0 +-3,147.1,-73.7,0 +-3,146.2,-73.3,0 +-3,145.3,-72.8,0 +-3,144.4,-72.4,0 +-3,143.5,-71.9,0 +-3,142.6,-71.5,0 +-3,141.7,-71,0 +-3,140.8,-70.6,0 +-3,139.8,-70.1,0 +-3,138.9,-69.6,0 +-3,138,-69.2,0 +-3,137.1,-68.7,0 +-3,136.2,-68.3,0 +-3,135.3,-67.8,0 +-3,134.4,-67.4,0 +-3,133.5,-66.9,0 +-3,132.6,-66.5,0 +-3,131.7,-66,0 +-3,130.8,-65.6,0 +-3,129.9,-65.1,0 +-3,129,-64.7,0 +-3,128.1,-64.2,0 +-3,127.2,-63.8,0 +-3,126.3,-63.3,0 +-3,125.4,-62.9,0 +-3,124.5,-62.4,0 +-3,123.6,-62,0 +-3,122.7,-61.5,0 +-3,121.8,-61.1,0 +-3,120.9,-60.6,0 +-3,120,-60.2,0 +-3,119.1,-59.7,0 +-3,118.2,-59.2,0 +-3,117.3,-58.8,0 +-3,116.4,-58.3,0 +-3,115.5,-57.9,0 +-3,114.6,-57.4,0 +-3,113.7,-57,0 +-3,112.8,-56.5,0 +-3,111.9,-56.1,0 +-3,111,-55.6,0 +-3,110.1,-55.2,0 +-3,109.2,-54.7,0 +-3,108.3,-54.3,0 +-3,107.4,-53.8,0 +-3,106.5,-53.4,0 +-3,105.6,-52.9,0 +-3,104.7,-52.5,0 +-3,103.8,-52,0 +-3,102.9,-51.6,0 +-3,102,-51.1,0 +-3,101.1,-50.7,0 +-3,100.2,-50.2,0 +-3,99.2,-49.7,0 +-3,98.3,-49.3,0 +-3,97.4,-48.8,0 +-3,96.5,-48.4,0 +-3,95.6,-47.9,0 +-3,94.7,-47.5,0 +-3,93.8,-47,0 +-3,92.9,-46.6,0 +-3,92,-46.1,0 +-3,91.1,-45.7,0 +-3,90.2,-45.2,0 +-3,89.3,-44.8,90 +-3,88.4,-44.3,89.1 +-3,87.5,-43.9,88.2 +-3,86.6,-43.4,87.3 +-3,85.7,-43,86.4 +-3,84.8,-42.5,85.5 +-3,83.9,-42.1,84.5 +-3,83,-41.6,83.6 +-3,82.1,-41.2,82.7 +-3,81.2,-40.7,81.8 +-3,80.3,-40.3,80.9 +-3,79.4,-39.8,80 +-3,78.5,-39.3,79.1 +-3,77.6,-38.9,78.2 +-3,76.7,-38.4,77.3 +-3,75.8,-38,76.4 +-3,74.9,-37.5,75.5 +-3,74,-37.1,74.5 +-3,73.1,-36.6,73.6 +-3,72.2,-36.2,72.7 +-3,71.3,-35.7,71.8 +-3,70.4,-35.3,70.9 +-3,69.5,-34.8,70 +-3,68.6,-34.4,69.1 +-3,67.7,-33.9,68.2 +-3,66.8,-33.5,67.3 +-3,65.9,-33,66.4 +-3,65,-32.6,65.5 +-3,64.1,-32.1,64.5 +-3,63.2,-31.7,63.6 +-3,62.3,-31.2,62.7 +-3,61.4,-30.8,61.8 +-3,60.5,-30.3,60.9 +-3,59.5,-29.8,60 +-3,58.6,-29.4,59.1 +-3,57.7,-28.9,58.2 +-3,56.8,-28.5,57.3 +-3,55.9,-28,56.4 +-3,55,-27.6,55.5 +-3,54.1,-27.1,54.5 +-3,53.2,-26.7,53.6 +-3,52.3,-26.2,52.7 +-3,51.4,-25.8,51.8 +-3,50.5,-25.3,50.9 +-3,49.6,-24.9,50 +-3,48.7,-24.4,49.1 +-3,47.8,-24,48.2 +-3,46.9,-23.5,47.3 +-3,46,-23.1,46.4 +-3,45.1,-22.6,45.5 +-3,44.2,-22.2,44.5 +-3,43.3,-21.7,43.6 +-3,42.4,-21.3,42.7 +-3,41.5,-20.8,41.8 +-3,40.6,-20.4,40.9 +-3,39.7,-19.9,40 +-3,38.8,-19.4,39.1 +-3,37.9,-19,38.2 +-3,37,-18.5,37.3 +-3,36.1,-18.1,36.4 +-3,35.2,-17.6,35.5 +-3,34.3,-17.2,34.5 +-3,33.4,-16.7,33.6 +-3,32.5,-16.3,32.7 +-3,31.6,-15.8,31.8 +-3,30.7,-15.4,30.9 +-3,29.8,-14.9,30 +-3,28.9,-14.5,29.1 +-3,28,-14,28.2 +-3,27.1,-13.6,27.3 +-3,26.2,-13.1,26.4 +-3,25.3,-12.7,25.5 +-3,24.4,-12.2,24.5 +-3,23.5,-11.8,23.6 +-3,22.6,-11.3,22.7 +-3,21.7,-10.9,21.8 +-3,20.8,-10.4,20.9 +-3,19.8,-9.9,20 +-3,18.9,-9.5,19.1 +-3,18,-9,18.2 +-3,17.1,-8.6,17.3 +-3,16.2,-8.1,16.4 +-3,15.3,-7.7,15.5 +-3,14.4,-7.2,14.5 +-3,13.5,-6.8,13.6 +-3,12.6,-6.3,12.7 +-3,11.7,-5.9,11.8 +-3,10.8,-5.4,10.9 +-3,9.9,-5,10 +-3,9,-4.5,9.1 +-3,8.1,-4.1,8.2 +-3,7.2,-3.6,7.3 +-3,6.3,-3.2,6.4 +-3,5.4,-2.7,5.5 +-3,4.5,-2.3,4.5 +-3,3.6,-1.8,3.6 +-3,2.7,-1.4,2.7 +-3,1.8,-0.9,1.8 +-3,0.9,-0.5,0.9 +-3,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +0.9,0,0,0.3 +0.9,0,0,0.3 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.8,0,0,0.5 +0.8,0,0,0.5 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.5,0,0,0.8 +0.5,0,0,0.8 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.3,0,0,0.9 +0.3,0,0,0.9 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,0.9 +0.3,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.8 +0.5,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.7,0,0,0.8 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.8,0,0,0.7 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.5 +0.8,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.3 +0.9,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0 +-3,0,0,0 +-3,0.9,-0.5,0.9 +-3,1.8,-0.9,1.8 +-3,2.7,-1.4,2.7 +-3,3.6,-1.8,3.6 +-3,4.5,-2.3,4.5 +-3,5.4,-2.7,5.5 +-3,6.3,-3.2,6.4 +-3,7.2,-3.6,7.3 +-3,8.1,-4.1,8.2 +-3,9,-4.5,9.1 +-3,9.9,-5,10 +-3,10.8,-5.4,10.9 +-3,11.7,-5.9,11.8 +-3,12.6,-6.3,12.7 +-3,13.5,-6.8,13.6 +-3,14.4,-7.2,14.5 +-3,15.3,-7.7,15.5 +-3,16.2,-8.1,16.4 +-3,17.1,-8.6,17.3 +-3,18,-9,18.2 +-3,18.9,-9.5,19.1 +-3,19.8,-9.9,20 +-3,20.8,-10.4,20.9 +-3,21.7,-10.9,21.8 +-3,22.6,-11.3,22.7 +-3,23.5,-11.8,23.6 +-3,24.4,-12.2,24.5 +-3,25.3,-12.7,25.5 +-3,26.2,-13.1,26.4 +-3,27.1,-13.6,27.3 +-3,28,-14,28.2 +-3,28.9,-14.5,29.1 +-3,29.8,-14.9,30 +-3,30.7,-15.4,30.9 +-3,31.6,-15.8,31.8 +-3,32.5,-16.3,32.7 +-3,33.4,-16.7,33.6 +-3,34.3,-17.2,34.5 +-3,35.2,-17.6,35.5 +-3,36.1,-18.1,36.4 +-3,37,-18.5,37.3 +-3,37.9,-19,38.2 +-3,38.8,-19.4,39.1 +-3,39.7,-19.9,40 +-3,40.6,-20.4,40.9 +-3,41.5,-20.8,41.8 +-3,42.4,-21.3,42.7 +-3,43.3,-21.7,43.6 +-3,44.2,-22.2,44.5 +-3,45.1,-22.6,45.5 +-3,46,-23.1,46.4 +-3,46.9,-23.5,47.3 +-3,47.8,-24,48.2 +-3,48.7,-24.4,49.1 +-3,49.6,-24.9,50 +-3,50.5,-25.3,50.9 +-3,51.4,-25.8,51.8 +-3,52.3,-26.2,52.7 +-3,53.2,-26.7,53.6 +-3,54.1,-27.1,54.5 +-3,55,-27.6,55.5 +-3,55.9,-28,56.4 +-3,56.8,-28.5,57.3 +-3,57.7,-28.9,58.2 +-3,58.6,-29.4,59.1 +-3,59.5,-29.8,60 +-3,60.5,-30.3,60.9 +-3,61.4,-30.8,61.8 +-3,62.3,-31.2,62.7 +-3,63.2,-31.7,63.6 +-3,64.1,-32.1,64.5 +-3,65,-32.6,65.5 +-3,65.9,-33,66.4 +-3,66.8,-33.5,67.3 +-3,67.7,-33.9,68.2 +-3,68.6,-34.4,69.1 +-3,69.5,-34.8,70 +-3,70.4,-35.3,70.9 +-3,71.3,-35.7,71.8 +-3,72.2,-36.2,72.7 +-3,73.1,-36.6,73.6 +-3,74,-37.1,74.5 +-3,74.9,-37.5,75.5 +-3,75.8,-38,76.4 +-3,76.7,-38.4,77.3 +-3,77.6,-38.9,78.2 +-3,78.5,-39.3,79.1 +-3,79.4,-39.8,80 +-3,80.3,-40.3,80.9 +-3,81.2,-40.7,81.8 +-3,82.1,-41.2,82.7 +-3,83,-41.6,83.6 +-3,83.9,-42.1,84.5 +-3,84.8,-42.5,85.5 +-3,85.7,-43,86.4 +-3,86.6,-43.4,87.3 +-3,87.5,-43.9,88.2 +-3,88.4,-44.3,89.1 +-3,89.3,-44.8,90 +-3,90.2,-45.2,0 +-3,91.1,-45.7,0 +-3,92,-46.1,0 +-3,92.9,-46.6,0 +-3,93.8,-47,0 +-3,94.7,-47.5,0 +-3,95.6,-47.9,0 +-3,96.5,-48.4,0 +-3,97.4,-48.8,0 +-3,98.3,-49.3,0 +-3,99.2,-49.7,0 +-3,100.2,-50.2,0 +-3,101.1,-50.7,0 +-3,102,-51.1,0 +-3,102.9,-51.6,0 +-3,103.8,-52,0 +-3,104.7,-52.5,0 +-3,105.6,-52.9,0 +-3,106.5,-53.4,0 +-3,107.4,-53.8,0 +-3,108.3,-54.3,0 +-3,109.2,-54.7,0 +-3,110.1,-55.2,0 +-3,111,-55.6,0 +-3,111.9,-56.1,0 +-3,112.8,-56.5,0 +-3,113.7,-57,0 +-3,114.6,-57.4,0 +-3,115.5,-57.9,0 +-3,116.4,-58.3,0 +-3,117.3,-58.8,0 +-3,118.2,-59.2,0 +-3,119.1,-59.7,0 +-3,120,-60.2,0 +-3,120.9,-60.6,0 +-3,121.8,-61.1,0 +-3,122.7,-61.5,0 +-3,123.6,-62,0 +-3,124.5,-62.4,0 +-3,125.4,-62.9,0 +-3,126.3,-63.3,0 +-3,127.2,-63.8,0 +-3,128.1,-64.2,0 +-3,129,-64.7,0 +-3,129.9,-65.1,0 +-3,130.8,-65.6,0 +-3,131.7,-66,0 +-3,132.6,-66.5,0 +-3,133.5,-66.9,0 +-3,134.4,-67.4,0 +-3,135.3,-67.8,0 +-3,136.2,-68.3,0 +-3,137.1,-68.7,0 +-3,138,-69.2,0 +-3,138.9,-69.6,0 +-3,139.8,-70.1,0 +-3,140.8,-70.6,0 +-3,141.7,-71,0 +-3,142.6,-71.5,0 +-3,143.5,-71.9,0 +-3,144.4,-72.4,0 +-3,145.3,-72.8,0 +-3,146.2,-73.3,0 +-3,147.1,-73.7,0 +-3,148,-74.2,0 +-3,148.9,-74.6,0 +-3,149.8,-75.1,0 +-3,150.7,-75.5,0 +-3,151.6,-76,0 +-3,152.5,-76.4,0 +-3,153.4,-76.9,0 +-3,154.3,-77.3,0 +-3,155.2,-77.8,0 +-3,156.1,-78.2,0 +-3,157,-78.7,0 +-3,157.9,-79.1,0 +-3,158.8,-79.6,0 +-3,159.7,-80.1,0 +-3,160.6,-80.5,0 +-3,161.5,-81,0 +-3,162.4,-81.4,0 +-3,163.3,-81.9,0 +-3,164.2,-82.3,0 +-3,165.1,-82.8,0 +-3,166,-83.2,0 +-3,166.9,-83.7,0 +-3,167.8,-84.1,0 +-3,168.7,-84.6,0 +-3,169.6,-85,0 +-3,170.5,-85.5,0 +-3,171.4,-85.9,0 +-3,172.3,-86.4,0 +-3,173.2,-86.8,0 +-3,174.1,-87.3,0 +-3,175,-87.7,0 +-3,175.9,-88.2,0 +-3,176.8,-88.6,0 +-3,177.7,-89.1,0 +-3,178.6,-89.5,0 +-3,179.5,-90,0 +-3,180.5,0,0 +-3,181.4,0,0 +-3,182.3,0,0 +-3,183.2,0,0 +-3,184.1,0,0 +-3,185,0,0 +-3,185.9,0,0 +-3,186.8,0,0 +-3,187.7,0,0 +-3,188.6,0,0 +-3,189.5,0,0 +-3,190.4,0,0 +-3,191.3,0,0 +-3,192.2,0,0 +-3,193.1,0,0 +-3,194,0,0 +-3,194.9,0,0 +-3,195.8,0,0 +-3,196.7,0,0 +-3,197.6,0,0 +-3,198.5,0,0 +-3,199.4,0,0 +-3,200.3,0,0 +-3,201.2,0,0 +-3,202.1,0,0 +-3,203,0,0 +-3,203.9,0,0 +-3,204.8,0,0 +-3,205.7,0,0 +-3,206.6,0,0 +-3,207.5,0,0 +-3,208.4,0,0 +-3,209.3,0,0 +-3,210.2,0,0 +-3,211.1,0,0 +-3,212,0,0 +-3,212.9,0,0 +-3,213.8,0,0 +-3,214.7,0,0 +-3,215.6,0,0 +-3,216.5,0,0 +-3,217.4,0,0 +-3,218.3,0,0 +-3,219.2,0,0 +-3,220.2,0,0 +-3,221.1,0,0 +-3,222,0,0 +-3,222.9,0,0 +-3,223.8,0,0 +-3,224.7,0,0 +-3,225.6,0,0 +-3,226.5,0,0 +-3,227.4,0,0 +-3,228.3,0,0 +-3,229.2,0,0 +-3,230.1,0,0 +-3,231,0,0 +-3,231.9,0,0 +-3,232.8,0,0 +-3,233.7,0,0 +-3,234.6,0,0 +-3,235.5,0,0 +-3,236.4,0,0 +-3,237.3,0,0 +-3,238.2,0,0 +-3,239.1,0,0 +-3,240,0,0 +-3,240.9,0,0 +-3,241.8,0,0 +-3,242.7,0,0 +-3,243.6,0,0 +-3,244.5,0,0 +-3,245.4,0,0 +-3,246.3,0,0 +-3,247.2,0,0 +-3,248.1,0,0 +-3,249,0,0 +-3,249.9,0,0 +-3,250.8,0,0 +-3,251.7,0,0 +-3,252.6,0,0 +-3,253.5,0,0 +-3,254.4,0,0 +-3,255.3,0,0 +-3,256.2,0,0 +-3,257.1,0,0 +-3,258,0,0 +-3,258.9,0,0 +-3,259.8,0,0 +-3,260.8,0,0 +-3,261.7,0,0 +-3,262.6,0,0 +-3,263.5,0,0 +-3,264.4,0,0 +-3,265.3,0,0 +-3,266.2,0,0 +-3,267.1,0,0 +-3,268,0,0 +-3,268.9,0,0 +-3,269.8,0,0 +-3,270.7,0,0 +-3,271.6,0,0 +-3,272.5,0,0 +-3,273.4,0,0 +-3,274.3,0,0 +-3,275.2,0,0 +-3,276.1,0,0 +-3,277,0,0 +-3,277.9,0,0 +-3,278.8,0,0 +-3,279.7,0,0 +-3,280.6,0,0 +-3,281.5,0,0 +-3,282.4,0,0 +-3,283.3,0,0 +-3,284.2,0,0 +-3,285.1,0,0 +-3,286,0,0 +-3,286.9,0,0 +-3,287.8,0,0 +-3,288.7,0,0 +-3,289.6,0,0 +-3,290.5,0,0 +-3,291.4,0,0 +-3,292.3,0,0 +-3,293.2,0,0 +-3,294.1,0,0 +-3,295,0,0 +-3,295.9,0,0 +-3,296.8,0,0 +-3,297.7,0,0 +-3,298.6,0,0 +-3,299.5,0,0 +-3,300.5,0,0 +-3,301.4,0,0 +-3,302.3,0,0 +-3,303.2,0,0 +-3,304.1,0,0 +-3,305,0,0 +-3,305.9,0,0 +-3,306.8,0,0 +-3,307.7,0,0 +-3,308.6,0,0 +-3,309.5,0,0 +-3,310.4,0,0 +-3,311.3,0,0 +-3,312.2,0,0 +-3,313.1,0,0 +-3,314,0,0 +-3,314.9,0,0 +-3,315.8,0,0 +-3,316.7,0,0 +-3,317.6,0,0 +-3,318.5,0,0 +-3,319.4,0,0 +-3,320.3,0,0 +-3,321.2,0,0 +-3,322.1,0,0 +-3,323,0,0 +-3,323.9,0,0 +-3,324.8,0,0 +-3,325.7,0,0 +-3,326.6,0,0 +-3,327.5,0,0 +-3,328.4,0,0 +-3,329.3,0,0 +-3,330.2,0,0 +-3,331.1,0,0 +-3,332,0,0 +-3,332.9,0,0 +-3,333.8,0,0 +-3,334.7,0,0 +-3,335.6,0,0 +-3,336.5,0,0 +-3,337.4,0,0 +-3,338.3,0,0 +-3,339.2,0,0 +-3,340.2,0,0 +-3,341.1,0,0 +-3,342,0,0 +-3,342.9,0,0 +-3,343.8,0,0 +-3,344.7,0,0 +-3,345.6,0,0 +-3,346.5,0,0 +-3,347.4,0,0 +-3,348.3,0,0 +-3,349.2,0,0 +-3,350.1,0,0 +-3,351,0,0 +-3,351.9,0,0 +-3,352.8,0,0 +-3,353.7,0,0 +-3,354.6,0,0 +-3,355.5,0,0 +-3,356.4,0,0 +-3,357.3,0,0 +-3,358.2,0,0 +-3,359.1,0,0 +-3,360,0,0 +-3,360,0,0 +-3,359.1,0,0 +-3,358.2,0,0 +-3,357.3,0,0 +-3,356.4,0,0 +-3,355.5,0,0 +-3,354.6,0,0 +-3,353.7,0,0 +-3,352.8,0,0 +-3,351.9,0,0 +-3,351,0,0 +-3,350.1,0,0 +-3,349.2,0,0 +-3,348.3,0,0 +-3,347.4,0,0 +-3,346.5,0,0 +-3,345.6,0,0 +-3,344.7,0,0 +-3,343.8,0,0 +-3,342.9,0,0 +-3,342,0,0 +-3,341.1,0,0 +-3,340.2,0,0 +-3,339.2,0,0 +-3,338.3,0,0 +-3,337.4,0,0 +-3,336.5,0,0 +-3,335.6,0,0 +-3,334.7,0,0 +-3,333.8,0,0 +-3,332.9,0,0 +-3,332,0,0 +-3,331.1,0,0 +-3,330.2,0,0 +-3,329.3,0,0 +-3,328.4,0,0 +-3,327.5,0,0 +-3,326.6,0,0 +-3,325.7,0,0 +-3,324.8,0,0 +-3,323.9,0,0 +-3,323,0,0 +-3,322.1,0,0 +-3,321.2,0,0 +-3,320.3,0,0 +-3,319.4,0,0 +-3,318.5,0,0 +-3,317.6,0,0 +-3,316.7,0,0 +-3,315.8,0,0 +-3,314.9,0,0 +-3,314,0,0 +-3,313.1,0,0 +-3,312.2,0,0 +-3,311.3,0,0 +-3,310.4,0,0 +-3,309.5,0,0 +-3,308.6,0,0 +-3,307.7,0,0 +-3,306.8,0,0 +-3,305.9,0,0 +-3,305,0,0 +-3,304.1,0,0 +-3,303.2,0,0 +-3,302.3,0,0 +-3,301.4,0,0 +-3,300.5,0,0 +-3,299.5,0,0 +-3,298.6,0,0 +-3,297.7,0,0 +-3,296.8,0,0 +-3,295.9,0,0 +-3,295,0,0 +-3,294.1,0,0 +-3,293.2,0,0 +-3,292.3,0,0 +-3,291.4,0,0 +-3,290.5,0,0 +-3,289.6,0,0 +-3,288.7,0,0 +-3,287.8,0,0 +-3,286.9,0,0 +-3,286,0,0 +-3,285.1,0,0 +-3,284.2,0,0 +-3,283.3,0,0 +-3,282.4,0,0 +-3,281.5,0,0 +-3,280.6,0,0 +-3,279.7,0,0 +-3,278.8,0,0 +-3,277.9,0,0 +-3,277,0,0 +-3,276.1,0,0 +-3,275.2,0,0 +-3,274.3,0,0 +-3,273.4,0,0 +-3,272.5,0,0 +-3,271.6,0,0 +-3,270.7,0,0 +-3,269.8,0,0 +-3,268.9,0,0 +-3,268,0,0 +-3,267.1,0,0 +-3,266.2,0,0 +-3,265.3,0,0 +-3,264.4,0,0 +-3,263.5,0,0 +-3,262.6,0,0 +-3,261.7,0,0 +-3,260.8,0,0 +-3,259.8,0,0 +-3,258.9,0,0 +-3,258,0,0 +-3,257.1,0,0 +-3,256.2,0,0 +-3,255.3,0,0 +-3,254.4,0,0 +-3,253.5,0,0 +-3,252.6,0,0 +-3,251.7,0,0 +-3,250.8,0,0 +-3,249.9,0,0 +-3,249,0,0 +-3,248.1,0,0 +-3,247.2,0,0 +-3,246.3,0,0 +-3,245.4,0,0 +-3,244.5,0,0 +-3,243.6,0,0 +-3,242.7,0,0 +-3,241.8,0,0 +-3,240.9,0,0 +-3,240,0,0 +-3,239.1,0,0 +-3,238.2,0,0 +-3,237.3,0,0 +-3,236.4,0,0 +-3,235.5,0,0 +-3,234.6,0,0 +-3,233.7,0,0 +-3,232.8,0,0 +-3,231.9,0,0 +-3,231,0,0 +-3,230.1,0,0 +-3,229.2,0,0 +-3,228.3,0,0 +-3,227.4,0,0 +-3,226.5,0,0 +-3,225.6,0,0 +-3,224.7,0,0 +-3,223.8,0,0 +-3,222.9,0,0 +-3,222,0,0 +-3,221.1,0,0 +-3,220.2,0,0 +-3,219.2,0,0 +-3,218.3,0,0 +-3,217.4,0,0 +-3,216.5,0,0 +-3,215.6,0,0 +-3,214.7,0,0 +-3,213.8,0,0 +-3,212.9,0,0 +-3,212,0,0 +-3,211.1,0,0 +-3,210.2,0,0 +-3,209.3,0,0 +-3,208.4,0,0 +-3,207.5,0,0 +-3,206.6,0,0 +-3,205.7,0,0 +-3,204.8,0,0 +-3,203.9,0,0 +-3,203,0,0 +-3,202.1,0,0 +-3,201.2,0,0 +-3,200.3,0,0 +-3,199.4,0,0 +-3,198.5,0,0 +-3,197.6,0,0 +-3,196.7,0,0 +-3,195.8,0,0 +-3,194.9,0,0 +-3,194,0,0 +-3,193.1,0,0 +-3,192.2,0,0 +-3,191.3,0,0 +-3,190.4,0,0 +-3,189.5,0,0 +-3,188.6,0,0 +-3,187.7,0,0 +-3,186.8,0,0 +-3,185.9,0,0 +-3,185,0,0 +-3,184.1,0,0 +-3,183.2,0,0 +-3,182.3,0,0 +-3,181.4,0,0 +-3,180.5,0,0 +-3,179.5,-90,0 +-3,178.6,-89.5,0 +-3,177.7,-89.1,0 +-3,176.8,-88.6,0 +-3,175.9,-88.2,0 +-3,175,-87.7,0 +-3,174.1,-87.3,0 +-3,173.2,-86.8,0 +-3,172.3,-86.4,0 +-3,171.4,-85.9,0 +-3,170.5,-85.5,0 +-3,169.6,-85,0 +-3,168.7,-84.6,0 +-3,167.8,-84.1,0 +-3,166.9,-83.7,0 +-3,166,-83.2,0 +-3,165.1,-82.8,0 +-3,164.2,-82.3,0 +-3,163.3,-81.9,0 +-3,162.4,-81.4,0 +-3,161.5,-81,0 +-3,160.6,-80.5,0 +-3,159.7,-80.1,0 +-3,158.8,-79.6,0 +-3,157.9,-79.1,0 +-3,157,-78.7,0 +-3,156.1,-78.2,0 +-3,155.2,-77.8,0 +-3,154.3,-77.3,0 +-3,153.4,-76.9,0 +-3,152.5,-76.4,0 +-3,151.6,-76,0 +-3,150.7,-75.5,0 +-3,149.8,-75.1,0 +-3,148.9,-74.6,0 +-3,148,-74.2,0 +-3,147.1,-73.7,0 +-3,146.2,-73.3,0 +-3,145.3,-72.8,0 +-3,144.4,-72.4,0 +-3,143.5,-71.9,0 +-3,142.6,-71.5,0 +-3,141.7,-71,0 +-3,140.8,-70.6,0 +-3,139.8,-70.1,0 +-3,138.9,-69.6,0 +-3,138,-69.2,0 +-3,137.1,-68.7,0 +-3,136.2,-68.3,0 +-3,135.3,-67.8,0 +-3,134.4,-67.4,0 +-3,133.5,-66.9,0 +-3,132.6,-66.5,0 +-3,131.7,-66,0 +-3,130.8,-65.6,0 +-3,129.9,-65.1,0 +-3,129,-64.7,0 +-3,128.1,-64.2,0 +-3,127.2,-63.8,0 +-3,126.3,-63.3,0 +-3,125.4,-62.9,0 +-3,124.5,-62.4,0 +-3,123.6,-62,0 +-3,122.7,-61.5,0 +-3,121.8,-61.1,0 +-3,120.9,-60.6,0 +-3,120,-60.2,0 +-3,119.1,-59.7,0 +-3,118.2,-59.2,0 +-3,117.3,-58.8,0 +-3,116.4,-58.3,0 +-3,115.5,-57.9,0 +-3,114.6,-57.4,0 +-3,113.7,-57,0 +-3,112.8,-56.5,0 +-3,111.9,-56.1,0 +-3,111,-55.6,0 +-3,110.1,-55.2,0 +-3,109.2,-54.7,0 +-3,108.3,-54.3,0 +-3,107.4,-53.8,0 +-3,106.5,-53.4,0 +-3,105.6,-52.9,0 +-3,104.7,-52.5,0 +-3,103.8,-52,0 +-3,102.9,-51.6,0 +-3,102,-51.1,0 +-3,101.1,-50.7,0 +-3,100.2,-50.2,0 +-3,99.2,-49.7,0 +-3,98.3,-49.3,0 +-3,97.4,-48.8,0 +-3,96.5,-48.4,0 +-3,95.6,-47.9,0 +-3,94.7,-47.5,0 +-3,93.8,-47,0 +-3,92.9,-46.6,0 +-3,92,-46.1,0 +-3,91.1,-45.7,0 +-3,90.2,-45.2,0 +-3,89.3,-44.8,90 +-3,88.4,-44.3,89.1 +-3,87.5,-43.9,88.2 +-3,86.6,-43.4,87.3 +-3,85.7,-43,86.4 +-3,84.8,-42.5,85.5 +-3,83.9,-42.1,84.5 +-3,83,-41.6,83.6 +-3,82.1,-41.2,82.7 +-3,81.2,-40.7,81.8 +-3,80.3,-40.3,80.9 +-3,79.4,-39.8,80 +-3,78.5,-39.3,79.1 +-3,77.6,-38.9,78.2 +-3,76.7,-38.4,77.3 +-3,75.8,-38,76.4 +-3,74.9,-37.5,75.5 +-3,74,-37.1,74.5 +-3,73.1,-36.6,73.6 +-3,72.2,-36.2,72.7 +-3,71.3,-35.7,71.8 +-3,70.4,-35.3,70.9 +-3,69.5,-34.8,70 +-3,68.6,-34.4,69.1 +-3,67.7,-33.9,68.2 +-3,66.8,-33.5,67.3 +-3,65.9,-33,66.4 +-3,65,-32.6,65.5 +-3,64.1,-32.1,64.5 +-3,63.2,-31.7,63.6 +-3,62.3,-31.2,62.7 +-3,61.4,-30.8,61.8 +-3,60.5,-30.3,60.9 +-3,59.5,-29.8,60 +-3,58.6,-29.4,59.1 +-3,57.7,-28.9,58.2 +-3,56.8,-28.5,57.3 +-3,55.9,-28,56.4 +-3,55,-27.6,55.5 +-3,54.1,-27.1,54.5 +-3,53.2,-26.7,53.6 +-3,52.3,-26.2,52.7 +-3,51.4,-25.8,51.8 +-3,50.5,-25.3,50.9 +-3,49.6,-24.9,50 +-3,48.7,-24.4,49.1 +-3,47.8,-24,48.2 +-3,46.9,-23.5,47.3 +-3,46,-23.1,46.4 +-3,45.1,-22.6,45.5 +-3,44.2,-22.2,44.5 +-3,43.3,-21.7,43.6 +-3,42.4,-21.3,42.7 +-3,41.5,-20.8,41.8 +-3,40.6,-20.4,40.9 +-3,39.7,-19.9,40 +-3,38.8,-19.4,39.1 +-3,37.9,-19,38.2 +-3,37,-18.5,37.3 +-3,36.1,-18.1,36.4 +-3,35.2,-17.6,35.5 +-3,34.3,-17.2,34.5 +-3,33.4,-16.7,33.6 +-3,32.5,-16.3,32.7 +-3,31.6,-15.8,31.8 +-3,30.7,-15.4,30.9 +-3,29.8,-14.9,30 +-3,28.9,-14.5,29.1 +-3,28,-14,28.2 +-3,27.1,-13.6,27.3 +-3,26.2,-13.1,26.4 +-3,25.3,-12.7,25.5 +-3,24.4,-12.2,24.5 +-3,23.5,-11.8,23.6 +-3,22.6,-11.3,22.7 +-3,21.7,-10.9,21.8 +-3,20.8,-10.4,20.9 +-3,19.8,-9.9,20 +-3,18.9,-9.5,19.1 +-3,18,-9,18.2 +-3,17.1,-8.6,17.3 +-3,16.2,-8.1,16.4 +-3,15.3,-7.7,15.5 +-3,14.4,-7.2,14.5 +-3,13.5,-6.8,13.6 +-3,12.6,-6.3,12.7 +-3,11.7,-5.9,11.8 +-3,10.8,-5.4,10.9 +-3,9.9,-5,10 +-3,9,-4.5,9.1 +-3,8.1,-4.1,8.2 +-3,7.2,-3.6,7.3 +-3,6.3,-3.2,6.4 +-3,5.4,-2.7,5.5 +-3,4.5,-2.3,4.5 +-3,3.6,-1.8,3.6 +-3,2.7,-1.4,2.7 +-3,1.8,-0.9,1.8 +-3,0.9,-0.5,0.9 +-3,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +0.9,0,0,0.3 +0.9,0,0,0.3 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.8,0,0,0.5 +0.8,0,0,0.5 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.5,0,0,0.8 +0.5,0,0,0.8 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.3,0,0,0.9 +0.3,0,0,0.9 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,0.9 +0.3,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.8 +0.5,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.7,0,0,0.8 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.8,0,0,0.7 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.5 +0.8,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.3 +0.9,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0 +-3,0,0,0 +-3,0.9,-0.5,0.9 +-3,1.8,-0.9,1.8 +-3,2.7,-1.4,2.7 +-3,3.6,-1.8,3.6 +-3,4.5,-2.3,4.5 +-3,5.4,-2.7,5.5 +-3,6.3,-3.2,6.4 +-3,7.2,-3.6,7.3 +-3,8.1,-4.1,8.2 +-3,9,-4.5,9.1 +-3,9.9,-5,10 +-3,10.8,-5.4,10.9 +-3,11.7,-5.9,11.8 +-3,12.6,-6.3,12.7 +-3,13.5,-6.8,13.6 +-3,14.4,-7.2,14.5 +-3,15.3,-7.7,15.5 +-3,16.2,-8.1,16.4 +-3,17.1,-8.6,17.3 +-3,18,-9,18.2 +-3,18.9,-9.5,19.1 +-3,19.8,-9.9,20 +-3,20.8,-10.4,20.9 +-3,21.7,-10.9,21.8 +-3,22.6,-11.3,22.7 +-3,23.5,-11.8,23.6 +-3,24.4,-12.2,24.5 +-3,25.3,-12.7,25.5 +-3,26.2,-13.1,26.4 +-3,27.1,-13.6,27.3 +-3,28,-14,28.2 +-3,28.9,-14.5,29.1 +-3,29.8,-14.9,30 +-3,30.7,-15.4,30.9 +-3,31.6,-15.8,31.8 +-3,32.5,-16.3,32.7 +-3,33.4,-16.7,33.6 +-3,34.3,-17.2,34.5 +-3,35.2,-17.6,35.5 +-3,36.1,-18.1,36.4 +-3,37,-18.5,37.3 +-3,37.9,-19,38.2 +-3,38.8,-19.4,39.1 +-3,39.7,-19.9,40 +-3,40.6,-20.4,40.9 +-3,41.5,-20.8,41.8 +-3,42.4,-21.3,42.7 +-3,43.3,-21.7,43.6 +-3,44.2,-22.2,44.5 +-3,45.1,-22.6,45.5 +-3,46,-23.1,46.4 +-3,46.9,-23.5,47.3 +-3,47.8,-24,48.2 +-3,48.7,-24.4,49.1 +-3,49.6,-24.9,50 +-3,50.5,-25.3,50.9 +-3,51.4,-25.8,51.8 +-3,52.3,-26.2,52.7 +-3,53.2,-26.7,53.6 +-3,54.1,-27.1,54.5 +-3,55,-27.6,55.5 +-3,55.9,-28,56.4 +-3,56.8,-28.5,57.3 +-3,57.7,-28.9,58.2 +-3,58.6,-29.4,59.1 +-3,59.5,-29.8,60 +-3,60.5,-30.3,60.9 +-3,61.4,-30.8,61.8 +-3,62.3,-31.2,62.7 +-3,63.2,-31.7,63.6 +-3,64.1,-32.1,64.5 +-3,65,-32.6,65.5 +-3,65.9,-33,66.4 +-3,66.8,-33.5,67.3 +-3,67.7,-33.9,68.2 +-3,68.6,-34.4,69.1 +-3,69.5,-34.8,70 +-3,70.4,-35.3,70.9 +-3,71.3,-35.7,71.8 +-3,72.2,-36.2,72.7 +-3,73.1,-36.6,73.6 +-3,74,-37.1,74.5 +-3,74.9,-37.5,75.5 +-3,75.8,-38,76.4 +-3,76.7,-38.4,77.3 +-3,77.6,-38.9,78.2 +-3,78.5,-39.3,79.1 +-3,79.4,-39.8,80 +-3,80.3,-40.3,80.9 +-3,81.2,-40.7,81.8 +-3,82.1,-41.2,82.7 +-3,83,-41.6,83.6 +-3,83.9,-42.1,84.5 +-3,84.8,-42.5,85.5 +-3,85.7,-43,86.4 +-3,86.6,-43.4,87.3 +-3,87.5,-43.9,88.2 +-3,88.4,-44.3,89.1 +-3,89.3,-44.8,90 +-3,90.2,-45.2,0 +-3,91.1,-45.7,0 +-3,92,-46.1,0 +-3,92.9,-46.6,0 +-3,93.8,-47,0 +-3,94.7,-47.5,0 +-3,95.6,-47.9,0 +-3,96.5,-48.4,0 +-3,97.4,-48.8,0 +-3,98.3,-49.3,0 +-3,99.2,-49.7,0 +-3,100.2,-50.2,0 +-3,101.1,-50.7,0 +-3,102,-51.1,0 +-3,102.9,-51.6,0 +-3,103.8,-52,0 +-3,104.7,-52.5,0 +-3,105.6,-52.9,0 +-3,106.5,-53.4,0 +-3,107.4,-53.8,0 +-3,108.3,-54.3,0 +-3,109.2,-54.7,0 +-3,110.1,-55.2,0 +-3,111,-55.6,0 +-3,111.9,-56.1,0 +-3,112.8,-56.5,0 +-3,113.7,-57,0 +-3,114.6,-57.4,0 +-3,115.5,-57.9,0 +-3,116.4,-58.3,0 +-3,117.3,-58.8,0 +-3,118.2,-59.2,0 +-3,119.1,-59.7,0 +-3,120,-60.2,0 +-3,120.9,-60.6,0 +-3,121.8,-61.1,0 +-3,122.7,-61.5,0 +-3,123.6,-62,0 +-3,124.5,-62.4,0 +-3,125.4,-62.9,0 +-3,126.3,-63.3,0 +-3,127.2,-63.8,0 +-3,128.1,-64.2,0 +-3,129,-64.7,0 +-3,129.9,-65.1,0 +-3,130.8,-65.6,0 +-3,131.7,-66,0 +-3,132.6,-66.5,0 +-3,133.5,-66.9,0 +-3,134.4,-67.4,0 +-3,135.3,-67.8,0 +-3,136.2,-68.3,0 +-3,137.1,-68.7,0 +-3,138,-69.2,0 +-3,138.9,-69.6,0 +-3,139.8,-70.1,0 +-3,140.8,-70.6,0 +-3,141.7,-71,0 +-3,142.6,-71.5,0 +-3,143.5,-71.9,0 +-3,144.4,-72.4,0 +-3,145.3,-72.8,0 +-3,146.2,-73.3,0 +-3,147.1,-73.7,0 +-3,148,-74.2,0 +-3,148.9,-74.6,0 +-3,149.8,-75.1,0 +-3,150.7,-75.5,0 +-3,151.6,-76,0 +-3,152.5,-76.4,0 +-3,153.4,-76.9,0 +-3,154.3,-77.3,0 +-3,155.2,-77.8,0 +-3,156.1,-78.2,0 +-3,157,-78.7,0 +-3,157.9,-79.1,0 +-3,158.8,-79.6,0 +-3,159.7,-80.1,0 +-3,160.6,-80.5,0 +-3,161.5,-81,0 +-3,162.4,-81.4,0 +-3,163.3,-81.9,0 +-3,164.2,-82.3,0 +-3,165.1,-82.8,0 +-3,166,-83.2,0 +-3,166.9,-83.7,0 +-3,167.8,-84.1,0 +-3,168.7,-84.6,0 +-3,169.6,-85,0 +-3,170.5,-85.5,0 +-3,171.4,-85.9,0 +-3,172.3,-86.4,0 +-3,173.2,-86.8,0 +-3,174.1,-87.3,0 +-3,175,-87.7,0 +-3,175.9,-88.2,0 +-3,176.8,-88.6,0 +-3,177.7,-89.1,0 +-3,178.6,-89.5,0 +-3,179.5,-90,0 +-3,180.5,0,0 +-3,181.4,0,0 +-3,182.3,0,0 +-3,183.2,0,0 +-3,184.1,0,0 +-3,185,0,0 +-3,185.9,0,0 +-3,186.8,0,0 +-3,187.7,0,0 +-3,188.6,0,0 +-3,189.5,0,0 +-3,190.4,0,0 +-3,191.3,0,0 +-3,192.2,0,0 +-3,193.1,0,0 +-3,194,0,0 +-3,194.9,0,0 +-3,195.8,0,0 +-3,196.7,0,0 +-3,197.6,0,0 +-3,198.5,0,0 +-3,199.4,0,0 +-3,200.3,0,0 +-3,201.2,0,0 +-3,202.1,0,0 +-3,203,0,0 +-3,203.9,0,0 +-3,204.8,0,0 +-3,205.7,0,0 +-3,206.6,0,0 +-3,207.5,0,0 +-3,208.4,0,0 +-3,209.3,0,0 +-3,210.2,0,0 +-3,211.1,0,0 +-3,212,0,0 +-3,212.9,0,0 +-3,213.8,0,0 +-3,214.7,0,0 +-3,215.6,0,0 +-3,216.5,0,0 +-3,217.4,0,0 +-3,218.3,0,0 +-3,219.2,0,0 +-3,220.2,0,0 +-3,221.1,0,0 +-3,222,0,0 +-3,222.9,0,0 +-3,223.8,0,0 +-3,224.7,0,0 +-3,225.6,0,0 +-3,226.5,0,0 +-3,227.4,0,0 +-3,228.3,0,0 +-3,229.2,0,0 +-3,230.1,0,0 +-3,231,0,0 +-3,231.9,0,0 +-3,232.8,0,0 +-3,233.7,0,0 +-3,234.6,0,0 +-3,235.5,0,0 +-3,236.4,0,0 +-3,237.3,0,0 +-3,238.2,0,0 +-3,239.1,0,0 +-3,240,0,0 +-3,240.9,0,0 +-3,241.8,0,0 +-3,242.7,0,0 +-3,243.6,0,0 +-3,244.5,0,0 +-3,245.4,0,0 +-3,246.3,0,0 +-3,247.2,0,0 +-3,248.1,0,0 +-3,249,0,0 +-3,249.9,0,0 +-3,250.8,0,0 +-3,251.7,0,0 +-3,252.6,0,0 +-3,253.5,0,0 +-3,254.4,0,0 +-3,255.3,0,0 +-3,256.2,0,0 +-3,257.1,0,0 +-3,258,0,0 +-3,258.9,0,0 +-3,259.8,0,0 +-3,260.8,0,0 +-3,261.7,0,0 +-3,262.6,0,0 +-3,263.5,0,0 +-3,264.4,0,0 +-3,265.3,0,0 +-3,266.2,0,0 +-3,267.1,0,0 +-3,268,0,0 +-3,268.9,0,0 +-3,269.8,0,0 +-3,270.7,0,0 +-3,271.6,0,0 +-3,272.5,0,0 +-3,273.4,0,0 +-3,274.3,0,0 +-3,275.2,0,0 +-3,276.1,0,0 +-3,277,0,0 +-3,277.9,0,0 +-3,278.8,0,0 +-3,279.7,0,0 +-3,280.6,0,0 +-3,281.5,0,0 +-3,282.4,0,0 +-3,283.3,0,0 +-3,284.2,0,0 +-3,285.1,0,0 +-3,286,0,0 +-3,286.9,0,0 +-3,287.8,0,0 +-3,288.7,0,0 +-3,289.6,0,0 +-3,290.5,0,0 +-3,291.4,0,0 +-3,292.3,0,0 +-3,293.2,0,0 +-3,294.1,0,0 +-3,295,0,0 +-3,295.9,0,0 +-3,296.8,0,0 +-3,297.7,0,0 +-3,298.6,0,0 +-3,299.5,0,0 +-3,300.5,0,0 +-3,301.4,0,0 +-3,302.3,0,0 +-3,303.2,0,0 +-3,304.1,0,0 +-3,305,0,0 +-3,305.9,0,0 +-3,306.8,0,0 +-3,307.7,0,0 +-3,308.6,0,0 +-3,309.5,0,0 +-3,310.4,0,0 +-3,311.3,0,0 +-3,312.2,0,0 +-3,313.1,0,0 +-3,314,0,0 +-3,314.9,0,0 +-3,315.8,0,0 +-3,316.7,0,0 +-3,317.6,0,0 +-3,318.5,0,0 +-3,319.4,0,0 +-3,320.3,0,0 +-3,321.2,0,0 +-3,322.1,0,0 +-3,323,0,0 +-3,323.9,0,0 +-3,324.8,0,0 +-3,325.7,0,0 +-3,326.6,0,0 +-3,327.5,0,0 +-3,328.4,0,0 +-3,329.3,0,0 +-3,330.2,0,0 +-3,331.1,0,0 +-3,332,0,0 +-3,332.9,0,0 +-3,333.8,0,0 +-3,334.7,0,0 +-3,335.6,0,0 +-3,336.5,0,0 +-3,337.4,0,0 +-3,338.3,0,0 +-3,339.2,0,0 +-3,340.2,0,0 +-3,341.1,0,0 +-3,342,0,0 +-3,342.9,0,0 +-3,343.8,0,0 +-3,344.7,0,0 +-3,345.6,0,0 +-3,346.5,0,0 +-3,347.4,0,0 +-3,348.3,0,0 +-3,349.2,0,0 +-3,350.1,0,0 +-3,351,0,0 +-3,351.9,0,0 +-3,352.8,0,0 +-3,353.7,0,0 +-3,354.6,0,0 +-3,355.5,0,0 +-3,356.4,0,0 +-3,357.3,0,0 +-3,358.2,0,0 +-3,359.1,0,0 +-3,360,0,0 +-3,360,0,0 +-3,359.1,0,0 +-3,358.2,0,0 +-3,357.3,0,0 +-3,356.4,0,0 +-3,355.5,0,0 +-3,354.6,0,0 +-3,353.7,0,0 +-3,352.8,0,0 +-3,351.9,0,0 +-3,351,0,0 +-3,350.1,0,0 +-3,349.2,0,0 +-3,348.3,0,0 +-3,347.4,0,0 +-3,346.5,0,0 +-3,345.6,0,0 +-3,344.7,0,0 +-3,343.8,0,0 +-3,342.9,0,0 +-3,342,0,0 +-3,341.1,0,0 +-3,340.2,0,0 +-3,339.2,0,0 +-3,338.3,0,0 +-3,337.4,0,0 +-3,336.5,0,0 +-3,335.6,0,0 +-3,334.7,0,0 +-3,333.8,0,0 +-3,332.9,0,0 +-3,332,0,0 +-3,331.1,0,0 +-3,330.2,0,0 +-3,329.3,0,0 +-3,328.4,0,0 +-3,327.5,0,0 +-3,326.6,0,0 +-3,325.7,0,0 +-3,324.8,0,0 +-3,323.9,0,0 +-3,323,0,0 +-3,322.1,0,0 +-3,321.2,0,0 +-3,320.3,0,0 +-3,319.4,0,0 +-3,318.5,0,0 +-3,317.6,0,0 +-3,316.7,0,0 +-3,315.8,0,0 +-3,314.9,0,0 +-3,314,0,0 +-3,313.1,0,0 +-3,312.2,0,0 +-3,311.3,0,0 +-3,310.4,0,0 +-3,309.5,0,0 +-3,308.6,0,0 +-3,307.7,0,0 +-3,306.8,0,0 +-3,305.9,0,0 +-3,305,0,0 +-3,304.1,0,0 +-3,303.2,0,0 +-3,302.3,0,0 +-3,301.4,0,0 +-3,300.5,0,0 +-3,299.5,0,0 +-3,298.6,0,0 +-3,297.7,0,0 +-3,296.8,0,0 +-3,295.9,0,0 +-3,295,0,0 +-3,294.1,0,0 +-3,293.2,0,0 +-3,292.3,0,0 +-3,291.4,0,0 +-3,290.5,0,0 +-3,289.6,0,0 +-3,288.7,0,0 +-3,287.8,0,0 +-3,286.9,0,0 +-3,286,0,0 +-3,285.1,0,0 +-3,284.2,0,0 +-3,283.3,0,0 +-3,282.4,0,0 +-3,281.5,0,0 +-3,280.6,0,0 +-3,279.7,0,0 +-3,278.8,0,0 +-3,277.9,0,0 +-3,277,0,0 +-3,276.1,0,0 +-3,275.2,0,0 +-3,274.3,0,0 +-3,273.4,0,0 +-3,272.5,0,0 +-3,271.6,0,0 +-3,270.7,0,0 +-3,269.8,0,0 +-3,268.9,0,0 +-3,268,0,0 +-3,267.1,0,0 +-3,266.2,0,0 +-3,265.3,0,0 +-3,264.4,0,0 +-3,263.5,0,0 +-3,262.6,0,0 +-3,261.7,0,0 +-3,260.8,0,0 +-3,259.8,0,0 +-3,258.9,0,0 +-3,258,0,0 +-3,257.1,0,0 +-3,256.2,0,0 +-3,255.3,0,0 +-3,254.4,0,0 +-3,253.5,0,0 +-3,252.6,0,0 +-3,251.7,0,0 +-3,250.8,0,0 +-3,249.9,0,0 +-3,249,0,0 +-3,248.1,0,0 +-3,247.2,0,0 +-3,246.3,0,0 +-3,245.4,0,0 +-3,244.5,0,0 +-3,243.6,0,0 +-3,242.7,0,0 +-3,241.8,0,0 +-3,240.9,0,0 +-3,240,0,0 +-3,239.1,0,0 +-3,238.2,0,0 +-3,237.3,0,0 +-3,236.4,0,0 +-3,235.5,0,0 +-3,234.6,0,0 +-3,233.7,0,0 +-3,232.8,0,0 +-3,231.9,0,0 +-3,231,0,0 +-3,230.1,0,0 +-3,229.2,0,0 +-3,228.3,0,0 +-3,227.4,0,0 +-3,226.5,0,0 +-3,225.6,0,0 +-3,224.7,0,0 +-3,223.8,0,0 +-3,222.9,0,0 +-3,222,0,0 +-3,221.1,0,0 +-3,220.2,0,0 +-3,219.2,0,0 +-3,218.3,0,0 +-3,217.4,0,0 +-3,216.5,0,0 +-3,215.6,0,0 +-3,214.7,0,0 +-3,213.8,0,0 +-3,212.9,0,0 +-3,212,0,0 +-3,211.1,0,0 +-3,210.2,0,0 +-3,209.3,0,0 +-3,208.4,0,0 +-3,207.5,0,0 +-3,206.6,0,0 +-3,205.7,0,0 +-3,204.8,0,0 +-3,203.9,0,0 +-3,203,0,0 +-3,202.1,0,0 +-3,201.2,0,0 +-3,200.3,0,0 +-3,199.4,0,0 +-3,198.5,0,0 +-3,197.6,0,0 +-3,196.7,0,0 +-3,195.8,0,0 +-3,194.9,0,0 +-3,194,0,0 +-3,193.1,0,0 +-3,192.2,0,0 +-3,191.3,0,0 +-3,190.4,0,0 +-3,189.5,0,0 +-3,188.6,0,0 +-3,187.7,0,0 +-3,186.8,0,0 +-3,185.9,0,0 +-3,185,0,0 +-3,184.1,0,0 +-3,183.2,0,0 +-3,182.3,0,0 +-3,181.4,0,0 +-3,180.5,0,0 +-3,179.5,-90,0 +-3,178.6,-89.5,0 +-3,177.7,-89.1,0 +-3,176.8,-88.6,0 +-3,175.9,-88.2,0 +-3,175,-87.7,0 +-3,174.1,-87.3,0 +-3,173.2,-86.8,0 +-3,172.3,-86.4,0 +-3,171.4,-85.9,0 +-3,170.5,-85.5,0 +-3,169.6,-85,0 +-3,168.7,-84.6,0 +-3,167.8,-84.1,0 +-3,166.9,-83.7,0 +-3,166,-83.2,0 +-3,165.1,-82.8,0 +-3,164.2,-82.3,0 +-3,163.3,-81.9,0 +-3,162.4,-81.4,0 +-3,161.5,-81,0 +-3,160.6,-80.5,0 +-3,159.7,-80.1,0 +-3,158.8,-79.6,0 +-3,157.9,-79.1,0 +-3,157,-78.7,0 +-3,156.1,-78.2,0 +-3,155.2,-77.8,0 +-3,154.3,-77.3,0 +-3,153.4,-76.9,0 +-3,152.5,-76.4,0 +-3,151.6,-76,0 +-3,150.7,-75.5,0 +-3,149.8,-75.1,0 +-3,148.9,-74.6,0 +-3,148,-74.2,0 +-3,147.1,-73.7,0 +-3,146.2,-73.3,0 +-3,145.3,-72.8,0 +-3,144.4,-72.4,0 +-3,143.5,-71.9,0 +-3,142.6,-71.5,0 +-3,141.7,-71,0 +-3,140.8,-70.6,0 +-3,139.8,-70.1,0 +-3,138.9,-69.6,0 +-3,138,-69.2,0 +-3,137.1,-68.7,0 +-3,136.2,-68.3,0 +-3,135.3,-67.8,0 +-3,134.4,-67.4,0 +-3,133.5,-66.9,0 +-3,132.6,-66.5,0 +-3,131.7,-66,0 +-3,130.8,-65.6,0 +-3,129.9,-65.1,0 +-3,129,-64.7,0 +-3,128.1,-64.2,0 +-3,127.2,-63.8,0 +-3,126.3,-63.3,0 +-3,125.4,-62.9,0 +-3,124.5,-62.4,0 +-3,123.6,-62,0 +-3,122.7,-61.5,0 +-3,121.8,-61.1,0 +-3,120.9,-60.6,0 +-3,120,-60.2,0 +-3,119.1,-59.7,0 +-3,118.2,-59.2,0 +-3,117.3,-58.8,0 +-3,116.4,-58.3,0 +-3,115.5,-57.9,0 +-3,114.6,-57.4,0 +-3,113.7,-57,0 +-3,112.8,-56.5,0 +-3,111.9,-56.1,0 +-3,111,-55.6,0 +-3,110.1,-55.2,0 +-3,109.2,-54.7,0 +-3,108.3,-54.3,0 +-3,107.4,-53.8,0 +-3,106.5,-53.4,0 +-3,105.6,-52.9,0 +-3,104.7,-52.5,0 +-3,103.8,-52,0 +-3,102.9,-51.6,0 +-3,102,-51.1,0 +-3,101.1,-50.7,0 +-3,100.2,-50.2,0 +-3,99.2,-49.7,0 +-3,98.3,-49.3,0 +-3,97.4,-48.8,0 +-3,96.5,-48.4,0 +-3,95.6,-47.9,0 +-3,94.7,-47.5,0 +-3,93.8,-47,0 +-3,92.9,-46.6,0 +-3,92,-46.1,0 +-3,91.1,-45.7,0 +-3,90.2,-45.2,0 +-3,89.3,-44.8,90 +-3,88.4,-44.3,89.1 +-3,87.5,-43.9,88.2 +-3,86.6,-43.4,87.3 +-3,85.7,-43,86.4 +-3,84.8,-42.5,85.5 +-3,83.9,-42.1,84.5 +-3,83,-41.6,83.6 +-3,82.1,-41.2,82.7 +-3,81.2,-40.7,81.8 +-3,80.3,-40.3,80.9 +-3,79.4,-39.8,80 +-3,78.5,-39.3,79.1 +-3,77.6,-38.9,78.2 +-3,76.7,-38.4,77.3 +-3,75.8,-38,76.4 +-3,74.9,-37.5,75.5 +-3,74,-37.1,74.5 +-3,73.1,-36.6,73.6 +-3,72.2,-36.2,72.7 +-3,71.3,-35.7,71.8 +-3,70.4,-35.3,70.9 +-3,69.5,-34.8,70 +-3,68.6,-34.4,69.1 +-3,67.7,-33.9,68.2 +-3,66.8,-33.5,67.3 +-3,65.9,-33,66.4 +-3,65,-32.6,65.5 +-3,64.1,-32.1,64.5 +-3,63.2,-31.7,63.6 +-3,62.3,-31.2,62.7 +-3,61.4,-30.8,61.8 +-3,60.5,-30.3,60.9 +-3,59.5,-29.8,60 +-3,58.6,-29.4,59.1 +-3,57.7,-28.9,58.2 +-3,56.8,-28.5,57.3 +-3,55.9,-28,56.4 +-3,55,-27.6,55.5 +-3,54.1,-27.1,54.5 +-3,53.2,-26.7,53.6 +-3,52.3,-26.2,52.7 +-3,51.4,-25.8,51.8 +-3,50.5,-25.3,50.9 +-3,49.6,-24.9,50 +-3,48.7,-24.4,49.1 +-3,47.8,-24,48.2 +-3,46.9,-23.5,47.3 +-3,46,-23.1,46.4 +-3,45.1,-22.6,45.5 +-3,44.2,-22.2,44.5 +-3,43.3,-21.7,43.6 +-3,42.4,-21.3,42.7 +-3,41.5,-20.8,41.8 +-3,40.6,-20.4,40.9 +-3,39.7,-19.9,40 +-3,38.8,-19.4,39.1 +-3,37.9,-19,38.2 +-3,37,-18.5,37.3 +-3,36.1,-18.1,36.4 +-3,35.2,-17.6,35.5 +-3,34.3,-17.2,34.5 +-3,33.4,-16.7,33.6 +-3,32.5,-16.3,32.7 +-3,31.6,-15.8,31.8 +-3,30.7,-15.4,30.9 +-3,29.8,-14.9,30 +-3,28.9,-14.5,29.1 +-3,28,-14,28.2 +-3,27.1,-13.6,27.3 +-3,26.2,-13.1,26.4 +-3,25.3,-12.7,25.5 +-3,24.4,-12.2,24.5 +-3,23.5,-11.8,23.6 +-3,22.6,-11.3,22.7 +-3,21.7,-10.9,21.8 +-3,20.8,-10.4,20.9 +-3,19.8,-9.9,20 +-3,18.9,-9.5,19.1 +-3,18,-9,18.2 +-3,17.1,-8.6,17.3 +-3,16.2,-8.1,16.4 +-3,15.3,-7.7,15.5 +-3,14.4,-7.2,14.5 +-3,13.5,-6.8,13.6 +-3,12.6,-6.3,12.7 +-3,11.7,-5.9,11.8 +-3,10.8,-5.4,10.9 +-3,9.9,-5,10 +-3,9,-4.5,9.1 +-3,8.1,-4.1,8.2 +-3,7.2,-3.6,7.3 +-3,6.3,-3.2,6.4 +-3,5.4,-2.7,5.5 +-3,4.5,-2.3,4.5 +-3,3.6,-1.8,3.6 +-3,2.7,-1.4,2.7 +-3,1.8,-0.9,1.8 +-3,0.9,-0.5,0.9 +-3,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +0.9,0,0,0.3 +0.9,0,0,0.3 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.8,0,0,0.5 +0.8,0,0,0.5 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.5,0,0,0.8 +0.5,0,0,0.8 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.3,0,0,0.9 +0.3,0,0,0.9 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,0.9 +0.3,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.8 +0.5,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.7,0,0,0.8 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.8,0,0,0.7 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.5 +0.8,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.3 +0.9,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0 +-3,0,0,0 +-3,0.9,-0.5,0.9 +-3,1.8,-0.9,1.8 +-3,2.7,-1.4,2.7 +-3,3.6,-1.8,3.6 +-3,4.5,-2.3,4.5 +-3,5.4,-2.7,5.5 +-3,6.3,-3.2,6.4 +-3,7.2,-3.6,7.3 +-3,8.1,-4.1,8.2 +-3,9,-4.5,9.1 +-3,9.9,-5,10 +-3,10.8,-5.4,10.9 +-3,11.7,-5.9,11.8 +-3,12.6,-6.3,12.7 +-3,13.5,-6.8,13.6 +-3,14.4,-7.2,14.5 +-3,15.3,-7.7,15.5 +-3,16.2,-8.1,16.4 +-3,17.1,-8.6,17.3 +-3,18,-9,18.2 +-3,18.9,-9.5,19.1 +-3,19.8,-9.9,20 +-3,20.8,-10.4,20.9 +-3,21.7,-10.9,21.8 +-3,22.6,-11.3,22.7 +-3,23.5,-11.8,23.6 +-3,24.4,-12.2,24.5 +-3,25.3,-12.7,25.5 +-3,26.2,-13.1,26.4 +-3,27.1,-13.6,27.3 +-3,28,-14,28.2 +-3,28.9,-14.5,29.1 +-3,29.8,-14.9,30 +-3,30.7,-15.4,30.9 +-3,31.6,-15.8,31.8 +-3,32.5,-16.3,32.7 +-3,33.4,-16.7,33.6 +-3,34.3,-17.2,34.5 +-3,35.2,-17.6,35.5 +-3,36.1,-18.1,36.4 +-3,37,-18.5,37.3 +-3,37.9,-19,38.2 +-3,38.8,-19.4,39.1 +-3,39.7,-19.9,40 +-3,40.6,-20.4,40.9 +-3,41.5,-20.8,41.8 +-3,42.4,-21.3,42.7 +-3,43.3,-21.7,43.6 +-3,44.2,-22.2,44.5 +-3,45.1,-22.6,45.5 +-3,46,-23.1,46.4 +-3,46.9,-23.5,47.3 +-3,47.8,-24,48.2 +-3,48.7,-24.4,49.1 +-3,49.6,-24.9,50 +-3,50.5,-25.3,50.9 +-3,51.4,-25.8,51.8 +-3,52.3,-26.2,52.7 +-3,53.2,-26.7,53.6 +-3,54.1,-27.1,54.5 +-3,55,-27.6,55.5 +-3,55.9,-28,56.4 +-3,56.8,-28.5,57.3 +-3,57.7,-28.9,58.2 +-3,58.6,-29.4,59.1 +-3,59.5,-29.8,60 +-3,60.5,-30.3,60.9 +-3,61.4,-30.8,61.8 +-3,62.3,-31.2,62.7 +-3,63.2,-31.7,63.6 +-3,64.1,-32.1,64.5 +-3,65,-32.6,65.5 +-3,65.9,-33,66.4 +-3,66.8,-33.5,67.3 +-3,67.7,-33.9,68.2 +-3,68.6,-34.4,69.1 +-3,69.5,-34.8,70 +-3,70.4,-35.3,70.9 +-3,71.3,-35.7,71.8 +-3,72.2,-36.2,72.7 +-3,73.1,-36.6,73.6 +-3,74,-37.1,74.5 +-3,74.9,-37.5,75.5 +-3,75.8,-38,76.4 +-3,76.7,-38.4,77.3 +-3,77.6,-38.9,78.2 +-3,78.5,-39.3,79.1 +-3,79.4,-39.8,80 +-3,80.3,-40.3,80.9 +-3,81.2,-40.7,81.8 +-3,82.1,-41.2,82.7 +-3,83,-41.6,83.6 +-3,83.9,-42.1,84.5 +-3,84.8,-42.5,85.5 +-3,85.7,-43,86.4 +-3,86.6,-43.4,87.3 +-3,87.5,-43.9,88.2 +-3,88.4,-44.3,89.1 +-3,89.3,-44.8,90 +-3,90.2,-45.2,0 +-3,91.1,-45.7,0 +-3,92,-46.1,0 +-3,92.9,-46.6,0 +-3,93.8,-47,0 +-3,94.7,-47.5,0 +-3,95.6,-47.9,0 +-3,96.5,-48.4,0 +-3,97.4,-48.8,0 +-3,98.3,-49.3,0 +-3,99.2,-49.7,0 +-3,100.2,-50.2,0 +-3,101.1,-50.7,0 +-3,102,-51.1,0 +-3,102.9,-51.6,0 +-3,103.8,-52,0 +-3,104.7,-52.5,0 +-3,105.6,-52.9,0 +-3,106.5,-53.4,0 +-3,107.4,-53.8,0 +-3,108.3,-54.3,0 +-3,109.2,-54.7,0 +-3,110.1,-55.2,0 +-3,111,-55.6,0 +-3,111.9,-56.1,0 +-3,112.8,-56.5,0 +-3,113.7,-57,0 +-3,114.6,-57.4,0 +-3,115.5,-57.9,0 +-3,116.4,-58.3,0 +-3,117.3,-58.8,0 +-3,118.2,-59.2,0 +-3,119.1,-59.7,0 +-3,120,-60.2,0 +-3,120.9,-60.6,0 +-3,121.8,-61.1,0 +-3,122.7,-61.5,0 +-3,123.6,-62,0 +-3,124.5,-62.4,0 +-3,125.4,-62.9,0 +-3,126.3,-63.3,0 +-3,127.2,-63.8,0 +-3,128.1,-64.2,0 +-3,129,-64.7,0 +-3,129.9,-65.1,0 +-3,130.8,-65.6,0 +-3,131.7,-66,0 +-3,132.6,-66.5,0 +-3,133.5,-66.9,0 +-3,134.4,-67.4,0 +-3,135.3,-67.8,0 +-3,136.2,-68.3,0 +-3,137.1,-68.7,0 +-3,138,-69.2,0 +-3,138.9,-69.6,0 +-3,139.8,-70.1,0 +-3,140.8,-70.6,0 +-3,141.7,-71,0 +-3,142.6,-71.5,0 +-3,143.5,-71.9,0 +-3,144.4,-72.4,0 +-3,145.3,-72.8,0 +-3,146.2,-73.3,0 +-3,147.1,-73.7,0 +-3,148,-74.2,0 +-3,148.9,-74.6,0 +-3,149.8,-75.1,0 +-3,150.7,-75.5,0 +-3,151.6,-76,0 +-3,152.5,-76.4,0 +-3,153.4,-76.9,0 +-3,154.3,-77.3,0 +-3,155.2,-77.8,0 +-3,156.1,-78.2,0 +-3,157,-78.7,0 +-3,157.9,-79.1,0 +-3,158.8,-79.6,0 +-3,159.7,-80.1,0 +-3,160.6,-80.5,0 +-3,161.5,-81,0 +-3,162.4,-81.4,0 +-3,163.3,-81.9,0 +-3,164.2,-82.3,0 +-3,165.1,-82.8,0 +-3,166,-83.2,0 +-3,166.9,-83.7,0 +-3,167.8,-84.1,0 +-3,168.7,-84.6,0 +-3,169.6,-85,0 +-3,170.5,-85.5,0 +-3,171.4,-85.9,0 +-3,172.3,-86.4,0 +-3,173.2,-86.8,0 +-3,174.1,-87.3,0 +-3,175,-87.7,0 +-3,175.9,-88.2,0 +-3,176.8,-88.6,0 +-3,177.7,-89.1,0 +-3,178.6,-89.5,0 +-3,179.5,-90,0 +-3,180.5,0,0 +-3,181.4,0,0 +-3,182.3,0,0 +-3,183.2,0,0 +-3,184.1,0,0 +-3,185,0,0 +-3,185.9,0,0 +-3,186.8,0,0 +-3,187.7,0,0 +-3,188.6,0,0 +-3,189.5,0,0 +-3,190.4,0,0 +-3,191.3,0,0 +-3,192.2,0,0 +-3,193.1,0,0 +-3,194,0,0 +-3,194.9,0,0 +-3,195.8,0,0 +-3,196.7,0,0 +-3,197.6,0,0 +-3,198.5,0,0 +-3,199.4,0,0 +-3,200.3,0,0 +-3,201.2,0,0 +-3,202.1,0,0 +-3,203,0,0 +-3,203.9,0,0 +-3,204.8,0,0 +-3,205.7,0,0 +-3,206.6,0,0 +-3,207.5,0,0 +-3,208.4,0,0 +-3,209.3,0,0 +-3,210.2,0,0 +-3,211.1,0,0 +-3,212,0,0 +-3,212.9,0,0 +-3,213.8,0,0 +-3,214.7,0,0 +-3,215.6,0,0 +-3,216.5,0,0 +-3,217.4,0,0 +-3,218.3,0,0 +-3,219.2,0,0 +-3,220.2,0,0 +-3,221.1,0,0 +-3,222,0,0 +-3,222.9,0,0 +-3,223.8,0,0 +-3,224.7,0,0 +-3,225.6,0,0 +-3,226.5,0,0 +-3,227.4,0,0 +-3,228.3,0,0 +-3,229.2,0,0 +-3,230.1,0,0 +-3,231,0,0 +-3,231.9,0,0 +-3,232.8,0,0 +-3,233.7,0,0 +-3,234.6,0,0 +-3,235.5,0,0 +-3,236.4,0,0 +-3,237.3,0,0 +-3,238.2,0,0 +-3,239.1,0,0 +-3,240,0,0 +-3,240.9,0,0 +-3,241.8,0,0 +-3,242.7,0,0 +-3,243.6,0,0 +-3,244.5,0,0 +-3,245.4,0,0 +-3,246.3,0,0 +-3,247.2,0,0 +-3,248.1,0,0 +-3,249,0,0 +-3,249.9,0,0 +-3,250.8,0,0 +-3,251.7,0,0 +-3,252.6,0,0 +-3,253.5,0,0 +-3,254.4,0,0 +-3,255.3,0,0 +-3,256.2,0,0 +-3,257.1,0,0 +-3,258,0,0 +-3,258.9,0,0 +-3,259.8,0,0 +-3,260.8,0,0 +-3,261.7,0,0 +-3,262.6,0,0 +-3,263.5,0,0 +-3,264.4,0,0 +-3,265.3,0,0 +-3,266.2,0,0 +-3,267.1,0,0 +-3,268,0,0 +-3,268.9,0,0 +-3,269.8,0,0 +-3,270.7,0,0 +-3,271.6,0,0 +-3,272.5,0,0 +-3,273.4,0,0 +-3,274.3,0,0 +-3,275.2,0,0 +-3,276.1,0,0 +-3,277,0,0 +-3,277.9,0,0 +-3,278.8,0,0 +-3,279.7,0,0 +-3,280.6,0,0 +-3,281.5,0,0 +-3,282.4,0,0 +-3,283.3,0,0 +-3,284.2,0,0 +-3,285.1,0,0 +-3,286,0,0 +-3,286.9,0,0 +-3,287.8,0,0 +-3,288.7,0,0 +-3,289.6,0,0 +-3,290.5,0,0 +-3,291.4,0,0 +-3,292.3,0,0 +-3,293.2,0,0 +-3,294.1,0,0 +-3,295,0,0 +-3,295.9,0,0 +-3,296.8,0,0 +-3,297.7,0,0 +-3,298.6,0,0 +-3,299.5,0,0 +-3,300.5,0,0 +-3,301.4,0,0 +-3,302.3,0,0 +-3,303.2,0,0 +-3,304.1,0,0 +-3,305,0,0 +-3,305.9,0,0 +-3,306.8,0,0 +-3,307.7,0,0 +-3,308.6,0,0 +-3,309.5,0,0 +-3,310.4,0,0 +-3,311.3,0,0 +-3,312.2,0,0 +-3,313.1,0,0 +-3,314,0,0 +-3,314.9,0,0 +-3,315.8,0,0 +-3,316.7,0,0 +-3,317.6,0,0 +-3,318.5,0,0 +-3,319.4,0,0 +-3,320.3,0,0 +-3,321.2,0,0 +-3,322.1,0,0 +-3,323,0,0 +-3,323.9,0,0 +-3,324.8,0,0 +-3,325.7,0,0 +-3,326.6,0,0 +-3,327.5,0,0 +-3,328.4,0,0 +-3,329.3,0,0 +-3,330.2,0,0 +-3,331.1,0,0 +-3,332,0,0 +-3,332.9,0,0 +-3,333.8,0,0 +-3,334.7,0,0 +-3,335.6,0,0 +-3,336.5,0,0 +-3,337.4,0,0 +-3,338.3,0,0 +-3,339.2,0,0 +-3,340.2,0,0 +-3,341.1,0,0 +-3,342,0,0 +-3,342.9,0,0 +-3,343.8,0,0 +-3,344.7,0,0 +-3,345.6,0,0 +-3,346.5,0,0 +-3,347.4,0,0 +-3,348.3,0,0 +-3,349.2,0,0 +-3,350.1,0,0 +-3,351,0,0 +-3,351.9,0,0 +-3,352.8,0,0 +-3,353.7,0,0 +-3,354.6,0,0 +-3,355.5,0,0 +-3,356.4,0,0 +-3,357.3,0,0 +-3,358.2,0,0 +-3,359.1,0,0 +-3,360,0,0 +-3,360,0,0 +-3,359.1,0,0 +-3,358.2,0,0 +-3,357.3,0,0 +-3,356.4,0,0 +-3,355.5,0,0 +-3,354.6,0,0 +-3,353.7,0,0 +-3,352.8,0,0 +-3,351.9,0,0 +-3,351,0,0 +-3,350.1,0,0 +-3,349.2,0,0 +-3,348.3,0,0 +-3,347.4,0,0 +-3,346.5,0,0 +-3,345.6,0,0 +-3,344.7,0,0 +-3,343.8,0,0 +-3,342.9,0,0 +-3,342,0,0 +-3,341.1,0,0 +-3,340.2,0,0 +-3,339.2,0,0 +-3,338.3,0,0 +-3,337.4,0,0 +-3,336.5,0,0 +-3,335.6,0,0 +-3,334.7,0,0 +-3,333.8,0,0 +-3,332.9,0,0 +-3,332,0,0 +-3,331.1,0,0 +-3,330.2,0,0 +-3,329.3,0,0 +-3,328.4,0,0 +-3,327.5,0,0 +-3,326.6,0,0 +-3,325.7,0,0 +-3,324.8,0,0 +-3,323.9,0,0 +-3,323,0,0 +-3,322.1,0,0 +-3,321.2,0,0 +-3,320.3,0,0 +-3,319.4,0,0 +-3,318.5,0,0 +-3,317.6,0,0 +-3,316.7,0,0 +-3,315.8,0,0 +-3,314.9,0,0 +-3,314,0,0 +-3,313.1,0,0 +-3,312.2,0,0 +-3,311.3,0,0 +-3,310.4,0,0 +-3,309.5,0,0 +-3,308.6,0,0 +-3,307.7,0,0 +-3,306.8,0,0 +-3,305.9,0,0 +-3,305,0,0 +-3,304.1,0,0 +-3,303.2,0,0 +-3,302.3,0,0 +-3,301.4,0,0 +-3,300.5,0,0 +-3,299.5,0,0 +-3,298.6,0,0 +-3,297.7,0,0 +-3,296.8,0,0 +-3,295.9,0,0 +-3,295,0,0 +-3,294.1,0,0 +-3,293.2,0,0 +-3,292.3,0,0 +-3,291.4,0,0 +-3,290.5,0,0 +-3,289.6,0,0 +-3,288.7,0,0 +-3,287.8,0,0 +-3,286.9,0,0 +-3,286,0,0 +-3,285.1,0,0 +-3,284.2,0,0 +-3,283.3,0,0 +-3,282.4,0,0 +-3,281.5,0,0 +-3,280.6,0,0 +-3,279.7,0,0 +-3,278.8,0,0 +-3,277.9,0,0 +-3,277,0,0 +-3,276.1,0,0 +-3,275.2,0,0 +-3,274.3,0,0 +-3,273.4,0,0 +-3,272.5,0,0 +-3,271.6,0,0 +-3,270.7,0,0 +-3,269.8,0,0 +-3,268.9,0,0 +-3,268,0,0 +-3,267.1,0,0 +-3,266.2,0,0 +-3,265.3,0,0 +-3,264.4,0,0 +-3,263.5,0,0 +-3,262.6,0,0 +-3,261.7,0,0 +-3,260.8,0,0 +-3,259.8,0,0 +-3,258.9,0,0 +-3,258,0,0 +-3,257.1,0,0 +-3,256.2,0,0 +-3,255.3,0,0 +-3,254.4,0,0 +-3,253.5,0,0 +-3,252.6,0,0 +-3,251.7,0,0 +-3,250.8,0,0 +-3,249.9,0,0 +-3,249,0,0 +-3,248.1,0,0 +-3,247.2,0,0 +-3,246.3,0,0 +-3,245.4,0,0 +-3,244.5,0,0 +-3,243.6,0,0 +-3,242.7,0,0 +-3,241.8,0,0 +-3,240.9,0,0 +-3,240,0,0 +-3,239.1,0,0 +-3,238.2,0,0 +-3,237.3,0,0 +-3,236.4,0,0 +-3,235.5,0,0 +-3,234.6,0,0 +-3,233.7,0,0 +-3,232.8,0,0 +-3,231.9,0,0 +-3,231,0,0 +-3,230.1,0,0 +-3,229.2,0,0 +-3,228.3,0,0 +-3,227.4,0,0 +-3,226.5,0,0 +-3,225.6,0,0 +-3,224.7,0,0 +-3,223.8,0,0 +-3,222.9,0,0 +-3,222,0,0 +-3,221.1,0,0 +-3,220.2,0,0 +-3,219.2,0,0 +-3,218.3,0,0 +-3,217.4,0,0 +-3,216.5,0,0 +-3,215.6,0,0 +-3,214.7,0,0 +-3,213.8,0,0 +-3,212.9,0,0 +-3,212,0,0 +-3,211.1,0,0 +-3,210.2,0,0 +-3,209.3,0,0 +-3,208.4,0,0 +-3,207.5,0,0 +-3,206.6,0,0 +-3,205.7,0,0 +-3,204.8,0,0 +-3,203.9,0,0 +-3,203,0,0 +-3,202.1,0,0 +-3,201.2,0,0 +-3,200.3,0,0 +-3,199.4,0,0 +-3,198.5,0,0 +-3,197.6,0,0 +-3,196.7,0,0 +-3,195.8,0,0 +-3,194.9,0,0 +-3,194,0,0 +-3,193.1,0,0 +-3,192.2,0,0 +-3,191.3,0,0 +-3,190.4,0,0 +-3,189.5,0,0 +-3,188.6,0,0 +-3,187.7,0,0 +-3,186.8,0,0 +-3,185.9,0,0 +-3,185,0,0 +-3,184.1,0,0 +-3,183.2,0,0 +-3,182.3,0,0 +-3,181.4,0,0 +-3,180.5,0,0 +-3,179.5,-90,0 +-3,178.6,-89.5,0 +-3,177.7,-89.1,0 +-3,176.8,-88.6,0 +-3,175.9,-88.2,0 +-3,175,-87.7,0 +-3,174.1,-87.3,0 +-3,173.2,-86.8,0 +-3,172.3,-86.4,0 +-3,171.4,-85.9,0 +-3,170.5,-85.5,0 +-3,169.6,-85,0 +-3,168.7,-84.6,0 +-3,167.8,-84.1,0 +-3,166.9,-83.7,0 +-3,166,-83.2,0 +-3,165.1,-82.8,0 +-3,164.2,-82.3,0 +-3,163.3,-81.9,0 +-3,162.4,-81.4,0 +-3,161.5,-81,0 +-3,160.6,-80.5,0 +-3,159.7,-80.1,0 +-3,158.8,-79.6,0 +-3,157.9,-79.1,0 +-3,157,-78.7,0 +-3,156.1,-78.2,0 +-3,155.2,-77.8,0 +-3,154.3,-77.3,0 +-3,153.4,-76.9,0 +-3,152.5,-76.4,0 +-3,151.6,-76,0 +-3,150.7,-75.5,0 +-3,149.8,-75.1,0 +-3,148.9,-74.6,0 +-3,148,-74.2,0 +-3,147.1,-73.7,0 +-3,146.2,-73.3,0 +-3,145.3,-72.8,0 +-3,144.4,-72.4,0 +-3,143.5,-71.9,0 +-3,142.6,-71.5,0 +-3,141.7,-71,0 +-3,140.8,-70.6,0 +-3,139.8,-70.1,0 +-3,138.9,-69.6,0 +-3,138,-69.2,0 +-3,137.1,-68.7,0 +-3,136.2,-68.3,0 +-3,135.3,-67.8,0 +-3,134.4,-67.4,0 +-3,133.5,-66.9,0 +-3,132.6,-66.5,0 +-3,131.7,-66,0 +-3,130.8,-65.6,0 +-3,129.9,-65.1,0 +-3,129,-64.7,0 +-3,128.1,-64.2,0 +-3,127.2,-63.8,0 +-3,126.3,-63.3,0 +-3,125.4,-62.9,0 +-3,124.5,-62.4,0 +-3,123.6,-62,0 +-3,122.7,-61.5,0 +-3,121.8,-61.1,0 +-3,120.9,-60.6,0 +-3,120,-60.2,0 +-3,119.1,-59.7,0 +-3,118.2,-59.2,0 +-3,117.3,-58.8,0 +-3,116.4,-58.3,0 +-3,115.5,-57.9,0 +-3,114.6,-57.4,0 +-3,113.7,-57,0 +-3,112.8,-56.5,0 +-3,111.9,-56.1,0 +-3,111,-55.6,0 +-3,110.1,-55.2,0 +-3,109.2,-54.7,0 +-3,108.3,-54.3,0 +-3,107.4,-53.8,0 +-3,106.5,-53.4,0 +-3,105.6,-52.9,0 +-3,104.7,-52.5,0 +-3,103.8,-52,0 +-3,102.9,-51.6,0 +-3,102,-51.1,0 +-3,101.1,-50.7,0 +-3,100.2,-50.2,0 +-3,99.2,-49.7,0 +-3,98.3,-49.3,0 +-3,97.4,-48.8,0 +-3,96.5,-48.4,0 +-3,95.6,-47.9,0 +-3,94.7,-47.5,0 +-3,93.8,-47,0 +-3,92.9,-46.6,0 +-3,92,-46.1,0 +-3,91.1,-45.7,0 +-3,90.2,-45.2,0 +-3,89.3,-44.8,90 +-3,88.4,-44.3,89.1 +-3,87.5,-43.9,88.2 +-3,86.6,-43.4,87.3 +-3,85.7,-43,86.4 +-3,84.8,-42.5,85.5 +-3,83.9,-42.1,84.5 +-3,83,-41.6,83.6 +-3,82.1,-41.2,82.7 +-3,81.2,-40.7,81.8 +-3,80.3,-40.3,80.9 +-3,79.4,-39.8,80 +-3,78.5,-39.3,79.1 +-3,77.6,-38.9,78.2 +-3,76.7,-38.4,77.3 +-3,75.8,-38,76.4 +-3,74.9,-37.5,75.5 +-3,74,-37.1,74.5 +-3,73.1,-36.6,73.6 +-3,72.2,-36.2,72.7 +-3,71.3,-35.7,71.8 +-3,70.4,-35.3,70.9 +-3,69.5,-34.8,70 +-3,68.6,-34.4,69.1 +-3,67.7,-33.9,68.2 +-3,66.8,-33.5,67.3 +-3,65.9,-33,66.4 +-3,65,-32.6,65.5 +-3,64.1,-32.1,64.5 +-3,63.2,-31.7,63.6 +-3,62.3,-31.2,62.7 +-3,61.4,-30.8,61.8 +-3,60.5,-30.3,60.9 +-3,59.5,-29.8,60 +-3,58.6,-29.4,59.1 +-3,57.7,-28.9,58.2 +-3,56.8,-28.5,57.3 +-3,55.9,-28,56.4 +-3,55,-27.6,55.5 +-3,54.1,-27.1,54.5 +-3,53.2,-26.7,53.6 +-3,52.3,-26.2,52.7 +-3,51.4,-25.8,51.8 +-3,50.5,-25.3,50.9 +-3,49.6,-24.9,50 +-3,48.7,-24.4,49.1 +-3,47.8,-24,48.2 +-3,46.9,-23.5,47.3 +-3,46,-23.1,46.4 +-3,45.1,-22.6,45.5 +-3,44.2,-22.2,44.5 +-3,43.3,-21.7,43.6 +-3,42.4,-21.3,42.7 +-3,41.5,-20.8,41.8 +-3,40.6,-20.4,40.9 +-3,39.7,-19.9,40 +-3,38.8,-19.4,39.1 +-3,37.9,-19,38.2 +-3,37,-18.5,37.3 +-3,36.1,-18.1,36.4 +-3,35.2,-17.6,35.5 +-3,34.3,-17.2,34.5 +-3,33.4,-16.7,33.6 +-3,32.5,-16.3,32.7 +-3,31.6,-15.8,31.8 +-3,30.7,-15.4,30.9 +-3,29.8,-14.9,30 +-3,28.9,-14.5,29.1 +-3,28,-14,28.2 +-3,27.1,-13.6,27.3 +-3,26.2,-13.1,26.4 +-3,25.3,-12.7,25.5 +-3,24.4,-12.2,24.5 +-3,23.5,-11.8,23.6 +-3,22.6,-11.3,22.7 +-3,21.7,-10.9,21.8 +-3,20.8,-10.4,20.9 +-3,19.8,-9.9,20 +-3,18.9,-9.5,19.1 +-3,18,-9,18.2 +-3,17.1,-8.6,17.3 +-3,16.2,-8.1,16.4 +-3,15.3,-7.7,15.5 +-3,14.4,-7.2,14.5 +-3,13.5,-6.8,13.6 +-3,12.6,-6.3,12.7 +-3,11.7,-5.9,11.8 +-3,10.8,-5.4,10.9 +-3,9.9,-5,10 +-3,9,-4.5,9.1 +-3,8.1,-4.1,8.2 +-3,7.2,-3.6,7.3 +-3,6.3,-3.2,6.4 +-3,5.4,-2.7,5.5 +-3,4.5,-2.3,4.5 +-3,3.6,-1.8,3.6 +-3,2.7,-1.4,2.7 +-3,1.8,-0.9,1.8 +-3,0.9,-0.5,0.9 +-3,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +0.9,0,0,0.3 +0.9,0,0,0.3 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.8,0,0,0.5 +0.8,0,0,0.5 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.5,0,0,0.8 +0.5,0,0,0.8 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.3,0,0,0.9 +0.3,0,0,0.9 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.1,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.2,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,1 +0.3,0,0,0.9 +0.3,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.4,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.9 +0.5,0,0,0.8 +0.5,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.6,0,0,0.8 +0.7,0,0,0.8 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.7,0,0,0.7 +0.8,0,0,0.7 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.6 +0.8,0,0,0.5 +0.8,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.5 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.4 +0.9,0,0,0.3 +0.9,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.3 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.2 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0.1 +1,0,0,0 +1,0,0,0 +1,0,0,0 +1,0,0,0 +-3,0,0,0 +-3,0.9,-0.5,0.9 +-3,1.8,-0.9,1.8 +-3,2.7,-1.4,2.7 +-3,3.6,-1.8,3.6 +-3,4.5,-2.3,4.5 +-3,5.4,-2.7,5.5 +-3,6.3,-3.2,6.4 +-3,7.2,-3.6,7.3 +-3,8.1,-4.1,8.2 +-3,9,-4.5,9.1 +-3,9.9,-5,10 +-3,10.8,-5.4,10.9 +-3,11.7,-5.9,11.8 +-3,12.6,-6.3,12.7 +-3,13.5,-6.8,13.6 +-3,14.4,-7.2,14.5 +-3,15.3,-7.7,15.5 +-3,16.2,-8.1,16.4 +-3,17.1,-8.6,17.3 +-3,18,-9,18.2 +-3,18.9,-9.5,19.1 +-3,19.8,-9.9,20 +-3,20.8,-10.4,20.9 +-3,21.7,-10.9,21.8 +-3,22.6,-11.3,22.7 +-3,23.5,-11.8,23.6 +-3,24.4,-12.2,24.5 +-3,25.3,-12.7,25.5 +-3,26.2,-13.1,26.4 +-3,27.1,-13.6,27.3 +-3,28,-14,28.2 +-3,28.9,-14.5,29.1 +-3,29.8,-14.9,30 +-3,30.7,-15.4,30.9 +-3,31.6,-15.8,31.8 +-3,32.5,-16.3,32.7 +-3,33.4,-16.7,33.6 +-3,34.3,-17.2,34.5 +-3,35.2,-17.6,35.5 +-3,36.1,-18.1,36.4 +-3,37,-18.5,37.3 +-3,37.9,-19,38.2 +-3,38.8,-19.4,39.1 +-3,39.7,-19.9,40 +-3,40.6,-20.4,40.9 +-3,41.5,-20.8,41.8 +-3,42.4,-21.3,42.7 +-3,43.3,-21.7,43.6 +-3,44.2,-22.2,44.5 +-3,45.1,-22.6,45.5 +-3,46,-23.1,46.4 +-3,46.9,-23.5,47.3 +-3,47.8,-24,48.2 +-3,48.7,-24.4,49.1 +-3,49.6,-24.9,50 +-3,50.5,-25.3,50.9 +-3,51.4,-25.8,51.8 +-3,52.3,-26.2,52.7 +-3,53.2,-26.7,53.6 +-3,54.1,-27.1,54.5 +-3,55,-27.6,55.5 +-3,55.9,-28,56.4 +-3,56.8,-28.5,57.3 +-3,57.7,-28.9,58.2 +-3,58.6,-29.4,59.1 +-3,59.5,-29.8,60 +-3,60.5,-30.3,60.9 +-3,61.4,-30.8,61.8 +-3,62.3,-31.2,62.7 +-3,63.2,-31.7,63.6 +-3,64.1,-32.1,64.5 +-3,65,-32.6,65.5 +-3,65.9,-33,66.4 +-3,66.8,-33.5,67.3 +-3,67.7,-33.9,68.2 +-3,68.6,-34.4,69.1 +-3,69.5,-34.8,70 +-3,70.4,-35.3,70.9 +-3,71.3,-35.7,71.8 +-3,72.2,-36.2,72.7 +-3,73.1,-36.6,73.6 +-3,74,-37.1,74.5 +-3,74.9,-37.5,75.5 +-3,75.8,-38,76.4 +-3,76.7,-38.4,77.3 +-3,77.6,-38.9,78.2 +-3,78.5,-39.3,79.1 +-3,79.4,-39.8,80 +-3,80.3,-40.3,80.9 +-3,81.2,-40.7,81.8 +-3,82.1,-41.2,82.7 +-3,83,-41.6,83.6 +-3,83.9,-42.1,84.5 +-3,84.8,-42.5,85.5 +-3,85.7,-43,86.4 +-3,86.6,-43.4,87.3 +-3,87.5,-43.9,88.2 +-3,88.4,-44.3,89.1 +-3,89.3,-44.8,90 +-3,90.2,-45.2,0 +-3,91.1,-45.7,0 +-3,92,-46.1,0 +-3,92.9,-46.6,0 +-3,93.8,-47,0 +-3,94.7,-47.5,0 +-3,95.6,-47.9,0 +-3,96.5,-48.4,0 +-3,97.4,-48.8,0 +-3,98.3,-49.3,0 +-3,99.2,-49.7,0 +-3,100.2,-50.2,0 +-3,101.1,-50.7,0 +-3,102,-51.1,0 +-3,102.9,-51.6,0 +-3,103.8,-52,0 +-3,104.7,-52.5,0 +-3,105.6,-52.9,0 +-3,106.5,-53.4,0 +-3,107.4,-53.8,0 +-3,108.3,-54.3,0 +-3,109.2,-54.7,0 +-3,110.1,-55.2,0 +-3,111,-55.6,0 +-3,111.9,-56.1,0 +-3,112.8,-56.5,0 +-3,113.7,-57,0 +-3,114.6,-57.4,0 +-3,115.5,-57.9,0 +-3,116.4,-58.3,0 +-3,117.3,-58.8,0 +-3,118.2,-59.2,0 +-3,119.1,-59.7,0 +-3,120,-60.2,0 +-3,120.9,-60.6,0 +-3,121.8,-61.1,0 +-3,122.7,-61.5,0 +-3,123.6,-62,0 +-3,124.5,-62.4,0 +-3,125.4,-62.9,0 +-3,126.3,-63.3,0 +-3,127.2,-63.8,0 +-3,128.1,-64.2,0 +-3,129,-64.7,0 +-3,129.9,-65.1,0 +-3,130.8,-65.6,0 +-3,131.7,-66,0 +-3,132.6,-66.5,0 +-3,133.5,-66.9,0 +-3,134.4,-67.4,0 +-3,135.3,-67.8,0 +-3,136.2,-68.3,0 +-3,137.1,-68.7,0 +-3,138,-69.2,0 +-3,138.9,-69.6,0 +-3,139.8,-70.1,0 +-3,140.8,-70.6,0 +-3,141.7,-71,0 +-3,142.6,-71.5,0 +-3,143.5,-71.9,0 +-3,144.4,-72.4,0 +-3,145.3,-72.8,0 +-3,146.2,-73.3,0 +-3,147.1,-73.7,0 +-3,148,-74.2,0 +-3,148.9,-74.6,0 +-3,149.8,-75.1,0 +-3,150.7,-75.5,0 +-3,151.6,-76,0 +-3,152.5,-76.4,0 +-3,153.4,-76.9,0 +-3,154.3,-77.3,0 +-3,155.2,-77.8,0 +-3,156.1,-78.2,0 +-3,157,-78.7,0 +-3,157.9,-79.1,0 +-3,158.8,-79.6,0 +-3,159.7,-80.1,0 +-3,160.6,-80.5,0 +-3,161.5,-81,0 +-3,162.4,-81.4,0 +-3,163.3,-81.9,0 +-3,164.2,-82.3,0 +-3,165.1,-82.8,0 +-3,166,-83.2,0 +-3,166.9,-83.7,0 +-3,167.8,-84.1,0 +-3,168.7,-84.6,0 +-3,169.6,-85,0 +-3,170.5,-85.5,0 +-3,171.4,-85.9,0 +-3,172.3,-86.4,0 +-3,173.2,-86.8,0 +-3,174.1,-87.3,0 +-3,175,-87.7,0 +-3,175.9,-88.2,0 +-3,176.8,-88.6,0 +-3,177.7,-89.1,0 +-3,178.6,-89.5,0 +-3,179.5,-90,0 +-3,180.5,0,0 +-3,181.4,0,0 +-3,182.3,0,0 +-3,183.2,0,0 +-3,184.1,0,0 +-3,185,0,0 +-3,185.9,0,0 +-3,186.8,0,0 +-3,187.7,0,0 +-3,188.6,0,0 +-3,189.5,0,0 +-3,190.4,0,0 +-3,191.3,0,0 +-3,192.2,0,0 +-3,193.1,0,0 +-3,194,0,0 +-3,194.9,0,0 +-3,195.8,0,0 +-3,196.7,0,0 +-3,197.6,0,0 +-3,198.5,0,0 +-3,199.4,0,0 +-3,200.3,0,0 +-3,201.2,0,0 +-3,202.1,0,0 +-3,203,0,0 +-3,203.9,0,0 +-3,204.8,0,0 +-3,205.7,0,0 +-3,206.6,0,0 +-3,207.5,0,0 +-3,208.4,0,0 +-3,209.3,0,0 +-3,210.2,0,0 +-3,211.1,0,0 +-3,212,0,0 +-3,212.9,0,0 +-3,213.8,0,0 +-3,214.7,0,0 +-3,215.6,0,0 +-3,216.5,0,0 +-3,217.4,0,0 +-3,218.3,0,0 +-3,219.2,0,0 +-3,220.2,0,0 +-3,221.1,0,0 +-3,222,0,0 +-3,222.9,0,0 +-3,223.8,0,0 +-3,224.7,0,0 +-3,225.6,0,0 +-3,226.5,0,0 +-3,227.4,0,0 +-3,228.3,0,0 +-3,229.2,0,0 +-3,230.1,0,0 +-3,231,0,0 +-3,231.9,0,0 +-3,232.8,0,0 +-3,233.7,0,0 +-3,234.6,0,0 +-3,235.5,0,0 +-3,236.4,0,0 +-3,237.3,0,0 +-3,238.2,0,0 +-3,239.1,0,0 +-3,240,0,0 +-3,240.9,0,0 +-3,241.8,0,0 +-3,242.7,0,0 +-3,243.6,0,0 +-3,244.5,0,0 +-3,245.4,0,0 +-3,246.3,0,0 +-3,247.2,0,0 +-3,248.1,0,0 +-3,249,0,0 +-3,249.9,0,0 +-3,250.8,0,0 +-3,251.7,0,0 +-3,252.6,0,0 +-3,253.5,0,0 +-3,254.4,0,0 +-3,255.3,0,0 +-3,256.2,0,0 +-3,257.1,0,0 +-3,258,0,0 +-3,258.9,0,0 +-3,259.8,0,0 +-3,260.8,0,0 +-3,261.7,0,0 +-3,262.6,0,0 +-3,263.5,0,0 +-3,264.4,0,0 +-3,265.3,0,0 +-3,266.2,0,0 +-3,267.1,0,0 +-3,268,0,0 +-3,268.9,0,0 +-3,269.8,0,0 +-3,270.7,0,0 +-3,271.6,0,0 +-3,272.5,0,0 +-3,273.4,0,0 +-3,274.3,0,0 +-3,275.2,0,0 +-3,276.1,0,0 +-3,277,0,0 +-3,277.9,0,0 +-3,278.8,0,0 +-3,279.7,0,0 +-3,280.6,0,0 +-3,281.5,0,0 +-3,282.4,0,0 +-3,283.3,0,0 +-3,284.2,0,0 +-3,285.1,0,0 +-3,286,0,0 +-3,286.9,0,0 +-3,287.8,0,0 +-3,288.7,0,0 +-3,289.6,0,0 +-3,290.5,0,0 +-3,291.4,0,0 +-3,292.3,0,0 +-3,293.2,0,0 +-3,294.1,0,0 +-3,295,0,0 +-3,295.9,0,0 +-3,296.8,0,0 +-3,297.7,0,0 +-3,298.6,0,0 +-3,299.5,0,0 +-3,300.5,0,0 +-3,301.4,0,0 +-3,302.3,0,0 +-3,303.2,0,0 +-3,304.1,0,0 +-3,305,0,0 +-3,305.9,0,0 +-3,306.8,0,0 +-3,307.7,0,0 +-3,308.6,0,0 +-3,309.5,0,0 +-3,310.4,0,0 +-3,311.3,0,0 +-3,312.2,0,0 +-3,313.1,0,0 +-3,314,0,0 +-3,314.9,0,0 +-3,315.8,0,0 +-3,316.7,0,0 +-3,317.6,0,0 +-3,318.5,0,0 +-3,319.4,0,0 +-3,320.3,0,0 +-3,321.2,0,0 +-3,322.1,0,0 +-3,323,0,0 +-3,323.9,0,0 +-3,324.8,0,0 +-3,325.7,0,0 +-3,326.6,0,0 +-3,327.5,0,0 +-3,328.4,0,0 +-3,329.3,0,0 +-3,330.2,0,0 +-3,331.1,0,0 +-3,332,0,0 +-3,332.9,0,0 +-3,333.8,0,0 +-3,334.7,0,0 +-3,335.6,0,0 +-3,336.5,0,0 +-3,337.4,0,0 +-3,338.3,0,0 +-3,339.2,0,0 +-3,340.2,0,0 +-3,341.1,0,0 +-3,342,0,0 +-3,342.9,0,0 +-3,343.8,0,0 +-3,344.7,0,0 +-3,345.6,0,0 +-3,346.5,0,0 +-3,347.4,0,0 +-3,348.3,0,0 +-3,349.2,0,0 +-3,350.1,0,0 +-3,351,0,0 +-3,351.9,0,0 +-3,352.8,0,0 +-3,353.7,0,0 +-3,354.6,0,0 +-3,355.5,0,0 +-3,356.4,0,0 +-3,357.3,0,0 +-3,358.2,0,0 +-3,359.1,0,0 +-3,360,0,0 diff --git a/scripts/trajectories/rotate_euler_quaternion_5s.csv b/scripts/trajectories/rotate_euler_quaternion_5s.csv deleted file mode 100644 index 0052e3d7c7a49f78f8880e203ee2fd99b4c19f29..0000000000000000000000000000000000000000 --- a/scripts/trajectories/rotate_euler_quaternion_5s.csv +++ /dev/null @@ -1,1000 +0,0 @@ --3,360,0,0 --3,359.1,0,0 --3,358.2,0,0 --3,357.3,0,0 --3,356.4,0,0 --3,355.5,0,0 --3,354.6,0,0 --3,353.7,0,0 --3,352.8,0,0 --3,351.9,0,0 --3,351,0,0 --3,350.1,0,0 --3,349.2,0,0 --3,348.3,0,0 --3,347.4,0,0 --3,346.5,0,0 --3,345.6,0,0 --3,344.7,0,0 --3,343.8,0,0 --3,342.9,0,0 --3,342,0,0 --3,341.1,0,0 --3,340.2,0,0 --3,339.2,0,0 --3,338.3,0,0 --3,337.4,0,0 --3,336.5,0,0 --3,335.6,0,0 --3,334.7,0,0 --3,333.8,0,0 --3,332.9,0,0 --3,332,0,0 --3,331.1,0,0 --3,330.2,0,0 --3,329.3,0,0 --3,328.4,0,0 --3,327.5,0,0 --3,326.6,0,0 --3,325.7,0,0 --3,324.8,0,0 --3,323.9,0,0 --3,323,0,0 --3,322.1,0,0 --3,321.2,0,0 --3,320.3,0,0 --3,319.4,0,0 --3,318.5,0,0 --3,317.6,0,0 --3,316.7,0,0 --3,315.8,0,0 --3,314.9,0,0 --3,314,0,0 --3,313.1,0,0 --3,312.2,0,0 --3,311.3,0,0 --3,310.4,0,0 --3,309.5,0,0 --3,308.6,0,0 --3,307.7,0,0 --3,306.8,0,0 --3,305.9,0,0 --3,305,0,0 --3,304.1,0,0 --3,303.2,0,0 --3,302.3,0,0 --3,301.4,0,0 --3,300.5,0,0 --3,299.5,0,0 --3,298.6,0,0 --3,297.7,0,0 --3,296.8,0,0 --3,295.9,0,0 --3,295,0,0 --3,294.1,0,0 --3,293.2,0,0 --3,292.3,0,0 --3,291.4,0,0 --3,290.5,0,0 --3,289.6,0,0 --3,288.7,0,0 --3,287.8,0,0 --3,286.9,0,0 --3,286,0,0 --3,285.1,0,0 --3,284.2,0,0 --3,283.3,0,0 --3,282.4,0,0 --3,281.5,0,0 --3,280.6,0,0 --3,279.7,0,0 --3,278.8,0,0 --3,277.9,0,0 --3,277,0,0 --3,276.1,0,0 --3,275.2,0,0 --3,274.3,0,0 --3,273.4,0,0 --3,272.5,0,0 --3,271.6,0,0 --3,270.7,0,0 --3,269.8,0,0 --3,268.9,0,0 --3,268,0,0 --3,267.1,0,0 --3,266.2,0,0 --3,265.3,0,0 --3,264.4,0,0 --3,263.5,0,0 --3,262.6,0,0 --3,261.7,0,0 --3,260.8,0,0 --3,259.8,0,0 --3,258.9,0,0 --3,258,0,0 --3,257.1,0,0 --3,256.2,0,0 --3,255.3,0,0 --3,254.4,0,0 --3,253.5,0,0 --3,252.6,0,0 --3,251.7,0,0 --3,250.8,0,0 --3,249.9,0,0 --3,249,0,0 --3,248.1,0,0 --3,247.2,0,0 --3,246.3,0,0 --3,245.4,0,0 --3,244.5,0,0 --3,243.6,0,0 --3,242.7,0,0 --3,241.8,0,0 --3,240.9,0,0 --3,240,0,0 --3,239.1,0,0 --3,238.2,0,0 --3,237.3,0,0 --3,236.4,0,0 --3,235.5,0,0 --3,234.6,0,0 --3,233.7,0,0 --3,232.8,0,0 --3,231.9,0,0 --3,231,0,0 --3,230.1,0,0 --3,229.2,0,0 --3,228.3,0,0 --3,227.4,0,0 --3,226.5,0,0 --3,225.6,0,0 --3,224.7,0,0 --3,223.8,0,0 --3,222.9,0,0 --3,222,0,0 --3,221.1,0,0 --3,220.2,0,0 --3,219.2,0,0 --3,218.3,0,0 --3,217.4,0,0 --3,216.5,0,0 --3,215.6,0,0 --3,214.7,0,0 --3,213.8,0,0 --3,212.9,0,0 --3,212,0,0 --3,211.1,0,0 --3,210.2,0,0 --3,209.3,0,0 --3,208.4,0,0 --3,207.5,0,0 --3,206.6,0,0 --3,205.7,0,0 --3,204.8,0,0 --3,203.9,0,0 --3,203,0,0 --3,202.1,0,0 --3,201.2,0,0 --3,200.3,0,0 --3,199.4,0,0 --3,198.5,0,0 --3,197.6,0,0 --3,196.7,0,0 --3,195.8,0,0 --3,194.9,0,0 --3,194,0,0 --3,193.1,0,0 --3,192.2,0,0 --3,191.3,0,0 --3,190.4,0,0 --3,189.5,0,0 --3,188.6,0,0 --3,187.7,0,0 --3,186.8,0,0 --3,185.9,0,0 --3,185,0,0 --3,184.1,0,0 --3,183.2,0,0 --3,182.3,0,0 --3,181.4,0,0 --3,180.5,0,0 --3,179.5,-90,0 --3,178.6,-89.5,0 --3,177.7,-89.1,0 --3,176.8,-88.6,0 --3,175.9,-88.2,0 --3,175,-87.7,0 --3,174.1,-87.3,0 --3,173.2,-86.8,0 --3,172.3,-86.4,0 --3,171.4,-85.9,0 --3,170.5,-85.5,0 --3,169.6,-85,0 --3,168.7,-84.6,0 --3,167.8,-84.1,0 --3,166.9,-83.7,0 --3,166,-83.2,0 --3,165.1,-82.8,0 --3,164.2,-82.3,0 --3,163.3,-81.9,0 --3,162.4,-81.4,0 --3,161.5,-81,0 --3,160.6,-80.5,0 --3,159.7,-80.1,0 --3,158.8,-79.6,0 --3,157.9,-79.1,0 --3,157,-78.7,0 --3,156.1,-78.2,0 --3,155.2,-77.8,0 --3,154.3,-77.3,0 --3,153.4,-76.9,0 --3,152.5,-76.4,0 --3,151.6,-76,0 --3,150.7,-75.5,0 --3,149.8,-75.1,0 --3,148.9,-74.6,0 --3,148,-74.2,0 --3,147.1,-73.7,0 --3,146.2,-73.3,0 --3,145.3,-72.8,0 --3,144.4,-72.4,0 --3,143.5,-71.9,0 --3,142.6,-71.5,0 --3,141.7,-71,0 --3,140.8,-70.6,0 --3,139.8,-70.1,0 --3,138.9,-69.6,0 --3,138,-69.2,0 --3,137.1,-68.7,0 --3,136.2,-68.3,0 --3,135.3,-67.8,0 --3,134.4,-67.4,0 --3,133.5,-66.9,0 --3,132.6,-66.5,0 --3,131.7,-66,0 --3,130.8,-65.6,0 --3,129.9,-65.1,0 --3,129,-64.7,0 --3,128.1,-64.2,0 --3,127.2,-63.8,0 --3,126.3,-63.3,0 --3,125.4,-62.9,0 --3,124.5,-62.4,0 --3,123.6,-62,0 --3,122.7,-61.5,0 --3,121.8,-61.1,0 --3,120.9,-60.6,0 --3,120,-60.2,0 --3,119.1,-59.7,0 --3,118.2,-59.2,0 --3,117.3,-58.8,0 --3,116.4,-58.3,0 --3,115.5,-57.9,0 --3,114.6,-57.4,0 --3,113.7,-57,0 --3,112.8,-56.5,0 --3,111.9,-56.1,0 --3,111,-55.6,0 --3,110.1,-55.2,0 --3,109.2,-54.7,0 --3,108.3,-54.3,0 --3,107.4,-53.8,0 --3,106.5,-53.4,0 --3,105.6,-52.9,0 --3,104.7,-52.5,0 --3,103.8,-52,0 --3,102.9,-51.6,0 --3,102,-51.1,0 --3,101.1,-50.7,0 --3,100.2,-50.2,0 --3,99.2,-49.7,0 --3,98.3,-49.3,0 --3,97.4,-48.8,0 --3,96.5,-48.4,0 --3,95.6,-47.9,0 --3,94.7,-47.5,0 --3,93.8,-47,0 --3,92.9,-46.6,0 --3,92,-46.1,0 --3,91.1,-45.7,0 --3,90.2,-45.2,0 --3,89.3,-44.8,90 --3,88.4,-44.3,89.1 --3,87.5,-43.9,88.2 --3,86.6,-43.4,87.3 --3,85.7,-43,86.4 --3,84.8,-42.5,85.5 --3,83.9,-42.1,84.5 --3,83,-41.6,83.6 --3,82.1,-41.2,82.7 --3,81.2,-40.7,81.8 --3,80.3,-40.3,80.9 --3,79.4,-39.8,80 --3,78.5,-39.3,79.1 --3,77.6,-38.9,78.2 --3,76.7,-38.4,77.3 --3,75.8,-38,76.4 --3,74.9,-37.5,75.5 --3,74,-37.1,74.5 --3,73.1,-36.6,73.6 --3,72.2,-36.2,72.7 --3,71.3,-35.7,71.8 --3,70.4,-35.3,70.9 --3,69.5,-34.8,70 --3,68.6,-34.4,69.1 --3,67.7,-33.9,68.2 --3,66.8,-33.5,67.3 --3,65.9,-33,66.4 --3,65,-32.6,65.5 --3,64.1,-32.1,64.5 --3,63.2,-31.7,63.6 --3,62.3,-31.2,62.7 --3,61.4,-30.8,61.8 --3,60.5,-30.3,60.9 --3,59.5,-29.8,60 --3,58.6,-29.4,59.1 --3,57.7,-28.9,58.2 --3,56.8,-28.5,57.3 --3,55.9,-28,56.4 --3,55,-27.6,55.5 --3,54.1,-27.1,54.5 --3,53.2,-26.7,53.6 --3,52.3,-26.2,52.7 --3,51.4,-25.8,51.8 --3,50.5,-25.3,50.9 --3,49.6,-24.9,50 --3,48.7,-24.4,49.1 --3,47.8,-24,48.2 --3,46.9,-23.5,47.3 --3,46,-23.1,46.4 --3,45.1,-22.6,45.5 --3,44.2,-22.2,44.5 --3,43.3,-21.7,43.6 --3,42.4,-21.3,42.7 --3,41.5,-20.8,41.8 --3,40.6,-20.4,40.9 --3,39.7,-19.9,40 --3,38.8,-19.4,39.1 --3,37.9,-19,38.2 --3,37,-18.5,37.3 --3,36.1,-18.1,36.4 --3,35.2,-17.6,35.5 --3,34.3,-17.2,34.5 --3,33.4,-16.7,33.6 --3,32.5,-16.3,32.7 --3,31.6,-15.8,31.8 --3,30.7,-15.4,30.9 --3,29.8,-14.9,30 --3,28.9,-14.5,29.1 --3,28,-14,28.2 --3,27.1,-13.6,27.3 --3,26.2,-13.1,26.4 --3,25.3,-12.7,25.5 --3,24.4,-12.2,24.5 --3,23.5,-11.8,23.6 --3,22.6,-11.3,22.7 --3,21.7,-10.9,21.8 --3,20.8,-10.4,20.9 --3,19.8,-9.9,20 --3,18.9,-9.5,19.1 --3,18,-9,18.2 --3,17.1,-8.6,17.3 --3,16.2,-8.1,16.4 --3,15.3,-7.7,15.5 --3,14.4,-7.2,14.5 --3,13.5,-6.8,13.6 --3,12.6,-6.3,12.7 --3,11.7,-5.9,11.8 --3,10.8,-5.4,10.9 --3,9.9,-5,10 --3,9,-4.5,9.1 --3,8.1,-4.1,8.2 --3,7.2,-3.6,7.3 --3,6.3,-3.2,6.4 --3,5.4,-2.7,5.5 --3,4.5,-2.3,4.5 --3,3.6,-1.8,3.6 --3,2.7,-1.4,2.7 --3,1.8,-0.9,1.8 --3,0.9,-0.5,0.9 --3,0,0,0 -1,0,0,0 -1,0,0,0 -1,0,0,0 -1,0,0,0 -1,0,0,0.1 -1,0,0,0.1 -1,0,0,0.1 -1,0,0,0.1 -1,0,0,0.1 -1,0,0,0.1 -1,0,0,0.2 -1,0,0,0.2 -1,0,0,0.2 -1,0,0,0.2 -1,0,0,0.2 -1,0,0,0.2 -1,0,0,0.2 -1,0,0,0.3 -1,0,0,0.3 -1,0,0,0.3 -1,0,0,0.3 -0.9,0,0,0.3 -0.9,0,0,0.3 -0.9,0,0,0.4 -0.9,0,0,0.4 -0.9,0,0,0.4 -0.9,0,0,0.4 -0.9,0,0,0.4 -0.9,0,0,0.4 -0.9,0,0,0.4 -0.9,0,0,0.5 -0.9,0,0,0.5 -0.9,0,0,0.5 -0.9,0,0,0.5 -0.9,0,0,0.5 -0.9,0,0,0.5 -0.8,0,0,0.5 -0.8,0,0,0.5 -0.8,0,0,0.6 -0.8,0,0,0.6 -0.8,0,0,0.6 -0.8,0,0,0.6 -0.8,0,0,0.6 -0.8,0,0,0.6 -0.8,0,0,0.6 -0.8,0,0,0.6 -0.8,0,0,0.7 -0.7,0,0,0.7 -0.7,0,0,0.7 -0.7,0,0,0.7 -0.7,0,0,0.7 -0.7,0,0,0.7 -0.7,0,0,0.7 -0.7,0,0,0.7 -0.7,0,0,0.8 -0.6,0,0,0.8 -0.6,0,0,0.8 -0.6,0,0,0.8 -0.6,0,0,0.8 -0.6,0,0,0.8 -0.6,0,0,0.8 -0.6,0,0,0.8 -0.6,0,0,0.8 -0.5,0,0,0.8 -0.5,0,0,0.8 -0.5,0,0,0.9 -0.5,0,0,0.9 -0.5,0,0,0.9 -0.5,0,0,0.9 -0.5,0,0,0.9 -0.5,0,0,0.9 -0.4,0,0,0.9 -0.4,0,0,0.9 -0.4,0,0,0.9 -0.4,0,0,0.9 -0.4,0,0,0.9 -0.4,0,0,0.9 -0.4,0,0,0.9 -0.3,0,0,0.9 -0.3,0,0,0.9 -0.3,0,0,1 -0.3,0,0,1 -0.3,0,0,1 -0.3,0,0,1 -0.2,0,0,1 -0.2,0,0,1 -0.2,0,0,1 -0.2,0,0,1 -0.2,0,0,1 -0.2,0,0,1 -0.2,0,0,1 -0.1,0,0,1 -0.1,0,0,1 -0.1,0,0,1 -0.1,0,0,1 -0.1,0,0,1 -0.1,0,0,1 -0,0,0,1 -0,0,0,1 -0,0,0,1 -0,0,0,1 -0,0,0,1 -0,0,0,1 -0.1,0,0,1 -0.1,0,0,1 -0.1,0,0,1 -0.1,0,0,1 -0.1,0,0,1 -0.1,0,0,1 -0.2,0,0,1 -0.2,0,0,1 -0.2,0,0,1 -0.2,0,0,1 -0.2,0,0,1 -0.2,0,0,1 -0.2,0,0,1 -0.3,0,0,1 -0.3,0,0,1 -0.3,0,0,1 -0.3,0,0,1 -0.3,0,0,0.9 -0.3,0,0,0.9 -0.4,0,0,0.9 -0.4,0,0,0.9 -0.4,0,0,0.9 -0.4,0,0,0.9 -0.4,0,0,0.9 -0.4,0,0,0.9 -0.4,0,0,0.9 -0.5,0,0,0.9 -0.5,0,0,0.9 -0.5,0,0,0.9 -0.5,0,0,0.9 -0.5,0,0,0.9 -0.5,0,0,0.9 -0.5,0,0,0.8 -0.5,0,0,0.8 -0.6,0,0,0.8 -0.6,0,0,0.8 -0.6,0,0,0.8 -0.6,0,0,0.8 -0.6,0,0,0.8 -0.6,0,0,0.8 -0.6,0,0,0.8 -0.6,0,0,0.8 -0.7,0,0,0.8 -0.7,0,0,0.7 -0.7,0,0,0.7 -0.7,0,0,0.7 -0.7,0,0,0.7 -0.7,0,0,0.7 -0.7,0,0,0.7 -0.7,0,0,0.7 -0.8,0,0,0.7 -0.8,0,0,0.6 -0.8,0,0,0.6 -0.8,0,0,0.6 -0.8,0,0,0.6 -0.8,0,0,0.6 -0.8,0,0,0.6 -0.8,0,0,0.6 -0.8,0,0,0.6 -0.8,0,0,0.5 -0.8,0,0,0.5 -0.9,0,0,0.5 -0.9,0,0,0.5 -0.9,0,0,0.5 -0.9,0,0,0.5 -0.9,0,0,0.5 -0.9,0,0,0.5 -0.9,0,0,0.4 -0.9,0,0,0.4 -0.9,0,0,0.4 -0.9,0,0,0.4 -0.9,0,0,0.4 -0.9,0,0,0.4 -0.9,0,0,0.4 -0.9,0,0,0.3 -0.9,0,0,0.3 -1,0,0,0.3 -1,0,0,0.3 -1,0,0,0.3 -1,0,0,0.3 -1,0,0,0.2 -1,0,0,0.2 -1,0,0,0.2 -1,0,0,0.2 -1,0,0,0.2 -1,0,0,0.2 -1,0,0,0.2 -1,0,0,0.1 -1,0,0,0.1 -1,0,0,0.1 -1,0,0,0.1 -1,0,0,0.1 -1,0,0,0.1 -1,0,0,0 -1,0,0,0 -1,0,0,0 -1,0,0,0 --3,0,0,0 --3,0.9,-0.5,0.9 --3,1.8,-0.9,1.8 --3,2.7,-1.4,2.7 --3,3.6,-1.8,3.6 --3,4.5,-2.3,4.5 --3,5.4,-2.7,5.5 --3,6.3,-3.2,6.4 --3,7.2,-3.6,7.3 --3,8.1,-4.1,8.2 --3,9,-4.5,9.1 --3,9.9,-5,10 --3,10.8,-5.4,10.9 --3,11.7,-5.9,11.8 --3,12.6,-6.3,12.7 --3,13.5,-6.8,13.6 --3,14.4,-7.2,14.5 --3,15.3,-7.7,15.5 --3,16.2,-8.1,16.4 --3,17.1,-8.6,17.3 --3,18,-9,18.2 --3,18.9,-9.5,19.1 --3,19.8,-9.9,20 --3,20.8,-10.4,20.9 --3,21.7,-10.9,21.8 --3,22.6,-11.3,22.7 --3,23.5,-11.8,23.6 --3,24.4,-12.2,24.5 --3,25.3,-12.7,25.5 --3,26.2,-13.1,26.4 --3,27.1,-13.6,27.3 --3,28,-14,28.2 --3,28.9,-14.5,29.1 --3,29.8,-14.9,30 --3,30.7,-15.4,30.9 --3,31.6,-15.8,31.8 --3,32.5,-16.3,32.7 --3,33.4,-16.7,33.6 --3,34.3,-17.2,34.5 --3,35.2,-17.6,35.5 --3,36.1,-18.1,36.4 --3,37,-18.5,37.3 --3,37.9,-19,38.2 --3,38.8,-19.4,39.1 --3,39.7,-19.9,40 --3,40.6,-20.4,40.9 --3,41.5,-20.8,41.8 --3,42.4,-21.3,42.7 --3,43.3,-21.7,43.6 --3,44.2,-22.2,44.5 --3,45.1,-22.6,45.5 --3,46,-23.1,46.4 --3,46.9,-23.5,47.3 --3,47.8,-24,48.2 --3,48.7,-24.4,49.1 --3,49.6,-24.9,50 --3,50.5,-25.3,50.9 --3,51.4,-25.8,51.8 --3,52.3,-26.2,52.7 --3,53.2,-26.7,53.6 --3,54.1,-27.1,54.5 --3,55,-27.6,55.5 --3,55.9,-28,56.4 --3,56.8,-28.5,57.3 --3,57.7,-28.9,58.2 --3,58.6,-29.4,59.1 --3,59.5,-29.8,60 --3,60.5,-30.3,60.9 --3,61.4,-30.8,61.8 --3,62.3,-31.2,62.7 --3,63.2,-31.7,63.6 --3,64.1,-32.1,64.5 --3,65,-32.6,65.5 --3,65.9,-33,66.4 --3,66.8,-33.5,67.3 --3,67.7,-33.9,68.2 --3,68.6,-34.4,69.1 --3,69.5,-34.8,70 --3,70.4,-35.3,70.9 --3,71.3,-35.7,71.8 --3,72.2,-36.2,72.7 --3,73.1,-36.6,73.6 --3,74,-37.1,74.5 --3,74.9,-37.5,75.5 --3,75.8,-38,76.4 --3,76.7,-38.4,77.3 --3,77.6,-38.9,78.2 --3,78.5,-39.3,79.1 --3,79.4,-39.8,80 --3,80.3,-40.3,80.9 --3,81.2,-40.7,81.8 --3,82.1,-41.2,82.7 --3,83,-41.6,83.6 --3,83.9,-42.1,84.5 --3,84.8,-42.5,85.5 --3,85.7,-43,86.4 --3,86.6,-43.4,87.3 --3,87.5,-43.9,88.2 --3,88.4,-44.3,89.1 --3,89.3,-44.8,90 --3,90.2,-45.2,0 --3,91.1,-45.7,0 --3,92,-46.1,0 --3,92.9,-46.6,0 --3,93.8,-47,0 --3,94.7,-47.5,0 --3,95.6,-47.9,0 --3,96.5,-48.4,0 --3,97.4,-48.8,0 --3,98.3,-49.3,0 --3,99.2,-49.7,0 --3,100.2,-50.2,0 --3,101.1,-50.7,0 --3,102,-51.1,0 --3,102.9,-51.6,0 --3,103.8,-52,0 --3,104.7,-52.5,0 --3,105.6,-52.9,0 --3,106.5,-53.4,0 --3,107.4,-53.8,0 --3,108.3,-54.3,0 --3,109.2,-54.7,0 --3,110.1,-55.2,0 --3,111,-55.6,0 --3,111.9,-56.1,0 --3,112.8,-56.5,0 --3,113.7,-57,0 --3,114.6,-57.4,0 --3,115.5,-57.9,0 --3,116.4,-58.3,0 --3,117.3,-58.8,0 --3,118.2,-59.2,0 --3,119.1,-59.7,0 --3,120,-60.2,0 --3,120.9,-60.6,0 --3,121.8,-61.1,0 --3,122.7,-61.5,0 --3,123.6,-62,0 --3,124.5,-62.4,0 --3,125.4,-62.9,0 --3,126.3,-63.3,0 --3,127.2,-63.8,0 --3,128.1,-64.2,0 --3,129,-64.7,0 --3,129.9,-65.1,0 --3,130.8,-65.6,0 --3,131.7,-66,0 --3,132.6,-66.5,0 --3,133.5,-66.9,0 --3,134.4,-67.4,0 --3,135.3,-67.8,0 --3,136.2,-68.3,0 --3,137.1,-68.7,0 --3,138,-69.2,0 --3,138.9,-69.6,0 --3,139.8,-70.1,0 --3,140.8,-70.6,0 --3,141.7,-71,0 --3,142.6,-71.5,0 --3,143.5,-71.9,0 --3,144.4,-72.4,0 --3,145.3,-72.8,0 --3,146.2,-73.3,0 --3,147.1,-73.7,0 --3,148,-74.2,0 --3,148.9,-74.6,0 --3,149.8,-75.1,0 --3,150.7,-75.5,0 --3,151.6,-76,0 --3,152.5,-76.4,0 --3,153.4,-76.9,0 --3,154.3,-77.3,0 --3,155.2,-77.8,0 --3,156.1,-78.2,0 --3,157,-78.7,0 --3,157.9,-79.1,0 --3,158.8,-79.6,0 --3,159.7,-80.1,0 --3,160.6,-80.5,0 --3,161.5,-81,0 --3,162.4,-81.4,0 --3,163.3,-81.9,0 --3,164.2,-82.3,0 --3,165.1,-82.8,0 --3,166,-83.2,0 --3,166.9,-83.7,0 --3,167.8,-84.1,0 --3,168.7,-84.6,0 --3,169.6,-85,0 --3,170.5,-85.5,0 --3,171.4,-85.9,0 --3,172.3,-86.4,0 --3,173.2,-86.8,0 --3,174.1,-87.3,0 --3,175,-87.7,0 --3,175.9,-88.2,0 --3,176.8,-88.6,0 --3,177.7,-89.1,0 --3,178.6,-89.5,0 --3,179.5,-90,0 --3,180.5,0,0 --3,181.4,0,0 --3,182.3,0,0 --3,183.2,0,0 --3,184.1,0,0 --3,185,0,0 --3,185.9,0,0 --3,186.8,0,0 --3,187.7,0,0 --3,188.6,0,0 --3,189.5,0,0 --3,190.4,0,0 --3,191.3,0,0 --3,192.2,0,0 --3,193.1,0,0 --3,194,0,0 --3,194.9,0,0 --3,195.8,0,0 --3,196.7,0,0 --3,197.6,0,0 --3,198.5,0,0 --3,199.4,0,0 --3,200.3,0,0 --3,201.2,0,0 --3,202.1,0,0 --3,203,0,0 --3,203.9,0,0 --3,204.8,0,0 --3,205.7,0,0 --3,206.6,0,0 --3,207.5,0,0 --3,208.4,0,0 --3,209.3,0,0 --3,210.2,0,0 --3,211.1,0,0 --3,212,0,0 --3,212.9,0,0 --3,213.8,0,0 --3,214.7,0,0 --3,215.6,0,0 --3,216.5,0,0 --3,217.4,0,0 --3,218.3,0,0 --3,219.2,0,0 --3,220.2,0,0 --3,221.1,0,0 --3,222,0,0 --3,222.9,0,0 --3,223.8,0,0 --3,224.7,0,0 --3,225.6,0,0 --3,226.5,0,0 --3,227.4,0,0 --3,228.3,0,0 --3,229.2,0,0 --3,230.1,0,0 --3,231,0,0 --3,231.9,0,0 --3,232.8,0,0 --3,233.7,0,0 --3,234.6,0,0 --3,235.5,0,0 --3,236.4,0,0 --3,237.3,0,0 --3,238.2,0,0 --3,239.1,0,0 --3,240,0,0 --3,240.9,0,0 --3,241.8,0,0 --3,242.7,0,0 --3,243.6,0,0 --3,244.5,0,0 --3,245.4,0,0 --3,246.3,0,0 --3,247.2,0,0 --3,248.1,0,0 --3,249,0,0 --3,249.9,0,0 --3,250.8,0,0 --3,251.7,0,0 --3,252.6,0,0 --3,253.5,0,0 --3,254.4,0,0 --3,255.3,0,0 --3,256.2,0,0 --3,257.1,0,0 --3,258,0,0 --3,258.9,0,0 --3,259.8,0,0 --3,260.8,0,0 --3,261.7,0,0 --3,262.6,0,0 --3,263.5,0,0 --3,264.4,0,0 --3,265.3,0,0 --3,266.2,0,0 --3,267.1,0,0 --3,268,0,0 --3,268.9,0,0 --3,269.8,0,0 --3,270.7,0,0 --3,271.6,0,0 --3,272.5,0,0 --3,273.4,0,0 --3,274.3,0,0 --3,275.2,0,0 --3,276.1,0,0 --3,277,0,0 --3,277.9,0,0 --3,278.8,0,0 --3,279.7,0,0 --3,280.6,0,0 --3,281.5,0,0 --3,282.4,0,0 --3,283.3,0,0 --3,284.2,0,0 --3,285.1,0,0 --3,286,0,0 --3,286.9,0,0 --3,287.8,0,0 --3,288.7,0,0 --3,289.6,0,0 --3,290.5,0,0 --3,291.4,0,0 --3,292.3,0,0 --3,293.2,0,0 --3,294.1,0,0 --3,295,0,0 --3,295.9,0,0 --3,296.8,0,0 --3,297.7,0,0 --3,298.6,0,0 --3,299.5,0,0 --3,300.5,0,0 --3,301.4,0,0 --3,302.3,0,0 --3,303.2,0,0 --3,304.1,0,0 --3,305,0,0 --3,305.9,0,0 --3,306.8,0,0 --3,307.7,0,0 --3,308.6,0,0 --3,309.5,0,0 --3,310.4,0,0 --3,311.3,0,0 --3,312.2,0,0 --3,313.1,0,0 --3,314,0,0 --3,314.9,0,0 --3,315.8,0,0 --3,316.7,0,0 --3,317.6,0,0 --3,318.5,0,0 --3,319.4,0,0 --3,320.3,0,0 --3,321.2,0,0 --3,322.1,0,0 --3,323,0,0 --3,323.9,0,0 --3,324.8,0,0 --3,325.7,0,0 --3,326.6,0,0 --3,327.5,0,0 --3,328.4,0,0 --3,329.3,0,0 --3,330.2,0,0 --3,331.1,0,0 --3,332,0,0 --3,332.9,0,0 --3,333.8,0,0 --3,334.7,0,0 --3,335.6,0,0 --3,336.5,0,0 --3,337.4,0,0 --3,338.3,0,0 --3,339.2,0,0 --3,340.2,0,0 --3,341.1,0,0 --3,342,0,0 --3,342.9,0,0 --3,343.8,0,0 --3,344.7,0,0 --3,345.6,0,0 --3,346.5,0,0 --3,347.4,0,0 --3,348.3,0,0 --3,349.2,0,0 --3,350.1,0,0 --3,351,0,0 --3,351.9,0,0 --3,352.8,0,0 --3,353.7,0,0 --3,354.6,0,0 --3,355.5,0,0 --3,356.4,0,0 --3,357.3,0,0 --3,358.2,0,0 --3,359.1,0,0 --3,360,0,0 diff --git a/scripts/trajectories/rotate_euler_quaternion_5s_delayed.csv b/scripts/trajectories/rotate_euler_quaternion_5s_delayed.csv deleted file mode 100644 index 99c54e3c52a9252d38520920c392e0df553611e1..0000000000000000000000000000000000000000 --- a/scripts/trajectories/rotate_euler_quaternion_5s_delayed.csv +++ /dev/null @@ -1,1020 +0,0 @@ --3,360,0,0 --3,360,0,0 --3,360,0,0 --3,360,0,0 --3,360,0,0 --3,360,0,0 --3,360,0,0 --3,360,0,0 --3,360,0,0 --3,360,0,0 --3,360,0,0 --3,360,0,0 --3,360,0,0 --3,360,0,0 --3,360,0,0 --3,360,0,0 --3,360,0,0 --3,360,0,0 --3,360,0,0 --3,360,0,0 --3,360,0,0 --3,359.1,0,0 --3,358.2,0,0 --3,357.3,0,0 --3,356.4,0,0 --3,355.5,0,0 --3,354.6,0,0 --3,353.7,0,0 --3,352.8,0,0 --3,351.9,0,0 --3,351,0,0 --3,350.1,0,0 --3,349.2,0,0 --3,348.3,0,0 --3,347.4,0,0 --3,346.5,0,0 --3,345.6,0,0 --3,344.7,0,0 --3,343.8,0,0 --3,342.9,0,0 --3,342,0,0 --3,341.1,0,0 --3,340.2,0,0 --3,339.2,0,0 --3,338.3,0,0 --3,337.4,0,0 --3,336.5,0,0 --3,335.6,0,0 --3,334.7,0,0 --3,333.8,0,0 --3,332.9,0,0 --3,332,0,0 --3,331.1,0,0 --3,330.2,0,0 --3,329.3,0,0 --3,328.4,0,0 --3,327.5,0,0 --3,326.6,0,0 --3,325.7,0,0 --3,324.8,0,0 --3,323.9,0,0 --3,323,0,0 --3,322.1,0,0 --3,321.2,0,0 --3,320.3,0,0 --3,319.4,0,0 --3,318.5,0,0 --3,317.6,0,0 --3,316.7,0,0 --3,315.8,0,0 --3,314.9,0,0 --3,314,0,0 --3,313.1,0,0 --3,312.2,0,0 --3,311.3,0,0 --3,310.4,0,0 --3,309.5,0,0 --3,308.6,0,0 --3,307.7,0,0 --3,306.8,0,0 --3,305.9,0,0 --3,305,0,0 --3,304.1,0,0 --3,303.2,0,0 --3,302.3,0,0 --3,301.4,0,0 --3,300.5,0,0 --3,299.5,0,0 --3,298.6,0,0 --3,297.7,0,0 --3,296.8,0,0 --3,295.9,0,0 --3,295,0,0 --3,294.1,0,0 --3,293.2,0,0 --3,292.3,0,0 --3,291.4,0,0 --3,290.5,0,0 --3,289.6,0,0 --3,288.7,0,0 --3,287.8,0,0 --3,286.9,0,0 --3,286,0,0 --3,285.1,0,0 --3,284.2,0,0 --3,283.3,0,0 --3,282.4,0,0 --3,281.5,0,0 --3,280.6,0,0 --3,279.7,0,0 --3,278.8,0,0 --3,277.9,0,0 --3,277,0,0 --3,276.1,0,0 --3,275.2,0,0 --3,274.3,0,0 --3,273.4,0,0 --3,272.5,0,0 --3,271.6,0,0 --3,270.7,0,0 --3,269.8,0,0 --3,268.9,0,0 --3,268,0,0 --3,267.1,0,0 --3,266.2,0,0 --3,265.3,0,0 --3,264.4,0,0 --3,263.5,0,0 --3,262.6,0,0 --3,261.7,0,0 --3,260.8,0,0 --3,259.8,0,0 --3,258.9,0,0 --3,258,0,0 --3,257.1,0,0 --3,256.2,0,0 --3,255.3,0,0 --3,254.4,0,0 --3,253.5,0,0 --3,252.6,0,0 --3,251.7,0,0 --3,250.8,0,0 --3,249.9,0,0 --3,249,0,0 --3,248.1,0,0 --3,247.2,0,0 --3,246.3,0,0 --3,245.4,0,0 --3,244.5,0,0 --3,243.6,0,0 --3,242.7,0,0 --3,241.8,0,0 --3,240.9,0,0 --3,240,0,0 --3,239.1,0,0 --3,238.2,0,0 --3,237.3,0,0 --3,236.4,0,0 --3,235.5,0,0 --3,234.6,0,0 --3,233.7,0,0 --3,232.8,0,0 --3,231.9,0,0 --3,231,0,0 --3,230.1,0,0 --3,229.2,0,0 --3,228.3,0,0 --3,227.4,0,0 --3,226.5,0,0 --3,225.6,0,0 --3,224.7,0,0 --3,223.8,0,0 --3,222.9,0,0 --3,222,0,0 --3,221.1,0,0 --3,220.2,0,0 --3,219.2,0,0 --3,218.3,0,0 --3,217.4,0,0 --3,216.5,0,0 --3,215.6,0,0 --3,214.7,0,0 --3,213.8,0,0 --3,212.9,0,0 --3,212,0,0 --3,211.1,0,0 --3,210.2,0,0 --3,209.3,0,0 --3,208.4,0,0 --3,207.5,0,0 --3,206.6,0,0 --3,205.7,0,0 --3,204.8,0,0 --3,203.9,0,0 --3,203,0,0 --3,202.1,0,0 --3,201.2,0,0 --3,200.3,0,0 --3,199.4,0,0 --3,198.5,0,0 --3,197.6,0,0 --3,196.7,0,0 --3,195.8,0,0 --3,194.9,0,0 --3,194,0,0 --3,193.1,0,0 --3,192.2,0,0 --3,191.3,0,0 --3,190.4,0,0 --3,189.5,0,0 --3,188.6,0,0 --3,187.7,0,0 --3,186.8,0,0 --3,185.9,0,0 --3,185,0,0 --3,184.1,0,0 --3,183.2,0,0 --3,182.3,0,0 --3,181.4,0,0 --3,180.5,0,0 --3,179.5,-90,0 --3,178.6,-89.5,0 --3,177.7,-89.1,0 --3,176.8,-88.6,0 --3,175.9,-88.2,0 --3,175,-87.7,0 --3,174.1,-87.3,0 --3,173.2,-86.8,0 --3,172.3,-86.4,0 --3,171.4,-85.9,0 --3,170.5,-85.5,0 --3,169.6,-85,0 --3,168.7,-84.6,0 --3,167.8,-84.1,0 --3,166.9,-83.7,0 --3,166,-83.2,0 --3,165.1,-82.8,0 --3,164.2,-82.3,0 --3,163.3,-81.9,0 --3,162.4,-81.4,0 --3,161.5,-81,0 --3,160.6,-80.5,0 --3,159.7,-80.1,0 --3,158.8,-79.6,0 --3,157.9,-79.1,0 --3,157,-78.7,0 --3,156.1,-78.2,0 --3,155.2,-77.8,0 --3,154.3,-77.3,0 --3,153.4,-76.9,0 --3,152.5,-76.4,0 --3,151.6,-76,0 --3,150.7,-75.5,0 --3,149.8,-75.1,0 --3,148.9,-74.6,0 --3,148,-74.2,0 --3,147.1,-73.7,0 --3,146.2,-73.3,0 --3,145.3,-72.8,0 --3,144.4,-72.4,0 --3,143.5,-71.9,0 --3,142.6,-71.5,0 --3,141.7,-71,0 --3,140.8,-70.6,0 --3,139.8,-70.1,0 --3,138.9,-69.6,0 --3,138,-69.2,0 --3,137.1,-68.7,0 --3,136.2,-68.3,0 --3,135.3,-67.8,0 --3,134.4,-67.4,0 --3,133.5,-66.9,0 --3,132.6,-66.5,0 --3,131.7,-66,0 --3,130.8,-65.6,0 --3,129.9,-65.1,0 --3,129,-64.7,0 --3,128.1,-64.2,0 --3,127.2,-63.8,0 --3,126.3,-63.3,0 --3,125.4,-62.9,0 --3,124.5,-62.4,0 --3,123.6,-62,0 --3,122.7,-61.5,0 --3,121.8,-61.1,0 --3,120.9,-60.6,0 --3,120,-60.2,0 --3,119.1,-59.7,0 --3,118.2,-59.2,0 --3,117.3,-58.8,0 --3,116.4,-58.3,0 --3,115.5,-57.9,0 --3,114.6,-57.4,0 --3,113.7,-57,0 --3,112.8,-56.5,0 --3,111.9,-56.1,0 --3,111,-55.6,0 --3,110.1,-55.2,0 --3,109.2,-54.7,0 --3,108.3,-54.3,0 --3,107.4,-53.8,0 --3,106.5,-53.4,0 --3,105.6,-52.9,0 --3,104.7,-52.5,0 --3,103.8,-52,0 --3,102.9,-51.6,0 --3,102,-51.1,0 --3,101.1,-50.7,0 --3,100.2,-50.2,0 --3,99.2,-49.7,0 --3,98.3,-49.3,0 --3,97.4,-48.8,0 --3,96.5,-48.4,0 --3,95.6,-47.9,0 --3,94.7,-47.5,0 --3,93.8,-47,0 --3,92.9,-46.6,0 --3,92,-46.1,0 --3,91.1,-45.7,0 --3,90.2,-45.2,0 --3,89.3,-44.8,90 --3,88.4,-44.3,89.1 --3,87.5,-43.9,88.2 --3,86.6,-43.4,87.3 --3,85.7,-43,86.4 --3,84.8,-42.5,85.5 --3,83.9,-42.1,84.5 --3,83,-41.6,83.6 --3,82.1,-41.2,82.7 --3,81.2,-40.7,81.8 --3,80.3,-40.3,80.9 --3,79.4,-39.8,80 --3,78.5,-39.3,79.1 --3,77.6,-38.9,78.2 --3,76.7,-38.4,77.3 --3,75.8,-38,76.4 --3,74.9,-37.5,75.5 --3,74,-37.1,74.5 --3,73.1,-36.6,73.6 --3,72.2,-36.2,72.7 --3,71.3,-35.7,71.8 --3,70.4,-35.3,70.9 --3,69.5,-34.8,70 --3,68.6,-34.4,69.1 --3,67.7,-33.9,68.2 --3,66.8,-33.5,67.3 --3,65.9,-33,66.4 --3,65,-32.6,65.5 --3,64.1,-32.1,64.5 --3,63.2,-31.7,63.6 --3,62.3,-31.2,62.7 --3,61.4,-30.8,61.8 --3,60.5,-30.3,60.9 --3,59.5,-29.8,60 --3,58.6,-29.4,59.1 --3,57.7,-28.9,58.2 --3,56.8,-28.5,57.3 --3,55.9,-28,56.4 --3,55,-27.6,55.5 --3,54.1,-27.1,54.5 --3,53.2,-26.7,53.6 --3,52.3,-26.2,52.7 --3,51.4,-25.8,51.8 --3,50.5,-25.3,50.9 --3,49.6,-24.9,50 --3,48.7,-24.4,49.1 --3,47.8,-24,48.2 --3,46.9,-23.5,47.3 --3,46,-23.1,46.4 --3,45.1,-22.6,45.5 --3,44.2,-22.2,44.5 --3,43.3,-21.7,43.6 --3,42.4,-21.3,42.7 --3,41.5,-20.8,41.8 --3,40.6,-20.4,40.9 --3,39.7,-19.9,40 --3,38.8,-19.4,39.1 --3,37.9,-19,38.2 --3,37,-18.5,37.3 --3,36.1,-18.1,36.4 --3,35.2,-17.6,35.5 --3,34.3,-17.2,34.5 --3,33.4,-16.7,33.6 --3,32.5,-16.3,32.7 --3,31.6,-15.8,31.8 --3,30.7,-15.4,30.9 --3,29.8,-14.9,30 --3,28.9,-14.5,29.1 --3,28,-14,28.2 --3,27.1,-13.6,27.3 --3,26.2,-13.1,26.4 --3,25.3,-12.7,25.5 --3,24.4,-12.2,24.5 --3,23.5,-11.8,23.6 --3,22.6,-11.3,22.7 --3,21.7,-10.9,21.8 --3,20.8,-10.4,20.9 --3,19.8,-9.9,20 --3,18.9,-9.5,19.1 --3,18,-9,18.2 --3,17.1,-8.6,17.3 --3,16.2,-8.1,16.4 --3,15.3,-7.7,15.5 --3,14.4,-7.2,14.5 --3,13.5,-6.8,13.6 --3,12.6,-6.3,12.7 --3,11.7,-5.9,11.8 --3,10.8,-5.4,10.9 --3,9.9,-5,10 --3,9,-4.5,9.1 --3,8.1,-4.1,8.2 --3,7.2,-3.6,7.3 --3,6.3,-3.2,6.4 --3,5.4,-2.7,5.5 --3,4.5,-2.3,4.5 --3,3.6,-1.8,3.6 --3,2.7,-1.4,2.7 --3,1.8,-0.9,1.8 --3,0.9,-0.5,0.9 --3,0,0,0 -1,0,0,0 -1,0,0,0 -1,0,0,0 -1,0,0,0 -1,0,0,0.1 -1,0,0,0.1 -1,0,0,0.1 -1,0,0,0.1 -1,0,0,0.1 -1,0,0,0.1 -1,0,0,0.2 -1,0,0,0.2 -1,0,0,0.2 -1,0,0,0.2 -1,0,0,0.2 -1,0,0,0.2 -1,0,0,0.2 -1,0,0,0.3 -1,0,0,0.3 -1,0,0,0.3 -1,0,0,0.3 -0.9,0,0,0.3 -0.9,0,0,0.3 -0.9,0,0,0.4 -0.9,0,0,0.4 -0.9,0,0,0.4 -0.9,0,0,0.4 -0.9,0,0,0.4 -0.9,0,0,0.4 -0.9,0,0,0.4 -0.9,0,0,0.5 -0.9,0,0,0.5 -0.9,0,0,0.5 -0.9,0,0,0.5 -0.9,0,0,0.5 -0.9,0,0,0.5 -0.8,0,0,0.5 -0.8,0,0,0.5 -0.8,0,0,0.6 -0.8,0,0,0.6 -0.8,0,0,0.6 -0.8,0,0,0.6 -0.8,0,0,0.6 -0.8,0,0,0.6 -0.8,0,0,0.6 -0.8,0,0,0.6 -0.8,0,0,0.7 -0.7,0,0,0.7 -0.7,0,0,0.7 -0.7,0,0,0.7 -0.7,0,0,0.7 -0.7,0,0,0.7 -0.7,0,0,0.7 -0.7,0,0,0.7 -0.7,0,0,0.8 -0.6,0,0,0.8 -0.6,0,0,0.8 -0.6,0,0,0.8 -0.6,0,0,0.8 -0.6,0,0,0.8 -0.6,0,0,0.8 -0.6,0,0,0.8 -0.6,0,0,0.8 -0.5,0,0,0.8 -0.5,0,0,0.8 -0.5,0,0,0.9 -0.5,0,0,0.9 -0.5,0,0,0.9 -0.5,0,0,0.9 -0.5,0,0,0.9 -0.5,0,0,0.9 -0.4,0,0,0.9 -0.4,0,0,0.9 -0.4,0,0,0.9 -0.4,0,0,0.9 -0.4,0,0,0.9 -0.4,0,0,0.9 -0.4,0,0,0.9 -0.3,0,0,0.9 -0.3,0,0,0.9 -0.3,0,0,1 -0.3,0,0,1 -0.3,0,0,1 -0.3,0,0,1 -0.2,0,0,1 -0.2,0,0,1 -0.2,0,0,1 -0.2,0,0,1 -0.2,0,0,1 -0.2,0,0,1 -0.2,0,0,1 -0.1,0,0,1 -0.1,0,0,1 -0.1,0,0,1 -0.1,0,0,1 -0.1,0,0,1 -0.1,0,0,1 -0,0,0,1 -0,0,0,1 -0,0,0,1 -0,0,0,1 -0,0,0,1 -0,0,0,1 -0.1,0,0,1 -0.1,0,0,1 -0.1,0,0,1 -0.1,0,0,1 -0.1,0,0,1 -0.1,0,0,1 -0.2,0,0,1 -0.2,0,0,1 -0.2,0,0,1 -0.2,0,0,1 -0.2,0,0,1 -0.2,0,0,1 -0.2,0,0,1 -0.3,0,0,1 -0.3,0,0,1 -0.3,0,0,1 -0.3,0,0,1 -0.3,0,0,0.9 -0.3,0,0,0.9 -0.4,0,0,0.9 -0.4,0,0,0.9 -0.4,0,0,0.9 -0.4,0,0,0.9 -0.4,0,0,0.9 -0.4,0,0,0.9 -0.4,0,0,0.9 -0.5,0,0,0.9 -0.5,0,0,0.9 -0.5,0,0,0.9 -0.5,0,0,0.9 -0.5,0,0,0.9 -0.5,0,0,0.9 -0.5,0,0,0.8 -0.5,0,0,0.8 -0.6,0,0,0.8 -0.6,0,0,0.8 -0.6,0,0,0.8 -0.6,0,0,0.8 -0.6,0,0,0.8 -0.6,0,0,0.8 -0.6,0,0,0.8 -0.6,0,0,0.8 -0.7,0,0,0.8 -0.7,0,0,0.7 -0.7,0,0,0.7 -0.7,0,0,0.7 -0.7,0,0,0.7 -0.7,0,0,0.7 -0.7,0,0,0.7 -0.7,0,0,0.7 -0.8,0,0,0.7 -0.8,0,0,0.6 -0.8,0,0,0.6 -0.8,0,0,0.6 -0.8,0,0,0.6 -0.8,0,0,0.6 -0.8,0,0,0.6 -0.8,0,0,0.6 -0.8,0,0,0.6 -0.8,0,0,0.5 -0.8,0,0,0.5 -0.9,0,0,0.5 -0.9,0,0,0.5 -0.9,0,0,0.5 -0.9,0,0,0.5 -0.9,0,0,0.5 -0.9,0,0,0.5 -0.9,0,0,0.4 -0.9,0,0,0.4 -0.9,0,0,0.4 -0.9,0,0,0.4 -0.9,0,0,0.4 -0.9,0,0,0.4 -0.9,0,0,0.4 -0.9,0,0,0.3 -0.9,0,0,0.3 -1,0,0,0.3 -1,0,0,0.3 -1,0,0,0.3 -1,0,0,0.3 -1,0,0,0.2 -1,0,0,0.2 -1,0,0,0.2 -1,0,0,0.2 -1,0,0,0.2 -1,0,0,0.2 -1,0,0,0.2 -1,0,0,0.1 -1,0,0,0.1 -1,0,0,0.1 -1,0,0,0.1 -1,0,0,0.1 -1,0,0,0.1 -1,0,0,0 -1,0,0,0 -1,0,0,0 -1,0,0,0 --3,0,0,0 --3,0.9,-0.5,0.9 --3,1.8,-0.9,1.8 --3,2.7,-1.4,2.7 --3,3.6,-1.8,3.6 --3,4.5,-2.3,4.5 --3,5.4,-2.7,5.5 --3,6.3,-3.2,6.4 --3,7.2,-3.6,7.3 --3,8.1,-4.1,8.2 --3,9,-4.5,9.1 --3,9.9,-5,10 --3,10.8,-5.4,10.9 --3,11.7,-5.9,11.8 --3,12.6,-6.3,12.7 --3,13.5,-6.8,13.6 --3,14.4,-7.2,14.5 --3,15.3,-7.7,15.5 --3,16.2,-8.1,16.4 --3,17.1,-8.6,17.3 --3,18,-9,18.2 --3,18.9,-9.5,19.1 --3,19.8,-9.9,20 --3,20.8,-10.4,20.9 --3,21.7,-10.9,21.8 --3,22.6,-11.3,22.7 --3,23.5,-11.8,23.6 --3,24.4,-12.2,24.5 --3,25.3,-12.7,25.5 --3,26.2,-13.1,26.4 --3,27.1,-13.6,27.3 --3,28,-14,28.2 --3,28.9,-14.5,29.1 --3,29.8,-14.9,30 --3,30.7,-15.4,30.9 --3,31.6,-15.8,31.8 --3,32.5,-16.3,32.7 --3,33.4,-16.7,33.6 --3,34.3,-17.2,34.5 --3,35.2,-17.6,35.5 --3,36.1,-18.1,36.4 --3,37,-18.5,37.3 --3,37.9,-19,38.2 --3,38.8,-19.4,39.1 --3,39.7,-19.9,40 --3,40.6,-20.4,40.9 --3,41.5,-20.8,41.8 --3,42.4,-21.3,42.7 --3,43.3,-21.7,43.6 --3,44.2,-22.2,44.5 --3,45.1,-22.6,45.5 --3,46,-23.1,46.4 --3,46.9,-23.5,47.3 --3,47.8,-24,48.2 --3,48.7,-24.4,49.1 --3,49.6,-24.9,50 --3,50.5,-25.3,50.9 --3,51.4,-25.8,51.8 --3,52.3,-26.2,52.7 --3,53.2,-26.7,53.6 --3,54.1,-27.1,54.5 --3,55,-27.6,55.5 --3,55.9,-28,56.4 --3,56.8,-28.5,57.3 --3,57.7,-28.9,58.2 --3,58.6,-29.4,59.1 --3,59.5,-29.8,60 --3,60.5,-30.3,60.9 --3,61.4,-30.8,61.8 --3,62.3,-31.2,62.7 --3,63.2,-31.7,63.6 --3,64.1,-32.1,64.5 --3,65,-32.6,65.5 --3,65.9,-33,66.4 --3,66.8,-33.5,67.3 --3,67.7,-33.9,68.2 --3,68.6,-34.4,69.1 --3,69.5,-34.8,70 --3,70.4,-35.3,70.9 --3,71.3,-35.7,71.8 --3,72.2,-36.2,72.7 --3,73.1,-36.6,73.6 --3,74,-37.1,74.5 --3,74.9,-37.5,75.5 --3,75.8,-38,76.4 --3,76.7,-38.4,77.3 --3,77.6,-38.9,78.2 --3,78.5,-39.3,79.1 --3,79.4,-39.8,80 --3,80.3,-40.3,80.9 --3,81.2,-40.7,81.8 --3,82.1,-41.2,82.7 --3,83,-41.6,83.6 --3,83.9,-42.1,84.5 --3,84.8,-42.5,85.5 --3,85.7,-43,86.4 --3,86.6,-43.4,87.3 --3,87.5,-43.9,88.2 --3,88.4,-44.3,89.1 --3,89.3,-44.8,90 --3,90.2,-45.2,0 --3,91.1,-45.7,0 --3,92,-46.1,0 --3,92.9,-46.6,0 --3,93.8,-47,0 --3,94.7,-47.5,0 --3,95.6,-47.9,0 --3,96.5,-48.4,0 --3,97.4,-48.8,0 --3,98.3,-49.3,0 --3,99.2,-49.7,0 --3,100.2,-50.2,0 --3,101.1,-50.7,0 --3,102,-51.1,0 --3,102.9,-51.6,0 --3,103.8,-52,0 --3,104.7,-52.5,0 --3,105.6,-52.9,0 --3,106.5,-53.4,0 --3,107.4,-53.8,0 --3,108.3,-54.3,0 --3,109.2,-54.7,0 --3,110.1,-55.2,0 --3,111,-55.6,0 --3,111.9,-56.1,0 --3,112.8,-56.5,0 --3,113.7,-57,0 --3,114.6,-57.4,0 --3,115.5,-57.9,0 --3,116.4,-58.3,0 --3,117.3,-58.8,0 --3,118.2,-59.2,0 --3,119.1,-59.7,0 --3,120,-60.2,0 --3,120.9,-60.6,0 --3,121.8,-61.1,0 --3,122.7,-61.5,0 --3,123.6,-62,0 --3,124.5,-62.4,0 --3,125.4,-62.9,0 --3,126.3,-63.3,0 --3,127.2,-63.8,0 --3,128.1,-64.2,0 --3,129,-64.7,0 --3,129.9,-65.1,0 --3,130.8,-65.6,0 --3,131.7,-66,0 --3,132.6,-66.5,0 --3,133.5,-66.9,0 --3,134.4,-67.4,0 --3,135.3,-67.8,0 --3,136.2,-68.3,0 --3,137.1,-68.7,0 --3,138,-69.2,0 --3,138.9,-69.6,0 --3,139.8,-70.1,0 --3,140.8,-70.6,0 --3,141.7,-71,0 --3,142.6,-71.5,0 --3,143.5,-71.9,0 --3,144.4,-72.4,0 --3,145.3,-72.8,0 --3,146.2,-73.3,0 --3,147.1,-73.7,0 --3,148,-74.2,0 --3,148.9,-74.6,0 --3,149.8,-75.1,0 --3,150.7,-75.5,0 --3,151.6,-76,0 --3,152.5,-76.4,0 --3,153.4,-76.9,0 --3,154.3,-77.3,0 --3,155.2,-77.8,0 --3,156.1,-78.2,0 --3,157,-78.7,0 --3,157.9,-79.1,0 --3,158.8,-79.6,0 --3,159.7,-80.1,0 --3,160.6,-80.5,0 --3,161.5,-81,0 --3,162.4,-81.4,0 --3,163.3,-81.9,0 --3,164.2,-82.3,0 --3,165.1,-82.8,0 --3,166,-83.2,0 --3,166.9,-83.7,0 --3,167.8,-84.1,0 --3,168.7,-84.6,0 --3,169.6,-85,0 --3,170.5,-85.5,0 --3,171.4,-85.9,0 --3,172.3,-86.4,0 --3,173.2,-86.8,0 --3,174.1,-87.3,0 --3,175,-87.7,0 --3,175.9,-88.2,0 --3,176.8,-88.6,0 --3,177.7,-89.1,0 --3,178.6,-89.5,0 --3,179.5,-90,0 --3,180.5,0,0 --3,181.4,0,0 --3,182.3,0,0 --3,183.2,0,0 --3,184.1,0,0 --3,185,0,0 --3,185.9,0,0 --3,186.8,0,0 --3,187.7,0,0 --3,188.6,0,0 --3,189.5,0,0 --3,190.4,0,0 --3,191.3,0,0 --3,192.2,0,0 --3,193.1,0,0 --3,194,0,0 --3,194.9,0,0 --3,195.8,0,0 --3,196.7,0,0 --3,197.6,0,0 --3,198.5,0,0 --3,199.4,0,0 --3,200.3,0,0 --3,201.2,0,0 --3,202.1,0,0 --3,203,0,0 --3,203.9,0,0 --3,204.8,0,0 --3,205.7,0,0 --3,206.6,0,0 --3,207.5,0,0 --3,208.4,0,0 --3,209.3,0,0 --3,210.2,0,0 --3,211.1,0,0 --3,212,0,0 --3,212.9,0,0 --3,213.8,0,0 --3,214.7,0,0 --3,215.6,0,0 --3,216.5,0,0 --3,217.4,0,0 --3,218.3,0,0 --3,219.2,0,0 --3,220.2,0,0 --3,221.1,0,0 --3,222,0,0 --3,222.9,0,0 --3,223.8,0,0 --3,224.7,0,0 --3,225.6,0,0 --3,226.5,0,0 --3,227.4,0,0 --3,228.3,0,0 --3,229.2,0,0 --3,230.1,0,0 --3,231,0,0 --3,231.9,0,0 --3,232.8,0,0 --3,233.7,0,0 --3,234.6,0,0 --3,235.5,0,0 --3,236.4,0,0 --3,237.3,0,0 --3,238.2,0,0 --3,239.1,0,0 --3,240,0,0 --3,240.9,0,0 --3,241.8,0,0 --3,242.7,0,0 --3,243.6,0,0 --3,244.5,0,0 --3,245.4,0,0 --3,246.3,0,0 --3,247.2,0,0 --3,248.1,0,0 --3,249,0,0 --3,249.9,0,0 --3,250.8,0,0 --3,251.7,0,0 --3,252.6,0,0 --3,253.5,0,0 --3,254.4,0,0 --3,255.3,0,0 --3,256.2,0,0 --3,257.1,0,0 --3,258,0,0 --3,258.9,0,0 --3,259.8,0,0 --3,260.8,0,0 --3,261.7,0,0 --3,262.6,0,0 --3,263.5,0,0 --3,264.4,0,0 --3,265.3,0,0 --3,266.2,0,0 --3,267.1,0,0 --3,268,0,0 --3,268.9,0,0 --3,269.8,0,0 --3,270.7,0,0 --3,271.6,0,0 --3,272.5,0,0 --3,273.4,0,0 --3,274.3,0,0 --3,275.2,0,0 --3,276.1,0,0 --3,277,0,0 --3,277.9,0,0 --3,278.8,0,0 --3,279.7,0,0 --3,280.6,0,0 --3,281.5,0,0 --3,282.4,0,0 --3,283.3,0,0 --3,284.2,0,0 --3,285.1,0,0 --3,286,0,0 --3,286.9,0,0 --3,287.8,0,0 --3,288.7,0,0 --3,289.6,0,0 --3,290.5,0,0 --3,291.4,0,0 --3,292.3,0,0 --3,293.2,0,0 --3,294.1,0,0 --3,295,0,0 --3,295.9,0,0 --3,296.8,0,0 --3,297.7,0,0 --3,298.6,0,0 --3,299.5,0,0 --3,300.5,0,0 --3,301.4,0,0 --3,302.3,0,0 --3,303.2,0,0 --3,304.1,0,0 --3,305,0,0 --3,305.9,0,0 --3,306.8,0,0 --3,307.7,0,0 --3,308.6,0,0 --3,309.5,0,0 --3,310.4,0,0 --3,311.3,0,0 --3,312.2,0,0 --3,313.1,0,0 --3,314,0,0 --3,314.9,0,0 --3,315.8,0,0 --3,316.7,0,0 --3,317.6,0,0 --3,318.5,0,0 --3,319.4,0,0 --3,320.3,0,0 --3,321.2,0,0 --3,322.1,0,0 --3,323,0,0 --3,323.9,0,0 --3,324.8,0,0 --3,325.7,0,0 --3,326.6,0,0 --3,327.5,0,0 --3,328.4,0,0 --3,329.3,0,0 --3,330.2,0,0 --3,331.1,0,0 --3,332,0,0 --3,332.9,0,0 --3,333.8,0,0 --3,334.7,0,0 --3,335.6,0,0 --3,336.5,0,0 --3,337.4,0,0 --3,338.3,0,0 --3,339.2,0,0 --3,340.2,0,0 --3,341.1,0,0 --3,342,0,0 --3,342.9,0,0 --3,343.8,0,0 --3,344.7,0,0 --3,345.6,0,0 --3,346.5,0,0 --3,347.4,0,0 --3,348.3,0,0 --3,349.2,0,0 --3,350.1,0,0 --3,351,0,0 --3,351.9,0,0 --3,352.8,0,0 --3,353.7,0,0 --3,354.6,0,0 --3,355.5,0,0 --3,356.4,0,0 --3,357.3,0,0 --3,358.2,0,0 --3,359.1,0,0 --3,360,0,0 diff --git a/tests/conftest.py b/tests/conftest.py index 5ce1485b717ee93de78341826da17fc618adbb3a..6f293b9502b058903416b4d99f4601055300c26e 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -128,6 +128,12 @@ def pytest_addoption(parser): help="If specified, use given binary as DUT decoder.", ) + parser.addoption( + "--dut_postrend_path", + action="store", + help="If specified, use given binary as DUT ISAR post-renderer.", + ) + parser.addoption( "--ref_encoder_path", action="store", @@ -140,6 +146,12 @@ def pytest_addoption(parser): help="If specified, use given binary as REF decoder.", ) + parser.addoption( + "--ref_postrend_path", + action="store", + help="If specified, use given binary as REF ISAR post-renderer.", + ) + parser.addoption( "--test_vector_path", action="store", @@ -1321,3 +1333,216 @@ def get_format_from_enc_opts(enc_opts: str) -> str: format = IVAS_ENC_FORMATS[enc_format_str] return format + + +@pytest.fixture(scope="session") +def dut_postrend_path(request) -> Optional[str]: + """ + Return path of DUT postrend binary. + """ + if request.config.option.dut_postrend_path: + return request.config.option.dut_postrend_path + + if request.config.option.update_ref == "1": + return None + + here = Path(__file__).parent.resolve() + system = platform.system() + + if system == "Windows": + path = here.joinpath("../ISAR_post_rend.exe") + elif system in ["Darwin", "Linux"]: + path = here.joinpath("../ISAR_post_rend") + else: + raise ValueError(f'Wrong system "{system}"!') + + path = str(path.resolve()) + + if not os.path.isfile(path): + raise FileNotFoundError(f"DUT postrend binary {path} not found!\n!") + + return path + + +class PostRendFrontend: + def __init__(self, path, postrend_type, timeout=None, fr=20) -> None: + self._path = Path(path).absolute() + self._type = postrend_type + self.returncode = None + self.stdout = None + self.stderr = None + self.timeout = timeout + self.fr = fr + + def run( + self, + output_sampling_rate: int, + input_path: Path, + output_path: Path, + head_trajectory: Path, + metadata_input_path: Optional[Path] = None, + quiet_mode: Optional[bool] = True, + bfi_file: Optional[Path] = None, + add_option_list: Optional[list] = None, + run_dir: Optional[Path] = None, + ) -> None: + command = [str(self._path)] + + # add optional parameters + if quiet_mode: + command.extend(["-q"]) + + if bfi_file is not None: + command.extend(["-prbfi", str(bfi_file)]) + + if add_option_list is not None: + command.extend(add_option_list) + + if metadata_input_path is not None: + # If we have metadata input file, then input format must be PCM + command.extend(["-if", "BINAURAL_SPLIT_PCM"]) + command.extend(["-im", str(metadata_input_path)]) + else: + command.extend(["-if", "BINAURAL_SPLIT_CODED"]) + + command.extend( + [ + "-fr", + str(self.fr), + "-fs", + str(output_sampling_rate), + "-i", + str(input_path), + "-o", + str(output_path), + "-T", + str(head_trajectory), + ] + ) + + cmd_str = textwrap.indent(" ".join(command), prefix="\t") + log_dbg_msg(f"{self._type} post-rend command:\n{cmd_str}") + + try: + with tempfile.TemporaryDirectory() as tmp_dir: + if run_dir is None: + cwd = Path(tmp_dir).absolute() + else: + cwd = Path(run_dir).absolute() + result = run( + command, + capture_output=True, + check=False, + timeout=self.timeout, + cwd=cwd, + ) + except TimeoutExpired: + pytest.fail(f"{self._type} post-rend run timed out after {self.timeout}s.") + + self.returncode = result.returncode + self.stderr = result.stderr.decode("ascii") + self.stdout = result.stdout.decode("ascii") + if self.stdout: + stdout_str = textwrap.indent(self.stdout, prefix="\t") + log_dbg_msg(f"{self._type} post-rend stdout:\n{stdout_str}") + if self.stderr: + stderr_str = textwrap.indent(self.stderr, prefix="\t") + log_dbg_msg(f"{self._type} post-rend stderr:\n{stderr_str}") + if self.returncode: + pytest.fail( + f"{self._type} post-rend terminated with a non-0 return code: {self.returncode}" + ) + if self.stderr and "UndefinedBehaviorSanitizer" in self.stderr: + pytest.fail("Undefined Behaviour runtime error encountered") + + def _check_run(self): + if self.returncode is not None: + if self.returncode: + pytest.fail( + f"{self._type} post-rend terminated with a non-0 return code: {self.returncode}" + ) + else: + logger.warning("%s post-rend was set-up, but not run", self._type) + # next assert is not OK since stderr contains messages even when decoding was successful + # assert not self.stderr, self._type + " decoder stderr is not empty" + + +@pytest.fixture(scope="function") +def dut_postrend_frontend(dut_postrend_path, request) -> Optional[PostRendFrontend]: + """ + Return a :class:`conftest.PostRendFrontend` instance as DUT for the test session. + """ + postrend = None + + if dut_postrend_path and request.node.funcargs["out_format"] in [ + "BINAURAL_SPLIT_CODED", + "BINAURAL_SPLIT_PCM", + ]: + timeout = request.config.getoption("--testcase_timeout") + postrend = PostRendFrontend( + dut_postrend_path, + "DUT", + timeout=timeout, + fr=request.config.option.dut_fr, + ) + + yield postrend + + # Fixture teardown + if postrend is not None: + postrend._check_run() + + +@pytest.fixture(scope="session") +def ref_postrend_path(request) -> Optional[str]: + """ + Return path of DUT postrend binary. + """ + if request.config.option.ref_postrend_path: + return request.config.option.ref_postrend_path + + if request.config.option.update_ref == "0": + return None + + here = Path(__file__).parent.resolve() + system = platform.system() + + if system == "Windows": + path = here.joinpath("../ISAR_post_rend_ref.exe") + elif system in ["Darwin", "Linux"]: + path = here.joinpath("../ISAR_post_rend_ref") + else: + raise ValueError(f'Wrong system "{system}"!') + + path = str(path.resolve()) + + if not os.path.isfile(path): + raise FileNotFoundError(f"REF postrend binary {path} not found!\n!") + + return path + + +@pytest.fixture(scope="function") +def ref_postrend_frontend(ref_postrend_path, request) -> Optional[PostRendFrontend]: + """ + Return a :class:`conftest.PostRendFrontend` instance as REF for the test session. + """ + postrend = None + + if ref_postrend_path and request.node.funcargs["out_format"] in [ + "BINAURAL_SPLIT_CODED", + "BINAURAL_SPLIT_PCM", + ]: + timeout = request.config.getoption("--testcase_timeout") + postrend = PostRendFrontend( + ref_postrend_path, + "REF", + timeout=timeout, + fr=request.config.option.dut_fr, + ) + + yield postrend + + # Fixture teardown + if postrend is not None: + postrend._check_run() diff --git a/tests/renderer/constants.py b/tests/renderer/constants.py index 85affb1b3acfa05ed6628d5fc9e8a7cb5232e4e2..2d6a4daee41b8ad5187cd1d953f9ff39ae99e862 100644 --- a/tests/renderer/constants.py +++ b/tests/renderer/constants.py @@ -332,7 +332,7 @@ FORMAT_TO_METADATA_FILES_LTV = { "ISM2MASA1": [ str(LTV_DIR.joinpath("ltvISM1.csv")), str(LTV_DIR.joinpath("ltvISM2.csv")), - str(LTV_DIR.joinpath("ltv48_OMASA_2ISM_1TC.met ")), + str(LTV_DIR.joinpath("ltv48_OMASA_2ISM_1TC.met")), ], "ISM3MASA1": [ str(LTV_DIR.joinpath("ltvISM1.csv")), diff --git a/tests/renderer/test_renderer.py b/tests/renderer/test_renderer.py index 8b68e47541bafe509f0e5259433d947bfc50025c..1f097823671c95d61e5369ab11f97df4e8a8a4d2 100644 --- a/tests/renderer/test_renderer.py +++ b/tests/renderer/test_renderer.py @@ -641,8 +641,6 @@ def test_masa_prerend( get_odg_bin, split_comparison, ): - if fs != "48kHz": - pytest.skip("MASA Prerendering at 16 and 32 kHz WIP") run_renderer( record_property, props_to_record, @@ -677,8 +675,6 @@ def test_masa_prerend_scenes( get_odg_bin, split_comparison, ): - if fs != "48kHz": - pytest.skip("MASA Prerendering at 16 and 32 kHz WIP") run_renderer( record_property, props_to_record, diff --git a/tests/renderer/utils.py b/tests/renderer/utils.py index 657b1aa61627b13dee952d974ded3e7614afaec4..9acb1b7f18101c802f3c9edb5b65af498ce85806 100644 --- a/tests/renderer/utils.py +++ b/tests/renderer/utils.py @@ -109,7 +109,10 @@ def run_ivas_isar_enc_cmd(cmd, env=None): def run_ivas_isar_dec_cmd(cmd, env=None): - logging.info(f"\nDUT decoder command:\n\t{' '.join(cmd)}\n") + if BIN_SUFFIX_MERGETARGET in cmd[0]: + logging.info(f"\nREF decoder command:\n\t{' '.join(cmd)}\n") + else: + logging.info(f"\nDUT decoder command:\n\t{' '.join(cmd)}\n") _run_cmd(cmd, env) @@ -474,6 +477,7 @@ def run_renderer( record_property(k, v) if output_differs_parts[0]: + logging.error(f"Command line was: {' '.join(cmd)}") pytest.fail(f"Output differs: ({reason_parts[0]})") # compare metadata files in case of MASA prerendering diff --git a/tests/renderer_short/README.md b/tests/renderer_short/README.md new file mode 100644 index 0000000000000000000000000000000000000000..713821c5d389adaaf89de09b0ec60d4aee84dacf --- /dev/null +++ b/tests/renderer_short/README.md @@ -0,0 +1,44 @@ +======================================== +THIS FOLDER WILL NOT BE PART OF DELIVERY +======================================== + +# External Renderer Tests + +See also the [contribution page](https://forge.3gpp.org/rep/ivas-codec-pc/ivas-codec/-/wikis/Contributions/2-external-renderer) for related presentations. + +### Run tests with: + +## Smoke test: + +```bash +python3 -m pytest -q -n auto tests/renderer/test_renderer.py +``` + +## Comparison test: + +```bash +python3 -m pytest -q -n auto tests/renderer/test_renderer.py --create_ref # requires IVAS_rend_ref in root! +python3 -m pytest -q -n auto tests/renderer/test_renderer.py --create_cut +``` + +### Important flags (see [pytest docs](https://docs.pytest.org/en/7.2.x/) for more information): + +- `-k` flag can filter test cases, e.g. `-k "test_ism_binaural_static"` +- `-rA` reports ALL (pass, xpass, xfail, fail) instead of the default behaviour of reporting only failed tests\ + this option will also report captured logs, **required for obtaining the commandline of testcases that pass or xfail** +- `--last-failed` re-runs only the cases that failed in the last test run +- `--collect-only` is useful when adding new testcases to check if argument parametrization is working correctly + +### Directory tree + +``` +. +├── compare_audio.py -> Python implementation of CompAudio, used for comparisons in tests +├── conftest.py -> Pytest configuration (enable commandline argument ingestion) +├── constants.py -> Important paths, formats, metadata files and commandline templates +├── cut -> Default location for output files for test conditions +├── data -> Input test vectors +├── ref -> Default location for output files for reference conditions +├── test_renderer.py -> Runs the renderer for all modes +└── utils.py -> Wrapper functions for executables for use in testcases +``` diff --git a/tests/renderer_short/__init__.py b/tests/renderer_short/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..26555940430c214d3c47dda947bf5fa3207220ae --- /dev/null +++ b/tests/renderer_short/__init__.py @@ -0,0 +1,31 @@ +#!/usr/bin/env python3 + +""" + (C) 2022-2025 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB, + Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., + Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, + Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other + contributors to this repository. All Rights Reserved. + + This software is protected by copyright law and by international treaties. + The IVAS codec Public Collaboration consisting of Dolby International AB, Ericsson AB, + Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., + Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, + Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other + contributors to this repository retain full ownership rights in their respective contributions in + the software. This notice grants no license of any kind, including but not limited to patent + license, nor is any license granted by implication, estoppel or otherwise. + + Contributors are required to enter into the IVAS codec Public Collaboration agreement before making + contributions. + + This software is provided "AS IS", without any express or implied warranties. The software is in the + development stage. It is intended exclusively for experts who have experience with such software and + solely for the purpose of inspection. All implied warranties of non-infringement, merchantability + and fitness for a particular purpose are hereby disclaimed and excluded. + + Any dispute, controversy or claim arising under or in relation to providing this software shall be + submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in + accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and + the United Nations Convention on Contracts on the International Sales of Goods. +""" diff --git a/tests/renderer_short/compare_audio.py b/tests/renderer_short/compare_audio.py new file mode 100644 index 0000000000000000000000000000000000000000..49bfa86c062b830cd791a5bcbc1aa48828e50eed --- /dev/null +++ b/tests/renderer_short/compare_audio.py @@ -0,0 +1,105 @@ +#!/usr/bin/env python3 + +""" + (C) 2022-2025 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB, + Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., + Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, + Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other + contributors to this repository. All Rights Reserved. + + This software is protected by copyright law and by international treaties. + The IVAS codec Public Collaboration consisting of Dolby International AB, Ericsson AB, + Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., + Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, + Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other + contributors to this repository retain full ownership rights in their respective contributions in + the software. This notice grants no license of any kind, including but not limited to patent + license, nor is any license granted by implication, estoppel or otherwise. + + Contributors are required to enter into the IVAS codec Public Collaboration agreement before making + contributions. + + This software is provided "AS IS", without any express or implied warranties. The software is in the + development stage. It is intended exclusively for experts who have experience with such software and + solely for the purpose of inspection. All implied warranties of non-infringement, merchantability + and fitness for a particular purpose are hereby disclaimed and excluded. + + Any dispute, controversy or claim arising under or in relation to providing this software shall be + submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in + accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and + the United Nations Convention on Contracts on the International Sales of Goods. +""" + +import sys +import warnings +from typing import Tuple + +import numpy as np + +from .constants import SCRIPTS_DIR + +sys.path.append(str(SCRIPTS_DIR)) +from pyaudio3dtools.audioarray import getdelay + + +def compare_audio_arrays( + left: np.ndarray, left_fs: int, right: np.ndarray, right_fs: int +) -> Tuple[float, float]: + if left_fs != right_fs: + return ValueError(f"Differing samplerates: {left_fs} vs {right_fs}!") + + if left.shape[1] != right.shape[1]: + cmp_ch = min(left.shape[1], right.shape[1]) + warnings.warn( + f"Differing number of channels: {left.shape[1]} vs {right.shape[1]}! Comparing first {cmp_ch} channel(s)", + category=RuntimeWarning, + ) + left = left[:, :cmp_ch] + right = right[:, :cmp_ch] + + if left.shape[0] != right.shape[0]: + cmp_smp = min(left.shape[0], right.shape[0]) + warnings.warn( + f"Warning - different durations: {left.shape[0] / left_fs:.2f}s vs {right.shape[0] / right_fs:.2f}s! Comparing first {cmp_smp / left_fs : .2f} sample(s)", + category=RuntimeWarning, + ) + left = left[:cmp_smp, :] + right = right[:cmp_smp, :] + + if not np.array_equal(left, right): + delay = getdelay(left, right) + delay_abs = np.abs(delay) + # getdelay can return large values if signals are quite different + # limit any delay compensation to 20 ms + if delay != 0 and (delay_abs < left_fs / 50): + warnings.warn( + f"File B is delayed by {delay} samples ({delay*1000 / left_fs : .2f}ms)!", + category=RuntimeWarning, + ) + + # shift array + left = np.roll(left, delay, axis=0) + + # zero shifted out samples + if delay < 0: + left[-np.abs(delay) :, :] = 0 + elif delay > 0: + left[: np.abs(delay), :] = 0 + """ + http://www-mmsp.ece.mcgill.ca/Documents/Software/Packages/AFsp/AFsp/CompAudio.html + """ + num = np.sum(left * right) + den = np.sqrt(np.sum(left**2) * np.sum(right**2)) + if den > 0: + r = num / den + else: + r = np.inf + snr = 10 * np.log10(1 / (1 - (r**2))) + gain_b = num / np.sum(right**2) + max_diff = np.abs(np.max(left - right)) + else: + snr = np.inf + gain_b = 1 + max_diff = 0 + + return snr, gain_b, max_diff diff --git a/tests/renderer_short/constants.py b/tests/renderer_short/constants.py new file mode 100644 index 0000000000000000000000000000000000000000..766e64722b80132b963c007880ac732222855dfc --- /dev/null +++ b/tests/renderer_short/constants.py @@ -0,0 +1,421 @@ +#!/usr/bin/env python3 + +""" +(C) 2022-2025 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB, +Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., +Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, +Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other +contributors to this repository. All Rights Reserved. + +This software is protected by copyright law and by international treaties. +The IVAS codec Public Collaboration consisting of Dolby International AB, Ericsson AB, +Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., +Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, +Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other +contributors to this repository retain full ownership rights in their respective contributions in +the software. This notice grants no license of any kind, including but not limited to patent +license, nor is any license granted by implication, estoppel or otherwise. + +Contributors are required to enter into the IVAS codec Public Collaboration agreement before making +contributions. + +This software is provided "AS IS", without any express or implied warranties. The software is in the +development stage. It is intended exclusively for experts who have experience with such software and +solely for the purpose of inspection. All implied warranties of non-infringement, merchantability +and fitness for a particular purpose are hereby disclaimed and excluded. + +Any dispute, controversy or claim arising under or in relation to providing this software shall be +submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in +accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and +the United Nations Convention on Contracts on the International Sales of Goods. +""" + +from pathlib import Path +import platform + +""" Set up paths """ +TESTS_DIR = Path(__file__).parent +SCRIPTS_DIR = TESTS_DIR.parents[1].joinpath("scripts").resolve() +TEST_VECTOR_DIR = SCRIPTS_DIR.joinpath("testv") + +OUTPUT_PATH_REF = TESTS_DIR.joinpath("ref") +OUTPUT_PATH_CUT = TESTS_DIR.joinpath("cut") + +CUSTOM_LAYOUT_DIR = SCRIPTS_DIR.joinpath("ls_layouts") +HR_TRAJECTORY_DIR = SCRIPTS_DIR.joinpath("trajectories") +TESTV_DIR = SCRIPTS_DIR.joinpath("testv") +LTV_DIR = TESTV_DIR + +BIN_SUFFIX_MERGETARGET = "_ref" + +if platform.system() == "Windows": + EXE_SUFFIX = ".exe" +elif platform.system() in ["Linux", "Darwin"]: + EXE_SUFFIX = "" +else: + assert False, f"Unsupported platform {platform.system()}" + +""" Renderer commandline template """ +RENDERER_CMD = [ + str(TESTS_DIR.parent.parent.joinpath("IVAS_rend")), + "-i", + "", # 2 -> input file + "-if", + "", # 4 -> input format + "-o", + "/dev/null", # 6 -> output file + "-of", + "", # 8 -> output format + "-fs", + "48", # 10 -> input fs + "-no_delay_cmp", + # "-ndl", + "-q", +] + + +""" Format to file mappings """ +NCHAN_TO_FILE = { + 1: TEST_VECTOR_DIR.joinpath("spectral_test_1ch_48kHz.wav"), + 2: TEST_VECTOR_DIR.joinpath("spectral_test_2ch_48kHz.wav"), + 3: TEST_VECTOR_DIR.joinpath("spectral_test_3ch_48kHz.wav"), + 4: TEST_VECTOR_DIR.joinpath("spectral_test_4ch_48kHz.wav"), + 5: TEST_VECTOR_DIR.joinpath("spectral_test_5ch_48kHz.wav"), + 6: TEST_VECTOR_DIR.joinpath("spectral_test_6ch_48kHz.wav"), + 7: TEST_VECTOR_DIR.joinpath("spectral_test_7ch_48kHz.wav"), + 8: TEST_VECTOR_DIR.joinpath("spectral_test_8ch_48kHz.wav"), + 9: TEST_VECTOR_DIR.joinpath("spectral_test_9ch_48kHz.wav"), + 10: TEST_VECTOR_DIR.joinpath("spectral_test_10ch_48kHz.wav"), + 11: TEST_VECTOR_DIR.joinpath("spectral_test_11ch_48kHz.wav"), + 12: TEST_VECTOR_DIR.joinpath("spectral_test_12ch_48kHz.wav"), + 13: TEST_VECTOR_DIR.joinpath("spectral_test_13ch_48kHz.wav"), + 15: TEST_VECTOR_DIR.joinpath("spectral_test_15ch_48kHz.wav"), + 16: TEST_VECTOR_DIR.joinpath("spectral_test_16ch_48kHz.wav"), + 17: TEST_VECTOR_DIR.joinpath("spectral_test_17ch_48kHz.wav"), + 18: TEST_VECTOR_DIR.joinpath("spectral_test_18ch_48kHz.wav"), + 19: TEST_VECTOR_DIR.joinpath("spectral_test_19ch_48kHz.wav"), + 20: TEST_VECTOR_DIR.joinpath("spectral_test_20ch_48kHz.wav"), +} + +FORMAT_TO_FILE_SMOKETEST = { + "MONO": NCHAN_TO_FILE[1], + "STEREO": NCHAN_TO_FILE[2], + "5_1": NCHAN_TO_FILE[6], + "7_1": NCHAN_TO_FILE[8], + "5_1_2": NCHAN_TO_FILE[8], + "5_1_4": NCHAN_TO_FILE[10], + "7_1_4": NCHAN_TO_FILE[12], + "FOA": NCHAN_TO_FILE[4], + "HOA2": NCHAN_TO_FILE[9], + "HOA3": NCHAN_TO_FILE[16], + "ISM1": NCHAN_TO_FILE[1], + "ISM2": NCHAN_TO_FILE[2], + "ISM3": NCHAN_TO_FILE[3], + "ISM4": NCHAN_TO_FILE[4], + "NDP_ISM4": NCHAN_TO_FILE[4], + "MASA1": NCHAN_TO_FILE[1], + "MASA2": NCHAN_TO_FILE[2], + "OMASA_1_1": NCHAN_TO_FILE[2], + "OMASA_1_2": NCHAN_TO_FILE[3], + "OMASA_1_3": NCHAN_TO_FILE[4], + "OMASA_1_4": NCHAN_TO_FILE[5], + "OMASA_2_1": NCHAN_TO_FILE[3], + "OMASA_2_2": NCHAN_TO_FILE[4], + "OMASA_2_3": NCHAN_TO_FILE[5], + "OMASA_2_4": NCHAN_TO_FILE[6], + "OSBA_1_1": NCHAN_TO_FILE[5], + "OSBA_2_1": NCHAN_TO_FILE[6], + "OSBA_3_1": NCHAN_TO_FILE[7], + "OSBA_4_1": NCHAN_TO_FILE[8], + "OSBA_1_2": NCHAN_TO_FILE[10], + "OSBA_2_2": NCHAN_TO_FILE[11], + "OSBA_3_2": NCHAN_TO_FILE[12], + "OSBA_4_2": NCHAN_TO_FILE[13], + "OSBA_1_3": NCHAN_TO_FILE[17], + "OSBA_2_3": NCHAN_TO_FILE[18], + "OSBA_3_3": NCHAN_TO_FILE[19], + "OSBA_4_3": NCHAN_TO_FILE[20], + "META": TEST_VECTOR_DIR.joinpath("mixed_scene.txt"), + "16ch_8+4+4": NCHAN_TO_FILE[16], + "4d4": NCHAN_TO_FILE[8], + "t_design_4": NCHAN_TO_FILE[12], +} + +FORMAT_TO_FILE_COMPARETEST = { + "MONO": TESTV_DIR.joinpath("stv48c.wav"), + "STEREO": TESTV_DIR.joinpath("stvST48c.wav"), + "5_1": TESTV_DIR.joinpath("stv51MC48c.wav"), + "7_1": TESTV_DIR.joinpath("stv71MC48c.wav"), + "5_1_2": TESTV_DIR.joinpath("stv512MC48c.wav"), + "5_1_4": TESTV_DIR.joinpath("stv514MC48c.wav"), + "7_1_4": TESTV_DIR.joinpath("stv714MC48c.wav"), + "FOA": TESTV_DIR.joinpath("stvFOA48c.wav"), + "HOA2": TESTV_DIR.joinpath("stv2OA48c.wav"), + "HOA3": TESTV_DIR.joinpath("stv3OA48c.wav"), + "ISM1": TESTV_DIR.joinpath("stv1ISM48s.wav"), + "ISM2": TESTV_DIR.joinpath("stv2ISM48s.wav"), + "ISM3": TESTV_DIR.joinpath("stv3ISM48s.wav"), + "ISM4": TESTV_DIR.joinpath("stv4ISM48s.wav"), + "MASA1": TESTV_DIR.joinpath("stv1MASA1TC48c.wav"), + "MASA2": TESTV_DIR.joinpath("stv2MASA2TC48c.wav"), + "OMASA_1_1": TESTV_DIR.joinpath("stvOMASA_1ISM_1MASA1TC48c.wav"), + "OMASA_1_2": TESTV_DIR.joinpath("stvOMASA_2ISM_2MASA1TC48c.wav"), + "OMASA_1_3": TESTV_DIR.joinpath("stvOMASA_3ISM_1MASA1TC48c.wav"), + "OMASA_1_4": TESTV_DIR.joinpath("stvOMASA_4ISM_2MASA1TC48c.wav"), + "OMASA_2_1": TESTV_DIR.joinpath("stvOMASA_1ISM_1MASA2TC48c.wav"), + "OMASA_2_2": TESTV_DIR.joinpath("stvOMASA_2ISM_2MASA2TC48c.wav"), + "OMASA_2_3": TESTV_DIR.joinpath("stvOMASA_3ISM_1MASA2TC48c.wav"), + "OMASA_2_4": TESTV_DIR.joinpath("stvOMASA_4ISM_2MASA2TC48c.wav"), + "OSBA_1_1": TESTV_DIR.joinpath("stvOSBA_1ISM_FOA48c.wav"), + "OSBA_1_2": TESTV_DIR.joinpath("stvOSBA_1ISM_2OA48c.wav"), + "OSBA_1_3": TESTV_DIR.joinpath("stvOSBA_1ISM_3OA48c.wav"), + "OSBA_2_1": TESTV_DIR.joinpath("stvOSBA_2ISM_FOA48c.wav"), + "OSBA_2_2": TESTV_DIR.joinpath("stvOSBA_2ISM_2OA48c.wav"), + "OSBA_2_3": TESTV_DIR.joinpath("stvOSBA_2ISM_3OA48c.wav"), + "OSBA_3_1": TESTV_DIR.joinpath("stvOSBA_3ISM_FOA48c.wav"), + "OSBA_3_2": TESTV_DIR.joinpath("stvOSBA_3ISM_2OA48c.wav"), + "OSBA_3_3": TESTV_DIR.joinpath("stvOSBA_3ISM_3OA48c.wav"), + "OSBA_4_1": TESTV_DIR.joinpath("stvOSBA_4ISM_FOA48c.wav"), + "OSBA_4_2": TESTV_DIR.joinpath("stvOSBA_4ISM_2OA48c.wav"), + "OSBA_4_3": TESTV_DIR.joinpath("stvOSBA_4ISM_3OA48c.wav"), + "META": TEST_VECTOR_DIR.joinpath("mixed_scene.txt"), + "16ch_8+4+4": TESTV_DIR.joinpath("stv3OA48c.wav"), + "4d4": TESTV_DIR.joinpath("stv71MC48c.wav"), + "t_design_4": TESTV_DIR.joinpath("stv714MC48c.wav"), +} + +FORMAT_TO_FILE_LTV = { + "MONO": LTV_DIR.joinpath("ltv48_MONO.wav"), + "STEREO": LTV_DIR.joinpath("ltv48_STEREO.wav"), + "5_1": LTV_DIR.joinpath("ltv48_MC51.wav"), + "7_1": LTV_DIR.joinpath("ltv48_MC71.wav"), + "5_1_2": LTV_DIR.joinpath("ltv48_MC512.wav"), + "5_1_4": LTV_DIR.joinpath("ltv48_MC514.wav"), + "7_1_4": LTV_DIR.joinpath("ltv48_MC714.wav"), + "FOA": LTV_DIR.joinpath("ltv48_FOA.wav"), + "HOA2": LTV_DIR.joinpath("ltv48_HOA2.wav"), + "HOA3": LTV_DIR.joinpath("ltv48_HOA3.wav"), + "ISM1": LTV_DIR.joinpath("ltv48_1ISM.wav"), + "ISM2": LTV_DIR.joinpath("ltv48_2ISM.wav"), + "ISM3": LTV_DIR.joinpath("ltv48_3ISM.wav"), + "ISM4": LTV_DIR.joinpath("ltv48_4ISM.wav"), + "MASA1": LTV_DIR.joinpath("ltv48_MASA1TC.wav"), + "MASA2": LTV_DIR.joinpath("ltv48_MASA2TC.wav"), + "OMASA_1_1": LTV_DIR.joinpath("ltv48_OMASA_1ISM_1TC.wav"), + "OMASA_1_2": LTV_DIR.joinpath("ltv48_OMASA_2ISM_1TC.wav"), + "OMASA_1_3": LTV_DIR.joinpath("ltv48_OMASA_3ISM_1TC.wav"), + "OMASA_1_4": LTV_DIR.joinpath("ltv48_OMASA_4ISM_1TC.wav"), + "OMASA_2_1": LTV_DIR.joinpath("ltv48_OMASA_1ISM_2TC.wav"), + "OMASA_2_2": LTV_DIR.joinpath("ltv48_OMASA_2ISM_2TC.wav"), + "OMASA_2_3": LTV_DIR.joinpath("ltv48_OMASA_3ISM_2TC.wav"), + "OMASA_2_4": LTV_DIR.joinpath("ltv48_OMASA_4ISM_2TC.wav"), + "OSBA_1_1": LTV_DIR.joinpath("ltv48_OSBA_1ISM_FOA.wav"), + "OSBA_1_2": LTV_DIR.joinpath("ltv48_OSBA_1ISM_HOA2.wav"), + "OSBA_1_3": LTV_DIR.joinpath("ltv48_OSBA_1ISM_HOA3.wav"), + "OSBA_2_1": LTV_DIR.joinpath("ltv48_OSBA_2ISM_FOA.wav"), + "OSBA_2_2": LTV_DIR.joinpath("ltv48_OSBA_2ISM_HOA2.wav"), + "OSBA_2_3": LTV_DIR.joinpath("ltv48_OSBA_2ISM_HOA3.wav"), + "OSBA_3_1": LTV_DIR.joinpath("ltv48_OSBA_3ISM_FOA.wav"), + "OSBA_3_2": LTV_DIR.joinpath("ltv48_OSBA_3ISM_HOA2.wav"), + "OSBA_3_3": LTV_DIR.joinpath("ltv48_OSBA_3ISM_HOA3.wav"), + "OSBA_4_1": LTV_DIR.joinpath("ltv48_OSBA_4ISM_FOA.wav"), + "OSBA_4_2": LTV_DIR.joinpath("ltv48_OSBA_4ISM_HOA2.wav"), + "OSBA_4_3": LTV_DIR.joinpath("ltv48_OSBA_4ISM_HOA3.wav"), + "META": TEST_VECTOR_DIR.joinpath("mixed_scene.txt"), + "16ch_8+4+4": LTV_DIR.joinpath("ltv48_HOA3.wav"), + "4d4": LTV_DIR.joinpath("ltv48_MC71.wav"), + "t_design_4": LTV_DIR.joinpath("ltv48_MC714.wav"), +} + +FORMAT_TO_METADATA_FILES = { + "ISM1": [str(TESTV_DIR.joinpath("stvISM1.csv"))], + "ISM2": [ + str(TESTV_DIR.joinpath("stvISM1.csv")), + str(TESTV_DIR.joinpath("stvISM2.csv")), + ], + "ISM3": [ + str(TESTV_DIR.joinpath("stvISM1.csv")), + str(TESTV_DIR.joinpath("stvISM2.csv")), + str(TESTV_DIR.joinpath("stvISM3.csv")), + ], + "ISM4": [ + str(TESTV_DIR.joinpath("stvISM1.csv")), + str(TESTV_DIR.joinpath("stvISM2.csv")), + str(TESTV_DIR.joinpath("stvISM3.csv")), + str(TESTV_DIR.joinpath("stvISM4.csv")), + ], + "NDP_ISM4": [ + str(TESTV_DIR.joinpath("stvISM1.csv")), + str(TESTV_DIR.joinpath("stvISM2_non-diegetic-pan.csv")), + str(TESTV_DIR.joinpath("stvISM3.csv")), + str(TESTV_DIR.joinpath("stvISM4.csv")), + ], + "MASA1": [str(TESTV_DIR.joinpath("stv1MASA1TC48c.met"))], + "MASA2": [str(TESTV_DIR.joinpath("stv2MASA2TC48c.met"))], + "OMASA_1_1": [ + str(TESTV_DIR.joinpath("stvISM1.csv")), + str(TESTV_DIR.joinpath("stvOMASA_1ISM_1MASA1TC48c.met")), + ], + "OMASA_1_2": [ + str(TESTV_DIR.joinpath("stvISM1.csv")), + str(TESTV_DIR.joinpath("stvISM2.csv")), + str(TESTV_DIR.joinpath("stvOMASA_2ISM_2MASA1TC48c.met")), + ], + "OMASA_1_3": [ + str(TESTV_DIR.joinpath("stvISM1.csv")), + str(TESTV_DIR.joinpath("stvISM2.csv")), + str(TESTV_DIR.joinpath("stvISM3.csv")), + str(TESTV_DIR.joinpath("stvOMASA_3ISM_1MASA1TC48c.met")), + ], + "OMASA_1_4": [ + str(TESTV_DIR.joinpath("stvISM1.csv")), + str(TESTV_DIR.joinpath("stvISM2.csv")), + str(TESTV_DIR.joinpath("stvISM3.csv")), + str(TESTV_DIR.joinpath("stvISM4.csv")), + str(TESTV_DIR.joinpath("stvOMASA_4ISM_2MASA1TC48c.met")), + ], + "OMASA_2_1": [ + str(TESTV_DIR.joinpath("stvISM1.csv")), + str(TESTV_DIR.joinpath("stvOMASA_1ISM_1MASA2TC48c.met")), + ], + "OMASA_2_2": [ + str(TESTV_DIR.joinpath("stvISM1.csv")), + str(TESTV_DIR.joinpath("stvISM2.csv")), + str(TESTV_DIR.joinpath("stvOMASA_2ISM_2MASA2TC48c.met")), + ], + "OMASA_2_3": [ + str(TESTV_DIR.joinpath("stvISM1.csv")), + str(TESTV_DIR.joinpath("stvISM2.csv")), + str(TESTV_DIR.joinpath("stvISM3.csv")), + str(TESTV_DIR.joinpath("stvOMASA_3ISM_1MASA2TC48c.met")), + ], + "OMASA_2_4": [ + str(TESTV_DIR.joinpath("stvISM1.csv")), + str(TESTV_DIR.joinpath("stvISM2.csv")), + str(TESTV_DIR.joinpath("stvISM3.csv")), + str(TESTV_DIR.joinpath("stvISM4.csv")), + str(TESTV_DIR.joinpath("stvOMASA_4ISM_2MASA2TC48c.met")), + ], +} + +FORMAT_TO_METADATA_FILES_LTV = { + "ISM1": [str(LTV_DIR.joinpath("ltvISM1.csv"))], + "ISM2": [ + str(LTV_DIR.joinpath("ltvISM1.csv")), + str(LTV_DIR.joinpath("ltvISM2.csv")), + ], + "ISM3": [ + str(LTV_DIR.joinpath("ltvISM1.csv")), + str(LTV_DIR.joinpath("ltvISM2.csv")), + str(LTV_DIR.joinpath("ltvISM3.csv")), + ], + "ISM4": [ + str(LTV_DIR.joinpath("ltvISM1.csv")), + str(LTV_DIR.joinpath("ltvISM2.csv")), + str(LTV_DIR.joinpath("ltvISM3.csv")), + str(LTV_DIR.joinpath("ltvISM4.csv")), + ], + "NDP_ISM4": [ # Should not be needed, because it is included in all ISM metadata files. + str(LTV_DIR.joinpath("ltvISM1.csv")), + str(LTV_DIR.joinpath("ltvISM2.csv")), + str(LTV_DIR.joinpath("ltvISM3.csv")), + str(LTV_DIR.joinpath("ltvISM4.csv")), + ], + "MASA1": [str(LTV_DIR.joinpath("ltv48_MASA1TC.met"))], + "MASA2": [str(LTV_DIR.joinpath("ltv48_MASA2TC.met"))], + "OMASA_1_1": [ + str(LTV_DIR.joinpath("ltvISM1.csv")), + str(LTV_DIR.joinpath("ltv48_OMASA_1ISM_1TC.met")), + ], + "OMASA_1_2": [ + str(LTV_DIR.joinpath("ltvISM1.csv")), + str(LTV_DIR.joinpath("ltvISM2.csv")), + str(LTV_DIR.joinpath("ltv48_OMASA_2ISM_1TC.met")), + ], + "OMASA_1_3": [ + str(LTV_DIR.joinpath("ltvISM1.csv")), + str(LTV_DIR.joinpath("ltvISM2.csv")), + str(LTV_DIR.joinpath("ltvISM3.csv")), + str(LTV_DIR.joinpath("ltv48_OMASA_3ISM_1TC.met")), + ], + "OMASA_1_4": [ + str(LTV_DIR.joinpath("ltvISM1.csv")), + str(LTV_DIR.joinpath("ltvISM2.csv")), + str(LTV_DIR.joinpath("ltvISM3.csv")), + str(LTV_DIR.joinpath("ltvISM4.csv")), + str(LTV_DIR.joinpath("ltv48_OMASA_4ISM_1TC.met")), + ], + "OMASA_2_1": [ + str(LTV_DIR.joinpath("ltvISM1.csv")), + str(LTV_DIR.joinpath("ltv48_OMASA_1ISM_2TC.met")), + ], + "OMASA_2_2": [ + str(LTV_DIR.joinpath("ltvISM1.csv")), + str(LTV_DIR.joinpath("ltvISM2.csv")), + str(LTV_DIR.joinpath("ltv48_OMASA_2ISM_2TC.met")), + ], + "OMASA_2_3": [ + str(LTV_DIR.joinpath("ltvISM1.csv")), + str(LTV_DIR.joinpath("ltvISM2.csv")), + str(LTV_DIR.joinpath("ltvISM3.csv")), + str(LTV_DIR.joinpath("ltv48_OMASA_3ISM_2TC.met")), + ], + "OMASA_2_4": [ + str(LTV_DIR.joinpath("ltvISM1.csv")), + str(LTV_DIR.joinpath("ltvISM2.csv")), + str(LTV_DIR.joinpath("ltvISM3.csv")), + str(LTV_DIR.joinpath("ltvISM4.csv")), + str(LTV_DIR.joinpath("ltv48_OMASA_4ISM_2TC.met")), + ], +} + +""" Input formats """ +INPUT_FORMATS_AMBI = ["FOA", "HOA2", "HOA3"] +INPUT_FORMATS_MC = ["MONO", "STEREO", "5_1", "5_1_2", "5_1_4", "7_1", "7_1_4"] +INPUT_FORMATS_ISM = ["ISM1", "ISM2", "ISM3", "ISM4"] +INPUT_FORMATS_MASA = ["MASA1", "MASA2"] + +""" Non binaural / parametric output formats """ +OUTPUT_FORMATS = [ + "MONO", + "STEREO", + "5_1", + "5_1_2", + "5_1_4", + "7_1", + "7_1_4", + "FOA", + "HOA2", + "HOA3", +] + +""" Custom loudspeaker input/output """ +CUSTOM_LS_TO_TEST = [ + "t_design_4", + "4d4", + "16ch_8+4+4", +] + +""" Mixed scene ( metadata ) rendering """ +METADATA_SCENES_TO_TEST = ["mixed_scene", "mixed_scene_simple"] +METADATA_SCENES_TO_TEST_NO_BE = ["masa_scene"] +METADATA_SCENES_TO_TEST_MASA_PREREND = ["mixed_mc714_foa_masa2_ism4"] + +""" Binaural rendering """ +OUTPUT_FORMATS_BINAURAL = ["BINAURAL", "BINAURAL_ROOM_IR", "BINAURAL_ROOM_REVERB"] +HR_TRAJECTORIES_TO_TEST = [ + "full_circle_in_15s", + # "rotate_yaw_pitch_roll1", +] + +""" Frame Size """ +FRAMING_TO_TEST = ["5ms", "20ms"] + +PEAQ_SUPPORTED_FMT = [ + "MONO", + "STEREO", + "BINAURAL", + "BINAURAL_ROOM_IR", + "BINAURAL_ROOM_REVERB", +] + diff --git a/tests/renderer_short/cut/.gitignore b/tests/renderer_short/cut/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..f935021a8f8a7bd22f9d6703cafa5134bb6a57f8 --- /dev/null +++ b/tests/renderer_short/cut/.gitignore @@ -0,0 +1 @@ +!.gitignore diff --git a/tests/renderer_short/ref/.gitignore b/tests/renderer_short/ref/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..f935021a8f8a7bd22f9d6703cafa5134bb6a57f8 --- /dev/null +++ b/tests/renderer_short/ref/.gitignore @@ -0,0 +1 @@ +!.gitignore diff --git a/tests/renderer_short/test_renderer.py b/tests/renderer_short/test_renderer.py new file mode 100644 index 0000000000000000000000000000000000000000..8cfda2f6dbbed56e3c31f39b6ffd818408bc7e4d --- /dev/null +++ b/tests/renderer_short/test_renderer.py @@ -0,0 +1,1285 @@ +#!/usr/bin/env python3 + +""" +(C) 2022-2025 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB, +Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., +Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, +Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other +contributors to this repository. All Rights Reserved. + +This software is protected by copyright law and by international treaties. +The IVAS codec Public Collaboration consisting of Dolby International AB, Ericsson AB, +Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., +Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, +Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other +contributors to this repository retain full ownership rights in their respective contributions in +the software. This notice grants no license of any kind, including but not limited to patent +license, nor is any license granted by implication, estoppel or otherwise. + +Contributors are required to enter into the IVAS codec Public Collaboration agreement before making +contributions. + +This software is provided "AS IS", without any express or implied warranties. The software is in the +development stage. It is intended exclusively for experts who have experience with such software and +solely for the purpose of inspection. All implied warranties of non-infringement, merchantability +and fitness for a particular purpose are hereby disclaimed and excluded. + +Any dispute, controversy or claim arising under or in relation to providing this software shall be +submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in +accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and +the United Nations Convention on Contracts on the International Sales of Goods. +""" + +import pytest + +from .constants import ( + FORMAT_TO_METADATA_FILES_LTV, + OUTPUT_FORMATS, + INPUT_FORMATS_AMBI, + FRAMING_TO_TEST, + EXE_SUFFIX, + OUTPUT_FORMATS_BINAURAL, + HR_TRAJECTORIES_TO_TEST, + HR_TRAJECTORY_DIR, + INPUT_FORMATS_MC, + INPUT_FORMATS_ISM, + INPUT_FORMATS_MASA, + METADATA_SCENES_TO_TEST_MASA_PREREND, + TEST_VECTOR_DIR, + CUSTOM_LS_TO_TEST, + CUSTOM_LAYOUT_DIR, + METADATA_SCENES_TO_TEST, +) +from .utils import run_renderer, compare_renderer_args +from ..conftest import props_to_record + +############################################################################## +# Bit-exactness tests +# +# These tests are run in REF and CUT mode and the outputs are compared for +# bit-exactness +############################################################################## +""" Ambisonics """ + + +@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS) +@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_AMBI) +@pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) +def test_ambisonics( + record_property, + props_to_record, + test_info, + in_fmt, + out_fmt, + frame_size, + get_mld, + get_mld_lim, + get_ssnr, + get_odg, + get_odg_bin, + split_comparison, +): + run_renderer( + record_property, + props_to_record, + test_info, + in_fmt, + out_fmt, + binary_suffix=EXE_SUFFIX, + frame_size=frame_size, + get_mld=get_mld, + mld_lim=get_mld_lim, + get_ssnr=get_ssnr, + get_odg=get_odg, + get_odg_bin=get_odg_bin, + split_comparison=split_comparison, + ) + + +@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) +@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_AMBI) +@pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) +def test_ambisonics_binaural_static( + record_property, + props_to_record, + test_info, + in_fmt, + out_fmt, + frame_size, + get_mld, + get_mld_lim, + get_ssnr, + get_odg, + get_odg_bin, + split_comparison, +): + run_renderer( + record_property, + props_to_record, + test_info, + in_fmt, + out_fmt, + binary_suffix=EXE_SUFFIX, + frame_size=frame_size, + get_mld=get_mld, + mld_lim=get_mld_lim, + get_ssnr=get_ssnr, + get_odg=get_odg, + get_odg_bin=get_odg_bin, + split_comparison=split_comparison, + ) + + +@pytest.mark.parametrize("trj_file", HR_TRAJECTORIES_TO_TEST) +@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) +@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_AMBI) +@pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) +def test_ambisonics_binaural_headrotation( + record_property, + props_to_record, + test_info, + in_fmt, + out_fmt, + trj_file, + frame_size, + get_mld, + get_mld_lim, + get_ssnr, + get_odg, + get_odg_bin, + split_comparison, +): + run_renderer( + record_property, + props_to_record, + test_info, + in_fmt, + out_fmt, + trj_file=HR_TRAJECTORY_DIR.joinpath(f"{trj_file}.csv"), + binary_suffix=EXE_SUFFIX, + frame_size=frame_size, + get_mld=get_mld, + mld_lim=get_mld_lim, + get_ssnr=get_ssnr, + get_odg=get_odg, + get_odg_bin=get_odg_bin, + split_comparison=split_comparison, + ) + + +@pytest.mark.skip(reason="Not supported for BASOP code currently") +@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL[2:]) +@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_AMBI) +@pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) +@pytest.mark.parametrize("aeid", ["1", "0"]) +def test_dynamic_acoustic_environment( + record_property, + props_to_record, + test_info, + in_fmt, + out_fmt, + frame_size, + get_mld, + get_mld_lim, + get_ssnr, + get_odg, + get_odg_bin, + aeid, + split_comparison, +): + rend_config_path = TEST_VECTOR_DIR.joinpath(f"rend_config_combined.cfg") + rend_config_path.with_stem(f"rend_config") + + run_renderer( + record_property, + props_to_record, + test_info, + in_fmt, + out_fmt, + binary_suffix=EXE_SUFFIX, + frame_size=frame_size, + get_mld=get_mld, + mld_lim=get_mld_lim, + get_ssnr=get_ssnr, + get_odg=get_odg, + get_odg_bin=get_odg_bin, + config_file=rend_config_path, + aeid=aeid, + split_comparison=split_comparison, + ) + + +@pytest.mark.skip("MSAN errors in BASOP need to be fixed") +@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL[2:]) +@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_AMBI) +@pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) +def test_dynamic_acoustic_environment_file( + record_property, + props_to_record, + test_info, + in_fmt, + out_fmt, + frame_size, + get_mld, + get_mld_lim, + get_ssnr, + get_odg, + get_odg_bin, + split_comparison, +): + rend_config_path = TEST_VECTOR_DIR.joinpath(f"rend_config_combined.cfg") + rend_config_path.with_stem(f"rend_config") + + aeid = TEST_VECTOR_DIR.joinpath(f"aeid1.txt") + + run_renderer( + record_property, + props_to_record, + test_info, + in_fmt, + out_fmt, + binary_suffix=EXE_SUFFIX, + frame_size=frame_size, + get_mld=get_mld, + mld_lim=get_mld_lim, + get_ssnr=get_ssnr, + get_odg=get_odg, + get_odg_bin=get_odg_bin, + config_file=rend_config_path, + aeid=aeid, + split_comparison=split_comparison, + ) + + +""" Multichannel """ + + +@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS) +@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_MC) +@pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) +def test_multichannel( + record_property, + props_to_record, + test_info, + in_fmt, + out_fmt, + frame_size, + get_mld, + get_mld_lim, + get_ssnr, + get_odg, + get_odg_bin, + split_comparison, +): + run_renderer( + record_property, + props_to_record, + test_info, + in_fmt, + out_fmt, + binary_suffix=EXE_SUFFIX, + frame_size=frame_size, + get_mld=get_mld, + mld_lim=get_mld_lim, + get_ssnr=get_ssnr, + get_odg=get_odg, + get_odg_bin=get_odg_bin, + split_comparison=split_comparison, + ) + + +@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) +@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_MC) +@pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) +def test_multichannel_binaural_static( + record_property, + props_to_record, + test_info, + in_fmt, + out_fmt, + frame_size, + get_mld, + get_mld_lim, + get_ssnr, + get_odg, + get_odg_bin, + split_comparison, +): + if in_fmt in ["MONO", "STEREO"]: + pytest.skip("MONO or STEREO to Binaural rendering unsupported") + + run_renderer( + record_property, + props_to_record, + test_info, + in_fmt, + out_fmt, + binary_suffix=EXE_SUFFIX, + frame_size=frame_size, + get_mld=get_mld, + mld_lim=get_mld_lim, + get_ssnr=get_ssnr, + get_odg=get_odg, + get_odg_bin=get_odg_bin, + split_comparison=split_comparison, + ) + + +@pytest.mark.parametrize("trj_file", HR_TRAJECTORIES_TO_TEST) +@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) +@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_MC) +@pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) +def test_multichannel_binaural_headrotation( + record_property, + props_to_record, + test_info, + in_fmt, + out_fmt, + trj_file, + frame_size, + get_mld, + get_mld_lim, + get_ssnr, + get_odg, + get_odg_bin, + split_comparison, +): + if in_fmt in ["MONO", "STEREO"]: + pytest.skip("MONO or STEREO to Binaural rendering unsupported") + + run_renderer( + record_property, + props_to_record, + test_info, + in_fmt, + out_fmt, + trj_file=HR_TRAJECTORY_DIR.joinpath(f"{trj_file}.csv"), + binary_suffix=EXE_SUFFIX, + frame_size=frame_size, + get_mld=get_mld, + mld_lim=get_mld_lim, + get_ssnr=get_ssnr, + get_odg=get_odg, + get_odg_bin=get_odg_bin, + split_comparison=split_comparison, + ) + + +""" ISM """ + + +@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS) +@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_ISM) +@pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) +def test_ism( + record_property, + props_to_record, + test_info, + in_fmt, + out_fmt, + frame_size, + get_mld, + get_mld_lim, + get_ssnr, + get_odg, + get_odg_bin, + split_comparison, +): + run_renderer( + record_property, + props_to_record, + test_info, + in_fmt, + out_fmt, + binary_suffix=EXE_SUFFIX, + frame_size=frame_size, + get_mld=get_mld, + mld_lim=get_mld_lim, + get_ssnr=get_ssnr, + get_odg=get_odg, + get_odg_bin=get_odg_bin, + split_comparison=split_comparison, + ) + + +@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) +@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_ISM) +@pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) +def test_ism_binaural_static( + record_property, + props_to_record, + test_info, + in_fmt, + out_fmt, + frame_size, + get_mld, + get_mld_lim, + get_ssnr, + get_odg, + get_odg_bin, + split_comparison, +): + run_renderer( + record_property, + props_to_record, + test_info, + in_fmt, + out_fmt, + binary_suffix=EXE_SUFFIX, + frame_size=frame_size, + get_mld=get_mld, + mld_lim=get_mld_lim, + get_ssnr=get_ssnr, + get_odg=get_odg, + get_odg_bin=get_odg_bin, + split_comparison=split_comparison, + ) + + +@pytest.mark.parametrize("trj_file", HR_TRAJECTORIES_TO_TEST) +@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) +@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_ISM) +@pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) +def test_ism_binaural_headrotation( + record_property, + props_to_record, + test_info, + in_fmt, + out_fmt, + trj_file, + frame_size, + get_mld, + get_mld_lim, + get_ssnr, + get_odg, + get_odg_bin, + split_comparison, +): + run_renderer( + record_property, + props_to_record, + test_info, + in_fmt, + out_fmt, + trj_file=HR_TRAJECTORY_DIR.joinpath(f"{trj_file}.csv"), + binary_suffix=EXE_SUFFIX, + frame_size=frame_size, + get_mld=get_mld, + mld_lim=get_mld_lim, + get_ssnr=get_ssnr, + get_odg=get_odg, + get_odg_bin=get_odg_bin, + split_comparison=split_comparison, + ) + + +""" MASA """ + + +@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS) +@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_MASA) +@pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) +def test_masa( + record_property, + props_to_record, + test_info, + in_fmt, + out_fmt, + frame_size, + get_mld, + get_mld_lim, + get_ssnr, + get_odg, + get_odg_bin, + split_comparison, +): + run_renderer( + record_property, + props_to_record, + test_info, + in_fmt, + out_fmt, + binary_suffix=EXE_SUFFIX, + frame_size=frame_size, + get_mld=get_mld, + mld_lim=get_mld_lim, + get_ssnr=get_ssnr, + get_odg=get_odg, + get_odg_bin=get_odg_bin, + split_comparison=split_comparison, + ) + + +@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) +@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_MASA) +@pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) +def test_masa_binaural_static( + record_property, + props_to_record, + test_info, + in_fmt, + out_fmt, + frame_size, + get_mld, + get_mld_lim, + get_ssnr, + get_odg, + get_odg_bin, + split_comparison, +): + if out_fmt in ["BINAURAL_ROOM_IR", "BINAURAL_ROOM_REVERB"]: + pytest.skip("Skipping binaural room outputs for MASA as unimplemented.") + + run_renderer( + record_property, + props_to_record, + test_info, + in_fmt, + out_fmt, + binary_suffix=EXE_SUFFIX, + frame_size=frame_size, + get_mld=get_mld, + mld_lim=get_mld_lim, + get_ssnr=get_ssnr, + get_odg=get_odg, + get_odg_bin=get_odg_bin, + split_comparison=split_comparison, + ) + + +@pytest.mark.parametrize("trj_file", HR_TRAJECTORIES_TO_TEST) +@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) +@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_MASA) +@pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) +def test_masa_binaural_headrotation( + record_property, + props_to_record, + test_info, + in_fmt, + out_fmt, + trj_file, + frame_size, + get_mld, + get_mld_lim, + get_ssnr, + get_odg, + get_odg_bin, + split_comparison, +): + if out_fmt in ["BINAURAL_ROOM_IR", "BINAURAL_ROOM_REVERB"]: + pytest.skip("Skipping binaural room outputs for MASA as unimplemented.") + + run_renderer( + record_property, + props_to_record, + test_info, + in_fmt, + out_fmt, + trj_file=HR_TRAJECTORY_DIR.joinpath(f"{trj_file}.csv"), + binary_suffix=EXE_SUFFIX, + frame_size=frame_size, + get_mld=get_mld, + mld_lim=get_mld_lim, + get_ssnr=get_ssnr, + get_odg=get_odg, + get_odg_bin=get_odg_bin, + split_comparison=split_comparison, + ) + + +@pytest.mark.parametrize("in_fmt", METADATA_SCENES_TO_TEST_MASA_PREREND) +def test_masa_prerend( + record_property, + props_to_record, + test_info, + in_fmt, + get_mld, + get_mld_lim, + get_ssnr, + get_odg, + get_odg_bin, + split_comparison, +): + run_renderer( + record_property, + props_to_record, + test_info, + "META", + "MASA2", + metadata_input=TEST_VECTOR_DIR.joinpath(f"{in_fmt}.txt"), + binary_suffix=EXE_SUFFIX, + get_mld=get_mld, + mld_lim=get_mld_lim, + get_ssnr=get_ssnr, + get_odg=get_odg, + get_odg_bin=get_odg_bin, + split_comparison=split_comparison, + ) + + +""" Custom loudspeaker layouts """ + + +@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS) +@pytest.mark.parametrize("in_layout", CUSTOM_LS_TO_TEST) +@pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) +def test_custom_ls_input( + record_property, + props_to_record, + test_info, + in_layout, + out_fmt, + frame_size, + get_mld, + get_mld_lim, + get_ssnr, + get_odg, + get_odg_bin, + split_comparison, +): + run_renderer( + record_property, + props_to_record, + test_info, + CUSTOM_LAYOUT_DIR.joinpath(f"{in_layout}.txt"), + out_fmt, + binary_suffix=EXE_SUFFIX, + frame_size=frame_size, + get_mld=get_mld, + mld_lim=get_mld_lim, + get_ssnr=get_ssnr, + get_odg=get_odg, + get_odg_bin=get_odg_bin, + split_comparison=split_comparison, + ) + + +@pytest.mark.parametrize("out_fmt", CUSTOM_LS_TO_TEST) +@pytest.mark.parametrize( + "in_fmt", + [*INPUT_FORMATS_AMBI, *INPUT_FORMATS_MC, *INPUT_FORMATS_ISM, *INPUT_FORMATS_MASA], +) +def test_custom_ls_output( + record_property, + props_to_record, + test_info, + in_fmt, + out_fmt, + get_mld, + get_mld_lim, + get_ssnr, + get_odg, + get_odg_bin, + split_comparison, +): + # TODO: revert once BASOP is brought up-to-date + if in_fmt in INPUT_FORMATS_MASA: + pytest.skip("MASA to custom LS not supported on ivas-float-update yet") + if in_fmt in INPUT_FORMATS_ISM and out_fmt == "t_design_4": + pytest.skip("ISMx + t_design_4 skipped until bug in BASOP is fixed") + run_renderer( + record_property, + props_to_record, + test_info, + in_fmt, + CUSTOM_LAYOUT_DIR.joinpath(f"{out_fmt}.txt"), + binary_suffix=EXE_SUFFIX, + get_mld=get_mld, + mld_lim=get_mld_lim, + get_ssnr=get_ssnr, + get_odg=get_odg, + get_odg_bin=get_odg_bin, + split_comparison=split_comparison, + ) + + +@pytest.mark.parametrize("out_fmt", CUSTOM_LS_TO_TEST) +@pytest.mark.parametrize("in_fmt", CUSTOM_LS_TO_TEST) +def test_custom_ls_input_output( + record_property, + props_to_record, + test_info, + in_fmt, + out_fmt, + get_mld, + get_mld_lim, + get_ssnr, + get_odg, + get_odg_bin, + split_comparison, +): + run_renderer( + record_property, + props_to_record, + test_info, + CUSTOM_LAYOUT_DIR.joinpath(f"{in_fmt}.txt"), + CUSTOM_LAYOUT_DIR.joinpath(f"{out_fmt}.txt"), + binary_suffix=EXE_SUFFIX, + get_mld=get_mld, + mld_lim=get_mld_lim, + get_ssnr=get_ssnr, + get_odg=get_odg, + get_odg_bin=get_odg_bin, + split_comparison=split_comparison, + ) + + +@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) +@pytest.mark.parametrize("in_layout", CUSTOM_LS_TO_TEST) +@pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) +def test_custom_ls_input_binaural( + record_property, + props_to_record, + test_info, + in_layout, + out_fmt, + frame_size, + get_mld, + get_mld_lim, + get_ssnr, + get_odg, + get_odg_bin, + split_comparison, +): + run_renderer( + record_property, + props_to_record, + test_info, + CUSTOM_LAYOUT_DIR.joinpath(f"{in_layout}.txt"), + out_fmt, + binary_suffix=EXE_SUFFIX, + frame_size=frame_size, + get_mld=get_mld, + mld_lim=get_mld_lim, + get_ssnr=get_ssnr, + get_odg=get_odg, + get_odg_bin=get_odg_bin, + split_comparison=split_comparison, + ) + + +@pytest.mark.parametrize("trj_file", HR_TRAJECTORIES_TO_TEST) +@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) +@pytest.mark.parametrize("in_layout", CUSTOM_LS_TO_TEST) +@pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) +def test_custom_ls_input_binaural_headrotation( + record_property, + props_to_record, + test_info, + in_layout, + out_fmt, + trj_file, + frame_size, + get_mld, + get_mld_lim, + get_ssnr, + get_odg, + get_odg_bin, + split_comparison, +): + run_renderer( + record_property, + props_to_record, + test_info, + CUSTOM_LAYOUT_DIR.joinpath(f"{in_layout}.txt"), + out_fmt, + trj_file=HR_TRAJECTORY_DIR.joinpath(f"{trj_file}.csv"), + binary_suffix=EXE_SUFFIX, + frame_size=frame_size, + get_mld=get_mld, + mld_lim=get_mld_lim, + get_ssnr=get_ssnr, + get_odg=get_odg, + get_odg_bin=get_odg_bin, + split_comparison=split_comparison, + ) + + +""" Metadata / scene description input """ + + +@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS) +@pytest.mark.parametrize("in_fmt", METADATA_SCENES_TO_TEST) +@pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) +def test_metadata( + record_property, + props_to_record, + test_info, + in_fmt, + out_fmt, + frame_size, + get_mld, + get_mld_lim, + get_ssnr, + get_odg, + get_odg_bin, + split_comparison, +): + run_renderer( + record_property, + props_to_record, + test_info, + "META", + out_fmt, + metadata_input=TEST_VECTOR_DIR.joinpath(f"{in_fmt}.txt"), + binary_suffix=EXE_SUFFIX, + frame_size=frame_size, + get_mld=get_mld, + mld_lim=get_mld_lim, + get_ssnr=get_ssnr, + get_odg=get_odg, + get_odg_bin=get_odg_bin, + split_comparison=split_comparison, + ) + + +""" non diegetic pan """ + + +@pytest.mark.parametrize("out_fmt", ["STEREO"]) +@pytest.mark.parametrize("in_fmt", ["MONO"]) +@pytest.mark.parametrize("non_diegetic_pan", ["0", "-30", "45", "90", "-90"]) +def test_non_diegetic_pan_static( + record_property, + props_to_record, + test_info, + in_fmt, + out_fmt, + non_diegetic_pan, + get_mld, + get_mld_lim, + get_ssnr, + get_odg, + get_odg_bin, + split_comparison, +): + run_renderer( + record_property, + props_to_record, + test_info, + in_fmt, + out_fmt, + non_diegetic_pan=non_diegetic_pan, + binary_suffix=EXE_SUFFIX, + get_mld=get_mld, + mld_lim=get_mld_lim, + get_ssnr=get_ssnr, + get_odg=get_odg, + get_odg_bin=get_odg_bin, + split_comparison=split_comparison, + ) + + +@pytest.mark.parametrize("out_fmt", ["STEREO"]) +@pytest.mark.parametrize("in_fmt", ["ISM1"]) +@pytest.mark.parametrize("non_diegetic_pan", ["0", "-30", "45", "90", "-90"]) +def test_non_diegetic_pan_ism_static( + record_property, + props_to_record, + test_info, + in_fmt, + out_fmt, + non_diegetic_pan, + get_mld, + get_mld_lim, + get_ssnr, + get_odg, + get_odg_bin, + split_comparison, +): + run_renderer( + record_property, + props_to_record, + test_info, + in_fmt, + out_fmt, + non_diegetic_pan=non_diegetic_pan, + binary_suffix=EXE_SUFFIX, + get_mld=get_mld, + mld_lim=get_mld_lim, + get_ssnr=get_ssnr, + get_odg=get_odg, + get_odg_bin=get_odg_bin, + split_comparison=split_comparison, + ) + + +############################################################################## +# Smoke tests +# +# These tests are run only for the smoke test and do not perform a +# bit-exactness comparison between REF and CUT, but between CUT1 and CUT2 +############################################################################## + + +# Test compares rendering with just a trajectory file against rendering with a trajectory file + a zero ref rotation. +# These should be binary equivalent. +@pytest.mark.parametrize("trj_file", HR_TRAJECTORIES_TO_TEST) +@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) +@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_AMBI) +def test_ambisonics_binaural_headrotation_refrotzero( + record_property, + props_to_record, + test_info, + in_fmt, + out_fmt, + trj_file, + split_comparison, +): + if test_info.config.option.create_ref or test_info.config.option.create_cut: + pytest.skip("OTR tests only run for smoke test") + + compare_renderer_args( + record_property, + props_to_record, + test_info, + in_fmt, + out_fmt, + ref_kwargs={ + "name_extension": "refrotzero", + "trj_file": HR_TRAJECTORY_DIR.joinpath(f"{trj_file}.csv"), + "frame_size": "5", + }, + cut_kwargs={ + "trj_file": HR_TRAJECTORY_DIR.joinpath(f"{trj_file}.csv"), + "refrot_file": HR_TRAJECTORY_DIR.joinpath("const000.csv"), + "frame_size": "5", + }, + split_comparison=split_comparison, + ) + + +# Second test compares rendering with no head rotation against rendering with equal ref and head rotation. +# These should also be binary equivalent. +# Note that reference rotation is supplied per 4 subframes; head rotation per subframe. +@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) +@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_AMBI) +def test_ambisonics_binaural_headrotation_refrotequal( + record_property, + props_to_record, + test_info, + in_fmt, + out_fmt, + split_comparison, +): + if test_info.config.option.create_ref or test_info.config.option.create_cut: + pytest.skip("OTR tests only run for smoke test") + + compare_renderer_args( + record_property, + props_to_record, + test_info, + in_fmt, + out_fmt, + ref_kwargs={ + "name_extension": "refrotequal", + "frame_size": "5", + }, + cut_kwargs={ + "trj_file": HR_TRAJECTORY_DIR.joinpath( + "azi_plus_2-ele_plus_2-every-100-frames.csv" + ), + "refrot_file": HR_TRAJECTORY_DIR.joinpath( + "azi_plus_2-ele_plus_2-every-25-rows.csv" + ), + "frame_size": "5", + }, + split_comparison=split_comparison, + ) + + +# This test compares rendering with: +# ref: head rotation trajectory file (OTR=NONE) +# cut: identical head rotation trajectory file as ref but in addition a constant +# reference vector in the looking direction of the coordinate system (OTR=REF_VEC) +@pytest.mark.parametrize("trj_file", HR_TRAJECTORIES_TO_TEST) +@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) +@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_AMBI) +def test_ambisonics_binaural_headrotation_refveczero( + record_property, + props_to_record, + test_info, + in_fmt, + out_fmt, + trj_file, + split_comparison, +): + if test_info.config.option.create_ref or test_info.config.option.create_cut: + pytest.skip("OTR tests only run for smoke test") + + compare_renderer_args( + record_property, + props_to_record, + test_info, + in_fmt, + out_fmt, + ref_kwargs={ + "name_extension": "refveczero", + "trj_file": HR_TRAJECTORY_DIR.joinpath(f"{trj_file}.csv"), + "frame_size": "5", + }, + cut_kwargs={ + "trj_file": HR_TRAJECTORY_DIR.joinpath(f"{trj_file}.csv"), + "refvec_file": HR_TRAJECTORY_DIR.joinpath("const000-Vector3.csv"), + "frame_size": "5", + }, + split_comparison=split_comparison, + ) + + +# This test compares rendering with: +# ref: no head rotation (OTR=NONE) +# cut: rendering with head rotation and a ref vector which moves in the +# looking-direction of the head rotation and therefore compensates it (OTR=REF_VEC) +@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) +@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_AMBI) +def test_ambisonics_binaural_headrotation_refvecequal( + record_property, + props_to_record, + test_info, + in_fmt, + out_fmt, + split_comparison, +): + if test_info.config.option.create_ref or test_info.config.option.create_cut: + pytest.skip("OTR tests only run for smoke test") + + # TODO revert + if in_fmt == "HOA3" and out_fmt == "BINAURAL_ROOM_REVERB": + pytest.xfail("WIP : minor differences to be resolved") + else: + compare_renderer_args( + record_property, + props_to_record, + test_info, + in_fmt, + out_fmt, + ref_kwargs={ + "name_extension": "refvecequal", + "frame_size": "5", + }, + cut_kwargs={ + "trj_file": HR_TRAJECTORY_DIR.joinpath( + "full-circle-with-up-and-down-4s.csv" + ), + "refvec_file": HR_TRAJECTORY_DIR.joinpath( + "full-circle-with-up-and-down-4s-Vector3.csv" + ), + "frame_size": "5", + }, + split_comparison=split_comparison, + ) + + +# This test compares rendering with: +# ref: a head rotation trajectory with elevation (OTR=NONE) +# cut: a static head rotation and a reference position trajectory which moves +# in a way that produces the same acoustic output as the ref head rot trajectory (OTR=REF_VEC) +@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) +@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_AMBI) +def test_ambisonics_binaural_headrotation_refvec_rotating( + record_property, + props_to_record, + test_info, + in_fmt, + out_fmt, + split_comparison, +): + if test_info.config.option.create_ref or test_info.config.option.create_cut: + pytest.skip("OTR tests only run for smoke test") + + # TODO revert + if in_fmt == "HOA2" and out_fmt == "BINAURAL_ROOM_REVERB": + pytest.xfail("WIP : minor differences to be resolved") + else: + compare_renderer_args( + record_property, + props_to_record, + test_info, + in_fmt, + out_fmt, + ref_kwargs={ + "name_extension": "refvec_rotating", + "trj_file": HR_TRAJECTORY_DIR.joinpath( + "full-circle-with-up-and-down-4s.csv" + ), + "frame_size": "5", + }, + cut_kwargs={ + "trj_file": HR_TRAJECTORY_DIR.joinpath("const000.csv"), + "refvec_file": HR_TRAJECTORY_DIR.joinpath( + "full-circle-with-up-and-down-4s-ccw-Vector3.csv" + ), + "frame_size": "5", + }, + split_comparison=split_comparison, + ) + + +# This test compares rendering with: +# ref: a head rotation trajectory with elevation (OTR=NONE) +# cut: a static head rotation and a reference position trajectory which moves +# in a way that produces the same acoustic output as the ref head rot trajectory (OTR=REF_VEC) +# which also contains a fixed position offset between listener and reference position (which +# gets compensated in the REF_VEV OTR modes) +@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) +@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_AMBI) +def test_ambisonics_binaural_headrotation_refvec_rotating_fixed_pos_offset( + record_property, + props_to_record, + test_info, + in_fmt, + out_fmt, + split_comparison, +): + if test_info.config.option.create_ref or test_info.config.option.create_cut: + pytest.skip("OTR tests only run for smoke test") + + compare_renderer_args( + record_property, + props_to_record, + test_info, + in_fmt, + out_fmt, + ref_kwargs={ + "name_extension": "refvec_rotating", + "trj_file": HR_TRAJECTORY_DIR.joinpath( + "full-circle-with-up-and-down-4s-ccw.csv" + ), + "frame_size": "5", + }, + cut_kwargs={ + "trj_file": HR_TRAJECTORY_DIR.joinpath("const000.csv"), + "refvec_file": HR_TRAJECTORY_DIR.joinpath( + "full-circle-with-up-and-down-4s-fixed-pos-offset-Vector3.csv" + ), + "frame_size": "5", + }, + split_comparison=split_comparison, + ) + + +# This test compares rendering with: +# ref: a reference position trajectory with elevation and REF_VEC_LEV OTR mode (OTR=REF_VEC_LEV) +# cut: a reference position trajectory without the elevation and REF_VEC OTR mode (OTR=REF_VEC) +# Since the only difference between REF_VEC_LEV and REF_VEC is that *LEV ignores +# the height difference in positions, the output must be binary equivalent. +@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) +@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_AMBI) +def test_ambisonics_binaural_headrotation_refveclev_vs_refvec( + record_property, + props_to_record, + test_info, + in_fmt, + out_fmt, + split_comparison, +): + if test_info.config.option.create_ref or test_info.config.option.create_cut: + pytest.skip("OTR tests only run for smoke test") + + compare_renderer_args( + record_property, + props_to_record, + test_info, + in_fmt, + out_fmt, + ref_kwargs={ + "name_extension": "refveclevel", + "trj_file": HR_TRAJECTORY_DIR.joinpath("const000.csv"), + "refveclev_file": HR_TRAJECTORY_DIR.joinpath( + "full-circle-with-up-and-down-4s-Vector3.csv" + ), + "frame_size": "5", + }, + cut_kwargs={ + "trj_file": HR_TRAJECTORY_DIR.joinpath("const000.csv"), + "refvec_file": HR_TRAJECTORY_DIR.joinpath("full-circle-4s-Vector3.csv"), + "frame_size": "5", + }, + split_comparison=split_comparison, + ) + + +# This test compares rendering with: +# ref: a head rotation trajectory with elevation (OTR=NONE) +# cut: a static head rotation and a reference position trajectory which moves +# in a way that produces the same acoustic output as the ref head rot trajectory (OTR=REF_VEC) +@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) +@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_MC) +def test_multichannel_binaural_headrotation_refvec_rotating( + record_property, + props_to_record, + test_info, + in_fmt, + out_fmt, + split_comparison, +): + if test_info.config.option.create_ref or test_info.config.option.create_cut: + pytest.skip("OTR tests only run for smoke test") + + if in_fmt in ["MONO", "STEREO"]: + pytest.skip("MONO or STEREO to Binaural rendering unsupported") + + compare_renderer_args( + record_property, + props_to_record, + test_info, + in_fmt, + out_fmt, + ref_kwargs={ + "name_extension": "refvec_rotating", + "trj_file": HR_TRAJECTORY_DIR.joinpath( + "full-circle-with-up-and-down-4s.csv" + ), + "frame_size": "5", + }, + cut_kwargs={ + "trj_file": HR_TRAJECTORY_DIR.joinpath("const000.csv"), + "refvec_file": HR_TRAJECTORY_DIR.joinpath( + "full-circle-with-up-and-down-4s-ccw-Vector3.csv" + ), + "frame_size": "5", + }, + split_comparison=split_comparison, + ) + + +# This test compares rendering with: +# ref: a head rotation trajectory with elevation (OTR=NONE) +# cut: a static head rotation and a reference position trajectory which moves +# in a way that produces the same acoustic output as the ref head rot trajectory (OTR=REF_VEC) +@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) +@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_ISM) +def test_ism_binaural_headrotation_refvec_rotating( + record_property, + props_to_record, + test_info, + in_fmt, + out_fmt, + split_comparison, +): + if test_info.config.option.create_ref or test_info.config.option.create_cut: + pytest.skip("OTR tests only run for smoke test") + + compare_renderer_args( + record_property, + props_to_record, + test_info, + in_fmt, + out_fmt, + ref_kwargs={ + "name_extension": "refvec_rotating", + "trj_file": HR_TRAJECTORY_DIR.joinpath( + "full-circle-with-up-and-down-4s.csv" + ), + "frame_size": "5", + }, + cut_kwargs={ + "trj_file": HR_TRAJECTORY_DIR.joinpath("const000.csv"), + "refvec_file": HR_TRAJECTORY_DIR.joinpath( + "full-circle-with-up-and-down-4s-ccw-Vector3.csv" + ), + "frame_size": "5", + }, + split_comparison=split_comparison, + ) diff --git a/tests/renderer_short/utils.py b/tests/renderer_short/utils.py new file mode 100644 index 0000000000000000000000000000000000000000..9afda68b940d90511cf4cb75485f0f526495de3f --- /dev/null +++ b/tests/renderer_short/utils.py @@ -0,0 +1,786 @@ +#!/usr/bin/env python3 + +""" +(C) 2022-2025 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB, +Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., +Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, +Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other +contributors to this repository. All Rights Reserved. + +This software is protected by copyright law and by international treaties. +The IVAS codec Public Collaboration consisting of Dolby International AB, Ericsson AB, +Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., +Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, +Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other +contributors to this repository retain full ownership rights in their respective contributions in +the software. This notice grants no license of any kind, including but not limited to patent +license, nor is any license granted by implication, estoppel or otherwise. + +Contributors are required to enter into the IVAS codec Public Collaboration agreement before making +contributions. + +This software is provided "AS IS", without any express or implied warranties. The software is in the +development stage. It is intended exclusively for experts who have experience with such software and +solely for the purpose of inspection. All implied warranties of non-infringement, merchantability +and fitness for a particular purpose are hereby disclaimed and excluded. + +Any dispute, controversy or claim arising under or in relation to providing this software shall be +submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in +accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and +the United Nations Convention on Contracts on the International Sales of Goods. +""" + +import filecmp +import logging +import os +from pathlib import Path +import subprocess as sp +import sys +from typing import Dict, Optional, Union + +import numpy as np +import pytest +import re +import errno +import tempfile + +from .compare_audio import compare_audio_arrays +from .constants import ( + LTV_DIR, + SCRIPTS_DIR, + OUTPUT_PATH_REF, + OUTPUT_PATH_CUT, + FORMAT_TO_FILE_COMPARETEST, + FORMAT_TO_FILE_LTV, + FORMAT_TO_METADATA_FILES, + FORMAT_TO_METADATA_FILES_LTV, + FORMAT_TO_FILE_SMOKETEST, + RENDERER_CMD, + BIN_SUFFIX_MERGETARGET, + PEAQ_SUPPORTED_FMT, +) +from ..constants import CAT_NORMAL + +sys.path.append(SCRIPTS_DIR) +from pyaudio3dtools.audiofile import readfile +from ..cmp_pcm import cmp_pcm +from ..conftest import parse_properties, get_split_idx + + +def _run_cmd(cmd, env, test_info=None): + """ + Helper function for running some command. + Raises a SystemError if either the return code is non-zero or a USAN printout is detected + """ + proc = sp.run(cmd, capture_output=True, text=True, env=env) + stdout = proc.stdout + proc.stderr + + # check for USAN error first + if "UndefinedBehaviorSanitizer" in stdout: + error = f"USAN error detected in stdout of command: {' '.join(cmd)}\n{stdout}" + if test_info is not None: + test_info.error = error + raise SystemError(error) + + # then handle possible crash + try: + proc.check_returncode() + except sp.CalledProcessError as e: + error = f"Command returned non-zero exit status ({e.returncode}): {' '.join(e.cmd)}\n{e.stderr}\n{e.stdout}" + if test_info is not None: + test_info.error = error + raise SystemError(error) + + +def run_cmd(cmd, test_info, env=None): + logging.info(f"\nRunning command\n{' '.join(cmd)}\n") + _run_cmd(cmd, env, test_info) + + +def run_isar_ext_rend_cmd(cmd, env=None): + logging.info(f"\nRunning ISAR EXT REND command\n{' '.join(cmd)}\n") + _run_cmd(cmd, env) + + +def run_ivas_isar_enc_cmd(cmd, env=None): + logging.info(f"\nRunning IVAS ISAR encoder command\n{' '.join(cmd)}\n") + _run_cmd(cmd, env) + + +def run_ivas_isar_dec_cmd(cmd, env=None): + logging.info(f"\nDUT decoder command:\n\t{' '.join(cmd)}\n") + _run_cmd(cmd, env) + + +def run_isar_post_rend_cmd(cmd, env=None): + logging.info(f"\nRunning ISAR post renderer command\n{' '.join(cmd)}\n") + _run_cmd(cmd, env) + + +def check_BE( + test_info, + ref: np.ndarray, + ref_fs: int, + cut: np.ndarray, + cut_fs: int, + atol: int = 2, +) -> tuple: + if ref is None or np.array_equal(ref, np.zeros_like(ref)): + pytest.fail("REF signal does not exist or is zero!") + + if cut is None or np.array_equal(cut, np.zeros_like(cut)): + pytest.fail("CuT signal does not exist or is zero!") + + snr, gain_b, max_diff = compare_audio_arrays(ref, ref_fs, cut, cut_fs) + + if np.isnan(snr) or gain_b == 0: + pytest.fail("Invalid comparison result, check your signals!") + + if ref.shape[0] < cut.shape[0]: + ref = np.pad(ref, [(0, cut.shape[0] - ref.shape[0]), (0, 0)]) + elif ref.shape[0] > cut.shape[0]: + cut = np.pad(cut, [(0, ref.shape[0] - cut.shape[0]), (0, 0)]) + + # check max_diff as well, since compare_audio_arrays will try to adjust for small delay differences + diff_found = not np.allclose(ref, cut, rtol=0, atol=atol) and max_diff > atol + + return diff_found, snr, gain_b, max_diff + + +def run_renderer( + record_property, + props_to_record, + test_info, + in_fmt: str, + out_fmt: str, + metadata_input: Optional[str] = None, + in_meta_files: Optional[list] = None, + trj_file: Optional[str] = None, + non_diegetic_pan: Optional[str] = None, + name_extension: Optional[str] = None, + refrot_file: Optional[str] = None, + refvec_file: Optional[str] = None, + refveclev_file: Optional[str] = None, + config_file: Optional[str] = None, + binary_suffix: str = "", + frame_size: Optional[str] = "20ms", + hrtf_file: Optional[str] = None, + get_mld=False, + mld_lim=0, + get_mld_lim=0, + abs_tol=0, + get_ssnr=False, + get_odg=False, + get_odg_bin=False, + aeid: Optional[Union[Path, int]] = None, + in_file=None, + out_file=None, + sr=48, + render_for_peaq=False, + split_comparison=False, +) -> str: + # prepare arguments and filepaths + if trj_file is not None: + trj_name = f"_{trj_file.stem}" + else: + trj_name = "" + + if refrot_file is not None: + refrot_name = f"_{refrot_file.stem}" + else: + refrot_name = "" + + if refvec_file is not None: + refvec_name = f"_{refvec_file.stem}" + else: + refvec_name = "" + + if refveclev_file is not None: + refveclev_name = f"_{refveclev_file.stem}" + else: + refveclev_name = "" + + if config_file is not None: + config_name = f"_{config_file.stem}" + else: + config_name = "" + + if frame_size: + framing_name = f"_{frame_size}" + else: + framing_name = "" + + if aeid is not None: + if isinstance(aeid, Path): + aeid_name = f"_{aeid.stem}" + else: + aeid_name = aeid + else: + aeid_name = "" + + if not isinstance(out_fmt, str): + out_name = f"{out_fmt.stem}" + else: + out_name = out_fmt + + if hrtf_file is not None: + hrtf_file_name = f"_{hrtf_file.stem}" + else: + hrtf_file_name = "" + + if test_info.config.option.create_ref: + output_path_base = OUTPUT_PATH_REF + else: + output_path_base = OUTPUT_PATH_CUT + + # if in REF or CUT creation mode use the comparetestv + if test_info.config.option.create_ref or test_info.config.option.create_cut: + format_to_file = FORMAT_TO_FILE_COMPARETEST + else: + format_to_file = FORMAT_TO_FILE_SMOKETEST + + format_to_metadata_files = FORMAT_TO_METADATA_FILES + + if test_info.config.option.use_ltv: + if test_info.config.option.ltv_dir: + format_to_file = dict() + format_to_metadata_files = dict() + for k, v in FORMAT_TO_FILE_LTV.items(): + format_to_file[k] = str(v).replace( + str(LTV_DIR), str(test_info.config.option.ltv_dir) + ) + for k, v in FORMAT_TO_METADATA_FILES_LTV.items(): + format_to_file[k] = str(v).replace( + str(LTV_DIR), str(test_info.config.option.ltv_dir) + ) + else: + format_to_file = FORMAT_TO_FILE_LTV + format_to_metadata_files = FORMAT_TO_METADATA_FILES_LTV + + if in_file is None: + if metadata_input is not None: + in_file = metadata_input + in_name = metadata_input.stem + elif not isinstance(in_fmt, str): + in_file = format_to_file[in_fmt.stem] + in_name = in_fmt.stem + else: + in_file = format_to_file[in_fmt] + in_name = in_fmt + + if in_meta_files is None and in_fmt in format_to_metadata_files: + in_meta_files = format_to_metadata_files[in_fmt] + + if out_file is None: + out_file_stem = f"{in_name}_to_{out_name}{trj_name}{non_diegetic_pan}{refrot_name}{refvec_name}{refveclev_name}{config_name}{framing_name}{hrtf_file_name}{name_extension}{aeid_name}.wav" + out_file = str(output_path_base.joinpath(out_file_stem)) + + cmd = RENDERER_CMD[:] + cmd[2] = str(in_file) + cmd[4] = str(in_fmt) + cmd[6] = str(out_file) + cmd[8] = str(out_fmt) + cmd[10] = str(sr) + + if test_info.config.option.create_ref: + cmd[0] += BIN_SUFFIX_MERGETARGET + cmd[0] += binary_suffix + + if in_meta_files is not None: + cmd.extend(["-im", *in_meta_files]) + + if trj_file is not None: + cmd.extend(["-T", str(trj_file)]) + + if hrtf_file is not None: + cmd.extend(["-hrtf", str(hrtf_file)]) + + if non_diegetic_pan is not None: + cmd.extend(["-non_diegetic_pan", str(non_diegetic_pan)]) + if refrot_file is not None: + cmd.extend(["-rf", str(refrot_file)]) + cmd.extend(["-otr", "ref"]) + + if refvec_file is not None: + cmd.extend(["-rvf", str(refvec_file)]) + cmd.extend(["-otr", "ref_vec"]) + + if refveclev_file is not None: + cmd.extend(["-rvf", str(refveclev_file)]) + cmd.extend(["-otr", "ref_vec_lev"]) + + if config_file is not None: + cmd.extend(["-render_config", str(config_file)]) + + if frame_size: + cmd.extend(["-fr", str(frame_size.replace("ms", ""))]) + + if aeid is not None: + cmd.extend(["-aeid", str(aeid)]) + + # Set env variables for UBSAN + env = os.environ.copy() + if test_info.node.name and "UBSAN_OPTIONS" in env.keys(): + env["UBSAN_OPTIONS"] = ( + env["UBSAN_OPTIONS"] + f",log_path=usan_log_{test_info.node.name}" + ) + + testcase_props = { + "format": "Renderer", + "category": CAT_NORMAL, + } + + if record_property is not None: + for k, v in testcase_props.items(): + record_property(k, v) + + # run the renderer + run_cmd(cmd, test_info, env) + + if test_info.config.option.create_cut and not render_for_peaq: + # CUT creation mode will run a comparison with REF + out_file_ref = str(OUTPUT_PATH_REF.joinpath(out_file_stem)) + + # Check if we need to render to mono, stereo or binaural for PEAQ comparison + odg_input = None + odg_test = None + odg_ref = None + if get_odg_bin: + odg_input = out_file_ref[0:-4] + ".INPUT.BINAURAL.wav" + odg_test = str(out_file)[0:-4] + ".BINAURAL.wav" + odg_ref = out_file_ref[0:-4] + ".BINAURAL.wav" + + if out_fmt not in PEAQ_SUPPORTED_FMT: + if in_fmt in PEAQ_SUPPORTED_FMT: + new_fmt = in_fmt # MONO or STEREO + else: + # If input is META which contains stereo, new_fmt needs to be STEREO. + if in_fmt == "META": + with open(in_file, "r") as scene: + if "STEREO" in scene.read(): + new_fmt = "STEREO" + else: + new_fmt = "BINAURAL" + else: + new_fmt = "BINAURAL" + + # Render test to PEAQ supported format (MONO, STEREO or BINAURAL) + cmd2 = RENDERER_CMD[:] + cmd2[2] = str(out_file) # in_file + cmd2[4] = str(out_fmt) # in_fmt + cmd2[6] = odg_test # out_file + cmd2[8] = new_fmt # out_fmt + cmd2[10] = str(sr) + cmd2[0] += BIN_SUFFIX_MERGETARGET # Use IVAS_rend_ref for re-rendering + cmd2[0] += binary_suffix + if "MASA" in str(out_fmt): + cmd2.extend(["-im", out_file + ".met"]) + run_cmd(cmd2, test_info, env) + + # Render ref to BINAURAL with same settings as test + cmd2[2] = str(out_file_ref) # in_file + cmd2[6] = odg_ref # out_file + run_cmd(cmd2, test_info, env) + out_fmt_bin = new_fmt + else: + out_fmt_bin = out_fmt + odg_test = out_file + odg_ref = out_file_ref + + if out_fmt_bin != in_fmt: + # Render input to match out_fmt_bin using same config as input, but with IVAS_rend_ref + cmd[0] += BIN_SUFFIX_MERGETARGET + cmd[0] += binary_suffix + cmd[6] = odg_input # out_file + cmd[8] = out_fmt_bin # out_fmt + run_cmd(cmd, test_info, env) + else: + odg_input = in_file + + ### run the comparison tools + split_idx = np.empty(0) + prop_suffix = [""] + + # 1. run comparison on whole files - this is done always, regardless of the presence of --split_comparison + ref_fs = int(cmd[10]) * 1000 + output_differs_parts, reason_parts = cmp_pcm( + out_file_ref, + out_file, + out_fmt, + ref_fs, + get_mld=get_mld, + mld_lim=get_mld_lim, + abs_tol=abs_tol, + get_ssnr=get_ssnr, + get_odg=get_odg, + get_odg_bin=get_odg_bin, + odg_input=odg_input, + odg_test=odg_test, + odg_ref=odg_ref, + scalefac=test_info.config.option.scalefac, + split_idx=split_idx, + ) + + # 2. run comparison on split files if --split_comparison is given + # for JBM cases, comparison will fail because of length mismatch beetween split wav files and tracefiles + # -> skip split comparison for these cases + if split_comparison: + split_idx = get_split_idx(str(Path(in_file).stem), ref_fs // 1000) + + # this extra if takes care of cases where no splits are found, e.g. the "NOOP" case in the self_test_ltv prm file + # if this would not be there, then the comparison of the whole file would run twice + if len(split_idx) > 0: + output_differs_splits, reason_splits = cmp_pcm( + out_file_ref, + out_file, + out_fmt, + ref_fs, + get_mld=get_mld, + mld_lim=get_mld_lim, + abs_tol=abs_tol, + get_ssnr=get_ssnr, + get_odg=get_odg, + get_odg_bin=get_odg_bin, + odg_input=odg_input, + odg_test=odg_test, + odg_ref=odg_ref, + scalefac=test_info.config.option.scalefac, + split_idx=split_idx, + ) + output_differs_parts += output_differs_splits + reason_parts += reason_splits + + if split_comparison: + prop_suffix = ["_whole"] + [ + f"_split{i:03d}" for i in range(1, len(split_idx) + 1) + ] + + for output_differs, reason, suffix in zip( + output_differs_parts, reason_parts, prop_suffix + ): + result_props = parse_properties( + reason, output_differs, props_to_record, suffix + ) + for k, v in result_props.items(): + record_property(k, v) + + if output_differs_parts[0]: + logging.error(f"Command line was: {' '.join(cmd)}") + pytest.fail(f"Output differs: ({reason_parts[0]})") + + # compare metadata files in case of MASA prerendering + if "MASA" in str(out_fmt): + meta_file_ref = out_file_ref + ".met" + meta_file_cut = out_file + ".met" + if not filecmp.cmp(meta_file_cut, meta_file_ref): + pytest.fail("Metadata file differs from reference") + + return out_file + + +def compare_renderer_args( + record_property, + props_to_record, + test_info, + in_fmt, + out_fmt, + ref_kwargs: Dict, + cut_kwargs: Dict, + split_comparison=False, +): + out_file_ref = run_renderer( + record_property, + props_to_record, + test_info, + in_fmt, + out_fmt, + **ref_kwargs, + split_comparison=split_comparison, + ) + ref, ref_fs = readfile(out_file_ref) + out_file_cut = run_renderer( + record_property, + props_to_record, + test_info, + in_fmt, + out_fmt, + **cut_kwargs, + split_comparison=split_comparison, + ) + cut, cut_fs = readfile(out_file_cut) + [diff_found, snr, gain_b, max_diff] = check_BE(test_info, ref, ref_fs, cut, cut_fs) + if diff_found: + pytest.fail( + f"CuT not BE to REF! SNR : {snr:3.2f} dB, Gain CuT: {gain_b:1.3f}, Max Diff = {int(max_diff)}" + ) + + +def binauralize_input_and_output( + record_property, + props_to_record, + test_info, + input_file, + dut_output_file, + ref_output_file, + in_fmt, + output_config, + enc_opts, + dec_opts, + in_sr, + out_sr, +): + # Use current folder as location for temporary directory, since scene description does not handle spaces in path + with tempfile.TemporaryDirectory(dir=".") as tmp_dir: + tmp_dir = Path(tmp_dir) + scene_dut = str(tmp_dir.joinpath("scene_dut.txt")) + scene_ref = str(tmp_dir.joinpath("scene_ref.txt")) + scene_in = str(tmp_dir.joinpath("scene_in.txt")) + + # File names for binauralized signals, if needed + ref_input_file_binaural = ref_output_file[0:-4] + ".INPUT.BINAURAL.wav" + dut_output_file_binaural = dut_output_file[0:-4] + ".BINAURAL.wav" + ref_output_file_binaural = ref_output_file[0:-4] + ".BINAURAL.wav" + + # Identify metadata + in_meta_files = [ + str(SCRIPTS_DIR.joinpath(m)) if m != "NULL" else m + for m in re.findall(r"\b\S+\.csv|NULL\b", enc_opts) + ] # All .csv or NULL files in enc_opts are ISM metadata files. + n_obj = len(in_meta_files) + + # If extended metadata is not used, strip the metadata for the external renderer + extended_md_used = ( + re.search(r"-ism\s?\+[1-4]", enc_opts) + and not "OMASA" in in_fmt + and not "OSBA" in in_fmt + ) + if not extended_md_used and n_obj > 0: + truncated_meta_files = [] + for md in in_meta_files: + if md != "NULL": + md_out_file = str(tmp_dir.joinpath(os.path.basename(md))) + with open(md_out_file, "w") as fp_out, open(md, "r") as fp_in: + for line in fp_in: + fp_out.write( + ",".join(line.split(",")[:2]) + "\n" + ) # Keep only first two elements: azim, elev + else: + md_out_file = "NULL" # Cannot truncate NULL, just insert it without modification + truncated_meta_files.append(md_out_file) + in_meta_files = truncated_meta_files + + in_meta_files = in_meta_files + [ + str(SCRIPTS_DIR.joinpath(m)) for m in re.findall(r"\b\S+\.met\b", enc_opts) + ] # All .met files in enc_opts are MASA metadata files. + out_meta_files = None + if output_config == "EXT": + out_meta_files = [] + if n_obj > 0: + out_meta_files = out_meta_files + [ + f"{dut_output_file}.{i}.csv" for i in range(0, n_obj) + ] + if "MASA" in in_fmt: + out_meta_files = out_meta_files + [f"{dut_output_file}.met"] + if output_config == "EXT": + output_config = in_fmt + if output_config == "": + output_config = "MONO" # EVS mono + metadata_input = None + + if "OSBA" in in_fmt or "OMASA" in in_fmt: + scene_description_file(in_fmt, scene_in, n_obj, input_file, in_meta_files) + input_file = scene_in + in_meta_files = None + in_fmt = "META" + + if "OSBA" in output_config or "OMASA" in output_config: + if "OSBA" in output_config: + output_config = ( + output_config[:-1] + "3" + ) # Temporary fix to handle than IVAS_dec produces HOA3 for all OSBA configs. Needs to be removed when this fix is ported to BASOP. + scene_description_file( + output_config, scene_dut, n_obj, dut_output_file, out_meta_files + ) + dut_output_file = scene_dut + scene_description_file( + output_config, scene_ref, n_obj, ref_output_file, out_meta_files + ) + ref_output_file = scene_ref + out_meta_files = None + output_config = "META" + + # Identify headtracking and orientation trajectories + trj_file = findstr(r"-t\s+(\S+)", dec_opts) + non_diegetic_pan = findstr(r"-non_diegetic_pan\s+(\S+)", dec_opts) + if non_diegetic_pan is not None: + output_config = "STEREO" + name_extension = None + refrot_file = findstr(r"-rf\s+(\S+)", dec_opts) + rot_tmp_file = findstr(r"-rvf\s+(\S+)", dec_opts) + refveclev_file = None + refvec_file = None + if "-otr ref_vec_lev".upper() in dec_opts.upper(): + refveclev_file = rot_tmp_file + else: + if "-otr ref_vec".upper() in dec_opts.upper(): + refvec_file = rot_tmp_file + + # Rendering configuration + config_file = findstr(r"-render_config\s+(\S+)", dec_opts) + binary_suffix = "_ref" + frame_size = findstr(r"-fr\s+(\S+)", dec_opts) + # hrtf_file = findstr(r'-hrtf\s+(\S+)', dec_opts) + hrtf_file = None # Default HRTFs used for binaural rendering of output + + aeid = findstr(r"-aeid\s+(\S+)", dec_opts) + + if not output_config.upper() in PEAQ_SUPPORTED_FMT: + # Render output to BINAURAL + output_reformat = "BINAURAL" + + check_and_makedir(str(Path(dut_output_file_binaural).parent)) + + run_renderer( + record_property, + props_to_record, + test_info, + output_config, + output_reformat, + metadata_input, + out_meta_files, + trj_file, + non_diegetic_pan, + name_extension, + refrot_file, + refvec_file, + refveclev_file, + config_file, + binary_suffix, + frame_size, + hrtf_file, + aeid, + in_file=dut_output_file, + out_file=dut_output_file_binaural, + sr=out_sr, + render_for_peaq=True, + ) + + check_and_makedir(str(Path(ref_output_file_binaural).parent)) + + run_renderer( + record_property, + props_to_record, + test_info, + output_config, + output_reformat, + metadata_input, + out_meta_files, + trj_file, + non_diegetic_pan, + name_extension, + refrot_file, + refvec_file, + refveclev_file, + config_file, + binary_suffix, + frame_size, + hrtf_file, + aeid, + in_file=ref_output_file, + out_file=ref_output_file_binaural, + sr=out_sr, + render_for_peaq=True, + ) + + # Update output_config to rendered format + output_config = output_reformat + else: + # Signal already mono, stereo or binaural + dut_output_file_binaural = dut_output_file + ref_output_file_binaural = ref_output_file + + if in_fmt.upper() != output_config.upper(): + # Render input to match output_config + out_fmt = output_config + + check_and_makedir(str(Path(ref_input_file_binaural).parent)) + + run_renderer( + record_property, + props_to_record, + test_info, + in_fmt, + out_fmt, + metadata_input, + in_meta_files, + trj_file, + non_diegetic_pan, + name_extension, + refrot_file, + refvec_file, + refveclev_file, + config_file, + binary_suffix, + frame_size, + hrtf_file, + aeid, + in_file=input_file, + out_file=ref_input_file_binaural, + sr=in_sr, + render_for_peaq=True, + ) + else: + ref_input_file_binaural = input_file + return ( + ref_input_file_binaural, + dut_output_file_binaural, + ref_output_file_binaural, + ) + + +def findstr(exp, s, one_element=True): + result = [SCRIPTS_DIR.joinpath(x) for x in re.findall(exp, s)] + if len(result) == 0: + return None + if one_element: + return result[0] + return result + + +def check_and_makedir(dir_path): + if not os.path.exists(dir_path): + try: + os.makedirs(dir_path) + except OSError as e: + if e.errno != errno.EEXIST: + raise # raises the error again + + +def scene_description_file(in_fmt, metadata_tmp, n_obj, input_file, in_meta_files): + with open(metadata_tmp, "w") as fp_meta: + currdir = Path( + metadata_tmp + ).parent # File names must be relative to config file location + fp_meta.write(f"{os.path.relpath(input_file, currdir)}\n") # Input file + fp_meta.write(f"{n_obj+1}\n") # Number of sources + for n in range(0, n_obj): + if in_meta_files[n] == "NULL": + md_file = "1\n1,0,0" # NULL metadata position: azim=0,elev=0 for 1 frame, looped throughout all frames. + else: + md_file = os.path.relpath(in_meta_files[n], currdir) + fp_meta.write(f"ISM\n{n+1}\n{md_file}\n") # ISM metadata + if "OSBA" in in_fmt: + fp_meta.write( + "gain_dB:-6\n" + ) # Set -6 dB on all components for OSBA to match IVAS_dec + fp_meta.write(f"{in_fmt.split('_')[0][1:]}\n") # SBA or MASA + fp_meta.write(f"{n_obj+1}\n") + fp_meta.write(f"{in_fmt.split('_')[-1]}\n") # SBA or MASA parameter + if "OMASA" in in_fmt: + fp_meta.write( + f"{os.path.relpath(in_meta_files[n_obj], currdir)}\n" + ) # MASA metadata + if "OSBA" in in_fmt: + fp_meta.write( + "gain_dB:-6\n" + ) # Set -6 dB on all components for OSBA to match IVAS_dec diff --git a/tests/requirements.txt b/tests/requirements.txt index 2eb090f4fb56da7587e0a3eb19b7e287870361c1..00100fae88284c95868ad876d1fd19210746d77d 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -2,3 +2,4 @@ pytest>=5.3.5 pytest-xdist>=1.31.0 scipy>=1.5.2 numpy>=1.19.2 +bitstring>=4.3.1 diff --git a/tests/rtp/ivasrtp.py b/tests/rtp/ivasrtp.py new file mode 100644 index 0000000000000000000000000000000000000000..b09333fc46c5b2797607efb6d11b5078ec033924 --- /dev/null +++ b/tests/rtp/ivasrtp.py @@ -0,0 +1,1653 @@ +#!/usr/bin/env python3 + +__copyright__ = """ +(C) 2022-2025 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB, +Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., +Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, +Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other +contributors to this repository. All Rights Reserved. + +This software is protected by copyright law and by international treaties. +The IVAS codec Public Collaboration consisting of Dolby International AB, Ericsson AB, +Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., +Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, +Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other +contributors to this repository retain full ownership rights in their respective contributions in +the software. This notice grants no license of any kind, including but not limited to patent +license, nor is any license granted by implication, estoppel or otherwise. + +Contributors are required to enter into the IVAS codec Public Collaboration agreement before making +contributions. + +This software is provided "AS IS", without any express or implied warranties. The software is in the +development stage. It is intended exclusively for experts who have experience with such software and +solely for the purpose of inspection. All implied warranties of non-infringement, merchantability +and fitness for a particular purpose are hereby disclaimed and excluded. + +Any dispute, controversy or claim arising under or in relation to providing this software shall be +submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in +accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and +the United Nations Convention on Contracts on the International Sales of Goods. +""" + +__doc__ = """ +To configure test modules. +""" + +import struct +from enum import Enum +from dataclasses import dataclass, field, asdict +from bitstring import ConstBitStream, BitStream, ReadError +import json +import base64 +import argparse +from pathlib import Path +from typing import cast, Optional + +NO_REQ = "NO_REQ" + + +class CAMODE(str, Enum): + CA_LO_02 = "CA-LO-O2" + CA_LO_03 = "CA-LO-O3" + CA_LO_05 = "CA-LO-O5" + CA_LO_07 = "CA-LO-O7" + CA_HI_02 = "CA-HI-O2" + CA_HI_03 = "CA-HI-O3" + CA_HI_05 = "CA-HI-O5" + CA_HI_07 = "CA-HI-O7" + + +class CODECS(str, Enum): + AMRWB = "amrwb_io" + EVS = "evs" + IVAS = "ivas" + + +class SRCODEC(str, Enum): + LCLD = "lcld" + LC3PLUS = "lc3+" + + +class BANDWIDTH(str, Enum): + NB = "narrowband" + WB = "wideband" + SWB = "super wideband" + FB = "fullband" + + +class REQUESTS(str, Enum): + CODEC = ("codec",) + BR = "bitrate" + BW = "bandwidth" + CA = "ca-mode" + FMT = "format" + SUBFMT = "sub-format" + SRCFG = "sr-config" + + +class FORMATS(str, Enum): + STEREO = "Stereo" + SBA = "SBA" + MASA = "MASA" + ISM = "ISM" + MC = "MC" + OMASA = "OMASA" + OSBA = "OSBA" + + +class SUBFORMATS(str, Enum): + FOA_PLANAR = "FOA planar" + HOA2_PLANAR = "HOA2 planar" + HOA3_PLANAR = "HOA3 planar" + FOA = "FOA" + HOA2 = "HOA2" + HOA3 = "HOA3" + MASA1 = "MASA1" + MASA2 = "MASA2" + ISM1 = "ISM1" + ISM2 = "ISM2" + ISM3 = "ISM3" + ISM4 = "ISM4" + ISM1_EXTENDED_METADATA = "ISM1 extended metadata" + ISM2_EXTENDED_METADATA = "ISM2 extended metadata" + ISM3_EXTENDED_METADATA = "ISM3 extended metadata" + ISM4_EXTENDED_METADATA = "ISM4 extended metadata" + MC_5_1 = "MC 5.1" + MC_7_1 = "MC 7.1" + MC_5_1_2 = "MC 5.1.2" + MC_5_1_4 = "MC 5.1.4" + MC_7_1_4 = "MC 7.1.4" + Reserved22 = "Reserved22" + Reserved23 = "Reserved23" + Reserved24 = "Reserved24" + Reserved25 = "Reserved25" + Reserved26 = "Reserved26" + Reserved27 = "Reserved27" + Reserved28 = "Reserved28" + Reserved29 = "Reserved29" + Reserved30 = "Reserved30" + Reserved31 = "Reserved31" + Reserved32 = "Reserved32" + OMASA_ISM1_1TC = "OMASA ISM1 1TC" + OMASA_ISM2_1TC = "OMASA ISM2 1TC" + OMASA_ISM3_1TC = "OMASA ISM3 1TC" + OMASA_ISM4_1TC = "OMASA ISM4 1TC" + OMASA_ISM1_2TC = "OMASA ISM1 2TC" + OMASA_ISM2_2TC = "OMASA ISM2 2TC" + OMASA_ISM3_2TC = "OMASA ISM3 2TC" + OMASA_ISM4_2TC = "OMASA ISM4 2TC" + OSBA_ISM1_FOA_PLANAR = "OSBA ISM1 FOA planar" + OSBA_ISM2_FOA_PLANAR = "OSBA ISM2 FOA planar" + OSBA_ISM3_FOA_PLANAR = "OSBA ISM3 FOA planar" + OSBA_ISM4_FOA_PLANAR = "OSBA ISM4 FOA planar" + OSBA_ISM1_FOA = "OSBA ISM1 FOA" + OSBA_ISM2_FOA = "OSBA ISM2 FOA" + OSBA_ISM3_FOA = "OSBA ISM3 FOA" + OSBA_ISM4_FOA = "OSBA ISM4 FOA" + OSBA_ISM1_HOA2_PLANAR = "OSBA ISM1 HOA2 planar" + OSBA_ISM2_HOA2_PLANAR = "OSBA ISM2 HOA2 planar" + OSBA_ISM3_HOA2_PLANAR = "OSBA ISM3 HOA2 planar" + OSBA_ISM4_HOA2_PLANAR = "OSBA ISM4 HOA2 planar" + OSBA_ISM1_HOA2 = "OSBA ISM1 HOA2" + OSBA_ISM2_HOA2 = "OSBA ISM2 HOA2" + OSBA_ISM3_HOA2 = "OSBA ISM3 HOA2" + OSBA_ISM4_HOA2 = "OSBA ISM4 HOA2" + OSBA_ISM1_HOA3_PLANAR = "OSBA ISM1 HOA3 planar" + OSBA_ISM2_HOA3_PLANAR = "OSBA ISM2 HOA3 planar" + OSBA_ISM3_HOA3_PLANAR = "OSBA ISM3 HOA3 planar" + OSBA_ISM4_HOA3_PLANAR = "OSBA ISM4 HOA3 planar" + OSBA_ISM1_HOA3 = "OSBA ISM1 HOA3" + OSBA_ISM2_HOA3 = "OSBA ISM2 HOA3" + OSBA_ISM3_HOA3 = "OSBA ISM3 HOA3" + OSBA_ISM4_HOA3 = "OSBA ISM4 HOA3" + + +class PIDATAS(str, Enum): + SCENE_ORIENTATION = "SCENE_ORIENTATION" + DEVICE_ORIENTATION_COMPENSATED = "DEVICE_ORIENTATION_COMPENSATED" + DEVICE_ORIENTATION_UNCOMPENSATED = "DEVICE_ORIENTATION_UNCOMPENSATED" + ACOUSTIC_ENVIRONMENT = "ACOUSTIC_ENVIRONMENT" + AUDIO_DESCRIPTION = "AUDIO_DESCRIPTION" + ISM_NUM = "ISM_NUM" + ISM_ID = "ISM_ID" + ISM_GAIN = "ISM_GAIN" + ISM_ORIENTATION = "ISM_ORIENTATION" + ISM_POSITION = "ISM_POSITION" + ISM_DISTANCE_ATTENUATION = "ISM_DISTANCE_ATTENUATION" + ISM_DIRECTIVITY = "ISM_DIRECTIVITY" + DIEGETIC_TYPE = "DIEGETIC_TYPE" + DYNAMIC_AUDIO_SUPPRESSION_INDICATION = "DYNAMIC_AUDIO_SUPPRESSION_INDICATION" + AUDIO_FOCUS_INDICATION = "AUDIO_FOCUS_INDICATION" + RESERVED15 = "RESERVED15" + PLAYBACK_DEVICE_ORIENTATION = "PLAYBACK_DEVICE_ORIENTATION" + HEAD_ORIENTATION = "HEAD_ORIENTATION" + LISTENER_POSITION = "LISTENER_POSITION" + DYNAMIC_AUDIO_SUPPRESSION_REQUEST = "DYNAMIC_AUDIO_SUPPRESSION_REQUEST" + AUDIO_FOCUS_REQUEST = "AUDIO_FOCUS_REQUEST" + PI_LATENCY = "PI_LATENCY" + R_ISM_ID = "R_ISM_ID" + R_ISM_GAIN = "R_ISM_GAIN" + R_ISM_ORIENTATION = "R_ISM_ORIENTATION" + R_ISM_POSITION = "R_ISM_POSITION" + R_ISM_DIRECTION = "R_ISM_DIRECTION" + RESERVED27 = "RESERVED27" + RESERVED28 = "RESERVED28" + RESERVED29 = "RESERVED29" + RESERVED30 = "RESERVED30" + NO_PI_DATA = "NO_PI_DATA" + + +class SUPPRESSION_LEVEL(int, Enum): + SUPPRESSION_LEVEL_MIN = 0 + SUPPRESSION_LEVEL_1 = 1 + SUPPRESSION_LEVEL_2 = 2 + SUPPRESSION_LEVEL_3 = 3 + SUPPRESSION_LEVEL_4 = 4 + SUPPRESSION_LEVEL_5 = 5 + SUPPRESSION_LEVEL_6 = 6 + SUPPRESSION_LEVEL_7 = 7 + SUPPRESSION_LEVEL_8 = 8 + SUPPRESSION_LEVEL_9 = 9 + SUPPRESSION_LEVEL_10 = 10 + SUPPRESSION_LEVEL_11 = 11 + SUPPRESSION_LEVEL_MAX = 12 + SUPPRESSION_LEVEL_NONE = 13 + SUPPRESSION_LEVEL_DEFAULT = 14 + SUPPRESSION_LEVEL_NO_PREFERENCE = 15 + + +class AUDIO_FOCUS_LEVEL(int, Enum): + AUDIO_FOCUS_LEVEL_NONE = 0 + AUDIO_FOCUS_LEVEL_1 = 1 + AUDIO_FOCUS_LEVEL_2 = 2 + AUDIO_FOCUS_LEVEL_3 = 3 + AUDIO_FOCUS_LEVEL_4 = 4 + AUDIO_FOCUS_LEVEL_5 = 5 + AUDIO_FOCUS_LEVEL_6 = 6 + AUDIO_FOCUS_LEVEL_7 = 7 + AUDIO_FOCUS_LEVEL_8 = 8 + AUDIO_FOCUS_LEVEL_9 = 9 + AUDIO_FOCUS_LEVEL_10 = 10 + AUDIO_FOCUS_LEVEL_11 = 11 + AUDIO_FOCUS_LEVEL_12 = 12 + AUDIO_FOCUS_LEVEL_MAX = 13 + AUDIO_FOCUS_LEVEL_DEFAULT = 14 + AUDIO_FOCUS_LEVEL_NO_PREFERENCE = 15 + + +@dataclass +class RTPHDR: + version: int = 2 + padding: bool = False + extension: bool = False + csrcCount: int = 0 + marker: bool = False + payloadType: int = 0 + sequenceNum: int = 0 + timestamp: int = 0 + ssrc: int = 0 + extensionType: int = 0 + extensionLength: int = 0 + csrcList: list = field(default_factory=list) + extensionWords: list = field(default_factory=list) + + def updateHeader(self, numFrames: int): + self.sequenceNum = (self.sequenceNum + 1) % 65536 + self.timestamp += 320 * numFrames + + def pack(self, bitstrm: BitStream): + bitstrm.append(f"uint:2={self.version}") + bitstrm.append(f"bool={self.padding}") + bitstrm.append(f"bool={self.extension}") + bitstrm.append(f"uint:4={self.csrcCount}") + bitstrm.append(f"bool={self.marker}") + bitstrm.append(f"uint:7={self.payloadType}") + bitstrm.append(f"uintbe:16={self.sequenceNum}") + bitstrm.append(f"uintbe:32={self.timestamp}") + bitstrm.append(f"uintbe:32={self.ssrc}") + assert ( + len(self.csrcList) == self.csrcCount + ), "csrcList must be of length csrcCount" + for csrc in self.csrcList: + bitstrm.append(f"uintbe:32={csrc}") + if self.extension: + bitstrm.append(f"uintbe:16={self.extensionType}") + bitstrm.append(f"uintbe:16={self.extensionLength}") + assert ( + len(self.extensionWords) == self.extensionLength + ), "extensionWords must be of extensionLength csrcCount" + for ext in self.extensionWords: + bitstrm.append(f"uintbe:32={ext}") + + @classmethod + def unpack(cls, bitstrm: ConstBitStream): + hdr = cls() + hdr.version = bitstrm.read(2).uint + hdr.padding = bitstrm.read(1).bool + hdr.extension = bitstrm.read(1).bool + hdr.csrcCount = bitstrm.read(4).int + hdr.marker = bitstrm.read(1).bool + hdr.payloadType = bitstrm.read(7).int + hdr.sequenceNum = bitstrm.read(16).uintbe + hdr.timestamp = bitstrm.read(32).uintbe + hdr.ssrc = bitstrm.read(32).uintbe + if hdr.csrcCount: + hdr.csrcList = [bitstrm.read(32).uintbe for _ in range(hdr.csrcCount)] + if hdr.extension: + hdr.extensionType = bitstrm.read(16).uintbe + hdr.extensionLength = bitstrm.read(16).uintbe + hdr.extensionWords = [ + bitstrm.read(32).uintbe for _ in range(hdr.extensionLength) + ] + return hdr + + +@dataclass +class SRCONFIG: + diegetic: bool = False + yaw: bool = False + pitch: bool = False + roll: bool = False + + +@dataclass +class CMR: + bandwidth: BANDWIDTH + codec: CODECS = CODECS.IVAS + startIdx: int = 0 + endIdx: int = 0 + bitrates: list = field(default_factory=list) + + +@dataclass +class SRINFO: + bitrate: int = 0 + diegetic: bool = False + transportCodec: SRCODEC = SRCODEC.LCLD + + +@dataclass +class FRAME: + codec: CODECS = CODECS.IVAS + frmSizeBits: int = 0 + bitrate: int = 0 + speechLost: bool = False + srInfo: SRINFO = None + timestamp: int = 0 + au: bytes = field(default_factory=bytes) + + +# PI DATA STRUCTURES +@dataclass +class ORIENTATION: + w: float = 0.0 + x: float = 0.0 + y: float = 0.0 + z: float = 0.0 + + +@dataclass +class POSITION: + x: float = 0.0 + y: float = 0.0 + z: float = 0.0 + + +class ISM_POSITIONS: + positions: list[POSITION] + + +@dataclass +class AUDIO_DESCRIPTION: + isSpeech: bool = False + isMusic: bool = False + isAmbiance: bool = False + isEditable: bool = False + isBinaural: bool = False + + +@dataclass +class DYNAMIC_AUDIO_SUPPRESSION: + preferSpeech: bool = False + preferMusic: bool = False + preferAmbiance: bool = False + level: SUPPRESSION_LEVEL = SUPPRESSION_LEVEL.SUPPRESSION_LEVEL_MAX + + +@dataclass +class DIEGETIC_TYPE: + isDigetic: list[bool] + + +@dataclass +class ACOUSTIC_ENVIRONMENT: + aeid: int = 0 + rt60: tuple[float, float, float] = () + dsr: tuple[float, float, float] = () + dim: tuple[float, float, float] = () + abscoeff: tuple[float, float, float, float, float, float] = () + + +@dataclass +class AUDIO_FOCUS: + direction: Optional[ORIENTATION] = None + level: Optional[AUDIO_FOCUS_LEVEL] = None + + +@dataclass +class PIDATA: + timestamp: int = 0 + type: str = "NO_PI_DATA" + data: any = None + + +MAX_PACKED_PI_SIZE = 32 +ivasBitrates = [ + 13200, + 16400, + 24400, + 32000, + 48000, + 64000, + 80000, + 96000, + 128000, + 160000, + 192000, + 256000, + 384000, + 512000, + -1, + 5200, +] +evsBitrates = [ + 5900, + 7200, + 8000, + 9600, + 13200, + 16400, + 24400, + 32000, + 48000, + 64000, + 96000, + 128000, + 2400, + -1, + -1, + -1, +] +amrwbBitrates = [ + 6600, + 8850, + 12650, + 14250, + 15850, + 18250, + 19850, + 23050, + 23850, + 1750, + -1, + -1, + -1, + -1, + -1, + -1, +] +requestBitratesForCodec = { + CODECS.AMRWB: amrwbBitrates[0:9], + CODECS.EVS: evsBitrates[0:12], + CODECS.IVAS: ivasBitrates[0:14], +} +rt60Value = [ + 0.01, + 0.0126, + 0.0159, + 0.02, + 0.0252, + 0.0317, + 0.04, + 0.0504, + 0.0635, + 0.08, + 0.1008, + 0.1270, + 0.16, + 0.2016, + 0.2540, + 0.32, + 0.4032, + 0.5080, + 0.64, + 0.8063, + 1.0159, + 1.28, + 1.6127, + 2.0319, + 2.56, + 3.2254, + 4.0637, + 5.12, + 6.4508, + 8.1275, + 10.24, + 12.9016, +] +dsrValue = [ + -20.0, + -21.0, + -22.0, + -23.0, + -24.0, + -25.0, + -26.0, + -27.0, + -28.0, + -29.0, + -30.0, + -31.0, + -32.0, + -33.0, + -34.0, + -35.0, + -36.0, + -37.0, + -38.0, + -39.0, + -40.0, + -41.0, + -42.0, + -43.0, + -44.0, + -45.0, + -46.0, + -47.0, + -48.0, + -49.0, + -50.0, + -51.0, + -52.0, + -53.0, + -54.0, + -55.0, + -56.0, + -57.0, + -58.0, + -59.0, + -60.0, + -61.0, + -62.0, + -63.0, + -64.0, + -65.0, + -66.0, + -67.0, + -68.0, + -69.0, + -70.0, + -71.0, + -72.0, + -73.0, + -74.0, + -75.0, + -76.0, + -77.0, + -78.0, + -79.0, + -80.0, + -81.0, + -82.0, + -83.0, +] +roomDimensionValue = [ + 0.5, + 0.707, + 1.0, + 1.4141, + 2.0, + 2.8282, + 4.0, + 5.6568, + 8.0, + 11.314, + 16.0, + 22.627, + 32.0, + 45.255, + 64.0, + 90.51, +] +absorptionCoeffValues = [0.0800, 0.1656, 0.3430, 0.7101] +codedFormats = list(FORMATS) +codedSubFormats = list(SUBFORMATS) +PiTypeNames = list(PIDATAS) + + +def mapNearestIndex(table: list, val: float) -> int: + for idx, entry in enumerate(table): + if abs(entry) >= abs(val): + return idx + return len(table) - 1 + + +getListIndex = lambda mylist, val: mylist.index(val) if val in mylist else -1 + +cmrLookup = [ + CMR( + bandwidth=BANDWIDTH.NB, + codec=CODECS.EVS, + startIdx=0, + endIdx=7, + bitrates=evsBitrates, + ), # 000 = NB-EVS + CMR( + bandwidth=BANDWIDTH.WB, + codec=CODECS.AMRWB, + startIdx=0, + endIdx=9, + bitrates=amrwbBitrates, + ), # 001 = AMRWB IO + CMR( + bandwidth=BANDWIDTH.WB, + codec=CODECS.EVS, + startIdx=0, + endIdx=12, + bitrates=evsBitrates, + ), # 010 = WB-EVS + CMR( + bandwidth=BANDWIDTH.SWB, + codec=CODECS.EVS, + startIdx=3, + endIdx=12, + bitrates=evsBitrates, + ), # 011 = SWB-EVS + CMR( + bandwidth=BANDWIDTH.FB, + codec=CODECS.EVS, + startIdx=5, + endIdx=12, + bitrates=evsBitrates, + ), # 100 = FB-EVS + CMR( + bandwidth=BANDWIDTH.WB, codec=CODECS.EVS, startIdx=0, endIdx=0, bitrates=[] + ), # 101 = WB-CA + CMR( + bandwidth=BANDWIDTH.SWB, codec=CODECS.EVS, startIdx=0, endIdx=0, bitrates=[] + ), # 110 = SWB-CA + CMR( + bandwidth=NO_REQ, + codec=CODECS.IVAS, + startIdx=0, + endIdx=14, + bitrates=ivasBitrates, + ), # 111 = IVAS +] + +q15 = lambda x: int(min(32767.0, max(-32768.0, x * 32768.0))) + + +def unpackUnsupported(bitstrm: ConstBitStream, piSize: int) -> any: + # assert False, "Unsupported PI Data" + return base64.b64encode(bitstrm.read(piSize * 8).tobytes()).decode("utf-8") + + +def packUnsupported(bitstrm: ConstBitStream, data: any) -> any: + assert False, f"unsupported PI Data of type : {type(data)}" + + +def unpackNoPiData(bitstrm: ConstBitStream, piSize: int) -> None: + assert piSize == 0, "NO_PI_DATA should be 0 size" + + +def packNoPiData(bitstrm: BitStream, data: any = None): + pass + + +def unpackOrientations(bitstrm: ConstBitStream, piSize: int) -> list[ORIENTATION]: + assert ( + piSize % 8 + ) == 0 and piSize <= 32, "Incorrect PI Data Size for list[ORIENTATION]" + orientations = list() + while piSize > 0: + w = bitstrm.read(16).int / 32768.0 + x = bitstrm.read(16).int / 32768.0 + y = bitstrm.read(16).int / 32768.0 + z = bitstrm.read(16).int / 32768.0 + orientations.append(ORIENTATION(w, x, y, z)) + piSize -= 8 + return orientations + + +def packOrientations(bitstrm: BitStream, data: any): + assert type(data) == list, "Orientation PI Data expects a data of type list" + for orientation in cast(list, data): + assert ( + type(orientation) == ORIENTATION + ), "Orientation PI Data expects a data of type list[ORIENTATION]" + bitstrm.append(f"intbe:16={q15(orientation.w)}") + bitstrm.append(f"intbe:16={q15(orientation.x)}") + bitstrm.append(f"intbe:16={q15(orientation.y)}") + bitstrm.append(f"intbe:16={q15(orientation.z)}") + + +def unpackPositions(bitstrm: ConstBitStream, piSize: int) -> list[POSITION]: + assert piSize <= 24 and (piSize % 6) == 0, "Incorrect PI Data Size for Positions" + positions = list() + while piSize > 0: + x = bitstrm.read(16).int / 100.0 + y = bitstrm.read(16).int / 100.0 + z = bitstrm.read(16).int / 100.0 + positions.append(POSITION(x, y, z)) + piSize -= 6 + return positions + + +def packPositions(bitstrm: BitStream, data: any): + assert type(data) == list, "Position PI Data expects a data of type list" + positions = cast(list, data) + assert len(positions) <= 4, "Max one position per ISM object" + for position in positions: + assert ( + type(position) == POSITION + ), "Position PI Data expects a data of type list[POSITIONS]" + bitstrm.append(f"intbe:16={q15(position.x / 327.68)}") + bitstrm.append(f"intbe:16={q15(position.y / 327.68)}") + bitstrm.append(f"intbe:16={q15(position.z / 327.68)}") + + +def unpackOrientation(bitstrm: ConstBitStream, piSize: int) -> ORIENTATION: + assert piSize == 8, "Incorrect PI Data Size for ORIENTATION" + orientations = unpackOrientations(bitstrm, piSize) + assert len(orientations) == 1 + return orientations[0] + + +def packOrientation(bitstrm: BitStream, data: any): + assert ( + type(data) == ORIENTATION + ), "Orientation PI Data expects a data of type ORIENTATION" + orientation = cast(ORIENTATION, data) + packOrientations(bitstrm, [orientation]) + + +def unpackPosition(bitstrm: ConstBitStream, piSize: int) -> POSITION: + assert piSize == 6, "Incorrect PI Data Size for POSITION" + positions = unpackPositions(bitstrm, piSize) + assert len(positions) == 1 + return positions[0] + + +def packPosition(bitstrm: BitStream, data: any): + assert type(data) == POSITION, "Position PI Data expects a data of type POSITION" + position = cast(POSITION, data) + packPositions(bitstrm, [position]) + + +def unpackAudioDescription( + bitstrm: ConstBitStream, piSize: int +) -> list[AUDIO_DESCRIPTION]: + assert piSize <= 5, "Incorrect PI Data Size for AUDIO_DESCRIPTION" + ad = list() + for byte in range(piSize): + V = bitstrm.read(1).bool + M = bitstrm.read(1).bool + A = bitstrm.read(1).bool + E = bitstrm.read(1).bool + B = bitstrm.read(1).bool + _ = bitstrm.read(3) + ad.append( + AUDIO_DESCRIPTION( + isSpeech=V, isMusic=M, isAmbiance=A, isEditable=E, isBinaural=B + ) + ) + return ad + + +def packAudioDescription(bitstrm: BitStream, data: any): + assert ( + type(data) == list + ), "Audio Description PI Data expects a data of type list[AUDIO_DESCRIPTION]" + for desc in cast(list, data): + assert ( + type(desc) == AUDIO_DESCRIPTION + ), "Audio Description PI Data expects a data of type list[AUDIO_DESCRIPTION]" + ad = cast(AUDIO_DESCRIPTION, desc) + bitstrm.append(f"bool={ad.isSpeech}") + bitstrm.append(f"bool={ad.isMusic}") + bitstrm.append(f"bool={ad.isAmbiance}") + bitstrm.append(f"bool={ad.isEditable}") + bitstrm.append(f"bool={ad.isBinaural}") + bitstrm.append(f"uint:3=0") + + +def unpackDAS(bitstrm: ConstBitStream, piSize: int) -> list[AUDIO_DESCRIPTION]: + assert piSize == 2, "Incorrect PI Data Size for DYNAMIC_AUDIO_SUPPRESSION" + V = bitstrm.read(1).bool + M = bitstrm.read(1).bool + A = bitstrm.read(1).bool + _ = bitstrm.read(5) + SLI = bitstrm.read(4).uint + _ = bitstrm.read(4) + return DYNAMIC_AUDIO_SUPPRESSION( + preferSpeech=V, preferMusic=M, preferAmbiance=A, level=SLI + ) + + +def packDAS(bitstrm: BitStream, data: any): + assert ( + type(data) == DYNAMIC_AUDIO_SUPPRESSION + ), "Dynamic Audio Suppression PI Data expects a data of type DYNAMIC_AUDIO_SUPPRESSION" + das = cast(DYNAMIC_AUDIO_SUPPRESSION, data) + bitstrm.append(f"bool={das.preferSpeech}") + bitstrm.append(f"bool={das.preferMusic}") + bitstrm.append(f"bool={das.preferAmbiance}") + bitstrm.append(f"uint:5=0") + bitstrm.append(f"uint:4={das.level}") + bitstrm.append(f"uint:4=0") + + +def unpackDiegetic(bitstrm: ConstBitStream, piSize: int) -> DIEGETIC_TYPE: + assert piSize == 1, "Incorrect PI Data Size for DIEGETIC_TYPE" + digType = list() + for _ in range(5): # no way to know how many bits are valid bits, so all 5 read + digType.append(bitstrm.read(1).bool) + bitstrm.bytealign() + return DIEGETIC_TYPE(isDigetic=digType) + + +def packDiegetic(bitstrm: BitStream, data: any): + assert ( + type(data) == DIEGETIC_TYPE + ), "Diegetic type PI Data expects a data of type DIEGETIC_TYPE" + diegetic = cast(DIEGETIC_TYPE, data) + assert ( + len(diegetic.isDigetic) <= 5 + ), "Maximum 1 bit per object + 1 bit for SBA/MASA is required (max 5)" + for isDigetic in diegetic.isDigetic: + bitstrm.append(f"bool={isDigetic}") + nPad = 8 - (bitstrm.pos % 8) + if nPad > 0: + bitstrm.append(f"uint:{nPad}=0") + + +def unpackAcousticEnv(bitstrm: ConstBitStream, piSize: int) -> DIEGETIC_TYPE: + assert ( + piSize == 1 or piSize == 5 or piSize == 8 + ), "Incorrect PI Data Size for ACOUSTIC_ENVIRONMENT" + rt60 = list() + dsr = list() + dim = list() + absCoeff = list() + + if piSize == 1: + bitstrm.read(1) + + aeid = bitstrm.read(7).uint + + if piSize >= 5: + for _ in range(3): + rt60.append(rt60Value[bitstrm.read(5).uint]) + dsr.append(dsrValue[bitstrm.read(6).uint]) + if piSize == 8: + for _ in range(3): + dim.append(roomDimensionValue[bitstrm.read(4).uint]) + for _ in range(6): + absCoeff.append(absorptionCoeffValues[bitstrm.read(2).uint]) + + return ACOUSTIC_ENVIRONMENT( + aeid=aeid, + rt60=tuple(rt60), + dsr=tuple(dsr), + dim=tuple(dim), + abscoeff=tuple(absCoeff), + ) + + +def packAcousticEnv(bitstrm: BitStream, data: any): + assert ( + type(data) == ACOUSTIC_ENVIRONMENT + ), "Diegetic type PI Data expects a data of type ACOUSTIC_ENVIRONMENT" + aenv = cast(ACOUSTIC_ENVIRONMENT, data) + if not aenv.rt60 and not aenv.dsr: + bitstrm.append(f"uint:8={aenv.aeid % 128}") + else: + assert ( + len(aenv.rt60) == 3 and len(aenv.dsr) == 3 + ), "Lo, Mi, Hi only required for RT60 and DSR values" + bitstrm.append(f"uint:7={aenv.aeid % 128}") + for n in range(3): + rt60 = mapNearestIndex(rt60Value, aenv.rt60[n]) + dsr = mapNearestIndex(dsrValue, aenv.dsr[n]) + bitstrm.append(f"uint:5={rt60}") + bitstrm.append(f"uint:6={dsr}") + if aenv.abscoeff and aenv.dim: + assert len(aenv.abscoeff) == 6 and len(aenv.dim) == 3 + for n in range(3): + dim = mapNearestIndex(roomDimensionValue, aenv.dim[n]) + bitstrm.append(f"uint:4={dim}") + for n in range(6): + absCoeff = mapNearestIndex(absorptionCoeffValues, aenv.abscoeff[n]) + bitstrm.append(f"uint:2={absCoeff}") + + +def unpackAudioFocus(bitstrm: ConstBitStream, piSize: int) -> AUDIO_FOCUS: + assert ( + piSize == 1 or piSize == 8 or piSize == 9 + ), "Incorrect PI Data Size for AUDIO_FOCUS" + direction = None + level = None + if piSize == 1: + level = bitstrm.read(4).uint + _ = bitstrm.read(4) + else: + direction = unpackOrientation(bitstrm, 8) + if piSize == 9: + level = bitstrm.read(4).uint + _ = bitstrm.read(4) + + return AUDIO_FOCUS(direction=direction, level=level) + + +def packAudioFocus(bitstrm: BitStream, data: any): + assert ( + type(data) == AUDIO_FOCUS + ), "Audio focus PI Data expects a data of type AUDIO_FOCUS" + auFocus = cast(AUDIO_FOCUS, data) + if auFocus.direction is not None: + packOrientations(bitstrm, [auFocus.direction]) + if auFocus.level is not None: + level = int(auFocus.level) + bitstrm.append(f"uint:4={level}") + bitstrm.append(f"uint:4=0") + + +PIDataUnpacker = [ + unpackOrientation, # SCENE_ORIENTATION, + unpackOrientation, # DEVICE_ORIENTATION_COMPENSATED, + unpackOrientation, # DEVICE_ORIENTATION_UNCOMPENSATED + unpackAcousticEnv, # ACOUSTIC_ENVIRONMENT + unpackAudioDescription, # AUDIO_DESCRIPTION + unpackUnsupported, # ISM_NUM + unpackUnsupported, # ISM_ID + unpackUnsupported, # ISM_GAIN + unpackOrientations, # ISM_ORIENTATION + unpackPositions, # ISM_POSITION + unpackUnsupported, # ISM_DISTANCE_ATTENUATION + unpackUnsupported, # ISM_DIRECTIVITY + unpackDiegetic, # DIEGETIC_TYPE + unpackDAS, # DYNAMIC_AUDIO_SUPPRESSION_INDICATION + unpackAudioFocus, # AUDIO_FOCUS_INDICATION + unpackUnsupported, # RESERVED15 + unpackOrientation, # PLAYBACK_DEVICE_ORIENTATION + unpackOrientation, # HEAD_ORIENTATION + unpackPosition, # LISTENER_POSITION + unpackDAS, # DYNAMIC_AUDIO_SUPPRESSION_REQUEST + unpackAudioFocus, # AUDIO_FOCUS_REQUEST + unpackUnsupported, # PI_LATENCY + unpackUnsupported, # R_ISM_ID + unpackUnsupported, # R_ISM_GAIN + unpackOrientation, # R_ISM_ORIENTATION + unpackPosition, # R_ISM_POSITION + unpackUnsupported, # R_ISM_DIRECTION + unpackUnsupported, # RESERVED27 + unpackUnsupported, # RESERVED28 + unpackUnsupported, # RESERVED29 + unpackUnsupported, # RESERVED30 + unpackNoPiData, # NO_DATA +] + +PIDataPacker = [ + packOrientation, # SCENE_ORIENTATION, + packOrientation, # DEVICE_ORIENTATION_COMPENSATED, + packOrientation, # DEVICE_ORIENTATION_UNCOMPENSATED + packAcousticEnv, # ACOUSTIC_ENVIRONMENT + packAudioDescription, # AUDIO_DESCRIPTION + packUnsupported, # ISM_NUM + packUnsupported, # ISM_ID + packUnsupported, # ISM_GAIN + packOrientations, # ISM_ORIENTATION + packPositions, # ISM_POSITION + packUnsupported, # ISM_DISTANCE_ATTENUATION + packUnsupported, # ISM_DIRECTIVITY + packDiegetic, # DIEGETIC_TYPE + packDAS, # DYNAMIC_AUDIO_SUPPRESSION_INDICATION + packAudioFocus, # AUDIO_FOCUS_INDICATION + packUnsupported, # RESERVED15 + packOrientation, # PLAYBACK_DEVICE_ORIENTATION + packOrientation, # HEAD_ORIENTATION + packPosition, # LISTENER_POSITION + packDAS, # DYNAMIC_AUDIO_SUPPRESSION_REQUEST + packAudioFocus, # AUDIO_FOCUS_DIRECTION + packUnsupported, # PI_LATENCY + packUnsupported, # R_ISM_ID + packUnsupported, # R_ISM_GAIN + packOrientation, # R_ISM_ORIENTATION + packPosition, # R_ISM_POSITION + packUnsupported, # R_ISM_DIRECTION + packUnsupported, # RESERVED27 + packUnsupported, # RESERVED28 + packUnsupported, # RESERVED29 + packUnsupported, # RESERVED30 + packNoPiData, # NO_DATA +] + + +def ReadG192Bitstream(g192File: Path) -> list[bytes]: + refPackets = list[bytes]() + with open(g192File, "rb") as fd: + refBitStrm = ConstBitStream(fd.read()) + while refBitStrm.pos < refBitStrm.len: + sync = hex(refBitStrm.read(16).intle) + nBits = refBitStrm.read(16).intle + assert sync == "0x6b21", "G192 syncword not found at start of packet" + writer = BitStream() + for _ in range(nBits): + bit = "0b1" if refBitStrm.read(16).uintle == 129 else "0b0" + writer.append(bit) + refPackets.append(writer.tobytes()) + return refPackets + + +def unpackEBytes(bitstrm: ConstBitStream) -> tuple[bool, dict]: + piIndicated = False + requests = dict() + try: + if bitstrm.read(1).bool: + T = bitstrm.read(3).uint + BR = bitstrm.read(4).uint + if T in [5, 6]: # CA MODES + if BR < 8: + requests[REQUESTS.CODEC] = cmrLookup[T].codec + requests[REQUESTS.BR] = 13200 + requests[REQUESTS.CA] = BR + requests[REQUESTS.BW] = cmrLookup[T].bandwidth + else: + raise Exception("Unsupported BR bits in CA Mode") + elif T == 7: # IVAS + if BR < 14: + requests[REQUESTS.CODEC] = cmrLookup[T].codec + requests[REQUESTS.BR] = cmrLookup[T].bitrates[BR] + requests[REQUESTS.CA] = -1 + elif BR == 14: + raise Exception("Reserved BR idx in IVAS EByte") + else: + if BR >= cmrLookup[T].startIdx and BR < cmrLookup[T].endIdx: + requests[REQUESTS.CODEC] = cmrLookup[T].codec + requests[REQUESTS.BR] = cmrLookup[T].bitrates[BR] + requests[REQUESTS.CA] = -1 + requests[REQUESTS.BW] = cmrLookup[T].bandwidth + else: + raise Exception( + "Reserved BR idx in {} EByte".format(cmrLookup[T].codec) + ) + # Try to get all subsequent E-bytes + while bitstrm.read(1).bool: + ET = bitstrm.read(3).uint + if ET == 0: + supportedBW = [ + BANDWIDTH.WB, + BANDWIDTH.SWB, + BANDWIDTH.FB, + BANDWIDTH.NREQ, + ] + reserved = bitstrm.read(2) + BW = bitstrm.read(2).uint + requests[REQUESTS.BW] = supportedBW[BW] + elif ET == 1: + S = bitstrm.read(1).bool + FMT = bitstrm.read(3).uint + if not S: + requests[REQUESTS.FMT] = codedFormats[FMT] + requests[REQUESTS.SUBFMT] = NO_REQ + else: + reserved = bitstrm.read(2) + subFMT = bitstrm.read(6).uint + requests[REQUESTS.FMT] = NO_REQ + requests[REQUESTS.SUBFMT] = codedSubFormats[subFMT] + elif ET == 2: + reserved = bitstrm.read(4) + piIndicated = True + elif ET == 3: + D = bitstrm.read(1).bool + Y = bitstrm.read(1).bool + P = bitstrm.read(1).bool + R = bitstrm.read(1).bool + requests[REQUESTS.SRCFG] = SRCONFIG( + diegetic=D, yaw=Y, pitch=P, roll=R + ) + else: + reserved = bitstrm.read(4) + raise Exception( + "Unsupported subsequent EByte with ET={}".format(ET) + ) + except ReadError as error: + print("Underflow in E-Bytes parsing during unpacking, error = {}".format(error)) + return piIndicated, requests + + +def packEBytes(bitstrm: BitStream, requests: dict[str:any], piIndication: bool = False): + codec = requests[REQUESTS.CODEC] if REQUESTS.CODEC in requests.keys() else NO_REQ + bitrate = requests[REQUESTS.BR] if REQUESTS.BR in requests.keys() else 0 + bandwidth = requests[REQUESTS.BW] if REQUESTS.BW in requests.keys() else NO_REQ + camode = requests[REQUESTS.CA] if REQUESTS.CA in requests.keys() else NO_REQ + format = requests[REQUESTS.FMT] if REQUESTS.FMT in requests.keys() else NO_REQ + subFormat = ( + requests[REQUESTS.SUBFMT] if REQUESTS.SUBFMT in requests.keys() else NO_REQ + ) + srcfg = ( + SRCONFIG(requests[REQUESTS.SRCFG]) + if REQUESTS.SRCFG in requests.keys() + else None + ) + + # Check if any request needs to be sent + isInitialEByteNeeded = ( + piIndication + or bitrate != 0 + or bandwidth != NO_REQ + or camode != NO_REQ + or format != NO_REQ + or subFormat != NO_REQ + or srcfg != None + ) + + if not isInitialEByteNeeded: + return + + if camode != NO_REQ: + T = 6 if bandwidth == BANDWIDTH.SWB else 5 + BR = getListIndex(list(CAMODE), camode) + assert BR > 0, "Channel Aware Mode not supported" + elif bitrate == 0: + T = 7 + BR = 15 + else: + mapBandwidthToTBit = { + BANDWIDTH.NB: 0, + BANDWIDTH.WB: 2, + BANDWIDTH.SWB: 3, + BANDWIDTH.FB: 4, + NO_REQ: 2, + }[bandwidth] + T = {CODECS.AMRWB: 1, CODECS.IVAS: 7, CODECS.EVS: mapBandwidthToTBit}[codec] + BR = getListIndex(requestBitratesForCodec[codec], bitrate) + assert ( + BR >= cmrLookup[T].startIdx and BR < cmrLookup[T].endIdx + ), "EVS Bitrate Index and Bandwidth Combination cannot be requested" + + # Write the Initial E-Byte + bitstrm.append(f"bool={True}") # E-Byte H=1 + bitstrm.append(f"uint:3={T}") + bitstrm.append(f"uint:4={BR}") + + # Subsequent E-bytes follow + if piIndication: + bitstrm.append("hex:8=A0") + + if codec != CODECS.IVAS: + return + + # Bandwidth E-Byte + if bandwidth != NO_REQ: + bw = {BANDWIDTH.WB: 0, BANDWIDTH.SWB: 1, BANDWIDTH.FB: 2}[bandwidth] + bitstrm.append("hex:4=8") + bitstrm.append(f"uint:4={bw}") + + # Coded Format/SubFormat Request E-Byte + if subFormat in SUBFORMATS: + subFmt = getListIndex(codedSubFormats, subFormat) + bitstrm.append("hex:8=9F") # S=0, FMT=111 + bitstrm.append(f"uint:8={subFmt}") + elif format in FORMATS: + fmt = getListIndex(codedFormats, format) + bitstrm.append("hex:4=9") + bitstrm.append(f"bool={False}") # S=0 + bitstrm.append(f"uint:3={fmt}") + + # SR Config E-Byte + with srcfg: + bitstrm.append("hex:4=B") + bitstrm.append(f"bool={srcfg.diegetic}") + bitstrm.append(f"bool={srcfg.yaw}") + bitstrm.append(f"bool={srcfg.pitch}") + bitstrm.append(f"bool={srcfg.roll}") + + +def unpackAUFrames(bitstrm: ConstBitStream, frameList: list[FRAME]): + try: + # Unpack Frame AUs here + for idx, frm in enumerate(frameList): + auSize = (frm.frmSizeBits + 7) // 8 # Zero padded bytes in amrwb_io mode + frm.au = bitstrm.read(auSize * 8).tobytes() + except ReadError as error: + print( + "Underflow in AU Frames parsing during unpacking, error = {}".format(error) + ) + + +def packAUFrames(bitstrm: BitStream, frameList: list[FRAME]): + for frm in frameList: + bitstrm.append(frm.au) + bitstrm.bytealign() + + +def unpackToCBytes( + bitstrm: ConstBitStream, rtpTimestamp: int, Codec: CODECS +) -> list[FRAME]: + F = True + frmList = list() + + try: + while F: + F = bitstrm.read(1).bool + FT = bitstrm.read(2).uint + BR = bitstrm.read(4).uint + frm = FRAME(timestamp=rtpTimestamp) + if FT == 1: + frm.codec = CODECS.IVAS + if BR == 14: + supportedBitrates = [-1, 256000, 384000, 512000] + reserved = bitstrm.read(1) + D = bitstrm.read(1).bool + C = bitstrm.read(1).bool + SR_BR = bitstrm.read(2).uint + reserved = bitstrm.read(3) + if SR_BR == 0: + raise Exception("Reserved bitrate in SR Config ToC Indicated") + frm.srInfo = SRINFO( + bitrate=supportedBitrates[SR_BR], + diegetic=D, + transportCodec=SRCODEC.LC3PLUS if C else SRCODEC.LCLD, + ) + else: + frm.bitrate = ivasBitrates[BR] + elif FT == 0: + # Codec switch only if not NO_DATA_FRAME, as IVAS/EVS signal using this + frm.codec = CODECS.EVS if BR != 15 else Codec + if BR == 13: + raise Exception("Reserved bitrate in EVS ToC Indicated") + frm.speechLost = BR == 14 + frm.bitrate = evsBitrates[BR] if BR < 13 else 0 + else: + frm.codec = CODECS.AMRWB + if BR >= 10 and BR <= 13: + raise Exception("Reserved bitrate in AMRWB-IO ToC Indicated") + frm.speechLost = (BR == 14) or (FT == 2) + frm.bitrate = amrwbBitrates[BR] if BR < 10 else 0 + frm.frmSizeBits = frm.bitrate // 50 + rtpTimestamp += 320 + frmList.append(frm) + if F: + # skip all frame specific E-bytes before next header + while bitstrm.read(1).bool: + print("Skipping unsupported frame specific subsequent Ebytes") + reserved = bitstrm.read(7) + except ReadError as error: + print("Underflow in ToC parsing during unpacking, error = {}".format(error)) + + return frmList + + +def packToCBytes(bitstrm: BitStream, frameList: list[FRAME]): + numFrames = len(frameList) + + for idx, frame in enumerate(frameList): + F = idx != (numFrames - 1) + FT = 0 + BR = 0 + if frame.frmSizeBits == 0: + FT = ( + 3 if frame.codec == CODECS.AMRWB else 0 + ) # Only AMRWB or EVS support 0 frame case + BR = 14 if frame.speechLost else 15 # SPEECH_LOST or NO_DATA + elif frame.codec == CODECS.AMRWB: + FT = 3 + BR = getListIndex(amrwbBitrates[0:10], frame.bitrate) + elif frame.codec == CODECS.IVAS: + FT = 1 + BR = 14 if frame.srInfo else getListIndex(ivasBitrates, frame.bitrate) + else: + FT = 0 + BR = getListIndex(evsBitrates[0:13], frame.bitrate) + + assert BR >= 0, "Index for table not found" + + bitstrm.append(f"bool={False}") # ToC 0 bit + bitstrm.append(f"bool={F}") # Frame follows bit + bitstrm.append(f"uint:2={FT}") # Frame Type + bitstrm.append(f"uint:4={BR}") # Frame Type + if frame.srInfo and frame.codec == CODECS.IVAS: + SRBR = (frame.srInfo.bitrate // 128000) - 1 + bitstrm.append(f"bool={False}") # ToC 0 bit + bitstrm.append(f"bool={frame.srInfo.diegetic}") + bitstrm.append(f"bool={frame.srInfo.transportCodec == SRCODEC.LC3PLUS}") + bitstrm.append(f"uint:2={SRBR}") + bitstrm.append("uint:3=0") + + +def unpackPiData(bitstrm: ConstBitStream, rtpTimestamp: int) -> list[PIDATA]: + piDataList = list[PIDATA]() + try: + # PI Data if Indicated + PF = True + piTimeStamps = rtpTimestamp + while PF: + PF = bitstrm.read(1).bool + PM = bitstrm.read(2).uint + PiType = bitstrm.read(5).uint + PiSize = 0 + byte = 255 + while byte == 255: + byte = bitstrm.read(8).uint + PiSize += byte + + PiFrameData = PIDataUnpacker[PiType](bitstrm, PiSize) + + if PiTypeNames[PiType] != PIDATAS.NO_PI_DATA: + piDataList.append( + PIDATA( + timestamp=( + piTimeStamps if PM != 3 else rtpTimestamp + ), # Generic Pi has base timestamp + type=PiTypeNames[PiType], + data=PiFrameData, + ) + ) + piTimeStamps += 320 if PM == 2 else 0 + except ReadError as error: + print("Underflow before completion of unpacking, error = {}".format(error)) + return piDataList + + +def packPiData( + bitstrm: BitStream, rtpTimestampBounds: tuple[int, int], piDataList: list[PIDATA] +): + # sort the piDataList by timestamp and eliminate data where timestamp is OOB for this packet + piDataList = [ + data + for data in piDataList + if ( + data.timestamp >= rtpTimestampBounds[0] + and data.timestamp < rtpTimestampBounds[1] + ) + ] + sorted(piDataList, key=lambda data: data.timestamp) + numPiData = len(piDataList) + + # Group PI data by timestamps + piDataDict = dict[int, list[PIDATA]]() + for data in piDataList: + ts = (data.timestamp // 320) * 320 + if ts not in piDataDict.keys(): + piDataDict[ts] = list() + piDataDict[ts].append(data) + + curTimestamp = rtpTimestampBounds[0] + for ts, dataList in piDataDict.items(): + while curTimestamp < ts: + # Inset NO_PI_DATA till current Timestamp is reached + bitstrm.append( + "hex:16=DF00" + ) # PI Frame follows, Last PI header for this frame, NO_PI_DATA, size=0 + curTimestamp += 320 + + for idx, data in enumerate(dataList): + pack = BitStream() + PM = 2 if idx == len(dataList) - 1 else 1 + PF = 0 if numPiData == 1 else 1 + TYPE = PiTypeNames.index(data.type) + PIDataPacker[TYPE](pack, data.data) + assert (pack.pos % 8) == 0, "PI data must be byte aligned" + SIZE = pack.pos // 8 + assert ( + SIZE < MAX_PACKED_PI_SIZE + ), f"Packed PI Size should be less than MAX_PACKED_PI_SIZE ({MAX_PACKED_PI_SIZE})" + + bitstrm.append(f"uint:1={PF}") + bitstrm.append(f"uint:2={PM}") + bitstrm.append(f"uint:5={TYPE}") + bitstrm.append(f"uint:8={SIZE}") + bitstrm.append(pack) + numPiData -= 1 + curTimestamp += 320 + assert numPiData == 0, "Not all PI data was packed due to internal error" + + +@dataclass +class IvasPayload: + frameList: list[FRAME] = field(default_factory=list) + piDataList: list[PIDATA] = field(default_factory=list) + requests: dict[str, any] = field(default_factory=dict) + + def pack(self, bitstrm: BitStream) -> int: + piIndication = len(self.piDataList) > 0 + numFrames = len(self.frameList) + packEBytes(bitstrm, self.requests, piIndication) + packToCBytes(bitstrm, self.frameList) + packAUFrames(bitstrm, self.frameList) + if piIndication: + packPiData( + bitstrm, + (self.frameList[0].timestamp, self.frameList[-1].timestamp + 320), + self.piDataList, + ) + return numFrames + + @classmethod + def unpack(cls, bitstrm: ConstBitStream, rtpTimestamp: int, Codec: CODECS): + # Unpack the E-bytes + piIndicated, requests = unpackEBytes(bitstrm) + + # ToC Byte parsing starts with 'F' bit as H bit is already read for E-byte parsing + frameList = unpackToCBytes(bitstrm, rtpTimestamp, Codec) + + # Extract packed AU + unpackAUFrames(bitstrm, frameList) + + if piIndicated: + piDataList = unpackPiData(bitstrm, rtpTimestamp) + else: + piDataList = list() + + return cls(frameList=frameList, piDataList=piDataList, requests=requests) + + +@dataclass +class IvasPacket: + hdr: RTPHDR = field(default_factory=RTPHDR) + payload: IvasPayload = field(default_factory=IvasPayload) + + def pack(self, bitstrm: BitStream): + self.hdr.pack(bitstrm) + numFrames = self.payload.pack(bitstrm) + self.hdr.updateHeader(numFrames) + + +class IvasRtp: + def __init__(self, numFramesPerPacket=4, codec: CODECS = CODECS.IVAS): + self.numFramesPerPacket = numFramesPerPacket + self.packets = list[IvasPacket]() + self.Codec: CODECS = codec # Track last frame's codec + self.requests = dict() + self.piData = dict() + + def dumpToJSON(self, jsonFileName): + with open(jsonFileName, "w") as fd: + packets = list() + for packet in self.packets: + packetDict = asdict(packet) + for frame in packetDict["payload"]["frameList"]: + frame["au"] = base64.b64encode(frame["au"]).decode("utf-8") + packets.append(packetDict) + json_output = json.dumps(packets, indent=4) + fd.write(json_output) + + def requestReader(self, timestamp: int) -> dict[str, any]: + tsList = sorted(self.requests.keys()) + if len(tsList) > 0: + lastTs = int(tsList[0]) + for ts in tsList: + if timestamp >= lastTs and timestamp < int(ts): + return self.requests[str(lastTs)] + lastTs = int(ts) + return dict() + + def piDataReader(self, startTimestamp: int, endTimestamp: int) -> list[PIDATA]: + + piDataList = list() + while startTimestamp < endTimestamp: + ts = str(startTimestamp) + if ts in self.piData.keys(): + for piTypes in self.piData[ts].keys(): + dataDict = self.piData[ts][piTypes] + if type(dataDict) != dict: + data = dataDict + elif piTypes == PIDATAS.ISM_ORIENTATION: + data = list() + for orientation in dataDict: + data.append(ORIENTATION(**orientation)) + elif "ORIENTATION" in piTypes: + data = ORIENTATION(**dataDict) + elif piTypes == PIDATAS.ACOUSTIC_ENVIRONMENT: + data = ACOUSTIC_ENVIRONMENT(**dataDict) + elif piTypes == PIDATAS.AUDIO_DESCRIPTION: + data = list() + for desc in dataDict: + data.append(AUDIO_DESCRIPTION(**desc)) + elif piTypes == PIDATAS.DIEGETIC_TYPE: + data = DIEGETIC_TYPE(**dataDict) + elif ( + piTypes == PIDATAS.LISTENER_POSITION + or piTypes == PIDATAS.R_ISM_POSITION + ): + data = POSITION(**dataDict) + elif "DYNAMIC_AUDIO_SUPPRESSION" in piTypes: + data = DYNAMIC_AUDIO_SUPPRESSION(**dataDict) + elif "AUDIO_FOCUS" in piTypes: + data = AUDIO_FOCUS(**dataDict) + else: + assert False, "Unhandled PI Data" + piDataList.append( + PIDATA(timestamp=startTimestamp, type=piTypes, data=data) + ) + startTimestamp += 320 + return piDataList + + def packG192File( + self, + g192File: Path, + rtpDumpOut: Path, + piData: dict = None, + requestsData: dict = None, + ): + packet = IvasPacket() + packet.hdr.sequenceNum = int("0xFFFF", 16) + packet.hdr.timestamp = 0 + packet.hdr.ssrc = int("0xDEADBEEF", 16) + + self.piData = piData + self.requests = requestsData + + timestamp = packet.hdr.timestamp + piTimestamps = 0 + with open(g192File, "rb") as fin: + with open(rtpDumpOut, "wb") as fout: + refBitStrm = ConstBitStream(fin.read()) + frames = list[FRAME]() + while refBitStrm.pos < refBitStrm.len: + sync = hex(refBitStrm.read(16).intle) + nBits = refBitStrm.read(16).intle + assert ( + sync == "0x6b21" + ), "G192 syncword not found at start of packet" + writer = BitStream() + for _ in range(nBits): + bit = "0b1" if refBitStrm.read(16).uintle == 129 else "0b0" + writer.append(bit) + frames.append( + FRAME( + codec=self.Codec, + frmSizeBits=nBits, + bitrate=nBits * 50, + speechLost=False, + timestamp=timestamp, + au=writer.tobytes(), + ) + ) + if (len(frames) == self.numFramesPerPacket) or ( + refBitStrm.pos == refBitStrm.len + ): + rtpBitstrm = BitStream() + numFrames = len(frames) + packet.payload = IvasPayload( + frameList=frames, + piDataList=self.piDataReader( + piTimestamps, piTimestamps + (numFrames * 320) + ), + requests=self.requestReader(piTimestamps), + ) + packet.pack(bitstrm=rtpBitstrm) + fout.write(struct.pack("i", rtpBitstrm.bytepos)) + fout.write(rtpBitstrm.tobytes()) + frames = list() + piTimestamps += numFrames * 320 + timestamp += 320 + + def getPackets(self): + return self.packets + + def unpackFile(self, rtpDumpFile): + with open(rtpDumpFile, mode="rb") as fd: + while True: + size = fd.read(4) + if not size: + break + size = struct.unpack("i", size)[0] + packet = fd.read(size) + if not packet: + break + self.packets.append(self.unpackPacket(packet)) + + def unpackPacket(self, packet) -> IvasPacket: + bitStrm = ConstBitStream(packet) + hdr = RTPHDR.unpack(bitStrm) + payload = IvasPayload.unpack( + bitStrm, rtpTimestamp=hdr.timestamp, Codec=self.Codec + ) + self.Codec = payload.frameList[ + -1 + ].codec # Last Frame's codec for next frame for NO_DATA case + return IvasPacket(hdr=hdr, payload=payload) + + +class ArgsParser: + def __init__(self): + self.parser = argparse.ArgumentParser() + self.parser.add_argument( + "-r", "--rtpdump", type=str, default=None, help="RTP Dump to unpack" + ) + self.parser.add_argument( + "-j", + "--json", + type=str, + default="unpack.json", + help="Output unpacked RTP frames to JSON file", + ) + self.parser.add_argument( + "-g", + "--g192", + type=str, + default=None, + help="G192 bitstream input for RTP Packing", + ) + self.parser.add_argument( + "-f", + "--framesPerPacket", + type=int, + default=1, + help="Number of IVAS frames per RTP Packet", + ) + self.parser.add_argument( + "-o", + "--outrtpdump", + type=str, + default="output.rtpdump", + help="Output RTP Dump file", + ) + self.parser.add_argument( + "-p", "--piDataJson", type=str, default=None, help="piData to be packed" + ) + self.parser.add_argument( + "-x", "--requestsJson", type=str, default=None, help="Requests to be packed" + ) + + def parse(self): + args = self.parser.parse_args() + return args + + +if __name__ == "__main__": + args = ArgsParser().parse() + rtp = IvasRtp(numFramesPerPacket=args.framesPerPacket) + + if args.rtpdump: + rtp.unpackFile(args.rtpdump) + rtp.dumpToJSON(args.json) + elif args.g192: + piData = dict() + requestsData = dict() + if args.piDataJson: + with open(args.piDataJson) as f: + piData = json.load(f) + if args.requestsJson: + with open(args.requestsJson) as f: + requestsData = json.load(f) + rtp.packG192File( + g192File=args.g192, + rtpDumpOut=args.outrtpdump, + piData=piData, + requestsData=requestsData, + ) diff --git a/tests/rtp/test_rtp.py b/tests/rtp/test_rtp.py new file mode 100644 index 0000000000000000000000000000000000000000..44d08a91e16033ddae42c6859ce5858052535df1 --- /dev/null +++ b/tests/rtp/test_rtp.py @@ -0,0 +1,665 @@ +#!/usr/bin/env python3 + +__copyright__ = """ +(C) 2022-2025 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB, +Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., +Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, +Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other +contributors to this repository. All Rights Reserved. + +This software is protected by copyright law and by international treaties. +The IVAS codec Public Collaboration consisting of Dolby International AB, Ericsson AB, +Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., +Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, +Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other +contributors to this repository retain full ownership rights in their respective contributions in +the software. This notice grants no license of any kind, including but not limited to patent +license, nor is any license granted by implication, estoppel or otherwise. + +Contributors are required to enter into the IVAS codec Public Collaboration agreement before making +contributions. + +This software is provided "AS IS", without any express or implied warranties. The software is in the +development stage. It is intended exclusively for experts who have experience with such software and +solely for the purpose of inspection. All implied warranties of non-infringement, merchantability +and fitness for a particular purpose are hereby disclaimed and excluded. + +Any dispute, controversy or claim arising under or in relation to providing this software shall be +submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in +accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and +the United Nations Convention on Contracts on the International Sales of Goods. +""" + +__doc__ = """ +This test does the following procedure:- + +DECODER TEST +============ +* Encode a input for given format, bitrate and dtx info using IVAS Encoder to g192 +* Generate random PI data to be used for RTP packaging +* Use g192 and random PI data to pack a stream into RTPDump stream using the reference rtp packer implementation in python +* Provide the rtpdump stream to IVAS decoder to decode the stream and generate a PI data dump in a JSON file +* Decode G192 stream using IVAS decoder and compare against output of RTPdump for bit-exactness +* Validate dumped JSON agains original random PI data to check for similar data after deocde + +ENCODER TEST +============ +* Encode the input for given format, bitrate and dtx info using IVAS Encoder to rtpdump directly +* Validate the generated rtp dump using reference python implementation of RTP depacker for following:- + * RTP Header consistency (Timestamp, seq number, etc) + * IVAS Payload (no of frames in packet, bitrate indicated, bitexactness of frames in packet) + * PI Data verification (Timestamp, Pidata Type, similarity of PI data) +""" + +import pytest +import csv +import os +import sys +import random + +from tempfile import TemporaryDirectory +from pathlib import Path +from ivasrtp import * +import numpy as np +from pyaudio3dtools.audiofile import readfile + +ROOT_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), "../..")) +sys.path.append(ROOT_DIR) + +from tests.conftest import EncoderFrontend, DecoderFrontend + + +@pytest.mark.parametrize("dtx", [False, True]) +@pytest.mark.parametrize("bitrate", [6600, 12650, 23850]) +@pytest.mark.parametrize("framesPerPacket", [1, 3, 8]) +def test_rtp_bitstream_amrwb( + test_info, + bitrate: int, + dtx: bool, + framesPerPacket: int, + dut_encoder_frontend: EncoderFrontend, + dut_decoder_frontend: DecoderFrontend, +): + run_rtp_bitstream_tests( + CODECS.AMRWB, + bitrate, + "WB", + "OFF", + "MONO", + dtx, + framesPerPacket, + dut_encoder_frontend, + dut_decoder_frontend, + ) + + +@pytest.mark.parametrize("dtx", [False, True]) +@pytest.mark.parametrize("bitrate", [24400, 48000]) +@pytest.mark.parametrize("bandwidth", ["WB", "SWB", "FB"]) +@pytest.mark.parametrize("caMode", ["OFF", "LO", "HI"]) +@pytest.mark.parametrize("framesPerPacket", [3]) +def test_rtp_bitstream_evs( + test_info, + bitrate: int, + bandwidth: str, + caMode: str, + dtx: bool, + framesPerPacket: int, + dut_encoder_frontend: EncoderFrontend, + dut_decoder_frontend: DecoderFrontend, +): + run_rtp_bitstream_tests( + CODECS.EVS, + bitrate, + bandwidth, + caMode, + "MONO", + dtx, + framesPerPacket, + dut_encoder_frontend, + dut_decoder_frontend, + ) + + +@pytest.mark.parametrize("bitrate", [16400, 32000, 48000]) +@pytest.mark.parametrize("bandwidth", ["WB", "SWB", "FB"]) +@pytest.mark.parametrize("format", ["STEREO", "SBA", "MC", "MASA"]) +@pytest.mark.parametrize("framesPerPacket", [8]) +def test_rtp_bitstream_ivas_nodtx( + test_info, + bitrate: int, + bandwidth: str, + format: str, + framesPerPacket: int, + dut_encoder_frontend: EncoderFrontend, + dut_decoder_frontend: DecoderFrontend, +): + run_rtp_bitstream_tests( + CODECS.IVAS, + bitrate, + bandwidth, + "OFF", + format, + False, + framesPerPacket, + dut_encoder_frontend, + dut_decoder_frontend, + ) + + +@pytest.mark.parametrize("bitrate", [13200, 24400, 64000]) +@pytest.mark.parametrize("bandwidth", ["WB", "SWB", "FB"]) +@pytest.mark.parametrize("format", ["STEREO", "SBA"]) +@pytest.mark.parametrize("framesPerPacket", [1, 3]) +def test_rtp_bitstream_ivas_dtx( + test_info, + bitrate: int, + bandwidth: str, + format: str, + framesPerPacket: int, + dut_encoder_frontend: EncoderFrontend, + dut_decoder_frontend: DecoderFrontend, +): + run_rtp_bitstream_tests( + CODECS.IVAS, + bitrate, + bandwidth, + "OFF", + format, + True, + framesPerPacket, + dut_encoder_frontend, + dut_decoder_frontend, + ) + + +def generateRequests(startTs: int, endTs: int) -> dict: + requests = dict() + return requests + + +def generatePiData(startTs: int, endTs: int) -> dict: + data = dict() + + someOrientation = lambda: ORIENTATION( + w=2 * random.random() - 1.0, + x=2 * random.random() - 1.0, + y=2 * random.random() - 1.0, + z=2 * random.random() - 1.0, + ) + somePosition = lambda: POSITION( + x=random.randint(-32788, 32767) / 100.0, + y=random.randint(-32788, 32767) / 100.0, + z=random.randint(-32788, 32767) / 100.0, + ) + someDesc = lambda: AUDIO_DESCRIPTION( + isSpeech=bool(random.getrandbits(1)), + isMusic=bool(random.getrandbits(1)), + isAmbiance=bool(random.getrandbits(1)), + isEditable=bool(random.getrandbits(1)), + isBinaural=bool(random.getrandbits(1)), + ) + someDAS = lambda: DYNAMIC_AUDIO_SUPPRESSION( + preferSpeech=bool(random.getrandbits(1)), + preferMusic=bool(random.getrandbits(1)), + preferAmbiance=bool(random.getrandbits(1)), + level=random.randint(0, 15), + ) + someDIG = lambda: DIEGETIC_TYPE( + isDigetic=[bool(random.getrandbits(1)) for _ in range(random.randint(1, 5))] + ) + someAuFocusDirLvl = lambda: AUDIO_FOCUS( + ORIENTATION( + w=2 * random.random() - 1.0, + x=2 * random.random() - 1.0, + y=2 * random.random() - 1.0, + z=2 * random.random() - 1.0, + ), + level=AUDIO_FOCUS_LEVEL(random.randint(0, 15)), + ) + someAuFocusDir = lambda: AUDIO_FOCUS( + ORIENTATION( + w=2 * random.random() - 1.0, + x=2 * random.random() - 1.0, + y=2 * random.random() - 1.0, + z=2 * random.random() - 1.0, + ) + ) + someAuFocusLvl = lambda: AUDIO_FOCUS(level=AUDIO_FOCUS_LEVEL(random.randint(0, 15))) + someAuFocusList = [someAuFocusDirLvl, someAuFocusDir, someAuFocusLvl] + + for ts in range(startTs, endTs, 320): + pidata = dict() + pidata["SCENE_ORIENTATION"] = someOrientation() + pidata["DEVICE_ORIENTATION_COMPENSATED"] = someOrientation() + pidata["DEVICE_ORIENTATION_UNCOMPENSATED"] = someOrientation() + pidata["PLAYBACK_DEVICE_ORIENTATION"] = someOrientation() + pidata["HEAD_ORIENTATION"] = someOrientation() + pidata["AUDIO_FOCUS_REQUEST"] = random.choice(someAuFocusList)() + pidata["LISTENER_POSITION"] = somePosition() + pidata["DYNAMIC_AUDIO_SUPPRESSION_REQUEST"] = someDAS() + pidata["AUDIO_DESCRIPTION"] = [someDesc() for n in range(random.randint(1, 5))] + pidata["DIEGETIC_TYPE"] = someDIG() + pidata["ACOUSTIC_ENVIRONMENT"] = ACOUSTIC_ENVIRONMENT( + aeid=random.randint(0, 127) + ) + data[str(ts)] = pidata + return data + + +def isEqualFrame(refFrame: bytes, dutFrame: bytes): + assert len(refFrame) == len(dutFrame), "Encoded frame size is different" + for refByte, dutByte in zip(refFrame, dutFrame): + assert ( + refByte == dutByte + ), "Encoded frames should be bitexact between ref and rtpdump" + + +def isEqualOrientation(ref: ORIENTATION, dut: ORIENTATION): + assert abs(ref.w - dut.w) < 0.0001, "Scene Orientation PI Data mismatch in w" + assert abs(ref.x - dut.x) < 0.0001, "Scene Orientation PI Data mismatch in x" + assert abs(ref.y - dut.y) < 0.0001, "Scene Orientation PI Data mismatch in y" + assert abs(ref.z - dut.z) < 0.0001, "Scene Orientation PI Data mismatch in z" + + +def isEqualPosition(ref: POSITION, dut: POSITION): + assert abs(ref.x - dut.x) < 0.3, "Position PI Data mismatch in x" + assert abs(ref.y - dut.y) < 0.3, "Position PI Data mismatch in y" + assert abs(ref.z - dut.z) < 0.3, "Position PI Data mismatch in z" + + +def isEqualAD(ref: AUDIO_DESCRIPTION, dut: AUDIO_DESCRIPTION): + assert ( + ref.isSpeech == dut.isSpeech + ), "Audio Description PI Data mismatch in isSpeech" + assert ref.isMusic == dut.isMusic, "Audio Description PI Data mismatch in isMusic" + assert ( + ref.isAmbiance == dut.isAmbiance + ), "Audio Description PI Data mismatch in isAmbiance" + assert ( + ref.isEditable == dut.isEditable + ), "Audio Description PI Data mismatch in isEditable" + assert ( + ref.isBinaural == dut.isBinaural + ), "Audio Description PI Data mismatch in isBinaural" + + +def isEqualDAS(ref: DYNAMIC_AUDIO_SUPPRESSION, dut: DYNAMIC_AUDIO_SUPPRESSION): + assert ( + ref.preferSpeech == dut.preferSpeech + ), "Dynamic Audio Suppression PI Data mismatch in preferSpeech" + assert ( + ref.preferMusic == dut.preferMusic + ), "Dynamic Audio Suppression PI Data mismatch in preferMusic" + assert ( + ref.preferAmbiance == dut.preferAmbiance + ), "Dynamic Audio Suppression PI Data mismatch in preferAmbiance" + assert ref.level == dut.level, "Dynamic Audio Suppression PI Data mismatch in level" + + +def isEqualDiegetic(ref: DIEGETIC_TYPE, dut: DIEGETIC_TYPE): + for r, d in zip(ref.isDigetic, dut.isDigetic): + assert r == d, f"Diegetic PI Data mismatch {r} != {d}" + + +def isEqualAcousticEnv(ref: ACOUSTIC_ENVIRONMENT, dut: ACOUSTIC_ENVIRONMENT): + assert ref.aeid == dut.aeid, "Acoustic Env PI Data mismatch in Acoustic Identifier" + assert len(ref.rt60) == len(dut.rt60), "Acoustic Env PI Data mismatch in len(rt60)" + assert len(ref.dsr) == len(dut.dsr), "Acoustic Env PI Data mismatch in len(dsr)" + assert len(ref.dim) == len(dut.dim), "Acoustic Env PI Data mismatch in len(dim)" + assert len(ref.abscoeff) == len( + dut.abscoeff + ), "Acoustic Env PI Data mismatch in len(abscoeff)" + for r, d in zip(ref.rt60, dut.rt60): + assert r == d, f"Acoustic Env PI Data mismatch in rt60 {r} != {d}" + + +def isEqualAudioFocus(ref: AUDIO_FOCUS, dut: AUDIO_FOCUS): + if ref.direction is not None or dut.direction is not None: + assert ref.direction is not None, "Audio Focus PI Data missing direction" + assert dut.direction is not None, "Audio Focus PI Data missing direction" + if ref.direction is not None and dut.direction is not None: + assert ( + abs(ref.direction["w"] - dut.direction.w) < 0.0001 + ), "Audio Focus PI Data mismatch in direction w" + assert ( + abs(ref.direction["x"] - dut.direction.x) < 0.0001 + ), "Audio Focus PI Data mismatch in direction x" + assert ( + abs(ref.direction["y"] - dut.direction.y) < 0.0001 + ), "Audio Focus PI Data mismatch in direction y" + assert ( + abs(ref.direction["z"] - dut.direction.z) < 0.0001 + ), "Audio Focus PI Data mismatch in direction z" + assert ref.level == dut.level, "Audio Focus PI Data mismatch in level" + + +class CSVREADER: + def __init__(self, csvFile: Path): + self.rIdx = 0 + self.rows = [] + with open(csvFile, "r") as fd: + self.rows = [row for row in csv.reader(fd)] + self.count = len(self.rows) + + def next(self) -> list[float]: + row = self.rows[self.rIdx] + self.rIdx += 1 + if self.rIdx == self.count: + self.rIdx = 0 + return [float(x) for x in row] + + +class RTPVALIDATE: + + DTX_BITRATES = {CODECS.IVAS: 5200, CODECS.EVS: 2400, CODECS.AMRWB: 1750} + + def __init__(self, codec=CODECS.IVAS, bitrate=24400, framesPerPacket=1, dtx=False): + self.framesPerPacket = framesPerPacket + self.dtx = dtx + self.codec = codec + self.bitrate = bitrate + self.timestamp = 0 + self.seqnum = -1 + self.ssrc = -1 + self.numFrames = 0 + self.validatePiData = False + self.g192File = None + self.frameIdx = 0 + # PI DATA + self.readers: dict[str:CSVREADER] = dict() + + def setPiDataFiles(self, piFiles: tuple[Path]): + self.validatePiData = True + self.readers[PiTypeNames[0]] = CSVREADER(piFiles[0]) + self.readers[PiTypeNames[1]] = CSVREADER(piFiles[1]) + + def setRefG192Bitstream(self, g192File: Path): + self.refPackets = ReadG192Bitstream(g192File) + + def packet(self, packet: IvasPacket): + self.header(packet.hdr) + self.payload(packet.payload) + self.seqnum = (self.seqnum + 1) % 65536 + self.timestamp += 320 * self.numFrames + + def header(self, hdr: RTPHDR): + if self.timestamp == 0: + self.seqnum = hdr.sequenceNum + self.ssrc = hdr.ssrc + assert hdr.version == 2, "RTP Header Version must be 2" + assert self.ssrc == hdr.ssrc, "SSRC changed mid-stream in RTP Header" + assert self.timestamp == hdr.timestamp, "Timestamp mismatch in RTP Header" + assert self.seqnum == hdr.sequenceNum, "Sequence number mismatch in RTP Header" + + def payload(self, payload: IvasPayload): + self.numFrames = len(payload.frameList) + assert ( + self.numFrames >= 1 and self.numFrames <= self.framesPerPacket + ), f"Packet must have atleast 1 frame and atmost {self.framesPerPacket} frames" + + for frame in payload.frameList: + assert self.codec == frame.codec, "Codec mismatch in RTP Payload" + if self.dtx: + assert frame.bitrate in ( + self.bitrate, + RTPVALIDATE.DTX_BITRATES[self.codec], + 0, + ), "Bitrate mismatch in RTP Payload in DTX mode" + else: + assert frame.bitrate == self.bitrate, "Bitrate mismatch in RTP Payload" + + assert self.frameIdx < len(self.refPackets), "No. of frames mismatch" + isEqualFrame(frame.au, self.refPackets[self.frameIdx]) + self.frameIdx += 1 + + # Vallidate the PI Data + if self.validatePiData: + self.piData(payload.piDataList) + + def piData(self, piDataList: list[PIDATA]): + for piData in piDataList: + assert ( + piData.timestamp >= self.timestamp + and piData.timestamp < self.timestamp + (self.numFrames * 320) + ), "PI Data Time stamp is OOB" + assert ( + piData.type == PiTypeNames[0] or piData.type == PiTypeNames[1] + ), "PI Data is neither Scene nor Device Orientation" + assert type(piData.data) == ORIENTATION, "Orientation type data expected" + # validate the PI Data provided is the PI data in the packet + refData = self.readers[piData.type].next() + isEqualOrientation( + ORIENTATION(w=refData[0], x=refData[1], y=refData[2], z=refData[3]), + piData.data, + ) + + +@dataclass +class TVARGS: + TVROOT = Path(ROOT_DIR).joinpath("scripts/testv") + + def __init__(self): + self.tvDict = dict() + self.sceneFile = ( + Path(ROOT_DIR) + .joinpath("scripts/trajectories/azi_plus_2-ele_plus_2-every-25-rows.csv") + .absolute() + ) + self.deviceFile = ( + Path(ROOT_DIR).joinpath("scripts/trajectories/headrot-1.5s.csv").absolute() + ) + + def add(self, fmt: str, inputFile: str, args: list[str] = []): + inputFile = str(TVARGS.TVROOT.joinpath(inputFile).absolute()) + if fmt == "MASA": + args[2] = str(TVARGS.TVROOT.joinpath(args[2]).absolute()) + self.tvDict[fmt] = (inputFile, args) + + def input(self, fmt): + return self.tvDict[fmt][0] + + def args(self, fmt, addPI=False) -> list[str]: + args = [x for x in self.tvDict[fmt][1]] + if addPI and fmt != "MONO": + args += [ + "-scene_orientation", + str(self.sceneFile), + "-device_orientation", + str(self.deviceFile), + ] + return args + + def piFiles(self) -> tuple[Path]: + return (self.sceneFile, self.deviceFile) + + +def run_rtp_bitstream_tests( + codec: CODECS, + bitrate: int, + bandwidth: str, + caMode: str, + format: str, + dtx: bool, + framesPerPacket: int, + dut_encoder_frontend: EncoderFrontend, + dut_decoder_frontend: DecoderFrontend, +): + tvArgs = TVARGS() + tvArgs.add("MONO", "stv48n.wav") + + if dtx: # use bigger file for dtx stereo + tvArgs.add("STEREO", "stvST48n.wav", ["-stereo"]) + else: + tvArgs.add("STEREO", "stv2MASA2TC48c.wav", ["-stereo"]) + + tvArgs.add("MC", "stv51MC48c.wav", ["-mc", "5_1"]) + tvArgs.add("MASA", "stv2MASA2TC48c.wav", ["-masa", "2", "stv2MASA2TC48c.met"]) + tvArgs.add("SBA", "stvFOA48c.wav", ["-sba", "+1"]) + + if (bitrate > 24400 and bandwidth == "NB") or ( + format == "STEREO" and bitrate > 256000 + ): + pytest.skip() + + print( + "Test: dut_encoder_frontend={}, dtx={}, codec:={}, bitrate={}, bandwidth={}, caMode={}, format={},".format( + dut_encoder_frontend._path, dtx, codec, bitrate, bandwidth, caMode, format + ) + ) + + validate = RTPVALIDATE( + codec=codec, bitrate=bitrate, framesPerPacket=framesPerPacket, dtx=dtx + ) + + with TemporaryDirectory() as tmp_dir: + g192Out = ( + Path(tmp_dir) + .joinpath(f"output-{codec}-{bitrate}-{caMode}-{format}-{dtx}.g192") + .absolute() + ) + rtpdumpOut = ( + Path(tmp_dir) + .joinpath(f"output-{codec}-{bitrate}-{caMode}-{format}-{dtx}.rtpdump") + .absolute() + ) + rtpdumpIn = ( + Path(tmp_dir) + .joinpath(f"input-{codec}-{bitrate}-{caMode}-{format}-{dtx}.rtpdump") + .absolute() + ) + pcmOut = ( + Path(tmp_dir) + .joinpath(f"output-{codec}-{bitrate}-{caMode}-{format}-{dtx}.wav") + .absolute() + ) + pcmOutG192 = ( + Path(tmp_dir) + .joinpath(f"output_g192-{codec}-{bitrate}-{caMode}-{format}-{dtx}.wav") + .absolute() + ) + piDataOutJson = ( + Path(tmp_dir) + .joinpath(f"piData-{codec}-{bitrate}-{caMode}-{format}-{dtx}.json") + .absolute() + ) + + # Run WITHOUT rtpdump first to generate reference bitstream + dut_encoder_frontend.run( + bitrate=bitrate, + input_sampling_rate=48, + input_path=tvArgs.input(format), + output_bitstream_path=g192Out, + sba_order=None, + dtx_mode=dtx, + max_band=bandwidth, + add_option_list=tvArgs.args(format), + ) + validate.setRefG192Bitstream(g192File=g192Out) + + packer = IvasRtp(numFramesPerPacket=framesPerPacket, codec=codec) + + if codec == CODECS.IVAS: + outMode = "STEREO" if format == "STEREO" else "BINAURAL" + generatedPIData = generatePiData(0, 16000) + else: + outMode = "" + generatedPIData = dict() + + packer.packG192File( + g192File=g192Out, + rtpDumpOut=rtpdumpIn, + piData=generatedPIData, + requestsData=generateRequests(0, 1600), + ) + + dut_decoder_frontend.run( + output_config=outMode, + output_sampling_rate=48, + input_bitstream_path=g192Out, + output_path=pcmOutG192, + add_option_list=[], + ) + + dut_decoder_frontend.run( + output_config=outMode, + output_sampling_rate=48, + input_bitstream_path=rtpdumpIn, + output_path=pcmOut, + add_option_list=["-VOIP_HF_ONLY=1", "-PiDataFile", str(piDataOutJson)], + ) + + decAudio, fs = readfile(pcmOut) + g192Audio, Fs = readfile(pcmOutG192) + decAudio /= 32768.0 # readfile reuturns 16 bit int + g192Audio /= 32768.0 # readfile reuturns 16 bit int + decAudio = decAudio[4 * 960 :] + assert abs(decAudio.shape[0] - g192Audio.shape[0]) <= ( + 4 * 960 + ), "Decoded PCM Audio is not same length as input" + minSamples = min(decAudio.shape[0], g192Audio.shape[0]) + rmsdB = 10.0 * np.log10( + np.finfo(float).eps + + np.sum(np.abs(g192Audio[:minSamples] - decAudio[:minSamples]) ** 2) + / minSamples + ) + + if dtx: + assert ( + rmsdB < -60.0 + ), "Bitdiff in the RTP unpacked and G192 streams for DTX stream" + else: + assert rmsdB < -96.0, "Bitdiff in the RTP unpacked and G192 streams" + + with open(piDataOutJson, "r") as fd: + decodedPiData = json.load(fd) + assert ( + decodedPiData.keys() == generatedPIData.keys() + ), f"Timestamp of PI data {generatedPIData.keys()} not found in Decoded PI Data {decodedPiData.keys()}" + for ts in generatedPIData.keys(): + for pitype in generatedPIData[ts]: + data = generatedPIData[ts][pitype] + decoded = decodedPiData[ts][pitype] + if type(generatedPIData[ts][pitype]) == ORIENTATION: + isEqualOrientation(ORIENTATION(**decoded), data) + elif type(generatedPIData[ts][pitype]) == POSITION: + isEqualPosition(POSITION(**decoded), data) + elif type(generatedPIData[ts][pitype]) == DYNAMIC_AUDIO_SUPPRESSION: + isEqualDAS(DYNAMIC_AUDIO_SUPPRESSION(**decoded), data) + elif type(generatedPIData[ts][pitype]) == DIEGETIC_TYPE: + isEqualDiegetic(DIEGETIC_TYPE(**decoded), data) + elif type(generatedPIData[ts][pitype]) == ACOUSTIC_ENVIRONMENT: + isEqualAcousticEnv(ACOUSTIC_ENVIRONMENT(**decoded), data) + elif type(generatedPIData[ts][pitype]) == AUDIO_FOCUS: + isEqualAudioFocus(AUDIO_FOCUS(**decoded), data) + elif type(generatedPIData[ts][pitype]) == list: + for r, d in zip( + generatedPIData[ts][pitype], decodedPiData[ts][pitype] + ): + isEqualAD(AUDIO_DESCRIPTION(**d), r) + else: + assert False, "Unsupported PI data found" + + # Generate RTPDUMP + addPI = False if format == "MONO" else True + if addPI: + # Add PI Data to Pack in RTP + validate.setPiDataFiles(tvArgs.piFiles()) + + extra_args = tvArgs.args(format, addPI) + extra_args += ["-rtpdump", str(framesPerPacket)] + dut_encoder_frontend.run( + bitrate=bitrate, + input_sampling_rate=48, + input_path=tvArgs.input(format), + output_bitstream_path=rtpdumpOut, + sba_order=None, + dtx_mode=dtx, + max_band=bandwidth, + add_option_list=extra_args, + ) + + unpacker = IvasRtp() + unpacker.unpackFile(rtpdumpOut) + for packet in unpacker.getPackets(): + validate.packet(packet) diff --git a/tests/split_rendering/constants.py b/tests/split_rendering/constants.py index 10ed5a9393dc40a57de0a1fa3a48cad10065ec29..7d58a03b0c05a3556603d24c082f15a7750df267 100644 --- a/tests/split_rendering/constants.py +++ b/tests/split_rendering/constants.py @@ -56,6 +56,14 @@ CUSTOM_LAYOUT_DIR = SCRIPTS_DIR.joinpath("ls_layouts") HR_TRAJECTORY_DIR = SCRIPTS_DIR.joinpath("trajectories") TESTV_DIR = SCRIPTS_DIR.joinpath("testv") +if platform.system() == "Windows": + TOOLS_DIR = SCRIPTS_DIR / "tools" / "Win32" +elif platform.system() == "Linux": + TOOLS_DIR = SCRIPTS_DIR / "tools"/ "Linux" +elif platform.system() == "Darwin": + TOOLS_DIR = SCRIPTS_DIR / "tools" / "Darwin" +else: + assert False, "Unsupported platform" """ Renderer configurations """ RENDERER_CONFIGS_DEFAULT_CODEC = [ @@ -99,7 +107,7 @@ RENDERER_CONFIGS_TO_TEST_PLC = ( """ Trajectories """ SPLIT_REND_HR_TRAJECTORIES_TO_TEST = [ - "rotate_euler_quaternion_5s", + "rotate_euler_quaternion_30s", ] """ IVAS specific constants """ @@ -180,6 +188,9 @@ INPUT_DURATION_SEC = 5 """ PLC constants """ PLC_ERROR_PATTERNS = [str(ep.stem) for ep in ERROR_PATTERNS_DIR.glob("*.ep")] +""" Delay profiles for testing VoIP mode """ +DELAY_PROFILES = [None, "dly_error_profile_5"] + """ Encoder commandline template """ SPLIT_PRE_COD_CMD = [ str(TESTS_DIR.parent.parent.joinpath("IVAS_cod")), diff --git a/tests/split_rendering/test_split_rendering.py b/tests/split_rendering/test_split_rendering.py index cac6c9b94921675123f985c72b93381b7fae2ffd..0ff32fa290ccdb0693d1d2f296630a652ab20881 100644 --- a/tests/split_rendering/test_split_rendering.py +++ b/tests/split_rendering/test_split_rendering.py @@ -37,6 +37,7 @@ from tests.split_rendering.utils import * """ Ambisonics """ +@pytest.mark.parametrize("delay_profile", DELAY_PROFILES) @pytest.mark.parametrize("trajectory", SPLIT_REND_HR_TRAJECTORIES_TO_TEST) @pytest.mark.parametrize("render_config", RENDERER_CONFIGS_TO_TEST_AMBI) @pytest.mark.parametrize("bitrate", IVAS_BITRATES_AMBI) @@ -54,6 +55,7 @@ def test_ambisonics_full_chain_split( bitrate, render_config, trajectory, + delay_profile, ): post_trajectory = HR_TRAJECTORY_DIR.joinpath(f"{trajectory}.csv") pre_trajectory = post_trajectory.with_stem(f"{post_trajectory.stem}_delayed") @@ -73,6 +75,7 @@ def test_ambisonics_full_chain_split( get_ssnr=get_ssnr, get_odg=get_odg, get_odg_bin=get_odg_bin, + delay_profile=SCRIPTS_DIR / "dly_error_profiles" / f"{delay_profile}.dat" if delay_profile else None, ) @@ -114,6 +117,7 @@ def test_ambisonics_external_split( """ Multichannel """ +@pytest.mark.parametrize("delay_profile", DELAY_PROFILES) @pytest.mark.parametrize("trajectory", SPLIT_REND_HR_TRAJECTORIES_TO_TEST) @pytest.mark.parametrize("render_config", RENDERER_CONFIGS_TO_TEST_MC) @pytest.mark.parametrize("bitrate", IVAS_BITRATES_MC) @@ -131,6 +135,7 @@ def test_multichannel_full_chain_split( bitrate, render_config, trajectory, + delay_profile, ): post_trajectory = HR_TRAJECTORY_DIR.joinpath(f"{trajectory}.csv") pre_trajectory = post_trajectory.with_stem(f"{post_trajectory.stem}_delayed") @@ -150,6 +155,7 @@ def test_multichannel_full_chain_split( get_ssnr=get_ssnr, get_odg=get_odg, get_odg_bin=get_odg_bin, + delay_profile=SCRIPTS_DIR / "dly_error_profiles" / f"{delay_profile}.dat" if delay_profile else None, ) @@ -191,6 +197,7 @@ def test_multichannel_external_split( """ ISM """ +@pytest.mark.parametrize("delay_profile", DELAY_PROFILES) @pytest.mark.parametrize("trajectory", SPLIT_REND_HR_TRAJECTORIES_TO_TEST) @pytest.mark.parametrize("render_config", RENDERER_CONFIGS_TO_TEST_ISM) @pytest.mark.parametrize("bitrate", IVAS_BITRATES_ISM) @@ -208,6 +215,7 @@ def test_ism_full_chain_split( bitrate, render_config, trajectory, + delay_profile, ): post_trajectory = HR_TRAJECTORY_DIR.joinpath(f"{trajectory}.csv") pre_trajectory = post_trajectory.with_stem(f"{post_trajectory.stem}_delayed") @@ -227,6 +235,7 @@ def test_ism_full_chain_split( get_ssnr=get_ssnr, get_odg=get_odg, get_odg_bin=get_odg_bin, + delay_profile=SCRIPTS_DIR / "dly_error_profiles" / f"{delay_profile}.dat" if delay_profile else None, ) @@ -268,6 +277,7 @@ def test_ism_external_split( """ MASA """ +@pytest.mark.parametrize("delay_profile", DELAY_PROFILES) @pytest.mark.parametrize("trajectory", SPLIT_REND_HR_TRAJECTORIES_TO_TEST) @pytest.mark.parametrize("render_config", RENDERER_CONFIGS_TO_TEST_MASA) @pytest.mark.parametrize("bitrate", IVAS_BITRATES_MASA) @@ -285,6 +295,7 @@ def test_masa_full_chain_split( bitrate, render_config, trajectory, + delay_profile, ): post_trajectory = HR_TRAJECTORY_DIR.joinpath(f"{trajectory}.csv") pre_trajectory = post_trajectory.with_stem(f"{post_trajectory.stem}_delayed") @@ -304,6 +315,7 @@ def test_masa_full_chain_split( get_ssnr=get_ssnr, get_odg=get_odg, get_odg_bin=get_odg_bin, + delay_profile=SCRIPTS_DIR / "dly_error_profiles" / f"{delay_profile}.dat" if delay_profile else None, ) @@ -345,6 +357,7 @@ def test_masa_external_split( """ OMASA """ +@pytest.mark.parametrize("delay_profile", DELAY_PROFILES) @pytest.mark.parametrize("trajectory", SPLIT_REND_HR_TRAJECTORIES_TO_TEST) @pytest.mark.parametrize("render_config", RENDERER_CONFIGS_TO_TEST_OMASA) @pytest.mark.parametrize("bitrate", IVAS_BITRATES_OMASA) @@ -362,6 +375,7 @@ def test_omasa_full_chain_split( bitrate, render_config, trajectory, + delay_profile, ): post_trajectory = HR_TRAJECTORY_DIR.joinpath(f"{trajectory}.csv") pre_trajectory = post_trajectory.with_stem(f"{post_trajectory.stem}_delayed") @@ -381,6 +395,7 @@ def test_omasa_full_chain_split( get_ssnr=get_ssnr, get_odg=get_odg, get_odg_bin=get_odg_bin, + delay_profile=SCRIPTS_DIR / "dly_error_profiles" / f"{delay_profile}.dat" if delay_profile else None, ) @@ -422,6 +437,7 @@ def test_omasa_external_split( """ OSBA """ +@pytest.mark.parametrize("delay_profile", DELAY_PROFILES) @pytest.mark.parametrize("trajectory", SPLIT_REND_HR_TRAJECTORIES_TO_TEST) @pytest.mark.parametrize("render_config", RENDERER_CONFIGS_TO_TEST_OSBA) @pytest.mark.parametrize("bitrate", IVAS_BITRATES_OSBA) @@ -439,6 +455,7 @@ def test_osba_full_chain_split( bitrate, render_config, trajectory, + delay_profile, ): post_trajectory = HR_TRAJECTORY_DIR.joinpath(f"{trajectory}.csv") pre_trajectory = post_trajectory.with_stem(f"{post_trajectory.stem}_delayed") @@ -458,6 +475,7 @@ def test_osba_full_chain_split( get_ssnr=get_ssnr, get_odg=get_odg, get_odg_bin=get_odg_bin, + delay_profile=SCRIPTS_DIR / "dly_error_profiles" / f"{delay_profile}.dat" if delay_profile else None, ) @@ -549,6 +567,7 @@ full_chain_split_pcm_params = [ ] +@pytest.mark.parametrize("delay_profile", DELAY_PROFILES) @pytest.mark.parametrize("in_fmt,bitrate,render_config", full_chain_split_pcm_params) def test_full_chain_split_pcm( record_property, @@ -562,6 +581,7 @@ def test_full_chain_split_pcm( in_fmt, bitrate, render_config, + delay_profile, ): trajectory = SPLIT_REND_HR_TRAJECTORIES_TO_TEST[0] post_trajectory = HR_TRAJECTORY_DIR.joinpath(f"{trajectory}.csv") @@ -583,6 +603,7 @@ def test_full_chain_split_pcm( get_ssnr=get_ssnr, get_odg=get_odg, get_odg_bin=get_odg_bin, + delay_profile=SCRIPTS_DIR / "dly_error_profiles" / f"{delay_profile}.dat" if delay_profile else None, ) @@ -668,9 +689,10 @@ def test_framing_combinations_external_split( ) +@pytest.mark.parametrize("delay_profile", DELAY_PROFILES) @pytest.mark.parametrize("trajectory", SPLIT_REND_HR_TRAJECTORIES_TO_TEST) @pytest.mark.parametrize("render_config", RENDERER_CONFIGS_FRAMING) -@pytest.mark.parametrize("in_fmt", ["5_1"]) +@pytest.mark.parametrize("in_fmt", ["5_1", "FOA"]) @pytest.mark.parametrize("pre_rend_fr", SPLIT_RENDERER_PRE_FRAMINGS) @pytest.mark.parametrize("post_rend_fr", SPLIT_RENDERER_POST_FRAMINGS) def test_framing_combinations_full_chain_split( @@ -687,6 +709,7 @@ def test_framing_combinations_full_chain_split( trajectory, post_rend_fr, pre_rend_fr, + delay_profile, ): post_trajectory = HR_TRAJECTORY_DIR.joinpath(f"{trajectory}.csv") pre_trajectory = post_trajectory.with_stem(f"{post_trajectory.stem}_delayed") @@ -708,4 +731,5 @@ def test_framing_combinations_full_chain_split( get_ssnr=get_ssnr, get_odg=get_odg, get_odg_bin=get_odg_bin, + delay_profile=SCRIPTS_DIR / "dly_error_profiles" / f"{delay_profile}.dat" if delay_profile else None, ) diff --git a/tests/split_rendering/test_voip_be_splitrend_vs_binaural.py b/tests/split_rendering/test_voip_be_splitrend_vs_binaural.py new file mode 100644 index 0000000000000000000000000000000000000000..d70640b33aa92d4919784f5853eea28c138acc46 --- /dev/null +++ b/tests/split_rendering/test_voip_be_splitrend_vs_binaural.py @@ -0,0 +1,154 @@ +#!/usr/bin/env python3 + +""" + (C) 2022-2025 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB, + Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., + Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, + Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other + contributors to this repository. All Rights Reserved. + + This software is protected by copyright law and by international treaties. + The IVAS codec Public Collaboration consisting of Dolby International AB, Ericsson AB, + Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., + Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, + Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other + contributors to this repository retain full ownership rights in their respective contributions in + the software. This notice grants no license of any kind, including but not limited to patent + license, nor is any license granted by implication, estoppel or otherwise. + + Contributors are required to enter into the IVAS codec Public Collaboration agreement before making + contributions. + + This software is provided "AS IS", without any express or implied warranties. The software is in the + development stage. It is intended exclusively for experts who have experience with such software and + solely for the purpose of inspection. All implied warranties of non-infringement, merchantability + and fitness for a particular purpose are hereby disclaimed and excluded. + + Any dispute, controversy or claim arising under or in relation to providing this software shall be + submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in + accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and + the United Nations Convention on Contracts on the International Sales of Goods. +""" + +import pytest + +from tempfile import TemporaryDirectory +from pathlib import Path +import filecmp + +from tests.split_rendering.utils import * +from tests.split_rendering.constants import SCRIPTS_DIR, TESTV_DIR +from tests.test_be_for_jbm_neutral_dly_profile import ( + INPUT_FILES, + get_options_cod, +) +from pyaudio3dtools import audioarray, audiofile + +IN_FORMATS = [ + "MC_5_1", + "ISM4", + "FOA", + "MASA2TC", +] + +DELAY_PROFILES = ["dly_error_profile_0.dat", "dly_error_profile_5.dat"] + + +# Compares PCM output and tracefile from a VoIP BINAURAL_SPLIT_PCM chain with equivalent BINAURAL +# chain to ensure time-scaling and other JBM operations are BE between the two. +@pytest.mark.parametrize("in_format", IN_FORMATS) +@pytest.mark.parametrize("delay_profile", DELAY_PROFILES) +def test_voip_be_splitrend_vs_binaural( + in_format, + delay_profile, + dut_encoder_frontend, + dut_decoder_frontend, + ivas_bitrate=128000, +): + with TemporaryDirectory() as tmp_dir: + tmp_dir = Path(tmp_dir) + + sampling_rate_khz = 48 + delay_profile_path = SCRIPTS_DIR / "dly_error_profiles" / delay_profile + delay_profile_id = int(delay_profile[-5]) + + # run encoder + bitstream_file = (tmp_dir / f"{in_format}-dly{delay_profile_id}.192").absolute() + dtx = False + wav_in = TESTV_DIR / INPUT_FILES[in_format] + dut_encoder_frontend.run( + ivas_bitrate, + sampling_rate_khz, + wav_in, + bitstream_file, + add_option_list=get_options_cod(in_format, dtx), + run_dir=tmp_dir, + ) + + def run_decoder(out_format): + options = [] + + # With CLDFB pose correction (default with BINAURAL_SPLIT_PCM), a 20 ms audio frame is + # rendered with only one head position (first of the 4 per frame). If we want to compare + # the output from BINAURAL_SPLIT_PCM to output from BINAURAL, the head trajectory must + # be static. + head_traj = Path(SCRIPTS_DIR / "trajectories/const000.csv") + options.extend(["-T", str(head_traj)]) + + wav_out = ( + tmp_dir + / f"{in_format}-{ivas_bitrate}-{out_format}-dly{delay_profile_id}.wav" + ).absolute() + + trace_out = wav_out.with_suffix(".trace") + options.extend(["-Tracefile", str(trace_out), "-no_delay_cmp"]) + + if out_format == "BINAURAL_SPLIT_PCM": + isar_md_file = wav_out.with_suffix(".isarmd") + options.extend(["-om", str(isar_md_file)]) + else: + isar_md_file = None + + dut_decoder_frontend.run( + out_format, + sampling_rate_khz, + bitstream_file, + wav_out, + netsim_profile=delay_profile_path, + add_option_list=options, + ) + + return wav_out, trace_out, isar_md_file + + wav_out_bin, trace_out_bin, _ = run_decoder("BINAURAL") + wav_out_sr, trace_out_sr, _ = run_decoder("BINAURAL_SPLIT_PCM") + + # Note regarding delay alignment: both output audio files contain the same decoder delay. + # + # - When outputting to BINAURAL with -no_delay_cmp, decoder delay is present in the audio + # output, as expected. + # + # - When outputting to BINAURAL_SPLIT_PCM, decoder delay is never compensated in output + # audio (irrespective of the -no_delay_cmp flag). The delay value is saved in the ISAR + # metadata file and compensated at the post-rendering stage. + audio_sr, _ = audiofile.readfile(str(wav_out_sr)) + audio_bin, _ = audiofile.readfile(str(wav_out_bin)) + + # Ensure audio and tracefiles are BE + audio_cmp_result = audioarray.compare( + audio_bin, audio_sr, fs=sampling_rate_khz * 1000, per_frame=False + ) + tracefiles_equal = filecmp.cmp(trace_out_bin, trace_out_sr) + failed = not audio_cmp_result["bitexact"] or not tracefiles_equal + if failed: + message = [] + if not audio_cmp_result["bitexact"]: + message.append( + "Difference found between delay-aligned BINAURAL audio and BINAURAL_SPLIT_PCM audio! " + f"Max abs diff: {audio_cmp_result['max_abs_diff']}" + ) + if not tracefiles_equal: + message.append( + "Difference found between BINAURAL tracefile and BINAURAL_SPLIT_PCM tracefile!" + ) + pytest.fail("; ".join(message)) diff --git a/tests/split_rendering/utils.py b/tests/split_rendering/utils.py index 1a6ff61edc55c9edac6e1400ffef6c040e30b072..ca7a5143c581d181f895fed3914c6a3a760484f1 100644 --- a/tests/split_rendering/utils.py +++ b/tests/split_rendering/utils.py @@ -34,10 +34,11 @@ import re import sys from pathlib import Path from tempfile import TemporaryDirectory -from typing import Tuple +from typing import Tuple, Optional import numpy as np import pytest +import logging from tests.renderer.constants import ( BIN_SUFFIX_MERGETARGET, @@ -50,6 +51,7 @@ from tests.renderer.utils import ( run_isar_post_rend_cmd, run_ivas_isar_dec_cmd, run_ivas_isar_enc_cmd, + run_cmd, ) from tests.split_rendering.constants import * @@ -184,6 +186,7 @@ def run_full_chain_split_rendering( get_ssnr=False, get_odg=False, get_odg_bin=False, + delay_profile: Optional[Path] = None, ) -> str: """ Runs the full split rendering chain consisting of @@ -201,6 +204,9 @@ def run_full_chain_split_rendering( renderer_fmt_for_filename = renderer_fmt.replace("BINAURAL_", "") filename_base = f"{in_fmt}_{bitrate}_{renderer_fmt_for_filename}_full_cfg_{render_config.stem}_fr_pre_{pre_rend_fr}_post_{post_rend_fr}" + if delay_profile: + filename_base += f"_{delay_profile.stem}" + ivas_bitstream_stem = f"{filename_base}.192" # NOTE: the split bitstream files need to have ".bit" extension otherwise the conformance test breaks split_bitstream_stem = f"{filename_base}.splt.bit" @@ -230,63 +236,80 @@ def run_full_chain_split_rendering( in_meta_files = None # run encoder - cmd = SPLIT_PRE_COD_CMD[:] + enc_cmd = SPLIT_PRE_COD_CMD[:] if test_info.config.option.create_ref: - cmd[0] += BIN_SUFFIX_MERGETARGET - cmd[0] += binary_suffix - cmd[1] = bitrate + enc_cmd[0] += BIN_SUFFIX_MERGETARGET + enc_cmd[0] += binary_suffix + enc_cmd[1] = bitrate # if in REF or CUT creation mode use the comparetestv if test_info.config.option.create_ref or test_info.config.option.create_cut: in_file = FORMAT_TO_FILE_COMPARETEST[in_fmt] truncate_signal(in_file, cut_in_file) - cmd[3] = str(cut_in_file) + enc_cmd[3] = str(cut_in_file) else: - cmd[3] = str(FORMAT_TO_FILE_SMOKETEST[in_fmt]) - cmd[4] = str(ivas_bitstream) + enc_cmd[3] = str(FORMAT_TO_FILE_SMOKETEST[in_fmt]) + enc_cmd[4] = str(ivas_bitstream) if in_meta_files: - cmd[1:1] = in_meta_files - - cmd[1:1] = FORMAT_TO_IVAS_COD_FORMAT[in_fmt] - - run_ivas_isar_enc_cmd(cmd) + enc_cmd[1:1] = in_meta_files + + enc_cmd[1:1] = FORMAT_TO_IVAS_COD_FORMAT[in_fmt] + + run_ivas_isar_enc_cmd(enc_cmd) + + if delay_profile: + rtp_bitstream = ivas_bitstream.with_suffix(".netsimout") + netsim_cmd = [ + str(TOOLS_DIR / f"networkSimulator_g192{EXE_SUFFIX}"), + str(delay_profile), + str(ivas_bitstream), + str(rtp_bitstream), + str(tmp_dir / "tmp.netsimtrace"), + "1", + "0", + ] + run_cmd(netsim_cmd, test_info=test_info) + ivas_bitstream = rtp_bitstream # decode to split-rendering bitstream - cmd = SPLIT_PRE_DEC_CMD[:] + dec_cmd = SPLIT_PRE_DEC_CMD[:] if test_info.config.option.create_ref: - cmd[0] += BIN_SUFFIX_MERGETARGET - cmd[0] += binary_suffix - cmd[2] = str(pre_trajectory) - cmd[4] = str(render_config) - cmd[6] = str(pre_rend_fr) - cmd[7] = renderer_fmt - cmd[9] = str(ivas_bitstream) - cmd[10] = str(split_bitstream) + dec_cmd[0] += BIN_SUFFIX_MERGETARGET + dec_cmd[0] += binary_suffix + dec_cmd[2] = str(pre_trajectory) + dec_cmd[4] = str(render_config) + dec_cmd[6] = str(pre_rend_fr) + dec_cmd[7] = renderer_fmt + dec_cmd[9] = str(ivas_bitstream) + dec_cmd[10] = str(split_bitstream) if renderer_fmt == "BINAURAL_SPLIT_PCM": - cmd[5:5] = ["-om", str(split_md_file)] + dec_cmd[5:5] = ["-om", str(split_md_file)] - run_ivas_isar_dec_cmd(cmd) + if delay_profile: + dec_cmd[5:5] = ["-voip"] + + run_ivas_isar_dec_cmd(dec_cmd) # run split renderer - cmd = SPLIT_POST_REND_CMD[:] + post_rend_cmd = SPLIT_POST_REND_CMD[:] if test_info.config.option.create_ref: - cmd[0] += BIN_SUFFIX_MERGETARGET - cmd[0] += binary_suffix - cmd[4] = str(split_bitstream) - cmd[6] = renderer_fmt - cmd[8] = str(out_file) - cmd[10] = str(post_trajectory) - cmd[12] = post_rend_fr + post_rend_cmd[0] += BIN_SUFFIX_MERGETARGET + post_rend_cmd[0] += binary_suffix + post_rend_cmd[4] = str(split_bitstream) + post_rend_cmd[6] = renderer_fmt + post_rend_cmd[8] = str(out_file) + post_rend_cmd[10] = str(post_trajectory) + post_rend_cmd[12] = post_rend_fr if renderer_fmt == "BINAURAL_SPLIT_PCM": - cmd[7:7] = ["-im", str(split_md_file)] + post_rend_cmd[7:7] = ["-im", str(split_md_file)] - run_isar_post_rend_cmd(cmd) + run_isar_post_rend_cmd(post_rend_cmd) if test_info.config.option.create_cut: # CUT creation mode will run a comparison with REF @@ -313,6 +336,11 @@ def run_full_chain_split_rendering( record_property(k, v) if output_differs: + logging.error(f"Encoder command line was: {' '.join(enc_cmd)}") + if delay_profile: + logging.error(f"Netsim command line was: {' '.join(netsim_cmd)}") + logging.error(f"Decoder command line was: {' '.join(dec_cmd)}") + logging.error(f"Post renderer command line was: {' '.join(post_rend_cmd)}") pytest.fail(f"Output differs: ({reason})") return out_file @@ -329,7 +357,6 @@ def run_external_split_rendering( plc_error_pattern: Path = None, renderer_fmt: str = "BINAURAL_SPLIT_CODED", binary_suffix: str = "", - is_comparetest: bool = False, post_rend_fr: str = "20", pre_rend_fr: str = "20", get_mld=False, @@ -377,52 +404,53 @@ def run_external_split_rendering( in_meta_files = None # generate split-rendering bitstream - cmd = SPLIT_PRE_REND_CMD[:] + split_pre_cmd = SPLIT_PRE_REND_CMD[:] if test_info.config.option.create_ref: - cmd[0] += BIN_SUFFIX_MERGETARGET - cmd[0] += binary_suffix - cmd[4] = str(render_config) - if is_comparetest: + split_pre_cmd[0] += BIN_SUFFIX_MERGETARGET + split_pre_cmd[0] += binary_suffix + split_pre_cmd[4] = str(render_config) + # if in REF or CUT creation mode use the comparetestv + if test_info.config.option.create_ref or test_info.config.option.create_cut: in_file = FORMAT_TO_FILE_COMPARETEST[in_fmt] truncate_signal(in_file, cut_in_file) - cmd[6] = str(cut_in_file) + split_pre_cmd[6] = str(cut_in_file) else: - cmd[6] = str(FORMAT_TO_FILE_SMOKETEST[in_fmt]) - cmd[8] = in_fmt - cmd[10] = str(split_bitstream) - cmd[12] = renderer_fmt - cmd[14] = str(pre_trajectory) - cmd[16] = pre_rend_fr + split_pre_cmd[6] = str(FORMAT_TO_FILE_SMOKETEST[in_fmt]) + split_pre_cmd[8] = in_fmt + split_pre_cmd[10] = str(split_bitstream) + split_pre_cmd[12] = renderer_fmt + split_pre_cmd[14] = str(pre_trajectory) + split_pre_cmd[16] = pre_rend_fr if renderer_fmt == "BINAURAL_SPLIT_PCM": - cmd[13:13] = ["-om", str(split_md_file)] + split_pre_cmd[13:13] = ["-om", str(split_md_file)] if in_meta_files: - cmd[9:9] = ["-im", *in_meta_files] + split_pre_cmd[9:9] = ["-im", *in_meta_files] - run_isar_ext_rend_cmd(cmd) + run_isar_ext_rend_cmd(split_pre_cmd) # run split renderer - cmd = SPLIT_POST_REND_CMD[:] + split_post_cmd = SPLIT_POST_REND_CMD[:] if test_info.config.option.create_ref: - cmd[0] += BIN_SUFFIX_MERGETARGET - cmd[0] += binary_suffix - cmd[4] = str(split_bitstream) - cmd[6] = renderer_fmt - cmd[8] = str(out_file) - cmd[10] = str(post_trajectory) - cmd[12] = post_rend_fr + split_post_cmd[0] += BIN_SUFFIX_MERGETARGET + split_post_cmd[0] += binary_suffix + split_post_cmd[4] = str(split_bitstream) + split_post_cmd[6] = renderer_fmt + split_post_cmd[8] = str(out_file) + split_post_cmd[10] = str(post_trajectory) + split_post_cmd[12] = post_rend_fr if renderer_fmt == "BINAURAL_SPLIT_PCM": - cmd[7:7] = ["-im", str(split_md_file)] + split_post_cmd[7:7] = ["-im", str(split_md_file)] if plc_error_pattern: - cmd[1:1] = ["-prbfi", str(plc_error_pattern)] + split_post_cmd[1:1] = ["-prbfi", str(plc_error_pattern)] - run_isar_ext_rend_cmd(cmd) + run_isar_ext_rend_cmd(split_post_cmd) if test_info.config.option.create_cut: # CUT creation mode will run a comparison with REF @@ -452,6 +480,8 @@ def run_external_split_rendering( record_property(k, v) if output_differs: + logging.error(f"Split Pre command line was: {' '.join(split_pre_cmd)}") + logging.error(f"Split Post command line was: {' '.join(split_post_cmd)}") pytest.fail(f"Output differs: ({reason})") return out_file diff --git a/tests/test_be_ambi_converter_fixed_to_float.py b/tests/test_be_ambi_converter_fixed_to_float.py new file mode 100644 index 0000000000000000000000000000000000000000..aa4202d3d1a90a85978b3da31c3d13e1a9c7d64c --- /dev/null +++ b/tests/test_be_ambi_converter_fixed_to_float.py @@ -0,0 +1,126 @@ +import pytest +import subprocess +import itertools +import sys +from enum import Enum +from pathlib import Path +from tempfile import TemporaryDirectory + +HERE = Path(__file__).absolute().parent +TESTV_DIR = HERE.parent / "scripts/testv" +OUTPUT_FOLDER_IF_KEEP_FILES = HERE.joinpath("output-ambi_converter-be") + +sys.path.append(str(HERE.parent / "scripts")) +from pyaudio3dtools import audiofile, audioarray + + +class AMBI_CONVENTION(int, Enum): + ACN_SN3D = 0 + ACN_N3D = 1 + FUMA_MAXN = 2 + FUMA_FUMA = 3 + SID_SN3D = 4 + SID_N3D = 5 + + +def run_ambi_converter( + bin_path: Path, + infile: Path, + outfile: str, + convention_in: AMBI_CONVENTION, + convention_out: AMBI_CONVENTION, +): + cmd = [ + str(bin_path), + str(infile), + outfile, + f"{int(convention_in)}", + f"{int(convention_out)}", + ] + print(" ".join(cmd)) + + p = subprocess.run(cmd, capture_output=True) + if p.returncode != 0: + msg = f"{p.stdout.decode('utf8')}\n{p.stderr.decode('utf8')}" + pytest.fail(f"Ambisonics converter run failed:\n{msg}") + + +# test all ambisonics orders from 1 to 3 +INPUT_CH_NUM = [4, 9, 16] +INPUT_FS = [16, 32, 48] +INPUT_FILES = [ + TESTV_DIR / f"spectral_test_{ch}ch_{fs}kHz.wav" + for ch in INPUT_CH_NUM + for fs in INPUT_FS +] +CONVENTIONS = [c for c in AMBI_CONVENTION] +AMBI_CONVERTER_PATH_FLOAT = HERE.parent / "ambi_converter_flt" +AMBI_CONVERTER_PATH_FIXED = HERE.parent / "ambi_converter_fx" +THRESHOLD_FAIL = 1 + +CONVENTIONS_FULL_COMBI = list(itertools.product(CONVENTIONS, CONVENTIONS)) +CONVENTIONS_TEST_PARAMS = [ + (c_in.value, c_out.value) for c_in, c_out in CONVENTIONS_FULL_COMBI +] +CONVENTIONS_TEST_PARAMS_IDS = [ + f"{c_in.name}-to-{c_out.name}" for c_in, c_out in CONVENTIONS_FULL_COMBI +] + + +@pytest.mark.parametrize("infile", INPUT_FILES, ids=[p.name for p in INPUT_FILES]) +@pytest.mark.parametrize( + "convention_in,convention_out", + CONVENTIONS_TEST_PARAMS, + ids=CONVENTIONS_TEST_PARAMS_IDS, +) +def test_ambi_converter( + infile: Path, + convention_in: AMBI_CONVENTION, + convention_out: AMBI_CONVENTION, + keep_files, + # needs to be passed to correctly report errors + test_info, +): + if ( + convention_out != AMBI_CONVENTION.ACN_SN3D + and convention_in != AMBI_CONVENTION.ACN_SN3D + ): + pytest.xfail("One of in and out convention needs to be ACN_SN3D") + + if keep_files: + OUTPUT_FOLDER_IF_KEEP_FILES.mkdir(exist_ok=True, parents=True) + + with TemporaryDirectory() as tmp_dir: + output_dir = OUTPUT_FOLDER_IF_KEEP_FILES if keep_files else tmp_dir + + outfile_base = Path(output_dir) / ( + infile.stem + f"-{str(convention_in)}-to-{str(convention_out)}" + ) + + outfile_flt = str(outfile_base) + "-flt.wav" + outfile_fx = str(outfile_base) + "-fx.wav" + + run_ambi_converter( + AMBI_CONVERTER_PATH_FLOAT, + infile, + outfile_flt, + convention_in, + convention_out, + ) + + run_ambi_converter( + AMBI_CONVERTER_PATH_FIXED, + infile, + outfile_fx, + convention_in, + convention_out, + ) + + s_flt, _ = audiofile.readfile(outfile_flt) + s_fx, _ = audiofile.readfile(outfile_fx) + + cmp_result = audioarray.compare(s_flt, s_fx, fs=48000, per_frame=False) + if abs(cmp_result["max_abs_diff"]) > THRESHOLD_FAIL: + pytest.fail( + f"Difference between float and fixed ambi_converter output found! Max abs diff: {cmp_result['max_abs_diff']}" + ) diff --git a/tests/test_be_for_jbm_neutral_dly_profile.py b/tests/test_be_for_jbm_neutral_dly_profile.py index ec67ab22a3ae312d9ffbb9061b9c2338325259be..dee54b7d94a6f8dd0984e7d9203176f0028e8512 100644 --- a/tests/test_be_for_jbm_neutral_dly_profile.py +++ b/tests/test_be_for_jbm_neutral_dly_profile.py @@ -4,12 +4,15 @@ import sys import re import numpy as np from tempfile import TemporaryDirectory +from pathlib import Path from .constants import TESTV_DIR, SCRIPTS_DIR +from .split_rendering.constants import HR_TRAJECTORY_DIR, RENDER_CFG_DIR sys.path.append(str(SCRIPTS_DIR)) from pyaudio3dtools import audiofile, audioarray +from split_rendering.isar_bstool import IsarBitstream DTX_ON = "DTX_ON" DTX_OFF = "DTX_OFF" @@ -76,12 +79,28 @@ TESTCASES_NO_DTX = [ ["OSBA_ISM3_HOA3", 128000, "EXT"], ["OSBA_ISM2_HOA3", 96000, "5_1"], ["OSBA_ISM1_HOA2", 32000, "mono"], + # BINAURAL_SPLIT_PCM as output + ["ISM4", 128000, "BINAURAL_SPLIT_PCM"], + ["MC_5_1", 128000, "BINAURAL_SPLIT_PCM"], + ["FOA", 128000, "BINAURAL_SPLIT_PCM"], + ["OMASA_ISM2", 128000, "BINAURAL_SPLIT_PCM"], + # BINAURAL_SPLIT_CODED with LC3plus + ["MC_5_1", 128000, "BINAURAL_SPLIT_CODED"], + ["ISM4", 128000, "BINAURAL_SPLIT_CODED"], + # BINAURAL_SPLIT_CODED with LCLD + ["HOA3", 128000, "BINAURAL_SPLIT_CODED"], + ["OSBA_ISM4_FOA", 128000, "BINAURAL_SPLIT_CODED"], ] DLY_PROFILE = SCRIPTS_DIR.joinpath("dly_error_profiles/dly_error_profile_0.dat") JBM_NEUTRAL_DELAY_MS = 60 -def get_options(in_format, dtx): +def is_split_rend(format) -> bool: + return format.upper() in ["BINAURAL_SPLIT_CODED", "BINAURAL_SPLIT_PCM"] + + +def get_options_cod(in_format, dtx): + # NOTE: this function is shared with another test in tests/split_rendering/test_voip_be_splitrend_vs_binaural.py options = list() if dtx: @@ -124,6 +143,35 @@ def get_options(in_format, dtx): return options +def get_options_dec( + output_format: str, + output_file: Path, + is_voip: bool, +): + options = [] + + if "BINAURAL_SPLIT" in output_format.upper(): + options.extend(["-render_config", str(RENDER_CFG_DIR / "split_renderer_config_3dof_512k_default.txt")]) + + if output_format.upper() == "BINAURAL_SPLIT_PCM": + options.extend(["-om", str(output_file.with_suffix(".isarmd"))]) + + if is_split_rend(output_format): + # In VoIP configs account for VoIP delay by using the appropriately delayed head rotation file + options.extend( + [ + "-T", + str( + HR_TRAJECTORY_DIR + / f"rotate_euler_quaternion_30s_delayed{'_voip' if is_voip else ''}.csv" + ), + ] + ) + + return options + + +# NOTE: this list is shared with another test in tests/split_rendering/test_voip_be_splitrend_vs_binaural.py INPUT_FILES = { "stereo": "stvST48n.wav", "ISM1": "stv1ISM48s.wav", @@ -158,6 +206,32 @@ OUTPUT_FOLDER_IF_KEEP_FILES_NEUTRAL = OUTPUT_FOLDER_IF_KEEP_FILES.joinpath( "neutral-profile" ) +def compare_audio(non_voip_output, voip_output, sampling_rate_khz): + # compare no-jbm and jbm output + x, _ = audiofile.readfile(non_voip_output) + x_jbm, _ = audiofile.readfile(voip_output) + + # strip jbm delay + cmp_result = audioarray.compare( + x, + x_jbm, + fs=sampling_rate_khz * 1000, + per_frame=False, + test_start_offset_ms=JBM_NEUTRAL_DELAY_MS, + ) + if not cmp_result["bitexact"]: + pytest.fail( + f"Difference between no jbm and zero-delay jbm decoding found! Max abs diff: {cmp_result['max_abs_diff']}" + ) + + +def compare_isar_files(non_voip_isar, voip_isar): + isar_bs = IsarBitstream(non_voip_isar) + isar_bs_voip = IsarBitstream(voip_isar).trim(JBM_NEUTRAL_DELAY_MS / 1000) + if not isar_bs_voip.is_same_as(isar_bs): + pytest.fail( + "Difference between no jbm and zero-delay jbm decoding found! ISAR files differ" + ) @pytest.mark.parametrize( "in_format,bitrate,out_format", TESTCASES_NO_DTX + TESTCASES_WITH_DTX @@ -168,6 +242,7 @@ def test_be_for_jbm_neutral_dly_profile_no_dtx( out_format, dut_encoder_frontend, dut_decoder_frontend, + dut_postrend_frontend, keep_files, ): run_test( @@ -177,6 +252,7 @@ def test_be_for_jbm_neutral_dly_profile_no_dtx( DTX_OFF, dut_encoder_frontend, dut_decoder_frontend, + dut_postrend_frontend, keep_files, ) @@ -188,6 +264,7 @@ def test_be_for_jbm_neutral_dly_profile_with_dtx( out_format, dut_encoder_frontend, dut_decoder_frontend, + dut_postrend_frontend, keep_files, ): run_test( @@ -197,6 +274,7 @@ def test_be_for_jbm_neutral_dly_profile_with_dtx( DTX_ON, dut_encoder_frontend, dut_decoder_frontend, + dut_postrend_frontend, keep_files, ) @@ -208,6 +286,7 @@ def run_test( dtx, dut_encoder_frontend, dut_decoder_frontend, + dut_postrend_frontend, keep_files, ): if keep_files: @@ -216,6 +295,7 @@ def run_test( with TemporaryDirectory() as tmp_dir: tmp_dir = pathlib.Path(tmp_dir) + output_ext = "wav" if out_format != "BINAURAL_SPLIT_CODED" else "isarbs" output_dir_no_jbm = ( OUTPUT_FOLDER_IF_KEEP_FILES_NO_JBM if keep_files else tmp_dir ) @@ -243,7 +323,7 @@ def run_test( input_file = tmp_dir.joinpath(f"{input_file.stem}-plus-noise.wav") audiofile.writefile(input_file, input_signal, fs) - options = get_options(in_format, dtx == DTX_ON) + options = get_options_cod(in_format, dtx == DTX_ON) dut_encoder_frontend.run( bitrate, sampling_rate_khz, @@ -255,33 +335,67 @@ def run_test( # run decoder without network simulation output = output_dir_no_jbm.joinpath( - f"{in_format}-{bitrate}-{out_format}-{dtx}.wav" + f"{in_format}-{bitrate}-{out_format}-{dtx}.{output_ext}" ).absolute() - dut_decoder_frontend.run(out_format, sampling_rate_khz, bitstream_file, output) + non_voip_options = get_options_dec(out_format, output, is_voip=False) + dut_decoder_frontend.run( + out_format, + sampling_rate_khz, + bitstream_file, + output, + add_option_list=non_voip_options, + ) # run decoder with network simulation - output_jbm = output_dir_neutral.joinpath(output.with_suffix(".jbm-0.wav").name) + output_jbm = output_dir_neutral.joinpath(output.with_suffix(f".jbm-0.{output_ext}").name) + voip_options = get_options_dec(out_format, output_jbm, is_voip=True) dut_decoder_frontend.run( out_format, sampling_rate_khz, bitstream_file, output_jbm, netsim_profile=DLY_PROFILE, + add_option_list=voip_options, + ) + + if out_format == "BINAURAL_SPLIT_CODED": + # With `BINAURAL_SPLIT_CODED` the main output is an ISAR bitstream + compare_isar_files(output, output_jbm) + else: + # Otherwise audio output + compare_audio(output, output_jbm, sampling_rate_khz) + + # With `BINAURAL_SPLIT_PCM` there is an additional metadata output file + if out_format == "BINAURAL_SPLIT_PCM": + isar_md_file = Path(non_voip_options[non_voip_options.index("-om") + 1]) + isar_md_file_voip = Path(voip_options[voip_options.index("-om") + 1]) + compare_isar_files(isar_md_file, isar_md_file_voip) + else: + isar_md_file = None + isar_md_file_voip = None + + # We will test ISAR_post_rend below. Only applies to split rendering. + if not is_split_rend(out_format): + return + + # Render non-voip output + postrend_output = output_dir_no_jbm.joinpath(output.with_suffix(".postrend.wav").name) + dut_postrend_frontend.run( + sampling_rate_khz, + output, + postrend_output, + str(HR_TRAJECTORY_DIR / f"rotate_euler_quaternion_30s.csv"), + isar_md_file, ) - # compare no-jbm and jbm output - x, _ = audiofile.readfile(output) - x_jbm, _ = audiofile.readfile(output_jbm) - - # strip jbm delay - cmp_result = audioarray.compare( - x, - x_jbm, - fs=sampling_rate_khz * 1000, - per_frame=False, - test_start_offset_ms=JBM_NEUTRAL_DELAY_MS, + # Render voip output + postrend_output_voip = output_dir_neutral.joinpath(output_jbm.with_suffix(".postrend.wav").name) + dut_postrend_frontend.run( + sampling_rate_khz, + output_jbm, + postrend_output_voip, + str(HR_TRAJECTORY_DIR / f"rotate_euler_quaternion_30s_voip.csv"), + isar_md_file_voip, ) - if not cmp_result["bitexact"]: - pytest.fail( - f"Difference between no jbm and zero-delay jbm decoding found! Max abs diff: {cmp_result['max_abs_diff']}" - ) + + compare_audio(postrend_output, postrend_output_voip, sampling_rate_khz) diff --git a/tests/thirdPartyLegalNotices/thirdPartyLegalNotices.txt b/tests/thirdPartyLegalNotices/thirdPartyLegalNotices.txt index abff6f2cde469b73226728edcd1802a690800926..14815692f4064f5cf1734b0f4a0b2cfef5d03615 100755 --- a/tests/thirdPartyLegalNotices/thirdPartyLegalNotices.txt +++ b/tests/thirdPartyLegalNotices/thirdPartyLegalNotices.txt @@ -101,7 +101,7 @@ exceptiongroup MIT License The MIT License (MIT) -Copyright (c) 2022 Alex Grönholm +Copyright (c) 2022 Alex Grönholm Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in @@ -2244,4 +2244,81 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file +SOFTWARE. + + +bitstring +4.3.1 +MIT License +The MIT License + +Copyright (c) 2006 Scott Griffiths (dr.scottgriffiths@gmail.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + + +bitarray +3.7.2 +PSF-2.0 +PYTHON SOFTWARE FOUNDATION LICENSE +---------------------------------- + +1. This LICENSE AGREEMENT is between Ilan Schnell, and the Individual or +Organization ("Licensee") accessing and otherwise using this software +("bitarray") in source or binary form and its associated documentation. + +2. Subject to the terms and conditions of this License Agreement, Ilan Schnell +hereby grants Licensee a nonexclusive, royalty-free, world-wide +license to reproduce, analyze, test, perform and/or display publicly, +prepare derivative works, distribute, and otherwise use bitarray +alone or in any derivative version, provided, however, that Ilan Schnell's +License Agreement and Ilan Schnell's notice of copyright, i.e., "Copyright (c) +2008 - 2025 Ilan Schnell; All Rights Reserved" are retained in bitarray +alone or in any derivative version prepared by Licensee. + +3. In the event Licensee prepares a derivative work that is based on +or incorporates bitarray or any part thereof, and wants to make +the derivative work available to others as provided herein, then +Licensee hereby agrees to include in any such work a brief summary of +the changes made to bitarray. + +4. Ilan Schnell is making bitarray available to Licensee on an "AS IS" +basis. ILAN SCHNELL MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR +IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, ILAN SCHNELL MAKES NO AND +DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS +FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF BITARRAY WILL NOT +INFRINGE ANY THIRD PARTY RIGHTS. + +5. ILAN SCHNELL SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF BITARRAY +FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS +A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING BITARRAY, +OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. + +6. This License Agreement will automatically terminate upon a material +breach of its terms and conditions. + +7. Nothing in this License Agreement shall be deemed to create any +relationship of agency, partnership, or joint venture between Ilan Schnell +and Licensee. This License Agreement does not grant permission to use Ilan +Schnell trademarks or trade name in a trademark sense to endorse or promote +products or services of Licensee, or any third party. + +8. By copying, installing or otherwise using bitarray, Licensee +agrees to be bound by the terms and conditions of this License +Agreement.