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

Avoid extra memcpy when decoding avif #208

Merged
merged 2 commits into from
Jun 15, 2023
Merged

Conversation

qbnu
Copy link
Contributor

@qbnu qbnu commented Jun 11, 2023

We can allocate space for each AVIF frame ourselves and decode into it, avoiding having to copy once it's been decoded. It will be freed later once it's been displayed.

@sylikc
Copy link
Owner

sylikc commented Jun 15, 2023

I had to read the code several times... even though it's just a few lines that's a very cool optimization. Instead of having the library allocate the pixels, you did it manually and have control of it without memcpy() it to and from the library allocation.

That's very cool. Thank you @qbnu

sylikc added a commit that referenced this pull request Jun 15, 2023
…w allocates and frees the memory instead of calling avifRGBImageAllocatePixels/avifRGBImageFreePixels

Merge PR #208 by https://github.com/qbnu
@sylikc sylikc merged commit 13a261b into sylikc:master Jun 15, 2023
@sylikc sylikc added enhancement New feature or request format support Related to add/remove/change of a specific format support. labels Jun 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request format support Related to add/remove/change of a specific format support.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants