Chroma subsampling represents colour-difference components on a coarser spatial grid than luma. In YCbCr video, 4:4:4 chroma sampling keeps full sample counts for every component; 4:2:2 chroma subsampling halves the colour-difference count horizontally; 4:2:0 chroma subsampling halves it horizontally and vertically.[ref]
Recommended 8-Bit YUV Formats for Video Rendering by Gary Sullivan and Stephen Estrop. YUV Sampling, definitions of4:4:4,4:2:2 and4:2:0
For an original eight-bit image with no padding or alpha, full sampling uses eight samples in each of three components: 24 bytes. With horizontal halving, the count becomes bytes. Halving in both directions gives bytes. These count active samples, not the allocation overhead of a particular pixel format.
The reduction loses information unless the discarded variations are otherwise constrained. For a stipulated pair of neighbouring samples with constant luma, let one colour-difference channel have values and . Averaging the pair and retaining only the average stores zero. Reconstructing both positions as zero cannot recover which one was originally positive. Fine colour variation can therefore disappear even though both luma samples remain intact.
A low-pass filter before reducing the sampling rate controls aliasing; merely dropping alternate samples need not. Later chroma reconstruction estimates the missing positions. It must respect chroma sample location: equal sample counts do not determine where those samples lie relative to the luma grid. The Microsoft primary guide explicitly distinguishes different 4:2:0 grids and discusses interpolation during format conversion.[ref]
Recommended 8-Bit YUV Formats for Video Rendering by Gary Sullivan and Stephen Estrop. YUV Sampling diagrams; Converting4:2:0 YUV to4:2:2 YUV
Storage organization is independent of this sampling ratio. NV12 interleaves the two reduced components in a second plane, while a fully planar pixel format can store them in separate planes. Rearranging the same samples changes layout, not sampling resolution.
Chroma reconstruction estimates colour-difference values on a desired spatial grid from the samples retained by chroma subsampling. In YCbCr video, chroma upsampling can bring the reduced Cb and Cr arrays onto the luma grid before a full-resolution conversion to RGB. The sampling ratio, chroma sample location and chosen interpolation rule all affect the result.[ref]
For an original one-dimensional example, let a component have codes at and at . Linear interpolation givesAt , this gives 60, while nearest-neighbor interpolation selects 40. Both methods use the same retained samples; they make different assumptions about the values between them.
No reconstruction rule can infer every discarded variation from these two numbers alone. The functionsagree at zero and two, yet at they give 80 and 90. Thus the retained endpoints do not uniquely identify the interior signal. Recovery guarantees require additional restrictions on the signal and sampling process.
A practical reconstruction also specifies how to handle image edges, where a filter may ask for samples beyond the available array. The Microsoft example states its progressive-scan assumption and supplies separate edge equations; those details are part of the method rather than consequences of the ratio 4:2:0.[ref]
Recommended 8-Bit YUV Formats for Video Rendering by Gary Sullivan and Stephen Estrop. Converting 4:2:0 YUV to4:2:2 YUV, assumptions and edge handling
Increasing the number of output samples therefore does not, by itself, restore the original colour detail.Chroma upsampling increases the spatial sample count of the colour-difference components after chroma subsampling. For example, converting 4:2:0 chroma subsampling to 4:2:2 chroma subsampling doubles the vertical colour sample count, while conversion to 4:4:4 chroma sampling also doubles it horizontally.[ref]
Recommended 8-Bit YUV Formats for Video Rendering by Gary Sullivan and Stephen Estrop. Converting4:2:0 YUV to4:2:2 YUV and Converting4:2:2 YUV to4:4:4 YUV
The added values are estimates, not newly measured image detail.An original one-dimensional derivation separates increasing the grid density from interpolation. Start with samples and insert zero-valued placeholders:Apply the chroma interpolation filterIt follows that and . Thus this stipulated filter preserves the original positions and fills the intervening positions by linear interpolation.
The scaling is essential. For a constant input , the correctly scaled result is128 at every output position. Using the ordinary three-tap averaging coefficients on the zero-inserted sequence would instead give64 everywhere. Those coefficients are suitable for a different operation; their unit sum alone does not preserve a constant after zero insertion.
The derivation assumes the retained samples occupy the even positions of the output grid and ignores image boundaries. Centered chroma can require a different alignment, and finite images require an edge rule. The Microsoft example specifies progressive scanning, interpolation and edge handling explicitly.[ref]
Recommended 8-Bit YUV Formats for Video Rendering by Gary Sullivan and Stephen Estrop. 4:2:0-to4:2:2 method and edge equations
Upsampling quality therefore depends on chroma sample location, filter choice and boundary treatment, rather than only on output dimensions.A chroma interpolation filter combines retained colour-difference samples to estimate values at the output locations required by chroma upsampling. It acts on the components of YCbCr separately from full-resolution luma. The filter coefficients and the assumed chroma sample location jointly determine the reconstruction. Microsoft's primary conversion guide gives a four-sample interpolation example and states its progressive-scan and edge-handling assumptions.[ref]
For an original one-dimensional linear interpolation rule, let retained samples lie at positions . Define output samples byThe two coefficient sets, one for each output parity, both sum to one. A constant input is therefore reproduced at every output position. With , and , the outputs through are . The values at odd-integer positions are estimates, while the retained even-integer positions are unchanged.
Higher-order interpolation need not remain between neighbouring input values. As an original exact-arithmetic illustration, take a half-position rule with coefficients applied to four consecutive samples. Their sum is one, so constants are preserved. But the sample sequence yields between the two central samples; yields . Negative coefficients permit overshoot. Quantization and clipping then change the result further. The primary Microsoft example uses these interpolation coefficients with integer rounding and clipping.[ref]
Recommended 8-Bit YUV Formats for Video Rendering by Gary Sullivan and Stephen Estrop. four-sample Cout formula and subsequent interpolation discussion
The same numerical coefficients can produce spatially misplaced colour if their assumed input grid is wrong. Centered chroma and co-sited chroma require their actual coordinates to be respected. At image boundaries, missing neighbours require an explicit extension rule. No choice of chroma interpolation filter can uniquely recover arbitrary colour variation discarded by chroma subsampling.
A chroma sample location specifies where a colour-difference sample is positioned relative to the luma sampling grid. The counts in 4:2:2 chroma subsampling or 4:2:0 chroma subsampling do not fully specify those positions. Co-sited chroma shares selected luma positions; centered chroma lies between them.[ref]
YUV Formats in the Linux Kernel documentation. Subsampling discussion and centered/co-sited examples
Use an original one-dimensional coordinate system with luma samples at integers. A colour-difference grid at is co-sited with every second luma sample. The equally dense grid at is centered between successive pairs. Both contain half as many horizontal samples, but they have different offsets.
Suppose the first two stored component codes are 20 and 100. At the luma position , linear interpolation on the first grid givesOn the second grid it givesThe same stored array and interpolation rule yield different reconstructed values because the sample coordinates differ. An incorrect location convention can therefore shift colour relative to luma without corrupting the byte buffer.
Horizontal and vertical choices also need not match. The Linux documentation illustrates 4:2:0 with horizontally centered and vertically co-sited colour-difference samples.[ref] By contrast, the original grid diagram in 4:2:0 chroma subsampling deliberately chooses centering in both directions. That is an illustration, not a claim that every format follows it.
A framebuffer stride locates rows in computer memory; it does not identify the physical sampling offset. A decoder performing chroma reconstruction therefore needs both the storage layout and the sample-location convention.
Centered chroma, also called interstitially sited chroma, places colour-difference samples between the corresponding luma sample positions along an axis being subsampled. The term centred chroma is the alternative spelling. A simple two-sample average illustrates how this location arises.[ref]
Let the luma-grid coordinate be an integer , and consider an original colour-difference ramp . Averaging consecutive samples before keeping one result per pair givesThe output exactly equals the ramp at . Assigning that average to would shift its interpretation by half a luma-sample spacing. For , the first averages are50,90 and130 at positions0.5,2.5 and4.5.
The location describes the sampling geometry, not an obligation to use only this averaging filter. A more elaborate filter can have the same effective alignment. Nor does horizontal centering force vertical centering: the Linux documentation includes a 4:2:0 chroma subsampling example with horizontal centering and vertical co-siting.[ref]
A decoder performing chroma upsampling must interpret those offsets consistently. Treating centered samples as co-sited chroma can displace reconstructed colour relative to luma while preserving every stored byte. A pixel format's plane arrangement and framebuffer stride describe memory addressing; they do not, by themselves, establish the sample coordinates.
Co-sited chroma places a retained colour-difference sample at the same spatial coordinate as a selected luma sample along the relevant axis. With horizontal reduction by two, an illustrative co-sited grid occupies when luma samples occupy all integer positions. The Linux video documentation distinguishes this from centered chroma.[ref]
Co-siting does not require simply discarding alternate original samples. An original symmetric three-tap filter can produceFor a linear ramp , the terms simplify to . This filter's output is therefore aligned with the middle luma position for the ramp, even though it combines neighbouring samples.
An alternating input shows why filtering matters. Let . Keeping only even-indexed samples without filtering gives the constant148, losing the alternating pattern through aliasing. The stated three-tap filter instead gives at every retained position. This demonstrates suppression of this particular pattern; it does not prove rejection of every frequency that could alias.
Horizontal and vertical alignment are separate choices. A 4:2:0 chroma subsampling grid can be co-sited vertically while centered horizontally. During chroma reconstruction, using the correct coordinates and an appropriate low-pass filter are related but distinct requirements: correct placement cannot undo detail already discarded during sampling.
4:2:0 chroma subsampling keeps the full luma grid while halving each colour-difference component's sampling rate horizontally and vertically. For even width and height , it retains Y samples and samples each of Cb and Cr.[ref]
Recommended 8-Bit YUV Formats for Video Rendering by Gary Sullivan and Stephen Estrop. YUV Sampling,4:2:0 definition
The zero in the notation does not mean that one colour-difference component has disappeared.For an original six-by-four eight-bit image, the active payload iscompared with 72 bytes for 4:4:4 chroma sampling and 48 bytes for 4:2:2 chroma subsampling. Thus the 4:2:0 payload is half the 4:4:4 payload and three quarters of the 4:2:2 payload under these declared assumptions. It averages 12 bits per original pixel, without row padding or alpha.
Both colour components have fewer samples, so chroma reconstruction must estimate values at additional positions before a full-resolution colour conversion. It cannot generally reverse information discarded during downsampling. The chroma sample location also matters: identical counts can correspond to different spatial offsets.
NV12 stores the reduced components as interleaved Cb/Cr pairs after a luma plane; NV21 reverses each pair. A fully planar pixel format can keep the two colour-difference arrays separate. All can carry 4:2:0 sampling, so plane count and pair order must be specified in addition to the sampling ratio.
4:2:2 chroma subsampling keeps the full luma sample count while sampling each colour-difference component at half the horizontal rate and the full vertical rate. Thus a horizontal group with four Y samples has two Cb and two Cr samples.[ref]
For an original sample-count example, let the grid be six positions wide and three rows high. It contains 18 Y samples and nine samples of each colour-difference component. At eight bits per sample, its active payload isThe corresponding 4:4:4 chroma sampling payload is 54 bytes. The reduction is one third, or from 24 to 16 bits per original pixel. These counts omit padding and any alpha channel; they describe a sampling grid rather than every storage API's alignment constraints.
Horizontal fine colour detail can be lost even though the vertical sample count is unchanged. If a colour-difference row alternates between codes 40 and 160 at every luma position, pair averaging gives three samples of 100 on the stipulated six-position row. Interpolating from those averages cannot identify the original alternation. A low-pass filter and an explicit chroma sample location describe how the reduction is performed; the ratio alone does not specify either.
For a grid whose colour samples share the luma row coordinates, chroma reconstruction needs to estimate missing horizontal positions without inventing a missing vertical row. A later conversion to 4:2:0 chroma subsampling additionally reduces the colour sampling vertically. Rearranging the same 4:2:2 samples between packed pixel formats and planar pixel formats changes layout without making that further sampling reduction.
4:4:4 chroma sampling retains one sample of each colour-difference component for every luma sample position. In a YCbCr image, the Y, Cb and Cr sample grids therefore have equal counts. The notation describes sampling density, not the number of bits in a sample.[ref]
For an original eight-bit image, there are four Y samples, four Cb samples and four Cr samples: 12 active bytes. Declare the row-major component arrays to beEvery image location has its own colour-difference values. Averaging each pair of Cb values would discard the alternating pattern; 4:4:4 sampling itself has not performed that averaging.
A planar pixel format can store those three arrays separately. A packed pixel format can instead put each location's three samples together. Both can represent the same 4:4:4 data, while dimensions, framebuffer stride and component order determine how to address the stored bytes.
Full component sampling also does not promise a lossless pipeline. YCbCr conversion can include rounding, and an image compression method can discard information even when its input uses 4:4:4. Conversely, a decoder that expands 4:2:0 chroma subsampling to a full grid by chroma reconstruction has not necessarily restored the original missing colour detail. Equal output counts and preservation of the original samples are distinct properties.
Articles by others on the same topic
Chroma subsampling is a technique used in video compression and image processing that reduces the amount of color information (chrominance) in an image while retaining the luminance information (brightness) relatively intact. This method exploits the human visual system's greater sensitivity to brightness (luminance) than to color (chrominance), allowing for a more efficient representation of images without a significant loss in perceived quality.
