Repository navigation
perf(rendering): AVX2 software RGBA→NV12 - #3287
Merged
richiemcilroy merged 6 commits intoOct 26, 2026
Merged
richiemcilroy merged 6 commits into
richiemcilroy merged 6 commits into
Conversation
Contributor
|
@kyzer1023 is attempting to deploy a commit to the Cap Software Inc Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
Author
|
@greptileai review |
2 of 3 tasks
Member
|
Thanks @kyzer1023! Before we can merge, this needs a 5/5 from Greptile on its latest commit and green CI. It's at 4/5, and there are three things to sort out:
Once it's rebased and green, request a re-review. |
Export's software BT.709 conversion now uses an AVX2 kernel that matches the scalar 2x2 average, with a scalar tail for width % 8 and odd rows.
cursor
Bot
force-pushed
the
kyzer/perf-rendering-avx2-rgba-nv12-9048
branch
from
October 25, 2026 23:10
ef04413 to
f939e0b
Compare
The helper is only called from the AVX2 dispatch, so aarch64 clippy with -D warnings reported it as dead code.
cursor
Bot
force-pushed
the
kyzer/perf-rendering-avx2-rgba-nv12-9048
branch
from
October 25, 2026 23:10
f939e0b to
af48fba
Compare
Contributor
Author
|
@greptileai review |
2 of 3 tasks
Contributor
Author
|
@richiemcilroy Ready for another look: rebased onto main after #3281, |
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.
What
Add an AVX2 path for software RGBA→NV12 in
crates/rendering(cpu_yuv/ProjectRenderer::convert_rgba_to_nv12). Dispatches when AVX2 is present and stride/length checks pass. 8-pixel vector kernel;width % 8and leftover odd row stay scalar. Chroma still averages each complete 2×2 with(sum + 2) / 4before the matrix (BT.709). Single-threaded (no rayon on this path).Why
Export / software-adapter encode converts RGBA→NV12 on CPU. Inverse of #3281 (YUV→RGBA). Exact match vs existing scalar (max abs diff 0).
Measurement
Hardware: Intel Xeon family 6 model 207 (KVM, 4 vCPU), AVX2, rustc 1.88.0. Release profile (
opt-level=s,codegen-units=1,lto=thin), generic x86-64 (no-C target-cpu=native). Warmup 8, samples 31, median. Stride = renderer 256-byte row padding.Max abs diff vs scalar: 0 (incl. odd widths / padded strides).
Test plan
cargo test -p cap-rendering --lib cpu_yuv::(21 passed)No overlap with #3281 (YUV→RGBA), #3227 (YUV plane pack), or Windows MF encode PRs.


Confidence Score: 5/5
The PR appears safe to merge, with the previous build issue fixed and no new actionable findings.Summary
Adds an AVX2 path for software RGBA→NV12 conversion and moves the renderer’s scalar conversion into
cpu_yuv.Reviews (2) · Last reviewed commit: "fix(rendering): gate RGBA to NV12 bounds..." · Reviewed by Greptile