Go to the documentation of this file.
29 double m00 = in[0][0], m01 = in[0][1], m02 = in[0][2],
30 m10 = in[1][0], m11 = in[1][1], m12 = in[1][2],
31 m20 = in[2][0], m21 = in[2][1], m22 = in[2][2];
35 out[0][0] = (m11 * m22 - m21 * m12);
36 out[0][1] = -(m01 * m22 - m21 * m02);
37 out[0][2] = (m01 * m12 - m11 * m02);
38 out[1][0] = -(m10 * m22 - m20 * m12);
39 out[1][1] = (m00 * m22 - m20 * m02);
40 out[1][2] = -(m00 * m12 - m10 * m02);
41 out[2][0] = (m10 * m21 - m20 * m11);
42 out[2][1] = -(m00 * m21 - m20 * m01);
43 out[2][2] = (m00 * m11 - m10 * m01);
45 det = m00 *
out[0][0] + m10 *
out[0][1] + m20 *
out[0][2];
48 for (
i = 0;
i < 3;
i++) {
49 for (j = 0; j < 3; j++)
55 const double src1[3][3],
const double src2[3][3])
59 for (m = 0; m < 3; m++)
60 for (n = 0; n < 3; n++)
70 for (m = 0; m < 3; m++)
71 dst[m] = vec[0] * mat[m][0] +
83 double i[3][3], sr, sg, sb, zw;
89 rgb2xyz[0][0] = xr / yr;
90 rgb2xyz[0][1] = xg / yg;
91 rgb2xyz[0][2] = xb / yb;
92 rgb2xyz[1][0] = rgb2xyz[1][1] = rgb2xyz[1][2] = 1.0;
93 rgb2xyz[2][0] = (1.0 - xr - yr) / yr;
94 rgb2xyz[2][1] = (1.0 - xg - yg) / yg;
95 rgb2xyz[2][2] = (1.0 - xb - yb) / yb;
98 sr =
i[0][0] * xw +
i[0][1] * yw +
i[0][2] * zw;
99 sg =
i[1][0] * xw +
i[1][1] * yw +
i[1][2] * zw;
100 sb =
i[2][0] * xw +
i[2][1] * yw +
i[2][2] * zw;
114 { -0.25, 0.5, -0.25 },
128 double bscale, rscale;
132 if (
cr == 0.25 && cg == 0.5 &&
cb == 0.25) {
135 }
else if (
cr == 1 && cg == 1 &&
cb == 1) {
143 bscale = 0.5 / (
cb - 1.0);
144 rscale = 0.5 / (
cr - 1.0);
enum AVColorTransferCharacteristic color_trc
static const double gbr_matrix[3][3]
static double cb(void *priv, double x, double y)
AVFrameSideData * av_frame_get_side_data(const AVFrame *frame, enum AVFrameSideDataType type)
void ff_matrix_invert_3x3(const double in[3][3], double out[3][3])
static const double ycgco_matrix[3][3]
unsigned MaxCLL
Max content light level (cd/m^2).
This structure describes decoded (raw) audio or video data.
static const char rgb2yuv[]
double ff_determine_signal_peak(AVFrame *in)
Struct containing luma coefficients to be used for RGB to YUV/YCoCg, or similar calculations.
Content light level needed by to transmit HDR over HDMI (CTA-861.3).
Struct defining the red, green, and blue primary locations in terms of CIE 1931 chromaticity x and y.
static double av_q2d(AVRational a)
Convert an AVRational to a double.
void ff_matrix_mul_3x3_vec(double dst[3], const double vec[3], const double mat[3][3])
void ff_matrix_mul_3x3(double dst[3][3], const double src1[3][3], const double src2[3][3])
@ AV_FRAME_DATA_MASTERING_DISPLAY_METADATA
Mastering display metadata associated with a video frame.
Struct containing chromaticity x and y values for the standard CIE 1931 chromaticity definition.
@ AVCOL_TRC_SMPTE2084
SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems.
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
void ff_update_hdr_metadata(AVFrame *in, double peak)
void ff_fill_rgb2yuv_table(const AVLumaCoefficients *coeffs, double rgb2yuv[3][3])
@ AV_FRAME_DATA_CONTENT_LIGHT_LEVEL
Content light level (based on CTA-861.3).
#define i(width, name, range_min, range_max)
AVRational av_d2q(double d, int max)
Convert a double precision floating point number to a rational.
void ff_fill_rgb2xyz_table(const AVPrimaryCoefficients *coeffs, const AVWhitepointCoefficients *wp, double rgb2xyz[3][3])
Structure to hold side data for an AVFrame.
static double cr(void *priv, double x, double y)