~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/Documentation/userspace-api/media/v4l/yuv-formats.rst

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 .. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
  2 
  3 .. _yuv-formats:
  4 
  5 ***********
  6 YUV Formats
  7 ***********
  8 
  9 YUV is the format native to TV broadcast and composite video signals. It
 10 separates the brightness information (Y) from the color information (U
 11 and V or Cb and Cr). The color information consists of red and blue
 12 *color difference* signals, this way the green component can be
 13 reconstructed by subtracting from the brightness component. See
 14 :ref:`colorspaces` for conversion examples. YUV was chosen because
 15 early television would only transmit brightness information. To add
 16 color in a way compatible with existing receivers a new signal carrier
 17 was added to transmit the color difference signals.
 18 
 19 
 20 Subsampling
 21 ===========
 22 
 23 YUV formats commonly encode images with a lower resolution for the chroma
 24 components than for the luma component. This compression technique, taking
 25 advantage of the human eye being more sensitive to luminance than color
 26 differences, is called chroma subsampling.
 27 
 28 While many combinations of subsampling factors in the horizontal and vertical
 29 direction are possible, common factors are 1 (no subsampling), 2 and 4, with
 30 horizontal subsampling always larger than or equal to vertical subsampling.
 31 Common combinations are named as follows.
 32 
 33 - `4:4:4`: No subsampling
 34 - `4:2:2`: Horizontal subsampling by 2, no vertical subsampling
 35 - `4:2:0`: Horizontal subsampling by 2, vertical subsampling by 2
 36 - `4:1:1`: Horizontal subsampling by 4, no vertical subsampling
 37 - `4:1:0`: Horizontal subsampling by 4, vertical subsampling by 4
 38 
 39 Subsampling the chroma component effectively creates chroma values that can be
 40 located in different spatial locations:
 41 
 42 - .. _yuv-chroma-centered:
 43 
 44   The subsampled chroma value may be calculated by simply averaging the chroma
 45   value of two consecutive pixels. It effectively models the chroma of a pixel
 46   sited between the two original pixels. This is referred to as centered or
 47   interstitially sited chroma.
 48 
 49 - .. _yuv-chroma-cosited:
 50 
 51   The other option is to subsample chroma values in a way that place them in
 52   the same spatial sites as the pixels. This may be performed by skipping every
 53   other chroma sample (creating aliasing artifacts), or with filters using an
 54   odd number of taps. This is referred to as co-sited chroma.
 55 
 56 The following examples show different combination of chroma siting in a 4x4
 57 image.
 58 
 59 .. flat-table:: 4:2:2 subsampling, interstitially sited
 60     :header-rows: 1
 61     :stub-columns: 1
 62 
 63     * -
 64       - 0
 65       -
 66       - 1
 67       -
 68       - 2
 69       -
 70       - 3
 71     * - 0
 72       - Y
 73       - C
 74       - Y
 75       -
 76       - Y
 77       - C
 78       - Y
 79     * - 1
 80       - Y
 81       - C
 82       - Y
 83       -
 84       - Y
 85       - C
 86       - Y
 87     * - 2
 88       - Y
 89       - C
 90       - Y
 91       -
 92       - Y
 93       - C
 94       - Y
 95     * - 3
 96       - Y
 97       - C
 98       - Y
 99       -
100       - Y
101       - C
102       - Y
103 
104 .. flat-table:: 4:2:2 subsampling, co-sited
105     :header-rows: 1
106     :stub-columns: 1
107 
108     * -
109       - 0
110       -
111       - 1
112       -
113       - 2
114       -
115       - 3
116     * - 0
117       - Y/C
118       -
119       - Y
120       -
121       - Y/C
122       -
123       - Y
124     * - 1
125       - Y/C
126       -
127       - Y
128       -
129       - Y/C
130       -
131       - Y
132     * - 2
133       - Y/C
134       -
135       - Y
136       -
137       - Y/C
138       -
139       - Y
140     * - 3
141       - Y/C
142       -
143       - Y
144       -
145       - Y/C
146       -
147       - Y
148 
149 .. flat-table:: 4:2:0 subsampling, horizontally interstitially sited, vertically co-sited
150     :header-rows: 1
151     :stub-columns: 1
152 
153     * -
154       - 0
155       -
156       - 1
157       -
158       - 2
159       -
160       - 3
161     * - 0
162       - Y
163       - C
164       - Y
165       -
166       - Y
167       - C
168       - Y
169     * - 1
170       - Y
171       -
172       - Y
173       -
174       - Y
175       -
176       - Y
177     * - 2
178       - Y
179       - C
180       - Y
181       -
182       - Y
183       - C
184       - Y
185     * - 3
186       - Y
187       -
188       - Y
189       -
190       - Y
191       -
192       - Y
193 
194 .. flat-table:: 4:1:0 subsampling, horizontally and vertically interstitially sited
195     :header-rows: 1
196     :stub-columns: 1
197 
198     * -
199       - 0
200       -
201       - 1
202       -
203       - 2
204       -
205       - 3
206     * - 0
207       - Y
208       -
209       - Y
210       -
211       - Y
212       -
213       - Y
214     * -
215       -
216       -
217       -
218       -
219       -
220       -
221       -
222     * - 1
223       - Y
224       -
225       - Y
226       -
227       - Y
228       -
229       - Y
230     * -
231       -
232       -
233       -
234       - C
235       -
236       -
237       -
238     * - 2
239       - Y
240       -
241       - Y
242       -
243       - Y
244       -
245       - Y
246     * -
247       -
248       -
249       -
250       -
251       -
252       -
253       -
254     * - 3
255       - Y
256       -
257       - Y
258       -
259       - Y
260       -
261       - Y
262 
263 
264 .. toctree::
265     :maxdepth: 1
266 
267     pixfmt-packed-yuv
268     pixfmt-yuv-planar
269     pixfmt-yuv-luma
270     pixfmt-y8i
271     pixfmt-y12i
272     pixfmt-uv8
273     pixfmt-m420

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php