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 , defineHere denote normalized colour differences before digital scaling. For nominal eight-bit video codes, the corresponding relationships areThese 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.
New to topics? Read the docs here!