Commit 0f3a7e91 authored by Tapani Pihlajakuja's avatar Tapani Pihlajakuja
Browse files

Move new renderer test set into renderer_short folder

parent 59ee52dc
Loading
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -139,6 +139,7 @@ FORMAT_TO_FILE_SMOKETEST = {
    "ISM4SBA3": NCHAN_TO_FILE[20],
    "META": TEST_VECTOR_DIR.joinpath("mixed_scene_48.txt"),
    "16ch_8+4+4": NCHAN_TO_FILE[16],
    "4d4": NCHAN_TO_FILE[8],
    "t_design_4": NCHAN_TO_FILE[12],
}

@@ -181,6 +182,7 @@ FORMAT_TO_FILE_COMPARETEST = {
    "ISM4SBA3": TESTV_DIR.joinpath("stvOSBA_4ISM_3OA48c.wav"),
    "META": TEST_VECTOR_DIR.joinpath("mixed_scene_48.txt"),
    "16ch_8+4+4": TESTV_DIR.joinpath("stv3OA48c.wav"),
    "4d4": TESTV_DIR.joinpath("stv71MC48c.wav"),
    "t_design_4": TESTV_DIR.joinpath("stv714MC48c.wav"),
}

@@ -223,6 +225,7 @@ FORMAT_TO_FILE_LTV = {
    "ISM4SBA3": LTV_DIR.joinpath("ltv48_OSBA_4ISM_HOA3.wav"),
    "META": TEST_VECTOR_DIR.joinpath("mixed_scene_48.txt"),
    "16ch_8+4+4": LTV_DIR.joinpath("ltv48_HOA3.wav"),
    "4d4": LTV_DIR.joinpath("ltv48_MC71.wav"),
    "t_design_4": LTV_DIR.joinpath("ltv48_MC714.wav"),
}

@@ -416,6 +419,7 @@ OUTPUT_FORMATS = [
""" Custom loudspeaker input/output """
CUSTOM_LS_TO_TEST = [
    "t_design_4",
    "4d4",
    "16ch_8+4+4",
]

+0 −288
Original line number Diff line number Diff line
@@ -82,26 +82,6 @@ def test_ambisonics(
    get_odg_bin,
    split_comparison,
):
    if in_fmt == "HOA2":
        if out_fmt != "5_1":
            pytest.skip()
        if frame_size != "20ms":
            pytest.skip()
        if fs != "48kHz":
            pytest.skip()

    if in_fmt == "FOA":
        if frame_size != "5ms":
            pytest.skip()
        if fs != "32kHz":
            pytest.skip()

    if in_fmt == "HOA3":
        if frame_size != "20ms":
            pytest.skip()
        if fs == "32kHz":
            pytest.skip()

    run_renderer(
        record_property,
        props_to_record,
@@ -139,15 +119,6 @@ def test_ambisonics_binaural_static(
    get_odg_bin,
    split_comparison,
):
    if in_fmt != "HOA2":
        pytest.skip()

    if frame_size != "20ms":
        pytest.skip()

    if fs != "48kHz":
        pytest.skip()

    run_renderer(
        record_property,
        props_to_record,
@@ -187,14 +158,6 @@ def test_ambisonics_binaural_headrotation(
    get_odg_bin,
    split_comparison,
):
    if in_fmt == "HOA2":
        pytest.skip()

    if in_fmt == "FOA" and frame_size != "20ms" and fs != "48kHz":
        pytest.skip()

    # Run everything for HOA3 input

    run_renderer(
        record_property,
        props_to_record,
@@ -326,18 +289,6 @@ def test_multichannel(
    get_odg_bin,
    split_comparison,
):
    if in_fmt not in ["STEREO", "7_1_4"]:
        if frame_size != "20ms":
            pytest.skip()
        if fs != "48kHz":
            pytest.skip()
        if out_fmt not in ["MONO", "STEREO", "FOA", "7_1_4"]:
            pytest.skip()
        if frame_size != "5ms":
            pytest.skip()

    # Run everything for 7_1_4 input

    run_renderer(
        record_property,
        props_to_record,
@@ -378,15 +329,6 @@ def test_multichannel_binaural_static(
    if in_fmt in ["MONO", "STEREO"]:
        pytest.skip("MONO or STEREO to Binaural rendering unsupported")

    if fs != "48kHz":
        pytest.skip()

    if frame_size != "20ms":
        pytest.skip()

    if in_fmt not in ["5_1", "7_1_4"]:
        pytest.skip()

    run_renderer(
        record_property,
        props_to_record,
@@ -429,16 +371,6 @@ def test_multichannel_binaural_headrotation(
    if in_fmt in ["MONO", "STEREO"]:
        pytest.skip("MONO or STEREO to Binaural rendering unsupported")

    if in_fmt != "5_1_4":
        if fs != "48kHz":
            pytest.skip()
        if in_fmt in ["MONO, 5_1, 7_1_4"] and frame_size != "20ms":
            pytest.skip()
        if in_fmt not in ["MONO, 5_1, 7_1_4"] and frame_size == "20ms":
            pytest.skip()

    # Run everything for 5_1_4

    run_renderer(
        record_property,
        props_to_record,
@@ -480,22 +412,6 @@ def test_ism(
    get_odg_bin,
    split_comparison,
):
    if in_fmt != "ISM4":
        if frame_size != "20ms":
            pytest.skip()
        if fs != "48kHz":
            pytest.skip()
        if out_fmt not in ["STEREO", "5_1"]:
            pytest.skip()

    if out_fmt not in ["HOA3", "5_1_2"]:
        if frame_size != "5ms":
            pytest.skip()
        if fs != "32kHz":
            pytest.skip()

    # Run almost everything for ISM4

    run_renderer(
        record_property,
        props_to_record,
@@ -533,20 +449,6 @@ def test_ism_binaural_static(
    get_odg_bin,
    split_comparison,
):
    if in_fmt != "ISM4":
        if frame_size != "20ms":
            pytest.skip()
        if fs != "48kHz":
            pytest.skip()

    if fs == "32kHz" and frame_size == "5ms":
        pytest.skip()

    if fs == "16kHz" and frame_size == "20ms":
        pytest.skip()

    # Run everything for ISM4

    run_renderer(
        record_property,
        props_to_record,
@@ -586,14 +488,6 @@ def test_ism_binaural_headrotation(
    get_odg_bin,
    split_comparison,
):
    if in_fmt != "ISM4":
        if frame_size != "5ms":
            pytest.skip()
        if fs != "32kHz":
            pytest.skip()

    # Run everything for ISM4

    run_renderer(
        record_property,
        props_to_record,
@@ -635,46 +529,6 @@ def test_masa(
    get_odg_bin,
    split_comparison,
):
    if fs == "32kHz" and out_fmt in [
        "STEREO",
        "5_1",
        "5_1_2",
        "5_1_4",
        "7_1",
        "7_1_4",
        "FOA",
        "HOA2",
    ]:
        pytest.skip()

    if fs == "16kHz" and out_fmt in [
        "5_1_2",
        "5_1_4",
        "7_1",
        "7_1_4",
        "FOA",
        "HOA2",
        "HOA3",
    ]:
        pytest.skip()

    if fs in ["16kHz", "32kHz"] and frame_size == "5ms":
        pytest.skip()

    if (
        out_fmt in ["5_1_2", "5_1_4", "7_1", "HOA2", "HOA3"]
        and frame_size != "20ms"
        and in_fmt == "MASA1"
    ):
        pytest.skip()

    if (
        out_fmt in ["5_1_2", "7_1_4", "5_1", "FOA"]
        and frame_size != "20ms"
        and in_fmt == "MASA2"
    ):
        pytest.skip()

    run_renderer(
        record_property,
        props_to_record,
@@ -712,11 +566,6 @@ def test_masa_binaural_static(
    get_odg_bin,
    split_comparison,
):
    if fs in ["16kHz", "32kHz"] and frame_size == "5ms":
        pytest.skip()

    # fs == 48 tests everything

    run_renderer(
        record_property,
        props_to_record,
@@ -756,14 +605,6 @@ def test_masa_binaural_headrotation(
    get_odg_bin,
    split_comparison,
):
    if fs == 32 and frame_size == "20ms":
        pytest.skip()

    if fs == 16 and frame_size == "5ms":
        pytest.skip()

    # fs == 48 tests everything

    run_renderer(
        record_property,
        props_to_record,
@@ -800,9 +641,6 @@ def test_masa_prerend(
    get_odg_bin,
    split_comparison,
):
    if in_fmt not in ["ISM4MASA2", "ISM1MASA1"] and fs != "48kHz":
        pytest.skip()

    run_renderer(
        record_property,
        props_to_record,
@@ -837,8 +675,6 @@ def test_masa_prerend_scenes(
    get_odg_bin,
    split_comparison,
):
    # Test all scenes

    run_renderer(
        record_property,
        props_to_record,
@@ -879,25 +715,6 @@ def test_omasa(
    get_odg_bin,
    split_comparison,
):
    if in_fmt != "ISM4MASA2":
        if fs != "48kHz":
            pytest.skip()
        if frame_size != "20ms":
            pytest.skip()
        if out_fmt not in ["STEREO", "5_1"]:
            pytest.skip()

    if in_fmt in ["ISM3MASA1", "ISM2MASA2", "ISM1MASA1"]:
        pytest.skip()

    if out_fmt in ["5_1", "5_1_4", "7_1_4", "FOA", "HOA2"]:
        if frame_size != "20ms":
            pytest.skip()
        if fs != "16kHz":
            pytest.skip()

    # Test all for ISM4MASA2

    run_renderer(
        record_property,
        props_to_record,
@@ -935,17 +752,6 @@ def test_omasa_binaural_static(
    get_odg_bin,
    split_comparison,
):
    if in_fmt != "ISM4MASA2":
        if fs != "48kHz":
            pytest.skip()
        if frame_size != "20ms":
            pytest.skip()

    if in_fmt in ["ISM3MASA2", "ISM2MASA1", "ISM1MASA2", "ISM4MASA1"]:
        pytest.skip()

    # Test all for ISM4MASA2

    run_renderer(
        record_property,
        props_to_record,
@@ -985,14 +791,6 @@ def test_omasa_binaural_headrotation(
    get_odg_bin,
    split_comparison,
):
    if in_fmt not in ["ISM1MASA1", "ISM2MASA2", "ISM4MASA2"]:
        if fs != "48kHz":
            pytest.skip()
        if frame_size != "20ms":
            pytest.skip()

    # Test all for ["ISM1MASA1", "ISM2MASA2", "ISM4MASA2"]

    run_renderer(
        record_property,
        props_to_record,
@@ -1034,18 +832,6 @@ def test_osba(
    get_odg_bin,
    split_comparison,
):
    if in_fmt != "ISM4SBA3":
        if fs != "48kHz":
            pytest.skip()
        if frame_size != "20ms":
            pytest.skip()
        if out_fmt not in ["HOA3", "5_1"]:
            pytest.skip()

    if out_fmt in ["HOA3", "5_1"]:
        pytest.skip()
    # Test all for ISM4SBA3

    run_renderer(
        record_property,
        props_to_record,
@@ -1083,17 +869,6 @@ def test_osba_binaural_static(
    get_odg_bin,
    split_comparison,
):
    if in_fmt != "ISM4SBA3":
        pytest.skip()

    if fs != "48kHz":
        pytest.skip()

    if frame_size != "20ms":
        pytest.skip()

    # Test all for ISM4SBA3

    run_renderer(
        record_property,
        props_to_record,
@@ -1133,14 +908,6 @@ def test_osba_binaural_headrotation(
    get_odg_bin,
    split_comparison,
):
    if in_fmt not in ["ISM1SBA1", "ISM2SBA2", "ISM4SBA3"]:
        if fs != "48kHz":
            pytest.skip()
        if frame_size != "20ms":
            pytest.skip()

    # Test all for ["ISM1SBA1", "ISM2SBA2", "ISM4SBA3"]

    run_renderer(
        record_property,
        props_to_record,
@@ -1182,14 +949,6 @@ def test_custom_ls_input(
    get_odg_bin,
    split_comparison,
):
    if out_fmt not in ["7_1, FOA, STEREO"]:
        if fs != "48kHz":
            pytest.skip()
        if frame_size != "20ms":
            pytest.skip()

    # Test rest

    run_renderer(
        record_property,
        props_to_record,
@@ -1235,23 +994,6 @@ def test_custom_ls_output(
    get_odg_bin,
    split_comparison,
):
    if in_fmt not in [
        "HOA3",
        "MONO",
        "STEREO",
        "5_1",
        "7_1_4",
        "MASA1",
        "MASA2",
        "ISM4",
        "ISM4MASA2",
        "ISM4SBA3",
    ]:
        pytest.skip()

    if out_fmt == "t_design_4" and fs != "48kHz":
        pytest.skip()

    run_renderer(
        record_property,
        props_to_record,
@@ -1322,9 +1064,6 @@ def test_custom_ls_input_binaural(
    get_odg_bin,
    split_comparison,
):
    if fs != "48kHz" or frame_size != "20ms":
        pytest.skip()

    run_renderer(
        record_property,
        props_to_record,
@@ -1364,12 +1103,6 @@ def test_custom_ls_input_binaural_headrotation(
    get_odg_bin,
    split_comparison,
):
    if fs == "32kHz" and frame_size == "5ms":
        pytest.skip()

    if fs == "16kHz" and frame_size == "20ms":
        pytest.skip()

    run_renderer(
        record_property,
        props_to_record,
@@ -1411,15 +1144,6 @@ def test_metadata(
    get_odg_bin,
    split_comparison,
):
    if fs == "32kHz" and frame_size == "5ms":
        pytest.skip()

    if fs == "16kHz" and frame_size == "20ms":
        pytest.skip()

    if out_fmt not in ["5_1_2", "HOA3", "STEREO"] and fs != "48kHz":
        pytest.skip()

    run_renderer(
        record_property,
        props_to_record,
@@ -1461,12 +1185,6 @@ def test_non_diegetic_pan_static(
    get_odg_bin,
    split_comparison,
):
    if non_diegetic_pan in ["0", "45", "-90"] and fs == "32kHz":
        pytest.skip()

    if non_diegetic_pan not in ["0", "45", "-90"] and fs == "16kHz":
        pytest.skip()

    run_renderer(
        record_property,
        props_to_record,
@@ -1504,12 +1222,6 @@ def test_non_diegetic_pan_ism_static(
    get_odg_bin,
    split_comparison,
):
    if non_diegetic_pan in ["0", "45", "-90"] and fs == "16kHz":
        pytest.skip()

    if non_diegetic_pan not in ["0", "45", "-90"] and fs == "32kHz":
        pytest.skip()

    run_renderer(
        record_property,
        props_to_record,
+108 −86
Original line number Diff line number Diff line
@@ -30,8 +30,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.
"""

from pathlib import Path
import platform
from pathlib import Path

""" Set up paths """
TESTS_DIR = Path(__file__).parent
@@ -55,6 +55,8 @@ elif platform.system() in ["Linux", "Darwin"]:
else:
    assert False, f"Unsupported platform {platform.system()}"

SAMPLING_RATES = ["48kHz", "32kHz", "16kHz"]

""" Renderer commandline template """
RENDERER_CMD = [
    str(TESTS_DIR.parent.parent.joinpath("IVAS_rend")),
@@ -115,29 +117,28 @@ FORMAT_TO_FILE_SMOKETEST = {
    "NDP_ISM4": NCHAN_TO_FILE[4],
    "MASA1": NCHAN_TO_FILE[1],
    "MASA2": NCHAN_TO_FILE[2],
    "OMASA_1_1": NCHAN_TO_FILE[2],
    "OMASA_1_2": NCHAN_TO_FILE[3],
    "OMASA_1_3": NCHAN_TO_FILE[4],
    "OMASA_1_4": NCHAN_TO_FILE[5],
    "OMASA_2_1": NCHAN_TO_FILE[3],
    "OMASA_2_2": NCHAN_TO_FILE[4],
    "OMASA_2_3": NCHAN_TO_FILE[5],
    "OMASA_2_4": NCHAN_TO_FILE[6],
    "OSBA_1_1": NCHAN_TO_FILE[5],
    "OSBA_2_1": NCHAN_TO_FILE[6],
    "OSBA_3_1": NCHAN_TO_FILE[7],
    "OSBA_4_1": NCHAN_TO_FILE[8],
    "OSBA_1_2": NCHAN_TO_FILE[10],
    "OSBA_2_2": NCHAN_TO_FILE[11],
    "OSBA_3_2": NCHAN_TO_FILE[12],
    "OSBA_4_2": NCHAN_TO_FILE[13],
    "OSBA_1_3": NCHAN_TO_FILE[17],
    "OSBA_2_3": NCHAN_TO_FILE[18],
    "OSBA_3_3": NCHAN_TO_FILE[19],
    "OSBA_4_3": NCHAN_TO_FILE[20],
    "META": TEST_VECTOR_DIR.joinpath("mixed_scene.txt"),
    "ISM1MASA1": NCHAN_TO_FILE[2],
    "ISM2MASA1": NCHAN_TO_FILE[3],
    "ISM3MASA1": NCHAN_TO_FILE[4],
    "ISM4MASA1": NCHAN_TO_FILE[5],
    "ISM1MASA2": NCHAN_TO_FILE[3],
    "ISM2MASA2": NCHAN_TO_FILE[4],
    "ISM3MASA2": NCHAN_TO_FILE[5],
    "ISM4MASA2": NCHAN_TO_FILE[6],
    "ISM1SBA1": NCHAN_TO_FILE[5],
    "ISM2SBA1": NCHAN_TO_FILE[6],
    "ISM3SBA1": NCHAN_TO_FILE[7],
    "ISM4SBA1": NCHAN_TO_FILE[8],
    "ISM1SBA2": NCHAN_TO_FILE[10],
    "ISM2SBA2": NCHAN_TO_FILE[11],
    "ISM3SBA2": NCHAN_TO_FILE[12],
    "ISM4SBA2": NCHAN_TO_FILE[13],
    "ISM1SBA3": NCHAN_TO_FILE[17],
    "ISM2SBA3": NCHAN_TO_FILE[18],
    "ISM3SBA3": NCHAN_TO_FILE[19],
    "ISM4SBA3": NCHAN_TO_FILE[20],
    "META": TEST_VECTOR_DIR.joinpath("mixed_scene_48.txt"),
    "16ch_8+4+4": NCHAN_TO_FILE[16],
    "4d4": NCHAN_TO_FILE[8],
    "t_design_4": NCHAN_TO_FILE[12],
}

@@ -158,29 +159,28 @@ FORMAT_TO_FILE_COMPARETEST = {
    "ISM4": TESTV_DIR.joinpath("stv4ISM48s.wav"),
    "MASA1": TESTV_DIR.joinpath("stv1MASA1TC48c.wav"),
    "MASA2": TESTV_DIR.joinpath("stv2MASA2TC48c.wav"),
    "OMASA_1_1": TESTV_DIR.joinpath("stvOMASA_1ISM_1MASA1TC48c.wav"),
    "OMASA_1_2": TESTV_DIR.joinpath("stvOMASA_2ISM_2MASA1TC48c.wav"),
    "OMASA_1_3": TESTV_DIR.joinpath("stvOMASA_3ISM_1MASA1TC48c.wav"),
    "OMASA_1_4": TESTV_DIR.joinpath("stvOMASA_4ISM_2MASA1TC48c.wav"),
    "OMASA_2_1": TESTV_DIR.joinpath("stvOMASA_1ISM_1MASA2TC48c.wav"),
    "OMASA_2_2": TESTV_DIR.joinpath("stvOMASA_2ISM_2MASA2TC48c.wav"),
    "OMASA_2_3": TESTV_DIR.joinpath("stvOMASA_3ISM_1MASA2TC48c.wav"),
    "OMASA_2_4": TESTV_DIR.joinpath("stvOMASA_4ISM_2MASA2TC48c.wav"),
    "OSBA_1_1": TESTV_DIR.joinpath("stvOSBA_1ISM_FOA48c.wav"),
    "OSBA_1_2": TESTV_DIR.joinpath("stvOSBA_1ISM_2OA48c.wav"),
    "OSBA_1_3": TESTV_DIR.joinpath("stvOSBA_1ISM_3OA48c.wav"),
    "OSBA_2_1": TESTV_DIR.joinpath("stvOSBA_2ISM_FOA48c.wav"),
    "OSBA_2_2": TESTV_DIR.joinpath("stvOSBA_2ISM_2OA48c.wav"),
    "OSBA_2_3": TESTV_DIR.joinpath("stvOSBA_2ISM_3OA48c.wav"),
    "OSBA_3_1": TESTV_DIR.joinpath("stvOSBA_3ISM_FOA48c.wav"),
    "OSBA_3_2": TESTV_DIR.joinpath("stvOSBA_3ISM_2OA48c.wav"),
    "OSBA_3_3": TESTV_DIR.joinpath("stvOSBA_3ISM_3OA48c.wav"),
    "OSBA_4_1": TESTV_DIR.joinpath("stvOSBA_4ISM_FOA48c.wav"),
    "OSBA_4_2": TESTV_DIR.joinpath("stvOSBA_4ISM_2OA48c.wav"),
    "OSBA_4_3": TESTV_DIR.joinpath("stvOSBA_4ISM_3OA48c.wav"),
    "META": TEST_VECTOR_DIR.joinpath("mixed_scene.txt"),
    "ISM1MASA1": TESTV_DIR.joinpath("stvOMASA_1ISM_1MASA1TC48c.wav"),
    "ISM2MASA1": TESTV_DIR.joinpath("stvOMASA_2ISM_2MASA1TC48c.wav"),
    "ISM3MASA1": TESTV_DIR.joinpath("stvOMASA_3ISM_1MASA1TC48c.wav"),
    "ISM4MASA1": TESTV_DIR.joinpath("stvOMASA_4ISM_2MASA1TC48c.wav"),
    "ISM1MASA2": TESTV_DIR.joinpath("stvOMASA_1ISM_1MASA2TC48c.wav"),
    "ISM2MASA2": TESTV_DIR.joinpath("stvOMASA_2ISM_2MASA2TC48c.wav"),
    "ISM3MASA2": TESTV_DIR.joinpath("stvOMASA_3ISM_1MASA2TC48c.wav"),
    "ISM4MASA2": TESTV_DIR.joinpath("stvOMASA_4ISM_2MASA2TC48c.wav"),
    "ISM1SBA1": TESTV_DIR.joinpath("stvOSBA_1ISM_FOA48c.wav"),
    "ISM1SBA2": TESTV_DIR.joinpath("stvOSBA_1ISM_2OA48c.wav"),
    "ISM1SBA3": TESTV_DIR.joinpath("stvOSBA_1ISM_3OA48c.wav"),
    "ISM2SBA1": TESTV_DIR.joinpath("stvOSBA_2ISM_FOA48c.wav"),
    "ISM2SBA2": TESTV_DIR.joinpath("stvOSBA_2ISM_2OA48c.wav"),
    "ISM2SBA3": TESTV_DIR.joinpath("stvOSBA_2ISM_3OA48c.wav"),
    "ISM3SBA1": TESTV_DIR.joinpath("stvOSBA_3ISM_FOA48c.wav"),
    "ISM3SBA2": TESTV_DIR.joinpath("stvOSBA_3ISM_2OA48c.wav"),
    "ISM3SBA3": TESTV_DIR.joinpath("stvOSBA_3ISM_3OA48c.wav"),
    "ISM4SBA1": TESTV_DIR.joinpath("stvOSBA_4ISM_FOA48c.wav"),
    "ISM4SBA2": TESTV_DIR.joinpath("stvOSBA_4ISM_2OA48c.wav"),
    "ISM4SBA3": TESTV_DIR.joinpath("stvOSBA_4ISM_3OA48c.wav"),
    "META": TEST_VECTOR_DIR.joinpath("mixed_scene_48.txt"),
    "16ch_8+4+4": TESTV_DIR.joinpath("stv3OA48c.wav"),
    "4d4": TESTV_DIR.joinpath("stv71MC48c.wav"),
    "t_design_4": TESTV_DIR.joinpath("stv714MC48c.wav"),
}

@@ -201,29 +201,28 @@ FORMAT_TO_FILE_LTV = {
    "ISM4": LTV_DIR.joinpath("ltv48_4ISM.wav"),
    "MASA1": LTV_DIR.joinpath("ltv48_MASA1TC.wav"),
    "MASA2": LTV_DIR.joinpath("ltv48_MASA2TC.wav"),
    "OMASA_1_1": LTV_DIR.joinpath("ltv48_OMASA_1ISM_1TC.wav"),
    "OMASA_1_2": LTV_DIR.joinpath("ltv48_OMASA_2ISM_1TC.wav"),
    "OMASA_1_3": LTV_DIR.joinpath("ltv48_OMASA_3ISM_1TC.wav"),
    "OMASA_1_4": LTV_DIR.joinpath("ltv48_OMASA_4ISM_1TC.wav"),
    "OMASA_2_1": LTV_DIR.joinpath("ltv48_OMASA_1ISM_2TC.wav"),
    "OMASA_2_2": LTV_DIR.joinpath("ltv48_OMASA_2ISM_2TC.wav"),
    "OMASA_2_3": LTV_DIR.joinpath("ltv48_OMASA_3ISM_2TC.wav"),
    "OMASA_2_4": LTV_DIR.joinpath("ltv48_OMASA_4ISM_2TC.wav"),
    "OSBA_1_1": LTV_DIR.joinpath("ltv48_OSBA_1ISM_FOA.wav"),
    "OSBA_1_2": LTV_DIR.joinpath("ltv48_OSBA_1ISM_HOA2.wav"),
    "OSBA_1_3": LTV_DIR.joinpath("ltv48_OSBA_1ISM_HOA3.wav"),
    "OSBA_2_1": LTV_DIR.joinpath("ltv48_OSBA_2ISM_FOA.wav"),
    "OSBA_2_2": LTV_DIR.joinpath("ltv48_OSBA_2ISM_HOA2.wav"),
    "OSBA_2_3": LTV_DIR.joinpath("ltv48_OSBA_2ISM_HOA3.wav"),
    "OSBA_3_1": LTV_DIR.joinpath("ltv48_OSBA_3ISM_FOA.wav"),
    "OSBA_3_2": LTV_DIR.joinpath("ltv48_OSBA_3ISM_HOA2.wav"),
    "OSBA_3_3": LTV_DIR.joinpath("ltv48_OSBA_3ISM_HOA3.wav"),
    "OSBA_4_1": LTV_DIR.joinpath("ltv48_OSBA_4ISM_FOA.wav"),
    "OSBA_4_2": LTV_DIR.joinpath("ltv48_OSBA_4ISM_HOA2.wav"),
    "OSBA_4_3": LTV_DIR.joinpath("ltv48_OSBA_4ISM_HOA3.wav"),
    "META": TEST_VECTOR_DIR.joinpath("mixed_scene.txt"),
    "ISM1MASA1": LTV_DIR.joinpath("ltv48_OMASA_1ISM_1TC.wav"),
    "ISM2MASA1": LTV_DIR.joinpath("ltv48_OMASA_2ISM_1TC.wav"),
    "ISM3MASA1": LTV_DIR.joinpath("ltv48_OMASA_3ISM_1TC.wav"),
    "ISM4MASA1": LTV_DIR.joinpath("ltv48_OMASA_4ISM_1TC.wav"),
    "ISM1MASA2": LTV_DIR.joinpath("ltv48_OMASA_1ISM_2TC.wav"),
    "ISM2MASA2": LTV_DIR.joinpath("ltv48_OMASA_2ISM_2TC.wav"),
    "ISM3MASA2": LTV_DIR.joinpath("ltv48_OMASA_3ISM_2TC.wav"),
    "ISM4MASA2": LTV_DIR.joinpath("ltv48_OMASA_4ISM_2TC.wav"),
    "ISM1SBA1": LTV_DIR.joinpath("ltv48_OSBA_1ISM_FOA.wav"),
    "ISM1SBA2": LTV_DIR.joinpath("ltv48_OSBA_1ISM_HOA2.wav"),
    "ISM1SBA3": LTV_DIR.joinpath("ltv48_OSBA_1ISM_HOA3.wav"),
    "ISM2SBA1": LTV_DIR.joinpath("ltv48_OSBA_2ISM_FOA.wav"),
    "ISM2SBA2": LTV_DIR.joinpath("ltv48_OSBA_2ISM_HOA2.wav"),
    "ISM2SBA3": LTV_DIR.joinpath("ltv48_OSBA_2ISM_HOA3.wav"),
    "ISM3SBA1": LTV_DIR.joinpath("ltv48_OSBA_3ISM_FOA.wav"),
    "ISM3SBA2": LTV_DIR.joinpath("ltv48_OSBA_3ISM_HOA2.wav"),
    "ISM3SBA3": LTV_DIR.joinpath("ltv48_OSBA_3ISM_HOA3.wav"),
    "ISM4SBA1": LTV_DIR.joinpath("ltv48_OSBA_4ISM_FOA.wav"),
    "ISM4SBA2": LTV_DIR.joinpath("ltv48_OSBA_4ISM_HOA2.wav"),
    "ISM4SBA3": LTV_DIR.joinpath("ltv48_OSBA_4ISM_HOA3.wav"),
    "META": TEST_VECTOR_DIR.joinpath("mixed_scene_48.txt"),
    "16ch_8+4+4": LTV_DIR.joinpath("ltv48_HOA3.wav"),
    "4d4": LTV_DIR.joinpath("ltv48_MC71.wav"),
    "t_design_4": LTV_DIR.joinpath("ltv48_MC714.wav"),
}

@@ -252,44 +251,44 @@ FORMAT_TO_METADATA_FILES = {
    ],
    "MASA1": [str(TESTV_DIR.joinpath("stv1MASA1TC48c.met"))],
    "MASA2": [str(TESTV_DIR.joinpath("stv2MASA2TC48c.met"))],
    "OMASA_1_1": [
    "ISM1MASA1": [
        str(TESTV_DIR.joinpath("stvISM1.csv")),
        str(TESTV_DIR.joinpath("stvOMASA_1ISM_1MASA1TC48c.met")),
    ],
    "OMASA_1_2": [
    "ISM2MASA1": [
        str(TESTV_DIR.joinpath("stvISM1.csv")),
        str(TESTV_DIR.joinpath("stvISM2.csv")),
        str(TESTV_DIR.joinpath("stvOMASA_2ISM_2MASA1TC48c.met")),
    ],
    "OMASA_1_3": [
    "ISM3MASA1": [
        str(TESTV_DIR.joinpath("stvISM1.csv")),
        str(TESTV_DIR.joinpath("stvISM2.csv")),
        str(TESTV_DIR.joinpath("stvISM3.csv")),
        str(TESTV_DIR.joinpath("stvOMASA_3ISM_1MASA1TC48c.met")),
    ],
    "OMASA_1_4": [
    "ISM4MASA1": [
        str(TESTV_DIR.joinpath("stvISM1.csv")),
        str(TESTV_DIR.joinpath("stvISM2.csv")),
        str(TESTV_DIR.joinpath("stvISM3.csv")),
        str(TESTV_DIR.joinpath("stvISM4.csv")),
        str(TESTV_DIR.joinpath("stvOMASA_4ISM_2MASA1TC48c.met")),
    ],
    "OMASA_2_1": [
    "ISM1MASA2": [
        str(TESTV_DIR.joinpath("stvISM1.csv")),
        str(TESTV_DIR.joinpath("stvOMASA_1ISM_1MASA2TC48c.met")),
    ],
    "OMASA_2_2": [
    "ISM2MASA2": [
        str(TESTV_DIR.joinpath("stvISM1.csv")),
        str(TESTV_DIR.joinpath("stvISM2.csv")),
        str(TESTV_DIR.joinpath("stvOMASA_2ISM_2MASA2TC48c.met")),
    ],
    "OMASA_2_3": [
    "ISM3MASA2": [
        str(TESTV_DIR.joinpath("stvISM1.csv")),
        str(TESTV_DIR.joinpath("stvISM2.csv")),
        str(TESTV_DIR.joinpath("stvISM3.csv")),
        str(TESTV_DIR.joinpath("stvOMASA_3ISM_1MASA2TC48c.met")),
    ],
    "OMASA_2_4": [
    "ISM4MASA2": [
        str(TESTV_DIR.joinpath("stvISM1.csv")),
        str(TESTV_DIR.joinpath("stvISM2.csv")),
        str(TESTV_DIR.joinpath("stvISM3.csv")),
@@ -323,44 +322,44 @@ FORMAT_TO_METADATA_FILES_LTV = {
    ],
    "MASA1": [str(LTV_DIR.joinpath("ltv48_MASA1TC.met"))],
    "MASA2": [str(LTV_DIR.joinpath("ltv48_MASA2TC.met"))],
    "OMASA_1_1": [
    "ISM1MASA1": [
        str(LTV_DIR.joinpath("ltvISM1.csv")),
        str(LTV_DIR.joinpath("ltv48_OMASA_1ISM_1TC.met")),
    ],
    "OMASA_1_2": [
    "ISM2MASA1": [
        str(LTV_DIR.joinpath("ltvISM1.csv")),
        str(LTV_DIR.joinpath("ltvISM2.csv")),
        str(LTV_DIR.joinpath("ltv48_OMASA_2ISM_1TC.met")),
    ],
    "OMASA_1_3": [
    "ISM3MASA1": [
        str(LTV_DIR.joinpath("ltvISM1.csv")),
        str(LTV_DIR.joinpath("ltvISM2.csv")),
        str(LTV_DIR.joinpath("ltvISM3.csv")),
        str(LTV_DIR.joinpath("ltv48_OMASA_3ISM_1TC.met")),
    ],
    "OMASA_1_4": [
    "ISM4MASA1": [
        str(LTV_DIR.joinpath("ltvISM1.csv")),
        str(LTV_DIR.joinpath("ltvISM2.csv")),
        str(LTV_DIR.joinpath("ltvISM3.csv")),
        str(LTV_DIR.joinpath("ltvISM4.csv")),
        str(LTV_DIR.joinpath("ltv48_OMASA_4ISM_1TC.met")),
    ],
    "OMASA_2_1": [
    "ISM1MASA2": [
        str(LTV_DIR.joinpath("ltvISM1.csv")),
        str(LTV_DIR.joinpath("ltv48_OMASA_1ISM_2TC.met")),
    ],
    "OMASA_2_2": [
    "ISM2MASA2": [
        str(LTV_DIR.joinpath("ltvISM1.csv")),
        str(LTV_DIR.joinpath("ltvISM2.csv")),
        str(LTV_DIR.joinpath("ltv48_OMASA_2ISM_2TC.met")),
    ],
    "OMASA_2_3": [
    "ISM3MASA2": [
        str(LTV_DIR.joinpath("ltvISM1.csv")),
        str(LTV_DIR.joinpath("ltvISM2.csv")),
        str(LTV_DIR.joinpath("ltvISM3.csv")),
        str(LTV_DIR.joinpath("ltv48_OMASA_3ISM_2TC.met")),
    ],
    "OMASA_2_4": [
    "ISM4MASA2": [
        str(LTV_DIR.joinpath("ltvISM1.csv")),
        str(LTV_DIR.joinpath("ltvISM2.csv")),
        str(LTV_DIR.joinpath("ltvISM3.csv")),
@@ -374,6 +373,31 @@ INPUT_FORMATS_AMBI = ["FOA", "HOA2", "HOA3"]
INPUT_FORMATS_MC = ["MONO", "STEREO", "5_1", "5_1_2", "5_1_4", "7_1", "7_1_4"]
INPUT_FORMATS_ISM = ["ISM1", "ISM2", "ISM3", "ISM4"]
INPUT_FORMATS_MASA = ["MASA1", "MASA2"]
INPUT_FORMATS_OMASA = [
    "ISM1MASA1",
    "ISM2MASA1",
    "ISM3MASA1",
    "ISM4MASA1",
    "ISM1MASA2",
    "ISM2MASA2",
    "ISM3MASA2",
    "ISM4MASA2",
]
INPUT_FORMATS_OSBA = [
    "ISM1SBA1",
    "ISM1SBA2",
    "ISM1SBA3",
    "ISM2SBA1",
    "ISM2SBA2",
    "ISM2SBA3",
    "ISM3SBA1",
    "ISM3SBA2",
    "ISM3SBA3",
    "ISM4SBA1",
    "ISM4SBA2",
    "ISM4SBA3",
]


""" Non binaural / parametric output formats """
OUTPUT_FORMATS = [
@@ -392,7 +416,6 @@ OUTPUT_FORMATS = [
""" Custom loudspeaker input/output """
CUSTOM_LS_TO_TEST = [
    "t_design_4",
    "4d4",
    "16ch_8+4+4",
]

@@ -418,4 +441,3 @@ PEAQ_SUPPORTED_FMT = [
    "BINAURAL_ROOM_IR",
    "BINAURAL_ROOM_REVERB",
]
+698 −82

File changed.

Preview size limit exceeded, changes collapsed.

+44 −35
Original line number Diff line number Diff line
@@ -30,44 +30,44 @@ 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 errno
import filecmp
import logging
import os
from pathlib import Path
import re
import subprocess as sp
import sys
import tempfile
from pathlib import Path
from typing import Dict, Optional, Union

import numpy as np
import pytest
import re
import errno
import tempfile

from ..constants import CAT_NORMAL
from .compare_audio import compare_audio_arrays
from .constants import (
    LTV_DIR,
    SCRIPTS_DIR,
    OUTPUT_PATH_REF,
    OUTPUT_PATH_CUT,
    BIN_SUFFIX_MERGETARGET,
    FORMAT_TO_FILE_COMPARETEST,
    FORMAT_TO_FILE_LTV,
    FORMAT_TO_FILE_SMOKETEST,
    FORMAT_TO_METADATA_FILES,
    FORMAT_TO_METADATA_FILES_LTV,
    FORMAT_TO_FILE_SMOKETEST,
    RENDERER_CMD,
    BIN_SUFFIX_MERGETARGET,
    LTV_DIR,
    OUTPUT_PATH_CUT,
    OUTPUT_PATH_REF,
    PEAQ_SUPPORTED_FMT,
    RENDERER_CMD,
    SCRIPTS_DIR,
)
from ..constants import CAT_NORMAL

sys.path.append(SCRIPTS_DIR)
from pyaudio3dtools.audiofile import readfile
from ..cmp_pcm import cmp_pcm
from ..conftest import parse_properties, get_split_idx

from ..cmp_pcm import cmp_pcm
from ..conftest import get_split_idx, parse_properties

def _run_cmd(cmd, env, test_info=None):
def _run_cmd(cmd, test_info=None, env=None ):
    """
    Helper function for running some command.
    Raises a SystemError if either the return code is non-zero or a USAN printout is detected
@@ -92,29 +92,30 @@ def _run_cmd(cmd, env, test_info=None):
        raise SystemError(error)


def run_cmd(cmd, test_info, env=None):
def run_cmd(cmd, test_info=None, env=None):
    logging.info(f"\nRunning command\n{' '.join(cmd)}\n")
    _run_cmd(cmd, env, test_info)
    _run_cmd(cmd, test_info=test_info, env=env)


def run_isar_ext_rend_cmd(cmd, env=None):
def run_isar_ext_rend_cmd(cmd, test_info=None, env=None):
    logging.info(f"\nRunning ISAR EXT REND command\n{' '.join(cmd)}\n")
    _run_cmd(cmd, env)
    _run_cmd(cmd, test_info=test_info, env=env)


def run_ivas_isar_enc_cmd(cmd, env=None):
def run_ivas_isar_enc_cmd(cmd, test_info=None, env=None):
    logging.info(f"\nRunning IVAS ISAR encoder command\n{' '.join(cmd)}\n")
    _run_cmd(cmd, env)

    _run_cmd(cmd, test_info=test_info, env=env)

def run_ivas_isar_dec_cmd(cmd, env=None):
def run_ivas_isar_dec_cmd(cmd, test_info=None, env=None):
    if BIN_SUFFIX_MERGETARGET in cmd[0]:
        logging.info(f"\nREF decoder command:\n\t{' '.join(cmd)}\n")
    else:
        logging.info(f"\nDUT decoder command:\n\t{' '.join(cmd)}\n")
    _run_cmd(cmd, env)

    _run_cmd(cmd, test_info=test_info, env=env)

def run_isar_post_rend_cmd(cmd, env=None):
def run_isar_post_rend_cmd(cmd, test_info=None, env=None):
    logging.info(f"\nRunning ISAR post renderer command\n{' '.join(cmd)}\n")
    _run_cmd(cmd, env)
    _run_cmd(cmd, test_info=test_info, env=env)


def check_BE(
@@ -175,7 +176,7 @@ def run_renderer(
    aeid: Optional[Union[Path, int]] = None,
    in_file=None,
    out_file=None,
    sr=48,
    sr="48kHz",
    render_for_peaq=False,
    split_comparison=False,
) -> str:
@@ -267,12 +268,20 @@ def run_renderer(
        else:
            in_file = format_to_file[in_fmt]
            in_name = in_fmt
        in_file = str(in_file).replace("48", sr[:2])

    if in_meta_files is None and in_fmt in format_to_metadata_files:
        in_meta_files = format_to_metadata_files[in_fmt]

    # If metadata not given with ISM input, use default NULL
    if in_meta_files is None and isinstance(in_fmt, str) and "ism" in in_fmt.lower():
        match = re.search(r"ism(\d)", in_fmt.lower())
        assert match is not None
        num_obj = int(match[1])
        in_meta_files = ["NULL"] * num_obj

    if out_file is None:
        out_file_stem = f"{in_name}_to_{out_name}{trj_name}{non_diegetic_pan}{refrot_name}{refvec_name}{refveclev_name}{config_name}{framing_name}{hrtf_file_name}{name_extension}{aeid_name}.wav"
        out_file_stem = f"{in_name}_to_{out_name}{trj_name}{non_diegetic_pan}{refrot_name}{refvec_name}{refveclev_name}{config_name}{framing_name}{hrtf_file_name}{name_extension}{aeid_name}_{sr}.wav"
        out_file = str(output_path_base.joinpath(out_file_stem))

    cmd = RENDERER_CMD[:]
@@ -280,7 +289,7 @@ def run_renderer(
    cmd[4] = str(in_fmt)
    cmd[6] = str(out_file)
    cmd[8] = str(out_fmt)
    cmd[10] = str(sr)
    cmd[10] = str(sr[:2])

    if test_info.config.option.create_ref:
        cmd[0] += BIN_SUFFIX_MERGETARGET
@@ -370,7 +379,7 @@ def run_renderer(
                cmd2[4] = str(out_fmt)  # in_fmt
                cmd2[6] = odg_test  # out_file
                cmd2[8] = new_fmt  # out_fmt
                cmd2[10] = str(sr)
                cmd2[10] = str(sr[:2])
                cmd2[0] += BIN_SUFFIX_MERGETARGET  # Use IVAS_rend_ref for re-rendering
                cmd2[0] += binary_suffix
                if "MASA" in str(out_fmt):
@@ -551,8 +560,8 @@ def binauralize_input_and_output(
        # If extended metadata is not used, strip the metadata for the external renderer
        extended_md_used = (
            re.search(r"-ism\s?\+[1-4]", enc_opts)
            and not "OMASA" in in_fmt
            and not "OSBA" in in_fmt
            and "OMASA" not in in_fmt
            and "OSBA" not in in_fmt
        )
        if not extended_md_used and n_obj > 0:
            truncated_meta_files = []
@@ -634,7 +643,7 @@ def binauralize_input_and_output(

        aeid = findstr(r"-aeid\s+(\S+)", dec_opts)

        if not output_config.upper() in PEAQ_SUPPORTED_FMT:
        if output_config.upper() not in PEAQ_SUPPORTED_FMT:
            # Render output to BINAURAL
            output_reformat = "BINAURAL"