Commit Graph

1 Commits

Author SHA1 Message Date
claude-noether 898544a29c iter3 Phase 2: situation analysis — VP8 backend gaps + contract surface
Source-read of every file the iter3 patch series will touch, plus the
kernel UAPI + VAAPI + downstream FFmpeg + kernel hantro reference
sources. Conducted on noether against fork tip 8d71e20 (iter2 Phase 6
commit B); fresnel.vpn was unreachable so Phase 3 baseline empirical
capture defers until laptop reachable.

Bug enumeration (10 sites the patch series must touch):

  B1  config.c::RequestQueryConfigProfiles    enumeration block missing
  B2  config.c::RequestCreateConfig           VP8 case label missing
  B3  config.c::RequestQueryConfigEntrypoints VP8 case missing
  B4  src/vp8.c                               new file ~160-220 LOC
  B5  src/vp8.h                               new file ~35-45 LOC
  B6  picture.c::codec_set_controls           VP8 dispatch missing
  B7  picture.c::codec_store_buffer           4 buffer-type cases +
                                              VAProbabilityDataBufferType
                                              outer case missing
  B8  picture.c::RequestBeginPicture          per-frame reset additions
  B9  surface.h::object_surface::params union vp8 member missing
  B10 meson.build                             vp8.c/vp8.h not in lists

Non-bugs (intentionally untouched):
  - context.c (no DECODE_MODE/START_CODE menus for VP8)
  - video.c (CAPTURE-side format list; VP8 is OUTPUT-side)
  - v4l2.c (fourcc-agnostic helpers)
  - buffer.c (buffer registry is type-agnostic)
  - include/hevc-ctrls.h (already includes <linux/v4l2-controls.h>
    which holds V4L2_CID_STATELESS_VP8_FRAME)

Contract surface cited verbatim:
  - V4L2_CID_STATELESS_VP8_FRAME = V4L2_CID_CODEC_STATELESS_BASE+200
    = 0x00a409c8 (matches Phase 0 V4L2 inventory)
  - struct v4l2_ctrl_vp8_frame at <linux/v4l2-controls.h>:1929-1958
    + 5 sub-structs (segment, lf, quant, entropy, coder_state) at
    1785-1888
  - VAAPI VAPictureParameterBufferVP8 + VASliceParameterBufferVP8 +
    VAProbabilityDataBufferVP8 + VAIQMatrixBufferVP8 at
    references/libva/va/va_dec_vp8.h
  - FFmpeg v4l2_request_vp8.c reference: single batched S_EXT_CTRLS
    at end_frame, count=1, no init-time menus
  - Kernel hantro_vp8.c::hantro_vp8_prob_update reads 9 fields from
    hdr (skip/intra/last/gf probs, segment_probs, entropy.{y,uv,mv,
    coeff}_probs)

VAAPI → V4L2 mapping table: 30 fields enumerated. Open questions for
Phase 3 baseline (6 items: first_part_header_bits derivation, num_
dct_parts off-by-one, DPB timestamp 0-sentinel handling, show_frame
default, lf.flags FILTER_TYPE_SIMPLE bit, first-frame DPB sentinel).

Patch-shape prediction: ~260-340 LOC across 6 modified + 2 new
files. Medium-sized iter — between iter1's 120 LOC (3 modified +
1 deleted) and iter2's 470 LOC (5 modified). The new file dominates.

Phase 3 baseline targets queued: cross-validator strace verbatim
S_EXT_CTRLS payload capture, VAAPI consumer trace, mpv-SW reference
JPEG capture for criterion 4 byte-compare anchor.

Phase 4 plan structure anticipated: 10-clause template per iter2.

Refs:
  phase0_findings_iter3.md (Phase 1 lock)
  phase8_iteration2_close.md (predecessor close)
  src/mpeg2.c (iter1 single-codec template; iter3 will mirror shape)
  src/h265.c (iter2 dispatcher pattern; iter3 takes structure cues)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-08 17:27:06 +00:00