summaryrefslogtreecommitdiff
path: root/libavfilter/colorspace.h
diff options
context:
space:
mode:
authorNiklas Haas <git@haasn.dev>2022-04-09 18:40:59 +0200
committerNiklas Haas <git@haasn.dev>2022-04-23 21:51:55 +0200
commit6d83036662226f25ff0662b87b7455c77b985f5d (patch)
tree4d1b2ba85ce3d80c71176a3b36774c31e3b69373 /libavfilter/colorspace.h
parent3ac23440ef4a5a203f53b33325fa38b2e8afa219 (diff)
downloadffmpeg-6d83036662226f25ff0662b87b7455c77b985f5d.tar.gz
lavfi: generalize colorspace coefficent helpers
These are needed beyond just vf_colorspace, so give them a new home in colorspace.h. In addition to moving code around, also merge the white point and primary coefficients into a single struct to slightly increase the convenience and shrink the size of the new API by avoiding the need to introduce an extra function just to look up the white point as well. The only place the distinction matters is in a single enum comparison, which can just as well be a single memcpy - the difference is negligible. Signed-off-by: Niklas Haas <git@haasn.dev>
Diffstat (limited to 'libavfilter/colorspace.h')
-rw-r--r--libavfilter/colorspace.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/libavfilter/colorspace.h b/libavfilter/colorspace.h
index a4c5078d5f..fc415fed05 100644
--- a/libavfilter/colorspace.h
+++ b/libavfilter/colorspace.h
@@ -37,6 +37,11 @@ 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]);
@@ -44,6 +49,7 @@ void ff_fill_rgb2xyz_table(const struct PrimaryCoefficients *coeffs,
const struct WhitepointCoefficients *wp,
double rgb2xyz[3][3]);
+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,
double rgb2yuv[3][3]);