From 133b4dfae42060c317c3dfcfea407809c4bee3a1 Mon Sep 17 00:00:00 2001 From: Yingchi Long Date: Mon, 24 Mar 2025 22:29:58 +0800 Subject: [PATCH] x264: support perf ref --- src/speccpu/x264.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/speccpu/x264.py b/src/speccpu/x264.py index ca77abe..39cd1b6 100644 --- a/src/speccpu/x264.py +++ b/src/speccpu/x264.py @@ -82,3 +82,31 @@ def recompile_mc(mc_path: Path, build: Path, spec_env: os._Environ): # Run "make" return make(build, spec_env) + + +def perf_ref(x264_run, perf_output): + """Run "perf" to profile x264 reference performance.""" + x264_cmd = [ + x264_run / "x264_s_base.mytest-m64", + "--seek", + "500", + "--dumpyuv", + "200", + "--frames", + "1250", + "-o", + "BuckBunny_New.264", + "BuckBunny.yuv", + "1280x720", + ] + run( + [ + "perf", + "record", + "-o", + perf_output, + "--", + *x264_cmd, + ], + cwd=x264_run, + )