Cycle 9 closed: H.264 luma qpel mc20 = 131 Mblock/s NEON, CPU-only

Last unmeasured H.264 kernel. mc20 picked as representative
(horizontal half-pel, 6-tap filter; canonical for the H.264 luma
qpel family). M1 PASS 10000/10000 first try, M3 = 131.477
Mblock/s on a single core (7.6 ns/block), 135x the 1080p30 floor.

Per the cycles 6+7 lightweight-kernel rationale, Phase 4 deferred:
QPU dispatch floor (~250 ns/block) is 33x above the NEON per-block
cost; R9 ≈ 0.03 deep RED. No realistic QPU offload value.

Generalization: all H.264 luma MC variants (mc02, mc11, mc22,
etc.) will share this verdict. No need to measure each variant
individually.

H.264 NEON is dramatically faster than VP9 NEON across the board:
- IDCT 4x4: 175 vs N/A    (no VP9 analog)
- IDCT 8x8: 151 vs 8.2 Mblock/s (18x faster)
- MC 6/8-tap: 131 vs 7.0   (19x faster)
- Deblock: 92 vs 48 Medge/s (2x faster)

H.264 deployment recipe: all CPU NEON except deblock (opportunistic
QPU). On a Pi 5 running H.264-only, the QPU is mostly idle.

Cycles 1-9 complete. Public API exposes all 9.
Next: daedalus-v4l2 sibling repo per locked Phase 8 architecture
(B + γ + sibling), then README polish.

- external/ffmpeg-snapshot/libavcodec/aarch64/h264qpel_neon.S
  vendored (1467 lines, all qpel variants)
- tests/h264_qpel8_mc20_ref.c: 40-line C ref (clip255 of
  6-tap convolution)
- tests/bench_neon_h264qpel_mc20.c: M1 + M3 bench
- docs/k9_h264qpel_mc20.md: cycle 9 closure with comparison
  matrix

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-18 14:53:21 +00:00
parent 0a99b16489
commit 5c8b09349c
6 changed files with 1836 additions and 0 deletions
+16
View File
@@ -128,6 +128,14 @@ set_source_files_properties(${FFASM_H264DSP_SOURCES} PROPERTIES
COMPILE_OPTIONS "${FFASM_FLAGS}"
LANGUAGE ASM)
# Cycle 9 — H.264 luma qpel MC NEON.
set(FFASM_H264QPEL_SOURCES
${FFSNAP}/libavcodec/aarch64/h264qpel_neon.S
)
set_source_files_properties(${FFASM_H264QPEL_SOURCES} PROPERTIES
COMPILE_OPTIONS "${FFASM_FLAGS}"
LANGUAGE ASM)
add_executable(bench_neon_h264deblock
tests/bench_neon_h264deblock.c
tests/h264_deblock_ref.c
@@ -135,6 +143,14 @@ add_executable(bench_neon_h264deblock
)
target_compile_options(bench_neon_h264deblock PRIVATE -O3 -march=armv8-a+simd)
# Cycle 9 — H.264 luma qpel mc20 NEON M3 baseline.
add_executable(bench_neon_h264qpel_mc20
tests/bench_neon_h264qpel_mc20.c
tests/h264_qpel8_mc20_ref.c
${FFASM_H264QPEL_SOURCES}
)
target_compile_options(bench_neon_h264qpel_mc20 PRIVATE -O3 -march=armv8-a+simd)
add_executable(bench_neon_idct
tests/bench_neon_idct.c
tests/vp9_idct8_ref.c