# HG changeset patch # User michael # Date 1004990111 0 # Node ID 5bba527c9a4c2d461824786b7f4e15d13bef8dd1 # Parent c08b7af267824a6a69a78bdf82080593a7a7b055 unsigned stuff diff -r c08b7af26782 -r 5bba527c9a4c postproc/rgb2rgb.c --- a/postproc/rgb2rgb.c Mon Nov 05 18:50:58 2001 +0000 +++ b/postproc/rgb2rgb.c Mon Nov 05 19:55:11 2001 +0000 @@ -295,7 +295,8 @@ * 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) + unsigned int width, unsigned int height, + unsigned int lumStride, unsigned int chromStride, unsigned int dstStride) { int y; const int chromWidth= width>>1; @@ -366,7 +367,8 @@ * 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) + unsigned int width, unsigned int height, + unsigned int lumStride, unsigned int chromStride, unsigned int srcStride) { int y; const int chromWidth= width>>1; @@ -420,7 +422,12 @@ "addl $8, %%eax \n\t" "cmpl %4, %%eax \n\t" " jb 1b \n\t" + ::"r"(src), "r"(ydst), "r"(udst), "r"(vdst), "r" (chromWidth) + : "memory", "%eax" + ); + asm volatile( + "xorl %%eax, %%eax \n\t" "1: \n\t" PREFETCH" 64(%0, %%eax, 4) \n\t" "movq (%0, %%eax, 4), %%mm0 \n\t" // YUYV YUYV(0) @@ -438,10 +445,10 @@ MOVNTQ" %%mm2, 8(%1, %%eax, 2) \n\t" "addl $8, %%eax \n\t" - "cmpl %5, %%eax \n\t" + "cmpl %4, %%eax \n\t" " jb 1b \n\t" - ::"r"(src), "r"(ydst), "r"(udst), "r"(vdst), "r" (chromWidth), "m"(width) + ::"r"(src+srcStride), "r"(ydst+lumStride), "r"(udst), "r"(vdst), "r" (chromWidth) : "memory", "%eax" ); #else diff -r c08b7af26782 -r 5bba527c9a4c postproc/rgb2rgb.h --- a/postproc/rgb2rgb.h Mon Nov 05 18:50:58 2001 +0000 +++ b/postproc/rgb2rgb.h Mon Nov 05 19:55:11 2001 +0000 @@ -22,8 +22,10 @@ extern void palette8torgb24(const uint8_t *src, uint8_t *dst, unsigned num_pixels, const uint8_t *palette); extern 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); + unsigned int width, unsigned int height, + unsigned int lumStride, unsigned int chromStride, unsigned int dstStride); extern 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); + unsigned int width, unsigned int height, + unsigned int lumStride, unsigned int chromStride, unsigned int srcStride); #endif diff -r c08b7af26782 -r 5bba527c9a4c postproc/rgb2rgb_template.c --- a/postproc/rgb2rgb_template.c Mon Nov 05 18:50:58 2001 +0000 +++ b/postproc/rgb2rgb_template.c Mon Nov 05 19:55:11 2001 +0000 @@ -295,7 +295,8 @@ * 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) + unsigned int width, unsigned int height, + unsigned int lumStride, unsigned int chromStride, unsigned int dstStride) { int y; const int chromWidth= width>>1; @@ -366,7 +367,8 @@ * 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) + unsigned int width, unsigned int height, + unsigned int lumStride, unsigned int chromStride, unsigned int srcStride) { int y; const int chromWidth= width>>1; @@ -420,7 +422,12 @@ "addl $8, %%eax \n\t" "cmpl %4, %%eax \n\t" " jb 1b \n\t" + ::"r"(src), "r"(ydst), "r"(udst), "r"(vdst), "r" (chromWidth) + : "memory", "%eax" + ); + asm volatile( + "xorl %%eax, %%eax \n\t" "1: \n\t" PREFETCH" 64(%0, %%eax, 4) \n\t" "movq (%0, %%eax, 4), %%mm0 \n\t" // YUYV YUYV(0) @@ -438,10 +445,10 @@ MOVNTQ" %%mm2, 8(%1, %%eax, 2) \n\t" "addl $8, %%eax \n\t" - "cmpl %5, %%eax \n\t" + "cmpl %4, %%eax \n\t" " jb 1b \n\t" - ::"r"(src), "r"(ydst), "r"(udst), "r"(vdst), "r" (chromWidth), "m"(width) + ::"r"(src+srcStride), "r"(ydst+lumStride), "r"(udst), "r"(vdst), "r" (chromWidth) : "memory", "%eax" ); #else