swscale: implement Nbit->non native endian 16bit. Fixes v210.
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 8 May 2011 22:22:12 +0000 (00:22 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 8 May 2011 22:22:12 +0000 (00:22 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libswscale/swscale.c
tests/ref/fate/v210

index f5f7a55..591c7a4 100644 (file)
@@ -1910,9 +1910,15 @@ static int planarCopyWrapper(SwsContext *c, const uint8_t* src[], int srcStride[
                     }
                 } else if (src_depth < dst_depth) {
                     for (i = 0; i < height; i++) {
-                        for (j = 0; j < length; j++)
-                            dstPtr2[j] = (srcPtr2[j]<<(dst_depth-src_depth)) |
-                                (srcPtr2[j]>>(2*src_depth-dst_depth));
+                        if(isBE(c->dstFormat)){
+                            for (j = 0; j < length; j++)
+                                AV_WB16(&dstPtr2[j], (srcPtr2[j]<<(dst_depth-src_depth)) |
+                                                     (srcPtr2[j]>>(2*src_depth-dst_depth)));
+                        }else{
+                            for (j = 0; j < length; j++)
+                                AV_WL16(&dstPtr2[j], (srcPtr2[j]<<(dst_depth-src_depth)) |
+                                                     (srcPtr2[j]>>(2*src_depth-dst_depth)));
+                        }
                         dstPtr2 += dstStride[plane]/2;
                         srcPtr2 += srcStride[plane]/2;
                     }
index dc82788..6a551a5 100644 (file)
@@ -1 +1 @@
-0, 0, 3686400, 0x9c6c1dde
+0, 0, 3686400, 0x75ee1dde