Commit f2f521a9 authored by kinuthia's avatar kinuthia
Browse files

split head rotation test cases into 3 files

parent a62f0c79
Loading
Loading
Loading
Loading
+29 −10
Original line number Diff line number Diff line
@@ -1162,6 +1162,33 @@ test-be-to-release:
    - echo ($tmp -split -split 'timestamp="')[0]
    - cp report-enc-const_br.html $BE_LOGS/report-enc-const_br--sha-$CI_COMMIT_SHORT_SHA.html

    # decoder, head_rot_binaural
    - $zero_errors_dec_head_rot_binaural=0
    - ("& python -m pytest .\tests\codec_be_to_accepted_release\decoder\test_decoder_head_rotation_binaural.py --update_ref 1 --html=report-dec-head_rot_binaural.html --self-contained-html --junit-xml=logs/report-junit-dec-head_rot_binaural.xml --testcase_timeout 40 -n $NPROC | out-null") | Invoke-Expression
    - IF (!(Select-String logs/report-junit-dec-head_rot_binaural.xml -Pattern 'errors="0"')){$zero_errors_dec_head_rot_binaural=1; echo "Errors encountered"}

    - $tmp=((Get-content logs/report-junit-dec-head_rot_binaural.xml) -split 'name="pytest" ')[1]
    - echo ($tmp -split -split 'timestamp="')[0]
    - cp report-dec-head_rot_binaural.html $BE_LOGS/report-dec-head_rot_binaural--sha-$CI_COMMIT_SHORT_SHA.html

    # decoder, head_rot_binaural_room_ir
    - $zero_errors_dec_head_rot_binaural_room_ir=0
    - ("& python -m pytest .\tests\codec_be_to_accepted_release\decoder\test_decoder_head_rotation_binaural_room_ir.py --update_ref 1 --html=report-dec-head_rot_binaural_room_ir.html --self-contained-html --junit-xml=logs/report-junit-dec-head_rot_binaural_room_ir.xml --testcase_timeout 40 -n $NPROC | out-null") | Invoke-Expression
    - IF (!(Select-String logs/report-junit-dec-head_rot_binaural_room_ir.xml -Pattern 'errors="0"')){$zero_errors_dec_head_rot_binaural_room_ir=1; echo "Errors encountered"}

    - $tmp=((Get-content logs/report-junit-dec-head_rot_binaural_room_ir.xml) -split 'name="pytest" ')[1]
    - echo ($tmp -split -split 'timestamp="')[0]
    - cp report-dec-head_rot_binaura_room_ir.html $BE_LOGS/report-dec-head_rot_binaural_room_ir--sha-$CI_COMMIT_SHORT_SHA.html

    # decoder, head_rot_binaural_room_reverb
    - $zero_errors_dec_head_rot_binaural_room_reverb=0
    - ("& python -m pytest .\tests\codec_be_to_accepted_release\decoder\test_decoder_head_rotation_binaural_room_reverb.py --update_ref 1 --html=report-dec-head_rot_binaural_room_reverb.html --self-contained-html --junit-xml=logs/report-junit-dec-head_rot_binaural_room_reverb.xml --testcase_timeout 40 -n $NPROC | out-null") | Invoke-Expression
    - IF (!(Select-String logs/report-junit-dec-head_rot_binaural_room_reverb.xml -Pattern 'errors="0"')){$zero_errors_dec_head_rot_binaural_room_reverb=1; echo "Errors encountered"}

    - $tmp=((Get-content logs/report-junit-dec-head_rot_binaural_room_reverb.xml) -split 'name="pytest" ')[1]
    - echo ($tmp -split -split 'timestamp="')[0]
    - cp report-dec-head_rot_binaura_room_reverb.html $BE_LOGS/report-dec-head_rot_binaural_room_reverb--sha-$CI_COMMIT_SHORT_SHA.html

    # decoder, no-binaural, constant brate
    - $zero_errors_dec_const_br_no_binaural=0
    - ("& python -m pytest .\tests\codec_be_to_accepted_release\decoder\test_decoder_constant_bitrate_no_binaural.py --update_ref 1 --html=report-dec-const_br-no_binaural.html --self-contained-html --junit-xml=logs/report-junit-dec-const_br-no_binaural.xml --testcase_timeout 40 -n $NPROC | out-null") | Invoke-Expression
@@ -1180,15 +1207,6 @@ test-be-to-release:
    - echo ($tmp -split -split 'timestamp="')[0]
    - cp report-dec-const_br-binaural.html $BE_LOGS/report-dec-const_br-binaural--sha-$CI_COMMIT_SHORT_SHA.html

    # decoder, head_rot
    - $zero_errors_dec_head_rot=0
    - ("& python -m pytest .\tests\codec_be_to_accepted_release\decoder\test_decoder_head_rotation.py --update_ref 1 --html=report-dec-head_rot.html --self-contained-html --junit-xml=logs/report-junit-dec-head_rot.xml --testcase_timeout 40 -n $NPROC | out-null") | Invoke-Expression
    - IF (!(Select-String logs/report-junit-dec-head_rot.xml -Pattern 'errors="0"')){$zero_errors_dec_head_rot=1; echo "Errors encountered"}

    - $tmp=((Get-content logs/report-junit-dec-head_rot.xml) -split 'name="pytest" ')[1]
    - echo ($tmp -split -split 'timestamp="')[0]
    - cp report-dec-head_rot.html $BE_LOGS/report-dec-head_rot--sha-$CI_COMMIT_SHORT_SHA.html

    # decoder, non-diegetic
    - $zero_errors_dec_non_diegetic=0
    - ("& python -m pytest .\tests\codec_be_to_accepted_release\decoder\test_decoder_non_diegetic_pan.py --update_ref 1 --html=report-dec-non_diegetic.html --self-contained-html --junit-xml=logs/report-junit-dec-non_diegetic.xml --testcase_timeout 40 -n $NPROC | out-null") | Invoke-Expression
@@ -1207,8 +1225,9 @@ test-be-to-release:
    - echo ($tmp -split -split 'timestamp="')[0]
    - cp report-dec-render_conf.html $BE_LOGS/report-dec-render_conf--sha-$CI_COMMIT_SHORT_SHA.html

    - IF($zero_errors_dec_head_rot_binaural -ne 0 -or $zero_errors_dec_head_rot_binaural_room_ir -ne 0 -or $zero_errors_dec_head_rot_binaural_room_reverb -ne 0 ) {echo "Errors encountered"; exit $EXIT_CODE_FAIL}
    - IF($zero_errors_enc_const_br -ne 0 -or $zero_errors_dec_const_br_no_binaural -ne 0 -or $zero_errors_dec_const_br_binaural -ne 0 ) {echo "Errors encountered"; exit $EXIT_CODE_FAIL}
    - IF($zero_errors_dec_head_rot -ne 0 -or $zero_errors_dec_non_diegetic -ne 0 -or $zero_errors_dec_render_conf -ne 0 ) {echo "Errors encountered"; exit $EXIT_CODE_FAIL}
    - IF($zero_errors_dec_non_diegetic -ne 0 -or $zero_errors_dec_render_conf -ne 0 ) {echo "Errors encountered"; exit $EXIT_CODE_FAIL}

  artifacts:
    name: "test-be-to-release--sha-$CI_COMMIT_SHORT_SHA--results"
+108 −0
Original line number Diff line number Diff line
@@ -537,3 +537,111 @@ DECODER_CONST_BR_BINAURAL_COMBINED_PARAMS = collapse_into_list_of_pairs(
        BITSTREAM_PROCESSING,
    )
)

# split test cases with head rotation further to [BINAURAL, BINAURAL_ROOM_IR, BINAURAL_ROOM_REVERB]

DECODER_CONST_BR_BINAURAL_MC_AND_MASA_BINAURAL = collapse_into_list_of_pairs(
    product(
        MC_PARAMS,
        OUTPUT_FORMATS_BINAURAL[0],
        SAMPLING_RATES_ALL,
        BITSTREAM_PROCESSING,
    )
) + collapse_into_list_of_pairs(
    product(
        MASA_PARAMS,
        OUTPUT_FORMATS_BINAURAL[0],
        SAMPLING_RATES_ALL,
        BITSTREAM_PROCESSING,
    )
)
DECODER_CONST_BR_BINAURAL_OBJECTBASED_BINAURAL = collapse_into_list_of_pairs(
    product(
        ISM_PARAMS, OUTPUT_FORMATS_BINAURAL[0], SAMPLING_RATES_ALL, BITSTREAM_PROCESSING
    )
)
DECODER_CONST_BR_BINAURAL_SCENEBASED_BINAURAL = collapse_into_list_of_pairs(
    product(
        SBA_PARAMS, OUTPUT_FORMATS_BINAURAL[0], SAMPLING_RATES_ALL, BITSTREAM_PROCESSING
    )
)
DECODER_CONST_BR_BINAURAL_COMBINED_PARAMS_BINAURAL = collapse_into_list_of_pairs(
    product(
        COMBINED_FORMATS_PARAMS,
        OUTPUT_FORMATS_BINAURAL[0],
        SAMPLING_RATES_ALL,
        BITSTREAM_PROCESSING,
    )
)

# [BINAURAL_ROOM_IR]

DECODER_CONST_BR_BINAURAL_MC_AND_MASA_BINAURAL_ROOM_IR = collapse_into_list_of_pairs(
    product(
        MC_PARAMS,
        OUTPUT_FORMATS_BINAURAL[1],
        SAMPLING_RATES_ALL,
        BITSTREAM_PROCESSING,
    )
) + collapse_into_list_of_pairs(
    product(
        MASA_PARAMS,
        OUTPUT_FORMATS_BINAURAL[1],
        SAMPLING_RATES_ALL,
        BITSTREAM_PROCESSING,
    )
)
DECODER_CONST_BR_BINAURAL_OBJECTBASED_BINAURAL_ROOM_IR = collapse_into_list_of_pairs(
    product(
        ISM_PARAMS, OUTPUT_FORMATS_BINAURAL[1], SAMPLING_RATES_ALL, BITSTREAM_PROCESSING
    )
)
DECODER_CONST_BR_BINAURAL_SCENEBASED_BINAURAL_ROOM_IR = collapse_into_list_of_pairs(
    product(
        SBA_PARAMS, OUTPUT_FORMATS_BINAURAL[1], SAMPLING_RATES_ALL, BITSTREAM_PROCESSING
    )
)
DECODER_CONST_BR_BINAURAL_COMBINED_PARAMS_BINAURAL_ROOM_IR = collapse_into_list_of_pairs(
    product(
        COMBINED_FORMATS_PARAMS,
        OUTPUT_FORMATS_BINAURAL[1],
        SAMPLING_RATES_ALL,
        BITSTREAM_PROCESSING,
    )
)

# [BINAURAL_ROOM_REVERB]

DECODER_CONST_BR_BINAURAL_MC_AND_MASA_BINAURAL_ROOM_REVERB = collapse_into_list_of_pairs(
    product(
        MC_PARAMS,
        OUTPUT_FORMATS_BINAURAL[2],
        SAMPLING_RATES_ALL,
        BITSTREAM_PROCESSING,
    )
) + collapse_into_list_of_pairs(
    product(
        MASA_PARAMS,
        OUTPUT_FORMATS_BINAURAL[2],
        SAMPLING_RATES_ALL,
        BITSTREAM_PROCESSING,
    )
)
DECODER_CONST_BR_BINAURAL_OBJECTBASED_BINAURAL_ROOM_REVERB = collapse_into_list_of_pairs(
    product(
        ISM_PARAMS, OUTPUT_FORMATS_BINAURAL[2], SAMPLING_RATES_ALL, BITSTREAM_PROCESSING
    )
)
DECODER_CONST_BR_BINAURAL_SCENEBASED_BINAURAL_ROOM_REVERB = collapse_into_list_of_pairs(
    product(
        SBA_PARAMS, OUTPUT_FORMATS_BINAURAL[2], SAMPLING_RATES_ALL, BITSTREAM_PROCESSING
    )
)
DECODER_CONST_BR_BINAURAL_COMBINED_PARAMS_BINAURAL_ROOM_REVERB = collapse_into_list_of_pairs(
    product(
        COMBINED_FORMATS_PARAMS,
        OUTPUT_FORMATS_BINAURAL[2],
        SAMPLING_RATES_ALL,
        BITSTREAM_PROCESSING,
    )
)
+4 −4
Original line number Diff line number Diff line
@@ -44,7 +44,7 @@ def pytest_generate_tests(metafunc):
@pytest.mark.parametrize("otr_mode", OTR_PARAMS)
@pytest.mark.parametrize(
    "input_format,bitrate,dtx,output_format,output_sampling_rate,bitstream_processing",
    DECODER_CONST_BR_BINAURAL_MC_AND_MASA,
    DECODER_CONST_BR_BINAURAL_MC_AND_MASA_BINAURAL,
)
def test_decoder_hr_mc_and_masa(
    input_format,
@@ -90,7 +90,7 @@ def test_decoder_hr_mc_and_masa(
@pytest.mark.parametrize("otr_mode", OTR_PARAMS)
@pytest.mark.parametrize(
    "input_format,bitrate,dtx,md_type,output_format,output_sampling_rate,bitstream_processing",
    DECODER_CONST_BR_BINAURAL_OBJECTBASED,
    DECODER_CONST_BR_BINAURAL_OBJECTBASED_BINAURAL,
)
def test_decoder_hr_objectbased(
    input_format,
@@ -141,7 +141,7 @@ def test_decoder_hr_objectbased(
@pytest.mark.parametrize("otr_mode", OTR_PARAMS)
@pytest.mark.parametrize(
    "input_format,bitrate,dtx,pca,output_format,output_sampling_rate,bitstream_processing",
    DECODER_CONST_BR_BINAURAL_SCENEBASED,
    DECODER_CONST_BR_BINAURAL_SCENEBASED_BINAURAL,
)
def test_decoder_hr_scenebased(
    input_format,
@@ -190,7 +190,7 @@ def test_decoder_hr_scenebased(
@pytest.mark.parametrize("otr_mode", OTR_PARAMS)
@pytest.mark.parametrize(
    "input_format_ism,input_format_other,bitrate,md_type,output_format,output_sampling_rate,bitstream_processing",
    DECODER_CONST_BR_BINAURAL_COMBINED_PARAMS,
    DECODER_CONST_BR_BINAURAL_COMBINED_PARAMS_BINAURAL,
)
def test_decoder_hr_combined_formats(
    input_format_ism,
+241 −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 . import get_bitstream_and_options, run_check
from .. import get_testv_path, get_valid_fs_max_band_pairs
from ..constants import *


def pytest_generate_tests(metafunc):
    # NOTE: this excludes narrow-band modes for stereo_dmx_evs as those are not really IVAS but EVS and implementation is complicated...
    fs_mb_params = get_valid_fs_max_band_pairs()
    metafunc.parametrize("input_sampling_rate,max_band", fs_mb_params)


@pytest.mark.parametrize("exof", EXOF_PARAMS)
@pytest.mark.parametrize("otr_mode", OTR_PARAMS)
@pytest.mark.parametrize(
    "input_format,bitrate,dtx,output_format,output_sampling_rate,bitstream_processing",
    DECODER_CONST_BR_BINAURAL_MC_AND_MASA_BINAURAL_ROOM_IR,
)
def test_decoder_hr_mc_and_masa(
    input_format,
    bitrate,
    input_sampling_rate,
    max_band,
    dtx,
    output_format,
    output_sampling_rate,
    bitstream_processing,
    otr_mode,
    exof,
    dut_decoder_frontend,
    update_ref,
):
    testv_name = get_testv_path(input_format, input_sampling_rate).stem
    with get_bitstream_and_options(
        testv_name,
        input_format,
        bitrate,
        input_sampling_rate,
        dtx,
        processing=bitstream_processing,
        otr_mode=otr_mode,
        exof=exof,
        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,
            output_suffix=f"{otr_mode}-{exof}",
        )


# NOTE: md_type probably does not need to be exhaustively tested in combination with OTR
# NOTE: same for FER/JBM
@pytest.mark.parametrize("exof", EXOF_PARAMS)
@pytest.mark.parametrize("otr_mode", OTR_PARAMS)
@pytest.mark.parametrize(
    "input_format,bitrate,dtx,md_type,output_format,output_sampling_rate,bitstream_processing",
    DECODER_CONST_BR_BINAURAL_OBJECTBASED_BINAURAL_ROOM_IR,
)
def test_decoder_hr_objectbased(
    input_format,
    bitrate,
    input_sampling_rate,
    max_band,
    dtx,
    md_type,
    output_format,
    output_sampling_rate,
    bitstream_processing,
    otr_mode,
    exof,
    dut_decoder_frontend,
    update_ref,
):
    testv_name = get_testv_path(input_format, input_sampling_rate).stem
    suffix = "_basic_MD"
    if md_type == ISM_MD_EXTENDED:
        suffix = "_ext_MD"
    elif md_type == ISM_MD_NULL:
        suffix = "_null_MD"
    with get_bitstream_and_options(
        testv_name,
        input_format,
        bitrate,
        input_sampling_rate,
        dtx,
        suffix=suffix,
        processing=bitstream_processing,
        otr_mode=otr_mode,
        exof=exof,
        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,
            output_suffix=f"{otr_mode}-{exof}",
        )


@pytest.mark.parametrize("exof", EXOF_PARAMS)
@pytest.mark.parametrize("otr_mode", OTR_PARAMS)
@pytest.mark.parametrize(
    "input_format,bitrate,dtx,pca,output_format,output_sampling_rate,bitstream_processing",
    DECODER_CONST_BR_BINAURAL_SCENEBASED_BINAURAL_ROOM_IR,
)
def test_decoder_hr_scenebased(
    input_format,
    bitrate,
    input_sampling_rate,
    max_band,
    dtx,
    pca,
    output_format,
    output_sampling_rate,
    bitstream_processing,
    otr_mode,
    exof,
    dut_decoder_frontend,
    update_ref,
):
    testv_name = get_testv_path(input_format, input_sampling_rate).stem
    suffix = ""
    if pca == SBA_FOA_PCA_ON:
        suffix += "-pca"
    with get_bitstream_and_options(
        testv_name,
        input_format,
        bitrate,
        input_sampling_rate,
        dtx,
        suffix=suffix,
        processing=bitstream_processing,
        otr_mode=otr_mode,
        exof=exof,
        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,
            output_suffix=f"{otr_mode}-{exof}",
        )


@pytest.mark.parametrize("exof", EXOF_PARAMS)
@pytest.mark.parametrize("otr_mode", OTR_PARAMS)
@pytest.mark.parametrize(
    "input_format_ism,input_format_other,bitrate,md_type,output_format,output_sampling_rate,bitstream_processing",
    DECODER_CONST_BR_BINAURAL_COMBINED_PARAMS_BINAURAL_ROOM_IR,
)
def test_decoder_hr_combined_formats(
    input_format_ism,
    input_format_other,
    bitrate,
    input_sampling_rate,
    max_band,
    md_type,
    output_format,
    output_sampling_rate,
    bitstream_processing,
    otr_mode,
    exof,
    dut_decoder_frontend,
    update_ref,
):
    input_format_combined = "OMASA" if "MASA" in input_format_other else "OSBA"
    testv_name = get_testv_path(
        f"{input_format_combined}_{input_format_ism}_{input_format_other}",
        input_sampling_rate,
    ).stem
    suffix = "_basic_MD"
    if md_type == ISM_MD_EXTENDED:
        suffix = "_ext_MD"
    elif md_type == ISM_MD_NULL:
        suffix = "_null_MD"
    with get_bitstream_and_options(
        testv_name,
        input_format_combined,
        bitrate,
        input_sampling_rate,
        DTX_OFF,
        suffix=suffix,
        processing=bitstream_processing,
        otr_mode=otr_mode,
        exof=exof,
        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,
            output_suffix=f"{otr_mode}-{exof}",
        )
+241 −0

File added.

Preview size limit exceeded, changes collapsed.