summaryrefslogtreecommitdiff
path: root/libavfilter/colorspace.h
diff options
context:
space:
mode:
authorNiklas Haas <git@haasn.dev>2022-04-11 01:25:26 +0200
committerNiklas Haas <git@haasn.dev>2022-04-23 21:51:55 +0200
commit072dd047f0e7830bbc51c893bed91d8ba5e4f788 (patch)
tree641d8a2cb715f6e32717aac880edd7148e740ba9 /libavfilter/colorspace.h
parent6d83036662226f25ff0662b87b7455c77b985f5d (diff)
downloadffmpeg-072dd047f0e7830bbc51c893bed91d8ba5e4f788.tar.gz
lavfi: add ff_detect_color_primaries helper
Related to #9673, this helper exists to facilitate "guessing" the right primary tags from a given set of raw primary coefficients. The cutoff value of 0.001 was chosen by experimentation. The smallest "false positive" delta observed in practice was 0.023329, while the largest "false negative" delta was 0.00016. So, a value of 0.001 sits comfortably in the middle. Signed-off-by: Niklas Haas <git@haasn.dev>
Diffstat (limited to 'libavfilter/colorspace.h')
-rw-r--r--libavfilter/colorspace.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavfilter/colorspace.h b/libavfilter/colorspace.h
index fc415fed05..6959133a49 100644
--- a/libavfilter/colorspace.h
+++ b/libavfilter/colorspace.h
@@ -49,6 +49,9 @@ void ff_fill_rgb2xyz_table(const struct PrimaryCoefficients *coeffs,
const struct WhitepointCoefficients *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,