Repository navigation
Commit 2ce4eae
WebP lossless encoder: prefix groups, color cache size, lazy matches
The VP8L encoder (lossless WebPs and the alpha of lossy ones) now
- groups the main image's 16x16 blocks by their symbols (k-means by the
bits their clusters' codes would take, 4-16 groups, from the blocks
farthest apart) and writes an entropy image with a prefix group each,
if that is estimated to be smaller;
- picks the color cache's size (0-10 bits) by the estimated bits of the
literals and hits, all sizes in one pass;
- delays a match by a pixel if the next one starts a longer one;
- tries predicting images of 17-256 colors instead of indexing them, and
doesn't subtract green from images without red and blue (alpha planes).
Sizes vs cwebp: lossless 113.7% -> 107.2% (5 images), lossy alpha at
effort 2 113% -> 94%, at effort 4 134% -> 111%; every file decodes
exactly in dwebp. Lossless encoding takes about 65% longer.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Lfv41PqHEGbU7SLg5onpG11 parent 1adf0d3 commit 2ce4eae
2 files changed
Lines changed: 357 additions & 66 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
16 | 24 | | |
17 | 25 | | |
18 | 26 | | |
| |||
0 commit comments