[FFmpeg-cvslog] r29439 - in trunk/libswscale: rgb2rgb.c rgb2rgb_template.c swscale.c swscale_internal.h

mru subversion
Sun Jul 26 14:26:32 CEST 2009


Author: mru
Date: Sun Jul 26 14:26:32 2009
New Revision: 29439

Log:
Replace WORDS_BIGENDIAN with HAVE_BIGENDIAN

Modified:
   trunk/libswscale/rgb2rgb.c
   trunk/libswscale/rgb2rgb_template.c
   trunk/libswscale/swscale.c
   trunk/libswscale/swscale_internal.h

Modified: trunk/libswscale/rgb2rgb.c
==============================================================================
--- trunk/libswscale/rgb2rgb.c	Fri Jul 24 12:35:22 2009	(r29438)
+++ trunk/libswscale/rgb2rgb.c	Sun Jul 26 14:26:32 2009	(r29439)
@@ -275,7 +275,7 @@ void rgb32to24(const uint8_t *src, uint8
     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
     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, ui
     {
         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, ui
     {
         register uint16_t bgr;
         bgr = *s++;
-        #ifdef WORDS_BIGENDIAN
+        #if HAVE_BIGENDIAN
             *d++ = 255;
             *d++ = (bgr&0x1F)<<3;
             *d++ = (bgr&0x3E0)>>2;

Modified: trunk/libswscale/rgb2rgb_template.c
==============================================================================
--- trunk/libswscale/rgb2rgb_template.c	Fri Jul 24 12:35:22 2009	(r29438)
+++ trunk/libswscale/rgb2rgb_template.c	Sun Jul 26 14:26:32 2009	(r29439)
@@ -115,7 +115,7 @@ static inline void RENAME(rgb24tobgr32)(
     #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)(
 #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)(con
 #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)(con
     {
         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(yuvPlanartoyuy
         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(yuvPlanartouyv
         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

Modified: trunk/libswscale/swscale.c
==============================================================================
--- trunk/libswscale/swscale.c	Fri Jul 24 12:35:22 2009	(r29438)
+++ trunk/libswscale/swscale.c	Sun Jul 26 14:26:32 2009	(r29439)
@@ -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* sr
 
             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:

Modified: trunk/libswscale/swscale_internal.h
==============================================================================
--- trunk/libswscale/swscale_internal.h	Fri Jul 24 12:35:22 2009	(r29438)
+++ trunk/libswscale/swscale_internal.h	Sun Jul 26 14:26:32 2009	(r29439)
@@ -41,7 +41,7 @@
 
 #define VOF  (VOFW*2)
 
-#ifdef WORDS_BIGENDIAN
+#if HAVE_BIGENDIAN
 #define ALT32_CORR (-1)
 #else
 #define ALT32_CORR   1



More information about the ffmpeg-cvslog mailing list