Replace WORDS_BIGENDIAN with HAVE_BIGENDIAN

Originally committed as revision 29439 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
release/0.6
Måns Rullgård 16 years ago
parent 63613fe615
commit a898cdc995
  1. 8
      libswscale/rgb2rgb.c
  2. 12
      libswscale/rgb2rgb_template.c
  3. 9
      libswscale/swscale.c
  4. 2
      libswscale/swscale_internal.h

@ -275,7 +275,7 @@ void rgb32to24(const uint8_t *src, uint8_t *dst, long src_size)
long num_pixels = src_size >> 2;
for (i=0; i<num_pixels; i++)
{
#ifdef WORDS_BIGENDIAN
#if HAVE_BIGENDIAN
/* RGB32 (= A,B,G,R) -> BGR24 (= B,G,R) */
dst[3*i + 0] = src[4*i + 1];
dst[3*i + 1] = src[4*i + 2];
@ -293,7 +293,7 @@ void rgb24to32(const uint8_t *src, uint8_t *dst, long src_size)
long i;
for (i=0; 3*i<src_size; i++)
{
#ifdef WORDS_BIGENDIAN
#if HAVE_BIGENDIAN
/* RGB24 (= R,G,B) -> BGR32 (= A,R,G,B) */
dst[4*i + 0] = 255;
dst[4*i + 1] = src[3*i + 0];
@ -318,7 +318,7 @@ void rgb16tobgr32(const uint8_t *src, uint8_t *dst, long src_size)
{
register uint16_t bgr;
bgr = *s++;
#ifdef WORDS_BIGENDIAN
#if HAVE_BIGENDIAN
*d++ = 255;
*d++ = (bgr&0x1F)<<3;
*d++ = (bgr&0x7E0)>>3;
@ -382,7 +382,7 @@ void rgb15tobgr32(const uint8_t *src, uint8_t *dst, long src_size)
{
register uint16_t bgr;
bgr = *s++;
#ifdef WORDS_BIGENDIAN
#if HAVE_BIGENDIAN
*d++ = 255;
*d++ = (bgr&0x1F)<<3;
*d++ = (bgr&0x3E0)>>2;

@ -115,7 +115,7 @@ static inline void RENAME(rgb24tobgr32)(const uint8_t *src, uint8_t *dst, long s
#endif
while (s < end)
{
#ifdef WORDS_BIGENDIAN
#if HAVE_BIGENDIAN
/* RGB24 (= R,G,B) -> RGB32 (= A,B,G,R) */
*dest++ = 255;
*dest++ = s[2];
@ -201,7 +201,7 @@ static inline void RENAME(rgb32tobgr24)(const uint8_t *src, uint8_t *dst, long s
#endif
while (s < end)
{
#ifdef WORDS_BIGENDIAN
#if HAVE_BIGENDIAN
/* RGB32 (= A,B,G,R) -> RGB24 (= R,G,B) */
s++;
dest[2] = *s++;
@ -1264,7 +1264,7 @@ static inline void RENAME(rgb15to32)(const uint8_t *src, uint8_t *dst, long src_
#else
register uint16_t bgr;
bgr = *s++;
#ifdef WORDS_BIGENDIAN
#if HAVE_BIGENDIAN
*d++ = 255;
*d++ = (bgr&0x7C00)>>7;
*d++ = (bgr&0x3E0)>>2;
@ -1321,7 +1321,7 @@ static inline void RENAME(rgb16to32)(const uint8_t *src, uint8_t *dst, long src_
{
register uint16_t bgr;
bgr = *s++;
#ifdef WORDS_BIGENDIAN
#if HAVE_BIGENDIAN
*d++ = 255;
*d++ = (bgr&0xF800)>>8;
*d++ = (bgr&0x7E0)>>3;
@ -1581,7 +1581,7 @@ static inline void RENAME(yuvPlanartoyuy2)(const uint8_t *ysrc, const uint8_t *u
int i, *idst = (int32_t *) dst;
const uint8_t *yc = ysrc, *uc = usrc, *vc = vsrc;
for (i = 0; i < chromWidth; i++){
#ifdef WORDS_BIGENDIAN
#if HAVE_BIGENDIAN
*idst++ = (yc[0] << 24)+ (uc[0] << 16) +
(yc[1] << 8) + (vc[0] << 0);
#else
@ -1687,7 +1687,7 @@ static inline void RENAME(yuvPlanartouyvy)(const uint8_t *ysrc, const uint8_t *u
int i, *idst = (int32_t *) dst;
const uint8_t *yc = ysrc, *uc = usrc, *vc = vsrc;
for (i = 0; i < chromWidth; i++){
#ifdef WORDS_BIGENDIAN
#if HAVE_BIGENDIAN
*idst++ = (uc[0] << 24)+ (yc[0] << 16) +
(vc[0] << 8) + (yc[1] << 0);
#else

@ -89,7 +89,6 @@ unsigned swscale_version(void)
//#define HAVE_AMD3DNOW
//#undef HAVE_MMX
//#undef ARCH_X86
//#define WORDS_BIGENDIAN
#define DITHER1XBPP
#define FAST_BGR2YV12 // use 7 bit coefficients instead of 15 bit
@ -3161,25 +3160,25 @@ int sws_scale(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY,
switch(c->dstFormat) {
case PIX_FMT_BGR32:
#ifndef WORDS_BIGENDIAN
#if !HAVE_BIGENDIAN
case PIX_FMT_RGB24:
#endif
c->pal_rgb[i]= r + (g<<8) + (b<<16);
break;
case PIX_FMT_BGR32_1:
#ifdef WORDS_BIGENDIAN
#if HAVE_BIGENDIAN
case PIX_FMT_BGR24:
#endif
c->pal_rgb[i]= (r + (g<<8) + (b<<16)) << 8;
break;
case PIX_FMT_RGB32_1:
#ifdef WORDS_BIGENDIAN
#if HAVE_BIGENDIAN
case PIX_FMT_RGB24:
#endif
c->pal_rgb[i]= (b + (g<<8) + (r<<16)) << 8;
break;
case PIX_FMT_RGB32:
#ifndef WORDS_BIGENDIAN
#if !HAVE_BIGENDIAN
case PIX_FMT_BGR24:
#endif
default:

@ -41,7 +41,7 @@
#define VOF (VOFW*2)
#ifdef WORDS_BIGENDIAN
#if HAVE_BIGENDIAN
#define ALT32_CORR (-1)
#else
#define ALT32_CORR 1

Loading…
Cancel
Save