From 81436f1995f2085c22f486b4226f86b33e9a57bb Mon Sep 17 00:00:00 2001 From: "Huo, Jiaquan" Date: Sun, 4 Aug 2024 20:51:47 +1000 Subject: [PATCH 1/5] add ltv to sba pytests, not tested --- tests/codec_be_on_mr_nonselection/test_sba.py | 55 +++++++++++++++---- 1 file changed, 45 insertions(+), 10 deletions(-) diff --git a/tests/codec_be_on_mr_nonselection/test_sba.py b/tests/codec_be_on_mr_nonselection/test_sba.py index a69e54a290..efab83be77 100644 --- a/tests/codec_be_on_mr_nonselection/test_sba.py +++ b/tests/codec_be_on_mr_nonselection/test_sba.py @@ -46,11 +46,11 @@ from ..constants import TESTV_DIR # params -tag_list = ["stvFOA"] -tag_list_HOA2 = ["stv2OA"] -tag_list_HOA3 = ["stv3OA"] +tag_list = ["stvFOA", "ltvFOA"] +tag_list_HOA2 = ["stv2OA", "ltvHOA2"] +tag_list_HOA3 = ["stv3OA", "ltvHOA3"] -tag_list_bw_force = ["stvFOA"] +tag_list_bw_force = ["stvFOA", "ltvFOA"] dtx_set = ["0", "1"] dict_fsample_bw = {"48": "3", "32": "2", "16": "1"} dict_bw_idx = {"FB": "3", "SWB": "2", "WB": "1"} @@ -117,7 +117,6 @@ def test_pca_enc( get_odg, ): pca = True - tag = tag + fs + "c" ivas_br = "256000" dtx = "0" max_bw = "FB" @@ -125,6 +124,13 @@ def test_pca_enc( sba_order = "+1" output_config = "FOA" + if "ltv" in tag: + tag = f"ltv{fs}_FOA" + elif "stv" in tag: + tag = tag + fs + "c" + else: + assert 0 + if not decoder_only: # enc sba_enc( @@ -227,7 +233,14 @@ def test_sba_enc_system( pytest.skip() if gain_flag == 1 and ivas_br not in ["13200", "16400", "24400", "32000"]: pytest.skip() - tag = tag + fs + "c" + + if "ltv" in tag: + tag = f"ltv{fs}_FOA" + elif "stv" in tag: + tag = tag + fs + "c" + else: + assert 0 + max_bw = "FB" sba_order = "+1" output_config = "FOA" @@ -317,7 +330,13 @@ def test_spar_hoa2_enc_system( dtx = "0" gain_flag = -1 - tag = tag + fs + "c" + if "ltv" in tag: + tag = f"ltv{fs}_HOA2" + elif "stv" in tag: + tag = tag + fs + "c" + else: + assert 0 + max_bw = "FB" sba_order = "+2" output_config = "HOA2" @@ -398,7 +417,13 @@ def test_spar_hoa3_enc_system( dtx = "0" gain_flag = -1 - tag = tag + fs + "c" + if "ltv" in tag: + tag = f"ltv{fs}_HOA3" + elif "stv" in tag: + tag = tag + fs + "c" + else: + assert 0 + max_bw = "FB" sba_order = "+3" output_config = "HOA3" @@ -488,7 +513,12 @@ def test_sba_enc_BWforce_system( pytest.skip() fs = sample_rate_bw_idx[0] bw = sample_rate_bw_idx[1] - tag = tag + fs + "c" + if "ltv" in tag: + tag = f"ltv{fs}_FOA" + elif "stv" in tag: + tag = tag + fs + "c" + else: + assert 0 gain_flag = -1 sba_order = "+1" output_config = "FOA" @@ -593,7 +623,12 @@ def test_sba_plc_system( pytest.skip() if gain_flag == 1 and ivas_br not in ["13200", "16400", "24400", "32000"]: pytest.skip() - tag = tag + fs + "c" + if "ltv" in tag: + tag = f"ltv{fs}_FOA" + elif "stv" in tag: + tag = tag + fs + "c" + else: + assert 0 # dec sba_dec( -- GitLab From 6da9e84fe642ecb83505792050580a398c941e14 Mon Sep 17 00:00:00 2001 From: "Huo, Jiaquan" Date: Mon, 5 Aug 2024 10:31:41 +1000 Subject: [PATCH 2/5] no test vector cutting for ltv tests --- tests/codec_be_on_mr_nonselection/test_sba.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/tests/codec_be_on_mr_nonselection/test_sba.py b/tests/codec_be_on_mr_nonselection/test_sba.py index efab83be77..32e3feecdd 100644 --- a/tests/codec_be_on_mr_nonselection/test_sba.py +++ b/tests/codec_be_on_mr_nonselection/test_sba.py @@ -123,11 +123,13 @@ def test_pca_enc( gain_flag = -1 sba_order = "+1" output_config = "FOA" - + if "ltv" in tag: tag = f"ltv{fs}_FOA" + cut_testv = False elif "stv" in tag: tag = tag + fs + "c" + cut_testv=True else: assert 0 @@ -150,7 +152,7 @@ def test_pca_enc( update_ref, gain_flag, keep_files, - cut_testv=True, + cut_testv=cut_testv, pca=pca, ) @@ -236,8 +238,10 @@ def test_sba_enc_system( if "ltv" in tag: tag = f"ltv{fs}_FOA" + cut_testv = False elif "stv" in tag: tag = tag + fs + "c" + cut_testv = True else: assert 0 @@ -272,7 +276,7 @@ def test_sba_enc_system( keep_files, cut_gain=cut_gain, create_dutenc=True, - cut_testv=True, + cut_testv=cut_testv, ) # dec @@ -515,8 +519,10 @@ def test_sba_enc_BWforce_system( bw = sample_rate_bw_idx[1] if "ltv" in tag: tag = f"ltv{fs}_FOA" + cut_testv = False elif "stv" in tag: tag = tag + fs + "c" + cut_testv = True else: assert 0 gain_flag = -1 @@ -542,7 +548,7 @@ def test_sba_enc_BWforce_system( update_ref, gain_flag, keep_files, - cut_testv=True, + cut_testv=cut_testv, ) # dec -- GitLab From 5aab6d552340f9f2de3dd3247595478113df0819 Mon Sep 17 00:00:00 2001 From: "Huo, Jiaquan" Date: Wed, 14 Aug 2024 10:12:33 +1000 Subject: [PATCH 3/5] use --use_ltv to run ltv tests --- tests/codec_be_on_mr_nonselection/test_sba.py | 9 +++++---- tests/conftest.py | 8 ++++++++ tests/testconfig.py | 2 ++ 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/tests/codec_be_on_mr_nonselection/test_sba.py b/tests/codec_be_on_mr_nonselection/test_sba.py index 32e3feecdd..66fe1f5891 100644 --- a/tests/codec_be_on_mr_nonselection/test_sba.py +++ b/tests/codec_be_on_mr_nonselection/test_sba.py @@ -43,14 +43,15 @@ from tests.cmp_pcm import cmp_pcm from tests.conftest import DecoderFrontend, EncoderFrontend from ..conftest import parse_properties from ..constants import TESTV_DIR +from tests.testconfig import use_ltv # params -tag_list = ["stvFOA", "ltvFOA"] -tag_list_HOA2 = ["stv2OA", "ltvHOA2"] -tag_list_HOA3 = ["stv3OA", "ltvHOA3"] +tag_list = ["ltvFOA" if use_ltv else "stvFOA"] +tag_list_HOA2 = ["ltvHOA2" if use_ltv else "stv2OA"] +tag_list_HOA3 = ["ltvHOA3" if use_ltv else "stv3OA"] -tag_list_bw_force = ["stvFOA", "ltvFOA"] +tag_list_bw_force = tag_list dtx_set = ["0", "1"] dict_fsample_bw = {"48": "3", "32": "2", "16": "1"} dict_bw_idx = {"FB": "3", "SWB": "2", "WB": "1"} diff --git a/tests/conftest.py b/tests/conftest.py index b75b3ba997..909fef2540 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -134,6 +134,12 @@ def pytest_addoption(parser): help="If specified, use given param file in test_param_file.", ) + parser.addoption( + "--use_ltv", + action="store_true", + help="If specified, run relevant tests with ltv.", + ) + parser.addoption( "--keep_files", action="store_true", @@ -820,6 +826,8 @@ def pytest_configure(config): ) if config.option.param_file: testconfig.PARAM_FILE = config.option.param_file + if config.option.use_ltv: + testconfig.use_ltv = True if config.option.selection_be_md5_file: md5_file_path = config.option.selection_be_md5_file if not platform.system() == "Windows": diff --git a/tests/testconfig.py b/tests/testconfig.py index 77e0f9f59d..17a0288740 100644 --- a/tests/testconfig.py +++ b/tests/testconfig.py @@ -37,3 +37,5 @@ from pathlib import Path PARAM_FILE = Path("scripts/config/self_test.prm") MD5_REF_DICT = dict() + +use_ltv = False \ No newline at end of file -- GitLab From fdeaa5614488e351f95d26fa4cb51d0a004b5024 Mon Sep 17 00:00:00 2001 From: "Huo, Jiaquan" Date: Thu, 15 Aug 2024 14:23:25 +1000 Subject: [PATCH 4/5] add ltv pytests to coverage-test-on-main-scheduled job --- .gitlab-ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 97d547d5c5..05198cc3cd 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2248,9 +2248,13 @@ coverage-test-on-main-scheduled: - cp IVAS_rend IVAS_rend_ref # Copy exec to be able to run renderer script - 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 + - 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 --use_ltv + - 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 --use_ltv # need to ignore non-zero exit codes as limiter is active and thus the different framesiszes will not be BE in all cases - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR -v --dut_encoder_path ./IVAS_cod --dut_decoder_path ./IVAS_dec --dut_fr 5 --decoder_only || true - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR -v --dut_encoder_path ./IVAS_cod --dut_decoder_path ./IVAS_dec --dut_fr 10 --decoder_only || true + - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR -v --dut_encoder_path ./IVAS_cod --dut_decoder_path ./IVAS_dec --dut_fr 5 --decoder_only --use_ltv || true + - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR -v --dut_encoder_path ./IVAS_cod --dut_decoder_path ./IVAS_dec --dut_fr 10 --decoder_only --use_ltv || true - python3 -m pytest -q -n auto tests/renderer/test_renderer.py --create_ref - python3 -m pytest -q -n auto tests/renderer/test_renderer.py --create_cut - lcov -c -d obj -o coverage_stv.info # extract coverage of short test vectors here -- GitLab From 6f45f869139cca238aee0b493090d77014197fab Mon Sep 17 00:00:00 2001 From: "Huo, Jiaquan" Date: Fri, 16 Aug 2024 10:38:07 +1000 Subject: [PATCH 5/5] resolve conflict previous merging from main --- tests/conftest.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 03af343dab..0e2fb9be87 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -134,12 +134,6 @@ def pytest_addoption(parser): help="If specified, use given param file in test_param_file.", ) - parser.addoption( - "--use_ltv", - action="store_true", - help="If specified, run relevant tests with ltv.", - ) - parser.addoption( "--keep_files", action="store_true", -- GitLab