OpenJPH icon indicating copy to clipboard operation
OpenJPH copied to clipboard

Support -skip_res in ojph_expand when the data is 32bit lossless

Open aous72 opened this issue 1 year ago • 2 comments

When ojph_expand is invoked with -skip_res and the data is 32bit lossless, the 32 bit interface cannot support the needed dynamic range. This requires exposing the 64 bit data, and in the process changing the interface to applications outside the library.

aous72 avatar Nov 10 '24 01:11 aous72

I think an application that is knowingly skipping the decoding of resolution levels would not necessarily expect the lower resolution data to be lossless. I could imagine it might be lossless in an area where there are no high-frequencies but I'm not sure it would be lossless in an area containing high frequencies. Maybe the mean value of the image would be losslessly represented. Also, it might be hard to justify having an application access the 64-bit interface only for low-resolution decoding, but then use the 32-bit interface for full-resolution decoding.

One solution could be to map the higher-than-32bit dynamic range of the low-resolution decode to the limits of the 32bit interface.

michaeldsmith avatar Jan 20 '25 18:01 michaeldsmith

I agree with you. I think having access to 64bit is a bad idea. I should limit the data to 32bit before sending it out, like you said. This is requires some development.

aous72 avatar Jan 29 '25 10:01 aous72