2003/06/16 23:19:47
authorbrian <brian@xwt.org>
Fri, 30 Jan 2004 07:01:27 +0000 (07:01 +0000)
committerbrian <brian@xwt.org>
Fri, 30 Jan 2004 07:01:27 +0000 (07:01 +0000)
darcs-hash:20040130070127-aa32f-e21fa1f574a6fbce030f1a70daca0591b529a170.gz

src/org/ijg/jmorecfg.h.patch

index b703dda..f56340b 100644 (file)
@@ -1,11 +1,48 @@
---- jmorecfg.h-        Tue Apr  8 04:33:05 2003
-+++ jmorecfg.h Tue Apr  8 04:33:13 2003
-@@ -314,7 +314,7 @@
- #define RGB_RED               0       /* Offset of Red in an RGB scanline element */
- #define RGB_GREEN     1       /* Offset of Green */
- #define RGB_BLUE      2       /* Offset of Blue */
--#define RGB_PIXELSIZE 3       /* JSAMPLEs per RGB scanline element */
-+#define RGB_PIXELSIZE 4       /* JSAMPLEs per RGB scanline element */
+--- jmorecfg.h.orig    Thu Jun 12 03:18:52 2003
++++ jmorecfg.h Thu Jun 12 03:21:25 2003
+@@ -290,8 +290,11 @@
+ #define IDCT_SCALING_SUPPORTED      /* Output rescaling via IDCT? */
+ #undef  UPSAMPLE_SCALING_SUPPORTED  /* Output rescaling at upsample stage? */
+ #define UPSAMPLE_MERGING_SUPPORTED  /* Fast path for sloppy upsampling? */
++/* Can't use these with RGB_PIXELSIZE != 3 */
++#if 0
+ #define QUANT_1PASS_SUPPORTED      /* 1-pass color quantization? */
+ #define QUANT_2PASS_SUPPORTED      /* 2-pass color quantization? */
++#endif
+ /* more capability options later, no doubt */
+@@ -311,10 +314,30 @@
+  *    can't use color quantization if you change that value.
+  */
+-#define RGB_RED       0        /* Offset of Red in an RGB scanline element */
++#include <sys/types.h>
++#if defined(__BYTE_ORDER) && !defined(BYTE_ORDER)
++#define BYTE_ORDER __BYTE_ORDER
++#endif
++#if defined(__LITTLE_ENDIAN) && !defined(LITTLE_ENDIAN)
++#define LITTLE_ENDIAN __LITTLE_ENDIAN
++#endif
++#if defined(__BIG_ENDIAN) && !defined(BIG_ENDIAN)
++#define BIG_ENDIAN __BIG_ENDIAN
++#endif
++
++#if BYTE_ORDER == BIG_ENDIAN
++#define RGB_RED        1       /* Offset of Red in an RGB scanline element */
++#define RGB_GREEN      2       /* Offset of Green */
++#define RGB_BLUE       3       /* Offset of Blue */
++#elif BYTE_ORDER == LITTLE_ENDIAN
++#define RGB_RED        2       /* Offset of Red in an RGB scanline element */
+ #define RGB_GREEN      1       /* Offset of Green */
+-#define RGB_BLUE       2       /* Offset of Blue */
+-#define RGB_PIXELSIZE  3       /* JSAMPLEs per RGB scanline element */
++#define RGB_BLUE       0       /* Offset of Blue */
++#else
++#error Cannot figure out endianness
++#endif
++
++#define RGB_PIXELSIZE  4       /* JSAMPLEs per RGB scanline element */
  
  
  /* Definitions for speed-related optimizations. */