-
Notifications
You must be signed in to change notification settings - Fork 293
fix bug in huffman-rle-gradient (e1) specialized decode path #3662
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
Merged
jonsneyers
merged 1 commit into
libjxl:main
from
jonsneyers:f
8000
ast_lossless_decode_bug
Jun 25, 2024
Conversation
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
veluca93
approved these changes
Jun 24, 2024
69bbaa6
to
f784aba
Compare
mo271
pushed a commit
that referenced
this pull request
Jun 27, 2024
(cherry picked from commit 5c99f53)
mo271
pushed a commit
to mo271/libjxl
that referenced
this pull request
Jun 27, 2024
mo271
pushed a commit
to mo271/libjxl
that referenced
this pull request
Jun 27, 2024
mo271
pushed a commit
to mo271/libjxl
that referenced
this pull request
Jun 27, 2024
mo271
pushed a commit
that referenced
this pull request
Jun 27, 2024
mo271
pushed a commit
to mo271/libjxl
that referenced
this pull request
Jun 27, 2024
mo271
pushed a commit
that referenced
this pull request
Jun 28, 2024
mo271
pushed a commit
to mo271/libjxl
that referenced
this pull request
Jun 28, 2024
mo271
pushed a commit
that referenced
this pull request
Jun 28, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
bug
Something isn't working
decoder
Related to the libjxl decoder
merge-0.7
PR label to flag PRs that need to be merged to v0.7.x
merge-0.8
merge-0.9
PRs that need to be cherry picked into v0.9.x
merge-0.10
regression
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.
Fixes #3659
This was a regression introduced in #1046 when making a specialized decode path for RLE-only Huffman decoding as in bitstreams produced by lossless effort 1 (fast lossless).
The bug was that at the end of a decoded channel, there could still be a run going that goes into the next channel. The code assumed that there would be no runs crossing channel boundaries (i.e. run == 0 at the end of every channel), which is a valid assumption for bitstreams produced by fast_lossless, but it is not a valid assumption in general.
The cases where libjxl happens to produce RLE-only Huffman bitstreams outside the fast_lossless code path are pretty rare (otherwise we would have noticed this regression way earlier), but apparently it does happen, see #3659 for an example. Outside the fast_lossless encode path, there is no reason why runs would respect channel boundaries.
This fixes that bug and makes runs across channel boundaries work again, while preserving the specialized decode path (a simpler fix would be to just use the generic decode path).