changeset 27288:37014889f212

simplify yuv2yuv1()
author michael
date Thu, 17 Jul 2008 23:35:36 +0000
parents 910e475d3a2f
children 2c9fa9b25781
files libswscale/swscale_template.c
diffstat 1 files changed, 8 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/libswscale/swscale_template.c	Thu Jul 17 22:38:26 2008 +0000
+++ b/libswscale/swscale_template.c	Thu Jul 17 23:35:36 2008 +0000
@@ -973,29 +973,20 @@
                                     uint8_t *dest, uint8_t *uDest, uint8_t *vDest, long dstW, long chrDstW)
 {
 #ifdef HAVE_MMX
-    if (uDest)
-    {
+    long p= uDest ? 3 : 1;
+    uint8_t *src[3]= {lumSrc + dstW, chrSrc + chrDstW, chrSrc + VOFW + chrDstW};
+    uint8_t *dst[3]= {dest, uDest, vDest};
+    long counter[3] = {dstW, chrDstW, chrDstW};
+
+    while(p--){
         asm volatile(
             YSCALEYUV2YV121
-            :: "r" (chrSrc + chrDstW), "r" (uDest + chrDstW),
-            "g" (-chrDstW)
-            : "%"REG_a
-        );
-
-        asm volatile(
-            YSCALEYUV2YV121
-            :: "r" (chrSrc + VOFW + chrDstW), "r" (vDest + chrDstW),
-            "g" (-chrDstW)
+            :: "r" (src[p]), "r" (dst[p] + counter[p]),
+            "g" (-counter[p])
             : "%"REG_a
         );
     }
 
-    asm volatile(
-        YSCALEYUV2YV121
-        :: "r" (lumSrc + dstW), "r" (dest + dstW),
-        "g" (-dstW)
-        : "%"REG_a
-    );
 #else
     int i;
     for (i=0; i<dstW; i++)