Skip to content

Fix progressive AC refinement JPEG decoding#565

Merged
treeform merged 1 commit intomasterfrom
fix-progressive-ac-refinement-jpeg
Apr 8, 2026
Merged

Fix progressive AC refinement JPEG decoding#565
treeform merged 1 commit intomasterfrom
fix-progressive-ac-refinement-jpeg

Conversation

@treeform
Copy link
Copy Markdown
Owner

@treeform treeform commented Mar 28, 2026

  • fix progressive JPEG AC refinement decoding when an EOB run is active by refining through spectralEnd instead of stopping one coefficient early
  • correct the SOS progressive validation check to reject spectralStart > spectralEnd
  • add tests/fileformats/jpeg/masters/chair_normal.jpg as a regression case in the JPEG suite

Pixie was skipping the last coefficient during progressive AC refinement when eobRun was active. That left one refinement bit unread, desynchronized the entropy bitstream, and caused a later Huffman decode to fail even though the JPEG itself was valid.

Progressive AC refinement scans were skipping the last coefficient during EOB-run handling, which left the bitstream misaligned and caused later Huffman decode failures on valid JPEGs. Add the chair_normal regression image to keep this case covered.

Made-with: Cursor
@treeform treeform merged commit 666d420 into master Apr 8, 2026
8 checks passed
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