From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Markus Fritsche Date: Mon, 25 May 2026 22:00:00 +0200 Subject: [PATCH] avcodec/aarch64/h264: revert ctx flip — daedalus-fourier PR #36 was a measurement artifact MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reverts the daedalus_ctx_create_no_qpu() → daedalus_ctx_create() flip that landed in 0014-h264-ctx-qpu-capable.patch (marfrit-packages PR #104). The flip was justified by daedalus-fourier PR #36 which reported a 4.30x QPU-over-CPU win on the 1080p H.264 hot-path sum. That number was a measurement artifact. The bench tool's v3d_runner.read_spv() did a bare fopen() that resolved relative to cwd; when run from the source directory (as in PR #36), the SPVs at $builddir/v3d_*.spv were not found, every QPU dispatch returned -1 fast, and the loop timed the failure path. Daedalus-fourier PR #37 fixes the SPV search + bench preflight; corrected numbers from hertz (Pi 5 V3D 7.1) show QPU is 12-77x SLOWER than CPU NEON at every H.264 hot-path kernel: kernel CPU ns/op QPU ns/op winner IDCT 4x4 luma 10.75 217.63 CPU 20.24x IDCT 8x8 luma 29.69 785.94 CPU 26.47x Deblock luma_v 17.63 467.42 CPU 26.51x Deblock luma_h 38.30 498.53 CPU 13.02x qpel mc20 (8x8) 30.17 1300.44 CPU 43.10x qpel mc02 (8x8) 17.69 1363.40 CPU 77.08x qpel mc22 (8x8) 71.60 1948.37 CPU 27.21x 1080p sum: CPU 5.57 ms vs QPU 123.54 ms — QPU 22x slower. Until the daedalus QPU dispatch overhead is actually competitive (a multi-task effort tracked on the daedalus-fourier side), the libavcodec.so substitution must stay on daedalus_ctx_create_no_qpu() to avoid pessimizing every host process that loads it (firefox-fourier RDD, mpv-fourier, daedalus_v4l2_daemon). Both H.264 TUs (h264_idct_daedalus.c, h264_qpel_daedalus.c) are reverted; the change is a 2-line revert of patch 0014. Refs reauktion/daedalus-fourier!37 (the retraction PR). --- libavcodec/aarch64/h264_idct_daedalus.c | 2 +- libavcodec/aarch64/h264_qpel_daedalus.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/aarch64/h264_idct_daedalus.c b/libavcodec/aarch64/h264_idct_daedalus.c --- a/libavcodec/aarch64/h264_idct_daedalus.c +++ b/libavcodec/aarch64/h264_idct_daedalus.c @@ -32,7 +32,7 @@ static pthread_once_t g_dctx_once = PTHREAD_ONCE_INIT; static void daedalus_ctx_init_once(void) { - g_dctx = daedalus_ctx_create(); + g_dctx = daedalus_ctx_create_no_qpu(); } void ff_h264_idct_add_daedalus(uint8_t *dst, int16_t *block, int stride); diff --git a/libavcodec/aarch64/h264_qpel_daedalus.c b/libavcodec/aarch64/h264_qpel_daedalus.c --- a/libavcodec/aarch64/h264_qpel_daedalus.c +++ b/libavcodec/aarch64/h264_qpel_daedalus.c @@ -38,7 +38,7 @@ static pthread_once_t g_dctx_once = PTHREAD_ONCE_INIT; static void daedalus_ctx_init_once(void) { - g_dctx = daedalus_ctx_create(); + g_dctx = daedalus_ctx_create_no_qpu(); } void ff_put_h264_qpel8_mc20_daedalus(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);