Revert "HID: multitouch: Support ALPS PTP stick with pid 0x120A"
[sfrench/cifs-2.6.git] / Documentation / media / uapi / v4l / pixfmt-007.rst
1 .. -*- coding: utf-8; mode: rst -*-
2
3 ********************************
4 Detailed Colorspace Descriptions
5 ********************************
6
7
8 .. _col-smpte-170m:
9
10 Colorspace SMPTE 170M (V4L2_COLORSPACE_SMPTE170M)
11 =================================================
12
13 The :ref:`smpte170m` standard defines the colorspace used by NTSC and
14 PAL and by SDTV in general. The default transfer function is
15 ``V4L2_XFER_FUNC_709``. The default Y'CbCr encoding is
16 ``V4L2_YCBCR_ENC_601``. The default Y'CbCr quantization is limited
17 range. The chromaticities of the primary colors and the white reference
18 are:
19
20
21
22 .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
23
24 .. flat-table:: SMPTE 170M Chromaticities
25     :header-rows:  1
26     :stub-columns: 0
27     :widths:       1 1 2
28
29     * - Color
30       - x
31       - y
32     * - Red
33       - 0.630
34       - 0.340
35     * - Green
36       - 0.310
37       - 0.595
38     * - Blue
39       - 0.155
40       - 0.070
41     * - White Reference (D65)
42       - 0.3127
43       - 0.3290
44
45
46 The red, green and blue chromaticities are also often referred to as the
47 SMPTE C set, so this colorspace is sometimes called SMPTE C as well.
48
49 The transfer function defined for SMPTE 170M is the same as the one
50 defined in Rec. 709.
51
52 .. math::
53
54     L' = -1.099(-L)^{0.45} + 0.099 \text{, for } L \le-0.018
55
56     L' = 4.5L \text{, for } -0.018 < L < 0.018
57
58     L' = 1.099L^{0.45} - 0.099 \text{, for } L \ge 0.018
59
60 Inverse Transfer function:
61
62 .. math::
63
64     L = -\left( \frac{L' - 0.099}{-1.099} \right) ^{\frac{1}{0.45}} \text{, for } L' \le -0.081
65
66     L = \frac{L'}{4.5} \text{, for } -0.081 < L' < 0.081
67
68     L = \left(\frac{L' + 0.099}{1.099}\right)^{\frac{1}{0.45} } \text{, for } L' \ge 0.081
69
70 The luminance (Y') and color difference (Cb and Cr) are obtained with
71 the following ``V4L2_YCBCR_ENC_601`` encoding:
72
73 .. math::
74
75     Y' = 0.2990R' + 0.5870G' + 0.1140B'
76
77     Cb = -0.1687R' - 0.3313G' + 0.5B'
78
79     Cr = 0.5R' - 0.4187G' - 0.0813B'
80
81 Y' is clamped to the range [0…1] and Cb and Cr are clamped to the range
82 [-0.5…0.5]. This conversion to Y'CbCr is identical to the one defined in
83 the :ref:`itu601` standard and this colorspace is sometimes called
84 BT.601 as well, even though BT.601 does not mention any color primaries.
85
86 The default quantization is limited range, but full range is possible
87 although rarely seen.
88
89
90 .. _col-rec709:
91
92 Colorspace Rec. 709 (V4L2_COLORSPACE_REC709)
93 ============================================
94
95 The :ref:`itu709` standard defines the colorspace used by HDTV in
96 general. The default transfer function is ``V4L2_XFER_FUNC_709``. The
97 default Y'CbCr encoding is ``V4L2_YCBCR_ENC_709``. The default Y'CbCr
98 quantization is limited range. The chromaticities of the primary colors
99 and the white reference are:
100
101
102
103 .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
104
105 .. flat-table:: Rec. 709 Chromaticities
106     :header-rows:  1
107     :stub-columns: 0
108     :widths:       1 1 2
109
110     * - Color
111       - x
112       - y
113     * - Red
114       - 0.640
115       - 0.330
116     * - Green
117       - 0.300
118       - 0.600
119     * - Blue
120       - 0.150
121       - 0.060
122     * - White Reference (D65)
123       - 0.3127
124       - 0.3290
125
126
127 The full name of this standard is Rec. ITU-R BT.709-5.
128
129 Transfer function. Normally L is in the range [0…1], but for the
130 extended gamut xvYCC encoding values outside that range are allowed.
131
132 .. math::
133
134     L' = -1.099(-L)^{0.45} + 0.099 \text{, for } L \le -0.018
135
136     L' = 4.5L \text{, for } -0.018 < L < 0.018
137
138     L' = 1.099L^{0.45} - 0.099 \text{, for } L \ge 0.018
139
140 Inverse Transfer function:
141
142 .. math::
143
144     L = -\left( \frac{L' - 0.099}{-1.099} \right)^\frac{1}{0.45} \text{, for } L' \le -0.081
145
146     L = \frac{L'}{4.5}\text{, for } -0.081 < L' < 0.081
147
148     L = \left(\frac{L' + 0.099}{1.099}\right)^{\frac{1}{0.45} } \text{, for } L' \ge 0.081
149
150 The luminance (Y') and color difference (Cb and Cr) are obtained with
151 the following ``V4L2_YCBCR_ENC_709`` encoding:
152
153 .. math::
154
155     Y' = 0.2126R' + 0.7152G' + 0.0722B'
156
157     Cb = -0.1146R' - 0.3854G' + 0.5B'
158
159     Cr = 0.5R' - 0.4542G' - 0.0458B'
160
161 Y' is clamped to the range [0…1] and Cb and Cr are clamped to the range
162 [-0.5…0.5].
163
164 The default quantization is limited range, but full range is possible
165 although rarely seen.
166
167 The ``V4L2_YCBCR_ENC_709`` encoding described above is the default for
168 this colorspace, but it can be overridden with ``V4L2_YCBCR_ENC_601``,
169 in which case the BT.601 Y'CbCr encoding is used.
170
171 Two additional extended gamut Y'CbCr encodings are also possible with
172 this colorspace:
173
174 The xvYCC 709 encoding (``V4L2_YCBCR_ENC_XV709``, :ref:`xvycc`) is
175 similar to the Rec. 709 encoding, but it allows for R', G' and B' values
176 that are outside the range [0…1]. The resulting Y', Cb and Cr values are
177 scaled and offset according to the limited range formula:
178
179 .. math::
180
181     Y' = \frac{219}{256} * (0.2126R' + 0.7152G' + 0.0722B') + \frac{16}{256}
182
183     Cb = \frac{224}{256} * (-0.1146R' - 0.3854G' + 0.5B')
184
185     Cr = \frac{224}{256} * (0.5R' - 0.4542G' - 0.0458B')
186
187 The xvYCC 601 encoding (``V4L2_YCBCR_ENC_XV601``, :ref:`xvycc`) is
188 similar to the BT.601 encoding, but it allows for R', G' and B' values
189 that are outside the range [0…1]. The resulting Y', Cb and Cr values are
190 scaled and offset according to the limited range formula:
191
192 .. math::
193
194     Y' = \frac{219}{256} * (0.2990R' + 0.5870G' + 0.1140B') + \frac{16}{256}
195
196     Cb = \frac{224}{256} * (-0.1687R' - 0.3313G' + 0.5B')
197
198     Cr = \frac{224}{256} * (0.5R' - 0.4187G' - 0.0813B')
199
200 Y' is clamped to the range [0…1] and Cb and Cr are clamped to the range
201 [-0.5…0.5] and quantized without further scaling or offsets.
202 The non-standard xvYCC 709 or xvYCC 601 encodings can be
203 used by selecting ``V4L2_YCBCR_ENC_XV709`` or ``V4L2_YCBCR_ENC_XV601``.
204 As seen by the xvYCC formulas these encodings always use limited range quantization,
205 there is no full range variant. The whole point of these extended gamut encodings
206 is that values outside the limited range are still valid, although they
207 map to R', G' and B' values outside the [0…1] range and are therefore outside
208 the Rec. 709 colorspace gamut.
209
210
211 .. _col-srgb:
212
213 Colorspace sRGB (V4L2_COLORSPACE_SRGB)
214 ======================================
215
216 The :ref:`srgb` standard defines the colorspace used by most webcams
217 and computer graphics. The default transfer function is
218 ``V4L2_XFER_FUNC_SRGB``. The default Y'CbCr encoding is
219 ``V4L2_YCBCR_ENC_601``. The default Y'CbCr quantization is limited range.
220
221 Note that the :ref:`sycc` standard specifies full range quantization,
222 however all current capture hardware supported by the kernel convert
223 R'G'B' to limited range Y'CbCr. So choosing full range as the default
224 would break how applications interpret the quantization range.
225
226 The chromaticities of the primary colors and the white reference are:
227
228
229
230 .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
231
232 .. flat-table:: sRGB Chromaticities
233     :header-rows:  1
234     :stub-columns: 0
235     :widths:       1 1 2
236
237     * - Color
238       - x
239       - y
240     * - Red
241       - 0.640
242       - 0.330
243     * - Green
244       - 0.300
245       - 0.600
246     * - Blue
247       - 0.150
248       - 0.060
249     * - White Reference (D65)
250       - 0.3127
251       - 0.3290
252
253
254 These chromaticities are identical to the Rec. 709 colorspace.
255
256 Transfer function. Note that negative values for L are only used by the
257 Y'CbCr conversion.
258
259 .. math::
260
261     L' = -1.055(-L)^{\frac{1}{2.4} } + 0.055\text{, for }L < -0.0031308
262
263     L' = 12.92L\text{, for }-0.0031308 \le L \le 0.0031308
264
265     L' = 1.055L ^{\frac{1}{2.4} } - 0.055\text{, for }0.0031308 < L \le 1
266
267 Inverse Transfer function:
268
269 .. math::
270
271     L = -((-L' + 0.055) / 1.055) ^{2.4}\text{, for }L' < -0.04045
272
273     L = L' / 12.92\text{, for }-0.04045 \le L' \le 0.04045
274
275     L = ((L' + 0.055) / 1.055) ^{2.4}\text{, for }L' > 0.04045
276
277 The luminance (Y') and color difference (Cb and Cr) are obtained with
278 the following ``V4L2_YCBCR_ENC_601`` encoding as defined by :ref:`sycc`:
279
280 .. math::
281
282     Y' = 0.2990R' + 0.5870G' + 0.1140B'
283
284     Cb = -0.1687R' - 0.3313G' + 0.5B'
285
286     Cr = 0.5R' - 0.4187G' - 0.0813B'
287
288 Y' is clamped to the range [0…1] and Cb and Cr are clamped to the range
289 [-0.5…0.5]. This transform is identical to one defined in SMPTE
290 170M/BT.601. The Y'CbCr quantization is limited range.
291
292
293 .. _col-adobergb:
294
295 Colorspace Adobe RGB (V4L2_COLORSPACE_ADOBERGB)
296 ===============================================
297
298 The :ref:`adobergb` standard defines the colorspace used by computer
299 graphics that use the AdobeRGB colorspace. This is also known as the
300 :ref:`oprgb` standard. The default transfer function is
301 ``V4L2_XFER_FUNC_ADOBERGB``. The default Y'CbCr encoding is
302 ``V4L2_YCBCR_ENC_601``. The default Y'CbCr quantization is limited
303 range.
304
305 Note that the :ref:`oprgb` standard specifies full range quantization,
306 however all current capture hardware supported by the kernel convert
307 R'G'B' to limited range Y'CbCr. So choosing full range as the default
308 would break how applications interpret the quantization range.
309
310 The chromaticities of the primary colors and the white reference are:
311
312
313 .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
314
315 .. flat-table:: Adobe RGB Chromaticities
316     :header-rows:  1
317     :stub-columns: 0
318     :widths:       1 1 2
319
320     * - Color
321       - x
322       - y
323     * - Red
324       - 0.6400
325       - 0.3300
326     * - Green
327       - 0.2100
328       - 0.7100
329     * - Blue
330       - 0.1500
331       - 0.0600
332     * - White Reference (D65)
333       - 0.3127
334       - 0.3290
335
336
337
338 Transfer function:
339
340 .. math::
341
342     L' = L ^{\frac{1}{2.19921875}}
343
344 Inverse Transfer function:
345
346 .. math::
347
348     L = L'^{(2.19921875)}
349
350 The luminance (Y') and color difference (Cb and Cr) are obtained with
351 the following ``V4L2_YCBCR_ENC_601`` encoding:
352
353 .. math::
354
355     Y' = 0.2990R' + 0.5870G' + 0.1140B'
356
357     Cb = -0.1687R' - 0.3313G' + 0.5B'
358
359     Cr = 0.5R' - 0.4187G' - 0.0813B'
360
361 Y' is clamped to the range [0…1] and Cb and Cr are clamped to the range
362 [-0.5…0.5]. This transform is identical to one defined in SMPTE
363 170M/BT.601. The Y'CbCr quantization is limited range.
364
365
366 .. _col-bt2020:
367
368 Colorspace BT.2020 (V4L2_COLORSPACE_BT2020)
369 ===========================================
370
371 The :ref:`itu2020` standard defines the colorspace used by Ultra-high
372 definition television (UHDTV). The default transfer function is
373 ``V4L2_XFER_FUNC_709``. The default Y'CbCr encoding is
374 ``V4L2_YCBCR_ENC_BT2020``. The default R'G'B' quantization is limited
375 range (!), and so is the default Y'CbCr quantization. The chromaticities
376 of the primary colors and the white reference are:
377
378
379
380 .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
381
382 .. flat-table:: BT.2020 Chromaticities
383     :header-rows:  1
384     :stub-columns: 0
385     :widths:       1 1 2
386
387     * - Color
388       - x
389       - y
390     * - Red
391       - 0.708
392       - 0.292
393     * - Green
394       - 0.170
395       - 0.797
396     * - Blue
397       - 0.131
398       - 0.046
399     * - White Reference (D65)
400       - 0.3127
401       - 0.3290
402
403
404
405 Transfer function (same as Rec. 709):
406
407 .. math::
408
409     L' = 4.5L\text{, for }0 \le L < 0.018
410
411     L' = 1.099L ^{0.45} - 0.099\text{, for } 0.018 \le L \le 1
412
413 Inverse Transfer function:
414
415 .. math::
416
417     L = L' / 4.5\text{, for } L' < 0.081
418
419     L = \left( \frac{L' + 0.099}{1.099}\right) ^{\frac{1}{0.45} }\text{, for } L' \ge 0.081
420
421 The luminance (Y') and color difference (Cb and Cr) are obtained with
422 the following ``V4L2_YCBCR_ENC_BT2020`` encoding:
423
424 .. math::
425
426     Y' = 0.2627R' + 0.6780G' + 0.0593B'
427
428     Cb = -0.1396R' - 0.3604G' + 0.5B'
429
430     Cr = 0.5R' - 0.4598G' - 0.0402B'
431
432 Y' is clamped to the range [0…1] and Cb and Cr are clamped to the range
433 [-0.5…0.5]. The Y'CbCr quantization is limited range.
434
435 There is also an alternate constant luminance R'G'B' to Yc'CbcCrc
436 (``V4L2_YCBCR_ENC_BT2020_CONST_LUM``) encoding:
437
438 Luma:
439
440 .. math::
441     :nowrap:
442
443     \begin{align*}
444     Yc' = (0.2627R + 0.6780G + 0.0593B)'& \\
445     B' - Yc' \le 0:& \\
446         &Cbc = (B' - Yc') / 1.9404 \\
447     B' - Yc' > 0: & \\
448         &Cbc = (B' - Yc') / 1.5816 \\
449     R' - Yc' \le 0:& \\
450         &Crc = (R' - Y') / 1.7184 \\
451     R' - Yc' > 0:& \\
452         &Crc = (R' - Y') / 0.9936
453     \end{align*}
454
455 Yc' is clamped to the range [0…1] and Cbc and Crc are clamped to the
456 range [-0.5…0.5]. The Yc'CbcCrc quantization is limited range.
457
458
459 .. _col-dcip3:
460
461 Colorspace DCI-P3 (V4L2_COLORSPACE_DCI_P3)
462 ==========================================
463
464 The :ref:`smpte431` standard defines the colorspace used by cinema
465 projectors that use the DCI-P3 colorspace. The default transfer function
466 is ``V4L2_XFER_FUNC_DCI_P3``. The default Y'CbCr encoding is
467 ``V4L2_YCBCR_ENC_709``. The default Y'CbCr quantization is limited range.
468
469 .. note::
470
471    Note that this colorspace standard does not specify a
472    Y'CbCr encoding since it is not meant to be encoded to Y'CbCr. So this
473    default Y'CbCr encoding was picked because it is the HDTV encoding.
474
475 The chromaticities of the primary colors and the white reference are:
476
477
478
479 .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
480
481 .. flat-table:: DCI-P3 Chromaticities
482     :header-rows:  1
483     :stub-columns: 0
484     :widths:       1 1 2
485
486     * - Color
487       - x
488       - y
489     * - Red
490       - 0.6800
491       - 0.3200
492     * - Green
493       - 0.2650
494       - 0.6900
495     * - Blue
496       - 0.1500
497       - 0.0600
498     * - White Reference
499       - 0.3140
500       - 0.3510
501
502
503
504 Transfer function:
505
506 .. math::
507
508     L' = L^{\frac{1}{2.6}}
509
510 Inverse Transfer function:
511
512 .. math::
513
514     L = L'^{(2.6)}
515
516 Y'CbCr encoding is not specified. V4L2 defaults to Rec. 709.
517
518
519 .. _col-smpte-240m:
520
521 Colorspace SMPTE 240M (V4L2_COLORSPACE_SMPTE240M)
522 =================================================
523
524 The :ref:`smpte240m` standard was an interim standard used during the
525 early days of HDTV (1988-1998). It has been superseded by Rec. 709. The
526 default transfer function is ``V4L2_XFER_FUNC_SMPTE240M``. The default
527 Y'CbCr encoding is ``V4L2_YCBCR_ENC_SMPTE240M``. The default Y'CbCr
528 quantization is limited range. The chromaticities of the primary colors
529 and the white reference are:
530
531
532
533 .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
534
535 .. flat-table:: SMPTE 240M Chromaticities
536     :header-rows:  1
537     :stub-columns: 0
538     :widths:       1 1 2
539
540     * - Color
541       - x
542       - y
543     * - Red
544       - 0.630
545       - 0.340
546     * - Green
547       - 0.310
548       - 0.595
549     * - Blue
550       - 0.155
551       - 0.070
552     * - White Reference (D65)
553       - 0.3127
554       - 0.3290
555
556
557 These chromaticities are identical to the SMPTE 170M colorspace.
558
559 Transfer function:
560
561 .. math::
562
563     L' = 4L\text{, for } 0 \le L < 0.0228
564
565     L' = 1.1115L ^{0.45} - 0.1115\text{, for } 0.0228 \le L \le 1
566
567 Inverse Transfer function:
568
569 .. math::
570
571     L = \frac{L'}{4}\text{, for } 0 \le L' < 0.0913
572
573     L = \left( \frac{L' + 0.1115}{1.1115}\right) ^{\frac{1}{0.45} }\text{, for } L' \ge 0.0913
574
575 The luminance (Y') and color difference (Cb and Cr) are obtained with
576 the following ``V4L2_YCBCR_ENC_SMPTE240M`` encoding:
577
578 .. math::
579
580     Y' = 0.2122R' + 0.7013G' + 0.0865B'
581
582     Cb = -0.1161R' - 0.3839G' + 0.5B'
583
584     Cr = 0.5R' - 0.4451G' - 0.0549B'
585
586 Y' is clamped to the range [0…1] and Cb and Cr are clamped to the
587 range [-0.5…0.5]. The Y'CbCr quantization is limited range.
588
589
590 .. _col-sysm:
591
592 Colorspace NTSC 1953 (V4L2_COLORSPACE_470_SYSTEM_M)
593 ===================================================
594
595 This standard defines the colorspace used by NTSC in 1953. In practice
596 this colorspace is obsolete and SMPTE 170M should be used instead. The
597 default transfer function is ``V4L2_XFER_FUNC_709``. The default Y'CbCr
598 encoding is ``V4L2_YCBCR_ENC_601``. The default Y'CbCr quantization is
599 limited range. The chromaticities of the primary colors and the white
600 reference are:
601
602
603
604 .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
605
606 .. flat-table:: NTSC 1953 Chromaticities
607     :header-rows:  1
608     :stub-columns: 0
609     :widths:       1 1 2
610
611     * - Color
612       - x
613       - y
614     * - Red
615       - 0.67
616       - 0.33
617     * - Green
618       - 0.21
619       - 0.71
620     * - Blue
621       - 0.14
622       - 0.08
623     * - White Reference (C)
624       - 0.310
625       - 0.316
626
627
628 .. note::
629
630    This colorspace uses Illuminant C instead of D65 as the white
631    reference. To correctly convert an image in this colorspace to another
632    that uses D65 you need to apply a chromatic adaptation algorithm such as
633    the Bradford method.
634
635 The transfer function was never properly defined for NTSC 1953. The Rec.
636 709 transfer function is recommended in the literature:
637
638 .. math::
639
640     L' = 4.5L\text{, for } 0 \le L < 0.018
641
642     L' = 1.099L ^{0.45} - 0.099\text{, for } 0.018 \le L \le 1
643
644 Inverse Transfer function:
645
646 .. math::
647
648     L = \frac{L'}{4.5} \text{, for } L' < 0.081
649
650     L = \left( \frac{L' + 0.099}{1.099}\right) ^{\frac{1}{0.45} }\text{, for } L' \ge 0.081
651
652 The luminance (Y') and color difference (Cb and Cr) are obtained with
653 the following ``V4L2_YCBCR_ENC_601`` encoding:
654
655 .. math::
656
657     Y' = 0.2990R' + 0.5870G' + 0.1140B'
658
659     Cb = -0.1687R' - 0.3313G' + 0.5B'
660
661     Cr = 0.5R' - 0.4187G' - 0.0813B'
662
663 Y' is clamped to the range [0…1] and Cb and Cr are clamped to the range
664 [-0.5…0.5]. The Y'CbCr quantization is limited range. This transform is
665 identical to one defined in SMPTE 170M/BT.601.
666
667
668 .. _col-sysbg:
669
670 Colorspace EBU Tech. 3213 (V4L2_COLORSPACE_470_SYSTEM_BG)
671 =========================================================
672
673 The :ref:`tech3213` standard defines the colorspace used by PAL/SECAM
674 in 1975. In practice this colorspace is obsolete and SMPTE 170M should
675 be used instead. The default transfer function is
676 ``V4L2_XFER_FUNC_709``. The default Y'CbCr encoding is
677 ``V4L2_YCBCR_ENC_601``. The default Y'CbCr quantization is limited
678 range. The chromaticities of the primary colors and the white reference
679 are:
680
681
682
683 .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
684
685 .. flat-table:: EBU Tech. 3213 Chromaticities
686     :header-rows:  1
687     :stub-columns: 0
688     :widths:       1 1 2
689
690     * - Color
691       - x
692       - y
693     * - Red
694       - 0.64
695       - 0.33
696     * - Green
697       - 0.29
698       - 0.60
699     * - Blue
700       - 0.15
701       - 0.06
702     * - White Reference (D65)
703       - 0.3127
704       - 0.3290
705
706
707
708 The transfer function was never properly defined for this colorspace.
709 The Rec. 709 transfer function is recommended in the literature:
710
711 .. math::
712
713     L' = 4.5L\text{, for } 0 \le L < 0.018
714
715     L' = 1.099L ^{0.45} - 0.099\text{, for } 0.018 \le L \le 1
716
717 Inverse Transfer function:
718
719 .. math::
720
721     L = \frac{L'}{4.5} \text{, for } L' < 0.081
722
723     L = \left(\frac{L' + 0.099}{1.099} \right) ^{\frac{1}{0.45} }\text{, for } L' \ge 0.081
724
725 The luminance (Y') and color difference (Cb and Cr) are obtained with
726 the following ``V4L2_YCBCR_ENC_601`` encoding:
727
728 .. math::
729
730     Y' = 0.2990R' + 0.5870G' + 0.1140B'
731
732     Cb = -0.1687R' - 0.3313G' + 0.5B'
733
734     Cr = 0.5R' - 0.4187G' - 0.0813B'
735
736 Y' is clamped to the range [0…1] and Cb and Cr are clamped to the range
737 [-0.5…0.5]. The Y'CbCr quantization is limited range. This transform is
738 identical to one defined in SMPTE 170M/BT.601.
739
740
741 .. _col-jpeg:
742
743 Colorspace JPEG (V4L2_COLORSPACE_JPEG)
744 ======================================
745
746 This colorspace defines the colorspace used by most (Motion-)JPEG
747 formats. The chromaticities of the primary colors and the white
748 reference are identical to sRGB. The transfer function use is
749 ``V4L2_XFER_FUNC_SRGB``. The Y'CbCr encoding is ``V4L2_YCBCR_ENC_601``
750 with full range quantization where Y' is scaled to [0…255] and Cb/Cr are
751 scaled to [-128…128] and then clipped to [-128…127].
752
753 .. note::
754
755    The JPEG standard does not actually store colorspace
756    information. So if something other than sRGB is used, then the driver
757    will have to set that information explicitly. Effectively
758    ``V4L2_COLORSPACE_JPEG`` can be considered to be an abbreviation for
759    ``V4L2_COLORSPACE_SRGB``, ``V4L2_YCBCR_ENC_601`` and
760    ``V4L2_QUANTIZATION_FULL_RANGE``.