diff --git a/tests/split_rendering/utils.py b/tests/split_rendering/utils.py index ccc6a9b5c8aa6fc231373952097eaa12dff88df2..3ab8c25007fec0fe4807da42f378aecc19ebbe85 100644 --- a/tests/split_rendering/utils.py +++ b/tests/split_rendering/utils.py @@ -40,7 +40,6 @@ import numpy as np import pytest from tests.renderer.utils import ( - check_BE, run_ivas_isar_enc_cmd, run_ivas_isar_dec_cmd, run_isar_post_rend_cmd, @@ -290,46 +289,28 @@ def run_full_chain_split_rendering( # CUT creation mode will run a comparison with REF out_file_ref = str(OUTPUT_PATH_REF.joinpath(out_file_stem)) - try: - ref, ref_fs = readfile(out_file_ref) - except FileNotFoundError: - pytest.fail( - f"Reference vector not found! Ensure they were created with the --create_ref argument.\n{out_file_ref}" - ) - - cut, cut_fs = readfile(out_file) - - if not get_mld: - [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: - output_differs, reason = cmp_pcm( - out_file, - out_file_ref, - 2, # is always "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, - ) + output_differs, reason = cmp_pcm( + out_file, + out_file_ref, + 2, # is always "BINAURAL" + 48000, # currently only 48 kHz tests + get_mld=get_mld, + mld_lim=mld_lim, + get_ssnr=get_ssnr, + get_odg=get_odg, + get_odg_bin=get_odg_bin, + ) - # NOTE: split comparison not implemented for split rendering, always unpack values - reason = reason[0] - output_differs = output_differs[0] + # NOTE: split comparison not implemented for split rendering, always unpack values + reason = reason[0] + output_differs = output_differs[0] - props = parse_properties(reason, output_differs, props_to_record) - for k, v in props.items(): - record_property(k, v) + 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})") + if output_differs: + pytest.fail(f"Output differs: ({reason})") return out_file @@ -445,45 +426,26 @@ def run_external_split_rendering( f"{out_file_ref.stem}_plc_{plc_error_pattern.stem}" ) - try: - ref, ref_fs = readfile(out_file_ref) - except FileNotFoundError: - pytest.fail( - f"Reference vector not found! Ensure they were created with the --create_ref argument.\n{out_file_ref}" - ) - - cut, cut_fs = readfile(out_file) - - if not get_mld: - [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, - 2, # is always "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, - ) - # NOTE: split comparison not implemented for split rendering, always unpack values - reason = reason[0] - output_differs = output_differs[0] + output_differs, reason = cmp_pcm( + out_file, + out_file_ref, + 2, # is always "BINAURAL", + 48000, # currently only 48 kHz tests + get_mld=get_mld, + mld_lim=mld_lim, + get_ssnr=get_ssnr, + get_odg=get_odg, + get_odg_bin=get_odg_bin, + ) + # NOTE: split comparison not implemented for split rendering, always unpack values + reason = reason[0] + output_differs = output_differs[0] - props = parse_properties(reason, output_differs, props_to_record) - for k, v in props.items(): - record_property(k, v) + 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})") + if output_differs: + pytest.fail(f"Output differs: ({reason})") return out_file