From be3a541c64eaff129a1d6a70b4241aab34187d14 Mon Sep 17 00:00:00 2001 From: Michael Roitzsch Date: Sun, 11 Jul 2004 21:38:05 +0000 Subject: PNGs are rendered too bright because the conversion coefficients are wrong CVS patchset: 6789 CVS date: 2004/07/11 21:38:05 --- src/libxinevdec/image.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/libxinevdec/image.c b/src/libxinevdec/image.c index 72c2e7366..d82b1f194 100644 --- a/src/libxinevdec/image.c +++ b/src/libxinevdec/image.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: image.c,v 1.14 2004/01/12 17:35:18 miguelfreitas Exp $ + * $Id: image.c,v 1.15 2004/07/11 21:38:05 mroi Exp $ * * a image video decoder */ @@ -208,6 +208,7 @@ static void row_callback(png_structp png_ptr, png_bytep new_row, #define FIX(x) ( (int32_t) ( (x) * (1<rows[row]+col*3); g = *(this->rows[row]+col*3+1); b = *(this->rows[row]+col*3+2); - y = (FIX(0.299) * r + FIX(0.587) * g + FIX(0.114) * b + ONE_HALF) + y = (FIX(0.257) * r + FIX(0.504) * g + FIX(0.098) * b + ONE_HALF + FOOTROOM) >> SCALEBITS; if (!(col & 0x0001)) { /* even pixel, do u */ - u = (- FIX(0.16874) * r - FIX(0.33126) * g + FIX(0.5) * b + u = (- FIX(0.148) * r - FIX(0.291) * g + FIX(0.439) * b + CBCR_OFFSET + ONE_HALF-1) >> SCALEBITS; *out = ( (uint16_t) u << 8) | (uint16_t) y; } else { /* odd pixel, do v */ - v = (FIX(0.5) * r - FIX(0.41869) * g - FIX(0.08131) * b + v = (FIX(0.439) * r - FIX(0.368) * g - FIX(0.071) * b + CBCR_OFFSET + ONE_HALF-1) >> SCALEBITS; *out = ( (uint16_t) v << 8) | (uint16_t) y; } -- cgit v1.2.3