You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
c2df11b:crates/gamut-jpeg/src/encoder.rs:621,:722-725,:783-795).huffman::build_optimal_table(Annex K.2) — but is wired only to the progressive path.libjpeg-turbo -optimize. Best reward/effort item in the JPEG set: the machinery is written, it just isn't reachable from the sequential encoder.JpegEncoderbuilder method. Keep the current fixed-table output reachable so the frozen-bytes contract inencoder.rsstill holds for existing configurations.