fixed nanogoat bug
[org.ibex.core.git] / upstream / jpeg-6b / patches / jpeg-6b.patch
1 --- jmorecfg.h  Thu Jun 12 03:18:52 2003
2 +++ jmorecfg.h  Thu Jun 12 03:21:25 2003
3 @@ -290,8 +290,11 @@
4  #define IDCT_SCALING_SUPPORTED      /* Output rescaling via IDCT? */
5  #undef  UPSAMPLE_SCALING_SUPPORTED  /* Output rescaling at upsample stage? */
6  #define UPSAMPLE_MERGING_SUPPORTED  /* Fast path for sloppy upsampling? */
7 +/* Can't use these with RGB_PIXELSIZE != 3 */
8 +#if 0
9  #define QUANT_1PASS_SUPPORTED      /* 1-pass color quantization? */
10  #define QUANT_2PASS_SUPPORTED      /* 2-pass color quantization? */
11 +#endif
12  
13  /* more capability options later, no doubt */
14  
15 @@ -311,10 +314,30 @@
16   *    can't use color quantization if you change that value.
17   */
18  
19 -#define RGB_RED       0        /* Offset of Red in an RGB scanline element */
20 +#include <sys/types.h>
21 +#if defined(__BYTE_ORDER) && !defined(BYTE_ORDER)
22 +#define BYTE_ORDER __BYTE_ORDER
23 +#endif
24 +#if defined(__LITTLE_ENDIAN) && !defined(LITTLE_ENDIAN)
25 +#define LITTLE_ENDIAN __LITTLE_ENDIAN
26 +#endif
27 +#if defined(__BIG_ENDIAN) && !defined(BIG_ENDIAN)
28 +#define BIG_ENDIAN __BIG_ENDIAN
29 +#endif
30 +
31 +#if BYTE_ORDER == BIG_ENDIAN
32 +#define RGB_RED        1       /* Offset of Red in an RGB scanline element */
33 +#define RGB_GREEN      2       /* Offset of Green */
34 +#define RGB_BLUE       3       /* Offset of Blue */
35 +#elif BYTE_ORDER == LITTLE_ENDIAN
36 +#define RGB_RED        2       /* Offset of Red in an RGB scanline element */
37  #define RGB_GREEN      1       /* Offset of Green */
38 -#define RGB_BLUE       2       /* Offset of Blue */
39 -#define RGB_PIXELSIZE  3       /* JSAMPLEs per RGB scanline element */
40 +#define RGB_BLUE       0       /* Offset of Blue */
41 +#else
42 +#error Cannot figure out endianness
43 +#endif
44 +
45 +#define RGB_PIXELSIZE  4       /* JSAMPLEs per RGB scanline element */
46  
47  
48  /* Definitions for speed-related optimizations. */