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