A macroblock is the fundamental coding unit of H.264 and the earlier MPEG codecs (MPEG-1, MPEG-2, MPEG-4 Part 2). Each frame is divided into a regular grid of macroblocks always 16×16 pixels in size, and the encoder processes each macroblock as a single decision unit: pick a prediction mode for it, transform its residual, quantize, entropy-code, move to the next. The macroblock is the H.264 era's answer to "what's the smallest piece of video that gets handled as one thing".

The fixed 16×16 size made H.264 efficient to implement in hardware and software, and it worked well for SD and early HD content. But it became a limitation as resolutions grew. A 4K frame has ~32,000 macroblocks; a single 16×16 block in the middle of a clear sky carries almost no information but still has its own header overhead, while a 16×16 block over an eye doesn't have enough granularity to capture detail efficiently. The single fixed size made trade-offs in both directions.

The successor codecs solved this by abandoning the macroblock. HEVC introduced ctu (Coding Tree Units) up to 64×64 that the encoder can split recursively where detail demands it. AV1 has 128×128 superblocks with the same recursive partitioning idea, plus rectangular splits. For a product team, the macroblock is mostly historical context for understanding why each codec generation got more efficient — moving away from one-size-fits-all blocks toward content-adaptive partitioning is one of the biggest reasons HEVC and AV1 beat H.264 on the same bitrate.

Book cover: Video Encoding, Volume 1 of the Fora Soft Video Engineering Handbook

The book · Volume 1 of 7

Video Encoding: A Complete Guide to Video Compression — From Pixels and Color to H.264, HEVC, AV1, Quality Metrics, and AI

The macroblock is H.264's fixed 16x16 unit, and its size limits how well large flat areas compress compared with HEVC and AV1. Volume 1 covers the macroblock in detail: block-based prediction, macroblocks versus CTUs and superblocks, partitioning, and how block size shapes bitrate and artefacts. Written by Nikolay Sapunov, CEO at Fora Soft.

Read it on Amazon →Kindle & paperback · Fora Soft Video Engineering Handbook

Wondering if moving off macroblock-based H.264 is worth it for your content?

Send us sample content: we encode it with H.264, HEVC and AV1 and show the bitrate saved by larger blocks at equal quality. 250+ video products shipped since 2005.

Book a 30-min call →WhatsApp →Email us →