Skip to content

Disable lossy coding of non-visual channels#2507

Open
palemieux wants to merge 2 commits into
AcademySoftwareFoundation:lossy-htj2kfrom
sandflow:issues/disable-lossy-non-visual-channels
Open

Disable lossy coding of non-visual channels#2507
palemieux wants to merge 2 commits into
AcademySoftwareFoundation:lossy-htj2kfrom
sandflow:issues/disable-lossy-non-visual-channels

Conversation

@palemieux

Copy link
Copy Markdown
Collaborator

OpenJPH is not optimized for lossy coding of non-visual channels, e.g., depth maps.

This PR use heuristics to detect visual channels: visual channels are those whose suffix or full name is "r", "g", "b", "red", "green" or "blue". Even when requested globally by the caller, lossy coding is disabled on non-visual channels.

@palemieux
palemieux force-pushed the issues/disable-lossy-non-visual-channels branch from 6117610 to fd6e691 Compare June 25, 2026 22:09
Signed-off-by: Pierre-Anthony Lemieux <pal@palemieux.com>
@palemieux
palemieux force-pushed the issues/disable-lossy-non-visual-channels branch from fd6e691 to 278c9fc Compare June 25, 2026 22:10
@peterhillman

Copy link
Copy Markdown
Collaborator

As discussed in the meeting, DWA has a similar approach to deciding which channels need to be lossless (internal_dwa_classifier.h)
It could be worth making the HTJ2K channel logic match DWA

@palemieux

Copy link
Copy Markdown
Collaborator Author

Looks like there is a bug deep in OpenJPH:

aous72/OpenJPH#310

Signed-off-by: Pierre-Anthony Lemieux <pal@palemieux.com>
@palemieux

Copy link
Copy Markdown
Collaborator Author

@cary-ilm What is the procedure if this patch depends on a version of OpenJPH where method signatures have changed?

@cary-ilm

cary-ilm commented Jul 3, 2026

Copy link
Copy Markdown
Member

This PR goes into the lossy-htj2k branch, not main, and that branch will go into the 3.5 release, and we can make 3.5 depend on a modern OpenJPH.

It might be cleaner to submit a separate PR that bumps the OpenJPH version, in external as well as in the CI, merge that, then rebase this off of that.

@palemieux

Copy link
Copy Markdown
Collaborator Author

@cary-ilm the OpenJPH maintainer tells me he does not expect a tagged release (which the build system demands) until sometime in the future, so I guess this PR will remain until then.

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

Successfully merging this pull request may close these issues.

3 participants