Commit 3a334e56 authored by Jan Kiene's avatar Jan Kiene
Browse files

cleanup, formatting, comments

parent c0d849df
Loading
Loading
Loading
Loading
+12 −8
Original line number Diff line number Diff line
__copyright__ = \
"""
__copyright__ = """
(C) 2022-2023 IVAS codec Public Collaboration 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,
@@ -97,7 +96,6 @@ def apply_error_pattern_on_bitstream(
            in_bitstream = Path(tmpdir).joinpath(in_bitstream.name)

        cmd = ["eid-xor", "-vbr", "-fer", in_bitstream, error_pattern, out_bitstream]

        subprocess.run(cmd)


@@ -156,10 +154,16 @@ def run_check(

    dut_bitstream_to_decoder = dut_bitstream
    if error_pattern is not None:
        dut_bitstream_to_decoder = dut_bitstream.with_suffix(".err" + dut_bitstream.suffix)
        apply_error_pattern_on_bitstream(dut_bitstream, error_pattern, dut_bitstream_to_decoder)
        dut_bitstream_to_decoder = dut_bitstream.with_suffix(
            ".err" + dut_bitstream.suffix
        )
        apply_error_pattern_on_bitstream(
            dut_bitstream, error_pattern, dut_bitstream_to_decoder
        )

    decoder_frontend.run(output_mode, sampling_rate, dut_bitstream_to_decoder, dut_output)
    decoder_frontend.run(
        output_mode, sampling_rate, dut_bitstream_to_decoder, dut_output
    )

    # NOTE: file comparison is done via filecmp which compares the whole file, including the header for wav files
    #       this should not be a problem as both the reference and the tdut output was generated by the codec, so
+16 −7
Original line number Diff line number Diff line
__copyright__ = \
"""
__copyright__ = """
(C) 2022-2023 IVAS codec Public Collaboration 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,
@@ -34,6 +33,11 @@ from typing import Union, List


class ExperimentParams:
    """
    Class to bundle the parameters for the experiments. Main purpose is to make things more readable over
    just using a lot of lists and bundling sanitiy checks and needed utilities together.
    """

    def __init__(
        self,
        name: str,
@@ -59,6 +63,10 @@ class ExperimentParams:
        self.fer = fer

    def assemble_unified_params(self):
        """
        Create the parameter combinations for the tested operating points.
        Just passing them to pytest would give too many (and not tested) combinations, so do it here.
        """
        params = zip(self.bitrates, self.dtx, self.fer)
        return [(self.name, *p, t) for p, t in product(params, self.testsets)]

@@ -318,6 +326,8 @@ BS1534_PARAMS_MASA = [
    ),
]

# These "_UNIFIED" parameter lists are the thigns that get passed to the pytest parametrization

P800_PARAMS_UNIFIED = [
    i for sl in [p.assemble_unified_params() for p in P800_PARAMS] for i in sl
]
@@ -325,20 +335,19 @@ BS1534_PARAMS_UNIFIED = [
    i for sl in [p.assemble_unified_params() for p in BS1534_PARAMS] for i in sl
]

# for the MASA BS1534 tests everything is complicated because of categories and different numbering in them, hence the extra code here
BS1534_MASA_PARAMS = [
    i for sl in [p.assemble_unified_params() for p in BS1534_PARAMS_MASA] for i in sl
]
BS1534_MASA_PARAMS = [
    x + tuple([y]) for x, y in product(BS1534_MASA_PARAMS, ["FOA", "HOA2"])
]
BS1534_MASA_PARAMS = [x + (y,) for x, y in product(BS1534_MASA_PARAMS, ["FOA", "HOA2"])]
BS1534_MASA_PARAMS_UNIFIED = [
    x + tuple([y])
    x + (y,)
    for x, y in product(
        [p for p in BS1534_MASA_PARAMS if p[5] == "FOA"],
        range(2, 1 + BS1534_N_FILES, 2),
    )
] + [
    x + tuple([y])
    x + (y,)
    for x, y in product(
        [p for p in BS1534_MASA_PARAMS if p[5] == "HOA2"],
        range(1, 1 + BS1534_N_FILES, 2),
+1 −2
Original line number Diff line number Diff line
__copyright__ = \
"""
__copyright__ = """
(C) 2022-2023 IVAS codec Public Collaboration 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,