aboutsummaryrefslogtreecommitdiffstats
path: root/postproc
diff options
context:
space:
mode:
authorNicolas Plourde <nicolas.plourde@sympatico.ca>2005-04-27 18:17:53 +0000
committerNicolas Plourde <nicolas.plourde@sympatico.ca>2005-04-27 18:17:53 +0000
commitf8c1d62d74897b4eedfc2b45013c03863de3d3c4 (patch)
tree10fcaac1a8bd8370627061485e336dc4eeb1fd01 /postproc
parentc8389233cb08710c8ac8c65074427a4005156ae3 (diff)
downloadffmpeg-f8c1d62d74897b4eedfc2b45013c03863de3d3c4.tar.gz
fix palette8tobgr32/palette8torgb32 on big endian
Originally committed as revision 15278 to svn://svn.mplayerhq.hu/mplayer/trunk/postproc
Diffstat (limited to 'postproc')
-rw-r--r--postproc/rgb2rgb.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/postproc/rgb2rgb.c b/postproc/rgb2rgb.c
index 45770bd005..fc87b9c02c 100644
--- a/postproc/rgb2rgb.c
+++ b/postproc/rgb2rgb.c
@@ -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;
}
}