Conversation
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.
For a gain map at scale 1, the Shepard weights are
[1, 0, 0, 0]: the result is just the first sample. The integer samplers still load four neighboring samples and combine them. This change reads the selected pixel directly for grayscale and RGB/RGBA maps, keeping the existing edge clamping, pixel strides, and/ 255.0fconversion.Performance
In a local 12 MP JPEG decode test with a full-resolution RGB gain map, this reduced elapsed time by 8.6-9.5% and process CPU time by 15.5-15.9%.
Each value is the median of nine iterations after two warmups. The test used a deterministic synthetic 4000x3000 JPEG on macOS ARM64, Apple Clang 21, libjpeg-turbo 3.2.0, and a Release
-O3build with intrinsics enabled. The in-memory harness included decoder creation, setters, decode to linear RGBA half-float, and release; file I/O was outside timing. CPU time includes all process threads. These results measure HDR decoding, not a complete transcoding pipeline.Tests
The added tests cover padded grayscale and RGB/RGBA rows, edge clamping, alpha-independent RGB sampling, and all 256 grayscale byte values. They also pass against the unmodified baseline.