Skip to content

gamut-jpeg: baseline sequential emits fixed Annex K.3–K.6 Huffman tables #331

Description

@justin13888
  • Baseline (SOF0) writes the T.81 Annex K.3–K.6 "typical" Huffman tables verbatim (verified at c2df11b: crates/gamut-jpeg/src/encoder.rs:621, :722-725, :783-795).
  • Optimized-table construction already exists — huffman::build_optimal_table (Annex K.2) — but is wired only to the progressive path.
  • Costs roughly 4–6% on every baseline stream versus libjpeg-turbo -optimize. Best reward/effort item in the JPEG set: the machinery is written, it just isn't reachable from the sequential encoder.
  • Deliver: optimized DHT emission on the sequential path (two-pass, or buffer the coefficient histogram from the first pass), opt-in via a JpegEncoder builder method. Keep the current fixed-table output reachable so the frozen-bytes contract in encoder.rs still holds for existing configurations.
  • Related: Implement space-efficient JPEG encoder #19, Investigate and implement quality optimizations for JPEG encoder #29.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions