From c4f7050bb1e449a9b45a98cc460c06bd89afa8b4 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Tue, 10 May 2011 00:17:44 +0200 Subject: [PATCH] swscale: support unscaled planar Nbit->8bit with non native endian source. Signed-off-by: Michael Niedermayer --- libswscale/swscale.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libswscale/swscale.c b/libswscale/swscale.c index 1e412b3a25..744e002b9c 100644 --- a/libswscale/swscale.c +++ b/libswscale/swscale.c @@ -1904,7 +1904,11 @@ static int planarCopyWrapper(SwsContext *c, const uint8_t* src[], int srcStride[ uint16_t *dstPtr2 = (uint16_t*)dstPtr; if (dst_depth == 8) { - DITHER_COPY(dstPtr, dstStride[plane], srcPtr2, srcStride[plane]/2, ) + if(isBE(c->srcFormat) == HAVE_BIGENDIAN){ + DITHER_COPY(dstPtr, dstStride[plane], srcPtr2, srcStride[plane]/2, ) + } else { + DITHER_COPY(dstPtr, dstStride[plane], srcPtr2, srcStride[plane]/2, av_bswap16) + } } else if (src_depth == 8) { for (i = 0; i < height; i++) { for (j = 0; j < length; j++)