1<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Detailed Colorspace Descriptions</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="LINUX MEDIA INFRASTRUCTURE API"><link rel="up" href="pixfmt.html" title="Chapter 2. Image Formats"><link rel="prev" href="ch02s05.html" title="Defining Colorspaces in V4L2"><link rel="next" href="ch02s07.html" title="Detailed Transfer Function Descriptions"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Detailed Colorspace Descriptions</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch02s05.html">Prev</a> </td><th width="60%" align="center">Chapter 2. Image Formats</th><td width="20%" align="right"> <a accesskey="n" href="ch02s07.html">Next</a></td></tr></table><hr></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id-1.4.5.8"></a>Detailed Colorspace Descriptions</h2></div></div></div><div class="toc"><dl class="toc"><dt><span class="section"><a href="ch02s06.html#col-smpte-170m">Colorspace SMPTE 170M (<code class="constant">V4L2_COLORSPACE_SMPTE170M</code>)</a></span></dt><dt><span class="section"><a href="ch02s06.html#col-rec709">Colorspace Rec. 709 (<code class="constant">V4L2_COLORSPACE_REC709</code>)</a></span></dt><dt><span class="section"><a href="ch02s06.html#col-srgb">Colorspace sRGB (<code class="constant">V4L2_COLORSPACE_SRGB</code>)</a></span></dt><dt><span class="section"><a href="ch02s06.html#col-adobergb">Colorspace Adobe RGB (<code class="constant">V4L2_COLORSPACE_ADOBERGB</code>)</a></span></dt><dt><span class="section"><a href="ch02s06.html#col-bt2020">Colorspace BT.2020 (<code class="constant">V4L2_COLORSPACE_BT2020</code>)</a></span></dt><dt><span class="section"><a href="ch02s06.html#col-dcip3">Colorspace DCI-P3 (<code class="constant">V4L2_COLORSPACE_DCI_P3</code>)</a></span></dt><dt><span class="section"><a href="ch02s06.html#col-smpte-240m">Colorspace SMPTE 240M (<code class="constant">V4L2_COLORSPACE_SMPTE240M</code>)</a></span></dt><dt><span class="section"><a href="ch02s06.html#col-sysm">Colorspace NTSC 1953 (<code class="constant">V4L2_COLORSPACE_470_SYSTEM_M</code>)</a></span></dt><dt><span class="section"><a href="ch02s06.html#col-sysbg">Colorspace EBU Tech. 3213 (<code class="constant">V4L2_COLORSPACE_470_SYSTEM_BG</code>)</a></span></dt><dt><span class="section"><a href="ch02s06.html#col-jpeg">Colorspace JPEG (<code class="constant">V4L2_COLORSPACE_JPEG</code>)</a></span></dt></dl></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="col-smpte-170m"></a>Colorspace SMPTE 170M (<code class="constant">V4L2_COLORSPACE_SMPTE170M</code>)</h3></div></div></div><p>The <a class="xref" href="bi01.html#smpte170m" title='SMPTE 170M-1999 "Television - Composite Analog Video Signal - NTSC for Studio Applications"'>[<abbr class="abbrev">SMPTE 170M</abbr>]</a> standard defines the colorspace used by NTSC and PAL and by SDTV 2in general. The default transfer function is <code class="constant">V4L2_XFER_FUNC_709</code>. 3The default Y'CbCr encoding is <code class="constant">V4L2_YCBCR_ENC_601</code>. 4The default Y'CbCr quantization is limited range. The chromaticities of the primary colors and 5the white reference are:</p><div class="table"><a name="id-1.4.5.8.2.3"></a><p class="title"><b>Table 2.8. SMPTE 170M Chromaticities</b></p><div class="table-contents"><table summary="SMPTE 170M Chromaticities" border="0"><colgroup><col align="left" class="c1"><col align="left" class="c2"><col align="left" class="c3"></colgroup><thead><tr><th align="left">Color</th><th align="left">x</th><th align="left">y</th></tr></thead><tbody valign="top"><tr><td align="left" valign="top">Red</td><td align="left" valign="top">0.630</td><td align="left" valign="top">0.340</td></tr><tr><td align="left" valign="top">Green</td><td align="left" valign="top">0.310</td><td align="left" valign="top">0.595</td></tr><tr><td align="left" valign="top">Blue</td><td align="left" valign="top">0.155</td><td align="left" valign="top">0.070</td></tr><tr><td align="left" valign="top">White Reference (D65)</td><td align="left" valign="top">0.3127</td><td align="left" valign="top">0.3290</td></tr></tbody></table></div></div><br class="table-break"><p>The red, green and blue chromaticities are also often referred to 6as the SMPTE C set, so this colorspace is sometimes called SMPTE C as well.</p><div class="variablelist"><dl class="variablelist"><dt><span class="term">The transfer function defined for SMPTE 170M is the same as the 7one defined in Rec. 709.</span></dt><dd><p>L' = -1.099(-L)<sup>0.45</sup> + 0.099 for L ≤ -0.018</p><p>L' = 4.5L for -0.018 < L < 0.018</p><p>L' = 1.099L<sup>0.45</sup> - 0.099 for L ≥ 0.018</p></dd></dl></div><div class="variablelist"><dl class="variablelist"><dt><span class="term">Inverse Transfer function:</span></dt><dd><p>L = -((L' - 0.099) / -1.099)<sup>1/0.45</sup> for L' ≤ -0.081</p><p>L = L' / 4.5 for -0.081 < L' < 0.081</p><p>L = ((L' + 0.099) / 1.099)<sup>1/0.45</sup> for L' ≥ 0.081</p></dd></dl></div><div class="variablelist"><dl class="variablelist"><dt><span class="term">The luminance (Y') and color difference (Cb and Cr) are obtained with 8the following <code class="constant">V4L2_YCBCR_ENC_601</code> encoding:</span></dt><dd><p>Y' = 0.299R' + 0.587G' + 0.114B'</p><p>Cb = -0.169R' - 0.331G' + 0.5B'</p><p>Cr = 0.5R' - 0.419G' - 0.081B'</p></dd></dl></div><p>Y' is clamped to the range [0…1] and Cb and Cr are 9clamped to the range [-0.5…0.5]. This conversion to Y'CbCr is identical to the one 10defined in the <a class="xref" href="bi01.html#itu601" title='ITU-R Recommendation BT.601-5 "Studio Encoding Parameters of Digital Television for Standard 4:3 and Wide-Screen 16:9 Aspect Ratios"'>[<abbr class="abbrev">ITU BT.601</abbr>]</a> standard and this colorspace is sometimes called BT.601 as well, even 11though BT.601 does not mention any color primaries.</p><p>The default quantization is limited range, but full range is possible although 12rarely seen.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="col-rec709"></a>Colorspace Rec. 709 (<code class="constant">V4L2_COLORSPACE_REC709</code>)</h3></div></div></div><p>The <a class="xref" href="bi01.html#itu709" title='ITU-R Recommendation BT.709-5 "Parameter values for the HDTV standards for production and international programme exchange"'>[<abbr class="abbrev">ITU BT.709</abbr>]</a> standard defines the colorspace used by HDTV in general. 13The default transfer function is <code class="constant">V4L2_XFER_FUNC_709</code>. The default 14Y'CbCr encoding is <code class="constant">V4L2_YCBCR_ENC_709</code>. The default Y'CbCr quantization is 15limited range. The chromaticities of the primary colors and the white reference are:</p><div class="table"><a name="id-1.4.5.8.3.3"></a><p class="title"><b>Table 2.9. Rec. 709 Chromaticities</b></p><div class="table-contents"><table summary="Rec. 709 Chromaticities" border="0"><colgroup><col align="left" class="c1"><col align="left" class="c2"><col align="left" class="c3"></colgroup><thead><tr><th align="left">Color</th><th align="left">x</th><th align="left">y</th></tr></thead><tbody valign="top"><tr><td align="left" valign="top">Red</td><td align="left" valign="top">0.640</td><td align="left" valign="top">0.330</td></tr><tr><td align="left" valign="top">Green</td><td align="left" valign="top">0.300</td><td align="left" valign="top">0.600</td></tr><tr><td align="left" valign="top">Blue</td><td align="left" valign="top">0.150</td><td align="left" valign="top">0.060</td></tr><tr><td align="left" valign="top">White Reference (D65)</td><td align="left" valign="top">0.3127</td><td align="left" valign="top">0.3290</td></tr></tbody></table></div></div><br class="table-break"><p>The full name of this standard is Rec. ITU-R BT.709-5.</p><div class="variablelist"><dl class="variablelist"><dt><span class="term">Transfer function. Normally L is in the range [0…1], but for the extended 16gamut xvYCC encoding values outside that range are allowed.</span></dt><dd><p>L' = -1.099(-L)<sup>0.45</sup> + 0.099 for L ≤ -0.018</p><p>L' = 4.5L for -0.018 < L < 0.018</p><p>L' = 1.099L<sup>0.45</sup> - 0.099 for L ≥ 0.018</p></dd></dl></div><div class="variablelist"><dl class="variablelist"><dt><span class="term">Inverse Transfer function:</span></dt><dd><p>L = -((L' - 0.099) / -1.099)<sup>1/0.45</sup> for L' ≤ -0.081</p><p>L = L' / 4.5 for -0.081 < L' < 0.081</p><p>L = ((L' + 0.099) / 1.099)<sup>1/0.45</sup> for L' ≥ 0.081</p></dd></dl></div><div class="variablelist"><dl class="variablelist"><dt><span class="term">The luminance (Y') and color difference (Cb and Cr) are obtained with the following 17<code class="constant">V4L2_YCBCR_ENC_709</code> encoding:</span></dt><dd><p>Y' = 0.2126R' + 0.7152G' + 0.0722B'</p><p>Cb = -0.1146R' - 0.3854G' + 0.5B'</p><p>Cr = 0.5R' - 0.4542G' - 0.0458B'</p></dd></dl></div><p>Y' is clamped to the range [0…1] and Cb and Cr are 18clamped to the range [-0.5…0.5].</p><p>The default quantization is limited range, but full range is possible although 19rarely seen.</p><p>The <code class="constant">V4L2_YCBCR_ENC_709</code> encoding described above is the default 20for this colorspace, but it can be overridden with <code class="constant">V4L2_YCBCR_ENC_601</code>, in which 21case the BT.601 Y'CbCr encoding is used.</p><p>Two additional extended gamut Y'CbCr encodings are also possible with this colorspace:</p><div class="variablelist"><dl class="variablelist"><dt><span class="term">The xvYCC 709 encoding (<code class="constant">V4L2_YCBCR_ENC_XV709</code>, <a class="xref" href="bi01.html#xvycc" title='IEC 61966-2-4 ed1.0 "Multimedia systems and equipment - Colour measurement and management - Part 2-4: Colour management - Extended-gamut YCC colour space for video applications - xvYCC"'>[<abbr class="abbrev">xvYCC</abbr>]</a>) 22is similar to the Rec. 709 encoding, but it allows for R', G' and B' values that are outside the range 23[0…1]. The resulting Y', Cb and Cr values are scaled and offset:</span></dt><dd><p>Y' = (219 / 256) * (0.2126R' + 0.7152G' + 0.0722B') + (16 / 256)</p><p>Cb = (224 / 256) * (-0.1146R' - 0.3854G' + 0.5B')</p><p>Cr = (224 / 256) * (0.5R' - 0.4542G' - 0.0458B')</p></dd></dl></div><div class="variablelist"><dl class="variablelist"><dt><span class="term">The xvYCC 601 encoding (<code class="constant">V4L2_YCBCR_ENC_XV601</code>, <a class="xref" href="bi01.html#xvycc" title='IEC 61966-2-4 ed1.0 "Multimedia systems and equipment - Colour measurement and management - Part 2-4: Colour management - Extended-gamut YCC colour space for video applications - xvYCC"'>[<abbr class="abbrev">xvYCC</abbr>]</a>) is similar 24to the BT.601 encoding, but it allows for R', G' and B' values that are outside the range 25[0…1]. The resulting Y', Cb and Cr values are scaled and offset:</span></dt><dd><p>Y' = (219 / 256) * (0.299R' + 0.587G' + 0.114B') + (16 / 256)</p><p>Cb = (224 / 256) * (-0.169R' - 0.331G' + 0.5B')</p><p>Cr = (224 / 256) * (0.5R' - 0.419G' - 0.081B')</p></dd></dl></div><p>Y' is clamped to the range [0…1] and Cb and Cr are clamped 26to the range [-0.5…0.5]. The non-standard xvYCC 709 or xvYCC 601 encodings can be used by 27selecting <code class="constant">V4L2_YCBCR_ENC_XV709</code> or <code class="constant">V4L2_YCBCR_ENC_XV601</code>. 28The xvYCC encodings always use full range quantization.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="col-srgb"></a>Colorspace sRGB (<code class="constant">V4L2_COLORSPACE_SRGB</code>)</h3></div></div></div><p>The <a class="xref" href="bi01.html#srgb" title='IEC 61966-2-1 ed1.0 "Multimedia systems and equipment - Colour measurement and management - Part 2-1: Colour management - Default RGB colour space - sRGB"'>[<abbr class="abbrev">sRGB</abbr>]</a> standard defines the colorspace used by most webcams 29and computer graphics. The default transfer function is <code class="constant">V4L2_XFER_FUNC_SRGB</code>. 30The default Y'CbCr encoding is <code class="constant">V4L2_YCBCR_ENC_SYCC</code>. The default Y'CbCr 31quantization is full range. The chromaticities of the primary colors and the white 32reference are:</p><div class="table"><a name="id-1.4.5.8.4.3"></a><p class="title"><b>Table 2.10. sRGB Chromaticities</b></p><div class="table-contents"><table summary="sRGB Chromaticities" border="0"><colgroup><col align="left" class="c1"><col align="left" class="c2"><col align="left" class="c3"></colgroup><thead><tr><th align="left">Color</th><th align="left">x</th><th align="left">y</th></tr></thead><tbody valign="top"><tr><td align="left" valign="top">Red</td><td align="left" valign="top">0.640</td><td align="left" valign="top">0.330</td></tr><tr><td align="left" valign="top">Green</td><td align="left" valign="top">0.300</td><td align="left" valign="top">0.600</td></tr><tr><td align="left" valign="top">Blue</td><td align="left" valign="top">0.150</td><td align="left" valign="top">0.060</td></tr><tr><td align="left" valign="top">White Reference (D65)</td><td align="left" valign="top">0.3127</td><td align="left" valign="top">0.3290</td></tr></tbody></table></div></div><br class="table-break"><p>These chromaticities are identical to the Rec. 709 colorspace.</p><div class="variablelist"><dl class="variablelist"><dt><span class="term">Transfer function. Note that negative values for L are only used by the Y'CbCr conversion.</span></dt><dd><p>L' = -1.055(-L)<sup>1/2.4</sup> + 0.055 for L < -0.0031308</p><p>L' = 12.92L for -0.0031308 ≤ L ≤ 0.0031308</p><p>L' = 1.055L<sup>1/2.4</sup> - 0.055 for 0.0031308 < L ≤ 1</p></dd><dt><span class="term">Inverse Transfer function:</span></dt><dd><p>L = -((-L' + 0.055) / 1.055)<sup>2.4</sup> for L' < -0.04045</p><p>L = L' / 12.92 for -0.04045 ≤ L' ≤ 0.04045</p><p>L = ((L' + 0.055) / 1.055)<sup>2.4</sup> for L' > 0.04045</p></dd></dl></div><div class="variablelist"><dl class="variablelist"><dt><span class="term">The luminance (Y') and color difference (Cb and Cr) are obtained with the following 33<code class="constant">V4L2_YCBCR_ENC_SYCC</code> encoding as defined by <a class="xref" href="bi01.html#sycc" title='IEC 61966-2-1-am1 ed1.0 "Amendment 1 - Multimedia systems and equipment - Colour measurement and management - Part 2-1: Colour management - Default RGB colour space - sRGB"'>[<abbr class="abbrev">sYCC</abbr>]</a>:</span></dt><dd><p>Y' = 0.2990R' + 0.5870G' + 0.1140B'</p><p>Cb = -0.1687R' - 0.3313G' + 0.5B'</p><p>Cr = 0.5R' - 0.4187G' - 0.0813B'</p></dd></dl></div><p>Y' is clamped to the range [0…1] and Cb and Cr are clamped 34to the range [-0.5…0.5]. The <code class="constant">V4L2_YCBCR_ENC_SYCC</code> quantization is always 35full range. Although this Y'CbCr encoding looks very similar to the <code class="constant">V4L2_YCBCR_ENC_XV601</code> 36encoding, it is not. The <code class="constant">V4L2_YCBCR_ENC_XV601</code> scales and offsets the Y'CbCr 37values before quantization, but this encoding does not do that.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="col-adobergb"></a>Colorspace Adobe RGB (<code class="constant">V4L2_COLORSPACE_ADOBERGB</code>)</h3></div></div></div><p>The <a class="xref" href="bi01.html#adobergb" title="Adobe© RGB (1998) Color Image Encoding Version 2005-05">[<abbr class="abbrev">AdobeRGB</abbr>]</a> standard defines the colorspace used by computer graphics 38that use the AdobeRGB colorspace. This is also known as the <a class="xref" href="bi01.html#oprgb" title='IEC 61966-2-5 "Multimedia systems and equipment - Colour measurement and management - Part 2-5: Colour management - Optional RGB colour space - opRGB"'>[<abbr class="abbrev">opRGB</abbr>]</a> standard. 39The default transfer function is <code class="constant">V4L2_XFER_FUNC_ADOBERGB</code>. 40The default Y'CbCr encoding is <code class="constant">V4L2_YCBCR_ENC_601</code>. The default Y'CbCr 41quantization is limited range. The chromaticities of the primary colors and the white reference 42are:</p><div class="table"><a name="id-1.4.5.8.5.3"></a><p class="title"><b>Table 2.11. Adobe RGB Chromaticities</b></p><div class="table-contents"><table summary="Adobe RGB Chromaticities" border="0"><colgroup><col align="left" class="c1"><col align="left" class="c2"><col align="left" class="c3"></colgroup><thead><tr><th align="left">Color</th><th align="left">x</th><th align="left">y</th></tr></thead><tbody valign="top"><tr><td align="left" valign="top">Red</td><td align="left" valign="top">0.6400</td><td align="left" valign="top">0.3300</td></tr><tr><td align="left" valign="top">Green</td><td align="left" valign="top">0.2100</td><td align="left" valign="top">0.7100</td></tr><tr><td align="left" valign="top">Blue</td><td align="left" valign="top">0.1500</td><td align="left" valign="top">0.0600</td></tr><tr><td align="left" valign="top">White Reference (D65)</td><td align="left" valign="top">0.3127</td><td align="left" valign="top">0.3290</td></tr></tbody></table></div></div><br class="table-break"><div class="variablelist"><dl class="variablelist"><dt><span class="term">Transfer function:</span></dt><dd><p>L' = L<sup>1/2.19921875</sup></p></dd><dt><span class="term">Inverse Transfer function:</span></dt><dd><p>L = L'<sup>2.19921875</sup></p></dd></dl></div><div class="variablelist"><dl class="variablelist"><dt><span class="term">The luminance (Y') and color difference (Cb and Cr) are obtained with the 43following <code class="constant">V4L2_YCBCR_ENC_601</code> encoding:</span></dt><dd><p>Y' = 0.299R' + 0.587G' + 0.114B'</p><p>Cb = -0.169R' - 0.331G' + 0.5B'</p><p>Cr = 0.5R' - 0.419G' - 0.081B'</p></dd></dl></div><p>Y' is clamped to the range [0…1] and Cb and Cr are 44clamped to the range [-0.5…0.5]. This transform is identical to one defined in 45SMPTE 170M/BT.601. The Y'CbCr quantization is limited range.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="col-bt2020"></a>Colorspace BT.2020 (<code class="constant">V4L2_COLORSPACE_BT2020</code>)</h3></div></div></div><p>The <a class="xref" href="bi01.html#itu2020" title='ITU-R Recommendation BT.2020 (08/2012) "Parameter values for ultra-high definition television systems for production and international programme exchange"'>[<abbr class="abbrev">ITU BT.2020</abbr>]</a> standard defines the colorspace used by Ultra-high definition 46television (UHDTV). The default transfer function is <code class="constant">V4L2_XFER_FUNC_709</code>. 47The default Y'CbCr encoding is <code class="constant">V4L2_YCBCR_ENC_BT2020</code>. 48The default R'G'B' quantization is limited range (!), and so is the default Y'CbCr quantization. 49The chromaticities of the primary colors and the white reference are:</p><div class="table"><a name="id-1.4.5.8.6.3"></a><p class="title"><b>Table 2.12. BT.2020 Chromaticities</b></p><div class="table-contents"><table summary="BT.2020 Chromaticities" border="0"><colgroup><col align="left" class="c1"><col align="left" class="c2"><col align="left" class="c3"></colgroup><thead><tr><th align="left">Color</th><th align="left">x</th><th align="left">y</th></tr></thead><tbody valign="top"><tr><td align="left" valign="top">Red</td><td align="left" valign="top">0.708</td><td align="left" valign="top">0.292</td></tr><tr><td align="left" valign="top">Green</td><td align="left" valign="top">0.170</td><td align="left" valign="top">0.797</td></tr><tr><td align="left" valign="top">Blue</td><td align="left" valign="top">0.131</td><td align="left" valign="top">0.046</td></tr><tr><td align="left" valign="top">White Reference (D65)</td><td align="left" valign="top">0.3127</td><td align="left" valign="top">0.3290</td></tr></tbody></table></div></div><br class="table-break"><div class="variablelist"><dl class="variablelist"><dt><span class="term">Transfer function (same as Rec. 709):</span></dt><dd><p>L' = 4.5L for 0 ≤ L < 0.018</p><p>L' = 1.099L<sup>0.45</sup> - 0.099 for 0.018 ≤ L ≤ 1</p></dd><dt><span class="term">Inverse Transfer function:</span></dt><dd><p>L = L' / 4.5 for L' < 0.081</p><p>L = ((L' + 0.099) / 1.099)<sup>1/0.45</sup> for L' ≥ 0.081</p></dd></dl></div><div class="variablelist"><dl class="variablelist"><dt><span class="term">The luminance (Y') and color difference (Cb and Cr) are obtained with the 50following <code class="constant">V4L2_YCBCR_ENC_BT2020</code> encoding:</span></dt><dd><p>Y' = 0.2627R' + 0.6780G' + 0.0593B'</p><p>Cb = -0.1396R' - 0.3604G' + 0.5B'</p><p>Cr = 0.5R' - 0.4598G' - 0.0402B'</p></dd></dl></div><p>Y' is clamped to the range [0…1] and Cb and Cr are 51clamped to the range [-0.5…0.5]. The Y'CbCr quantization is limited range.</p><p>There is also an alternate constant luminance R'G'B' to Yc'CbcCrc 52(<code class="constant">V4L2_YCBCR_ENC_BT2020_CONST_LUM</code>) encoding:</p><div class="variablelist"><dl class="variablelist"><dt><span class="term">Luma:</span></dt><dd><p>Yc' = (0.2627R + 0.6780G + 0.0593B)'</p></dd></dl></div><div class="variablelist"><dl class="variablelist"><dt><span class="term">B' - Yc' ≤ 0:</span></dt><dd><p>Cbc = (B' - Yc') / 1.9404</p></dd></dl></div><div class="variablelist"><dl class="variablelist"><dt><span class="term">B' - Yc' > 0:</span></dt><dd><p>Cbc = (B' - Yc') / 1.5816</p></dd></dl></div><div class="variablelist"><dl class="variablelist"><dt><span class="term">R' - Yc' ≤ 0:</span></dt><dd><p>Crc = (R' - Y') / 1.7184</p></dd></dl></div><div class="variablelist"><dl class="variablelist"><dt><span class="term">R' - Yc' > 0:</span></dt><dd><p>Crc = (R' - Y') / 0.9936</p></dd></dl></div><p>Yc' is clamped to the range [0…1] and Cbc and Crc are 53clamped to the range [-0.5…0.5]. The Yc'CbcCrc quantization is limited range.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="col-dcip3"></a>Colorspace DCI-P3 (<code class="constant">V4L2_COLORSPACE_DCI_P3</code>)</h3></div></div></div><p>The <a class="xref" href="bi01.html#smpte431" title='SMPTE RP 431-2:2011 "D-Cinema Quality - Reference Projector and Environment"'>[<abbr class="abbrev">SMPTE RP 431-2</abbr>]</a> standard defines the colorspace used by cinema 54projectors that use the DCI-P3 colorspace. 55The default transfer function is <code class="constant">V4L2_XFER_FUNC_DCI_P3</code>. 56The default Y'CbCr encoding is <code class="constant">V4L2_YCBCR_ENC_709</code>. Note that this 57colorspace does not specify a Y'CbCr encoding since it is not meant to be encoded 58to Y'CbCr. So this default Y'CbCr encoding was picked because it is the HDTV 59encoding. The default Y'CbCr quantization is limited range. The chromaticities of 60the primary colors and the white reference are:</p><div class="table"><a name="id-1.4.5.8.7.3"></a><p class="title"><b>Table 2.13. DCI-P3 Chromaticities</b></p><div class="table-contents"><table summary="DCI-P3 Chromaticities" border="0"><colgroup><col align="left" class="c1"><col align="left" class="c2"><col align="left" class="c3"></colgroup><thead><tr><th align="left">Color</th><th align="left">x</th><th align="left">y</th></tr></thead><tbody valign="top"><tr><td align="left" valign="top">Red</td><td align="left" valign="top">0.6800</td><td align="left" valign="top">0.3200</td></tr><tr><td align="left" valign="top">Green</td><td align="left" valign="top">0.2650</td><td align="left" valign="top">0.6900</td></tr><tr><td align="left" valign="top">Blue</td><td align="left" valign="top">0.1500</td><td align="left" valign="top">0.0600</td></tr><tr><td align="left" valign="top">White Reference</td><td align="left" valign="top">0.3140</td><td align="left" valign="top">0.3510</td></tr></tbody></table></div></div><br class="table-break"><div class="variablelist"><dl class="variablelist"><dt><span class="term">Transfer function:</span></dt><dd><p>L' = L<sup>1/2.6</sup></p></dd><dt><span class="term">Inverse Transfer function:</span></dt><dd><p>L = L'<sup>2.6</sup></p></dd></dl></div><p>Y'CbCr encoding is not specified. V4L2 defaults to Rec. 709.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="col-smpte-240m"></a>Colorspace SMPTE 240M (<code class="constant">V4L2_COLORSPACE_SMPTE240M</code>)</h3></div></div></div><p>The <a class="xref" href="bi01.html#smpte240m" title='SMPTE 240M-1999 "Television - Signal Parameters - 1125-Line High-Definition Production"'>[<abbr class="abbrev">SMPTE 240M</abbr>]</a> standard was an interim standard used during 61the early days of HDTV (1988-1998). It has been superseded by Rec. 709. 62The default transfer function is <code class="constant">V4L2_XFER_FUNC_SMPTE240M</code>. 63The default Y'CbCr encoding is <code class="constant">V4L2_YCBCR_ENC_SMPTE240M</code>. 64The default Y'CbCr quantization is limited range. The chromaticities of the primary colors and the 65white reference are:</p><div class="table"><a name="id-1.4.5.8.8.3"></a><p class="title"><b>Table 2.14. SMPTE 240M Chromaticities</b></p><div class="table-contents"><table summary="SMPTE 240M Chromaticities" border="0"><colgroup><col align="left" class="c1"><col align="left" class="c2"><col align="left" class="c3"></colgroup><thead><tr><th align="left">Color</th><th align="left">x</th><th align="left">y</th></tr></thead><tbody valign="top"><tr><td align="left" valign="top">Red</td><td align="left" valign="top">0.630</td><td align="left" valign="top">0.340</td></tr><tr><td align="left" valign="top">Green</td><td align="left" valign="top">0.310</td><td align="left" valign="top">0.595</td></tr><tr><td align="left" valign="top">Blue</td><td align="left" valign="top">0.155</td><td align="left" valign="top">0.070</td></tr><tr><td align="left" valign="top">White Reference (D65)</td><td align="left" valign="top">0.3127</td><td align="left" valign="top">0.3290</td></tr></tbody></table></div></div><br class="table-break"><p>These chromaticities are identical to the SMPTE 170M colorspace.</p><div class="variablelist"><dl class="variablelist"><dt><span class="term">Transfer function:</span></dt><dd><p>L' = 4L for 0 ≤ L < 0.0228</p><p>L' = 1.1115L<sup>0.45</sup> - 0.1115 for 0.0228 ≤ L ≤ 1</p></dd><dt><span class="term">Inverse Transfer function:</span></dt><dd><p>L = L' / 4 for 0 ≤ L' < 0.0913</p><p>L = ((L' + 0.1115) / 1.1115)<sup>1/0.45</sup> for L' ≥ 0.0913</p></dd></dl></div><div class="variablelist"><dl class="variablelist"><dt><span class="term">The luminance (Y') and color difference (Cb and Cr) are obtained with the 66following <code class="constant">V4L2_YCBCR_ENC_SMPTE240M</code> encoding:</span></dt><dd><p>Y' = 0.2122R' + 0.7013G' + 0.0865B'</p><p>Cb = -0.1161R' - 0.3839G' + 0.5B'</p><p>Cr = 0.5R' - 0.4451G' - 0.0549B'</p></dd></dl></div><p>Yc' is clamped to the range [0…1] and Cbc and Crc are 67clamped to the range [-0.5…0.5]. The Y'CbCr quantization is limited range.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="col-sysm"></a>Colorspace NTSC 1953 (<code class="constant">V4L2_COLORSPACE_470_SYSTEM_M</code>)</h3></div></div></div><p>This standard defines the colorspace used by NTSC in 1953. In practice this 68colorspace is obsolete and SMPTE 170M should be used instead. 69The default transfer function is <code class="constant">V4L2_XFER_FUNC_709</code>. 70The default Y'CbCr encoding is <code class="constant">V4L2_YCBCR_ENC_601</code>. 71The default Y'CbCr quantization is limited range. 72The chromaticities of the primary colors and the white reference are:</p><div class="table"><a name="id-1.4.5.8.9.3"></a><p class="title"><b>Table 2.15. NTSC 1953 Chromaticities</b></p><div class="table-contents"><table summary="NTSC 1953 Chromaticities" border="0"><colgroup><col align="left" class="c1"><col align="left" class="c2"><col align="left" class="c3"></colgroup><thead><tr><th align="left">Color</th><th align="left">x</th><th align="left">y</th></tr></thead><tbody valign="top"><tr><td align="left" valign="top">Red</td><td align="left" valign="top">0.67</td><td align="left" valign="top">0.33</td></tr><tr><td align="left" valign="top">Green</td><td align="left" valign="top">0.21</td><td align="left" valign="top">0.71</td></tr><tr><td align="left" valign="top">Blue</td><td align="left" valign="top">0.14</td><td align="left" valign="top">0.08</td></tr><tr><td align="left" valign="top">White Reference (C)</td><td align="left" valign="top">0.310</td><td align="left" valign="top">0.316</td></tr></tbody></table></div></div><br class="table-break"><p>Note that this colorspace uses Illuminant C instead of D65 as the 73white reference. To correctly convert an image in this colorspace to another 74that uses D65 you need to apply a chromatic adaptation algorithm such as the 75Bradford method.</p><div class="variablelist"><dl class="variablelist"><dt><span class="term">The transfer function was never properly defined for NTSC 1953. The 76Rec. 709 transfer function is recommended in the literature:</span></dt><dd><p>L' = 4.5L for 0 ≤ L < 0.018</p><p>L' = 1.099L<sup>0.45</sup> - 0.099 for 0.018 ≤ L ≤ 1</p></dd><dt><span class="term">Inverse Transfer function:</span></dt><dd><p>L = L' / 4.5 for L' < 0.081</p><p>L = ((L' + 0.099) / 1.099)<sup>1/0.45</sup> for L' ≥ 0.081</p></dd></dl></div><div class="variablelist"><dl class="variablelist"><dt><span class="term">The luminance (Y') and color difference (Cb and Cr) are obtained with the 77following <code class="constant">V4L2_YCBCR_ENC_601</code> encoding:</span></dt><dd><p>Y' = 0.299R' + 0.587G' + 0.114B'</p><p>Cb = -0.169R' - 0.331G' + 0.5B'</p><p>Cr = 0.5R' - 0.419G' - 0.081B'</p></dd></dl></div><p>Y' is clamped to the range [0…1] and Cb and Cr are 78clamped to the range [-0.5…0.5]. The Y'CbCr quantization is limited range. 79This transform is identical to one defined in SMPTE 170M/BT.601.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="col-sysbg"></a>Colorspace EBU Tech. 3213 (<code class="constant">V4L2_COLORSPACE_470_SYSTEM_BG</code>)</h3></div></div></div><p>The <a class="xref" href="bi01.html#tech3213" title='E.B.U. Standard for Chromaticity Tolerances for Studio Monitors"'>[<abbr class="abbrev">EBU Tech 3213</abbr>]</a> standard defines the colorspace used by PAL/SECAM in 1975. In practice this 80colorspace is obsolete and SMPTE 170M should be used instead. 81The default transfer function is <code class="constant">V4L2_XFER_FUNC_709</code>. 82The default Y'CbCr encoding is <code class="constant">V4L2_YCBCR_ENC_601</code>. 83The default Y'CbCr quantization is limited range. 84The chromaticities of the primary colors and the white reference are:</p><div class="table"><a name="id-1.4.5.8.10.3"></a><p class="title"><b>Table 2.16. EBU Tech. 3213 Chromaticities</b></p><div class="table-contents"><table summary="EBU Tech. 3213 Chromaticities" border="0"><colgroup><col align="left" class="c1"><col align="left" class="c2"><col align="left" class="c3"></colgroup><thead><tr><th align="left">Color</th><th align="left">x</th><th align="left">y</th></tr></thead><tbody valign="top"><tr><td align="left" valign="top">Red</td><td align="left" valign="top">0.64</td><td align="left" valign="top">0.33</td></tr><tr><td align="left" valign="top">Green</td><td align="left" valign="top">0.29</td><td align="left" valign="top">0.60</td></tr><tr><td align="left" valign="top">Blue</td><td align="left" valign="top">0.15</td><td align="left" valign="top">0.06</td></tr><tr><td align="left" valign="top">White Reference (D65)</td><td align="left" valign="top">0.3127</td><td align="left" valign="top">0.3290</td></tr></tbody></table></div></div><br class="table-break"><div class="variablelist"><dl class="variablelist"><dt><span class="term">The transfer function was never properly defined for this colorspace. 85The Rec. 709 transfer function is recommended in the literature:</span></dt><dd><p>L' = 4.5L for 0 ≤ L < 0.018</p><p>L' = 1.099L<sup>0.45</sup> - 0.099 for 0.018 ≤ L ≤ 1</p></dd><dt><span class="term">Inverse Transfer function:</span></dt><dd><p>L = L' / 4.5 for L' < 0.081</p><p>L = ((L' + 0.099) / 1.099)<sup>1/0.45</sup> for L' ≥ 0.081</p></dd></dl></div><div class="variablelist"><dl class="variablelist"><dt><span class="term">The luminance (Y') and color difference (Cb and Cr) are obtained with the 86following <code class="constant">V4L2_YCBCR_ENC_601</code> encoding:</span></dt><dd><p>Y' = 0.299R' + 0.587G' + 0.114B'</p><p>Cb = -0.169R' - 0.331G' + 0.5B'</p><p>Cr = 0.5R' - 0.419G' - 0.081B'</p></dd></dl></div><p>Y' is clamped to the range [0…1] and Cb and Cr are 87clamped to the range [-0.5…0.5]. The Y'CbCr quantization is limited range. 88This transform is identical to one defined in SMPTE 170M/BT.601.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="col-jpeg"></a>Colorspace JPEG (<code class="constant">V4L2_COLORSPACE_JPEG</code>)</h3></div></div></div><p>This colorspace defines the colorspace used by most (Motion-)JPEG formats. The chromaticities 89of the primary colors and the white reference are identical to sRGB. The transfer 90function use is <code class="constant">V4L2_XFER_FUNC_SRGB</code>. The Y'CbCr encoding is 91<code class="constant">V4L2_YCBCR_ENC_601</code> with full range quantization where 92Y' is scaled to [0…255] and Cb/Cr are scaled to [-128…128] and 93then clipped to [-128…127].</p><p>Note that the JPEG standard does not actually store colorspace information. 94So if something other than sRGB is used, then the driver will have to set that information 95explicitly. Effectively <code class="constant">V4L2_COLORSPACE_JPEG</code> can be considered to be 96an abbreviation for <code class="constant">V4L2_COLORSPACE_SRGB</code>, <code class="constant">V4L2_YCBCR_ENC_601</code> 97and <code class="constant">V4L2_QUANTIZATION_FULL_RANGE</code>.</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch02s05.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="pixfmt.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch02s07.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Defining Colorspaces in V4L2 </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Detailed Transfer Function Descriptions</td></tr></table></div></body></html> 98