Repository navigation
A10: the H.264 and HEVC encoder - #94
Merged
Merged
Conversation
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>
This was referenced Dec 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
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 toFirmware/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:ave2-firmware-from-kernelcache@1.apple/ave-t8010.bin.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.
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