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, + )