Merge libjpeg-turbo r1220

* commit '93ddfcfc1a814789ed64d967a6118616753bb9d5': (65 commits)
  Use clz/bsr instructions on ARM for bit counting rather than the lookup table (reduces memory footprint and can improve performance in some cases.)
  Make iOS build instructions more generic and applicable to all versions of Xcode;  modify iOS build procedure for Xcode 5.0 and later to fix a build issue with Xcode 5.1.
  Update build instructions to reflect the use of pkgbuild/productbuild
  Remove any claims of support for OS X 10.4 "Tiger" (the packaging system overhaul produces packages that require Leopard or later, and I haven't been able to test Tiger for years anyhow.)  Update TurboJPEG shared library version.
  Migrate Mac packaging system to pkgbuild, since PackageMaker is no longer supported.
  Remove the sections about replacing libjpeg at run time and compile time.  These were written before O/S distributions started shipping libjpeg-turbo, and they are either pedantic or no longer relevant.  Also remove any text that assumes the use of our official project binaries.  Notes specific to the official binaries have been moved into the project wiki.
  Fix Windows build
  Since we're now maintaining our own Cygwin pseudo-repository directories instead of recommending that users install these packages from a local source, it makes more sense to name the packages according to Cygwin specs, so they can be copied as-is into the pseudo-repository.
  39dbc2db9718f9af2f62eb486fd73328fe8bf5e8
  Fix 'make dist'
  RHEL 6 (and probably other platforms as well) sets _defaultdocdir=%{_datadir}/doc, which screws things up, since we're overriding _datadir.  Since we intend _defaultdocdir to be /usr/share/doc, just be explicit about it.
  Fix compiler warning about unused function when building with the libjpeg v6b API/ABI
  Fix compiler warning ("always_inline function might not be inlinable") when building with recent versions of GCC
  Enable silent build (can be overridden with 'make V=1') if the version of autotools being used is new enough.
  Extend YUVImage class to allow reuse of the same buffer with different metadata;  port TJBench changes that treat YUV encoding/decoding as an intermediate step of the JPEG compression/decompression pipeline rather than a separate test case;  add YUV encode/decode tests to the Java version of tjbenchtest
  formatting tweaks
  Fix an error that occurred when trying to use the lossless transform feature without specifying -quiet;  formatting tweak
  Move the garbage collection of the JPEG tiles into the decompression function to increase the chances that tiled decompression of large images will succeed without an OutOfMemoryError.
  Generate the Java documentation using javadoc 7, to improve readability.
  This should have been checked in with the previous commit.
  ...

Conflicts:
	BUILDING.txt
	configure.ac
	jversion.h
	release/Info.plist.in
	release/ReadMe.rtf
	tjbench.c
	turbojpeg.c
This commit is contained in:
Kornel Lesiński
2014-09-07 16:07:58 +01:00
78 changed files with 13454 additions and 9256 deletions

View File

@@ -50,12 +50,12 @@ Build Requirements
is suggested that you install Apple GCC v4.2 through MacPorts. is suggested that you install Apple GCC v4.2 through MacPorts.
-- If building the MozJPEG Java wrapper, JDK or OpenJDK 1.5 or later is -- If building the MozJPEG 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 Solaris 10 and later and Red Hat Enterprise
Hat Enterprise Linux 5 and later, have this pre-installed. On OS X 10.5 and Linux 5 and later, have this pre-installed. On OS X 10.5 and later, it will
later, it will be necessary to install the Java Developer Package, which can be necessary to install the Java Developer Package, which can be downloaded
be downloaded from http://developer.apple.com/downloads (Apple ID required.) from http://developer.apple.com/downloads (Apple ID required.) For systems
For systems that do not have a JDK installed, you can obtain the Oracle Java that do not have a JDK installed, you can obtain the Oracle Java Development
Development Kit from http://www.java.com. Kit from http://www.java.com.
================== ==================
@@ -243,12 +243,12 @@ to the configure command line.
Add Add
--host x86_64-apple-darwin NASM=/opt/local/bin/nasm \ --host x86_64-apple-darwin NASM=/opt/local/bin/nasm \
CFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \ CFLAGS='-isysroot /Developer/SDKs/MacOSX10.5.sdk \
-mmacosx-version-min=10.4 -O3' \ -mmacosx-version-min=10.5 -O3' \
LDFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \ LDFLAGS='-isysroot /Developer/SDKs/MacOSX10.5.sdk \
-mmacosx-version-min=10.4' -mmacosx-version-min=10.5'
to the configure command line. The OS X 10.4 SDK, and NASM 2.07 or later from to the configure command line. The OS X 10.5 SDK, and NASM 2.07 or later from
MacPorts, must be installed. MacPorts, must be installed.
@@ -258,12 +258,12 @@ MacPorts, must be installed.
Add Add
--host i686-apple-darwin \ --host i686-apple-darwin \
CFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \ CFLAGS='-isysroot /Developer/SDKs/MacOSX10.5.sdk \
-mmacosx-version-min=10.4 -O3 -m32' \ -mmacosx-version-min=10.5 -O3 -m32' \
LDFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \ LDFLAGS='-isysroot /Developer/SDKs/MacOSX10.5.sdk \
-mmacosx-version-min=10.4 -m32' -mmacosx-version-min=10.5 -m32'
to the configure command line. The OS X 10.4 SDK must be installed. to the configure command line. The OS X 10.5 SDK must be installed.
64-bit Library Build on 64-bit Solaris 64-bit Library Build on 64-bit Solaris
@@ -333,31 +333,40 @@ examples accordingly.
Additional build requirements: Additional build requirements:
gas-preprocessor.pl (https://github.com/yuvi/gas-preprocessor) should be gas-preprocessor.pl
installed in your PATH. (https://sourceforge.net/p/libjpeg-turbo/code/HEAD/tree/gas-preprocessor)
should be installed in your PATH.
Set the following shell variables for simplicity: Set the following shell variables for simplicity:
Xcode 3.2.x / iOS 4.3 SDK: Xcode 4.2 and earlier:
IOS_PLATFORMDIR="/Developer/Platforms/iPhoneOS.platform" IOS_PLATFORMDIR=/Developer/Platforms/iPhoneOS.platform
IOS_SYSROOT="$IOS_PLATFORMDIR/Developer/SDKs/iPhoneOS4.3.sdk" Xcode 4.3 and later:
IOS_GCC="$IOS_PLATFORMDIR/Developer/usr/bin/arm-apple-darwin10-llvm-gcc-4.2" IOS_PLATFORMDIR=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform
Xcode 4.5.x / iOS 6.0 SDK: IOS_SYSROOT=$IOS_PLATFORMDIR/Developer/SDKs/iPhoneOS*.sdk
IOS_PLATFORMDIR="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform"
IOS_SYSROOT="$IOS_PLATFORMDIR/Developer/SDKs/iPhoneOS6.0.sdk" Xcode 4.6.x and earlier:
IOS_GCC="$IOS_PLATFORMDIR/Developer/usr/bin/arm-apple-darwin10-llvm-gcc-4.2" IOS_GCC=$IOS_PLATFORMDIR/Developer/usr/bin/arm-apple-darwin10-llvm-gcc-4.2
Xcode 5.0.x and later:
IOS_GCC=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
ARM v6 only (up to and including iPhone 3G): ARM v6 only (up to and including iPhone 3G):
[NOTE: Requires Xcode 4.4.x or earlier] [NOTE: Requires Xcode 4.4.x or earlier]
IOS_CFLAGS="-march=armv6 -mcpu=arm1176jzf-s -mfpu=vfp" IOS_CFLAGS="-march=armv6 -mcpu=arm1176jzf-s -mfpu=vfp"
ARM v7 only (iPhone 3GS-4S, iPad 1st-3rd Generation): ARM v7 only (iPhone 3GS-4S, iPad 1st-3rd Generation):
Xcode 4.6.x and earlier:
IOS_CFLAGS="-march=armv7 -mcpu=cortex-a8 -mtune=cortex-a8 -mfpu=neon" IOS_CFLAGS="-march=armv7 -mcpu=cortex-a8 -mtune=cortex-a8 -mfpu=neon"
Xcode 5.0.x and later:
IOS_CFLAGS="-arch armv7"
ARM v7s only (iPhone 5, iPad 4th Generation): ARM v7s only (iPhone 5, iPad 4th Generation):
[NOTE: Requires Xcode 4.5 or later] [NOTE: Requires Xcode 4.5 or later]
Xcode 4.6.x and earlier:
IOS_CFLAGS="-march=armv7s -mcpu=swift -mtune=swift -mfpu=neon" IOS_CFLAGS="-march=armv7s -mcpu=swift -mtune=swift -mfpu=neon"
Xcode 5.0.x and later:
IOS_CFLAGS="-arch armv7s"
Follow the procedure under "Building libmozjpeg" above, adding Follow the procedure under "Building libmozjpeg" above, adding
@@ -366,8 +375,16 @@ Follow the procedure under "Building libmozjpeg" above, adding
CFLAGS="-mfloat-abi=softfp -isysroot $IOS_SYSROOT -O3 $IOS_CFLAGS" \ CFLAGS="-mfloat-abi=softfp -isysroot $IOS_SYSROOT -O3 $IOS_CFLAGS" \
LDFLAGS="-mfloat-abi=softfp -isysroot $IOS_SYSROOT $IOS_CFLAGS" LDFLAGS="-mfloat-abi=softfp -isysroot $IOS_SYSROOT $IOS_CFLAGS"
to the configure command line. If using Xcode 5.0.x or later, also add
CCASFLAGS="-no-integrated-as $IOS_CFLAGS"
to the configure command line. to the configure command line.
NOTE: You can also add -miphoneos-version-min={version} to $IOS_CFLAGS above
in order to support older versions of iOS than the default version supported by
the SDK.
Once built, lipo can be used to combine the ARM v6, v7, and/or v7s variants Once built, lipo can be used to combine the ARM v6, v7, and/or v7s variants
into a universal library. into a universal library.
@@ -695,11 +712,11 @@ make deb
make dmg make dmg
Create Macintosh package/disk image. This requires the PackageMaker Create Macintosh package/disk image. This requires pkgbuild and
application, which must be installed in /Developer/Applications/Utilities. productbuild, which are installed by default on OS X 10.7 and later and which
Note that PackageMaker is not included in recent releases of Xcode, but it can be obtained by installing Xcode 3.2.6 (with the "Unix Development"
can be obtained by downloading the "Auxiliary Tools for Xcode" package from option) on OS X 10.6. Packages built in this manner can be installed on OS X
http://developer.apple.com/downloads. 10.5 and later, but they must be built on OS X 10.6 or later.
make udmg [BUILDDIR32={32-bit build directory}] make udmg [BUILDDIR32={32-bit build directory}]

View File

@@ -2,7 +2,8 @@
# Setup # Setup
# #
cmake_minimum_required(VERSION 2.6) cmake_minimum_required(VERSION 2.8.8)
cmake_policy(SET CMP0022 OLD)
project(libmozjpeg C) project(libmozjpeg C)
set(VERSION 2.0.1) set(VERSION 2.0.1)

View File

@@ -1,27 +1,52 @@
1.4 pre-beta 1.4 pre-beta
============ ============
[1] The TurboJPEG API can now be used to generate YUV images with an arbitrary [1] New features in the TurboJPEG API:
line padding (previously, it only supported 4-byte padding, which was -- YUV planar images can now be generated with an arbitrary line padding
compatible with X Video.) Also, the decompress-to-YUV function has been (previously only 4-byte padding, which was compatible with X Video, was
extended to support image scaling. supported.)
-- The decompress-to-YUV function has been extended to support image scaling.
-- JPEG images can now be compressed from YUV planar source images.
-- YUV planar images can now be decoded into RGB or grayscale images.
-- 4:1:1 subsampling is now supported. This is mainly included for
compatibility, since 4:1:1 is not fully accelerated in libjpeg-turbo and has no
significant advantages relative to 4:2:0.
-- CMYK images are now supported. This feature allows CMYK source images to be
compressed to YCCK JPEGs and YCCK or CMYK JPEGs to be decompressed to CMYK
destination images. Conversion between CMYK and RGB or YUV images is not
supported. Such conversion requires a color management system and is out of
scope for a codec library.
-- The handling of YUV images in the Java API has been significantly refactored
and should now be much more intuitive.
-- The Java API now supports encoding a YUV image from an arbitrary position in
a large image buffer.
[2] Added SIMD acceleration for DSPr2-capable MIPS platforms. This speeds up [2] Added SIMD acceleration for DSPr2-capable MIPS platforms. This speeds up
the compression of full-color JPEGs by 70-80% on such platforms and the compression of full-color JPEGs by 70-80% on such platforms and
decompression by 25-35%. decompression by 25-35%.
[3] Added support for 4:1:1 subsampling to the TurboJPEG API. This is mainly [3] If an application attempts to decompress a Huffman-coded JPEG image whose
included for compatibility, since 4:1:1 is not fully accelerated in header does not contain Huffman tables, libjpeg-turbo will now insert the
libjpeg-turbo and has no significant advantages relative to 4:2:0. default Huffman tables. In order to save space, many motion JPEG video frames
are encoded without the default Huffman tables, so these frames can now be
successfully decompressed by libjpeg-turbo without additional work on the part
of the application. An application can still override the Huffman tables, for
instance to re-use tables from a previous frame of the same video.
[4] Added support for CMYK images to the TurboJPEG API. This feature allows [4] The Mac packaging system now uses pkgbuild and productbuild rather than
CMYK source images to be compressed to YCCK JPEGs and YCCK or CMYK JPEGs to be PackageMaker (which is obsolete and no longer supported.) This means that
decompressed to CMYK destination images. Conversion between CMYK and RGB OS X 10.6 "Snow Leopard" or later must be used when packaging libjpeg-turbo,
images is not supported. Such conversion requires a color management system although the packages produced can be installed on OS X 10.5 "Leopard" or
and is out of scope for a codec library. later. OS X 10.4 "Tiger" is no longer supported.
[5] The TurboJPEG API can now be used to compress JPEG images from YUV planar [5] The Huffman encoder now uses clz and bsr instructions for bit counting on
source images. ARM platforms rather than a lookup table. This reduces the memory footprint
by 64k, which may be important for some mobile applications. Out of four
Android devices that were tested, two demonstrated a small loss (~3-4% on
average) with ARMv6 code and a small gain (also ~3-4%) with ARMv7 code when
enabling this new feature, but the other two devices demonstrated a
significant performance gain across the board (~10-20%.) Actual mileage may
vary.
1.3.1 1.3.1
@@ -48,6 +73,20 @@ omitted at compile time".
[4] Fixed a couple of issues whereby malformed JPEG images would cause [4] Fixed a couple of issues whereby malformed JPEG images would cause
libjpeg-turbo to use uninitialized memory during decompression. libjpeg-turbo to use uninitialized memory during decompression.
[5] Fixed an error ("Buffer passed to JPEG library is too small") that occurred
when calling the TurboJPEG YUV encoding function with a very small (< 5x5)
source image, and added a unit test to check for this error.
[6] The Java classes should now build properly under Visual Studio 2010 and
later.
[7] Fixed an issue that prevented SRPMs generated using the in-tree packaging
tools from being rebuilt on certain newer Linux distributions.
[8] Numerous minor fixes to eliminate compilation and build/packaging system
warnings, fix cosmetic issues, improve documentation clarity, and other general
source cleanup.
1.3.0 1.3.0
===== =====

View File

@@ -162,7 +162,7 @@ dist_example_DATA = example.c
EXTRA_DIST = win release $(DOCS) testimages CMakeLists.txt \ EXTRA_DIST = win release $(DOCS) testimages CMakeLists.txt \
sharedlib/CMakeLists.txt cmakescripts libjpeg.map.in doc doxygen.config \ sharedlib/CMakeLists.txt cmakescripts libjpeg.map.in doc doxygen.config \
jccolext.c jdcolext.c jdmrgext.c jccolext.c jdcolext.c jdmrgext.c jstdhuff.c
dist-hook: dist-hook:
rm -rf `find $(distdir) -name .svn` rm -rf `find $(distdir) -name .svn`
@@ -335,8 +335,10 @@ testclean:
tjtest: tjtest:
sh ./tjbenchtest sh ./tjbenchtest
sh ./tjbenchtest -yuv
if WITH_JAVA if WITH_JAVA
sh ./tjbenchtest.java sh ./tjbenchtest.java
sh ./tjbenchtest.java -yuv
endif endif

View File

@@ -81,131 +81,6 @@ JPEG images:
There is no significant performance advantage to either API when both are used There is no significant performance advantage to either API when both are used
to perform similar operations. to perform similar operations.
======================
Installation Directory
======================
This document assumes that libjpeg-turbo will be installed in the default
directory (/opt/libjpeg-turbo on Un*x and Mac systems and
c:\libjpeg-turbo[-gcc][64] on Windows systems. If your installation of
libjpeg-turbo resides in a different directory, then adjust the instructions
accordingly.
=============================
Replacing libjpeg at Run Time
=============================
Un*x
----
If a Un*x application is dynamically linked with libjpeg, then you can replace
libjpeg with libjpeg-turbo at run time by manipulating LD_LIBRARY_PATH.
For instance:
[Using libjpeg]
> time cjpeg <vgl_5674_0098.ppm >vgl_5674_0098.jpg
real 0m0.392s
user 0m0.074s
sys 0m0.020s
[Using libjpeg-turbo]
> export LD_LIBRARY_PATH=/opt/libjpeg-turbo/{lib}:$LD_LIBRARY_PATH
> time cjpeg <vgl_5674_0098.ppm >vgl_5674_0098.jpg
real 0m0.109s
user 0m0.029s
sys 0m0.010s
({lib} = lib32 or lib64, depending on whether you wish to use the 32-bit or the
64-bit version of libjpeg-turbo.)
System administrators can also replace the libjpeg symlinks in /usr/lib* with
links to the libjpeg-turbo dynamic library located in /opt/libjpeg-turbo/{lib}.
This will effectively accelerate every application that uses the libjpeg
dynamic library on the system.
Windows
-------
If a Windows application is dynamically linked with libjpeg, then you can
replace libjpeg with libjpeg-turbo at run time by backing up the application's
copy of jpeg62.dll, jpeg7.dll, or jpeg8.dll (assuming the application has its
own local copy of this library) and copying the corresponding DLL from
libjpeg-turbo into the application's install directory. The official
libjpeg-turbo binary packages only provide jpeg62.dll. If the application uses
jpeg7.dll or jpeg8.dll instead, then it will be necessary to build
libjpeg-turbo from source (see "libjpeg v7 and v8 API/ABI Emulation" below.)
The following information is specific to the official libjpeg-turbo binary
packages for Visual C++:
-- jpeg62.dll requires the Visual C++ 2008 C run-time DLL (msvcr90.dll).
msvcr90.dll ships with more recent versions of Windows, but users of older
Windows releases can obtain it from the Visual C++ 2008 Redistributable
Package, which is available as a free download from Microsoft's web site.
-- Features of the libjpeg API that require passing a C run-time structure,
such as a file handle, from an application to the library will probably not
work with jpeg62.dll, unless the application is also built to use the Visual
C++ 2008 C run-time DLL. In particular, this affects jpeg_stdio_dest() and
jpeg_stdio_src().
Mac
---
Mac applications typically embed their own copies of the libjpeg dylib inside
the (hidden) application bundle, so it is not possible to globally replace
libjpeg on OS X systems. Replacing the application's version of the libjpeg
dylib would generally involve copying libjpeg.*.dylib from libjpeg-turbo into
the appropriate place in the application bundle and using install_name_tool to
repoint the libjpeg-turbo dylib to its new directory. This requires an
advanced knowledge of OS X and would not survive an upgrade or a re-install of
the application. Thus, it is not recommended for most users.
========================================
Using libjpeg-turbo in Your Own Programs
========================================
For the most part, libjpeg-turbo should work identically to libjpeg, so in
most cases, an application can be built against libjpeg and then run against
libjpeg-turbo. On Un*x systems and Cygwin, you can build against libjpeg-turbo
instead of libjpeg by setting
CPATH=/opt/libjpeg-turbo/include
and
LIBRARY_PATH=/opt/libjpeg-turbo/{lib}
({lib} = lib32 or lib64, depending on whether you are building a 32-bit or a
64-bit application.)
If using MinGW, then set
CPATH=/c/libjpeg-turbo-gcc[64]/include
and
LIBRARY_PATH=/c/libjpeg-turbo-gcc[64]/lib
Building against libjpeg-turbo is useful, for instance, if you want to build an
application that leverages the libjpeg-turbo colorspace extensions (see below.)
On Un*x systems, you would still need to manipulate LD_LIBRARY_PATH or create
appropriate symlinks to use libjpeg-turbo at run time. On such systems, you
can pass -R /opt/libjpeg-turbo/{lib} to the linker to force the use of
libjpeg-turbo at run time rather than libjpeg (also useful if you want to
leverage the colorspace extensions), or you can link against the libjpeg-turbo
static library.
To force a Un*x or MinGW application to link against the static version of
libjpeg-turbo, you can use the following linker options:
-Wl,-Bstatic -ljpeg -Wl,-Bdynamic
On OS X, simply add /opt/libjpeg-turbo/lib/libjpeg.a to the linker command
line.
To build Visual C++ applications using libjpeg-turbo, add
c:\libjpeg-turbo[64]\include to the system or user INCLUDE environment
variable and c:\libjpeg-turbo[64]\lib to the system or user LIB environment
variable, and then link against either jpeg.lib (to use the DLL version of
libjpeg-turbo) or jpeg-static.lib (to use the static version of libjpeg-turbo.)
===================== =====================
Colorspace Extensions Colorspace Extensions
===================== =====================
@@ -265,7 +140,7 @@ compression and decompression structures. Unfortunately, due to the exposed
nature of those structures, extending them also necessitated breaking backward nature of those structures, extending them also necessitated breaking backward
ABI compatibility with previous libjpeg releases. Thus, programs that were ABI compatibility with previous libjpeg releases. Thus, programs that were
built to use libjpeg v7 or v8 did not work with libjpeg-turbo, since it is built to use libjpeg v7 or v8 did not work with libjpeg-turbo, since it is
based on the libjpeg v6b code base. Although libjpeg v7 and v8 are still not based on the libjpeg v6b code base. Although libjpeg v7 and v8 are not
as widely used as v6b, enough programs (including a few Linux distros) made as widely used as v6b, enough programs (including a few Linux distros) made
the switch that there was a demand to emulate the libjpeg v7 and v8 ABIs the switch that there was a demand to emulate the libjpeg v7 and v8 ABIs
in libjpeg-turbo. It should be noted, however, that this feature was added in libjpeg-turbo. It should be noted, however, that this feature was added

View File

@@ -210,3 +210,36 @@ AC_DEFUN([AC_CHECK_COMPATIBLE_MIPSEL_ASSEMBLER_IFELSE],[
$2 $2
fi fi
]) ])
AC_DEFUN([AC_CHECK_COMPATIBLE_ARM64_ASSEMBLER_IFELSE],[
ac_good_gnu_arm_assembler=no
ac_save_CC="$CC"
ac_save_CFLAGS="$CFLAGS"
CFLAGS="$CCASFLAGS -x assembler-with-cpp"
CC="$CCAS"
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
.text
movi v0.16b, #100]])], 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_LANG_SOURCE([[
.text
movi v0.16b, #100]])], ac_use_gas_preprocessor=yes)
fi
CFLAGS="$ac_save_CFLAGS"
CC="$ac_save_CC"
if test "x$ac_use_gas_preprocessor" = "xyes" ; then
CCAS="gas-preprocessor.pl $CCAS"
AC_SUBST([CCAS])
ac_good_gnu_arm_assembler=yes
fi
if test "x$ac_good_gnu_arm_assembler" = "xyes" ; then
$1
else
$2
fi
])

View File

@@ -17,8 +17,9 @@ 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 m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
AM_PROG_AS AM_PROG_AS
AM_PROG_CC_C_O
AC_PROG_INSTALL AC_PROG_INSTALL
m4_ifdef([AM_PROG_AR], [AM_PROG_AR]) m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
AC_PROG_LIBTOOL AC_PROG_LIBTOOL
@@ -437,6 +438,22 @@ if test "x${with_simd}" != "xno"; then
fi fi
fi fi
;; ;;
aarch64*)
AC_MSG_RESULT([yes (arm64)])
AC_MSG_CHECKING([if the assembler is GNU-compatible and can be used])
AC_CHECK_COMPATIBLE_ARM64_ASSEMBLER_IFELSE(
[AC_MSG_RESULT([yes])
simd_arch=aarch64],
[AC_MSG_RESULT([no])
with_simd=no])
if test "x${with_simd}" = "xno"; then
if test "x${require_simd}" = "xyes"; then
AC_MSG_ERROR([SIMD support can't be enabled.])
else
AC_MSG_WARN([SIMD support can't be enabled. Performance will suffer.])
fi
fi
;;
mipsel*) mipsel*)
AC_MSG_RESULT([yes (mipsel)]) AC_MSG_RESULT([yes (mipsel)])
AC_MSG_CHECKING([if the assembler is GNU-compatible and can be used]) AC_MSG_CHECKING([if the assembler is GNU-compatible and can be used])
@@ -476,6 +493,7 @@ AM_CONDITIONAL([WITH_SSE_FLOAT_DCT], [test "x$simd_arch" = "xx86_64" -o "x$simd_
AM_CONDITIONAL([SIMD_I386], [test "x$simd_arch" = "xi386"]) AM_CONDITIONAL([SIMD_I386], [test "x$simd_arch" = "xi386"])
AM_CONDITIONAL([SIMD_X86_64], [test "x$simd_arch" = "xx86_64"]) AM_CONDITIONAL([SIMD_X86_64], [test "x$simd_arch" = "xx86_64"])
AM_CONDITIONAL([SIMD_ARM], [test "x$simd_arch" = "xarm"]) AM_CONDITIONAL([SIMD_ARM], [test "x$simd_arch" = "xarm"])
AM_CONDITIONAL([SIMD_ARM_64], [test "x$simd_arch" = "xaarch64"])
AM_CONDITIONAL([SIMD_MIPSEL], [test "x$simd_arch" = "xmipsel"]) AM_CONDITIONAL([SIMD_MIPSEL], [test "x$simd_arch" = "xmipsel"])
AM_CONDITIONAL([X86_64], [test "x$host_cpu" = "xx86_64" -o "x$host_cpu" = "xamd64"]) AM_CONDITIONAL([X86_64], [test "x$host_cpu" = "xx86_64" -o "x$host_cpu" = "xamd64"])
AM_CONDITIONAL([WITH_TURBOJPEG], [test "x$with_turbojpeg" != "xno"]) AM_CONDITIONAL([WITH_TURBOJPEG], [test "x$with_turbojpeg" != "xno"])
@@ -513,8 +531,6 @@ AC_CONFIG_FILES([pkgscripts/libmozjpeg.spec.tmpl:release/libmozjpeg.spec.in])
AC_CONFIG_FILES([pkgscripts/makecygwinpkg.tmpl:release/makecygwinpkg.in]) AC_CONFIG_FILES([pkgscripts/makecygwinpkg.tmpl:release/makecygwinpkg.in])
AC_CONFIG_FILES([pkgscripts/makedpkg.tmpl:release/makedpkg.in]) AC_CONFIG_FILES([pkgscripts/makedpkg.tmpl:release/makedpkg.in])
AC_CONFIG_FILES([pkgscripts/makemacpkg.tmpl:release/makemacpkg.in]) AC_CONFIG_FILES([pkgscripts/makemacpkg.tmpl:release/makemacpkg.in])
AC_CONFIG_FILES([pkgscripts/Description.plist:release/Description.plist.in])
AC_CONFIG_FILES([pkgscripts/Info.plist:release/Info.plist.in])
AC_CONFIG_FILES([pkgscripts/uninstall.tmpl:release/uninstall.in]) AC_CONFIG_FILES([pkgscripts/uninstall.tmpl:release/uninstall.in])
if test "x$with_turbojpeg" != "xno"; then if test "x$with_turbojpeg" != "xno"; then
AC_CONFIG_FILES([tjbenchtest]) AC_CONFIG_FILES([tjbenchtest])

View File

@@ -255,6 +255,9 @@ Functions</h2></td></tr>
<tr class="memitem:ga7c08b340ad7f8e85d407bd9e81d44d07"><td class="memItemLeft" align="right" valign="top">DLLEXPORT int DLLCALL&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga7c08b340ad7f8e85d407bd9e81d44d07">tjDecompressToYUV2</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, unsigned char *jpegBuf, unsigned long jpegSize, unsigned char *dstBuf, int width, int pad, int height, int flags)</td></tr> <tr class="memitem:ga7c08b340ad7f8e85d407bd9e81d44d07"><td class="memItemLeft" align="right" valign="top">DLLEXPORT int DLLCALL&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga7c08b340ad7f8e85d407bd9e81d44d07">tjDecompressToYUV2</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, unsigned char *jpegBuf, unsigned long jpegSize, unsigned char *dstBuf, int width, int pad, int height, int flags)</td></tr>
<tr class="memdesc:ga7c08b340ad7f8e85d407bd9e81d44d07"><td class="mdescLeft">&#160;</td><td class="mdescRight">Decompress a JPEG image to a YUV planar image. <a href="#ga7c08b340ad7f8e85d407bd9e81d44d07">More...</a><br/></td></tr> <tr class="memdesc:ga7c08b340ad7f8e85d407bd9e81d44d07"><td class="mdescLeft">&#160;</td><td class="mdescRight">Decompress a JPEG image to a YUV planar image. <a href="#ga7c08b340ad7f8e85d407bd9e81d44d07">More...</a><br/></td></tr>
<tr class="separator:ga7c08b340ad7f8e85d407bd9e81d44d07"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="separator:ga7c08b340ad7f8e85d407bd9e81d44d07"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga132ae2c2cadcf64c8bb0f3bdf69da3ed"><td class="memItemLeft" align="right" valign="top">DLLEXPORT int DLLCALL&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga132ae2c2cadcf64c8bb0f3bdf69da3ed">tjDecodeYUV</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, unsigned char *srcBuf, int pad, int subsamp, unsigned char *dstBuf, int width, int pitch, int height, int pixelFormat, int flags)</td></tr>
<tr class="memdesc:ga132ae2c2cadcf64c8bb0f3bdf69da3ed"><td class="mdescLeft">&#160;</td><td class="mdescRight">Decode a YUV planar image into an RGB or grayscale image. <a href="#ga132ae2c2cadcf64c8bb0f3bdf69da3ed">More...</a><br/></td></tr>
<tr class="separator:ga132ae2c2cadcf64c8bb0f3bdf69da3ed"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga3155b775bfbac9dbba869b95a0367902"><td class="memItemLeft" align="right" valign="top">DLLEXPORT <a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> DLLCALL&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga3155b775bfbac9dbba869b95a0367902">tjInitTransform</a> (void)</td></tr> <tr class="memitem:ga3155b775bfbac9dbba869b95a0367902"><td class="memItemLeft" align="right" valign="top">DLLEXPORT <a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> DLLCALL&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga3155b775bfbac9dbba869b95a0367902">tjInitTransform</a> (void)</td></tr>
<tr class="memdesc:ga3155b775bfbac9dbba869b95a0367902"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create a new TurboJPEG transformer instance. <a href="#ga3155b775bfbac9dbba869b95a0367902">More...</a><br/></td></tr> <tr class="memdesc:ga3155b775bfbac9dbba869b95a0367902"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create a new TurboJPEG transformer instance. <a href="#ga3155b775bfbac9dbba869b95a0367902">More...</a><br/></td></tr>
<tr class="separator:ga3155b775bfbac9dbba869b95a0367902"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="separator:ga3155b775bfbac9dbba869b95a0367902"><td class="memSeparator" colspan="2">&#160;</td></tr>
@@ -1064,6 +1067,7 @@ If you choose option 1, <code>*jpegSize</code> should be set to the size of your
</div><div class="memdoc"> </div><div class="memdoc">
<p>Compress a YUV planar image into a JPEG image. </p> <p>Compress a YUV planar image into a JPEG image. </p>
<p>Note that, if the width or height of the YUV image is not an even multiple of the MCU block size (see <a class="el" href="group___turbo_j_p_e_g.html#ga9e61e7cd47a15a173283ba94e781308c" title="MCU block width (in pixels) for a given level of chrominance subsampling.">tjMCUWidth</a> and <a class="el" href="group___turbo_j_p_e_g.html#gabd247bb9fecb393eca57366feb8327bf" title="MCU block height (in pixels) for a given level of chrominance subsampling.">tjMCUHeight</a>), then an intermediate buffer copy will be performed within TurboJPEG.</p>
<dl class="params"><dt>Parameters</dt><dd> <dl class="params"><dt>Parameters</dt><dd>
<table class="params"> <table class="params">
<tr><td class="paramname">handle</td><td>a handle to a TurboJPEG compressor or transformer instance </td></tr> <tr><td class="paramname">handle</td><td>a handle to a TurboJPEG compressor or transformer instance </td></tr>
@@ -1086,6 +1090,100 @@ If you choose option 1, <code>*jpegSize</code> should be set to the size of your
</dl> </dl>
<dl class="section return"><dt>Returns</dt><dd>0 if successful, or -1 if an error occurred (see <a class="el" href="group___turbo_j_p_e_g.html#ga9af79c908ec131b1ae8d52fe40375abf" title="Returns a descriptive error message explaining why the last command failed.">tjGetErrorStr()</a>.) </dd></dl> <dl class="section return"><dt>Returns</dt><dd>0 if successful, or -1 if an error occurred (see <a class="el" href="group___turbo_j_p_e_g.html#ga9af79c908ec131b1ae8d52fe40375abf" title="Returns a descriptive error message explaining why the last command failed.">tjGetErrorStr()</a>.) </dd></dl>
</div>
</div>
<a class="anchor" id="ga132ae2c2cadcf64c8bb0f3bdf69da3ed"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">DLLEXPORT int DLLCALL tjDecodeYUV </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a>&#160;</td>
<td class="paramname"><em>handle</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">unsigned char *&#160;</td>
<td class="paramname"><em>srcBuf</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>pad</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>subsamp</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">unsigned char *&#160;</td>
<td class="paramname"><em>dstBuf</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>width</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>pitch</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>height</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>pixelFormat</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>flags</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Decode a YUV planar image into an RGB or grayscale image. </p>
<p>This function uses the accelerated color conversion routines in the underlying codec but does not execute any of the other steps in the JPEG decompression process. The Y, U (Cb), and V (Cr) image planes should be stored sequentially in the source buffer, and the size of each plane is determined by the width and height of the source image, as well as the specified padding and level of chrominance subsampling. If the chrominance components are subsampled along the horizontal dimension, then the width of the luminance plane should be padded to the nearest multiple of 2 in the input image (same goes for the height of the luminance plane, if the chrominance components are subsampled along the vertical dimension.) </p>
<p>NOTE: Technically, the JPEG format uses the YCbCr colorspace, but per the convention of the digital video community, the TurboJPEG API uses "YUV" to refer to an image format consisting of Y, Cb, and Cr image planes.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">handle</td><td>a handle to a TurboJPEG decompressor or transformer instance </td></tr>
<tr><td class="paramname">srcBuf</td><td>pointer to an image buffer containing a YUV planar image to be decoded. The size of this buffer should match the value returned by <a class="el" href="group___turbo_j_p_e_g.html#gaf451664a62c1f6c7cc5a6401f32908c9" title="The size of the buffer (in bytes) required to hold a YUV planar image with the given parameters...">tjBufSizeYUV2()</a> for the given image width, height, padding, and level of chrominance subsampling. </td></tr>
<tr><td class="paramname">pad</td><td>Use this parameter to specify that the width of each line in each plane of the YUV source image is padded to the nearest multiple of this number of bytes (must be a power of 2.) </td></tr>
<tr><td class="paramname">subsamp</td><td>the level of chrominance subsampling used in the YUV source image (see <a class="el" href="group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074">Chrominance subsampling options</a>.) </td></tr>
<tr><td class="paramname">dstBuf</td><td>pointer to an image buffer that will receive the decoded image. This buffer should normally be <code>pitch * height</code> bytes in size, but the <code>dstBuf</code> pointer can also be used to decode into a specific region of a larger buffer. </td></tr>
<tr><td class="paramname">width</td><td>width (in pixels) of the source and destination images </td></tr>
<tr><td class="paramname">pitch</td><td>bytes per line of the destination image. Normally, this should be <code>width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code> if the destination image is unpadded, or <code><a class="el" href="group___turbo_j_p_e_g.html#ga0aba955473315e405295d978f0c16511" title="Pad the given width to the nearest 32-bit boundary.">TJPAD</a>(width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat])</code> if each line of the destination image should be padded to the nearest 32-bit boundary, as is the case for Windows bitmaps. You can also be clever and use the pitch parameter to skip lines, etc. Setting this parameter to 0 is the equivalent of setting it to <code>width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code>. </td></tr>
<tr><td class="paramname">height</td><td>height (in pixels) of the source and destination images </td></tr>
<tr><td class="paramname">pixelFormat</td><td>pixel format of the destination image (see <a class="el" href="group___turbo_j_p_e_g.html#gac916144e26c3817ac514e64ae5d12e2a">Pixel formats</a>.) </td></tr>
<tr><td class="paramname">flags</td><td>the bitwise OR of one or more of the <a class="el" href="group___turbo_j_p_e_g.html#ga72ecf4ebe6eb702d3c6f5ca27455e1ec">flags</a>.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 if successful, or -1 if an error occurred (see <a class="el" href="group___turbo_j_p_e_g.html#ga9af79c908ec131b1ae8d52fe40375abf" title="Returns a descriptive error message explaining why the last command failed.">tjGetErrorStr()</a>.) </dd></dl>
</div> </div>
</div> </div>
<a class="anchor" id="gada69cc6443d1bb493b40f1626259e5e9"></a> <a class="anchor" id="gada69cc6443d1bb493b40f1626259e5e9"></a>
@@ -1422,7 +1520,7 @@ If you choose option 1, <code>*jpegSize</code> should be set to the size of your
</div><div class="memdoc"> </div><div class="memdoc">
<p>Encode an RGB or grayscale image into a YUV planar image. </p> <p>Encode an RGB or grayscale image into a YUV planar image. </p>
<p>This function uses the accelerated color conversion routines in TurboJPEG's underlying codec but does not execute any of the other steps in the JPEG compression process. The Y, U (Cb), and V (Cr) image planes are stored sequentially into the destination buffer, and the size of each plane is determined by the width and height of the source image, as well as the specified padding and level of chrominance subsampling. If the chrominance components are subsampled along the horizontal dimension, then the width of the luminance plane is padded to the nearest multiple of 2 in the output image (same goes for the height of the luminance plane, if the chrominance components are subsampled along the vertical dimension.) </p> <p>This function uses the accelerated color conversion routines in the underlying codec but does not execute any of the other steps in the JPEG compression process. The Y, U (Cb), and V (Cr) image planes are stored sequentially into the destination buffer, and the size of each plane is determined by the width and height of the source image, as well as the specified padding and level of chrominance subsampling. If the chrominance components are subsampled along the horizontal dimension, then the width of the luminance plane is padded to the nearest multiple of 2 in the output image (same goes for the height of the luminance plane, if the chrominance components are subsampled along the vertical dimension.) </p>
<p>NOTE: Technically, the JPEG format uses the YCbCr colorspace, but per the convention of the digital video community, the TurboJPEG API uses "YUV" to refer to an image format consisting of Y, Cb, and Cr image planes.</p> <p>NOTE: Technically, the JPEG format uses the YCbCr colorspace, but per the convention of the digital video community, the TurboJPEG API uses "YUV" to refer to an image format consisting of Y, Cb, and Cr image planes.</p>
<dl class="params"><dt>Parameters</dt><dd> <dl class="params"><dt>Parameters</dt><dd>
<table class="params"> <table class="params">

View File

@@ -16,6 +16,7 @@ var searchData=
['tjcs_5frgb',['TJCS_RGB',['../group___turbo_j_p_e_g.html#gga4f83ad3368e0e29d1957be0efa7c3720a677cb7ccb85c4038ac41964a2e09e555',1,'turbojpeg.h']]], ['tjcs_5frgb',['TJCS_RGB',['../group___turbo_j_p_e_g.html#gga4f83ad3368e0e29d1957be0efa7c3720a677cb7ccb85c4038ac41964a2e09e555',1,'turbojpeg.h']]],
['tjcs_5fycbcr',['TJCS_YCbCr',['../group___turbo_j_p_e_g.html#gga4f83ad3368e0e29d1957be0efa7c3720a7389b8f65bb387ffedce3efd0d78ec75',1,'turbojpeg.h']]], ['tjcs_5fycbcr',['TJCS_YCbCr',['../group___turbo_j_p_e_g.html#gga4f83ad3368e0e29d1957be0efa7c3720a7389b8f65bb387ffedce3efd0d78ec75',1,'turbojpeg.h']]],
['tjcs_5fycck',['TJCS_YCCK',['../group___turbo_j_p_e_g.html#gga4f83ad3368e0e29d1957be0efa7c3720a53839e0fe867b76b58d16b0a1a7c598e',1,'turbojpeg.h']]], ['tjcs_5fycck',['TJCS_YCCK',['../group___turbo_j_p_e_g.html#gga4f83ad3368e0e29d1957be0efa7c3720a53839e0fe867b76b58d16b0a1a7c598e',1,'turbojpeg.h']]],
['tjdecodeyuv',['tjDecodeYUV',['../group___turbo_j_p_e_g.html#ga132ae2c2cadcf64c8bb0f3bdf69da3ed',1,'turbojpeg.h']]],
['tjdecompress2',['tjDecompress2',['../group___turbo_j_p_e_g.html#gada69cc6443d1bb493b40f1626259e5e9',1,'turbojpeg.h']]], ['tjdecompress2',['tjDecompress2',['../group___turbo_j_p_e_g.html#gada69cc6443d1bb493b40f1626259e5e9',1,'turbojpeg.h']]],
['tjdecompressheader3',['tjDecompressHeader3',['../group___turbo_j_p_e_g.html#gacd0fac3af74b3511d39b4781b7103086',1,'turbojpeg.h']]], ['tjdecompressheader3',['tjDecompressHeader3',['../group___turbo_j_p_e_g.html#gacd0fac3af74b3511d39b4781b7103086',1,'turbojpeg.h']]],
['tjdecompresstoyuv2',['tjDecompressToYUV2',['../group___turbo_j_p_e_g.html#ga7c08b340ad7f8e85d407bd9e81d44d07',1,'turbojpeg.h']]], ['tjdecompresstoyuv2',['tjDecompressToYUV2',['../group___turbo_j_p_e_g.html#ga7c08b340ad7f8e85d407bd9e81d44d07',1,'turbojpeg.h']]],

View File

@@ -5,6 +5,7 @@ var searchData=
['tjbufsizeyuv2',['tjBufSizeYUV2',['../group___turbo_j_p_e_g.html#gaf451664a62c1f6c7cc5a6401f32908c9',1,'turbojpeg.h']]], ['tjbufsizeyuv2',['tjBufSizeYUV2',['../group___turbo_j_p_e_g.html#gaf451664a62c1f6c7cc5a6401f32908c9',1,'turbojpeg.h']]],
['tjcompress2',['tjCompress2',['../group___turbo_j_p_e_g.html#gaba62b7a98f960839b588579898495cf2',1,'turbojpeg.h']]], ['tjcompress2',['tjCompress2',['../group___turbo_j_p_e_g.html#gaba62b7a98f960839b588579898495cf2',1,'turbojpeg.h']]],
['tjcompressfromyuv',['tjCompressFromYUV',['../group___turbo_j_p_e_g.html#ga0b931126c7a615ddc3bbd0cca6698d67',1,'turbojpeg.h']]], ['tjcompressfromyuv',['tjCompressFromYUV',['../group___turbo_j_p_e_g.html#ga0b931126c7a615ddc3bbd0cca6698d67',1,'turbojpeg.h']]],
['tjdecodeyuv',['tjDecodeYUV',['../group___turbo_j_p_e_g.html#ga132ae2c2cadcf64c8bb0f3bdf69da3ed',1,'turbojpeg.h']]],
['tjdecompress2',['tjDecompress2',['../group___turbo_j_p_e_g.html#gada69cc6443d1bb493b40f1626259e5e9',1,'turbojpeg.h']]], ['tjdecompress2',['tjDecompress2',['../group___turbo_j_p_e_g.html#gada69cc6443d1bb493b40f1626259e5e9',1,'turbojpeg.h']]],
['tjdecompressheader3',['tjDecompressHeader3',['../group___turbo_j_p_e_g.html#gacd0fac3af74b3511d39b4781b7103086',1,'turbojpeg.h']]], ['tjdecompressheader3',['tjDecompressHeader3',['../group___turbo_j_p_e_g.html#gacd0fac3af74b3511d39b4781b7103086',1,'turbojpeg.h']]],
['tjdecompresstoyuv2',['tjDecompressToYUV2',['../group___turbo_j_p_e_g.html#ga7c08b340ad7f8e85d407bd9e81d44d07',1,'turbojpeg.h']]], ['tjdecompresstoyuv2',['tjDecompressToYUV2',['../group___turbo_j_p_e_g.html#ga7c08b340ad7f8e85d407bd9e81d44d07',1,'turbojpeg.h']]],

View File

@@ -8,12 +8,13 @@ set(JAVA_CLASSNAMES org/libjpegturbo/turbojpeg/TJ
org/libjpegturbo/turbojpeg/TJScalingFactor org/libjpegturbo/turbojpeg/TJScalingFactor
org/libjpegturbo/turbojpeg/TJTransform org/libjpegturbo/turbojpeg/TJTransform
org/libjpegturbo/turbojpeg/TJTransformer org/libjpegturbo/turbojpeg/TJTransformer
org/libjpegturbo/turbojpeg/YUVImage
TJUnitTest TJUnitTest
TJExample TJExample
TJBench) TJBench)
if(MSVC_IDE) if(MSVC_IDE)
set(OBJDIR "${CMAKE_CURRENT_BINARY_DIR}/$(OutDir)") set(OBJDIR "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}")
else() else()
set(OBJDIR "${CMAKE_CURRENT_BINARY_DIR}") set(OBJDIR "${CMAKE_CURRENT_BINARY_DIR}")
endif() endif()

View File

@@ -13,6 +13,7 @@ JAVASOURCES = org/libjpegturbo/turbojpeg/TJ.java \
org/libjpegturbo/turbojpeg/TJScalingFactor.java \ org/libjpegturbo/turbojpeg/TJScalingFactor.java \
org/libjpegturbo/turbojpeg/TJTransform.java \ org/libjpegturbo/turbojpeg/TJTransform.java \
org/libjpegturbo/turbojpeg/TJTransformer.java \ org/libjpegturbo/turbojpeg/TJTransformer.java \
org/libjpegturbo/turbojpeg/YUVImage.java \
TJExample.java \ TJExample.java \
TJUnitTest.java \ TJUnitTest.java \
TJBench.java TJBench.java
@@ -34,6 +35,7 @@ JAVA_CLASSES = org/libjpegturbo/turbojpeg/TJ.class \
org/libjpegturbo/turbojpeg/TJScalingFactor.class \ org/libjpegturbo/turbojpeg/TJScalingFactor.class \
org/libjpegturbo/turbojpeg/TJTransform.class \ org/libjpegturbo/turbojpeg/TJTransform.class \
org/libjpegturbo/turbojpeg/TJTransformer.class \ org/libjpegturbo/turbojpeg/TJTransformer.class \
org/libjpegturbo/turbojpeg/YUVImage.class \
TJExample.class \ TJExample.class \
TJUnitTest.class \ TJUnitTest.class \
TJBench.class TJBench.class

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C)2009-2013 D. R. Commander. All Rights Reserved. * Copyright (C)2009-2014 D. R. Commander. All Rights Reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are met:
@@ -34,12 +34,8 @@ import org.libjpegturbo.turbojpeg.*;
class TJBench { class TJBench {
static final int YUVENCODE = 1; static int flags = 0, quiet = 0, pf = TJ.PF_BGR, yuvpad = 1, warmup = 1;
static final int YUVDECODE = 2; static boolean compOnly, decompOnly, doTile, doYUV;
static final int YUVCOMPRESS = 3;
static int flags = 0, yuv = 0, quiet = 0, pf = TJ.PF_BGR, yuvpad = 1;
static boolean compOnly, decompOnly, doTile;
static final String[] pixFormatStr = { static final String[] pixFormatStr = {
"RGB", "BGR", "RGBX", "BGRX", "XBGR", "XRGB", "GRAY" "RGB", "BGR", "RGBX", "BGRX", "XBGR", "XRGB", "GRAY"
@@ -134,68 +130,97 @@ class TJBench {
/* Decompression test */ /* Decompression test */
static void decompTest(byte[] srcBuf, byte[][] jpegBuf, int[] jpegSize, static void decomp(byte[] srcBuf, byte[][] jpegBuf, int[] jpegSize,
byte[] dstBuf, int w, int h, int subsamp, byte[] dstBuf, int w, int h, int subsamp, int jpegQual,
int jpegQual, String fileName, int tilew, int tileh) String fileName, int tilew, int tileh) throws Exception {
throws Exception {
String qualStr = new String(""), sizeStr, tempStr; String qualStr = new String(""), sizeStr, tempStr;
TJDecompressor tjd; TJDecompressor tjd;
double start, elapsed; double elapsed, elapsedDecode;
int ps = TJ.getPixelSize(pf), i; int ps = TJ.getPixelSize(pf), i, iter = 0;
int scaledw = sf.getScaled(w); int scaledw = sf.getScaled(w);
int scaledh = sf.getScaled(h); int scaledh = sf.getScaled(h);
int yuvSize = TJ.bufSizeYUV(scaledw, yuvpad, scaledh, subsamp), bufsize;
int pitch = scaledw * ps; int pitch = scaledw * ps;
YUVImage yuvImage = null;
if (jpegQual > 0) if (jpegQual > 0)
qualStr = new String("_Q" + jpegQual); qualStr = new String("_Q" + jpegQual);
tjd = new TJDecompressor(); tjd = new TJDecompressor();
int bufSize = (yuv == YUVDECODE ? yuvSize : pitch * scaledh);
if (dstBuf == null) if (dstBuf == null)
dstBuf = new byte[bufSize]; dstBuf = new byte[pitch * scaledh];
/* Set the destination buffer to gray so we know whether the decompressor /* Set the destination buffer to gray so we know whether the decompressor
attempted to write to it */ attempted to write to it */
Arrays.fill(dstBuf, (byte)127); Arrays.fill(dstBuf, (byte)127);
/* Execute once to preload cache */ if (doYUV) {
tjd.setJPEGImage(jpegBuf[0], jpegSize[0]); int width = doTile ? tilew : scaledw;
if (yuv == YUVDECODE) int height = doTile ? tileh : scaledh;
tjd.decompressToYUV(dstBuf, scaledw, yuvpad, scaledh, flags); yuvImage = new YUVImage(width, yuvpad, height, subsamp);
else Arrays.fill(yuvImage.getBuf(), (byte)127);
tjd.decompress(dstBuf, scaledw, pitch, scaledh, pf, flags); }
/* Benchmark */ /* Benchmark */
for (i = 0, start = getTime(); (elapsed = getTime() - start) < benchTime; iter -= warmup;
i++) { elapsed = elapsedDecode = 0.0;
while (true) {
int tile = 0; int tile = 0;
if (yuv == YUVDECODE) double start = getTime();
tjd.decompressToYUV(dstBuf, scaledw, yuvpad, scaledh, flags);
else {
for (int y = 0; y < h; y += tileh) { for (int y = 0; y < h; y += tileh) {
for (int x = 0; x < w; x += tilew, tile++) { for (int x = 0; x < w; x += tilew, tile++) {
int width = doTile ? Math.min(tilew, w - x) : scaledw; int width = doTile ? Math.min(tilew, w - x) : scaledw;
int height = doTile ? Math.min(tileh, h - y) : scaledh; int height = doTile ? Math.min(tileh, h - y) : scaledh;
tjd.setJPEGImage(jpegBuf[tile], jpegSize[tile]); tjd.setSourceImage(jpegBuf[tile], jpegSize[tile]);
if (doYUV) {
yuvImage.setBuf(yuvImage.getBuf(), width, yuvpad, height, subsamp);
tjd.decompressToYUV(yuvImage, flags);
double startDecode = getTime();
tjd.setSourceImage(yuvImage);
tjd.decompress(dstBuf, x, y, width, pitch, height, pf, flags);
if (iter >= 0)
elapsedDecode += getTime() - startDecode;
} else
tjd.decompress(dstBuf, x, y, width, pitch, height, pf, flags); tjd.decompress(dstBuf, x, y, width, pitch, height, pf, flags);
} }
} }
iter++;
if (iter >= 1) {
elapsed += getTime() - start;
if (elapsed >= benchTime)
break;
} }
} }
if(doYUV)
elapsed -= elapsedDecode;
tjd = null; tjd = null;
for (i = 0; i < jpegBuf.length; i++)
jpegBuf[i] = null;
jpegBuf = null; jpegSize = null;
System.gc(); System.gc();
if (quiet != 0) if (quiet != 0) {
System.out.println( System.out.format("%-6s%s",
sigFig((double)(w * h) / 1000000. * (double)i / elapsed, 4)); sigFig((double)(w * h) / 1000000. * (double)iter / elapsed, 4),
else { quiet == 2 ? "\n" : " ");
System.out.format("D--> Frame rate: %f fps\n", if (doYUV)
(double)i / elapsed); System.out.format("%s\n",
System.out.format(" Dest. throughput: %f Megapixels/sec\n", sigFig((double)(w * h) / 1000000. * (double)iter / elapsedDecode, 4));
(double)(w * h) / 1000000. * (double)i / elapsed); else if (quiet != 2)
System.out.print("\n");
} else {
System.out.format("%s --> Frame rate: %f fps\n",
(doYUV ? "Decomp to YUV":"Decompress "),
(double)iter / elapsed);
System.out.format(" Throughput: %f Megapixels/sec\n",
(double)(w * h) / 1000000. * (double)iter / elapsed);
if (doYUV) {
System.out.format("YUV Decode --> Frame rate: %f fps\n",
(double)iter / elapsedDecode);
System.out.format(" Throughput: %f Megapixels/sec\n",
(double)(w * h) / 1000000. * (double)iter / elapsedDecode);
}
} }
if (sf.getNum() != 1 || sf.getDenom() != 1) if (sf.getNum() != 1 || sf.getDenom() != 1)
@@ -205,17 +230,11 @@ class TJBench {
else else
sizeStr = new String("full"); sizeStr = new String("full");
if (decompOnly) if (decompOnly)
tempStr = new String(fileName + "_" + sizeStr + tempStr = new String(fileName + "_" + sizeStr + ".bmp");
(yuv != 0 ? ".yuv" : ".bmp"));
else else
tempStr = new String(fileName + "_" + subName[subsamp] + qualStr + tempStr = new String(fileName + "_" + subName[subsamp] + qualStr +
"_" + sizeStr + (yuv != 0 ? ".yuv" : ".bmp")); "_" + sizeStr + ".bmp");
if (yuv == YUVDECODE) {
FileOutputStream fos = new FileOutputStream(tempStr);
fos.write(dstBuf, 0, yuvSize);
fos.close();
} else {
saveImage(tempStr, dstBuf, scaledw, scaledh, pf); saveImage(tempStr, dstBuf, scaledw, scaledh, pf);
int ndx = tempStr.indexOf('.'); int ndx = tempStr.indexOf('.');
tempStr = new String(tempStr.substring(0, ndx) + "-err.bmp"); tempStr = new String(tempStr.substring(0, ndx) + "-err.bmp");
@@ -248,87 +267,20 @@ class TJBench {
saveImage(tempStr, dstBuf, w, h, pf); saveImage(tempStr, dstBuf, w, h, pf);
} }
} }
}
static void doTestYUV(byte[] srcBuf, int w, int h, int subsamp, static void fullTest(byte[] srcBuf, int w, int h, int subsamp, int jpegQual,
String fileName) throws Exception {
TJCompressor tjc;
byte[] dstBuf;
double start, elapsed;
int ps = TJ.getPixelSize(pf), i;
int yuvSize = 0;
yuvSize = TJ.bufSizeYUV(w, h, subsamp);
dstBuf = new byte[yuvSize];
if (quiet == 0)
System.out.format(">>>>> %s (%s) <--> YUV %s <<<<<\n",
pixFormatStr[pf],
(flags & TJ.FLAG_BOTTOMUP) != 0 ? "Bottom-up" : "Top-down",
subNameLong[subsamp]);
if (quiet == 1)
System.out.format("%s\t%s\t%s\tN/A\t", pixFormatStr[pf],
(flags & TJ.FLAG_BOTTOMUP) != 0 ? "BU" : "TD",
subNameLong[subsamp]);
tjc = new TJCompressor(srcBuf, w, 0, h, pf);
tjc.setSubsamp(subsamp);
/* Execute once to preload cache */
tjc.encodeYUV(dstBuf, flags);
/* Benchmark */
for (i = 0, start = getTime();
(elapsed = getTime() - start) < benchTime; i++)
tjc.encodeYUV(dstBuf, flags);
if (quiet == 1)
System.out.format("%-4d %-4d\t", w, h);
if (quiet != 0) {
System.out.format("%s%c%s%c",
sigFig((double)(w * h) / 1000000. * (double) i / elapsed, 4),
quiet == 2 ? '\n' : '\t',
sigFig((double)(w * h * ps) / (double)yuvSize, 4),
quiet == 2 ? '\n' : '\t');
} else {
System.out.format("\n%s size: %d x %d\n", "Image", w, h);
System.out.format("C--> Frame rate: %f fps\n",
(double)i / elapsed);
System.out.format(" Output image size: %d bytes\n", yuvSize);
System.out.format(" Compression ratio: %f:1\n",
(double)(w * h * ps) / (double)yuvSize);
System.out.format(" Source throughput: %f Megapixels/sec\n",
(double)(w * h) / 1000000. * (double)i / elapsed);
System.out.format(" Output bit stream: %f Megabits/sec\n",
(double)yuvSize * 8. / 1000000. * (double)i / elapsed);
}
String tempStr = fileName + "_" + subName[subsamp] + ".yuv";
FileOutputStream fos = new FileOutputStream(tempStr);
fos.write(dstBuf, 0, yuvSize);
fos.close();
if (quiet == 0)
System.out.println("Reference image written to " + tempStr);
}
static void doTest(byte[] srcBuf, int w, int h, int subsamp, int jpegQual,
String fileName) throws Exception { String fileName) throws Exception {
TJCompressor tjc; TJCompressor tjc;
byte[] tmpBuf; byte[] tmpBuf;
byte[][] jpegBuf; byte[][] jpegBuf;
int[] jpegSize; int[] jpegSize;
double start, elapsed; double start, elapsed, elapsedEncode;
int totalJpegSize = 0, tilew, tileh, i; int totalJpegSize = 0, tilew, tileh, i, iter;
int ps = (yuv == YUVCOMPRESS ? 3 : TJ.getPixelSize(pf)); int ps = TJ.getPixelSize(pf);
int ntilesw = 1, ntilesh = 1, pitch = w * ps; int ntilesw = 1, ntilesh = 1, pitch = w * ps;
String pfStr = (yuv == YUVCOMPRESS ? "YUV" : pixFormatStr[pf]); String pfStr = pixFormatStr[pf];
YUVImage yuvImage = null;
if (yuv == YUVENCODE) {
doTestYUV(srcBuf, w, h, subsamp, fileName);
return;
}
tmpBuf = new byte[pitch * h]; tmpBuf = new byte[pitch * h];
@@ -353,61 +305,94 @@ class TJBench {
/* Compression test */ /* Compression test */
if (quiet == 1) if (quiet == 1)
System.out.format("%s\t%s\t%s\t%d\t", pfStr, System.out.format("%-4s (%s) %-5s %-3d ", pfStr,
(flags & TJ.FLAG_BOTTOMUP) != 0 ? "BU" : "TD", (flags & TJ.FLAG_BOTTOMUP) != 0 ? "BU" : "TD",
subNameLong[subsamp], jpegQual); subNameLong[subsamp], jpegQual);
if (yuv != YUVCOMPRESS)
for (i = 0; i < h; i++) for (i = 0; i < h; i++)
System.arraycopy(srcBuf, w * ps * i, tmpBuf, pitch * i, w * ps); System.arraycopy(srcBuf, w * ps * i, tmpBuf, pitch * i, w * ps);
if (yuv == YUVCOMPRESS)
tjc.setSourceImageYUV(srcBuf, tilew, yuvpad, tileh);
else
tjc.setSourceImage(srcBuf, tilew, pitch, tileh, pf);
tjc.setJPEGQuality(jpegQual); tjc.setJPEGQuality(jpegQual);
tjc.setSubsamp(subsamp); tjc.setSubsamp(subsamp);
/* Execute once to preload cache */ if (doYUV) {
tjc.compress(jpegBuf[0], flags); yuvImage = new YUVImage(tilew, yuvpad, tileh, subsamp);
Arrays.fill(yuvImage.getBuf(), (byte)127);
}
/* Benchmark */ /* Benchmark */
for (i = 0, start = getTime(); iter = -warmup;
(elapsed = getTime() - start) < benchTime; i++) { elapsed = elapsedEncode = 0.0;
while (true) {
int tile = 0; int tile = 0;
totalJpegSize = 0; totalJpegSize = 0;
start = getTime();
for (int y = 0; y < h; y += tileh) { for (int y = 0; y < h; y += tileh) {
for (int x = 0; x < w; x += tilew, tile++) { for (int x = 0; x < w; x += tilew, tile++) {
int width = Math.min(tilew, w - x); int width = Math.min(tilew, w - x);
int height = Math.min(tileh, h - y); int height = Math.min(tileh, h - y);
if (yuv != YUVCOMPRESS)
tjc.setSourceImage(srcBuf, x, y, width, pitch, height, pf); tjc.setSourceImage(srcBuf, x, y, width, pitch, height, pf);
if (doYUV) {
double startEncode = getTime();
yuvImage.setBuf(yuvImage.getBuf(), width, yuvpad, height,
subsamp);
tjc.encodeYUV(yuvImage, flags);
if (iter >= 0)
elapsedEncode += getTime() - startEncode;
tjc.setSourceImage(yuvImage);
}
tjc.compress(jpegBuf[tile], flags); tjc.compress(jpegBuf[tile], flags);
jpegSize[tile] = tjc.getCompressedSize(); jpegSize[tile] = tjc.getCompressedSize();
totalJpegSize += jpegSize[tile]; totalJpegSize += jpegSize[tile];
} }
} }
iter++;
if (iter >= 1) {
elapsed += getTime() - start;
if (elapsed >= benchTime)
break;
} }
}
if (doYUV)
elapsed -= elapsedEncode;
if (quiet == 1) if (quiet == 1)
System.out.format("%-4d %-4d\t", tilew, tileh); System.out.format("%-5d %-5d ", tilew, tileh);
if (quiet != 0) { if (quiet != 0) {
System.out.format("%s%c%s%c", if (doYUV)
sigFig((double)(w * h) / 1000000. * (double) i / elapsed, 4), System.out.format("%-6s%s",
quiet == 2 ? '\n' : '\t', sigFig((double)(w * h) / 1000000. * (double)iter / elapsedEncode, 4),
quiet == 2 ? "\n" : " ");
System.out.format("%-6s%s",
sigFig((double)(w * h) / 1000000. * (double)iter / elapsed, 4),
quiet == 2 ? "\n" : " ");
System.out.format("%-6s%s",
sigFig((double)(w * h * ps) / (double)totalJpegSize, 4), sigFig((double)(w * h * ps) / (double)totalJpegSize, 4),
quiet == 2 ? '\n' : '\t'); quiet == 2 ? "\n" : " ");
} else { } else {
System.out.format("\n%s size: %d x %d\n", doTile ? "Tile" : "Image", System.out.format("\n%s size: %d x %d\n", doTile ? "Tile" : "Image",
tilew, tileh); tilew, tileh);
System.out.format("C--> Frame rate: %f fps\n", if (doYUV) {
(double)i / elapsed); System.out.format("Encode YUV --> Frame rate: %f fps\n",
(double)iter / elapsedEncode);
System.out.format(" Output image size: %d bytes\n",
yuvImage.getSize());
System.out.format(" Compression ratio: %f:1\n",
(double)(w * h * ps) / (double)yuvImage.getSize());
System.out.format(" Throughput: %f Megapixels/sec\n",
(double)(w * h) / 1000000. * (double)iter / elapsedEncode);
System.out.format(" Output bit stream: %f Megabits/sec\n",
(double)yuvImage.getSize() * 8. / 1000000. * (double)iter / elapsedEncode);
}
System.out.format("%s --> Frame rate: %f fps\n",
doYUV ? "Comp from YUV" : "Compress ",
(double)iter / elapsed);
System.out.format(" Output image size: %d bytes\n", System.out.format(" Output image size: %d bytes\n",
totalJpegSize); totalJpegSize);
System.out.format(" Compression ratio: %f:1\n", System.out.format(" Compression ratio: %f:1\n",
(double)(w * h * ps) / (double)totalJpegSize); (double)(w * h * ps) / (double)totalJpegSize);
System.out.format(" Source throughput: %f Megapixels/sec\n", System.out.format(" Throughput: %f Megapixels/sec\n",
(double)(w * h) / 1000000. * (double)i / elapsed); (double)(w * h) / 1000000. * (double)iter / elapsed);
System.out.format(" Output bit stream: %f Megabits/sec\n", System.out.format(" Output bit stream: %f Megabits/sec\n",
(double)totalJpegSize * 8. / 1000000. * (double)i / elapsed); (double)totalJpegSize * 8. / 1000000. * (double)iter / elapsed);
} }
if (tilew == w && tileh == h) { if (tilew == w && tileh == h) {
String tempStr = fileName + "_" + subName[subsamp] + "_" + "Q" + String tempStr = fileName + "_" + subName[subsamp] + "_" + "Q" +
@@ -421,27 +406,22 @@ class TJBench {
/* Decompression test */ /* Decompression test */
if (!compOnly) if (!compOnly)
decompTest(srcBuf, jpegBuf, jpegSize, tmpBuf, w, h, subsamp, jpegQual, decomp(srcBuf, jpegBuf, jpegSize, tmpBuf, w, h, subsamp, jpegQual,
fileName, tilew, tileh); fileName, tilew, tileh);
for (i = 0; i < ntilesw * ntilesh; i++)
jpegBuf[i] = null;
jpegBuf = null; jpegSize = null;
System.gc();
if (tilew == w && tileh == h) break; if (tilew == w && tileh == h) break;
} }
} }
static void doDecompTest(String fileName) throws Exception { static void decompTest(String fileName) throws Exception {
TJTransformer tjt; TJTransformer tjt;
byte[][] jpegBuf; byte[][] jpegBuf = null;
byte[] srcBuf; byte[] srcBuf;
int[] jpegSize; int[] jpegSize = null;
int totalJpegSize; int totalJpegSize;
int w = 0, h = 0, subsamp = -1, cs = -1, _w, _h, _tilew, _tileh, int w = 0, h = 0, subsamp = -1, cs = -1, _w, _h, _tilew, _tileh,
_ntilesw, _ntilesh, _subsamp, x, y; _ntilesw, _ntilesh, _subsamp, x, y, iter;
int ntilesw = 1, ntilesh = 1; int ntilesw = 1, ntilesh = 1;
double start, elapsed; double start, elapsed;
int ps = TJ.getPixelSize(pf), tile; int ps = TJ.getPixelSize(pf), tile;
@@ -458,7 +438,7 @@ class TJBench {
tjt = new TJTransformer(); tjt = new TJTransformer();
tjt.setJPEGImage(srcBuf, srcSize); tjt.setSourceImage(srcBuf, srcSize);
w = tjt.getWidth(); w = tjt.getWidth();
h = tjt.getHeight(); h = tjt.getHeight();
subsamp = tjt.getSubsamp(); subsamp = tjt.getSubsamp();
@@ -466,19 +446,20 @@ class TJBench {
if (quiet == 1) { if (quiet == 1) {
System.out.println("All performance values in Mpixels/sec\n"); System.out.println("All performance values in Mpixels/sec\n");
System.out.format("Bitmap\tBitmap\tJPEG\tJPEG\t%s %s \tXform\tComp\tDecomp\n", System.out.format("Bitmap JPEG JPEG %s %s Xform Comp Decomp ",
(doTile ? "Tile " : "Image"), (doTile ? "Tile " : "Image"),
(doTile ? "Tile " : "Image")); (doTile ? "Tile " : "Image"));
System.out.println("Format\tOrder\tCS\tSubsamp\tWidth Height\tPerf \tRatio\tPerf\n"); if (doYUV)
} else if (quiet == 0) { System.out.print("Decode");
if (yuv == YUVDECODE) System.out.print("\n");
System.out.format(">>>>> JPEG %s --> YUV <<<<<", System.out.print("Format CS Subsamp Width Height Perf Ratio Perf ");
formatName(subsamp, cs)); if (doYUV)
else System.out.print("Perf");
System.out.format(">>>>> JPEG %s --> %s (%s) <<<<<", System.out.println("\n");
} else if (quiet == 0)
System.out.format(">>>>> JPEG %s --> %s (%s) <<<<<\n",
formatName(subsamp, cs), pixFormatStr[pf], formatName(subsamp, cs), pixFormatStr[pf],
(flags & TJ.FLAG_BOTTOMUP) != 0 ? "Bottom-up" : "Top-down"); (flags & TJ.FLAG_BOTTOMUP) != 0 ? "Bottom-up" : "Top-down");
}
for (int tilew = doTile ? 16 : w, tileh = doTile ? 16 : h; ; for (int tilew = doTile ? 16 : w, tileh = doTile ? 16 : h; ;
tilew *= 2, tileh *= 2) { tilew *= 2, tileh *= 2) {
@@ -498,10 +479,10 @@ class TJBench {
sf.getScaled(_h)); sf.getScaled(_h));
System.out.println(""); System.out.println("");
} else if (quiet == 1) { } else if (quiet == 1) {
System.out.format("%s\t%s\t%s\t%s\t", pixFormatStr[pf], System.out.format("%-4s (%s) %-5s %-5s ", pixFormatStr[pf],
(flags & TJ.FLAG_BOTTOMUP) != 0 ? "BU" : "TD", (flags & TJ.FLAG_BOTTOMUP) != 0 ? "BU" : "TD",
csName[cs], subNameLong[subsamp]); csName[cs], subNameLong[subsamp]);
System.out.format("%-4d %-4d\t", tilew, tileh); System.out.format("%-5d %-5d ", tilew, tileh);
} }
_subsamp = subsamp; _subsamp = subsamp;
@@ -530,6 +511,16 @@ class TJBench {
_ntilesw = (_w + _tilew - 1) / _tilew; _ntilesw = (_w + _tilew - 1) / _tilew;
_ntilesh = (_h + _tileh - 1) / _tileh; _ntilesh = (_h + _tileh - 1) / _tileh;
if (xformOp == TJTransform.OP_TRANSPOSE ||
xformOp == TJTransform.OP_TRANSVERSE ||
xformOp == TJTransform.OP_ROT90 ||
xformOp == TJTransform.OP_ROT270) {
if (_subsamp == TJ.SAMP_422)
_subsamp = TJ.SAMP_440;
else if (_subsamp == TJ.SAMP_440)
_subsamp = TJ.SAMP_422;
}
TJTransform[] t = new TJTransform[_ntilesw * _ntilesh]; TJTransform[] t = new TJTransform[_ntilesw * _ntilesh];
jpegBuf = new byte[_ntilesw * _ntilesh][TJ.bufSize(_tilew, _tileh, subsamp)]; jpegBuf = new byte[_ntilesw * _ntilesh][TJ.bufSize(_tilew, _tileh, subsamp)];
@@ -548,37 +539,45 @@ class TJBench {
} }
} }
iter = -warmup;
elapsed = 0.;
while (true) {
start = getTime(); start = getTime();
tjt.transform(jpegBuf, t, flags); tjt.transform(jpegBuf, t, flags);
jpegSize = tjt.getTransformedSizes(); jpegSize = tjt.getTransformedSizes();
elapsed = getTime() - start; iter++;
if (iter >= 1) {
elapsed += getTime() - start;
if (elapsed >= benchTime)
break;
}
}
t = null; t = null;
for (tile = 0, totalJpegSize = 0; tile < _ntilesw * _ntilesh; tile++) for (tile = 0, totalJpegSize = 0; tile < _ntilesw * _ntilesh; tile++)
totalJpegSize += jpegSize[tile]; totalJpegSize += jpegSize[tile];
if (quiet != 0) { if (quiet != 0) {
System.out.format("%s%c%s%c", System.out.format("%-6s%s%-6s%s",
sigFig((double)(w * h) / 1000000. / elapsed, 4), sigFig((double)(w * h) / 1000000. / elapsed, 4),
quiet == 2 ? '\n' : '\t', quiet == 2 ? "\n" : " ",
sigFig((double)(w * h * ps) / (double)totalJpegSize, 4), sigFig((double)(w * h * ps) / (double)totalJpegSize, 4),
quiet == 2 ? '\n' : '\t'); quiet == 2 ? "\n" : " ");
} else if (quiet == 0) { } else if (quiet == 0) {
System.out.format("X--> Frame rate: %f fps\n", System.out.format("Transform --> Frame rate: %f fps\n",
1.0 / elapsed); 1.0 / elapsed);
System.out.format(" Output image size: %lu bytes\n", System.out.format(" Output image size: %d bytes\n",
totalJpegSize); totalJpegSize);
System.out.format(" Compression ratio: %f:1\n", System.out.format(" Compression ratio: %f:1\n",
(double)(w * h * ps) / (double)totalJpegSize); (double)(w * h * ps) / (double)totalJpegSize);
System.out.format(" Source throughput: %f Megapixels/sec\n", System.out.format(" Throughput: %f Megapixels/sec\n",
(double)(w * h) / 1000000. / elapsed); (double)(w * h) / 1000000. / elapsed);
System.out.format(" Output bit stream: %f Megabits/sec\n", System.out.format(" Output bit stream: %f Megabits/sec\n",
(double)totalJpegSize * 8. / 1000000. / elapsed); (double)totalJpegSize * 8. / 1000000. / elapsed);
} }
} else { } else {
if (quiet == 1) if (quiet == 1)
System.out.print("N/A\tN/A\t"); System.out.print("N/A N/A ");
jpegBuf = new byte[1][TJ.bufSize(_tilew, _tileh, subsamp)]; jpegBuf = new byte[1][TJ.bufSize(_tilew, _tileh, subsamp)];
jpegSize = new int[1]; jpegSize = new int[1];
jpegSize[0] = srcSize; jpegSize[0] = srcSize;
@@ -590,7 +589,7 @@ class TJBench {
if (h == tileh) if (h == tileh)
_tileh = _h; _tileh = _h;
if ((xformOpt & TJTransform.OPT_NOOUTPUT) == 0) if ((xformOpt & TJTransform.OPT_NOOUTPUT) == 0)
decompTest(null, jpegBuf, jpegSize, null, _w, _h, _subsamp, 0, decomp(null, jpegBuf, jpegSize, null, _w, _h, _subsamp, 0,
fileName, _tilew, _tileh); fileName, _tilew, _tileh);
else if (quiet == 1) else if (quiet == 1)
System.out.println("N/A"); System.out.println("N/A");
@@ -610,7 +609,7 @@ class TJBench {
String className = new TJBench().getClass().getName(); String className = new TJBench().getClass().getName();
System.out.println("\nUSAGE: java " + className); System.out.println("\nUSAGE: java " + className);
System.out.println(" <Inputfile (BMP|YUV)> <Quality> [options]\n"); System.out.println(" <Inputfile (BMP)> <Quality> [options]\n");
System.out.println(" java " + className); System.out.println(" java " + className);
System.out.println(" <Inputfile (JPG)> [options]\n"); System.out.println(" <Inputfile (JPG)> [options]\n");
System.out.println("Options:\n"); System.out.println("Options:\n");
@@ -618,32 +617,24 @@ class TJBench {
System.out.println("-bottomup = Test bottom-up compression/decompression"); System.out.println("-bottomup = Test bottom-up compression/decompression");
System.out.println("-tile = Test performance of the codec when the image is encoded as separate"); System.out.println("-tile = Test performance of the codec when the image is encoded as separate");
System.out.println(" tiles of varying sizes."); System.out.println(" tiles of varying sizes.");
System.out.println("-forcemmx, -forcesse, -forcesse2, -forcesse3 =");
System.out.println(" Force MMX, SSE, SSE2, or SSE3 code paths in the underlying codec");
System.out.println("-rgb, -bgr, -rgbx, -bgrx, -xbgr, -xrgb ="); System.out.println("-rgb, -bgr, -rgbx, -bgrx, -xbgr, -xrgb =");
System.out.println(" Test the specified color conversion path in the codec (default: BGR)"); System.out.println(" Test the specified color conversion path in the codec (default = BGR)");
System.out.println("-fastupsample = Use the fastest chrominance upsampling algorithm available in"); System.out.println("-fastupsample = Use the fastest chrominance upsampling algorithm available in");
System.out.println(" the underlying codec"); System.out.println(" the underlying codec");
System.out.println("-fastdct = Use the fastest DCT/IDCT algorithms available in the underlying"); System.out.println("-fastdct = Use the fastest DCT/IDCT algorithms available in the underlying");
System.out.println(" codec"); System.out.println(" codec");
System.out.println("-accuratedct = Use the most accurate DCT/IDCT algorithms available in the"); System.out.println("-accuratedct = Use the most accurate DCT/IDCT algorithms available in the");
System.out.println(" underlying codec"); System.out.println(" underlying codec");
System.out.println("-subsamp <s> = if compressing a JPEG image from a YUV planar source image,"); System.out.println("-subsamp <s> = When testing JPEG compression, this option specifies the level");
System.out.println(" this specifies the level of chrominance subsampling used in the source"); System.out.println(" of chrominance subsampling to use (<s> = 444, 422, 440, 420, 411, or");
System.out.println(" image. Otherwise, this specifies the level of chrominance subsampling"); System.out.println(" GRAY). The default is to test Grayscale, 4:2:0, 4:2:2, and 4:4:4 in");
System.out.println(" to use in the JPEG destination image. <s> = 444, 422, 440, 420, 411,"); System.out.println(" sequence.");
System.out.println(" or GRAY");
System.out.println("-quiet = Output results in tabular rather than verbose format"); System.out.println("-quiet = Output results in tabular rather than verbose format");
System.out.println("-yuvencode = Encode RGB input as planar YUV rather than compressing as JPEG"); System.out.println("-yuv = Test YUV encoding/decoding functions");
System.out.println("-yuvdecode = Decode JPEG image to planar YUV rather than RGB"); System.out.println("-yuvpad <p> = If testing YUV encoding/decoding, this specifies the number of");
System.out.println("-yuvsize WxH = if compressing a JPEG image from a YUV planar source image, this"); System.out.println(" bytes to which each row of each plane in the intermediate YUV image is");
System.out.println(" specifies the width and height of the source image."); System.out.println(" padded (default = 1)");
System.out.println("-yuvpad <p> = if compressing a JPEG image from a YUV planar source image, this"); System.out.println("-scale M/N = Scale down the width/height of the decompressed JPEG image by a");
System.out.println(" specifies the number of bytes to which each row of each plane in the");
System.out.println(" source image is padded. If decompressing a JPEG image to a YUV planar");
System.out.println(" destination image, this specifies the row padding for each plane of the");
System.out.println(" destination image. (default=1)");
System.out.println("-scale M/N = scale down the width/height of the decompressed JPEG image by a");
System.out.print (" factor of M/N (M/N = "); System.out.print (" factor of M/N (M/N = ");
for (i = 0; i < nsf; i++) { for (i = 0; i < nsf; i++) {
System.out.format("%d/%d", scalingFactors[i].getNum(), System.out.format("%d/%d", scalingFactors[i].getNum(),
@@ -666,6 +657,8 @@ class TJBench {
System.out.println("-grayscale = Perform lossless grayscale conversion prior to decompression"); System.out.println("-grayscale = Perform lossless grayscale conversion prior to decompression");
System.out.println(" test (can be combined with the other transforms above)"); System.out.println(" test (can be combined with the other transforms above)");
System.out.println("-benchtime <t> = Run each benchmark for at least <t> seconds (default = 5.0)"); System.out.println("-benchtime <t> = Run each benchmark for at least <t> seconds (default = 5.0)");
System.out.println("-warmup <w> = Execute each benchmark <w> times to prime the cache before");
System.out.println(" taking performance measurements (default = 1)");
System.out.println("-componly = Stop after running compression tests. Do not test decompression.\n"); System.out.println("-componly = Stop after running compression tests. Do not test decompression.\n");
System.out.println("NOTE: If the quality is specified as a range (e.g. 90-100), a separate"); System.out.println("NOTE: If the quality is specified as a range (e.g. 90-100), a separate");
System.out.println("test will be performed for all quality values in the range.\n"); System.out.println("test will be performed for all quality values in the range.\n");
@@ -687,25 +680,10 @@ class TJBench {
String tempStr = argv[0].toLowerCase(); String tempStr = argv[0].toLowerCase();
if (tempStr.endsWith(".jpg") || tempStr.endsWith(".jpeg")) if (tempStr.endsWith(".jpg") || tempStr.endsWith(".jpeg"))
decompOnly = true; decompOnly = true;
if (tempStr.endsWith(".yuv"))
yuv = YUVCOMPRESS;
System.out.println(""); System.out.println("");
if (argv.length > minArg) { if (!decompOnly) {
for (int i = minArg; i < argv.length; i++) {
if (argv[i].equalsIgnoreCase("-yuvencode")) {
System.out.println("Testing YUV planar encoding\n");
yuv = YUVENCODE; maxQual = minQual = 100;
}
if (argv[i].equalsIgnoreCase("-yuvdecode")) {
System.out.println("Testing YUV planar decoding\n");
yuv = YUVDECODE;
}
}
}
if (!decompOnly && yuv != YUVENCODE) {
minArg = 2; minArg = 2;
if (argv.length < minArg) if (argv.length < minArg)
usage(); usage();
@@ -729,22 +707,6 @@ class TJBench {
if (argv[i].equalsIgnoreCase("-tile")) { if (argv[i].equalsIgnoreCase("-tile")) {
doTile = true; xformOpt |= TJTransform.OPT_CROP; doTile = true; xformOpt |= TJTransform.OPT_CROP;
} }
if (argv[i].equalsIgnoreCase("-forcesse3")) {
System.out.println("Forcing SSE3 code\n");
flags |= TJ.FLAG_FORCESSE3;
}
if (argv[i].equalsIgnoreCase("-forcesse2")) {
System.out.println("Forcing SSE2 code\n");
flags |= TJ.FLAG_FORCESSE2;
}
if (argv[i].equalsIgnoreCase("-forcesse")) {
System.out.println("Forcing SSE code\n");
flags |= TJ.FLAG_FORCESSE;
}
if (argv[i].equalsIgnoreCase("-forcemmx")) {
System.out.println("Forcing MMX code\n");
flags |= TJ.FLAG_FORCEMMX;
}
if (argv[i].equalsIgnoreCase("-fastupsample")) { if (argv[i].equalsIgnoreCase("-fastupsample")) {
System.out.println("Using fast upsampling code\n"); System.out.println("Using fast upsampling code\n");
flags |= TJ.FLAG_FASTUPSAMPLE; flags |= TJ.FLAG_FASTUPSAMPLE;
@@ -826,18 +788,9 @@ class TJBench {
else else
usage(); usage();
} }
if (argv[i].equalsIgnoreCase("-yuvsize") && i < argv.length - 1) { if (argv[i].equalsIgnoreCase("-yuv")) {
int temp1 = 0, temp2 = 0; System.out.println("Testing YUV planar encoding/decoding\n");
Scanner scanner = new Scanner(argv[++i]).useDelimiter("x"); doYUV = true;
try {
temp1 = scanner.nextInt();
temp2 = scanner.nextInt();
} catch(Exception e) {}
if (temp1 >= 1 && temp2 >= 1) {
w = temp1;
h = temp2;
} else
usage();
} }
if (argv[i].equalsIgnoreCase("-yuvpad") && i < argv.length - 1) { if (argv[i].equalsIgnoreCase("-yuvpad") && i < argv.length - 1) {
int temp = 0; int temp = 0;
@@ -864,6 +817,16 @@ class TJBench {
} }
if (argv[i].equalsIgnoreCase("-componly")) if (argv[i].equalsIgnoreCase("-componly"))
compOnly = true; compOnly = true;
if (argv[i].equalsIgnoreCase("-warmup") && i < argv.length - 1) {
int temp = -1;
try {
temp = Integer.parseInt(argv[++i]);
} catch (NumberFormatException e) {}
if (temp >= 0) {
warmup = temp;
System.out.format("Warmup runs = %d\n\n", warmup);
}
}
if (argv[i].equalsIgnoreCase("-?")) if (argv[i].equalsIgnoreCase("-?"))
usage(); usage();
} }
@@ -878,25 +841,7 @@ class TJBench {
doTile = false; doTile = false;
} }
if (yuv != 0 && doTile) {
System.out.println("Disabling tiled compression/decompression tests, because those tests do not");
System.out.println("work when YUV encoding, compression, or decoding is enabled.\n");
doTile = false;
}
if (!decompOnly) { if (!decompOnly) {
if(yuv == YUVCOMPRESS) {
if (w < 1 || h < 1 || subsamp < 0 || subsamp >= TJ.NUMSAMP)
throw new Exception("YUV image size and/or subsampling not specified");
FileInputStream fis = new FileInputStream(argv[0]);
int srcSize = (int)fis.getChannel().size();
if (srcSize != TJ.bufSizeYUV(w, yuvpad, h, subsamp))
throw new Exception("YUV image file is the wrong size");
srcBuf = new byte[srcSize];
fis.read(srcBuf, 0, srcSize);
fis.close();
}
else {
int[] width = new int[1], height = new int[1]; int[] width = new int[1], height = new int[1];
srcBuf = loadImage(argv[0], width, height, pf); srcBuf = loadImage(argv[0], width, height, pf);
w = width[0]; h = height[0]; w = width[0]; h = height[0];
@@ -904,41 +849,52 @@ class TJBench {
if ((index = argv[0].indexOf('.')) >= 0) if ((index = argv[0].indexOf('.')) >= 0)
argv[0] = argv[0].substring(0, index); argv[0] = argv[0].substring(0, index);
} }
}
if (quiet == 1 && !decompOnly) { if (quiet == 1 && !decompOnly) {
System.out.println("All performance values in Mpixels/sec\n"); System.out.println("All performance values in Mpixels/sec\n");
System.out.format("Bitmap\tBitmap\tJPEG\tJPEG\t%s %s \tComp\tComp\tDecomp\n", System.out.format("Bitmap JPEG JPEG %s %s ",
(doTile ? "Tile " : "Image"), (doTile ? "Tile " : "Image")); (doTile ? "Tile " : "Image"), (doTile ? "Tile " : "Image"));
System.out.println("Format\tOrder\tSubsamp\tQual\tWidth Height\tPerf \tRatio\tPerf\n"); if (doYUV)
System.out.print("Encode ");
System.out.print("Comp Comp Decomp ");
if (doYUV)
System.out.print("Decode");
System.out.print("\n");
System.out.print("Format Subsamp Qual Width Height ");
if (doYUV)
System.out.print("Perf ");
System.out.print("Perf Ratio Perf ");
if (doYUV)
System.out.print("Perf");
System.out.println("\n");
} }
if (decompOnly) { if (decompOnly) {
doDecompTest(argv[0]); decompTest(argv[0]);
System.out.println(""); System.out.println("");
System.exit(retval); System.exit(retval);
} }
System.gc(); System.gc();
if (yuv == YUVCOMPRESS || (subsamp >= 0 && subsamp < TJ.NUMSAMP)) { if (subsamp >= 0 && subsamp < TJ.NUMSAMP) {
for (int i = maxQual; i >= minQual; i--) for (int i = maxQual; i >= minQual; i--)
doTest(srcBuf, w, h, subsamp, i, argv[0]); fullTest(srcBuf, w, h, subsamp, i, argv[0]);
System.out.println(""); System.out.println("");
} else { } else {
for (int i = maxQual; i >= minQual; i--) for (int i = maxQual; i >= minQual; i--)
doTest(srcBuf, w, h, TJ.SAMP_GRAY, i, argv[0]); fullTest(srcBuf, w, h, TJ.SAMP_GRAY, i, argv[0]);
System.out.println(""); System.out.println("");
System.gc(); System.gc();
for (int i = maxQual; i >= minQual; i--) for (int i = maxQual; i >= minQual; i--)
doTest(srcBuf, w, h, TJ.SAMP_420, i, argv[0]); fullTest(srcBuf, w, h, TJ.SAMP_420, i, argv[0]);
System.out.println(""); System.out.println("");
System.gc(); System.gc();
for (int i = maxQual; i >= minQual; i--) for (int i = maxQual; i >= minQual; i--)
doTest(srcBuf, w, h, TJ.SAMP_422, i, argv[0]); fullTest(srcBuf, w, h, TJ.SAMP_422, i, argv[0]);
System.out.println(""); System.out.println("");
System.gc(); System.gc();
for (int i = maxQual; i >= minQual; i--) for (int i = maxQual; i >= minQual; i--)
doTest(srcBuf, w, h, TJ.SAMP_444, i, argv[0]); fullTest(srcBuf, w, h, TJ.SAMP_444, i, argv[0]);
System.out.println(""); System.out.println("");
} }

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C)2011-2012 D. R. Commander. All Rights Reserved. * Copyright (C)2011-2012, 2014 D. R. Commander. All Rights Reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are met:
@@ -277,7 +277,7 @@ public class TJExample implements TJCustomFilter {
scaleFactor.isOne()) { scaleFactor.isOne()) {
file = new File(argv[1]); file = new File(argv[1]);
FileOutputStream fos = new FileOutputStream(file); FileOutputStream fos = new FileOutputStream(file);
fos.write(tjd.getJPEGBuf(), 0, tjd.getJPEGSize()); fos.write(tjd.getSourceBuf(), 0, tjd.getSourceSize());
fos.close(); fos.close();
System.exit(0); System.exit(0);
} }
@@ -324,11 +324,11 @@ public class TJExample implements TJCustomFilter {
tjc.setSubsamp(outSubsamp); tjc.setSubsamp(outSubsamp);
tjc.setJPEGQuality(outQual); tjc.setJPEGQuality(outQual);
if (img != null) if (img != null)
jpegBuf = tjc.compress(img, flags); tjc.setSourceImage(img, 0, 0, 0, 0);
else { else {
tjc.setSourceImage(bmpBuf, width, 0, height, TJ.PF_BGRX); tjc.setSourceImage(bmpBuf, 0, 0, width, 0, height, TJ.PF_BGRX);
jpegBuf = tjc.compress(flags);
} }
jpegBuf = tjc.compress(flags);
jpegSize = tjc.getCompressedSize(); jpegSize = tjc.getCompressedSize();
tjc.close(); tjc.close();

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C)2011-2013 D. R. Commander. All Rights Reserved. * Copyright (C)2011-2014 D. R. Commander. All Rights Reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are met:
@@ -92,9 +92,7 @@ public class TJUnitTest {
TJ.PF_RGB TJ.PF_RGB
}; };
private static final int YUVENCODE = 1; private static boolean doYUV = false;
private static final int YUVDECODE = 2;
private static int yuv = 0;
private static int pad = 4; private static int pad = 4;
private static boolean bi = false; private static boolean bi = false;
@@ -152,10 +150,6 @@ public class TJUnitTest {
return "Unknown"; return "Unknown";
} }
private static double getTime() {
return (double)System.nanoTime() / 1.0e9;
}
private static void initBuf(byte[] buf, int w, int pitch, int h, int pf, private static void initBuf(byte[] buf, int w, int pitch, int h, int pf,
int flags) throws Exception { int flags) throws Exception {
int roffset = TJ.getRedOffset(pf); int roffset = TJ.getRedOffset(pf);
@@ -538,54 +532,6 @@ public class TJUnitTest {
return ((v + (p) - 1) & (~((p) - 1))); return ((v + (p) - 1) & (~((p) - 1)));
} }
private static void initBufYUV(byte[] buf, int w, int pad, int h,
int subsamp) throws Exception {
int row, col;
int hsf = TJ.getMCUWidth(subsamp) / 8, vsf = TJ.getMCUHeight(subsamp) / 8;
int pw = PAD(w, hsf), ph = PAD(h, vsf);
int cw = pw / hsf, ch = ph / vsf;
int ypitch = PAD(pw, pad), uvpitch = PAD(cw, pad);
int halfway = 16, blockSize = 8;
Arrays.fill(buf, (byte)0);
for (row = 0; row < ph; row++) {
for (col = 0; col < pw; col++) {
int index = ypitch * row + col;
if (((row / blockSize) + (col / blockSize)) % 2 == 0) {
if (row < halfway)
buf[index] = (byte)255;
else
buf[index] = 0;
} else {
if (row < halfway)
buf[index] = 76;
else
buf[index] = (byte)226;
}
}
}
if (subsamp != TJ.SAMP_GRAY) {
halfway = 16 / vsf;
for (row = 0; row < ch; row++) {
for (col = 0; col < cw; col++) {
int uindex = ypitch * ph + (uvpitch * row + col),
vindex = ypitch * ph + uvpitch * ch + (uvpitch * row + col);
if (((row * vsf / blockSize) + (col * hsf / blockSize)) % 2 == 0) {
buf[uindex] = buf[vindex] = (byte)128;
} else {
if (row < halfway) {
buf[uindex] = 85;
buf[vindex] = (byte)255;
} else {
buf[uindex] = 0;
buf[vindex] = (byte)149;
}
}
}
}
}
}
private static int checkBufYUV(byte[] buf, int size, int w, int h, private static int checkBufYUV(byte[] buf, int size, int w, int h,
int subsamp, TJScalingFactor sf) int subsamp, TJScalingFactor sf)
throws Exception { throws Exception {
@@ -690,96 +636,68 @@ public class TJUnitTest {
private static int compTest(TJCompressor tjc, byte[] dstBuf, int w, private static int compTest(TJCompressor tjc, byte[] dstBuf, int w,
int h, int pf, String baseName, int subsamp, int h, int pf, String baseName, int subsamp,
int jpegQual, int flags) throws Exception { int jpegQual, int flags) throws Exception {
String tempstr; String tempStr;
byte[] srcBuf = null; byte[] srcBuf = null;
BufferedImage img = null; BufferedImage img = null;
String pfStr; String pfStr, pfStrLong;
String buStr = (flags & TJ.FLAG_BOTTOMUP) != 0 ? "BU" : "TD";
String buStrLong = (flags & TJ.FLAG_BOTTOMUP) != 0 ? String buStrLong = (flags & TJ.FLAG_BOTTOMUP) != 0 ?
"Bottom-Up" : "Top-Down "; "Bottom-Up" : "Top-Down ";
String buStr = (flags & TJ.FLAG_BOTTOMUP) != 0 ? "BU" : "TD";
double t;
int size = 0, ps, imgType = pf; int size = 0, ps, imgType = pf;
if (yuv == YUVDECODE) {
System.out.format("YUV %s %s --> JPEG Q%d ... ", subNameLong[subsamp],
buStrLong, jpegQual);
srcBuf = new byte[TJ.bufSizeYUV(w, pad, h, subsamp)];
initBufYUV(srcBuf, w, pad, h, subsamp);
pfStr = "YUV";
} else {
if (bi) { if (bi) {
pf = biTypePF(imgType); pf = biTypePF(imgType);
pfStr = biTypeStr(imgType); pfStr = biTypeStr(imgType);
} else pfStrLong = pfStr + " (" + pixFormatStr[pf] + ")";
} else {
pfStr = pixFormatStr[pf]; pfStr = pixFormatStr[pf];
pfStrLong = pfStr;
}
ps = TJ.getPixelSize(pf); ps = TJ.getPixelSize(pf);
System.out.print(pfStr + " ");
if (bi)
System.out.print("(" + pixFormatStr[pf] + ") ");
if (yuv == YUVENCODE)
System.out.format("%s -> %s YUV ... ", buStrLong,
subNameLong[subsamp]);
else
System.out.format("%s -> %s Q%d ... ", buStrLong, subNameLong[subsamp],
jpegQual);
if (bi) { if (bi) {
img = new BufferedImage(w, h, imgType); img = new BufferedImage(w, h, imgType);
initImg(img, pf, flags); initImg(img, pf, flags);
tempstr = baseName + "_enc_" + pfStr + "_" + buStr + "_" + tempStr = baseName + "_enc_" + pfStr + "_" + buStr + "_" +
subName[subsamp] + "_Q" + jpegQual + ".png"; subName[subsamp] + "_Q" + jpegQual + ".png";
File file = new File(tempstr); File file = new File(tempStr);
ImageIO.write(img, "png", file); ImageIO.write(img, "png", file);
tjc.setSourceImage(img, 0, 0, 0, 0);
} else { } else {
srcBuf = new byte[w * h * ps + 1]; srcBuf = new byte[w * h * ps + 1];
initBuf(srcBuf, w, w * ps, h, pf, flags); initBuf(srcBuf, w, w * ps, h, pf, flags);
} tjc.setSourceImage(srcBuf, 0, 0, w, 0, h, pf);
} }
Arrays.fill(dstBuf, (byte)0); Arrays.fill(dstBuf, (byte)0);
t = getTime();
tjc.setSubsamp(subsamp); tjc.setSubsamp(subsamp);
tjc.setJPEGQuality(jpegQual); tjc.setJPEGQuality(jpegQual);
tjc.setYUVPad(pad); if (doYUV) {
if (bi) { System.out.format("%s %s -> YUV %s ... ", pfStrLong, buStrLong,
if (yuv == YUVENCODE) subNameLong[subsamp]);
tjc.encodeYUV(img, dstBuf, flags); YUVImage yuvImage = tjc.encodeYUV(pad, flags);
else if (checkBufYUV(yuvImage.getBuf(), yuvImage.getSize(), w, h, subsamp,
tjc.compress(img, dstBuf, flags);
} else {
if (yuv == YUVDECODE)
tjc.setSourceImageYUV(srcBuf, w, pad, h);
else
tjc.setSourceImage(srcBuf, w, 0, h, pf);
if (yuv == YUVENCODE)
tjc.encodeYUV(dstBuf, flags);
else
tjc.compress(dstBuf, flags);
}
size = tjc.getCompressedSize();
t = getTime() - t;
if (yuv == YUVENCODE)
tempstr = baseName + "_enc_" + pfStr + "_" + buStr + "_" +
subName[subsamp] + ".yuv";
else
tempstr = baseName + "_enc_" + pfStr + "_" + buStr + "_" +
subName[subsamp] + "_Q" + jpegQual + ".jpg";
writeJPEG(dstBuf, size, tempstr);
if (yuv == YUVENCODE) {
if (checkBufYUV(dstBuf, size, w, h, subsamp,
new TJScalingFactor(1, 1)) == 1) new TJScalingFactor(1, 1)) == 1)
System.out.print("Passed."); System.out.print("Passed.\n");
else { else {
System.out.print("FAILED!"); System.out.print("FAILED!\n");
exitStatus = -1; exitStatus = -1;
} }
} else
System.out.print("Done."); System.out.format("YUV %s %s -> JPEG Q%d ... ", subNameLong[subsamp],
System.out.format(" %.6f ms\n", t * 1000.); buStrLong, jpegQual);
System.out.println(" Result in " + tempstr); tjc.setSourceImage(yuvImage);
} else {
System.out.format("%s %s -> %s Q%d ... ", pfStrLong, buStrLong,
subNameLong[subsamp], jpegQual);
}
tjc.compress(dstBuf, flags);
size = tjc.getCompressedSize();
tempStr = baseName + "_enc_" + pfStr + "_" + buStr + "_" +
subName[subsamp] + "_Q" + jpegQual + ".jpg";
writeJPEG(dstBuf, size, tempStr);
System.out.println("Done.\n Result in " + tempStr);
return size; return size;
} }
@@ -788,41 +706,25 @@ public class TJUnitTest {
int jpegSize, int w, int h, int pf, int jpegSize, int w, int h, int pf,
String baseName, int subsamp, int flags, String baseName, int subsamp, int flags,
TJScalingFactor sf) throws Exception { TJScalingFactor sf) throws Exception {
String pfStr, tempstr; String pfStr, pfStrLong, tempStr;
double t; String buStrLong = (flags & TJ.FLAG_BOTTOMUP) != 0 ?
"Bottom-Up" : "Top-Down ";
int scaledWidth = sf.getScaled(w); int scaledWidth = sf.getScaled(w);
int scaledHeight = sf.getScaled(h); int scaledHeight = sf.getScaled(h);
int temp1, temp2, imgType = pf; int temp1, temp2, imgType = pf;
BufferedImage img = null; BufferedImage img = null;
byte[] dstBuf = null; byte[] dstBuf = null;
if (yuv == YUVENCODE) return;
if (bi) { if (bi) {
pf = biTypePF(imgType); pf = biTypePF(imgType);
pfStr = biTypeStr(imgType); pfStr = biTypeStr(imgType);
} else pfStrLong = pfStr + " (" + pixFormatStr[pf] + ")";
} else {
pfStr = pixFormatStr[pf]; pfStr = pixFormatStr[pf];
pfStrLong = pfStr;
System.out.print("JPEG -> ");
if (yuv == YUVDECODE)
System.out.print("YUV " + subNameLong[subsamp] + " ");
else {
System.out.print(pfStr + " ");
if (bi)
System.out.print("(" + pixFormatStr[pf] + ") ");
if ((flags & TJ.FLAG_BOTTOMUP) != 0)
System.out.print("Bottom-Up ");
else
System.out.print("Top-Down ");
} }
if (!sf.isOne())
System.out.print(sf.getNum() + "/" + sf.getDenom() + " ... ");
else
System.out.print("... ");
t = getTime(); tjd.setSourceImage(jpegBuf, jpegSize);
tjd.setJPEGImage(jpegBuf, jpegSize);
if (tjd.getWidth() != w || tjd.getHeight() != h || if (tjd.getWidth() != w || tjd.getHeight() != h ||
tjd.getSubsamp() != subsamp) tjd.getSubsamp() != subsamp)
throw new Exception("Incorrect JPEG header"); throw new Exception("Incorrect JPEG header");
@@ -834,45 +736,53 @@ public class TJUnitTest {
if (temp1 != scaledWidth || temp2 != scaledHeight) if (temp1 != scaledWidth || temp2 != scaledHeight)
throw new Exception("Scaled size mismatch"); throw new Exception("Scaled size mismatch");
if (yuv == YUVDECODE) if (doYUV) {
dstBuf = tjd.decompressToYUV(scaledWidth, pad, scaledHeight, flags); System.out.format("JPEG -> YUV %s ", subNameLong[subsamp]);
if(!sf.isOne())
System.out.format("%d/%d ... ", sf.getNum(), sf.getDenom());
else System.out.print("... ");
YUVImage yuvImage = tjd.decompressToYUV(scaledWidth, pad, scaledHeight,
flags);
if (checkBufYUV(yuvImage.getBuf(), yuvImage.getSize(), scaledWidth,
scaledHeight, subsamp, sf) == 1)
System.out.print("Passed.\n");
else { else {
System.out.print("FAILED!\n"); exitStatus = -1;
}
System.out.format("YUV %s -> %s %s ... ", subNameLong[subsamp],
pfStrLong, buStrLong);
tjd.setSourceImage(yuvImage);
} else {
System.out.format("JPEG -> %s %s ", pfStrLong, buStrLong);
if(!sf.isOne())
System.out.format("%d/%d ... ", sf.getNum(), sf.getDenom());
else System.out.print("... ");
}
if (bi) if (bi)
img = tjd.decompress(scaledWidth, scaledHeight, imgType, flags); img = tjd.decompress(scaledWidth, scaledHeight, imgType, flags);
else else
dstBuf = tjd.decompress(scaledWidth, 0, scaledHeight, pf, flags); dstBuf = tjd.decompress(scaledWidth, 0, scaledHeight, pf, flags);
}
t = getTime() - t;
if (bi) { if (bi) {
tempstr = baseName + "_dec_" + pfStr + "_" + tempStr = baseName + "_dec_" + pfStr + "_" +
(((flags & TJ.FLAG_BOTTOMUP) != 0) ? "BU" : "TD") + "_" + (((flags & TJ.FLAG_BOTTOMUP) != 0) ? "BU" : "TD") + "_" +
subName[subsamp] + "_" + subName[subsamp] + "_" +
(double)sf.getNum() / (double)sf.getDenom() + "x" + ".png"; (double)sf.getNum() / (double)sf.getDenom() + "x" + ".png";
File file = new File(tempstr); File file = new File(tempStr);
ImageIO.write(img, "png", file); ImageIO.write(img, "png", file);
} }
if (yuv == YUVDECODE) {
if (checkBufYUV(dstBuf, dstBuf.length, scaledWidth, scaledHeight,
subsamp, sf) == 1)
System.out.print("Passed.");
else {
System.out.print("FAILED!"); exitStatus = -1;
}
} else {
if ((bi && checkImg(img, pf, subsamp, sf, flags) == 1) || if ((bi && checkImg(img, pf, subsamp, sf, flags) == 1) ||
(!bi && checkBuf(dstBuf, scaledWidth, (!bi && checkBuf(dstBuf, scaledWidth,
scaledWidth * TJ.getPixelSize(pf), scaledHeight, pf, scaledWidth * TJ.getPixelSize(pf), scaledHeight, pf,
subsamp, sf, flags) == 1)) subsamp, sf, flags) == 1))
System.out.print("Passed."); System.out.print("Passed.\n");
else { else {
System.out.print("FAILED!"); System.out.print("FAILED!\n");
exitStatus = -1; exitStatus = -1;
} }
} }
System.out.format(" %.6f ms\n", t * 1000.);
}
private static void decompTest(TJDecompressor tjd, byte[] jpegBuf, private static void decompTest(TJDecompressor tjd, byte[] jpegBuf,
int jpegSize, int w, int h, int pf, int jpegSize, int w, int h, int pf,
@@ -900,9 +810,6 @@ public class TJUnitTest {
int size; int size;
byte[] dstBuf; byte[] dstBuf;
if (yuv == YUVENCODE)
dstBuf = new byte[TJ.bufSizeYUV(w, pad, h, subsamp)];
else
dstBuf = new byte[TJ.bufSize(w, h, subsamp)]; dstBuf = new byte[TJ.bufSize(w, h, subsamp)];
try { try {
@@ -916,20 +823,16 @@ public class TJUnitTest {
if (subsamp == TJ.SAMP_422 || subsamp == TJ.SAMP_420 || if (subsamp == TJ.SAMP_422 || subsamp == TJ.SAMP_420 ||
subsamp == TJ.SAMP_440 || subsamp == TJ.SAMP_411) subsamp == TJ.SAMP_440 || subsamp == TJ.SAMP_411)
flags |= TJ.FLAG_FASTUPSAMPLE; flags |= TJ.FLAG_FASTUPSAMPLE;
if (i == 1) { if (i == 1)
if (yuv == YUVDECODE) {
tjc.close();
tjd.close();
return;
} else
flags |= TJ.FLAG_BOTTOMUP; flags |= TJ.FLAG_BOTTOMUP;
}
size = compTest(tjc, dstBuf, w, h, pf, baseName, subsamp, 100, size = compTest(tjc, dstBuf, w, h, pf, baseName, subsamp, 100,
flags); flags);
decompTest(tjd, dstBuf, size, w, h, pf, baseName, subsamp, flags); decompTest(tjd, dstBuf, size, w, h, pf, baseName, subsamp, flags);
if (pf >= TJ.PF_RGBX && pf <= TJ.PF_XRGB && !bi) if (pf >= TJ.PF_RGBX && pf <= TJ.PF_XRGB && !bi) {
System.out.print("\n");
decompTest(tjd, dstBuf, size, w, h, pf + (TJ.PF_RGBA - TJ.PF_RGBX), decompTest(tjd, dstBuf, size, w, h, pf + (TJ.PF_RGBA - TJ.PF_RGBX),
baseName, subsamp, flags); baseName, subsamp, flags);
}
System.out.print("\n"); System.out.print("\n");
} }
} }
@@ -945,7 +848,8 @@ public class TJUnitTest {
private static void bufSizeTest() throws Exception { private static void bufSizeTest() throws Exception {
int w, h, i, subsamp; int w, h, i, subsamp;
byte[] srcBuf, jpegBuf; byte[] srcBuf, dstBuf = null;
YUVImage dstImage = null;
TJCompressor tjc = null; TJCompressor tjc = null;
Random r = new Random(); Random r = new Random();
@@ -959,22 +863,34 @@ public class TJUnitTest {
if (h % 100 == 0) if (h % 100 == 0)
System.out.format("%04d x %04d\b\b\b\b\b\b\b\b\b\b\b", w, h); System.out.format("%04d x %04d\b\b\b\b\b\b\b\b\b\b\b", w, h);
srcBuf = new byte[w * h * 4]; srcBuf = new byte[w * h * 4];
jpegBuf = new byte[TJ.bufSize(w, h, subsamp)]; if (doYUV)
dstImage = new YUVImage(w, pad, h, subsamp);
else
dstBuf = new byte[TJ.bufSize(w, h, subsamp)];
for (i = 0; i < w * h * 4; i++) { for (i = 0; i < w * h * 4; i++) {
srcBuf[i] = (byte)(r.nextInt(2) * 255); srcBuf[i] = (byte)(r.nextInt(2) * 255);
} }
tjc.setSourceImage(srcBuf, w, 0, h, TJ.PF_BGRX); tjc.setSourceImage(srcBuf, 0, 0, w, 0, h, TJ.PF_BGRX);
tjc.setSubsamp(subsamp); tjc.setSubsamp(subsamp);
tjc.setJPEGQuality(100); tjc.setJPEGQuality(100);
tjc.compress(jpegBuf, 0); if (doYUV)
tjc.encodeYUV(dstImage, 0);
else
tjc.compress(dstBuf, 0);
srcBuf = new byte[h * w * 4]; srcBuf = new byte[h * w * 4];
jpegBuf = new byte[TJ.bufSize(h, w, subsamp)]; if (doYUV)
dstImage = new YUVImage(h, pad, w, subsamp);
else
dstBuf = new byte[TJ.bufSize(h, w, subsamp)];
for (i = 0; i < h * w * 4; i++) { for (i = 0; i < h * w * 4; i++) {
srcBuf[i] = (byte)(r.nextInt(2) * 255); srcBuf[i] = (byte)(r.nextInt(2) * 255);
} }
tjc.setSourceImage(srcBuf, h, 0, w, TJ.PF_BGRX); tjc.setSourceImage(srcBuf, 0, 0, h, 0, w, TJ.PF_BGRX);
tjc.compress(jpegBuf, 0); if (doYUV)
tjc.encodeYUV(dstImage, 0);
else
tjc.compress(dstBuf, 0);
} }
} }
} }
@@ -989,10 +905,9 @@ public class TJUnitTest {
public static void main(String[] argv) { public static void main(String[] argv) {
try { try {
String testName = "javatest"; String testName = "javatest";
boolean doyuv = false;
for (int i = 0; i < argv.length; i++) { for (int i = 0; i < argv.length; i++) {
if (argv[i].equalsIgnoreCase("-yuv")) if (argv[i].equalsIgnoreCase("-yuv"))
doyuv = true; doYUV = true;
if (argv[i].equalsIgnoreCase("-noyuvpad")) if (argv[i].equalsIgnoreCase("-noyuvpad"))
pad = 1; pad = 1;
if (argv[i].substring(0, 1).equalsIgnoreCase("-h") || if (argv[i].substring(0, 1).equalsIgnoreCase("-h") ||
@@ -1003,10 +918,8 @@ public class TJUnitTest {
testName = "javabitest"; testName = "javabitest";
} }
} }
if (doyuv) { if (doYUV)
yuv = YUVENCODE;
_4byteFormats[4] = -1; _4byteFormats[4] = -1;
}
doTest(35, 39, bi ? _3byteFormatsBI : _3byteFormats, TJ.SAMP_444, doTest(35, 39, bi ? _3byteFormatsBI : _3byteFormats, TJ.SAMP_444,
testName); testName);
doTest(39, 41, bi ? _4byteFormatsBI : _4byteFormats, TJ.SAMP_444, doTest(39, 41, bi ? _4byteFormatsBI : _4byteFormats, TJ.SAMP_444,
@@ -1033,24 +946,17 @@ public class TJUnitTest {
_4byteFormats[4] = -1; _4byteFormats[4] = -1;
doTest(35, 39, bi ? _4byteFormatsBI : _4byteFormats, TJ.SAMP_GRAY, doTest(35, 39, bi ? _4byteFormatsBI : _4byteFormats, TJ.SAMP_GRAY,
testName); testName);
if (!doyuv && !bi) if (!bi)
bufSizeTest(); bufSizeTest();
if (doyuv && !bi) { if (doYUV && !bi) {
yuv = YUVDECODE; System.out.print("\n--------------------\n\n");
doTest(48, 48, onlyRGB, TJ.SAMP_444, "javatest_yuv0"); doTest(48, 48, onlyRGB, TJ.SAMP_444, "javatest_yuv0");
doTest(35, 39, onlyRGB, TJ.SAMP_444, "javatest_yuv1");
doTest(48, 48, onlyRGB, TJ.SAMP_422, "javatest_yuv0"); doTest(48, 48, onlyRGB, TJ.SAMP_422, "javatest_yuv0");
doTest(39, 41, onlyRGB, TJ.SAMP_422, "javatest_yuv1");
doTest(48, 48, onlyRGB, TJ.SAMP_420, "javatest_yuv0"); doTest(48, 48, onlyRGB, TJ.SAMP_420, "javatest_yuv0");
doTest(41, 35, onlyRGB, TJ.SAMP_420, "javatest_yuv1");
doTest(48, 48, onlyRGB, TJ.SAMP_440, "javatest_yuv0"); doTest(48, 48, onlyRGB, TJ.SAMP_440, "javatest_yuv0");
doTest(35, 39, onlyRGB, TJ.SAMP_440, "javatest_yuv1");
doTest(48, 48, onlyRGB, TJ.SAMP_411, "javatest_yuv0"); doTest(48, 48, onlyRGB, TJ.SAMP_411, "javatest_yuv0");
doTest(39, 41, onlyRGB, TJ.SAMP_411, "javatest_yuv1");
doTest(48, 48, onlyRGB, TJ.SAMP_GRAY, "javatest_yuv0"); doTest(48, 48, onlyRGB, TJ.SAMP_GRAY, "javatest_yuv0");
doTest(41, 35, onlyRGB, TJ.SAMP_GRAY, "javatest_yuv1");
doTest(48, 48, onlyGray, TJ.SAMP_GRAY, "javatest_yuv0"); doTest(48, 48, onlyGray, TJ.SAMP_GRAY, "javatest_yuv0");
doTest(35, 39, onlyGray, TJ.SAMP_GRAY, "javatest_yuv1");
} }
} catch(Exception e) { } catch(Exception e) {
e.printStackTrace(); e.printStackTrace();

View File

@@ -1,41 +1,23 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage --> <!-- NewPage -->
<HTML> <html lang="en">
<HEAD> <head>
<TITLE> <title>All Classes</title>
All Classes <link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
</TITLE> </head>
<body>
<h1 class="bar">All Classes</h1>
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style"> <div class="indexContainer">
<ul>
<li><a href="org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg" target="classFrame">TJ</a></li>
</HEAD> <li><a href="org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg" target="classFrame">TJCompressor</a></li>
<li><a href="org/libjpegturbo/turbojpeg/TJCustomFilter.html" title="interface in org.libjpegturbo.turbojpeg" target="classFrame"><i>TJCustomFilter</i></a></li>
<BODY BGCOLOR="white"> <li><a href="org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg" target="classFrame">TJDecompressor</a></li>
<FONT size="+1" CLASS="FrameHeadingFont"> <li><a href="org/libjpegturbo/turbojpeg/TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg" target="classFrame">TJScalingFactor</a></li>
<B>All Classes</B></FONT> <li><a href="org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg" target="classFrame">TJTransform</a></li>
<BR> <li><a href="org/libjpegturbo/turbojpeg/TJTransformer.html" title="class in org.libjpegturbo.turbojpeg" target="classFrame">TJTransformer</a></li>
<li><a href="org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg" target="classFrame">YUVImage</a></li>
<TABLE BORDER="0" WIDTH="100%" SUMMARY=""> </ul>
<TR> </div>
<TD NOWRAP><FONT CLASS="FrameItemFont"><A HREF="org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg" target="classFrame">TJ</A> </body>
<BR> </html>
<A HREF="org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg" target="classFrame">TJCompressor</A>
<BR>
<A HREF="org/libjpegturbo/turbojpeg/TJCustomFilter.html" title="interface in org.libjpegturbo.turbojpeg" target="classFrame"><I>TJCustomFilter</I></A>
<BR>
<A HREF="org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg" target="classFrame">TJDecompressor</A>
<BR>
<A HREF="org/libjpegturbo/turbojpeg/TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg" target="classFrame">TJScalingFactor</A>
<BR>
<A HREF="org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg" target="classFrame">TJTransform</A>
<BR>
<A HREF="org/libjpegturbo/turbojpeg/TJTransformer.html" title="class in org.libjpegturbo.turbojpeg" target="classFrame">TJTransformer</A>
<BR>
</FONT></TD>
</TR>
</TABLE>
</BODY>
</HTML>

View File

@@ -1,41 +1,23 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage --> <!-- NewPage -->
<HTML> <html lang="en">
<HEAD> <head>
<TITLE> <title>All Classes</title>
All Classes <link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
</TITLE> </head>
<body>
<h1 class="bar">All Classes</h1>
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style"> <div class="indexContainer">
<ul>
<li><a href="org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></li>
</HEAD> <li><a href="org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg">TJCompressor</a></li>
<li><a href="org/libjpegturbo/turbojpeg/TJCustomFilter.html" title="interface in org.libjpegturbo.turbojpeg"><i>TJCustomFilter</i></a></li>
<BODY BGCOLOR="white"> <li><a href="org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></li>
<FONT size="+1" CLASS="FrameHeadingFont"> <li><a href="org/libjpegturbo/turbojpeg/TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg">TJScalingFactor</a></li>
<B>All Classes</B></FONT> <li><a href="org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</a></li>
<BR> <li><a href="org/libjpegturbo/turbojpeg/TJTransformer.html" title="class in org.libjpegturbo.turbojpeg">TJTransformer</a></li>
<li><a href="org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a></li>
<TABLE BORDER="0" WIDTH="100%" SUMMARY=""> </ul>
<TR> </div>
<TD NOWRAP><FONT CLASS="FrameItemFont"><A HREF="org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</A> </body>
<BR> </html>
<A HREF="org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg">TJCompressor</A>
<BR>
<A HREF="org/libjpegturbo/turbojpeg/TJCustomFilter.html" title="interface in org.libjpegturbo.turbojpeg"><I>TJCustomFilter</I></A>
<BR>
<A HREF="org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</A>
<BR>
<A HREF="org/libjpegturbo/turbojpeg/TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg">TJScalingFactor</A>
<BR>
<A HREF="org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</A>
<BR>
<A HREF="org/libjpegturbo/turbojpeg/TJTransformer.html" title="class in org.libjpegturbo.turbojpeg">TJTransformer</A>
<BR>
</FONT></TD>
</TR>
</TABLE>
</BODY>
</HTML>

View File

@@ -1,462 +1,479 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage --> <!-- NewPage -->
<HTML> <html lang="en">
<HEAD> <head>
<TITLE> <title>Constant Field Values</title>
Constant Field Values <link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
</TITLE> </head>
<body>
<script type="text/javascript"><!--
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) { if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Constant Field Values"; parent.document.title="Constant Field Values";
} }
} //-->
</SCRIPT> </script>
<NOSCRIPT> <noscript>
</NOSCRIPT> <div>JavaScript is disabled on your browser.</div>
</noscript>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ========= START OF TOP NAVBAR ======= --> <!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A> <div class="topNav"><a name="navbar_top">
<A HREF="#skip-navbar_top" title="Skip navigation links"></A> <!-- -->
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<TR> <!-- -->
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> </a>
<A NAME="navbar_top_firstrow"><!-- --></A> <ul class="navList" title="Navigation">
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <li><a href="org/libjpegturbo/turbojpeg/package-summary.html">Package</a></li>
<TR ALIGN="center" VALIGN="top"> <li>Class</li>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="org/libjpegturbo/turbojpeg/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <li><a href="org/libjpegturbo/turbojpeg/package-tree.html">Tree</a></li>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT>&nbsp;</TD> <li><a href="deprecated-list.html">Deprecated</a></li>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="org/libjpegturbo/turbojpeg/package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <li><a href="index-all.html">Index</a></li>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <li><a href="help-doc.html">Help</a></li>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> </ul>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </div>
</TR> <div class="subNav">
</TABLE> <ul class="navList">
</TD> <li>Prev</li>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> <li>Next</li>
</EM> </ul>
</TD> <ul class="navList">
</TR> <li><a href="index.html?constant-values.html" target="_top">Frames</a></li>
<li><a href="constant-values.html" target="_top">No Frames</a></li>
<TR> </ul>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <ul class="navList" id="allclasses_navbar_top">
&nbsp;PREV&nbsp; <li><a href="allclasses-noframe.html">All Classes</a></li>
&nbsp;NEXT</FONT></TD> </ul>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <div>
<A HREF="index.html?constant-values.html" target="_top"><B>FRAMES</B></A> &nbsp; <script type="text/javascript"><!--
&nbsp;<A HREF="constant-values.html" target="_top"><B>NO FRAMES</B></A> &nbsp; allClassesLink = document.getElementById("allclasses_navbar_top");
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) { if(window==top) {
document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>'); allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
} }
//--> //-->
</SCRIPT> </script>
<NOSCRIPT> </div>
<A HREF="allclasses-noframe.html"><B>All Classes</B></A> <a name="skip-navbar_top">
</NOSCRIPT> <!-- -->
</a></div>
</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= --> <!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<HR> <h1 title="Constant Field Values" class="title">Constant Field Values</h1>
<CENTER> <h2 title="Contents">Contents</h2>
<H1> <ul>
Constant Field Values</H1> <li><a href="#org.libjpegturbo">org.libjpegturbo.*</a></li>
</CENTER> </ul>
<HR SIZE="4" NOSHADE> </div>
<B>Contents</B><UL> <div class="constantValuesContainer"><a name="org.libjpegturbo">
<LI><A HREF="#org.libjpegturbo">org.libjpegturbo.*</A> <!-- -->
</UL> </a>
<h2 title="org.libjpegturbo">org.libjpegturbo.*</h2>
<A NAME="org.libjpegturbo"><!-- --></A> <ul class="blockList">
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <li class="blockList">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <table border="0" cellpadding="3" cellspacing="0" summary="Constant Field Values table, listing constant fields, and values">
<TH ALIGN="left"><FONT SIZE="+2"> <caption><span>org.libjpegturbo.turbojpeg.<a href="org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></span><span class="tabEnd">&nbsp;</span></caption>
org.libjpegturbo.*</FONT></TH> <tr>
</TR> <th class="colFirst" scope="col">Modifier and Type</th>
</TABLE> <th scope="col">Constant Field</th>
<th class="colLast" scope="col">Value</th>
<P> </tr>
<tbody>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <tr class="altColor">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.CS_CMYK">
<TH ALIGN="left" COLSPAN="3">org.libjpegturbo.turbojpeg.<A HREF="org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</A></TH> <!-- -->
</TR> </a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<TR BGCOLOR="white" CLASS="TableRowColor"> <td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#CS_CMYK">CS_CMYK</a></code></td>
<A NAME="org.libjpegturbo.turbojpeg.TJ.CS_CMYK"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> <td class="colLast"><code>3</code></td>
<CODE>public&nbsp;static&nbsp;final&nbsp;int</CODE></FONT></TD> </tr>
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#CS_CMYK">CS_CMYK</A></CODE></TD> <tr class="rowColor">
<TD ALIGN="right"><CODE>3</CODE></TD> <td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.CS_GRAY">
</TR> <!-- -->
<TR BGCOLOR="white" CLASS="TableRowColor"> </a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<A NAME="org.libjpegturbo.turbojpeg.TJ.CS_GRAY"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> <td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#CS_GRAY">CS_GRAY</a></code></td>
<CODE>public&nbsp;static&nbsp;final&nbsp;int</CODE></FONT></TD> <td class="colLast"><code>2</code></td>
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#CS_GRAY">CS_GRAY</A></CODE></TD> </tr>
<TD ALIGN="right"><CODE>2</CODE></TD> <tr class="altColor">
</TR> <td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.CS_RGB">
<TR BGCOLOR="white" CLASS="TableRowColor"> <!-- -->
<A NAME="org.libjpegturbo.turbojpeg.TJ.CS_RGB"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> </a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<CODE>public&nbsp;static&nbsp;final&nbsp;int</CODE></FONT></TD> <td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#CS_RGB">CS_RGB</a></code></td>
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#CS_RGB">CS_RGB</A></CODE></TD> <td class="colLast"><code>0</code></td>
<TD ALIGN="right"><CODE>0</CODE></TD> </tr>
</TR> <tr class="rowColor">
<TR BGCOLOR="white" CLASS="TableRowColor"> <td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.CS_YCbCr">
<A NAME="org.libjpegturbo.turbojpeg.TJ.CS_YCbCr"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> <!-- -->
<CODE>public&nbsp;static&nbsp;final&nbsp;int</CODE></FONT></TD> </a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#CS_YCbCr">CS_YCbCr</A></CODE></TD> <td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#CS_YCbCr">CS_YCbCr</a></code></td>
<TD ALIGN="right"><CODE>1</CODE></TD> <td class="colLast"><code>1</code></td>
</TR> </tr>
<TR BGCOLOR="white" CLASS="TableRowColor"> <tr class="altColor">
<A NAME="org.libjpegturbo.turbojpeg.TJ.CS_YCCK"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> <td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.CS_YCCK">
<CODE>public&nbsp;static&nbsp;final&nbsp;int</CODE></FONT></TD> <!-- -->
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#CS_YCCK">CS_YCCK</A></CODE></TD> </a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<TD ALIGN="right"><CODE>4</CODE></TD> <td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#CS_YCCK">CS_YCCK</a></code></td>
</TR> <td class="colLast"><code>4</code></td>
<TR BGCOLOR="white" CLASS="TableRowColor"> </tr>
<A NAME="org.libjpegturbo.turbojpeg.TJ.FLAG_ACCURATEDCT"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> <tr class="rowColor">
<CODE>public&nbsp;static&nbsp;final&nbsp;int</CODE></FONT></TD> <td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.FLAG_ACCURATEDCT">
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#FLAG_ACCURATEDCT">FLAG_ACCURATEDCT</A></CODE></TD> <!-- -->
<TD ALIGN="right"><CODE>4096</CODE></TD> </a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
</TR> <td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#FLAG_ACCURATEDCT">FLAG_ACCURATEDCT</a></code></td>
<TR BGCOLOR="white" CLASS="TableRowColor"> <td class="colLast"><code>4096</code></td>
<A NAME="org.libjpegturbo.turbojpeg.TJ.FLAG_BOTTOMUP"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> </tr>
<CODE>public&nbsp;static&nbsp;final&nbsp;int</CODE></FONT></TD> <tr class="altColor">
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#FLAG_BOTTOMUP">FLAG_BOTTOMUP</A></CODE></TD> <td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.FLAG_BOTTOMUP">
<TD ALIGN="right"><CODE>2</CODE></TD> <!-- -->
</TR> </a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<TR BGCOLOR="white" CLASS="TableRowColor"> <td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#FLAG_BOTTOMUP">FLAG_BOTTOMUP</a></code></td>
<A NAME="org.libjpegturbo.turbojpeg.TJ.FLAG_FASTDCT"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> <td class="colLast"><code>2</code></td>
<CODE>public&nbsp;static&nbsp;final&nbsp;int</CODE></FONT></TD> </tr>
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#FLAG_FASTDCT">FLAG_FASTDCT</A></CODE></TD> <tr class="rowColor">
<TD ALIGN="right"><CODE>2048</CODE></TD> <td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.FLAG_FASTDCT">
</TR> <!-- -->
<TR BGCOLOR="white" CLASS="TableRowColor"> </a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<A NAME="org.libjpegturbo.turbojpeg.TJ.FLAG_FASTUPSAMPLE"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> <td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#FLAG_FASTDCT">FLAG_FASTDCT</a></code></td>
<CODE>public&nbsp;static&nbsp;final&nbsp;int</CODE></FONT></TD> <td class="colLast"><code>2048</code></td>
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#FLAG_FASTUPSAMPLE">FLAG_FASTUPSAMPLE</A></CODE></TD> </tr>
<TD ALIGN="right"><CODE>256</CODE></TD> <tr class="altColor">
</TR> <td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.FLAG_FASTUPSAMPLE">
<TR BGCOLOR="white" CLASS="TableRowColor"> <!-- -->
<A NAME="org.libjpegturbo.turbojpeg.TJ.FLAG_FORCEMMX"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> </a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<CODE>public&nbsp;static&nbsp;final&nbsp;int</CODE></FONT></TD> <td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#FLAG_FASTUPSAMPLE">FLAG_FASTUPSAMPLE</a></code></td>
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#FLAG_FORCEMMX">FLAG_FORCEMMX</A></CODE></TD> <td class="colLast"><code>256</code></td>
<TD ALIGN="right"><CODE>8</CODE></TD> </tr>
</TR> <tr class="rowColor">
<TR BGCOLOR="white" CLASS="TableRowColor"> <td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.FLAG_FORCEMMX">
<A NAME="org.libjpegturbo.turbojpeg.TJ.FLAG_FORCESSE"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> <!-- -->
<CODE>public&nbsp;static&nbsp;final&nbsp;int</CODE></FONT></TD> </a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#FLAG_FORCESSE">FLAG_FORCESSE</A></CODE></TD> <td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#FLAG_FORCEMMX">FLAG_FORCEMMX</a></code></td>
<TD ALIGN="right"><CODE>16</CODE></TD> <td class="colLast"><code>8</code></td>
</TR> </tr>
<TR BGCOLOR="white" CLASS="TableRowColor"> <tr class="altColor">
<A NAME="org.libjpegturbo.turbojpeg.TJ.FLAG_FORCESSE2"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> <td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.FLAG_FORCESSE">
<CODE>public&nbsp;static&nbsp;final&nbsp;int</CODE></FONT></TD> <!-- -->
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#FLAG_FORCESSE2">FLAG_FORCESSE2</A></CODE></TD> </a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<TD ALIGN="right"><CODE>32</CODE></TD> <td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#FLAG_FORCESSE">FLAG_FORCESSE</a></code></td>
</TR> <td class="colLast"><code>16</code></td>
<TR BGCOLOR="white" CLASS="TableRowColor"> </tr>
<A NAME="org.libjpegturbo.turbojpeg.TJ.FLAG_FORCESSE3"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> <tr class="rowColor">
<CODE>public&nbsp;static&nbsp;final&nbsp;int</CODE></FONT></TD> <td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.FLAG_FORCESSE2">
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#FLAG_FORCESSE3">FLAG_FORCESSE3</A></CODE></TD> <!-- -->
<TD ALIGN="right"><CODE>128</CODE></TD> </a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
</TR> <td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#FLAG_FORCESSE2">FLAG_FORCESSE2</a></code></td>
<TR BGCOLOR="white" CLASS="TableRowColor"> <td class="colLast"><code>32</code></td>
<A NAME="org.libjpegturbo.turbojpeg.TJ.NUMCS"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> </tr>
<CODE>public&nbsp;static&nbsp;final&nbsp;int</CODE></FONT></TD> <tr class="altColor">
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#NUMCS">NUMCS</A></CODE></TD> <td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.FLAG_FORCESSE3">
<TD ALIGN="right"><CODE>5</CODE></TD> <!-- -->
</TR> </a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<TR BGCOLOR="white" CLASS="TableRowColor"> <td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#FLAG_FORCESSE3">FLAG_FORCESSE3</a></code></td>
<A NAME="org.libjpegturbo.turbojpeg.TJ.NUMPF"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> <td class="colLast"><code>128</code></td>
<CODE>public&nbsp;static&nbsp;final&nbsp;int</CODE></FONT></TD> </tr>
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#NUMPF">NUMPF</A></CODE></TD> <tr class="rowColor">
<TD ALIGN="right"><CODE>12</CODE></TD> <td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.NUMCS">
</TR> <!-- -->
<TR BGCOLOR="white" CLASS="TableRowColor"> </a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<A NAME="org.libjpegturbo.turbojpeg.TJ.NUMSAMP"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> <td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#NUMCS">NUMCS</a></code></td>
<CODE>public&nbsp;static&nbsp;final&nbsp;int</CODE></FONT></TD> <td class="colLast"><code>5</code></td>
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#NUMSAMP">NUMSAMP</A></CODE></TD> </tr>
<TD ALIGN="right"><CODE>6</CODE></TD> <tr class="altColor">
</TR> <td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.NUMPF">
<TR BGCOLOR="white" CLASS="TableRowColor"> <!-- -->
<A NAME="org.libjpegturbo.turbojpeg.TJ.PF_ABGR"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> </a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<CODE>public&nbsp;static&nbsp;final&nbsp;int</CODE></FONT></TD> <td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#NUMPF">NUMPF</a></code></td>
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#PF_ABGR">PF_ABGR</A></CODE></TD> <td class="colLast"><code>12</code></td>
<TD ALIGN="right"><CODE>9</CODE></TD> </tr>
</TR> <tr class="rowColor">
<TR BGCOLOR="white" CLASS="TableRowColor"> <td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.NUMSAMP">
<A NAME="org.libjpegturbo.turbojpeg.TJ.PF_ARGB"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> <!-- -->
<CODE>public&nbsp;static&nbsp;final&nbsp;int</CODE></FONT></TD> </a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#PF_ARGB">PF_ARGB</A></CODE></TD> <td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#NUMSAMP">NUMSAMP</a></code></td>
<TD ALIGN="right"><CODE>10</CODE></TD> <td class="colLast"><code>6</code></td>
</TR> </tr>
<TR BGCOLOR="white" CLASS="TableRowColor"> <tr class="altColor">
<A NAME="org.libjpegturbo.turbojpeg.TJ.PF_BGR"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> <td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.PF_ABGR">
<CODE>public&nbsp;static&nbsp;final&nbsp;int</CODE></FONT></TD> <!-- -->
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#PF_BGR">PF_BGR</A></CODE></TD> </a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<TD ALIGN="right"><CODE>1</CODE></TD> <td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#PF_ABGR">PF_ABGR</a></code></td>
</TR> <td class="colLast"><code>9</code></td>
<TR BGCOLOR="white" CLASS="TableRowColor"> </tr>
<A NAME="org.libjpegturbo.turbojpeg.TJ.PF_BGRA"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> <tr class="rowColor">
<CODE>public&nbsp;static&nbsp;final&nbsp;int</CODE></FONT></TD> <td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.PF_ARGB">
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#PF_BGRA">PF_BGRA</A></CODE></TD> <!-- -->
<TD ALIGN="right"><CODE>8</CODE></TD> </a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
</TR> <td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#PF_ARGB">PF_ARGB</a></code></td>
<TR BGCOLOR="white" CLASS="TableRowColor"> <td class="colLast"><code>10</code></td>
<A NAME="org.libjpegturbo.turbojpeg.TJ.PF_BGRX"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> </tr>
<CODE>public&nbsp;static&nbsp;final&nbsp;int</CODE></FONT></TD> <tr class="altColor">
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#PF_BGRX">PF_BGRX</A></CODE></TD> <td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.PF_BGR">
<TD ALIGN="right"><CODE>3</CODE></TD> <!-- -->
</TR> </a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<TR BGCOLOR="white" CLASS="TableRowColor"> <td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#PF_BGR">PF_BGR</a></code></td>
<A NAME="org.libjpegturbo.turbojpeg.TJ.PF_CMYK"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> <td class="colLast"><code>1</code></td>
<CODE>public&nbsp;static&nbsp;final&nbsp;int</CODE></FONT></TD> </tr>
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#PF_CMYK">PF_CMYK</A></CODE></TD> <tr class="rowColor">
<TD ALIGN="right"><CODE>11</CODE></TD> <td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.PF_BGRA">
</TR> <!-- -->
<TR BGCOLOR="white" CLASS="TableRowColor"> </a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<A NAME="org.libjpegturbo.turbojpeg.TJ.PF_GRAY"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> <td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#PF_BGRA">PF_BGRA</a></code></td>
<CODE>public&nbsp;static&nbsp;final&nbsp;int</CODE></FONT></TD> <td class="colLast"><code>8</code></td>
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#PF_GRAY">PF_GRAY</A></CODE></TD> </tr>
<TD ALIGN="right"><CODE>6</CODE></TD> <tr class="altColor">
</TR> <td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.PF_BGRX">
<TR BGCOLOR="white" CLASS="TableRowColor"> <!-- -->
<A NAME="org.libjpegturbo.turbojpeg.TJ.PF_RGB"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> </a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<CODE>public&nbsp;static&nbsp;final&nbsp;int</CODE></FONT></TD> <td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#PF_BGRX">PF_BGRX</a></code></td>
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#PF_RGB">PF_RGB</A></CODE></TD> <td class="colLast"><code>3</code></td>
<TD ALIGN="right"><CODE>0</CODE></TD> </tr>
</TR> <tr class="rowColor">
<TR BGCOLOR="white" CLASS="TableRowColor"> <td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.PF_CMYK">
<A NAME="org.libjpegturbo.turbojpeg.TJ.PF_RGBA"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> <!-- -->
<CODE>public&nbsp;static&nbsp;final&nbsp;int</CODE></FONT></TD> </a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#PF_RGBA">PF_RGBA</A></CODE></TD> <td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#PF_CMYK">PF_CMYK</a></code></td>
<TD ALIGN="right"><CODE>7</CODE></TD> <td class="colLast"><code>11</code></td>
</TR> </tr>
<TR BGCOLOR="white" CLASS="TableRowColor"> <tr class="altColor">
<A NAME="org.libjpegturbo.turbojpeg.TJ.PF_RGBX"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> <td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.PF_GRAY">
<CODE>public&nbsp;static&nbsp;final&nbsp;int</CODE></FONT></TD> <!-- -->
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#PF_RGBX">PF_RGBX</A></CODE></TD> </a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<TD ALIGN="right"><CODE>2</CODE></TD> <td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#PF_GRAY">PF_GRAY</a></code></td>
</TR> <td class="colLast"><code>6</code></td>
<TR BGCOLOR="white" CLASS="TableRowColor"> </tr>
<A NAME="org.libjpegturbo.turbojpeg.TJ.PF_XBGR"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> <tr class="rowColor">
<CODE>public&nbsp;static&nbsp;final&nbsp;int</CODE></FONT></TD> <td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.PF_RGB">
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#PF_XBGR">PF_XBGR</A></CODE></TD> <!-- -->
<TD ALIGN="right"><CODE>4</CODE></TD> </a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
</TR> <td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#PF_RGB">PF_RGB</a></code></td>
<TR BGCOLOR="white" CLASS="TableRowColor"> <td class="colLast"><code>0</code></td>
<A NAME="org.libjpegturbo.turbojpeg.TJ.PF_XRGB"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> </tr>
<CODE>public&nbsp;static&nbsp;final&nbsp;int</CODE></FONT></TD> <tr class="altColor">
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#PF_XRGB">PF_XRGB</A></CODE></TD> <td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.PF_RGBA">
<TD ALIGN="right"><CODE>5</CODE></TD> <!-- -->
</TR> </a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<TR BGCOLOR="white" CLASS="TableRowColor"> <td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#PF_RGBA">PF_RGBA</a></code></td>
<A NAME="org.libjpegturbo.turbojpeg.TJ.SAMP_411"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> <td class="colLast"><code>7</code></td>
<CODE>public&nbsp;static&nbsp;final&nbsp;int</CODE></FONT></TD> </tr>
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#SAMP_411">SAMP_411</A></CODE></TD> <tr class="rowColor">
<TD ALIGN="right"><CODE>5</CODE></TD> <td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.PF_RGBX">
</TR> <!-- -->
<TR BGCOLOR="white" CLASS="TableRowColor"> </a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<A NAME="org.libjpegturbo.turbojpeg.TJ.SAMP_420"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> <td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#PF_RGBX">PF_RGBX</a></code></td>
<CODE>public&nbsp;static&nbsp;final&nbsp;int</CODE></FONT></TD> <td class="colLast"><code>2</code></td>
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#SAMP_420">SAMP_420</A></CODE></TD> </tr>
<TD ALIGN="right"><CODE>2</CODE></TD> <tr class="altColor">
</TR> <td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.PF_XBGR">
<TR BGCOLOR="white" CLASS="TableRowColor"> <!-- -->
<A NAME="org.libjpegturbo.turbojpeg.TJ.SAMP_422"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> </a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<CODE>public&nbsp;static&nbsp;final&nbsp;int</CODE></FONT></TD> <td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#PF_XBGR">PF_XBGR</a></code></td>
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#SAMP_422">SAMP_422</A></CODE></TD> <td class="colLast"><code>4</code></td>
<TD ALIGN="right"><CODE>1</CODE></TD> </tr>
</TR> <tr class="rowColor">
<TR BGCOLOR="white" CLASS="TableRowColor"> <td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.PF_XRGB">
<A NAME="org.libjpegturbo.turbojpeg.TJ.SAMP_440"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> <!-- -->
<CODE>public&nbsp;static&nbsp;final&nbsp;int</CODE></FONT></TD> </a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#SAMP_440">SAMP_440</A></CODE></TD> <td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#PF_XRGB">PF_XRGB</a></code></td>
<TD ALIGN="right"><CODE>4</CODE></TD> <td class="colLast"><code>5</code></td>
</TR> </tr>
<TR BGCOLOR="white" CLASS="TableRowColor"> <tr class="altColor">
<A NAME="org.libjpegturbo.turbojpeg.TJ.SAMP_444"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> <td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.SAMP_411">
<CODE>public&nbsp;static&nbsp;final&nbsp;int</CODE></FONT></TD> <!-- -->
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#SAMP_444">SAMP_444</A></CODE></TD> </a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<TD ALIGN="right"><CODE>0</CODE></TD> <td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#SAMP_411">SAMP_411</a></code></td>
</TR> <td class="colLast"><code>5</code></td>
<TR BGCOLOR="white" CLASS="TableRowColor"> </tr>
<A NAME="org.libjpegturbo.turbojpeg.TJ.SAMP_GRAY"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> <tr class="rowColor">
<CODE>public&nbsp;static&nbsp;final&nbsp;int</CODE></FONT></TD> <td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.SAMP_420">
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#SAMP_GRAY">SAMP_GRAY</A></CODE></TD> <!-- -->
<TD ALIGN="right"><CODE>3</CODE></TD> </a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
</TR> <td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#SAMP_420">SAMP_420</a></code></td>
</FONT></TD> <td class="colLast"><code>2</code></td>
</TR> </tr>
</TABLE> <tr class="altColor">
<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.SAMP_422">
<P> <!-- -->
</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<P> <td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#SAMP_422">SAMP_422</a></code></td>
<td class="colLast"><code>1</code></td>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> </tr>
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <tr class="rowColor">
<TH ALIGN="left" COLSPAN="3">org.libjpegturbo.turbojpeg.<A HREF="org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</A></TH> <td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.SAMP_440">
</TR> <!-- -->
<TR BGCOLOR="white" CLASS="TableRowColor"> </a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<A NAME="org.libjpegturbo.turbojpeg.TJTransform.NUMOP"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> <td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#SAMP_440">SAMP_440</a></code></td>
<CODE>public&nbsp;static&nbsp;final&nbsp;int</CODE></FONT></TD> <td class="colLast"><code>4</code></td>
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJTransform.html#NUMOP">NUMOP</A></CODE></TD> </tr>
<TD ALIGN="right"><CODE>8</CODE></TD> <tr class="altColor">
</TR> <td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.SAMP_444">
<TR BGCOLOR="white" CLASS="TableRowColor"> <!-- -->
<A NAME="org.libjpegturbo.turbojpeg.TJTransform.OP_HFLIP"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> </a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<CODE>public&nbsp;static&nbsp;final&nbsp;int</CODE></FONT></TD> <td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#SAMP_444">SAMP_444</a></code></td>
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJTransform.html#OP_HFLIP">OP_HFLIP</A></CODE></TD> <td class="colLast"><code>0</code></td>
<TD ALIGN="right"><CODE>1</CODE></TD> </tr>
</TR> <tr class="rowColor">
<TR BGCOLOR="white" CLASS="TableRowColor"> <td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.SAMP_GRAY">
<A NAME="org.libjpegturbo.turbojpeg.TJTransform.OP_NONE"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> <!-- -->
<CODE>public&nbsp;static&nbsp;final&nbsp;int</CODE></FONT></TD> </a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJTransform.html#OP_NONE">OP_NONE</A></CODE></TD> <td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#SAMP_GRAY">SAMP_GRAY</a></code></td>
<TD ALIGN="right"><CODE>0</CODE></TD> <td class="colLast"><code>3</code></td>
</TR> </tr>
<TR BGCOLOR="white" CLASS="TableRowColor"> </tbody>
<A NAME="org.libjpegturbo.turbojpeg.TJTransform.OP_ROT180"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> </table>
<CODE>public&nbsp;static&nbsp;final&nbsp;int</CODE></FONT></TD> </li>
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJTransform.html#OP_ROT180">OP_ROT180</A></CODE></TD> <li class="blockList">
<TD ALIGN="right"><CODE>6</CODE></TD> <table border="0" cellpadding="3" cellspacing="0" summary="Constant Field Values table, listing constant fields, and values">
</TR> <caption><span>org.libjpegturbo.turbojpeg.<a href="org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</a></span><span class="tabEnd">&nbsp;</span></caption>
<TR BGCOLOR="white" CLASS="TableRowColor"> <tr>
<A NAME="org.libjpegturbo.turbojpeg.TJTransform.OP_ROT270"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> <th class="colFirst" scope="col">Modifier and Type</th>
<CODE>public&nbsp;static&nbsp;final&nbsp;int</CODE></FONT></TD> <th scope="col">Constant Field</th>
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJTransform.html#OP_ROT270">OP_ROT270</A></CODE></TD> <th class="colLast" scope="col">Value</th>
<TD ALIGN="right"><CODE>7</CODE></TD> </tr>
</TR> <tbody>
<TR BGCOLOR="white" CLASS="TableRowColor"> <tr class="altColor">
<A NAME="org.libjpegturbo.turbojpeg.TJTransform.OP_ROT90"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> <td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJTransform.NUMOP">
<CODE>public&nbsp;static&nbsp;final&nbsp;int</CODE></FONT></TD> <!-- -->
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJTransform.html#OP_ROT90">OP_ROT90</A></CODE></TD> </a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<TD ALIGN="right"><CODE>5</CODE></TD> <td><code><a href="org/libjpegturbo/turbojpeg/TJTransform.html#NUMOP">NUMOP</a></code></td>
</TR> <td class="colLast"><code>8</code></td>
<TR BGCOLOR="white" CLASS="TableRowColor"> </tr>
<A NAME="org.libjpegturbo.turbojpeg.TJTransform.OP_TRANSPOSE"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> <tr class="rowColor">
<CODE>public&nbsp;static&nbsp;final&nbsp;int</CODE></FONT></TD> <td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJTransform.OP_HFLIP">
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJTransform.html#OP_TRANSPOSE">OP_TRANSPOSE</A></CODE></TD> <!-- -->
<TD ALIGN="right"><CODE>3</CODE></TD> </a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
</TR> <td><code><a href="org/libjpegturbo/turbojpeg/TJTransform.html#OP_HFLIP">OP_HFLIP</a></code></td>
<TR BGCOLOR="white" CLASS="TableRowColor"> <td class="colLast"><code>1</code></td>
<A NAME="org.libjpegturbo.turbojpeg.TJTransform.OP_TRANSVERSE"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> </tr>
<CODE>public&nbsp;static&nbsp;final&nbsp;int</CODE></FONT></TD> <tr class="altColor">
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJTransform.html#OP_TRANSVERSE">OP_TRANSVERSE</A></CODE></TD> <td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJTransform.OP_NONE">
<TD ALIGN="right"><CODE>4</CODE></TD> <!-- -->
</TR> </a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<TR BGCOLOR="white" CLASS="TableRowColor"> <td><code><a href="org/libjpegturbo/turbojpeg/TJTransform.html#OP_NONE">OP_NONE</a></code></td>
<A NAME="org.libjpegturbo.turbojpeg.TJTransform.OP_VFLIP"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> <td class="colLast"><code>0</code></td>
<CODE>public&nbsp;static&nbsp;final&nbsp;int</CODE></FONT></TD> </tr>
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJTransform.html#OP_VFLIP">OP_VFLIP</A></CODE></TD> <tr class="rowColor">
<TD ALIGN="right"><CODE>2</CODE></TD> <td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJTransform.OP_ROT180">
</TR> <!-- -->
<TR BGCOLOR="white" CLASS="TableRowColor"> </a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<A NAME="org.libjpegturbo.turbojpeg.TJTransform.OPT_CROP"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> <td><code><a href="org/libjpegturbo/turbojpeg/TJTransform.html#OP_ROT180">OP_ROT180</a></code></td>
<CODE>public&nbsp;static&nbsp;final&nbsp;int</CODE></FONT></TD> <td class="colLast"><code>6</code></td>
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJTransform.html#OPT_CROP">OPT_CROP</A></CODE></TD> </tr>
<TD ALIGN="right"><CODE>4</CODE></TD> <tr class="altColor">
</TR> <td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJTransform.OP_ROT270">
<TR BGCOLOR="white" CLASS="TableRowColor"> <!-- -->
<A NAME="org.libjpegturbo.turbojpeg.TJTransform.OPT_GRAY"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> </a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<CODE>public&nbsp;static&nbsp;final&nbsp;int</CODE></FONT></TD> <td><code><a href="org/libjpegturbo/turbojpeg/TJTransform.html#OP_ROT270">OP_ROT270</a></code></td>
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJTransform.html#OPT_GRAY">OPT_GRAY</A></CODE></TD> <td class="colLast"><code>7</code></td>
<TD ALIGN="right"><CODE>8</CODE></TD> </tr>
</TR> <tr class="rowColor">
<TR BGCOLOR="white" CLASS="TableRowColor"> <td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJTransform.OP_ROT90">
<A NAME="org.libjpegturbo.turbojpeg.TJTransform.OPT_NOOUTPUT"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> <!-- -->
<CODE>public&nbsp;static&nbsp;final&nbsp;int</CODE></FONT></TD> </a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJTransform.html#OPT_NOOUTPUT">OPT_NOOUTPUT</A></CODE></TD> <td><code><a href="org/libjpegturbo/turbojpeg/TJTransform.html#OP_ROT90">OP_ROT90</a></code></td>
<TD ALIGN="right"><CODE>16</CODE></TD> <td class="colLast"><code>5</code></td>
</TR> </tr>
<TR BGCOLOR="white" CLASS="TableRowColor"> <tr class="altColor">
<A NAME="org.libjpegturbo.turbojpeg.TJTransform.OPT_PERFECT"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> <td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJTransform.OP_TRANSPOSE">
<CODE>public&nbsp;static&nbsp;final&nbsp;int</CODE></FONT></TD> <!-- -->
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJTransform.html#OPT_PERFECT">OPT_PERFECT</A></CODE></TD> </a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<TD ALIGN="right"><CODE>1</CODE></TD> <td><code><a href="org/libjpegturbo/turbojpeg/TJTransform.html#OP_TRANSPOSE">OP_TRANSPOSE</a></code></td>
</TR> <td class="colLast"><code>3</code></td>
<TR BGCOLOR="white" CLASS="TableRowColor"> </tr>
<A NAME="org.libjpegturbo.turbojpeg.TJTransform.OPT_TRIM"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1"> <tr class="rowColor">
<CODE>public&nbsp;static&nbsp;final&nbsp;int</CODE></FONT></TD> <td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJTransform.OP_TRANSVERSE">
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJTransform.html#OPT_TRIM">OPT_TRIM</A></CODE></TD> <!-- -->
<TD ALIGN="right"><CODE>2</CODE></TD> </a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
</TR> <td><code><a href="org/libjpegturbo/turbojpeg/TJTransform.html#OP_TRANSVERSE">OP_TRANSVERSE</a></code></td>
</FONT></TD> <td class="colLast"><code>4</code></td>
</TR> </tr>
</TABLE> <tr class="altColor">
<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJTransform.OP_VFLIP">
<P> <!-- -->
</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<P> <td><code><a href="org/libjpegturbo/turbojpeg/TJTransform.html#OP_VFLIP">OP_VFLIP</a></code></td>
<HR> <td class="colLast"><code>2</code></td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJTransform.OPT_CROP">
<!-- -->
</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<td><code><a href="org/libjpegturbo/turbojpeg/TJTransform.html#OPT_CROP">OPT_CROP</a></code></td>
<td class="colLast"><code>4</code></td>
</tr>
<tr class="altColor">
<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJTransform.OPT_GRAY">
<!-- -->
</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<td><code><a href="org/libjpegturbo/turbojpeg/TJTransform.html#OPT_GRAY">OPT_GRAY</a></code></td>
<td class="colLast"><code>8</code></td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJTransform.OPT_NOOUTPUT">
<!-- -->
</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<td><code><a href="org/libjpegturbo/turbojpeg/TJTransform.html#OPT_NOOUTPUT">OPT_NOOUTPUT</a></code></td>
<td class="colLast"><code>16</code></td>
</tr>
<tr class="altColor">
<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJTransform.OPT_PERFECT">
<!-- -->
</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<td><code><a href="org/libjpegturbo/turbojpeg/TJTransform.html#OPT_PERFECT">OPT_PERFECT</a></code></td>
<td class="colLast"><code>1</code></td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJTransform.OPT_TRIM">
<!-- -->
</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<td><code><a href="org/libjpegturbo/turbojpeg/TJTransform.html#OPT_TRIM">OPT_TRIM</a></code></td>
<td class="colLast"><code>2</code></td>
</tr>
</tbody>
</table>
</li>
</ul>
</div>
<!-- ======= START OF BOTTOM NAVBAR ====== --> <!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A> <div class="bottomNav"><a name="navbar_bottom">
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <!-- -->
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<TR> <!-- -->
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> </a>
<A NAME="navbar_bottom_firstrow"><!-- --></A> <ul class="navList" title="Navigation">
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <li><a href="org/libjpegturbo/turbojpeg/package-summary.html">Package</a></li>
<TR ALIGN="center" VALIGN="top"> <li>Class</li>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="org/libjpegturbo/turbojpeg/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <li><a href="org/libjpegturbo/turbojpeg/package-tree.html">Tree</a></li>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT>&nbsp;</TD> <li><a href="deprecated-list.html">Deprecated</a></li>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="org/libjpegturbo/turbojpeg/package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <li><a href="index-all.html">Index</a></li>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <li><a href="help-doc.html">Help</a></li>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> </ul>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </div>
</TR> <div class="subNav">
</TABLE> <ul class="navList">
</TD> <li>Prev</li>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> <li>Next</li>
</EM> </ul>
</TD> <ul class="navList">
</TR> <li><a href="index.html?constant-values.html" target="_top">Frames</a></li>
<li><a href="constant-values.html" target="_top">No Frames</a></li>
<TR> </ul>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <ul class="navList" id="allclasses_navbar_bottom">
&nbsp;PREV&nbsp; <li><a href="allclasses-noframe.html">All Classes</a></li>
&nbsp;NEXT</FONT></TD> </ul>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <div>
<A HREF="index.html?constant-values.html" target="_top"><B>FRAMES</B></A> &nbsp; <script type="text/javascript"><!--
&nbsp;<A HREF="constant-values.html" target="_top"><B>NO FRAMES</B></A> &nbsp; allClassesLink = document.getElementById("allclasses_navbar_bottom");
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) { if(window==top) {
document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>'); allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
} }
//--> //-->
</SCRIPT> </script>
<NOSCRIPT> </div>
<A HREF="allclasses-noframe.html"><B>All Classes</B></A> <a name="skip-navbar_bottom">
</NOSCRIPT> <!-- -->
</a></div>
</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= --> <!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
<HR> </html>
</BODY>
</HTML>

View File

@@ -1,208 +1,258 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage --> <!-- NewPage -->
<HTML> <html lang="en">
<HEAD> <head>
<TITLE> <title>Deprecated List</title>
Deprecated List <link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
</TITLE> </head>
<body>
<script type="text/javascript"><!--
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) { if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Deprecated List"; parent.document.title="Deprecated List";
} }
} //-->
</SCRIPT> </script>
<NOSCRIPT> <noscript>
</NOSCRIPT> <div>JavaScript is disabled on your browser.</div>
</noscript>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ========= START OF TOP NAVBAR ======= --> <!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A> <div class="topNav"><a name="navbar_top">
<A HREF="#skip-navbar_top" title="Skip navigation links"></A> <!-- -->
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<TR> <!-- -->
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> </a>
<A NAME="navbar_top_firstrow"><!-- --></A> <ul class="navList" title="Navigation">
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <li><a href="org/libjpegturbo/turbojpeg/package-summary.html">Package</a></li>
<TR ALIGN="center" VALIGN="top"> <li>Class</li>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="org/libjpegturbo/turbojpeg/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <li><a href="org/libjpegturbo/turbojpeg/package-tree.html">Tree</a></li>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT>&nbsp;</TD> <li class="navBarCell1Rev">Deprecated</li>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="org/libjpegturbo/turbojpeg/package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <li><a href="index-all.html">Index</a></li>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Deprecated</B></FONT>&nbsp;</TD> <li><a href="help-doc.html">Help</a></li>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> </ul>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </div>
</TR> <div class="subNav">
</TABLE> <ul class="navList">
</TD> <li>Prev</li>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> <li>Next</li>
</EM> </ul>
</TD> <ul class="navList">
</TR> <li><a href="index.html?deprecated-list.html" target="_top">Frames</a></li>
<li><a href="deprecated-list.html" target="_top">No Frames</a></li>
<TR> </ul>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <ul class="navList" id="allclasses_navbar_top">
&nbsp;PREV&nbsp; <li><a href="allclasses-noframe.html">All Classes</a></li>
&nbsp;NEXT</FONT></TD> </ul>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <div>
<A HREF="index.html?deprecated-list.html" target="_top"><B>FRAMES</B></A> &nbsp; <script type="text/javascript"><!--
&nbsp;<A HREF="deprecated-list.html" target="_top"><B>NO FRAMES</B></A> &nbsp; allClassesLink = document.getElementById("allclasses_navbar_top");
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) { if(window==top) {
document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>'); allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
} }
//--> //-->
</SCRIPT> </script>
<NOSCRIPT> </div>
<A HREF="allclasses-noframe.html"><B>All Classes</B></A> <a name="skip-navbar_top">
</NOSCRIPT> <!-- -->
</a></div>
</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= --> <!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<HR> <h1 title="Deprecated API" class="title">Deprecated API</h1>
<CENTER> <h2 title="Contents">Contents</h2>
<H2> <ul>
<B>Deprecated API</B></H2> <li><a href="#field">Deprecated Fields</a></li>
</CENTER> <li><a href="#method">Deprecated Methods</a></li>
<HR SIZE="4" NOSHADE> <li><a href="#constructor">Deprecated Constructors</a></li>
<B>Contents</B><UL> </ul>
<LI><A HREF="#field">Deprecated Fields</A> </div>
<LI><A HREF="#method">Deprecated Methods</A> <div class="contentContainer"><a name="field">
</UL> <!-- -->
</a>
<A NAME="field"><!-- --></A> <ul class="blockList">
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <li class="blockList">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <table border="0" cellpadding="3" cellspacing="0" summary="Deprecated Fields table, listing deprecated fields, and an explanation">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <caption><span>Deprecated Fields</span><span class="tabEnd">&nbsp;</span></caption>
<B>Deprecated Fields</B></FONT></TH> <tr>
</TR> <th class="colOne" scope="col">Field and Description</th>
<TR BGCOLOR="white" CLASS="TableRowColor"> </tr>
<TD><A HREF="org/libjpegturbo/turbojpeg/TJ.html#FLAG_FORCEMMX">org.libjpegturbo.turbojpeg.TJ.FLAG_FORCEMMX</A> <tbody>
<BR> <tr class="altColor">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> <td class="colOne"><a href="org/libjpegturbo/turbojpeg/TJ.html#FLAG_FORCEMMX">org.libjpegturbo.turbojpeg.TJ.FLAG_FORCEMMX</a></td>
</TR> </tr>
<TR BGCOLOR="white" CLASS="TableRowColor"> <tr class="rowColor">
<TD><A HREF="org/libjpegturbo/turbojpeg/TJ.html#FLAG_FORCESSE">org.libjpegturbo.turbojpeg.TJ.FLAG_FORCESSE</A> <td class="colOne"><a href="org/libjpegturbo/turbojpeg/TJ.html#FLAG_FORCESSE">org.libjpegturbo.turbojpeg.TJ.FLAG_FORCESSE</a></td>
<BR> </tr>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> <tr class="altColor">
</TR> <td class="colOne"><a href="org/libjpegturbo/turbojpeg/TJ.html#FLAG_FORCESSE2">org.libjpegturbo.turbojpeg.TJ.FLAG_FORCESSE2</a></td>
<TR BGCOLOR="white" CLASS="TableRowColor"> </tr>
<TD><A HREF="org/libjpegturbo/turbojpeg/TJ.html#FLAG_FORCESSE2">org.libjpegturbo.turbojpeg.TJ.FLAG_FORCESSE2</A> <tr class="rowColor">
<BR> <td class="colOne"><a href="org/libjpegturbo/turbojpeg/TJ.html#FLAG_FORCESSE3">org.libjpegturbo.turbojpeg.TJ.FLAG_FORCESSE3</a></td>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </tr>
</TR> </tbody>
<TR BGCOLOR="white" CLASS="TableRowColor"> </table>
<TD><A HREF="org/libjpegturbo/turbojpeg/TJ.html#FLAG_FORCESSE3">org.libjpegturbo.turbojpeg.TJ.FLAG_FORCESSE3</A> </li>
<BR> </ul>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> <a name="method">
</TR> <!-- -->
</TABLE> </a>
&nbsp; <ul class="blockList">
<P> <li class="blockList">
<A NAME="method"><!-- --></A> <table border="0" cellpadding="3" cellspacing="0" summary="Deprecated Methods table, listing deprecated methods, and an explanation">
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <caption><span>Deprecated Methods</span><span class="tabEnd">&nbsp;</span></caption>
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <tr>
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <th class="colOne" scope="col">Method and Description</th>
<B>Deprecated Methods</B></FONT></TH> </tr>
</TR> <tbody>
<TR BGCOLOR="white" CLASS="TableRowColor"> <tr class="altColor">
<TD><A HREF="org/libjpegturbo/turbojpeg/TJ.html#bufSizeYUV(int, int, int)">org.libjpegturbo.turbojpeg.TJ.bufSizeYUV(int, int, int)</A> <td class="colOne"><a href="org/libjpegturbo/turbojpeg/TJ.html#bufSizeYUV(int, int, int)">org.libjpegturbo.turbojpeg.TJ.bufSizeYUV(int, int, int)</a>
<BR> <div class="block"><i>Use <a href="org/libjpegturbo/turbojpeg/TJ.html#bufSizeYUV(int, int, int, int)"><code>TJ.bufSizeYUV(int, int, int, int)</code></a> instead.</i></div>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<I>Use <A HREF="org/libjpegturbo/turbojpeg/TJ.html#bufSizeYUV(int, int, int, int)"><CODE>TJ.bufSizeYUV(int, int, int, int)</CODE></A> instead.</I>&nbsp;</TD> </td>
</TR> </tr>
<TR BGCOLOR="white" CLASS="TableRowColor"> <tr class="rowColor">
<TD><A HREF="org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[], int, int, int, int, int)">org.libjpegturbo.turbojpeg.TJDecompressor.decompress(byte[], int, int, int, int, int)</A> <td class="colOne"><a href="org/libjpegturbo/turbojpeg/TJCompressor.html#compress(java.awt.image.BufferedImage, byte[], int)">org.libjpegturbo.turbojpeg.TJCompressor.compress(BufferedImage, byte[], int)</a>
<BR> <div class="block"><i>Use
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<I>Use <a href="org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage, int, int, int, int)"><code>TJCompressor.setSourceImage(BufferedImage, int, int, int, int)</code></a> and
<A HREF="org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[], int, int, int, int, int, int, int)"><CODE>TJDecompressor.decompress(byte[], int, int, int, int, int, int, int)</CODE></A> instead.</I>&nbsp;</TD> <a href="org/libjpegturbo/turbojpeg/TJCompressor.html#compress(byte[], int)"><code>TJCompressor.compress(byte[], int)</code></a> instead.</i></div>
</TR> </td>
<TR BGCOLOR="white" CLASS="TableRowColor"> </tr>
<TD><A HREF="org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(byte[], int)">org.libjpegturbo.turbojpeg.TJDecompressor.decompressToYUV(byte[], int)</A> <tr class="altColor">
<BR> <td class="colOne"><a href="org/libjpegturbo/turbojpeg/TJCompressor.html#compress(java.awt.image.BufferedImage, int)">org.libjpegturbo.turbojpeg.TJCompressor.compress(BufferedImage, int)</a>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<I>Use <A HREF="org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(byte[], int, int, int, int)"><CODE>TJDecompressor.decompressToYUV(byte[], int, int, int, int)</CODE></A> <div class="block"><i>Use
instead.</I>&nbsp;</TD> <a href="org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage, int, int, int, int)"><code>TJCompressor.setSourceImage(BufferedImage, int, int, int, int)</code></a> and
</TR> <a href="org/libjpegturbo/turbojpeg/TJCompressor.html#compress(int)"><code>TJCompressor.compress(int)</code></a> instead.</i></div>
<TR BGCOLOR="white" CLASS="TableRowColor"> </td>
<TD><A HREF="org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(int)">org.libjpegturbo.turbojpeg.TJDecompressor.decompressToYUV(int)</A> </tr>
<BR> <tr class="rowColor">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<I>Use <A HREF="org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(int, int, int, int)"><CODE>TJDecompressor.decompressToYUV(int, int, int, int)</CODE></A> instead.</I>&nbsp;</TD> <td class="colOne"><a href="org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[], int, int, int, int, int)">org.libjpegturbo.turbojpeg.TJDecompressor.decompress(byte[], int, int, int, int, int)</a>
</TR> <div class="block"><i>Use
<TR BGCOLOR="white" CLASS="TableRowColor"> <a href="org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[], int, int, int, int, int, int, int)"><code>TJDecompressor.decompress(byte[], int, int, int, int, int, int, int)</code></a> instead.</i></div>
<TD><A HREF="org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[], int, int, int, int)">org.libjpegturbo.turbojpeg.TJCompressor.setSourceImage(byte[], int, int, int, int)</A> </td>
<BR> </tr>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<I>Use <tr class="altColor">
<A HREF="org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[], int, int, int, int, int, int)"><CODE>TJCompressor.setSourceImage(byte[], int, int, int, int, int, int)</CODE></A> instead.</I>&nbsp;</TD> <td class="colOne"><a href="org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(byte[], int)">org.libjpegturbo.turbojpeg.TJDecompressor.decompressToYUV(byte[], int)</a>
</TR> <div class="block"><i>Use <a href="org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(org.libjpegturbo.turbojpeg.YUVImage, int)"><code>TJDecompressor.decompressToYUV(YUVImage, int)</code></a> instead.</i></div>
</TABLE> </td>
&nbsp; </tr>
<P> <tr class="rowColor">
<HR> <td class="colOne"><a href="org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(int)">org.libjpegturbo.turbojpeg.TJDecompressor.decompressToYUV(int)</a>
<div class="block"><i>Use <a href="org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(int, int, int, int)"><code>TJDecompressor.decompressToYUV(int, int, int, int)</code></a> instead.</i></div>
</td>
</tr>
<tr class="altColor">
<td class="colOne"><a href="org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(java.awt.image.BufferedImage, byte[], int)">org.libjpegturbo.turbojpeg.TJCompressor.encodeYUV(BufferedImage, byte[], int)</a>
<div class="block"><i>Use
<a href="org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage, int, int, int, int)"><code>TJCompressor.setSourceImage(BufferedImage, int, int, int, int)</code></a> and
<a href="org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(byte[], int)"><code>TJCompressor.encodeYUV(byte[], int)</code></a> instead.</i></div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><a href="org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(java.awt.image.BufferedImage, int)">org.libjpegturbo.turbojpeg.TJCompressor.encodeYUV(BufferedImage, int)</a>
<div class="block"><i>Use
<a href="org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage, int, int, int, int)"><code>TJCompressor.setSourceImage(BufferedImage, int, int, int, int)</code></a> and
<a href="org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(int)"><code>TJCompressor.encodeYUV(int)</code></a> instead.</i></div>
</td>
</tr>
<tr class="altColor">
<td class="colOne"><a href="org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(byte[], int)">org.libjpegturbo.turbojpeg.TJCompressor.encodeYUV(byte[], int)</a>
<div class="block"><i>Use <a href="org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(org.libjpegturbo.turbojpeg.YUVImage, int)"><code>TJCompressor.encodeYUV(YUVImage, int)</code></a> instead.</i></div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><a href="org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(int)">org.libjpegturbo.turbojpeg.TJCompressor.encodeYUV(int)</a>
<div class="block"><i>Use <a href="org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(int, int)"><code>TJCompressor.encodeYUV(int, int)</code></a> instead.</i></div>
</td>
</tr>
<tr class="altColor">
<td class="colOne"><a href="org/libjpegturbo/turbojpeg/TJDecompressor.html#getJPEGBuf()">org.libjpegturbo.turbojpeg.TJDecompressor.getJPEGBuf()</a>
<div class="block"><i>Use <a href="org/libjpegturbo/turbojpeg/TJDecompressor.html#getSourceBuf()"><code>TJDecompressor.getSourceBuf()</code></a> instead.</i></div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><a href="org/libjpegturbo/turbojpeg/TJDecompressor.html#getJPEGSize()">org.libjpegturbo.turbojpeg.TJDecompressor.getJPEGSize()</a>
<div class="block"><i>Use <a href="org/libjpegturbo/turbojpeg/TJDecompressor.html#getSourceSize()"><code>TJDecompressor.getSourceSize()</code></a> instead.</i></div>
</td>
</tr>
<tr class="altColor">
<td class="colOne"><a href="org/libjpegturbo/turbojpeg/TJDecompressor.html#setJPEGImage(byte[], int)">org.libjpegturbo.turbojpeg.TJDecompressor.setJPEGImage(byte[], int)</a>
<div class="block"><i>Use <a href="org/libjpegturbo/turbojpeg/TJDecompressor.html#setSourceImage(byte[], int)"><code>TJDecompressor.setSourceImage(byte[], int)</code></a> instead.</i></div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><a href="org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[], int, int, int, int)">org.libjpegturbo.turbojpeg.TJCompressor.setSourceImage(byte[], int, int, int, int)</a>
<div class="block"><i>Use
<a href="org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[], int, int, int, int, int, int)"><code>TJCompressor.setSourceImage(byte[], int, int, int, int, int, int)</code></a> instead.</i></div>
</td>
</tr>
</tbody>
</table>
</li>
</ul>
<a name="constructor">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<table border="0" cellpadding="3" cellspacing="0" summary="Deprecated Constructors table, listing deprecated constructors, and an explanation">
<caption><span>Deprecated Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colOne"><a href="org/libjpegturbo/turbojpeg/TJCompressor.html#TJCompressor(byte[], int, int, int, int)">org.libjpegturbo.turbojpeg.TJCompressor(byte[], int, int, int, int)</a>
<div class="block"><i>Use
<a href="org/libjpegturbo/turbojpeg/TJCompressor.html#TJCompressor(byte[], int, int, int, int, int, int)"><code>TJCompressor.TJCompressor(byte[], int, int, int, int, int, int)</code></a> instead.</i></div>
</td>
</tr>
</tbody>
</table>
</li>
</ul>
</div>
<!-- ======= START OF BOTTOM NAVBAR ====== --> <!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A> <div class="bottomNav"><a name="navbar_bottom">
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <!-- -->
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<TR> <!-- -->
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> </a>
<A NAME="navbar_bottom_firstrow"><!-- --></A> <ul class="navList" title="Navigation">
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <li><a href="org/libjpegturbo/turbojpeg/package-summary.html">Package</a></li>
<TR ALIGN="center" VALIGN="top"> <li>Class</li>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="org/libjpegturbo/turbojpeg/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <li><a href="org/libjpegturbo/turbojpeg/package-tree.html">Tree</a></li>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT>&nbsp;</TD> <li class="navBarCell1Rev">Deprecated</li>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="org/libjpegturbo/turbojpeg/package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <li><a href="index-all.html">Index</a></li>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Deprecated</B></FONT>&nbsp;</TD> <li><a href="help-doc.html">Help</a></li>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> </ul>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </div>
</TR> <div class="subNav">
</TABLE> <ul class="navList">
</TD> <li>Prev</li>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> <li>Next</li>
</EM> </ul>
</TD> <ul class="navList">
</TR> <li><a href="index.html?deprecated-list.html" target="_top">Frames</a></li>
<li><a href="deprecated-list.html" target="_top">No Frames</a></li>
<TR> </ul>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <ul class="navList" id="allclasses_navbar_bottom">
&nbsp;PREV&nbsp; <li><a href="allclasses-noframe.html">All Classes</a></li>
&nbsp;NEXT</FONT></TD> </ul>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <div>
<A HREF="index.html?deprecated-list.html" target="_top"><B>FRAMES</B></A> &nbsp; <script type="text/javascript"><!--
&nbsp;<A HREF="deprecated-list.html" target="_top"><B>NO FRAMES</B></A> &nbsp; allClassesLink = document.getElementById("allclasses_navbar_bottom");
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) { if(window==top) {
document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>'); allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
} }
//--> //-->
</SCRIPT> </script>
<NOSCRIPT> </div>
<A HREF="allclasses-noframe.html"><B>All Classes</B></A> <a name="skip-navbar_bottom">
</NOSCRIPT> <!-- -->
</a></div>
</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= --> <!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
<HR> </html>
</BODY>
</HTML>

View File

@@ -1,207 +1,206 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage --> <!-- NewPage -->
<HTML> <html lang="en">
<HEAD> <head>
<TITLE> <title>API Help</title>
API Help <link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
</TITLE> </head>
<body>
<script type="text/javascript"><!--
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) { if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="API Help"; parent.document.title="API Help";
} }
} //-->
</SCRIPT> </script>
<NOSCRIPT> <noscript>
</NOSCRIPT> <div>JavaScript is disabled on your browser.</div>
</noscript>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ========= START OF TOP NAVBAR ======= --> <!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A> <div class="topNav"><a name="navbar_top">
<A HREF="#skip-navbar_top" title="Skip navigation links"></A> <!-- -->
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<TR> <!-- -->
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> </a>
<A NAME="navbar_top_firstrow"><!-- --></A> <ul class="navList" title="Navigation">
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <li><a href="org/libjpegturbo/turbojpeg/package-summary.html">Package</a></li>
<TR ALIGN="center" VALIGN="top"> <li>Class</li>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="org/libjpegturbo/turbojpeg/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <li><a href="org/libjpegturbo/turbojpeg/package-tree.html">Tree</a></li>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT>&nbsp;</TD> <li><a href="deprecated-list.html">Deprecated</a></li>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="org/libjpegturbo/turbojpeg/package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <li><a href="index-all.html">Index</a></li>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <li class="navBarCell1Rev">Help</li>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> </ul>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Help</B></FONT>&nbsp;</TD> </div>
</TR> <div class="subNav">
</TABLE> <ul class="navList">
</TD> <li>Prev</li>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> <li>Next</li>
</EM> </ul>
</TD> <ul class="navList">
</TR> <li><a href="index.html?help-doc.html" target="_top">Frames</a></li>
<li><a href="help-doc.html" target="_top">No Frames</a></li>
<TR> </ul>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <ul class="navList" id="allclasses_navbar_top">
&nbsp;PREV&nbsp; <li><a href="allclasses-noframe.html">All Classes</a></li>
&nbsp;NEXT</FONT></TD> </ul>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <div>
<A HREF="index.html?help-doc.html" target="_top"><B>FRAMES</B></A> &nbsp; <script type="text/javascript"><!--
&nbsp;<A HREF="help-doc.html" target="_top"><B>NO FRAMES</B></A> &nbsp; allClassesLink = document.getElementById("allclasses_navbar_top");
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) { if(window==top) {
document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>'); allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
} }
//--> //-->
</SCRIPT> </script>
<NOSCRIPT> </div>
<A HREF="allclasses-noframe.html"><B>All Classes</B></A> <a name="skip-navbar_top">
</NOSCRIPT> <!-- -->
</a></div>
</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= --> <!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<HR> <h1 class="title">How This API Document Is Organized</h1>
<CENTER> <div class="subTitle">This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows.</div>
<H1> </div>
How This API Document Is Organized</H1> <div class="contentContainer">
</CENTER> <ul class="blockList">
This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows.<H3> <li class="blockList">
Package</H3> <h2>Package</h2>
<BLOCKQUOTE> <p>Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain six categories:</p>
<ul>
<P> <li>Interfaces (italic)</li>
Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain four categories:<UL> <li>Classes</li>
<LI>Interfaces (italic)<LI>Classes<LI>Enums<LI>Exceptions<LI>Errors<LI>Annotation Types</UL> <li>Enums</li>
</BLOCKQUOTE> <li>Exceptions</li>
<H3> <li>Errors</li>
Class/Interface</H3> <li>Annotation Types</li>
<BLOCKQUOTE> </ul>
</li>
<P> <li class="blockList">
Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions:<UL> <h2>Class/Interface</h2>
<LI>Class inheritance diagram<LI>Direct Subclasses<LI>All Known Subinterfaces<LI>All Known Implementing Classes<LI>Class/interface declaration<LI>Class/interface description <p>Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions:</p>
<P> <ul>
<LI>Nested Class Summary<LI>Field Summary<LI>Constructor Summary<LI>Method Summary <li>Class inheritance diagram</li>
<P> <li>Direct Subclasses</li>
<LI>Field Detail<LI>Constructor Detail<LI>Method Detail</UL> <li>All Known Subinterfaces</li>
Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.</BLOCKQUOTE> <li>All Known Implementing Classes</li>
</BLOCKQUOTE> <li>Class/interface declaration</li>
<H3> <li>Class/interface description</li>
Annotation Type</H3> </ul>
<BLOCKQUOTE> <ul>
<li>Nested Class Summary</li>
<P> <li>Field Summary</li>
Each annotation type has its own separate page with the following sections:<UL> <li>Constructor Summary</li>
<LI>Annotation Type declaration<LI>Annotation Type description<LI>Required Element Summary<LI>Optional Element Summary<LI>Element Detail</UL> <li>Method Summary</li>
</BLOCKQUOTE> </ul>
</BLOCKQUOTE> <ul>
<H3> <li>Field Detail</li>
Enum</H3> <li>Constructor Detail</li>
<BLOCKQUOTE> <li>Method Detail</li>
</ul>
<P> <p>Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.</p>
Each enum has its own separate page with the following sections:<UL> </li>
<LI>Enum declaration<LI>Enum description<LI>Enum Constant Summary<LI>Enum Constant Detail</UL> <li class="blockList">
</BLOCKQUOTE> <h2>Annotation Type</h2>
<H3> <p>Each annotation type has its own separate page with the following sections:</p>
Tree (Class Hierarchy)</H3> <ul>
<BLOCKQUOTE> <li>Annotation Type declaration</li>
There is a <A HREF="overview-tree.html">Class Hierarchy</A> page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. The classes are organized by inheritance structure starting with <code>java.lang.Object</code>. The interfaces do not inherit from <code>java.lang.Object</code>.<UL> <li>Annotation Type description</li>
<LI>When viewing the Overview page, clicking on "Tree" displays the hierarchy for all packages.<LI>When viewing a particular package, class or interface page, clicking "Tree" displays the hierarchy for only that package.</UL> <li>Required Element Summary</li>
</BLOCKQUOTE> <li>Optional Element Summary</li>
<H3> <li>Element Detail</li>
Deprecated API</H3> </ul>
<BLOCKQUOTE> </li>
The <A HREF="deprecated-list.html">Deprecated API</A> page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to improvements, and a replacement API is usually given. Deprecated APIs may be removed in future implementations.</BLOCKQUOTE> <li class="blockList">
<H3> <h2>Enum</h2>
Index</H3> <p>Each enum has its own separate page with the following sections:</p>
<BLOCKQUOTE> <ul>
The <A HREF="index-all.html">Index</A> contains an alphabetic list of all classes, interfaces, constructors, methods, and fields.</BLOCKQUOTE> <li>Enum declaration</li>
<H3> <li>Enum description</li>
Prev/Next</H3> <li>Enum Constant Summary</li>
These links take you to the next or previous class, interface, package, or related page.<H3> <li>Enum Constant Detail</li>
Frames/No Frames</H3> </ul>
These links show and hide the HTML frames. All pages are available with or without frames. </li>
<P> <li class="blockList">
<H3> <h2>Tree (Class Hierarchy)</h2>
Serialized Form</H3> <p>There is a <a href="overview-tree.html">Class Hierarchy</a> page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. The classes are organized by inheritance structure starting with <code>java.lang.Object</code>. The interfaces do not inherit from <code>java.lang.Object</code>.</p>
Each serializable or externalizable class has a description of its serialization fields and methods. This information is of interest to re-implementors, not to developers using the API. While there is no link in the navigation bar, you can get to this information by going to any serialized class and clicking "Serialized Form" in the "See also" section of the class description. <ul>
<P> <li>When viewing the Overview page, clicking on "Tree" displays the hierarchy for all packages.</li>
<H3> <li>When viewing a particular package, class or interface page, clicking "Tree" displays the hierarchy for only that package.</li>
Constant Field Values</H3> </ul>
The <a href="constant-values.html">Constant Field Values</a> page lists the static final fields and their values. </li>
<P> <li class="blockList">
<FONT SIZE="-1"> <h2>Deprecated API</h2>
<EM> <p>The <a href="deprecated-list.html">Deprecated API</a> page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to improvements, and a replacement API is usually given. Deprecated APIs may be removed in future implementations.</p>
This help file applies to API documentation generated using the standard doclet.</EM> </li>
</FONT> <li class="blockList">
<BR> <h2>Index</h2>
<HR> <p>The <a href="index-all.html">Index</a> contains an alphabetic list of all classes, interfaces, constructors, methods, and fields.</p>
</li>
<li class="blockList">
<h2>Prev/Next</h2>
<p>These links take you to the next or previous class, interface, package, or related page.</p>
</li>
<li class="blockList">
<h2>Frames/No Frames</h2>
<p>These links show and hide the HTML frames. All pages are available with or without frames.</p>
</li>
<li class="blockList">
<h2>All Classes</h2>
<p>The <a href="allclasses-noframe.html">All Classes</a> link shows all classes and interfaces except non-static nested types.</p>
</li>
<li class="blockList">
<h2>Serialized Form</h2>
<p>Each serializable or externalizable class has a description of its serialization fields and methods. This information is of interest to re-implementors, not to developers using the API. While there is no link in the navigation bar, you can get to this information by going to any serialized class and clicking "Serialized Form" in the "See also" section of the class description.</p>
</li>
<li class="blockList">
<h2>Constant Field Values</h2>
<p>The <a href="constant-values.html">Constant Field Values</a> page lists the static final fields and their values.</p>
</li>
</ul>
<em>This help file applies to API documentation generated using the standard doclet.</em></div>
<!-- ======= START OF BOTTOM NAVBAR ====== --> <!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A> <div class="bottomNav"><a name="navbar_bottom">
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <!-- -->
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<TR> <!-- -->
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> </a>
<A NAME="navbar_bottom_firstrow"><!-- --></A> <ul class="navList" title="Navigation">
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <li><a href="org/libjpegturbo/turbojpeg/package-summary.html">Package</a></li>
<TR ALIGN="center" VALIGN="top"> <li>Class</li>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="org/libjpegturbo/turbojpeg/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <li><a href="org/libjpegturbo/turbojpeg/package-tree.html">Tree</a></li>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT>&nbsp;</TD> <li><a href="deprecated-list.html">Deprecated</a></li>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="org/libjpegturbo/turbojpeg/package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <li><a href="index-all.html">Index</a></li>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <li class="navBarCell1Rev">Help</li>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> </ul>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Help</B></FONT>&nbsp;</TD> </div>
</TR> <div class="subNav">
</TABLE> <ul class="navList">
</TD> <li>Prev</li>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> <li>Next</li>
</EM> </ul>
</TD> <ul class="navList">
</TR> <li><a href="index.html?help-doc.html" target="_top">Frames</a></li>
<li><a href="help-doc.html" target="_top">No Frames</a></li>
<TR> </ul>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <ul class="navList" id="allclasses_navbar_bottom">
&nbsp;PREV&nbsp; <li><a href="allclasses-noframe.html">All Classes</a></li>
&nbsp;NEXT</FONT></TD> </ul>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <div>
<A HREF="index.html?help-doc.html" target="_top"><B>FRAMES</B></A> &nbsp; <script type="text/javascript"><!--
&nbsp;<A HREF="help-doc.html" target="_top"><B>NO FRAMES</B></A> &nbsp; allClassesLink = document.getElementById("allclasses_navbar_bottom");
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) { if(window==top) {
document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>'); allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
} }
//--> //-->
</SCRIPT> </script>
<NOSCRIPT> </div>
<A HREF="allclasses-noframe.html"><B>All Classes</B></A> <a name="skip-navbar_bottom">
</NOSCRIPT> <!-- -->
</a></div>
</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= --> <!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
<HR> </html>
</BODY>
</HTML>

File diff suppressed because it is too large Load Diff

View File

@@ -1,11 +1,9 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
<!-- NewPage --> <!-- NewPage -->
<HTML> <html lang="en">
<HEAD> <head>
<TITLE> <title>Generated Documentation (Untitled)</title>
Generated Documentation (Untitled) <script type="text/javascript">
</TITLE>
<SCRIPT type="text/javascript">
targetPage = "" + window.location.search; targetPage = "" + window.location.search;
if (targetPage != "" && targetPage != "undefined") if (targetPage != "" && targetPage != "undefined")
targetPage = targetPage.substring(1); targetPage = targetPage.substring(1);
@@ -49,21 +47,17 @@ Generated Documentation (Untitled)
if (targetPage != "" && targetPage != "undefined") if (targetPage != "" && targetPage != "undefined")
top.classFrame.location = top.targetPage; top.classFrame.location = top.targetPage;
} }
</SCRIPT> </script>
<NOSCRIPT> </head>
</NOSCRIPT> <frameset cols="20%,80%" title="Documentation frame" onload="top.loadFrames()">
</HEAD> <frame src="allclasses-frame.html" name="packageFrame" title="All classes and interfaces (except non-static nested types)">
<FRAMESET cols="20%,80%" title="" onLoad="top.loadFrames()"> <frame src="org/libjpegturbo/turbojpeg/package-summary.html" name="classFrame" title="Package, class and interface descriptions" scrolling="yes">
<FRAME src="allclasses-frame.html" name="packageFrame" title="All classes and interfaces (except non-static nested types)"> <noframes>
<FRAME src="org/libjpegturbo/turbojpeg/package-summary.html" name="classFrame" title="Package, class and interface descriptions" scrolling="yes"> <noscript>
<NOFRAMES> <div>JavaScript is disabled on your browser.</div>
<H2> </noscript>
Frame Alert</H2> <h2>Frame Alert</h2>
<p>This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. Link to <a href="org/libjpegturbo/turbojpeg/package-summary.html">Non-frame version</a>.</p>
<P> </noframes>
This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. </frameset>
<BR> </html>
Link to<A HREF="org/libjpegturbo/turbojpeg/package-summary.html">Non-frame version.</A>
</NOFRAMES>
</FRAMESET>
</HTML>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,238 +1,237 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage --> <!-- NewPage -->
<HTML> <html lang="en">
<HEAD> <head>
<TITLE> <title>TJCustomFilter</title>
TJCustomFilter <link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
</TITLE> </head>
<body>
<script type="text/javascript"><!--
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) { if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="TJCustomFilter"; parent.document.title="TJCustomFilter";
} }
} //-->
</SCRIPT> </script>
<NOSCRIPT> <noscript>
</NOSCRIPT> <div>JavaScript is disabled on your browser.</div>
</noscript>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ========= START OF TOP NAVBAR ======= --> <!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A> <div class="topNav"><a name="navbar_top">
<A HREF="#skip-navbar_top" title="Skip navigation links"></A> <!-- -->
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<TR> <!-- -->
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> </a>
<A NAME="navbar_top_firstrow"><!-- --></A> <ul class="navList" title="Navigation">
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <li><a href="../../../org/libjpegturbo/turbojpeg/package-summary.html">Package</a></li>
<TR ALIGN="center" VALIGN="top"> <li class="navBarCell1Rev">Class</li>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../org/libjpegturbo/turbojpeg/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <li><a href="package-tree.html">Tree</a></li>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD> <li><a href="../../../deprecated-list.html">Deprecated</a></li>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <li><a href="../../../index-all.html">Index</a></li>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <li><a href="../../../help-doc.html">Help</a></li>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> </ul>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </div>
</TR> <div class="subNav">
</TABLE> <ul class="navList">
</TD> <li><a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">Prev Class</span></a></li>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> <li><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">Next Class</span></a></li>
</EM> </ul>
</TD> <ul class="navList">
</TR> <li><a href="../../../index.html?org/libjpegturbo/turbojpeg/TJCustomFilter.html" target="_top">Frames</a></li>
<li><a href="TJCustomFilter.html" target="_top">No Frames</a></li>
<TR> </ul>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <ul class="navList" id="allclasses_navbar_top">
&nbsp;<A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg"><B>PREV CLASS</B></A>&nbsp; <li><a href="../../../allclasses-noframe.html">All Classes</a></li>
&nbsp;<A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg"><B>NEXT CLASS</B></A></FONT></TD> </ul>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <div>
<A HREF="../../../index.html?org/libjpegturbo/turbojpeg/TJCustomFilter.html" target="_top"><B>FRAMES</B></A> &nbsp; <script type="text/javascript"><!--
&nbsp;<A HREF="TJCustomFilter.html" target="_top"><B>NO FRAMES</B></A> &nbsp; allClassesLink = document.getElementById("allclasses_navbar_top");
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) { if(window==top) {
document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
} }
//--> //-->
</SCRIPT> </script>
<NOSCRIPT> </div>
<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> <div>
</NOSCRIPT> <ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
</FONT></TD> <li>Field&nbsp;|&nbsp;</li>
</TR> <li>Constr&nbsp;|&nbsp;</li>
<TR> <li><a href="#method_summary">Method</a></li>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> </ul>
SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD> <ul class="subNavList">
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> <li>Detail:&nbsp;</li>
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD> <li>Field&nbsp;|&nbsp;</li>
</TR> <li>Constr&nbsp;|&nbsp;</li>
</TABLE> <li><a href="#method_detail">Method</a></li>
<A NAME="skip-navbar_top"></A> </ul>
</div>
<a name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= --> <!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<!-- ======== START OF CLASS DATA ======== --> <!-- ======== START OF CLASS DATA ======== -->
<H2> <div class="header">
<FONT SIZE="-1"> <div class="subTitle">org.libjpegturbo.turbojpeg</div>
org.libjpegturbo.turbojpeg</FONT> <h2 title="Interface TJCustomFilter" class="title">Interface TJCustomFilter</h2>
<BR> </div>
Interface TJCustomFilter</H2> <div class="contentContainer">
<HR> <div class="description">
<DL> <ul class="blockList">
<DT><PRE>public interface <B>TJCustomFilter</B></DL> <li class="blockList">
</PRE> <hr>
<br>
<P> <pre>public interface <span class="strong">TJCustomFilter</span></pre>
Custom filter callback interface <div class="block">Custom filter callback interface</div>
<P> </li>
</ul>
<P> </div>
<HR> <div class="summary">
<ul class="blockList">
<P> <li class="blockList">
<!-- ========== METHOD SUMMARY =========== --> <!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<A NAME="method_summary"><!-- --></A> <li class="blockList"><a name="method_summary">
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <!-- -->
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> </a>
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <h3>Method Summary</h3>
<B>Method Summary</B></FONT></TH> <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
</TR> <caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption>
<TR BGCOLOR="white" CLASS="TableRowColor"> <tr>
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <th class="colFirst" scope="col">Modifier and Type</th>
<CODE>&nbsp;void</CODE></FONT></TD> <th class="colLast" scope="col">Method and Description</th>
<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJCustomFilter.html#customFilter(java.nio.ShortBuffer, java.awt.Rectangle, java.awt.Rectangle, int, int, org.libjpegturbo.turbojpeg.TJTransform)">customFilter</A></B>(java.nio.ShortBuffer&nbsp;coeffBuffer, </tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJCustomFilter.html#customFilter(java.nio.ShortBuffer, java.awt.Rectangle, java.awt.Rectangle, int, int, org.libjpegturbo.turbojpeg.TJTransform)">customFilter</a></strong>(java.nio.ShortBuffer&nbsp;coeffBuffer,
java.awt.Rectangle&nbsp;bufferRegion, java.awt.Rectangle&nbsp;bufferRegion,
java.awt.Rectangle&nbsp;planeRegion, java.awt.Rectangle&nbsp;planeRegion,
int&nbsp;componentID, int&nbsp;componentID,
int&nbsp;transformID, int&nbsp;transformID,
<A HREF="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</A>&nbsp;transform)</CODE> <a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</a>&nbsp;transform)</code>
<div class="block">A callback function that can be used to modify the DCT coefficients after
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;A callback function that can be used to modify the DCT coefficients after
they are losslessly transformed but before they are transcoded to a new they are losslessly transformed but before they are transcoded to a new
JPEG image.</TD> JPEG image.</div>
</TR> </td>
</TABLE> </tr>
&nbsp; </table>
<P> </li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ METHOD DETAIL ========== --> <!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<A NAME="method_detail"><!-- --></A> <li class="blockList"><a name="method_detail">
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <!-- -->
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> </a>
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <h3>Method Detail</h3>
<B>Method Detail</B></FONT></TH> <a name="customFilter(java.nio.ShortBuffer, java.awt.Rectangle, java.awt.Rectangle, int, int, org.libjpegturbo.turbojpeg.TJTransform)">
</TR> <!-- -->
</TABLE> </a>
<ul class="blockListLast">
<A NAME="customFilter(java.nio.ShortBuffer, java.awt.Rectangle, java.awt.Rectangle, int, int, org.libjpegturbo.turbojpeg.TJTransform)"><!-- --></A><H3> <li class="blockList">
customFilter</H3> <h4>customFilter</h4>
<PRE> <pre>void&nbsp;customFilter(java.nio.ShortBuffer&nbsp;coeffBuffer,
void <B>customFilter</B>(java.nio.ShortBuffer&nbsp;coeffBuffer,
java.awt.Rectangle&nbsp;bufferRegion, java.awt.Rectangle&nbsp;bufferRegion,
java.awt.Rectangle&nbsp;planeRegion, java.awt.Rectangle&nbsp;planeRegion,
int&nbsp;componentID, int&nbsp;componentID,
int&nbsp;transformID, int&nbsp;transformID,
<A HREF="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</A>&nbsp;transform) <a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</a>&nbsp;transform)
throws java.lang.Exception</PRE> throws java.lang.Exception</pre>
<DL> <div class="block">A callback function that can be used to modify the DCT coefficients after
<DD>A callback function that can be used to modify the DCT coefficients after
they are losslessly transformed but before they are transcoded to a new they are losslessly transformed but before they are transcoded to a new
JPEG image. This allows for custom filters or other transformations to be JPEG image. This allows for custom filters or other transformations to be
applied in the frequency domain. applied in the frequency domain.</div>
<P> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>coeffBuffer</code> - a buffer containing transformed DCT coefficients.
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>coeffBuffer</CODE> - a buffer containing transformed DCT coefficients.
(NOTE: this buffer is not guaranteed to be valid once the callback (NOTE: this buffer is not guaranteed to be valid once the callback
returns, so applications wishing to hand off the DCT coefficients to returns, so applications wishing to hand off the DCT coefficients to
another function or library should make a copy of them within the body of another function or library should make a copy of them within the body of
the callback.)<DD><CODE>bufferRegion</CODE> - rectangle containing the width and height of the callback.)</dd><dd><code>bufferRegion</code> - rectangle containing the width and height of
<code>coeffBuffer</code> as well as its offset relative to the component <code>coeffBuffer</code> as well as its offset relative to the component
plane. TurboJPEG implementations may choose to split each component plane plane. TurboJPEG implementations may choose to split each component plane
into multiple DCT coefficient buffers and call the callback function once into multiple DCT coefficient buffers and call the callback function once
for each buffer.<DD><CODE>planeRegion</CODE> - rectangle containing the width and height of the for each buffer.</dd><dd><code>planeRegion</code> - rectangle containing the width and height of the
component plane to which <code>coeffBuffer</code> belongs<DD><CODE>componentID</CODE> - ID number of the component plane to which component plane to which <code>coeffBuffer</code> belongs</dd><dd><code>componentID</code> - ID number of the component plane to which
<code>coeffBuffer</code> belongs (Y, Cb, and Cr have, respectively, ID's <code>coeffBuffer</code> belongs (Y, Cb, and Cr have, respectively, ID's
of 0, 1, and 2 in typical JPEG images.)<DD><CODE>transformID</CODE> - ID number of the transformed image to which of 0, 1, and 2 in typical JPEG images.)</dd><dd><code>transformID</code> - ID number of the transformed image to which
<code>coeffBuffer</code> belongs. This is the same as the index of the <code>coeffBuffer</code> belongs. This is the same as the index of the
transform in the <code>transforms</code> array that was passed to <A HREF="../../../org/libjpegturbo/turbojpeg/TJTransformer.html#transform(byte[][], org.libjpegturbo.turbojpeg.TJTransform[], int)"><CODE>TJTransformer.transform()</CODE></A>.<DD><CODE>transform</CODE> - a <A HREF="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg"><CODE>TJTransform</CODE></A> instance that specifies the transform in the <code>transforms</code> array that was passed to <a href="../../../org/libjpegturbo/turbojpeg/TJTransformer.html#transform(byte[][], org.libjpegturbo.turbojpeg.TJTransform[], int)"><code>TJTransformer.transform()</code></a>.</dd><dd><code>transform</code> - a <a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg"><code>TJTransform</code></a> instance that specifies the
parameters and/or cropping region for this transform parameters and/or cropping region for this transform</dd>
<DT><B>Throws:</B> <dt><span class="strong">Throws:</span></dt>
<DD><CODE>java.lang.Exception</CODE></DL> <dd><code>java.lang.Exception</code></dd></dl>
</DD> </li>
</DL> </ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= --> <!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== --> <!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A> <div class="bottomNav"><a name="navbar_bottom">
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <!-- -->
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<TR> <!-- -->
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> </a>
<A NAME="navbar_bottom_firstrow"><!-- --></A> <ul class="navList" title="Navigation">
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <li><a href="../../../org/libjpegturbo/turbojpeg/package-summary.html">Package</a></li>
<TR ALIGN="center" VALIGN="top"> <li class="navBarCell1Rev">Class</li>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../org/libjpegturbo/turbojpeg/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <li><a href="package-tree.html">Tree</a></li>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD> <li><a href="../../../deprecated-list.html">Deprecated</a></li>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <li><a href="../../../index-all.html">Index</a></li>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <li><a href="../../../help-doc.html">Help</a></li>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> </ul>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </div>
</TR> <div class="subNav">
</TABLE> <ul class="navList">
</TD> <li><a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">Prev Class</span></a></li>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> <li><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">Next Class</span></a></li>
</EM> </ul>
</TD> <ul class="navList">
</TR> <li><a href="../../../index.html?org/libjpegturbo/turbojpeg/TJCustomFilter.html" target="_top">Frames</a></li>
<li><a href="TJCustomFilter.html" target="_top">No Frames</a></li>
<TR> </ul>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <ul class="navList" id="allclasses_navbar_bottom">
&nbsp;<A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg"><B>PREV CLASS</B></A>&nbsp; <li><a href="../../../allclasses-noframe.html">All Classes</a></li>
&nbsp;<A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg"><B>NEXT CLASS</B></A></FONT></TD> </ul>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <div>
<A HREF="../../../index.html?org/libjpegturbo/turbojpeg/TJCustomFilter.html" target="_top"><B>FRAMES</B></A> &nbsp; <script type="text/javascript"><!--
&nbsp;<A HREF="TJCustomFilter.html" target="_top"><B>NO FRAMES</B></A> &nbsp; allClassesLink = document.getElementById("allclasses_navbar_bottom");
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) { if(window==top) {
document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
} }
//--> //-->
</SCRIPT> </script>
<NOSCRIPT> </div>
<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> <div>
</NOSCRIPT> <ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
</FONT></TD> <li>Field&nbsp;|&nbsp;</li>
</TR> <li>Constr&nbsp;|&nbsp;</li>
<TR> <li><a href="#method_summary">Method</a></li>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> </ul>
SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD> <ul class="subNavList">
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> <li>Detail:&nbsp;</li>
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD> <li>Field&nbsp;|&nbsp;</li>
</TR> <li>Constr&nbsp;|&nbsp;</li>
</TABLE> <li><a href="#method_detail">Method</a></li>
<A NAME="skip-navbar_bottom"></A> </ul>
</div>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= --> <!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
<HR> </html>
</BODY>
</HTML>

File diff suppressed because it is too large Load Diff

View File

@@ -1,356 +1,336 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage --> <!-- NewPage -->
<HTML> <html lang="en">
<HEAD> <head>
<TITLE> <title>TJScalingFactor</title>
TJScalingFactor <link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
</TITLE> </head>
<body>
<script type="text/javascript"><!--
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) { if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="TJScalingFactor"; parent.document.title="TJScalingFactor";
} }
} //-->
</SCRIPT> </script>
<NOSCRIPT> <noscript>
</NOSCRIPT> <div>JavaScript is disabled on your browser.</div>
</noscript>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ========= START OF TOP NAVBAR ======= --> <!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A> <div class="topNav"><a name="navbar_top">
<A HREF="#skip-navbar_top" title="Skip navigation links"></A> <!-- -->
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<TR> <!-- -->
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> </a>
<A NAME="navbar_top_firstrow"><!-- --></A> <ul class="navList" title="Navigation">
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <li><a href="../../../org/libjpegturbo/turbojpeg/package-summary.html">Package</a></li>
<TR ALIGN="center" VALIGN="top"> <li class="navBarCell1Rev">Class</li>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../org/libjpegturbo/turbojpeg/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <li><a href="package-tree.html">Tree</a></li>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD> <li><a href="../../../deprecated-list.html">Deprecated</a></li>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <li><a href="../../../index-all.html">Index</a></li>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <li><a href="../../../help-doc.html">Help</a></li>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> </ul>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </div>
</TR> <div class="subNav">
</TABLE> <ul class="navList">
</TD> <li><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">Prev Class</span></a></li>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> <li><a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">Next Class</span></a></li>
</EM> </ul>
</TD> <ul class="navList">
</TR> <li><a href="../../../index.html?org/libjpegturbo/turbojpeg/TJScalingFactor.html" target="_top">Frames</a></li>
<li><a href="TJScalingFactor.html" target="_top">No Frames</a></li>
<TR> </ul>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <ul class="navList" id="allclasses_navbar_top">
&nbsp;<A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg"><B>PREV CLASS</B></A>&nbsp; <li><a href="../../../allclasses-noframe.html">All Classes</a></li>
&nbsp;<A HREF="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg"><B>NEXT CLASS</B></A></FONT></TD> </ul>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <div>
<A HREF="../../../index.html?org/libjpegturbo/turbojpeg/TJScalingFactor.html" target="_top"><B>FRAMES</B></A> &nbsp; <script type="text/javascript"><!--
&nbsp;<A HREF="TJScalingFactor.html" target="_top"><B>NO FRAMES</B></A> &nbsp; allClassesLink = document.getElementById("allclasses_navbar_top");
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) { if(window==top) {
document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
} }
//--> //-->
</SCRIPT> </script>
<NOSCRIPT> </div>
<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> <div>
</NOSCRIPT> <ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
</FONT></TD> <li>Field&nbsp;|&nbsp;</li>
</TR> <li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
<TR> <li><a href="#method_summary">Method</a></li>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> </ul>
SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD> <ul class="subNavList">
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> <li>Detail:&nbsp;</li>
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD> <li>Field&nbsp;|&nbsp;</li>
</TR> <li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
</TABLE> <li><a href="#method_detail">Method</a></li>
<A NAME="skip-navbar_top"></A> </ul>
</div>
<a name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= --> <!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<!-- ======== START OF CLASS DATA ======== --> <!-- ======== START OF CLASS DATA ======== -->
<H2> <div class="header">
<FONT SIZE="-1"> <div class="subTitle">org.libjpegturbo.turbojpeg</div>
org.libjpegturbo.turbojpeg</FONT> <h2 title="Class TJScalingFactor" class="title">Class TJScalingFactor</h2>
<BR> </div>
Class TJScalingFactor</H2> <div class="contentContainer">
<PRE> <ul class="inheritance">
java.lang.Object <li>java.lang.Object</li>
<IMG SRC="../../../resources/inherit.gif" ALT="extended by "><B>org.libjpegturbo.turbojpeg.TJScalingFactor</B> <li>
</PRE> <ul class="inheritance">
<HR> <li>org.libjpegturbo.turbojpeg.TJScalingFactor</li>
<DL> </ul>
<DT><PRE>public class <B>TJScalingFactor</B><DT>extends java.lang.Object</DL> </li>
</PRE> </ul>
<div class="description">
<P> <ul class="blockList">
Fractional scaling factor <li class="blockList">
<P> <hr>
<br>
<P> <pre>public class <span class="strong">TJScalingFactor</span>
<HR> extends java.lang.Object</pre>
<div class="block">Fractional scaling factor</div>
<P> </li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== CONSTRUCTOR SUMMARY ======== --> <!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<A NAME="constructor_summary"><!-- --></A> <li class="blockList"><a name="constructor_summary">
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <!-- -->
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> </a>
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <h3>Constructor Summary</h3>
<B>Constructor Summary</B></FONT></TH> <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
</TR> <caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<TR BGCOLOR="white" CLASS="TableRowColor"> <tr>
<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html#TJScalingFactor(int, int)">TJScalingFactor</A></B>(int&nbsp;num, <th class="colOne" scope="col">Constructor and Description</th>
int&nbsp;denom)</CODE> </tr>
<tr class="altColor">
<BR> <td class="colOne"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html#TJScalingFactor(int, int)">TJScalingFactor</a></strong>(int&nbsp;num,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> int&nbsp;denom)</code>&nbsp;</td>
</TR> </tr>
</TABLE> </table>
&nbsp; </li>
</ul>
<!-- ========== METHOD SUMMARY =========== --> <!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<A NAME="method_summary"><!-- --></A> <li class="blockList"><a name="method_summary">
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <!-- -->
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> </a>
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <h3>Method Summary</h3>
<B>Method Summary</B></FONT></TH> <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
</TR> <caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption>
<TR BGCOLOR="white" CLASS="TableRowColor"> <tr>
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <th class="colFirst" scope="col">Modifier and Type</th>
<CODE>&nbsp;boolean</CODE></FONT></TD> <th class="colLast" scope="col">Method and Description</th>
<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html#equals(org.libjpegturbo.turbojpeg.TJScalingFactor)">equals</A></B>(<A HREF="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg">TJScalingFactor</A>&nbsp;other)</CODE> </tr>
<tr class="altColor">
<BR> <td class="colFirst"><code>boolean</code></td>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns true or false, depending on whether this instance and <td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html#equals(org.libjpegturbo.turbojpeg.TJScalingFactor)">equals</a></strong>(<a href="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg">TJScalingFactor</a>&nbsp;other)</code>
<code>other</code> have the same numerator and denominator.</TD> <div class="block">Returns true or false, depending on whether this instance and
</TR> <code>other</code> have the same numerator and denominator.</div>
<TR BGCOLOR="white" CLASS="TableRowColor"> </td>
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> </tr>
<CODE>&nbsp;int</CODE></FONT></TD> <tr class="rowColor">
<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html#getDenom()">getDenom</A></B>()</CODE> <td class="colFirst"><code>int</code></td>
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html#getDenom()">getDenom</a></strong>()</code>
<BR> <div class="block">Returns denominator</div>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns denominator</TD> </td>
</TR> </tr>
<TR BGCOLOR="white" CLASS="TableRowColor"> <tr class="altColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <td class="colFirst"><code>int</code></td>
<CODE>&nbsp;int</CODE></FONT></TD> <td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html#getNum()">getNum</a></strong>()</code>
<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html#getNum()">getNum</A></B>()</CODE> <div class="block">Returns numerator</div>
</td>
<BR> </tr>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns numerator</TD> <tr class="rowColor">
</TR> <td class="colFirst"><code>int</code></td>
<TR BGCOLOR="white" CLASS="TableRowColor"> <td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html#getScaled(int)">getScaled</a></strong>(int&nbsp;dimension)</code>
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <div class="block">Returns the scaled value of <code>dimension</code>.</div>
<CODE>&nbsp;int</CODE></FONT></TD> </td>
<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html#getScaled(int)">getScaled</A></B>(int&nbsp;dimension)</CODE> </tr>
<tr class="altColor">
<BR> <td class="colFirst"><code>boolean</code></td>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the scaled value of <code>dimension</code>.</TD> <td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html#isOne()">isOne</a></strong>()</code>
</TR> <div class="block">Returns true or false, depending on whether this instance is equal to
<TR BGCOLOR="white" CLASS="TableRowColor"> 1/1.</div>
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> </td>
<CODE>&nbsp;boolean</CODE></FONT></TD> </tr>
<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html#isOne()">isOne</A></B>()</CODE> </table>
<ul class="blockList">
<BR> <li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns true or false, depending on whether this instance is equal to <!-- -->
1/1.</TD> </a>
</TR> <h3>Methods inherited from class&nbsp;java.lang.Object</h3>
</TABLE> <code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> </ul>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> </li>
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> </ul>
<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH> </li>
</TR> </ul>
<TR BGCOLOR="white" CLASS="TableRowColor"> </div>
<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD> <div class="details">
</TR> <ul class="blockList">
</TABLE> <li class="blockList">
&nbsp;
<P>
<!-- ========= CONSTRUCTOR DETAIL ======== --> <!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<A NAME="constructor_detail"><!-- --></A> <li class="blockList"><a name="constructor_detail">
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <!-- -->
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> </a>
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <h3>Constructor Detail</h3>
<B>Constructor Detail</B></FONT></TH> <a name="TJScalingFactor(int, int)">
</TR> <!-- -->
</TABLE> </a>
<ul class="blockListLast">
<A NAME="TJScalingFactor(int, int)"><!-- --></A><H3> <li class="blockList">
TJScalingFactor</H3> <h4>TJScalingFactor</h4>
<PRE> <pre>public&nbsp;TJScalingFactor(int&nbsp;num,
public <B>TJScalingFactor</B>(int&nbsp;num,
int&nbsp;denom) int&nbsp;denom)
throws java.lang.Exception</PRE> throws java.lang.Exception</pre>
<DL> <dl><dt><span class="strong">Throws:</span></dt>
<DL> <dd><code>java.lang.Exception</code></dd></dl>
</li>
<DT><B>Throws:</B> </ul>
<DD><CODE>java.lang.Exception</CODE></DL> </li>
</DL> </ul>
<!-- ============ METHOD DETAIL ========== --> <!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<A NAME="method_detail"><!-- --></A> <li class="blockList"><a name="method_detail">
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <!-- -->
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> </a>
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <h3>Method Detail</h3>
<B>Method Detail</B></FONT></TH> <a name="getNum()">
</TR> <!-- -->
</TABLE> </a>
<ul class="blockList">
<A NAME="getNum()"><!-- --></A><H3> <li class="blockList">
getNum</H3> <h4>getNum</h4>
<PRE> <pre>public&nbsp;int&nbsp;getNum()</pre>
public int <B>getNum</B>()</PRE> <div class="block">Returns numerator</div>
<DL> <dl><dt><span class="strong">Returns:</span></dt><dd>numerator</dd></dl>
<DD>Returns numerator </li>
<P> </ul>
<DD><DL> <a name="getDenom()">
<!-- -->
<DT><B>Returns:</B><DD>numerator</DL> </a>
</DD> <ul class="blockList">
</DL> <li class="blockList">
<HR> <h4>getDenom</h4>
<pre>public&nbsp;int&nbsp;getDenom()</pre>
<A NAME="getDenom()"><!-- --></A><H3> <div class="block">Returns denominator</div>
getDenom</H3> <dl><dt><span class="strong">Returns:</span></dt><dd>denominator</dd></dl>
<PRE> </li>
public int <B>getDenom</B>()</PRE> </ul>
<DL> <a name="getScaled(int)">
<DD>Returns denominator <!-- -->
<P> </a>
<DD><DL> <ul class="blockList">
<li class="blockList">
<DT><B>Returns:</B><DD>denominator</DL> <h4>getScaled</h4>
</DD> <pre>public&nbsp;int&nbsp;getScaled(int&nbsp;dimension)</pre>
</DL> <div class="block">Returns the scaled value of <code>dimension</code>. This function
<HR>
<A NAME="getScaled(int)"><!-- --></A><H3>
getScaled</H3>
<PRE>
public int <B>getScaled</B>(int&nbsp;dimension)</PRE>
<DL>
<DD>Returns the scaled value of <code>dimension</code>. This function
performs the integer equivalent of performs the integer equivalent of
<code>ceil(dimension * scalingFactor)</code>. <code>ceil(dimension * scalingFactor)</code>.</div>
<P> <dl><dt><span class="strong">Returns:</span></dt><dd>the scaled value of <code>dimension</code></dd></dl>
<DD><DL> </li>
</ul>
<DT><B>Returns:</B><DD>the scaled value of <code>dimension</code></DL> <a name="equals(org.libjpegturbo.turbojpeg.TJScalingFactor)">
</DD> <!-- -->
</DL> </a>
<HR> <ul class="blockList">
<li class="blockList">
<A NAME="equals(org.libjpegturbo.turbojpeg.TJScalingFactor)"><!-- --></A><H3> <h4>equals</h4>
equals</H3> <pre>public&nbsp;boolean&nbsp;equals(<a href="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg">TJScalingFactor</a>&nbsp;other)</pre>
<PRE> <div class="block">Returns true or false, depending on whether this instance and
public boolean <B>equals</B>(<A HREF="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg">TJScalingFactor</A>&nbsp;other)</PRE> <code>other</code> have the same numerator and denominator.</div>
<DL> <dl><dt><span class="strong">Returns:</span></dt><dd>true or false, depending on whether this instance and
<DD>Returns true or false, depending on whether this instance and <code>other</code> have the same numerator and denominator</dd></dl>
<code>other</code> have the same numerator and denominator. </li>
<P> </ul>
<DD><DL> <a name="isOne()">
<!-- -->
<DT><B>Returns:</B><DD>true or false, depending on whether this instance and </a>
<code>other</code> have the same numerator and denominator</DL> <ul class="blockListLast">
</DD> <li class="blockList">
</DL> <h4>isOne</h4>
<HR> <pre>public&nbsp;boolean&nbsp;isOne()</pre>
<div class="block">Returns true or false, depending on whether this instance is equal to
<A NAME="isOne()"><!-- --></A><H3> 1/1.</div>
isOne</H3> <dl><dt><span class="strong">Returns:</span></dt><dd>true or false, depending on whether this instance is equal to
<PRE> 1/1</dd></dl>
public boolean <B>isOne</B>()</PRE> </li>
<DL> </ul>
<DD>Returns true or false, depending on whether this instance is equal to </li>
1/1. </ul>
<P> </li>
<DD><DL> </ul>
</div>
<DT><B>Returns:</B><DD>true or false, depending on whether this instance is equal to </div>
1/1</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= --> <!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== --> <!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A> <div class="bottomNav"><a name="navbar_bottom">
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <!-- -->
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<TR> <!-- -->
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> </a>
<A NAME="navbar_bottom_firstrow"><!-- --></A> <ul class="navList" title="Navigation">
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <li><a href="../../../org/libjpegturbo/turbojpeg/package-summary.html">Package</a></li>
<TR ALIGN="center" VALIGN="top"> <li class="navBarCell1Rev">Class</li>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../org/libjpegturbo/turbojpeg/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <li><a href="package-tree.html">Tree</a></li>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD> <li><a href="../../../deprecated-list.html">Deprecated</a></li>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <li><a href="../../../index-all.html">Index</a></li>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <li><a href="../../../help-doc.html">Help</a></li>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> </ul>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </div>
</TR> <div class="subNav">
</TABLE> <ul class="navList">
</TD> <li><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">Prev Class</span></a></li>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> <li><a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">Next Class</span></a></li>
</EM> </ul>
</TD> <ul class="navList">
</TR> <li><a href="../../../index.html?org/libjpegturbo/turbojpeg/TJScalingFactor.html" target="_top">Frames</a></li>
<li><a href="TJScalingFactor.html" target="_top">No Frames</a></li>
<TR> </ul>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <ul class="navList" id="allclasses_navbar_bottom">
&nbsp;<A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg"><B>PREV CLASS</B></A>&nbsp; <li><a href="../../../allclasses-noframe.html">All Classes</a></li>
&nbsp;<A HREF="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg"><B>NEXT CLASS</B></A></FONT></TD> </ul>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <div>
<A HREF="../../../index.html?org/libjpegturbo/turbojpeg/TJScalingFactor.html" target="_top"><B>FRAMES</B></A> &nbsp; <script type="text/javascript"><!--
&nbsp;<A HREF="TJScalingFactor.html" target="_top"><B>NO FRAMES</B></A> &nbsp; allClassesLink = document.getElementById("allclasses_navbar_bottom");
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) { if(window==top) {
document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
} }
//--> //-->
</SCRIPT> </script>
<NOSCRIPT> </div>
<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> <div>
</NOSCRIPT> <ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
</FONT></TD> <li>Field&nbsp;|&nbsp;</li>
</TR> <li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
<TR> <li><a href="#method_summary">Method</a></li>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> </ul>
SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD> <ul class="subNavList">
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> <li>Detail:&nbsp;</li>
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD> <li>Field&nbsp;|&nbsp;</li>
</TR> <li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
</TABLE> <li><a href="#method_detail">Method</a></li>
<A NAME="skip-navbar_bottom"></A> </ul>
</div>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= --> <!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
<HR> </html>
</BODY>
</HTML>

File diff suppressed because it is too large Load Diff

View File

@@ -1,301 +1,291 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage --> <!-- NewPage -->
<HTML> <html lang="en">
<HEAD> <head>
<TITLE> <title>TJTransformer</title>
TJTransformer <link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
</TITLE> </head>
<body>
<script type="text/javascript"><!--
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) { if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="TJTransformer"; parent.document.title="TJTransformer";
} }
} //-->
</SCRIPT> </script>
<NOSCRIPT> <noscript>
</NOSCRIPT> <div>JavaScript is disabled on your browser.</div>
</noscript>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ========= START OF TOP NAVBAR ======= --> <!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A> <div class="topNav"><a name="navbar_top">
<A HREF="#skip-navbar_top" title="Skip navigation links"></A> <!-- -->
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<TR> <!-- -->
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> </a>
<A NAME="navbar_top_firstrow"><!-- --></A> <ul class="navList" title="Navigation">
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <li><a href="../../../org/libjpegturbo/turbojpeg/package-summary.html">Package</a></li>
<TR ALIGN="center" VALIGN="top"> <li class="navBarCell1Rev">Class</li>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../org/libjpegturbo/turbojpeg/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <li><a href="package-tree.html">Tree</a></li>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD> <li><a href="../../../deprecated-list.html">Deprecated</a></li>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <li><a href="../../../index-all.html">Index</a></li>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <li><a href="../../../help-doc.html">Help</a></li>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> </ul>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </div>
</TR> <div class="subNav">
</TABLE> <ul class="navList">
</TD> <li><a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">Prev Class</span></a></li>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> <li><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">Next Class</span></a></li>
</EM> </ul>
</TD> <ul class="navList">
</TR> <li><a href="../../../index.html?org/libjpegturbo/turbojpeg/TJTransformer.html" target="_top">Frames</a></li>
<li><a href="TJTransformer.html" target="_top">No Frames</a></li>
<TR> </ul>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <ul class="navList" id="allclasses_navbar_top">
&nbsp;<A HREF="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg"><B>PREV CLASS</B></A>&nbsp; <li><a href="../../../allclasses-noframe.html">All Classes</a></li>
&nbsp;NEXT CLASS</FONT></TD> </ul>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <div>
<A HREF="../../../index.html?org/libjpegturbo/turbojpeg/TJTransformer.html" target="_top"><B>FRAMES</B></A> &nbsp; <script type="text/javascript"><!--
&nbsp;<A HREF="TJTransformer.html" target="_top"><B>NO FRAMES</B></A> &nbsp; allClassesLink = document.getElementById("allclasses_navbar_top");
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) { if(window==top) {
document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
} }
//--> //-->
</SCRIPT> </script>
<NOSCRIPT> </div>
<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> <div>
</NOSCRIPT> <ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
</FONT></TD> <li><a href="#fields_inherited_from_class_org.libjpegturbo.turbojpeg.TJDecompressor">Field</a>&nbsp;|&nbsp;</li>
</TR> <li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
<TR> <li><a href="#method_summary">Method</a></li>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> </ul>
SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#fields_inherited_from_class_org.libjpegturbo.turbojpeg.TJDecompressor">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD> <ul class="subNavList">
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> <li>Detail:&nbsp;</li>
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD> <li>Field&nbsp;|&nbsp;</li>
</TR> <li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
</TABLE> <li><a href="#method_detail">Method</a></li>
<A NAME="skip-navbar_top"></A> </ul>
</div>
<a name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= --> <!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<!-- ======== START OF CLASS DATA ======== --> <!-- ======== START OF CLASS DATA ======== -->
<H2> <div class="header">
<FONT SIZE="-1"> <div class="subTitle">org.libjpegturbo.turbojpeg</div>
org.libjpegturbo.turbojpeg</FONT> <h2 title="Class TJTransformer" class="title">Class TJTransformer</h2>
<BR> </div>
Class TJTransformer</H2> <div class="contentContainer">
<PRE> <ul class="inheritance">
java.lang.Object <li>java.lang.Object</li>
<IMG SRC="../../../resources/inherit.gif" ALT="extended by "><A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">org.libjpegturbo.turbojpeg.TJDecompressor</A> <li>
<IMG SRC="../../../resources/inherit.gif" ALT="extended by "><B>org.libjpegturbo.turbojpeg.TJTransformer</B> <ul class="inheritance">
</PRE> <li><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">org.libjpegturbo.turbojpeg.TJDecompressor</a></li>
<HR> <li>
<DL> <ul class="inheritance">
<DT><PRE>public class <B>TJTransformer</B><DT>extends <A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</A></DL> <li>org.libjpegturbo.turbojpeg.TJTransformer</li>
</PRE> </ul>
</li>
<P> </ul>
TurboJPEG lossless transformer </li>
<P> </ul>
<div class="description">
<P> <ul class="blockList">
<HR> <li class="blockList">
<hr>
<P> <br>
<pre>public class <span class="strong">TJTransformer</span>
extends <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></pre>
<div class="block">TurboJPEG lossless transformer</div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== FIELD SUMMARY =========== --> <!-- =========== FIELD SUMMARY =========== -->
<ul class="blockList">
<A NAME="field_summary"><!-- --></A> <li class="blockList"><a name="field_summary">
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <!-- -->
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> </a>
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <h3>Field Summary</h3>
<B>Field Summary</B></FONT></TH> <ul class="blockList">
</TR> <li class="blockList"><a name="fields_inherited_from_class_org.libjpegturbo.turbojpeg.TJDecompressor">
</TABLE> <!-- -->
&nbsp;<A NAME="fields_inherited_from_class_org.libjpegturbo.turbojpeg.TJDecompressor"><!-- --></A> </a>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <h3>Fields inherited from class&nbsp;org.libjpegturbo.turbojpeg.<a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></h3>
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <code><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#handle">handle</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#jpegBuf">jpegBuf</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#jpegBufSize">jpegBufSize</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#srcColorspace">srcColorspace</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#srcHeight">srcHeight</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#srcSubsamp">srcSubsamp</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#srcWidth">srcWidth</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#yuvImage">yuvImage</a></code></li>
<TH ALIGN="left"><B>Fields inherited from class org.libjpegturbo.turbojpeg.<A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</A></B></TH> </ul>
</TR> </li>
<TR BGCOLOR="white" CLASS="TableRowColor"> </ul>
<TD><CODE><A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#handle">handle</A>, <A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#jpegBuf">jpegBuf</A>, <A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#jpegBufSize">jpegBufSize</A>, <A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#jpegColorspace">jpegColorspace</A>, <A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#jpegHeight">jpegHeight</A>, <A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#jpegSubsamp">jpegSubsamp</A>, <A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#jpegWidth">jpegWidth</A></CODE></TD>
</TR>
</TABLE>
&nbsp;
<!-- ======== CONSTRUCTOR SUMMARY ======== --> <!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<A NAME="constructor_summary"><!-- --></A> <li class="blockList"><a name="constructor_summary">
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <!-- -->
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> </a>
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <h3>Constructor Summary</h3>
<B>Constructor Summary</B></FONT></TH> <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
</TR> <caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<TR BGCOLOR="white" CLASS="TableRowColor"> <tr>
<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJTransformer.html#TJTransformer()">TJTransformer</A></B>()</CODE> <th class="colOne" scope="col">Constructor and Description</th>
</tr>
<BR> <tr class="altColor">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Create a TurboJPEG lossless transformer instance.</TD> <td class="colOne"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJTransformer.html#TJTransformer()">TJTransformer</a></strong>()</code>
</TR> <div class="block">Create a TurboJPEG lossless transformer instance.</div>
<TR BGCOLOR="white" CLASS="TableRowColor"> </td>
<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJTransformer.html#TJTransformer(byte[])">TJTransformer</A></B>(byte[]&nbsp;jpegImage)</CODE> </tr>
<tr class="rowColor">
<BR> <td class="colOne"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJTransformer.html#TJTransformer(byte[])">TJTransformer</a></strong>(byte[]&nbsp;jpegImage)</code>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Create a TurboJPEG lossless transformer instance and associate the JPEG <div class="block">Create a TurboJPEG lossless transformer instance and associate the JPEG
image stored in <code>jpegImage</code> with the newly-created instance.</TD> image stored in <code>jpegImage</code> with the newly created instance.</div>
</TR> </td>
<TR BGCOLOR="white" CLASS="TableRowColor"> </tr>
<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJTransformer.html#TJTransformer(byte[], int)">TJTransformer</A></B>(byte[]&nbsp;jpegImage, <tr class="altColor">
int&nbsp;imageSize)</CODE> <td class="colOne"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJTransformer.html#TJTransformer(byte[], int)">TJTransformer</a></strong>(byte[]&nbsp;jpegImage,
int&nbsp;imageSize)</code>
<BR> <div class="block">Create a TurboJPEG lossless transformer instance and associate the JPEG
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Create a TurboJPEG lossless transformer instance and associate the JPEG
image of length <code>imageSize</code> bytes stored in image of length <code>imageSize</code> bytes stored in
<code>jpegImage</code> with the newly-created instance.</TD> <code>jpegImage</code> with the newly created instance.</div>
</TR> </td>
</TABLE> </tr>
&nbsp; </table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== --> <!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<A NAME="method_summary"><!-- --></A> <li class="blockList"><a name="method_summary">
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <!-- -->
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> </a>
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <h3>Method Summary</h3>
<B>Method Summary</B></FONT></TH> <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
</TR> <caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption>
<TR BGCOLOR="white" CLASS="TableRowColor"> <tr>
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <th class="colFirst" scope="col">Modifier and Type</th>
<CODE>&nbsp;int[]</CODE></FONT></TD> <th class="colLast" scope="col">Method and Description</th>
<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJTransformer.html#getTransformedSizes()">getTransformedSizes</A></B>()</CODE> </tr>
<tr class="altColor">
<BR> <td class="colFirst"><code>int[]</code></td>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns an array containing the sizes of the transformed JPEG images from <td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJTransformer.html#getTransformedSizes()">getTransformedSizes</a></strong>()</code>
the most recent call to <A HREF="../../../org/libjpegturbo/turbojpeg/TJTransformer.html#transform(byte[][], org.libjpegturbo.turbojpeg.TJTransform[], int)"><CODE>transform()</CODE></A>.</TD> <div class="block">Returns an array containing the sizes of the transformed JPEG images
</TR> generated by the most recent transform operation.</div>
<TR BGCOLOR="white" CLASS="TableRowColor"> </td>
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> </tr>
<CODE>&nbsp;void</CODE></FONT></TD> <tr class="rowColor">
<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJTransformer.html#transform(byte[][], org.libjpegturbo.turbojpeg.TJTransform[], int)">transform</A></B>(byte[][]&nbsp;dstBufs, <td class="colFirst"><code>void</code></td>
<A HREF="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</A>[]&nbsp;transforms, <td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJTransformer.html#transform(byte[][], org.libjpegturbo.turbojpeg.TJTransform[], int)">transform</a></strong>(byte[][]&nbsp;dstBufs,
int&nbsp;flags)</CODE> <a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</a>[]&nbsp;transforms,
int&nbsp;flags)</code>
<BR> <div class="block">Losslessly transform the JPEG image associated with this transformer
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Losslessly transform the JPEG image associated with this transformer
instance into one or more JPEG images stored in the given destination instance into one or more JPEG images stored in the given destination
buffers.</TD> buffers.</div>
</TR> </td>
<TR BGCOLOR="white" CLASS="TableRowColor"> </tr>
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <tr class="altColor">
<CODE>&nbsp;<A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</A>[]</CODE></FONT></TD> <td class="colFirst"><code><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a>[]</code></td>
<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJTransformer.html#transform(org.libjpegturbo.turbojpeg.TJTransform[], int)">transform</A></B>(<A HREF="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</A>[]&nbsp;transforms, <td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJTransformer.html#transform(org.libjpegturbo.turbojpeg.TJTransform[], int)">transform</a></strong>(<a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</a>[]&nbsp;transforms,
int&nbsp;flags)</CODE> int&nbsp;flags)</code>
<div class="block">Losslessly transform the JPEG image associated with this transformer
<BR> instance and return an array of <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg"><code>TJDecompressor</code></a> instances, each of
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Losslessly transform the JPEG image associated with this transformer which has a transformed JPEG image associated with it.</div>
instance and return an array of <A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg"><CODE>TJDecompressor</CODE></A> instances, each of </td>
which has a transformed JPEG image associated with it.</TD> </tr>
</TR> </table>
</TABLE> <ul class="blockList">
&nbsp;<A NAME="methods_inherited_from_class_org.libjpegturbo.turbojpeg.TJDecompressor"><!-- --></A> <li class="blockList"><a name="methods_inherited_from_class_org.libjpegturbo.turbojpeg.TJDecompressor">
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <!-- -->
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> </a>
<TH ALIGN="left"><B>Methods inherited from class org.libjpegturbo.turbojpeg.<A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</A></B></TH> <h3>Methods inherited from class&nbsp;org.libjpegturbo.turbojpeg.<a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></h3>
</TR> <code><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#close()">close</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(java.awt.image.BufferedImage, int)">decompress</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[], int, int, int, int, int)">decompress</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[], int, int, int, int, int, int, int)">decompress</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(int[], int, int, int, int, int, int, int)">decompress</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(int, int, int, int)">decompress</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(int, int, int, int, int)">decompress</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(byte[], int)">decompressToYUV</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(int)">decompressToYUV</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(int, int, int, int)">decompressToYUV</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(org.libjpegturbo.turbojpeg.YUVImage, int)">decompressToYUV</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#finalize()">finalize</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getColorspace()">getColorspace</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getHeight()">getHeight</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getJPEGBuf()">getJPEGBuf</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getJPEGSize()">getJPEGSize</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getScaledHeight(int, int)">getScaledHeight</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getScaledWidth(int, int)">getScaledWidth</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getSourceBuf()">getSourceBuf</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getSourceSize()">getSourceSize</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getSubsamp()">getSubsamp</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getWidth()">getWidth</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#setJPEGImage(byte[], int)">setJPEGImage</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#setSourceImage(byte[], int)">setSourceImage</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#setSourceImage(org.libjpegturbo.turbojpeg.YUVImage)">setSourceImage</a></code></li>
<TR BGCOLOR="white" CLASS="TableRowColor"> </ul>
<TD><CODE><A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#close()">close</A>, <A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(java.awt.image.BufferedImage, int)">decompress</A>, <A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[], int, int, int, int, int)">decompress</A>, <A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[], int, int, int, int, int, int, int)">decompress</A>, <A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(int[], int, int, int, int, int, int, int)">decompress</A>, <A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(int, int, int, int)">decompress</A>, <A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(int, int, int, int, int)">decompress</A>, <A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(byte[], int)">decompressToYUV</A>, <A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(byte[], int, int, int, int)">decompressToYUV</A>, <A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(int)">decompressToYUV</A>, <A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(int, int, int, int)">decompressToYUV</A>, <A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#finalize()">finalize</A>, <A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getColorspace()">getColorspace</A>, <A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getHeight()">getHeight</A>, <A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getJPEGBuf()">getJPEGBuf</A>, <A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getJPEGSize()">getJPEGSize</A>, <A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getScaledHeight(int, int)">getScaledHeight</A>, <A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getScaledWidth(int, int)">getScaledWidth</A>, <A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getSubsamp()">getSubsamp</A>, <A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getWidth()">getWidth</A>, <A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#setJPEGImage(byte[], int)">setJPEGImage</A></CODE></TD> <ul class="blockList">
</TR> <li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
</TABLE> <!-- -->
&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> </a>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <h3>Methods inherited from class&nbsp;java.lang.Object</h3>
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <code>clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH> </ul>
</TR> </li>
<TR BGCOLOR="white" CLASS="TableRowColor"> </ul>
<TD><CODE>clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD> </li>
</TR> </ul>
</TABLE> </div>
&nbsp; <div class="details">
<P> <ul class="blockList">
<li class="blockList">
<!-- ========= CONSTRUCTOR DETAIL ======== --> <!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<A NAME="constructor_detail"><!-- --></A> <li class="blockList"><a name="constructor_detail">
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <!-- -->
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> </a>
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <h3>Constructor Detail</h3>
<B>Constructor Detail</B></FONT></TH> <a name="TJTransformer()">
</TR> <!-- -->
</TABLE> </a>
<ul class="blockList">
<A NAME="TJTransformer()"><!-- --></A><H3> <li class="blockList">
TJTransformer</H3> <h4>TJTransformer</h4>
<PRE> <pre>public&nbsp;TJTransformer()
public <B>TJTransformer</B>() throws java.lang.Exception</pre>
throws java.lang.Exception</PRE> <div class="block">Create a TurboJPEG lossless transformer instance.</div>
<DL> <dl><dt><span class="strong">Throws:</span></dt>
<DD>Create a TurboJPEG lossless transformer instance. <dd><code>java.lang.Exception</code></dd></dl>
<P> </li>
<DL> </ul>
<a name="TJTransformer(byte[])">
<DT><B>Throws:</B> <!-- -->
<DD><CODE>java.lang.Exception</CODE></DL> </a>
</DL> <ul class="blockList">
<HR> <li class="blockList">
<h4>TJTransformer</h4>
<A NAME="TJTransformer(byte[])"><!-- --></A><H3> <pre>public&nbsp;TJTransformer(byte[]&nbsp;jpegImage)
TJTransformer</H3> throws java.lang.Exception</pre>
<PRE> <div class="block">Create a TurboJPEG lossless transformer instance and associate the JPEG
public <B>TJTransformer</B>(byte[]&nbsp;jpegImage) image stored in <code>jpegImage</code> with the newly created instance.</div>
throws java.lang.Exception</PRE> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>jpegImage</code> - JPEG image buffer (size of the JPEG image is assumed to
<DL> be the length of the array)</dd>
<DD>Create a TurboJPEG lossless transformer instance and associate the JPEG <dt><span class="strong">Throws:</span></dt>
image stored in <code>jpegImage</code> with the newly-created instance. <dd><code>java.lang.Exception</code></dd></dl>
<P> </li>
<DL> </ul>
<DT><B>Parameters:</B><DD><CODE>jpegImage</CODE> - JPEG image buffer (size of the JPEG image is assumed to <a name="TJTransformer(byte[], int)">
be the length of the array) <!-- -->
<DT><B>Throws:</B> </a>
<DD><CODE>java.lang.Exception</CODE></DL> <ul class="blockListLast">
</DL> <li class="blockList">
<HR> <h4>TJTransformer</h4>
<pre>public&nbsp;TJTransformer(byte[]&nbsp;jpegImage,
<A NAME="TJTransformer(byte[], int)"><!-- --></A><H3>
TJTransformer</H3>
<PRE>
public <B>TJTransformer</B>(byte[]&nbsp;jpegImage,
int&nbsp;imageSize) int&nbsp;imageSize)
throws java.lang.Exception</PRE> throws java.lang.Exception</pre>
<DL> <div class="block">Create a TurboJPEG lossless transformer instance and associate the JPEG
<DD>Create a TurboJPEG lossless transformer instance and associate the JPEG
image of length <code>imageSize</code> bytes stored in image of length <code>imageSize</code> bytes stored in
<code>jpegImage</code> with the newly-created instance. <code>jpegImage</code> with the newly created instance.</div>
<P> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>jpegImage</code> - JPEG image buffer</dd><dd><code>imageSize</code> - size of the JPEG image (in bytes)</dd>
<DL> <dt><span class="strong">Throws:</span></dt>
<DT><B>Parameters:</B><DD><CODE>jpegImage</CODE> - JPEG image buffer<DD><CODE>imageSize</CODE> - size of the JPEG image (in bytes) <dd><code>java.lang.Exception</code></dd></dl>
<DT><B>Throws:</B> </li>
<DD><CODE>java.lang.Exception</CODE></DL> </ul>
</DL> </li>
</ul>
<!-- ============ METHOD DETAIL ========== --> <!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<A NAME="method_detail"><!-- --></A> <li class="blockList"><a name="method_detail">
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <!-- -->
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> </a>
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <h3>Method Detail</h3>
<B>Method Detail</B></FONT></TH> <a name="transform(byte[][], org.libjpegturbo.turbojpeg.TJTransform[], int)">
</TR> <!-- -->
</TABLE> </a>
<ul class="blockList">
<A NAME="transform(byte[][], org.libjpegturbo.turbojpeg.TJTransform[], int)"><!-- --></A><H3> <li class="blockList">
transform</H3> <h4>transform</h4>
<PRE> <pre>public&nbsp;void&nbsp;transform(byte[][]&nbsp;dstBufs,
public void <B>transform</B>(byte[][]&nbsp;dstBufs, <a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</a>[]&nbsp;transforms,
<A HREF="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</A>[]&nbsp;transforms,
int&nbsp;flags) int&nbsp;flags)
throws java.lang.Exception</PRE> throws java.lang.Exception</pre>
<DL> <div class="block">Losslessly transform the JPEG image associated with this transformer
<DD>Losslessly transform the JPEG image associated with this transformer
instance into one or more JPEG images stored in the given destination instance into one or more JPEG images stored in the given destination
buffers. Lossless transforms work by moving the raw coefficients from one buffers. Lossless transforms work by moving the raw coefficients from one
JPEG image structure to another without altering the values of the JPEG image structure to another without altering the values of the
@@ -306,121 +296,121 @@ public void <B>transform</B>(byte[][]&nbsp;dstBufs,
size of the destination image. Thus, this method provides a means of size of the destination image. Thus, this method provides a means of
generating multiple transformed images from the same source or of applying generating multiple transformed images from the same source or of applying
multiple transformations simultaneously, in order to eliminate the need to multiple transformations simultaneously, in order to eliminate the need to
read the source coefficients multiple times. read the source coefficients multiple times.</div>
<P> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>dstBufs</code> - an array of image buffers. <code>dstbufs[i]</code> will
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>dstBufs</CODE> - an array of image buffers. <code>dstbufs[i]</code> will
receive a JPEG image that has been transformed using the parameters in receive a JPEG image that has been transformed using the parameters in
<code>transforms[i]</code>. Use <A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html#bufSize(int, int, int)"><CODE>TJ.bufSize(int, int, int)</CODE></A> to determine the <code>transforms[i]</code>. Use <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#bufSize(int, int, int)"><code>TJ.bufSize(int, int, int)</code></a> to determine the
maximum size for each buffer based on the transformed or cropped width and maximum size for each buffer based on the transformed or cropped width and
height.<DD><CODE>transforms</CODE> - an array of <A HREF="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg"><CODE>TJTransform</CODE></A> instances, each of height and the level of subsampling used in the source image.</dd><dd><code>transforms</code> - an array of <a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg"><code>TJTransform</code></a> instances, each of
which specifies the transform parameters and/or cropping region for the which specifies the transform parameters and/or cropping region for the
corresponding transformed output image<DD><CODE>flags</CODE> - the bitwise OR of one or more of <A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg"><CODE>TJ.FLAG_*</CODE></A> corresponding transformed output image</dd><dd><code>flags</code> - the bitwise OR of one or more of
<DT><B>Throws:</B> <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#FLAG_BOTTOMUP"><code>TJ.FLAG_*</code></a></dd>
<DD><CODE>java.lang.Exception</CODE></DL> <dt><span class="strong">Throws:</span></dt>
</DD> <dd><code>java.lang.Exception</code></dd></dl>
</DL> </li>
<HR> </ul>
<a name="transform(org.libjpegturbo.turbojpeg.TJTransform[], int)">
<A NAME="transform(org.libjpegturbo.turbojpeg.TJTransform[], int)"><!-- --></A><H3> <!-- -->
transform</H3> </a>
<PRE> <ul class="blockList">
public <A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</A>[] <B>transform</B>(<A HREF="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</A>[]&nbsp;transforms, <li class="blockList">
<h4>transform</h4>
<pre>public&nbsp;<a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a>[]&nbsp;transform(<a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</a>[]&nbsp;transforms,
int&nbsp;flags) int&nbsp;flags)
throws java.lang.Exception</PRE> throws java.lang.Exception</pre>
<DL> <div class="block">Losslessly transform the JPEG image associated with this transformer
<DD>Losslessly transform the JPEG image associated with this transformer instance and return an array of <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg"><code>TJDecompressor</code></a> instances, each of
instance and return an array of <A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg"><CODE>TJDecompressor</CODE></A> instances, each of which has a transformed JPEG image associated with it.</div>
which has a transformed JPEG image associated with it. <dl><dt><span class="strong">Parameters:</span></dt><dd><code>transforms</code> - an array of <a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg"><code>TJTransform</code></a> instances, each of
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>transforms</CODE> - an array of <A HREF="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg"><CODE>TJTransform</CODE></A> instances, each of
which specifies the transform parameters and/or cropping region for the which specifies the transform parameters and/or cropping region for the
corresponding transformed output image<DD><CODE>flags</CODE> - the bitwise OR of one or more of <A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg"><CODE>TJ.FLAG_*</CODE></A> corresponding transformed output image</dd><dd><code>flags</code> - the bitwise OR of one or more of
<DT><B>Returns:</B><DD>an array of <A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg"><CODE>TJDecompressor</CODE></A> instances, each of <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#FLAG_BOTTOMUP"><code>TJ.FLAG_*</code></a></dd>
which has a transformed JPEG image associated with it <dt><span class="strong">Returns:</span></dt><dd>an array of <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg"><code>TJDecompressor</code></a> instances, each of
<DT><B>Throws:</B> which has a transformed JPEG image associated with it</dd>
<DD><CODE>java.lang.Exception</CODE></DL> <dt><span class="strong">Throws:</span></dt>
</DD> <dd><code>java.lang.Exception</code></dd></dl>
</DL> </li>
<HR> </ul>
<a name="getTransformedSizes()">
<A NAME="getTransformedSizes()"><!-- --></A><H3> <!-- -->
getTransformedSizes</H3> </a>
<PRE> <ul class="blockListLast">
public int[] <B>getTransformedSizes</B>() <li class="blockList">
throws java.lang.Exception</PRE> <h4>getTransformedSizes</h4>
<DL> <pre>public&nbsp;int[]&nbsp;getTransformedSizes()
<DD>Returns an array containing the sizes of the transformed JPEG images from throws java.lang.Exception</pre>
the most recent call to <A HREF="../../../org/libjpegturbo/turbojpeg/TJTransformer.html#transform(byte[][], org.libjpegturbo.turbojpeg.TJTransform[], int)"><CODE>transform()</CODE></A>. <div class="block">Returns an array containing the sizes of the transformed JPEG images
<P> generated by the most recent transform operation.</div>
<DD><DL> <dl><dt><span class="strong">Returns:</span></dt><dd>an array containing the sizes of the transformed JPEG images
generated by the most recent transform operation</dd>
<DT><B>Returns:</B><DD>an array containing the sizes of the transformed JPEG images from <dt><span class="strong">Throws:</span></dt>
the most recent call to <A HREF="../../../org/libjpegturbo/turbojpeg/TJTransformer.html#transform(byte[][], org.libjpegturbo.turbojpeg.TJTransform[], int)"><CODE>transform()</CODE></A> <dd><code>java.lang.Exception</code></dd></dl>
<DT><B>Throws:</B> </li>
<DD><CODE>java.lang.Exception</CODE></DL> </ul>
</DD> </li>
</DL> </ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= --> <!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== --> <!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A> <div class="bottomNav"><a name="navbar_bottom">
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <!-- -->
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<TR> <!-- -->
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> </a>
<A NAME="navbar_bottom_firstrow"><!-- --></A> <ul class="navList" title="Navigation">
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <li><a href="../../../org/libjpegturbo/turbojpeg/package-summary.html">Package</a></li>
<TR ALIGN="center" VALIGN="top"> <li class="navBarCell1Rev">Class</li>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../org/libjpegturbo/turbojpeg/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <li><a href="package-tree.html">Tree</a></li>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD> <li><a href="../../../deprecated-list.html">Deprecated</a></li>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <li><a href="../../../index-all.html">Index</a></li>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <li><a href="../../../help-doc.html">Help</a></li>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> </ul>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </div>
</TR> <div class="subNav">
</TABLE> <ul class="navList">
</TD> <li><a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">Prev Class</span></a></li>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> <li><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">Next Class</span></a></li>
</EM> </ul>
</TD> <ul class="navList">
</TR> <li><a href="../../../index.html?org/libjpegturbo/turbojpeg/TJTransformer.html" target="_top">Frames</a></li>
<li><a href="TJTransformer.html" target="_top">No Frames</a></li>
<TR> </ul>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <ul class="navList" id="allclasses_navbar_bottom">
&nbsp;<A HREF="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg"><B>PREV CLASS</B></A>&nbsp; <li><a href="../../../allclasses-noframe.html">All Classes</a></li>
&nbsp;NEXT CLASS</FONT></TD> </ul>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <div>
<A HREF="../../../index.html?org/libjpegturbo/turbojpeg/TJTransformer.html" target="_top"><B>FRAMES</B></A> &nbsp; <script type="text/javascript"><!--
&nbsp;<A HREF="TJTransformer.html" target="_top"><B>NO FRAMES</B></A> &nbsp; allClassesLink = document.getElementById("allclasses_navbar_bottom");
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) { if(window==top) {
document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
} }
//--> //-->
</SCRIPT> </script>
<NOSCRIPT> </div>
<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> <div>
</NOSCRIPT> <ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
</FONT></TD> <li><a href="#fields_inherited_from_class_org.libjpegturbo.turbojpeg.TJDecompressor">Field</a>&nbsp;|&nbsp;</li>
</TR> <li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
<TR> <li><a href="#method_summary">Method</a></li>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> </ul>
SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#fields_inherited_from_class_org.libjpegturbo.turbojpeg.TJDecompressor">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD> <ul class="subNavList">
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> <li>Detail:&nbsp;</li>
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD> <li>Field&nbsp;|&nbsp;</li>
</TR> <li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
</TABLE> <li><a href="#method_detail">Method</a></li>
<A NAME="skip-navbar_bottom"></A> </ul>
</div>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= --> <!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
<HR> </html>
</BODY>
</HTML>

View File

@@ -0,0 +1,569 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<title>YUVImage</title>
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="YUVImage";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!-- -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../org/libjpegturbo/turbojpeg/package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../index-all.html">Index</a></li>
<li><a href="../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../org/libjpegturbo/turbojpeg/TJTransformer.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">Prev Class</span></a></li>
<li>Next Class</li>
</ul>
<ul class="navList">
<li><a href="../../../index.html?org/libjpegturbo/turbojpeg/YUVImage.html" target="_top">Frames</a></li>
<li><a href="YUVImage.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#field_summary">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field_detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">org.libjpegturbo.turbojpeg</div>
<h2 title="Class YUVImage" class="title">Class YUVImage</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li>org.libjpegturbo.turbojpeg.YUVImage</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>public class <span class="strong">YUVImage</span>
extends java.lang.Object</pre>
<div class="block">This class encapsulates a YUV planar image buffer and the metadata
associated with it. The TurboJPEG API allows both the JPEG compression and
decompression pipelines to be split into stages: YUV encode, compress from
YUV, decompress to YUV, and YUV decode. A <code>YUVImage</code> instance
serves as the destination image for YUV encode and decompress-to-YUV
operations and as the source image for compress-from-YUV and YUV decode
operations.
<p>
Technically, the JPEG format uses the YCbCr colorspace (which technically is
not a "colorspace" but rather a "color transform"), but per the convention
of the digital video community, the TurboJPEG API uses "YUV" to refer to an
image format consisting of Y, Cb, and Cr image planes. In this image
format, the Y, Cb (U), and Cr (V) planes are stored sequentially in the same
image buffer, and the size of each plane is determined by the image width,
height, line padding, and level of chrominance subsampling. If the
chrominance components are subsampled along the horizontal dimension, then
the width of the luminance plane would be padded to the nearest multiple of
2 (same goes for the height of the luminance plane, if the chrominance
components are subsampled along the vertical dimension.) For instance, if
the source image is 35 x 35 pixels and 4:2:2 subsampling is used, then the
luminance plane would be 36 x 35 bytes, and each of the chrominance planes
would be 18 x 35 bytes. If you specify, for instance, a line padding of 4
bytes on top of this, then the luminance plane would be 36 x 35 bytes, and
each of the chrominance planes would be 20 x 35 bytes.</div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== FIELD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="field_summary">
<!-- -->
</a>
<h3>Field Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation">
<caption><span>Fields</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Field and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected long</code></td>
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html#handle">handle</a></strong></code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected byte[]</code></td>
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html#yuvBuf">yuvBuf</a></strong></code>&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected int</code></td>
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html#yuvHeight">yuvHeight</a></strong></code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected int</code></td>
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html#yuvPad">yuvPad</a></strong></code>&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected int</code></td>
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html#yuvSubsamp">yuvSubsamp</a></strong></code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected int</code></td>
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html#yuvWidth">yuvWidth</a></strong></code>&nbsp;</td>
</tr>
</table>
</li>
</ul>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html#YUVImage(byte[], int, int, int, int)">YUVImage</a></strong>(byte[]&nbsp;yuvImage,
int&nbsp;width,
int&nbsp;pad,
int&nbsp;height,
int&nbsp;subsamp)</code>
<div class="block">Create a <code>YUVImage</code> instance from an existing YUV planar image
buffer.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html#YUVImage(int, int, int, int)">YUVImage</a></strong>(int&nbsp;width,
int&nbsp;pad,
int&nbsp;height,
int&nbsp;subsamp)</code>
<div class="block">Create a <code>YUVImage</code> instance with a new image buffer.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method_summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>byte[]</code></td>
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html#getBuf()">getBuf</a></strong>()</code>
<div class="block">Returns the YUV image buffer</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html#getHeight()">getHeight</a></strong>()</code>
<div class="block">Returns the height of the YUV image.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html#getPad()">getPad</a></strong>()</code>
<div class="block">Returns the line padding used in the YUV image buffer.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html#getSize()">getSize</a></strong>()</code>
<div class="block">Returns the size (in bytes) of the YUV image buffer</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html#getSubsamp()">getSubsamp</a></strong>()</code>
<div class="block">Returns the level of chrominance subsampling used in the YUV image.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html#getWidth()">getWidth</a></strong>()</code>
<div class="block">Returns the width of the YUV image.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html#setBuf(byte[], int, int, int, int)">setBuf</a></strong>(byte[]&nbsp;yuvImage,
int&nbsp;width,
int&nbsp;pad,
int&nbsp;height,
int&nbsp;subsamp)</code>
<div class="block">Assign an existing YUV planar image buffer to this <code>YUVImage</code>
instance.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.Object</h3>
<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ FIELD DETAIL =========== -->
<ul class="blockList">
<li class="blockList"><a name="field_detail">
<!-- -->
</a>
<h3>Field Detail</h3>
<a name="handle">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>handle</h4>
<pre>protected&nbsp;long handle</pre>
</li>
</ul>
<a name="yuvBuf">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>yuvBuf</h4>
<pre>protected&nbsp;byte[] yuvBuf</pre>
</li>
</ul>
<a name="yuvPad">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>yuvPad</h4>
<pre>protected&nbsp;int yuvPad</pre>
</li>
</ul>
<a name="yuvWidth">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>yuvWidth</h4>
<pre>protected&nbsp;int yuvWidth</pre>
</li>
</ul>
<a name="yuvHeight">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>yuvHeight</h4>
<pre>protected&nbsp;int yuvHeight</pre>
</li>
</ul>
<a name="yuvSubsamp">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>yuvSubsamp</h4>
<pre>protected&nbsp;int yuvSubsamp</pre>
</li>
</ul>
</li>
</ul>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a name="YUVImage(int, int, int, int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>YUVImage</h4>
<pre>public&nbsp;YUVImage(int&nbsp;width,
int&nbsp;pad,
int&nbsp;height,
int&nbsp;subsamp)
throws java.lang.Exception</pre>
<div class="block">Create a <code>YUVImage</code> instance with a new image buffer.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>width</code> - width (in pixels) of the YUV image</dd><dd><code>pad</code> - Each line of each plane in the YUV image buffer will be padded
to this number of bytes (must be a power of 2.)</dd><dd><code>height</code> - height (in pixels) of the YUV image</dd><dd><code>subsamp</code> - the level of chrominance subsampling to be used in the YUV
image (one of <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#SAMP_444"><code>TJ.SAMP_*</code></a>)</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code>java.lang.Exception</code></dd></dl>
</li>
</ul>
<a name="YUVImage(byte[], int, int, int, int)">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>YUVImage</h4>
<pre>public&nbsp;YUVImage(byte[]&nbsp;yuvImage,
int&nbsp;width,
int&nbsp;pad,
int&nbsp;height,
int&nbsp;subsamp)
throws java.lang.Exception</pre>
<div class="block">Create a <code>YUVImage</code> instance from an existing YUV planar image
buffer.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>yuvImage</code> - image buffer that contains or will contain YUV planar
image data. See <a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg"><code>above</code></a> for a description of the image
format. Use <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#bufSizeYUV(int, int, int, int)"><code>TJ.bufSizeYUV(int, int, int, int)</code></a> to determine the minimum size for this
buffer.</dd><dd><code>width</code> - width (in pixels) of the YUV image</dd><dd><code>pad</code> - the line padding used in the YUV image buffer. For
instance, if each line in each plane of the buffer is padded to the
nearest multiple of 4 bytes, then <code>pad</code> should be set to 4.</dd><dd><code>height</code> - height (in pixels) of the YUV image</dd><dd><code>subsamp</code> - the level of chrominance subsampling used in the YUV
image (one of <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#SAMP_444"><code>TJ.SAMP_*</code></a>)</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code>java.lang.Exception</code></dd></dl>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="setBuf(byte[], int, int, int, int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setBuf</h4>
<pre>public&nbsp;void&nbsp;setBuf(byte[]&nbsp;yuvImage,
int&nbsp;width,
int&nbsp;pad,
int&nbsp;height,
int&nbsp;subsamp)
throws java.lang.Exception</pre>
<div class="block">Assign an existing YUV planar image buffer to this <code>YUVImage</code>
instance.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>yuvImage</code> - image buffer that contains or will contain YUV planar
image data. See <a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg"><code>above</code></a> for a description of the image
format. Use <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#bufSizeYUV(int, int, int, int)"><code>TJ.bufSizeYUV(int, int, int, int)</code></a> to determine the minimum size for this
buffer.</dd><dd><code>width</code> - width (in pixels) of the YUV image</dd><dd><code>pad</code> - the line padding used in the YUV image buffer. For
instance, if each line in each plane of the buffer is padded to the
nearest multiple of 4 bytes, then <code>pad</code> should be set to 4.</dd><dd><code>height</code> - height (in pixels) of the YUV image</dd><dd><code>subsamp</code> - the level of chrominance subsampling used in the YUV
image (one of <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#SAMP_444"><code>TJ.SAMP_*</code></a>)</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code>java.lang.Exception</code></dd></dl>
</li>
</ul>
<a name="getWidth()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getWidth</h4>
<pre>public&nbsp;int&nbsp;getWidth()
throws java.lang.Exception</pre>
<div class="block">Returns the width of the YUV image.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>the width of the YUV image</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code>java.lang.Exception</code></dd></dl>
</li>
</ul>
<a name="getHeight()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getHeight</h4>
<pre>public&nbsp;int&nbsp;getHeight()
throws java.lang.Exception</pre>
<div class="block">Returns the height of the YUV image.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>the height of the YUV image</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code>java.lang.Exception</code></dd></dl>
</li>
</ul>
<a name="getPad()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getPad</h4>
<pre>public&nbsp;int&nbsp;getPad()
throws java.lang.Exception</pre>
<div class="block">Returns the line padding used in the YUV image buffer.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>the line padding used in the YUV image buffer</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code>java.lang.Exception</code></dd></dl>
</li>
</ul>
<a name="getSubsamp()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getSubsamp</h4>
<pre>public&nbsp;int&nbsp;getSubsamp()
throws java.lang.Exception</pre>
<div class="block">Returns the level of chrominance subsampling used in the YUV image. See
<a href="../../../org/libjpegturbo/turbojpeg/TJ.html#SAMP_444"><code>TJ.SAMP_*</code></a>.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>the level of chrominance subsampling used in the YUV image</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code>java.lang.Exception</code></dd></dl>
</li>
</ul>
<a name="getBuf()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getBuf</h4>
<pre>public&nbsp;byte[]&nbsp;getBuf()
throws java.lang.Exception</pre>
<div class="block">Returns the YUV image buffer</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>the YUV image buffer</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code>java.lang.Exception</code></dd></dl>
</li>
</ul>
<a name="getSize()">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>getSize</h4>
<pre>public&nbsp;int&nbsp;getSize()
throws java.lang.Exception</pre>
<div class="block">Returns the size (in bytes) of the YUV image buffer</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>the size (in bytes) of the YUV image buffer</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code>java.lang.Exception</code></dd></dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!-- -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../org/libjpegturbo/turbojpeg/package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../index-all.html">Index</a></li>
<li><a href="../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../org/libjpegturbo/turbojpeg/TJTransformer.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">Prev Class</span></a></li>
<li>Next Class</li>
</ul>
<ul class="navList">
<li><a href="../../../index.html?org/libjpegturbo/turbojpeg/YUVImage.html" target="_top">Frames</a></li>
<li><a href="YUVImage.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#field_summary">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field_detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>

View File

@@ -1,51 +1,27 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage --> <!-- NewPage -->
<HTML> <html lang="en">
<HEAD> <head>
<TITLE> <title>org.libjpegturbo.turbojpeg</title>
org.libjpegturbo.turbojpeg <link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
</TITLE> </head>
<body>
<h1 class="bar"><a href="../../../org/libjpegturbo/turbojpeg/package-summary.html" target="classFrame">org.libjpegturbo.turbojpeg</a></h1>
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style"> <div class="indexContainer">
<h2 title="Interfaces">Interfaces</h2>
<ul title="Interfaces">
</HEAD> <li><a href="TJCustomFilter.html" title="interface in org.libjpegturbo.turbojpeg" target="classFrame"><i>TJCustomFilter</i></a></li>
</ul>
<BODY BGCOLOR="white"> <h2 title="Classes">Classes</h2>
<FONT size="+1" CLASS="FrameTitleFont"> <ul title="Classes">
<A HREF="../../../org/libjpegturbo/turbojpeg/package-summary.html" target="classFrame">org.libjpegturbo.turbojpeg</A></FONT> <li><a href="TJ.html" title="class in org.libjpegturbo.turbojpeg" target="classFrame">TJ</a></li>
<TABLE BORDER="0" WIDTH="100%" SUMMARY=""> <li><a href="TJCompressor.html" title="class in org.libjpegturbo.turbojpeg" target="classFrame">TJCompressor</a></li>
<TR> <li><a href="TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg" target="classFrame">TJDecompressor</a></li>
<TD NOWRAP><FONT size="+1" CLASS="FrameHeadingFont"> <li><a href="TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg" target="classFrame">TJScalingFactor</a></li>
Interfaces</FONT>&nbsp; <li><a href="TJTransform.html" title="class in org.libjpegturbo.turbojpeg" target="classFrame">TJTransform</a></li>
<FONT CLASS="FrameItemFont"> <li><a href="TJTransformer.html" title="class in org.libjpegturbo.turbojpeg" target="classFrame">TJTransformer</a></li>
<BR> <li><a href="YUVImage.html" title="class in org.libjpegturbo.turbojpeg" target="classFrame">YUVImage</a></li>
<A HREF="TJCustomFilter.html" title="interface in org.libjpegturbo.turbojpeg" target="classFrame"><I>TJCustomFilter</I></A></FONT></TD> </ul>
</TR> </div>
</TABLE> </body>
</html>
<TABLE BORDER="0" WIDTH="100%" SUMMARY="">
<TR>
<TD NOWRAP><FONT size="+1" CLASS="FrameHeadingFont">
Classes</FONT>&nbsp;
<FONT CLASS="FrameItemFont">
<BR>
<A HREF="TJ.html" title="class in org.libjpegturbo.turbojpeg" target="classFrame">TJ</A>
<BR>
<A HREF="TJCompressor.html" title="class in org.libjpegturbo.turbojpeg" target="classFrame">TJCompressor</A>
<BR>
<A HREF="TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg" target="classFrame">TJDecompressor</A>
<BR>
<A HREF="TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg" target="classFrame">TJScalingFactor</A>
<BR>
<A HREF="TJTransform.html" title="class in org.libjpegturbo.turbojpeg" target="classFrame">TJTransform</A>
<BR>
<A HREF="TJTransformer.html" title="class in org.libjpegturbo.turbojpeg" target="classFrame">TJTransformer</A></FONT></TD>
</TR>
</TABLE>
</BODY>
</HTML>

View File

@@ -1,185 +1,183 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage --> <!-- NewPage -->
<HTML> <html lang="en">
<HEAD> <head>
<TITLE> <title>org.libjpegturbo.turbojpeg</title>
org.libjpegturbo.turbojpeg <link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
</TITLE> </head>
<body>
<script type="text/javascript"><!--
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) { if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="org.libjpegturbo.turbojpeg"; parent.document.title="org.libjpegturbo.turbojpeg";
} }
} //-->
</SCRIPT> </script>
<NOSCRIPT> <noscript>
</NOSCRIPT> <div>JavaScript is disabled on your browser.</div>
</noscript>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ========= START OF TOP NAVBAR ======= --> <!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A> <div class="topNav"><a name="navbar_top">
<A HREF="#skip-navbar_top" title="Skip navigation links"></A> <!-- -->
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<TR> <!-- -->
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> </a>
<A NAME="navbar_top_firstrow"><!-- --></A> <ul class="navList" title="Navigation">
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <li><a href="../../../org/libjpegturbo/turbojpeg/package-summary.html">Package</a></li>
<TR ALIGN="center" VALIGN="top"> <li>Class</li>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../org/libjpegturbo/turbojpeg/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <li><a href="package-tree.html">Tree</a></li>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT>&nbsp;</TD> <li><a href="../../../deprecated-list.html">Deprecated</a></li>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <li><a href="../../../index-all.html">Index</a></li>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <li><a href="../../../help-doc.html">Help</a></li>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> </ul>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </div>
</TR> <div class="subNav">
</TABLE> <ul class="navList">
</TD> <li>Prev Package</li>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> <li>Next Package</li>
</EM> </ul>
</TD> <ul class="navList">
</TR> <li><a href="../../../index.html?org/libjpegturbo/turbojpeg/package-summary.html" target="_top">Frames</a></li>
<li><a href="package-summary.html" target="_top">No Frames</a></li>
<TR> </ul>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <ul class="navList" id="allclasses_navbar_top">
&nbsp;PREV PACKAGE&nbsp; <li><a href="../../../allclasses-noframe.html">All Classes</a></li>
&nbsp;NEXT PACKAGE</FONT></TD> </ul>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <div>
<A HREF="../../../index.html?org/libjpegturbo/turbojpeg/package-summary.html" target="_top"><B>FRAMES</B></A> &nbsp; <script type="text/javascript"><!--
&nbsp;<A HREF="package-summary.html" target="_top"><B>NO FRAMES</B></A> &nbsp; allClassesLink = document.getElementById("allclasses_navbar_top");
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) { if(window==top) {
document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
} }
//--> //-->
</SCRIPT> </script>
<NOSCRIPT> </div>
<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> <a name="skip-navbar_top">
</NOSCRIPT> <!-- -->
</a></div>
</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= --> <!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<HR> <h1 title="Package" class="title">Package&nbsp;org.libjpegturbo.turbojpeg</h1>
<H2> </div>
Package org.libjpegturbo.turbojpeg <div class="contentContainer">
</H2> <ul class="blockList">
<li class="blockList">
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <table class="packageSummary" border="0" cellpadding="3" cellspacing="0" summary="Interface Summary table, listing interfaces, and an explanation">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <caption><span>Interface Summary</span><span class="tabEnd">&nbsp;</span></caption>
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <tr>
<B>Interface Summary</B></FONT></TH> <th class="colFirst" scope="col">Interface</th>
</TR> <th class="colLast" scope="col">Description</th>
<TR BGCOLOR="white" CLASS="TableRowColor"> </tr>
<TD WIDTH="15%"><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJCustomFilter.html" title="interface in org.libjpegturbo.turbojpeg">TJCustomFilter</A></B></TD> <tbody>
<TD>Custom filter callback interface</TD> <tr class="altColor">
</TR> <td class="colFirst"><a href="../../../org/libjpegturbo/turbojpeg/TJCustomFilter.html" title="interface in org.libjpegturbo.turbojpeg">TJCustomFilter</a></td>
</TABLE> <td class="colLast">
&nbsp; <div class="block">Custom filter callback interface</div>
</td>
<P> </tr>
</tbody>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> </table>
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> </li>
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <li class="blockList">
<B>Class Summary</B></FONT></TH> <table class="packageSummary" border="0" cellpadding="3" cellspacing="0" summary="Class Summary table, listing classes, and an explanation">
</TR> <caption><span>Class Summary</span><span class="tabEnd">&nbsp;</span></caption>
<TR BGCOLOR="white" CLASS="TableRowColor"> <tr>
<TD WIDTH="15%"><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</A></B></TD> <th class="colFirst" scope="col">Class</th>
<TD>TurboJPEG utility class (cannot be instantiated)</TD> <th class="colLast" scope="col">Description</th>
</TR> </tr>
<TR BGCOLOR="white" CLASS="TableRowColor"> <tbody>
<TD WIDTH="15%"><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg">TJCompressor</A></B></TD> <tr class="altColor">
<TD>TurboJPEG compressor</TD> <td class="colFirst"><a href="../../../org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></td>
</TR> <td class="colLast">
<TR BGCOLOR="white" CLASS="TableRowColor"> <div class="block">TurboJPEG utility class (cannot be instantiated)</div>
<TD WIDTH="15%"><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</A></B></TD> </td>
<TD>TurboJPEG decompressor</TD> </tr>
</TR> <tr class="rowColor">
<TR BGCOLOR="white" CLASS="TableRowColor"> <td class="colFirst"><a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg">TJCompressor</a></td>
<TD WIDTH="15%"><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg">TJScalingFactor</A></B></TD> <td class="colLast">
<TD>Fractional scaling factor</TD> <div class="block">TurboJPEG compressor</div>
</TR> </td>
<TR BGCOLOR="white" CLASS="TableRowColor"> </tr>
<TD WIDTH="15%"><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</A></B></TD> <tr class="altColor">
<TD>Lossless transform parameters</TD> <td class="colFirst"><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></td>
</TR> <td class="colLast">
<TR BGCOLOR="white" CLASS="TableRowColor"> <div class="block">TurboJPEG decompressor</div>
<TD WIDTH="15%"><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJTransformer.html" title="class in org.libjpegturbo.turbojpeg">TJTransformer</A></B></TD> </td>
<TD>TurboJPEG lossless transformer</TD> </tr>
</TR> <tr class="rowColor">
</TABLE> <td class="colFirst"><a href="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg">TJScalingFactor</a></td>
&nbsp; <td class="colLast">
<div class="block">Fractional scaling factor</div>
<P> </td>
<DL> </tr>
</DL> <tr class="altColor">
<HR> <td class="colFirst"><a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</a></td>
<td class="colLast">
<div class="block">Lossless transform parameters</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../org/libjpegturbo/turbojpeg/TJTransformer.html" title="class in org.libjpegturbo.turbojpeg">TJTransformer</a></td>
<td class="colLast">
<div class="block">TurboJPEG lossless transformer</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a></td>
<td class="colLast">
<div class="block">This class encapsulates a YUV planar image buffer and the metadata
associated with it.</div>
</td>
</tr>
</tbody>
</table>
</li>
</ul>
</div>
<!-- ======= START OF BOTTOM NAVBAR ====== --> <!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A> <div class="bottomNav"><a name="navbar_bottom">
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <!-- -->
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<TR> <!-- -->
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> </a>
<A NAME="navbar_bottom_firstrow"><!-- --></A> <ul class="navList" title="Navigation">
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <li><a href="../../../org/libjpegturbo/turbojpeg/package-summary.html">Package</a></li>
<TR ALIGN="center" VALIGN="top"> <li>Class</li>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../org/libjpegturbo/turbojpeg/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <li><a href="package-tree.html">Tree</a></li>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT>&nbsp;</TD> <li><a href="../../../deprecated-list.html">Deprecated</a></li>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <li><a href="../../../index-all.html">Index</a></li>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <li><a href="../../../help-doc.html">Help</a></li>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> </ul>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </div>
</TR> <div class="subNav">
</TABLE> <ul class="navList">
</TD> <li>Prev Package</li>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> <li>Next Package</li>
</EM> </ul>
</TD> <ul class="navList">
</TR> <li><a href="../../../index.html?org/libjpegturbo/turbojpeg/package-summary.html" target="_top">Frames</a></li>
<li><a href="package-summary.html" target="_top">No Frames</a></li>
<TR> </ul>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <ul class="navList" id="allclasses_navbar_bottom">
&nbsp;PREV PACKAGE&nbsp; <li><a href="../../../allclasses-noframe.html">All Classes</a></li>
&nbsp;NEXT PACKAGE</FONT></TD> </ul>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <div>
<A HREF="../../../index.html?org/libjpegturbo/turbojpeg/package-summary.html" target="_top"><B>FRAMES</B></A> &nbsp; <script type="text/javascript"><!--
&nbsp;<A HREF="package-summary.html" target="_top"><B>NO FRAMES</B></A> &nbsp; allClassesLink = document.getElementById("allclasses_navbar_bottom");
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) { if(window==top) {
document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
} }
//--> //-->
</SCRIPT> </script>
<NOSCRIPT> </div>
<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> <a name="skip-navbar_bottom">
</NOSCRIPT> <!-- -->
</a></div>
</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= --> <!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
<HR> </html>
</BODY>
</HTML>

View File

@@ -1,159 +1,143 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage --> <!-- NewPage -->
<HTML> <html lang="en">
<HEAD> <head>
<TITLE> <title>org.libjpegturbo.turbojpeg Class Hierarchy</title>
org.libjpegturbo.turbojpeg Class Hierarchy <link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
</TITLE> </head>
<body>
<script type="text/javascript"><!--
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) { if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="org.libjpegturbo.turbojpeg Class Hierarchy"; parent.document.title="org.libjpegturbo.turbojpeg Class Hierarchy";
} }
} //-->
</SCRIPT> </script>
<NOSCRIPT> <noscript>
</NOSCRIPT> <div>JavaScript is disabled on your browser.</div>
</noscript>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ========= START OF TOP NAVBAR ======= --> <!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A> <div class="topNav"><a name="navbar_top">
<A HREF="#skip-navbar_top" title="Skip navigation links"></A> <!-- -->
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<TR> <!-- -->
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> </a>
<A NAME="navbar_top_firstrow"><!-- --></A> <ul class="navList" title="Navigation">
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <li><a href="../../../org/libjpegturbo/turbojpeg/package-summary.html">Package</a></li>
<TR ALIGN="center" VALIGN="top"> <li>Class</li>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../org/libjpegturbo/turbojpeg/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <li class="navBarCell1Rev">Tree</li>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT>&nbsp;</TD> <li><a href="../../../deprecated-list.html">Deprecated</a></li>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Tree</B></FONT>&nbsp;</TD> <li><a href="../../../index-all.html">Index</a></li>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <li><a href="../../../help-doc.html">Help</a></li>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> </ul>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </div>
</TR> <div class="subNav">
</TABLE> <ul class="navList">
</TD> <li>Prev</li>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> <li>Next</li>
</EM> </ul>
</TD> <ul class="navList">
</TR> <li><a href="../../../index.html?org/libjpegturbo/turbojpeg/package-tree.html" target="_top">Frames</a></li>
<li><a href="package-tree.html" target="_top">No Frames</a></li>
<TR> </ul>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <ul class="navList" id="allclasses_navbar_top">
&nbsp;PREV&nbsp; <li><a href="../../../allclasses-noframe.html">All Classes</a></li>
&nbsp;NEXT</FONT></TD> </ul>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <div>
<A HREF="../../../index.html?org/libjpegturbo/turbojpeg/package-tree.html" target="_top"><B>FRAMES</B></A> &nbsp; <script type="text/javascript"><!--
&nbsp;<A HREF="package-tree.html" target="_top"><B>NO FRAMES</B></A> &nbsp; allClassesLink = document.getElementById("allclasses_navbar_top");
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) { if(window==top) {
document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
} }
//--> //-->
</SCRIPT> </script>
<NOSCRIPT> </div>
<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> <a name="skip-navbar_top">
</NOSCRIPT> <!-- -->
</a></div>
</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= --> <!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<HR> <h1 class="title">Hierarchy For Package org.libjpegturbo.turbojpeg</h1>
<CENTER> </div>
<H2> <div class="contentContainer">
Hierarchy For Package org.libjpegturbo.turbojpeg <h2 title="Class Hierarchy">Class Hierarchy</h2>
</H2> <ul>
</CENTER> <li type="circle">java.lang.Object
<H2> <ul>
Class Hierarchy <li type="circle">java.awt.geom.RectangularShape (implements java.lang.Cloneable, java.awt.Shape)
</H2> <ul>
<UL> <li type="circle">java.awt.geom.Rectangle2D
<LI TYPE="circle">java.lang.Object<UL> <ul>
<LI TYPE="circle">java.awt.geom.RectangularShape (implements java.lang.Cloneable, java.awt.Shape) <li type="circle">java.awt.Rectangle (implements java.io.Serializable, java.awt.Shape)
<UL> <ul>
<LI TYPE="circle">java.awt.geom.Rectangle2D<UL> <li type="circle">org.libjpegturbo.turbojpeg.<a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">TJTransform</span></a></li>
<LI TYPE="circle">java.awt.Rectangle (implements java.io.Serializable, java.awt.Shape) </ul>
<UL> </li>
<LI TYPE="circle">org.libjpegturbo.turbojpeg.<A HREF="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg"><B>TJTransform</B></A></UL> </ul>
</UL> </li>
</UL> </ul>
<LI TYPE="circle">org.libjpegturbo.turbojpeg.<A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg"><B>TJ</B></A><LI TYPE="circle">org.libjpegturbo.turbojpeg.<A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg"><B>TJCompressor</B></A><LI TYPE="circle">org.libjpegturbo.turbojpeg.<A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg"><B>TJDecompressor</B></A><UL> </li>
<LI TYPE="circle">org.libjpegturbo.turbojpeg.<A HREF="../../../org/libjpegturbo/turbojpeg/TJTransformer.html" title="class in org.libjpegturbo.turbojpeg"><B>TJTransformer</B></A></UL> <li type="circle">org.libjpegturbo.turbojpeg.<a href="../../../org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">TJ</span></a></li>
<LI TYPE="circle">org.libjpegturbo.turbojpeg.<A HREF="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg"><B>TJScalingFactor</B></A></UL> <li type="circle">org.libjpegturbo.turbojpeg.<a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">TJCompressor</span></a></li>
</UL> <li type="circle">org.libjpegturbo.turbojpeg.<a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">TJDecompressor</span></a>
<H2> <ul>
Interface Hierarchy <li type="circle">org.libjpegturbo.turbojpeg.<a href="../../../org/libjpegturbo/turbojpeg/TJTransformer.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">TJTransformer</span></a></li>
</H2> </ul>
<UL> </li>
<LI TYPE="circle">org.libjpegturbo.turbojpeg.<A HREF="../../../org/libjpegturbo/turbojpeg/TJCustomFilter.html" title="interface in org.libjpegturbo.turbojpeg"><B>TJCustomFilter</B></A></UL> <li type="circle">org.libjpegturbo.turbojpeg.<a href="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">TJScalingFactor</span></a></li>
<HR> <li type="circle">org.libjpegturbo.turbojpeg.<a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">YUVImage</span></a></li>
</ul>
</li>
</ul>
<h2 title="Interface Hierarchy">Interface Hierarchy</h2>
<ul>
<li type="circle">org.libjpegturbo.turbojpeg.<a href="../../../org/libjpegturbo/turbojpeg/TJCustomFilter.html" title="interface in org.libjpegturbo.turbojpeg"><span class="strong">TJCustomFilter</span></a></li>
</ul>
</div>
<!-- ======= START OF BOTTOM NAVBAR ====== --> <!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A> <div class="bottomNav"><a name="navbar_bottom">
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <!-- -->
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<TR> <!-- -->
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> </a>
<A NAME="navbar_bottom_firstrow"><!-- --></A> <ul class="navList" title="Navigation">
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <li><a href="../../../org/libjpegturbo/turbojpeg/package-summary.html">Package</a></li>
<TR ALIGN="center" VALIGN="top"> <li>Class</li>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../org/libjpegturbo/turbojpeg/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <li class="navBarCell1Rev">Tree</li>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT>&nbsp;</TD> <li><a href="../../../deprecated-list.html">Deprecated</a></li>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Tree</B></FONT>&nbsp;</TD> <li><a href="../../../index-all.html">Index</a></li>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <li><a href="../../../help-doc.html">Help</a></li>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> </ul>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </div>
</TR> <div class="subNav">
</TABLE> <ul class="navList">
</TD> <li>Prev</li>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> <li>Next</li>
</EM> </ul>
</TD> <ul class="navList">
</TR> <li><a href="../../../index.html?org/libjpegturbo/turbojpeg/package-tree.html" target="_top">Frames</a></li>
<li><a href="package-tree.html" target="_top">No Frames</a></li>
<TR> </ul>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <ul class="navList" id="allclasses_navbar_bottom">
&nbsp;PREV&nbsp; <li><a href="../../../allclasses-noframe.html">All Classes</a></li>
&nbsp;NEXT</FONT></TD> </ul>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <div>
<A HREF="../../../index.html?org/libjpegturbo/turbojpeg/package-tree.html" target="_top"><B>FRAMES</B></A> &nbsp; <script type="text/javascript"><!--
&nbsp;<A HREF="package-tree.html" target="_top"><B>NO FRAMES</B></A> &nbsp; allClassesLink = document.getElementById("allclasses_navbar_bottom");
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) { if(window==top) {
document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
} }
//--> //-->
</SCRIPT> </script>
<NOSCRIPT> </div>
<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> <a name="skip-navbar_bottom">
</NOSCRIPT> <!-- -->
</a></div>
</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= --> <!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
<HR> </html>
</BODY>
</HTML>

View File

@@ -1,161 +1,147 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage --> <!-- NewPage -->
<HTML> <html lang="en">
<HEAD> <head>
<TITLE> <title>Class Hierarchy</title>
Class Hierarchy <link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
</TITLE> </head>
<body>
<script type="text/javascript"><!--
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) { if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Class Hierarchy"; parent.document.title="Class Hierarchy";
} }
} //-->
</SCRIPT> </script>
<NOSCRIPT> <noscript>
</NOSCRIPT> <div>JavaScript is disabled on your browser.</div>
</noscript>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ========= START OF TOP NAVBAR ======= --> <!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A> <div class="topNav"><a name="navbar_top">
<A HREF="#skip-navbar_top" title="Skip navigation links"></A> <!-- -->
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<TR> <!-- -->
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> </a>
<A NAME="navbar_top_firstrow"><!-- --></A> <ul class="navList" title="Navigation">
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <li><a href="org/libjpegturbo/turbojpeg/package-summary.html">Package</a></li>
<TR ALIGN="center" VALIGN="top"> <li>Class</li>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="org/libjpegturbo/turbojpeg/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <li class="navBarCell1Rev">Tree</li>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT>&nbsp;</TD> <li><a href="deprecated-list.html">Deprecated</a></li>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Tree</B></FONT>&nbsp;</TD> <li><a href="index-all.html">Index</a></li>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <li><a href="help-doc.html">Help</a></li>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> </ul>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </div>
</TR> <div class="subNav">
</TABLE> <ul class="navList">
</TD> <li>Prev</li>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> <li>Next</li>
</EM> </ul>
</TD> <ul class="navList">
</TR> <li><a href="index.html?overview-tree.html" target="_top">Frames</a></li>
<li><a href="overview-tree.html" target="_top">No Frames</a></li>
<TR> </ul>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <ul class="navList" id="allclasses_navbar_top">
&nbsp;PREV&nbsp; <li><a href="allclasses-noframe.html">All Classes</a></li>
&nbsp;NEXT</FONT></TD> </ul>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <div>
<A HREF="index.html?overview-tree.html" target="_top"><B>FRAMES</B></A> &nbsp; <script type="text/javascript"><!--
&nbsp;<A HREF="overview-tree.html" target="_top"><B>NO FRAMES</B></A> &nbsp; allClassesLink = document.getElementById("allclasses_navbar_top");
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) { if(window==top) {
document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>'); allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
} }
//--> //-->
</SCRIPT> </script>
<NOSCRIPT> </div>
<A HREF="allclasses-noframe.html"><B>All Classes</B></A> <a name="skip-navbar_top">
</NOSCRIPT> <!-- -->
</a></div>
</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= --> <!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<HR> <h1 class="title">Hierarchy For All Packages</h1>
<CENTER> <span class="strong">Package Hierarchies:</span>
<H2> <ul class="horizontal">
Hierarchy For All Packages</H2> <li><a href="org/libjpegturbo/turbojpeg/package-tree.html">org.libjpegturbo.turbojpeg</a></li>
</CENTER> </ul>
<DL> </div>
<DT><B>Package Hierarchies:</B><DD><A HREF="org/libjpegturbo/turbojpeg/package-tree.html">org.libjpegturbo.turbojpeg</A></DL> <div class="contentContainer">
<HR> <h2 title="Class Hierarchy">Class Hierarchy</h2>
<H2> <ul>
Class Hierarchy <li type="circle">java.lang.Object
</H2> <ul>
<UL> <li type="circle">java.awt.geom.RectangularShape (implements java.lang.Cloneable, java.awt.Shape)
<LI TYPE="circle">java.lang.Object<UL> <ul>
<LI TYPE="circle">java.awt.geom.RectangularShape (implements java.lang.Cloneable, java.awt.Shape) <li type="circle">java.awt.geom.Rectangle2D
<UL> <ul>
<LI TYPE="circle">java.awt.geom.Rectangle2D<UL> <li type="circle">java.awt.Rectangle (implements java.io.Serializable, java.awt.Shape)
<LI TYPE="circle">java.awt.Rectangle (implements java.io.Serializable, java.awt.Shape) <ul>
<UL> <li type="circle">org.libjpegturbo.turbojpeg.<a href="org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">TJTransform</span></a></li>
<LI TYPE="circle">org.libjpegturbo.turbojpeg.<A HREF="org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg"><B>TJTransform</B></A></UL> </ul>
</UL> </li>
</UL> </ul>
<LI TYPE="circle">org.libjpegturbo.turbojpeg.<A HREF="org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg"><B>TJ</B></A><LI TYPE="circle">org.libjpegturbo.turbojpeg.<A HREF="org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg"><B>TJCompressor</B></A><LI TYPE="circle">org.libjpegturbo.turbojpeg.<A HREF="org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg"><B>TJDecompressor</B></A><UL> </li>
<LI TYPE="circle">org.libjpegturbo.turbojpeg.<A HREF="org/libjpegturbo/turbojpeg/TJTransformer.html" title="class in org.libjpegturbo.turbojpeg"><B>TJTransformer</B></A></UL> </ul>
<LI TYPE="circle">org.libjpegturbo.turbojpeg.<A HREF="org/libjpegturbo/turbojpeg/TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg"><B>TJScalingFactor</B></A></UL> </li>
</UL> <li type="circle">org.libjpegturbo.turbojpeg.<a href="org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">TJ</span></a></li>
<H2> <li type="circle">org.libjpegturbo.turbojpeg.<a href="org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">TJCompressor</span></a></li>
Interface Hierarchy <li type="circle">org.libjpegturbo.turbojpeg.<a href="org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">TJDecompressor</span></a>
</H2> <ul>
<UL> <li type="circle">org.libjpegturbo.turbojpeg.<a href="org/libjpegturbo/turbojpeg/TJTransformer.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">TJTransformer</span></a></li>
<LI TYPE="circle">org.libjpegturbo.turbojpeg.<A HREF="org/libjpegturbo/turbojpeg/TJCustomFilter.html" title="interface in org.libjpegturbo.turbojpeg"><B>TJCustomFilter</B></A></UL> </ul>
<HR> </li>
<li type="circle">org.libjpegturbo.turbojpeg.<a href="org/libjpegturbo/turbojpeg/TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">TJScalingFactor</span></a></li>
<li type="circle">org.libjpegturbo.turbojpeg.<a href="org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">YUVImage</span></a></li>
</ul>
</li>
</ul>
<h2 title="Interface Hierarchy">Interface Hierarchy</h2>
<ul>
<li type="circle">org.libjpegturbo.turbojpeg.<a href="org/libjpegturbo/turbojpeg/TJCustomFilter.html" title="interface in org.libjpegturbo.turbojpeg"><span class="strong">TJCustomFilter</span></a></li>
</ul>
</div>
<!-- ======= START OF BOTTOM NAVBAR ====== --> <!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A> <div class="bottomNav"><a name="navbar_bottom">
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <!-- -->
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<TR> <!-- -->
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> </a>
<A NAME="navbar_bottom_firstrow"><!-- --></A> <ul class="navList" title="Navigation">
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <li><a href="org/libjpegturbo/turbojpeg/package-summary.html">Package</a></li>
<TR ALIGN="center" VALIGN="top"> <li>Class</li>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="org/libjpegturbo/turbojpeg/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <li class="navBarCell1Rev">Tree</li>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT>&nbsp;</TD> <li><a href="deprecated-list.html">Deprecated</a></li>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Tree</B></FONT>&nbsp;</TD> <li><a href="index-all.html">Index</a></li>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <li><a href="help-doc.html">Help</a></li>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> </ul>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </div>
</TR> <div class="subNav">
</TABLE> <ul class="navList">
</TD> <li>Prev</li>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> <li>Next</li>
</EM> </ul>
</TD> <ul class="navList">
</TR> <li><a href="index.html?overview-tree.html" target="_top">Frames</a></li>
<li><a href="overview-tree.html" target="_top">No Frames</a></li>
<TR> </ul>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <ul class="navList" id="allclasses_navbar_bottom">
&nbsp;PREV&nbsp; <li><a href="allclasses-noframe.html">All Classes</a></li>
&nbsp;NEXT</FONT></TD> </ul>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <div>
<A HREF="index.html?overview-tree.html" target="_top"><B>FRAMES</B></A> &nbsp; <script type="text/javascript"><!--
&nbsp;<A HREF="overview-tree.html" target="_top"><B>NO FRAMES</B></A> &nbsp; allClassesLink = document.getElementById("allclasses_navbar_bottom");
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) { if(window==top) {
document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>'); allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
} }
//--> //-->
</SCRIPT> </script>
<NOSCRIPT> </div>
<A HREF="allclasses-noframe.html"><B>All Classes</B></A> <a name="skip-navbar_bottom">
</NOSCRIPT> <!-- -->
</a></div>
</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= --> <!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
<HR> </html>
</BODY>
</HTML>

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 57 B

BIN
java/doc/resources/tab.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 291 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 849 B

View File

@@ -1,200 +1,150 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage --> <!-- NewPage -->
<HTML> <html lang="en">
<HEAD> <head>
<TITLE> <title>Serialized Form</title>
Serialized Form <link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
</TITLE> </head>
<body>
<script type="text/javascript"><!--
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) { if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Serialized Form"; parent.document.title="Serialized Form";
} }
} //-->
</SCRIPT> </script>
<NOSCRIPT> <noscript>
</NOSCRIPT> <div>JavaScript is disabled on your browser.</div>
</noscript>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ========= START OF TOP NAVBAR ======= --> <!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A> <div class="topNav"><a name="navbar_top">
<A HREF="#skip-navbar_top" title="Skip navigation links"></A> <!-- -->
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<TR> <!-- -->
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> </a>
<A NAME="navbar_top_firstrow"><!-- --></A> <ul class="navList" title="Navigation">
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <li><a href="org/libjpegturbo/turbojpeg/package-summary.html">Package</a></li>
<TR ALIGN="center" VALIGN="top"> <li>Class</li>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="org/libjpegturbo/turbojpeg/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <li><a href="org/libjpegturbo/turbojpeg/package-tree.html">Tree</a></li>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT>&nbsp;</TD> <li><a href="deprecated-list.html">Deprecated</a></li>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="org/libjpegturbo/turbojpeg/package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <li><a href="index-all.html">Index</a></li>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <li><a href="help-doc.html">Help</a></li>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> </ul>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </div>
</TR> <div class="subNav">
</TABLE> <ul class="navList">
</TD> <li>Prev</li>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> <li>Next</li>
</EM> </ul>
</TD> <ul class="navList">
</TR> <li><a href="index.html?serialized-form.html" target="_top">Frames</a></li>
<li><a href="serialized-form.html" target="_top">No Frames</a></li>
<TR> </ul>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <ul class="navList" id="allclasses_navbar_top">
&nbsp;PREV&nbsp; <li><a href="allclasses-noframe.html">All Classes</a></li>
&nbsp;NEXT</FONT></TD> </ul>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <div>
<A HREF="index.html?serialized-form.html" target="_top"><B>FRAMES</B></A> &nbsp; <script type="text/javascript"><!--
&nbsp;<A HREF="serialized-form.html" target="_top"><B>NO FRAMES</B></A> &nbsp; allClassesLink = document.getElementById("allclasses_navbar_top");
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) { if(window==top) {
document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>'); allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
} }
//--> //-->
</SCRIPT> </script>
<NOSCRIPT> </div>
<A HREF="allclasses-noframe.html"><B>All Classes</B></A> <a name="skip-navbar_top">
</NOSCRIPT> <!-- -->
</a></div>
</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= --> <!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<HR> <h1 title="Serialized Form" class="title">Serialized Form</h1>
<CENTER> </div>
<H1> <div class="serializedFormContainer">
Serialized Form</H1> <ul class="blockList">
</CENTER> <li class="blockList">
<HR SIZE="4" NOSHADE> <h2 title="Package">Package&nbsp;org.libjpegturbo.turbojpeg</h2>
<ul class="blockList">
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <li class="blockList"><a name="org.libjpegturbo.turbojpeg.TJTransform">
<TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"> <!-- -->
<TH ALIGN="center"><FONT SIZE="+2"> </a>
<B>Package</B> <B>org.libjpegturbo.turbojpeg</B></FONT></TH> <h3>Class <a href="org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">org.libjpegturbo.turbojpeg.TJTransform</a> extends java.awt.Rectangle implements Serializable</h3>
</TR> <dl class="nameValue">
</TABLE> <dt>serialVersionUID:</dt>
<dd>-127367705761430371L</dd>
<P> </dl>
<A NAME="org.libjpegturbo.turbojpeg.TJTransform"><!-- --></A> <ul class="blockList">
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <li class="blockList"><a name="serializedForm">
<TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"> <!-- -->
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> </a>
<B>Class <A HREF="org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">org.libjpegturbo.turbojpeg.TJTransform</A> extends java.awt.Rectangle implements Serializable</B></FONT></TH> <h3>Serialized Fields</h3>
</TR> <ul class="blockList">
</TABLE> <li class="blockList">
<h4>op</h4>
<P> <pre>int op</pre>
<B>serialVersionUID:&nbsp;</B>-127367705761430371L <div class="block">Transform operation (one of <code>OP_*</code>)</div>
</li>
<P> <li class="blockList">
<A NAME="serializedForm"><!-- --></A> <h4>options</h4>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <pre>int options</pre>
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <div class="block">Transform options (bitwise OR of one or more of <code>OPT_*</code>)</div>
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> </li>
<B>Serialized Fields</B></FONT></TH> <li class="blockListLast">
</TR> <h4>cf</h4>
</TABLE> <pre><a href="org/libjpegturbo/turbojpeg/TJCustomFilter.html" title="interface in org.libjpegturbo.turbojpeg">TJCustomFilter</a> cf</pre>
<div class="block">Custom filter instance</div>
<H3> </li>
op</H3> </ul>
<PRE> </li>
int <B>op</B></PRE> </ul>
<DL> </li>
<DD>Transform operation (one of <code>OP_*</code>) </ul>
<P> </li>
<DL> </ul>
</DL> </div>
</DL>
<HR>
<H3>
options</H3>
<PRE>
int <B>options</B></PRE>
<DL>
<DD>Transform options (bitwise OR of one or more of <code>OPT_*</code>)
<P>
<DL>
</DL>
</DL>
<HR>
<H3>
cf</H3>
<PRE>
<A HREF="org/libjpegturbo/turbojpeg/TJCustomFilter.html" title="interface in org.libjpegturbo.turbojpeg">TJCustomFilter</A> <B>cf</B></PRE>
<DL>
<DD>Custom filter instance
<P>
<DL>
</DL>
</DL>
<P>
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== --> <!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A> <div class="bottomNav"><a name="navbar_bottom">
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <!-- -->
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<TR> <!-- -->
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> </a>
<A NAME="navbar_bottom_firstrow"><!-- --></A> <ul class="navList" title="Navigation">
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <li><a href="org/libjpegturbo/turbojpeg/package-summary.html">Package</a></li>
<TR ALIGN="center" VALIGN="top"> <li>Class</li>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="org/libjpegturbo/turbojpeg/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <li><a href="org/libjpegturbo/turbojpeg/package-tree.html">Tree</a></li>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT>&nbsp;</TD> <li><a href="deprecated-list.html">Deprecated</a></li>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="org/libjpegturbo/turbojpeg/package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <li><a href="index-all.html">Index</a></li>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <li><a href="help-doc.html">Help</a></li>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> </ul>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </div>
</TR> <div class="subNav">
</TABLE> <ul class="navList">
</TD> <li>Prev</li>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> <li>Next</li>
</EM> </ul>
</TD> <ul class="navList">
</TR> <li><a href="index.html?serialized-form.html" target="_top">Frames</a></li>
<li><a href="serialized-form.html" target="_top">No Frames</a></li>
<TR> </ul>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <ul class="navList" id="allclasses_navbar_bottom">
&nbsp;PREV&nbsp; <li><a href="allclasses-noframe.html">All Classes</a></li>
&nbsp;NEXT</FONT></TD> </ul>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <div>
<A HREF="index.html?serialized-form.html" target="_top"><B>FRAMES</B></A> &nbsp; <script type="text/javascript"><!--
&nbsp;<A HREF="serialized-form.html" target="_top"><B>NO FRAMES</B></A> &nbsp; allClassesLink = document.getElementById("allclasses_navbar_bottom");
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) { if(window==top) {
document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>'); allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
} }
//--> //-->
</SCRIPT> </script>
<NOSCRIPT> </div>
<A HREF="allclasses-noframe.html"><B>All Classes</B></A> <a name="skip-navbar_bottom">
</NOSCRIPT> <!-- -->
</a></div>
</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= --> <!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
<HR> </html>
</BODY>
</HTML>

View File

@@ -1,29 +1,474 @@
/* Javadoc style sheet */ /* Javadoc style sheet */
/*
/* Define colors, fonts and other style attributes here to override the defaults */ Overall document style
*/
/* Page background color */ body {
body { background-color: #FFFFFF; color:#000000 } background-color:#ffffff;
color:#353833;
/* Headings */ font-family:Arial, Helvetica, sans-serif;
h1 { font-size: 145% } font-size:76%;
margin:0;
/* Table colors */ }
.TableHeadingColor { background: #CCCCFF; color:#000000 } /* Dark mauve */ a:link, a:visited {
.TableSubHeadingColor { background: #EEEEFF; color:#000000 } /* Light mauve */ text-decoration:none;
.TableRowColor { background: #FFFFFF; color:#000000 } /* White */ color:#4c6b87;
}
/* Font used in left-hand frame lists */ a:hover, a:focus {
.FrameTitleFont { font-size: 100%; font-family: Helvetica, Arial, sans-serif; color:#000000 } text-decoration:none;
.FrameHeadingFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif; color:#000000 } color:#bb7a2a;
.FrameItemFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif; color:#000000 } }
a:active {
/* Navigation bar fonts and colors */ text-decoration:none;
.NavBarCell1 { background-color:#EEEEFF; color:#000000} /* Light mauve */ color:#4c6b87;
.NavBarCell1Rev { background-color:#00008B; color:#FFFFFF} /* Dark Blue */ }
.NavBarFont1 { font-family: Arial, Helvetica, sans-serif; color:#000000;color:#000000;} a[name] {
.NavBarFont1Rev { font-family: Arial, Helvetica, sans-serif; color:#FFFFFF;color:#FFFFFF;} color:#353833;
}
.NavBarCell2 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF; color:#000000} a[name]:hover {
.NavBarCell3 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF; color:#000000} text-decoration:none;
color:#353833;
}
pre {
font-size:1.3em;
}
h1 {
font-size:1.8em;
}
h2 {
font-size:1.5em;
}
h3 {
font-size:1.4em;
}
h4 {
font-size:1.3em;
}
h5 {
font-size:1.2em;
}
h6 {
font-size:1.1em;
}
ul {
list-style-type:disc;
}
code, tt {
font-size:1.2em;
}
dt code {
font-size:1.2em;
}
table tr td dt code {
font-size:1.2em;
vertical-align:top;
}
sup {
font-size:.6em;
}
/*
Document title and Copyright styles
*/
.clear {
clear:both;
height:0px;
overflow:hidden;
}
.aboutLanguage {
float:right;
padding:0px 21px;
font-size:.8em;
z-index:200;
margin-top:-7px;
}
.legalCopy {
margin-left:.5em;
}
.bar a, .bar a:link, .bar a:visited, .bar a:active {
color:#FFFFFF;
text-decoration:none;
}
.bar a:hover, .bar a:focus {
color:#bb7a2a;
}
.tab {
background-color:#0066FF;
background-image:url(resources/titlebar.gif);
background-position:left top;
background-repeat:no-repeat;
color:#ffffff;
padding:8px;
width:5em;
font-weight:bold;
}
/*
Navigation bar styles
*/
.bar {
background-image:url(resources/background.gif);
background-repeat:repeat-x;
color:#FFFFFF;
padding:.8em .5em .4em .8em;
height:auto;/*height:1.8em;*/
font-size:1em;
margin:0;
}
.topNav {
background-image:url(resources/background.gif);
background-repeat:repeat-x;
color:#FFFFFF;
float:left;
padding:0;
width:100%;
clear:right;
height:2.8em;
padding-top:10px;
overflow:hidden;
}
.bottomNav {
margin-top:10px;
background-image:url(resources/background.gif);
background-repeat:repeat-x;
color:#FFFFFF;
float:left;
padding:0;
width:100%;
clear:right;
height:2.8em;
padding-top:10px;
overflow:hidden;
}
.subNav {
background-color:#dee3e9;
border-bottom:1px solid #9eadc0;
float:left;
width:100%;
overflow:hidden;
}
.subNav div {
clear:left;
float:left;
padding:0 0 5px 6px;
}
ul.navList, ul.subNavList {
float:left;
margin:0 25px 0 0;
padding:0;
}
ul.navList li{
list-style:none;
float:left;
padding:3px 6px;
}
ul.subNavList li{
list-style:none;
float:left;
font-size:90%;
}
.topNav a:link, .topNav a:active, .topNav a:visited, .bottomNav a:link, .bottomNav a:active, .bottomNav a:visited {
color:#FFFFFF;
text-decoration:none;
}
.topNav a:hover, .bottomNav a:hover {
text-decoration:none;
color:#bb7a2a;
}
.navBarCell1Rev {
background-image:url(resources/tab.gif);
background-color:#a88834;
color:#FFFFFF;
margin: auto 5px;
border:1px solid #c9aa44;
}
/*
Page header and footer styles
*/
.header, .footer {
clear:both;
margin:0 20px;
padding:5px 0 0 0;
}
.indexHeader {
margin:10px;
position:relative;
}
.indexHeader h1 {
font-size:1.3em;
}
.title {
color:#2c4557;
margin:10px 0;
}
.subTitle {
margin:5px 0 0 0;
}
.header ul {
margin:0 0 25px 0;
padding:0;
}
.footer ul {
margin:20px 0 5px 0;
}
.header ul li, .footer ul li {
list-style:none;
font-size:1.2em;
}
/*
Heading styles
*/
div.details ul.blockList ul.blockList ul.blockList li.blockList h4, div.details ul.blockList ul.blockList ul.blockListLast li.blockList h4 {
background-color:#dee3e9;
border-top:1px solid #9eadc0;
border-bottom:1px solid #9eadc0;
margin:0 0 6px -8px;
padding:2px 5px;
}
ul.blockList ul.blockList ul.blockList li.blockList h3 {
background-color:#dee3e9;
border-top:1px solid #9eadc0;
border-bottom:1px solid #9eadc0;
margin:0 0 6px -8px;
padding:2px 5px;
}
ul.blockList ul.blockList li.blockList h3 {
padding:0;
margin:15px 0;
}
ul.blockList li.blockList h2 {
padding:0px 0 20px 0;
}
/*
Page layout container styles
*/
.contentContainer, .sourceContainer, .classUseContainer, .serializedFormContainer, .constantValuesContainer {
clear:both;
padding:10px 20px;
position:relative;
}
.indexContainer {
margin:10px;
position:relative;
font-size:1.0em;
}
.indexContainer h2 {
font-size:1.1em;
padding:0 0 3px 0;
}
.indexContainer ul {
margin:0;
padding:0;
}
.indexContainer ul li {
list-style:none;
}
.contentContainer .description dl dt, .contentContainer .details dl dt, .serializedFormContainer dl dt {
font-size:1.1em;
font-weight:bold;
margin:10px 0 0 0;
color:#4E4E4E;
}
.contentContainer .description dl dd, .contentContainer .details dl dd, .serializedFormContainer dl dd {
margin:10px 0 10px 20px;
}
.serializedFormContainer dl.nameValue dt {
margin-left:1px;
font-size:1.1em;
display:inline;
font-weight:bold;
}
.serializedFormContainer dl.nameValue dd {
margin:0 0 0 1px;
font-size:1.1em;
display:inline;
}
/*
List styles
*/
ul.horizontal li {
display:inline;
font-size:0.9em;
}
ul.inheritance {
margin:0;
padding:0;
}
ul.inheritance li {
display:inline;
list-style:none;
}
ul.inheritance li ul.inheritance {
margin-left:15px;
padding-left:15px;
padding-top:1px;
}
ul.blockList, ul.blockListLast {
margin:10px 0 10px 0;
padding:0;
}
ul.blockList li.blockList, ul.blockListLast li.blockList {
list-style:none;
margin-bottom:25px;
}
ul.blockList ul.blockList li.blockList, ul.blockList ul.blockListLast li.blockList {
padding:0px 20px 5px 10px;
border:1px solid #9eadc0;
background-color:#f9f9f9;
}
ul.blockList ul.blockList ul.blockList li.blockList, ul.blockList ul.blockList ul.blockListLast li.blockList {
padding:0 0 5px 8px;
background-color:#ffffff;
border:1px solid #9eadc0;
border-top:none;
}
ul.blockList ul.blockList ul.blockList ul.blockList li.blockList {
margin-left:0;
padding-left:0;
padding-bottom:15px;
border:none;
border-bottom:1px solid #9eadc0;
}
ul.blockList ul.blockList ul.blockList ul.blockList li.blockListLast {
list-style:none;
border-bottom:none;
padding-bottom:0;
}
table tr td dl, table tr td dl dt, table tr td dl dd {
margin-top:0;
margin-bottom:1px;
}
/*
Table styles
*/
.contentContainer table, .classUseContainer table, .constantValuesContainer table {
border-bottom:1px solid #9eadc0;
width:100%;
}
.contentContainer ul li table, .classUseContainer ul li table, .constantValuesContainer ul li table {
width:100%;
}
.contentContainer .description table, .contentContainer .details table {
border-bottom:none;
}
.contentContainer ul li table th.colOne, .contentContainer ul li table th.colFirst, .contentContainer ul li table th.colLast, .classUseContainer ul li table th, .constantValuesContainer ul li table th, .contentContainer ul li table td.colOne, .contentContainer ul li table td.colFirst, .contentContainer ul li table td.colLast, .classUseContainer ul li table td, .constantValuesContainer ul li table td{
vertical-align:top;
padding-right:20px;
}
.contentContainer ul li table th.colLast, .classUseContainer ul li table th.colLast,.constantValuesContainer ul li table th.colLast,
.contentContainer ul li table td.colLast, .classUseContainer ul li table td.colLast,.constantValuesContainer ul li table td.colLast,
.contentContainer ul li table th.colOne, .classUseContainer ul li table th.colOne,
.contentContainer ul li table td.colOne, .classUseContainer ul li table td.colOne {
padding-right:3px;
}
.overviewSummary caption, .packageSummary caption, .contentContainer ul.blockList li.blockList caption, .summary caption, .classUseContainer caption, .constantValuesContainer caption {
position:relative;
text-align:left;
background-repeat:no-repeat;
color:#FFFFFF;
font-weight:bold;
clear:none;
overflow:hidden;
padding:0px;
margin:0px;
}
caption a:link, caption a:hover, caption a:active, caption a:visited {
color:#FFFFFF;
}
.overviewSummary caption span, .packageSummary caption span, .contentContainer ul.blockList li.blockList caption span, .summary caption span, .classUseContainer caption span, .constantValuesContainer caption span {
white-space:nowrap;
padding-top:8px;
padding-left:8px;
display:block;
float:left;
background-image:url(resources/titlebar.gif);
height:18px;
}
.overviewSummary .tabEnd, .packageSummary .tabEnd, .contentContainer ul.blockList li.blockList .tabEnd, .summary .tabEnd, .classUseContainer .tabEnd, .constantValuesContainer .tabEnd {
width:10px;
background-image:url(resources/titlebar_end.gif);
background-repeat:no-repeat;
background-position:top right;
position:relative;
float:left;
}
ul.blockList ul.blockList li.blockList table {
margin:0 0 12px 0px;
width:100%;
}
.tableSubHeadingColor {
background-color: #EEEEFF;
}
.altColor {
background-color:#eeeeef;
}
.rowColor {
background-color:#ffffff;
}
.overviewSummary td, .packageSummary td, .contentContainer ul.blockList li.blockList td, .summary td, .classUseContainer td, .constantValuesContainer td {
text-align:left;
padding:3px 3px 3px 7px;
}
th.colFirst, th.colLast, th.colOne, .constantValuesContainer th {
background:#dee3e9;
border-top:1px solid #9eadc0;
border-bottom:1px solid #9eadc0;
text-align:left;
padding:3px 3px 3px 7px;
}
td.colOne a:link, td.colOne a:active, td.colOne a:visited, td.colOne a:hover, td.colFirst a:link, td.colFirst a:active, td.colFirst a:visited, td.colFirst a:hover, td.colLast a:link, td.colLast a:active, td.colLast a:visited, td.colLast a:hover, .constantValuesContainer td a:link, .constantValuesContainer td a:active, .constantValuesContainer td a:visited, .constantValuesContainer td a:hover {
font-weight:bold;
}
td.colFirst, th.colFirst {
border-left:1px solid #9eadc0;
white-space:nowrap;
}
td.colLast, th.colLast {
border-right:1px solid #9eadc0;
}
td.colOne, th.colOne {
border-right:1px solid #9eadc0;
border-left:1px solid #9eadc0;
}
table.overviewSummary {
padding:0px;
margin-left:0px;
}
table.overviewSummary td.colFirst, table.overviewSummary th.colFirst,
table.overviewSummary td.colOne, table.overviewSummary th.colOne {
width:25%;
vertical-align:middle;
}
table.packageSummary td.colFirst, table.overviewSummary th.colFirst {
width:25%;
vertical-align:middle;
}
/*
Content styles
*/
.description pre {
margin-top:0;
}
.deprecatedContent {
margin:0;
padding:10px 0;
}
.docSummary {
padding:0;
}
/*
Formatting effect styles
*/
.sourceLineNo {
color:green;
padding:0 30px 0 0;
}
h1.hidden {
visibility:hidden;
overflow:hidden;
font-size:.9em;
}
.block {
display:block;
margin:3px 0 0 0;
}
.strong {
font-weight:bold;
}

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C)2011-2013 D. R. Commander. All Rights Reserved. * Copyright (C)2011-2014 D. R. Commander. All Rights Reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are met:
@@ -48,28 +48,7 @@ public class TJCompressor {
/** /**
* Create a TurboJPEG compressor instance and associate the uncompressed * Create a TurboJPEG compressor instance and associate the uncompressed
* source image stored in <code>srcImage</code> with the newly-created * source image stored in <code>srcImage</code> with the newly created
* instance.
*
* @param srcImage see {@link #setSourceImage} for description
*
* @param width see {@link #setSourceImage} for description
*
* @param pitch see {@link #setSourceImage} for description
*
* @param height see {@link #setSourceImage} for description
*
* @param pixelFormat pixel format of the source image (one of
* {@link TJ TJ.PF_*})
*/
public TJCompressor(byte[] srcImage, int width, int pitch, int height,
int pixelFormat) throws Exception {
setSourceImage(srcImage, width, pitch, height, pixelFormat);
}
/**
* Create a TurboJPEG compressor instance and associate the uncompressed
* source image stored in <code>srcImage</code> with the newly-created
* instance. * instance.
* *
* @param srcImage see {@link #setSourceImage} for description * @param srcImage see {@link #setSourceImage} for description
@@ -85,7 +64,7 @@ public class TJCompressor {
* @param height see {@link #setSourceImage} for description * @param height see {@link #setSourceImage} for description
* *
* @param pixelFormat pixel format of the source image (one of * @param pixelFormat pixel format of the source image (one of
* {@link TJ TJ.PF_*}) * {@link TJ#PF_RGB TJ.PF_*})
*/ */
public TJCompressor(byte[] srcImage, int x, int y, int width, int pitch, public TJCompressor(byte[] srcImage, int x, int y, int width, int pitch,
int height, int pixelFormat) throws Exception { int height, int pixelFormat) throws Exception {
@@ -93,34 +72,70 @@ public class TJCompressor {
} }
/** /**
* Associate an uncompressed source image with this compressor instance. * @deprecated Use
* {@link #TJCompressor(byte[], int, int, int, int, int, int)} instead.
*/
@Deprecated
public TJCompressor(byte[] srcImage, int width, int pitch, int height,
int pixelFormat) throws Exception {
setSourceImage(srcImage, width, pitch, height, pixelFormat);
}
/**
* Create a TurboJPEG compressor instance and associate the uncompressed
* source image stored in <code>srcImage</code> with the newly created
* instance.
*
* @param srcImage see
* {@link #setSourceImage(BufferedImage, int, int, int, int)} for description
*
* @param x see
* {@link #setSourceImage(BufferedImage, int, int, int, int)} for description
*
* @param y see
* {@link #setSourceImage(BufferedImage, int, int, int, int)} for description
*
* @param width see
* {@link #setSourceImage(BufferedImage, int, int, int, int)} for description
*
* @param height see
* {@link #setSourceImage(BufferedImage, int, int, int, int)} for description
*/
public TJCompressor(BufferedImage srcImage, int x, int y, int width,
int height) throws Exception {
setSourceImage(srcImage, x, y, width, height);
}
/**
* Associate an uncompressed RGB, grayscale, or CMYK source image with this
* compressor instance.
* *
* @param srcImage image buffer containing RGB, grayscale, or CMYK pixels to * @param srcImage image buffer containing RGB, grayscale, or CMYK pixels to
* be compressed * be compressed or encoded
* *
* @param x x offset (in pixels) of the region from which the JPEG image * @param x x offset (in pixels) of the region in the source image from which
* should be compressed, relative to the start of <code>srcImage</code>. * the JPEG or YUV image should be compressed/encoded
* *
* @param y y offset (in pixels) of the region from which the JPEG image * @param y y offset (in pixels) of the region in the source image from which
* should be compressed, relative to the start of <code>srcImage</code>. * the JPEG or YUV image should be compressed/encoded
* *
* @param width width (in pixels) of the region in the source image from * @param width width (in pixels) of the region in the source image from
* which the JPEG image should be compressed. * which the JPEG or YUV image should be compressed/encoded
* *
* @param pitch bytes per line of the source image. Normally, this should be * @param pitch bytes per line of the source image. Normally, this should be
* <code>width * TJ.pixelSize(pixelFormat)</code> if the source image is * <code>width * TJ.pixelSize(pixelFormat)</code> if the source image is
* unpadded, but you can use this parameter to, for instance, specify that * unpadded, but you can use this parameter to, for instance, specify that
* the scanlines in the source image are padded to a 4-byte boundary or to * the scanlines in the source image are padded to a 4-byte boundary or to
* compress a JPEG image from a region of a larger source image. You can * compress/encode a JPEG or YUV image from a region of a larger source
* also be clever and use this parameter to skip lines, etc. Setting this * image. You can also be clever and use this parameter to skip lines, etc.
* parameter to 0 is the equivalent of setting it to <code>width * * Setting this parameter to 0 is the equivalent of setting it to
* TJ.pixelSize(pixelFormat)</code>. * <code>width * TJ.pixelSize(pixelFormat)</code>.
* *
* @param height height (in pixels) of the region in the source image from * @param height height (in pixels) of the region in the source image from
* which the JPEG image should be compressed. * which the JPEG or YUV image should be compressed/encoded
* *
* @param pixelFormat pixel format of the source image (one of * @param pixelFormat pixel format of the source image (one of
* {@link TJ TJ.PF_*}) * {@link TJ#PF_RGB TJ.PF_*})
*/ */
public void setSourceImage(byte[] srcImage, int x, int y, int width, public void setSourceImage(byte[] srcImage, int x, int y, int width,
int pitch, int height, int pixelFormat) int pitch, int height, int pixelFormat)
@@ -139,7 +154,8 @@ public class TJCompressor {
srcPixelFormat = pixelFormat; srcPixelFormat = pixelFormat;
srcX = x; srcX = x;
srcY = y; srcY = y;
srcIsYUV = false; srcBufInt = null;
srcYUVImage = null;
} }
/** /**
@@ -154,147 +170,38 @@ public class TJCompressor {
} }
/** /**
* Associate an uncompressed YUV planar source image with this compressor * Associate an uncompressed RGB or grayscale source image with this
* instance. * compressor instance.
*
* @param srcImage image buffer containing a YUV planar image to be
* compressed. The Y, U (Cb), and V (Cr) image planes should be stored
* sequentially in the buffer, and the size of each plane is determined by
* the specified width, height, and padding, as well as the level of
* chrominance subsampling (specified using {@link #setSubsamp}.) If the
* chrominance components are subsampled along the horizontal dimension, then
* the width of the luminance plane should be padded to the nearest multiple
* of 2 (same goes for the height of the luminance plane, if the chrominance
* components are subsampled along the vertical dimension.) This is
* irrespective of any additional padding specified in the <code>pad</code>
* parameter.
*
* @param width width (in pixels) of the source image
*
* @param pad the line padding used in the source image. For instance, if
* each line in each plane of the YUV image is padded to the nearest multiple
* of 4 bytes, then <code>pad</code> should be set to 4.
*
* @param height height (in pixels) of the source image
*/
public void setSourceImageYUV(byte[] srcImage, int width, int pad,
int height) throws Exception {
if (handle == 0) init();
if (srcImage == null || width < 1 || pad < 1 || height < 1)
throw new Exception("Invalid argument in setSourceImageYUV()");
srcBuf = srcImage;
srcWidth = width;
srcYUVPad = pad;
srcHeight = height;
srcIsYUV = true;
}
/**
* Set the level of chrominance subsampling for subsequent compress/encode
* operations. When pixels are converted from RGB to YCbCr (see
* {@link TJ#CS_YCbCr}) or from CMYK to YCCK (see {@link TJ#CS_YCCK}) as part
* of the JPEG compression process, some of the Cb and Cr (chrominance)
* components can be discarded or averaged together to produce a smaller
* image with little perceptible loss of image clarity (the human eye is more
* sensitive to small changes in brightness than to small changes in color.)
* This is called "chrominance subsampling".
* <p>
* NOTE: When compressing a YUV planar image into a JPEG image, this method
* also specifies the level of chrominance subsampling used in the source
* image.
*
* @param newSubsamp the new level of chrominance subsampling (one of
* {@link TJ TJ.SAMP_*})
*/
public void setSubsamp(int newSubsamp) throws Exception {
if (newSubsamp < 0 || newSubsamp >= TJ.NUMSAMP)
throw new Exception("Invalid argument in setSubsamp()");
subsamp = newSubsamp;
}
/**
* Set the JPEG image quality level for subsequent compress operations.
*
* @param quality the new JPEG image quality level (1 to 100, 1 = worst,
* 100 = best)
*/
public void setJPEGQuality(int quality) throws Exception {
if (quality < 1 || quality > 100)
throw new Exception("Invalid argument in setJPEGQuality()");
jpegQuality = quality;
}
/**
* Compress the uncompressed source image associated with this compressor
* instance and output a JPEG image to the given destination buffer.
*
* @param dstBuf buffer that will receive the JPEG image. Use
* {@link TJ#bufSize} to determine the maximum size for this buffer based on
* the image width, height, and level of chrominance subsampling.
*
* @param flags the bitwise OR of one or more of {@link TJ TJ.FLAG_*}
*/
public void compress(byte[] dstBuf, int flags) throws Exception {
if (dstBuf == null || flags < 0)
throw new Exception("Invalid argument in compress()");
if (srcBuf == null)
throw new Exception(NO_ASSOC_ERROR);
if (jpegQuality < 0)
throw new Exception("JPEG Quality not set");
if (subsamp < 0)
throw new Exception("Subsampling level not set");
if (srcIsYUV)
compressedSize = compressFromYUV(srcBuf, srcWidth, srcYUVPad, srcHeight,
subsamp, dstBuf, jpegQuality, flags);
else {
if (srcX >= 0 && srcY >= 0)
compressedSize = compress(srcBuf, srcX, srcY, srcWidth, srcPitch,
srcHeight, srcPixelFormat, dstBuf, subsamp,
jpegQuality, flags);
else
compressedSize = compress(srcBuf, srcWidth, srcPitch, srcHeight,
srcPixelFormat, dstBuf, subsamp, jpegQuality,
flags);
}
}
/**
* Compress the uncompressed source image associated with this compressor
* instance and return a buffer containing a JPEG image.
*
* @param flags the bitwise OR of one or more of {@link TJ TJ.FLAG_*}
*
* @return a buffer containing a JPEG image. The length of this buffer will
* not be equal to the size of the JPEG image. Use {@link
* #getCompressedSize} to obtain the size of the JPEG image.
*/
public byte[] compress(int flags) throws Exception {
if (srcWidth < 1 || srcHeight < 1)
throw new Exception(NO_ASSOC_ERROR);
byte[] buf = new byte[TJ.bufSize(srcWidth, srcHeight, subsamp)];
compress(buf, flags);
return buf;
}
/**
* Compress the uncompressed source image stored in <code>srcImage</code>
* and output a JPEG image to the given destination buffer.
* *
* @param srcImage a <code>BufferedImage</code> instance containing RGB or * @param srcImage a <code>BufferedImage</code> instance containing RGB or
* grayscale pixels to be compressed * grayscale pixels to be compressed or encoded
* *
* @param dstBuf buffer that will receive the JPEG image. Use * @param x x offset (in pixels) of the region in the source image from which
* {@link TJ#bufSize} to determine the maximum size for this buffer based on * the JPEG or YUV image should be compressed/encoded
* the image width, height, and level of chrominance subsampling.
* *
* @param flags the bitwise OR of one or more of {@link TJ TJ.FLAG_*} * @param y y offset (in pixels) of the region in the source image from which
* the JPEG or YUV image should be compressed/encoded
*
* @param width width (in pixels) of the region in the source image from
* which the JPEG or YUV image should be compressed/encoded (0 = use the
* width of the source image)
*
* @param height height (in pixels) of the region in the source image from
* which the JPEG or YUV image should be compressed/encoded (0 = use the
* height of the source image)
*/ */
public void compress(BufferedImage srcImage, byte[] dstBuf, int flags) public void setSourceImage(BufferedImage srcImage, int x, int y, int width,
throws Exception { int height) throws Exception {
if (srcImage == null || dstBuf == null || flags < 0) if (handle == 0) init();
throw new Exception("Invalid argument in compress()"); if (srcImage == null || x < 0 || y < 0 || width < 0 || height < 0)
int width = srcImage.getWidth(); throw new Exception("Invalid argument in setSourceImage()");
int height = srcImage.getHeight(); srcX = x;
srcY = y;
srcWidth = (width == 0) ? srcImage.getWidth(): width;
srcHeight = (height == 0) ? srcImage.getHeight() : height;
if (x + width > srcImage.getWidth() || y + height > srcImage.getHeight())
throw new Exception("Compression region exceeds the bounds of the source image");
int pixelFormat; int pixelFormat;
boolean intPixels = false; boolean intPixels = false;
if (byteOrder == null) if (byteOrder == null)
@@ -324,227 +231,293 @@ public class TJCompressor {
default: default:
throw new Exception("Unsupported BufferedImage format"); throw new Exception("Unsupported BufferedImage format");
} }
srcPixelFormat = pixelFormat;
WritableRaster wr = srcImage.getRaster(); WritableRaster wr = srcImage.getRaster();
if (jpegQuality < 0)
throw new Exception("JPEG Quality not set");
if (subsamp < 0)
throw new Exception("Subsampling level not set");
if (intPixels) { if (intPixels) {
SinglePixelPackedSampleModel sm = SinglePixelPackedSampleModel sm =
(SinglePixelPackedSampleModel)srcImage.getSampleModel(); (SinglePixelPackedSampleModel)srcImage.getSampleModel();
int stride = sm.getScanlineStride(); srcStride = sm.getScanlineStride();
DataBufferInt db = (DataBufferInt)wr.getDataBuffer(); DataBufferInt db = (DataBufferInt)wr.getDataBuffer();
int[] buf = db.getData(); srcBufInt = db.getData();
if (srcX >= 0 && srcY >= 0) srcBuf = null;
compressedSize = compress(buf, srcX, srcY, width, stride, height,
pixelFormat, dstBuf, subsamp, jpegQuality,
flags);
else
compressedSize = compress(buf, width, stride, height, pixelFormat,
dstBuf, subsamp, jpegQuality, flags);
} else { } else {
ComponentSampleModel sm = ComponentSampleModel sm =
(ComponentSampleModel)srcImage.getSampleModel(); (ComponentSampleModel)srcImage.getSampleModel();
int pixelSize = sm.getPixelStride(); int pixelSize = sm.getPixelStride();
if (pixelSize != TJ.getPixelSize(pixelFormat)) if (pixelSize != TJ.getPixelSize(pixelFormat))
throw new Exception("Inconsistency between pixel format and pixel size in BufferedImage"); throw new Exception("Inconsistency between pixel format and pixel size in BufferedImage");
int pitch = sm.getScanlineStride(); srcPitch = sm.getScanlineStride();
DataBufferByte db = (DataBufferByte)wr.getDataBuffer(); DataBufferByte db = (DataBufferByte)wr.getDataBuffer();
byte[] buf = db.getData(); srcBuf = db.getData();
srcBufInt = null;
}
srcYUVImage = null;
}
/**
* Associate an uncompressed YUV planar source image with this compressor
* instance.
*
* @param srcImage YUV planar image to be compressed
*/
public void setSourceImage(YUVImage srcImage) throws Exception {
if (handle == 0) init();
if (srcImage == null)
throw new Exception("Invalid argument in setSourceImage()");
srcYUVImage = srcImage;
srcBuf = null;
srcBufInt = null;
}
/**
* Set the level of chrominance subsampling for subsequent compress/encode
* operations. When pixels are converted from RGB to YCbCr (see
* {@link TJ#CS_YCbCr}) or from CMYK to YCCK (see {@link TJ#CS_YCCK}) as part
* of the JPEG compression process, some of the Cb and Cr (chrominance)
* components can be discarded or averaged together to produce a smaller
* image with little perceptible loss of image clarity (the human eye is more
* sensitive to small changes in brightness than to small changes in color.)
* This is called "chrominance subsampling".
* <p>
* NOTE: This method has no effect when compressing a JPEG image from a YUV
* planar source. In that case, the level of chrominance subsampling in
* the JPEG image is determined by the source. Further, this method has no
* effect when encoding to a pre-allocated {@link YUVImage} instance. In
* that case, the level of chrominance subsampling is determined by the
* destination.
*
* @param newSubsamp the level of chrominance subsampling to use in
* subsequent compress/encode oeprations (one of
* {@link TJ#SAMP_444 TJ.SAMP_*})
*/
public void setSubsamp(int newSubsamp) throws Exception {
if (newSubsamp < 0 || newSubsamp >= TJ.NUMSAMP)
throw new Exception("Invalid argument in setSubsamp()");
subsamp = newSubsamp;
}
/**
* Set the JPEG image quality level for subsequent compress operations.
*
* @param quality the new JPEG image quality level (1 to 100, 1 = worst,
* 100 = best)
*/
public void setJPEGQuality(int quality) throws Exception {
if (quality < 1 || quality > 100)
throw new Exception("Invalid argument in setJPEGQuality()");
jpegQuality = quality;
}
/**
* Compress the uncompressed source image associated with this compressor
* instance and output a JPEG image to the given destination buffer.
*
* @param dstBuf buffer that will receive the JPEG image. Use
* {@link TJ#bufSize} to determine the maximum size for this buffer based on
* the source image's width and height and the desired level of chrominance
* subsampling.
*
* @param flags the bitwise OR of one or more of
* {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*}
*/
public void compress(byte[] dstBuf, int flags) throws Exception {
if (dstBuf == null || flags < 0)
throw new Exception("Invalid argument in compress()");
if (srcBuf == null && srcBufInt == null && srcYUVImage == null)
throw new Exception(NO_ASSOC_ERROR);
if (jpegQuality < 0)
throw new Exception("JPEG Quality not set");
if (subsamp < 0 && srcYUVImage == null)
throw new Exception("Subsampling level not set");
if (srcYUVImage != null)
compressedSize = compressFromYUV(srcYUVImage.getBuf(),
srcYUVImage.getWidth(),
srcYUVImage.getPad(),
srcYUVImage.getHeight(),
srcYUVImage.getSubsamp(),
dstBuf, jpegQuality, flags);
else if (srcBuf != null) {
if (srcX >= 0 && srcY >= 0) if (srcX >= 0 && srcY >= 0)
compressedSize = compress(buf, srcX, srcY, width, pitch, height, compressedSize = compress(srcBuf, srcX, srcY, srcWidth, srcPitch,
pixelFormat, dstBuf, subsamp, jpegQuality, srcHeight, srcPixelFormat, dstBuf, subsamp,
flags); jpegQuality, flags);
else else
compressedSize = compress(buf, width, pitch, height, pixelFormat, compressedSize = compress(srcBuf, srcWidth, srcPitch, srcHeight,
dstBuf, subsamp, jpegQuality, flags); srcPixelFormat, dstBuf, subsamp, jpegQuality,
flags);
} else if (srcBufInt != null) {
if (srcX >= 0 && srcY >= 0)
compressedSize = compress(srcBufInt, srcX, srcY, srcWidth, srcStride,
srcHeight, srcPixelFormat, dstBuf, subsamp,
jpegQuality, flags);
else
compressedSize = compress(srcBufInt, srcWidth, srcStride, srcHeight,
srcPixelFormat, dstBuf, subsamp, jpegQuality,
flags);
} }
} }
/** /**
* Compress the uncompressed source image stored in <code>srcImage</code> * Compress the uncompressed source image associated with this compressor
* and return a buffer containing a JPEG image. * instance and return a buffer containing a JPEG image.
* *
* @param srcImage a <code>BufferedImage</code> instance containing RGB or * @param flags the bitwise OR of one or more of
* grayscale pixels to be compressed * {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*}
*
* @param flags the bitwise OR of one or more of {@link TJ TJ.FLAG_*}
* *
* @return a buffer containing a JPEG image. The length of this buffer will * @return a buffer containing a JPEG image. The length of this buffer will
* not be equal to the size of the JPEG image. Use {@link * not be equal to the size of the JPEG image. Use {@link
* #getCompressedSize} to obtain the size of the JPEG image. * #getCompressedSize} to obtain the size of the JPEG image.
*/ */
public byte[] compress(BufferedImage srcImage, int flags) throws Exception { public byte[] compress(int flags) throws Exception {
int width = srcImage.getWidth(); if (srcWidth < 1 || srcHeight < 1)
int height = srcImage.getHeight(); throw new Exception(NO_ASSOC_ERROR);
byte[] buf = new byte[TJ.bufSize(width, height, subsamp)]; byte[] buf = new byte[TJ.bufSize(srcWidth, srcHeight, subsamp)];
compress(srcImage, buf, flags); compress(buf, flags);
return buf; return buf;
} }
/**
* @deprecated Use
* {@link #setSourceImage(BufferedImage, int, int, int, int)} and
* {@link #compress(byte[], int)} instead.
*/
@Deprecated
public void compress(BufferedImage srcImage, byte[] dstBuf, int flags)
throws Exception {
setSourceImage(srcImage, 0, 0, 0, 0);
compress(dstBuf, flags);
}
/** /**
* Set the plane padding for subsequent YUV encode operations. * @deprecated Use
* * {@link #setSourceImage(BufferedImage, int, int, int, int)} and
* @param pad the width of each line in each plane of the YUV image will be * {@link #compress(int)} instead.
* padded to the nearest multiple of this number of bytes (must be a
* power of 2.) The default padding is 4 bytes, which generates
* images suitable for direct video display.
*/ */
public void setYUVPad(int pad) throws Exception { @Deprecated
if(pad < 1 || ((pad & (pad - 1)) != 0)) public byte[] compress(BufferedImage srcImage, int flags) throws Exception {
throw new Exception("Invalid argument in setYUVPad()"); setSourceImage(srcImage, 0, 0, 0, 0);
yuvPad = pad; return compress(flags);
} }
/** /**
* Encode the uncompressed source image associated with this compressor * Encode the uncompressed source image associated with this compressor
* instance and output a YUV planar image to the given destination buffer. * instance into a YUV planar image and store it in the given
* This method uses the accelerated color conversion routines in TurboJPEG's * <code>YUVImage</code> instance. This method uses the accelerated color
* underlying codec but does not execute any of the other steps in the JPEG * conversion routines in TurboJPEG's underlying codec but does not execute
* compression process. The Y, U (Cb), and V (Cr) image planes are stored * any of the other steps in the JPEG compression process. Encoding
* sequentially into the destination buffer, and the size of each plane is * CMYK source images to YUV is not supported.
* determined by the width and height of the source image, as well as the
* specified padding and level of chrominance subsampling. If the
* chrominance components are subsampled along the horizontal dimension, then
* the width of the luminance plane is padded to the nearest multiple of 2 in
* the output image (same goes for the height of the luminance plane, if the
* chrominance components are subsampled along the vertical dimension.)
* <p>
* NOTE: Technically, the JPEG format uses the YCbCr colorspace, but per the
* convention of the digital video community, the TurboJPEG API uses "YUV" to
* refer to an image format consisting of Y, Cb, and Cr image planes.
* *
* @param dstBuf buffer that will receive the YUV planar image. Use * @param dstImage {@link YUVImage} instance that will receive the YUV planar
* {@link TJ#bufSizeYUV} to determine the appropriate size for this buffer * image
* based on the image width, height, and level of chrominance subsampling.
* *
* @param flags the bitwise OR of one or more of {@link TJ TJ.FLAG_*} * @param flags the bitwise OR of one or more of
* {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*}
*/ */
public void encodeYUV(YUVImage dstImage, int flags) throws Exception {
if (dstImage == null || flags < 0)
throw new Exception("Invalid argument in encodeYUV()");
if (srcBuf == null && srcBufInt == null)
throw new Exception(NO_ASSOC_ERROR);
if (srcYUVImage != null)
throw new Exception("Source image is not correct type");
if (subsamp < 0)
throw new Exception("Subsampling level not set");
if (srcWidth != dstImage.getWidth() || srcHeight != dstImage.getHeight())
throw new Exception("Destination image is the wrong size");
if (srcBufInt != null) {
encodeYUV(srcBufInt, srcX, srcY, srcWidth, srcStride, srcHeight,
srcPixelFormat, dstImage.getBuf(), dstImage.getPad(),
dstImage.getSubsamp(), flags);
} else {
encodeYUV(srcBuf, srcX, srcY, srcWidth, srcPitch, srcHeight,
srcPixelFormat, dstImage.getBuf(), dstImage.getPad(),
dstImage.getSubsamp(), flags);
}
compressedSize = dstImage.getSize();
}
/**
* @deprecated Use {@link #encodeYUV(YUVImage, int)} instead.
*/
@Deprecated
public void encodeYUV(byte[] dstBuf, int flags) throws Exception { public void encodeYUV(byte[] dstBuf, int flags) throws Exception {
if (dstBuf == null || flags < 0) if(dstBuf == null)
throw new Exception("Invalid argument in compress()"); throw new Exception("Invalid argument in encodeYUV()");
if (srcBuf == null) if (srcWidth < 1 || srcHeight < 1)
throw new Exception(NO_ASSOC_ERROR); throw new Exception(NO_ASSOC_ERROR);
if (subsamp < 0) if (subsamp < 0)
throw new Exception("Subsampling level not set"); throw new Exception("Subsampling level not set");
encodeYUV(srcBuf, srcWidth, srcPitch, srcHeight, srcPixelFormat, dstBuf, YUVImage yuvImage = new YUVImage(dstBuf, srcWidth, 4, srcHeight, subsamp);
yuvPad, subsamp, flags); encodeYUV(yuvImage, flags);
compressedSize = TJ.bufSizeYUV(srcWidth, yuvPad, srcHeight, subsamp);
} }
/** /**
* Encode the uncompressed source image associated with this compressor * Encode the uncompressed source image associated with this compressor
* instance and return a buffer containing a YUV planar image. See * instance into a YUV planar image and return a <code>YUVImage</code>
* {@link #encodeYUV(byte[], int)} for more detail. * instance containing the encoded image. This method uses the accelerated
* color conversion routines in TurboJPEG's underlying codec but does not
* execute any of the other steps in the JPEG compression process. Encoding
* CMYK source images to YUV is not supported.
* *
* @param flags the bitwise OR of one or more of {@link TJ TJ.FLAG_*} * @param pad the width of each line in each plane of the YUV image will be
* padded to the nearest multiple of this number of bytes (must be a power of
* 2.)
* *
* @return a buffer containing a YUV planar image * @param flags the bitwise OR of one or more of
* {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*}
*
* @return a YUV planar image
*/ */
public YUVImage encodeYUV(int pad, int flags) throws Exception {
if (srcWidth < 1 || srcHeight < 1)
throw new Exception(NO_ASSOC_ERROR);
if (subsamp < 0)
throw new Exception("Subsampling level not set");
if(pad < 1 || ((pad & (pad - 1)) != 0))
throw new Exception("Invalid argument in encodeYUV()");
YUVImage yuvImage = new YUVImage(srcWidth, pad, srcHeight, subsamp);
encodeYUV(yuvImage, flags);
return yuvImage;
}
/**
* @deprecated Use {@link #encodeYUV(int, int)} instead.
*/
@Deprecated
public byte[] encodeYUV(int flags) throws Exception { public byte[] encodeYUV(int flags) throws Exception {
if (srcWidth < 1 || srcHeight < 1) if (srcWidth < 1 || srcHeight < 1)
throw new Exception(NO_ASSOC_ERROR); throw new Exception(NO_ASSOC_ERROR);
if (subsamp < 0) if (subsamp < 0)
throw new Exception("Subsampling level not set"); throw new Exception("Subsampling level not set");
byte[] buf = new byte[TJ.bufSizeYUV(srcWidth, yuvPad, srcHeight, subsamp)]; YUVImage yuvImage = new YUVImage(srcWidth, 4, srcHeight, subsamp);
encodeYUV(buf, flags); encodeYUV(yuvImage, flags);
return buf; return yuvImage.getBuf();
} }
/** /**
* Encode the uncompressed source image stored in <code>srcImage</code> * @deprecated Use
* and output a YUV planar image to the given destination buffer. See * {@link #setSourceImage(BufferedImage, int, int, int, int)} and
* {@link #encodeYUV(byte[], int)} for more detail. * {@link #encodeYUV(byte[], int)} instead.
*
* @param srcImage a <code>BufferedImage</code> instance containing RGB or
* grayscale pixels to be encoded
*
* @param dstBuf buffer that will receive the YUV planar image. Use
* {@link TJ#bufSizeYUV} to determine the appropriate size for this buffer
* based on the image width, height, and level of chrominance subsampling.
*
* @param flags the bitwise OR of one or more of {@link TJ TJ.FLAG_*}
*/ */
@Deprecated
public void encodeYUV(BufferedImage srcImage, byte[] dstBuf, int flags) public void encodeYUV(BufferedImage srcImage, byte[] dstBuf, int flags)
throws Exception { throws Exception {
if (srcImage == null || dstBuf == null || flags < 0) setSourceImage(srcImage, 0, 0, 0, 0);
throw new Exception("Invalid argument in encodeYUV()"); encodeYUV(dstBuf, flags);
int width = srcImage.getWidth();
int height = srcImage.getHeight();
int pixelFormat; boolean intPixels = false;
if (byteOrder == null)
byteOrder = ByteOrder.nativeOrder();
switch(srcImage.getType()) {
case BufferedImage.TYPE_3BYTE_BGR:
pixelFormat = TJ.PF_BGR; break;
case BufferedImage.TYPE_4BYTE_ABGR:
case BufferedImage.TYPE_4BYTE_ABGR_PRE:
pixelFormat = TJ.PF_XBGR; break;
case BufferedImage.TYPE_BYTE_GRAY:
pixelFormat = TJ.PF_GRAY; break;
case BufferedImage.TYPE_INT_BGR:
if (byteOrder == ByteOrder.BIG_ENDIAN)
pixelFormat = TJ.PF_XBGR;
else
pixelFormat = TJ.PF_RGBX;
intPixels = true; break;
case BufferedImage.TYPE_INT_RGB:
case BufferedImage.TYPE_INT_ARGB:
case BufferedImage.TYPE_INT_ARGB_PRE:
if (byteOrder == ByteOrder.BIG_ENDIAN)
pixelFormat = TJ.PF_XRGB;
else
pixelFormat = TJ.PF_BGRX;
intPixels = true; break;
default:
throw new Exception("Unsupported BufferedImage format");
}
WritableRaster wr = srcImage.getRaster();
if (subsamp < 0) throw new Exception("Subsampling level not set");
if (intPixels) {
SinglePixelPackedSampleModel sm =
(SinglePixelPackedSampleModel)srcImage.getSampleModel();
int stride = sm.getScanlineStride();
DataBufferInt db = (DataBufferInt)wr.getDataBuffer();
int[] buf = db.getData();
encodeYUV(buf, width, stride, height, pixelFormat, dstBuf, yuvPad,
subsamp, flags);
} else {
ComponentSampleModel sm =
(ComponentSampleModel)srcImage.getSampleModel();
int pixelSize = sm.getPixelStride();
if (pixelSize != TJ.getPixelSize(pixelFormat))
throw new Exception("Inconsistency between pixel format and pixel size in BufferedImage");
int pitch = sm.getScanlineStride();
DataBufferByte db = (DataBufferByte)wr.getDataBuffer();
byte[] buf = db.getData();
encodeYUV(buf, width, pitch, height, pixelFormat, dstBuf, yuvPad,
subsamp, flags);
}
compressedSize = TJ.bufSizeYUV(width, yuvPad, height, subsamp);
} }
/** /**
* Encode the uncompressed source image stored in <code>srcImage</code> * @deprecated Use
* and return a buffer containing a YUV planar image. See * {@link #setSourceImage(BufferedImage, int, int, int, int)} and
* {@link #encodeYUV(byte[], int)} for more detail. * {@link #encodeYUV(int)} instead.
*
* @param srcImage a <code>BufferedImage</code> instance containing RGB or
* grayscale pixels to be encoded
*
* @param flags the bitwise OR of one or more of {@link TJ TJ.FLAG_*}
*
* @return a buffer containing a YUV planar image
*/ */
@Deprecated
public byte[] encodeYUV(BufferedImage srcImage, int flags) throws Exception { public byte[] encodeYUV(BufferedImage srcImage, int flags) throws Exception {
if (subsamp < 0) setSourceImage(srcImage, 0, 0, 0, 0);
throw new Exception("Subsampling level not set"); return encodeYUV(flags);
int width = srcImage.getWidth();
int height = srcImage.getHeight();
byte[] buf = new byte[TJ.bufSizeYUV(width, yuvPad, height, subsamp)];
encodeYUV(srcImage, buf, flags);
return buf;
} }
/** /**
@@ -603,17 +576,17 @@ public class TJCompressor {
int height, int pixelFormat, byte[] dstBuf, int subsamp, int flags) int height, int pixelFormat, byte[] dstBuf, int subsamp, int flags)
throws Exception; // deprecated throws Exception; // deprecated
private native void encodeYUV(byte[] srcBuf, int width, int pitch, private native void encodeYUV(byte[] srcBuf, int x, int y, int width,
int height, int pixelFormat, byte[] dstBuf, int pad, int subsamp, int pitch, int height, int pixelFormat, byte[] dstBuf, int pad,
int flags) throws Exception; int subsamp, int flags) throws Exception;
private native void encodeYUV(int[] srcBuf, int width, int stride, private native void encodeYUV(int[] srcBuf, int width, int stride,
int height, int pixelFormat, byte[] dstBuf, int subsamp, int flags) int height, int pixelFormat, byte[] dstBuf, int subsamp, int flags)
throws Exception; // deprecated throws Exception; // deprecated
private native void encodeYUV(int[] srcBuf, int width, int pitch, private native void encodeYUV(int[] srcBuf, int x, int y, int width,
int height, int pixelFormat, byte[] dstBuf, int pad, int subsamp, int pitch, int height, int pixelFormat, byte[] dstBuf, int pad,
int flags) throws Exception; int subsamp, int flags) throws Exception;
static { static {
TJLoader.load(); TJLoader.load();
@@ -621,14 +594,15 @@ public class TJCompressor {
private long handle = 0; private long handle = 0;
private byte[] srcBuf = null; private byte[] srcBuf = null;
private int[] srcBufInt = null;
private int srcWidth = 0; private int srcWidth = 0;
private int srcHeight = 0; private int srcHeight = 0;
private int srcX = -1; private int srcX = -1;
private int srcY = -1; private int srcY = -1;
private int srcPitch = 0; private int srcPitch = 0;
private int srcStride = 0;
private int srcPixelFormat = -1; private int srcPixelFormat = -1;
private int srcYUVPad = -1; private YUVImage srcYUVImage = null;
private boolean srcIsYUV;
private int subsamp = -1; private int subsamp = -1;
private int jpegQuality = -1; private int jpegQuality = -1;
private int compressedSize = 0; private int compressedSize = 0;

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C)2011-2013 D. R. Commander. All Rights Reserved. * Copyright (C)2011-2014 D. R. Commander. All Rights Reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are met:
@@ -37,7 +37,7 @@ import java.nio.*;
public class TJDecompressor { public class TJDecompressor {
private static final String NO_ASSOC_ERROR = private static final String NO_ASSOC_ERROR =
"No JPEG image is associated with this instance"; "No source image is associated with this instance";
/** /**
* Create a TurboJPEG decompresssor instance. * Create a TurboJPEG decompresssor instance.
@@ -47,21 +47,21 @@ public class TJDecompressor {
} }
/** /**
* Create a TurboJPEG decompressor instance and associate the JPEG image * Create a TurboJPEG decompressor instance and associate the JPEG source
* stored in <code>jpegImage</code> with the newly-created instance. * image stored in <code>jpegImage</code> with the newly created instance.
* *
* @param jpegImage JPEG image buffer (size of the JPEG image is assumed to * @param jpegImage JPEG image buffer (size of the JPEG image is assumed to
* be the length of the array) * be the length of the array)
*/ */
public TJDecompressor(byte[] jpegImage) throws Exception { public TJDecompressor(byte[] jpegImage) throws Exception {
init(); init();
setJPEGImage(jpegImage, jpegImage.length); setSourceImage(jpegImage, jpegImage.length);
} }
/** /**
* Create a TurboJPEG decompressor instance and associate the JPEG image * Create a TurboJPEG decompressor instance and associate the JPEG source
* of length <code>imageSize</code> bytes stored in <code>jpegImage</code> * image of length <code>imageSize</code> bytes stored in
* with the newly-created instance. * <code>jpegImage</code> with the newly created instance.
* *
* @param jpegImage JPEG image buffer * @param jpegImage JPEG image buffer
* *
@@ -69,87 +69,150 @@ public class TJDecompressor {
*/ */
public TJDecompressor(byte[] jpegImage, int imageSize) throws Exception { public TJDecompressor(byte[] jpegImage, int imageSize) throws Exception {
init(); init();
setJPEGImage(jpegImage, imageSize); setSourceImage(jpegImage, imageSize);
}
/**
* Create a TurboJPEG decompressor instance and associate the YUV planar
* source image stored in <code>yuvImage</code> with the newly created
* instance.
*
* @param yuvImage {@link YUVImage} instance containing a YUV planar
* image to be decoded
*/
public TJDecompressor(YUVImage yuvImage) throws Exception {
init();
setSourceImage(yuvImage);
} }
/** /**
* Associate the JPEG image of length <code>imageSize</code> bytes stored in * Associate the JPEG image of length <code>imageSize</code> bytes stored in
* <code>jpegImage</code> with this decompressor instance. This image will * <code>srcImage</code> with this decompressor instance. This image will
* be used as the source image for subsequent decompress operations. * be used as the source image for subsequent decompress operations.
* *
* @param jpegImage JPEG image buffer * @param srcImage JPEG image buffer
* *
* @param imageSize size of the JPEG image (in bytes) * @param imageSize size of the JPEG image (in bytes)
*/ */
public void setJPEGImage(byte[] jpegImage, int imageSize) throws Exception { public void setSourceImage(byte[] srcImage, int imageSize)
if (jpegImage == null || imageSize < 1) throws Exception {
throw new Exception("Invalid argument in setJPEGImage()"); if (srcImage == null || imageSize < 1)
jpegBuf = jpegImage; throw new Exception("Invalid argument in setSourceImage()");
jpegBuf = srcImage;
jpegBufSize = imageSize; jpegBufSize = imageSize;
decompressHeader(jpegBuf, jpegBufSize); decompressHeader(jpegBuf, jpegBufSize);
yuvImage = null;
} }
/** /**
* Returns the width of the JPEG image associated with this decompressor * @deprecated Use {@link #setSourceImage(byte[], int)} instead.
* instance.
*
* @return the width of the JPEG image associated with this decompressor
* instance
*/ */
public int getWidth() throws Exception { @Deprecated
if (jpegWidth < 1) public void setJPEGImage(byte[] jpegImage, int imageSize) throws Exception {
throw new Exception(NO_ASSOC_ERROR); setSourceImage(jpegImage, imageSize);
return jpegWidth;
} }
/** /**
* Returns the height of the JPEG image associated with this decompressor * Associate the specified YUV planar source image with this decompressor
* instance. * instance. Subsequent decompress operations will decode this image into an
* RGB or grayscale destination image.
* *
* @return the height of the JPEG image associated with this decompressor * @param srcImage {@link YUVImage} instance containing a YUV planar image to
* instance * be decoded
*/ */
public int getHeight() throws Exception { public void setSourceImage(YUVImage srcImage) throws Exception {
if (jpegHeight < 1) if (srcImage == null)
throw new Exception(NO_ASSOC_ERROR); throw new Exception("Invalid argument in setSourceImage()");
return jpegHeight; yuvImage = srcImage;
jpegBuf = null;
jpegBufSize = 0;
} }
/**
* Returns the level of chrominance subsampling used in the JPEG image
* associated with this decompressor instance. See {@link TJ TJ.SAMP_*}.
*
* @return the level of chrominance subsampling used in the JPEG image
* associated with this decompressor instance
*/
public int getSubsamp() throws Exception {
if (jpegSubsamp < 0)
throw new Exception(NO_ASSOC_ERROR);
if (jpegSubsamp >= TJ.NUMSAMP)
throw new Exception("JPEG header information is invalid");
return jpegSubsamp;
}
/** /**
* Returns the colorspace used in the JPEG image associated with this * Returns the width of the source image (JPEG or YUV) associated with this
* decompressor instance. See {@link TJ TJ.CS_*}. * decompressor instance.
* *
* @return the colorspace used in the JPEG image associated with this * @return the width of the source image (JPEG or YUV) associated with this
* decompressor instance * decompressor instance
*/ */
public int getColorspace() throws Exception { public int getWidth() throws Exception {
if (jpegColorspace < 0) if (yuvImage != null)
return yuvImage.getWidth();
if (srcWidth < 1)
throw new Exception(NO_ASSOC_ERROR); throw new Exception(NO_ASSOC_ERROR);
if (jpegColorspace >= TJ.NUMCS) return srcWidth;
throw new Exception("JPEG header information is invalid");
return jpegColorspace;
} }
/** /**
* Returns the JPEG image buffer associated with this decompressor instance. * Returns the height of the source image (JPEG or YUV) associated with this
* decompressor instance.
* *
* @return the JPEG image buffer associated with this decompressor instance * @return the height of the source image (JPEG or YUV) associated with this
* decompressor instance
*/ */
public int getHeight() throws Exception {
if (yuvImage != null)
return yuvImage.getHeight();
if (srcHeight < 1)
throw new Exception(NO_ASSOC_ERROR);
return srcHeight;
}
/**
* Returns the level of chrominance subsampling used in the source image
* (JPEG or YUV) associated with this decompressor instance. See
* {@link TJ#SAMP_444 TJ.SAMP_*}.
*
* @return the level of chrominance subsampling used in the source image
* (JPEG or YUV) associated with this decompressor instance
*/
public int getSubsamp() throws Exception {
if (yuvImage != null)
return yuvImage.getSubsamp();
if (srcSubsamp < 0)
throw new Exception(NO_ASSOC_ERROR);
if (srcSubsamp >= TJ.NUMSAMP)
throw new Exception("JPEG header information is invalid");
return srcSubsamp;
}
/**
* Returns the colorspace used in the source image (JPEG or YUV) associated
* with this decompressor instance. See {@link TJ#CS_RGB TJ.CS_*}. If the
* source image is YUV, then this always returns {@link TJ#CS_YCbCr}.
*
* @return the colorspace used in the source image (JPEG or YUV) associated
* with this decompressor instance
*/
public int getColorspace() throws Exception {
if (yuvImage != null)
return TJ.CS_YCbCr;
if (srcColorspace < 0)
throw new Exception(NO_ASSOC_ERROR);
if (srcColorspace >= TJ.NUMCS)
throw new Exception("JPEG header information is invalid");
return srcColorspace;
}
/**
* Returns the source image buffer associated with this decompressor
* instance.
*
* @return the source image buffer associated with this decompressor instance
*/
public byte[] getSourceBuf() throws Exception {
if (yuvImage != null)
return yuvImage.getBuf();
if (jpegBuf == null)
throw new Exception(NO_ASSOC_ERROR);
return jpegBuf;
}
/**
* @deprecated Use {@link #getSourceBuf} instead.
*/
@Deprecated
public byte[] getJPEGBuf() throws Exception { public byte[] getJPEGBuf() throws Exception {
if (jpegBuf == null) if (jpegBuf == null)
throw new Exception(NO_ASSOC_ERROR); throw new Exception(NO_ASSOC_ERROR);
@@ -157,18 +220,29 @@ public class TJDecompressor {
} }
/** /**
* Returns the size of the JPEG image (in bytes) associated with this * Returns the size of the source image (in bytes) associated with this
* decompressor instance. * decompressor instance.
* *
* @return the size of the JPEG image (in bytes) associated with this * @return the size of the source image (in bytes) associated with this
* decompressor instance * decompressor instance
*/ */
public int getJPEGSize() throws Exception { public int getSourceSize() throws Exception {
if (yuvImage != null)
return yuvImage.getSize();
if (jpegBufSize < 1) if (jpegBufSize < 1)
throw new Exception(NO_ASSOC_ERROR); throw new Exception(NO_ASSOC_ERROR);
return jpegBufSize; return jpegBufSize;
} }
/**
* @deprecated Use {@link #getSourceSize} instead.
*/
@Deprecated
public int getJPEGSize() throws Exception {
if (jpegBufSize < 1)
throw new Exception(NO_ASSOC_ERROR);
return jpegBufSize;
}
/** /**
* Returns the width of the largest scaled-down image that the TurboJPEG * Returns the width of the largest scaled-down image that the TurboJPEG
@@ -191,19 +265,19 @@ public class TJDecompressor {
*/ */
public int getScaledWidth(int desiredWidth, int desiredHeight) public int getScaledWidth(int desiredWidth, int desiredHeight)
throws Exception { throws Exception {
if (jpegWidth < 1 || jpegHeight < 1) if (srcWidth < 1 || srcHeight < 1)
throw new Exception(NO_ASSOC_ERROR); throw new Exception(NO_ASSOC_ERROR);
if (desiredWidth < 0 || desiredHeight < 0) if (desiredWidth < 0 || desiredHeight < 0)
throw new Exception("Invalid argument in getScaledWidth()"); throw new Exception("Invalid argument in getScaledWidth()");
TJScalingFactor[] sf = TJ.getScalingFactors(); TJScalingFactor[] sf = TJ.getScalingFactors();
if (desiredWidth == 0) if (desiredWidth == 0)
desiredWidth = jpegWidth; desiredWidth = srcWidth;
if (desiredHeight == 0) if (desiredHeight == 0)
desiredHeight = jpegHeight; desiredHeight = srcHeight;
int scaledWidth = jpegWidth, scaledHeight = jpegHeight; int scaledWidth = srcWidth, scaledHeight = srcHeight;
for (int i = 0; i < sf.length; i++) { for (int i = 0; i < sf.length; i++) {
scaledWidth = sf[i].getScaled(jpegWidth); scaledWidth = sf[i].getScaled(srcWidth);
scaledHeight = sf[i].getScaled(jpegHeight); scaledHeight = sf[i].getScaled(srcHeight);
if (scaledWidth <= desiredWidth && scaledHeight <= desiredHeight) if (scaledWidth <= desiredWidth && scaledHeight <= desiredHeight)
break; break;
} }
@@ -233,19 +307,19 @@ public class TJDecompressor {
*/ */
public int getScaledHeight(int desiredWidth, int desiredHeight) public int getScaledHeight(int desiredWidth, int desiredHeight)
throws Exception { throws Exception {
if (jpegWidth < 1 || jpegHeight < 1) if (srcWidth < 1 || srcHeight < 1)
throw new Exception(NO_ASSOC_ERROR); throw new Exception(NO_ASSOC_ERROR);
if (desiredWidth < 0 || desiredHeight < 0) if (desiredWidth < 0 || desiredHeight < 0)
throw new Exception("Invalid argument in getScaledHeight()"); throw new Exception("Invalid argument in getScaledHeight()");
TJScalingFactor[] sf = TJ.getScalingFactors(); TJScalingFactor[] sf = TJ.getScalingFactors();
if (desiredWidth == 0) if (desiredWidth == 0)
desiredWidth = jpegWidth; desiredWidth = srcWidth;
if (desiredHeight == 0) if (desiredHeight == 0)
desiredHeight = jpegHeight; desiredHeight = srcHeight;
int scaledWidth = jpegWidth, scaledHeight = jpegHeight; int scaledWidth = srcWidth, scaledHeight = srcHeight;
for (int i = 0; i < sf.length; i++) { for (int i = 0; i < sf.length; i++) {
scaledWidth = sf[i].getScaled(jpegWidth); scaledWidth = sf[i].getScaled(srcWidth);
scaledHeight = sf[i].getScaled(jpegHeight); scaledHeight = sf[i].getScaled(srcHeight);
if (scaledWidth <= desiredWidth && scaledHeight <= desiredHeight) if (scaledWidth <= desiredWidth && scaledHeight <= desiredHeight)
break; break;
} }
@@ -255,67 +329,83 @@ public class TJDecompressor {
} }
/** /**
* Decompress the JPEG source image associated with this decompressor * Decompress the JPEG source image or decode the YUV source image associated
* instance and output a decompressed image to the given destination buffer. * with this decompressor instance and output a grayscale, RGB, or CMYK image
* to the given destination buffer.
* *
* @param dstBuf buffer that will receive the decompressed image. This * @param dstBuf buffer that will receive the decompressed/decoded image.
* buffer should normally be <code>pitch * scaledHeight</code> bytes in size, * If the source image is a JPEG image, then this buffer should normally be
* where <code>scaledHeight</code> can be determined by calling <code> * <code>pitch * scaledHeight</code> bytes in size, where
* <code>scaledHeight</code> can be determined by calling <code>
* scalingFactor.{@link TJScalingFactor#getScaled getScaled}(jpegHeight) * scalingFactor.{@link TJScalingFactor#getScaled getScaled}(jpegHeight)
* </code> with one of the scaling factors returned from {@link * </code> with one of the scaling factors returned from {@link
* TJ#getScalingFactors} or by calling {@link #getScaledHeight}. However, * TJ#getScalingFactors} or by calling {@link #getScaledHeight}. If the
* the buffer may also be larger than the dimensions of the JPEG image, in * source image is a YUV image, then this buffer should normally be
* which case the <code>x</code>, <code>y</code>, and <code>pitch</code> * <code>pitch * height</code> bytes in size, where <code>height</code> is
* parameters can be used to specify the region into which the JPEG image * the height of the YUV image. However, the buffer may also be larger than
* should be decompressed. * the dimensions of the source image, in which case the <code>x</code>,
* <code>y</code>, and <code>pitch</code> parameters can be used to specify
* the region into which the source image should be decompressed/decoded.
* *
* @param x x offset (in pixels) of the region into which the JPEG image * @param x x offset (in pixels) of the region in the destination image into
* should be decompressed, relative to the start of <code>dstBuf</code>. * which the source image should be decompressed/decoded
* *
* @param y y offset (in pixels) of the region into which the JPEG image * @param y y offset (in pixels) of the region in the destination image into
* should be decompressed, relative to the start of <code>dstBuf</code>. * which the source image should be decompressed/decoded
* *
* @param desiredWidth desired width (in pixels) of the decompressed image * @param desiredWidth If the source image is a JPEG image, then this
* (or image region.) If the desired image dimensions are different than the * specifies the desired width (in pixels) of the decompressed image (or
* dimensions of the JPEG image being decompressed, then TurboJPEG will use * image region.) If the desired destination image dimensions are different
* scaling in the JPEG decompressor to generate the largest possible image * than the source image dimensions, then TurboJPEG will use scaling in the
* that will fit within the desired dimensions. Setting this to 0 is the * JPEG decompressor to generate the largest possible image that will fit
* same as setting it to the width of the JPEG image (in other words, the * within the desired dimensions. Setting this to 0 is the same as setting
* width will not be considered when determining the scaled image size.) * it to the width of the JPEG image (in other words, the width will not be
* considered when determining the scaled image size.) This parameter is
* ignored if the source image is a YUV image.
* *
* @param pitch bytes per line of the destination image. Normally, this * @param pitch bytes per line of the destination image. Normally, this
* should be set to <code>scaledWidth * TJ.pixelSize(pixelFormat)</code> if * should be set to <code>scaledWidth * TJ.pixelSize(pixelFormat)</code> if
* the decompressed image is unpadded, but you can use this to, for instance, * the destination image is unpadded, but you can use this to, for instance,
* pad each line of the decompressed image to a 4-byte boundary or to * pad each line of the destination image to a 4-byte boundary or to
* decompress the JPEG image into a region of a larger image. NOTE: * decompress/decode the source image into a region of a larger image. NOTE:
* <code>scaledWidth</code> can be determined by calling <code> * if the source image is a JPEG image, then <code>scaledWidth</code> can be
* determined by calling <code>
* scalingFactor.{@link TJScalingFactor#getScaled getScaled}(jpegWidth) * scalingFactor.{@link TJScalingFactor#getScaled getScaled}(jpegWidth)
* </code> or by calling {@link #getScaledWidth}. Setting this parameter to * </code> or by calling {@link #getScaledWidth}. If the source image is a
* 0 is the equivalent of setting it to <code>scaledWidth * * YUV image, then <code>scaledWidth</code> is the width of the YUV image.
* TJ.pixelSize(pixelFormat)</code>. * Setting this parameter to 0 is the equivalent of setting it to
* <code>scaledWidth * TJ.pixelSize(pixelFormat)</code>.
* *
* @param desiredHeight desired height (in pixels) of the decompressed image * @param desiredHeight If the source image is a JPEG image, then this
* (or image region.) If the desired image dimensions are different than the * specifies the desired height (in pixels) of the decompressed image (or
* dimensions of the JPEG image being decompressed, then TurboJPEG will use * image region.) If the desired destination image dimensions are different
* scaling in the JPEG decompressor to generate the largest possible image * than the source image dimensions, then TurboJPEG will use scaling in the
* that will fit within the desired dimensions. Setting this to 0 is the * JPEG decompressor to generate the largest possible image that will fit
* same as setting it to the height of the JPEG image (in other words, the * within the desired dimensions. Setting this to 0 is the same as setting
* height will not be considered when determining the scaled image size.) * it to the height of the JPEG image (in other words, the height will not be
* considered when determining the scaled image size.) This parameter is
* ignored if the source image is a YUV image.
* *
* @param pixelFormat pixel format of the decompressed image (one of * @param pixelFormat pixel format of the decompressed/decoded image (one of
* {@link TJ TJ.PF_*}) * {@link TJ#PF_RGB TJ.PF_*})
* *
* @param flags the bitwise OR of one or more of {@link TJ TJ.FLAG_*} * @param flags the bitwise OR of one or more of
* {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*}
*/ */
public void decompress(byte[] dstBuf, int x, int y, int desiredWidth, public void decompress(byte[] dstBuf, int x, int y, int desiredWidth,
int pitch, int desiredHeight, int pixelFormat, int pitch, int desiredHeight, int pixelFormat,
int flags) throws Exception { int flags) throws Exception {
if (jpegBuf == null) if (jpegBuf == null && yuvImage == null)
throw new Exception(NO_ASSOC_ERROR); throw new Exception(NO_ASSOC_ERROR);
if (dstBuf == null || x < 0 || y < 0 || desiredWidth < 0 || pitch < 0 || if (dstBuf == null || x < 0 || y < 0 || pitch < 0 ||
desiredHeight < 0 || pixelFormat < 0 || pixelFormat >= TJ.NUMPF || (yuvImage != null && (desiredWidth < 0 || desiredHeight < 0)) ||
flags < 0) pixelFormat < 0 || pixelFormat >= TJ.NUMPF || flags < 0)
throw new Exception("Invalid argument in decompress()"); throw new Exception("Invalid argument in decompress()");
if (yuvImage != null)
decodeYUV(yuvImage.getBuf(), yuvImage.getPad(), yuvImage.getSubsamp(),
dstBuf, x, y, yuvImage.getWidth(), pitch, yuvImage.getHeight(),
pixelFormat, flags);
else {
if (x > 0 || y > 0) if (x > 0 || y > 0)
decompress(jpegBuf, jpegBufSize, dstBuf, x, y, desiredWidth, pitch, decompress(jpegBuf, jpegBufSize, dstBuf, x, y, desiredWidth, pitch,
desiredHeight, pixelFormat, flags); desiredHeight, pixelFormat, flags);
@@ -323,6 +413,7 @@ public class TJDecompressor {
decompress(jpegBuf, jpegBufSize, dstBuf, desiredWidth, pitch, decompress(jpegBuf, jpegBufSize, dstBuf, desiredWidth, pitch,
desiredHeight, pixelFormat, flags); desiredHeight, pixelFormat, flags);
} }
}
/** /**
* @deprecated Use * @deprecated Use
@@ -353,15 +444,17 @@ public class TJDecompressor {
* for description * for description
* *
* @param pixelFormat pixel format of the decompressed image (one of * @param pixelFormat pixel format of the decompressed image (one of
* {@link TJ TJ.PF_*}) * {@link TJ#PF_RGB TJ.PF_*})
* *
* @param flags the bitwise OR of one or more of {@link TJ TJ.FLAG_*} * @param flags the bitwise OR of one or more of
* {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*}
* *
* @return a buffer containing the decompressed image * @return a buffer containing the decompressed image
*/ */
public byte[] decompress(int desiredWidth, int pitch, int desiredHeight, public byte[] decompress(int desiredWidth, int pitch, int desiredHeight,
int pixelFormat, int flags) throws Exception { int pixelFormat, int flags) throws Exception {
if (desiredWidth < 0 || pitch < 0 || desiredHeight < 0 || if (pitch < 0 ||
(yuvImage == null && (desiredWidth < 0 || desiredHeight < 0)) ||
pixelFormat < 0 || pixelFormat >= TJ.NUMPF || flags < 0) pixelFormat < 0 || pixelFormat >= TJ.NUMPF || flags < 0)
throw new Exception("Invalid argument in decompress()"); throw new Exception("Invalid argument in decompress()");
int pixelSize = TJ.getPixelSize(pixelFormat); int pixelSize = TJ.getPixelSize(pixelFormat);
@@ -376,22 +469,60 @@ public class TJDecompressor {
/** /**
* Decompress the JPEG source image associated with this decompressor * Decompress the JPEG source image associated with this decompressor
* instance and output a YUV planar image to the given destination buffer. * instance into a YUV planar image and store it in the given
* This method performs JPEG decompression but leaves out the color * <code>YUVImage</code> instance. This method performs JPEG decompression
* conversion step, so a planar YUV image is generated instead of an RGB * but leaves out the color conversion step, so a planar YUV image is
* image. The padding of the planes in this image is the same as in the * generated instead of an RGB or grayscale image. This method cannot be
* images generated by {@link TJCompressor#encodeYUV(byte[], int)}. Note * used to decompress JPEG source images with the CMYK or YCCK colorspace.
* that, if the width or height of the image is not an even multiple of the
* MCU block size (see {@link TJ#getMCUWidth} and {@link TJ#getMCUHeight}),
* then an intermediate buffer copy will be performed within TurboJPEG.
* <p>
* NOTE: Technically, the JPEG format uses the YCbCr colorspace, but per the
* convention of the digital video community, the TurboJPEG API uses "YUV" to
* refer to an image format consisting of Y, Cb, and Cr image planes.
* *
* @param dstBuf buffer that will receive the YUV planar image. Use * @param dstImage {@link YUVImage} instance that will receive the YUV planar
* {@link TJ#bufSizeYUV} to determine the appropriate size for this buffer * image. The level of subsampling specified in this <code>YUVImage</code>
* based on the image width, height, and level of chrominance subsampling. * instance must match that of the JPEG image, and the width and height
* specified in the <code>YUVImage</code> instance must match one of the
* scaled image sizes that TurboJPEG is capable of generating from the JPEG
* source image.
*
* @param flags the bitwise OR of one or more of
* {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*}
*/
public void decompressToYUV(YUVImage dstImage, int flags) throws Exception {
if (jpegBuf == null)
throw new Exception(NO_ASSOC_ERROR);
if (dstImage == null || flags < 0)
throw new Exception("Invalid argument in decompressToYUV()");
int scaledWidth = getScaledWidth(dstImage.getWidth(),
dstImage.getHeight());
int scaledHeight = getScaledHeight(dstImage.getWidth(),
dstImage.getHeight());
if (scaledWidth != dstImage.getWidth() ||
scaledHeight != dstImage.getHeight())
throw new Exception("YUVImage dimensions do not match one of the scaled image sizes that TurboJPEG is capable of generating.");
if (srcSubsamp != dstImage.getSubsamp())
throw new Exception("YUVImage subsampling level does not match that of the JPEG image");
decompressToYUV(jpegBuf, jpegBufSize, dstImage.getBuf(),
dstImage.getWidth(), dstImage.getPad(),
dstImage.getHeight(), flags);
}
/**
* @deprecated Use {@link #decompressToYUV(YUVImage, int)} instead.
*/
@Deprecated
public void decompressToYUV(byte[] dstBuf, int flags) throws Exception {
YUVImage dstImage = new YUVImage(dstBuf, srcWidth, 4, srcHeight,
srcSubsamp);
decompressToYUV(dstImage, flags);
}
/**
* Decompress the JPEG source image associated with this decompressor
* instance into a YUV planar image and return a <code>YUVImage</code>
* instance containing the decompressed image. This method performs JPEG
* decompression but leaves out the color conversion step, so a planar YUV
* image is generated instead of an RGB or grayscale image. This method
* cannot be used to decompress JPEG source images with the CMYK or YCCK
* colorspace.
* *
* @param desiredWidth desired width (in pixels) of the YUV image. If the * @param desiredWidth desired width (in pixels) of the YUV image. If the
* desired image dimensions are different than the dimensions of the JPEG * desired image dimensions are different than the dimensions of the JPEG
@@ -413,60 +544,28 @@ public class TJDecompressor {
* the height of the JPEG image (in other words, the height will not be * the height of the JPEG image (in other words, the height will not be
* considered when determining the scaled image size.) * considered when determining the scaled image size.)
* *
* @param flags the bitwise OR of one or more of {@link TJ TJ.FLAG_*} * @param flags the bitwise OR of one or more of
* {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*}
*
* @return a YUV planar image
*/ */
public void decompressToYUV(byte[] dstBuf, int desiredWidth, int pad, public YUVImage decompressToYUV(int desiredWidth, int pad, int desiredHeight,
int desiredHeight, int flags) throws Exception {
if (jpegBuf == null)
throw new Exception(NO_ASSOC_ERROR);
if (dstBuf == null || desiredWidth < 0 || pad < 1 ||
((pad & (pad - 1)) != 0) || desiredHeight < 0 || flags < 0)
throw new Exception("Invalid argument in decompressToYUV()");
decompressToYUV(jpegBuf, jpegBufSize, dstBuf, desiredWidth, pad,
desiredHeight, flags);
}
/**
* @deprecated Use {@link #decompressToYUV(byte[], int, int, int, int)}
* instead.
*/
@Deprecated
public void decompressToYUV(byte[] dstBuf, int flags) throws Exception {
decompressToYUV(dstBuf, 0, 4, 0, flags);
}
/**
* Decompress the JPEG source image associated with this decompressor
* instance and return a buffer containing a YUV planar image. See {@link
* #decompressToYUV(byte[], int, int, int, int)} for more detail.
*
* @param desiredWidth see
* {@link #decompressToYUV(byte[], int, int, int, int)} for description
*
* @param pad see {@link #decompressToYUV(byte[], int, int, int, int)} for
* description
*
* @param desiredHeight see {@link
* #decompressToYUV(byte[], int, int, int, int)} for description
*
* @param flags the bitwise OR of one or more of {@link TJ TJ.FLAG_*}
*
* @return a buffer containing a YUV planar image
*/
public byte[] decompressToYUV(int desiredWidth, int pad, int desiredHeight,
int flags) throws Exception { int flags) throws Exception {
if (flags < 0) if (flags < 0)
throw new Exception("Invalid argument in decompressToYUV()"); throw new Exception("Invalid argument in decompressToYUV()");
if (jpegWidth < 1 || jpegHeight < 1 || jpegSubsamp < 0) if (srcWidth < 1 || srcHeight < 1 || srcSubsamp < 0)
throw new Exception(NO_ASSOC_ERROR); throw new Exception(NO_ASSOC_ERROR);
if (jpegSubsamp >= TJ.NUMSAMP) if (srcSubsamp >= TJ.NUMSAMP)
throw new Exception("JPEG header information is invalid"); throw new Exception("JPEG header information is invalid");
if (yuvImage != null)
throw new Exception("Source image is the wrong type");
int scaledWidth = getScaledWidth(desiredWidth, desiredHeight); int scaledWidth = getScaledWidth(desiredWidth, desiredHeight);
int scaledHeight = getScaledHeight(desiredWidth, desiredHeight); int scaledHeight = getScaledHeight(desiredWidth, desiredHeight);
byte[] buf = new byte[TJ.bufSizeYUV(scaledWidth, pad, scaledHeight, YUVImage yuvImage = new YUVImage(scaledWidth, pad, scaledHeight,
jpegSubsamp)]; srcSubsamp);
decompressToYUV(buf, desiredWidth, pad, desiredHeight, flags); decompressToYUV(yuvImage, flags);
return buf; return yuvImage;
} }
/** /**
@@ -474,91 +573,126 @@ public class TJDecompressor {
*/ */
@Deprecated @Deprecated
public byte[] decompressToYUV(int flags) throws Exception { public byte[] decompressToYUV(int flags) throws Exception {
return decompressToYUV(0, 4, 0, flags); YUVImage dstImage = new YUVImage(srcWidth, 4, srcHeight, srcSubsamp);
decompressToYUV(dstImage, flags);
return dstImage.getBuf();
} }
/** /**
* Decompress the JPEG source image associated with this decompressor * Decompress the JPEG source image or decode the YUV source image associated
* instance and output a decompressed image to the given destination buffer. * with this decompressor instance and output a grayscale, RGB, or CMYK image
* to the given destination buffer.
* *
* @param dstBuf buffer that will receive the decompressed image. This * @param dstBuf buffer that will receive the decompressed/decoded image.
* buffer should normally be <code>stride * scaledHeight</code> pixels in * If the source image is a JPEG image, then this buffer should normally be
* size, where <code>scaledHeight</code> can be determined by calling <code> * <code>stride * scaledHeight</code> pixels in size, where
* <code>scaledHeight</code> can be determined by calling <code>
* scalingFactor.{@link TJScalingFactor#getScaled getScaled}(jpegHeight) * scalingFactor.{@link TJScalingFactor#getScaled getScaled}(jpegHeight)
* </code> with one of the scaling factors returned from {@link * </code> with one of the scaling factors returned from {@link
* TJ#getScalingFactors} or by calling {@link #getScaledHeight}. However, * TJ#getScalingFactors} or by calling {@link #getScaledHeight}. If the
* the buffer may also be larger than the dimensions of the JPEG image, in * source image is a YUV image, then this buffer should normally be
* which case the <code>x</code>, <code>y</code>, and <code>stride</code> * <code>stride * height</code> pixels in size, where <code>height</code> is
* parameters can be used to specify the region into which the JPEG image * the height of the YUV image. However, the buffer may also be larger than
* should be decompressed. * the dimensions of the JPEG image, in which case the <code>x</code>,
* <code>y</code>, and <code>stride</code> parameters can be used to specify
* the region into which the source image should be decompressed.
* *
* @param x x offset (in pixels) of the region into which the JPEG image * @param x x offset (in pixels) of the region in the destination image into
* should be decompressed, relative to the start of <code>dstBuf</code>. * which the source image should be decompressed/decoded
* *
* @param y y offset (in pixels) of the region into which the JPEG image * @param y y offset (in pixels) of the region in the destination image into
* should be decompressed, relative to the start of <code>dstBuf</code>. * which the source image should be decompressed/decoded
* *
* @param desiredWidth desired width (in pixels) of the decompressed image * @param desiredWidth If the source image is a JPEG image, then this
* (or image region.) If the desired image dimensions are different than the * specifies the desired width (in pixels) of the decompressed image (or
* dimensions of the JPEG image being decompressed, then TurboJPEG will use * image region.) If the desired destination image dimensions are different
* scaling in the JPEG decompressor to generate the largest possible image * than the source image dimensions, then TurboJPEG will use scaling in the
* that will fit within the desired dimensions. Setting this to 0 is the * JPEG decompressor to generate the largest possible image that will fit
* same as setting it to the width of the JPEG image (in other words, the * within the desired dimensions. Setting this to 0 is the same as setting
* width will not be considered when determining the scaled image size.) * it to the width of the JPEG image (in other words, the width will not be
* considered when determining the scaled image size.) This parameter is
* ignored if the source image is a YUV image.
* *
* @param stride pixels per line of the destination image. Normally, this * @param stride pixels per line of the destination image. Normally, this
* should be set to <code>scaledWidth</code>, but you can use this to, for * should be set to <code>scaledWidth</code>, but you can use this to, for
* instance, decompress the JPEG image into a region of a larger image. * instance, decompress the JPEG image into a region of a larger image.
* NOTE: <code>scaledWidth</code> can be determined by calling <code> * NOTE: if the source image is a JPEG image, then <code>scaledWidth</code>
* can be determined by calling <code>
* scalingFactor.{@link TJScalingFactor#getScaled getScaled}(jpegWidth) * scalingFactor.{@link TJScalingFactor#getScaled getScaled}(jpegWidth)
* </code> or by calling {@link #getScaledWidth}. Setting this parameter to * </code> or by calling {@link #getScaledWidth}. If the source image is a
* 0 is the equivalent of setting it to <code>scaledWidth</code>. * YUV image, then <code>scaledWidth</code> is the width of the YUV image.
* Setting this parameter to 0 is the equivalent of setting it to
* <code>scaledWidth</code>.
* *
* @param desiredHeight desired height (in pixels) of the decompressed image * @param desiredHeight If the source image is a JPEG image, then this
* (or image region.) If the desired image dimensions are different than the * specifies the desired height (in pixels) of the decompressed image (or
* dimensions of the JPEG image being decompressed, then TurboJPEG will use * image region.) If the desired destination image dimensions are different
* scaling in the JPEG decompressor to generate the largest possible image * than the source image dimensions, then TurboJPEG will use scaling in the
* that will fit within the desired dimensions. Setting this to 0 is the * JPEG decompressor to generate the largest possible image that will fit
* same as setting it to the height of the JPEG image (in other words, the * within the desired dimensions. Setting this to 0 is the same as setting
* height will not be considered when determining the scaled image size.) * it to the height of the JPEG image (in other words, the height will not be
* considered when determining the scaled image size.) This parameter is
* ignored if the source image is a YUV image.
* *
* @param pixelFormat pixel format of the decompressed image (one of * @param pixelFormat pixel format of the decompressed image (one of
* {@link TJ TJ.PF_*}) * {@link TJ#PF_RGB TJ.PF_*})
* *
* @param flags the bitwise OR of one or more of {@link TJ TJ.FLAG_*} * @param flags the bitwise OR of one or more of
* {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*}
*/ */
public void decompress(int[] dstBuf, int x, int y, int desiredWidth, public void decompress(int[] dstBuf, int x, int y, int desiredWidth,
int stride, int desiredHeight, int pixelFormat, int stride, int desiredHeight, int pixelFormat,
int flags) throws Exception { int flags) throws Exception {
if (jpegBuf == null) if (jpegBuf == null && yuvImage == null)
throw new Exception(NO_ASSOC_ERROR); throw new Exception(NO_ASSOC_ERROR);
if (dstBuf == null || x < 0 || y < 0 || desiredWidth < 0 || stride < 0 || if (dstBuf == null || x < 0 || y < 0 || stride < 0 ||
desiredHeight < 0 || pixelFormat < 0 || pixelFormat >= TJ.NUMPF || (yuvImage != null && (desiredWidth < 0 || desiredHeight < 0)) ||
flags < 0) pixelFormat < 0 || pixelFormat >= TJ.NUMPF || flags < 0)
throw new Exception("Invalid argument in decompress()"); throw new Exception("Invalid argument in decompress()");
if (yuvImage != null)
decodeYUV(yuvImage.getBuf(), yuvImage.getPad(), yuvImage.getSubsamp(),
dstBuf, x, y, yuvImage.getWidth(), stride,
yuvImage.getHeight(), pixelFormat, flags);
else
decompress(jpegBuf, jpegBufSize, dstBuf, x, y, desiredWidth, stride, decompress(jpegBuf, jpegBufSize, dstBuf, x, y, desiredWidth, stride,
desiredHeight, pixelFormat, flags); desiredHeight, pixelFormat, flags);
} }
/** /**
* Decompress the JPEG source image associated with this decompressor * Decompress the JPEG source image or decode the YUV source image associated
* instance and output a decompressed image to the given * with this decompressor instance and output a decompressed/decoded image to
* <code>BufferedImage</code> instance. * the given <code>BufferedImage</code> instance.
* *
* @param dstImage a <code>BufferedImage</code> instance that will receive * @param dstImage a <code>BufferedImage</code> instance that will receive
* the decompressed image * the decompressed/decoded image. If the source image is a JPEG image, then
* the width and height of the <code>BufferedImage</code> instance must match
* one of the scaled image sizes that TurboJPEG is capable of generating from
* the JPEG image. If the source image is a YUV image, then the width and
* height of the <code>BufferedImage</code> instance must match the width and
* height of the YUV image.
* *
* @param flags the bitwise OR of one or more of {@link TJ TJ.FLAG_*} * @param flags the bitwise OR of one or more of
* {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*}
*/ */
public void decompress(BufferedImage dstImage, int flags) throws Exception { public void decompress(BufferedImage dstImage, int flags) throws Exception {
if (dstImage == null || flags < 0) if (dstImage == null || flags < 0)
throw new Exception("Invalid argument in decompress()"); throw new Exception("Invalid argument in decompress()");
int desiredWidth = dstImage.getWidth(); int desiredWidth = dstImage.getWidth();
int desiredHeight = dstImage.getHeight(); int desiredHeight = dstImage.getHeight();
int scaledWidth = getScaledWidth(desiredWidth, desiredHeight); int scaledWidth, scaledHeight;
int scaledHeight = getScaledHeight(desiredWidth, desiredHeight);
if (yuvImage != null) {
if (desiredWidth != yuvImage.getWidth() ||
desiredHeight != yuvImage.getHeight())
throw new Exception("BufferedImage dimensions do not match the dimensions of the source image.");
scaledWidth = yuvImage.getWidth();
scaledHeight = yuvImage.getHeight();
} else {
scaledWidth = getScaledWidth(desiredWidth, desiredHeight);
scaledHeight = getScaledHeight(desiredWidth, desiredHeight);
if (scaledWidth != desiredWidth || scaledHeight != desiredHeight) if (scaledWidth != desiredWidth || scaledHeight != desiredHeight)
throw new Exception("BufferedImage dimensions do not match a scaled image size that TurboJPEG is capable of generating."); throw new Exception("BufferedImage dimensions do not match one of the scaled image sizes that TurboJPEG is capable of generating.");
}
int pixelFormat; boolean intPixels = false; int pixelFormat; boolean intPixels = false;
if (byteOrder == null) if (byteOrder == null)
byteOrder = ByteOrder.nativeOrder(); byteOrder = ByteOrder.nativeOrder();
@@ -599,10 +733,16 @@ public class TJDecompressor {
int stride = sm.getScanlineStride(); int stride = sm.getScanlineStride();
DataBufferInt db = (DataBufferInt)wr.getDataBuffer(); DataBufferInt db = (DataBufferInt)wr.getDataBuffer();
int[] buf = db.getData(); int[] buf = db.getData();
if (yuvImage != null)
decodeYUV(yuvImage.getBuf(), yuvImage.getPad(), yuvImage.getSubsamp(),
buf, 0, 0, yuvImage.getWidth(), stride, yuvImage.getHeight(),
pixelFormat, flags);
else {
if (jpegBuf == null) if (jpegBuf == null)
throw new Exception(NO_ASSOC_ERROR); throw new Exception(NO_ASSOC_ERROR);
decompress(jpegBuf, jpegBufSize, buf, scaledWidth, stride, scaledHeight, decompress(jpegBuf, jpegBufSize, buf, 0, 0, scaledWidth, stride,
pixelFormat, flags); scaledHeight, pixelFormat, flags);
}
} else { } else {
ComponentSampleModel sm = ComponentSampleModel sm =
(ComponentSampleModel)dstImage.getSampleModel(); (ComponentSampleModel)dstImage.getSampleModel();
@@ -612,14 +752,15 @@ public class TJDecompressor {
int pitch = sm.getScanlineStride(); int pitch = sm.getScanlineStride();
DataBufferByte db = (DataBufferByte)wr.getDataBuffer(); DataBufferByte db = (DataBufferByte)wr.getDataBuffer();
byte[] buf = db.getData(); byte[] buf = db.getData();
decompress(buf, scaledWidth, pitch, scaledHeight, pixelFormat, flags); decompress(buf, 0, 0, scaledWidth, pitch, scaledHeight, pixelFormat,
flags);
} }
} }
/** /**
* Decompress the JPEG source image associated with this decompressor * Decompress the JPEG source image or decode the YUV source image associated
* instance and return a <code>BufferedImage</code> instance containing the * with this decompressor instance and return a <code>BufferedImage</code>
* decompressed image. * instance containing the decompressed/decoded image.
* *
* @param desiredWidth see * @param desiredWidth see
* {@link #decompress(byte[], int, int, int, int, int, int, int)} for * {@link #decompress(byte[], int, int, int, int, int, int, int)} for
@@ -629,19 +770,21 @@ public class TJDecompressor {
* {@link #decompress(byte[], int, int, int, int, int, int, int)} for * {@link #decompress(byte[], int, int, int, int, int, int, int)} for
* description * description
* *
* @param bufferedImageType the image type of the newly-created * @param bufferedImageType the image type of the <code>BufferedImage</code>
* <code>BufferedImage</code> instance (for instance, * instance that will be created (for instance,
* <code>BufferedImage.TYPE_INT_RGB</code>) * <code>BufferedImage.TYPE_INT_RGB</code>)
* *
* @param flags the bitwise OR of one or more of {@link TJ TJ.FLAG_*} * @param flags the bitwise OR of one or more of
* {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*}
* *
* @return a <code>BufferedImage</code> instance containing the * @return a <code>BufferedImage</code> instance containing the
* decompressed image * decompressed/decoded image
*/ */
public BufferedImage decompress(int desiredWidth, int desiredHeight, public BufferedImage decompress(int desiredWidth, int desiredHeight,
int bufferedImageType, int flags) int bufferedImageType, int flags)
throws Exception { throws Exception {
if (desiredWidth < 0 || desiredHeight < 0 || flags < 0) if ((yuvImage == null && (desiredWidth < 0 || desiredHeight < 0)) ||
flags < 0)
throw new Exception("Invalid argument in decompress()"); throw new Exception("Invalid argument in decompress()");
int scaledWidth = getScaledWidth(desiredWidth, desiredHeight); int scaledWidth = getScaledWidth(desiredWidth, desiredHeight);
int scaledHeight = getScaledHeight(desiredWidth, desiredHeight); int scaledHeight = getScaledHeight(desiredWidth, desiredHeight);
@@ -696,6 +839,14 @@ public class TJDecompressor {
private native void decompressToYUV(byte[] srcBuf, int size, byte[] dstBuf, private native void decompressToYUV(byte[] srcBuf, int size, byte[] dstBuf,
int desiredWidth, int pad, int desiredheight, int flags) throws Exception; int desiredWidth, int pad, int desiredheight, int flags) throws Exception;
private native void decodeYUV(byte[] srcBuf, int pad, int subsamp,
byte[] dstBuf, int x, int y, int width, int pitch, int height,
int pixelFormat, int flags) throws Exception;
private native void decodeYUV(byte[] srcBuf, int pad, int subsamp,
int[] dstBuf, int x, int y, int width, int stride, int height,
int pixelFormat, int flags) throws Exception;
static { static {
TJLoader.load(); TJLoader.load();
} }
@@ -703,9 +854,10 @@ public class TJDecompressor {
protected long handle = 0; protected long handle = 0;
protected byte[] jpegBuf = null; protected byte[] jpegBuf = null;
protected int jpegBufSize = 0; protected int jpegBufSize = 0;
protected int jpegWidth = 0; protected YUVImage yuvImage = null;
protected int jpegHeight = 0; protected int srcWidth = 0;
protected int jpegSubsamp = -1; protected int srcHeight = 0;
protected int jpegColorspace = -1; protected int srcSubsamp = -1;
protected int srcColorspace = -1;
private ByteOrder byteOrder = null; private ByteOrder byteOrder = null;
}; };

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C)2011, 2013 D. R. Commander. All Rights Reserved. * Copyright (C)2011, 2013-2014 D. R. Commander. All Rights Reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are met:
@@ -42,20 +42,20 @@ public class TJTransformer extends TJDecompressor {
/** /**
* Create a TurboJPEG lossless transformer instance and associate the JPEG * Create a TurboJPEG lossless transformer instance and associate the JPEG
* image stored in <code>jpegImage</code> with the newly-created instance. * image stored in <code>jpegImage</code> with the newly created instance.
* *
* @param jpegImage JPEG image buffer (size of the JPEG image is assumed to * @param jpegImage JPEG image buffer (size of the JPEG image is assumed to
* be the length of the array) * be the length of the array)
*/ */
public TJTransformer(byte[] jpegImage) throws Exception { public TJTransformer(byte[] jpegImage) throws Exception {
init(); init();
setJPEGImage(jpegImage, jpegImage.length); setSourceImage(jpegImage, jpegImage.length);
} }
/** /**
* Create a TurboJPEG lossless transformer instance and associate the JPEG * Create a TurboJPEG lossless transformer instance and associate the JPEG
* image of length <code>imageSize</code> bytes stored in * image of length <code>imageSize</code> bytes stored in
* <code>jpegImage</code> with the newly-created instance. * <code>jpegImage</code> with the newly created instance.
* *
* @param jpegImage JPEG image buffer * @param jpegImage JPEG image buffer
* *
@@ -63,7 +63,7 @@ public class TJTransformer extends TJDecompressor {
*/ */
public TJTransformer(byte[] jpegImage, int imageSize) throws Exception { public TJTransformer(byte[] jpegImage, int imageSize) throws Exception {
init(); init();
setJPEGImage(jpegImage, imageSize); setSourceImage(jpegImage, imageSize);
} }
/** /**
@@ -84,13 +84,14 @@ public class TJTransformer extends TJDecompressor {
* receive a JPEG image that has been transformed using the parameters in * receive a JPEG image that has been transformed using the parameters in
* <code>transforms[i]</code>. Use {@link TJ#bufSize} to determine the * <code>transforms[i]</code>. Use {@link TJ#bufSize} to determine the
* maximum size for each buffer based on the transformed or cropped width and * maximum size for each buffer based on the transformed or cropped width and
* height. * height and the level of subsampling used in the source image.
* *
* @param transforms an array of {@link TJTransform} instances, each of * @param transforms an array of {@link TJTransform} instances, each of
* which specifies the transform parameters and/or cropping region for the * which specifies the transform parameters and/or cropping region for the
* corresponding transformed output image * corresponding transformed output image
* *
* @param flags the bitwise OR of one or more of {@link TJ TJ.FLAG_*} * @param flags the bitwise OR of one or more of
* {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*}
*/ */
public void transform(byte[][] dstBufs, TJTransform[] transforms, public void transform(byte[][] dstBufs, TJTransform[] transforms,
int flags) throws Exception { int flags) throws Exception {
@@ -112,20 +113,21 @@ public class TJTransformer extends TJDecompressor {
* @return an array of {@link TJDecompressor} instances, each of * @return an array of {@link TJDecompressor} instances, each of
* which has a transformed JPEG image associated with it * which has a transformed JPEG image associated with it
* *
* @param flags the bitwise OR of one or more of {@link TJ TJ.FLAG_*} * @param flags the bitwise OR of one or more of
* {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*}
*/ */
public TJDecompressor[] transform(TJTransform[] transforms, int flags) public TJDecompressor[] transform(TJTransform[] transforms, int flags)
throws Exception { throws Exception {
byte[][] dstBufs = new byte[transforms.length][]; byte[][] dstBufs = new byte[transforms.length][];
if (jpegWidth < 1 || jpegHeight < 1) if (srcWidth < 1 || srcHeight < 1)
throw new Exception("JPEG buffer not initialized"); throw new Exception("JPEG buffer not initialized");
for (int i = 0; i < transforms.length; i++) { for (int i = 0; i < transforms.length; i++) {
int w = jpegWidth, h = jpegHeight; int w = srcWidth, h = srcHeight;
if ((transforms[i].options & TJTransform.OPT_CROP) != 0) { if ((transforms[i].options & TJTransform.OPT_CROP) != 0) {
if (transforms[i].width != 0) w = transforms[i].width; if (transforms[i].width != 0) w = transforms[i].width;
if (transforms[i].height != 0) h = transforms[i].height; if (transforms[i].height != 0) h = transforms[i].height;
} }
dstBufs[i] = new byte[TJ.bufSize(w, h, jpegSubsamp)]; dstBufs[i] = new byte[TJ.bufSize(w, h, srcSubsamp)];
} }
TJDecompressor[] tjd = new TJDecompressor[transforms.length]; TJDecompressor[] tjd = new TJDecompressor[transforms.length];
transform(dstBufs, transforms, flags); transform(dstBufs, transforms, flags);
@@ -135,11 +137,11 @@ public class TJTransformer extends TJDecompressor {
} }
/** /**
* Returns an array containing the sizes of the transformed JPEG images from * Returns an array containing the sizes of the transformed JPEG images
* the most recent call to {@link #transform transform()}. * generated by the most recent transform operation.
* *
* @return an array containing the sizes of the transformed JPEG images from * @return an array containing the sizes of the transformed JPEG images
* the most recent call to {@link #transform transform()} * generated by the most recent transform operation
*/ */
public int[] getTransformedSizes() throws Exception { public int[] getTransformedSizes() throws Exception {
if (transformedSizes == null) if (transformedSizes == null)

View File

@@ -0,0 +1,213 @@
/*
* Copyright (C)2014 D. R. Commander. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* - Neither the name of the libjpeg-turbo Project nor the names of its
* contributors may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS",
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
package org.libjpegturbo.turbojpeg;
/**
* This class encapsulates a YUV planar image buffer and the metadata
* associated with it. The TurboJPEG API allows both the JPEG compression and
* decompression pipelines to be split into stages: YUV encode, compress from
* YUV, decompress to YUV, and YUV decode. A <code>YUVImage</code> instance
* serves as the destination image for YUV encode and decompress-to-YUV
* operations and as the source image for compress-from-YUV and YUV decode
* operations.
* <p>
* Technically, the JPEG format uses the YCbCr colorspace (which technically is
* not a "colorspace" but rather a "color transform"), but per the convention
* of the digital video community, the TurboJPEG API uses "YUV" to refer to an
* image format consisting of Y, Cb, and Cr image planes. In this image
* format, the Y, Cb (U), and Cr (V) planes are stored sequentially in the same
* image buffer, and the size of each plane is determined by the image width,
* height, line padding, and level of chrominance subsampling. If the
* chrominance components are subsampled along the horizontal dimension, then
* the width of the luminance plane would be padded to the nearest multiple of
* 2 (same goes for the height of the luminance plane, if the chrominance
* components are subsampled along the vertical dimension.) For instance, if
* the source image is 35 x 35 pixels and 4:2:2 subsampling is used, then the
* luminance plane would be 36 x 35 bytes, and each of the chrominance planes
* would be 18 x 35 bytes. If you specify, for instance, a line padding of 4
* bytes on top of this, then the luminance plane would be 36 x 35 bytes, and
* each of the chrominance planes would be 20 x 35 bytes.
*/
public class YUVImage {
private static final String NO_ASSOC_ERROR =
"No YUV buffer is associated with this instance";
/**
* Create a <code>YUVImage</code> instance with a new image buffer.
*
* @param width width (in pixels) of the YUV image
*
* @param pad Each line of each plane in the YUV image buffer will be padded
* to this number of bytes (must be a power of 2.)
*
* @param height height (in pixels) of the YUV image
*
* @param subsamp the level of chrominance subsampling to be used in the YUV
* image (one of {@link TJ#SAMP_444 TJ.SAMP_*})
*/
public YUVImage(int width, int pad, int height, int subsamp)
throws Exception {
setBuf(new byte[TJ.bufSizeYUV(width, pad, height, subsamp)], width, pad,
height, subsamp);
}
/**
* Create a <code>YUVImage</code> instance from an existing YUV planar image
* buffer.
*
* @param yuvImage image buffer that contains or will contain YUV planar
* image data. See {@link YUVImage above} for a description of the image
* format. Use {@link TJ#bufSizeYUV} to determine the minimum size for this
* buffer.
*
* @param width width (in pixels) of the YUV image
*
* @param pad the line padding used in the YUV image buffer. For
* instance, if each line in each plane of the buffer is padded to the
* nearest multiple of 4 bytes, then <code>pad</code> should be set to 4.
*
* @param height height (in pixels) of the YUV image
*
* @param subsamp the level of chrominance subsampling used in the YUV
* image (one of {@link TJ#SAMP_444 TJ.SAMP_*})
*/
public YUVImage(byte[] yuvImage, int width, int pad, int height,
int subsamp) throws Exception {
setBuf(yuvImage, width, pad, height, subsamp);
}
/**
* Assign an existing YUV planar image buffer to this <code>YUVImage</code>
* instance.
*
* @param yuvImage image buffer that contains or will contain YUV planar
* image data. See {@link YUVImage above} for a description of the image
* format. Use {@link TJ#bufSizeYUV} to determine the minimum size for this
* buffer.
*
* @param width width (in pixels) of the YUV image
*
* @param pad the line padding used in the YUV image buffer. For
* instance, if each line in each plane of the buffer is padded to the
* nearest multiple of 4 bytes, then <code>pad</code> should be set to 4.
*
* @param height height (in pixels) of the YUV image
*
* @param subsamp the level of chrominance subsampling used in the YUV
* image (one of {@link TJ#SAMP_444 TJ.SAMP_*})
*/
public void setBuf(byte[] yuvImage, int width, int pad, int height,
int subsamp) throws Exception {
if (yuvImage == null || width < 1 || pad < 1 || ((pad & (pad - 1)) != 0) ||
height < 1 || subsamp < 0 || subsamp >= TJ.NUMSAMP)
throw new Exception("Invalid argument in YUVImage()");
if (yuvImage.length < TJ.bufSizeYUV(width, pad, height, subsamp))
throw new Exception("YUV image buffer is not large enough");
yuvBuf = yuvImage;
yuvWidth = width;
yuvPad = pad;
yuvHeight = height;
yuvSubsamp = subsamp;
}
/**
* Returns the width of the YUV image.
*
* @return the width of the YUV image
*/
public int getWidth() throws Exception {
if (yuvWidth < 1)
throw new Exception(NO_ASSOC_ERROR);
return yuvWidth;
}
/**
* Returns the height of the YUV image.
*
* @return the height of the YUV image
*/
public int getHeight() throws Exception {
if (yuvHeight < 1)
throw new Exception(NO_ASSOC_ERROR);
return yuvHeight;
}
/**
* Returns the line padding used in the YUV image buffer.
*
* @return the line padding used in the YUV image buffer
*/
public int getPad() throws Exception {
if (yuvPad < 1 || ((yuvPad & (yuvPad - 1)) != 0))
throw new Exception(NO_ASSOC_ERROR);
return yuvPad;
}
/**
* Returns the level of chrominance subsampling used in the YUV image. See
* {@link TJ#SAMP_444 TJ.SAMP_*}.
*
* @return the level of chrominance subsampling used in the YUV image
*/
public int getSubsamp() throws Exception {
if (yuvSubsamp < 0 || yuvSubsamp >= TJ.NUMSAMP)
throw new Exception(NO_ASSOC_ERROR);
return yuvSubsamp;
}
/**
* Returns the YUV image buffer
*
* @return the YUV image buffer
*/
public byte[] getBuf() throws Exception {
if (yuvBuf == null)
throw new Exception(NO_ASSOC_ERROR);
return yuvBuf;
}
/**
* Returns the size (in bytes) of the YUV image buffer
*
* @return the size (in bytes) of the YUV image buffer
*/
public int getSize() throws Exception {
if (yuvBuf == null)
throw new Exception(NO_ASSOC_ERROR);
return TJ.bufSizeYUV(yuvWidth, yuvPad, yuvHeight, yuvSubsamp);
}
protected long handle = 0;
protected byte[] yuvBuf = null;
protected int yuvPad = 0;
protected int yuvWidth = 0;
protected int yuvHeight = 0;
protected int yuvSubsamp = -1;
};

View File

@@ -74,10 +74,10 @@ JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_encodeYUV___
/* /*
* Class: org_libjpegturbo_turbojpeg_TJCompressor * Class: org_libjpegturbo_turbojpeg_TJCompressor
* Method: encodeYUV * Method: encodeYUV
* Signature: ([BIIII[BIII)V * Signature: ([BIIIIII[BIII)V
*/ */
JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_encodeYUV___3BIIII_3BIII JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_encodeYUV___3BIIIIII_3BIII
(JNIEnv *, jobject, jbyteArray, jint, jint, jint, jint, jbyteArray, jint, jint, jint); (JNIEnv *, jobject, jbyteArray, jint, jint, jint, jint, jint, jint, jbyteArray, jint, jint, jint);
/* /*
* Class: org_libjpegturbo_turbojpeg_TJCompressor * Class: org_libjpegturbo_turbojpeg_TJCompressor
@@ -90,10 +90,10 @@ JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_encodeYUV___
/* /*
* Class: org_libjpegturbo_turbojpeg_TJCompressor * Class: org_libjpegturbo_turbojpeg_TJCompressor
* Method: encodeYUV * Method: encodeYUV
* Signature: ([IIIII[BIII)V * Signature: ([IIIIIII[BIII)V
*/ */
JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_encodeYUV___3IIIII_3BIII JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_encodeYUV___3IIIIIII_3BIII
(JNIEnv *, jobject, jintArray, jint, jint, jint, jint, jbyteArray, jint, jint, jint); (JNIEnv *, jobject, jintArray, jint, jint, jint, jint, jint, jint, jbyteArray, jint, jint, jint);
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@@ -79,6 +79,22 @@ JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompress
JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompressToYUV___3BI_3BIIII JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompressToYUV___3BI_3BIIII
(JNIEnv *, jobject, jbyteArray, jint, jbyteArray, jint, jint, jint, jint); (JNIEnv *, jobject, jbyteArray, jint, jbyteArray, jint, jint, jint, jint);
/*
* Class: org_libjpegturbo_turbojpeg_TJDecompressor
* Method: decodeYUV
* Signature: ([BII[BIIIIIII)V
*/
JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJDecompressor_decodeYUV___3BII_3BIIIIIII
(JNIEnv *, jobject, jbyteArray, jint, jint, jbyteArray, jint, jint, jint, jint, jint, jint, jint);
/*
* Class: org_libjpegturbo_turbojpeg_TJDecompressor
* Method: decodeYUV
* Signature: ([BII[IIIIIIII)V
*/
JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJDecompressor_decodeYUV___3BII_3IIIIIIII
(JNIEnv *, jobject, jbyteArray, jint, jint, jintArray, jint, jint, jint, jint, jint, jint, jint);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@@ -22,8 +22,36 @@
#include "jchuff.h" /* Declarations shared with jcphuff.c */ #include "jchuff.h" /* Declarations shared with jcphuff.c */
#include <limits.h> #include <limits.h>
/*
* NOTE: If USE_CLZ_INTRINSIC is defined, then clz/bsr instructions will be
* used for bit counting rather than the lookup table. This will reduce the
* memory footprint by 64k, which is important for some mobile applications
* that create many isolated instances of libjpeg-turbo (web browsers, for
* instance.) This may improve performance on some mobile platforms as well.
* This feature is enabled by default only on ARM processors, because some x86
* chips have a slow implementation of bsr, and the use of clz/bsr cannot be
* shown to have a significant performance impact even on the x86 chips that
* have a fast implementation of it. When building for ARMv6, you can
* explicitly disable the use of clz/bsr by adding -mthumb to the compiler
* flags (this defines __thumb__).
*/
/* NOTE: Both GCC and Clang define __GNUC__ */
#if defined __GNUC__ && defined __arm__
#if !defined __thumb__ || defined __thumb2__
#define USE_CLZ_INTRINSIC
#endif
#endif
#ifdef USE_CLZ_INTRINSIC
#define JPEG_NBITS_NONZERO(x) (32 - __builtin_clz(x))
#define JPEG_NBITS(x) (x ? JPEG_NBITS_NONZERO(x) : 0)
#else
static unsigned char jpeg_nbits_table[65536]; static unsigned char jpeg_nbits_table[65536];
static int jpeg_nbits_table_init = 0; static int jpeg_nbits_table_init = 0;
#define JPEG_NBITS(x) (jpeg_nbits_table[x])
#define JPEG_NBITS_NONZERO(x) JPEG_NBITS(x)
#endif
#ifndef min #ifndef min
#define min(a,b) ((a)<(b)?(a):(b)) #define min(a,b) ((a)<(b)?(a):(b))
@@ -272,6 +300,7 @@ jpeg_make_c_derived_tbl (j_compress_ptr cinfo, boolean isDC, int tblno,
dtbl->ehufsi[i] = huffsize[p]; dtbl->ehufsi[i] = huffsize[p];
} }
#ifndef USE_CLZ_INTRINSIC
if(!jpeg_nbits_table_init) { if(!jpeg_nbits_table_init) {
for(i = 0; i < 65536; i++) { for(i = 0; i < 65536; i++) {
int nbits = 0, temp = i; int nbits = 0, temp = i;
@@ -280,6 +309,7 @@ jpeg_make_c_derived_tbl (j_compress_ptr cinfo, boolean isDC, int tblno,
} }
jpeg_nbits_table_init = 1; jpeg_nbits_table_init = 1;
} }
#endif
} }
@@ -482,7 +512,7 @@ encode_one_block (working_state * state, JCOEFPTR block, int last_dc_val,
temp2 += temp3; temp2 += temp3;
/* Find the number of bits needed for the magnitude of the coefficient */ /* Find the number of bits needed for the magnitude of the coefficient */
nbits = jpeg_nbits_table[temp]; nbits = JPEG_NBITS(temp);
/* Emit the Huffman-coded symbol for the number of bits */ /* Emit the Huffman-coded symbol for the number of bits */
code = dctbl->ehufco[nbits]; code = dctbl->ehufco[nbits];
@@ -516,7 +546,7 @@ encode_one_block (working_state * state, JCOEFPTR block, int last_dc_val,
temp ^= temp3; \ temp ^= temp3; \
temp -= temp3; \ temp -= temp3; \
temp2 += temp3; \ temp2 += temp3; \
nbits = jpeg_nbits_table[temp]; \ nbits = JPEG_NBITS_NONZERO(temp); \
/* if run length > 15, must emit special run-length-16 codes (0xF0) */ \ /* if run length > 15, must emit special run-length-16 codes (0xF0) */ \
while (r > 15) { \ while (r > 15) { \
EMIT_BITS(code_0xf0, size_0xf0) \ EMIT_BITS(code_0xf0, size_0xf0) \

113
jcparam.c
View File

@@ -18,6 +18,7 @@
#define JPEG_INTERNALS #define JPEG_INTERNALS
#include "jinclude.h" #include "jinclude.h"
#include "jpeglib.h" #include "jpeglib.h"
#include "jstdhuff.c"
/* /*
@@ -191,116 +192,6 @@ jpeg_set_quality (j_compress_ptr cinfo, int quality, boolean force_baseline)
} }
/*
* Huffman table setup routines
*/
LOCAL(void)
add_huff_table (j_compress_ptr cinfo,
JHUFF_TBL **htblptr, const UINT8 *bits, const UINT8 *val)
/* Define a Huffman table */
{
int nsymbols, len;
if (*htblptr == NULL)
*htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo);
/* Copy the number-of-symbols-of-each-code-length counts */
MEMCOPY((*htblptr)->bits, bits, SIZEOF((*htblptr)->bits));
/* Validate the counts. We do this here mainly so we can copy the right
* number of symbols from the val[] array, without risking marching off
* the end of memory. jchuff.c will do a more thorough test later.
*/
nsymbols = 0;
for (len = 1; len <= 16; len++)
nsymbols += bits[len];
if (nsymbols < 1 || nsymbols > 256)
ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);
MEMCOPY((*htblptr)->huffval, val, nsymbols * SIZEOF(UINT8));
/* Initialize sent_table FALSE so table will be written to JPEG file. */
(*htblptr)->sent_table = FALSE;
}
LOCAL(void)
std_huff_tables (j_compress_ptr cinfo)
/* Set up the standard Huffman tables (cf. JPEG standard section K.3) */
/* IMPORTANT: these are only valid for 8-bit data precision! */
{
static const UINT8 bits_dc_luminance[17] =
{ /* 0-base */ 0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0 };
static const UINT8 val_dc_luminance[] =
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 };
static const UINT8 bits_dc_chrominance[17] =
{ /* 0-base */ 0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0 };
static const UINT8 val_dc_chrominance[] =
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 };
static const UINT8 bits_ac_luminance[17] =
{ /* 0-base */ 0, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 0x7d };
static const UINT8 val_ac_luminance[] =
{ 0x01, 0x02, 0x03, 0x00, 0x04, 0x11, 0x05, 0x12,
0x21, 0x31, 0x41, 0x06, 0x13, 0x51, 0x61, 0x07,
0x22, 0x71, 0x14, 0x32, 0x81, 0x91, 0xa1, 0x08,
0x23, 0x42, 0xb1, 0xc1, 0x15, 0x52, 0xd1, 0xf0,
0x24, 0x33, 0x62, 0x72, 0x82, 0x09, 0x0a, 0x16,
0x17, 0x18, 0x19, 0x1a, 0x25, 0x26, 0x27, 0x28,
0x29, 0x2a, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39,
0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49,
0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59,
0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69,
0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79,
0x7a, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89,
0x8a, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98,
0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7,
0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6,
0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3, 0xc4, 0xc5,
0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2, 0xd3, 0xd4,
0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xe1, 0xe2,
0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea,
0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8,
0xf9, 0xfa };
static const UINT8 bits_ac_chrominance[17] =
{ /* 0-base */ 0, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 0x77 };
static const UINT8 val_ac_chrominance[] =
{ 0x00, 0x01, 0x02, 0x03, 0x11, 0x04, 0x05, 0x21,
0x31, 0x06, 0x12, 0x41, 0x51, 0x07, 0x61, 0x71,
0x13, 0x22, 0x32, 0x81, 0x08, 0x14, 0x42, 0x91,
0xa1, 0xb1, 0xc1, 0x09, 0x23, 0x33, 0x52, 0xf0,
0x15, 0x62, 0x72, 0xd1, 0x0a, 0x16, 0x24, 0x34,
0xe1, 0x25, 0xf1, 0x17, 0x18, 0x19, 0x1a, 0x26,
0x27, 0x28, 0x29, 0x2a, 0x35, 0x36, 0x37, 0x38,
0x39, 0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48,
0x49, 0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58,
0x59, 0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68,
0x69, 0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78,
0x79, 0x7a, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
0x88, 0x89, 0x8a, 0x92, 0x93, 0x94, 0x95, 0x96,
0x97, 0x98, 0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5,
0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4,
0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3,
0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2,
0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda,
0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9,
0xea, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8,
0xf9, 0xfa };
add_huff_table(cinfo, &cinfo->dc_huff_tbl_ptrs[0],
bits_dc_luminance, val_dc_luminance);
add_huff_table(cinfo, &cinfo->ac_huff_tbl_ptrs[0],
bits_ac_luminance, val_ac_luminance);
add_huff_table(cinfo, &cinfo->dc_huff_tbl_ptrs[1],
bits_dc_chrominance, val_dc_chrominance);
add_huff_table(cinfo, &cinfo->ac_huff_tbl_ptrs[1],
bits_ac_chrominance, val_ac_chrominance);
}
/* /*
* Default parameter setup for compression. * Default parameter setup for compression.
* *
@@ -339,7 +230,7 @@ jpeg_set_defaults (j_compress_ptr cinfo)
/* Set up two quantization tables using default quality of 75 */ /* Set up two quantization tables using default quality of 75 */
jpeg_set_quality(cinfo, 75, TRUE); jpeg_set_quality(cinfo, 75, TRUE);
/* Set up two Huffman tables */ /* Set up two Huffman tables */
std_huff_tables(cinfo); std_huff_tables((j_common_ptr) cinfo);
/* Initialize default arithmetic coding conditioning */ /* Initialize default arithmetic coding conditioning */
for (i = 0; i < NUM_ARITH_TBLS; i++) { for (i = 0; i < NUM_ARITH_TBLS; i++) {

View File

@@ -80,7 +80,7 @@ int main(void)
jerr.pub.output_message = my_output_message; jerr.pub.output_message = my_output_message;
if(setjmp(jerr.jb)) { if(setjmp(jerr.jb)) {
// this will execute if libjpeg has an error /* this will execute if libjpeg has an error */
jcs_valid = 0; jcs_valid = 0;
goto done; goto done;
} }
@@ -108,7 +108,7 @@ int main(void)
#endif #endif
if(setjmp(jerr.jb)) { if(setjmp(jerr.jb)) {
// this will execute if libjpeg has an error /* this will execute if libjpeg has an error */
jcs_alpha_valid = 0; jcs_alpha_valid = 0;
goto done2; goto done2;
} }

View File

@@ -21,6 +21,7 @@
#include "jpeglib.h" #include "jpeglib.h"
#include "jdhuff.h" /* Declarations shared with jdphuff.c */ #include "jdhuff.h" /* Declarations shared with jdphuff.c */
#include "jpegcomp.h" #include "jpegcomp.h"
#include "jstdhuff.c"
/* /*
@@ -795,6 +796,12 @@ jinit_huff_decoder (j_decompress_ptr cinfo)
huff_entropy_ptr entropy; huff_entropy_ptr entropy;
int i; int i;
/* Motion JPEG frames typically do not include the Huffman tables if they
are the default tables. Thus, if the tables are not set by the time
the Huffman decoder is initialized (usually within the body of
jpeg_start_decompress()), we set them to default values. */
std_huff_tables((j_common_ptr) cinfo);
entropy = (huff_entropy_ptr) entropy = (huff_entropy_ptr)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
SIZEOF(huff_entropy_decoder)); SIZEOF(huff_entropy_decoder));

View File

@@ -478,13 +478,14 @@ get_dht (j_decompress_ptr cinfo)
if (index & 0x10) { /* AC table definition */ if (index & 0x10) { /* AC table definition */
index -= 0x10; index -= 0x10;
htblptr = &cinfo->ac_huff_tbl_ptrs[index];
} else { /* DC table definition */
htblptr = &cinfo->dc_huff_tbl_ptrs[index];
}
if (index < 0 || index >= NUM_HUFF_TBLS) if (index < 0 || index >= NUM_HUFF_TBLS)
ERREXIT1(cinfo, JERR_DHT_INDEX, index); ERREXIT1(cinfo, JERR_DHT_INDEX, index);
htblptr = &cinfo->ac_huff_tbl_ptrs[index];
} else { /* DC table definition */
if (index < 0 || index >= NUM_HUFF_TBLS)
ERREXIT1(cinfo, JERR_DHT_INDEX, index);
htblptr = &cinfo->dc_huff_tbl_ptrs[index];
}
if (*htblptr == NULL) if (*htblptr == NULL)
*htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo); *htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo);

View File

@@ -198,6 +198,7 @@ start_pass_phuff_decoder (j_decompress_ptr cinfo)
* On some machines, a shift and add will be faster than a table lookup. * On some machines, a shift and add will be faster than a table lookup.
*/ */
#define AVOID_TABLES
#ifdef AVOID_TABLES #ifdef AVOID_TABLES
#define HUFF_EXTEND(x,s) ((x) < (1<<((s)-1)) ? (x) + (((-1)<<(s)) + 1) : (x)) #define HUFF_EXTEND(x,s) ((x) < (1<<((s)-1)) ? (x) + (((-1)<<(s)) + 1) : (x))

133
jstdhuff.c Normal file
View File

@@ -0,0 +1,133 @@
/*
* jstdhuff.c
*
* This file was part of the Independent JPEG Group's software:
* Copyright (C) 1991-1998, Thomas G. Lane.
* libjpeg-turbo Modifications:
* Copyright (C) 2013, D. R. Commander.
* For conditions of distribution and use, see the accompanying README file.
*
* This file contains routines to set the default Huffman tables, if they are
* not already set.
*/
/*
* Huffman table setup routines
*/
LOCAL(void)
add_huff_table (j_common_ptr cinfo,
JHUFF_TBL **htblptr, const UINT8 *bits, const UINT8 *val)
/* Define a Huffman table */
{
int nsymbols, len;
if (*htblptr == NULL)
*htblptr = jpeg_alloc_huff_table(cinfo);
else
return;
/* Copy the number-of-symbols-of-each-code-length counts */
MEMCOPY((*htblptr)->bits, bits, SIZEOF((*htblptr)->bits));
/* Validate the counts. We do this here mainly so we can copy the right
* number of symbols from the val[] array, without risking marching off
* the end of memory. jchuff.c will do a more thorough test later.
*/
nsymbols = 0;
for (len = 1; len <= 16; len++)
nsymbols += bits[len];
if (nsymbols < 1 || nsymbols > 256)
ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);
MEMCOPY((*htblptr)->huffval, val, nsymbols * SIZEOF(UINT8));
/* Initialize sent_table FALSE so table will be written to JPEG file. */
(*htblptr)->sent_table = FALSE;
}
LOCAL(void)
std_huff_tables (j_common_ptr cinfo)
/* Set up the standard Huffman tables (cf. JPEG standard section K.3) */
/* IMPORTANT: these are only valid for 8-bit data precision! */
{
JHUFF_TBL **dc_huff_tbl_ptrs, **ac_huff_tbl_ptrs;
static const UINT8 bits_dc_luminance[17] =
{ /* 0-base */ 0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0 };
static const UINT8 val_dc_luminance[] =
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 };
static const UINT8 bits_dc_chrominance[17] =
{ /* 0-base */ 0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0 };
static const UINT8 val_dc_chrominance[] =
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 };
static const UINT8 bits_ac_luminance[17] =
{ /* 0-base */ 0, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 0x7d };
static const UINT8 val_ac_luminance[] =
{ 0x01, 0x02, 0x03, 0x00, 0x04, 0x11, 0x05, 0x12,
0x21, 0x31, 0x41, 0x06, 0x13, 0x51, 0x61, 0x07,
0x22, 0x71, 0x14, 0x32, 0x81, 0x91, 0xa1, 0x08,
0x23, 0x42, 0xb1, 0xc1, 0x15, 0x52, 0xd1, 0xf0,
0x24, 0x33, 0x62, 0x72, 0x82, 0x09, 0x0a, 0x16,
0x17, 0x18, 0x19, 0x1a, 0x25, 0x26, 0x27, 0x28,
0x29, 0x2a, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39,
0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49,
0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59,
0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69,
0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79,
0x7a, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89,
0x8a, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98,
0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7,
0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6,
0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3, 0xc4, 0xc5,
0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2, 0xd3, 0xd4,
0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xe1, 0xe2,
0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea,
0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8,
0xf9, 0xfa };
static const UINT8 bits_ac_chrominance[17] =
{ /* 0-base */ 0, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 0x77 };
static const UINT8 val_ac_chrominance[] =
{ 0x00, 0x01, 0x02, 0x03, 0x11, 0x04, 0x05, 0x21,
0x31, 0x06, 0x12, 0x41, 0x51, 0x07, 0x61, 0x71,
0x13, 0x22, 0x32, 0x81, 0x08, 0x14, 0x42, 0x91,
0xa1, 0xb1, 0xc1, 0x09, 0x23, 0x33, 0x52, 0xf0,
0x15, 0x62, 0x72, 0xd1, 0x0a, 0x16, 0x24, 0x34,
0xe1, 0x25, 0xf1, 0x17, 0x18, 0x19, 0x1a, 0x26,
0x27, 0x28, 0x29, 0x2a, 0x35, 0x36, 0x37, 0x38,
0x39, 0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48,
0x49, 0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58,
0x59, 0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68,
0x69, 0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78,
0x79, 0x7a, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
0x88, 0x89, 0x8a, 0x92, 0x93, 0x94, 0x95, 0x96,
0x97, 0x98, 0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5,
0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4,
0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3,
0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2,
0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda,
0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9,
0xea, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8,
0xf9, 0xfa };
if (cinfo->is_decompressor) {
dc_huff_tbl_ptrs = ((j_decompress_ptr)cinfo)->dc_huff_tbl_ptrs;
ac_huff_tbl_ptrs = ((j_decompress_ptr)cinfo)->ac_huff_tbl_ptrs;
} else {
dc_huff_tbl_ptrs = ((j_compress_ptr)cinfo)->dc_huff_tbl_ptrs;
ac_huff_tbl_ptrs = ((j_compress_ptr)cinfo)->ac_huff_tbl_ptrs;
}
add_huff_table(cinfo, &dc_huff_tbl_ptrs[0], bits_dc_luminance,
val_dc_luminance);
add_huff_table(cinfo, &ac_huff_tbl_ptrs[0], bits_ac_luminance,
val_ac_luminance);
add_huff_table(cinfo, &dc_huff_tbl_ptrs[1], bits_dc_chrominance,
val_dc_chrominance);
add_huff_table(cinfo, &ac_huff_tbl_ptrs[1], bits_ac_chrominance,
val_ac_chrominance);
}

View File

@@ -4,7 +4,7 @@
* This file was part of the Independent JPEG Group's software: * This file was part of the Independent JPEG Group's software:
* Copyright (C) 1991-2012, Thomas G. Lane, Guido Vollbeding. * Copyright (C) 1991-2012, Thomas G. Lane, Guido Vollbeding.
* Modifications: * Modifications:
* Copyright (C) 2010, 2012-2013, D. R. Commander. * Copyright (C) 2010, 2012-2014, D. R. Commander.
* mozjpeg Modifications: * mozjpeg Modifications:
* Copyright (C) 2014, Mozilla Corporation. * Copyright (C) 2014, Mozilla Corporation.
* For conditions of distribution and use, see the accompanying README file. * For conditions of distribution and use, see the accompanying README file.
@@ -30,7 +30,8 @@
#define JCOPYRIGHT "Copyright (C) 1991-2012 Thomas G. Lane, Guido Vollbeding\n" \ #define JCOPYRIGHT "Copyright (C) 1991-2012 Thomas G. Lane, Guido Vollbeding\n" \
"Copyright (C) 1999-2006 MIYASAKA Masaru\n" \ "Copyright (C) 1999-2006 MIYASAKA Masaru\n" \
"Copyright (C) 2009 Pierre Ossman for Cendio AB\n" \ "Copyright (C) 2009 Pierre Ossman for Cendio AB\n" \
"Copyright (C) 2009-2013 D. R. Commander\n" \ "Copyright (C) 2009-2014 D. R. Commander\n" \
"Copyright (C) 2009-2011 Nokia Corporation and/or its subsidiary(-ies)\n" \ "Copyright (C) 2009-2011 Nokia Corporation and/or its subsidiary(-ies)\n" \
"Copyright (C) 2014 Mozilla Corporation\n" "Copyright (C) 2014 Mozilla Corporation\n" \
"Copyright (C) 2013 MIPS Technologies, Inc.\n" \
"Copyright (C) 2013 Linaro Limited"

View File

@@ -1,12 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IFPkgDescriptionDescription</key>
<string>A SIMD-accelerated JPEG codec that provides both the libjpeg and TurboJPEG APIs</string>
<key>IFPkgDescriptionTitle</key>
<string>@PACKAGE_NAME@</string>
<key>IFPkgDescriptionVersion</key>
<string>@VERSION@</string>
</dict>
</plist>

24
release/Distribution.xml Normal file
View File

@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<installer-gui-script minSpecVersion="1">
<title>libjpeg-turbo</title>
<welcome file="Welcome.rtf" />
<readme file="ReadMe.txt" />
<license file="License.rtf" />
<domains
enable_anywhere="false"
enable_currentUserHome="false"
enable_localSystem="true"
/>
<options customize="never" />
<choices-outline>
<line choice="default">
<line choice="com.libjpeg-turbo.libjpeg-turbo"/>
</line>
</choices-outline>
<choice id="default"/>
<choice id="com.libjpeg-turbo.libjpeg-turbo" visible="false">
<pkg-ref id="com.libjpeg-turbo.libjpeg-turbo"/>
</choice>
<pkg-ref auth="root"
id="com.libjpeg-turbo.libjpeg-turbo">libjpeg-turbo.pkg</pkg-ref>
</installer-gui-script>

View File

@@ -1,44 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleGetInfoString</key>
<string>@VERSION@, The libmozjpeg Project</string>
<key>CFBundleIdentifier</key>
<string>com.libmozjpeg.libmozjpeg</string>
<key>CFBundleShortVersionString</key>
<string>@VERSION@</string>
<key>IFMajorVersion</key>
<integer>1</integer>
<key>IFMinorVersion</key>
<integer>@BUILD@</integer>
<key>IFPkgFlagAllowBackRev</key>
<false/>
<key>IFPkgFlagAuthorizationAction</key>
<string>AdminAuthorization</string>
<key>IFPkgFlagBackgroundAlignment</key>
<string>topleft</string>
<key>IFPkgFlagBackgroundScaling</key>
<string>none</string>
<key>IFPkgFlagDefaultLocation</key>
<string>/</string>
<key>IFPkgFlagFollowLinks</key>
<true/>
<key>IFPkgFlagInstallFat</key>
<false/>
<key>IFPkgFlagIsRequired</key>
<false/>
<key>IFPkgFlagOverwritePermissions</key>
<false/>
<key>IFPkgFlagRelocatable</key>
<false/>
<key>IFPkgFlagRestartAction</key>
<string>NoRestart</string>
<key>IFPkgFlagRootVolumeOnly</key>
<true/>
<key>IFPkgFlagUpdateInstalledLanguages</key>
<false/>
<key>IFPkgFormatVersion</key>
<real>0.10000000149011612</real>
</dict>
</plist>

View File

@@ -1,13 +0,0 @@
{\rtf1\ansi\ansicpg1252\cocoartf1265\cocoasubrtf190
\cocoascreenfonts1{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
{\colortbl;\red255\green255\blue255;}
\margl1440\margr1440\vieww13560\viewh16600\viewkind0
\deftab720
\pard\pardeftab720
\f0\fs24 \cf0 libmozjpeg is a JPEG image codec that uses SIMD instructions (MMX, SSE2, NEON) to accelerate baseline JPEG compression and decompression on x86, x86-64, and ARM systems. On such systems, libmozjpeg is generally 2-4x as fast as libjpeg, all else being equal. On other types of systems, libmozjpeg can still outperform libjpeg by a significant amount, by virtue of its highly-optimized Huffman coding routines. In many cases, the performance of libmozjpeg rivals that of proprietary high-speed JPEG codecs.\
\
libmozjpeg implements both the traditional libjpeg API as well as the less powerful but more straightforward TurboJPEG API. libmozjpeg also features colorspace extensions that allow it to compress from/decompress to 32-bit and big-endian pixel buffers (RGBX, XBGR, etc.), as well as a full-featured Java interface.\
\
libmozjpeg was forked from libjpeg-turbo. libjpeg-turbo was originally based on libjpeg/SIMD, an MMX-accelerated derivative of libjpeg v6b developed by Miyasaka Masaru. The TigerVNC and VirtualGL projects made numerous enhancements to the codec in 2009, and in early 2010, libjpeg-turbo spun off into an independent project, with the goal of making high-speed JPEG compression/decompression technology available to a broader range of users and developers.\
}

5
release/ReadMe.txt Normal file
View File

@@ -0,0 +1,5 @@
libjpeg-turbo is a JPEG image codec that uses SIMD instructions (MMX, SSE2, NEON) to accelerate baseline JPEG compression and decompression on x86, x86-64, and ARM systems. On such systems, libjpeg-turbo is generally 2-4x as fast as libjpeg, all else being equal. On other types of systems, libjpeg-turbo can still outperform libjpeg by a significant amount, by virtue of its highly-optimized Huffman coding routines. In many cases, the performance of libjpeg-turbo rivals that of proprietary high-speed JPEG codecs.
libjpeg-turbo implements both the traditional libjpeg API as well as the less powerful but more straightforward TurboJPEG API. libjpeg-turbo also features colorspace extensions that allow it to compress from/decompress to 32-bit and big-endian pixel buffers (RGBX, XBGR, etc.), as well as a full-featured Java interface.
libjpeg-turbo was originally based on libjpeg/SIMD, an MMX-accelerated derivative of libjpeg v6b developed by Miyasaka Masaru. The TigerVNC and VirtualGL projects made numerous enhancements to the codec in 2009, and in early 2010, libjpeg-turbo spun off into an independent project, with the goal of making high-speed JPEG compression/decompression technology available to a broader range of users and developers.

View File

@@ -8,7 +8,7 @@
%define _datadir %{__datadir} %define _datadir %{__datadir}
# Path under which docs should be installed # Path under which docs should be installed
%define _docdir %{_defaultdocdir}/%{name}-%{version} %define _docdir /usr/share/doc/%{name}-%{version}
# Path under which headers should be installed # Path under which headers should be installed
%define _includedir %{__includedir} %define _includedir %{__includedir}

View File

@@ -17,19 +17,15 @@ onexit()
PACKAGE_NAME=@PKGNAME@ PACKAGE_NAME=@PKGNAME@
VERSION=@VERSION@ VERSION=@VERSION@
BUILD=@BUILD@
SRCDIR=@abs_top_srcdir@ SRCDIR=@abs_top_srcdir@
RPMARCH=@RPMARCH@
PLATFORM=cygwin
PREFIX=%{__prefix} PREFIX=%{__prefix}
DOCDIR=%{__docdir} DOCDIR=%{__docdir}
LIBDIR=%{__libdir} LIBDIR=%{__libdir}
umask 022 umask 022
if [ "$RPMARCH" = "x86_64" ]; then rm -f $PACKAGE_NAME-$VERSION-$BUILD.tar.bz2
PLATFORM=cygwin64
fi
rm -f $PACKAGE_NAME-$VERSION-$PLATFORM.tar.bz2
TMPDIR=`mktemp -d /tmp/ljtbuild.XXXXXX` TMPDIR=`mktemp -d /tmp/ljtbuild.XXXXXX`
__PWD=`pwd` __PWD=`pwd`
make install DESTDIR=$TMPDIR/pkg docdir=/usr/share/doc/$PACKAGE_NAME-$VERSION \ make install DESTDIR=$TMPDIR/pkg docdir=/usr/share/doc/$PACKAGE_NAME-$VERSION \
@@ -39,7 +35,7 @@ if [ "$PREFIX" = "/opt/libmozjpeg" -a "$DOCDIR" = "/opt/libmozjpeg/doc" ]; then
ln -fs /usr/share/doc/$PACKAGE_NAME-$VERSION $TMPDIR/pkg$DOCDIR ln -fs /usr/share/doc/$PACKAGE_NAME-$VERSION $TMPDIR/pkg$DOCDIR
fi fi
cd $TMPDIR/pkg cd $TMPDIR/pkg
tar cfj ../$PACKAGE_NAME-$VERSION-$PLATFORM.tar.bz2 * tar cfj ../$PACKAGE_NAME-$VERSION-$BUILD.tar.bz2 *
cd $__PWD cd $__PWD
mv $TMPDIR/*.tar.bz2 . mv $TMPDIR/*.tar.bz2 .

View File

@@ -11,7 +11,7 @@ TMPDIR=
onexit() onexit()
{ {
if [ ! "$TMPDIR" = "" ]; then if [ ! "$TMPDIR" = "" ]; then
sudo rm -rf $TMPDIR rm -rf $TMPDIR
fi fi
} }
@@ -78,7 +78,6 @@ while [ $# -gt 0 ]; do
esac esac
shift shift
done done
PACKAGEMAKER=/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker
if [ -f $PACKAGE_NAME-$VERSION.dmg ]; then if [ -f $PACKAGE_NAME-$VERSION.dmg ]; then
rm -f $PACKAGE_NAME-$VERSION.dmg rm -f $PACKAGE_NAME-$VERSION.dmg
@@ -245,21 +244,20 @@ if [ "$PREFIX" = "/opt/libmozjpeg" -a "$LIBDIR" = "/opt/libmozjpeg/lib" ]; then
fi fi
fi fi
chmod 1775 $PKGROOT/Library mkdir -p $TMPDIR/pkg
chmod 775 $PKGROOT/Library/Documentation
mkdir -p $TMPDIR/pkg/Resources
cp pkgscripts/Description.plist $TMPDIR/pkg/
cp pkgscripts/Info.plist $TMPDIR/pkg/
install -m 755 pkgscripts/uninstall $PKGROOT/$BINDIR/ install -m 755 pkgscripts/uninstall $PKGROOT/$BINDIR/
sudo chown -R root:admin $PKGROOT find $PKGROOT -type f | while read file; do xattr -c $file; done
cp $SRCDIR/release/License.rtf $SRCDIR/release/Welcome.rtf $SRCDIR/release/ReadMe.rtf $TMPDIR/pkg/Resources/
cp $SRCDIR/release/License.rtf $SRCDIR/release/Welcome.rtf $SRCDIR/release/ReadMe.txt $TMPDIR/pkg/
mkdir $TMPDIR/dmg mkdir $TMPDIR/dmg
$PACKAGEMAKER -build -v -p $TMPDIR/dmg/$PACKAGE_NAME.pkg \ pkgbuild --root $PKGROOT --version $VERSION.$BUILD \
-f $PKGROOT -r $TMPDIR/pkg/Resources \ --identifier com.libjpeg-turbo.libjpeg-turbo $TMPDIR/pkg/$PACKAGE_NAME.pkg
-i $TMPDIR/pkg/Info.plist -d $TMPDIR/pkg/Description.plist productbuild --distribution $SRCDIR/release/Distribution.xml \
--package-path $TMPDIR/pkg/ --resources $TMPDIR/pkg/ \
$TMPDIR/dmg/$PACKAGE_NAME.pkg
hdiutil create -fs HFS+ -volname $PACKAGE_NAME-$VERSION \ hdiutil create -fs HFS+ -volname $PACKAGE_NAME-$VERSION \
-srcfolder "$TMPDIR/dmg" $TMPDIR/$PACKAGE_NAME-$VERSION.dmg -srcfolder "$TMPDIR/dmg" $TMPDIR/$PACKAGE_NAME-$VERSION.dmg
cp $TMPDIR/$PACKAGE_NAME-$VERSION.dmg . cp $TMPDIR/$PACKAGE_NAME-$VERSION.dmg .

View File

@@ -58,6 +58,12 @@ libsimd_la_SOURCES = jsimd_arm.c jsimd_arm_neon.S
endif endif
if SIMD_ARM_64
libsimd_la_SOURCES = jsimd_arm64.c jsimd_arm_neon_64.S
endif
if SIMD_MIPSEL if SIMD_MIPSEL
libsimd_la_SOURCES = jsimd_mips.c jsimd_mips_dspr2_asm.h jsimd_mips_dspr2.S libsimd_la_SOURCES = jsimd_mips.c jsimd_mips_dspr2_asm.h jsimd_mips_dspr2.S

586
simd/jsimd_arm64.c Normal file
View File

@@ -0,0 +1,586 @@
/*
* jsimd_arm64.c
*
* Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
* Copyright 2009-2011, 2013-2014 D. R. Commander
*
* Based on the x86 SIMD extension for IJG JPEG library,
* Copyright (C) 1999-2006, MIYASAKA Masaru.
* For conditions of distribution and use, see copyright notice in jsimdext.inc
*
* This file contains the interface between the "normal" portions
* of the library and the SIMD implementations when running on
* ARM architecture.
*
* Based on the stubs from 'jsimd_none.c'
*/
#define JPEG_INTERNALS
#include "../jinclude.h"
#include "../jpeglib.h"
#include "../jsimd.h"
#include "../jdct.h"
#include "../jsimddct.h"
#include "jsimd.h"
#include <stdio.h>
#include <string.h>
#include <ctype.h>
static unsigned int simd_support = ~0;
#if defined(__linux__) || defined(ANDROID) || defined(__ANDROID__)
#define SOMEWHAT_SANE_PROC_CPUINFO_SIZE_LIMIT (1024 * 1024)
LOCAL(int)
check_feature (char *buffer, char *feature)
{
char *p;
if (*feature == 0)
return 0;
if (strncmp(buffer, "Features", 8) != 0)
return 0;
buffer += 8;
while (isspace(*buffer))
buffer++;
/* Check if 'feature' is present in the buffer as a separate word */
while ((p = strstr(buffer, feature))) {
if (p > buffer && !isspace(*(p - 1))) {
buffer++;
continue;
}
p += strlen(feature);
if (*p != 0 && !isspace(*p)) {
buffer++;
continue;
}
return 1;
}
return 0;
}
LOCAL(int)
parse_proc_cpuinfo (int bufsize)
{
char *buffer = (char *)malloc(bufsize);
FILE *fd;
simd_support = 0;
if (!buffer)
return 0;
fd = fopen("/proc/cpuinfo", "r");
if (fd) {
while (fgets(buffer, bufsize, fd)) {
if (!strchr(buffer, '\n') && !feof(fd)) {
/* "impossible" happened - insufficient size of the buffer! */
fclose(fd);
free(buffer);
return 0;
}
if (check_feature(buffer, "neon"))
simd_support |= JSIMD_ARM_NEON;
}
fclose(fd);
}
free(buffer);
return 1;
}
#endif
/*
* Check what SIMD accelerations are supported.
*
* FIXME: This code is racy under a multi-threaded environment.
*/
LOCAL(void)
init_simd (void)
{
char *env = NULL;
#if !defined(__ARM_NEON__) && defined(__linux__) || defined(ANDROID) || defined(__ANDROID__)
int bufsize = 1024; /* an initial guess for the line buffer size limit */
#endif
if (simd_support != ~0U)
return;
simd_support = 0;
#if defined(__ARM_NEON__)
simd_support |= JSIMD_ARM_NEON;
#elif defined(__linux__) || defined(ANDROID) || defined(__ANDROID__)
/* We still have a chance to use NEON regardless of globally used
* -mcpu/-mfpu options passed to gcc by performing runtime detection via
* /proc/cpuinfo parsing on linux/android */
while (!parse_proc_cpuinfo(bufsize)) {
bufsize *= 2;
if (bufsize > SOMEWHAT_SANE_PROC_CPUINFO_SIZE_LIMIT)
break;
}
#endif
/* Force different settings through environment variables */
env = getenv("JSIMD_FORCENEON");
if ((env != NULL) && (strcmp(env, "1") == 0))
simd_support &= JSIMD_ARM_NEON;
env = getenv("JSIMD_FORCENONE");
if ((env != NULL) && (strcmp(env, "1") == 0))
simd_support = 0;
}
GLOBAL(int)
jsimd_can_rgb_ycc (void)
{
init_simd();
return 0;
}
GLOBAL(int)
jsimd_can_rgb_gray (void)
{
init_simd();
return 0;
}
GLOBAL(int)
jsimd_can_ycc_rgb (void)
{
init_simd();
/* The code is optimised for these values only */
if (BITS_IN_JSAMPLE != 8)
return 0;
if (sizeof(JDIMENSION) != 4)
return 0;
if ((RGB_PIXELSIZE != 3) && (RGB_PIXELSIZE != 4))
return 0;
if (simd_support & JSIMD_ARM_NEON)
return 1;
return 0;
}
GLOBAL(void)
jsimd_rgb_ycc_convert (j_compress_ptr cinfo,
JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
JDIMENSION output_row, int num_rows)
{
}
GLOBAL(void)
jsimd_rgb_gray_convert (j_compress_ptr cinfo,
JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
JDIMENSION output_row, int num_rows)
{
}
GLOBAL(void)
jsimd_ycc_rgb_convert (j_decompress_ptr cinfo,
JSAMPIMAGE input_buf, JDIMENSION input_row,
JSAMPARRAY output_buf, int num_rows)
{
void (*neonfct)(JDIMENSION, JSAMPIMAGE, JDIMENSION, JSAMPARRAY, int);
switch(cinfo->out_color_space)
{
case JCS_EXT_RGB:
neonfct=jsimd_ycc_extrgb_convert_neon;
break;
case JCS_EXT_RGBX:
case JCS_EXT_RGBA:
neonfct=jsimd_ycc_extrgbx_convert_neon;
break;
case JCS_EXT_BGR:
neonfct=jsimd_ycc_extbgr_convert_neon;
break;
case JCS_EXT_BGRX:
case JCS_EXT_BGRA:
neonfct=jsimd_ycc_extbgrx_convert_neon;
break;
case JCS_EXT_XBGR:
case JCS_EXT_ABGR:
neonfct=jsimd_ycc_extxbgr_convert_neon;
break;
case JCS_EXT_XRGB:
case JCS_EXT_ARGB:
neonfct=jsimd_ycc_extxrgb_convert_neon;
break;
default:
neonfct=jsimd_ycc_extrgb_convert_neon;
break;
}
if (simd_support & JSIMD_ARM_NEON)
neonfct(cinfo->output_width, input_buf,
input_row, output_buf, num_rows);
}
GLOBAL(int)
jsimd_can_h2v2_downsample (void)
{
init_simd();
return 0;
}
GLOBAL(int)
jsimd_can_h2v1_downsample (void)
{
init_simd();
return 0;
}
GLOBAL(void)
jsimd_h2v2_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,
JSAMPARRAY input_data, JSAMPARRAY output_data)
{
}
GLOBAL(void)
jsimd_h2v1_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,
JSAMPARRAY input_data, JSAMPARRAY output_data)
{
}
GLOBAL(int)
jsimd_can_h2v2_upsample (void)
{
init_simd();
return 0;
}
GLOBAL(int)
jsimd_can_h2v1_upsample (void)
{
init_simd();
return 0;
}
GLOBAL(void)
jsimd_h2v2_upsample (j_decompress_ptr cinfo,
jpeg_component_info * compptr,
JSAMPARRAY input_data,
JSAMPARRAY * output_data_ptr)
{
}
GLOBAL(void)
jsimd_h2v1_upsample (j_decompress_ptr cinfo,
jpeg_component_info * compptr,
JSAMPARRAY input_data,
JSAMPARRAY * output_data_ptr)
{
}
GLOBAL(int)
jsimd_can_h2v2_fancy_upsample (void)
{
init_simd();
return 0;
}
GLOBAL(int)
jsimd_can_h2v1_fancy_upsample (void)
{
init_simd();
return 0;
}
GLOBAL(void)
jsimd_h2v2_fancy_upsample (j_decompress_ptr cinfo,
jpeg_component_info * compptr,
JSAMPARRAY input_data,
JSAMPARRAY * output_data_ptr)
{
}
GLOBAL(void)
jsimd_h2v1_fancy_upsample (j_decompress_ptr cinfo,
jpeg_component_info * compptr,
JSAMPARRAY input_data,
JSAMPARRAY * output_data_ptr)
{
}
GLOBAL(int)
jsimd_can_h2v2_merged_upsample (void)
{
init_simd();
return 0;
}
GLOBAL(int)
jsimd_can_h2v1_merged_upsample (void)
{
init_simd();
return 0;
}
GLOBAL(void)
jsimd_h2v2_merged_upsample (j_decompress_ptr cinfo,
JSAMPIMAGE input_buf,
JDIMENSION in_row_group_ctr,
JSAMPARRAY output_buf)
{
}
GLOBAL(void)
jsimd_h2v1_merged_upsample (j_decompress_ptr cinfo,
JSAMPIMAGE input_buf,
JDIMENSION in_row_group_ctr,
JSAMPARRAY output_buf)
{
}
GLOBAL(int)
jsimd_can_convsamp (void)
{
init_simd();
return 0;
}
GLOBAL(int)
jsimd_can_convsamp_float (void)
{
init_simd();
return 0;
}
GLOBAL(void)
jsimd_convsamp (JSAMPARRAY sample_data, JDIMENSION start_col,
DCTELEM * workspace)
{
}
GLOBAL(void)
jsimd_convsamp_float (JSAMPARRAY sample_data, JDIMENSION start_col,
FAST_FLOAT * workspace)
{
}
GLOBAL(int)
jsimd_can_fdct_islow (void)
{
init_simd();
return 0;
}
GLOBAL(int)
jsimd_can_fdct_ifast (void)
{
init_simd();
return 0;
}
GLOBAL(int)
jsimd_can_fdct_float (void)
{
init_simd();
return 0;
}
GLOBAL(void)
jsimd_fdct_islow (DCTELEM * data)
{
}
GLOBAL(void)
jsimd_fdct_ifast (DCTELEM * data)
{
}
GLOBAL(void)
jsimd_fdct_float (FAST_FLOAT * data)
{
}
GLOBAL(int)
jsimd_can_quantize (void)
{
init_simd();
return 0;
}
GLOBAL(int)
jsimd_can_quantize_float (void)
{
init_simd();
return 0;
}
GLOBAL(void)
jsimd_quantize (JCOEFPTR coef_block, DCTELEM * divisors,
DCTELEM * workspace)
{
}
GLOBAL(void)
jsimd_quantize_float (JCOEFPTR coef_block, FAST_FLOAT * divisors,
FAST_FLOAT * workspace)
{
}
GLOBAL(int)
jsimd_can_idct_2x2 (void)
{
init_simd();
/* The code is optimised for these values only */
if (DCTSIZE != 8)
return 0;
if (sizeof(JCOEF) != 2)
return 0;
if (BITS_IN_JSAMPLE != 8)
return 0;
if (sizeof(JDIMENSION) != 4)
return 0;
if (sizeof(ISLOW_MULT_TYPE) != 2)
return 0;
if ((simd_support & JSIMD_ARM_NEON))
return 1;
return 0;
}
GLOBAL(int)
jsimd_can_idct_4x4 (void)
{
init_simd();
/* The code is optimised for these values only */
if (DCTSIZE != 8)
return 0;
if (sizeof(JCOEF) != 2)
return 0;
if (BITS_IN_JSAMPLE != 8)
return 0;
if (sizeof(JDIMENSION) != 4)
return 0;
if (sizeof(ISLOW_MULT_TYPE) != 2)
return 0;
if ((simd_support & JSIMD_ARM_NEON))
return 1;
return 0;
}
GLOBAL(void)
jsimd_idct_2x2 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
JCOEFPTR coef_block, JSAMPARRAY output_buf,
JDIMENSION output_col)
{
if ((simd_support & JSIMD_ARM_NEON))
jsimd_idct_2x2_neon(compptr->dct_table, coef_block, output_buf, output_col);
}
GLOBAL(void)
jsimd_idct_4x4 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
JCOEFPTR coef_block, JSAMPARRAY output_buf,
JDIMENSION output_col)
{
if ((simd_support & JSIMD_ARM_NEON))
jsimd_idct_4x4_neon(compptr->dct_table, coef_block, output_buf, output_col);
}
GLOBAL(int)
jsimd_can_idct_islow (void)
{
init_simd();
/* The code is optimised for these values only */
if (DCTSIZE != 8)
return 0;
if (sizeof(JCOEF) != 2)
return 0;
if (BITS_IN_JSAMPLE != 8)
return 0;
if (sizeof(JDIMENSION) != 4)
return 0;
if (sizeof(ISLOW_MULT_TYPE) != 2)
return 0;
if (simd_support & JSIMD_ARM_NEON)
return 1;
return 0;
}
GLOBAL(int)
jsimd_can_idct_ifast (void)
{
init_simd();
/* The code is optimised for these values only */
if (DCTSIZE != 8)
return 0;
if (sizeof(JCOEF) != 2)
return 0;
if (BITS_IN_JSAMPLE != 8)
return 0;
if (sizeof(JDIMENSION) != 4)
return 0;
if (sizeof(IFAST_MULT_TYPE) != 2)
return 0;
if (IFAST_SCALE_BITS != 2)
return 0;
if ((simd_support & JSIMD_ARM_NEON))
return 1;
return 0;
}
GLOBAL(int)
jsimd_can_idct_float (void)
{
init_simd();
return 0;
}
GLOBAL(void)
jsimd_idct_islow (j_decompress_ptr cinfo, jpeg_component_info * compptr,
JCOEFPTR coef_block, JSAMPARRAY output_buf,
JDIMENSION output_col)
{
if ((simd_support & JSIMD_ARM_NEON))
jsimd_idct_islow_neon(compptr->dct_table, coef_block, output_buf, output_col);
}
GLOBAL(void)
jsimd_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info * compptr,
JCOEFPTR coef_block, JSAMPARRAY output_buf,
JDIMENSION output_col)
{
if ((simd_support & JSIMD_ARM_NEON))
jsimd_idct_ifast_neon(compptr->dct_table, coef_block, output_buf, output_col);
}
GLOBAL(void)
jsimd_idct_float (j_decompress_ptr cinfo, jpeg_component_info * compptr,
JCOEFPTR coef_block, JSAMPARRAY output_buf,
JDIMENSION output_col)
{
}

View File

@@ -1,5 +1,5 @@
/* /*
* ARM NEON optimizations for libjpeg-turbo * ARMv7 NEON optimizations for libjpeg-turbo
* *
* Copyright (C) 2009-2011 Nokia Corporation and/or its subsidiary(-ies). * Copyright (C) 2009-2011 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved. * All rights reserved.
@@ -35,6 +35,7 @@
#define RESPECT_STRICT_ALIGNMENT 1 #define RESPECT_STRICT_ALIGNMENT 1
/*****************************************************************************/ /*****************************************************************************/
/* Supplementary macro for setting function attributes */ /* Supplementary macro for setting function attributes */
@@ -62,6 +63,7 @@ _\fname:
vtrn.32 \x1, \x3 vtrn.32 \x1, \x3
.endm .endm
#define CENTERJSAMPLE 128 #define CENTERJSAMPLE 128
/*****************************************************************************/ /*****************************************************************************/
@@ -670,6 +672,7 @@ asm_function jsimd_idct_islow_neon
.unreq ROW7R .unreq ROW7R
.endfunc .endfunc
/*****************************************************************************/ /*****************************************************************************/
/* /*
@@ -894,6 +897,7 @@ asm_function jsimd_idct_ifast_neon
.unreq TMP4 .unreq TMP4
.endfunc .endfunc
/*****************************************************************************/ /*****************************************************************************/
/* /*
@@ -1108,6 +1112,7 @@ asm_function jsimd_idct_4x4_neon
.purgem idct_helper .purgem idct_helper
/*****************************************************************************/ /*****************************************************************************/
/* /*
@@ -1262,6 +1267,7 @@ asm_function jsimd_idct_2x2_neon
.purgem idct_helper .purgem idct_helper
/*****************************************************************************/ /*****************************************************************************/
/* /*
@@ -1561,6 +1567,7 @@ generate_jsimd_ycc_rgb_convert_neon extxrgb, 32, 1, 2, 3
.purgem do_load .purgem do_load
.purgem do_store .purgem do_store
/*****************************************************************************/ /*****************************************************************************/
/* /*
@@ -1871,6 +1878,7 @@ generate_jsimd_rgb_ycc_convert_neon extxrgb, 32, 1, 2, 3
.purgem do_load .purgem do_load
.purgem do_store .purgem do_store
/*****************************************************************************/ /*****************************************************************************/
/* /*
@@ -1934,6 +1942,7 @@ asm_function jsimd_convsamp_neon
.unreq TMP4 .unreq TMP4
.endfunc .endfunc
/*****************************************************************************/ /*****************************************************************************/
/* /*
@@ -2057,6 +2066,7 @@ asm_function jsimd_fdct_ifast_neon
.unreq TMP .unreq TMP
.endfunc .endfunc
/*****************************************************************************/ /*****************************************************************************/
/* /*
@@ -2158,6 +2168,7 @@ asm_function jsimd_quantize_neon
.unreq LOOP_COUNT .unreq LOOP_COUNT
.endfunc .endfunc
/*****************************************************************************/ /*****************************************************************************/
/* /*

1832
simd/jsimd_arm_neon_64.S Normal file

File diff suppressed because it is too large Load Diff

405
tjbench.c
View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C)2009-2013 D. R. Commander. All Rights Reserved. * Copyright (C)2009-2014 D. R. Commander. All Rights Reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are met:
@@ -45,9 +45,8 @@
#define _throwtj(m) _throw(m, tjGetErrorStr()) #define _throwtj(m) _throw(m, tjGetErrorStr())
#define _throwbmp(m) _throw(m, bmpgeterr()) #define _throwbmp(m) _throw(m, bmpgeterr())
enum {YUVENCODE=1, YUVDECODE, YUVCOMPRESS}; int flags=TJFLAG_NOREALLOC, componly=0, decomponly=0, doyuv=0, quiet=0,
int flags=TJFLAG_NOREALLOC, componly=0, decomponly=0, yuv=0, quiet=0, dotile=0, dotile=0, pf=TJPF_BGR, yuvpad=1, warmup=1;
pf=TJPF_BGR, yuvpad=1;
char *ext="ppm"; char *ext="ppm";
const char *pixFormatStr[TJ_NUMPF]= const char *pixFormatStr[TJ_NUMPF]=
{ {
@@ -102,21 +101,20 @@ int dummyDCTFilter(short *coeffs, tjregion arrayRegion, tjregion planeRegion,
/* Decompression test */ /* Decompression test */
int decomptest(unsigned char *srcbuf, unsigned char **jpegbuf, int decomp(unsigned char *srcbuf, unsigned char **jpegbuf,
unsigned long *jpegsize, unsigned char *dstbuf, int w, int h, unsigned long *jpegsize, unsigned char *dstbuf, int w, int h,
int subsamp, int jpegqual, char *filename, int tilew, int tileh) int subsamp, int jpegqual, char *filename, int tilew, int tileh)
{ {
char tempstr[1024], sizestr[20]="\0", qualstr[6]="\0", *ptr; char tempstr[1024], sizestr[20]="\0", qualstr[6]="\0", *ptr;
FILE *file=NULL; tjhandle handle=NULL; FILE *file=NULL; tjhandle handle=NULL;
int row, col, i, dstbufalloc=0, retval=0; int row, col, iter=0, dstbufalloc=0, retval=0;
double start, elapsed; double elapsed, elapsedDecode;
int ps=tjPixelSize[pf]; int ps=tjPixelSize[pf];
int scaledw=TJSCALED(w, sf); int scaledw=TJSCALED(w, sf);
int scaledh=TJSCALED(h, sf); int scaledh=TJSCALED(h, sf);
int yuvsize=tjBufSizeYUV2(scaledw, yuvpad, scaledh, subsamp), bufsize;
int pitch=scaledw*ps; int pitch=scaledw*ps;
int ntilesw=(w+tilew-1)/tilew, ntilesh=(h+tileh-1)/tileh; int ntilesw=(w+tilew-1)/tilew, ntilesh=(h+tileh-1)/tileh;
unsigned char *dstptr, *dstptr2; unsigned char *dstptr, *dstptr2, *yuvbuf=NULL;
if(jpegqual>0) if(jpegqual>0)
{ {
@@ -127,64 +125,93 @@ int decomptest(unsigned char *srcbuf, unsigned char **jpegbuf,
if((handle=tjInitDecompress())==NULL) if((handle=tjInitDecompress())==NULL)
_throwtj("executing tjInitDecompress()"); _throwtj("executing tjInitDecompress()");
bufsize=(yuv==YUVDECODE? yuvsize:pitch*scaledh);
if(dstbuf==NULL) if(dstbuf==NULL)
{ {
if((dstbuf=(unsigned char *)malloc(bufsize)) == NULL) if((dstbuf=(unsigned char *)malloc(pitch*scaledh))==NULL)
_throwunix("allocating image buffer"); _throwunix("allocating destination buffer");
dstbufalloc=1; dstbufalloc=1;
} }
/* Set the destination buffer to gray so we know whether the decompressor /* Set the destination buffer to gray so we know whether the decompressor
attempted to write to it */ attempted to write to it */
memset(dstbuf, 127, bufsize); memset(dstbuf, 127, pitch*scaledh);
/* Execute once to preload cache */ if(doyuv)
if(yuv==YUVDECODE)
{ {
if(tjDecompressToYUV2(handle, jpegbuf[0], jpegsize[0], dstbuf, scaledw, int width=dotile? tilew:scaledw;
yuvpad, scaledh, flags)==-1) int height=dotile? tileh:scaledh;
_throwtj("executing tjDecompressToYUV2()"); int yuvsize=tjBufSizeYUV2(width, yuvpad, height, subsamp);
if((yuvbuf=(unsigned char *)malloc(yuvsize))==NULL)
_throwunix("allocating YUV buffer");
memset(yuvbuf, 127, yuvsize);
} }
else if(tjDecompress2(handle, jpegbuf[0], jpegsize[0], dstbuf, scaledw,
pitch, scaledh, pf, flags)==-1)
_throwtj("executing tjDecompress2()");
/* Benchmark */ /* Benchmark */
for(i=0, start=gettime(); (elapsed=gettime()-start)<benchtime; i++) iter=-warmup;
elapsed=elapsedDecode=0.;
while(1)
{ {
int tile=0; int tile=0;
if(yuv==YUVDECODE) double start=gettime();
{ for(row=0, dstptr=dstbuf; row<ntilesh; row++, dstptr+=pitch*tileh)
if(tjDecompressToYUV2(handle, jpegbuf[0], jpegsize[0], dstbuf, scaledw,
yuvpad, scaledh, flags)==-1)
_throwtj("executing tjDecompressToYUV2()");
}
else for(row=0, dstptr=dstbuf; row<ntilesh; row++, dstptr+=pitch*tileh)
{ {
for(col=0, dstptr2=dstptr; col<ntilesw; col++, tile++, dstptr2+=ps*tilew) for(col=0, dstptr2=dstptr; col<ntilesw; col++, tile++, dstptr2+=ps*tilew)
{ {
int width=dotile? min(tilew, w-col*tilew):scaledw; int width=dotile? min(tilew, w-col*tilew):scaledw;
int height=dotile? min(tileh, h-row*tileh):scaledh; int height=dotile? min(tileh, h-row*tileh):scaledh;
if(tjDecompress2(handle, jpegbuf[tile], jpegsize[tile], dstptr2, width, if(doyuv)
{
double startDecode;
if(tjDecompressToYUV2(handle, jpegbuf[tile], jpegsize[tile], yuvbuf,
width, yuvpad, height, flags)==-1)
_throwtj("executing tjDecompressToYUV2()");
startDecode=gettime();
if(tjDecodeYUV(handle, yuvbuf, yuvpad, subsamp, dstptr2, width,
pitch, height, pf, flags)==-1) pitch, height, pf, flags)==-1)
_throwtj("executing tjDecodeYUV()");
if(iter>=0) elapsedDecode+=gettime()-startDecode;
}
else
if(tjDecompress2(handle, jpegbuf[tile], jpegsize[tile], dstptr2,
width, pitch, height, pf, flags)==-1)
_throwtj("executing tjDecompress2()"); _throwtj("executing tjDecompress2()");
} }
} }
iter++;
if(iter>=1)
{
elapsed+=gettime()-start;
if(elapsed>=benchtime) break;
} }
}
if(doyuv) elapsed-=elapsedDecode;
if(tjDestroy(handle)==-1) _throwtj("executing tjDestroy()"); if(tjDestroy(handle)==-1) _throwtj("executing tjDestroy()");
handle=NULL; handle=NULL;
if(quiet) if(quiet)
{ {
printf("%-6s%s",
sigfig((double)(w*h)/1000000.*(double)iter/elapsed, 4, tempstr, 1024),
quiet==2? "\n":" ");
if(doyuv)
printf("%s\n", printf("%s\n",
sigfig((double)(w*h)/1000000.*(double)i/elapsed, 4, tempstr, 1024)); sigfig((double)(w*h)/1000000.*(double)iter/elapsedDecode, 4, tempstr,
1024));
else if(quiet!=2) printf("\n");
} }
else else
{ {
printf("D--> Frame rate: %f fps\n", (double)i/elapsed); printf("%s --> Frame rate: %f fps\n",
printf(" Dest. throughput: %f Megapixels/sec\n", doyuv? "Decomp to YUV":"Decompress ", (double)iter/elapsed);
(double)(w*h)/1000000.*(double)i/elapsed); printf(" Throughput: %f Megapixels/sec\n",
(double)(w*h)/1000000.*(double)iter/elapsed);
if(doyuv)
{
printf("YUV Decode --> Frame rate:  %f fps\n",
(double)iter/elapsedDecode);
printf(" Throughput: %f Megapixels/sec\n",
(double)(w*h)/1000000.*(double)iter/elapsedDecode);
}
} }
if(sf.num!=1 || sf.denom!=1) if(sf.num!=1 || sf.denom!=1)
snprintf(sizestr, 20, "%d_%d", sf.num, sf.denom); snprintf(sizestr, 20, "%d_%d", sf.num, sf.denom);
@@ -197,16 +224,6 @@ int decomptest(unsigned char *srcbuf, unsigned char **jpegbuf,
snprintf(tempstr, 1024, "%s_%s%s_%s.%s", filename, subName[subsamp], snprintf(tempstr, 1024, "%s_%s%s_%s.%s", filename, subName[subsamp],
qualstr, sizestr, ext); qualstr, sizestr, ext);
if(yuv==YUVDECODE)
{
if((file=fopen(tempstr, "wb"))==NULL)
_throwunix("opening YUV image for output");
if(fwrite(dstbuf, yuvsize, 1, file)!=1)
_throwunix("writing YUV image");
fclose(file); file=NULL;
}
else
{
if(savebmp(tempstr, dstbuf, scaledw, scaledh, pf, if(savebmp(tempstr, dstbuf, scaledw, scaledh, pf,
(flags&TJFLAG_BOTTOMUP)!=0)==-1) (flags&TJFLAG_BOTTOMUP)!=0)==-1)
_throwbmp("saving bitmap"); _throwbmp("saving bitmap");
@@ -246,12 +263,12 @@ int decomptest(unsigned char *srcbuf, unsigned char **jpegbuf,
(flags&TJFLAG_BOTTOMUP)!=0)==-1) (flags&TJFLAG_BOTTOMUP)!=0)==-1)
_throwbmp("saving bitmap"); _throwbmp("saving bitmap");
} }
}
bailout: bailout:
if(file) {fclose(file); file=NULL;} if(file) fclose(file);
if(handle) {tjDestroy(handle); handle=NULL;} if(handle) tjDestroy(handle);
if(dstbuf && dstbufalloc) {free(dstbuf); dstbuf=NULL;} if(dstbuf && dstbufalloc) free(dstbuf);
if(yuvbuf) free(yuvbuf);
return retval; return retval;
} }
@@ -332,20 +349,19 @@ int dotestyuv(unsigned char *srcbuf, int w, int h, int subsamp,
} }
int dotest(unsigned char *srcbuf, int w, int h, int subsamp, int jpegqual, void fullTest(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];
FILE *file=NULL; tjhandle handle=NULL; FILE *file=NULL; tjhandle handle=NULL;
unsigned char **jpegbuf=NULL, *tmpbuf=NULL, *srcptr, *srcptr2; unsigned char **jpegbuf=NULL, *yuvbuf=NULL, *tmpbuf=NULL, *srcptr, *srcptr2;
double start, elapsed; double start, elapsed, elapsedEncode;
int totaljpegsize=0, row, col, i, tilew=w, tileh=h, retval=0; int totaljpegsize=0, row, col, i, tilew=w, tileh=h, retval=0;
int iter, yuvsize=0;
unsigned long *jpegsize=NULL; unsigned long *jpegsize=NULL;
int ps=(yuv==YUVCOMPRESS)? 3:tjPixelSize[pf]; int ps=tjPixelSize[pf];
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=pixFormatStr[pf];
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");
@@ -379,33 +395,29 @@ int dotest(unsigned char *srcbuf, int w, int h, int subsamp, int jpegqual,
/* Compression test */ /* Compression test */
if(quiet==1) if(quiet==1)
printf("%s\t%s\t%s\t%d\t", pfStr, (flags&TJFLAG_BOTTOMUP)? "BU":"TD", printf("%-4s (%s) %-5s %-3d ", pfStr,
subNameLong[subsamp], jpegqual); (flags&TJFLAG_BOTTOMUP)? "BU":"TD", subNameLong[subsamp], jpegqual);
if(yuv!=YUVCOMPRESS)
for(i=0; i<h; i++) for(i=0; i<h; i++)
memcpy(&tmpbuf[pitch*i], &srcbuf[w*ps*i], w*ps); memcpy(&tmpbuf[pitch*i], &srcbuf[w*ps*i], w*ps);
if((handle=tjInitCompress())==NULL) if((handle=tjInitCompress())==NULL)
_throwtj("executing tjInitCompress()"); _throwtj("executing tjInitCompress()");
/* Execute once to preload cache */ if(doyuv)
if(yuv==YUVCOMPRESS)
{ {
if(tjCompressFromYUV(handle, srcbuf, tilew, yuvpad, tileh, subsamp, yuvsize=tjBufSizeYUV2(tilew, yuvpad, tileh, subsamp);
&jpegbuf[0], &jpegsize[0], jpegqual, flags)==-1) if((yuvbuf=(unsigned char *)malloc(yuvsize))==NULL)
_throwtj("executing tjCompressFromYUV()"); _throwunix("allocating YUV buffer");
} memset(yuvbuf, 127, yuvsize);
else
{
if(tjCompress2(handle, srcbuf, tilew, pitch, tileh, pf, &jpegbuf[0],
&jpegsize[0], subsamp, jpegqual, flags)==-1)
_throwtj("executing tjCompress2()");
} }
/* Benchmark */ /* Benchmark */
for(i=0, start=gettime(); (elapsed=gettime()-start)<benchtime; i++) iter=-warmup;
elapsed=elapsedEncode=0.;
while(1)
{ {
int tile=0; int tile=0;
totaljpegsize=0; totaljpegsize=0;
start=gettime();
for(row=0, srcptr=srcbuf; row<ntilesh; row++, srcptr+=pitch*tileh) for(row=0, srcptr=srcbuf; row<ntilesh; row++, srcptr+=pitch*tileh)
{ {
for(col=0, srcptr2=srcptr; col<ntilesw; col++, tile++, for(col=0, srcptr2=srcptr; col<ntilesw; col++, tile++,
@@ -413,9 +425,14 @@ int dotest(unsigned char *srcbuf, int w, int h, int subsamp, int jpegqual,
{ {
int width=min(tilew, w-col*tilew); int width=min(tilew, w-col*tilew);
int height=min(tileh, h-row*tileh); int height=min(tileh, h-row*tileh);
if(yuv==YUVCOMPRESS) if(doyuv)
{ {
if(tjCompressFromYUV(handle, srcptr2, width, yuvpad, height, double startEncode=gettime();
if(tjEncodeYUV3(handle, srcptr2, width, pitch, height, pf, yuvbuf,
yuvpad, subsamp, flags)==-1)
_throwtj("executing tjEncodeYUV3()");
if(iter>=0) elapsedEncode+=gettime()-startEncode;
if(tjCompressFromYUV(handle, yuvbuf, width, yuvpad, height,
subsamp, &jpegbuf[tile], &jpegsize[tile], jpegqual, flags)==-1) subsamp, &jpegbuf[tile], &jpegsize[tile], jpegqual, flags)==-1)
_throwtj("executing tjCompressFromYUV()"); _throwtj("executing tjCompressFromYUV()");
} }
@@ -428,32 +445,58 @@ int dotest(unsigned char *srcbuf, int w, int h, int subsamp, int jpegqual,
totaljpegsize+=jpegsize[tile]; totaljpegsize+=jpegsize[tile];
} }
} }
iter++;
if(iter>=1)
{
elapsed+=gettime()-start;
if(elapsed>=benchtime) break;
} }
}
if(doyuv) elapsed-=elapsedEncode;
if(tjDestroy(handle)==-1) _throwtj("executing tjDestroy()"); if(tjDestroy(handle)==-1) _throwtj("executing tjDestroy()");
handle=NULL; handle=NULL;
if(quiet==1) printf("%-4d %-4d\t", tilew, tileh); if(quiet==1) printf("%-5d %-5d ", tilew, tileh);
if(quiet) if(quiet)
{ {
printf("%s%c%s%c", if(doyuv)
sigfig((double)(w*h)/1000000.*(double)i/elapsed, 4, tempstr, 1024), printf("%-6s%s",
quiet==2? '\n':'\t', sigfig((double)(w*h)/1000000.*(double)iter/elapsedEncode, 4, tempstr,
1024), quiet==2? "\n":" ");
printf("%-6s%s",
sigfig((double)(w*h)/1000000.*(double)iter/elapsed, 4, tempstr, 1024),
quiet==2? "\n":" ");
printf("%-6s%s",
sigfig((double)(w*h*ps)/(double)totaljpegsize, 4, tempstr2, 80), sigfig((double)(w*h*ps)/(double)totaljpegsize, 4, tempstr2, 80),
quiet==2? '\n':'\t'); quiet==2? "\n":" ");
} }
else else
{ {
printf("\n%s size: %d x %d\n", dotile? "Tile":"Image", tilew, printf("\n%s size: %d x %d\n", dotile? "Tile":"Image", tilew,
tileh); tileh);
printf("C--> Frame rate: %f fps\n", (double)i/elapsed); if(doyuv)
printf(" Output image size: %d bytes\n", totaljpegsize); {
printf("Encode YUV --> Frame rate: %f fps\n",
(double)iter/elapsedEncode);
printf(" Output image size: %d bytes\n", yuvsize);
printf(" Compression ratio: %f:1\n",
(double)(w*h*ps)/(double)yuvsize);
printf(" Throughput: %f Megapixels/sec\n",
(double)(w*h)/1000000.*(double)iter/elapsedEncode);
printf(" Output bit stream: %f Megabits/sec\n",
(double)yuvsize*8./1000000.*(double)iter/elapsedEncode);
}
printf("%s --> Frame rate: %f fps\n",
doyuv? "Comp from YUV":"Compress ", (double)iter/elapsed);
printf(" Output image size: %d bytes\n",
totaljpegsize);
printf(" Compression ratio: %f:1\n", printf(" Compression ratio: %f:1\n",
(double)(w*h*ps)/(double)totaljpegsize); (double)(w*h*ps)/(double)totaljpegsize);
printf(" Source throughput: %f Megapixels/sec\n", printf(" Throughput: %f Megapixels/sec\n",
(double)(w*h)/1000000.*(double)i/elapsed); (double)(w*h)/1000000.*(double)iter/elapsed);
printf(" Output bit stream: %f Megabits/sec\n", printf(" Output bit stream: %f Megabits/sec\n",
(double)totaljpegsize*8./1000000.*(double)i/elapsed); (double)totaljpegsize*8./1000000.*(double)iter/elapsed);
} }
if(tilew==w && tileh==h) if(tilew==w && tileh==h)
{ {
@@ -470,7 +513,7 @@ int dotest(unsigned char *srcbuf, int w, int h, int subsamp, int jpegqual,
/* Decompression test */ /* Decompression test */
if(!componly) if(!componly)
{ {
if(decomptest(srcbuf, jpegbuf, jpegsize, tmpbuf, w, h, subsamp, jpegqual, if(decomp(srcbuf, jpegbuf, jpegsize, tmpbuf, w, h, subsamp, jpegqual,
filename, tilew, tileh)==-1) filename, tilew, tileh)==-1)
goto bailout; goto bailout;
} }
@@ -481,6 +524,10 @@ int dotest(unsigned char *srcbuf, int w, int h, int subsamp, int jpegqual,
} }
free(jpegbuf); jpegbuf=NULL; free(jpegbuf); jpegbuf=NULL;
free(jpegsize); jpegsize=NULL; free(jpegsize); jpegsize=NULL;
if(doyuv)
{
free(yuvbuf); yuvbuf=NULL;
}
if(tilew==w && tileh==h) break; if(tilew==w && tileh==h) break;
} }
@@ -495,14 +542,15 @@ int dotest(unsigned char *srcbuf, int w, int h, int subsamp, int jpegqual,
} }
free(jpegbuf); jpegbuf=NULL; free(jpegbuf); jpegbuf=NULL;
} }
if(yuvbuf) {free(yuvbuf); yuvbuf=NULL;}
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 retval; return;
} }
int dodecomptest(char *filename) void decompTest(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;
@@ -511,7 +559,7 @@ int dodecomptest(char *filename)
int w=0, h=0, subsamp=-1, cs=-1, _w, _h, _tilew, _tileh, int w=0, h=0, subsamp=-1, cs=-1, _w, _h, _tilew, _tileh,
_ntilesw, _ntilesh, _subsamp; _ntilesw, _ntilesh, _subsamp;
char *temp=NULL, tempstr[80], tempstr2[80]; char *temp=NULL, tempstr[80], tempstr2[80];
int row, col, i, tilew, tileh, ntilesw=1, ntilesh=1, retval=0; int row, col, i, iter, tilew, tileh, ntilesw=1, ntilesh=1, retval=0;
double start, elapsed; double start, elapsed;
int ps=tjPixelSize[pf], tile; int ps=tjPixelSize[pf], tile;
@@ -538,20 +586,18 @@ int dodecomptest(char *filename)
if(quiet==1) if(quiet==1)
{ {
printf("All performance values in Mpixels/sec\n\n"); printf("All performance values in Mpixels/sec\n\n");
printf("Bitmap\tBitmap\tJPEG\tJPEG\t%s %s \tXform\tComp\tDecomp\n", printf("Bitmap JPEG JPEG %s %s Xform Comp Decomp ",
dotile? "Tile ":"Image", dotile? "Tile ":"Image"); dotile? "Tile ":"Image", dotile? "Tile ":"Image");
printf("Format\tOrder\tCS\tSubsamp\tWidth Height\tPerf \tRatio\tPerf\n\n"); if(doyuv) printf("Decode");
printf("\n");
printf("Format CS Subsamp Width Height Perf Ratio Perf ");
if(doyuv) printf("Perf");
printf("\n\n");
} }
else if(!quiet) else if(!quiet)
{
if(yuv==YUVDECODE)
printf(">>>>> JPEG %s --> YUV <<<<<\n",
formatName(subsamp, cs, tempstr));
else
printf(">>>>> JPEG %s --> %s (%s) <<<<<\n", printf(">>>>> JPEG %s --> %s (%s) <<<<<\n",
formatName(subsamp, cs, tempstr), pixFormatStr[pf], formatName(subsamp, cs, tempstr), pixFormatStr[pf],
(flags&TJFLAG_BOTTOMUP)? "Bottom-up":"Top-down"); (flags&TJFLAG_BOTTOMUP)? "Bottom-up":"Top-down");
}
for(tilew=dotile? 16:w, tileh=dotile? 16:h; ; tilew*=2, tileh*=2) for(tilew=dotile? 16:w, tileh=dotile? 16:h; ; tilew*=2, tileh*=2)
{ {
@@ -567,7 +613,7 @@ int dodecomptest(char *filename)
_throwunix("allocating JPEG size array"); _throwunix("allocating JPEG size array");
memset(jpegsize, 0, sizeof(unsigned long)*ntilesw*ntilesh); memset(jpegsize, 0, sizeof(unsigned long)*ntilesw*ntilesh);
if((flags&TJFLAG_NOREALLOC)!=0) if((flags&TJFLAG_NOREALLOC)!=0 || !dotile)
for(i=0; i<ntilesw*ntilesh; i++) for(i=0; i<ntilesw*ntilesh; i++)
{ {
if((jpegbuf[i]=(unsigned char *)malloc(tjBufSize(tilew, tileh, if((jpegbuf[i]=(unsigned char *)malloc(tjBufSize(tilew, tileh,
@@ -586,9 +632,9 @@ int dodecomptest(char *filename)
} }
else if(quiet==1) else if(quiet==1)
{ {
printf("%s\t%s\t%s\t%s\t", pixFormatStr[pf], printf("%-4s (%s) %-5s %-5s ", pixFormatStr[pf],
(flags&TJFLAG_BOTTOMUP)? "BU":"TD", csName[cs], subNameLong[subsamp]); (flags&TJFLAG_BOTTOMUP)? "BU":"TD", csName[cs], subNameLong[subsamp]);
printf("%-4d %-4d\t", tilew, tileh); printf("%-5d %-5d ", tilew, tileh);
} }
_subsamp=subsamp; _subsamp=subsamp;
@@ -616,6 +662,13 @@ int dodecomptest(char *filename)
_ntilesw=(_w+_tilew-1)/_tilew; _ntilesw=(_w+_tilew-1)/_tilew;
_ntilesh=(_h+_tileh-1)/_tileh; _ntilesh=(_h+_tileh-1)/_tileh;
if(xformop==TJXOP_TRANSPOSE || xformop==TJXOP_TRANSVERSE
|| xformop==TJXOP_ROT90 || xformop==TJXOP_ROT270)
{
if(_subsamp==TJSAMP_422) _subsamp=TJSAMP_440;
else if(_subsamp==TJSAMP_440) _subsamp=TJSAMP_422;
}
for(row=0, tile=0; row<_ntilesh; row++) for(row=0, tile=0; row<_ntilesh; row++)
{ {
for(col=0; col<_ntilesw; col++, tile++) for(col=0; col<_ntilesw; col++, tile++)
@@ -634,11 +687,21 @@ int dodecomptest(char *filename)
} }
} }
iter=-warmup;
elapsed=0.;
while(1)
{
start=gettime(); start=gettime();
if(tjTransform(handle, srcbuf, srcsize, _ntilesw*_ntilesh, jpegbuf, if(tjTransform(handle, srcbuf, srcsize, _ntilesw*_ntilesh, jpegbuf,
jpegsize, t, flags)==-1) jpegsize, t, flags)==-1)
_throwtj("executing tjTransform()"); _throwtj("executing tjTransform()");
elapsed=gettime()-start; iter++;
if(iter>=1)
{
elapsed+=gettime()-start;
if(elapsed>=benchtime) break;
}
}
free(t); t=NULL; free(t); t=NULL;
@@ -647,19 +710,19 @@ int dodecomptest(char *filename)
if(quiet) if(quiet)
{ {
printf("%s%c%s%c", printf("%-6s%s%-6s%s",
sigfig((double)(w*h)/1000000./elapsed, 4, tempstr, 80), sigfig((double)(w*h)/1000000./elapsed, 4, tempstr, 80),
quiet==2? '\n':'\t', quiet==2? "\n":" ",
sigfig((double)(w*h*ps)/(double)totaljpegsize, 4, tempstr2, 80), sigfig((double)(w*h*ps)/(double)totaljpegsize, 4, tempstr2, 80),
quiet==2? '\n':'\t'); quiet==2? "\n":" ");
} }
else if(!quiet) else if(!quiet)
{ {
printf("X--> Frame rate: %f fps\n", 1.0/elapsed); printf("Transform --> Frame rate: %f fps\n", 1.0/elapsed);
printf(" Output image size: %lu bytes\n", totaljpegsize); printf(" Output image size: %lu bytes\n", totaljpegsize);
printf(" Compression ratio: %f:1\n", printf(" Compression ratio: %f:1\n",
(double)(w*h*ps)/(double)totaljpegsize); (double)(w*h*ps)/(double)totaljpegsize);
printf(" Source throughput: %f Megapixels/sec\n", printf(" Throughput: %f Megapixels/sec\n",
(double)(w*h)/1000000./elapsed); (double)(w*h)/1000000./elapsed);
printf(" Output bit stream: %f Megabits/sec\n", printf(" Output bit stream: %f Megabits/sec\n",
(double)totaljpegsize*8./1000000./elapsed); (double)totaljpegsize*8./1000000./elapsed);
@@ -667,7 +730,7 @@ int dodecomptest(char *filename)
} }
else else
{ {
if(quiet==1) printf("N/A\tN/A\t"); if(quiet==1) printf("N/A N/A ");
jpegsize[0]=srcsize; jpegsize[0]=srcsize;
memcpy(jpegbuf[0], srcbuf, srcsize); memcpy(jpegbuf[0], srcbuf, srcsize);
} }
@@ -676,7 +739,7 @@ int dodecomptest(char *filename)
if(h==tileh) _tileh=_h; if(h==tileh) _tileh=_h;
if(!(xformopt&TJXOPT_NOOUTPUT)) if(!(xformopt&TJXOPT_NOOUTPUT))
{ {
if(decomptest(NULL, jpegbuf, jpegsize, NULL, _w, _h, _subsamp, 0, if(decomp(NULL, jpegbuf, jpegsize, NULL, _w, _h, _subsamp, 0,
filename, _tilew, _tileh)==-1) filename, _tilew, _tileh)==-1)
goto bailout; goto bailout;
} }
@@ -706,7 +769,7 @@ int 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 retval; return;
} }
@@ -714,7 +777,7 @@ void usage(char *progname)
{ {
int i; int i;
printf("USAGE: %s\n", progname); printf("USAGE: %s\n", progname);
printf(" <Inputfile (BMP|PPM|YUV)> <Quality> [options]\n\n"); printf(" <Inputfile (BMP|PPM)> <Quality> [options]\n\n");
printf(" %s\n", progname); printf(" %s\n", progname);
printf(" <Inputfile (JPG)> [options]\n\n"); printf(" <Inputfile (JPG)> [options]\n\n");
printf("Options:\n\n"); printf("Options:\n\n");
@@ -724,29 +787,23 @@ void usage(char *progname)
printf("-tile = Test performance of the codec when the image is encoded as separate\n"); printf("-tile = Test performance of the codec when the image is encoded as separate\n");
printf(" tiles of varying sizes.\n"); printf(" tiles of varying sizes.\n");
printf("-rgb, -bgr, -rgbx, -bgrx, -xbgr, -xrgb =\n"); printf("-rgb, -bgr, -rgbx, -bgrx, -xbgr, -xrgb =\n");
printf(" Test the specified color conversion path in the codec (default: BGR)\n"); printf(" Test the specified color conversion path in the codec (default = BGR)\n");
printf("-fastupsample = Use the fastest chrominance upsampling algorithm available in\n"); printf("-fastupsample = Use the fastest chrominance upsampling algorithm available in\n");
printf(" the underlying codec\n"); printf(" the underlying codec\n");
printf("-fastdct = Use the fastest DCT/IDCT algorithms available in the underlying\n"); printf("-fastdct = Use the fastest DCT/IDCT algorithms available in the underlying\n");
printf(" codec\n"); printf(" codec\n");
printf("-accuratedct = Use the most accurate DCT/IDCT algorithms available in the\n"); printf("-accuratedct = Use the most accurate DCT/IDCT algorithms available in the\n");
printf(" underlying codec\n"); printf(" underlying codec\n");
printf("-subsamp <s> = if compressing a JPEG image from a YUV planar source image,\n"); printf("-subsamp <s> = When testing JPEG compression, this option specifies the level\n");
printf(" this specifies the level of chrominance subsampling used in the source\n"); printf(" of chrominance subsampling to use (<s> = 444, 422, 440, 420, 411, or\n");
printf(" image. Otherwise, this specifies the level of chrominance subsampling\n"); printf(" GRAY). The default is to test Grayscale, 4:2:0, 4:2:2, and 4:4:4 in\n");
printf(" to use in the JPEG destination image. <s> = 444, 422, 440, 420, 411,\n"); printf(" sequence.\n");
printf(" or GRAY\n");
printf("-quiet = Output results in tabular rather than verbose format\n"); printf("-quiet = Output results in tabular rather than verbose format\n");
printf("-yuvencode = Encode RGB input as planar YUV rather than compressing as JPEG\n"); printf("-yuv = Test YUV encoding/decoding functions\n");
printf("-yuvdecode = Decode JPEG image to planar YUV rather than RGB\n"); printf("-yuvpad <p> = If testing YUV encoding/decoding, this specifies the number of\n");
printf("-yuvsize WxH = if compressing a JPEG image from a YUV planar source image, this\n"); printf(" bytes to which each row of each plane in the intermediate YUV image is\n");
printf(" specifies the width and height of the source image.\n"); printf(" padded (default = 1)\n");
printf("-yuvpad <p> = if compressing a JPEG image from a YUV planar source image, this\n"); printf("-scale M/N = Scale down the width/height of the decompressed JPEG image by a\n");
printf(" specifies the number of bytes to which each row of each plane in the\n");
printf(" source image is padded. If decompressing a JPEG image to a YUV planar\n");
printf(" destination image, this specifies the row padding for each plane of the\n");
printf(" destination image. (default=1)\n");
printf("-scale M/N = scale down the width/height of the decompressed JPEG image by a\n");
printf(" factor of M/N (M/N = "); printf(" factor of M/N (M/N = ");
for(i=0; i<nsf; i++) for(i=0; i<nsf; i++)
{ {
@@ -766,6 +823,8 @@ void usage(char *progname)
printf("-grayscale = Perform lossless grayscale conversion prior to decompression\n"); printf("-grayscale = Perform lossless grayscale conversion prior to decompression\n");
printf(" test (can be combined with the other transforms above)\n"); printf(" test (can be combined with the other transforms above)\n");
printf("-benchtime <t> = Run each benchmark for at least <t> seconds (default = 5.0)\n"); printf("-benchtime <t> = Run each benchmark for at least <t> seconds (default = 5.0)\n");
printf("-warmup <w> = Execute each benchmark <w> times to prime the cache before\n");
printf(" taking performance measurements (default = 1)\n");
printf("-componly = Stop after running compression tests. Do not test decompression.\n\n"); printf("-componly = Stop after running compression tests. Do not test decompression.\n\n");
printf("NOTE: If the quality is specified as a range (e.g. 90-100), a separate\n"); printf("NOTE: If the quality is specified as a range (e.g. 90-100), a separate\n");
printf("test will be performed for all quality values in the range.\n\n"); printf("test will be performed for all quality values in the range.\n\n");
@@ -789,29 +848,11 @@ int main(int argc, char *argv[])
{ {
if(!strcasecmp(temp, ".bmp")) ext="bmp"; if(!strcasecmp(temp, ".bmp")) ext="bmp";
if(!strcasecmp(temp, ".jpg") || !strcasecmp(temp, ".jpeg")) decomponly=1; if(!strcasecmp(temp, ".jpg") || !strcasecmp(temp, ".jpeg")) decomponly=1;
if(!strcasecmp(temp, ".yuv")) yuv=YUVCOMPRESS;
} }
printf("\n"); printf("\n");
if(argc>minarg) if(!decomponly)
{
for(i=minarg; i<argc; i++)
{
if(!strcasecmp(argv[i], "-yuvencode"))
{
printf("Testing YUV planar encoding\n\n");
yuv=YUVENCODE; maxqual=minqual=100;
}
if(!strcasecmp(argv[i], "-yuvdecode"))
{
printf("Testing YUV planar decoding\n\n");
yuv=YUVDECODE;
}
}
}
if(!decomponly && yuv!=YUVENCODE)
{ {
minarg=3; minarg=3;
if(argc<minarg) usage(argv[0]); if(argc<minarg) usage(argv[0]);
@@ -892,18 +933,23 @@ int main(int argc, char *argv[])
if(temp>0.0) benchtime=temp; if(temp>0.0) benchtime=temp;
else usage(argv[0]); else usage(argv[0]);
} }
if(!strcasecmp(argv[i], "-warmup") && i<argc-1)
{
int temp=atoi(argv[++i]);
if(temp>=0)
{
warmup=temp;
printf("Warmup runs = %d\n\n", warmup);
}
else usage(argv[0]);
}
if(!strcmp(argv[i], "-?")) usage(argv[0]); if(!strcmp(argv[i], "-?")) usage(argv[0]);
if(!strcasecmp(argv[i], "-alloc")) flags&=(~TJFLAG_NOREALLOC); if(!strcasecmp(argv[i], "-alloc")) flags&=(~TJFLAG_NOREALLOC);
if(!strcasecmp(argv[i], "-bmp")) ext="bmp"; if(!strcasecmp(argv[i], "-bmp")) ext="bmp";
if(!strcasecmp(argv[i], "-yuvsize") && i<argc-1) if(!strcasecmp(argv[i], "-yuv"))
{ {
int temp1=0, temp2=0; printf("Testing YUV planar encoding/decoding\n\n");
if(sscanf(argv[++i], "%dx%d", &temp1, &temp2)==2 && temp1>=1 doyuv=1;
&& temp2>=1)
{
w=temp1; h=temp2;
}
else usage(argv[0]);
} }
if(!strcasecmp(argv[i], "-yuvpad") && i<argc-1) if(!strcasecmp(argv[i], "-yuvpad") && i<argc-1)
{ {
@@ -931,8 +977,6 @@ int main(int argc, char *argv[])
} }
} }
if(yuv) ext="yuv";
if((sf.num!=1 || sf.denom!=1) && dotile) if((sf.num!=1 || sf.denom!=1) && dotile)
{ {
printf("Disabling tiled compression/decompression tests, because those tests do not\n"); printf("Disabling tiled compression/decompression tests, because those tests do not\n");
@@ -940,41 +984,10 @@ int main(int argc, char *argv[])
dotile=0; dotile=0;
} }
if(yuv && dotile)
{
printf("Disabling tiled compression/decompression tests, because those tests do not\n");
printf("work when YUV encoding, compression, or decoding is enabled.\n\n");
dotile=0;
}
if(!decomponly) if(!decomponly)
{
if(yuv==YUVCOMPRESS)
{
FILE *file=NULL; unsigned long srcsize;
if(w<1 || h<1 || subsamp<0 || subsamp>=TJ_NUMSAMP)
_throw("opening YUV image file",
"YUV image size and/or subsampling not specified");
if((file=fopen(argv[1], "rb"))==NULL)
_throwunix("opening YUV image file");
if(fseek(file, 0, SEEK_END)<0 ||
(srcsize=ftell(file))==(unsigned long)-1)
_throwunix("determining YUV image file size");
if(srcsize!=tjBufSizeYUV2(w, yuvpad, h, subsamp))
_throw("opening YUV image file", "YUV image file is the wrong size");
if((srcbuf=(unsigned char *)malloc(srcsize))==NULL)
_throwunix("allocating memory for YUV image");
if(fseek(file, 0, SEEK_SET)<0)
_throwunix("setting YUV image file position");
if(fread(srcbuf, srcsize, 1, file)<1)
_throwunix("reading YUV data");
fclose(file); file=NULL;
}
else
{ {
if(loadbmp(argv[1], &srcbuf, &w, &h, pf, (flags&TJFLAG_BOTTOMUP)!=0)==-1) if(loadbmp(argv[1], &srcbuf, &w, &h, pf, (flags&TJFLAG_BOTTOMUP)!=0)==-1)
_throwbmp("loading bitmap"); _throwbmp("loading bitmap");
}
temp=strrchr(argv[1], '.'); temp=strrchr(argv[1], '.');
if(temp!=NULL) *temp='\0'; if(temp!=NULL) *temp='\0';
} }
@@ -982,36 +995,44 @@ int main(int argc, char *argv[])
if(quiet==1 && !decomponly) if(quiet==1 && !decomponly)
{ {
printf("All performance values in Mpixels/sec\n\n"); printf("All performance values in Mpixels/sec\n\n");
printf("Bitmap\tBitmap\tJPEG\tJPEG\t%s %s \tComp\tComp\tDecomp\n", printf("Bitmap JPEG JPEG %s %s ",
dotile? "Tile ":"Image", dotile? "Tile ":"Image"); dotile? "Tile ":"Image", dotile? "Tile ":"Image");
printf("Format\tOrder\tSubsamp\tQual\tWidth Height\tPerf \tRatio\tPerf\n\n"); if(doyuv) printf("Encode ");
printf("Comp Comp Decomp ");
if(doyuv) printf("Decode");
printf("\n");
printf("Format Subsamp Qual Width Height ");
if(doyuv) printf("Perf ");
printf("Perf Ratio Perf ");
if(doyuv) printf("Perf");
printf("\n\n");
} }
if(decomponly) if(decomponly)
{ {
dodecomptest(argv[1]); decompTest(argv[1]);
printf("\n"); printf("\n");
goto bailout; goto bailout;
} }
if(yuv==YUVCOMPRESS || (subsamp>=0 && subsamp<TJ_NUMSAMP)) if(subsamp>=0 && subsamp<TJ_NUMSAMP)
{ {
for(i=maxqual; i>=minqual; i--) for(i=maxqual; i>=minqual; i--)
dotest(srcbuf, w, h, subsamp, i, argv[1]); fullTest(srcbuf, w, h, subsamp, i, argv[1]);
printf("\n"); printf("\n");
} }
else else
{ {
for(i=maxqual; i>=minqual; i--) for(i=maxqual; i>=minqual; i--)
dotest(srcbuf, w, h, TJSAMP_GRAY, i, argv[1]); fullTest(srcbuf, w, h, TJSAMP_GRAY, i, argv[1]);
printf("\n"); printf("\n");
for(i=maxqual; i>=minqual; i--) for(i=maxqual; i>=minqual; i--)
dotest(srcbuf, w, h, TJSAMP_420, i, argv[1]); fullTest(srcbuf, w, h, TJSAMP_420, i, argv[1]);
printf("\n"); printf("\n");
for(i=maxqual; i>=minqual; i--) for(i=maxqual; i>=minqual; i--)
dotest(srcbuf, w, h, TJSAMP_422, i, argv[1]); fullTest(srcbuf, w, h, TJSAMP_422, i, argv[1]);
printf("\n"); printf("\n");
for(i=maxqual; i>=minqual; i--) for(i=maxqual; i>=minqual; i--)
dotest(srcbuf, w, h, TJSAMP_444, i, argv[1]); fullTest(srcbuf, w, h, TJSAMP_444, i, argv[1]);
printf("\n"); printf("\n");
} }

View File

@@ -25,6 +25,8 @@ IMGDIR=@srcdir@/testimages
OUTDIR=__tjbenchtest_output OUTDIR=__tjbenchtest_output
EXEDIR=. EXEDIR=.
BMPARG= BMPARG=
NSARG=
YUVARG=
if [ "$EXT" = "bmp" ]; then BMPARG=-bmp; fi if [ "$EXT" = "bmp" ]; then BMPARG=-bmp; fi
if [ -d $OUTDIR ]; then if [ -d $OUTDIR ]; then
@@ -34,33 +36,58 @@ mkdir -p $OUTDIR
exec >$EXEDIR/tjbenchtest.log exec >$EXEDIR/tjbenchtest.log
if [ $# -gt 0 ]; then
if [ "$1" = "-yuv" ]; then
NSARG=-nosmooth
YUVARG=-yuv
# NOTE: The combination of tjEncodeYUV*() and tjCompressFromYUV*() does not
# always produce bitwise-identical results to tjCompress*() if subsampling is
# enabled. In both cases, if the image width or height are not evenly
# divisible by the MCU width/height, then the bottom and/or right edge are
# expanded. However, the libjpeg code performs this expansion prior to
# downsampling, and TurboJPEG performs it in tjCompressFromYUV*(), which is
# after downsampling. Thus, the two will agree only if the width/height along
# each downsampled dimension is an odd number or is evenly divisible by the MCU
# width/height. This disagreement basically amounts to a round-off error, but
# there is no easy way around it, so for now, we just test the only image that
# works. (NOTE: nightshot_iso_100 does not suffer from the above issue, but
# it suffers from an unrelated problem whereby the combination of
# tjDecompressToYUV*() and tjDecodeYUV*() do not produce bitwise-identical
# results to tjDecompress*() if decompression scaling is enabled. This latter
# phenomenon is not yet fully understood but is also believed to be some sort
# of round-off error.)
IMAGES="vgl_6548_0026a.${EXT}"
fi
fi
# Standard tests # Standard tests
for image in $IMAGES; do for image in $IMAGES; do
cp $IMGDIR/$image $OUTDIR cp $IMGDIR/$image $OUTDIR
basename=`basename $image .${EXT}` basename=`basename $image .${EXT}`
$EXEDIR/cjpeg -quality 95 -dct fast -grayscale $IMGDIR/${basename}.${EXT} >$OUTDIR/${basename}_GRAY_fast_cjpeg.jpg runme $EXEDIR/cjpeg -quality 95 -dct fast -grayscale -outfile $OUTDIR/${basename}_GRAY_fast_cjpeg.jpg $IMGDIR/${basename}.${EXT}
$EXEDIR/cjpeg -quality 95 -dct fast -sample 2x2 $IMGDIR/${basename}.${EXT} >$OUTDIR/${basename}_420_fast_cjpeg.jpg runme $EXEDIR/cjpeg -quality 95 -dct fast -sample 2x2 -outfile $OUTDIR/${basename}_420_fast_cjpeg.jpg $IMGDIR/${basename}.${EXT}
$EXEDIR/cjpeg -quality 95 -dct fast -sample 2x1 $IMGDIR/${basename}.${EXT} >$OUTDIR/${basename}_422_fast_cjpeg.jpg runme $EXEDIR/cjpeg -quality 95 -dct fast -sample 2x1 -outfile $OUTDIR/${basename}_422_fast_cjpeg.jpg $IMGDIR/${basename}.${EXT}
$EXEDIR/cjpeg -quality 95 -dct fast -sample 1x1 $IMGDIR/${basename}.${EXT} >$OUTDIR/${basename}_444_fast_cjpeg.jpg runme $EXEDIR/cjpeg -quality 95 -dct fast -sample 1x1 -outfile $OUTDIR/${basename}_444_fast_cjpeg.jpg $IMGDIR/${basename}.${EXT}
$EXEDIR/cjpeg -quality 95 -dct int -grayscale $IMGDIR/${basename}.${EXT} >$OUTDIR/${basename}_GRAY_accurate_cjpeg.jpg runme $EXEDIR/cjpeg -quality 95 -dct int -grayscale -outfile $OUTDIR/${basename}_GRAY_accurate_cjpeg.jpg $IMGDIR/${basename}.${EXT}
$EXEDIR/cjpeg -quality 95 -dct int -sample 2x2 $IMGDIR/${basename}.${EXT} >$OUTDIR/${basename}_420_accurate_cjpeg.jpg runme $EXEDIR/cjpeg -quality 95 -dct int -sample 2x2 -outfile $OUTDIR/${basename}_420_accurate_cjpeg.jpg $IMGDIR/${basename}.${EXT}
$EXEDIR/cjpeg -quality 95 -dct int -sample 2x1 $IMGDIR/${basename}.${EXT} >$OUTDIR/${basename}_422_accurate_cjpeg.jpg runme $EXEDIR/cjpeg -quality 95 -dct int -sample 2x1 -outfile $OUTDIR/${basename}_422_accurate_cjpeg.jpg $IMGDIR/${basename}.${EXT}
$EXEDIR/cjpeg -quality 95 -dct int -sample 1x1 $IMGDIR/${basename}.${EXT} >$OUTDIR/${basename}_444_accurate_cjpeg.jpg runme $EXEDIR/cjpeg -quality 95 -dct int -sample 1x1 -outfile $OUTDIR/${basename}_444_accurate_cjpeg.jpg $IMGDIR/${basename}.${EXT}
for samp in GRAY 420 422 444; do for samp in GRAY 420 422 444; do
$EXEDIR/djpeg -rgb $BMPARG $OUTDIR/${basename}_${samp}_fast_cjpeg.jpg >$OUTDIR/${basename}_${samp}_default_djpeg.${EXT} runme $EXEDIR/djpeg -rgb $NSARG $BMPARG -outfile $OUTDIR/${basename}_${samp}_default_djpeg.${EXT} $OUTDIR/${basename}_${samp}_fast_cjpeg.jpg
$EXEDIR/djpeg -dct fast -rgb $BMPARG $OUTDIR/${basename}_${samp}_fast_cjpeg.jpg >$OUTDIR/${basename}_${samp}_fast_djpeg.${EXT} runme $EXEDIR/djpeg -dct fast -rgb $NSARG $BMPARG -outfile $OUTDIR/${basename}_${samp}_fast_djpeg.${EXT} $OUTDIR/${basename}_${samp}_fast_cjpeg.jpg
$EXEDIR/djpeg -dct int -rgb $BMPARG $OUTDIR/${basename}_${samp}_accurate_cjpeg.jpg >$OUTDIR/${basename}_${samp}_accurate_djpeg.${EXT} runme $EXEDIR/djpeg -dct int -rgb $NSARG $BMPARG -outfile $OUTDIR/${basename}_${samp}_accurate_djpeg.${EXT} $OUTDIR/${basename}_${samp}_accurate_cjpeg.jpg
done done
for samp in 420 422; do for samp in 420 422; do
$EXEDIR/djpeg -nosmooth $BMPARG $OUTDIR/${basename}_${samp}_fast_cjpeg.jpg >$OUTDIR/${basename}_${samp}_default_nosmooth_djpeg.${EXT} runme $EXEDIR/djpeg -nosmooth $BMPARG -outfile $OUTDIR/${basename}_${samp}_default_nosmooth_djpeg.${EXT} $OUTDIR/${basename}_${samp}_fast_cjpeg.jpg
$EXEDIR/djpeg -dct fast -nosmooth $BMPARG $OUTDIR/${basename}_${samp}_fast_cjpeg.jpg >$OUTDIR/${basename}_${samp}_fast_nosmooth_djpeg.${EXT} runme $EXEDIR/djpeg -dct fast -nosmooth $BMPARG -outfile $OUTDIR/${basename}_${samp}_fast_nosmooth_djpeg.${EXT} $OUTDIR/${basename}_${samp}_fast_cjpeg.jpg
$EXEDIR/djpeg -dct int -nosmooth $BMPARG $OUTDIR/${basename}_${samp}_accurate_cjpeg.jpg >$OUTDIR/${basename}_${samp}_accurate_nosmooth_djpeg.${EXT} runme $EXEDIR/djpeg -dct int -nosmooth $BMPARG -outfile $OUTDIR/${basename}_${samp}_accurate_nosmooth_djpeg.${EXT} $OUTDIR/${basename}_${samp}_accurate_cjpeg.jpg
done done
# Compression # Compression
for dct in accurate fast; do for dct in accurate fast; do
runme $EXEDIR/tjbench $OUTDIR/$image 95 -rgb -quiet -benchtime 0.01 -${dct}dct runme $EXEDIR/tjbench $OUTDIR/$image 95 -rgb -quiet -benchtime 0.01 -warmup 0 -${dct}dct $YUVARG
for samp in GRAY 420 422 444; do for samp in GRAY 420 422 444; do
runme cmp $OUTDIR/${basename}_${samp}_Q95.jpg $OUTDIR/${basename}_${samp}_${dct}_cjpeg.jpg runme cmp $OUTDIR/${basename}_${samp}_Q95.jpg $OUTDIR/${basename}_${samp}_${dct}_cjpeg.jpg
done done
@@ -73,7 +100,7 @@ for image in $IMAGES; do
fi fi
# Tiled compression & decompression # Tiled compression & decompression
runme $EXEDIR/tjbench $OUTDIR/$image 95 -rgb -tile -quiet -benchtime 0.01 ${dctarg} runme $EXEDIR/tjbench $OUTDIR/$image 95 -rgb -tile -quiet -benchtime 0.01 -warmup 0 ${dctarg} $YUVARG
for samp in GRAY 444; do for samp in GRAY 444; do
for i in $OUTDIR/${basename}_${samp}_Q95_[0-9]*[0-9]x[0-9]*[0-9].${EXT} \ for i in $OUTDIR/${basename}_${samp}_Q95_[0-9]*[0-9]x[0-9]*[0-9].${EXT} \
$OUTDIR/${basename}_${samp}_Q95_full.${EXT}; do $OUTDIR/${basename}_${samp}_Q95_full.${EXT}; do
@@ -81,7 +108,7 @@ for image in $IMAGES; do
rm $i rm $i
done done
done done
runme $EXEDIR/tjbench $OUTDIR/$image 95 -rgb -tile -quiet -benchtime 0.01 -fastupsample ${dctarg} runme $EXEDIR/tjbench $OUTDIR/$image 95 -rgb -tile -quiet -benchtime 0.01 -warmup 0 -fastupsample ${dctarg} $YUVARG
for samp in 420 422; do for samp in 420 422; do
for i in $OUTDIR/${basename}_${samp}_Q95_[0-9]*[0-9]x[0-9]*[0-9].${EXT} \ for i in $OUTDIR/${basename}_${samp}_Q95_[0-9]*[0-9]x[0-9]*[0-9].${EXT} \
$OUTDIR/${basename}_${samp}_Q95_full.${EXT}; do $OUTDIR/${basename}_${samp}_Q95_full.${EXT}; do
@@ -92,7 +119,7 @@ for image in $IMAGES; do
# Tiled decompression # Tiled decompression
for samp in GRAY 444; do for samp in GRAY 444; do
runme $EXEDIR/tjbench $OUTDIR/${basename}_${samp}_Q95.jpg $BMPARG -tile -quiet -benchtime 0.01 ${dctarg} runme $EXEDIR/tjbench $OUTDIR/${basename}_${samp}_Q95.jpg $BMPARG -tile -quiet -benchtime 0.01 -warmup 0 ${dctarg} $YUVARG
for i in $OUTDIR/${basename}_${samp}_Q95_[0-9]*[0-9]x[0-9]*[0-9].${EXT} \ for i in $OUTDIR/${basename}_${samp}_Q95_[0-9]*[0-9]x[0-9]*[0-9].${EXT} \
$OUTDIR/${basename}_${samp}_Q95_full.${EXT}; do $OUTDIR/${basename}_${samp}_Q95_full.${EXT}; do
runme cmp $i $OUTDIR/${basename}_${samp}_${dct}_djpeg.${EXT} runme cmp $i $OUTDIR/${basename}_${samp}_${dct}_djpeg.${EXT}
@@ -100,7 +127,7 @@ for image in $IMAGES; do
done done
done done
for samp in 420 422; do for samp in 420 422; do
runme $EXEDIR/tjbench $OUTDIR/${basename}_${samp}_Q95.jpg $BMPARG -tile -quiet -benchtime 0.01 -fastupsample ${dctarg} runme $EXEDIR/tjbench $OUTDIR/${basename}_${samp}_Q95.jpg $BMPARG -tile -quiet -benchtime 0.01 -warmup 0 -fastupsample ${dctarg} $YUVARG
for i in $OUTDIR/${basename}_${samp}_Q95_[0-9]*[0-9]x[0-9]*[0-9].${EXT} \ for i in $OUTDIR/${basename}_${samp}_Q95_[0-9]*[0-9]x[0-9]*[0-9].${EXT} \
$OUTDIR/${basename}_${samp}_Q95_full.${EXT}; do $OUTDIR/${basename}_${samp}_Q95_full.${EXT}; do
runme cmp $i $OUTDIR/${basename}_${samp}_${dct}_nosmooth_djpeg.${EXT} runme cmp $i $OUTDIR/${basename}_${samp}_${dct}_nosmooth_djpeg.${EXT}
@@ -113,8 +140,8 @@ for image in $IMAGES; do
for scale in 2_1 15_8 7_4 13_8 3_2 11_8 5_4 9_8 7_8 3_4 5_8 1_2 3_8 1_4 1_8; do for scale in 2_1 15_8 7_4 13_8 3_2 11_8 5_4 9_8 7_8 3_4 5_8 1_2 3_8 1_4 1_8; do
scalearg=`echo $scale | sed s@_@/@g` scalearg=`echo $scale | sed s@_@/@g`
for samp in GRAY 420 422 444; do for samp in GRAY 420 422 444; do
$EXEDIR/djpeg -rgb -scale ${scalearg} $BMPARG $OUTDIR/${basename}_${samp}_fast_cjpeg.jpg >$OUTDIR/${basename}_${samp}_${scale}_djpeg.${EXT} runme $EXEDIR/djpeg -rgb -scale ${scalearg} $NSARG $BMPARG -outfile $OUTDIR/${basename}_${samp}_${scale}_djpeg.${EXT} $OUTDIR/${basename}_${samp}_fast_cjpeg.jpg
runme $EXEDIR/tjbench $OUTDIR/${basename}_${samp}_Q95.jpg $BMPARG -scale ${scalearg} -quiet -benchtime 0.01 runme $EXEDIR/tjbench $OUTDIR/${basename}_${samp}_Q95.jpg $BMPARG -scale ${scalearg} -quiet -benchtime 0.01 -warmup 0 $YUVARG
runme cmp $OUTDIR/${basename}_${samp}_Q95_${scale}.${EXT} $OUTDIR/${basename}_${samp}_${scale}_djpeg.${EXT} runme cmp $OUTDIR/${basename}_${samp}_Q95_${scale}.${EXT} $OUTDIR/${basename}_${samp}_${scale}_djpeg.${EXT}
rm $OUTDIR/${basename}_${samp}_Q95_${scale}.${EXT} rm $OUTDIR/${basename}_${samp}_Q95_${scale}.${EXT}
done done
@@ -122,18 +149,18 @@ for image in $IMAGES; do
# Transforms # Transforms
for samp in GRAY 420 422 444; do for samp in GRAY 420 422 444; do
$EXEDIR/jpegtran -flip horizontal -trim $OUTDIR/${basename}_${samp}_Q95.jpg >$OUTDIR/${basename}_${samp}_hflip_jpegtran.jpg runme $EXEDIR/jpegtran -flip horizontal -trim -outfile $OUTDIR/${basename}_${samp}_hflip_jpegtran.jpg $OUTDIR/${basename}_${samp}_Q95.jpg
$EXEDIR/jpegtran -flip vertical -trim $OUTDIR/${basename}_${samp}_Q95.jpg >$OUTDIR/${basename}_${samp}_vflip_jpegtran.jpg runme $EXEDIR/jpegtran -flip vertical -trim -outfile $OUTDIR/${basename}_${samp}_vflip_jpegtran.jpg $OUTDIR/${basename}_${samp}_Q95.jpg
$EXEDIR/jpegtran -transpose -trim $OUTDIR/${basename}_${samp}_Q95.jpg >$OUTDIR/${basename}_${samp}_transpose_jpegtran.jpg runme $EXEDIR/jpegtran -transpose -trim -outfile $OUTDIR/${basename}_${samp}_transpose_jpegtran.jpg $OUTDIR/${basename}_${samp}_Q95.jpg
$EXEDIR/jpegtran -transverse -trim $OUTDIR/${basename}_${samp}_Q95.jpg >$OUTDIR/${basename}_${samp}_transverse_jpegtran.jpg runme $EXEDIR/jpegtran -transverse -trim -outfile $OUTDIR/${basename}_${samp}_transverse_jpegtran.jpg $OUTDIR/${basename}_${samp}_Q95.jpg
$EXEDIR/jpegtran -rotate 90 -trim $OUTDIR/${basename}_${samp}_Q95.jpg >$OUTDIR/${basename}_${samp}_rot90_jpegtran.jpg runme $EXEDIR/jpegtran -rotate 90 -trim -outfile $OUTDIR/${basename}_${samp}_rot90_jpegtran.jpg $OUTDIR/${basename}_${samp}_Q95.jpg
$EXEDIR/jpegtran -rotate 180 -trim $OUTDIR/${basename}_${samp}_Q95.jpg >$OUTDIR/${basename}_${samp}_rot180_jpegtran.jpg runme $EXEDIR/jpegtran -rotate 180 -trim -outfile $OUTDIR/${basename}_${samp}_rot180_jpegtran.jpg $OUTDIR/${basename}_${samp}_Q95.jpg
$EXEDIR/jpegtran -rotate 270 -trim $OUTDIR/${basename}_${samp}_Q95.jpg >$OUTDIR/${basename}_${samp}_rot270_jpegtran.jpg runme $EXEDIR/jpegtran -rotate 270 -trim -outfile $OUTDIR/${basename}_${samp}_rot270_jpegtran.jpg $OUTDIR/${basename}_${samp}_Q95.jpg
done done
for xform in hflip vflip transpose transverse rot90 rot180 rot270; do for xform in hflip vflip transpose transverse rot90 rot180 rot270; do
for samp in GRAY 444; do for samp in GRAY 444; do
$EXEDIR/djpeg -rgb $BMPARG $OUTDIR/${basename}_${samp}_${xform}_jpegtran.jpg >$OUTDIR/${basename}_${samp}_${xform}_jpegtran.${EXT} runme $EXEDIR/djpeg -rgb $BMPARG -outfile $OUTDIR/${basename}_${samp}_${xform}_jpegtran.${EXT} $OUTDIR/${basename}_${samp}_${xform}_jpegtran.jpg
runme $EXEDIR/tjbench $OUTDIR/${basename}_${samp}_Q95.jpg $BMPARG -$xform -tile -quiet -benchtime 0.01 runme $EXEDIR/tjbench $OUTDIR/${basename}_${samp}_Q95.jpg $BMPARG -$xform -tile -quiet -benchtime 0.01 -warmup 0 $YUVARG
for i in $OUTDIR/${basename}_${samp}_Q95_[0-9]*[0-9]x[0-9]*[0-9].${EXT} \ for i in $OUTDIR/${basename}_${samp}_Q95_[0-9]*[0-9]x[0-9]*[0-9].${EXT} \
$OUTDIR/${basename}_${samp}_Q95_full.${EXT}; do $OUTDIR/${basename}_${samp}_Q95_full.${EXT}; do
runme cmp $i $OUTDIR/${basename}_${samp}_${xform}_jpegtran.${EXT} runme cmp $i $OUTDIR/${basename}_${samp}_${xform}_jpegtran.${EXT}
@@ -141,8 +168,8 @@ for image in $IMAGES; do
done done
done done
for samp in 420 422; do for samp in 420 422; do
$EXEDIR/djpeg -nosmooth -rgb $BMPARG $OUTDIR/${basename}_${samp}_${xform}_jpegtran.jpg >$OUTDIR/${basename}_${samp}_${xform}_jpegtran.${EXT} runme $EXEDIR/djpeg -nosmooth -rgb $BMPARG -outfile $OUTDIR/${basename}_${samp}_${xform}_jpegtran.${EXT} $OUTDIR/${basename}_${samp}_${xform}_jpegtran.jpg
runme $EXEDIR/tjbench $OUTDIR/${basename}_${samp}_Q95.jpg $BMPARG -$xform -tile -quiet -benchtime 0.01 -fastupsample runme $EXEDIR/tjbench $OUTDIR/${basename}_${samp}_Q95.jpg $BMPARG -$xform -tile -quiet -benchtime 0.01 -warmup 0 -fastupsample $YUVARG
for i in $OUTDIR/${basename}_${samp}_Q95_[0-9]*[0-9]x[0-9]*[0-9].${EXT} \ for i in $OUTDIR/${basename}_${samp}_Q95_[0-9]*[0-9]x[0-9]*[0-9].${EXT} \
$OUTDIR/${basename}_${samp}_Q95_full.${EXT}; do $OUTDIR/${basename}_${samp}_Q95_full.${EXT}; do
runme cmp $i $OUTDIR/${basename}_${samp}_${xform}_jpegtran.${EXT} runme cmp $i $OUTDIR/${basename}_${samp}_${xform}_jpegtran.${EXT}
@@ -154,7 +181,7 @@ for image in $IMAGES; do
# Grayscale transform # Grayscale transform
for xform in hflip vflip transpose transverse rot90 rot180 rot270; do for xform in hflip vflip transpose transverse rot90 rot180 rot270; do
for samp in GRAY 444 422 420; do for samp in GRAY 444 422 420; do
runme $EXEDIR/tjbench $OUTDIR/${basename}_${samp}_Q95.jpg $BMPARG -$xform -tile -quiet -benchtime 0.01 -grayscale runme $EXEDIR/tjbench $OUTDIR/${basename}_${samp}_Q95.jpg $BMPARG -$xform -tile -quiet -benchtime 0.01 -warmup 0 -grayscale $YUVARG
for i in $OUTDIR/${basename}_${samp}_Q95_[0-9]*[0-9]x[0-9]*[0-9].${EXT} \ for i in $OUTDIR/${basename}_${samp}_Q95_[0-9]*[0-9]x[0-9]*[0-9].${EXT} \
$OUTDIR/${basename}_${samp}_Q95_full.${EXT}; do $OUTDIR/${basename}_${samp}_Q95_full.${EXT}; do
runme cmp $i $OUTDIR/${basename}_GRAY_${xform}_jpegtran.${EXT} runme cmp $i $OUTDIR/${basename}_GRAY_${xform}_jpegtran.${EXT}
@@ -168,8 +195,8 @@ for image in $IMAGES; do
for samp in GRAY 444 422 420; do for samp in GRAY 444 422 420; do
for scale in 2_1 15_8 7_4 13_8 3_2 11_8 5_4 9_8 7_8 3_4 5_8 1_2 3_8 1_4 1_8; do for scale in 2_1 15_8 7_4 13_8 3_2 11_8 5_4 9_8 7_8 3_4 5_8 1_2 3_8 1_4 1_8; do
scalearg=`echo $scale | sed s@_@/@g` scalearg=`echo $scale | sed s@_@/@g`
$EXEDIR/djpeg -rgb -scale ${scalearg} $BMPARG $OUTDIR/${basename}_${samp}_${xform}_jpegtran.jpg >$OUTDIR/${basename}_${samp}_${xform}_${scale}_jpegtran.${EXT} runme $EXEDIR/djpeg -rgb -scale ${scalearg} $NSARG $BMPARG -outfile $OUTDIR/${basename}_${samp}_${xform}_${scale}_jpegtran.${EXT} $OUTDIR/${basename}_${samp}_${xform}_jpegtran.jpg
runme $EXEDIR/tjbench $OUTDIR/${basename}_${samp}_Q95.jpg $BMPARG -$xform -scale ${scalearg} -quiet -benchtime 0.01 runme $EXEDIR/tjbench $OUTDIR/${basename}_${samp}_Q95.jpg $BMPARG -$xform -scale ${scalearg} -quiet -benchtime 0.01 -warmup 0 $YUVARG
runme cmp $OUTDIR/${basename}_${samp}_Q95_${scale}.${EXT} $OUTDIR/${basename}_${samp}_${xform}_${scale}_jpegtran.${EXT} runme cmp $OUTDIR/${basename}_${samp}_Q95_${scale}.${EXT} $OUTDIR/${basename}_${samp}_${xform}_${scale}_jpegtran.${EXT}
rm $OUTDIR/${basename}_${samp}_Q95_${scale}.${EXT} rm $OUTDIR/${basename}_${samp}_Q95_${scale}.${EXT}
done done

View File

@@ -24,6 +24,9 @@ IMGDIR=@srcdir@/testimages
OUTDIR=__tjbenchtest_java_output OUTDIR=__tjbenchtest_java_output
EXEDIR=. EXEDIR=.
JAVA="@JAVA@ -cp java/turbojpeg.jar -Djava.library.path=.libs" JAVA="@JAVA@ -cp java/turbojpeg.jar -Djava.library.path=.libs"
BMPARG=
NSARG=
YUVARG=
if [ -d $OUTDIR ]; then if [ -d $OUTDIR ]; then
rm -rf $OUTDIR rm -rf $OUTDIR
@@ -32,33 +35,58 @@ mkdir -p $OUTDIR
exec >$EXEDIR/tjbenchtest-java.log exec >$EXEDIR/tjbenchtest-java.log
if [ $# -gt 0 ]; then
if [ "$1" = "-yuv" ]; then
NSARG=-nosmooth
YUVARG=-yuv
# NOTE: The combination of tjEncodeYUV*() and tjCompressFromYUV*() does not
# always produce bitwise-identical results to tjCompress*() if subsampling is
# enabled. In both cases, if the image width or height are not evenly
# divisible by the MCU width/height, then the bottom and/or right edge are
# expanded. However, the libjpeg code performs this expansion prior to
# downsampling, and TurboJPEG performs it in tjCompressFromYUV*(), which is
# after downsampling. Thus, the two will agree only if the width/height along
# each downsampled dimension is an odd number or is evenly divisible by the MCU
# width/height. This disagreement basically amounts to a round-off error, but
# there is no easy way around it, so for now, we just test the only image that
# works. (NOTE: nightshot_iso_100 does not suffer from the above issue, but
# it suffers from an unrelated problem whereby the combination of
# tjDecompressToYUV*() and tjDecodeYUV*() do not produce bitwise-identical
# results to tjDecompress*() if decompression scaling is enabled. This latter
# phenomenon is not yet fully understood but is also believed to be some sort
# of round-off error.)
IMAGES="vgl_6548_0026a.bmp"
fi
fi
# Standard tests # Standard tests
for image in $IMAGES; do for image in $IMAGES; do
cp $IMGDIR/$image $OUTDIR cp $IMGDIR/$image $OUTDIR
basename=`basename $image .bmp` basename=`basename $image .bmp`
$EXEDIR/cjpeg -quality 95 -dct fast -grayscale $IMGDIR/${basename}.bmp >$OUTDIR/${basename}_GRAY_fast_cjpeg.jpg runme $EXEDIR/cjpeg -quality 95 -dct fast -grayscale -outfile $OUTDIR/${basename}_GRAY_fast_cjpeg.jpg $IMGDIR/${basename}.bmp
$EXEDIR/cjpeg -quality 95 -dct fast -sample 2x2 $IMGDIR/${basename}.bmp >$OUTDIR/${basename}_420_fast_cjpeg.jpg runme $EXEDIR/cjpeg -quality 95 -dct fast -sample 2x2 -outfile $OUTDIR/${basename}_420_fast_cjpeg.jpg $IMGDIR/${basename}.bmp
$EXEDIR/cjpeg -quality 95 -dct fast -sample 2x1 $IMGDIR/${basename}.bmp >$OUTDIR/${basename}_422_fast_cjpeg.jpg runme $EXEDIR/cjpeg -quality 95 -dct fast -sample 2x1 -outfile $OUTDIR/${basename}_422_fast_cjpeg.jpg $IMGDIR/${basename}.bmp
$EXEDIR/cjpeg -quality 95 -dct fast -sample 1x1 $IMGDIR/${basename}.bmp >$OUTDIR/${basename}_444_fast_cjpeg.jpg runme $EXEDIR/cjpeg -quality 95 -dct fast -sample 1x1 -outfile $OUTDIR/${basename}_444_fast_cjpeg.jpg $IMGDIR/${basename}.bmp
$EXEDIR/cjpeg -quality 95 -dct int -grayscale $IMGDIR/${basename}.bmp >$OUTDIR/${basename}_GRAY_accurate_cjpeg.jpg runme $EXEDIR/cjpeg -quality 95 -dct int -grayscale -outfile $OUTDIR/${basename}_GRAY_accurate_cjpeg.jpg $IMGDIR/${basename}.bmp
$EXEDIR/cjpeg -quality 95 -dct int -sample 2x2 $IMGDIR/${basename}.bmp >$OUTDIR/${basename}_420_accurate_cjpeg.jpg runme $EXEDIR/cjpeg -quality 95 -dct int -sample 2x2 -outfile $OUTDIR/${basename}_420_accurate_cjpeg.jpg $IMGDIR/${basename}.bmp
$EXEDIR/cjpeg -quality 95 -dct int -sample 2x1 $IMGDIR/${basename}.bmp >$OUTDIR/${basename}_422_accurate_cjpeg.jpg runme $EXEDIR/cjpeg -quality 95 -dct int -sample 2x1 -outfile $OUTDIR/${basename}_422_accurate_cjpeg.jpg $IMGDIR/${basename}.bmp
$EXEDIR/cjpeg -quality 95 -dct int -sample 1x1 $IMGDIR/${basename}.bmp >$OUTDIR/${basename}_444_accurate_cjpeg.jpg runme $EXEDIR/cjpeg -quality 95 -dct int -sample 1x1 -outfile $OUTDIR/${basename}_444_accurate_cjpeg.jpg $IMGDIR/${basename}.bmp
for samp in GRAY 420 422 444; do for samp in GRAY 420 422 444; do
$EXEDIR/djpeg -rgb -bmp $OUTDIR/${basename}_${samp}_fast_cjpeg.jpg >$OUTDIR/${basename}_${samp}_default_djpeg.bmp runme $EXEDIR/djpeg -rgb -bmp -outfile $OUTDIR/${basename}_${samp}_default_djpeg.bmp $OUTDIR/${basename}_${samp}_fast_cjpeg.jpg
$EXEDIR/djpeg -dct fast -rgb -bmp $OUTDIR/${basename}_${samp}_fast_cjpeg.jpg >$OUTDIR/${basename}_${samp}_fast_djpeg.bmp runme $EXEDIR/djpeg -dct fast -rgb -bmp -outfile $OUTDIR/${basename}_${samp}_fast_djpeg.bmp $OUTDIR/${basename}_${samp}_fast_cjpeg.jpg
$EXEDIR/djpeg -dct int -rgb -bmp $OUTDIR/${basename}_${samp}_accurate_cjpeg.jpg >$OUTDIR/${basename}_${samp}_accurate_djpeg.bmp runme $EXEDIR/djpeg -dct int -rgb -bmp -outfile $OUTDIR/${basename}_${samp}_accurate_djpeg.bmp $OUTDIR/${basename}_${samp}_accurate_cjpeg.jpg
done done
for samp in 420 422; do for samp in 420 422; do
$EXEDIR/djpeg -nosmooth -bmp $OUTDIR/${basename}_${samp}_fast_cjpeg.jpg >$OUTDIR/${basename}_${samp}_default_nosmooth_djpeg.bmp runme $EXEDIR/djpeg -nosmooth -bmp -outfile $OUTDIR/${basename}_${samp}_default_nosmooth_djpeg.bmp $OUTDIR/${basename}_${samp}_fast_cjpeg.jpg
$EXEDIR/djpeg -dct fast -nosmooth -bmp $OUTDIR/${basename}_${samp}_fast_cjpeg.jpg >$OUTDIR/${basename}_${samp}_fast_nosmooth_djpeg.bmp runme $EXEDIR/djpeg -dct fast -nosmooth -bmp -outfile $OUTDIR/${basename}_${samp}_fast_nosmooth_djpeg.bmp $OUTDIR/${basename}_${samp}_fast_cjpeg.jpg
$EXEDIR/djpeg -dct int -nosmooth -bmp $OUTDIR/${basename}_${samp}_accurate_cjpeg.jpg >$OUTDIR/${basename}_${samp}_accurate_nosmooth_djpeg.bmp runme $EXEDIR/djpeg -dct int -nosmooth -bmp -outfile $OUTDIR/${basename}_${samp}_accurate_nosmooth_djpeg.bmp $OUTDIR/${basename}_${samp}_accurate_cjpeg.jpg
done done
# Compression # Compression
for dct in accurate fast; do for dct in accurate fast; do
runme $JAVA TJBench $OUTDIR/$image 95 -rgb -quiet -benchtime 0.01 -${dct}dct runme $JAVA TJBench $OUTDIR/$image 95 -rgb -quiet -benchtime 0.01 -warmup 0 -${dct}dct $YUVARG
for samp in GRAY 420 422 444; do for samp in GRAY 420 422 444; do
runme cmp $OUTDIR/${basename}_${samp}_Q95.jpg $OUTDIR/${basename}_${samp}_${dct}_cjpeg.jpg runme cmp $OUTDIR/${basename}_${samp}_Q95.jpg $OUTDIR/${basename}_${samp}_${dct}_cjpeg.jpg
done done
@@ -71,7 +99,7 @@ for image in $IMAGES; do
fi fi
# Tiled compression & decompression # Tiled compression & decompression
runme $JAVA TJBench $OUTDIR/$image 95 -rgb -tile -quiet -benchtime 0.01 ${dctarg} runme $JAVA TJBench $OUTDIR/$image 95 -rgb -tile -quiet -benchtime 0.01 -warmup 0 ${dctarg} $YUVARG
for samp in GRAY 444; do for samp in GRAY 444; do
for i in $OUTDIR/${basename}_${samp}_Q95_[0-9]*[0-9]x[0-9]*[0-9].bmp \ for i in $OUTDIR/${basename}_${samp}_Q95_[0-9]*[0-9]x[0-9]*[0-9].bmp \
$OUTDIR/${basename}_${samp}_Q95_full.bmp; do $OUTDIR/${basename}_${samp}_Q95_full.bmp; do
@@ -79,7 +107,7 @@ for image in $IMAGES; do
rm $i rm $i
done done
done done
runme $JAVA TJBench $OUTDIR/$image 95 -rgb -tile -quiet -benchtime 0.01 -fastupsample ${dctarg} runme $JAVA TJBench $OUTDIR/$image 95 -rgb -tile -quiet -benchtime 0.01 -warmup 0 -fastupsample ${dctarg} $YUVARG
for samp in 420 422; do for samp in 420 422; do
for i in $OUTDIR/${basename}_${samp}_Q95_[0-9]*[0-9]x[0-9]*[0-9].bmp \ for i in $OUTDIR/${basename}_${samp}_Q95_[0-9]*[0-9]x[0-9]*[0-9].bmp \
$OUTDIR/${basename}_${samp}_Q95_full.bmp; do $OUTDIR/${basename}_${samp}_Q95_full.bmp; do
@@ -90,7 +118,7 @@ for image in $IMAGES; do
# Tiled decompression # Tiled decompression
for samp in GRAY 444; do for samp in GRAY 444; do
runme $JAVA TJBench $OUTDIR/${basename}_${samp}_Q95.jpg -tile -quiet -benchtime 0.01 ${dctarg} runme $JAVA TJBench $OUTDIR/${basename}_${samp}_Q95.jpg -tile -quiet -benchtime 0.01 -warmup 0 ${dctarg} $YUVARG
for i in $OUTDIR/${basename}_${samp}_Q95_[0-9]*[0-9]x[0-9]*[0-9].bmp \ for i in $OUTDIR/${basename}_${samp}_Q95_[0-9]*[0-9]x[0-9]*[0-9].bmp \
$OUTDIR/${basename}_${samp}_Q95_full.bmp; do $OUTDIR/${basename}_${samp}_Q95_full.bmp; do
runme cmp -i 54:54 $i $OUTDIR/${basename}_${samp}_${dct}_djpeg.bmp runme cmp -i 54:54 $i $OUTDIR/${basename}_${samp}_${dct}_djpeg.bmp
@@ -98,7 +126,7 @@ for image in $IMAGES; do
done done
done done
for samp in 420 422; do for samp in 420 422; do
runme $JAVA TJBench $OUTDIR/${basename}_${samp}_Q95.jpg -tile -quiet -benchtime 0.01 -fastupsample ${dctarg} runme $JAVA TJBench $OUTDIR/${basename}_${samp}_Q95.jpg -tile -quiet -benchtime 0.01 -warmup 0 -fastupsample ${dctarg} $YUVARG
for i in $OUTDIR/${basename}_${samp}_Q95_[0-9]*[0-9]x[0-9]*[0-9].bmp \ for i in $OUTDIR/${basename}_${samp}_Q95_[0-9]*[0-9]x[0-9]*[0-9].bmp \
$OUTDIR/${basename}_${samp}_Q95_full.bmp; do $OUTDIR/${basename}_${samp}_Q95_full.bmp; do
runme cmp $i -i 54:54 $OUTDIR/${basename}_${samp}_${dct}_nosmooth_djpeg.bmp runme cmp $i -i 54:54 $OUTDIR/${basename}_${samp}_${dct}_nosmooth_djpeg.bmp
@@ -111,8 +139,8 @@ for image in $IMAGES; do
for scale in 2_1 15_8 7_4 13_8 3_2 11_8 5_4 9_8 7_8 3_4 5_8 1_2 3_8 1_4 1_8; do for scale in 2_1 15_8 7_4 13_8 3_2 11_8 5_4 9_8 7_8 3_4 5_8 1_2 3_8 1_4 1_8; do
scalearg=`echo $scale | sed s@_@/@g` scalearg=`echo $scale | sed s@_@/@g`
for samp in GRAY 420 422 444; do for samp in GRAY 420 422 444; do
$EXEDIR/djpeg -rgb -scale ${scalearg} -bmp $OUTDIR/${basename}_${samp}_fast_cjpeg.jpg >$OUTDIR/${basename}_${samp}_${scale}_djpeg.bmp runme $EXEDIR/djpeg -rgb -scale ${scalearg} $NSARG -bmp -outfile $OUTDIR/${basename}_${samp}_${scale}_djpeg.bmp $OUTDIR/${basename}_${samp}_fast_cjpeg.jpg
runme $JAVA TJBench $OUTDIR/${basename}_${samp}_Q95.jpg -scale ${scalearg} -quiet -benchtime 0.01 runme $JAVA TJBench $OUTDIR/${basename}_${samp}_Q95.jpg -scale ${scalearg} -quiet -benchtime 0.01 -warmup 0 $YUVARG
runme cmp -i 54:54 $OUTDIR/${basename}_${samp}_Q95_${scale}.bmp $OUTDIR/${basename}_${samp}_${scale}_djpeg.bmp runme cmp -i 54:54 $OUTDIR/${basename}_${samp}_Q95_${scale}.bmp $OUTDIR/${basename}_${samp}_${scale}_djpeg.bmp
rm $OUTDIR/${basename}_${samp}_Q95_${scale}.bmp rm $OUTDIR/${basename}_${samp}_Q95_${scale}.bmp
done done
@@ -120,18 +148,18 @@ for image in $IMAGES; do
# Transforms # Transforms
for samp in GRAY 420 422 444; do for samp in GRAY 420 422 444; do
$EXEDIR/jpegtran -flip horizontal -trim $OUTDIR/${basename}_${samp}_Q95.jpg >$OUTDIR/${basename}_${samp}_hflip_jpegtran.jpg runme $EXEDIR/jpegtran -flip horizontal -trim -outfile $OUTDIR/${basename}_${samp}_hflip_jpegtran.jpg $OUTDIR/${basename}_${samp}_Q95.jpg
$EXEDIR/jpegtran -flip vertical -trim $OUTDIR/${basename}_${samp}_Q95.jpg >$OUTDIR/${basename}_${samp}_vflip_jpegtran.jpg runme $EXEDIR/jpegtran -flip vertical -trim -outfile $OUTDIR/${basename}_${samp}_vflip_jpegtran.jpg $OUTDIR/${basename}_${samp}_Q95.jpg
$EXEDIR/jpegtran -transpose -trim $OUTDIR/${basename}_${samp}_Q95.jpg >$OUTDIR/${basename}_${samp}_transpose_jpegtran.jpg runme $EXEDIR/jpegtran -transpose -trim -outfile $OUTDIR/${basename}_${samp}_transpose_jpegtran.jpg $OUTDIR/${basename}_${samp}_Q95.jpg
$EXEDIR/jpegtran -transverse -trim $OUTDIR/${basename}_${samp}_Q95.jpg >$OUTDIR/${basename}_${samp}_transverse_jpegtran.jpg runme $EXEDIR/jpegtran -transverse -trim -outfile $OUTDIR/${basename}_${samp}_transverse_jpegtran.jpg $OUTDIR/${basename}_${samp}_Q95.jpg
$EXEDIR/jpegtran -rotate 90 -trim $OUTDIR/${basename}_${samp}_Q95.jpg >$OUTDIR/${basename}_${samp}_rot90_jpegtran.jpg runme $EXEDIR/jpegtran -rotate 90 -trim -outfile $OUTDIR/${basename}_${samp}_rot90_jpegtran.jpg $OUTDIR/${basename}_${samp}_Q95.jpg
$EXEDIR/jpegtran -rotate 180 -trim $OUTDIR/${basename}_${samp}_Q95.jpg >$OUTDIR/${basename}_${samp}_rot180_jpegtran.jpg runme $EXEDIR/jpegtran -rotate 180 -trim -outfile $OUTDIR/${basename}_${samp}_rot180_jpegtran.jpg $OUTDIR/${basename}_${samp}_Q95.jpg
$EXEDIR/jpegtran -rotate 270 -trim $OUTDIR/${basename}_${samp}_Q95.jpg >$OUTDIR/${basename}_${samp}_rot270_jpegtran.jpg runme $EXEDIR/jpegtran -rotate 270 -trim -outfile $OUTDIR/${basename}_${samp}_rot270_jpegtran.jpg $OUTDIR/${basename}_${samp}_Q95.jpg
done done
for xform in hflip vflip transpose transverse rot90 rot180 rot270; do for xform in hflip vflip transpose transverse rot90 rot180 rot270; do
for samp in GRAY 444; do for samp in GRAY 444; do
$EXEDIR/djpeg -rgb -bmp $OUTDIR/${basename}_${samp}_${xform}_jpegtran.jpg >$OUTDIR/${basename}_${samp}_${xform}_jpegtran.bmp runme $EXEDIR/djpeg -rgb -bmp -outfile $OUTDIR/${basename}_${samp}_${xform}_jpegtran.bmp $OUTDIR/${basename}_${samp}_${xform}_jpegtran.jpg
runme $JAVA TJBench $OUTDIR/${basename}_${samp}_Q95.jpg -$xform -tile -quiet -benchtime 0.01 runme $JAVA TJBench $OUTDIR/${basename}_${samp}_Q95.jpg -$xform -tile -quiet -benchtime 0.01 -warmup 0 $YUVARG
for i in $OUTDIR/${basename}_${samp}_Q95_[0-9]*[0-9]x[0-9]*[0-9].bmp \ for i in $OUTDIR/${basename}_${samp}_Q95_[0-9]*[0-9]x[0-9]*[0-9].bmp \
$OUTDIR/${basename}_${samp}_Q95_full.bmp; do $OUTDIR/${basename}_${samp}_Q95_full.bmp; do
runme cmp -i 54:54 $i $OUTDIR/${basename}_${samp}_${xform}_jpegtran.bmp runme cmp -i 54:54 $i $OUTDIR/${basename}_${samp}_${xform}_jpegtran.bmp
@@ -139,8 +167,8 @@ for image in $IMAGES; do
done done
done done
for samp in 420 422; do for samp in 420 422; do
$EXEDIR/djpeg -nosmooth -rgb -bmp $OUTDIR/${basename}_${samp}_${xform}_jpegtran.jpg >$OUTDIR/${basename}_${samp}_${xform}_jpegtran.bmp runme $EXEDIR/djpeg -nosmooth -rgb -bmp -outfile $OUTDIR/${basename}_${samp}_${xform}_jpegtran.bmp $OUTDIR/${basename}_${samp}_${xform}_jpegtran.jpg
runme $JAVA TJBench $OUTDIR/${basename}_${samp}_Q95.jpg -$xform -tile -quiet -benchtime 0.01 -fastupsample runme $JAVA TJBench $OUTDIR/${basename}_${samp}_Q95.jpg -$xform -tile -quiet -benchtime 0.01 -warmup 0 -fastupsample $YUVARG
for i in $OUTDIR/${basename}_${samp}_Q95_[0-9]*[0-9]x[0-9]*[0-9].bmp \ for i in $OUTDIR/${basename}_${samp}_Q95_[0-9]*[0-9]x[0-9]*[0-9].bmp \
$OUTDIR/${basename}_${samp}_Q95_full.bmp; do $OUTDIR/${basename}_${samp}_Q95_full.bmp; do
runme cmp -i 54:54 $i $OUTDIR/${basename}_${samp}_${xform}_jpegtran.bmp runme cmp -i 54:54 $i $OUTDIR/${basename}_${samp}_${xform}_jpegtran.bmp
@@ -152,7 +180,7 @@ for image in $IMAGES; do
# Grayscale transform # Grayscale transform
for xform in hflip vflip transpose transverse rot90 rot180 rot270; do for xform in hflip vflip transpose transverse rot90 rot180 rot270; do
for samp in GRAY 444 422 420; do for samp in GRAY 444 422 420; do
runme $JAVA TJBench $OUTDIR/${basename}_${samp}_Q95.jpg -$xform -tile -quiet -benchtime 0.01 -grayscale runme $JAVA TJBench $OUTDIR/${basename}_${samp}_Q95.jpg -$xform -tile -quiet -benchtime 0.01 -warmup 0 -grayscale $YUVARG
for i in $OUTDIR/${basename}_${samp}_Q95_[0-9]*[0-9]x[0-9]*[0-9].bmp \ for i in $OUTDIR/${basename}_${samp}_Q95_[0-9]*[0-9]x[0-9]*[0-9].bmp \
$OUTDIR/${basename}_${samp}_Q95_full.bmp; do $OUTDIR/${basename}_${samp}_Q95_full.bmp; do
runme cmp -i 54:54 $i $OUTDIR/${basename}_GRAY_${xform}_jpegtran.bmp runme cmp -i 54:54 $i $OUTDIR/${basename}_GRAY_${xform}_jpegtran.bmp
@@ -166,8 +194,8 @@ for image in $IMAGES; do
for samp in GRAY 444 422 420; do for samp in GRAY 444 422 420; do
for scale in 2_1 15_8 7_4 13_8 3_2 11_8 5_4 9_8 7_8 3_4 5_8 1_2 3_8 1_4 1_8; do for scale in 2_1 15_8 7_4 13_8 3_2 11_8 5_4 9_8 7_8 3_4 5_8 1_2 3_8 1_4 1_8; do
scalearg=`echo $scale | sed s@_@/@g` scalearg=`echo $scale | sed s@_@/@g`
$EXEDIR/djpeg -rgb -scale ${scalearg} -bmp $OUTDIR/${basename}_${samp}_${xform}_jpegtran.jpg >$OUTDIR/${basename}_${samp}_${xform}_${scale}_jpegtran.bmp runme $EXEDIR/djpeg -rgb -scale ${scalearg} $NSARG -bmp -outfile $OUTDIR/${basename}_${samp}_${xform}_${scale}_jpegtran.bmp $OUTDIR/${basename}_${samp}_${xform}_jpegtran.jpg
runme $JAVA TJBench $OUTDIR/${basename}_${samp}_Q95.jpg -$xform -scale ${scalearg} -quiet -benchtime 0.01 runme $JAVA TJBench $OUTDIR/${basename}_${samp}_Q95.jpg -$xform -scale ${scalearg} -quiet -benchtime 0.01 -warmup 0 $YUVARG
runme cmp -i 54:54 $OUTDIR/${basename}_${samp}_Q95_${scale}.bmp $OUTDIR/${basename}_${samp}_${xform}_${scale}_jpegtran.bmp runme cmp -i 54:54 $OUTDIR/${basename}_${samp}_Q95_${scale}.bmp $OUTDIR/${basename}_${samp}_${xform}_${scale}_jpegtran.bmp
rm $OUTDIR/${basename}_${samp}_Q95_${scale}.bmp rm $OUTDIR/${basename}_${samp}_Q95_${scale}.bmp
done done

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C)2009-2013 D. R. Commander. All Rights Reserved. * Copyright (C)2009-2014 D. R. Commander. All Rights Reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are met:
@@ -79,8 +79,7 @@ const int _4byteFormats[]={TJPF_RGBX, TJPF_BGRX, TJPF_XBGR, TJPF_XRGB,
const int _onlyGray[]={TJPF_GRAY}; const int _onlyGray[]={TJPF_GRAY};
const int _onlyRGB[]={TJPF_RGB}; const int _onlyRGB[]={TJPF_RGB};
enum {YUVENCODE=1, YUVDECODE}; int doyuv=0, alloc=0, pad=4;
int yuv=0, alloc=0, pad=4;
int exitStatus=0; int exitStatus=0;
#define bailout() {exitStatus=-1; goto bailout;} #define bailout() {exitStatus=-1; goto bailout;}
@@ -295,60 +294,6 @@ int checkBuf(unsigned char *buf, int w, int h, int pf, int subsamp,
#define PAD(v, p) ((v+(p)-1)&(~((p)-1))) #define PAD(v, p) ((v+(p)-1)&(~((p)-1)))
void initBufYUV(unsigned char *buf, int w, int pad, int h, int subsamp)
{
int row, col;
int hsf=tjMCUWidth[subsamp]/8, vsf=tjMCUHeight[subsamp]/8;
int pw=PAD(w, hsf), ph=PAD(h, vsf);
int cw=pw/hsf, ch=ph/vsf;
int ypitch=PAD(pw, pad), uvpitch=PAD(cw, pad);
int halfway=16, blocksize=8;
memset(buf, 0, tjBufSizeYUV2(w, pad, h, subsamp));
for(row=0; row<ph; row++)
{
for(col=0; col<pw; col++)
{
unsigned char *y=&buf[ypitch*row+col];
if(((row/blocksize)+(col/blocksize))%2==0)
{
if(row<halfway) *y=255; else *y=0;
}
else
{
if(row<halfway) *y=76; else *y=226;
}
}
}
if(subsamp!=TJSAMP_GRAY)
{
halfway=16/vsf;
for(row=0; row<ch; row++)
{
for(col=0; col<cw; col++)
{
unsigned char *u=&buf[ypitch*ph + (uvpitch*row+col)],
*v=&buf[ypitch*ph + uvpitch*ch + (uvpitch*row+col)];
if(((row*vsf/blocksize)+(col*hsf/blocksize))%2==0)
*u=*v=128;
else
{
if(row<halfway)
{
*u=85; *v=255;
}
else
{
*u=0; *v=149;
}
}
}
}
}
}
int checkBufYUV(unsigned char *buf, int w, int h, int subsamp, int checkBufYUV(unsigned char *buf, int w, int h, int subsamp,
tjscalingfactor sf) tjscalingfactor sf)
{ {
@@ -451,74 +396,57 @@ void compTest(tjhandle handle, unsigned char **dstBuf,
unsigned long *dstSize, int w, int h, int pf, char *basename, unsigned long *dstSize, int w, int h, int pf, char *basename,
int subsamp, int jpegQual, int flags) int subsamp, int jpegQual, int flags)
{ {
char tempStr[1024]; unsigned char *srcBuf=NULL; char tempStr[1024]; unsigned char *srcBuf=NULL, *yuvBuf=NULL;
const char *pfStr=(yuv==YUVDECODE)? "YUV":pixFormatStr[pf]; const char *pfStr=pixFormatStr[pf];
const char *buStrLong=(flags&TJFLAG_BOTTOMUP)? "Bottom-Up":"Top-Down "; const char *buStrLong=(flags&TJFLAG_BOTTOMUP)? "Bottom-Up":"Top-Down ";
const char *buStr=(flags&TJFLAG_BOTTOMUP)? "BU":"TD"; const char *buStr=(flags&TJFLAG_BOTTOMUP)? "BU":"TD";
double t;
if(yuv==YUVDECODE)
{
printf("YUV %s %s -> JPEG Q%d ... ", subNameLong[subsamp], buStrLong,
jpegQual);
if((srcBuf=(unsigned char *)malloc(tjBufSizeYUV2(w, pad, h, subsamp)))
==NULL)
_throw("Memory allocation failure");
initBufYUV(srcBuf, w, pad, h, subsamp);
}
else
{
if(yuv==YUVENCODE)
printf("%s %s -> %s YUV ... ", pfStr, buStrLong, subNameLong[subsamp]);
else
printf("%s %s -> %s Q%d ... ", pfStr, buStrLong, subNameLong[subsamp],
jpegQual);
if((srcBuf=(unsigned char *)malloc(w*h*tjPixelSize[pf]))==NULL) if((srcBuf=(unsigned char *)malloc(w*h*tjPixelSize[pf]))==NULL)
_throw("Memory allocation failure"); _throw("Memory allocation failure");
initBuf(srcBuf, w, h, pf, flags); initBuf(srcBuf, w, h, pf, flags);
}
if(*dstBuf && *dstSize>0) memset(*dstBuf, 0, *dstSize); if(*dstBuf && *dstSize>0) memset(*dstBuf, 0, *dstSize);
t=gettime();
if(yuv==YUVENCODE)
{
_tj(tjEncodeYUV3(handle, srcBuf, w, 0, h, pf, *dstBuf, pad, subsamp,
flags));
}
else
{
if(!alloc) flags|=TJFLAG_NOREALLOC; if(!alloc) flags|=TJFLAG_NOREALLOC;
if(yuv==YUVDECODE) if(doyuv)
{ {
_tj(tjCompressFromYUV(handle, srcBuf, w, pad, h, subsamp, dstBuf, unsigned long yuvSize=tjBufSizeYUV2(w, pad, h, subsamp);
tjscalingfactor sf={1, 1};
tjhandle handle2=tjInitCompress();
if(!handle2) _throwtj();
if((yuvBuf=(unsigned char *)malloc(yuvSize))==NULL)
_throw("Memory allocation failure");
memset(yuvBuf, 0, yuvSize);
printf("%s %s -> YUV %s ... ", pfStr, buStrLong, subNameLong[subsamp]);
_tj(tjEncodeYUV3(handle2, srcBuf, w, 0, h, pf, yuvBuf, pad, subsamp,
flags));
tjDestroy(handle2);
if(checkBufYUV(yuvBuf, w, h, subsamp, sf)) printf("Passed.\n");
else printf("FAILED!\n");
printf("YUV %s %s -> JPEG Q%d ... ", subNameLong[subsamp], buStrLong,
jpegQual);
_tj(tjCompressFromYUV(handle, yuvBuf, w, pad, h, subsamp, dstBuf,
dstSize, jpegQual, flags)); dstSize, jpegQual, flags));
} }
else else
{ {
printf("%s %s -> %s Q%d ... ", pfStr, buStrLong, subNameLong[subsamp],
jpegQual);
_tj(tjCompress2(handle, srcBuf, w, 0, h, pf, dstBuf, dstSize, subsamp, _tj(tjCompress2(handle, srcBuf, w, 0, h, pf, dstBuf, dstSize, subsamp,
jpegQual, flags)); jpegQual, flags));
} }
}
t=gettime()-t;
if(yuv==YUVENCODE)
snprintf(tempStr, 1024, "%s_enc_%s_%s_%s.yuv", basename, pfStr, buStr,
subName[subsamp]);
else
snprintf(tempStr, 1024, "%s_enc_%s_%s_%s_Q%d.jpg", basename, pfStr, buStr, snprintf(tempStr, 1024, "%s_enc_%s_%s_%s_Q%d.jpg", basename, pfStr, buStr,
subName[subsamp], jpegQual); subName[subsamp], jpegQual);
writeJPEG(*dstBuf, *dstSize, tempStr); writeJPEG(*dstBuf, *dstSize, tempStr);
if(yuv==YUVENCODE) printf("Done.\n Result in %s\n", tempStr);
{
tjscalingfactor sf={1, 1};
if(checkBufYUV(*dstBuf, w, h, subsamp, sf)) printf("Passed.");
else printf("FAILED!");
}
else printf("Done.");
printf(" %f ms\n Result in %s\n", t*1000., tempStr);
bailout: bailout:
if(yuvBuf) free(yuvBuf);
if(srcBuf) free(srcBuf); if(srcBuf) free(srcBuf);
} }
@@ -527,63 +455,67 @@ void _decompTest(tjhandle handle, unsigned char *jpegBuf,
unsigned long jpegSize, int w, int h, int pf, char *basename, int subsamp, unsigned long jpegSize, int w, int h, int pf, char *basename, int subsamp,
int flags, tjscalingfactor sf) int flags, tjscalingfactor sf)
{ {
unsigned char *dstBuf=NULL; unsigned char *dstBuf=NULL, *yuvBuf=NULL;
int _hdrw=0, _hdrh=0, _hdrsubsamp=-1; double t; int _hdrw=0, _hdrh=0, _hdrsubsamp=-1;
int scaledWidth=TJSCALED(w, sf); int scaledWidth=TJSCALED(w, sf);
int scaledHeight=TJSCALED(h, sf); int scaledHeight=TJSCALED(h, sf);
unsigned long dstSize=0; unsigned long dstSize=0;
if(yuv==YUVENCODE) return;
if(yuv==YUVDECODE)
printf("JPEG -> YUV %s ", subNameLong[subsamp]);
else
printf("JPEG -> %s %s ", pixFormatStr[pf],
(flags&TJFLAG_BOTTOMUP)? "Bottom-Up":"Top-Down ");
if(sf.num!=1 || sf.denom!=1)
printf("%d/%d ... ", sf.num, sf.denom);
else printf("... ");
_tj(tjDecompressHeader2(handle, jpegBuf, jpegSize, &_hdrw, &_hdrh, _tj(tjDecompressHeader2(handle, jpegBuf, jpegSize, &_hdrw, &_hdrh,
&_hdrsubsamp)); &_hdrsubsamp));
if(_hdrw!=w || _hdrh!=h || _hdrsubsamp!=subsamp) if(_hdrw!=w || _hdrh!=h || _hdrsubsamp!=subsamp)
_throw("Incorrect JPEG header"); _throw("Incorrect JPEG header");
if(yuv==YUVDECODE) dstSize=scaledWidth*scaledHeight*tjPixelSize[pf];
dstSize=tjBufSizeYUV2(scaledWidth, pad, scaledHeight, subsamp);
else dstSize=scaledWidth*scaledHeight*tjPixelSize[pf];
if((dstBuf=(unsigned char *)malloc(dstSize))==NULL) if((dstBuf=(unsigned char *)malloc(dstSize))==NULL)
_throw("Memory allocation failure"); _throw("Memory allocation failure");
memset(dstBuf, 0, dstSize); memset(dstBuf, 0, dstSize);
t=gettime(); if(doyuv)
if(yuv==YUVDECODE)
{ {
_tj(tjDecompressToYUV2(handle, jpegBuf, jpegSize, dstBuf, scaledWidth, unsigned long yuvSize=tjBufSizeYUV2(scaledWidth, pad, scaledHeight,
subsamp);
tjhandle handle2=tjInitDecompress();
if(!handle2) _throwtj();
if((yuvBuf=(unsigned char *)malloc(yuvSize))==NULL)
_throw("Memory allocation failure");
memset(yuvBuf, 0, yuvSize);
printf("JPEG -> YUV %s ", subNameLong[subsamp]);
if(sf.num!=1 || sf.denom!=1)
printf("%d/%d ... ", sf.num, sf.denom);
else printf("... ");
_tj(tjDecompressToYUV2(handle, jpegBuf, jpegSize, yuvBuf, scaledWidth,
pad, scaledHeight, flags)); pad, scaledHeight, flags));
if(checkBufYUV(yuvBuf, scaledWidth, scaledHeight, subsamp, sf))
printf("Passed.\n");
else printf("FAILED!\n");
printf("YUV %s -> %s %s ... ", subNameLong[subsamp], pixFormatStr[pf],
(flags&TJFLAG_BOTTOMUP)? "Bottom-Up":"Top-Down ");
_tj(tjDecodeYUV(handle2, yuvBuf, pad, subsamp, dstBuf, scaledWidth, 0,
scaledHeight, pf, flags));
tjDestroy(handle2);
} }
else else
{ {
printf("JPEG -> %s %s ", pixFormatStr[pf],
(flags&TJFLAG_BOTTOMUP)? "Bottom-Up":"Top-Down ");
if(sf.num!=1 || sf.denom!=1)
printf("%d/%d ... ", sf.num, sf.denom);
else printf("... ");
_tj(tjDecompress2(handle, jpegBuf, jpegSize, dstBuf, scaledWidth, 0, _tj(tjDecompress2(handle, jpegBuf, jpegSize, dstBuf, scaledWidth, 0,
scaledHeight, pf, flags)); scaledHeight, pf, flags));
} }
t=gettime()-t;
if(yuv==YUVDECODE)
{
if(checkBufYUV(dstBuf, scaledWidth, scaledHeight, subsamp, sf))
printf("Passed.");
else printf("FAILED!");
}
else
{
if(checkBuf(dstBuf, scaledWidth, scaledHeight, pf, subsamp, sf, flags)) if(checkBuf(dstBuf, scaledWidth, scaledHeight, pf, subsamp, sf, flags))
printf("Passed."); printf("Passed.");
else printf("FAILED!"); else printf("FAILED!");
} printf("\n");
printf(" %f ms\n", t*1000.);
bailout: bailout:
if(yuvBuf) free(yuvBuf);
if(dstBuf) free(dstBuf); if(dstBuf) free(dstBuf);
} }
@@ -619,9 +551,7 @@ void doTest(int w, int h, const int *formats, int nformats, int subsamp,
unsigned char *dstBuf=NULL; unsigned char *dstBuf=NULL;
unsigned long size=0; int pfi, pf, i; unsigned long size=0; int pfi, pf, i;
if(yuv==YUVENCODE) if(!alloc)
size=tjBufSizeYUV2(w, pad, h, subsamp);
else if(!alloc)
size=tjBufSize(w, h, subsamp); size=tjBufSize(w, h, subsamp);
if(size!=0) if(size!=0)
if((dstBuf=(unsigned char *)tjAlloc(size))==NULL) if((dstBuf=(unsigned char *)tjAlloc(size))==NULL)
@@ -638,19 +568,18 @@ void doTest(int w, int h, const int *formats, int nformats, int subsamp,
if(subsamp==TJSAMP_422 || subsamp==TJSAMP_420 || subsamp==TJSAMP_440 || if(subsamp==TJSAMP_422 || subsamp==TJSAMP_420 || subsamp==TJSAMP_440 ||
subsamp==TJSAMP_411) subsamp==TJSAMP_411)
flags|=TJFLAG_FASTUPSAMPLE; flags|=TJFLAG_FASTUPSAMPLE;
if(i==1) if(i==1) flags|=TJFLAG_BOTTOMUP;
{
if(yuv==YUVDECODE) goto bailout;
else flags|=TJFLAG_BOTTOMUP;
}
pf=formats[pfi]; pf=formats[pfi];
compTest(chandle, &dstBuf, &size, w, h, pf, basename, subsamp, 100, compTest(chandle, &dstBuf, &size, w, h, pf, basename, subsamp, 100,
flags); flags);
decompTest(dhandle, dstBuf, size, w, h, pf, basename, subsamp, decompTest(dhandle, dstBuf, size, w, h, pf, basename, subsamp,
flags); flags);
if(pf>=TJPF_RGBX && pf<=TJPF_XRGB) if(pf>=TJPF_RGBX && pf<=TJPF_XRGB)
{
printf("\n");
decompTest(dhandle, dstBuf, size, w, h, pf+(TJPF_RGBA-TJPF_RGBX), decompTest(dhandle, dstBuf, size, w, h, pf+(TJPF_RGBA-TJPF_RGBX),
basename, subsamp, flags); basename, subsamp, flags);
}
printf("\n"); printf("\n");
} }
} }
@@ -667,9 +596,9 @@ void doTest(int w, int h, const int *formats, int nformats, int subsamp,
void bufSizeTest(void) void bufSizeTest(void)
{ {
int w, h, i, subsamp; int w, h, i, subsamp;
unsigned char *srcBuf=NULL, *jpegBuf=NULL; unsigned char *srcBuf=NULL, *dstBuf=NULL;
tjhandle handle=NULL; tjhandle handle=NULL;
unsigned long jpegSize=0; unsigned long dstSize=0;
if((handle=tjInitCompress())==NULL) _throwtj(); if((handle=tjInitCompress())==NULL) _throwtj();
@@ -684,12 +613,12 @@ void bufSizeTest(void)
if(h%100==0) printf("%.4d x %.4d\b\b\b\b\b\b\b\b\b\b\b", w, h); if(h%100==0) printf("%.4d x %.4d\b\b\b\b\b\b\b\b\b\b\b", w, h);
if((srcBuf=(unsigned char *)malloc(w*h*4))==NULL) if((srcBuf=(unsigned char *)malloc(w*h*4))==NULL)
_throw("Memory allocation failure"); _throw("Memory allocation failure");
if(!alloc) if(!alloc || doyuv)
{ {
if((jpegBuf=(unsigned char *)tjAlloc(tjBufSize(w, h, subsamp))) if(doyuv) dstSize=tjBufSizeYUV2(w, pad, h, subsamp);
==NULL) else dstSize=tjBufSize(w, h, subsamp);
if((dstBuf=(unsigned char *)tjAlloc(dstSize))==NULL)
_throw("Memory allocation failure"); _throw("Memory allocation failure");
jpegSize=tjBufSize(w, h, subsamp);
} }
for(i=0; i<w*h*4; i++) for(i=0; i<w*h*4; i++)
@@ -698,19 +627,27 @@ void bufSizeTest(void)
else srcBuf[i]=255; else srcBuf[i]=255;
} }
_tj(tjCompress2(handle, srcBuf, w, 0, h, TJPF_BGRX, &jpegBuf, if(doyuv)
&jpegSize, subsamp, 100, alloc? 0:TJFLAG_NOREALLOC)); {
_tj(tjEncodeYUV3(handle, srcBuf, w, 0, h, TJPF_BGRX, dstBuf, pad,
subsamp, 0));
}
else
{
_tj(tjCompress2(handle, srcBuf, w, 0, h, TJPF_BGRX, &dstBuf,
&dstSize, subsamp, 100, alloc? 0:TJFLAG_NOREALLOC));
}
free(srcBuf); srcBuf=NULL; free(srcBuf); srcBuf=NULL;
tjFree(jpegBuf); jpegBuf=NULL; tjFree(dstBuf); dstBuf=NULL;
if((srcBuf=(unsigned char *)malloc(h*w*4))==NULL) if((srcBuf=(unsigned char *)malloc(h*w*4))==NULL)
_throw("Memory allocation failure"); _throw("Memory allocation failure");
if(!alloc) if(!alloc || doyuv)
{ {
if((jpegBuf=(unsigned char *)tjAlloc(tjBufSize(h, w, subsamp))) if(doyuv) dstSize=tjBufSizeYUV2(h, pad, w, subsamp);
==NULL) else dstSize=tjBufSize(h, w, subsamp);
if((dstBuf=(unsigned char *)tjAlloc(dstSize))==NULL)
_throw("Memory allocation failure"); _throw("Memory allocation failure");
jpegSize=tjBufSize(h, w, subsamp);
} }
for(i=0; i<h*w*4; i++) for(i=0; i<h*w*4; i++)
@@ -719,10 +656,18 @@ void bufSizeTest(void)
else srcBuf[i]=255; else srcBuf[i]=255;
} }
_tj(tjCompress2(handle, srcBuf, h, 0, w, TJPF_BGRX, &jpegBuf, if(doyuv)
&jpegSize, subsamp, 100, alloc? 0:TJFLAG_NOREALLOC)); {
_tj(tjEncodeYUV3(handle, srcBuf, h, 0, w, TJPF_BGRX, dstBuf, pad,
subsamp, 0));
}
else
{
_tj(tjCompress2(handle, srcBuf, h, 0, w, TJPF_BGRX, &dstBuf,
&dstSize, subsamp, 100, alloc? 0:TJFLAG_NOREALLOC));
}
free(srcBuf); srcBuf=NULL; free(srcBuf); srcBuf=NULL;
tjFree(jpegBuf); jpegBuf=NULL; tjFree(dstBuf); dstBuf=NULL;
} }
} }
} }
@@ -730,14 +675,14 @@ void bufSizeTest(void)
bailout: bailout:
if(srcBuf) free(srcBuf); if(srcBuf) free(srcBuf);
if(jpegBuf) free(jpegBuf); if(dstBuf) free(dstBuf);
if(handle) tjDestroy(handle); if(handle) tjDestroy(handle);
} }
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
int doyuv=0, i, num4bf=5; int i, num4bf=5;
#ifdef _WIN32 #ifdef _WIN32
srand((unsigned int)time(NULL)); srand((unsigned int)time(NULL));
#endif #endif
@@ -753,7 +698,7 @@ int main(int argc, char *argv[])
} }
} }
if(alloc) printf("Testing automatic buffer allocation\n"); if(alloc) printf("Testing automatic buffer allocation\n");
if(doyuv) {yuv=YUVENCODE; num4bf=4;} if(doyuv) num4bf=4;
doTest(35, 39, _3byteFormats, 2, TJSAMP_444, "test"); doTest(35, 39, _3byteFormats, 2, TJSAMP_444, "test");
doTest(39, 41, _4byteFormats, num4bf, TJSAMP_444, "test"); doTest(39, 41, _4byteFormats, num4bf, TJSAMP_444, "test");
doTest(41, 35, _3byteFormats, 2, TJSAMP_422, "test"); doTest(41, 35, _3byteFormats, 2, TJSAMP_422, "test");
@@ -767,24 +712,17 @@ int main(int argc, char *argv[])
doTest(39, 41, _onlyGray, 1, TJSAMP_GRAY, "test"); doTest(39, 41, _onlyGray, 1, TJSAMP_GRAY, "test");
doTest(41, 35, _3byteFormats, 2, TJSAMP_GRAY, "test"); doTest(41, 35, _3byteFormats, 2, TJSAMP_GRAY, "test");
doTest(35, 39, _4byteFormats, 4, TJSAMP_GRAY, "test"); doTest(35, 39, _4byteFormats, 4, TJSAMP_GRAY, "test");
if(!doyuv) bufSizeTest(); bufSizeTest();
if(doyuv) if(doyuv)
{ {
yuv=YUVDECODE; printf("\n--------------------\n\n");
doTest(48, 48, _onlyRGB, 1, TJSAMP_444, "test_yuv0"); doTest(48, 48, _onlyRGB, 1, TJSAMP_444, "test_yuv0");
doTest(35, 39, _onlyRGB, 1, TJSAMP_444, "test_yuv1");
doTest(48, 48, _onlyRGB, 1, TJSAMP_422, "test_yuv0"); doTest(48, 48, _onlyRGB, 1, TJSAMP_422, "test_yuv0");
doTest(39, 41, _onlyRGB, 1, TJSAMP_422, "test_yuv1");
doTest(48, 48, _onlyRGB, 1, TJSAMP_420, "test_yuv0"); doTest(48, 48, _onlyRGB, 1, TJSAMP_420, "test_yuv0");
doTest(41, 35, _onlyRGB, 1, TJSAMP_420, "test_yuv1");
doTest(48, 48, _onlyRGB, 1, TJSAMP_440, "test_yuv0"); doTest(48, 48, _onlyRGB, 1, TJSAMP_440, "test_yuv0");
doTest(35, 39, _onlyRGB, 1, TJSAMP_440, "test_yuv1");
doTest(48, 48, _onlyRGB, 1, TJSAMP_411, "test_yuv0"); doTest(48, 48, _onlyRGB, 1, TJSAMP_411, "test_yuv0");
doTest(39, 41, _onlyRGB, 1, TJSAMP_411, "test_yuv1");
doTest(48, 48, _onlyRGB, 1, TJSAMP_GRAY, "test_yuv0"); doTest(48, 48, _onlyRGB, 1, TJSAMP_GRAY, "test_yuv0");
doTest(41, 35, _onlyRGB, 1, TJSAMP_GRAY, "test_yuv1");
doTest(48, 48, _onlyGray, 1, TJSAMP_GRAY, "test_yuv0"); doTest(48, 48, _onlyGray, 1, TJSAMP_GRAY, "test_yuv0");
doTest(35, 39, _onlyGray, 1, TJSAMP_GRAY, "test_yuv1");
} }
return exitStatus; return exitStatus;

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C)2011-2013 D. R. Commander. All Rights Reserved. * Copyright (C)2011-2014 D. R. Commander. All Rights Reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are met:
@@ -250,12 +250,13 @@ JNIEXPORT jint JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_compressFrom
return (jint)jpegSize; return (jint)jpegSize;
} }
JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_encodeYUV___3BIIII_3BIII JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_encodeYUV___3BIIIIII_3BIII
(JNIEnv *env, jobject obj, jbyteArray src, jint width, jint pitch, (JNIEnv *env, jobject obj, jbyteArray src, jint x, jint y, jint width,
jint height, jint pf, jbyteArray dst, jint pad, jint subsamp, jint flags) jint pitch, jint height, jint pf, jbyteArray dst, jint pad, jint subsamp,
jint flags)
{ {
tjhandle handle=0; tjhandle handle=0;
jsize arraySize=0, yuvSize; jsize arraySize=0, actualPitch, yuvSize;
unsigned char *srcBuf=NULL, *dstBuf=NULL; unsigned char *srcBuf=NULL, *dstBuf=NULL;
gethandle(); gethandle();
@@ -266,7 +267,8 @@ JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_encodeYUV___
if(org_libjpegturbo_turbojpeg_TJ_NUMPF!=TJ_NUMPF) if(org_libjpegturbo_turbojpeg_TJ_NUMPF!=TJ_NUMPF)
_throw("Mismatch between Java and C API"); _throw("Mismatch between Java and C API");
arraySize=(pitch==0)? width*tjPixelSize[pf]*height:pitch*height; actualPitch=(pitch==0)? width*tjPixelSize[pf]:pitch;
arraySize=(y+height-1)*actualPitch + x+width;
if((*env)->GetArrayLength(env, src)<arraySize) if((*env)->GetArrayLength(env, src)<arraySize)
_throw("Source buffer is not large enough"); _throw("Source buffer is not large enough");
yuvSize=(jsize)tjBufSizeYUV2(width, pad, height, subsamp); yuvSize=(jsize)tjBufSizeYUV2(width, pad, height, subsamp);
@@ -278,8 +280,8 @@ JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_encodeYUV___
bailif0(srcBuf=(*env)->GetPrimitiveArrayCritical(env, src, 0)); bailif0(srcBuf=(*env)->GetPrimitiveArrayCritical(env, src, 0));
bailif0(dstBuf=(*env)->GetPrimitiveArrayCritical(env, dst, 0)); bailif0(dstBuf=(*env)->GetPrimitiveArrayCritical(env, dst, 0));
if(tjEncodeYUV3(handle, srcBuf, width, pitch, height, pf, dstBuf, pad, if(tjEncodeYUV3(handle, &srcBuf[y*actualPitch + x*tjPixelSize[pf]], width,
subsamp, flags)==-1) pitch, height, pf, dstBuf, pad, subsamp, flags)==-1)
{ {
(*env)->ReleasePrimitiveArrayCritical(env, dst, dstBuf, 0); (*env)->ReleasePrimitiveArrayCritical(env, dst, dstBuf, 0);
(*env)->ReleasePrimitiveArrayCritical(env, src, srcBuf, 0); (*env)->ReleasePrimitiveArrayCritical(env, src, srcBuf, 0);
@@ -297,16 +299,17 @@ JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_encodeYUV___
(JNIEnv *env, jobject obj, jbyteArray src, jint width, jint pitch, (JNIEnv *env, jobject obj, jbyteArray src, jint width, jint pitch,
jint height, jint pf, jbyteArray dst, jint subsamp, jint flags) jint height, jint pf, jbyteArray dst, jint subsamp, jint flags)
{ {
Java_org_libjpegturbo_turbojpeg_TJCompressor_encodeYUV___3BIIII_3BIII( Java_org_libjpegturbo_turbojpeg_TJCompressor_encodeYUV___3BIIIIII_3BIII(
env, obj, src, width, pitch, height, pf, dst, 4, subsamp, flags); env, obj, src, 0, 0, width, pitch, height, pf, dst, 4, subsamp, flags);
} }
JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_encodeYUV___3IIIII_3BIII JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_encodeYUV___3IIIIIII_3BIII
(JNIEnv *env, jobject obj, jintArray src, jint width, jint stride, (JNIEnv *env, jobject obj, jintArray src, jint x, jint y, jint width,
jint height, jint pf, jbyteArray dst, jint pad, jint subsamp, jint flags) jint stride, jint height, jint pf, jbyteArray dst, jint pad, jint subsamp,
jint flags)
{ {
tjhandle handle=0; tjhandle handle=0;
jsize arraySize=0, yuvSize; jsize arraySize=0, actualStride, yuvSize;
unsigned char *srcBuf=NULL, *dstBuf=NULL; unsigned char *srcBuf=NULL, *dstBuf=NULL;
gethandle(); gethandle();
@@ -319,7 +322,8 @@ JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_encodeYUV___
if(tjPixelSize[pf]!=sizeof(jint)) if(tjPixelSize[pf]!=sizeof(jint))
_throw("Pixel format must be 32-bit when encoding from an integer buffer."); _throw("Pixel format must be 32-bit when encoding from an integer buffer.");
arraySize=(stride==0)? width*height:stride*height; actualStride=(stride==0)? width:stride;
arraySize=(y+height-1)*actualStride + x+width;
if((*env)->GetArrayLength(env, src)<arraySize) if((*env)->GetArrayLength(env, src)<arraySize)
_throw("Source buffer is not large enough"); _throw("Source buffer is not large enough");
yuvSize=(jsize)tjBufSizeYUV2(width, pad, height, subsamp); yuvSize=(jsize)tjBufSizeYUV2(width, pad, height, subsamp);
@@ -331,8 +335,8 @@ JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_encodeYUV___
bailif0(srcBuf=(*env)->GetPrimitiveArrayCritical(env, src, 0)); bailif0(srcBuf=(*env)->GetPrimitiveArrayCritical(env, src, 0));
bailif0(dstBuf=(*env)->GetPrimitiveArrayCritical(env, dst, 0)); bailif0(dstBuf=(*env)->GetPrimitiveArrayCritical(env, dst, 0));
if(tjEncodeYUV3(handle, srcBuf, width, stride*sizeof(jint), height, pf, if(tjEncodeYUV3(handle, &srcBuf[(y*actualStride + x)*sizeof(int)], width,
dstBuf, pad, subsamp, flags)==-1) stride*sizeof(jint), height, pf, dstBuf, pad, subsamp, flags)==-1)
{ {
(*env)->ReleasePrimitiveArrayCritical(env, dst, dstBuf, 0); (*env)->ReleasePrimitiveArrayCritical(env, dst, dstBuf, 0);
(*env)->ReleasePrimitiveArrayCritical(env, src, srcBuf, 0); (*env)->ReleasePrimitiveArrayCritical(env, src, srcBuf, 0);
@@ -350,8 +354,8 @@ JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_encodeYUV___
(JNIEnv *env, jobject obj, jintArray src, jint width, jint pitch, (JNIEnv *env, jobject obj, jintArray src, jint width, jint pitch,
jint height, jint pf, jbyteArray dst, jint subsamp, jint flags) jint height, jint pf, jbyteArray dst, jint subsamp, jint flags)
{ {
Java_org_libjpegturbo_turbojpeg_TJCompressor_encodeYUV___3IIIII_3BIII( Java_org_libjpegturbo_turbojpeg_TJCompressor_encodeYUV___3IIIIIII_3BIII(
env, obj, src, width, pitch, height, pf, dst, 4, subsamp, flags); env, obj, src, 0, 0, width, pitch, height, pf, dst, 4, subsamp, flags);
} }
JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_destroy JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_destroy
@@ -435,13 +439,13 @@ JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompress
} }
(*env)->ReleasePrimitiveArrayCritical(env, src, jpegBuf, 0); jpegBuf=NULL; (*env)->ReleasePrimitiveArrayCritical(env, src, jpegBuf, 0); jpegBuf=NULL;
bailif0(_fid=(*env)->GetFieldID(env, _cls, "jpegSubsamp", "I")); bailif0(_fid=(*env)->GetFieldID(env, _cls, "srcSubsamp", "I"));
(*env)->SetIntField(env, obj, _fid, jpegSubsamp); (*env)->SetIntField(env, obj, _fid, jpegSubsamp);
bailif0(_fid=(*env)->GetFieldID(env, _cls, "jpegColorspace", "I")); bailif0(_fid=(*env)->GetFieldID(env, _cls, "srcColorspace", "I"));
(*env)->SetIntField(env, obj, _fid, jpegColorspace); (*env)->SetIntField(env, obj, _fid, jpegColorspace);
bailif0(_fid=(*env)->GetFieldID(env, _cls, "jpegWidth", "I")); bailif0(_fid=(*env)->GetFieldID(env, _cls, "srcWidth", "I"));
(*env)->SetIntField(env, obj, _fid, width); (*env)->SetIntField(env, obj, _fid, width);
bailif0(_fid=(*env)->GetFieldID(env, _cls, "jpegHeight", "I")); bailif0(_fid=(*env)->GetFieldID(env, _cls, "srcHeight", "I"));
(*env)->SetIntField(env, obj, _fid, height); (*env)->SetIntField(env, obj, _fid, height);
bailout: bailout:
@@ -562,11 +566,11 @@ JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompress
if((*env)->GetArrayLength(env, src)<jpegSize) if((*env)->GetArrayLength(env, src)<jpegSize)
_throw("Source buffer is not large enough"); _throw("Source buffer is not large enough");
bailif0(_fid=(*env)->GetFieldID(env, _cls, "jpegSubsamp", "I")); bailif0(_fid=(*env)->GetFieldID(env, _cls, "srcSubsamp", "I"));
jpegSubsamp=(int)(*env)->GetIntField(env, obj, _fid); jpegSubsamp=(int)(*env)->GetIntField(env, obj, _fid);
bailif0(_fid=(*env)->GetFieldID(env, _cls, "jpegWidth", "I")); bailif0(_fid=(*env)->GetFieldID(env, _cls, "srcWidth", "I"));
jpegWidth=(int)(*env)->GetIntField(env, obj, _fid); jpegWidth=(int)(*env)->GetIntField(env, obj, _fid);
bailif0(_fid=(*env)->GetFieldID(env, _cls, "jpegHeight", "I")); bailif0(_fid=(*env)->GetFieldID(env, _cls, "srcHeight", "I"));
jpegHeight=(int)(*env)->GetIntField(env, obj, _fid); jpegHeight=(int)(*env)->GetIntField(env, obj, _fid);
yuvSize=(jsize)tjBufSizeYUV2(desiredWidth==0? jpegWidth:desiredWidth, yuvSize=(jsize)tjBufSizeYUV2(desiredWidth==0? jpegWidth:desiredWidth,
@@ -601,6 +605,94 @@ JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompress
env, obj, src, jpegSize, dst, 0, 4, 0, flags); env, obj, src, jpegSize, dst, 0, 4, 0, flags);
} }
JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJDecompressor_decodeYUV___3BII_3BIIIIIII
(JNIEnv *env, jobject obj, jbyteArray src, jint pad, jint subsamp,
jbyteArray dst, jint x, jint y, jint width, jint pitch, jint height,
jint pf, jint flags)
{
tjhandle handle=0;
jsize arraySize=0, actualPitch;
unsigned char *srcBuf=NULL, *dstBuf=NULL;
gethandle();
if(pf<0 || pf>=org_libjpegturbo_turbojpeg_TJ_NUMPF)
_throw("Invalid argument in decodeYUV()");
if(org_libjpegturbo_turbojpeg_TJ_NUMPF!=TJ_NUMPF)
_throw("Mismatch between Java and C API");
arraySize=tjBufSizeYUV2(width, pad, height, subsamp);
if((*env)->GetArrayLength(env, src)<arraySize)
_throw("Source buffer is not large enough");
actualPitch=(pitch==0)? width*tjPixelSize[pf]:pitch;
arraySize=(y+height-1)*actualPitch + (x+width)*tjPixelSize[pf];
if((*env)->GetArrayLength(env, dst)<arraySize)
_throw("Destination buffer is not large enough");
bailif0(srcBuf=(*env)->GetPrimitiveArrayCritical(env, src, 0));
bailif0(dstBuf=(*env)->GetPrimitiveArrayCritical(env, dst, 0));
if(tjDecodeYUV(handle, srcBuf, pad, subsamp,
&dstBuf[y*actualPitch + x*tjPixelSize[pf]], width, pitch, height, pf,
flags)==-1)
{
(*env)->ReleasePrimitiveArrayCritical(env, dst, dstBuf, 0);
(*env)->ReleasePrimitiveArrayCritical(env, src, srcBuf, 0);
dstBuf=srcBuf=NULL;
_throw(tjGetErrorStr());
}
bailout:
if(dstBuf) (*env)->ReleasePrimitiveArrayCritical(env, dst, dstBuf, 0);
if(srcBuf) (*env)->ReleasePrimitiveArrayCritical(env, src, srcBuf, 0);
return;
}
JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJDecompressor_decodeYUV___3BII_3IIIIIIII
(JNIEnv *env, jobject obj, jbyteArray src, jint pad, jint subsamp,
jintArray dst, jint x, jint y, jint width, jint stride, jint height,
jint pf, jint flags)
{
tjhandle handle=0;
jsize arraySize=0, actualStride;
unsigned char *srcBuf=NULL, *dstBuf=NULL;
gethandle();
if(pf<0 || pf>=org_libjpegturbo_turbojpeg_TJ_NUMPF)
_throw("Invalid argument in decodeYUV()");
if(org_libjpegturbo_turbojpeg_TJ_NUMPF!=TJ_NUMPF)
_throw("Mismatch between Java and C API");
if(tjPixelSize[pf]!=sizeof(jint))
_throw("Pixel format must be 32-bit when decoding to an integer buffer.");
arraySize=tjBufSizeYUV2(width, pad, height, subsamp);
if((*env)->GetArrayLength(env, src)<arraySize)
_throw("Source buffer is not large enough");
actualStride=(stride==0)? width:stride;
arraySize=(y+height-1)*actualStride + x+width;
if((*env)->GetArrayLength(env, dst)<arraySize)
_throw("Destination buffer is not large enough");
bailif0(srcBuf=(*env)->GetPrimitiveArrayCritical(env, src, 0));
bailif0(dstBuf=(*env)->GetPrimitiveArrayCritical(env, dst, 0));
if(tjDecodeYUV(handle, srcBuf, pad, subsamp,
&dstBuf[(y*actualStride + x)*sizeof(int)], width, stride*sizeof(jint),
height, pf, flags)==-1)
{
(*env)->ReleasePrimitiveArrayCritical(env, dst, dstBuf, 0);
(*env)->ReleasePrimitiveArrayCritical(env, src, srcBuf, 0);
dstBuf=srcBuf=NULL;
_throw(tjGetErrorStr());
}
bailout:
if(dstBuf) (*env)->ReleasePrimitiveArrayCritical(env, dst, dstBuf, 0);
if(srcBuf) (*env)->ReleasePrimitiveArrayCritical(env, src, srcBuf, 0);
return;
}
JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJTransformer_init JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJTransformer_init
(JNIEnv *env, jobject obj) (JNIEnv *env, jobject obj)
{ {
@@ -698,11 +790,11 @@ JNIEXPORT jintArray JNICALL Java_org_libjpegturbo_turbojpeg_TJTransformer_transf
if((*env)->GetArrayLength(env, jsrcBuf)<jpegSize) if((*env)->GetArrayLength(env, jsrcBuf)<jpegSize)
_throw("Source buffer is not large enough"); _throw("Source buffer is not large enough");
bailif0(_fid=(*env)->GetFieldID(env, _cls, "jpegWidth", "I")); bailif0(_fid=(*env)->GetFieldID(env, _cls, "srcWidth", "I"));
jpegWidth=(int)(*env)->GetIntField(env, obj, _fid); jpegWidth=(int)(*env)->GetIntField(env, obj, _fid);
bailif0(_fid=(*env)->GetFieldID(env, _cls, "jpegHeight", "I")); bailif0(_fid=(*env)->GetFieldID(env, _cls, "srcHeight", "I"));
jpegHeight=(int)(*env)->GetIntField(env, obj, _fid); jpegHeight=(int)(*env)->GetIntField(env, obj, _fid);
bailif0(_fid=(*env)->GetFieldID(env, _cls, "jpegSubsamp", "I")); bailif0(_fid=(*env)->GetFieldID(env, _cls, "srcSubsamp", "I"));
jpegSubsamp=(int)(*env)->GetIntField(env, obj, _fid); jpegSubsamp=(int)(*env)->GetIntField(env, obj, _fid);
n=(*env)->GetArrayLength(env, dstobjs); n=(*env)->GetArrayLength(env, dstobjs);

View File

@@ -42,6 +42,7 @@ TURBOJPEG_1.4
global: global:
tjBufSizeYUV2; tjBufSizeYUV2;
tjCompressFromYUV; tjCompressFromYUV;
tjDecodeYUV;
tjDecompressHeader3; tjDecompressHeader3;
tjDecompressToYUV2; tjDecompressToYUV2;
tjEncodeYUV3; tjEncodeYUV3;

View File

@@ -68,12 +68,15 @@ TURBOJPEG_1.4
global: global:
tjBufSizeYUV2; tjBufSizeYUV2;
tjCompressFromYUV; tjCompressFromYUV;
tjDecodeYUV;
tjDecompressHeader3; tjDecompressHeader3;
tjDecompressToYUV2; tjDecompressToYUV2;
tjEncodeYUV3; tjEncodeYUV3;
Java_org_libjpegturbo_turbojpeg_TJ_bufSizeYUV__IIII; Java_org_libjpegturbo_turbojpeg_TJ_bufSizeYUV__IIII;
Java_org_libjpegturbo_turbojpeg_TJCompressor_compressFromYUV___3BIIII_3BII; Java_org_libjpegturbo_turbojpeg_TJCompressor_compressFromYUV___3BIIII_3BII;
Java_org_libjpegturbo_turbojpeg_TJCompressor_encodeYUV___3BIIII_3BIII; Java_org_libjpegturbo_turbojpeg_TJCompressor_encodeYUV___3BIIIIII_3BIII;
Java_org_libjpegturbo_turbojpeg_TJCompressor_encodeYUV___3IIIII_3BIII; Java_org_libjpegturbo_turbojpeg_TJCompressor_encodeYUV___3IIIIIII_3BIII;
Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompressToYUV___3BI_3BIIII; Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompressToYUV___3BI_3BIIII;
Java_org_libjpegturbo_turbojpeg_TJDecompressor_decodeYUV___3BII_3BIIIIIII;
Java_org_libjpegturbo_turbojpeg_TJDecompressor_decodeYUV___3BII_3IIIIIIII;
} TURBOJPEG_1.3; } TURBOJPEG_1.3;

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C)2009-2013 D. R. Commander. All Rights Reserved. * Copyright (C)2009-2014 D. R. Commander. All Rights Reserved.
* mozjpeg Modifications: * mozjpeg Modifications:
* Copyright (C) 2014, Mozilla Corporation. * Copyright (C) 2014, Mozilla Corporation.
* *
@@ -548,9 +548,9 @@ DLLEXPORT unsigned long DLLCALL tjBufSize(int width, int height,
if(width<1 || height<1 || jpegSubsamp<0 || jpegSubsamp>=NUMSUBOPT) if(width<1 || height<1 || jpegSubsamp<0 || jpegSubsamp>=NUMSUBOPT)
_throw("tjBufSize(): Invalid argument"); _throw("tjBufSize(): Invalid argument");
// This allows for rare corner cases in which a JPEG image can actually be /* This allows for rare corner cases in which a JPEG image can actually be
// larger than the uncompressed input (we wouldn't mention it if it hadn't larger than the uncompressed input (we wouldn't mention it if it hadn't
// happened before.) happened before.) */
mcuw=tjMCUWidth[jpegSubsamp]; mcuw=tjMCUWidth[jpegSubsamp];
mcuh=tjMCUHeight[jpegSubsamp]; mcuh=tjMCUHeight[jpegSubsamp];
chromasf=jpegSubsamp==TJSAMP_GRAY? 0: 4*64/(mcuw*mcuh); chromasf=jpegSubsamp==TJSAMP_GRAY? 0: 4*64/(mcuw*mcuh);
@@ -566,9 +566,9 @@ DLLEXPORT unsigned long DLLCALL TJBUFSIZE(int width, int height)
if(width<1 || height<1) if(width<1 || height<1)
_throw("TJBUFSIZE(): Invalid argument"); _throw("TJBUFSIZE(): Invalid argument");
// This allows for rare corner cases in which a JPEG image can actually be /* This allows for rare corner cases in which a JPEG image can actually be
// larger than the uncompressed input (we wouldn't mention it if it hadn't larger than the uncompressed input (we wouldn't mention it if it hadn't
// happened before.) happened before.) */
retval=PAD(width, 16) * PAD(height, 16) * 6 + 2048; retval=PAD(width, 16) * PAD(height, 16) * 6 + 2048;
bailout: bailout:
@@ -766,10 +766,20 @@ DLLEXPORT int DLLCALL tjEncodeYUV3(tjhandle handle, unsigned char *srcBuf,
else if(flags&TJFLAG_FORCESSE2) putenv("JSIMD_FORCESSE2=1"); else if(flags&TJFLAG_FORCESSE2) putenv("JSIMD_FORCESSE2=1");
yuvsize=tjBufSizeYUV2(width, pad, height, subsamp); yuvsize=tjBufSizeYUV2(width, pad, height, subsamp);
jpeg_mem_dest_tj(cinfo, &dstBuf, &yuvsize, 0);
if(setCompDefaults(cinfo, pixelFormat, subsamp, -1, flags)==-1) return -1; if(setCompDefaults(cinfo, pixelFormat, subsamp, -1, flags)==-1) return -1;
jpeg_start_compress(cinfo, TRUE); /* Execute only the parts of jpeg_start_compress() that we need. If we
were to call the whole jpeg_start_compress() function, then it would try
to write the file headers, which could overflow the output buffer if the
YUV image were very small. */
if(cinfo->global_state!=CSTATE_START)
_throw("tjEncodeYUV3(): libjpeg API is in the wrong state");
(*cinfo->err->reset_error_mgr)((j_common_ptr)cinfo);
jinit_c_master_control(cinfo, FALSE);
jinit_color_converter(cinfo);
jinit_downsampler(cinfo);
(*cinfo->cconvert->start_pass)(cinfo);
pw=PAD(width, cinfo->max_h_samp_factor); pw=PAD(width, cinfo->max_h_samp_factor);
ph=PAD(height, cinfo->max_v_samp_factor); ph=PAD(height, cinfo->max_v_samp_factor);
@@ -973,10 +983,10 @@ DLLEXPORT int DLLCALL tjCompressFromYUV(tjhandle handle, unsigned char *srcBuf,
for(j=0; j<min(th[i], ch[i]-crow[i]); j++) for(j=0; j<min(th[i], ch[i]-crow[i]); j++)
{ {
memcpy(tmpbuf[i][j], inbuf[i][crow[i]+j], cw[i]); memcpy(tmpbuf[i][j], inbuf[i][crow[i]+j], cw[i]);
// Duplicate last sample in row to fill out MCU /* Duplicate last sample in row to fill out MCU */
for(k=cw[i]; k<iw[i]; k++) tmpbuf[i][j][k]=tmpbuf[i][j][cw[i]-1]; for(k=cw[i]; k<iw[i]; k++) tmpbuf[i][j][k]=tmpbuf[i][j][cw[i]-1];
} }
// Duplicate last row to fill out MCU /* Duplicate last row to fill out MCU */
for(j=ch[i]-crow[i]; j<th[i]; j++) for(j=ch[i]-crow[i]; j<th[i]; j++)
memcpy(tmpbuf[i][j], tmpbuf[i][ch[i]-crow[i]-1], iw[i]); memcpy(tmpbuf[i][j], tmpbuf[i][ch[i]-crow[i]-1], iw[i]);
yuvptr[i]=tmpbuf[i]; yuvptr[i]=tmpbuf[i];
@@ -1233,6 +1243,214 @@ DLLEXPORT int DLLCALL tjDecompress(tjhandle handle, unsigned char *jpegBuf,
} }
static int setDecodeDefaults(struct jpeg_decompress_struct *dinfo,
int pixelFormat, int subsamp, int flags)
{
int i;
dinfo->scale_num=dinfo->scale_denom=1;
if(subsamp==TJSAMP_GRAY)
{
dinfo->num_components=dinfo->comps_in_scan=1;
dinfo->jpeg_color_space=JCS_GRAYSCALE;
}
else
{
dinfo->num_components=dinfo->comps_in_scan=3;
dinfo->jpeg_color_space=JCS_YCbCr;
}
dinfo->comp_info=(jpeg_component_info *)
(*dinfo->mem->alloc_small)((j_common_ptr)dinfo, JPOOL_IMAGE,
dinfo->num_components*SIZEOF(jpeg_component_info));
for(i=0; i<dinfo->num_components; i++)
{
jpeg_component_info *compptr=&dinfo->comp_info[i];
compptr->h_samp_factor=(i==0)? tjMCUWidth[subsamp]/8:1;
compptr->v_samp_factor=(i==0)? tjMCUHeight[subsamp]/8:1;
compptr->component_index=i;
compptr->component_id=i+1;
compptr->quant_tbl_no=compptr->dc_tbl_no=compptr->ac_tbl_no=
(i==0)? 0:1;
dinfo->cur_comp_info[i]=compptr;
}
dinfo->data_precision=8;
for(i=0; i<2; i++)
{
if(dinfo->quant_tbl_ptrs[i]==NULL)
dinfo->quant_tbl_ptrs[i]=jpeg_alloc_quant_table((j_common_ptr)dinfo);
}
return 0;
}
int my_read_markers(j_decompress_ptr dinfo)
{
return JPEG_REACHED_SOS;
}
void my_reset_marker_reader(j_decompress_ptr dinfo)
{
}
DLLEXPORT int DLLCALL tjDecodeYUV(tjhandle handle, unsigned char *srcBuf,
int pad, int subsamp, unsigned char *dstBuf, int width, int pitch,
int height, int pixelFormat, int flags)
{
int i, retval=0; JSAMPROW *row_pointer=NULL;
JSAMPLE *_tmpbuf[MAX_COMPONENTS];
JSAMPROW *tmpbuf[MAX_COMPONENTS], *inbuf[MAX_COMPONENTS];
int row, pw, ph, cw[MAX_COMPONENTS], ch[MAX_COMPONENTS];
JSAMPLE *ptr=srcBuf;
unsigned long yuvsize=0;
jpeg_component_info *compptr;
#ifndef JCS_EXTENSIONS
unsigned char *rgbBuf=NULL;
#endif
JMETHOD(int, old_read_markers, (j_decompress_ptr));
JMETHOD(void, old_reset_marker_reader, (j_decompress_ptr));
getinstance(handle);
for(i=0; i<MAX_COMPONENTS; i++)
{
tmpbuf[i]=NULL; _tmpbuf[i]=NULL; inbuf[i]=NULL;
}
if((this->init&DECOMPRESS)==0)
_throw("tjDecodeYUV(): Instance has not been initialized for compression");
if(srcBuf==NULL || pad<0 || !isPow2(pad) || subsamp<0 || subsamp>=NUMSUBOPT
|| dstBuf==NULL || width<=0 || pitch<0 || height<=0 || pixelFormat<0
|| pixelFormat>=TJ_NUMPF)
_throw("tjDecodeYUV(): Invalid argument");
if(setjmp(this->jerr.setjmp_buffer))
{
/* If we get here, the JPEG code has signaled an error. */
retval=-1;
goto bailout;
}
if(pixelFormat==TJPF_CMYK)
_throw("tjDecodeYUV(): Cannot decode YUV images into CMYK pixels.");
if(pitch==0) pitch=width*tjPixelSize[pixelFormat];
#ifndef JCS_EXTENSIONS
if(pixelFormat!=TJPF_GRAY)
{
rgbBuf=(unsigned char *)malloc(width*height*RGB_PIXELSIZE);
if(!rgbBuf) _throw("tjDecodeYUV(): Memory allocation failure");
srcBuf=toRGB(srcBuf, width, pitch, height, pixelFormat, rgbBuf);
pitch=width*RGB_PIXELSIZE;
}
#endif
dinfo->image_width=width;
dinfo->image_height=height;
if(flags&TJFLAG_FORCEMMX) putenv("JSIMD_FORCEMMX=1");
else if(flags&TJFLAG_FORCESSE) putenv("JSIMD_FORCESSE=1");
else if(flags&TJFLAG_FORCESSE2) putenv("JSIMD_FORCESSE2=1");
yuvsize=tjBufSizeYUV2(width, pad, height, subsamp);
if(setDecodeDefaults(dinfo, pixelFormat, subsamp, flags)==-1)
{
retval=-1; goto bailout;
}
old_read_markers=dinfo->marker->read_markers;
dinfo->marker->read_markers=my_read_markers;
old_reset_marker_reader=dinfo->marker->reset_marker_reader;
dinfo->marker->reset_marker_reader=my_reset_marker_reader;
jpeg_read_header(dinfo, TRUE);
dinfo->marker->read_markers=old_read_markers;
dinfo->marker->reset_marker_reader=old_reset_marker_reader;
if(setDecompDefaults(dinfo, pixelFormat, flags)==-1)
{
retval=-1; goto bailout;
}
dinfo->do_fancy_upsampling=FALSE;
jinit_master_decompress(dinfo);
(*dinfo->upsample->start_pass)(dinfo);
pw=PAD(width, dinfo->max_h_samp_factor);
ph=PAD(height, dinfo->max_v_samp_factor);
if(pitch==0) pitch=dinfo->output_width*tjPixelSize[pixelFormat];
if((row_pointer=(JSAMPROW *)malloc(sizeof(JSAMPROW)*ph))==NULL)
_throw("tjDecodeYUV(): Memory allocation failure");
for(i=0; i<height; i++)
{
if(flags&TJFLAG_BOTTOMUP) row_pointer[i]=&dstBuf[(height-i-1)*pitch];
else row_pointer[i]=&dstBuf[i*pitch];
}
if(height<ph)
for(i=height; i<ph; i++) row_pointer[i]=row_pointer[height-1];
for(i=0; i<dinfo->num_components; i++)
{
compptr=&dinfo->comp_info[i];
_tmpbuf[i]=(JSAMPLE *)malloc(PAD(compptr->width_in_blocks*DCTSIZE, 16)
* compptr->v_samp_factor + 16);
if(!_tmpbuf[i]) _throw("tjDecodeYUV(): Memory allocation failure");
tmpbuf[i]=(JSAMPROW *)malloc(sizeof(JSAMPROW)*compptr->v_samp_factor);
if(!tmpbuf[i]) _throw("tjDecodeYUV(): Memory allocation failure");
for(row=0; row<compptr->v_samp_factor; row++)
{
unsigned char *_tmpbuf_aligned=
(unsigned char *)PAD((size_t)_tmpbuf[i], 16);
tmpbuf[i][row]=&_tmpbuf_aligned[
PAD(compptr->width_in_blocks*DCTSIZE, 16) * row];
}
cw[i]=pw*compptr->h_samp_factor/dinfo->max_h_samp_factor;
ch[i]=ph*compptr->v_samp_factor/dinfo->max_v_samp_factor;
inbuf[i]=(JSAMPROW *)malloc(sizeof(JSAMPROW)*ch[i]);
if(!inbuf[i]) _throw("tjDecodeYUV(): Memory allocation failure");
for(row=0; row<ch[i]; row++)
{
inbuf[i][row]=ptr;
ptr+=PAD(cw[i], pad);
}
}
if(yuvsize!=(unsigned long)(ptr-srcBuf))
_throw("tjDecodeYUV(): YUV image is not the correct size");
for(row=0; row<ph; row+=dinfo->max_v_samp_factor)
{
JDIMENSION inrow=0, outrow=0;
for(i=0, compptr=dinfo->comp_info; i<dinfo->num_components; i++, compptr++)
jcopy_sample_rows(inbuf[i],
row*compptr->v_samp_factor/dinfo->max_v_samp_factor, tmpbuf[i], 0,
compptr->v_samp_factor, cw[i]);
(dinfo->upsample->upsample)(dinfo, tmpbuf, &inrow,
dinfo->max_v_samp_factor, &row_pointer[row], &outrow,
dinfo->max_v_samp_factor);
}
jpeg_abort_decompress(dinfo);
bailout:
if(dinfo->global_state>DSTATE_START) jpeg_abort_decompress(dinfo);
#ifndef JCS_EXTENSIONS
if(rgbBuf) free(rgbBuf);
#endif
if(row_pointer) free(row_pointer);
for(i=0; i<MAX_COMPONENTS; i++)
{
if(tmpbuf[i]!=NULL) free(tmpbuf[i]);
if(_tmpbuf[i]!=NULL) free(_tmpbuf[i]);
if(inbuf[i]!=NULL) free(inbuf[i]);
}
return retval;
}
DLLEXPORT int DLLCALL tjDecompressToYUV2(tjhandle handle, DLLEXPORT int DLLCALL tjDecompressToYUV2(tjhandle handle,
unsigned char *jpegBuf, unsigned long jpegSize, unsigned char *dstBuf, unsigned char *jpegBuf, unsigned long jpegSize, unsigned char *dstBuf,
int width, int pad, int height, int flags) int width, int pad, int height, int flags)

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C)2009-2013 D. R. Commander. All Rights Reserved. * Copyright (C)2009-2014 D. R. Commander. All Rights Reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are met:
@@ -636,7 +636,10 @@ DLLEXPORT int DLLCALL tjCompress2(tjhandle handle, unsigned char *srcBuf,
/** /**
* Compress a YUV planar image into a JPEG image. * Compress a YUV planar image into a JPEG image. Note that, if the width or
* height of the YUV image is not an even multiple of the MCU block size
* (see #tjMCUWidth and #tjMCUHeight), then an intermediate buffer copy will be
* performed within TurboJPEG.
* *
* @param handle a handle to a TurboJPEG compressor or transformer instance * @param handle a handle to a TurboJPEG compressor or transformer instance
* @param srcBuf pointer to an image buffer containing a YUV planar image * @param srcBuf pointer to an image buffer containing a YUV planar image
@@ -733,7 +736,7 @@ DLLEXPORT unsigned long DLLCALL tjBufSizeYUV2(int width, int pad, int height,
/** /**
* Encode an RGB or grayscale image into a YUV planar image. This function * Encode an RGB or grayscale image into a YUV planar image. This function
* uses the accelerated color conversion routines in TurboJPEG's underlying * uses the accelerated color conversion routines in the underlying
* codec but does not execute any of the other steps in the JPEG compression * codec but does not execute any of the other steps in the JPEG compression
* process. The Y, U (Cb), and V (Cr) image planes are stored sequentially * process. The Y, U (Cb), and V (Cr) image planes are stored sequentially
* into the destination buffer, and the size of each plane is determined by the * into the destination buffer, and the size of each plane is determined by the
@@ -925,6 +928,60 @@ DLLEXPORT int DLLCALL tjDecompressToYUV2(tjhandle handle,
int width, int pad, int height, int flags); int width, int pad, int height, int flags);
/**
* Decode a YUV planar image into an RGB or grayscale image. This function
* uses the accelerated color conversion routines in the underlying
* codec but does not execute any of the other steps in the JPEG decompression
* process. The Y, U (Cb), and V (Cr) image planes should be stored
* sequentially in the source buffer, and the size of each plane is determined
* by the width and height of the source image, as well as the specified
* padding and level of chrominance subsampling. If the chrominance components
* are subsampled along the horizontal dimension, then the width of the
* luminance plane should be padded to the nearest multiple of 2 in the input
* image (same goes for the height of the luminance plane, if the chrominance
* components are subsampled along the vertical dimension.)
* <p>
* NOTE: Technically, the JPEG format uses the YCbCr colorspace, but per the
* convention of the digital video community, the TurboJPEG API uses "YUV" to
* refer to an image format consisting of Y, Cb, and Cr image planes.
*
* @param handle a handle to a TurboJPEG decompressor or transformer instance
* @param srcBuf pointer to an image buffer containing a YUV planar image to be
* decoded. The size of this buffer should match the value returned
* by #tjBufSizeYUV2() for the given image width, height, padding, and
* level of chrominance subsampling.
* @param pad Use this parameter to specify that the width of each line in each
* plane of the YUV source image is padded to the nearest multiple of
* this number of bytes (must be a power of 2.)
* @param subsamp the level of chrominance subsampling used in the YUV source
* image (see @ref TJSAMP "Chrominance subsampling options".)
* @param dstBuf pointer to an image buffer that will receive the decoded
* image. This buffer should normally be <tt>pitch * height</tt>
* bytes in size, but the <tt>dstBuf</tt> pointer can also be used to
* decode into a specific region of a larger buffer.
* @param width width (in pixels) of the source and destination images
* @param pitch bytes per line of the destination image. Normally, this should
* be <tt>width * #tjPixelSize[pixelFormat]</tt> if the destination
* image is unpadded, or <tt>#TJPAD(width *
* #tjPixelSize[pixelFormat])</tt> if each line of the destination
* image should be padded to the nearest 32-bit boundary, as is the case
* for Windows bitmaps. You can also be clever and use the pitch
* parameter to skip lines, etc. Setting this parameter to 0 is the
* equivalent of setting it to <tt>width *
* #tjPixelSize[pixelFormat]</tt>.
* @param height height (in pixels) of the source and destination images
* @param pixelFormat pixel format of the destination image (see @ref TJPF
* "Pixel formats".)
* @param flags the bitwise OR of one or more of the @ref TJFLAG_BOTTOMUP
* "flags".
*
* @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr().)
*/
DLLEXPORT int DLLCALL tjDecodeYUV(tjhandle handle, unsigned char *srcBuf,
int pad, int subsamp, unsigned char *dstBuf, int width, int pitch,
int height, int pixelFormat, int flags);
/** /**
* Create a new TurboJPEG transformer instance. * Create a new TurboJPEG transformer instance.
* *