Commit c62f01d1 authored by Tapani Pihlajakuja's avatar Tapani Pihlajakuja
Browse files

Fix if-checks and reduce more.

parent 17bf5aff
Loading
Loading
Loading
Loading
Loading
+128 −39
Original line number Diff line number Diff line
@@ -82,13 +82,24 @@ def test_ambisonics(
    get_odg_bin,
    split_comparison,
):
    if in_fmt == "HOA2" and out_fmt != "5_1" and frame_size != "20ms" and fs != "48kHz":
    if in_fmt == "HOA2":
        if out_fmt != "5_1":
            pytest.skip()
        if frame_size != "20ms":
            pytest.skip()
        if fs != "48kHz":
            pytest.skip()

    if in_fmt == "FOA" and frame_size != "5ms" and fs != "32kHz":
    if in_fmt == "FOA":
        if frame_size != "5ms":
            pytest.skip()
        if fs != "32kHz":
            pytest.skip()

    if in_fmt == "HOA3" and frame_size != "20ms" and fs == "32kHz":
    if in_fmt == "HOA3":
        if frame_size != "20ms": 
            pytest.skip()    
        if fs == "32kHz":
            pytest.skip()

    run_renderer(
@@ -128,7 +139,13 @@ def test_ambisonics_binaural_static(
    get_odg_bin,
    split_comparison,
):
    if in_fmt != "FOA" and frame_size != "20ms" and fs != "48kHz":
    if in_fmt != "HOA2":
        pytest.skip()

    if frame_size != "20ms":
        pytest.skip()

    if fs != "48kHz":
        pytest.skip()

    run_renderer(
@@ -309,7 +326,12 @@ def test_multichannel(
    get_odg_bin,
    split_comparison,
):
    if in_fmt in [ ["MONO", "5_1", "5_1_2", "5_1_4", "7_1"]] and frame_size != "20ms" and fs != "48kHz" and out_fmt not in ["STEREO","FOA","7_1_4"]:
    if in_fmt in [ ["MONO", "5_1", "5_1_2", "5_1_4", "7_1"]]:
        if frame_size != "20ms":
            pytest.skip();
        if fs != "48kHz":
            pytest.skip();
        if out_fmt not in ["STEREO","FOA","7_1_4"]:
            pytest.skip();
    
    if in_fmt == "STEREO" and frame_size != "5ms":
@@ -357,7 +379,10 @@ def test_multichannel_binaural_static(
    if in_fmt in ["MONO", "STEREO"]:
        pytest.skip("MONO or STEREO to Binaural rendering unsupported")

    if fs != "48kHz" or frame_size != "20ms":
    if fs != "48kHz": 
        pytest.skip()

    if frame_size != "20ms":
        pytest.skip()
    
    if in_fmt not in ["5_1, 7_1_4"]:
@@ -456,10 +481,21 @@ def test_ism(
    get_odg_bin,
    split_comparison,
):
    if in_fmt != "ISM4" and frame_size != "20ms" and fs != "48kHz" and out_fmt not in ["STEREO", "5_1"]:
    if in_fmt != "ISM4":
        if frame_size != "20ms":
            pytest.skip()
        if fs != "48kHz":
            pytest.skip()
        if out_fmt not in ["STEREO", "5_1"]:
            pytest.skip()

    # Run everything for ISM4
    if out_fmt not in ["HOA3","5_1_2"]:
        if frame_size != "5ms":
            pytest.skip()
        if fs != "32kHz":
            pytest.skip()

    # Run almost everything for ISM4

    run_renderer(
        record_property,
@@ -498,7 +534,16 @@ def test_ism_binaural_static(
    get_odg_bin,
    split_comparison,
):
    if in_fmt != "ISM4" and frame_size != "20ms" and fs != "48kHz":
    if in_fmt != "ISM4":
        if frame_size != "20ms":
            pytest.skip()
        if fs != "48kHz":
            pytest.skip()

    if fs == "32kHz" and frame_size == "5ms":
        pytest.skip()

    if fs == "16kHz" and frame_size == "20ms":
        pytest.skip()

    # Run everything for ISM4
@@ -542,7 +587,10 @@ def test_ism_binaural_headrotation(
    get_odg_bin,
    split_comparison,
):
    if in_fmt != "ISM4" and frame_size != "5ms" and fs != "32kHz":
    if in_fmt != "ISM4":
        if frame_size != "5ms":
            pytest.skip()
        if fs != "32kHz":
            pytest.skip()

    # Run everything for ISM4
@@ -597,7 +645,11 @@ def test_masa(
    if fs in ["16kHz", "32kHz"] and frame_size == "5ms":
        pytest.skip()

    # fs == 48 tests everything
    if out_fmt in ["5_1_2", "5_1_4", "7_1", "HOA2", "HOA3"] and frame_size != "20ms" and in_fmt == "MASA1":
        pytest.skip()

    if out_fmt in ["5_1_2", "7_1_4", "5_1", "FOA"] and frame_size != "20ms" and in_fmt == "MASA2":
        pytest.skip()

    run_renderer(
        record_property,
@@ -803,7 +855,12 @@ def test_omasa(
    get_odg_bin,
    split_comparison,
):
    if in_fmt != "ISM4MASA2" and fs != "48kHz" and frame_size != "20ms" and out_fmt not in ["STEREO", "5_1"]:
    if in_fmt != "ISM4MASA2":
        if fs != "48kHz":
            pytest.skip()
        if frame_size != "20ms":
            pytest.skip()
        if out_fmt not in ["STEREO", "5_1"]:
            pytest.skip()

    # Test all for ISM4MASA2
@@ -845,7 +902,10 @@ def test_omasa_binaural_static(
    get_odg_bin,
    split_comparison,
):
    if in_fmt != "ISM4MASA2" and fs != "48kHz" and frame_size != "20ms":
    if in_fmt != "ISM4MASA2":
        if fs != "48kHz":
            pytest.skip()
        if frame_size != "20ms":
            pytest.skip()

    # Test all for ISM4MASA2
@@ -889,7 +949,10 @@ def test_omasa_binaural_headrotation(
    get_odg_bin,
    split_comparison,
):
    if in_fmt not in ["ISM1MASA1", "ISM2MASA2", "ISM4MASA2"] and fs != "48kHz" and frame_size != "20ms":
    if in_fmt not in ["ISM1MASA1", "ISM2MASA2", "ISM4MASA2"]:
        if fs != "48kHz":
            pytest.skip()
        if frame_size != "20ms":
            pytest.skip()

    # Test all for ["ISM1MASA1", "ISM2MASA2", "ISM4MASA2"]
@@ -935,7 +998,12 @@ def test_osba(
    get_odg_bin,
    split_comparison,
):
    if in_fmt != "ISM4SBA3" and fs != "48kHz" and frame_size != "20ms" and out_fmt not in ["HOA3", "5_1"]:
    if in_fmt != "ISM4SBA3":
        if fs != "48kHz":
            pytest.skip()
        if frame_size != "20ms":
            pytest.skip()
        if out_fmt not in ["HOA3", "5_1"]:
            pytest.skip()

    # Test all for ISM4SBA3
@@ -977,7 +1045,10 @@ def test_osba_binaural_static(
    get_odg_bin,
    split_comparison,
):
    if in_fmt != "ISM4SBA3" and fs != 48 and frame_size != "20ms":
    if in_fmt != "ISM4SBA3":
        if fs != "48kHz":
            pytest.skip()
        if frame_size != "20ms":
            pytest.skip()

    # Test all for ISM4SBA3
@@ -1021,7 +1092,10 @@ def test_osba_binaural_headrotation(
    get_odg_bin,
    split_comparison,
):
    if in_fmt not in ["ISM1SBA1", "ISM2SBA2", "ISM4SBA3"] and fs != "48kHz" and frame_size != "20ms":
    if in_fmt not in ["ISM1SBA1", "ISM2SBA2", "ISM4SBA3"]:
        if fs != "48kHz":
            pytest.skip()
        if frame_size != "20ms":
            pytest.skip()

    # Test all for ["ISM1SBA1", "ISM2SBA2", "ISM4SBA3"]
@@ -1067,10 +1141,13 @@ def test_custom_ls_input(
    get_odg_bin,
    split_comparison,
):
    if out_fmt not in ["7_1, FOA, STEREO"] and fs != "48kHz" and frame_size != "20ms":
    if out_fmt not in ["7_1, FOA, STEREO"]:
        if fs != "48kHz":
            pytest.skip()
        if frame_size != "20ms":
            pytest.skip()

    # Test everything for fs 48 and 20ms framing
    # Test rest

    run_renderer(
        record_property,
@@ -1120,6 +1197,9 @@ def test_custom_ls_output(
    if in_fmt not in ["HOA3", "MONO", "STEREO", "5_1", "7_1_4", "MASA1", "MASA2", "ISM4", "ISM4MASA2", "ISM4SBA3"]:
        pytest.skip()

    if out_fmt == "t_design_4" and fs != "48kHz":
        pytest.skip()

    run_renderer(
        record_property,
        props_to_record,
@@ -1190,7 +1270,7 @@ def test_custom_ls_input_binaural(
    get_odg_bin,
    split_comparison,
):
    if fs != 48 or frame_size != "20ms":
    if fs != "48kHz" or frame_size != "20ms":
        pytest.skip()

    run_renderer(
@@ -1232,10 +1312,10 @@ def test_custom_ls_input_binaural_headrotation(
    get_odg_bin,
    split_comparison,
):
    if fs == 32 and frame_size == "5ms":
    if fs == "32kHz" and frame_size == "5ms":
        pytest.skip()

    if fs == 16 and frame_size == "20ms":
    if fs == "16kHz" and frame_size == "20ms":
        pytest.skip()

    run_renderer(
@@ -1279,6 +1359,15 @@ def test_metadata(
    get_odg_bin,
    split_comparison,
):
    if fs == "32kHz" and frame_size == "5ms":
        pytest.skip()

    if fs == "16kHz" and frame_size == "20ms":
        pytest.skip()

    if out_fmt not in ["5_1_2", "HOA3", "STEREO"] and fs != "48kHz":
        pytest.skip()

    run_renderer(
        record_property,
        props_to_record,
@@ -1320,10 +1409,10 @@ def test_non_diegetic_pan_static(
    get_odg_bin,
    split_comparison,
):
    if non_diegetic_pan in ["0", "45", "-90"] and fs == 32:
    if non_diegetic_pan in ["0", "45", "-90"] and fs == "32kHz":
        pytest.skip()

    if non_diegetic_pan not in ["0", "45", "-90"] and fs == 16:
    if non_diegetic_pan not in ["0", "45", "-90"] and fs == "16kHz":
        pytest.skip()

    run_renderer(
@@ -1363,10 +1452,10 @@ def test_non_diegetic_pan_ism_static(
    get_odg_bin,
    split_comparison,
):
    if non_diegetic_pan in ["0", "45", "-90"] and fs == 16:
    if non_diegetic_pan in ["0", "45", "-90"] and fs == "16kHz":
        pytest.skip()

    if non_diegetic_pan not in ["0", "45", "-90"] and fs == 32:
    if non_diegetic_pan not in ["0", "45", "-90"] and fs == "32kHz":
        pytest.skip()

    run_renderer(