Skip to content

Fix JPEG scaled decoding parity for 0.11.2 - #121

Merged
jcwal1516 merged 1 commit into
mainfrom
fix/jpeg-scaled-parity
Sep 27, 2026
Merged

jcwal1516 merged 1 commit into
mainfrom
fix/jpeg-scaled-parity

Conversation

@jcwal1516

Copy link
Copy Markdown
Member

JPEG reduced-resolution decoding could differ from libjpeg-turbo because components used the same IDCT size, chroma was smoothed at unsupported scales or widths, and progressive/12-bit paths decimated full-resolution pixels. Apply per-component reduced IDCTs and the matching upsampling rules across the CPU and Metal paths for the planned 0.11.2 release.

Also fix 12-bit region slice panics, Metal region chroma context at MCU boundaries, CUDA CPU-backed surface dimensions, and the 12-bit scratch budget for live output rows. A 208-image libjpeg-turbo 3.1.4.1 golden matrix covers full images, regions, scale factors, restart markers, progressive images, supported 12-bit layouts, and tall narrow images. Existing unsupported 12-bit layouts still return NotImplemented; narrow subsampled images reject explicit device requests and use CPU decoding under automatic routing.

Validation:

  • CPU golden matrix and decode-into integration suites: 88 passed.
  • Reference geometry check: 1 passed. The 192 original JPEG inputs and reference samples were preserved when adding the 16 tall-image cases.
  • WSI parity: 10 passed; real-GPU Metal matrix: 5 passed; CUDA-wrapper region tests on macOS: 6 passed.
  • Tall 4×64 12-bit 4:2:2 and 4:2:0 fixtures reproduced MemoryCapExceeded before the budget fix and now match libjpeg-turbo, including region reads.
  • Formatting and diff checks passed. Linux CUDA hardware validation and hosted PR checks remain pending; this PR does not publish a release.

@jcwal1516
jcwal1516 merged commit 75a3e06 into main Sep 27, 2026
22 of 24 checks passed
@jcwal1516
jcwal1516 deleted the fix/jpeg-scaled-parity branch September 27, 2026 21:59
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.

1 participant