Skip to content

media: apple: prores: per-profile rate control - #840

Merged
RyanTheTide merged 1 commit into
aurora-wipfrom
prores/rate-control
Nov 2, 2026
Merged

RyanTheTide merged 1 commit into
aurora-wipfrom
prores/rate-control

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

ProRes per-profile rate control (Neo)

Every profile used one rate-control setting, so the engine drove them all to the same frame size (about 125 KB at 1080p). This gives each profile its own starting quantiser and byte budget as macOS does: the 422 HQ budget for the picture size, scaled by profile (Proxy 13/63, LT 13/28, 422 2/3, HQ 1, 4444 3/2, 4444 XQ 9/4), with a target of 8/9 and a maximum of 9/8 of the target, given to the engine as Q3 bytes per macroblock after the header and slice table. At 1080p30 the targets are 45, 102, 147, 220, 330 and 495 Mbit/s, Apple's published rates. KUnit checks the budgets and both descriptor words for 1080p and 2160p in every profile.

Tested on the Neo, same input on both OSes (FFmpeg testsrc2, 8 frames cycled)

Linux: 7.3.0-aurora-fleet14k-codec3, boot 9633c867. macOS 26.6.2, VideoToolbox hardware encoder, same boot session.

1080p bytes/frame Linux bytes/frame macOS PSNR (Y, Linux) fps Linux fps macOS
422 Proxy 98,727 98,734 39.7 dB 1242 850
422 LT 223,623 223,630 60.9 dB 1225 851
422 286,316 286,324 66.5 dB 1074 843
422 HQ 386,072 386,080 75.3 dB 1031 855
4444 589,767 589,774 75.3 dB 679 758
4444 XQ 613,266 613,274 87.6 dB 679 759

Frame sizes match macOS to within its 7 to 8 bytes of trailing padding, in all six profiles and at 2160p too (for example 4K HQ 1,310,095 vs 1,310,100).

At 2160p Linux runs at about 60% of macOS (422: 260-267 vs 420-425 fps; 4444: 170-173 vs 282 fps). macOS raises the ProRes SoC performance vote (PRORES-SOC-VMAX) while encoding; that vote is a separate follow-up, like the AVE performance request.

Same boot: v4l2-compliance 48/48, no DART faults, H.264 163.9 fps / HEVC 155.1 fps (no regression), KUnit 9/9, W=1 clean.

🤖 Generated with Claude Code

Every profile used one rate-control setting, so the engine drove all of
them to the same frame size. Give each profile its own starting
quantiser and byte budget, as macOS does: the 422 HQ budget for the
picture size (fixed steps up to 2.36 Mpixel, then half a byte per pixel)
scaled by the profile (Proxy 13/63, LT 13/28, 422 2/3, 4444 3/2, 4444 XQ
9/4), with a target of eight ninths and a maximum of nine eighths of the
target. The engine takes both as bytes per macroblock after the frame
and slice headers, in the two words the driver had filled with the
picture size in macroblocks.

At 1920x1080 this gives targets of 45, 102, 147, 220, 330 and 495 Mbit/s
at 30 fps, Apple's published ProRes data rates. KUnit checks the budgets
and descriptor words for 1080p and 2160p in every profile.

Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@RyanTheTide
RyanTheTide merged commit 7708185 into aurora-wip Nov 2, 2026
@RyanTheTide
RyanTheTide deleted the prores/rate-control branch November 2, 2026 05:13
notmysegv pushed a commit to notmysegv/linux that referenced this pull request Nov 4, 2026
…tion/aurora

Bring integration/aurora up to aurora-wip e1524e6, the source of
7.3.0-aurora-fleet14l, promoted on all four machines on 2026-11-02.
The range also covers the fleet14i, fleet14j and fleet14k sources
(a8fa302, d67eece, ce900d1). It adds aurora-silicon#822, aurora-silicon#823, aurora-silicon#824, aurora-silicon#827,
aurora-silicon#829, aurora-silicon#834, aurora-silicon#835, aurora-silicon#836, aurora-silicon#838, aurora-silicon#840 and aurora-silicon#839. No conflicts.

Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
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