H-DDCM: Hadamard Codebooks for Fast
Generative Image and Video Compression

Abstract

Training-free diffusion-based compression methods repurpose the generative priors of a diffusion or a flow model to compress data without retraining them as task-specific codecs. Recent codebook-based approaches such as Turbo-DDCM achieve strong perceptual quality at ultra-low bitrates, but their reliance on dense Gaussian codebooks remains costly in both memory and computation, and scales poorly with the large latent dimensions of modern image and video generators. Their combinatorial bitstream encoding further becomes computationally heavy at this scale. We introduce H-DDCM, a scalable generative compression framework that replaces Gaussian codebooks with implicit randomized Hadamard dictionaries. The fast Walsh–Hadamard transform allows implicitly synthesizing full-dimensional dictionaries with O(D log D) compute for projection and reconstruction and O(D) memory, without materializing the full-dimensional dictionary. We further introduce an efficient table-free lexicographic coding scheme that makes combinatorial encoding practical at larger dimensions. Beyond images, we adapt the framework to an autoregressive video flow model and develop a streaming compression scheme that periodically re-encodes recently reconstructed frames into a fresh KV-cache prefix, preserving temporal context across segments at no additional transmitted bits. This enables long-form, close to real-time generative video compression on a single GPU. Across image and video benchmarks, H-DDCM achieves competitive rate-distortion-perception performance while substantially reducing the memory and computational overhead of codebook-based training-free generative compression.

We compare our reproducible codebook-based noise selection against Turbo-DDCM on two pretrained diffusion backbones, Stable Diffusion 2.1 (Kodak24) and FLUX (DIV2K), across a wide bits-per-pixel (BPP) range. These quantitative comparisons show that our method is the fastest, without additional memory requirements, and achieves on-par results to other state-of-the-art methods on the rate-distortion-perception tradeoff.

Quantitative Comparison

SD2.1 quantitative comparison

Stable Diffusion 2.1 (Kodak24)

FLUX quantitative comparison

FLUX (DIV2K)

Qualitative Comparison — Stable Diffusion 2.1 (Kodak24)

Original
Ours
← smaller bit budgetlarger bit budget →
Original
Ours
← smaller bit budgetlarger bit budget →
Original
Ours
← smaller bit budgetlarger bit budget →

Qualitative Comparison — FLUX (DIV2K)

Original
Ours
← smaller bit budgetlarger bit budget →
Original
Ours
← smaller bit budgetlarger bit budget →
Original
Ours
← smaller bit budgetlarger bit budget →

We extend our reproducible codebook-based noise selection to video generation, using a Causal-Forcing (CF) autoregressive (AR) causal video model as the backbone, evaluated on the MCL-JCV and UVG datasets. We achieve the fastest encoding and decoding compression compared to methods leveraging the same CF backbone, leading towards real-time video compression and streaming, while achieving on-par performance on the rate-distortion-perception tradeoff.

Quantitative Comparison

Video quantitative comparison

Causal-Forcing (MCL-JCV / UVG)

Qualitative Comparison — Video

Original
Ours
← smaller bit budgetlarger bit budget →
Original
Ours
← smaller bit budgetlarger bit budget →
Original
Ours
← smaller bit budgetlarger bit budget →
Original
Ours
← smaller bit budgetlarger bit budget →
Original
Ours
← smaller bit budgetlarger bit budget →
Original
Ours
← smaller bit budgetlarger bit budget →
Original
Ours
← smaller bit budgetlarger bit budget →
Original
Ours
← smaller bit budgetlarger bit budget →
Original
Ours
← smaller bit budgetlarger bit budget →
Original
Ours
← smaller bit budgetlarger bit budget →
Original
Ours
← smaller bit budgetlarger bit budget →
Original
Ours
← smaller bit budgetlarger bit budget →
Original
Ours
← smaller bit budgetlarger bit budget →
Original
Ours
← smaller bit budgetlarger bit budget →
Original
Ours
← smaller bit budgetlarger bit budget →
Original
Ours
← smaller bit budgetlarger bit budget →
Original
Ours
← smaller bit budgetlarger bit budget →

We also apply our reproducible codebook-based noise selection to audio compression, using the Stable Audio Open 1.0 model, and compare it with the neural codec EnCodec and the classical codec Opus on SQAM recordings, at several bitrates.

Quantitative Comparison

Audio quantitative comparison

Stable Audio Open 1.0 (SQAM, 5 seconds 100 excerpts)

Qualitative Comparison — Audio

Press play to listen. Every row compares one excerpt: the original and the reconstructions of H-DDCM, EnCodec and Opus. The bitrate under each player is the actual rate of that file (each method uses its closest evaluated point to the chosen ~3 / ~6 kbps, so the rates are close but not identical).

5-second excerpts

SQAM track 37 · 7.5–12.5 s of the recording
Original
0:00
 
Ours
0:00
2.99 kbps
EnCodec
0:00
3.18 kbps
Opus
0:00
 
SQAM track 36 · 14.5–19.5 s of the recording
Original
0:00
 
Ours
0:00
2.99 kbps
EnCodec
0:00
3.18 kbps
Opus
0:00
 
SQAM track 29 · 3.5–8.5 s of the recording
Original
0:00
 
Ours
0:00
2.99 kbps
EnCodec
0:00
3.18 kbps
Opus
0:00
 
SQAM track 60 · 58.0–63.0 s of the recording
Original
0:00
 
Ours
0:00
2.99 kbps
EnCodec
0:00
3.18 kbps
Opus
0:00
 
SQAM track 58 · 8.0–13.0 s of the recording
Original
0:00
 
Ours
0:00
2.99 kbps
EnCodec
0:00
3.18 kbps
Opus
0:00
 
SQAM track 56 · 21.5–26.5 s of the recording
Original
0:00
 
Ours
0:00
2.99 kbps
EnCodec
0:00
3.18 kbps
Opus
0:00
 
SQAM track 46 · 19.0–24.0 s of the recording
Original
0:00
 
Ours
0:00
2.99 kbps
EnCodec
0:00
3.18 kbps
Opus
0:00
 
SQAM track 47 · 0.5–5.5 s of the recording
Original
0:00
 
Ours
0:00
2.99 kbps
EnCodec
0:00
3.18 kbps
Opus
0:00
 
SQAM track 44 · 15.0–20.0 s of the recording
Original
0:00
 
Ours
0:00
2.99 kbps
EnCodec
0:00
3.18 kbps
Opus
0:00
 
SQAM track 51 · 1.5–6.5 s of the recording
Original
0:00
 
Ours
0:00
2.99 kbps
EnCodec
0:00
3.18 kbps
Opus
0:00
 
SQAM track 53 · 0.5–5.5 s of the recording
Original
0:00
 
Ours
0:00
2.99 kbps
EnCodec
0:00
3.18 kbps
Opus
0:00
 
SQAM track 54 · 11.0–16.0 s of the recording
Original
0:00
 
Ours
0:00
2.99 kbps
EnCodec
0:00
3.18 kbps
Opus
0:00
 
SQAM track 62 · 15.5–20.5 s of the recording
Original
0:00
 
Ours
0:00
2.99 kbps
EnCodec
0:00
3.18 kbps
Opus
0:00
 
SQAM track 64 · 16.0–21.0 s of the recording
Original
0:00
 
Ours
0:00
2.99 kbps
EnCodec
0:00
3.18 kbps
Opus
0:00
 
SQAM track 61 · 149.5–154.5 s of the recording
Original
0:00
 
Ours
0:00
2.99 kbps
EnCodec
0:00
3.18 kbps
Opus
0:00
 
SQAM track 66 · 9.0–14.0 s of the recording
Original
0:00
 
Ours
0:00
2.99 kbps
EnCodec
0:00
3.18 kbps
Opus
0:00
 
SQAM track 65 · 51.0–56.0 s of the recording
Original
0:00
 
Ours
0:00
2.99 kbps
EnCodec
0:00
3.18 kbps
Opus
0:00
 
SQAM track 68 · 150.5–155.5 s of the recording
Original
0:00
 
Ours
0:00
2.99 kbps
EnCodec
0:00
3.18 kbps
Opus
0:00
 
SQAM track 70 · 10.5–15.5 s of the recording
Original
0:00
 
Ours
0:00
2.99 kbps
EnCodec
0:00
3.18 kbps
Opus
0:00
 
SQAM track 69 · 11.5–16.5 s of the recording
Original
0:00
 
Ours
0:00
2.99 kbps
EnCodec
0:00
3.18 kbps
Opus
0:00
 
SQAM track 69 · 17.0–22.0 s of the recording
Original
0:00
 
Ours
0:00
2.99 kbps
EnCodec
0:00
3.18 kbps
Opus
0:00
 

15-second excerpts

SQAM track 36 · 9.5–24.5 s of the recording
Original
0:00
 
Ours
0:00
2.99 kbps
EnCodec
0:00
3.10 kbps
Opus
0:00
 
SQAM track 26 · 9.5–24.5 s of the recording
Original
0:00
 
Ours
0:00
2.99 kbps
EnCodec
0:00
3.10 kbps
Opus
0:00
 
SQAM track 29 · 0.0–15.0 s of the recording
Original
0:00
 
Ours
0:00
2.99 kbps
EnCodec
0:00
3.10 kbps
Opus
0:00
 
SQAM track 60 · 22.0–37.0 s of the recording
Original
0:00
 
Ours
0:00
2.99 kbps
EnCodec
0:00
3.10 kbps
Opus
0:00
 
SQAM track 58 · 0.0–15.0 s of the recording
Original
0:00
 
Ours
0:00
2.99 kbps
EnCodec
0:00
3.10 kbps
Opus
0:00
 
SQAM track 57 · 0.0–15.0 s of the recording
Original
0:00
 
Ours
0:00
2.99 kbps
EnCodec
0:00
3.10 kbps
Opus
0:00
 
SQAM track 44 · 0.0–15.0 s of the recording
Original
0:00
 
Ours
0:00
2.99 kbps
EnCodec
0:00
3.10 kbps
Opus
0:00
 
SQAM track 45 · 0.0–15.0 s of the recording
Original
0:00
 
Ours
0:00
2.99 kbps
EnCodec
0:00
3.10 kbps
Opus
0:00
 
SQAM track 46 · 1.0–16.0 s of the recording
Original
0:00
 
Ours
0:00
2.99 kbps
EnCodec
0:00
3.10 kbps
Opus
0:00
 
SQAM track 52 · 0.0–15.0 s of the recording
Original
0:00
 
Ours
0:00
2.99 kbps
EnCodec
0:00
3.10 kbps
Opus
0:00
 
SQAM track 51 · 0.0–15.0 s of the recording
Original
0:00
 
Ours
0:00
2.99 kbps
EnCodec
0:00
3.10 kbps
Opus
0:00
 
SQAM track 53 · 0.0–15.0 s of the recording
Original
0:00
 
Ours
0:00
2.99 kbps
EnCodec
0:00
3.10 kbps
Opus
0:00
 
SQAM track 62 · 5.5–20.5 s of the recording
Original
0:00
 
Ours
0:00
2.99 kbps
EnCodec
0:00
3.10 kbps
Opus
0:00
 
SQAM track 64 · 4.0–19.0 s of the recording
Original
0:00
 
Ours
0:00
2.99 kbps
EnCodec
0:00
3.10 kbps
Opus
0:00
 
SQAM track 63 · 14.5–29.5 s of the recording
Original
0:00
 
Ours
0:00
2.99 kbps
EnCodec
0:00
3.10 kbps
Opus
0:00
 
SQAM track 66 · 0.0–15.0 s of the recording
Original
0:00
 
Ours
0:00
2.99 kbps
EnCodec
0:00
3.10 kbps
Opus
0:00
 
SQAM track 65 · 46.0–61.0 s of the recording
Original
0:00
 
Ours
0:00
2.99 kbps
EnCodec
0:00
3.10 kbps
Opus
0:00
 
SQAM track 67 · 4.0–19.0 s of the recording
Original
0:00
 
Ours
0:00
2.99 kbps
EnCodec
0:00
3.10 kbps
Opus
0:00
 
SQAM track 70 · 0.0–15.0 s of the recording
Original
0:00
 
Ours
0:00
2.99 kbps
EnCodec
0:00
3.10 kbps
Opus
0:00
 
SQAM track 69 · 6.5–21.5 s of the recording
Original
0:00
 
Ours
0:00
2.99 kbps
EnCodec
0:00
3.10 kbps
Opus
0:00