10bit and 16-bit YUV video format
微软操作系统中的10bit和16bit存储方式
This topic describes the 10- and 16-bit YUV formats that are recommended for capturing, processing, and displaying video in the Microsoft Windows operating system.
这个主题描述了10 -推荐用于捕获和16位YUV格式,处理和显示视频在Microsoft Windows操作系统。
The 16-bit representations described here use little-endian WORD values for each channel. The 10-bit formats also use 16 bits for each channel, with the lowest 6 bits set to zero, as shown in the following diagram.
这里描述的16位表示为每个通道使用little - endian词值。10位格式也使用16位每通道,最低的6位设置为0,如下列图所示。
Because the 10-bit and 16-bit representations of the same YUV format have the same memory layout, it is possible to cast a 10-bit representation to a 16-representation with no loss of precision. It is also possible to cast a 16-bit representation down to a 10-bit representation. (The Y416 and Y410 formats are an exception to this general rule, however, because they do not share the same memory layout.)
由于相同YUV格式的10位和16位表示具有相同的内存布局,因此可以将10位表示转换为16位表示,而不会丢失精度。也可以将16位表示转换为10位表示。(然而,Y416和Y410格式是此一般规则的例外,因为它们不共享相同的内存布局。)
When the graphics hardware reads a surface that contains a 10-bit representation, it should ignore the low-order 6 bits of each channel. If a surface contains valid 16-bit data, however, it should be identified as a 16-bit surface.
当图形硬件读取包含10位表示的曲面时,应忽略每个通道的低阶6位。但是,如果曲面包含有效的16位数据,则应将其标识为16位曲面。
For images in video memory, the graphics driver selects the memory alignment of the surface. The surface must be DWORD aligned. That is, individual lines within a surface are guaranteed to start at a 32-bit boundary, although the alignment can be larger than 32 bits. The origin (0,0) is always the upper-left corner of the surface.
对于视频内存中的图像,图形驱动程序选择曲面的内存对齐方式。曲面必须与DWORD对齐。也就是说,虽然对齐可以大于32位,但曲面内的各条线保证从32位边界开始。原点(0,0)始终是曲面的左上角。
The FOURCC codes for the formats described here use the following convention:
- If the format is planar, the first character in the FOURCC code is ‘P’. If the format is packed, the first character is ‘Y’.
- The second character in the FOURCC code is determined by the chroma sampling, as shown in the following table.
Chroma sampling | FOURCC code letter |
---|---|
4:4:4 | ‘4’ |
4:2:2 | ‘2’ |
4:2:1 | ‘1’ |
4:2:0 | ‘0’ |
- The final two characters in the FOURCC indicate the number of bits per channel, either ‘16’ for 16 bits or ‘10’ for 10 bits.
Using this scheme, the following FOURCC codes have been defined. No 4:2:1 formats for 10-bit or 16-bit YUV have been defined at this time.
FOURCC | Description |
---|---|
P016 | Planar, 4:2:0, 16-bit. |
P010 | Planar, 4:2:0, 10-bit. |
P216 | Planar, 4:2:2, 16-bit. |
P210 | Planar, 4:2:2, 10-bit. |
Y216 | Packed, 4:2:2, 16-bit. |
Y210 | Packed, 4:2:2, 10-bit. |
Y416 | Packed, 4:4:4, 16-bit |
Y410 | Packed, 4:4:4, 10-bit. |