Loading tests/split_rendering/test_split_rendering.py +234 −12 Original line number Diff line number Diff line Loading @@ -44,12 +44,21 @@ from tests.split_rendering.utils import * @pytest.mark.parametrize("bitrate", IVAS_BITRATES_AMBI) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_AMBI_SPLIT_REND) def test_ambisonics_full_chain_split( record_property, props_to_record, get_mld, get_mld_lim, get_ssnr, get_odg, get_odg_bin, test_info, in_fmt, bitrate, render_config, trajectory ): post_trajectory = HR_TRAJECTORY_DIR.joinpath(f"{trajectory}.csv") pre_trajectory = post_trajectory.with_stem(f"{post_trajectory.stem}_delayed") run_full_chain_split_rendering( record_property, props_to_record, test_info, in_fmt=in_fmt, bitrate=bitrate, Loading @@ -57,6 +66,11 @@ def test_ambisonics_full_chain_split( binary_suffix=EXE_SUFFIX, pre_trajectory=pre_trajectory, post_trajectory=post_trajectory, get_mld=get_mld, mld_lim=get_mld_lim, get_ssnr=get_ssnr, get_odg=get_odg, get_odg_bin=get_odg_bin, ) Loading @@ -64,16 +78,31 @@ def test_ambisonics_full_chain_split( @pytest.mark.parametrize("trajectory", SPLIT_REND_HR_TRAJECTORIES_TO_TEST) @pytest.mark.parametrize("render_config", RENDERER_CONFIGS_TO_TEST_AMBI) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_AMBI_SPLIT_REND) def test_ambisonics_external_split(test_info, in_fmt, render_config, trajectory): def test_ambisonics_external_split( record_property, props_to_record, get_mld, get_mld_lim, get_ssnr, get_odg, get_odg_bin, test_info, in_fmt, render_config, trajectory): post_trajectory = HR_TRAJECTORY_DIR.joinpath(f"{trajectory}.csv") pre_trajectory = post_trajectory.with_stem(f"{post_trajectory.stem}_delayed") run_external_split_rendering( record_property, props_to_record, test_info, in_fmt=in_fmt, render_config=RENDER_CFG_DIR.joinpath(f"{render_config}.txt"), pre_trajectory=pre_trajectory, post_trajectory=post_trajectory, get_mld=get_mld, mld_lim=get_mld_lim, get_ssnr=get_ssnr, get_odg=get_odg, get_odg_bin=get_odg_bin, ) Loading @@ -86,12 +115,21 @@ def test_ambisonics_external_split(test_info, in_fmt, render_config, trajectory) @pytest.mark.parametrize("bitrate", IVAS_BITRATES_MC) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_MC_SPLIT_REND) def test_multichannel_full_chain_split( record_property, props_to_record, get_mld, get_mld_lim, get_ssnr, get_odg, get_odg_bin, test_info, in_fmt, bitrate, render_config, trajectory ): post_trajectory = HR_TRAJECTORY_DIR.joinpath(f"{trajectory}.csv") pre_trajectory = post_trajectory.with_stem(f"{post_trajectory.stem}_delayed") run_full_chain_split_rendering( record_property, props_to_record, test_info, in_fmt=in_fmt, bitrate=bitrate, Loading @@ -99,6 +137,11 @@ def test_multichannel_full_chain_split( binary_suffix=EXE_SUFFIX, pre_trajectory=pre_trajectory, post_trajectory=post_trajectory, get_mld=get_mld, mld_lim=get_mld_lim, get_ssnr=get_ssnr, get_odg=get_odg, get_odg_bin=get_odg_bin, ) Loading @@ -106,16 +149,31 @@ def test_multichannel_full_chain_split( @pytest.mark.parametrize("trajectory", SPLIT_REND_HR_TRAJECTORIES_TO_TEST) @pytest.mark.parametrize("render_config", RENDERER_CONFIGS_TO_TEST_MC) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_MC_SPLIT_REND) def test_multichannel_external_split(test_info, in_fmt, render_config, trajectory): def test_multichannel_external_split( record_property, props_to_record, get_mld, get_mld_lim, get_ssnr, get_odg, get_odg_bin, test_info, in_fmt, render_config, trajectory): post_trajectory = HR_TRAJECTORY_DIR.joinpath(f"{trajectory}.csv") pre_trajectory = post_trajectory.with_stem(f"{post_trajectory.stem}_delayed") run_external_split_rendering( record_property, props_to_record, test_info, in_fmt=in_fmt, render_config=RENDER_CFG_DIR.joinpath(f"{render_config}.txt"), pre_trajectory=pre_trajectory, post_trajectory=post_trajectory, get_mld=get_mld, mld_lim=get_mld_lim, get_ssnr=get_ssnr, get_odg=get_odg, get_odg_bin=get_odg_bin, ) Loading @@ -127,11 +185,21 @@ def test_multichannel_external_split(test_info, in_fmt, render_config, trajector @pytest.mark.parametrize("render_config", RENDERER_CONFIGS_TO_TEST_ISM) @pytest.mark.parametrize("bitrate", IVAS_BITRATES_ISM) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_ISM_SPLIT_REND) def test_ism_full_chain_split(test_info, in_fmt, bitrate, render_config, trajectory): def test_ism_full_chain_split( record_property, props_to_record, get_mld, get_mld_lim, get_ssnr, get_odg, get_odg_bin, test_info, in_fmt, bitrate, render_config, trajectory): post_trajectory = HR_TRAJECTORY_DIR.joinpath(f"{trajectory}.csv") pre_trajectory = post_trajectory.with_stem(f"{post_trajectory.stem}_delayed") run_full_chain_split_rendering( record_property, props_to_record, test_info, in_fmt=in_fmt, bitrate=bitrate, Loading @@ -139,6 +207,11 @@ def test_ism_full_chain_split(test_info, in_fmt, bitrate, render_config, traject binary_suffix=EXE_SUFFIX, pre_trajectory=pre_trajectory, post_trajectory=post_trajectory, get_mld=get_mld, mld_lim=get_mld_lim, get_ssnr=get_ssnr, get_odg=get_odg, get_odg_bin=get_odg_bin, ) Loading @@ -146,16 +219,31 @@ def test_ism_full_chain_split(test_info, in_fmt, bitrate, render_config, traject @pytest.mark.parametrize("trajectory", SPLIT_REND_HR_TRAJECTORIES_TO_TEST) @pytest.mark.parametrize("render_config", RENDERER_CONFIGS_TO_TEST_ISM) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_ISM_SPLIT_REND) def test_ism_external_split(test_info, in_fmt, render_config, trajectory): def test_ism_external_split( record_property, props_to_record, get_mld, get_mld_lim, get_ssnr, get_odg, get_odg_bin, test_info, in_fmt, render_config, trajectory): post_trajectory = HR_TRAJECTORY_DIR.joinpath(f"{trajectory}.csv") pre_trajectory = post_trajectory.with_stem(f"{post_trajectory.stem}_delayed") run_external_split_rendering( record_property, props_to_record, test_info, in_fmt=in_fmt, render_config=RENDER_CFG_DIR.joinpath(f"{render_config}.txt"), pre_trajectory=pre_trajectory, post_trajectory=post_trajectory, get_mld=get_mld, mld_lim=get_mld_lim, get_ssnr=get_ssnr, get_odg=get_odg, get_odg_bin=get_odg_bin, ) Loading @@ -167,11 +255,21 @@ def test_ism_external_split(test_info, in_fmt, render_config, trajectory): @pytest.mark.parametrize("render_config", RENDERER_CONFIGS_TO_TEST_MASA) @pytest.mark.parametrize("bitrate", IVAS_BITRATES_MASA) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_MASA_SPLIT_REND) def test_masa_full_chain_split(test_info, in_fmt, bitrate, render_config, trajectory): def test_masa_full_chain_split( record_property, props_to_record, get_mld, get_mld_lim, get_ssnr, get_odg, get_odg_bin, test_info, in_fmt, bitrate, render_config, trajectory): post_trajectory = HR_TRAJECTORY_DIR.joinpath(f"{trajectory}.csv") pre_trajectory = post_trajectory.with_stem(f"{post_trajectory.stem}_delayed") run_full_chain_split_rendering( record_property, props_to_record, test_info, in_fmt=in_fmt, bitrate=bitrate, Loading @@ -179,6 +277,11 @@ def test_masa_full_chain_split(test_info, in_fmt, bitrate, render_config, trajec binary_suffix=EXE_SUFFIX, pre_trajectory=pre_trajectory, post_trajectory=post_trajectory, get_mld=get_mld, mld_lim=get_mld_lim, get_ssnr=get_ssnr, get_odg=get_odg, get_odg_bin=get_odg_bin, ) Loading @@ -186,16 +289,31 @@ def test_masa_full_chain_split(test_info, in_fmt, bitrate, render_config, trajec @pytest.mark.parametrize("trajectory", SPLIT_REND_HR_TRAJECTORIES_TO_TEST) @pytest.mark.parametrize("render_config", RENDERER_CONFIGS_TO_TEST_MASA) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_MASA_SPLIT_REND) def test_masa_external_split(test_info, in_fmt, render_config, trajectory): def test_masa_external_split( record_property, props_to_record, get_mld, get_mld_lim, get_ssnr, get_odg, get_odg_bin, test_info, in_fmt, render_config, trajectory): post_trajectory = HR_TRAJECTORY_DIR.joinpath(f"{trajectory}.csv") pre_trajectory = post_trajectory.with_stem(f"{post_trajectory.stem}_delayed") run_external_split_rendering( record_property, props_to_record, test_info, in_fmt=in_fmt, render_config=RENDER_CFG_DIR.joinpath(f"{render_config}.txt"), pre_trajectory=pre_trajectory, post_trajectory=post_trajectory, get_mld=get_mld, mld_lim=get_mld_lim, get_ssnr=get_ssnr, get_odg=get_odg, get_odg_bin=get_odg_bin, ) Loading @@ -207,11 +325,21 @@ def test_masa_external_split(test_info, in_fmt, render_config, trajectory): @pytest.mark.parametrize("render_config", RENDERER_CONFIGS_TO_TEST_OMASA) @pytest.mark.parametrize("bitrate", IVAS_BITRATES_OMASA) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_OMASA_SPLIT_REND) def test_omasa_full_chain_split(test_info, in_fmt, bitrate, render_config, trajectory): def test_omasa_full_chain_split( record_property, props_to_record, get_mld, get_mld_lim, get_ssnr, get_odg, get_odg_bin, test_info, in_fmt, bitrate, render_config, trajectory): post_trajectory = HR_TRAJECTORY_DIR.joinpath(f"{trajectory}.csv") pre_trajectory = post_trajectory.with_stem(f"{post_trajectory.stem}_delayed") run_full_chain_split_rendering( record_property, props_to_record, test_info, in_fmt=in_fmt, bitrate=bitrate, Loading @@ -219,6 +347,11 @@ def test_omasa_full_chain_split(test_info, in_fmt, bitrate, render_config, traje binary_suffix=EXE_SUFFIX, pre_trajectory=pre_trajectory, post_trajectory=post_trajectory, get_mld=get_mld, mld_lim=get_mld_lim, get_ssnr=get_ssnr, get_odg=get_odg, get_odg_bin=get_odg_bin, ) Loading @@ -230,11 +363,21 @@ def test_omasa_full_chain_split(test_info, in_fmt, bitrate, render_config, traje @pytest.mark.parametrize("render_config", RENDERER_CONFIGS_TO_TEST_OSBA) @pytest.mark.parametrize("bitrate", IVAS_BITRATES_OSBA) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_OSBA_SPLIT_REND) def test_osba_full_chain_split(test_info, in_fmt, bitrate, render_config, trajectory): def test_osba_full_chain_split( record_property, props_to_record, get_mld, get_mld_lim, get_ssnr, get_odg, get_odg_bin, test_info, in_fmt, bitrate, render_config, trajectory): post_trajectory = HR_TRAJECTORY_DIR.joinpath(f"{trajectory}.csv") pre_trajectory = post_trajectory.with_stem(f"{post_trajectory.stem}_delayed") run_full_chain_split_rendering( record_property, props_to_record, test_info, in_fmt=in_fmt, bitrate=bitrate, Loading @@ -242,6 +385,11 @@ def test_osba_full_chain_split(test_info, in_fmt, bitrate, render_config, trajec binary_suffix=EXE_SUFFIX, pre_trajectory=pre_trajectory, post_trajectory=post_trajectory, get_mld=get_mld, mld_lim=get_mld_lim, get_ssnr=get_ssnr, get_odg=get_odg, get_odg_bin=get_odg_bin, ) Loading @@ -253,17 +401,32 @@ def test_osba_full_chain_split(test_info, in_fmt, bitrate, render_config, trajec @pytest.mark.parametrize("trajectory", SPLIT_REND_HR_TRAJECTORIES_TO_TEST) @pytest.mark.parametrize("render_config", RENDERER_CONFIGS_TO_TEST_PLC) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_AMBI_SPLIT_REND[-1:]) def test_post_rend_plc(test_info, in_fmt, render_config, trajectory, error_pattern): def test_post_rend_plc( record_property, props_to_record, get_mld, get_mld_lim, get_ssnr, get_odg, get_odg_bin, test_info, in_fmt, render_config, trajectory, error_pattern): post_trajectory = HR_TRAJECTORY_DIR.joinpath(f"{trajectory}.csv") pre_trajectory = post_trajectory.with_stem(f"{post_trajectory.stem}_delayed") run_external_split_rendering( record_property, props_to_record, test_info, in_fmt=in_fmt, render_config=RENDER_CFG_DIR.joinpath(f"{render_config}.txt"), pre_trajectory=pre_trajectory, post_trajectory=post_trajectory, plc_error_pattern=ERROR_PATTERNS_DIR.joinpath(f"{error_pattern}.ep"), get_mld=get_mld, mld_lim=get_mld_lim, get_ssnr=get_ssnr, get_odg=get_odg, get_odg_bin=get_odg_bin, ) Loading @@ -281,12 +444,22 @@ full_chain_split_pcm_params = [ @pytest.mark.parametrize("in_fmt,bitrate,render_config", full_chain_split_pcm_params) def test_full_chain_split_pcm(test_info, in_fmt, bitrate, render_config): def test_full_chain_split_pcm( record_property, props_to_record, get_mld, get_mld_lim, get_ssnr, get_odg, get_odg_bin, test_info, in_fmt, bitrate, render_config): trajectory = SPLIT_REND_HR_TRAJECTORIES_TO_TEST[0] post_trajectory = HR_TRAJECTORY_DIR.joinpath(f"{trajectory}.csv") pre_trajectory = post_trajectory.with_stem(f"{post_trajectory.stem}_delayed") run_full_chain_split_rendering( record_property, props_to_record, test_info, in_fmt=in_fmt, bitrate=bitrate, Loading @@ -295,6 +468,11 @@ def test_full_chain_split_pcm(test_info, in_fmt, bitrate, render_config): pre_trajectory=pre_trajectory, post_trajectory=post_trajectory, renderer_fmt="BINAURAL_SPLIT_PCM", get_mld=get_mld, mld_lim=get_mld_lim, get_ssnr=get_ssnr, get_odg=get_odg, get_odg_bin=get_odg_bin, ) Loading @@ -307,18 +485,33 @@ external_split_pcm_params = [ @pytest.mark.parametrize("in_fmt,render_config", external_split_pcm_params) def test_external_split_pcm(test_info, in_fmt, render_config): def test_external_split_pcm( record_property, props_to_record, get_mld, get_mld_lim, get_ssnr, get_odg, get_odg_bin, test_info, in_fmt, render_config): trajectory = SPLIT_REND_HR_TRAJECTORIES_TO_TEST[0] post_trajectory = HR_TRAJECTORY_DIR.joinpath(f"{trajectory}.csv") pre_trajectory = post_trajectory.with_stem(f"{post_trajectory.stem}_delayed") run_external_split_rendering( record_property, props_to_record, test_info, in_fmt=in_fmt, render_config=RENDER_CFG_DIR.joinpath(f"{render_config}.txt"), pre_trajectory=pre_trajectory, post_trajectory=post_trajectory, renderer_fmt="BINAURAL_SPLIT_PCM", get_mld=get_mld, mld_lim=get_mld_lim, get_ssnr=get_ssnr, get_odg=get_odg, get_odg_bin=get_odg_bin, ) Loading @@ -327,11 +520,21 @@ def test_external_split_pcm(test_info, in_fmt, render_config): @pytest.mark.parametrize("in_fmt", ["5_1"]) @pytest.mark.parametrize("pre_rend_fr", SPLIT_RENDERER_PRE_FRAMINGS) @pytest.mark.parametrize("post_rend_fr", SPLIT_RENDERER_POST_FRAMINGS) def test_framing_combinations_external_split(test_info, in_fmt, render_config, trajectory, post_rend_fr, pre_rend_fr): def test_framing_combinations_external_split( record_property, props_to_record, get_mld, get_mld_lim, get_ssnr, get_odg, get_odg_bin, test_info, in_fmt, render_config, trajectory, post_rend_fr, pre_rend_fr): post_trajectory = HR_TRAJECTORY_DIR.joinpath(f"{trajectory}.csv") pre_trajectory = post_trajectory.with_stem(f"{post_trajectory.stem}_delayed") run_external_split_rendering( record_property, props_to_record, test_info, in_fmt=in_fmt, render_config=RENDER_FRAMING_CFG_DIR.joinpath(f"{render_config}.txt"), Loading @@ -339,6 +542,11 @@ def test_framing_combinations_external_split(test_info, in_fmt, render_config, t post_trajectory=post_trajectory, post_rend_fr=post_rend_fr, pre_rend_fr=pre_rend_fr, get_mld=get_mld, mld_lim=get_mld_lim, get_ssnr=get_ssnr, get_odg=get_odg, get_odg_bin=get_odg_bin, ) @pytest.mark.parametrize("trajectory", SPLIT_REND_HR_TRAJECTORIES_TO_TEST) Loading @@ -347,12 +555,21 @@ def test_framing_combinations_external_split(test_info, in_fmt, render_config, t @pytest.mark.parametrize("pre_rend_fr", SPLIT_RENDERER_PRE_FRAMINGS) @pytest.mark.parametrize("post_rend_fr", SPLIT_RENDERER_POST_FRAMINGS) def test_framing_combinations_full_chain_split( record_property, props_to_record, get_mld, get_mld_lim, get_ssnr, get_odg, get_odg_bin, test_info, in_fmt, render_config, trajectory, post_rend_fr, pre_rend_fr ): post_trajectory = HR_TRAJECTORY_DIR.joinpath(f"{trajectory}.csv") pre_trajectory = post_trajectory.with_stem(f"{post_trajectory.stem}_delayed") run_full_chain_split_rendering( record_property, props_to_record, test_info, in_fmt=in_fmt, render_config=RENDER_FRAMING_CFG_DIR.joinpath(f"{render_config}.txt"), Loading @@ -362,4 +579,9 @@ def test_framing_combinations_full_chain_split( binary_suffix=EXE_SUFFIX, post_rend_fr=post_rend_fr, pre_rend_fr=pre_rend_fr, get_mld=get_mld, mld_lim=get_mld_lim, get_ssnr=get_ssnr, get_odg=get_odg, get_odg_bin=get_odg_bin, ) tests/split_rendering/utils.py +71 −8 Original line number Diff line number Diff line Loading @@ -41,6 +41,8 @@ import pytest from tests.renderer.utils import check_BE, run_ivas_isar_enc_cmd, run_ivas_isar_dec_cmd, run_isar_post_rend_cmd, run_isar_ext_rend_cmd from tests.split_rendering.constants import * from ..cmp_pcm import cmp_pcm from ..conftest import parse_properties sys.path.append(SCRIPTS_DIR) from pyaudio3dtools.audiofile import readfile, writefile Loading Loading @@ -151,6 +153,8 @@ def truncate_signal( def run_full_chain_split_rendering( record_property, props_to_record, test_info, in_fmt: str, bitrate: str, Loading @@ -161,6 +165,11 @@ def run_full_chain_split_rendering( binary_suffix: str = "", post_rend_fr: str = "20", pre_rend_fr: str = "20", get_mld=False, mld_lim=0, get_ssnr=False, get_odg=False, get_odg_bin=False, ) -> str: """ Runs the full split rendering chain consisting of Loading Loading @@ -274,15 +283,41 @@ def run_full_chain_split_rendering( cut, cut_fs = readfile(out_file) if get_mld == False: [diff_found, snr, gain_b, max_diff] = check_BE(test_info, ref, ref_fs, cut, cut_fs) if diff_found : pytest.fail( f"CuT not BE to REF! SNR : {snr:3.2f} dB, Gain CuT: {gain_b:1.3f}, Max Diff = {int(max_diff)}" ) else: # see constants.py output_differs, reason = cmp_pcm( out_file, out_file_ref, "BINAURAL", ref_fs, get_mld=get_mld, mld_lim=mld_lim, get_ssnr=get_ssnr, get_odg=get_odg, get_odg_bin=get_odg_bin, ) props = parse_properties(reason, output_differs, props_to_record) for k, v in props.items(): record_property(k, v) if output_differs: pytest.fail(f"Output differs: ({reason})") return out_file def run_external_split_rendering( record_property, props_to_record, test_info, in_fmt: str, render_config: Path, Loading @@ -294,6 +329,11 @@ def run_external_split_rendering( is_comparetest: bool = False, post_rend_fr: str = "20", pre_rend_fr: str = "20", get_mld=False, mld_lim=0, get_ssnr=False, get_odg=False, get_odg_bin=False, ) -> Tuple[np.ndarray, int]: """ Runs the exeternal split rendering chain consisting of Loading Loading @@ -393,9 +433,32 @@ def run_external_split_rendering( cut, cut_fs = readfile(out_file) if get_mld == False: [diff_found, snr, gain_b, max_diff] = check_BE(test_info, ref, ref_fs, cut, cut_fs) if diff_found : pytest.fail( f"CuT not BE to REF! SNR : {snr:3.2f} dB, Gain CuT: {gain_b:1.3f}, Max Diff = {int(max_diff)}" ) else: # see constants.py output_differs, reason = cmp_pcm( out_file, out_file_ref, "BINAURAL", ref_fs, get_mld=get_mld, mld_lim=mld_lim, get_ssnr=get_ssnr, get_odg=get_odg, get_odg_bin=get_odg_bin, ) props = parse_properties(reason, output_differs, props_to_record) for k, v in props.items(): record_property(k, v) if output_differs: pytest.fail(f"Output differs: ({reason})") return out_file Loading
tests/split_rendering/test_split_rendering.py +234 −12 Original line number Diff line number Diff line Loading @@ -44,12 +44,21 @@ from tests.split_rendering.utils import * @pytest.mark.parametrize("bitrate", IVAS_BITRATES_AMBI) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_AMBI_SPLIT_REND) def test_ambisonics_full_chain_split( record_property, props_to_record, get_mld, get_mld_lim, get_ssnr, get_odg, get_odg_bin, test_info, in_fmt, bitrate, render_config, trajectory ): post_trajectory = HR_TRAJECTORY_DIR.joinpath(f"{trajectory}.csv") pre_trajectory = post_trajectory.with_stem(f"{post_trajectory.stem}_delayed") run_full_chain_split_rendering( record_property, props_to_record, test_info, in_fmt=in_fmt, bitrate=bitrate, Loading @@ -57,6 +66,11 @@ def test_ambisonics_full_chain_split( binary_suffix=EXE_SUFFIX, pre_trajectory=pre_trajectory, post_trajectory=post_trajectory, get_mld=get_mld, mld_lim=get_mld_lim, get_ssnr=get_ssnr, get_odg=get_odg, get_odg_bin=get_odg_bin, ) Loading @@ -64,16 +78,31 @@ def test_ambisonics_full_chain_split( @pytest.mark.parametrize("trajectory", SPLIT_REND_HR_TRAJECTORIES_TO_TEST) @pytest.mark.parametrize("render_config", RENDERER_CONFIGS_TO_TEST_AMBI) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_AMBI_SPLIT_REND) def test_ambisonics_external_split(test_info, in_fmt, render_config, trajectory): def test_ambisonics_external_split( record_property, props_to_record, get_mld, get_mld_lim, get_ssnr, get_odg, get_odg_bin, test_info, in_fmt, render_config, trajectory): post_trajectory = HR_TRAJECTORY_DIR.joinpath(f"{trajectory}.csv") pre_trajectory = post_trajectory.with_stem(f"{post_trajectory.stem}_delayed") run_external_split_rendering( record_property, props_to_record, test_info, in_fmt=in_fmt, render_config=RENDER_CFG_DIR.joinpath(f"{render_config}.txt"), pre_trajectory=pre_trajectory, post_trajectory=post_trajectory, get_mld=get_mld, mld_lim=get_mld_lim, get_ssnr=get_ssnr, get_odg=get_odg, get_odg_bin=get_odg_bin, ) Loading @@ -86,12 +115,21 @@ def test_ambisonics_external_split(test_info, in_fmt, render_config, trajectory) @pytest.mark.parametrize("bitrate", IVAS_BITRATES_MC) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_MC_SPLIT_REND) def test_multichannel_full_chain_split( record_property, props_to_record, get_mld, get_mld_lim, get_ssnr, get_odg, get_odg_bin, test_info, in_fmt, bitrate, render_config, trajectory ): post_trajectory = HR_TRAJECTORY_DIR.joinpath(f"{trajectory}.csv") pre_trajectory = post_trajectory.with_stem(f"{post_trajectory.stem}_delayed") run_full_chain_split_rendering( record_property, props_to_record, test_info, in_fmt=in_fmt, bitrate=bitrate, Loading @@ -99,6 +137,11 @@ def test_multichannel_full_chain_split( binary_suffix=EXE_SUFFIX, pre_trajectory=pre_trajectory, post_trajectory=post_trajectory, get_mld=get_mld, mld_lim=get_mld_lim, get_ssnr=get_ssnr, get_odg=get_odg, get_odg_bin=get_odg_bin, ) Loading @@ -106,16 +149,31 @@ def test_multichannel_full_chain_split( @pytest.mark.parametrize("trajectory", SPLIT_REND_HR_TRAJECTORIES_TO_TEST) @pytest.mark.parametrize("render_config", RENDERER_CONFIGS_TO_TEST_MC) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_MC_SPLIT_REND) def test_multichannel_external_split(test_info, in_fmt, render_config, trajectory): def test_multichannel_external_split( record_property, props_to_record, get_mld, get_mld_lim, get_ssnr, get_odg, get_odg_bin, test_info, in_fmt, render_config, trajectory): post_trajectory = HR_TRAJECTORY_DIR.joinpath(f"{trajectory}.csv") pre_trajectory = post_trajectory.with_stem(f"{post_trajectory.stem}_delayed") run_external_split_rendering( record_property, props_to_record, test_info, in_fmt=in_fmt, render_config=RENDER_CFG_DIR.joinpath(f"{render_config}.txt"), pre_trajectory=pre_trajectory, post_trajectory=post_trajectory, get_mld=get_mld, mld_lim=get_mld_lim, get_ssnr=get_ssnr, get_odg=get_odg, get_odg_bin=get_odg_bin, ) Loading @@ -127,11 +185,21 @@ def test_multichannel_external_split(test_info, in_fmt, render_config, trajector @pytest.mark.parametrize("render_config", RENDERER_CONFIGS_TO_TEST_ISM) @pytest.mark.parametrize("bitrate", IVAS_BITRATES_ISM) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_ISM_SPLIT_REND) def test_ism_full_chain_split(test_info, in_fmt, bitrate, render_config, trajectory): def test_ism_full_chain_split( record_property, props_to_record, get_mld, get_mld_lim, get_ssnr, get_odg, get_odg_bin, test_info, in_fmt, bitrate, render_config, trajectory): post_trajectory = HR_TRAJECTORY_DIR.joinpath(f"{trajectory}.csv") pre_trajectory = post_trajectory.with_stem(f"{post_trajectory.stem}_delayed") run_full_chain_split_rendering( record_property, props_to_record, test_info, in_fmt=in_fmt, bitrate=bitrate, Loading @@ -139,6 +207,11 @@ def test_ism_full_chain_split(test_info, in_fmt, bitrate, render_config, traject binary_suffix=EXE_SUFFIX, pre_trajectory=pre_trajectory, post_trajectory=post_trajectory, get_mld=get_mld, mld_lim=get_mld_lim, get_ssnr=get_ssnr, get_odg=get_odg, get_odg_bin=get_odg_bin, ) Loading @@ -146,16 +219,31 @@ def test_ism_full_chain_split(test_info, in_fmt, bitrate, render_config, traject @pytest.mark.parametrize("trajectory", SPLIT_REND_HR_TRAJECTORIES_TO_TEST) @pytest.mark.parametrize("render_config", RENDERER_CONFIGS_TO_TEST_ISM) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_ISM_SPLIT_REND) def test_ism_external_split(test_info, in_fmt, render_config, trajectory): def test_ism_external_split( record_property, props_to_record, get_mld, get_mld_lim, get_ssnr, get_odg, get_odg_bin, test_info, in_fmt, render_config, trajectory): post_trajectory = HR_TRAJECTORY_DIR.joinpath(f"{trajectory}.csv") pre_trajectory = post_trajectory.with_stem(f"{post_trajectory.stem}_delayed") run_external_split_rendering( record_property, props_to_record, test_info, in_fmt=in_fmt, render_config=RENDER_CFG_DIR.joinpath(f"{render_config}.txt"), pre_trajectory=pre_trajectory, post_trajectory=post_trajectory, get_mld=get_mld, mld_lim=get_mld_lim, get_ssnr=get_ssnr, get_odg=get_odg, get_odg_bin=get_odg_bin, ) Loading @@ -167,11 +255,21 @@ def test_ism_external_split(test_info, in_fmt, render_config, trajectory): @pytest.mark.parametrize("render_config", RENDERER_CONFIGS_TO_TEST_MASA) @pytest.mark.parametrize("bitrate", IVAS_BITRATES_MASA) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_MASA_SPLIT_REND) def test_masa_full_chain_split(test_info, in_fmt, bitrate, render_config, trajectory): def test_masa_full_chain_split( record_property, props_to_record, get_mld, get_mld_lim, get_ssnr, get_odg, get_odg_bin, test_info, in_fmt, bitrate, render_config, trajectory): post_trajectory = HR_TRAJECTORY_DIR.joinpath(f"{trajectory}.csv") pre_trajectory = post_trajectory.with_stem(f"{post_trajectory.stem}_delayed") run_full_chain_split_rendering( record_property, props_to_record, test_info, in_fmt=in_fmt, bitrate=bitrate, Loading @@ -179,6 +277,11 @@ def test_masa_full_chain_split(test_info, in_fmt, bitrate, render_config, trajec binary_suffix=EXE_SUFFIX, pre_trajectory=pre_trajectory, post_trajectory=post_trajectory, get_mld=get_mld, mld_lim=get_mld_lim, get_ssnr=get_ssnr, get_odg=get_odg, get_odg_bin=get_odg_bin, ) Loading @@ -186,16 +289,31 @@ def test_masa_full_chain_split(test_info, in_fmt, bitrate, render_config, trajec @pytest.mark.parametrize("trajectory", SPLIT_REND_HR_TRAJECTORIES_TO_TEST) @pytest.mark.parametrize("render_config", RENDERER_CONFIGS_TO_TEST_MASA) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_MASA_SPLIT_REND) def test_masa_external_split(test_info, in_fmt, render_config, trajectory): def test_masa_external_split( record_property, props_to_record, get_mld, get_mld_lim, get_ssnr, get_odg, get_odg_bin, test_info, in_fmt, render_config, trajectory): post_trajectory = HR_TRAJECTORY_DIR.joinpath(f"{trajectory}.csv") pre_trajectory = post_trajectory.with_stem(f"{post_trajectory.stem}_delayed") run_external_split_rendering( record_property, props_to_record, test_info, in_fmt=in_fmt, render_config=RENDER_CFG_DIR.joinpath(f"{render_config}.txt"), pre_trajectory=pre_trajectory, post_trajectory=post_trajectory, get_mld=get_mld, mld_lim=get_mld_lim, get_ssnr=get_ssnr, get_odg=get_odg, get_odg_bin=get_odg_bin, ) Loading @@ -207,11 +325,21 @@ def test_masa_external_split(test_info, in_fmt, render_config, trajectory): @pytest.mark.parametrize("render_config", RENDERER_CONFIGS_TO_TEST_OMASA) @pytest.mark.parametrize("bitrate", IVAS_BITRATES_OMASA) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_OMASA_SPLIT_REND) def test_omasa_full_chain_split(test_info, in_fmt, bitrate, render_config, trajectory): def test_omasa_full_chain_split( record_property, props_to_record, get_mld, get_mld_lim, get_ssnr, get_odg, get_odg_bin, test_info, in_fmt, bitrate, render_config, trajectory): post_trajectory = HR_TRAJECTORY_DIR.joinpath(f"{trajectory}.csv") pre_trajectory = post_trajectory.with_stem(f"{post_trajectory.stem}_delayed") run_full_chain_split_rendering( record_property, props_to_record, test_info, in_fmt=in_fmt, bitrate=bitrate, Loading @@ -219,6 +347,11 @@ def test_omasa_full_chain_split(test_info, in_fmt, bitrate, render_config, traje binary_suffix=EXE_SUFFIX, pre_trajectory=pre_trajectory, post_trajectory=post_trajectory, get_mld=get_mld, mld_lim=get_mld_lim, get_ssnr=get_ssnr, get_odg=get_odg, get_odg_bin=get_odg_bin, ) Loading @@ -230,11 +363,21 @@ def test_omasa_full_chain_split(test_info, in_fmt, bitrate, render_config, traje @pytest.mark.parametrize("render_config", RENDERER_CONFIGS_TO_TEST_OSBA) @pytest.mark.parametrize("bitrate", IVAS_BITRATES_OSBA) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_OSBA_SPLIT_REND) def test_osba_full_chain_split(test_info, in_fmt, bitrate, render_config, trajectory): def test_osba_full_chain_split( record_property, props_to_record, get_mld, get_mld_lim, get_ssnr, get_odg, get_odg_bin, test_info, in_fmt, bitrate, render_config, trajectory): post_trajectory = HR_TRAJECTORY_DIR.joinpath(f"{trajectory}.csv") pre_trajectory = post_trajectory.with_stem(f"{post_trajectory.stem}_delayed") run_full_chain_split_rendering( record_property, props_to_record, test_info, in_fmt=in_fmt, bitrate=bitrate, Loading @@ -242,6 +385,11 @@ def test_osba_full_chain_split(test_info, in_fmt, bitrate, render_config, trajec binary_suffix=EXE_SUFFIX, pre_trajectory=pre_trajectory, post_trajectory=post_trajectory, get_mld=get_mld, mld_lim=get_mld_lim, get_ssnr=get_ssnr, get_odg=get_odg, get_odg_bin=get_odg_bin, ) Loading @@ -253,17 +401,32 @@ def test_osba_full_chain_split(test_info, in_fmt, bitrate, render_config, trajec @pytest.mark.parametrize("trajectory", SPLIT_REND_HR_TRAJECTORIES_TO_TEST) @pytest.mark.parametrize("render_config", RENDERER_CONFIGS_TO_TEST_PLC) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_AMBI_SPLIT_REND[-1:]) def test_post_rend_plc(test_info, in_fmt, render_config, trajectory, error_pattern): def test_post_rend_plc( record_property, props_to_record, get_mld, get_mld_lim, get_ssnr, get_odg, get_odg_bin, test_info, in_fmt, render_config, trajectory, error_pattern): post_trajectory = HR_TRAJECTORY_DIR.joinpath(f"{trajectory}.csv") pre_trajectory = post_trajectory.with_stem(f"{post_trajectory.stem}_delayed") run_external_split_rendering( record_property, props_to_record, test_info, in_fmt=in_fmt, render_config=RENDER_CFG_DIR.joinpath(f"{render_config}.txt"), pre_trajectory=pre_trajectory, post_trajectory=post_trajectory, plc_error_pattern=ERROR_PATTERNS_DIR.joinpath(f"{error_pattern}.ep"), get_mld=get_mld, mld_lim=get_mld_lim, get_ssnr=get_ssnr, get_odg=get_odg, get_odg_bin=get_odg_bin, ) Loading @@ -281,12 +444,22 @@ full_chain_split_pcm_params = [ @pytest.mark.parametrize("in_fmt,bitrate,render_config", full_chain_split_pcm_params) def test_full_chain_split_pcm(test_info, in_fmt, bitrate, render_config): def test_full_chain_split_pcm( record_property, props_to_record, get_mld, get_mld_lim, get_ssnr, get_odg, get_odg_bin, test_info, in_fmt, bitrate, render_config): trajectory = SPLIT_REND_HR_TRAJECTORIES_TO_TEST[0] post_trajectory = HR_TRAJECTORY_DIR.joinpath(f"{trajectory}.csv") pre_trajectory = post_trajectory.with_stem(f"{post_trajectory.stem}_delayed") run_full_chain_split_rendering( record_property, props_to_record, test_info, in_fmt=in_fmt, bitrate=bitrate, Loading @@ -295,6 +468,11 @@ def test_full_chain_split_pcm(test_info, in_fmt, bitrate, render_config): pre_trajectory=pre_trajectory, post_trajectory=post_trajectory, renderer_fmt="BINAURAL_SPLIT_PCM", get_mld=get_mld, mld_lim=get_mld_lim, get_ssnr=get_ssnr, get_odg=get_odg, get_odg_bin=get_odg_bin, ) Loading @@ -307,18 +485,33 @@ external_split_pcm_params = [ @pytest.mark.parametrize("in_fmt,render_config", external_split_pcm_params) def test_external_split_pcm(test_info, in_fmt, render_config): def test_external_split_pcm( record_property, props_to_record, get_mld, get_mld_lim, get_ssnr, get_odg, get_odg_bin, test_info, in_fmt, render_config): trajectory = SPLIT_REND_HR_TRAJECTORIES_TO_TEST[0] post_trajectory = HR_TRAJECTORY_DIR.joinpath(f"{trajectory}.csv") pre_trajectory = post_trajectory.with_stem(f"{post_trajectory.stem}_delayed") run_external_split_rendering( record_property, props_to_record, test_info, in_fmt=in_fmt, render_config=RENDER_CFG_DIR.joinpath(f"{render_config}.txt"), pre_trajectory=pre_trajectory, post_trajectory=post_trajectory, renderer_fmt="BINAURAL_SPLIT_PCM", get_mld=get_mld, mld_lim=get_mld_lim, get_ssnr=get_ssnr, get_odg=get_odg, get_odg_bin=get_odg_bin, ) Loading @@ -327,11 +520,21 @@ def test_external_split_pcm(test_info, in_fmt, render_config): @pytest.mark.parametrize("in_fmt", ["5_1"]) @pytest.mark.parametrize("pre_rend_fr", SPLIT_RENDERER_PRE_FRAMINGS) @pytest.mark.parametrize("post_rend_fr", SPLIT_RENDERER_POST_FRAMINGS) def test_framing_combinations_external_split(test_info, in_fmt, render_config, trajectory, post_rend_fr, pre_rend_fr): def test_framing_combinations_external_split( record_property, props_to_record, get_mld, get_mld_lim, get_ssnr, get_odg, get_odg_bin, test_info, in_fmt, render_config, trajectory, post_rend_fr, pre_rend_fr): post_trajectory = HR_TRAJECTORY_DIR.joinpath(f"{trajectory}.csv") pre_trajectory = post_trajectory.with_stem(f"{post_trajectory.stem}_delayed") run_external_split_rendering( record_property, props_to_record, test_info, in_fmt=in_fmt, render_config=RENDER_FRAMING_CFG_DIR.joinpath(f"{render_config}.txt"), Loading @@ -339,6 +542,11 @@ def test_framing_combinations_external_split(test_info, in_fmt, render_config, t post_trajectory=post_trajectory, post_rend_fr=post_rend_fr, pre_rend_fr=pre_rend_fr, get_mld=get_mld, mld_lim=get_mld_lim, get_ssnr=get_ssnr, get_odg=get_odg, get_odg_bin=get_odg_bin, ) @pytest.mark.parametrize("trajectory", SPLIT_REND_HR_TRAJECTORIES_TO_TEST) Loading @@ -347,12 +555,21 @@ def test_framing_combinations_external_split(test_info, in_fmt, render_config, t @pytest.mark.parametrize("pre_rend_fr", SPLIT_RENDERER_PRE_FRAMINGS) @pytest.mark.parametrize("post_rend_fr", SPLIT_RENDERER_POST_FRAMINGS) def test_framing_combinations_full_chain_split( record_property, props_to_record, get_mld, get_mld_lim, get_ssnr, get_odg, get_odg_bin, test_info, in_fmt, render_config, trajectory, post_rend_fr, pre_rend_fr ): post_trajectory = HR_TRAJECTORY_DIR.joinpath(f"{trajectory}.csv") pre_trajectory = post_trajectory.with_stem(f"{post_trajectory.stem}_delayed") run_full_chain_split_rendering( record_property, props_to_record, test_info, in_fmt=in_fmt, render_config=RENDER_FRAMING_CFG_DIR.joinpath(f"{render_config}.txt"), Loading @@ -362,4 +579,9 @@ def test_framing_combinations_full_chain_split( binary_suffix=EXE_SUFFIX, post_rend_fr=post_rend_fr, pre_rend_fr=pre_rend_fr, get_mld=get_mld, mld_lim=get_mld_lim, get_ssnr=get_ssnr, get_odg=get_odg, get_odg_bin=get_odg_bin, )
tests/split_rendering/utils.py +71 −8 Original line number Diff line number Diff line Loading @@ -41,6 +41,8 @@ import pytest from tests.renderer.utils import check_BE, run_ivas_isar_enc_cmd, run_ivas_isar_dec_cmd, run_isar_post_rend_cmd, run_isar_ext_rend_cmd from tests.split_rendering.constants import * from ..cmp_pcm import cmp_pcm from ..conftest import parse_properties sys.path.append(SCRIPTS_DIR) from pyaudio3dtools.audiofile import readfile, writefile Loading Loading @@ -151,6 +153,8 @@ def truncate_signal( def run_full_chain_split_rendering( record_property, props_to_record, test_info, in_fmt: str, bitrate: str, Loading @@ -161,6 +165,11 @@ def run_full_chain_split_rendering( binary_suffix: str = "", post_rend_fr: str = "20", pre_rend_fr: str = "20", get_mld=False, mld_lim=0, get_ssnr=False, get_odg=False, get_odg_bin=False, ) -> str: """ Runs the full split rendering chain consisting of Loading Loading @@ -274,15 +283,41 @@ def run_full_chain_split_rendering( cut, cut_fs = readfile(out_file) if get_mld == False: [diff_found, snr, gain_b, max_diff] = check_BE(test_info, ref, ref_fs, cut, cut_fs) if diff_found : pytest.fail( f"CuT not BE to REF! SNR : {snr:3.2f} dB, Gain CuT: {gain_b:1.3f}, Max Diff = {int(max_diff)}" ) else: # see constants.py output_differs, reason = cmp_pcm( out_file, out_file_ref, "BINAURAL", ref_fs, get_mld=get_mld, mld_lim=mld_lim, get_ssnr=get_ssnr, get_odg=get_odg, get_odg_bin=get_odg_bin, ) props = parse_properties(reason, output_differs, props_to_record) for k, v in props.items(): record_property(k, v) if output_differs: pytest.fail(f"Output differs: ({reason})") return out_file def run_external_split_rendering( record_property, props_to_record, test_info, in_fmt: str, render_config: Path, Loading @@ -294,6 +329,11 @@ def run_external_split_rendering( is_comparetest: bool = False, post_rend_fr: str = "20", pre_rend_fr: str = "20", get_mld=False, mld_lim=0, get_ssnr=False, get_odg=False, get_odg_bin=False, ) -> Tuple[np.ndarray, int]: """ Runs the exeternal split rendering chain consisting of Loading Loading @@ -393,9 +433,32 @@ def run_external_split_rendering( cut, cut_fs = readfile(out_file) if get_mld == False: [diff_found, snr, gain_b, max_diff] = check_BE(test_info, ref, ref_fs, cut, cut_fs) if diff_found : pytest.fail( f"CuT not BE to REF! SNR : {snr:3.2f} dB, Gain CuT: {gain_b:1.3f}, Max Diff = {int(max_diff)}" ) else: # see constants.py output_differs, reason = cmp_pcm( out_file, out_file_ref, "BINAURAL", ref_fs, get_mld=get_mld, mld_lim=mld_lim, get_ssnr=get_ssnr, get_odg=get_odg, get_odg_bin=get_odg_bin, ) props = parse_properties(reason, output_differs, props_to_record) for k, v in props.items(): record_property(k, v) if output_differs: pytest.fail(f"Output differs: ({reason})") return out_file