27 printf(
" %s=(%d/%d, %d/%d)\n", label,
47 printf(
"Testing av_csp_luma_coeffs_from_avcsp()\n");
55 printf(
"csp=%-16s -> cr=%d/%d cg=%d/%d cb=%d/%d\n",
59 c->cb.num,
c->cb.den);
62 printf(
"csp=AVCOL_SPC_NB -> %s\n",
66 printf(
"\nTesting av_csp_primaries_desc_from_id() round trip\n");
71 const char *
name, *back_name, *status;
100 status = d_back &&
desc_eq(d, d_back) ?
"OK" :
"MISMATCH";
101 printf(
" round-trip id=%-16s desc=%s\n",
102 back_name ? back_name :
"?", status);
105 printf(
"prm=AVCOL_PRI_NB -> %s\n",
111 .wp = { { 0, 1 }, { 0, 1 } },
113 .r = { { 0, 1 }, { 0, 1 } },
114 .g = { { 0, 1 }, { 0, 1 } },
115 .b = { { 0, 1 }, { 0, 1 } },
119 printf(
"garbage desc -> %s (expect AVCOL_PRI_UNSPECIFIED)\n",
125 printf(
"\nTesting av_csp_approximate_{trc,eotf}_gamma()\n");
128 double g_trc, g_eotf;
136 printf(
"trc=%-16s trc_gamma=%.6f eotf_gamma=%.6f\n",
140 printf(
"trc=AVCOL_TRC_NB trc_gamma=%.6f eotf_gamma=%.6f\n",
static const uint8_t garbage[]
Colorspace value utility functions for libavutil.
__device__ int printf(const char *,...)
const struct AVLumaCoefficients * av_csp_luma_coeffs_from_avcsp(enum AVColorSpace csp)
Retrieves the Luma coefficients necessary to construct a conversion matrix from an enum constant desc...
enum AVColorPrimaries av_csp_primaries_id_from_desc(const AVColorPrimariesDesc *prm)
Detects which enum AVColorPrimaries constant corresponds to the given complete gamut description.
const AVColorPrimariesDesc * av_csp_primaries_desc_from_id(enum AVColorPrimaries prm)
Retrieves a complete gamut description from an enum constant describing the color primaries.
double av_csp_approximate_eotf_gamma(enum AVColorTransferCharacteristic trc)
Determine a suitable EOTF 'gamma' value to match the supplied AVColorTransferCharacteristic.
double av_csp_approximate_trc_gamma(enum AVColorTransferCharacteristic trc)
Determine a suitable 'gamma' value to match the supplied AVColorTransferCharacteristic.
static int av_cmp_q(AVRational a, AVRational b)
Compare two rationals.
const char * av_color_space_name(enum AVColorSpace space)
const char * av_color_transfer_name(enum AVColorTransferCharacteristic transfer)
const char * av_color_primaries_name(enum AVColorPrimaries primaries)
AVColorPrimaries
Chromaticity coordinates of the source primaries.
@ AVCOL_PRI_NB
Not part of ABI.
@ AVCOL_PRI_EXT_NB
Not part of ABI.
AVColorTransferCharacteristic
Color Transfer Characteristic.
@ AVCOL_TRC_EXT_NB
Not part of ABI.
@ AVCOL_TRC_NB
Not part of ABI.
AVColorSpace
YUV colorspace type.
@ AVCOL_SPC_NB
Not part of ABI.
Struct containing chromaticity x and y values for the standard CIE 1931 chromaticity definition.
Struct that contains both white point location and primaries location, providing the complete descrip...
AVWhitepointCoefficients wp
AVPrimaryCoefficients prim
Struct containing luma coefficients to be used for RGB to YUV/YCoCg, or similar calculations.
static int cie_eq(AVCIExy a, AVCIExy b)
static int desc_eq(const AVColorPrimariesDesc *a, const AVColorPrimariesDesc *b)
static void print_cie(const char *label, AVCIExy xy)