[FFmpeg-cvslog] swscale: implement Nbit->non native endian 16bit. Fixes v210.

Michael Niedermayer git at videolan.org
Mon May 9 00:24:50 CEST 2011


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Mon May  9 00:22:12 2011 +0200| [3dd779eb0affdd6d597291a5cc6215a138f71495] | committer: Michael Niedermayer

swscale: implement Nbit->non native endian 16bit. Fixes v210.
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3dd779eb0affdd6d597291a5cc6215a138f71495
---

 libswscale/swscale.c |   12 +++++++++---
 tests/ref/fate/v210  |    2 +-
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/libswscale/swscale.c b/libswscale/swscale.c
index f5f7a55..591c7a4 100644
--- a/libswscale/swscale.c
+++ b/libswscale/swscale.c
@@ -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;
                     }
diff --git a/tests/ref/fate/v210 b/tests/ref/fate/v210
index dc82788..6a551a5 100644
--- a/tests/ref/fate/v210
+++ b/tests/ref/fate/v210
@@ -1 +1 @@
-0, 0, 3686400, 0x9c6c1dde
+0, 0, 3686400, 0x75ee1dde



More information about the ffmpeg-cvslog mailing list