diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index be07b53f13762d4608acd7de0537b5023678c114..541aee3207a8605daae827aef53984471ce4d8d7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -602,8 +602,6 @@ pytest-compare-20ms-and-5ms-rendering: ### prepare pytest - cp IVAS_cod IVAS_cod_ref - cp IVAS_dec IVAS_dec_ref - # create short test vectors - - python3 tests/create_short_testvectors.py # create references - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR -v --update_ref 1 -m create_ref - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR -v --update_ref 1 -m create_ref_part2 @@ -920,8 +918,6 @@ ivas-pytest-on-merge-request: - if [ $ref_using_main == 0 ]; then git checkout $source_branch_commit_sha; fi ### prepare pytest - # create short test vectors - - python3 tests/create_short_testvectors.py # create references - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR -v --update_ref 1 -m create_ref - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR -v --update_ref 1 -m create_ref_part2 @@ -975,8 +971,6 @@ ivas-interop-on-merge-request: - non_interop_flag=$(grep -c --ignore-case "\[non[ -]*io\]" tmp.txt) || true ### prepare pytest - # create short test vectors - - python3 tests/create_short_testvectors.py # Run reference creation, using source branch encoder and main decoder (see .merge-request-comparison-setup-codec) - exit_code=0 @@ -1183,7 +1177,7 @@ check-bitexactness-hrtf-rom-and-file: - *print-common-info - cmake . - make -j - - python3 tests/create_short_testvectors.py --which all --cut_len 1.0 + - python3 tests/create_short_testvectors.py --cut_len 1.0 - python3 -m pytest tests/hrtf_binary_loading --html=report.html --junit-xml=report-junit.xml --self-contained-html artifacts: paths: @@ -1300,8 +1294,6 @@ codec-comparison-on-main-push: - if [ $ref_using_main == 0 ]; then git checkout $latest_commit;fi ### prepare pytest - # create short test vectors - - python3 tests/create_short_testvectors.py # rename test binaries back - mv IVAS_cod_test IVAS_cod - mv IVAS_dec_test IVAS_dec @@ -1385,7 +1377,6 @@ ivas-conformance: - cp -force IVAS_rend.exe IVAS_rend_ref.exe # Reference creation - - python tests/create_short_testvectors.py - python scripts/prepare_combined_format_inputs.py - $TEST_SET = "tests/codec_be_on_mr_nonselection", "tests/renderer/test_renderer.py", "tests/split_rendering/test_split_rendering.py" - python -m pytest $TEST_SET -v -n auto --update_ref 1 -m create_ref --create_ref --keep_files @@ -1479,7 +1470,6 @@ ivas-conformance-linux: - cp IVAS_rend IVAS_rend_ref # Reference creation - - python3 tests/create_short_testvectors.py - python3 scripts/prepare_combined_format_inputs.py - TEST_SET="tests/codec_be_on_mr_nonselection tests/renderer/test_renderer.py tests/split_rendering/test_split_rendering.py" - python3 -m pytest $TEST_SET -v -n auto --update_ref 1 -m create_ref --create_ref --keep_files @@ -2237,7 +2227,6 @@ coverage-test-on-main-scheduled: - *copy-ltv-files-to-testv-dir - make GCOV=1 -j - cp IVAS_rend IVAS_rend_ref # Copy exec to be able to run renderer script - - python3 tests/create_short_testvectors.py - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR -v -n auto --update_ref 1 -m create_ref --ref_encoder_path ./IVAS_cod --ref_decoder_path ./IVAS_dec - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR -v -n auto --update_ref 1 -m create_ref_part2 --ref_encoder_path ./IVAS_cod --ref_decoder_path ./IVAS_dec # need to ignore non-zero exit codes as limiter is active and thus the different framesiszes will not be BE in all cases diff --git a/scripts/config/self_test.prm b/scripts/config/self_test.prm index 1c194cc882f0898be98e724afaf5c359fe6952ac..caf2f264e99086f032c4e8285ca476a3611eade2 100644 --- a/scripts/config/self_test.prm +++ b/scripts/config/self_test.prm @@ -851,11 +851,11 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_dec 7_1_4 48 bit testv/stv3OA48c.wav_sw_48-48_7_1_4.tst // SBA FOA bitrate switching from 13.2 kbps to 192 kbps, 32kHz in, 32kHz out, DTX on, BINAURAL out -../IVAS_cod -dtx -sba 1 ../scripts/switchPaths/sw_13k2_192k_50fr.bin 32 testv/stvFOA32c.wav bit +../IVAS_cod -dtx -sba 1 ../scripts/switchPaths/sw_13k2_192k_50fr.bin 32 testv/stvFOA32c_cut_.004.wav bit ../IVAS_dec BINAURAL 32 bit testv/stvFOA32c.wav_sw_32-32_DTX_BINAURAL.tst // SBA 3OA bitrate switching from 13.2 kbps to 128 kbps, 32kHz in, 32kHz out, DTX on, HOA3 out -../IVAS_cod -dtx -sba 3 ../scripts/switchPaths/sw_13k2_to_128k_10fr.bin 32 testv/stv3OA32c.wav bit +../IVAS_cod -dtx -sba 3 ../scripts/switchPaths/sw_13k2_to_128k_10fr.bin 32 testv/stv3OA32c_cut_.004.wav bit ../IVAS_dec HOA3 32 bit testv/stv3OA32c.wav_sw_32-32_DTX_HOA3.tst // SBA FOA bitrate switching from 13.2 kbps to 512 kbps, 48kHz in, 48kHz out, FOA out @@ -1773,14 +1773,14 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_10pct.g ../IVAS_dec -hrtf ../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_48kHz.bin BINAURAL_ROOM_REVERB 48 bit testv/stvOSBA_4ISM_p3OA48c.wav_BINAURAL_ROOM_REVERB_512000_48-48.tst // SBA FOA bitrate switching from 13.2 kbps to 192 kbps, 32kHz in, 32kHz out, DTX on, EXT out -../IVAS_cod -dtx -sba 1 ../scripts/switchPaths/sw_13k2_192k_50fr.bin 32 testv/stvFOA32c.wav bit +../IVAS_cod -dtx -sba 1 ../scripts/switchPaths/sw_13k2_192k_50fr.bin 32 testv/stvFOA32c_cut_.004.wav bit ../IVAS_dec EXT 32 bit testv/stvFOA32c.wav_sw_32-32_DTX_EXT.tst // SBA 3OA bitrate switching from 13.2 kbps to 128 kbps, 32kHz in, 32kHz out, DTX on, EXT out -../IVAS_cod -dtx -sba 3 ../scripts/switchPaths/sw_13k2_to_128k_10fr.bin 32 testv/stv3OA32c.wav bit +../IVAS_cod -dtx -sba 3 ../scripts/switchPaths/sw_13k2_to_128k_10fr.bin 32 testv/stv3OA32c_cut_.004.wav bit ../IVAS_dec EXT 32 bit testv/stv3OA32c.wav_sw_32-32_DTX_EXT.tst // SBA 2OA bitrate switching from 13.2 kbps to 128 kbps, 48kHz in, 48kHz out, EXT out, random FER at 5%, DTX on -../IVAS_cod -dtx -sba 3 ../scripts/switchPaths/sw_13k2_to_128k_10fr.bin 48 testv/stv3OA48c.wav bit +../IVAS_cod -dtx -sba 3 ../scripts/switchPaths/sw_13k2_to_128k_10fr.bin 48 testv/stv3OA48c_cut_.004.wav bit eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error ../IVAS_dec EXT 48 bit_error testv/stv3OA48c.wav_sw_48-48_EXT_FER5.tst diff --git a/scripts/testv/stv2OA16c_cut.wav b/scripts/testv/stv2OA16c_cut.wav new file mode 100644 index 0000000000000000000000000000000000000000..ff5d903c04803709f75d6f0ff5a871f16ba5579c --- /dev/null +++ b/scripts/testv/stv2OA16c_cut.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:603bcfa3fdaf1cb7e73b7c9da7017b37680d85162b7494177be3cffed61d4231 +size 1440044 diff --git a/scripts/testv/stv2OA16c_cut_.004.wav b/scripts/testv/stv2OA16c_cut_.004.wav new file mode 100644 index 0000000000000000000000000000000000000000..d5180c44b05f23c78a354780964bef7e9c49e34a --- /dev/null +++ b/scripts/testv/stv2OA16c_cut_.004.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a08210deb9d2585838ad27b41e22b769b3e54cc8d5bfe15229520e19bf3098dc +size 1440044 diff --git a/scripts/testv/stv2OA16c_cut_16.0.wav b/scripts/testv/stv2OA16c_cut_16.0.wav new file mode 100644 index 0000000000000000000000000000000000000000..18a826bf09c3e990d2c6ce4fad8c707bc8e28a90 --- /dev/null +++ b/scripts/testv/stv2OA16c_cut_16.0.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1f8012db61a4be19a12d074b94a7a1b6ce15c71e0f84daabbfaae18aa97700c3 +size 1440044 diff --git a/scripts/testv/stv2OA32c_cut.wav b/scripts/testv/stv2OA32c_cut.wav new file mode 100644 index 0000000000000000000000000000000000000000..7e5c6aae8927219d3a6c154f2f70ac323a4c7fc7 --- /dev/null +++ b/scripts/testv/stv2OA32c_cut.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:038b5280a4c975ae3b6206d9b69ff513493f975d41c71d04a95209960e7a629b +size 2880044 diff --git a/scripts/testv/stv2OA32c_cut_.004.wav b/scripts/testv/stv2OA32c_cut_.004.wav new file mode 100644 index 0000000000000000000000000000000000000000..3f8956143d7b44308cc77c550edb8f13c54bca9f --- /dev/null +++ b/scripts/testv/stv2OA32c_cut_.004.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:db2a43841dbbd87cc152d7e703e53da77059ca8f52e92030990b2d884aaeea57 +size 2880044 diff --git a/scripts/testv/stv2OA32c_cut_16.0.wav b/scripts/testv/stv2OA32c_cut_16.0.wav new file mode 100644 index 0000000000000000000000000000000000000000..5f0d85863c42f911023172373b4fbd76d11b9e82 --- /dev/null +++ b/scripts/testv/stv2OA32c_cut_16.0.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f287429064e1a79f9f2c0b1d2bf0e6a8badc6224e9b12b67cd30975b1224cf4b +size 2880044 diff --git a/scripts/testv/stv2OA48c_cut.wav b/scripts/testv/stv2OA48c_cut.wav new file mode 100644 index 0000000000000000000000000000000000000000..eb8d0a3f6256ac01da679cb24cac88de01fcc1a9 --- /dev/null +++ b/scripts/testv/stv2OA48c_cut.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:df84bfe267d016665865ef1eced65c0150afb9b9a4890efd86ffbb87be36668e +size 4320044 diff --git a/scripts/testv/stv2OA48c_cut_.004.wav b/scripts/testv/stv2OA48c_cut_.004.wav new file mode 100644 index 0000000000000000000000000000000000000000..af076a2ccc4eeba12e2235a6dd58db9a4096bc6c --- /dev/null +++ b/scripts/testv/stv2OA48c_cut_.004.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4f1b7acc2b75144f970c0a158ae1706365c8247dec14ad43967360f1abf5c09a +size 4320044 diff --git a/scripts/testv/stv2OA48c_cut_16.0.wav b/scripts/testv/stv2OA48c_cut_16.0.wav new file mode 100644 index 0000000000000000000000000000000000000000..5ce1e0b7338bc1e29030b4998d5399a5dc336100 --- /dev/null +++ b/scripts/testv/stv2OA48c_cut_16.0.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:07d7bd51701997a3301ccee71e421c422388b8a076cc8b0b23b169da55a4b1b3 +size 4320044 diff --git a/scripts/testv/stv3OA16c_cut.wav b/scripts/testv/stv3OA16c_cut.wav new file mode 100644 index 0000000000000000000000000000000000000000..0a2952b90c35929140911dd0fdbab05d9fbaab91 --- /dev/null +++ b/scripts/testv/stv3OA16c_cut.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:35950b5b10ca76e910ae5294ee108d4d5b5fd1404aa69f678b035dd24438172e +size 2560044 diff --git a/scripts/testv/stv3OA16c_cut_.004.wav b/scripts/testv/stv3OA16c_cut_.004.wav new file mode 100644 index 0000000000000000000000000000000000000000..258b0b6d0bb7b1d0f994b294eaf8781946d0b078 --- /dev/null +++ b/scripts/testv/stv3OA16c_cut_.004.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:97fdb3191b17a60372f8f71d923f2bd0365c239a3ed5b9ff5a35a0cb94a2002f +size 2560044 diff --git a/scripts/testv/stv3OA16c_cut_16.0.wav b/scripts/testv/stv3OA16c_cut_16.0.wav new file mode 100644 index 0000000000000000000000000000000000000000..f835fb1c0c7e620a1483e5937071c2b013620bb5 --- /dev/null +++ b/scripts/testv/stv3OA16c_cut_16.0.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:377e348577a95275dfc6741a30693678c462726968d07557e456d3bd709674f0 +size 2560044 diff --git a/scripts/testv/stv3OA32c_cut.wav b/scripts/testv/stv3OA32c_cut.wav new file mode 100644 index 0000000000000000000000000000000000000000..9839a146f0f630cd8739190bede6cc34fe7a8089 --- /dev/null +++ b/scripts/testv/stv3OA32c_cut.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:841d1c86539c0842013c9ad3a562bdcc0d69ebd5c41f8655536898bbb7e79d35 +size 5120044 diff --git a/scripts/testv/stv3OA32c_cut_.004.wav b/scripts/testv/stv3OA32c_cut_.004.wav new file mode 100644 index 0000000000000000000000000000000000000000..6ed3da7e3b60fcc27dfa7753a6aba1cb3b4f289f --- /dev/null +++ b/scripts/testv/stv3OA32c_cut_.004.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4536b7f93ab6e12e1714ce419af8c7477790b71d0372bb430c9a2d46424cbdcc +size 5120044 diff --git a/scripts/testv/stv3OA32c_cut_16.0.wav b/scripts/testv/stv3OA32c_cut_16.0.wav new file mode 100644 index 0000000000000000000000000000000000000000..db3f20c704a0d54ba5c8fa01730575bbc9f81757 --- /dev/null +++ b/scripts/testv/stv3OA32c_cut_16.0.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:04cc8770deaf7899966ea1b94aa290a5a4ae2c712c85c51805ee2a6eeb409a2b +size 5120044 diff --git a/scripts/testv/stv3OA48c_cut.wav b/scripts/testv/stv3OA48c_cut.wav new file mode 100644 index 0000000000000000000000000000000000000000..6be77fbd8abdfbb83ffed106a4b1b7b821e0183f --- /dev/null +++ b/scripts/testv/stv3OA48c_cut.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cd905c085de10ea6cb3e753eae5a053082909a0022364c2a22b6ddc3319cbd8e +size 7680044 diff --git a/scripts/testv/stv3OA48c_cut_.004.wav b/scripts/testv/stv3OA48c_cut_.004.wav new file mode 100644 index 0000000000000000000000000000000000000000..0a7a771757620bcd8736f6f832a62ef6c6304173 --- /dev/null +++ b/scripts/testv/stv3OA48c_cut_.004.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:794c7cf7321d0e9c811358195f9bc8d28ba564ff22a6af587376c83b46361c22 +size 7680044 diff --git a/scripts/testv/stv3OA48c_cut_16.0.wav b/scripts/testv/stv3OA48c_cut_16.0.wav new file mode 100644 index 0000000000000000000000000000000000000000..8e3f436df267aea79b75c6c0355e196edebd6197 --- /dev/null +++ b/scripts/testv/stv3OA48c_cut_16.0.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:232f2d173e864ac3843197e2d6c291881980aa22710aa0a16f518b5684d25ae4 +size 7680044 diff --git a/scripts/testv/stvFOA16c_cut.wav b/scripts/testv/stvFOA16c_cut.wav new file mode 100644 index 0000000000000000000000000000000000000000..6529a74cf3310ea7d2208b4ebe3ed174b11e8ba5 --- /dev/null +++ b/scripts/testv/stvFOA16c_cut.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7cefe32372f32cf518486b4dd5bdb599a34a877b5822152d62777d0be723cffd +size 640044 diff --git a/scripts/testv/stvFOA16c_cut_.004.wav b/scripts/testv/stvFOA16c_cut_.004.wav new file mode 100644 index 0000000000000000000000000000000000000000..9d07f0d7d45e915527e38d9c2558520220e01e8d --- /dev/null +++ b/scripts/testv/stvFOA16c_cut_.004.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:56c7fe054cb42b39ba8e4ff67d00adcf0fe82edfcdaf58179380708ea9dc760b +size 640044 diff --git a/scripts/testv/stvFOA16c_cut_16.0.wav b/scripts/testv/stvFOA16c_cut_16.0.wav new file mode 100644 index 0000000000000000000000000000000000000000..7ede9f26929a35a7e4d3381d05fb8fa7f1e7f39d --- /dev/null +++ b/scripts/testv/stvFOA16c_cut_16.0.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:23c1baac936d4ee00304b8da8847fc201bf5658827bf5155038ea73dd50048ce +size 640044 diff --git a/scripts/testv/stvFOA32c_cut.wav b/scripts/testv/stvFOA32c_cut.wav new file mode 100644 index 0000000000000000000000000000000000000000..1fc25fcd6263d5d0f2df5b4452817782334ee7c8 --- /dev/null +++ b/scripts/testv/stvFOA32c_cut.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1e204055ee1daeecc715f8d167532ba6b49b022c7671487f6abcadca0fc33bea +size 1280044 diff --git a/scripts/testv/stvFOA32c_cut_.004.wav b/scripts/testv/stvFOA32c_cut_.004.wav new file mode 100644 index 0000000000000000000000000000000000000000..a122bc20984b312240b27e2eb9e14f5f9cf1b1b1 --- /dev/null +++ b/scripts/testv/stvFOA32c_cut_.004.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:55037196717e4e8f0f4b532381e0770642ace75adfac0524230e09ef7b407635 +size 1280044 diff --git a/scripts/testv/stvFOA32c_cut_16.0.wav b/scripts/testv/stvFOA32c_cut_16.0.wav new file mode 100644 index 0000000000000000000000000000000000000000..213a894796abeabd1494cbf71ebd7329e81e5042 --- /dev/null +++ b/scripts/testv/stvFOA32c_cut_16.0.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1e55b8064e43221eff40393b903c973aae937244874f677f4a9358c8cb16caba +size 1280044 diff --git a/scripts/testv/stvFOA48c_cut.wav b/scripts/testv/stvFOA48c_cut.wav new file mode 100644 index 0000000000000000000000000000000000000000..7f3c6231ec70202b3d35aba5d24471ac221ae324 --- /dev/null +++ b/scripts/testv/stvFOA48c_cut.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5d86c4f8fcd8de2395cbe83a9d7846c107bf4a34c4878c6731827ff2acf6f9a7 +size 1920044 diff --git a/scripts/testv/stvFOA48c_cut_.004.wav b/scripts/testv/stvFOA48c_cut_.004.wav new file mode 100644 index 0000000000000000000000000000000000000000..f6bbf0f1ff06cdd0aebc425da8f9bf1935846047 --- /dev/null +++ b/scripts/testv/stvFOA48c_cut_.004.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c5e40af6a3133a734abebb25071de55cec175d824b381ae92948489ef2099cc5 +size 1920044 diff --git a/scripts/testv/stvFOA48c_cut_16.0.wav b/scripts/testv/stvFOA48c_cut_16.0.wav new file mode 100644 index 0000000000000000000000000000000000000000..30a9b21f2c442aa75b983d322e111d6f05e8186c --- /dev/null +++ b/scripts/testv/stvFOA48c_cut_16.0.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:07ba1c3ebfe3c427fab6efc0c9f58b3bfe3a744e5cb394653ac92457d6b46250 +size 1920044 diff --git a/tests/codec_be_on_mr_nonselection/test_param_file.py b/tests/codec_be_on_mr_nonselection/test_param_file.py index 137000976fd2fc3e5533231f58f26cb7fc2e00ca..e8de6decf3bbb5f99ed401987daf85cfcb1204ca 100644 --- a/tests/codec_be_on_mr_nonselection/test_param_file.py +++ b/tests/codec_be_on_mr_nonselection/test_param_file.py @@ -39,12 +39,10 @@ import re import platform from pathlib import Path from subprocess import run - import pytest from tests.cmp_pcm import cmp_pcm from tests.conftest import DecoderFrontend, EncoderFrontend -from tests.cut_pcm import cut_samples from tests.testconfig import PARAM_FILE from . import MLD_PATTERN, MAX_DIFF_PATTERN @@ -165,17 +163,6 @@ def test_param_file_tests( sampling_rate = int(fs) bitrate = enc_split.pop() - sba_br_switching_dtx = 0 - if ( - not bitrate.isdigit() - and "-dtx" in enc_split - and "-sba" in enc_split - and Path(testv_file).name.startswith("stv") - ): - sba_br_switching_dtx = 1 - cut_file = pre_proc_input(testv_file, fs) - testv_file = cut_file - # bitrate can be a filename: remove leading "../" if bitrate.startswith("../"): bitrate = bitrate[3:] @@ -202,10 +189,6 @@ def test_param_file_tests( enc_split, update_ref, ) - if sba_br_switching_dtx == 1 and not keep_files: - is_exist = os.path.exists(cut_file) - if is_exist: - os.remove(cut_file) # check for networkSimulator_g192 command line if sim_opts != "": @@ -451,21 +434,6 @@ def encode( ) -def pre_proc_input(testv_file, fs): - cut_from = "0.0" - cut_len = "5.0" - cut_gain = "0.004" - if "stvFOA" in testv_file: - num_channel = "4" - elif "stv2OA" in testv_file: - num_channel = "9" - elif "stv3OA" in testv_file: - num_channel = "16" - cut_file = testv_file.replace(".wav", num_channel + "chn_" + cut_gain + ".wav") - cut_samples(testv_file, cut_file, num_channel, cut_from, cut_len, cut_gain) - return cut_file - - def simulate( reference_path, dut_base_path, diff --git a/tests/codec_be_on_mr_nonselection/test_sba_bs_enc.py b/tests/codec_be_on_mr_nonselection/test_sba_bs_enc.py index b7effa986c272f4799583589e2d12262f026c745..788421f833ce6ac2dedae8350f16fbff39537d3a 100644 --- a/tests/codec_be_on_mr_nonselection/test_sba_bs_enc.py +++ b/tests/codec_be_on_mr_nonselection/test_sba_bs_enc.py @@ -42,7 +42,6 @@ from cut_bs import cut_from_start from tests.cmp_pcm import cmp_pcm from tests.conftest import DecoderFrontend, EncoderFrontend -from tests.cut_pcm import cut_samples from . import MLD_PATTERN, MAX_DIFF_PATTERN # params @@ -585,16 +584,7 @@ def sba_enc( cut_file = f"{test_vector_path}/{tag_in}_cut{in_extension}" else: cut_file = f"{test_vector_path}/{tag_in}_cut_{cut_gain}{in_extension}" - if not os.path.exists(cut_file): - cut_samples( - input_path, - cut_file, - num_channels, - cut_from, - cut_len, - cut_gain, - sample_rate=sampling_rate + "000", - ) + input_path = cut_file if ref_encoder_frontend: diff --git a/tests/create_short_testvectors.py b/tests/create_short_testvectors.py index e51f018f451ced981a72fa502103026a3b5543e4..87d05e001e189a4a93eeb1f02f27ff03d9ee1ab9 100755 --- a/tests/create_short_testvectors.py +++ b/tests/create_short_testvectors.py @@ -42,14 +42,14 @@ from cut_pcm import cut_samples HERE = Path(__file__).parent.resolve() TEST_VECTOR_DIR = HERE.joinpath("../scripts/testv").resolve() +SCRIPTS_DIR = HERE.joinpath("../scripts").resolve() -NUM_CHANNELS = "4" # currently only FOA -CUT_FROM = "0.0" +sys.path.append(SCRIPTS_DIR) +from pyaudio3dtools import audiofile +CUT_FROM = "0.0" +GAIN = "1.0" FILE_IDS = [ - "stvFOA", - "stv2OA", - "stv3OA", "stv51MC", "stv71MC", "stv512MC", @@ -58,40 +58,31 @@ FILE_IDS = [ "ISM", "MASA", ] -GAINS = ["1.0", "16.0", ".004"] -def collect_files(file_ids): +def collect_files(): files = [ f.absolute() for f in TEST_VECTOR_DIR.iterdir() if f.suffix == ".wav" - and any([id in f.name for id in file_ids]) + and any([id in f.name for id in FILE_IDS]) and "_cut" not in f.name ] return files -def create_short_testvectors(which="foa", cut_len=5.0): - file_ids = [] - if which == "all": - file_ids = FILE_IDS - elif which == "foa": - file_ids = FILE_IDS[:1] - - for f in collect_files(file_ids): - for g in GAINS: - suffix = "_cut" - if g != "1.0": - suffix += f"_{g}" +def create_short_testvectors(cut_len=5.0): + files = collect_files() - out_file = f.parent.joinpath(f.stem + suffix + f.suffix) - cut_samples(f, out_file, NUM_CHANNELS, CUT_FROM, f"{cut_len}", g) + for f in files: + suffix = "_cut" + out_file = f.parent.joinpath(f.stem + suffix + f.suffix) + num_channels = audiofile.get_wav_file_info(f)["channels"] + cut_samples(f, out_file, num_channels, CUT_FROM, f"{cut_len}", GAIN) if __name__ == "__main__": parser = argparse.ArgumentParser() - parser.add_argument("--which", choices=["foa", "all"], default="foa") def positive_float(x: str) -> float: x = float(x) @@ -101,6 +92,5 @@ if __name__ == "__main__": parser.add_argument("--cut_len", type=positive_float, default=5.0) args = parser.parse_args() - which = args.which cut_len = args.cut_len - sys.exit(create_short_testvectors(which=args.which, cut_len=cut_len)) + sys.exit(create_short_testvectors(cut_len=cut_len)) diff --git a/tests/test_param_file_ltv.py b/tests/test_param_file_ltv.py index 36efa91a2cab16a13685c6e8325ac5a33f62f01a..646258fabbbaafbee26a03c60005e1e031575823 100644 --- a/tests/test_param_file_ltv.py +++ b/tests/test_param_file_ltv.py @@ -44,7 +44,6 @@ import pytest from tests.cmp_pcm import cmp_pcm from tests.conftest import DecoderFrontend, EncoderFrontend -from tests.cut_pcm import cut_samples from .codec_be_on_mr_nonselection import MLD_PATTERN, MAX_DIFF_PATTERN # from tests.testconfig import PARAM_FILE @@ -167,17 +166,6 @@ def test_param_file_tests( sampling_rate = int(fs) bitrate = enc_split.pop() - sba_br_switching_dtx = 0 - if ( - not bitrate.isdigit() - and "-dtx" in enc_split - and "-sba" in enc_split - and testv_file.split("/")[1].startswith("stv") - ): - sba_br_switching_dtx = 1 - cut_file = pre_proc_input(testv_file, fs) - testv_file = cut_file - # bitrate can be a filename: remove leading "../" if bitrate.startswith("../"): bitrate = bitrate[3:] @@ -203,10 +191,6 @@ def test_param_file_tests( enc_split, update_ref, ) - if sba_br_switching_dtx == 1 and not keep_files: - is_exist = os.path.exists(cut_file) - if is_exist: - os.remove(cut_file) # check for networkSimulator_g192 command line if sim_opts != "": @@ -435,21 +419,6 @@ def encode( ) -def pre_proc_input(testv_file, fs): - cut_from = "0.0" - cut_len = "5.0" - cut_gain = "0.004" - if "stvFOA" in testv_file: - num_channel = "4" - elif "stv2OA" in testv_file: - num_channel = "9" - elif "stv3OA" in testv_file: - num_channel = "16" - cut_file = testv_file.replace(".wav", num_channel + "chn_" + cut_gain + ".wav") - cut_samples(testv_file, cut_file, num_channel, cut_from, cut_len, cut_gain) - return cut_file - - def simulate( reference_path, dut_base_path,