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

refactor uncompressed decode #1081

Merged
merged 2 commits into from
Dec 26, 2023

Conversation

bradh
Copy link
Contributor

@bradh bradh commented Dec 25, 2023

This is a pretty large refactoring of the uncompressed codec.

There are two commits. The first splits the uncompressed boxes out into a separate file. That part is basically mechanical.

The second reworks how the uncompressed decode logic works. Previously we tried to pull the right bits into the image. This implementation is closer to the source - we step through the data and push into the image planes. There are multiple decoder implementations, and a factory method to choose which decoder to use. The choices at this point are oriented around interleave, but other options are possible.

There are no changes to the encode side.

There are now many more tests. We now support YCbCr 4:2:2 and 4:2:0 subsampling, and correctly handle component interleave. We also handle component alignment (for at least some cases).

Resolves #904

What is not yet supported:

  • block_size != 0 (along with associated flags)
  • components little endian
  • high bit depth (except == 16)
  • multi-Y interleave
  • 4:1:1 subsampling
  • palette images
  • component formats other than unsigned integer
  • the "version == 1" uncC short-cut format

Even with all of that, this is a better basis than what we currently have.

This moves the enumerations into a shared header file. The
sampling type enumeration and interleave type enumeration are
renamed to be sampling mode and enumeration mode to match the changes
in the FDIS. Documentation is added (although its not public API).

The cmpd and uncC box definitions are split off from the codec, to
keep file sizes reasonable.
@farindk farindk merged commit 44dbb8f into strukturag:develop-v1.18.0 Dec 26, 2023
2 checks passed
@farindk
Copy link
Contributor

farindk commented Dec 26, 2023

Thanks.

@bradh bradh deleted the uncompressed_rework_merge branch December 26, 2023 20:22
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.

2 participants