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