Closed landaire closed 3 years ago
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).
:memo: Please visit https://cla.developers.google.com/ to sign.
Once you've signed (or fixed any issues), please reply here with @googlebot I signed it!
and we'll verify it.
ℹ️ Googlers: Go here for more info.
@googlebot I signed it!
I force pushed a new change which correctly does the RGB to BGRA encoding. po8's patch just copied from src to dst without taking into account that R
and B
are in opposite positions. The benchmark stats were updated accordingly.
No big secret that I am /u/po8 on Reddit. Glad to see this change go in! Let me know if I can be of help somehow. Thanks to @landaire for doing the hard part.
Thanks!
There was some conversation on the Rust subreddit about the recent PNG decoder blog post and some users had pointed out that the RGB to BGRA conversion is a particularly great example of where Rust fails to elide bounds checks.
The full thread is here: https://www.reddit.com/r/rust/comments/mlfhlo/wuffs_png_decoder_faster_than_rust/gtm8odo/
I've applied a patch to use the iterator-based solution from the user po8 which provides a nice speedup:
I tried to tackle the conversion from RGBA to BGRA but I ended up with a very odd negative result somehow:
The patch for
rgba_to_bgra.txt
looks like:Note: I have not tested po8's patch for functional correctness but it it seems to do the right thing.