Skip to content

Split YUV & RGB Buffers Into Arrays#85

Merged
ralfbiedert merged 2 commits into
ralfbiedert:masterfrom
jnnks:yuv2rgb_perf
Dec 25, 2025
Merged

Split YUV & RGB Buffers Into Arrays#85
ralfbiedert merged 2 commits into
ralfbiedert:masterfrom
jnnks:yuv2rgb_perf

Conversation

@jnnks

@jnnks jnnks commented Dec 21, 2025

Copy link
Copy Markdown
Contributor

The macro turned into many conditional jumps due to range checks.
This PR uses a more "rusty" syntax and removes many of the bound checks.

RUSTFLAGS='-C target-cpu=native' cargo +nightly bench convert_yuv_to_rgb


before:
test convert_yuv_to_rgb_1920x1080  ... bench:   5,080,432.75 ns/iter (+/- 188,360.31)
test convert_yuv_to_rgb_512x512    ... bench:     639,837.89 ns/iter (+/- 32,349.89)
test convert_yuv_to_rgba_1920x1080 ... bench:   5,477,576.50 ns/iter (+/- 691,816.61)

after:
test convert_yuv_to_rgb_1920x1080  ... bench:   2,660,560.60 ns/iter (+/- 170,850.83)
test convert_yuv_to_rgb_512x512    ... bench:     352,246.05 ns/iter (+/- 41,074.52)
test convert_yuv_to_rgba_1920x1080 ... bench:   2,524,497.02 ns/iter (+/- 158,960.58)

edit: wrong convert_yuv_to_rgba_1920x1080 number

@ralfbiedert

Copy link
Copy Markdown
Owner

Nice, thanks!

@ralfbiedert ralfbiedert merged commit 905cb92 into ralfbiedert:master Dec 25, 2025
14 checks passed
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.

2 participants