← Documents Documentation/userspace-api/media/v4l/pixfmt-yuv-planar.rst GitHub 원문 ↗

Linux 6.18.37 · Userspace API / Media / V4L

V4L2 평면형 YUV 포맷

반평면과 완전 평면 YUV 포맷의 서브샘플링, 평면 순서, 타일링 및 비트 패킹을 정리합니다.

Source pathDocumentation/userspace-api/media/v4l/pixfmt-yuv-planar.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

요약·해설

pixfmt-yuv-planar.rst:1-1455

반평면·완전 평면 YUV 계열에서 메모리 연속성, 색차 순서, stride 제약과 타일 패킹을 포맷별로 비교합니다.

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

원문 전체 펼치기
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 .. 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_P012
127 - 'P012'
128 - 12
129 - 4:2:0
130 - Cb, Cr
131 - Yes
132 - Linear
133 * - V4L2_PIX_FMT_P012M
134 - 'PM12'
135 - 12
136 - 4:2:0
137 - Cb, Cr
138 - No
139 - Linear
140 * - V4L2_PIX_FMT_NV15
141 - 'NV15'
142 - 10
143 - 4:2:0
144 - Cb, Cr
145 - Yes
146 - Linear
147 * - V4L2_PIX_FMT_NV15_4L4
148 - 'VT15'
149 - 15
150 - 4:2:0
151 - Cb, Cr
152 - Yes
153 - 4x4 tiles
154 * - V4L2_PIX_FMT_MT2110T
155 - 'MT2T'
156 - 15
157 - 4:2:0
158 - Cb, Cr
159 - No
160 - 16x32 / 16x16 tiles tiled low bits
161 * - V4L2_PIX_FMT_MT2110R
162 - 'MT2R'
163 - 15
164 - 4:2:0
165 - Cb, Cr
166 - No
167 - 16x32 / 16x16 tiles raster low bits
168 * - V4L2_PIX_FMT_NV16
169 - 'NV16'
170 - 8
171 - 4:2:2
172 - Cb, Cr
173 - Yes
174 - Linear
175 * - V4L2_PIX_FMT_NV61
176 - 'NV61'
177 - 8
178 - 4:2:2
179 - Cr, Cb
180 - Yes
181 - Linear
182 * - V4L2_PIX_FMT_NV16M
183 - 'NM16'
184 - 8
185 - 4:2:2
186 - Cb, Cr
187 - No
188 - Linear
189 * - V4L2_PIX_FMT_NV61M
190 - 'NM61'
191 - 8
192 - 4:2:2
193 - Cr, Cb
194 - No
195 - Linear
196 * - V4L2_PIX_FMT_NV20
197 - 'NV20'
198 - 10
199 - 4:2:2
200 - Cb, Cr
201 - Yes
202 - Linear
203 * - V4L2_PIX_FMT_NV24
204 - 'NV24'
205 - 8
206 - 4:4:4
207 - Cb, Cr
208 - Yes
209 - Linear
210 * - V4L2_PIX_FMT_NV42
211 - 'NV42'
212 - 8
213 - 4:4:4
214 - Cr, Cb
215 - Yes
216 - Linear
217
218 .. raw:: latex
219
220 \normalsize
221
222 .. [1] Order of chroma samples in the second plane
223 .. [2] Indicates if planes have to be contiguous in memory or can be
224 disjoint
225 .. [3] Macroblock size in pixels
226
227
228 **Color Sample Location:**
229 Chroma samples are :ref:`interstitially sited<yuv-chroma-centered>`
230 horizontally.
231
232
233 .. _V4L2-PIX-FMT-NV12:
234 .. _V4L2-PIX-FMT-NV21:
235 .. _V4L2-PIX-FMT-NV12M:
236 .. _V4L2-PIX-FMT-NV21M:
237 .. _V4L2-PIX-FMT-P010:
238
239 NV12, NV21, NV12M and NV21M
240 ---------------------------
241
242 Semi-planar YUV 4:2:0 formats. The chroma plane is subsampled by 2 in each
243 direction. Chroma lines contain half the number of pixels and the same number
244 of bytes as luma lines, and the chroma plane contains half the number of lines
245 of the luma plane.
246
247 .. flat-table:: Sample 4x4 NV12 Image
248 :header-rows: 0
249 :stub-columns: 0
250
251 * - start + 0:
252 - Y'\ :sub:`00`
253 - Y'\ :sub:`01`
254 - Y'\ :sub:`02`
255 - Y'\ :sub:`03`
256 * - start + 4:
257 - Y'\ :sub:`10`
258 - Y'\ :sub:`11`
259 - Y'\ :sub:`12`
260 - Y'\ :sub:`13`
261 * - start + 8:
262 - Y'\ :sub:`20`
263 - Y'\ :sub:`21`
264 - Y'\ :sub:`22`
265 - Y'\ :sub:`23`
266 * - start + 12:
267 - Y'\ :sub:`30`
268 - Y'\ :sub:`31`
269 - Y'\ :sub:`32`
270 - Y'\ :sub:`33`
271 * - start + 16:
272 - Cb\ :sub:`00`
273 - Cr\ :sub:`00`
274 - Cb\ :sub:`01`
275 - Cr\ :sub:`01`
276 * - start + 20:
277 - Cb\ :sub:`10`
278 - Cr\ :sub:`10`
279 - Cb\ :sub:`11`
280 - Cr\ :sub:`11`
281
282 .. flat-table:: Sample 4x4 NV12M Image
283 :header-rows: 0
284 :stub-columns: 0
285
286 * - start0 + 0:
287 - Y'\ :sub:`00`
288 - Y'\ :sub:`01`
289 - Y'\ :sub:`02`
290 - Y'\ :sub:`03`
291 * - start0 + 4:
292 - Y'\ :sub:`10`
293 - Y'\ :sub:`11`
294 - Y'\ :sub:`12`
295 - Y'\ :sub:`13`
296 * - start0 + 8:
297 - Y'\ :sub:`20`
298 - Y'\ :sub:`21`
299 - Y'\ :sub:`22`
300 - Y'\ :sub:`23`
301 * - start0 + 12:
302 - Y'\ :sub:`30`
303 - Y'\ :sub:`31`
304 - Y'\ :sub:`32`
305 - Y'\ :sub:`33`
306 * -
307 * - start1 + 0:
308 - Cb\ :sub:`00`
309 - Cr\ :sub:`00`
310 - Cb\ :sub:`01`
311 - Cr\ :sub:`01`
312 * - start1 + 4:
313 - Cb\ :sub:`10`
314 - Cr\ :sub:`10`
315 - Cb\ :sub:`11`
316 - Cr\ :sub:`11`
317
318
319 .. _V4L2-PIX-FMT-NV15:
320
321 NV15
322 ----
323
324 Semi-planar 10-bit YUV 4:2:0 format similar to NV12, using 10-bit components
325 with no padding between each component. A group of 4 components are stored over
326 5 bytes in little endian order.
327
328 .. flat-table:: Sample 4x4 NV15 Image (1 byte per cell)
329 :header-rows: 0
330 :stub-columns: 0
331
332 * - start + 0:
333 - Y'\ :sub:`00[7:0]`
334 - Y'\ :sub:`01[5:0]`\ Y'\ :sub:`00[9:8]`
335 - Y'\ :sub:`02[3:0]`\ Y'\ :sub:`01[9:6]`
336 - Y'\ :sub:`03[1:0]`\ Y'\ :sub:`02[9:4]`
337 - Y'\ :sub:`03[9:2]`
338 * - start + 5:
339 - Y'\ :sub:`10[7:0]`
340 - Y'\ :sub:`11[5:0]`\ Y'\ :sub:`10[9:8]`
341 - Y'\ :sub:`12[3:0]`\ Y'\ :sub:`11[9:6]`
342 - Y'\ :sub:`13[1:0]`\ Y'\ :sub:`12[9:4]`
343 - Y'\ :sub:`13[9:2]`
344 * - start + 10:
345 - Y'\ :sub:`20[7:0]`
346 - Y'\ :sub:`21[5:0]`\ Y'\ :sub:`20[9:8]`
347 - Y'\ :sub:`22[3:0]`\ Y'\ :sub:`21[9:6]`
348 - Y'\ :sub:`23[1:0]`\ Y'\ :sub:`22[9:4]`
349 - Y'\ :sub:`23[9:2]`
350 * - start + 15:
351 - Y'\ :sub:`30[7:0]`
352 - Y'\ :sub:`31[5:0]`\ Y'\ :sub:`30[9:8]`
353 - Y'\ :sub:`32[3:0]`\ Y'\ :sub:`31[9:6]`
354 - Y'\ :sub:`33[1:0]`\ Y'\ :sub:`32[9:4]`
355 - Y'\ :sub:`33[9:2]`
356 * - start + 20:
357 - Cb\ :sub:`00[7:0]`
358 - Cr\ :sub:`00[5:0]`\ Cb\ :sub:`00[9:8]`
359 - Cb\ :sub:`01[3:0]`\ Cr\ :sub:`00[9:6]`
360 - Cr\ :sub:`01[1:0]`\ Cb\ :sub:`01[9:4]`
361 - Cr\ :sub:`01[9:2]`
362 * - start + 25:
363 - Cb\ :sub:`10[7:0]`
364 - Cr\ :sub:`10[5:0]`\ Cb\ :sub:`10[9:8]`
365 - Cb\ :sub:`11[3:0]`\ Cr\ :sub:`10[9:6]`
366 - Cr\ :sub:`11[1:0]`\ Cb\ :sub:`11[9:4]`
367 - Cr\ :sub:`11[9:2]`
368
369
370 .. _V4L2-PIX-FMT-NV12MT:
371 .. _V4L2-PIX-FMT-NV12MT-16X16:
372 .. _V4L2-PIX-FMT-NV12-4L4:
373 .. _V4L2-PIX-FMT-NV12-16L16:
374 .. _V4L2-PIX-FMT-NV12-32L32:
375 .. _V4L2-PIX-FMT-NV12M-8L128:
376 .. _V4L2-PIX-FMT-NV12-8L128:
377 .. _V4L2-PIX-FMT-MM21:
378
379 Tiled NV12
380 ----------
381
382 Semi-planar YUV 4:2:0 formats, using macroblock tiling. The chroma plane is
383 subsampled by 2 in each direction. Chroma lines contain half the number of
384 pixels and the same number of bytes as luma lines, and the chroma plane
385 contains half the number of lines of the luma plane. Each tile follows the
386 previous one linearly in memory (from left to right, top to bottom).
387
388 ``V4L2_PIX_FMT_NV12MT_16X16`` is similar to ``V4L2_PIX_FMT_NV12M`` but stores
389 pixels in 2D 16x16 tiles, and stores tiles linearly in memory.
390 The line stride and image height must be aligned to a multiple of 16.
391 The layouts of the luma and chroma planes are identical.
392
393 ``V4L2_PIX_FMT_NV12MT`` is similar to ``V4L2_PIX_FMT_NV12M`` but stores
394 pixels in 2D 64x32 tiles, and stores 2x2 groups of tiles in
395 Z-order in memory, alternating Z and mirrored Z shapes horizontally.
396 The line stride must be a multiple of 128 pixels to ensure an
397 integer number of Z shapes. The image height must be a multiple of 32 pixels.
398 If the vertical resolution is an odd number of tiles, the last row of
399 tiles is stored in linear order. The layouts of the luma and chroma
400 planes are identical.
401
402 .. _nv12mt:
403
404 .. kernel-figure:: nv12mt.svg
405 :alt: nv12mt.svg
406 :align: center
407
408 V4L2_PIX_FMT_NV12MT macroblock Z shape memory layout
409
410 .. _nv12mt_ex:
411
412 .. kernel-figure:: nv12mt_example.svg
413 :alt: nv12mt_example.svg
414 :align: center
415
416 Example V4L2_PIX_FMT_NV12MT memory layout of tiles
417
418 ``V4L2_PIX_FMT_NV12_4L4`` stores pixels in 4x4 tiles, and stores
419 tiles linearly in memory. The line stride and image height must be
420 aligned to a multiple of 4. The layouts of the luma and chroma planes are
421 identical.
422
423 ``V4L2_PIX_FMT_NV12_16L16`` stores pixels in 16x16 tiles, and stores
424 tiles linearly in memory. The line stride and image height must be
425 aligned to a multiple of 16. The layouts of the luma and chroma planes are
426 identical.
427
428 ``V4L2_PIX_FMT_NV12_32L32`` stores pixels in 32x32 tiles, and stores
429 tiles linearly in memory. The line stride and image height must be
430 aligned to a multiple of 32. The layouts of the luma and chroma planes are
431 identical.
432
433 ``V4L2_PIX_FMT_NV12M_8L128`` is similar to ``V4L2_PIX_FMT_NV12M`` but stores
434 pixels in 2D 8x128 tiles, and stores tiles linearly in memory.
435 The image height must be aligned to a multiple of 128.
436 The layouts of the luma and chroma planes are identical.
437
438 ``V4L2_PIX_FMT_NV12_8L128`` is similar to ``V4L2_PIX_FMT_NV12M_8L128`` but stores
439 two planes in one memory.
440
441 ``V4L2_PIX_FMT_MM21`` store luma pixel in 16x32 tiles, and chroma pixels
442 in 16x16 tiles. The line stride must be aligned to a multiple of 16 and the
443 image height must be aligned to a multiple of 32. The number of luma and chroma
444 tiles are identical, even though the tile size differ. The image is formed of
445 two non-contiguous planes.
446
447
448 .. _V4L2-PIX-FMT-NV15-4L4:
449 .. _V4L2-PIX-FMT-NV12M-10BE-8L128:
450 .. _V4L2-PIX-FMT-NV12-10BE-8L128:
451 .. _V4L2-PIX-FMT-MT2110T:
452 .. _V4L2-PIX-FMT-MT2110R:
453
454 Tiled NV15
455 ----------
456
457 ``V4L2_PIX_FMT_NV15_4L4`` Semi-planar 10-bit YUV 4:2:0 formats, using 4x4 tiling.
458 All components are packed without any padding between each other.
459 As a side-effect, each group of 4 components are stored over 5 bytes
460 (YYYY or UVUV = 4 * 10 bits = 40 bits = 5 bytes).
461
462 ``V4L2_PIX_FMT_NV12M_10BE_8L128`` is similar to ``V4L2_PIX_FMT_NV12M`` but stores
463 10 bits pixels in 2D 8x128 tiles, and stores tiles linearly in memory.
464 the data is arranged in big endian order.
465 The image height must be aligned to a multiple of 128.
466 The layouts of the luma and chroma planes are identical.
467 Note the tile size is 8bytes multiplied by 128 bytes,
468 it means that the low bits and high bits of one pixel may be in different tiles.
469 The 10 bit pixels are packed, so 5 bytes contain 4 10-bit pixels layout like
470 this (for luma):
471 byte 0: Y0(bits 9-2)
472 byte 1: Y0(bits 1-0) Y1(bits 9-4)
473 byte 2: Y1(bits 3-0) Y2(bits 9-6)
474 byte 3: Y2(bits 5-0) Y3(bits 9-8)
475 byte 4: Y3(bits 7-0)
476
477 ``V4L2_PIX_FMT_NV12_10BE_8L128`` is similar to ``V4L2_PIX_FMT_NV12M_10BE_8L128`` but stores
478 two planes in one memory.
479
480 ``V4L2_PIX_FMT_MT2110T`` is one of Mediatek packed 10bit YUV 4:2:0 formats.
481 It is fully packed 10bit 4:2:0 format like NV15 (15 bits per pixel), except
482 that the lower two bits data is stored in separate partitions. The format is
483 composed of 16x32 luma tiles, and 16x16 chroma tiles. Each tiles is 640 bytes
484 long, divided into 8 partitions of 80 bytes. The first 16 bytes of the
485 partition represent the 2 least significant bits of pixel data. The remaining
486 64 bytes represent the 8 most significant bits of pixel data.
487
488 .. kernel-figure:: mt2110t.svg
489 :alt: mt2110t.svg
490 :align: center
491
492 Layout of MT2110T Chroma Tile
493
494 Filtering out the upper part of each partitions results in a valid
495 ``V4L2_PIX_FMT_MM21`` frame. A partition is a sub-tile of size 16 x 4. The
496 lower two bits is said to be tiled since each bytes contains the lower two
497 bits of the column of for pixel matching the same index. The chroma tiles
498 only have 4 partitions.
499
500 .. flat-table:: MT2110T LSB bits layout
501 :header-rows: 1
502 :stub-columns: 1
503
504 * -
505 - start + 0:
506 - start + 1:
507 - . . .
508 - start\ +\ 15:
509 * - Bits 1:0
510 - Y'\ :sub:`0:0`
511 - Y'\ :sub:`0:1`
512 - . . .
513 - Y'\ :sub:`0:15`
514 * - Bit 3:2
515 - Y'\ :sub:`1:0`
516 - Y'\ :sub:`1:1`
517 - . . .
518 - Y'\ :sub:`1:15`
519 * - Bits 5:4
520 - Y'\ :sub:`2:0`
521 - Y'\ :sub:`2:1`
522 - . . .
523 - Y'\ :sub:`2:15`
524 * - Bits 7:6
525 - Y'\ :sub:`3:0`
526 - Y'\ :sub:`3:1`
527 - . . .
528 - Y'\ :sub:`3:15`
529
530 ``V4L2_PIX_FMT_MT2110R`` is identical to ``V4L2_PIX_FMT_MT2110T`` except that
531 the least significant two bits layout is in raster order. This means the first byte
532 contains 4 pixels of the first row, with 4 bytes per line.
533
534 .. flat-table:: MT2110R LSB bits layout
535 :header-rows: 2
536 :stub-columns: 1
537
538 * -
539 - :cspan:`3` Byte 0
540 - ...
541 - :cspan:`3` Byte 3
542 * -
543 - 7:6
544 - 5:4
545 - 3:2
546 - 1:0
547 - ...
548 - 7:6
549 - 5:4
550 - 3:2
551 - 1:0
552 * - start + 0:
553 - Y'\ :sub:`0:3`
554 - Y'\ :sub:`0:2`
555 - Y'\ :sub:`0:1`
556 - Y'\ :sub:`0:0`
557 - ...
558 - Y'\ :sub:`0:15`
559 - Y'\ :sub:`0:14`
560 - Y'\ :sub:`0:13`
561 - Y'\ :sub:`0:12`
562 * - start + 4:
563 - Y'\ :sub:`1:3`
564 - Y'\ :sub:`1:2`
565 - Y'\ :sub:`1:1`
566 - Y'\ :sub:`1:0`
567 - ...
568 - Y'\ :sub:`1:15`
569 - Y'\ :sub:`1:14`
570 - Y'\ :sub:`1:13`
571 - Y'\ :sub:`1:12`
572 * - start + 8:
573 - Y'\ :sub:`2:3`
574 - Y'\ :sub:`2:2`
575 - Y'\ :sub:`2:1`
576 - Y'\ :sub:`2:0`
577 - ...
578 - Y'\ :sub:`2:15`
579 - Y'\ :sub:`2:14`
580 - Y'\ :sub:`2:13`
581 - Y'\ :sub:`2:12`
582 * - start\ +\ 12:
583 - Y'\ :sub:`3:3`
584 - Y'\ :sub:`3:2`
585 - Y'\ :sub:`3:1`
586 - Y'\ :sub:`3:0`
587 - ...
588 - Y'\ :sub:`3:15`
589 - Y'\ :sub:`3:14`
590 - Y'\ :sub:`3:13`
591 - Y'\ :sub:`3:12`
592
593
594 .. _V4L2-PIX-FMT-NV16:
595 .. _V4L2-PIX-FMT-NV61:
596 .. _V4L2-PIX-FMT-NV16M:
597 .. _V4L2-PIX-FMT-NV61M:
598
599 NV16, NV61, NV16M and NV61M
600 ---------------------------
601
602 Semi-planar YUV 4:2:2 formats. The chroma plane is subsampled by 2 in the
603 horizontal direction. Chroma lines contain half the number of pixels and the
604 same number of bytes as luma lines, and the chroma plane contains the same
605 number of lines as the luma plane.
606
607 .. flat-table:: Sample 4x4 NV16 Image
608 :header-rows: 0
609 :stub-columns: 0
610
611 * - start + 0:
612 - Y'\ :sub:`00`
613 - Y'\ :sub:`01`
614 - Y'\ :sub:`02`
615 - Y'\ :sub:`03`
616 * - start + 4:
617 - Y'\ :sub:`10`
618 - Y'\ :sub:`11`
619 - Y'\ :sub:`12`
620 - Y'\ :sub:`13`
621 * - start + 8:
622 - Y'\ :sub:`20`
623 - Y'\ :sub:`21`
624 - Y'\ :sub:`22`
625 - Y'\ :sub:`23`
626 * - start + 12:
627 - Y'\ :sub:`30`
628 - Y'\ :sub:`31`
629 - Y'\ :sub:`32`
630 - Y'\ :sub:`33`
631 * - start + 16:
632 - Cb\ :sub:`00`
633 - Cr\ :sub:`00`
634 - Cb\ :sub:`01`
635 - Cr\ :sub:`01`
636 * - start + 20:
637 - Cb\ :sub:`10`
638 - Cr\ :sub:`10`
639 - Cb\ :sub:`11`
640 - Cr\ :sub:`11`
641 * - start + 24:
642 - Cb\ :sub:`20`
643 - Cr\ :sub:`20`
644 - Cb\ :sub:`21`
645 - Cr\ :sub:`21`
646 * - start + 28:
647 - Cb\ :sub:`30`
648 - Cr\ :sub:`30`
649 - Cb\ :sub:`31`
650 - Cr\ :sub:`31`
651
652 .. flat-table:: Sample 4x4 NV16M Image
653 :header-rows: 0
654 :stub-columns: 0
655
656 * - start0 + 0:
657 - Y'\ :sub:`00`
658 - Y'\ :sub:`01`
659 - Y'\ :sub:`02`
660 - Y'\ :sub:`03`
661 * - start0 + 4:
662 - Y'\ :sub:`10`
663 - Y'\ :sub:`11`
664 - Y'\ :sub:`12`
665 - Y'\ :sub:`13`
666 * - start0 + 8:
667 - Y'\ :sub:`20`
668 - Y'\ :sub:`21`
669 - Y'\ :sub:`22`
670 - Y'\ :sub:`23`
671 * - start0 + 12:
672 - Y'\ :sub:`30`
673 - Y'\ :sub:`31`
674 - Y'\ :sub:`32`
675 - Y'\ :sub:`33`
676 * -
677 * - start1 + 0:
678 - Cb\ :sub:`00`
679 - Cr\ :sub:`00`
680 - Cb\ :sub:`02`
681 - Cr\ :sub:`02`
682 * - start1 + 4:
683 - Cb\ :sub:`10`
684 - Cr\ :sub:`10`
685 - Cb\ :sub:`12`
686 - Cr\ :sub:`12`
687 * - start1 + 8:
688 - Cb\ :sub:`20`
689 - Cr\ :sub:`20`
690 - Cb\ :sub:`22`
691 - Cr\ :sub:`22`
692 * - start1 + 12:
693 - Cb\ :sub:`30`
694 - Cr\ :sub:`30`
695 - Cb\ :sub:`32`
696 - Cr\ :sub:`32`
697
698
699 .. _V4L2-PIX-FMT-NV20:
700
701 NV20
702 ----
703
704 Semi-planar 10-bit YUV 4:2:2 format similar to NV16, using 10-bit components
705 with no padding between each component. A group of 4 components are stored over
706 5 bytes in little endian order.
707
708 .. flat-table:: Sample 4x4 NV20 Image (1 byte per cell)
709 :header-rows: 0
710 :stub-columns: 0
711
712 * - start + 0:
713 - Y'\ :sub:`00[7:0]`
714 - Y'\ :sub:`01[5:0]`\ Y'\ :sub:`00[9:8]`
715 - Y'\ :sub:`02[3:0]`\ Y'\ :sub:`01[9:6]`
716 - Y'\ :sub:`03[1:0]`\ Y'\ :sub:`02[9:4]`
717 - Y'\ :sub:`03[9:2]`
718 * - start + 5:
719 - Y'\ :sub:`10[7:0]`
720 - Y'\ :sub:`11[5:0]`\ Y'\ :sub:`10[9:8]`
721 - Y'\ :sub:`12[3:0]`\ Y'\ :sub:`11[9:6]`
722 - Y'\ :sub:`13[1:0]`\ Y'\ :sub:`12[9:4]`
723 - Y'\ :sub:`13[9:2]`
724 * - start + 10:
725 - Y'\ :sub:`20[7:0]`
726 - Y'\ :sub:`21[5:0]`\ Y'\ :sub:`20[9:8]`
727 - Y'\ :sub:`22[3:0]`\ Y'\ :sub:`21[9:6]`
728 - Y'\ :sub:`23[1:0]`\ Y'\ :sub:`22[9:4]`
729 - Y'\ :sub:`23[9:2]`
730 * - start + 15:
731 - Y'\ :sub:`30[7:0]`
732 - Y'\ :sub:`31[5:0]`\ Y'\ :sub:`30[9:8]`
733 - Y'\ :sub:`32[3:0]`\ Y'\ :sub:`31[9:6]`
734 - Y'\ :sub:`33[1:0]`\ Y'\ :sub:`32[9:4]`
735 - Y'\ :sub:`33[9:2]`
736 * - start + 20:
737 - Cb\ :sub:`00[7:0]`
738 - Cr\ :sub:`00[5:0]`\ Cb\ :sub:`00[9:8]`
739 - Cb\ :sub:`01[3:0]`\ Cr\ :sub:`00[9:6]`
740 - Cr\ :sub:`01[1:0]`\ Cb\ :sub:`01[9:4]`
741 - Cr\ :sub:`01[9:2]`
742 * - start + 25:
743 - Cb\ :sub:`10[7:0]`
744 - Cr\ :sub:`10[5:0]`\ Cb\ :sub:`10[9:8]`
745 - Cb\ :sub:`11[3:0]`\ Cr\ :sub:`10[9:6]`
746 - Cr\ :sub:`11[1:0]`\ Cb\ :sub:`11[9:4]`
747 - Cr\ :sub:`11[9:2]`
748 * - start + 30:
749 - Cb\ :sub:`20[7:0]`
750 - Cr\ :sub:`20[5:0]`\ Cb\ :sub:`20[9:8]`
751 - Cb\ :sub:`21[3:0]`\ Cr\ :sub:`20[9:6]`
752 - Cr\ :sub:`21[1:0]`\ Cb\ :sub:`21[9:4]`
753 - Cr\ :sub:`21[9:2]`
754 * - start + 35:
755 - Cb\ :sub:`30[7:0]`
756 - Cr\ :sub:`30[5:0]`\ Cb\ :sub:`30[9:8]`
757 - Cb\ :sub:`31[3:0]`\ Cr\ :sub:`30[9:6]`
758 - Cr\ :sub:`31[1:0]`\ Cb\ :sub:`31[9:4]`
759 - Cr\ :sub:`31[9:2]`
760
761
762 .. _V4L2-PIX-FMT-NV24:
763 .. _V4L2-PIX-FMT-NV42:
764
765 NV24 and NV42
766 -------------
767
768 Semi-planar YUV 4:4:4 formats. The chroma plane is not subsampled.
769 Chroma lines contain the same number of pixels and twice the
770 number of bytes as luma lines, and the chroma plane contains the same
771 number of lines as the luma plane.
772
773 .. flat-table:: Sample 4x4 NV24 Image
774 :header-rows: 0
775 :stub-columns: 0
776
777 * - start + 0:
778 - Y'\ :sub:`00`
779 - Y'\ :sub:`01`
780 - Y'\ :sub:`02`
781 - Y'\ :sub:`03`
782 * - start + 4:
783 - Y'\ :sub:`10`
784 - Y'\ :sub:`11`
785 - Y'\ :sub:`12`
786 - Y'\ :sub:`13`
787 * - start + 8:
788 - Y'\ :sub:`20`
789 - Y'\ :sub:`21`
790 - Y'\ :sub:`22`
791 - Y'\ :sub:`23`
792 * - start + 12:
793 - Y'\ :sub:`30`
794 - Y'\ :sub:`31`
795 - Y'\ :sub:`32`
796 - Y'\ :sub:`33`
797 * - start + 16:
798 - Cb\ :sub:`00`
799 - Cr\ :sub:`00`
800 - Cb\ :sub:`01`
801 - Cr\ :sub:`01`
802 - Cb\ :sub:`02`
803 - Cr\ :sub:`02`
804 - Cb\ :sub:`03`
805 - Cr\ :sub:`03`
806 * - start + 24:
807 - Cb\ :sub:`10`
808 - Cr\ :sub:`10`
809 - Cb\ :sub:`11`
810 - Cr\ :sub:`11`
811 - Cb\ :sub:`12`
812 - Cr\ :sub:`12`
813 - Cb\ :sub:`13`
814 - Cr\ :sub:`13`
815 * - start + 32:
816 - Cb\ :sub:`20`
817 - Cr\ :sub:`20`
818 - Cb\ :sub:`21`
819 - Cr\ :sub:`21`
820 - Cb\ :sub:`22`
821 - Cr\ :sub:`22`
822 - Cb\ :sub:`23`
823 - Cr\ :sub:`23`
824 * - start + 40:
825 - Cb\ :sub:`30`
826 - Cr\ :sub:`30`
827 - Cb\ :sub:`31`
828 - Cr\ :sub:`31`
829 - Cb\ :sub:`32`
830 - Cr\ :sub:`32`
831 - Cb\ :sub:`33`
832 - Cr\ :sub:`33`
833
834 .. _V4L2_PIX_FMT_P010:
835 .. _V4L2-PIX-FMT-P010-4L4:
836
837 P010 and tiled P010
838 -------------------
839
840 P010 is like NV12 with 10 bits per component, expanded to 16 bits.
841 Data in the 10 high bits, zeros in the 6 low bits, arranged in little endian order.
842
843 .. flat-table:: Sample 4x4 P010 Image
844 :header-rows: 0
845 :stub-columns: 0
846
847 * - start + 0:
848 - Y'\ :sub:`00`
849 - Y'\ :sub:`01`
850 - Y'\ :sub:`02`
851 - Y'\ :sub:`03`
852 * - start + 8:
853 - Y'\ :sub:`10`
854 - Y'\ :sub:`11`
855 - Y'\ :sub:`12`
856 - Y'\ :sub:`13`
857 * - start + 16:
858 - Y'\ :sub:`20`
859 - Y'\ :sub:`21`
860 - Y'\ :sub:`22`
861 - Y'\ :sub:`23`
862 * - start + 24:
863 - Y'\ :sub:`30`
864 - Y'\ :sub:`31`
865 - Y'\ :sub:`32`
866 - Y'\ :sub:`33`
867 * - start + 32:
868 - Cb\ :sub:`00`
869 - Cr\ :sub:`00`
870 - Cb\ :sub:`01`
871 - Cr\ :sub:`01`
872 * - start + 40:
873 - Cb\ :sub:`10`
874 - Cr\ :sub:`10`
875 - Cb\ :sub:`11`
876 - Cr\ :sub:`11`
877
878 .. _V4L2-PIX-FMT-P012:
879 .. _V4L2-PIX-FMT-P012M:
880
881 P012 and P012M
882 --------------
883
884 P012 is like NV12 with 12 bits per component, expanded to 16 bits.
885 Data in the 12 high bits, zeros in the 4 low bits, arranged in little endian order.
886
887 .. flat-table:: Sample 4x4 P012 Image
888 :header-rows: 0
889 :stub-columns: 0
890
891 * - start + 0:
892 - Y'\ :sub:`00`
893 - Y'\ :sub:`01`
894 - Y'\ :sub:`02`
895 - Y'\ :sub:`03`
896 * - start + 8:
897 - Y'\ :sub:`10`
898 - Y'\ :sub:`11`
899 - Y'\ :sub:`12`
900 - Y'\ :sub:`13`
901 * - start + 16:
902 - Y'\ :sub:`20`
903 - Y'\ :sub:`21`
904 - Y'\ :sub:`22`
905 - Y'\ :sub:`23`
906 * - start + 24:
907 - Y'\ :sub:`30`
908 - Y'\ :sub:`31`
909 - Y'\ :sub:`32`
910 - Y'\ :sub:`33`
911 * - start + 32:
912 - Cb\ :sub:`00`
913 - Cr\ :sub:`00`
914 - Cb\ :sub:`01`
915 - Cr\ :sub:`01`
916 * - start + 40:
917 - Cb\ :sub:`10`
918 - Cr\ :sub:`10`
919 - Cb\ :sub:`11`
920 - Cr\ :sub:`11`
921
922 .. flat-table:: Sample 4x4 P012M Image
923 :header-rows: 0
924 :stub-columns: 0
925
926 * - start0 + 0:
927 - Y'\ :sub:`00`
928 - Y'\ :sub:`01`
929 - Y'\ :sub:`02`
930 - Y'\ :sub:`03`
931 * - start0 + 8:
932 - Y'\ :sub:`10`
933 - Y'\ :sub:`11`
934 - Y'\ :sub:`12`
935 - Y'\ :sub:`13`
936 * - start0 + 16:
937 - Y'\ :sub:`20`
938 - Y'\ :sub:`21`
939 - Y'\ :sub:`22`
940 - Y'\ :sub:`23`
941 * - start0 + 24:
942 - Y'\ :sub:`30`
943 - Y'\ :sub:`31`
944 - Y'\ :sub:`32`
945 - Y'\ :sub:`33`
946 * -
947 * - start1 + 0:
948 - Cb\ :sub:`00`
949 - Cr\ :sub:`00`
950 - Cb\ :sub:`01`
951 - Cr\ :sub:`01`
952 * - start1 + 8:
953 - Cb\ :sub:`10`
954 - Cr\ :sub:`10`
955 - Cb\ :sub:`11`
956 - Cr\ :sub:`11`
957
958
959 Fully Planar YUV Formats
960 ========================
961
962 These formats store the Y, Cb and Cr components in three separate planes. The
963 luma plane comes first, and the order of the two chroma planes varies between
964 formats. The two chroma planes always use the same subsampling.
965
966 For memory contiguous formats, the number of padding pixels at the end of the
967 chroma lines is identical to the padding of the luma lines. The chroma line
968 stride (in bytes) is thus equal to the luma line stride divided by the
969 horizontal subsampling factor. Vertical subsampling doesn't affect the line
970 stride.
971
972 For non-contiguous formats, no constraints are enforced by the format on the
973 relationship between the luma and chroma line padding and stride.
974
975 All components are stored with the same number of bits per component.
976
977 ``V4L2_PIX_FMT_P010_4L4`` stores pixels in 4x4 tiles, and stores tiles linearly
978 in memory. The line stride must be aligned to multiple of 8 and image height to
979 a multiple of 4. The layouts of the luma and chroma planes are identical.
980
981 .. raw:: latex
982
983 \small
984
985 .. tabularcolumns:: |p{5.0cm}|p{1.1cm}|p{1.5cm}|p{2.2cm}|p{1.2cm}|p{3.7cm}|
986
987 .. flat-table:: Overview of Fully Planar YUV Formats
988 :header-rows: 1
989 :stub-columns: 0
990
991 * - Identifier
992 - Code
993 - Bits per component
994 - Subsampling
995 - Planes order [4]_
996 - Contiguous [5]_
997
998 * - V4L2_PIX_FMT_YUV410
999 - 'YUV9'
1000 - 8
1001 - 4:1:0
1002 - Y, Cb, Cr
1003 - Yes
1004 * - V4L2_PIX_FMT_YVU410
1005 - 'YVU9'
1006 - 8
1007 - 4:1:0
1008 - Y, Cr, Cb
1009 - Yes
1010 * - V4L2_PIX_FMT_YUV411P
1011 - '411P'
1012 - 8
1013 - 4:1:1
1014 - Y, Cb, Cr
1015 - Yes
1016 * - V4L2_PIX_FMT_YUV420M
1017 - 'YM12'
1018 - 8
1019 - 4:2:0
1020 - Y, Cb, Cr
1021 - No
1022 * - V4L2_PIX_FMT_YVU420M
1023 - 'YM21'
1024 - 8
1025 - 4:2:0
1026 - Y, Cr, Cb
1027 - No
1028 * - V4L2_PIX_FMT_YUV420
1029 - 'YU12'
1030 - 8
1031 - 4:2:0
1032 - Y, Cb, Cr
1033 - Yes
1034 * - V4L2_PIX_FMT_YVU420
1035 - 'YV12'
1036 - 8
1037 - 4:2:0
1038 - Y, Cr, Cb
1039 - Yes
1040 * - V4L2_PIX_FMT_YUV422P
1041 - '422P'
1042 - 8
1043 - 4:2:2
1044 - Y, Cb, Cr
1045 - Yes
1046 * - V4L2_PIX_FMT_YUV422M
1047 - 'YM16'
1048 - 8
1049 - 4:2:2
1050 - Y, Cb, Cr
1051 - No
1052 * - V4L2_PIX_FMT_YVU422M
1053 - 'YM61'
1054 - 8
1055 - 4:2:2
1056 - Y, Cr, Cb
1057 - No
1058 * - V4L2_PIX_FMT_YUV444M
1059 - 'YM24'
1060 - 8
1061 - 4:4:4
1062 - Y, Cb, Cr
1063 - No
1064 * - V4L2_PIX_FMT_YVU444M
1065 - 'YM42'
1066 - 8
1067 - 4:4:4
1068 - Y, Cr, Cb
1069 - No
1071 .. raw:: latex
1073 \normalsize
1075 .. [4] Order of luma and chroma planes
1076 .. [5] Indicates if planes have to be contiguous in memory or can be
1077 disjoint
1080 **Color Sample Location:**
1081 Chroma samples are :ref:`interstitially sited<yuv-chroma-centered>`
1082 horizontally.
1084 .. _V4L2-PIX-FMT-YUV410:
1085 .. _V4L2-PIX-FMT-YVU410:
1087 YUV410 and YVU410
1088 -----------------
1090 Planar YUV 4:1:0 formats. The chroma planes are subsampled by 4 in each
1091 direction. Chroma lines contain a quarter of the number of pixels and bytes of
1092 the luma lines, and the chroma planes contain a quarter of the number of lines
1093 of the luma plane.
1095 .. flat-table:: Sample 4x4 YUV410 Image
1096 :header-rows: 0
1097 :stub-columns: 0
1099 * - start + 0:
1100 - Y'\ :sub:`00`
1101 - Y'\ :sub:`01`
1102 - Y'\ :sub:`02`
1103 - Y'\ :sub:`03`
1104 * - start + 4:
1105 - Y'\ :sub:`10`
1106 - Y'\ :sub:`11`
1107 - Y'\ :sub:`12`
1108 - Y'\ :sub:`13`
1109 * - start + 8:
1110 - Y'\ :sub:`20`
1111 - Y'\ :sub:`21`
1112 - Y'\ :sub:`22`
1113 - Y'\ :sub:`23`
1114 * - start + 12:
1115 - Y'\ :sub:`30`
1116 - Y'\ :sub:`31`
1117 - Y'\ :sub:`32`
1118 - Y'\ :sub:`33`
1119 * - start + 16:
1120 - Cr\ :sub:`00`
1121 * - start + 17:
1122 - Cb\ :sub:`00`
1125 .. _V4L2-PIX-FMT-YUV411P:
1127 YUV411P
1128 -------
1130 Planar YUV 4:1:1 formats. The chroma planes are subsampled by 4 in the
1131 horizontal direction. Chroma lines contain a quarter of the number of pixels
1132 and bytes of the luma lines, and the chroma planes contain the same number of
1133 lines as the luma plane.
1135 .. flat-table:: Sample 4x4 YUV411P Image
1136 :header-rows: 0
1137 :stub-columns: 0
1139 * - start + 0:
1140 - Y'\ :sub:`00`
1141 - Y'\ :sub:`01`
1142 - Y'\ :sub:`02`
1143 - Y'\ :sub:`03`
1144 * - start + 4:
1145 - Y'\ :sub:`10`
1146 - Y'\ :sub:`11`
1147 - Y'\ :sub:`12`
1148 - Y'\ :sub:`13`
1149 * - start + 8:
1150 - Y'\ :sub:`20`
1151 - Y'\ :sub:`21`
1152 - Y'\ :sub:`22`
1153 - Y'\ :sub:`23`
1154 * - start + 12:
1155 - Y'\ :sub:`30`
1156 - Y'\ :sub:`31`
1157 - Y'\ :sub:`32`
1158 - Y'\ :sub:`33`
1159 * - start + 16:
1160 - Cb\ :sub:`00`
1161 * - start + 17:
1162 - Cb\ :sub:`10`
1163 * - start + 18:
1164 - Cb\ :sub:`20`
1165 * - start + 19:
1166 - Cb\ :sub:`30`
1167 * - start + 20:
1168 - Cr\ :sub:`00`
1169 * - start + 21:
1170 - Cr\ :sub:`10`
1171 * - start + 22:
1172 - Cr\ :sub:`20`
1173 * - start + 23:
1174 - Cr\ :sub:`30`
1177 .. _V4L2-PIX-FMT-YUV420:
1178 .. _V4L2-PIX-FMT-YVU420:
1179 .. _V4L2-PIX-FMT-YUV420M:
1180 .. _V4L2-PIX-FMT-YVU420M:
1182 YUV420, YVU420, YUV420M and YVU420M
1183 -----------------------------------
1185 Planar YUV 4:2:0 formats. The chroma planes are subsampled by 2 in each
1186 direction. Chroma lines contain half of the number of pixels and bytes of the
1187 luma lines, and the chroma planes contain half of the number of lines of the
1188 luma plane.
1190 .. flat-table:: Sample 4x4 YUV420 Image
1191 :header-rows: 0
1192 :stub-columns: 0
1194 * - start + 0:
1195 - Y'\ :sub:`00`
1196 - Y'\ :sub:`01`
1197 - Y'\ :sub:`02`
1198 - Y'\ :sub:`03`
1199 * - start + 4:
1200 - Y'\ :sub:`10`
1201 - Y'\ :sub:`11`
1202 - Y'\ :sub:`12`
1203 - Y'\ :sub:`13`
1204 * - start + 8:
1205 - Y'\ :sub:`20`
1206 - Y'\ :sub:`21`
1207 - Y'\ :sub:`22`
1208 - Y'\ :sub:`23`
1209 * - start + 12:
1210 - Y'\ :sub:`30`
1211 - Y'\ :sub:`31`
1212 - Y'\ :sub:`32`
1213 - Y'\ :sub:`33`
1214 * - start + 16:
1215 - Cr\ :sub:`00`
1216 - Cr\ :sub:`01`
1217 * - start + 18:
1218 - Cr\ :sub:`10`
1219 - Cr\ :sub:`11`
1220 * - start + 20:
1221 - Cb\ :sub:`00`
1222 - Cb\ :sub:`01`
1223 * - start + 22:
1224 - Cb\ :sub:`10`
1225 - Cb\ :sub:`11`
1227 .. flat-table:: Sample 4x4 YUV420M Image
1228 :header-rows: 0
1229 :stub-columns: 0
1231 * - start0 + 0:
1232 - Y'\ :sub:`00`
1233 - Y'\ :sub:`01`
1234 - Y'\ :sub:`02`
1235 - Y'\ :sub:`03`
1236 * - start0 + 4:
1237 - Y'\ :sub:`10`
1238 - Y'\ :sub:`11`
1239 - Y'\ :sub:`12`
1240 - Y'\ :sub:`13`
1241 * - start0 + 8:
1242 - Y'\ :sub:`20`
1243 - Y'\ :sub:`21`
1244 - Y'\ :sub:`22`
1245 - Y'\ :sub:`23`
1246 * - start0 + 12:
1247 - Y'\ :sub:`30`
1248 - Y'\ :sub:`31`
1249 - Y'\ :sub:`32`
1250 - Y'\ :sub:`33`
1251 * -
1252 * - start1 + 0:
1253 - Cb\ :sub:`00`
1254 - Cb\ :sub:`01`
1255 * - start1 + 2:
1256 - Cb\ :sub:`10`
1257 - Cb\ :sub:`11`
1258 * -
1259 * - start2 + 0:
1260 - Cr\ :sub:`00`
1261 - Cr\ :sub:`01`
1262 * - start2 + 2:
1263 - Cr\ :sub:`10`
1264 - Cr\ :sub:`11`
1267 .. _V4L2-PIX-FMT-YUV422P:
1268 .. _V4L2-PIX-FMT-YUV422M:
1269 .. _V4L2-PIX-FMT-YVU422M:
1271 YUV422P, YUV422M and YVU422M
1272 ----------------------------
1274 Planar YUV 4:2:2 formats. The chroma planes are subsampled by 2 in the
1275 horizontal direction. Chroma lines contain half of the number of pixels and
1276 bytes of the luma lines, and the chroma planes contain the same number of lines
1277 as the luma plane.
1279 .. flat-table:: Sample 4x4 YUV422P Image
1280 :header-rows: 0
1281 :stub-columns: 0
1283 * - start + 0:
1284 - Y'\ :sub:`00`
1285 - Y'\ :sub:`01`
1286 - Y'\ :sub:`02`
1287 - Y'\ :sub:`03`
1288 * - start + 4:
1289 - Y'\ :sub:`10`
1290 - Y'\ :sub:`11`
1291 - Y'\ :sub:`12`
1292 - Y'\ :sub:`13`
1293 * - start + 8:
1294 - Y'\ :sub:`20`
1295 - Y'\ :sub:`21`
1296 - Y'\ :sub:`22`
1297 - Y'\ :sub:`23`
1298 * - start + 12:
1299 - Y'\ :sub:`30`
1300 - Y'\ :sub:`31`
1301 - Y'\ :sub:`32`
1302 - Y'\ :sub:`33`
1303 * - start + 16:
1304 - Cb\ :sub:`00`
1305 - Cb\ :sub:`01`
1306 * - start + 18:
1307 - Cb\ :sub:`10`
1308 - Cb\ :sub:`11`
1309 * - start + 20:
1310 - Cb\ :sub:`20`
1311 - Cb\ :sub:`21`
1312 * - start + 22:
1313 - Cb\ :sub:`30`
1314 - Cb\ :sub:`31`
1315 * - start + 24:
1316 - Cr\ :sub:`00`
1317 - Cr\ :sub:`01`
1318 * - start + 26:
1319 - Cr\ :sub:`10`
1320 - Cr\ :sub:`11`
1321 * - start + 28:
1322 - Cr\ :sub:`20`
1323 - Cr\ :sub:`21`
1324 * - start + 30:
1325 - Cr\ :sub:`30`
1326 - Cr\ :sub:`31`
1328 .. flat-table:: Sample 4x4 YUV422M Image
1329 :header-rows: 0
1330 :stub-columns: 0
1332 * - start0 + 0:
1333 - Y'\ :sub:`00`
1334 - Y'\ :sub:`01`
1335 - Y'\ :sub:`02`
1336 - Y'\ :sub:`03`
1337 * - start0 + 4:
1338 - Y'\ :sub:`10`
1339 - Y'\ :sub:`11`
1340 - Y'\ :sub:`12`
1341 - Y'\ :sub:`13`
1342 * - start0 + 8:
1343 - Y'\ :sub:`20`
1344 - Y'\ :sub:`21`
1345 - Y'\ :sub:`22`
1346 - Y'\ :sub:`23`
1347 * - start0 + 12:
1348 - Y'\ :sub:`30`
1349 - Y'\ :sub:`31`
1350 - Y'\ :sub:`32`
1351 - Y'\ :sub:`33`
1352 * -
1353 * - start1 + 0:
1354 - Cb\ :sub:`00`
1355 - Cb\ :sub:`01`
1356 * - start1 + 2:
1357 - Cb\ :sub:`10`
1358 - Cb\ :sub:`11`
1359 * - start1 + 4:
1360 - Cb\ :sub:`20`
1361 - Cb\ :sub:`21`
1362 * - start1 + 6:
1363 - Cb\ :sub:`30`
1364 - Cb\ :sub:`31`
1365 * -
1366 * - start2 + 0:
1367 - Cr\ :sub:`00`
1368 - Cr\ :sub:`01`
1369 * - start2 + 2:
1370 - Cr\ :sub:`10`
1371 - Cr\ :sub:`11`
1372 * - start2 + 4:
1373 - Cr\ :sub:`20`
1374 - Cr\ :sub:`21`
1375 * - start2 + 6:
1376 - Cr\ :sub:`30`
1377 - Cr\ :sub:`31`
1380 .. _V4L2-PIX-FMT-YUV444M:
1381 .. _V4L2-PIX-FMT-YVU444M:
1383 YUV444M and YVU444M
1384 -------------------
1386 Planar YUV 4:4:4 formats. The chroma planes are no subsampled. Chroma lines
1387 contain the same number of pixels and bytes of the luma lines, and the chroma
1388 planes contain the same number of lines as the luma plane.
1390 .. flat-table:: Sample 4x4 YUV444M Image
1391 :header-rows: 0
1392 :stub-columns: 0
1394 * - start0 + 0:
1395 - Y'\ :sub:`00`
1396 - Y'\ :sub:`01`
1397 - Y'\ :sub:`02`
1398 - Y'\ :sub:`03`
1399 * - start0 + 4:
1400 - Y'\ :sub:`10`
1401 - Y'\ :sub:`11`
1402 - Y'\ :sub:`12`
1403 - Y'\ :sub:`13`
1404 * - start0 + 8:
1405 - Y'\ :sub:`20`
1406 - Y'\ :sub:`21`
1407 - Y'\ :sub:`22`
1408 - Y'\ :sub:`23`
1409 * - start0 + 12:
1410 - Y'\ :sub:`30`
1411 - Y'\ :sub:`31`
1412 - Y'\ :sub:`32`
1413 - Y'\ :sub:`33`
1414 * -
1415 * - start1 + 0:
1416 - Cb\ :sub:`00`
1417 - Cb\ :sub:`01`
1418 - Cb\ :sub:`02`
1419 - Cb\ :sub:`03`
1420 * - start1 + 4:
1421 - Cb\ :sub:`10`
1422 - Cb\ :sub:`11`
1423 - Cb\ :sub:`12`
1424 - Cb\ :sub:`13`
1425 * - start1 + 8:
1426 - Cb\ :sub:`20`
1427 - Cb\ :sub:`21`
1428 - Cb\ :sub:`22`
1429 - Cb\ :sub:`23`
1430 * - start1 + 12:
1431 - Cb\ :sub:`20`
1432 - Cb\ :sub:`21`
1433 - Cb\ :sub:`32`
1434 - Cb\ :sub:`33`
1435 * -
1436 * - start2 + 0:
1437 - Cr\ :sub:`00`
1438 - Cr\ :sub:`01`
1439 - Cr\ :sub:`02`
1440 - Cr\ :sub:`03`
1441 * - start2 + 4:
1442 - Cr\ :sub:`10`
1443 - Cr\ :sub:`11`
1444 - Cr\ :sub:`12`
1445 - Cr\ :sub:`13`
1446 * - start2 + 8:
1447 - Cr\ :sub:`20`
1448 - Cr\ :sub:`21`
1449 - Cr\ :sub:`22`
1450 - Cr\ :sub:`23`
1451 * - start2 + 12:
1452 - Cr\ :sub:`30`
1453 - Cr\ :sub:`31`
1454 - Cr\ :sub:`32`
1455 - Cr\ :sub:`33`

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

평면 분리와 메모리 연속성

1-31

평면형 포맷은 휘도와 색차 데이터를 서로 다른 메모리 영역으로 나눕니다. 반평면 포맷은 Y 성분을 담는 휘도 평면과 Cb·Cr 성분을 교차 저장하는 색차 평면의 두 평면을 사용합니다. 완전 평면 포맷은 Y, Cb, Cr을 각각 별도 평면에 저장합니다.

평면 안의 성분은 픽셀 순서로 저장하며 선형 또는 타일 순서일 수 있습니다. 행 끝 패딩을 허용할 수 있고 색차 평면의 행 stride가 휘도 평면 stride에 종속될 수 있습니다.

이름에 `M` 접미사가 붙은 포맷은 각 평면을 독립된 메모리 위치에 둘 수 있으며 다중 평면 API를 지원하는 드라이버와 애플리케이션에서만 사용합니다. 비연속 평면 지원을 명시하지 않은 포맷은 모든 평면이 메모리에서 바로 이어져야 합니다.

.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later

.. planar-yuv:

******************
Planar YUV formats
******************

Planar formats split luma and chroma data in separate memory regions. They
exist in two variants:

- Semi-planar formats use two planes. The first plane is the luma plane and
  stores the Y components. The second plane is the chroma plane and stores the
  Cb and Cr components interleaved.

- Fully planar formats use three planes to store the Y, Cb and Cr components
  separately.

Within a plane, components are stored in pixel order, which may be linear or
tiled. Padding may be supported at the end of the lines, and the line stride of
the chroma planes may be constrained by the line stride of the luma plane.

Some planar formats allow planes to be placed in independent memory locations.
They are identified by an 'M' suffix in their name (such as in
``V4L2_PIX_FMT_NV12M``). Those formats are intended to be used only in drivers
and applications that support the multi-planar API, described in
:ref:`planar-apis`. Unless explicitly documented as supporting non-contiguous
planes, formats require the planes to follow each other immediately in memory.


Semi-Planar YUV Formats

반평면 NV 포맷 개요

32-232

NV12, NV16 등으로 부르는 반평면 포맷은 첫 평면에 Y를, 두 번째 평면에 Cb와 Cr을 쌍으로 교차 저장합니다. Cb·Cr 순서가 반대인 경우 별도 포맷으로 노출됩니다.

메모리 연속 포맷에서는 색차 행 끝 패딩 픽셀 수가 휘도 행과 같습니다. 수평 서브샘플링이 없으면 색차 행 stride(바이트)는 휘도 stride의 두 배이고, 2배 수평 서브샘플링이면 두 stride가 같습니다. 수직 서브샘플링은 행 stride에 영향을 주지 않습니다. 비연속 포맷은 두 평면의 패딩과 stride 관계를 강제하지 않습니다.

모든 성분은 같은 성분당 비트 수로 저장합니다. 두 번째 평면의 색차 샘플은 수평으로 픽셀 사이에 위치합니다.

반평면 YUV 포맷 목록
식별자FourCC비트서브샘플링색차 순서평면타일링
V4L2_PIX_FMT_NV12NV1284:2:0Cb, Cr연속선형
V4L2_PIX_FMT_NV21NV2184:2:0Cr, Cb연속선형
V4L2_PIX_FMT_NV12MNM1284:2:0Cb, Cr분리선형
V4L2_PIX_FMT_NV21MNM2184:2:0Cr, Cb분리선형
V4L2_PIX_FMT_NV12MTTM1284:2:0Cb, Cr분리64×32 타일, 수평 Z 순서
V4L2_PIX_FMT_NV12MT_16X16VM1284:2:2Cb, Cr분리16×16 타일
V4L2_PIX_FMT_P010P010104:2:0Cb, Cr연속선형
V4L2_PIX_FMT_P010_4L4T010104:2:0Cb, Cr연속4×4 타일
V4L2_PIX_FMT_P012P012124:2:0Cb, Cr연속선형
V4L2_PIX_FMT_P012MPM12124:2:0Cb, Cr분리선형
V4L2_PIX_FMT_NV15NV15104:2:0Cb, Cr연속선형
V4L2_PIX_FMT_NV15_4L4VT15154:2:0Cb, Cr연속4×4 타일
V4L2_PIX_FMT_MT2110TMT2T154:2:0Cb, Cr분리16×32/16×16 타일, 하위 비트 타일 순서
V4L2_PIX_FMT_MT2110RMT2R154:2:0Cb, Cr분리16×32/16×16 타일, 하위 비트 래스터 순서
V4L2_PIX_FMT_NV16NV1684:2:2Cb, Cr연속선형
V4L2_PIX_FMT_NV61NV6184:2:2Cr, Cb연속선형
V4L2_PIX_FMT_NV16MNM1684:2:2Cb, Cr분리선형
V4L2_PIX_FMT_NV61MNM6184:2:2Cr, Cb분리선형
V4L2_PIX_FMT_NV20NV20104:2:2Cb, Cr연속선형
V4L2_PIX_FMT_NV24NV2484:4:4Cb, Cr연속선형
V4L2_PIX_FMT_NV42NV4284:4:4Cr, Cb연속선형

색차 순서는 두 번째 평면의 샘플 순서이고, 연속성은 평면을 분리된 메모리에 둘 수 있는지를 뜻합니다.

=======================

These formats are commonly referred to as NV formats (NV12, NV16, ...). They
use two planes, and store the luma components in the first plane and the chroma
components in the second plane. The Cb and Cr components are interleaved in the
chroma plane, with Cb and Cr always stored in pairs. The chroma order is
exposed as different formats.

For memory contiguous formats, the number of padding pixels at the end of the
chroma lines is identical to the padding of the luma lines. Without horizontal
subsampling, the chroma line stride (in bytes) is thus equal to twice the luma
line stride. With horizontal subsampling by 2, the chroma line stride is equal
to the luma line stride. Vertical subsampling doesn't affect the line stride.

For non-contiguous formats, no constraints are enforced by the format on the
relationship between the luma and chroma line padding and stride.

All components are stored with the same number of bits per component.

.. raw:: latex

    \footnotesize

.. tabularcolumns:: |p{5.2cm}|p{1.0cm}|p{1.5cm}|p{1.9cm}|p{1.2cm}|p{1.8cm}|p{2.7cm}|

.. flat-table:: Overview of Semi-Planar YUV Formats
    :header-rows:  1
    :stub-columns: 0

    * - Identifier
      - Code
      - Bits per component
      - Subsampling
      - Chroma order [1]_
      - Contiguous [2]_
      - Tiling [3]_
    * - V4L2_PIX_FMT_NV12
      - 'NV12'
      - 8
      - 4:2:0
      - Cb, Cr
      - Yes
      - Linear
    * - V4L2_PIX_FMT_NV21
      - 'NV21'
      - 8
      - 4:2:0
      - Cr, Cb
      - Yes
      - Linear
    * - V4L2_PIX_FMT_NV12M
      - 'NM12'
      - 8
      - 4:2:0
      - Cb, Cr
      - No
      - Linear
    * - V4L2_PIX_FMT_NV21M
      - 'NM21'
      - 8
      - 4:2:0
      - Cr, Cb
      - No
      - Linear
    * - V4L2_PIX_FMT_NV12MT
      - 'TM12'
      - 8
      - 4:2:0
      - Cb, Cr
      - No
      - 64x32 tiles

        Horizontal Z order
    * - V4L2_PIX_FMT_NV12MT_16X16
      - 'VM12'
      - 8
      - 4:2:2
      - Cb, Cr
      - No
      - 16x16 tiles
    * - V4L2_PIX_FMT_P010
      - 'P010'
      - 10
      - 4:2:0
      - Cb, Cr
      - Yes
      - Linear
    * - V4L2_PIX_FMT_P010_4L4
      - 'T010'
      - 10
      - 4:2:0
      - Cb, Cr
      - Yes
      - 4x4 tiles
    * - V4L2_PIX_FMT_P012
      - 'P012'
      - 12
      - 4:2:0
      - Cb, Cr
      - Yes
      - Linear
    * - V4L2_PIX_FMT_P012M
      - 'PM12'
      - 12
      - 4:2:0
      - Cb, Cr
      - No
      - Linear
    * - V4L2_PIX_FMT_NV15
      - 'NV15'
      - 10
      - 4:2:0
      - Cb, Cr
      - Yes
      - Linear
    * - V4L2_PIX_FMT_NV15_4L4
      - 'VT15'
      - 15
      - 4:2:0
      - Cb, Cr
      - Yes
      - 4x4 tiles
    * - V4L2_PIX_FMT_MT2110T
      - 'MT2T'
      - 15
      - 4:2:0
      - Cb, Cr
      - No
      - 16x32 / 16x16 tiles tiled low bits
    * - V4L2_PIX_FMT_MT2110R
      - 'MT2R'
      - 15
      - 4:2:0
      - Cb, Cr
      - No
      - 16x32 / 16x16 tiles raster low bits
    * - V4L2_PIX_FMT_NV16
      - 'NV16'
      - 8
      - 4:2:2
      - Cb, Cr
      - Yes
      - Linear
    * - V4L2_PIX_FMT_NV61
      - 'NV61'
      - 8
      - 4:2:2
      - Cr, Cb
      - Yes
      - Linear
    * - V4L2_PIX_FMT_NV16M
      - 'NM16'
      - 8
      - 4:2:2
      - Cb, Cr
      - No
      - Linear
    * - V4L2_PIX_FMT_NV61M
      - 'NM61'
      - 8
      - 4:2:2
      - Cr, Cb
      - No
      - Linear
    * - V4L2_PIX_FMT_NV20
      - 'NV20'
      - 10
      - 4:2:2
      - Cb, Cr
      - Yes
      - Linear
    * - V4L2_PIX_FMT_NV24
      - 'NV24'
      - 8
      - 4:4:4
      - Cb, Cr
      - Yes
      - Linear
    * - V4L2_PIX_FMT_NV42
      - 'NV42'
      - 8
      - 4:4:4
      - Cr, Cb
      - Yes
      - Linear

.. raw:: latex

    \normalsize

.. [1] Order of chroma samples in the second plane
.. [2] Indicates if planes have to be contiguous in memory or can be
       disjoint
.. [3] Macroblock size in pixels


**Color Sample Location:**
Chroma samples are :ref:`interstitially sited<yuv-chroma-centered>`
horizontally.

NV12·NV21·NV12M·NV21M

233-318

이 포맷들은 반평면 YUV 4:2:0입니다. 색차 평면은 가로와 세로 방향으로 각각 2배 서브샘플링됩니다. 색차 행은 픽셀 수가 휘도 행의 절반이지만 바이트 수는 같고, 색차 평면의 행 수는 휘도 평면의 절반입니다. NV21 계열은 아래 Cb·Cr 순서를 Cr·Cb로 바꿉니다.

4×4 NV12 연속 메모리
오프셋B0B1B2B3
start + 0Y'00Y'01Y'02Y'03
start + 4Y'10Y'11Y'12Y'13
start + 8Y'20Y'21Y'22Y'23
start + 12Y'30Y'31Y'32Y'33
start + 16Cb00Cr00Cb01Cr01
start + 20Cb10Cr10Cb11Cr11

16바이트 Y 평면 다음에 8바이트 CbCr 평면이 이어집니다.

4×4 NV12M 분리 메모리
오프셋B0B1B2B3
start0 + 0Y'00Y'01Y'02Y'03
start0 + 4Y'10Y'11Y'12Y'13
start0 + 8Y'20Y'21Y'22Y'23
start0 + 12Y'30Y'31Y'32Y'33
start1 + 0Cb00Cr00Cb01Cr01
start1 + 4Cb10Cr10Cb11Cr11

Y는 start0, CbCr은 독립된 start1 주소에서 시작합니다.

.. _V4L2-PIX-FMT-NV12:
.. _V4L2-PIX-FMT-NV21:
.. _V4L2-PIX-FMT-NV12M:
.. _V4L2-PIX-FMT-NV21M:
.. _V4L2-PIX-FMT-P010:

NV12, NV21, NV12M and NV21M
---------------------------

Semi-planar YUV 4:2:0 formats. The chroma plane is subsampled by 2 in each
direction. Chroma lines contain half the number of pixels and the same number
of bytes as luma lines, and the chroma plane contains half the number of lines
of the luma plane.

.. flat-table:: Sample 4x4 NV12 Image
    :header-rows:  0
    :stub-columns: 0

    * - start + 0:
      - Y'\ :sub:`00`
      - Y'\ :sub:`01`
      - Y'\ :sub:`02`
      - Y'\ :sub:`03`
    * - start + 4:
      - Y'\ :sub:`10`
      - Y'\ :sub:`11`
      - Y'\ :sub:`12`
      - Y'\ :sub:`13`
    * - start + 8:
      - Y'\ :sub:`20`
      - Y'\ :sub:`21`
      - Y'\ :sub:`22`
      - Y'\ :sub:`23`
    * - start + 12:
      - Y'\ :sub:`30`
      - Y'\ :sub:`31`
      - Y'\ :sub:`32`
      - Y'\ :sub:`33`
    * - start + 16:
      - Cb\ :sub:`00`
      - Cr\ :sub:`00`
      - Cb\ :sub:`01`
      - Cr\ :sub:`01`
    * - start + 20:
      - Cb\ :sub:`10`
      - Cr\ :sub:`10`
      - Cb\ :sub:`11`
      - Cr\ :sub:`11`

.. flat-table:: Sample 4x4 NV12M Image
    :header-rows:  0
    :stub-columns: 0

    * - start0 + 0:
      - Y'\ :sub:`00`
      - Y'\ :sub:`01`
      - Y'\ :sub:`02`
      - Y'\ :sub:`03`
    * - start0 + 4:
      - Y'\ :sub:`10`
      - Y'\ :sub:`11`
      - Y'\ :sub:`12`
      - Y'\ :sub:`13`
    * - start0 + 8:
      - Y'\ :sub:`20`
      - Y'\ :sub:`21`
      - Y'\ :sub:`22`
      - Y'\ :sub:`23`
    * - start0 + 12:
      - Y'\ :sub:`30`
      - Y'\ :sub:`31`
      - Y'\ :sub:`32`
      - Y'\ :sub:`33`
    * -
    * - start1 + 0:
      - Cb\ :sub:`00`
      - Cr\ :sub:`00`
      - Cb\ :sub:`01`
      - Cr\ :sub:`01`
    * - start1 + 4:
      - Cb\ :sub:`10`
      - Cr\ :sub:`10`
      - Cb\ :sub:`11`
      - Cr\ :sub:`11`

선형 NV15

319-369

NV15는 NV12와 비슷한 반평면 10비트 YUV 4:2:0 포맷입니다. 성분 사이에 패딩이 없고 4개 성분을 5바이트에 리틀 엔디언 순서로 패킹합니다.

NV15 10비트 패킹
오프셋B0B1B2B3B4
Y row 0 / start + 0Y00[7:0]Y01[5:0]|Y00[9:8]Y02[3:0]|Y01[9:6]Y03[1:0]|Y02[9:4]Y03[9:2]
Y row 1 / start + 5Y10[7:0]Y11[5:0]|Y10[9:8]Y12[3:0]|Y11[9:6]Y13[1:0]|Y12[9:4]Y13[9:2]
Y row 2 / start + 10Y20[7:0]Y21[5:0]|Y20[9:8]Y22[3:0]|Y21[9:6]Y23[1:0]|Y22[9:4]Y23[9:2]
Y row 3 / start + 15Y30[7:0]Y31[5:0]|Y30[9:8]Y32[3:0]|Y31[9:6]Y33[1:0]|Y32[9:4]Y33[9:2]
CbCr row 0 / start + 20Cb00[7:0]Cr00[5:0]|Cb00[9:8]Cb01[3:0]|Cr00[9:6]Cr01[1:0]|Cb01[9:4]Cr01[9:2]
CbCr row 1 / start + 25Cb10[7:0]Cr10[5:0]|Cb10[9:8]Cb11[3:0]|Cr10[9:6]Cr11[1:0]|Cb11[9:4]Cr11[9:2]

각 행은 4개 성분을 5바이트로 패킹합니다. 같은 규칙을 Y 행과 CbCr 행에 적용합니다.

.. _V4L2-PIX-FMT-NV15:

NV15
----

Semi-planar 10-bit YUV 4:2:0 format similar to NV12, using 10-bit components
with no padding between each component. A group of 4 components are stored over
5 bytes in little endian order.

.. flat-table:: Sample 4x4 NV15 Image (1 byte per cell)
    :header-rows:  0
    :stub-columns: 0

    * - start + 0:
      - Y'\ :sub:`00[7:0]`
      - Y'\ :sub:`01[5:0]`\ Y'\ :sub:`00[9:8]`
      - Y'\ :sub:`02[3:0]`\ Y'\ :sub:`01[9:6]`
      - Y'\ :sub:`03[1:0]`\ Y'\ :sub:`02[9:4]`
      - Y'\ :sub:`03[9:2]`
    * - start + 5:
      - Y'\ :sub:`10[7:0]`
      - Y'\ :sub:`11[5:0]`\ Y'\ :sub:`10[9:8]`
      - Y'\ :sub:`12[3:0]`\ Y'\ :sub:`11[9:6]`
      - Y'\ :sub:`13[1:0]`\ Y'\ :sub:`12[9:4]`
      - Y'\ :sub:`13[9:2]`
    * - start + 10:
      - Y'\ :sub:`20[7:0]`
      - Y'\ :sub:`21[5:0]`\ Y'\ :sub:`20[9:8]`
      - Y'\ :sub:`22[3:0]`\ Y'\ :sub:`21[9:6]`
      - Y'\ :sub:`23[1:0]`\ Y'\ :sub:`22[9:4]`
      - Y'\ :sub:`23[9:2]`
    * - start + 15:
      - Y'\ :sub:`30[7:0]`
      - Y'\ :sub:`31[5:0]`\ Y'\ :sub:`30[9:8]`
      - Y'\ :sub:`32[3:0]`\ Y'\ :sub:`31[9:6]`
      - Y'\ :sub:`33[1:0]`\ Y'\ :sub:`32[9:4]`
      - Y'\ :sub:`33[9:2]`
    * - start + 20:
      - Cb\ :sub:`00[7:0]`
      - Cr\ :sub:`00[5:0]`\ Cb\ :sub:`00[9:8]`
      - Cb\ :sub:`01[3:0]`\ Cr\ :sub:`00[9:6]`
      - Cr\ :sub:`01[1:0]`\ Cb\ :sub:`01[9:4]`
      - Cr\ :sub:`01[9:2]`
    * - start + 25:
      - Cb\ :sub:`10[7:0]`
      - Cr\ :sub:`10[5:0]`\ Cb\ :sub:`10[9:8]`
      - Cb\ :sub:`11[3:0]`\ Cr\ :sub:`10[9:6]`
      - Cr\ :sub:`11[1:0]`\ Cb\ :sub:`11[9:4]`
      - Cr\ :sub:`11[9:2]`

타일형 NV12

370-447

타일형 NV12는 반평면 YUV 4:2:0과 같은 서브샘플링을 사용하지만 픽셀을 매크로블록 타일에 배치합니다. 특별히 달리 설명하지 않으면 타일은 왼쪽에서 오른쪽, 위에서 아래 순서로 메모리에 선형 저장됩니다.

NV12 타일 변형
포맷타일메모리 순서정렬평면 조건
V4L2_PIX_FMT_NV12MT_16X1616×16선형stride·높이 16의 배수Y와 색차 배치 동일
V4L2_PIX_FMT_NV12MT64×322×2 타일 Z 순서, 수평으로 Z/반전 Z 교대stride 128픽셀, 높이 32픽셀의 배수세로 타일 수가 홀수면 마지막 행 선형
V4L2_PIX_FMT_NV12_4L44×4선형stride·높이 4의 배수Y와 색차 배치 동일
V4L2_PIX_FMT_NV12_16L1616×16선형stride·높이 16의 배수Y와 색차 배치 동일
V4L2_PIX_FMT_NV12_32L3232×32선형stride·높이 32의 배수Y와 색차 배치 동일
V4L2_PIX_FMT_NV12M_8L1288×128선형, 분리 평면높이 128의 배수Y와 색차 배치 동일
V4L2_PIX_FMT_NV12_8L1288×128선형, 한 메모리NV12M_8L128과 동일두 평면 연속
V4L2_PIX_FMT_MM21Y 16×32 / 색차 16×16선형, 분리 평면stride 16, 높이 32의 배수타일 크기는 달라도 Y·색차 타일 수 동일

stride와 높이는 포맷별 타일 경계에 정렬해야 합니다.

NV12MT 2×2 Z 배치
각 평면을 64×32 타일 격자로 나눕니다.인접한 2×2 타일을 Z 순서로 방문합니다.다음 수평 그룹은 반전 Z 순서로 방문합니다.마지막 세로 타일 행만 남으면 왼쪽부터 선형으로 저장합니다.

64×32 타일을 2×2 그룹으로 묶어 Z와 반전 Z 모양을 수평으로 번갈아 저장합니다.

.. _V4L2-PIX-FMT-NV12MT:
.. _V4L2-PIX-FMT-NV12MT-16X16:
.. _V4L2-PIX-FMT-NV12-4L4:
.. _V4L2-PIX-FMT-NV12-16L16:
.. _V4L2-PIX-FMT-NV12-32L32:
.. _V4L2-PIX-FMT-NV12M-8L128:
.. _V4L2-PIX-FMT-NV12-8L128:
.. _V4L2-PIX-FMT-MM21:

Tiled NV12
----------

Semi-planar YUV 4:2:0 formats, using macroblock tiling. The chroma plane is
subsampled by 2 in each direction. Chroma lines contain half the number of
pixels and the same number of bytes as luma lines, and the chroma plane
contains half the number of lines of the luma plane. Each tile follows the
previous one linearly in memory (from left to right, top to bottom).

``V4L2_PIX_FMT_NV12MT_16X16`` is similar to ``V4L2_PIX_FMT_NV12M`` but stores
pixels in 2D 16x16 tiles, and stores tiles linearly in memory.
The line stride and image height must be aligned to a multiple of 16.
The layouts of the luma and chroma planes are identical.

``V4L2_PIX_FMT_NV12MT`` is similar to ``V4L2_PIX_FMT_NV12M`` but stores
pixels in 2D 64x32 tiles, and stores 2x2 groups of tiles in
Z-order in memory, alternating Z and mirrored Z shapes horizontally.
The line stride must be a multiple of 128 pixels to ensure an
integer number of Z shapes. The image height must be a multiple of 32 pixels.
If the vertical resolution is an odd number of tiles, the last row of
tiles is stored in linear order. The layouts of the luma and chroma
planes are identical.

.. _nv12mt:

.. kernel-figure:: nv12mt.svg
    :alt:    nv12mt.svg
    :align:  center

    V4L2_PIX_FMT_NV12MT macroblock Z shape memory layout

.. _nv12mt_ex:

.. kernel-figure:: nv12mt_example.svg
    :alt:    nv12mt_example.svg
    :align:  center

    Example V4L2_PIX_FMT_NV12MT memory layout of tiles

``V4L2_PIX_FMT_NV12_4L4`` stores pixels in 4x4 tiles, and stores
tiles linearly in memory. The line stride and image height must be
aligned to a multiple of 4. The layouts of the luma and chroma planes are
identical.

``V4L2_PIX_FMT_NV12_16L16`` stores pixels in 16x16 tiles, and stores
tiles linearly in memory. The line stride and image height must be
aligned to a multiple of 16. The layouts of the luma and chroma planes are
identical.

``V4L2_PIX_FMT_NV12_32L32`` stores pixels in 32x32 tiles, and stores
tiles linearly in memory. The line stride and image height must be
aligned to a multiple of 32. The layouts of the luma and chroma planes are
identical.

``V4L2_PIX_FMT_NV12M_8L128`` is similar to ``V4L2_PIX_FMT_NV12M`` but stores
pixels in 2D 8x128 tiles, and stores tiles linearly in memory.
The image height must be aligned to a multiple of 128.
The layouts of the luma and chroma planes are identical.

``V4L2_PIX_FMT_NV12_8L128`` is similar to ``V4L2_PIX_FMT_NV12M_8L128`` but stores
two planes in one memory.

``V4L2_PIX_FMT_MM21`` store luma pixel in 16x32 tiles, and chroma pixels
in 16x16 tiles. The line stride must be aligned to a multiple of 16 and the
image height must be aligned to a multiple of 32. The number of luma and chroma
tiles are identical, even though the tile size differ. The image is formed of
two non-contiguous planes.

타일형 NV15와 MT2110

448-593

`V4L2_PIX_FMT_NV15_4L4`는 4×4 타일을 쓰는 반평면 10비트 YUV 4:2:0입니다. 성분 사이 패딩이 없으므로 Y 네 개 또는 UVUV 네 성분의 40비트를 5바이트에 저장합니다.

`V4L2_PIX_FMT_NV12M_10BE_8L128`은 10비트 픽셀을 8바이트×128바이트 타일에 빅 엔디언 순서로 저장합니다. 타일은 선형이며 높이는 128의 배수여야 합니다. 한 픽셀의 상·하위 비트가 서로 다른 타일에 놓일 수 있습니다. `V4L2_PIX_FMT_NV12_10BE_8L128`은 같은 배치의 두 평면을 한 메모리에 둡니다.

10비트 4성분 빅 엔디언 패킹
바이트비트 구성
Byte 0Y0[9:2]
Byte 1Y0[1:0] | Y1[9:4]
Byte 2Y1[3:0] | Y2[9:6]
Byte 3Y2[5:0] | Y3[9:8]
Byte 4Y3[7:0]

5바이트에 Y0~Y3을 패딩 없이 저장하는 휘도 예시입니다.

`V4L2_PIX_FMT_MT2110T`는 Mediatek의 패킹된 10비트 YUV 4:2:0 포맷입니다. NV15처럼 픽셀당 15비트를 완전히 패킹하지만 하위 2비트를 별도 파티션에 둡니다. Y 타일은 16×32, 색차 타일은 16×16이며 각 타일은 640바이트입니다. 타일은 80바이트 파티션 8개로 나뉘고, 파티션 앞 16바이트는 픽셀 하위 2비트, 나머지 64바이트는 상위 8비트입니다. 색차 타일은 파티션 4개만 사용합니다.

MT2110T 하위 2비트 파티션
비트start+0start+1...start+15
Bits 1:0Y0:0Y0:1...Y0:15
Bits 3:2Y1:0Y1:1...Y1:15
Bits 5:4Y2:0Y2:1...Y2:15
Bits 7:6Y3:0Y3:1...Y3:15

16×4 하위 타일에서 한 바이트의 네 2비트 필드가 같은 열의 4개 행을 담습니다.

각 파티션의 앞 16바이트를 제외하면 유효한 `V4L2_PIX_FMT_MM21` 프레임을 얻습니다. `V4L2_PIX_FMT_MT2110R`은 MT2110T와 같지만 하위 2비트를 래스터 순서로 둡니다. 첫 바이트가 첫 행의 4픽셀을 담고 한 행은 4바이트입니다.

MT2110R 하위 2비트 래스터 배치
오프셋B0 7:65:43:21:0...B3 7:65:43:21:0
start + 0Y0:3Y0:2Y0:1Y0:0...Y0:15Y0:14Y0:13Y0:12
start + 4Y1:3Y1:2Y1:1Y1:0...Y1:15Y1:14Y1:13Y1:12
start + 8Y2:3Y2:2Y2:1Y2:0...Y2:15Y2:14Y2:13Y2:12
start + 12Y3:3Y3:2Y3:1Y3:0...Y3:15Y3:14Y3:13Y3:12

각 행의 첫 바이트와 마지막 바이트가 담는 네 픽셀을 표시합니다.

.. _V4L2-PIX-FMT-NV15-4L4:
.. _V4L2-PIX-FMT-NV12M-10BE-8L128:
.. _V4L2-PIX-FMT-NV12-10BE-8L128:
.. _V4L2-PIX-FMT-MT2110T:
.. _V4L2-PIX-FMT-MT2110R:

Tiled NV15
----------

``V4L2_PIX_FMT_NV15_4L4`` Semi-planar 10-bit YUV 4:2:0 formats, using 4x4 tiling.
All components are packed without any padding between each other.
As a side-effect, each group of 4 components are stored over 5 bytes
(YYYY or UVUV = 4 * 10 bits = 40 bits = 5 bytes).

``V4L2_PIX_FMT_NV12M_10BE_8L128`` is similar to ``V4L2_PIX_FMT_NV12M`` but stores
10 bits pixels in 2D 8x128 tiles, and stores tiles linearly in memory.
the data is arranged in big endian order.
The image height must be aligned to a multiple of 128.
The layouts of the luma and chroma planes are identical.
Note the tile size is 8bytes multiplied by 128 bytes,
it means that the low bits and high bits of one pixel may be in different tiles.
The 10 bit pixels are packed, so 5 bytes contain 4 10-bit pixels layout like
this (for luma):
byte 0: Y0(bits 9-2)
byte 1: Y0(bits 1-0) Y1(bits 9-4)
byte 2: Y1(bits 3-0) Y2(bits 9-6)
byte 3: Y2(bits 5-0) Y3(bits 9-8)
byte 4: Y3(bits 7-0)

``V4L2_PIX_FMT_NV12_10BE_8L128`` is similar to ``V4L2_PIX_FMT_NV12M_10BE_8L128`` but stores
two planes in one memory.

``V4L2_PIX_FMT_MT2110T`` is one of Mediatek packed 10bit YUV 4:2:0 formats.
It is fully packed 10bit 4:2:0 format like NV15 (15 bits per pixel), except
that the lower two bits data is stored in separate partitions. The format is
composed of 16x32 luma tiles, and 16x16 chroma tiles. Each tiles is 640 bytes
long, divided into 8 partitions of 80 bytes.  The first 16 bytes of the
partition represent the 2 least significant bits of pixel data. The remaining
64 bytes represent the 8 most significant bits of pixel data.

.. kernel-figure:: mt2110t.svg
    :alt:    mt2110t.svg
    :align:  center

    Layout of MT2110T Chroma Tile

Filtering out the upper part of each partitions results in a valid
``V4L2_PIX_FMT_MM21`` frame. A partition is a sub-tile of size 16 x 4. The
lower two bits is said to be tiled since each bytes contains the lower two
bits of the column of for pixel matching the same index. The chroma tiles
only have 4 partitions.

.. flat-table:: MT2110T LSB bits layout
    :header-rows:  1
    :stub-columns: 1

    * -
      - start + 0:
      - start + 1:
      - . . .
      - start\ +\ 15:
    * - Bits 1:0
      - Y'\ :sub:`0:0`
      - Y'\ :sub:`0:1`
      - . . .
      - Y'\ :sub:`0:15`
    * - Bit 3:2
      - Y'\ :sub:`1:0`
      - Y'\ :sub:`1:1`
      - . . .
      - Y'\ :sub:`1:15`
    * - Bits 5:4
      - Y'\ :sub:`2:0`
      - Y'\ :sub:`2:1`
      - . . .
      - Y'\ :sub:`2:15`
    * - Bits 7:6
      - Y'\ :sub:`3:0`
      - Y'\ :sub:`3:1`
      - . . .
      - Y'\ :sub:`3:15`

``V4L2_PIX_FMT_MT2110R`` is identical to ``V4L2_PIX_FMT_MT2110T`` except that
the least significant two bits layout is in raster order. This means the first byte
contains 4 pixels of the first row, with 4 bytes per line.

.. flat-table:: MT2110R LSB bits layout
    :header-rows:  2
    :stub-columns: 1

    * -
      - :cspan:`3` Byte 0
      - ...
      - :cspan:`3` Byte 3
    * -
      - 7:6
      - 5:4
      - 3:2
      - 1:0
      - ...
      - 7:6
      - 5:4
      - 3:2
      - 1:0
    * - start + 0:
      - Y'\ :sub:`0:3`
      - Y'\ :sub:`0:2`
      - Y'\ :sub:`0:1`
      - Y'\ :sub:`0:0`
      - ...
      - Y'\ :sub:`0:15`
      - Y'\ :sub:`0:14`
      - Y'\ :sub:`0:13`
      - Y'\ :sub:`0:12`
    * - start + 4:
      - Y'\ :sub:`1:3`
      - Y'\ :sub:`1:2`
      - Y'\ :sub:`1:1`
      - Y'\ :sub:`1:0`
      - ...
      - Y'\ :sub:`1:15`
      - Y'\ :sub:`1:14`
      - Y'\ :sub:`1:13`
      - Y'\ :sub:`1:12`
    * - start + 8:
      - Y'\ :sub:`2:3`
      - Y'\ :sub:`2:2`
      - Y'\ :sub:`2:1`
      - Y'\ :sub:`2:0`
      - ...
      - Y'\ :sub:`2:15`
      - Y'\ :sub:`2:14`
      - Y'\ :sub:`2:13`
      - Y'\ :sub:`2:12`
    * - start\ +\ 12:
      - Y'\ :sub:`3:3`
      - Y'\ :sub:`3:2`
      - Y'\ :sub:`3:1`
      - Y'\ :sub:`3:0`
      - ...
      - Y'\ :sub:`3:15`
      - Y'\ :sub:`3:14`
      - Y'\ :sub:`3:13`
      - Y'\ :sub:`3:12`

NV16·NV61·NV16M·NV61M

594-698

이 포맷들은 반평면 YUV 4:2:2입니다. 색차 평면은 가로 방향만 2배 서브샘플링됩니다. 색차 행의 픽셀 수는 휘도 행의 절반이고 바이트 수는 같으며, 두 평면의 행 수는 같습니다. NV61 계열은 Cb·Cr 순서를 바꿉니다.

4×4 NV16 연속 메모리
오프셋B0B1B2B3
start + 0Y'00Y'01Y'02Y'03
start + 4Y'10Y'11Y'12Y'13
start + 8Y'20Y'21Y'22Y'23
start + 12Y'30Y'31Y'32Y'33
start + 16Cb00Cr00Cb01Cr01
start + 20Cb10Cr10Cb11Cr11
start + 24Cb20Cr20Cb21Cr21
start + 28Cb30Cr30Cb31Cr31

16바이트 Y 뒤에 행마다 4바이트인 CbCr 평면이 이어집니다.

4×4 NV16M 분리 메모리
오프셋B0B1B2B3
start0 + 0Y'00Y'01Y'02Y'03
start0 + 4Y'10Y'11Y'12Y'13
start0 + 8Y'20Y'21Y'22Y'23
start0 + 12Y'30Y'31Y'32Y'33
start1 + 0Cb00Cr00Cb02Cr02
start1 + 4Cb10Cr10Cb12Cr12
start1 + 8Cb20Cr20Cb22Cr22
start1 + 12Cb30Cr30Cb32Cr32

Y는 start0, 색차는 start1에서 시작합니다. 원문 예시의 색차 열 좌표를 그대로 보존합니다.

.. _V4L2-PIX-FMT-NV16:
.. _V4L2-PIX-FMT-NV61:
.. _V4L2-PIX-FMT-NV16M:
.. _V4L2-PIX-FMT-NV61M:

NV16, NV61, NV16M and NV61M
---------------------------

Semi-planar YUV 4:2:2 formats. The chroma plane is subsampled by 2 in the
horizontal direction. Chroma lines contain half the number of pixels and the
same number of bytes as luma lines, and the chroma plane contains the same
number of lines as the luma plane.

.. flat-table:: Sample 4x4 NV16 Image
    :header-rows:  0
    :stub-columns: 0

    * - start + 0:
      - Y'\ :sub:`00`
      - Y'\ :sub:`01`
      - Y'\ :sub:`02`
      - Y'\ :sub:`03`
    * - start + 4:
      - Y'\ :sub:`10`
      - Y'\ :sub:`11`
      - Y'\ :sub:`12`
      - Y'\ :sub:`13`
    * - start + 8:
      - Y'\ :sub:`20`
      - Y'\ :sub:`21`
      - Y'\ :sub:`22`
      - Y'\ :sub:`23`
    * - start + 12:
      - Y'\ :sub:`30`
      - Y'\ :sub:`31`
      - Y'\ :sub:`32`
      - Y'\ :sub:`33`
    * - start + 16:
      - Cb\ :sub:`00`
      - Cr\ :sub:`00`
      - Cb\ :sub:`01`
      - Cr\ :sub:`01`
    * - start + 20:
      - Cb\ :sub:`10`
      - Cr\ :sub:`10`
      - Cb\ :sub:`11`
      - Cr\ :sub:`11`
    * - start + 24:
      - Cb\ :sub:`20`
      - Cr\ :sub:`20`
      - Cb\ :sub:`21`
      - Cr\ :sub:`21`
    * - start + 28:
      - Cb\ :sub:`30`
      - Cr\ :sub:`30`
      - Cb\ :sub:`31`
      - Cr\ :sub:`31`

.. flat-table:: Sample 4x4 NV16M Image
    :header-rows:  0
    :stub-columns: 0

    * - start0 + 0:
      - Y'\ :sub:`00`
      - Y'\ :sub:`01`
      - Y'\ :sub:`02`
      - Y'\ :sub:`03`
    * - start0 + 4:
      - Y'\ :sub:`10`
      - Y'\ :sub:`11`
      - Y'\ :sub:`12`
      - Y'\ :sub:`13`
    * - start0 + 8:
      - Y'\ :sub:`20`
      - Y'\ :sub:`21`
      - Y'\ :sub:`22`
      - Y'\ :sub:`23`
    * - start0 + 12:
      - Y'\ :sub:`30`
      - Y'\ :sub:`31`
      - Y'\ :sub:`32`
      - Y'\ :sub:`33`
    * -
    * - start1 + 0:
      - Cb\ :sub:`00`
      - Cr\ :sub:`00`
      - Cb\ :sub:`02`
      - Cr\ :sub:`02`
    * - start1 + 4:
      - Cb\ :sub:`10`
      - Cr\ :sub:`10`
      - Cb\ :sub:`12`
      - Cr\ :sub:`12`
    * - start1 + 8:
      - Cb\ :sub:`20`
      - Cr\ :sub:`20`
      - Cb\ :sub:`22`
      - Cr\ :sub:`22`
    * - start1 + 12:
      - Cb\ :sub:`30`
      - Cr\ :sub:`30`
      - Cb\ :sub:`32`
      - Cr\ :sub:`32`

NV20

699-761

NV20은 NV16과 비슷한 반평면 10비트 YUV 4:2:2입니다. 성분 사이 패딩 없이 4개 성분을 5바이트에 리틀 엔디언 순서로 저장합니다.

NV20 10비트 패킹
오프셋B0B1B2B3B4
Y row 0 / +0Y00[7:0]Y01[5:0]|Y00[9:8]Y02[3:0]|Y01[9:6]Y03[1:0]|Y02[9:4]Y03[9:2]
Y row 1 / +5Y10[7:0]Y11[5:0]|Y10[9:8]Y12[3:0]|Y11[9:6]Y13[1:0]|Y12[9:4]Y13[9:2]
Y row 2 / +10Y20[7:0]Y21[5:0]|Y20[9:8]Y22[3:0]|Y21[9:6]Y23[1:0]|Y22[9:4]Y23[9:2]
Y row 3 / +15Y30[7:0]Y31[5:0]|Y30[9:8]Y32[3:0]|Y31[9:6]Y33[1:0]|Y32[9:4]Y33[9:2]
CbCr row 0 / +20Cb00[7:0]Cr00[5:0]|Cb00[9:8]Cb01[3:0]|Cr00[9:6]Cr01[1:0]|Cb01[9:4]Cr01[9:2]
CbCr row 1 / +25Cb10[7:0]Cr10[5:0]|Cb10[9:8]Cb11[3:0]|Cr10[9:6]Cr11[1:0]|Cb11[9:4]Cr11[9:2]
CbCr row 2 / +30Cb20[7:0]Cr20[5:0]|Cb20[9:8]Cb21[3:0]|Cr20[9:6]Cr21[1:0]|Cb21[9:4]Cr21[9:2]
CbCr row 3 / +35Cb30[7:0]Cr30[5:0]|Cb30[9:8]Cb31[3:0]|Cr30[9:6]Cr31[1:0]|Cb31[9:4]Cr31[9:2]

4개 Y 또는 CbCrCbCr 성분마다 같은 5바이트 패킹을 반복합니다.

.. _V4L2-PIX-FMT-NV20:

NV20
----

Semi-planar 10-bit YUV 4:2:2 format similar to NV16, using 10-bit components
with no padding between each component. A group of 4 components are stored over
5 bytes in little endian order.

.. flat-table:: Sample 4x4 NV20 Image (1 byte per cell)
    :header-rows:  0
    :stub-columns: 0

    * - start + 0:
      - Y'\ :sub:`00[7:0]`
      - Y'\ :sub:`01[5:0]`\ Y'\ :sub:`00[9:8]`
      - Y'\ :sub:`02[3:0]`\ Y'\ :sub:`01[9:6]`
      - Y'\ :sub:`03[1:0]`\ Y'\ :sub:`02[9:4]`
      - Y'\ :sub:`03[9:2]`
    * - start + 5:
      - Y'\ :sub:`10[7:0]`
      - Y'\ :sub:`11[5:0]`\ Y'\ :sub:`10[9:8]`
      - Y'\ :sub:`12[3:0]`\ Y'\ :sub:`11[9:6]`
      - Y'\ :sub:`13[1:0]`\ Y'\ :sub:`12[9:4]`
      - Y'\ :sub:`13[9:2]`
    * - start + 10:
      - Y'\ :sub:`20[7:0]`
      - Y'\ :sub:`21[5:0]`\ Y'\ :sub:`20[9:8]`
      - Y'\ :sub:`22[3:0]`\ Y'\ :sub:`21[9:6]`
      - Y'\ :sub:`23[1:0]`\ Y'\ :sub:`22[9:4]`
      - Y'\ :sub:`23[9:2]`
    * - start + 15:
      - Y'\ :sub:`30[7:0]`
      - Y'\ :sub:`31[5:0]`\ Y'\ :sub:`30[9:8]`
      - Y'\ :sub:`32[3:0]`\ Y'\ :sub:`31[9:6]`
      - Y'\ :sub:`33[1:0]`\ Y'\ :sub:`32[9:4]`
      - Y'\ :sub:`33[9:2]`
    * - start + 20:
      - Cb\ :sub:`00[7:0]`
      - Cr\ :sub:`00[5:0]`\ Cb\ :sub:`00[9:8]`
      - Cb\ :sub:`01[3:0]`\ Cr\ :sub:`00[9:6]`
      - Cr\ :sub:`01[1:0]`\ Cb\ :sub:`01[9:4]`
      - Cr\ :sub:`01[9:2]`
    * - start + 25:
      - Cb\ :sub:`10[7:0]`
      - Cr\ :sub:`10[5:0]`\ Cb\ :sub:`10[9:8]`
      - Cb\ :sub:`11[3:0]`\ Cr\ :sub:`10[9:6]`
      - Cr\ :sub:`11[1:0]`\ Cb\ :sub:`11[9:4]`
      - Cr\ :sub:`11[9:2]`
    * - start + 30:
      - Cb\ :sub:`20[7:0]`
      - Cr\ :sub:`20[5:0]`\ Cb\ :sub:`20[9:8]`
      - Cb\ :sub:`21[3:0]`\ Cr\ :sub:`20[9:6]`
      - Cr\ :sub:`21[1:0]`\ Cb\ :sub:`21[9:4]`
      - Cr\ :sub:`21[9:2]`
    * - start + 35:
      - Cb\ :sub:`30[7:0]`
      - Cr\ :sub:`30[5:0]`\ Cb\ :sub:`30[9:8]`
      - Cb\ :sub:`31[3:0]`\ Cr\ :sub:`30[9:6]`
      - Cr\ :sub:`31[1:0]`\ Cb\ :sub:`31[9:4]`
      - Cr\ :sub:`31[9:2]`

NV24와 NV42

762-833

NV24와 NV42는 반평면 YUV 4:4:4로 색차 평면을 서브샘플링하지 않습니다. 색차 행은 휘도 행과 픽셀 수와 행 수가 같고, 각 픽셀에 Cb·Cr 두 바이트를 쓰므로 바이트 수는 휘도 행의 두 배입니다. NV42는 Cb·Cr 순서를 뒤집습니다.

4×4 NV24 연속 메모리
오프셋B0B1B2B3B4B5B6B7
start + 0Y'00Y'01Y'02Y'03
start + 4Y'10Y'11Y'12Y'13
start + 8Y'20Y'21Y'22Y'23
start + 12Y'30Y'31Y'32Y'33
start + 16Cb00Cr00Cb01Cr01Cb02Cr02Cb03Cr03
start + 24Cb10Cr10Cb11Cr11Cb12Cr12Cb13Cr13
start + 32Cb20Cr20Cb21Cr21Cb22Cr22Cb23Cr23
start + 40Cb30Cr30Cb31Cr31Cb32Cr32Cb33Cr33

16바이트 Y 평면 다음에 32바이트 CbCr 평면이 이어집니다.

.. _V4L2-PIX-FMT-NV24:
.. _V4L2-PIX-FMT-NV42:

NV24 and NV42
-------------

Semi-planar YUV 4:4:4 formats. The chroma plane is not subsampled.
Chroma lines contain the same number of pixels and twice the
number of bytes as luma lines, and the chroma plane contains the same
number of lines as the luma plane.

.. flat-table:: Sample 4x4 NV24 Image
    :header-rows:  0
    :stub-columns: 0

    * - start + 0:
      - Y'\ :sub:`00`
      - Y'\ :sub:`01`
      - Y'\ :sub:`02`
      - Y'\ :sub:`03`
    * - start + 4:
      - Y'\ :sub:`10`
      - Y'\ :sub:`11`
      - Y'\ :sub:`12`
      - Y'\ :sub:`13`
    * - start + 8:
      - Y'\ :sub:`20`
      - Y'\ :sub:`21`
      - Y'\ :sub:`22`
      - Y'\ :sub:`23`
    * - start + 12:
      - Y'\ :sub:`30`
      - Y'\ :sub:`31`
      - Y'\ :sub:`32`
      - Y'\ :sub:`33`
    * - start + 16:
      - Cb\ :sub:`00`
      - Cr\ :sub:`00`
      - Cb\ :sub:`01`
      - Cr\ :sub:`01`
      - Cb\ :sub:`02`
      - Cr\ :sub:`02`
      - Cb\ :sub:`03`
      - Cr\ :sub:`03`
    * - start + 24:
      - Cb\ :sub:`10`
      - Cr\ :sub:`10`
      - Cb\ :sub:`11`
      - Cr\ :sub:`11`
      - Cb\ :sub:`12`
      - Cr\ :sub:`12`
      - Cb\ :sub:`13`
      - Cr\ :sub:`13`
    * - start + 32:
      - Cb\ :sub:`20`
      - Cr\ :sub:`20`
      - Cb\ :sub:`21`
      - Cr\ :sub:`21`
      - Cb\ :sub:`22`
      - Cr\ :sub:`22`
      - Cb\ :sub:`23`
      - Cr\ :sub:`23`
    * - start + 40:
      - Cb\ :sub:`30`
      - Cr\ :sub:`30`
      - Cb\ :sub:`31`
      - Cr\ :sub:`31`
      - Cb\ :sub:`32`
      - Cr\ :sub:`32`
      - Cb\ :sub:`33`
      - Cr\ :sub:`33`

P010과 타일형 P010

834-878

P010은 NV12와 같은 4:2:0 배치에 성분당 10비트를 사용하되 각 성분을 16비트로 확장합니다. 유효 데이터는 상위 10비트에, 0 패딩은 하위 6비트에 두며 16비트 워드를 리틀 엔디언으로 저장합니다.

4×4 P010 메모리
바이트 오프셋Word 0Word 1Word 2Word 3
start + 0Y00Y01Y02Y03
start + 8Y10Y11Y12Y13
start + 16Y20Y21Y22Y23
start + 24Y30Y31Y32Y33
start + 32Cb00Cr00Cb01Cr01
start + 40Cb10Cr10Cb11Cr11

표의 각 셀은 16비트 성분입니다. Y 16개 뒤에 CbCr 4쌍이 이어집니다.

.. _V4L2_PIX_FMT_P010:
.. _V4L2-PIX-FMT-P010-4L4:

P010 and tiled P010
-------------------

P010 is like NV12 with 10 bits per component, expanded to 16 bits.
Data in the 10 high bits, zeros in the 6 low bits, arranged in little endian order.

.. flat-table:: Sample 4x4 P010 Image
    :header-rows:  0
    :stub-columns: 0

    * - start + 0:
      - Y'\ :sub:`00`
      - Y'\ :sub:`01`
      - Y'\ :sub:`02`
      - Y'\ :sub:`03`
    * - start + 8:
      - Y'\ :sub:`10`
      - Y'\ :sub:`11`
      - Y'\ :sub:`12`
      - Y'\ :sub:`13`
    * - start + 16:
      - Y'\ :sub:`20`
      - Y'\ :sub:`21`
      - Y'\ :sub:`22`
      - Y'\ :sub:`23`
    * - start + 24:
      - Y'\ :sub:`30`
      - Y'\ :sub:`31`
      - Y'\ :sub:`32`
      - Y'\ :sub:`33`
    * - start + 32:
      - Cb\ :sub:`00`
      - Cr\ :sub:`00`
      - Cb\ :sub:`01`
      - Cr\ :sub:`01`
    * - start + 40:
      - Cb\ :sub:`10`
      - Cr\ :sub:`10`
      - Cb\ :sub:`11`
      - Cr\ :sub:`11`

.. _V4L2-PIX-FMT-P012:

P012와 P012M

879-958

P012는 NV12와 같은 4:2:0 배치에 성분당 12비트를 사용하고 각 성분을 16비트로 확장합니다. 유효 데이터는 상위 12비트, 0 패딩은 하위 4비트이며 리틀 엔디언 워드입니다. P012M은 Y와 CbCr 평면을 독립 메모리에 둡니다.

4×4 P012 연속 메모리
바이트 오프셋Word 0Word 1Word 2Word 3
start + 0Y00Y01Y02Y03
start + 8Y10Y11Y12Y13
start + 16Y20Y21Y22Y23
start + 24Y30Y31Y32Y33
start + 32Cb00Cr00Cb01Cr01
start + 40Cb10Cr10Cb11Cr11

각 셀은 16비트 성분입니다.

4×4 P012M 분리 메모리
바이트 오프셋Word 0Word 1Word 2Word 3
start0 + 0Y00Y01Y02Y03
start0 + 8Y10Y11Y12Y13
start0 + 16Y20Y21Y22Y23
start0 + 24Y30Y31Y32Y33
start1 + 0Cb00Cr00Cb01Cr01
start1 + 8Cb10Cr10Cb11Cr11

Y는 start0, CbCr은 start1에서 시작합니다.

.. _V4L2-PIX-FMT-P012M:

P012 and P012M
--------------

P012 is like NV12 with 12 bits per component, expanded to 16 bits.
Data in the 12 high bits, zeros in the 4 low bits, arranged in little endian order.

.. flat-table:: Sample 4x4 P012 Image
    :header-rows:  0
    :stub-columns: 0

    * - start + 0:
      - Y'\ :sub:`00`
      - Y'\ :sub:`01`
      - Y'\ :sub:`02`
      - Y'\ :sub:`03`
    * - start + 8:
      - Y'\ :sub:`10`
      - Y'\ :sub:`11`
      - Y'\ :sub:`12`
      - Y'\ :sub:`13`
    * - start + 16:
      - Y'\ :sub:`20`
      - Y'\ :sub:`21`
      - Y'\ :sub:`22`
      - Y'\ :sub:`23`
    * - start + 24:
      - Y'\ :sub:`30`
      - Y'\ :sub:`31`
      - Y'\ :sub:`32`
      - Y'\ :sub:`33`
    * - start + 32:
      - Cb\ :sub:`00`
      - Cr\ :sub:`00`
      - Cb\ :sub:`01`
      - Cr\ :sub:`01`
    * - start + 40:
      - Cb\ :sub:`10`
      - Cr\ :sub:`10`
      - Cb\ :sub:`11`
      - Cr\ :sub:`11`

.. flat-table:: Sample 4x4 P012M Image
    :header-rows:  0
    :stub-columns: 0

    * - start0 + 0:
      - Y'\ :sub:`00`
      - Y'\ :sub:`01`
      - Y'\ :sub:`02`
      - Y'\ :sub:`03`
    * - start0 + 8:
      - Y'\ :sub:`10`
      - Y'\ :sub:`11`
      - Y'\ :sub:`12`
      - Y'\ :sub:`13`
    * - start0 + 16:
      - Y'\ :sub:`20`
      - Y'\ :sub:`21`
      - Y'\ :sub:`22`
      - Y'\ :sub:`23`
    * - start0 + 24:
      - Y'\ :sub:`30`
      - Y'\ :sub:`31`
      - Y'\ :sub:`32`
      - Y'\ :sub:`33`
    * -
    * - start1 + 0:
      - Cb\ :sub:`00`
      - Cr\ :sub:`00`
      - Cb\ :sub:`01`
      - Cr\ :sub:`01`
    * - start1 + 8:
      - Cb\ :sub:`10`
      - Cr\ :sub:`10`
      - Cb\ :sub:`11`
      - Cr\ :sub:`11`

완전 평면 YUV 개요

959-1083

완전 평면 포맷은 Y, Cb, Cr을 세 개의 독립 평면에 저장합니다. Y 평면이 항상 먼저 오고, 두 색차 평면의 순서는 포맷에 따라 달라집니다. 두 색차 평면은 언제나 같은 서브샘플링을 사용합니다.

연속 포맷에서 색차 행 끝 패딩 픽셀 수는 휘도 행과 같으므로 색차 stride는 휘도 stride를 수평 서브샘플링 계수로 나눈 값입니다. 수직 서브샘플링은 stride에 영향을 주지 않습니다. 비연속 포맷은 평면 간 패딩·stride 관계를 강제하지 않습니다. 모든 성분의 비트 수는 같습니다.

`V4L2_PIX_FMT_P010_4L4`는 4×4 타일을 메모리에 선형 저장합니다. stride는 8의 배수, 높이는 4의 배수로 맞춰야 하며 Y와 색차 평면의 타일 배치는 같습니다.

완전 평면 YUV 포맷 목록
식별자FourCC비트서브샘플링평면 순서메모리
V4L2_PIX_FMT_YUV410YUV984:1:0Y, Cb, Cr연속
V4L2_PIX_FMT_YVU410YVU984:1:0Y, Cr, Cb연속
V4L2_PIX_FMT_YUV411P411P84:1:1Y, Cb, Cr연속
V4L2_PIX_FMT_YUV420MYM1284:2:0Y, Cb, Cr분리
V4L2_PIX_FMT_YVU420MYM2184:2:0Y, Cr, Cb분리
V4L2_PIX_FMT_YUV420YU1284:2:0Y, Cb, Cr연속
V4L2_PIX_FMT_YVU420YV1284:2:0Y, Cr, Cb연속
V4L2_PIX_FMT_YUV422P422P84:2:2Y, Cb, Cr연속
V4L2_PIX_FMT_YUV422MYM1684:2:2Y, Cb, Cr분리
V4L2_PIX_FMT_YVU422MYM6184:2:2Y, Cr, Cb분리
V4L2_PIX_FMT_YUV444MYM2484:4:4Y, Cb, Cr분리
V4L2_PIX_FMT_YVU444MYM4284:4:4Y, Cr, Cb분리

평면 순서와 메모리 연속성을 함께 확인합니다.

색차 샘플은 수평으로 픽셀 사이에 위치합니다.

Fully Planar YUV Formats
========================

These formats store the Y, Cb and Cr components in three separate planes. The
luma plane comes first, and the order of the two chroma planes varies between
formats. The two chroma planes always use the same subsampling.

For memory contiguous formats, the number of padding pixels at the end of the
chroma lines is identical to the padding of the luma lines. The chroma line
stride (in bytes) is thus equal to the luma line stride divided by the
horizontal subsampling factor. Vertical subsampling doesn't affect the line
stride.

For non-contiguous formats, no constraints are enforced by the format on the
relationship between the luma and chroma line padding and stride.

All components are stored with the same number of bits per component.

``V4L2_PIX_FMT_P010_4L4`` stores pixels in 4x4 tiles, and stores tiles linearly
in memory. The line stride must be aligned to multiple of 8 and image height to
a multiple of 4. The layouts of the luma and chroma planes are identical.

.. raw:: latex

    \small

.. tabularcolumns:: |p{5.0cm}|p{1.1cm}|p{1.5cm}|p{2.2cm}|p{1.2cm}|p{3.7cm}|

.. flat-table:: Overview of Fully Planar YUV Formats
    :header-rows:  1
    :stub-columns: 0

    * - Identifier
      - Code
      - Bits per component
      - Subsampling
      - Planes order [4]_
      - Contiguous [5]_

    * - V4L2_PIX_FMT_YUV410
      - 'YUV9'
      - 8
      - 4:1:0
      - Y, Cb, Cr
      - Yes
    * - V4L2_PIX_FMT_YVU410
      - 'YVU9'
      - 8
      - 4:1:0
      - Y, Cr, Cb
      - Yes
    * - V4L2_PIX_FMT_YUV411P
      - '411P'
      - 8
      - 4:1:1
      - Y, Cb, Cr
      - Yes
    * - V4L2_PIX_FMT_YUV420M
      - 'YM12'
      - 8
      - 4:2:0
      - Y, Cb, Cr
      - No
    * - V4L2_PIX_FMT_YVU420M
      - 'YM21'
      - 8
      - 4:2:0
      - Y, Cr, Cb
      - No
    * - V4L2_PIX_FMT_YUV420
      - 'YU12'
      - 8
      - 4:2:0
      - Y, Cb, Cr
      - Yes
    * - V4L2_PIX_FMT_YVU420
      - 'YV12'
      - 8
      - 4:2:0
      - Y, Cr, Cb
      - Yes
    * - V4L2_PIX_FMT_YUV422P
      - '422P'
      - 8
      - 4:2:2
      - Y, Cb, Cr
      - Yes
    * - V4L2_PIX_FMT_YUV422M
      - 'YM16'
      - 8
      - 4:2:2
      - Y, Cb, Cr
      - No
    * - V4L2_PIX_FMT_YVU422M
      - 'YM61'
      - 8
      - 4:2:2
      - Y, Cr, Cb
      - No
    * - V4L2_PIX_FMT_YUV444M
      - 'YM24'
      - 8
      - 4:4:4
      - Y, Cb, Cr
      - No
    * - V4L2_PIX_FMT_YVU444M
      - 'YM42'
      - 8
      - 4:4:4
      - Y, Cr, Cb
      - No

.. raw:: latex

    \normalsize

.. [4] Order of luma and chroma planes
.. [5] Indicates if planes have to be contiguous in memory or can be
       disjoint


**Color Sample Location:**
Chroma samples are :ref:`interstitially sited<yuv-chroma-centered>`
horizontally.

YUV410과 YVU410

1084-1124

평면형 YUV 4:1:0 포맷입니다. 색차 평면은 가로와 세로 모두 4배 서브샘플링됩니다. 색차 행의 픽셀 수와 바이트 수는 휘도 행의 1/4이고, 색차 평면 행 수도 Y 평면의 1/4입니다. YUV와 YVU 변형은 Cb·Cr 평면 순서가 반대입니다.

4×4 YUV410 원문 예시
오프셋B0B1B2B3
start + 0Y'00Y'01Y'02Y'03
start + 4Y'10Y'11Y'12Y'13
start + 8Y'20Y'21Y'22Y'23
start + 12Y'30Y'31Y'32Y'33
start + 16Cr00
start + 17Cb00

16바이트 Y 뒤에 원문 표가 제시한 Cr00, Cb00 순서를 그대로 보존합니다.

.. _V4L2-PIX-FMT-YUV410:
.. _V4L2-PIX-FMT-YVU410:

YUV410 and YVU410
-----------------

Planar YUV 4:1:0 formats. The chroma planes are subsampled by 4 in each
direction. Chroma lines contain a quarter of the number of pixels and bytes of
the luma lines, and the chroma planes contain a quarter of the number of lines
of the luma plane.

.. flat-table:: Sample 4x4 YUV410 Image
    :header-rows:  0
    :stub-columns: 0

    * - start + 0:
      - Y'\ :sub:`00`
      - Y'\ :sub:`01`
      - Y'\ :sub:`02`
      - Y'\ :sub:`03`
    * - start + 4:
      - Y'\ :sub:`10`
      - Y'\ :sub:`11`
      - Y'\ :sub:`12`
      - Y'\ :sub:`13`
    * - start + 8:
      - Y'\ :sub:`20`
      - Y'\ :sub:`21`
      - Y'\ :sub:`22`
      - Y'\ :sub:`23`
    * - start + 12:
      - Y'\ :sub:`30`
      - Y'\ :sub:`31`
      - Y'\ :sub:`32`
      - Y'\ :sub:`33`
    * - start + 16:
      - Cr\ :sub:`00`
    * - start + 17:
      - Cb\ :sub:`00`

YUV411P

1125-1176

평면형 YUV 4:1:1 포맷입니다. 색차 평면은 가로 방향으로 4배 서브샘플링됩니다. 색차 행의 픽셀 수와 바이트 수는 Y 행의 1/4이고, 색차 평면의 행 수는 Y 평면과 같습니다.

4×4 YUV411P 메모리
오프셋B0B1B2B3
start + 0Y'00Y'01Y'02Y'03
start + 4Y'10Y'11Y'12Y'13
start + 8Y'20Y'21Y'22Y'23
start + 12Y'30Y'31Y'32Y'33
start + 16Cb00
start + 17Cb10
start + 18Cb20
start + 19Cb30
start + 20Cr00
start + 21Cr10
start + 22Cr20
start + 23Cr30

Y 16바이트 뒤에 행당 한 Cb, 이어서 행당 한 Cr을 저장합니다.

.. _V4L2-PIX-FMT-YUV411P:

YUV411P
-------

Planar YUV 4:1:1 formats. The chroma planes are subsampled by 4 in the
horizontal direction. Chroma lines contain a quarter of the number of pixels
and bytes of the luma lines, and the chroma planes contain the same number of
lines as the luma plane.

.. flat-table:: Sample 4x4 YUV411P Image
    :header-rows:  0
    :stub-columns: 0

    * - start + 0:
      - Y'\ :sub:`00`
      - Y'\ :sub:`01`
      - Y'\ :sub:`02`
      - Y'\ :sub:`03`
    * - start + 4:
      - Y'\ :sub:`10`
      - Y'\ :sub:`11`
      - Y'\ :sub:`12`
      - Y'\ :sub:`13`
    * - start + 8:
      - Y'\ :sub:`20`
      - Y'\ :sub:`21`
      - Y'\ :sub:`22`
      - Y'\ :sub:`23`
    * - start + 12:
      - Y'\ :sub:`30`
      - Y'\ :sub:`31`
      - Y'\ :sub:`32`
      - Y'\ :sub:`33`
    * - start + 16:
      - Cb\ :sub:`00`
    * - start + 17:
      - Cb\ :sub:`10`
    * - start + 18:
      - Cb\ :sub:`20`
    * - start + 19:
      - Cb\ :sub:`30`
    * - start + 20:
      - Cr\ :sub:`00`
    * - start + 21:
      - Cr\ :sub:`10`
    * - start + 22:
      - Cr\ :sub:`20`
    * - start + 23:
      - Cr\ :sub:`30`

YUV420·YVU420·YUV420M·YVU420M

1177-1266

평면형 YUV 4:2:0 포맷입니다. 색차 평면은 가로와 세로 모두 2배 서브샘플링됩니다. 색차 행의 픽셀 수와 바이트 수는 Y 행의 절반이고, 색차 평면의 행 수도 Y 평면의 절반입니다. YUV/YVU는 색차 평면 순서가 반대이며 `M` 변형은 세 평면을 독립 메모리에 둡니다.

4×4 YUV420 원문 연속 예시
오프셋B0B1B2B3
start + 0Y'00Y'01Y'02Y'03
start + 4Y'10Y'11Y'12Y'13
start + 8Y'20Y'21Y'22Y'23
start + 12Y'30Y'31Y'32Y'33
start + 16Cr00Cr01
start + 18Cr10Cr11
start + 20Cb00Cb01
start + 22Cb10Cb11

16바이트 Y 뒤에 원문 표가 제시한 Cr 평면, Cb 평면 순서를 보존합니다.

4×4 YUV420M 분리 예시
오프셋B0B1B2B3
start0 + 0Y'00Y'01Y'02Y'03
start0 + 4Y'10Y'11Y'12Y'13
start0 + 8Y'20Y'21Y'22Y'23
start0 + 12Y'30Y'31Y'32Y'33
start1 + 0Cb00Cb01
start1 + 2Cb10Cb11
start2 + 0Cr00Cr01
start2 + 2Cr10Cr11

Y, Cb, Cr이 각각 start0, start1, start2에서 시작합니다.

.. _V4L2-PIX-FMT-YUV420:
.. _V4L2-PIX-FMT-YVU420:
.. _V4L2-PIX-FMT-YUV420M:
.. _V4L2-PIX-FMT-YVU420M:

YUV420, YVU420, YUV420M and YVU420M
-----------------------------------

Planar YUV 4:2:0 formats. The chroma planes are subsampled by 2 in each
direction. Chroma lines contain half of the number of pixels and bytes of the
luma lines, and the chroma planes contain half of the number of lines of the
luma plane.

.. flat-table:: Sample 4x4 YUV420 Image
    :header-rows:  0
    :stub-columns: 0

    * - start + 0:
      - Y'\ :sub:`00`
      - Y'\ :sub:`01`
      - Y'\ :sub:`02`
      - Y'\ :sub:`03`
    * - start + 4:
      - Y'\ :sub:`10`
      - Y'\ :sub:`11`
      - Y'\ :sub:`12`
      - Y'\ :sub:`13`
    * - start + 8:
      - Y'\ :sub:`20`
      - Y'\ :sub:`21`
      - Y'\ :sub:`22`
      - Y'\ :sub:`23`
    * - start + 12:
      - Y'\ :sub:`30`
      - Y'\ :sub:`31`
      - Y'\ :sub:`32`
      - Y'\ :sub:`33`
    * - start + 16:
      - Cr\ :sub:`00`
      - Cr\ :sub:`01`
    * - start + 18:
      - Cr\ :sub:`10`
      - Cr\ :sub:`11`
    * - start + 20:
      - Cb\ :sub:`00`
      - Cb\ :sub:`01`
    * - start + 22:
      - Cb\ :sub:`10`
      - Cb\ :sub:`11`

.. flat-table:: Sample 4x4 YUV420M Image
    :header-rows:  0
    :stub-columns: 0

    * - start0 + 0:
      - Y'\ :sub:`00`
      - Y'\ :sub:`01`
      - Y'\ :sub:`02`
      - Y'\ :sub:`03`
    * - start0 + 4:
      - Y'\ :sub:`10`
      - Y'\ :sub:`11`
      - Y'\ :sub:`12`
      - Y'\ :sub:`13`
    * - start0 + 8:
      - Y'\ :sub:`20`
      - Y'\ :sub:`21`
      - Y'\ :sub:`22`
      - Y'\ :sub:`23`
    * - start0 + 12:
      - Y'\ :sub:`30`
      - Y'\ :sub:`31`
      - Y'\ :sub:`32`
      - Y'\ :sub:`33`
    * -
    * - start1 + 0:
      - Cb\ :sub:`00`
      - Cb\ :sub:`01`
    * - start1 + 2:
      - Cb\ :sub:`10`
      - Cb\ :sub:`11`
    * -
    * - start2 + 0:
      - Cr\ :sub:`00`
      - Cr\ :sub:`01`
    * - start2 + 2:
      - Cr\ :sub:`10`
      - Cr\ :sub:`11`

YUV422P·YUV422M·YVU422M

1267-1379

평면형 YUV 4:2:2 포맷입니다. 색차 평면은 가로 방향만 2배 서브샘플링됩니다. 색차 행의 픽셀 수와 바이트 수는 Y 행의 절반이고, 색차 평면 행 수는 Y 평면과 같습니다. `M` 변형은 세 평면을 분리하며 YVU 변형은 Cb·Cr 평면 순서를 바꿉니다.

4×4 YUV422P 연속 메모리
오프셋B0B1B2B3
start + 0Y'00Y'01Y'02Y'03
start + 4Y'10Y'11Y'12Y'13
start + 8Y'20Y'21Y'22Y'23
start + 12Y'30Y'31Y'32Y'33
start + 16Cb00Cb01
start + 18Cb10Cb11
start + 20Cb20Cb21
start + 22Cb30Cb31
start + 24Cr00Cr01
start + 26Cr10Cr11
start + 28Cr20Cr21
start + 30Cr30Cr31

Y 16바이트 뒤에 Cb 8바이트와 Cr 8바이트가 이어집니다.

4×4 YUV422M 분리 메모리
오프셋B0B1B2B3
start0 + 0Y'00Y'01Y'02Y'03
start0 + 4Y'10Y'11Y'12Y'13
start0 + 8Y'20Y'21Y'22Y'23
start0 + 12Y'30Y'31Y'32Y'33
start1 + 0Cb00Cb01
start1 + 2Cb10Cb11
start1 + 4Cb20Cb21
start1 + 6Cb30Cb31
start2 + 0Cr00Cr01
start2 + 2Cr10Cr11
start2 + 4Cr20Cr21
start2 + 6Cr30Cr31

Y, Cb, Cr이 각각 독립 주소에서 시작합니다.

.. _V4L2-PIX-FMT-YUV422P:
.. _V4L2-PIX-FMT-YUV422M:
.. _V4L2-PIX-FMT-YVU422M:

YUV422P, YUV422M and YVU422M
----------------------------

Planar YUV 4:2:2 formats. The chroma planes are subsampled by 2 in the
horizontal direction. Chroma lines contain half of the number of pixels and
bytes of the luma lines, and the chroma planes contain the same number of lines
as the luma plane.

.. flat-table:: Sample 4x4 YUV422P Image
    :header-rows:  0
    :stub-columns: 0

    * - start + 0:
      - Y'\ :sub:`00`
      - Y'\ :sub:`01`
      - Y'\ :sub:`02`
      - Y'\ :sub:`03`
    * - start + 4:
      - Y'\ :sub:`10`
      - Y'\ :sub:`11`
      - Y'\ :sub:`12`
      - Y'\ :sub:`13`
    * - start + 8:
      - Y'\ :sub:`20`
      - Y'\ :sub:`21`
      - Y'\ :sub:`22`
      - Y'\ :sub:`23`
    * - start + 12:
      - Y'\ :sub:`30`
      - Y'\ :sub:`31`
      - Y'\ :sub:`32`
      - Y'\ :sub:`33`
    * - start + 16:
      - Cb\ :sub:`00`
      - Cb\ :sub:`01`
    * - start + 18:
      - Cb\ :sub:`10`
      - Cb\ :sub:`11`
    * - start + 20:
      - Cb\ :sub:`20`
      - Cb\ :sub:`21`
    * - start + 22:
      - Cb\ :sub:`30`
      - Cb\ :sub:`31`
    * - start + 24:
      - Cr\ :sub:`00`
      - Cr\ :sub:`01`
    * - start + 26:
      - Cr\ :sub:`10`
      - Cr\ :sub:`11`
    * - start + 28:
      - Cr\ :sub:`20`
      - Cr\ :sub:`21`
    * - start + 30:
      - Cr\ :sub:`30`
      - Cr\ :sub:`31`

.. flat-table:: Sample 4x4 YUV422M Image
    :header-rows:  0
    :stub-columns: 0

    * - start0 + 0:
      - Y'\ :sub:`00`
      - Y'\ :sub:`01`
      - Y'\ :sub:`02`
      - Y'\ :sub:`03`
    * - start0 + 4:
      - Y'\ :sub:`10`
      - Y'\ :sub:`11`
      - Y'\ :sub:`12`
      - Y'\ :sub:`13`
    * - start0 + 8:
      - Y'\ :sub:`20`
      - Y'\ :sub:`21`
      - Y'\ :sub:`22`
      - Y'\ :sub:`23`
    * - start0 + 12:
      - Y'\ :sub:`30`
      - Y'\ :sub:`31`
      - Y'\ :sub:`32`
      - Y'\ :sub:`33`
    * -
    * - start1 + 0:
      - Cb\ :sub:`00`
      - Cb\ :sub:`01`
    * - start1 + 2:
      - Cb\ :sub:`10`
      - Cb\ :sub:`11`
    * - start1 + 4:
      - Cb\ :sub:`20`
      - Cb\ :sub:`21`
    * - start1 + 6:
      - Cb\ :sub:`30`
      - Cb\ :sub:`31`
    * -
    * - start2 + 0:
      - Cr\ :sub:`00`
      - Cr\ :sub:`01`
    * - start2 + 2:
      - Cr\ :sub:`10`
      - Cr\ :sub:`11`
    * - start2 + 4:
      - Cr\ :sub:`20`
      - Cr\ :sub:`21`
    * - start2 + 6:
      - Cr\ :sub:`30`
      - Cr\ :sub:`31`

YUV444M과 YVU444M

1380-1455

평면형 YUV 4:4:4 포맷으로 색차 평면을 서브샘플링하지 않습니다. Cb·Cr 행은 Y 행과 픽셀 수, 바이트 수, 행 수가 모두 같습니다. YVU444M은 Cb와 Cr 평면 순서를 바꿉니다.

4×4 YUV444M 분리 메모리
오프셋B0B1B2B3
start0 + 0Y'00Y'01Y'02Y'03
start0 + 4Y'10Y'11Y'12Y'13
start0 + 8Y'20Y'21Y'22Y'23
start0 + 12Y'30Y'31Y'32Y'33
start1 + 0Cb00Cb01Cb02Cb03
start1 + 4Cb10Cb11Cb12Cb13
start1 + 8Cb20Cb21Cb22Cb23
start1 + 12Cb20Cb21Cb32Cb33
start2 + 0Cr00Cr01Cr02Cr03
start2 + 4Cr10Cr11Cr12Cr13
start2 + 8Cr20Cr21Cr22Cr23
start2 + 12Cr30Cr31Cr32Cr33

원문 표의 모든 좌표를 그대로 보존합니다. Cb 마지막 행의 `Cb20`, `Cb21` 표기도 원문 기준입니다.

.. _V4L2-PIX-FMT-YUV444M:
.. _V4L2-PIX-FMT-YVU444M:

YUV444M and YVU444M
-------------------

Planar YUV 4:4:4 formats. The chroma planes are no subsampled. Chroma lines
contain the same number of pixels and bytes of the luma lines, and the chroma
planes contain the same number of lines as the luma plane.

.. flat-table:: Sample 4x4 YUV444M Image
    :header-rows:  0
    :stub-columns: 0

    * - start0 + 0:
      - Y'\ :sub:`00`
      - Y'\ :sub:`01`
      - Y'\ :sub:`02`
      - Y'\ :sub:`03`
    * - start0 + 4:
      - Y'\ :sub:`10`
      - Y'\ :sub:`11`
      - Y'\ :sub:`12`
      - Y'\ :sub:`13`
    * - start0 + 8:
      - Y'\ :sub:`20`
      - Y'\ :sub:`21`
      - Y'\ :sub:`22`
      - Y'\ :sub:`23`
    * - start0 + 12:
      - Y'\ :sub:`30`
      - Y'\ :sub:`31`
      - Y'\ :sub:`32`
      - Y'\ :sub:`33`
    * -
    * - start1 + 0:
      - Cb\ :sub:`00`
      - Cb\ :sub:`01`
      - Cb\ :sub:`02`
      - Cb\ :sub:`03`
    * - start1 + 4:
      - Cb\ :sub:`10`
      - Cb\ :sub:`11`
      - Cb\ :sub:`12`
      - Cb\ :sub:`13`
    * - start1 + 8:
      - Cb\ :sub:`20`
      - Cb\ :sub:`21`
      - Cb\ :sub:`22`
      - Cb\ :sub:`23`
    * - start1 + 12:
      - Cb\ :sub:`20`
      - Cb\ :sub:`21`
      - Cb\ :sub:`32`
      - Cb\ :sub:`33`
    * -
    * - start2 + 0:
      - Cr\ :sub:`00`
      - Cr\ :sub:`01`
      - Cr\ :sub:`02`
      - Cr\ :sub:`03`
    * - start2 + 4:
      - Cr\ :sub:`10`
      - Cr\ :sub:`11`
      - Cr\ :sub:`12`
      - Cr\ :sub:`13`
    * - start2 + 8:
      - Cr\ :sub:`20`
      - Cr\ :sub:`21`
      - Cr\ :sub:`22`
      - Cr\ :sub:`23`
    * - start2 + 12:
      - Cr\ :sub:`30`
      - Cr\ :sub:`31`
      - Cr\ :sub:`32`
      - Cr\ :sub:`33`