Modes

Besides baseline sequential coding, the standard defines progressive and lossless modes. Progressive mode sends the coefficients of each block over several scans. Lossless mode skips the DCT and quantization.

Progressive Mode

The coefficients of each block are sent over several scans.

  • Spectral selection
    Early scans send the DC coefficients of all blocks. Later scans send bands of AC coefficients, such as indices 1 to 5, then 6 to 63.
  • Successive approximation
    A coefficient is first sent with its most significant bits (shifted right by AlA_l). Later scans send the remaining bits 1 bit at a time.

An AC scan covers 1 component. The entropy coder adds an end-of-band run symbol that covers many blocks, so long runs of all-zero bands cost little. The compressed size is similar to the sequential mode and often slightly smaller.

Lossless Mode

No DCT or quantization. The predicted value of sample xx uses its left neighbour AA, upper neighbour BB and upper-left neighbour CC.

SelectorPredictor x^\hat{x}
1AA
2BB
3CC
4A+B−CA + B - C
5A+(B−C)/2A + (B - C)/2
6B+(A−C)/2B + (A - C)/2
7(A+B)/2(A + B)/2

The difference x−x^x - \hat{x} is coded as a category and extra bits, as with DC coefficients. The first sample of a row uses a fixed default prediction.

Written by October 23, 2026 2 min read
Was this helpful?