Loading tests/codec_be_on_mr_selection/__init__.py +4 −8 Original line number Diff line number Diff line Loading @@ -34,7 +34,7 @@ import os import filecmp from pathlib import Path import subprocess from .constants import OUTPUT_MODES_AND_OPTIONS_FOR_EXPERIMENT from .constants import OUTPUT_MODES_AND_OPTIONS_FOR_EXPERIMENT, DTX_ON, FER_5PERC HERE = Path(__file__).parent # set environment variables in CI job Loading Loading @@ -70,17 +70,13 @@ def get_testvectors_for_exp_cat_and_testset( if experiment in MASA_TESTS: metadata.append(TESTV_PATH.joinpath(fname + ".met")) print(metadata) return signal, metadata def get_out_bitstream_and_synthesis_name(input_signal, bitrate, dtx, fer): dtx_str = "DTXon" if dtx else "DTXoff" fer_str = "FER_5perc" if fer else "FER_0perc" suffix = [".192", ".wav"] return [ DUT_PATH.joinpath(f"{input_signal.stem}-{bitrate}bps-{dtx_str}-{fer_str}{s}") DUT_PATH.joinpath(f"{input_signal.stem}-{bitrate}bps-{dtx}-{fer}{s}") for s in suffix ] Loading Loading @@ -126,7 +122,7 @@ def run_check( ) error_pattern = ( get_error_pattern_for_exp_cat_and_testset(experiment, category, testset) if fer if fer == FER_5PERC else None ) Loading @@ -147,7 +143,7 @@ def run_check( sampling_rate, testv, dut_bitstream, dtx_mode=dtx, dtx_mode=True if dtx == DTX_ON else False, add_option_list=options + [str(f) for f in metadata], ) Loading tests/codec_be_on_mr_selection/constants.py +23 −17 Original line number Diff line number Diff line Loading @@ -32,6 +32,12 @@ from itertools import product from typing import Union, List DTX_ON = "DTXon" DTX_OFF = "DTXoff" FER_5PERC = "FER_5perc" FER_0PERC = "FER_0perc" class ExperimentParams: """ Class to bundle the parameters for the experiments. Main purpose is to make things more readable over Loading @@ -44,11 +50,11 @@ class ExperimentParams: n_conditions: int, bitrates: List[int], testsets: List[str], dtx: Union[List[bool], bool] = False, fer: Union[List[bool], bool] = False, dtx: Union[List[str], str] = DTX_OFF, fer: Union[List[str], str] = FER_0PERC, ): dtx = n_conditions * [dtx] if isinstance(dtx, bool) else dtx fer = n_conditions * [fer] if isinstance(fer, bool) else fer dtx = n_conditions * [dtx] if isinstance(dtx, str) else dtx fer = n_conditions * [fer] if isinstance(fer, str) else fer assert ( len(bitrates) == n_conditions and len(testsets) == 2 Loading Loading @@ -94,8 +100,8 @@ P800_PARAMS = [ 24400, 13200, ], dtx=10 * [False] + 2 * [True], fer=5 * [False] + 5 * [True] + [False, True], dtx=10 * [DTX_OFF] + 2 * [DTX_ON], fer=5 * [FER_0PERC] + 5 * [FER_5PERC] + [FER_0PERC, FER_5PERC], testsets=["a", "d"], ), ExperimentParams( Loading @@ -114,7 +120,7 @@ P800_PARAMS = [ 32000, 48000, ], dtx=6 * [False] + 5 * [True], dtx=6 * [DTX_OFF] + 5 * [DTX_ON], testsets=["b", "d"], ), ExperimentParams( Loading @@ -135,8 +141,8 @@ P800_PARAMS = [ 24400, 13200, ], dtx=11 * [False] + 2 * [True], fer=6 * [False] + 5 * [True] + [False, True], dtx=11 * [DTX_OFF] + 2 * [DTX_ON], fer=6 * [FER_0PERC] + 5 * [FER_5PERC] + [FER_0PERC, FER_5PERC], testsets=["a", "d"], ), ExperimentParams( Loading @@ -157,7 +163,7 @@ P800_PARAMS = [ 80000, 96000, ], fer=7 * [False] + 6 * [True], fer=7 * [FER_0PERC] + 6 * [FER_5PERC], testsets=["a", "c"], ), ExperimentParams( Loading @@ -178,7 +184,7 @@ P800_PARAMS = [ 64000, 80000, ], dtx=7 * [False] + 6 * [True], dtx=7 * [DTX_OFF] + 6 * [DTX_ON], testsets=["a", "b"], ), ExperimentParams( Loading @@ -199,8 +205,8 @@ P800_PARAMS = [ 16400, 24400, ], dtx=10 * [False] + 3 * [True], fer=6 * [False] + 4 * [True] + 3 * [False], dtx=10 * [DTX_OFF] + 3 * [DTX_ON], fer=6 * [FER_0PERC] + 4 * [FER_5PERC] + 3 * [FER_0PERC], testsets=["a", "c"], ), ExperimentParams( Loading @@ -221,8 +227,8 @@ P800_PARAMS = [ 32000, 48000, ], dtx=9 * [False] + 4 * [True], fer=5 * [False] + 4 * [True] + 4 * [False], dtx=9 * [DTX_OFF] + 4 * [DTX_ON], fer=5 * [FER_0PERC] + 4 * [FER_5PERC] + 4 * [FER_0PERC], testsets=["a", "d"], ), ExperimentParams( Loading @@ -242,7 +248,7 @@ P800_PARAMS = [ 48000, 64000, ], fer=7 * [False] + 5 * [True], fer=7 * [FER_0PERC] + 5 * [FER_5PERC], testsets=["a", "b"], ), ExperimentParams( Loading @@ -263,7 +269,7 @@ P800_PARAMS = [ 48000, 64000, ], dtx=7 * [False] + 6 * [True], dtx=7 * [DTX_OFF] + 6 * [DTX_ON], testsets=["a", "d"], ), ] Loading Loading
tests/codec_be_on_mr_selection/__init__.py +4 −8 Original line number Diff line number Diff line Loading @@ -34,7 +34,7 @@ import os import filecmp from pathlib import Path import subprocess from .constants import OUTPUT_MODES_AND_OPTIONS_FOR_EXPERIMENT from .constants import OUTPUT_MODES_AND_OPTIONS_FOR_EXPERIMENT, DTX_ON, FER_5PERC HERE = Path(__file__).parent # set environment variables in CI job Loading Loading @@ -70,17 +70,13 @@ def get_testvectors_for_exp_cat_and_testset( if experiment in MASA_TESTS: metadata.append(TESTV_PATH.joinpath(fname + ".met")) print(metadata) return signal, metadata def get_out_bitstream_and_synthesis_name(input_signal, bitrate, dtx, fer): dtx_str = "DTXon" if dtx else "DTXoff" fer_str = "FER_5perc" if fer else "FER_0perc" suffix = [".192", ".wav"] return [ DUT_PATH.joinpath(f"{input_signal.stem}-{bitrate}bps-{dtx_str}-{fer_str}{s}") DUT_PATH.joinpath(f"{input_signal.stem}-{bitrate}bps-{dtx}-{fer}{s}") for s in suffix ] Loading Loading @@ -126,7 +122,7 @@ def run_check( ) error_pattern = ( get_error_pattern_for_exp_cat_and_testset(experiment, category, testset) if fer if fer == FER_5PERC else None ) Loading @@ -147,7 +143,7 @@ def run_check( sampling_rate, testv, dut_bitstream, dtx_mode=dtx, dtx_mode=True if dtx == DTX_ON else False, add_option_list=options + [str(f) for f in metadata], ) Loading
tests/codec_be_on_mr_selection/constants.py +23 −17 Original line number Diff line number Diff line Loading @@ -32,6 +32,12 @@ from itertools import product from typing import Union, List DTX_ON = "DTXon" DTX_OFF = "DTXoff" FER_5PERC = "FER_5perc" FER_0PERC = "FER_0perc" class ExperimentParams: """ Class to bundle the parameters for the experiments. Main purpose is to make things more readable over Loading @@ -44,11 +50,11 @@ class ExperimentParams: n_conditions: int, bitrates: List[int], testsets: List[str], dtx: Union[List[bool], bool] = False, fer: Union[List[bool], bool] = False, dtx: Union[List[str], str] = DTX_OFF, fer: Union[List[str], str] = FER_0PERC, ): dtx = n_conditions * [dtx] if isinstance(dtx, bool) else dtx fer = n_conditions * [fer] if isinstance(fer, bool) else fer dtx = n_conditions * [dtx] if isinstance(dtx, str) else dtx fer = n_conditions * [fer] if isinstance(fer, str) else fer assert ( len(bitrates) == n_conditions and len(testsets) == 2 Loading Loading @@ -94,8 +100,8 @@ P800_PARAMS = [ 24400, 13200, ], dtx=10 * [False] + 2 * [True], fer=5 * [False] + 5 * [True] + [False, True], dtx=10 * [DTX_OFF] + 2 * [DTX_ON], fer=5 * [FER_0PERC] + 5 * [FER_5PERC] + [FER_0PERC, FER_5PERC], testsets=["a", "d"], ), ExperimentParams( Loading @@ -114,7 +120,7 @@ P800_PARAMS = [ 32000, 48000, ], dtx=6 * [False] + 5 * [True], dtx=6 * [DTX_OFF] + 5 * [DTX_ON], testsets=["b", "d"], ), ExperimentParams( Loading @@ -135,8 +141,8 @@ P800_PARAMS = [ 24400, 13200, ], dtx=11 * [False] + 2 * [True], fer=6 * [False] + 5 * [True] + [False, True], dtx=11 * [DTX_OFF] + 2 * [DTX_ON], fer=6 * [FER_0PERC] + 5 * [FER_5PERC] + [FER_0PERC, FER_5PERC], testsets=["a", "d"], ), ExperimentParams( Loading @@ -157,7 +163,7 @@ P800_PARAMS = [ 80000, 96000, ], fer=7 * [False] + 6 * [True], fer=7 * [FER_0PERC] + 6 * [FER_5PERC], testsets=["a", "c"], ), ExperimentParams( Loading @@ -178,7 +184,7 @@ P800_PARAMS = [ 64000, 80000, ], dtx=7 * [False] + 6 * [True], dtx=7 * [DTX_OFF] + 6 * [DTX_ON], testsets=["a", "b"], ), ExperimentParams( Loading @@ -199,8 +205,8 @@ P800_PARAMS = [ 16400, 24400, ], dtx=10 * [False] + 3 * [True], fer=6 * [False] + 4 * [True] + 3 * [False], dtx=10 * [DTX_OFF] + 3 * [DTX_ON], fer=6 * [FER_0PERC] + 4 * [FER_5PERC] + 3 * [FER_0PERC], testsets=["a", "c"], ), ExperimentParams( Loading @@ -221,8 +227,8 @@ P800_PARAMS = [ 32000, 48000, ], dtx=9 * [False] + 4 * [True], fer=5 * [False] + 4 * [True] + 4 * [False], dtx=9 * [DTX_OFF] + 4 * [DTX_ON], fer=5 * [FER_0PERC] + 4 * [FER_5PERC] + 4 * [FER_0PERC], testsets=["a", "d"], ), ExperimentParams( Loading @@ -242,7 +248,7 @@ P800_PARAMS = [ 48000, 64000, ], fer=7 * [False] + 5 * [True], fer=7 * [FER_0PERC] + 5 * [FER_5PERC], testsets=["a", "b"], ), ExperimentParams( Loading @@ -263,7 +269,7 @@ P800_PARAMS = [ 48000, 64000, ], dtx=7 * [False] + 6 * [True], dtx=7 * [DTX_OFF] + 6 * [DTX_ON], testsets=["a", "d"], ), ] Loading