Merge branch 'for-4.11' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata
[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:
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:
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]. The non-standard xvYCC 709 or xvYCC 601 encodings can be
202 used by selecting ``V4L2_YCBCR_ENC_XV709`` or ``V4L2_YCBCR_ENC_XV601``.
203 The xvYCC encodings always use full range quantization.
204
205
206 .. _col-srgb:
207
208 Colorspace sRGB (V4L2_COLORSPACE_SRGB)
209 ======================================
210
211 The :ref:`srgb` standard defines the colorspace used by most webcams
212 and computer graphics. The default transfer function is
213 ``V4L2_XFER_FUNC_SRGB``. The default Y'CbCr encoding is
214 ``V4L2_YCBCR_ENC_601``. The default Y'CbCr quantization is limited range.
215
216 Note that the :ref:`sycc` standard specifies full range quantization,
217 however all current capture hardware supported by the kernel convert
218 R'G'B' to limited range Y'CbCr. So choosing full range as the default
219 would break how applications interpret the quantization range.
220
221 The chromaticities of the primary colors and the white reference are:
222
223
224
225 .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
226
227 .. flat-table:: sRGB Chromaticities
228     :header-rows:  1
229     :stub-columns: 0
230     :widths:       1 1 2
231
232     * - Color
233       - x
234       - y
235     * - Red
236       - 0.640
237       - 0.330
238     * - Green
239       - 0.300
240       - 0.600
241     * - Blue
242       - 0.150
243       - 0.060
244     * - White Reference (D65)
245       - 0.3127
246       - 0.3290
247
248
249 These chromaticities are identical to the Rec. 709 colorspace.
250
251 Transfer function. Note that negative values for L are only used by the
252 Y'CbCr conversion.
253
254 .. math::
255
256     L' = -1.055(-L)^{\frac{1}{2.4} } + 0.055\text{, for }L < -0.0031308
257
258     L' = 12.92L\text{, for }-0.0031308 \le L \le 0.0031308
259
260     L' = 1.055L ^{\frac{1}{2.4} } - 0.055\text{, for }0.0031308 < L \le 1
261
262 Inverse Transfer function:
263
264 .. math::
265
266     L = -((-L' + 0.055) / 1.055) ^{2.4}\text{, for }L' < -0.04045
267
268     L = L' / 12.92\text{, for }-0.04045 \le L' \le 0.04045
269
270     L = ((L' + 0.055) / 1.055) ^{2.4}\text{, for }L' > 0.04045
271
272 The luminance (Y') and color difference (Cb and Cr) are obtained with
273 the following ``V4L2_YCBCR_ENC_601`` encoding as defined by :ref:`sycc`:
274
275 .. math::
276
277     Y' = 0.2990R' + 0.5870G' + 0.1140B'
278
279     Cb = -0.1687R' - 0.3313G' + 0.5B'
280
281     Cr = 0.5R' - 0.4187G' - 0.0813B'
282
283 Y' is clamped to the range [0…1] and Cb and Cr are clamped to the range
284 [-0.5…0.5]. This transform is identical to one defined in SMPTE
285 170M/BT.601. The Y'CbCr quantization is limited range.
286
287
288 .. _col-adobergb:
289
290 Colorspace Adobe RGB (V4L2_COLORSPACE_ADOBERGB)
291 ===============================================
292
293 The :ref:`adobergb` standard defines the colorspace used by computer
294 graphics that use the AdobeRGB colorspace. This is also known as the
295 :ref:`oprgb` standard. The default transfer function is
296 ``V4L2_XFER_FUNC_ADOBERGB``. The default Y'CbCr encoding is
297 ``V4L2_YCBCR_ENC_601``. The default Y'CbCr quantization is limited
298 range.
299
300 Note that the :ref:`oprgb` standard specifies full range quantization,
301 however all current capture hardware supported by the kernel convert
302 R'G'B' to limited range Y'CbCr. So choosing full range as the default
303 would break how applications interpret the quantization range.
304
305 The chromaticities of the primary colors and the white reference are:
306
307
308 .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
309
310 .. flat-table:: Adobe RGB Chromaticities
311     :header-rows:  1
312     :stub-columns: 0
313     :widths:       1 1 2
314
315     * - Color
316       - x
317       - y
318     * - Red
319       - 0.6400
320       - 0.3300
321     * - Green
322       - 0.2100
323       - 0.7100
324     * - Blue
325       - 0.1500
326       - 0.0600
327     * - White Reference (D65)
328       - 0.3127
329       - 0.3290
330
331
332
333 Transfer function:
334
335 .. math::
336
337     L' = L ^{\frac{1}{2.19921875}}
338
339 Inverse Transfer function:
340
341 .. math::
342
343     L = L'^{(2.19921875)}
344
345 The luminance (Y') and color difference (Cb and Cr) are obtained with
346 the following ``V4L2_YCBCR_ENC_601`` encoding:
347
348 .. math::
349
350     Y' = 0.2990R' + 0.5870G' + 0.1140B'
351
352     Cb = -0.1687R' - 0.3313G' + 0.5B'
353
354     Cr = 0.5R' - 0.4187G' - 0.0813B'
355
356 Y' is clamped to the range [0…1] and Cb and Cr are clamped to the range
357 [-0.5…0.5]. This transform is identical to one defined in SMPTE
358 170M/BT.601. The Y'CbCr quantization is limited range.
359
360
361 .. _col-bt2020:
362
363 Colorspace BT.2020 (V4L2_COLORSPACE_BT2020)
364 ===========================================
365
366 The :ref:`itu2020` standard defines the colorspace used by Ultra-high
367 definition television (UHDTV). The default transfer function is
368 ``V4L2_XFER_FUNC_709``. The default Y'CbCr encoding is
369 ``V4L2_YCBCR_ENC_BT2020``. The default R'G'B' quantization is limited
370 range (!), and so is the default Y'CbCr quantization. The chromaticities
371 of the primary colors and the white reference are:
372
373
374
375 .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
376
377 .. flat-table:: BT.2020 Chromaticities
378     :header-rows:  1
379     :stub-columns: 0
380     :widths:       1 1 2
381
382     * - Color
383       - x
384       - y
385     * - Red
386       - 0.708
387       - 0.292
388     * - Green
389       - 0.170
390       - 0.797
391     * - Blue
392       - 0.131
393       - 0.046
394     * - White Reference (D65)
395       - 0.3127
396       - 0.3290
397
398
399
400 Transfer function (same as Rec. 709):
401
402 .. math::
403
404     L' = 4.5L\text{, for }0 \le L < 0.018
405
406     L' = 1.099L ^{0.45} - 0.099\text{, for } 0.018 \le L \le 1
407
408 Inverse Transfer function:
409
410 .. math::
411
412     L = L' / 4.5\text{, for } L' < 0.081
413
414     L = \left( \frac{L' + 0.099}{1.099}\right) ^{\frac{1}{0.45} }\text{, for } L' \ge 0.081
415
416 The luminance (Y') and color difference (Cb and Cr) are obtained with
417 the following ``V4L2_YCBCR_ENC_BT2020`` encoding:
418
419 .. math::
420
421     Y' = 0.2627R' + 0.6780G' + 0.0593B'
422
423     Cb = -0.1396R' - 0.3604G' + 0.5B'
424
425     Cr = 0.5R' - 0.4598G' - 0.0402B'
426
427 Y' is clamped to the range [0…1] and Cb and Cr are clamped to the range
428 [-0.5…0.5]. The Y'CbCr quantization is limited range.
429
430 There is also an alternate constant luminance R'G'B' to Yc'CbcCrc
431 (``V4L2_YCBCR_ENC_BT2020_CONST_LUM``) encoding:
432
433 Luma:
434
435 .. math::
436     :nowrap:
437
438     \begin{align*}
439     Yc' = (0.2627R + 0.6780G + 0.0593B)'& \\
440     B' - Yc' \le 0:& \\
441         &Cbc = (B' - Yc') / 1.9404 \\
442     B' - Yc' > 0: & \\
443         &Cbc = (B' - Yc') / 1.5816 \\
444     R' - Yc' \le 0:& \\
445         &Crc = (R' - Y') / 1.7184 \\
446     R' - Yc' > 0:& \\
447         &Crc = (R' - Y') / 0.9936
448     \end{align*}
449
450 Yc' is clamped to the range [0…1] and Cbc and Crc are clamped to the
451 range [-0.5…0.5]. The Yc'CbcCrc quantization is limited range.
452
453
454 .. _col-dcip3:
455
456 Colorspace DCI-P3 (V4L2_COLORSPACE_DCI_P3)
457 ==========================================
458
459 The :ref:`smpte431` standard defines the colorspace used by cinema
460 projectors that use the DCI-P3 colorspace. The default transfer function
461 is ``V4L2_XFER_FUNC_DCI_P3``. The default Y'CbCr encoding is
462 ``V4L2_YCBCR_ENC_709``. The default Y'CbCr quantization is limited range.
463
464 .. note::
465
466    Note that this colorspace standard does not specify a
467    Y'CbCr encoding since it is not meant to be encoded to Y'CbCr. So this
468    default Y'CbCr encoding was picked because it is the HDTV encoding.
469
470 The chromaticities of the primary colors and the white reference are:
471
472
473
474 .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
475
476 .. flat-table:: DCI-P3 Chromaticities
477     :header-rows:  1
478     :stub-columns: 0
479     :widths:       1 1 2
480
481     * - Color
482       - x
483       - y
484     * - Red
485       - 0.6800
486       - 0.3200
487     * - Green
488       - 0.2650
489       - 0.6900
490     * - Blue
491       - 0.1500
492       - 0.0600
493     * - White Reference
494       - 0.3140
495       - 0.3510
496
497
498
499 Transfer function:
500
501 .. math::
502
503     L' = L^{\frac{1}{2.6}}
504
505 Inverse Transfer function:
506
507 .. math::
508
509     L = L'^{(2.6)}
510
511 Y'CbCr encoding is not specified. V4L2 defaults to Rec. 709.
512
513
514 .. _col-smpte-240m:
515
516 Colorspace SMPTE 240M (V4L2_COLORSPACE_SMPTE240M)
517 =================================================
518
519 The :ref:`smpte240m` standard was an interim standard used during the
520 early days of HDTV (1988-1998). It has been superseded by Rec. 709. The
521 default transfer function is ``V4L2_XFER_FUNC_SMPTE240M``. The default
522 Y'CbCr encoding is ``V4L2_YCBCR_ENC_SMPTE240M``. The default Y'CbCr
523 quantization is limited range. The chromaticities of the primary colors
524 and the white reference are:
525
526
527
528 .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
529
530 .. flat-table:: SMPTE 240M Chromaticities
531     :header-rows:  1
532     :stub-columns: 0
533     :widths:       1 1 2
534
535     * - Color
536       - x
537       - y
538     * - Red
539       - 0.630
540       - 0.340
541     * - Green
542       - 0.310
543       - 0.595
544     * - Blue
545       - 0.155
546       - 0.070
547     * - White Reference (D65)
548       - 0.3127
549       - 0.3290
550
551
552 These chromaticities are identical to the SMPTE 170M colorspace.
553
554 Transfer function:
555
556 .. math::
557
558     L' = 4L\text{, for } 0 \le L < 0.0228
559
560     L' = 1.1115L ^{0.45} - 0.1115\text{, for } 0.0228 \le L \le 1
561
562 Inverse Transfer function:
563
564 .. math::
565
566     L = \frac{L'}{4}\text{, for } 0 \le L' < 0.0913
567
568     L = \left( \frac{L' + 0.1115}{1.1115}\right) ^{\frac{1}{0.45} }\text{, for } L' \ge 0.0913
569
570 The luminance (Y') and color difference (Cb and Cr) are obtained with
571 the following ``V4L2_YCBCR_ENC_SMPTE240M`` encoding:
572
573 .. math::
574
575     Y' = 0.2122R' + 0.7013G' + 0.0865B'
576
577     Cb = -0.1161R' - 0.3839G' + 0.5B'
578
579     Cr = 0.5R' - 0.4451G' - 0.0549B'
580
581 Y' is clamped to the range [0…1] and Cb and Cr are clamped to the
582 range [-0.5…0.5]. The Y'CbCr quantization is limited range.
583
584
585 .. _col-sysm:
586
587 Colorspace NTSC 1953 (V4L2_COLORSPACE_470_SYSTEM_M)
588 ===================================================
589
590 This standard defines the colorspace used by NTSC in 1953. In practice
591 this colorspace is obsolete and SMPTE 170M should be used instead. The
592 default transfer function is ``V4L2_XFER_FUNC_709``. The default Y'CbCr
593 encoding is ``V4L2_YCBCR_ENC_601``. The default Y'CbCr quantization is
594 limited range. The chromaticities of the primary colors and the white
595 reference are:
596
597
598
599 .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
600
601 .. flat-table:: NTSC 1953 Chromaticities
602     :header-rows:  1
603     :stub-columns: 0
604     :widths:       1 1 2
605
606     * - Color
607       - x
608       - y
609     * - Red
610       - 0.67
611       - 0.33
612     * - Green
613       - 0.21
614       - 0.71
615     * - Blue
616       - 0.14
617       - 0.08
618     * - White Reference (C)
619       - 0.310
620       - 0.316
621
622
623 .. note::
624
625    This colorspace uses Illuminant C instead of D65 as the white
626    reference. To correctly convert an image in this colorspace to another
627    that uses D65 you need to apply a chromatic adaptation algorithm such as
628    the Bradford method.
629
630 The transfer function was never properly defined for NTSC 1953. The Rec.
631 709 transfer function is recommended in the literature:
632
633 .. math::
634
635     L' = 4.5L\text{, for } 0 \le L < 0.018
636
637     L' = 1.099L ^{0.45} - 0.099\text{, for } 0.018 \le L \le 1
638
639 Inverse Transfer function:
640
641 .. math::
642
643     L = \frac{L'}{4.5} \text{, for } L' < 0.081
644
645     L = \left( \frac{L' + 0.099}{1.099}\right) ^{\frac{1}{0.45} }\text{, for } L' \ge 0.081
646
647 The luminance (Y') and color difference (Cb and Cr) are obtained with
648 the following ``V4L2_YCBCR_ENC_601`` encoding:
649
650 .. math::
651
652     Y' = 0.2990R' + 0.5870G' + 0.1140B'
653
654     Cb = -0.1687R' - 0.3313G' + 0.5B'
655
656     Cr = 0.5R' - 0.4187G' - 0.0813B'
657
658 Y' is clamped to the range [0…1] and Cb and Cr are clamped to the range
659 [-0.5…0.5]. The Y'CbCr quantization is limited range. This transform is
660 identical to one defined in SMPTE 170M/BT.601.
661
662
663 .. _col-sysbg:
664
665 Colorspace EBU Tech. 3213 (V4L2_COLORSPACE_470_SYSTEM_BG)
666 =========================================================
667
668 The :ref:`tech3213` standard defines the colorspace used by PAL/SECAM
669 in 1975. In practice this colorspace is obsolete and SMPTE 170M should
670 be used instead. The default transfer function is
671 ``V4L2_XFER_FUNC_709``. The default Y'CbCr encoding is
672 ``V4L2_YCBCR_ENC_601``. The default Y'CbCr quantization is limited
673 range. The chromaticities of the primary colors and the white reference
674 are:
675
676
677
678 .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
679
680 .. flat-table:: EBU Tech. 3213 Chromaticities
681     :header-rows:  1
682     :stub-columns: 0
683     :widths:       1 1 2
684
685     * - Color
686       - x
687       - y
688     * - Red
689       - 0.64
690       - 0.33
691     * - Green
692       - 0.29
693       - 0.60
694     * - Blue
695       - 0.15
696       - 0.06
697     * - White Reference (D65)
698       - 0.3127
699       - 0.3290
700
701
702
703 The transfer function was never properly defined for this colorspace.
704 The Rec. 709 transfer function is recommended in the literature:
705
706 .. math::
707
708     L' = 4.5L\text{, for } 0 \le L < 0.018
709
710     L' = 1.099L ^{0.45} - 0.099\text{, for } 0.018 \le L \le 1
711
712 Inverse Transfer function:
713
714 .. math::
715
716     L = \frac{L'}{4.5} \text{, for } L' < 0.081
717
718     L = \left(\frac{L' + 0.099}{1.099} \right) ^{\frac{1}{0.45} }\text{, for } L' \ge 0.081
719
720 The luminance (Y') and color difference (Cb and Cr) are obtained with
721 the following ``V4L2_YCBCR_ENC_601`` encoding:
722
723 .. math::
724
725     Y' = 0.2990R' + 0.5870G' + 0.1140B'
726
727     Cb = -0.1687R' - 0.3313G' + 0.5B'
728
729     Cr = 0.5R' - 0.4187G' - 0.0813B'
730
731 Y' is clamped to the range [0…1] and Cb and Cr are clamped to the range
732 [-0.5…0.5]. The Y'CbCr quantization is limited range. This transform is
733 identical to one defined in SMPTE 170M/BT.601.
734
735
736 .. _col-jpeg:
737
738 Colorspace JPEG (V4L2_COLORSPACE_JPEG)
739 ======================================
740
741 This colorspace defines the colorspace used by most (Motion-)JPEG
742 formats. The chromaticities of the primary colors and the white
743 reference are identical to sRGB. The transfer function use is
744 ``V4L2_XFER_FUNC_SRGB``. The Y'CbCr encoding is ``V4L2_YCBCR_ENC_601``
745 with full range quantization where Y' is scaled to [0…255] and Cb/Cr are
746 scaled to [-128…128] and then clipped to [-128…127].
747
748 .. note::
749
750    The JPEG standard does not actually store colorspace
751    information. So if something other than sRGB is used, then the driver
752    will have to set that information explicitly. Effectively
753    ``V4L2_COLORSPACE_JPEG`` can be considered to be an abbreviation for
754    ``V4L2_COLORSPACE_SRGB``, ``V4L2_YCBCR_ENC_601`` and
755    ``V4L2_QUANTIZATION_FULL_RANGE``.