Global Brand, Local Voices: A Practical Guide
Video Codecs

Video Codecs Explained: H.264, HEVC, AV1 & VP9

Learn how video codecs work—intra/inter prediction, chroma subsampling, quantization, GOP structure—and compare H.264, HEVC, AV1, and VP9 for your workflow.

A video codec (coder/decoder) is the algorithm that compresses raw video into a manageable bitstream and reconstructs it for playback. Uncompressed 1080p video at 30 frames per second needs roughly 1.5 gigabits per second—no network or storage budget survives that. Codecs routinely shrink video by two to three orders of magnitude while keeping it visually intact, and the four codecs covered in this section—H.264, HEVC, AV1, and VP9—account for the overwhelming majority of video delivered on the internet today.

They are also the codecs our platform is built on. Codec strategy sits at the core of Videospan's rendering pipeline—every recording we capture, every brand-compliant edit we produce, and every variant we deliver depends on the decisions documented here—so we document them openly, the same way we make them.

How video compression works

Every modern lossy video codec uses the same fundamental toolkit. The differences between codecs are mostly in how finely each tool is tuned.

Prediction: don't send what's already known

Raw frames are mostly redundant. Within a single frame, neighboring pixels are usually similar, so intra prediction extrapolates a block from the pixels above and to its left, and only the residual difference is stored. Across frames, most of the picture barely changes, so inter prediction finds matching blocks in previously encoded frames and stores a motion vector plus a small residual instead of the pixels themselves. Residuals are tiny compared to raw pixel data—that is where the savings come from.

Chroma subsampling

Human vision resolves luminance (brightness) far better than chrominance (color). Codecs exploit this by storing color at a lower resolution than brightness. In 4:2:0, the dominant format for delivery, each 2×2 block of pixels shares a single chroma sample—half the color resolution in each dimension, a 50% reduction in chroma data with almost no visible loss for natural content. Professional acquisition formats use 4:2:2, and mastering formats use 4:4:4 (no subsampling). Try the difference yourself:

Left of the purple line: original. Right: chroma subsampled (4:2:0, ½ horizontal + vertical chroma). Luma stays at full resolution — only color detail is shared between pixels.

4:2:0 is why most codecs treat the frame as a grid of 16×16-pixel units: 16×16 luma samples plus two 8×8 chroma samples.

Transform and quantization

The residual is converted from pixels into frequency coefficients using a transform related to the discrete cosine transform (DCT). Slowly changing areas concentrate energy into a few low-frequency coefficients; detail and noise scatter into high-frequency ones. Quantization then divides those coefficients by a step size and rounds—deliberately throwing away precision the eye is unlikely to miss. The quantizer step size is the single most important quality dial in any encoder: raise it and the file shrinks but blocking artifacts appear; lower it and quality rises at the cost of bits.

Each 8×8 block is transformed with a DCT and its coefficients are quantized with the JPEG luminance table. Higher QP coarsens the quantization: high-frequency coefficients collapse to zero, leaving blocking and mosquito noise around edges.

Everything after quantization—coefficients, motion vectors, prediction modes—is compressed losslessly by an entropy coder (CAVLC, CABAC, or an arithmetic coder, depending on the codec).

Group of Pictures (GOP)

Inter prediction creates chains of dependency between frames, organized into a Group of Pictures:

IintraBbidirectionalBbidirectionalPpredictedBbidirectionalBbidirectionalPpredictedBbidirectionalBbidirectionalIintraone GOP (Group of Pictures) — display order · I (intra) · P (predicted) · B (bidirectional)

An I-frame is coded independently, like a still image. P-frames predict from earlier frames; B-frames predict from frames before and after them and compress best. A GOP runs from one I-frame to the next. Longer GOPs mean smaller files but slower seek times and harder editing; adaptive streaming typically locks GOP length to the segment duration (2–6 seconds) so every segment starts with a clean I-frame.

Codec comparison at a glance

H.264 / AVCHEVC / H.265VP9AV1
Year finalized2003201320132018
Standardized byITU-T / MPEG (JVT)ITU-T / MPEG (JCT-VC)Google (open spec)Alliance for Open Media
Largest block unit16×16 macroblock64×64 coding tree unit64×64 superblock128×128 superblock
Compression vs H.264Baseline~50% fewer bits at same quality~50% fewer bits~30% fewer bits than HEVC
LicensingRoyalty-bearingRoyalty-bearing, multiple poolsRoyalty-freeRoyalty-free
Hardware decodeUniversalWidespread since ~2015Broad (Android, TVs)Growing since 2020
Browser supportUniversalSafari, Edge; others via hardwareChrome, Firefox, EdgeChrome, Firefox, Edge, Safari
Typical roleUniversal delivery4K/HDR, Apple ecosystemYouTube, WebMNext-generation VOD delivery

The practical read: H.264 is the floor everything supports, HEVC is the efficiency play where hardware and licensing allow, AV1 is where streaming economics are heading, and VP9 is the open bridge between them.

H.264 / AVC

Ratified in 2003 and still the most widely supported codec ever made. H.264 encodes 16×16 macroblocks with CAVLC or CABAC entropy coding and decodes in hardware on effectively every device shipped in the last fifteen years. If a file must play everywhere without question, it is H.264 in an MP4 container. Read the H.264 guide →

HEVC / H.265

Finalized in 2013, HEVC roughly halves H.264's bitrate at the same quality by partitioning frames into coding tree units up to 64×64 and expanding to 35 intra prediction modes. It anchors 4K and HDR delivery—especially in the Apple ecosystem—but its multi-pool patent licensing has pushed much of the streaming industry toward royalty-free alternatives. Read the HEVC guide →

AV1

Released in 2018 by the Alliance for Open Media, AV1 is royalty-free by design and delivers roughly 30% better compression than HEVC, using superblocks up to 128×128 and tools like CDEF filtering and film grain synthesis. Encoding was historically slow, but SVT-AV1 has made it practical at scale. YouTube and Netflix already ship AV1 broadly, and hardware decode has spread across GPUs, phones, and TVs since 2020. Read the AV1 guide →

VP9

Google's royalty-free codec from 2013, VP9 offered H.264-beating compression years before AV1 arrived and has been YouTube's workhorse ever since. It remains a solid choice for WebM delivery to Chrome, Firefox, and Android audiences, though new deployments increasingly skip it in favor of AV1. Read the VP9 guide →

Glossary

CodecCoder/Decoder

The algorithm (and its software or hardware implementation) that compresses video into a bitstream and decodes it back for playback. Distinct from a container, which wraps the bitstream with audio and metadata.

GOPGroup of Pictures

A sequence of frames beginning with an independently coded I-frame, followed by predicted P-frames and B-frames. GOP length trades file size against seek and edit granularity.

Chroma subsampling

Storing color information at lower spatial resolution than brightness (e.g., 4:2:0), exploiting the eye's lower sensitivity to color detail.

Quantization

The lossy step that reduces the precision of transform coefficients, controlling the bitrate-versus-quality tradeoff.

BitrateData rate

The number of bits used per second of video, usually in Mbps. Higher bitrate generally means higher quality—up to the codec's efficiency limit.

Entropy coding

The final lossless compression stage (CAVLC, CABAC, or arithmetic coding) that packs symbols into the fewest possible bits.