Skip to content
Commits on Source (191)
...@@ -426,7 +426,7 @@ codec-smoke-test: ...@@ -426,7 +426,7 @@ codec-smoke-test:
- if cat smoke_test_output_hrtf.txt | grep -c "failed"; then echo "Smoke test with external hrtf files failed"; ret_val=1; fi - if cat smoke_test_output_hrtf.txt | grep -c "failed"; then echo "Smoke test with external hrtf files failed"; ret_val=1; fi
- exit $ret_val - exit $ret_val
artifacts: artifacts:
name: "mr-$CI_MERGE_REQUEST_IID--sha-$CI_COMMIT_SHORT_SHA--stage-$CI_JOB_STAGE--results" name: "mr-$CI_MERGE_REQUEST_IID--sha-$CI_COMMIT_SHORT_SHA--job-$CI_JOB_NAME--results"
expire_in: 1 week expire_in: 1 week
when: always when: always
paths: paths:
...@@ -508,7 +508,7 @@ pytest-compare-20ms-and-5ms-rendering: ...@@ -508,7 +508,7 @@ pytest-compare-20ms-and-5ms-rendering:
- if [ $exit_code10 -ne 0 ]; then echo "Non-bitexact cases encountered with 10ms rendering!"; exit_code=1; fi - if [ $exit_code10 -ne 0 ]; then echo "Non-bitexact cases encountered with 10ms rendering!"; exit_code=1; fi
- if [ $exit_code -ne 0 ]; then exit $EXIT_CODE_FAIL; fi - if [ $exit_code -ne 0 ]; then exit $EXIT_CODE_FAIL; fi
artifacts: artifacts:
name: "mr-$CI_MERGE_REQUEST_IID--sha-$CI_COMMIT_SHORT_SHA--stage-$CI_JOB_STAGE--results" name: "mr-$CI_MERGE_REQUEST_IID--sha-$CI_COMMIT_SHORT_SHA--job-$CI_JOB_NAME--results"
expire_in: 1 week expire_in: 1 week
when: always when: always
expose_as: "pytest 5ms and 10ms vs 20ms results" expose_as: "pytest 5ms and 10ms vs 20ms results"
...@@ -550,7 +550,7 @@ renderer-smoke-test: ...@@ -550,7 +550,7 @@ renderer-smoke-test:
- .rules-merge-request-to-main - .rules-merge-request-to-main
needs: ["build-codec-linux-cmake"] needs: ["build-codec-linux-cmake"]
stage: test stage: test
timeout: "30 minutes" timeout: "1 hour"
artifacts: artifacts:
name: "mr-$CI_MERGE_REQUEST_IID--sha-$CI_COMMIT_SHORT_SHA--job-$CI_JOB_NAME--results" name: "mr-$CI_MERGE_REQUEST_IID--sha-$CI_COMMIT_SHORT_SHA--job-$CI_JOB_NAME--results"
expire_in: 1 week expire_in: 1 week
...@@ -773,6 +773,12 @@ ivas-pytest-on-merge-request: ...@@ -773,6 +773,12 @@ ivas-pytest-on-merge-request:
stage: compare stage: compare
needs: ["build-codec-linux-cmake", "codec-smoke-test"] needs: ["build-codec-linux-cmake", "codec-smoke-test"]
timeout: "14 minutes" timeout: "14 minutes"
parallel:
matrix:
# note: keep in sync with list in $TESTS_DIR_CODEC_BE_ON_MR
- PYTEST_SCRIPT:
- test_param_file.py
- test_sba.py
script: script:
- bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/print-common-info.sh - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/print-common-info.sh
- commits_behind_count="$(bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/get-commits-behind-count.sh)" - commits_behind_count="$(bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/get-commits-behind-count.sh)"
...@@ -790,7 +796,7 @@ ivas-pytest-on-merge-request: ...@@ -790,7 +796,7 @@ ivas-pytest-on-merge-request:
### prepare pytest ### prepare pytest
# create references # create references
- python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR -v --update_ref 1 - python3 -m pytest "$TESTS_DIR_CODEC_BE_ON_MR"/"$PYTEST_SCRIPT" -v --update_ref 1
### Run test using branch scripts and input ### Run test using branch scripts and input
- if [ $ref_using_main == 1 ]; then git checkout $source_branch_commit_sha; fi - if [ $ref_using_main == 1 ]; then git checkout $source_branch_commit_sha; fi
...@@ -798,7 +804,7 @@ ivas-pytest-on-merge-request: ...@@ -798,7 +804,7 @@ ivas-pytest-on-merge-request:
### run pytest ### run pytest
- exit_code=0 - exit_code=0
- testcase_timeout=60 - testcase_timeout=60
- python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR -v --html=report.html --self-contained-html --junit-xml=report-junit.xml --testcase_timeout=$testcase_timeout || exit_code=$? - python3 -m pytest "$TESTS_DIR_CODEC_BE_ON_MR"/"$PYTEST_SCRIPT" -v --html=report.html --self-contained-html --junit-xml=report-junit.xml --testcase_timeout=$testcase_timeout || exit_code=$?
- zero_errors=$(cat report-junit.xml | grep -c 'errors="0"') || true - zero_errors=$(cat report-junit.xml | grep -c 'errors="0"') || true
- *merge-request-comparison-check - *merge-request-comparison-check
...@@ -807,7 +813,7 @@ ivas-pytest-on-merge-request: ...@@ -807,7 +813,7 @@ ivas-pytest-on-merge-request:
exit_codes: exit_codes:
- 123 - 123
artifacts: artifacts:
name: "mr-$CI_MERGE_REQUEST_IID--sha-$CI_COMMIT_SHORT_SHA--stage-$CI_JOB_STAGE--results" name: "mr-$CI_MERGE_REQUEST_IID--sha-$CI_COMMIT_SHORT_SHA--job-$CI_JOB_NAME--results"
expire_in: 1 week expire_in: 1 week
when: always when: always
paths: paths:
...@@ -858,7 +864,7 @@ ivas-interop-on-merge-request: ...@@ -858,7 +864,7 @@ ivas-interop-on-merge-request:
exit_codes: exit_codes:
- 123 - 123
artifacts: artifacts:
name: "mr-$CI_MERGE_REQUEST_IID--sha-$CI_COMMIT_SHORT_SHA--stage-$CI_JOB_STAGE--results" name: "mr-$CI_MERGE_REQUEST_IID--sha-$CI_COMMIT_SHORT_SHA--job-$CI_JOB_NAME--results"
expire_in: 1 week expire_in: 1 week
when: always when: always
paths: paths:
...@@ -910,7 +916,7 @@ evs-pytest-on-merge-request: ...@@ -910,7 +916,7 @@ evs-pytest-on-merge-request:
exit_codes: exit_codes:
- 123 - 123
artifacts: artifacts:
name: "mr-$CI_MERGE_REQUEST_IID--sha-$CI_COMMIT_SHORT_SHA--stage-$CI_JOB_STAGE--results" name: "mr-$CI_MERGE_REQUEST_IID--sha-$CI_COMMIT_SHORT_SHA--job-$CI_JOB_NAME--results"
expire_in: 1 week expire_in: 1 week
when: always when: always
paths: paths:
...@@ -1006,7 +1012,7 @@ check-first-frame-is-sid: ...@@ -1006,7 +1012,7 @@ check-first-frame-is-sid:
expose_as: "logs-sidstart" expose_as: "logs-sidstart"
expire_in: "5 days" expire_in: "5 days"
.lc3plus-ensure-no-code-changes: lc3plus-ensure-no-code-changes:
extends: extends:
- .test-job-linux - .test-job-linux
- .rules-merge-request-to-main - .rules-merge-request-to-main
...@@ -1018,7 +1024,7 @@ check-first-frame-is-sid: ...@@ -1018,7 +1024,7 @@ check-first-frame-is-sid:
- ./scripts/lc3plus_lib_setup/get_lc3plus.sh - ./scripts/lc3plus_lib_setup/get_lc3plus.sh
# Ensure git reports no changes # Ensure git reports no changes
- modified_files=$(git status -s) - modified_files=$(git status -su lib_lc3plus)
- if [[ $modified_files ]]; then printf 'LC3plus codebase was modified!\n\n'"$modified_files"'\n\n'; exit $EXIT_CODE_FAIL; fi - if [[ $modified_files ]]; then printf 'LC3plus codebase was modified!\n\n'"$modified_files"'\n\n'; exit $EXIT_CODE_FAIL; fi
check-bitexactness-hrtf-rom-and-file: check-bitexactness-hrtf-rom-and-file:
...@@ -1192,7 +1198,7 @@ codec-comparison-on-main-push: ...@@ -1192,7 +1198,7 @@ codec-comparison-on-main-push:
exit_codes: exit_codes:
- 123 - 123
artifacts: artifacts:
name: "main-push--sha-$CI_COMMIT_SHORT_SHA--stage-$CI_JOB_STAGE--results" name: "main-push--sha-$CI_COMMIT_SHORT_SHA--job-$CI_JOB_NAME--results"
expire_in: 1 week expire_in: 1 week
when: always when: always
paths: paths:
......
...@@ -106,7 +106,6 @@ ...@@ -106,7 +106,6 @@
<ClCompile Include="..\lib_lc3plus\apply_global_gain.c" /> <ClCompile Include="..\lib_lc3plus\apply_global_gain.c" />
<ClCompile Include="..\lib_lc3plus\ari_codec.c" /> <ClCompile Include="..\lib_lc3plus\ari_codec.c" />
<ClCompile Include="..\lib_lc3plus\attack_detector.c" /> <ClCompile Include="..\lib_lc3plus\attack_detector.c" />
<ClCompile Include="..\lib_lc3plus\plc_compute_stab_fac.c" />
<ClCompile Include="..\lib_lc3plus\constants.c" /> <ClCompile Include="..\lib_lc3plus\constants.c" />
<ClCompile Include="..\lib_lc3plus\cutoff_bandwidth.c" /> <ClCompile Include="..\lib_lc3plus\cutoff_bandwidth.c" />
<ClCompile Include="..\lib_lc3plus\dct4.c" /> <ClCompile Include="..\lib_lc3plus\dct4.c" />
...@@ -116,13 +115,13 @@ ...@@ -116,13 +115,13 @@
<ClCompile Include="..\lib_lc3plus\enc_entropy.c" /> <ClCompile Include="..\lib_lc3plus\enc_entropy.c" />
<ClCompile Include="..\lib_lc3plus\enc_lc3_fl.c" /> <ClCompile Include="..\lib_lc3plus\enc_lc3_fl.c" />
<ClCompile Include="..\lib_lc3plus\estimate_global_gain.c" /> <ClCompile Include="..\lib_lc3plus\estimate_global_gain.c" />
<ClCompile Include="..\lib_lc3plus\lc3plus_fft.c" />
<ClCompile Include="..\lib_lc3plus\imdct.c" /> <ClCompile Include="..\lib_lc3plus\imdct.c" />
<ClCompile Include="..\lib_lc3plus\lc3.c" /> <ClCompile Include="..\lib_lc3plus\lc3plus_fft.c" />
<ClCompile Include="..\lib_lc3plus\lc3plus.c" />
<ClCompile Include="..\lib_lc3plus\ltpf_coder.c" /> <ClCompile Include="..\lib_lc3plus\ltpf_coder.c" />
<ClCompile Include="..\lib_lc3plus\ltpf_decoder.c" /> <ClCompile Include="..\lib_lc3plus\ltpf_decoder.c" />
<ClCompile Include="..\lib_lc3plus\mdct.c" />
<ClCompile Include="..\lib_lc3plus\mdct_shaping.c" /> <ClCompile Include="..\lib_lc3plus\mdct_shaping.c" />
<ClCompile Include="..\lib_lc3plus\mdct.c" />
<ClCompile Include="..\lib_lc3plus\near_nyquist_detector.c" /> <ClCompile Include="..\lib_lc3plus\near_nyquist_detector.c" />
<ClCompile Include="..\lib_lc3plus\noise_factor.c" /> <ClCompile Include="..\lib_lc3plus\noise_factor.c" />
<ClCompile Include="..\lib_lc3plus\noise_filling.c" /> <ClCompile Include="..\lib_lc3plus\noise_filling.c" />
...@@ -133,35 +132,36 @@ ...@@ -133,35 +132,36 @@
<ClCompile Include="..\lib_lc3plus\pc_update.c" /> <ClCompile Include="..\lib_lc3plus\pc_update.c" />
<ClCompile Include="..\lib_lc3plus\per_band_energy.c" /> <ClCompile Include="..\lib_lc3plus\per_band_energy.c" />
<ClCompile Include="..\lib_lc3plus\plc_classify.c" /> <ClCompile Include="..\lib_lc3plus\plc_classify.c" />
<ClCompile Include="..\lib_lc3plus\plc_compute_stab_fac.c" />
<ClCompile Include="..\lib_lc3plus\plc_damping_scrambling.c" /> <ClCompile Include="..\lib_lc3plus\plc_damping_scrambling.c" />
<ClCompile Include="..\lib_lc3plus\plc_main.c" /> <ClCompile Include="..\lib_lc3plus\plc_main.c" />
<ClCompile Include="..\lib_lc3plus\plc_noise_substitution.c" /> <ClCompile Include="..\lib_lc3plus\plc_noise_substitution.c" />
<ClCompile Include="..\lib_lc3plus\plc_tdc_tdac.c" />
<ClCompile Include="..\lib_lc3plus\plc_update.c" />
<ClCompile Include="..\lib_lc3plus\plc_phecu_f0_refine_first.c" /> <ClCompile Include="..\lib_lc3plus\plc_phecu_f0_refine_first.c" />
<ClCompile Include="..\lib_lc3plus\plc_phecu_fec_hq.c" /> <ClCompile Include="..\lib_lc3plus\plc_phecu_fec_hq.c" />
<ClCompile Include="..\lib_lc3plus\plc_phecu_hq_ecu.c" /> <ClCompile Include="..\lib_lc3plus\plc_phecu_hq_ecu.c" />
<ClCompile Include="..\lib_lc3plus\plc_phecu_lf_peak_analysis.c" /> <ClCompile Include="..\lib_lc3plus\plc_phecu_lf_peak_analysis.c" />
<ClCompile Include="..\lib_lc3plus\plc_phecu_rec_frame.c" /> <ClCompile Include="..\lib_lc3plus\plc_phecu_rec_frame.c" />
<ClCompile Include="..\lib_lc3plus\plc_phecu_setf0hz.c" /> <ClCompile Include="..\lib_lc3plus\plc_phecu_setf0hz.c" />
<ClCompile Include="..\lib_lc3plus\plc_phecu_subst_spec.c" />
<ClCompile Include="..\lib_lc3plus\plc_phecu_spec_ana.c" /> <ClCompile Include="..\lib_lc3plus\plc_phecu_spec_ana.c" />
<ClCompile Include="..\lib_lc3plus\plc_phecu_subst_spec.c" />
<ClCompile Include="..\lib_lc3plus\plc_phecu_tba_per_band_gain.c" /> <ClCompile Include="..\lib_lc3plus\plc_phecu_tba_per_band_gain.c" />
<ClCompile Include="..\lib_lc3plus\plc_phecu_tba_spect_Xavg.c" /> <ClCompile Include="..\lib_lc3plus\plc_phecu_tba_spect_Xavg.c" />
<ClCompile Include="..\lib_lc3plus\plc_phecu_tba_trans_dect_gains.c" /> <ClCompile Include="..\lib_lc3plus\plc_phecu_tba_trans_dect_gains.c" />
<ClCompile Include="..\lib_lc3plus\plc_phecu_trans_burst_ana_sub.c" /> <ClCompile Include="..\lib_lc3plus\plc_phecu_trans_burst_ana_sub.c" />
<ClCompile Include="..\lib_lc3plus\plc_tdc_tdac.c" />
<ClCompile Include="..\lib_lc3plus\plc_tdc.c" />
<ClCompile Include="..\lib_lc3plus\plc_update.c" />
<ClCompile Include="..\lib_lc3plus\quantize_spec.c" /> <ClCompile Include="..\lib_lc3plus\quantize_spec.c" />
<ClCompile Include="..\lib_lc3plus\reorder_bitstream.c" /> <ClCompile Include="..\lib_lc3plus\reorder_bitstream.c" />
<ClCompile Include="..\lib_lc3plus\resamp12k8.c" /> <ClCompile Include="..\lib_lc3plus\resamp12k8.c" />
<ClCompile Include="..\lib_lc3plus\residual_coding.c" /> <ClCompile Include="..\lib_lc3plus\residual_coding.c" />
<ClCompile Include="..\lib_lc3plus\residual_decoding.c" /> <ClCompile Include="..\lib_lc3plus\residual_decoding.c" />
<ClCompile Include="..\lib_lc3plus\setup_dec_lc3.c" /> <ClCompile Include="..\lib_lc3plus\setup_com_lc3plus.c" />
<ClCompile Include="..\lib_lc3plus\setup_enc_lc3.c" /> <ClCompile Include="..\lib_lc3plus\setup_dec_lc3plus.c" />
<ClCompile Include="..\lib_lc3plus\setup_com_lc3.c" /> <ClCompile Include="..\lib_lc3plus\setup_enc_lc3plus.c" />
<ClCompile Include="..\lib_lc3plus\sns_compute_scf.c" /> <ClCompile Include="..\lib_lc3plus\sns_compute_scf.c" />
<ClCompile Include="..\lib_lc3plus\sns_interpolate_scf.c" /> <ClCompile Include="..\lib_lc3plus\sns_interpolate_scf.c" />
<ClCompile Include="..\lib_lc3plus\sns_quantize_scf.c" /> <ClCompile Include="..\lib_lc3plus\sns_quantize_scf.c" />
<ClCompile Include="..\lib_lc3plus\plc_tdc.c" />
<ClCompile Include="..\lib_lc3plus\tns_coder.c" /> <ClCompile Include="..\lib_lc3plus\tns_coder.c" />
<ClCompile Include="..\lib_lc3plus\tns_decoder.c" /> <ClCompile Include="..\lib_lc3plus\tns_decoder.c" />
</ItemGroup> </ItemGroup>
...@@ -169,14 +169,12 @@ ...@@ -169,14 +169,12 @@
<ClInclude Include="..\lib_lc3plus\clib.h" /> <ClInclude Include="..\lib_lc3plus\clib.h" />
<ClInclude Include="..\lib_lc3plus\constants.h" /> <ClInclude Include="..\lib_lc3plus\constants.h" />
<ClInclude Include="..\lib_lc3plus\defines.h" /> <ClInclude Include="..\lib_lc3plus\defines.h" />
<ClInclude Include="..\lib_lc3plus\file_io.h" />
<ClInclude Include="..\lib_lc3plus\functions.h" /> <ClInclude Include="..\lib_lc3plus\functions.h" />
<ClInclude Include="..\lib_lc3plus\lc3.h" /> <ClInclude Include="..\lib_lc3plus\lc3plus.h" />
<ClInclude Include="..\lib_lc3plus\setup_dec_lc3.h" /> <ClInclude Include="..\lib_lc3plus\license.h" />
<ClInclude Include="..\lib_lc3plus\setup_enc_lc3.h" /> <ClInclude Include="..\lib_lc3plus\setup_dec_lc3plus.h" />
<ClInclude Include="..\lib_lc3plus\setup_enc_lc3plus.h" />
<ClInclude Include="..\lib_lc3plus\structs.h" /> <ClInclude Include="..\lib_lc3plus\structs.h" />
<ClInclude Include="..\lib_lc3plus\tinywavein_c.h" />
<ClInclude Include="..\lib_lc3plus\tinywaveout_c.h" />
<ClInclude Include="..\lib_lc3plus\util.h" /> <ClInclude Include="..\lib_lc3plus\util.h" />
</ItemGroup> </ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
......
...@@ -175,6 +175,7 @@ ...@@ -175,6 +175,7 @@
<ClCompile Include="..\lib_rend\ivas_rom_rend.c" /> <ClCompile Include="..\lib_rend\ivas_rom_rend.c" />
<ClCompile Include="..\lib_rend\ivas_shoebox.c" /> <ClCompile Include="..\lib_rend\ivas_shoebox.c" />
<ClCompile Include="..\lib_rend\ivas_td_decorr.c" /> <ClCompile Include="..\lib_rend\ivas_td_decorr.c" />
<ClCompile Include="..\lib_rend\ivas_td_ring_buffer.c" />
<ClCompile Include="..\lib_rend\ivas_vbap.c" /> <ClCompile Include="..\lib_rend\ivas_vbap.c" />
<ClCompile Include="..\lib_rend\lib_rend.c" /> <ClCompile Include="..\lib_rend\lib_rend.c" />
</ItemGroup> </ItemGroup>
......
...@@ -32,30 +32,12 @@ ...@@ -32,30 +32,12 @@
<ClCompile Include="..\lib_rend\ivas_hrtf.c"> <ClCompile Include="..\lib_rend\ivas_hrtf.c">
<Filter>rend_c</Filter> <Filter>rend_c</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\lib_rend\ivas_lc3plus_common.c">
<Filter>rend_c</Filter>
</ClCompile>
<ClCompile Include="..\lib_rend\ivas_lc3plus_dec.c">
<Filter>rend_c</Filter>
</ClCompile>
<ClCompile Include="..\lib_rend\ivas_lc3plus_enc.c">
<Filter>rend_c</Filter>
</ClCompile>
<ClCompile Include="..\lib_rend\ivas_limiter.c">
<Filter>rend_c</Filter>
</ClCompile>
<ClCompile Include="..\lib_rend\ivas_masa_merge.c"> <ClCompile Include="..\lib_rend\ivas_masa_merge.c">
<Filter>rend_c</Filter> <Filter>rend_c</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\lib_rend\ivas_mcmasa_ana.c"> <ClCompile Include="..\lib_rend\ivas_mcmasa_ana.c">
<Filter>rend_c</Filter> <Filter>rend_c</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\lib_rend\ivas_MSPred.c">
<Filter>rend_c</Filter>
</ClCompile>
<ClCompile Include="..\lib_rend\ivas_NoiseGen.c">
<Filter>rend_c</Filter>
</ClCompile>
<ClCompile Include="..\lib_rend\ivas_objectRenderer.c"> <ClCompile Include="..\lib_rend\ivas_objectRenderer.c">
<Filter>rend_c</Filter> <Filter>rend_c</Filter>
</ClCompile> </ClCompile>
...@@ -83,15 +65,6 @@ ...@@ -83,15 +65,6 @@
<ClCompile Include="..\lib_rend\ivas_output_init.c"> <ClCompile Include="..\lib_rend\ivas_output_init.c">
<Filter>rend_c</Filter> <Filter>rend_c</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\lib_rend\ivas_PerceptualModel.c">
<Filter>rend_c</Filter>
</ClCompile>
<ClCompile Include="..\lib_rend\ivas_PredDecoder.c">
<Filter>rend_c</Filter>
</ClCompile>
<ClCompile Include="..\lib_rend\ivas_PredEncoder.c">
<Filter>rend_c</Filter>
</ClCompile>
<ClCompile Include="..\lib_rend\ivas_render_config.c"> <ClCompile Include="..\lib_rend\ivas_render_config.c">
<Filter>rend_c</Filter> <Filter>rend_c</Filter>
</ClCompile> </ClCompile>
...@@ -113,9 +86,6 @@ ...@@ -113,9 +86,6 @@
<ClCompile Include="..\lib_rend\ivas_reverb_utils.c"> <ClCompile Include="..\lib_rend\ivas_reverb_utils.c">
<Filter>rend_c</Filter> <Filter>rend_c</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\lib_rend\ivas_RMSEnvGrouping.c">
<Filter>rend_c</Filter>
</ClCompile>
<ClCompile Include="..\lib_rend\ivas_rom_binaural_crend_head.c"> <ClCompile Include="..\lib_rend\ivas_rom_binaural_crend_head.c">
<Filter>rend_c</Filter> <Filter>rend_c</Filter>
</ClCompile> </ClCompile>
...@@ -134,24 +104,6 @@ ...@@ -134,24 +104,6 @@
<ClCompile Include="..\lib_rend\ivas_sba_rendering.c"> <ClCompile Include="..\lib_rend\ivas_sba_rendering.c">
<Filter>rend_c</Filter> <Filter>rend_c</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\lib_rend\ivas_splitRend_lcld_dec.c">
<Filter>rend_c</Filter>
</ClCompile>
<ClCompile Include="..\lib_rend\ivas_splitRend_lcld_enc.c">
<Filter>rend_c</Filter>
</ClCompile>
<ClCompile Include="..\lib_rend\ivas_splitRenderer_utils.c">
<Filter>rend_c</Filter>
</ClCompile>
<ClCompile Include="..\lib_rend\ivas_splitRendererPLC.c">
<Filter>rend_c</Filter>
</ClCompile>
<ClCompile Include="..\lib_rend\ivas_splitRendererPost.c">
<Filter>rend_c</Filter>
</ClCompile>
<ClCompile Include="..\lib_rend\ivas_splitRendererPre.c">
<Filter>rend_c</Filter>
</ClCompile>
<ClCompile Include="..\lib_rend\ivas_shoebox.c"> <ClCompile Include="..\lib_rend\ivas_shoebox.c">
<Filter>rend_c</Filter> <Filter>rend_c</Filter>
</ClCompile> </ClCompile>
...@@ -161,30 +113,15 @@ ...@@ -161,30 +113,15 @@
<ClCompile Include="..\lib_rend\ivas_vbap.c"> <ClCompile Include="..\lib_rend\ivas_vbap.c">
<Filter>rend_c</Filter> <Filter>rend_c</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\lib_rend\ivas_lcld_rom_tables.c"> <ClCompile Include="..\lib_rend\ivas_td_decorr.c">
<Filter>rend_c</Filter>
</ClCompile>
<ClCompile Include="..\lib_rend\ivas_lcld_decoder.c">
<Filter>rend_c</Filter>
</ClCompile>
<ClCompile Include="..\lib_rend\ivas_lcld_encoder.c">
<Filter>rend_c</Filter> <Filter>rend_c</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\lib_rend\ivas_td_decorr.c"> <ClCompile Include="..\lib_rend\ivas_td_ring_buffer.c">
<Filter>rend_c</Filter> <Filter>rend_c</Filter>
</ClCompile> </ClCompile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="..\lib_rend\lib_rend.h" /> <ClInclude Include="..\lib_rend\lib_rend.h" />
<ClInclude Include="..\lib_rend\ivas_lc3plus_common.h">
<Filter>rend_h</Filter>
</ClInclude>
<ClInclude Include="..\lib_rend\ivas_lc3plus_enc.h">
<Filter>rend_h</Filter>
</ClInclude>
<ClInclude Include="..\lib_rend\ivas_lc3plus_dec.h">
<Filter>rend_h</Filter>
</ClInclude>
<ClInclude Include="..\lib_rend\ivas_prot_rend.h"> <ClInclude Include="..\lib_rend\ivas_prot_rend.h">
<Filter>rend_h</Filter> <Filter>rend_h</Filter>
</ClInclude> </ClInclude>
...@@ -203,12 +140,6 @@ ...@@ -203,12 +140,6 @@
<ClInclude Include="..\lib_rend\ivas_rom_TdBinauralRenderer.h"> <ClInclude Include="..\lib_rend\ivas_rom_TdBinauralRenderer.h">
<Filter>rend_h</Filter> <Filter>rend_h</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\lib_rend\ivas_lcld_prot.h">
<Filter>rend_h</Filter>
</ClInclude>
<ClInclude Include="..\lib_rend\ivas_lcld_rom_tables.h">
<Filter>rend_h</Filter>
</ClInclude>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Filter Include="rend_h"> <Filter Include="rend_h">
......
...@@ -1720,6 +1720,18 @@ static bool parseCmdlIVAS_dec( ...@@ -1720,6 +1720,18 @@ static bool parseCmdlIVAS_dec(
return false; return false;
} }
#ifdef SUPPORT_JBM_TRACEFILE
/* Validate options that depend on other options */
if ( arg->jbmTraceFilename != NULL && arg->delayCompensationEnabled
/* This decMode check should be removed once timestamp sync issues between JBM trace and audio are fixed in EVS */
&& arg->decMode != IVAS_DEC_MODE_EVS )
{
fprintf( stderr, "Error: Writing to a JBM trace file requires delay compensation to be disabled with -no_delay_cmp\n\n" );
usage_dec();
return false;
}
#endif
return true; return true;
} }
...@@ -1793,7 +1805,8 @@ static void usage_dec( void ) ...@@ -1793,7 +1805,8 @@ static void usage_dec( void )
fprintf( stdout, " EVS RTP Payload Format. The SDP parameter hf_only is required.\n" ); fprintf( stdout, " EVS RTP Payload Format. The SDP parameter hf_only is required.\n" );
fprintf( stdout, " Reading RFC4867 AMR/AMR-WB RTP payload format is not supported.\n" ); fprintf( stdout, " Reading RFC4867 AMR/AMR-WB RTP payload format is not supported.\n" );
#ifdef SUPPORT_JBM_TRACEFILE #ifdef SUPPORT_JBM_TRACEFILE
fprintf( stdout, "-Tracefile TF : VoIP mode: Generate trace file named TF\n" ); fprintf( stdout, "-Tracefile TF : VoIP mode: Generate trace file named TF. Requires -no_delay_cmp to\n" );
fprintf( stdout, " be enabled so that trace contents remain in sync with audio output.\n" );
#endif #endif
#ifdef DEBUGGING #ifdef DEBUGGING
#ifdef VARIABLE_SPEED_DECODING #ifdef VARIABLE_SPEED_DECODING
......
...@@ -68,9 +68,7 @@ ...@@ -68,9 +68,7 @@
#define IVAS_MAX16B_FLT 32767.0f #define IVAS_MAX16B_FLT 32767.0f
#define IVAS_MIN16B_FLT ( -32768.0f ) #define IVAS_MIN16B_FLT ( -32768.0f )
#ifdef NONBE_1359_FIX_IVASREND_OMASA_BINAURAL_LOUDNESS
#define OMASA_TDREND_MATCHING_GAIN_DB ( -2.0f ) #define OMASA_TDREND_MATCHING_GAIN_DB ( -2.0f )
#endif
#if !defined( DEBUGGING ) && !defined( WMOPS ) #if !defined( DEBUGGING ) && !defined( WMOPS )
static static
...@@ -566,12 +564,27 @@ static void setupWithSingleFormatInput( ...@@ -566,12 +564,27 @@ static void setupWithSingleFormatInput(
positionProvider->numObjects = args.inConfig.numAudioObjects; positionProvider->numObjects = args.inConfig.numAudioObjects;
for ( int16_t i = 0; i < positionProvider->numObjects; ++i ) for ( int16_t i = 0; i < positionProvider->numObjects; ++i )
{ {
#ifdef FIX_1376_MISSING_ISM_METADATA
/* Check if path to metadata file was given */
if ( isEmptyString( args.inMetadataFilePaths[i] ) )
{
fprintf( stderr, "No metadata file was given for ISM input %d\n", i );
exit( -1 );
}
/* It is allowed on CLI to have no metadata for an ISM input - skip opening if string contains "NULL" */
#else
/* It is allowed on CLI to have no metadata for an ISM input - skip opening if string is empty or contains "NULL" */ /* It is allowed on CLI to have no metadata for an ISM input - skip opening if string is empty or contains "NULL" */
#endif
char charBuf[FILENAME_MAX]; char charBuf[FILENAME_MAX];
strncpy( charBuf, args.inMetadataFilePaths[i], min( FILENAME_MAX, RENDERER_MAX_CLI_ARG_LENGTH ) - 1 ); strncpy( charBuf, args.inMetadataFilePaths[i], min( FILENAME_MAX, RENDERER_MAX_CLI_ARG_LENGTH ) - 1 );
charBuf[min( FILENAME_MAX, RENDERER_MAX_CLI_ARG_LENGTH ) - 1] = '\0'; charBuf[min( FILENAME_MAX, RENDERER_MAX_CLI_ARG_LENGTH ) - 1] = '\0';
to_upper( charBuf ); to_upper( charBuf );
#ifdef FIX_1376_MISSING_ISM_METADATA
if ( strncmp( charBuf, "NULL", 4 ) == 0 )
#else
if ( isEmptyString( args.inMetadataFilePaths[i] ) || strncmp( charBuf, "NULL", 4 ) == 0 ) if ( isEmptyString( args.inMetadataFilePaths[i] ) || strncmp( charBuf, "NULL", 4 ) == 0 )
#endif
{ {
continue; continue;
} }
...@@ -702,6 +715,7 @@ int main( ...@@ -702,6 +715,7 @@ int main(
SplitFileReadWrite *hSplitRendFileReadWrite; SplitFileReadWrite *hSplitRendFileReadWrite;
int16_t delayNumSamples_temp; int16_t delayNumSamples_temp;
int32_t delayTimeScale_temp; int32_t delayTimeScale_temp;
bool flushRendererLastFrame = false;
int16_t numSamplesRead; int16_t numSamplesRead;
int16_t delayNumSamples = -1; int16_t delayNumSamples = -1;
int16_t delayNumSamples_orig = 0; int16_t delayNumSamples_orig = 0;
...@@ -746,8 +760,11 @@ int main( ...@@ -746,8 +760,11 @@ int main(
CmdlnArgs args = parseCmdlnArgs( argc, argv ); CmdlnArgs args = parseCmdlnArgs( argc, argv );
if ( args.nonDiegeticPan && !( ( args.inConfig.numAudioObjects == 0 && args.inConfig.multiChannelBuses[0].audioConfig == IVAS_AUDIO_CONFIG_MONO ) || if ( args.nonDiegeticPan &&
( args.inConfig.numAudioObjects > 0 && args.inConfig.audioObjects[0].audioConfig == IVAS_AUDIO_CONFIG_OBA && args.inConfig.numAudioObjects == 1 ) ) ) !( ( args.inConfig.numAudioObjects == 0 &&
args.inConfig.multiChannelBuses[0].audioConfig == IVAS_AUDIO_CONFIG_MONO ) ||
( args.inConfig.numAudioObjects > 0 &&
args.inConfig.audioObjects[0].audioConfig == IVAS_AUDIO_CONFIG_OBA && args.inConfig.numAudioObjects == 1 ) ) )
{ {
fprintf( stderr, "\ninvalid configuration - non-diegetic panning requires mono or ISM1 input\n" ); fprintf( stderr, "\ninvalid configuration - non-diegetic panning requires mono or ISM1 input\n" );
goto cleanup; goto cleanup;
...@@ -1068,7 +1085,10 @@ int main( ...@@ -1068,7 +1085,10 @@ int main(
{ {
/* sanity check */ /* sanity check */
if ( ( args.outConfig.audioConfig != IVAS_AUDIO_CONFIG_BINAURAL ) && ( args.outConfig.audioConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) && ( args.outConfig.audioConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) && !is_split_pre_rend_mode( &args ) ) if ( ( args.outConfig.audioConfig != IVAS_AUDIO_CONFIG_BINAURAL ) &&
( args.outConfig.audioConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) &&
( args.outConfig.audioConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) &&
!is_split_pre_rend_mode( &args ) )
{ {
fprintf( stderr, "\nExternal Renderer Config is supported only when binaural output configurations is used as output OR when Split pre-rendering mode is enabled. Exiting. \n" ); fprintf( stderr, "\nExternal Renderer Config is supported only when binaural output configurations is used as output OR when Split pre-rendering mode is enabled. Exiting. \n" );
goto cleanup; goto cleanup;
...@@ -1157,29 +1177,21 @@ int main( ...@@ -1157,29 +1177,21 @@ int main(
} }
} }
#ifndef NONBE_1359_FIX_IVASREND_OMASA_BINAURAL_LOUDNESS
/* Set the total number of objects */
#endif
if ( args.inConfig.numAudioObjects > 0 ) if ( args.inConfig.numAudioObjects > 0 )
{ {
#ifdef NONBE_1359_FIX_IVASREND_OMASA_BINAURAL_LOUDNESS
/* Set the total number of objects */ /* Set the total number of objects */
#endif
if ( ( error = IVAS_REND_SetTotalNumberOfObjects( hIvasRend, args.inConfig.numAudioObjects ) ) != IVAS_ERR_OK ) if ( ( error = IVAS_REND_SetTotalNumberOfObjects( hIvasRend, args.inConfig.numAudioObjects ) ) != IVAS_ERR_OK )
{ {
fprintf( stderr, "\nError in IVAS_REND_SetTotalNumberOfObjects(): %s\n", ivas_error_to_string( error ) ); fprintf( stderr, "\nError in IVAS_REND_SetTotalNumberOfObjects(): %s\n", ivas_error_to_string( error ) );
goto cleanup; goto cleanup;
} }
#ifdef NONBE_1359_FIX_IVASREND_OMASA_BINAURAL_LOUDNESS
/* Set the metadata delay for objects */ /* Set the metadata delay for objects */
#endif
if ( ( error = IVAS_REND_SetIsmMetadataDelay( hIvasRend, args.syncMdDelay ) ) != IVAS_ERR_OK ) if ( ( error = IVAS_REND_SetIsmMetadataDelay( hIvasRend, args.syncMdDelay ) ) != IVAS_ERR_OK )
{ {
fprintf( stderr, "\nError in IVAS_REND_SetIsmMetadataDelay(): %s\n", ivas_error_to_string( error ) ); fprintf( stderr, "\nError in IVAS_REND_SetIsmMetadataDelay(): %s\n", ivas_error_to_string( error ) );
goto cleanup; goto cleanup;
} }
#ifdef NONBE_1359_FIX_IVASREND_OMASA_BINAURAL_LOUDNESS
/* For OMASA input and BINAURAL output, apply a gain to objects to match the loudness with MASA part */ /* For OMASA input and BINAURAL output, apply a gain to objects to match the loudness with MASA part */
if ( args.inConfig.numMasaBuses > 0 && args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_BINAURAL ) if ( args.inConfig.numMasaBuses > 0 && args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_BINAURAL )
...@@ -1189,7 +1201,6 @@ int main( ...@@ -1189,7 +1201,6 @@ int main(
args.inConfig.audioObjects[i].gain_dB += OMASA_TDREND_MATCHING_GAIN_DB; args.inConfig.audioObjects[i].gain_dB += OMASA_TDREND_MATCHING_GAIN_DB;
} }
} }
#endif
} }
IVAS_REND_LfePanMtx lfePanMatrix; IVAS_REND_LfePanMtx lfePanMatrix;
...@@ -1374,7 +1385,7 @@ int main( ...@@ -1374,7 +1385,7 @@ int main(
} }
int16_t numOutChannels; int16_t numOutChannels;
if ( ( error = IVAS_REND_NumOutChannels( hIvasRend, &numOutChannels ) ) != IVAS_ERR_OK ) if ( ( error = IVAS_REND_GetNumOutChannels( hIvasRend, &numOutChannels ) ) != IVAS_ERR_OK )
{ {
fprintf( stderr, "\nError in IVAS_REND_NumOutChannels(): %s\n", ivas_error_to_string( error ) ); fprintf( stderr, "\nError in IVAS_REND_NumOutChannels(): %s\n", ivas_error_to_string( error ) );
goto cleanup; goto cleanup;
...@@ -1389,31 +1400,16 @@ int main( ...@@ -1389,31 +1400,16 @@ int main(
} }
} }
if ( args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) if ( args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
{
if ( ( error = IVAS_REND_GetSplitRendBitstreamHeader( hIvasRend, &bitsBuffer.config.codec, &bitsBuffer.config.poseCorrection, &bitsBuffer.config.codec_frame_size_ms, &bitsBuffer.config.isar_frame_size_ms ) ) != IVAS_ERR_OK )
{
fprintf( stderr, "\nError in IVAS_REND_GetSplitRendBitstreamHeader()!\n" );
goto cleanup;
}
if ( IVAS_REND_GetDelay( hIvasRend, &delayNumSamples_temp, &delayTimeScale_temp ) != IVAS_ERR_OK )
{ {
fprintf( stderr, "\nUnable to get delay of renderer!\n" ); char *outFile = args.outMetadataFilePath;
goto cleanup;
}
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, bitsBuffer.config.isar_frame_size_ms, args.sampleRate, bitsBuffer.config.lc3plus_highres ) ) != IVAS_ERR_OK ) if ( args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED )
{ {
fprintf( stderr, "\nCould not open split rend metadata file %s\n", args.outputFilePath ); outFile = args.outputFilePath;
goto cleanup;
}
audioWriter = NULL; audioWriter = NULL;
} }
else
{
if ( args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
{
if ( ( error = IVAS_REND_GetSplitRendBitstreamHeader( hIvasRend, &bitsBuffer.config.codec, &bitsBuffer.config.poseCorrection, &bitsBuffer.config.codec_frame_size_ms, &bitsBuffer.config.isar_frame_size_ms ) ) != IVAS_ERR_OK ) if ( ( error = IVAS_REND_GetSplitRendBitstreamHeader( hIvasRend, &bitsBuffer.config.codec, &bitsBuffer.config.poseCorrection, &bitsBuffer.config.codec_frame_size_ms, &bitsBuffer.config.isar_frame_size_ms ) ) != IVAS_ERR_OK )
{ {
fprintf( stderr, "\nError in IVAS_REND_GetSplitRendBitstreamHeader()!\n" ); fprintf( stderr, "\nError in IVAS_REND_GetSplitRendBitstreamHeader()!\n" );
...@@ -1426,13 +1422,15 @@ int main( ...@@ -1426,13 +1422,15 @@ int main(
goto cleanup; goto cleanup;
} }
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, bitsBuffer.config.isar_frame_size_ms, args.sampleRate, bitsBuffer.config.lc3plus_highres ) ) != IVAS_ERR_OK ) if ( ( error = split_rend_writer_open( &hSplitRendFileReadWrite, outFile, delayNumSamples_temp, delayTimeScale_temp, bitsBuffer.config.codec, bitsBuffer.config.poseCorrection, bitsBuffer.config.codec_frame_size_ms, bitsBuffer.config.isar_frame_size_ms, args.sampleRate, bitsBuffer.config.lc3plus_highres ) ) != IVAS_ERR_OK )
{ {
fprintf( stderr, "\nCould not open split rend metadata file %s\n", args.outMetadataFilePath ); fprintf( stderr, "\nCould not open split rend metadata file %s\n", outFile );
goto cleanup; goto cleanup;
} }
} }
if ( args.outConfig.audioConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED )
{
if ( AudioFileWriter_open( &audioWriter, args.outputFilePath, args.sampleRate, numOutChannels ) != IVAS_ERR_OK ) if ( AudioFileWriter_open( &audioWriter, args.outputFilePath, args.sampleRate, numOutChannels ) != IVAS_ERR_OK )
{ {
fprintf( stderr, "\nFailed to open file: %s\n", args.outputFilePath ); fprintf( stderr, "\nFailed to open file: %s\n", args.outputFilePath );
...@@ -1558,16 +1556,23 @@ int main( ...@@ -1558,16 +1556,23 @@ int main(
if ( numSamplesRead == 0 ) if ( numSamplesRead == 0 )
{ {
/* end of input data */ /* end of input data */
break; flushRendererLastFrame = true;
} }
/* Convert from int to float and from interleaved to packed */ /* Convert from int to float and from interleaved to packed */
if ( !flushRendererLastFrame )
{
convertInputBuffer( inpInt16Buffer, numSamplesRead, inBuffer.config.numSamplesPerChannel, num_in_channels, inFloatBuffer, inBuffer.config.is_cldfb, cldfbAna ); convertInputBuffer( inpInt16Buffer, numSamplesRead, inBuffer.config.numSamplesPerChannel, num_in_channels, inFloatBuffer, inBuffer.config.is_cldfb, cldfbAna );
}
else
{
memset( inBuffer.data, 0, inBuffer.config.numChannels * inBuffer.config.numSamplesPerChannel * sizeof( float ) );
}
int16_t num_subframes, sf_idx; int16_t num_subframes, sf_idx;
num_subframes = (int16_t) args.render_framesize; num_subframes = (int16_t) args.render_framesize;
if ( isCurrentFrameMultipleOf20ms ) if ( isCurrentFrameMultipleOf20ms && !flushRendererLastFrame )
{ {
IsmPositionProvider_getNextFrame( positionProvider, &mtdBuffer ); IsmPositionProvider_getNextFrame( positionProvider, &mtdBuffer );
...@@ -1679,7 +1684,7 @@ int main( ...@@ -1679,7 +1684,7 @@ int main(
} }
IVAS_REND_ReadOnlyAudioBuffer tmpBuffer = getReadOnlySubBuffer( inBuffer, (int16_t) args.inConfig.multiChannelBuses[i].inputChannelIndex, numChannels ); IVAS_REND_ReadOnlyAudioBuffer tmpBuffer = getReadOnlySubBuffer( inBuffer, (int16_t) args.inConfig.multiChannelBuses[i].inputChannelIndex, numChannels );
if ( ( error = IVAS_REND_FeedInputAudio( hIvasRend, mcIds[i], tmpBuffer ) ) != IVAS_ERR_OK ) if ( ( error = IVAS_REND_FeedInputAudio( hIvasRend, mcIds[i], tmpBuffer, flushRendererLastFrame ) ) != IVAS_ERR_OK )
{ {
fprintf( stderr, "\nIVAS_REND_FeedInputAudio failed: %s\n", ivas_error_to_string( error ) ); fprintf( stderr, "\nIVAS_REND_FeedInputAudio failed: %s\n", ivas_error_to_string( error ) );
goto cleanup; goto cleanup;
...@@ -1694,7 +1699,7 @@ int main( ...@@ -1694,7 +1699,7 @@ int main(
{ {
IVAS_REND_ReadOnlyAudioBuffer tmpBuffer = getReadOnlySubBuffer( inBuffer, (int16_t) args.inConfig.audioObjects[i].inputChannelIndex, args.inConfig.numAudioObjects ); IVAS_REND_ReadOnlyAudioBuffer tmpBuffer = getReadOnlySubBuffer( inBuffer, (int16_t) args.inConfig.audioObjects[i].inputChannelIndex, args.inConfig.numAudioObjects );
if ( ( error = IVAS_REND_FeedInputAudio( hIvasRend, ismIds[i], tmpBuffer ) ) != IVAS_ERR_OK ) if ( ( error = IVAS_REND_FeedInputAudio( hIvasRend, ismIds[i], tmpBuffer, flushRendererLastFrame ) ) != IVAS_ERR_OK )
{ {
fprintf( stderr, "\nIVAS_REND_FeedInputAudio failed: %s\n", ivas_error_to_string( error ) ); fprintf( stderr, "\nIVAS_REND_FeedInputAudio failed: %s\n", ivas_error_to_string( error ) );
goto cleanup; goto cleanup;
...@@ -1711,7 +1716,7 @@ int main( ...@@ -1711,7 +1716,7 @@ int main(
{ {
IVAS_REND_ReadOnlyAudioBuffer tmpBuffer = getReadOnlySubBuffer( inBuffer, (int16_t) args.inConfig.audioObjects[i].inputChannelIndex, 1 ); IVAS_REND_ReadOnlyAudioBuffer tmpBuffer = getReadOnlySubBuffer( inBuffer, (int16_t) args.inConfig.audioObjects[i].inputChannelIndex, 1 );
if ( ( error = IVAS_REND_FeedInputAudio( hIvasRend, ismIds[i], tmpBuffer ) ) != IVAS_ERR_OK ) if ( ( error = IVAS_REND_FeedInputAudio( hIvasRend, ismIds[i], tmpBuffer, flushRendererLastFrame ) ) != IVAS_ERR_OK )
{ {
fprintf( stderr, "\nIVAS_REND_FeedInputAudio failed: %s\n", ivas_error_to_string( error ) ); fprintf( stderr, "\nIVAS_REND_FeedInputAudio failed: %s\n", ivas_error_to_string( error ) );
goto cleanup; goto cleanup;
...@@ -1734,7 +1739,7 @@ int main( ...@@ -1734,7 +1739,7 @@ int main(
} }
IVAS_REND_ReadOnlyAudioBuffer tmpBuffer = getReadOnlySubBuffer( inBuffer, (int16_t) args.inConfig.ambisonicsBuses[i].inputChannelIndex, numChannels ); IVAS_REND_ReadOnlyAudioBuffer tmpBuffer = getReadOnlySubBuffer( inBuffer, (int16_t) args.inConfig.ambisonicsBuses[i].inputChannelIndex, numChannels );
if ( ( error = IVAS_REND_FeedInputAudio( hIvasRend, sbaIds[i], tmpBuffer ) ) != IVAS_ERR_OK ) if ( ( error = IVAS_REND_FeedInputAudio( hIvasRend, sbaIds[i], tmpBuffer, flushRendererLastFrame ) ) != IVAS_ERR_OK )
{ {
fprintf( stderr, "\nIVAS_REND_FeedInputAudio failed: %s\n", ivas_error_to_string( error ) ); fprintf( stderr, "\nIVAS_REND_FeedInputAudio failed: %s\n", ivas_error_to_string( error ) );
goto cleanup; goto cleanup;
...@@ -1750,13 +1755,13 @@ int main( ...@@ -1750,13 +1755,13 @@ int main(
} }
IVAS_REND_ReadOnlyAudioBuffer tmpBuffer = getReadOnlySubBuffer( inBuffer, (int16_t) args.inConfig.masaBuses[i].inputChannelIndex, numChannels ); IVAS_REND_ReadOnlyAudioBuffer tmpBuffer = getReadOnlySubBuffer( inBuffer, (int16_t) args.inConfig.masaBuses[i].inputChannelIndex, numChannels );
if ( ( error = IVAS_REND_FeedInputAudio( hIvasRend, masaIds[i], tmpBuffer ) ) != IVAS_ERR_OK ) if ( ( error = IVAS_REND_FeedInputAudio( hIvasRend, masaIds[i], tmpBuffer, flushRendererLastFrame ) ) != IVAS_ERR_OK )
{ {
fprintf( stderr, "IVAS_REND_FeedInputAudio failed: %s\n", ivas_error_to_string( error ) ); fprintf( stderr, "IVAS_REND_FeedInputAudio failed: %s\n", ivas_error_to_string( error ) );
goto cleanup; goto cleanup;
} }
if ( isCurrentFrameMultipleOf20ms ) if ( isCurrentFrameMultipleOf20ms && !flushRendererLastFrame )
{ {
if ( masaReaders[i] != NULL ) if ( masaReaders[i] != NULL )
{ {
...@@ -1819,7 +1824,7 @@ int main( ...@@ -1819,7 +1824,7 @@ int main(
zeroPad = delayNumSamples; zeroPad = delayNumSamples;
} }
if ( is_split_pre_rend_mode( &args ) ) if ( is_split_pre_rend_mode( &args ) && !flushRendererLastFrame )
{ {
if ( split_rend_write_bitstream_to_file( hSplitRendFileReadWrite, bitsBuffer.bits, &bitsBuffer.config.bitsRead, if ( split_rend_write_bitstream_to_file( hSplitRendFileReadWrite, bitsBuffer.bits, &bitsBuffer.config.bitsRead,
&bitsBuffer.config.bitsWritten ) != IVAS_ERR_OK ) &bitsBuffer.config.bitsWritten ) != IVAS_ERR_OK )
...@@ -1829,7 +1834,7 @@ int main( ...@@ -1829,7 +1834,7 @@ int main(
} }
} }
if ( audioWriter != NULL ) if ( audioWriter != NULL && !flushRendererLastFrame )
{ {
if ( delayNumSamples * num_out_channels < outBufferSize ) if ( delayNumSamples * num_out_channels < outBufferSize )
{ {
...@@ -1850,7 +1855,7 @@ int main( ...@@ -1850,7 +1855,7 @@ int main(
bitsBuffer.config.bitsWritten = 0; bitsBuffer.config.bitsWritten = 0;
/* Write MASA metadata for MASA outputs */ /* Write MASA metadata for MASA outputs */
if ( args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_MASA1 || args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_MASA2 ) if ( !flushRendererLastFrame && ( args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_MASA1 || args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_MASA2 ) )
{ {
IVAS_REND_AudioConfigType inputType1; IVAS_REND_AudioConfigType inputType1;
IVAS_REND_AudioConfigType inputType2; IVAS_REND_AudioConfigType inputType2;
...@@ -1922,7 +1927,8 @@ int main( ...@@ -1922,7 +1927,8 @@ int main(
} }
} }
if ( ( args.inConfig.numAmbisonicsBuses > 0 || args.inConfig.numMultiChannelBuses > 0 || args.inConfig.numMasaBuses > 0 ) && args.inConfig.numAudioObjects > 0 ) if ( ( args.inConfig.numAmbisonicsBuses > 0 || args.inConfig.numMultiChannelBuses > 0 || args.inConfig.numMasaBuses > 0 ) &&
args.inConfig.numAudioObjects > 0 )
{ {
inputType2 = IVAS_REND_AUDIO_CONFIG_TYPE_OBJECT_BASED; inputType2 = IVAS_REND_AUDIO_CONFIG_TYPE_OBJECT_BASED;
if ( ( error = IVAS_REND_MergeMasaMetadata( hIvasRend, &hMetaOutput, inputType1, inputType2 ) ) != IVAS_ERR_OK ) if ( ( error = IVAS_REND_MergeMasaMetadata( hIvasRend, &hMetaOutput, inputType1, inputType2 ) ) != IVAS_ERR_OK )
...@@ -1939,6 +1945,13 @@ int main( ...@@ -1939,6 +1945,13 @@ int main(
} }
} }
/* no new input was actually read, only delay buffers were flushed
* therefore this is not a real frame */
if ( flushRendererLastFrame )
{
break;
}
frame++; frame++;
if ( !args.quietModeEnabled ) if ( !args.quietModeEnabled )
{ {
...@@ -1951,12 +1964,13 @@ int main( ...@@ -1951,12 +1964,13 @@ int main(
#endif #endif
} }
/* add zeros at the end to have equal length of synthesized signals */ /* add zeros at the end to have equal length of synthesized signals
* the output buffer will contain either leftover input samples from delay aligned inputs
* or zeros for padding */
if ( audioWriter != NULL ) if ( audioWriter != NULL )
{ {
for ( zeroPadToWrite = zeroPad; zeroPadToWrite > frameSize_smpls; zeroPadToWrite -= frameSize_smpls ) 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 ) if ( ( error = AudioFileWriter_write( audioWriter, outInt16Buffer, outBufferSize ) ) != IVAS_ERR_OK )
{ {
fprintf( stderr, "\nOutput audio file writer error\n" ); fprintf( stderr, "\nOutput audio file writer error\n" );
...@@ -1964,7 +1978,6 @@ int main( ...@@ -1964,7 +1978,6 @@ int main(
} }
} }
memset( outInt16Buffer, 0, zeroPadToWrite * outBuffer.config.numChannels * sizeof( int16_t ) );
if ( ( error = AudioFileWriter_write( audioWriter, outInt16Buffer, zeroPadToWrite * outBuffer.config.numChannels ) ) != IVAS_ERR_OK ) if ( ( error = AudioFileWriter_write( audioWriter, outInt16Buffer, zeroPadToWrite * outBuffer.config.numChannels ) ) != IVAS_ERR_OK )
{ {
fprintf( stderr, "\nOutput audio file writer error\n" ); fprintf( stderr, "\nOutput audio file writer error\n" );
...@@ -1973,9 +1986,10 @@ int main( ...@@ -1973,9 +1986,10 @@ int main(
zeroPadToWrite = 0; zeroPadToWrite = 0;
} }
if ( args.inConfig.numAudioObjects != 0 && ( args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_BINAURAL || args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) if ( args.inConfig.numAudioObjects != 0 &&
( args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_BINAURAL || args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) )
{ {
fprintf( stdout, "\n\nMetadata delayed %d subframes\n\n", (int16_t) round( args.syncMdDelay / ( 1000 / IVAS_NUM_FRAMES_PER_SEC / IVAS_MAX_PARAM_SPATIAL_SUBFRAMES ) ) ); fprintf( stdout, "\n\nMetadata delayed %d subframes\n\n", (int16_t) round( args.syncMdDelay / ( 1000.f / IVAS_NUM_FRAMES_PER_SEC / IVAS_MAX_PARAM_SPATIAL_SUBFRAMES ) ) );
} }
if ( !args.quietModeEnabled && args.delayCompensationEnabled ) if ( !args.quietModeEnabled && args.delayCompensationEnabled )
...@@ -2596,7 +2610,11 @@ static CmdlnArgs defaultArgs( ...@@ -2596,7 +2610,11 @@ static CmdlnArgs defaultArgs(
args.outConfig.outSetupCustom.num_lfe = 0; args.outConfig.outSetupCustom.num_lfe = 0;
args.inConfig.ambisonicsBuses->audioConfig = IVAS_AUDIO_CONFIG_INVALID; args.inConfig.ambisonicsBuses->audioConfig = IVAS_AUDIO_CONFIG_INVALID;
#ifdef FIX_1376_MISSING_ISM_METADATA
for ( int32_t i = 0; i < RENDERER_MAX_ISM_INPUTS + RENDERER_MAX_MASA_INPUTS; ++i )
#else
for ( int32_t i = 0; i < RENDERER_MAX_ISM_INPUTS; ++i ) for ( int32_t i = 0; i < RENDERER_MAX_ISM_INPUTS; ++i )
#endif
{ {
clearString( args.inMetadataFilePaths[i] ); clearString( args.inMetadataFilePaths[i] );
} }
...@@ -3305,7 +3323,8 @@ static void parseObjectPosition( ...@@ -3305,7 +3323,8 @@ static void parseObjectPosition(
*positionDuration = (uint16_t) strtol( line, &endptr, 10 ); *positionDuration = (uint16_t) strtol( line, &endptr, 10 );
readNextMetadataChunk( line, "\n" ); readNextMetadataChunk( line, "\n" );
read_values = (int16_t) sscanf( line, "%f,%f,%f,%f,%f,%f,%f,%f", &meta_prm[0], &meta_prm[1], &meta_prm[2], &meta_prm[3], &meta_prm[4], &meta_prm[5], &meta_prm[6], &meta_prm[7] ); read_values = (int16_t) sscanf( line, "%f,%f,%f,%f,%f,%f,%f,%f",
&meta_prm[0], &meta_prm[1], &meta_prm[2], &meta_prm[3], &meta_prm[4], &meta_prm[5], &meta_prm[6], &meta_prm[7] );
if ( read_values < 2 ) if ( read_values < 2 )
{ {
......
...@@ -5,6 +5,10 @@ ...@@ -5,6 +5,10 @@
<body> <body>
<h1>Ivas BASOP code Development</h1> <h1>Ivas BASOP code Development</h1>
<h2>Regression tracking</h2>
<li><a href="long_term_regression.html">Long term regression</a></li>
<h2>Daily long testvector tests</h2> <h2>Daily long testvector tests</h2>
<ul> <ul>
......
...@@ -69,6 +69,7 @@ JOBS_BASOP_REPO = { ...@@ -69,6 +69,7 @@ JOBS_BASOP_REPO = {
"complexity-stereo-in-stereo-out": "Stereo in, Stereo out", "complexity-stereo-in-stereo-out": "Stereo in, Stereo out",
# "timeless" jobs (not complexity) # "timeless" jobs (not complexity)
"coverage-test-on-main-scheduled": "Coverage", "coverage-test-on-main-scheduled": "Coverage",
"ivas-long-term-job-logs-overview": "Long term logs",
} }
JOBS_FOR_PROJECT_ID = { JOBS_FOR_PROJECT_ID = {
......
...@@ -308,8 +308,14 @@ ivas_error ivas_init_decoder( ...@@ -308,8 +308,14 @@ ivas_error ivas_init_decoder(
ivas_error ivas_output_buff_dec( ivas_error ivas_output_buff_dec(
float *p_output_f[], /* i/o: output audio buffers */ float *p_output_f[], /* i/o: output audio buffers */
#ifdef FIX_1330_JBM_MEMORY
const int16_t nchan_out_buff, /* i : number of output channels */
const int16_t Opt_tsm, /* i : TSM option flag */
DECODER_TC_BUFFER_HANDLE hTcBuffer /* i : TSM buffer handle */
#else
const int16_t nchan_out_buff_old, /* i : previous frame number of output channels*/ const int16_t nchan_out_buff_old, /* i : previous frame number of output channels*/
const int16_t nchan_out_buff /* i : number of output channels */ const int16_t nchan_out_buff /* i : number of output channels */
#endif
); );
ivas_error stereo_dmx_evs_init_encoder( ivas_error stereo_dmx_evs_init_encoder(
...@@ -5823,8 +5829,12 @@ void ivas_omasa_separate_object_render_jbm( ...@@ -5823,8 +5829,12 @@ void ivas_omasa_separate_object_render_jbm(
const uint16_t nSamplesRendered, /* i : number of samples rendered */ const uint16_t nSamplesRendered, /* i : number of samples rendered */
float input_f[][L_FRAME48k], /* i : separated object signal */ float input_f[][L_FRAME48k], /* i : separated object signal */
float *output_f[], /* o : rendered time signal */ float *output_f[], /* o : rendered time signal */
#ifdef FIX_1330_JBM_MEMORY
const int16_t subframes_rendered /* i : number of subframes rendered */
#else
const int16_t subframes_rendered, /* i : number of subframes rendered */ const int16_t subframes_rendered, /* i : number of subframes rendered */
const int16_t slots_rendered /* i : number of CLDFB slots rendered */ const int16_t slots_rendered /* i : number of CLDFB slots rendered */
#endif
); );
void ivas_omasa_encode_masa_to_total( void ivas_omasa_encode_masa_to_total(
......
...@@ -198,12 +198,24 @@ void ivas_buffer_deinterleaved_to_interleaved( ...@@ -198,12 +198,24 @@ void ivas_buffer_deinterleaved_to_interleaved(
) )
{ {
int16_t ch, m; int16_t ch, m;
#ifdef FIX_1330_JBM_MEMORY
float buffer[MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS][L_FRAME48k]; /* temp buffer needed when "*audio[]" and "*audio_out[]" are the same */
for ( ch = 0; ch < n_channels; ch++ )
{
mvr2r( audio[ch], buffer[ch], frame_length );
}
#endif
for ( ch = 0; ch < n_channels; ch++ ) for ( ch = 0; ch < n_channels; ch++ )
{ {
for ( m = 0; m < frame_length; m++ ) for ( m = 0; m < frame_length; m++ )
{ {
#ifdef FIX_1330_JBM_MEMORY
audio_out[m * n_channels + ch] = buffer[ch][m];
#else
audio_out[m * n_channels + ch] = audio[ch][m]; audio_out[m * n_channels + ch] = audio[ch][m];
#endif
} }
} }
......
...@@ -136,6 +136,7 @@ ...@@ -136,6 +136,7 @@
/*#define DEBUG_JBM_CMD_OPTION*/ /* ability for telling the decoder the frontend fetch size and to not delay compensate for bad frames at the beginning */ /*#define DEBUG_JBM_CMD_OPTION*/ /* ability for telling the decoder the frontend fetch size and to not delay compensate for bad frames at the beginning */
/*#define VARIABLE_SPEED_DECODING*/ /* variable speed decoding employing the JBM functioniality; move to DEBUGGING after build for disabled is fixed */ /*#define VARIABLE_SPEED_DECODING*/ /* variable speed decoding employing the JBM functioniality; move to DEBUGGING after build for disabled is fixed */
/*#define DISABLE_LIMITER*/ /* disable the limiter */ /*#define DISABLE_LIMITER*/ /* disable the limiter */
/*#define DEBUG_APA_SILENCE_NON_SCALED*/ /* Switch APA into mode that replaces contents of non-scaled frames with silence. Useful for identifying scaled regions in the audio output of the decoder */
/*Split Rendering Debug switches*/ /*Split Rendering Debug switches*/
/*#define DBG_WAV_WRITER*/ /* add debugging function dbgwrite_wav() */ /*#define DBG_WAV_WRITER*/ /* add debugging function dbgwrite_wav() */
...@@ -166,7 +167,10 @@ ...@@ -166,7 +167,10 @@
#endif #endif
#define TMP_FIX_1119_SPLIT_RENDERING_VOIP /* FhG: Add error check for unsupported config: split rendering with VoIP mode */ #define TMP_FIX_1119_SPLIT_RENDERING_VOIP /* FhG: Add error check for unsupported config: split rendering with VoIP mode */
/*#define CODE_IMPROVEMENTS*/ /* FhG: Small code improvements that do not change the functionality */ #define FIX_1348_OVERFLOW /* FhG: fix BASOP overflow in hq_lr_dec(), brings floating-point code inline with FX */
#define FIX_1369_HQ_LR_OVERFLOW /* FhG: fix BASOP overflow in hq_lr_enc(), brings floating-point code inline with FX */
#define FIX_1376_MISSING_ISM_METADATA /* FhG: IVAS_rend: throw error if there exists an ISM input without a corresponding metadata file path */
#define FIX_1330_JBM_MEMORY /* VA: issue 1330: memory savings in the JBM decoder */
/* #################### End BE switches ################################## */ /* #################### End BE switches ################################## */
...@@ -177,8 +181,7 @@ ...@@ -177,8 +181,7 @@
#define NONBE_1244_FIX_SWB_BWE_MEMORY /* VA: issue 1244: fix to SWB BWE memory in case of switching from FB coding - pending a review by Huawei */ #define NONBE_1244_FIX_SWB_BWE_MEMORY /* VA: issue 1244: fix to SWB BWE memory in case of switching from FB coding - pending a review by Huawei */
#define NONBE_1122_KEEP_EVS_MODE_UNCHANGED /* FhG: Disables fix for issue 1122 in EVS mode to keep BE tests green. This switch should be removed once the 1122 fix is added to EVS via a CR. */ #define NONBE_1122_KEEP_EVS_MODE_UNCHANGED /* FhG: Disables fix for issue 1122 in EVS mode to keep BE tests green. This switch should be removed once the 1122 fix is added to EVS via a CR. */
#define NONBE_1359_FIX_IVASREND_OMASA_BINAURAL_LOUDNESS /* Nokia: issue 1339: Apply scaling to the object-part of OMASA for binaural rendering in IVAS_rend. */ #define NONBE_SVD_OPTIMIZATION
#define NONBE_1362_FIX_OMASA_TO_MASA1_RENDERING /* Nokia: Fix OMASA to MASA1 rendering in IVAS_rend */
/* ##################### End NON-BE switches ########################### */ /* ##################### End NON-BE switches ########################### */
......
...@@ -1742,27 +1742,11 @@ double anint( ...@@ -1742,27 +1742,11 @@ double anint(
int16_t is_numeric_float( int16_t is_numeric_float(
float x ) float x )
{ {
#ifdef CODE_IMPROVEMENTS
int16_t retval; int16_t retval;
#define WMC_TOOL_SKIP #define WMC_TOOL_SKIP
retval = (int16_t) ( !isnan( x ) && !isinf( x ) ); retval = (int16_t) ( !isnan( x ) && !isinf( x ) );
#undef WMC_TOOL_SKIP #undef WMC_TOOL_SKIP
return retval; return retval;
#else
#ifndef BASOP_NOGLOB
union float_int
#else /* BASOP_NOGLOB */
union float_int
#endif /* BASOP_NOGLOB */
{
float float_val;
int32_t int_val;
} float_int;
float_int.float_val = x;
return ( ( float_int.int_val & 0x7f800000 ) != 0x7f800000 );
#endif
} }
/*-------------------------------------------------------------------* /*-------------------------------------------------------------------*
......
...@@ -262,7 +262,15 @@ void hq_lr_dec( ...@@ -262,7 +262,15 @@ void hq_lr_dec(
frac1 = L_Extract_lc( L_tmp, &exp ); /* Extract exponent of L_tmp */ frac1 = L_Extract_lc( L_tmp, &exp ); /* Extract exponent of L_tmp */
L_tmp = Pow2( 30, frac1 ); L_tmp = Pow2( 30, frac1 );
exp = sub( exp, 30 ); exp = sub( exp, 30 );
#ifdef FIX_1348_OVERFLOW
#ifdef BASOP_NOGLOB
Ep_fx[i] = L_shl_o( L_tmp, s_max( sub( exp, 6 ), -31 ), &Overflow ); /* Q -6 */
#else
Ep_fx[i] = L_shl( L_tmp, s_max( sub( exp, 6 ), -31 ) ); /* Q -6 */
#endif
#else
Ep_fx[i] = L_shl( L_tmp, sub( exp, 6 ) ); /* Q -6 */ Ep_fx[i] = L_shl( L_tmp, sub( exp, 6 ) ); /* Q -6 */
#endif
Ep[i] = (float) ( Ep_fx[i] / pow( 2.0, -6 ) ); Ep[i] = (float) ( Ep_fx[i] / pow( 2.0, -6 ) );
} }
......
...@@ -1252,6 +1252,9 @@ ivas_error ivas_init_decoder( ...@@ -1252,6 +1252,9 @@ ivas_error ivas_init_decoder(
int16_t sce_id, cpe_id; int16_t sce_id, cpe_id;
int16_t numCldfbAnalyses, numCldfbSyntheses; int16_t numCldfbAnalyses, numCldfbSyntheses;
int16_t granularity, n_channels_transport_jbm; int16_t granularity, n_channels_transport_jbm;
#ifdef FIX_1330_JBM_MEMORY
int16_t nchan_out_buff;
#endif
int32_t output_Fs, ivas_total_brate; int32_t output_Fs, ivas_total_brate;
int32_t delay_ns; int32_t delay_ns;
AUDIO_CONFIG output_config; AUDIO_CONFIG output_config;
...@@ -2304,8 +2307,16 @@ ivas_error ivas_init_decoder( ...@@ -2304,8 +2307,16 @@ ivas_error ivas_init_decoder(
*-----------------------------------------------------------------*/ *-----------------------------------------------------------------*/
if ( st_ivas->mc_mode == MC_MODE_MCT || st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) if ( st_ivas->mc_mode == MC_MODE_MCT || st_ivas->mc_mode == MC_MODE_PARAMUPMIX )
{
if ( st_ivas->hIntSetup.index_lfe[0] != -1 )
{ {
delay_ns = st_ivas->binaural_latency_ns; delay_ns = st_ivas->binaural_latency_ns;
}
else
{
delay_ns = 0;
}
if ( st_ivas->hBinRenderer != NULL ) if ( st_ivas->hBinRenderer != NULL )
{ {
if ( st_ivas->hBinRenderer->render_lfe ) if ( st_ivas->hBinRenderer->render_lfe )
...@@ -2363,7 +2374,7 @@ ivas_error ivas_init_decoder( ...@@ -2363,7 +2374,7 @@ ivas_error ivas_init_decoder(
} }
} }
if ( ( st_ivas->ivas_format == MASA_FORMAT || st_ivas->ivas_format == MASA_ISM_FORMAT ) && st_ivas->hDecoderConfig->Opt_tsm ) if ( ( st_ivas->ivas_format == MASA_FORMAT || st_ivas->ivas_format == MASA_ISM_FORMAT ) && hDecoderConfig->Opt_tsm )
{ {
if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL )
{ {
...@@ -2378,7 +2389,14 @@ ivas_error ivas_init_decoder( ...@@ -2378,7 +2389,14 @@ ivas_error ivas_init_decoder(
* Allocate floating-point output audio buffers * Allocate floating-point output audio buffers
*-----------------------------------------------------------------*/ *-----------------------------------------------------------------*/
k = ivas_get_nchan_buffers_dec( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); #ifdef FIX_1330_JBM_MEMORY
nchan_out_buff = ivas_get_nchan_buffers_dec( st_ivas, st_ivas->sba_analysis_order, ivas_total_brate );
if ( ( error = ivas_output_buff_dec( st_ivas->p_output_f, nchan_out_buff, hDecoderConfig->Opt_tsm, st_ivas->hTcBuffer ) ) != IVAS_ERR_OK )
{
return error;
}
#else
k = ivas_get_nchan_buffers_dec( st_ivas, st_ivas->sba_analysis_order, ivas_total_brate );
for ( n = 0; n < k; n++ ) for ( n = 0; n < k; n++ )
{ {
/* note: these are intra-frame heap memories */ /* note: these are intra-frame heap memories */
...@@ -2392,9 +2410,9 @@ ivas_error ivas_init_decoder( ...@@ -2392,9 +2410,9 @@ ivas_error ivas_init_decoder(
{ {
st_ivas->p_output_f[n] = NULL; st_ivas->p_output_f[n] = NULL;
} }
#endif
return IVAS_ERR_OK;
return error;
} }
...@@ -2849,12 +2867,14 @@ void ivas_destroy_dec( ...@@ -2849,12 +2867,14 @@ void ivas_destroy_dec(
/* Limiter struct */ /* Limiter struct */
ivas_limiter_close( &( st_ivas->hLimiter ) ); ivas_limiter_close( &( st_ivas->hLimiter ) );
/* Decoder configuration structure */
if ( st_ivas->hDecoderConfig != NULL ) if ( st_ivas->hDecoderConfig != NULL )
{ {
free( st_ivas->hDecoderConfig ); free( st_ivas->hDecoderConfig );
st_ivas->hDecoderConfig = NULL; st_ivas->hDecoderConfig = NULL;
} }
/* JBM TC buffer structure */
ivas_jbm_dec_tc_buffer_close( &st_ivas->hTcBuffer ); ivas_jbm_dec_tc_buffer_close( &st_ivas->hTcBuffer );
if ( st_ivas->hJbmMetadata != NULL ) if ( st_ivas->hJbmMetadata != NULL )
...@@ -2866,11 +2886,15 @@ void ivas_destroy_dec( ...@@ -2866,11 +2886,15 @@ void ivas_destroy_dec(
/* floating-point output audio buffers */ /* floating-point output audio buffers */
for ( i = 0; i < MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS; i++ ) for ( i = 0; i < MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS; i++ )
{ {
#ifdef FIX_1330_JBM_MEMORY
st_ivas->p_output_f[i] = NULL;
#else
if ( st_ivas->p_output_f[i] != NULL ) if ( st_ivas->p_output_f[i] != NULL )
{ {
free( st_ivas->p_output_f[i] ); free( st_ivas->p_output_f[i] );
st_ivas->p_output_f[i] = NULL; st_ivas->p_output_f[i] = NULL;
} }
#endif
} }
/* main IVAS handle */ /* main IVAS handle */
......
...@@ -60,7 +60,11 @@ static ivas_error ivas_ism_bitrate_switching_dec( ...@@ -60,7 +60,11 @@ static ivas_error ivas_ism_bitrate_switching_dec(
int16_t tc_nchan_tc_new; int16_t tc_nchan_tc_new;
int16_t tc_nchan_allocate_new; int16_t tc_nchan_allocate_new;
int16_t tc_granularity_new; int16_t tc_granularity_new;
#ifdef FIX_1330_JBM_MEMORY
int16_t nchan_out_buff;
#else
int16_t nchan_out_buff, nchan_out_buff_old; int16_t nchan_out_buff, nchan_out_buff_old;
#endif
nCPE_old = st_ivas->nCPE; nCPE_old = st_ivas->nCPE;
nSCE_old = st_ivas->nSCE; nSCE_old = st_ivas->nSCE;
...@@ -70,7 +74,9 @@ static ivas_error ivas_ism_bitrate_switching_dec( ...@@ -70,7 +74,9 @@ static ivas_error ivas_ism_bitrate_switching_dec(
st_ivas->ism_mode = last_ism_mode; st_ivas->ism_mode = last_ism_mode;
ivas_init_dec_get_num_cldfb_instances( st_ivas, &numCldfbAnalyses_old, &numCldfbSyntheses_old ); ivas_init_dec_get_num_cldfb_instances( st_ivas, &numCldfbAnalyses_old, &numCldfbSyntheses_old );
st_ivas->ism_mode = ism_mode; st_ivas->ism_mode = ism_mode;
#ifndef FIX_1330_JBM_MEMORY
nchan_out_buff_old = ivas_get_nchan_buffers_dec( st_ivas, -1, -1 ); nchan_out_buff_old = ivas_get_nchan_buffers_dec( st_ivas, -1, -1 );
#endif
if ( ( error = ivas_ism_config( st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->nchan_transport, st_ivas->nchan_ism, NULL, 0, NULL, NULL, element_brate_tmp, NULL, NULL, 0 ) ) != IVAS_ERR_OK ) if ( ( error = ivas_ism_config( st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->nchan_transport, st_ivas->nchan_ism, NULL, 0, NULL, NULL, element_brate_tmp, NULL, NULL, 0 ) ) != IVAS_ERR_OK )
{ {
...@@ -266,17 +272,17 @@ static ivas_error ivas_ism_bitrate_switching_dec( ...@@ -266,17 +272,17 @@ static ivas_error ivas_ism_bitrate_switching_dec(
return error; return error;
} }
#ifndef FIX_1330_JBM_MEMORY
/*-----------------------------------------------------------------* /*-----------------------------------------------------------------*
* floating-point output audio buffers * floating-point output audio buffers
*-----------------------------------------------------------------*/ *-----------------------------------------------------------------*/
nchan_out_buff = ivas_get_nchan_buffers_dec( st_ivas, -1, -1 ); nchan_out_buff = ivas_get_nchan_buffers_dec( st_ivas, -1, -1 );
if ( ( error = ivas_output_buff_dec( st_ivas->p_output_f, nchan_out_buff_old, nchan_out_buff ) ) != IVAS_ERR_OK ) if ( ( error = ivas_output_buff_dec( st_ivas->p_output_f, nchan_out_buff_old, nchan_out_buff ) ) != IVAS_ERR_OK )
{ {
return error; return error;
} }
#endif
/*-----------------------------------------------------------------* /*-----------------------------------------------------------------*
* JBM TC buffers * JBM TC buffers
*-----------------------------------------------------------------*/ *-----------------------------------------------------------------*/
...@@ -316,6 +322,18 @@ static ivas_error ivas_ism_bitrate_switching_dec( ...@@ -316,6 +322,18 @@ static ivas_error ivas_ism_bitrate_switching_dec(
mvs2s( st_ivas->hTcBuffer->subframe_nbslots, st_ivas->hSpatParamRendCom->subframe_nbslots, MAX_JBM_SUBFRAMES_5MS ); mvs2s( st_ivas->hTcBuffer->subframe_nbslots, st_ivas->hSpatParamRendCom->subframe_nbslots, MAX_JBM_SUBFRAMES_5MS );
} }
#ifdef FIX_1330_JBM_MEMORY
/*-----------------------------------------------------------------*
* floating-point output audio buffers
*-----------------------------------------------------------------*/
nchan_out_buff = ivas_get_nchan_buffers_dec( st_ivas, -1, -1 );
if ( ( error = ivas_output_buff_dec( st_ivas->p_output_f, nchan_out_buff, st_ivas->hDecoderConfig->Opt_tsm, st_ivas->hTcBuffer ) ) != IVAS_ERR_OK )
{
return error;
}
#endif
return IVAS_ERR_OK; return IVAS_ERR_OK;
} }
......
...@@ -193,6 +193,7 @@ void ivas_ism_render_sf( ...@@ -193,6 +193,7 @@ void ivas_ism_render_sf(
ism_md_subframe_update_jbm = st_ivas->hTcBuffer->nb_subframes - 2; ism_md_subframe_update_jbm = st_ivas->hTcBuffer->nb_subframes - 2;
} }
#ifndef FIX_1330_JBM_MEMORY
if ( st_ivas->hDecoderConfig->Opt_tsm ) if ( st_ivas->hDecoderConfig->Opt_tsm )
{ {
for ( i = 0; i < num_objects; i++ ) for ( i = 0; i < num_objects; i++ )
...@@ -202,12 +203,15 @@ void ivas_ism_render_sf( ...@@ -202,12 +203,15 @@ void ivas_ism_render_sf(
} }
else else
{ {
#endif
for ( i = 0; i < num_objects; i++ ) for ( i = 0; i < num_objects; i++ )
{ {
mvr2r( &output_f[i][tc_offset], tc_local[i], n_samples_to_render ); mvr2r( &output_f[i][tc_offset], tc_local[i], n_samples_to_render );
p_tc[i] = tc_local[i]; p_tc[i] = tc_local[i];
} }
#ifndef FIX_1330_JBM_MEMORY
} }
#endif
for ( i = 0; i < nchan_out_woLFE + st_ivas->hIntSetup.num_lfe; i++ ) for ( i = 0; i < nchan_out_woLFE + st_ivas->hIntSetup.num_lfe; i++ )
{ {
...@@ -432,8 +436,12 @@ void ivas_omasa_separate_object_render_jbm( ...@@ -432,8 +436,12 @@ void ivas_omasa_separate_object_render_jbm(
const uint16_t nSamplesRendered, /* i : number of samples rendered */ const uint16_t nSamplesRendered, /* i : number of samples rendered */
float input_f_in[][L_FRAME48k], /* i : separated object signal */ float input_f_in[][L_FRAME48k], /* i : separated object signal */
float *output_f[], /* o : rendered time signal */ float *output_f[], /* o : rendered time signal */
#ifdef FIX_1330_JBM_MEMORY
const int16_t subframes_rendered /* i : number of subframes rendered */
#else
const int16_t subframes_rendered, /* i : number of subframes rendered */ const int16_t subframes_rendered, /* i : number of subframes rendered */
const int16_t slots_rendered /* i : number of CLDFB slots rendered */ const int16_t slots_rendered /* i : number of CLDFB slots rendered */
#endif
) )
{ {
VBAP_HANDLE hVBAPdata; VBAP_HANDLE hVBAPdata;
...@@ -474,13 +482,16 @@ void ivas_omasa_separate_object_render_jbm( ...@@ -474,13 +482,16 @@ void ivas_omasa_separate_object_render_jbm(
num_objects = st_ivas->nchan_ism; num_objects = st_ivas->nchan_ism;
} }
#ifndef FIX_1330_JBM_MEMORY
offsetSamples = slots_rendered * hSpatParamRendCom->slot_size; offsetSamples = slots_rendered * hSpatParamRendCom->slot_size;
#endif
for ( j = 0; j < nchan_out_woLFE + num_lfe; j++ ) for ( j = 0; j < nchan_out_woLFE + num_lfe; j++ )
{ {
output_f_local[j] = output_f[j]; output_f_local[j] = output_f[j];
} }
#ifndef FIX_1330_JBM_MEMORY
if ( st_ivas->hDecoderConfig->Opt_tsm ) if ( st_ivas->hDecoderConfig->Opt_tsm )
{ {
for ( obj = 0; obj < num_objects; obj++ ) for ( obj = 0; obj < num_objects; obj++ )
...@@ -490,11 +501,14 @@ void ivas_omasa_separate_object_render_jbm( ...@@ -490,11 +501,14 @@ void ivas_omasa_separate_object_render_jbm(
} }
else else
{ {
#endif
for ( obj = 0; obj < num_objects; obj++ ) for ( obj = 0; obj < num_objects; obj++ )
{ {
input_f[obj] = input_f_in[obj]; input_f[obj] = input_f_in[obj];
} }
#ifndef FIX_1330_JBM_MEMORY
} }
#endif
slots_to_render = nSamplesRendered / hSpatParamRendCom->slot_size; slots_to_render = nSamplesRendered / hSpatParamRendCom->slot_size;
first_sf = subframes_rendered; first_sf = subframes_rendered;
......
...@@ -763,7 +763,11 @@ void ivas_jbm_dec_feed_tc_to_renderer( ...@@ -763,7 +763,11 @@ void ivas_jbm_dec_feed_tc_to_renderer(
float tmp_buf[MAX_JBM_L_FRAME48k]; float tmp_buf[MAX_JBM_L_FRAME48k];
float *p_data_f[FOA_CHANNELS + MAX_NUM_OBJECTS]; float *p_data_f[FOA_CHANNELS + MAX_NUM_OBJECTS];
int16_t n, n_render_timeslots, n_ch_cldfb; int16_t n, n_render_timeslots, n_ch_cldfb;
#ifdef FIX_1330_JBM_MEMORY
int16_t ch, offset, len_offset;
#else
int16_t ch; int16_t ch;
#endif
DECODER_TC_BUFFER_HANDLE hTcBuffer; DECODER_TC_BUFFER_HANDLE hTcBuffer;
hTcBuffer = st_ivas->hTcBuffer; hTcBuffer = st_ivas->hTcBuffer;
...@@ -781,6 +785,22 @@ void ivas_jbm_dec_feed_tc_to_renderer( ...@@ -781,6 +785,22 @@ void ivas_jbm_dec_feed_tc_to_renderer(
n_ch_full_copy = min( hTcBuffer->nchan_transport_jbm, hTcBuffer->nchan_buffer_full ); n_ch_full_copy = min( hTcBuffer->nchan_transport_jbm, hTcBuffer->nchan_buffer_full );
n_ch_res_copy = hTcBuffer->nchan_transport_jbm - hTcBuffer->nchan_buffer_full; n_ch_res_copy = hTcBuffer->nchan_transport_jbm - hTcBuffer->nchan_buffer_full;
#ifdef FIX_1330_JBM_MEMORY
/* buffers are shared between 'hTcBuffer->tc[]' and 'p_output_f[]':
in case of 'length(hTcBuffer->tc[]) < length(p_output_f[])', reset of TC buffers
pointers is needed after ivas_buffer_interleaved_to_deinterleaved() */
len_offset = NS2SA( st_ivas->hDecoderConfig->output_Fs, MAX_JBM_L_FRAME_NS );
if ( len_offset < L_FRAME48k )
{
offset = 0;
for ( ch = 0; ch < max( hTcBuffer->nchan_transport_jbm, hTcBuffer->nchan_buffer_full ); ch++ )
{
hTcBuffer->tc[ch] = &hTcBuffer->tc_buffer[offset];
offset += len_offset;
}
}
#endif
for ( ch = 0; ch < n_ch_full_copy; ch++ ) for ( ch = 0; ch < n_ch_full_copy; ch++ )
{ {
mvr2r( hTcBuffer->tc[ch], tmp_buf, nSamplesForRendering ); mvr2r( hTcBuffer->tc[ch], tmp_buf, nSamplesForRendering );
...@@ -2086,6 +2106,9 @@ static ivas_error ivas_jbm_dec_tc_audio_allocate( ...@@ -2086,6 +2106,9 @@ static ivas_error ivas_jbm_dec_tc_audio_allocate(
if ( Opt_tsm ) if ( Opt_tsm )
{ {
n_samp_full = ( NS2SA( output_Fs, MAX_JBM_L_FRAME_NS ) ); n_samp_full = ( NS2SA( output_Fs, MAX_JBM_L_FRAME_NS ) );
#ifdef FIX_1330_JBM_MEMORY
n_samp_full = max( n_samp_full, L_FRAME48k ); /* buffers are shared between 'hTcBuffer->tc[]' and 'p_output_f[]': ensure minimal length */
#endif
n_samp_residual = hTcBuffer->n_samples_granularity - 1; n_samp_residual = hTcBuffer->n_samples_granularity - 1;
} }
else else
...@@ -2145,6 +2168,10 @@ static ivas_error ivas_jbm_dec_tc_audio_allocate( ...@@ -2145,6 +2168,10 @@ static ivas_error ivas_jbm_dec_tc_audio_allocate(
} }
} }
#ifdef FIX_1330_JBM_MEMORY
hTcBuffer->tc_buffer2 = NULL;
#endif
return IVAS_ERR_OK; return IVAS_ERR_OK;
} }
...@@ -2182,6 +2209,14 @@ static void ivas_jbm_dec_tc_audio_deallocate( ...@@ -2182,6 +2209,14 @@ static void ivas_jbm_dec_tc_audio_deallocate(
hTcBuffer->tc_buffer_old[ch_idx] = NULL; hTcBuffer->tc_buffer_old[ch_idx] = NULL;
} }
} }
#ifdef FIX_1330_JBM_MEMORY
if ( hTcBuffer->tc_buffer2 != NULL )
{
free( hTcBuffer->tc_buffer2 );
hTcBuffer->tc_buffer2 = NULL;
}
#endif
} }
return; return;
...@@ -2378,7 +2413,11 @@ static void ivas_jbm_dec_tc_buffer_playout( ...@@ -2378,7 +2413,11 @@ static void ivas_jbm_dec_tc_buffer_playout(
for ( ch_idx = 0; ch_idx < st_ivas->hTcBuffer->nchan_transport_jbm; ch_idx++ ) for ( ch_idx = 0; ch_idx < st_ivas->hTcBuffer->nchan_transport_jbm; ch_idx++ )
{ {
#ifdef FIX_1330_JBM_MEMORY
output[ch_idx] = st_ivas->hTcBuffer->tc[ch_idx] + st_ivas->hTcBuffer->n_samples_rendered;
#else
mvr2r( st_ivas->hTcBuffer->tc[ch_idx] + st_ivas->hTcBuffer->n_samples_rendered, output[ch_idx], *nSamplesRendered ); mvr2r( st_ivas->hTcBuffer->tc[ch_idx] + st_ivas->hTcBuffer->n_samples_rendered, output[ch_idx], *nSamplesRendered );
#endif
} }
st_ivas->hTcBuffer->subframes_rendered = last_sf; st_ivas->hTcBuffer->subframes_rendered = last_sf;
......
...@@ -380,7 +380,7 @@ ivas_error ivas_create_lfe_dec( ...@@ -380,7 +380,7 @@ ivas_error ivas_create_lfe_dec(
LFE_DEC_HANDLE hLFE; LFE_DEC_HANDLE hLFE;
float lfe_addl_delay_s; float lfe_addl_delay_s;
int16_t i, j; int16_t i, j;
int16_t add_delay_sa; float lfe_block_delay_s;
low_pass_delay_dec_out = 0; low_pass_delay_dec_out = 0;
block_offset_s = 0; block_offset_s = 0;
...@@ -418,7 +418,7 @@ ivas_error ivas_create_lfe_dec( ...@@ -418,7 +418,7 @@ ivas_error ivas_create_lfe_dec(
hLFE->cum_freq_models[1][3] = &ivas_str_lfe_freq_models.entropy_coder_model_coarse_sg4; hLFE->cum_freq_models[1][3] = &ivas_str_lfe_freq_models.entropy_coder_model_coarse_sg4;
/* delay calculation */ /* delay calculation */
hLFE->lfe_block_delay_s = ( IVAS_LFE_FADE_NS / 1000000000.f ) + ivas_lfe_lpf_delay[IVAS_FILTER_ORDER_4 - 3]; lfe_block_delay_s = ( IVAS_LFE_FADE_NS / 1000000000.f ) + ivas_lfe_lpf_delay[IVAS_FILTER_ORDER_4 - 3];
block_offset_s = BLOCK_OFFSET_MS * 0.001f; block_offset_s = BLOCK_OFFSET_MS * 0.001f;
filt_order = 0; filt_order = 0;
...@@ -426,21 +426,21 @@ ivas_error ivas_create_lfe_dec( ...@@ -426,21 +426,21 @@ ivas_error ivas_create_lfe_dec(
if ( ( delay_ns / 1000000000.f ) > ivas_lfe_lpf_delay[IVAS_FILTER_ORDER_4 - 3] ) if ( ( delay_ns / 1000000000.f ) > ivas_lfe_lpf_delay[IVAS_FILTER_ORDER_4 - 3] )
{ {
filt_order = 4; filt_order = 4;
low_pass_delay_dec_out = ivas_lfe_lpf_delay[IVAS_FILTER_ORDER_4 - 3] * 1000000000.f; low_pass_delay_dec_out = ivas_lfe_lpf_delay[IVAS_FILTER_ORDER_4 - 3];
ivas_create_lfe_lpf_dec( &( hLFE->filter_state ), output_Fs ); ivas_create_lfe_lpf_dec( &( hLFE->filter_state ), output_Fs );
} }
hLFE->filter_state.order = filt_order; hLFE->filter_state.order = filt_order;
hLFE->lfe_block_delay_s = hLFE->lfe_block_delay_s + low_pass_delay_dec_out; lfe_block_delay_s = lfe_block_delay_s + low_pass_delay_dec_out;
hLFE->lfe_prior_buf_len = NS2SA( output_Fs, IVAS_LFE_FADE_NS ); hLFE->lfe_prior_buf_len = NS2SA( output_Fs, IVAS_LFE_FADE_NS );
hLFE->bfi_count = 0; hLFE->bfi_count = 0;
block_offset_s += delay_ns / 1000000000.f;
lfe_addl_delay_s = block_offset_s - lfe_block_delay_s;
lfe_addl_delay_s = block_offset_s - hLFE->lfe_block_delay_s;
lfe_addl_delay_s = max( 0.0f, lfe_addl_delay_s ); lfe_addl_delay_s = max( 0.0f, lfe_addl_delay_s );
add_delay_sa = (int16_t) roundf( (float) delay_ns * output_Fs / 1000000000.f ); hLFE->lfe_addl_delay = (int16_t) ( lfe_addl_delay_s * output_Fs );
hLFE->lfe_addl_delay = (int16_t) ( lfe_addl_delay_s * output_Fs ) + add_delay_sa; hLFE->delay_ns = delay_ns;
hLFE->lfe_block_delay_s += lfe_addl_delay_s + add_delay_sa / output_Fs;
if ( hLFE->lfe_addl_delay > 0 ) if ( hLFE->lfe_addl_delay > 0 )
{ {
......
...@@ -1320,7 +1320,11 @@ ivas_error ivas_masa_dec_reconfigure( ...@@ -1320,7 +1320,11 @@ ivas_error ivas_masa_dec_reconfigure(
Decoder_State **sts; Decoder_State **sts;
int32_t ivas_total_brate, last_ivas_total_brate; int32_t ivas_total_brate, last_ivas_total_brate;
int16_t numCldfbAnalyses_old, numCldfbSyntheses_old; int16_t numCldfbAnalyses_old, numCldfbSyntheses_old;
#ifdef FIX_1330_JBM_MEMORY
int16_t nchan_out_buff;
#else
int16_t nchan_out_buff_old, nchan_out_buff; int16_t nchan_out_buff_old, nchan_out_buff;
#endif
ivas_error error; ivas_error error;
int16_t pos_idx; int16_t pos_idx;
int32_t ism_total_brate; int32_t ism_total_brate;
...@@ -1328,8 +1332,10 @@ ivas_error ivas_masa_dec_reconfigure( ...@@ -1328,8 +1332,10 @@ ivas_error ivas_masa_dec_reconfigure(
ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate; ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate;
last_ivas_total_brate = st_ivas->hDecoderConfig->last_ivas_total_brate; last_ivas_total_brate = st_ivas->hDecoderConfig->last_ivas_total_brate;
#ifndef FIX_1330_JBM_MEMORY
nchan_out_buff_old = ivas_get_nchan_buffers_dec( st_ivas, -1, -1 ); nchan_out_buff_old = ivas_get_nchan_buffers_dec( st_ivas, -1, -1 );
#endif
/* Copy state to TC buffer if granularity matches and we are not in OMASA EXT rendering mode */ /* Copy state to TC buffer if granularity matches and we are not in OMASA EXT rendering mode */
if ( st_ivas->hSpatParamRendCom != NULL && st_ivas->hSpatParamRendCom->slot_size == st_ivas->hTcBuffer->n_samples_granularity && st_ivas->hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_EXTERNAL ) if ( st_ivas->hSpatParamRendCom != NULL && st_ivas->hSpatParamRendCom->slot_size == st_ivas->hTcBuffer->n_samples_granularity && st_ivas->hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_EXTERNAL )
{ {
...@@ -1474,6 +1480,10 @@ ivas_error ivas_masa_dec_reconfigure( ...@@ -1474,6 +1480,10 @@ ivas_error ivas_masa_dec_reconfigure(
ivas_masa_set_elements( ivas_total_brate, st_ivas->mc_mode, st_ivas->nchan_transport, st_ivas->hQMetaData, &tmp, &tmp, &tmp, st_ivas->ivas_format, st_ivas->ism_mode, ism_total_brate ); ivas_masa_set_elements( ivas_total_brate, st_ivas->mc_mode, st_ivas->nchan_transport, st_ivas->hQMetaData, &tmp, &tmp, &tmp, st_ivas->ivas_format, st_ivas->ism_mode, ism_total_brate );
/*-----------------------------------------------------------------*
* JBM TC buffers
*-----------------------------------------------------------------*/
{ {
int16_t tc_nchan_to_allocate; int16_t tc_nchan_to_allocate;
int16_t tc_nchan_transport; int16_t tc_nchan_transport;
...@@ -1544,7 +1554,11 @@ ivas_error ivas_masa_dec_reconfigure( ...@@ -1544,7 +1554,11 @@ ivas_error ivas_masa_dec_reconfigure(
if ( st_ivas->ivas_format == MASA_FORMAT && st_ivas->last_ivas_format == MASA_FORMAT ) /* note: switching with OMASA is addressed in ivas_omasa_dec_config() */ if ( st_ivas->ivas_format == MASA_FORMAT && st_ivas->last_ivas_format == MASA_FORMAT ) /* note: switching with OMASA is addressed in ivas_omasa_dec_config() */
{ {
nchan_out_buff = ivas_get_nchan_buffers_dec( st_ivas, -1, -1 ); nchan_out_buff = ivas_get_nchan_buffers_dec( st_ivas, -1, -1 );
#ifdef FIX_1330_JBM_MEMORY
if ( ( error = ivas_output_buff_dec( st_ivas->p_output_f, nchan_out_buff, st_ivas->hDecoderConfig->Opt_tsm, st_ivas->hTcBuffer ) ) != IVAS_ERR_OK )
#else
if ( ( error = ivas_output_buff_dec( st_ivas->p_output_f, nchan_out_buff_old, nchan_out_buff ) ) != IVAS_ERR_OK ) if ( ( error = ivas_output_buff_dec( st_ivas->p_output_f, nchan_out_buff_old, nchan_out_buff ) ) != IVAS_ERR_OK )
#endif
{ {
return error; return error;
} }
......