jxlatte icon indicating copy to clipboard operation
jxlatte copied to clipboard

32 bit floating point support

Open haraldk opened this issue 1 year ago • 1 comments

Hi again, I've been testing the decoder on a lot of images, and I have found an image that won't decode. It's one of the images from the libjxl conformance tests, containing a lossless encoded 32 bit float image:

lossless_pfm/input.jxl

com.traneptora.jxlatte.io.InvalidBitstreamException: Illegal final modular state
	at com.traneptora.jxlatte.frame.modular.ModularStream.decodeChannels(ModularStream.java:196)
	at com.traneptora.jxlatte.frame.modular.ModularStream.decodeChannels(ModularStream.java:184)
	at com.traneptora.jxlatte.frame.group.PassGroup.<init>(PassGroup.java:79)
	at com.traneptora.jxlatte.frame.Frame.decodePassGroups(Frame.java:342)
	at com.traneptora.jxlatte.frame.Frame.decodeFrame(Frame.java:429)
	at com.traneptora.jxlatte.JXLCodestreamDecoder.decode(JXLCodestreamDecoder.java:761)
	at com.traneptora.jxlatte.JXLCodestreamDecoder.decode(JXLCodestreamDecoder.java:686)
	at com.traneptora.jxlatte.JXLDecoder.decode(JXLDecoder.java:41)

This is the only sample file I have come across that actually contains 32 bit and float samples, so I guess they are quite rare. But it would be nice if it could be decoded!

Not sure if this counts as a bug or a new feature... Let me know if I can help fixing this, but I'm afraid my knowledge on JPEG XL is a bit limited at the moment. 😀

haraldk avatar Nov 08 '24 08:11 haraldk

This is most likely an issue with the weighted predictor, upon further investigation. It may require some deeper looking though.

Traneptora avatar Nov 11 '24 21:11 Traneptora