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.
Articles by others on the same topic
There are currently no matching articles.