1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

fix palette8tobgr32/palette8torgb32 on big endian

Originally committed as revision 15278 to svn://svn.mplayerhq.hu/mplayer/trunk/postproc
This commit is contained in:
Nicolas Plourde 2005-04-27 18:17:53 +00:00
parent c8389233cb
commit f8c1d62d74

View File

@ -332,11 +332,17 @@ void palette8torgb32(const uint8_t *src, uint8_t *dst, unsigned num_pixels, cons
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?
dst[0]= palette[ src[i]*4+2 ];
dst[1]= palette[ src[i]*4+1 ];
dst[2]= palette[ src[i]*4+0 ];
// dst[3]= 0; /* do we need this cleansing? */
#endif
dst+= 4;
}
}
@ -346,11 +352,18 @@ void palette8tobgr32(const uint8_t *src, uint8_t *dst, unsigned num_pixels, cons
unsigned 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?
dst[0]= palette[ src[i]*4+0 ];
dst[1]= palette[ src[i]*4+1 ];
dst[2]= palette[ src[i]*4+2 ];
// dst[3]= 0; /* do we need this cleansing? */
#endif
dst+= 4;
}
}