1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
2<HTML
3><HEAD
4><TITLE
5>V4L2_PIX_FMT_YVU420 ('YV12'), V4L2_PIX_FMT_YUV420 ('YU12')</TITLE
6><META
7NAME="GENERATOR"
8CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
9REL="HOME"
10TITLE="Video for Linux Two API Specification"
11HREF="book1.htm"><LINK
12REL="UP"
13TITLE="YUV Formats"
14HREF="x3891.htm"><LINK
15REL="PREVIOUS"
16TITLE="V4L2_PIX_FMT_Y41P ('Y41P')"
17HREF="r4629.htm"><LINK
18REL="NEXT"
19TITLE="V4L2_PIX_FMT_YVU410 ('YVU9'), V4L2_PIX_FMT_YUV410 ('YUV9')"
20HREF="r5016.htm"></HEAD
21><BODY
22CLASS="REFENTRY"
23BGCOLOR="#FFFFFF"
24TEXT="#000000"
25LINK="#0000FF"
26VLINK="#840084"
27ALINK="#0000FF"
28><DIV
29CLASS="NAVHEADER"
30><TABLE
31SUMMARY="Header navigation table"
32WIDTH="100%"
33BORDER="0"
34CELLPADDING="0"
35CELLSPACING="0"
36><TR
37><TH
38COLSPAN="3"
39ALIGN="center"
40>Video for Linux Two API Specification: Revision 0.24</TH
41></TR
42><TR
43><TD
44WIDTH="10%"
45ALIGN="left"
46VALIGN="bottom"
47><A
48HREF="r4629.htm"
49ACCESSKEY="P"
50>Prev</A
51></TD
52><TD
53WIDTH="80%"
54ALIGN="center"
55VALIGN="bottom"
56></TD
57><TD
58WIDTH="10%"
59ALIGN="right"
60VALIGN="bottom"
61><A
62HREF="r5016.htm"
63ACCESSKEY="N"
64>Next</A
65></TD
66></TR
67></TABLE
68><HR
69ALIGN="LEFT"
70WIDTH="100%"></DIV
71><H1
72><A
73NAME="AEN4850"
74></A
75>V4L2_PIX_FMT_YVU420 ('YV12'), V4L2_PIX_FMT_YUV420 ('YU12')</H1
76><DIV
77CLASS="REFNAMEDIV"
78><A
79NAME="AEN4854"
80></A
81><H2
82>Name</H2
83><CODE
84CLASS="CONSTANT"
85>V4L2_PIX_FMT_YVU420</CODE
86>, <CODE
87CLASS="CONSTANT"
88>V4L2_PIX_FMT_YUV420</CODE
89>&nbsp;--&nbsp;Planar formats with &frac12; horizontal and
90vertical chroma resolution, also known as YUV 4:2:0</DIV
91><DIV
92CLASS="REFSECT1"
93><A
94NAME="AEN4860"
95></A
96><H2
97>Description</H2
98><P
99>These are planar formats, as opposed to a packed format.
100The three components are separated into three sub- images or planes.
101The Y plane is first. The Y plane has one byte per pixel. For
102<CODE
103CLASS="CONSTANT"
104>V4L2_PIX_FMT_YVU420</CODE
105>, the Cr plane immediately
106follows the Y plane in memory. The Cr plane is half the width and half
107the height of the Y plane (and of the image). Each Cr belongs to four
108pixels, a two-by-two square of the image. For example,
109Cr<SUB
110>0</SUB
111> belongs to Y'<SUB
112>00</SUB
113>,
114Y'<SUB
115>01</SUB
116>, Y'<SUB
117>10</SUB
118>, and
119Y'<SUB
120>11</SUB
121>. Following the Cr plane is the Cb plane,
122just like the Cr plane. <CODE
123CLASS="CONSTANT"
124>V4L2_PIX_FMT_YUV420</CODE
125> is
126the same except the Cb plane comes first, then the Cr plane.</P
127><P
128>If the Y plane has pad bytes after each row, then the Cr
129and Cb planes have half as many pad bytes after their rows. In other
130words, two Cx rows (including padding) is exactly as long as one Y row
131(including padding).</P
132><DIV
133CLASS="EXAMPLE"
134><A
135NAME="AEN4871"
136></A
137><P
138><B
139>Example 2-1. <CODE
140CLASS="CONSTANT"
141>V4L2_PIX_FMT_YVU420</CODE
142> 4 &times; 4
143pixel image</B
144></P
145><DIV
146CLASS="FORMALPARA"
147><P
148><B
149>Byte Order. </B
150>Each cell is one byte.
151                <DIV
152CLASS="INFORMALTABLE"
153><P
154></P
155><A
156NAME="AEN4877"
157></A
158><TABLE
159BORDER="0"
160FRAME="void"
161CLASS="CALSTABLE"
162><COL
163WIDTH="2*"
164ALIGN="LEFT"><COL><COL><COL><COL><TBODY
165VALIGN="TOP"
166><TR
167><TD
168>start&nbsp;+&nbsp;0:</TD
169><TD
170>Y'<SUB
171>00</SUB
172></TD
173><TD
174>Y'<SUB
175>01</SUB
176></TD
177><TD
178>Y'<SUB
179>02</SUB
180></TD
181><TD
182>Y'<SUB
183>03</SUB
184></TD
185></TR
186><TR
187><TD
188>start&nbsp;+&nbsp;4:</TD
189><TD
190>Y'<SUB
191>10</SUB
192></TD
193><TD
194>Y'<SUB
195>11</SUB
196></TD
197><TD
198>Y'<SUB
199>12</SUB
200></TD
201><TD
202>Y'<SUB
203>13</SUB
204></TD
205></TR
206><TR
207><TD
208>start&nbsp;+&nbsp;8:</TD
209><TD
210>Y'<SUB
211>20</SUB
212></TD
213><TD
214>Y'<SUB
215>21</SUB
216></TD
217><TD
218>Y'<SUB
219>22</SUB
220></TD
221><TD
222>Y'<SUB
223>23</SUB
224></TD
225></TR
226><TR
227><TD
228>start&nbsp;+&nbsp;12:</TD
229><TD
230>Y'<SUB
231>30</SUB
232></TD
233><TD
234>Y'<SUB
235>31</SUB
236></TD
237><TD
238>Y'<SUB
239>32</SUB
240></TD
241><TD
242>Y'<SUB
243>33</SUB
244></TD
245></TR
246><TR
247><TD
248>start&nbsp;+&nbsp;16:</TD
249><TD
250>Cr<SUB
251>00</SUB
252></TD
253><TD
254>Cr<SUB
255>01</SUB
256></TD
257><TD
258>&nbsp;</TD
259><TD
260>&nbsp;</TD
261></TR
262><TR
263><TD
264>start&nbsp;+&nbsp;18:</TD
265><TD
266>Cr<SUB
267>10</SUB
268></TD
269><TD
270>Cr<SUB
271>11</SUB
272></TD
273><TD
274>&nbsp;</TD
275><TD
276>&nbsp;</TD
277></TR
278><TR
279><TD
280>start&nbsp;+&nbsp;20:</TD
281><TD
282>Cb<SUB
283>00</SUB
284></TD
285><TD
286>Cb<SUB
287>01</SUB
288></TD
289><TD
290>&nbsp;</TD
291><TD
292>&nbsp;</TD
293></TR
294><TR
295><TD
296>start&nbsp;+&nbsp;22:</TD
297><TD
298>Cb<SUB
299>10</SUB
300></TD
301><TD
302>Cb<SUB
303>11</SUB
304></TD
305><TD
306>&nbsp;</TD
307><TD
308>&nbsp;</TD
309></TR
310></TBODY
311></TABLE
312><P
313></P
314></DIV
315>
316              </P
317></DIV
318><DIV
319CLASS="FORMALPARA"
320><P
321><B
322>Color Sample Location. </B
323>                <DIV
324CLASS="INFORMALTABLE"
325><P
326></P
327><A
328NAME="AEN4948"
329></A
330><TABLE
331BORDER="0"
332FRAME="void"
333CLASS="CALSTABLE"
334><COL><COL><COL><COL><COL><COL><COL><TBODY
335VALIGN="TOP"
336><TR
337><TD
338>&nbsp;</TD
339><TD
340>0</TD
341><TD
342>&nbsp;</TD
343><TD
344>1</TD
345><TD
346>&nbsp;</TD
347><TD
348>2</TD
349><TD
350>&nbsp;</TD
351><TD
352>3</TD
353></TR
354><TR
355><TD
356>0</TD
357><TD
358>Y</TD
359><TD
360>&nbsp;</TD
361><TD
362>Y</TD
363><TD
364>&nbsp;</TD
365><TD
366>Y</TD
367><TD
368>&nbsp;</TD
369><TD
370>Y</TD
371></TR
372><TR
373><TD
374>&nbsp;</TD
375><TD
376>&nbsp;</TD
377><TD
378>C</TD
379><TD
380>&nbsp;</TD
381><TD
382>&nbsp;</TD
383><TD
384>&nbsp;</TD
385><TD
386>C</TD
387><TD
388>&nbsp;</TD
389></TR
390><TR
391><TD
392>1</TD
393><TD
394>Y</TD
395><TD
396>&nbsp;</TD
397><TD
398>Y</TD
399><TD
400>&nbsp;</TD
401><TD
402>Y</TD
403><TD
404>&nbsp;</TD
405><TD
406>Y</TD
407></TR
408><TR
409><TD
410>&nbsp;</TD
411><TD
412>&nbsp;</TD
413><TD
414>&nbsp;</TD
415><TD
416>&nbsp;</TD
417><TD
418>&nbsp;</TD
419><TD
420>&nbsp;</TD
421><TD
422>&nbsp;</TD
423></TR
424><TR
425><TD
426>2</TD
427><TD
428>Y</TD
429><TD
430>&nbsp;</TD
431><TD
432>Y</TD
433><TD
434>&nbsp;</TD
435><TD
436>Y</TD
437><TD
438>&nbsp;</TD
439><TD
440>Y</TD
441></TR
442><TR
443><TD
444>&nbsp;</TD
445><TD
446>&nbsp;</TD
447><TD
448>C</TD
449><TD
450>&nbsp;</TD
451><TD
452>&nbsp;</TD
453><TD
454>&nbsp;</TD
455><TD
456>C</TD
457><TD
458>&nbsp;</TD
459></TR
460><TR
461><TD
462>3</TD
463><TD
464>Y</TD
465><TD
466>&nbsp;</TD
467><TD
468>Y</TD
469><TD
470>&nbsp;</TD
471><TD
472>Y</TD
473><TD
474>&nbsp;</TD
475><TD
476>Y</TD
477></TR
478></TBODY
479></TABLE
480><P
481></P
482></DIV
483>
484              </P
485></DIV
486></DIV
487></DIV
488><DIV
489CLASS="NAVFOOTER"
490><HR
491ALIGN="LEFT"
492WIDTH="100%"><TABLE
493SUMMARY="Footer navigation table"
494WIDTH="100%"
495BORDER="0"
496CELLPADDING="0"
497CELLSPACING="0"
498><TR
499><TD
500WIDTH="33%"
501ALIGN="left"
502VALIGN="top"
503><A
504HREF="r4629.htm"
505ACCESSKEY="P"
506>Prev</A
507></TD
508><TD
509WIDTH="34%"
510ALIGN="center"
511VALIGN="top"
512><A
513HREF="book1.htm"
514ACCESSKEY="H"
515>Home</A
516></TD
517><TD
518WIDTH="33%"
519ALIGN="right"
520VALIGN="top"
521><A
522HREF="r5016.htm"
523ACCESSKEY="N"
524>Next</A
525></TD
526></TR
527><TR
528><TD
529WIDTH="33%"
530ALIGN="left"
531VALIGN="top"
532>V4L2_PIX_FMT_Y41P ('Y41P')</TD
533><TD
534WIDTH="34%"
535ALIGN="center"
536VALIGN="top"
537><A
538HREF="x3891.htm"
539ACCESSKEY="U"
540>Up</A
541></TD
542><TD
543WIDTH="33%"
544ALIGN="right"
545VALIGN="top"
546>V4L2_PIX_FMT_YVU410 ('YVU9'), V4L2_PIX_FMT_YUV410 ('YUV9')</TD
547></TR
548></TABLE
549></DIV
550></BODY
551></HTML
552>
553