Repository navigation
Commit 5bb9034
committed
WebP lossless encoder: single symbol codes >= 256 take zero bits
A prefix code with one used symbol that can't be a simple code (a length
code, >= 256) is written as a normal code with one non-zero length.
Decoders read such a code with zero bits per symbol, the encoder wrote
one, so every following bit was off by one. Only prefix groups (since
3.7.0) produce such histograms. It broke lossless WebPs and the alpha of
lossy ones, which most optimized animations have.
Fixes #82
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BsU2GDnECphmYTjLB5UeZv1 parent c8c1b0b commit 5bb9034
3 files changed
Lines changed: 29 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
3 | 10 | | |
4 | 11 | | |
5 | 12 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
684 | 684 | | |
685 | 685 | | |
686 | 686 | | |
| 687 | + | |
| 688 | + | |
687 | 689 | | |
688 | | - | |
689 | 690 | | |
690 | 691 | | |
691 | 692 | | |
| |||
743 | 744 | | |
744 | 745 | | |
745 | 746 | | |
746 | | - | |
| 747 | + | |
747 | 748 | | |
748 | 749 | | |
749 | 750 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
535 | 535 | | |
536 | 536 | | |
537 | 537 | | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
538 | 557 | | |
539 | 558 | | |
540 | 559 | | |
| |||
0 commit comments