diff --git a/ChangeLog.txt b/ChangeLog.txt index 309b5e21..1619a46b 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -32,10 +32,11 @@ SIMD-enabled libjpeg-turbo MIPS build was executed with the -nosmooth option on a MIPS machine that lacked DSPr2 support. The MIPS SIMD routines for h2v1 and h2v2 merged upsampling were not properly checking for the existence of DSPr2. -[6] Performance has been improved significantly on 64-bit Mac platforms -(particularly compression performance.) Due to an oversight, the 64-bit -version of the accelerated Huffman codec was not being compiled in when -libjpeg-turbo was built on OS X. Oops. +[6] Performance has been improved significantly on 64-bit non-Linux and +non-Windows platforms (generally 10-20% faster compression and 5-10% faster +decompression.) Due to an oversight, the 64-bit version of the accelerated +Huffman codec was not being compiled in when libjpeg-turbo was built on +platforms other than Windows or Linux. Oops. [7] Fixed an extremely rare bug in the Huffman encoder that caused 64-bit builds of libjpeg-turbo to incorrectly encode a few specific test images when diff --git a/configure.ac b/configure.ac index f2b8cf2e..6ef4b5c6 100644 --- a/configure.ac +++ b/configure.ac @@ -50,6 +50,8 @@ if test "x$exec_prefix" = "xNONE"; then exec_prefix=${prefix} fi +AC_CHECK_SIZEOF(size_t) + if test "x${libdir}" = 'x${exec_prefix}/lib' -o "x${libdir}" = 'x${prefix}/lib'; then LIBDIR=`eval echo ${libdir}` LIBDIR=`eval echo $LIBDIR` @@ -58,10 +60,9 @@ if test "x${libdir}" = 'x${exec_prefix}/lib' -o "x${libdir}" = 'x${prefix}/lib'; darwin*) ;; *) - AC_CHECK_SIZEOF(long) - if test "${ac_cv_sizeof_long}" = "8"; then + if test "${ac_cv_sizeof_size_t}" = "8"; then libdir='${exec_prefix}/lib64' - elif test "${ac_cv_sizeof_long}" = "4"; then + elif test "${ac_cv_sizeof_size_t}" = "4"; then libdir='${exec_prefix}/lib32' fi ;; diff --git a/jchuff.c b/jchuff.c index 23c66591..4ecc18d6 100644 --- a/jchuff.c +++ b/jchuff.c @@ -21,9 +21,6 @@ #include "jpeglib.h" #include "jchuff.h" /* Declarations shared with jcphuff.c */ #include -#ifdef HAVE_STDINT_H -#include -#endif /* * NOTE: If USE_CLZ_INTRINSIC is defined, then clz/bsr instructions will be @@ -379,11 +376,11 @@ dump_buffer (working_state * state) } \ } -#if !defined(_WIN32) && !defined(__WORDSIZE) -#error __WORDSIZE is not defined +#if !defined(_WIN32) && !defined(SIZEOF_SIZE_T) +#error Cannot determine word size #endif -#if __WORDSIZE==64 || defined(_WIN64) +#if SIZEOF_SIZE_T==8 || defined(_WIN64) #define EMIT_BITS(code, size) { \ CHECKBUF47() \ diff --git a/jconfig.h.in b/jconfig.h.in index fbf64a58..b99a87e1 100644 --- a/jconfig.h.in +++ b/jconfig.h.in @@ -32,9 +32,6 @@ /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H -/* Define to 1 if you have the header file. */ -#undef HAVE_STDINT_H - /* Define to 1 if the system has the type `unsigned char'. */ #undef HAVE_UNSIGNED_CHAR @@ -71,3 +68,6 @@ /* Define to `unsigned int' if does not define. */ #undef size_t + +/* The size of `size_t', as computed by sizeof. */ +#undef SIZEOF_SIZE_T diff --git a/jdhuff.c b/jdhuff.c index 03e39492..cbdce7d4 100644 --- a/jdhuff.c +++ b/jdhuff.c @@ -22,9 +22,6 @@ #include "jdhuff.h" /* Declarations shared with jdphuff.c */ #include "jpegcomp.h" #include "jstdhuff.c" -#ifdef HAVE_STDINT_H -#include -#endif /* @@ -422,11 +419,7 @@ jpeg_fill_bit_buffer (bitread_working_state * state, } \ } -#if !defined(_WIN32) && !defined(__WORDSIZE) -#error __WORDSIZE is not defined -#endif - -#if __WORDSIZE == 64 || defined(_WIN64) +#if SIZEOF_SIZE_T==8 || defined(_WIN64) /* Pre-fetch 48 bytes, because the holding register is 64-bit */ #define FILL_BIT_BUFFER_FAST \ diff --git a/jdhuff.h b/jdhuff.h index f2805e46..c7f3d500 100644 --- a/jdhuff.h +++ b/jdhuff.h @@ -67,7 +67,11 @@ EXTERN(void) jpeg_make_d_derived_tbl * necessary. */ -#if __WORDSIZE == 64 || defined(_WIN64) +#if !defined(_WIN32) && !defined(SIZEOF_SIZE_T) +#error Cannot determine word size +#endif + +#if SIZEOF_SIZE_T==8 || defined(_WIN64) typedef size_t bit_buf_type; /* type of bit-extraction buffer */ #define BIT_BUF_SIZE 64 /* size of buffer in bits */