Skip to content
Commits on Source (611)
......@@ -4,6 +4,7 @@
IVAS_cod
IVAS_dec
IVAS_rend
ISAR_post_rend
obj/
*.a
*.o
......@@ -16,6 +17,7 @@ build*/**/*
IVAS_cod.exe
IVAS_dec.exe
IVAS_rend.exe
ISAR_post_rend.exe
*.user
.vs/
Debug_*/
......@@ -54,10 +56,12 @@ scripts/testv/stvOMASA_*.met
scripts/testv/stvOMASA_*.csv
scripts/testv/stvOMASA_2ISM_1MASA1TC48c.wav
scripts/testv/stvOMASA_3ISM_1MASA1TC48c.wav
scripts/testv/stvO*
# default reference binary name
IVAS_cod_ref*
IVAS_dec_ref*
IVAS_rend_ref*
ISAR_post_rend_ref*
# Python files that pop up when running scripts
__pycache__/
......
......@@ -167,6 +167,12 @@ stages:
- git pull
- cd -
.update-ltv-repo-win: &update-ltv-repo-win
- Push-Location
- cd $LTV_DIR_WIN
- git pull
- Pop-Location
.enable-split-rendering: &enable-split-rendering
# automatically enable #define SPLIT_REND_WITH_HEAD_ROT in options.h, handling both /**/-comment and //-comment
- sed -i.bak -e "s/\/\*[[:space:]]*\(#define[[:space:]]*SPLIT_REND_WITH_HEAD_ROT\)[[:space:]]*\*\//\1/g" ./lib_com/options.h
......@@ -189,6 +195,11 @@ stages:
- cp "$LTV_DIR"/*.met scripts/testv/
- cp "$LTV_DIR"/*.csv scripts/testv/
.copy-ltv-files-to-testv-dir-win: &copy-ltv-files-to-testv-dir-win
- cp $LTV_DIR_WIN\*.wav scripts\testv
- cp $LTV_DIR_WIN\*.met scripts\testv
- cp $LTV_DIR_WIN\*.csv scripts\testv
.activate-Werror-linux: &activate-Werror-linux
- sed -i.bak "s/^# \(CFLAGS += -Werror\)/\1/" Makefile
- sed -i.bak "s/# \(set(CMAKE_C_FLAGS \"\${CMAKE_C_FLAGS} -Werror\")\)/\1/" CMakeLists.txt
......@@ -379,6 +390,17 @@ branch-is-up-to-date-with-main-pre:
- echo $commits_behind_count
- if [ $commits_behind_count -eq 0 ]; then exit 0; else echo "Your branch is behind main, run 'git merge origin/main' to update."; exit 1; fi;
check-self-test-names-pre:
extends:
- .rules-merge-request
stage: prevalidate
needs: []
tags:
- ivas-linux
script:
- python3 ci/check_self_test_names.py scripts/config/self_test.prm 135
branch-is-up-to-date-with-main-post:
extends:
- .rules-merge-request
......@@ -420,7 +442,7 @@ build-codec-instrumented-linux:
extends:
- .build-job-linux
- .rules-basis
timeout: "7 minutes"
timeout: "10 minutes"
script:
- *print-common-info
- *activate-Werror-linux
......@@ -491,7 +513,6 @@ build-codec-windows-msbuild:
script:
- *print-common-info-windows
- *activate-WX-windows
- python .\scripts\strip_split_rendering.py
- MSBuild.exe -maxcpucount .\Workspace_msvc\Workspace_msvc.sln /property:Configuration=Debug
# ---------------------------------------------------------------
......@@ -789,6 +810,18 @@ split-rendering-smoke-test:
junit:
- report-junit.xml
lc3-wrapper-unit-test:
extends:
- .test-job-linux
- .rules-merge-request
needs: ["build-codec-linux-cmake"]
stage: test
script:
- *enable-split-rendering
- cmake -B cmake-build -G "Unix Makefiles" -DCOPY_EXECUTABLES_FROM_BUILD_DIR=true
- cmake --build cmake-build -- -j
- scripts/split_rendering/lc3plus/ivas_lc3plus_unit_test
# compare split-rendering bitexactness between target and source branch
split-rendering-pytest-on-merge-request:
extends:
......@@ -1337,45 +1370,46 @@ ivas-conformance:
tags:
- ivas-windows
stage: test
timeout: "60 minutes"
timeout: "90 minutes"
rules:
- if: ($CI_PIPELINE_SOURCE == 'web' || $CI_PIPELINE_SOURCE == 'trigger') && $MANUAL_PIPELINE_TYPE == 'ivas-conformance'
- if: $CI_PIPELINE_SOURCE == 'push' && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
allow_failure:
exit_codes:
- 123
script:
- *print-common-info-windows
# Prepare reference exec, use tests and scripts from reference
- $source_branch_commit_sha = $(git rev-parse HEAD)
- git checkout main # This should be set to a relevant reference
- git pull # Ensure to get the latest version
- python .\scripts\strip_split_rendering.py
- 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
- git restore .
- git checkout $source_branch_commit_sha
# Reference creation
- python tests/create_short_testvectors.py
- python scripts/prepare_combined_format_inputs.py
- python -m pytest tests/codec_be_on_mr_nonselection -v -n auto --update_ref 1 -m create_ref --keep_files
- python -m pytest tests/codec_be_on_mr_nonselection -v -n auto --update_ref 1 -m create_ref_part2 --keep_files
- python -m pytest tests/renderer/test_renderer.py --create_ref --keep_files
- $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 -m create_ref --create_ref --keep_files
- python -m pytest $TEST_SET -v -n auto --update_ref 1 -m create_ref_part2 --keep_files
# Output creation
- python -m pytest tests/codec_be_on_mr_nonselection tests/renderer/test_renderer.py -v -n auto --keep_files --create_cut --html=report_cmd.html --self-contained-html
- python -m pytest $TEST_SET -v -n auto --keep_files --create_cut --html=report_cmd.html --self-contained-html
- python scripts/parse_commands.py report_cmd.html Readme_IVAS.txt
# Copy input data and output ref data
- if (Test-Path testvec) {rm -r -force testvec}
- if (Test-Path TMP_DEC) {rm -r -force TMP_DEC}
- if (Test-Path TMP_ENC) {rm -r -force TMP_ENC}
- if (Test-Path TMP_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}
- mkdir testvec
- mkdir testvec/binauralRenderer_interface
- mkdir testvec/testv
- mkdir testvec/testv/renderer
- mkdir testvec/testv/split_rendering
- mkdir testvec/bin
- cp -r -force -ErrorAction Ignore scripts/testv/* testvec/testv
- cp -force -ErrorAction Ignore scripts/testv/* testvec/testv
- cp -r -force -ErrorAction Ignore scripts/ls_layouts testvec
- cp -r -force -ErrorAction Ignore scripts/switchPaths testvec
- cp -r -force -ErrorAction Ignore scripts/trajectories testvec
......@@ -1383,14 +1417,26 @@ ivas-conformance:
- cp -r -force -ErrorAction Ignore tests/ref testvec/testv/ref
- cp -r -force -ErrorAction Ignore tests/dut/* testvec/testv/ref
- cp -r -force -ErrorAction Ignore tests/renderer/cut testvec/testv/renderer/ref
- cp -r -force -ErrorAction Ignore tests/split_rendering/cut testvec/testv/split_rendering/ref
- cp -r -force -ErrorAction Ignore tests/split_rendering/renderer_configs testvec/testv/split_rendering/renderer_configs
- cp -r -force -ErrorAction Ignore tests/split_rendering/error_patterns testvec/testv/split_rendering/error_patterns
# Remove redundant files
- 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_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.exe testvec/bin
- cp IVAS_dec.exe testvec/bin
- cp IVAS_rend.exe testvec/bin
- cp ISAR_post_rend.exe testvec/bin
# Test run generated scripts in testvec
- cd testvec
......@@ -1409,6 +1455,8 @@ ivas-conformance:
- Readme_IVAS_enc.txt
- Readme_IVAS_rend.txt
- Readme_IVAS_JBM_dec.txt
- Readme_IVAS_ISAR_dec.txt
- Readme_IVAS_ISAR_post_rend.txt
expose_as: "Draft IVAS conformance"
reports:
junit: report-junit.xml
......@@ -1417,7 +1465,7 @@ ivas-conformance-linux:
tags:
- ivas-linux
stage: test
timeout: "60 minutes"
timeout: "90 minutes"
rules:
- if: ($CI_PIPELINE_SOURCE == 'web' || $CI_PIPELINE_SOURCE == 'trigger') && $MANUAL_PIPELINE_TYPE == 'ivas-conformance-linux'
allow_failure:
......@@ -1425,26 +1473,20 @@ ivas-conformance-linux:
- 123
script:
- *print-common-info
# Prepare reference exec, use tests and scripts from reference
- source_branch_commit_sha=$(git rev-parse HEAD)
- git checkout main # This should be set to a relevant reference
- make -j
- cp IVAS_cod IVAS_cod_ref
- cp IVAS_dec IVAS_dec_ref
- cp IVAS_rend IVAS_rend_ref
- git restore .
- git checkout $source_branch_commit_sha
# Reference creation
- python3 tests/create_short_testvectors.py
- python3 scripts/prepare_combined_format_inputs.py
- python3 -m pytest tests/codec_be_on_mr_nonselection -v -n auto --update_ref 1 -m create_ref --keep_files
- python3 -m pytest tests/codec_be_on_mr_nonselection -v -n auto --update_ref 1 -m create_ref_part2 --keep_files
- python3 -m pytest tests/renderer/test_renderer.py --create_ref --keep_files
- 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 -m create_ref --create_ref --keep_files
- python3 -m pytest $TEST_SET -v -n auto --update_ref 1 -m create_ref_part2 --keep_files
# Output creation
- python3 -m pytest tests/codec_be_on_mr_nonselection tests/renderer/test_renderer.py -v -n auto --keep_files --create_cut --html=report_cmd.html --self-contained-html
- python3 -m pytest $TEST_SET -v -n auto --keep_files --create_cut --html=report_cmd.html --self-contained-html
- python3 scripts/parse_commands.py report_cmd.html Readme_IVAS.txt
# Copy input data and output ref data
......@@ -1453,6 +1495,7 @@ ivas-conformance-linux:
- mkdir testvec/binauralRenderer_interface
- mkdir testvec/testv
- mkdir testvec/testv/renderer
- mkdir testvec/testv/split_rendering
- mkdir testvec/bin
- cp -r scripts/testv/* testvec/testv
- cp -r scripts/ls_layouts testvec
......@@ -1462,32 +1505,65 @@ ivas-conformance-linux:
- cp -r tests/ref testvec/testv/ref
- cp -r tests/dut/* testvec/testv/ref
- cp -r tests/renderer/cut testvec/testv/renderer/ref
- cp -r tests/split_rendering/cut testvec/testv/split_rendering/ref
- cp -r tests/split_rendering/renderer_configs testvec/testv/split_rendering/renderer_configs
- cp -r tests/split_rendering/error_patterns testvec/testv/split_rendering/error_patterns
# Remove redundant files
- 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_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
# 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
# Test run generated scripts in testvec
- cd testvec
- python3 -m pytest conformance-test/test_26252.py --junit-xml=report-junit.xml --html=report.html --self-contained-html
- exit_code=0
- python3 -m pytest 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"
# Check for failures
- if [ $exit_code -eq 1 ]; then echo "Test failures encountered"; exit $EXIT_CODE_FAIL; fi
artifacts:
name: "ivas-conformance-linux-$CI_COMMIT_SHORT_SHA"
expire_in: 1 week
when: always
paths:
- report_cmd.html
- report-junit.xml
- report.html
- 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
expose_as: "Draft IVAS conformance -- Linux"
reports:
junit: report-junit.xml
......@@ -1574,7 +1650,7 @@ ltv-msan:
- .sanitizer-selftest-ltv
rules:
- if: $SANITIZER_SCHEDULE_E
timeout: 2 hour
timeout: 3 hour
tags:
- ivas-linux-fast
before_script:
......@@ -1590,10 +1666,10 @@ ltv-asan:
rules:
- if: $SANITIZER_SCHEDULE_E
when: delayed
start_in: 2 hours
start_in: 3 hours
tags:
- ivas-linux-fast
timeout: 2 hour
timeout: 3 hour
before_script:
- CLANG_NUM=2
- SELFTEST_SANITY_TIMEOUT=$TESTCASE_TIMEOUT_LTV_SANITIZERS
......@@ -1607,10 +1683,10 @@ ltv-usan:
rules:
- if: $SANITIZER_SCHEDULE_E
when: delayed
start_in: 3 hours
start_in: 6 hours
tags:
- ivas-linux-fast
timeout: 2 hour
timeout: 3 hour
before_script:
- CLANG_NUM=3
- SELFTEST_SANITY_TIMEOUT=$TESTCASE_TIMEOUT_LTV_SANITIZERS
......
......@@ -27,14 +27,12 @@
# # or build on command line, e.g.:
# cmake --build . --config Debug
# cmake --build . --config Release
#
# INCLUDE_SPLIT is not set by default. If split rendering is used, then add -D INCLUDE_SPLIT=1 to the build command
cmake_minimum_required(VERSION 3.1)
set(CMAKE_C_STANDARD 99)
# configuration options for UNIX
if(UNIX)
set(TARGET_PLATFORM "" CACHE STRING "i686 / x86_64")
......@@ -115,11 +113,6 @@ elseif(WIN32)
-D_CRT_SECURE_NO_WARNINGS
/MP
)
if(NOT INCLUDE_SPLIT)
add_compile_options("/W4")
# to be uncommented in CI
# add_compile_options("/WX")
endif()
endif()
# configuration options for all platforms
......@@ -138,87 +131,61 @@ add_library(lib_com ${libComSrcs} ${libComHeaders})
if(UNIX)
target_link_libraries(lib_com PRIVATE m)
endif()
target_include_directories(lib_com PUBLIC lib_com PRIVATE lib_enc lib_dec lib_rend lib_debug)
if(INCLUDE_SPLIT)
target_include_directories(lib_com PUBLIC lib_com PRIVATE lib_enc lib_dec lib_rend lib_debug lib_isar)
target_include_directories(lib_com PRIVATE lib_lc3plus)
endif()
file(GLOB libDebugSrcs "lib_debug/*.c")
file(GLOB libDebugHeaders "lib_debug/*.h")
add_library(lib_debug ${libDebugSrcs} ${libDebugHeaders})
target_link_libraries(lib_debug lib_com)
target_include_directories(lib_debug PUBLIC lib_debug PRIVATE lib_enc lib_dec lib_rend)
target_include_directories(lib_debug PUBLIC lib_debug PRIVATE lib_enc lib_dec lib_rend lib_isar)
file(GLOB libEncSrcs "lib_enc/*.c")
file(GLOB libEncHeaders "lib_enc/*.h")
add_library(lib_enc ${libEncSrcs} ${libEncHeaders})
target_link_libraries(lib_enc lib_com lib_debug)
target_include_directories(lib_enc PUBLIC lib_enc PRIVATE lib_dec lib_rend)
if(INCLUDE_SPLIT)
target_include_directories(lib_enc PUBLIC lib_enc PRIVATE lib_dec lib_rend lib_isar)
target_include_directories(lib_enc PRIVATE lib_lc3plus)
endif()
if(INCLUDE_SPLIT)
file(GLOB libLC3plusSrcs "lib_lc3plus/*.c")
file(GLOB libLC3plusHeaders "lib_lc3plus/*.h")
add_library(lib_lc3plus ${libLC3plusSrcs} ${libLC3plusHeaders})
target_include_directories(lib_lc3plus PUBLIC lib_lc3plus)
target_link_libraries(lib_lc3plus lib_com) # For including options.h, which is needed for instrumentation to work correctly
if(WMOPS)
target_link_libraries(lib_lc3plus lib_debug)
endif()
endif()
target_include_directories(lib_lc3plus PUBLIC lib_lc3plus PRIVATE lib_com lib_debug)
file(GLOB libRendSrcs "lib_rend/*.c")
file(GLOB libRendHeaders "lib_rend/*.h")
if(NOT INCLUDE_SPLIT)
list(FILTER libRendSrcs EXCLUDE REGEX ".*lib_rend\/.*lc3plus.*\.c$")
list(FILTER libRendSrcs EXCLUDE REGEX ".*lib_rend\/.*ivas_cldfb_codec.*\.c$")
list(FILTER libRendSrcs EXCLUDE REGEX ".*lib_rend\/.*splitRend.*\.c$")
list(FILTER libRendSrcs EXCLUDE REGEX ".*lib_rend\/.*splitrenderer.*\.c$")
list(FILTER libRendSrcs EXCLUDE REGEX ".*lib_rend\/.*ivas_lcld.*\.c$")
list(FILTER libRendSrcs EXCLUDE REGEX ".*lib_rend\/.*ivas_Pred.*\.c$")
list(FILTER libRendSrcs EXCLUDE REGEX ".*lib_rend\/.*ivas_RMSEnv.*\.c$")
list(FILTER libRendSrcs EXCLUDE REGEX ".*lib_rend\/.*ivas_PerceptualModel.*\.c$")
list(FILTER libRendSrcs EXCLUDE REGEX ".*lib_rend\/.*ivas_lcld_rom_tables.*\.c$")
list(FILTER libRendHeaders EXCLUDE REGEX ".*lib_rend\/.*lc3plus.*\.h$")
list(FILTER libRendHeaders EXCLUDE REGEX ".*lib_rend\/.*splitRend.*\.h$")
list(FILTER libRendHeaders EXCLUDE REGEX ".*lib_rend\/.*ivas_cldfb_codec.*\.h$")
list(FILTER libRendHeaders EXCLUDE REGEX ".*lib_rend\/.*ivas_lcld_rom_tables.*\.h$")
endif()
add_library(lib_rend ${libRendSrcs} ${libRendHeaders})
target_link_libraries(lib_rend lib_dec lib_com lib_debug) # Todo refactor: This dependency on lib_dec should be removed.
if(INCLUDE_SPLIT)
target_link_libraries(lib_rend lib_lc3plus)
endif()
target_include_directories(lib_rend PUBLIC lib_rend PRIVATE lib_enc)
target_link_libraries(lib_rend lib_lc3plus lib_isar)
target_include_directories(lib_rend PUBLIC lib_rend PRIVATE lib_enc lib_isar)
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)
target_include_directories(lib_dec PUBLIC lib_dec lib_rend PRIVATE lib_enc)
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)
file(GLOB libUtilSrcs "lib_util/*.c")
file(GLOB libUtilHeaders "lib_util/*.h")
if(NOT INCLUDE_SPLIT)
list(FILTER libUtilSrcs EXCLUDE REGEX ".*lib_util\/.*split_rend.*\.c$")
endif()
add_library(lib_util ${libUtilSrcs} ${libUtilHeaders})
target_include_directories(lib_util PUBLIC lib_util PRIVATE lib_com lib_enc lib_dec lib_rend lib_debug)
if(INCLUDE_SPLIT)
target_include_directories(lib_util PRIVATE lib_lc3plus)
endif()
target_include_directories(lib_util PRIVATE lib_lc3plus lib_isar)
if(INCLUDE_SPLIT)
if(NOT WMOPS)
add_executable(ivas_lc3plus_unit_test ${CMAKE_SOURCE_DIR}/scripts/split_rendering/lc3plus/ivas_lc3plus_unit_test.c)
target_link_libraries(ivas_lc3plus_unit_test lib_rend lib_dec lib_util lib_com lib_debug)
endif()
target_link_libraries(ivas_lc3plus_unit_test lib_rend lib_dec lib_util lib_com lib_debug lib_isar)
endif()
file(GLOB libISARSrcs "lib_isar/*.c")
file(GLOB libISARHeaders "lib_isar/*.h")
add_library(lib_isar ${libISARSrcs} ${libISARHeaders})
target_link_libraries(lib_isar lib_com lib_debug lib_lc3plus) # Todo refactor: This dependency on lib_dec should be removed.
target_include_directories(lib_isar PUBLIC lib_isar PRIVATE lib_enc lib_dec lib_rend)
add_executable(IVAS_cod apps/encoder.c)
target_link_libraries(IVAS_cod lib_enc lib_util)
if(WIN32)
......@@ -232,20 +199,23 @@ if(WIN32)
endif()
add_executable(IVAS_rend apps/renderer.c)
target_link_libraries(IVAS_rend lib_rend lib_util)
target_link_libraries(IVAS_rend lib_rend lib_util lib_isar)
target_include_directories(IVAS_rend PRIVATE lib_enc)
add_executable(ISAR_post_rend apps/isar_post_rend.c)
target_link_libraries(ISAR_post_rend lib_isar lib_util)
target_include_directories(ISAR_post_rend PRIVATE lib_isar)
if(COPY_EXECUTABLES_FROM_BUILD_DIR)
# Optionally copy executables to the same place where Make puts them (useful for tests that expect executables in specific places)
add_custom_command(TARGET IVAS_cod POST_BUILD VERBATIM COMMAND "${CMAKE_COMMAND}" -E copy "$<TARGET_FILE:IVAS_cod>" "${CMAKE_CURRENT_SOURCE_DIR}/")
add_custom_command(TARGET IVAS_dec POST_BUILD VERBATIM COMMAND "${CMAKE_COMMAND}" -E copy "$<TARGET_FILE:IVAS_dec>" "${CMAKE_CURRENT_SOURCE_DIR}/")
add_custom_command(TARGET IVAS_rend POST_BUILD VERBATIM COMMAND "${CMAKE_COMMAND}" -E copy "$<TARGET_FILE:IVAS_rend>" "${CMAKE_CURRENT_SOURCE_DIR}/")
if(INCLUDE_SPLIT)
add_custom_command(TARGET ISAR_post_rend POST_BUILD VERBATIM COMMAND "${CMAKE_COMMAND}" -E copy "$<TARGET_FILE:ISAR_post_rend>" "${CMAKE_CURRENT_SOURCE_DIR}/")
if (NOT WMOPS)
add_custom_command(TARGET ivas_lc3plus_unit_test POST_BUILD VERBATIM COMMAND "${CMAKE_COMMAND}" -E copy "$<TARGET_FILE:ivas_lc3plus_unit_test>" "${CMAKE_CURRENT_SOURCE_DIR}/scripts/split_rendering/lc3plus")
endif()
endif()
endif()
# Allow creating packages for CMake install
install(TARGETS lib_enc lib_dec lib_rend lib_com lib_util ARCHIVE DESTINATION lib)
......@@ -6,26 +6,30 @@ SRC_LIBDEBUG = lib_debug
SRC_LIBDEC = lib_dec
SRC_LIBENC = lib_enc
SRC_LIBREND = lib_rend
SRC_LIBISAR = lib_isar
SRC_LC3PLUS = lib_lc3plus lib_lc3plus/fft
SRC_LIBUTIL = lib_util
SRC_APP = apps
BUILD = build
OBJDIR = obj
SRC_DIRS = $(sort -u $(SRC_LIBCOM) $(SRC_LIBDEBUG) $(SRC_LIBDEC) $(SRC_LIBENC) $(SRC_LIBREND) $(SRC_LC3PLUS) $(SRC_LIBUTIL) $(SRC_APP))
SRC_DIRS = $(sort -u $(SRC_LIBCOM) $(SRC_LIBDEBUG) $(SRC_LIBDEC) $(SRC_LIBENC) $(SRC_LIBREND) $(SRC_LIBISAR) $(SRC_LC3PLUS) $(SRC_LIBUTIL) $(SRC_APP))
# Name of CLI binaries
CLI_APIDEC ?= IVAS_dec
CLI_APIENC ?= IVAS_cod
CLI_APIREND ?= IVAS_rend
CLI_APIPOSTREND ?= ISAR_post_rend
LIB_LIBCOM ?= libivascom.a
LIB_LIBDEBUG ?= libivasdebug.a
LIB_LIBDEC ?= libivasdec.a
LIB_LIBENC ?= libivasenc.a
LIB_LIBREND ?= libivasrend.a
LIB_LIBISAR ?= libisar.a
LIB_LC3PLUS ?= liblc3plus.a
LIB_LIBUTIL ?= libivasutil.a
# Default tool settings
CC ?= gcc
RM ?= rm -f
......@@ -135,32 +139,31 @@ SRCS_LIBDEC = $(foreach DIR,$(SRC_LIBDEC),$(patsubst $(DIR)/%,%,$(wildcard $(D
SRCS_LIBENC = $(foreach DIR,$(SRC_LIBENC),$(patsubst $(DIR)/%,%,$(wildcard $(DIR)/*.c)))
SRCS_LIBREND = $(foreach DIR,$(SRC_LIBREND),$(patsubst $(DIR)/%,%,$(wildcard $(DIR)/*.c)))
SRCS_LIBUTIL = $(foreach DIR,$(SRC_LIBUTIL),$(patsubst $(DIR)/%,%,$(wildcard $(DIR)/*.c)))
ifeq "$(INCLUDE_SPLIT)" "1"
SRCS_LIBISAR = $(foreach DIR,$(SRC_LIBISAR),$(patsubst $(DIR)/%,%,$(wildcard $(DIR)/*.c)))
SRCS_LC3PLUS = $(foreach DIR,$(SRC_LC3PLUS),$(patsubst $(DIR)/%,%,$(wildcard $(DIR)/*.c)))
else
SRCS_LIBREND := $(filter-out $(SRCS_SPLIT_REND),$(SRCS_LIBREND))
SRCS_LIBUTIL := $(filter-out $(SRCS_SPLIT_REND),$(SRCS_LIBUTIL))
endif
OBJS_LIBCOM = $(addprefix $(OBJDIR)/,$(SRCS_LIBCOM:.c=.o))
OBJS_LIBDEBUG = $(addprefix $(OBJDIR)/,$(SRCS_LIBDEBUG:.c=.o))
OBJS_LIBDEC = $(addprefix $(OBJDIR)/,$(SRCS_LIBDEC:.c=.o))
OBJS_LIBENC = $(addprefix $(OBJDIR)/,$(SRCS_LIBENC:.c=.o))
OBJS_LIBREND = $(addprefix $(OBJDIR)/,$(SRCS_LIBREND:.c=.o))
OBJS_LIBISAR = $(addprefix $(OBJDIR)/,$(SRCS_LIBISAR:.c=.o))
OBJS_LC3PLUS = $(addprefix $(OBJDIR)/,$(SRCS_LC3PLUS:.c=.o))
OBJS_LIBUTIL = $(addprefix $(OBJDIR)/,$(SRCS_LIBUTIL:.c=.o))
OBJS_CLI_APIDEC = $(OBJDIR)/decoder.o
OBJS_CLI_APIENC = $(OBJDIR)/encoder.o
OBJS_CLI_APPREND = $(OBJDIR)/renderer.o
OBJS_CLI_APPPOSTREND = $(OBJDIR)/isar_post_rend.o
DEPS = $(addprefix $(OBJDIR)/,$(SRCS_LIBCOM:.c=.P) $(SRCS_LIBDEBUG:.c=.P) $(SRCS_LIBDEC:.c=.P) \
$(SRCS_LIBENC:.c=.P) $(SRCS_LIBUTIL:.c=.P) $(SRCS_LIBREND:.c=.P) $(SRCS_LC3PLUS:.c=.P))
$(SRCS_LIBENC:.c=.P) $(SRCS_LIBUTIL:.c=.P) $(SRCS_LIBREND:.c=.P) $(SRCS_LIBISAR:.c=.P) \
$(SRCS_LC3PLUS:.c=.P))
###############################################################################
.PHONY: all clean
all: $(CLI_APIENC) $(CLI_APIDEC) $(CLI_APIREND)
all: $(CLI_APIENC) $(CLI_APIDEC) $(CLI_APIREND) $(CLI_APIPOSTREND)
$(OBJDIR):
$(QUIET)mkdir -p $(OBJDIR)
......@@ -168,24 +171,23 @@ $(OBJDIR):
$(LIB_LIBCOM): $(OBJS_LIBCOM)
$(QUIET_AR)$(AR) rcs $@ $^
$(LIB_LIBDEC): $(OBJS_LIBDEC) $(OBJS_LIBREND)
$(LIB_LIBDEC): $(OBJS_LIBDEC) $(OBJS_LIBREND) $(OBJS_LIBISAR)
$(QUIET_AR)$(AR) rcs $@ $^
$(LIB_LIBDEBUG): $(OBJS_LIBDEBUG)
$(QUIET_AR)$(AR) rcs $@ $^
$(LIB_LIBISAR): $(OBJS_LIBISAR)
$(QUIET_AR)$(AR) rcs $@ $^
$(LIB_LIBENC): $(OBJS_LIBENC)
$(QUIET_AR)$(AR) rcs $@ $^
$(LIB_LIBREND): $(OBJS_LIBREND)
$(LIB_LIBREND): $(OBJS_LIBREND) $(OBJS_LIBISAR)
$(QUIET_AR)$(AR) rcs $@ $^
$(LIB_LC3PLUS): $(OBJS_LC3PLUS)
ifeq "$(INCLUDE_SPLIT)" "1"
$(QUIET_AR)$(AR) rcs $@ $^
else
endif
$(LIB_LIBUTIL): $(OBJS_LIBUTIL)
$(QUIET_AR)$(AR) rcs $@ $^
......@@ -193,27 +195,22 @@ $(LIB_LIBUTIL): $(OBJS_LIBUTIL)
$(CLI_APIENC): $(OBJS_CLI_APIENC) $(LIB_LIBENC) $(LIB_LIBCOM) $(LIB_LIBUTIL) $(LIB_LIBDEBUG) $(LIB_LC3PLUS)
$(QUIET_LINK)$(CC) $(LDFLAGS) $(OBJS_CLI_APIENC) -L. -livasenc -livascom -livasutil -livasdebug $(LDLIBS) -o $(CLI_APIENC)
$(CLI_APIDEC): $(OBJS_CLI_APIDEC) $(LIB_LIBDEC) $(LIB_LIBCOM) $(LIB_LIBUTIL) $(LIB_LIBDEBUG) $(LIB_LC3PLUS)
ifeq "$(INCLUDE_SPLIT)" "1"
$(CLI_APIDEC): $(OBJS_CLI_APIDEC) $(LIB_LIBDEC) $(LIB_LIBCOM) $(LIB_LIBUTIL) $(LIB_LIBDEBUG) $(LIB_LC3PLUS) $(LIB_LIBISAR)
$(QUIET_LINK)$(CC) $(LDFLAGS) $(OBJS_CLI_APIDEC) -L. -livasdec -livascom -livasutil -livasdebug -llc3plus $(LDLIBS) -o $(CLI_APIDEC)
else
$(QUIET_LINK)$(CC) $(LDFLAGS) $(OBJS_CLI_APIDEC) -L. -livasdec -livascom -livasutil -livasdebug $(LDLIBS) -o $(CLI_APIDEC)
endif
$(CLI_APIREND): $(OBJS_CLI_APPREND) $(LIB_LIBREND) $(LIB_LIBCOM) $(LIB_LIBUTIL) $(LIB_LIBDEBUG) $(LIB_LIBDEC) $(LIB_LC3PLUS)
ifeq "$(INCLUDE_SPLIT)" "1"
$(QUIET_LINK)$(CC) $(LDFLAGS) $(OBJS_CLI_APPREND) -L. -livasrend -livasdec -livasutil -livasdebug -livascom -llc3plus $(LDLIBS) -o $(CLI_APIREND)
else
$(QUIET_LINK)$(CC) $(LDFLAGS) $(OBJS_CLI_APPREND) -L. -livasrend -livasdec -livasutil -livasdebug -livascom $(LDLIBS) -o $(CLI_APIREND)
endif
$(CLI_APIREND): $(OBJS_CLI_APPREND) $(LIB_LIBREND) $(LIB_LIBCOM) $(LIB_LIBUTIL) $(LIB_LIBDEBUG) $(LIB_LIBDEC) $(LIB_LC3PLUS) $(LIB_LIBISAR)
$(QUIET_LINK)$(CC) $(LDFLAGS) $(OBJS_CLI_APPREND) -L. -livasrend -lisar -livasdec -livasutil -livasdebug -livascom -llc3plus $(LDLIBS) -o $(CLI_APIREND)
$(CLI_APIPOSTREND): $(OBJS_CLI_APPPOSTREND) $(LIB_LIBISAR) $(LIB_LIBCOM) $(LIB_LIBUTIL) $(LIB_LIBDEBUG) $(LIB_LC3PLUS)
$(QUIET_LINK)$(CC) $(LDFLAGS) $(OBJS_CLI_APPPOSTREND) -L. -lisar -livasutil -livasdebug -livascom -llc3plus $(LDLIBS) -o $(CLI_APIPOSTREND)
libs: $(LIB_LIBENC) $(LIB_LIBDEBUG) $(LIB_LIBCOM) $(LIB_LIBDEC) $(LIB_LIBREND) $(LIB_LC3PLUS) $(LIB_LIBUTIL)
libs: $(LIB_LIBENC) $(LIB_LIBDEBUG) $(LIB_LIBCOM) $(LIB_LIBDEC) $(LIB_LIBREND) $(LIB_LIBISAR) $(LIB_LC3PLUS) $(LIB_LIBUTIL)
clean:
$(QUIET)$(RM) $(OBJS_LIBENC) $(OBJS_LIBDEC) $(DEPS)
$(QUIET)$(RM) $(DEPS:.P=.d)
$(QUIET)test ! -d $(OBJDIR) || rm -rf $(OBJDIR)
$(QUIET)$(RM) $(CLI_APIENC) $(CLI_APIDEC) $(CLI_APIREND) $(LIB_LIBENC) $(LIB_LIBDEBUG) $(LIB_LIBCOM) $(LIB_LIBDEC) $(LIB_LIBUTIL) $(LIB_LIBREND) $(LIB_LC3PLUS)
$(QUIET)$(RM) $(CLI_APIENC) $(CLI_APIDEC) $(CLI_APIREND) $(CLI_APIPOSTREND) $(LIB_LIBENC) $(LIB_LIBDEBUG) $(LIB_LIBCOM) $(LIB_LIBDEC) $(LIB_LIBUTIL) $(LIB_LIBREND) $(LIB_LIBISAR) $(LIB_LC3PLUS)
$(OBJDIR)/%.o : %.c | $(OBJDIR)
$(QUIET_CC)$(CC) $(CFLAGS) -c -MD -o $@ $<
......
......@@ -20,13 +20,17 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "encoder", "encoder.vcxproj"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "renderer", "renderer.vcxproj", "{12B4C8A5-1E06-4E30-B443-D1F916F52B47}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LC3plus", "lib_lc3plus.vcxproj", "{95030B82-70CD-4C6B-84D4-61096035BEA2}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lib_lc3plus", "lib_lc3plus.vcxproj", "{95030B82-70CD-4C6B-84D4-61096035BEA2}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{51160D4C-55C9-4C16-A792-D94507225746}"
ProjectSection(SolutionItems) = preProject
..\.clang-format = ..\.clang-format
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lib_isar", "lib_isar.vcxproj", "{869A305E-D99E-4C3A-BDB3-AA57ABCCE619}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "isar_post_rend", "isar_post_rend.vcxproj", "{12374ADC-0E5C-4FDD-B903-71D572413831}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
......@@ -95,6 +99,18 @@ Global
{95030B82-70CD-4C6B-84D4-61096035BEA2}.Release|Win32.ActiveCfg = Release|Win32
{95030B82-70CD-4C6B-84D4-61096035BEA2}.Release|Win32.Build.0 = Release|Win32
{95030B82-70CD-4C6B-84D4-61096035BEA2}.Release|x64.ActiveCfg = Release|Win32
{869A305E-D99E-4C3A-BDB3-AA57ABCCE619}.Debug|Win32.ActiveCfg = Debug|Win32
{869A305E-D99E-4C3A-BDB3-AA57ABCCE619}.Debug|Win32.Build.0 = Debug|Win32
{869A305E-D99E-4C3A-BDB3-AA57ABCCE619}.Debug|x64.ActiveCfg = Debug|Win32
{869A305E-D99E-4C3A-BDB3-AA57ABCCE619}.Release|Win32.ActiveCfg = Release|Win32
{869A305E-D99E-4C3A-BDB3-AA57ABCCE619}.Release|Win32.Build.0 = Release|Win32
{869A305E-D99E-4C3A-BDB3-AA57ABCCE619}.Release|x64.ActiveCfg = Release|Win32
{12374ADC-0E5C-4FDD-B903-71D572413831}.Debug|Win32.ActiveCfg = Debug|Win32
{12374ADC-0E5C-4FDD-B903-71D572413831}.Debug|Win32.Build.0 = Debug|Win32
{12374ADC-0E5C-4FDD-B903-71D572413831}.Debug|x64.ActiveCfg = Debug|Win32
{12374ADC-0E5C-4FDD-B903-71D572413831}.Release|Win32.ActiveCfg = Release|Win32
{12374ADC-0E5C-4FDD-B903-71D572413831}.Release|Win32.Build.0 = Release|Win32
{12374ADC-0E5C-4FDD-B903-71D572413831}.Release|x64.ActiveCfg = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
......
......@@ -68,7 +68,7 @@
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\lib_dec;..\lib_com;..\lib_util;..\lib_debug;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>..\lib_dec;..\lib_com;..\lib_util;..\lib_debug;..\lib_isar;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;$(Macros);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ExceptionHandling />
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
......@@ -113,7 +113,7 @@
<FavorSizeOrSpeed>Neither</FavorSizeOrSpeed>
<OmitFramePointers>false</OmitFramePointers>
<EnableFiberSafeOptimizations>false</EnableFiberSafeOptimizations>
<AdditionalIncludeDirectories>..\lib_dec;..\lib_com;..\lib_util;..\lib_debug;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>..\lib_dec;..\lib_com;..\lib_util;..\lib_debug;..\lib_isar;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;$(Macros);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<ExceptionHandling />
......@@ -157,6 +157,9 @@
<Project>{e822ddaf-0f5f-4cd0-a694-38ae69de74d3}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
<ProjectReference Include="lib_isar.vcxproj">
<Project>{869a305e-d99e-4c3a-bdb3-aa57abcce619}</Project>
</ProjectReference>
<ProjectReference Include="lib_util.vcxproj">
<Project>{2fa8f384-0775-f3b7-f8c3-85209222fc70}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
......
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectName>isar_post_rend</ProjectName>
<ProjectGuid>{12374ADC-0E5C-4FDD-B903-71D572413831}</ProjectGuid>
<RootNamespace>isar_post_rend</RootNamespace>
<WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v141</PlatformToolset>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v141</PlatformToolset>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>15.0.27428.2015</_ProjectFileVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<OutDir>..\</OutDir>
<IntDir>.\Debug_$(ProjectName)\</IntDir>
<LinkIncremental>false</LinkIncremental>
<GenerateManifest>false</GenerateManifest>
<TargetName>ISAR_post_rend</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>..\</OutDir>
<IntDir>.\Release_$(ProjectName)\</IntDir>
<LinkIncremental>false</LinkIncremental>
<GenerateManifest>false</GenerateManifest>
<TargetName>ISAR_post_rend</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Midl>
<TypeLibraryName>$(IntDir)$(ProjectName).tlb</TypeLibraryName>
<HeaderFileName />
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\lib_com;..\lib_debug;..\lib_util;..\lib_isar;..\lib_lc3plus;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;$(Macros);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ExceptionHandling />
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<PrecompiledHeader />
<PrecompiledHeaderOutputFile />
<ProgramDataBaseFileName>$(IntDir)$(ProjectName).pdb</ProgramDataBaseFileName>
<WarningLevel>Level4</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<DebugInformationFormat>OldStyle</DebugInformationFormat>
<CompileAs>Default</CompileAs>
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
<TreatWarningAsError>false</TreatWarningAsError>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0c0c</Culture>
</ResourceCompile>
<Link>
<AdditionalDependencies />
<OutputFile>$(OutDir)$(TargetName).exe</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<ManifestFile />
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(IntDir)$(ProjectName).pdb</ProgramDatabaseFile>
<SubSystem>Console</SubSystem>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention />
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Midl>
<TypeLibraryName>$(IntDir)$(ProjectName).tlb</TypeLibraryName>
<HeaderFileName />
</Midl>
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
<IntrinsicFunctions>false</IntrinsicFunctions>
<FavorSizeOrSpeed>Neither</FavorSizeOrSpeed>
<OmitFramePointers>false</OmitFramePointers>
<EnableFiberSafeOptimizations>false</EnableFiberSafeOptimizations>
<AdditionalIncludeDirectories>..\lib_com;..\lib_debug;..\lib_util;..\lib_isar;..\lib_lc3plus;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;$(Macros);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<ExceptionHandling />
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<FloatingPointModel>Precise</FloatingPointModel>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<PrecompiledHeader />
<PrecompiledHeaderOutputFile />
<ProgramDataBaseFileName>$(IntDir)$(ProjectName).pdb</ProgramDataBaseFileName>
<WarningLevel>Level4</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<DebugInformationFormat />
<CompileAs>Default</CompileAs>
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
<TreatWarningAsError>false</TreatWarningAsError>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0c0c</Culture>
</ResourceCompile>
<Link>
<OutputFile>$(OutDir)$(TargetName).exe</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<ManifestFile />
<GenerateDebugInformation>false</GenerateDebugInformation>
<ProgramDatabaseFile>$(IntDir)$(ProjectName).pdb</ProgramDatabaseFile>
<SubSystem>Console</SubSystem>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention />
<TargetMachine>MachineX86</TargetMachine>
<IgnoreSpecificDefaultLibraries>libcmtd.lib</IgnoreSpecificDefaultLibraries>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\apps\isar_post_rend.c" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="lib_debug.vcxproj">
<Project>{54509728-928B-44D9-A118-A6F92F08B34F}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
<ProjectReference Include="lib_isar.vcxproj">
<Project>{869a305e-d99e-4c3a-bdb3-aa57abcce619}</Project>
</ProjectReference>
<ProjectReference Include="lib_util.vcxproj">
<Project>{2FA8F384-0775-F3B7-F8C3-85209222FC70}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
<ProjectReference Include="lib_com.vcxproj">
<Project>{39ec200d-7795-4ff8-b214-b24eda5526ae}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
<ProjectExtensions>
<VisualStudio>
<UserProperties DevPartner_IsInstrumented="0" />
</VisualStudio>
</ProjectExtensions>
</Project>
\ No newline at end of file
......@@ -59,7 +59,7 @@
</CustomBuildStep>
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;..\lib_rend;..\lib_lc3plus;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;..\lib_rend;..\lib_isar;..\lib_lc3plus;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;$(Macros);WIN32;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ExceptionHandling />
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
......@@ -95,7 +95,7 @@
<FavorSizeOrSpeed>Neither</FavorSizeOrSpeed>
<OmitFramePointers>false</OmitFramePointers>
<EnableFiberSafeOptimizations>false</EnableFiberSafeOptimizations>
<AdditionalIncludeDirectories>..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;..\lib_rend;..\lib_lc3plus;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;..\lib_isar;..\lib_rend;..\lib_lc3plus;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;$(Macros);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<ExceptionHandling />
......@@ -205,6 +205,7 @@
<ClCompile Include="..\lib_com\ivas_mdct_imdct.c" />
<ClCompile Include="..\lib_com\ivas_mdft_imdft.c" />
<ClCompile Include="..\lib_com\ivas_omasa_com.c" />
<ClCompile Include="..\lib_com\ivas_osba_com.c" />
<ClCompile Include="..\lib_com\ivas_pca_tools.c" />
<ClCompile Include="..\lib_com\ivas_qmetadata_com.c" />
<ClCompile Include="..\lib_com\ivas_qspherical_com.c" />
......@@ -221,6 +222,8 @@
<ClCompile Include="..\lib_com\ivas_stereo_td_bit_alloc.c" />
<ClCompile Include="..\lib_com\ivas_tools.c" />
<ClCompile Include="..\lib_com\ivas_transient_det.c" />
<ClCompile Include="..\lib_com\ivas_rotation_com.c" />
<ClCompile Include="..\lib_com\ivas_limiter.c" />
<ClCompile Include="..\lib_com\lag_wind.c" />
<ClCompile Include="..\lib_com\lerp.c" />
<ClCompile Include="..\lib_com\limit_t0.c" />
......
......@@ -469,6 +469,10 @@
<ClCompile Include="..\lib_com\ivas_lfe_com.c">
<Filter>common_ivas_c</Filter>
</ClCompile>
<ClCompile Include="..\lib_com\ivas_osba_com.c">
<Filter>common_ivas_c</Filter>
</ClCompile>
<ClCompile Include="..\lib_com\ivas_rotation_com.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\lib_com\basop_proto_func.h">
......
......@@ -68,7 +68,7 @@
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;..\lib_rend;..\lib_lc3plus;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;..\lib_isar;..\lib_rend;..\lib_lc3plus;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;$(Macros);WIN32;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ExceptionHandling />
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
......@@ -109,7 +109,7 @@
<FavorSizeOrSpeed>Neither</FavorSizeOrSpeed>
<OmitFramePointers>false</OmitFramePointers>
<EnableFiberSafeOptimizations>false</EnableFiberSafeOptimizations>
<AdditionalIncludeDirectories>..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;..\lib_rend;..\lib_lc3plus;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;..\lib_isar;..\lib_rend;..\lib_lc3plus;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;$(Macros);WIN32;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<ExceptionHandling />
......
......@@ -68,7 +68,7 @@
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;..\lib_rend;..\lib_lc3plus;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;..\lib_rend;..\lib_isar;..\lib_lc3plus;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;$(Macros);WIN32;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ExceptionHandling />
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
......@@ -112,7 +112,7 @@
<FavorSizeOrSpeed>Neither</FavorSizeOrSpeed>
<OmitFramePointers>false</OmitFramePointers>
<EnableFiberSafeOptimizations>false</EnableFiberSafeOptimizations>
<AdditionalIncludeDirectories>..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;..\lib_rend;..\lib_lc3plus;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;..\lib_rend;..\lib_isar;..\lib_lc3plus;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;$(Macros);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<ExceptionHandling />
......
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectName>lib_isar</ProjectName>
<ProjectGuid>{869A305E-D99E-4C3A-BDB3-AA57ABCCE619}</ProjectGuid>
<RootNamespace>evs_dec</RootNamespace>
<WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<PlatformToolset>v141</PlatformToolset>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<PlatformToolset>v141</PlatformToolset>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>15.0.27428.2015</_ProjectFileVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<OutDir>.\Debug_$(ProjectName)\</OutDir>
<IntDir>.\Debug_$(ProjectName)\</IntDir>
<LinkIncremental>false</LinkIncremental>
<GenerateManifest>false</GenerateManifest>
<TargetName>libivasrend</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>.\Release_$(ProjectName)\</OutDir>
<IntDir>.\Release_$(ProjectName)\</IntDir>
<LinkIncremental>false</LinkIncremental>
<GenerateManifest>false</GenerateManifest>
<TargetName>libivasrend</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<CustomBuildStep>
<Message />
</CustomBuildStep>
<Midl>
<TypeLibraryName>.\Debug\$(ProjectName).tlb</TypeLibraryName>
<HeaderFileName />
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;..\lib_rend;..\lib_isar;..\lib_lc3plus;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;$(Macros);WIN32;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ExceptionHandling />
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<PrecompiledHeader />
<PrecompiledHeaderOutputFile />
<ProgramDataBaseFileName>$(IntDir)$(ProjectName).pdb</ProgramDataBaseFileName>
<WarningLevel>Level4</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<DebugInformationFormat>OldStyle</DebugInformationFormat>
<CompileAs>Default</CompileAs>
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
<TreatWarningAsError>false</TreatWarningAsError>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0c0c</Culture>
</ResourceCompile>
<Lib>
<AdditionalDependencies>WS2_32.lib; %(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(TargetName).lib</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<CustomBuildStep>
<Message />
</CustomBuildStep>
<Midl>
<TypeLibraryName>$(IntDir)$(ProjectName).tlb</TypeLibraryName>
<HeaderFileName />
</Midl>
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
<IntrinsicFunctions>false</IntrinsicFunctions>
<FavorSizeOrSpeed>Neither</FavorSizeOrSpeed>
<OmitFramePointers>false</OmitFramePointers>
<EnableFiberSafeOptimizations>false</EnableFiberSafeOptimizations>
<AdditionalIncludeDirectories>..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;..\lib_rend;..\lib_isar;..\lib_lc3plus;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;$(Macros);WIN32;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<ExceptionHandling />
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<PrecompiledHeader />
<PrecompiledHeaderOutputFile />
<ProgramDataBaseFileName>$(IntDir)$(ProjectName).pdb</ProgramDataBaseFileName>
<WarningLevel>Level4</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<DebugInformationFormat />
<CompileAs>Default</CompileAs>
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
<TreatWarningAsError>false</TreatWarningAsError>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0c0c</Culture>
</ResourceCompile>
<Lib>
<AdditionalDependencies>WS2_32.lib; %(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(TargetName).lib</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
</Lib>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\lib_isar\isar_lcld_decoder.c" />
<ClCompile Include="..\lib_isar\isar_lcld_encoder.c" />
<ClCompile Include="..\lib_isar\isar_rom_lcld_tables.c" />
<ClCompile Include="..\lib_isar\isar_splitRend_lcld_enc.c" />
<ClCompile Include="..\lib_isar\isar_splitRend_lcld_dec.c" />
<ClCompile Include="..\lib_isar\isar_lc3plus_common.c" />
<ClCompile Include="..\lib_isar\isar_lc3plus_dec.c" />
<ClCompile Include="..\lib_isar\isar_lc3plus_enc.c" />
<ClCompile Include="..\lib_isar\isar_lc3plus_payload.c" />
<ClCompile Include="..\lib_isar\isar_MSPred.c" />
<ClCompile Include="..\lib_isar\isar_NoiseGen.c" />
<ClCompile Include="..\lib_isar\isar_PerceptualModel.c" />
<ClCompile Include="..\lib_isar\isar_PredDecoder.c" />
<ClCompile Include="..\lib_isar\isar_PredEncoder.c" />
<ClCompile Include="..\lib_isar\isar_RMSEnvGrouping.c" />
<ClCompile Include="..\lib_isar\isar_splitRendererPre.c" />
<ClCompile Include="..\lib_isar\isar_splitRendererPost.c" />
<ClCompile Include="..\lib_isar\isar_splitRenderer_utils.c" />
<ClCompile Include="..\lib_isar\isar_splitRendererPLC.c" />
<ClCompile Include="..\lib_isar\isar_rom_post_rend.c" />
<ClCompile Include="..\lib_isar\lib_isar_post_rend.c" />
<ClCompile Include="..\lib_isar\lib_isar_pre_rend.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\lib_isar\isar_lcld_prot.h" />
<ClInclude Include="..\lib_isar\isar_prot.h" />
<ClInclude Include="..\lib_isar\isar_stat.h" />
<ClInclude Include="..\lib_isar\isar_cnst.h" />
<ClInclude Include="..\lib_isar\isar_rom_lcld_tables.h" />
<ClInclude Include="..\lib_isar\isar_lc3plus_common.h" />
<ClInclude Include="..\lib_isar\isar_lc3plus_dec.h" />
<ClInclude Include="..\lib_isar\isar_lc3plus_enc.h" />
<ClInclude Include="..\lib_isar\isar_lc3plus_payload.h" />
<ClInclude Include="..\lib_isar\isar_rom_post_rend.h" />
<ClInclude Include="..\lib_isar\lib_isar_post_rend.h" />
<ClInclude Include="..\lib_isar\lib_isar_pre_rend.h" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="lib_com.vcxproj">
<Project>{39ec200d-7795-4ff8-b214-b24eda5526ae}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
<ProjectReference Include="lib_debug.vcxproj">
<Project>{54509728-928b-44d9-a118-a6f92f08b34f}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
<ProjectReference Include="lib_lc3plus.vcxproj">
<Project>{95030B82-70CD-4C6B-84D4-61096035BEA2}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
<ProjectExtensions>
<VisualStudio>
<UserProperties DevPartner_IsInstrumented="0" />
</VisualStudio>
</ProjectExtensions>
</Project>
......@@ -65,7 +65,7 @@
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<AdditionalIncludeDirectories>..\lib_com;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>..\lib_com;..\lib_debug;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<Optimization>Disabled</Optimization>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
......@@ -84,7 +84,7 @@
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<AdditionalIncludeDirectories>..\lib_com;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>..\lib_com;..\lib_debug;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<Optimization>MaxSpeed</Optimization>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
......
......@@ -68,7 +68,7 @@
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;..\lib_lc3plus;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;..\lib_isar;..\lib_lc3plus;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;$(Macros);WIN32;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ExceptionHandling />
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
......@@ -109,7 +109,7 @@
<FavorSizeOrSpeed>Neither</FavorSizeOrSpeed>
<OmitFramePointers>false</OmitFramePointers>
<EnableFiberSafeOptimizations>false</EnableFiberSafeOptimizations>
<AdditionalIncludeDirectories>..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;..\lib_lc3plus;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;..\lib_isar;..\lib_lc3plus;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;$(Macros);WIN32;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<ExceptionHandling />
......@@ -144,30 +144,11 @@
<ClCompile Include="..\lib_rend\ivas_dirac_output_synthesis_dec.c" />
<ClCompile Include="..\lib_rend\ivas_dirac_rend.c" />
<ClCompile Include="..\lib_rend\ivas_hrtf.c" />
<ClCompile Include="..\lib_rend\ivas_lc3plus_common.c" />
<ClCompile Include="..\lib_rend\ivas_lc3plus_dec.c" />
<ClCompile Include="..\lib_rend\ivas_lc3plus_enc.c" />
<ClCompile Include="..\lib_rend\ivas_lcld_decoder.c" />
<ClCompile Include="..\lib_rend\ivas_lcld_encoder.c" />
<ClCompile Include="..\lib_rend\ivas_lcld_rom_tables.c" />
<ClCompile Include="..\lib_rend\ivas_sba_rendering.c" />
<ClCompile Include="..\lib_rend\ivas_allrad_dec.c" />
<ClCompile Include="..\lib_rend\ivas_MSPred.c" />
<ClCompile Include="..\lib_rend\ivas_NoiseGen.c" />
<ClCompile Include="..\lib_rend\ivas_PerceptualModel.c" />
<ClCompile Include="..\lib_rend\ivas_PredDecoder.c" />
<ClCompile Include="..\lib_rend\ivas_PredEncoder.c" />
<ClCompile Include="..\lib_rend\ivas_RMSEnvGrouping.c" />
<ClCompile Include="..\lib_rend\ivas_splitRendererPre.c" />
<ClCompile Include="..\lib_rend\ivas_splitRendererPost.c" />
<ClCompile Include="..\lib_rend\ivas_splitRenderer_utils.c" />
<ClCompile Include="..\lib_rend\ivas_splitRend_lcld_enc.c" />
<ClCompile Include="..\lib_rend\ivas_splitRend_lcld_dec.c" />
<ClCompile Include="..\lib_rend\ivas_splitRendererPLC.c" />
<ClCompile Include="..\lib_rend\ivas_crend.c" />
<ClCompile Include="..\lib_rend\ivas_dirac_ana.c" />
<ClCompile Include="..\lib_rend\ivas_efap.c" />
<ClCompile Include="..\lib_rend\ivas_limiter.c" />
<ClCompile Include="..\lib_rend\ivas_masa_merge.c" />
<ClCompile Include="..\lib_rend\ivas_mcmasa_ana.c" />
<ClCompile Include="..\lib_rend\ivas_objectRenderer.c" />
......@@ -198,8 +179,6 @@
<ClCompile Include="..\lib_rend\lib_rend.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\lib_rend\ivas_lcld_prot.h" />
<ClInclude Include="..\lib_rend\ivas_lcld_rom_tables.h" />
<ClInclude Include="..\lib_rend\ivas_prot_rend.h" />
<ClInclude Include="..\lib_rend\ivas_rom_binauralRenderer.h" />
<ClInclude Include="..\lib_rend\ivas_rom_binaural_crend_head.h" />
......@@ -207,9 +186,6 @@
<ClInclude Include="..\lib_rend\ivas_rom_TdBinauralRenderer.h" />
<ClInclude Include="..\lib_rend\ivas_stat_rend.h" />
<ClInclude Include="..\lib_rend\lib_rend.h" />
<ClInclude Include="..\lib_rend\ivas_lc3plus_common.h" />
<ClInclude Include="..\lib_rend\ivas_lc3plus_dec.h" />
<ClInclude Include="..\lib_rend\ivas_lc3plus_enc.h" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="lib_com.vcxproj">
......
......@@ -55,7 +55,7 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;..\lib_rend;..\lib_util;..\lib_lc3plus;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;..\lib_isar;..\lib_rend;..\lib_util;..\lib_lc3plus;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;$(Macros);ZLIB_WINAPI;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>false</MinimalRebuild>
<ExceptionHandling />
......@@ -79,7 +79,7 @@
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
<IntrinsicFunctions>false</IntrinsicFunctions>
<WholeProgramOptimization>false</WholeProgramOptimization>
<AdditionalIncludeDirectories>..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;..\lib_rend;..\lib_util;..\lib_lc3plus;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;..\lib_isar;..\lib_rend;..\lib_util;..\lib_lc3plus;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;$(Macros);ZLIB_WINAPI;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<ExceptionHandling />
......
......@@ -65,7 +65,7 @@
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\lib_com;..\lib_debug;..\lib_util;..\lib_rend;..\lib_lc3plus;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>..\lib_com;..\lib_debug;..\lib_util;..\lib_isar;..\lib_rend;..\lib_lc3plus;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;$(Macros);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ExceptionHandling />
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
......@@ -110,7 +110,7 @@
<FavorSizeOrSpeed>Neither</FavorSizeOrSpeed>
<OmitFramePointers>false</OmitFramePointers>
<EnableFiberSafeOptimizations>false</EnableFiberSafeOptimizations>
<AdditionalIncludeDirectories>..\lib_com;..\lib_debug;..\lib_util;..\lib_rend;..\lib_lc3plus;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>..\lib_com;..\lib_debug;..\lib_util;..\lib_isar;..\lib_rend;..\lib_lc3plus;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;$(Macros);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<ExceptionHandling />
......@@ -158,6 +158,9 @@
<Project>{E822DDAF-0F5F-4CD0-A694-38AE69DE74D3}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
<ProjectReference Include="lib_isar.vcxproj">
<Project>{869a305e-d99e-4c3a-bdb3-aa57abcce619}</Project>
</ProjectReference>
<ProjectReference Include="lib_util.vcxproj">
<Project>{2FA8F384-0775-F3B7-F8C3-85209222FC70}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
......
......@@ -90,6 +90,17 @@ static
* Local structure for storing cmdln arguments
*------------------------------------------------------------------------------------------*/
#ifdef FIX_1053_REVERB_RECONFIGURATION
typedef struct
{
uint16_t *pID;
uint16_t *pValidity;
uint16_t count;
uint16_t selected;
uint16_t frameCounter;
} AcousticEnvironmentSequence;
#endif
typedef struct
{
char *inputBitstreamFilename;
......@@ -141,7 +152,11 @@ typedef struct
uint16_t tsmScale;
#endif
#endif
#ifdef FIX_1053_REVERB_RECONFIGURATION
AcousticEnvironmentSequence aeSequence;
#else
uint16_t acousticEnvironmentId;
#endif
int16_t Opt_dpid_on;
uint16_t directivityPatternId[IVAS_MAX_NUM_OBJECTS];
......@@ -155,7 +170,7 @@ typedef struct
static bool parseCmdlIVAS_dec( int16_t argc, char **argv, DecArguments *arg );
static void usage_dec( void );
#ifdef SPLIT_REND_WITH_HEAD_ROT
static ivas_error decodeG192( DecArguments arg, BS_READER_HANDLE hBsReader, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, uint8_t *splitRendBitsBuf, IVAS_DEC_HANDLE hIvasDec, int16_t *pcmBuf );
static ivas_error decodeG192( DecArguments arg, BS_READER_HANDLE hBsReader, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, ISAR_SPLIT_REND_BITS_DATA *splitRendBits, IVAS_DEC_HANDLE hIvasDec, int16_t *pcmBuf );
#else
static ivas_error decodeG192( DecArguments arg, BS_READER_HANDLE hBsReader, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, IVAS_DEC_HANDLE hIvasDec, int16_t *pcmBuf );
#endif
......@@ -181,7 +196,8 @@ int main(
DecArguments arg;
ivas_error error = IVAS_ERR_UNKNOWN;
#ifdef SPLIT_REND_WITH_HEAD_ROT
uint8_t splitRendBitsBuf[IVAS_MAX_SPLIT_REND_BITS_BUFFER_SIZE_IN_BYTES];
ISAR_SPLIT_REND_BITS_DATA splitRendBits;
uint8_t splitRendBitsBuf[ISAR_MAX_SPLIT_REND_BITS_BUFFER_SIZE_IN_BYTES];
#endif
/* Any handles that require cleanup must be declared here and initialized to NULL */
......@@ -215,6 +231,10 @@ int main(
reset_mem( USE_BYTES );
#endif
#ifdef SPLIT_REND_WITH_HEAD_ROT
splitRendBits.bits_buf = splitRendBitsBuf;
#endif
/*------------------------------------------------------------------------------------------*
* Parse command-line arguments
*------------------------------------------------------------------------------------------*/
......@@ -412,7 +432,8 @@ int main(
/* sanity check */
if ( arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB
#ifdef SPLIT_REND_WITH_HEAD_ROT
&& arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM
&& arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM &&
arg.Opt_non_diegetic_pan == 0
#endif
)
{
......@@ -432,9 +453,14 @@ int main(
*------------------------------------------------------------------------------------------*/
asked_frame_size = arg.renderFramesize;
#ifdef FIX_1053_REVERB_RECONFIGURATION
uint16_t aeID = arg.aeSequence.count > 0 ? arg.aeSequence.pID[0] : 65535;
if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputConfig, arg.tsmEnabled, arg.renderFramesize, arg.customLsOutputEnabled, arg.hrtfReaderEnabled, arg.enableHeadRotation, arg.enableExternalOrientation, arg.orientation_tracking, arg.renderConfigEnabled, arg.Opt_non_diegetic_pan, arg.non_diegetic_pan_gain,
arg.Opt_dpid_on, aeID, arg.delayCompensationEnabled ) ) != IVAS_ERR_OK )
#else
if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputConfig, arg.tsmEnabled, arg.renderFramesize, arg.customLsOutputEnabled, arg.hrtfReaderEnabled, arg.enableHeadRotation, arg.enableExternalOrientation, arg.orientation_tracking, arg.renderConfigEnabled, arg.Opt_non_diegetic_pan, arg.non_diegetic_pan_gain,
arg.Opt_dpid_on, arg.acousticEnvironmentId, arg.delayCompensationEnabled ) ) != IVAS_ERR_OK )
#endif
{
fprintf( stderr, "\nConfigure failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) );
goto cleanup;
......@@ -450,11 +476,11 @@ int main(
fprintf( stderr, "\nChanged render framesize, only 20ms are allowed for decoding to EXT!\n" );
}
#ifdef SPLIT_REND_WITH_HEAD_ROT
/*------------------------------------------------------------------------------------------*
* Configure Split rendering
*------------------------------------------------------------------------------------------*/
#ifdef SPLIT_REND_WITH_HEAD_ROT
asked_frame_size = arg.renderFramesize;
if ( arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
{
......@@ -603,7 +629,8 @@ int main(
/* sanity check */
#ifdef SPLIT_REND_WITH_HEAD_ROT
if ( arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB &&
arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM &&
arg.Opt_non_diegetic_pan == 0 )
{
fprintf( stderr, "\nExternal Renderer Config is supported only when binaural output configurations is used as output OR when Split rendering mode is enabled. Exiting. \n" );
goto cleanup;
......@@ -633,9 +660,19 @@ int main(
fprintf( stderr, "Failed to get directivity patterns for one or more of IDs: %d %d %d %d\n\n", arg.directivityPatternId[0], arg.directivityPatternId[1], arg.directivityPatternId[2], arg.directivityPatternId[3] );
goto cleanup;
}
#ifdef CONF_DISTATT
if ( ( error = RenderConfigReader_getDistanceAttenuation( renderConfigReader, renderConfig.distAtt ) ) != IVAS_ERR_OK )
{
fprintf( stderr, "Failed to get Distance Attenuation \n\n" );
goto cleanup;
}
#endif
#ifdef SPLIT_REND_WITH_HEAD_ROT
if ( asked_frame_size != IVAS_RENDER_FRAMESIZE_20MS && ( renderConfig.split_rend_config.poseCorrectionMode == IVAS_SPLIT_REND_POSE_CORRECTION_MODE_NONE ||
if ( ( arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ||
arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) )
{
if ( asked_frame_size != IVAS_RENDER_FRAMESIZE_20MS &&
( renderConfig.split_rend_config.poseCorrectionMode == ISAR_SPLIT_REND_POSE_CORRECTION_MODE_NONE ||
renderConfig.split_rend_config.dof == 0 ) )
{
arg.renderFramesize = asked_frame_size;
......@@ -654,11 +691,16 @@ int main(
{
fprintf( stderr, "\nChanged render framesize, only 20ms are allowed for non-0dof split rendering!\n" );
}
}
#endif
if ( arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB )
{
#ifdef FIX_1053_REVERB_RECONFIGURATION
if ( ( error = RenderConfigReader_getAcousticEnvironment( renderConfigReader, aeID, &renderConfig.roomAcoustics ) ) == IVAS_ERR_OK )
#else
if ( ( error = RenderConfigReader_getAcousticEnvironment( renderConfigReader, arg.acousticEnvironmentId, &renderConfig.roomAcoustics ) ) == IVAS_ERR_OK )
#endif
{
if ( RenderConfigReader_checkValues( &renderConfig ) != IVAS_ERR_OK )
{
......@@ -668,11 +710,22 @@ int main(
}
else
{
#ifdef FIX_1053_REVERB_RECONFIGURATION
fprintf( stderr, "Failed to get acoustic environment with ID: %d\n\n", aeID );
#else
fprintf( stderr, "Failed to get acoustic environment with ID: %d\n\n", arg.acousticEnvironmentId );
#endif
goto cleanup;
}
renderConfig.roomAcoustics.override = true;
}
#ifdef SPLIT_REND_WITH_HEAD_ROT
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
/* ISAR frame size is set from command line, not renderer config file.
* This will be ignored if output format is not split rendering. */
renderConfig.split_rend_config.isar_frame_size_ms = (int16_t) arg.renderFramesize /* given in number of 5ms subframes */ * 5;
#endif
#endif
if ( ( error = IVAS_DEC_FeedRenderConfig( hIvasDec, renderConfig ) ) != IVAS_ERR_OK )
{
......@@ -831,7 +884,7 @@ int main(
else
{
#ifdef SPLIT_REND_WITH_HEAD_ROT
error = decodeG192( arg, hBsReader, headRotReader, externalOrientationFileReader, refRotReader, referenceVectorReader, splitRendBitsBuf, hIvasDec, pcmBuf );
error = decodeG192( arg, hBsReader, headRotReader, externalOrientationFileReader, refRotReader, referenceVectorReader, &splitRendBits, hIvasDec, pcmBuf );
#else
error = decodeG192( arg, hBsReader, headRotReader, externalOrientationFileReader, refRotReader, referenceVectorReader, hIvasDec, pcmBuf );
#endif
......@@ -875,6 +928,13 @@ cleanup:
free( pcmBuf );
#ifdef FIX_1053_REVERB_RECONFIGURATION
if ( arg.aeSequence.count > 0 )
{
free( arg.aeSequence.pID );
free( arg.aeSequence.pValidity );
}
#endif
#ifdef DEBUG_SBA_AUDIO_DUMP
IVAS_DEC_GetSbaDebugParams( hIvasDec, &numOutChannels, &numTransportChannels, &pca_ingest_channels );
......@@ -1090,7 +1150,15 @@ static bool parseCmdlIVAS_dec(
arg->tsmScaleFileName = NULL;
#endif
#endif
#ifdef FIX_1053_REVERB_RECONFIGURATION
arg->aeSequence.count = 0;
arg->aeSequence.pID = NULL;
arg->aeSequence.pValidity = NULL;
arg->aeSequence.selected = 0;
arg->aeSequence.frameCounter = 0;
#else
arg->acousticEnvironmentId = 65535;
#endif
for ( i = 0; i < IVAS_MAX_NUM_OBJECTS; ++i )
{
arg->directivityPatternId[i] = 65535;
......@@ -1474,11 +1542,90 @@ static bool parseCmdlIVAS_dec(
if ( !is_digits_only( argv[i] ) )
{
#ifdef FIX_1053_REVERB_RECONFIGURATION
uint16_t k;
char *s = argv[i];
char *token = argv[i];
for ( k = 0; s[k]; )
{
s[k] == ',' ? k++ : *s++;
}
k++;
if ( k == 0 )
{
fprintf( stdout, "Error: Invalid acoustic environment sequence specified: %s\n\n", argv[i] );
usage_dec();
return false;
}
if ( NULL == ( arg->aeSequence.pID = malloc( sizeof( uint16_t ) * k ) ) ||
NULL == ( arg->aeSequence.pValidity = malloc( sizeof( uint16_t ) * k ) ) )
{
fprintf( stdout, "Error: Unable to allocate memory for acoustic environment sequence: %s\n\n", argv[i] );
usage_dec();
return false;
}
arg->aeSequence.count = k;
k = 0;
token = strtok( argv[i++], ":" );
while ( token != NULL )
{
if ( !is_number( token ) )
{
fprintf( stdout, "Error: Invalid token %s found in acoustic environment sequence: %s\n\n", token, argv[i] );
usage_dec();
return false;
}
arg->aeSequence.pID[k] = (uint16_t) atoi( token );
token = strtok( NULL, "," );
if ( !is_number( token ) )
{
fprintf( stdout, "Error: Invalid token %s found in acoustic environment sequence: %s\n\n", token, argv[i] );
usage_dec();
return false;
}
arg->aeSequence.pValidity[k] = (uint16_t) atoi( token );
token = strtok( NULL, ":" );
k++;
}
if ( k != arg->aeSequence.count )
{
fprintf( stdout, "Error while parsing acoustic environment sequence: %s\n\n", argv[i] );
usage_dec();
return false;
}
#else
fprintf( stdout, "Error: Invalid acoustic environment ID specified: %s\n\n", argv[i] );
usage_dec();
return false;
#endif
}
#ifdef FIX_1053_REVERB_RECONFIGURATION
else
{
/* A single acoustic environment */
if ( NULL == ( arg->aeSequence.pID = malloc( sizeof( uint16_t ) ) ) ||
NULL == ( arg->aeSequence.pValidity = malloc( sizeof( uint16_t ) ) ) )
{
fprintf( stdout, "Error: Unable to allocate memory for acoustic environment sequence: %s\n\n", argv[i] );
usage_dec();
return false;
}
arg->aeSequence.count = 1;
arg->aeSequence.pID[0] = (int16_t) atoi( argv[i++] );
arg->aeSequence.pValidity[0] = 0;
}
#else
arg->acousticEnvironmentId = (int16_t) atoi( argv[i++] );
#endif
}
else if ( strcmp( argv_to_upper, "-DPID" ) == 0 )
{
......@@ -1570,6 +1717,13 @@ static bool parseCmdlIVAS_dec(
usage_dec();
return false;
}
if ( arg->outputMdFilename != NULL && arg->outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
{
fprintf( stderr, "Error: Output split rendering metadata file is supported for BINAURAL_SPLIT_PCM output config. only\n\n" );
usage_dec();
return false;
}
}
else
{
......@@ -1717,7 +1871,15 @@ static void usage_dec( void )
fprintf( stdout, " output configuration. ID1, ID2, ID3, ID4 specify the directivity pattern IDs used for\n" );
fprintf( stdout, " ISMs 1,2,3 and 4 respectively. This options needs to be accompanied by a render_config file,\n" );
fprintf( stdout, " otherwise a default directivity pattern is used.\n" );
#ifdef FIX_1053_REVERB_RECONFIGURATION
fprintf( stdout, "-aeid ID : Acoustic environment ID (number > 0) or\n" );
fprintf( stdout, " a sequence thereof in the format [ID1:duration1,ID2:duration2...]\n" );
fprintf( stdout, " without braces and spaces, with ':' character separating ID from duration and ',' separating\n" );
fprintf( stdout, " ID and duration pairs, where duration is specified in frames\n" );
fprintf( stdout, " for BINAURAL_ROOM_REVERB output configuration.\n" );
#else
fprintf( stdout, "-aeid ID : Acoustic environment ID (number >= 0) for BINAURAL_ROOM_REVERB output configuration\n" );
#endif
fprintf( stdout, "-level level : Complexity level, level = (1, 2, 3), will be defined after characterisation. \n" );
fprintf( stdout, " Currently, all values default to level 3 (full functionality).\n" );
fprintf( stdout, "-q : Quiet mode, no frame counter\n" );
......@@ -1790,7 +1952,7 @@ static ivas_error initOnFirstGoodFrame(
}
#ifdef SPLIT_REND_WITH_HEAD_ROT
if ( arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
if ( IVAS_DEC_is_split_rendering_enabled( hIvasDec ) )
{
pFullDelayNumSamples[0] = 0;
}
......@@ -1817,11 +1979,18 @@ static ivas_error initOnFirstGoodFrame(
}
#ifdef SPLIT_REND_WITH_HEAD_ROT
if ( arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
if ( IVAS_DEC_is_split_rendering_enabled( hIvasDec ) )
{
/* Open split rendering metadata writer */
int16_t delayNumSamples_temp[3];
int32_t delayTimeScale_temp;
ISAR_SPLIT_REND_CODEC splitRendCodec;
int16_t splitRendCodecFrameSizeMs;
ISAR_SPLIT_REND_POSE_CORRECTION_MODE poseCorrection;
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
int16_t splitRendIsarFrameSizeMs;
int16_t lc3plusHighRes;
#endif
if ( ( error = IVAS_DEC_GetDelay( hIvasDec, delayNumSamples_temp, &delayTimeScale_temp ) ) != IVAS_ERR_OK )
{
......@@ -1829,9 +1998,39 @@ static ivas_error initOnFirstGoodFrame(
return error;
}
if ( arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED )
if ( ( error = IVAS_DEC_GetSplitRendBitstreamHeader( hIvasDec,
&splitRendCodec,
&poseCorrection,
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
&splitRendIsarFrameSizeMs,
#endif
&splitRendCodecFrameSizeMs
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
,
&lc3plusHighRes
#endif
) ) != IVAS_ERR_OK )
{
fprintf( stderr, "\nUnable to get split renderer bitstream header: %s\n", ivas_error_to_string( error ) );
return error;
}
if ( IVAS_DEC_is_split_rendering_coded_out( hIvasDec ) )
{
if ( ( error = split_rend_writer_open( splitRendWriter, arg.outputWavFilename, delayNumSamples_temp[0], delayTimeScale_temp ) ) != IVAS_ERR_OK )
if ( ( error = split_rend_writer_open( splitRendWriter,
arg.outputWavFilename,
delayNumSamples_temp[0],
delayTimeScale_temp,
splitRendCodec,
poseCorrection,
splitRendCodecFrameSizeMs
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
,
splitRendIsarFrameSizeMs,
arg.output_Fs,
lc3plusHighRes
#endif
) ) != IVAS_ERR_OK )
{
fprintf( stderr, "\nUnable to open output split rendering metadata file %s\n", arg.outputWavFilename );
return error;
......@@ -1839,7 +2038,26 @@ static ivas_error initOnFirstGoodFrame(
}
else
{
if ( ( error = split_rend_writer_open( splitRendWriter, arg.outputMdFilename, delayNumSamples_temp[0], delayTimeScale_temp ) ) != IVAS_ERR_OK )
if ( arg.outputMdFilename == NULL )
{
fprintf( stderr, "\nOutput split rendering metadata file not specified\n" );
return IVAS_ERR_INVALID_SPLIT_REND_CONFIG;
}
if ( ( error = split_rend_writer_open( splitRendWriter,
arg.outputMdFilename,
delayNumSamples_temp[0],
delayTimeScale_temp,
splitRendCodec,
poseCorrection,
splitRendCodecFrameSizeMs
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
,
splitRendIsarFrameSizeMs,
arg.output_Fs,
lc3plusHighRes
#endif
) ) != IVAS_ERR_OK )
{
fprintf( stderr, "\nUnable to open output split rendering metadata file %s\n", arg.outputWavFilename );
return error;
......@@ -1847,7 +2065,7 @@ static ivas_error initOnFirstGoodFrame(
}
}
if ( arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED )
if ( IVAS_DEC_is_split_rendering_coded_out( hIvasDec ) == 0 )
{
#endif
/* Open audio writer and write all previously skipped bad frames now that frame size is known */
......@@ -1868,16 +2086,21 @@ static ivas_error initOnFirstGoodFrame(
#ifdef SPLIT_REND_WITH_HEAD_ROT
if ( *splitRendWriter != NULL )
{
IVAS_SPLIT_REND_BITS_DATA splitRendBitsZero;
ISAR_SPLIT_REND_BITS_DATA splitRendBitsZero;
splitRendBitsZero.bits_buf = NULL;
splitRendBitsZero.bits_read = 0;
splitRendBitsZero.bits_written = 0;
splitRendBitsZero.buf_len = 0;
splitRendBitsZero.codec = IVAS_SPLIT_REND_CODEC_DEFAULT;
splitRendBitsZero.pose_correction = IVAS_SPLIT_REND_POSE_CORRECTION_MODE_NONE;
splitRendBitsZero.codec = ISAR_SPLIT_REND_CODEC_DEFAULT;
splitRendBitsZero.pose_correction = ISAR_SPLIT_REND_POSE_CORRECTION_MODE_NONE;
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
splitRendBitsZero.codec_frame_size_ms = 0;
splitRendBitsZero.isar_frame_size_ms = 20;
#else
splitRendBitsZero.codec_frame_size_ms = 20;
#endif
if ( split_rend_write_bitstream_to_file( *splitRendWriter, splitRendBitsZero.bits_buf, &splitRendBitsZero.bits_read, &splitRendBitsZero.bits_written, -1, IVAS_SPLIT_REND_POSE_CORRECTION_MODE_NONE, splitRendBitsZero.codec_frame_size_ms ) != IVAS_ERR_OK )
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;
......@@ -2041,7 +2264,7 @@ static ivas_error decodeG192(
RotFileReader *refRotReader,
Vector3PairFileReader *referenceVectorReader,
#ifdef SPLIT_REND_WITH_HEAD_ROT
uint8_t *splitRendBitsBuf,
ISAR_SPLIT_REND_BITS_DATA *splitRendBits,
#endif
IVAS_DEC_HANDLE hIvasDec,
int16_t *pcmBuf )
......@@ -2082,6 +2305,31 @@ static ivas_error decodeG192(
SplitFileReadWrite *splitRendWriter = NULL;
#endif
#ifdef FIX_1053_REVERB_RECONFIGURATION
IVAS_RENDER_CONFIG_DATA renderConfig;
RenderConfigReader *renderConfigReader = NULL;
if ( arg.renderConfigEnabled )
{
if ( ( error = RenderConfigReader_open( arg.renderConfigFilename, &renderConfigReader ) ) != IVAS_ERR_OK )
{
fprintf( stderr, "\nError: Can't open Renderer configuration file %s \n\n", arg.renderConfigFilename );
goto cleanup;
}
if ( ( error = IVAS_DEC_GetRenderConfig( hIvasDec, &renderConfig ) ) != IVAS_ERR_OK )
{
fprintf( stderr, "\nIVAS_DEC_GetRenderConfig failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) );
goto cleanup;
}
if ( RenderConfigReader_read( renderConfigReader, arg.renderConfigFilename, &renderConfig ) != IVAS_ERR_OK )
{
fprintf( stderr, "Failed to read renderer configuration from file %s\n\n", arg.renderConfigFilename );
goto cleanup;
}
}
#endif
for ( i = 0; i < IVAS_MAX_NUM_OBJECTS; ++i )
{
ismWriters[i] = NULL;
......@@ -2291,6 +2539,38 @@ static ivas_error decodeG192(
{
if ( needNewFrame )
{
#ifdef FIX_1053_REVERB_RECONFIGURATION
if ( arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB && renderConfigReader != NULL &&
arg.aeSequence.count > 0 && arg.aeSequence.pValidity[arg.aeSequence.selected] != 0 )
{
if ( ++arg.aeSequence.frameCounter >= arg.aeSequence.pValidity[arg.aeSequence.selected] )
{
if ( ++arg.aeSequence.selected >= arg.aeSequence.count )
{
arg.aeSequence.selected = 0;
}
arg.aeSequence.frameCounter = 0;
if ( ( error = RenderConfigReader_getAcousticEnvironment( renderConfigReader, arg.aeSequence.pID[arg.aeSequence.selected], &renderConfig.roomAcoustics ) ) == IVAS_ERR_OK )
{
if ( RenderConfigReader_checkValues( &renderConfig ) != IVAS_ERR_OK )
{
fprintf( stderr, "Invalid acoustic environment configuratoin parameters\n\n" );
goto cleanup;
}
}
else
{
fprintf( stderr, "Failed to get acoustic environment with ID %d\n\n", arg.aeSequence.pID[arg.aeSequence.selected] );
goto cleanup;
}
if ( ( error = IVAS_DEC_FeedRenderConfig( hIvasDec, renderConfig ) ) != IVAS_ERR_OK )
{
fprintf( stderr, "\nIVAS_DEC_FeedRenderConfig failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) );
goto cleanup;
}
}
}
#endif
#ifdef DEBUGGING
#ifdef VARIABLE_SPEED_DECODING
if ( arg.tsmScaleFileEnabled )
......@@ -2345,9 +2625,9 @@ static ivas_error decodeG192(
}
#ifdef SPLIT_REND_WITH_HEAD_ROT
if ( arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
if ( IVAS_DEC_is_split_rendering_enabled( hIvasDec ) )
{
if ( ( error = IVAS_DEC_GetSplitBinauralBitstream( hIvasDec, (void *) ( pcmBuf + nOutChannels * nSamplesRendered ), splitRendBitsBuf, &nSamplesRendered_loop, &needNewFrame ) ) != IVAS_ERR_OK )
if ( ( error = IVAS_DEC_GetSplitBinauralBitstream( hIvasDec, (void *) ( pcmBuf + nOutChannels * nSamplesRendered ), splitRendBits, &nSamplesRendered_loop, &needNewFrame ) ) != IVAS_ERR_OK )
{
fprintf( stderr, "\nError in IVAS_DEC_GetSplitBinauralBitstream: %s\n", IVAS_DEC_GetErrorMessage( error ) );
goto cleanup;
......@@ -2427,24 +2707,16 @@ static ivas_error decodeG192(
if ( decodedGoodFrame )
{
#ifdef SPLIT_REND_WITH_HEAD_ROT
if ( arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
{
IVAS_SPLIT_REND_BITS_DATA splitRendBits;
if ( ( error = IVAS_DEC_GetSplitRendBits( hIvasDec, &splitRendBits ) ) != IVAS_ERR_OK )
if ( IVAS_DEC_is_split_rendering_enabled( hIvasDec ) )
{
fprintf( stderr, "\nError in IVAS_DEC_SplitRendBits: %s\n", IVAS_DEC_GetErrorMessage( error ) );
goto cleanup;
}
if ( split_rend_write_bitstream_to_file( splitRendWriter, splitRendBits.bits_buf, &splitRendBits.bits_read, &splitRendBits.bits_written, splitRendBits.codec, splitRendBits.pose_correction, splitRendBits.codec_frame_size_ms ) != 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, "\nUnable to write to bitstream file!\n" );
goto cleanup;
}
}
if ( arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED )
if ( IVAS_DEC_is_split_rendering_coded_out( hIvasDec ) == 0 )
{
#endif
if ( delayNumSamples < nOutSamples )
......@@ -2738,6 +3010,9 @@ static ivas_error decodeG192(
cleanup:
#ifdef FIX_1053_REVERB_RECONFIGURATION
RenderConfigReader_close( &renderConfigReader );
#endif
#ifdef SPLIT_REND_WITH_HEAD_ROT
split_rend_reader_writer_close( &splitRendWriter );
#endif
......
/******************************************************************************************************
(C) 2022-2024 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 "lib_isar_post_rend.h"
#ifndef SPLIT_REND_WITH_HEAD_ROT
int main( int argc, char **argv )
{
(void) argc;
(void) argv;
ISAR_POST_REND_void_func();
return 0;
}
#else
#include <assert.h>
#include <math.h>
#include <string.h>
#include "audio_file_reader.h"
#include "audio_file_writer.h"
#include "cmdl_tools.h"
#include "cmdln_parser.h"
#include "render_config_reader.h"
#include "rotation_file_reader.h"
#include "split_render_file_read_write.h"
#include "split_rend_bfi_file_reader.h"
#ifdef DEBUGGING
#include "debug.h"
#endif
#include "wmc_auto.h"
#define WMC_TOOL_SKIP
/*------------------------------------------------------------------------------------------*
* Local constants
*------------------------------------------------------------------------------------------*/
#define POST_REND_MAX_CLI_ARG_LENGTH ( FILENAME_MAX )
#define ISAR_MAX16B_FLT 32767.0f
#define ISAR_MIN16B_FLT ( -32768.0f )
#if !defined( DEBUGGING ) && !defined( WMOPS )
static
#endif
int32_t frame = 0;
#ifdef _WIN32
#define SEP_FOLDER '\\'
#else
#define SEP_FOLDER '/'
#endif
/*------------------------------------------------------------------------------------------*
* Local structures
*------------------------------------------------------------------------------------------*/
typedef struct
{
IVAS_AUDIO_CONFIG audioConfig;
int32_t inputChannelIndex;
float gain_dB;
} RendererInput;
typedef struct
{
RendererInput binBuses[RENDERER_MAX_BIN_INPUTS];
uint16_t numBinBuses;
} InputConfig;
typedef struct
{
IVAS_AUDIO_CONFIG audioConfig;
} OutputConfig;
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];
int32_t sampleRate;
InputConfig inConfig;
OutputConfig outConfig;
char inMetadataFilePaths[RENDERER_MAX_ISAR_MD_INPUTS][POST_REND_MAX_CLI_ARG_LENGTH];
int16_t numInMetadataFiles;
char headRotationFilePath[POST_REND_MAX_CLI_ARG_LENGTH];
char splitRendBFIFilePath[POST_REND_MAX_CLI_ARG_LENGTH];
ISAR_POST_REND_COMPLEXITY_LEVEL complexityLevel;
bool delayCompensationEnabled;
bool quietModeEnabled;
bool sceneDescriptionInput;
IVAS_RENDER_FRAMESIZE render_framesize;
} CmdlnArgs;
typedef enum
{
CmdLnOptionId_inputFile = 1,
CmdLnOptionId_inputFormat,
CmdLnOptionId_outputFile,
CmdLnOptionId_sampleRate,
CmdLnOptionId_trajFile,
CmdLnOptionId_orientationTracking,
CmdLnOptionId_complexityLevel,
CmdLnOptionId_noDelayCmp,
CmdLnOptionId_quietModeEnabled,
CmdLnOptionId_inputMetadata,
CmdLnOptionId_listFormats,
CmdLnOptionId_SplitRendBFIFile,
CmdLnOptionId_framing,
} CmdLnOptionId;
static const CmdLnParser_Option cliOptions[] = {
{
.id = CmdLnOptionId_inputFile,
.match = "input_file",
.matchShort = "i",
.description = "Path to the input file (WAV, raw PCM or scene description file)",
},
{
.id = CmdLnOptionId_inputFormat,
.match = "input_format",
.matchShort = "if",
.description = "Audio format of input file (e.g. BINAURAL_SPLIT_PCM, use -l for a list)",
},
{
.id = CmdLnOptionId_inputMetadata,
.match = "input_metadata",
.matchShort = "im",
.description = "Space-separated list of path to metadata files for BINAURAL_SPLIT_PCM input mode",
},
{
.id = CmdLnOptionId_outputFile,
.match = "output_file",
.matchShort = "o",
.description = "Path to the output file",
},
{
.id = CmdLnOptionId_sampleRate,
.match = "sample_rate",
.matchShort = "fs",
.description = "Input sampling rate in kHz (16, 32, 48) - required only with raw PCM inputs",
},
{
.id = CmdLnOptionId_trajFile,
.match = "trajectory_file",
.matchShort = "T",
.description = "Head rotation trajectory file for simulation of head tracking",
},
{
.id = CmdLnOptionId_SplitRendBFIFile,
.match = "post_rend_bfi_file",
.matchShort = "prbfi",
.description = "Split rendering option: bfi file",
},
{
.id = CmdLnOptionId_noDelayCmp,
.match = "no_delay_compensation",
.matchShort = "no_delay_cmp",
.description = "[flag] Turn off delay compensation",
},
{
.id = CmdLnOptionId_complexityLevel,
.match = "complexity_level",
.matchShort = "level",
.description = "Complexity level, level = (1, 2, 3), will be defined after characterisation.",
},
{
.id = CmdLnOptionId_quietModeEnabled,
.match = "quiet",
.matchShort = "q",
.description = "[flag] Limit printouts to terminal",
},
{
.id = CmdLnOptionId_listFormats,
.match = "list",
.matchShort = "l",
.description = "List supported audio formats",
},
{
.id = CmdLnOptionId_framing,
.match = "framing",
.matchShort = "fr",
.description = "Set Render audio framing.",
},
};
/*------------------------------------------------------------------------------------------*
* Local function prototypes
*------------------------------------------------------------------------------------------*/
static const int32_t numCliOptions = sizeof( cliOptions ) / sizeof( CmdLnParser_Option );
static void printSupportedAudioConfigs( void );
static IVAS_AUDIO_CONFIG parseAudioConfig( const char *configString );
static void convertOutputBuffer( const float *floatBuffer, const int16_t numSamplesPerChannel, const int16_t numChannels, int16_t *intBuffer );
/*------------------------------------------------------------------------------------------*
* Local functions
*------------------------------------------------------------------------------------------*/
static ISAR_POST_REND_ReadOnlyAudioBuffer getReadOnlySubBuffer(
IVAS_REND_AudioBuffer buffer,
const int16_t chBeginIdx,
const int16_t numChannels )
{
ISAR_POST_REND_ReadOnlyAudioBuffer subBuffer;
subBuffer.config = buffer.config;
subBuffer.config.numChannels = numChannels;
subBuffer.data = buffer.data + subBuffer.config.numSamplesPerChannel * chBeginIdx;
return subBuffer;
}
static int16_t getTotalNumInChannels(
ISAR_POST_REND_HANDLE hIsarPostRend,
ISAR_POST_REND_InputId splitBinIds[RENDERER_MAX_BIN_INPUTS] )
{
int16_t totalNumInChannels = 0;
int16_t i, numInputChannels;
ivas_error error;
for ( i = 0; i < RENDERER_MAX_BIN_INPUTS; ++i )
{
if ( splitBinIds[i] == 0 )
{
/* Skip inactive inputs */
continue;
}
if ( ( error = ISAR_POST_REND_GetInputNumChannels( hIsarPostRend, splitBinIds[i], &numInputChannels ) ) != IVAS_ERR_OK )
{
fprintf( stderr, "Error: %s\n", ivas_error_to_string( error ) );
exit( -1 );
}
totalNumInChannels += numInputChannels;
}
return totalNumInChannels;
}
/*------------------------------------------------------------------------------------------*
* Local functions
*------------------------------------------------------------------------------------------*/
static const CmdLnParser_Option *findOptionById(
const int32_t id )
{
for ( int32_t i = 0; i < numCliOptions; ++i )
{
if ( cliOptions[i].id == id )
{
return &cliOptions[i];
}
}
return NULL;
}
static bool parseInConfig(
const char *inFormatStr,
InputConfig *inConfig,
bool *sceneDescriptionInput )
{
char charBuf[FILENAME_MAX];
/* Initialize input config struct */
inConfig->numBinBuses = 0;
/* First check if input is being set to scene description file - this is not covered by parseAudioConfig(). */
strncpy( charBuf, inFormatStr, sizeof( charBuf ) - 1 );
charBuf[sizeof( charBuf ) - 1] = '\0';
to_upper( charBuf );
if ( strcmp( charBuf, "META" ) == 0 )
{
*sceneDescriptionInput = true;
/* Parsing the file will be done later. At this point the actual file path
* may not be known as command line parameters are still being parsed. */
return true;
}
/* Check for single-format inputs. The given string should map to a member of AUDIO_CONFIG enum. */
IVAS_AUDIO_CONFIG audioConfig = parseAudioConfig( inFormatStr );
switch ( audioConfig )
{
case IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED:
case IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM:
inConfig->numBinBuses = 1;
inConfig->binBuses[0].audioConfig = audioConfig;
inConfig->binBuses[0].inputChannelIndex = 0;
inConfig->binBuses[0].gain_dB = 0.0f;
break;
default:
{
/* Default case covers formats that are defined in the AUDIO_CONFIG enum,
* but cannot be used at input, e.g. BINAURAL */
const CmdLnParser_Option *listOption = findOptionById( CmdLnOptionId_listFormats );
fprintf( stderr, "Unsupported input format: %s. To list valid formats, use option --%s.\n", inFormatStr, listOption->match );
return false;
}
}
return true;
}
static bool parseRenderFramesize(
char *value,
IVAS_RENDER_FRAMESIZE *render_framesize )
{
int32_t tmp;
*render_framesize = IVAS_RENDER_FRAMESIZE_UNKNOWN;
if ( !is_digits_only( value ) )
{
return false;
}
tmp = (int32_t) strtol( value, NULL, 0 );
switch ( (int16_t) tmp )
{
case 5:
*render_framesize = IVAS_RENDER_FRAMESIZE_5MS;
break;
case 10:
*render_framesize = IVAS_RENDER_FRAMESIZE_10MS;
break;
case 20:
*render_framesize = IVAS_RENDER_FRAMESIZE_20MS;
break;
default:
return false;
}
return true;
}
static IVAS_AUDIO_CONFIG parseAudioConfig(
const char *configString )
{
char charBuf[25];
charBuf[24] = '\0';
strncpy( charBuf, configString, sizeof( charBuf ) - 1 );
charBuf[sizeof( charBuf ) - 1] = '\0';
to_upper( charBuf );
if ( strcmp( charBuf, "BINAURAL" ) == 0 )
{
return IVAS_AUDIO_CONFIG_BINAURAL;
}
if ( strcmp( charBuf, "BINAURAL_SPLIT_PCM" ) == 0 )
{
return IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM;
}
if ( strcmp( charBuf, "BINAURAL_SPLIT_CODED" ) == 0 )
{
return IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED;
}
return IVAS_AUDIO_CONFIG_INVALID;
}
static bool checkRequiredArgs(
CmdlnArgs args )
{
const CmdLnParser_Option *tmpOption;
/* Check required arguments */
bool missingRequiredArg = false;
if ( isEmptyString( args.inputFilePath ) )
{
tmpOption = findOptionById( CmdLnOptionId_inputFile );
fprintf( stderr, "Missing required argument: %s (%s)\n", tmpOption->match, tmpOption->matchShort );
missingRequiredArg = true;
}
const bool singleInputSpecified = ( args.inConfig.numBinBuses != 0 );
if ( !args.sceneDescriptionInput && !singleInputSpecified )
{
/* Neither scene description input nor single-type input was specified on command line */
tmpOption = findOptionById( CmdLnOptionId_inputFormat );
fprintf( stderr, "Missing required argument: %s (%s)\n", tmpOption->match, tmpOption->matchShort );
missingRequiredArg = true;
}
if ( isEmptyString( args.outputFilePath ) )
{
tmpOption = findOptionById( CmdLnOptionId_outputFile );
fprintf( stderr, "Missing required argument: %s (%s)\n", tmpOption->match, tmpOption->matchShort );
missingRequiredArg = true;
}
if ( args.sampleRate == 0 )
{
tmpOption = findOptionById( CmdLnOptionId_sampleRate );
fprintf( stderr, "Missing required argument: %s (%s)\n", tmpOption->match, tmpOption->matchShort );
missingRequiredArg = true;
}
if ( missingRequiredArg )
{
CmdLnParser_printUsage( args.executableName, cliOptions, numCliOptions );
}
return !missingRequiredArg;
}
static CmdlnArgs defaultArgs(
const char *executableName )
{
CmdlnArgs args;
strncpy( args.executableName, executableName, POST_REND_MAX_CLI_ARG_LENGTH );
clearString( args.inputFilePath );
clearString( args.outputFilePath );
args.sampleRate = 0;
args.outConfig.audioConfig = IVAS_AUDIO_CONFIG_INVALID;
for ( int32_t i = 0; i < RENDERER_MAX_ISAR_MD_INPUTS; ++i )
{
clearString( args.inMetadataFilePaths[i] );
}
args.numInMetadataFiles = 0;
clearString( args.headRotationFilePath );
clearString( args.splitRendBFIFilePath );
args.delayCompensationEnabled = true;
args.quietModeEnabled = false;
args.sceneDescriptionInput = false;
args.render_framesize = IVAS_RENDER_FRAMESIZE_20MS;
return args;
}
static void parseOption(
const int32_t optionId,
char **optionValues,
const int16_t numOptionValues,
void *pOutputStruct )
{
CmdlnArgs *args = pOutputStruct;
switch ( optionId )
{
case CmdLnOptionId_listFormats:
assert( numOptionValues == 0 );
printSupportedAudioConfigs();
exit( 0 );
case CmdLnOptionId_inputFile:
assert( numOptionValues == 1 );
strncpy( args->inputFilePath, optionValues[0], POST_REND_MAX_CLI_ARG_LENGTH - 1 );
break;
case CmdLnOptionId_inputFormat:
assert( numOptionValues == 1 );
if ( !parseInConfig( optionValues[0], &args->inConfig, &args->sceneDescriptionInput ) )
{
exit( -1 ); /* Error printout handled by failing function */
}
break;
case CmdLnOptionId_inputMetadata:
assert( numOptionValues <= RENDERER_MAX_ISAR_MD_INPUTS );
for ( int16_t i = 0; i < numOptionValues; ++i )
{
strncpy( args->inMetadataFilePaths[i], optionValues[i], POST_REND_MAX_CLI_ARG_LENGTH - 1 );
}
args->numInMetadataFiles = numOptionValues;
break;
case CmdLnOptionId_outputFile:
assert( numOptionValues == 1 );
strncpy( args->outputFilePath, optionValues[0], POST_REND_MAX_CLI_ARG_LENGTH - 1 );
break;
case CmdLnOptionId_sampleRate:
assert( numOptionValues == 1 );
args->sampleRate = (int32_t) ( strtol( optionValues[0], NULL, 10 ) * 1000 );
if ( args->sampleRate == 0 )
{
fprintf( stderr, "Invalid sampling rate specified\n" );
exit( -1 );
}
break;
case CmdLnOptionId_trajFile:
assert( numOptionValues == 1 );
strncpy( args->headRotationFilePath, optionValues[0], POST_REND_MAX_CLI_ARG_LENGTH - 1 );
break;
case CmdLnOptionId_SplitRendBFIFile:
assert( numOptionValues == 1 );
strncpy( args->splitRendBFIFilePath, optionValues[0], POST_REND_MAX_CLI_ARG_LENGTH - 1 );
break;
case CmdLnOptionId_complexityLevel:
assert( numOptionValues == 1 );
args->complexityLevel = (int32_t) ( strtol( optionValues[0], NULL, 10 ) );
if ( args->complexityLevel < ISAR_POST_REND_COMPLEXITY_LEVEL_ONE || args->complexityLevel > ISAR_POST_REND_COMPLEXITY_LEVEL_THREE )
{
fprintf( stdout, "Invalid complexity level specified.\n" );
exit( -1 );
}
else if ( args->complexityLevel == ISAR_POST_REND_COMPLEXITY_LEVEL_ONE || args->complexityLevel == ISAR_POST_REND_COMPLEXITY_LEVEL_TWO )
{
fprintf( stdout, "Complexity levels 1 and 2 will be defined after characterisation - default to level 3 (full functionality).\n" );
}
break;
case CmdLnOptionId_noDelayCmp:
assert( numOptionValues == 0 );
args->delayCompensationEnabled = false;
break;
case CmdLnOptionId_quietModeEnabled:
assert( numOptionValues == 0 );
args->quietModeEnabled = true;
break;
case CmdLnOptionId_framing:
assert( numOptionValues == 1 );
if ( !parseRenderFramesize( optionValues[0], &args->render_framesize ) )
{
fprintf( stderr, "Unknown or invalid option for frame size: %s\n", optionValues[0] );
exit( -1 );
}
break;
default:
assert( 0 && "This should be unreachable - all command line options should be explicitly handled." );
break;
}
return;
}
static CmdlnArgs parseCmdlnArgs(
const int argc,
char **argv )
{
CmdlnArgs args = defaultArgs( argv[0] );
if ( CmdLnParser_parseArgs( argc, argv, cliOptions, numCliOptions, &args, parseOption ) != 0 )
{
exit( -1 ); /* Error printout handled by failing function */
}
if ( !checkRequiredArgs( args ) )
{
exit( -1 ); /* Error printout handled by failing function */
}
return args;
}
static void printSupportedAudioConfigs( void )
{
uint16_t i;
const char *supportedFormats[] = {
"BINAURAL (output only)",
"BINAURAL_SPLIT_PCM",
"BINAURAL_SPLIT_CODED",
};
fprintf( stdout, "Supported audio formats:\n" );
for ( i = 0; i < sizeof( supportedFormats ) / sizeof( *supportedFormats ); i++ )
{
fprintf( stdout, "%s\n", supportedFormats[i] );
}
return;
}
/*--------------------------------------------------------------------------*
* convertInputBuffer()
*
* Convert input buffer from WAV/PCM file (int16_t, interleaved) to a format
* accepted by the renderer (float, packed)
*--------------------------------------------------------------------------*/
static void convertInputBuffer(
const int16_t *intBuffer,
const int16_t numIntSamplesPerChannel,
const int16_t numFloatSamplesPerChannel,
const int16_t numChannels,
float *floatBuffer )
{
int16_t chnl, smpl, i;
i = 0;
for ( smpl = 0; smpl < numFloatSamplesPerChannel; ++smpl )
{
for ( chnl = 0; chnl < numChannels; ++chnl )
{
if ( i < numIntSamplesPerChannel )
{
floatBuffer[chnl * numFloatSamplesPerChannel + smpl] = (float) intBuffer[i];
}
else
{
floatBuffer[chnl * numFloatSamplesPerChannel + smpl] = 0.f;
}
++i;
}
}
return;
}
/*--------------------------------------------------------------------------*
* convertOutputBuffer()
*
* Convert output buffer from the renderer (float, packed) to a format ready
* for writing to a WAV/PCM file (int16_t, interleaved)
*--------------------------------------------------------------------------*/
static void convertOutputBuffer(
const float *floatBuffer,
const int16_t numSamplesPerChannel,
const int16_t numChannels,
int16_t *intBuffer )
{
int16_t chnl, smpl, i;
float temp;
i = 0;
for ( smpl = 0; smpl < numSamplesPerChannel; ++smpl )
{
for ( chnl = 0; chnl < numChannels; ++chnl )
{
temp = floatBuffer[chnl * numSamplesPerChannel + smpl];
temp = (float) floor( temp + 0.5f );
if ( temp > ISAR_MAX16B_FLT )
{
temp = ISAR_MAX16B_FLT;
}
else if ( temp < ISAR_MIN16B_FLT )
{
temp = ISAR_MIN16B_FLT;
}
intBuffer[i] = (int16_t) temp;
++i;
}
}
return;
}
/*------------------------------------------------------------------------------------------*
* main()
*
* Main ISAR post renderer function for command-line interface
*------------------------------------------------------------------------------------------*/
int main(
int argc,
char **argv )
{
ISAR_POST_REND_HANDLE hIsarPostRend;
RotFileReader *headRotReader = NULL;
RotFileReader *externalOrientationFileReader = NULL;
SplitRendBFIFileReader *splitRendBFIReader = NULL;
AudioFileReader *audioReader = NULL;
AudioFileWriter *audioWriter;
int32_t inBufferSize;
int32_t outBufferSize;
int32_t bitsBufferSize;
int16_t *inpInt16Buffer;
float *inFloatBuffer;
int16_t *outInt16Buffer;
float *outFloatBuffer;
uint8_t *bitsBufferData = NULL;
IVAS_REND_AudioBuffer inBuffer;
IVAS_REND_AudioBuffer outBuffer;
ISAR_POST_REND_BitstreamBuffer bitsBuffer;
SplitFileReadWrite *hSplitRendFileReadWrite;
char audioFilePath[FILENAME_MAX];
int16_t numSamplesRead;
int16_t delayNumSamples = -1;
int16_t delayNumSamples_orig = 0;
int16_t zeroPad = 0;
int16_t zeroPadToWrite = 0;
int32_t delayTimeScale = 0;
int16_t i, numChannels;
ivas_error error = IVAS_ERR_OK;
bool splitBinNeedsNewFrame = true;
#ifdef WMOPS
reset_wmops();
reset_mem( USE_BYTES );
#endif
hSplitRendFileReadWrite = NULL;
bitsBuffer.bits = NULL;
bitsBuffer.config.bitsRead = 0;
bitsBuffer.config.bitsWritten = 0;
bitsBuffer.config.bufLenInBytes = 0;
bitsBuffer.config.codec = ISAR_SPLIT_REND_CODEC_DEFAULT;
bitsBuffer.config.poseCorrection = ISAR_SPLIT_REND_POSE_CORRECTION_MODE_NONE;
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
bitsBuffer.config.codec_frame_size_ms = 5;
bitsBuffer.config.isar_frame_size_ms = 20;
bitsBuffer.config.lc3plusHighRes = 0;
#else
bitsBuffer.config.codec_frame_size_ms = 20;
#endif
CmdlnArgs args = parseCmdlnArgs( argc, argv );
convert_backslash( args.inputFilePath );
convert_backslash( args.outputFilePath );
convert_backslash( args.headRotationFilePath );
if ( !isEmptyString( args.headRotationFilePath ) )
{
if ( RotationFileReader_open( args.headRotationFilePath, &headRotReader ) != IVAS_ERR_OK )
{
fprintf( stderr, "Error opening file: %s\n", args.headRotationFilePath );
exit( -1 );
}
}
if ( !isEmptyString( args.splitRendBFIFilePath ) )
{
convert_backslash( args.splitRendBFIFilePath );
SplitRendBFIFileReader_open( args.splitRendBFIFilePath, &splitRendBFIReader );
}
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
int32_t inFileSampleRate = 0;
#endif
strncpy( audioFilePath, args.inputFilePath, FILENAME_MAX - 1 );
hSplitRendFileReadWrite = NULL;
if ( ( args.inConfig.numBinBuses > 0 ) && ( args.inConfig.binBuses[0].audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) )
{
error = split_rend_reader_open( &hSplitRendFileReadWrite,
args.inMetadataFilePaths[0],
&bitsBuffer.config.codec,
&bitsBuffer.config.poseCorrection,
&bitsBuffer.config.codec_frame_size_ms
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
,
&bitsBuffer.config.isar_frame_size_ms,
&inFileSampleRate,
&bitsBuffer.config.lc3plusHighRes
#endif
);
if ( error != IVAS_ERR_OK )
{
fprintf( stderr, "Could not open split rend metadata file %s\n", args.inMetadataFilePaths[0] );
exit( -1 );
}
if ( AudioFileReader_open( &audioReader, audioFilePath ) != IVAS_ERR_OK )
{
fprintf( stderr, "Error opening file: %s\n", audioFilePath );
exit( -1 );
}
}
/*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 ) )
{
error = split_rend_reader_open( &hSplitRendFileReadWrite,
args.inputFilePath,
&bitsBuffer.config.codec,
&bitsBuffer.config.poseCorrection,
&bitsBuffer.config.codec_frame_size_ms
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
,
&bitsBuffer.config.isar_frame_size_ms,
&inFileSampleRate,
&bitsBuffer.config.lc3plusHighRes
#endif
);
if ( error != IVAS_ERR_OK )
{
fprintf( stderr, "Could not open split rend metadata file %s\n", args.inputFilePath );
exit( -1 );
}
audioReader = NULL;
}
#ifndef ISAR_BITSTREAM_UPDATE_LC3PLUS
int32_t inFileSampleRate = 0;
#endif
if ( audioReader != NULL )
{
error = AudioFileReader_getSamplingRate( audioReader, &inFileSampleRate );
}
else
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
if ( hSplitRendFileReadWrite == NULL )
#endif
{
inFileSampleRate = args.sampleRate;
}
switch ( error )
{
case IVAS_ERR_OK:
/* If sampling rate not given on command line, use the one from SR file */
if ( args.sampleRate == 0 )
{
args.sampleRate = inFileSampleRate;
}
/* else if sampling rate given on command line, compare with wav file */
else if ( inFileSampleRate != args.sampleRate )
{
fprintf( stderr, "Sampling rate mismatch: %d Hz requested, but %d Hz found in file %s\n", args.sampleRate, inFileSampleRate, args.inputFilePath );
exit( -1 );
}
break;
case IVAS_ERR_SAMPLING_RATE_UNKNOWN: /* Returned when input is raw PCM */
if ( args.sampleRate == 0 )
{
fprintf( stderr, "Sampling rate must be specified on command line when using raw PCM input\n" );
exit( -1 );
}
break;
default:
fprintf( stderr, "Error: %s\n", ivas_error_to_string( error ) );
exit( -1 );
}
int16_t inFileNumChannels = 0;
if ( audioReader != NULL )
{
error = AudioFileReader_getNumChannels( audioReader, &inFileNumChannels );
if ( error != IVAS_ERR_OK && error != IVAS_ERR_NUM_CHANNELS_UNKNOWN )
{
fprintf( stderr, "Error: %s\n", ivas_error_to_string( error ) );
exit( -1 );
}
}
const int16_t frameSize_smpls = (int16_t) ( ( args.render_framesize ) * args.sampleRate * 5 / ( 1000 ) );
args.outConfig.audioConfig = IVAS_AUDIO_CONFIG_BINAURAL;
if ( ( error = ISAR_POST_REND_open( &hIsarPostRend, args.sampleRate, args.outConfig.audioConfig, true, 0, 0.0, (int16_t) args.render_framesize ) ) != IVAS_ERR_OK )
{
fprintf( stderr, "Error opening renderer handle: %s\n", ivas_error_to_string( error ) );
exit( -1 );
}
/* === Configure === */
if ( ( error = ISAR_POST_REND_InitConfig( hIsarPostRend, args.outConfig.audioConfig ) ) != IVAS_ERR_OK )
{
fprintf( stderr, "Error in Renderer Config Init: %s\n", ivas_error_to_string( error ) );
exit( -1 );
}
if ( args.inConfig.numBinBuses > 0 )
{
if ( ( error = ISAR_REND_SetSplitRendBitstreamHeader( hIsarPostRend,
bitsBuffer.config.codec,
bitsBuffer.config.poseCorrection,
bitsBuffer.config.codec_frame_size_ms
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
,
bitsBuffer.config.isar_frame_size_ms,
bitsBuffer.config.lc3plusHighRes
#endif
) ) != IVAS_ERR_OK )
{
fprintf( stderr, "Error in getting split renderer bitstream header: %s\n", ivas_error_to_string( error ) );
exit( -1 );
}
}
ISAR_POST_REND_InputId splitBinIds[RENDERER_MAX_BIN_INPUTS];
for ( i = 0; i < RENDERER_MAX_BIN_INPUTS; i++ )
{
splitBinIds[i] = 0u;
}
for ( i = 0; i < args.inConfig.numBinBuses; ++i )
{
if ( ( error = ISAR_POST_REND_AddInput( hIsarPostRend, args.inConfig.binBuses[i].audioConfig, &splitBinIds[i] ) ) != IVAS_ERR_OK )
{
fprintf( stderr, "Error: %s\n", ivas_error_to_string( error ) );
exit( -1 );
}
}
const int16_t totalNumInChannels = getTotalNumInChannels( hIsarPostRend, splitBinIds );
if ( inFileNumChannels != 0 /* inFileNumChannels is 0 with raw PCM input */ && totalNumInChannels != inFileNumChannels )
{
fprintf( stderr, "Number of channels in input file does not match selected configuration\n" );
exit( -1 );
}
int16_t numOutChannels = 2;
if ( AudioFileWriter_open( &audioWriter, args.outputFilePath, args.sampleRate, numOutChannels ) != IVAS_ERR_OK )
{
fprintf( stderr, "Failed to open file: %s\n", args.outputFilePath );
exit( -1 );
}
inBufferSize = frameSize_smpls * totalNumInChannels;
outBufferSize = frameSize_smpls * numOutChannels;
inpInt16Buffer = malloc( inBufferSize * sizeof( int16_t ) );
inFloatBuffer = malloc( inBufferSize * sizeof( float ) );
inBuffer.config.numSamplesPerChannel = (int16_t) frameSize_smpls;
outFloatBuffer = malloc( outBufferSize * sizeof( float ) );
outBuffer.config.numSamplesPerChannel = (int16_t) frameSize_smpls;
outInt16Buffer = malloc( outBufferSize * sizeof( int16_t ) );
inBuffer.config.is_cldfb = 0;
inBuffer.config.numChannels = (int16_t) totalNumInChannels;
inBuffer.data = inFloatBuffer;
outBuffer.config.is_cldfb = 0;
outBuffer.config.numChannels = (int16_t) numOutChannels;
outBuffer.data = outFloatBuffer;
memset( outBuffer.data, 0, outBuffer.config.numSamplesPerChannel * outBuffer.config.numChannels * sizeof( float ) );
bitsBufferSize = SPLIT_REND_BITS_BUFF_SIZE;
if ( bitsBufferSize > 0 )
{
bitsBufferData = malloc( bitsBufferSize * sizeof( uint8_t ) );
}
else
{
bitsBufferData = NULL;
}
bitsBuffer.bits = bitsBufferData;
bitsBuffer.config.bitsRead = 0;
bitsBuffer.config.bitsWritten = 0;
bitsBuffer.config.bufLenInBytes = bitsBufferSize;
#ifdef WMOPS
reset_stack();
reset_wmops();
#endif
if ( !args.quietModeEnabled )
{
fprintf( stdout, "\n------ Running the ISAR post renderer ------\n\n" );
fprintf( stdout, "Frames processed: " );
}
else
{
fprintf( stdout, "\n\n-- Start the ISAR post renderer (quiet mode) --\n\n" );
}
while ( 1 )
{
int16_t num_in_channels;
num_in_channels = inBuffer.config.numChannels;
numSamplesRead = 0;
if ( ( hSplitRendFileReadWrite != NULL ) && splitBinNeedsNewFrame )
{
ivas_error error_tmp;
numSamplesRead = (int16_t) inBufferSize;
error_tmp = split_rend_read_bits_from_file( hSplitRendFileReadWrite, bitsBuffer.bits, &bitsBuffer.config.bitsRead, &bitsBuffer.config.bitsWritten );
if ( error_tmp != IVAS_ERR_OK )
{
if ( error_tmp == IVAS_ERR_END_OF_FILE )
{
numSamplesRead = 0;
}
else
{
fprintf( stderr, "\nUnable to read from bitstream file!\n" );
exit( -1 );
}
}
}
if ( audioReader != NULL )
{
/* Read the input data */
if ( ( error = AudioFileReader_read( audioReader, inpInt16Buffer, (int16_t) inBufferSize, &numSamplesRead ) ) != IVAS_ERR_OK )
{
fprintf( stderr, "\nError reading from file %s\n", audioFilePath );
exit( -1 );
}
}
if ( numSamplesRead == 0 && splitBinNeedsNewFrame )
{
/* end of input data */
break;
}
/* Convert from int to float and from interleaved to packed */
convertInputBuffer( inpInt16Buffer, numSamplesRead, inBuffer.config.numSamplesPerChannel, num_in_channels, inFloatBuffer );
int16_t num_subframes, sf_idx;
num_subframes = (int16_t) args.render_framesize;
/* Read from head rotation trajectory file if specified */
if ( headRotReader != NULL )
{
for ( sf_idx = 0; sf_idx < num_subframes; sf_idx++ )
{
IVAS_QUATERNION headRot;
IVAS_VECTOR3 Pos;
if ( ( error = HeadRotationFileReading( headRotReader, &headRot, &Pos ) ) != IVAS_ERR_OK )
{
fprintf( stderr, "Error in Head Rotation File Reading: %s\n", ivas_error_to_string( error ) );
exit( -1 );
}
if ( ( error = ISAR_POST_REND_SetHeadRotation( hIsarPostRend, headRot, Pos, DEFAULT_AXIS, sf_idx ) ) != IVAS_ERR_OK )
{
fprintf( stderr, "Error setting Head Rotation: %s\n", ivas_error_to_string( error ) );
exit( -1 );
}
}
}
else
{
fprintf( stderr, "Head Rotation should be enabled in post renderer\n" );
exit( -1 );
}
/* Read from split renderer bfi file if specified */
if ( splitRendBFIReader != NULL && splitBinNeedsNewFrame )
{
int16_t bfi;
if ( ( error = SplitRendBFIFileReading( splitRendBFIReader, &bfi ) ) != IVAS_ERR_OK )
{
fprintf( stderr, "Error in SplitRendBFIFileReading(): %s\n", ivas_error_to_string( error ) );
exit( -1 );
}
if ( ( error = ISAR_POST_REND_SetSplitRendBFI( hIsarPostRend, bfi ) ) != IVAS_ERR_OK )
{
fprintf( stderr, "Error in ISAR_POST_REND_SetSplitRendBFI(): %s\n", ivas_error_to_string( error ) );
exit( -1 );
}
}
for ( i = 0; i < args.inConfig.numBinBuses; ++i )
{
if ( numSamplesRead > 0 )
{
if ( ( error = ISAR_POST_REND_GetInputNumChannels( hIsarPostRend, splitBinIds[i], &numChannels ) ) != IVAS_ERR_OK )
{
fprintf( stderr, "Error: %s\n", ivas_error_to_string( error ) );
exit( -1 );
}
ISAR_POST_REND_ReadOnlyAudioBuffer tmpBuffer = getReadOnlySubBuffer( inBuffer, (int16_t) args.inConfig.binBuses[i].inputChannelIndex, numChannels );
if ( ( error = ISAR_POST_REND_FeedInputAudio( hIsarPostRend, splitBinIds[i], tmpBuffer ) ) != IVAS_ERR_OK )
{
fprintf( stderr, "Error: %s\n", ivas_error_to_string( error ) );
exit( -1 );
}
}
if ( splitBinNeedsNewFrame )
{
if ( ( error = ISAR_POST_REND_FeedSplitBinauralBitstream( hIsarPostRend, splitBinIds[i], &bitsBuffer ) ) != IVAS_ERR_OK )
{
fprintf( stderr, "Error: %s\n", ivas_error_to_string( error ) );
exit( -1 );
}
}
}
if ( ( error = ISAR_POST_REND_GetSplitBinauralSamples( hIsarPostRend, outBuffer, &splitBinNeedsNewFrame ) ) != IVAS_ERR_OK )
{
fprintf( stderr, "Error: %s\n", ivas_error_to_string( error ) );
exit( -1 );
}
int16_t num_out_channels;
num_out_channels = outBuffer.config.numChannels;
/* Convert from float to int and from packed to interleaved.
* Values in outFloatBuffer are guaranteed to be within range INT16_MIN:INT16_MAX */
convertOutputBuffer( outFloatBuffer, outBuffer.config.numSamplesPerChannel, num_out_channels, outInt16Buffer );
if ( delayNumSamples == -1 )
{
if ( args.delayCompensationEnabled )
{
if ( ISAR_POST_REND_GetDelay( hIsarPostRend, &delayNumSamples, &delayTimeScale ) != IVAS_ERR_OK )
{
fprintf( stderr, "\nUnable to get delay of renderer!\n" );
exit( -1 );
}
if ( hSplitRendFileReadWrite != NULL )
{
uint32_t pre_rend_delay_ns;
split_rend_read_pre_rend_delay_ns( hSplitRendFileReadWrite, &pre_rend_delay_ns );
delayNumSamples += (int16_t) roundf( (float) pre_rend_delay_ns * delayTimeScale / 1000000000.f );
}
delayNumSamples_orig = delayNumSamples;
}
else
{
delayNumSamples = 0;
}
zeroPad = delayNumSamples;
}
if ( audioWriter != NULL )
{
if ( delayNumSamples * num_out_channels < outBufferSize )
{
if ( AudioFileWriter_write( audioWriter, &outInt16Buffer[delayNumSamples * num_out_channels], outBufferSize - ( delayNumSamples * num_out_channels ) ) != IVAS_ERR_OK )
{
fprintf( stderr, "Error writing audio file %s\n", args.outputFilePath );
exit( -1 );
}
delayNumSamples = 0;
}
else
{
delayNumSamples -= (int16_t) ( outBufferSize / num_out_channels );
}
}
bitsBuffer.config.bitsRead = 0;
bitsBuffer.config.bitsWritten = 0;
frame++;
if ( !args.quietModeEnabled )
{
fprintf( stdout, "%-8d\b\b\b\b\b\b\b\b", frame );
}
#ifdef WMOPS
update_mem();
update_wmops();
#endif
}
/* add zeros at the end to have equal length of synthesized signals */
if ( audioWriter != NULL )
{
for ( zeroPadToWrite = zeroPad; zeroPadToWrite > frameSize_smpls; zeroPadToWrite -= frameSize_smpls )
{
memset( outInt16Buffer, 0, outBufferSize * sizeof( int16_t ) );
if ( ( error = AudioFileWriter_write( audioWriter, outInt16Buffer, outBufferSize ) ) != IVAS_ERR_OK )
{
fprintf( stderr, "\nOutput audio file writer error\n" );
exit( -1 );
}
}
memset( outInt16Buffer, 0, zeroPadToWrite * outBuffer.config.numChannels * sizeof( int16_t ) );
if ( ( error = AudioFileWriter_write( audioWriter, outInt16Buffer, zeroPadToWrite * outBuffer.config.numChannels ) ) != IVAS_ERR_OK )
{
fprintf( stderr, "\nOutput audio file writer error\n" );
exit( -1 );
}
zeroPadToWrite = 0;
}
if ( !args.quietModeEnabled && args.delayCompensationEnabled )
{
fprintf( stdout, "\nRenderer delay: %-5u [samples] - Timescale: %5u\n", delayNumSamples_orig, delayTimeScale );
}
fprintf( stdout, "\n\nRendering of %d frames finished\n\n", frame );
#ifdef DEBUGGING
int32_t cnt_frames_limited, noClipping;
if ( ( cnt_frames_limited = ISAR_POST_REND_GetCntFramesLimited( hIsarPostRend ) ) > 0 )
{
fprintf( stdout, "Limiter applied in %d frames.\n\n", cnt_frames_limited );
}
if ( ( noClipping = ISAR_POST_REND_GetNoCLipping( hIsarPostRend ) ) > 0 )
{
fprintf( stdout, "Clipping (saturation) detected: %d samples clipped!!!\n\n", noClipping );
}
#endif
/* === Close === */
free( inpInt16Buffer );
free( inFloatBuffer );
free( outInt16Buffer );
free( outFloatBuffer );
if ( bitsBufferData != NULL )
{
free( bitsBufferData );
}
split_rend_reader_writer_close( &hSplitRendFileReadWrite );
SplitRendBFIFileReader_close( &splitRendBFIReader );
AudioFileReader_close( &audioReader );
AudioFileWriter_close( &audioWriter );
RotationFileReader_close( &headRotReader );
RotationFileReader_close( &externalOrientationFileReader );
ISAR_POST_REND_Close( &hIsarPostRend );
#ifdef DEBUGGING
dbgclose();
#endif
#ifdef WMOPS
print_wmops();
print_mem( NULL );
#endif
return 0;
}
#undef WMC_TOOL_SKIP
#endif /* SPLIT_REND_WITH_HEAD_ROT */
......@@ -66,10 +66,6 @@
#define RENDERER_MAX_METADATA_LENGTH 8192
#define RENDERER_MAX_METADATA_LINE_LENGTH 1024
#ifdef SPLIT_REND_WITH_HEAD_ROT
#define SPLIT_REND_BITS_BUFF_SIZE ( ( ( ( (int32_t) IVAS_MAX_SPLIT_REND_BITRATE / IVAS_NUM_FRAMES_PER_SEC ) + 7 ) >> 3 ) + IVAS_SPLIT_REND_ADDITIONAL_BYTES_TO_READ )
#endif
#define IVAS_MAX16B_FLT 32767.0f
#define IVAS_MIN16B_FLT ( -32768.0f )
......@@ -138,10 +134,6 @@ typedef struct
IVAS_CUSTOM_LS_DATA inSetupCustom;
RendererInput masaBuses[RENDERER_MAX_MASA_INPUTS];
uint16_t numMasaBuses;
#ifdef SPLIT_REND_WITH_HEAD_ROT
RendererInput binBuses[RENDERER_MAX_BIN_INPUTS];
uint16_t numBinBuses;
#endif
} InputConfig;
typedef struct
......@@ -150,6 +142,17 @@ typedef struct
IVAS_CUSTOM_LS_DATA outSetupCustom;
} OutputConfig;
#ifdef FIX_1053_REVERB_RECONFIGURATION
typedef struct
{
uint16_t *pID;
uint16_t *pValidity;
uint16_t count;
uint16_t selected;
uint16_t frameCounter;
} AcousticEnvironmentSequence;
#endif
typedef struct
{
char executableName[RENDERER_MAX_CLI_ARG_LENGTH];
......@@ -189,7 +192,11 @@ typedef struct
float syncMdDelay;
IVAS_RENDER_FRAMESIZE render_framesize;
uint16_t directivityPatternId[RENDERER_MAX_ISM_INPUTS];
#ifdef FIX_1053_REVERB_RECONFIGURATION
AcousticEnvironmentSequence aeSequence;
#else
uint16_t acousticEnvironmentId;
#endif
} CmdlnArgs;
typedef enum
......@@ -322,10 +329,12 @@ static const CmdLnParser_Option cliOptions[] = {
.matchShort = "lp",
.description = "Output LFE position. Comma-delimited triplet of [gain, azimuth, elevation] where gain is linear (like --gain, -g) and azimuth, elevation are in degrees.\nIf specified, overrides the default behavior which attempts to map input to output LFE channel(s)",
},
{ .id = CmdlnOptionId_lfeMatrix,
{
.id = CmdlnOptionId_lfeMatrix,
.match = "lfe_matrix",
.matchShort = "lm",
.description = "LFE panning matrix. File (CSV table) containing a matrix of dimensions [ num_input_lfe x num_output_channels ] with elements specifying linear routing gain (like --gain, -g). \nIf specified, overrides the output LFE position option and the default behavior which attempts to map input to output LFE channel(s)" },
.description = "LFE panning matrix. File (CSV table) containing a matrix of dimensions [ num_input_lfe x num_output_channels ] with elements specifying linear routing gain (like --gain, -g). \nIf specified, overrides the output LFE position option and the default behavior which attempts to map input to output LFE channel(s)",
},
{
.id = CmdLnOptionId_noDelayCmp,
.match = "no_delay_compensation",
......@@ -390,7 +399,11 @@ static const CmdLnParser_Option cliOptions[] = {
.id = CmdLnOptionId_acousticEnvironmentId,
.match = "acoustic_environment_id",
.matchShort = "aeid",
#ifdef FIX_1053_REVERB_RECONFIGURATION
.description = "Acoustic environment ID( number > 0 ) or a sequence thereof in the format [ID1:duration1,ID2:duration2...] without braces and spaces, with ':' character separating ID from duration and ',' separating ID and duration pairs, where duration is specified in frames for BINAURAL_ROOM_REVERB output configuration.",
#else
.description = "Acoustic environment ID (number >= 0) for BINAURAL_ROOM_REVERB output configuration",
#endif
},
};
......@@ -478,13 +491,7 @@ static int16_t getTotalNumInChannels(
IVAS_REND_InputId mcIds[RENDERER_MAX_MC_INPUTS],
IVAS_REND_InputId ismIds[RENDERER_MAX_ISM_INPUTS],
IVAS_REND_InputId sbaIds[RENDERER_MAX_SBA_INPUTS],
#ifdef SPLIT_REND_WITH_HEAD_ROT
IVAS_REND_InputId masaIds[RENDERER_MAX_MASA_INPUTS],
IVAS_REND_InputId splitBinIds[RENDERER_MAX_BIN_INPUTS]
#else
IVAS_REND_InputId masaIds[RENDERER_MAX_MASA_INPUTS]
#endif
)
IVAS_REND_InputId masaIds[RENDERER_MAX_MASA_INPUTS] )
{
int16_t totalNumInChannels = 0;
int16_t i, numInputChannels;
......@@ -561,24 +568,6 @@ static int16_t getTotalNumInChannels(
totalNumInChannels += numInputChannels;
}
#ifdef SPLIT_REND_WITH_HEAD_ROT
for ( i = 0; i < RENDERER_MAX_BIN_INPUTS; ++i )
{
if ( splitBinIds[i] == 0 )
{
/* Skip inactive inputs */
continue;
}
if ( ( error = IVAS_REND_GetInputNumChannels( hIvasRend, splitBinIds[i], &numInputChannels ) ) != IVAS_ERR_OK )
{
fprintf( stderr, "Error: %s\n", ivas_error_to_string( error ) );
exit( -1 );
}
totalNumInChannels += numInputChannels;
}
#endif
return totalNumInChannels;
}
......@@ -587,13 +576,7 @@ static void setupWithSingleFormatInput(
CmdlnArgs args,
char *audioFilePath,
IsmPositionProvider *positionProvider,
#ifdef SPLIT_REND_WITH_HEAD_ROT
MasaFileReader **masaReaders,
SplitFileReadWrite **hhSplitRendFileReadWrite
#else
MasaFileReader **masaReaders
#endif
)
MasaFileReader **masaReaders )
{
/* With single-format input, inputFilePath is the path to input audio file. */
strncpy( audioFilePath, args.inputFilePath, FILENAME_MAX - 1 );
......@@ -640,22 +623,6 @@ static void setupWithSingleFormatInput(
}
}
}
#ifdef SPLIT_REND_WITH_HEAD_ROT
else if ( args.inConfig.numBinBuses != 0 )
{
*hhSplitRendFileReadWrite = NULL;
if ( args.inConfig.binBuses[0].audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
{
ivas_error error;
error = split_rend_reader_open( hhSplitRendFileReadWrite, args.inMetadataFilePaths[0] );
if ( error != IVAS_ERR_OK )
{
fprintf( stderr, "Could not open split rend metadata file %s\n", args.inMetadataFilePaths[0] );
exit( -1 );
}
}
}
#endif
return;
}
......@@ -671,12 +638,12 @@ static float dBToLin(
#ifdef SPLIT_REND_WITH_HEAD_ROT
static int16_t get_cldfb_in_flag(
const IVAS_AUDIO_CONFIG audioConfig,
IVAS_RENDER_CONFIG_DATA *renderConfig )
const IVAS_RENDER_CONFIG_DATA *renderConfig )
{
int16_t cldfb_in_flag;
cldfb_in_flag = 0;
if ( renderConfig->split_rend_config.rendererSelection == IVAS_SPLIT_REND_RENDERER_SELECTION_FASTCONV )
if ( renderConfig->split_rend_config.rendererSelection == ISAR_SPLIT_REND_RENDERER_SELECTION_FASTCONV )
{
#ifdef DEBUGGING
cldfb_in_flag = 1;
......@@ -690,21 +657,6 @@ static int16_t get_cldfb_in_flag(
return cldfb_in_flag;
}
static int16_t is_split_post_rend_mode(
CmdlnArgs *args )
{
int16_t flag;
flag = 0;
if ( args->inConfig.numBinBuses > 0 && ( args->inConfig.binBuses[0].audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || args->inConfig.binBuses[0].audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) )
{
flag = 1;
}
return flag;
}
static int16_t is_split_pre_rend_mode(
CmdlnArgs *args )
{
......@@ -784,8 +736,10 @@ int main(
int16_t zeroPadToWrite = 0;
int32_t delayTimeScale = 0;
int16_t i, numChannels;
#ifdef FIX_1053_REVERB_RECONFIGURATION
uint16_t aeID;
#endif
ivas_error error = IVAS_ERR_OK;
bool splitBinNeedsNewFrame = true;
#ifdef WMOPS
reset_wmops();
......@@ -802,6 +756,19 @@ int main(
hSplitRendFileReadWrite = NULL;
CLDFBframeSize_smpls = 0;
cldfb_in_flag = 0;
bitsBuffer.bits = NULL;
bitsBuffer.config.bitsRead = 0;
bitsBuffer.config.bitsWritten = 0;
bitsBuffer.config.bufLenInBytes = 0;
bitsBuffer.config.codec = ISAR_SPLIT_REND_CODEC_DEFAULT;
bitsBuffer.config.poseCorrection = ISAR_SPLIT_REND_POSE_CORRECTION_MODE_NONE;
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
bitsBuffer.config.codec_frame_size_ms = 5;
bitsBuffer.config.isar_frame_size_ms = 20;
bitsBuffer.config.lc3plus_highres = 0;
#else
bitsBuffer.config.codec_frame_size_ms = 20;
#endif
#endif
for ( i = 0; i < RENDERER_MAX_MC_INPUTS; ++i )
{
......@@ -894,11 +861,7 @@ int main(
else
{
/* With single-format input, all information is given on command line. */
#ifdef SPLIT_REND_WITH_HEAD_ROT
setupWithSingleFormatInput( args, audioFilePath, positionProvider, masaReaders, &hSplitRendFileReadWrite );
#else
setupWithSingleFormatInput( args, audioFilePath, positionProvider, masaReaders );
#endif
}
/* Check that there is allowed configuration for MASA format output */
......@@ -919,44 +882,14 @@ int main(
}
}
#ifdef SPLIT_REND_WITH_HEAD_ROT
/*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 ) )
{
error = split_rend_reader_open( &hSplitRendFileReadWrite, args.inputFilePath );
if ( error != IVAS_ERR_OK )
{
fprintf( stderr, "Could not open split rend metadata file %s\n", args.inputFilePath );
exit( -1 );
}
audioReader = NULL;
}
else
{
#endif
if ( AudioFileReader_open( &audioReader, audioFilePath ) != IVAS_ERR_OK )
{
fprintf( stderr, "Error opening file: %s\n", audioFilePath );
exit( -1 );
}
#ifdef SPLIT_REND_WITH_HEAD_ROT
}
#endif
int32_t inFileSampleRate = 0;
#ifdef SPLIT_REND_WITH_HEAD_ROT
if ( audioReader != NULL )
{
#endif
error = AudioFileReader_getSamplingRate( audioReader, &inFileSampleRate );
#ifdef SPLIT_REND_WITH_HEAD_ROT
}
else
{
inFileSampleRate = args.sampleRate;
}
#endif
switch ( error )
{
case IVAS_ERR_OK:
......@@ -985,19 +918,13 @@ int main(
}
int16_t inFileNumChannels = 0;
#ifdef SPLIT_REND_WITH_HEAD_ROT
if ( audioReader != NULL )
{
#endif
error = AudioFileReader_getNumChannels( audioReader, &inFileNumChannels );
if ( error != IVAS_ERR_OK && error != IVAS_ERR_NUM_CHANNELS_UNKNOWN )
{
fprintf( stderr, "Error: %s\n", ivas_error_to_string( error ) );
exit( -1 );
}
#ifdef SPLIT_REND_WITH_HEAD_ROT
}
#endif
const int16_t frameSize_smpls = (int16_t) ( ( args.render_framesize ) * args.sampleRate * 5 / ( 1000 ) );
if ( ( error = IVAS_REND_Open( &hIvasRend, args.sampleRate, args.outConfig.audioConfig, !isEmptyString( args.customHrtfFilePath ), args.nonDiegeticPan, args.nonDiegeticPanGain, (int16_t) args.render_framesize ) ) != IVAS_ERR_OK )
......@@ -1160,7 +1087,12 @@ int main(
if ( args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB )
{
#ifdef FIX_1053_REVERB_RECONFIGURATION
aeID = args.aeSequence.count > 0 ? args.aeSequence.pID[0] : 65535;
if ( ( error = RenderConfigReader_getAcousticEnvironment( renderConfigReader, aeID, &renderConfig.roomAcoustics ) ) == IVAS_ERR_OK )
#else
if ( ( error = RenderConfigReader_getAcousticEnvironment( renderConfigReader, args.acousticEnvironmentId, &renderConfig.roomAcoustics ) ) == IVAS_ERR_OK )
#endif
{
if ( RenderConfigReader_checkValues( &renderConfig ) != IVAS_ERR_OK )
{
......@@ -1170,12 +1102,24 @@ int main(
}
else
{
#ifdef FIX_1053_REVERB_RECONFIGURATION
fprintf( stderr, "Failed to get acoustic environment with ID: %d\n\n", aeID );
#else
fprintf( stderr, "Failed to get acoustic environment with ID: %d\n\n", args.acousticEnvironmentId );
#endif
exit( -1 );
}
renderConfig.roomAcoustics.override = 1;
}
#ifdef SPLIT_REND_WITH_HEAD_ROT
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
/* ISAR frame size is set from command line, not renderer config file.
* This will be ignored if output format is not split rendering. */
renderConfig.split_rend_config.isar_frame_size_ms = (int16_t) args.render_framesize /* given in number of 5ms subframes */ * 5;
#endif
#endif
if ( ( error = IVAS_REND_FeedRenderConfig( hIvasRend, renderConfig ) ) != IVAS_ERR_OK )
{
#ifdef SPLIT_REND_WITH_HEAD_ROT
......@@ -1187,11 +1131,8 @@ int main(
}
#ifdef SPLIT_REND_WITH_HEAD_ROT
if ( !is_split_post_rend_mode( &args ) )
{
CLDFBframeSize_smpls = frameSize_smpls * 2;
cldfb_in_flag = get_cldfb_in_flag( args.outConfig.audioConfig, &renderConfig );
}
#endif
}
......@@ -1254,9 +1195,6 @@ int main(
IVAS_REND_InputId ismIds[RENDERER_MAX_ISM_INPUTS];
IVAS_REND_InputId sbaIds[RENDERER_MAX_SBA_INPUTS];
IVAS_REND_InputId masaIds[RENDERER_MAX_MASA_INPUTS];
#ifdef SPLIT_REND_WITH_HEAD_ROT
IVAS_REND_InputId splitBinIds[RENDERER_MAX_BIN_INPUTS];
#endif
for ( i = 0; i < RENDERER_MAX_MC_INPUTS; i++ )
{
......@@ -1274,12 +1212,6 @@ int main(
{
masaIds[i] = 0u;
}
#ifdef SPLIT_REND_WITH_HEAD_ROT
for ( i = 0; i < RENDERER_MAX_BIN_INPUTS; i++ )
{
splitBinIds[i] = 0u;
}
#endif
for ( i = 0; i < args.inConfig.numMultiChannelBuses; ++i )
{
......@@ -1397,23 +1329,6 @@ int main(
}
}
#ifdef SPLIT_REND_WITH_HEAD_ROT
for ( i = 0; i < args.inConfig.numBinBuses; ++i )
{
if ( ( error = IVAS_REND_AddInput( hIvasRend, args.inConfig.binBuses[i].audioConfig, &splitBinIds[i] ) ) != IVAS_ERR_OK )
{
fprintf( stderr, "Error: %s\n", ivas_error_to_string( error ) );
exit( -1 );
}
if ( ( error = IVAS_REND_SetInputGain( hIvasRend, splitBinIds[i], args.inputGainGlobal * dBToLin( args.inConfig.binBuses[i].gain_dB ) ) ) != IVAS_ERR_OK )
{
fprintf( stderr, "Error: %s\n", ivas_error_to_string( error ) );
exit( -1 );
}
}
#endif
for ( i = 0; i < args.inConfig.numMasaBuses; ++i )
{
if ( ( error = IVAS_REND_AddInput( hIvasRend, args.inConfig.masaBuses[i].audioConfig, &masaIds[i] ) ) != IVAS_ERR_OK )
......@@ -1429,11 +1344,7 @@ int main(
}
}
#ifdef SPLIT_REND_WITH_HEAD_ROT
const int16_t totalNumInChannels = getTotalNumInChannels( hIvasRend, mcIds, ismIds, sbaIds, masaIds, splitBinIds );
#else
const int16_t totalNumInChannels = getTotalNumInChannels( hIvasRend, mcIds, ismIds, sbaIds, masaIds );
#endif
if ( inFileNumChannels != 0 /* inFileNumChannels is 0 with raw PCM input */ && totalNumInChannels != inFileNumChannels )
{
......@@ -1468,13 +1379,37 @@ int main(
if ( args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED )
{
IVAS_REND_GetSplitRendBitstreamHeader( hIvasRend,
&bitsBuffer.config.codec,
&bitsBuffer.config.poseCorrection,
&bitsBuffer.config.codec_frame_size_ms
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
,
&bitsBuffer.config.isar_frame_size_ms
#endif
);
if ( IVAS_REND_GetDelay( hIvasRend, &delayNumSamples_temp, &delayTimeScale_temp ) != IVAS_ERR_OK )
{
fprintf( stderr, "\nUnable to get delay of renderer!\n" );
exit( -1 );
}
if ( ( error = split_rend_writer_open( &hSplitRendFileReadWrite, args.outputFilePath, delayNumSamples_temp, delayTimeScale_temp ) ) != IVAS_ERR_OK )
if ( ( error = split_rend_writer_open( &hSplitRendFileReadWrite,
args.outputFilePath,
delayNumSamples_temp,
delayTimeScale_temp,
bitsBuffer.config.codec,
bitsBuffer.config.poseCorrection,
bitsBuffer.config.codec_frame_size_ms
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
,
bitsBuffer.config.isar_frame_size_ms,
args.sampleRate,
bitsBuffer.config.lc3plus_highres
#endif
) ) != IVAS_ERR_OK )
{
fprintf( stderr, "Could not open split rend metadata file %s\n", args.outputFilePath );
exit( -1 );
......@@ -1485,13 +1420,37 @@ int main(
{
if ( args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
{
IVAS_REND_GetSplitRendBitstreamHeader( hIvasRend,
&bitsBuffer.config.codec,
&bitsBuffer.config.poseCorrection,
&bitsBuffer.config.codec_frame_size_ms
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
,
&bitsBuffer.config.isar_frame_size_ms
#endif
);
if ( IVAS_REND_GetDelay( hIvasRend, &delayNumSamples_temp, &delayTimeScale_temp ) != IVAS_ERR_OK )
{
fprintf( stderr, "\nUnable to get delay of renderer!\n" );
exit( -1 );
}
if ( ( error = split_rend_writer_open( &hSplitRendFileReadWrite, args.outMetadataFilePath, delayNumSamples_temp, delayTimeScale_temp ) ) != IVAS_ERR_OK )
if ( ( error = split_rend_writer_open( &hSplitRendFileReadWrite,
args.outMetadataFilePath,
delayNumSamples_temp,
delayTimeScale_temp,
bitsBuffer.config.codec,
bitsBuffer.config.poseCorrection,
bitsBuffer.config.codec_frame_size_ms
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
,
bitsBuffer.config.isar_frame_size_ms,
args.sampleRate,
bitsBuffer.config.lc3plus_highres
#endif
) ) != IVAS_ERR_OK )
{
fprintf( stderr, "Could not open split rend metadata file %s\n", args.outMetadataFilePath );
exit( -1 );
......@@ -1539,7 +1498,7 @@ int main(
memset( outBuffer.data, 0, outBuffer.config.numSamplesPerChannel * outBuffer.config.numChannels * sizeof( float ) );
if ( is_split_pre_rend_mode( &args ) || is_split_post_rend_mode( &args ) )
if ( is_split_pre_rend_mode( &args ) )
{
bitsBufferSize = SPLIT_REND_BITS_BUFF_SIZE;
}
......@@ -1561,9 +1520,6 @@ int main(
bitsBuffer.config.bitsRead = 0;
bitsBuffer.config.bitsWritten = 0;
bitsBuffer.config.bufLenInBytes = bitsBufferSize;
bitsBuffer.config.codec = IVAS_SPLIT_REND_CODEC_DEFAULT;
bitsBuffer.config.poseCorrection = IVAS_SPLIT_REND_POSE_CORRECTION_MODE_NONE;
bitsBuffer.config.codec_frame_size_ms = 20;
#else
inFloatBuffer = malloc( inBufferSize * sizeof( float ) );
outInt16Buffer = malloc( outBufferSize * sizeof( int16_t ) );
......@@ -1601,43 +1557,50 @@ int main(
num_in_channels = inBuffer.config.numChannels;
const bool isCurrentFrameMultipleOf20ms = frame % ( 4 / args.render_framesize ) == 0;
#ifdef SPLIT_REND_WITH_HEAD_ROT
numSamplesRead = 0;
if ( ( hSplitRendFileReadWrite != NULL ) && is_split_post_rend_mode( &args ) && splitBinNeedsNewFrame )
#ifdef FIX_1053_REVERB_RECONFIGURATION
if ( args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB && renderConfigReader != NULL &&
args.aeSequence.count > 0 && args.aeSequence.pValidity[args.aeSequence.selected] != 0 )
{
ivas_error error_tmp;
numSamplesRead = (int16_t) inBufferSize;
error_tmp = split_rend_read_bits_from_file( hSplitRendFileReadWrite, bitsBuffer.bits, &bitsBuffer.config.bitsRead, &bitsBuffer.config.bitsWritten,
&bitsBuffer.config.codec, &bitsBuffer.config.poseCorrection,
&bitsBuffer.config.codec_frame_size_ms );
if ( error_tmp != IVAS_ERR_OK )
if ( ++args.aeSequence.frameCounter >= args.aeSequence.pValidity[args.aeSequence.selected] )
{
if ( error_tmp == IVAS_ERR_END_OF_FILE )
IVAS_RENDER_CONFIG_DATA renderConfig;
if ( ++args.aeSequence.selected >= args.aeSequence.count )
{
numSamplesRead = 0;
args.aeSequence.selected = 0;
}
else
args.aeSequence.frameCounter = 0;
if ( ( error = RenderConfigReader_getAcousticEnvironment( renderConfigReader, args.aeSequence.pID[args.aeSequence.selected], &renderConfig.roomAcoustics ) ) == IVAS_ERR_OK )
{
fprintf( stderr, "\nUnable to read from bitstream file!\n" );
exit( -1 );
if ( RenderConfigReader_checkValues( &renderConfig ) != IVAS_ERR_OK )
{
fprintf( stderr, "Invalid acoustic environment configuratoin parameters\n\n" );
goto cleanup;
}
}
else
{
fprintf( stderr, "Failed to get acoustic environment with ID %d\n\n", args.aeSequence.pID[args.aeSequence.selected] );
goto cleanup;
}
if ( audioReader != NULL )
if ( ( error = IVAS_REND_FeedRenderConfig( hIvasRend, renderConfig ) ) != IVAS_ERR_OK )
{
fprintf( stderr, "\nIVAS_REND_FeedRenderConfig failed: %s\n\n", ivas_error_to_string( error ) );
goto cleanup;
}
}
}
#endif
numSamplesRead = 0;
/* Read the input data */
if ( ( error = AudioFileReader_read( audioReader, inpInt16Buffer, (int16_t) inBufferSize, &numSamplesRead ) ) != IVAS_ERR_OK )
{
fprintf( stderr, "\nError reading from file %s\n", audioFilePath );
exit( -1 );
}
#ifdef SPLIT_REND_WITH_HEAD_ROT
}
#endif
if ( numSamplesRead == 0 && splitBinNeedsNewFrame )
if ( numSamplesRead == 0 )
{
/* end of input data */
break;
......@@ -1726,25 +1689,6 @@ int main(
}
}
#ifdef SPLIT_REND_WITH_HEAD_ROT
/* Read from split renderer bfi file if specified */
if ( splitRendBFIReader != NULL && splitBinNeedsNewFrame )
{
int16_t bfi;
if ( ( error = SplitRendBFIFileReading( splitRendBFIReader, &bfi ) ) != IVAS_ERR_OK )
{
fprintf( stderr, "Error in SplitRendBFIFileReading(): %s\n", ivas_error_to_string( error ) );
exit( -1 );
}
if ( ( error = IVAS_REND_SetSplitRendBFI( hIvasRend, bfi ) ) != IVAS_ERR_OK )
{
fprintf( stderr, "Error in IVAS_REND_SetSplitRendBFI(): %s\n", ivas_error_to_string( error ) );
exit( -1 );
}
}
#endif
/* Read from external orientation file if specified */
if ( externalOrientationFileReader != NULL )
{
......@@ -1885,46 +1829,8 @@ int main(
}
}
#ifdef SPLIT_REND_WITH_HEAD_ROT
for ( i = 0; i < args.inConfig.numBinBuses; ++i )
{
if ( numSamplesRead > 0 )
{
if ( ( error = IVAS_REND_GetInputNumChannels( hIvasRend, splitBinIds[i], &numChannels ) ) != IVAS_ERR_OK )
{
fprintf( stderr, "Error: %s\n", ivas_error_to_string( error ) );
exit( -1 );
}
IVAS_REND_ReadOnlyAudioBuffer tmpBuffer = getReadOnlySubBuffer( inBuffer, (int16_t) args.inConfig.binBuses[i].inputChannelIndex, numChannels );
if ( ( error = IVAS_REND_FeedInputAudio( hIvasRend, splitBinIds[i], tmpBuffer ) ) != IVAS_ERR_OK )
{
fprintf( stderr, "Error: %s\n", ivas_error_to_string( error ) );
exit( -1 );
}
}
if ( splitBinNeedsNewFrame )
{
if ( ( error = IVAS_REND_FeedSplitBinauralBitstream( hIvasRend, splitBinIds[i], &bitsBuffer ) ) != IVAS_ERR_OK )
{
fprintf( stderr, "Error: %s\n", ivas_error_to_string( error ) );
exit( -1 );
}
}
}
#endif
#ifdef SPLIT_REND_WITH_HEAD_ROT
if ( args.inConfig.numBinBuses != 0 )
{
if ( ( error = IVAS_REND_GetSplitBinauralSamples( hIvasRend, outBuffer, &splitBinNeedsNewFrame ) ) != IVAS_ERR_OK )
{
fprintf( stderr, "Error: %s\n", ivas_error_to_string( error ) );
exit( -1 );
}
}
else if ( args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
if ( args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
{
if ( ( error = IVAS_REND_GetSplitBinauralBitstream( hIvasRend, outBuffer, &bitsBuffer ) ) != IVAS_ERR_OK )
{
......@@ -1973,15 +1879,6 @@ int main(
exit( -1 );
}
#ifdef SPLIT_REND_WITH_HEAD_ROT
if ( is_split_post_rend_mode( &args ) && ( hSplitRendFileReadWrite != NULL ) )
{
uint32_t pre_rend_delay_ns;
split_rend_read_pre_rend_delay_ns( hSplitRendFileReadWrite, &pre_rend_delay_ns );
delayNumSamples += (int16_t) roundf( (float) pre_rend_delay_ns * delayTimeScale / 1000000000.f );
}
#endif
delayNumSamples_orig = delayNumSamples;
}
else
......@@ -1994,9 +1891,8 @@ int main(
#ifdef SPLIT_REND_WITH_HEAD_ROT
if ( is_split_pre_rend_mode( &args ) )
{
if ( split_rend_write_bitstream_to_file( hSplitRendFileReadWrite, bitsBuffer.bits, &bitsBuffer.config.bitsRead, &bitsBuffer.config.bitsWritten,
bitsBuffer.config.codec, bitsBuffer.config.poseCorrection,
bitsBuffer.config.codec_frame_size_ms ) != IVAS_ERR_OK )
if ( split_rend_write_bitstream_to_file( hSplitRendFileReadWrite, bitsBuffer.bits, &bitsBuffer.config.bitsRead,
&bitsBuffer.config.bitsWritten ) != IVAS_ERR_OK )
{
fprintf( stderr, "\nUnable to write to bitstream file!\n" );
exit( -1 );
......@@ -2192,6 +2088,13 @@ cleanup:
{
free( bitsBufferData );
}
#endif
#ifdef FIX_1053_REVERB_RECONFIGURATION
if ( args.aeSequence.count > 0 )
{
free( args.aeSequence.pID );
free( args.aeSequence.pValidity );
}
#endif
for ( i = 0; i < RENDERER_MAX_MASA_INPUTS; ++i )
{
......@@ -2285,9 +2188,6 @@ static bool parseInConfig(
inConfig->numAmbisonicsBuses = 0;
inConfig->numMultiChannelBuses = 0;
inConfig->numMasaBuses = 0;
#ifdef SPLIT_REND_WITH_HEAD_ROT
inConfig->numBinBuses = 0;
#endif
/* First check if input is being set to scene description file - this is not covered by parseAudioConfig(). */
strncpy( charBuf, inFormatStr, sizeof( charBuf ) - 1 );
......@@ -2325,15 +2225,6 @@ static bool parseInConfig(
inConfig->ambisonicsBuses[0].inputChannelIndex = 0;
inConfig->ambisonicsBuses[0].gain_dB = 0.0f;
break;
#ifdef SPLIT_REND_WITH_HEAD_ROT
case IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED:
case IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM:
inConfig->numBinBuses = 1;
inConfig->binBuses[0].audioConfig = audioConfig;
inConfig->binBuses[0].inputChannelIndex = 0;
inConfig->binBuses[0].gain_dB = 0.0f;
break;
#endif
case IVAS_AUDIO_CONFIG_MASA1:
case IVAS_AUDIO_CONFIG_MASA2:
inConfig->numMasaBuses = 1;
......@@ -2673,6 +2564,94 @@ static bool parseLfePositionConfig(
}
#ifdef FIX_1053_REVERB_RECONFIGURATION
static bool parseAcousticEnvironmentIds(
const char *value,
AcousticEnvironmentSequence *aeSequence )
{
uint16_t k;
char config_string[RENDERER_MAX_METADATA_LINE_LENGTH];
char *s;
char *token;
strncpy( config_string, value, RENDERER_MAX_METADATA_LINE_LENGTH );
s = config_string;
token = config_string;
if ( !is_digits_only( config_string ) )
{
for ( k = 0; s[k]; )
{
s[k] == ',' ? k++ : *s++;
}
k++;
if ( k == 0 )
{
fprintf( stdout, "Error: Invalid acoustic environment sequence specified: %s\n\n", config_string );
return false;
}
if ( NULL == ( aeSequence->pID = malloc( sizeof( uint16_t ) * k ) ) ||
NULL == ( aeSequence->pValidity = malloc( sizeof( uint16_t ) * k ) ) )
{
fprintf( stdout, "Error: Unable to allocate memory for acoustic environment sequence: %s\n\n", config_string );
return false;
}
aeSequence->count = k;
k = 0;
token = strtok( config_string, ":" );
while ( token != NULL )
{
if ( !is_number( token ) )
{
fprintf( stdout, "Error: Invalid token %s found in acoustic environment sequence: %s\n\n", token, config_string );
return false;
}
aeSequence->pID[k] = (uint16_t) atoi( token );
token = strtok( NULL, "," );
if ( !is_number( token ) )
{
fprintf( stdout, "Error: Invalid token %s found in acoustic environment sequence: %s\n\n", token, config_string );
return false;
}
aeSequence->pValidity[k] = (uint16_t) atoi( token );
token = strtok( NULL, ":" );
k++;
}
if ( k != aeSequence->count )
{
fprintf( stdout, "Error while parsing acoustic environment sequence: %s\n\n", config_string );
return false;
}
}
else
{
/* A single acoustic environment */
if ( NULL == ( aeSequence->pID = malloc( sizeof( uint16_t ) ) ) ||
NULL == ( aeSequence->pValidity = malloc( sizeof( uint16_t ) ) ) )
{
fprintf( stdout, "Error: Unable to allocate memory for acoustic environment sequence: %s\n\n", config_string );
return false;
}
aeSequence->count = 1;
aeSequence->pID[0] = (int16_t) atoi( config_string );
aeSequence->pValidity[0] = 0;
}
return true;
}
#endif
static bool checkRequiredArgs(
CmdlnArgs args )
{
......@@ -2687,18 +2666,10 @@ static bool checkRequiredArgs(
missingRequiredArg = true;
}
#ifdef SPLIT_REND_WITH_HEAD_ROT
const bool singleInputSpecified = args.inConfig.numAudioObjects != 0 ||
args.inConfig.numAmbisonicsBuses != 0 ||
args.inConfig.numMultiChannelBuses != 0 ||
args.inConfig.numMasaBuses != 0 ||
args.inConfig.numBinBuses != 0;
#else
const bool singleInputSpecified = args.inConfig.numAudioObjects != 0 ||
args.inConfig.numAmbisonicsBuses != 0 ||
args.inConfig.numMultiChannelBuses != 0 ||
args.inConfig.numMasaBuses != 0;
#endif
if ( !args.sceneDescriptionInput && !singleInputSpecified )
{
......@@ -2789,7 +2760,15 @@ static CmdlnArgs defaultArgs(
args.directivityPatternId[i] = 65535;
}
#ifdef FIX_1053_REVERB_RECONFIGURATION
args.aeSequence.count = 0;
args.aeSequence.pID = NULL;
args.aeSequence.pValidity = NULL;
args.aeSequence.selected = 0;
args.aeSequence.frameCounter = 0;
#else
args.acousticEnvironmentId = 65535;
#endif
return args;
}
......@@ -2961,12 +2940,19 @@ static void parseOption(
break;
case CmdLnOptionId_acousticEnvironmentId:
assert( numOptionValues == 1 );
#ifdef FIX_1053_REVERB_RECONFIGURATION
if ( !parseAcousticEnvironmentIds( optionValues[0], &args->aeSequence ) )
{
fprintf( stderr, "Invalid acoustic environment ID specified: %s\n", optionValues[0] );
}
#else
if ( !is_digits_only( optionValues[0] ) )
{
fprintf( stderr, "Invalid acousting environment ID specified: %s\n", optionValues[0] );
exit( -1 );
}
args->acousticEnvironmentId = (int16_t) strtol( optionValues[0], NULL, 10 );
#endif
break;
case CmdLnOptionId_syncMdDelay:
assert( numOptionValues == 1 );
......
#!/usr/bin/env python3
"""
(C) 2022-2024 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 sys
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("prm_file", type=str)
parser.add_argument("max_length", type=int)
args = parser.parse_args()
skiplines = 8
exceeded = []
with open(args.prm_file, "r") as f:
for line in f:
if skiplines > 0:
skiplines = skiplines - 1
else:
if "//" in line and all(x not in line for x in ["IVAS_cod", "IVAS_dec", "IVAS_rend"]) and len(line) > args.max_length:
exceeded.append(line)
if exceeded:
print(
f"Failed! *** Following tests cases exceeded the limit of {args.max_length} characters ***\n"
)
print("\n".join(exceeded))
sys.exit(-1)
print("All OK")
sys.exit(0)