Repository navigation
media: apple: ave: speed over quality for HEVC Main 10 too - #1239
Merged
Merged
Conversation
The speed-over-quality control was limited to 8-bit HEVC because Main 10 had not been measured. Main 10 behaves like Main: the same Start word (3 -> 5) makes it 1.6-1.8 times faster, its pictures stay intact, and the bit-rate cost is lower than for 8-bit (+7.2% BD-rate PSNR-Y against +12.4%). Apply the control to Main 10 as well. It still applies only to HEVC above 1280x720. With the control off, every command is byte-identical to before. Signed-off-by: Ryan Murray <[email protected]> Assisted-by: LLM
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.
Follow-up to #1228. The speed-over-quality control (
Prioritize Speed Over Quality) now covers HEVC Main 10 as well as Main. Main 10 had been left out only because it had not been measured. The control stays off by default, and with it off every command is byte-identical to before.Main 10 responds to the same Start word (3 to 5) as Main. It encodes 1.6-1.8 times faster, its pictures stay intact (PSNR follows the normal curve), and the bit-rate cost is lower than for 8-bit: +7.2% BD-rate against +12.4%.
Method
Same bench and procedure as #1228: 16 OUTPUT buffers (8 for 4K P010, which is all the encoder's DMA window holds at that size), VBR 4 Mb/s, GOP 30, 3 runs per row. Each variant gets a fresh boot, because the AVE firmware cannot be reloaded within one. Test = this driver as a module, swapped in right after boot. Stock = the fleet kernel's own module after a reboot to the default. For quality, the 150-frame mandel input was converted to P010 (ffmpeg,
p010le) and coded at 1/2/4/8 Mb/s. PSNR-Y is computed at 10 bits against that P010 source after a software decode, and BD-rate uses a piecewise-cubic fit on log-rate. The same script gives +12.42% on #1228's 8-bit rows, matching that PR's number.Results (fps, 3 runs)
The first run of each stock boot was slower on rows the driver does not touch (Main 10 at 161.3 vs 168.0 later, Main at 161.2). That is warm-up after boot, not this change.
Main 10 quality (Neo, mandel P010):
BD-rate, speed against quality: +7.2%.
macOS 10-bit speed-mode numbers: not measured. No macOS boot of the J616s was free tonight. On macOS the speed property is per codec (HEVC), not per bit depth.
Quality mode unchanged
Bitstreams from this PR with the control off are bit-identical to the stock module's. On the Neo that is 7/7 files: Main 10 at 1/2/4/8 Mb/s, Main at 1/4 Mb/s and H.264 at 4 Mb/s. On the J616s it is also 7/7. Speed-mode Main 10 bitstreams are bit-identical between the J616s and the Neo, so the BD-rate above holds for both Macs. Host tests
--compare-baselineagainstintegration/aurora: 288 sessions / 1440 commands byte-identical.Checks
v4l2-compliance48/48. 0 DART faults, 0 AVC denials and 0 AVE errors in every boot. SELinux enforcing.apple-ave-abi10/10.ave_9003_speednow also covers Main 10: speed mode changes only Start+0x320(3 to 5) and no Process word, with and without B-frames.checkpatch.pl --strictclean. W=1 module build clean.Note on constant-quality HEVC (from #1228)
macOS 27.0's HEVC CQ output sets
weighted_pred_flagandlists_modification_present_flagin the PPS. In all 145 P slices, though, it signals no weights and no list modification, so those flags change nothing. The remaining +0.7% BD-rate gap is down to encoder decisions in macOS 27's newer firmware. It is being followed up separately; nothing in this PR touches CQ.🤖 Generated with Claude Code