Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use chunks_exact_mut in PNG decoder #2110

Merged
merged 2 commits into from
Jan 16, 2024
Merged

Conversation

Shnatsel
Copy link
Contributor

chunks_mut can return chunks with sizes 1 or 2, while chunks_exact_mut always returns chunks of size 2. This should result in better codegen.

This certainly could be vectorized further, but this codepath is only taken for 16-bit images which are uncommon, so I'm not going to invest a lot of my time into optimizing it.

In the current code a chunk of size 1 being returned would result in a panic, so this should not break anything.

src/codecs/png.rs Outdated Show resolved Hide resolved
@fintelia fintelia merged commit a6886ea into image-rs:master Jan 16, 2024
35 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