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