Commit b7ff94df authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

[media] pixfmt-007.rst: use Sphinx math:: expressions

Enrich math formulas by using the Sphinx math. That will allow
using those formulas on pdf documents as well.
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent 43c78e11
...@@ -74,23 +74,29 @@ SMPTE C set, so this colorspace is sometimes called SMPTE C as well. ...@@ -74,23 +74,29 @@ SMPTE C set, so this colorspace is sometimes called SMPTE C as well.
The transfer function defined for SMPTE 170M is the same as the one The transfer function defined for SMPTE 170M is the same as the one
defined in Rec. 709. defined in Rec. 709.
L' = -1.099(-L) :sup:`0.45` + 0.099 for L ≤ -0.018 .. math::
L' = 4.5L for -0.018 < L < 0.018 L' = -1.099(-L)^{0.45} + 0.099 \text{, for } L \le-0.018
L' = 1.099L :sup:`0.45` - 0.099 for L ≥ 0.018 L' = 4.5L \text{, for } -0.018 < L < 0.018
L' = 1.099L^{0.45} - 0.099 \text{, for } L \ge 0.018
Inverse Transfer function: Inverse Transfer function:
L = -((L' - 0.099) / -1.099) :sup:`1/0.45` for L' ≤ -0.081 .. math::
L = -\left( \frac{L' - 0.099}{-1.099} \right) ^{\frac{1}{0.45}} \text{, for } L' \le -0.081
L = L' / 4.5 for -0.081 < L' < 0.081 L = \frac{L'}{4.5} \text{, for } -0.081 < L' < 0.081
L = ((L' + 0.099) / 1.099) :sup:`1/0.45` for L' ≥ 0.081 L = \left(\frac{L' + 0.099}{1.099}\right)^{\frac{1}{0.45} } \text{, for } L' \ge 0.081
The luminance (Y') and color difference (Cb and Cr) are obtained with The luminance (Y') and color difference (Cb and Cr) are obtained with
the following ``V4L2_YCBCR_ENC_601`` encoding: the following ``V4L2_YCBCR_ENC_601`` encoding:
.. math::
Y' = 0.299R' + 0.587G' + 0.114B' Y' = 0.299R' + 0.587G' + 0.114B'
Cb = -0.169R' - 0.331G' + 0.5B' Cb = -0.169R' - 0.331G' + 0.5B'
...@@ -173,23 +179,29 @@ The full name of this standard is Rec. ITU-R BT.709-5. ...@@ -173,23 +179,29 @@ The full name of this standard is Rec. ITU-R BT.709-5.
Transfer function. Normally L is in the range [0…1], but for the Transfer function. Normally L is in the range [0…1], but for the
extended gamut xvYCC encoding values outside that range are allowed. extended gamut xvYCC encoding values outside that range are allowed.
L' = -1.099(-L) :sup:`0.45` + 0.099 for L ≤ -0.018 .. math::
L' = 4.5L for -0.018 < L < 0.018 L' = -1.099(-L)^{0.45} + 0.099 \text{, for } L \le -0.018
L' = 1.099L :sup:`0.45` - 0.099 for L ≥ 0.018 L' = 4.5L \text{, for } -0.018 < L < 0.018
L' = 1.099L^{0.45} - 0.099 \text{, for } L \ge 0.018
Inverse Transfer function: Inverse Transfer function:
L = -((L' - 0.099) / -1.099) :sup:`1/0.45` for L' ≤ -0.081 .. math::
L = -\left( \frac{L' - 0.099}{-1.099} \right)^\frac{1}{0.45} \text{, for } L' \le -0.081
L = L' / 4.5 for -0.081 < L' < 0.081 L = \frac{L'}{4.5}\text{, for } -0.081 < L' < 0.081
L = ((L' + 0.099) / 1.099) :sup:`1/0.45` for L' ≥ 0.081 L = \left(\frac{L' + 0.099}{1.099}\right)^{\frac{1}{0.45} } \text{, for } L' \ge 0.081
The luminance (Y') and color difference (Cb and Cr) are obtained with The luminance (Y') and color difference (Cb and Cr) are obtained with
the following ``V4L2_YCBCR_ENC_709`` encoding: the following ``V4L2_YCBCR_ENC_709`` encoding:
.. math::
Y' = 0.2126R' + 0.7152G' + 0.0722B' Y' = 0.2126R' + 0.7152G' + 0.0722B'
Cb = -0.1146R' - 0.3854G' + 0.5B' Cb = -0.1146R' - 0.3854G' + 0.5B'
...@@ -214,22 +226,26 @@ similar to the Rec. 709 encoding, but it allows for R', G' and B' values ...@@ -214,22 +226,26 @@ similar to the Rec. 709 encoding, but it allows for R', G' and B' values
that are outside the range [0…1]. The resulting Y', Cb and Cr values are that are outside the range [0…1]. The resulting Y', Cb and Cr values are
scaled and offset: scaled and offset:
Y' = (219 / 256) * (0.2126R' + 0.7152G' + 0.0722B') + (16 / 256) .. math::
Y' = \frac{219}{256} * (0.2126R' + 0.7152G' + 0.0722B') + \frac{16}{256}
Cb = (224 / 256) * (-0.1146R' - 0.3854G' + 0.5B') Cb = \frac{224}{256} * (-0.1146R' - 0.3854G' + 0.5B')
Cr = (224 / 256) * (0.5R' - 0.4542G' - 0.0458B') Cr = \frac{224}{256} * (0.5R' - 0.4542G' - 0.0458B')
The xvYCC 601 encoding (``V4L2_YCBCR_ENC_XV601``, :ref:`xvycc`) is The xvYCC 601 encoding (``V4L2_YCBCR_ENC_XV601``, :ref:`xvycc`) is
similar to the BT.601 encoding, but it allows for R', G' and B' values similar to the BT.601 encoding, but it allows for R', G' and B' values
that are outside the range [0…1]. The resulting Y', Cb and Cr values are that are outside the range [0…1]. The resulting Y', Cb and Cr values are
scaled and offset: scaled and offset:
Y' = (219 / 256) * (0.299R' + 0.587G' + 0.114B') + (16 / 256) .. math::
Cb = (224 / 256) * (-0.169R' - 0.331G' + 0.5B') Y' = \frac{219}{256} * (0.299R' + 0.587G' + 0.114B') + \frac{16}{256}
Cr = (224 / 256) * (0.5R' - 0.419G' - 0.081B') Cb = \frac{224}{256} * (-0.169R' - 0.331G' + 0.5B')
Cr = \frac{224}{256} * (0.5R' - 0.419G' - 0.081B')
Y' is clamped to the range [0…1] and Cb and Cr are clamped to the range Y' is clamped to the range [0…1] and Cb and Cr are clamped to the range
[-0.5…0.5]. The non-standard xvYCC 709 or xvYCC 601 encodings can be [-0.5…0.5]. The non-standard xvYCC 709 or xvYCC 601 encodings can be
...@@ -304,24 +320,30 @@ These chromaticities are identical to the Rec. 709 colorspace. ...@@ -304,24 +320,30 @@ These chromaticities are identical to the Rec. 709 colorspace.
Transfer function. Note that negative values for L are only used by the Transfer function. Note that negative values for L are only used by the
Y'CbCr conversion. Y'CbCr conversion.
L' = -1.055(-L) :sup:`1/2.4` + 0.055 for L < -0.0031308 .. math::
L' = -1.055(-L)^{\frac{1}{2.4} } + 0.055\text{, for }L < -0.0031308
L' = 12.92L for -0.0031308 ≤ L ≤ 0.0031308 L' = 12.92L\text{, for }-0.0031308 \le L \le 0.0031308
L' = 1.055L :sup:`1/2.4` - 0.055 for 0.0031308 < L ≤ 1 L' = 1.055L ^{\frac{1}{2.4} } - 0.055\text{, for }0.0031308 < L \le 1
Inverse Transfer function: Inverse Transfer function:
L = -((-L' + 0.055) / 1.055) :sup:`2.4` for L' < -0.04045 .. math::
L = L' / 12.92 for -0.04045 ≤ L' ≤ 0.04045 L = -((-L' + 0.055) / 1.055) ^{2.4}\text{, for }L' < -0.04045
L = ((L' + 0.055) / 1.055) :sup:`2.4` for L' > 0.04045 L = L' / 12.92\text{, for }-0.04045 \le L' \le 0.04045
L = ((L' + 0.055) / 1.055) ^{2.4}\text{, for }L' > 0.04045
The luminance (Y') and color difference (Cb and Cr) are obtained with The luminance (Y') and color difference (Cb and Cr) are obtained with
the following ``V4L2_YCBCR_ENC_SYCC`` encoding as defined by the following ``V4L2_YCBCR_ENC_SYCC`` encoding as defined by
:ref:`sycc`: :ref:`sycc`:
.. math::
Y' = 0.2990R' + 0.5870G' + 0.1140B' Y' = 0.2990R' + 0.5870G' + 0.1140B'
Cb = -0.1687R' - 0.3313G' + 0.5B' Cb = -0.1687R' - 0.3313G' + 0.5B'
...@@ -403,15 +425,21 @@ are: ...@@ -403,15 +425,21 @@ are:
Transfer function: Transfer function:
L' = L :sup:`1/2.19921875` .. math::
L' = L ^{\frac{1}{2.19921875}}
Inverse Transfer function: Inverse Transfer function:
L = L' :sup:`2.19921875` .. math::
L = L'^{(2.19921875)}
The luminance (Y') and color difference (Cb and Cr) are obtained with The luminance (Y') and color difference (Cb and Cr) are obtained with
the following ``V4L2_YCBCR_ENC_601`` encoding: the following ``V4L2_YCBCR_ENC_601`` encoding:
.. math::
Y' = 0.299R' + 0.587G' + 0.114B' Y' = 0.299R' + 0.587G' + 0.114B'
Cb = -0.169R' - 0.331G' + 0.5B' Cb = -0.169R' - 0.331G' + 0.5B'
...@@ -489,19 +517,25 @@ of the primary colors and the white reference are: ...@@ -489,19 +517,25 @@ of the primary colors and the white reference are:
Transfer function (same as Rec. 709): Transfer function (same as Rec. 709):
L' = 4.5L for 0 ≤ L < 0.018 .. math::
L' = 1.099L :sup:`0.45` - 0.099 for 0.018 ≤ L ≤ 1 L' = 4.5L\text{, for }0 \le L < 0.018
L' = 1.099L ^{0.45} - 0.099\text{, for } 0.018 \le L \le 1
Inverse Transfer function: Inverse Transfer function:
L = L' / 4.5 for L' < 0.081 .. math::
L = L' / 4.5\text{, for } L' < 0.081
L = ((L' + 0.099) / 1.099) :sup:`1/0.45` for L' ≥ 0.081 L = \left( \frac{L' + 0.099}{1.099}\right) ^{\frac{1}{0.45} }\text{, for } L' \ge 0.081
The luminance (Y') and color difference (Cb and Cr) are obtained with The luminance (Y') and color difference (Cb and Cr) are obtained with
the following ``V4L2_YCBCR_ENC_BT2020`` encoding: the following ``V4L2_YCBCR_ENC_BT2020`` encoding:
.. math::
Y' = 0.2627R' + 0.6780G' + 0.0593B' Y' = 0.2627R' + 0.6780G' + 0.0593B'
Cb = -0.1396R' - 0.3604G' + 0.5B' Cb = -0.1396R' - 0.3604G' + 0.5B'
...@@ -516,23 +550,20 @@ There is also an alternate constant luminance R'G'B' to Yc'CbcCrc ...@@ -516,23 +550,20 @@ There is also an alternate constant luminance R'G'B' to Yc'CbcCrc
Luma: Luma:
Yc' = (0.2627R + 0.6780G + 0.0593B)' .. math::
:nowrap:
B' - Yc' ≤ 0:
\begin{align*}
Cbc = (B' - Yc') / 1.9404 Yc' = (0.2627R + 0.6780G + 0.0593B)'& \\
B' - Yc' \le 0:& \\
B' - Yc' > 0: &Cbc = (B' - Yc') / 1.9404 \\
B' - Yc' > 0: & \\
Cbc = (B' - Yc') / 1.5816 &Cbc = (B' - Yc') / 1.5816 \\
R' - Yc' \le 0:& \\
R' - Yc' ≤ 0: &Crc = (R' - Y') / 1.7184 \\
R' - Yc' > 0:& \\
Crc = (R' - Y') / 1.7184 &Crc = (R' - Y') / 0.9936
\end{align*}
R' - Yc' > 0:
Crc = (R' - Y') / 0.9936
Yc' is clamped to the range [0…1] and Cbc and Crc are clamped to the Yc' is clamped to the range [0…1] and Cbc and Crc are clamped to the
range [-0.5…0.5]. The Yc'CbcCrc quantization is limited range. range [-0.5…0.5]. The Yc'CbcCrc quantization is limited range.
...@@ -610,11 +641,15 @@ is ``V4L2_XFER_FUNC_DCI_P3``. The default Y'CbCr encoding is ...@@ -610,11 +641,15 @@ is ``V4L2_XFER_FUNC_DCI_P3``. The default Y'CbCr encoding is
Transfer function: Transfer function:
L' = L :sup:`1/2.6` .. math::
L' = L^{\frac{1}{2.6}}
Inverse Transfer function: Inverse Transfer function:
L = L' :sup:`2.6` .. math::
L = L'^{(2.6)}
Y'CbCr encoding is not specified. V4L2 defaults to Rec. 709. Y'CbCr encoding is not specified. V4L2 defaults to Rec. 709.
...@@ -686,19 +721,25 @@ These chromaticities are identical to the SMPTE 170M colorspace. ...@@ -686,19 +721,25 @@ These chromaticities are identical to the SMPTE 170M colorspace.
Transfer function: Transfer function:
L' = 4L for 0 ≤ L < 0.0228 .. math::
L' = 1.1115L :sup:`0.45` - 0.1115 for 0.0228 ≤ L ≤ 1 L' = 4L\text{, for } 0 \le L < 0.0228
L' = 1.1115L ^{0.45} - 0.1115\text{, for } 0.0228 \le L \le 1
Inverse Transfer function: Inverse Transfer function:
L = L' / 4 for 0 ≤ L' < 0.0913 .. math::
L = \frac{L'}{4}\text{, for } 0 \le L' < 0.0913
L = ((L' + 0.1115) / 1.1115) :sup:`1/0.45` for L' ≥ 0.0913 L = \left( \frac{L' + 0.1115}{1.1115}\right) ^{\frac{1}{0.45} }\text{, for } L' \ge 0.0913
The luminance (Y') and color difference (Cb and Cr) are obtained with The luminance (Y') and color difference (Cb and Cr) are obtained with
the following ``V4L2_YCBCR_ENC_SMPTE240M`` encoding: the following ``V4L2_YCBCR_ENC_SMPTE240M`` encoding:
.. math::
Y' = 0.2122R' + 0.7013G' + 0.0865B' Y' = 0.2122R' + 0.7013G' + 0.0865B'
Cb = -0.1161R' - 0.3839G' + 0.5B' Cb = -0.1161R' - 0.3839G' + 0.5B'
...@@ -782,19 +823,25 @@ reference are: ...@@ -782,19 +823,25 @@ reference are:
The transfer function was never properly defined for NTSC 1953. The Rec. The transfer function was never properly defined for NTSC 1953. The Rec.
709 transfer function is recommended in the literature: 709 transfer function is recommended in the literature:
L' = 4.5L for 0 ≤ L < 0.018 .. math::
L' = 1.099L :sup:`0.45` - 0.099 for 0.018 ≤ L ≤ 1 L' = 4.5L\text{, for } 0 \le L < 0.018
L' = 1.099L ^{0.45} - 0.099\text{, for } 0.018 \le L \le 1
Inverse Transfer function: Inverse Transfer function:
L = L' / 4.5 for L' < 0.081 .. math::
L = \frac{L'}{4.5} \text{, for } L' < 0.081
L = ((L' + 0.099) / 1.099) :sup:`1/0.45` for L' ≥ 0.081 L = \left( \frac{L' + 0.099}{1.099}\right) ^{\frac{1}{0.45} }\text{, for } L' \ge 0.081
The luminance (Y') and color difference (Cb and Cr) are obtained with The luminance (Y') and color difference (Cb and Cr) are obtained with
the following ``V4L2_YCBCR_ENC_601`` encoding: the following ``V4L2_YCBCR_ENC_601`` encoding:
.. math::
Y' = 0.299R' + 0.587G' + 0.114B' Y' = 0.299R' + 0.587G' + 0.114B'
Cb = -0.169R' - 0.331G' + 0.5B' Cb = -0.169R' - 0.331G' + 0.5B'
...@@ -874,19 +921,25 @@ are: ...@@ -874,19 +921,25 @@ are:
The transfer function was never properly defined for this colorspace. The transfer function was never properly defined for this colorspace.
The Rec. 709 transfer function is recommended in the literature: The Rec. 709 transfer function is recommended in the literature:
L' = 4.5L for 0 ≤ L < 0.018 .. math::
L' = 4.5L\text{, for } 0 \le L < 0.018
L' = 1.099L :sup:`0.45` - 0.099 for 0.018 ≤ L ≤ 1 L' = 1.099L ^{0.45} - 0.099\text{, for } 0.018 \le L \le 1
Inverse Transfer function: Inverse Transfer function:
L = L' / 4.5 for L' < 0.081 .. math::
L = ((L' + 0.099) / 1.099) :sup:`1/0.45` for L' ≥ 0.081 L = \frac{L'}{4.5} \text{, for } L' < 0.081
L = \left(\frac{L' + 0.099}{1.099} \right) ^{\frac{1}{0.45} }\text{, for } L' \ge 0.081
The luminance (Y') and color difference (Cb and Cr) are obtained with The luminance (Y') and color difference (Cb and Cr) are obtained with
the following ``V4L2_YCBCR_ENC_601`` encoding: the following ``V4L2_YCBCR_ENC_601`` encoding:
.. math::
Y' = 0.299R' + 0.587G' + 0.114B' Y' = 0.299R' + 0.587G' + 0.114B'
Cb = -0.169R' - 0.331G' + 0.5B' Cb = -0.169R' - 0.331G' + 0.5B'
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment