summaryrefslogtreecommitdiffstats
path: root/libswscale
diff options
context:
space:
mode:
authormru <mru@b3059339-0415-0410-9bf9-f77b7e298cf2>2009-07-26 12:26:32 +0000
committermru <mru@b3059339-0415-0410-9bf9-f77b7e298cf2>2009-07-26 12:26:32 +0000
commitb3186ed071dc514391e06e85e9dd6c96d1295aea (patch)
tree4a619b5b3f0de7987284a6d7faaf5d2783879d9e /libswscale
parentde3d544c4362f04e46f1e85283a3b7d7401229e3 (diff)
downloadmpv-b3186ed071dc514391e06e85e9dd6c96d1295aea.tar.bz2
mpv-b3186ed071dc514391e06e85e9dd6c96d1295aea.tar.xz
Replace WORDS_BIGENDIAN with HAVE_BIGENDIAN
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29439 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libswscale')
-rw-r--r--libswscale/rgb2rgb.c8
-rw-r--r--libswscale/rgb2rgb_template.c12
-rw-r--r--libswscale/swscale.c9
-rw-r--r--libswscale/swscale_internal.h2
4 files changed, 15 insertions, 16 deletions
diff --git a/libswscale/rgb2rgb.c b/libswscale/rgb2rgb.c
index 59b8e30a63..7aeb2a3ac2 100644
--- a/libswscale/rgb2rgb.c
+++ b/libswscale/rgb2rgb.c
@@ -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;
diff --git a/libswscale/rgb2rgb_template.c b/libswscale/rgb2rgb_template.c
index 56c9426430..cd7fbae292 100644
--- a/libswscale/rgb2rgb_template.c
+++ b/libswscale/rgb2rgb_template.c
@@ -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
diff --git a/libswscale/swscale.c b/libswscale/swscale.c
index bbeef61dba..b1592dadf8 100644
--- a/libswscale/swscale.c
+++ b/libswscale/swscale.c
@@ -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:
diff --git a/libswscale/swscale_internal.h b/libswscale/swscale_internal.h
index 50cf304b1f..85e07c0af1 100644
--- a/libswscale/swscale_internal.h
+++ b/libswscale/swscale_internal.h
@@ -41,7 +41,7 @@
#define VOF (VOFW*2)
-#ifdef WORDS_BIGENDIAN
+#if HAVE_BIGENDIAN
#define ALT32_CORR (-1)
#else
#define ALT32_CORR 1