# HG changeset patch # User michael # Date 1043314522 0 # Node ID 25baacd1c650a556c15a7ee748b64e58038220cb # Parent 8b2dde0dccf636c6c89062036c31b8e6e36eddc2 UYVY input diff -r 8b2dde0dccf6 -r 25baacd1c650 libmpcodecs/vf_scale.c --- a/libmpcodecs/vf_scale.c Thu Jan 23 04:19:24 2003 +0000 +++ b/libmpcodecs/vf_scale.c Thu Jan 23 09:35:22 2003 +0000 @@ -219,13 +219,14 @@ //===========================================================================// -// supported Input formats: YV12, I420, IYUV, YUY2, BGR32, BGR24, BGR16, BGR15, RGB32, RGB24, Y8, Y800 +// supported Input formats: YV12, I420, IYUV, YUY2, UYVY, BGR32, BGR24, BGR16, BGR15, RGB32, RGB24, Y8, Y800 static int query_format(struct vf_instance_s* vf, unsigned int fmt){ switch(fmt){ case IMGFMT_YV12: case IMGFMT_I420: case IMGFMT_IYUV: + case IMGFMT_UYVY: case IMGFMT_YUY2: case IMGFMT_BGR32: case IMGFMT_BGR24: diff -r 8b2dde0dccf6 -r 25baacd1c650 postproc/swscale.c --- a/postproc/swscale.c Thu Jan 23 04:19:24 2003 +0000 +++ b/postproc/swscale.c Thu Jan 23 09:35:22 2003 +0000 @@ -17,7 +17,7 @@ */ /* - supported Input formats: YV12, I420/IYUV, YUY2, BGR32, BGR24, BGR16, BGR15, RGB32, RGB24, Y8/Y800, YVU9/IF09 + supported Input formats: YV12, I420/IYUV, YUY2, UYVY, BGR32, BGR24, BGR16, BGR15, RGB32, RGB24, Y8/Y800, YVU9/IF09 supported output formats: YV12, I420/IYUV, YUY2, {BGR,RGB}{1,4,8,15,16,24,32}, Y8/Y800, YVU9/IF09 {BGR,RGB}{1,4,8,15,16} support dithering @@ -105,11 +105,11 @@ //FIXME replace this with something faster #define isPlanarYUV(x) ((x)==IMGFMT_YV12 || (x)==IMGFMT_I420 || (x)==IMGFMT_YVU9 \ || (x)==IMGFMT_444P || (x)==IMGFMT_422P || (x)==IMGFMT_411P) -#define isYUV(x) ((x)==IMGFMT_YUY2 || isPlanarYUV(x)) +#define isYUV(x) ((x)==IMGFMT_UYVY || (x)==IMGFMT_YUY2 || isPlanarYUV(x)) #define isGray(x) ((x)==IMGFMT_Y800) #define isRGB(x) (((x)&IMGFMT_RGB_MASK)==IMGFMT_RGB) #define isBGR(x) (((x)&IMGFMT_BGR_MASK)==IMGFMT_BGR) -#define isSupportedIn(x) ((x)==IMGFMT_YV12 || (x)==IMGFMT_I420 || (x)==IMGFMT_YUY2 \ +#define isSupportedIn(x) ((x)==IMGFMT_YV12 || (x)==IMGFMT_I420 || (x)==IMGFMT_YUY2 || (x)==IMGFMT_UYVY\ || (x)==IMGFMT_BGR32|| (x)==IMGFMT_BGR24|| (x)==IMGFMT_BGR16|| (x)==IMGFMT_BGR15\ || (x)==IMGFMT_RGB32|| (x)==IMGFMT_RGB24\ || (x)==IMGFMT_Y800 || (x)==IMGFMT_YVU9\ @@ -118,7 +118,7 @@ || (x)==IMGFMT_444P || (x)==IMGFMT_422P || (x)==IMGFMT_411P\ || isRGB(x) || isBGR(x)\ || (x)==IMGFMT_Y800 || (x)==IMGFMT_YVU9) -#define isPacked(x) ((x)==IMGFMT_YUY2 || isRGB(x) || isBGR(x)) +#define isPacked(x) ((x)==IMGFMT_YUY2 || (x)==IMGFMT_UYVY ||isRGB(x) || isBGR(x)) #define RGB2YUV_SHIFT 16 #define BY ((int)( 0.098*(1<>1; + dstV[i]= (src1[4*i + 2] + src2[4*i + 2])>>1; + } +#endif +} + static inline void RENAME(bgr32ToY)(uint8_t *dst, uint8_t *src, int width) { #ifdef HAVE_MMXFIXME @@ -2113,6 +2176,11 @@ RENAME(yuy2ToY)(formatConvBuffer, src, srcW); src= formatConvBuffer; } + else if(srcFormat==IMGFMT_UYVY) + { + RENAME(uyvyToY)(formatConvBuffer, src, srcW); + src= formatConvBuffer; + } else if(srcFormat==IMGFMT_BGR32) { RENAME(bgr32ToY)(formatConvBuffer, src, srcW); @@ -2265,6 +2333,12 @@ src1= formatConvBuffer; src2= formatConvBuffer+2048; } + else if(srcFormat==IMGFMT_UYVY) + { + RENAME(uyvyToUV)(formatConvBuffer, formatConvBuffer+2048, src1, src2, srcW); + src1= formatConvBuffer; + src2= formatConvBuffer+2048; + } else if(srcFormat==IMGFMT_BGR32) { RENAME(bgr32ToUV)(formatConvBuffer, formatConvBuffer+2048, src1, src2, srcW);