Ch. 3 · Anatomy of a Hybrid Codec

한국어日本語
8 min

Block Partitioning in Video Codecs: Macroblocks, Quadtrees and QTBT

How a codec cuts each frame into blocks, from AVC macroblocks to HEVC quadtrees and VVC's binary and ternary splits, and why finer isn't always better.

A codec doesn't handle a whole frame at once. It splits the frame into small blocks and applies different tools (prediction direction, transform size) to each. Why split? A flat region like sky is fine with one large block, but complex regions like a human face or leaves have to be cut finely to preserve detail.

Partitioning by generation

CodecLargest unitPartitioningSmallest unit
H.264/AVC16×16 macroblockSplit down to 8×8; each 8×8 can be sub-split down to 4×44×4
HEVC64×64 CTUQuadtree (recursive four-way splits)8×8 (4×4 for transforms)
VP964×64 superblockQuadtree + some rectangular splits4×4
AV1128×128 superblockQuadtree + 10 split types (T-shaped, rectangular, etc.)4×4
VVC128×128 CTUQTBT+T — a mix of quad, binary, and ternary trees4×4
Sky (simple) no split Leaves Edge Face (complex) Plain background no split
Quadtree partitioning — split only the complex areas finely and leave simple areas large

HEVC's QT — the quadtree

HEVC starts from a 64×64 CTU (Coding Tree Unit) and, where needed, recursively repeats four-way splits: 64→32→16→8. Each leaf node is a CU (Coding Unit), and a CU can be further divided into a PU (Prediction Unit) for prediction and a TU (Transform Unit) for the transform.

VVC's QTBT+T — where it gets truly flexible

A quadtree that only produces squares has limits. A thin, long railing or a horizon line, for example, is cut more efficiently with rectangles than with squares. VVC mixes three kinds of splits.

Split typeShapeDescription
QT (Quad-Tree)Four squaresThe same basic split as HEVC
BT (Binary-Tree)Two rectanglesSplits in half, horizontally or vertically
TT (Ternary-Tree)Three parts in a 1:2:1 ratioLeaves the middle part thick. Good for capturing object boundaries

Thanks to QTBT+T, the CU/PU/TU distinction in VVC all but disappears and a single CU takes on most of the roles — the structure actually became simpler.

QT BT (horizontal / vertical) TT (1:2:1)
VVC split types — flexible shapes beyond squares

AV1's partitions — ten kinds of freedom

From a 128×128 superblock, AV1 supports up to 10 split types, including squares, rectangles, and even T-shaped (4-way partial) splits. The approach differs from HEVC/VVC, but the goal is the same — find the shape that fits the content boundaries as closely as possible.

In practice — partitioning isn't free

The finer you split, the better the detail is represented, but signaling the partitioning itself costs bits. Each block also needs its own mode information (prediction direction, reference frame, and so on). So deciding 'how finely to split' is also a job for the RDO from Chapter 2 — each time, the encoder computes whether the quality gained by splitting outweighs the cost (R) of splitting. This is one of the most compute-heavy parts of an encoder.

MacroblockMacroblock

The fixed-size (16×16) top-level partitioning unit of H.264 and earlier generations. The predecessor of the CTU.

CTU / CUCoding Tree Unit / Coding Unit

The top-level partitioning unit (CTU) since HEVC and its leaf node (CU).

QTBT+TQTBT+T

VVC's partitioning scheme. A mix of quad, binary, and ternary trees.

PU / TUPrediction Unit / Transform Unit

Subdivisions of a CU in HEVC, for prediction and for the transform respectively.

SuperblockSuperblock

The top-level partitioning unit of VP9/AV1 (64×64 / 128×128).

Check yourself

What is the fundamental reason VVC added binary (BT) and ternary (TT) splits to HEVC's quadtree?

Check yourself

What is the cost of splitting blocks more finely?