Commit | Line | Data |
---|---|---|
5377d91f MH |
1 | .. -*- coding: utf-8; mode: rst -*- |
2 | ||
3 | .. _V4L2-PIX-FMT-NV12: | |
4 | ||
5 | ****************************************************** | |
6 | V4L2_PIX_FMT_NV12 ('NV12'), V4L2_PIX_FMT_NV21 ('NV21') | |
7 | ****************************************************** | |
8 | ||
9 | *man V4L2_PIX_FMT_NV12(2)* | |
10 | ||
11 | V4L2_PIX_FMT_NV21 | |
12 | Formats with ½ horizontal and vertical chroma resolution, also known as | |
13 | YUV 4:2:0. One luminance and one chrominance plane with alternating | |
14 | chroma samples as opposed to ``V4L2_PIX_FMT_YVU420`` | |
15 | ||
16 | ||
17 | Description | |
18 | =========== | |
19 | ||
20 | These are two-plane versions of the YUV 4:2:0 format. The three | |
21 | components are separated into two sub-images or planes. The Y plane is | |
22 | first. The Y plane has one byte per pixel. For ``V4L2_PIX_FMT_NV12``, a | |
23 | combined CbCr plane immediately follows the Y plane in memory. The CbCr | |
24 | plane is the same width, in bytes, as the Y plane (and of the image), | |
25 | but is half as tall in pixels. Each CbCr pair belongs to four pixels. | |
eba9e91c | 26 | For example, Cb\ :sub:`0`/Cr\ :sub:`0` belongs to Y'\ :sub:`00`, |
5377d91f MH |
27 | Y'\ :sub:`01`, Y'\ :sub:`10`, Y'\ :sub:`11`. ``V4L2_PIX_FMT_NV21`` is |
28 | the same except the Cb and Cr bytes are swapped, the CrCb plane starts | |
29 | with a Cr byte. | |
30 | ||
31 | If the Y plane has pad bytes after each row, then the CbCr plane has as | |
32 | many pad bytes after its rows. | |
33 | ||
056d2ee6 | 34 | **Byte Order.** |
5377d91f MH |
35 | Each cell is one byte. |
36 | ||
37 | ||
38 | ||
39 | .. flat-table:: | |
40 | :header-rows: 0 | |
41 | :stub-columns: 0 | |
42 | :widths: 2 1 1 1 1 | |
43 | ||
44 | ||
45 | - .. row 1 | |
46 | ||
47 | - start + 0: | |
48 | ||
49 | - Y'\ :sub:`00` | |
50 | ||
51 | - Y'\ :sub:`01` | |
52 | ||
53 | - Y'\ :sub:`02` | |
54 | ||
55 | - Y'\ :sub:`03` | |
56 | ||
57 | - .. row 2 | |
58 | ||
59 | - start + 4: | |
60 | ||
61 | - Y'\ :sub:`10` | |
62 | ||
63 | - Y'\ :sub:`11` | |
64 | ||
65 | - Y'\ :sub:`12` | |
66 | ||
67 | - Y'\ :sub:`13` | |
68 | ||
69 | - .. row 3 | |
70 | ||
71 | - start + 8: | |
72 | ||
73 | - Y'\ :sub:`20` | |
74 | ||
75 | - Y'\ :sub:`21` | |
76 | ||
77 | - Y'\ :sub:`22` | |
78 | ||
79 | - Y'\ :sub:`23` | |
80 | ||
81 | - .. row 4 | |
82 | ||
83 | - start + 12: | |
84 | ||
85 | - Y'\ :sub:`30` | |
86 | ||
87 | - Y'\ :sub:`31` | |
88 | ||
89 | - Y'\ :sub:`32` | |
90 | ||
91 | - Y'\ :sub:`33` | |
92 | ||
93 | - .. row 5 | |
94 | ||
95 | - start + 16: | |
96 | ||
97 | - Cb\ :sub:`00` | |
98 | ||
99 | - Cr\ :sub:`00` | |
100 | ||
101 | - Cb\ :sub:`01` | |
102 | ||
103 | - Cr\ :sub:`01` | |
104 | ||
105 | - .. row 6 | |
106 | ||
107 | - start + 20: | |
108 | ||
109 | - Cb\ :sub:`10` | |
110 | ||
111 | - Cr\ :sub:`10` | |
112 | ||
113 | - Cb\ :sub:`11` | |
114 | ||
115 | - Cr\ :sub:`11` | |
116 | ||
117 | ||
118 | **Color Sample Location..** | |
119 | ||
5377d91f MH |
120 | .. flat-table:: |
121 | :header-rows: 0 | |
122 | :stub-columns: 0 | |
123 | ||
124 | ||
125 | - .. row 1 | |
126 | ||
0579e6e3 | 127 | - |
5377d91f MH |
128 | - 0 |
129 | ||
0579e6e3 | 130 | - |
5377d91f MH |
131 | - 1 |
132 | ||
5377d91f MH |
133 | - 2 |
134 | ||
0579e6e3 | 135 | - |
5377d91f MH |
136 | - 3 |
137 | ||
138 | - .. row 2 | |
139 | ||
140 | - 0 | |
141 | ||
142 | - Y | |
143 | ||
0579e6e3 | 144 | - |
5377d91f MH |
145 | - Y |
146 | ||
5377d91f MH |
147 | - Y |
148 | ||
0579e6e3 | 149 | - |
5377d91f MH |
150 | - Y |
151 | ||
152 | - .. row 3 | |
153 | ||
0579e6e3 MCC |
154 | - |
155 | - | |
5377d91f MH |
156 | - C |
157 | ||
0579e6e3 MCC |
158 | - |
159 | - | |
5377d91f MH |
160 | - C |
161 | ||
0579e6e3 | 162 | - |
5377d91f MH |
163 | |
164 | - .. row 4 | |
165 | ||
166 | - 1 | |
167 | ||
168 | - Y | |
0579e6e3 | 169 | - |
31ad250f | 170 | |
5377d91f MH |
171 | - Y |
172 | ||
5377d91f MH |
173 | - Y |
174 | ||
0579e6e3 | 175 | - |
5377d91f MH |
176 | - Y |
177 | ||
178 | - .. row 5 | |
179 | ||
0579e6e3 | 180 | - |
5377d91f MH |
181 | |
182 | - .. row 6 | |
183 | ||
184 | - 2 | |
185 | ||
186 | - Y | |
0579e6e3 | 187 | - |
31ad250f | 188 | |
5377d91f MH |
189 | - Y |
190 | ||
5377d91f MH |
191 | - Y |
192 | ||
0579e6e3 | 193 | - |
5377d91f MH |
194 | - Y |
195 | ||
196 | - .. row 7 | |
197 | ||
0579e6e3 MCC |
198 | - |
199 | - | |
5377d91f MH |
200 | - C |
201 | ||
0579e6e3 MCC |
202 | - |
203 | - | |
5377d91f MH |
204 | - C |
205 | ||
0579e6e3 | 206 | - |
5377d91f MH |
207 | |
208 | - .. row 8 | |
209 | ||
210 | - 3 | |
211 | ||
212 | - Y | |
213 | ||
0579e6e3 | 214 | - |
5377d91f MH |
215 | - Y |
216 | ||
5377d91f MH |
217 | - Y |
218 | ||
0579e6e3 | 219 | - |
5377d91f | 220 | - Y |