493c762967
Cycle 7 of the libavcodec.so substitution arc (reauktion/daedalus-v4l2#11 step 2). H264DSPContext.idct8_add — called per 8×8 block from the High-profile intra-8×8-DCT decode path in libavcodec/h264_mb.c — now dispatches through daedalus_recipe_dispatch_h264_idct8 instead of ff_h264_idct8_add_neon. ## What - Add 0004-h264-idct8-daedalus-fourier.patch (in both arch/ and debian/ ffmpeg-v4l2-request-fourier/). Extends libavcodec/aarch64/ h264_idct_daedalus.c (introduced by 0003) with ff_h264_idct8_add_daedalus and a daedalus_recipe_dispatch_h264_idct8 call; patches libavcodec/aarch64/h264dsp_init_aarch64.c to wire c->idct8_add to the new shim. - arch/PKGBUILD + debian/build-deb.sh: append the new patch to the apply list; bump pkgrel/PKGREL to 7. - No new build-deps, no Depends change, no daedalus-fourier rev — the d87239d pin already exposes daedalus_recipe_dispatch_h264_idct8. ## Why The recipe layer picks the substrate; for cycle 7 (H.264 IDCT 8×8) the recipe is CPU NEON, so this is effectively a NEON-to-NEON substitution layered on top of cycle 6. Production validation of cycle 6 on higgs Firefox YouTube: 3040 frames decoded cleanly, avg_decode_us=3388 (no regression vs the pre-substitution ~4 ms baseline). Cycle 7 inherits the same shim's pthread_once context. Bit-exact against ff_h264_idct8_add_neon (daedalus-fourier cycle 7 green; FFmpeg 8×8 block storage block[r + 8*c] matches daedalus column-major convention). ## Scope NOT covered (deferred) - Bulk c->idct8_add4 (inter 8×8-DCT macroblocks) stays on the in-tree NEON .S code; batched substitution with n_blocks>1 lands later alongside the cycle-6 bulk-paths work. - High-bit-depth (10-bit) path untouched. - Cycles 8/9 — separate PRs. ## SONAME Unchanged. libavcodec.so.62 / libavformat.so.62 / libavutil.so.60. ## Refs - reauktion/daedalus-v4l2 issue #11 (substitution arc): reauktion/daedalus-v4l2#11 - marfrit-packages PR #76 (cycle 6 IDCT 4×4) - marfrit-packages PR #78 (libxml2 ABI-skew workaround) - marfrit/daedalus-fourier cycle 7 close (H.264 IDCT 8×8 NEON green)
193 lines
5.6 KiB
Bash
193 lines
5.6 KiB
Bash
# Maintainer: Markus Fritsche <mfritsche@reauktion.de>
|
|
#
|
|
# FFmpeg + V4L2-Request hwaccel (stateless video decode on Rockchip,
|
|
# Allwinner, etc) for the Fourier umbrella. Tracks Kwiboo's long-running
|
|
# rebase of Jernej Škrabec's v4l2-request patchset onto ffmpeg release
|
|
# tags. Pins the branch tip to a known commit for reproducible CI builds;
|
|
# bump _commit when upstream picks up a fix we want.
|
|
#
|
|
# Why this fork instead of AUR ffmpeg-v4l2-request-git:
|
|
# - AUR is pinned to 6.1.1 with epoch=2, which is OLDER than Arch's
|
|
# stock 2:8.1-3 → installing it downgrades system ffmpeg.
|
|
# - AUR pulls X11/AMF/CUDA/FireWire/AviSynth/OpenMPT/Bluray — irrelevant
|
|
# for a Wayland + ARM + video-decode fleet.
|
|
# - AUR uses #branch=..., no commit pin. CI artifacts are non-reproducible.
|
|
#
|
|
# Encoders (libx264/libx265/libvpx/libdav1d) kept per Fourier fleet policy.
|
|
# X11, AMF, CUDA, FireWire, AviSynth, OpenMPT, Bluray, OpenMAX, JPEG-XL,
|
|
# Theora, XVid, rsvg, soxr, ssh, vidstab, modplug, SDL2, Vulkan, JACK, GSM,
|
|
# Speex dropped — not needed on the Fourier fleet. (No SDL2 means no
|
|
# `ffplay` binary; mpv covers interactive playback.)
|
|
|
|
pkgname=ffmpeg-v4l2-request-fourier
|
|
_srcname=FFmpeg
|
|
_version='8.1'
|
|
_commit='b57fbbe50c9b2656fad86a1a7eeabfd2b2a50935' # v4l2-request-n8.1 tip 2026-04-24
|
|
pkgver=8.1.r123329.b57fbbe
|
|
pkgrel=7 # pkgrel=7 — H.264 IDCT 8x8 daedalus-fourier substitution (cycle 7, 2026-05-22)
|
|
epoch=2
|
|
|
|
# daedalus-fourier pin — first kernel substitution in libavcodec
|
|
# (cycle 6 H.264 IDCT 4x4). Same SHA as the daedalus-v4l2 daemon's
|
|
# inline build; lockstep with that until the public API rolls.
|
|
_daedalus_fourier_commit='d87239d8172307d9a1b93c95cbed116d175b85cc'
|
|
pkgdesc='FFmpeg with V4L2 Request API hwaccel (Rockchip / Allwinner stateless decode)'
|
|
arch=('aarch64')
|
|
url='https://github.com/Kwiboo/FFmpeg'
|
|
license=('GPL-3.0-or-later')
|
|
depends=(
|
|
alsa-lib
|
|
bzip2
|
|
fontconfig
|
|
vulkan-icd-loader
|
|
fribidi
|
|
gmp
|
|
gnutls
|
|
lame
|
|
libass.so
|
|
libdav1d.so
|
|
libdrm
|
|
libfreetype.so
|
|
libgl
|
|
libpulse
|
|
libva.so
|
|
libva-drm.so
|
|
libvorbis.so
|
|
libvorbisenc.so
|
|
libvpx.so
|
|
libwebp
|
|
libx264.so
|
|
libx265.so
|
|
libxml2
|
|
opus
|
|
v4l-utils
|
|
xz
|
|
zlib
|
|
)
|
|
makedepends=(
|
|
cmake
|
|
git
|
|
linux-api-headers
|
|
mesa
|
|
nasm
|
|
ninja
|
|
vulkan-headers
|
|
)
|
|
provides=(
|
|
libavcodec.so
|
|
libavdevice.so
|
|
libavfilter.so
|
|
libavformat.so
|
|
libavutil.so
|
|
libpostproc.so
|
|
libswresample.so
|
|
libswscale.so
|
|
ffmpeg
|
|
)
|
|
conflicts=(ffmpeg)
|
|
replaces=(ffmpeg ffmpeg-v4l2-request-git)
|
|
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"
|
|
'0001-libudev-bypass-fallback.patch'
|
|
'0002-nv15-to-p010-unpack.patch'
|
|
'0003-h264-idct4-daedalus-fourier.patch'
|
|
'0004-h264-idct8-daedalus-fourier.patch')
|
|
sha256sums=('SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP')
|
|
|
|
pkgver() {
|
|
cd "${_srcname}"
|
|
printf '%s.r%s.%s' "${_version}" \
|
|
"$(git rev-list --count HEAD)" \
|
|
"$(git rev-parse --short=7 HEAD)"
|
|
}
|
|
|
|
prepare() {
|
|
cd "${_srcname}"
|
|
patch -Np1 -i "${srcdir}/0001-libudev-bypass-fallback.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}/0004-h264-idct8-daedalus-fourier.patch"
|
|
}
|
|
|
|
build() {
|
|
# --- daedalus-fourier: build static .a with PIC, install to a
|
|
# per-build prefix; libavcodec.so links it into the shared object so
|
|
# H264DSPContext.idct_add (and follow-up kernels) dispatch through
|
|
# the daedalus recipe layer instead of the in-tree NEON .S code. ---
|
|
local _fourier_prefix="${srcdir}/fourier-prefix"
|
|
mkdir -p "${_fourier_prefix}"
|
|
pushd "${srcdir}"/daedalus-fourier >/dev/null
|
|
cmake -B build -G Ninja \
|
|
-DCMAKE_BUILD_TYPE=Release \
|
|
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
|
|
-DCMAKE_INSTALL_PREFIX="${_fourier_prefix}"
|
|
cmake --build build --target daedalus_core
|
|
cmake --install build
|
|
popd >/dev/null
|
|
|
|
cd "${_srcname}"
|
|
|
|
# FFmpeg's configure resolves the compiler via `which` and bakes the
|
|
# absolute path into generated makefiles, bypassing the makepkg
|
|
# /usr/lib/distcc/bin shim. Pass it explicitly so `BUILDENV=(distcc ...)`
|
|
# actually distributes; otherwise everything compiles locally.
|
|
local _ffmpeg_cc=gcc _ffmpeg_cxx=g++
|
|
if [[ ":$PATH:" == *":/usr/lib/distcc/bin:"* ]]; then
|
|
_ffmpeg_cc='distcc gcc'
|
|
_ffmpeg_cxx='distcc g++'
|
|
fi
|
|
|
|
./configure \
|
|
--prefix=/usr \
|
|
--cc="${_ffmpeg_cc}" \
|
|
--cxx="${_ffmpeg_cxx}" \
|
|
--disable-debug \
|
|
--disable-static \
|
|
--disable-doc \
|
|
--disable-stripping \
|
|
--enable-shared \
|
|
--enable-gpl \
|
|
--enable-version3 \
|
|
--enable-pic \
|
|
--enable-neon \
|
|
--arch=aarch64 \
|
|
\
|
|
--enable-libdrm \
|
|
--enable-libv4l2 \
|
|
--enable-libudev \
|
|
--enable-v4l2-request \
|
|
--enable-v4l2_m2m \
|
|
--enable-vaapi \
|
|
--enable-opengl \
|
|
\
|
|
--enable-gnutls \
|
|
--enable-fontconfig \
|
|
--enable-libass \
|
|
--enable-libfreetype \
|
|
--enable-libfribidi \
|
|
--enable-libxml2 \
|
|
--enable-libpulse \
|
|
--enable-libdav1d \
|
|
--enable-libopus \
|
|
--enable-libvorbis \
|
|
--enable-libmp3lame \
|
|
--enable-libvpx \
|
|
--enable-libx264 \
|
|
--enable-libx265 \
|
|
--enable-libwebp \
|
|
\
|
|
--extra-cflags="-I${_fourier_prefix}/include" \
|
|
--extra-ldflags="-L${_fourier_prefix}/lib" \
|
|
--extra-libs="-ldaedalus_core -lvulkan -lpthread" \
|
|
--host-cflags='-fPIC'
|
|
|
|
make
|
|
make tools/qt-faststart
|
|
}
|
|
|
|
package() {
|
|
cd "${_srcname}"
|
|
make DESTDIR="${pkgdir}" install
|
|
install -Dm755 tools/qt-faststart "${pkgdir}/usr/bin/qt-faststart"
|
|
}
|