Repository navigation
fix(j2k): decode shared component grids for CPU batches and regions - #393
Merged
Merged
Conversation
Expose the sampling shared by every component on native images and inspected reference grids, while retaining the full image-area size separately for recovered-header callers.
Pack only a gray plane’s decoded samples so component-grid decodes into image-area-sized buffers leave every byte past the decoded grid untouched.
Map full, region, reduced, row, component, and prepared CPU batch outputs onto the grid shared by every component. Report that sampling in reference-grid metadata, reject regions that hold no sample, and preserve the full image area for recovered headers.
Pin that newly preparable metadata-only shared-sampling groups and operations remain explicit Metal or CUDA errors and never decode on the CPU.
Refresh the 0.14 public API snapshots, review fingerprints, and generated diff for the new native and facade output-sampling fields and hidden image geometry accessors.
Reject uniformly subsampled component grids explicitly before the opj_decompress-compatible command can take the newly supported facade path with the wrong output interpretation.
Document that CPU pixel decoding now returns the smaller grid shared by uniformly sampled components and maps regions onto the samples they contain.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
When all JPEG 2000 components are sampled at the same interval, the decoder writes a smaller grid of samples. Rust batch planning used the full image dimensions or rejected the input. A half-sized gray output could also copy SIMD padding into a caller's longer slice.
Report the output sampling from the native header and the Rust reference grid, map image-relative requests to the samples they cover, and prepare and decode CPU batches with that geometry. This gives the C bindings the output dimensions and layouts they need. The CLI keeps its documented input restrictions, and explicit GPU batch requests keep their error contract for these layouts.
Impact
Testing