summaryrefslogtreecommitdiff
path: root/libswscale
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-05-09 00:22:12 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-05-09 00:22:12 +0200
commit3dd779eb0affdd6d597291a5cc6215a138f71495 (patch)
treefefd497ac18acfbf49b640b35f7b5b14e67e4a72 /libswscale
parentf2bfdc3836afe266c7fe04d3c744acd0a72889b4 (diff)
swscale: implement Nbit->non native endian 16bit. Fixes v210.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libswscale')
-rw-r--r--libswscale/swscale.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/libswscale/swscale.c b/libswscale/swscale.c
index f5f7a55760..591c7a4375 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;
}