Commit 662bc933 authored by nplourde's avatar nplourde

fix palette8tobgr32/palette8torgb32 on big endian


git-svn-id: file:///var/local/repositories/mplayer/trunk/postproc@15278 b3059339-0415-0410-9bf9-f77b7e298cf2
parent c533d0fc
...@@ -332,11 +332,17 @@ void palette8torgb32(const uint8_t *src, uint8_t *dst, unsigned num_pixels, cons ...@@ -332,11 +332,17 @@ void palette8torgb32(const uint8_t *src, uint8_t *dst, unsigned num_pixels, cons
for(i=0; i<num_pixels; i++) for(i=0; i<num_pixels; i++)
{ {
#ifdef WORDS_BIGENDIAN
dst[3]= palette[ src[i]*4+2 ];
dst[2]= palette[ src[i]*4+1 ];
dst[1]= palette[ src[i]*4+0 ];
#else
//FIXME slow? //FIXME slow?
dst[0]= palette[ src[i]*4+2 ]; dst[0]= palette[ src[i]*4+2 ];
dst[1]= palette[ src[i]*4+1 ]; dst[1]= palette[ src[i]*4+1 ];
dst[2]= palette[ src[i]*4+0 ]; dst[2]= palette[ src[i]*4+0 ];
// dst[3]= 0; /* do we need this cleansing? */ // dst[3]= 0; /* do we need this cleansing? */
#endif
dst+= 4; dst+= 4;
} }
} }
...@@ -346,11 +352,18 @@ void palette8tobgr32(const uint8_t *src, uint8_t *dst, unsigned num_pixels, cons ...@@ -346,11 +352,18 @@ void palette8tobgr32(const uint8_t *src, uint8_t *dst, unsigned num_pixels, cons
unsigned i; unsigned i;
for(i=0; i<num_pixels; i++) for(i=0; i<num_pixels; i++)
{ {
#ifdef WORDS_BIGENDIAN
dst[3]= palette[ src[i]*4+0 ];
dst[2]= palette[ src[i]*4+1 ];
dst[1]= palette[ src[i]*4+2 ];
#else
//FIXME slow? //FIXME slow?
dst[0]= palette[ src[i]*4+0 ]; dst[0]= palette[ src[i]*4+0 ];
dst[1]= palette[ src[i]*4+1 ]; dst[1]= palette[ src[i]*4+1 ];
dst[2]= palette[ src[i]*4+2 ]; dst[2]= palette[ src[i]*4+2 ];
// dst[3]= 0; /* do we need this cleansing? */ // dst[3]= 0; /* do we need this cleansing? */
#endif
dst+= 4; dst+= 4;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment