diff --git a/arch/ffmpeg-v4l2-request-fourier/0015-h264-ctx-revert-to-no-qpu.patch b/arch/ffmpeg-v4l2-request-fourier/0015-h264-ctx-revert-to-no-qpu.patch new file mode 100644 index 000000000..f3d873d5e --- /dev/null +++ b/arch/ffmpeg-v4l2-request-fourier/0015-h264-ctx-revert-to-no-qpu.patch @@ -0,0 +1,73 @@ +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); diff --git a/arch/ffmpeg-v4l2-request-fourier/PKGBUILD b/arch/ffmpeg-v4l2-request-fourier/PKGBUILD index 5905a23fa..6f4d479f4 100644 --- a/arch/ffmpeg-v4l2-request-fourier/PKGBUILD +++ b/arch/ffmpeg-v4l2-request-fourier/PKGBUILD @@ -24,7 +24,7 @@ _srcname=FFmpeg _version='8.1' _commit='b57fbbe50c9b2656fad86a1a7eeabfd2b2a50935' # v4l2-request-n8.1 tip 2026-04-24 pkgver=8.1.r123329.b57fbbe -pkgrel=11 # pkgrel=11 — libavcodec.so daedalus ctx flipped no_qpu → qpu-capable (PR #36 bench: QPU 4.30x on 1080p hot-path sum, 2026-05-25) +pkgrel=12 # pkgrel=12 — REVERT pkgrel=11 ctx flip; daedalus-fourier PR #36 4.30x headline was measurement artifact (PR #37 corrects: QPU 22x SLOWER than CPU) epoch=2 # daedalus-fourier pin. 209a421 = PR #2 merge (Phase 8c — public API @@ -101,8 +101,9 @@ source=("git+https://github.com/Kwiboo/FFmpeg.git#commit=${_commit}" '0011-h264-chroma-dc-hadamard-daedalus-fourier.patch' '0012-h264-qpel-rest-daedalus-fourier.patch' '0013-h264-deblock-chroma-intra-daedalus-fourier.patch' - '0014-h264-ctx-qpu-capable.patch') -sha256sums=('SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP') + '0014-h264-ctx-qpu-capable.patch' + '0015-h264-ctx-revert-to-no-qpu.patch') +sha256sums=('SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP') pkgver() { cd "${_srcname}" @@ -127,6 +128,7 @@ prepare() { patch -Np1 -i "${srcdir}/0012-h264-qpel-rest-daedalus-fourier.patch" patch -Np1 -i "${srcdir}/0013-h264-deblock-chroma-intra-daedalus-fourier.patch" patch -Np1 -i "${srcdir}/0014-h264-ctx-qpu-capable.patch" + patch -Np1 -i "${srcdir}/0015-h264-ctx-revert-to-no-qpu.patch" } build() { diff --git a/debian/ffmpeg-v4l2-request-fourier/0015-h264-ctx-revert-to-no-qpu.patch b/debian/ffmpeg-v4l2-request-fourier/0015-h264-ctx-revert-to-no-qpu.patch new file mode 100644 index 000000000..f3d873d5e --- /dev/null +++ b/debian/ffmpeg-v4l2-request-fourier/0015-h264-ctx-revert-to-no-qpu.patch @@ -0,0 +1,73 @@ +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); diff --git a/debian/ffmpeg-v4l2-request-fourier/build-deb.sh b/debian/ffmpeg-v4l2-request-fourier/build-deb.sh index bd8d80fb4..cea84a25a 100755 --- a/debian/ffmpeg-v4l2-request-fourier/build-deb.sh +++ b/debian/ffmpeg-v4l2-request-fourier/build-deb.sh @@ -33,7 +33,7 @@ FFMPEG_VERSION=8.1 # epoch 2 matches Debian's stock ffmpeg (currently 7:7.1.x in trixie); # +rfourier suffix to avoid colliding with upstream/Debian rebuilds. PKGVER=2:${FFMPEG_VERSION}+rfourier+gb57fbbe -PKGREL=11 # pkgrel=11 — libavcodec.so daedalus ctx flipped no_qpu → qpu-capable (PR #36 bench: QPU 4.30x on 1080p hot-path sum, 2026-05-25) +PKGREL=12 # pkgrel=12 — REVERT pkgrel=11 ctx flip; daedalus-fourier PR #36 4.30x headline was measurement artifact (PR #37 corrects: QPU 22x SLOWER than CPU) # (cycle 9 of the daedalus-v4l2#11 step 2 substitution arc; closes # the libavcodec.so substitution sequence 6 IDCT4 / 7 IDCT8 / # 8 luma-v deblock / 9 qpel mc20). Pulls daedalus-fourier PR #2 @@ -81,6 +81,7 @@ patch -Np1 -i "$HERE/0011-h264-chroma-dc-hadamard-daedalus-fourier.patch" patch -Np1 -i "$HERE/0012-h264-qpel-rest-daedalus-fourier.patch" patch -Np1 -i "$HERE/0013-h264-deblock-chroma-intra-daedalus-fourier.patch" patch -Np1 -i "$HERE/0014-h264-ctx-qpu-capable.patch" +patch -Np1 -i "$HERE/0015-h264-ctx-revert-to-no-qpu.patch" # --- daedalus-fourier: fetch + build static .a with PIC, install to a # per-build prefix; libavcodec.so links it into the shared object so