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, Cr
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, Cr
94      - No
95      - Linear
96    * - V4L2_PIX_FMT_NV12MT
97      - 'TM12'
98      - 8
99      - 4:2:0
100      - Cb, Cr
101      - No
102      - 64x32 macroblocks
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 macroblocks
112    * - V4L2_PIX_FMT_NV16
113      - 'NV16'
114      - 8
115      - 4:2:2
116      - Cb, Cr
117      - Yes
118      - Linear
119    * - V4L2_PIX_FMT_NV61
120      - 'NV61'
121      - 8
122      - 4:2:2
123      - Cr, Cr
124      - Yes
125      - Linear
126    * - V4L2_PIX_FMT_NV16M
127      - 'NM16'
128      - 8
129      - 4:2:2
130      - Cb, Cr
131      - No
132      - Linear
133    * - V4L2_PIX_FMT_NV61M
134      - 'NM61'
135      - 8
136      - 4:2:2
137      - Cr, Cr
138      - No
139      - Linear
140    * - V4L2_PIX_FMT_NV24
141      - 'NV24'
142      - 8
143      - 4:4:4
144      - Cb, Cr
145      - Yes
146      - Linear
147    * - V4L2_PIX_FMT_NV42
148      - 'NV42'
149      - 8
150      - 4:4:4
151      - Cr, Cr
152      - Yes
153      - Linear
154
155.. raw:: latex
156
157    \normalsize
158
159.. [1] Order of chroma samples in the second plane
160.. [2] Indicates if planes have to be contiguous in memory or can be
161       disjoint
162.. [3] Macroblock size in pixels
163
164
165**Color Sample Location:**
166Chroma samples are :ref:`interstitially sited<yuv-chroma-centered>`
167horizontally.
168
169
170.. _V4L2-PIX-FMT-NV12:
171.. _V4L2-PIX-FMT-NV21:
172.. _V4L2-PIX-FMT-NV12M:
173.. _V4L2-PIX-FMT-NV21M:
174
175NV12, NV21, NV12M and NV21M
176---------------------------
177
178Semi-planar YUV 4:2:0 formats. The chroma plane is subsampled by 2 in each
179direction. Chroma lines contain half the number of pixels and the same number
180of bytes as luma lines, and the chroma plane contains half the number of lines
181of the luma plane.
182
183.. flat-table:: Sample 4x4 NV12 Image
184    :header-rows:  0
185    :stub-columns: 0
186
187    * - start + 0:
188      - Y'\ :sub:`00`
189      - Y'\ :sub:`01`
190      - Y'\ :sub:`02`
191      - Y'\ :sub:`03`
192    * - start + 4:
193      - Y'\ :sub:`10`
194      - Y'\ :sub:`11`
195      - Y'\ :sub:`12`
196      - Y'\ :sub:`13`
197    * - start + 8:
198      - Y'\ :sub:`20`
199      - Y'\ :sub:`21`
200      - Y'\ :sub:`22`
201      - Y'\ :sub:`23`
202    * - start + 12:
203      - Y'\ :sub:`30`
204      - Y'\ :sub:`31`
205      - Y'\ :sub:`32`
206      - Y'\ :sub:`33`
207    * - start + 16:
208      - Cb\ :sub:`00`
209      - Cr\ :sub:`00`
210      - Cb\ :sub:`01`
211      - Cr\ :sub:`01`
212    * - start + 20:
213      - Cb\ :sub:`10`
214      - Cr\ :sub:`10`
215      - Cb\ :sub:`11`
216      - Cr\ :sub:`11`
217
218.. flat-table:: Sample 4x4 NV12M Image
219    :header-rows:  0
220    :stub-columns: 0
221
222    * - start0 + 0:
223      - Y'\ :sub:`00`
224      - Y'\ :sub:`01`
225      - Y'\ :sub:`02`
226      - Y'\ :sub:`03`
227    * - start0 + 4:
228      - Y'\ :sub:`10`
229      - Y'\ :sub:`11`
230      - Y'\ :sub:`12`
231      - Y'\ :sub:`13`
232    * - start0 + 8:
233      - Y'\ :sub:`20`
234      - Y'\ :sub:`21`
235      - Y'\ :sub:`22`
236      - Y'\ :sub:`23`
237    * - start0 + 12:
238      - Y'\ :sub:`30`
239      - Y'\ :sub:`31`
240      - Y'\ :sub:`32`
241      - Y'\ :sub:`33`
242    * -
243    * - start1 + 0:
244      - Cb\ :sub:`00`
245      - Cr\ :sub:`00`
246      - Cb\ :sub:`01`
247      - Cr\ :sub:`01`
248    * - start1 + 4:
249      - Cb\ :sub:`10`
250      - Cr\ :sub:`10`
251      - Cb\ :sub:`11`
252      - Cr\ :sub:`11`
253
254
255.. _V4L2-PIX-FMT-NV12MT:
256.. _V4L2-PIX-FMT-NV12MT-16X16:
257.. _V4L2-PIX-FMT-NV12-32L32:
258
259Tiled NV12
260----------
261
262Semi-planar YUV 4:2:0 formats, using macroblock tiling. The chroma plane is
263subsampled by 2 in each direction. Chroma lines contain half the number of
264pixels and the same number of bytes as luma lines, and the chroma plane
265contains half the number of lines of the luma plane. Each tile follows the
266previous one linearly in memory (from left to right, top to bottom).
267
268``V4L2_PIX_FMT_NV12MT_16X16`` stores pixel in 2D 16x16 macroblocks, and stores
269macroblocks linearly in memory. The line stride and image height must be
270aligned to a multiple of 16. The layouts of the luma and chroma planes are
271identical.
272
273``V4L2_PIX_FMT_NV12MT`` stores pixels in 2D 64x32 macroblocks, and stores 2x2
274groups of macroblocks in Z-order in memory, alternating Z and mirrored Z shapes
275horizontally.  The line stride must be a multiple of 128 pixels to ensure an
276integer number of Z shapes. The image height must be a multiple of 32 pixels.
277If the vertical resolution is an odd number of macroblocks, the last row of
278macroblocks is stored in linear order. The layouts of the luma and chroma
279planes are identical.
280
281``V4L2_PIX_FMT_NV12_32L32`` stores pixel in 32x32 tiles, and stores
282tiles linearly in memory. The line stride and image height must be
283aligned to a multiple of 32. The layouts of the luma and chroma planes are
284identical.
285
286.. _nv12mt:
287
288.. kernel-figure:: nv12mt.svg
289    :alt:    nv12mt.svg
290    :align:  center
291
292    V4L2_PIX_FMT_NV12MT macroblock Z shape memory layout
293
294.. _nv12mt_ex:
295
296.. kernel-figure:: nv12mt_example.svg
297    :alt:    nv12mt_example.svg
298    :align:  center
299
300    Example V4L2_PIX_FMT_NV12MT memory layout of macroblocks
301
302
303.. _V4L2-PIX-FMT-NV16:
304.. _V4L2-PIX-FMT-NV61:
305.. _V4L2-PIX-FMT-NV16M:
306.. _V4L2-PIX-FMT-NV61M:
307
308NV16, NV61, NV16M and NV61M
309---------------------------
310
311Semi-planar YUV 4:2:2 formats. The chroma plane is subsampled by 2 in the
312horizontal direction. Chroma lines contain half the number of pixels and the
313same number of bytes as luma lines, and the chroma plane contains the same
314number of lines as the luma plane.
315
316.. flat-table:: Sample 4x4 NV16 Image
317    :header-rows:  0
318    :stub-columns: 0
319
320    * - start + 0:
321      - Y'\ :sub:`00`
322      - Y'\ :sub:`01`
323      - Y'\ :sub:`02`
324      - Y'\ :sub:`03`
325    * - start + 4:
326      - Y'\ :sub:`10`
327      - Y'\ :sub:`11`
328      - Y'\ :sub:`12`
329      - Y'\ :sub:`13`
330    * - start + 8:
331      - Y'\ :sub:`20`
332      - Y'\ :sub:`21`
333      - Y'\ :sub:`22`
334      - Y'\ :sub:`23`
335    * - start + 12:
336      - Y'\ :sub:`30`
337      - Y'\ :sub:`31`
338      - Y'\ :sub:`32`
339      - Y'\ :sub:`33`
340    * - start + 16:
341      - Cb\ :sub:`00`
342      - Cr\ :sub:`00`
343      - Cb\ :sub:`01`
344      - Cr\ :sub:`01`
345    * - start + 20:
346      - Cb\ :sub:`10`
347      - Cr\ :sub:`10`
348      - Cb\ :sub:`11`
349      - Cr\ :sub:`11`
350    * - start + 24:
351      - Cb\ :sub:`20`
352      - Cr\ :sub:`20`
353      - Cb\ :sub:`21`
354      - Cr\ :sub:`21`
355    * - start + 28:
356      - Cb\ :sub:`30`
357      - Cr\ :sub:`30`
358      - Cb\ :sub:`31`
359      - Cr\ :sub:`31`
360
361.. flat-table:: Sample 4x4 NV16M Image
362    :header-rows:  0
363    :stub-columns: 0
364
365    * - start0 + 0:
366      - Y'\ :sub:`00`
367      - Y'\ :sub:`01`
368      - Y'\ :sub:`02`
369      - Y'\ :sub:`03`
370    * - start0 + 4:
371      - Y'\ :sub:`10`
372      - Y'\ :sub:`11`
373      - Y'\ :sub:`12`
374      - Y'\ :sub:`13`
375    * - start0 + 8:
376      - Y'\ :sub:`20`
377      - Y'\ :sub:`21`
378      - Y'\ :sub:`22`
379      - Y'\ :sub:`23`
380    * - start0 + 12:
381      - Y'\ :sub:`30`
382      - Y'\ :sub:`31`
383      - Y'\ :sub:`32`
384      - Y'\ :sub:`33`
385    * -
386    * - start1 + 0:
387      - Cb\ :sub:`00`
388      - Cr\ :sub:`00`
389      - Cb\ :sub:`02`
390      - Cr\ :sub:`02`
391    * - start1 + 4:
392      - Cb\ :sub:`10`
393      - Cr\ :sub:`10`
394      - Cb\ :sub:`12`
395      - Cr\ :sub:`12`
396    * - start1 + 8:
397      - Cb\ :sub:`20`
398      - Cr\ :sub:`20`
399      - Cb\ :sub:`22`
400      - Cr\ :sub:`22`
401    * - start1 + 12:
402      - Cb\ :sub:`30`
403      - Cr\ :sub:`30`
404      - Cb\ :sub:`32`
405      - Cr\ :sub:`32`
406
407
408.. _V4L2-PIX-FMT-NV24:
409.. _V4L2-PIX-FMT-NV42:
410
411NV24 and NV42
412-------------
413
414Semi-planar YUV 4:4:4 formats. The chroma plane is not subsampled.
415Chroma lines contain the same number of pixels and twice the
416number of bytes as luma lines, and the chroma plane contains the same
417number of lines as the luma plane.
418
419.. flat-table:: Sample 4x4 NV24 Image
420    :header-rows:  0
421    :stub-columns: 0
422
423    * - start + 0:
424      - Y'\ :sub:`00`
425      - Y'\ :sub:`01`
426      - Y'\ :sub:`02`
427      - Y'\ :sub:`03`
428    * - start + 4:
429      - Y'\ :sub:`10`
430      - Y'\ :sub:`11`
431      - Y'\ :sub:`12`
432      - Y'\ :sub:`13`
433    * - start + 8:
434      - Y'\ :sub:`20`
435      - Y'\ :sub:`21`
436      - Y'\ :sub:`22`
437      - Y'\ :sub:`23`
438    * - start + 12:
439      - Y'\ :sub:`30`
440      - Y'\ :sub:`31`
441      - Y'\ :sub:`32`
442      - Y'\ :sub:`33`
443    * - start + 16:
444      - Cb\ :sub:`00`
445      - Cr\ :sub:`00`
446      - Cb\ :sub:`01`
447      - Cr\ :sub:`01`
448      - Cb\ :sub:`02`
449      - Cr\ :sub:`02`
450      - Cb\ :sub:`03`
451      - Cr\ :sub:`03`
452    * - start + 24:
453      - Cb\ :sub:`10`
454      - Cr\ :sub:`10`
455      - Cb\ :sub:`11`
456      - Cr\ :sub:`11`
457      - Cb\ :sub:`12`
458      - Cr\ :sub:`12`
459      - Cb\ :sub:`13`
460      - Cr\ :sub:`13`
461    * - start + 32:
462      - Cb\ :sub:`20`
463      - Cr\ :sub:`20`
464      - Cb\ :sub:`21`
465      - Cr\ :sub:`21`
466      - Cb\ :sub:`22`
467      - Cr\ :sub:`22`
468      - Cb\ :sub:`23`
469      - Cr\ :sub:`23`
470    * - start + 40:
471      - Cb\ :sub:`30`
472      - Cr\ :sub:`30`
473      - Cb\ :sub:`31`
474      - Cr\ :sub:`31`
475      - Cb\ :sub:`32`
476      - Cr\ :sub:`32`
477      - Cb\ :sub:`33`
478      - Cr\ :sub:`33`
479
480
481Fully Planar YUV Formats
482========================
483
484These formats store the Y, Cb and Cr components in three separate planes. The
485luma plane comes first, and the order of the two chroma planes varies between
486formats. The two chroma planes always use the same subsampling.
487
488For memory contiguous formats, the number of padding pixels at the end of the
489chroma lines is identical to the padding of the luma lines. The chroma line
490stride (in bytes) is thus equal to the luma line stride divided by the
491horizontal subsampling factor. Vertical subsampling doesn't affect the line
492stride.
493
494For non-contiguous formats, no constraints are enforced by the format on the
495relationship between the luma and chroma line padding and stride.
496
497All components are stored with the same number of bits per component.
498
499.. raw:: latex
500
501    \small
502
503.. tabularcolumns:: |p{5.0cm}|p{1.1cm}|p{1.5cm}|p{2.2cm}|p{1.2cm}|p{3.7cm}|
504
505.. flat-table:: Overview of Fully Planar YUV Formats
506    :header-rows:  1
507    :stub-columns: 0
508
509    * - Identifier
510      - Code
511      - Bits per component
512      - Subsampling
513      - Planes order [4]_
514      - Contiguous [5]_
515
516    * - V4L2_PIX_FMT_YUV410
517      - 'YUV9'
518      - 8
519      - 4:1:0
520      - Y, Cb, Cr
521      - Yes
522    * - V4L2_PIX_FMT_YVU410
523      - 'YVU9'
524      - 8
525      - 4:1:0
526      - Y, Cr, Cb
527      - Yes
528    * - V4L2_PIX_FMT_YUV411P
529      - '411P'
530      - 8
531      - 4:1:1
532      - Y, Cb, Cr
533      - Yes
534    * - V4L2_PIX_FMT_YUV420M
535      - 'YM12'
536      - 8
537      - 4:2:0
538      - Y, Cb, Cr
539      - No
540    * - V4L2_PIX_FMT_YVU420M
541      - 'YM21'
542      - 8
543      - 4:2:0
544      - Y, Cr, Cb
545      - No
546    * - V4L2_PIX_FMT_YUV420
547      - 'YU12'
548      - 8
549      - 4:2:0
550      - Y, Cb, Cr
551      - Yes
552    * - V4L2_PIX_FMT_YVU420
553      - 'YV12'
554      - 8
555      - 4:2:0
556      - Y, Cr, Cb
557      - Yes
558    * - V4L2_PIX_FMT_YUV422P
559      - '422P'
560      - 8
561      - 4:2:2
562      - Y, Cb, Cr
563      - Yes
564    * - V4L2_PIX_FMT_YUV422M
565      - 'YM16'
566      - 8
567      - 4:2:2
568      - Y, Cb, Cr
569      - No
570    * - V4L2_PIX_FMT_YVU422M
571      - 'YM61'
572      - 8
573      - 4:2:2
574      - Y, Cr, Cb
575      - No
576    * - V4L2_PIX_FMT_YUV444M
577      - 'YM24'
578      - 8
579      - 4:4:4
580      - Y, Cb, Cr
581      - No
582    * - V4L2_PIX_FMT_YVU444M
583      - 'YM42'
584      - 8
585      - 4:4:4
586      - Y, Cr, Cb
587      - No
588
589.. raw:: latex
590
591    \normalsize
592
593.. [4] Order of luma and chroma planes
594.. [5] Indicates if planes have to be contiguous in memory or can be
595       disjoint
596
597
598**Color Sample Location:**
599Chroma samples are :ref:`interstitially sited<yuv-chroma-centered>`
600horizontally.
601
602.. _V4L2-PIX-FMT-YUV410:
603.. _V4L2-PIX-FMT-YVU410:
604
605YUV410 and YVU410
606-----------------
607
608Planar YUV 4:1:0 formats. The chroma planes are subsampled by 4 in each
609direction. Chroma lines contain a quarter of the number of pixels and bytes of
610the luma lines, and the chroma planes contain a quarter of the number of lines
611of the luma plane.
612
613.. flat-table:: Sample 4x4 YUV410 Image
614    :header-rows:  0
615    :stub-columns: 0
616
617    * - start + 0:
618      - Y'\ :sub:`00`
619      - Y'\ :sub:`01`
620      - Y'\ :sub:`02`
621      - Y'\ :sub:`03`
622    * - start + 4:
623      - Y'\ :sub:`10`
624      - Y'\ :sub:`11`
625      - Y'\ :sub:`12`
626      - Y'\ :sub:`13`
627    * - start + 8:
628      - Y'\ :sub:`20`
629      - Y'\ :sub:`21`
630      - Y'\ :sub:`22`
631      - Y'\ :sub:`23`
632    * - start + 12:
633      - Y'\ :sub:`30`
634      - Y'\ :sub:`31`
635      - Y'\ :sub:`32`
636      - Y'\ :sub:`33`
637    * - start + 16:
638      - Cr\ :sub:`00`
639    * - start + 17:
640      - Cb\ :sub:`00`
641
642
643.. _V4L2-PIX-FMT-YUV411P:
644
645YUV411P
646-------
647
648Planar YUV 4:1:1 formats. The chroma planes are subsampled by 4 in the
649horizontal direction. Chroma lines contain a quarter of the number of pixels
650and bytes of the luma lines, and the chroma planes contain the same number of
651lines as the luma plane.
652
653.. flat-table:: Sample 4x4 YUV411P Image
654    :header-rows:  0
655    :stub-columns: 0
656
657    * - start + 0:
658      - Y'\ :sub:`00`
659      - Y'\ :sub:`01`
660      - Y'\ :sub:`02`
661      - Y'\ :sub:`03`
662    * - start + 4:
663      - Y'\ :sub:`10`
664      - Y'\ :sub:`11`
665      - Y'\ :sub:`12`
666      - Y'\ :sub:`13`
667    * - start + 8:
668      - Y'\ :sub:`20`
669      - Y'\ :sub:`21`
670      - Y'\ :sub:`22`
671      - Y'\ :sub:`23`
672    * - start + 12:
673      - Y'\ :sub:`30`
674      - Y'\ :sub:`31`
675      - Y'\ :sub:`32`
676      - Y'\ :sub:`33`
677    * - start + 16:
678      - Cb\ :sub:`00`
679    * - start + 17:
680      - Cb\ :sub:`10`
681    * - start + 18:
682      - Cb\ :sub:`20`
683    * - start + 19:
684      - Cb\ :sub:`30`
685    * - start + 20:
686      - Cr\ :sub:`00`
687    * - start + 21:
688      - Cr\ :sub:`10`
689    * - start + 22:
690      - Cr\ :sub:`20`
691    * - start + 23:
692      - Cr\ :sub:`30`
693
694
695.. _V4L2-PIX-FMT-YUV420:
696.. _V4L2-PIX-FMT-YVU420:
697.. _V4L2-PIX-FMT-YUV420M:
698.. _V4L2-PIX-FMT-YVU420M:
699
700YUV420, YVU420, YUV420M and YVU420M
701-----------------------------------
702
703Planar YUV 4:2:0 formats. The chroma planes are subsampled by 2 in each
704direction. Chroma lines contain half of the number of pixels and bytes of the
705luma lines, and the chroma planes contain half of the number of lines of the
706luma plane.
707
708.. flat-table:: Sample 4x4 YUV420 Image
709    :header-rows:  0
710    :stub-columns: 0
711
712    * - start + 0:
713      - Y'\ :sub:`00`
714      - Y'\ :sub:`01`
715      - Y'\ :sub:`02`
716      - Y'\ :sub:`03`
717    * - start + 4:
718      - Y'\ :sub:`10`
719      - Y'\ :sub:`11`
720      - Y'\ :sub:`12`
721      - Y'\ :sub:`13`
722    * - start + 8:
723      - Y'\ :sub:`20`
724      - Y'\ :sub:`21`
725      - Y'\ :sub:`22`
726      - Y'\ :sub:`23`
727    * - start + 12:
728      - Y'\ :sub:`30`
729      - Y'\ :sub:`31`
730      - Y'\ :sub:`32`
731      - Y'\ :sub:`33`
732    * - start + 16:
733      - Cr\ :sub:`00`
734      - Cr\ :sub:`01`
735    * - start + 18:
736      - Cr\ :sub:`10`
737      - Cr\ :sub:`11`
738    * - start + 20:
739      - Cb\ :sub:`00`
740      - Cb\ :sub:`01`
741    * - start + 22:
742      - Cb\ :sub:`10`
743      - Cb\ :sub:`11`
744
745.. flat-table:: Sample 4x4 YUV420M Image
746    :header-rows:  0
747    :stub-columns: 0
748
749    * - start0 + 0:
750      - Y'\ :sub:`00`
751      - Y'\ :sub:`01`
752      - Y'\ :sub:`02`
753      - Y'\ :sub:`03`
754    * - start0 + 4:
755      - Y'\ :sub:`10`
756      - Y'\ :sub:`11`
757      - Y'\ :sub:`12`
758      - Y'\ :sub:`13`
759    * - start0 + 8:
760      - Y'\ :sub:`20`
761      - Y'\ :sub:`21`
762      - Y'\ :sub:`22`
763      - Y'\ :sub:`23`
764    * - start0 + 12:
765      - Y'\ :sub:`30`
766      - Y'\ :sub:`31`
767      - Y'\ :sub:`32`
768      - Y'\ :sub:`33`
769    * -
770    * - start1 + 0:
771      - Cb\ :sub:`00`
772      - Cb\ :sub:`01`
773    * - start1 + 2:
774      - Cb\ :sub:`10`
775      - Cb\ :sub:`11`
776    * -
777    * - start2 + 0:
778      - Cr\ :sub:`00`
779      - Cr\ :sub:`01`
780    * - start2 + 2:
781      - Cr\ :sub:`10`
782      - Cr\ :sub:`11`
783
784
785.. _V4L2-PIX-FMT-YUV422P:
786.. _V4L2-PIX-FMT-YUV422M:
787.. _V4L2-PIX-FMT-YVU422M:
788
789YUV422P, YUV422M and YVU422M
790----------------------------
791
792Planar YUV 4:2:2 formats. The chroma planes are subsampled by 2 in the
793horizontal direction. Chroma lines contain half of the number of pixels and
794bytes of the luma lines, and the chroma planes contain the same number of lines
795as the luma plane.
796
797.. flat-table:: Sample 4x4 YUV422P Image
798    :header-rows:  0
799    :stub-columns: 0
800
801    * - start + 0:
802      - Y'\ :sub:`00`
803      - Y'\ :sub:`01`
804      - Y'\ :sub:`02`
805      - Y'\ :sub:`03`
806    * - start + 4:
807      - Y'\ :sub:`10`
808      - Y'\ :sub:`11`
809      - Y'\ :sub:`12`
810      - Y'\ :sub:`13`
811    * - start + 8:
812      - Y'\ :sub:`20`
813      - Y'\ :sub:`21`
814      - Y'\ :sub:`22`
815      - Y'\ :sub:`23`
816    * - start + 12:
817      - Y'\ :sub:`30`
818      - Y'\ :sub:`31`
819      - Y'\ :sub:`32`
820      - Y'\ :sub:`33`
821    * - start + 16:
822      - Cb\ :sub:`00`
823      - Cb\ :sub:`01`
824    * - start + 18:
825      - Cb\ :sub:`10`
826      - Cb\ :sub:`11`
827    * - start + 20:
828      - Cb\ :sub:`20`
829      - Cb\ :sub:`21`
830    * - start + 22:
831      - Cb\ :sub:`30`
832      - Cb\ :sub:`31`
833    * - start + 24:
834      - Cr\ :sub:`00`
835      - Cr\ :sub:`01`
836    * - start + 26:
837      - Cr\ :sub:`10`
838      - Cr\ :sub:`11`
839    * - start + 28:
840      - Cr\ :sub:`20`
841      - Cr\ :sub:`21`
842    * - start + 30:
843      - Cr\ :sub:`30`
844      - Cr\ :sub:`31`
845
846.. flat-table:: Sample 4x4 YUV422M Image
847    :header-rows:  0
848    :stub-columns: 0
849
850    * - start0 + 0:
851      - Y'\ :sub:`00`
852      - Y'\ :sub:`01`
853      - Y'\ :sub:`02`
854      - Y'\ :sub:`03`
855    * - start0 + 4:
856      - Y'\ :sub:`10`
857      - Y'\ :sub:`11`
858      - Y'\ :sub:`12`
859      - Y'\ :sub:`13`
860    * - start0 + 8:
861      - Y'\ :sub:`20`
862      - Y'\ :sub:`21`
863      - Y'\ :sub:`22`
864      - Y'\ :sub:`23`
865    * - start0 + 12:
866      - Y'\ :sub:`30`
867      - Y'\ :sub:`31`
868      - Y'\ :sub:`32`
869      - Y'\ :sub:`33`
870    * -
871    * - start1 + 0:
872      - Cb\ :sub:`00`
873      - Cb\ :sub:`01`
874    * - start1 + 2:
875      - Cb\ :sub:`10`
876      - Cb\ :sub:`11`
877    * - start1 + 4:
878      - Cb\ :sub:`20`
879      - Cb\ :sub:`21`
880    * - start1 + 6:
881      - Cb\ :sub:`30`
882      - Cb\ :sub:`31`
883    * -
884    * - start2 + 0:
885      - Cr\ :sub:`00`
886      - Cr\ :sub:`01`
887    * - start2 + 2:
888      - Cr\ :sub:`10`
889      - Cr\ :sub:`11`
890    * - start2 + 4:
891      - Cr\ :sub:`20`
892      - Cr\ :sub:`21`
893    * - start2 + 6:
894      - Cr\ :sub:`30`
895      - Cr\ :sub:`31`
896
897
898.. _V4L2-PIX-FMT-YUV444M:
899.. _V4L2-PIX-FMT-YVU444M:
900
901YUV444M and YVU444M
902-------------------
903
904Planar YUV 4:4:4 formats. The chroma planes are no subsampled. Chroma lines
905contain the same number of pixels and bytes of the luma lines, and the chroma
906planes contain the same number of lines as the luma plane.
907
908.. flat-table:: Sample 4x4 YUV444M Image
909    :header-rows:  0
910    :stub-columns: 0
911
912    * - start0 + 0:
913      - Y'\ :sub:`00`
914      - Y'\ :sub:`01`
915      - Y'\ :sub:`02`
916      - Y'\ :sub:`03`
917    * - start0 + 4:
918      - Y'\ :sub:`10`
919      - Y'\ :sub:`11`
920      - Y'\ :sub:`12`
921      - Y'\ :sub:`13`
922    * - start0 + 8:
923      - Y'\ :sub:`20`
924      - Y'\ :sub:`21`
925      - Y'\ :sub:`22`
926      - Y'\ :sub:`23`
927    * - start0 + 12:
928      - Y'\ :sub:`30`
929      - Y'\ :sub:`31`
930      - Y'\ :sub:`32`
931      - Y'\ :sub:`33`
932    * -
933    * - start1 + 0:
934      - Cb\ :sub:`00`
935      - Cb\ :sub:`01`
936      - Cb\ :sub:`02`
937      - Cb\ :sub:`03`
938    * - start1 + 4:
939      - Cb\ :sub:`10`
940      - Cb\ :sub:`11`
941      - Cb\ :sub:`12`
942      - Cb\ :sub:`13`
943    * - start1 + 8:
944      - Cb\ :sub:`20`
945      - Cb\ :sub:`21`
946      - Cb\ :sub:`22`
947      - Cb\ :sub:`23`
948    * - start1 + 12:
949      - Cb\ :sub:`20`
950      - Cb\ :sub:`21`
951      - Cb\ :sub:`32`
952      - Cb\ :sub:`33`
953    * -
954    * - start2 + 0:
955      - Cr\ :sub:`00`
956      - Cr\ :sub:`01`
957      - Cr\ :sub:`02`
958      - Cr\ :sub:`03`
959    * - start2 + 4:
960      - Cr\ :sub:`10`
961      - Cr\ :sub:`11`
962      - Cr\ :sub:`12`
963      - Cr\ :sub:`13`
964    * - start2 + 8:
965      - Cr\ :sub:`20`
966      - Cr\ :sub:`21`
967      - Cr\ :sub:`22`
968      - Cr\ :sub:`23`
969    * - start2 + 12:
970      - Cr\ :sub:`30`
971      - Cr\ :sub:`31`
972      - Cr\ :sub:`32`
973      - Cr\ :sub:`33`
974