encoder output mode using out-of-order jxlp#4745
Open
jonsneyers wants to merge 4 commits into
Open
Conversation
veluca93
reviewed
Apr 28, 2026
veluca93
left a comment
Member
There was a problem hiding this comment.
Can we add roundtrip tests for this, with and without TOC permutation?
Member
Author
Initially TOC permutation was being ignored in output mode 2 (just like in output mode 1). Changed it to actually do the requested TOC permutation in mode 2, since even if modes 1 and 2 are inherently non-progressive, mode 2 can be easily converted to mode 0 by sorting and merging the jxlp boxes, so it may be useful to be able to do a center-first permutation even if it will only be usable after doing a conversion from ftyp 1 to ftyp 0. Added a test that checks that all output modes and TOC permutations produce different files but identical decoded images. |
veluca93
approved these changes
Jun 9, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
(builds on #4741)
This adds a new encoder option
JXL_ENC_FRAME_SETTING_OUTPUT_MODEto set the output mode:ftypversion 1 which allowsjxlpboxes to be in arbitrary order. Writes sections in the same order as in mode 1, but wraps each of them in its ownjxlpbox. The finaljxlpbox contains the TOC. No seeking is required during encode, and the 'logical' codestream does not use a permuted TOC, but it is shuffled at the file format level since it is split injxlpboxes that are out of order.It is not recommended to start using output mode 2 since current decoders do not support this yet. This is mostly just to create test bitstreams; it could be useful in some very specific use cases but generally sticking to mode 0 is recommended (to produce progressive-decodable output).