这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@eustas
Copy link
Contributor

@eustas eustas commented Nov 20, 2024

Before this PR 0px channels were "skipped" before the check. In some cases 1xK and Kx1 images are squeezed (for 420 subsampling) and thus 0xK / Kx0 channels appear.

@eustas eustas requested a review from jonsneyers November 20, 2024 14:20
@jonsneyers
Copy link
Member

Is this a spec change?

@eustas
Copy link
Contributor Author

eustas commented Nov 22, 2024

Going to check.

@eustas
Copy link
Contributor Author

eustas commented Nov 22, 2024

(sorry, only old spec is at hands reach now)

C.4.8: The decoder shall decode a modular sub-bitstream (C.9). However, the decoder shall only decode the first nb_meta_channels channels and any further channels that have a width and height that are both at most 256.

C.8.2: In the partial image decoded from the GlobalModular and ModularDcGroup sections, the pixels in the remaining channel data that correspond to the group are decoded as another modular image sub-bitstream (C.9)... The number of channels and their dimensions are derived as follows: for every remaining channel in the partially decoded GlobalModular image (i.e. it is not a meta-channel, the channel dimensions exceed 256×256,...

C.9.2: The decoder shall then decode the data for each channel (in ascending order of index) as specified in C.9.3, skipping any channels whose width or height is zero. Finally the series of inverse transformations shall be applied as described in C.9.4.

So, both C.4.8 and C.8.2 add "extra" condition on the top of C.9. C.9.2 gives a lower level hint - "no pixels -> skip".

But of course, that could be interpreted the other way round.

@eustas
Copy link
Contributor Author

eustas commented Dec 12, 2024

@jonsneyers friendly ping

@jonsneyers
Copy link
Member

I mean: are there files produced by older cjxl/libjxl that will no longer decode if this gets merged, or will the new cjxl/libjxl produce files that will not decode by older djxl/libjxl?

@eustas
Copy link
Contributor Author

eustas commented Dec 18, 2024

Current encoder and decoder fail when they meet specific input (very tall/wide image + modular + group-shift).
So, likely there are no such files in the wild.
New encoder will be able to produce files on which old decoder will fail.

Context: #3937

@jonsneyers
Copy link
Member

OK, let's just check if this is something that needs to be made more clear in the spec.

@jonsneyers jonsneyers added the spec Has spec impact label Dec 19, 2024
Before this PR 0px channels were "skipped" before the check.
In some cases 1xK and Kx1 images are squeezed (for 420 subsampling)
and thus 0xK / Kx0 channels appear.
@eustas eustas enabled auto-merge December 20, 2024 08:04
@eustas eustas added this pull request to the merge queue Dec 20, 2024
auto-merge was automatically disabled December 20, 2024 08:34

Pull Request is not mergeable

Merged via the queue into libjxl:main with commit 782608f Dec 20, 2024
101 checks passed
@eustas eustas deleted the m420bis branch December 23, 2024 08:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

spec Has spec impact

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants