-
Notifications
You must be signed in to change notification settings - Fork 63
fix and optimize openjpeg J2C encoder #4017
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
base: develop
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your contribution!
Please fix the whitespace issues so that it passes the pre-commit check.
llassert(user_data); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
llassert(user_data); | |
llassert(user_data); | |
parameters->tcp_numlayers = num_layers; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
parameters->tcp_numlayers = num_layers; | |
parameters->tcp_numlayers = num_layers; | |
parameters.tcp_mct = (image->numcomps >= 3) ? 1 : 0; // no color transform for RGBA images | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
parameters.tcp_mct = (image->numcomps >= 3) ? 1 : 0; // no color transform for RGBA images | |
parameters.tcp_mct = (image->numcomps >= 3) ? 1 : 0; // no color transform for RGBA images | |
This is a follow up of my previous PR about JPEG2000 encoding with OpenJPEG. #2054
There were a few issues with my previous attempt:
Here's what I did in this PR:
After a lot of testing I came very close to the results we get
with Kakadu. Here are some test files for comparison:
test_files.zip
The encoded files now respect the 1:8 ratio and have the correct number of discards.
With many thanks to @TommyTheTerrible for his help.