Commit 41948d5e authored by Jan Kiene's avatar Jan Kiene
Browse files

add decoder part of minimal bitrate switching case

parent 43a9202e
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@ the United Nations Convention on Contracts on the International Sales of Goods.
import numpy as np
import pytest
from contextlib import contextmanager
from typing import Union
from pathlib import Path
from tempfile import TemporaryDirectory
import subprocess
@@ -101,7 +102,7 @@ def get_output_path(
def get_bitstream_and_options(
    testv_name,
    encoder_format,
    bitrate,
    bitrate: Union[int, str],
    input_sampling_rate,
    dtx,
    processing,
+73 −0
Original line number Diff line number Diff line
__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,
Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other
contributors to this repository. All Rights Reserved.

This software is protected by copyright law and by international treaties.
The IVAS codec Public Collaboration 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 Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other
contributors to this repository retain full ownership rights in their respective contributions in
the software. This notice grants no license of any kind, including but not limited to patent
license, nor is any license granted by implication, estoppel or otherwise.

Contributors are required to enter into the IVAS codec Public Collaboration agreement before making
contributions.

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 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.
"""

import pytest
from ..constants import *
from . import run_check, get_bitstream_and_options
from .. import get_testv_path, get_bitstream_path


@pytest.mark.parametrize("input_sampling_rate", SAMPLING_RATES_ALL)
@pytest.mark.parametrize("max_band", MAX_BAND_ALL)
@pytest.mark.parametrize("dtx", [DTX_OFF, DTX_ON])
@pytest.mark.parametrize("output_format", OUTPUT_FORMATS_ALL[:7])
@pytest.mark.parametrize("output_sampling_rate", SAMPLING_RATES_ALL)
@pytest.mark.parametrize("bitstream_processing", BITSTREAM_PROCESSING)
def test_decoder_br_switching_stereo(
    input_sampling_rate,
    max_band,
    dtx,
    output_format,
    output_sampling_rate,
    bitstream_processing,
    dut_decoder_frontend,
    update_ref,
):
    input_format = "STEREO"
    br_sw_file = BR_SW_FILE_STEREO
    testv_name = get_testv_path(input_format, input_sampling_rate).stem
    with get_bitstream_and_options(
        testv_name,
        input_format,
        br_sw_file,
        input_sampling_rate,
        dtx,
        processing=bitstream_processing,
        max_band=max_band,
    ) as (ref_bitstream, options):
        run_check(
            ref_bitstream,
            output_format,
            output_sampling_rate,
            options,
            dut_decoder_frontend,
            update_ref == 1,
            bitstream_processing=bitstream_processing,
        )
+1 −4
Original line number Diff line number Diff line
@@ -48,9 +48,6 @@ def test_encoder_br_switching_stereo(
    testv = get_testv_path(input_format, sampling_rate)
    options = get_options(input_format, max_band=max_band)
    br_sw_file = BR_SW_FILE_STEREO
    bitstream = get_bitstream_path(
        DUT_PATH, testv.stem, input_format, br_sw_file, sampling_rate, max_band, dtx
    )
    run_check(
        input_format,
        br_sw_file,
@@ -59,5 +56,5 @@ def test_encoder_br_switching_stereo(
        options,
        dut_encoder_frontend,
        update_ref == 1,
        dtx == DTX_ON,
        dtx
    )