diff --git a/lib_com/options.h b/lib_com/options.h index 8e314ba4f1678e9adc9176adfe608dcc7f64492c..4d8e7d5f743612b2af110bd44a27a7852093308f 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -164,6 +164,7 @@ #define FIX_1099_JBM_MD_HANDLE_ALLOC /* VA: issue 1099: Limit the allocation of `hJbmMetadata` handle to MASA and OMASA only */ #define FIX_1111_TDM_LSP_BUFFER /* VA: issue 1111: remove unused buffer `tdm_lspQ_PCh[]' */ #define FIX_1101_CLEANING_JBM_CALL /* VA: issue 1101: remove obsolete call of ivas_jbm_dec_tc_buffer_open() */ +#define FIX_1053_AEID_FILE_TEST /* Philips: Tests for the -aeid file and fix for memory error */ /* #################### End BE switches ################################## */ diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index 66032833c158178a9f960c247886674ea9ebdd06..d60bc2b7a21f986bce82cc3c4de6d61ddaea5f00 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -2084,6 +2084,9 @@ static ivas_error copyRendererConfigStruct( mvr2r( hRCin->roomAcoustics.pAcoustic_rt60, hRCout->roomAcoustics.pAcoustic_rt60, CLDFB_NO_CHANNELS_MAX ); mvr2r( hRCin->roomAcoustics.pAcoustic_dsr, hRCout->roomAcoustics.pAcoustic_dsr, CLDFB_NO_CHANNELS_MAX ); mvr2r( hRCin->directivity, hRCout->directivity, 3 * MAX_NUM_OBJECTS ); +#ifdef FIX_1053_AEID_FILE_TEST + mvr2r( hRCin->distAtt, hRCout->distAtt, 3 ); +#endif hRCout->split_rend_config = hRCin->split_rend_config; diff --git a/scripts/config/self_test.prm b/scripts/config/self_test.prm index 6a35d9ec1e2985e300fc0a8c6c983b7d5b6a8ac8..c3ff72f61d0388109d088181719468ee2f3a9961 100644 --- a/scripts/config/self_test.prm +++ b/scripts/config/self_test.prm @@ -1320,6 +1320,18 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -mc 5_1 512000 48 testv/stv51MC48c.wav bit ../IVAS_dec -render_config testv/rend_config_renderer.cfg BINAURAL_ROOM_REVERB 16 bit testv/stv51MC48c.wav_MC51_512000_48-16_MC_Config_renderer.tst +// Multi-channel 5_1 at 512 kbps, 48kHz in 48kHz out, BINAURAL_ROOM_REVERB out custom acoustic environment with a sequence (CREND) +../IVAS_cod -mc 5_1 512000 48 testv/stv51MC48c.wav bit +../IVAS_dec -render_config testv/rend_config_combined.cfg -aeid testv/aeid1.txt BINAURAL_ROOM_REVERB 48 bit testv/stv51MC48c.wav_MC51_512000_48-48_MC_reverb_sequence.tst + +// Multi-channel 5_1 at 64 kbps, 48kHz in 48kHz out, BINAURAL_ROOM_REVERB out custom acoustic environment with a sequence (FastConv) +../IVAS_cod -mc 5_1 64000 48 testv/stv51MC48c.wav bit +../IVAS_dec -render_config testv/rend_config_combined.cfg -aeid testv/aeid2.txt BINAURAL_ROOM_REVERB 48 bit testv/stv51MC48c.wav_MC51_64000_48-48_MC_reverb_sequence.tst + +// Multi-channel 5_1 at 32 kbps, 48kHz in 48kHz out, BINAURAL_ROOM_REVERB out custom acoustic environment with a sequence (ParamBin) +../IVAS_cod -mc 5_1 32000 48 testv/stv51MC48c.wav bit +../IVAS_dec -render_config testv/rend_config_combined.cfg -aeid testv/aeid3.txt BINAURAL_ROOM_REVERB 48 bit testv/stv51MC48c.wav_MC51_32000_48-48_MC_reverb_sequence.tst + // Multi-channel 5_1 at 32 kbps, 48kHz in, 48kHz out, BINAURAL_ROOM_REVERB out Config hospital_patientroom ../IVAS_cod -mc 5_1 32000 48 testv/stv51MC48c.wav bit ../IVAS_dec -render_config testv/rend_config_hospital_patientroom.cfg BINAURAL_ROOM_REVERB 48 bit testv/stv51MC48c.wav_MC51_32000_48-48_MC_Config_hospital_patientroom.tst diff --git a/scripts/config/self_test_ltv.prm b/scripts/config/self_test_ltv.prm index bb815be3adc04a370c2c75460cadded58c10260f..7ca6ce18d4766c671c56d71abfcfaea522134766 100644 --- a/scripts/config/self_test_ltv.prm +++ b/scripts/config/self_test_ltv.prm @@ -1319,6 +1319,18 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -mc 5_1 512000 48 testv/ltv48_MC51.wav bit ../IVAS_dec -render_config testv/rend_config_renderer.cfg BINAURAL_ROOM_REVERB 16 bit testv/ltv48_MC51.wav_MC51_512000_48-16_MC_Config_renderer.tst +// Multi-channel 5_1 at 512 kbps, 48kHz in 48kHz out, BINAURAL_ROOM_REVERB out custom acoustic environment with a sequence (CREND) +../IVAS_cod -mc 5_1 512000 48 testv/ltv51MC48c.wav bit +../IVAS_dec -render_config testv/rend_config_combined.cfg -aeid testv/aeid1.txt BINAURAL_ROOM_REVERB 48 bit testv/ltv51MC48c.wav_MC51_512000_48-48_MC_reverb_sequence.tst + +// Multi-channel 5_1 at 64 kbps, 48kHz in 48kHz out, BINAURAL_ROOM_REVERB out custom acoustic environment with a sequence (FastConv) +../IVAS_cod -mc 5_1 64000 48 testv/ltv51MC48c.wav bit +../IVAS_dec -render_config testv/rend_config_combined.cfg -aeid testv/aeid2.txt BINAURAL_ROOM_REVERB 48 bit testv/ltv51MC48c.wav_MC51_64000_48-48_MC_reverb_sequence.tst + +// Multi-channel 5_1 at 32 kbps, 48kHz in 48kHz out, BINAURAL_ROOM_REVERB out custom acoustic environment with a sequence (ParamBin) +../IVAS_cod -mc 5_1 32000 48 testv/ltv51MC48c.wav bit +../IVAS_dec -render_config testv/rend_config_combined.cfg -aeid testv/aeid3.txt BINAURAL_ROOM_REVERB 48 bit testv/ltv51MC48c.wav_MC51_32000_48-48_MC_reverb_sequence.tst + // Multi-channel 5_1 at 32 kbps, 48kHz in, 48kHz out, BINAURAL_ROOM_REVERB out Config hospital_patientroom ../IVAS_cod -mc 5_1 32000 48 testv/ltv48_MC51.wav bit ../IVAS_dec -render_config testv/rend_config_hospital_patientroom.cfg BINAURAL_ROOM_REVERB 48 bit testv/ltv48_MC51.wav_MC51_80000_48-48_MC_Config_hospital_patientroom.tst diff --git a/scripts/testv/aeid1.txt b/scripts/testv/aeid1.txt new file mode 100644 index 0000000000000000000000000000000000000000..66cd02723f34933e0229b0b9d80d37013cc5e178 --- /dev/null +++ b/scripts/testv/aeid1.txt @@ -0,0 +1,3 @@ +1 200 +0 100 +2 500 \ No newline at end of file diff --git a/scripts/testv/aeid2.txt b/scripts/testv/aeid2.txt new file mode 100644 index 0000000000000000000000000000000000000000..0c7700c444292e09af732bfbab464ae093c3a230 --- /dev/null +++ b/scripts/testv/aeid2.txt @@ -0,0 +1,3 @@ +1 500 +2 100 +0 300 \ No newline at end of file diff --git a/scripts/testv/aeid3.txt b/scripts/testv/aeid3.txt new file mode 100644 index 0000000000000000000000000000000000000000..7136bcabbca3dafe3799602bb920ba58c89609d8 --- /dev/null +++ b/scripts/testv/aeid3.txt @@ -0,0 +1,3 @@ +0 100 +2 500 +1 200 \ No newline at end of file diff --git a/tests/renderer/test_renderer.py b/tests/renderer/test_renderer.py index 3c9b95dbaf66170a9bd4204fc0c25bfc53e83e1a..e89096ceed6ff4a76620601766a1aaf49cd9a990 100644 --- a/tests/renderer/test_renderer.py +++ b/tests/renderer/test_renderer.py @@ -30,6 +30,7 @@ the United Nations Convention on Contracts on the International Sales of Goods. """ +from pathlib import Path import pytest from .constants import ( @@ -151,6 +152,31 @@ def test_dynamic_acoustic_environment( aeid=aeid, ) +@pytest.mark.create_ref +@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL[2:]) +@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_AMBI) +@pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) +def test_dynamic_acoustic_environment_file( + record_property, test_info, in_fmt, out_fmt, frame_size, get_mld, get_mld_lim +): + rend_config_path = TEST_VECTOR_DIR.joinpath(f"rend_config_combined.cfg") + rend_config_path.with_stem(f"rend_config") + + aeid = TEST_VECTOR_DIR.joinpath(f"aeid1.txt") + + run_renderer( + record_property, + test_info, + in_fmt, + out_fmt, + binary_suffix=EXE_SUFFIX, + frame_size=frame_size, + get_mld=get_mld, + mld_lim=get_mld_lim, + config_file=rend_config_path, + aeid=aeid, + ) + """ Multichannel """ diff --git a/tests/renderer/utils.py b/tests/renderer/utils.py index 9bd2b8f4b77f04a89ef89ca8416de2c840815c5d..239e846ca0e800bc1ce7adb2331941b8fa916866 100644 --- a/tests/renderer/utils.py +++ b/tests/renderer/utils.py @@ -33,9 +33,10 @@ import filecmp import logging import os +from pathlib import Path import subprocess as sp import sys -from typing import Dict, Optional +from typing import Dict, Optional, Union import numpy as np import pytest @@ -164,7 +165,7 @@ def run_renderer( get_mld=False, mld_lim=0, get_mld_lim=0, - aeid: Optional[str] = None, + aeid: Optional[Union[Path, int]] = None, ) -> str: # prepare arguments and filepaths if trj_file is not None: @@ -198,7 +199,10 @@ def run_renderer( framing_name = "" if aeid is not None: - aeid_name = f"_{aeid}" + if isinstance(aeid, Path): + aeid_name = f"_{aeid.stem}" + else: + aeid_name = aeid else: aeid_name = ""