From f384349dfb857247a9f0dcc367b501eea4b0d520 Mon Sep 17 00:00:00 2001 From: reimar Date: Sun, 25 Sep 2005 16:17:03 +0000 Subject: [PATCH] contrast 0 should lead to a grey, not a black image git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@16590 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/gl_common.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libvo/gl_common.c b/libvo/gl_common.c index 936c4618a3..63f70cee90 100644 --- a/libvo/gl_common.c +++ b/libvo/gl_common.c @@ -563,6 +563,11 @@ static void glSetupYUVFragprog(float brightness, float contrast, rc = (-16 * ry + (-128) * ru + (-128) * rv) / 255.0 + brightness; gc = (-16 * gy + (-128) * gu + (-128) * gv) / 255.0 + brightness; bc = (-16 * by + (-128) * bu + (-128) * bv) / 255.0 + brightness; + // these "center" contrast control so that e.g. a contrast of 0 + // leads to a grey image, not a black one + rc += 0.5 - contrast / 2.0; + gc += 0.5 - contrast / 2.0; + bc += 0.5 - contrast / 2.0; rgamma = 1.0 / rgamma; ggamma = 1.0 / ggamma; bgamma = 1.0 / bgamma;