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

Pixel value could be changed by 0-4 after compression and decompression #1429

Closed
xuemin-liu opened this issue Jun 11, 2022 · 3 comments
Closed

Comments

@xuemin-liu
Copy link

xuemin-liu commented Jun 11, 2022

Expected behavior and actual behavior.

I made a 16 bit matrix filled with random 12 bit integers. The values in the matrix were changed by 0-4 after compression (quality 100) and decompression. I expect the final matrix should be the same as the original one.

Steps to reproduce the problem.

Compress a random 12 bit matrix and decompress the comressed matrix.
Original matrix should be as the same as decmpressed matrix.

Operating system

Ubuntu

openjpeg version

2.7-dev

@xuemin-liu xuemin-liu changed the title Pixel value could changed by 0-4 after compression and decompression Pixel value could be changed by 0-4 after compression and decompression Jun 12, 2022
@xuemin-liu
Copy link
Author

xuemin-liu commented Jun 18, 2022

@ValZapod Thanks for your comment. That reminded me that the code was actually for lossy compression.
The problem was in the following code snippet:
l_param.tcp_numlayers = 1; l_param.cp_fixed_quality = 1; l_param.tcp_distoratio[0] = 100;
It is still lossy compression even distoratio is 100.
I removed the above code and that fixed my problem.

@rouault rouault closed this as completed Jul 20, 2022
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

3 participants
@rouault @xuemin-liu and others