forked from marfrit/marfrit-packages
Compare commits
14 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d449ec1073 | |||
| 9d30c34be9 | |||
| 1ca18ac130 | |||
| cf9eef6cfa | |||
| 5c69460722 | |||
| d11a52405d | |||
| 29e0852d11 | |||
| 510a31622c | |||
| db9ae16da9 | |||
| 493c762967 | |||
| 360e8eb6bf | |||
| 6288536223 | |||
| 09d8813507 | |||
| 8a3186b53c |
@@ -1419,8 +1419,9 @@ jobs:
|
|||||||
|
|
||||||
- name: wipe secrets
|
- name: wipe secrets
|
||||||
if: always()
|
if: always()
|
||||||
run: rm -f /root/repo_pass /root/.ssh/id_ed25519
|
run: |
|
||||||
run: rm -f /root/.ssh/id_ed25519_hertz
|
rm -f /root/repo_pass /root/.ssh/id_ed25519
|
||||||
|
rm -f /root/.ssh/id_ed25519_hertz
|
||||||
|
|
||||||
# -------------------------------------------------------------------------
|
# -------------------------------------------------------------------------
|
||||||
# mesa-panvk-bifrost-video (aarch64 only) — sibling adding VK_KHR_video_decode_h264
|
# mesa-panvk-bifrost-video (aarch64 only) — sibling adding VK_KHR_video_decode_h264
|
||||||
|
|||||||
@@ -23,10 +23,10 @@ _module=daedalus_v4l2
|
|||||||
# content-equivalent to f0d4186 plus PR #4 (cosmetic menu ctrls).
|
# content-equivalent to f0d4186 plus PR #4 (cosmetic menu ctrls).
|
||||||
# PROTO_VERSION drops 1 → 0; lock-step install with
|
# PROTO_VERSION drops 1 → 0; lock-step install with
|
||||||
# daedalus-v4l2 0.1.0.r33.5d8b436 REQUIRED.
|
# daedalus-v4l2 0.1.0.r33.5d8b436 REQUIRED.
|
||||||
_commit=5d8b4369e58ab947d1c56b1f718293c57c6065b5
|
_commit=872eec505eb91b561892d02a0526749348ddc121
|
||||||
|
|
||||||
pkgver=0.1.0.r33.5d8b436
|
pkgver=0.1.0.r45.872eec5
|
||||||
pkgrel=1 # reset for new upstream pin (5d8b436 — revert parking design)
|
pkgrel=1 # reset for new upstream pin (872eec5 — PROTO_MAX_PAYLOAD 64 KiB -> 1 MiB, closes #19); lock-step with daedalus-v4l2 0.1.0.r45.872eec5 REQUIRED
|
||||||
pkgdesc="V4L2 stateless decoder shim kernel module (DKMS) — Pi 5 / CM5"
|
pkgdesc="V4L2 stateless decoder shim kernel module (DKMS) — Pi 5 / CM5"
|
||||||
arch=('any')
|
arch=('any')
|
||||||
url="https://git.reauktion.de/reauktion/daedalus-v4l2"
|
url="https://git.reauktion.de/reauktion/daedalus-v4l2"
|
||||||
|
|||||||
@@ -23,12 +23,12 @@ _upstreampkg=daedalus-v4l2
|
|||||||
# (daedalus-v4l2#11). Daemon still needs daedalus-fourier at
|
# (daedalus-v4l2#11). Daemon still needs daedalus-fourier at
|
||||||
# build time (Arch packaging for that is a follow-up; Debian side
|
# build time (Arch packaging for that is a follow-up; Debian side
|
||||||
# fetches inline via build-deb.sh).
|
# fetches inline via build-deb.sh).
|
||||||
_commit=6e6dfa144da7bc7fa8be50c8da91d7d1c6132a2c
|
_commit=872eec505eb91b561892d02a0526749348ddc121
|
||||||
|
|
||||||
# 0.1.0 (pre-1.0) + commit count + short sha. Bump the .Y on each
|
# 0.1.0 (pre-1.0) + commit count + short sha. Bump the .Y on each
|
||||||
# Phase 8.x close. pkgver() recomputes at build time.
|
# Phase 8.x close. pkgver() recomputes at build time.
|
||||||
pkgver=0.1.0.r41.6e6dfa1
|
pkgver=0.1.0.r45.872eec5
|
||||||
pkgrel=1 # reset for new upstream pin (6e6dfa1 — soname 62 via /opt/fourier)
|
pkgrel=1 # reset for new upstream pin (872eec5 — PROTO_MAX_PAYLOAD 64 KiB -> 1 MiB, closes #19); lock-step with daedalus-v4l2-dkms 0.1.0.r45.872eec5 REQUIRED
|
||||||
pkgdesc="Userspace daemon for the daedalus-v4l2 V4L2 stateless decoder shim (VP9/AV1/H.264 on Pi 5 / CM5)"
|
pkgdesc="Userspace daemon for the daedalus-v4l2 V4L2 stateless decoder shim (VP9/AV1/H.264 on Pi 5 / CM5)"
|
||||||
arch=('aarch64')
|
arch=('aarch64')
|
||||||
url="https://git.reauktion.de/reauktion/daedalus-v4l2"
|
url="https://git.reauktion.de/reauktion/daedalus-v4l2"
|
||||||
|
|||||||
@@ -0,0 +1,107 @@
|
|||||||
|
From 1b286ddb4efaca26ec9b9e290e989fec77dc1c77 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Markus Fritsche <mfritsche@reauktion.de>
|
||||||
|
Date: Fri, 22 May 2026 10:18:21 +0200
|
||||||
|
Subject: [PATCH] avcodec/aarch64/h264dsp: route H.264 8x8 IDCT through
|
||||||
|
daedalus-fourier
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
H264DSPContext.idct8_add (called per 8x8 block from the High-profile
|
||||||
|
intra-8x8-DCT decode path in h264_mb.c) now dispatches through
|
||||||
|
daedalus_recipe_dispatch_h264_idct8 instead of ff_h264_idct8_add_neon.
|
||||||
|
|
||||||
|
The recipe layer picks the substrate; for cycle 7 (H.264 IDCT 8x8)
|
||||||
|
the recipe is CPU NEON, so this is effectively a NEON-to-NEON
|
||||||
|
substitution layered on top of the cycle-6 IDCT 4x4 wiring. Same
|
||||||
|
pthread_once global context, same destructive-zero semantics; FFmpeg
|
||||||
|
column-major 8x8 storage block[r + 8*c] matches daedalus's convention.
|
||||||
|
|
||||||
|
Bulk path c->idct8_add4 (used for inter 8x8-DCT macroblocks) remains
|
||||||
|
on the in-tree NEON .S code and will be batched through
|
||||||
|
daedalus_recipe_dispatch_h264_idct8 with n_blocks>1 in a follow-up.
|
||||||
|
|
||||||
|
Bit-exact against ff_h264_idct8_add_neon (daedalus-fourier cycle 7
|
||||||
|
green).
|
||||||
|
|
||||||
|
Refs reauktion/daedalus-v4l2#11 — substitution arc step 2 cycle 7.
|
||||||
|
---
|
||||||
|
libavcodec/aarch64/h264_idct_daedalus.c | 29 ++++++++++++++++-------
|
||||||
|
libavcodec/aarch64/h264dsp_init_aarch64.c | 3 ++-
|
||||||
|
2 files changed, 23 insertions(+), 9 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/libavcodec/aarch64/h264_idct_daedalus.c b/libavcodec/aarch64/h264_idct_daedalus.c
|
||||||
|
index 538d223..cbb98af 100644
|
||||||
|
--- a/libavcodec/aarch64/h264_idct_daedalus.c
|
||||||
|
+++ b/libavcodec/aarch64/h264_idct_daedalus.c
|
||||||
|
@@ -1,14 +1,16 @@
|
||||||
|
/*
|
||||||
|
- * H.264 4x4 IDCT + add — daedalus-fourier substitution shim.
|
||||||
|
+ * H.264 4x4 / 8x8 IDCT + add — daedalus-fourier substitution shims.
|
||||||
|
*
|
||||||
|
- * Routes H264DSPContext.idct_add through
|
||||||
|
- * daedalus_recipe_dispatch_h264_idct4 instead of ff_h264_idct_add_neon.
|
||||||
|
- * The recipe layer picks the substrate (CPU NEON by default for
|
||||||
|
- * cycle 6; future cycles may dispatch to V3D opportunistically).
|
||||||
|
+ * Routes H264DSPContext.idct_add → daedalus_recipe_dispatch_h264_idct4
|
||||||
|
+ * H264DSPContext.idct8_add → daedalus_recipe_dispatch_h264_idct8
|
||||||
|
+ * instead of the in-tree ff_h264_idct{,8}_add_neon assembly. The
|
||||||
|
+ * recipe layer picks the substrate (CPU NEON by default for cycles
|
||||||
|
+ * 6 + 7; future cycles may dispatch to V3D opportunistically).
|
||||||
|
*
|
||||||
|
- * FFmpeg's 4x4 block memory layout matches daedalus's column-major
|
||||||
|
- * convention: block[r + 4*c] = coefficient at (row r, col c). Both
|
||||||
|
- * sides destructively zero the block after the transform.
|
||||||
|
+ * FFmpeg's 4x4 and 8x8 block memory layouts match daedalus's
|
||||||
|
+ * column-major convention: block[r + N*c] = coefficient at
|
||||||
|
+ * (row r, col c) for N ∈ {4, 8}. Both sides destructively zero the
|
||||||
|
+ * block after the transform.
|
||||||
|
*
|
||||||
|
* The library context is process-global and lazily initialised under
|
||||||
|
* pthread_once. We pick the no-QPU constructor here because
|
||||||
|
@@ -37,6 +39,7 @@ static void daedalus_ctx_init_once(void)
|
||||||
|
}
|
||||||
|
|
||||||
|
void ff_h264_idct_add_daedalus(uint8_t *dst, int16_t *block, int stride);
|
||||||
|
+void ff_h264_idct8_add_daedalus(uint8_t *dst, int16_t *block, int stride);
|
||||||
|
|
||||||
|
void ff_h264_idct_add_daedalus(uint8_t *dst, int16_t *block, int stride)
|
||||||
|
{
|
||||||
|
@@ -47,3 +50,13 @@ void ff_h264_idct_add_daedalus(uint8_t *dst, int16_t *block, int stride)
|
||||||
|
daedalus_recipe_dispatch_h264_idct4(g_dctx, dst, (size_t)stride,
|
||||||
|
block, 1, &meta);
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+void ff_h264_idct8_add_daedalus(uint8_t *dst, int16_t *block, int stride)
|
||||||
|
+{
|
||||||
|
+ static const daedalus_h264_block_meta meta = { .dst_off = 0 };
|
||||||
|
+
|
||||||
|
+ pthread_once(&g_dctx_once, daedalus_ctx_init_once);
|
||||||
|
+
|
||||||
|
+ daedalus_recipe_dispatch_h264_idct8(g_dctx, dst, (size_t)stride,
|
||||||
|
+ block, 1, &meta);
|
||||||
|
+}
|
||||||
|
diff --git a/libavcodec/aarch64/h264dsp_init_aarch64.c b/libavcodec/aarch64/h264dsp_init_aarch64.c
|
||||||
|
index b993df2..741e551 100644
|
||||||
|
--- a/libavcodec/aarch64/h264dsp_init_aarch64.c
|
||||||
|
+++ b/libavcodec/aarch64/h264dsp_init_aarch64.c
|
||||||
|
@@ -79,6 +79,7 @@ void ff_h264_idct_add8_neon(uint8_t **dest, const int *block_offset,
|
||||||
|
const uint8_t nnzc[15 * 8]);
|
||||||
|
|
||||||
|
void ff_h264_idct8_add_neon(uint8_t *dst, int16_t *block, int stride);
|
||||||
|
+void ff_h264_idct8_add_daedalus(uint8_t *dst, int16_t *block, int stride);
|
||||||
|
void ff_h264_idct8_dc_add_neon(uint8_t *dst, int16_t *block, int stride);
|
||||||
|
void ff_h264_idct8_add4_neon(uint8_t *dst, const int *block_offset,
|
||||||
|
int16_t *block, int stride,
|
||||||
|
@@ -146,7 +147,7 @@ av_cold void ff_h264dsp_init_aarch64(H264DSPContext *c, const int bit_depth,
|
||||||
|
c->idct_add16intra = ff_h264_idct_add16intra_neon;
|
||||||
|
if (chroma_format_idc <= 1)
|
||||||
|
c->idct_add8 = ff_h264_idct_add8_neon;
|
||||||
|
- c->idct8_add = ff_h264_idct8_add_neon;
|
||||||
|
+ c->idct8_add = ff_h264_idct8_add_daedalus;
|
||||||
|
c->idct8_dc_add = ff_h264_idct8_dc_add_neon;
|
||||||
|
c->idct8_add4 = ff_h264_idct8_add4_neon;
|
||||||
|
} else if (have_neon(cpu_flags) && bit_depth == 10) {
|
||||||
|
--
|
||||||
|
2.47.3
|
||||||
|
|
||||||
@@ -0,0 +1,121 @@
|
|||||||
|
From 68731c41d7ea68be0e912b128cb4e71fb56e8263 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Markus Fritsche <mfritsche@reauktion.de>
|
||||||
|
Date: Fri, 22 May 2026 12:15:16 +0200
|
||||||
|
Subject: [PATCH] avcodec/aarch64/h264dsp: route H.264 luma-v deblock through
|
||||||
|
daedalus-fourier
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
H264DSPContext.v_loop_filter_luma (non-intra bS<4 vertical luma
|
||||||
|
deblock, called per macroblock-row edge from the slice deblock
|
||||||
|
loop) now dispatches through
|
||||||
|
daedalus_recipe_dispatch_h264_deblock_luma_v instead of
|
||||||
|
ff_h264_v_loop_filter_luma_neon.
|
||||||
|
|
||||||
|
The recipe layer picks the substrate; for cycle 8 the daedalus
|
||||||
|
docstring marks the kernel "CPU primary; QPU opportunistic", but
|
||||||
|
the libavcodec.so context here is built with
|
||||||
|
daedalus_ctx_create_no_qpu — process-global pthread_once init,
|
||||||
|
shared with cycles 6/7. QPU opportunism stays gated off until a
|
||||||
|
follow-up adds an explicit feature flag (no implicit Vulkan init
|
||||||
|
in arbitrary host processes). In the meantime cycle 8 is a
|
||||||
|
plumbing-only substitution, NEON-to-NEON via the daedalus recipe.
|
||||||
|
|
||||||
|
Intra (bS=4) loop filter — c->v_loop_filter_luma_intra — stays on
|
||||||
|
the in-tree NEON .S code; daedalus's daedalus_h264_deblock_meta
|
||||||
|
only covers the non-intra path per its docstring.
|
||||||
|
|
||||||
|
FFmpeg `int alpha/beta/int8_t tc0[4]` → daedalus_h264_deblock_meta
|
||||||
|
(int32_t alpha/beta + inline int8_t tc0[4]). pix already points
|
||||||
|
to row 0 of the bottom block per FFmpeg's deblock convention,
|
||||||
|
satisfying daedalus's `dst_off >= 4 * dst_stride` constraint.
|
||||||
|
|
||||||
|
Refs reauktion/daedalus-v4l2#11 — substitution arc step 2 cycle 8.
|
||||||
|
---
|
||||||
|
libavcodec/aarch64/h264_idct_daedalus.c | 36 +++++++++++++++++++----
|
||||||
|
libavcodec/aarch64/h264dsp_init_aarch64.c | 4 ++-
|
||||||
|
2 files changed, 33 insertions(+), 7 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/libavcodec/aarch64/h264_idct_daedalus.c b/libavcodec/aarch64/h264_idct_daedalus.c
|
||||||
|
index cbb98af..92365fa 100644
|
||||||
|
--- a/libavcodec/aarch64/h264_idct_daedalus.c
|
||||||
|
+++ b/libavcodec/aarch64/h264_idct_daedalus.c
|
||||||
|
@@ -1,11 +1,14 @@
|
||||||
|
/*
|
||||||
|
- * H.264 4x4 / 8x8 IDCT + add — daedalus-fourier substitution shims.
|
||||||
|
+ * H.264 4x4 / 8x8 IDCT + luma-v deblock — daedalus-fourier substitution shims.
|
||||||
|
*
|
||||||
|
- * Routes H264DSPContext.idct_add → daedalus_recipe_dispatch_h264_idct4
|
||||||
|
- * H264DSPContext.idct8_add → daedalus_recipe_dispatch_h264_idct8
|
||||||
|
- * instead of the in-tree ff_h264_idct{,8}_add_neon assembly. The
|
||||||
|
- * recipe layer picks the substrate (CPU NEON by default for cycles
|
||||||
|
- * 6 + 7; future cycles may dispatch to V3D opportunistically).
|
||||||
|
+ * Routes H264DSPContext.idct_add → daedalus_recipe_dispatch_h264_idct4
|
||||||
|
+ * H264DSPContext.idct8_add → daedalus_recipe_dispatch_h264_idct8
|
||||||
|
+ * H264DSPContext.v_loop_filter_luma → daedalus_recipe_dispatch_h264_deblock_luma_v
|
||||||
|
+ * instead of the in-tree ff_h264_*_neon assembly. The recipe layer
|
||||||
|
+ * picks the substrate (CPU NEON for cycles 6 + 7 by default; cycle 8
|
||||||
|
+ * is CPU primary with QPU opportunistic — the ctx below is no-QPU,
|
||||||
|
+ * so cycle 8 stays on the CPU NEON path until a separate change
|
||||||
|
+ * gates QPU init on a daedalus-fourier feature flag).
|
||||||
|
*
|
||||||
|
* FFmpeg's 4x4 and 8x8 block memory layouts match daedalus's
|
||||||
|
* column-major convention: block[r + N*c] = coefficient at
|
||||||
|
@@ -40,6 +43,8 @@ static void daedalus_ctx_init_once(void)
|
||||||
|
|
||||||
|
void ff_h264_idct_add_daedalus(uint8_t *dst, int16_t *block, int stride);
|
||||||
|
void ff_h264_idct8_add_daedalus(uint8_t *dst, int16_t *block, int stride);
|
||||||
|
+void ff_h264_v_loop_filter_luma_daedalus(uint8_t *pix, ptrdiff_t stride,
|
||||||
|
+ int alpha, int beta, int8_t *tc0);
|
||||||
|
|
||||||
|
void ff_h264_idct_add_daedalus(uint8_t *dst, int16_t *block, int stride)
|
||||||
|
{
|
||||||
|
@@ -60,3 +65,22 @@ void ff_h264_idct8_add_daedalus(uint8_t *dst, int16_t *block, int stride)
|
||||||
|
daedalus_recipe_dispatch_h264_idct8(g_dctx, dst, (size_t)stride,
|
||||||
|
block, 1, &meta);
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+void ff_h264_v_loop_filter_luma_daedalus(uint8_t *pix, ptrdiff_t stride,
|
||||||
|
+ int alpha, int beta, int8_t *tc0)
|
||||||
|
+{
|
||||||
|
+ daedalus_h264_deblock_meta meta = {
|
||||||
|
+ .dst_off = 0,
|
||||||
|
+ .alpha = alpha,
|
||||||
|
+ .beta = beta,
|
||||||
|
+ };
|
||||||
|
+ meta.tc0[0] = tc0[0];
|
||||||
|
+ meta.tc0[1] = tc0[1];
|
||||||
|
+ meta.tc0[2] = tc0[2];
|
||||||
|
+ meta.tc0[3] = tc0[3];
|
||||||
|
+
|
||||||
|
+ pthread_once(&g_dctx_once, daedalus_ctx_init_once);
|
||||||
|
+
|
||||||
|
+ daedalus_recipe_dispatch_h264_deblock_luma_v(g_dctx, pix, (size_t)stride,
|
||||||
|
+ 1, &meta);
|
||||||
|
+}
|
||||||
|
diff --git a/libavcodec/aarch64/h264dsp_init_aarch64.c b/libavcodec/aarch64/h264dsp_init_aarch64.c
|
||||||
|
index 741e551..85ac381 100644
|
||||||
|
--- a/libavcodec/aarch64/h264dsp_init_aarch64.c
|
||||||
|
+++ b/libavcodec/aarch64/h264dsp_init_aarch64.c
|
||||||
|
@@ -27,6 +27,8 @@
|
||||||
|
|
||||||
|
void ff_h264_v_loop_filter_luma_neon(uint8_t *pix, ptrdiff_t stride, int alpha,
|
||||||
|
int beta, int8_t *tc0);
|
||||||
|
+void ff_h264_v_loop_filter_luma_daedalus(uint8_t *pix, ptrdiff_t stride,
|
||||||
|
+ int alpha, int beta, int8_t *tc0);
|
||||||
|
void ff_h264_h_loop_filter_luma_neon(uint8_t *pix, ptrdiff_t stride, int alpha,
|
||||||
|
int beta, int8_t *tc0);
|
||||||
|
void ff_h264_v_loop_filter_luma_intra_neon(uint8_t *pix, ptrdiff_t stride, int alpha,
|
||||||
|
@@ -114,7 +116,7 @@ av_cold void ff_h264dsp_init_aarch64(H264DSPContext *c, const int bit_depth,
|
||||||
|
int cpu_flags = av_get_cpu_flags();
|
||||||
|
|
||||||
|
if (have_neon(cpu_flags) && bit_depth == 8) {
|
||||||
|
- c->v_loop_filter_luma = ff_h264_v_loop_filter_luma_neon;
|
||||||
|
+ c->v_loop_filter_luma = ff_h264_v_loop_filter_luma_daedalus;
|
||||||
|
c->h_loop_filter_luma = ff_h264_h_loop_filter_luma_neon;
|
||||||
|
c->v_loop_filter_luma_intra= ff_h264_v_loop_filter_luma_intra_neon;
|
||||||
|
c->h_loop_filter_luma_intra= ff_h264_h_loop_filter_luma_intra_neon;
|
||||||
|
--
|
||||||
|
2.47.3
|
||||||
|
|
||||||
@@ -0,0 +1,82 @@
|
|||||||
|
From 0d1292ea99bc4e5fa2da438259fa01a2374e3e04 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Markus Fritsche <mfritsche@reauktion.de>
|
||||||
|
Date: Fri, 22 May 2026 14:18:25 +0200
|
||||||
|
Subject: [PATCH] avcodec/h264: restore AV_CODEC_FLAG_LOW_DELAY semantics
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
FFmpeg 8.x dropped the H.264 decoder's low_delay path —
|
||||||
|
AV_CODEC_FLAG_LOW_DELAY no longer prevents
|
||||||
|
h264_select_output_frame from running the display-order DPB
|
||||||
|
output queue. V4L2-stateless-style consumers (daedalus-v4l2
|
||||||
|
daemon, libva-v4l2-request-fourier) that set the flag end up
|
||||||
|
seeing the 2-1-4-3 pair-swap pattern on B-frame streams again.
|
||||||
|
|
||||||
|
Restore the documented semantics:
|
||||||
|
|
||||||
|
- Early-exit at the top of h264_select_output_frame when the
|
||||||
|
flag is set: emit the just-decoded picture immediately as
|
||||||
|
next_output_pic, mirror the corruption / recovery-point
|
||||||
|
tracking the main path performs, and skip the entire
|
||||||
|
delayed_pic[] / POC reorder machinery.
|
||||||
|
|
||||||
|
- Suppress the SPS-driven has_b_frames clobber in
|
||||||
|
h264_field_start when the flag is set, so the per-slice
|
||||||
|
bitstream_restriction_flag re-pickup cannot reintroduce a
|
||||||
|
nonzero reorder buffer mid-stream.
|
||||||
|
|
||||||
|
This is a fork-only change required by the daedalus-v4l2 daemon's
|
||||||
|
one-frame-per-send_packet contract; upstream FFmpeg consumers that
|
||||||
|
expect display-order output remain untouched (flag default = off).
|
||||||
|
|
||||||
|
Refs reauktion/daedalus-v4l2#11 — substitution arc step 2 deblock
|
||||||
|
+ flag-restoration follow-up.
|
||||||
|
---
|
||||||
|
libavcodec/h264_slice.c | 23 +++++++++++++++++++++++
|
||||||
|
1 file changed, 23 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
|
||||||
|
index 97fab70..a7bfbd6 100644
|
||||||
|
--- a/libavcodec/h264_slice.c
|
||||||
|
+++ b/libavcodec/h264_slice.c
|
||||||
|
@@ -1308,6 +1308,28 @@ static int h264_select_output_frame(H264Context *h)
|
||||||
|
cur->mmco_reset = h->mmco_reset;
|
||||||
|
h->mmco_reset = 0;
|
||||||
|
|
||||||
|
+ /* AV_CODEC_FLAG_LOW_DELAY restore (FFmpeg 8.x dropped the H.264
|
||||||
|
+ * decoder's low_delay path). Bypass the display-order DPB
|
||||||
|
+ * output queue: emit the just-decoded picture immediately, in
|
||||||
|
+ * decode order, one per send_packet. V4L2-stateless-style
|
||||||
|
+ * consumers (daedalus-v4l2 daemon, libva-v4l2-request-fourier)
|
||||||
|
+ * do their own POC-based reorder downstream and require this
|
||||||
|
+ * behaviour. */
|
||||||
|
+ if (h->avctx->flags & AV_CODEC_FLAG_LOW_DELAY) {
|
||||||
|
+ h->next_output_pic = cur;
|
||||||
|
+ h->next_outputed_poc = cur->poc;
|
||||||
|
+ h->frame_recovered |= cur->recovered;
|
||||||
|
+ cur->recovered |= h->frame_recovered & FRAME_RECOVERED_SEI;
|
||||||
|
+ if (!cur->recovered) {
|
||||||
|
+ if (!(h->avctx->flags & AV_CODEC_FLAG_OUTPUT_CORRUPT) &&
|
||||||
|
+ !(h->avctx->flags2 & AV_CODEC_FLAG2_SHOW_ALL))
|
||||||
|
+ h->next_output_pic = NULL;
|
||||||
|
+ else
|
||||||
|
+ cur->f->flags |= AV_FRAME_FLAG_CORRUPT;
|
||||||
|
+ }
|
||||||
|
+ return 0;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
if (sps->bitstream_restriction_flag ||
|
||||||
|
h->avctx->strict_std_compliance >= FF_COMPLIANCE_STRICT) {
|
||||||
|
h->avctx->has_b_frames = FFMAX(h->avctx->has_b_frames, sps->num_reorder_frames);
|
||||||
|
@@ -1415,6 +1437,7 @@ static int h264_field_start(H264Context *h, const H264SliceContext *sl,
|
||||||
|
sps = h->ps.sps;
|
||||||
|
|
||||||
|
if (sps->bitstream_restriction_flag &&
|
||||||
|
+ !(h->avctx->flags & AV_CODEC_FLAG_LOW_DELAY) &&
|
||||||
|
h->avctx->has_b_frames < sps->num_reorder_frames) {
|
||||||
|
h->avctx->has_b_frames = sps->num_reorder_frames;
|
||||||
|
}
|
||||||
|
--
|
||||||
|
2.47.3
|
||||||
|
|
||||||
@@ -24,7 +24,7 @@ _srcname=FFmpeg
|
|||||||
_version='8.1'
|
_version='8.1'
|
||||||
_commit='b57fbbe50c9b2656fad86a1a7eeabfd2b2a50935' # v4l2-request-n8.1 tip 2026-04-24
|
_commit='b57fbbe50c9b2656fad86a1a7eeabfd2b2a50935' # v4l2-request-n8.1 tip 2026-04-24
|
||||||
pkgver=8.1.r123329.b57fbbe
|
pkgver=8.1.r123329.b57fbbe
|
||||||
pkgrel=6 # pkgrel=6 — H.264 IDCT 4x4 daedalus-fourier substitution (2026-05-21)
|
pkgrel=9 # pkgrel=9 — restore AV_CODEC_FLAG_LOW_DELAY for H.264 (2026-05-22)
|
||||||
epoch=2
|
epoch=2
|
||||||
|
|
||||||
# daedalus-fourier pin — first kernel substitution in libavcodec
|
# daedalus-fourier pin — first kernel substitution in libavcodec
|
||||||
@@ -90,8 +90,11 @@ source=("git+https://github.com/Kwiboo/FFmpeg.git#commit=${_commit}"
|
|||||||
"daedalus-fourier-${_daedalus_fourier_commit}.tar.gz::https://git.reauktion.de/marfrit/daedalus-fourier/archive/${_daedalus_fourier_commit}.tar.gz"
|
"daedalus-fourier-${_daedalus_fourier_commit}.tar.gz::https://git.reauktion.de/marfrit/daedalus-fourier/archive/${_daedalus_fourier_commit}.tar.gz"
|
||||||
'0001-libudev-bypass-fallback.patch'
|
'0001-libudev-bypass-fallback.patch'
|
||||||
'0002-nv15-to-p010-unpack.patch'
|
'0002-nv15-to-p010-unpack.patch'
|
||||||
'0003-h264-idct4-daedalus-fourier.patch')
|
'0003-h264-idct4-daedalus-fourier.patch'
|
||||||
sha256sums=('SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP')
|
'0004-h264-idct8-daedalus-fourier.patch'
|
||||||
|
'0005-h264-deblock-luma-v-daedalus-fourier.patch'
|
||||||
|
'0006-h264-restore-low-delay.patch')
|
||||||
|
sha256sums=('SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP')
|
||||||
|
|
||||||
pkgver() {
|
pkgver() {
|
||||||
cd "${_srcname}"
|
cd "${_srcname}"
|
||||||
@@ -105,6 +108,9 @@ prepare() {
|
|||||||
patch -Np1 -i "${srcdir}/0001-libudev-bypass-fallback.patch"
|
patch -Np1 -i "${srcdir}/0001-libudev-bypass-fallback.patch"
|
||||||
patch -Np1 -i "${srcdir}/0002-nv15-to-p010-unpack.patch"
|
patch -Np1 -i "${srcdir}/0002-nv15-to-p010-unpack.patch"
|
||||||
patch -Np1 -i "${srcdir}/0003-h264-idct4-daedalus-fourier.patch"
|
patch -Np1 -i "${srcdir}/0003-h264-idct4-daedalus-fourier.patch"
|
||||||
|
patch -Np1 -i "${srcdir}/0004-h264-idct8-daedalus-fourier.patch"
|
||||||
|
patch -Np1 -i "${srcdir}/0005-h264-deblock-luma-v-daedalus-fourier.patch"
|
||||||
|
patch -Np1 -i "${srcdir}/0006-h264-restore-low-delay.patch"
|
||||||
}
|
}
|
||||||
|
|
||||||
build() {
|
build() {
|
||||||
|
|||||||
+3
-3
@@ -14,9 +14,9 @@
|
|||||||
# Sibling userspace package: ../daedalus-v4l2/build-deb.sh
|
# Sibling userspace package: ../daedalus-v4l2/build-deb.sh
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
UPSTREAM_COMMIT=5d8b4369e58ab947d1c56b1f718293c57c6065b5
|
UPSTREAM_COMMIT=872eec505eb91b561892d02a0526749348ddc121
|
||||||
PKGVER=0.1.0+r33+g5d8b436
|
PKGVER=0.1.0+r45+g872eec5
|
||||||
PKGREL=1 # reset for new upstream pin (5d8b436 — revert parking design); still carries the #64 multi-kernel postinst fix
|
PKGREL=1 # reset for new upstream pin (872eec5 — PROTO_MAX_PAYLOAD 64 KiB -> 1 MiB, closes #19); lock-step with daedalus-v4l2 0.1.0+r45+g872eec5 REQUIRED
|
||||||
MODULE_NAME=daedalus_v4l2
|
MODULE_NAME=daedalus_v4l2
|
||||||
|
|
||||||
HERE=$(dirname "$(readlink -f "$0")")
|
HERE=$(dirname "$(readlink -f "$0")")
|
||||||
|
|||||||
+21
@@ -1,3 +1,24 @@
|
|||||||
|
daedalus-v4l2-dkms (0.1.0+r45+g872eec5-1) bookworm trixie; urgency=medium
|
||||||
|
|
||||||
|
* Bump to 872eec5 — picks up daedalus-v4l2 PR #20 (closes #19).
|
||||||
|
Wire-protocol cap DAEDALUS_PROTO_MAX_PAYLOAD raised from 64 KiB
|
||||||
|
to 1 MiB in include/daedalus_v4l2_proto.h. The kernel module
|
||||||
|
inherits the larger DAEDALUS_MAX_BITSTREAM via the same #define
|
||||||
|
and daedalus_fill_output_fmt now reports OUTPUT_MPLANE
|
||||||
|
sizeimage = ~1 MiB instead of 65484.
|
||||||
|
* Skips the r33 -> r45 commit range — between 5d8b436 and 872eec5
|
||||||
|
only one kernel/include change landed (the PROTO_MAX_PAYLOAD
|
||||||
|
bump above). The intervening daemon-only bumps (r37 / r39 /
|
||||||
|
r41 / r43) didn't touch kernel/ or include/ at all.
|
||||||
|
* Effective wire cap is min(kernel, daemon) — lock-step install
|
||||||
|
WITH daedalus-v4l2 0.1.0+r45+g872eec5 REQUIRED.
|
||||||
|
* Allocations (kmemdup / kmalloc on payload, vb2 plane backing)
|
||||||
|
are dynamic and sized per-payload at runtime; the bump only
|
||||||
|
sets the ceiling. KMALLOC_MAX_SIZE on aarch64 SLUB is several
|
||||||
|
MiB so 1 MiB is well within bounds.
|
||||||
|
|
||||||
|
-- Markus Fritsche <mfritsche@reauktion.de> Fri, 22 May 2026 21:00:00 +0000
|
||||||
|
|
||||||
daedalus-v4l2-dkms (0.1.0+r33+g5d8b436-1) bookworm trixie; urgency=medium
|
daedalus-v4l2-dkms (0.1.0+r33+g5d8b436-1) bookworm trixie; urgency=medium
|
||||||
|
|
||||||
* Bump to 5d8b436 — reverts daedalus-v4l2 PRs #7 + #8. Kernel
|
* Bump to 5d8b436 — reverts daedalus-v4l2 PRs #7 + #8. Kernel
|
||||||
|
|||||||
Vendored
+3
-3
@@ -19,9 +19,9 @@ set -euo pipefail
|
|||||||
# source tree we own in marfrit-packages. Headers + .pc files
|
# source tree we own in marfrit-packages. Headers + .pc files
|
||||||
# come from ffmpeg-v4l2-request-fourier (installed by the CI
|
# come from ffmpeg-v4l2-request-fourier (installed by the CI
|
||||||
# workflow before this script runs; see PKG_CONFIG_PATH below).
|
# workflow before this script runs; see PKG_CONFIG_PATH below).
|
||||||
UPSTREAM_COMMIT=6e6dfa144da7bc7fa8be50c8da91d7d1c6132a2c
|
UPSTREAM_COMMIT=872eec505eb91b561892d02a0526749348ddc121
|
||||||
PKGVER=0.1.0+r41+g6e6dfa1
|
PKGVER=0.1.0+r45+g872eec5
|
||||||
PKGREL=1 # reset for new upstream pin (6e6dfa1 — soname 62 via /opt/fourier)
|
PKGREL=1 # reset for new upstream pin (872eec5 — PROTO_MAX_PAYLOAD 64 KiB -> 1 MiB, closes #19); lock-step with daedalus-v4l2-dkms 0.1.0+r45+g872eec5 REQUIRED
|
||||||
|
|
||||||
# daedalus-fourier pin. d87239d = marfrit/daedalus-fourier PR #1 merge
|
# daedalus-fourier pin. d87239d = marfrit/daedalus-fourier PR #1 merge
|
||||||
# (install rules + pkg-config, enables this consumer to find_package
|
# (install rules + pkg-config, enables this consumer to find_package
|
||||||
|
|||||||
+43
@@ -1,3 +1,46 @@
|
|||||||
|
daedalus-v4l2 (0.1.0+r45+g872eec5-1) bookworm trixie; urgency=medium
|
||||||
|
|
||||||
|
* Bump to 872eec5 — picks up daedalus-v4l2 PR #20 (closes #19).
|
||||||
|
Wire-protocol cap DAEDALUS_PROTO_MAX_PAYLOAD raised from 64 KiB
|
||||||
|
to 1 MiB. DAEDALUS_MAX_BITSTREAM follows; daedalus_fill_output_fmt
|
||||||
|
now reports OUTPUT_MPLANE sizeimage = ~1 MiB instead of 65484.
|
||||||
|
libva-v4l2-request-fourier's S_FMT-driven OUTPUT-pool resize
|
||||||
|
finally succeeds; Firefox no longer falls off to libmozavcodec
|
||||||
|
SW when an H.264 slice exceeds 64 KiB (routine on any
|
||||||
|
720p+ stream).
|
||||||
|
* #define-only change in include/daedalus_v4l2_proto.h; struct
|
||||||
|
layout unchanged. But effective cap is min(kernel, daemon) —
|
||||||
|
lock-step install of this package WITH
|
||||||
|
daedalus-v4l2-dkms 0.1.0+r45+g872eec5 REQUIRED.
|
||||||
|
* Daemon-side allocations are dynamic (malloc-on-payload), so
|
||||||
|
the practical growth is one ~1 MiB read buffer per daemon
|
||||||
|
process at startup. Negligible on Pi 5 / 8 GB.
|
||||||
|
* Picks up the same r43 -> r45 transition as daedalus-v4l2-dkms
|
||||||
|
(which had been stuck at r33+g5d8b436 since the parking-design
|
||||||
|
revert because the kernel module didn't change in r37/r39/r41/r43).
|
||||||
|
|
||||||
|
-- Markus Fritsche <mfritsche@reauktion.de> Fri, 22 May 2026 21:00:00 +0000
|
||||||
|
|
||||||
|
daedalus-v4l2 (0.1.0+r43+g1d8f5af-1) bookworm trixie; urgency=medium
|
||||||
|
|
||||||
|
* Bump to 1d8f5af — picks up daedalus-v4l2 PR #18 (closes #17).
|
||||||
|
Daemon now drops degenerate (<4 byte) bitstreams at the REQ_DECODE
|
||||||
|
entry instead of letting avcodec_send_packet return
|
||||||
|
AVERROR_INVALIDDATA. Reply RESP_FRAME with status=
|
||||||
|
DAEDALUS_DECODE_NO_FRAME so libva's V4L2 surface pool stays
|
||||||
|
healthy.
|
||||||
|
* Fixes the Firefox YouTube avc1 pause→resume regression observed
|
||||||
|
on higgs: libva-v4l2-request-fourier flushes a 3-byte stub
|
||||||
|
(presumably a bare NAL start code) into OUTPUT_MPLANE at the
|
||||||
|
pause boundary; the old INVALIDDATA error path made Firefox
|
||||||
|
fall off to libmozavcodec SW for the rest of the session. With
|
||||||
|
this filter the daemon logs the sentinel as 'tiny bitstream 3
|
||||||
|
bytes — dropping as no-op' and the next real REQ_DECODE
|
||||||
|
proceeds normally.
|
||||||
|
* Wire protocol unchanged. No daedalus-v4l2-dkms bump needed.
|
||||||
|
|
||||||
|
-- Markus Fritsche <mfritsche@reauktion.de> Fri, 22 May 2026 17:30:00 +0000
|
||||||
|
|
||||||
daedalus-v4l2 (0.1.0+r41+g6e6dfa1-1) bookworm trixie; urgency=medium
|
daedalus-v4l2 (0.1.0+r41+g6e6dfa1-1) bookworm trixie; urgency=medium
|
||||||
|
|
||||||
* Bump to 6e6dfa1 — daedalus-v4l2 PR #16. Daemon dlopens Kwiboo
|
* Bump to 6e6dfa1 — daedalus-v4l2 PR #16. Daemon dlopens Kwiboo
|
||||||
|
|||||||
@@ -0,0 +1,107 @@
|
|||||||
|
From 1b286ddb4efaca26ec9b9e290e989fec77dc1c77 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Markus Fritsche <mfritsche@reauktion.de>
|
||||||
|
Date: Fri, 22 May 2026 10:18:21 +0200
|
||||||
|
Subject: [PATCH] avcodec/aarch64/h264dsp: route H.264 8x8 IDCT through
|
||||||
|
daedalus-fourier
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
H264DSPContext.idct8_add (called per 8x8 block from the High-profile
|
||||||
|
intra-8x8-DCT decode path in h264_mb.c) now dispatches through
|
||||||
|
daedalus_recipe_dispatch_h264_idct8 instead of ff_h264_idct8_add_neon.
|
||||||
|
|
||||||
|
The recipe layer picks the substrate; for cycle 7 (H.264 IDCT 8x8)
|
||||||
|
the recipe is CPU NEON, so this is effectively a NEON-to-NEON
|
||||||
|
substitution layered on top of the cycle-6 IDCT 4x4 wiring. Same
|
||||||
|
pthread_once global context, same destructive-zero semantics; FFmpeg
|
||||||
|
column-major 8x8 storage block[r + 8*c] matches daedalus's convention.
|
||||||
|
|
||||||
|
Bulk path c->idct8_add4 (used for inter 8x8-DCT macroblocks) remains
|
||||||
|
on the in-tree NEON .S code and will be batched through
|
||||||
|
daedalus_recipe_dispatch_h264_idct8 with n_blocks>1 in a follow-up.
|
||||||
|
|
||||||
|
Bit-exact against ff_h264_idct8_add_neon (daedalus-fourier cycle 7
|
||||||
|
green).
|
||||||
|
|
||||||
|
Refs reauktion/daedalus-v4l2#11 — substitution arc step 2 cycle 7.
|
||||||
|
---
|
||||||
|
libavcodec/aarch64/h264_idct_daedalus.c | 29 ++++++++++++++++-------
|
||||||
|
libavcodec/aarch64/h264dsp_init_aarch64.c | 3 ++-
|
||||||
|
2 files changed, 23 insertions(+), 9 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/libavcodec/aarch64/h264_idct_daedalus.c b/libavcodec/aarch64/h264_idct_daedalus.c
|
||||||
|
index 538d223..cbb98af 100644
|
||||||
|
--- a/libavcodec/aarch64/h264_idct_daedalus.c
|
||||||
|
+++ b/libavcodec/aarch64/h264_idct_daedalus.c
|
||||||
|
@@ -1,14 +1,16 @@
|
||||||
|
/*
|
||||||
|
- * H.264 4x4 IDCT + add — daedalus-fourier substitution shim.
|
||||||
|
+ * H.264 4x4 / 8x8 IDCT + add — daedalus-fourier substitution shims.
|
||||||
|
*
|
||||||
|
- * Routes H264DSPContext.idct_add through
|
||||||
|
- * daedalus_recipe_dispatch_h264_idct4 instead of ff_h264_idct_add_neon.
|
||||||
|
- * The recipe layer picks the substrate (CPU NEON by default for
|
||||||
|
- * cycle 6; future cycles may dispatch to V3D opportunistically).
|
||||||
|
+ * Routes H264DSPContext.idct_add → daedalus_recipe_dispatch_h264_idct4
|
||||||
|
+ * H264DSPContext.idct8_add → daedalus_recipe_dispatch_h264_idct8
|
||||||
|
+ * instead of the in-tree ff_h264_idct{,8}_add_neon assembly. The
|
||||||
|
+ * recipe layer picks the substrate (CPU NEON by default for cycles
|
||||||
|
+ * 6 + 7; future cycles may dispatch to V3D opportunistically).
|
||||||
|
*
|
||||||
|
- * FFmpeg's 4x4 block memory layout matches daedalus's column-major
|
||||||
|
- * convention: block[r + 4*c] = coefficient at (row r, col c). Both
|
||||||
|
- * sides destructively zero the block after the transform.
|
||||||
|
+ * FFmpeg's 4x4 and 8x8 block memory layouts match daedalus's
|
||||||
|
+ * column-major convention: block[r + N*c] = coefficient at
|
||||||
|
+ * (row r, col c) for N ∈ {4, 8}. Both sides destructively zero the
|
||||||
|
+ * block after the transform.
|
||||||
|
*
|
||||||
|
* The library context is process-global and lazily initialised under
|
||||||
|
* pthread_once. We pick the no-QPU constructor here because
|
||||||
|
@@ -37,6 +39,7 @@ static void daedalus_ctx_init_once(void)
|
||||||
|
}
|
||||||
|
|
||||||
|
void ff_h264_idct_add_daedalus(uint8_t *dst, int16_t *block, int stride);
|
||||||
|
+void ff_h264_idct8_add_daedalus(uint8_t *dst, int16_t *block, int stride);
|
||||||
|
|
||||||
|
void ff_h264_idct_add_daedalus(uint8_t *dst, int16_t *block, int stride)
|
||||||
|
{
|
||||||
|
@@ -47,3 +50,13 @@ void ff_h264_idct_add_daedalus(uint8_t *dst, int16_t *block, int stride)
|
||||||
|
daedalus_recipe_dispatch_h264_idct4(g_dctx, dst, (size_t)stride,
|
||||||
|
block, 1, &meta);
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+void ff_h264_idct8_add_daedalus(uint8_t *dst, int16_t *block, int stride)
|
||||||
|
+{
|
||||||
|
+ static const daedalus_h264_block_meta meta = { .dst_off = 0 };
|
||||||
|
+
|
||||||
|
+ pthread_once(&g_dctx_once, daedalus_ctx_init_once);
|
||||||
|
+
|
||||||
|
+ daedalus_recipe_dispatch_h264_idct8(g_dctx, dst, (size_t)stride,
|
||||||
|
+ block, 1, &meta);
|
||||||
|
+}
|
||||||
|
diff --git a/libavcodec/aarch64/h264dsp_init_aarch64.c b/libavcodec/aarch64/h264dsp_init_aarch64.c
|
||||||
|
index b993df2..741e551 100644
|
||||||
|
--- a/libavcodec/aarch64/h264dsp_init_aarch64.c
|
||||||
|
+++ b/libavcodec/aarch64/h264dsp_init_aarch64.c
|
||||||
|
@@ -79,6 +79,7 @@ void ff_h264_idct_add8_neon(uint8_t **dest, const int *block_offset,
|
||||||
|
const uint8_t nnzc[15 * 8]);
|
||||||
|
|
||||||
|
void ff_h264_idct8_add_neon(uint8_t *dst, int16_t *block, int stride);
|
||||||
|
+void ff_h264_idct8_add_daedalus(uint8_t *dst, int16_t *block, int stride);
|
||||||
|
void ff_h264_idct8_dc_add_neon(uint8_t *dst, int16_t *block, int stride);
|
||||||
|
void ff_h264_idct8_add4_neon(uint8_t *dst, const int *block_offset,
|
||||||
|
int16_t *block, int stride,
|
||||||
|
@@ -146,7 +147,7 @@ av_cold void ff_h264dsp_init_aarch64(H264DSPContext *c, const int bit_depth,
|
||||||
|
c->idct_add16intra = ff_h264_idct_add16intra_neon;
|
||||||
|
if (chroma_format_idc <= 1)
|
||||||
|
c->idct_add8 = ff_h264_idct_add8_neon;
|
||||||
|
- c->idct8_add = ff_h264_idct8_add_neon;
|
||||||
|
+ c->idct8_add = ff_h264_idct8_add_daedalus;
|
||||||
|
c->idct8_dc_add = ff_h264_idct8_dc_add_neon;
|
||||||
|
c->idct8_add4 = ff_h264_idct8_add4_neon;
|
||||||
|
} else if (have_neon(cpu_flags) && bit_depth == 10) {
|
||||||
|
--
|
||||||
|
2.47.3
|
||||||
|
|
||||||
+121
@@ -0,0 +1,121 @@
|
|||||||
|
From 68731c41d7ea68be0e912b128cb4e71fb56e8263 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Markus Fritsche <mfritsche@reauktion.de>
|
||||||
|
Date: Fri, 22 May 2026 12:15:16 +0200
|
||||||
|
Subject: [PATCH] avcodec/aarch64/h264dsp: route H.264 luma-v deblock through
|
||||||
|
daedalus-fourier
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
H264DSPContext.v_loop_filter_luma (non-intra bS<4 vertical luma
|
||||||
|
deblock, called per macroblock-row edge from the slice deblock
|
||||||
|
loop) now dispatches through
|
||||||
|
daedalus_recipe_dispatch_h264_deblock_luma_v instead of
|
||||||
|
ff_h264_v_loop_filter_luma_neon.
|
||||||
|
|
||||||
|
The recipe layer picks the substrate; for cycle 8 the daedalus
|
||||||
|
docstring marks the kernel "CPU primary; QPU opportunistic", but
|
||||||
|
the libavcodec.so context here is built with
|
||||||
|
daedalus_ctx_create_no_qpu — process-global pthread_once init,
|
||||||
|
shared with cycles 6/7. QPU opportunism stays gated off until a
|
||||||
|
follow-up adds an explicit feature flag (no implicit Vulkan init
|
||||||
|
in arbitrary host processes). In the meantime cycle 8 is a
|
||||||
|
plumbing-only substitution, NEON-to-NEON via the daedalus recipe.
|
||||||
|
|
||||||
|
Intra (bS=4) loop filter — c->v_loop_filter_luma_intra — stays on
|
||||||
|
the in-tree NEON .S code; daedalus's daedalus_h264_deblock_meta
|
||||||
|
only covers the non-intra path per its docstring.
|
||||||
|
|
||||||
|
FFmpeg `int alpha/beta/int8_t tc0[4]` → daedalus_h264_deblock_meta
|
||||||
|
(int32_t alpha/beta + inline int8_t tc0[4]). pix already points
|
||||||
|
to row 0 of the bottom block per FFmpeg's deblock convention,
|
||||||
|
satisfying daedalus's `dst_off >= 4 * dst_stride` constraint.
|
||||||
|
|
||||||
|
Refs reauktion/daedalus-v4l2#11 — substitution arc step 2 cycle 8.
|
||||||
|
---
|
||||||
|
libavcodec/aarch64/h264_idct_daedalus.c | 36 +++++++++++++++++++----
|
||||||
|
libavcodec/aarch64/h264dsp_init_aarch64.c | 4 ++-
|
||||||
|
2 files changed, 33 insertions(+), 7 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/libavcodec/aarch64/h264_idct_daedalus.c b/libavcodec/aarch64/h264_idct_daedalus.c
|
||||||
|
index cbb98af..92365fa 100644
|
||||||
|
--- a/libavcodec/aarch64/h264_idct_daedalus.c
|
||||||
|
+++ b/libavcodec/aarch64/h264_idct_daedalus.c
|
||||||
|
@@ -1,11 +1,14 @@
|
||||||
|
/*
|
||||||
|
- * H.264 4x4 / 8x8 IDCT + add — daedalus-fourier substitution shims.
|
||||||
|
+ * H.264 4x4 / 8x8 IDCT + luma-v deblock — daedalus-fourier substitution shims.
|
||||||
|
*
|
||||||
|
- * Routes H264DSPContext.idct_add → daedalus_recipe_dispatch_h264_idct4
|
||||||
|
- * H264DSPContext.idct8_add → daedalus_recipe_dispatch_h264_idct8
|
||||||
|
- * instead of the in-tree ff_h264_idct{,8}_add_neon assembly. The
|
||||||
|
- * recipe layer picks the substrate (CPU NEON by default for cycles
|
||||||
|
- * 6 + 7; future cycles may dispatch to V3D opportunistically).
|
||||||
|
+ * Routes H264DSPContext.idct_add → daedalus_recipe_dispatch_h264_idct4
|
||||||
|
+ * H264DSPContext.idct8_add → daedalus_recipe_dispatch_h264_idct8
|
||||||
|
+ * H264DSPContext.v_loop_filter_luma → daedalus_recipe_dispatch_h264_deblock_luma_v
|
||||||
|
+ * instead of the in-tree ff_h264_*_neon assembly. The recipe layer
|
||||||
|
+ * picks the substrate (CPU NEON for cycles 6 + 7 by default; cycle 8
|
||||||
|
+ * is CPU primary with QPU opportunistic — the ctx below is no-QPU,
|
||||||
|
+ * so cycle 8 stays on the CPU NEON path until a separate change
|
||||||
|
+ * gates QPU init on a daedalus-fourier feature flag).
|
||||||
|
*
|
||||||
|
* FFmpeg's 4x4 and 8x8 block memory layouts match daedalus's
|
||||||
|
* column-major convention: block[r + N*c] = coefficient at
|
||||||
|
@@ -40,6 +43,8 @@ static void daedalus_ctx_init_once(void)
|
||||||
|
|
||||||
|
void ff_h264_idct_add_daedalus(uint8_t *dst, int16_t *block, int stride);
|
||||||
|
void ff_h264_idct8_add_daedalus(uint8_t *dst, int16_t *block, int stride);
|
||||||
|
+void ff_h264_v_loop_filter_luma_daedalus(uint8_t *pix, ptrdiff_t stride,
|
||||||
|
+ int alpha, int beta, int8_t *tc0);
|
||||||
|
|
||||||
|
void ff_h264_idct_add_daedalus(uint8_t *dst, int16_t *block, int stride)
|
||||||
|
{
|
||||||
|
@@ -60,3 +65,22 @@ void ff_h264_idct8_add_daedalus(uint8_t *dst, int16_t *block, int stride)
|
||||||
|
daedalus_recipe_dispatch_h264_idct8(g_dctx, dst, (size_t)stride,
|
||||||
|
block, 1, &meta);
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+void ff_h264_v_loop_filter_luma_daedalus(uint8_t *pix, ptrdiff_t stride,
|
||||||
|
+ int alpha, int beta, int8_t *tc0)
|
||||||
|
+{
|
||||||
|
+ daedalus_h264_deblock_meta meta = {
|
||||||
|
+ .dst_off = 0,
|
||||||
|
+ .alpha = alpha,
|
||||||
|
+ .beta = beta,
|
||||||
|
+ };
|
||||||
|
+ meta.tc0[0] = tc0[0];
|
||||||
|
+ meta.tc0[1] = tc0[1];
|
||||||
|
+ meta.tc0[2] = tc0[2];
|
||||||
|
+ meta.tc0[3] = tc0[3];
|
||||||
|
+
|
||||||
|
+ pthread_once(&g_dctx_once, daedalus_ctx_init_once);
|
||||||
|
+
|
||||||
|
+ daedalus_recipe_dispatch_h264_deblock_luma_v(g_dctx, pix, (size_t)stride,
|
||||||
|
+ 1, &meta);
|
||||||
|
+}
|
||||||
|
diff --git a/libavcodec/aarch64/h264dsp_init_aarch64.c b/libavcodec/aarch64/h264dsp_init_aarch64.c
|
||||||
|
index 741e551..85ac381 100644
|
||||||
|
--- a/libavcodec/aarch64/h264dsp_init_aarch64.c
|
||||||
|
+++ b/libavcodec/aarch64/h264dsp_init_aarch64.c
|
||||||
|
@@ -27,6 +27,8 @@
|
||||||
|
|
||||||
|
void ff_h264_v_loop_filter_luma_neon(uint8_t *pix, ptrdiff_t stride, int alpha,
|
||||||
|
int beta, int8_t *tc0);
|
||||||
|
+void ff_h264_v_loop_filter_luma_daedalus(uint8_t *pix, ptrdiff_t stride,
|
||||||
|
+ int alpha, int beta, int8_t *tc0);
|
||||||
|
void ff_h264_h_loop_filter_luma_neon(uint8_t *pix, ptrdiff_t stride, int alpha,
|
||||||
|
int beta, int8_t *tc0);
|
||||||
|
void ff_h264_v_loop_filter_luma_intra_neon(uint8_t *pix, ptrdiff_t stride, int alpha,
|
||||||
|
@@ -114,7 +116,7 @@ av_cold void ff_h264dsp_init_aarch64(H264DSPContext *c, const int bit_depth,
|
||||||
|
int cpu_flags = av_get_cpu_flags();
|
||||||
|
|
||||||
|
if (have_neon(cpu_flags) && bit_depth == 8) {
|
||||||
|
- c->v_loop_filter_luma = ff_h264_v_loop_filter_luma_neon;
|
||||||
|
+ c->v_loop_filter_luma = ff_h264_v_loop_filter_luma_daedalus;
|
||||||
|
c->h_loop_filter_luma = ff_h264_h_loop_filter_luma_neon;
|
||||||
|
c->v_loop_filter_luma_intra= ff_h264_v_loop_filter_luma_intra_neon;
|
||||||
|
c->h_loop_filter_luma_intra= ff_h264_h_loop_filter_luma_intra_neon;
|
||||||
|
--
|
||||||
|
2.47.3
|
||||||
|
|
||||||
@@ -0,0 +1,82 @@
|
|||||||
|
From 0d1292ea99bc4e5fa2da438259fa01a2374e3e04 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Markus Fritsche <mfritsche@reauktion.de>
|
||||||
|
Date: Fri, 22 May 2026 14:18:25 +0200
|
||||||
|
Subject: [PATCH] avcodec/h264: restore AV_CODEC_FLAG_LOW_DELAY semantics
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
FFmpeg 8.x dropped the H.264 decoder's low_delay path —
|
||||||
|
AV_CODEC_FLAG_LOW_DELAY no longer prevents
|
||||||
|
h264_select_output_frame from running the display-order DPB
|
||||||
|
output queue. V4L2-stateless-style consumers (daedalus-v4l2
|
||||||
|
daemon, libva-v4l2-request-fourier) that set the flag end up
|
||||||
|
seeing the 2-1-4-3 pair-swap pattern on B-frame streams again.
|
||||||
|
|
||||||
|
Restore the documented semantics:
|
||||||
|
|
||||||
|
- Early-exit at the top of h264_select_output_frame when the
|
||||||
|
flag is set: emit the just-decoded picture immediately as
|
||||||
|
next_output_pic, mirror the corruption / recovery-point
|
||||||
|
tracking the main path performs, and skip the entire
|
||||||
|
delayed_pic[] / POC reorder machinery.
|
||||||
|
|
||||||
|
- Suppress the SPS-driven has_b_frames clobber in
|
||||||
|
h264_field_start when the flag is set, so the per-slice
|
||||||
|
bitstream_restriction_flag re-pickup cannot reintroduce a
|
||||||
|
nonzero reorder buffer mid-stream.
|
||||||
|
|
||||||
|
This is a fork-only change required by the daedalus-v4l2 daemon's
|
||||||
|
one-frame-per-send_packet contract; upstream FFmpeg consumers that
|
||||||
|
expect display-order output remain untouched (flag default = off).
|
||||||
|
|
||||||
|
Refs reauktion/daedalus-v4l2#11 — substitution arc step 2 deblock
|
||||||
|
+ flag-restoration follow-up.
|
||||||
|
---
|
||||||
|
libavcodec/h264_slice.c | 23 +++++++++++++++++++++++
|
||||||
|
1 file changed, 23 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
|
||||||
|
index 97fab70..a7bfbd6 100644
|
||||||
|
--- a/libavcodec/h264_slice.c
|
||||||
|
+++ b/libavcodec/h264_slice.c
|
||||||
|
@@ -1308,6 +1308,28 @@ static int h264_select_output_frame(H264Context *h)
|
||||||
|
cur->mmco_reset = h->mmco_reset;
|
||||||
|
h->mmco_reset = 0;
|
||||||
|
|
||||||
|
+ /* AV_CODEC_FLAG_LOW_DELAY restore (FFmpeg 8.x dropped the H.264
|
||||||
|
+ * decoder's low_delay path). Bypass the display-order DPB
|
||||||
|
+ * output queue: emit the just-decoded picture immediately, in
|
||||||
|
+ * decode order, one per send_packet. V4L2-stateless-style
|
||||||
|
+ * consumers (daedalus-v4l2 daemon, libva-v4l2-request-fourier)
|
||||||
|
+ * do their own POC-based reorder downstream and require this
|
||||||
|
+ * behaviour. */
|
||||||
|
+ if (h->avctx->flags & AV_CODEC_FLAG_LOW_DELAY) {
|
||||||
|
+ h->next_output_pic = cur;
|
||||||
|
+ h->next_outputed_poc = cur->poc;
|
||||||
|
+ h->frame_recovered |= cur->recovered;
|
||||||
|
+ cur->recovered |= h->frame_recovered & FRAME_RECOVERED_SEI;
|
||||||
|
+ if (!cur->recovered) {
|
||||||
|
+ if (!(h->avctx->flags & AV_CODEC_FLAG_OUTPUT_CORRUPT) &&
|
||||||
|
+ !(h->avctx->flags2 & AV_CODEC_FLAG2_SHOW_ALL))
|
||||||
|
+ h->next_output_pic = NULL;
|
||||||
|
+ else
|
||||||
|
+ cur->f->flags |= AV_FRAME_FLAG_CORRUPT;
|
||||||
|
+ }
|
||||||
|
+ return 0;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
if (sps->bitstream_restriction_flag ||
|
||||||
|
h->avctx->strict_std_compliance >= FF_COMPLIANCE_STRICT) {
|
||||||
|
h->avctx->has_b_frames = FFMAX(h->avctx->has_b_frames, sps->num_reorder_frames);
|
||||||
|
@@ -1415,6 +1437,7 @@ static int h264_field_start(H264Context *h, const H264SliceContext *sl,
|
||||||
|
sps = h->ps.sps;
|
||||||
|
|
||||||
|
if (sps->bitstream_restriction_flag &&
|
||||||
|
+ !(h->avctx->flags & AV_CODEC_FLAG_LOW_DELAY) &&
|
||||||
|
h->avctx->has_b_frames < sps->num_reorder_frames) {
|
||||||
|
h->avctx->has_b_frames = sps->num_reorder_frames;
|
||||||
|
}
|
||||||
|
--
|
||||||
|
2.47.3
|
||||||
|
|
||||||
+10
-7
@@ -33,13 +33,13 @@ FFMPEG_VERSION=8.1
|
|||||||
# epoch 2 matches Debian's stock ffmpeg (currently 7:7.1.x in trixie);
|
# epoch 2 matches Debian's stock ffmpeg (currently 7:7.1.x in trixie);
|
||||||
# +rfourier suffix to avoid colliding with upstream/Debian rebuilds.
|
# +rfourier suffix to avoid colliding with upstream/Debian rebuilds.
|
||||||
PKGVER=2:${FFMPEG_VERSION}+rfourier+gb57fbbe
|
PKGVER=2:${FFMPEG_VERSION}+rfourier+gb57fbbe
|
||||||
PKGREL=6 # pkgrel=6 — drop --enable-libxml2 to avoid runner/target libxml2
|
PKGREL=9 # pkgrel=9 — restore AV_CODEC_FLAG_LOW_DELAY semantics in the
|
||||||
# SOVERSION skew (runner has libxml2 ≥ 2.14 = SONAME 16; trixie
|
# H.264 decoder (FFmpeg 8.x dropped them). Fixes the 2-1-4-3
|
||||||
# has 2.12 = SONAME 2; -5 .deb dlopens libavformat → fails on
|
# B-frame pair-swap that re-appeared in Firefox YouTube after
|
||||||
# "libxml2.so.16: cannot open shared object"). Neither the
|
# the SONAME 61→62 jump (PR #75) silently neutered the
|
||||||
# daedalus-v4l2 daemon (direct AVPacket feed) nor mpv-fourier
|
# daemon's ctx->flags |= AV_CODEC_FLAG_LOW_DELAY at
|
||||||
# nor firefox-fourier consumers need FFmpeg's DASH demuxer.
|
# daemon/src/decoder.c:202. Substitution arc unchanged.
|
||||||
# (2026-05-21)
|
# (2026-05-22)
|
||||||
|
|
||||||
# daedalus-fourier pin — first kernel substitution in libavcodec (cycle 6
|
# daedalus-fourier pin — first kernel substitution in libavcodec (cycle 6
|
||||||
# H.264 IDCT 4x4). Same SHA as the daedalus-v4l2 daemon already ships
|
# H.264 IDCT 4x4). Same SHA as the daedalus-v4l2 daemon already ships
|
||||||
@@ -69,6 +69,9 @@ fi
|
|||||||
patch -Np1 -i "$HERE/0001-libudev-bypass-fallback.patch"
|
patch -Np1 -i "$HERE/0001-libudev-bypass-fallback.patch"
|
||||||
patch -Np1 -i "$HERE/0002-nv15-to-p010-unpack.patch"
|
patch -Np1 -i "$HERE/0002-nv15-to-p010-unpack.patch"
|
||||||
patch -Np1 -i "$HERE/0003-h264-idct4-daedalus-fourier.patch"
|
patch -Np1 -i "$HERE/0003-h264-idct4-daedalus-fourier.patch"
|
||||||
|
patch -Np1 -i "$HERE/0004-h264-idct8-daedalus-fourier.patch"
|
||||||
|
patch -Np1 -i "$HERE/0005-h264-deblock-luma-v-daedalus-fourier.patch"
|
||||||
|
patch -Np1 -i "$HERE/0006-h264-restore-low-delay.patch"
|
||||||
|
|
||||||
# --- daedalus-fourier: fetch + build static .a with PIC, install to a
|
# --- daedalus-fourier: fetch + build static .a with PIC, install to a
|
||||||
# per-build prefix; libavcodec.so links it into the shared object so
|
# per-build prefix; libavcodec.so links it into the shared object so
|
||||||
|
|||||||
@@ -1,3 +1,71 @@
|
|||||||
|
ffmpeg-v4l2-request-fourier (2:8.1+rfourier+gb57fbbe-9) bookworm trixie; urgency=medium
|
||||||
|
|
||||||
|
* Add 0006-h264-restore-low-delay.patch — restore the documented
|
||||||
|
AV_CODEC_FLAG_LOW_DELAY semantics in the H.264 decoder. FFmpeg
|
||||||
|
8.x dropped the H.264 low_delay code path entirely; setting the
|
||||||
|
flag at avcodec_open2 no longer prevents the display-order DPB
|
||||||
|
output queue from running. Visible on Firefox YouTube as the
|
||||||
|
2-1-4-3 B-frame pair-swap, re-introduced silently by the
|
||||||
|
SONAME 61→62 jump in daedalus-v4l2 PR #16.
|
||||||
|
* h264_select_output_frame: early-exit when LOW_DELAY is set;
|
||||||
|
emit the just-decoded picture as next_output_pic, mirror the
|
||||||
|
corruption / recovery-point tracking, skip delayed_pic[] and
|
||||||
|
the POC reorder machinery entirely.
|
||||||
|
* h264_field_start: suppress the SPS-driven
|
||||||
|
has_b_frames = sps->num_reorder_frames clobber when LOW_DELAY
|
||||||
|
is set — without this the per-slice bitstream_restriction_flag
|
||||||
|
re-pickup would reintroduce a nonzero reorder buffer mid-
|
||||||
|
stream.
|
||||||
|
* Restores the same one-frame-per-send_packet contract the
|
||||||
|
daedalus-v4l2 daemon's decoder.c already relies on (the flag
|
||||||
|
is set unconditionally for H.264). No daemon side change.
|
||||||
|
* No SONAME change, no Depends change.
|
||||||
|
|
||||||
|
-- Markus Fritsche <mfritsche@reauktion.de> Fri, 22 May 2026 13:30:00 +0000
|
||||||
|
|
||||||
|
ffmpeg-v4l2-request-fourier (2:8.1+rfourier+gb57fbbe-8) bookworm trixie; urgency=medium
|
||||||
|
|
||||||
|
* Add 0005-h264-deblock-luma-v-daedalus-fourier.patch —
|
||||||
|
H264DSPContext.v_loop_filter_luma (non-intra bS<4 vertical luma
|
||||||
|
deblock, called per macroblock-row edge from the slice deblock
|
||||||
|
loop in libavcodec/h264_loopfilter.c) now dispatches through
|
||||||
|
daedalus_recipe_dispatch_h264_deblock_luma_v instead of
|
||||||
|
ff_h264_v_loop_filter_luma_neon. Cycle 8 of the daedalus-v4l2#11
|
||||||
|
step 2 substitution arc.
|
||||||
|
* Cycle 8 is marked "CPU primary; QPU opportunistic" in
|
||||||
|
daedalus-fourier, but the libavcodec.so context here uses
|
||||||
|
daedalus_ctx_create_no_qpu (process-global pthread_once,
|
||||||
|
shared with cycles 6/7). Opportunistic QPU is deferred to a
|
||||||
|
separate change that gates Vulkan init on a feature flag, to
|
||||||
|
avoid implicit Vulkan init in arbitrary host processes. For
|
||||||
|
now cycle 8 is plumbing-only — NEON-by-recipe.
|
||||||
|
* Intra (bS=4) loop filter c->v_loop_filter_luma_intra stays on
|
||||||
|
the in-tree NEON .S code; daedalus's daedalus_h264_deblock_meta
|
||||||
|
only covers the non-intra path per its API docstring.
|
||||||
|
* Bit-exact against ff_h264_v_loop_filter_luma_neon (daedalus-fourier
|
||||||
|
cycle 8 green).
|
||||||
|
* No SONAME change, no Depends change.
|
||||||
|
|
||||||
|
-- Markus Fritsche <mfritsche@reauktion.de> Fri, 22 May 2026 12:30:00 +0000
|
||||||
|
|
||||||
|
ffmpeg-v4l2-request-fourier (2:8.1+rfourier+gb57fbbe-7) bookworm trixie; urgency=medium
|
||||||
|
|
||||||
|
* Add 0004-h264-idct8-daedalus-fourier.patch — H264DSPContext.idct8_add
|
||||||
|
(per-block 8x8 IDCT, called from the High-profile intra-8x8-DCT
|
||||||
|
macroblock path in libavcodec/h264_mb.c) now dispatches through
|
||||||
|
daedalus_recipe_dispatch_h264_idct8 instead of
|
||||||
|
ff_h264_idct8_add_neon. Cycle 7 of the daedalus-v4l2#11 step 2
|
||||||
|
substitution arc — NEON-by-recipe, same pthread_once context the
|
||||||
|
cycle-6 IDCT 4x4 shim already owns.
|
||||||
|
* Bit-exact against ff_h264_idct8_add_neon (daedalus-fourier cycle 7
|
||||||
|
green; FFmpeg 8x8 block storage block[r + 8*c] matches daedalus
|
||||||
|
column-major convention).
|
||||||
|
* Bulk c->idct8_add4 (inter 8x8-DCT macroblocks) stays on the
|
||||||
|
in-tree NEON .S code; batched substitution lands later.
|
||||||
|
* No SONAME change, no Depends change.
|
||||||
|
|
||||||
|
-- Markus Fritsche <mfritsche@reauktion.de> Fri, 22 May 2026 10:30:00 +0000
|
||||||
|
|
||||||
ffmpeg-v4l2-request-fourier (2:8.1+rfourier+gb57fbbe-6) bookworm trixie; urgency=medium
|
ffmpeg-v4l2-request-fourier (2:8.1+rfourier+gb57fbbe-6) bookworm trixie; urgency=medium
|
||||||
|
|
||||||
* Drop --enable-libxml2 + libxml2 Depends — the Gitea
|
* Drop --enable-libxml2 + libxml2 Depends — the Gitea
|
||||||
|
|||||||
Reference in New Issue
Block a user