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

[wip] first version of split rendering pytest framework

parent b9fbb11c
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -47,10 +47,13 @@ tests/renderer/cut
tests/renderer/ref
tests/dut
tests/ref
tests/split_rendering/ref/*
tests/split_rendering/cut/*
scripts/testv/*_cut*.pcm
# default reference binary name
IVAS_cod_ref
IVAS_dec_ref
IVAS_rend_ref

# Python files that pop up when running scripts
__pycache__/
+3020 −0

File added.

Preview size limit exceeded, changes collapsed.

+2421 −0

File added.

Preview size limit exceeded, changes collapsed.

+27 −0
Original line number Diff line number Diff line
#!/usr/bin/env python3

"""
   (C) 2022-2023 Baseline Development Group with portions copyright Dolby International AB, Ericsson AB,
   Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD.,
   Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies OY, Orange,
   Panasonic Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation. All Rights Reserved.

   This software is protected by copyright law and by international treaties.
   The Baseline Development Group consisting of Dolby International AB, Ericsson AB,
   Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD.,
   Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies OY, Orange,
   Panasonic Corporation, Qualcomm Technologies, Inc., and VoiceAge Corporation retain full ownership
   rights in their respective contributions in the software. No license of any kind, including but not
   limited to patent license, of any foregoing parties is hereby granted by implication, estoppel or
   otherwise.

   This software is provided "AS IS", without any express or implied warranties. The software is in the
   development stage. It is intended exclusively for experts who have experience with such software and
   solely for the purpose of inspection. All implied warranties of non-infringement, merchantability
   and/or fitness for a particular purpose are hereby disclaimed and excluded.

   Any dispute, controversy or claim arising under or in relation to providing this software shall be
   submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in
   accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and
   the United Nations Convention on Contracts on the International Sales of Goods.
"""
+137 −0
Original line number Diff line number Diff line
#!/usr/bin/env python3

"""
   (C) 2022-2023 Baseline Development Group with portions copyright Dolby International AB, Ericsson AB,
   Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD.,
   Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies OY, Orange,
   Panasonic Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation. All Rights Reserved.

   This software is protected by copyright law and by international treaties.
   The Baseline Development Group consisting of Dolby International AB, Ericsson AB,
   Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD.,
   Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies OY, Orange,
   Panasonic Corporation, Qualcomm Technologies, Inc., and VoiceAge Corporation retain full ownership
   rights in their respective contributions in the software. No license of any kind, including but not
   limited to patent license, of any foregoing parties is hereby granted by implication, estoppel or
   otherwise.

   This software is provided "AS IS", without any express or implied warranties. The software is in the
   development stage. It is intended exclusively for experts who have experience with such software and
   solely for the purpose of inspection. All implied warranties of non-infringement, merchantability
   and/or fitness for a particular purpose are hereby disclaimed and excluded.

   Any dispute, controversy or claim arising under or in relation to providing this software shall be
   submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in
   accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and
   the United Nations Convention on Contracts on the International Sales of Goods.
"""

from pathlib import Path
import sys


""" Set up paths """
TESTS_DIR = Path(__file__).parent
RENDER_CFG_DIR = TESTS_DIR.joinpath("renderer_configs").resolve()

OUTPUT_PATH_REF = TESTS_DIR.joinpath("ref")
OUTPUT_PATH_CUT = TESTS_DIR.joinpath("cut")

SCRIPTS_DIR = TESTS_DIR.parents[1].joinpath("scripts").resolve()
CUSTOM_LAYOUT_DIR = SCRIPTS_DIR.joinpath("ls_layouts")
HR_TRAJECTORY_DIR = SCRIPTS_DIR.joinpath("trajectories")
TESTV_DIR = SCRIPTS_DIR.joinpath("testv")

BIN_SUFFIX_MERGETARGET = "_ref"

sys.path.append(TESTS_DIR)
from renderer.constants import (
    FORMAT_TO_FILE_COMPARETEST,
    FORMAT_TO_METADATA_FILES,
    INPUT_FORMATS_AMBI,
    INPUT_FORMATS_ISM,
    INPUT_FORMATS_MASA,
    INPUT_FORMATS_MC,
    CUSTOM_LS_TO_TEST,
    METADATA_SCENES_TO_TEST,
    HR_TRAJECTORIES_TO_TEST,
)

""" Renderer configurations """
RENDERER_CONFIGS_TO_TEST = [str(cfg.stem) for cfg in RENDER_CFG_DIR.glob("*.txt")]

""" IVAS format mapping """
FORMAT_TO_IVAS_COD_FORMAT = {
    "MONO": "",
    "STEREO": "-stereo",
    "ISM1": ["-ism", "1"],
    "ISM2": ["-ism", "2"],
    "ISM3": ["-ism", "3"],
    "ISM4": ["-ism", "4"],
    "5_1": ["-mc", "5_1"],
    "5_1_2": ["-mc", "5_1_2"],
    "5_1_4": ["-mc", "5_1_4"],
    "7_1": ["-mc", "7_1"],
    "7_1_4": ["-mc", "7_1_4"],
    "FOA": ["-sba", "1"],
    "HOA2": ["-sba", "2"],
    "HOA3": ["-sba", "3"],
}

""" Encoder commandline template """
SPLIT_PRE_COD_CMD = [
    str(TESTS_DIR.parent.parent.joinpath("IVAS_cod")),
    "512000",
    "48",
    "",  # 3 -> input file
    "",  # 4 -> output bitstream
]

""" Split-pre Decoder commandline template """
SPLIT_PRE_DEC_CMD = [
    str(TESTS_DIR.parent.parent.joinpath("IVAS_dec")),
    "-T",
    "",  # 2 -> pre-trajectory file
    "-render_config",
    "",  # 4 -> render config file
    "BINAURAL_SPLIT_CLDFB",
    "48",
    "",  # 7 -> encoder bitstream
    "",  # 8 -> split rendering bitstream
]

""" Split-pre Renderer commandline template """
SPLIT_PRE_REND_CMD = [
    str(TESTS_DIR.parent.parent.joinpath("IVAS_rend")),
    "-fs",
    "48",
    "-render_config",
    "",  # 4 -> render config file
    "-i",
    "",  # 6 -> input file
    "-if",
    "",  # 8 -> input format
    "-o",
    "BINAURAL_SPLIT_CLDFB",
    "-of",
    "",  # 10 -> split rendering bitstream
    "-tf",
    "",  # 12 -> post-trajectory file
]

""" Split-post Renderer commandline template """
SPLIT_POST_REND_CMD = [
    str(TESTS_DIR.parent.parent.joinpath("IVAS_rend")),
    "-fs",
    "48",
    "-i",
    "",  # 4 -> split rendering bitstream
    "-if",
    "BINAURAL_SPLIT_CLDFB",
    "-o",
    "",  # 8 -> output file
    "-of",
    "BINAURAL",
    "-tf",
    "",  # 12 -> post-trajectory file
]
Loading