Commit 1cad243d authored by Jan Kiene's avatar Jan Kiene
Browse files

add pytest_generate_tests hook to non diegetic testcase file

parent 81e1a015
Loading
Loading
Loading
Loading
+15 −3
Original line number Diff line number Diff line
@@ -30,7 +30,7 @@ the United Nations Convention on Contracts on the International Sales of Goods.

import pytest
from . import get_bitstream_and_options, run_check
from .. import get_testv_path
from .. import get_testv_path, get_valid_fs_max_band_pairs
from ..constants import (
    STEREO_DMX_EVS_PARAMS,
    ISM_MD_EXTENDED,
@@ -38,8 +38,16 @@ from ..constants import (
    DECODER_CONST_BR_NO_BINAURAL_OBJECTBASED,
    SAMPLING_RATES_ALL,
    BITSTREAM_PROCESSING,
    SAMPLING_RATES_ALL,
)


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("input_sampling_rate,max_band", fs_mb_params)


# NOTE: this way, all possible inputs for the non-diegetic panning value are used for all input/output configs
# less exhaustive testing is probably enough here, one can e.g. only test one panning value for each i/o config
NON_DIEGETIC_PAN_VALUES = ["c", "center", "middle", "left", "l", "right", "r"] + list(
@@ -54,13 +62,14 @@ ISM1_DECODER_PARAMS = [

@pytest.mark.parametrize("non_diegetic_panning_value", NON_DIEGETIC_PAN_VALUES)
@pytest.mark.parametrize(
    "input_format,bitrate,input_sampling_rate,dtx,md_type,output_format,output_sampling_rate,bitstream_processing",
    "input_format,bitrate,dtx,md_type,output_format,output_sampling_rate,bitstream_processing",
    ISM1_DECODER_PARAMS,
)
def test_decoder_non_diegetic_pan_ism(
    input_format,
    bitrate,
    input_sampling_rate,
    max_band,
    dtx,
    md_type,
    output_format,
@@ -84,6 +93,7 @@ def test_decoder_non_diegetic_pan_ism(
        dtx,
        bitstream_processing,
        suffix=suffix,
        max_band=max_band,
    ) as (ref_bitstream, options):
        suffix += f"-non_diegetic_pan_{non_diegetic_panning_value}"
        run_check(
@@ -100,12 +110,13 @@ def test_decoder_non_diegetic_pan_ism(

# for the mono input, we use the Stereo DMX EVS outputs from the decoder so no explicit mono encoder run is needed
@pytest.mark.parametrize("non_diegetic_panning_value", NON_DIEGETIC_PAN_VALUES)
@pytest.mark.parametrize("bitrate,input_sampling_rate,dtx", STEREO_DMX_EVS_PARAMS)
@pytest.mark.parametrize("bitrate,dtx", STEREO_DMX_EVS_PARAMS)
@pytest.mark.parametrize("output_sampling_rate", SAMPLING_RATES_ALL)
@pytest.mark.parametrize("bitstream_processing", BITSTREAM_PROCESSING)
def test_decoder_non_diegetic_pan_mono(
    bitrate,
    input_sampling_rate,
    max_band,
    dtx,
    output_sampling_rate,
    bitstream_processing,
@@ -122,6 +133,7 @@ def test_decoder_non_diegetic_pan_mono(
        dtx,
        bitstream_processing,
        non_diegetic_pan_value=non_diegetic_panning_value,
        max_band=max_band,
    ) as (ref_bitstream, options):
        suffix = f"-non_diegetic_pan_{non_diegetic_panning_value}"
        run_check(