AV1 Palette Mode Coding for Computer Graphics

This article provides an overview of how the AV1 video codec implements palette mode coding to optimize the compression of computer-generated graphics and screen content. Traditional video coding tools rely on transforms like DCT, which are designed for continuous-tone photographic imagery and cause severe ringing artifacts when applied to sharp, flat-color computer graphics. AV1 circumvents this by treating blocks with limited color variations as indexed images, storing a small set of representative colors in a local palette and encoding pixels as an index map. Below is a detailed look at how AV1 detects, structures, and encodes palette mode blocks to deliver high fidelity and low bitrates for synthetic imagery.

The Challenge of Computer-Generated Graphics

Synthetic content—such as desktop screen shares, slide presentations, video game user interfaces, and 2D animations—features unique characteristics compared to natural video:

When a conventional intra-prediction and frequency-transform pipeline processes these sharp transitions, high-frequency coefficients are heavily quantized, introducing noticeable blur, edge distortion, and "mosquito noise."

Palette Mode Activation and Palette Sizing

AV1 includes palette mode as a specialized intra-coding tool. An encoder evaluates whether a block contains a small enough set of unique colors to justify a palette representation over standard directional intra-prediction.

Palette Color Signaling

Once the encoder establishes the palette colors for a block, it must transmit those color values to the decoder with minimal overhead:

  1. Palette Predictor Cache: AV1 maintains a running cache of recently used palette colors from previously decoded neighboring blocks.
  2. Bitstream Flags: The bitstream uses binary flags to signal whether a color from the cache is reused in the current block's palette.
  3. Direct Transmission: Any colors not present in the cache are explicitly transmitted with delta encoding relative to previous entries, taking advantage of monotonic ordering to minimize bit consumption.

Index Map Encoding

After defining the palette table, the block’s pixels are converted into an index map where each pixel corresponds to a palette index (0 through 7). AV1 encodes this 2D grid using an advanced context-adaptive entropy coding process rather than simple raw indices:

Impact on Compression and Visual Quality

By bypassing the transform and quantization stages, palette mode provides two primary advantages for computer graphics: