Eliminated the awkward and confusing "TurboJPEG/OSS" designation, since there are no other active implementations of the TurboJPEG API anymore; don't refer to the libjpeg API library as "libjpeg-turbo" anymore, since that can be confusing; ARM v7s build instructions

git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@919 632fc199-4ca6-4c93-a231-07263d6284db
This commit is contained in:
DRC
2013-01-21 23:42:12 +00:00
parent 515fece330
commit 34be67477f
7 changed files with 142 additions and 103 deletions

View File

@@ -34,7 +34,7 @@ Build Requirements
-- GCC v4.1 or later recommended for best performance -- 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 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 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 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 Building libjpeg-turbo
====================== ======================
The following procedure will build libjpeg-turbo on Linux, FreeBSD, 32-bit The following procedure will build libjpeg-turbo on Linux, FreeBSD, Cygwin, and
OS X, Cygwin, and Solaris/x86 systems (on Solaris, this generates a 32-bit Solaris/x86 systems (on Solaris, this generates a 32-bit library. See below
library. See below for 64-bit build instructions.) for 64-bit build instructions.)
cd {source_directory} cd {source_directory}
autoreconf -fiv autoreconf -fiv
@@ -77,34 +77,38 @@ libjpeg-turbo from the SVN repository.
This will generate the following files under .libs/ This will generate the following files under .libs/
libjpeg.a 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) libjpeg.{version}.dylib (OS X)
cygjpeg-{version}.dll (Cygwin) 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) libjpeg.dylib (OS X)
Development symlink for the libjpeg API
libjpeg.dll.a (Cygwin) libjpeg.dll.a (Cygwin)
Development stub for libjpeg-turbo shared library Import library for the libjpeg API
libturbojpeg.a libturbojpeg.a
Static link library for TurboJPEG/OSS Static link library for the TurboJPEG API
libturbojpeg.so (Linux, Solaris) libturbojpeg.so.0.0.0 (Linux, Unix)
libturbojpeg.0.0.0.dylib (OS X)
cygturbojpeg-0.dll (Cygwin)
Shared library for the TurboJPEG API
libturbojpeg.so (Linux, Unix)
libturbojpeg.dylib (OS X) libturbojpeg.dylib (OS X)
Shared library and development stub for TurboJPEG/OSS Development symlink for the TurboJPEG API
cygturbojpeg.dll (Cygwin)
Shared library for TurboJPEG/OSS
libturbojpeg.dll.a (Cygwin) libturbojpeg.dll.a (Cygwin)
Development stub for TurboJPEG/OSS shared library Import library for the TurboJPEG API
{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.
libjpeg v7 or v8 API/ABI Emulation 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. 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 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.) 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 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 Native Interface wrapper into the TurboJPEG shared library and build the Java
Java front-end classes to support it. This allows the TurboJPEG/OSS dynamic front-end classes to support it. This allows the TurboJPEG shared library to
library to be used directly from Java applications. See java/README for more be used directly from Java applications. See java/README for more details.
details.
You can set the JAVAC, JAR, and JAVA configure variables to specify You can set the JAVAC, JAR, and JAVA configure variables to specify
alternate commands for javac, jar, and java (respectively.) You can also 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, /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 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 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 to force applications to use libjpeg-turbo instead of libjpeg. See
README-turbo.txt for more information. 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 Add
@@ -187,8 +200,8 @@ Add
to the configure command line. to the configure command line.
64-bit Library Build on 64-bit OS X 64-bit Build on 64-bit OS X
----------------------------------- ---------------------------
Add Add
@@ -198,8 +211,8 @@ to the configure command line. NASM 2.07 or later from MacPorts must be
installed. installed.
32-bit Library Build on 64-bit OS X 32-bit Build on 64-bit OS X
----------------------------------- ---------------------------
Add Add
@@ -208,8 +221,8 @@ Add
to the configure command line. 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 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. MacPorts, must be installed.
32-bit Backward-Compatible Library Build on OS X 32-bit Backward-Compatible Build on OS X
------------------------------------------------ ----------------------------------------
Add Add
@@ -247,8 +260,8 @@ Add
to the configure command line. to the configure command line.
32-bit Library Build on 64-bit FreeBSD 32-bit Build on 64-bit FreeBSD
-------------------------------------- ------------------------------
Add Add
@@ -316,7 +329,7 @@ Set the following shell variables for simplicity:
ARM v6 only (up to and including iPhone 3G): ARM v6 only (up to and including iPhone 3G):
IOS_CFLAGS="-march=armv6 -mcpu=arm1176jzf-s -mfpu=vfp" 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" IOS_CFLAGS="-march=armv7 -mcpu=cortex-a8 -mtune=cortex-a8 -mfpu=neon"
Follow the procedure under "Building libjpeg-turbo" above, adding 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 Once built, lipo can be used to combine the ARM v6 and v7 variants into a
universal library. 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) ** 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 -- NASM (http://www.nasm.us/) 0.98 or later (NASM 2.05 or later is required for
a 64-bit build) a 64-bit build)
-- If building the TurboJPEG/OSS Java wrapper, JDK 1.5 or later is required. -- If building the TurboJPEG Java wrapper, JDK 1.5 or later is required. This
This can be downloaded from http://www.java.com. 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}: The following files will be generated under {build_directory}:
jpeg-static.lib jpeg-static.lib
Static link library for libjpeg-turbo Static link library for the libjpeg API
sharedlib/jpeg{version}.dll sharedlib/jpeg{version}.dll
DLL for libjpeg-turbo DLL for the libjpeg API
sharedlib/jpeg.lib sharedlib/jpeg.lib
Import library for libjpeg-turbo DLL Import library for the libjpeg API
turbojpeg-static.lib turbojpeg-static.lib
Static link library for TurboJPEG/OSS Static link library for the TurboJPEG API
turbojpeg.dll turbojpeg.dll
DLL for TurboJPEG/OSS DLL for the TurboJPEG API
turbojpeg.lib 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 {version} is 62, 7, or 8, depending on whether libjpeg v6b (default), v7, or
v8 emulation is enabled. v8 emulation is enabled.
@@ -442,17 +468,17 @@ build of libjpeg-turbo.
This will generate the following files under {build_directory}: This will generate the following files under {build_directory}:
{configuration}/jpeg-static.lib {configuration}/jpeg-static.lib
Static link library for libjpeg-turbo Static link library for the libjpeg API
sharedlib/{configuration}/jpeg{version}.dll sharedlib/{configuration}/jpeg{version}.dll
DLL for libjpeg-turbo DLL for the libjpeg API
sharedlib/{configuration}/jpeg.lib sharedlib/{configuration}/jpeg.lib
Import library for libjpeg-turbo DLL Import library for the libjpeg API
{configuration}/turbojpeg-static.lib {configuration}/turbojpeg-static.lib
Static link library for TurboJPEG/OSS Static link library for the TurboJPEG API
{configuration}/turbojpeg.dll {configuration}/turbojpeg.dll
DLL for TurboJPEG/OSS DLL for the TurboJPEG API
{configuration}/turbojpeg.lib {configuration}/turbojpeg.lib
Import library for TurboJPEG/OSS DLL Import library for the TurboJPEG API
{configuration} is Debug, Release, RelWithDebInfo, or MinSizeRel, depending on {configuration} is Debug, Release, RelWithDebInfo, or MinSizeRel, depending on
the configuration you built in the IDE, and {version} is 62, 7, or 8, 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} This will generate the following files under {build_directory}
libjpeg.a libjpeg.a
Static link library for libjpeg-turbo Static link library for the libjpeg API
sharedlib/libjpeg-{version}.dll sharedlib/libjpeg-{version}.dll
DLL for libjpeg-turbo DLL for the libjpeg API
sharedlib/libjpeg.dll.a sharedlib/libjpeg.dll.a
Import library for libjpeg-turbo DLL Import library for the libjpeg API
libturbojpeg.a libturbojpeg.a
Static link library for TurboJPEG/OSS Static link library for the TurboJPEG API
libturbojpeg.dll libturbojpeg.dll
DLL for TurboJPEG/OSS DLL for the TurboJPEG API
libturbojpeg.dll.a 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 {version} is 62, 7, or 8, depending on whether libjpeg v6b (default), v7, or
v8 emulation is enabled. 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. 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 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.) 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 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 Native Interface wrapper into the TurboJPEG shared library and build the Java
Java front-end classes to support it. This allows the TurboJPEG/OSS dynamic front-end classes to support it. This allows the TurboJPEG shared library to
library to be used directly from Java applications. See java/README for more be used directly from Java applications. See java/README for more details.
details.
If you are using CMake 2.8, you can set the Java_JAVAC_EXECUTABLE, 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 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 the 'testclean' target (if using the Visual Studio IDE) will clean up the
output images generated by 'make test'. 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 wrappers can be run by invoking 'make tjtest'. These extended TurboJPEG tests
essentially iterate through all of the available features of the TurboJPEG APIs 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 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 transform options) and compare the images generated by each feature to images
generated using the equivalent feature in the libjpeg API. The extended generated using the equivalent feature in the libjpeg API. The extended
TurboJPEG tests are meant to test for regressions in the TurboJPEG wrappers, 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.

View File

@@ -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_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_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_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) if(WITH_ARITH_ENC)
set(C_ARITH_CODING_SUPPORTED 1) set(C_ARITH_CODING_SUPPORTED 1)
@@ -63,9 +63,9 @@ else()
endif() endif()
if(WITH_JAVA) if(WITH_JAVA)
message(STATUS "TurboJPEG/OSS Java wrapper enabled") message(STATUS "TurboJPEG Java wrapper enabled")
else() else()
message(STATUS "TurboJPEG/OSS Java wrapper disabled") message(STATUS "TurboJPEG Java wrapper disabled")
endif() endif()
set(SO_AGE 0) set(SO_AGE 0)

View File

@@ -184,7 +184,7 @@ NEON instructions.
TurboJPEG 1.2 API uses pixel formats to define the size and component order of 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 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 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 now uses the libjpeg memory source and destination managers, which allows the
TurboJPEG compressor to grow the JPEG buffer as necessary. 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. cases.
[2] Despite the above, the fast integer forward DCT still degrades somewhat for [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 JPEG qualities greater than 95, so the TurboJPEG wrapper will now automatically
slow integer forward DCT when generating JPEG images of quality 96 or greater. use the slow integer forward DCT when generating JPEG images of quality 96 or
This reduces compression performance by as much as 15% for these high-quality greater. This reduces compression performance by as much as 15% for these
images but is necessary to ensure that the images are perceptually lossless. high-quality images but is necessary to ensure that the images are perceptually
It also ensures that the library can avoid the performance pitfall created by lossless. It also ensures that the library can avoid the performance pitfall
[1]. created by [1].
[3] Ported jpgtest.cxx to pure C to avoid the need for a C++ compiler. [3] Ported jpgtest.cxx to pure C to avoid the need for a C++ compiler.

View File

@@ -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 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: associated test programs bear a similar license, which is reproduced below:
Redistribution and use in source and binary forms, with or without 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 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 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 API but also more powerful. The libjpeg API implementation in libjpeg-turbo
mathematically compatible with libjpeg v6b. It can also optionally be is both API/ABI-compatible and mathematically compatible with libjpeg v6b.
configured to be API/ABI-compatible with libjpeg v7 and v8 (see below.) 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 Installation Directory

View File

@@ -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"]) AM_CONDITIONAL([WITH_ARITH], [test "x$with_arith_dec" != "xno" -o "x$with_arith_enc" != "xno"])
# TurboJPEG support # 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_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 if test "x$with_turbojpeg" = "xno"; then
AC_MSG_RESULT(no) AC_MSG_RESULT(no)
RPM_CONFIG_ARGS="$RPM_CONFIG_ARGS --without-turbojpeg" RPM_CONFIG_ARGS="$RPM_CONFIG_ARGS --without-turbojpeg"
@@ -272,9 +272,9 @@ fi
AC_SUBST(JAVA) 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_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_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 if test "x$with_turbojpeg" = "xno"; then
with_java=no with_java=no
fi fi

View File

@@ -1,25 +1,25 @@
TurboJPEG/OSS Java Wrapper TurboJPEG Java Wrapper
========================== ======================
TurboJPEG/OSS can optionally be built with a Java Native Interface wrapper, The TurboJPEG shared library can optionally be built with a Java Native
which allows the TurboJPEG/OSS dynamic library to be loaded and used directly Interface wrapper, which allows the library to be loaded and used directly from
from Java applications. The Java front end for this is defined in several Java applications. The Java front end for this is defined in several classes
classes located under org/libjpegturbo/turbojpeg. The source code for these located under org/libjpegturbo/turbojpeg. The source code for these Java
Java classes is licensed under a BSD-style license, so the files can be classes is licensed under a BSD-style license, so the files can be incorporated
incorporated directly into both open source and proprietary projects without directly into both open source and proprietary projects without restriction. A
restriction. A Java archive (JAR) file containing these classes is also Java archive (JAR) file containing these classes is also shipped with the
shipped with the "official" distribution packages of libjpeg-turbo. "official" distribution packages of libjpeg-turbo.
TJExample.java, which should also be located in the same directory as this 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 README file, demonstrates how to use the TurboJPEG Java API to compress and
compress and decompress JPEG images in memory. decompress JPEG images in memory.
Performance Pitfalls Performance Pitfalls
-------------------- --------------------
The TurboJPEG Java front end defines several convenience methods that can The TurboJPEG Java API defines several convenience methods that can allocate
allocate image buffers or instantiate classes to hold the result of compress, image buffers or instantiate classes to hold the result of compress,
decompress, or transform operations. However, if you use these methods, then 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 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 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 performance, particularly in a multi-threaded environment (Java pauses all
threads when the GC runs.) threads when the GC runs.)
The Java front end always gives you the option of pre-allocating your own The TurboJPEG Java API always gives you the option of pre-allocating your own
source and destination buffers, which allows you to re-use these buffers for source and destination buffers, which allows you to re-use those buffers for
compressing/decompressing multiple images. If the image sequence you are compressing/decompressing multiple images. If the image sequence you are
compressing or decompressing consists of images of the same size, then compressing or decompressing consists of images of the same size, then
pre-allocating the buffers is recommended. pre-allocating the buffers is recommended.

View File

@@ -26,7 +26,7 @@
* POSSIBILITY OF SUCH DAMAGE. * 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 <stdio.h>
#include <stdlib.h> #include <stdlib.h>