Loading tests/codec_be_to_accepted_release/encoder/test_encoder_constant_bitrate.py +21 −7 Original line number Diff line number Diff line Loading @@ -28,7 +28,8 @@ accordance with the laws of the Federal Republic of Germany excluding its confli the United Nations Convention on Contracts on the International Sales of Goods. """ import pytest import itertools import random from ..constants import ( ISM_MD_NULL, ISM_MD_EXTENDED, Loading @@ -45,7 +46,7 @@ from . import get_options, run_check from .. import get_testv_path, get_valid_fs_max_band_pairs TEST_PARAMS = { TEST_PARAMS_EXHAUSTIVE = { "test_encoder_const_br_channel_based_and_masa_modes": ( "input_format,bitrate,dtx", ENCODER_CHANNEL_BASED_AND_MASA_PARAMS, Loading @@ -62,14 +63,27 @@ TEST_PARAMS = { ), } N_PARAMS = {t: n for t, n in zip(TEST_PARAMS_EXHAUSTIVE.keys(), [40] * 5)} def pytest_generate_tests(metafunc): # NOTE: this excludes narrow-band modes for stereo_dmx_evs as those are not really IVAS but EVS and implementation is complicated... fs_mb_params = get_valid_fs_max_band_pairs() metafunc.parametrize("sampling_rate,max_band", fs_mb_params) func_name = metafunc.function.__name__ param_string, params = TEST_PARAMS[func_name] param_string_fs_mb = "sampling_rate,max_band" fs_mb_params = get_valid_fs_max_band_pairs() param_string, params = TEST_PARAMS_EXHAUSTIVE[func_name] if metafunc.config.getoption("reduced"): # randomly choose lower number of parameters random.seed("IVAAAAS") param_string = ",".join([param_string, param_string_fs_mb]) combined_params = [p[0] + p[1] for p in itertools.product(params, fs_mb_params)] metafunc.parametrize( param_string, random.sample(combined_params, N_PARAMS[func_name]) ) else: # NOTE: this excludes narrow-band modes for stereo_dmx_evs as those are not really IVAS but EVS and implementation is complicated... metafunc.parametrize(param_string_fs_mb, fs_mb_params) metafunc.parametrize(param_string, params) Loading tests/conftest.py +2 −0 Original line number Diff line number Diff line Loading @@ -147,6 +147,8 @@ def pytest_addoption(parser): help="Path to file with md5 sums for the reference signals of the selection-BE test" ) parser.addoption("--reduced", action="store_true", help="Flag for running the allpairs-reduced version of the long BE test") @pytest.fixture(scope="session", autouse=True) def update_ref(request): Loading Loading
tests/codec_be_to_accepted_release/encoder/test_encoder_constant_bitrate.py +21 −7 Original line number Diff line number Diff line Loading @@ -28,7 +28,8 @@ accordance with the laws of the Federal Republic of Germany excluding its confli the United Nations Convention on Contracts on the International Sales of Goods. """ import pytest import itertools import random from ..constants import ( ISM_MD_NULL, ISM_MD_EXTENDED, Loading @@ -45,7 +46,7 @@ from . import get_options, run_check from .. import get_testv_path, get_valid_fs_max_band_pairs TEST_PARAMS = { TEST_PARAMS_EXHAUSTIVE = { "test_encoder_const_br_channel_based_and_masa_modes": ( "input_format,bitrate,dtx", ENCODER_CHANNEL_BASED_AND_MASA_PARAMS, Loading @@ -62,14 +63,27 @@ TEST_PARAMS = { ), } N_PARAMS = {t: n for t, n in zip(TEST_PARAMS_EXHAUSTIVE.keys(), [40] * 5)} def pytest_generate_tests(metafunc): # NOTE: this excludes narrow-band modes for stereo_dmx_evs as those are not really IVAS but EVS and implementation is complicated... fs_mb_params = get_valid_fs_max_band_pairs() metafunc.parametrize("sampling_rate,max_band", fs_mb_params) func_name = metafunc.function.__name__ param_string, params = TEST_PARAMS[func_name] param_string_fs_mb = "sampling_rate,max_band" fs_mb_params = get_valid_fs_max_band_pairs() param_string, params = TEST_PARAMS_EXHAUSTIVE[func_name] if metafunc.config.getoption("reduced"): # randomly choose lower number of parameters random.seed("IVAAAAS") param_string = ",".join([param_string, param_string_fs_mb]) combined_params = [p[0] + p[1] for p in itertools.product(params, fs_mb_params)] metafunc.parametrize( param_string, random.sample(combined_params, N_PARAMS[func_name]) ) else: # NOTE: this excludes narrow-band modes for stereo_dmx_evs as those are not really IVAS but EVS and implementation is complicated... metafunc.parametrize(param_string_fs_mb, fs_mb_params) metafunc.parametrize(param_string, params) Loading
tests/conftest.py +2 −0 Original line number Diff line number Diff line Loading @@ -147,6 +147,8 @@ def pytest_addoption(parser): help="Path to file with md5 sums for the reference signals of the selection-BE test" ) parser.addoption("--reduced", action="store_true", help="Flag for running the allpairs-reduced version of the long BE test") @pytest.fixture(scope="session", autouse=True) def update_ref(request): Loading