Commit 89c65f71 authored by Jan Kiene's avatar Jan Kiene
Browse files

record category as property

parent 8f4f93c0
Loading
Loading
Loading
Loading
+12 −2
Original line number Diff line number Diff line
@@ -62,6 +62,11 @@ from tests.constants import (
    MAX_ENC_STATS_DIFF,
    SCRIPTS_DIR,
    MAX_ENC_DIFF,
    CAT_NORMAL,
    CAT_DTX,
    CAT_BITRATE_SWITCHING,
    CAT_JBM,
    CAT_PLC,
)
from tests.renderer.utils import check_and_makedir, binauralize_input_and_output

@@ -299,9 +304,9 @@ def run_test(
                "All non-passthrough modes are skipped when --compare-to-input is set"
            )

    pytest.set_trace()
    testcase_props = {}
    testcase_props["format"] = get_format_from_enc_opts(enc_opts)
    testcase_props["category"] = CAT_NORMAL

    tag_str = convert_test_string_to_tag(test_tag)

@@ -322,6 +327,9 @@ def run_test(
    bitrate = enc_split.pop()
    in_sr = sampling_rate

    if "-dtx" in enc_opts:
        testcase_props["category"] = CAT_DTX

    # bitrate can be a filename: change it to an absolute path
    if not bitrate.isdigit():
        if compare_enc_dmx:
@@ -329,6 +337,7 @@ def run_test(
                "Rate switching + --compare_enc_dmx currently skipped due to DEBUGGING code limitations with varying number of transport channels"
            )
        bitrate = Path(bitrate[3:]).absolute()
        testcase_props["category"] = CAT_BITRATE_SWITCHING

    testv_base = testv_file.split("/")[-1]
    if testv_base.endswith(".pcm"):
@@ -421,9 +430,9 @@ def run_test(
            rootdir,
            decoder_only,
        )
        testcase_props["category"] = CAT_JBM

    # check for eid-xor command line

    if eid_opts != "":
        eid_split = eid_opts.split()
        assert len(eid_split) >= 3, "eid-xor expects at least 3 parameters"
@@ -449,6 +458,7 @@ def run_test(
            rootdir,
            decoder_only,
        )
        testcase_props["category"] = CAT_PLC

    # evaluate decoder options
    dec_split = dec_opts.split()
+32 −5
Original line number Diff line number Diff line
@@ -48,7 +48,7 @@ from tests.conftest import (
    get_split_idx,
)
from ..cmp_stats_files import cmp_stats_files
from ..constants import TESTV_DIR, MAX_ENC_FILE_LENGTH_DIFF, MAX_ENC_STATS_DIFF
from ..constants import CAT_BITRATE_SWITCHING, CAT_DTX, CAT_NORMAL, CAT_PLC, TESTV_DIR, MAX_ENC_FILE_LENGTH_DIFF, MAX_ENC_STATS_DIFF
from tests.testconfig import use_ltv

from tests.renderer.utils import check_and_makedir, binauralize_input_and_output
@@ -190,6 +190,7 @@ def test_pca_enc(
            gain_flag,
            keep_files,
            decoder_only,
            testcase_props,
            cut_gain=cut_gain,
            cut_testv=cut_testv,
            plc_pattern=plc_pattern,
@@ -251,7 +252,7 @@ def test_sba_enc_system(
    cut_gain = "1.0"
    plc_pattern = None
    cut_testv = True
    testcase_props = {"format": "SBA"}
    testcase_props = {"format": "SBA", "category": CAT_NORMAL}

    if dtx == "1" and bitrate not in ["13200", "16400", "24400", "32000", "64000"]:
        # skip high bitrates for DTX until DTX issue is resolved
@@ -289,6 +290,12 @@ def test_sba_enc_system(
        cut_gain = "1.0"

    input_config = SBA_FORMAT[abs(int(sba_order))]
    if dtx:
        testcase_props["category"] = CAT_DTX
    try:
        int(bitrate)
    except ValueError:
        testcase_props["category"] = CAT_BITRATE_SWITCHING

    if not decoder_only:
        ref_stats_file, dut_stats_file = sba_enc(
@@ -373,6 +380,7 @@ def test_sba_enc_system(
            gain_flag,
            keep_files,
            decoder_only,
            testcase_props,
            cut_gain=cut_gain,
            cut_testv=cut_testv,
            plc_pattern=plc_pattern,
@@ -429,7 +437,7 @@ def test_spar_hoa2_enc_system(
    cut_gain = "1.0"
    plc_pattern = None
    cut_testv = False
    testcase_props = {"format": "SBA"}
    testcase_props = {"format": "SBA", "category": CAT_NORMAL}

    if "ltv" in tag:
        tag = f"ltv{sampling_rate}_HOA2"
@@ -523,6 +531,7 @@ def test_spar_hoa2_enc_system(
            gain_flag,
            keep_files,
            decoder_only,
            testcase_props,
            cut_gain=cut_gain,
            cut_testv=cut_testv,
            plc_pattern=plc_pattern,
@@ -579,7 +588,7 @@ def test_spar_hoa3_enc_system(
    cut_gain = "1.0"
    plc_pattern = None
    cut_testv = False
    testcase_props = {"format": "SBA"}
    testcase_props = {"format": "SBA", "category": CAT_NORMAL}

    if "ltv" in tag:
        tag = f"ltv{sampling_rate}_HOA3"
@@ -667,6 +676,7 @@ def test_spar_hoa3_enc_system(
            gain_flag,
            keep_files,
            decoder_only,
            testcase_props,
            cut_gain=cut_gain,
            cut_testv=cut_testv,
            plc_pattern=plc_pattern,
@@ -726,6 +736,7 @@ def test_sba_enc_BWforce_system(
    cut_testv = False
    sampling_rate = sample_rate_bw_idx[0]
    max_bw = sample_rate_bw_idx[1]
    testcase_props = {"format": "SBA", "category": CAT_NORMAL}

    if dtx == "1" and bitrate not in ["32000", "64000"]:
        # skip high bitrates for DTX until DTX issue is resolved
@@ -746,6 +757,12 @@ def test_sba_enc_BWforce_system(
        assert 0

    input_config = SBA_FORMAT[abs(int(sba_order))]
    if dtx:
        testcase_props["category"] = CAT_DTX
    try:
        int(bitrate)
    except ValueError:
        testcase_props["category"] = CAT_BITRATE_SWITCHING

    if not decoder_only:
        ref_stats_file, dut_stats_file = sba_enc(
@@ -830,6 +847,7 @@ def test_sba_enc_BWforce_system(
            gain_flag,
            keep_files,
            decoder_only,
            testcase_props,
            cut_gain=cut_gain,
            cut_testv=cut_testv,
            plc_pattern=plc_pattern,
@@ -889,6 +907,7 @@ def test_sba_plc_system(
    sba_order = "+1"
    cut_testv = True
    output_config = "FOA"
    testcase_props = {"format": "SBA", "category": CAT_NORMAL}

    if dtx == "1" and bitrate not in ["13200", "16400", "24400", "32000", "64000"]:
        # skip high bitrates for DTX until DTX issue is resolved
@@ -925,6 +944,12 @@ def test_sba_plc_system(
        cut_gain = "1.0"

    input_config = SBA_FORMAT[abs(int(sba_order))]
    if dtx:
        testcase_props["category"] = CAT_DTX
    try:
        int(bitrate)
    except ValueError:
        testcase_props["category"] = CAT_BITRATE_SWITCHING

    if not decoder_only:
        sba_enc(
@@ -973,6 +998,7 @@ def test_sba_plc_system(
            gain_flag,
            keep_files,
            decoder_only,
            testcase_props,
            cut_gain=cut_gain,
            cut_testv=cut_testv,
            plc_pattern=plc_pattern,
@@ -1150,6 +1176,7 @@ def sba_dec(
    gain_flag,
    keep_files,
    decoder_only,
    testcase_props
    cut_gain="1.0",
    cut_testv=False,
    plc_pattern=None,
@@ -1167,7 +1194,6 @@ def sba_dec(
    ref_pkt_dir = f"{reference_path}/sba_bs/pkt"
    dut_out_dir = f"{dut_base_path}/sba_bs/raw"
    ref_out_dir = f"{reference_path}/sba_bs/raw"
    testcase_props = {"format": "SBA"}

    check_and_makedir(dut_out_dir)
    check_and_makedir(ref_out_dir)
@@ -1194,6 +1220,7 @@ def sba_dec(

    plc_file = None
    if plc_pattern is not None:
        testcase_props["category"] = CAT_PLC
        plc_file = f"{TESTV_DIR}/{plc_pattern}.g192"

    if sid == 1:
+6 −0
Original line number Diff line number Diff line
@@ -66,6 +66,12 @@ ENC_AUX_FILES = [
    ["vad_flag", np.int16, "fs/50"],
]

CAT_NORMAL = "normal operation"
CAT_DTX = "DTX"
CAT_PLC = "PLC"
CAT_BITRATE_SWITCHING = "bitrate switching"
CAT_JBM = "JBM"

# lists of indices for splitting of output files
# values are in SAMPLES for 16kHz (!). For higher rates, need to multiply
SPLIT_IDX_LTV_STEREO_16KHZ = np.asarray(
+2 −0
Original line number Diff line number Diff line
@@ -57,6 +57,7 @@ from .constants import (
    BIN_SUFFIX_MERGETARGET,
    PEAQ_SUPPORTED_FMT,
)
from ..constants import CAT_NORMAL

sys.path.append(SCRIPTS_DIR)
from pyaudio3dtools.audiofile import readfile
@@ -394,6 +395,7 @@ def run_renderer(

        props = parse_properties(reason, output_differs, props_to_record)
        props["format"] = "renderer"
        props["category"] = CAT_NORMAL
        for k, v in props.items():
            record_property(k, v)