Go under the hood: prediction, transforms, quantization, entropy coding, and psychoacoustics.
Advanced guide

How

Codecs
Work

This page moves from practical explanation toward a more Wikipedia-like view of the moving parts inside modern codecs.

Compression is mostly about removing redundancy, keeping what matters most, and spending bits where the eye or ear will notice them.
Prediction • Transform • Quantization

Core idea

Spatial redundancy: nearby pixels are similar.

Temporal redundancy: nearby frames are similar.

Perceptual limits: humans do not notice every detail equally.

From Choosing
to Understanding

This is where the site stops being mostly buying advice and starts becoming a technical reference: compression tools, trade-offs, and structure.

What this page covers

Video: prediction, transforms, GOPs, entropy coding.

Audio: psychoacoustics, masking, bit allocation.

Delivery: rate control, profiles, decoding limits.

The compression pipeline

Modern codecs differ in details, but many share the same broad pipeline: predict, transform, quantize, and entropy-code the remaining information.

1. Predict what the frame or block should look like
2. Store only the residual difference
3. Transform and quantize that residual
4. Entropy-code the result into a compact bitstream

Video compression concepts

Intra prediction

Instead of coding every pixel directly, codecs often predict a block from nearby pixels in the same frame. Only the prediction error needs to be stored.

Inter prediction

Video frames are usually similar over time. A codec can point to a block in a previous or future frame and store a motion vector plus the remaining difference.

Residuals

Once a prediction is made, the codec stores what is left over. Good prediction means a smaller residual and fewer bits spent.

Mini glossary

Motion vector
A small instruction telling the decoder where a matching block appears in another frame.
Residual
The difference between a prediction and the original content.
Quantizer
A control affecting how much precision is removed to save bits.
Chroma subsampling
Reducing color detail relative to brightness detail, often in formats like 4:2:0.

How to read codec documentation

When you see a technical page or spec, scan for these questions:

  • What prediction tools does it use?
  • How does it handle transforms and quantization?
  • What are the profile and level limits?
  • What decoder support exists in real devices?