FFmpeg
Loading...
Searching...
No Matches
csp.c File Reference
#include <stdlib.h>
#include <math.h>
#include "attributes.h"
#include "csp.h"
#include "pixfmt.h"
#include "rational.h"

Go to the source code of this file.

Macros

#define AVR(d)
 
#define WP_D65   { AVR(0.3127), AVR(0.3290) }
 
#define WP_C   { AVR(0.3100), AVR(0.3160) }
 
#define WP_DCI   { AVR(0.3140), AVR(0.3510) }
 
#define WP_E   { {1, 3}, {1, 3} }
 
#define BT709_alpha   1.099296826809442
 
#define BT709_beta   0.018053968510807
 
#define PQ_c1   ( 3424.0 / 4096.0) /* c3-c2 + 1 */
 
#define PQ_c2   ( 32.0 * 2413.0 / 4096.0)
 
#define PQ_c3   ( 32.0 * 2392.0 / 4096.0)
 
#define PQ_m   (128.0 * 2523.0 / 4096.0)
 
#define PQ_n   ( 0.25 * 2610.0 / 4096.0)
 
#define DCI_L   48.00
 
#define DCI_P   52.37
 
#define HLG_a   0.17883277
 
#define HLG_b   0.28466892
 
#define HLG_c   0.55991073
 
#define VLOG_c1   0.01
 
#define VLOG_c2   0.181
 
#define VLOG_b   0.00873
 
#define VLOG_c   0.241514
 
#define VLOG_d   0.598206
 
#define WRAP_SDR_OETF(name)
 
#define WRAP_SDR_EOTF(name)
 
#define DCI_L   48.00
 
#define DCI_P   52.37
 
#define DCI_X   (42.94 / DCI_L)
 
#define DCI_Z   (45.82 / DCI_L)
 

Functions

const struct AVLumaCoefficientsav_csp_luma_coeffs_from_avcsp (enum AVColorSpace csp)
 Retrieves the Luma coefficients necessary to construct a conversion matrix from an enum constant describing the colorspace.
 
const AVColorPrimariesDescav_csp_primaries_desc_from_id (enum AVColorPrimaries prm)
 Retrieves a complete gamut description from an enum constant describing the color primaries.
 
static av_always_inline AVRational abs_sub_q (AVRational r1, AVRational r2)
 
enum AVColorPrimaries av_csp_primaries_id_from_desc (const AVColorPrimariesDesc *prm)
 Detects which enum AVColorPrimaries constant corresponds to the given complete gamut description.
 
double av_csp_approximate_trc_gamma (enum AVColorTransferCharacteristic trc)
 Determine a suitable 'gamma' value to match the supplied AVColorTransferCharacteristic.
 
double av_csp_approximate_eotf_gamma (enum AVColorTransferCharacteristic trc)
 Determine a suitable EOTF 'gamma' value to match the supplied AVColorTransferCharacteristic.
 
static double trc_bt709 (double Lc)
 
static double trc_bt709_inv (double E)
 
static double trc_gamma22 (double Lc)
 
static double trc_gamma22_inv (double E)
 
static double trc_gamma28 (double Lc)
 
static double trc_gamma28_inv (double E)
 
static double trc_smpte240M (double Lc)
 
static double trc_smpte240M_inv (double E)
 
static double trc_linear (double Lc)
 
static double trc_log (double Lc)
 
static double trc_log_inv (double E)
 
static double trc_log_sqrt (double Lc)
 
static double trc_log_sqrt_inv (double E)
 
static double trc_iec61966_2_4 (double Lc)
 
static double trc_iec61966_2_4_inv (double E)
 
static double trc_bt1361 (double Lc)
 
static double trc_bt1361_inv (double E)
 
static double trc_iec61966_2_1 (double Lc)
 
static double trc_iec61966_2_1_inv (double E)
 
static double trc_smpte_st2084 (double Lc)
 
static double trc_smpte_st2084_inv (double E)
 
static double trc_smpte_st428_1 (double Lc)
 
static double trc_smpte_st428_1_inv (double E)
 
static double trc_arib_std_b67 (double Lc)
 
static double trc_arib_std_b67_inv (double E)
 
static double trc_v_log (double E)
 
static double trc_v_log_inv (double E)
 
av_csp_trc_function av_csp_trc_func_from_id (enum AVColorTransferCharacteristic trc)
 Determine the function needed to apply the given AVColorTransferCharacteristic to linear input.
 
av_csp_trc_function av_csp_trc_func_inv_from_id (enum AVColorTransferCharacteristic trc)
 Returns the mathematical inverse of the corresponding TRC function.
 
static void eotf_linear (const double Lw, const double Lb, double E[3])
 
static void eotf_linear_inv (const double Lw, const double Lb, double L[3])
 
static void eotf_bt1886 (const double Lw, const double Lb, double E[3])
 
static void eotf_bt1886_inv (const double Lw, const double Lb, double L[3])
 
static void eotf_smpte_st2084 (const double Lw, const double Lb, double E[3])
 
static void eotf_smpte_st2084_inv (const double Lw, const double Lb, double L[3])
 
static void eotf_smpte_st428_1 (const double Lw_Y, const double Lb_Y, double E[3])
 
static void eotf_smpte_st428_1_inv (const double Lw_Y, const double Lb_Y, double L[3])
 
static void eotf_arib_std_b67 (const double Lw, const double Lb, double E[3])
 
static void eotf_arib_std_b67_inv (const double Lw, const double Lb, double L[3])
 
av_csp_eotf_function av_csp_itu_eotf (enum AVColorTransferCharacteristic trc)
 Returns the ITU EOTF corresponding to a given TRC.
 
av_csp_eotf_function av_csp_itu_eotf_inv (enum AVColorTransferCharacteristic trc)
 Returns the mathematical inverse of the corresponding EOTF.
 

Variables

static const struct AVLumaCoefficients luma_coefficients [AVCOL_SPC_NB]
 
static const AVColorPrimariesDesc color_primaries [AVCOL_PRI_NB]
 
static const AVColorPrimariesDesc color_primaries_ext [AVCOL_PRI_EXT_NB - AVCOL_PRI_EXT_BASE]
 
static const double approximate_gamma [AVCOL_TRC_NB]
 
static const double approximate_gamma_ext [AVCOL_TRC_EXT_NB - AVCOL_TRC_EXT_BASE]
 
static const double approximate_eotf_gamma [AVCOL_TRC_NB]
 
static const double approximate_eotf_gamma_ext [AVCOL_TRC_EXT_NB - AVCOL_TRC_EXT_BASE]
 
static const av_csp_trc_function trc_funcs [AVCOL_TRC_NB]
 
static const av_csp_trc_function trc_funcs_ext [AVCOL_TRC_EXT_NB - AVCOL_TRC_EXT_BASE]
 
static const av_csp_trc_function trc_inv_funcs [AVCOL_TRC_NB]
 
static const av_csp_trc_function trc_inv_funcs_ext [AVCOL_TRC_EXT_NB - AVCOL_TRC_EXT_BASE]
 
static const av_csp_eotf_function eotf_funcs [AVCOL_TRC_NB]
 
static const av_csp_eotf_function eotf_inv_funcs [AVCOL_TRC_NB]
 

Macro Definition Documentation

◆ AVR

#define AVR ( d)
Value:
{ (int)(d * 100000 + 0.5), 100000 }

Definition at line 38 of file csp.c.

◆ WP_D65

#define WP_D65   { AVR(0.3127), AVR(0.3290) }

Definition at line 71 of file csp.c.

◆ WP_C

#define WP_C   { AVR(0.3100), AVR(0.3160) }

Definition at line 72 of file csp.c.

◆ WP_DCI

#define WP_DCI   { AVR(0.3140), AVR(0.3510) }

Definition at line 73 of file csp.c.

◆ WP_E

#define WP_E   { {1, 3}, {1, 3} }

Definition at line 74 of file csp.c.

◆ BT709_alpha

#define BT709_alpha   1.099296826809442

◆ BT709_beta

#define BT709_beta   0.018053968510807

◆ PQ_c1

#define PQ_c1   ( 3424.0 / 4096.0) /* c3-c2 + 1 */

Definition at line 347 of file csp.c.

Referenced by trc_smpte_st2084(), and trc_smpte_st2084_inv().

◆ PQ_c2

#define PQ_c2   ( 32.0 * 2413.0 / 4096.0)

Definition at line 348 of file csp.c.

Referenced by trc_smpte_st2084(), and trc_smpte_st2084_inv().

◆ PQ_c3

#define PQ_c3   ( 32.0 * 2392.0 / 4096.0)

Definition at line 349 of file csp.c.

Referenced by trc_smpte_st2084(), and trc_smpte_st2084_inv().

◆ PQ_m

#define PQ_m   (128.0 * 2523.0 / 4096.0)

Definition at line 350 of file csp.c.

Referenced by trc_smpte_st2084(), and trc_smpte_st2084_inv().

◆ PQ_n

#define PQ_n   ( 0.25 * 2610.0 / 4096.0)

Definition at line 351 of file csp.c.

Referenced by trc_smpte_st2084(), and trc_smpte_st2084_inv().

◆ DCI_L [1/2]

#define DCI_L   48.00

◆ DCI_P [1/2]

#define DCI_P   52.37

◆ HLG_a

#define HLG_a   0.17883277

Definition at line 394 of file csp.c.

Referenced by trc_arib_std_b67(), and trc_arib_std_b67_inv().

◆ HLG_b

#define HLG_b   0.28466892

Definition at line 395 of file csp.c.

Referenced by trc_arib_std_b67(), and trc_arib_std_b67_inv().

◆ HLG_c

#define HLG_c   0.55991073

Definition at line 396 of file csp.c.

Referenced by trc_arib_std_b67(), and trc_arib_std_b67_inv().

◆ VLOG_c1

#define VLOG_c1   0.01

Definition at line 418 of file csp.c.

Referenced by trc_v_log().

◆ VLOG_c2

#define VLOG_c2   0.181

Definition at line 419 of file csp.c.

Referenced by trc_v_log_inv().

◆ VLOG_b

#define VLOG_b   0.00873

Definition at line 420 of file csp.c.

Referenced by trc_v_log(), and trc_v_log_inv().

◆ VLOG_c

#define VLOG_c   0.241514

Definition at line 421 of file csp.c.

Referenced by trc_v_log(), and trc_v_log_inv().

◆ VLOG_d

#define VLOG_d   0.598206

Definition at line 422 of file csp.c.

Referenced by trc_v_log(), and trc_v_log_inv().

◆ WRAP_SDR_OETF

#define WRAP_SDR_OETF ( name)
Value:
static void oetf_##name(double L[3]) \
{ \
for (int i = 0; i < 3; i++) \
L[i] = trc_##name(L[i]); \
} \
\
static void oetf_##name##_inv(double E[3]) \
{ \
for (int i = 0; i < 3; i++) \
E[i] = trc_##name##_inv(E[i]); \
}
#define L(x)
Definition vpx_arith.h:36
#define E
Definition avdct.c:34
#define i(width, name, range_min, range_max)
Definition cbs_h264.c:63
const char * name
Definition qsvenc.c:142

Definition at line 524 of file csp.c.

◆ WRAP_SDR_EOTF

#define WRAP_SDR_EOTF ( name)
Value:
static void eotf_##name(double Lw, double Lb, double E[3]) \
{ \
oetf_##name##_inv(E); \
eotf_linear(Lw, Lb, E); \
} \
\
static void eotf_##name##_inv(double Lw, double Lb, double L[3]) \
{ \
eotf_linear_inv(Lw, Lb, L); \
oetf_##name(L); \
}

Definition at line 541 of file csp.c.

◆ DCI_L [2/2]

#define DCI_L   48.00

Definition at line 381 of file csp.c.

◆ DCI_P [2/2]

#define DCI_P   52.37

Definition at line 382 of file csp.c.

◆ DCI_X

#define DCI_X   (42.94 / DCI_L)

Definition at line 595 of file csp.c.

Referenced by eotf_smpte_st428_1(), and eotf_smpte_st428_1_inv().

◆ DCI_Z

#define DCI_Z   (45.82 / DCI_L)

Definition at line 596 of file csp.c.

Referenced by eotf_smpte_st428_1(), and eotf_smpte_st428_1_inv().

Function Documentation

◆ abs_sub_q()

static av_always_inline AVRational abs_sub_q ( AVRational r1,
AVRational r2 )
static

Definition at line 108 of file csp.c.

Referenced by av_csp_primaries_id_from_desc().

◆ trc_bt709()

static double trc_bt709 ( double Lc)
static

Definition at line 200 of file csp.c.

◆ trc_bt709_inv()

static double trc_bt709_inv ( double E)
static

Definition at line 210 of file csp.c.

◆ trc_gamma22()

static double trc_gamma22 ( double Lc)
static

Definition at line 220 of file csp.c.

◆ trc_gamma22_inv()

static double trc_gamma22_inv ( double E)
static

Definition at line 225 of file csp.c.

◆ trc_gamma28()

static double trc_gamma28 ( double Lc)
static

Definition at line 230 of file csp.c.

◆ trc_gamma28_inv()

static double trc_gamma28_inv ( double E)
static

Definition at line 235 of file csp.c.

◆ trc_smpte240M()

static double trc_smpte240M ( double Lc)
static

Definition at line 240 of file csp.c.

◆ trc_smpte240M_inv()

static double trc_smpte240M_inv ( double E)
static

Definition at line 250 of file csp.c.

◆ trc_linear()

static double trc_linear ( double Lc)
static

Definition at line 260 of file csp.c.

◆ trc_log()

static double trc_log ( double Lc)
static

Definition at line 265 of file csp.c.

◆ trc_log_inv()

static double trc_log_inv ( double E)
static

Definition at line 270 of file csp.c.

◆ trc_log_sqrt()

static double trc_log_sqrt ( double Lc)
static

Definition at line 275 of file csp.c.

◆ trc_log_sqrt_inv()

static double trc_log_sqrt_inv ( double E)
static

Definition at line 281 of file csp.c.

◆ trc_iec61966_2_4()

static double trc_iec61966_2_4 ( double Lc)
static

Definition at line 286 of file csp.c.

◆ trc_iec61966_2_4_inv()

static double trc_iec61966_2_4_inv ( double E)
static

Definition at line 296 of file csp.c.

◆ trc_bt1361()

static double trc_bt1361 ( double Lc)
static

Definition at line 306 of file csp.c.

◆ trc_bt1361_inv()

static double trc_bt1361_inv ( double E)
static

Definition at line 316 of file csp.c.

◆ trc_iec61966_2_1()

static double trc_iec61966_2_1 ( double Lc)
static

Definition at line 326 of file csp.c.

◆ trc_iec61966_2_1_inv()

static double trc_iec61966_2_1_inv ( double E)
static

Definition at line 336 of file csp.c.

◆ trc_smpte_st2084()

static double trc_smpte_st2084 ( double Lc)
static

Definition at line 353 of file csp.c.

Referenced by eotf_smpte_st2084_inv().

◆ trc_smpte_st2084_inv()

static double trc_smpte_st2084_inv ( double E)
static

Definition at line 368 of file csp.c.

Referenced by eotf_smpte_st2084().

◆ trc_smpte_st428_1()

static double trc_smpte_st428_1 ( double Lc)
static

Definition at line 384 of file csp.c.

◆ trc_smpte_st428_1_inv()

static double trc_smpte_st428_1_inv ( double E)
static

Definition at line 389 of file csp.c.

◆ trc_arib_std_b67()

static double trc_arib_std_b67 ( double Lc)
static

Definition at line 398 of file csp.c.

Referenced by eotf_arib_std_b67_inv().

◆ trc_arib_std_b67_inv()

static double trc_arib_std_b67_inv ( double E)
static

Definition at line 409 of file csp.c.

Referenced by eotf_arib_std_b67().

◆ trc_v_log()

static double trc_v_log ( double E)
static

Definition at line 424 of file csp.c.

◆ trc_v_log_inv()

static double trc_v_log_inv ( double E)
static

Definition at line 434 of file csp.c.

◆ eotf_linear()

static void eotf_linear ( const double Lw,
const double Lb,
double E[3] )
static

Definition at line 512 of file csp.c.

◆ eotf_linear_inv()

static void eotf_linear_inv ( const double Lw,
const double Lb,
double L[3] )
static

Definition at line 518 of file csp.c.

◆ eotf_bt1886()

static void eotf_bt1886 ( const double Lw,
const double Lb,
double E[3] )
static

Definition at line 558 of file csp.c.

Referenced by eotf_bt1886().

◆ eotf_bt1886_inv()

static void eotf_bt1886_inv ( const double Lw,
const double Lb,
double L[3] )
static

Definition at line 569 of file csp.c.

◆ eotf_smpte_st2084()

static void eotf_smpte_st2084 ( const double Lw,
const double Lb,
double E[3] )
static

Definition at line 580 of file csp.c.

◆ eotf_smpte_st2084_inv()

static void eotf_smpte_st2084_inv ( const double Lw,
const double Lb,
double L[3] )
static

Definition at line 586 of file csp.c.

◆ eotf_smpte_st428_1()

static void eotf_smpte_st428_1 ( const double Lw_Y,
const double Lb_Y,
double E[3] )
static

Definition at line 598 of file csp.c.

◆ eotf_smpte_st428_1_inv()

static void eotf_smpte_st428_1_inv ( const double Lw_Y,
const double Lb_Y,
double L[3] )
static

Definition at line 609 of file csp.c.

◆ eotf_arib_std_b67()

static void eotf_arib_std_b67 ( const double Lw,
const double Lb,
double E[3] )
static

Note: This equation is technically only accurate if the contrast ratio Lw:Lb is greater than 12:1; otherwise we would need to use a different, significantly more complicated solution. Ignore this as a highly degenerate case, since any real world reference display will have a static contrast ratio multiple orders of magnitude higher.

Definition at line 620 of file csp.c.

◆ eotf_arib_std_b67_inv()

static void eotf_arib_std_b67_inv ( const double Lw,
const double Lb,
double L[3] )
static

Definition at line 643 of file csp.c.

Variable Documentation

◆ luma_coefficients

const struct AVLumaCoefficients luma_coefficients[AVCOL_SPC_NB]
static
Initial value:
= {
[AVCOL_SPC_FCC] = { AVR(0.30), AVR(0.59), AVR(0.11) },
[AVCOL_SPC_BT470BG] = { AVR(0.299), AVR(0.587), AVR(0.114) },
[AVCOL_SPC_SMPTE170M] = { AVR(0.299), AVR(0.587), AVR(0.114) },
[AVCOL_SPC_BT709] = { AVR(0.2126), AVR(0.7152), AVR(0.0722) },
[AVCOL_SPC_SMPTE240M] = { AVR(0.212), AVR(0.701), AVR(0.087) },
[AVCOL_SPC_YCOCG] = { AVR(0.25), AVR(0.5), AVR(0.25) },
[AVCOL_SPC_RGB] = { AVR(1), AVR(1), AVR(1) },
[AVCOL_SPC_BT2020_NCL] = { AVR(0.2627), AVR(0.6780), AVR(0.0593) },
[AVCOL_SPC_BT2020_CL] = { AVR(0.2627), AVR(0.6780), AVR(0.0593) },
}
#define AVR(d)
Definition csp.c:38
@ AVCOL_SPC_BT709
also ITU-R BT1361 / IEC 61966-2-4 xvYCC709 / derived in SMPTE RP 177 Annex B
Definition pixfmt.h:708
@ AVCOL_SPC_BT470BG
also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM / IEC 61966-2-4 xvYCC601
Definition pixfmt.h:712
@ AVCOL_SPC_YCOCG
Definition pixfmt.h:716
@ AVCOL_SPC_BT2020_CL
ITU-R BT2020 constant luminance system.
Definition pixfmt.h:718
@ AVCOL_SPC_RGB
order of coefficients is actually GBR, also IEC 61966-2-1 (sRGB), YZX and ST 428-1
Definition pixfmt.h:707
@ AVCOL_SPC_BT2020_NCL
ITU-R BT2020 non-constant luminance system.
Definition pixfmt.h:717
@ AVCOL_SPC_SMPTE170M
also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC / functionally identical to above
Definition pixfmt.h:713
@ AVCOL_SPC_FCC
FCC Title 47 Code of Federal Regulations 73.682 (a)(20)
Definition pixfmt.h:711
@ AVCOL_SPC_SMPTE240M
derived from 170M primaries and D65 white point, 170M is derived from BT470 System M's primaries
Definition pixfmt.h:714

Definition at line 46 of file csp.c.

Referenced by av_csp_luma_coeffs_from_avcsp().

◆ color_primaries

const AVColorPrimariesDesc color_primaries[AVCOL_PRI_NB]
static
Initial value:
= {
[AVCOL_PRI_BT709] = { WP_D65, { { AVR(0.640), AVR(0.330) }, { AVR(0.300), AVR(0.600) }, { AVR(0.150), AVR(0.060) } } },
[AVCOL_PRI_BT470M] = { WP_C, { { AVR(0.670), AVR(0.330) }, { AVR(0.210), AVR(0.710) }, { AVR(0.140), AVR(0.080) } } },
[AVCOL_PRI_BT470BG] = { WP_D65, { { AVR(0.640), AVR(0.330) }, { AVR(0.290), AVR(0.600) }, { AVR(0.150), AVR(0.060) } } },
[AVCOL_PRI_SMPTE170M] = { WP_D65, { { AVR(0.630), AVR(0.340) }, { AVR(0.310), AVR(0.595) }, { AVR(0.155), AVR(0.070) } } },
[AVCOL_PRI_SMPTE240M] = { WP_D65, { { AVR(0.630), AVR(0.340) }, { AVR(0.310), AVR(0.595) }, { AVR(0.155), AVR(0.070) } } },
[AVCOL_PRI_SMPTE428] = { WP_E, { { AVR(0.735), AVR(0.265) }, { AVR(0.274), AVR(0.718) }, { AVR(0.167), AVR(0.009) } } },
[AVCOL_PRI_SMPTE431] = { WP_DCI, { { AVR(0.680), AVR(0.320) }, { AVR(0.265), AVR(0.690) }, { AVR(0.150), AVR(0.060) } } },
[AVCOL_PRI_SMPTE432] = { WP_D65, { { AVR(0.680), AVR(0.320) }, { AVR(0.265), AVR(0.690) }, { AVR(0.150), AVR(0.060) } } },
[AVCOL_PRI_FILM] = { WP_C, { { AVR(0.681), AVR(0.319) }, { AVR(0.243), AVR(0.692) }, { AVR(0.145), AVR(0.049) } } },
[AVCOL_PRI_BT2020] = { WP_D65, { { AVR(0.708), AVR(0.292) }, { AVR(0.170), AVR(0.797) }, { AVR(0.131), AVR(0.046) } } },
[AVCOL_PRI_JEDEC_P22] = { WP_D65, { { AVR(0.630), AVR(0.340) }, { AVR(0.295), AVR(0.605) }, { AVR(0.155), AVR(0.077) } } },
}
#define WP_D65
Definition csp.c:71
#define WP_C
Definition csp.c:72
#define WP_DCI
Definition csp.c:73
#define WP_E
Definition csp.c:74
@ AVCOL_PRI_BT470BG
also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM
Definition pixfmt.h:649
@ AVCOL_PRI_FILM
colour filters using Illuminant C
Definition pixfmt.h:652
@ AVCOL_PRI_SMPTE432
SMPTE ST 432-1 (2010) / P3 D65 / Display P3.
Definition pixfmt.h:657
@ AVCOL_PRI_BT709
also ITU-R BT1361 / IEC 61966-2-4 / SMPTE RP 177 Annex B
Definition pixfmt.h:644
@ AVCOL_PRI_JEDEC_P22
Definition pixfmt.h:659
@ AVCOL_PRI_SMPTE240M
identical to above, also called "SMPTE C" even though it uses D65
Definition pixfmt.h:651
@ AVCOL_PRI_SMPTE431
SMPTE ST 431-2 (2011) / DCI P3.
Definition pixfmt.h:656
@ AVCOL_PRI_SMPTE428
SMPTE ST 428-1 (CIE 1931 XYZ)
Definition pixfmt.h:654
@ AVCOL_PRI_SMPTE170M
also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC
Definition pixfmt.h:650
@ AVCOL_PRI_BT2020
ITU-R BT2020.
Definition pixfmt.h:653
@ AVCOL_PRI_BT470M
also FCC Title 47 Code of Federal Regulations 73.682 (a)(20)
Definition pixfmt.h:647

Definition at line 76 of file csp.c.

Referenced by av_csp_primaries_desc_from_id(), av_csp_primaries_id_from_desc(), color_config(), convert_primaries(), dovi_configure_ext(), ff_prores_kostya_write_frame_header(), frame_header(), mov_read_colr(), mov_read_vpcc(), print_film_grain_params(), print_primaries(), scale_vaapi_init(), scale_vt_init(), tonemap_vaapi_init(), vpp_init(), and write_frame_header().

◆ color_primaries_ext

const AVColorPrimariesDesc color_primaries_ext[AVCOL_PRI_EXT_NB - AVCOL_PRI_EXT_BASE]
static
Initial value:
= {
[AVCOL_PRI_V_GAMUT - AVCOL_PRI_EXT_BASE] = { WP_D65, { { AVR(0.730), AVR(0.280) }, { AVR(0.165), AVR(0.840) }, { AVR(0.100), AVR(-0.030) } } },
}
@ AVCOL_PRI_V_GAMUT
Definition pixfmt.h:664
@ AVCOL_PRI_EXT_BASE
Definition pixfmt.h:663

Definition at line 90 of file csp.c.

Referenced by av_csp_primaries_desc_from_id().

◆ approximate_gamma

const double approximate_gamma[AVCOL_TRC_NB]
static
Initial value:
= {
[AVCOL_TRC_BT709] = 1.961,
}
@ AVCOL_TRC_SMPTE170M
also ITU-R BT601-6 525 or 625 / ITU-R BT1358 525 or 625 / ITU-R BT1700 NTSC
Definition pixfmt.h:679
@ AVCOL_TRC_GAMMA22
also ITU-R BT470M / ITU-R BT1700 625 PAL & SECAM
Definition pixfmt.h:677
@ AVCOL_TRC_BT1361_ECG
ITU-R BT1361 Extended Colour Gamut.
Definition pixfmt.h:685
@ AVCOL_TRC_SMPTE240M
Definition pixfmt.h:680
@ AVCOL_TRC_LINEAR
"Linear transfer characteristics"
Definition pixfmt.h:681
@ AVCOL_TRC_GAMMA28
also ITU-R BT470BG
Definition pixfmt.h:678
@ AVCOL_TRC_SMPTE428
SMPTE ST 428-1.
Definition pixfmt.h:691
@ AVCOL_TRC_BT2020_12
ITU-R BT2020 for 12-bit system.
Definition pixfmt.h:688
@ AVCOL_TRC_IEC61966_2_1
IEC 61966-2-1 (sRGB or sYCC)
Definition pixfmt.h:686
@ AVCOL_TRC_BT2020_10
ITU-R BT2020 for 10-bit system.
Definition pixfmt.h:687
@ AVCOL_TRC_BT709
also ITU-R BT1361
Definition pixfmt.h:674

Definition at line 140 of file csp.c.

Referenced by av_csp_approximate_trc_gamma().

◆ approximate_gamma_ext

const double approximate_gamma_ext[AVCOL_TRC_EXT_NB - AVCOL_TRC_EXT_BASE]
static
Initial value:
= {
}
@ AVCOL_TRC_EXT_BASE
Definition pixfmt.h:697
@ AVCOL_TRC_V_LOG
Definition pixfmt.h:698

Definition at line 154 of file csp.c.

Referenced by av_csp_approximate_trc_gamma().

◆ approximate_eotf_gamma

const double approximate_eotf_gamma[AVCOL_TRC_NB]
static
Initial value:

Definition at line 168 of file csp.c.

Referenced by av_csp_approximate_eotf_gamma().

◆ approximate_eotf_gamma_ext

const double approximate_eotf_gamma_ext[AVCOL_TRC_EXT_NB - AVCOL_TRC_EXT_BASE]
static
Initial value:

Definition at line 182 of file csp.c.

Referenced by av_csp_approximate_eotf_gamma().

◆ trc_funcs

const av_csp_trc_function trc_funcs[AVCOL_TRC_NB]
static
Initial value:
= {
}
static double trc_smpte240M(double Lc)
Definition csp.c:240
static double trc_smpte_st2084(double Lc)
Definition csp.c:353
static double trc_iec61966_2_4(double Lc)
Definition csp.c:286
static double trc_log_sqrt(double Lc)
Definition csp.c:275
static double trc_iec61966_2_1(double Lc)
Definition csp.c:326
static double trc_bt1361(double Lc)
Definition csp.c:306
static double trc_log(double Lc)
Definition csp.c:265
static double trc_linear(double Lc)
Definition csp.c:260
static double trc_gamma28(double Lc)
Definition csp.c:230
static double trc_arib_std_b67(double Lc)
Definition csp.c:398
static double trc_gamma22(double Lc)
Definition csp.c:220
static double trc_smpte_st428_1(double Lc)
Definition csp.c:384
static double trc_bt709(double Lc)
Definition csp.c:200
@ AVCOL_TRC_SMPTE2084
SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems.
Definition pixfmt.h:689
@ AVCOL_TRC_LOG
"Logarithmic transfer characteristic (100:1 range)"
Definition pixfmt.h:682
@ AVCOL_TRC_IEC61966_2_4
IEC 61966-2-4.
Definition pixfmt.h:684
@ AVCOL_TRC_ARIB_STD_B67
ARIB STD-B67, known as "Hybrid log-gamma".
Definition pixfmt.h:693
@ AVCOL_TRC_LOG_SQRT
"Logarithmic transfer characteristic (100 * Sqrt(10) : 1 range)"
Definition pixfmt.h:683

Definition at line 444 of file csp.c.

Referenced by av_csp_trc_func_from_id().

◆ trc_funcs_ext

Initial value:
= {
}
static double trc_v_log(double E)
Definition csp.c:424

Definition at line 463 of file csp.c.

Referenced by av_csp_trc_func_from_id().

◆ trc_inv_funcs

const av_csp_trc_function trc_inv_funcs[AVCOL_TRC_NB]
static
Initial value:
= {
}
static double trc_gamma22_inv(double E)
Definition csp.c:225
static double trc_bt1361_inv(double E)
Definition csp.c:316
static double trc_arib_std_b67_inv(double E)
Definition csp.c:409
static double trc_bt709_inv(double E)
Definition csp.c:210
static double trc_gamma28_inv(double E)
Definition csp.c:235
static double trc_log_sqrt_inv(double E)
Definition csp.c:281
static double trc_smpte_st2084_inv(double E)
Definition csp.c:368
static double trc_smpte240M_inv(double E)
Definition csp.c:250
static double trc_iec61966_2_1_inv(double E)
Definition csp.c:336
static double trc_iec61966_2_4_inv(double E)
Definition csp.c:296
static double trc_log_inv(double E)
Definition csp.c:270
static double trc_smpte_st428_1_inv(double E)
Definition csp.c:389

Definition at line 478 of file csp.c.

Referenced by av_csp_trc_func_inv_from_id().

◆ trc_inv_funcs_ext

const av_csp_trc_function trc_inv_funcs_ext[AVCOL_TRC_EXT_NB - AVCOL_TRC_EXT_BASE]
static
Initial value:
= {
}
static double trc_v_log_inv(double E)
Definition csp.c:434

Definition at line 497 of file csp.c.

Referenced by av_csp_trc_func_inv_from_id().

◆ eotf_funcs

const av_csp_eotf_function eotf_funcs[AVCOL_TRC_NB]
static
Initial value:
= {
[AVCOL_TRC_GAMMA22] = eotf_gamma22,
[AVCOL_TRC_GAMMA28] = eotf_gamma28,
[AVCOL_TRC_IEC61966_2_1] = eotf_iec61966_2_1,
}
#define NULL
Definition coverity.c:32
static void eotf_bt1886(const double Lw, const double Lb, double E[3])
Definition csp.c:558
static void eotf_smpte_st2084(const double Lw, const double Lb, double E[3])
Definition csp.c:580
static void eotf_linear(const double Lw, const double Lb, double E[3])
Definition csp.c:512
static void eotf_arib_std_b67(const double Lw, const double Lb, double E[3])
Definition csp.c:620
static void eotf_smpte_st428_1(const double Lw_Y, const double Lb_Y, double E[3])
Definition csp.c:598

Definition at line 661 of file csp.c.

Referenced by av_csp_itu_eotf().

◆ eotf_inv_funcs

const av_csp_eotf_function eotf_inv_funcs[AVCOL_TRC_NB]
static
Initial value:
= {
[AVCOL_TRC_GAMMA22] = eotf_gamma22_inv,
[AVCOL_TRC_GAMMA28] = eotf_gamma28_inv,
[AVCOL_TRC_IEC61966_2_1] = eotf_iec61966_2_1_inv,
}
static void eotf_arib_std_b67_inv(const double Lw, const double Lb, double L[3])
Definition csp.c:643
static void eotf_linear_inv(const double Lw, const double Lb, double L[3])
Definition csp.c:518
static void eotf_smpte_st428_1_inv(const double Lw_Y, const double Lb_Y, double L[3])
Definition csp.c:609
static void eotf_smpte_st2084_inv(const double Lw, const double Lb, double L[3])
Definition csp.c:586
static void eotf_bt1886_inv(const double Lw, const double Lb, double L[3])
Definition csp.c:569

Definition at line 691 of file csp.c.

Referenced by av_csp_itu_eotf_inv().