Chroma subsampling
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
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.
For this cat:
- 4:2:0 chroma stores 1.5 samples per pixel. Luma is untouched, the chroma error is 96.7, and the picture error is 189.
- The error sits on color edges. In the Error panel it follows the collar, the eye, the ears and the outline of the head; inside the fur and the sky there is close to none.
- 4:2:2 leaves less error. 2 samples per pixel, chroma error 57.5, picture error 113.
- The same reduction applied to luma leaves more picture error here. Half width and height on luma keeps 2.25 samples per pixel and gives a picture error of 292, against 189 with 1.5 samples when the two chroma planes are reduced.
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
| Format | Chroma plane | Samples per pixel | x264 profile |
|---|---|---|---|
| 4:4:4 | Full size | 3 | High 4:4:4 Predictive |
| 4:2:2 | Half width | 2 | High 4:2:2 |
| 4:2:0 | Half width, half height | 1.5 | Set 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
- 4:2:0 halves the samples before the encoder starts. 1.5 per pixel against 3. How many bits that saves after compression is not something a sample count shows.
- Sharp, saturated color edges can blur or bleed. The collar against the sky is this cat's example.
- The decoder has to support the format, bit depth and profile actually used. Which devices support which was not checked for this page.
- Converting back and forth is not free. Each reduction and enlargement is a filter, and its error stays in the picture.
Sources
Read 2026-11-14, at the commits linked.
- x264 at commit c24e06c (GitHub mirror): the
--output-csphelp and its default, the format forced on the filter chain and the conversion inx264.c; the library's default format incommon/base.c; the chroma format, the profile choice and the chroma location condition inencoder/set.c; which formats halve the width and the height incommon/common.h;mc_chromaincommon/mc.c. - x265 at commit 4191822 (GitHub mirror): the default format and
input-cspinsource/common/param.cpp; the profile choice insource/encoder/level.cpp. - K. T. Mullen, The contrast sensitivity of human colour vision to red-green and blue-yellow chromatic gratings, Journal of Physiology 359 (1985), abstract only.
- Not checked: what the three numbers in a format's name stand for; the chroma sample positions the standards define; the filters real converters use; H.264 and High Efficiency Video Coding text on chroma formats (the H.264 edition read for this unit predates its 4:2:2 and 4:4:4 profiles); which decoders support which profiles; libaom and SVT-AV1; the rest of Mullen's paper.