https://msdn.microsoft.com/zh-tw/library/windows/desktop/bb970578(v=vs.85).aspx#fourcc_codes
FOURCC Codes For 10-Bit and 16-Bit YUV
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. |
Subtype GUIDs have also been defined from these FOURCCs; see Video Subtype GUIDs.
Surface Definitions
This section describes the memory layout of each format. In the descriptions that follow, the term WORD refers to a little-endian 16-bit value, and the term DWORD refers to a little-endian 32-bit value.
4:2:0 Formats
Two 4:2:0 formats are defined, with the FOURCC codes P016 and P010. They share the same memory layout, but P016 uses 16 bits per channel and P010 uses 10 bits per channel.
P016 and P010
In these two formats, all Y samples appear first in memory as an array of WORDs with an even number of lines. The surface stride can be larger than the width of the Y plane. This array is followed immediately by an array of WORDs that contains interleaved U and V samples, as shown in the following diagram.
If the combined U-V array is addressed as an array of DWORDs, the least significant word (LSW) contains the U value and the most significant word (MSW) contains the V value. The stride of the combined U-V plane is equal to the stride of the Y plane. The U-V plane has half as many lines as the Y plane.
These two formats are the preferred 4:2:0 planar pixel formats for higher precision YUV representations. They are expected to be an intermediate-term requirement for DirectX Video Acceleration (DXVA) accelerators that support 10-bit or 16-bit 4:2:0 video.
4:2:2 Formats
Four 4:2:2 formats are defined, two planar and two packed. They have the following FOURCC codes:
- P216
- P210
- Y216
- Y210
P216 and P210
In these two planar formats, all Y samples appear first in memory as an array of WORDs with an even number of lines. The surface stride can be larger than the width of the Y plane. This array is followed immediately by an array of WORDs that contains interleaved U and V samples, as shown in the following diagram.
If the combined U-V array is addressed as an array of DWORDs, the LSW contains the U value and the MSW contains the V value. The stride of the combined U-V plane is equal to the stride of the Y plane. The U-V plane has the same number of lines as the Y plane.
These two formats are the preferred 4:2:2 planar pixel formats for higher precision YUV representations. They are expected to be an intermediate-term requirement for DirectX Video Acceleration (DXVA) accelerators that support 10-bit or 16-bit 4:2:2 video.
Y216 and Y210
In these two packed formats, each pair of pixels is stored as an array of four WORDs, as shown in the following illustration.
The first WORD in the array contains the first Y sample in the pair, the second WORD contains the U sample, the third WORD contains the second Y sample, and the fourth WORD contains the V sample.
Y210 is identical to Y216 except that each sample contains only 10 bits of significant data. The least significant 6 bits are set to zero, as described previously.
4:4:4 Formats
Two 4:4:4 formats are defined, with the FOURCC codes Y410 and Y416. Both are packed formats.
Y410
This format is a packed 10-bit representation that includes 2 bits of alpha. Each pixel is encoded as a single DWORD with the memory layout shown in the following diagram.
Bits 0-9 contain the U sample, bits 10-19 contain the Y sample, bits 20-29 contain the V sample, and bits 30-31 contain the alpha value. To indicate that a pixel is fully opaque, an application must set the two alpha bits equal to 0x03.
Y416
This format is a packed 16-bit representation that includes 16 bits of alpha. Each pixel is encoded as a pair of DWORDs, as shown in the following illustration.
Bits 0-15 contain the U sample, bits 16-31 contain the Y sample, bits 32-47 contain the V sample, and bits 48-63 contain the alpha value.
To indicate that a pixel is fully opaque, an application must set the two alpha bits equal to 0xFFFF. This format is intended primarily as an intermediate format during image processing to avoid the accumulation of errors.
Preferred YUV Formats
The following table lists the preferred YUV formats, including 8-bit formats.
Format | Chroma sampling | Packed or planar | Bits per channel |
---|---|---|---|
AYUV | 4:4:4 | Packed | 8 |
Y410 | 4:4:4 | Packed | 10 |
Y416 | 4:4:4 | Packed | 16 |
AI44 | 4:4:4 | Packed | Palettized |
YUY2 | 4:2:2 | Packed | 8 |
Y210 | 4:2:2 | Packed | 10 |
Y216 | 4:2:2 | Packed | 16 |
P210 | 4:2:2 | Planar | 10 |
P216 | 4:2:2 | Planar | 16 |
NV12 | 4:2:0 | Planar | 8 |
P010 | 4:2:0 | Planar | 10 |
P016 | 4:2:0 | Planar | 16 |
NV11 | 4:1:1 | Planar | 8 |
It is recommended that if an object supports a given bit depth and chroma sampling scheme, it should support the corresponding YUV formats listed in this table. (Objects might support additional formats not listed here.)
https://msdn.microsoft.com/zh-tw/library/windows/desktop/dd407253(v=vs.85).aspx
Uncompressed RGB Video Subtypes
The following subtypes define uncompressed RGB formats with no alpha channel.
The following subtypes define uncompressed RGB formats with alpha channel.
Remarks
For palettized formats, the color of each pixel is specified as an index into a palette. The palette must be included in the format block, following the BITMAPINFOHEADER structure. For non-palettized formats, the color of each pixel is specified directly; the memory layout depends on the bit depth:
- RGB 555 uses the following memory layout:
High-order byte: Low-order byte: X R R R R R G G G G G B B B B B X = Don't care, R = Red, G = Green, B = Blue
- RGB 565 uses the following memory layout:
High-order byte: Low-order byte: R R R R R G G G G G G B B B B B
- For RGB 24, every pixel is an RGBTRIPLE. Each color is one byte, with a value from 0 to 255, inclusive. The memory layout is:
Byte 0 1 2 Value Blue Green Red - For RGB 32, every pixel is an RGBQUAD. Each color is one byte, with a value from 0 to 255, inclusive. The memory layout is:
Byte 0 1 2 3 Value Blue Green Red Alpha or Don't Care If the subtype is MEDIASUBTYPE_ARGB32, byte 3 contains a value for the alpha channel. If the subtype is MEDIASUBTYPE_RGB32, byte 3 should be ignored.
- A2R10G10B10 uses the following layout:
Bit 0 - 9 10 - 19 20 - 29 30 - 31 Value Blue Green Red Alpha - A2B10G10R10 uses the following layout:
Bit 0 - 9 10 - 19 20 - 29 30 - 31 Value Red Green Blue Alpha
https://linuxtv.org/downloads/v4l-dvb-apis/uapi/v4l/pixfmt.html
http://www.retiisi.org.uk/v4l2/tmp/media_api/yuv-formats.html
Chapter 2. Image Formats
Table of Contents
- Single-planar format structure
- Multi-planar format structures
- Standard Image Formats
- Colorspaces
- Indexed Format
- RGB Formats
-
- Packed RGB formats — Packed RGB formats
- V4L2_PIX_FMT_SBGGR8 ('BA81') — Bayer RGB format
- V4L2_PIX_FMT_SGBRG8 ('GBRG') — Bayer RGB format
- V4L2_PIX_FMT_SGRBG8 ('GRBG') — Bayer RGB format
- V4L2_PIX_FMT_SRGGB8 ('RGGB') — Bayer RGB format
- V4L2_PIX_FMT_SBGGR16 ('BYR2') — Bayer RGB format
- V4L2_PIX_FMT_SRGGB10 ('RG10'), V4L2_PIX_FMT_SGRBG10 ('BA10'), V4L2_PIX_FMT_SGBRG10 ('GB10'), V4L2_PIX_FMT_SBGGR10 ('BG10'), — 10-bit Bayer formats expanded to 16 bits
- V4L2_PIX_FMT_SRGGB10DPCM8 ('bBA8'), V4L2_PIX_FMT_SGBRG10DPCM8 ('bGA8'), V4L2_PIX_FMT_SGRBG10DPCM8 ('BD10'), V4L2_PIX_FMT_SBGGR10DPCM8 ('bRA8'), — 10-bit Bayer formats compressed to 8 bits
- V4L2_PIX_FMT_SRGGB12 ('RG12'), V4L2_PIX_FMT_SGRBG12 ('BA12'), V4L2_PIX_FMT_SGBRG12 ('GB12'), V4L2_PIX_FMT_SBGGR12 ('BG12'), — 12-bit Bayer formats expanded to 16 bits
- YUV Formats
-
- Packed YUV formats — Packed YUV formats
- V4L2_PIX_FMT_GREY ('GREY') — Grey-scale image
- V4L2_PIX_FMT_Y10 ('Y10 ') — Grey-scale image
- V4L2_PIX_FMT_Y12 ('Y12 ') — Grey-scale image
- V4L2_PIX_FMT_Y10BPACK ('Y10B') — Grey-scale image as a bit-packed array
- V4L2_PIX_FMT_Y16 ('Y16 ') — Grey-scale image
- V4L2_PIX_FMT_YUYV ('YUYV') — Packed format with ½ horizontal chroma resolution, also known as YUV 4:2:2
- V4L2_PIX_FMT_UYVY ('UYVY') — Variation of
V4L2_PIX_FMT_YUYV
with different order of samples in memory - V4L2_PIX_FMT_YVYU ('YVYU') — Variation of
V4L2_PIX_FMT_YUYV
with different order of samples in memory - V4L2_PIX_FMT_VYUY ('VYUY') — Variation of
V4L2_PIX_FMT_YUYV
with different order of samples in memory - V4L2_PIX_FMT_Y41P ('Y41P') — Format with ¼ horizontal chroma resolution, also known as YUV 4:1:1
- V4L2_PIX_FMT_YVU420 ('YV12'), V4L2_PIX_FMT_YUV420 ('YU12') — Planar formats with ½ horizontal and vertical chroma resolution, also known as YUV 4:2:0
- V4L2_PIX_FMT_YUV420M ('YU12M') — Variation of
V4L2_PIX_FMT_YUV420
with planes non contiguous in memory. - V4L2_PIX_FMT_YVU410 ('YVU9'), V4L2_PIX_FMT_YUV410 ('YUV9') — Planar formats with ¼ horizontal and vertical chroma resolution, also known as YUV 4:1:0
- V4L2_PIX_FMT_YUV422P ('422P') — Format with ½ horizontal chroma resolution, also known as YUV 4:2:2. Planar layout as opposed to
V4L2_PIX_FMT_YUYV
- V4L2_PIX_FMT_YUV411P ('411P') — Format with ¼ horizontal chroma resolution, also known as YUV 4:1:1. Planar layout as opposed to
V4L2_PIX_FMT_Y41P
- V4L2_PIX_FMT_NV12 ('NV12'), V4L2_PIX_FMT_NV21 ('NV21') — Formats with ½ horizontal and vertical chroma resolution, also known as YUV 4:2:0. One luminance and one chrominance plane with alternating chroma samples as opposed to
V4L2_PIX_FMT_YVU420
- V4L2_PIX_FMT_NV12M ('NV12M') — Variation of
V4L2_PIX_FMT_NV12
with planes non contiguous in memory. - V4L2_PIX_FMT_NV12MT ('TM12') — Formats with ½ horizontal and vertical chroma resolution. This format has two planes - one for luminance and one for chrominance. Chroma samples are interleaved. The difference to
V4L2_PIX_FMT_NV12
is the memory layout. Pixels are grouped in macroblocks of 64x32 size. The order of macroblocks in memory is also not standard. - V4L2_PIX_FMT_NV16 ('NV16'), V4L2_PIX_FMT_NV61 ('NV61') — Formats with ½ horizontal chroma resolution, also known as YUV 4:2:2. One luminance and one chrominance plane with alternating chroma samples as opposed to
V4L2_PIX_FMT_YVU420
- V4L2_PIX_FMT_NV24 ('NV24'), V4L2_PIX_FMT_NV42 ('NV42') — Formats with full horizontal and vertical chroma resolutions, also known as YUV 4:4:4. One luminance and one chrominance plane with alternating chroma samples as opposed to
V4L2_PIX_FMT_YVU420
- V4L2_PIX_FMT_M420 ('M420') — Format with ½ horizontal and vertical chroma resolution, also known as YUV 4:2:0. Hybrid plane line-interleaved layout.
- Compressed Formats
-
2. Image Formats
The V4L2 API was primarily designed for devices exchanging image data with applications. The struct
v4l2_pix_format
and structv4l2_pix_format_mplane
structures define the format and layout of an image in memory. The former is used with the single-planar API, while the latter is used with the multi-planar version (see Single- and multi-planar APIs). Image formats are negotiated with the VIDIOC_S_FMT ioctl. (The explanations here focus on video capturing and output, for overlay frame buffer formats see also VIDIOC_G_FBUF.)- 2.1. Single-planar format structure
- 2.2. Multi-planar format structures
- 2.3. Standard Image Formats
- 2.4. Indexed Format
- 2.5. RGB Formats
- 2.6. YUV Formats
- 2.7. HSV Formats
- 2.8. Depth Formats
- 2.9. Compressed Formats
- 2.10. SDR Formats
- 2.11. Touch Formats
- 2.12. Metadata Formats
- 2.13. Reserved Format Identifiers
- 2.14. Colorspaces
- 2.15. Defining Colorspaces in V4L2
- 2.16. Detailed Colorspace Descriptions
- 2.17. Detailed Transfer Function Descriptions
- http://bbs.chinaffmpeg.com/html/old__pix__fmts_8h_source.html
- https://msdn.microsoft.com/zh-tw/library/windows/desktop/bb970578(v=vs.85).aspx
-
10-bit and 16-bit YUV Video Formats
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.
This topic contains the following sections:
- http://130.216.33.163/compsci773s1t/lectures/YuY2_files/intro.htm
-
Packed YUV Formats
Label FOURCC in Hex Bits per pixel Description AYUV 0x56555941 32 Combined YUV and alpha CLJR 0x524A4C43 8 Cirrus Logic format with 4 pixels packed into a u_int32. A form of YUV 4:1:1 wiht less than 8 bits per Y, U and V sample. cyuv 0x76757963 16 Essentially a copy of UYVY except that the sense of the height is reversed - the image is upside down with respect to the UYVY version. GREY 0x59455247 8 Apparently a duplicate of Y800 (and also, presumably, "Y8 ") IRAW 0x57615349 ? Intel uncompressed YUV. I have no information on this format - can you help? IUYV 0x56595549 16 Interlaced version of UYVY (line order 0, 2, 4,....,1, 3, 5....) registered by Silviu Brinzei of Lead Technologies. IY41 0x31345949 12 Interlaced version of Y41P (line order 0, 2, 4,....,1, 3, 5....) registered by Silviu Brinzei of Lead Technologies. IYU1 0x31555949 12 12 bit format used in mode 2 of the IEEE 1394 Digital Camera 1.04 spec. This is equivalent to Y411 IYU2 0x32555949 24 24 bit format used in mode 0 of the IEEE 1394 Digital Camera 1.04 spec UYNV 0x564E5955 16 A direct copy of UYVY registered by NVidia to work around problems in some old codecs which did not like hardware which offered more than 2 UYVY surfaces. UYVP 0x50565955 24? YCbCr 4:2:2 extended precision 10-bits per component in U0Y0V0Y1 order. Registered by Rich Ehlers of Evans & Sutherland. (Awaiting confirmation of component packing structure) UYVY 0x59565955 16 YUV 4:2:2 (Y sample at every pixel, U and V sampled at every second pixel horizontally on each line). A macropixel contains 2 pixels in 1 u_int32. V210 0x30313256 32 10-bit 4:2:2 YCrCb equivalent to the Quicktime format of the same name. V422 0x32323456 16 I am told that this is an upside down version of UYVY. V655 0x35353656 16? 16 bit YUV 4:2:2 format registered by Vitec Multimedia. I have no information on the component ordering or packing. VYUY 0x59555956 ? ATI Packed YUV Data (format unknown but you can get hold of a codec supporting it here) Y422 0x32323459 16 Direct copy of UYVY as used by ADS Technologies Pyro WebCam firewire camera. YUY2 0x32595559 16 YUV 4:2:2 as for UYVY but with different component ordering within the u_int32 macropixel. YUYV 0x56595559 16 Duplicate of YUY2 YUNV 0x564E5559 16 A direct copy of YUY2 registered by NVidia to work around problems in some old codecs which did not like hardware which offered more than 2 YUY2 surfaces. YVYU 0x55595659 16 YUV 4:2:2 as for UYVY but with different component ordering within the u_int32 macropixel. Y41P 0x50313459 12 YUV 4:1:1 (Y sample at every pixel, U and V sampled at every fourth pixel horizontally on each line). A macropixel contains 8 pixels in 3 u_int32s. Y411 0x31313459 12 YUV 4:1:1 with a packed, 6 byte/4 pixel macroblock structure. Y211 0x31313259 8 Packed YUV format with Y sampled at every second pixel across each line and U and V sampled at every fourth pixel. Y41T 0x54313459 12 Format as for Y41P but the lsb of each Y component is used to signal pixel transparency . Y42T 0x54323459 16 Format as for UYVY but the lsb of each Y component is used to signal pixel transparency . YUVP 0x50565559 24? YCbCr 4:2:2 extended precision 10-bits per component in Y0U0Y1V0 order. Registered by Rich Ehlers of Evans & Sutherland. Y800 0x30303859 8 Simple, single Y plane for monochrome images. Y8 0x20203859 8 Duplicate of Y800 as far as I can see. - Reserved Format Identifiers
留言列表