1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><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="pixfmt-indexed.html" title="Indexed Format"></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="pixfmt-indexed.html">Next</a></td></tr></table><hr></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="idp1100511100"></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-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 Y'CbCr encoding is <code class="constant">V4L2_YCBCR_ENC_601</code>. 3The default Y'CbCr quantization is limited range. The chromaticities of the primary colors and 4the white reference are:</p><div class="table"><a name="idp1100513292"></a><p class="title"><b>Table 2.7. 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 5as 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 6one 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 7the 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 8clamped to the range [-0.5…0.5]. This conversion to Y'CbCr is identical to the one 9defined 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 10though BT.601 does not mention any color primaries.</p><p>The default quantization is limited range, but full range is possible although 11rarely 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. The default 12Y'CbCr encoding is <code class="constant">V4L2_YCBCR_ENC_709</code>. The default Y'CbCr quantization is 13limited range. The chromaticities of the primary colors and the white reference are:</p><div class="table"><a name="idp1100529900"></a><p class="title"><b>Table 2.8. 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 14gamut 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 15<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 16clamped to the range [-0.5…0.5].</p><p>The default quantization is limited range, but full range is possible although 17rarely seen.</p><p>The <code class="constant">V4L2_YCBCR_ENC_709</code> encoding described above is the default 18for this colorspace, but it can be overridden with <code class="constant">V4L2_YCBCR_ENC_601</code>, in which 19case 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>) 20is similar to the Rec. 709 encoding, but it allows for R', G' and B' values that are outside the range 21[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 22to the BT.601 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.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 24to the range [-0.5…0.5]. The non-standard xvYCC 709 or xvYCC 601 encodings can be used by 25selecting <code class="constant">V4L2_YCBCR_ENC_XV709</code> or <code class="constant">V4L2_YCBCR_ENC_XV601</code>. 26The 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 and computer graphics. The 27default Y'CbCr encoding is <code class="constant">V4L2_YCBCR_ENC_SYCC</code>. The default Y'CbCr quantization 28is full range. The chromaticities of the primary colors and the white reference are:</p><div class="table"><a name="idp1100552316"></a><p class="title"><b>Table 2.9. 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 29<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 30to the range [-0.5…0.5]. The <code class="constant">V4L2_YCBCR_ENC_SYCC</code> quantization is always 31full range. Although this Y'CbCr encoding looks very similar to the <code class="constant">V4L2_YCBCR_ENC_XV601</code> 32encoding, it is not. The <code class="constant">V4L2_YCBCR_ENC_XV601</code> scales and offsets the Y'CbCr 33values 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 34that 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. 35The default Y'CbCr encoding is <code class="constant">V4L2_YCBCR_ENC_601</code>. The default Y'CbCr 36quantization is limited range. The chromaticities of the primary colors and the white reference 37are:</p><div class="table"><a name="idp1100569212"></a><p class="title"><b>Table 2.10. 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 38following <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 39clamped to the range [-0.5…0.5]. This transform is identical to one defined in 40SMPTE 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 41television (UHDTV). The default Y'CbCr encoding is <code class="constant">V4L2_YCBCR_ENC_BT2020</code>. 42The default R'G'B' quantization is limited range (!), and so is the default Y'CbCr quantization. 43The chromaticities of the primary colors and the white reference are:</p><div class="table"><a name="idp1100582572"></a><p class="title"><b>Table 2.11. 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 44following <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 45clamped 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 46(<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 47clamped 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-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 the early days of HDTV (1988-1998). 48It has been superseded by Rec. 709. The default Y'CbCr encoding is <code class="constant">V4L2_YCBCR_ENC_SMPTE240M</code>. 49The default Y'CbCr quantization is limited range. The chromaticities of the primary colors and the 50white reference are:</p><div class="table"><a name="idp1100602580"></a><p class="title"><b>Table 2.12. 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 51following <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 52clamped 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 53colorspace is obsolete and SMPTE 170M should be used instead. The default Y'CbCr encoding 54is <code class="constant">V4L2_YCBCR_ENC_601</code>. The default Y'CbCr quantization is limited range. 55The chromaticities of the primary colors and the white reference are:</p><div class="table"><a name="idp1100616436"></a><p class="title"><b>Table 2.13. 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 56white reference. To correctly convert an image in this colorspace to another 57that uses D65 you need to apply a chromatic adaptation algorithm such as the 58Bradford method.</p><div class="variablelist"><dl class="variablelist"><dt><span class="term">The transfer function was never properly defined for NTSC 1953. The 59Rec. 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 60following <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 61clamped to the range [-0.5…0.5]. The Y'CbCr quantization is limited range. 62This 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 63colorspace is obsolete and SMPTE 170M should be used instead. The default Y'CbCr encoding 64is <code class="constant">V4L2_YCBCR_ENC_601</code>. The default Y'CbCr quantization is limited range. 65The chromaticities of the primary colors and the white reference are:</p><div class="table"><a name="idp1100631012"></a><p class="title"><b>Table 2.14. 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. 66The 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 67following <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 68clamped to the range [-0.5…0.5]. The Y'CbCr quantization is limited range. 69This 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 70of the primary colors and the white reference are identical to sRGB. The Y'CbCr encoding is 71<code class="constant">V4L2_YCBCR_ENC_601</code> with full range quantization where 72Y' is scaled to [0…255] and Cb/Cr are scaled to [-128…128] and 73then clipped to [-128…127].</p><p>Note that the JPEG standard does not actually store colorspace information. 74So if something other than sRGB is used, then the driver will have to set that information 75explicitly. Effectively <code class="constant">V4L2_COLORSPACE_JPEG</code> can be considered to be 76an abbreviation for <code class="constant">V4L2_COLORSPACE_SRGB</code>, <code class="constant">V4L2_YCBCR_ENC_601</code> 77and <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="pixfmt-indexed.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"> Indexed Format</td></tr></table></div></body></html> 78