--- colorspace.c 2003/02/22 08:49:45 1.8.2.1 +++ colorspace.c 2003/10/01 23:23:01 1.8.2.4 @@ -1,42 +1,34 @@ -/************************************************************************** +/***************************************************************************** * - * XVID MPEG-4 VIDEO CODEC - * colorspace conversions + * XVID MPEG-4 VIDEO CODEC + * - Colorspace conversion functions - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * Copyright(C) 2001-2003 Peter Ross * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is free software ; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation ; either version 2 of the License, or + * (at your option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY ; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - *************************************************************************/ - -/************************************************************************** - * - * History: + * You should have received a copy of the GNU General Public License + * along with this program ; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * 14.04.2002 added user_to_yuv_c() - * 30.02.2002 out_yuv dst_stride2 fix - * 26.02.2002 rgb555, rgb565 - * 24.11.2001 accuracy improvement to yuyv/vyuy conversion - * 28.10.2001 total rewrite + * $Id: colorspace.c,v 1.8.2.4 2003/10/01 23:23:01 edgomez Exp $ * - **************************************************************************/ + ****************************************************************************/ -#include // memcpy +#include /* memcpy */ #include "../global.h" #include "colorspace.h" -// function pointers +/* function pointers */ /* input */ packedFuncPtr rgb555_to_yv12; @@ -135,7 +127,7 @@ Video Demystified" (ISBN 1-878707-09-4) rgb<->yuv _is_ lossy, since most programs do the conversion differently - + SCALEBITS/FIX taken from ffmpeg */ @@ -230,7 +222,7 @@ b##UVID += b = x_ptr[(ROW)*x_stride+(SIZE)+(C3)]; \ y_ptr[(ROW)*y_stride+1] = \ (uint8_t) ((FIX_IN(Y_R_IN) * r + FIX_IN(Y_G_IN) * g + \ - FIX_IN(Y_B_IN) * b) >> SCALEBITS_IN) + Y_ADD_IN; + FIX_IN(Y_B_IN) * b) >> SCALEBITS_IN) + Y_ADD_IN; #define READ_RGB_UV(UV_ROW,UVID) \ u_ptr[(UV_ROW)*uv_stride] = \ @@ -380,7 +372,7 @@ WRITE_RGB16(1, 1, C1) \ WRITE_RGB16(2, 0, C1) \ WRITE_RGB16(3, 1, C1) \ - + /* rgb/rgbi output */ @@ -432,7 +424,7 @@ #define YV12_TO_YUYV_ROW(SIZE,C1,C2,C3,C4) /* nothing */ #define YV12_TO_YUYV(SIZE,C1,C2,C3,C4) \ WRITE_YUYV(0, 0, C1,C2,C3,C4) \ - WRITE_YUYV(1, 0, C1,C2,C3,C4) + WRITE_YUYV(1, 0, C1,C2,C3,C4) #define YV12_TO_YUYVI_ROW(SIZE,C1,C2,C3,C4) /* nothing */ #define YV12_TO_YUYVI(SIZE,C1,C2,C3,C4) \ @@ -465,9 +457,9 @@ /* yv12 to yv12 copy function */ void -yv12_to_yv12_c(uint8_t * y_dst, uint8_t * u_dst, uint8_t * v_dst, +yv12_to_yv12_c(uint8_t * y_dst, uint8_t * u_dst, uint8_t * v_dst, int y_dst_stride, int uv_dst_stride, - uint8_t * y_src, uint8_t * u_src, uint8_t * v_src, + uint8_t * y_src, uint8_t * u_src, uint8_t * v_src, int y_src_stride, int uv_src_stride, int width, int height, int vflip) {