Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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: Mauro Carvalho Chehab <mchehab@s-opensource.com>

+113 -60
+113 -60
Documentation/media/uapi/v4l/pixfmt-007.rst
··· 74 74 The transfer function defined for SMPTE 170M is the same as the one 75 75 defined in Rec. 709. 76 76 77 - L' = -1.099(-L) :sup:`0.45` + 0.099 for L ≤ -0.018 77 + .. math:: 78 78 79 - L' = 4.5L for -0.018 < L < 0.018 79 + L' = -1.099(-L)^{0.45} + 0.099 \text{, for } L \le-0.018 80 80 81 - L' = 1.099L :sup:`0.45` - 0.099 for L ≥ 0.018 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 82 84 83 85 Inverse Transfer function: 84 86 85 - L = -((L' - 0.099) / -1.099) :sup:`1/0.45` for L' ≤ -0.081 87 + .. math:: 86 88 87 - L = L' / 4.5 for -0.081 < L' < 0.081 89 + L = -\left( \frac{L' - 0.099}{-1.099} \right) ^{\frac{1}{0.45}} \text{, for } L' \le -0.081 88 90 89 - L = ((L' + 0.099) / 1.099) :sup:`1/0.45` for L' ≥ 0.081 91 + L = \frac{L'}{4.5} \text{, for } -0.081 < L' < 0.081 92 + 93 + L = \left(\frac{L' + 0.099}{1.099}\right)^{\frac{1}{0.45} } \text{, for } L' \ge 0.081 90 94 91 95 The luminance (Y') and color difference (Cb and Cr) are obtained with 92 96 the following ``V4L2_YCBCR_ENC_601`` encoding: 97 + 98 + .. math:: 93 99 94 100 Y' = 0.299R' + 0.587G' + 0.114B' 95 101 ··· 179 173 Transfer function. Normally L is in the range [0…1], but for the 180 174 extended gamut xvYCC encoding values outside that range are allowed. 181 175 182 - L' = -1.099(-L) :sup:`0.45` + 0.099 for L ≤ -0.018 176 + .. math:: 183 177 184 - L' = 4.5L for -0.018 < L < 0.018 178 + L' = -1.099(-L)^{0.45} + 0.099 \text{, for } L \le -0.018 185 179 186 - L' = 1.099L :sup:`0.45` - 0.099 for L ≥ 0.018 180 + L' = 4.5L \text{, for } -0.018 < L < 0.018 181 + 182 + L' = 1.099L^{0.45} - 0.099 \text{, for } L \ge 0.018 187 183 188 184 Inverse Transfer function: 189 185 190 - L = -((L' - 0.099) / -1.099) :sup:`1/0.45` for L' ≤ -0.081 186 + .. math:: 191 187 192 - L = L' / 4.5 for -0.081 < L' < 0.081 188 + L = -\left( \frac{L' - 0.099}{-1.099} \right)^\frac{1}{0.45} \text{, for } L' \le -0.081 193 189 194 - L = ((L' + 0.099) / 1.099) :sup:`1/0.45` for L' ≥ 0.081 190 + L = \frac{L'}{4.5}\text{, for } -0.081 < L' < 0.081 191 + 192 + L = \left(\frac{L' + 0.099}{1.099}\right)^{\frac{1}{0.45} } \text{, for } L' \ge 0.081 195 193 196 194 The luminance (Y') and color difference (Cb and Cr) are obtained with 197 195 the following ``V4L2_YCBCR_ENC_709`` encoding: 196 + 197 + .. math:: 198 198 199 199 Y' = 0.2126R' + 0.7152G' + 0.0722B' 200 200 ··· 226 214 that are outside the range [0…1]. The resulting Y', Cb and Cr values are 227 215 scaled and offset: 228 216 229 - Y' = (219 / 256) * (0.2126R' + 0.7152G' + 0.0722B') + (16 / 256) 217 + .. math:: 230 218 231 - Cb = (224 / 256) * (-0.1146R' - 0.3854G' + 0.5B') 219 + Y' = \frac{219}{256} * (0.2126R' + 0.7152G' + 0.0722B') + \frac{16}{256} 232 220 233 - Cr = (224 / 256) * (0.5R' - 0.4542G' - 0.0458B') 221 + Cb = \frac{224}{256} * (-0.1146R' - 0.3854G' + 0.5B') 222 + 223 + Cr = \frac{224}{256} * (0.5R' - 0.4542G' - 0.0458B') 234 224 235 225 The xvYCC 601 encoding (``V4L2_YCBCR_ENC_XV601``, :ref:`xvycc`) is 236 226 similar to the BT.601 encoding, but it allows for R', G' and B' values 237 227 that are outside the range [0…1]. The resulting Y', Cb and Cr values are 238 228 scaled and offset: 239 229 240 - Y' = (219 / 256) * (0.299R' + 0.587G' + 0.114B') + (16 / 256) 230 + .. math:: 241 231 242 - Cb = (224 / 256) * (-0.169R' - 0.331G' + 0.5B') 232 + Y' = \frac{219}{256} * (0.299R' + 0.587G' + 0.114B') + \frac{16}{256} 243 233 244 - Cr = (224 / 256) * (0.5R' - 0.419G' - 0.081B') 234 + Cb = \frac{224}{256} * (-0.169R' - 0.331G' + 0.5B') 235 + 236 + Cr = \frac{224}{256} * (0.5R' - 0.419G' - 0.081B') 245 237 246 238 Y' is clamped to the range [0…1] and Cb and Cr are clamped to the range 247 239 [-0.5…0.5]. The non-standard xvYCC 709 or xvYCC 601 encodings can be ··· 320 304 Transfer function. Note that negative values for L are only used by the 321 305 Y'CbCr conversion. 322 306 323 - L' = -1.055(-L) :sup:`1/2.4` + 0.055 for L < -0.0031308 307 + .. math:: 324 308 325 - L' = 12.92L for -0.0031308 ≤ L ≤ 0.0031308 309 + L' = -1.055(-L)^{\frac{1}{2.4} } + 0.055\text{, for }L < -0.0031308 326 310 327 - L' = 1.055L :sup:`1/2.4` - 0.055 for 0.0031308 < L ≤ 1 311 + L' = 12.92L\text{, for }-0.0031308 \le L \le 0.0031308 312 + 313 + L' = 1.055L ^{\frac{1}{2.4} } - 0.055\text{, for }0.0031308 < L \le 1 328 314 329 315 Inverse Transfer function: 330 316 331 - L = -((-L' + 0.055) / 1.055) :sup:`2.4` for L' < -0.04045 317 + .. math:: 332 318 333 - L = L' / 12.92 for -0.04045 ≤ L' ≤ 0.04045 319 + L = -((-L' + 0.055) / 1.055) ^{2.4}\text{, for }L' < -0.04045 334 320 335 - L = ((L' + 0.055) / 1.055) :sup:`2.4` for L' > 0.04045 321 + L = L' / 12.92\text{, for }-0.04045 \le L' \le 0.04045 322 + 323 + L = ((L' + 0.055) / 1.055) ^{2.4}\text{, for }L' > 0.04045 336 324 337 325 The luminance (Y') and color difference (Cb and Cr) are obtained with 338 326 the following ``V4L2_YCBCR_ENC_SYCC`` encoding as defined by 339 327 :ref:`sycc`: 328 + 329 + .. math:: 340 330 341 331 Y' = 0.2990R' + 0.5870G' + 0.1140B' 342 332 ··· 425 403 426 404 Transfer function: 427 405 428 - L' = L :sup:`1/2.19921875` 406 + .. math:: 407 + 408 + L' = L ^{\frac{1}{2.19921875}} 429 409 430 410 Inverse Transfer function: 431 411 432 - L = L' :sup:`2.19921875` 412 + .. math:: 413 + 414 + L = L'^{(2.19921875)} 433 415 434 416 The luminance (Y') and color difference (Cb and Cr) are obtained with 435 417 the following ``V4L2_YCBCR_ENC_601`` encoding: 418 + 419 + .. math:: 436 420 437 421 Y' = 0.299R' + 0.587G' + 0.114B' 438 422 ··· 517 489 518 490 Transfer function (same as Rec. 709): 519 491 520 - L' = 4.5L for 0 ≤ L < 0.018 492 + .. math:: 521 493 522 - L' = 1.099L :sup:`0.45` - 0.099 for 0.018 ≤ L ≤ 1 494 + L' = 4.5L\text{, for }0 \le L < 0.018 495 + 496 + L' = 1.099L ^{0.45} - 0.099\text{, for } 0.018 \le L \le 1 523 497 524 498 Inverse Transfer function: 525 499 526 - L = L' / 4.5 for L' < 0.081 500 + .. math:: 527 501 528 - L = ((L' + 0.099) / 1.099) :sup:`1/0.45` for L' ≥ 0.081 502 + L = L' / 4.5\text{, for } L' < 0.081 503 + 504 + L = \left( \frac{L' + 0.099}{1.099}\right) ^{\frac{1}{0.45} }\text{, for } L' \ge 0.081 529 505 530 506 The luminance (Y') and color difference (Cb and Cr) are obtained with 531 507 the following ``V4L2_YCBCR_ENC_BT2020`` encoding: 508 + 509 + .. math:: 532 510 533 511 Y' = 0.2627R' + 0.6780G' + 0.0593B' 534 512 ··· 550 516 551 517 Luma: 552 518 553 - Yc' = (0.2627R + 0.6780G + 0.0593B)' 519 + .. math:: 520 + :nowrap: 554 521 555 - B' - Yc' ≤ 0: 556 - 557 - Cbc = (B' - Yc') / 1.9404 558 - 559 - B' - Yc' > 0: 560 - 561 - Cbc = (B' - Yc') / 1.5816 562 - 563 - R' - Yc' ≤ 0: 564 - 565 - Crc = (R' - Y') / 1.7184 566 - 567 - R' - Yc' > 0: 568 - 569 - Crc = (R' - Y') / 0.9936 522 + \begin{align*} 523 + Yc' = (0.2627R + 0.6780G + 0.0593B)'& \\ 524 + B' - Yc' \le 0:& \\ 525 + &Cbc = (B' - Yc') / 1.9404 \\ 526 + B' - Yc' > 0: & \\ 527 + &Cbc = (B' - Yc') / 1.5816 \\ 528 + R' - Yc' \le 0:& \\ 529 + &Crc = (R' - Y') / 1.7184 \\ 530 + R' - Yc' > 0:& \\ 531 + &Crc = (R' - Y') / 0.9936 532 + \end{align*} 570 533 571 534 Yc' is clamped to the range [0…1] and Cbc and Crc are clamped to the 572 535 range [-0.5…0.5]. The Yc'CbcCrc quantization is limited range. ··· 641 610 642 611 Transfer function: 643 612 644 - L' = L :sup:`1/2.6` 613 + .. math:: 614 + 615 + L' = L^{\frac{1}{2.6}} 645 616 646 617 Inverse Transfer function: 647 618 648 - L = L' :sup:`2.6` 619 + .. math:: 620 + 621 + L = L'^{(2.6)} 649 622 650 623 Y'CbCr encoding is not specified. V4L2 defaults to Rec. 709. 651 624 ··· 721 686 722 687 Transfer function: 723 688 724 - L' = 4L for 0 ≤ L < 0.0228 689 + .. math:: 725 690 726 - L' = 1.1115L :sup:`0.45` - 0.1115 for 0.0228 ≤ L ≤ 1 691 + L' = 4L\text{, for } 0 \le L < 0.0228 692 + 693 + L' = 1.1115L ^{0.45} - 0.1115\text{, for } 0.0228 \le L \le 1 727 694 728 695 Inverse Transfer function: 729 696 730 - L = L' / 4 for 0 ≤ L' < 0.0913 697 + .. math:: 731 698 732 - L = ((L' + 0.1115) / 1.1115) :sup:`1/0.45` for L' ≥ 0.0913 699 + L = \frac{L'}{4}\text{, for } 0 \le L' < 0.0913 700 + 701 + L = \left( \frac{L' + 0.1115}{1.1115}\right) ^{\frac{1}{0.45} }\text{, for } L' \ge 0.0913 733 702 734 703 The luminance (Y') and color difference (Cb and Cr) are obtained with 735 704 the following ``V4L2_YCBCR_ENC_SMPTE240M`` encoding: 705 + 706 + .. math:: 736 707 737 708 Y' = 0.2122R' + 0.7013G' + 0.0865B' 738 709 ··· 823 782 The transfer function was never properly defined for NTSC 1953. The Rec. 824 783 709 transfer function is recommended in the literature: 825 784 826 - L' = 4.5L for 0 ≤ L < 0.018 785 + .. math:: 827 786 828 - L' = 1.099L :sup:`0.45` - 0.099 for 0.018 ≤ L ≤ 1 787 + L' = 4.5L\text{, for } 0 \le L < 0.018 788 + 789 + L' = 1.099L ^{0.45} - 0.099\text{, for } 0.018 \le L \le 1 829 790 830 791 Inverse Transfer function: 831 792 832 - L = L' / 4.5 for L' < 0.081 793 + .. math:: 833 794 834 - L = ((L' + 0.099) / 1.099) :sup:`1/0.45` for L' ≥ 0.081 795 + L = \frac{L'}{4.5} \text{, for } L' < 0.081 796 + 797 + L = \left( \frac{L' + 0.099}{1.099}\right) ^{\frac{1}{0.45} }\text{, for } L' \ge 0.081 835 798 836 799 The luminance (Y') and color difference (Cb and Cr) are obtained with 837 800 the following ``V4L2_YCBCR_ENC_601`` encoding: 801 + 802 + .. math:: 838 803 839 804 Y' = 0.299R' + 0.587G' + 0.114B' 840 805 ··· 921 874 The transfer function was never properly defined for this colorspace. 922 875 The Rec. 709 transfer function is recommended in the literature: 923 876 924 - L' = 4.5L for 0 ≤ L < 0.018 877 + .. math:: 925 878 926 - L' = 1.099L :sup:`0.45` - 0.099 for 0.018 ≤ L ≤ 1 879 + L' = 4.5L\text{, for } 0 \le L < 0.018 880 + 881 + L' = 1.099L ^{0.45} - 0.099\text{, for } 0.018 \le L \le 1 927 882 928 883 Inverse Transfer function: 929 884 930 - L = L' / 4.5 for L' < 0.081 885 + .. math:: 931 886 932 - L = ((L' + 0.099) / 1.099) :sup:`1/0.45` for L' ≥ 0.081 887 + L = \frac{L'}{4.5} \text{, for } L' < 0.081 888 + 889 + L = \left(\frac{L' + 0.099}{1.099} \right) ^{\frac{1}{0.45} }\text{, for } L' \ge 0.081 933 890 934 891 The luminance (Y') and color difference (Cb and Cr) are obtained with 935 892 the following ``V4L2_YCBCR_ENC_601`` encoding: 893 + 894 + .. math:: 936 895 937 896 Y' = 0.299R' + 0.587G' + 0.114B' 938 897