Commit | Line | Data |
---|---|---|
5377d91f MH |
1 | .. -*- coding: utf-8; mode: rst -*- |
2 | ||
3 | .. _V4L2-PIX-FMT-YUV420M: | |
9aff73d2 | 4 | .. _v4l2-pix-fmt-yvu420m: |
5377d91f MH |
5 | |
6 | ************************************************************ | |
7 | V4L2_PIX_FMT_YUV420M ('YM12'), V4L2_PIX_FMT_YVU420M ('YM21') | |
8 | ************************************************************ | |
9 | ||
5377d91f MH |
10 | |
11 | V4L2_PIX_FMT_YVU420M | |
12 | Variation of ``V4L2_PIX_FMT_YUV420`` and ``V4L2_PIX_FMT_YVU420`` with | |
13 | planes non contiguous in memory. | |
14 | ||
15 | ||
16 | Description | |
17 | =========== | |
18 | ||
19 | This is a multi-planar format, as opposed to a packed format. The three | |
20 | components are separated into three sub-images or planes. | |
21 | ||
22 | The Y plane is first. The Y plane has one byte per pixel. For | |
23 | ``V4L2_PIX_FMT_YUV420M`` the Cb data constitutes the second plane which | |
24 | is half the width and half the height of the Y plane (and of the image). | |
25 | Each Cb belongs to four pixels, a two-by-two square of the image. For | |
26 | example, Cb\ :sub:`0` belongs to Y'\ :sub:`00`, Y'\ :sub:`01`, | |
27 | Y'\ :sub:`10`, and Y'\ :sub:`11`. The Cr data, just like the Cb plane, | |
28 | is in the third plane. | |
29 | ||
30 | ``V4L2_PIX_FMT_YVU420M`` is the same except the Cr data is stored in the | |
31 | second plane and the Cb data in the third plane. | |
32 | ||
33 | If the Y plane has pad bytes after each row, then the Cb and Cr planes | |
34 | have half as many pad bytes after their rows. In other words, two Cx | |
35 | rows (including padding) is exactly as long as one Y row (including | |
36 | padding). | |
37 | ||
38 | ``V4L2_PIX_FMT_YUV420M`` and ``V4L2_PIX_FMT_YVU420M`` are intended to be | |
39 | used only in drivers and applications that support the multi-planar API, | |
40 | described in :ref:`planar-apis`. | |
41 | ||
056d2ee6 | 42 | **Byte Order.** |
5377d91f MH |
43 | Each cell is one byte. |
44 | ||
45 | ||
46 | ||
5bd4bb78 | 47 | |
5377d91f MH |
48 | .. flat-table:: |
49 | :header-rows: 0 | |
50 | :stub-columns: 0 | |
5377d91f MH |
51 | |
52 | ||
53 | - .. row 1 | |
54 | ||
55 | - start0 + 0: | |
56 | ||
57 | - Y'\ :sub:`00` | |
58 | ||
59 | - Y'\ :sub:`01` | |
60 | ||
61 | - Y'\ :sub:`02` | |
62 | ||
63 | - Y'\ :sub:`03` | |
64 | ||
65 | - .. row 2 | |
66 | ||
67 | - start0 + 4: | |
68 | ||
69 | - Y'\ :sub:`10` | |
70 | ||
71 | - Y'\ :sub:`11` | |
72 | ||
73 | - Y'\ :sub:`12` | |
74 | ||
75 | - Y'\ :sub:`13` | |
76 | ||
77 | - .. row 3 | |
78 | ||
79 | - start0 + 8: | |
80 | ||
81 | - Y'\ :sub:`20` | |
82 | ||
83 | - Y'\ :sub:`21` | |
84 | ||
85 | - Y'\ :sub:`22` | |
86 | ||
87 | - Y'\ :sub:`23` | |
88 | ||
89 | - .. row 4 | |
90 | ||
91 | - start0 + 12: | |
92 | ||
93 | - Y'\ :sub:`30` | |
94 | ||
95 | - Y'\ :sub:`31` | |
96 | ||
97 | - Y'\ :sub:`32` | |
98 | ||
99 | - Y'\ :sub:`33` | |
100 | ||
101 | - .. row 5 | |
102 | ||
0579e6e3 | 103 | - |
5377d91f MH |
104 | |
105 | - .. row 6 | |
106 | ||
107 | - start1 + 0: | |
108 | ||
109 | - Cb\ :sub:`00` | |
110 | ||
111 | - Cb\ :sub:`01` | |
112 | ||
113 | - .. row 7 | |
114 | ||
115 | - start1 + 2: | |
116 | ||
117 | - Cb\ :sub:`10` | |
118 | ||
119 | - Cb\ :sub:`11` | |
120 | ||
121 | - .. row 8 | |
122 | ||
0579e6e3 | 123 | - |
5377d91f MH |
124 | |
125 | - .. row 9 | |
126 | ||
127 | - start2 + 0: | |
128 | ||
129 | - Cr\ :sub:`00` | |
130 | ||
131 | - Cr\ :sub:`01` | |
132 | ||
133 | - .. row 10 | |
134 | ||
135 | - start2 + 2: | |
136 | ||
137 | - Cr\ :sub:`10` | |
138 | ||
139 | - Cr\ :sub:`11` | |
140 | ||
141 | ||
142 | **Color Sample Location..** | |
143 | ||
144 | ||
145 | ||
146 | .. flat-table:: | |
147 | :header-rows: 0 | |
148 | :stub-columns: 0 | |
149 | ||
150 | ||
151 | - .. row 1 | |
152 | ||
0579e6e3 | 153 | - |
5377d91f MH |
154 | - 0 |
155 | ||
0579e6e3 | 156 | - |
5377d91f MH |
157 | - 1 |
158 | ||
0579e6e3 | 159 | - |
5377d91f MH |
160 | - 2 |
161 | ||
0579e6e3 | 162 | - |
5377d91f MH |
163 | - 3 |
164 | ||
165 | - .. row 2 | |
166 | ||
167 | - 0 | |
168 | ||
169 | - Y | |
170 | ||
0579e6e3 | 171 | - |
5377d91f MH |
172 | - Y |
173 | ||
0579e6e3 | 174 | - |
5377d91f MH |
175 | - Y |
176 | ||
0579e6e3 | 177 | - |
5377d91f MH |
178 | - Y |
179 | ||
180 | - .. row 3 | |
181 | ||
0579e6e3 MCC |
182 | - |
183 | - | |
5377d91f MH |
184 | - C |
185 | ||
0579e6e3 MCC |
186 | - |
187 | - | |
188 | - | |
5377d91f MH |
189 | - C |
190 | ||
0579e6e3 | 191 | - |
5377d91f MH |
192 | |
193 | - .. row 4 | |
194 | ||
195 | - 1 | |
196 | ||
197 | - Y | |
198 | ||
0579e6e3 | 199 | - |
5377d91f MH |
200 | - Y |
201 | ||
0579e6e3 | 202 | - |
5377d91f MH |
203 | - Y |
204 | ||
0579e6e3 | 205 | - |
5377d91f MH |
206 | - Y |
207 | ||
208 | - .. row 5 | |
209 | ||
0579e6e3 | 210 | - |
5377d91f MH |
211 | |
212 | - .. row 6 | |
213 | ||
214 | - 2 | |
215 | ||
216 | - Y | |
217 | ||
0579e6e3 | 218 | - |
5377d91f MH |
219 | - Y |
220 | ||
0579e6e3 | 221 | - |
5377d91f MH |
222 | - Y |
223 | ||
0579e6e3 | 224 | - |
5377d91f MH |
225 | - Y |
226 | ||
227 | - .. row 7 | |
228 | ||
0579e6e3 MCC |
229 | - |
230 | - | |
5377d91f MH |
231 | - C |
232 | ||
0579e6e3 MCC |
233 | - |
234 | - | |
235 | - | |
5377d91f MH |
236 | - C |
237 | ||
0579e6e3 | 238 | - |
5377d91f MH |
239 | |
240 | - .. row 8 | |
241 | ||
242 | - 3 | |
243 | ||
244 | - Y | |
245 | ||
0579e6e3 | 246 | - |
5377d91f MH |
247 | - Y |
248 | ||
0579e6e3 | 249 | - |
5377d91f MH |
250 | - Y |
251 | ||
0579e6e3 | 252 | - |
5377d91f | 253 | - Y |