H.264 has two entropy coders. Constrained Baseline uses CAVLC and High Profile adds CABAC. Both code the same motion vectors and coefficients, so at a fixed quantizer the decoded picture is the same and only the number of bits changes. We measured that difference on our own encoder: IronH264 for Baseline, and the High Profile extension that plugs into it.
The two coders
CAVLC codes each block of coefficients with variable-length tables, chosen from the neighboring blocks. It is simple, and it works in whole bits: the shortest code is one bit, however likely the symbol.
CABAC turns every syntax element into binary decisions and codes each one with an arithmetic coder. A context model tracks how likely each decision is and adapts as the picture is coded. A very likely decision costs a fraction of a bit. The cost is a serial coding loop and the context memory.
High Profile also allows an 8 × 8 transform for inter-predicted luma. A larger transform packs smooth areas into fewer coefficients and does worse on fine detail, so the extension can fix the choice or select per macroblock.
Board measurements at 1080p30
These are from a Nexys Video with two encoder engines at 90 MHz and constant QP 28. The inputs are identical across the columns.
| Input | Baseline CAVLC | High Profile CABAC | Saving |
|---|---|---|---|
| Motion and noise pattern | 27.23 Mb/s | 23.83 Mb/s | 12.5% |
| Scrolling bars | 0.52 Mb/s | 0.25 Mb/s | 52% |
| Ten-minute soak | 27.54 Mb/s, 18,002 pictures | 24.02 Mb/s, 18,002 pictures | 12.8% |
The two inputs sit at opposite ends. The scrolling bars are almost all skipped macroblocks and zero residual, which is where one-bit minimum codes hurt CAVLC most, so CABAC halves the rate. The noise band is near-random data that no entropy coder compresses well, and the saving falls to about an eighth. Real camera scenes land between those two.
Where Baseline wins
CABAC is not always smaller. In RTL simulation over two P pictures, a short 1080p sequence of moving objects took 2,640 bits with Baseline and 3,016 with CABAC. CABAC's context models start from fixed states at every slice and adapt as they code, so a slice with very little data gives them little to adapt on. That is the likely cause here. The engines also split the picture into bands with at least one slice each, which shortens the slices further.
| Simulation, bits in two P pictures | Baseline | CABAC 4 × 4 | CABAC fixed 8 × 8 |
|---|---|---|---|
| 720p scrolling bars | 16,728 | 8,528 | 8,368 |
| 720p pan | 9,464 | 7,320 | 7,800 |
| 1080p moving objects | 2,640 | 3,016 | 3,016 |
The pan shows the transform trade as well: fixed 8 × 8 used more bits than 4 × 4 on that content. These are synthetic scenes, so evaluate with pictures that look like the product's.
What it costs in logic
The CABAC-only netlist in the demo image is 2,719 LUTs and 1,295 flip-flops on the XC7A200T at 90 MHz. The parent encoder keeps its prediction, motion search, picture memory and NAL packing; the extension replaces the entropy stage and, when selected, the inter-luma transform path. Registers, DDR buffers and the bitstream rings are the same, so software written for Baseline runs unchanged and reads the available tools from a status register.
Choosing
Baseline decodes on everything and is the right start for a link with bit rate to spare. High Profile earns its place when the link is the limit: a radio, a shared uplink or recorded storage. Software players such as VLC and ffplay decode High Profile. Check a fixed-function receiver before committing to it.
A change of profile forces an IDR picture, so a receiver decodes through the transition. The timed demo for the Nexys Video shows this: it runs High Profile for 30 minutes, then continues the same stream in Baseline. In the recorded run the change came 1,799.82 seconds after configuration, and the receiver logged 59,404 pictures over 1,980 seconds with none dropped.