aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--BUILDING.txt171
-rw-r--r--CMakeLists.txt6
-rw-r--r--ChangeLog.txt14
-rwxr-xr-xREADME-turbo.txt12
-rw-r--r--configure.ac8
-rw-r--r--java/README34
-rw-r--r--turbojpeg.c2
7 files changed, 143 insertions, 104 deletions
diff --git a/BUILDING.txt b/BUILDING.txt
index 2e529382..3207d240 100644
--- a/BUILDING.txt
+++ b/BUILDING.txt
@@ -34,7 +34,7 @@ Build Requirements
-- GCC v4.1 or later recommended for best performance
--- If building the TurboJPEG/OSS Java wrapper, JDK or OpenJDK 1.5 or later is
+-- If building the TurboJPEG Java wrapper, JDK or OpenJDK 1.5 or later is
required. Some systems, such as OS X 10.4, Solaris 10 and later, and Red
Hat Enterprise Linux 5 and later, have this pre-installed. On OS X 10.5 and
later, it will be necessary to install the Java Developer Package, which can
@@ -61,9 +61,9 @@ directory. For in-tree builds, these directories are the same.
Building libjpeg-turbo
======================
-The following procedure will build libjpeg-turbo on Linux, FreeBSD, 32-bit
-OS X, Cygwin, and Solaris/x86 systems (on Solaris, this generates a 32-bit
-library. See below for 64-bit build instructions.)
+The following procedure will build libjpeg-turbo on Linux, FreeBSD, Cygwin, and
+Solaris/x86 systems (on Solaris, this generates a 32-bit library. See below
+for 64-bit build instructions.)
cd {source_directory}
autoreconf -fiv
@@ -77,34 +77,38 @@ libjpeg-turbo from the SVN repository.
This will generate the following files under .libs/
libjpeg.a
- Static link library for libjpeg-turbo
+ Static link library for the libjpeg API
- libjpeg.so.{version} (Linux, Solaris)
+ libjpeg.so.{version} (Linux, Unix)
libjpeg.{version}.dylib (OS X)
cygjpeg-{version}.dll (Cygwin)
- Shared library for libjpeg-turbo
+ Shared library for the libjpeg API
- libjpeg.so (Linux, Solaris)
+ By default, {version} is 62.1.0, 7.1.0, or 8.0.2, depending on whether
+ libjpeg v6b (default), v7, or v8 emulation is enabled. If using Cygwin,
+ {version} is 62, 7, or 8.
+
+ libjpeg.so (Linux, Unix)
libjpeg.dylib (OS X)
+ Development symlink for the libjpeg API
+
libjpeg.dll.a (Cygwin)
- Development stub for libjpeg-turbo shared library
+ Import library for the libjpeg API
libturbojpeg.a
- Static link library for TurboJPEG/OSS
+ Static link library for the TurboJPEG API
- libturbojpeg.so (Linux, Solaris)
- libturbojpeg.dylib (OS X)
- Shared library and development stub for TurboJPEG/OSS
+ libturbojpeg.so.0.0.0 (Linux, Unix)
+ libturbojpeg.0.0.0.dylib (OS X)
+ cygturbojpeg-0.dll (Cygwin)
+ Shared library for the TurboJPEG API
- cygturbojpeg.dll (Cygwin)
- Shared library for TurboJPEG/OSS
+ libturbojpeg.so (Linux, Unix)
+ libturbojpeg.dylib (OS X)
+ Development symlink for the TurboJPEG API
libturbojpeg.dll.a (Cygwin)
- Development stub for TurboJPEG/OSS shared library
-
-{version} is 62.0.0, 7.0.0, or 8.0.2, depending on whether libjpeg v6b
-(default), v7, or v8 emulation is enabled. If using Cygwin, {version} is
-62, 7, or 8.
+ Import library for the TurboJPEG API
libjpeg v7 or v8 API/ABI Emulation
@@ -117,6 +121,16 @@ API/ABI-compatible with libjpeg v8. See README-turbo.txt for more information
on libjpeg v7 and v8 emulation.
+In-Memory Source/Destination Managers
+-------------------------------------
+
+When using libjpeg v6b or v7 API/ABI emulation, add --without-mem-srcdst to the
+configure command line to build a version of libjpeg-turbo that lacks the
+jpeg_mem_src() and jpeg_mem_dest() functions. These functions were not part of
+the original libjpeg v6b and v7 APIs, so removing them ensures strict
+conformance with those APIs. See README-turbo.txt for more information.
+
+
Arithmetic Coding Support
-------------------------
@@ -129,13 +143,12 @@ add --without-arith-enc or --without-arith-dec to the configure command line to
disable encoding or decoding (respectively.)
-TurboJPEG/OSS Java Wrapper
---------------------------
+TurboJPEG Java Wrapper
+----------------------
Add --with-java to the configure command line to incorporate an optional Java
-Native Interface wrapper into the TurboJPEG/OSS dynamic library and build the
-Java front-end classes to support it. This allows the TurboJPEG/OSS dynamic
-library to be used directly from Java applications. See java/README for more
-details.
+Native Interface wrapper into the TurboJPEG shared library and build the Java
+front-end classes to support it. This allows the TurboJPEG shared library to
+be used directly from Java applications. See java/README for more details.
You can set the JAVAC, JAR, and JAVA configure variables to specify
alternate commands for javac, jar, and java (respectively.) You can also
@@ -167,7 +180,7 @@ NOTE: You can specify a prefix of /usr and a libdir of, for instance,
/usr/lib64 to overwrite the system's version of libjpeg. If you do this,
however, then be sure to BACK UP YOUR SYSTEM'S INSTALLATION OF LIBJPEG before
overwriting it. It is recommended that you instead install libjpeg-turbo into
-a non-system directory and manipulate the LD_LIBRARY_PATH or create sym links
+a non-system directory and manipulate the LD_LIBRARY_PATH or create symlinks
to force applications to use libjpeg-turbo instead of libjpeg. See
README-turbo.txt for more information.
@@ -177,8 +190,8 @@ Build Recipes
=============
-32-bit Library Build on 64-bit Linux
-------------------------------------
+32-bit Build on 64-bit Linux
+----------------------------
Add
@@ -187,8 +200,8 @@ Add
to the configure command line.
-64-bit Library Build on 64-bit OS X
------------------------------------
+64-bit Build on 64-bit OS X
+---------------------------
Add
@@ -198,8 +211,8 @@ to the configure command line. NASM 2.07 or later from MacPorts must be
installed.
-32-bit Library Build on 64-bit OS X
------------------------------------
+32-bit Build on 64-bit OS X
+---------------------------
Add
@@ -208,8 +221,8 @@ Add
to the configure command line.
-64-bit Backward-Compatible Library Build on 64-bit OS X
--------------------------------------------------------
+64-bit Backward-Compatible Build on 64-bit OS X
+-----------------------------------------------
Add
@@ -223,8 +236,8 @@ to the configure command line. The OS X 10.4 SDK, and NASM 2.07 or later from
MacPorts, must be installed.
-32-bit Backward-Compatible Library Build on OS X
-------------------------------------------------
+32-bit Backward-Compatible Build on OS X
+----------------------------------------
Add
@@ -247,8 +260,8 @@ Add
to the configure command line.
-32-bit Library Build on 64-bit FreeBSD
---------------------------------------
+32-bit Build on 64-bit FreeBSD
+------------------------------
Add
@@ -316,7 +329,7 @@ Set the following shell variables for simplicity:
ARM v6 only (up to and including iPhone 3G):
IOS_CFLAGS="-march=armv6 -mcpu=arm1176jzf-s -mfpu=vfp"
- ARM v7 only (iPhone 3GS and newer, iPad):
+ ARM v7 only (iPhone 3GS-4S, iPad 1st-3rd Generation):
IOS_CFLAGS="-march=armv7 -mcpu=cortex-a8 -mtune=cortex-a8 -mfpu=neon"
Follow the procedure under "Building libjpeg-turbo" above, adding
@@ -331,6 +344,19 @@ to the configure command line.
Once built, lipo can be used to combine the ARM v6 and v7 variants into a
universal library.
+An ARM v7s version of libjpeg-turbo, for iPhone 5 and iPad 4th Generation
+devices, can be built by using the iPhone 5 SDK in XCode 4.5. You will have to
+adjust IOS_PLATFORMDIR, IOS_SYSROOT, and IOS_GCC accordingly, and use the
+following compiler flags:
+
+IOS_CFLAGS="-march=armv7s -mcpu=swift -mtune=swift -mfpu=neon"
+
+Unfortunately, XCode 4.5 also dropped support for ARM v6, so it will not be
+possible to use a single version of XCode to build a universal binary that
+supports both the iPhone 3G and earlier and the iPhone 5/iPad 4 and later.
+Even more unfortunately, XCode 4.5 requires OS X 10.7, which means that we
+cannot currently install and test it.
+
*******************************************************************************
** Building on Windows (Visual C++ or MinGW)
@@ -373,8 +399,8 @@ Build Requirements
-- NASM (http://www.nasm.us/) 0.98 or later (NASM 2.05 or later is required for
a 64-bit build)
--- If building the TurboJPEG/OSS Java wrapper, JDK 1.5 or later is required.
- This can be downloaded from http://www.java.com.
+-- If building the TurboJPEG Java wrapper, JDK 1.5 or later is required. This
+ can be downloaded from http://www.java.com.
==================
@@ -409,17 +435,17 @@ on which version of cl.exe is in the PATH.
The following files will be generated under {build_directory}:
jpeg-static.lib
- Static link library for libjpeg-turbo
+ Static link library for the libjpeg API
sharedlib/jpeg{version}.dll
- DLL for libjpeg-turbo
+ DLL for the libjpeg API
sharedlib/jpeg.lib
- Import library for libjpeg-turbo DLL
+ Import library for the libjpeg API
turbojpeg-static.lib
- Static link library for TurboJPEG/OSS
+ Static link library for the TurboJPEG API
turbojpeg.dll
- DLL for TurboJPEG/OSS
+ DLL for the TurboJPEG API
turbojpeg.lib
- Import library for TurboJPEG/OSS DLL
+ Import library for the TurboJPEG API
{version} is 62, 7, or 8, depending on whether libjpeg v6b (default), v7, or
v8 emulation is enabled.
@@ -442,17 +468,17 @@ build of libjpeg-turbo.
This will generate the following files under {build_directory}:
{configuration}/jpeg-static.lib
- Static link library for libjpeg-turbo
+ Static link library for the libjpeg API
sharedlib/{configuration}/jpeg{version}.dll
- DLL for libjpeg-turbo
+ DLL for the libjpeg API
sharedlib/{configuration}/jpeg.lib
- Import library for libjpeg-turbo DLL
+ Import library for the libjpeg API
{configuration}/turbojpeg-static.lib
- Static link library for TurboJPEG/OSS
+ Static link library for the TurboJPEG API
{configuration}/turbojpeg.dll
- DLL for TurboJPEG/OSS
+ DLL for the TurboJPEG API
{configuration}/turbojpeg.lib
- Import library for TurboJPEG/OSS DLL
+ Import library for the TurboJPEG API
{configuration} is Debug, Release, RelWithDebInfo, or MinSizeRel, depending on
the configuration you built in the IDE, and {version} is 62, 7, or 8,
@@ -469,17 +495,17 @@ MinGW
This will generate the following files under {build_directory}
libjpeg.a
- Static link library for libjpeg-turbo
+ Static link library for the libjpeg API
sharedlib/libjpeg-{version}.dll
- DLL for libjpeg-turbo
+ DLL for the libjpeg API
sharedlib/libjpeg.dll.a
- Import library for libjpeg-turbo DLL
+ Import library for the libjpeg API
libturbojpeg.a
- Static link library for TurboJPEG/OSS
+ Static link library for the TurboJPEG API
libturbojpeg.dll
- DLL for TurboJPEG/OSS
+ DLL for the TurboJPEG API
libturbojpeg.dll.a
- Import library for TurboJPEG/OSS DLL
+ Import library for the TurboJPEG API
{version} is 62, 7, or 8, depending on whether libjpeg v6b (default), v7, or
v8 emulation is enabled.
@@ -503,6 +529,16 @@ API/ABI-compatible with libjpeg v8. See README-turbo.txt for more information
on libjpeg v7 and v8 emulation.
+In-Memory Source/Destination Managers
+-------------------------------------
+
+When using libjpeg v6b or v7 API/ABI emulation, add -DWITH_MEM_SRCDST=0 to the
+CMake command line to build a version of libjpeg-turbo that lacks the
+jpeg_mem_src() and jpeg_mem_dest() functions. These functions were not part of
+the original libjpeg v6b and v7 APIs, so removing them ensures strict
+conformance with those APIs. See README-turbo.txt for more information.
+
+
Arithmetic Coding Support
-------------------------
@@ -515,13 +551,12 @@ add "-DWITH_ARITH_ENC=0" or "-DWITH_ARITH_DEC=0" to the cmake command line to
disable encoding or decoding (respectively.)
-TurboJPEG/OSS Java Wrapper
---------------------------
+TurboJPEG Java Wrapper
+----------------------
Add "-DWITH_JAVA=1" to the cmake command line to incorporate an optional Java
-Native Interface wrapper into the TurboJPEG/OSS dynamic library and build the
-Java front-end classes to support it. This allows the TurboJPEG/OSS dynamic
-library to be used directly from Java applications. See java/README for more
-details.
+Native Interface wrapper into the TurboJPEG shared library and build the Java
+front-end classes to support it. This allows the TurboJPEG shared library to
+be used directly from Java applications. See java/README for more details.
If you are using CMake 2.8, you can set the Java_JAVAC_EXECUTABLE,
Java_JAVA_EXECUTABLE, and Java_JAR_EXECUTABLE CMake variables to specify
@@ -719,11 +754,11 @@ Invoking 'make testclean' or 'nmake testclean' (if using NMake) or building
the 'testclean' target (if using the Visual Studio IDE) will clean up the
output images generated by 'make test'.
-On Unix/Linux platforms, more extensive tests of the TurboJPEG/OSS C and Java
+On Unix/Linux platforms, more extensive tests of the TurboJPEG C and Java
wrappers can be run by invoking 'make tjtest'. These extended TurboJPEG tests
essentially iterate through all of the available features of the TurboJPEG APIs
that are not covered by the TurboJPEG unit tests (this includes the lossless
transform options) and compare the images generated by each feature to images
generated using the equivalent feature in the libjpeg API. The extended
TurboJPEG tests are meant to test for regressions in the TurboJPEG wrappers,
-not in the underlying libjpeg-turbo library.
+not in the underlying libjpeg API library.
diff --git a/CMakeLists.txt b/CMakeLists.txt
index facf4502..98378954 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -46,7 +46,7 @@ option(WITH_ARITH_DEC "Include arithmetic decoding support" TRUE)
option(WITH_JPEG7 "Emulate libjpeg v7 API/ABI (this makes libjpeg-turbo backward incompatible with libjpeg v6b)" FALSE)
option(WITH_JPEG8 "Emulate libjpeg v8 API/ABI (this makes libjpeg-turbo backward incompatible with libjpeg v6b)" FALSE)
option(WITH_MEM_SRCDST "Include in-memory source/destination manager functions when emulating the libjpeg v6b or v7 API/ABI" TRUE)
-option(WITH_JAVA "Build Java wrapper for the TurboJPEG/OSS library" FALSE)
+option(WITH_JAVA "Build Java wrapper for the TurboJPEG library" FALSE)
if(WITH_ARITH_ENC)
set(C_ARITH_CODING_SUPPORTED 1)
@@ -63,9 +63,9 @@ else()
endif()
if(WITH_JAVA)
- message(STATUS "TurboJPEG/OSS Java wrapper enabled")
+ message(STATUS "TurboJPEG Java wrapper enabled")
else()
- message(STATUS "TurboJPEG/OSS Java wrapper disabled")
+ message(STATUS "TurboJPEG Java wrapper disabled")
endif()
set(SO_AGE 0)
diff --git a/ChangeLog.txt b/ChangeLog.txt
index b073d62c..56a858f2 100644
--- a/ChangeLog.txt
+++ b/ChangeLog.txt
@@ -184,7 +184,7 @@ NEON instructions.
TurboJPEG 1.2 API uses pixel formats to define the size and component order of
the uncompressed source/destination images, and it includes a more efficient
version of TJBUFSIZE() that computes a worst-case JPEG size based on the level
-of chrominance subsampling. The refactored implementation of TurboJPEG/OSS
+of chrominance subsampling. The refactored implementation of the TurboJPEG API
now uses the libjpeg memory source and destination managers, which allows the
TurboJPEG compressor to grow the JPEG buffer as necessary.
@@ -260,12 +260,12 @@ and libjpeg-turbo should now produce identical output to libjpeg v6b in all
cases.
[2] Despite the above, the fast integer forward DCT still degrades somewhat for
-JPEG qualities greater than 95, so TurboJPEG/OSS will now automatically use the
-slow integer forward DCT when generating JPEG images of quality 96 or greater.
-This reduces compression performance by as much as 15% for these high-quality
-images but is necessary to ensure that the images are perceptually lossless.
-It also ensures that the library can avoid the performance pitfall created by
-[1].
+JPEG qualities greater than 95, so the TurboJPEG wrapper will now automatically
+use the slow integer forward DCT when generating JPEG images of quality 96 or
+greater. This reduces compression performance by as much as 15% for these
+high-quality images but is necessary to ensure that the images are perceptually
+lossless. It also ensures that the library can avoid the performance pitfall
+created by [1].
[3] Ported jpgtest.cxx to pure C to avoid the need for a C++ compiler.
diff --git a/README-turbo.txt b/README-turbo.txt
index 96e127c5..c6e09dba 100755
--- a/README-turbo.txt
+++ b/README-turbo.txt
@@ -25,7 +25,7 @@ available to a broader range of users and developers.
*******************************************************************************
Most of libjpeg-turbo inherits the non-restrictive, BSD-style license used by
-libjpeg (see README.) The TurboJPEG/OSS wrapper (both C and Java versions) and
+libjpeg (see README.) The TurboJPEG wrapper (both C and Java versions) and
associated test programs bear a similar license, which is reproduced below:
Redistribution and use in source and binary forms, with or without
@@ -69,9 +69,13 @@ JPEG images:
libjpeg API: This is the de facto industry-standard API for compressing and
decompressing JPEG images. It is more difficult to use than the TurboJPEG
- API but also more powerful. libjpeg-turbo is both API/ABI-compatible and
- mathematically compatible with libjpeg v6b. It can also optionally be
- configured to be API/ABI-compatible with libjpeg v7 and v8 (see below.)
+ API but also more powerful. The libjpeg API implementation in libjpeg-turbo
+ is both API/ABI-compatible and mathematically compatible with libjpeg v6b.
+ It can also optionally be configured to be API/ABI-compatible with libjpeg v7
+ and v8 (see below.)
+
+There is no significant performance advantage to either API when both are used
+to perform similar operations.
======================
Installation Directory
diff --git a/configure.ac b/configure.ac
index ea5ab38a..8e75dcec 100644
--- a/configure.ac
+++ b/configure.ac
@@ -242,9 +242,9 @@ AM_CONDITIONAL([WITH_ARITH_DEC], [test "x$with_arith_dec" != "xno"])
AM_CONDITIONAL([WITH_ARITH], [test "x$with_arith_dec" != "xno" -o "x$with_arith_enc" != "xno"])
# TurboJPEG support
-AC_MSG_CHECKING([whether to build TurboJPEG/OSS C wrapper])
+AC_MSG_CHECKING([whether to build TurboJPEG C wrapper])
AC_ARG_WITH([turbojpeg],
- AC_HELP_STRING([--without-turbojpeg],[Do not include the TurboJPEG/OSS wrapper library and associated test programs]))
+ AC_HELP_STRING([--without-turbojpeg],[Do not include the TurboJPEG wrapper library and associated test programs]))
if test "x$with_turbojpeg" = "xno"; then
AC_MSG_RESULT(no)
RPM_CONFIG_ARGS="$RPM_CONFIG_ARGS --without-turbojpeg"
@@ -272,9 +272,9 @@ fi
AC_SUBST(JAVA)
AC_ARG_VAR(JNI_CFLAGS, [C compiler flags needed to include jni.h (default: -I/System/Library/Frameworks/JavaVM.framework/Headers on OS X, '-I/usr/java/include -I/usr/java/include/solaris' on Solaris, and '-I/usr/java/default/include -I/usr/java/default/include/linux' on Linux)])
-AC_MSG_CHECKING([whether to build TurboJPEG/OSS Java wrapper])
+AC_MSG_CHECKING([whether to build TurboJPEG Java wrapper])
AC_ARG_WITH([java],
- AC_HELP_STRING([--with-java],[Build Java wrapper for the TurboJPEG/OSS library]))
+ AC_HELP_STRING([--with-java],[Build Java wrapper for the TurboJPEG library]))
if test "x$with_turbojpeg" = "xno"; then
with_java=no
fi
diff --git a/java/README b/java/README
index 8bca0710..2576ce2c 100644
--- a/java/README
+++ b/java/README
@@ -1,25 +1,25 @@
-TurboJPEG/OSS Java Wrapper
-==========================
-
-TurboJPEG/OSS can optionally be built with a Java Native Interface wrapper,
-which allows the TurboJPEG/OSS dynamic library to be loaded and used directly
-from Java applications. The Java front end for this is defined in several
-classes located under org/libjpegturbo/turbojpeg. The source code for these
-Java classes is licensed under a BSD-style license, so the files can be
-incorporated directly into both open source and proprietary projects without
-restriction. A Java archive (JAR) file containing these classes is also
-shipped with the "official" distribution packages of libjpeg-turbo.
+TurboJPEG Java Wrapper
+======================
+
+The TurboJPEG shared library can optionally be built with a Java Native
+Interface wrapper, which allows the library to be loaded and used directly from
+Java applications. The Java front end for this is defined in several classes
+located under org/libjpegturbo/turbojpeg. The source code for these Java
+classes is licensed under a BSD-style license, so the files can be incorporated
+directly into both open source and proprietary projects without restriction. A
+Java archive (JAR) file containing these classes is also shipped with the
+"official" distribution packages of libjpeg-turbo.
TJExample.java, which should also be located in the same directory as this
-README file, demonstrates how to use the TurboJPEG/OSS Java front end to
-compress and decompress JPEG images in memory.
+README file, demonstrates how to use the TurboJPEG Java API to compress and
+decompress JPEG images in memory.
Performance Pitfalls
--------------------
-The TurboJPEG Java front end defines several convenience methods that can
-allocate image buffers or instantiate classes to hold the result of compress,
+The TurboJPEG Java API defines several convenience methods that can allocate
+image buffers or instantiate classes to hold the result of compress,
decompress, or transform operations. However, if you use these methods, then
be mindful of the amount of new data you are creating on the heap. It may be
necessary to manually invoke the garbage collector to prevent heap exhaustion
@@ -27,8 +27,8 @@ or to prevent performance degradation. Background garbage collection can kill
performance, particularly in a multi-threaded environment (Java pauses all
threads when the GC runs.)
-The Java front end always gives you the option of pre-allocating your own
-source and destination buffers, which allows you to re-use these buffers for
+The TurboJPEG Java API always gives you the option of pre-allocating your own
+source and destination buffers, which allows you to re-use those buffers for
compressing/decompressing multiple images. If the image sequence you are
compressing or decompressing consists of images of the same size, then
pre-allocating the buffers is recommended.
diff --git a/turbojpeg.c b/turbojpeg.c
index 21599c86..ca250a33 100644
--- a/turbojpeg.c
+++ b/turbojpeg.c
@@ -26,7 +26,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-/* TurboJPEG/OSS: this implements the TurboJPEG API using libjpeg-turbo */
+/* TurboJPEG/LJT: this implements the TurboJPEG API using libjpeg-turbo */
#include <stdio.h>
#include <stdlib.h>