Merge branch 'akpm'
[linux-2.6/next.git] / Documentation / DocBook / media / v4l / pixfmt-yuv420.xml
blob42d7de5e456d77a22d3911f1c85c5149b7ff8d82
1     <refentry>
2       <refmeta>
3         <refentrytitle>V4L2_PIX_FMT_YVU420 ('YV12'), V4L2_PIX_FMT_YUV420 ('YU12')</refentrytitle>
4         &manvol;
5      </refmeta>
6       <refnamediv>
7         <refname id="V4L2-PIX-FMT-YVU420"><constant>V4L2_PIX_FMT_YVU420</constant></refname>
8         <refname id="V4L2-PIX-FMT-YUV420"><constant>V4L2_PIX_FMT_YUV420</constant></refname>
9         <refpurpose>Planar formats with &frac12; horizontal and
10 vertical chroma resolution, also known as YUV 4:2:0</refpurpose>
11       </refnamediv>
12       <refsect1>
13         <title>Description</title>
15         <para>These are planar formats, as opposed to a packed format.
16 The three components are separated into three sub- images or planes.
17 The Y plane is first. The Y plane has one byte per pixel. For
18 <constant>V4L2_PIX_FMT_YVU420</constant>, the Cr plane immediately
19 follows the Y plane in memory. The Cr plane is half the width and half
20 the height of the Y plane (and of the image). Each Cr belongs to four
21 pixels, a two-by-two square of the image. For example,
22 Cr<subscript>0</subscript> belongs to Y'<subscript>00</subscript>,
23 Y'<subscript>01</subscript>, Y'<subscript>10</subscript>, and
24 Y'<subscript>11</subscript>. Following the Cr plane is the Cb plane,
25 just like the Cr plane. <constant>V4L2_PIX_FMT_YUV420</constant> is
26 the same except the Cb plane comes first, then the Cr plane.</para>
28         <para>If the Y plane has pad bytes after each row, then the Cr
29 and Cb planes have half as many pad bytes after their rows. In other
30 words, two Cx rows (including padding) is exactly as long as one Y row
31 (including padding).</para>
33         <example>
34           <title><constant>V4L2_PIX_FMT_YVU420</constant> 4 &times; 4
35 pixel image</title>
37           <formalpara>
38             <title>Byte Order.</title>
39             <para>Each cell is one byte.
40                 <informaltable frame="none">
41                 <tgroup cols="5" align="center">
42                   <colspec align="left" colwidth="2*" />
43                   <tbody valign="top">
44                     <row>
45                       <entry>start&nbsp;+&nbsp;0:</entry>
46                       <entry>Y'<subscript>00</subscript></entry>
47                       <entry>Y'<subscript>01</subscript></entry>
48                       <entry>Y'<subscript>02</subscript></entry>
49                       <entry>Y'<subscript>03</subscript></entry>
50                     </row>
51                     <row>
52                       <entry>start&nbsp;+&nbsp;4:</entry>
53                       <entry>Y'<subscript>10</subscript></entry>
54                       <entry>Y'<subscript>11</subscript></entry>
55                       <entry>Y'<subscript>12</subscript></entry>
56                       <entry>Y'<subscript>13</subscript></entry>
57                     </row>
58                     <row>
59                       <entry>start&nbsp;+&nbsp;8:</entry>
60                       <entry>Y'<subscript>20</subscript></entry>
61                       <entry>Y'<subscript>21</subscript></entry>
62                       <entry>Y'<subscript>22</subscript></entry>
63                       <entry>Y'<subscript>23</subscript></entry>
64                     </row>
65                     <row>
66                       <entry>start&nbsp;+&nbsp;12:</entry>
67                       <entry>Y'<subscript>30</subscript></entry>
68                       <entry>Y'<subscript>31</subscript></entry>
69                       <entry>Y'<subscript>32</subscript></entry>
70                       <entry>Y'<subscript>33</subscript></entry>
71                     </row>
72                     <row>
73                       <entry>start&nbsp;+&nbsp;16:</entry>
74                       <entry>Cr<subscript>00</subscript></entry>
75                       <entry>Cr<subscript>01</subscript></entry>
76                     </row>
77                     <row>
78                       <entry>start&nbsp;+&nbsp;18:</entry>
79                       <entry>Cr<subscript>10</subscript></entry>
80                       <entry>Cr<subscript>11</subscript></entry>
81                     </row>
82                     <row>
83                       <entry>start&nbsp;+&nbsp;20:</entry>
84                       <entry>Cb<subscript>00</subscript></entry>
85                       <entry>Cb<subscript>01</subscript></entry>
86                     </row>
87                     <row>
88                       <entry>start&nbsp;+&nbsp;22:</entry>
89                       <entry>Cb<subscript>10</subscript></entry>
90                       <entry>Cb<subscript>11</subscript></entry>
91                     </row>
92                   </tbody>
93                 </tgroup>
94                 </informaltable>
95               </para>
96           </formalpara>
98           <formalpara>
99             <title>Color Sample Location.</title>
100             <para>
101                 <informaltable frame="none">
102                 <tgroup cols="7" align="center">
103                   <tbody valign="top">
104                     <row>
105                       <entry></entry>
106                       <entry>0</entry><entry></entry><entry>1</entry><entry></entry>
107                       <entry>2</entry><entry></entry><entry>3</entry>
108                     </row>
109                     <row>
110                       <entry>0</entry>
111                       <entry>Y</entry><entry></entry><entry>Y</entry><entry></entry>
112                       <entry>Y</entry><entry></entry><entry>Y</entry>
113                     </row>
114                     <row>
115                       <entry></entry>
116                       <entry></entry><entry>C</entry><entry></entry><entry></entry>
117                       <entry></entry><entry>C</entry><entry></entry>
118                     </row>
119                     <row>
120                       <entry>1</entry>
121                       <entry>Y</entry><entry></entry><entry>Y</entry><entry></entry>
122                       <entry>Y</entry><entry></entry><entry>Y</entry>
123                     </row>
124                     <row>
125                       <entry></entry>
126                     </row>
127                     <row>
128                       <entry>2</entry>
129                       <entry>Y</entry><entry></entry><entry>Y</entry><entry></entry>
130                       <entry>Y</entry><entry></entry><entry>Y</entry>
131                     </row>
132                     <row>
133                       <entry></entry>
134                       <entry></entry><entry>C</entry><entry></entry><entry></entry>
135                       <entry></entry><entry>C</entry><entry></entry>
136                     </row>
137                     <row>
138                       <entry>3</entry>
139                       <entry>Y</entry><entry></entry><entry>Y</entry><entry></entry>
140                       <entry>Y</entry><entry></entry><entry>Y</entry>
141                     </row>
142                   </tbody>
143                 </tgroup>
144                 </informaltable>
145               </para>
146           </formalpara>
147         </example>
148       </refsect1>
149     </refentry>
151   <!--
152 Local Variables:
153 mode: sgml
154 sgml-parent-document: "pixfmt.sgml"
155 indent-tabs-mode: nil
156 End:
157   -->