12
acinclude.m4
12
acinclude.m4
@@ -144,26 +144,26 @@ AC_DEFUN([AC_CHECK_COMPATIBLE_ARM_ASSEMBLER_IFELSE],[
|
|||||||
ac_save_CFLAGS="$CFLAGS"
|
ac_save_CFLAGS="$CFLAGS"
|
||||||
CFLAGS="$CCASFLAGS -x assembler-with-cpp"
|
CFLAGS="$CCASFLAGS -x assembler-with-cpp"
|
||||||
CC="$CCAS"
|
CC="$CCAS"
|
||||||
AC_COMPILE_IFELSE([[
|
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
||||||
.text
|
.text
|
||||||
.fpu neon
|
.fpu neon
|
||||||
.arch armv7a
|
.arch armv7a
|
||||||
.object_arch armv4
|
.object_arch armv4
|
||||||
.arm
|
.arm
|
||||||
pld [r0]
|
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
|
ac_use_gas_preprocessor=no
|
||||||
if test "x$ac_good_gnu_arm_assembler" = "xno" ; then
|
if test "x$ac_good_gnu_arm_assembler" = "xno" ; then
|
||||||
CC="gas-preprocessor.pl $CCAS"
|
CC="gas-preprocessor.pl $CCAS"
|
||||||
AC_COMPILE_IFELSE([[
|
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
||||||
.text
|
.text
|
||||||
.fpu neon
|
.fpu neon
|
||||||
.arch armv7a
|
.arch armv7a
|
||||||
.object_arch armv4
|
.object_arch armv4
|
||||||
.arm
|
.arm
|
||||||
pld [r0]
|
pld [r0]
|
||||||
vmovn.u16 d0, q0]], ac_use_gas_preprocessor=yes)
|
vmovn.u16 d0, q0]])], ac_use_gas_preprocessor=yes)
|
||||||
fi
|
fi
|
||||||
CFLAGS="$ac_save_CFLAGS"
|
CFLAGS="$ac_save_CFLAGS"
|
||||||
CC="$ac_save_CC"
|
CC="$ac_save_CC"
|
||||||
@@ -189,7 +189,7 @@ AC_DEFUN([AC_CHECK_COMPATIBLE_MIPSEL_ASSEMBLER_IFELSE],[
|
|||||||
ac_save_CFLAGS="$CFLAGS"
|
ac_save_CFLAGS="$CFLAGS"
|
||||||
CFLAGS="$CCASFLAGS -mdspr2"
|
CFLAGS="$CCASFLAGS -mdspr2"
|
||||||
|
|
||||||
AC_COMPILE_IFELSE([[
|
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
||||||
|
|
||||||
int main ()
|
int main ()
|
||||||
{
|
{
|
||||||
@@ -201,7 +201,7 @@ AC_DEFUN([AC_CHECK_COMPATIBLE_MIPSEL_ASSEMBLER_IFELSE],[
|
|||||||
);
|
);
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
]], have_mips_dspr2=yes)
|
]])], have_mips_dspr2=yes)
|
||||||
CFLAGS=$ac_save_CFLAGS
|
CFLAGS=$ac_save_CFLAGS
|
||||||
|
|
||||||
if test "x$have_mips_dspr2" = "xyes" ; then
|
if test "x$have_mips_dspr2" = "xyes" ; then
|
||||||
|
|||||||
11
configure.ac
11
configure.ac
@@ -2,10 +2,11 @@
|
|||||||
# Process this file with autoconf to produce a configure script.
|
# Process this file with autoconf to produce a configure script.
|
||||||
|
|
||||||
AC_PREREQ([2.56])
|
AC_PREREQ([2.56])
|
||||||
AC_INIT([libmozjpeg], [1.0.0])
|
AC_INIT([libmozjpeg], [1.0.2])
|
||||||
BUILD=`date +%Y%m%d`
|
BUILD=`date +%Y%m%d`
|
||||||
|
|
||||||
AM_INIT_AUTOMAKE([-Wall foreign dist-bzip2])
|
AM_INIT_AUTOMAKE([-Wall foreign dist-bzip2])
|
||||||
|
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES(yes)])
|
||||||
AC_PREFIX_DEFAULT(/opt/libmozjpeg)
|
AC_PREFIX_DEFAULT(/opt/libmozjpeg)
|
||||||
|
|
||||||
# Always build with prototypes
|
# Always build with prototypes
|
||||||
@@ -16,8 +17,10 @@ SAVED_CFLAGS=${CFLAGS}
|
|||||||
SAVED_CPPFLAGS=${CPPFLAGS}
|
SAVED_CPPFLAGS=${CPPFLAGS}
|
||||||
AC_PROG_CPP
|
AC_PROG_CPP
|
||||||
AC_PROG_CC
|
AC_PROG_CC
|
||||||
|
AM_PROG_CC_C_O
|
||||||
AM_PROG_AS
|
AM_PROG_AS
|
||||||
AC_PROG_INSTALL
|
AC_PROG_INSTALL
|
||||||
|
AM_PROG_AR
|
||||||
AC_PROG_LIBTOOL
|
AC_PROG_LIBTOOL
|
||||||
AC_PROG_LN_S
|
AC_PROG_LN_S
|
||||||
|
|
||||||
@@ -235,13 +238,13 @@ VERS_1 {
|
|||||||
global: *;
|
global: *;
|
||||||
};
|
};
|
||||||
EOF
|
EOF
|
||||||
AC_LINK_IFELSE(AC_LANG_PROGRAM([], []),
|
AC_LINK_IFELSE([AC_LANG_SOURCE([AC_LANG_PROGRAM([], [])])],
|
||||||
[VERSION_SCRIPT_FLAG=-Wl,--version-script,;
|
[VERSION_SCRIPT_FLAG=-Wl,--version-script,;
|
||||||
AC_MSG_RESULT([yes (GNU style)])],
|
AC_MSG_RESULT([yes (GNU style)])],
|
||||||
[])
|
[])
|
||||||
if test "x$VERSION_SCRIPT_FLAG" = "x"; then
|
if test "x$VERSION_SCRIPT_FLAG" = "x"; then
|
||||||
LDFLAGS="$SAVED_LDFLAGS -Wl,-M,conftest.map"
|
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,;
|
[VERSION_SCRIPT_FLAG=-Wl,-M,;
|
||||||
AC_MSG_RESULT([yes (Sun style)])],
|
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; }
|
AC_TRY_COMPILE(, [} inline int foo() { return 0; }
|
||||||
int bar() { return foo();], ljt_cv_inline="inline"))))
|
int bar() { return foo();], ljt_cv_inline="inline"))))
|
||||||
AC_MSG_RESULT($ljt_cv_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
|
# Arithmetic coding support
|
||||||
AC_MSG_CHECKING([whether to include arithmetic encoding support])
|
AC_MSG_CHECKING([whether to include arithmetic encoding support])
|
||||||
|
|||||||
@@ -596,8 +596,7 @@ select_scans (j_compress_ptr cinfo, int next_scan_number)
|
|||||||
{
|
{
|
||||||
my_master_ptr master = (my_master_ptr) cinfo->master;
|
my_master_ptr master = (my_master_ptr) cinfo->master;
|
||||||
|
|
||||||
unsigned long size[8];
|
int base_scan_idx = 0;
|
||||||
int base_scan_idx;
|
|
||||||
int luma_freq_split_scan_start = cinfo->num_scans_luma_dc + 3 * cinfo->Al_max_luma + 2;
|
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);
|
int chroma_freq_split_scan_start = cinfo->num_scans_luma+cinfo->num_scans_chroma_dc+(6*cinfo->Al_max_chroma+4);
|
||||||
|
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ endif
|
|||||||
AM_CPPFLAGS = -I$(top_srcdir)
|
AM_CPPFLAGS = -I$(top_srcdir)
|
||||||
|
|
||||||
.asm.lo:
|
.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
|
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' > $@
|
||||||
|
|||||||
@@ -5,6 +5,9 @@ o_opt=no
|
|||||||
pic=no
|
pic=no
|
||||||
while [ $# -gt 0 ]; do
|
while [ $# -gt 0 ]; do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
|
--silent)
|
||||||
|
exec > /dev/null
|
||||||
|
;;
|
||||||
-DPIC|-fPIC|-fpic|-Kpic|-KPIC)
|
-DPIC|-fPIC|-fpic|-Kpic|-KPIC)
|
||||||
if [ "$pic" != "yes" ] ; then
|
if [ "$pic" != "yes" ] ; then
|
||||||
command="$command -DPIC"
|
command="$command -DPIC"
|
||||||
|
|||||||
14
tjbench.c
14
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 *filename)
|
||||||
{
|
{
|
||||||
char tempstr[1024], tempstr2[80];
|
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(file) {fclose(file); file=NULL;}
|
||||||
if(dstbuf) {free(dstbuf); dstbuf=NULL;}
|
if(dstbuf) {free(dstbuf); dstbuf=NULL;}
|
||||||
if(handle) {tjDestroy(handle); handle=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 *filename)
|
||||||
{
|
{
|
||||||
char tempstr[1024], tempstr2[80];
|
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;
|
int ntilesw=1, ntilesh=1, pitch=w*ps;
|
||||||
const char *pfStr=(yuv==YUVCOMPRESS)? "YUV":pixFormatStr[pf];
|
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)
|
if((tmpbuf=(unsigned char *)malloc(pitch*h)) == NULL)
|
||||||
_throwunix("allocating temporary image buffer");
|
_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(jpegsize) {free(jpegsize); jpegsize=NULL;}
|
||||||
if(tmpbuf) {free(tmpbuf); tmpbuf=NULL;}
|
if(tmpbuf) {free(tmpbuf); tmpbuf=NULL;}
|
||||||
if(handle) {tjDestroy(handle); handle=NULL;}
|
if(handle) {tjDestroy(handle); handle=NULL;}
|
||||||
return;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void dodecomptest(char *filename)
|
int dodecomptest(char *filename)
|
||||||
{
|
{
|
||||||
FILE *file=NULL; tjhandle handle=NULL;
|
FILE *file=NULL; tjhandle handle=NULL;
|
||||||
unsigned char **jpegbuf=NULL, *srcbuf=NULL;
|
unsigned char **jpegbuf=NULL, *srcbuf=NULL;
|
||||||
@@ -706,7 +706,7 @@ void dodecomptest(char *filename)
|
|||||||
if(srcbuf) {free(srcbuf); srcbuf=NULL;}
|
if(srcbuf) {free(srcbuf); srcbuf=NULL;}
|
||||||
if(t) {free(t); t=NULL;}
|
if(t) {free(t); t=NULL;}
|
||||||
if(handle) {tjDestroy(handle); handle=NULL;}
|
if(handle) {tjDestroy(handle); handle=NULL;}
|
||||||
return;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1171,6 +1171,7 @@ transpose_critical_parameters (j_compress_ptr dstinfo)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#if JPEG_LIB_VERSION >= 70
|
||||||
/* Adjust Exif image parameters.
|
/* Adjust Exif image parameters.
|
||||||
*
|
*
|
||||||
* We try to adjust the Tags ExifImageWidth and ExifImageHeight if possible.
|
* 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;
|
offset += 12;
|
||||||
} while (--number_of_tags);
|
} while (--number_of_tags);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* Adjust output image parameters as needed.
|
/* Adjust output image parameters as needed.
|
||||||
|
|||||||
@@ -123,7 +123,10 @@ static const tjscalingfactor sf[NUMSF]={
|
|||||||
j_compress_ptr cinfo=NULL; j_decompress_ptr dinfo=NULL; \
|
j_compress_ptr cinfo=NULL; j_decompress_ptr dinfo=NULL; \
|
||||||
if(!this) {snprintf(errStr, JMSG_LENGTH_MAX, "Invalid handle"); \
|
if(!this) {snprintf(errStr, JMSG_LENGTH_MAX, "Invalid handle"); \
|
||||||
return -1;} \
|
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)
|
static int getPixelFormat(int pixelSize, int flags)
|
||||||
{
|
{
|
||||||
@@ -612,7 +615,7 @@ DLLEXPORT int DLLCALL tjCompress2(tjhandle handle, unsigned char *srcBuf,
|
|||||||
unsigned char *rgbBuf=NULL;
|
unsigned char *rgbBuf=NULL;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
getinstance(handle)
|
getinstance(handle);
|
||||||
if((this->init&COMPRESS)==0)
|
if((this->init&COMPRESS)==0)
|
||||||
_throw("tjCompress2(): Instance has not been initialized for compression");
|
_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];
|
tmpbufsize=0, usetmpbuf=0, th[MAX_COMPONENTS];
|
||||||
JSAMPLE *_tmpbuf=NULL, *ptr=srcBuf; JSAMPROW *tmpbuf[MAX_COMPONENTS];
|
JSAMPLE *_tmpbuf=NULL, *ptr=srcBuf; JSAMPROW *tmpbuf[MAX_COMPONENTS];
|
||||||
|
|
||||||
getinstance(handle)
|
getinstance(handle);
|
||||||
|
|
||||||
for(i=0; i<MAX_COMPONENTS; i++)
|
for(i=0; i<MAX_COMPONENTS; i++)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user