forked from SerenityOS/serenity
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
LibGfx/WebP: Add CanonicalCode::write_symbol(), use it in writer
We still construct the code length codes manually, and now we also construct a PrefixCodeGroup manually that assigns 8 bits to all symbols (except for fully-opaque alpha channels, and for the unused distance codes, like before). But now we use the CanonicalCodes from that PrefixCodeGroup for writing. No behavior change at all, the output is bit-for-bit identical to before. But this is a step towards actually huffman-coding symbols. This is however a pretty big perf regression. For `image -o test.webp test.bmp` (where test.bmp is retro-sunset.png re-encoded as bmp), time goes from 23.7 ms to 33.2 ms. `animation -o wow.webp giphy.gif` goes from 85.5 ms to 127.7 ms. `animation -o wow.webp 7z7c.gif` goes from 12.6 ms to 16.5 ms.
- Loading branch information
Showing
3 changed files
with
30 additions
and
11 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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