Skip to content

media: apple: ave: encode 6070 H.264 with B pictures - #1484

Merged
RyanTheTide merged 1 commit into
integration/aurorafrom
ave-m1m2/6070-bframes-hevc
Nov 10, 2026
Merged

RyanTheTide merged 1 commit into
integration/aurorafrom
ave-m1m2/6070-bframes-hevc

Conversation

@RyanTheTide

Copy link
Copy Markdown
Contributor

Encode H.264 Main and High with B pictures on the 6070 firmware (M1 Pro, M2), on top of #1387 and #1440.

  • Pictures are planned from display order (IDR, one B between two P, an unpaired last picture closed as P); each Process gets its picture type, the H.264 slice-header fields of the retained slice object and the current / list 0 / list 1 reconstruction, colocated and low-resolution surfaces.
  • Start for reordered sessions: both motion-estimation units, two references, VUI bitstream restriction (one reordered picture, two buffered).
  • Compressed reconstruction layout for 8 and 10 bit; HEVC Start / RPS / slice fields and transcoder surfaces are added, but HEVC stays refused on the 6070 (its stream is not decodable yet).
  • Firmware fields are named, commented offsets; values follow the H.264/H.265 syntax they carry.
  • B pictures follow the existing V4L2_CID_MPEG_VIDEO_B_FRAMES control (0 or 3, default 3) for Main/High; Baseline stays IPPP.

Tests

  • KUnit apple-ave-*: 30/30. checkpatch --strict: clean.
  • M1 Pro (fleet55, gst v4l2h264enc, constant QP, 300 frames 1080p / 120 frames 4K):
stream frames slice types Y PSNR size fps
Baseline IPPP 1080p 300/300 I P P P 38.19 dB 24.1 MB 60-67
Main I P B 1080p 300/300 I P B P B 38.19 dB 19.1 MB 64.9
High I P B 1080p 300/300 I P B P B 38.21 dB 19.2 MB 65.1
High I P B 4K 120/120 I P B P B 38.35 dB 29.0 MB 17.0
  • M2 (fleet55): same streams, 300/300 and 120/120, Main/High B 1080p 152 fps, High B 4K 39.5 fps, Y 38.19 / 38.21 / 38.35 dB.
  • All streams decode without errors (ffmpeg, two builds); no DART/SMMU faults, no AVC denials.

🤖 Generated with Claude Code

The 6070 path only built low-delay H.264: every Process carried the
first picture's slice object and a fixed picture type, so a session
with B pictures hung on its third picture.

Plan each picture from its display order (IDR, then one B between two
P pictures, an unpaired last picture closed as P) and build what
depends on it: the picture type, the H.264 slice-header fields of the
retained slice object (nal_ref_idc, NAL and slice type, frame_num, IDR
id, POC lsb, active reference counts, slice QP delta) and the current,
list 0 (one or two) and list 1 reconstruction, colocated and
low-resolution surfaces. Start for a reordered session uses both motion
estimation units, two references and the VUI bitstream restriction
(one reordered picture, two buffered).

Lay out the compressed reconstruction for 8- and 10-bit depths and add
the HEVC Start, RPS and slice fields and the HEVC transcoder surfaces;
HEVC stays refused on the 6070 until its stream is qualified.

Every firmware field is a named, commented offset; the values come from
the H.264/H.265 syntax they carry.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant