summaryrefslogtreecommitdiff
path: root/libavfilter/colorspace.h
diff options
context:
space:
mode:
authorLeo Izen <leo.izen@gmail.com>2022-05-28 09:30:36 -0400
committerRonald S. Bultje <rsbultje@gmail.com>2022-06-01 13:52:38 -0400
commitd42b410e05ad1c4d6e74aa981b4a4423103291fb (patch)
treeef3a78871469fd303caa770e888d78779998d030 /libavfilter/colorspace.h
parent77b529fbd228fe30a870e3157f051885b436ad92 (diff)
downloadffmpeg-d42b410e05ad1c4d6e74aa981b4a4423103291fb.tar.gz
avutil/csp: create public API for colorspace structs
This commit moves some of the functionality from avfilter/colorspace into avutil/csp and exposes it as a public API so it can be used by libavcodec and/or libavformat. It also converts those structs from double values to AVRational to make regression testing easier and more consistent. Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
Diffstat (limited to 'libavfilter/colorspace.h')
-rw-r--r--libavfilter/colorspace.h31
1 files changed, 4 insertions, 27 deletions
diff --git a/libavfilter/colorspace.h b/libavfilter/colorspace.h
index 6959133a49..879518d242 100644
--- a/libavfilter/colorspace.h
+++ b/libavfilter/colorspace.h
@@ -20,43 +20,20 @@
#ifndef AVFILTER_COLORSPACE_H
#define AVFILTER_COLORSPACE_H
+#include "libavutil/csp.h"
#include "libavutil/frame.h"
#include "libavutil/pixfmt.h"
#define REFERENCE_WHITE 100.0f
-struct LumaCoefficients {
- double cr, cg, cb;
-};
-
-struct PrimaryCoefficients {
- double xr, yr, xg, yg, xb, yb;
-};
-
-struct WhitepointCoefficients {
- double xw, yw;
-};
-
-struct ColorPrimaries {
- struct WhitepointCoefficients wp;
- struct PrimaryCoefficients prim;
-};
-
void ff_matrix_invert_3x3(const double in[3][3], double out[3][3]);
void ff_matrix_mul_3x3(double dst[3][3],
const double src1[3][3], const double src2[3][3]);
-void ff_fill_rgb2xyz_table(const struct PrimaryCoefficients *coeffs,
- const struct WhitepointCoefficients *wp,
+void ff_fill_rgb2xyz_table(const AVPrimaryCoefficients *coeffs,
+ const AVWhitepointCoefficients *wp,
double rgb2xyz[3][3]);
-
-/* Returns AVCOL_PRI_UNSPECIFIED if no clear match can be identified */
-enum AVColorPrimaries ff_detect_color_primaries(const struct ColorPrimaries *prm);
-
-const struct ColorPrimaries *ff_get_color_primaries(enum AVColorPrimaries prm);
-const struct LumaCoefficients *ff_get_luma_coefficients(enum AVColorSpace csp);
-void ff_fill_rgb2yuv_table(const struct LumaCoefficients *coeffs,
+void ff_fill_rgb2yuv_table(const AVLumaCoefficients *coeffs,
double rgb2yuv[3][3]);
-
double ff_determine_signal_peak(AVFrame *in);
void ff_update_hdr_metadata(AVFrame *in, double peak);