blob: c51d5a4cda091f795beba7316498431a7defcc63 [file] [log] [blame]
Laurent Pinchart84930542013-06-26 09:46:42 -03001 <refentry>
2 <refmeta>
3 <refentrytitle>V4L2_PIX_FMT_NV16M ('NM16'), V4L2_PIX_FMT_NV61M ('NM61')</refentrytitle>
4 &manvol;
5 </refmeta>
6 <refnamediv>
7 <refname id="V4L2-PIX-FMT-NV16M"><constant>V4L2_PIX_FMT_NV16M</constant></refname>
8 <refname id="V4L2-PIX-FMT-NV61M"><constant>V4L2_PIX_FMT_NV61M</constant></refname>
9 <refpurpose>Variation of <constant>V4L2_PIX_FMT_NV16</constant> and <constant>V4L2_PIX_FMT_NV61</constant> with planes
10 non contiguous in memory. </refpurpose>
11 </refnamediv>
12 <refsect1>
13 <title>Description</title>
14
15 <para>This is a multi-planar, two-plane version of the YUV 4:2:0 format.
16The three components are separated into two sub-images or planes.
17<constant>V4L2_PIX_FMT_NV16M</constant> differs from <constant>V4L2_PIX_FMT_NV16
18</constant> in that the two planes are non-contiguous in memory, i.e. the chroma
19plane does not necessarily immediately follows the luma plane.
20The luminance data occupies the first plane. The Y plane has one byte per pixel.
21In the second plane there is chrominance data with alternating chroma samples.
22The CbCr plane is the same width and height, in bytes, as the Y plane.
23Each CbCr pair belongs to four pixels. For example,
24Cb<subscript>0</subscript>/Cr<subscript>0</subscript> belongs to
25Y'<subscript>00</subscript>, Y'<subscript>01</subscript>,
26Y'<subscript>10</subscript>, Y'<subscript>11</subscript>.
27<constant>V4L2_PIX_FMT_NV61M</constant> is the same as <constant>V4L2_PIX_FMT_NV16M</constant>
28except the Cb and Cr bytes are swapped, the CrCb plane starts with a Cr byte.</para>
29
30 <para><constant>V4L2_PIX_FMT_NV16M</constant> and
31<constant>V4L2_PIX_FMT_NV61M</constant> are intended to be used only in drivers
32and applications that support the multi-planar API, described in
33<xref linkend="planar-apis"/>. </para>
34
35 <example>
36 <title><constant>V4L2_PIX_FMT_NV16M</constant> 4 &times; 4 pixel image</title>
37
38 <formalpara>
39 <title>Byte Order.</title>
40 <para>Each cell is one byte.
41 <informaltable frame="none">
42 <tgroup cols="5" align="center">
43 <colspec align="left" colwidth="2*" />
44 <tbody valign="top">
45 <row>
46 <entry>start0&nbsp;+&nbsp;0:</entry>
47 <entry>Y'<subscript>00</subscript></entry>
48 <entry>Y'<subscript>01</subscript></entry>
49 <entry>Y'<subscript>02</subscript></entry>
50 <entry>Y'<subscript>03</subscript></entry>
51 </row>
52 <row>
53 <entry>start0&nbsp;+&nbsp;4:</entry>
54 <entry>Y'<subscript>10</subscript></entry>
55 <entry>Y'<subscript>11</subscript></entry>
56 <entry>Y'<subscript>12</subscript></entry>
57 <entry>Y'<subscript>13</subscript></entry>
58 </row>
59 <row>
60 <entry>start0&nbsp;+&nbsp;8:</entry>
61 <entry>Y'<subscript>20</subscript></entry>
62 <entry>Y'<subscript>21</subscript></entry>
63 <entry>Y'<subscript>22</subscript></entry>
64 <entry>Y'<subscript>23</subscript></entry>
65 </row>
66 <row>
67 <entry>start0&nbsp;+&nbsp;12:</entry>
68 <entry>Y'<subscript>30</subscript></entry>
69 <entry>Y'<subscript>31</subscript></entry>
70 <entry>Y'<subscript>32</subscript></entry>
71 <entry>Y'<subscript>33</subscript></entry>
72 </row>
73 <row>
74 <entry></entry>
75 </row>
76 <row>
77 <entry>start1&nbsp;+&nbsp;0:</entry>
78 <entry>Cb<subscript>00</subscript></entry>
79 <entry>Cr<subscript>00</subscript></entry>
80 <entry>Cb<subscript>02</subscript></entry>
81 <entry>Cr<subscript>02</subscript></entry>
82 </row>
83 <row>
84 <entry>start1&nbsp;+&nbsp;4:</entry>
85 <entry>Cb<subscript>10</subscript></entry>
86 <entry>Cr<subscript>10</subscript></entry>
87 <entry>Cb<subscript>12</subscript></entry>
88 <entry>Cr<subscript>12</subscript></entry>
89 </row>
90 <row>
91 <entry>start1&nbsp;+&nbsp;8:</entry>
92 <entry>Cb<subscript>20</subscript></entry>
93 <entry>Cr<subscript>20</subscript></entry>
94 <entry>Cb<subscript>22</subscript></entry>
95 <entry>Cr<subscript>22</subscript></entry>
96 </row>
97 <row>
98 <entry>start1&nbsp;+&nbsp;12:</entry>
99 <entry>Cb<subscript>30</subscript></entry>
100 <entry>Cr<subscript>30</subscript></entry>
101 <entry>Cb<subscript>32</subscript></entry>
102 <entry>Cr<subscript>32</subscript></entry>
103 </row>
104 </tbody>
105 </tgroup>
106 </informaltable>
107 </para>
108 </formalpara>
109
110 <formalpara>
111 <title>Color Sample Location.</title>
112 <para>
113 <informaltable frame="none">
114 <tgroup cols="7" align="center">
115 <tbody valign="top">
116 <row>
117 <entry></entry>
118 <entry>0</entry><entry></entry><entry>1</entry><entry></entry>
119 <entry>2</entry><entry></entry><entry>3</entry>
120 </row>
121 <row>
122 <entry>0</entry>
123 <entry>Y</entry><entry></entry><entry>Y</entry><entry></entry>
124 <entry>Y</entry><entry></entry><entry>Y</entry>
125 </row>
126 <row>
127 <entry></entry>
128 <entry></entry><entry>C</entry><entry></entry><entry></entry>
129 <entry></entry><entry>C</entry><entry></entry>
130 </row>
131 <row>
132 <entry>1</entry>
133 <entry>Y</entry><entry></entry><entry>Y</entry><entry></entry>
134 <entry>Y</entry><entry></entry><entry>Y</entry>
135 </row>
136 <row>
137 <entry></entry>
138 <entry></entry><entry>C</entry><entry></entry><entry></entry>
139 <entry></entry><entry>C</entry><entry></entry>
140 </row>
141 <row>
142 <entry></entry>
143 </row>
144 <row>
145 <entry>2</entry>
146 <entry>Y</entry><entry></entry><entry>Y</entry><entry></entry>
147 <entry>Y</entry><entry></entry><entry>Y</entry>
148 </row>
149 <row>
150 <entry></entry>
151 <entry></entry><entry>C</entry><entry></entry><entry></entry>
152 <entry></entry><entry>C</entry><entry></entry>
153 </row>
154 <row>
155 <entry>3</entry>
156 <entry>Y</entry><entry></entry><entry>Y</entry><entry></entry>
157 <entry>Y</entry><entry></entry><entry>Y</entry>
158 </row>
159 <row>
160 <entry></entry>
161 <entry></entry><entry>C</entry><entry></entry><entry></entry>
162 <entry></entry><entry>C</entry><entry></entry>
163 </row>
164 </tbody>
165 </tgroup>
166 </informaltable>
167 </para>
168 </formalpara>
169 </example>
170 </refsect1>
171 </refentry>