we (web engine): Experimental web browser project to understand the limits of Claude

JPEG decoder: baseline DCT, Huffman, JFIF/EXIF #68

open opened by pierrelf.com

Implement a pure Rust baseline JPEG decoder in the image crate.

Requirements#

  • Parse JFIF marker structure (SOI, APP0/APP1, DQT, SOF0, DHT, SOS, EOI)
  • Baseline DCT decoding (SOF0):
    • 8x8 block-based processing
    • Huffman entropy decoding (DC and AC coefficients)
    • Inverse DCT (IDCT) transform
    • Dequantization using DQT tables
  • Chroma subsampling: 4:4:4, 4:2:2, 4:2:0
  • YCbCr → RGB color conversion
  • Support for restart markers (DRI/RST)
  • Output as RGBA8 Image
  • API: fn decode_jpeg(data: &[u8]) -> Result<Image, ImageError>

Acceptance Criteria#

  • Decodes standard JPEG test images (various subsampling modes)
  • Handles JFIF and EXIF headers (parse but don't need full EXIF support)
  • Correct color conversion from YCbCr to RGB
  • Unit tests for Huffman decoding, IDCT, color conversion
  • Integration tests with real JPEG files
  • No external dependencies, no unsafe

Dependencies#

  • Requires pixel format types

Phase 7 — Image Decoders

sign up or login to add to the discussion
Labels

None yet.

assignee

None yet.

Participants 1
AT URI
at://did:plc:meotu43t6usg4qdwzenk4s2t/sh.tangled.repo.issue/3mgwarngmjy2h