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 by
The 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]
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.
Chroma reconstruction 2026-11-05
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 gives
At , 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 functions
agree 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] Increasing the number of output samples therefore does not, by itself, restore the original colour detail.
Chroma upsampling 2026-11-05
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] 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 filter
It 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] Upsampling quality therefore depends on chroma sample location, filter choice and boundary treatment, rather than only on output dimensions.
Color component 2026-11-05
A color component is one numerical coordinate used by a color model to describe a colour. An RGB representation has red, green and blue components, while YCbCr has luma and two colour-difference components. Their meanings depend on the model and encoding: a component need not represent a separately emitted primary light. The Microsoft technical guide explicitly separates RGB signals from Y, Cb and Cr and gives their conversion equations.[ref]
For an original normalized Linear-light RGB example, the triple contains three component values for one colour sample. Its blue component is ; that scalar alone does not specify the complete colour. A second triple shares that blue component while differing in red and green. Likewise, the same numerical triple interpreted in different color spaces need not describe the same physical colour.
A component is also distinct from a storage plane. An eight-bit packed pixel format can place three RGB component codes in three successive bytes for each pixel, all in one image memory plane. NV12M instead uses a luma plane and an interleaved colour-difference plane: two memory planes carry three color components. Chroma subsampling can additionally give the components different spatial sample counts.
An alpha channel describes transparency or coverage rather than another coordinate of the colour itself. PNG consequently distinguishes truecolour samples with red, green and blue components from truecolour-with-alpha samples that carry an additional alpha value.[ref] Component identity, sample location, numerical encoding and storage layout together determine how an image is interpreted.
Gary Sullivan 2026-11-05
An original neutral-gray example isolates code range conversion from memory layout. Take eight-bit computer RGB inputs , with codes from 0 to 255. Since the three coefficients in the guide's luma combination sum to one, the combined gray value is regardless of which of its two coefficient sets is selected. For its eight-bit nominal video coding, use
Thus gray 64 becomes , while gray 192 becomes . The separation of the two stored luma codes is 110 rather than 128. These values follow the stipulated input/output ranges and nearest-integer rounding; copying an RGB component directly into the luma slot would implement a different mapping.[ref]
Changing a pixel format can rearrange those same codes without performing this conversion. Conversely, converting every pixel's three components does not itself require chroma subsampling. Keeping these operations separate is a practical contribution of the jointly authored guide; no individual authorship of its formulas is inferred.
Luma (video) 2026-11-05
Luma is a video signal formed by combining nonlinear RGB component signals. It is conventionally written , with the prime warning that the components have already undergone a nonlinear encoding. It differs from physical luminance, which describes light with a photometric scale.
Under Recommendation ITU-R BT.709-6,
The coefficients sum to one, so a neutral signal has luma . The same recommendation specifies a nonlinear conversion from a normalized linear primary signal :
The primed components are formed separately before combining them.[ref]
An original calculation shows why the order matters. For a linear red primary , the primed triple is also and luma is 0.2126. Combining the linear channels first gives normalized linear luminance ; applying to that scalar gives approximately 0.4485. Thus
Nonlinear encoding does not commute with this channel combination.
In YCbCr, luma is stored alongside colour-difference information. Chroma subsampling can preserve the luma sampling grid while reducing the other components' sampling. A luma image can therefore retain fine spatial variation without carrying every colour distinction of the original image; it is not a complete colour description.
NV12 2026-11-05
NV12 is an eight-bit YCbCr semiplanar pixel format with 4:2:0 chroma subsampling. A full-resolution plane holds luma samples. The following plane stores alternating Cb and Cr samples, with half as many sample positions in each spatial direction. Linux specifies ordinary untiled NV12 with adjacent planes; the separately allocated variant is NV12M.[ref]
For even dimensions , active samples occupy luma bytes plus interleaved colour-difference bytes. This is bytes, or an average of 12 bits per original pixel. It does not give every pixel its own three-component triple: neighbouring pixels share the lower-resolution colour-difference samples.
For an original address calculation, choose width six, height four and an eight-byte framebuffer stride in both planes. Put the first luma row at address 1000. The luma allocation occupies bytes, so the colour-difference plane starts at 1032 and occupies another bytes. There are 36 active bytes in 48 allocated bytes, including row padding.
With zero-based indices, luma position is at . Its associated subsampled grid cell has indices in this declared layout. That cell's Cb and Cr bytes are at 1044 and 1045. Colour reconstruction additionally needs a sampling-location and filtering convention; these address calculations alone do not specify it.
The pixel format identifies storage. A decoder must also know the YCbCr matrix and code ranges to interpret the numbers as colour.
NV21 2026-11-05
NV21 is an eight-bit YCbCr semiplanar pixel format using 4:2:0 chroma subsampling. It has a full-resolution luma plane followed by interleaved colour-difference samples in Cr, Cb order. NV12 uses the reverse pair order, Cb, Cr. The separately allocated Linux variant is NV21M.[ref]
An original tightly stored image has eight luma bytes followed by four colour-difference bytes. Suppose the latter are 200 40 150 90. Under NV21, the two pairs are and . Reading the same bytes as NV12 instead assigns and . The buffer length remains correct while its colour-difference channels are exchanged.
Converting this declared NV21 buffer to NV12 requires swapping adjacent bytes in the interleaved plane, giving 40 200 90 150, while retaining the luma data. This is a layout conversion, not a conversion to the RGB color model. The numerical colour interpretation still depends on the declared YCbCr encoding.
The active footprint is bytes for even width and height under eight-bit 4:2:0 sampling. Framebuffer stride can add padding, so the next row need not start immediately after the last active sample. A converter must apply the actual row and plane boundaries: swapping pairs across padding or across the luma plane would corrupt the image rather than exchange the intended channels.
Semiplanar pixel format 2026-11-05
A semiplanar pixel format combines a separate sample plane with another plane containing interleaved components. A common YCbCr arrangement stores luma samples in one plane and pairs of colour-difference samples in another. It therefore has two planes while representing three components. Linux's video API distinguishes this from the three separate planes of a fully planar pixel format.[ref]
In NV12, one byte represents each sample. Chroma subsampling halves the colour-difference sampling count in both directions, and the second plane stores Cb followed by Cr in each pair. NV21 reverses that pair order. For even width and height , tightly stored active samples occupy
Thus a stipulated image contains eight Y samples and two Cb/Cr pairs: 12 active bytes. The eight Y bytes can be followed by Cb00 Cr00 Cb01 Cr01. The component names identify stored codes; their colour interpretation also requires the declared YCbCr conventions.[ref]
Active sample count differs from allocated storage. With an eight-byte framebuffer stride for both planes in this example, two Y rows and one interleaved row occupy bytes including padding. A consumer needs dimensions, strides, component order and whether planes are adjacent or separately allocated. Reinterpreting NV21 as NV12 swaps the two colour-difference components; it does not recover the intended colours merely because the buffer size matches.
YCbCr 2026-11-05
YCbCr represents colour using a luma component and two scaled colour-difference components. It is a family of encodings: the matrix coefficients, numerical ranges and color space must be specified. Recommendation ITU-R BT.709-6 defines one important set of signal and digital-coding conventions.
For its normalized nonlinear RGB signals , define
Here denote normalized colour differences before digital scaling. For nominal eight-bit video codes, the corresponding relationships are
These are the recommendation's signal equations and quantization scales, with nearest-integer rounding applied at the end and half-integers rounded upward.[ref]
For an original red example, gives , and . The rounded code triple is approximately . Neutral gray instead gives , hence neutral colour-difference codes 128 regardless of gray level. An RGB triple cannot simply be copied into the YCbCr component slots.
This conversion alone need not reduce the number of samples. Chroma subsampling separately reduces the spatial sampling of the colour-difference components. NV12 and NV21 additionally specify how those samples occupy computer memory. A colour conversion, a sampling choice and a storage layout therefore describe three different operations.