speccpu/x264: add recompile_mc_src to simplify code

This commit is contained in:
2025-04-27 17:27:26 +08:00
parent 516d525ef4
commit 4c0c722616
3 changed files with 113 additions and 11 deletions

View File

@@ -22,19 +22,9 @@ def x264_disable_mc_mul(
assert x264_build.exists()
assert "x264_src" in os.listdir(x264_build)
mc_path = x264.get_mc_path(x264_build)
assert mc_path.exists()
mc_src = x264.MCBuilder().with_disabled_iscale_mul().build()
# 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 = x264.recompile_mc(mc_path, x264_build, spec_env)
assert recompiled_x264_path.exists()
assert recompiled_x264_path.is_file()
recompiled_x264_path = x264.recompile_mc_src(mc_src, x264_build, spec_env)
# Execute that new binary
x264.update_exe(recompiled_x264_path, x264_dir / "exe")