Commit fd09a4ce authored by sagnowski's avatar sagnowski
Browse files

Extend split rendering tests to also run decoder in VoIP mode

parent dd011004
Loading
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -56,6 +56,14 @@ CUSTOM_LAYOUT_DIR = SCRIPTS_DIR.joinpath("ls_layouts")
HR_TRAJECTORY_DIR = SCRIPTS_DIR.joinpath("trajectories")
TESTV_DIR = SCRIPTS_DIR.joinpath("testv")

if platform.system() == "Windows":
    TOOLS_DIR = SCRIPTS_DIR / "tools" / "Win32"
elif platform.system() == "Linux":
    TOOLS_DIR = SCRIPTS_DIR / "tools"/ "Linux"
elif platform.system() == "Darwin":
    TOOLS_DIR = SCRIPTS_DIR / "tools" / "Darwin"
else:
    assert False, "Unsupported platform"

""" Renderer configurations """
RENDERER_CONFIGS_DEFAULT_CODEC = [
@@ -180,6 +188,9 @@ INPUT_DURATION_SEC = 5
""" PLC constants """
PLC_ERROR_PATTERNS = [str(ep.stem) for ep in ERROR_PATTERNS_DIR.glob("*.ep")]

""" Delay profiles for testing VoIP mode """
DELAY_PROFILES = [None, "dly_error_profile_5"]

""" Encoder commandline template """
SPLIT_PRE_COD_CMD = [
    str(TESTS_DIR.parent.parent.joinpath("IVAS_cod")),
+25 −1
Original line number Diff line number Diff line
@@ -37,6 +37,7 @@ from tests.split_rendering.utils import *
""" Ambisonics """


@pytest.mark.parametrize("delay_profile", DELAY_PROFILES)
@pytest.mark.parametrize("trajectory", SPLIT_REND_HR_TRAJECTORIES_TO_TEST)
@pytest.mark.parametrize("render_config", RENDERER_CONFIGS_TO_TEST_AMBI)
@pytest.mark.parametrize("bitrate", IVAS_BITRATES_AMBI)
@@ -54,6 +55,7 @@ def test_ambisonics_full_chain_split(
    bitrate,
    render_config,
    trajectory,
    delay_profile,
):
    post_trajectory = HR_TRAJECTORY_DIR.joinpath(f"{trajectory}.csv")
    pre_trajectory = post_trajectory.with_stem(f"{post_trajectory.stem}_delayed")
@@ -73,6 +75,7 @@ def test_ambisonics_full_chain_split(
        get_ssnr=get_ssnr,
        get_odg=get_odg,
        get_odg_bin=get_odg_bin,
        delay_profile=SCRIPTS_DIR / "dly_error_profiles" / f"{delay_profile}.dat" if delay_profile else None,
    )


@@ -114,6 +117,7 @@ def test_ambisonics_external_split(
""" Multichannel """


@pytest.mark.parametrize("delay_profile", DELAY_PROFILES)
@pytest.mark.parametrize("trajectory", SPLIT_REND_HR_TRAJECTORIES_TO_TEST)
@pytest.mark.parametrize("render_config", RENDERER_CONFIGS_TO_TEST_MC)
@pytest.mark.parametrize("bitrate", IVAS_BITRATES_MC)
@@ -131,6 +135,7 @@ def test_multichannel_full_chain_split(
    bitrate,
    render_config,
    trajectory,
    delay_profile,
):
    post_trajectory = HR_TRAJECTORY_DIR.joinpath(f"{trajectory}.csv")
    pre_trajectory = post_trajectory.with_stem(f"{post_trajectory.stem}_delayed")
@@ -150,6 +155,7 @@ def test_multichannel_full_chain_split(
        get_ssnr=get_ssnr,
        get_odg=get_odg,
        get_odg_bin=get_odg_bin,
        delay_profile=SCRIPTS_DIR / "dly_error_profiles" / f"{delay_profile}.dat" if delay_profile else None,
    )


@@ -191,6 +197,7 @@ def test_multichannel_external_split(
""" ISM """


@pytest.mark.parametrize("delay_profile", DELAY_PROFILES)
@pytest.mark.parametrize("trajectory", SPLIT_REND_HR_TRAJECTORIES_TO_TEST)
@pytest.mark.parametrize("render_config", RENDERER_CONFIGS_TO_TEST_ISM)
@pytest.mark.parametrize("bitrate", IVAS_BITRATES_ISM)
@@ -208,6 +215,7 @@ def test_ism_full_chain_split(
    bitrate,
    render_config,
    trajectory,
    delay_profile,
):
    post_trajectory = HR_TRAJECTORY_DIR.joinpath(f"{trajectory}.csv")
    pre_trajectory = post_trajectory.with_stem(f"{post_trajectory.stem}_delayed")
@@ -227,6 +235,7 @@ def test_ism_full_chain_split(
        get_ssnr=get_ssnr,
        get_odg=get_odg,
        get_odg_bin=get_odg_bin,
        delay_profile=SCRIPTS_DIR / "dly_error_profiles" / f"{delay_profile}.dat" if delay_profile else None,
    )


@@ -268,6 +277,7 @@ def test_ism_external_split(
""" MASA """


@pytest.mark.parametrize("delay_profile", DELAY_PROFILES)
@pytest.mark.parametrize("trajectory", SPLIT_REND_HR_TRAJECTORIES_TO_TEST)
@pytest.mark.parametrize("render_config", RENDERER_CONFIGS_TO_TEST_MASA)
@pytest.mark.parametrize("bitrate", IVAS_BITRATES_MASA)
@@ -285,6 +295,7 @@ def test_masa_full_chain_split(
    bitrate,
    render_config,
    trajectory,
    delay_profile,
):
    post_trajectory = HR_TRAJECTORY_DIR.joinpath(f"{trajectory}.csv")
    pre_trajectory = post_trajectory.with_stem(f"{post_trajectory.stem}_delayed")
@@ -304,6 +315,7 @@ def test_masa_full_chain_split(
        get_ssnr=get_ssnr,
        get_odg=get_odg,
        get_odg_bin=get_odg_bin,
        delay_profile=SCRIPTS_DIR / "dly_error_profiles" / f"{delay_profile}.dat" if delay_profile else None,
    )


@@ -345,6 +357,7 @@ def test_masa_external_split(
""" OMASA """


# @pytest.mark.parametrize("delay_profile", DELAY_PROFILES) # Waiting for issue #1343 to be resolved
@pytest.mark.parametrize("trajectory", SPLIT_REND_HR_TRAJECTORIES_TO_TEST)
@pytest.mark.parametrize("render_config", RENDERER_CONFIGS_TO_TEST_OMASA)
@pytest.mark.parametrize("bitrate", IVAS_BITRATES_OMASA)
@@ -362,6 +375,7 @@ def test_omasa_full_chain_split(
    bitrate,
    render_config,
    trajectory,
    delay_profile=None,
):
    post_trajectory = HR_TRAJECTORY_DIR.joinpath(f"{trajectory}.csv")
    pre_trajectory = post_trajectory.with_stem(f"{post_trajectory.stem}_delayed")
@@ -381,6 +395,7 @@ def test_omasa_full_chain_split(
        get_ssnr=get_ssnr,
        get_odg=get_odg,
        get_odg_bin=get_odg_bin,
        delay_profile=SCRIPTS_DIR / "dly_error_profiles" / f"{delay_profile}.dat" if delay_profile else None,
    )


@@ -425,6 +440,7 @@ def test_omasa_external_split(
""" OSBA """


# @pytest.mark.parametrize("delay_profile", DELAY_PROFILES) # Waiting for issue #1343 to be resolved
@pytest.mark.parametrize("trajectory", SPLIT_REND_HR_TRAJECTORIES_TO_TEST)
@pytest.mark.parametrize("render_config", RENDERER_CONFIGS_TO_TEST_OSBA)
@pytest.mark.parametrize("bitrate", IVAS_BITRATES_OSBA)
@@ -442,6 +458,7 @@ def test_osba_full_chain_split(
    bitrate,
    render_config,
    trajectory,
    delay_profile=None,
):
    post_trajectory = HR_TRAJECTORY_DIR.joinpath(f"{trajectory}.csv")
    pre_trajectory = post_trajectory.with_stem(f"{post_trajectory.stem}_delayed")
@@ -461,6 +478,7 @@ def test_osba_full_chain_split(
        get_ssnr=get_ssnr,
        get_odg=get_odg,
        get_odg_bin=get_odg_bin,
        delay_profile=SCRIPTS_DIR / "dly_error_profiles" / f"{delay_profile}.dat" if delay_profile else None,
    )


@@ -552,6 +570,7 @@ full_chain_split_pcm_params = [
]


@pytest.mark.parametrize("delay_profile", DELAY_PROFILES)
@pytest.mark.parametrize("in_fmt,bitrate,render_config", full_chain_split_pcm_params)
def test_full_chain_split_pcm(
    record_property,
@@ -565,6 +584,7 @@ def test_full_chain_split_pcm(
    in_fmt,
    bitrate,
    render_config,
    delay_profile,
):
    trajectory = SPLIT_REND_HR_TRAJECTORIES_TO_TEST[0]
    post_trajectory = HR_TRAJECTORY_DIR.joinpath(f"{trajectory}.csv")
@@ -586,6 +606,7 @@ def test_full_chain_split_pcm(
        get_ssnr=get_ssnr,
        get_odg=get_odg,
        get_odg_bin=get_odg_bin,
        delay_profile=SCRIPTS_DIR / "dly_error_profiles" / f"{delay_profile}.dat" if delay_profile else None,
    )


@@ -671,9 +692,10 @@ def test_framing_combinations_external_split(
    )


@pytest.mark.parametrize("delay_profile", DELAY_PROFILES)
@pytest.mark.parametrize("trajectory", SPLIT_REND_HR_TRAJECTORIES_TO_TEST)
@pytest.mark.parametrize("render_config", RENDERER_CONFIGS_FRAMING)
@pytest.mark.parametrize("in_fmt", ["5_1"])
@pytest.mark.parametrize("in_fmt", ["5_1", "FOA"])
@pytest.mark.parametrize("pre_rend_fr", SPLIT_RENDERER_PRE_FRAMINGS)
@pytest.mark.parametrize("post_rend_fr", SPLIT_RENDERER_POST_FRAMINGS)
def test_framing_combinations_full_chain_split(
@@ -690,6 +712,7 @@ def test_framing_combinations_full_chain_split(
    trajectory,
    post_rend_fr,
    pre_rend_fr,
    delay_profile,
):
    post_trajectory = HR_TRAJECTORY_DIR.joinpath(f"{trajectory}.csv")
    pre_trajectory = post_trajectory.with_stem(f"{post_trajectory.stem}_delayed")
@@ -711,4 +734,5 @@ def test_framing_combinations_full_chain_split(
        get_ssnr=get_ssnr,
        get_odg=get_odg,
        get_odg_bin=get_odg_bin,
        delay_profile=SCRIPTS_DIR / "dly_error_profiles" / f"{delay_profile}.dat" if delay_profile else None,
    )
+22 −0
Original line number Diff line number Diff line
@@ -50,6 +50,7 @@ from tests.renderer.utils import (
    run_isar_post_rend_cmd,
    run_ivas_isar_dec_cmd,
    run_ivas_isar_enc_cmd,
    run_cmd,
)
from tests.split_rendering.constants import *

@@ -184,6 +185,7 @@ def run_full_chain_split_rendering(
    get_ssnr=False,
    get_odg=False,
    get_odg_bin=False,
    delay_profile: Path | None=None,
) -> str:
    """
    Runs the full split rendering chain consisting of
@@ -201,6 +203,9 @@ def run_full_chain_split_rendering(
        renderer_fmt_for_filename = renderer_fmt.replace("BINAURAL_", "")
        filename_base = f"{in_fmt}_{bitrate}_{renderer_fmt_for_filename}_full_cfg_{render_config.stem}_fr_pre_{pre_rend_fr}_post_{post_rend_fr}"

        if delay_profile:
            filename_base += f"_{delay_profile.stem}"

        ivas_bitstream_stem = f"{filename_base}.192"
        # NOTE: the split bitstream files need to have ".bit" extension otherwise the conformance test breaks
        split_bitstream_stem = f"{filename_base}.splt.bit"
@@ -253,6 +258,20 @@ def run_full_chain_split_rendering(

        run_ivas_isar_enc_cmd(cmd)

        if delay_profile:
            rtp_bitstream = ivas_bitstream.with_suffix(".rtpg192")
            cmd = [
                str(TOOLS_DIR / f"networkSimulator_g192{EXE_SUFFIX}"),
                str(delay_profile),
                str(ivas_bitstream),
                str(rtp_bitstream),
                str(tmp_dir / "tmp.netsimtrace"),
                "1",
                "0"
            ]
            run_cmd(cmd, test_info=test_info)
            ivas_bitstream = rtp_bitstream

        # decode to split-rendering bitstream
        cmd = SPLIT_PRE_DEC_CMD[:]

@@ -269,6 +288,9 @@ def run_full_chain_split_rendering(
        if renderer_fmt == "BINAURAL_SPLIT_PCM":
            cmd[5:5] = ["-om", str(split_md_file)]

        if delay_profile:
            cmd[5:5] = ["-voip"]

        run_ivas_isar_dec_cmd(cmd)

        # run split renderer