8000 fix bug in huffman-rle-gradient (e1) specialized decode path by jonsneyers · Pull Request #3662 · libjxl/libjxl · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

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
merged 1 commit into from
Jun 25, 2024

Conversation

jonsneyers
Copy link
Member

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).

@jonsneyers jonsneyers added bug Something isn't working decoder Related to the libjxl decoder regression labels Jun 24, 2024
@jonsneyers jonsneyers requested a review from veluca93 June 24, 2024 15:26
@jonsneyers jonsneyers force-pushed the fast_lossless_decode_bug branch from 69bbaa6 to f784aba Compare June 25, 2024 08:13
@jonsneyers jonsneyers added this pull request to the merge queue Jun 25, 2024
Merged via the queue into libjxl:main with commit 5c99f53 Jun 25, 2024
101 checks passed
@mo271 mo271 added 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 labels 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 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
…3662)

(cherry picked from commit 5c99f53)
(cherry picked from commit f138eb3)
(cherry picked from commit bad72ed)
mo271 pushed a commit that referenced this pull request Jun 27, 2024
(cherry picked from commit 5c99f53)
(cherry picked from commit f138eb3)
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
(cherry picked from commit 5c99f53)
(cherry picked from commit f138eb3)
mo271 pushed a commit to mo271/libjxl that referenced this pull request Jun 28, 2024
…3662)

(cherry picked from commit 5c99f53)
(cherry picked from commit f138eb3)
(cherry picked from commit bad72ed)
mo271 pushed a commit that referenced this pull request Jun 28, 2024
(cherry picked from commit 5c99f53)
(cherry picked from commit f138eb3)
(cherry picked from commit bad72ed)
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

old encoded image jxl cannot decode by new version
3 participants
0