0001 .. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
0002
0003 .. planar-yuv:
0004
0005 ******************
0006 Planar YUV formats
0007 ******************
0008
0009 Planar formats split luma and chroma data in separate memory regions. They
0010 exist in two variants:
0011
0012 - Semi-planar formats use two planes. The first plane is the luma plane and
0013 stores the Y components. The second plane is the chroma plane and stores the
0014 Cb and Cr components interleaved.
0015
0016 - Fully planar formats use three planes to store the Y, Cb and Cr components
0017 separately.
0018
0019 Within a plane, components are stored in pixel order, which may be linear or
0020 tiled. Padding may be supported at the end of the lines, and the line stride of
0021 the chroma planes may be constrained by the line stride of the luma plane.
0022
0023 Some planar formats allow planes to be placed in independent memory locations.
0024 They are identified by an 'M' suffix in their name (such as in
0025 ``V4L2_PIX_FMT_NV12M``). Those formats are intended to be used only in drivers
0026 and applications that support the multi-planar API, described in
0027 :ref:`planar-apis`. Unless explicitly documented as supporting non-contiguous
0028 planes, formats require the planes to follow each other immediately in memory.
0029
0030
0031 Semi-Planar YUV Formats
0032 =======================
0033
0034 These formats are commonly referred to as NV formats (NV12, NV16, ...). They
0035 use two planes, and store the luma components in the first plane and the chroma
0036 components in the second plane. The Cb and Cr components are interleaved in the
0037 chroma plane, with Cb and Cr always stored in pairs. The chroma order is
0038 exposed as different formats.
0039
0040 For memory contiguous formats, the number of padding pixels at the end of the
0041 chroma lines is identical to the padding of the luma lines. Without horizontal
0042 subsampling, the chroma line stride (in bytes) is thus equal to twice the luma
0043 line stride. With horizontal subsampling by 2, the chroma line stride is equal
0044 to the luma line stride. Vertical subsampling doesn't affect the line stride.
0045
0046 For non-contiguous formats, no constraints are enforced by the format on the
0047 relationship between the luma and chroma line padding and stride.
0048
0049 All components are stored with the same number of bits per component.
0050
0051 .. raw:: latex
0052
0053 \footnotesize
0054
0055 .. tabularcolumns:: |p{5.2cm}|p{1.0cm}|p{1.5cm}|p{1.9cm}|p{1.2cm}|p{1.8cm}|p{2.7cm}|
0056
0057 .. flat-table:: Overview of Semi-Planar YUV Formats
0058 :header-rows: 1
0059 :stub-columns: 0
0060
0061 * - Identifier
0062 - Code
0063 - Bits per component
0064 - Subsampling
0065 - Chroma order [1]_
0066 - Contiguous [2]_
0067 - Tiling [3]_
0068 * - V4L2_PIX_FMT_NV12
0069 - 'NV12'
0070 - 8
0071 - 4:2:0
0072 - Cb, Cr
0073 - Yes
0074 - Linear
0075 * - V4L2_PIX_FMT_NV21
0076 - 'NV21'
0077 - 8
0078 - 4:2:0
0079 - Cr, Cb
0080 - Yes
0081 - Linear
0082 * - V4L2_PIX_FMT_NV12M
0083 - 'NM12'
0084 - 8
0085 - 4:2:0
0086 - Cb, Cr
0087 - No
0088 - Linear
0089 * - V4L2_PIX_FMT_NV21M
0090 - 'NM21'
0091 - 8
0092 - 4:2:0
0093 - Cr, Cb
0094 - No
0095 - Linear
0096 * - V4L2_PIX_FMT_NV12MT
0097 - 'TM12'
0098 - 8
0099 - 4:2:0
0100 - Cb, Cr
0101 - No
0102 - 64x32 tiles
0103
0104 Horizontal Z order
0105 * - V4L2_PIX_FMT_NV12MT_16X16
0106 - 'VM12'
0107 - 8
0108 - 4:2:2
0109 - Cb, Cr
0110 - No
0111 - 16x16 tiles
0112 * - V4L2_PIX_FMT_P010
0113 - 'P010'
0114 - 10
0115 - 4:2:0
0116 - Cb, Cr
0117 - Yes
0118 - Linear
0119 * - V4L2_PIX_FMT_P010_4L4
0120 - 'T010'
0121 - 10
0122 - 4:2:0
0123 - Cb, Cr
0124 - Yes
0125 - 4x4 tiles
0126 * - V4L2_PIX_FMT_NV16
0127 - 'NV16'
0128 - 8
0129 - 4:2:2
0130 - Cb, Cr
0131 - Yes
0132 - Linear
0133 * - V4L2_PIX_FMT_NV61
0134 - 'NV61'
0135 - 8
0136 - 4:2:2
0137 - Cr, Cb
0138 - Yes
0139 - Linear
0140 * - V4L2_PIX_FMT_NV16M
0141 - 'NM16'
0142 - 8
0143 - 4:2:2
0144 - Cb, Cr
0145 - No
0146 - Linear
0147 * - V4L2_PIX_FMT_NV61M
0148 - 'NM61'
0149 - 8
0150 - 4:2:2
0151 - Cr, Cb
0152 - No
0153 - Linear
0154 * - V4L2_PIX_FMT_NV24
0155 - 'NV24'
0156 - 8
0157 - 4:4:4
0158 - Cb, Cr
0159 - Yes
0160 - Linear
0161 * - V4L2_PIX_FMT_NV42
0162 - 'NV42'
0163 - 8
0164 - 4:4:4
0165 - Cr, Cb
0166 - Yes
0167 - Linear
0168
0169 .. raw:: latex
0170
0171 \normalsize
0172
0173 .. [1] Order of chroma samples in the second plane
0174 .. [2] Indicates if planes have to be contiguous in memory or can be
0175 disjoint
0176 .. [3] Macroblock size in pixels
0177
0178
0179 **Color Sample Location:**
0180 Chroma samples are :ref:`interstitially sited<yuv-chroma-centered>`
0181 horizontally.
0182
0183
0184 .. _V4L2-PIX-FMT-NV12:
0185 .. _V4L2-PIX-FMT-NV21:
0186 .. _V4L2-PIX-FMT-NV12M:
0187 .. _V4L2-PIX-FMT-NV21M:
0188 .. _V4L2-PIX-FMT-P010:
0189
0190 NV12, NV21, NV12M and NV21M
0191 ---------------------------
0192
0193 Semi-planar YUV 4:2:0 formats. The chroma plane is subsampled by 2 in each
0194 direction. Chroma lines contain half the number of pixels and the same number
0195 of bytes as luma lines, and the chroma plane contains half the number of lines
0196 of the luma plane.
0197
0198 .. flat-table:: Sample 4x4 NV12 Image
0199 :header-rows: 0
0200 :stub-columns: 0
0201
0202 * - start + 0:
0203 - Y'\ :sub:`00`
0204 - Y'\ :sub:`01`
0205 - Y'\ :sub:`02`
0206 - Y'\ :sub:`03`
0207 * - start + 4:
0208 - Y'\ :sub:`10`
0209 - Y'\ :sub:`11`
0210 - Y'\ :sub:`12`
0211 - Y'\ :sub:`13`
0212 * - start + 8:
0213 - Y'\ :sub:`20`
0214 - Y'\ :sub:`21`
0215 - Y'\ :sub:`22`
0216 - Y'\ :sub:`23`
0217 * - start + 12:
0218 - Y'\ :sub:`30`
0219 - Y'\ :sub:`31`
0220 - Y'\ :sub:`32`
0221 - Y'\ :sub:`33`
0222 * - start + 16:
0223 - Cb\ :sub:`00`
0224 - Cr\ :sub:`00`
0225 - Cb\ :sub:`01`
0226 - Cr\ :sub:`01`
0227 * - start + 20:
0228 - Cb\ :sub:`10`
0229 - Cr\ :sub:`10`
0230 - Cb\ :sub:`11`
0231 - Cr\ :sub:`11`
0232
0233 .. flat-table:: Sample 4x4 NV12M Image
0234 :header-rows: 0
0235 :stub-columns: 0
0236
0237 * - start0 + 0:
0238 - Y'\ :sub:`00`
0239 - Y'\ :sub:`01`
0240 - Y'\ :sub:`02`
0241 - Y'\ :sub:`03`
0242 * - start0 + 4:
0243 - Y'\ :sub:`10`
0244 - Y'\ :sub:`11`
0245 - Y'\ :sub:`12`
0246 - Y'\ :sub:`13`
0247 * - start0 + 8:
0248 - Y'\ :sub:`20`
0249 - Y'\ :sub:`21`
0250 - Y'\ :sub:`22`
0251 - Y'\ :sub:`23`
0252 * - start0 + 12:
0253 - Y'\ :sub:`30`
0254 - Y'\ :sub:`31`
0255 - Y'\ :sub:`32`
0256 - Y'\ :sub:`33`
0257 * -
0258 * - start1 + 0:
0259 - Cb\ :sub:`00`
0260 - Cr\ :sub:`00`
0261 - Cb\ :sub:`01`
0262 - Cr\ :sub:`01`
0263 * - start1 + 4:
0264 - Cb\ :sub:`10`
0265 - Cr\ :sub:`10`
0266 - Cb\ :sub:`11`
0267 - Cr\ :sub:`11`
0268
0269
0270 .. _V4L2-PIX-FMT-NV12MT:
0271 .. _V4L2-PIX-FMT-NV12MT-16X16:
0272 .. _V4L2-PIX-FMT-NV12-4L4:
0273 .. _V4L2-PIX-FMT-NV12-16L16:
0274 .. _V4L2-PIX-FMT-NV12-32L32:
0275 .. _V4L2-PIX-FMT-NV12M-8L128:
0276 .. _V4L2-PIX-FMT-NV12M-10BE-8L128:
0277 .. _V4L2-PIX-FMT-MM21:
0278
0279 Tiled NV12
0280 ----------
0281
0282 Semi-planar YUV 4:2:0 formats, using macroblock tiling. The chroma plane is
0283 subsampled by 2 in each direction. Chroma lines contain half the number of
0284 pixels and the same number of bytes as luma lines, and the chroma plane
0285 contains half the number of lines of the luma plane. Each tile follows the
0286 previous one linearly in memory (from left to right, top to bottom).
0287
0288 ``V4L2_PIX_FMT_NV12MT_16X16`` is similar to ``V4L2_PIX_FMT_NV12M`` but stores
0289 pixels in 2D 16x16 tiles, and stores tiles linearly in memory.
0290 The line stride and image height must be aligned to a multiple of 16.
0291 The layouts of the luma and chroma planes are identical.
0292
0293 ``V4L2_PIX_FMT_NV12MT`` is similar to ``V4L2_PIX_FMT_NV12M`` but stores
0294 pixels in 2D 64x32 tiles, and stores 2x2 groups of tiles in
0295 Z-order in memory, alternating Z and mirrored Z shapes horizontally.
0296 The line stride must be a multiple of 128 pixels to ensure an
0297 integer number of Z shapes. The image height must be a multiple of 32 pixels.
0298 If the vertical resolution is an odd number of tiles, the last row of
0299 tiles is stored in linear order. The layouts of the luma and chroma
0300 planes are identical.
0301
0302 ``V4L2_PIX_FMT_NV12_4L4`` stores pixels in 4x4 tiles, and stores
0303 tiles linearly in memory. The line stride and image height must be
0304 aligned to a multiple of 4. The layouts of the luma and chroma planes are
0305 identical.
0306
0307 ``V4L2_PIX_FMT_NV12_16L16`` stores pixels in 16x16 tiles, and stores
0308 tiles linearly in memory. The line stride and image height must be
0309 aligned to a multiple of 16. The layouts of the luma and chroma planes are
0310 identical.
0311
0312 ``V4L2_PIX_FMT_NV12_32L32`` stores pixels in 32x32 tiles, and stores
0313 tiles linearly in memory. The line stride and image height must be
0314 aligned to a multiple of 32. The layouts of the luma and chroma planes are
0315 identical.
0316
0317 ``V4L2_PIX_FMT_NV12M_8L128`` is similar to ``V4L2_PIX_FMT_NV12M`` but stores
0318 pixels in 2D 8x128 tiles, and stores tiles linearly in memory.
0319 The image height must be aligned to a multiple of 128.
0320 The layouts of the luma and chroma planes are identical.
0321
0322 ``V4L2_PIX_FMT_NV12M_10BE_8L128`` is similar to ``V4L2_PIX_FMT_NV12M`` but stores
0323 10 bits pixels in 2D 8x128 tiles, and stores tiles linearly in memory.
0324 the data is arranged in big endian order.
0325 The image height must be aligned to a multiple of 128.
0326 The layouts of the luma and chroma planes are identical.
0327 Note the tile size is 8bytes multiplied by 128 bytes,
0328 it means that the low bits and high bits of one pixel may be in different tiles.
0329 The 10 bit pixels are packed, so 5 bytes contain 4 10-bit pixels layout like
0330 this (for luma):
0331 byte 0: Y0(bits 9-2)
0332 byte 1: Y0(bits 1-0) Y1(bits 9-4)
0333 byte 2: Y1(bits 3-0) Y2(bits 9-6)
0334 byte 3: Y2(bits 5-0) Y3(bits 9-8)
0335 byte 4: Y3(bits 7-0)
0336
0337 ``V4L2_PIX_FMT_MM21`` store luma pixel in 16x32 tiles, and chroma pixels
0338 in 16x16 tiles. The line stride must be aligned to a multiple of 16 and the
0339 image height must be aligned to a multiple of 32. The number of luma and chroma
0340 tiles are identical, even though the tile size differ. The image is formed of
0341 two non-contiguous planes.
0342
0343 .. _nv12mt:
0344
0345 .. kernel-figure:: nv12mt.svg
0346 :alt: nv12mt.svg
0347 :align: center
0348
0349 V4L2_PIX_FMT_NV12MT macroblock Z shape memory layout
0350
0351 .. _nv12mt_ex:
0352
0353 .. kernel-figure:: nv12mt_example.svg
0354 :alt: nv12mt_example.svg
0355 :align: center
0356
0357 Example V4L2_PIX_FMT_NV12MT memory layout of tiles
0358
0359
0360 .. _V4L2-PIX-FMT-NV16:
0361 .. _V4L2-PIX-FMT-NV61:
0362 .. _V4L2-PIX-FMT-NV16M:
0363 .. _V4L2-PIX-FMT-NV61M:
0364
0365 NV16, NV61, NV16M and NV61M
0366 ---------------------------
0367
0368 Semi-planar YUV 4:2:2 formats. The chroma plane is subsampled by 2 in the
0369 horizontal direction. Chroma lines contain half the number of pixels and the
0370 same number of bytes as luma lines, and the chroma plane contains the same
0371 number of lines as the luma plane.
0372
0373 .. flat-table:: Sample 4x4 NV16 Image
0374 :header-rows: 0
0375 :stub-columns: 0
0376
0377 * - start + 0:
0378 - Y'\ :sub:`00`
0379 - Y'\ :sub:`01`
0380 - Y'\ :sub:`02`
0381 - Y'\ :sub:`03`
0382 * - start + 4:
0383 - Y'\ :sub:`10`
0384 - Y'\ :sub:`11`
0385 - Y'\ :sub:`12`
0386 - Y'\ :sub:`13`
0387 * - start + 8:
0388 - Y'\ :sub:`20`
0389 - Y'\ :sub:`21`
0390 - Y'\ :sub:`22`
0391 - Y'\ :sub:`23`
0392 * - start + 12:
0393 - Y'\ :sub:`30`
0394 - Y'\ :sub:`31`
0395 - Y'\ :sub:`32`
0396 - Y'\ :sub:`33`
0397 * - start + 16:
0398 - Cb\ :sub:`00`
0399 - Cr\ :sub:`00`
0400 - Cb\ :sub:`01`
0401 - Cr\ :sub:`01`
0402 * - start + 20:
0403 - Cb\ :sub:`10`
0404 - Cr\ :sub:`10`
0405 - Cb\ :sub:`11`
0406 - Cr\ :sub:`11`
0407 * - start + 24:
0408 - Cb\ :sub:`20`
0409 - Cr\ :sub:`20`
0410 - Cb\ :sub:`21`
0411 - Cr\ :sub:`21`
0412 * - start + 28:
0413 - Cb\ :sub:`30`
0414 - Cr\ :sub:`30`
0415 - Cb\ :sub:`31`
0416 - Cr\ :sub:`31`
0417
0418 .. flat-table:: Sample 4x4 NV16M Image
0419 :header-rows: 0
0420 :stub-columns: 0
0421
0422 * - start0 + 0:
0423 - Y'\ :sub:`00`
0424 - Y'\ :sub:`01`
0425 - Y'\ :sub:`02`
0426 - Y'\ :sub:`03`
0427 * - start0 + 4:
0428 - Y'\ :sub:`10`
0429 - Y'\ :sub:`11`
0430 - Y'\ :sub:`12`
0431 - Y'\ :sub:`13`
0432 * - start0 + 8:
0433 - Y'\ :sub:`20`
0434 - Y'\ :sub:`21`
0435 - Y'\ :sub:`22`
0436 - Y'\ :sub:`23`
0437 * - start0 + 12:
0438 - Y'\ :sub:`30`
0439 - Y'\ :sub:`31`
0440 - Y'\ :sub:`32`
0441 - Y'\ :sub:`33`
0442 * -
0443 * - start1 + 0:
0444 - Cb\ :sub:`00`
0445 - Cr\ :sub:`00`
0446 - Cb\ :sub:`02`
0447 - Cr\ :sub:`02`
0448 * - start1 + 4:
0449 - Cb\ :sub:`10`
0450 - Cr\ :sub:`10`
0451 - Cb\ :sub:`12`
0452 - Cr\ :sub:`12`
0453 * - start1 + 8:
0454 - Cb\ :sub:`20`
0455 - Cr\ :sub:`20`
0456 - Cb\ :sub:`22`
0457 - Cr\ :sub:`22`
0458 * - start1 + 12:
0459 - Cb\ :sub:`30`
0460 - Cr\ :sub:`30`
0461 - Cb\ :sub:`32`
0462 - Cr\ :sub:`32`
0463
0464
0465 .. _V4L2-PIX-FMT-NV24:
0466 .. _V4L2-PIX-FMT-NV42:
0467
0468 NV24 and NV42
0469 -------------
0470
0471 Semi-planar YUV 4:4:4 formats. The chroma plane is not subsampled.
0472 Chroma lines contain the same number of pixels and twice the
0473 number of bytes as luma lines, and the chroma plane contains the same
0474 number of lines as the luma plane.
0475
0476 .. flat-table:: Sample 4x4 NV24 Image
0477 :header-rows: 0
0478 :stub-columns: 0
0479
0480 * - start + 0:
0481 - Y'\ :sub:`00`
0482 - Y'\ :sub:`01`
0483 - Y'\ :sub:`02`
0484 - Y'\ :sub:`03`
0485 * - start + 4:
0486 - Y'\ :sub:`10`
0487 - Y'\ :sub:`11`
0488 - Y'\ :sub:`12`
0489 - Y'\ :sub:`13`
0490 * - start + 8:
0491 - Y'\ :sub:`20`
0492 - Y'\ :sub:`21`
0493 - Y'\ :sub:`22`
0494 - Y'\ :sub:`23`
0495 * - start + 12:
0496 - Y'\ :sub:`30`
0497 - Y'\ :sub:`31`
0498 - Y'\ :sub:`32`
0499 - Y'\ :sub:`33`
0500 * - start + 16:
0501 - Cb\ :sub:`00`
0502 - Cr\ :sub:`00`
0503 - Cb\ :sub:`01`
0504 - Cr\ :sub:`01`
0505 - Cb\ :sub:`02`
0506 - Cr\ :sub:`02`
0507 - Cb\ :sub:`03`
0508 - Cr\ :sub:`03`
0509 * - start + 24:
0510 - Cb\ :sub:`10`
0511 - Cr\ :sub:`10`
0512 - Cb\ :sub:`11`
0513 - Cr\ :sub:`11`
0514 - Cb\ :sub:`12`
0515 - Cr\ :sub:`12`
0516 - Cb\ :sub:`13`
0517 - Cr\ :sub:`13`
0518 * - start + 32:
0519 - Cb\ :sub:`20`
0520 - Cr\ :sub:`20`
0521 - Cb\ :sub:`21`
0522 - Cr\ :sub:`21`
0523 - Cb\ :sub:`22`
0524 - Cr\ :sub:`22`
0525 - Cb\ :sub:`23`
0526 - Cr\ :sub:`23`
0527 * - start + 40:
0528 - Cb\ :sub:`30`
0529 - Cr\ :sub:`30`
0530 - Cb\ :sub:`31`
0531 - Cr\ :sub:`31`
0532 - Cb\ :sub:`32`
0533 - Cr\ :sub:`32`
0534 - Cb\ :sub:`33`
0535 - Cr\ :sub:`33`
0536
0537 .. _V4L2_PIX_FMT_P010:
0538 .. _V4L2-PIX-FMT-P010-4L4:
0539
0540 P010 and tiled P010
0541 -------------------
0542
0543 P010 is like NV12 with 10 bits per component, expanded to 16 bits.
0544 Data in the 10 high bits, zeros in the 6 low bits, arranged in little endian order.
0545
0546 .. flat-table:: Sample 4x4 P010 Image
0547 :header-rows: 0
0548 :stub-columns: 0
0549
0550 * - start + 0:
0551 - Y'\ :sub:`00`
0552 - Y'\ :sub:`01`
0553 - Y'\ :sub:`02`
0554 - Y'\ :sub:`03`
0555 * - start + 8:
0556 - Y'\ :sub:`10`
0557 - Y'\ :sub:`11`
0558 - Y'\ :sub:`12`
0559 - Y'\ :sub:`13`
0560 * - start + 16:
0561 - Y'\ :sub:`20`
0562 - Y'\ :sub:`21`
0563 - Y'\ :sub:`22`
0564 - Y'\ :sub:`23`
0565 * - start + 24:
0566 - Y'\ :sub:`30`
0567 - Y'\ :sub:`31`
0568 - Y'\ :sub:`32`
0569 - Y'\ :sub:`33`
0570 * - start + 32:
0571 - Cb\ :sub:`00`
0572 - Cr\ :sub:`00`
0573 - Cb\ :sub:`01`
0574 - Cr\ :sub:`01`
0575 * - start + 40:
0576 - Cb\ :sub:`10`
0577 - Cr\ :sub:`10`
0578 - Cb\ :sub:`11`
0579 - Cr\ :sub:`11`
0580
0581
0582 Fully Planar YUV Formats
0583 ========================
0584
0585 These formats store the Y, Cb and Cr components in three separate planes. The
0586 luma plane comes first, and the order of the two chroma planes varies between
0587 formats. The two chroma planes always use the same subsampling.
0588
0589 For memory contiguous formats, the number of padding pixels at the end of the
0590 chroma lines is identical to the padding of the luma lines. The chroma line
0591 stride (in bytes) is thus equal to the luma line stride divided by the
0592 horizontal subsampling factor. Vertical subsampling doesn't affect the line
0593 stride.
0594
0595 For non-contiguous formats, no constraints are enforced by the format on the
0596 relationship between the luma and chroma line padding and stride.
0597
0598 All components are stored with the same number of bits per component.
0599
0600 ``V4L2_PIX_FMT_P010_4L4`` stores pixels in 4x4 tiles, and stores tiles linearly
0601 in memory. The line stride must be aligned to multiple of 8 and image height to
0602 a multiple of 4. The layouts of the luma and chroma planes are identical.
0603
0604 .. raw:: latex
0605
0606 \small
0607
0608 .. tabularcolumns:: |p{5.0cm}|p{1.1cm}|p{1.5cm}|p{2.2cm}|p{1.2cm}|p{3.7cm}|
0609
0610 .. flat-table:: Overview of Fully Planar YUV Formats
0611 :header-rows: 1
0612 :stub-columns: 0
0613
0614 * - Identifier
0615 - Code
0616 - Bits per component
0617 - Subsampling
0618 - Planes order [4]_
0619 - Contiguous [5]_
0620
0621 * - V4L2_PIX_FMT_YUV410
0622 - 'YUV9'
0623 - 8
0624 - 4:1:0
0625 - Y, Cb, Cr
0626 - Yes
0627 * - V4L2_PIX_FMT_YVU410
0628 - 'YVU9'
0629 - 8
0630 - 4:1:0
0631 - Y, Cr, Cb
0632 - Yes
0633 * - V4L2_PIX_FMT_YUV411P
0634 - '411P'
0635 - 8
0636 - 4:1:1
0637 - Y, Cb, Cr
0638 - Yes
0639 * - V4L2_PIX_FMT_YUV420M
0640 - 'YM12'
0641 - 8
0642 - 4:2:0
0643 - Y, Cb, Cr
0644 - No
0645 * - V4L2_PIX_FMT_YVU420M
0646 - 'YM21'
0647 - 8
0648 - 4:2:0
0649 - Y, Cr, Cb
0650 - No
0651 * - V4L2_PIX_FMT_YUV420
0652 - 'YU12'
0653 - 8
0654 - 4:2:0
0655 - Y, Cb, Cr
0656 - Yes
0657 * - V4L2_PIX_FMT_YVU420
0658 - 'YV12'
0659 - 8
0660 - 4:2:0
0661 - Y, Cr, Cb
0662 - Yes
0663 * - V4L2_PIX_FMT_YUV422P
0664 - '422P'
0665 - 8
0666 - 4:2:2
0667 - Y, Cb, Cr
0668 - Yes
0669 * - V4L2_PIX_FMT_YUV422M
0670 - 'YM16'
0671 - 8
0672 - 4:2:2
0673 - Y, Cb, Cr
0674 - No
0675 * - V4L2_PIX_FMT_YVU422M
0676 - 'YM61'
0677 - 8
0678 - 4:2:2
0679 - Y, Cr, Cb
0680 - No
0681 * - V4L2_PIX_FMT_YUV444M
0682 - 'YM24'
0683 - 8
0684 - 4:4:4
0685 - Y, Cb, Cr
0686 - No
0687 * - V4L2_PIX_FMT_YVU444M
0688 - 'YM42'
0689 - 8
0690 - 4:4:4
0691 - Y, Cr, Cb
0692 - No
0693
0694 .. raw:: latex
0695
0696 \normalsize
0697
0698 .. [4] Order of luma and chroma planes
0699 .. [5] Indicates if planes have to be contiguous in memory or can be
0700 disjoint
0701
0702
0703 **Color Sample Location:**
0704 Chroma samples are :ref:`interstitially sited<yuv-chroma-centered>`
0705 horizontally.
0706
0707 .. _V4L2-PIX-FMT-YUV410:
0708 .. _V4L2-PIX-FMT-YVU410:
0709
0710 YUV410 and YVU410
0711 -----------------
0712
0713 Planar YUV 4:1:0 formats. The chroma planes are subsampled by 4 in each
0714 direction. Chroma lines contain a quarter of the number of pixels and bytes of
0715 the luma lines, and the chroma planes contain a quarter of the number of lines
0716 of the luma plane.
0717
0718 .. flat-table:: Sample 4x4 YUV410 Image
0719 :header-rows: 0
0720 :stub-columns: 0
0721
0722 * - start + 0:
0723 - Y'\ :sub:`00`
0724 - Y'\ :sub:`01`
0725 - Y'\ :sub:`02`
0726 - Y'\ :sub:`03`
0727 * - start + 4:
0728 - Y'\ :sub:`10`
0729 - Y'\ :sub:`11`
0730 - Y'\ :sub:`12`
0731 - Y'\ :sub:`13`
0732 * - start + 8:
0733 - Y'\ :sub:`20`
0734 - Y'\ :sub:`21`
0735 - Y'\ :sub:`22`
0736 - Y'\ :sub:`23`
0737 * - start + 12:
0738 - Y'\ :sub:`30`
0739 - Y'\ :sub:`31`
0740 - Y'\ :sub:`32`
0741 - Y'\ :sub:`33`
0742 * - start + 16:
0743 - Cr\ :sub:`00`
0744 * - start + 17:
0745 - Cb\ :sub:`00`
0746
0747
0748 .. _V4L2-PIX-FMT-YUV411P:
0749
0750 YUV411P
0751 -------
0752
0753 Planar YUV 4:1:1 formats. The chroma planes are subsampled by 4 in the
0754 horizontal direction. Chroma lines contain a quarter of the number of pixels
0755 and bytes of the luma lines, and the chroma planes contain the same number of
0756 lines as the luma plane.
0757
0758 .. flat-table:: Sample 4x4 YUV411P Image
0759 :header-rows: 0
0760 :stub-columns: 0
0761
0762 * - start + 0:
0763 - Y'\ :sub:`00`
0764 - Y'\ :sub:`01`
0765 - Y'\ :sub:`02`
0766 - Y'\ :sub:`03`
0767 * - start + 4:
0768 - Y'\ :sub:`10`
0769 - Y'\ :sub:`11`
0770 - Y'\ :sub:`12`
0771 - Y'\ :sub:`13`
0772 * - start + 8:
0773 - Y'\ :sub:`20`
0774 - Y'\ :sub:`21`
0775 - Y'\ :sub:`22`
0776 - Y'\ :sub:`23`
0777 * - start + 12:
0778 - Y'\ :sub:`30`
0779 - Y'\ :sub:`31`
0780 - Y'\ :sub:`32`
0781 - Y'\ :sub:`33`
0782 * - start + 16:
0783 - Cb\ :sub:`00`
0784 * - start + 17:
0785 - Cb\ :sub:`10`
0786 * - start + 18:
0787 - Cb\ :sub:`20`
0788 * - start + 19:
0789 - Cb\ :sub:`30`
0790 * - start + 20:
0791 - Cr\ :sub:`00`
0792 * - start + 21:
0793 - Cr\ :sub:`10`
0794 * - start + 22:
0795 - Cr\ :sub:`20`
0796 * - start + 23:
0797 - Cr\ :sub:`30`
0798
0799
0800 .. _V4L2-PIX-FMT-YUV420:
0801 .. _V4L2-PIX-FMT-YVU420:
0802 .. _V4L2-PIX-FMT-YUV420M:
0803 .. _V4L2-PIX-FMT-YVU420M:
0804
0805 YUV420, YVU420, YUV420M and YVU420M
0806 -----------------------------------
0807
0808 Planar YUV 4:2:0 formats. The chroma planes are subsampled by 2 in each
0809 direction. Chroma lines contain half of the number of pixels and bytes of the
0810 luma lines, and the chroma planes contain half of the number of lines of the
0811 luma plane.
0812
0813 .. flat-table:: Sample 4x4 YUV420 Image
0814 :header-rows: 0
0815 :stub-columns: 0
0816
0817 * - start + 0:
0818 - Y'\ :sub:`00`
0819 - Y'\ :sub:`01`
0820 - Y'\ :sub:`02`
0821 - Y'\ :sub:`03`
0822 * - start + 4:
0823 - Y'\ :sub:`10`
0824 - Y'\ :sub:`11`
0825 - Y'\ :sub:`12`
0826 - Y'\ :sub:`13`
0827 * - start + 8:
0828 - Y'\ :sub:`20`
0829 - Y'\ :sub:`21`
0830 - Y'\ :sub:`22`
0831 - Y'\ :sub:`23`
0832 * - start + 12:
0833 - Y'\ :sub:`30`
0834 - Y'\ :sub:`31`
0835 - Y'\ :sub:`32`
0836 - Y'\ :sub:`33`
0837 * - start + 16:
0838 - Cr\ :sub:`00`
0839 - Cr\ :sub:`01`
0840 * - start + 18:
0841 - Cr\ :sub:`10`
0842 - Cr\ :sub:`11`
0843 * - start + 20:
0844 - Cb\ :sub:`00`
0845 - Cb\ :sub:`01`
0846 * - start + 22:
0847 - Cb\ :sub:`10`
0848 - Cb\ :sub:`11`
0849
0850 .. flat-table:: Sample 4x4 YUV420M Image
0851 :header-rows: 0
0852 :stub-columns: 0
0853
0854 * - start0 + 0:
0855 - Y'\ :sub:`00`
0856 - Y'\ :sub:`01`
0857 - Y'\ :sub:`02`
0858 - Y'\ :sub:`03`
0859 * - start0 + 4:
0860 - Y'\ :sub:`10`
0861 - Y'\ :sub:`11`
0862 - Y'\ :sub:`12`
0863 - Y'\ :sub:`13`
0864 * - start0 + 8:
0865 - Y'\ :sub:`20`
0866 - Y'\ :sub:`21`
0867 - Y'\ :sub:`22`
0868 - Y'\ :sub:`23`
0869 * - start0 + 12:
0870 - Y'\ :sub:`30`
0871 - Y'\ :sub:`31`
0872 - Y'\ :sub:`32`
0873 - Y'\ :sub:`33`
0874 * -
0875 * - start1 + 0:
0876 - Cb\ :sub:`00`
0877 - Cb\ :sub:`01`
0878 * - start1 + 2:
0879 - Cb\ :sub:`10`
0880 - Cb\ :sub:`11`
0881 * -
0882 * - start2 + 0:
0883 - Cr\ :sub:`00`
0884 - Cr\ :sub:`01`
0885 * - start2 + 2:
0886 - Cr\ :sub:`10`
0887 - Cr\ :sub:`11`
0888
0889
0890 .. _V4L2-PIX-FMT-YUV422P:
0891 .. _V4L2-PIX-FMT-YUV422M:
0892 .. _V4L2-PIX-FMT-YVU422M:
0893
0894 YUV422P, YUV422M and YVU422M
0895 ----------------------------
0896
0897 Planar YUV 4:2:2 formats. The chroma planes are subsampled by 2 in the
0898 horizontal direction. Chroma lines contain half of the number of pixels and
0899 bytes of the luma lines, and the chroma planes contain the same number of lines
0900 as the luma plane.
0901
0902 .. flat-table:: Sample 4x4 YUV422P Image
0903 :header-rows: 0
0904 :stub-columns: 0
0905
0906 * - start + 0:
0907 - Y'\ :sub:`00`
0908 - Y'\ :sub:`01`
0909 - Y'\ :sub:`02`
0910 - Y'\ :sub:`03`
0911 * - start + 4:
0912 - Y'\ :sub:`10`
0913 - Y'\ :sub:`11`
0914 - Y'\ :sub:`12`
0915 - Y'\ :sub:`13`
0916 * - start + 8:
0917 - Y'\ :sub:`20`
0918 - Y'\ :sub:`21`
0919 - Y'\ :sub:`22`
0920 - Y'\ :sub:`23`
0921 * - start + 12:
0922 - Y'\ :sub:`30`
0923 - Y'\ :sub:`31`
0924 - Y'\ :sub:`32`
0925 - Y'\ :sub:`33`
0926 * - start + 16:
0927 - Cb\ :sub:`00`
0928 - Cb\ :sub:`01`
0929 * - start + 18:
0930 - Cb\ :sub:`10`
0931 - Cb\ :sub:`11`
0932 * - start + 20:
0933 - Cb\ :sub:`20`
0934 - Cb\ :sub:`21`
0935 * - start + 22:
0936 - Cb\ :sub:`30`
0937 - Cb\ :sub:`31`
0938 * - start + 24:
0939 - Cr\ :sub:`00`
0940 - Cr\ :sub:`01`
0941 * - start + 26:
0942 - Cr\ :sub:`10`
0943 - Cr\ :sub:`11`
0944 * - start + 28:
0945 - Cr\ :sub:`20`
0946 - Cr\ :sub:`21`
0947 * - start + 30:
0948 - Cr\ :sub:`30`
0949 - Cr\ :sub:`31`
0950
0951 .. flat-table:: Sample 4x4 YUV422M Image
0952 :header-rows: 0
0953 :stub-columns: 0
0954
0955 * - start0 + 0:
0956 - Y'\ :sub:`00`
0957 - Y'\ :sub:`01`
0958 - Y'\ :sub:`02`
0959 - Y'\ :sub:`03`
0960 * - start0 + 4:
0961 - Y'\ :sub:`10`
0962 - Y'\ :sub:`11`
0963 - Y'\ :sub:`12`
0964 - Y'\ :sub:`13`
0965 * - start0 + 8:
0966 - Y'\ :sub:`20`
0967 - Y'\ :sub:`21`
0968 - Y'\ :sub:`22`
0969 - Y'\ :sub:`23`
0970 * - start0 + 12:
0971 - Y'\ :sub:`30`
0972 - Y'\ :sub:`31`
0973 - Y'\ :sub:`32`
0974 - Y'\ :sub:`33`
0975 * -
0976 * - start1 + 0:
0977 - Cb\ :sub:`00`
0978 - Cb\ :sub:`01`
0979 * - start1 + 2:
0980 - Cb\ :sub:`10`
0981 - Cb\ :sub:`11`
0982 * - start1 + 4:
0983 - Cb\ :sub:`20`
0984 - Cb\ :sub:`21`
0985 * - start1 + 6:
0986 - Cb\ :sub:`30`
0987 - Cb\ :sub:`31`
0988 * -
0989 * - start2 + 0:
0990 - Cr\ :sub:`00`
0991 - Cr\ :sub:`01`
0992 * - start2 + 2:
0993 - Cr\ :sub:`10`
0994 - Cr\ :sub:`11`
0995 * - start2 + 4:
0996 - Cr\ :sub:`20`
0997 - Cr\ :sub:`21`
0998 * - start2 + 6:
0999 - Cr\ :sub:`30`
1000 - Cr\ :sub:`31`
1001
1002
1003 .. _V4L2-PIX-FMT-YUV444M:
1004 .. _V4L2-PIX-FMT-YVU444M:
1005
1006 YUV444M and YVU444M
1007 -------------------
1008
1009 Planar YUV 4:4:4 formats. The chroma planes are no subsampled. Chroma lines
1010 contain the same number of pixels and bytes of the luma lines, and the chroma
1011 planes contain the same number of lines as the luma plane.
1012
1013 .. flat-table:: Sample 4x4 YUV444M Image
1014 :header-rows: 0
1015 :stub-columns: 0
1016
1017 * - start0 + 0:
1018 - Y'\ :sub:`00`
1019 - Y'\ :sub:`01`
1020 - Y'\ :sub:`02`
1021 - Y'\ :sub:`03`
1022 * - start0 + 4:
1023 - Y'\ :sub:`10`
1024 - Y'\ :sub:`11`
1025 - Y'\ :sub:`12`
1026 - Y'\ :sub:`13`
1027 * - start0 + 8:
1028 - Y'\ :sub:`20`
1029 - Y'\ :sub:`21`
1030 - Y'\ :sub:`22`
1031 - Y'\ :sub:`23`
1032 * - start0 + 12:
1033 - Y'\ :sub:`30`
1034 - Y'\ :sub:`31`
1035 - Y'\ :sub:`32`
1036 - Y'\ :sub:`33`
1037 * -
1038 * - start1 + 0:
1039 - Cb\ :sub:`00`
1040 - Cb\ :sub:`01`
1041 - Cb\ :sub:`02`
1042 - Cb\ :sub:`03`
1043 * - start1 + 4:
1044 - Cb\ :sub:`10`
1045 - Cb\ :sub:`11`
1046 - Cb\ :sub:`12`
1047 - Cb\ :sub:`13`
1048 * - start1 + 8:
1049 - Cb\ :sub:`20`
1050 - Cb\ :sub:`21`
1051 - Cb\ :sub:`22`
1052 - Cb\ :sub:`23`
1053 * - start1 + 12:
1054 - Cb\ :sub:`20`
1055 - Cb\ :sub:`21`
1056 - Cb\ :sub:`32`
1057 - Cb\ :sub:`33`
1058 * -
1059 * - start2 + 0:
1060 - Cr\ :sub:`00`
1061 - Cr\ :sub:`01`
1062 - Cr\ :sub:`02`
1063 - Cr\ :sub:`03`
1064 * - start2 + 4:
1065 - Cr\ :sub:`10`
1066 - Cr\ :sub:`11`
1067 - Cr\ :sub:`12`
1068 - Cr\ :sub:`13`
1069 * - start2 + 8:
1070 - Cr\ :sub:`20`
1071 - Cr\ :sub:`21`
1072 - Cr\ :sub:`22`
1073 - Cr\ :sub:`23`
1074 * - start2 + 12:
1075 - Cr\ :sub:`30`
1076 - Cr\ :sub:`31`
1077 - Cr\ :sub:`32`
1078 - Cr\ :sub:`33`