Commit | Line | Data |
---|---|---|
5377d91f MH |
1 | .. -*- coding: utf-8; mode: rst -*- |
2 | ||
3 | .. _V4L2-PIX-FMT-NV12: | |
9aff73d2 | 4 | .. _V4L2-PIX-FMT-NV21: |
5377d91f MH |
5 | |
6 | ****************************************************** | |
7 | V4L2_PIX_FMT_NV12 ('NV12'), V4L2_PIX_FMT_NV21 ('NV21') | |
8 | ****************************************************** | |
9 | ||
5377d91f MH |
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 | ||
5377d91f MH |
38 | .. flat-table:: |
39 | :header-rows: 0 | |
40 | :stub-columns: 0 | |
5377d91f MH |
41 | |
42 | - .. row 1 | |
43 | ||
44 | - start + 0: | |
45 | ||
46 | - Y'\ :sub:`00` | |
47 | ||
48 | - Y'\ :sub:`01` | |
49 | ||
50 | - Y'\ :sub:`02` | |
51 | ||
52 | - Y'\ :sub:`03` | |
53 | ||
54 | - .. row 2 | |
55 | ||
56 | - start + 4: | |
57 | ||
58 | - Y'\ :sub:`10` | |
59 | ||
60 | - Y'\ :sub:`11` | |
61 | ||
62 | - Y'\ :sub:`12` | |
63 | ||
64 | - Y'\ :sub:`13` | |
65 | ||
66 | - .. row 3 | |
67 | ||
68 | - start + 8: | |
69 | ||
70 | - Y'\ :sub:`20` | |
71 | ||
72 | - Y'\ :sub:`21` | |
73 | ||
74 | - Y'\ :sub:`22` | |
75 | ||
76 | - Y'\ :sub:`23` | |
77 | ||
78 | - .. row 4 | |
79 | ||
80 | - start + 12: | |
81 | ||
82 | - Y'\ :sub:`30` | |
83 | ||
84 | - Y'\ :sub:`31` | |
85 | ||
86 | - Y'\ :sub:`32` | |
87 | ||
88 | - Y'\ :sub:`33` | |
89 | ||
90 | - .. row 5 | |
91 | ||
92 | - start + 16: | |
93 | ||
94 | - Cb\ :sub:`00` | |
95 | ||
96 | - Cr\ :sub:`00` | |
97 | ||
98 | - Cb\ :sub:`01` | |
99 | ||
100 | - Cr\ :sub:`01` | |
101 | ||
102 | - .. row 6 | |
103 | ||
104 | - start + 20: | |
105 | ||
106 | - Cb\ :sub:`10` | |
107 | ||
108 | - Cr\ :sub:`10` | |
109 | ||
110 | - Cb\ :sub:`11` | |
111 | ||
112 | - Cr\ :sub:`11` | |
113 | ||
114 | ||
115 | **Color Sample Location..** | |
116 | ||
5377d91f MH |
117 | .. flat-table:: |
118 | :header-rows: 0 | |
119 | :stub-columns: 0 | |
120 | ||
121 | ||
122 | - .. row 1 | |
123 | ||
0579e6e3 | 124 | - |
5377d91f MH |
125 | - 0 |
126 | ||
0579e6e3 | 127 | - |
5377d91f MH |
128 | - 1 |
129 | ||
5377d91f MH |
130 | - 2 |
131 | ||
0579e6e3 | 132 | - |
5377d91f MH |
133 | - 3 |
134 | ||
135 | - .. row 2 | |
136 | ||
137 | - 0 | |
138 | ||
139 | - Y | |
140 | ||
0579e6e3 | 141 | - |
5377d91f MH |
142 | - Y |
143 | ||
5377d91f MH |
144 | - Y |
145 | ||
0579e6e3 | 146 | - |
5377d91f MH |
147 | - Y |
148 | ||
149 | - .. row 3 | |
150 | ||
0579e6e3 MCC |
151 | - |
152 | - | |
5377d91f MH |
153 | - C |
154 | ||
0579e6e3 MCC |
155 | - |
156 | - | |
5377d91f MH |
157 | - C |
158 | ||
0579e6e3 | 159 | - |
5377d91f MH |
160 | |
161 | - .. row 4 | |
162 | ||
163 | - 1 | |
164 | ||
165 | - Y | |
0579e6e3 | 166 | - |
31ad250f | 167 | |
5377d91f MH |
168 | - Y |
169 | ||
5377d91f MH |
170 | - Y |
171 | ||
0579e6e3 | 172 | - |
5377d91f MH |
173 | - Y |
174 | ||
175 | - .. row 5 | |
176 | ||
0579e6e3 | 177 | - |
5377d91f MH |
178 | |
179 | - .. row 6 | |
180 | ||
181 | - 2 | |
182 | ||
183 | - Y | |
0579e6e3 | 184 | - |
31ad250f | 185 | |
5377d91f MH |
186 | - Y |
187 | ||
5377d91f MH |
188 | - Y |
189 | ||
0579e6e3 | 190 | - |
5377d91f MH |
191 | - Y |
192 | ||
193 | - .. row 7 | |
194 | ||
0579e6e3 MCC |
195 | - |
196 | - | |
5377d91f MH |
197 | - C |
198 | ||
0579e6e3 MCC |
199 | - |
200 | - | |
5377d91f MH |
201 | - C |
202 | ||
0579e6e3 | 203 | - |
5377d91f MH |
204 | |
205 | - .. row 8 | |
206 | ||
207 | - 3 | |
208 | ||
209 | - Y | |
210 | ||
0579e6e3 | 211 | - |
5377d91f MH |
212 | - Y |
213 | ||
5377d91f MH |
214 | - Y |
215 | ||
0579e6e3 | 216 | - |
5377d91f | 217 | - Y |