AV1 HRD Leaky Bucket Buffer Model Parameters

The AV1 Hypothetical Reference Decoder (HRD) relies on a leaky bucket model to mathematically verify that a bitstream can be decoded in real time without causing memory overflow or buffer underflow. This article breaks down the essential parameters governing the leaky bucket model in the AV1 specification, detailing how bit rate, buffer capacity, initial delays, and timing metadata define the continuous intake and instantaneous removal of compressed video data within the Coded Picture Buffer (CPB).

The Core Leaky Bucket Triplet

In video coding standards, the leaky bucket model conceptualizes the decoder buffer as a bucket with a hole in the bottom. In AV1's implementation for the CPB, bits typically enter the bucket at a constant or bounded transmission rate (the input) and are removed instantaneously as complete frames (the leak) at designated decode times.

The model is formally defined by three primary parameters:

  1. Bit Rate (\(R\)): The transmission speed at which coded bits flow into the buffer.
  2. Buffer Size (\(B\)): The maximum storage capacity of the decoder's buffer.
  3. Initial Delay (\(F\)): The duration or initial fullness required before the decoder begins extracting and decoding frames.

In AV1, multiple operating points can exist within a single bitstream, and each operating point can define its own set of leaky bucket parameters to handle varying network constraints and decoder capabilities.


Key Syntax Elements in the AV1 Specification

The parameters that construct the leaky bucket model are transmitted within the sequence_header_obu under the decoder model information (decoder_model_info) and operating parameters information (operating_parameters_info).

1. Bit Rate Specification

The transmission rate \(R\) is calculated using a base value and an exponent scale:

The peak or nominal bit rate is derived as: \[\text{BitRate} = (\text{bit\_rate\_value\_minus1}[i] + 1) \times 2^{(6 + \text{bit\_rate\_scale})}\]

2. Buffer Capacity Specification

The size \(B\) of the Coded Picture Buffer is configured similarly:

The maximum buffer capacity is derived as: \[\text{BufferSize} = (\text{buffer\_size\_value\_minus1}[i] + 1) \times 2^{(4 + \text{buffer\_size\_scale})}\]

3. Initial Buffer Fullness and Delay Parameters

To prevent the decoder from running out of bits during the initial presentation phase, the model sets initial buffering delays:

These values are quantified using a time base defined by the sequence timing info.

4. Time Scale and Clock Ticks

The timing of frame delivery and extraction depends on reference clock values defined in timing_info:


Buffer Dynamics: Underflow and Overflow Rules

The leaky bucket parameters enforce two strict operational conditions on the bitstream:

By embedding these parameters directly into the bitstream headers, AV1 allows streaming servers and decoders to negotiate suitable operating points, guarantee continuous playback, and prevent buffer exhaustion regardless of network variance.