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

[fix] update validation function and add xfails to pytest accordingly

parent 7b4a8cbe
Loading
Loading
Loading
Loading
Loading
+21 −6
Original line number Diff line number Diff line
@@ -597,16 +597,31 @@ ivas_error ivas_split_rend_validate_config( const IVAS_SPLIT_REND_CONFIG_DATA *p
        switch ( pSplitRendConfig->splitRendBitRate )
        {
            case SPLIT_REND_256k:
            case SPLIT_REND_384k:
            case SPLIT_REND_512k:
            case SPLIT_REND_768k:
                /* Always valid */
                if ( pSplitRendConfig->codec == IVAS_SPLIT_REND_CODEC_LCLD )
                {
                    return IVAS_ERROR( IVAS_ERR_INVALID_SPLIT_REND_CONFIG, "Unsupported bitrate for LCLD codec" );
                }

                if ( pSplitRendConfig->dof != 0 )
                {
                    return IVAS_ERROR( IVAS_ERR_INVALID_SPLIT_REND_CONFIG, "bitrates below 320 kbps are only valid with 0 DOF" );
                }
                break;
            case SPLIT_REND_320k:
                /* Only valid with 0 DOF */
                if ( pSplitRendConfig->dof != 0 )
                {
                    return IVAS_ERROR( IVAS_ERR_INVALID_SPLIT_REND_CONFIG, "bitrates below 320 kpbs are only valid with 0 DOF" );
                    return IVAS_ERROR( IVAS_ERR_INVALID_SPLIT_REND_CONFIG, "bitrates below 320 kbps are only valid with 0 DOF" );
                }
                break;
            case SPLIT_REND_384k:
            case SPLIT_REND_512k:
                /* Always valid */
                break;
            case SPLIT_REND_768k:
                if ( pSplitRendConfig->dof == 0 && pSplitRendConfig->codec == IVAS_SPLIT_REND_CODEC_LC3PLUS )
                {
                    return IVAS_ERROR( IVAS_ERR_INVALID_SPLIT_REND_CONFIG, "Bitrate is too high for LC3plus with 0 DOF" );
                }
                break;
#ifdef SPLIT_REND_TD_POSE_CORRECTION
@@ -615,7 +630,7 @@ ivas_error ivas_split_rend_validate_config( const IVAS_SPLIT_REND_CONFIG_DATA *p
                /* Only valid with IVAS_SPLIT_REND_POSE_CORRECTION_MODE_TD */
                if ( pSplitRendConfig->poseCorrectionMode != IVAS_SPLIT_REND_POSE_CORRECTION_MODE_TD )
                {
                    return IVAS_ERROR( IVAS_ERR_INVALID_SPLIT_REND_CONFIG, "Invalid bitrate for MSPC" );
                    return IVAS_ERROR( IVAS_ERR_INVALID_SPLIT_REND_CONFIG, "Bitrate only supported with Multi-Stream Pose Correction!" );
                }
                break;
#endif
+13 −0
Original line number Diff line number Diff line
@@ -30,6 +30,13 @@ import pytest

from tests.split_rendering.utils import *

def check_xfail(in_fmt, render_config):
    if "0dof" in render_config and "768k" in render_config:
        pytest.xfail("Bitrate is too high for default codec selection of LC3plus with 0DOF")
    
    if "256k" in render_config and in_fmt in INPUT_FORMATS_AMBI:
        pytest.xfail("Unsupported bitrate for LCLD codec")
    
""" Ambisonics """


@@ -37,6 +44,7 @@ from tests.split_rendering.utils import *
@pytest.mark.parametrize("render_config", RENDERER_CONFIGS_TO_TEST)
@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_AMBI)
def test_ambisonics_full_chain_split(test_info, in_fmt, render_config, trajectory):
    check_xfail(in_fmt, render_config)

    post_trajectory = HR_TRAJECTORY_DIR.joinpath(f"{trajectory}.csv")
    pre_trajectory = post_trajectory.with_stem(f"{post_trajectory.stem}_delayed")
@@ -54,6 +62,7 @@ def test_ambisonics_full_chain_split(test_info, in_fmt, render_config, trajector
@pytest.mark.parametrize("render_config", RENDERER_CONFIGS_TO_TEST)
@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_AMBI)
def test_ambisonics_external_split(test_info, in_fmt, render_config, trajectory):
    check_xfail(in_fmt, render_config)

    post_trajectory = HR_TRAJECTORY_DIR.joinpath(f"{trajectory}.csv")
    pre_trajectory = post_trajectory.with_stem(f"{post_trajectory.stem}_delayed")
@@ -74,6 +83,7 @@ def test_ambisonics_external_split(test_info, in_fmt, render_config, trajectory)
@pytest.mark.parametrize("render_config", RENDERER_CONFIGS_TO_TEST)
@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_MC[2:])
def test_multichannel_full_chain_split(test_info, in_fmt, render_config, trajectory):
    check_xfail(in_fmt, render_config)

    post_trajectory = HR_TRAJECTORY_DIR.joinpath(f"{trajectory}.csv")
    pre_trajectory = post_trajectory.with_stem(f"{post_trajectory.stem}_delayed")
@@ -91,6 +101,7 @@ def test_multichannel_full_chain_split(test_info, in_fmt, render_config, traject
@pytest.mark.parametrize("render_config", RENDERER_CONFIGS_TO_TEST)
@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_MC[2:])
def test_multichannel_external_split(test_info, in_fmt, render_config, trajectory):
    check_xfail(in_fmt, render_config)

    post_trajectory = HR_TRAJECTORY_DIR.joinpath(f"{trajectory}.csv")
    pre_trajectory = post_trajectory.with_stem(f"{post_trajectory.stem}_delayed")
@@ -111,6 +122,7 @@ def test_multichannel_external_split(test_info, in_fmt, render_config, trajector
@pytest.mark.parametrize("render_config", RENDERER_CONFIGS_TO_TEST)
@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_ISM)
def test_ism_full_chain_split(test_info, in_fmt, render_config, trajectory):
    check_xfail(in_fmt, render_config)

    post_trajectory = HR_TRAJECTORY_DIR.joinpath(f"{trajectory}.csv")
    pre_trajectory = post_trajectory.with_stem(f"{post_trajectory.stem}_delayed")
@@ -128,6 +140,7 @@ def test_ism_full_chain_split(test_info, in_fmt, render_config, trajectory):
@pytest.mark.parametrize("render_config", RENDERER_CONFIGS_TO_TEST)
@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_ISM)
def test_ism_external_split(test_info, in_fmt, render_config, trajectory):
    check_xfail(in_fmt, render_config)

    post_trajectory = HR_TRAJECTORY_DIR.joinpath(f"{trajectory}.csv")
    pre_trajectory = post_trajectory.with_stem(f"{post_trajectory.stem}_delayed")