Add
- --host i686-pc-linux-gnu CFLAGS='-O3 -m32' CXXFLAGS='-O3 -m32' LDFLAGS=-m32
+ --host i686-pc-linux-gnu CFLAGS='-O3 -m32' LDFLAGS=-m32
to the configure command line.
Add
- CFLAGS='-O3 -m32' CXXFLAGS='-O3 -m32' LDFLAGS=-m32
+ CFLAGS='-O3 -m32' LDFLAGS=-m32
to the configure command line.
--host x86_64-apple-darwin NASM=/opt/local/bin/nasm \
CFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \
- -mmacosx-version-min=10.4 -O3' \
- CXXFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \
-mmacosx-version-min=10.4 -O3' \
LDFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \
-mmacosx-version-min=10.4'
Add
CFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \
- -mmacosx-version-min=10.4 -O3 -m32' \
- CXXFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \
-mmacosx-version-min=10.4 -O3 -m32' \
LDFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \
-mmacosx-version-min=10.4 -m32'
Add
- --host x86_64-pc-solaris CFLAGS='-O3 -m64' CXXFLAGS='-O3 -m64' LDFLAGS=-m64
+ --host x86_64-pc-solaris CFLAGS='-O3 -m64' LDFLAGS=-m64
to the configure command line.
Add
- --host i386-unknown-freebsd CC='gcc -B /usr/lib32' CXX='g++ -B/usr/lib32' \
- CFLAGS='-O3 -m32' CXXFLAGS='-O3 -m32' LDFLAGS='-B/usr/lib32'
+ --host i386-unknown-freebsd CC='gcc -B /usr/lib32' CFLAGS='-O3 -m32' \
+ LDFLAGS='-B/usr/lib32'
to the configure command line. NASM 2.07 or later from FreeBSD ports must be
installed.
Add
- CC=cc CXX=CC
+ CC=cc
to the configure command line. libjpeg-turbo will automatically be built with
-the maximum optimization level (-xO5) unless you override CFLAGS and CXXFLAGS.
+the maximum optimization level (-xO5) unless you override CFLAGS.
To build a 64-bit version of libjpeg-turbo using Sun Studio, add
- --host x86_64-pc-solaris CC=cc CXX=CC CFLAGS='-xO5 -m64' \
- CXXFLAGS='-xO5 -m64' LDFLAGS=-m64
+ --host x86_64-pc-solaris CC=cc CFLAGS='-xO5 -m64' LDFLAGS=-m64
to the configure command line.
----------------------------
cd {build_directory}
- CC=/usr/bin/x86_64-w64-mingw32-gcc CXX=/usr/bin/x86_64-w64-mingw32-g++ \
+ CC=/usr/bin/x86_64-w64-mingw32-gcc \
cmake -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Windows \
-DCMAKE_AR=/usr/bin/x86_64-w64-mingw32-ar \
-DCMAKE_RANLIB=/usr/bin/x86_64-w64-mingw32-ranlib {source_directory}
----------------------------
cd {build_directory}
- CC=/usr/bin/i686-w64-mingw32-gcc CXX=/usr/bin/i686-w64-mingw32-g++ \
+ CC=/usr/bin/i686-w64-mingw32-gcc \
cmake -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Windows \
-DDCMAKE_AR=/usr/bin/i686-w64-mingw32-ar \
-DCMAKE_RANLIB=/usr/bin/i686-w64-mingw32-ranlib {source_directory}
cd {build_directory}
CC={mingw-w64_binary_path}/x86_64-w64-mingw32-gcc \
- CXX={mingw-w64_binary_path}/x86_64-w64-mingw32-g++ \
cmake -G "MSYS Makefiles" \
-DCMAKE_AR={mingw-w64_binary_path}/x86_64-w64-mingw32-ar \
-DCMAKE_RANLIB={mingw-w64_binary_path}/x86_64-w64-mingw32-ranlib \
cd {build_directory}
CC={mingw_binary_path}/i386-mingw32-gcc \
- CXX={mingw_binary_path}/i386-mingw32-g++ \
cmake -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Windows \
-DCMAKE_AR={mingw_binary_path}/i386-mingw32-ar \
-DCMAKE_RANLIB={mingw_binary_path}/i386-mingw32-ranlib \
if(MSVC)
# Use the static C library for all build types
foreach(var CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE
- CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO
- CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
- CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
+ CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO)
if(${var} MATCHES "/MD")
string(REGEX REPLACE "/MD" "/MT" ${var} "${${var}}")
endif()
add_executable(jpegut-static jpegut.c)
target_link_libraries(jpegut-static turbojpeg-static)
-add_executable(jpgtest jpgtest.cxx bmp.c)
+add_executable(jpgtest jpgtest.c bmp.c)
target_link_libraries(jpgtest turbojpeg)
-add_executable(jpgtest-static jpgtest.cxx bmp.c)
+add_executable(jpgtest-static jpgtest.c bmp.c)
target_link_libraries(jpgtest-static turbojpeg-static)
add_executable(cjpeg-static cjpeg.c cdjpeg.c rdbmp.c rdgif.c rdppm.c rdswitch.c
reduces compression performance by as much as 15% for these high-quality images
but is necessary to ensure that the images are perceptually lossless.
+[2] Ported jpgtest.cxx to pure C to avoid the need for a C++ compiler.
+
1.0.90 (1.1 beta1)
==================
bin_PROGRAMS = cjpeg djpeg jpegtran rdjpgcom wrjpgcom
noinst_PROGRAMS = jpgtest jpegut
-jpgtest_SOURCES = $(TSTHDRS) jpgtest.cxx bmp.h bmp.c
+jpgtest_SOURCES = $(TSTHDRS) jpgtest.c bmp.h bmp.c
jpgtest_LDADD = libturbojpeg.la
# Checks for programs.
SAVED_CFLAGS=${CFLAGS}
-SAVED_CXXFLAGS=${CXXFLAGS}
AC_PROG_CPP
AC_PROG_CC
-AC_PROG_CXX
AC_PROG_INSTALL
AC_PROG_LIBTOOL
AC_PROG_LN_S
if test "x${SAVED_CFLAGS}" = "x"; then
CFLAGS=-O3
fi
- if test "x${SAVED_CXXFLAGS}" = "x"; then
- CXXFLAGS=-O3
- fi
fi
AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
if test "x${SAVED_CFLAGS}" = "x"; then
CFLAGS=-xO5
fi
- if test "x${SAVED_CXXFLAGS}" = "x"; then
- CXXFLAGS=-xO5
- fi
fi
# Checks for libraries.
/* Copyright (C)2004 Landmark Graphics Corporation
* Copyright (C)2005, 2006 Sun Microsystems, Inc.
- * Copyright (C)2009-2010 D. R. Commander
+ * Copyright (C)2009-2011 D. R. Commander
*
* This library is free software and may be redistributed and/or modified under
* the terms of the wxWindows Library License, Version 3.1 or (at your option)
printf(format, val);
}
-void dotest(unsigned char *srcbuf, int w, int h, BMPPIXELFORMAT pf, int bu,
+void dotest(unsigned char *srcbuf, int w, int h, int pf, int bu,
int jpegsub, int qual, char *filename, int dotile, int useppm, int quiet)
{
char tempstr[1024];
FILE *outfile=NULL; tjhandle hnd;
unsigned char **jpegbuf=NULL, *rgbbuf=NULL;
- rrtimer timer; double elapsed;
+ double start, elapsed;
int jpgbufsize=0, i, j, tilesizex, tilesizey, numtilesx, numtilesy, ITER;
unsigned long *comptilesize=NULL;
int flags=(forcemmx?TJ_FORCEMMX:0)|(forcesse?TJ_FORCESSE:0)
|(forcesse2?TJ_FORCESSE2:0)|(forcesse3?TJ_FORCESSE3:0)
|(fastupsample?TJ_FASTUPSAMPLE:0);
- int ps=_ps[pf];
+ int ps=_ps[pf], tilen;
int pitch=w*ps, yuvsize;
int hsf=_hsf[jpegsub], vsf=_vsf[jpegsub];
int pw=PAD(w, hsf), ph=PAD(h, vsf);
jpegbuf[0], &comptilesize[0], jpegsub, qual, flags)==-1)
_throwtj("executing tjCompress()");
ITER=0;
- timer.start();
+ start=rrtime();
do
{
- jpgbufsize=0; int tilen=0;
+ jpgbufsize=0; tilen=0;
for(i=0; i<h; i+=tilesizey)
{
for(j=0; j<w; j+=tilesizex)
}
}
ITER++;
- } while((elapsed=timer.elapsed())<5.);
+ } while((elapsed=rrtime()-start)<5.);
if(tjDestroy(hnd)==-1) _throwtj("executing tjDestroy()");
hnd=NULL;
if(quiet)
tilesizey, ps, flags)==-1)
_throwtj("executing tjDecompress()");
ITER=0;
- timer.start();
+ start=rrtime();
do
{
int tilen=0;
}
}
ITER++;
- } while((elapsed=timer.elapsed())<5.);
+ } while((elapsed=rrtime()-start)<5.);
if(tjDestroy(hnd)==-1) _throwtj("executing tjDestroy()");
hnd=NULL;
if(quiet)
}
-void dodecomptest(char *filename, BMPPIXELFORMAT pf, int bu, int useppm,
+void dodecomptest(char *filename, int pf, int bu, int useppm,
int quiet)
{
char tempstr[1024];
FILE *file=NULL; tjhandle hnd;
unsigned char *jpegbuf=NULL, *rgbbuf=NULL;
- rrtimer timer; double elapsed;
+ double start, elapsed;
int w, h, ITER;
unsigned long jpgbufsize=0;
int flags=(forcemmx?TJ_FORCEMMX:0)|(forcesse?TJ_FORCESSE:0)
if(tjDecompress(hnd, jpegbuf, jpgbufsize, rgbbuf, w, pitch, h, ps, flags)==-1)
_throwtj("executing tjDecompress()");
ITER=0;
- timer.start();
+ start=rrtime();
do
{
if(tjDecompress(hnd, jpegbuf, jpgbufsize, rgbbuf, w, pitch, h, ps, flags)
==-1)
_throwtj("executing tjDecompress()");
ITER++;
- } while((elapsed=timer.elapsed())<5.);
+ } while((elapsed=rrtime()-start)<5.);
if(tjDestroy(hnd)==-1) _throwtj("executing tjDestroy()");
hnd=NULL;
if(quiet)
{
unsigned char *bmpbuf=NULL; int w, h, i, useppm=0;
int qual, dotile=0, quiet=0, hiqual=-1; char *temp;
- BMPPIXELFORMAT pf=BMP_BGR;
+ int pf=BMP_BGR;
int bu=0, minarg=2;
printf("\n");
#ifndef __RRTIMER_H__
#define __RRTIMER_H__
-#ifdef __cplusplus
-
-#ifdef _WIN32
-#include <windows.h>
-#else
-#include <sys/time.h>
-#endif
-
-class rrtimer
-{
- public:
-
- rrtimer(void) : t1(0.0)
- {
- #ifdef _WIN32
- highres=false; tick=0.001;
- LARGE_INTEGER Frequency;
- if(QueryPerformanceFrequency(&Frequency)!=0)
- {
- tick=(double)1.0/(double)(Frequency.QuadPart);
- highres=true;
- }
- #endif
- }
-
- void start(void)
- {
- t1=time();
- }
-
- double time(void)
- {
- #ifdef _WIN32
- if(highres)
- {
- LARGE_INTEGER Time;
- QueryPerformanceCounter(&Time);
- return((double)(Time.QuadPart)*tick);
- }
- else
- return((double)GetTickCount()*tick);
- #else
- struct timeval __tv;
- gettimeofday(&__tv, (struct timezone *)NULL);
- return((double)(__tv.tv_sec)+(double)(__tv.tv_usec)*0.000001);
- #endif
- }
-
- double elapsed(void)
- {
- return time()-t1;
- }
-
- private:
-
- #ifdef _WIN32
- bool highres; double tick;
- #endif
- double t1;
-};
-
-#endif // __cplusplus
-
#ifdef _WIN32
#include <windows.h>
#endif
#endif
-