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