From 42b5fcb890d6558167f5340b225caf149e75b5f7 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Mon, 5 Nov 2001 18:26:49 +0000 Subject: [PATCH] fixed yv12toyuy2 Originally committed as revision 2724 to svn://svn.mplayerhq.hu/mplayer/trunk/postproc --- postproc/rgb2rgb.c | 101 +++++++++++++++++++++--------------- postproc/rgb2rgb.h | 4 +- postproc/rgb2rgb_template.c | 101 +++++++++++++++++++++--------------- 3 files changed, 118 insertions(+), 88 deletions(-) diff --git a/postproc/rgb2rgb.c b/postproc/rgb2rgb.c index ddb805bbc..5d538ec7a 100644 --- a/postproc/rgb2rgb.c +++ b/postproc/rgb2rgb.c @@ -291,56 +291,71 @@ void palette8torgb15(const uint8_t *src, uint8_t *dst, unsigned num_pixels, cons } /** * - * num_pixels must be a multiple of 16 for the MMX version + * width must be a multiple of 16 for the MMX version */ -void yv12toyuy2(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst, unsigned num_pixels) +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) { + int y; + const int chromWidth= width>>1; + for(y=0; y>1) - : "memory", "%eax" - ); + MOVNTQ" %%mm3, (%0, %%eax, 4) \n\t" + MOVNTQ" %%mm4, 8(%0, %%eax, 4) \n\t" + MOVNTQ" %%mm5, 16(%0, %%eax, 4) \n\t" + MOVNTQ" %%mm6, 24(%0, %%eax, 4) \n\t" + "addl $8, %%eax \n\t" + "cmpl %4, %%eax \n\t" + " jb 1b \n\t" + ::"r"(dst), "r"(ysrc), "r"(usrc), "r"(vsrc), "r" (chromWidth) + : "%eax" + ); #else - int i; - num_pixels>>=1; - for(i=0; i>1; + for(y=0; y>1) - : "memory", "%eax" - ); + MOVNTQ" %%mm3, (%0, %%eax, 4) \n\t" + MOVNTQ" %%mm4, 8(%0, %%eax, 4) \n\t" + MOVNTQ" %%mm5, 16(%0, %%eax, 4) \n\t" + MOVNTQ" %%mm6, 24(%0, %%eax, 4) \n\t" + "addl $8, %%eax \n\t" + "cmpl %4, %%eax \n\t" + " jb 1b \n\t" + ::"r"(dst), "r"(ysrc), "r"(usrc), "r"(vsrc), "r" (chromWidth) + : "%eax" + ); #else - int i; - num_pixels>>=1; - for(i=0; i