aboutsummaryrefslogtreecommitdiffstats
path: root/postproc/swscale.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2002-03-21 18:53:32 +0000
committerMichael Niedermayer <michaelni@gmx.at>2002-03-21 18:53:32 +0000
commitdaa57641370d17af7c5d8d757d110027488182b8 (patch)
treec5c1ebfbb151dedc52bc48249df9a39d4af66d60 /postproc/swscale.c
parentaf469427b345528797a6f0f33e8e6e5df623593d (diff)
downloadffmpeg-daa57641370d17af7c5d8d757d110027488182b8.tar.gz
fixing bgr15&16 on big_endian
i doubt that that will fix all big endian problems though, we very likely will have to support RGB & BGR output formats as either bgr32 or bgr15 is rgb depending upon the way rgb/bgr is defined Originally committed as revision 5247 to svn://svn.mplayerhq.hu/mplayer/trunk/postproc
Diffstat (limited to 'postproc/swscale.c')
-rw-r--r--postproc/swscale.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/postproc/swscale.c b/postproc/swscale.c
index 8dc4c030c3..dbf61ce8df 100644
--- a/postproc/swscale.c
+++ b/postproc/swscale.c
@@ -1125,12 +1125,12 @@ static void globalInit(){
for(i=0; i<768; i++)
{
int v= clip_table[i];
- clip_table16b[i]= le2me_16( v>>3);
- clip_table16g[i]= le2me_16((v<<3)&0x07E0);
- clip_table16r[i]= le2me_16((v<<8)&0xF800);
- clip_table15b[i]= le2me_16( v>>3);
- clip_table15g[i]= le2me_16((v<<2)&0x03E0);
- clip_table15r[i]= le2me_16((v<<7)&0x7C00);
+ clip_table16b[i]= v>>3;
+ clip_table16g[i]= (v<<3)&0x07E0;
+ clip_table16r[i]= (v<<8)&0xF800;
+ clip_table15b[i]= v>>3;
+ clip_table15g[i]= (v<<2)&0x03E0;
+ clip_table15r[i]= (v<<7)&0x7C00;
}
cpuCaps= gCpuCaps;
@@ -1420,7 +1420,10 @@ SwsContext *getSwsContext(int srcW, int srcH, int srcFormat, int dstW, int dstH,
{
// FIXME multiple yuv2rgb converters wont work that way cuz that thing is full of globals&statics
#ifdef WORDS_BIGENDIAN
- yuv2rgb_init( dstFormat&0xFF /* =bpp */, MODE_BGR);
+ if(dstFormat==IMGFMT_BGR32)
+ yuv2rgb_init( dstFormat&0xFF /* =bpp */, MODE_BGR);
+ else
+ yuv2rgb_init( dstFormat&0xFF /* =bpp */, MODE_RGB);
#else
yuv2rgb_init( dstFormat&0xFF /* =bpp */, MODE_RGB);
#endif