Commit f586732a authored by Archit Tamarapu's avatar Archit Tamarapu
Browse files

actually enable long testvectors for MR BE comparison

parent be201d8e
Loading
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -79,7 +79,7 @@ NCHAN_TO_FILE = {
    16: TEST_VECTOR_DIR.joinpath("spectral_test_16ch_48kHz.wav"),
}

FORMAT_TO_FILE = {
FORMAT_TO_FILE_STV = {
    "MONO": NCHAN_TO_FILE[1],
    "STEREO": NCHAN_TO_FILE[2],
    "5_1": NCHAN_TO_FILE[6],
+14 −12
Original line number Diff line number Diff line
@@ -30,8 +30,6 @@
import pytest
from .utils import *

# override to use long test vectors for this test
FORMAT_TO_FILE = FORMAT_TO_FILE_LTV

""" Ambisonics """

@@ -39,13 +37,13 @@ FORMAT_TO_FILE = FORMAT_TO_FILE_LTV
@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS)
@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_AMBI)
def test_ambisonics(test_info, in_fmt, out_fmt):
    compare_renderer_vs_mergetarget(test_info, in_fmt, out_fmt)
    compare_renderer_vs_mergetarget(test_info, in_fmt, out_fmt, use_ltv=True)


@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL)
@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_AMBI)
def test_ambisonics_binaural_static(test_info, in_fmt, out_fmt):
    compare_renderer_vs_mergetarget(test_info, in_fmt, out_fmt)
    compare_renderer_vs_mergetarget(test_info, in_fmt, out_fmt, use_ltv=True)


@pytest.mark.parametrize("trj_file", HR_TRAJECTORIES_TO_TEST)
@@ -57,6 +55,7 @@ def test_ambisonics_binaural_headrotation(test_info, in_fmt, out_fmt, trj_file):
        in_fmt,
        out_fmt,
        trj_file=HR_TRAJECTORY_DIR.joinpath(f"{trj_file}.csv"),
        use_ltv=True,
    )


@@ -66,7 +65,7 @@ def test_ambisonics_binaural_headrotation(test_info, in_fmt, out_fmt, trj_file):
@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS)
@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_MC)
def test_multichannel(test_info, in_fmt, out_fmt):
    compare_renderer_vs_mergetarget(test_info, in_fmt, out_fmt)
    compare_renderer_vs_mergetarget(test_info, in_fmt, out_fmt, use_ltv=True)


@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL)
@@ -75,7 +74,7 @@ def test_multichannel_binaural_static(test_info, in_fmt, out_fmt):
    if in_fmt in ["MONO", "STEREO"]:
        pytest.skip("MONO or STEREO to Binaural rendering unsupported")

    compare_renderer_vs_mergetarget(test_info, in_fmt, out_fmt)
    compare_renderer_vs_mergetarget(test_info, in_fmt, out_fmt, use_ltv=True)


@pytest.mark.parametrize("trj_file", HR_TRAJECTORIES_TO_TEST)
@@ -90,6 +89,7 @@ def test_multichannel_binaural_headrotation(test_info, in_fmt, out_fmt, trj_file
        in_fmt,
        out_fmt,
        trj_file=HR_TRAJECTORY_DIR.joinpath(f"{trj_file}.csv"),
        use_ltv=True,
    )


@@ -113,7 +113,7 @@ def test_ism_binaural_static(test_info, in_fmt, out_fmt):
        in_meta_files = None

    compare_renderer_vs_mergetarget(
        test_info, in_fmt, out_fmt, in_meta_files=in_meta_files
        test_info, in_fmt, out_fmt, in_meta_files=in_meta_files, use_ltv=True
    )


@@ -132,6 +132,7 @@ def test_ism_binaural_headrotation(test_info, in_fmt, out_fmt, trj_file):
        out_fmt,
        trj_file=HR_TRAJECTORY_DIR.joinpath(f"{trj_file}.csv"),
        in_meta_files=in_meta_files,
        use_ltv=True,
    )


@@ -145,7 +146,7 @@ def test_ism_binaural_headrotation(test_info, in_fmt, out_fmt, trj_file):
@pytest.mark.parametrize("in_layout", CUSTOM_LS_TO_TEST)
def test_custom_ls_input(test_info, in_layout, out_fmt):
    compare_renderer_vs_mergetarget(
        test_info, CUSTOM_LAYOUT_DIR.joinpath(f"{in_layout}.txt"), out_fmt
        test_info, CUSTOM_LAYOUT_DIR.joinpath(f"{in_layout}.txt"), out_fmt, use_ltv=True
    )


@@ -153,7 +154,7 @@ def test_custom_ls_input(test_info, in_layout, out_fmt):
@pytest.mark.parametrize("in_fmt", OUTPUT_FORMATS)
def test_custom_ls_output(test_info, in_fmt, out_fmt):
    compare_renderer_vs_mergetarget(
        test_info, in_fmt, CUSTOM_LAYOUT_DIR.joinpath(f"{out_fmt}.txt")
        test_info, in_fmt, CUSTOM_LAYOUT_DIR.joinpath(f"{out_fmt}.txt"), use_ltv=True
    )


@@ -164,6 +165,7 @@ def test_custom_ls_input_output(test_info, in_fmt, out_fmt):
        test_info,
        CUSTOM_LAYOUT_DIR.joinpath(f"{in_fmt}.txt"),
        CUSTOM_LAYOUT_DIR.joinpath(f"{out_fmt}.txt"),
        use_ltv=True,
    )


@@ -171,9 +173,7 @@ def test_custom_ls_input_output(test_info, in_fmt, out_fmt):
@pytest.mark.parametrize("in_layout", CUSTOM_LS_TO_TEST)
def test_custom_ls_input_binaural(test_info, in_layout, out_fmt):
    compare_renderer_vs_mergetarget(
        test_info,
        CUSTOM_LAYOUT_DIR.joinpath(f"{in_layout}.txt"),
        out_fmt,
        test_info, CUSTOM_LAYOUT_DIR.joinpath(f"{in_layout}.txt"), out_fmt, use_ltv=True
    )


@@ -186,6 +186,7 @@ def test_custom_ls_input_binaural_headrotation(test_info, in_layout, out_fmt, tr
        CUSTOM_LAYOUT_DIR.joinpath(f"{in_layout}.txt"),
        out_fmt,
        trj_file=HR_TRAJECTORY_DIR.joinpath(f"{trj_file}.csv"),
        use_ltv=True,
    )


@@ -200,4 +201,5 @@ def test_metadata(test_info, in_fmt, out_fmt):
        "META",
        out_fmt,
        metadata_input=TEST_VECTOR_DIR.joinpath(f"{in_fmt}.txt"),
        use_ltv=True,
    )
+12 −0
Original line number Diff line number Diff line
@@ -108,6 +108,7 @@ def run_renderer(
    trj_file: Optional[str] = None,
    output_path_base: str = OUTPUT_PATH_CUT,
    binary_suffix: str = "",
    use_ltv: Optional[bool] = False,
) -> Tuple[np.ndarray, int]:
    """CuT creation with standalone renderer"""
    if trj_file is not None:
@@ -120,6 +121,11 @@ def run_renderer(
    else:
        out_name = out_fmt

    if use_ltv:
        FORMAT_TO_FILE = FORMAT_TO_FILE_LTV
    else:
        FORMAT_TO_FILE = FORMAT_TO_FILE_STV

    if metadata_input is not None:
        in_file = metadata_input
        in_name = metadata_input.stem
@@ -157,6 +163,7 @@ def run_pyscripts(
    metadata_input: Optional[str] = None,
    in_meta_files: Optional[list] = None,
    trj_file: Optional[str] = None,
    use_ltv: Optional[bool] = False,
) -> Tuple[np.ndarray, int]:
    """Reference creation with pyaudio3dtools"""
    if trj_file is not None:
@@ -169,6 +176,11 @@ def run_pyscripts(
    else:
        out_name = out_fmt

    if use_ltv:
        FORMAT_TO_FILE = FORMAT_TO_FILE_LTV
    else:
        FORMAT_TO_FILE = FORMAT_TO_FILE_STV

    if metadata_input is not None:
        in_file = metadata_input
        in_name = metadata_input.stem