From 9e480850432c05e20bcb4c6d296bb08e5c757d18 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 9 May 2020 17:57:48 +0200 Subject: 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. --- video/csputils.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'video/csputils.h') diff --git a/video/csputils.h b/video/csputils.h index fc6f04db6a..dfc2a569cc 100644 --- a/video/csputils.h +++ b/video/csputils.h @@ -162,6 +162,8 @@ struct mp_csp_params { float gamma; // discard U/V components bool gray; + // input is already centered and range-expanded + bool is_float; // texture_bits/input_bits is for rescaling fixed point input to range [0,1] int texture_bits; int input_bits; -- cgit v1.2.3