Go to the documentation of this file.
58 #define BT709_alpha 1.099296826809442
59 #define BT709_beta 0.018053968510807
66 return (0.0 > Lc) ? 0.0
67 : (
b > Lc) ? 4.500 * Lc
68 :
a * pow(Lc, 0.45) - (
a - 1.0);
73 return (0.0 > Lc) ? 0.0 : pow(Lc, 1.0/ 2.2);
78 return (0.0 > Lc) ? 0.0 : pow(Lc, 1.0/ 2.8);
83 const double a = 1.1115;
84 const double b = 0.0228;
86 return (0.0 > Lc) ? 0.0
87 : (
b > Lc) ? 4.000 * Lc
88 :
a * pow(Lc, 0.45) - (
a - 1.0);
98 return (0.01 > Lc) ? 0.0 : 1.0 + log10(Lc) / 2.0;
104 return (0.00316227766 > Lc) ? 0.0 : 1.0 + log10(Lc) / 2.5;
112 return (-
b >= Lc) ? -
a * pow(-Lc, 0.45) + (
a - 1.0)
113 : (
b > Lc) ? 4.500 * Lc
114 :
a * pow( Lc, 0.45) - (
a - 1.0);
122 return (-0.0045 >= Lc) ? -(
a * pow(-4.0 * Lc, 0.45) + (
a - 1.0)) / 4.0
123 : (
b > Lc) ? 4.500 * Lc
124 :
a * pow( Lc, 0.45) - (
a - 1.0);
129 const double a = 1.055;
130 const double b = 0.0031308;
132 return (0.0 > Lc) ? 0.0
133 : (
b > Lc) ? 12.92 * Lc
134 :
a * pow(Lc, 1.0 / 2.4) - (
a - 1.0);
139 const double c1 = 3424.0 / 4096.0;
140 const double c2 = 32.0 * 2413.0 / 4096.0;
141 const double c3 = 32.0 * 2392.0 / 4096.0;
142 const double m = 128.0 * 2523.0 / 4096.0;
143 const double n = 0.25 * 2610.0 / 4096.0;
144 const double L = Lc / 10000.0;
145 const double Ln = pow(
L, n);
147 return (0.0 > Lc) ? 0.0
148 : pow((
c1 +
c2 * Ln) / (1.0 + c3 * Ln), m);
154 return (0.0 > Lc) ? 0.0
155 : pow(48.0 * Lc / 52.37, 1.0 / 2.6);
163 const double a = 0.17883277;
164 const double b = 0.28466892;
165 const double c = 0.55991073;
166 return (0.0 > Lc) ? 0.0 :
167 (Lc <= 1.0 / 12.0 ? sqrt(3.0 * Lc) :
a * log(12.0 * Lc -
b) +
c);
int(* func)(AVBPrint *dst, const char *in, const char *arg)
AVColorTransferCharacteristic
Color Transfer Characteristic.
@ AVCOL_TRC_LINEAR
"Linear transfer characteristics"
static double avpriv_trc_smpte_st428_1(double Lc)
@ AVCOL_TRC_BT2020_12
ITU-R BT2020 for 12-bit system.
@ AVCOL_TRC_IEC61966_2_1
IEC 61966-2-1 (sRGB or sYCC)
@ AVCOL_TRC_GAMMA28
also ITU-R BT470BG
double avpriv_get_gamma_from_trc(enum AVColorTransferCharacteristic trc)
Determine a suitable 'gamma' value to match the supplied AVColorTransferCharacteristic.
@ AVCOL_TRC_LOG_SQRT
"Logarithmic transfer characteristic (100 * Sqrt(10) : 1 range)"
@ AVCOL_TRC_GAMMA22
also ITU-R BT470M / ITU-R BT1700 625 PAL & SECAM
@ AVCOL_TRC_BT1361_ECG
ITU-R BT1361 Extended Colour Gamut.
static double avpriv_trc_smpte240M(double Lc)
@ AVCOL_TRC_IEC61966_2_4
IEC 61966-2-4.
avpriv_trc_function avpriv_get_trc_function_from_trc(enum AVColorTransferCharacteristic trc)
Determine the function needed to apply the given AVColorTransferCharacteristic to linear input.
@ AVCOL_TRC_BT2020_10
ITU-R BT2020 for 10-bit system.
static double avpriv_trc_log_sqrt(double Lc)
static double avpriv_trc_iec61966_2_1(double Lc)
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
static double avpriv_trc_iec61966_2_4(double Lc)
static double avpriv_trc_gamma28(double Lc)
@ AVCOL_TRC_LOG
"Logarithmic transfer characteristic (100:1 range)"
static double avpriv_trc_linear(double Lc)
The reader does not expect b to be semantically here and if the code is changed by maybe adding a a division or other the signedness will almost certainly be mistaken To avoid this confusion a new type was SUINT is the C unsigned type but it holds a signed int to use the same example SUINT a
@ AVCOL_TRC_BT709
also ITU-R BT1361
static double avpriv_trc_gamma22(double Lc)
double(* avpriv_trc_function)(double)
static double avpriv_trc_bt709(double Lc)
@ AVCOL_TRC_ARIB_STD_B67
ARIB STD-B67, known as "Hybrid log-gamma".
@ AVCOL_TRC_SMPTE170M
also ITU-R BT601-6 525 or 625 / ITU-R BT1358 525 or 625 / ITU-R BT1700 NTSC
static double avpriv_trc_bt1361(double Lc)
static double avpriv_trc_arib_std_b67(double Lc)
static double avpriv_trc_smpte_st2084(double Lc)
static double avpriv_trc_log(double Lc)