1.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
2
3.. planar-yuv:
4
5******************
6Planar YUV formats
7******************
8
9Planar formats split luma and chroma data in separate memory regions. They
10exist in two variants:
11
12- Semi-planar formats use two planes. The first plane is the luma plane and
13  stores the Y components. The second plane is the chroma plane and stores the
14  Cb and Cr components interleaved.
15
16- Fully planar formats use three planes to store the Y, Cb and Cr components
17  separately.
18
19Within a plane, components are stored in pixel order, which may be linear or
20tiled. Padding may be supported at the end of the lines, and the line stride of
21the chroma planes may be constrained by the line stride of the luma plane.
22
23Some planar formats allow planes to be placed in independent memory locations.
24They are identified by an 'M' suffix in their name (such as in
25``V4L2_PIX_FMT_NV12M``). Those formats are intended to be used only in drivers
26and applications that support the multi-planar API, described in
27:ref:`planar-apis`. Unless explicitly documented as supporting non-contiguous
28planes, formats require the planes to follow each other immediately in memory.
29
30
31Semi-Planar YUV Formats
32=======================
33
34These formats are commonly referred to as NV formats (NV12, NV16, ...). They
35use two planes, and store the luma components in the first plane and the chroma
36components in the second plane. The Cb and Cr components are interleaved in the
37chroma plane, with Cb and Cr always stored in pairs. The chroma order is
38exposed as different formats.
39
40For memory contiguous formats, the number of padding pixels at the end of the
41chroma lines is identical to the padding of the luma lines. Without horizontal
42subsampling, the chroma line stride (in bytes) is thus equal to twice the luma
43line stride. With horizontal subsampling by 2, the chroma line stride is equal
44to the luma line stride. Vertical subsampling doesn't affect the line stride.
45
46For non-contiguous formats, no constraints are enforced by the format on the
47relationship between the luma and chroma line padding and stride.
48
49All components are stored with the same number of bits per component.
50
51.. raw:: latex
52
53    \footnotesize
54
55.. tabularcolumns:: |p{5.2cm}|p{1.0cm}|p{1.5cm}|p{1.9cm}|p{1.2cm}|p{1.8cm}|p{2.7cm}|
56
57.. flat-table:: Overview of Semi-Planar YUV Formats
58    :header-rows:  1
59    :stub-columns: 0
60
61    * - Identifier
62      - Code
63      - Bits per component
64      - Subsampling
65      - Chroma order [1]_
66      - Contiguous [2]_
67      - Tiling [3]_
68    * - V4L2_PIX_FMT_NV12
69      - 'NV12'
70      - 8
71      - 4:2:0
72      - Cb, Cr
73      - Yes
74      - Linear
75    * - V4L2_PIX_FMT_NV21
76      - 'NV21'
77      - 8
78      - 4:2:0
79      - Cr, Cb
80      - Yes
81      - Linear
82    * - V4L2_PIX_FMT_NV12M
83      - 'NM12'
84      - 8
85      - 4:2:0
86      - Cb, Cr
87      - No
88      - Linear
89    * - V4L2_PIX_FMT_NV21M
90      - 'NM21'
91      - 8
92      - 4:2:0
93      - Cr, Cb
94      - No
95      - Linear
96    * - V4L2_PIX_FMT_NV12MT
97      - 'TM12'
98      - 8
99      - 4:2:0
100      - Cb, Cr
101      - No
102      - 64x32 tiles
103
104        Horizontal Z order
105    * - V4L2_PIX_FMT_NV12MT_16X16
106      - 'VM12'
107      - 8
108      - 4:2:2
109      - Cb, Cr
110      - No
111      - 16x16 tiles
112    * - V4L2_PIX_FMT_P010
113      - 'P010'
114      - 10
115      - 4:2:0
116      - Cb, Cr
117      - Yes
118      - Linear
119    * - V4L2_PIX_FMT_P010_4L4
120      - 'T010'
121      - 10
122      - 4:2:0
123      - Cb, Cr
124      - Yes
125      - 4x4 tiles
126    * - V4L2_PIX_FMT_NV16
127      - 'NV16'
128      - 8
129      - 4:2:2
130      - Cb, Cr
131      - Yes
132      - Linear
133    * - V4L2_PIX_FMT_NV61
134      - 'NV61'
135      - 8
136      - 4:2:2
137      - Cr, Cb
138      - Yes
139      - Linear
140    * - V4L2_PIX_FMT_NV16M
141      - 'NM16'
142      - 8
143      - 4:2:2
144      - Cb, Cr
145      - No
146      - Linear
147    * - V4L2_PIX_FMT_NV61M
148      - 'NM61'
149      - 8
150      - 4:2:2
151      - Cr, Cb
152      - No
153      - Linear
154    * - V4L2_PIX_FMT_NV24
155      - 'NV24'
156      - 8
157      - 4:4:4
158      - Cb, Cr
159      - Yes
160      - Linear
161    * - V4L2_PIX_FMT_NV42
162      - 'NV42'
163      - 8
164      - 4:4:4
165      - Cr, Cb
166      - Yes
167      - Linear
168
169.. raw:: latex
170
171    \normalsize
172
173.. [1] Order of chroma samples in the second plane
174.. [2] Indicates if planes have to be contiguous in memory or can be
175       disjoint
176.. [3] Macroblock size in pixels
177
178
179**Color Sample Location:**
180Chroma samples are :ref:`interstitially sited<yuv-chroma-centered>`
181horizontally.
182
183
184.. _V4L2-PIX-FMT-NV12:
185.. _V4L2-PIX-FMT-NV21:
186.. _V4L2-PIX-FMT-NV12M:
187.. _V4L2-PIX-FMT-NV21M:
188.. _V4L2-PIX-FMT-P010:
189
190NV12, NV21, NV12M and NV21M
191---------------------------
192
193Semi-planar YUV 4:2:0 formats. The chroma plane is subsampled by 2 in each
194direction. Chroma lines contain half the number of pixels and the same number
195of bytes as luma lines, and the chroma plane contains half the number of lines
196of the luma plane.
197
198.. flat-table:: Sample 4x4 NV12 Image
199    :header-rows:  0
200    :stub-columns: 0
201
202    * - start + 0:
203      - Y'\ :sub:`00`
204      - Y'\ :sub:`01`
205      - Y'\ :sub:`02`
206      - Y'\ :sub:`03`
207    * - start + 4:
208      - Y'\ :sub:`10`
209      - Y'\ :sub:`11`
210      - Y'\ :sub:`12`
211      - Y'\ :sub:`13`
212    * - start + 8:
213      - Y'\ :sub:`20`
214      - Y'\ :sub:`21`
215      - Y'\ :sub:`22`
216      - Y'\ :sub:`23`
217    * - start + 12:
218      - Y'\ :sub:`30`
219      - Y'\ :sub:`31`
220      - Y'\ :sub:`32`
221      - Y'\ :sub:`33`
222    * - start + 16:
223      - Cb\ :sub:`00`
224      - Cr\ :sub:`00`
225      - Cb\ :sub:`01`
226      - Cr\ :sub:`01`
227    * - start + 20:
228      - Cb\ :sub:`10`
229      - Cr\ :sub:`10`
230      - Cb\ :sub:`11`
231      - Cr\ :sub:`11`
232
233.. flat-table:: Sample 4x4 NV12M Image
234    :header-rows:  0
235    :stub-columns: 0
236
237    * - start0 + 0:
238      - Y'\ :sub:`00`
239      - Y'\ :sub:`01`
240      - Y'\ :sub:`02`
241      - Y'\ :sub:`03`
242    * - start0 + 4:
243      - Y'\ :sub:`10`
244      - Y'\ :sub:`11`
245      - Y'\ :sub:`12`
246      - Y'\ :sub:`13`
247    * - start0 + 8:
248      - Y'\ :sub:`20`
249      - Y'\ :sub:`21`
250      - Y'\ :sub:`22`
251      - Y'\ :sub:`23`
252    * - start0 + 12:
253      - Y'\ :sub:`30`
254      - Y'\ :sub:`31`
255      - Y'\ :sub:`32`
256      - Y'\ :sub:`33`
257    * -
258    * - start1 + 0:
259      - Cb\ :sub:`00`
260      - Cr\ :sub:`00`
261      - Cb\ :sub:`01`
262      - Cr\ :sub:`01`
263    * - start1 + 4:
264      - Cb\ :sub:`10`
265      - Cr\ :sub:`10`
266      - Cb\ :sub:`11`
267      - Cr\ :sub:`11`
268
269
270.. _V4L2-PIX-FMT-NV12MT:
271.. _V4L2-PIX-FMT-NV12MT-16X16:
272.. _V4L2-PIX-FMT-NV12-4L4:
273.. _V4L2-PIX-FMT-NV12-16L16:
274.. _V4L2-PIX-FMT-NV12-32L32:
275.. _V4L2-PIX-FMT-NV12M-8L128:
276.. _V4L2-PIX-FMT-NV12-8L128:
277.. _V4L2-PIX-FMT-NV12M-10BE-8L128:
278.. _V4L2-PIX-FMT-NV12-10BE-8L128:
279.. _V4L2-PIX-FMT-MM21:
280
281Tiled NV12
282----------
283
284Semi-planar YUV 4:2:0 formats, using macroblock tiling. The chroma plane is
285subsampled by 2 in each direction. Chroma lines contain half the number of
286pixels and the same number of bytes as luma lines, and the chroma plane
287contains half the number of lines of the luma plane. Each tile follows the
288previous one linearly in memory (from left to right, top to bottom).
289
290``V4L2_PIX_FMT_NV12MT_16X16`` is similar to ``V4L2_PIX_FMT_NV12M`` but stores
291pixels in 2D 16x16 tiles, and stores tiles linearly in memory.
292The line stride and image height must be aligned to a multiple of 16.
293The layouts of the luma and chroma planes are identical.
294
295``V4L2_PIX_FMT_NV12MT`` is similar to ``V4L2_PIX_FMT_NV12M`` but stores
296pixels in 2D 64x32 tiles, and stores 2x2 groups of tiles in
297Z-order in memory, alternating Z and mirrored Z shapes horizontally.
298The line stride must be a multiple of 128 pixels to ensure an
299integer number of Z shapes. The image height must be a multiple of 32 pixels.
300If the vertical resolution is an odd number of tiles, the last row of
301tiles is stored in linear order. The layouts of the luma and chroma
302planes are identical.
303
304``V4L2_PIX_FMT_NV12_4L4`` stores pixels in 4x4 tiles, and stores
305tiles linearly in memory. The line stride and image height must be
306aligned to a multiple of 4. The layouts of the luma and chroma planes are
307identical.
308
309``V4L2_PIX_FMT_NV12_16L16`` stores pixels in 16x16 tiles, and stores
310tiles linearly in memory. The line stride and image height must be
311aligned to a multiple of 16. The layouts of the luma and chroma planes are
312identical.
313
314``V4L2_PIX_FMT_NV12_32L32`` stores pixels in 32x32 tiles, and stores
315tiles linearly in memory. The line stride and image height must be
316aligned to a multiple of 32. The layouts of the luma and chroma planes are
317identical.
318
319``V4L2_PIX_FMT_NV12M_8L128`` is similar to ``V4L2_PIX_FMT_NV12M`` but stores
320pixels in 2D 8x128 tiles, and stores tiles linearly in memory.
321The image height must be aligned to a multiple of 128.
322The layouts of the luma and chroma planes are identical.
323
324``V4L2_PIX_FMT_NV12_8L128`` is similar to ``V4L2_PIX_FMT_NV12M_8L128`` but stores
325two planes in one memory.
326
327``V4L2_PIX_FMT_NV12M_10BE_8L128`` is similar to ``V4L2_PIX_FMT_NV12M`` but stores
32810 bits pixels in 2D 8x128 tiles, and stores tiles linearly in memory.
329the data is arranged in big endian order.
330The image height must be aligned to a multiple of 128.
331The layouts of the luma and chroma planes are identical.
332Note the tile size is 8bytes multiplied by 128 bytes,
333it means that the low bits and high bits of one pixel may be in different tiles.
334The 10 bit pixels are packed, so 5 bytes contain 4 10-bit pixels layout like
335this (for luma):
336byte 0: Y0(bits 9-2)
337byte 1: Y0(bits 1-0) Y1(bits 9-4)
338byte 2: Y1(bits 3-0) Y2(bits 9-6)
339byte 3: Y2(bits 5-0) Y3(bits 9-8)
340byte 4: Y3(bits 7-0)
341
342``V4L2_PIX_FMT_NV12_10BE_8L128`` is similar to ``V4L2_PIX_FMT_NV12M_10BE_8L128`` but stores
343two planes in one memory.
344
345``V4L2_PIX_FMT_MM21`` store luma pixel in 16x32 tiles, and chroma pixels
346in 16x16 tiles. The line stride must be aligned to a multiple of 16 and the
347image height must be aligned to a multiple of 32. The number of luma and chroma
348tiles are identical, even though the tile size differ. The image is formed of
349two non-contiguous planes.
350
351.. _nv12mt:
352
353.. kernel-figure:: nv12mt.svg
354    :alt:    nv12mt.svg
355    :align:  center
356
357    V4L2_PIX_FMT_NV12MT macroblock Z shape memory layout
358
359.. _nv12mt_ex:
360
361.. kernel-figure:: nv12mt_example.svg
362    :alt:    nv12mt_example.svg
363    :align:  center
364
365    Example V4L2_PIX_FMT_NV12MT memory layout of tiles
366
367
368.. _V4L2-PIX-FMT-NV16:
369.. _V4L2-PIX-FMT-NV61:
370.. _V4L2-PIX-FMT-NV16M:
371.. _V4L2-PIX-FMT-NV61M:
372
373NV16, NV61, NV16M and NV61M
374---------------------------
375
376Semi-planar YUV 4:2:2 formats. The chroma plane is subsampled by 2 in the
377horizontal direction. Chroma lines contain half the number of pixels and the
378same number of bytes as luma lines, and the chroma plane contains the same
379number of lines as the luma plane.
380
381.. flat-table:: Sample 4x4 NV16 Image
382    :header-rows:  0
383    :stub-columns: 0
384
385    * - start + 0:
386      - Y'\ :sub:`00`
387      - Y'\ :sub:`01`
388      - Y'\ :sub:`02`
389      - Y'\ :sub:`03`
390    * - start + 4:
391      - Y'\ :sub:`10`
392      - Y'\ :sub:`11`
393      - Y'\ :sub:`12`
394      - Y'\ :sub:`13`
395    * - start + 8:
396      - Y'\ :sub:`20`
397      - Y'\ :sub:`21`
398      - Y'\ :sub:`22`
399      - Y'\ :sub:`23`
400    * - start + 12:
401      - Y'\ :sub:`30`
402      - Y'\ :sub:`31`
403      - Y'\ :sub:`32`
404      - Y'\ :sub:`33`
405    * - start + 16:
406      - Cb\ :sub:`00`
407      - Cr\ :sub:`00`
408      - Cb\ :sub:`01`
409      - Cr\ :sub:`01`
410    * - start + 20:
411      - Cb\ :sub:`10`
412      - Cr\ :sub:`10`
413      - Cb\ :sub:`11`
414      - Cr\ :sub:`11`
415    * - start + 24:
416      - Cb\ :sub:`20`
417      - Cr\ :sub:`20`
418      - Cb\ :sub:`21`
419      - Cr\ :sub:`21`
420    * - start + 28:
421      - Cb\ :sub:`30`
422      - Cr\ :sub:`30`
423      - Cb\ :sub:`31`
424      - Cr\ :sub:`31`
425
426.. flat-table:: Sample 4x4 NV16M Image
427    :header-rows:  0
428    :stub-columns: 0
429
430    * - start0 + 0:
431      - Y'\ :sub:`00`
432      - Y'\ :sub:`01`
433      - Y'\ :sub:`02`
434      - Y'\ :sub:`03`
435    * - start0 + 4:
436      - Y'\ :sub:`10`
437      - Y'\ :sub:`11`
438      - Y'\ :sub:`12`
439      - Y'\ :sub:`13`
440    * - start0 + 8:
441      - Y'\ :sub:`20`
442      - Y'\ :sub:`21`
443      - Y'\ :sub:`22`
444      - Y'\ :sub:`23`
445    * - start0 + 12:
446      - Y'\ :sub:`30`
447      - Y'\ :sub:`31`
448      - Y'\ :sub:`32`
449      - Y'\ :sub:`33`
450    * -
451    * - start1 + 0:
452      - Cb\ :sub:`00`
453      - Cr\ :sub:`00`
454      - Cb\ :sub:`02`
455      - Cr\ :sub:`02`
456    * - start1 + 4:
457      - Cb\ :sub:`10`
458      - Cr\ :sub:`10`
459      - Cb\ :sub:`12`
460      - Cr\ :sub:`12`
461    * - start1 + 8:
462      - Cb\ :sub:`20`
463      - Cr\ :sub:`20`
464      - Cb\ :sub:`22`
465      - Cr\ :sub:`22`
466    * - start1 + 12:
467      - Cb\ :sub:`30`
468      - Cr\ :sub:`30`
469      - Cb\ :sub:`32`
470      - Cr\ :sub:`32`
471
472
473.. _V4L2-PIX-FMT-NV24:
474.. _V4L2-PIX-FMT-NV42:
475
476NV24 and NV42
477-------------
478
479Semi-planar YUV 4:4:4 formats. The chroma plane is not subsampled.
480Chroma lines contain the same number of pixels and twice the
481number of bytes as luma lines, and the chroma plane contains the same
482number of lines as the luma plane.
483
484.. flat-table:: Sample 4x4 NV24 Image
485    :header-rows:  0
486    :stub-columns: 0
487
488    * - start + 0:
489      - Y'\ :sub:`00`
490      - Y'\ :sub:`01`
491      - Y'\ :sub:`02`
492      - Y'\ :sub:`03`
493    * - start + 4:
494      - Y'\ :sub:`10`
495      - Y'\ :sub:`11`
496      - Y'\ :sub:`12`
497      - Y'\ :sub:`13`
498    * - start + 8:
499      - Y'\ :sub:`20`
500      - Y'\ :sub:`21`
501      - Y'\ :sub:`22`
502      - Y'\ :sub:`23`
503    * - start + 12:
504      - Y'\ :sub:`30`
505      - Y'\ :sub:`31`
506      - Y'\ :sub:`32`
507      - Y'\ :sub:`33`
508    * - start + 16:
509      - Cb\ :sub:`00`
510      - Cr\ :sub:`00`
511      - Cb\ :sub:`01`
512      - Cr\ :sub:`01`
513      - Cb\ :sub:`02`
514      - Cr\ :sub:`02`
515      - Cb\ :sub:`03`
516      - Cr\ :sub:`03`
517    * - start + 24:
518      - Cb\ :sub:`10`
519      - Cr\ :sub:`10`
520      - Cb\ :sub:`11`
521      - Cr\ :sub:`11`
522      - Cb\ :sub:`12`
523      - Cr\ :sub:`12`
524      - Cb\ :sub:`13`
525      - Cr\ :sub:`13`
526    * - start + 32:
527      - Cb\ :sub:`20`
528      - Cr\ :sub:`20`
529      - Cb\ :sub:`21`
530      - Cr\ :sub:`21`
531      - Cb\ :sub:`22`
532      - Cr\ :sub:`22`
533      - Cb\ :sub:`23`
534      - Cr\ :sub:`23`
535    * - start + 40:
536      - Cb\ :sub:`30`
537      - Cr\ :sub:`30`
538      - Cb\ :sub:`31`
539      - Cr\ :sub:`31`
540      - Cb\ :sub:`32`
541      - Cr\ :sub:`32`
542      - Cb\ :sub:`33`
543      - Cr\ :sub:`33`
544
545.. _V4L2_PIX_FMT_P010:
546.. _V4L2-PIX-FMT-P010-4L4:
547
548P010 and tiled P010
549-------------------
550
551P010 is like NV12 with 10 bits per component, expanded to 16 bits.
552Data in the 10 high bits, zeros in the 6 low bits, arranged in little endian order.
553
554.. flat-table:: Sample 4x4 P010 Image
555    :header-rows:  0
556    :stub-columns: 0
557
558    * - start + 0:
559      - Y'\ :sub:`00`
560      - Y'\ :sub:`01`
561      - Y'\ :sub:`02`
562      - Y'\ :sub:`03`
563    * - start + 8:
564      - Y'\ :sub:`10`
565      - Y'\ :sub:`11`
566      - Y'\ :sub:`12`
567      - Y'\ :sub:`13`
568    * - start + 16:
569      - Y'\ :sub:`20`
570      - Y'\ :sub:`21`
571      - Y'\ :sub:`22`
572      - Y'\ :sub:`23`
573    * - start + 24:
574      - Y'\ :sub:`30`
575      - Y'\ :sub:`31`
576      - Y'\ :sub:`32`
577      - Y'\ :sub:`33`
578    * - start + 32:
579      - Cb\ :sub:`00`
580      - Cr\ :sub:`00`
581      - Cb\ :sub:`01`
582      - Cr\ :sub:`01`
583    * - start + 40:
584      - Cb\ :sub:`10`
585      - Cr\ :sub:`10`
586      - Cb\ :sub:`11`
587      - Cr\ :sub:`11`
588
589
590Fully Planar YUV Formats
591========================
592
593These formats store the Y, Cb and Cr components in three separate planes. The
594luma plane comes first, and the order of the two chroma planes varies between
595formats. The two chroma planes always use the same subsampling.
596
597For memory contiguous formats, the number of padding pixels at the end of the
598chroma lines is identical to the padding of the luma lines. The chroma line
599stride (in bytes) is thus equal to the luma line stride divided by the
600horizontal subsampling factor. Vertical subsampling doesn't affect the line
601stride.
602
603For non-contiguous formats, no constraints are enforced by the format on the
604relationship between the luma and chroma line padding and stride.
605
606All components are stored with the same number of bits per component.
607
608``V4L2_PIX_FMT_P010_4L4`` stores pixels in 4x4 tiles, and stores tiles linearly
609in memory. The line stride must be aligned to multiple of 8 and image height to
610a multiple of 4. The layouts of the luma and chroma planes are identical.
611
612.. raw:: latex
613
614    \small
615
616.. tabularcolumns:: |p{5.0cm}|p{1.1cm}|p{1.5cm}|p{2.2cm}|p{1.2cm}|p{3.7cm}|
617
618.. flat-table:: Overview of Fully Planar YUV Formats
619    :header-rows:  1
620    :stub-columns: 0
621
622    * - Identifier
623      - Code
624      - Bits per component
625      - Subsampling
626      - Planes order [4]_
627      - Contiguous [5]_
628
629    * - V4L2_PIX_FMT_YUV410
630      - 'YUV9'
631      - 8
632      - 4:1:0
633      - Y, Cb, Cr
634      - Yes
635    * - V4L2_PIX_FMT_YVU410
636      - 'YVU9'
637      - 8
638      - 4:1:0
639      - Y, Cr, Cb
640      - Yes
641    * - V4L2_PIX_FMT_YUV411P
642      - '411P'
643      - 8
644      - 4:1:1
645      - Y, Cb, Cr
646      - Yes
647    * - V4L2_PIX_FMT_YUV420M
648      - 'YM12'
649      - 8
650      - 4:2:0
651      - Y, Cb, Cr
652      - No
653    * - V4L2_PIX_FMT_YVU420M
654      - 'YM21'
655      - 8
656      - 4:2:0
657      - Y, Cr, Cb
658      - No
659    * - V4L2_PIX_FMT_YUV420
660      - 'YU12'
661      - 8
662      - 4:2:0
663      - Y, Cb, Cr
664      - Yes
665    * - V4L2_PIX_FMT_YVU420
666      - 'YV12'
667      - 8
668      - 4:2:0
669      - Y, Cr, Cb
670      - Yes
671    * - V4L2_PIX_FMT_YUV422P
672      - '422P'
673      - 8
674      - 4:2:2
675      - Y, Cb, Cr
676      - Yes
677    * - V4L2_PIX_FMT_YUV422M
678      - 'YM16'
679      - 8
680      - 4:2:2
681      - Y, Cb, Cr
682      - No
683    * - V4L2_PIX_FMT_YVU422M
684      - 'YM61'
685      - 8
686      - 4:2:2
687      - Y, Cr, Cb
688      - No
689    * - V4L2_PIX_FMT_YUV444M
690      - 'YM24'
691      - 8
692      - 4:4:4
693      - Y, Cb, Cr
694      - No
695    * - V4L2_PIX_FMT_YVU444M
696      - 'YM42'
697      - 8
698      - 4:4:4
699      - Y, Cr, Cb
700      - No
701
702.. raw:: latex
703
704    \normalsize
705
706.. [4] Order of luma and chroma planes
707.. [5] Indicates if planes have to be contiguous in memory or can be
708       disjoint
709
710
711**Color Sample Location:**
712Chroma samples are :ref:`interstitially sited<yuv-chroma-centered>`
713horizontally.
714
715.. _V4L2-PIX-FMT-YUV410:
716.. _V4L2-PIX-FMT-YVU410:
717
718YUV410 and YVU410
719-----------------
720
721Planar YUV 4:1:0 formats. The chroma planes are subsampled by 4 in each
722direction. Chroma lines contain a quarter of the number of pixels and bytes of
723the luma lines, and the chroma planes contain a quarter of the number of lines
724of the luma plane.
725
726.. flat-table:: Sample 4x4 YUV410 Image
727    :header-rows:  0
728    :stub-columns: 0
729
730    * - start + 0:
731      - Y'\ :sub:`00`
732      - Y'\ :sub:`01`
733      - Y'\ :sub:`02`
734      - Y'\ :sub:`03`
735    * - start + 4:
736      - Y'\ :sub:`10`
737      - Y'\ :sub:`11`
738      - Y'\ :sub:`12`
739      - Y'\ :sub:`13`
740    * - start + 8:
741      - Y'\ :sub:`20`
742      - Y'\ :sub:`21`
743      - Y'\ :sub:`22`
744      - Y'\ :sub:`23`
745    * - start + 12:
746      - Y'\ :sub:`30`
747      - Y'\ :sub:`31`
748      - Y'\ :sub:`32`
749      - Y'\ :sub:`33`
750    * - start + 16:
751      - Cr\ :sub:`00`
752    * - start + 17:
753      - Cb\ :sub:`00`
754
755
756.. _V4L2-PIX-FMT-YUV411P:
757
758YUV411P
759-------
760
761Planar YUV 4:1:1 formats. The chroma planes are subsampled by 4 in the
762horizontal direction. Chroma lines contain a quarter of the number of pixels
763and bytes of the luma lines, and the chroma planes contain the same number of
764lines as the luma plane.
765
766.. flat-table:: Sample 4x4 YUV411P Image
767    :header-rows:  0
768    :stub-columns: 0
769
770    * - start + 0:
771      - Y'\ :sub:`00`
772      - Y'\ :sub:`01`
773      - Y'\ :sub:`02`
774      - Y'\ :sub:`03`
775    * - start + 4:
776      - Y'\ :sub:`10`
777      - Y'\ :sub:`11`
778      - Y'\ :sub:`12`
779      - Y'\ :sub:`13`
780    * - start + 8:
781      - Y'\ :sub:`20`
782      - Y'\ :sub:`21`
783      - Y'\ :sub:`22`
784      - Y'\ :sub:`23`
785    * - start + 12:
786      - Y'\ :sub:`30`
787      - Y'\ :sub:`31`
788      - Y'\ :sub:`32`
789      - Y'\ :sub:`33`
790    * - start + 16:
791      - Cb\ :sub:`00`
792    * - start + 17:
793      - Cb\ :sub:`10`
794    * - start + 18:
795      - Cb\ :sub:`20`
796    * - start + 19:
797      - Cb\ :sub:`30`
798    * - start + 20:
799      - Cr\ :sub:`00`
800    * - start + 21:
801      - Cr\ :sub:`10`
802    * - start + 22:
803      - Cr\ :sub:`20`
804    * - start + 23:
805      - Cr\ :sub:`30`
806
807
808.. _V4L2-PIX-FMT-YUV420:
809.. _V4L2-PIX-FMT-YVU420:
810.. _V4L2-PIX-FMT-YUV420M:
811.. _V4L2-PIX-FMT-YVU420M:
812
813YUV420, YVU420, YUV420M and YVU420M
814-----------------------------------
815
816Planar YUV 4:2:0 formats. The chroma planes are subsampled by 2 in each
817direction. Chroma lines contain half of the number of pixels and bytes of the
818luma lines, and the chroma planes contain half of the number of lines of the
819luma plane.
820
821.. flat-table:: Sample 4x4 YUV420 Image
822    :header-rows:  0
823    :stub-columns: 0
824
825    * - start + 0:
826      - Y'\ :sub:`00`
827      - Y'\ :sub:`01`
828      - Y'\ :sub:`02`
829      - Y'\ :sub:`03`
830    * - start + 4:
831      - Y'\ :sub:`10`
832      - Y'\ :sub:`11`
833      - Y'\ :sub:`12`
834      - Y'\ :sub:`13`
835    * - start + 8:
836      - Y'\ :sub:`20`
837      - Y'\ :sub:`21`
838      - Y'\ :sub:`22`
839      - Y'\ :sub:`23`
840    * - start + 12:
841      - Y'\ :sub:`30`
842      - Y'\ :sub:`31`
843      - Y'\ :sub:`32`
844      - Y'\ :sub:`33`
845    * - start + 16:
846      - Cr\ :sub:`00`
847      - Cr\ :sub:`01`
848    * - start + 18:
849      - Cr\ :sub:`10`
850      - Cr\ :sub:`11`
851    * - start + 20:
852      - Cb\ :sub:`00`
853      - Cb\ :sub:`01`
854    * - start + 22:
855      - Cb\ :sub:`10`
856      - Cb\ :sub:`11`
857
858.. flat-table:: Sample 4x4 YUV420M Image
859    :header-rows:  0
860    :stub-columns: 0
861
862    * - start0 + 0:
863      - Y'\ :sub:`00`
864      - Y'\ :sub:`01`
865      - Y'\ :sub:`02`
866      - Y'\ :sub:`03`
867    * - start0 + 4:
868      - Y'\ :sub:`10`
869      - Y'\ :sub:`11`
870      - Y'\ :sub:`12`
871      - Y'\ :sub:`13`
872    * - start0 + 8:
873      - Y'\ :sub:`20`
874      - Y'\ :sub:`21`
875      - Y'\ :sub:`22`
876      - Y'\ :sub:`23`
877    * - start0 + 12:
878      - Y'\ :sub:`30`
879      - Y'\ :sub:`31`
880      - Y'\ :sub:`32`
881      - Y'\ :sub:`33`
882    * -
883    * - start1 + 0:
884      - Cb\ :sub:`00`
885      - Cb\ :sub:`01`
886    * - start1 + 2:
887      - Cb\ :sub:`10`
888      - Cb\ :sub:`11`
889    * -
890    * - start2 + 0:
891      - Cr\ :sub:`00`
892      - Cr\ :sub:`01`
893    * - start2 + 2:
894      - Cr\ :sub:`10`
895      - Cr\ :sub:`11`
896
897
898.. _V4L2-PIX-FMT-YUV422P:
899.. _V4L2-PIX-FMT-YUV422M:
900.. _V4L2-PIX-FMT-YVU422M:
901
902YUV422P, YUV422M and YVU422M
903----------------------------
904
905Planar YUV 4:2:2 formats. The chroma planes are subsampled by 2 in the
906horizontal direction. Chroma lines contain half of the number of pixels and
907bytes of the luma lines, and the chroma planes contain the same number of lines
908as the luma plane.
909
910.. flat-table:: Sample 4x4 YUV422P Image
911    :header-rows:  0
912    :stub-columns: 0
913
914    * - start + 0:
915      - Y'\ :sub:`00`
916      - Y'\ :sub:`01`
917      - Y'\ :sub:`02`
918      - Y'\ :sub:`03`
919    * - start + 4:
920      - Y'\ :sub:`10`
921      - Y'\ :sub:`11`
922      - Y'\ :sub:`12`
923      - Y'\ :sub:`13`
924    * - start + 8:
925      - Y'\ :sub:`20`
926      - Y'\ :sub:`21`
927      - Y'\ :sub:`22`
928      - Y'\ :sub:`23`
929    * - start + 12:
930      - Y'\ :sub:`30`
931      - Y'\ :sub:`31`
932      - Y'\ :sub:`32`
933      - Y'\ :sub:`33`
934    * - start + 16:
935      - Cb\ :sub:`00`
936      - Cb\ :sub:`01`
937    * - start + 18:
938      - Cb\ :sub:`10`
939      - Cb\ :sub:`11`
940    * - start + 20:
941      - Cb\ :sub:`20`
942      - Cb\ :sub:`21`
943    * - start + 22:
944      - Cb\ :sub:`30`
945      - Cb\ :sub:`31`
946    * - start + 24:
947      - Cr\ :sub:`00`
948      - Cr\ :sub:`01`
949    * - start + 26:
950      - Cr\ :sub:`10`
951      - Cr\ :sub:`11`
952    * - start + 28:
953      - Cr\ :sub:`20`
954      - Cr\ :sub:`21`
955    * - start + 30:
956      - Cr\ :sub:`30`
957      - Cr\ :sub:`31`
958
959.. flat-table:: Sample 4x4 YUV422M Image
960    :header-rows:  0
961    :stub-columns: 0
962
963    * - start0 + 0:
964      - Y'\ :sub:`00`
965      - Y'\ :sub:`01`
966      - Y'\ :sub:`02`
967      - Y'\ :sub:`03`
968    * - start0 + 4:
969      - Y'\ :sub:`10`
970      - Y'\ :sub:`11`
971      - Y'\ :sub:`12`
972      - Y'\ :sub:`13`
973    * - start0 + 8:
974      - Y'\ :sub:`20`
975      - Y'\ :sub:`21`
976      - Y'\ :sub:`22`
977      - Y'\ :sub:`23`
978    * - start0 + 12:
979      - Y'\ :sub:`30`
980      - Y'\ :sub:`31`
981      - Y'\ :sub:`32`
982      - Y'\ :sub:`33`
983    * -
984    * - start1 + 0:
985      - Cb\ :sub:`00`
986      - Cb\ :sub:`01`
987    * - start1 + 2:
988      - Cb\ :sub:`10`
989      - Cb\ :sub:`11`
990    * - start1 + 4:
991      - Cb\ :sub:`20`
992      - Cb\ :sub:`21`
993    * - start1 + 6:
994      - Cb\ :sub:`30`
995      - Cb\ :sub:`31`
996    * -
997    * - start2 + 0:
998      - Cr\ :sub:`00`
999      - Cr\ :sub:`01`
1000    * - start2 + 2:
1001      - Cr\ :sub:`10`
1002      - Cr\ :sub:`11`
1003    * - start2 + 4:
1004      - Cr\ :sub:`20`
1005      - Cr\ :sub:`21`
1006    * - start2 + 6:
1007      - Cr\ :sub:`30`
1008      - Cr\ :sub:`31`
1009
1010
1011.. _V4L2-PIX-FMT-YUV444M:
1012.. _V4L2-PIX-FMT-YVU444M:
1013
1014YUV444M and YVU444M
1015-------------------
1016
1017Planar YUV 4:4:4 formats. The chroma planes are no subsampled. Chroma lines
1018contain the same number of pixels and bytes of the luma lines, and the chroma
1019planes contain the same number of lines as the luma plane.
1020
1021.. flat-table:: Sample 4x4 YUV444M Image
1022    :header-rows:  0
1023    :stub-columns: 0
1024
1025    * - start0 + 0:
1026      - Y'\ :sub:`00`
1027      - Y'\ :sub:`01`
1028      - Y'\ :sub:`02`
1029      - Y'\ :sub:`03`
1030    * - start0 + 4:
1031      - Y'\ :sub:`10`
1032      - Y'\ :sub:`11`
1033      - Y'\ :sub:`12`
1034      - Y'\ :sub:`13`
1035    * - start0 + 8:
1036      - Y'\ :sub:`20`
1037      - Y'\ :sub:`21`
1038      - Y'\ :sub:`22`
1039      - Y'\ :sub:`23`
1040    * - start0 + 12:
1041      - Y'\ :sub:`30`
1042      - Y'\ :sub:`31`
1043      - Y'\ :sub:`32`
1044      - Y'\ :sub:`33`
1045    * -
1046    * - start1 + 0:
1047      - Cb\ :sub:`00`
1048      - Cb\ :sub:`01`
1049      - Cb\ :sub:`02`
1050      - Cb\ :sub:`03`
1051    * - start1 + 4:
1052      - Cb\ :sub:`10`
1053      - Cb\ :sub:`11`
1054      - Cb\ :sub:`12`
1055      - Cb\ :sub:`13`
1056    * - start1 + 8:
1057      - Cb\ :sub:`20`
1058      - Cb\ :sub:`21`
1059      - Cb\ :sub:`22`
1060      - Cb\ :sub:`23`
1061    * - start1 + 12:
1062      - Cb\ :sub:`20`
1063      - Cb\ :sub:`21`
1064      - Cb\ :sub:`32`
1065      - Cb\ :sub:`33`
1066    * -
1067    * - start2 + 0:
1068      - Cr\ :sub:`00`
1069      - Cr\ :sub:`01`
1070      - Cr\ :sub:`02`
1071      - Cr\ :sub:`03`
1072    * - start2 + 4:
1073      - Cr\ :sub:`10`
1074      - Cr\ :sub:`11`
1075      - Cr\ :sub:`12`
1076      - Cr\ :sub:`13`
1077    * - start2 + 8:
1078      - Cr\ :sub:`20`
1079      - Cr\ :sub:`21`
1080      - Cr\ :sub:`22`
1081      - Cr\ :sub:`23`
1082    * - start2 + 12:
1083      - Cr\ :sub:`30`
1084      - Cr\ :sub:`31`
1085      - Cr\ :sub:`32`
1086      - Cr\ :sub:`33`
1087