diff options
author | michael <michael@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2007-02-17 12:58:35 +0000 |
---|---|---|
committer | michael <michael@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2007-02-17 12:58:35 +0000 |
commit | 28f35b52f686fcbf8b1cda96b6147f7084860aad (patch) | |
tree | 86856a8fe280dc17524323dc80f6e8bc5eccce7a /libmpcodecs | |
parent | 8fd50571b08ade708bc26ec89d403474c07b3612 (diff) | |
download | mpv-28f35b52f686fcbf8b1cda96b6147f7084860aad.tar.bz2 mpv-28f35b52f686fcbf8b1cda96b6147f7084860aad.tar.xz |
swap palette on big endian
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22246 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpcodecs')
-rw-r--r-- | libmpcodecs/vf_scale.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/libmpcodecs/vf_scale.c b/libmpcodecs/vf_scale.c index bbfbd4662e..445564e89b 100644 --- a/libmpcodecs/vf_scale.c +++ b/libmpcodecs/vf_scale.c @@ -11,6 +11,7 @@ #include "mp_image.h" #include "vf.h" #include "fmt-conversion.h" +#include "bswap.h" #include "libvo/fastmemcpy.h" #include "libswscale/swscale.h" @@ -323,9 +324,19 @@ static void start_slice(struct vf_instance_s* vf, mp_image_t *mpi){ static void scale(struct SwsContext *sws1, struct SwsContext *sws2, uint8_t *src[3], int src_stride[3], int y, int h, uint8_t *dst[3], int dst_stride[3], int interlaced){ + uint8_t *src2[3]={src[0], src[1], src[2]}; +#ifdef WORDS_BIGENDIAN + uint32_t pal2[256]; + if (src[1] && !src[2]){ + int i; + for(i=0; i<256; i++) + pal2[i]= bswap_32(((uint32_t*)src[1])[i]); + src2[1]= pal2; + } +#endif + if(interlaced){ int i; - uint8_t *src2[3]={src[0], src[1], src[2]}; uint8_t *dst2[3]={dst[0], dst[1], dst[2]}; int src_stride2[3]={2*src_stride[0], 2*src_stride[1], 2*src_stride[2]}; int dst_stride2[3]={2*dst_stride[0], 2*dst_stride[1], 2*dst_stride[2]}; @@ -337,7 +348,7 @@ static void scale(struct SwsContext *sws1, struct SwsContext *sws2, uint8_t *src } sws_scale_ordered(sws2, src2, src_stride2, y>>1, h>>1, dst2, dst_stride2); }else{ - sws_scale_ordered(sws1, src, src_stride, y, h, dst, dst_stride); + sws_scale_ordered(sws1, src2, src_stride, y, h, dst, dst_stride); } } |