Repository navigation
faster GIF decoding - #62
Merged
Merged
Conversation
- Frame indices become RGBA through a table of the 256 colors (transparent and missing entries resolved once), written as one 32-bit value per pixel instead of four bytes after a table bounds check. - LZW strings are written without checking every byte against the end of the image, unless the string runs past it. The results are bit-identical: still and animated decoding (and the GIF and APNG encoders on the decoded frames) checked against master on 1593 images. The benchmark's 101 frame GIF decodes about 25% faster. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YJgRK5qpwJEbHPuFv6kgAQ
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.
Faster GIF decoding:
Identical results: still and animated decoding, plus the GIF and APNG encoders on the decoded frames, checked against master on 1593 images (1970 results, 0 different).
Speed: decoding the benchmark's 101-frame GIF takes about 29% less time.