[FFmpeg-cvslog] r30327 - in trunk/libswscale: swscale.c swscale_internal.h swscale_template.c

ramiro subversion
Sat Jan 16 19:39:07 CET 2010


Author: ramiro
Date: Sat Jan 16 19:39:06 2010
New Revision: 30327

Log:
Reuse h{lum,chr}Filter{,Pos} variables for MMX2 fast_bilinear horizontal scaler.

Modified:
   trunk/libswscale/swscale.c
   trunk/libswscale/swscale_internal.h
   trunk/libswscale/swscale_template.c

Modified: trunk/libswscale/swscale.c
==============================================================================
--- trunk/libswscale/swscale.c	Sat Jan 16 19:36:21 2010	(r30326)
+++ trunk/libswscale/swscale.c	Sat Jan 16 19:39:06 2010	(r30327)
@@ -2690,13 +2690,13 @@ SwsContext *sws_getContext(int srcW, int
             c->chrMmx2FilterCode = av_malloc(c->chrMmx2FilterCodeSize);
 #endif
 
-            FF_ALLOCZ_OR_GOTO(c, c->lumMmx2Filter   , (dstW        /8+8)*sizeof(int16_t), fail);
-            FF_ALLOCZ_OR_GOTO(c, c->chrMmx2Filter   , (c->chrDstW  /4+8)*sizeof(int16_t), fail);
-            FF_ALLOCZ_OR_GOTO(c, c->lumMmx2FilterPos, (dstW      /2/8+8)*sizeof(int32_t), fail);
-            FF_ALLOCZ_OR_GOTO(c, c->chrMmx2FilterPos, (c->chrDstW/2/4+8)*sizeof(int32_t), fail);
+            FF_ALLOCZ_OR_GOTO(c, c->hLumFilter   , (dstW        /8+8)*sizeof(int16_t), fail);
+            FF_ALLOCZ_OR_GOTO(c, c->hChrFilter   , (c->chrDstW  /4+8)*sizeof(int16_t), fail);
+            FF_ALLOCZ_OR_GOTO(c, c->hLumFilterPos, (dstW      /2/8+8)*sizeof(int32_t), fail);
+            FF_ALLOCZ_OR_GOTO(c, c->hChrFilterPos, (c->chrDstW/2/4+8)*sizeof(int32_t), fail);
 
-            initMMX2HScaler(      dstW, c->lumXInc, c->lumMmx2FilterCode, c->lumMmx2Filter, c->lumMmx2FilterPos, 8);
-            initMMX2HScaler(c->chrDstW, c->chrXInc, c->chrMmx2FilterCode, c->chrMmx2Filter, c->chrMmx2FilterPos, 4);
+            initMMX2HScaler(      dstW, c->lumXInc, c->lumMmx2FilterCode, c->hLumFilter, c->hLumFilterPos, 8);
+            initMMX2HScaler(c->chrDstW, c->chrXInc, c->chrMmx2FilterCode, c->hChrFilter, c->hChrFilterPos, 4);
 
 #ifdef MAP_ANONYMOUS
             mprotect(c->lumMmx2FilterCode, c->lumMmx2FilterCodeSize, PROT_EXEC | PROT_READ);
@@ -3423,10 +3423,6 @@ void sws_freeContext(SwsContext *c)
     c->chrMmx2FilterCode=NULL;
 #endif /* ARCH_X86 && CONFIG_GPL */
 
-    av_freep(&c->lumMmx2Filter);
-    av_freep(&c->chrMmx2Filter);
-    av_freep(&c->lumMmx2FilterPos);
-    av_freep(&c->chrMmx2FilterPos);
     av_freep(&c->yuvTable);
 
     av_free(c);

Modified: trunk/libswscale/swscale_internal.h
==============================================================================
--- trunk/libswscale/swscale_internal.h	Sat Jan 16 19:36:21 2010	(r30326)
+++ trunk/libswscale/swscale_internal.h	Sat Jan 16 19:39:06 2010	(r30327)
@@ -114,10 +114,6 @@ typedef struct SwsContext {
     int chrMmx2FilterCodeSize;
     uint8_t *lumMmx2FilterCode;
     uint8_t *chrMmx2FilterCode;
-    int32_t *lumMmx2FilterPos;
-    int32_t *chrMmx2FilterPos;
-    int16_t *lumMmx2Filter;
-    int16_t *chrMmx2Filter;
 
     int canMMX2BeUsed;
 

Modified: trunk/libswscale/swscale_template.c
==============================================================================
--- trunk/libswscale/swscale_template.c	Sat Jan 16 19:36:21 2010	(r30326)
+++ trunk/libswscale/swscale_template.c	Sat Jan 16 19:39:06 2010	(r30327)
@@ -2260,8 +2260,8 @@ static inline void RENAME(hyscale_fast)(
 {
 #if ARCH_X86 && CONFIG_GPL
 #if COMPILE_TEMPLATE_MMX2
-    int32_t *mmx2FilterPos = c->lumMmx2FilterPos;
-    int16_t *mmx2Filter    = c->lumMmx2Filter;
+    int32_t *filterPos = c->hLumFilterPos;
+    int16_t *filter    = c->hLumFilter;
     int     canMMX2BeUsed  = c->canMMX2BeUsed;
     void    *mmx2FilterCode= c->lumMmx2FilterCode;
     int i;
@@ -2316,7 +2316,7 @@ static inline void RENAME(hyscale_fast)(
 #if defined(PIC)
             "mov                      %5, %%"REG_b" \n\t"
 #endif
-            :: "m" (src), "m" (dst), "m" (mmx2Filter), "m" (mmx2FilterPos),
+            :: "m" (src), "m" (dst), "m" (filter), "m" (filterPos),
             "m" (mmx2FilterCode)
 #if defined(PIC)
             ,"m" (ebxsave)
@@ -2409,8 +2409,8 @@ static inline void RENAME(hcscale_fast)(
 {
 #if ARCH_X86 && CONFIG_GPL
 #if COMPILE_TEMPLATE_MMX2
-    int32_t *mmx2FilterPos = c->chrMmx2FilterPos;
-    int16_t *mmx2Filter    = c->chrMmx2Filter;
+    int32_t *filterPos = c->hChrFilterPos;
+    int16_t *filter    = c->hChrFilter;
     int     canMMX2BeUsed  = c->canMMX2BeUsed;
     void    *mmx2FilterCode= c->chrMmx2FilterCode;
     int i;
@@ -2452,7 +2452,7 @@ static inline void RENAME(hcscale_fast)(
 #if defined(PIC)
             "mov %6, %%"REG_b"    \n\t"
 #endif
-            :: "m" (src1), "m" (dst), "m" (mmx2Filter), "m" (mmx2FilterPos),
+            :: "m" (src1), "m" (dst), "m" (filter), "m" (filterPos),
             "m" (mmx2FilterCode), "m" (src2)
 #if defined(PIC)
             ,"m" (ebxsave)



More information about the ffmpeg-cvslog mailing list