Commit 1eb42d2e authored by Archit Tamarapu's avatar Archit Tamarapu
Browse files

- shorten test duration for split-rendering BE comparison to 3s

- avoid name collisions in tmp test files
- add external split rendering testcases for MASA
parent 746550b0
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -131,7 +131,7 @@ IVAS_MAX_ISM_BITRATE = {
    "4": "512000",
}

INPUT_DURATION_SEC = 5
INPUT_DURATION_SEC = 3

""" Encoder commandline template """
SPLIT_PRE_COD_CMD = [
+17 −0
Original line number Diff line number Diff line
@@ -206,3 +206,20 @@ def test_masa_full_chain_split(test_info, in_fmt, bitrate, render_config, trajec
        post_trajectory=post_trajectory,
        output_path_base=OUTPUT_PATH_CUT,
    )

@pytest.mark.parametrize("trajectory", HR_TRAJECTORIES_TO_TEST)
@pytest.mark.parametrize("render_config", RENDERER_CONFIGS_TO_TEST_MASA)
@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_MASA)
def test_masa_external_split(test_info, in_fmt, render_config, trajectory):
    check_xfail(test_info, in_fmt, render_config)

    post_trajectory = HR_TRAJECTORY_DIR.joinpath(f"{trajectory}.csv")
    pre_trajectory = post_trajectory.with_stem(f"{post_trajectory.stem}_delayed")

    run_external_split_rendering(
        in_fmt=in_fmt,
        render_config=RENDER_CFG_DIR.joinpath(f"{render_config}.txt"),
        pre_trajectory=pre_trajectory,
        post_trajectory=post_trajectory,
        output_path_base=OUTPUT_PATH_CUT,
    )
 No newline at end of file
+18 −0
Original line number Diff line number Diff line
@@ -179,3 +179,21 @@ def test_masa_full_chain_split(test_info, in_fmt, bitrate, render_config, trajec
        pre_trajectory=pre_trajectory,
        post_trajectory=post_trajectory,
    )


@pytest.mark.parametrize("trajectory", HR_TRAJECTORIES_TO_TEST)
@pytest.mark.parametrize("render_config", RENDERER_CONFIGS_TO_TEST_MASA)
@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_MASA)
def test_masa_external_split(test_info, in_fmt, render_config, trajectory):
    check_xfail(test_info, in_fmt, render_config)

    post_trajectory = HR_TRAJECTORY_DIR.joinpath(f"{trajectory}.csv")
    pre_trajectory = post_trajectory.with_stem(f"{post_trajectory.stem}_delayed")

    compare_external_split_args(
        in_fmt=in_fmt,
        render_config=RENDER_CFG_DIR.joinpath(f"{render_config}.txt"),
        pre_trajectory=pre_trajectory,
        post_trajectory=post_trajectory,
        output_path_base=OUTPUT_PATH_CUT,
    )
+8 −10
Original line number Diff line number Diff line
@@ -57,12 +57,11 @@ def run_full_chain_split_rendering(
    """
    with TemporaryDirectory() as tmp_dir:
        tmp_dir = Path(tmp_dir)
        cut_in_file = tmp_dir.joinpath("cut_input.wav")
        ivas_bitstream = tmp_dir.joinpath("ivas.192")
        split_bitstream = tmp_dir.joinpath("split.bit")
        out_file = output_path_base.joinpath(
            f"{in_fmt}_{bitrate}bps_{pre_trajectory.stem}_split_full_{post_trajectory.stem}__config_{render_config.stem}.wav"
        )
        test_file_stem = f"{in_fmt}_{bitrate}bps_{pre_trajectory.stem}_split_full_{post_trajectory.stem}__config_{render_config.stem}"
        cut_in_file = tmp_dir.joinpath(f"{test_file_stem}_cut.wav")
        ivas_bitstream = tmp_dir.joinpath(f"{test_file_stem}.192")
        split_bitstream = tmp_dir.joinpath(f"{test_file_stem}.bit")
        out_file = output_path_base.joinpath(f"{test_file_stem}.wav")

        # check for metadata files
        if in_fmt.upper().startswith("ISM") or in_fmt.upper().startswith("MASA"):
@@ -146,10 +145,9 @@ def run_external_split_rendering(

    with TemporaryDirectory() as tmp_dir:
        tmp_dir = Path(tmp_dir)
        split_bitstream = tmp_dir.joinpath("split.bit")
        out_file = output_path_base.joinpath(
            f"{in_fmt}_{pre_trajectory.stem}_split_ext_{post_trajectory.stem}__config_{render_config.stem}.wav"
        )
        test_file_stem = f"{in_fmt}_{pre_trajectory.stem}_split_ext_{post_trajectory.stem}__config_{render_config.stem}"
        split_bitstream = tmp_dir.joinpath(f"{test_file_stem}.bit")
        out_file = output_path_base.joinpath(f"{test_file_stem}.wav")

        # check for metadata files
        if in_fmt.upper().startswith("ISM") or in_fmt.upper().startswith("MASA"):