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