Repository navigation
Conversation
Blur-off full-size YUYV422 camera preview converts to tight BGRA with an integer BT.601 kernel (AVX2 when the CPU has it, scalar otherwise) and reverses a mirrored preview in the same store. Blur still downscales through swscale. Bench on a 4-vCPU Intel Xeon (family 6 model 207), rustc 1.88.0, bench profile opt-level=s, codegen-units=1, thin LTO, target-cpu=x86-64. Warmup 8, 31 samples, median at sorted index 15. Each path timed alone. 1280x720: fresh swscale+copy_rows 3777.8 µs, reused-frame 1623.4 µs, AVX2 337.2 µs 1920x1080: fresh 8682.5 µs, reused-frame 3713.9 µs, AVX2 832.7 µs Mirrored AVX2 is 357.2 µs and 1021.9 µs. Max abs channel delta versus bilinear swscale is 3. The kernel matches the integer reference on every YUV triple.
Contributor
Author
|
@greptileai review |
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. |
Write scalar and AVX2 tail pixels through raw pointers into spare capacity, then set_len once every byte is initialized. Forming `&mut [u8]` over that spare capacity was undefined behavior. Expect the bench conversion before black_box so a None result fails the benchmark instead of tripping unused_must_use.
Use is_multiple_of and div_ceil in the thumbnail tests so clippy -D warnings is clean for cap-gpui-kernels, including benches.
Contributor
Author
|
@greptileai review |
Retrigger CI after unrelated Windows export and Hyprland image flakes.
Contributor
Author
|
@greptileai review |
Contributor
Author
|
@greptileai review |
Contributor
Author
|
@greptileai review |
Contributor
Author
|
@greptileai review |
Contributor
Author
|
@greptileai review |
This branch has not been deployed
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
Blur-off full-size YUYV422 camera preview converts to tight BGRA in one integer BT.601 store via
cap_gpui_kernels::yuyv::to_bgra.camera_preview_imageuses it whenmax_dimsis absent and the frame is even-widthYUYV422. AVX2 when available; same scalar formula otherwise. Mirrored preview is reversed in that store. Anymax_dims(including blur at 640×360) still uses bilinear swscale +copy_rows.Why
Blur-off Linux preview kept full-res YUYV and swscaled to BGRA every frame (
Video::empty()), thencopy_rowsintoRenderImage. That is ~3.7–8.7 ms @1080p depending on whether the BGRA frame is reused.Measurement
Hardware: Intel Xeon family 6 model 207, 4 vCPU, AVX2. rustc 1.88.0. Bench profile
opt-level=s, codegen-units 1, thin LTO,target-cpu=x86-64. Warmup 8, 31 samples, median. Tight YUYV strides.Max abs channel delta vs bilinear swscale: 3. Integer BT.601 reference match covered by
cap-gpui-kernelsYUV tests.Test plan
cargo +stable test -p cap-gpui-kernels --lib— 78 passed (incl. YUV triples vs scalar integer ref)cap-gpuibinary link blocked here (zed pin vs local gpui commits); manual blur-off camera preview spot checkNo overlap with #3281/#3287 (export/decode YUV), #3292 (X11 SHM), or #3146 (Linux camera pool).


Confidence Score: 5/5
The PR appears safe to merge; no new actionable issues were found.Summary
The PR adds a faster full-size YUYV camera preview and updates Linux desktop checks.
Both earlier findings are fixed: output bytes use raw-pointer writes until initialized, and the benchmark handles conversion results with
.expect(). Neither supplied thread has a comment number.Reviews (7) · Last reviewed commit: "fix: allow busy Wayland compositors to e..." · Reviewed by Greptile