diff --git a/acinclude.m4 b/acinclude.m4 index 80311369..978a469b 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -144,26 +144,26 @@ AC_DEFUN([AC_CHECK_COMPATIBLE_ARM_ASSEMBLER_IFELSE],[ ac_save_CFLAGS="$CFLAGS" CFLAGS="$CCASFLAGS -x assembler-with-cpp" CC="$CCAS" - AC_COMPILE_IFELSE([[ + AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ .text .fpu neon .arch armv7a .object_arch armv4 .arm pld [r0] - vmovn.u16 d0, q0]], ac_good_gnu_arm_assembler=yes) + vmovn.u16 d0, q0]])], ac_good_gnu_arm_assembler=yes) ac_use_gas_preprocessor=no if test "x$ac_good_gnu_arm_assembler" = "xno" ; then CC="gas-preprocessor.pl $CCAS" - AC_COMPILE_IFELSE([[ + AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ .text .fpu neon .arch armv7a .object_arch armv4 .arm pld [r0] - vmovn.u16 d0, q0]], ac_use_gas_preprocessor=yes) + vmovn.u16 d0, q0]])], ac_use_gas_preprocessor=yes) fi CFLAGS="$ac_save_CFLAGS" CC="$ac_save_CC" @@ -189,7 +189,7 @@ AC_DEFUN([AC_CHECK_COMPATIBLE_MIPSEL_ASSEMBLER_IFELSE],[ ac_save_CFLAGS="$CFLAGS" CFLAGS="$CCASFLAGS -mdspr2" - AC_COMPILE_IFELSE([[ + AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ int main () { @@ -201,7 +201,7 @@ AC_DEFUN([AC_CHECK_COMPATIBLE_MIPSEL_ASSEMBLER_IFELSE],[ ); return c; } - ]], have_mips_dspr2=yes) + ]])], have_mips_dspr2=yes) CFLAGS=$ac_save_CFLAGS if test "x$have_mips_dspr2" = "xyes" ; then diff --git a/configure.ac b/configure.ac index ec8a47c3..c64f58fb 100644 --- a/configure.ac +++ b/configure.ac @@ -2,10 +2,11 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ([2.56]) -AC_INIT([libmozjpeg], [1.0.0]) +AC_INIT([libmozjpeg], [1.0.2]) BUILD=`date +%Y%m%d` AM_INIT_AUTOMAKE([-Wall foreign dist-bzip2]) +m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES(yes)]) AC_PREFIX_DEFAULT(/opt/libmozjpeg) # Always build with prototypes @@ -16,8 +17,10 @@ SAVED_CFLAGS=${CFLAGS} SAVED_CPPFLAGS=${CPPFLAGS} AC_PROG_CPP AC_PROG_CC +AM_PROG_CC_C_O AM_PROG_AS AC_PROG_INSTALL +AM_PROG_AR AC_PROG_LIBTOOL AC_PROG_LN_S @@ -235,13 +238,13 @@ VERS_1 { global: *; }; EOF -AC_LINK_IFELSE(AC_LANG_PROGRAM([], []), +AC_LINK_IFELSE([AC_LANG_SOURCE([AC_LANG_PROGRAM([], [])])], [VERSION_SCRIPT_FLAG=-Wl,--version-script,; AC_MSG_RESULT([yes (GNU style)])], []) if test "x$VERSION_SCRIPT_FLAG" = "x"; then LDFLAGS="$SAVED_LDFLAGS -Wl,-M,conftest.map" - AC_LINK_IFELSE(AC_LANG_PROGRAM([], []), + AC_LINK_IFELSE([AC_LANG_SOURCE([AC_LANG_PROGRAM([], [])])], [VERSION_SCRIPT_FLAG=-Wl,-M,; AC_MSG_RESULT([yes (Sun style)])], []) @@ -270,7 +273,7 @@ int bar() { return foo();], ljt_cv_inline="__inline", AC_TRY_COMPILE(, [} inline int foo() { return 0; } int bar() { return foo();], ljt_cv_inline="inline")))) AC_MSG_RESULT($ljt_cv_inline) -AC_DEFINE_UNQUOTED([INLINE],[$ljt_cv_inline],[How to obtain function inlining.]) +AC_DEFINE_UNQUOTED([INLINE],[inline $ljt_cv_inline],[How to obtain function inlining.]) # Arithmetic coding support AC_MSG_CHECKING([whether to include arithmetic encoding support]) diff --git a/jcmaster.c b/jcmaster.c index e2abd165..a4ed4839 100644 --- a/jcmaster.c +++ b/jcmaster.c @@ -596,8 +596,7 @@ select_scans (j_compress_ptr cinfo, int next_scan_number) { my_master_ptr master = (my_master_ptr) cinfo->master; - unsigned long size[8]; - int base_scan_idx; + int base_scan_idx = 0; int luma_freq_split_scan_start = cinfo->num_scans_luma_dc + 3 * cinfo->Al_max_luma + 2; int chroma_freq_split_scan_start = cinfo->num_scans_luma+cinfo->num_scans_chroma_dc+(6*cinfo->Al_max_chroma+4); diff --git a/simd/Makefile.am b/simd/Makefile.am index 7b59298d..a4f116e7 100644 --- a/simd/Makefile.am +++ b/simd/Makefile.am @@ -67,7 +67,7 @@ endif AM_CPPFLAGS = -I$(top_srcdir) .asm.lo: - $(LIBTOOL) --mode=compile --tag NASM $(srcdir)/nasm_lt.sh $(NASM) $(NAFLAGS) -I$(srcdir) -I. $< -o $@ + $(AM_V_GEN) $(LIBTOOL) $(AM_V_lt) --mode=compile $(srcdir)/nasm_lt.sh $(AM_V_lt) $(NASM) $(NAFLAGS) -I$(srcdir) -I. $< -o $@ jsimdcfg.inc: $(srcdir)/jsimdcfg.inc.h ../jpeglib.h ../jconfig.h ../jmorecfg.h - $(CPP) -I$(top_builddir) -I$(top_builddir)/simd $(srcdir)/jsimdcfg.inc.h | $(EGREP) "^[\;%]|^\ %" | sed 's%_cpp_protection_%%' | sed 's@% define@%define@g' > $@ + $(AM_V_GEN) $(CPP) -I$(top_builddir) -I$(top_builddir)/simd $(srcdir)/jsimdcfg.inc.h | $(EGREP) "^[\;%]|^\ %" | sed 's%_cpp_protection_%%' | sed 's@% define@%define@g' > $@ diff --git a/simd/nasm_lt.sh b/simd/nasm_lt.sh index 6cd73294..817be161 100755 --- a/simd/nasm_lt.sh +++ b/simd/nasm_lt.sh @@ -5,6 +5,9 @@ o_opt=no pic=no while [ $# -gt 0 ]; do case "$1" in + --silent) + exec > /dev/null + ;; -DPIC|-fPIC|-fpic|-Kpic|-KPIC) if [ "$pic" != "yes" ] ; then command="$command -DPIC" diff --git a/tjbench.c b/tjbench.c index 7a7bc920..9fe8d050 100644 --- a/tjbench.c +++ b/tjbench.c @@ -256,7 +256,7 @@ int decomptest(unsigned char *srcbuf, unsigned char **jpegbuf, } -void dotestyuv(unsigned char *srcbuf, int w, int h, int subsamp, +int dotestyuv(unsigned char *srcbuf, int w, int h, int subsamp, char *filename) { char tempstr[1024], tempstr2[80]; @@ -328,11 +328,11 @@ void dotestyuv(unsigned char *srcbuf, int w, int h, int subsamp, if(file) {fclose(file); file=NULL;} if(dstbuf) {free(dstbuf); dstbuf=NULL;} if(handle) {tjDestroy(handle); handle=NULL;} - return; + return retval; } -void dotest(unsigned char *srcbuf, int w, int h, int subsamp, int jpegqual, +int dotest(unsigned char *srcbuf, int w, int h, int subsamp, int jpegqual, char *filename) { char tempstr[1024], tempstr2[80]; @@ -345,7 +345,7 @@ void dotest(unsigned char *srcbuf, int w, int h, int subsamp, int jpegqual, int ntilesw=1, ntilesh=1, pitch=w*ps; const char *pfStr=(yuv==YUVCOMPRESS)? "YUV":pixFormatStr[pf]; - if(yuv==YUVENCODE) {dotestyuv(srcbuf, w, h, subsamp, filename); return;} + if(yuv==YUVENCODE) {dotestyuv(srcbuf, w, h, subsamp, filename); return retval;} if((tmpbuf=(unsigned char *)malloc(pitch*h)) == NULL) _throwunix("allocating temporary image buffer"); @@ -498,11 +498,11 @@ void dotest(unsigned char *srcbuf, int w, int h, int subsamp, int jpegqual, if(jpegsize) {free(jpegsize); jpegsize=NULL;} if(tmpbuf) {free(tmpbuf); tmpbuf=NULL;} if(handle) {tjDestroy(handle); handle=NULL;} - return; + return retval; } -void dodecomptest(char *filename) +int dodecomptest(char *filename) { FILE *file=NULL; tjhandle handle=NULL; unsigned char **jpegbuf=NULL, *srcbuf=NULL; @@ -706,7 +706,7 @@ void dodecomptest(char *filename) if(srcbuf) {free(srcbuf); srcbuf=NULL;} if(t) {free(t); t=NULL;} if(handle) {tjDestroy(handle); handle=NULL;} - return; + return retval; } diff --git a/transupp.c b/transupp.c index 70e8c498..2537d872 100644 --- a/transupp.c +++ b/transupp.c @@ -1171,6 +1171,7 @@ transpose_critical_parameters (j_compress_ptr dstinfo) } +#if JPEG_LIB_VERSION >= 70 /* Adjust Exif image parameters. * * We try to adjust the Tags ExifImageWidth and ExifImageHeight if possible. @@ -1325,6 +1326,7 @@ adjust_exif_parameters (JOCTET FAR * data, unsigned int length, offset += 12; } while (--number_of_tags); } +#endif /* Adjust output image parameters as needed. diff --git a/turbojpeg.c b/turbojpeg.c index 61943623..694e558e 100644 --- a/turbojpeg.c +++ b/turbojpeg.c @@ -123,7 +123,10 @@ static const tjscalingfactor sf[NUMSF]={ j_compress_ptr cinfo=NULL; j_decompress_ptr dinfo=NULL; \ if(!this) {snprintf(errStr, JMSG_LENGTH_MAX, "Invalid handle"); \ return -1;} \ - cinfo=&this->cinfo; dinfo=&this->dinfo; + cinfo=&this->cinfo; \ + (void)cinfo; \ + dinfo=&this->dinfo; \ + (void)dinfo static int getPixelFormat(int pixelSize, int flags) { @@ -612,7 +615,7 @@ DLLEXPORT int DLLCALL tjCompress2(tjhandle handle, unsigned char *srcBuf, unsigned char *rgbBuf=NULL; #endif - getinstance(handle) + getinstance(handle); if((this->init&COMPRESS)==0) _throw("tjCompress2(): Instance has not been initialized for compression"); @@ -878,7 +881,7 @@ DLLEXPORT int DLLCALL tjCompressFromYUV(tjhandle handle, unsigned char *srcBuf, tmpbufsize=0, usetmpbuf=0, th[MAX_COMPONENTS]; JSAMPLE *_tmpbuf=NULL, *ptr=srcBuf; JSAMPROW *tmpbuf[MAX_COMPONENTS]; - getinstance(handle) + getinstance(handle); for(i=0; i