comparison postproc/swscale.c @ 5246:4cfa6366e551

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
author michael
date Thu, 21 Mar 2002 18:53:32 +0000
parents a14eff26f66a
children eb87391a5292
comparison
equal deleted inserted replaced
5245:1fd019cee62d 5246:4cfa6366e551
1123 } 1123 }
1124 1124
1125 for(i=0; i<768; i++) 1125 for(i=0; i<768; i++)
1126 { 1126 {
1127 int v= clip_table[i]; 1127 int v= clip_table[i];
1128 clip_table16b[i]= le2me_16( v>>3); 1128 clip_table16b[i]= v>>3;
1129 clip_table16g[i]= le2me_16((v<<3)&0x07E0); 1129 clip_table16g[i]= (v<<3)&0x07E0;
1130 clip_table16r[i]= le2me_16((v<<8)&0xF800); 1130 clip_table16r[i]= (v<<8)&0xF800;
1131 clip_table15b[i]= le2me_16( v>>3); 1131 clip_table15b[i]= v>>3;
1132 clip_table15g[i]= le2me_16((v<<2)&0x03E0); 1132 clip_table15g[i]= (v<<2)&0x03E0;
1133 clip_table15r[i]= le2me_16((v<<7)&0x7C00); 1133 clip_table15r[i]= (v<<7)&0x7C00;
1134 } 1134 }
1135 1135
1136 cpuCaps= gCpuCaps; 1136 cpuCaps= gCpuCaps;
1137 1137
1138 #ifdef RUNTIME_CPUDETECT 1138 #ifdef RUNTIME_CPUDETECT
1418 /* yuv2bgr */ 1418 /* yuv2bgr */
1419 if(isPlanarYUV(srcFormat) && isBGR(dstFormat)) 1419 if(isPlanarYUV(srcFormat) && isBGR(dstFormat))
1420 { 1420 {
1421 // FIXME multiple yuv2rgb converters wont work that way cuz that thing is full of globals&statics 1421 // FIXME multiple yuv2rgb converters wont work that way cuz that thing is full of globals&statics
1422 #ifdef WORDS_BIGENDIAN 1422 #ifdef WORDS_BIGENDIAN
1423 yuv2rgb_init( dstFormat&0xFF /* =bpp */, MODE_BGR); 1423 if(dstFormat==IMGFMT_BGR32)
1424 yuv2rgb_init( dstFormat&0xFF /* =bpp */, MODE_BGR);
1425 else
1426 yuv2rgb_init( dstFormat&0xFF /* =bpp */, MODE_RGB);
1424 #else 1427 #else
1425 yuv2rgb_init( dstFormat&0xFF /* =bpp */, MODE_RGB); 1428 yuv2rgb_init( dstFormat&0xFF /* =bpp */, MODE_RGB);
1426 #endif 1429 #endif
1427 c->swScale= planarYuvToBgr; 1430 c->swScale= planarYuvToBgr;
1428 1431