summaryrefslogtreecommitdiffstats
path: root/video/csputils.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2020-05-09 18:00:15 +0200
committerwm4 <wm4@nowhere>2020-05-09 18:02:57 +0200
commitbf19f34960ef1664ef8da614aa1b034003fcbc0f (patch)
treef5a7226c4ca5bd377917a30518eed19bf9617dea /video/csputils.h
parent56dbbc38479bd84905ac4478b1b853e907a583dd (diff)
downloadmpv-bf19f34960ef1664ef8da614aa1b034003fcbc0f.tar.bz2
mpv-bf19f34960ef1664ef8da614aa1b034003fcbc0f.tar.xz
csputils: add function for getting uint/float transformation
This provides a way to convert YUV in fixed point (or pseudo-fixed point; probably best to say "uint") to float, or rather coefficients to perform such a conversion. Things like colorspace conversion is out of scope, so this is simple and strictly per-component. This is somewhat similar to mp_get_csp_mul(), but includes proper color range expansion and correct chroma centering. The old function even seems to have a bug, and assumes something about shifted range for full range YCbCr, which is wrong. vo_gpu should probably use the new function eventually.
Diffstat (limited to 'video/csputils.h')
-rw-r--r--video/csputils.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/video/csputils.h b/video/csputils.h
index dfc2a569cc..34e2894a28 100644
--- a/video/csputils.h
+++ b/video/csputils.h
@@ -288,6 +288,8 @@ void mp_get_cms_matrix(struct mp_csp_primaries src, struct mp_csp_primaries dest
enum mp_render_intent intent, float cms_matrix[3][3]);
double mp_get_csp_mul(enum mp_csp csp, int input_bits, int texture_bits);
+void mp_get_csp_uint_mul(enum mp_csp csp, enum mp_csp_levels levels,
+ int bits, int component, double *out_m, double *out_o);
void mp_get_csp_matrix(struct mp_csp_params *params, struct mp_cmat *out);
void mp_invert_matrix3x3(float m[3][3]);