Commit e0364dd9 authored by Jiaquan Huo's avatar Jiaquan Huo
Browse files

Merge branch 'add_ltv_to_sba_pytests' into 'main'

Resolve #1160 Add ltv to sba pytests

See merge request !1735
parents 8c474568 24cf64b9
Loading
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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
+55 −13
Original line number Diff line number Diff line
@@ -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"]
tag_list_HOA2 = ["stv2OA"]
tag_list_HOA3 = ["stv3OA"]
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"]
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"}
@@ -117,7 +118,6 @@ def test_pca_enc(
    get_odg,
):
    pca = True
    tag = tag + fs + "c"
    ivas_br = "256000"
    dtx = "0"
    max_bw = "FB"
@@ -125,6 +125,15 @@ def test_pca_enc(
    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 

    if not decoder_only:
        # enc
        sba_enc(
@@ -144,7 +153,7 @@ def test_pca_enc(
            update_ref,
            gain_flag,
            keep_files,
            cut_testv=True,
            cut_testv=cut_testv,
            pca=pca,
        )

@@ -227,7 +236,16 @@ def test_sba_enc_system(
        pytest.skip()
    if gain_flag == 1 and ivas_br not in ["13200", "16400", "24400", "32000"]:
        pytest.skip()

    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 

    max_bw = "FB"
    sba_order = "+1"
    output_config = "FOA"
@@ -259,7 +277,7 @@ def test_sba_enc_system(
            keep_files,
            cut_gain=cut_gain,
            create_dutenc=True,
            cut_testv=True,
            cut_testv=cut_testv,
        )

    # dec
@@ -317,7 +335,13 @@ def test_spar_hoa2_enc_system(
    dtx = "0"
    gain_flag = -1

    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 +422,13 @@ def test_spar_hoa3_enc_system(
    dtx = "0"
    gain_flag = -1

    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 +518,14 @@ def test_sba_enc_BWforce_system(
        pytest.skip()
    fs = sample_rate_bw_idx[0]
    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
    sba_order = "+1"
    output_config = "FOA"
@@ -512,7 +549,7 @@ def test_sba_enc_BWforce_system(
            update_ref,
            gain_flag,
            keep_files,
            cut_testv=True,
            cut_testv=cut_testv,
        )

    # dec
@@ -593,7 +630,12 @@ def test_sba_plc_system(
            pytest.skip()
    if gain_flag == 1 and ivas_br not in ["13200", "16400", "24400", "32000"]:
        pytest.skip()
    if "ltv" in tag:
        tag = f"ltv{fs}_FOA"
    elif "stv" in tag:
        tag = tag + fs + "c"
    else:
        assert 0 

    # dec
    sba_dec(
+2 −0
Original line number Diff line number Diff line
@@ -833,6 +833,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":
+2 −0
Original line number Diff line number Diff line
@@ -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