Loading scripts/batch_comp_audio.py +42 −35 Original line number Diff line number Diff line Loading @@ -95,7 +95,7 @@ def main(args): repeat(fol2), repeat(outputs), repeat(tool), repeat(test_offset_ms) repeat(test_offset_ms), ) if args.sort: Loading Loading @@ -164,10 +164,17 @@ def compare_files(f, fol1, fol2, outputs_dict, tool, test_offset_ms): s2, fs2 = readfile(f2, outdtype="int16") cmp_result = compare(s1, s2, fs1, per_frame=False, get_mld=True) tool_output = cmp_result["MLD"] elif tool == "ssnr": s1, fs1 = readfile(f1, outdtype="int16") s2, fs2 = readfile(f2, outdtype="int16") cmp_result = compare(s1, s2, fs1, per_frame=False, get_ssnr=True) tool_output = cmp_result["SSNR"] elif tool == "pyaudio3dtools": s1, fs1 = readfile(f1, outdtype="int16") s2, fs2 = readfile(f2, outdtype="int16") cmp_result = compare(s1, s2, fs1, per_frame=False, test_start_offset_ms=test_offset_ms) cmp_result = compare( s1, s2, fs1, per_frame=False, test_start_offset_ms=test_offset_ms ) tool_output = cmp_result["max_abs_diff"] with threading.Lock(): Loading Loading @@ -298,7 +305,7 @@ if __name__ == "__main__": ) parser.add_argument( "--tool", choices=["mld", "CompAudio", "pyaudio3dtools"], choices=["mld", "CompAudio", "pyaudio3dtools", "ssnr"], default="CompAudio", help="Compare tool to run", ) Loading @@ -306,7 +313,7 @@ if __name__ == "__main__": "--test_offset_ms", type=int, default=0, help="Offset in miliseconds that is ignored at the start of the files in folder2 (only used if tool=pyaudio3dtools)" help="Offset in miliseconds that is ignored at the start of the files in folder2 (only used if tool=pyaudio3dtools)", ) args = parser.parse_args() Loading tests/renderer/utils.py +10 −9 Original line number Diff line number Diff line Loading @@ -230,28 +230,29 @@ def run_renderer( # if in REF or CUT creation mode use the comparetestv if test_info.config.option.create_ref or test_info.config.option.create_cut: FORMAT_TO_FILE = FORMAT_TO_FILE_COMPARETEST elif test_info.config.option.use_ltv: format_to_file = FORMAT_TO_FILE_COMPARETEST else: format_to_file = FORMAT_TO_FILE_SMOKETEST if test_info.config.option.use_ltv: if test_info.config.option.ltv_dir: FORMAT_TO_FILE = dict() format_to_file = dict() for k, v in FORMAT_TO_FILE_LTV.items(): FORMAT_TO_FILE[k] = str(v).replace( format_to_file[k] = str(v).replace( str(LTV_DIR), str(test_info.config.option.ltv_dir) ) else: FORMAT_TO_FILE = FORMAT_TO_FILE_LTV else: FORMAT_TO_FILE = FORMAT_TO_FILE_SMOKETEST format_to_file = FORMAT_TO_FILE_LTV if in_file is None: if metadata_input is not None: in_file = metadata_input in_name = metadata_input.stem elif not isinstance(in_fmt, str): in_file = FORMAT_TO_FILE[in_fmt.stem] in_file = format_to_file[in_fmt.stem] in_name = in_fmt.stem else: in_file = FORMAT_TO_FILE[in_fmt] in_file = format_to_file[in_fmt] in_name = in_fmt if out_file is None: Loading Loading
scripts/batch_comp_audio.py +42 −35 Original line number Diff line number Diff line Loading @@ -95,7 +95,7 @@ def main(args): repeat(fol2), repeat(outputs), repeat(tool), repeat(test_offset_ms) repeat(test_offset_ms), ) if args.sort: Loading Loading @@ -164,10 +164,17 @@ def compare_files(f, fol1, fol2, outputs_dict, tool, test_offset_ms): s2, fs2 = readfile(f2, outdtype="int16") cmp_result = compare(s1, s2, fs1, per_frame=False, get_mld=True) tool_output = cmp_result["MLD"] elif tool == "ssnr": s1, fs1 = readfile(f1, outdtype="int16") s2, fs2 = readfile(f2, outdtype="int16") cmp_result = compare(s1, s2, fs1, per_frame=False, get_ssnr=True) tool_output = cmp_result["SSNR"] elif tool == "pyaudio3dtools": s1, fs1 = readfile(f1, outdtype="int16") s2, fs2 = readfile(f2, outdtype="int16") cmp_result = compare(s1, s2, fs1, per_frame=False, test_start_offset_ms=test_offset_ms) cmp_result = compare( s1, s2, fs1, per_frame=False, test_start_offset_ms=test_offset_ms ) tool_output = cmp_result["max_abs_diff"] with threading.Lock(): Loading Loading @@ -298,7 +305,7 @@ if __name__ == "__main__": ) parser.add_argument( "--tool", choices=["mld", "CompAudio", "pyaudio3dtools"], choices=["mld", "CompAudio", "pyaudio3dtools", "ssnr"], default="CompAudio", help="Compare tool to run", ) Loading @@ -306,7 +313,7 @@ if __name__ == "__main__": "--test_offset_ms", type=int, default=0, help="Offset in miliseconds that is ignored at the start of the files in folder2 (only used if tool=pyaudio3dtools)" help="Offset in miliseconds that is ignored at the start of the files in folder2 (only used if tool=pyaudio3dtools)", ) args = parser.parse_args() Loading
tests/renderer/utils.py +10 −9 Original line number Diff line number Diff line Loading @@ -230,28 +230,29 @@ def run_renderer( # if in REF or CUT creation mode use the comparetestv if test_info.config.option.create_ref or test_info.config.option.create_cut: FORMAT_TO_FILE = FORMAT_TO_FILE_COMPARETEST elif test_info.config.option.use_ltv: format_to_file = FORMAT_TO_FILE_COMPARETEST else: format_to_file = FORMAT_TO_FILE_SMOKETEST if test_info.config.option.use_ltv: if test_info.config.option.ltv_dir: FORMAT_TO_FILE = dict() format_to_file = dict() for k, v in FORMAT_TO_FILE_LTV.items(): FORMAT_TO_FILE[k] = str(v).replace( format_to_file[k] = str(v).replace( str(LTV_DIR), str(test_info.config.option.ltv_dir) ) else: FORMAT_TO_FILE = FORMAT_TO_FILE_LTV else: FORMAT_TO_FILE = FORMAT_TO_FILE_SMOKETEST format_to_file = FORMAT_TO_FILE_LTV if in_file is None: if metadata_input is not None: in_file = metadata_input in_name = metadata_input.stem elif not isinstance(in_fmt, str): in_file = FORMAT_TO_FILE[in_fmt.stem] in_file = format_to_file[in_fmt.stem] in_name = in_fmt.stem else: in_file = FORMAT_TO_FILE[in_fmt] in_file = format_to_file[in_fmt] in_name = in_fmt if out_file is None: Loading