Commit bb0d68a0 authored by Jan Kiene's avatar Jan Kiene
Browse files

split between P800 and BS1534 tests

parent c6586b1a
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@ MASA_TESTS = ("P800-8", "P800-9", "BS1534-7a", "BS1534-7a")


def get_testvectors_for_exp_cat_and_testset(experiment, category, testset):
    fname = f"{experiment}-cat{category}-{testset}-input.wav"
    fname = f"{experiment}-{category}-{testset}-input.wav"
    signal = TESTV_PATH.joinpath(fname).absolute()

    # will be an empty list if not ISM experiment
@@ -47,7 +47,7 @@ def get_out_bitstream_and_synthesis_name(input_signal, bitrate, dtx, fer):


def get_error_pattern_for_exp_cat_and_testset(experiment, category, testset):
    ep_file = TESTV_PATH.joinpath(f"{experiment}-cat{category}-{testset}-ep.192")
    ep_file = TESTV_PATH.joinpath(f"{experiment}-{category}-{testset}-ep.192")
    return ep_file


+10 −2
Original line number Diff line number Diff line
@@ -32,9 +32,11 @@ class ExperimentParams:
        return [(self.name, *p, t) for p, t in product(params, self.testsets)]


P800_CATEGORIES = range(1, 7)
P800_CATEGORIES = [f"cat{i}" for i in range(1, 7)]
BS1534_CATEGORIES = [""]
BS1534_MASA_CATEGORIES = ["FOA", "HOA2"]

EXPERIMENT_PARAMS = [
P800_PARAMS = [
    ExperimentParams(
        name="P800-1",
        n_conditions=12,
@@ -224,6 +226,9 @@ EXPERIMENT_PARAMS = [
        dtx=7 * [False] + 6 * [True],
        testsets=["a", "d"],
    ),
]

BS1534_PARAMS = [
    ExperimentParams(
        name="BS1534-1a", n_conditions=2, bitrates=[48000, 64000], testsets=["a", "d"]
    ),
@@ -269,6 +274,9 @@ EXPERIMENT_PARAMS = [
        bitrates=[96000, 128000, 256000],
        testsets=["b", "d"],
    ),
]

BS1534_PARAMS_MASA = [
    ExperimentParams(
        name="BS1534-7a", n_conditions=2, bitrates=[96000, 128000], testsets=["b", "d"]
    ),
+66 −5
Original line number Diff line number Diff line
import pytest
from . import run_check
from .constants import EXPERIMENT_PARAMS, P800_CATEGORIES
from .constants import P800_CATEGORIES, BS1534_CATEGORIES, BS1534_MASA_CATEGORIES, P800_PARAMS, BS1534_PARAMS, BS1534_PARAMS_MASA


TEST_PARAMS = [
    i for sl in [p.assemble_unified_params() for p in EXPERIMENT_PARAMS] for i in sl
P800_PARAMS_UNIFIED = [
    i for sl in [p.assemble_unified_params() for p in P800_PARAMS] for i in sl
]
BS1534_PARAMS_UNIFIED = [
    i for sl in [p.assemble_unified_params() for p in BS1534_PARAMS] for i in sl
]
BS1534_MASA_PARAMS_UNIFIED = [
    i for sl in [p.assemble_unified_params() for p in BS1534_PARAMS_MASA] for i in sl
]


@pytest.mark.create_ref
@pytest.mark.parametrize("experiment,bitrate,dtx,fer,testset", TEST_PARAMS)
@pytest.mark.parametrize("experiment,bitrate,dtx,fer,testset", P800_PARAMS_UNIFIED)
@pytest.mark.parametrize("category", P800_CATEGORIES)
def test_experiment(
def test_p800(
    experiment,
    bitrate,
    dtx,
    fer,
    testset,
    category,
    dut_encoder_frontend,
    dut_decoder_frontend,
    update_ref,
):
    run_check(
        experiment,
        category,
        testset,
        bitrate,
        dtx,
        fer,
        dut_encoder_frontend,
        dut_decoder_frontend,
        update_ref == 1,
    )

# need to split BS1534 tests as MASA tests have categories (FOA, HOA2)
# otherwise, it is the exact same test

@pytest.mark.create_ref
@pytest.mark.parametrize("experiment,bitrate,dtx,fer,testset", BS1534_PARAMS_UNIFIED)
@pytest.mark.parametrize("category", BS1534_CATEGORIES)
def test_bs1534_no_masa(
    experiment,
    bitrate,
    dtx,
    fer,
    testset,
    category,
    dut_encoder_frontend,
    dut_decoder_frontend,
    update_ref,
):
    run_check(
        experiment,
        category,
        testset,
        bitrate,
        dtx,
        fer,
        dut_encoder_frontend,
        dut_decoder_frontend,
        update_ref == 1,
    )

@pytest.mark.create_ref
@pytest.mark.parametrize("experiment,bitrate,dtx,fer,testset", BS1534_MASA_PARAMS_UNIFIED)
@pytest.mark.parametrize("category", BS1534_MASA_CATEGORIES)
def test_bs1534_masa(
    experiment,
    bitrate,
    dtx,