encoding.info
You are hereSourcePredictionTransformEntropy codingFiltersFramesDecisionsRate controlPerceptionQualityBitstreamSettingsEncoder map
Page 2 of 4 in Pictures as numbers

Chroma subsampling

Pictures as numbers · concept · added 2026-11-14

You'll want firstPixels, luma and chroma
In Brief:
The two color planes are stored at a lower resolution than luma, before encoding starts. In 4:2:0 that halves the samples in a frame, and the cost can show on sharp, saturated color edges.

Chroma subsampling stores the two chroma planes at a lower resolution than the luma plane. In 4:2:0, the format x264 and x265 use unless told otherwise, each chroma plane has half the width and half the height, so a frame holds half the samples it would with every plane at full size. It is done before encoding: the encoder is handed the smaller planes.

Three formats

4:4:4 luma
8 samples
4:4:4 chroma
8 Cb + 8 Cr
4:4:4 picture
3 per pixel
4:2:2 luma
8 samples
4:2:2 chroma
4 Cb + 4 Cr
4:2:2 picture
2 per pixel
4:2:0 luma
8 samples
4:2:0 chroma
2 Cb + 2 Cr
4:2:0 picture
1.5 per pixel
Conceptual illustration, computed with this page's formulas: a patch of eight pixels in colors taken from the cat. Luma is kept for every pixel. Chroma is kept for every pixel (4:4:4), averaged over each pair side by side (4:2:2), or averaged over each group of four (4:2:0); it is drawn as the color it gives at a middle luma. In the picture, pixels that share a chroma value differ only in luma. A shared value is drawn as one wide cell: the format name gives the sampling density, and where a real chroma sample sits follows the format's conventions and any chroma location information in the stream.

Compare chroma reduction with luma reduction

The cat is split into luma and chroma. Choose which planes to reduce, then by how much. Chroma planes gives the three named formats. Luma plane is an artificial comparison, not a video format: the same reduction applied to luma, with chroma left whole. Every choice starts from the same original planes. A reduced plane is made by averaging each group of samples and is rebuilt by repeating each stored value across its group.

Samples per pixel counts stored values. The three errors are mean squared errors against the source: for the luma plane, for the two chroma planes together, and for the rebuilt picture over red, green and blue. The luma and chroma errors are on different scales; the picture error puts both kinds of reduction in the same units. In the Error panel mid-gray means no change, and differences are multiplied by 4.

Every pixel is drawn enlarged, so a color edge that spreads by one pixel is easy to see here. These comparisons show where this filter changes this cat. They do not compare equal bitrates or equal sample counts, and they do not predict what a viewer will notice at normal size.

Source
Stored, enlarged
Rebuilt
Error, ×4
Samples per pixel
Luma error
Chroma error
Picture error
Simplified demo: the cat is invented, and so are the filters. Averaging and repeating are the simplest choices; real converters use longer filters, and the conversion happens outside the codec. In the Stored panel each stored sample is drawn across the area it represents, and the line under it gives the number actually stored; the chroma view shows Cb, and Cr is reduced the same way. Planes are full-range integers from 0 to 255, and rebuilt values outside that range are limited to it. With no reduction the picture error is 0.27, the rounding of the color conversion itself. Error panel values past black or white are clipped; the readouts use the full values. Samples are not bits.

For this cat:

Why chroma

The choice leans on vision, not on arithmetic. In Mullen's 1985 experiment, for the gratings and conditions tested, viewers were less sensitive to fine stripes that varied only in color than to fine stripes of one color that varied in brightness. Results of that kind are the reason given for giving up chroma detail first. They are not a cutoff below which losing color is safe. This is a property of viewers, covered in What the eye misses, and the demo above does not test it.

Chroma formats in x264 and x265

FormatChroma planeSamples per pixelx264 profile
4:4:4Full size3High 4:4:4 Predictive
4:2:2Half width2High 4:2:2
4:2:0Half width, half height1.5Set by bit depth and tools

In x264 --output-csp chooses the format, i420 unless set, and the program converts the input to it before encoding. The format, together with bit depth, coding tools and lossless coding, picks the profile; the table shows the usual lossy case, and a decoder has to support the profile chosen. --chromaloc labels where chroma samples sit. It resamples nothing, and x264 writes it only for 4:2:0 and values 1 to 5. In 4:2:0 a displacement of a quarter of a luma sample is an eighth of the spacing between chroma samples: the motion is the same and the units differ. mc_chroma reads the low three bits of a vector as that offset and blends the four nearest chroma samples; luma works in quarters.

In x265 --input-csp sets the format the encoder works in, 4:2:0 unless set. 4:2:0 at up to 10 bits gets the Main or Main 10 profile, apart from intra-only and single-picture encodes; every other format gets a range extensions profile.

Trade-offs

Sources

Read 2026-11-14, at the commits linked.