Commit 91807c4e authored by Archit Tamarapu's avatar Archit Tamarapu
Browse files

[tests] update BE comparison test too + formatting (isort && black)

parent a1e9bdb8
Loading
Loading
Loading
Loading
Loading
+22 −8
Original line number Diff line number Diff line
@@ -57,14 +57,28 @@ from tests.renderer.constants import (
)

""" Renderer configurations """
RENDERER_CONFIGS_DEFAULT_CODEC = [str(cfg.stem) for cfg in RENDER_CFG_DIR.glob("*_default.txt")]
RENDERER_CONFIGS_LCLD_CODEC = [str(cfg.stem) for cfg in RENDER_CFG_DIR.glob("*_lcld.txt")]
RENDERER_CONFIGS_LC3PLUS_CODEC = [str(cfg.stem) for cfg in RENDER_CFG_DIR.glob("*_lc3plus.txt")]

RENDERER_CONFIGS_TO_TEST_AMBI = RENDERER_CONFIGS_DEFAULT_CODEC + RENDERER_CONFIGS_LC3PLUS_CODEC
RENDERER_CONFIGS_TO_TEST_MC = RENDERER_CONFIGS_DEFAULT_CODEC + RENDERER_CONFIGS_LCLD_CODEC
RENDERER_CONFIGS_TO_TEST_ISM = RENDERER_CONFIGS_DEFAULT_CODEC + RENDERER_CONFIGS_LCLD_CODEC
RENDERER_CONFIGS_TO_TEST_MASA = RENDERER_CONFIGS_DEFAULT_CODEC + RENDERER_CONFIGS_LC3PLUS_CODEC
RENDERER_CONFIGS_DEFAULT_CODEC = [
    str(cfg.stem) for cfg in RENDER_CFG_DIR.glob("*_default.txt")
]
RENDERER_CONFIGS_LCLD_CODEC = [
    str(cfg.stem) for cfg in RENDER_CFG_DIR.glob("*_lcld.txt")
]
RENDERER_CONFIGS_LC3PLUS_CODEC = [
    str(cfg.stem) for cfg in RENDER_CFG_DIR.glob("*_lc3plus.txt")
]

RENDERER_CONFIGS_TO_TEST_AMBI = (
    RENDERER_CONFIGS_DEFAULT_CODEC + RENDERER_CONFIGS_LC3PLUS_CODEC
)
RENDERER_CONFIGS_TO_TEST_MC = (
    RENDERER_CONFIGS_DEFAULT_CODEC + RENDERER_CONFIGS_LCLD_CODEC
)
RENDERER_CONFIGS_TO_TEST_ISM = (
    RENDERER_CONFIGS_DEFAULT_CODEC + RENDERER_CONFIGS_LCLD_CODEC
)
RENDERER_CONFIGS_TO_TEST_MASA = (
    RENDERER_CONFIGS_DEFAULT_CODEC + RENDERER_CONFIGS_LC3PLUS_CODEC
)

""" IVAS specific constants """
FORMAT_TO_IVAS_COD_FORMAT = {
+14 −18
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@

import pytest

from tests.split_rendering.test_split_rendering import check_xfail
from tests.split_rendering.utils import *

""" Ambisonics """
@@ -37,9 +38,10 @@ from tests.split_rendering.utils import *
@pytest.mark.parametrize("render_config", RENDERER_CONFIGS_TO_TEST_AMBI)
@pytest.mark.parametrize("bitrate", IVAS_BITRATES_AMBI)
@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_AMBI)
def test_ambisonics_full_chain_split(test_info, in_fmt, bitrate, render_config, trajectory):
    if "0dof_768k_lc3plus" in render_config:
        pytest.xfail("0DOF 768kbps LC3plus codec is unsupported")
def test_ambisonics_full_chain_split(
    test_info, in_fmt, bitrate, render_config, trajectory
):
    check_xfail(test_info, in_fmt, render_config, bitrate)

    post_trajectory = HR_TRAJECTORY_DIR.joinpath(f"{trajectory}.csv")
    pre_trajectory = post_trajectory.with_stem(f"{post_trajectory.stem}_delayed")
@@ -58,8 +60,7 @@ def test_ambisonics_full_chain_split(test_info, in_fmt, bitrate, render_config,
@pytest.mark.parametrize("render_config", RENDERER_CONFIGS_TO_TEST_AMBI)
@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_AMBI)
def test_ambisonics_external_split(test_info, in_fmt, render_config, trajectory):
    if "0dof_768k_lc3plus" in render_config:
        pytest.xfail("0DOF 768kbps LC3plus codec is unsupported")
    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")
@@ -80,9 +81,10 @@ def test_ambisonics_external_split(test_info, in_fmt, render_config, trajectory)
@pytest.mark.parametrize("render_config", RENDERER_CONFIGS_TO_TEST_MC)
@pytest.mark.parametrize("bitrate", IVAS_BITRATES_MC)
@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_MC[2:])
def test_multichannel_full_chain_split(test_info, in_fmt, bitrate, render_config, trajectory):
    if "0dof_768k_default" in render_config:
        pytest.xfail("0DOF 768kbps LC3plus codec is unsupported")
def test_multichannel_full_chain_split(
    test_info, in_fmt, bitrate, render_config, trajectory
):
    check_xfail(test_info, in_fmt, render_config, bitrate)

    post_trajectory = HR_TRAJECTORY_DIR.joinpath(f"{trajectory}.csv")
    pre_trajectory = post_trajectory.with_stem(f"{post_trajectory.stem}_delayed")
@@ -101,8 +103,7 @@ def test_multichannel_full_chain_split(test_info, in_fmt, bitrate, render_config
@pytest.mark.parametrize("render_config", RENDERER_CONFIGS_TO_TEST_MC)
@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_MC[2:])
def test_multichannel_external_split(test_info, in_fmt, render_config, trajectory):
    if "0dof_768k_default" in render_config:
        pytest.xfail("0DOF 768kbps LC3plus codec is unsupported")
    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")
@@ -124,10 +125,7 @@ def test_multichannel_external_split(test_info, in_fmt, render_config, trajector
@pytest.mark.parametrize("bitrate", IVAS_BITRATES_ISM)
@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_ISM)
def test_ism_full_chain_split(test_info, in_fmt, bitrate, render_config, trajectory):
    if "0dof_768k_default" in render_config:
        pytest.xfail("0DOF 768kbps LC3plus codec is unsupported")
    elif int(bitrate) > int(IVAS_MAX_ISM_BITRATE[in_fmt[-1]]):
        pytest.skip(f"Unsupported configuration with {in_fmt} at {bitrate}bps")
    check_xfail(test_info, in_fmt, render_config, bitrate)

    post_trajectory = HR_TRAJECTORY_DIR.joinpath(f"{trajectory}.csv")
    pre_trajectory = post_trajectory.with_stem(f"{post_trajectory.stem}_delayed")
@@ -146,8 +144,7 @@ def test_ism_full_chain_split(test_info, in_fmt, bitrate, render_config, traject
@pytest.mark.parametrize("render_config", RENDERER_CONFIGS_TO_TEST_ISM)
@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_ISM)
def test_ism_external_split(test_info, in_fmt, render_config, trajectory):
    if "0dof_768k_default" in render_config:
        pytest.xfail("0DOF 768kbps LC3plus codec is unsupported")
    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")
@@ -169,8 +166,7 @@ def test_ism_external_split(test_info, in_fmt, render_config, trajectory):
@pytest.mark.parametrize("bitrate", IVAS_BITRATES_MASA)
@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_MASA)
def test_masa_full_chain_split(test_info, in_fmt, bitrate, render_config, trajectory):
    if "0dof_768k_lc3plus" in render_config:
        pytest.xfail("0DOF 768kbps LC3plus codec is unsupported")
    check_xfail(test_info, in_fmt, render_config, bitrate)

    post_trajectory = HR_TRAJECTORY_DIR.joinpath(f"{trajectory}.csv")
    pre_trajectory = post_trajectory.with_stem(f"{post_trajectory.stem}_delayed")
+11 −9
Original line number Diff line number Diff line
@@ -27,15 +27,15 @@
"""

import sys
import numpy as np
from pathlib import Path
from tempfile import TemporaryDirectory
from typing import Tuple

from tests.split_rendering.constants import *
import numpy as np

from tests.renderer.utils import check_BE, run_cmd, test_info
from tests.cut_pcm import cut_samples
from tests.renderer.utils import check_BE, run_cmd, test_info
from tests.split_rendering.constants import *

sys.path.append(SCRIPTS_DIR)
from pyaudio3dtools.audiofile import readfile
@@ -80,12 +80,14 @@ def run_full_chain_split_rendering(
            in_file = FORMAT_TO_FILE_COMPARETEST[in_fmt]
            in_data, in_fs = readfile(in_file)
            if len(in_data) > INPUT_DURATION_SEC * in_fs:
                cut_samples(in_file=in_file,
                cut_samples(
                    in_file=in_file,
                    out_file=cut_in_file,
                    num_channels=FORMAT_TO_NCHAN[in_fmt],
                    sample_rate=in_fs,
                    start=0,
                            duration=INPUT_DURATION_SEC)
                    duration=INPUT_DURATION_SEC,
                )
                cmd[3] = str(cut_in_file)
            else:
                cmd[3] = str(in_file)
+1 −1

File changed.

Contains only whitespace changes.