changeset 28833:04cc20101f70

Let the 4th plane reach the swScale function
author sdrik
date Sat, 07 Mar 2009 09:39:48 +0000
parents 9ab5447ba67a
children 88ac68461aae
files libswscale/swscale.c
diffstat 1 files changed, 8 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/libswscale/swscale.c	Sat Mar 07 09:37:25 2009 +0000
+++ b/libswscale/swscale.c	Sat Mar 07 09:39:48 2009 +0000
@@ -2726,7 +2726,7 @@
 int sws_scale(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY,
               int srcSliceH, uint8_t* dst[], int dstStride[]){
     int i;
-    uint8_t* src2[4]= {src[0], src[1], src[2]};
+    uint8_t* src2[4]= {src[0], src[1], src[2], src[3]};
 
     if (c->sliceDir == 0 && srcSliceY != 0 && srcSliceY + srcSliceH != c->srcH) {
         av_log(c, AV_LOG_ERROR, "Slices start in the middle!\n");
@@ -2800,21 +2800,23 @@
     // copy strides, so they can safely be modified
     if (c->sliceDir == 1) {
         // slices go from top to bottom
-        int srcStride2[4]= {srcStride[0], srcStride[1], srcStride[2]};
-        int dstStride2[4]= {dstStride[0], dstStride[1], dstStride[2]};
+        int srcStride2[4]= {srcStride[0], srcStride[1], srcStride[2], srcStride[3]};
+        int dstStride2[4]= {dstStride[0], dstStride[1], dstStride[2], dstStride[3]};
         return c->swScale(c, src2, srcStride2, srcSliceY, srcSliceH, dst, dstStride2);
     } else {
         // slices go from bottom to top => we flip the image internally
         uint8_t* dst2[4]= {dst[0] + (c->dstH-1)*dstStride[0],
                            dst[1] + ((c->dstH>>c->chrDstVSubSample)-1)*dstStride[1],
-                           dst[2] + ((c->dstH>>c->chrDstVSubSample)-1)*dstStride[2]};
-        int srcStride2[4]= {-srcStride[0], -srcStride[1], -srcStride[2]};
-        int dstStride2[4]= {-dstStride[0], -dstStride[1], -dstStride[2]};
+                           dst[2] + ((c->dstH>>c->chrDstVSubSample)-1)*dstStride[2],
+                           dst[3] + (c->dstH-1)*dstStride[3]};
+        int srcStride2[4]= {-srcStride[0], -srcStride[1], -srcStride[2], -srcStride[3]};
+        int dstStride2[4]= {-dstStride[0], -dstStride[1], -dstStride[2], -dstStride[3]};
 
         src2[0] += (srcSliceH-1)*srcStride[0];
         if (!usePal(c->srcFormat))
             src2[1] += ((srcSliceH>>c->chrSrcVSubSample)-1)*srcStride[1];
         src2[2] += ((srcSliceH>>c->chrSrcVSubSample)-1)*srcStride[2];
+        src2[3] += (srcSliceH-1)*srcStride[3];
 
         return c->swScale(c, src2, srcStride2, c->srcH-srcSliceY-srcSliceH, srcSliceH, dst2, dstStride2);
     }