Skip to content
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

signed 16bit negative values mismatch in interoperablity test between openjph and kakadu #102

Closed
michaeldsmith opened this issue Mar 29, 2023 · 2 comments

Comments

@michaeldsmith
Copy link
Contributor

michaeldsmith commented Mar 29, 2023

I've been testing interoperability between kakadu and openjph with lossless compression using signed 16bit data.

If I don't test interoperability between kakadu and openjph, then I get confirmed lossless behavior.

  1. encode with kakadu decode with kakadu is lossless
  2. encode with openjph decode with openjph is lossless

Everything works when the input values are 0 or positive, but I don't get interoperability for negative values.

  1. encode with kakadu decode with openjph is not lossless
  2. encode with openjph decode with kakadu is not lossless.

Here is md5sum result for the various files
image

It seems like kakadu and openjph have different ways of handling the negative values, but it is consistent and therefore invertible/lossless.

Encoding the same source file with kakadu and openjph and viewing the encoded files in kdushow shows a clear difference in how the data is represented in the j2c files

image

In the snip below, the source is on the left, and the mismatching decoded files are in the center and to the right. I used the Vooya raw viewer with format settings single-channel, 256x256 and signed 16bit to view the decoded raw images.

image

If I instead treat the input file as unsigned 16bit raw (Nsigned=no with kakadu and -signed false with openjph), there is no issue and I get interoperable lossless performance, and all the md5 hashes match.

The attached zip files contains the source RAW file (all_16bit_values.raw) that contains all 16bit values, and the test scripts as well as the j2c codestreams and the decoded files.

2023_03_29_kdu_vs_openjph_signed_16bit_mismatch.zip

@aous72
Copy link
Owner

aous72 commented Apr 2, 2023

This is an issue of how raw files are processed. We need to have an independent raw_in and raw_out classes.

@aous72
Copy link
Owner

aous72 commented Apr 2, 2023

Thank you Mike for putting this is; I hope this fixes the issue.

@aous72 aous72 closed this as completed Apr 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants