# HG changeset patch # User michael # Date 1004986258 0 # Node ID c08b7af267824a6a69a78bdf82080593a7a7b055 # Parent 22aba8af94af3766617d2b30b7a2f9b8c719fb42 yuy2toyv12 fixed and speedup diff -r 22aba8af94af -r c08b7af26782 postproc/rgb2rgb.c --- a/postproc/rgb2rgb.c Mon Nov 05 18:26:49 2001 +0000 +++ b/postproc/rgb2rgb.c Mon Nov 05 18:50:58 2001 +0000 @@ -291,7 +291,8 @@ } /** * - * width must be a multiple of 16 for the MMX version + * height should be a multiple of 2 and width should be a multiple of 16 (if this is a + * problem for anyone then tell me, and ill fix it) */ void yv12toyuy2(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst, int width, int height, int lumStride, int chromStride, int dstStride) @@ -359,70 +360,116 @@ #endif } -void yuy2toyv12(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst, unsigned num_pixels) +/** + * + * height should be a multiple of 2 and width should be a multiple of 16 (if this is a + * problem for anyone then tell me, and ill fix it) + */ +void yuy2toyv12(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst, + int width, int height, int lumStride, int chromStride, int srcStride) { + int y; + const int chromWidth= width>>1; + for(y=0; y>1) - : "memory", "%eax" - ); + ::"r"(src), "r"(ydst), "r"(udst), "r"(vdst), "r" (chromWidth), "m"(width) + : "memory", "%eax" + ); #else - int i; - num_pixels>>=1; - for(i=0; i>1; + for(y=0; y>1) - : "memory", "%eax" - ); + ::"r"(src), "r"(ydst), "r"(udst), "r"(vdst), "r" (chromWidth), "m"(width) + : "memory", "%eax" + ); #else - int i; - num_pixels>>=1; - for(i=0; i