• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1.. Permission is granted to copy, distribute and/or modify this
2.. document under the terms of the GNU Free Documentation License,
3.. Version 1.1 or any later version published by the Free Software
4.. Foundation, with no Invariant Sections, no Front-Cover Texts
5.. and no Back-Cover Texts. A copy of the license is included at
6.. Documentation/media/uapi/fdl-appendix.rst.
7..
8.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
9
10.. _V4L2-PIX-FMT-YVU420:
11.. _V4L2-PIX-FMT-YUV420:
12
13**********************************************************
14V4L2_PIX_FMT_YVU420 ('YV12'), V4L2_PIX_FMT_YUV420 ('YU12')
15**********************************************************
16
17
18V4L2_PIX_FMT_YUV420
19Planar formats with ½ horizontal and vertical chroma resolution, also
20known as YUV 4:2:0
21
22
23Description
24===========
25
26These are planar formats, as opposed to a packed format. The three
27components are separated into three sub- images or planes. The Y plane
28is first. The Y plane has one byte per pixel. For
29``V4L2_PIX_FMT_YVU420``, the Cr plane immediately follows the Y plane in
30memory. The Cr plane is half the width and half the height of the Y
31plane (and of the image). Each Cr belongs to four pixels, a two-by-two
32square of the image. For example, Cr\ :sub:`0` belongs to Y'\ :sub:`00`,
33Y'\ :sub:`01`, Y'\ :sub:`10`, and Y'\ :sub:`11`. Following the Cr plane
34is the Cb plane, just like the Cr plane. ``V4L2_PIX_FMT_YUV420`` is the
35same except the Cb plane comes first, then the Cr plane.
36
37If the Y plane has pad bytes after each row, then the Cr and Cb planes
38have half as many pad bytes after their rows. In other words, two Cx
39rows (including padding) is exactly as long as one Y row (including
40padding).
41
42**Byte Order.**
43Each cell is one byte.
44
45
46
47
48.. flat-table::
49    :header-rows:  0
50    :stub-columns: 0
51
52    * - start + 0:
53      - Y'\ :sub:`00`
54      - Y'\ :sub:`01`
55      - Y'\ :sub:`02`
56      - Y'\ :sub:`03`
57    * - start + 4:
58      - Y'\ :sub:`10`
59      - Y'\ :sub:`11`
60      - Y'\ :sub:`12`
61      - Y'\ :sub:`13`
62    * - start + 8:
63      - Y'\ :sub:`20`
64      - Y'\ :sub:`21`
65      - Y'\ :sub:`22`
66      - Y'\ :sub:`23`
67    * - start + 12:
68      - Y'\ :sub:`30`
69      - Y'\ :sub:`31`
70      - Y'\ :sub:`32`
71      - Y'\ :sub:`33`
72    * - start + 16:
73      - Cr\ :sub:`00`
74      - Cr\ :sub:`01`
75    * - start + 18:
76      - Cr\ :sub:`10`
77      - Cr\ :sub:`11`
78    * - start + 20:
79      - Cb\ :sub:`00`
80      - Cb\ :sub:`01`
81    * - start + 22:
82      - Cb\ :sub:`10`
83      - Cb\ :sub:`11`
84
85
86**Color Sample Location:**
87
88
89
90.. flat-table::
91    :header-rows:  0
92    :stub-columns: 0
93
94    * -
95      - 0
96      -
97      - 1
98      -
99      - 2
100      -
101      - 3
102    * - 0
103      - Y
104      -
105      - Y
106      -
107      - Y
108      -
109      - Y
110    * -
111      -
112      - C
113      -
114      -
115      -
116      - C
117      -
118    * - 1
119      - Y
120      -
121      - Y
122      -
123      - Y
124      -
125      - Y
126    * -
127    * - 2
128      - Y
129      -
130      - Y
131      -
132      - Y
133      -
134      - Y
135    * -
136      -
137      - C
138      -
139      -
140      -
141      - C
142      -
143    * - 3
144      - Y
145      -
146      - Y
147      -
148      - Y
149      -
150      - Y
151