AV1 Cyclic Refresh in Low-Delay Real-Time Video
Cyclic refresh is a rate-control and error-resilience technique used in AV1 real-time encoding to maintain video quality and prevent transmission delays without relying on full keyframes. In low-latency applications like video conferencing and cloud gaming, transmitting an entire intra-coded frame (I-frame) creates a severe bitrate spike that causes network jitter, packet loss, and buffer delays. Cyclic refresh mitigates this by incrementally updating a portion of the frame over consecutive frames, smoothing out bandwidth demand while keeping end-to-end latency minimal.
The Challenge of Real-Time Video Delivery
Standard video compression structures utilize periodic keyframes to reset the temporal prediction chain, clear transmission errors, and refresh overall picture fidelity. However, an I-frame typically requires several times the bit budget of an inter-predicted frame (P-frame).
In real-time communications—such as WebRTC workflows—network buffers are kept extremely small to minimize lag. A sudden spike in frame size can instantly overwhelm these buffers, causing network congestion and dropped frames. Disabling keyframes entirely is equally problematic, as quantization errors accumulate over time and transmission losses cause visual artifacts to propagate indefinitely across subsequent frames.
How Cyclic Refresh Works in AV1
Cyclic refresh solves this trade-off by spreading the cost of an I-frame across a sliding window of multiple P-frames.
The encoder divides the video frame into a grid of blocks or macroblocks. Instead of refreshing all blocks at once, the algorithm selects a specific percentage—typically 5% to 20%—of the frame's surface area to be "refreshed" in each frame. Over a designated cycle (for example, across 10 to 20 consecutive frames), every spatial position within the picture area is refreshed at least once.
In AV1, this process is primarily driven through segmentation maps:
- Segmentation Tagging: AV1 supports up to eight distinct segments per frame, allowing specific encoding parameters to be assigned to arbitrary groups of blocks. The cyclic refresh module marks the designated refresh region as a distinct segment.
- Targeted Quality Boost: The blocks within the refresh segment are encoded with a lower Quantization Parameter (lower QP/higher fidelity) or forced into intra-prediction mode. This makes them cleaner references for future frames.
- Reference Frame Management: The encoder prioritizes using these newly refreshed, high-quality blocks as reference sources for motion estimation in subsequent frames, accelerating quality propagation across the entire scene.
Managing Motion and Static Content
A purely mechanical scan across the frame can waste bits on
completely static backgrounds or fail to clean up fast-moving objects.
Advanced AV1 encoders, such as the real-time pipeline in
libaom, apply adaptive logic to the cyclic refresh
process:
- Static Block Skipping: If a block has virtually zero motion and high similarity to its reference, the encoder can skip boosting it. This avoids wasting bandwidth on areas of the frame that have not suffered from drift or compression loss.
- Motion-Aware Selection: High-motion areas or complex textures are dynamically prioritized to ensure artifacts are resolved quickly before they compound.
- Bit Budget Balancing: To compensate for the higher bit allocation given to the refresh segment, the rest of the frame (the non-refreshed blocks) is coded with slightly higher quantization. This guarantees that the overall frame size remains flat and within the strict target bitrate.
Benefits for Low-Delay Streaming
By replacing discrete keyframes with a continuous intra-refresh cycle, AV1 achieves several critical benefits in real-time scenarios:
- Elimination of Bitrate Spikes: Network transmission remains predictable, preventing queue buildup in network hardware and drastically reducing latency.
- Passive Error Recovery: In the event of minor packet loss, the cyclical refresh of blocks naturally clears visual corruption over a short duration without requiring the receiver to request an expensive Full Intra Request (FIR) or Picture Loss Indication (PLI).
- Consistent CPU and Hardware Utilization: Eliminating large I-frames balances the computational load per frame, preventing encoding bottlenecks on the sender's device and ensuring steady frame pacing.