Abstract
This paper presents a high-performance, 4-way parallel architecture for Context-Based Adaptive Variable Length Coding (CAVLC) in H.264/AVC video encoders. By employing a two-stage pipeline and a novel "vlc-look-ahead" technique to resolve data dependencies, the design achieves real-time 4K resolution at 60fps with significantly reduced clock cycles per macroblock compared to existing state-of-the-art architectures.
Introduction
H.264/AVC remains a dominant standard in video compression. A critical component of this standard is Context-Based Adaptive Variable Length Coding (CAVLC), an entropy coding method used to translate quantized coefficients into a compact bitstream. However, CAVLC is inherently serial; for instance, the coding of a "Level" (coefficient magnitude) depends on the previous magnitude to select the appropriate Variable Length Coding (VLC) table. This serial dependency creates a significant bottleneck for high-resolution video processing, such as 4K (Ultra HD), where hardware must handle millions of pixels per second. Previous solutions often required excessively high clock speeds or too many cycles per macroblock (MB) to achieve 4K@60fps.
Proposed Hardware Architecture
To address these throughput limitations, the proposed architecture utilizes multi-level parallelism across two primary stages: a Scan Engine and an Encode Engine.
Two-Stage Pipelining
The design splits the CAVLC process into a Scan Engine and an Encode Engine. These stages operate concurrently on different 4x4 blocks, ensuring high hardware utilization. Both stages are balanced to consume exactly four cycles per 4x4 block, preventing pipeline stalls.
4-Way Parallel Scan Engine
The Scan Engine processes four coefficients per clock cycle. It utilizes specialized state bits to rapidly calculate essential parameters such as TotalCoeff (total non-zero coefficients) and TrailingOnes.
Parallel Encode Engine with VLC Look-Ahead
The core innovation is the vlc-look-ahead technique within the Encode Engine. Traditionally, Level encoding is serial because the VLC table index for the current coefficient depends on the value of the previous one. The look-ahead logic pre-calculates potential table shifts for four coefficients simultaneously, effectively bypassing the serial chain. Additionally, the engine encodes four "Run_before" symbols at once.
Bitstream Packing
A dedicated bitstream packer merges the results from the parallel encoders into the final output stream within four cycles per block, maintaining the overall throughput.
Performance and Results
The architecture was implemented in Verilog HDL and synthesized using SMIC 0.13µm CMOS technology.
Cycle Efficiency
The design achieves a maximum of 120 cycles per Macroblock, with an average of approximately 90 cycles in typical scenarios. This represents a substantial improvement over prior works, which typically required between 250 and 500 cycles per MB.
Throughput and Hardware Efficiency
Operating at a core frequency of 250 MHz, the design successfully supports real-time 4Kx2K @ 60fps encoding. The authors introduced a "Design Efficiency" metric—factoring in resolution, frame rate, gate count, and frequency—where this design achieved a normalized efficiency of 1.0, significantly outperforming previous architectures by Chen et al. (0.40) and Yi et al. (0.25).
Conclusion
The proposed 4-way parallel CAVLC architecture effectively breaks the serial dependencies inherent in H.264 entropy coding. By balancing a two-stage pipeline with novel look-ahead logic, the design provides the necessary throughput for 4K@60fps video encoding while maintaining high hardware efficiency. Future work may involve adapting these parallel techniques for newer standards like HEVC or VVC.
Summary updated