speccpu/x264: add recompile_mc_src to simplify code
This commit is contained in:
@@ -203,3 +203,18 @@ def perf_ref(x264_run, perf_output):
|
||||
],
|
||||
cwd=x264_run,
|
||||
)
|
||||
|
||||
|
||||
def recompile_mc_src(mc_src: str, x264_build: Path, spec_env: Mapping[str, str]):
|
||||
mc_path = get_mc_path(x264_build)
|
||||
assert mc_path.exists()
|
||||
|
||||
# Write mc_src to mc_path, recompile it, and replace resulting exe
|
||||
with open(mc_path, "w") as f:
|
||||
f.write(mc_src)
|
||||
|
||||
# Recompile
|
||||
recompiled_x264_path = recompile_mc(mc_path, x264_build, spec_env)
|
||||
assert recompiled_x264_path.exists()
|
||||
assert recompiled_x264_path.is_file()
|
||||
return recompiled_x264_path
|
||||
|
||||
Reference in New Issue
Block a user