From a30bad9b697a592a9be7f9794c556a60c63be52f Mon Sep 17 00:00:00 2001 From: Tapani Pihlajakuja Date: Wed, 12 Nov 2025 20:59:51 +0200 Subject: [PATCH 1/9] Add skips to renderer tests to reduce run time. --- tests/renderer/constants.py | 4 - tests/renderer/test_renderer.py | 152 +++++++++++++++++++++++++++++++- 2 files changed, 148 insertions(+), 8 deletions(-) diff --git a/tests/renderer/constants.py b/tests/renderer/constants.py index 2d6a4daee4..54434e865f 100644 --- a/tests/renderer/constants.py +++ b/tests/renderer/constants.py @@ -139,7 +139,6 @@ FORMAT_TO_FILE_SMOKETEST = { "ISM4SBA3": NCHAN_TO_FILE[20], "META": TEST_VECTOR_DIR.joinpath("mixed_scene_48.txt"), "16ch_8+4+4": NCHAN_TO_FILE[16], - "4d4": NCHAN_TO_FILE[8], "t_design_4": NCHAN_TO_FILE[12], } @@ -182,7 +181,6 @@ FORMAT_TO_FILE_COMPARETEST = { "ISM4SBA3": TESTV_DIR.joinpath("stvOSBA_4ISM_3OA48c.wav"), "META": TEST_VECTOR_DIR.joinpath("mixed_scene_48.txt"), "16ch_8+4+4": TESTV_DIR.joinpath("stv3OA48c.wav"), - "4d4": TESTV_DIR.joinpath("stv71MC48c.wav"), "t_design_4": TESTV_DIR.joinpath("stv714MC48c.wav"), } @@ -225,7 +223,6 @@ FORMAT_TO_FILE_LTV = { "ISM4SBA3": LTV_DIR.joinpath("ltv48_OSBA_4ISM_HOA3.wav"), "META": TEST_VECTOR_DIR.joinpath("mixed_scene_48.txt"), "16ch_8+4+4": LTV_DIR.joinpath("ltv48_HOA3.wav"), - "4d4": LTV_DIR.joinpath("ltv48_MC71.wav"), "t_design_4": LTV_DIR.joinpath("ltv48_MC714.wav"), } @@ -419,7 +416,6 @@ OUTPUT_FORMATS = [ """ Custom loudspeaker input/output """ CUSTOM_LS_TO_TEST = [ "t_design_4", - "4d4", "16ch_8+4+4", ] diff --git a/tests/renderer/test_renderer.py b/tests/renderer/test_renderer.py index 1f09782367..efcf8f0686 100644 --- a/tests/renderer/test_renderer.py +++ b/tests/renderer/test_renderer.py @@ -82,6 +82,15 @@ def test_ambisonics( get_odg_bin, split_comparison, ): + if in_fmt == "HOA2" and out_fmt != "5_1" and frame_size != "20ms" and fs != "48kHz": + pytest.skip() + + if in_fmt == "FOA" and frame_size != "5ms" and fs != "32kHz": + pytest.skip() + + if in_fmt == "HOA3" and frame_size != "20ms" and fs == "32kHz": + pytest.skip() + run_renderer( record_property, props_to_record, @@ -101,9 +110,9 @@ def test_ambisonics( @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) -@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_AMBI) -@pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) -@pytest.mark.parametrize("fs", SAMPLING_RATES) +@pytest.mark.parametrize("in_fmt", "FOA") +@pytest.mark.parametrize("frame_size", "20ms") +@pytest.mark.parametrize("fs", "48kHz") def test_ambisonics_binaural_static( record_property, props_to_record, @@ -158,6 +167,14 @@ def test_ambisonics_binaural_headrotation( get_odg_bin, split_comparison, ): + if in_fmt == "HOA2": + pytest.skip() + + if in_fmt == "FOA" and frame_size != "20ms" and fs != "48kHz": + pytest.skip() + + # Run everything for HOA3 input + run_renderer( record_property, props_to_record, @@ -289,6 +306,14 @@ 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"]: + pytest.skip(); + + if in_fmt == "STEREO" and frame_size != "5ms": + pytest.skip() + + # Run everything for 7_1_4 input + run_renderer( record_property, props_to_record, @@ -329,6 +354,12 @@ 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": + pytest.skip() + + if in_fmt not in ["5_1, 7_1_4"]: + pytest.skip() + run_renderer( record_property, props_to_record, @@ -371,6 +402,16 @@ def test_multichannel_binaural_headrotation( if in_fmt in ["MONO", "STEREO"]: pytest.skip("MONO or STEREO to Binaural rendering unsupported") + if in_fmt != "5_1_4": + if fs != "48kHz": + pytest.skip() + if in_fmt in ["MONO, 5_1, 7_1_4"] and frame_size != "20ms": + pytest.skip() + if in_fmt not in ["MONO, 5_1, 7_1_4"] and frame_size == "20ms": + pytest.skip() + + # Run everything for 5_1_4 + run_renderer( record_property, props_to_record, @@ -412,6 +453,11 @@ 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"]: + pytest.skip() + + # Run everything for ISM4 + run_renderer( record_property, props_to_record, @@ -449,6 +495,11 @@ def test_ism_binaural_static( get_odg_bin, split_comparison, ): + if in_fmt != "ISM4" and frame_size != "20ms" and fs != "48kHz": + pytest.skip() + + # Run everything for ISM4 + run_renderer( record_property, props_to_record, @@ -488,6 +539,11 @@ def test_ism_binaural_headrotation( get_odg_bin, split_comparison, ): + if in_fmt != "ISM4" and frame_size != "5ms" and fs != "32kHz": + pytest.skip() + + # Run everything for ISM4 + run_renderer( record_property, props_to_record, @@ -529,6 +585,17 @@ def test_masa( get_odg_bin, split_comparison, ): + if fs == "32kHz" and out_fmt in ["STEREO", "5_1", "5_1_2", "5_1_4", "7_1", "7_1_4", "FOA", "HOA2"]: + pytest.skip() + + if fs == "16kHz" and out_fmt in ["5_1_2", "5_1_4", "7_1", "7_1_4", "FOA", "HOA2", "HOA3"]: + pytest.skip() + + if fs in ["16kHz", "32kHz"] and frame_size == "5ms": + pytest.skip() + + # fs == 48 tests everything + run_renderer( record_property, props_to_record, @@ -565,7 +632,12 @@ def test_masa_binaural_static( get_odg, get_odg_bin, split_comparison, -): +): + if fs in ["16kHz", "32kHz"] and frame_size == "5ms": + pytest.skip() + + # fs == 48 tests everything + run_renderer( record_property, props_to_record, @@ -605,6 +677,14 @@ def test_masa_binaural_headrotation( get_odg_bin, split_comparison, ): + if fs == 32 and frame_size == "20ms": + pytest.skip() + + if fs == 16 and frame_size == "5ms": + pytest.skip() + + # fs == 48 tests everything + run_renderer( record_property, props_to_record, @@ -641,6 +721,9 @@ def test_masa_prerend( get_odg_bin, split_comparison, ): + if in_fmt not in ["ISM4MASA2", "ISM1MASA1"] and fs != "48kHz": + pytest.skip() + run_renderer( record_property, props_to_record, @@ -675,6 +758,8 @@ def test_masa_prerend_scenes( get_odg_bin, split_comparison, ): + # Test all scenes + run_renderer( record_property, props_to_record, @@ -715,6 +800,11 @@ 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"]: + pytest.skip() + + # Test all for ISM4MASA2 + run_renderer( record_property, props_to_record, @@ -752,6 +842,11 @@ def test_omasa_binaural_static( get_odg_bin, split_comparison, ): + if in_fmt != "ISM4MASA2" and fs != "48kHz" and frame_size != "20ms": + pytest.skip() + + # Test all for ISM4MASA2 + run_renderer( record_property, props_to_record, @@ -791,6 +886,11 @@ 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": + pytest.skip() + + # Test all for ["ISM1MASA1", "ISM2MASA2", "ISM4MASA2"] + run_renderer( record_property, props_to_record, @@ -832,6 +932,11 @@ 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"]: + pytest.skip() + + # Test all for ISM4SBA3 + run_renderer( record_property, props_to_record, @@ -869,6 +974,11 @@ def test_osba_binaural_static( get_odg_bin, split_comparison, ): + if in_fmt != "ISM4SBA3" and fs != 48 and frame_size != "20ms": + pytest.skip() + + # Test all for ISM4SBA3 + run_renderer( record_property, props_to_record, @@ -908,6 +1018,11 @@ 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": + pytest.skip() + + # Test all for ["ISM1SBA1", "ISM2SBA2", "ISM4SBA3"] + run_renderer( record_property, props_to_record, @@ -949,6 +1064,11 @@ 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": + pytest.skip() + + # Test everything for fs 48 and 20ms framing + run_renderer( record_property, props_to_record, @@ -994,6 +1114,9 @@ def test_custom_ls_output( get_odg_bin, split_comparison, ): + if in_fmt not in ["HOA3", "MONO", "STEREO", "5_1", "7_1_4", "MASA1", "MASA2", "ISM4", "ISM4MASA2", "ISM4SBA3"]: + pytest.skip() + run_renderer( record_property, props_to_record, @@ -1064,6 +1187,9 @@ def test_custom_ls_input_binaural( get_odg_bin, split_comparison, ): + if fs != 48 or frame_size != "20ms": + pytest.skip() + run_renderer( record_property, props_to_record, @@ -1103,6 +1229,12 @@ def test_custom_ls_input_binaural_headrotation( get_odg_bin, split_comparison, ): + if fs == 32 and frame_size == "5ms": + pytest.skip() + + if fs == 16 and frame_size == "20ms": + pytest.skip() + run_renderer( record_property, props_to_record, @@ -1185,6 +1317,12 @@ def test_non_diegetic_pan_static( get_odg_bin, split_comparison, ): + if non_diegetic_pan in ["0", "45", "-90"] and fs == 32: + pytest.skip() + + if non_diegetic_pan not in ["0", "45", "-90"] and fs == 16: + pytest.skip() + run_renderer( record_property, props_to_record, @@ -1222,6 +1360,12 @@ def test_non_diegetic_pan_ism_static( get_odg_bin, split_comparison, ): + if non_diegetic_pan in ["0", "45", "-90"] and fs == 16: + pytest.skip() + + if non_diegetic_pan not in ["0", "45", "-90"] and fs == 32: + pytest.skip() + run_renderer( record_property, props_to_record, -- GitLab From 17bf5affe57880fa3ce0d951e007a47ff2f50a09 Mon Sep 17 00:00:00 2001 From: Tapani Pihlajakuja Date: Wed, 12 Nov 2025 21:06:03 +0200 Subject: [PATCH 2/9] Fix ambi test --- tests/renderer/test_renderer.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/renderer/test_renderer.py b/tests/renderer/test_renderer.py index efcf8f0686..b9b8e4ac73 100644 --- a/tests/renderer/test_renderer.py +++ b/tests/renderer/test_renderer.py @@ -110,9 +110,9 @@ def test_ambisonics( @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) -@pytest.mark.parametrize("in_fmt", "FOA") -@pytest.mark.parametrize("frame_size", "20ms") -@pytest.mark.parametrize("fs", "48kHz") +@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_AMBI) +@pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) +@pytest.mark.parametrize("fs", SAMPLING_RATES) def test_ambisonics_binaural_static( record_property, props_to_record, @@ -128,6 +128,9 @@ def test_ambisonics_binaural_static( get_odg_bin, split_comparison, ): + if in_fmt != "FOA" and frame_size != "20ms" and fs != "48kHz": + pytest.skip() + run_renderer( record_property, props_to_record, -- GitLab From c62f01d1207d2fcd497a1426b40192e887e9c42d Mon Sep 17 00:00:00 2001 From: Tapani Pihlajakuja Date: Thu, 13 Nov 2025 11:21:42 +0200 Subject: [PATCH 3/9] Fix if-checks and reduce more. --- tests/renderer/test_renderer.py | 167 ++++++++++++++++++++++++-------- 1 file changed, 128 insertions(+), 39 deletions(-) diff --git a/tests/renderer/test_renderer.py b/tests/renderer/test_renderer.py index b9b8e4ac73..0c5c9f291c 100644 --- a/tests/renderer/test_renderer.py +++ b/tests/renderer/test_renderer.py @@ -82,14 +82,25 @@ def test_ambisonics( get_odg_bin, split_comparison, ): - if in_fmt == "HOA2" and out_fmt != "5_1" and frame_size != "20ms" and fs != "48kHz": - pytest.skip() + 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": - pytest.skip() + 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": - pytest.skip() + if in_fmt == "HOA3": + if frame_size != "20ms": + pytest.skip() + if fs == "32kHz": + pytest.skip() run_renderer( record_property, @@ -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,8 +326,13 @@ 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"]: - pytest.skip(); + 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": pytest.skip() @@ -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"]: - pytest.skip() + 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,8 +587,11 @@ def test_ism_binaural_headrotation( get_odg_bin, split_comparison, ): - if in_fmt != "ISM4" and frame_size != "5ms" and fs != "32kHz": - pytest.skip() + 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,8 +855,13 @@ 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"]: - pytest.skip() + 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,8 +902,11 @@ def test_omasa_binaural_static( get_odg_bin, split_comparison, ): - if in_fmt != "ISM4MASA2" and fs != "48kHz" and frame_size != "20ms": - pytest.skip() + if in_fmt != "ISM4MASA2": + if fs != "48kHz": + pytest.skip() + if frame_size != "20ms": + pytest.skip() # Test all for ISM4MASA2 @@ -889,8 +949,11 @@ 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": - pytest.skip() + 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,8 +998,13 @@ 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"]: - pytest.skip() + 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,8 +1045,11 @@ def test_osba_binaural_static( get_odg_bin, split_comparison, ): - if in_fmt != "ISM4SBA3" and fs != 48 and frame_size != "20ms": - pytest.skip() + if in_fmt != "ISM4SBA3": + if fs != "48kHz": + pytest.skip() + if frame_size != "20ms": + pytest.skip() # Test all for ISM4SBA3 @@ -1021,8 +1092,11 @@ 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": - pytest.skip() + 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": - pytest.skip() + 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( -- GitLab From 8243fc4e8d9bafae006ab73555df30a882363098 Mon Sep 17 00:00:00 2001 From: Tapani Pihlajakuja Date: Thu, 13 Nov 2025 11:46:17 +0200 Subject: [PATCH 4/9] Reduce even more --- tests/renderer/test_renderer.py | 34 ++++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/tests/renderer/test_renderer.py b/tests/renderer/test_renderer.py index 0c5c9f291c..d36c9b2689 100644 --- a/tests/renderer/test_renderer.py +++ b/tests/renderer/test_renderer.py @@ -326,16 +326,15 @@ def test_multichannel( get_odg_bin, split_comparison, ): - if in_fmt in [ ["MONO", "5_1", "5_1_2", "5_1_4", "7_1"]]: + if in_fmt not in ["STEREO","7_1_4"]: if frame_size != "20ms": pytest.skip(); if fs != "48kHz": pytest.skip(); - if out_fmt not in ["STEREO","FOA","7_1_4"]: + if out_fmt not in ["MONO","STEREO","FOA","7_1_4"]: pytest.skip(); - - if in_fmt == "STEREO" and frame_size != "5ms": - pytest.skip() + if frame_size != "5ms": + pytest.skip() # Run everything for 7_1_4 input @@ -863,6 +862,15 @@ def test_omasa( if out_fmt not in ["STEREO", "5_1"]: pytest.skip() + if in_fmt in ["ISM3MASA1", "ISM2MASA2", "ISM1MASA1", "ISM4MASA2"]: + pytest.skip() + + if out_fmt in ["5_1","5_1_4","7_1_4","FOA","HOA2"]: + if frame_size != "20ms": + pytest.skip() + if fs != "16kHz": + pytest.skip() + # Test all for ISM4MASA2 run_renderer( @@ -908,6 +916,9 @@ def test_omasa_binaural_static( if frame_size != "20ms": pytest.skip() + if in_fmt in ["ISM3MASA2", "ISM2MASA1", "ISM1MASA2", "ISM4MASA1"]: + pytest.skip() + # Test all for ISM4MASA2 run_renderer( @@ -1006,6 +1017,8 @@ def test_osba( if out_fmt not in ["HOA3", "5_1"]: pytest.skip() + if out_fmt in ["HOA3", "5_1"]: + pytest.skip() # Test all for ISM4SBA3 run_renderer( @@ -1046,10 +1059,13 @@ def test_osba_binaural_static( split_comparison, ): if in_fmt != "ISM4SBA3": - if fs != "48kHz": - pytest.skip() - if frame_size != "20ms": - pytest.skip() + pytest.skip() + + if fs != "48kHz": + pytest.skip() + + if frame_size != "20ms": + pytest.skip() # Test all for ISM4SBA3 -- GitLab From 2539a36dd0098718ade685cf41480d485aeaaa19 Mon Sep 17 00:00:00 2001 From: Tapani Pihlajakuja Date: Thu, 13 Nov 2025 13:13:02 +0200 Subject: [PATCH 5/9] Add back some OMASA tests --- tests/renderer/test_renderer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/renderer/test_renderer.py b/tests/renderer/test_renderer.py index d36c9b2689..2365709d15 100644 --- a/tests/renderer/test_renderer.py +++ b/tests/renderer/test_renderer.py @@ -862,7 +862,7 @@ def test_omasa( if out_fmt not in ["STEREO", "5_1"]: pytest.skip() - if in_fmt in ["ISM3MASA1", "ISM2MASA2", "ISM1MASA1", "ISM4MASA2"]: + if in_fmt in ["ISM3MASA1", "ISM2MASA2", "ISM1MASA1"]: pytest.skip() if out_fmt in ["5_1","5_1_4","7_1_4","FOA","HOA2"]: -- GitLab From cc08d6a6e279001e28a87f7dfdee5cb28e8cbd38 Mon Sep 17 00:00:00 2001 From: Tapani Pihlajakuja Date: Thu, 13 Nov 2025 13:25:25 +0200 Subject: [PATCH 6/9] Apply 1 suggestion(s) to 1 file(s) Co-authored-by: Archit Tamarapu --- tests/renderer/test_renderer.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/renderer/test_renderer.py b/tests/renderer/test_renderer.py index 2365709d15..885644b942 100644 --- a/tests/renderer/test_renderer.py +++ b/tests/renderer/test_renderer.py @@ -328,11 +328,11 @@ def test_multichannel( ): if in_fmt not in ["STEREO","7_1_4"]: if frame_size != "20ms": - pytest.skip(); + pytest.skip() if fs != "48kHz": - pytest.skip(); + pytest.skip() if out_fmt not in ["MONO","STEREO","FOA","7_1_4"]: - pytest.skip(); + pytest.skip() if frame_size != "5ms": pytest.skip() -- GitLab From 491bb98ee22158b49f343b6095709335e0f1cb8f Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Thu, 13 Nov 2025 12:30:03 +0100 Subject: [PATCH 7/9] formatting + whitespace --- tests/renderer/test_renderer.py | 66 +++++++++++++++++++++++++-------- 1 file changed, 51 insertions(+), 15 deletions(-) diff --git a/tests/renderer/test_renderer.py b/tests/renderer/test_renderer.py index 885644b942..8f7279ba47 100644 --- a/tests/renderer/test_renderer.py +++ b/tests/renderer/test_renderer.py @@ -97,8 +97,8 @@ def test_ambisonics( pytest.skip() if in_fmt == "HOA3": - if frame_size != "20ms": - pytest.skip() + if frame_size != "20ms": + pytest.skip() if fs == "32kHz": pytest.skip() @@ -326,16 +326,16 @@ def test_multichannel( get_odg_bin, split_comparison, ): - if in_fmt not in ["STEREO","7_1_4"]: + if in_fmt not in ["STEREO", "7_1_4"]: if frame_size != "20ms": pytest.skip() if fs != "48kHz": pytest.skip() - if out_fmt not in ["MONO","STEREO","FOA","7_1_4"]: + if out_fmt not in ["MONO", "STEREO", "FOA", "7_1_4"]: pytest.skip() if frame_size != "5ms": pytest.skip() - + # Run everything for 7_1_4 input run_renderer( @@ -378,12 +378,12 @@ def test_multichannel_binaural_static( if in_fmt in ["MONO", "STEREO"]: pytest.skip("MONO or STEREO to Binaural rendering unsupported") - if fs != "48kHz": + if fs != "48kHz": pytest.skip() if frame_size != "20ms": pytest.skip() - + if in_fmt not in ["5_1, 7_1_4"]: pytest.skip() @@ -488,7 +488,7 @@ def test_ism( if out_fmt not in ["STEREO", "5_1"]: pytest.skip() - if out_fmt not in ["HOA3","5_1_2"]: + if out_fmt not in ["HOA3", "5_1_2"]: if frame_size != "5ms": pytest.skip() if fs != "32kHz": @@ -635,19 +635,44 @@ def test_masa( get_odg_bin, split_comparison, ): - if fs == "32kHz" and out_fmt in ["STEREO", "5_1", "5_1_2", "5_1_4", "7_1", "7_1_4", "FOA", "HOA2"]: + if fs == "32kHz" and out_fmt in [ + "STEREO", + "5_1", + "5_1_2", + "5_1_4", + "7_1", + "7_1_4", + "FOA", + "HOA2", + ]: pytest.skip() - if fs == "16kHz" and out_fmt in ["5_1_2", "5_1_4", "7_1", "7_1_4", "FOA", "HOA2", "HOA3"]: + if fs == "16kHz" and out_fmt in [ + "5_1_2", + "5_1_4", + "7_1", + "7_1_4", + "FOA", + "HOA2", + "HOA3", + ]: pytest.skip() if fs in ["16kHz", "32kHz"] and frame_size == "5ms": pytest.skip() - if out_fmt in ["5_1_2", "5_1_4", "7_1", "HOA2", "HOA3"] and frame_size != "20ms" and in_fmt == "MASA1": + 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": + 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( @@ -686,7 +711,7 @@ def test_masa_binaural_static( get_odg, get_odg_bin, split_comparison, -): +): if fs in ["16kHz", "32kHz"] and frame_size == "5ms": pytest.skip() @@ -865,7 +890,7 @@ def test_omasa( if in_fmt in ["ISM3MASA1", "ISM2MASA2", "ISM1MASA1"]: pytest.skip() - if out_fmt in ["5_1","5_1_4","7_1_4","FOA","HOA2"]: + if out_fmt in ["5_1", "5_1_4", "7_1_4", "FOA", "HOA2"]: if frame_size != "20ms": pytest.skip() if fs != "16kHz": @@ -1210,7 +1235,18 @@ def test_custom_ls_output( get_odg_bin, split_comparison, ): - if in_fmt not in ["HOA3", "MONO", "STEREO", "5_1", "7_1_4", "MASA1", "MASA2", "ISM4", "ISM4MASA2", "ISM4SBA3"]: + 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": -- GitLab From 59ee52dc34592d9605ccc10c338ce7a578a9e0bc Mon Sep 17 00:00:00 2001 From: Tapani Pihlajakuja Date: Thu, 13 Nov 2025 13:43:57 +0200 Subject: [PATCH 8/9] Add missing case back. --- tests/renderer/test_renderer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/renderer/test_renderer.py b/tests/renderer/test_renderer.py index 8f7279ba47..9a214e3826 100644 --- a/tests/renderer/test_renderer.py +++ b/tests/renderer/test_renderer.py @@ -384,7 +384,7 @@ def test_multichannel_binaural_static( if frame_size != "20ms": pytest.skip() - if in_fmt not in ["5_1, 7_1_4"]: + if in_fmt not in ["5_1", "7_1_4"]: pytest.skip() run_renderer( -- GitLab From 0f3a7e9178228aa4c9e84fd220b130746c14ef73 Mon Sep 17 00:00:00 2001 From: Tapani Pihlajakuja Date: Thu, 13 Nov 2025 14:03:53 +0200 Subject: [PATCH 9/9] Move new renderer test set into renderer_short folder --- tests/renderer/constants.py | 4 + tests/renderer/test_renderer.py | 288 ---------- tests/renderer_short/constants.py | 194 ++++--- tests/renderer_short/test_renderer.py | 780 +++++++++++++++++++++++--- tests/renderer_short/utils.py | 79 +-- 5 files changed, 854 insertions(+), 491 deletions(-) diff --git a/tests/renderer/constants.py b/tests/renderer/constants.py index 54434e865f..2d6a4daee4 100644 --- a/tests/renderer/constants.py +++ b/tests/renderer/constants.py @@ -139,6 +139,7 @@ FORMAT_TO_FILE_SMOKETEST = { "ISM4SBA3": NCHAN_TO_FILE[20], "META": TEST_VECTOR_DIR.joinpath("mixed_scene_48.txt"), "16ch_8+4+4": NCHAN_TO_FILE[16], + "4d4": NCHAN_TO_FILE[8], "t_design_4": NCHAN_TO_FILE[12], } @@ -181,6 +182,7 @@ FORMAT_TO_FILE_COMPARETEST = { "ISM4SBA3": TESTV_DIR.joinpath("stvOSBA_4ISM_3OA48c.wav"), "META": TEST_VECTOR_DIR.joinpath("mixed_scene_48.txt"), "16ch_8+4+4": TESTV_DIR.joinpath("stv3OA48c.wav"), + "4d4": TESTV_DIR.joinpath("stv71MC48c.wav"), "t_design_4": TESTV_DIR.joinpath("stv714MC48c.wav"), } @@ -223,6 +225,7 @@ FORMAT_TO_FILE_LTV = { "ISM4SBA3": LTV_DIR.joinpath("ltv48_OSBA_4ISM_HOA3.wav"), "META": TEST_VECTOR_DIR.joinpath("mixed_scene_48.txt"), "16ch_8+4+4": LTV_DIR.joinpath("ltv48_HOA3.wav"), + "4d4": LTV_DIR.joinpath("ltv48_MC71.wav"), "t_design_4": LTV_DIR.joinpath("ltv48_MC714.wav"), } @@ -416,6 +419,7 @@ OUTPUT_FORMATS = [ """ Custom loudspeaker input/output """ CUSTOM_LS_TO_TEST = [ "t_design_4", + "4d4", "16ch_8+4+4", ] diff --git a/tests/renderer/test_renderer.py b/tests/renderer/test_renderer.py index 9a214e3826..1f09782367 100644 --- a/tests/renderer/test_renderer.py +++ b/tests/renderer/test_renderer.py @@ -82,26 +82,6 @@ def test_ambisonics( get_odg_bin, split_comparison, ): - 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": - if frame_size != "5ms": - pytest.skip() - if fs != "32kHz": - pytest.skip() - - if in_fmt == "HOA3": - if frame_size != "20ms": - pytest.skip() - if fs == "32kHz": - pytest.skip() - run_renderer( record_property, props_to_record, @@ -139,15 +119,6 @@ def test_ambisonics_binaural_static( get_odg_bin, split_comparison, ): - if in_fmt != "HOA2": - pytest.skip() - - if frame_size != "20ms": - pytest.skip() - - if fs != "48kHz": - pytest.skip() - run_renderer( record_property, props_to_record, @@ -187,14 +158,6 @@ def test_ambisonics_binaural_headrotation( get_odg_bin, split_comparison, ): - if in_fmt == "HOA2": - pytest.skip() - - if in_fmt == "FOA" and frame_size != "20ms" and fs != "48kHz": - pytest.skip() - - # Run everything for HOA3 input - run_renderer( record_property, props_to_record, @@ -326,18 +289,6 @@ def test_multichannel( get_odg_bin, split_comparison, ): - if in_fmt not in ["STEREO", "7_1_4"]: - if frame_size != "20ms": - pytest.skip() - if fs != "48kHz": - pytest.skip() - if out_fmt not in ["MONO", "STEREO", "FOA", "7_1_4"]: - pytest.skip() - if frame_size != "5ms": - pytest.skip() - - # Run everything for 7_1_4 input - run_renderer( record_property, props_to_record, @@ -378,15 +329,6 @@ def test_multichannel_binaural_static( if in_fmt in ["MONO", "STEREO"]: pytest.skip("MONO or STEREO to Binaural rendering unsupported") - if fs != "48kHz": - pytest.skip() - - if frame_size != "20ms": - pytest.skip() - - if in_fmt not in ["5_1", "7_1_4"]: - pytest.skip() - run_renderer( record_property, props_to_record, @@ -429,16 +371,6 @@ def test_multichannel_binaural_headrotation( if in_fmt in ["MONO", "STEREO"]: pytest.skip("MONO or STEREO to Binaural rendering unsupported") - if in_fmt != "5_1_4": - if fs != "48kHz": - pytest.skip() - if in_fmt in ["MONO, 5_1, 7_1_4"] and frame_size != "20ms": - pytest.skip() - if in_fmt not in ["MONO, 5_1, 7_1_4"] and frame_size == "20ms": - pytest.skip() - - # Run everything for 5_1_4 - run_renderer( record_property, props_to_record, @@ -480,22 +412,6 @@ def test_ism( get_odg_bin, split_comparison, ): - 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() - - 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, props_to_record, @@ -533,20 +449,6 @@ def test_ism_binaural_static( get_odg_bin, split_comparison, ): - 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 - run_renderer( record_property, props_to_record, @@ -586,14 +488,6 @@ def test_ism_binaural_headrotation( get_odg_bin, split_comparison, ): - if in_fmt != "ISM4": - if frame_size != "5ms": - pytest.skip() - if fs != "32kHz": - pytest.skip() - - # Run everything for ISM4 - run_renderer( record_property, props_to_record, @@ -635,46 +529,6 @@ def test_masa( get_odg_bin, split_comparison, ): - if fs == "32kHz" and out_fmt in [ - "STEREO", - "5_1", - "5_1_2", - "5_1_4", - "7_1", - "7_1_4", - "FOA", - "HOA2", - ]: - pytest.skip() - - if fs == "16kHz" and out_fmt in [ - "5_1_2", - "5_1_4", - "7_1", - "7_1_4", - "FOA", - "HOA2", - "HOA3", - ]: - pytest.skip() - - if fs in ["16kHz", "32kHz"] and frame_size == "5ms": - pytest.skip() - - 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, props_to_record, @@ -712,11 +566,6 @@ def test_masa_binaural_static( get_odg_bin, split_comparison, ): - if fs in ["16kHz", "32kHz"] and frame_size == "5ms": - pytest.skip() - - # fs == 48 tests everything - run_renderer( record_property, props_to_record, @@ -756,14 +605,6 @@ def test_masa_binaural_headrotation( get_odg_bin, split_comparison, ): - if fs == 32 and frame_size == "20ms": - pytest.skip() - - if fs == 16 and frame_size == "5ms": - pytest.skip() - - # fs == 48 tests everything - run_renderer( record_property, props_to_record, @@ -800,9 +641,6 @@ def test_masa_prerend( get_odg_bin, split_comparison, ): - if in_fmt not in ["ISM4MASA2", "ISM1MASA1"] and fs != "48kHz": - pytest.skip() - run_renderer( record_property, props_to_record, @@ -837,8 +675,6 @@ def test_masa_prerend_scenes( get_odg_bin, split_comparison, ): - # Test all scenes - run_renderer( record_property, props_to_record, @@ -879,25 +715,6 @@ def test_omasa( get_odg_bin, split_comparison, ): - 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() - - if in_fmt in ["ISM3MASA1", "ISM2MASA2", "ISM1MASA1"]: - pytest.skip() - - if out_fmt in ["5_1", "5_1_4", "7_1_4", "FOA", "HOA2"]: - if frame_size != "20ms": - pytest.skip() - if fs != "16kHz": - pytest.skip() - - # Test all for ISM4MASA2 - run_renderer( record_property, props_to_record, @@ -935,17 +752,6 @@ def test_omasa_binaural_static( get_odg_bin, split_comparison, ): - if in_fmt != "ISM4MASA2": - if fs != "48kHz": - pytest.skip() - if frame_size != "20ms": - pytest.skip() - - if in_fmt in ["ISM3MASA2", "ISM2MASA1", "ISM1MASA2", "ISM4MASA1"]: - pytest.skip() - - # Test all for ISM4MASA2 - run_renderer( record_property, props_to_record, @@ -985,14 +791,6 @@ def test_omasa_binaural_headrotation( get_odg_bin, split_comparison, ): - 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"] - run_renderer( record_property, props_to_record, @@ -1034,18 +832,6 @@ def test_osba( get_odg_bin, split_comparison, ): - 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() - - if out_fmt in ["HOA3", "5_1"]: - pytest.skip() - # Test all for ISM4SBA3 - run_renderer( record_property, props_to_record, @@ -1083,17 +869,6 @@ def test_osba_binaural_static( get_odg_bin, split_comparison, ): - if in_fmt != "ISM4SBA3": - pytest.skip() - - if fs != "48kHz": - pytest.skip() - - if frame_size != "20ms": - pytest.skip() - - # Test all for ISM4SBA3 - run_renderer( record_property, props_to_record, @@ -1133,14 +908,6 @@ def test_osba_binaural_headrotation( get_odg_bin, split_comparison, ): - 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"] - run_renderer( record_property, props_to_record, @@ -1182,14 +949,6 @@ def test_custom_ls_input( get_odg_bin, split_comparison, ): - if out_fmt not in ["7_1, FOA, STEREO"]: - if fs != "48kHz": - pytest.skip() - if frame_size != "20ms": - pytest.skip() - - # Test rest - run_renderer( record_property, props_to_record, @@ -1235,23 +994,6 @@ def test_custom_ls_output( get_odg_bin, split_comparison, ): - 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, @@ -1322,9 +1064,6 @@ def test_custom_ls_input_binaural( get_odg_bin, split_comparison, ): - if fs != "48kHz" or frame_size != "20ms": - pytest.skip() - run_renderer( record_property, props_to_record, @@ -1364,12 +1103,6 @@ def test_custom_ls_input_binaural_headrotation( get_odg_bin, split_comparison, ): - if fs == "32kHz" and frame_size == "5ms": - pytest.skip() - - if fs == "16kHz" and frame_size == "20ms": - pytest.skip() - run_renderer( record_property, props_to_record, @@ -1411,15 +1144,6 @@ 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, @@ -1461,12 +1185,6 @@ def test_non_diegetic_pan_static( get_odg_bin, split_comparison, ): - if non_diegetic_pan in ["0", "45", "-90"] and fs == "32kHz": - pytest.skip() - - if non_diegetic_pan not in ["0", "45", "-90"] and fs == "16kHz": - pytest.skip() - run_renderer( record_property, props_to_record, @@ -1504,12 +1222,6 @@ def test_non_diegetic_pan_ism_static( get_odg_bin, split_comparison, ): - if non_diegetic_pan in ["0", "45", "-90"] and fs == "16kHz": - pytest.skip() - - if non_diegetic_pan not in ["0", "45", "-90"] and fs == "32kHz": - pytest.skip() - run_renderer( record_property, props_to_record, diff --git a/tests/renderer_short/constants.py b/tests/renderer_short/constants.py index 766e64722b..54434e865f 100644 --- a/tests/renderer_short/constants.py +++ b/tests/renderer_short/constants.py @@ -30,8 +30,8 @@ accordance with the laws of the Federal Republic of Germany excluding its confli the United Nations Convention on Contracts on the International Sales of Goods. """ -from pathlib import Path import platform +from pathlib import Path """ Set up paths """ TESTS_DIR = Path(__file__).parent @@ -55,6 +55,8 @@ elif platform.system() in ["Linux", "Darwin"]: else: assert False, f"Unsupported platform {platform.system()}" +SAMPLING_RATES = ["48kHz", "32kHz", "16kHz"] + """ Renderer commandline template """ RENDERER_CMD = [ str(TESTS_DIR.parent.parent.joinpath("IVAS_rend")), @@ -115,29 +117,28 @@ FORMAT_TO_FILE_SMOKETEST = { "NDP_ISM4": NCHAN_TO_FILE[4], "MASA1": NCHAN_TO_FILE[1], "MASA2": NCHAN_TO_FILE[2], - "OMASA_1_1": NCHAN_TO_FILE[2], - "OMASA_1_2": NCHAN_TO_FILE[3], - "OMASA_1_3": NCHAN_TO_FILE[4], - "OMASA_1_4": NCHAN_TO_FILE[5], - "OMASA_2_1": NCHAN_TO_FILE[3], - "OMASA_2_2": NCHAN_TO_FILE[4], - "OMASA_2_3": NCHAN_TO_FILE[5], - "OMASA_2_4": NCHAN_TO_FILE[6], - "OSBA_1_1": NCHAN_TO_FILE[5], - "OSBA_2_1": NCHAN_TO_FILE[6], - "OSBA_3_1": NCHAN_TO_FILE[7], - "OSBA_4_1": NCHAN_TO_FILE[8], - "OSBA_1_2": NCHAN_TO_FILE[10], - "OSBA_2_2": NCHAN_TO_FILE[11], - "OSBA_3_2": NCHAN_TO_FILE[12], - "OSBA_4_2": NCHAN_TO_FILE[13], - "OSBA_1_3": NCHAN_TO_FILE[17], - "OSBA_2_3": NCHAN_TO_FILE[18], - "OSBA_3_3": NCHAN_TO_FILE[19], - "OSBA_4_3": NCHAN_TO_FILE[20], - "META": TEST_VECTOR_DIR.joinpath("mixed_scene.txt"), + "ISM1MASA1": NCHAN_TO_FILE[2], + "ISM2MASA1": NCHAN_TO_FILE[3], + "ISM3MASA1": NCHAN_TO_FILE[4], + "ISM4MASA1": NCHAN_TO_FILE[5], + "ISM1MASA2": NCHAN_TO_FILE[3], + "ISM2MASA2": NCHAN_TO_FILE[4], + "ISM3MASA2": NCHAN_TO_FILE[5], + "ISM4MASA2": NCHAN_TO_FILE[6], + "ISM1SBA1": NCHAN_TO_FILE[5], + "ISM2SBA1": NCHAN_TO_FILE[6], + "ISM3SBA1": NCHAN_TO_FILE[7], + "ISM4SBA1": NCHAN_TO_FILE[8], + "ISM1SBA2": NCHAN_TO_FILE[10], + "ISM2SBA2": NCHAN_TO_FILE[11], + "ISM3SBA2": NCHAN_TO_FILE[12], + "ISM4SBA2": NCHAN_TO_FILE[13], + "ISM1SBA3": NCHAN_TO_FILE[17], + "ISM2SBA3": NCHAN_TO_FILE[18], + "ISM3SBA3": NCHAN_TO_FILE[19], + "ISM4SBA3": NCHAN_TO_FILE[20], + "META": TEST_VECTOR_DIR.joinpath("mixed_scene_48.txt"), "16ch_8+4+4": NCHAN_TO_FILE[16], - "4d4": NCHAN_TO_FILE[8], "t_design_4": NCHAN_TO_FILE[12], } @@ -158,29 +159,28 @@ FORMAT_TO_FILE_COMPARETEST = { "ISM4": TESTV_DIR.joinpath("stv4ISM48s.wav"), "MASA1": TESTV_DIR.joinpath("stv1MASA1TC48c.wav"), "MASA2": TESTV_DIR.joinpath("stv2MASA2TC48c.wav"), - "OMASA_1_1": TESTV_DIR.joinpath("stvOMASA_1ISM_1MASA1TC48c.wav"), - "OMASA_1_2": TESTV_DIR.joinpath("stvOMASA_2ISM_2MASA1TC48c.wav"), - "OMASA_1_3": TESTV_DIR.joinpath("stvOMASA_3ISM_1MASA1TC48c.wav"), - "OMASA_1_4": TESTV_DIR.joinpath("stvOMASA_4ISM_2MASA1TC48c.wav"), - "OMASA_2_1": TESTV_DIR.joinpath("stvOMASA_1ISM_1MASA2TC48c.wav"), - "OMASA_2_2": TESTV_DIR.joinpath("stvOMASA_2ISM_2MASA2TC48c.wav"), - "OMASA_2_3": TESTV_DIR.joinpath("stvOMASA_3ISM_1MASA2TC48c.wav"), - "OMASA_2_4": TESTV_DIR.joinpath("stvOMASA_4ISM_2MASA2TC48c.wav"), - "OSBA_1_1": TESTV_DIR.joinpath("stvOSBA_1ISM_FOA48c.wav"), - "OSBA_1_2": TESTV_DIR.joinpath("stvOSBA_1ISM_2OA48c.wav"), - "OSBA_1_3": TESTV_DIR.joinpath("stvOSBA_1ISM_3OA48c.wav"), - "OSBA_2_1": TESTV_DIR.joinpath("stvOSBA_2ISM_FOA48c.wav"), - "OSBA_2_2": TESTV_DIR.joinpath("stvOSBA_2ISM_2OA48c.wav"), - "OSBA_2_3": TESTV_DIR.joinpath("stvOSBA_2ISM_3OA48c.wav"), - "OSBA_3_1": TESTV_DIR.joinpath("stvOSBA_3ISM_FOA48c.wav"), - "OSBA_3_2": TESTV_DIR.joinpath("stvOSBA_3ISM_2OA48c.wav"), - "OSBA_3_3": TESTV_DIR.joinpath("stvOSBA_3ISM_3OA48c.wav"), - "OSBA_4_1": TESTV_DIR.joinpath("stvOSBA_4ISM_FOA48c.wav"), - "OSBA_4_2": TESTV_DIR.joinpath("stvOSBA_4ISM_2OA48c.wav"), - "OSBA_4_3": TESTV_DIR.joinpath("stvOSBA_4ISM_3OA48c.wav"), - "META": TEST_VECTOR_DIR.joinpath("mixed_scene.txt"), + "ISM1MASA1": TESTV_DIR.joinpath("stvOMASA_1ISM_1MASA1TC48c.wav"), + "ISM2MASA1": TESTV_DIR.joinpath("stvOMASA_2ISM_2MASA1TC48c.wav"), + "ISM3MASA1": TESTV_DIR.joinpath("stvOMASA_3ISM_1MASA1TC48c.wav"), + "ISM4MASA1": TESTV_DIR.joinpath("stvOMASA_4ISM_2MASA1TC48c.wav"), + "ISM1MASA2": TESTV_DIR.joinpath("stvOMASA_1ISM_1MASA2TC48c.wav"), + "ISM2MASA2": TESTV_DIR.joinpath("stvOMASA_2ISM_2MASA2TC48c.wav"), + "ISM3MASA2": TESTV_DIR.joinpath("stvOMASA_3ISM_1MASA2TC48c.wav"), + "ISM4MASA2": TESTV_DIR.joinpath("stvOMASA_4ISM_2MASA2TC48c.wav"), + "ISM1SBA1": TESTV_DIR.joinpath("stvOSBA_1ISM_FOA48c.wav"), + "ISM1SBA2": TESTV_DIR.joinpath("stvOSBA_1ISM_2OA48c.wav"), + "ISM1SBA3": TESTV_DIR.joinpath("stvOSBA_1ISM_3OA48c.wav"), + "ISM2SBA1": TESTV_DIR.joinpath("stvOSBA_2ISM_FOA48c.wav"), + "ISM2SBA2": TESTV_DIR.joinpath("stvOSBA_2ISM_2OA48c.wav"), + "ISM2SBA3": TESTV_DIR.joinpath("stvOSBA_2ISM_3OA48c.wav"), + "ISM3SBA1": TESTV_DIR.joinpath("stvOSBA_3ISM_FOA48c.wav"), + "ISM3SBA2": TESTV_DIR.joinpath("stvOSBA_3ISM_2OA48c.wav"), + "ISM3SBA3": TESTV_DIR.joinpath("stvOSBA_3ISM_3OA48c.wav"), + "ISM4SBA1": TESTV_DIR.joinpath("stvOSBA_4ISM_FOA48c.wav"), + "ISM4SBA2": TESTV_DIR.joinpath("stvOSBA_4ISM_2OA48c.wav"), + "ISM4SBA3": TESTV_DIR.joinpath("stvOSBA_4ISM_3OA48c.wav"), + "META": TEST_VECTOR_DIR.joinpath("mixed_scene_48.txt"), "16ch_8+4+4": TESTV_DIR.joinpath("stv3OA48c.wav"), - "4d4": TESTV_DIR.joinpath("stv71MC48c.wav"), "t_design_4": TESTV_DIR.joinpath("stv714MC48c.wav"), } @@ -201,29 +201,28 @@ FORMAT_TO_FILE_LTV = { "ISM4": LTV_DIR.joinpath("ltv48_4ISM.wav"), "MASA1": LTV_DIR.joinpath("ltv48_MASA1TC.wav"), "MASA2": LTV_DIR.joinpath("ltv48_MASA2TC.wav"), - "OMASA_1_1": LTV_DIR.joinpath("ltv48_OMASA_1ISM_1TC.wav"), - "OMASA_1_2": LTV_DIR.joinpath("ltv48_OMASA_2ISM_1TC.wav"), - "OMASA_1_3": LTV_DIR.joinpath("ltv48_OMASA_3ISM_1TC.wav"), - "OMASA_1_4": LTV_DIR.joinpath("ltv48_OMASA_4ISM_1TC.wav"), - "OMASA_2_1": LTV_DIR.joinpath("ltv48_OMASA_1ISM_2TC.wav"), - "OMASA_2_2": LTV_DIR.joinpath("ltv48_OMASA_2ISM_2TC.wav"), - "OMASA_2_3": LTV_DIR.joinpath("ltv48_OMASA_3ISM_2TC.wav"), - "OMASA_2_4": LTV_DIR.joinpath("ltv48_OMASA_4ISM_2TC.wav"), - "OSBA_1_1": LTV_DIR.joinpath("ltv48_OSBA_1ISM_FOA.wav"), - "OSBA_1_2": LTV_DIR.joinpath("ltv48_OSBA_1ISM_HOA2.wav"), - "OSBA_1_3": LTV_DIR.joinpath("ltv48_OSBA_1ISM_HOA3.wav"), - "OSBA_2_1": LTV_DIR.joinpath("ltv48_OSBA_2ISM_FOA.wav"), - "OSBA_2_2": LTV_DIR.joinpath("ltv48_OSBA_2ISM_HOA2.wav"), - "OSBA_2_3": LTV_DIR.joinpath("ltv48_OSBA_2ISM_HOA3.wav"), - "OSBA_3_1": LTV_DIR.joinpath("ltv48_OSBA_3ISM_FOA.wav"), - "OSBA_3_2": LTV_DIR.joinpath("ltv48_OSBA_3ISM_HOA2.wav"), - "OSBA_3_3": LTV_DIR.joinpath("ltv48_OSBA_3ISM_HOA3.wav"), - "OSBA_4_1": LTV_DIR.joinpath("ltv48_OSBA_4ISM_FOA.wav"), - "OSBA_4_2": LTV_DIR.joinpath("ltv48_OSBA_4ISM_HOA2.wav"), - "OSBA_4_3": LTV_DIR.joinpath("ltv48_OSBA_4ISM_HOA3.wav"), - "META": TEST_VECTOR_DIR.joinpath("mixed_scene.txt"), + "ISM1MASA1": LTV_DIR.joinpath("ltv48_OMASA_1ISM_1TC.wav"), + "ISM2MASA1": LTV_DIR.joinpath("ltv48_OMASA_2ISM_1TC.wav"), + "ISM3MASA1": LTV_DIR.joinpath("ltv48_OMASA_3ISM_1TC.wav"), + "ISM4MASA1": LTV_DIR.joinpath("ltv48_OMASA_4ISM_1TC.wav"), + "ISM1MASA2": LTV_DIR.joinpath("ltv48_OMASA_1ISM_2TC.wav"), + "ISM2MASA2": LTV_DIR.joinpath("ltv48_OMASA_2ISM_2TC.wav"), + "ISM3MASA2": LTV_DIR.joinpath("ltv48_OMASA_3ISM_2TC.wav"), + "ISM4MASA2": LTV_DIR.joinpath("ltv48_OMASA_4ISM_2TC.wav"), + "ISM1SBA1": LTV_DIR.joinpath("ltv48_OSBA_1ISM_FOA.wav"), + "ISM1SBA2": LTV_DIR.joinpath("ltv48_OSBA_1ISM_HOA2.wav"), + "ISM1SBA3": LTV_DIR.joinpath("ltv48_OSBA_1ISM_HOA3.wav"), + "ISM2SBA1": LTV_DIR.joinpath("ltv48_OSBA_2ISM_FOA.wav"), + "ISM2SBA2": LTV_DIR.joinpath("ltv48_OSBA_2ISM_HOA2.wav"), + "ISM2SBA3": LTV_DIR.joinpath("ltv48_OSBA_2ISM_HOA3.wav"), + "ISM3SBA1": LTV_DIR.joinpath("ltv48_OSBA_3ISM_FOA.wav"), + "ISM3SBA2": LTV_DIR.joinpath("ltv48_OSBA_3ISM_HOA2.wav"), + "ISM3SBA3": LTV_DIR.joinpath("ltv48_OSBA_3ISM_HOA3.wav"), + "ISM4SBA1": LTV_DIR.joinpath("ltv48_OSBA_4ISM_FOA.wav"), + "ISM4SBA2": LTV_DIR.joinpath("ltv48_OSBA_4ISM_HOA2.wav"), + "ISM4SBA3": LTV_DIR.joinpath("ltv48_OSBA_4ISM_HOA3.wav"), + "META": TEST_VECTOR_DIR.joinpath("mixed_scene_48.txt"), "16ch_8+4+4": LTV_DIR.joinpath("ltv48_HOA3.wav"), - "4d4": LTV_DIR.joinpath("ltv48_MC71.wav"), "t_design_4": LTV_DIR.joinpath("ltv48_MC714.wav"), } @@ -252,44 +251,44 @@ FORMAT_TO_METADATA_FILES = { ], "MASA1": [str(TESTV_DIR.joinpath("stv1MASA1TC48c.met"))], "MASA2": [str(TESTV_DIR.joinpath("stv2MASA2TC48c.met"))], - "OMASA_1_1": [ + "ISM1MASA1": [ str(TESTV_DIR.joinpath("stvISM1.csv")), str(TESTV_DIR.joinpath("stvOMASA_1ISM_1MASA1TC48c.met")), ], - "OMASA_1_2": [ + "ISM2MASA1": [ str(TESTV_DIR.joinpath("stvISM1.csv")), str(TESTV_DIR.joinpath("stvISM2.csv")), str(TESTV_DIR.joinpath("stvOMASA_2ISM_2MASA1TC48c.met")), ], - "OMASA_1_3": [ + "ISM3MASA1": [ str(TESTV_DIR.joinpath("stvISM1.csv")), str(TESTV_DIR.joinpath("stvISM2.csv")), str(TESTV_DIR.joinpath("stvISM3.csv")), str(TESTV_DIR.joinpath("stvOMASA_3ISM_1MASA1TC48c.met")), ], - "OMASA_1_4": [ + "ISM4MASA1": [ str(TESTV_DIR.joinpath("stvISM1.csv")), str(TESTV_DIR.joinpath("stvISM2.csv")), str(TESTV_DIR.joinpath("stvISM3.csv")), str(TESTV_DIR.joinpath("stvISM4.csv")), str(TESTV_DIR.joinpath("stvOMASA_4ISM_2MASA1TC48c.met")), ], - "OMASA_2_1": [ + "ISM1MASA2": [ str(TESTV_DIR.joinpath("stvISM1.csv")), str(TESTV_DIR.joinpath("stvOMASA_1ISM_1MASA2TC48c.met")), ], - "OMASA_2_2": [ + "ISM2MASA2": [ str(TESTV_DIR.joinpath("stvISM1.csv")), str(TESTV_DIR.joinpath("stvISM2.csv")), str(TESTV_DIR.joinpath("stvOMASA_2ISM_2MASA2TC48c.met")), ], - "OMASA_2_3": [ + "ISM3MASA2": [ str(TESTV_DIR.joinpath("stvISM1.csv")), str(TESTV_DIR.joinpath("stvISM2.csv")), str(TESTV_DIR.joinpath("stvISM3.csv")), str(TESTV_DIR.joinpath("stvOMASA_3ISM_1MASA2TC48c.met")), ], - "OMASA_2_4": [ + "ISM4MASA2": [ str(TESTV_DIR.joinpath("stvISM1.csv")), str(TESTV_DIR.joinpath("stvISM2.csv")), str(TESTV_DIR.joinpath("stvISM3.csv")), @@ -315,7 +314,7 @@ FORMAT_TO_METADATA_FILES_LTV = { str(LTV_DIR.joinpath("ltvISM3.csv")), str(LTV_DIR.joinpath("ltvISM4.csv")), ], - "NDP_ISM4": [ # Should not be needed, because it is included in all ISM metadata files. + "NDP_ISM4": [ # Should not be needed, because it is included in all ISM metadata files. str(LTV_DIR.joinpath("ltvISM1.csv")), str(LTV_DIR.joinpath("ltvISM2.csv")), str(LTV_DIR.joinpath("ltvISM3.csv")), @@ -323,44 +322,44 @@ FORMAT_TO_METADATA_FILES_LTV = { ], "MASA1": [str(LTV_DIR.joinpath("ltv48_MASA1TC.met"))], "MASA2": [str(LTV_DIR.joinpath("ltv48_MASA2TC.met"))], - "OMASA_1_1": [ + "ISM1MASA1": [ str(LTV_DIR.joinpath("ltvISM1.csv")), str(LTV_DIR.joinpath("ltv48_OMASA_1ISM_1TC.met")), ], - "OMASA_1_2": [ + "ISM2MASA1": [ str(LTV_DIR.joinpath("ltvISM1.csv")), str(LTV_DIR.joinpath("ltvISM2.csv")), str(LTV_DIR.joinpath("ltv48_OMASA_2ISM_1TC.met")), ], - "OMASA_1_3": [ + "ISM3MASA1": [ str(LTV_DIR.joinpath("ltvISM1.csv")), str(LTV_DIR.joinpath("ltvISM2.csv")), str(LTV_DIR.joinpath("ltvISM3.csv")), str(LTV_DIR.joinpath("ltv48_OMASA_3ISM_1TC.met")), ], - "OMASA_1_4": [ + "ISM4MASA1": [ str(LTV_DIR.joinpath("ltvISM1.csv")), str(LTV_DIR.joinpath("ltvISM2.csv")), str(LTV_DIR.joinpath("ltvISM3.csv")), str(LTV_DIR.joinpath("ltvISM4.csv")), str(LTV_DIR.joinpath("ltv48_OMASA_4ISM_1TC.met")), ], - "OMASA_2_1": [ + "ISM1MASA2": [ str(LTV_DIR.joinpath("ltvISM1.csv")), str(LTV_DIR.joinpath("ltv48_OMASA_1ISM_2TC.met")), ], - "OMASA_2_2": [ + "ISM2MASA2": [ str(LTV_DIR.joinpath("ltvISM1.csv")), str(LTV_DIR.joinpath("ltvISM2.csv")), str(LTV_DIR.joinpath("ltv48_OMASA_2ISM_2TC.met")), ], - "OMASA_2_3": [ + "ISM3MASA2": [ str(LTV_DIR.joinpath("ltvISM1.csv")), str(LTV_DIR.joinpath("ltvISM2.csv")), str(LTV_DIR.joinpath("ltvISM3.csv")), str(LTV_DIR.joinpath("ltv48_OMASA_3ISM_2TC.met")), ], - "OMASA_2_4": [ + "ISM4MASA2": [ str(LTV_DIR.joinpath("ltvISM1.csv")), str(LTV_DIR.joinpath("ltvISM2.csv")), str(LTV_DIR.joinpath("ltvISM3.csv")), @@ -374,6 +373,31 @@ INPUT_FORMATS_AMBI = ["FOA", "HOA2", "HOA3"] INPUT_FORMATS_MC = ["MONO", "STEREO", "5_1", "5_1_2", "5_1_4", "7_1", "7_1_4"] INPUT_FORMATS_ISM = ["ISM1", "ISM2", "ISM3", "ISM4"] INPUT_FORMATS_MASA = ["MASA1", "MASA2"] +INPUT_FORMATS_OMASA = [ + "ISM1MASA1", + "ISM2MASA1", + "ISM3MASA1", + "ISM4MASA1", + "ISM1MASA2", + "ISM2MASA2", + "ISM3MASA2", + "ISM4MASA2", +] +INPUT_FORMATS_OSBA = [ + "ISM1SBA1", + "ISM1SBA2", + "ISM1SBA3", + "ISM2SBA1", + "ISM2SBA2", + "ISM2SBA3", + "ISM3SBA1", + "ISM3SBA2", + "ISM3SBA3", + "ISM4SBA1", + "ISM4SBA2", + "ISM4SBA3", +] + """ Non binaural / parametric output formats """ OUTPUT_FORMATS = [ @@ -392,7 +416,6 @@ OUTPUT_FORMATS = [ """ Custom loudspeaker input/output """ CUSTOM_LS_TO_TEST = [ "t_design_4", - "4d4", "16ch_8+4+4", ] @@ -418,4 +441,3 @@ PEAQ_SUPPORTED_FMT = [ "BINAURAL_ROOM_IR", "BINAURAL_ROOM_REVERB", ] - diff --git a/tests/renderer_short/test_renderer.py b/tests/renderer_short/test_renderer.py index 8cfda2f6db..9a214e3826 100644 --- a/tests/renderer_short/test_renderer.py +++ b/tests/renderer_short/test_renderer.py @@ -33,25 +33,26 @@ the United Nations Convention on Contracts on the International Sales of Goods. import pytest from .constants import ( - FORMAT_TO_METADATA_FILES_LTV, - OUTPUT_FORMATS, - INPUT_FORMATS_AMBI, - FRAMING_TO_TEST, + CUSTOM_LAYOUT_DIR, + CUSTOM_LS_TO_TEST, EXE_SUFFIX, - OUTPUT_FORMATS_BINAURAL, + FRAMING_TO_TEST, HR_TRAJECTORIES_TO_TEST, HR_TRAJECTORY_DIR, - INPUT_FORMATS_MC, + INPUT_FORMATS_AMBI, INPUT_FORMATS_ISM, INPUT_FORMATS_MASA, + INPUT_FORMATS_MC, + INPUT_FORMATS_OMASA, + INPUT_FORMATS_OSBA, + METADATA_SCENES_TO_TEST, METADATA_SCENES_TO_TEST_MASA_PREREND, + OUTPUT_FORMATS, + OUTPUT_FORMATS_BINAURAL, + SAMPLING_RATES, TEST_VECTOR_DIR, - CUSTOM_LS_TO_TEST, - CUSTOM_LAYOUT_DIR, - METADATA_SCENES_TO_TEST, ) -from .utils import run_renderer, compare_renderer_args -from ..conftest import props_to_record +from .utils import compare_renderer_args, run_renderer ############################################################################## # Bit-exactness tests @@ -65,6 +66,7 @@ from ..conftest import props_to_record @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_AMBI) @pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) +@pytest.mark.parametrize("fs", SAMPLING_RATES) def test_ambisonics( record_property, props_to_record, @@ -72,6 +74,7 @@ def test_ambisonics( in_fmt, out_fmt, frame_size, + fs, get_mld, get_mld_lim, get_ssnr, @@ -79,6 +82,26 @@ def test_ambisonics( get_odg_bin, split_comparison, ): + 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": + if frame_size != "5ms": + pytest.skip() + if fs != "32kHz": + pytest.skip() + + if in_fmt == "HOA3": + if frame_size != "20ms": + pytest.skip() + if fs == "32kHz": + pytest.skip() + run_renderer( record_property, props_to_record, @@ -93,12 +116,14 @@ def test_ambisonics( get_odg=get_odg, get_odg_bin=get_odg_bin, split_comparison=split_comparison, + sr=fs, ) @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_AMBI) @pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) +@pytest.mark.parametrize("fs", SAMPLING_RATES) def test_ambisonics_binaural_static( record_property, props_to_record, @@ -106,6 +131,7 @@ def test_ambisonics_binaural_static( in_fmt, out_fmt, frame_size, + fs, get_mld, get_mld_lim, get_ssnr, @@ -113,6 +139,15 @@ def test_ambisonics_binaural_static( get_odg_bin, split_comparison, ): + if in_fmt != "HOA2": + pytest.skip() + + if frame_size != "20ms": + pytest.skip() + + if fs != "48kHz": + pytest.skip() + run_renderer( record_property, props_to_record, @@ -127,6 +162,7 @@ def test_ambisonics_binaural_static( get_odg=get_odg, get_odg_bin=get_odg_bin, split_comparison=split_comparison, + sr=fs, ) @@ -134,6 +170,7 @@ def test_ambisonics_binaural_static( @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_AMBI) @pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) +@pytest.mark.parametrize("fs", SAMPLING_RATES) def test_ambisonics_binaural_headrotation( record_property, props_to_record, @@ -142,6 +179,7 @@ def test_ambisonics_binaural_headrotation( out_fmt, trj_file, frame_size, + fs, get_mld, get_mld_lim, get_ssnr, @@ -149,6 +187,14 @@ def test_ambisonics_binaural_headrotation( get_odg_bin, split_comparison, ): + if in_fmt == "HOA2": + pytest.skip() + + if in_fmt == "FOA" and frame_size != "20ms" and fs != "48kHz": + pytest.skip() + + # Run everything for HOA3 input + run_renderer( record_property, props_to_record, @@ -164,6 +210,7 @@ def test_ambisonics_binaural_headrotation( get_odg=get_odg, get_odg_bin=get_odg_bin, split_comparison=split_comparison, + sr=fs, ) @@ -172,6 +219,7 @@ def test_ambisonics_binaural_headrotation( @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_AMBI) @pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) @pytest.mark.parametrize("aeid", ["1", "0"]) +@pytest.mark.parametrize("fs", SAMPLING_RATES) def test_dynamic_acoustic_environment( record_property, props_to_record, @@ -179,6 +227,7 @@ def test_dynamic_acoustic_environment( in_fmt, out_fmt, frame_size, + fs, get_mld, get_mld_lim, get_ssnr, @@ -187,8 +236,8 @@ def test_dynamic_acoustic_environment( aeid, split_comparison, ): - rend_config_path = TEST_VECTOR_DIR.joinpath(f"rend_config_combined.cfg") - rend_config_path.with_stem(f"rend_config") + rend_config_path = TEST_VECTOR_DIR.joinpath("rend_config_combined.cfg") + rend_config_path.with_stem("rend_config") run_renderer( record_property, @@ -206,13 +255,15 @@ def test_dynamic_acoustic_environment( config_file=rend_config_path, aeid=aeid, split_comparison=split_comparison, + sr=fs, ) -@pytest.mark.skip("MSAN errors in BASOP need to be fixed") +@pytest.mark.skip(reason="Not supported for BASOP code currently") @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL[2:]) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_AMBI) @pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) +@pytest.mark.parametrize("fs", SAMPLING_RATES) def test_dynamic_acoustic_environment_file( record_property, props_to_record, @@ -220,6 +271,7 @@ def test_dynamic_acoustic_environment_file( in_fmt, out_fmt, frame_size, + fs, get_mld, get_mld_lim, get_ssnr, @@ -227,10 +279,10 @@ def test_dynamic_acoustic_environment_file( get_odg_bin, split_comparison, ): - rend_config_path = TEST_VECTOR_DIR.joinpath(f"rend_config_combined.cfg") - rend_config_path.with_stem(f"rend_config") + rend_config_path = TEST_VECTOR_DIR.joinpath("rend_config_combined.cfg") + rend_config_path.with_stem("rend_config") - aeid = TEST_VECTOR_DIR.joinpath(f"aeid1.txt") + aeid = TEST_VECTOR_DIR.joinpath("aeid1.txt") run_renderer( record_property, @@ -248,6 +300,7 @@ def test_dynamic_acoustic_environment_file( config_file=rend_config_path, aeid=aeid, split_comparison=split_comparison, + sr=fs, ) @@ -257,6 +310,7 @@ def test_dynamic_acoustic_environment_file( @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_MC) @pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) +@pytest.mark.parametrize("fs", SAMPLING_RATES) def test_multichannel( record_property, props_to_record, @@ -264,6 +318,7 @@ def test_multichannel( in_fmt, out_fmt, frame_size, + fs, get_mld, get_mld_lim, get_ssnr, @@ -271,6 +326,18 @@ def test_multichannel( get_odg_bin, split_comparison, ): + if in_fmt not in ["STEREO", "7_1_4"]: + if frame_size != "20ms": + pytest.skip() + if fs != "48kHz": + pytest.skip() + if out_fmt not in ["MONO", "STEREO", "FOA", "7_1_4"]: + pytest.skip() + if frame_size != "5ms": + pytest.skip() + + # Run everything for 7_1_4 input + run_renderer( record_property, props_to_record, @@ -285,12 +352,14 @@ def test_multichannel( get_odg=get_odg, get_odg_bin=get_odg_bin, split_comparison=split_comparison, + sr=fs, ) @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_MC) @pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) +@pytest.mark.parametrize("fs", SAMPLING_RATES) def test_multichannel_binaural_static( record_property, props_to_record, @@ -298,6 +367,7 @@ def test_multichannel_binaural_static( in_fmt, out_fmt, frame_size, + fs, get_mld, get_mld_lim, get_ssnr, @@ -308,6 +378,15 @@ def test_multichannel_binaural_static( if in_fmt in ["MONO", "STEREO"]: pytest.skip("MONO or STEREO to Binaural rendering unsupported") + if fs != "48kHz": + pytest.skip() + + if frame_size != "20ms": + pytest.skip() + + if in_fmt not in ["5_1", "7_1_4"]: + pytest.skip() + run_renderer( record_property, props_to_record, @@ -322,6 +401,7 @@ def test_multichannel_binaural_static( get_odg=get_odg, get_odg_bin=get_odg_bin, split_comparison=split_comparison, + sr=fs, ) @@ -329,6 +409,7 @@ def test_multichannel_binaural_static( @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_MC) @pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) +@pytest.mark.parametrize("fs", SAMPLING_RATES) def test_multichannel_binaural_headrotation( record_property, props_to_record, @@ -337,6 +418,7 @@ def test_multichannel_binaural_headrotation( out_fmt, trj_file, frame_size, + fs, get_mld, get_mld_lim, get_ssnr, @@ -347,6 +429,16 @@ def test_multichannel_binaural_headrotation( if in_fmt in ["MONO", "STEREO"]: pytest.skip("MONO or STEREO to Binaural rendering unsupported") + if in_fmt != "5_1_4": + if fs != "48kHz": + pytest.skip() + if in_fmt in ["MONO, 5_1, 7_1_4"] and frame_size != "20ms": + pytest.skip() + if in_fmt not in ["MONO, 5_1, 7_1_4"] and frame_size == "20ms": + pytest.skip() + + # Run everything for 5_1_4 + run_renderer( record_property, props_to_record, @@ -362,6 +454,7 @@ def test_multichannel_binaural_headrotation( get_odg=get_odg, get_odg_bin=get_odg_bin, split_comparison=split_comparison, + sr=fs, ) @@ -371,6 +464,7 @@ def test_multichannel_binaural_headrotation( @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_ISM) @pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) +@pytest.mark.parametrize("fs", SAMPLING_RATES) def test_ism( record_property, props_to_record, @@ -378,6 +472,7 @@ def test_ism( in_fmt, out_fmt, frame_size, + fs, get_mld, get_mld_lim, get_ssnr, @@ -385,6 +480,22 @@ def test_ism( get_odg_bin, split_comparison, ): + 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() + + 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, props_to_record, @@ -399,12 +510,14 @@ def test_ism( get_odg=get_odg, get_odg_bin=get_odg_bin, split_comparison=split_comparison, + sr=fs, ) @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_ISM) @pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) +@pytest.mark.parametrize("fs", SAMPLING_RATES) def test_ism_binaural_static( record_property, props_to_record, @@ -412,6 +525,7 @@ def test_ism_binaural_static( in_fmt, out_fmt, frame_size, + fs, get_mld, get_mld_lim, get_ssnr, @@ -419,6 +533,20 @@ def test_ism_binaural_static( get_odg_bin, split_comparison, ): + 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 + run_renderer( record_property, props_to_record, @@ -433,6 +561,7 @@ def test_ism_binaural_static( get_odg=get_odg, get_odg_bin=get_odg_bin, split_comparison=split_comparison, + sr=fs, ) @@ -440,6 +569,7 @@ def test_ism_binaural_static( @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_ISM) @pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) +@pytest.mark.parametrize("fs", SAMPLING_RATES) def test_ism_binaural_headrotation( record_property, props_to_record, @@ -448,6 +578,7 @@ def test_ism_binaural_headrotation( out_fmt, trj_file, frame_size, + fs, get_mld, get_mld_lim, get_ssnr, @@ -455,6 +586,14 @@ def test_ism_binaural_headrotation( get_odg_bin, split_comparison, ): + if in_fmt != "ISM4": + if frame_size != "5ms": + pytest.skip() + if fs != "32kHz": + pytest.skip() + + # Run everything for ISM4 + run_renderer( record_property, props_to_record, @@ -470,6 +609,7 @@ def test_ism_binaural_headrotation( get_odg=get_odg, get_odg_bin=get_odg_bin, split_comparison=split_comparison, + sr=fs, ) @@ -479,6 +619,7 @@ def test_ism_binaural_headrotation( @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_MASA) @pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) +@pytest.mark.parametrize("fs", SAMPLING_RATES) def test_masa( record_property, props_to_record, @@ -486,6 +627,7 @@ def test_masa( in_fmt, out_fmt, frame_size, + fs, get_mld, get_mld_lim, get_ssnr, @@ -493,6 +635,46 @@ def test_masa( get_odg_bin, split_comparison, ): + if fs == "32kHz" and out_fmt in [ + "STEREO", + "5_1", + "5_1_2", + "5_1_4", + "7_1", + "7_1_4", + "FOA", + "HOA2", + ]: + pytest.skip() + + if fs == "16kHz" and out_fmt in [ + "5_1_2", + "5_1_4", + "7_1", + "7_1_4", + "FOA", + "HOA2", + "HOA3", + ]: + pytest.skip() + + if fs in ["16kHz", "32kHz"] and frame_size == "5ms": + pytest.skip() + + 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, props_to_record, @@ -507,12 +689,14 @@ def test_masa( get_odg=get_odg, get_odg_bin=get_odg_bin, split_comparison=split_comparison, + sr=fs, ) @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_MASA) @pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) +@pytest.mark.parametrize("fs", SAMPLING_RATES) def test_masa_binaural_static( record_property, props_to_record, @@ -520,6 +704,7 @@ def test_masa_binaural_static( in_fmt, out_fmt, frame_size, + fs, get_mld, get_mld_lim, get_ssnr, @@ -527,8 +712,10 @@ def test_masa_binaural_static( get_odg_bin, split_comparison, ): - if out_fmt in ["BINAURAL_ROOM_IR", "BINAURAL_ROOM_REVERB"]: - pytest.skip("Skipping binaural room outputs for MASA as unimplemented.") + if fs in ["16kHz", "32kHz"] and frame_size == "5ms": + pytest.skip() + + # fs == 48 tests everything run_renderer( record_property, @@ -544,6 +731,7 @@ def test_masa_binaural_static( get_odg=get_odg, get_odg_bin=get_odg_bin, split_comparison=split_comparison, + sr=fs, ) @@ -551,6 +739,7 @@ def test_masa_binaural_static( @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_MASA) @pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) +@pytest.mark.parametrize("fs", SAMPLING_RATES) def test_masa_binaural_headrotation( record_property, props_to_record, @@ -559,6 +748,7 @@ def test_masa_binaural_headrotation( out_fmt, trj_file, frame_size, + fs, get_mld, get_mld_lim, get_ssnr, @@ -566,8 +756,13 @@ def test_masa_binaural_headrotation( get_odg_bin, split_comparison, ): - if out_fmt in ["BINAURAL_ROOM_IR", "BINAURAL_ROOM_REVERB"]: - pytest.skip("Skipping binaural room outputs for MASA as unimplemented.") + if fs == 32 and frame_size == "20ms": + pytest.skip() + + if fs == 16 and frame_size == "5ms": + pytest.skip() + + # fs == 48 tests everything run_renderer( record_property, @@ -584,15 +779,57 @@ def test_masa_binaural_headrotation( get_odg=get_odg, get_odg_bin=get_odg_bin, split_comparison=split_comparison, + sr=fs, ) -@pytest.mark.parametrize("in_fmt", METADATA_SCENES_TO_TEST_MASA_PREREND) +@pytest.mark.parametrize("out_fmt", INPUT_FORMATS_MASA) +@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_OMASA) +@pytest.mark.parametrize("fs", SAMPLING_RATES) def test_masa_prerend( record_property, props_to_record, test_info, in_fmt, + out_fmt, + fs, + get_mld, + get_mld_lim, + get_ssnr, + get_odg, + get_odg_bin, + split_comparison, +): + if in_fmt not in ["ISM4MASA2", "ISM1MASA1"] and fs != "48kHz": + pytest.skip() + + run_renderer( + record_property, + props_to_record, + test_info, + in_fmt, + out_fmt, + binary_suffix=EXE_SUFFIX, + get_mld=get_mld, + mld_lim=get_mld_lim, + get_ssnr=get_ssnr, + get_odg=get_odg, + get_odg_bin=get_odg_bin, + split_comparison=split_comparison, + sr=fs, + ) + + +@pytest.mark.parametrize("out_fmt", INPUT_FORMATS_MASA) +@pytest.mark.parametrize("in_fmt", METADATA_SCENES_TO_TEST_MASA_PREREND) +@pytest.mark.parametrize("fs", SAMPLING_RATES) +def test_masa_prerend_scenes( + record_property, + props_to_record, + test_info, + in_fmt, + out_fmt, + fs, get_mld, get_mld_lim, get_ssnr, @@ -600,20 +837,326 @@ def test_masa_prerend( get_odg_bin, split_comparison, ): + # Test all scenes + run_renderer( record_property, props_to_record, test_info, "META", - "MASA2", - metadata_input=TEST_VECTOR_DIR.joinpath(f"{in_fmt}.txt"), + out_fmt, + metadata_input=TEST_VECTOR_DIR.joinpath(f"{in_fmt}_{fs[:2]}.txt"), + binary_suffix=EXE_SUFFIX, + get_mld=get_mld, + mld_lim=get_mld_lim, + get_ssnr=get_ssnr, + get_odg=get_odg, + get_odg_bin=get_odg_bin, + split_comparison=split_comparison, + sr=fs, + ) + + +""" OMASA """ + + +@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS) +@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_OMASA) +@pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) +@pytest.mark.parametrize("fs", SAMPLING_RATES) +def test_omasa( + record_property, + props_to_record, + test_info, + in_fmt, + out_fmt, + fs, + frame_size, + get_mld, + get_mld_lim, + get_ssnr, + get_odg, + get_odg_bin, + split_comparison, +): + 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() + + if in_fmt in ["ISM3MASA1", "ISM2MASA2", "ISM1MASA1"]: + pytest.skip() + + if out_fmt in ["5_1", "5_1_4", "7_1_4", "FOA", "HOA2"]: + if frame_size != "20ms": + pytest.skip() + if fs != "16kHz": + pytest.skip() + + # Test all for ISM4MASA2 + + run_renderer( + record_property, + props_to_record, + test_info, + in_fmt, + out_fmt, + binary_suffix=EXE_SUFFIX, + frame_size=frame_size, + get_mld=get_mld, + mld_lim=get_mld_lim, + get_ssnr=get_ssnr, + get_odg=get_odg, + get_odg_bin=get_odg_bin, + split_comparison=split_comparison, + sr=fs, + ) + + +@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) +@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_OMASA) +@pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) +@pytest.mark.parametrize("fs", SAMPLING_RATES) +def test_omasa_binaural_static( + record_property, + props_to_record, + test_info, + in_fmt, + out_fmt, + fs, + frame_size, + get_mld, + get_mld_lim, + get_ssnr, + get_odg, + get_odg_bin, + split_comparison, +): + if in_fmt != "ISM4MASA2": + if fs != "48kHz": + pytest.skip() + if frame_size != "20ms": + pytest.skip() + + if in_fmt in ["ISM3MASA2", "ISM2MASA1", "ISM1MASA2", "ISM4MASA1"]: + pytest.skip() + + # Test all for ISM4MASA2 + + run_renderer( + record_property, + props_to_record, + test_info, + in_fmt, + out_fmt, binary_suffix=EXE_SUFFIX, + frame_size=frame_size, get_mld=get_mld, mld_lim=get_mld_lim, get_ssnr=get_ssnr, get_odg=get_odg, get_odg_bin=get_odg_bin, split_comparison=split_comparison, + sr=fs, + ) + + +@pytest.mark.parametrize("trj_file", HR_TRAJECTORIES_TO_TEST) +@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) +@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_OMASA) +@pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) +@pytest.mark.parametrize("fs", SAMPLING_RATES) +def test_omasa_binaural_headrotation( + record_property, + props_to_record, + test_info, + in_fmt, + out_fmt, + fs, + trj_file, + frame_size, + get_mld, + get_mld_lim, + get_ssnr, + get_odg, + get_odg_bin, + split_comparison, +): + 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"] + + run_renderer( + record_property, + props_to_record, + test_info, + in_fmt, + out_fmt, + trj_file=HR_TRAJECTORY_DIR.joinpath(f"{trj_file}.csv"), + binary_suffix=EXE_SUFFIX, + frame_size=frame_size, + get_mld=get_mld, + mld_lim=get_mld_lim, + get_ssnr=get_ssnr, + get_odg=get_odg, + get_odg_bin=get_odg_bin, + split_comparison=split_comparison, + sr=fs, + ) + + +""" OSBA """ + + +@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS) +@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_OSBA) +@pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) +@pytest.mark.parametrize("fs", SAMPLING_RATES) +def test_osba( + record_property, + props_to_record, + test_info, + in_fmt, + out_fmt, + fs, + frame_size, + get_mld, + get_mld_lim, + get_ssnr, + get_odg, + get_odg_bin, + split_comparison, +): + 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() + + if out_fmt in ["HOA3", "5_1"]: + pytest.skip() + # Test all for ISM4SBA3 + + run_renderer( + record_property, + props_to_record, + test_info, + in_fmt, + out_fmt, + binary_suffix=EXE_SUFFIX, + frame_size=frame_size, + get_mld=get_mld, + mld_lim=get_mld_lim, + get_ssnr=get_ssnr, + get_odg=get_odg, + get_odg_bin=get_odg_bin, + split_comparison=split_comparison, + sr=fs, + ) + + +@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) +@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_OSBA) +@pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) +@pytest.mark.parametrize("fs", SAMPLING_RATES) +def test_osba_binaural_static( + record_property, + props_to_record, + test_info, + in_fmt, + out_fmt, + fs, + frame_size, + get_mld, + get_mld_lim, + get_ssnr, + get_odg, + get_odg_bin, + split_comparison, +): + if in_fmt != "ISM4SBA3": + pytest.skip() + + if fs != "48kHz": + pytest.skip() + + if frame_size != "20ms": + pytest.skip() + + # Test all for ISM4SBA3 + + run_renderer( + record_property, + props_to_record, + test_info, + in_fmt, + out_fmt, + binary_suffix=EXE_SUFFIX, + frame_size=frame_size, + get_mld=get_mld, + mld_lim=get_mld_lim, + get_ssnr=get_ssnr, + get_odg=get_odg, + get_odg_bin=get_odg_bin, + split_comparison=split_comparison, + sr=fs, + ) + + +@pytest.mark.parametrize("trj_file", HR_TRAJECTORIES_TO_TEST) +@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) +@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_OSBA) +@pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) +@pytest.mark.parametrize("fs", SAMPLING_RATES) +def test_osba_binaural_headrotation( + record_property, + props_to_record, + test_info, + in_fmt, + out_fmt, + fs, + trj_file, + frame_size, + get_mld, + get_mld_lim, + get_ssnr, + get_odg, + get_odg_bin, + split_comparison, +): + 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"] + + run_renderer( + record_property, + props_to_record, + test_info, + in_fmt, + out_fmt, + trj_file=HR_TRAJECTORY_DIR.joinpath(f"{trj_file}.csv"), + binary_suffix=EXE_SUFFIX, + frame_size=frame_size, + get_mld=get_mld, + mld_lim=get_mld_lim, + get_ssnr=get_ssnr, + get_odg=get_odg, + get_odg_bin=get_odg_bin, + split_comparison=split_comparison, + sr=fs, ) @@ -623,6 +1166,7 @@ def test_masa_prerend( @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS) @pytest.mark.parametrize("in_layout", CUSTOM_LS_TO_TEST) @pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) +@pytest.mark.parametrize("fs", SAMPLING_RATES) def test_custom_ls_input( record_property, props_to_record, @@ -630,6 +1174,7 @@ def test_custom_ls_input( in_layout, out_fmt, frame_size, + fs, get_mld, get_mld_lim, get_ssnr, @@ -637,6 +1182,14 @@ def test_custom_ls_input( get_odg_bin, split_comparison, ): + if out_fmt not in ["7_1, FOA, STEREO"]: + if fs != "48kHz": + pytest.skip() + if frame_size != "20ms": + pytest.skip() + + # Test rest + run_renderer( record_property, props_to_record, @@ -651,20 +1204,30 @@ def test_custom_ls_input( get_odg=get_odg, get_odg_bin=get_odg_bin, split_comparison=split_comparison, + sr=fs, ) @pytest.mark.parametrize("out_fmt", CUSTOM_LS_TO_TEST) @pytest.mark.parametrize( "in_fmt", - [*INPUT_FORMATS_AMBI, *INPUT_FORMATS_MC, *INPUT_FORMATS_ISM, *INPUT_FORMATS_MASA], + [ + *INPUT_FORMATS_AMBI, + *INPUT_FORMATS_MC, + *INPUT_FORMATS_ISM, + *INPUT_FORMATS_MASA, + *INPUT_FORMATS_OMASA, + *INPUT_FORMATS_OSBA, + ], ) +@pytest.mark.parametrize("fs", SAMPLING_RATES) def test_custom_ls_output( record_property, props_to_record, test_info, in_fmt, out_fmt, + fs, get_mld, get_mld_lim, get_ssnr, @@ -672,11 +1235,23 @@ def test_custom_ls_output( get_odg_bin, split_comparison, ): - # TODO: revert once BASOP is brought up-to-date - if in_fmt in INPUT_FORMATS_MASA: - pytest.skip("MASA to custom LS not supported on ivas-float-update yet") - if in_fmt in INPUT_FORMATS_ISM and out_fmt == "t_design_4": - pytest.skip("ISMx + t_design_4 skipped until bug in BASOP is fixed") + 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, @@ -690,17 +1265,20 @@ def test_custom_ls_output( get_odg=get_odg, get_odg_bin=get_odg_bin, split_comparison=split_comparison, + sr=fs, ) @pytest.mark.parametrize("out_fmt", CUSTOM_LS_TO_TEST) @pytest.mark.parametrize("in_fmt", CUSTOM_LS_TO_TEST) +@pytest.mark.parametrize("fs", SAMPLING_RATES) def test_custom_ls_input_output( record_property, props_to_record, test_info, in_fmt, out_fmt, + fs, get_mld, get_mld_lim, get_ssnr, @@ -721,12 +1299,14 @@ def test_custom_ls_input_output( get_odg=get_odg, get_odg_bin=get_odg_bin, split_comparison=split_comparison, + sr=fs, ) @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) @pytest.mark.parametrize("in_layout", CUSTOM_LS_TO_TEST) @pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) +@pytest.mark.parametrize("fs", SAMPLING_RATES) def test_custom_ls_input_binaural( record_property, props_to_record, @@ -734,6 +1314,7 @@ def test_custom_ls_input_binaural( in_layout, out_fmt, frame_size, + fs, get_mld, get_mld_lim, get_ssnr, @@ -741,6 +1322,9 @@ def test_custom_ls_input_binaural( get_odg_bin, split_comparison, ): + if fs != "48kHz" or frame_size != "20ms": + pytest.skip() + run_renderer( record_property, props_to_record, @@ -755,6 +1339,7 @@ def test_custom_ls_input_binaural( get_odg=get_odg, get_odg_bin=get_odg_bin, split_comparison=split_comparison, + sr=fs, ) @@ -762,6 +1347,7 @@ def test_custom_ls_input_binaural( @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) @pytest.mark.parametrize("in_layout", CUSTOM_LS_TO_TEST) @pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) +@pytest.mark.parametrize("fs", SAMPLING_RATES) def test_custom_ls_input_binaural_headrotation( record_property, props_to_record, @@ -770,6 +1356,7 @@ def test_custom_ls_input_binaural_headrotation( out_fmt, trj_file, frame_size, + fs, get_mld, get_mld_lim, get_ssnr, @@ -777,6 +1364,12 @@ def test_custom_ls_input_binaural_headrotation( get_odg_bin, split_comparison, ): + if fs == "32kHz" and frame_size == "5ms": + pytest.skip() + + if fs == "16kHz" and frame_size == "20ms": + pytest.skip() + run_renderer( record_property, props_to_record, @@ -792,6 +1385,7 @@ def test_custom_ls_input_binaural_headrotation( get_odg=get_odg, get_odg_bin=get_odg_bin, split_comparison=split_comparison, + sr=fs, ) @@ -801,6 +1395,7 @@ def test_custom_ls_input_binaural_headrotation( @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS) @pytest.mark.parametrize("in_fmt", METADATA_SCENES_TO_TEST) @pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) +@pytest.mark.parametrize("fs", SAMPLING_RATES) def test_metadata( record_property, props_to_record, @@ -808,6 +1403,7 @@ def test_metadata( in_fmt, out_fmt, frame_size, + fs, get_mld, get_mld_lim, get_ssnr, @@ -815,13 +1411,22 @@ 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, test_info, "META", out_fmt, - metadata_input=TEST_VECTOR_DIR.joinpath(f"{in_fmt}.txt"), + metadata_input=TEST_VECTOR_DIR.joinpath(f"{in_fmt}_{fs[:2]}.txt"), binary_suffix=EXE_SUFFIX, frame_size=frame_size, get_mld=get_mld, @@ -830,6 +1435,7 @@ def test_metadata( get_odg=get_odg, get_odg_bin=get_odg_bin, split_comparison=split_comparison, + sr=fs, ) @@ -839,6 +1445,7 @@ def test_metadata( @pytest.mark.parametrize("out_fmt", ["STEREO"]) @pytest.mark.parametrize("in_fmt", ["MONO"]) @pytest.mark.parametrize("non_diegetic_pan", ["0", "-30", "45", "90", "-90"]) +@pytest.mark.parametrize("fs", SAMPLING_RATES) def test_non_diegetic_pan_static( record_property, props_to_record, @@ -846,6 +1453,7 @@ def test_non_diegetic_pan_static( in_fmt, out_fmt, non_diegetic_pan, + fs, get_mld, get_mld_lim, get_ssnr, @@ -853,6 +1461,12 @@ def test_non_diegetic_pan_static( get_odg_bin, split_comparison, ): + if non_diegetic_pan in ["0", "45", "-90"] and fs == "32kHz": + pytest.skip() + + if non_diegetic_pan not in ["0", "45", "-90"] and fs == "16kHz": + pytest.skip() + run_renderer( record_property, props_to_record, @@ -867,18 +1481,21 @@ def test_non_diegetic_pan_static( get_odg=get_odg, get_odg_bin=get_odg_bin, split_comparison=split_comparison, + sr=fs, ) @pytest.mark.parametrize("out_fmt", ["STEREO"]) @pytest.mark.parametrize("in_fmt", ["ISM1"]) @pytest.mark.parametrize("non_diegetic_pan", ["0", "-30", "45", "90", "-90"]) +@pytest.mark.parametrize("fs", SAMPLING_RATES) def test_non_diegetic_pan_ism_static( record_property, props_to_record, test_info, in_fmt, out_fmt, + fs, non_diegetic_pan, get_mld, get_mld_lim, @@ -887,6 +1504,12 @@ def test_non_diegetic_pan_ism_static( get_odg_bin, split_comparison, ): + if non_diegetic_pan in ["0", "45", "-90"] and fs == "16kHz": + pytest.skip() + + if non_diegetic_pan not in ["0", "45", "-90"] and fs == "32kHz": + pytest.skip() + run_renderer( record_property, props_to_record, @@ -901,6 +1524,7 @@ def test_non_diegetic_pan_ism_static( get_odg=get_odg, get_odg_bin=get_odg_bin, split_comparison=split_comparison, + sr=fs, ) @@ -1044,31 +1668,27 @@ def test_ambisonics_binaural_headrotation_refvecequal( if test_info.config.option.create_ref or test_info.config.option.create_cut: pytest.skip("OTR tests only run for smoke test") - # TODO revert - if in_fmt == "HOA3" and out_fmt == "BINAURAL_ROOM_REVERB": - pytest.xfail("WIP : minor differences to be resolved") - else: - compare_renderer_args( - record_property, - props_to_record, - test_info, - in_fmt, - out_fmt, - ref_kwargs={ - "name_extension": "refvecequal", - "frame_size": "5", - }, - cut_kwargs={ - "trj_file": HR_TRAJECTORY_DIR.joinpath( - "full-circle-with-up-and-down-4s.csv" - ), - "refvec_file": HR_TRAJECTORY_DIR.joinpath( - "full-circle-with-up-and-down-4s-Vector3.csv" - ), - "frame_size": "5", - }, - split_comparison=split_comparison, - ) + compare_renderer_args( + record_property, + props_to_record, + test_info, + in_fmt, + out_fmt, + ref_kwargs={ + "name_extension": "refvecequal", + "frame_size": "5", + }, + cut_kwargs={ + "trj_file": HR_TRAJECTORY_DIR.joinpath( + "full-circle-with-up-and-down-4s.csv" + ), + "refvec_file": HR_TRAJECTORY_DIR.joinpath( + "full-circle-with-up-and-down-4s-Vector3.csv" + ), + "frame_size": "5", + }, + split_comparison=split_comparison, + ) # This test compares rendering with: @@ -1088,32 +1708,28 @@ def test_ambisonics_binaural_headrotation_refvec_rotating( if test_info.config.option.create_ref or test_info.config.option.create_cut: pytest.skip("OTR tests only run for smoke test") - # TODO revert - if in_fmt == "HOA2" and out_fmt == "BINAURAL_ROOM_REVERB": - pytest.xfail("WIP : minor differences to be resolved") - else: - compare_renderer_args( - record_property, - props_to_record, - test_info, - in_fmt, - out_fmt, - ref_kwargs={ - "name_extension": "refvec_rotating", - "trj_file": HR_TRAJECTORY_DIR.joinpath( - "full-circle-with-up-and-down-4s.csv" - ), - "frame_size": "5", - }, - cut_kwargs={ - "trj_file": HR_TRAJECTORY_DIR.joinpath("const000.csv"), - "refvec_file": HR_TRAJECTORY_DIR.joinpath( - "full-circle-with-up-and-down-4s-ccw-Vector3.csv" - ), - "frame_size": "5", - }, - split_comparison=split_comparison, - ) + compare_renderer_args( + record_property, + props_to_record, + test_info, + in_fmt, + out_fmt, + ref_kwargs={ + "name_extension": "refvec_rotating", + "trj_file": HR_TRAJECTORY_DIR.joinpath( + "full-circle-with-up-and-down-4s.csv" + ), + "frame_size": "5", + }, + cut_kwargs={ + "trj_file": HR_TRAJECTORY_DIR.joinpath("const000.csv"), + "refvec_file": HR_TRAJECTORY_DIR.joinpath( + "full-circle-with-up-and-down-4s-ccw-Vector3.csv" + ), + "frame_size": "5", + }, + split_comparison=split_comparison, + ) # This test compares rendering with: diff --git a/tests/renderer_short/utils.py b/tests/renderer_short/utils.py index 9afda68b94..1aa7370f08 100644 --- a/tests/renderer_short/utils.py +++ b/tests/renderer_short/utils.py @@ -30,44 +30,44 @@ accordance with the laws of the Federal Republic of Germany excluding its confli the United Nations Convention on Contracts on the International Sales of Goods. """ +import errno import filecmp import logging import os -from pathlib import Path +import re import subprocess as sp import sys +import tempfile +from pathlib import Path from typing import Dict, Optional, Union import numpy as np import pytest -import re -import errno -import tempfile +from ..constants import CAT_NORMAL from .compare_audio import compare_audio_arrays from .constants import ( - LTV_DIR, - SCRIPTS_DIR, - OUTPUT_PATH_REF, - OUTPUT_PATH_CUT, + BIN_SUFFIX_MERGETARGET, FORMAT_TO_FILE_COMPARETEST, FORMAT_TO_FILE_LTV, + FORMAT_TO_FILE_SMOKETEST, FORMAT_TO_METADATA_FILES, FORMAT_TO_METADATA_FILES_LTV, - FORMAT_TO_FILE_SMOKETEST, - RENDERER_CMD, - BIN_SUFFIX_MERGETARGET, + LTV_DIR, + OUTPUT_PATH_CUT, + OUTPUT_PATH_REF, PEAQ_SUPPORTED_FMT, + RENDERER_CMD, + SCRIPTS_DIR, ) -from ..constants import CAT_NORMAL sys.path.append(SCRIPTS_DIR) from pyaudio3dtools.audiofile import readfile -from ..cmp_pcm import cmp_pcm -from ..conftest import parse_properties, get_split_idx +from ..cmp_pcm import cmp_pcm +from ..conftest import get_split_idx, parse_properties -def _run_cmd(cmd, env, test_info=None): +def _run_cmd(cmd, test_info=None, env=None ): """ Helper function for running some command. Raises a SystemError if either the return code is non-zero or a USAN printout is detected @@ -92,29 +92,30 @@ def _run_cmd(cmd, env, test_info=None): raise SystemError(error) -def run_cmd(cmd, test_info, env=None): +def run_cmd(cmd, test_info=None, env=None): logging.info(f"\nRunning command\n{' '.join(cmd)}\n") - _run_cmd(cmd, env, test_info) + _run_cmd(cmd, test_info=test_info, env=env) -def run_isar_ext_rend_cmd(cmd, env=None): +def run_isar_ext_rend_cmd(cmd, test_info=None, env=None): logging.info(f"\nRunning ISAR EXT REND command\n{' '.join(cmd)}\n") - _run_cmd(cmd, env) + _run_cmd(cmd, test_info=test_info, env=env) -def run_ivas_isar_enc_cmd(cmd, env=None): +def run_ivas_isar_enc_cmd(cmd, test_info=None, env=None): logging.info(f"\nRunning IVAS ISAR encoder command\n{' '.join(cmd)}\n") - _run_cmd(cmd, env) - - -def run_ivas_isar_dec_cmd(cmd, env=None): - logging.info(f"\nDUT decoder command:\n\t{' '.join(cmd)}\n") - _run_cmd(cmd, env) + _run_cmd(cmd, test_info=test_info, env=env) +def run_ivas_isar_dec_cmd(cmd, test_info=None, env=None): + if BIN_SUFFIX_MERGETARGET in cmd[0]: + logging.info(f"\nREF decoder command:\n\t{' '.join(cmd)}\n") + else: + logging.info(f"\nDUT decoder command:\n\t{' '.join(cmd)}\n") + _run_cmd(cmd, test_info=test_info, env=env) -def run_isar_post_rend_cmd(cmd, env=None): +def run_isar_post_rend_cmd(cmd, test_info=None, env=None): logging.info(f"\nRunning ISAR post renderer command\n{' '.join(cmd)}\n") - _run_cmd(cmd, env) + _run_cmd(cmd, test_info=test_info, env=env) def check_BE( @@ -175,7 +176,7 @@ def run_renderer( aeid: Optional[Union[Path, int]] = None, in_file=None, out_file=None, - sr=48, + sr="48kHz", render_for_peaq=False, split_comparison=False, ) -> str: @@ -267,12 +268,20 @@ def run_renderer( else: in_file = format_to_file[in_fmt] in_name = in_fmt + in_file = str(in_file).replace("48", sr[:2]) if in_meta_files is None and in_fmt in format_to_metadata_files: in_meta_files = format_to_metadata_files[in_fmt] + # If metadata not given with ISM input, use default NULL + if in_meta_files is None and isinstance(in_fmt, str) and "ism" in in_fmt.lower(): + match = re.search(r"ism(\d)", in_fmt.lower()) + assert match is not None + num_obj = int(match[1]) + in_meta_files = ["NULL"] * num_obj + if out_file is None: - out_file_stem = f"{in_name}_to_{out_name}{trj_name}{non_diegetic_pan}{refrot_name}{refvec_name}{refveclev_name}{config_name}{framing_name}{hrtf_file_name}{name_extension}{aeid_name}.wav" + out_file_stem = f"{in_name}_to_{out_name}{trj_name}{non_diegetic_pan}{refrot_name}{refvec_name}{refveclev_name}{config_name}{framing_name}{hrtf_file_name}{name_extension}{aeid_name}_{sr}.wav" out_file = str(output_path_base.joinpath(out_file_stem)) cmd = RENDERER_CMD[:] @@ -280,7 +289,7 @@ def run_renderer( cmd[4] = str(in_fmt) cmd[6] = str(out_file) cmd[8] = str(out_fmt) - cmd[10] = str(sr) + cmd[10] = str(sr[:2]) if test_info.config.option.create_ref: cmd[0] += BIN_SUFFIX_MERGETARGET @@ -370,7 +379,7 @@ def run_renderer( cmd2[4] = str(out_fmt) # in_fmt cmd2[6] = odg_test # out_file cmd2[8] = new_fmt # out_fmt - cmd2[10] = str(sr) + cmd2[10] = str(sr[:2]) cmd2[0] += BIN_SUFFIX_MERGETARGET # Use IVAS_rend_ref for re-rendering cmd2[0] += binary_suffix if "MASA" in str(out_fmt): @@ -551,8 +560,8 @@ def binauralize_input_and_output( # If extended metadata is not used, strip the metadata for the external renderer extended_md_used = ( re.search(r"-ism\s?\+[1-4]", enc_opts) - and not "OMASA" in in_fmt - and not "OSBA" in in_fmt + and "OMASA" not in in_fmt + and "OSBA" not in in_fmt ) if not extended_md_used and n_obj > 0: truncated_meta_files = [] @@ -634,7 +643,7 @@ def binauralize_input_and_output( aeid = findstr(r"-aeid\s+(\S+)", dec_opts) - if not output_config.upper() in PEAQ_SUPPORTED_FMT: + if output_config.upper() not in PEAQ_SUPPORTED_FMT: # Render output to BINAURAL output_reformat = "BINAURAL" -- GitLab