Commit | Line | Data |
---|---|---|
5377d91f MH |
1 | .. -*- coding: utf-8; mode: rst -*- |
2 | ||
3 | .. _V4L2-PIX-FMT-NV12M: | |
9aff73d2 MCC |
4 | .. _v4l2-pix-fmt-nv12mt-16x16: |
5 | .. _V4L2-PIX-FMT-NV21M: | |
5377d91f MH |
6 | |
7 | *********************************************************************************** | |
8 | V4L2_PIX_FMT_NV12M ('NM12'), V4L2_PIX_FMT_NV21M ('NM21'), V4L2_PIX_FMT_NV12MT_16X16 | |
9 | *********************************************************************************** | |
10 | ||
5377d91f MH |
11 | |
12 | V4L2_PIX_FMT_NV21M | |
13 | V4L2_PIX_FMT_NV12MT_16X16 | |
14 | Variation of ``V4L2_PIX_FMT_NV12`` and ``V4L2_PIX_FMT_NV21`` with planes | |
15 | non contiguous in memory. | |
16 | ||
17 | ||
18 | Description | |
19 | =========== | |
20 | ||
21 | This is a multi-planar, two-plane version of the YUV 4:2:0 format. The | |
22 | three components are separated into two sub-images or planes. | |
23 | ``V4L2_PIX_FMT_NV12M`` differs from ``V4L2_PIX_FMT_NV12`` in that the | |
24 | two planes are non-contiguous in memory, i.e. the chroma plane do not | |
25 | necessarily immediately follows the luma plane. The luminance data | |
26 | occupies the first plane. The Y plane has one byte per pixel. In the | |
27 | second plane there is a chrominance data with alternating chroma | |
28 | samples. The CbCr plane is the same width, in bytes, as the Y plane (and | |
29 | of the image), but is half as tall in pixels. Each CbCr pair belongs to | |
eba9e91c MCC |
30 | four pixels. For example, Cb\ :sub:`0`/Cr\ :sub:`0` belongs to |
31 | Y'\ :sub:`00`, Y'\ :sub:`01`, Y'\ :sub:`10`, Y'\ :sub:`11`. | |
5377d91f MH |
32 | ``V4L2_PIX_FMT_NV12MT_16X16`` is the tiled version of |
33 | ``V4L2_PIX_FMT_NV12M`` with 16x16 macroblock tiles. Here pixels are | |
34 | arranged in 16x16 2D tiles and tiles are arranged in linear order in | |
35 | memory. ``V4L2_PIX_FMT_NV21M`` is the same as ``V4L2_PIX_FMT_NV12M`` | |
36 | except the Cb and Cr bytes are swapped, the CrCb plane starts with a Cr | |
37 | byte. | |
38 | ||
39 | ``V4L2_PIX_FMT_NV12M`` is intended to be used only in drivers and | |
40 | applications that support the multi-planar API, described in | |
41 | :ref:`planar-apis`. | |
42 | ||
43 | If the Y plane has pad bytes after each row, then the CbCr plane has as | |
44 | many pad bytes after its rows. | |
45 | ||
056d2ee6 | 46 | **Byte Order.** |
5377d91f MH |
47 | Each cell is one byte. |
48 | ||
5377d91f MH |
49 | .. flat-table:: |
50 | :header-rows: 0 | |
51 | :stub-columns: 0 | |
5377d91f MH |
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 | - Cr\ :sub:`00` | |
112 | ||
113 | - Cb\ :sub:`01` | |
114 | ||
115 | - Cr\ :sub:`01` | |
116 | ||
117 | - .. row 7 | |
118 | ||
119 | - start1 + 4: | |
120 | ||
121 | - Cb\ :sub:`10` | |
122 | ||
123 | - Cr\ :sub:`10` | |
124 | ||
125 | - Cb\ :sub:`11` | |
126 | ||
127 | - Cr\ :sub:`11` | |
128 | ||
129 | ||
130 | **Color Sample Location..** | |
131 | ||
132 | ||
133 | ||
134 | .. flat-table:: | |
135 | :header-rows: 0 | |
136 | :stub-columns: 0 | |
137 | ||
138 | ||
139 | - .. row 1 | |
140 | ||
0579e6e3 | 141 | - |
5377d91f MH |
142 | - 0 |
143 | ||
0579e6e3 | 144 | - |
5377d91f MH |
145 | - 1 |
146 | ||
5377d91f MH |
147 | - 2 |
148 | ||
0579e6e3 | 149 | - |
5377d91f MH |
150 | - 3 |
151 | ||
152 | - .. row 2 | |
153 | ||
154 | - 0 | |
155 | ||
156 | - Y | |
157 | ||
0579e6e3 | 158 | - |
5377d91f MH |
159 | - Y |
160 | ||
5377d91f MH |
161 | - Y |
162 | ||
0579e6e3 | 163 | - |
5377d91f MH |
164 | - Y |
165 | ||
166 | - .. row 3 | |
167 | ||
0579e6e3 MCC |
168 | - |
169 | - | |
5377d91f MH |
170 | - C |
171 | ||
0579e6e3 MCC |
172 | - |
173 | - | |
5377d91f MH |
174 | - C |
175 | ||
0579e6e3 | 176 | - |
5377d91f MH |
177 | |
178 | - .. row 4 | |
179 | ||
180 | - 1 | |
181 | ||
182 | - Y | |
183 | ||
0579e6e3 | 184 | - |
5377d91f MH |
185 | - Y |
186 | ||
5377d91f MH |
187 | - Y |
188 | ||
0579e6e3 | 189 | - |
5377d91f MH |
190 | - Y |
191 | ||
192 | - .. row 5 | |
193 | ||
0579e6e3 | 194 | - |
5377d91f MH |
195 | |
196 | - .. row 6 | |
197 | ||
198 | - 2 | |
199 | ||
200 | - Y | |
201 | ||
0579e6e3 | 202 | - |
5377d91f MH |
203 | - Y |
204 | ||
5377d91f MH |
205 | - Y |
206 | ||
0579e6e3 | 207 | - |
5377d91f MH |
208 | - Y |
209 | ||
210 | - .. row 7 | |
211 | ||
0579e6e3 MCC |
212 | - |
213 | - | |
5377d91f MH |
214 | - C |
215 | ||
0579e6e3 MCC |
216 | - |
217 | - | |
218 | - | |
5377d91f MH |
219 | - C |
220 | ||
0579e6e3 | 221 | - |
5377d91f MH |
222 | |
223 | - .. row 8 | |
224 | ||
225 | - 3 | |
226 | ||
227 | - Y | |
228 | ||
0579e6e3 | 229 | - |
5377d91f MH |
230 | - Y |
231 | ||
5377d91f MH |
232 | - Y |
233 | ||
0579e6e3 | 234 | - |
5377d91f | 235 | - Y |