Skip to content

A10: the H.264 and HEVC encoder - #94

Merged
henrikklee merged 5 commits into
OrchardLinux:mainfrom
paulscalise1:a10-encoder
Dec 2, 2026
Merged

henrikklee merged 5 commits into
OrchardLinux:mainfrom
paulscalise1:a10-encoder

Conversation

@paulscalise1

@paulscalise1 paulscalise1 commented Dec 2, 2026 •

Copy link
Copy Markdown

Summary

The A10's hardware H.264 and HEVC encoder (AVE2), as a V4L2 stateful encoder. It builds on the JPEG codec (#93), which is merged now. The JPEG commits are already on main, so merging this adds only the 4 encoder commits.

What changes

  • dt-bindings and media: apple: Add the A10 video encoder. The encoder core is driven by Apple's firmware on a 32-bit ARM CPU of the block's own. The driver loads the firmware at the start of a DMA window behind the block's DART, boots the CPU and talks to the firmware through a mailbox and shared memory.
    • NV12 or P010 in, H.264 (up to High) or HEVC (Main, Main 10) out.
    • B pictures, several slices per picture, adaptive quantisation, bitrate and QP controls.
    • Several streams at once.
  • arm64: dts: apple: t8010: Add the video encoder: the encoder, its DART and its five power states, for every A10 board.
  • defconfig: the driver as a module.

The driver logs one line at probe. The firmware's asserts and errors go to the kernel log as warnings, and the rest of its log is for debugging.

Firmware

The driver speaks the encoder firmware of iOS 14, the A10's image in the AppleAVE2 kext (AVE2-rhea-release-1c397f7c). iOS 15 moved the firmware to Firmware/ave/ in the restore image, and its build (AppleAVE2FW-5060.4.0) has other command structures: it boots, then stops at the first command with this driver. So the recipe takes the firmware from the iPhone 7's iOS 14.5 kernelcache, as the iPhone 7's GPU firmware already comes from an iPad's restore image:

Testing

iPhone 7 (D10) booted from RAM, this branch on main at 9eebaa9, with the firmware layer from the recipe in OrchardLinux/orchard#447 (no files of my own). ffmpeg decoded every stream, all frames in order.

Encode (30 frames unless noted) Frames per second ffmpeg, Y
640x480 H.264 / HEVC 678 / 754 55 dB
1920x1080 H.264 / HEVC 191 / 164 47 dB
3840x2160 H.264 / HEVC, 8 frames 50 / 42 42 dB
1080p H.264 High, 2 B pictures 182 46.8 dB, IBBP
1080p HEVC, 2 B pictures 161 46.8 dB, IBBP
1080p HEVC Main 10 from P010, 10 frames 156 47.3 dB
two 1080p streams at once, H.264 and HEVC 85 and 83 47 dB

Other devices

The iPads 6 and 7 have the same SoC and get the same node and firmware, which nobody has tested there yet.

🤖 Generated with Claude Code

The A10's H.264 and HEVC encoder, whose firmware runs on an ARM CPU of
the block's own behind a DART.

Assisted-by: LLM
Signed-off-by: Paul Scalise <paulscalise1@users.noreply.github.com>
The A10's video encoder (AVE2) is an encoder core driven by Apple's
firmware on a 32-bit ARM CPU of its own. The driver loads the firmware
at the start of a DMA window behind the block's DART, boots the CPU,
talks to the firmware through a mailbox and the shared memory after the
image, and exposes a V4L2 stateful encoder: NV12 or P010 pictures in,
H.264 or HEVC (Main, Main 10) out, with B pictures, several slices per
picture, adaptive quantisation and several streams at once.

The firmware is the A10's image in iOS 14's AppleAVE2
(AVE2-rhea-release-1c397f7c). iOS 15 ships a later build
(AppleAVE2FW-5060.4.0) whose command structures differ, so it stops at
the first command with this driver.

The encoder's speed follows the fabric's performance level, which
apple-pmgr-misc keeps fast while the system runs, so the driver needs no
vote of its own.

Tested on an iPhone 7 (D10) booted from RAM with that firmware. 1920x1080
encodes at 191 frames per second to H.264 and 164 to HEVC, 3840x2160 at
50 and 42, and two 1080p streams at once at 85 and 83. B pictures in
both codecs and Main 10 from P010 work too. ffmpeg decodes every stream
in order, 1080p frames within 47 dB (Y) of their source.

Assisted-by: LLM
Signed-off-by: Paul Scalise <paulscalise1@users.noreply.github.com>
The encoder, its DART and its five power states.

Assisted-by: LLM
Signed-off-by: Paul Scalise <paulscalise1@users.noreply.github.com>
CONFIG_VIDEO_APPLE_AVE=m for the A10's H.264 and HEVC encoder.

Assisted-by: LLM
Signed-off-by: Paul Scalise <paulscalise1@users.noreply.github.com>
@henrikklee
henrikklee merged commit dd1f132 into OrchardLinux:main Dec 2, 2026
4 checks passed
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.

2 participants