diff options
author | wm4 <wm4@nowhere> | 2020-05-09 17:57:48 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2020-05-09 18:02:57 +0200 |
commit | 9e480850432c05e20bcb4c6d296bb08e5c757d18 (patch) | |
tree | 3ded761c41ae8793b3a2e1fc426e5b2daea51906 /video/csputils.c | |
parent | 4019c113140ff4841607c84598f2ce5912464f9b (diff) | |
download | mpv-9e480850432c05e20bcb4c6d296bb08e5c757d18.tar.bz2 mpv-9e480850432c05e20bcb4c6d296bb08e5c757d18.tar.xz |
vo_gpu: fix green shit with float yuv input
This was incorrect at least because the colorspace matrix attempted to
center chroma at (conceptually) 0.5, instead of 0. Also, it tried to
apply the fixed point shift logic for component sizes > 8 bit.
There is no float yuv format in mpv/ffmpeg yet, but see next commit,
which enables zimg to output it. I'm assuming zimg defines this format
such that luma is in range [0,1] and chroma in range [-0.5,0.5], with
the levels flag being ignored. This is consistent with H264/5 Annex E (I
think...), and it sort of seems to look right, so that's it.
Diffstat (limited to 'video/csputils.c')
-rw-r--r-- | video/csputils.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/video/csputils.c b/video/csputils.c index ef26813af0..8965b1324c 100644 --- a/video/csputils.c +++ b/video/csputils.c @@ -738,6 +738,9 @@ void mp_get_csp_matrix(struct mp_csp_params *params, struct mp_cmat *m) abort(); }; + if (params->is_float) + levels_in = -1; + if ((colorspace == MP_CSP_BT_601 || colorspace == MP_CSP_BT_709 || colorspace == MP_CSP_SMPTE_240M || colorspace == MP_CSP_BT_2020_NC)) { |