---
 libswscale/swscale_internal.h |    8 --------
 libswscale/utils.c            |   15 +++++++--------
 2 files changed, 7 insertions(+), 16 deletions(-)

diff --git a/libswscale/swscale_internal.h b/libswscale/swscale_internal.h
index 964f710..5aad9cf 100644
--- a/libswscale/swscale_internal.h
+++ b/libswscale/swscale_internal.h
@@ -35,14 +35,6 @@
 
 #define MAX_FILTER_SIZE 256
 
-#if ARCH_X86
-#define VOFW 5120
-#else
-#define VOFW 2048 // faster on PPC and not tested on others
-#endif
-
-#define VOF  (VOFW*2)
-
 #if HAVE_BIGENDIAN
 #define ALT32_CORR (-1)
 #else
diff --git a/libswscale/utils.c b/libswscale/utils.c
index d322e5b..3fdde51 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -750,6 +750,7 @@ int sws_init_context(SwsContext *c, SwsFilter *srcFilter, 
SwsFilter *dstFilter)
     int srcH= c->srcH;
     int dstW= c->dstW;
     int dstH= c->dstH;
+    int vofW = FFALIGN(c->dstW * sizeof(int16_t), 16), vofHW = vofW >> 1;
     int flags, cpu_flags;
     enum PixelFormat srcFormat= c->srcFormat;
     enum PixelFormat dstFormat= c->dstFormat;
@@ -997,26 +998,24 @@ int sws_init_context(SwsContext *c, SwsFilter *srcFilter, 
SwsFilter *dstFilter)
     //Note we need at least one pixel more at the end because of the MMX code 
(just in case someone wanna replace the 4000/8000)
     /* align at 16 bytes for AltiVec */
     for (i=0; i<c->vLumBufSize; i++) {
-        FF_ALLOCZ_OR_GOTO(c, c->lumPixBuf[i+c->vLumBufSize], VOF+1, fail);
+        FF_ALLOCZ_OR_GOTO(c, c->lumPixBuf[i+c->vLumBufSize], vofW+1, fail);
         c->lumPixBuf[i] = c->lumPixBuf[i+c->vLumBufSize];
     }
-    c->uv_off = VOFW;
+    c->uv_off = vofW;
     for (i=0; i<c->vChrBufSize; i++) {
-        FF_ALLOC_OR_GOTO(c, c->chrUPixBuf[i+c->vChrBufSize], VOF*2+1, fail);
+        FF_ALLOC_OR_GOTO(c, c->chrUPixBuf[i+c->vChrBufSize], vofW*2+1, fail);
         c->chrUPixBuf[i] = c->chrUPixBuf[i+c->vChrBufSize];
-        c->chrVPixBuf[i] = c->chrVPixBuf[i+c->vChrBufSize] = c->chrUPixBuf[i] 
+ VOFW;
+        c->chrVPixBuf[i] = c->chrVPixBuf[i+c->vChrBufSize] = c->chrUPixBuf[i] 
+ vofHW;
     }
     if (CONFIG_SWSCALE_ALPHA && c->alpPixBuf)
         for (i=0; i<c->vLumBufSize; i++) {
-            FF_ALLOCZ_OR_GOTO(c, c->alpPixBuf[i+c->vLumBufSize], VOF+1, fail);
+            FF_ALLOCZ_OR_GOTO(c, c->alpPixBuf[i+c->vLumBufSize], vofW+1, fail);
             c->alpPixBuf[i] = c->alpPixBuf[i+c->vLumBufSize];
         }
 
     //try to avoid drawing green stuff between the right end and the stride end
     for (i=0; i<c->vChrBufSize; i++)
-        memset(c->chrUPixBuf[i], 64, VOF*2+1);
-
-    assert(2*VOFW == VOF);
+        memset(c->chrUPixBuf[i], 64, vofW*2+1);
 
     assert(c->chrDstH <= dstH);
 
-- 
1.7.4.4

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to