Compare commits

...

64 Commits

Author SHA1 Message Date
DRC
cc336e7bd2 Cosmetic fixes to argument lists
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/branches/1.2.x@852 632fc199-4ca6-4c93-a231-07263d6284db
2012-06-29 23:51:35 +00:00
DRC
e0a0151761 Re-generate docs to pick up new API version
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/branches/1.2.x@850 632fc199-4ca6-4c93-a231-07263d6284db
2012-06-29 23:17:03 +00:00
DRC
fd3aba3590 Added flags to the TurboJPEG API that allow the caller to force the use of either the fast or the accurate DCT/IDCT algorithms in the underlying codec.
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/branches/1.2.x@849 632fc199-4ca6-4c93-a231-07263d6284db
2012-06-29 23:14:48 +00:00
DRC
112a0bb968 More recent versions of autoconf add -traditional-cpp to the CPP flags, which causes jsimdcfg.inc.h to not preprocess correctly unless we expand all of the instances of the #definev macro.
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/branches/1.2.x@848 632fc199-4ca6-4c93-a231-07263d6284db
2012-06-28 23:25:34 +00:00
DRC
5950c5d4f9 Later versions of autoconf (specifically, the one shipped with Xcode 4.3) default to building x86-64, so it is necessary to override the host_alias to get a 32-bit build.
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/branches/1.2.x@846 632fc199-4ca6-4c93-a231-07263d6284db
2012-06-28 23:22:03 +00:00
DRC
de37e07716 Provide further details about the regression
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/branches/1.2.x@841 632fc199-4ca6-4c93-a231-07263d6284db
2012-06-18 00:08:18 +00:00
DRC
8126d0c5a5 Fixed regression caused by a bug in the 32-bit strict memory access code in jdmrgss2.asm (contributed by Chromium to stop valgrind from whining whenever the output buffer size was not evenly divisible by 16 bytes.) On Linux/x86, this regression generated incorrect pixels on the right-hand side of images whose rows were not 16-byte aligned, whenever fancy upsampling was used. This patch also enables the strict memory access code on all platforms, not just Linux (it does no harm on other platforms) and removes a couple of pcmpeqb instructions that were rendered unnecessary by r835.
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/branches/1.2.x@838 632fc199-4ca6-4c93-a231-07263d6284db
2012-06-15 21:54:45 +00:00
DRC
316617faf4 Accelerated 4:2:2 upsampling routine for ARM (improves performance ~20-30% when decompressing 4:2:2 JPEGs using fancy upsampling)
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/branches/1.2.x@837 632fc199-4ca6-4c93-a231-07263d6284db
2012-06-13 05:17:03 +00:00
DRC
69799275be Eliminate the use of the MASKMOVDQU instruction, to speed up decompression performance by 10x on AMD Bobcat embedded processors (and ~5% on AMD desktop processors.)
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/branches/1.2.x@835 632fc199-4ca6-4c93-a231-07263d6284db
2012-06-13 01:21:29 +00:00
DRC
dd2b651243 Guard against num_components being a ridiculous value due to a corrupt header
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/branches/1.2.x@831 632fc199-4ca6-4c93-a231-07263d6284db
2012-05-30 20:36:42 +00:00
DRC
4f24016bde Preserve all 128 bits of xmm6 and xmm7
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/branches/1.2.x@829 632fc199-4ca6-4c93-a231-07263d6284db
2012-04-26 19:50:37 +00:00
DRC
d4c15e103c Whitespace tweak
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/branches/1.2.x@823 632fc199-4ca6-4c93-a231-07263d6284db
2012-03-23 19:39:14 +00:00
DRC
2eda8212e4 Ensure that tjDecompress2() exits cleanly if setDecompDefaults() fails
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/branches/1.2.x@821 632fc199-4ca6-4c93-a231-07263d6284db
2012-03-23 19:32:38 +00:00
DRC
0559e94c72 "Sun Studio"="Oracle Solaris Studio"
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/branches/1.2.x@818 632fc199-4ca6-4c93-a231-07263d6284db
2012-03-23 03:12:35 +00:00
DRC
7c6ae034da Fix universal DMG build
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/branches/1.2.x@816 632fc199-4ca6-4c93-a231-07263d6284db
2012-03-23 00:51:56 +00:00
DRC
68071bd2e4 1.2.1
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/branches/1.2.x@814 632fc199-4ca6-4c93-a231-07263d6284db
2012-03-22 22:05:09 +00:00
DRC
8015a30308 Visual Studio 2010 doesn't like the wildcard at compile time, so let CMake expand it instead.
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/branches/1.2.x@813 632fc199-4ca6-4c93-a231-07263d6284db
2012-03-17 14:32:38 +00:00
DRC
cac105133e Fix the behavior of the alpha-enabled colorspace constants whenever libjpeg-turbo is built without SIMD support and merged upsampling is used.
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/branches/1.2.x@811 632fc199-4ca6-4c93-a231-07263d6284db
2012-03-16 14:37:36 +00:00
DRC
a9b646c202 Allow RGB JPEG files to be created/decoded when using the LJT colorspace extensions
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/branches/1.2.x@809 632fc199-4ca6-4c93-a231-07263d6284db
2012-03-11 22:06:54 +00:00
DRC
69c1408e9d Oops
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/branches/1.2.x@805 632fc199-4ca6-4c93-a231-07263d6284db
2012-02-10 03:47:18 +00:00
DRC
9e7eb27686 Move build dir. variables back into makemacpkg to avoid messing up the Solaris packaging system.
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/branches/1.2.x@804 632fc199-4ca6-4c93-a231-07263d6284db
2012-02-10 03:41:20 +00:00
DRC
51d626ff9d Don't include documentation in 32-bit supplemental package
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/branches/1.2.x@801 632fc199-4ca6-4c93-a231-07263d6284db
2012-02-10 02:51:40 +00:00
DRC
01bf9d9ccd Fix 'make dist'
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/branches/1.2.x@799 632fc199-4ca6-4c93-a231-07263d6284db
2012-02-10 01:52:31 +00:00
DRC
ef49f790bd git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/branches/1.2.x@797 632fc199-4ca6-4c93-a231-07263d6284db 2012-02-10 01:44:23 +00:00
DRC
57bd84f435 RPM spec no longer uses %{_srcdir}
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/branches/1.2.x@796 632fc199-4ca6-4c93-a231-07263d6284db
2012-02-10 01:40:29 +00:00
DRC
20b734e1c4 Infrastructure for producing a universal x86-64/i386/ARM version of libjpeg.a and libturbojpeg.a on OS X, so that the same library can be used to build OS X and iOS apps
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/branches/1.2.x@793 632fc199-4ca6-4c93-a231-07263d6284db
2012-02-10 01:30:37 +00:00
DRC
a1647c8412 Install docs when doing 'make install' on Unix; Fix 'install' target on Windows; Include wizard.txt, example.c, and structure.txt in installed docs
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/branches/1.2.x@790 632fc199-4ca6-4c93-a231-07263d6284db
2012-02-10 00:39:05 +00:00
DRC
b39dfe7046 Merge description from README-turbo.txt into packages
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/branches/1.2.x@786 632fc199-4ca6-4c93-a231-07263d6284db
2012-02-08 09:17:42 +00:00
DRC
f832eae5c2 Merge description from README-turbo.txt into packages
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/branches/1.1.x@788 632fc199-4ca6-4c93-a231-07263d6284db
2012-02-08 09:56:04 +00:00
DRC
be6d424626 Compiler warning
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/branches/1.1.x@785 632fc199-4ca6-4c93-a231-07263d6284db
2012-02-07 23:41:10 +00:00
DRC
0f0fd75125 Compiler warnings
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/branches/1.1.x@784 632fc199-4ca6-4c93-a231-07263d6284db
2012-02-07 23:27:14 +00:00
DRC
760ea8dfb3 Merge documentation and wordsmithing changes from 1.2, including promotion of -arithmetic to a "switch for advanced users"
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/branches/1.1.x@783 632fc199-4ca6-4c93-a231-07263d6284db
2012-02-07 23:25:19 +00:00
DRC
11a122b2d6 Wordsmithing and grammar
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/branches/1.2.x@777 632fc199-4ca6-4c93-a231-07263d6284db
2012-02-07 00:14:53 +00:00
DRC
6916f87955 Several clarifications regarding v7/v8 API/ABI support
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/branches/1.2.x@776 632fc199-4ca6-4c93-a231-07263d6284db
2012-02-03 08:59:21 +00:00
DRC
1d5b1cf320 Merge copyright messages into one string and change the run-time messages to avoid confusion (we are not technically based on the latest libjpeg, although we do borrow some code from it)
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/branches/1.2.x@766 632fc199-4ca6-4c93-a231-07263d6284db
2012-01-31 10:39:29 +00:00
DRC
ccd1bfdd31 Incorporate a few upstream doc changes; grammar police; wordsmithing; Move -arithmetic into "switches for advanced users"
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/branches/1.2.x@764 632fc199-4ca6-4c93-a231-07263d6284db
2012-01-31 09:53:46 +00:00
DRC
866e6ffeca Fix 'make dist'
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/branches/1.2.x@763 632fc199-4ca6-4c93-a231-07263d6284db
2012-01-31 08:00:50 +00:00
DRC
9cd4e4b026 Add more extensive TurboJPEG regression tests
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/branches/1.2.x@762 632fc199-4ca6-4c93-a231-07263d6284db
2012-01-31 07:56:44 +00:00
DRC
6ebf110355 Move test images into their own subdirectory
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/branches/1.2.x@759 632fc199-4ca6-4c93-a231-07263d6284db
2012-01-31 04:58:26 +00:00
DRC
d65d99a9f5 Compiler warnings
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/branches/1.2.x@758 632fc199-4ca6-4c93-a231-07263d6284db
2012-01-31 03:39:23 +00:00
DRC
e006f5c427 Oops. Height of output buffer should equal scaled height, not JPEG height.
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/branches/1.2.x@755 632fc199-4ca6-4c93-a231-07263d6284db
2012-01-28 06:31:44 +00:00
DRC
8c8124bf51 Oops. Need to handle cases in which num_components > n
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/branches/1.2.x@751 632fc199-4ca6-4c93-a231-07263d6284db
2012-01-28 01:19:23 +00:00
DRC
30913542c0 Be clear that we are only emulating the libjpeg v7/v8 API/ABI, not the library itself.
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/branches/1.2.x@749 632fc199-4ca6-4c93-a231-07263d6284db
2012-01-27 09:53:33 +00:00
DRC
b6b30676a3 git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/branches/1.2.x@746 632fc199-4ca6-4c93-a231-07263d6284db 2012-01-27 09:42:26 +00:00
DRC
d657ba6093 Move -arithmetic into "switches for advanced users"
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/branches/1.2.x@745 632fc199-4ca6-4c93-a231-07263d6284db
2012-01-27 09:41:20 +00:00
DRC
16c6e26e4b Update upstream e-mail address
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/branches/1.2.x@743 632fc199-4ca6-4c93-a231-07263d6284db
2012-01-27 09:28:14 +00:00
DRC
a5dcab663a Create 1.2.x branch
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/branches/1.2.x@741 632fc199-4ca6-4c93-a231-07263d6284db
2012-01-27 05:46:31 +00:00
DRC
12781cb555 Properly decompress erroneous CMYK/YCCK images whose K component has an ID of 1 instead of 4 (this is to support SumatraPDF)
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@740 632fc199-4ca6-4c93-a231-07263d6284db
2012-01-27 01:23:20 +00:00
DRC
a7466c9d86 Move INLINE macro into config.h. That's really where it belongs anyhow, since it is used only internally, and putting it in jconfig.h was causing problems with DevIL.
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@739 632fc199-4ca6-4c93-a231-07263d6284db
2012-01-26 22:20:31 +00:00
DRC
81a50f71a3 Grammar police
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@736 632fc199-4ca6-4c93-a231-07263d6284db
2012-01-17 22:56:22 +00:00
DRC
2c62da3c6c Subtle point, but TurboJPEG is the API and TurboJPEG/OSS is the library implementing that API.
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@735 632fc199-4ca6-4c93-a231-07263d6284db
2012-01-17 22:55:03 +00:00
DRC
efe28cec4b Compiler warnings
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@734 632fc199-4ca6-4c93-a231-07263d6284db
2012-01-17 11:48:38 +00:00
DRC
b76c8404e3 Add program that demonstrates how to check for the existence of the colorspace extensions
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@733 632fc199-4ca6-4c93-a231-07263d6284db
2011-12-19 15:01:55 +00:00
DRC
67ce3b2352 Added new alpha channel colorspace constants/pixel formats, so applications can specify that they need the unused byte in a 4-component RGB output buffer set to 0xFF when decompressing.
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@732 632fc199-4ca6-4c93-a231-07263d6284db
2011-12-19 02:21:03 +00:00
DRC
ab64b62c6b Add LIBJPEG_TURBO_VERSION macro for checking the libjpeg-turbo version at compile time
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@731 632fc199-4ca6-4c93-a231-07263d6284db
2011-12-18 16:29:35 +00:00
DRC
80803ae5fe "which"="that"
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@730 632fc199-4ca6-4c93-a231-07263d6284db
2011-12-15 13:12:59 +00:00
DRC
ebfe9e4a7b Fixed non-fatal out-of-bounds read in SSE2 SIMD code reported by valgrind when decompressing a JPEG image to a bitmap buffer whose size was not a multiple of 16 bytes.
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@727 632fc199-4ca6-4c93-a231-07263d6284db
2011-12-01 10:58:36 +00:00
DRC
0f905d35c2 Expose NASM variable in ccmake
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@725 632fc199-4ca6-4c93-a231-07263d6284db
2011-11-29 09:01:23 +00:00
DRC
1ca924a550 NASM automatically adds the current directory to the include path, but YASM doesn't, so we need to explicitly add it.
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@724 632fc199-4ca6-4c93-a231-07263d6284db
2011-11-29 08:58:27 +00:00
DRC
b56ae3d7fa 1.2.0
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@723 632fc199-4ca6-4c93-a231-07263d6284db
2011-11-29 08:53:32 +00:00
DRC
77fee43a02 git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@722 632fc199-4ca6-4c93-a231-07263d6284db 2011-11-01 17:14:22 +00:00
DRC
7bc3fb51e3 git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@721 632fc199-4ca6-4c93-a231-07263d6284db 2011-10-28 06:45:53 +00:00
DRC
7080ea3c16 git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@720 632fc199-4ca6-4c93-a231-07263d6284db 2011-10-28 06:45:06 +00:00
DRC
3c21b08ef1 git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@718 632fc199-4ca6-4c93-a231-07263d6284db 2011-10-28 06:25:13 +00:00
129 changed files with 2803 additions and 1216 deletions

View File

@@ -107,14 +107,14 @@ This will generate the following files under .libs/
62, 7, or 8.
libjpeg v7 or v8 Emulation
--------------------------
libjpeg v7 or v8 API/ABI Emulation
----------------------------------
Add --with-jpeg7 to the configure command line to build a version of
libjpeg-turbo that is compatible with libjpeg v7. Add --with-jpeg8 to the
configure command to build a version of libjpeg-turbo that is compatible with
libjpeg v8. See README-turbo.txt for more information on libjpeg v7 and v8
emulation.
libjpeg-turbo that is API/ABI-compatible with libjpeg v7. Add --with-jpeg8 to
the configure command to build a version of libjpeg-turbo that is
API/ABI-compatible with libjpeg v8. See README-turbo.txt for more information
on libjpeg v7 and v8 emulation.
Arithmetic Coding Support
@@ -203,7 +203,7 @@ installed.
Add
CFLAGS='-O3 -m32' LDFLAGS=-m32
--host i686-apple-darwin CFLAGS='-O3 -m32' LDFLAGS=-m32
to the configure command line.
@@ -228,7 +228,8 @@ MacPorts, must be installed.
Add
CFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \
--host i686-apple-darwin \
CFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \
-mmacosx-version-min=10.4 -O3 -m32' \
LDFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \
-mmacosx-version-min=10.4 -m32'
@@ -258,8 +259,8 @@ to the configure command line. NASM 2.07 or later from FreeBSD ports must be
installed.
Sun Studio
----------
Oracle Solaris Studio
---------------------
Add
@@ -268,7 +269,7 @@ Add
to the configure command line. libjpeg-turbo will automatically be built with
the maximum optimization level (-xO5) unless you override CFLAGS.
To build a 64-bit version of libjpeg-turbo using Sun Studio, add
To build a 64-bit version of libjpeg-turbo using Oracle Solaris Studio, add
--host x86_64-pc-solaris CC=cc CFLAGS='-xO5 -m64' LDFLAGS=-m64
@@ -492,14 +493,14 @@ NMake, remove "-DCMAKE_BUILD_TYPE=Release" (Debug builds are the default with
NMake.)
libjpeg v7 or v8 Emulation
--------------------------
libjpeg v7 or v8 API/ABI Emulation
-----------------------------------
Add "-DWITH_JPEG7=1" to the cmake command line to build a version of
libjpeg-turbo that is compatible with libjpeg v7. Add "-DWITH_JPEG8=1" to the
cmake command to build a version of libjpeg-turbo that is compatible with
libjpeg v8. See README-turbo.txt for more information on libjpeg v7 and v8
emulation.
libjpeg-turbo that is API/ABI-compatible with libjpeg v7. Add "-DWITH_JPEG8=1"
to the cmake command to build a version of libjpeg-turbo that is
API/ABI-compatible with libjpeg v8. See README-turbo.txt for more information
on libjpeg v7 and v8 emulation.
Arithmetic Coding Support
@@ -644,13 +645,32 @@ make dmg
make udmg [BUILDDIR32={32-bit build directory}]
On 64-bit OS X systems, this creates a version of the Macintosh package and
disk image which contains universal i386/x86-64 binaries. You should first
configure a 32-bit out-of-tree build of libjpeg-turbo, then configure a
64-bit out-of-tree build, then run 'make udmg' from the 64-bit build
directory. The build system will look for the 32-bit build under
{source_directory}/osxx86 by default, but you can override this by setting
the BUILDDIR32 variable on the make command line as shown above.
On 64-bit OS X systems, this creates a Macintosh package and disk image that
contains universal i386/x86-64 binaries. You should first configure a 32-bit
out-of-tree build of libjpeg-turbo, then configure a 64-bit out-of-tree
build, then run 'make udmg' from the 64-bit build directory. The build
system will look for the 32-bit build under {source_directory}/osxx86 by
default, but you can override this by setting the BUILDDIR32 variable on the
make command line as shown above.
make iosdmg [BUILDDIR32={32-bit build directory}] \
[BUILDDIRARMV6={ARM v6 build directory}] \
[BUILDDIRARMV7={ARM v7 build directory}] \
On OS X systems, this creates a Macintosh package and disk image in which the
libjpeg-turbo static libraries contain ARM architectures necessary to build
iOS applications. If building on an x86-64 system, the binaries will also
contain the i386 architecture, as with 'make udmg' above. You should first
configure ARM v6 and ARM v7 out-of-tree builds of libjpeg-turbo (see
"Building libjpeg-turbo for iOS" above.) If you are building an x86-64
version of libjpeg-turbo, you should configure a 32-bit out-of-tree build as
well. Next, build libjpeg-turbo as you would normally, using an out-of-tree
build. When it is built, run 'make iosdmg' from the build directory. The
build system will look for the ARM v6 build under {source_directory}/iosarmv6
by default, the ARM v7 build under {source_directory}/iosarmv7 by default,
and (if applicable) the 32-bit build under {source_directory}/osxx86 by
default, but you can override this by setting the BUILDDIR32, BUILDDIRARMV6,
and/or BUILDDIRARMV7 variables on the make command line as shown above.
make sunpkg
@@ -658,7 +678,7 @@ make sunpkg
make csunpkg [BUILDDIR32={32-bit build directory}]
On 64-bit Solaris systems, this creates a combined package which contains
On 64-bit Solaris systems, this creates a combined package that contains
both 32-bit and 64-bit libraries. You should first configure a 32-bit
out-of-tree build of libjpeg-turbo, then configure a 64-bit out-of-tree
build, then run 'make csunpkg' from the 64-bit build directory. The build
@@ -694,3 +714,30 @@ configuration you built (such as {build_directory}\Debug\ or
Building a Windows installer requires the Nullsoft Install System
(http://nsis.sourceforge.net/.) makensis.exe should be in your PATH.
*******************************************************************************
** Regression testing
*******************************************************************************
The most common way to test libjpeg-turbo is by invoking 'make test' on
Unix/Linux platforms or 'ctest' on Windows platforms, once the build has
completed. This runs a series of tests to ensure that mathematical
compatibility has been maintained between libjpeg-turbo and libjpeg v6b. This
also invokes the TurboJPEG unit tests, which ensure that the colorspace
extensions, YUV encoding, decompression scaling, and other features of the
TurboJPEG C and Java APIs are working properly (and, by extension, that the
equivalent features of the underlying libjpeg API are also working.)
Invoking 'make testclean' or 'nmake testclean' (if using NMake) or building
the 'testclean' target (if using the Visual Studio IDE) will clean up the
output images generated by 'make test'.
On Unix/Linux platforms, more extensive tests of the TurboJPEG/OSS C and Java
wrappers can be run by invoking 'make tjtest'. These extended TurboJPEG tests
essentially iterate through all of the available features of the TurboJPEG APIs
that are not covered by the TurboJPEG unit tests (this includes the lossless
transform options) and compare the images generated by each feature to images
generated using the equivalent feature in the libjpeg API. The extended
TurboJPEG tests are meant to test for regressions in the TurboJPEG wrappers,
not in the underlying libjpeg-turbo library.

View File

@@ -5,7 +5,7 @@
cmake_minimum_required(VERSION 2.6)
project(libjpeg-turbo C)
set(VERSION 1.1.90)
set(VERSION 1.2.1)
if(MINGW OR CYGWIN)
execute_process(COMMAND "date" "+%Y%m%d" OUTPUT_VARIABLE BUILD)
@@ -252,122 +252,122 @@ endif()
add_test(tjunittest tjunittest)
add_test(tjunittest-alloc tjunittest -alloc)
add_test(tjunittest-yuv tjunittest -yuv)
add_test(cjpeg-int sharedlib/cjpeg -dct int -outfile testoutint.jpg ${CMAKE_SOURCE_DIR}/testorig.ppm)
add_test(cjpeg-int-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimgint.jpg testoutint.jpg)
add_test(cjpeg-fast sharedlib/cjpeg -dct fast -opt -outfile testoutfst.jpg ${CMAKE_SOURCE_DIR}/testorig.ppm)
add_test(cjpeg-fast-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimgfst.jpg testoutfst.jpg)
add_test(cjpeg-fast-100 sharedlib/cjpeg -dct fast -quality 100 -opt -outfile testoutfst100.jpg ${CMAKE_SOURCE_DIR}/testorig.ppm)
add_test(cjpeg-fast-100-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimgfst100.jpg testoutfst100.jpg)
add_test(cjpeg-float sharedlib/cjpeg -dct float -outfile testoutflt.jpg ${CMAKE_SOURCE_DIR}/testorig.ppm)
add_test(cjpeg-int sharedlib/cjpeg -dct int -outfile testoutint.jpg ${CMAKE_SOURCE_DIR}/testimages/testorig.ppm)
add_test(cjpeg-int-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testimgint.jpg testoutint.jpg)
add_test(cjpeg-fast sharedlib/cjpeg -dct fast -opt -outfile testoutfst.jpg ${CMAKE_SOURCE_DIR}/testimages/testorig.ppm)
add_test(cjpeg-fast-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testimgfst.jpg testoutfst.jpg)
add_test(cjpeg-fast-100 sharedlib/cjpeg -dct fast -quality 100 -opt -outfile testoutfst100.jpg ${CMAKE_SOURCE_DIR}/testimages/testorig.ppm)
add_test(cjpeg-fast-100-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testimgfst100.jpg testoutfst100.jpg)
add_test(cjpeg-float sharedlib/cjpeg -dct float -outfile testoutflt.jpg ${CMAKE_SOURCE_DIR}/testimages/testorig.ppm)
if(WITH_SIMD)
add_test(cjpeg-float-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimgflt.jpg testoutflt.jpg)
add_test(cjpeg-float-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testimgflt.jpg testoutflt.jpg)
else()
add_test(cjpeg-float-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimgflt-nosimd.jpg testoutflt.jpg)
add_test(cjpeg-float-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testimgflt-nosimd.jpg testoutflt.jpg)
endif()
add_test(cjpeg-int-gray sharedlib/cjpeg -dct int -grayscale -outfile testoutgray.jpg ${CMAKE_SOURCE_DIR}/testorig.ppm)
add_test(cjpeg-int-gray-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimggray.jpg testoutgray.jpg)
add_test(djpeg-int sharedlib/djpeg -dct int -fast -ppm -outfile testoutint.ppm ${CMAKE_SOURCE_DIR}/testorig.jpg)
add_test(djpeg-int-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimgint.ppm testoutint.ppm)
add_test(djpeg-fast sharedlib/djpeg -dct fast -ppm -outfile testoutfst.ppm ${CMAKE_SOURCE_DIR}/testorig.jpg)
add_test(djpeg-fast-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimgfst.ppm testoutfst.ppm)
add_test(djpeg-float sharedlib/djpeg -dct float -ppm -outfile testoutflt.ppm ${CMAKE_SOURCE_DIR}/testorig.jpg)
add_test(cjpeg-int-gray sharedlib/cjpeg -dct int -grayscale -outfile testoutgray.jpg ${CMAKE_SOURCE_DIR}/testimages/testorig.ppm)
add_test(cjpeg-int-gray-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testimggray.jpg testoutgray.jpg)
add_test(djpeg-int sharedlib/djpeg -dct int -fast -ppm -outfile testoutint.ppm ${CMAKE_SOURCE_DIR}/testimages/testorig.jpg)
add_test(djpeg-int-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testimgint.ppm testoutint.ppm)
add_test(djpeg-fast sharedlib/djpeg -dct fast -ppm -outfile testoutfst.ppm ${CMAKE_SOURCE_DIR}/testimages/testorig.jpg)
add_test(djpeg-fast-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testimgfst.ppm testoutfst.ppm)
add_test(djpeg-float sharedlib/djpeg -dct float -ppm -outfile testoutflt.ppm ${CMAKE_SOURCE_DIR}/testimages/testorig.jpg)
if(WITH_SIMD)
add_test(djpeg-float-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimgflt.ppm testoutflt.ppm)
add_test(djpeg-float-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testimgflt.ppm testoutflt.ppm)
else()
add_test(djpeg-float-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testorig.ppm testoutflt.ppm)
add_test(djpeg-float-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testorig.ppm testoutflt.ppm)
endif()
add_test(djpeg-int-1_2 sharedlib/djpeg -dct int -scale 1/2 -ppm -outfile testoutint1_2.ppm ${CMAKE_SOURCE_DIR}/testorig.jpg)
add_test(djpeg-int-1_2-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimgint1_2.ppm testoutint1_2.ppm)
add_test(djpeg-fast-1_2 sharedlib/djpeg -dct fast -scale 1/2 -ppm -outfile testoutfst1_2.ppm ${CMAKE_SOURCE_DIR}/testorig.jpg)
add_test(djpeg-fast-1_2-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimgfst1_2.ppm testoutfst1_2.ppm)
add_test(djpeg-int-1_4 sharedlib/djpeg -dct int -scale 1/4 -ppm -outfile testoutint1_4.ppm ${CMAKE_SOURCE_DIR}/testorig.jpg)
add_test(djpeg-int-1_4-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimgint1_4.ppm testoutint1_4.ppm)
add_test(djpeg-fast-1_4 sharedlib/djpeg -dct fast -scale 1/4 -ppm -outfile testoutfst1_4.ppm ${CMAKE_SOURCE_DIR}/testorig.jpg)
add_test(djpeg-fast-1_4-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimgfst1_4.ppm testoutfst1_4.ppm)
add_test(djpeg-int-1_8 sharedlib/djpeg -dct int -scale 1/8 -ppm -outfile testoutint1_8.ppm ${CMAKE_SOURCE_DIR}/testorig.jpg)
add_test(djpeg-int-1_8-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimgint1_8.ppm testoutint1_8.ppm)
add_test(djpeg-fast-1_8 sharedlib/djpeg -dct fast -scale 1/8 -ppm -outfile testoutfst1_8.ppm ${CMAKE_SOURCE_DIR}/testorig.jpg)
add_test(djpeg-fast-1_8-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimgfst1_8.ppm testoutfst1_8.ppm)
add_test(djpeg-256 sharedlib/djpeg -dct int -bmp -colors 256 -outfile testout.bmp ${CMAKE_SOURCE_DIR}/testorig.jpg)
add_test(djpeg-256-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimg.bmp testout.bmp)
add_test(cjpeg-prog sharedlib/cjpeg -dct int -progressive -outfile testoutp.jpg ${CMAKE_SOURCE_DIR}/testorig.ppm)
add_test(cjpeg-prog-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimgp.jpg testoutp.jpg)
add_test(djpeg-int-1_2 sharedlib/djpeg -dct int -scale 1/2 -ppm -outfile testoutint1_2.ppm ${CMAKE_SOURCE_DIR}/testimages/testorig.jpg)
add_test(djpeg-int-1_2-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testimgint1_2.ppm testoutint1_2.ppm)
add_test(djpeg-fast-1_2 sharedlib/djpeg -dct fast -scale 1/2 -ppm -outfile testoutfst1_2.ppm ${CMAKE_SOURCE_DIR}/testimages/testorig.jpg)
add_test(djpeg-fast-1_2-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testimgfst1_2.ppm testoutfst1_2.ppm)
add_test(djpeg-int-1_4 sharedlib/djpeg -dct int -scale 1/4 -ppm -outfile testoutint1_4.ppm ${CMAKE_SOURCE_DIR}/testimages/testorig.jpg)
add_test(djpeg-int-1_4-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testimgint1_4.ppm testoutint1_4.ppm)
add_test(djpeg-fast-1_4 sharedlib/djpeg -dct fast -scale 1/4 -ppm -outfile testoutfst1_4.ppm ${CMAKE_SOURCE_DIR}/testimages/testorig.jpg)
add_test(djpeg-fast-1_4-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testimgfst1_4.ppm testoutfst1_4.ppm)
add_test(djpeg-int-1_8 sharedlib/djpeg -dct int -scale 1/8 -ppm -outfile testoutint1_8.ppm ${CMAKE_SOURCE_DIR}/testimages/testorig.jpg)
add_test(djpeg-int-1_8-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testimgint1_8.ppm testoutint1_8.ppm)
add_test(djpeg-fast-1_8 sharedlib/djpeg -dct fast -scale 1/8 -ppm -outfile testoutfst1_8.ppm ${CMAKE_SOURCE_DIR}/testimages/testorig.jpg)
add_test(djpeg-fast-1_8-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testimgfst1_8.ppm testoutfst1_8.ppm)
add_test(djpeg-256 sharedlib/djpeg -dct int -bmp -colors 256 -outfile testout.bmp ${CMAKE_SOURCE_DIR}/testimages/testorig.jpg)
add_test(djpeg-256-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testimg.bmp testout.bmp)
add_test(cjpeg-prog sharedlib/cjpeg -dct int -progressive -outfile testoutp.jpg ${CMAKE_SOURCE_DIR}/testimages/testorig.ppm)
add_test(cjpeg-prog-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testimgp.jpg testoutp.jpg)
add_test(jpegtran-prog sharedlib/jpegtran -outfile testoutt.jpg testoutp.jpg)
add_test(jpegtran-prog-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimgint.jpg testoutt.jpg)
add_test(jpegtran-prog-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testimgint.jpg testoutt.jpg)
if(WITH_ARITH_ENC)
add_test(cjpeg-ari sharedlib/cjpeg -dct int -arithmetic -outfile testoutari.jpg ${CMAKE_SOURCE_DIR}/testorig.ppm)
add_test(cjpeg-ari-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimgari.jpg testoutari.jpg)
add_test(jpegtran-toari sharedlib/jpegtran -arithmetic -outfile testouta.jpg ${CMAKE_SOURCE_DIR}/testimgint.jpg)
add_test(jpegtran-toari-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimgari.jpg testouta.jpg)
add_test(cjpeg-ari sharedlib/cjpeg -dct int -arithmetic -outfile testoutari.jpg ${CMAKE_SOURCE_DIR}/testimages/testorig.ppm)
add_test(cjpeg-ari-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testimgari.jpg testoutari.jpg)
add_test(jpegtran-toari sharedlib/jpegtran -arithmetic -outfile testouta.jpg ${CMAKE_SOURCE_DIR}/testimages/testimgint.jpg)
add_test(jpegtran-toari-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testimgari.jpg testouta.jpg)
endif()
if(WITH_ARITH_DEC)
add_test(djpeg-ari sharedlib/djpeg -dct int -fast -ppm -outfile testoutari.ppm ${CMAKE_SOURCE_DIR}/testimgari.jpg)
add_test(djpeg-ari-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimgari.ppm testoutari.ppm)
add_test(jpegtran-fromari sharedlib/jpegtran -outfile testouta.jpg ${CMAKE_SOURCE_DIR}/testimgari.jpg)
add_test(jpegtran-fromari-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimgint.jpg testouta.jpg)
add_test(djpeg-ari sharedlib/djpeg -dct int -fast -ppm -outfile testoutari.ppm ${CMAKE_SOURCE_DIR}/testimages/testimgari.jpg)
add_test(djpeg-ari-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testimgari.ppm testoutari.ppm)
add_test(jpegtran-fromari sharedlib/jpegtran -outfile testouta.jpg ${CMAKE_SOURCE_DIR}/testimages/testimgari.jpg)
add_test(jpegtran-fromari-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testimgint.jpg testouta.jpg)
endif()
add_test(jpegtran-crop sharedlib/jpegtran -crop 120x90+20+50 -transpose -perfect -outfile testoutcrop.jpg ${CMAKE_SOURCE_DIR}/testorig.jpg)
add_test(jpegtran-crop-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimgcrop.jpg testoutcrop.jpg)
add_test(jpegtran-crop sharedlib/jpegtran -crop 120x90+20+50 -transpose -perfect -outfile testoutcrop.jpg ${CMAKE_SOURCE_DIR}/testimages/testorig.jpg)
add_test(jpegtran-crop-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testimgcrop.jpg testoutcrop.jpg)
add_test(tjunittest-static tjunittest-static)
add_test(tjunittest-static-alloc tjunittest-static -alloc)
add_test(tjunittest-static-yuv tjunittest-static -yuv)
add_test(cjpeg-static-int cjpeg-static -dct int -outfile testoutint.jpg ${CMAKE_SOURCE_DIR}/testorig.ppm)
add_test(cjpeg-static-int-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimgint.jpg testoutint.jpg)
add_test(cjpeg-static-fast cjpeg-static -dct fast -opt -outfile testoutfst.jpg ${CMAKE_SOURCE_DIR}/testorig.ppm)
add_test(cjpeg-static-fast-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimgfst.jpg testoutfst.jpg)
add_test(cjpeg-static-fast-100 cjpeg-static -dct fast -quality 100 -opt -outfile testoutfst100.jpg ${CMAKE_SOURCE_DIR}/testorig.ppm)
add_test(cjpeg-static-fast-100-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimgfst100.jpg testoutfst100.jpg)
add_test(cjpeg-static-float cjpeg-static -dct float -outfile testoutflt.jpg ${CMAKE_SOURCE_DIR}/testorig.ppm)
add_test(cjpeg-static-int cjpeg-static -dct int -outfile testoutint.jpg ${CMAKE_SOURCE_DIR}/testimages/testorig.ppm)
add_test(cjpeg-static-int-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testimgint.jpg testoutint.jpg)
add_test(cjpeg-static-fast cjpeg-static -dct fast -opt -outfile testoutfst.jpg ${CMAKE_SOURCE_DIR}/testimages/testorig.ppm)
add_test(cjpeg-static-fast-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testimgfst.jpg testoutfst.jpg)
add_test(cjpeg-static-fast-100 cjpeg-static -dct fast -quality 100 -opt -outfile testoutfst100.jpg ${CMAKE_SOURCE_DIR}/testimages/testorig.ppm)
add_test(cjpeg-static-fast-100-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testimgfst100.jpg testoutfst100.jpg)
add_test(cjpeg-static-float cjpeg-static -dct float -outfile testoutflt.jpg ${CMAKE_SOURCE_DIR}/testimages/testorig.ppm)
if(WITH_SIMD)
add_test(cjpeg-static-float-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimgflt.jpg testoutflt.jpg)
add_test(cjpeg-static-float-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testimgflt.jpg testoutflt.jpg)
else()
add_test(cjpeg-static-float-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimgflt-nosimd.jpg testoutflt.jpg)
add_test(cjpeg-static-float-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testimgflt-nosimd.jpg testoutflt.jpg)
endif()
add_test(cjpeg-static-int-gray cjpeg-static -dct int -grayscale -outfile testoutgray.jpg ${CMAKE_SOURCE_DIR}/testorig.ppm)
add_test(cjpeg-static-int-gray-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimggray.jpg testoutgray.jpg)
add_test(djpeg-static-int djpeg-static -dct int -fast -ppm -outfile testoutint.ppm ${CMAKE_SOURCE_DIR}/testorig.jpg)
add_test(djpeg-static-int-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimgint.ppm testoutint.ppm)
add_test(djpeg-static-fast djpeg-static -dct fast -ppm -outfile testoutfst.ppm ${CMAKE_SOURCE_DIR}/testorig.jpg)
add_test(djpeg-static-fast-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimgfst.ppm testoutfst.ppm)
add_test(djpeg-static-float djpeg-static -dct float -ppm -outfile testoutflt.ppm ${CMAKE_SOURCE_DIR}/testorig.jpg)
add_test(cjpeg-static-int-gray cjpeg-static -dct int -grayscale -outfile testoutgray.jpg ${CMAKE_SOURCE_DIR}/testimages/testorig.ppm)
add_test(cjpeg-static-int-gray-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testimggray.jpg testoutgray.jpg)
add_test(djpeg-static-int djpeg-static -dct int -fast -ppm -outfile testoutint.ppm ${CMAKE_SOURCE_DIR}/testimages/testorig.jpg)
add_test(djpeg-static-int-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testimgint.ppm testoutint.ppm)
add_test(djpeg-static-fast djpeg-static -dct fast -ppm -outfile testoutfst.ppm ${CMAKE_SOURCE_DIR}/testimages/testorig.jpg)
add_test(djpeg-static-fast-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testimgfst.ppm testoutfst.ppm)
add_test(djpeg-static-float djpeg-static -dct float -ppm -outfile testoutflt.ppm ${CMAKE_SOURCE_DIR}/testimages/testorig.jpg)
if(WITH_SIMD)
add_test(djpeg-static-float-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimgflt.ppm testoutflt.ppm)
add_test(djpeg-static-float-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testimgflt.ppm testoutflt.ppm)
else()
add_test(djpeg-static-float-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testorig.ppm testoutflt.ppm)
add_test(djpeg-static-float-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testorig.ppm testoutflt.ppm)
endif()
add_test(djpeg-static-int-1_2 djpeg-static -dct int -scale 1/2 -ppm -outfile testoutint1_2.ppm ${CMAKE_SOURCE_DIR}/testorig.jpg)
add_test(djpeg-static-int-1_2-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimgint1_2.ppm testoutint1_2.ppm)
add_test(djpeg-static-fast-1_2 djpeg-static -dct fast -scale 1/2 -ppm -outfile testoutfst1_2.ppm ${CMAKE_SOURCE_DIR}/testorig.jpg)
add_test(djpeg-static-fast-1_2-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimgfst1_2.ppm testoutfst1_2.ppm)
add_test(djpeg-static-int-1_4 djpeg-static -dct int -scale 1/4 -ppm -outfile testoutint1_4.ppm ${CMAKE_SOURCE_DIR}/testorig.jpg)
add_test(djpeg-static-int-1_4-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimgint1_4.ppm testoutint1_4.ppm)
add_test(djpeg-static-fast-1_4 djpeg-static -dct fast -scale 1/4 -ppm -outfile testoutfst1_4.ppm ${CMAKE_SOURCE_DIR}/testorig.jpg)
add_test(djpeg-static-fast-1_4-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimgfst1_4.ppm testoutfst1_4.ppm)
add_test(djpeg-static-int-1_8 djpeg-static -dct int -scale 1/8 -ppm -outfile testoutint1_8.ppm ${CMAKE_SOURCE_DIR}/testorig.jpg)
add_test(djpeg-static-int-1_8-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimgint1_8.ppm testoutint1_8.ppm)
add_test(djpeg-static-fast-1_8 djpeg-static -dct fast -scale 1/8 -ppm -outfile testoutfst1_8.ppm ${CMAKE_SOURCE_DIR}/testorig.jpg)
add_test(djpeg-static-fast-1_8-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimgfst1_8.ppm testoutfst1_8.ppm)
add_test(djpeg-static-256 djpeg-static -dct int -bmp -colors 256 -outfile testout.bmp ${CMAKE_SOURCE_DIR}/testorig.jpg)
add_test(djpeg-static-256-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimg.bmp testout.bmp)
add_test(cjpeg-static-prog cjpeg-static -dct int -progressive -outfile testoutp.jpg ${CMAKE_SOURCE_DIR}/testorig.ppm)
add_test(cjpeg-static-prog-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimgp.jpg testoutp.jpg)
add_test(djpeg-static-int-1_2 djpeg-static -dct int -scale 1/2 -ppm -outfile testoutint1_2.ppm ${CMAKE_SOURCE_DIR}/testimages/testorig.jpg)
add_test(djpeg-static-int-1_2-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testimgint1_2.ppm testoutint1_2.ppm)
add_test(djpeg-static-fast-1_2 djpeg-static -dct fast -scale 1/2 -ppm -outfile testoutfst1_2.ppm ${CMAKE_SOURCE_DIR}/testimages/testorig.jpg)
add_test(djpeg-static-fast-1_2-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testimgfst1_2.ppm testoutfst1_2.ppm)
add_test(djpeg-static-int-1_4 djpeg-static -dct int -scale 1/4 -ppm -outfile testoutint1_4.ppm ${CMAKE_SOURCE_DIR}/testimages/testorig.jpg)
add_test(djpeg-static-int-1_4-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testimgint1_4.ppm testoutint1_4.ppm)
add_test(djpeg-static-fast-1_4 djpeg-static -dct fast -scale 1/4 -ppm -outfile testoutfst1_4.ppm ${CMAKE_SOURCE_DIR}/testimages/testorig.jpg)
add_test(djpeg-static-fast-1_4-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testimgfst1_4.ppm testoutfst1_4.ppm)
add_test(djpeg-static-int-1_8 djpeg-static -dct int -scale 1/8 -ppm -outfile testoutint1_8.ppm ${CMAKE_SOURCE_DIR}/testimages/testorig.jpg)
add_test(djpeg-static-int-1_8-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testimgint1_8.ppm testoutint1_8.ppm)
add_test(djpeg-static-fast-1_8 djpeg-static -dct fast -scale 1/8 -ppm -outfile testoutfst1_8.ppm ${CMAKE_SOURCE_DIR}/testimages/testorig.jpg)
add_test(djpeg-static-fast-1_8-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testimgfst1_8.ppm testoutfst1_8.ppm)
add_test(djpeg-static-256 djpeg-static -dct int -bmp -colors 256 -outfile testout.bmp ${CMAKE_SOURCE_DIR}/testimages/testorig.jpg)
add_test(djpeg-static-256-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testimg.bmp testout.bmp)
add_test(cjpeg-static-prog cjpeg-static -dct int -progressive -outfile testoutp.jpg ${CMAKE_SOURCE_DIR}/testimages/testorig.ppm)
add_test(cjpeg-static-prog-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testimgp.jpg testoutp.jpg)
add_test(jpegtran-static-prog jpegtran-static -outfile testoutt.jpg testoutp.jpg)
add_test(jpegtran-static-prog-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimgint.jpg testoutt.jpg)
add_test(jpegtran-static-prog-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testimgint.jpg testoutt.jpg)
if(WITH_ARITH_ENC)
add_test(cjpeg-static-ari cjpeg-static -dct int -arithmetic -outfile testoutari.jpg ${CMAKE_SOURCE_DIR}/testorig.ppm)
add_test(cjpeg-static-ari-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimgari.jpg testoutari.jpg)
add_test(jpegtran-static-toari jpegtran-static -arithmetic -outfile testouta.jpg ${CMAKE_SOURCE_DIR}/testimgint.jpg)
add_test(jpegtran-static-toari-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimgari.jpg testouta.jpg)
add_test(cjpeg-static-ari cjpeg-static -dct int -arithmetic -outfile testoutari.jpg ${CMAKE_SOURCE_DIR}/testimages/testorig.ppm)
add_test(cjpeg-static-ari-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testimgari.jpg testoutari.jpg)
add_test(jpegtran-static-toari jpegtran-static -arithmetic -outfile testouta.jpg ${CMAKE_SOURCE_DIR}/testimages/testimgint.jpg)
add_test(jpegtran-static-toari-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testimgari.jpg testouta.jpg)
endif()
if(WITH_ARITH_DEC)
add_test(djpeg-static-ari djpeg-static -dct int -fast -ppm -outfile testoutari.ppm ${CMAKE_SOURCE_DIR}/testimgari.jpg)
add_test(djpeg-static-ari-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimgari.ppm testoutari.ppm)
add_test(jpegtran-static-fromari jpegtran-static -outfile testouta.jpg ${CMAKE_SOURCE_DIR}/testimgari.jpg)
add_test(jpegtran-static-fromari-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimgint.jpg testouta.jpg)
add_test(djpeg-static-ari djpeg-static -dct int -fast -ppm -outfile testoutari.ppm ${CMAKE_SOURCE_DIR}/testimages/testimgari.jpg)
add_test(djpeg-static-ari-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testimgari.ppm testoutari.ppm)
add_test(jpegtran-static-fromari jpegtran-static -outfile testouta.jpg ${CMAKE_SOURCE_DIR}/testimages/testimgari.jpg)
add_test(jpegtran-static-fromari-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testimgint.jpg testouta.jpg)
endif()
add_test(jpegtran-static-crop jpegtran-static -crop 120x90+20+50 -transpose -perfect -outfile testoutcrop.jpg ${CMAKE_SOURCE_DIR}/testorig.jpg)
add_test(jpegtran-static-crop-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimgcrop.jpg testoutcrop.jpg)
add_test(jpegtran-static-crop jpegtran-static -crop 120x90+20+50 -transpose -perfect -outfile testoutcrop.jpg ${CMAKE_SOURCE_DIR}/testimages/testorig.jpg)
add_test(jpegtran-static-crop-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testimgcrop.jpg testoutcrop.jpg)
add_custom_target(testclean COMMAND ${CMAKE_COMMAND} -P
${CMAKE_SOURCE_DIR}/cmakescripts/testclean.cmake)
@@ -419,9 +419,10 @@ install(TARGETS jpeg-static turbojpeg turbojpeg-static rdjpgcom wrjpgcom tjbench
RUNTIME DESTINATION bin
)
install(FILES ${CMAKE_SOURCE_DIR}/LGPL.txt ${CMAKE_SOURCE_DIR}/LICENSE.txt
${CMAKE_SOURCE_DIR}/README ${CMAKE_SOURCE_DIR}/README-turbo.txt
${CMAKE_SOURCE_DIR}/libjpeg.txt ${CMAKE_SOURCE_DIR}/usage.txt
install(FILES ${CMAKE_SOURCE_DIR}/README ${CMAKE_SOURCE_DIR}/README-turbo.txt
${CMAKE_SOURCE_DIR}/example.c ${CMAKE_SOURCE_DIR}/libjpeg.txt
${CMAKE_SOURCE_DIR}/structure.txt ${CMAKE_SOURCE_DIR}/usage.txt
${CMAKE_SOURCE_DIR}/wizard.txt
DESTINATION doc)
install(FILES ${CMAKE_BINARY_DIR}/jconfig.h ${CMAKE_SOURCE_DIR}/jerror.h

View File

@@ -1,24 +1,112 @@
1.2.1
=====
[1] Creating or decoding a JPEG file that uses the RGB colorspace should now
properly work when the input or output colorspace is one of the libjpeg-turbo
colorspace extensions.
[2] When libjpeg-turbo was built without SIMD support and merged (non-fancy)
upsampling was used along with an alpha-enabled colorspace during
decompression, the unused byte of the decompressed pixels was not being set to
0xFF. This has been fixed. TJUnitTest has also been extended to test for the
correct behavior of the colorspace extensions when merged upsampling is used.
[3] Fixed a bug whereby the libjpeg-turbo SSE2 SIMD code would not preserve the
upper 64 bits of xmm6 and xmm7 on Win64 platforms, which violated the Win64
calling conventions.
[4] Fixed a regression caused by 1.2.0[6] whereby decompressing corrupt JPEG
images (specifically, images in which the component count was erroneously set
to a large value) would cause libjpeg-turbo to segfault.
[5] Worked around a severe performance issue with "Bobcat" (AMD Embedded APU)
processors. The MASKMOVDQU instruction, which was used by the libjpeg-turbo
SSE2 SIMD code, is apparently implemented in microcode on AMD processors, and
it is painfully slow on Bobcat processors in particular. Eliminating the use
of this instruction improved performance by an order of magnitude on Bobcat
processors and by a small amount (typically 5%) on AMD desktop processors.
[6] Added SIMD acceleration for performing 4:2:2 upsampling on NEON-capable ARM
platforms. This speeds up the decompression of 4:2:2 JPEGs by 20-25% on such
platforms.
[7] Fixed a regression caused by 1.2.0[2] whereby, on Linux/x86 platforms
running the 32-bit SSE2 SIMD code in libjpeg-turbo, decompressing a 4:2:0 or
4:2:2 JPEG image into a 32-bit (RGBX, BGRX, etc.) buffer without using fancy
upsampling would produce several incorrect columns of pixels at the right-hand
side of the output image if each row in the output image was not evenly
divisible by 16 bytes.
[8] Fixed an issue whereby attempting to build the SIMD extensions with Xcode
4.3 on OS X platforms would cause NASM to return numerous errors of the form
"'%define' expects a macro identifier".
[9] Added flags to the TurboJPEG API that allow the caller to force the use of
either the fast or the accurate DCT/IDCT algorithms in the underlying codec.
1.2.0
=====
[1] Fixed build issue with YASM on Unix systems (the libjpeg-turbo build system
was not adding the current directory to the assembler include path, so YASM
was not able to find jsimdcfg.inc.)
[2] Fixed out-of-bounds read in SSE2 SIMD code that occurred when decompressing
a JPEG image to a bitmap buffer whose size was not a multiple of 16 bytes.
This was more of an annoyance than an actual bug, since it did not cause any
actual run-time problems, but the issue showed up when running libjpeg-turbo in
valgrind. See http://crbug.com/72399 for more information.
[3] Added a compile-time macro (LIBJPEG_TURBO_VERSION) that can be used to
check the version of libjpeg-turbo against which an application was compiled.
[4] Added new RGBA/BGRA/ABGR/ARGB colorspace extension constants (libjpeg API)
and pixel formats (TurboJPEG API), which allow applications to specify that,
when decompressing to a 4-component RGB buffer, the unused byte should be set
to 0xFF so that it can be interpreted as an opaque alpha channel.
[5] Fixed regression issue whereby DevIL failed to build against libjpeg-turbo
because libjpeg-turbo's distributed version of jconfig.h contained an INLINE
macro, which conflicted with a similar macro in DevIL. This macro is used only
internally when building libjpeg-turbo, so it was moved into config.h.
[6] libjpeg-turbo will now correctly decompress erroneous CMYK/YCCK JPEGs whose
K component is assigned a component ID of 1 instead of 4. Although these files
are in violation of the spec, other JPEG implementations handle them
correctly.
[7] Added ARM v6 and ARM v7 architectures to libjpeg.a and libturbojpeg.a in
the official OS X distribution package, so that those libraries can be used to
build both OS X and iOS applications.
1.1.90 (1.2 beta1)
==================
[1] Added a JNI wrapper for TurboJPEG/OSS. See java/README for more details.
[1] Added a Java wrapper for the TurboJPEG API. See java/README for more
details.
[2] TurboJPEG/OSS can now scale down images during decompression.
[2] The TurboJPEG API can now be used to scale down images during
decompression.
[3] Added SIMD routines for RGB-to-grayscale color conversion, which
significantly improves the performance of grayscale JPEG compression from an
RGB source image.
[4] Improved performance for non-x86 machines.
[4] Improved the performance of the C color conversion routines, which are used
on platforms for which SIMD acceleration is not available.
[5] Added a function to the TurboJPEG API which performs lossless transforms.
This function uses the same back end as jpegtran, but it performs transcoding
entirely in memory and allows multiple transforms and/or crop operations to be
batched together, so the source coefficients only need to be read once. This
is useful when generating image tiles from a single source JPEG.
[5] Added a function to the TurboJPEG API that performs lossless transforms.
This function is implemented using the same back end as jpegtran, but it
performs transcoding entirely in memory and allows multiple transforms and/or
crop operations to be batched together, so the source coefficients only need to
be read once. This is useful when generating image tiles from a single source
JPEG.
[6] Modified jpgtest to benchmark the new scaled decompression and lossless
transform features in TurboJPEG/OSS.
[6] Added tests for the new TurboJPEG scaled decompression and lossless
transform features to tjbench (the TurboJPEG benchmark, formerly called
"jpgtest".)
[7] Added support for 4:4:0 (transposed 4:2:2) subsampling in TurboJPEG, which
was necessary in order for it to read 4:2:2 JPEG files that had been losslessly
@@ -32,10 +120,13 @@ libjpeg-turbo, in its entirety, to be re-licensed under a BSD-style license.
[10] Added SIMD acceleration for ARM Linux and iOS platforms that support
NEON instructions.
[11] Refactored the TurboJPEG C API so that it uses pixel formats to define the
size and component order of the uncompressed source/destination images as well
as uses the libjpeg memory source and destination managers. The latter allows
the TurboJPEG compressor to grow the JPEG buffer as necessary.
[11] Refactored the TurboJPEG C API and documented it using Doxygen. The
TurboJPEG 1.2 API uses pixel formats to define the size and component order of
the uncompressed source/destination images, and it includes a more efficient
version of TJBUFSIZE() that computes a worst-case JPEG size based on the level
of chrominance subsampling. The refactored implementation of TurboJPEG/OSS
now uses the libjpeg memory source and destination managers, which allows the
TurboJPEG compressor to grow the JPEG buffer as necessary.
[12] Eliminated errors in the output of jpegtran on Windows that occurred when
the application was invoked using I/O redirection
@@ -54,13 +145,10 @@ based on whether libjpeg v7 or v8 emulation was enabled.
fail to compile if the Windows system headers were included before jpeglib.h.
This issue was caused by a conflict in the definition of the INT32 type.
[15] Implemented a more efficient version of TJBUFSIZE() which computes a
worst-case JPEG size based on the level of chrominance subsampling.
[16] Fixed 32-bit supplementary package for amd64 Debian systems which was
[15] Fixed 32-bit supplementary package for amd64 Debian systems, which was
broken by enhancements to the packaging system in 1.1.
[17] When decompressing a JPEG image using an output colorspace of
[16] When decompressing a JPEG image using an output colorspace of
JCS_EXT_RGBX, JCS_EXT_BGRX, JCS_EXT_XBGR, or JCS_EXT_XRGB, libjpeg-turbo will
now set the unused byte to 0xFF, which allows applications to interpret that
byte as an alpha channel (0xFF = opaque).
@@ -143,7 +231,8 @@ README-turbo.txt for more details. This feature was sponsored by CamTrace SAS.
[2] Created a new CMake-based build system for the Visual C++ and MinGW builds.
[3] TurboJPEG/OSS can now compress from/decompress to grayscale bitmaps.
[3] Grayscale bitmaps can now be compressed from/decompressed to using the
TurboJPEG API.
[4] jpgtest can now be used to test decompression performance with existing
JPEG images.
@@ -159,11 +248,12 @@ when the library is built with libjpeg v6b emulation.
[7] Added arithmetic encoding and decoding support (can be disabled with
configure or CMake options)
[8] Added a TJ_YUV flag to TurboJPEG/OSS which causes both the compressor and
decompressor to output planar YUV images.
[8] Added a TJ_YUV flag to the TurboJPEG API, which causes both the compressor
and decompressor to output planar YUV images.
[9] Added an extended version of tjDecompressHeader() to TurboJPEG/OSS which
allows the caller to determine the type of subsampling used in a JPEG image.
[9] Added an extended version of tjDecompressHeader() to the TurboJPEG API,
which allows the caller to determine the type of subsampling used in a JPEG
image.
[10] Added further protections against invalid Huffman codes.
@@ -175,7 +265,7 @@ allows the caller to determine the type of subsampling used in a JPEG image.
from a corrupt JPEG image.) Previously, these would cause libjpeg-turbo to
crash under certain circumstances.
[2] Fixed typo in SIMD dispatch routines which was causing 4:2:2 upsampling to
[2] Fixed typo in SIMD dispatch routines that was causing 4:2:2 upsampling to
be used instead of 4:2:0 when decompressing JPEG images using SSE2 code.
[3] configure script will now automatically determine whether the
@@ -196,7 +286,7 @@ static libraries can always be found in /opt/libjpeg-turbo/lib32, and the
[3] The Unix/Linux distribution packages now include the libjpeg run-time
programs (cjpeg, etc.) and man pages.
[4] Created a 32-bit supplementary package for amd64 Debian systems which
[4] Created a 32-bit supplementary package for amd64 Debian systems, which
contains just the 32-bit libjpeg-turbo libraries.
[5] Moved the libraries from */lib32 to */lib in the i386 Debian package.

View File

@@ -73,7 +73,7 @@ libjpeg_la_SOURCES += jsimd_none.c
endif
bin_PROGRAMS = cjpeg djpeg jpegtran rdjpgcom wrjpgcom tjbench
noinst_PROGRAMS = tjunittest
noinst_PROGRAMS = tjunittest jcstest
tjbench_SOURCES = tjbench.c bmp.h bmp.c tjutil.h tjutil.c rdbmp.c rdppm.c \
wrbmp.c wrppm.c
@@ -114,22 +114,24 @@ wrjpgcom_SOURCES = wrjpgcom.c
wrjpgcom_LDADD = libjpeg.la
jcstest_SOURCES = jcstest.c
jcstest_LDADD = libjpeg.la
dist_man1_MANS = cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 wrjpgcom.1
DOCS= README install.txt usage.txt wizard.txt example.c libjpeg.txt \
structure.txt coderules.txt filelist.txt jconfig.txt change.log \
README-turbo.txt rdrle.c wrrle.c BUILDING.txt ChangeLog.txt
DOCS= install.txt coderules.txt filelist.txt jconfig.txt change.log \
rdrle.c wrrle.c BUILDING.txt ChangeLog.txt
TESTFILES= testorig.jpg testorig.ppm testimg.bmp testimgflt.jpg \
testimgfst.jpg testimgint.jpg testimgp.jpg testimgflt.ppm testimgfst.ppm \
testimgint.ppm testimgflt-nosimd.jpg testimgcrop.jpg testimgari.jpg \
testimgari.ppm testimgfst100.jpg testimggray.jpg testimgfst1_2.ppm \
testimgfst1_4.ppm testimgfst1_8.ppm testimgint1_2.ppm testimgint1_4.ppm \
testimgint1_8.ppm
docdir = $(datadir)/doc
dist_doc_DATA = README README-turbo.txt libjpeg.txt structure.txt usage.txt \
wizard.txt
exampledir = $(datadir)/doc
dist_example_DATA = example.c
EXTRA_DIST = win release $(DOCS) $(TESTFILES) CMakeLists.txt \
EXTRA_DIST = win release $(DOCS) testimages CMakeLists.txt \
sharedlib/CMakeLists.txt cmakescripts libjpeg.map.in doc doxygen.config \
jccolext.c jdcolext.c jdmrgext.c
@@ -147,62 +149,62 @@ endif
./tjunittest
./tjunittest -alloc
./tjunittest -yuv
./cjpeg -dct int -outfile testoutint.jpg $(srcdir)/testorig.ppm
cmp $(srcdir)/testimgint.jpg testoutint.jpg
./cjpeg -dct fast -opt -outfile testoutfst.jpg $(srcdir)/testorig.ppm
cmp $(srcdir)/testimgfst.jpg testoutfst.jpg
./cjpeg -dct fast -quality 100 -opt -outfile testoutfst100.jpg $(srcdir)/testorig.ppm
cmp $(srcdir)/testimgfst100.jpg testoutfst100.jpg
./cjpeg -dct float -outfile testoutflt.jpg $(srcdir)/testorig.ppm
./cjpeg -dct int -outfile testoutint.jpg $(srcdir)/testimages/testorig.ppm
cmp $(srcdir)/testimages/testimgint.jpg testoutint.jpg
./cjpeg -dct fast -opt -outfile testoutfst.jpg $(srcdir)/testimages/testorig.ppm
cmp $(srcdir)/testimages/testimgfst.jpg testoutfst.jpg
./cjpeg -dct fast -quality 100 -opt -outfile testoutfst100.jpg $(srcdir)/testimages/testorig.ppm
cmp $(srcdir)/testimages/testimgfst100.jpg testoutfst100.jpg
./cjpeg -dct float -outfile testoutflt.jpg $(srcdir)/testimages/testorig.ppm
if WITH_SSE_FLOAT_DCT
cmp $(srcdir)/testimgflt.jpg testoutflt.jpg
cmp $(srcdir)/testimages/testimgflt.jpg testoutflt.jpg
else
cmp $(srcdir)/testimgflt-nosimd.jpg testoutflt.jpg
cmp $(srcdir)/testimages/testimgflt-nosimd.jpg testoutflt.jpg
endif
./cjpeg -dct int -grayscale -outfile testoutgray.jpg $(srcdir)/testorig.ppm
cmp $(srcdir)/testimggray.jpg testoutgray.jpg
./djpeg -dct int -fast -ppm -outfile testoutint.ppm $(srcdir)/testorig.jpg
cmp $(srcdir)/testimgint.ppm testoutint.ppm
./djpeg -dct fast -ppm -outfile testoutfst.ppm $(srcdir)/testorig.jpg
cmp $(srcdir)/testimgfst.ppm testoutfst.ppm
./djpeg -dct float -ppm -outfile testoutflt.ppm $(srcdir)/testorig.jpg
./cjpeg -dct int -grayscale -outfile testoutgray.jpg $(srcdir)/testimages/testorig.ppm
cmp $(srcdir)/testimages/testimggray.jpg testoutgray.jpg
./djpeg -dct int -fast -ppm -outfile testoutint.ppm $(srcdir)/testimages/testorig.jpg
cmp $(srcdir)/testimages/testimgint.ppm testoutint.ppm
./djpeg -dct fast -ppm -outfile testoutfst.ppm $(srcdir)/testimages/testorig.jpg
cmp $(srcdir)/testimages/testimgfst.ppm testoutfst.ppm
./djpeg -dct float -ppm -outfile testoutflt.ppm $(srcdir)/testimages/testorig.jpg
if WITH_SSE_FLOAT_DCT
cmp $(srcdir)/testimgflt.ppm testoutflt.ppm
cmp $(srcdir)/testimages/testimgflt.ppm testoutflt.ppm
else
cmp $(srcdir)/testorig.ppm testoutflt.ppm
cmp $(srcdir)/testimages/testorig.ppm testoutflt.ppm
endif
./djpeg -dct int -scale 1/2 -ppm -outfile testoutint1_2.ppm $(srcdir)/testorig.jpg
cmp $(srcdir)/testimgint1_2.ppm testoutint1_2.ppm
./djpeg -dct fast -scale 1/2 -ppm -outfile testoutfst1_2.ppm $(srcdir)/testorig.jpg
cmp $(srcdir)/testimgfst1_2.ppm testoutfst1_2.ppm
./djpeg -dct int -scale 1/4 -ppm -outfile testoutint1_4.ppm $(srcdir)/testorig.jpg
cmp $(srcdir)/testimgint1_4.ppm testoutint1_4.ppm
./djpeg -dct fast -scale 1/4 -ppm -outfile testoutfst1_4.ppm $(srcdir)/testorig.jpg
cmp $(srcdir)/testimgfst1_4.ppm testoutfst1_4.ppm
./djpeg -dct int -scale 1/8 -ppm -outfile testoutint1_8.ppm $(srcdir)/testorig.jpg
cmp $(srcdir)/testimgint1_8.ppm testoutint1_8.ppm
./djpeg -dct fast -scale 1/8 -ppm -outfile testoutfst1_8.ppm $(srcdir)/testorig.jpg
cmp $(srcdir)/testimgfst1_8.ppm testoutfst1_8.ppm
./djpeg -dct int -bmp -colors 256 -outfile testout.bmp $(srcdir)/testorig.jpg
cmp $(srcdir)/testimg.bmp testout.bmp
./djpeg -dct int -scale 1/2 -ppm -outfile testoutint1_2.ppm $(srcdir)/testimages/testorig.jpg
cmp $(srcdir)/testimages/testimgint1_2.ppm testoutint1_2.ppm
./djpeg -dct fast -scale 1/2 -ppm -outfile testoutfst1_2.ppm $(srcdir)/testimages/testorig.jpg
cmp $(srcdir)/testimages/testimgfst1_2.ppm testoutfst1_2.ppm
./djpeg -dct int -scale 1/4 -ppm -outfile testoutint1_4.ppm $(srcdir)/testimages/testorig.jpg
cmp $(srcdir)/testimages/testimgint1_4.ppm testoutint1_4.ppm
./djpeg -dct fast -scale 1/4 -ppm -outfile testoutfst1_4.ppm $(srcdir)/testimages/testorig.jpg
cmp $(srcdir)/testimages/testimgfst1_4.ppm testoutfst1_4.ppm
./djpeg -dct int -scale 1/8 -ppm -outfile testoutint1_8.ppm $(srcdir)/testimages/testorig.jpg
cmp $(srcdir)/testimages/testimgint1_8.ppm testoutint1_8.ppm
./djpeg -dct fast -scale 1/8 -ppm -outfile testoutfst1_8.ppm $(srcdir)/testimages/testorig.jpg
cmp $(srcdir)/testimages/testimgfst1_8.ppm testoutfst1_8.ppm
./djpeg -dct int -bmp -colors 256 -outfile testout.bmp $(srcdir)/testimages/testorig.jpg
cmp $(srcdir)/testimages/testimg.bmp testout.bmp
if WITH_ARITH_ENC
./cjpeg -dct int -arithmetic -outfile testoutari.jpg $(srcdir)/testorig.ppm
cmp $(srcdir)/testimgari.jpg testoutari.jpg
./jpegtran -arithmetic -outfile testouta.jpg $(srcdir)/testimgint.jpg
cmp $(srcdir)/testimgari.jpg testouta.jpg
./cjpeg -dct int -arithmetic -outfile testoutari.jpg $(srcdir)/testimages/testorig.ppm
cmp $(srcdir)/testimages/testimgari.jpg testoutari.jpg
./jpegtran -arithmetic -outfile testouta.jpg $(srcdir)/testimages/testimgint.jpg
cmp $(srcdir)/testimages/testimgari.jpg testouta.jpg
endif
if WITH_ARITH_DEC
./djpeg -dct int -fast -ppm -outfile testoutari.ppm $(srcdir)/testimgari.jpg
cmp $(srcdir)/testimgari.ppm testoutari.ppm
./jpegtran -outfile testouta.jpg $(srcdir)/testimgari.jpg
cmp $(srcdir)/testimgint.jpg testouta.jpg
./djpeg -dct int -fast -ppm -outfile testoutari.ppm $(srcdir)/testimages/testimgari.jpg
cmp $(srcdir)/testimages/testimgari.ppm testoutari.ppm
./jpegtran -outfile testouta.jpg $(srcdir)/testimages/testimgari.jpg
cmp $(srcdir)/testimages/testimgint.jpg testouta.jpg
endif
./cjpeg -dct int -progressive -outfile testoutp.jpg $(srcdir)/testorig.ppm
cmp $(srcdir)/testimgp.jpg testoutp.jpg
./cjpeg -dct int -progressive -outfile testoutp.jpg $(srcdir)/testimages/testorig.ppm
cmp $(srcdir)/testimages/testimgp.jpg testoutp.jpg
./jpegtran -outfile testoutt.jpg testoutp.jpg
cmp $(srcdir)/testimgint.jpg testoutt.jpg
./jpegtran -crop 120x90+20+50 -transpose -perfect -outfile testoutcrop.jpg $(srcdir)/testorig.jpg
cmp $(srcdir)/testimgcrop.jpg testoutcrop.jpg
cmp $(srcdir)/testimages/testimgint.jpg testoutt.jpg
./jpegtran -crop 120x90+20+50 -transpose -perfect -outfile testoutcrop.jpg $(srcdir)/testimages/testorig.jpg
cmp $(srcdir)/testimages/testimgcrop.jpg testoutcrop.jpg
testclean:
@@ -233,6 +235,14 @@ testclean:
rm -f *_440_*.jpg
rm -f *_440.yuv
tjtest:
sh ./tjbenchtest
if WITH_JAVA
sh ./tjexampletest
endif
if X86_64
install-exec-hook:
@@ -263,7 +273,7 @@ rpm: all
ln -fs `pwd` $$TMPDIR/BUILD; \
rm -f ${PACKAGE_NAME}-${VERSION}.${RPMARCH}.rpm; \
rpmbuild -bb --define "_blddir $$TMPDIR/buildroot" \
--define "_topdir $$TMPDIR" --define "_srcdir ${srcdir}" \
--define "_topdir $$TMPDIR" \
--target ${RPMARCH} pkgscripts/libjpeg-turbo.spec; \
cp $$TMPDIR/RPMS/${RPMARCH}/${PACKAGE_NAME}-${VERSION}-${BUILD}.${RPMARCH}.rpm \
${PACKAGE_NAME}-${VERSION}.${RPMARCH}.rpm; \
@@ -279,7 +289,7 @@ srpm: dist-gzip
rm -f ${PACKAGE_NAME}-${VERSION}.src.rpm; \
cp ${PACKAGE_NAME}-${VERSION}.tar.gz $$TMPDIR/SOURCES; \
cat pkgscripts/libjpeg-turbo.spec | sed s/%{_blddir}/%{_tmppath}/g \
| sed s@%{_srcdir}/@@g | sed s/#--\>//g \
| sed s/#--\>//g \
> $$TMPDIR/SPECS/libjpeg-turbo.spec; \
rpmbuild -bs --define "_topdir $$TMPDIR" $$TMPDIR/SPECS/libjpeg-turbo.spec; \
cp $$TMPDIR/SRPMS/${PACKAGE_NAME}-${VERSION}-${BUILD}.src.rpm \
@@ -292,7 +302,15 @@ deb: all
if X86_64
udmg: all
sh pkgscripts/makemacpkg universal ${BUILDDIR32}
sh pkgscripts/makemacpkg -build32 ${BUILDDIR32}
iosdmg: all
sh pkgscripts/makemacpkg -build32 ${BUILDDIR32} -buildarmv6 ${BUILDDIRARMV6} -buildarmv7 ${BUILDDIRARMV7}
else
iosdmg: all
sh pkgscripts/makemacpkg -buildarmv6 ${BUILDDIRARMV6} -buildarmv7 ${BUILDDIRARMV7}
endif

19
README
View File

@@ -1,7 +1,8 @@
libjpeg-turbo note: This file is mostly taken from the libjpeg v8b README
file, and it is included only for reference. Some parts of it may not apply to
libjpeg-turbo. Please see README-turbo.txt for information specific to the
turbo version.
libjpeg-turbo note: This file contains portions of the libjpeg v6b and v8
README files, with additional wordsmithing by The libjpeg-turbo Project.
It is included only for reference, as some parts of it may not apply to
libjpeg-turbo. Please see README-turbo.txt for information specific to
libjpeg-turbo.
The Independent JPEG Group's JPEG software
@@ -62,7 +63,7 @@ OVERVIEW
This package contains C software to implement JPEG image encoding, decoding,
and transcoding. JPEG (pronounced "jay-peg") is a standardized compression
method for full-color and gray-scale images. JPEG's strong suit is compressing
photographic images or other types of images which have smooth color and
photographic images or other types of images that have smooth color and
brightness transitions between neighboring pixels. Images with sharp lines or
other abrupt features may not compress well with JPEG, and a higher JPEG
quality may have to be used to avoid visible compression artifacts with such
@@ -256,8 +257,8 @@ ARCHIVE LOCATIONS
The "official" archive site for this software is www.ijg.org.
The most recent released version can always be found there in
directory "files". This particular version will be archived as
http://www.ijg.org/files/jpegsrc.v8b.tar.gz, and in Windows-compatible
"zip" archive format as http://www.ijg.org/files/jpegsr8b.zip.
http://www.ijg.org/files/jpegsrc.v8d.tar.gz, and in Windows-compatible
"zip" archive format as http://www.ijg.org/files/jpegsr8d.zip.
The JPEG FAQ (Frequently Asked Questions) article is a source of some
general information about JPEG.
@@ -274,7 +275,7 @@ FILE FORMAT WARS
================
The ISO JPEG standards committee actually promotes different formats like
"JPEG 2000" or "JPEG XR" which are incompatible with original DCT-based
"JPEG 2000" or "JPEG XR", which are incompatible with original DCT-based
JPEG. IJG therefore does not support these formats (see REFERENCES). Indeed,
one of the original reasons for developing this free software was to help
force convergence on common, interoperable format standards for JPEG files.
@@ -286,4 +287,4 @@ image files indefinitely.)
TO DO
=====
Please send bug reports, offers of help, etc. to jpeg-info@uc.ag.
Please send bug reports, offers of help, etc. to jpeg-info@jpegclub.org.

View File

@@ -2,32 +2,32 @@
** Background
*******************************************************************************
libjpeg-turbo is a derivative of libjpeg which uses SIMD instructions (MMX,
SSE2, etc.) to accelerate baseline JPEG compression and decompression on x86
and x86-64 systems. On such systems, libjpeg-turbo is generally 2-4x as fast
as the unmodified version of libjpeg, all else being equal.
libjpeg-turbo is a derivative of libjpeg 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 the unmodified version of libjpeg, all else being equal.
libjpeg-turbo was originally based on libjpeg/SIMD by Miyasaka Masaru, but
the TigerVNC and VirtualGL projects made numerous enhancements to the codec in
2009, including improved support for Mac OS X, 64-bit support, support for
32-bit and big endian pixel formats (RGBX, XBGR, etc.), accelerated Huffman
encoding/decoding, and various bug fixes. The goal was to produce a fully open
source codec that could replace the partially closed source TurboJPEG/IPP codec
used by VirtualGL and TurboVNC. libjpeg-turbo generally performs in the range
of 80-120% of TurboJPEG/IPP. It is faster in some areas but slower in others.
32-bit and big-endian pixel formats (RGBX, XBGR, etc.), accelerated Huffman
encoding/decoding, and various bug fixes. The goal was to produce a fully
open-source codec that could replace the partially closed-source TurboJPEG/IPP
codec used by VirtualGL and TurboVNC. libjpeg-turbo generally achieves 80-120%
of the performance of TurboJPEG/IPP. It is faster in some areas but slower in
others.
In early 2010, libjpeg-turbo spun off into its own independent project, with
the goal of making high-speed JPEG compression/decompression technology
available to a broader range of users and developers. The libjpeg-turbo shared
libraries can be used as drop-in replacements for libjpeg on most systems.
available to a broader range of users and developers.
*******************************************************************************
** License
*******************************************************************************
libjpeg-turbo is licensed under a non-restrictive, BSD-style license
(see README.) The TurboJPEG/OSS wrapper (both C and Java versions) and
Most of libjpeg-turbo inherits the non-restrictive, BSD-style license used by
libjpeg (see README.) The TurboJPEG/OSS wrapper (both C and Java versions) and
associated test programs bear a similar license, which is reproduced below:
Redistribution and use in source and binary forms, with or without
@@ -59,19 +59,19 @@ POSSIBILITY OF SUCH DAMAGE.
** Using libjpeg-turbo
*******************************************************************************
libjpeg-turbo includes two APIs which can be used to compress and decompress
libjpeg-turbo includes two APIs that can be used to compress and decompress
JPEG images:
TurboJPEG/OSS: This API wraps libjpeg-turbo and provides an easy-to-use
interface for compressing and decompressing JPEG images in memory. It also
provides some features that would not be straightforward to implement using
the underlying libjpeg API, such as generating planar YUV images and
performing multiple simultaneous lossless transforms on an image. The Java
interface for libjpeg-turbo is written on top of TurboJPEG/OSS.
TurboJPEG API: This API provides an easy-to-use interface for compressing
and decompressing JPEG images in memory. It also provides some functionality
that would not be straightforward to achieve using the underlying libjpeg
API, such as generating planar YUV images and performing multiple
simultaneous lossless transforms on an image. The Java interface for
libjpeg-turbo is written on top of the TurboJPEG API.
libjpeg API: This is the industry standard API for compressing and
decompressing JPEG images. It is more difficult to use than TurboJPEG/OSS
but also more powerful. libjpeg-turbo is both API/ABI-compatible and
libjpeg API: This is the de facto industry-standard API for compressing and
decompressing JPEG images. It is more difficult to use than the TurboJPEG
API but also more powerful. libjpeg-turbo is both API/ABI-compatible and
mathematically compatible with libjpeg v6b. It can also optionally be
configured to be API/ABI-compatible with libjpeg v7 and v8 (see below.)
@@ -101,13 +101,13 @@ NOTE: {lib} can be lib, lib32, lib64, or lib/64, depending on the O/S and
architecture.
System administrators can also replace the libjpeg sym links in /usr/{lib} with
links to the libjpeg dynamic library located in /opt/libjpeg-turbo/{lib}. This
will effectively accelerate every dynamically linked libjpeg application on the
system.
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.
The libjpeg-turbo SDK for Visual C++ installs the libjpeg-turbo DLL
(jpeg62.dll, jpeg7.dll, or jpeg8.dll, depending on whether libjpeg v6b, v7, or
v8 emulation is enabled) into c:\libjpeg-turbo[64]\bin, and the PATH
(jpeg62.dll, jpeg7.dll, or jpeg8.dll, depending on whether it was built with
libjpeg v6b, v7, or v8 emulation) into c:\libjpeg-turbo[64]\bin, and the PATH
environment variable can be modified such that this directory is searched
before any others that might contain a libjpeg DLL. However, if a libjpeg
DLL exists in an application's install directory, then Windows will load this
@@ -117,16 +117,16 @@ version of this DLL and copy c:\libjpeg-turbo[64]\bin\jpeg*.dll into the
application's install directory to accelerate it.
The version of the libjpeg-turbo DLL distributed in the libjpeg-turbo SDK for
Visual C++ requires the Visual C++ 2008 C run time DLL (msvcr90.dll).
Visual C++ 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.
NOTE: Features of libjpeg which require passing a C run time structure, such
NOTE: Features of libjpeg that require passing a C run-time structure, such
as a file handle, from an application to libjpeg will probably not work with
the version of the libjpeg-turbo DLL distributed in the libjpeg-turbo SDK for
Visual C++, unless the application is also built to use the Visual C++ 2008 C
run time DLL. In particular, this affects jpeg_stdio_dest() and
run-time DLL. In particular, this affects jpeg_stdio_dest() and
jpeg_stdio_src().
Mac applications typically embed their own copies of the libjpeg dylib inside
@@ -146,7 +146,7 @@ Replacing TurboJPEG/IPP
libjpeg-turbo is a drop-in replacement for the TurboJPEG/IPP SDK used by
VirtualGL 2.1.x and TurboVNC 0.6 (and prior.) libjpeg-turbo contains a wrapper
library (TurboJPEG/OSS) that emulates the TurboJPEG API using libjpeg-turbo
instead of the closed source Intel Performance Primitives. You can replace the
instead of the closed-source Intel Performance Primitives. You can replace the
TurboJPEG/IPP package on Linux systems with the libjpeg-turbo package in order
to make existing releases of VirtualGL 2.1.x and TurboVNC 0.x use the new codec
at run time. Note that the 64-bit libjpeg-turbo packages contain only 64-bit
@@ -157,7 +157,7 @@ both the 64-bit and 32-bit versions of libjpeg-turbo.
You can also build the VirtualGL 2.1.x and TurboVNC 0.6 source code with
the libjpeg-turbo SDK instead of TurboJPEG/IPP. It should work identically.
libjpeg-turbo also includes static library versions of TurboJPEG/OSS, which
are used to build TurboVNC 1.0 and later.
are used to build VirtualGL 2.2 and TurboVNC 1.0 and later.
========================================
Using libjpeg-turbo in Your Own Programs
@@ -208,9 +208,9 @@ libjpeg-turbo) or jpeg-static.lib (to use the static version of libjpeg-turbo.)
Colorspace Extensions
=====================
libjpeg-turbo includes extensions which allow JPEG images to be compressed
directly from (and decompressed directly to) buffers which use BGR, BGRX,
RGBX, XBGR, and XRGB pixel ordering. This is implemented with six new
libjpeg-turbo includes extensions that allow JPEG images to be compressed
directly from (and decompressed directly to) buffers that use BGR, BGRX,
RGBX, XBGR, and XRGB pixel ordering. This is implemented with ten new
colorspace constants:
JCS_EXT_RGB /* red/green/blue */
@@ -219,11 +219,15 @@ colorspace constants:
JCS_EXT_BGRX /* blue/green/red/x */
JCS_EXT_XBGR /* x/blue/green/red */
JCS_EXT_XRGB /* x/red/green/blue */
JCS_EXT_RGBA /* red/green/blue/alpha */
JCS_EXT_BGRA /* blue/green/red/alpha */
JCS_EXT_ABGR /* alpha/blue/green/red */
JCS_EXT_ARGB /* alpha/red/green/blue */
Setting cinfo.in_color_space (compression) or cinfo.out_color_space
(decompression) to one of these values will cause libjpeg-turbo to read the
red, green, and blue values from (or write them to) the appropriate position in
the pixel when YUV conversion is performed.
the pixel when compressing from/decompressing to an RGB buffer.
Your application can check for the existence of these extensions at compile
time with:
@@ -233,33 +237,41 @@ time with:
At run time, attempting to use these extensions with a version of libjpeg
that doesn't support them will result in a "Bogus input colorspace" error.
When using the RGBX, BGRX, XBGR, and XRGB colorspaces during decompression, the
X byte is undefined, and in order to ensure the best performance, libjpeg-turbo
can set that byte to whatever value it wishes. If an application expects the X
byte to be used as an alpha channel, then it should specify JCS_EXT_RGBA,
JCS_EXT_BGRA, JCS_EXT_ABGR, or JCS_EXT_ARGB. When these colorspace constants
are used, the X byte is guaranteed to be 0xFF, which is interpreted as opaque.
Your application can check for the existence of the alpha channel colorspace
extensions at compile time with:
#ifdef JCS_ALPHA_EXTENSIONS
jcstest.c, located in the libjpeg-turbo source tree, demonstrates how to check
for the existence of the colorspace extensions at compile time and run time.
=================================
libjpeg v7 and v8 API/ABI support
=================================
libjpeg v7 and v8 added new features to the API/ABI, and, unfortunately, the
compression and decompression structures were extended in a backward-
incompatible manner to accommodate these features. Thus, programs which are
With libjpeg v7 and v8, new features were added that necessitated extending the
compression and decompression structures. Unfortunately, due to the exposed
nature of those structures, extending them also necessitated breaking backward
ABI compatibility with previous libjpeg releases. Thus, programs that are
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
as widely used as v6b, enough programs (including a few Linux distros) have
made the switch that it was desirable to provide support for the libjpeg v7/v8
API/ABI in libjpeg-turbo.
Some of the libjpeg v7 and v8 features -- DCT scaling, to name one -- involve
deep modifications to the code which cannot be accommodated by libjpeg-turbo
without either breaking compatibility with libjpeg v6b or producing an
unsupportable mess. In order to fully support libjpeg v8 with all of its
features, we would have to essentially port the SIMD extensions to the libjpeg
v8 code base and maintain two separate code trees. We are hesitant to do this
until/unless the newer libjpeg code bases garner more community support and
involvement and until/unless we have some notion of whether future libjpeg
releases will also be backward-incompatible.
API/ABI in libjpeg-turbo. Although libjpeg-turbo can now be configured as a
drop-in replacement for libjpeg v7 or v8, it should be noted that not all of
the features in libjpeg v7 and v8 are supported (see below.)
By passing an argument of --with-jpeg7 or --with-jpeg8 to configure, or an
argument of -DWITH_JPEG7=1 or -DWITH_JPEG8=1 to cmake, you can build a version
of libjpeg-turbo which emulates the libjpeg v7 or v8 API/ABI, so that programs
which are built against libjpeg v7 or v8 can be run with libjpeg-turbo. The
of libjpeg-turbo that emulates the libjpeg v7 or v8 API/ABI, so that programs
that are built against libjpeg v7 or v8 can be run with libjpeg-turbo. The
following section describes which libjpeg v7+ features are supported and which
aren't.
@@ -293,6 +305,16 @@ Not supported:
-- libjpeg: DCT scaling in compressor
cinfo.scale_num and cinfo.scale_denom are silently ignored.
There is no technical reason why DCT scaling cannot be supported, but
without the SmartScale extension (see below), it would only be able to
down-scale using ratios of 1/2, 8/15, 4/7, 8/13, 2/3, 8/11, 4/5, and 8/9,
which is of limited usefulness.
-- libjpeg: SmartScale
cinfo.block_size is silently ignored.
SmartScale is an extension to the JPEG format that allows for DCT block
sizes other than 8x8. It would be difficult to support this feature while
retaining backward compatibility with libjpeg v6b.
-- libjpeg: IDCT scaling extensions in decompressor
libjpeg-turbo still supports IDCT scaling with scaling factors of 1/2, 1/4,
@@ -300,9 +322,14 @@ Not supported:
-- libjpeg: Fancy downsampling in compressor
cinfo.do_fancy_downsampling is silently ignored.
This requires the DCT scaling feature, which is not supported.
-- jpegtran: Scaling
Seems to depend on the DCT scaling feature, which isn't supported.
This requires both the DCT scaling and SmartScale features, which are not
supported.
-- Lossless RGB JPEG files
This requires the SmartScale feature, which is not supported.
*******************************************************************************
@@ -314,12 +341,13 @@ Restart Markers
===============
The optimized Huffman decoder in libjpeg-turbo does not handle restart markers
in a way that makes libjpeg happy, so it is necessary to use the slow Huffman
decoder when decompressing a JPEG image that has restart markers. This can
cause the decompression performance to drop by as much as 20%, but the
performance will still be much much greater than that of libjpeg v6b. Many
consumer packages, such as PhotoShop, use restart markers when generating JPEG
images, so images generated by those programs will experience this issue.
in a way that makes the rest of the libjpeg infrastructure happy, so it is
necessary to use the slow Huffman decoder when decompressing a JPEG image that
has restart markers. This can cause the decompression performance to drop by
as much as 20%, but the performance will still be much greater than that of
libjpeg. Many consumer packages, such as PhotoShop, use restart markers when
generating JPEG images, so images generated by those programs will experience
this issue.
===============================================
Fast Integer Forward DCT at High Quality Levels

16
cjpeg.1
View File

@@ -1,4 +1,4 @@
.TH CJPEG 1 "11 October 2010"
.TH CJPEG 1 "31 January 2012"
.SH NAME
cjpeg \- compress an image file to a JPEG file
.SH SYNOPSIS
@@ -121,7 +121,7 @@ quality-sensitive applications, for which the artifacts generated by
subsampling may be unacceptable.
.PP
The \fB-quality\fR option accepts a comma-separated list of parameters, which
respectively refer to the quality levels which should be assigned to the
respectively refer to the quality levels that should be assigned to the
quantization table slots. If there are more q-table slots than parameters,
then the last parameter is replicated. Thus, if only one quality parameter is
given, this is used for both luminance and chrominance (slots 0 and 1,
@@ -150,6 +150,12 @@ about the same --- often a little smaller.
.PP
Switches for advanced users:
.TP
.B \-arithmetic
Use arithmetic coding.
.B Caution:
arithmetic coded JPEG is not yet widely implemented, so many decoders will be
unable to view an arithmetic coded JPEG file at all.
.TP
.B \-dct int
Use integer DCT method (default).
.TP
@@ -214,12 +220,6 @@ visibly blur the image, however.
.PP
Switches for wizards:
.TP
.B \-arithmetic
Use arithmetic coding.
.B Caution:
arithmetic coded JPEG is not yet widely implemented, so many decoders will be
unable to view an arithmetic coded JPEG file at all.
.TP
.B \-baseline
Force baseline-compatible quantization tables to be generated. This clamps
quantization values to 8 bits even at low quality settings. (This switch is

12
cjpeg.c
View File

@@ -164,6 +164,9 @@ usage (void)
fprintf(stderr, " -targa Input file is Targa format (usually not needed)\n");
#endif
fprintf(stderr, "Switches for advanced users:\n");
#ifdef C_ARITH_CODING_SUPPORTED
fprintf(stderr, " -arithmetic Use arithmetic coding\n");
#endif
#ifdef DCT_ISLOW_SUPPORTED
fprintf(stderr, " -dct int Use integer DCT method%s\n",
(JDCT_DEFAULT == JDCT_ISLOW ? " (default)" : ""));
@@ -184,9 +187,6 @@ usage (void)
fprintf(stderr, " -outfile name Specify name for output file\n");
fprintf(stderr, " -verbose or -debug Emit debug output\n");
fprintf(stderr, "Switches for wizards:\n");
#ifdef C_ARITH_CODING_SUPPORTED
fprintf(stderr, " -arithmetic Use arithmetic coding\n");
#endif
fprintf(stderr, " -baseline Force baseline quantization tables\n");
fprintf(stderr, " -qtables file Use quantization tables given in file\n");
fprintf(stderr, " -qslots N[,...] Set component quantization tables\n");
@@ -277,9 +277,9 @@ parse_switches (j_compress_ptr cinfo, int argc, char **argv,
if (! printed_version) {
fprintf(stderr, "%s version %s (build %s)\n",
PACKAGE_NAME, VERSION, BUILD);
fprintf(stderr, "%s\n\n", LJTCOPYRIGHT);
fprintf(stderr, "Based on Independent JPEG Group's libjpeg, version %s\n%s\n\n",
JVERSION, JCOPYRIGHT);
fprintf(stderr, "%s\n\n", JCOPYRIGHT);
fprintf(stderr, "Emulating The Independent JPEG Group's libjpeg, version %s\n\n",
JVERSION);
printed_version = TRUE;
}
cinfo->err->trace_level++;

View File

@@ -2,7 +2,7 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.56])
AC_INIT([libjpeg-turbo], [1.1.90])
AC_INIT([libjpeg-turbo], [1.2.1])
BUILD=`date +%Y%m%d`
AM_INIT_AUTOMAKE([-Wall foreign dist-bzip2])
@@ -140,6 +140,8 @@ AC_MSG_RESULT([$SO_MAJOR_VERSION:$SO_MINOR_VERSION])
AC_SUBST(SO_MAJOR_VERSION)
AC_SUBST(SO_MINOR_VERSION)
AC_DEFINE_UNQUOTED(LIBJPEG_TURBO_VERSION, [$VERSION], [libjpeg-turbo version])
VERSION_SCRIPT=yes
AC_ARG_ENABLE([ld-version-script],
AS_HELP_STRING([--disable-ld-version-script],
@@ -366,6 +368,8 @@ AC_CONFIG_FILES([pkgscripts/Info.plist:release/Info.plist.in])
AC_CONFIG_FILES([pkgscripts/uninstall:release/uninstall.in])
AC_CONFIG_FILES([pkgscripts/makesunpkg:release/makesunpkg.in])
AC_CONFIG_FILES([pkgscripts/pkginfo:release/pkginfo.in])
AC_CONFIG_FILES([tjbenchtest])
AC_CONFIG_FILES([tjexampletest])
AC_CONFIG_FILES([libjpeg.map])
AC_CONFIG_FILES([Makefile simd/Makefile])
AC_CONFIG_FILES([java/Makefile])

View File

@@ -245,9 +245,9 @@ parse_switches (j_decompress_ptr cinfo, int argc, char **argv,
if (! printed_version) {
fprintf(stderr, "%s version %s (build %s)\n",
PACKAGE_NAME, VERSION, BUILD);
fprintf(stderr, "%s\n\n", LJTCOPYRIGHT);
fprintf(stderr, "Based on Independent JPEG Group's libjpeg, version %s\n%s\n\n",
JVERSION, JCOPYRIGHT);
fprintf(stderr, "%s\n\n", JCOPYRIGHT);
fprintf(stderr, "Emulating The Independent JPEG Group's libjpeg, version %s\n\n",
JVERSION);
printed_version = TRUE;
}
cinfo->err->trace_level++;

View File

@@ -19,7 +19,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">TurboJPEG&#160;<span id="projectnumber">1.2</span></div>
<div id="projectname">TurboJPEG&#160;<span id="projectnumber">1.2.1</span></div>
</td>
</tr>
</tbody>
@@ -81,7 +81,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
</iframe>
</div>
<hr class="footer"/><address class="footer"><small>Generated on Tue Sep 20 2011 13:18:32 for TurboJPEG by&#160;
<hr class="footer"/><address class="footer"><small>Generated on Fri Jun 29 2012 18:14:55 for TurboJPEG by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>

View File

@@ -19,7 +19,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">TurboJPEG&#160;<span id="projectnumber">1.2</span></div>
<div id="projectname">TurboJPEG&#160;<span id="projectnumber">1.2.1</span></div>
</td>
</tr>
</tbody>
@@ -80,7 +80,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
</iframe>
</div>
<hr class="footer"/><address class="footer"><small>Generated on Tue Sep 20 2011 13:18:32 for TurboJPEG by&#160;
<hr class="footer"/><address class="footer"><small>Generated on Fri Jun 29 2012 18:14:55 for TurboJPEG by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>

View File

@@ -19,7 +19,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">TurboJPEG&#160;<span id="projectnumber">1.2</span></div>
<div id="projectname">TurboJPEG&#160;<span id="projectnumber">1.2.1</span></div>
</td>
</tr>
</tbody>
@@ -113,7 +113,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
</iframe>
</div>
<hr class="footer"/><address class="footer"><small>Generated on Tue Sep 20 2011 13:18:32 for TurboJPEG by&#160;
<hr class="footer"/><address class="footer"><small>Generated on Fri Jun 29 2012 18:14:55 for TurboJPEG by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>

View File

@@ -19,7 +19,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">TurboJPEG&#160;<span id="projectnumber">1.2</span></div>
<div id="projectname">TurboJPEG&#160;<span id="projectnumber">1.2.1</span></div>
</td>
</tr>
</tbody>
@@ -113,7 +113,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
</iframe>
</div>
<hr class="footer"/><address class="footer"><small>Generated on Tue Sep 20 2011 13:18:32 for TurboJPEG by&#160;
<hr class="footer"/><address class="footer"><small>Generated on Fri Jun 29 2012 18:14:55 for TurboJPEG by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>

View File

@@ -19,7 +19,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">TurboJPEG&#160;<span id="projectnumber">1.2</span></div>
<div id="projectname">TurboJPEG&#160;<span id="projectnumber">1.2.1</span></div>
</td>
</tr>
</tbody>
@@ -82,17 +82,21 @@ Defines</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga72ecf4ebe6eb702d3c6f5ca27455e1ec">TJFLAG_BOTTOMUP</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">The uncompressed source/destination image is stored in bottom-up (Windows, OpenGL) order, not top-down (X11) order. <a href="#ga72ecf4ebe6eb702d3c6f5ca27455e1ec"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga4e872f11c82f241736fa8297920f24e5">TJFLAG_FORCEMMX</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Turn off CPU auto-detection and force TurboJPEG to use MMX code (IPP and 32-bit libjpeg-turbo versions only.) <a href="#ga4e872f11c82f241736fa8297920f24e5"></a><br/></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Turn off CPU auto-detection and force TurboJPEG to use MMX code (if the underlying codec supports it.) <a href="#ga4e872f11c82f241736fa8297920f24e5"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#gae17e63189e8cd730feed3efbd2454f38">TJFLAG_FORCESSE</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Turn off CPU auto-detection and force TurboJPEG to use SSE code (32-bit IPP and 32-bit libjpeg-turbo versions only) <a href="#gae17e63189e8cd730feed3efbd2454f38"></a><br/></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Turn off CPU auto-detection and force TurboJPEG to use SSE code (if the underlying codec supports it.) <a href="#gae17e63189e8cd730feed3efbd2454f38"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga8cf0bca96ea4d472563f4b0ebf8c48e7">TJFLAG_FORCESSE2</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Turn off CPU auto-detection and force TurboJPEG to use SSE2 code (32-bit IPP and 32-bit libjpeg-turbo versions only) <a href="#ga8cf0bca96ea4d472563f4b0ebf8c48e7"></a><br/></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Turn off CPU auto-detection and force TurboJPEG to use SSE2 code (if the underlying codec supports it.) <a href="#ga8cf0bca96ea4d472563f4b0ebf8c48e7"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#gaf9d49066633404da4386d70820295dd2">TJFLAG_FORCESSE3</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Turn off CPU auto-detection and force TurboJPEG to use SSE3 code (64-bit IPP version only) <a href="#gaf9d49066633404da4386d70820295dd2"></a><br/></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Turn off CPU auto-detection and force TurboJPEG to use SSE3 code (if the underlying codec supports it.) <a href="#gaf9d49066633404da4386d70820295dd2"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga4ee4506c81177a06f77e2504a22efd2d">TJFLAG_FASTUPSAMPLE</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Use fast, inaccurate chrominance upsampling routines in the JPEG decompressor (libjpeg and libjpeg-turbo versions only) <a href="#ga4ee4506c81177a06f77e2504a22efd2d"></a><br/></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">When decompressing, use the fastest chrominance upsampling algorithm available in the underlying codec. <a href="#ga4ee4506c81177a06f77e2504a22efd2d"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga8808d403c68b62aaa58a4c1e58e98963">TJFLAG_NOREALLOC</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Disable buffer (re)allocation. <a href="#ga8808d403c68b62aaa58a4c1e58e98963"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#gaabce235db80d3f698b27f36cbd453da2">TJFLAG_FASTDCT</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Use the fastest DCT/IDCT algorithm available in the underlying codec. <a href="#gaabce235db80d3f698b27f36cbd453da2"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#gacb233cfd722d66d1ccbf48a7de81f0e0">TJFLAG_ACCURATEDCT</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Use the most accurate DCT/IDCT algorithm available in the underlying codec. <a href="#gacb233cfd722d66d1ccbf48a7de81f0e0"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga0f6dbd18adf38b7d46ac547f0f4d562c">TJ_NUMXOP</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Number of transform operations. <a href="#ga0f6dbd18adf38b7d46ac547f0f4d562c"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga50e03cb5ed115330e212417429600b00">TJXOPT_PERFECT</a></td></tr>
@@ -135,7 +139,12 @@ Enumerations</h2></td></tr>
<br/>
&#160;&#160;<a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aaf6603b27147de47e212e75dac027b2af">TJPF_XBGR</a>,
<a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aadae996905efcfa3b42a0bb3bea7f9d84">TJPF_XRGB</a>,
<a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa5431b54b015337705f13118073711a1a">TJPF_GRAY</a>
<a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa5431b54b015337705f13118073711a1a">TJPF_GRAY</a>,
<a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa88d2e88fab67f6503cf972e14851cc12">TJPF_RGBA</a>,
<br/>
&#160;&#160;<a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aac037ff1845cf9b74bb81a3659c2b9fb4">TJPF_BGRA</a>,
<a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa1ba1a7f1631dbeaa49a0a85fc4a40081">TJPF_ABGR</a>,
<a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aae8f846ed9d9de99b6e1dfe448848765c">TJPF_ARGB</a>
<br/>
}</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Pixel formats. <a href="group___turbo_j_p_e_g.html#gac916144e26c3817ac514e64ae5d12e2a">More...</a><br/></td></tr>
@@ -248,6 +257,22 @@ Variables</h2></td></tr>
<p>Number of transform operations. </p>
</div>
</div>
<a class="anchor" id="gacb233cfd722d66d1ccbf48a7de81f0e0"></a><!-- doxytag: member="turbojpeg.h::TJFLAG_ACCURATEDCT" ref="gacb233cfd722d66d1ccbf48a7de81f0e0" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define TJFLAG_ACCURATEDCT</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Use the most accurate DCT/IDCT algorithm available in the underlying codec. </p>
<p>The default if this flag is not specified is implementation-specific. The libjpeg implementation, for example, uses the fast algorithm by default when compressing, because this has been shown to have only a very slight effect on accuracy, but it uses the accurate algorithm when decompressing, because this has been shown to have a larger effect. </p>
</div>
</div>
<a class="anchor" id="ga72ecf4ebe6eb702d3c6f5ca27455e1ec"></a><!-- doxytag: member="turbojpeg.h::TJFLAG_BOTTOMUP" ref="ga72ecf4ebe6eb702d3c6f5ca27455e1ec" args="" -->
@@ -263,6 +288,22 @@ Variables</h2></td></tr>
<p>The uncompressed source/destination image is stored in bottom-up (Windows, OpenGL) order, not top-down (X11) order. </p>
</div>
</div>
<a class="anchor" id="gaabce235db80d3f698b27f36cbd453da2"></a><!-- doxytag: member="turbojpeg.h::TJFLAG_FASTDCT" ref="gaabce235db80d3f698b27f36cbd453da2" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define TJFLAG_FASTDCT</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Use the fastest DCT/IDCT algorithm available in the underlying codec. </p>
<p>The default if this flag is not specified is implementation-specific. The libjpeg implementation, for example, uses the fast algorithm by default when compressing, because this has been shown to have only a very slight effect on accuracy, but it uses the accurate algorithm when decompressing, because this has been shown to have a larger effect. </p>
</div>
</div>
<a class="anchor" id="ga4ee4506c81177a06f77e2504a22efd2d"></a><!-- doxytag: member="turbojpeg.h::TJFLAG_FASTUPSAMPLE" ref="ga4ee4506c81177a06f77e2504a22efd2d" args="" -->
@@ -276,7 +317,8 @@ Variables</h2></td></tr>
</div>
<div class="memdoc">
<p>Use fast, inaccurate chrominance upsampling routines in the JPEG decompressor (libjpeg and libjpeg-turbo versions only) </p>
<p>When decompressing, use the fastest chrominance upsampling algorithm available in the underlying codec. </p>
<p>The default is to use smooth upsampling, which creates a smooth transition between neighboring chrominance components in order to reduce upsampling artifacts in the decompressed image. </p>
</div>
</div>
@@ -291,7 +333,7 @@ Variables</h2></td></tr>
</div>
<div class="memdoc">
<p>Turn off CPU auto-detection and force TurboJPEG to use MMX code (IPP and 32-bit libjpeg-turbo versions only.) </p>
<p>Turn off CPU auto-detection and force TurboJPEG to use MMX code (if the underlying codec supports it.) </p>
</div>
</div>
@@ -306,7 +348,7 @@ Variables</h2></td></tr>
</div>
<div class="memdoc">
<p>Turn off CPU auto-detection and force TurboJPEG to use SSE code (32-bit IPP and 32-bit libjpeg-turbo versions only) </p>
<p>Turn off CPU auto-detection and force TurboJPEG to use SSE code (if the underlying codec supports it.) </p>
</div>
</div>
@@ -321,7 +363,7 @@ Variables</h2></td></tr>
</div>
<div class="memdoc">
<p>Turn off CPU auto-detection and force TurboJPEG to use SSE2 code (32-bit IPP and 32-bit libjpeg-turbo versions only) </p>
<p>Turn off CPU auto-detection and force TurboJPEG to use SSE2 code (if the underlying codec supports it.) </p>
</div>
</div>
@@ -336,7 +378,7 @@ Variables</h2></td></tr>
</div>
<div class="memdoc">
<p>Turn off CPU auto-detection and force TurboJPEG to use SSE3 code (64-bit IPP version only) </p>
<p>Turn off CPU auto-detection and force TurboJPEG to use SSE3 code (if the underlying codec supports it.) </p>
</div>
</div>
@@ -537,24 +579,40 @@ Variables</h2></td></tr>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="ggac916144e26c3817ac514e64ae5d12e2aa83973bebb7e2dc6fa8bae89ff3f42e01"></a><!-- doxytag: member="TJPF_RGBX" ref="ggac916144e26c3817ac514e64ae5d12e2aa83973bebb7e2dc6fa8bae89ff3f42e01" args="" -->TJPF_RGBX</em>&nbsp;</td><td>
<p>RGBX pixel format. </p>
<p>The red, green, and blue components in the image are stored in 4-byte pixels in the order R, G, B from lowest to highest byte address within each pixel. </p>
<p>The red, green, and blue components in the image are stored in 4-byte pixels in the order R, G, B from lowest to highest byte address within each pixel. The X component is ignored when compressing and undefined when decompressing. </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="ggac916144e26c3817ac514e64ae5d12e2aa2a1fbf569ca79897eae886e3376ca4c8"></a><!-- doxytag: member="TJPF_BGRX" ref="ggac916144e26c3817ac514e64ae5d12e2aa2a1fbf569ca79897eae886e3376ca4c8" args="" -->TJPF_BGRX</em>&nbsp;</td><td>
<p>BGRX pixel format. </p>
<p>The red, green, and blue components in the image are stored in 4-byte pixels in the order B, G, R from lowest to highest byte address within each pixel. </p>
<p>The red, green, and blue components in the image are stored in 4-byte pixels in the order B, G, R from lowest to highest byte address within each pixel. The X component is ignored when compressing and undefined when decompressing. </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="ggac916144e26c3817ac514e64ae5d12e2aaf6603b27147de47e212e75dac027b2af"></a><!-- doxytag: member="TJPF_XBGR" ref="ggac916144e26c3817ac514e64ae5d12e2aaf6603b27147de47e212e75dac027b2af" args="" -->TJPF_XBGR</em>&nbsp;</td><td>
<p>XBGR pixel format. </p>
<p>The red, green, and blue components in the image are stored in 4-byte pixels in the order R, G, B from highest to lowest byte address within each pixel. </p>
<p>The red, green, and blue components in the image are stored in 4-byte pixels in the order R, G, B from highest to lowest byte address within each pixel. The X component is ignored when compressing and undefined when decompressing. </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="ggac916144e26c3817ac514e64ae5d12e2aadae996905efcfa3b42a0bb3bea7f9d84"></a><!-- doxytag: member="TJPF_XRGB" ref="ggac916144e26c3817ac514e64ae5d12e2aadae996905efcfa3b42a0bb3bea7f9d84" args="" -->TJPF_XRGB</em>&nbsp;</td><td>
<p>XRGB pixel format. </p>
<p>The red, green, and blue components in the image are stored in 4-byte pixels in the order B, G, R from highest to lowest byte address within each pixel. </p>
<p>The red, green, and blue components in the image are stored in 4-byte pixels in the order B, G, R from highest to lowest byte address within each pixel. The X component is ignored when compressing and undefined when decompressing. </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="ggac916144e26c3817ac514e64ae5d12e2aa5431b54b015337705f13118073711a1a"></a><!-- doxytag: member="TJPF_GRAY" ref="ggac916144e26c3817ac514e64ae5d12e2aa5431b54b015337705f13118073711a1a" args="" -->TJPF_GRAY</em>&nbsp;</td><td>
<p>Grayscale pixel format. </p>
<p>Each 1-byte pixel represents a luminance (brightness) level from 0 to 255. </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="ggac916144e26c3817ac514e64ae5d12e2aa88d2e88fab67f6503cf972e14851cc12"></a><!-- doxytag: member="TJPF_RGBA" ref="ggac916144e26c3817ac514e64ae5d12e2aa88d2e88fab67f6503cf972e14851cc12" args="" -->TJPF_RGBA</em>&nbsp;</td><td>
<p>RGBA pixel format. </p>
<p>This is the same as <a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa83973bebb7e2dc6fa8bae89ff3f42e01">TJPF_RGBX</a>, except that when decompressing, the X component is guaranteed to be 0xFF, which can be interpreted as an opaque alpha channel. </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="ggac916144e26c3817ac514e64ae5d12e2aac037ff1845cf9b74bb81a3659c2b9fb4"></a><!-- doxytag: member="TJPF_BGRA" ref="ggac916144e26c3817ac514e64ae5d12e2aac037ff1845cf9b74bb81a3659c2b9fb4" args="" -->TJPF_BGRA</em>&nbsp;</td><td>
<p>BGRA pixel format. </p>
<p>This is the same as <a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa2a1fbf569ca79897eae886e3376ca4c8">TJPF_BGRX</a>, except that when decompressing, the X component is guaranteed to be 0xFF, which can be interpreted as an opaque alpha channel. </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="ggac916144e26c3817ac514e64ae5d12e2aa1ba1a7f1631dbeaa49a0a85fc4a40081"></a><!-- doxytag: member="TJPF_ABGR" ref="ggac916144e26c3817ac514e64ae5d12e2aa1ba1a7f1631dbeaa49a0a85fc4a40081" args="" -->TJPF_ABGR</em>&nbsp;</td><td>
<p>ABGR pixel format. </p>
<p>This is the same as <a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aaf6603b27147de47e212e75dac027b2af">TJPF_XBGR</a>, except that when decompressing, the X component is guaranteed to be 0xFF, which can be interpreted as an opaque alpha channel. </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="ggac916144e26c3817ac514e64ae5d12e2aae8f846ed9d9de99b6e1dfe448848765c"></a><!-- doxytag: member="TJPF_ARGB" ref="ggac916144e26c3817ac514e64ae5d12e2aae8f846ed9d9de99b6e1dfe448848765c" args="" -->TJPF_ARGB</em>&nbsp;</td><td>
<p>ARGB pixel format. </p>
<p>This is the same as <a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aadae996905efcfa3b42a0bb3bea7f9d84">TJPF_XRGB</a>, except that when decompressing, the X component is guaranteed to be 0xFF, which can be interpreted as an opaque alpha channel. </p>
</td></tr>
</table>
</dd>
</dl>
@@ -861,7 +919,7 @@ Variables</h2></td></tr>
<li>pre-allocate the buffer to a "worst case" size determined by calling <a class="el" href="group___turbo_j_p_e_g.html#gaccc5bca7f12fcdcc302e6e1c6d4b311b" title="The maximum size of the buffer (in bytes) required to hold a JPEG image with the given parameters...">tjBufSize()</a>. This should ensure that the buffer never has to be re-allocated (setting <a class="el" href="group___turbo_j_p_e_g.html#ga8808d403c68b62aaa58a4c1e58e98963" title="Disable buffer (re)allocation.">TJFLAG_NOREALLOC</a> guarantees this.)</li>
</ol>
If you choose option 1, <code>*jpegSize</code> should be set to the size of your pre-allocated buffer. In any case, unless you have set <a class="el" href="group___turbo_j_p_e_g.html#ga8808d403c68b62aaa58a4c1e58e98963" title="Disable buffer (re)allocation.">TJFLAG_NOREALLOC</a>, you should always check <code>*jpegBuf</code> upon return from this function, as it may have changed. </td></tr>
<tr><td class="paramname">jpegSize</td><td>pointer to an unsigned long variable which holds the size of the JPEG image buffer. If <code>*jpegBuf</code> points to a pre-allocated buffer, then <code>*jpegSize</code> should be set to the size of the buffer. Upon return, <code>*jpegSize</code> will contain the size of the JPEG image (in bytes.) </td></tr>
<tr><td class="paramname">jpegSize</td><td>pointer to an unsigned long variable that holds the size of the JPEG image buffer. If <code>*jpegBuf</code> points to a pre-allocated buffer, then <code>*jpegSize</code> should be set to the size of the buffer. Upon return, <code>*jpegSize</code> will contain the size of the JPEG image (in bytes.) </td></tr>
<tr><td class="paramname">jpegSubsamp</td><td>the level of chrominance subsampling to be used when generating the JPEG image (see <a class="el" href="group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074">Chrominance subsampling options</a>.) </td></tr>
<tr><td class="paramname">jpegQual</td><td>the image quality of the generated JPEG image (1 = worst, 100 = best) </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>
@@ -945,7 +1003,7 @@ If you choose option 1, <code>*jpegSize</code> should be set to the size of your
<tr><td class="paramname">handle</td><td>a handle to a TurboJPEG decompressor or transformer instance </td></tr>
<tr><td class="paramname">jpegBuf</td><td>pointer to a buffer containing the JPEG image to decompress </td></tr>
<tr><td class="paramname">jpegSize</td><td>size of the JPEG image (in bytes) </td></tr>
<tr><td class="paramname">dstBuf</td><td>pointer to an image buffer which will receive the decompressed image. This buffer should normally be <code>pitch * scaledHeight</code> bytes in size, where <code>scaledHeight</code> can be determined by calling <a class="el" href="group___turbo_j_p_e_g.html#ga84878bb65404204743aa18cac02781df" title="Compute the scaled value of dimension using the given scaling factor.">TJSCALED()</a> with the JPEG image height and one of the scaling factors returned by <a class="el" href="group___turbo_j_p_e_g.html#ga6449044b9af402999ccf52f401333be8" title="Returns a list of fractional scaling factors that the JPEG decompressor in this implementation of Tur...">tjGetScalingFactors()</a>. The dstBuf pointer may also be used to decompress into a specific region of a larger buffer. </td></tr>
<tr><td class="paramname">dstBuf</td><td>pointer to an image buffer that will receive the decompressed image. This buffer should normally be <code>pitch * scaledHeight</code> bytes in size, where <code>scaledHeight</code> can be determined by calling <a class="el" href="group___turbo_j_p_e_g.html#ga84878bb65404204743aa18cac02781df" title="Compute the scaled value of dimension using the given scaling factor.">TJSCALED()</a> with the JPEG image height and one of the scaling factors returned by <a class="el" href="group___turbo_j_p_e_g.html#ga6449044b9af402999ccf52f401333be8" title="Returns a list of fractional scaling factors that the JPEG decompressor in this implementation of Tur...">tjGetScalingFactors()</a>. The dstBuf pointer may also be used to decompress into a specific region of a larger buffer. </td></tr>
<tr><td class="paramname">width</td><td>desired width (in pixels) of the destination image. If this is smaller than the width of the JPEG image being decompressed, then TurboJPEG will use scaling in the JPEG decompressor to generate the largest possible image that will fit within the desired width. If width is set to 0, then only the height will be considered when determining the scaled image size. </td></tr>
<tr><td class="paramname">pitch</td><td>bytes per line of the destination image. Normally, this is <code>scaledWidth * <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 decompressed image is unpadded, else <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>(scaledWidth * <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 decompressed image is padded to the nearest 32-bit boundary, as is the case for Windows bitmaps. (NOTE: <code>scaledWidth</code> can be determined by calling <a class="el" href="group___turbo_j_p_e_g.html#ga84878bb65404204743aa18cac02781df" title="Compute the scaled value of dimension using the given scaling factor.">TJSCALED()</a> with the JPEG image width and one of the scaling factors returned by <a class="el" href="group___turbo_j_p_e_g.html#ga6449044b9af402999ccf52f401333be8" title="Returns a list of fractional scaling factors that the JPEG decompressor in this implementation of Tur...">tjGetScalingFactors()</a>.) 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>scaledWidth * <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>desired height (in pixels) of the destination image. If this is smaller than the height of the JPEG image being decompressed, then TurboJPEG will use scaling in the JPEG decompressor to generate the largest possible image that will fit within the desired height. If height is set to 0, then only the width will be considered when determining the scaled image size. </td></tr>
@@ -1013,9 +1071,9 @@ If you choose option 1, <code>*jpegSize</code> should be set to the size of your
<tr><td class="paramname">handle</td><td>a handle to a TurboJPEG decompressor or transformer instance </td></tr>
<tr><td class="paramname">jpegBuf</td><td>pointer to a buffer containing a JPEG image </td></tr>
<tr><td class="paramname">jpegSize</td><td>size of the JPEG image (in bytes) </td></tr>
<tr><td class="paramname">width</td><td>pointer to an integer variable which will receive the width (in pixels) of the JPEG image </td></tr>
<tr><td class="paramname">height</td><td>pointer to an integer variable which will receive the height (in pixels) of the JPEG image </td></tr>
<tr><td class="paramname">jpegSubsamp</td><td>pointer to an integer variable which will receive the level of chrominance subsampling used when compressing the JPEG image (see <a class="el" href="group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074">Chrominance subsampling options</a>.)</td></tr>
<tr><td class="paramname">width</td><td>pointer to an integer variable that will receive the width (in pixels) of the JPEG image </td></tr>
<tr><td class="paramname">height</td><td>pointer to an integer variable that will receive the height (in pixels) of the JPEG image </td></tr>
<tr><td class="paramname">jpegSubsamp</td><td>pointer to an integer variable that will receive the level of chrominance subsampling used when compressing the JPEG image (see <a class="el" href="group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074">Chrominance subsampling options</a>.)</td></tr>
</table>
</dd>
</dl>
@@ -1073,7 +1131,7 @@ If you choose option 1, <code>*jpegSize</code> should be set to the size of your
<tr><td class="paramname">handle</td><td>a handle to a TurboJPEG decompressor or transformer instance </td></tr>
<tr><td class="paramname">jpegBuf</td><td>pointer to a buffer containing the JPEG image to decompress </td></tr>
<tr><td class="paramname">jpegSize</td><td>size of the JPEG image (in bytes) </td></tr>
<tr><td class="paramname">dstBuf</td><td>pointer to an image buffer which will receive the YUV image. Use <a class="el" href="group___turbo_j_p_e_g.html#ga9d0cb06fd5052d21b6f2b382db8b219c" title="The size of the buffer (in bytes) required to hold a YUV planar image with the given parameters...">tjBufSizeYUV</a> to determine the appropriate size for this buffer based on the image width, height, and level of subsampling. </td></tr>
<tr><td class="paramname">dstBuf</td><td>pointer to an image buffer that will receive the YUV image. Use <a class="el" href="group___turbo_j_p_e_g.html#ga9d0cb06fd5052d21b6f2b382db8b219c" title="The size of the buffer (in bytes) required to hold a YUV planar image with the given parameters...">tjBufSizeYUV</a> to determine the appropriate size for this buffer based on the image width, height, and level of subsampling. </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>
@@ -1185,7 +1243,7 @@ If you choose option 1, <code>*jpegSize</code> should be set to the size of your
<tr><td class="paramname">pitch</td><td>bytes per line of the source 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 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 image is padded to the nearest 32-bit boundary, as is the case for Windows bitmaps. You can also be clever and use this 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 image </td></tr>
<tr><td class="paramname">pixelFormat</td><td>pixel format of the source image (see <a class="el" href="group___turbo_j_p_e_g.html#gac916144e26c3817ac514e64ae5d12e2a">Pixel formats</a>.) </td></tr>
<tr><td class="paramname">dstBuf</td><td>pointer to an image buffer which will receive the YUV image. Use <a class="el" href="group___turbo_j_p_e_g.html#ga9d0cb06fd5052d21b6f2b382db8b219c" title="The size of the buffer (in bytes) required to hold a YUV planar image with the given parameters...">tjBufSizeYUV()</a> to determine the appropriate size for this buffer based on the image width, height, and level of chrominance subsampling. </td></tr>
<tr><td class="paramname">dstBuf</td><td>pointer to an image buffer that will receive the YUV image. Use <a class="el" href="group___turbo_j_p_e_g.html#ga9d0cb06fd5052d21b6f2b382db8b219c" title="The size of the buffer (in bytes) required to hold a YUV planar image with the given parameters...">tjBufSizeYUV()</a> to determine the appropriate size for this buffer based on the image width, height, and level of chrominance subsampling. </td></tr>
<tr><td class="paramname">subsamp</td><td>the level of chrominance subsampling to be used when generating the YUV image (see <a class="el" href="group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074">Chrominance subsampling options</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>
@@ -1403,7 +1461,7 @@ If you choose option 1, <code>*jpegSize</code> should be set to the size of your
<li>pre-allocate the buffer to a "worst case" size determined by calling <a class="el" href="group___turbo_j_p_e_g.html#gaccc5bca7f12fcdcc302e6e1c6d4b311b" title="The maximum size of the buffer (in bytes) required to hold a JPEG image with the given parameters...">tjBufSize()</a> with the cropped width and height. This should ensure that the buffer never has to be re-allocated (setting <a class="el" href="group___turbo_j_p_e_g.html#ga8808d403c68b62aaa58a4c1e58e98963" title="Disable buffer (re)allocation.">TJFLAG_NOREALLOC</a> guarantees this.)</li>
</ol>
If you choose option 1, <code>dstSizes[i]</code> should be set to the size of your pre-allocated buffer. In any case, unless you have set <a class="el" href="group___turbo_j_p_e_g.html#ga8808d403c68b62aaa58a4c1e58e98963" title="Disable buffer (re)allocation.">TJFLAG_NOREALLOC</a>, you should always check <code>dstBufs[i]</code> upon return from this function, as it may have changed. </td></tr>
<tr><td class="paramname">dstSizes</td><td>pointer to an array of n unsigned long variables which will receive the actual sizes (in bytes) of each transformed JPEG image. If <code>dstBufs[i]</code> points to a pre-allocated buffer, then <code>dstSizes[i]</code> should be set to the size of the buffer. Upon return, <code>dstSizes[i]</code> will contain the size of the JPEG image (in bytes.) </td></tr>
<tr><td class="paramname">dstSizes</td><td>pointer to an array of n unsigned long variables that will receive the actual sizes (in bytes) of each transformed JPEG image. If <code>dstBufs[i]</code> points to a pre-allocated buffer, then <code>dstSizes[i]</code> should be set to the size of the buffer. Upon return, <code>dstSizes[i]</code> will contain the size of the JPEG image (in bytes.) </td></tr>
<tr><td class="paramname">transforms</td><td>pointer to an array of n tjtransform structures, each of which specifies the transform parameters and/or cropping region for the corresponding transformed output image. </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>
@@ -1536,7 +1594,7 @@ If you choose option 1, <code>dstSizes[i]</code> should be set to the size of yo
</iframe>
</div>
<hr class="footer"/><address class="footer"><small>Generated on Tue Sep 20 2011 13:18:32 for TurboJPEG by&#160;
<hr class="footer"/><address class="footer"><small>Generated on Fri Jun 29 2012 18:14:55 for TurboJPEG by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>

View File

@@ -19,7 +19,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">TurboJPEG&#160;<span id="projectnumber">1.2</span></div>
<div id="projectname">TurboJPEG&#160;<span id="projectnumber">1.2.1</span></div>
</td>
</tr>
</tbody>
@@ -69,7 +69,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
</iframe>
</div>
<hr class="footer"/><address class="footer"><small>Generated on Tue Sep 20 2011 13:18:32 for TurboJPEG by&#160;
<hr class="footer"/><address class="footer"><small>Generated on Fri Jun 29 2012 18:14:55 for TurboJPEG by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>

View File

@@ -19,7 +19,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">TurboJPEG&#160;<span id="projectnumber">1.2</span></div>
<div id="projectname">TurboJPEG&#160;<span id="projectnumber">1.2.1</span></div>
</td>
</tr>
</tbody>
@@ -72,7 +72,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
</iframe>
</div>
<hr class="footer"/><address class="footer"><small>Generated on Tue Sep 20 2011 13:18:32 for TurboJPEG by&#160;
<hr class="footer"/><address class="footer"><small>Generated on Fri Jun 29 2012 18:14:55 for TurboJPEG by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>

View File

@@ -19,7 +19,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">TurboJPEG&#160;<span id="projectnumber">1.2</span></div>
<div id="projectname">TurboJPEG&#160;<span id="projectnumber">1.2.1</span></div>
</td>
</tr>
</tbody>
@@ -165,7 +165,7 @@ Data Fields</h2></td></tr>
</iframe>
</div>
<hr class="footer"/><address class="footer"><small>Generated on Tue Sep 20 2011 13:18:32 for TurboJPEG by&#160;
<hr class="footer"/><address class="footer"><small>Generated on Fri Jun 29 2012 18:14:55 for TurboJPEG by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>

View File

@@ -19,7 +19,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">TurboJPEG&#160;<span id="projectnumber">1.2</span></div>
<div id="projectname">TurboJPEG&#160;<span id="projectnumber">1.2.1</span></div>
</td>
</tr>
</tbody>
@@ -127,7 +127,7 @@ Data Fields</h2></td></tr>
</iframe>
</div>
<hr class="footer"/><address class="footer"><small>Generated on Tue Sep 20 2011 13:18:32 for TurboJPEG by&#160;
<hr class="footer"/><address class="footer"><small>Generated on Fri Jun 29 2012 18:14:55 for TurboJPEG by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>

View File

@@ -19,7 +19,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">TurboJPEG&#160;<span id="projectnumber">1.2</span></div>
<div id="projectname">TurboJPEG&#160;<span id="projectnumber">1.2.1</span></div>
</td>
</tr>
</tbody>
@@ -191,7 +191,7 @@ Data Fields</h2></td></tr>
</iframe>
</div>
<hr class="footer"/><address class="footer"><small>Generated on Tue Sep 20 2011 13:18:32 for TurboJPEG by&#160;
<hr class="footer"/><address class="footer"><small>Generated on Fri Jun 29 2012 18:14:55 for TurboJPEG by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>

View File

@@ -1,5 +1,5 @@
PROJECT_NAME = TurboJPEG
PROJECT_NUMBER = 1.2
PROJECT_NUMBER = 1.2.1
OUTPUT_DIRECTORY = doc/
USE_WINDOWS_ENCODING = NO
OPTIMIZE_OUTPUT_FOR_C = YES

View File

@@ -534,17 +534,17 @@ In general, it's worth trying the maximum optimization level of your compiler,
and experimenting with any optional optimizations such as loop unrolling.
(Unfortunately, far too many compilers have optimizer bugs ... be prepared to
back off if the code fails self-test.) If you do any experimentation along
these lines, please report the optimal settings to jpeg-info@uc.ag so we
can mention them in future releases. Be sure to specify your machine
and compiler version.
these lines, please report the optimal settings to jpeg-info@jpegclub.org so
we can mention them in future releases. Be sure to specify your machine and
compiler version.
HINTS FOR SPECIFIC SYSTEMS
==========================
We welcome reports on changes needed for systems not mentioned here. Submit
'em to jpeg-info@uc.ag. Also, if configure or ckconfig.c is wrong about how
to configure the JPEG software for your system, please let us know.
'em to jpeg-info@jpegclub.org. Also, if configure or ckconfig.c is wrong
about how to configure the JPEG software for your system, please let us know.
Acorn RISC OS:

View File

@@ -18,7 +18,7 @@ compress and decompress JPEG images in memory.
Performance Pitfalls
--------------------
The TurboJPEG Java front end defines several convenience methods which can
The TurboJPEG Java front end defines several convenience methods that can
allocate image buffers or instantiate classes to hold the result of compress,
decompress, or transform operations. However, if you use these methods, then
be mindful of the amount of new data you are creating on the heap. It may be

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C)2011 D. R. Commander. All Rights Reserved.
* Copyright (C)2011-2012 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:
@@ -81,6 +81,12 @@ public class TJExample implements TJCustomFilter {
System.out.println(" for 4:2:0.)\n");
System.out.println("-display = Display output image (Output file need not be specified in this");
System.out.println(" case.)\n");
System.out.println("-fastupsample = Use the fastest chrominance upsampling algorithm available in");
System.out.println(" the underlying codec\n");
System.out.println("-fastdct = Use the fastest DCT/IDCT algorithms available in the underlying");
System.out.println(" codec\n");
System.out.println("-accuratedct = Use the most accurate DCT/IDCT algorithms available in the");
System.out.println(" underlying codec\n");
System.exit(1);
}
@@ -92,6 +98,7 @@ public class TJExample implements TJCustomFilter {
BufferedImage img = null; byte[] bmpBuf = null;
TJTransform xform = new TJTransform();
int flags = 0;
try {
@@ -187,6 +194,18 @@ public class TJExample implements TJCustomFilter {
}
if(argv[i].substring(0, 2).equalsIgnoreCase("-d"))
display = true;
if(argv[i].equalsIgnoreCase("-fastupsample")) {
System.out.println("Using fast upsampling code");
flags |= TJ.FLAG_FASTUPSAMPLE;
}
if(argv[i].equalsIgnoreCase("-fastdct")) {
System.out.println("Using fastest DCT/IDCT algorithm");
flags |= TJ.FLAG_FASTDCT;
}
if(argv[i].equalsIgnoreCase("-accuratedct")) {
System.out.println("Using most accurate DCT/IDCT algorithm");
flags |= TJ.FLAG_ACCURATEDCT;
}
}
}
String[] inFileTokens = argv[0].split("\\.");
@@ -247,8 +266,9 @@ public class TJExample implements TJCustomFilter {
height = scaleFactor.getScaled(height);
if(!outFormat.equalsIgnoreCase("jpg"))
img = tjd.decompress(width, height, BufferedImage.TYPE_INT_RGB, 0);
else bmpBuf = tjd.decompress(width, 0, height, TJ.PF_BGRX, 0);
img = tjd.decompress(width, height, BufferedImage.TYPE_INT_RGB,
flags);
else bmpBuf = tjd.decompress(width, 0, height, TJ.PF_BGRX, flags);
tjd.close();
}
else {
@@ -282,10 +302,10 @@ public class TJExample implements TJCustomFilter {
tjc.setSubsamp(outSubsamp);
tjc.setJPEGQuality(outQual);
if(img != null)
jpegBuf = tjc.compress(img, 0);
jpegBuf = tjc.compress(img, flags);
else {
tjc.setSourceImage(bmpBuf, width, 0, height, TJ.PF_BGRX);
jpegBuf = tjc.compress(0);
jpegBuf = tjc.compress(flags);
}
jpegSize = tjc.getCompressedSize();
tjc.close();

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C)2011 D. R. Commander. All Rights Reserved.
* Copyright (C)2011-2012 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:
@@ -58,11 +58,12 @@ public class TJUnitTest {
};
private final static String pixFormatStr[] = {
"RGB", "BGR", "RGBX", "BGRX", "XBGR", "XRGB", "Grayscale"
"RGB", "BGR", "RGBX", "BGRX", "XBGR", "XRGB", "Grayscale",
"RGBA", "BGRA", "ABGR", "ARGB"
};
private final static int alphaOffset[] = {
-1, -1, 3, 3, 0, 0, -1
-1, -1, -1, -1, -1, -1, -1, 3, 3, 0, 0
};
private final static int _3byteFormats[] = {
@@ -112,12 +113,16 @@ public class TJUnitTest {
else
return TJ.PF_RGBX;
case BufferedImage.TYPE_INT_RGB:
case BufferedImage.TYPE_INT_ARGB:
case BufferedImage.TYPE_INT_ARGB_PRE:
if(byteOrder == ByteOrder.BIG_ENDIAN)
return TJ.PF_XRGB;
else
return TJ.PF_BGRX;
case BufferedImage.TYPE_INT_ARGB:
case BufferedImage.TYPE_INT_ARGB_PRE:
if(byteOrder == ByteOrder.BIG_ENDIAN)
return TJ.PF_ARGB;
else
return TJ.PF_BGRA;
}
return 0;
}
@@ -760,6 +765,9 @@ public class TJUnitTest {
for(int pf : formats) {
for(int i = 0; i < 2; i++) {
int flags = 0;
if (subsamp == TJ.SAMP_422 || subsamp == TJ.SAMP_420
|| subsamp == TJ.SAMP_440)
flags |= TJ.FLAG_FASTUPSAMPLE;
if(i == 1) {
if(yuv == YUVDECODE) {
tjc.close(); tjd.close(); return;
@@ -769,6 +777,9 @@ public class TJUnitTest {
size = compTest(tjc, dstBuf, w, h, pf, baseName, subsamp, 100,
flags);
decompTest(tjd, dstBuf, size, w, h, pf, baseName, subsamp, flags);
if(pf >= TJ.PF_RGBX && pf <= TJ.PF_XRGB && !bi)
decompTest(tjd, dstBuf, size, w, h, pf + (TJ.PF_RGBA - TJ.PF_RGBX),
baseName, subsamp, flags);
}
}
}
@@ -842,20 +853,18 @@ public class TJUnitTest {
if(doyuv) yuv = YUVENCODE;
doTest(35, 39, bi ? _3byteFormatsBI : _3byteFormats, TJ.SAMP_444, testName);
doTest(39, 41, bi ? _4byteFormatsBI : _4byteFormats, TJ.SAMP_444, testName);
if(doyuv) {
doTest(41, 35, bi ? _3byteFormatsBI : _3byteFormats, TJ.SAMP_422,
testName);
doTest(35, 39, bi ? _4byteFormatsBI : _4byteFormats, TJ.SAMP_422,
testName);
doTest(39, 41, bi ? _3byteFormatsBI : _3byteFormats, TJ.SAMP_420,
testName);
doTest(41, 35, bi ? _4byteFormatsBI : _4byteFormats, TJ.SAMP_420,
testName);
doTest(35, 39, bi ? _3byteFormatsBI : _3byteFormats, TJ.SAMP_440,
testName);
doTest(39, 41, bi ? _4byteFormatsBI : _4byteFormats, TJ.SAMP_440,
testName);
}
doTest(41, 35, bi ? _3byteFormatsBI : _3byteFormats, TJ.SAMP_422,
testName);
doTest(35, 39, bi ? _4byteFormatsBI : _4byteFormats, TJ.SAMP_422,
testName);
doTest(39, 41, bi ? _3byteFormatsBI : _3byteFormats, TJ.SAMP_420,
testName);
doTest(41, 35, bi ? _4byteFormatsBI : _4byteFormats, TJ.SAMP_420,
testName);
doTest(35, 39, bi ? _3byteFormatsBI : _3byteFormats, TJ.SAMP_440,
testName);
doTest(39, 41, bi ? _4byteFormatsBI : _4byteFormats, TJ.SAMP_440,
testName);
doTest(35, 39, bi ? onlyGrayBI : onlyGray, TJ.SAMP_GRAY, testName);
doTest(39, 41, bi ? _3byteFormatsBI : _3byteFormats, TJ.SAMP_GRAY,
testName);

View File

@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_26) on Mon Sep 19 23:46:08 CDT 2011 -->
<!-- Generated by javadoc (build 1.6.0_33) on Fri Jun 29 14:29:14 CDT 2012 -->
<TITLE>
All Classes
</TITLE>
<META NAME="date" CONTENT="2011-09-19">
<META NAME="date" CONTENT="2012-06-29">
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">

View File

@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_26) on Mon Sep 19 23:46:08 CDT 2011 -->
<!-- Generated by javadoc (build 1.6.0_33) on Fri Jun 29 14:29:14 CDT 2012 -->
<TITLE>
All Classes
</TITLE>
<META NAME="date" CONTENT="2011-09-19">
<META NAME="date" CONTENT="2012-06-29">
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">

View File

@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_26) on Mon Sep 19 23:46:08 CDT 2011 -->
<!-- Generated by javadoc (build 1.6.0_33) on Fri Jun 29 14:29:14 CDT 2012 -->
<TITLE>
Constant Field Values
</TITLE>
<META NAME="date" CONTENT="2011-09-19">
<META NAME="date" CONTENT="2012-06-29">
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
@@ -101,12 +101,24 @@ org.libjpegturbo.*</FONT></TH>
<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>
<TR BGCOLOR="white" CLASS="TableRowColor">
<A NAME="org.libjpegturbo.turbojpeg.TJ.FLAG_ACCURATEDCT"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
<CODE>public&nbsp;static&nbsp;final&nbsp;int</CODE></FONT></TD>
<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>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<A NAME="org.libjpegturbo.turbojpeg.TJ.FLAG_BOTTOMUP"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
<CODE>public&nbsp;static&nbsp;final&nbsp;int</CODE></FONT></TD>
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#FLAG_BOTTOMUP">FLAG_BOTTOMUP</A></CODE></TD>
<TD ALIGN="right"><CODE>2</CODE></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<A NAME="org.libjpegturbo.turbojpeg.TJ.FLAG_FASTDCT"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
<CODE>public&nbsp;static&nbsp;final&nbsp;int</CODE></FONT></TD>
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#FLAG_FASTDCT">FLAG_FASTDCT</A></CODE></TD>
<TD ALIGN="right"><CODE>2048</CODE></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<A NAME="org.libjpegturbo.turbojpeg.TJ.FLAG_FASTUPSAMPLE"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
<CODE>public&nbsp;static&nbsp;final&nbsp;int</CODE></FONT></TD>
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#FLAG_FASTUPSAMPLE">FLAG_FASTUPSAMPLE</A></CODE></TD>
@@ -140,7 +152,7 @@ org.libjpegturbo.*</FONT></TH>
<A NAME="org.libjpegturbo.turbojpeg.TJ.NUMPF"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
<CODE>public&nbsp;static&nbsp;final&nbsp;int</CODE></FONT></TD>
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#NUMPF">NUMPF</A></CODE></TD>
<TD ALIGN="right"><CODE>7</CODE></TD>
<TD ALIGN="right"><CODE>11</CODE></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<A NAME="org.libjpegturbo.turbojpeg.TJ.NUMSAMP"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
@@ -149,12 +161,30 @@ org.libjpegturbo.*</FONT></TH>
<TD ALIGN="right"><CODE>5</CODE></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<A NAME="org.libjpegturbo.turbojpeg.TJ.PF_ABGR"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
<CODE>public&nbsp;static&nbsp;final&nbsp;int</CODE></FONT></TD>
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#PF_ABGR">PF_ABGR</A></CODE></TD>
<TD ALIGN="right"><CODE>9</CODE></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<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>
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#PF_ARGB">PF_ARGB</A></CODE></TD>
<TD ALIGN="right"><CODE>10</CODE></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<A NAME="org.libjpegturbo.turbojpeg.TJ.PF_BGR"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
<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>
<TD ALIGN="right"><CODE>1</CODE></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<A NAME="org.libjpegturbo.turbojpeg.TJ.PF_BGRA"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
<CODE>public&nbsp;static&nbsp;final&nbsp;int</CODE></FONT></TD>
<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>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<A NAME="org.libjpegturbo.turbojpeg.TJ.PF_BGRX"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
<CODE>public&nbsp;static&nbsp;final&nbsp;int</CODE></FONT></TD>
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#PF_BGRX">PF_BGRX</A></CODE></TD>
@@ -173,6 +203,12 @@ org.libjpegturbo.*</FONT></TH>
<TD ALIGN="right"><CODE>0</CODE></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<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>
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#PF_RGBA">PF_RGBA</A></CODE></TD>
<TD ALIGN="right"><CODE>7</CODE></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<A NAME="org.libjpegturbo.turbojpeg.TJ.PF_RGBX"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
<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>

View File

@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_26) on Mon Sep 19 23:46:08 CDT 2011 -->
<!-- Generated by javadoc (build 1.6.0_33) on Fri Jun 29 14:29:14 CDT 2012 -->
<TITLE>
Deprecated List
</TITLE>
<META NAME="date" CONTENT="2011-09-19">
<META NAME="date" CONTENT="2012-06-29">
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">

View File

@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_26) on Mon Sep 19 23:46:08 CDT 2011 -->
<!-- Generated by javadoc (build 1.6.0_33) on Fri Jun 29 14:29:14 CDT 2012 -->
<TITLE>
API Help
</TITLE>
<META NAME="date" CONTENT="2011-09-19">
<META NAME="date" CONTENT="2012-06-29">
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">

View File

@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_26) on Mon Sep 19 23:46:08 CDT 2011 -->
<!-- Generated by javadoc (build 1.6.0_33) on Fri Jun 29 14:29:14 CDT 2012 -->
<TITLE>
Index
</TITLE>
<META NAME="date" CONTENT="2011-09-19">
<META NAME="date" CONTENT="2012-06-29">
<LINK REL ="stylesheet" TYPE="text/css" HREF="./stylesheet.css" TITLE="Style">
@@ -191,30 +191,37 @@ Method in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJDecompressor.html#finalize()"><B>finalize()</B></A> -
Method in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</A>
<DD>&nbsp;
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJ.html#FLAG_ACCURATEDCT"><B>FLAG_ACCURATEDCT</B></A> -
Static variable in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</A>
<DD>Use the most accurate DCT/IDCT algorithm available in the underlying
codec.
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJ.html#FLAG_BOTTOMUP"><B>FLAG_BOTTOMUP</B></A> -
Static variable in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</A>
<DD>The uncompressed source/destination image is stored in bottom-up (Windows,
OpenGL) order, not top-down (X11) order.
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJ.html#FLAG_FASTDCT"><B>FLAG_FASTDCT</B></A> -
Static variable in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</A>
<DD>Use the fastest DCT/IDCT algorithm available in the underlying codec.
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJ.html#FLAG_FASTUPSAMPLE"><B>FLAG_FASTUPSAMPLE</B></A> -
Static variable in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</A>
<DD>Use fast, inaccurate chrominance upsampling routines in the JPEG
decompressor (libjpeg and libjpeg-turbo versions only.)
<DD>When decompressing, use the fastest chrominance upsampling algorithm
available in the underlying codec.
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJ.html#FLAG_FORCEMMX"><B>FLAG_FORCEMMX</B></A> -
Static variable in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</A>
<DD>Turn off CPU auto-detection and force TurboJPEG to use MMX code
(IPP and 32-bit libjpeg-turbo versions only.)
(if the underlying codec supports it.)
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJ.html#FLAG_FORCESSE"><B>FLAG_FORCESSE</B></A> -
Static variable in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</A>
<DD>Turn off CPU auto-detection and force TurboJPEG to use SSE code
(32-bit IPP and 32-bit libjpeg-turbo versions only.)
(if the underlying codec supports it.)
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJ.html#FLAG_FORCESSE2"><B>FLAG_FORCESSE2</B></A> -
Static variable in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</A>
<DD>Turn off CPU auto-detection and force TurboJPEG to use SSE2 code
(32-bit IPP and 32-bit libjpeg-turbo versions only.)
(if the underlying codec supports it.)
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJ.html#FLAG_FORCESSE3"><B>FLAG_FORCESSE3</B></A> -
Static variable in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</A>
<DD>Turn off CPU auto-detection and force TurboJPEG to use SSE3 code
(64-bit IPP version only.)
(if the underlying codec supports it.)
</DL>
<HR>
<A NAME="_G_"><!-- --></A><H2>
@@ -404,9 +411,18 @@ Variable in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojp
<A NAME="_P_"><!-- --></A><H2>
<B>P</B></H2>
<DL>
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJ.html#PF_ABGR"><B>PF_ABGR</B></A> -
Static variable in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</A>
<DD>ABGR pixel format.
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJ.html#PF_ARGB"><B>PF_ARGB</B></A> -
Static variable in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</A>
<DD>ARGB pixel format.
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJ.html#PF_BGR"><B>PF_BGR</B></A> -
Static variable in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</A>
<DD>BGR pixel format.
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJ.html#PF_BGRA"><B>PF_BGRA</B></A> -
Static variable in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</A>
<DD>BGRA pixel format.
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJ.html#PF_BGRX"><B>PF_BGRX</B></A> -
Static variable in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</A>
<DD>BGRX pixel format.
@@ -416,6 +432,9 @@ Static variable in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJ.html#PF_RGB"><B>PF_RGB</B></A> -
Static variable in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</A>
<DD>RGB pixel format.
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJ.html#PF_RGBA"><B>PF_RGBA</B></A> -
Static variable in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</A>
<DD>RGBA pixel format.
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJ.html#PF_RGBX"><B>PF_RGBX</B></A> -
Static variable in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</A>
<DD>RGBX pixel format.

View File

@@ -2,7 +2,7 @@
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc on Mon Sep 19 23:46:08 CDT 2011-->
<!-- Generated by javadoc on Fri Jun 29 14:29:14 CDT 2012-->
<TITLE>
Generated Documentation (Untitled)
</TITLE>

View File

@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_26) on Mon Sep 19 23:46:08 CDT 2011 -->
<!-- Generated by javadoc (build 1.6.0_33) on Fri Jun 29 14:29:13 CDT 2012 -->
<TITLE>
TJ
</TITLE>
<META NAME="date" CONTENT="2011-09-19">
<META NAME="date" CONTENT="2012-06-29">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
@@ -117,6 +117,15 @@ TurboJPEG utility class (cannot be instantiated)
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html#FLAG_ACCURATEDCT">FLAG_ACCURATEDCT</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Use the most accurate DCT/IDCT algorithm available in the underlying
codec.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html#FLAG_BOTTOMUP">FLAG_BOTTOMUP</A></B></CODE>
<BR>
@@ -126,11 +135,19 @@ TurboJPEG utility class (cannot be instantiated)
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html#FLAG_FASTDCT">FLAG_FASTDCT</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Use the fastest DCT/IDCT algorithm available in the underlying codec.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html#FLAG_FASTUPSAMPLE">FLAG_FASTUPSAMPLE</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Use fast, inaccurate chrominance upsampling routines in the JPEG
decompressor (libjpeg and libjpeg-turbo versions only.)</TD>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;When decompressing, use the fastest chrominance upsampling algorithm
available in the underlying codec.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
@@ -139,7 +156,7 @@ TurboJPEG utility class (cannot be instantiated)
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Turn off CPU auto-detection and force TurboJPEG to use MMX code
(IPP and 32-bit libjpeg-turbo versions only.)</TD>
(if the underlying codec supports it.)</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
@@ -148,7 +165,7 @@ TurboJPEG utility class (cannot be instantiated)
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Turn off CPU auto-detection and force TurboJPEG to use SSE code
(32-bit IPP and 32-bit libjpeg-turbo versions only.)</TD>
(if the underlying codec supports it.)</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
@@ -157,7 +174,7 @@ TurboJPEG utility class (cannot be instantiated)
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Turn off CPU auto-detection and force TurboJPEG to use SSE2 code
(32-bit IPP and 32-bit libjpeg-turbo versions only.)</TD>
(if the underlying codec supports it.)</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
@@ -166,7 +183,7 @@ TurboJPEG utility class (cannot be instantiated)
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Turn off CPU auto-detection and force TurboJPEG to use SSE3 code
(64-bit IPP version only.)</TD>
(if the underlying codec supports it.)</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
@@ -187,6 +204,22 @@ TurboJPEG utility class (cannot be instantiated)
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html#PF_ABGR">PF_ABGR</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ABGR pixel format.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html#PF_ARGB">PF_ARGB</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ARGB pixel format.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html#PF_BGR">PF_BGR</A></B></CODE>
<BR>
@@ -195,6 +228,14 @@ TurboJPEG utility class (cannot be instantiated)
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html#PF_BGRA">PF_BGRA</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;BGRA pixel format.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html#PF_BGRX">PF_BGRX</A></B></CODE>
<BR>
@@ -219,6 +260,14 @@ TurboJPEG utility class (cannot be instantiated)
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html#PF_RGBA">PF_RGBA</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;RGBA pixel format.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html#PF_RGBX">PF_RGBX</A></B></CODE>
<BR>
@@ -538,7 +587,8 @@ public static final int <B>PF_RGBX</B></PRE>
<DL>
<DD>RGBX pixel format. The red, green, and blue components in the image are
stored in 4-byte pixels in the order R, G, B from lowest to highest byte
address within each pixel.
address within each pixel. The X component is ignored when compressing
and undefined when decompressing.
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.PF_RGBX">Constant Field Values</A></DL>
@@ -552,7 +602,8 @@ public static final int <B>PF_BGRX</B></PRE>
<DL>
<DD>BGRX pixel format. The red, green, and blue components in the image are
stored in 4-byte pixels in the order B, G, R from lowest to highest byte
address within each pixel.
address within each pixel. The X component is ignored when compressing
and undefined when decompressing.
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.PF_BGRX">Constant Field Values</A></DL>
@@ -566,7 +617,8 @@ public static final int <B>PF_XBGR</B></PRE>
<DL>
<DD>XBGR pixel format. The red, green, and blue components in the image are
stored in 4-byte pixels in the order R, G, B from highest to lowest byte
address within each pixel.
address within each pixel. The X component is ignored when compressing
and undefined when decompressing.
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.PF_XBGR">Constant Field Values</A></DL>
@@ -580,7 +632,8 @@ public static final int <B>PF_XRGB</B></PRE>
<DL>
<DD>XRGB pixel format. The red, green, and blue components in the image are
stored in 4-byte pixels in the order B, G, R from highest to lowest byte
address within each pixel.
address within each pixel. The X component is ignored when compressing
and undefined when decompressing.
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.PF_XRGB">Constant Field Values</A></DL>
@@ -600,6 +653,62 @@ public static final int <B>PF_GRAY</B></PRE>
</DL>
<HR>
<A NAME="PF_RGBA"><!-- --></A><H3>
PF_RGBA</H3>
<PRE>
public static final int <B>PF_RGBA</B></PRE>
<DL>
<DD>RGBA pixel format. This is the same as <A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html#PF_RGBX"><CODE>PF_RGBX</CODE></A>, except that when
decompressing, the X byte is guaranteed to be 0xFF, which can be
interpreted as an opaque alpha channel.
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.PF_RGBA">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="PF_BGRA"><!-- --></A><H3>
PF_BGRA</H3>
<PRE>
public static final int <B>PF_BGRA</B></PRE>
<DL>
<DD>BGRA pixel format. This is the same as <A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html#PF_BGRX"><CODE>PF_BGRX</CODE></A>, except that when
decompressing, the X byte is guaranteed to be 0xFF, which can be
interpreted as an opaque alpha channel.
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.PF_BGRA">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="PF_ABGR"><!-- --></A><H3>
PF_ABGR</H3>
<PRE>
public static final int <B>PF_ABGR</B></PRE>
<DL>
<DD>ABGR pixel format. This is the same as <A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html#PF_XBGR"><CODE>PF_XBGR</CODE></A>, except that when
decompressing, the X byte is guaranteed to be 0xFF, which can be
interpreted as an opaque alpha channel.
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.PF_ABGR">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="PF_ARGB"><!-- --></A><H3>
PF_ARGB</H3>
<PRE>
public static final int <B>PF_ARGB</B></PRE>
<DL>
<DD>ARGB pixel format. This is the same as <A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html#PF_XRGB"><CODE>PF_XRGB</CODE></A>, except that when
decompressing, the X byte is guaranteed to be 0xFF, which can be
interpreted as an opaque alpha channel.
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.PF_ARGB">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="FLAG_BOTTOMUP"><!-- --></A><H3>
FLAG_BOTTOMUP</H3>
<PRE>
@@ -619,7 +728,7 @@ FLAG_FORCEMMX</H3>
public static final int <B>FLAG_FORCEMMX</B></PRE>
<DL>
<DD>Turn off CPU auto-detection and force TurboJPEG to use MMX code
(IPP and 32-bit libjpeg-turbo versions only.)
(if the underlying codec supports it.)
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.FLAG_FORCEMMX">Constant Field Values</A></DL>
@@ -632,7 +741,7 @@ FLAG_FORCESSE</H3>
public static final int <B>FLAG_FORCESSE</B></PRE>
<DL>
<DD>Turn off CPU auto-detection and force TurboJPEG to use SSE code
(32-bit IPP and 32-bit libjpeg-turbo versions only.)
(if the underlying codec supports it.)
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.FLAG_FORCESSE">Constant Field Values</A></DL>
@@ -645,7 +754,7 @@ FLAG_FORCESSE2</H3>
public static final int <B>FLAG_FORCESSE2</B></PRE>
<DL>
<DD>Turn off CPU auto-detection and force TurboJPEG to use SSE2 code
(32-bit IPP and 32-bit libjpeg-turbo versions only.)
(if the underlying codec supports it.)
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.FLAG_FORCESSE2">Constant Field Values</A></DL>
@@ -658,7 +767,7 @@ FLAG_FORCESSE3</H3>
public static final int <B>FLAG_FORCESSE3</B></PRE>
<DL>
<DD>Turn off CPU auto-detection and force TurboJPEG to use SSE3 code
(64-bit IPP version only.)
(if the underlying codec supports it.)
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.FLAG_FORCESSE3">Constant Field Values</A></DL>
@@ -670,12 +779,50 @@ FLAG_FASTUPSAMPLE</H3>
<PRE>
public static final int <B>FLAG_FASTUPSAMPLE</B></PRE>
<DL>
<DD>Use fast, inaccurate chrominance upsampling routines in the JPEG
decompressor (libjpeg and libjpeg-turbo versions only.)
<DD>When decompressing, use the fastest chrominance upsampling algorithm
available in the underlying codec. The default is to use smooth
upsampling, which creates a smooth transition between neighboring
chrominance components in order to reduce upsampling artifacts in the
decompressed image.
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.FLAG_FASTUPSAMPLE">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="FLAG_FASTDCT"><!-- --></A><H3>
FLAG_FASTDCT</H3>
<PRE>
public static final int <B>FLAG_FASTDCT</B></PRE>
<DL>
<DD>Use the fastest DCT/IDCT algorithm available in the underlying codec. The
default if this flag is not specified is implementation-specific. The
libjpeg implementation, for example, uses the fast algorithm by default
when compressing, because this has been shown to have only a very slight
effect on accuracy, but it uses the accurate algorithm when decompressing,
because this has been shown to have a larger effect.
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.FLAG_FASTDCT">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="FLAG_ACCURATEDCT"><!-- --></A><H3>
FLAG_ACCURATEDCT</H3>
<PRE>
public static final int <B>FLAG_ACCURATEDCT</B></PRE>
<DL>
<DD>Use the most accurate DCT/IDCT algorithm available in the underlying
codec. The default if this flag is not specified is
implementation-specific. The libjpeg implementation, for example, uses
the fast algorithm by default when compressing, because this has been
shown to have only a very slight effect on accuracy, but it uses the
accurate algorithm when decompressing, because this has been shown to have
a larger effect.
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.FLAG_ACCURATEDCT">Constant Field Values</A></DL>
</DL>
<!-- ========= CONSTRUCTOR DETAIL ======== -->

View File

@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_26) on Mon Sep 19 23:46:08 CDT 2011 -->
<!-- Generated by javadoc (build 1.6.0_33) on Fri Jun 29 14:29:13 CDT 2012 -->
<TITLE>
TJCompressor
</TITLE>
<META NAME="date" CONTENT="2011-09-19">
<META NAME="date" CONTENT="2012-06-29">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
@@ -420,7 +420,7 @@ public void <B>compress</B>(byte[]&nbsp;dstBuf,
instance and output a JPEG image to the given destination buffer.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>dstBuf</CODE> - buffer which will receive the JPEG image. Use
<DT><B>Parameters:</B><DD><CODE>dstBuf</CODE> - buffer that will receive the JPEG image. 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 this buffer based on
the image width and height.<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>
<DT><B>Throws:</B>
@@ -461,7 +461,7 @@ public void <B>compress</B>(java.awt.image.BufferedImage&nbsp;srcImage,
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>srcImage</CODE> - a <code>BufferedImage</code> instance containing RGB or
grayscale pixels to be compressed<DD><CODE>dstBuf</CODE> - buffer which will receive the JPEG image. Use
grayscale pixels to be compressed<DD><CODE>dstBuf</CODE> - buffer that will receive the JPEG image. 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 this buffer based on
the image width and height.<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>
<DT><B>Throws:</B>
@@ -513,7 +513,7 @@ public void <B>encodeYUV</B>(byte[]&nbsp;dstBuf,
"YUV420P") format.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>dstBuf</CODE> - buffer which will receive the YUV planar image. Use
<DT><B>Parameters:</B><DD><CODE>dstBuf</CODE> - buffer that will receive the YUV planar image. Use
<A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html#bufSizeYUV(int, int, int)"><CODE>TJ.bufSizeYUV(int, int, int)</CODE></A> to determine the appropriate size for this buffer
based on the image width, height, and level of chrominance subsampling.<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>
<DT><B>Throws:</B>
@@ -555,7 +555,7 @@ public void <B>encodeYUV</B>(java.awt.image.BufferedImage&nbsp;srcImage,
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>srcImage</CODE> - a <code>BufferedImage</code> instance containing RGB or
grayscale pixels to be encoded<DD><CODE>dstBuf</CODE> - buffer which will receive the YUV planar image. Use
grayscale pixels to be encoded<DD><CODE>dstBuf</CODE> - buffer that will receive the YUV planar image. Use
<A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html#bufSizeYUV(int, int, int)"><CODE>TJ.bufSizeYUV(int, int, int)</CODE></A> to determine the appropriate size for this buffer
based on the image width, height, and level of chrominance subsampling.<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>
<DT><B>Throws:</B>

View File

@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_26) on Mon Sep 19 23:46:08 CDT 2011 -->
<!-- Generated by javadoc (build 1.6.0_33) on Fri Jun 29 14:29:13 CDT 2012 -->
<TITLE>
TJCustomFilter
</TITLE>
<META NAME="date" CONTENT="2011-09-19">
<META NAME="date" CONTENT="2012-06-29">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">

View File

@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_26) on Mon Sep 19 23:46:08 CDT 2011 -->
<!-- Generated by javadoc (build 1.6.0_33) on Fri Jun 29 14:29:13 CDT 2012 -->
<TITLE>
TJDecompressor
</TITLE>
<META NAME="date" CONTENT="2011-09-19">
<META NAME="date" CONTENT="2012-06-29">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
@@ -703,7 +703,7 @@ public void <B>decompress</B>(byte[]&nbsp;dstBuf,
instance and output a decompressed image to the given destination buffer.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>dstBuf</CODE> - buffer which will receive the decompressed image. This
<DT><B>Parameters:</B><DD><CODE>dstBuf</CODE> - buffer that will receive the decompressed image. This
buffer should normally be <code>pitch * scaledHeight</code> bytes in size,
where <code>scaledHeight</code> can be determined by calling <code>
scalingFactor.<A HREF="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html#getScaled(int)"><CODE>getScaled</CODE></A>(jpegHeight)
@@ -779,7 +779,7 @@ public void <B>decompressToYUV</B>(byte[]&nbsp;dstBuf,
intermediate buffer copy will be performed within TurboJPEG.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>dstBuf</CODE> - buffer which will receive the YUV planar image. Use
<DT><B>Parameters:</B><DD><CODE>dstBuf</CODE> - buffer that will receive the YUV planar image. Use
<A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html#bufSizeYUV(int, int, int)"><CODE>TJ.bufSizeYUV(int, int, int)</CODE></A> to determine the appropriate size for this buffer
based on the image width, height, and level of chrominance subsampling.<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>
<DT><B>Throws:</B>
@@ -818,7 +818,7 @@ public void <B>decompress</B>(java.awt.image.BufferedImage&nbsp;dstImage,
<code>BufferedImage</code> instance.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>dstImage</CODE> - a <code>BufferedImage</code> instance which will receive
<DT><B>Parameters:</B><DD><CODE>dstImage</CODE> - a <code>BufferedImage</code> instance that will receive
the decompressed 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>
<DT><B>Throws:</B>
<DD><CODE>java.lang.Exception</CODE></DL>

View File

@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_26) on Mon Sep 19 23:46:08 CDT 2011 -->
<!-- Generated by javadoc (build 1.6.0_33) on Fri Jun 29 14:29:13 CDT 2012 -->
<TITLE>
TJScalingFactor
</TITLE>
<META NAME="date" CONTENT="2011-09-19">
<META NAME="date" CONTENT="2012-06-29">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">

View File

@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_26) on Mon Sep 19 23:46:08 CDT 2011 -->
<!-- Generated by javadoc (build 1.6.0_33) on Fri Jun 29 14:29:13 CDT 2012 -->
<TITLE>
TJTransform
</TITLE>
<META NAME="date" CONTENT="2011-09-19">
<META NAME="date" CONTENT="2012-06-29">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
@@ -696,7 +696,7 @@ public <B>TJTransform</B>(java.awt.Rectangle&nbsp;r,
<DD>Create a new lossless transform instance with the given parameters.
<P>
<DL>
<DT><B>Parameters:</B><DD><CODE>r</CODE> - a <code>Rectangle</code> instance which specifies the cropping
<DT><B>Parameters:</B><DD><CODE>r</CODE> - a <code>Rectangle</code> instance that specifies the cropping
region. See <A HREF="../../../org/libjpegturbo/turbojpeg/TJTransform.html#TJTransform(int, int, int, int, int, int, org.libjpegturbo.turbojpeg.TJCustomFilter)"><CODE>TJTransform(int, int, int, int, int, int, TJCustomFilter)</CODE></A> for more
detail.<DD><CODE>op</CODE> - one of the transform operations (<code>OP_*</code>)<DD><CODE>options</CODE> - the bitwise OR of one or more of the transform options
(<code>OPT_*</code>)<DD><CODE>cf</CODE> - an instance of an object that implements the <A HREF="../../../org/libjpegturbo/turbojpeg/TJCustomFilter.html" title="interface in org.libjpegturbo.turbojpeg"><CODE>TJCustomFilter</CODE></A> interface, or null if no custom filter is needed

View File

@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_26) on Mon Sep 19 23:46:08 CDT 2011 -->
<!-- Generated by javadoc (build 1.6.0_33) on Fri Jun 29 14:29:13 CDT 2012 -->
<TITLE>
TJTransformer
</TITLE>
<META NAME="date" CONTENT="2011-09-19">
<META NAME="date" CONTENT="2012-06-29">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">

View File

@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_26) on Mon Sep 19 23:46:08 CDT 2011 -->
<!-- Generated by javadoc (build 1.6.0_33) on Fri Jun 29 14:29:13 CDT 2012 -->
<TITLE>
org.libjpegturbo.turbojpeg
</TITLE>
<META NAME="date" CONTENT="2011-09-19">
<META NAME="date" CONTENT="2012-06-29">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">

View File

@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_26) on Mon Sep 19 23:46:08 CDT 2011 -->
<!-- Generated by javadoc (build 1.6.0_33) on Fri Jun 29 14:29:13 CDT 2012 -->
<TITLE>
org.libjpegturbo.turbojpeg
</TITLE>
<META NAME="date" CONTENT="2011-09-19">
<META NAME="date" CONTENT="2012-06-29">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">

View File

@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_26) on Mon Sep 19 23:46:08 CDT 2011 -->
<!-- Generated by javadoc (build 1.6.0_33) on Fri Jun 29 14:29:13 CDT 2012 -->
<TITLE>
org.libjpegturbo.turbojpeg Class Hierarchy
</TITLE>
<META NAME="date" CONTENT="2011-09-19">
<META NAME="date" CONTENT="2012-06-29">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">

View File

@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_26) on Mon Sep 19 23:46:08 CDT 2011 -->
<!-- Generated by javadoc (build 1.6.0_33) on Fri Jun 29 14:29:14 CDT 2012 -->
<TITLE>
Class Hierarchy
</TITLE>
<META NAME="date" CONTENT="2011-09-19">
<META NAME="date" CONTENT="2012-06-29">
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">

View File

@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_26) on Mon Sep 19 23:46:08 CDT 2011 -->
<!-- Generated by javadoc (build 1.6.0_33) on Fri Jun 29 14:29:14 CDT 2012 -->
<TITLE>
Serialized Form
</TITLE>
<META NAME="date" CONTENT="2011-09-19">
<META NAME="date" CONTENT="2012-06-29">
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C)2011 D. R. Commander. All Rights Reserved.
* Copyright (C)2011-2012 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:
@@ -109,7 +109,7 @@ final public class TJ {
/**
* The number of pixel formats
*/
final public static int NUMPF = 7;
final public static int NUMPF = 11;
/**
* RGB pixel format. The red, green, and blue components in the image are
* stored in 3-byte pixels in the order R, G, B from lowest to highest byte
@@ -125,25 +125,29 @@ final public class TJ {
/**
* RGBX pixel format. The red, green, and blue components in the image are
* stored in 4-byte pixels in the order R, G, B from lowest to highest byte
* address within each pixel.
* address within each pixel. The X component is ignored when compressing
* and undefined when decompressing.
*/
final public static int PF_RGBX = 2;
/**
* BGRX pixel format. The red, green, and blue components in the image are
* stored in 4-byte pixels in the order B, G, R from lowest to highest byte
* address within each pixel.
* address within each pixel. The X component is ignored when compressing
* and undefined when decompressing.
*/
final public static int PF_BGRX = 3;
/**
* XBGR pixel format. The red, green, and blue components in the image are
* stored in 4-byte pixels in the order R, G, B from highest to lowest byte
* address within each pixel.
* address within each pixel. The X component is ignored when compressing
* and undefined when decompressing.
*/
final public static int PF_XBGR = 4;
/**
* XRGB pixel format. The red, green, and blue components in the image are
* stored in 4-byte pixels in the order B, G, R from highest to lowest byte
* address within each pixel.
* address within each pixel. The X component is ignored when compressing
* and undefined when decompressing.
*/
final public static int PF_XRGB = 5;
/**
@@ -151,6 +155,30 @@ final public class TJ {
* (brightness) level from 0 to 255.
*/
final public static int PF_GRAY = 6;
/**
* RGBA pixel format. This is the same as {@link #PF_RGBX}, except that when
* decompressing, the X byte is guaranteed to be 0xFF, which can be
* interpreted as an opaque alpha channel.
*/
final public static int PF_RGBA = 7;
/**
* BGRA pixel format. This is the same as {@link #PF_BGRX}, except that when
* decompressing, the X byte is guaranteed to be 0xFF, which can be
* interpreted as an opaque alpha channel.
*/
final public static int PF_BGRA = 8;
/**
* ABGR pixel format. This is the same as {@link #PF_XBGR}, except that when
* decompressing, the X byte is guaranteed to be 0xFF, which can be
* interpreted as an opaque alpha channel.
*/
final public static int PF_ABGR = 9;
/**
* ARGB pixel format. This is the same as {@link #PF_XRGB}, except that when
* decompressing, the X byte is guaranteed to be 0xFF, which can be
* interpreted as an opaque alpha channel.
*/
final public static int PF_ARGB = 10;
/**
@@ -167,7 +195,7 @@ final public class TJ {
}
final private static int pixelSize[] = {
3, 3, 4, 4, 4, 4, 1
3, 3, 4, 4, 4, 4, 1, 4, 4, 4, 4
};
@@ -189,7 +217,7 @@ final public class TJ {
}
final private static int redOffset[] = {
0, 2, 0, 2, 3, 1, 0
0, 2, 0, 2, 3, 1, 0, 0, 2, 3, 1
};
@@ -211,7 +239,7 @@ final public class TJ {
}
final private static int greenOffset[] = {
1, 1, 1, 1, 2, 2, 0
1, 1, 1, 1, 2, 2, 0, 1, 1, 2, 2
};
@@ -233,7 +261,7 @@ final public class TJ {
}
final private static int blueOffset[] = {
2, 0, 2, 0, 1, 3, 0
2, 0, 2, 0, 1, 3, 0, 2, 0, 1, 3
};
@@ -244,29 +272,51 @@ final public class TJ {
final public static int FLAG_BOTTOMUP = 2;
/**
* Turn off CPU auto-detection and force TurboJPEG to use MMX code
* (IPP and 32-bit libjpeg-turbo versions only.)
* (if the underlying codec supports it.)
*/
final public static int FLAG_FORCEMMX = 8;
/**
* Turn off CPU auto-detection and force TurboJPEG to use SSE code
* (32-bit IPP and 32-bit libjpeg-turbo versions only.)
* (if the underlying codec supports it.)
*/
final public static int FLAG_FORCESSE = 16;
/**
* Turn off CPU auto-detection and force TurboJPEG to use SSE2 code
* (32-bit IPP and 32-bit libjpeg-turbo versions only.)
* (if the underlying codec supports it.)
*/
final public static int FLAG_FORCESSE2 = 32;
/**
* Turn off CPU auto-detection and force TurboJPEG to use SSE3 code
*(64-bit IPP version only.)
* (if the underlying codec supports it.)
*/
final public static int FLAG_FORCESSE3 = 128;
/**
* Use fast, inaccurate chrominance upsampling routines in the JPEG
* decompressor (libjpeg and libjpeg-turbo versions only.)
* When decompressing, use the fastest chrominance upsampling algorithm
* available in the underlying codec. The default is to use smooth
* upsampling, which creates a smooth transition between neighboring
* chrominance components in order to reduce upsampling artifacts in the
* decompressed image.
*/
final public static int FLAG_FASTUPSAMPLE = 256;
/**
* Use the fastest DCT/IDCT algorithm available in the underlying codec. The
* default if this flag is not specified is implementation-specific. The
* libjpeg implementation, for example, uses the fast algorithm by default
* when compressing, because this has been shown to have only a very slight
* effect on accuracy, but it uses the accurate algorithm when decompressing,
* because this has been shown to have a larger effect.
*/
final public static int FLAG_FASTDCT = 2048;
/**
* Use the most accurate DCT/IDCT algorithm available in the underlying
* codec. The default if this flag is not specified is
* implementation-specific. The libjpeg implementation, for example, uses
* the fast algorithm by default when compressing, because this has been
* shown to have only a very slight effect on accuracy, but it uses the
* accurate algorithm when decompressing, because this has been shown to have
* a larger effect.
*/
final public static int FLAG_ACCURATEDCT = 4096;
/**

View File

@@ -131,7 +131,7 @@ public class TJCompressor {
* Compress the uncompressed source image associated with this compressor
* instance and output a JPEG image to the given destination buffer.
*
* @param dstBuf buffer which will receive the JPEG image. Use
* @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 and height.
*
@@ -172,7 +172,7 @@ public class TJCompressor {
* @param srcImage a <code>BufferedImage</code> instance containing RGB or
* grayscale pixels to be compressed
*
* @param dstBuf buffer which will receive the JPEG image. Use
* @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 and height.
*
@@ -274,7 +274,7 @@ public class TJCompressor {
* {@link TJ#SAMP_420}, which produces an image compatible with the I420 (AKA
* "YUV420P") format.
*
* @param dstBuf buffer which will receive the YUV planar image. Use
* @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.
*
@@ -316,7 +316,7 @@ public class TJCompressor {
* @param srcImage a <code>BufferedImage</code> instance containing RGB or
* grayscale pixels to be encoded
*
* @param dstBuf buffer which will receive the YUV planar image. Use
* @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.
*

View File

@@ -234,7 +234,7 @@ public class TJDecompressor {
* Decompress the JPEG source image associated with this decompressor
* instance and output a decompressed image to the given destination buffer.
*
* @param dstBuf buffer which will receive the decompressed image. This
* @param dstBuf buffer that will receive the decompressed image. This
* buffer should normally be <code>pitch * scaledHeight</code> bytes in size,
* where <code>scaledHeight</code> can be determined by calling <code>
* scalingFactor.{@link TJScalingFactor#getScaled getScaled}(jpegHeight)
@@ -327,7 +327,7 @@ public class TJDecompressor {
* size (see {@link TJ#getMCUWidth} and {@link TJ#getMCUHeight}), then an
* intermediate buffer copy will be performed within TurboJPEG.
*
* @param dstBuf buffer which will receive the YUV planar image. Use
* @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.
*
@@ -367,7 +367,7 @@ public class TJDecompressor {
* instance and output a decompressed image to the given
* <code>BufferedImage</code> instance.
*
* @param dstImage a <code>BufferedImage</code> instance which will receive
* @param dstImage a <code>BufferedImage</code> instance that will receive
* the decompressed image
*
* @param flags the bitwise OR of one or more of {@link TJ TJ.FLAG_*}
@@ -399,13 +399,18 @@ public class TJDecompressor {
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;
case BufferedImage.TYPE_INT_ARGB:
case BufferedImage.TYPE_INT_ARGB_PRE:
if(byteOrder == ByteOrder.BIG_ENDIAN)
pixelFormat = TJ.PF_ARGB;
else
pixelFormat = TJ.PF_BGRA;
intPixels = true; break;
default:
throw new Exception("Unsupported BufferedImage format");
}

View File

@@ -166,7 +166,7 @@ public class TJTransform extends Rectangle {
/**
* Create a new lossless transform instance with the given parameters.
*
* @param r a <code>Rectangle</code> instance which specifies the cropping
* @param r a <code>Rectangle</code> instance that specifies the cropping
* region. See {@link
* #TJTransform(int, int, int, int, int, int, TJCustomFilter)} for more
* detail.

View File

@@ -20,7 +20,7 @@ extern "C" {
#undef org_libjpegturbo_turbojpeg_TJ_SAMP_440
#define org_libjpegturbo_turbojpeg_TJ_SAMP_440 4L
#undef org_libjpegturbo_turbojpeg_TJ_NUMPF
#define org_libjpegturbo_turbojpeg_TJ_NUMPF 7L
#define org_libjpegturbo_turbojpeg_TJ_NUMPF 11L
#undef org_libjpegturbo_turbojpeg_TJ_PF_RGB
#define org_libjpegturbo_turbojpeg_TJ_PF_RGB 0L
#undef org_libjpegturbo_turbojpeg_TJ_PF_BGR
@@ -35,6 +35,14 @@ extern "C" {
#define org_libjpegturbo_turbojpeg_TJ_PF_XRGB 5L
#undef org_libjpegturbo_turbojpeg_TJ_PF_GRAY
#define org_libjpegturbo_turbojpeg_TJ_PF_GRAY 6L
#undef org_libjpegturbo_turbojpeg_TJ_PF_RGBA
#define org_libjpegturbo_turbojpeg_TJ_PF_RGBA 7L
#undef org_libjpegturbo_turbojpeg_TJ_PF_BGRA
#define org_libjpegturbo_turbojpeg_TJ_PF_BGRA 8L
#undef org_libjpegturbo_turbojpeg_TJ_PF_ABGR
#define org_libjpegturbo_turbojpeg_TJ_PF_ABGR 9L
#undef org_libjpegturbo_turbojpeg_TJ_PF_ARGB
#define org_libjpegturbo_turbojpeg_TJ_PF_ARGB 10L
#undef org_libjpegturbo_turbojpeg_TJ_FLAG_BOTTOMUP
#define org_libjpegturbo_turbojpeg_TJ_FLAG_BOTTOMUP 2L
#undef org_libjpegturbo_turbojpeg_TJ_FLAG_FORCEMMX

View File

@@ -2,7 +2,7 @@
* jccolext.c
*
* Copyright (C) 1991-1996, Thomas G. Lane.
* Copyright (C) 2009-2011, D. R. Commander.
* Copyright (C) 2009-2012, D. R. Commander.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
@@ -112,3 +112,35 @@ rgb_gray_convert_internal (j_compress_ptr cinfo,
}
}
}
/*
* Convert some rows of samples to the JPEG colorspace.
* This version handles extended RGB->plain RGB conversion
*/
INLINE
LOCAL(void)
rgb_rgb_convert_internal (j_compress_ptr cinfo,
JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
JDIMENSION output_row, int num_rows)
{
register JSAMPROW inptr;
register JSAMPROW outptr0, outptr1, outptr2;
register JDIMENSION col;
JDIMENSION num_cols = cinfo->image_width;
while (--num_rows >= 0) {
inptr = *input_buf++;
outptr0 = output_buf[0][output_row];
outptr1 = output_buf[1][output_row];
outptr2 = output_buf[2][output_row];
output_row++;
for (col = 0; col < num_cols; col++) {
outptr0[col] = GETJSAMPLE(inptr[RGB_RED]);
outptr1[col] = GETJSAMPLE(inptr[RGB_GREEN]);
outptr2[col] = GETJSAMPLE(inptr[RGB_BLUE]);
inptr += RGB_PIXELSIZE;
}
}
}

109
jccolor.c
View File

@@ -3,7 +3,7 @@
*
* Copyright (C) 1991-1996, Thomas G. Lane.
* Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
* Copyright (C) 2009-2011, D. R. Commander.
* Copyright (C) 2009-2012, D. R. Commander.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
@@ -14,6 +14,7 @@
#include "jinclude.h"
#include "jpeglib.h"
#include "jsimd.h"
#include "config.h"
/* Private subobject */
@@ -95,6 +96,7 @@ typedef my_color_converter * my_cconvert_ptr;
#define RGB_PIXELSIZE EXT_RGB_PIXELSIZE
#define rgb_ycc_convert_internal extrgb_ycc_convert_internal
#define rgb_gray_convert_internal extrgb_gray_convert_internal
#define rgb_rgb_convert_internal extrgb_rgb_convert_internal
#include "jccolext.c"
#undef RGB_RED
#undef RGB_GREEN
@@ -102,6 +104,7 @@ typedef my_color_converter * my_cconvert_ptr;
#undef RGB_PIXELSIZE
#undef rgb_ycc_convert_internal
#undef rgb_gray_convert_internal
#undef rgb_rgb_convert_internal
#define RGB_RED EXT_RGBX_RED
#define RGB_GREEN EXT_RGBX_GREEN
@@ -109,6 +112,7 @@ typedef my_color_converter * my_cconvert_ptr;
#define RGB_PIXELSIZE EXT_RGBX_PIXELSIZE
#define rgb_ycc_convert_internal extrgbx_ycc_convert_internal
#define rgb_gray_convert_internal extrgbx_gray_convert_internal
#define rgb_rgb_convert_internal extrgbx_rgb_convert_internal
#include "jccolext.c"
#undef RGB_RED
#undef RGB_GREEN
@@ -116,6 +120,7 @@ typedef my_color_converter * my_cconvert_ptr;
#undef RGB_PIXELSIZE
#undef rgb_ycc_convert_internal
#undef rgb_gray_convert_internal
#undef rgb_rgb_convert_internal
#define RGB_RED EXT_BGR_RED
#define RGB_GREEN EXT_BGR_GREEN
@@ -123,6 +128,7 @@ typedef my_color_converter * my_cconvert_ptr;
#define RGB_PIXELSIZE EXT_BGR_PIXELSIZE
#define rgb_ycc_convert_internal extbgr_ycc_convert_internal
#define rgb_gray_convert_internal extbgr_gray_convert_internal
#define rgb_rgb_convert_internal extbgr_rgb_convert_internal
#include "jccolext.c"
#undef RGB_RED
#undef RGB_GREEN
@@ -130,6 +136,7 @@ typedef my_color_converter * my_cconvert_ptr;
#undef RGB_PIXELSIZE
#undef rgb_ycc_convert_internal
#undef rgb_gray_convert_internal
#undef rgb_rgb_convert_internal
#define RGB_RED EXT_BGRX_RED
#define RGB_GREEN EXT_BGRX_GREEN
@@ -137,6 +144,7 @@ typedef my_color_converter * my_cconvert_ptr;
#define RGB_PIXELSIZE EXT_BGRX_PIXELSIZE
#define rgb_ycc_convert_internal extbgrx_ycc_convert_internal
#define rgb_gray_convert_internal extbgrx_gray_convert_internal
#define rgb_rgb_convert_internal extbgrx_rgb_convert_internal
#include "jccolext.c"
#undef RGB_RED
#undef RGB_GREEN
@@ -144,6 +152,7 @@ typedef my_color_converter * my_cconvert_ptr;
#undef RGB_PIXELSIZE
#undef rgb_ycc_convert_internal
#undef rgb_gray_convert_internal
#undef rgb_rgb_convert_internal
#define RGB_RED EXT_XBGR_RED
#define RGB_GREEN EXT_XBGR_GREEN
@@ -151,6 +160,7 @@ typedef my_color_converter * my_cconvert_ptr;
#define RGB_PIXELSIZE EXT_XBGR_PIXELSIZE
#define rgb_ycc_convert_internal extxbgr_ycc_convert_internal
#define rgb_gray_convert_internal extxbgr_gray_convert_internal
#define rgb_rgb_convert_internal extxbgr_rgb_convert_internal
#include "jccolext.c"
#undef RGB_RED
#undef RGB_GREEN
@@ -158,6 +168,7 @@ typedef my_color_converter * my_cconvert_ptr;
#undef RGB_PIXELSIZE
#undef rgb_ycc_convert_internal
#undef rgb_gray_convert_internal
#undef rgb_rgb_convert_internal
#define RGB_RED EXT_XRGB_RED
#define RGB_GREEN EXT_XRGB_GREEN
@@ -165,6 +176,7 @@ typedef my_color_converter * my_cconvert_ptr;
#define RGB_PIXELSIZE EXT_XRGB_PIXELSIZE
#define rgb_ycc_convert_internal extxrgb_ycc_convert_internal
#define rgb_gray_convert_internal extxrgb_gray_convert_internal
#define rgb_rgb_convert_internal extxrgb_rgb_convert_internal
#include "jccolext.c"
#undef RGB_RED
#undef RGB_GREEN
@@ -172,6 +184,7 @@ typedef my_color_converter * my_cconvert_ptr;
#undef RGB_PIXELSIZE
#undef rgb_ycc_convert_internal
#undef rgb_gray_convert_internal
#undef rgb_rgb_convert_internal
/*
@@ -225,6 +238,7 @@ rgb_ycc_convert (j_compress_ptr cinfo,
num_rows);
break;
case JCS_EXT_RGBX:
case JCS_EXT_RGBA:
extrgbx_ycc_convert_internal(cinfo, input_buf, output_buf, output_row,
num_rows);
break;
@@ -233,14 +247,17 @@ rgb_ycc_convert (j_compress_ptr cinfo,
num_rows);
break;
case JCS_EXT_BGRX:
case JCS_EXT_BGRA:
extbgrx_ycc_convert_internal(cinfo, input_buf, output_buf, output_row,
num_rows);
break;
case JCS_EXT_XBGR:
case JCS_EXT_ABGR:
extxbgr_ycc_convert_internal(cinfo, input_buf, output_buf, output_row,
num_rows);
break;
case JCS_EXT_XRGB:
case JCS_EXT_ARGB:
extxrgb_ycc_convert_internal(cinfo, input_buf, output_buf, output_row,
num_rows);
break;
@@ -270,6 +287,7 @@ rgb_gray_convert (j_compress_ptr cinfo,
num_rows);
break;
case JCS_EXT_RGBX:
case JCS_EXT_RGBA:
extrgbx_gray_convert_internal(cinfo, input_buf, output_buf, output_row,
num_rows);
break;
@@ -278,14 +296,17 @@ rgb_gray_convert (j_compress_ptr cinfo,
num_rows);
break;
case JCS_EXT_BGRX:
case JCS_EXT_BGRA:
extbgrx_gray_convert_internal(cinfo, input_buf, output_buf, output_row,
num_rows);
break;
case JCS_EXT_XBGR:
case JCS_EXT_ABGR:
extxbgr_gray_convert_internal(cinfo, input_buf, output_buf, output_row,
num_rows);
break;
case JCS_EXT_XRGB:
case JCS_EXT_ARGB:
extxrgb_gray_convert_internal(cinfo, input_buf, output_buf, output_row,
num_rows);
break;
@@ -297,6 +318,52 @@ rgb_gray_convert (j_compress_ptr cinfo,
}
/*
* Extended RGB to plain RGB conversion
*/
METHODDEF(void)
rgb_rgb_convert (j_compress_ptr cinfo,
JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
JDIMENSION output_row, int num_rows)
{
switch (cinfo->in_color_space) {
case JCS_EXT_RGB:
extrgb_rgb_convert_internal(cinfo, input_buf, output_buf, output_row,
num_rows);
break;
case JCS_EXT_RGBX:
case JCS_EXT_RGBA:
extrgbx_rgb_convert_internal(cinfo, input_buf, output_buf, output_row,
num_rows);
break;
case JCS_EXT_BGR:
extbgr_rgb_convert_internal(cinfo, input_buf, output_buf, output_row,
num_rows);
break;
case JCS_EXT_BGRX:
case JCS_EXT_BGRA:
extbgrx_rgb_convert_internal(cinfo, input_buf, output_buf, output_row,
num_rows);
break;
case JCS_EXT_XBGR:
case JCS_EXT_ABGR:
extxbgr_rgb_convert_internal(cinfo, input_buf, output_buf, output_row,
num_rows);
break;
case JCS_EXT_XRGB:
case JCS_EXT_ARGB:
extxrgb_rgb_convert_internal(cinfo, input_buf, output_buf, output_row,
num_rows);
break;
default:
rgb_rgb_convert_internal(cinfo, input_buf, output_buf, output_row,
num_rows);
break;
}
}
/*
* Convert some rows of samples to the JPEG colorspace.
* This version handles Adobe-style CMYK->YCCK conversion,
@@ -458,6 +525,10 @@ jinit_color_converter (j_compress_ptr cinfo)
case JCS_EXT_BGRX:
case JCS_EXT_XBGR:
case JCS_EXT_XRGB:
case JCS_EXT_RGBA:
case JCS_EXT_BGRA:
case JCS_EXT_ABGR:
case JCS_EXT_ARGB:
if (cinfo->input_components != rgb_pixelsize[cinfo->in_color_space])
ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);
break;
@@ -492,7 +563,11 @@ jinit_color_converter (j_compress_ptr cinfo)
cinfo->in_color_space == JCS_EXT_BGR ||
cinfo->in_color_space == JCS_EXT_BGRX ||
cinfo->in_color_space == JCS_EXT_XBGR ||
cinfo->in_color_space == JCS_EXT_XRGB) {
cinfo->in_color_space == JCS_EXT_XRGB ||
cinfo->in_color_space == JCS_EXT_RGBA ||
cinfo->in_color_space == JCS_EXT_BGRA ||
cinfo->in_color_space == JCS_EXT_ABGR ||
cinfo->in_color_space == JCS_EXT_ARGB) {
if (jsimd_can_rgb_gray())
cconvert->pub.color_convert = jsimd_rgb_gray_convert;
else {
@@ -506,17 +581,25 @@ jinit_color_converter (j_compress_ptr cinfo)
break;
case JCS_RGB:
case JCS_EXT_RGB:
case JCS_EXT_RGBX:
case JCS_EXT_BGR:
case JCS_EXT_BGRX:
case JCS_EXT_XBGR:
case JCS_EXT_XRGB:
if (cinfo->num_components != 3)
ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
if (cinfo->in_color_space == cinfo->jpeg_color_space &&
rgb_pixelsize[cinfo->in_color_space] == 3)
if (rgb_red[cinfo->in_color_space] == 0 &&
rgb_green[cinfo->in_color_space] == 1 &&
rgb_blue[cinfo->in_color_space] == 2 &&
rgb_pixelsize[cinfo->in_color_space] == 3)
cconvert->pub.color_convert = null_convert;
else if (cinfo->in_color_space == JCS_RGB ||
cinfo->in_color_space == JCS_EXT_RGB ||
cinfo->in_color_space == JCS_EXT_RGBX ||
cinfo->in_color_space == JCS_EXT_BGR ||
cinfo->in_color_space == JCS_EXT_BGRX ||
cinfo->in_color_space == JCS_EXT_XBGR ||
cinfo->in_color_space == JCS_EXT_XRGB ||
cinfo->in_color_space == JCS_EXT_RGBA ||
cinfo->in_color_space == JCS_EXT_BGRA ||
cinfo->in_color_space == JCS_EXT_ABGR ||
cinfo->in_color_space == JCS_EXT_ARGB)
cconvert->pub.color_convert = rgb_rgb_convert;
else
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
break;
@@ -530,7 +613,11 @@ jinit_color_converter (j_compress_ptr cinfo)
cinfo->in_color_space == JCS_EXT_BGR ||
cinfo->in_color_space == JCS_EXT_BGRX ||
cinfo->in_color_space == JCS_EXT_XBGR ||
cinfo->in_color_space == JCS_EXT_XRGB) {
cinfo->in_color_space == JCS_EXT_XRGB ||
cinfo->in_color_space == JCS_EXT_RGBA ||
cinfo->in_color_space == JCS_EXT_BGRA ||
cinfo->in_color_space == JCS_EXT_ABGR ||
cinfo->in_color_space == JCS_EXT_ARGB) {
if (jsimd_can_rgb_ycc())
cconvert->pub.color_convert = jsimd_rgb_ycc_convert;
else {

View File

@@ -182,7 +182,7 @@ compute_reciprocal (UINT16 divisor, DCTELEM * dtbl)
/* fq will be one bit too large to fit in DCTELEM, so adjust */
fq >>= 1;
r--;
} else if (fr <= (divisor / 2)) { /* fractional part is < 0.5 */
} else if (fr <= (divisor / 2U)) { /* fractional part is < 0.5 */
c++;
} else { /* fractional part is > 0.5 */
fq++;

View File

@@ -3,6 +3,9 @@
*/
#define JPEG_LIB_VERSION 62 /* Version 6b */
/* libjpeg-turbo version */
#define LIBJPEG_TURBO_VERSION 0
/* Support arithmetic encoding */
#undef C_ARITH_CODING_SUPPORTED
@@ -27,9 +30,6 @@
/* Compiler does not support pointers to unspecified structures. */
#undef INCOMPLETE_TYPES_BROKEN
/* How to obtain function inlining. */
#undef INLINE
/* Compiler has <strings.h> rather than standard <string.h>. */
#undef NEED_BSD_STRINGS

View File

@@ -3,7 +3,7 @@
*
* Copyright (C) 1991-1998, Thomas G. Lane.
* Modified 2003-2008 by Guido Vollbeding.
* Copyright (C) 2009-2010, D. R. Commander.
* Copyright (C) 2009-2011, D. R. Commander.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
@@ -398,6 +398,10 @@ jpeg_default_colorspace (j_compress_ptr cinfo)
case JCS_EXT_BGRX:
case JCS_EXT_XBGR:
case JCS_EXT_XRGB:
case JCS_EXT_RGBA:
case JCS_EXT_BGRA:
case JCS_EXT_ABGR:
case JCS_EXT_ARGB:
jpeg_set_colorspace(cinfo, JCS_YCbCr);
break;
case JCS_YCbCr:

126
jcstest.c Normal file
View File

@@ -0,0 +1,126 @@
/*
* Copyright (C)2011 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.
*/
/* This program demonstrates how to check for the colorspace extension
capabilities of libjpeg-turbo at both compile time and run time. */
#include <stdio.h>
#include <jpeglib.h>
#include <jerror.h>
#include <setjmp.h>
#ifndef JCS_EXTENSIONS
#define JCS_EXT_RGB 6
#endif
#if !defined(JCS_EXTENSIONS) || !defined(JCS_ALPHA_EXTENSIONS)
#define JCS_EXT_RGBA 12
#endif
static char lasterror[JMSG_LENGTH_MAX] = "No error";
typedef struct _error_mgr {
struct jpeg_error_mgr pub;
jmp_buf jb;
} error_mgr;
static void my_error_exit(j_common_ptr cinfo)
{
error_mgr *myerr = (error_mgr *)cinfo->err;
(*cinfo->err->output_message)(cinfo);
longjmp(myerr->jb, 1);
}
static void my_output_message(j_common_ptr cinfo)
{
(*cinfo->err->format_message)(cinfo, lasterror);
}
int main(void)
{
int jcs_valid = -1, jcs_alpha_valid = -1;
struct jpeg_compress_struct cinfo;
error_mgr jerr;
printf("libjpeg-turbo colorspace extensions:\n");
#if JCS_EXTENSIONS
printf(" Present at compile time\n");
#else
printf(" Not present at compile time\n");
#endif
cinfo.err = jpeg_std_error(&jerr.pub);
jerr.pub.error_exit = my_error_exit;
jerr.pub.output_message = my_output_message;
if(setjmp(jerr.jb)) {
// this will execute if libjpeg has an error
jcs_valid = 0;
goto done;
}
jpeg_create_compress(&cinfo);
cinfo.input_components = 3;
jpeg_set_defaults(&cinfo);
cinfo.in_color_space = JCS_EXT_RGB;
jpeg_default_colorspace(&cinfo);
jcs_valid = 1;
done:
if (jcs_valid)
printf(" Working properly\n");
else
printf(" Not working properly. Error returned was:\n %s\n",
lasterror);
printf("libjpeg-turbo alpha colorspace extensions:\n");
#if JCS_ALPHA_EXTENSIONS
printf(" Present at compile time\n");
#else
printf(" Not present at compile time\n");
#endif
if(setjmp(jerr.jb)) {
// this will execute if libjpeg has an error
jcs_alpha_valid = 0;
goto done2;
}
cinfo.in_color_space = JCS_EXT_RGBA;
jpeg_default_colorspace(&cinfo);
jcs_alpha_valid = 1;
done2:
if (jcs_alpha_valid)
printf(" Working properly\n");
else
printf(" Not working properly. Error returned was:\n %s\n",
lasterror);
jpeg_destroy_compress(&cinfo);
return 0;
}

View File

@@ -102,3 +102,40 @@ gray_rgb_convert_internal (j_decompress_ptr cinfo,
}
}
}
/*
* Convert RGB to extended RGB: just swap the order of source pixels
*/
INLINE
LOCAL(void)
rgb_rgb_convert_internal (j_decompress_ptr cinfo,
JSAMPIMAGE input_buf, JDIMENSION input_row,
JSAMPARRAY output_buf, int num_rows)
{
register JSAMPROW inptr0, inptr1, inptr2;
register JSAMPROW outptr;
register JDIMENSION col;
JDIMENSION num_cols = cinfo->output_width;
while (--num_rows >= 0) {
inptr0 = input_buf[0][input_row];
inptr1 = input_buf[1][input_row];
inptr2 = input_buf[2][input_row];
input_row++;
outptr = *output_buf++;
for (col = 0; col < num_cols; col++) {
/* We can dispense with GETJSAMPLE() here */
outptr[RGB_RED] = inptr0[col];
outptr[RGB_GREEN] = inptr1[col];
outptr[RGB_BLUE] = inptr2[col];
/* Set unused byte to 0xFF so it can be interpreted as an opaque */
/* alpha channel value */
#ifdef RGB_ALPHA
outptr[RGB_ALPHA] = 0xFF;
#endif
outptr += RGB_PIXELSIZE;
}
}
}

View File

@@ -3,7 +3,7 @@
*
* Copyright (C) 1991-1997, Thomas G. Lane.
* Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
* Copyright (C) 2009, 2011, D. R. Commander.
* Copyright (C) 2009, 2011-2012, D. R. Commander.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
@@ -14,6 +14,7 @@
#include "jinclude.h"
#include "jpeglib.h"
#include "jsimd.h"
#include "config.h"
/* Private subobject */
@@ -79,6 +80,7 @@ typedef my_color_deconverter * my_cconvert_ptr;
#define RGB_PIXELSIZE EXT_RGB_PIXELSIZE
#define ycc_rgb_convert_internal ycc_extrgb_convert_internal
#define gray_rgb_convert_internal gray_extrgb_convert_internal
#define rgb_rgb_convert_internal rgb_extrgb_convert_internal
#include "jdcolext.c"
#undef RGB_RED
#undef RGB_GREEN
@@ -86,6 +88,7 @@ typedef my_color_deconverter * my_cconvert_ptr;
#undef RGB_PIXELSIZE
#undef ycc_rgb_convert_internal
#undef gray_rgb_convert_internal
#undef rgb_rgb_convert_internal
#define RGB_RED EXT_RGBX_RED
#define RGB_GREEN EXT_RGBX_GREEN
@@ -94,6 +97,7 @@ typedef my_color_deconverter * my_cconvert_ptr;
#define RGB_PIXELSIZE EXT_RGBX_PIXELSIZE
#define ycc_rgb_convert_internal ycc_extrgbx_convert_internal
#define gray_rgb_convert_internal gray_extrgbx_convert_internal
#define rgb_rgb_convert_internal rgb_extrgbx_convert_internal
#include "jdcolext.c"
#undef RGB_RED
#undef RGB_GREEN
@@ -102,6 +106,7 @@ typedef my_color_deconverter * my_cconvert_ptr;
#undef RGB_PIXELSIZE
#undef ycc_rgb_convert_internal
#undef gray_rgb_convert_internal
#undef rgb_rgb_convert_internal
#define RGB_RED EXT_BGR_RED
#define RGB_GREEN EXT_BGR_GREEN
@@ -109,6 +114,7 @@ typedef my_color_deconverter * my_cconvert_ptr;
#define RGB_PIXELSIZE EXT_BGR_PIXELSIZE
#define ycc_rgb_convert_internal ycc_extbgr_convert_internal
#define gray_rgb_convert_internal gray_extbgr_convert_internal
#define rgb_rgb_convert_internal rgb_extbgr_convert_internal
#include "jdcolext.c"
#undef RGB_RED
#undef RGB_GREEN
@@ -116,6 +122,7 @@ typedef my_color_deconverter * my_cconvert_ptr;
#undef RGB_PIXELSIZE
#undef ycc_rgb_convert_internal
#undef gray_rgb_convert_internal
#undef rgb_rgb_convert_internal
#define RGB_RED EXT_BGRX_RED
#define RGB_GREEN EXT_BGRX_GREEN
@@ -124,6 +131,7 @@ typedef my_color_deconverter * my_cconvert_ptr;
#define RGB_PIXELSIZE EXT_BGRX_PIXELSIZE
#define ycc_rgb_convert_internal ycc_extbgrx_convert_internal
#define gray_rgb_convert_internal gray_extbgrx_convert_internal
#define rgb_rgb_convert_internal rgb_extbgrx_convert_internal
#include "jdcolext.c"
#undef RGB_RED
#undef RGB_GREEN
@@ -132,6 +140,7 @@ typedef my_color_deconverter * my_cconvert_ptr;
#undef RGB_PIXELSIZE
#undef ycc_rgb_convert_internal
#undef gray_rgb_convert_internal
#undef rgb_rgb_convert_internal
#define RGB_RED EXT_XBGR_RED
#define RGB_GREEN EXT_XBGR_GREEN
@@ -140,6 +149,7 @@ typedef my_color_deconverter * my_cconvert_ptr;
#define RGB_PIXELSIZE EXT_XBGR_PIXELSIZE
#define ycc_rgb_convert_internal ycc_extxbgr_convert_internal
#define gray_rgb_convert_internal gray_extxbgr_convert_internal
#define rgb_rgb_convert_internal rgb_extxbgr_convert_internal
#include "jdcolext.c"
#undef RGB_RED
#undef RGB_GREEN
@@ -148,6 +158,7 @@ typedef my_color_deconverter * my_cconvert_ptr;
#undef RGB_PIXELSIZE
#undef ycc_rgb_convert_internal
#undef gray_rgb_convert_internal
#undef rgb_rgb_convert_internal
#define RGB_RED EXT_XRGB_RED
#define RGB_GREEN EXT_XRGB_GREEN
@@ -156,6 +167,7 @@ typedef my_color_deconverter * my_cconvert_ptr;
#define RGB_PIXELSIZE EXT_XRGB_PIXELSIZE
#define ycc_rgb_convert_internal ycc_extxrgb_convert_internal
#define gray_rgb_convert_internal gray_extxrgb_convert_internal
#define rgb_rgb_convert_internal rgb_extxrgb_convert_internal
#include "jdcolext.c"
#undef RGB_RED
#undef RGB_GREEN
@@ -164,6 +176,7 @@ typedef my_color_deconverter * my_cconvert_ptr;
#undef RGB_PIXELSIZE
#undef ycc_rgb_convert_internal
#undef gray_rgb_convert_internal
#undef rgb_rgb_convert_internal
/*
@@ -224,6 +237,7 @@ ycc_rgb_convert (j_decompress_ptr cinfo,
num_rows);
break;
case JCS_EXT_RGBX:
case JCS_EXT_RGBA:
ycc_extrgbx_convert_internal(cinfo, input_buf, input_row, output_buf,
num_rows);
break;
@@ -232,14 +246,17 @@ ycc_rgb_convert (j_decompress_ptr cinfo,
num_rows);
break;
case JCS_EXT_BGRX:
case JCS_EXT_BGRA:
ycc_extbgrx_convert_internal(cinfo, input_buf, input_row, output_buf,
num_rows);
break;
case JCS_EXT_XBGR:
case JCS_EXT_ABGR:
ycc_extxbgr_convert_internal(cinfo, input_buf, input_row, output_buf,
num_rows);
break;
case JCS_EXT_XRGB:
case JCS_EXT_ARGB:
ycc_extxrgb_convert_internal(cinfo, input_buf, input_row, output_buf,
num_rows);
break;
@@ -316,6 +333,7 @@ gray_rgb_convert (j_decompress_ptr cinfo,
num_rows);
break;
case JCS_EXT_RGBX:
case JCS_EXT_RGBA:
gray_extrgbx_convert_internal(cinfo, input_buf, input_row, output_buf,
num_rows);
break;
@@ -324,14 +342,17 @@ gray_rgb_convert (j_decompress_ptr cinfo,
num_rows);
break;
case JCS_EXT_BGRX:
case JCS_EXT_BGRA:
gray_extbgrx_convert_internal(cinfo, input_buf, input_row, output_buf,
num_rows);
break;
case JCS_EXT_XBGR:
case JCS_EXT_ABGR:
gray_extxbgr_convert_internal(cinfo, input_buf, input_row, output_buf,
num_rows);
break;
case JCS_EXT_XRGB:
case JCS_EXT_ARGB:
gray_extxrgb_convert_internal(cinfo, input_buf, input_row, output_buf,
num_rows);
break;
@@ -343,6 +364,51 @@ gray_rgb_convert (j_decompress_ptr cinfo,
}
/*
* Convert plain RGB to extended RGB
*/
METHODDEF(void)
rgb_rgb_convert (j_decompress_ptr cinfo,
JSAMPIMAGE input_buf, JDIMENSION input_row,
JSAMPARRAY output_buf, int num_rows)
{
switch (cinfo->out_color_space) {
case JCS_EXT_RGB:
rgb_extrgb_convert_internal(cinfo, input_buf, input_row, output_buf,
num_rows);
break;
case JCS_EXT_RGBX:
case JCS_EXT_RGBA:
rgb_extrgbx_convert_internal(cinfo, input_buf, input_row, output_buf,
num_rows);
break;
case JCS_EXT_BGR:
rgb_extbgr_convert_internal(cinfo, input_buf, input_row, output_buf,
num_rows);
break;
case JCS_EXT_BGRX:
case JCS_EXT_BGRA:
rgb_extbgrx_convert_internal(cinfo, input_buf, input_row, output_buf,
num_rows);
break;
case JCS_EXT_XBGR:
case JCS_EXT_ABGR:
rgb_extxbgr_convert_internal(cinfo, input_buf, input_row, output_buf,
num_rows);
break;
case JCS_EXT_XRGB:
case JCS_EXT_ARGB:
rgb_extxrgb_convert_internal(cinfo, input_buf, input_row, output_buf,
num_rows);
break;
default:
rgb_rgb_convert_internal(cinfo, input_buf, input_row, output_buf,
num_rows);
break;
}
}
/*
* Adobe-style YCCK->CMYK conversion.
* We convert YCbCr to R=1-C, G=1-M, and B=1-Y using the same
@@ -471,6 +537,10 @@ jinit_color_deconverter (j_decompress_ptr cinfo)
case JCS_EXT_BGRX:
case JCS_EXT_XBGR:
case JCS_EXT_XRGB:
case JCS_EXT_RGBA:
case JCS_EXT_BGRA:
case JCS_EXT_ABGR:
case JCS_EXT_ARGB:
cinfo->out_color_components = rgb_pixelsize[cinfo->out_color_space];
if (cinfo->jpeg_color_space == JCS_YCbCr) {
if (jsimd_can_ycc_rgb())
@@ -481,9 +551,14 @@ jinit_color_deconverter (j_decompress_ptr cinfo)
}
} else if (cinfo->jpeg_color_space == JCS_GRAYSCALE) {
cconvert->pub.color_convert = gray_rgb_convert;
} else if (cinfo->jpeg_color_space == cinfo->out_color_space &&
rgb_pixelsize[cinfo->out_color_space] == 3) {
cconvert->pub.color_convert = null_convert;
} else if (cinfo->jpeg_color_space == JCS_RGB) {
if (rgb_red[cinfo->out_color_space] == 0 &&
rgb_green[cinfo->out_color_space] == 1 &&
rgb_blue[cinfo->out_color_space] == 2 &&
rgb_pixelsize[cinfo->out_color_space] == 3)
cconvert->pub.color_convert = null_convert;
else
cconvert->pub.color_convert = rgb_rgb_convert;
} else
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
break;

View File

@@ -758,7 +758,7 @@ decode_mcu (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
usefast = 0;
}
if (cinfo->src->bytes_in_buffer < BUFSIZE * cinfo->blocks_in_MCU
if (cinfo->src->bytes_in_buffer < BUFSIZE * (size_t)cinfo->blocks_in_MCU
|| cinfo->unread_marker != 0)
usefast = 0;

View File

@@ -2,6 +2,7 @@
* jdmarker.c
*
* Copyright (C) 1991-1998, Thomas G. Lane.
* Copyright (C) 2012, D. R. Commander.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
@@ -322,13 +323,17 @@ get_sos (j_decompress_ptr cinfo)
/* Collect the component-spec parameters */
for (i = 0; i < MAX_COMPS_IN_SCAN; i++)
cinfo->cur_comp_info[i] = NULL;
for (i = 0; i < n; i++) {
INPUT_BYTE(cinfo, cc, return FALSE);
INPUT_BYTE(cinfo, c, return FALSE);
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
for (ci = 0, compptr = cinfo->comp_info;
ci < cinfo->num_components && ci < MAX_COMPS_IN_SCAN;
ci++, compptr++) {
if (cc == compptr->component_id)
if (cc == compptr->component_id && !cinfo->cur_comp_info[ci])
goto id_found;
}

View File

@@ -2,7 +2,7 @@
* jdmaster.c
*
* Copyright (C) 1991-1997, Thomas G. Lane.
* Copyright (C) 2009-2010, D. R. Commander.
* Copyright (C) 2009-2011, D. R. Commander.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
@@ -57,7 +57,11 @@ use_merged_upsample (j_decompress_ptr cinfo)
cinfo->out_color_space != JCS_EXT_BGR &&
cinfo->out_color_space != JCS_EXT_BGRX &&
cinfo->out_color_space != JCS_EXT_XBGR &&
cinfo->out_color_space != JCS_EXT_XRGB) ||
cinfo->out_color_space != JCS_EXT_XRGB &&
cinfo->out_color_space != JCS_EXT_RGBA &&
cinfo->out_color_space != JCS_EXT_BGRA &&
cinfo->out_color_space != JCS_EXT_ABGR &&
cinfo->out_color_space != JCS_EXT_ARGB) ||
cinfo->out_color_components != rgb_pixelsize[cinfo->out_color_space])
return FALSE;
/* and it only handles 2h1v or 2h2v sampling ratios */
@@ -209,6 +213,10 @@ jpeg_calc_output_dimensions (j_decompress_ptr cinfo)
case JCS_EXT_BGRX:
case JCS_EXT_XBGR:
case JCS_EXT_XRGB:
case JCS_EXT_RGBA:
case JCS_EXT_BGRA:
case JCS_EXT_ABGR:
case JCS_EXT_ARGB:
cinfo->out_color_components = rgb_pixelsize[cinfo->out_color_space];
break;
case JCS_YCbCr:

View File

@@ -38,6 +38,7 @@
#include "jinclude.h"
#include "jpeglib.h"
#include "jsimd.h"
#include "config.h"
#ifdef UPSAMPLE_MERGING_SUPPORTED
@@ -102,6 +103,7 @@ typedef my_upsampler * my_upsample_ptr;
#define RGB_RED EXT_RGBX_RED
#define RGB_GREEN EXT_RGBX_GREEN
#define RGB_BLUE EXT_RGBX_BLUE
#define RGB_ALPHA 3
#define RGB_PIXELSIZE EXT_RGBX_PIXELSIZE
#define h2v1_merged_upsample_internal extrgbx_h2v1_merged_upsample_internal
#define h2v2_merged_upsample_internal extrgbx_h2v2_merged_upsample_internal
@@ -109,6 +111,7 @@ typedef my_upsampler * my_upsample_ptr;
#undef RGB_RED
#undef RGB_GREEN
#undef RGB_BLUE
#undef RGB_ALPHA
#undef RGB_PIXELSIZE
#undef h2v1_merged_upsample_internal
#undef h2v2_merged_upsample_internal
@@ -130,6 +133,7 @@ typedef my_upsampler * my_upsample_ptr;
#define RGB_RED EXT_BGRX_RED
#define RGB_GREEN EXT_BGRX_GREEN
#define RGB_BLUE EXT_BGRX_BLUE
#define RGB_ALPHA 3
#define RGB_PIXELSIZE EXT_BGRX_PIXELSIZE
#define h2v1_merged_upsample_internal extbgrx_h2v1_merged_upsample_internal
#define h2v2_merged_upsample_internal extbgrx_h2v2_merged_upsample_internal
@@ -137,6 +141,7 @@ typedef my_upsampler * my_upsample_ptr;
#undef RGB_RED
#undef RGB_GREEN
#undef RGB_BLUE
#undef RGB_ALPHA
#undef RGB_PIXELSIZE
#undef h2v1_merged_upsample_internal
#undef h2v2_merged_upsample_internal
@@ -144,6 +149,7 @@ typedef my_upsampler * my_upsample_ptr;
#define RGB_RED EXT_XBGR_RED
#define RGB_GREEN EXT_XBGR_GREEN
#define RGB_BLUE EXT_XBGR_BLUE
#define RGB_ALPHA 0
#define RGB_PIXELSIZE EXT_XBGR_PIXELSIZE
#define h2v1_merged_upsample_internal extxbgr_h2v1_merged_upsample_internal
#define h2v2_merged_upsample_internal extxbgr_h2v2_merged_upsample_internal
@@ -151,6 +157,7 @@ typedef my_upsampler * my_upsample_ptr;
#undef RGB_RED
#undef RGB_GREEN
#undef RGB_BLUE
#undef RGB_ALPHA
#undef RGB_PIXELSIZE
#undef h2v1_merged_upsample_internal
#undef h2v2_merged_upsample_internal
@@ -158,6 +165,7 @@ typedef my_upsampler * my_upsample_ptr;
#define RGB_RED EXT_XRGB_RED
#define RGB_GREEN EXT_XRGB_GREEN
#define RGB_BLUE EXT_XRGB_BLUE
#define RGB_ALPHA 0
#define RGB_PIXELSIZE EXT_XRGB_PIXELSIZE
#define h2v1_merged_upsample_internal extxrgb_h2v1_merged_upsample_internal
#define h2v2_merged_upsample_internal extxrgb_h2v2_merged_upsample_internal
@@ -165,6 +173,7 @@ typedef my_upsampler * my_upsample_ptr;
#undef RGB_RED
#undef RGB_GREEN
#undef RGB_BLUE
#undef RGB_ALPHA
#undef RGB_PIXELSIZE
#undef h2v1_merged_upsample_internal
#undef h2v2_merged_upsample_internal
@@ -329,6 +338,7 @@ h2v1_merged_upsample (j_decompress_ptr cinfo,
output_buf);
break;
case JCS_EXT_RGBX:
case JCS_EXT_RGBA:
extrgbx_h2v1_merged_upsample_internal(cinfo, input_buf, in_row_group_ctr,
output_buf);
break;
@@ -337,14 +347,17 @@ h2v1_merged_upsample (j_decompress_ptr cinfo,
output_buf);
break;
case JCS_EXT_BGRX:
case JCS_EXT_BGRA:
extbgrx_h2v1_merged_upsample_internal(cinfo, input_buf, in_row_group_ctr,
output_buf);
break;
case JCS_EXT_XBGR:
case JCS_EXT_ABGR:
extxbgr_h2v1_merged_upsample_internal(cinfo, input_buf, in_row_group_ctr,
output_buf);
break;
case JCS_EXT_XRGB:
case JCS_EXT_ARGB:
extxrgb_h2v1_merged_upsample_internal(cinfo, input_buf, in_row_group_ctr,
output_buf);
break;
@@ -371,6 +384,7 @@ h2v2_merged_upsample (j_decompress_ptr cinfo,
output_buf);
break;
case JCS_EXT_RGBX:
case JCS_EXT_RGBA:
extrgbx_h2v2_merged_upsample_internal(cinfo, input_buf, in_row_group_ctr,
output_buf);
break;
@@ -379,14 +393,17 @@ h2v2_merged_upsample (j_decompress_ptr cinfo,
output_buf);
break;
case JCS_EXT_BGRX:
case JCS_EXT_BGRA:
extbgrx_h2v2_merged_upsample_internal(cinfo, input_buf, in_row_group_ctr,
output_buf);
break;
case JCS_EXT_XBGR:
case JCS_EXT_ABGR:
extxbgr_h2v2_merged_upsample_internal(cinfo, input_buf, in_row_group_ctr,
output_buf);
break;
case JCS_EXT_XRGB:
case JCS_EXT_ARGB:
extxrgb_h2v2_merged_upsample_internal(cinfo, input_buf, in_row_group_ctr,
output_buf);
break;

View File

@@ -2,6 +2,7 @@
* jdmrgext.c
*
* Copyright (C) 1994-1996, Thomas G. Lane.
* Copyright (C) 2011, D. R. Commander.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
@@ -54,11 +55,17 @@ h2v1_merged_upsample_internal (j_decompress_ptr cinfo,
outptr[RGB_RED] = range_limit[y + cred];
outptr[RGB_GREEN] = range_limit[y + cgreen];
outptr[RGB_BLUE] = range_limit[y + cblue];
#ifdef RGB_ALPHA
outptr[RGB_ALPHA] = 0xFF;
#endif
outptr += RGB_PIXELSIZE;
y = GETJSAMPLE(*inptr0++);
outptr[RGB_RED] = range_limit[y + cred];
outptr[RGB_GREEN] = range_limit[y + cgreen];
outptr[RGB_BLUE] = range_limit[y + cblue];
#ifdef RGB_ALPHA
outptr[RGB_ALPHA] = 0xFF;
#endif
outptr += RGB_PIXELSIZE;
}
/* If image width is odd, do the last output column separately */
@@ -72,6 +79,9 @@ h2v1_merged_upsample_internal (j_decompress_ptr cinfo,
outptr[RGB_RED] = range_limit[y + cred];
outptr[RGB_GREEN] = range_limit[y + cgreen];
outptr[RGB_BLUE] = range_limit[y + cblue];
#ifdef RGB_ALPHA
outptr[RGB_ALPHA] = 0xFF;
#endif
}
}
@@ -120,21 +130,33 @@ h2v2_merged_upsample_internal (j_decompress_ptr cinfo,
outptr0[RGB_RED] = range_limit[y + cred];
outptr0[RGB_GREEN] = range_limit[y + cgreen];
outptr0[RGB_BLUE] = range_limit[y + cblue];
#ifdef RGB_ALPHA
outptr0[RGB_ALPHA] = 0xFF;
#endif
outptr0 += RGB_PIXELSIZE;
y = GETJSAMPLE(*inptr00++);
outptr0[RGB_RED] = range_limit[y + cred];
outptr0[RGB_GREEN] = range_limit[y + cgreen];
outptr0[RGB_BLUE] = range_limit[y + cblue];
#ifdef RGB_ALPHA
outptr0[RGB_ALPHA] = 0xFF;
#endif
outptr0 += RGB_PIXELSIZE;
y = GETJSAMPLE(*inptr01++);
outptr1[RGB_RED] = range_limit[y + cred];
outptr1[RGB_GREEN] = range_limit[y + cgreen];
outptr1[RGB_BLUE] = range_limit[y + cblue];
#ifdef RGB_ALPHA
outptr1[RGB_ALPHA] = 0xFF;
#endif
outptr1 += RGB_PIXELSIZE;
y = GETJSAMPLE(*inptr01++);
outptr1[RGB_RED] = range_limit[y + cred];
outptr1[RGB_GREEN] = range_limit[y + cgreen];
outptr1[RGB_BLUE] = range_limit[y + cblue];
#ifdef RGB_ALPHA
outptr1[RGB_ALPHA] = 0xFF;
#endif
outptr1 += RGB_PIXELSIZE;
}
/* If image width is odd, do the last output column separately */
@@ -148,9 +170,15 @@ h2v2_merged_upsample_internal (j_decompress_ptr cinfo,
outptr0[RGB_RED] = range_limit[y + cred];
outptr0[RGB_GREEN] = range_limit[y + cgreen];
outptr0[RGB_BLUE] = range_limit[y + cblue];
#ifdef RGB_ALPHA
outptr0[RGB_ALPHA] = 0xFF;
#endif
y = GETJSAMPLE(*inptr01);
outptr1[RGB_RED] = range_limit[y + cred];
outptr1[RGB_GREEN] = range_limit[y + cgreen];
outptr1[RGB_BLUE] = range_limit[y + cblue];
#ifdef RGB_ALPHA
outptr1[RGB_ALPHA] = 0xFF;
#endif
}
}

View File

@@ -2,7 +2,7 @@
* jmorecfg.h
*
* Copyright (C) 1991-1997, Thomas G. Lane.
* Copyright (C) 2009, D. R. Commander.
* Copyright (C) 2009, 2011, D. R. Commander.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
@@ -313,7 +313,7 @@ typedef int boolean;
#define RGB_BLUE 2 /* Offset of Blue */
#define RGB_PIXELSIZE 3 /* JSAMPLEs per RGB scanline element */
#define JPEG_NUMCS 12
#define JPEG_NUMCS 16
#define EXT_RGB_RED 0
#define EXT_RGB_GREEN 1
@@ -347,22 +347,26 @@ typedef int boolean;
static const int rgb_red[JPEG_NUMCS] = {
-1, -1, RGB_RED, -1, -1, -1, EXT_RGB_RED, EXT_RGBX_RED,
EXT_BGR_RED, EXT_BGRX_RED, EXT_XBGR_RED, EXT_XRGB_RED
EXT_BGR_RED, EXT_BGRX_RED, EXT_XBGR_RED, EXT_XRGB_RED,
EXT_RGBX_RED, EXT_BGRX_RED, EXT_XBGR_RED, EXT_XRGB_RED
};
static const int rgb_green[JPEG_NUMCS] = {
-1, -1, RGB_GREEN, -1, -1, -1, EXT_RGB_GREEN, EXT_RGBX_GREEN,
EXT_BGR_GREEN, EXT_BGRX_GREEN, EXT_XBGR_GREEN, EXT_XRGB_GREEN
EXT_BGR_GREEN, EXT_BGRX_GREEN, EXT_XBGR_GREEN, EXT_XRGB_GREEN,
EXT_RGBX_GREEN, EXT_BGRX_GREEN, EXT_XBGR_GREEN, EXT_XRGB_GREEN
};
static const int rgb_blue[JPEG_NUMCS] = {
-1, -1, RGB_BLUE, -1, -1, -1, EXT_RGB_BLUE, EXT_RGBX_BLUE,
EXT_BGR_BLUE, EXT_BGRX_BLUE, EXT_XBGR_BLUE, EXT_XRGB_BLUE
EXT_BGR_BLUE, EXT_BGRX_BLUE, EXT_XBGR_BLUE, EXT_XRGB_BLUE,
EXT_RGBX_BLUE, EXT_BGRX_BLUE, EXT_XBGR_BLUE, EXT_XRGB_BLUE
};
static const int rgb_pixelsize[JPEG_NUMCS] = {
-1, -1, RGB_PIXELSIZE, -1, -1, -1, EXT_RGB_PIXELSIZE, EXT_RGBX_PIXELSIZE,
EXT_BGR_PIXELSIZE, EXT_BGRX_PIXELSIZE, EXT_XBGR_PIXELSIZE, EXT_XRGB_PIXELSIZE
EXT_BGR_PIXELSIZE, EXT_BGRX_PIXELSIZE, EXT_XBGR_PIXELSIZE, EXT_XRGB_PIXELSIZE,
EXT_RGBX_PIXELSIZE, EXT_BGRX_PIXELSIZE, EXT_XBGR_PIXELSIZE, EXT_XRGB_PIXELSIZE
};
/* Definitions for speed-related optimizations. */

View File

@@ -3,7 +3,7 @@
*
* Copyright (C) 1991-1998, Thomas G. Lane.
* Modified 2002-2009 by Guido Vollbeding.
* Copyright (C) 2009-2010, D. R. Commander.
* Copyright (C) 2009-2011, D. R. Commander.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
@@ -211,12 +211,13 @@ struct jpeg_marker_struct {
/* Known color spaces. */
#define JCS_EXTENSIONS 1
#define JCS_ALPHA_EXTENSIONS 1
typedef enum {
JCS_UNKNOWN, /* error/unspecified */
JCS_GRAYSCALE, /* monochrome */
JCS_RGB, /* red/green/blue as specified by the RGB_RED, RGB_GREEN,
RGB_BLUE, and RGB_PIXELSIZE macros */
RGB_BLUE, and RGB_PIXELSIZE macros */
JCS_YCbCr, /* Y/Cb/Cr (also known as YUV) */
JCS_CMYK, /* C/M/Y/K */
JCS_YCCK, /* Y/Cb/Cr/K */
@@ -225,7 +226,18 @@ typedef enum {
JCS_EXT_BGR, /* blue/green/red */
JCS_EXT_BGRX, /* blue/green/red/x */
JCS_EXT_XBGR, /* x/blue/green/red */
JCS_EXT_XRGB /* x/red/green/blue */
JCS_EXT_XRGB, /* x/red/green/blue */
/* When out_color_space it set to JCS_EXT_RGBX, JCS_EXT_BGRX,
JCS_EXT_XBGR, or JCS_EXT_XRGB during decompression, the X byte is
undefined, and in order to ensure the best performance,
libjpeg-turbo can set that byte to whatever value it wishes. Use
the following colorspace constants to ensure that the X byte is set
to 0xFF, so that it can be interpreted as an opaque alpha
channel. */
JCS_EXT_RGBA, /* red/green/blue/alpha */
JCS_EXT_BGRA, /* blue/green/red/alpha */
JCS_EXT_ABGR, /* alpha/blue/green/red */
JCS_EXT_ARGB /* alpha/red/green/blue */
} J_COLOR_SPACE;
/* DCT/IDCT algorithm options. */

View File

@@ -1,4 +1,4 @@
.TH JPEGTRAN 1 "11 October 2010"
.TH JPEGTRAN 1 "31 January 2012"
.SH NAME
jpegtran \- lossless transformation of JPEG files
.SH SYNOPSIS
@@ -184,7 +184,7 @@ comments and other excess baggage present in the source file.
.TP
.B \-copy comments
Copy only comment markers. This setting copies comments from the source file
but discards any other data which is inessential for image display.
but discards any other data that is inessential for image display.
.TP
.B \-copy all
Copy all extra markers. This setting preserves miscellaneous markers

View File

@@ -78,14 +78,14 @@ usage (void)
fprintf(stderr, " -trim Drop non-transformable edge blocks\n");
#endif
fprintf(stderr, "Switches for advanced users:\n");
#ifdef C_ARITH_CODING_SUPPORTED
fprintf(stderr, " -arithmetic Use arithmetic coding\n");
#endif
fprintf(stderr, " -restart N Set restart interval in rows, or in blocks with B\n");
fprintf(stderr, " -maxmemory N Maximum memory to use (in kbytes)\n");
fprintf(stderr, " -outfile name Specify name for output file\n");
fprintf(stderr, " -verbose or -debug Emit debug output\n");
fprintf(stderr, "Switches for wizards:\n");
#ifdef C_ARITH_CODING_SUPPORTED
fprintf(stderr, " -arithmetic Use arithmetic coding\n");
#endif
#ifdef C_MULTISCAN_FILES_SUPPORTED
fprintf(stderr, " -scans file Create multi-scan JPEG per script file\n");
#endif
@@ -204,9 +204,9 @@ parse_switches (j_compress_ptr cinfo, int argc, char **argv,
if (! printed_version) {
fprintf(stderr, "%s version %s (build %s)\n",
PACKAGE_NAME, VERSION, BUILD);
fprintf(stderr, "%s\n\n", LJTCOPYRIGHT);
fprintf(stderr, "Based on Independent JPEG Group's libjpeg, version %s\n%s\n\n",
JVERSION, JCOPYRIGHT);
fprintf(stderr, "%s\n\n", JCOPYRIGHT);
fprintf(stderr, "Emulating The Independent JPEG Group's libjpeg, version %s\n\n",
JVERSION);
printed_version = TRUE;
}
cinfo->err->trace_level++;

View File

@@ -2,7 +2,7 @@
* jversion.h
*
* Copyright (C) 1991-2010, Thomas G. Lane, Guido Vollbeding.
* Copyright (C) 2010, D. R. Commander.
* Copyright (C) 2010, 2012, D. R. Commander.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
@@ -14,23 +14,18 @@
#define JVERSION "8b 16-May-2010"
#define JCOPYRIGHT "Copyright (C) 2010, Thomas G. Lane, Guido Vollbeding"
#elif JPEG_LIB_VERSION >= 70
#define JVERSION "7 27-Jun-2009"
#define JCOPYRIGHT "Copyright (C) 2009, Thomas G. Lane, Guido Vollbeding"
#else
#define JVERSION "6b 27-Mar-1998"
#define JCOPYRIGHT "Copyright (C) 1998, Thomas G. Lane"
#endif
#define LJTCOPYRIGHT "Copyright (C) 1999-2006 MIYASAKA Masaru\n" \
#define JCOPYRIGHT "Copyright (C) 1991-2010 Thomas G. Lane, Guido Vollbeding\n" \
"Copyright (C) 1999-2006 MIYASAKA Masaru\n" \
"Copyright (C) 2009 Pierre Ossman for Cendio AB\n" \
"Copyright (C) 2009-2011 D. R. Commander\n" \
"Copyright (C) 2009-2012 D. R. Commander\n" \
"Copyright (C) 2009-2011 Nokia Corporation and/or its subsidiary(-ies)"

View File

@@ -850,8 +850,9 @@ int jpeg_quality_scaling (int quality)
premise of this routine collapses. Caveat user.
jpeg_default_qtables (j_compress_ptr cinfo, boolean force_baseline)
[libjpeg v7/v8 only] Set default quantization tables with linear
q_scale_factor[] values (see below).
[libjpeg v7+ API/ABI emulation only]
Set default quantization tables with linear q_scale_factor[] values
(see below).
jpeg_add_quant_table (j_compress_ptr cinfo, int which_tbl,
const unsigned int *basic_table,
@@ -976,12 +977,13 @@ JQUANT_TBL * quant_tbl_ptrs[NUM_QUANT_TBLS]
slot 1 for chrominance.
int q_scale_factor[NUM_QUANT_TBLS]
[libjpeg v7+ only] Linear quantization scaling factors (0-100, default
100) for use with jpeg_default_qtables().
[libjpeg v7+ API/ABI emulation only]
Linear quantization scaling factors (0-100, default 100)
for use with jpeg_default_qtables().
See rdswitch.c and cjpeg.c for an example of usage.
Note that the q_scale_factor[] values use "linear" scales, so JPEG
quality levels chosen by the user must be converted to these scales
using jpeg_quality_scaling(). Here is an example which corresponds to
using jpeg_quality_scaling(). Here is an example that corresponds to
cjpeg -quality 90,70:
jpeg_set_defaults(cinfo);
@@ -1012,11 +1014,12 @@ JHUFF_TBL * ac_huff_tbl_ptrs[NUM_HUFF_TBLS]
any need to mess with providing your own Huffman tables.
[libjpeg v7+ only] The actual dimensions of the JPEG image that will be written
to the file are given by the following fields. These are computed from the
input image dimensions and the compression parameters by jpeg_start_compress().
You can also call jpeg_calc_jpeg_dimensions() to obtain the values that will
result from the current parameter settings.
[libjpeg v7+ API/ABI emulation only]
The actual dimensions of the JPEG image that will be written to the file are
given by the following fields. These are computed from the input image
dimensions and the compression parameters by jpeg_start_compress(). You can
also call jpeg_calc_jpeg_dimensions() to obtain the values that will result
from the current parameter settings.
JDIMENSION jpeg_width Actual dimensions of output image.
JDIMENSION jpeg_height

View File

@@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>IFPkgDescriptionDescription</key>
<string>A SIMD-accelerated JPEG codec which provides both the libjpeg and TurboJPEG APIs</string>
<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>

View File

@@ -1,13 +1,13 @@
{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350
{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360
{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
{\colortbl;\red255\green255\blue255;}
\margl1440\margr1440\vieww15200\viewh9600\viewkind0
\deftab720
\pard\pardeftab720\ql\qnatural
\f0\fs24 \cf0 libjpeg-turbo is a derivative of libjpeg which uses SIMD instructions (MMX, SSE2, etc.) to accelerate baseline JPEG compression and decompression on x86 and x86-64 systems. On such systems, libjpeg-turbo is generally 2-4x as fast as the unmodified version of libjpeg, all else being equal. libjpeg-turbo also includes a wrapper library which implements the TurboJPEG API used by VirtualGL and TurboVNC.\
\f0\fs24 \cf0 libjpeg-turbo is a derivative of libjpeg 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 the unmodified version of libjpeg, all else being equal.\
\
libjpeg-turbo was originally based on libjpeg/SIMD by Miyasaka Masaru, but the TigerVNC and VirtualGL projects made numerous enhancements to the codec in 2009, including improved support for Mac OS X, 64-bit support, support for 32-bit and big endian pixel formats (RGBX, XBGR, etc.), accelerated Huffman encoding/decoding, and various bug fixes. The goal was to produce a fully open source codec that could replace the partially closed source TurboJPEG/IPP codec used by VirtualGL and TurboVNC. libjpeg-turbo generally performs in the range of 80-120% of TurboJPEG/IPP. It is faster in some areas but slower in others.\
libjpeg-turbo was originally based on libjpeg/SIMD by Miyasaka Masaru, but the TigerVNC and VirtualGL projects made numerous enhancements to the codec in 2009, including improved support for Mac OS X, 64-bit support, support for 32-bit and big-endian pixel formats (RGBX, XBGR, etc.), accelerated Huffman encoding/decoding, and various bug fixes. The goal was to produce a fully open-source codec that could replace the partially closed-source TurboJPEG/IPP codec used by VirtualGL and TurboVNC. libjpeg-turbo generally achieves 80-120% of the performance of TurboJPEG/IPP. It is faster in some areas but slower in others.\
\
In early 2010, libjpeg-turbo spun off into its own independent project, with the goal of making high-speed JPEG compression/decompression technology available to a broader range of users and developers.\
}

View File

@@ -5,22 +5,20 @@ Priority: optional
Architecture: {__ARCH}
Essential: no
Maintainer: The libjpeg-turbo Project [http://www.libjpeg-turbo.org]
Description: A SIMD-accelerated JPEG codec which provides both the libjpeg and TurboJPEG APIs
libjpeg-turbo is a derivative of libjpeg which uses SIMD instructions (MMX,
SSE2, etc.) to accelerate baseline JPEG compression and decompression on x86
and x86-64 systems. On such systems, libjpeg-turbo is generally 2-4x as fast
as the unmodified version of libjpeg, all else being equal. libjpeg-turbo
also includes a wrapper library which implements the TurboJPEG API used by
VirtualGL and TurboVNC.
Description: A SIMD-accelerated JPEG codec that provides both the libjpeg and TurboJPEG APIs
libjpeg-turbo is a derivative of libjpeg 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 the unmodified version of libjpeg, all else being equal.
.
libjpeg-turbo was originally based on libjpeg/SIMD by Miyasaka Masaru, but
the TigerVNC and VirtualGL projects made numerous enhancements to the codec
in 2009, including improved support for Mac OS X, 64-bit support, support
for 32-bit and big endian pixel formats (RGBX, XBGR, etc.), accelerated
for 32-bit and big-endian pixel formats (RGBX, XBGR, etc.), accelerated
Huffman encoding/decoding, and various bug fixes. The goal was to produce a
fully open source codec that could replace the partially closed source
fully open-source codec that could replace the partially closed-source
TurboJPEG/IPP codec used by VirtualGL and TurboVNC. libjpeg-turbo generally
performs in the range of 80-120% of TurboJPEG/IPP. It is faster in some
achieves 80-120% of the performance of TurboJPEG/IPP. It is faster in some
areas but slower in others.
.
In early 2010, libjpeg-turbo spun off into its own independent project, with

View File

@@ -76,8 +76,11 @@ Section "@CMAKE_PROJECT_NAME@ SDK for @INST_PLATFORM@ (required)"
SetOutPath $INSTDIR\doc
File "@CMAKE_SOURCE_DIR@\README"
File "@CMAKE_SOURCE_DIR@\README-turbo.txt"
File "@CMAKE_SOURCE_DIR@\example.c"
File "@CMAKE_SOURCE_DIR@\libjpeg.txt"
File "@CMAKE_SOURCE_DIR@\structure.txt"
File "@CMAKE_SOURCE_DIR@\usage.txt"
File "@CMAKE_SOURCE_DIR@\wizard.txt"
WriteRegStr HKLM "SOFTWARE\@INST_DIR@ @VERSION@" "Install_Dir" "$INSTDIR"
@@ -132,8 +135,11 @@ Section "Uninstall"
Delete $INSTDIR\uninstall_@VERSION@.exe
Delete $INSTDIR\doc\README
Delete $INSTDIR\doc\README-turbo.txt
Delete $INSTDIR\doc\example.c
Delete $INSTDIR\doc\libjpeg.txt
Delete $INSTDIR\doc\structure.txt
Delete $INSTDIR\doc\usage.txt
Delete $INSTDIR\doc\wizard.txt
RMDir "$INSTDIR\include"
RMDir "$INSTDIR\lib"

View File

@@ -4,7 +4,7 @@
%define __lib lib
%endif
Summary: A SIMD-accelerated JPEG codec which provides both the libjpeg and TurboJPEG APIs
Summary: A SIMD-accelerated JPEG codec that provides both the libjpeg and TurboJPEG APIs
Name: @PACKAGE_NAME@
Version: @VERSION@
Vendor: The libjpeg-turbo Project
@@ -19,21 +19,20 @@ Provides: %{name} = %{version}-%{release}, turbojpeg = 2.00
Obsoletes: turbojpeg
%description
libjpeg-turbo is a derivative of libjpeg which uses SIMD instructions (MMX,
SSE2, etc.) to accelerate baseline JPEG compression and decompression on x86
and x86-64 systems. On such systems, libjpeg-turbo is generally 2-4x as fast
as the unmodified version of libjpeg, all else being equal. libjpeg-turbo also
includes a wrapper library which implements the TurboJPEG API used by VirtualGL
and TurboVNC.
libjpeg-turbo is a derivative of libjpeg 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 the unmodified version of libjpeg, all else being equal.
libjpeg-turbo was originally based on libjpeg/SIMD by Miyasaka Masaru, but
the TigerVNC and VirtualGL projects made numerous enhancements to the codec in
2009, including improved support for Mac OS X, 64-bit support, support for
32-bit and big endian pixel formats (RGBX, XBGR, etc.), accelerated Huffman
encoding/decoding, and various bug fixes. The goal was to produce a fully open
source codec that could replace the partially closed source TurboJPEG/IPP codec
used by VirtualGL and TurboVNC. libjpeg-turbo generally performs in the range
of 80-120% of TurboJPEG/IPP. It is faster in some areas but slower in others.
32-bit and big-endian pixel formats (RGBX, XBGR, etc.), accelerated Huffman
encoding/decoding, and various bug fixes. The goal was to produce a fully
open-source codec that could replace the partially closed-source TurboJPEG/IPP
codec used by VirtualGL and TurboVNC. libjpeg-turbo generally achieves 80-120%
of the performance of TurboJPEG/IPP. It is faster in some areas but slower in
others.
In early 2010, libjpeg-turbo spun off into its own independent project, with
the goal of making high-speed JPEG compression/decompression technology
@@ -49,7 +48,7 @@ available to a broader range of users and developers.
%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT libdir=/opt/%{name}/%{__lib} mandir=/opt/%{name}/man
make install DESTDIR=$RPM_BUILD_ROOT libdir=/opt/%{name}/%{__lib} mandir=/opt/%{name}/man docdir=/opt/%{name}/doc exampledir=/opt/%{name}/doc
rm -f $RPM_BUILD_ROOT/opt/%{name}/%{__lib}/*.la
mkdir -p $RPM_BUILD_ROOT/usr/%{__lib}
mv $RPM_BUILD_ROOT/opt/%{name}/%{__lib}/libturbojpeg.* $RPM_BUILD_ROOT/usr/%{__lib}
@@ -59,6 +58,8 @@ mkdir -p $RPM_BUILD_ROOT/usr/include
mv $RPM_BUILD_ROOT/opt/%{name}/include/turbojpeg.h $RPM_BUILD_ROOT/usr/include
ln -fs /usr/include/turbojpeg.h $RPM_BUILD_ROOT/opt/%{name}/include/
ln -fs /usr/%{__lib}/libturbojpeg.a $RPM_BUILD_ROOT/opt/%{name}/%{__lib}/
mkdir -p $RPM_BUILD_ROOT%{_defaultdocdir}
mv $RPM_BUILD_ROOT/opt/%{name}/doc $RPM_BUILD_ROOT%{_defaultdocdir}/%{name}-%{version}
%post -p /sbin/ldconfig
@@ -69,7 +70,8 @@ rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
%doc %{_srcdir}/README-turbo.txt %{_srcdir}/README %{_srcdir}/libjpeg.txt %{_srcdir}/usage.txt
%dir %{_defaultdocdir}/%{name}-%{version}
%doc %{_defaultdocdir}/%{name}-%{version}/*
%dir /opt/%{name}
%dir /opt/%{name}/bin
/opt/%{name}/bin/cjpeg

View File

@@ -23,14 +23,10 @@ umask 022
rm -f $PACKAGE_NAME-$VERSION-cygwin.tar.bz2
TMPDIR=`mktemp -d /tmp/ljtbuild.XXXXXX`
__PWD=`pwd`
make install DESTDIR=$TMPDIR/pkg mandir=/opt/$PACKAGE_NAME/man
make install DESTDIR=$TMPDIR/pkg mandir=/opt/$PACKAGE_NAME/man \
docdir=/usr/share/doc/$PACKAGE_NAME-$VERSION \
exampledir=/usr/share/doc/$PACKAGE_NAME-$VERSION
rm $TMPDIR/pkg/opt/$PACKAGE_NAME/lib/*.la
DOCDIR=$TMPDIR/pkg/usr/share/doc/$PACKAGE_NAME-$VERSION
mkdir -p $DOCDIR
install -m 644 $SRCDIR/README-turbo.txt $DOCDIR
install -m 644 $SRCDIR/README $DOCDIR
install -m 644 $SRCDIR/libjpeg.txt $DOCDIR
install -m 644 $SRCDIR/usage.txt $DOCDIR
ln -fs lib $TMPDIR/pkg/opt/$PACKAGE_NAME/lib32
cd $TMPDIR/pkg
tar cfj ../$PACKAGE_NAME-$VERSION-cygwin.tar.bz2 *

View File

@@ -36,7 +36,10 @@ makedeb()
| sed s/{__VERSION}/$VERSION/g | sed s/{__BUILD}/$BUILD/g \
| sed s/{__ARCH}/$DEBARCH/g > $TMPDIR/DEBIAN/control)
make install prefix=$TMPDIR/opt/$DIRNAME libdir=$TMPDIR/opt/$DIRNAME/$__LIB mandir=$TMPDIR/opt/$DIRNAME/man
make install prefix=$TMPDIR/opt/$DIRNAME libdir=$TMPDIR/opt/$DIRNAME/$__LIB \
mandir=$TMPDIR/opt/$DIRNAME/man \
docdir=$TMPDIR/usr/share/doc/$DIRNAME-$VERSION \
exampledir=$TMPDIR/usr/share/doc/$DIRNAME-$VERSION
rm -f $TMPDIR/opt/$DIRNAME/$__LIB/*.la
if [ $SUPPLEMENT = 1 ]; then
@@ -44,6 +47,7 @@ makedeb()
rm -rf $TMPDIR/opt/$DIRNAME/man
rm -rf $TMPDIR/opt/$DIRNAME/bin
rm -rf $TMPDIR/opt/$DIRNAME/classes
rm -rf $TMPDIR/usr
fi
mkdir -p $TMPDIR/usr/$__LIB
@@ -63,11 +67,6 @@ makedeb()
mkdir -p $TMPDIR/usr/include
mv $TMPDIR/opt/$DIRNAME/include/turbojpeg.h $TMPDIR/usr/include
ln -fs /usr/include/turbojpeg.h $TMPDIR/opt/$DIRNAME/include/
mkdir -p $TMPDIR/usr/share/doc/$DIRNAME-$VERSION
install -m 644 $SRCDIR/README-turbo.txt $TMPDIR/usr/share/doc/$DIRNAME-$VERSION
install -m 644 $SRCDIR/README $TMPDIR/usr/share/doc/$DIRNAME-$VERSION
install -m 644 $SRCDIR/libjpeg.txt $TMPDIR/usr/share/doc/$DIRNAME-$VERSION
install -m 644 $SRCDIR/usage.txt $TMPDIR/usr/share/doc/$DIRNAME-$VERSION
fi
sudo chown -Rh root:root $TMPDIR/*

View File

@@ -17,24 +17,51 @@ onexit()
usage()
{
echo "$0 [universal [32-bit build dir]]"
echo "$0 [-build32 [32-bit build dir]] [-buildarmv6 [ARM v6 build dir]] [-buildarmv7 [ARM v7 build dir]]"
exit 1
}
UNIVERSAL=0
PACKAGE_NAME=@PACKAGE_NAME@
VERSION=@VERSION@
BUILD=@BUILD@
SRCDIR=@abs_top_srcdir@
BUILDDIR32=@abs_top_srcdir@/osxx86
BUILD32=0
BUILDDIRARMV6=@abs_top_srcdir@/iosarmv6
BUILDARMV6=0
BUILDDIRARMV7=@abs_top_srcdir@/iosarmv7
BUILDARMV7=0
WITH_JAVA=@WITH_JAVA@
if [ $# -gt 0 ]; then
if [ "$1" = "universal" ]; then
UNIVERSAL=1
if [ $# -gt 1 ]; then BUILDDIR32=$2; fi
fi
fi
while [ $# -gt 0 ]; do
case $1 in
-h*) usage 0 ;;
-build32)
BUILD32=1
if [ $# -gt 1 ]; then
if [[ ! "$2" =~ -.* ]]; then
BUILDDIR32=$2; shift
fi
fi
;;
-buildarmv6)
BUILDARMV6=1
if [ $# -gt 1 ]; then
if [[ ! "$2" =~ -.* ]]; then
BUILDDIRARMV6=$2; shift
fi
fi
;;
-buildarmv7)
BUILDARMV7=1
if [ $# -gt 1 ]; then
if [[ ! "$2" =~ -.* ]]; then
BUILDDIRARMV7=$2; shift
fi
fi
;;
esac
shift
done
PACKAGEMAKER=/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker
if [ -f $PACKAGE_NAME-$VERSION.dmg ]; then
@@ -46,14 +73,16 @@ TMPDIR=`mktemp -d /tmp/$PACKAGE_NAME-build.XXXXXX`
PKGROOT=$TMPDIR/pkg/Package_Root
mkdir -p $PKGROOT
mkdir -p $PKGROOT/opt/$PACKAGE_NAME/bin
make install DESTDIR=$PKGROOT mandir=/opt/$PACKAGE_NAME/man
make install DESTDIR=$PKGROOT mandir=/opt/$PACKAGE_NAME/man \
docdir=/Library/Documentation/$PACKAGE_NAME \
exampledir=/Library/Documentation/$PACKAGE_NAME
rm -f $PKGROOT/opt/$PACKAGE_NAME/lib/*.la
mkdir -p $PKGROOT/usr/lib
mv $PKGROOT/opt/$PACKAGE_NAME/lib/libturbojpeg.* $PKGROOT/usr/lib
mkdir -p $PKGROOT/usr/include
mv $PKGROOT/opt/$PACKAGE_NAME/include/turbojpeg.h $PKGROOT/usr/include
if [ $UNIVERSAL = 1 ]; then
if [ $BUILD32 = 1 ]; then
if [ ! -d $BUILDDIR32 ]; then
echo ERROR: 32-bit build directory $BUILDDIR32 does not exist
exit 1
@@ -118,6 +147,52 @@ if [ $UNIVERSAL = 1 ]; then
fi
if [ $BUILDARMV6 = 1 ]; then
if [ ! -d $BUILDDIRARMV6 ]; then
echo ERROR: ARM v6 build directory $BUILDDIRARMV6 does not exist
exit 1
fi
if [ ! -f $BUILDDIRARMV6/Makefile ]; then
echo ERROR: ARM v6 build directory $BUILDDIRARMV6 is not configured
exit 1
fi
mkdir -p $TMPDIR/dist.armv6
pushd $BUILDDIRARMV6
make install DESTDIR=$TMPDIR/dist.armv6
popd
lipo -create \
$PKGROOT/opt/$PACKAGE_NAME/lib/libjpeg.a \
-arch arm $TMPDIR/dist.armv6/opt/$PACKAGE_NAME/lib/libjpeg.a \
-output $PKGROOT/opt/$PACKAGE_NAME/lib/libjpeg.a
lipo -create \
$PKGROOT/usr/lib/libturbojpeg.a \
-arch arm $TMPDIR/dist.armv6/opt/$PACKAGE_NAME/lib/libturbojpeg.a \
-output $PKGROOT/usr/lib/libturbojpeg.a
fi
if [ $BUILDARMV7 = 1 ]; then
if [ ! -d $BUILDDIRARMV7 ]; then
echo ERROR: ARM v7 build directory $BUILDDIRARMV7 does not exist
exit 1
fi
if [ ! -f $BUILDDIRARMV7/Makefile ]; then
echo ERROR: ARM v7 build directory $BUILDDIRARMV7 is not configured
exit 1
fi
mkdir -p $TMPDIR/dist.armv7
pushd $BUILDDIRARMV7
make install DESTDIR=$TMPDIR/dist.armv7
popd
lipo -create \
$PKGROOT/opt/$PACKAGE_NAME/lib/libjpeg.a \
-arch arm $TMPDIR/dist.armv7/opt/$PACKAGE_NAME/lib/libjpeg.a \
-output $PKGROOT/opt/$PACKAGE_NAME/lib/libjpeg.a
lipo -create \
$PKGROOT/usr/lib/libturbojpeg.a \
-arch arm $TMPDIR/dist.armv7/opt/$PACKAGE_NAME/lib/libturbojpeg.a \
-output $PKGROOT/usr/lib/libturbojpeg.a
fi
install_name_tool -id /opt/$PACKAGE_NAME/lib/libjpeg.@SO_MAJOR_VERSION@.dylib $PKGROOT/opt/$PACKAGE_NAME/lib/libjpeg.@SO_MAJOR_VERSION@.dylib
install_name_tool -id libturbojpeg.dylib $PKGROOT/usr/lib/libturbojpeg.dylib
@@ -133,7 +208,6 @@ if [ ! -h $PKGROOT/opt/$PACKAGE_NAME/lib64 ]; then
ln -fs lib $PKGROOT/opt/$PACKAGE_NAME/lib64
fi
mkdir -p $PKGROOT/Library/Documentation/$PACKAGE_NAME
chmod 1775 $PKGROOT/Library
chmod 775 $PKGROOT/Library/Documentation
mkdir -p $TMPDIR/pkg/Resources
@@ -142,11 +216,6 @@ cp pkgscripts/Description.plist $TMPDIR/pkg/
cp pkgscripts/Info.plist $TMPDIR/pkg/
install -m 755 pkgscripts/uninstall $PKGROOT/opt/$PACKAGE_NAME/bin/
install -m 644 $SRCDIR/README-turbo.txt $PKGROOT/Library/Documentation/$PACKAGE_NAME/README-turbo.txt
install -m 644 $SRCDIR/README $PKGROOT/Library/Documentation/$PACKAGE_NAME/README
install -m 644 $SRCDIR/libjpeg.txt $PKGROOT/Library/Documentation/$PACKAGE_NAME/libjpeg.txt
install -m 644 $SRCDIR/usage.txt $PKGROOT/Library/Documentation/$PACKAGE_NAME/usage.txt
sudo chown -R root:admin $PKGROOT
sudo chown -R root:0 $PKGROOT/usr
cp $SRCDIR/release/License.rtf $SRCDIR/release/Welcome.rtf $SRCDIR/release/ReadMe.rtf $TMPDIR/pkg/Resources/

View File

@@ -65,11 +65,11 @@ if [ $COMBINED = 1 ]; then
cd $PWD
fi
# This mess is to work around a bug in /usr/ccs/bin/make
make install DESTDIR=$TMPDIR libdir=/opt/$PACKAGE_NAME/$__LIB mandir=/opt/$PACKAGE_NAME/man AM_MAKEFLAGS="libdir=/opt/$PACKAGE_NAME/$__LIB mandir=/opt/$PACKAGE_NAME/man"
make install DESTDIR=$TMPDIR libdir=/opt/$PACKAGE_NAME/$__LIB \
mandir=/opt/$PACKAGE_NAME/man docdir=/opt/$PACKAGE_NAME/doc \
exampledir=/opt/$PACKAGE_NAME/doc \
AM_MAKEFLAGS="libdir=/opt/$PACKAGE_NAME/$__LIB mandir=/opt/$PACKAGE_NAME/man docdir=/opt/$PACKAGE_NAME/doc exampledir=/opt/$PACKAGE_NAME/doc"
rm -f $TMPDIR/opt/$PACKAGE_NAME/$__LIB/*.la
mkdir -p $TMPDIR/opt/$PACKAGE_NAME/doc
cp $SRCDIR/README-turbo.txt $SRCDIR/README $SRCDIR/libjpeg.txt $SRCDIR/usage.txt $TMPDIR/opt/$PACKAGE_NAME/doc
chmod 644 $TMPDIR/opt/$PACKAGE_NAME/doc/*
cat >$TMPDIR/proto <<EOF
i copyright
@@ -122,10 +122,13 @@ f none $PACKAGE_NAME/include/jmorecfg.h 0644 root bin
f none $PACKAGE_NAME/include/jpeglib.h 0644 root bin
f none $PACKAGE_NAME/include/turbojpeg.h 0644 root bin
d none $PACKAGE_NAME/doc 0755 root bin
f none $PACKAGE_NAME/doc/libjpeg.txt 0644 root bin
f none $PACKAGE_NAME/doc/README 0644 root bin
f none $PACKAGE_NAME/doc/README-turbo.txt 0644 root bin
f none $PACKAGE_NAME/doc/example.c 0644 root bin
f none $PACKAGE_NAME/doc/libjpeg.txt 0644 root bin
f none $PACKAGE_NAME/doc/structure.txt 0644 root bin
f none $PACKAGE_NAME/doc/usage.txt 0644 root bin
f none $PACKAGE_NAME/doc/wizard.txt 0644 root bin
EOF
if [ $WITH_JAVA = 1 ]; then
echo d none $PACKAGE_NAME/classes 0755 root bin >>$TMPDIR/proto

View File

@@ -3,7 +3,7 @@ PKG=@PACKAGE_NAME@
NAME=@PACKAGE_NAME@ SDK and run time libraries
VERSION=@VERSION@,REV=@BUILD@
SUNW_PKGVERS=1.0
DESC=A SIMD-accelerated JPEG codec which provides both the libjpeg and TurboJPEG APIs
DESC=A SIMD-accelerated JPEG codec that provides both the libjpeg and TurboJPEG APIs
VENDOR=The libjpeg-turbo Project
HOTLINE=http://www.libjpeg-turbo.org
EMAIL=information@libjpeg-turbo.org

View File

@@ -53,6 +53,9 @@ add_executable(jpegtran ../jpegtran.c ../cdjpeg.c ../rdswitch.c ../transupp.c)
target_link_libraries(jpegtran jpeg)
set_property(TARGET jpegtran PROPERTY COMPILE_FLAGS "-DUSE_SETMODE")
add_executable(jcstest ../jcstest.c)
target_link_libraries(jcstest jpeg)
install(TARGETS jpeg cjpeg djpeg jpegtran
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib

View File

@@ -1,5 +1,5 @@
if(NOT DEFINED NASM)
set(NASM nasm)
set(NASM nasm CACHE PATH "Path to NASM/YASM executable")
endif()
if(SIMD_X86_64)
@@ -37,6 +37,8 @@ else()
set(OBJDIR ${CMAKE_CURRENT_BINARY_DIR})
endif()
file(GLOB INC_FILES *.inc)
foreach(file ${SIMD_BASENAMES})
set(DEPFILE "")
set(SIMD_SRC ${CMAKE_CURRENT_SOURCE_DIR}/${file}.asm)
@@ -53,7 +55,8 @@ foreach(file ${SIMD_BASENAMES})
string(REGEX REPLACE "gra" "gry" DEPFILE ${DEPFILE})
endif()
set(SIMD_OBJ ${OBJDIR}/${file}.obj)
add_custom_command(OUTPUT ${SIMD_OBJ} DEPENDS ${SIMD_SRC} ${DEPFILE} *.inc
add_custom_command(OUTPUT ${SIMD_OBJ}
DEPENDS ${SIMD_SRC} ${DEPFILE} ${INC_FILES}
COMMAND ${NASM} ${NAFLAGS} ${SIMD_SRC} -o${SIMD_OBJ})
set(SIMD_OBJS ${SIMD_OBJS} ${SIMD_OBJ})
endforeach()

View File

@@ -61,7 +61,7 @@ endif
AM_CPPFLAGS = -I$(top_srcdir)
.asm.lo:
$(LIBTOOL) --mode=compile --tag NASM $(srcdir)/nasm_lt.sh $(NASM) $(NAFLAGS) -I$(srcdir) $< -o $@
$(LIBTOOL) --mode=compile --tag NASM $(srcdir)/nasm_lt.sh $(NASM) $(NAFLAGS) -I$(srcdir) -I. $< -o $@
jsimdcfg.inc: $(srcdir)/jsimdcfg.inc.h ../jpeglib.h ../jconfig.h ../jmorecfg.h
$(CPP) -I$(top_builddir) -I$(top_builddir)/simd $(srcdir)/jsimdcfg.inc.h | $(EGREP) "^[\;%]|^\ %" | sed 's%_cpp_protection_%%' | sed 's@% define@%define@g' > $@

View File

@@ -1,7 +1,7 @@
;
; jdclrss2-64.asm - colorspace conversion (64-bit SSE2)
;
; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
; Copyright 2009, 2012 Pierre Ossman <ossman@cendio.se> for Cendio AB
; Copyright 2009 D. R. Commander
;
; Based on
@@ -251,17 +251,13 @@ EXTN(jsimd_ycc_rgb_convert_sse2):
movntdq XMMWORD [rdi+0*SIZEOF_XMMWORD], xmmA
movntdq XMMWORD [rdi+1*SIZEOF_XMMWORD], xmmD
movntdq XMMWORD [rdi+2*SIZEOF_XMMWORD], xmmF
add rdi, byte RGB_PIXELSIZE*SIZEOF_XMMWORD ; outptr
jmp short .out0
.out1: ; --(unaligned)-----------------
pcmpeqb xmmH,xmmH ; xmmH=(all 1's)
maskmovdqu xmmA,xmmH ; movntdqu XMMWORD [rdi], xmmA
add rdi, byte SIZEOF_XMMWORD ; outptr
maskmovdqu xmmD,xmmH ; movntdqu XMMWORD [rdi], xmmD
add rdi, byte SIZEOF_XMMWORD ; outptr
maskmovdqu xmmF,xmmH ; movntdqu XMMWORD [rdi], xmmF
add rdi, byte SIZEOF_XMMWORD ; outptr
movdqu XMMWORD [rdi+0*SIZEOF_XMMWORD], xmmA
movdqu XMMWORD [rdi+1*SIZEOF_XMMWORD], xmmD
movdqu XMMWORD [rdi+2*SIZEOF_XMMWORD], xmmF
.out0:
add rdi, byte RGB_PIXELSIZE*SIZEOF_XMMWORD ; outptr
sub rcx, byte SIZEOF_XMMWORD
jz near .nextrow
@@ -271,64 +267,56 @@ EXTN(jsimd_ycc_rgb_convert_sse2):
jmp near .columnloop
.column_st32:
pcmpeqb xmmH,xmmH ; xmmH=(all 1's)
lea rcx, [rcx+rcx*2] ; imul ecx, RGB_PIXELSIZE
cmp rcx, byte 2*SIZEOF_XMMWORD
jb short .column_st16
maskmovdqu xmmA,xmmH ; movntdqu XMMWORD [rdi], xmmA
add rdi, byte SIZEOF_XMMWORD ; outptr
maskmovdqu xmmD,xmmH ; movntdqu XMMWORD [rdi], xmmD
add rdi, byte SIZEOF_XMMWORD ; outptr
movdqu XMMWORD [rdi+0*SIZEOF_XMMWORD], xmmA
movdqu XMMWORD [rdi+1*SIZEOF_XMMWORD], xmmD
add rdi, byte 2*SIZEOF_XMMWORD ; outptr
movdqa xmmA,xmmF
sub rcx, byte 2*SIZEOF_XMMWORD
jmp short .column_st15
.column_st16:
cmp rcx, byte SIZEOF_XMMWORD
jb short .column_st15
maskmovdqu xmmA,xmmH ; movntdqu XMMWORD [rdi], xmmA
movdqu XMMWORD [rdi+0*SIZEOF_XMMWORD], xmmA
add rdi, byte SIZEOF_XMMWORD ; outptr
movdqa xmmA,xmmD
sub rcx, byte SIZEOF_XMMWORD
.column_st15:
mov rax,rcx
xor rcx, byte 0x0F
shl rcx, 2
movd xmmB,ecx
psrlq xmmH,4
pcmpeqb xmmE,xmmE
psrlq xmmH,xmmB
psrlq xmmE,xmmB
punpcklbw xmmE,xmmH
; ----------------
mov rcx,rdi
and rcx, byte SIZEOF_XMMWORD-1
jz short .adj0
add rax,rcx
cmp rax, byte SIZEOF_XMMWORD
ja short .adj0
and rdi, byte (-SIZEOF_XMMWORD) ; align to 16-byte boundary
shl rcx, 3 ; pslldq xmmA,ecx & pslldq xmmE,rcx
movdqa xmmG,xmmA
movdqa xmmC,xmmE
pslldq xmmA, SIZEOF_XMMWORD/2
pslldq xmmE, SIZEOF_XMMWORD/2
movd xmmD,ecx
sub rcx, byte (SIZEOF_XMMWORD/2)*BYTE_BIT
jb short .adj1
movd xmmF,ecx
psllq xmmA,xmmF
psllq xmmE,xmmF
jmp short .adj0
.adj1: neg ecx
movd xmmF,ecx
psrlq xmmA,xmmF
psrlq xmmE,xmmF
psllq xmmG,xmmD
psllq xmmC,xmmD
por xmmA,xmmG
por xmmE,xmmC
.adj0: ; ----------------
maskmovdqu xmmA,xmmE ; movntdqu XMMWORD [rdi], xmmA
; Store the lower 8 bytes of xmmA to the output when it has enough
; space.
cmp rcx, byte SIZEOF_MMWORD
jb short .column_st7
movq MMWORD [rdi], xmmA
add rdi, byte SIZEOF_MMWORD
sub rcx, byte SIZEOF_MMWORD
psrldq xmmA, SIZEOF_MMWORD
.column_st7:
; Store the lower 4 bytes of xmmA to the output when it has enough
; space.
cmp rcx, byte SIZEOF_DWORD
jb short .column_st3
movd DWORD [rdi], xmmA
add rdi, byte SIZEOF_DWORD
sub rcx, byte SIZEOF_DWORD
psrldq xmmA, SIZEOF_DWORD
.column_st3:
; Store the lower 2 bytes of rax to the output when it has enough
; space.
movd eax, xmmA
cmp rcx, byte SIZEOF_WORD
jb short .column_st1
mov WORD [rdi], ax
add rdi, byte SIZEOF_WORD
sub rcx, byte SIZEOF_WORD
shr rax, 16
.column_st1:
; Store the lower 1 byte of rax to the output when it has enough
; space.
test rcx, rcx
jz short .nextrow
mov BYTE [rdi], al
%else ; RGB_PIXELSIZE == 4 ; -----------
@@ -373,19 +361,14 @@ EXTN(jsimd_ycc_rgb_convert_sse2):
movntdq XMMWORD [rdi+1*SIZEOF_XMMWORD], xmmD
movntdq XMMWORD [rdi+2*SIZEOF_XMMWORD], xmmC
movntdq XMMWORD [rdi+3*SIZEOF_XMMWORD], xmmH
add rdi, byte RGB_PIXELSIZE*SIZEOF_XMMWORD ; outptr
jmp short .out0
.out1: ; --(unaligned)-----------------
pcmpeqb xmmE,xmmE ; xmmE=(all 1's)
maskmovdqu xmmA,xmmE ; movntdqu XMMWORD [rdi], xmmA
add rdi, byte SIZEOF_XMMWORD ; outptr
maskmovdqu xmmD,xmmE ; movntdqu XMMWORD [rdi], xmmD
add rdi, byte SIZEOF_XMMWORD ; outptr
maskmovdqu xmmC,xmmE ; movntdqu XMMWORD [rdi], xmmC
add rdi, byte SIZEOF_XMMWORD ; outptr
maskmovdqu xmmH,xmmE ; movntdqu XMMWORD [rdi], xmmH
add rdi, byte SIZEOF_XMMWORD ; outptr
movdqu XMMWORD [rdi+0*SIZEOF_XMMWORD], xmmA
movdqu XMMWORD [rdi+1*SIZEOF_XMMWORD], xmmD
movdqu XMMWORD [rdi+2*SIZEOF_XMMWORD], xmmC
movdqu XMMWORD [rdi+3*SIZEOF_XMMWORD], xmmH
.out0:
add rdi, byte RGB_PIXELSIZE*SIZEOF_XMMWORD ; outptr
sub rcx, byte SIZEOF_XMMWORD
jz near .nextrow
@@ -395,63 +378,36 @@ EXTN(jsimd_ycc_rgb_convert_sse2):
jmp near .columnloop
.column_st32:
pcmpeqb xmmE,xmmE ; xmmE=(all 1's)
cmp rcx, byte SIZEOF_XMMWORD/2
jb short .column_st16
maskmovdqu xmmA,xmmE ; movntdqu XMMWORD [rdi], xmmA
add rdi, byte SIZEOF_XMMWORD ; outptr
maskmovdqu xmmD,xmmE ; movntdqu XMMWORD [rdi], xmmD
add rdi, byte SIZEOF_XMMWORD ; outptr
movdqu XMMWORD [rdi+0*SIZEOF_XMMWORD], xmmA
movdqu XMMWORD [rdi+1*SIZEOF_XMMWORD], xmmD
add rdi, byte 2*SIZEOF_XMMWORD ; outptr
movdqa xmmA,xmmC
movdqa xmmD,xmmH
sub rcx, byte SIZEOF_XMMWORD/2
.column_st16:
cmp rcx, byte SIZEOF_XMMWORD/4
jb short .column_st15
maskmovdqu xmmA,xmmE ; movntdqu XMMWORD [rdi], xmmA
movdqu XMMWORD [rdi+0*SIZEOF_XMMWORD], xmmA
add rdi, byte SIZEOF_XMMWORD ; outptr
movdqa xmmA,xmmD
sub rcx, byte SIZEOF_XMMWORD/4
.column_st15:
cmp rcx, byte SIZEOF_XMMWORD/16
jb near .nextrow
mov rax,rcx
xor rcx, byte 0x03
inc rcx
shl rcx, 4
movd xmmF,ecx
psrlq xmmE,xmmF
punpcklbw xmmE,xmmE
; ----------------
mov rcx,rdi
and rcx, byte SIZEOF_XMMWORD-1
jz short .adj0
lea rax, [rcx+rax*4] ; RGB_PIXELSIZE
cmp rax, byte SIZEOF_XMMWORD
ja short .adj0
and rdi, byte (-SIZEOF_XMMWORD) ; align to 16-byte boundary
shl rcx, 3 ; pslldq xmmA,ecx & pslldq xmmE,ecx
movdqa xmmB,xmmA
movdqa xmmG,xmmE
pslldq xmmA, SIZEOF_XMMWORD/2
pslldq xmmE, SIZEOF_XMMWORD/2
movd xmmC,ecx
sub rcx, byte (SIZEOF_XMMWORD/2)*BYTE_BIT
jb short .adj1
movd xmmH,ecx
psllq xmmA,xmmH
psllq xmmE,xmmH
jmp short .adj0
.adj1: neg rcx
movd xmmH,ecx
psrlq xmmA,xmmH
psrlq xmmE,xmmH
psllq xmmB,xmmC
psllq xmmG,xmmC
por xmmA,xmmB
por xmmE,xmmG
.adj0: ; ----------------
maskmovdqu xmmA,xmmE ; movntdqu XMMWORD [rdi], xmmA
; Store two pixels (8 bytes) of xmmA to the output when it has enough
; space.
cmp rcx, byte SIZEOF_XMMWORD/8
jb short .column_st7
movq MMWORD [rdi], xmmA
add rdi, byte SIZEOF_XMMWORD/8*4
sub rcx, byte SIZEOF_XMMWORD/8
psrldq xmmA, SIZEOF_XMMWORD/8*4
.column_st7:
; Store one pixel (4 bytes) of xmmA to the output when it has enough
; space.
test rcx, rcx
jz short .nextrow
movd DWORD [rdi], xmmA
%endif ; RGB_PIXELSIZE ; ---------------

View File

@@ -1,7 +1,7 @@
;
; jdclrss2.asm - colorspace conversion (SSE2)
;
; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
; Copyright 2009, 2012 Pierre Ossman <ossman@cendio.se> for Cendio AB
;
; Based on
; x86 SIMD extension for IJG JPEG library
@@ -262,17 +262,13 @@ EXTN(jsimd_ycc_rgb_convert_sse2):
movntdq XMMWORD [edi+0*SIZEOF_XMMWORD], xmmA
movntdq XMMWORD [edi+1*SIZEOF_XMMWORD], xmmD
movntdq XMMWORD [edi+2*SIZEOF_XMMWORD], xmmF
add edi, byte RGB_PIXELSIZE*SIZEOF_XMMWORD ; outptr
jmp short .out0
.out1: ; --(unaligned)-----------------
pcmpeqb xmmH,xmmH ; xmmH=(all 1's)
maskmovdqu xmmA,xmmH ; movntdqu XMMWORD [edi], xmmA
add edi, byte SIZEOF_XMMWORD ; outptr
maskmovdqu xmmD,xmmH ; movntdqu XMMWORD [edi], xmmD
add edi, byte SIZEOF_XMMWORD ; outptr
maskmovdqu xmmF,xmmH ; movntdqu XMMWORD [edi], xmmF
add edi, byte SIZEOF_XMMWORD ; outptr
movdqu XMMWORD [edi+0*SIZEOF_XMMWORD], xmmA
movdqu XMMWORD [edi+1*SIZEOF_XMMWORD], xmmD
movdqu XMMWORD [edi+2*SIZEOF_XMMWORD], xmmF
.out0:
add edi, byte RGB_PIXELSIZE*SIZEOF_XMMWORD ; outptr
sub ecx, byte SIZEOF_XMMWORD
jz near .nextrow
@@ -283,64 +279,56 @@ EXTN(jsimd_ycc_rgb_convert_sse2):
alignx 16,7
.column_st32:
pcmpeqb xmmH,xmmH ; xmmH=(all 1's)
lea ecx, [ecx+ecx*2] ; imul ecx, RGB_PIXELSIZE
cmp ecx, byte 2*SIZEOF_XMMWORD
jb short .column_st16
maskmovdqu xmmA,xmmH ; movntdqu XMMWORD [edi], xmmA
add edi, byte SIZEOF_XMMWORD ; outptr
maskmovdqu xmmD,xmmH ; movntdqu XMMWORD [edi], xmmD
add edi, byte SIZEOF_XMMWORD ; outptr
movdqu XMMWORD [edi+0*SIZEOF_XMMWORD], xmmA
movdqu XMMWORD [edi+1*SIZEOF_XMMWORD], xmmD
add edi, byte 2*SIZEOF_XMMWORD ; outptr
movdqa xmmA,xmmF
sub ecx, byte 2*SIZEOF_XMMWORD
jmp short .column_st15
.column_st16:
cmp ecx, byte SIZEOF_XMMWORD
jb short .column_st15
maskmovdqu xmmA,xmmH ; movntdqu XMMWORD [edi], xmmA
movdqu XMMWORD [edi+0*SIZEOF_XMMWORD], xmmA
add edi, byte SIZEOF_XMMWORD ; outptr
movdqa xmmA,xmmD
sub ecx, byte SIZEOF_XMMWORD
.column_st15:
mov eax,ecx
xor ecx, byte 0x0F
shl ecx, 2
movd xmmB,ecx
psrlq xmmH,4
pcmpeqb xmmE,xmmE
psrlq xmmH,xmmB
psrlq xmmE,xmmB
punpcklbw xmmE,xmmH
; ----------------
mov ecx,edi
and ecx, byte SIZEOF_XMMWORD-1
jz short .adj0
add eax,ecx
cmp eax, byte SIZEOF_XMMWORD
ja short .adj0
and edi, byte (-SIZEOF_XMMWORD) ; align to 16-byte boundary
shl ecx, 3 ; pslldq xmmA,ecx & pslldq xmmE,ecx
movdqa xmmG,xmmA
movdqa xmmC,xmmE
pslldq xmmA, SIZEOF_XMMWORD/2
pslldq xmmE, SIZEOF_XMMWORD/2
movd xmmD,ecx
sub ecx, byte (SIZEOF_XMMWORD/2)*BYTE_BIT
jb short .adj1
movd xmmF,ecx
psllq xmmA,xmmF
psllq xmmE,xmmF
jmp short .adj0
.adj1: neg ecx
movd xmmF,ecx
psrlq xmmA,xmmF
psrlq xmmE,xmmF
psllq xmmG,xmmD
psllq xmmC,xmmD
por xmmA,xmmG
por xmmE,xmmC
.adj0: ; ----------------
maskmovdqu xmmA,xmmE ; movntdqu XMMWORD [edi], xmmA
; Store the lower 8 bytes of xmmA to the output when it has enough
; space.
cmp ecx, byte SIZEOF_MMWORD
jb short .column_st7
movq MMWORD [edi], xmmA
add edi, byte SIZEOF_MMWORD
sub ecx, byte SIZEOF_MMWORD
psrldq xmmA, SIZEOF_MMWORD
.column_st7:
; Store the lower 4 bytes of xmmA to the output when it has enough
; space.
cmp ecx, byte SIZEOF_DWORD
jb short .column_st3
movd DWORD [edi], xmmA
add edi, byte SIZEOF_DWORD
sub ecx, byte SIZEOF_DWORD
psrldq xmmA, SIZEOF_DWORD
.column_st3:
; Store the lower 2 bytes of eax to the output when it has enough
; space.
movd eax, xmmA
cmp ecx, byte SIZEOF_WORD
jb short .column_st1
mov WORD [edi], ax
add edi, byte SIZEOF_WORD
sub ecx, byte SIZEOF_WORD
shr eax, 16
.column_st1:
; Store the lower 1 byte of eax to the output when it has enough
; space.
test ecx, ecx
jz short .nextrow
mov BYTE [edi], al
%else ; RGB_PIXELSIZE == 4 ; -----------
@@ -385,19 +373,14 @@ EXTN(jsimd_ycc_rgb_convert_sse2):
movntdq XMMWORD [edi+1*SIZEOF_XMMWORD], xmmD
movntdq XMMWORD [edi+2*SIZEOF_XMMWORD], xmmC
movntdq XMMWORD [edi+3*SIZEOF_XMMWORD], xmmH
add edi, byte RGB_PIXELSIZE*SIZEOF_XMMWORD ; outptr
jmp short .out0
.out1: ; --(unaligned)-----------------
pcmpeqb xmmE,xmmE ; xmmE=(all 1's)
maskmovdqu xmmA,xmmE ; movntdqu XMMWORD [edi], xmmA
add edi, byte SIZEOF_XMMWORD ; outptr
maskmovdqu xmmD,xmmE ; movntdqu XMMWORD [edi], xmmD
add edi, byte SIZEOF_XMMWORD ; outptr
maskmovdqu xmmC,xmmE ; movntdqu XMMWORD [edi], xmmC
add edi, byte SIZEOF_XMMWORD ; outptr
maskmovdqu xmmH,xmmE ; movntdqu XMMWORD [edi], xmmH
add edi, byte SIZEOF_XMMWORD ; outptr
movdqu XMMWORD [edi+0*SIZEOF_XMMWORD], xmmA
movdqu XMMWORD [edi+1*SIZEOF_XMMWORD], xmmD
movdqu XMMWORD [edi+2*SIZEOF_XMMWORD], xmmC
movdqu XMMWORD [edi+3*SIZEOF_XMMWORD], xmmH
.out0:
add edi, byte RGB_PIXELSIZE*SIZEOF_XMMWORD ; outptr
sub ecx, byte SIZEOF_XMMWORD
jz near .nextrow
@@ -408,63 +391,36 @@ EXTN(jsimd_ycc_rgb_convert_sse2):
alignx 16,7
.column_st32:
pcmpeqb xmmE,xmmE ; xmmE=(all 1's)
cmp ecx, byte SIZEOF_XMMWORD/2
jb short .column_st16
maskmovdqu xmmA,xmmE ; movntdqu XMMWORD [edi], xmmA
add edi, byte SIZEOF_XMMWORD ; outptr
maskmovdqu xmmD,xmmE ; movntdqu XMMWORD [edi], xmmD
add edi, byte SIZEOF_XMMWORD ; outptr
movdqu XMMWORD [edi+0*SIZEOF_XMMWORD], xmmA
movdqu XMMWORD [edi+1*SIZEOF_XMMWORD], xmmD
add edi, byte 2*SIZEOF_XMMWORD ; outptr
movdqa xmmA,xmmC
movdqa xmmD,xmmH
sub ecx, byte SIZEOF_XMMWORD/2
.column_st16:
cmp ecx, byte SIZEOF_XMMWORD/4
jb short .column_st15
maskmovdqu xmmA,xmmE ; movntdqu XMMWORD [edi], xmmA
movdqu XMMWORD [edi+0*SIZEOF_XMMWORD], xmmA
add edi, byte SIZEOF_XMMWORD ; outptr
movdqa xmmA,xmmD
sub ecx, byte SIZEOF_XMMWORD/4
.column_st15:
cmp ecx, byte SIZEOF_XMMWORD/16
jb short .nextrow
mov eax,ecx
xor ecx, byte 0x03
inc ecx
shl ecx, 4
movd xmmF,ecx
psrlq xmmE,xmmF
punpcklbw xmmE,xmmE
; ----------------
mov ecx,edi
and ecx, byte SIZEOF_XMMWORD-1
jz short .adj0
lea eax, [ecx+eax*4] ; RGB_PIXELSIZE
cmp eax, byte SIZEOF_XMMWORD
ja short .adj0
and edi, byte (-SIZEOF_XMMWORD) ; align to 16-byte boundary
shl ecx, 3 ; pslldq xmmA,ecx & pslldq xmmE,ecx
movdqa xmmB,xmmA
movdqa xmmG,xmmE
pslldq xmmA, SIZEOF_XMMWORD/2
pslldq xmmE, SIZEOF_XMMWORD/2
movd xmmC,ecx
sub ecx, byte (SIZEOF_XMMWORD/2)*BYTE_BIT
jb short .adj1
movd xmmH,ecx
psllq xmmA,xmmH
psllq xmmE,xmmH
jmp short .adj0
.adj1: neg ecx
movd xmmH,ecx
psrlq xmmA,xmmH
psrlq xmmE,xmmH
psllq xmmB,xmmC
psllq xmmG,xmmC
por xmmA,xmmB
por xmmE,xmmG
.adj0: ; ----------------
maskmovdqu xmmA,xmmE ; movntdqu XMMWORD [edi], xmmA
; Store two pixels (8 bytes) of xmmA to the output when it has enough
; space.
cmp ecx, byte SIZEOF_XMMWORD/8
jb short .column_st7
movq MMWORD [edi], xmmA
add edi, byte SIZEOF_XMMWORD/8*4
sub ecx, byte SIZEOF_XMMWORD/8
psrldq xmmA, SIZEOF_XMMWORD/8*4
.column_st7:
; Store one pixel (4 bytes) of xmmA to the output when it has enough
; space.
test ecx, ecx
jz short .nextrow
movd DWORD [edi], xmmA
%endif ; RGB_PIXELSIZE ; ---------------

View File

@@ -1,7 +1,7 @@
;
; jdmrgss2-64.asm - merged upsampling/color conversion (64-bit SSE2)
;
; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
; Copyright 2009, 2012 Pierre Ossman <ossman@cendio.se> for Cendio AB
; Copyright 2009 D. R. Commander
;
; Based on
@@ -12,7 +12,7 @@
; This file should be assembled with NASM (Netwide Assembler),
; can *not* be assembled with Microsoft's MASM or any compatible
; assembler (including Borland's Turbo Assembler).
; NASM is available from http://nasm.sourceforge.net/ for
; NASM is available from http://nasm.sourceforge.net/ or
; http://sourceforge.net/project/showfiles.php?group_id=6208
;
; [TAB8]
@@ -252,17 +252,13 @@ EXTN(jsimd_h2v1_merged_upsample_sse2):
movntdq XMMWORD [rdi+0*SIZEOF_XMMWORD], xmmA
movntdq XMMWORD [rdi+1*SIZEOF_XMMWORD], xmmD
movntdq XMMWORD [rdi+2*SIZEOF_XMMWORD], xmmF
add rdi, byte RGB_PIXELSIZE*SIZEOF_XMMWORD ; outptr
jmp short .out0
.out1: ; --(unaligned)-----------------
pcmpeqb xmmH,xmmH ; xmmH=(all 1's)
maskmovdqu xmmA,xmmH ; movntdqu XMMWORD [rdi], xmmA
add rdi, byte SIZEOF_XMMWORD ; outptr
maskmovdqu xmmD,xmmH ; movntdqu XMMWORD [rdi], xmmD
add rdi, byte SIZEOF_XMMWORD ; outptr
maskmovdqu xmmF,xmmH ; movntdqu XMMWORD [rdi], xmmF
add rdi, byte SIZEOF_XMMWORD ; outptr
movdqu XMMWORD [rdi+0*SIZEOF_XMMWORD], xmmA
movdqu XMMWORD [rdi+1*SIZEOF_XMMWORD], xmmD
movdqu XMMWORD [rdi+2*SIZEOF_XMMWORD], xmmF
.out0:
add rdi, byte RGB_PIXELSIZE*SIZEOF_XMMWORD ; outptr
sub rcx, byte SIZEOF_XMMWORD
jz near .endcolumn
@@ -275,64 +271,56 @@ EXTN(jsimd_h2v1_merged_upsample_sse2):
jmp near .columnloop
.column_st32:
pcmpeqb xmmH,xmmH ; xmmH=(all 1's)
lea rcx, [rcx+rcx*2] ; imul ecx, RGB_PIXELSIZE
cmp rcx, byte 2*SIZEOF_XMMWORD
jb short .column_st16
maskmovdqu xmmA,xmmH ; movntdqu XMMWORD [rdi], xmmA
add rdi, byte SIZEOF_XMMWORD ; outptr
maskmovdqu xmmD,xmmH ; movntdqu XMMWORD [rdi], xmmD
add rdi, byte SIZEOF_XMMWORD ; outptr
movdqu XMMWORD [rdi+0*SIZEOF_XMMWORD], xmmA
movdqu XMMWORD [rdi+1*SIZEOF_XMMWORD], xmmD
add rdi, byte 2*SIZEOF_XMMWORD ; outptr
movdqa xmmA,xmmF
sub rcx, byte 2*SIZEOF_XMMWORD
jmp short .column_st15
.column_st16:
cmp rcx, byte SIZEOF_XMMWORD
jb short .column_st15
maskmovdqu xmmA,xmmH ; movntdqu XMMWORD [rdi], xmmA
movdqu XMMWORD [rdi+0*SIZEOF_XMMWORD], xmmA
add rdi, byte SIZEOF_XMMWORD ; outptr
movdqa xmmA,xmmD
sub rcx, byte SIZEOF_XMMWORD
.column_st15:
mov rax,rcx
xor rcx, byte 0x0F
shl rcx, 2
movd xmmB,ecx
psrlq xmmH,4
pcmpeqb xmmE,xmmE
psrlq xmmH,xmmB
psrlq xmmE,xmmB
punpcklbw xmmE,xmmH
; ----------------
mov rcx,rdi
and rcx, byte SIZEOF_XMMWORD-1
jz short .adj0
add rax,rcx
cmp rax, byte SIZEOF_XMMWORD
ja short .adj0
and rdi, byte (-SIZEOF_XMMWORD) ; align to 16-byte boundary
shl rcx, 3 ; pslldq xmmA,ecx & pslldq xmmE,ecx
movdqa xmmG,xmmA
movdqa xmmC,xmmE
pslldq xmmA, SIZEOF_XMMWORD/2
pslldq xmmE, SIZEOF_XMMWORD/2
movd xmmD,ecx
sub rcx, byte (SIZEOF_XMMWORD/2)*BYTE_BIT
jb short .adj1
movd xmmF,ecx
psllq xmmA,xmmF
psllq xmmE,xmmF
jmp short .adj0
.adj1: neg rcx
movd xmmF,ecx
psrlq xmmA,xmmF
psrlq xmmE,xmmF
psllq xmmG,xmmD
psllq xmmC,xmmD
por xmmA,xmmG
por xmmE,xmmC
.adj0: ; ----------------
maskmovdqu xmmA,xmmE ; movntdqu XMMWORD [edi], xmmA
; Store the lower 8 bytes of xmmA to the output when it has enough
; space.
cmp rcx, byte SIZEOF_MMWORD
jb short .column_st7
movq MMWORD [rdi], xmmA
add rdi, byte SIZEOF_MMWORD
sub rcx, byte SIZEOF_MMWORD
psrldq xmmA, SIZEOF_MMWORD
.column_st7:
; Store the lower 4 bytes of xmmA to the output when it has enough
; space.
cmp rcx, byte SIZEOF_DWORD
jb short .column_st3
movd DWORD [rdi], xmmA
add rdi, byte SIZEOF_DWORD
sub rcx, byte SIZEOF_DWORD
psrldq xmmA, SIZEOF_DWORD
.column_st3:
; Store the lower 2 bytes of rax to the output when it has enough
; space.
movd eax, xmmA
cmp rcx, byte SIZEOF_WORD
jb short .column_st1
mov WORD [rdi], ax
add rdi, byte SIZEOF_WORD
sub rcx, byte SIZEOF_WORD
shr rax, 16
.column_st1:
; Store the lower 1 byte of rax to the output when it has enough
; space.
test rcx, rcx
jz short .endcolumn
mov BYTE [rdi], al
%else ; RGB_PIXELSIZE == 4 ; -----------
@@ -377,19 +365,14 @@ EXTN(jsimd_h2v1_merged_upsample_sse2):
movntdq XMMWORD [rdi+1*SIZEOF_XMMWORD], xmmD
movntdq XMMWORD [rdi+2*SIZEOF_XMMWORD], xmmC
movntdq XMMWORD [rdi+3*SIZEOF_XMMWORD], xmmH
add rdi, byte RGB_PIXELSIZE*SIZEOF_XMMWORD ; outptr
jmp short .out0
.out1: ; --(unaligned)-----------------
pcmpeqb xmmE,xmmE ; xmmE=(all 1's)
maskmovdqu xmmA,xmmE ; movntdqu XMMWORD [rdi], xmmA
add rdi, byte SIZEOF_XMMWORD ; outptr
maskmovdqu xmmD,xmmE ; movntdqu XMMWORD [rdi], xmmD
add rdi, byte SIZEOF_XMMWORD ; outptr
maskmovdqu xmmC,xmmE ; movntdqu XMMWORD [rdi], xmmC
add rdi, byte SIZEOF_XMMWORD ; outptr
maskmovdqu xmmH,xmmE ; movntdqu XMMWORD [rdi], xmmH
add rdi, byte SIZEOF_XMMWORD ; outptr
movdqu XMMWORD [rdi+0*SIZEOF_XMMWORD], xmmA
movdqu XMMWORD [rdi+1*SIZEOF_XMMWORD], xmmD
movdqu XMMWORD [rdi+2*SIZEOF_XMMWORD], xmmC
movdqu XMMWORD [rdi+3*SIZEOF_XMMWORD], xmmH
.out0:
add rdi, byte RGB_PIXELSIZE*SIZEOF_XMMWORD ; outptr
sub rcx, byte SIZEOF_XMMWORD
jz near .endcolumn
@@ -402,63 +385,36 @@ EXTN(jsimd_h2v1_merged_upsample_sse2):
jmp near .columnloop
.column_st32:
pcmpeqb xmmE,xmmE ; xmmE=(all 1's)
cmp rcx, byte SIZEOF_XMMWORD/2
jb short .column_st16
maskmovdqu xmmA,xmmE ; movntdqu XMMWORD [rdi], xmmA
add rdi, byte SIZEOF_XMMWORD ; outptr
maskmovdqu xmmD,xmmE ; movntdqu XMMWORD [rdi], xmmD
add rdi, byte SIZEOF_XMMWORD ; outptr
movdqu XMMWORD [rdi+0*SIZEOF_XMMWORD], xmmA
movdqu XMMWORD [rdi+1*SIZEOF_XMMWORD], xmmD
add rdi, byte 2*SIZEOF_XMMWORD ; outptr
movdqa xmmA,xmmC
movdqa xmmD,xmmH
sub rcx, byte SIZEOF_XMMWORD/2
.column_st16:
cmp rcx, byte SIZEOF_XMMWORD/4
jb short .column_st15
maskmovdqu xmmA,xmmE ; movntdqu XMMWORD [edi], xmmA
movdqu XMMWORD [rdi+0*SIZEOF_XMMWORD], xmmA
add rdi, byte SIZEOF_XMMWORD ; outptr
movdqa xmmA,xmmD
sub rcx, byte SIZEOF_XMMWORD/4
.column_st15:
cmp rcx, byte SIZEOF_XMMWORD/16
jb near .endcolumn
mov rax,rcx
xor rcx, byte 0x03
inc rcx
shl rcx, 4
movd xmmF,ecx
psrlq xmmE,xmmF
punpcklbw xmmE,xmmE
; ----------------
mov rcx,rdi
and rcx, byte SIZEOF_XMMWORD-1
jz short .adj0
lea rax, [rcx+rax*4] ; RGB_PIXELSIZE
cmp rax, byte SIZEOF_XMMWORD
ja short .adj0
and rdi, byte (-SIZEOF_XMMWORD) ; align to 16-byte boundary
shl rcx, 3 ; pslldq xmmA,ecx & pslldq xmmE,ecx
movdqa xmmB,xmmA
movdqa xmmG,xmmE
pslldq xmmA, SIZEOF_XMMWORD/2
pslldq xmmE, SIZEOF_XMMWORD/2
movd xmmC,ecx
sub rcx, byte (SIZEOF_XMMWORD/2)*BYTE_BIT
jb short .adj1
movd xmmH,ecx
psllq xmmA,xmmH
psllq xmmE,xmmH
jmp short .adj0
.adj1: neg rcx
movd xmmH,ecx
psrlq xmmA,xmmH
psrlq xmmE,xmmH
psllq xmmB,xmmC
psllq xmmG,xmmC
por xmmA,xmmB
por xmmE,xmmG
.adj0: ; ----------------
maskmovdqu xmmA,xmmE ; movntdqu XMMWORD [edi], xmmA
; Store two pixels (8 bytes) of xmmA to the output when it has enough
; space.
cmp rcx, byte SIZEOF_XMMWORD/8
jb short .column_st7
movq MMWORD [rdi], xmmA
add rdi, byte SIZEOF_XMMWORD/8*4
sub rcx, byte SIZEOF_XMMWORD/8
psrldq xmmA, SIZEOF_XMMWORD/8*4
.column_st7:
; Store one pixel (4 bytes) of xmmA to the output when it has enough
; space.
test rcx, rcx
jz short .endcolumn
movd DWORD [rdi], xmmA
%endif ; RGB_PIXELSIZE ; ---------------

View File

@@ -1,7 +1,7 @@
;
; jdmrgss2.asm - merged upsampling/color conversion (SSE2)
;
; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
; Copyright 2009, 2012 Pierre Ossman <ossman@cendio.se> for Cendio AB
;
; Based on
; x86 SIMD extension for IJG JPEG library
@@ -264,17 +264,13 @@ EXTN(jsimd_h2v1_merged_upsample_sse2):
movntdq XMMWORD [edi+0*SIZEOF_XMMWORD], xmmA
movntdq XMMWORD [edi+1*SIZEOF_XMMWORD], xmmD
movntdq XMMWORD [edi+2*SIZEOF_XMMWORD], xmmF
add edi, byte RGB_PIXELSIZE*SIZEOF_XMMWORD ; outptr
jmp short .out0
.out1: ; --(unaligned)-----------------
pcmpeqb xmmH,xmmH ; xmmH=(all 1's)
maskmovdqu xmmA,xmmH ; movntdqu XMMWORD [edi], xmmA
add edi, byte SIZEOF_XMMWORD ; outptr
maskmovdqu xmmD,xmmH ; movntdqu XMMWORD [edi], xmmD
add edi, byte SIZEOF_XMMWORD ; outptr
maskmovdqu xmmF,xmmH ; movntdqu XMMWORD [edi], xmmF
add edi, byte SIZEOF_XMMWORD ; outptr
movdqu XMMWORD [edi+0*SIZEOF_XMMWORD], xmmA
movdqu XMMWORD [edi+1*SIZEOF_XMMWORD], xmmD
movdqu XMMWORD [edi+2*SIZEOF_XMMWORD], xmmF
.out0:
add edi, byte RGB_PIXELSIZE*SIZEOF_XMMWORD ; outptr
sub ecx, byte SIZEOF_XMMWORD
jz near .endcolumn
@@ -288,64 +284,56 @@ EXTN(jsimd_h2v1_merged_upsample_sse2):
alignx 16,7
.column_st32:
pcmpeqb xmmH,xmmH ; xmmH=(all 1's)
lea ecx, [ecx+ecx*2] ; imul ecx, RGB_PIXELSIZE
cmp ecx, byte 2*SIZEOF_XMMWORD
jb short .column_st16
maskmovdqu xmmA,xmmH ; movntdqu XMMWORD [edi], xmmA
add edi, byte SIZEOF_XMMWORD ; outptr
maskmovdqu xmmD,xmmH ; movntdqu XMMWORD [edi], xmmD
add edi, byte SIZEOF_XMMWORD ; outptr
movdqu XMMWORD [edi+0*SIZEOF_XMMWORD], xmmA
movdqu XMMWORD [edi+1*SIZEOF_XMMWORD], xmmD
add edi, byte 2*SIZEOF_XMMWORD ; outptr
movdqa xmmA,xmmF
sub ecx, byte 2*SIZEOF_XMMWORD
jmp short .column_st15
.column_st16:
cmp ecx, byte SIZEOF_XMMWORD
jb short .column_st15
maskmovdqu xmmA,xmmH ; movntdqu XMMWORD [edi], xmmA
movdqu XMMWORD [edi+0*SIZEOF_XMMWORD], xmmA
add edi, byte SIZEOF_XMMWORD ; outptr
movdqa xmmA,xmmD
sub ecx, byte SIZEOF_XMMWORD
.column_st15:
mov eax,ecx
xor ecx, byte 0x0F
shl ecx, 2
movd xmmB,ecx
psrlq xmmH,4
pcmpeqb xmmE,xmmE
psrlq xmmH,xmmB
psrlq xmmE,xmmB
punpcklbw xmmE,xmmH
; ----------------
mov ecx,edi
and ecx, byte SIZEOF_XMMWORD-1
jz short .adj0
add eax,ecx
cmp eax, byte SIZEOF_XMMWORD
ja short .adj0
and edi, byte (-SIZEOF_XMMWORD) ; align to 16-byte boundary
shl ecx, 3 ; pslldq xmmA,ecx & pslldq xmmE,ecx
movdqa xmmG,xmmA
movdqa xmmC,xmmE
pslldq xmmA, SIZEOF_XMMWORD/2
pslldq xmmE, SIZEOF_XMMWORD/2
movd xmmD,ecx
sub ecx, byte (SIZEOF_XMMWORD/2)*BYTE_BIT
jb short .adj1
movd xmmF,ecx
psllq xmmA,xmmF
psllq xmmE,xmmF
jmp short .adj0
.adj1: neg ecx
movd xmmF,ecx
psrlq xmmA,xmmF
psrlq xmmE,xmmF
psllq xmmG,xmmD
psllq xmmC,xmmD
por xmmA,xmmG
por xmmE,xmmC
.adj0: ; ----------------
maskmovdqu xmmA,xmmE ; movntdqu XMMWORD [edi], xmmA
; Store the lower 8 bytes of xmmA to the output when it has enough
; space.
cmp ecx, byte SIZEOF_MMWORD
jb short .column_st7
movq MMWORD [edi], xmmA
add edi, byte SIZEOF_MMWORD
sub ecx, byte SIZEOF_MMWORD
psrldq xmmA, SIZEOF_MMWORD
.column_st7:
; Store the lower 4 bytes of xmmA to the output when it has enough
; space.
cmp ecx, byte SIZEOF_DWORD
jb short .column_st3
movd DWORD [edi], xmmA
add edi, byte SIZEOF_DWORD
sub ecx, byte SIZEOF_DWORD
psrldq xmmA, SIZEOF_DWORD
.column_st3:
; Store the lower 2 bytes of eax to the output when it has enough
; space.
movd eax, xmmA
cmp ecx, byte SIZEOF_WORD
jb short .column_st1
mov WORD [edi], ax
add edi, byte SIZEOF_WORD
sub ecx, byte SIZEOF_WORD
shr eax, 16
.column_st1:
; Store the lower 1 byte of eax to the output when it has enough
; space.
test ecx, ecx
jz short .endcolumn
mov BYTE [edi], al
%else ; RGB_PIXELSIZE == 4 ; -----------
@@ -390,19 +378,14 @@ EXTN(jsimd_h2v1_merged_upsample_sse2):
movntdq XMMWORD [edi+1*SIZEOF_XMMWORD], xmmD
movntdq XMMWORD [edi+2*SIZEOF_XMMWORD], xmmC
movntdq XMMWORD [edi+3*SIZEOF_XMMWORD], xmmH
add edi, byte RGB_PIXELSIZE*SIZEOF_XMMWORD ; outptr
jmp short .out0
.out1: ; --(unaligned)-----------------
pcmpeqb xmmE,xmmE ; xmmE=(all 1's)
maskmovdqu xmmA,xmmE ; movntdqu XMMWORD [edi], xmmA
add edi, byte SIZEOF_XMMWORD ; outptr
maskmovdqu xmmD,xmmE ; movntdqu XMMWORD [edi], xmmD
add edi, byte SIZEOF_XMMWORD ; outptr
maskmovdqu xmmC,xmmE ; movntdqu XMMWORD [edi], xmmC
add edi, byte SIZEOF_XMMWORD ; outptr
maskmovdqu xmmH,xmmE ; movntdqu XMMWORD [edi], xmmH
add edi, byte SIZEOF_XMMWORD ; outptr
movdqu XMMWORD [edi+0*SIZEOF_XMMWORD], xmmA
movdqu XMMWORD [edi+1*SIZEOF_XMMWORD], xmmD
movdqu XMMWORD [edi+2*SIZEOF_XMMWORD], xmmC
movdqu XMMWORD [edi+3*SIZEOF_XMMWORD], xmmH
.out0:
add edi, byte RGB_PIXELSIZE*SIZEOF_XMMWORD ; outptr
sub ecx, byte SIZEOF_XMMWORD
jz near .endcolumn
@@ -416,63 +399,36 @@ EXTN(jsimd_h2v1_merged_upsample_sse2):
alignx 16,7
.column_st32:
pcmpeqb xmmE,xmmE ; xmmE=(all 1's)
cmp ecx, byte SIZEOF_XMMWORD/2
jb short .column_st16
maskmovdqu xmmA,xmmE ; movntdqu XMMWORD [edi], xmmA
add edi, byte SIZEOF_XMMWORD ; outptr
maskmovdqu xmmD,xmmE ; movntdqu XMMWORD [edi], xmmD
add edi, byte SIZEOF_XMMWORD ; outptr
movdqu XMMWORD [edi+0*SIZEOF_XMMWORD], xmmA
movdqu XMMWORD [edi+1*SIZEOF_XMMWORD], xmmD
add edi, byte 2*SIZEOF_XMMWORD ; outptr
movdqa xmmA,xmmC
movdqa xmmD,xmmH
sub ecx, byte SIZEOF_XMMWORD/2
.column_st16:
cmp ecx, byte SIZEOF_XMMWORD/4
jb short .column_st15
maskmovdqu xmmA,xmmE ; movntdqu XMMWORD [edi], xmmA
movdqu XMMWORD [edi+0*SIZEOF_XMMWORD], xmmA
add edi, byte SIZEOF_XMMWORD ; outptr
movdqa xmmA,xmmD
sub ecx, byte SIZEOF_XMMWORD/4
.column_st15:
cmp ecx, byte SIZEOF_XMMWORD/16
jb short .endcolumn
mov eax,ecx
xor ecx, byte 0x03
inc ecx
shl ecx, 4
movd xmmF,ecx
psrlq xmmE,xmmF
punpcklbw xmmE,xmmE
; ----------------
mov ecx,edi
and ecx, byte SIZEOF_XMMWORD-1
jz short .adj0
lea eax, [ecx+eax*4] ; RGB_PIXELSIZE
cmp eax, byte SIZEOF_XMMWORD
ja short .adj0
and edi, byte (-SIZEOF_XMMWORD) ; align to 16-byte boundary
shl ecx, 3 ; pslldq xmmA,ecx & pslldq xmmE,ecx
movdqa xmmB,xmmA
movdqa xmmG,xmmE
pslldq xmmA, SIZEOF_XMMWORD/2
pslldq xmmE, SIZEOF_XMMWORD/2
movd xmmC,ecx
sub ecx, byte (SIZEOF_XMMWORD/2)*BYTE_BIT
jb short .adj1
movd xmmH,ecx
psllq xmmA,xmmH
psllq xmmE,xmmH
jmp short .adj0
.adj1: neg ecx
movd xmmH,ecx
psrlq xmmA,xmmH
psrlq xmmE,xmmH
psllq xmmB,xmmC
psllq xmmG,xmmC
por xmmA,xmmB
por xmmE,xmmG
.adj0: ; ----------------
maskmovdqu xmmA,xmmE ; movntdqu XMMWORD [edi], xmmA
; Store two pixels (8 bytes) of xmmA to the output when it has enough
; space.
cmp ecx, byte SIZEOF_XMMWORD/8
jb short .column_st7
movq MMWORD [edi], xmmA
add edi, byte SIZEOF_XMMWORD/8*4
sub ecx, byte SIZEOF_XMMWORD/8
psrldq xmmA, SIZEOF_XMMWORD/8*4
.column_st7:
; Store one pixel (4 bytes) of xmmA to the output when it has enough
; space.
test ecx, ecx
jz short .endcolumn
movd DWORD [edi], xmmA
%endif ; RGB_PIXELSIZE ; ---------------

View File

@@ -522,6 +522,10 @@ EXTERN(void) jsimd_h2v1_extxrgb_merged_upsample_sse2
JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,
JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));
EXTERN(void) jsimd_h2v1_fancy_upsample_neon
JPP((int max_v_samp_factor, JDIMENSION downsampled_width,
JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr));
/* SIMD Sample Conversion */
EXTERN(void) jsimd_convsamp_mmx JPP((JSAMPARRAY sample_data,
JDIMENSION start_col,

View File

@@ -104,7 +104,7 @@ init_simd (void)
int bufsize = 1024; /* an initial guess for the line buffer size limit */
#endif
if (simd_support != ~0)
if (simd_support != ~0U)
return;
simd_support = 0;
@@ -189,18 +189,22 @@ jsimd_rgb_ycc_convert (j_compress_ptr cinfo,
neonfct=jsimd_extrgb_ycc_convert_neon;
break;
case JCS_EXT_RGBX:
case JCS_EXT_RGBA:
neonfct=jsimd_extrgbx_ycc_convert_neon;
break;
case JCS_EXT_BGR:
neonfct=jsimd_extbgr_ycc_convert_neon;
break;
case JCS_EXT_BGRX:
case JCS_EXT_BGRA:
neonfct=jsimd_extbgrx_ycc_convert_neon;
break;
case JCS_EXT_XBGR:
case JCS_EXT_ABGR:
neonfct=jsimd_extxbgr_ycc_convert_neon;
break;
case JCS_EXT_XRGB:
case JCS_EXT_ARGB:
neonfct=jsimd_extxrgb_ycc_convert_neon;
break;
default:
@@ -233,18 +237,22 @@ jsimd_ycc_rgb_convert (j_decompress_ptr cinfo,
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:
@@ -330,6 +338,15 @@ jsimd_can_h2v1_fancy_upsample (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 (simd_support & JSIMD_ARM_NEON)
return 1;
return 0;
}
@@ -347,6 +364,9 @@ jsimd_h2v1_fancy_upsample (j_decompress_ptr cinfo,
JSAMPARRAY input_data,
JSAMPARRAY * output_data_ptr)
{
if (simd_support & JSIMD_ARM_NEON)
jsimd_h2v1_fancy_upsample_neon(cinfo->max_v_samp_factor,
compptr->downsampled_width, input_data, output_data_ptr);
}
GLOBAL(int)

View File

@@ -2157,3 +2157,241 @@ asm_function jsimd_quantize_neon
.unreq SHIFT
.unreq LOOP_COUNT
.endfunc
/*****************************************************************************/
/*
* GLOBAL(void)
* jsimd_h2v1_fancy_upsample_neon (int max_v_samp_factor,
* JDIMENSION downsampled_width,
* JSAMPARRAY input_data,
* JSAMPARRAY * output_data_ptr);
*
* Note: the use of unaligned writes is the main remaining bottleneck in
* this code, which can be potentially solved to get up to tens
* of percents performance improvement on Cortex-A8/Cortex-A9.
*/
/*
* Upsample 16 source pixels to 32 destination pixels. The new 16 source
* pixels are loaded to q0. The previous 16 source pixels are in q1. The
* shifted-by-one source pixels are constructed in q2 by using q0 and q1.
* Register d28 is used for multiplication by 3. Register q15 is used
* for adding +1 bias.
*/
.macro upsample16 OUTPTR, INPTR
vld1.8 {q0}, [\INPTR]!
vmovl.u8 q8, d0
vext.8 q2, q1, q0, #15
vmovl.u8 q9, d1
vaddw.u8 q10, q15, d4
vaddw.u8 q11, q15, d5
vmlal.u8 q8, d4, d28
vmlal.u8 q9, d5, d28
vmlal.u8 q10, d0, d28
vmlal.u8 q11, d1, d28
vmov q1, q0 /* backup source pixels to q1 */
vrshrn.u16 d6, q8, #2
vrshrn.u16 d7, q9, #2
vshrn.u16 d8, q10, #2
vshrn.u16 d9, q11, #2
vst2.8 {d6, d7, d8, d9}, [\OUTPTR]!
.endm
/*
* Upsample 32 source pixels to 64 destination pixels. Compared to 'usample16'
* macro, the roles of q0 and q1 registers are reversed for even and odd
* groups of 16 pixels, that's why "vmov q1, q0" instructions are not needed.
* Also this unrolling allows to reorder loads and stores to compensate
* multiplication latency and reduce stalls.
*/
.macro upsample32 OUTPTR, INPTR
/* even 16 pixels group */
vld1.8 {q0}, [\INPTR]!
vmovl.u8 q8, d0
vext.8 q2, q1, q0, #15
vmovl.u8 q9, d1
vaddw.u8 q10, q15, d4
vaddw.u8 q11, q15, d5
vmlal.u8 q8, d4, d28
vmlal.u8 q9, d5, d28
vmlal.u8 q10, d0, d28
vmlal.u8 q11, d1, d28
/* odd 16 pixels group */
vld1.8 {q1}, [\INPTR]!
vrshrn.u16 d6, q8, #2
vrshrn.u16 d7, q9, #2
vshrn.u16 d8, q10, #2
vshrn.u16 d9, q11, #2
vmovl.u8 q8, d2
vext.8 q2, q0, q1, #15
vmovl.u8 q9, d3
vaddw.u8 q10, q15, d4
vaddw.u8 q11, q15, d5
vmlal.u8 q8, d4, d28
vmlal.u8 q9, d5, d28
vmlal.u8 q10, d2, d28
vmlal.u8 q11, d3, d28
vst2.8 {d6, d7, d8, d9}, [\OUTPTR]!
vrshrn.u16 d6, q8, #2
vrshrn.u16 d7, q9, #2
vshrn.u16 d8, q10, #2
vshrn.u16 d9, q11, #2
vst2.8 {d6, d7, d8, d9}, [\OUTPTR]!
.endm
/*
* Upsample a row of WIDTH pixels from INPTR to OUTPTR.
*/
.macro upsample_row OUTPTR, INPTR, WIDTH, TMP1
/* special case for the first and last pixels */
sub \WIDTH, \WIDTH, #1
add \OUTPTR, \OUTPTR, #1
ldrb \TMP1, [\INPTR, \WIDTH]
strb \TMP1, [\OUTPTR, \WIDTH, asl #1]
ldrb \TMP1, [\INPTR], #1
strb \TMP1, [\OUTPTR, #-1]
vmov.8 d3[7], \TMP1
subs \WIDTH, \WIDTH, #32
blt 5f
0: /* process 32 pixels per iteration */
upsample32 \OUTPTR, \INPTR
subs \WIDTH, \WIDTH, #32
bge 0b
5:
adds \WIDTH, \WIDTH, #16
blt 1f
0: /* process 16 pixels if needed */
upsample16 \OUTPTR, \INPTR
subs \WIDTH, \WIDTH, #16
1:
adds \WIDTH, \WIDTH, #16
beq 9f
/* load the remaining 1-15 pixels */
add \INPTR, \INPTR, \WIDTH
tst \WIDTH, #1
beq 2f
sub \INPTR, \INPTR, #1
vld1.8 {d0[0]}, [\INPTR]
2:
tst \WIDTH, #2
beq 2f
vext.8 d0, d0, d0, #6
sub \INPTR, \INPTR, #1
vld1.8 {d0[1]}, [\INPTR]
sub \INPTR, \INPTR, #1
vld1.8 {d0[0]}, [\INPTR]
2:
tst \WIDTH, #4
beq 2f
vrev64.32 d0, d0
sub \INPTR, \INPTR, #1
vld1.8 {d0[3]}, [\INPTR]
sub \INPTR, \INPTR, #1
vld1.8 {d0[2]}, [\INPTR]
sub \INPTR, \INPTR, #1
vld1.8 {d0[1]}, [\INPTR]
sub \INPTR, \INPTR, #1
vld1.8 {d0[0]}, [\INPTR]
2:
tst \WIDTH, #8
beq 2f
vmov d1, d0
sub \INPTR, \INPTR, #8
vld1.8 {d0}, [\INPTR]
2: /* upsample the remaining pixels */
vmovl.u8 q8, d0
vext.8 q2, q1, q0, #15
vmovl.u8 q9, d1
vaddw.u8 q10, q15, d4
vaddw.u8 q11, q15, d5
vmlal.u8 q8, d4, d28
vmlal.u8 q9, d5, d28
vmlal.u8 q10, d0, d28
vmlal.u8 q11, d1, d28
vrshrn.u16 d10, q8, #2
vrshrn.u16 d12, q9, #2
vshrn.u16 d11, q10, #2
vshrn.u16 d13, q11, #2
vzip.8 d10, d11
vzip.8 d12, d13
/* store the remaining pixels */
tst \WIDTH, #8
beq 2f
vst1.8 {d10, d11}, [\OUTPTR]!
vmov q5, q6
2:
tst \WIDTH, #4
beq 2f
vst1.8 {d10}, [\OUTPTR]!
vmov d10, d11
2:
tst \WIDTH, #2
beq 2f
vst1.8 {d10[0]}, [\OUTPTR]!
vst1.8 {d10[1]}, [\OUTPTR]!
vst1.8 {d10[2]}, [\OUTPTR]!
vst1.8 {d10[3]}, [\OUTPTR]!
vext.8 d10, d10, d10, #4
2:
tst \WIDTH, #1
beq 2f
vst1.8 {d10[0]}, [\OUTPTR]!
vst1.8 {d10[1]}, [\OUTPTR]!
2:
9:
.endm
asm_function jsimd_h2v1_fancy_upsample_neon
MAX_V_SAMP_FACTOR .req r0
DOWNSAMPLED_WIDTH .req r1
INPUT_DATA .req r2
OUTPUT_DATA_PTR .req r3
OUTPUT_DATA .req OUTPUT_DATA_PTR
OUTPTR .req r4
INPTR .req r5
WIDTH .req ip
TMP .req lr
push {r4, r5, r6, lr}
vpush {d8-d15}
ldr OUTPUT_DATA, [OUTPUT_DATA_PTR]
cmp MAX_V_SAMP_FACTOR, #0
ble 99f
/* initialize constants */
vmov.u8 d28, #3
vmov.u16 q15, #1
11:
ldr INPTR, [INPUT_DATA], #4
ldr OUTPTR, [OUTPUT_DATA], #4
mov WIDTH, DOWNSAMPLED_WIDTH
upsample_row OUTPTR, INPTR, WIDTH, TMP
subs MAX_V_SAMP_FACTOR, MAX_V_SAMP_FACTOR, #1
bgt 11b
99:
vpop {d8-d15}
pop {r4, r5, r6, pc}
.unreq MAX_V_SAMP_FACTOR
.unreq DOWNSAMPLED_WIDTH
.unreq INPUT_DATA
.unreq OUTPUT_DATA_PTR
.unreq OUTPUT_DATA
.unreq OUTPTR
.unreq INPTR
.unreq WIDTH
.unreq TMP
.endfunc
.purgem upsample16
.purgem upsample32
.purgem upsample_row

View File

@@ -41,7 +41,7 @@ init_simd (void)
{
char *env = NULL;
if (simd_support != ~0)
if (simd_support != ~0U)
return;
simd_support = jpeg_simd_cpu_support();
@@ -142,6 +142,7 @@ jsimd_rgb_ycc_convert (j_compress_ptr cinfo,
mmxfct=jsimd_extrgb_ycc_convert_mmx;
break;
case JCS_EXT_RGBX:
case JCS_EXT_RGBA:
sse2fct=jsimd_extrgbx_ycc_convert_sse2;
mmxfct=jsimd_extrgbx_ycc_convert_mmx;
break;
@@ -150,14 +151,17 @@ jsimd_rgb_ycc_convert (j_compress_ptr cinfo,
mmxfct=jsimd_extbgr_ycc_convert_mmx;
break;
case JCS_EXT_BGRX:
case JCS_EXT_BGRA:
sse2fct=jsimd_extbgrx_ycc_convert_sse2;
mmxfct=jsimd_extbgrx_ycc_convert_mmx;
break;
case JCS_EXT_XBGR:
case JCS_EXT_ABGR:
sse2fct=jsimd_extxbgr_ycc_convert_sse2;
mmxfct=jsimd_extxbgr_ycc_convert_mmx;
break;
case JCS_EXT_XRGB:
case JCS_EXT_ARGB:
sse2fct=jsimd_extxrgb_ycc_convert_sse2;
mmxfct=jsimd_extxrgb_ycc_convert_mmx;
break;
@@ -191,6 +195,7 @@ jsimd_rgb_gray_convert (j_compress_ptr cinfo,
mmxfct=jsimd_extrgb_gray_convert_mmx;
break;
case JCS_EXT_RGBX:
case JCS_EXT_RGBA:
sse2fct=jsimd_extrgbx_gray_convert_sse2;
mmxfct=jsimd_extrgbx_gray_convert_mmx;
break;
@@ -199,14 +204,17 @@ jsimd_rgb_gray_convert (j_compress_ptr cinfo,
mmxfct=jsimd_extbgr_gray_convert_mmx;
break;
case JCS_EXT_BGRX:
case JCS_EXT_BGRA:
sse2fct=jsimd_extbgrx_gray_convert_sse2;
mmxfct=jsimd_extbgrx_gray_convert_mmx;
break;
case JCS_EXT_XBGR:
case JCS_EXT_ABGR:
sse2fct=jsimd_extxbgr_gray_convert_sse2;
mmxfct=jsimd_extxbgr_gray_convert_mmx;
break;
case JCS_EXT_XRGB:
case JCS_EXT_ARGB:
sse2fct=jsimd_extxrgb_gray_convert_sse2;
mmxfct=jsimd_extxrgb_gray_convert_mmx;
break;
@@ -240,6 +248,7 @@ jsimd_ycc_rgb_convert (j_decompress_ptr cinfo,
mmxfct=jsimd_ycc_extrgb_convert_mmx;
break;
case JCS_EXT_RGBX:
case JCS_EXT_RGBA:
sse2fct=jsimd_ycc_extrgbx_convert_sse2;
mmxfct=jsimd_ycc_extrgbx_convert_mmx;
break;
@@ -248,14 +257,17 @@ jsimd_ycc_rgb_convert (j_decompress_ptr cinfo,
mmxfct=jsimd_ycc_extbgr_convert_mmx;
break;
case JCS_EXT_BGRX:
case JCS_EXT_BGRA:
sse2fct=jsimd_ycc_extbgrx_convert_sse2;
mmxfct=jsimd_ycc_extbgrx_convert_mmx;
break;
case JCS_EXT_XBGR:
case JCS_EXT_ABGR:
sse2fct=jsimd_ycc_extxbgr_convert_sse2;
mmxfct=jsimd_ycc_extxbgr_convert_mmx;
break;
case JCS_EXT_XRGB:
case JCS_EXT_ARGB:
sse2fct=jsimd_ycc_extxrgb_convert_sse2;
mmxfct=jsimd_ycc_extxrgb_convert_mmx;
break;
@@ -532,6 +544,7 @@ jsimd_h2v2_merged_upsample (j_decompress_ptr cinfo,
mmxfct=jsimd_h2v2_extrgb_merged_upsample_mmx;
break;
case JCS_EXT_RGBX:
case JCS_EXT_RGBA:
sse2fct=jsimd_h2v2_extrgbx_merged_upsample_sse2;
mmxfct=jsimd_h2v2_extrgbx_merged_upsample_mmx;
break;
@@ -540,14 +553,17 @@ jsimd_h2v2_merged_upsample (j_decompress_ptr cinfo,
mmxfct=jsimd_h2v2_extbgr_merged_upsample_mmx;
break;
case JCS_EXT_BGRX:
case JCS_EXT_BGRA:
sse2fct=jsimd_h2v2_extbgrx_merged_upsample_sse2;
mmxfct=jsimd_h2v2_extbgrx_merged_upsample_mmx;
break;
case JCS_EXT_XBGR:
case JCS_EXT_ABGR:
sse2fct=jsimd_h2v2_extxbgr_merged_upsample_sse2;
mmxfct=jsimd_h2v2_extxbgr_merged_upsample_mmx;
break;
case JCS_EXT_XRGB:
case JCS_EXT_ARGB:
sse2fct=jsimd_h2v2_extxrgb_merged_upsample_sse2;
mmxfct=jsimd_h2v2_extxrgb_merged_upsample_mmx;
break;
@@ -582,6 +598,7 @@ jsimd_h2v1_merged_upsample (j_decompress_ptr cinfo,
mmxfct=jsimd_h2v1_extrgb_merged_upsample_mmx;
break;
case JCS_EXT_RGBX:
case JCS_EXT_RGBA:
sse2fct=jsimd_h2v1_extrgbx_merged_upsample_sse2;
mmxfct=jsimd_h2v1_extrgbx_merged_upsample_mmx;
break;
@@ -590,14 +607,17 @@ jsimd_h2v1_merged_upsample (j_decompress_ptr cinfo,
mmxfct=jsimd_h2v1_extbgr_merged_upsample_mmx;
break;
case JCS_EXT_BGRX:
case JCS_EXT_BGRA:
sse2fct=jsimd_h2v1_extbgrx_merged_upsample_sse2;
mmxfct=jsimd_h2v1_extbgrx_merged_upsample_mmx;
break;
case JCS_EXT_XBGR:
case JCS_EXT_ABGR:
sse2fct=jsimd_h2v1_extxbgr_merged_upsample_sse2;
mmxfct=jsimd_h2v1_extxbgr_merged_upsample_mmx;
break;
case JCS_EXT_XRGB:
case JCS_EXT_ARGB:
sse2fct=jsimd_h2v1_extxrgb_merged_upsample_sse2;
mmxfct=jsimd_h2v1_extxrgb_merged_upsample_mmx;
break;

View File

@@ -93,18 +93,22 @@ jsimd_rgb_ycc_convert (j_compress_ptr cinfo,
sse2fct=jsimd_extrgb_ycc_convert_sse2;
break;
case JCS_EXT_RGBX:
case JCS_EXT_RGBA:
sse2fct=jsimd_extrgbx_ycc_convert_sse2;
break;
case JCS_EXT_BGR:
sse2fct=jsimd_extbgr_ycc_convert_sse2;
break;
case JCS_EXT_BGRX:
case JCS_EXT_BGRA:
sse2fct=jsimd_extbgrx_ycc_convert_sse2;
break;
case JCS_EXT_XBGR:
case JCS_EXT_ABGR:
sse2fct=jsimd_extxbgr_ycc_convert_sse2;
break;
case JCS_EXT_XRGB:
case JCS_EXT_ARGB:
sse2fct=jsimd_extxrgb_ycc_convert_sse2;
break;
default:
@@ -128,18 +132,22 @@ jsimd_rgb_gray_convert (j_compress_ptr cinfo,
sse2fct=jsimd_extrgb_gray_convert_sse2;
break;
case JCS_EXT_RGBX:
case JCS_EXT_RGBA:
sse2fct=jsimd_extrgbx_gray_convert_sse2;
break;
case JCS_EXT_BGR:
sse2fct=jsimd_extbgr_gray_convert_sse2;
break;
case JCS_EXT_BGRX:
case JCS_EXT_BGRA:
sse2fct=jsimd_extbgrx_gray_convert_sse2;
break;
case JCS_EXT_XBGR:
case JCS_EXT_ABGR:
sse2fct=jsimd_extxbgr_gray_convert_sse2;
break;
case JCS_EXT_XRGB:
case JCS_EXT_ARGB:
sse2fct=jsimd_extxrgb_gray_convert_sse2;
break;
default:
@@ -163,18 +171,22 @@ jsimd_ycc_rgb_convert (j_decompress_ptr cinfo,
sse2fct=jsimd_ycc_extrgb_convert_sse2;
break;
case JCS_EXT_RGBX:
case JCS_EXT_RGBA:
sse2fct=jsimd_ycc_extrgbx_convert_sse2;
break;
case JCS_EXT_BGR:
sse2fct=jsimd_ycc_extbgr_convert_sse2;
break;
case JCS_EXT_BGRX:
case JCS_EXT_BGRA:
sse2fct=jsimd_ycc_extbgrx_convert_sse2;
break;
case JCS_EXT_XBGR:
case JCS_EXT_ABGR:
sse2fct=jsimd_ycc_extxbgr_convert_sse2;
break;
case JCS_EXT_XRGB:
case JCS_EXT_ARGB:
sse2fct=jsimd_ycc_extxrgb_convert_sse2;
break;
default:
@@ -373,18 +385,22 @@ jsimd_h2v2_merged_upsample (j_decompress_ptr cinfo,
sse2fct=jsimd_h2v2_extrgb_merged_upsample_sse2;
break;
case JCS_EXT_RGBX:
case JCS_EXT_RGBA:
sse2fct=jsimd_h2v2_extrgbx_merged_upsample_sse2;
break;
case JCS_EXT_BGR:
sse2fct=jsimd_h2v2_extbgr_merged_upsample_sse2;
break;
case JCS_EXT_BGRX:
case JCS_EXT_BGRA:
sse2fct=jsimd_h2v2_extbgrx_merged_upsample_sse2;
break;
case JCS_EXT_XBGR:
case JCS_EXT_ABGR:
sse2fct=jsimd_h2v2_extxbgr_merged_upsample_sse2;
break;
case JCS_EXT_XRGB:
case JCS_EXT_ARGB:
sse2fct=jsimd_h2v2_extxrgb_merged_upsample_sse2;
break;
default:
@@ -409,18 +425,22 @@ jsimd_h2v1_merged_upsample (j_decompress_ptr cinfo,
sse2fct=jsimd_h2v1_extrgb_merged_upsample_sse2;
break;
case JCS_EXT_RGBX:
case JCS_EXT_RGBA:
sse2fct=jsimd_h2v1_extrgbx_merged_upsample_sse2;
break;
case JCS_EXT_BGR:
sse2fct=jsimd_h2v1_extbgr_merged_upsample_sse2;
break;
case JCS_EXT_BGRX:
case JCS_EXT_BGRA:
sse2fct=jsimd_h2v1_extbgrx_merged_upsample_sse2;
break;
case JCS_EXT_XBGR:
case JCS_EXT_ABGR:
sse2fct=jsimd_h2v1_extxbgr_merged_upsample_sse2;
break;
case JCS_EXT_XRGB:
case JCS_EXT_ARGB:
sse2fct=jsimd_h2v1_extxrgb_merged_upsample_sse2;
break;
default:

View File

@@ -15,54 +15,51 @@
#include "../jmorecfg.h"
#include "jsimd.h"
#define define(var) %define _cpp_protection_##var
#define definev(var) %define _cpp_protection_##var var
;
; -- jpeglib.h
;
definev(DCTSIZE)
definev(DCTSIZE2)
%define _cpp_protection_DCTSIZE DCTSIZE
%define _cpp_protection_DCTSIZE2 DCTSIZE2
;
; -- jmorecfg.h
;
definev(RGB_RED)
definev(RGB_GREEN)
definev(RGB_BLUE)
definev(RGB_PIXELSIZE)
%define _cpp_protection_RGB_RED RGB_RED
%define _cpp_protection_RGB_GREEN RGB_GREEN
%define _cpp_protection_RGB_BLUE RGB_BLUE
%define _cpp_protection_RGB_PIXELSIZE RGB_PIXELSIZE
definev(EXT_RGB_RED)
definev(EXT_RGB_GREEN)
definev(EXT_RGB_BLUE)
definev(EXT_RGB_PIXELSIZE)
%define _cpp_protection_EXT_RGB_RED EXT_RGB_RED
%define _cpp_protection_EXT_RGB_GREEN EXT_RGB_GREEN
%define _cpp_protection_EXT_RGB_BLUE EXT_RGB_BLUE
%define _cpp_protection_EXT_RGB_PIXELSIZE EXT_RGB_PIXELSIZE
definev(EXT_RGBX_RED)
definev(EXT_RGBX_GREEN)
definev(EXT_RGBX_BLUE)
definev(EXT_RGBX_PIXELSIZE)
%define _cpp_protection_EXT_RGBX_RED EXT_RGBX_RED
%define _cpp_protection_EXT_RGBX_GREEN EXT_RGBX_GREEN
%define _cpp_protection_EXT_RGBX_BLUE EXT_RGBX_BLUE
%define _cpp_protection_EXT_RGBX_PIXELSIZE EXT_RGBX_PIXELSIZE
definev(EXT_BGR_RED)
definev(EXT_BGR_GREEN)
definev(EXT_BGR_BLUE)
definev(EXT_BGR_PIXELSIZE)
%define _cpp_protection_EXT_BGR_RED EXT_BGR_RED
%define _cpp_protection_EXT_BGR_GREEN EXT_BGR_GREEN
%define _cpp_protection_EXT_BGR_BLUE EXT_BGR_BLUE
%define _cpp_protection_EXT_BGR_PIXELSIZE EXT_BGR_PIXELSIZE
definev(EXT_BGRX_RED)
definev(EXT_BGRX_GREEN)
definev(EXT_BGRX_BLUE)
definev(EXT_BGRX_PIXELSIZE)
%define _cpp_protection_EXT_BGRX_RED EXT_BGRX_RED
%define _cpp_protection_EXT_BGRX_GREEN EXT_BGRX_GREEN
%define _cpp_protection_EXT_BGRX_BLUE EXT_BGRX_BLUE
%define _cpp_protection_EXT_BGRX_PIXELSIZE EXT_BGRX_PIXELSIZE
definev(EXT_XBGR_RED)
definev(EXT_XBGR_GREEN)
definev(EXT_XBGR_BLUE)
definev(EXT_XBGR_PIXELSIZE)
%define _cpp_protection_EXT_XBGR_RED EXT_XBGR_RED
%define _cpp_protection_EXT_XBGR_GREEN EXT_XBGR_GREEN
%define _cpp_protection_EXT_XBGR_BLUE EXT_XBGR_BLUE
%define _cpp_protection_EXT_XBGR_PIXELSIZE EXT_XBGR_PIXELSIZE
definev(EXT_XRGB_RED)
definev(EXT_XRGB_GREEN)
definev(EXT_XRGB_BLUE)
definev(EXT_XRGB_PIXELSIZE)
%define _cpp_protection_EXT_XRGB_RED EXT_XRGB_RED
%define _cpp_protection_EXT_XRGB_GREEN EXT_XRGB_GREEN
%define _cpp_protection_EXT_XRGB_BLUE EXT_XRGB_BLUE
%define _cpp_protection_EXT_XRGB_PIXELSIZE EXT_XRGB_PIXELSIZE
%define RGBX_FILLER_0XFF 1
@@ -73,7 +70,7 @@ definev(EXT_XRGB_PIXELSIZE)
%define JSAMPLE byte ; unsigned char
%define SIZEOF_JSAMPLE SIZEOF_BYTE ; sizeof(JSAMPLE)
definev(CENTERJSAMPLE)
%define _cpp_protection_CENTERJSAMPLE CENTERJSAMPLE
; Representation of a DCT frequency coefficient.
; On this SIMD implementation, this must be 'short'.
@@ -126,74 +123,74 @@ definev(CENTERJSAMPLE)
; -- jsimd.h
;
definev(JSIMD_NONE)
definev(JSIMD_MMX)
definev(JSIMD_3DNOW)
definev(JSIMD_SSE)
definev(JSIMD_SSE2)
%define _cpp_protection_JSIMD_NONE JSIMD_NONE
%define _cpp_protection_JSIMD_MMX JSIMD_MMX
%define _cpp_protection_JSIMD_3DNOW JSIMD_3DNOW
%define _cpp_protection_JSIMD_SSE JSIMD_SSE
%define _cpp_protection_JSIMD_SSE2 JSIMD_SSE2
; Short forms of external names for systems with brain-damaged linkers.
;
#ifdef NEED_SHORT_EXTERNAL_NAMES
definev(jpeg_simd_cpu_support)
definev(jsimd_rgb_ycc_convert_mmx)
definev(jsimd_ycc_rgb_convert_mmx)
definev(jconst_rgb_ycc_convert_sse2)
definev(jsimd_rgb_ycc_convert_sse2)
definev(jconst_ycc_rgb_convert_sse2)
definev(jsimd_ycc_rgb_convert_sse2)
definev(jsimd_h2v2_downsample_mmx)
definev(jsimd_h2v1_downsample_mmx)
definev(jsimd_h2v2_downsample_sse2)
definev(jsimd_h2v1_downsample_sse2)
definev(jsimd_h2v2_upsample_mmx)
definev(jsimd_h2v1_upsample_mmx)
definev(jsimd_h2v1_fancy_upsample_mmx)
definev(jsimd_h2v2_fancy_upsample_mmx)
definev(jsimd_h2v1_merged_upsample_mmx)
definev(jsimd_h2v2_merged_upsample_mmx)
definev(jsimd_h2v2_upsample_sse2)
definev(jsimd_h2v1_upsample_sse2)
definev(jconst_fancy_upsample_sse2)
definev(jsimd_h2v1_fancy_upsample_sse2)
definev(jsimd_h2v2_fancy_upsample_sse2)
definev(jconst_merged_upsample_sse2)
definev(jsimd_h2v1_merged_upsample_sse2)
definev(jsimd_h2v2_merged_upsample_sse2)
definev(jsimd_convsamp_mmx)
definev(jsimd_convsamp_sse2)
definev(jsimd_convsamp_float_3dnow)
definev(jsimd_convsamp_float_sse)
definev(jsimd_convsamp_float_sse2)
definev(jsimd_fdct_islow_mmx)
definev(jsimd_fdct_ifast_mmx)
definev(jconst_fdct_islow_sse2)
definev(jsimd_fdct_islow_sse2)
definev(jconst_fdct_ifast_sse2)
definev(jsimd_fdct_ifast_sse2)
definev(jsimd_fdct_float_3dnow)
definev(jconst_fdct_float_sse)
definev(jsimd_fdct_float_sse)
definev(jsimd_quantize_mmx)
definev(jsimd_quantize_sse2)
definev(jsimd_quantize_float_3dnow)
definev(jsimd_quantize_float_sse)
definev(jsimd_quantize_float_sse2)
definev(jsimd_idct_2x2_mmx)
definev(jsimd_idct_4x4_mmx)
definev(jconst_idct_red_sse2)
definev(jsimd_idct_2x2_sse2)
definev(jsimd_idct_4x4_sse2)
definev(jsimd_idct_islow_mmx)
definev(jsimd_idct_ifast_mmx)
definev(jconst_idct_islow_sse2)
definev(jsimd_idct_islow_sse2)
definev(jconst_idct_ifast_sse2)
definev(jsimd_idct_ifast_sse2)
definev(jsimd_idct_float_3dnow)
definev(jconst_idct_float_sse)
definev(jsimd_idct_float_sse)
definev(jconst_idct_float_sse2)
definev(jsimd_idct_float_sse2)
%define _cpp_protection_jpeg_simd_cpu_support jpeg_simd_cpu_support
%define _cpp_protection_jsimd_rgb_ycc_convert_mmx jsimd_rgb_ycc_convert_mmx
%define _cpp_protection_jsimd_ycc_rgb_convert_mmx jsimd_ycc_rgb_convert_mmx
%define _cpp_protection_jconst_rgb_ycc_convert_sse2 jconst_rgb_ycc_convert_sse2
%define _cpp_protection_jsimd_rgb_ycc_convert_sse2 jsimd_rgb_ycc_convert_sse2
%define _cpp_protection_jconst_ycc_rgb_convert_sse2 jconst_ycc_rgb_convert_sse2
%define _cpp_protection_jsimd_ycc_rgb_convert_sse2 jsimd_ycc_rgb_convert_sse2
%define _cpp_protection_jsimd_h2v2_downsample_mmx jsimd_h2v2_downsample_mmx
%define _cpp_protection_jsimd_h2v1_downsample_mmx jsimd_h2v1_downsample_mmx
%define _cpp_protection_jsimd_h2v2_downsample_sse2 jsimd_h2v2_downsample_sse2
%define _cpp_protection_jsimd_h2v1_downsample_sse2 jsimd_h2v1_downsample_sse2
%define _cpp_protection_jsimd_h2v2_upsample_mmx jsimd_h2v2_upsample_mmx
%define _cpp_protection_jsimd_h2v1_upsample_mmx jsimd_h2v1_upsample_mmx
%define _cpp_protection_jsimd_h2v1_fancy_upsample_mmx jsimd_h2v1_fancy_upsample_mmx
%define _cpp_protection_jsimd_h2v2_fancy_upsample_mmx jsimd_h2v2_fancy_upsample_mmx
%define _cpp_protection_jsimd_h2v1_merged_upsample_mmx jsimd_h2v1_merged_upsample_mmx
%define _cpp_protection_jsimd_h2v2_merged_upsample_mmx jsimd_h2v2_merged_upsample_mmx
%define _cpp_protection_jsimd_h2v2_upsample_sse2 jsimd_h2v2_upsample_sse2
%define _cpp_protection_jsimd_h2v1_upsample_sse2 jsimd_h2v1_upsample_sse2
%define _cpp_protection_jconst_fancy_upsample_sse2 jconst_fancy_upsample_sse2
%define _cpp_protection_jsimd_h2v1_fancy_upsample_sse2 jsimd_h2v1_fancy_upsample_sse2
%define _cpp_protection_jsimd_h2v2_fancy_upsample_sse2 jsimd_h2v2_fancy_upsample_sse2
%define _cpp_protection_jconst_merged_upsample_sse2 jconst_merged_upsample_sse2
%define _cpp_protection_jsimd_h2v1_merged_upsample_sse2 jsimd_h2v1_merged_upsample_sse2
%define _cpp_protection_jsimd_h2v2_merged_upsample_sse2 jsimd_h2v2_merged_upsample_sse2
%define _cpp_protection_jsimd_convsamp_mmx jsimd_convsamp_mmx
%define _cpp_protection_jsimd_convsamp_sse2 jsimd_convsamp_sse2
%define _cpp_protection_jsimd_convsamp_float_3dnow jsimd_convsamp_float_3dnow
%define _cpp_protection_jsimd_convsamp_float_sse jsimd_convsamp_float_sse
%define _cpp_protection_jsimd_convsamp_float_sse2 jsimd_convsamp_float_sse2
%define _cpp_protection_jsimd_fdct_islow_mmx jsimd_fdct_islow_mmx
%define _cpp_protection_jsimd_fdct_ifast_mmx jsimd_fdct_ifast_mmx
%define _cpp_protection_jconst_fdct_islow_sse2 jconst_fdct_islow_sse2
%define _cpp_protection_jsimd_fdct_islow_sse2 jsimd_fdct_islow_sse2
%define _cpp_protection_jconst_fdct_ifast_sse2 jconst_fdct_ifast_sse2
%define _cpp_protection_jsimd_fdct_ifast_sse2 jsimd_fdct_ifast_sse2
%define _cpp_protection_jsimd_fdct_float_3dnow jsimd_fdct_float_3dnow
%define _cpp_protection_jconst_fdct_float_sse jconst_fdct_float_sse
%define _cpp_protection_jsimd_fdct_float_sse jsimd_fdct_float_sse
%define _cpp_protection_jsimd_quantize_mmx jsimd_quantize_mmx
%define _cpp_protection_jsimd_quantize_sse2 jsimd_quantize_sse2
%define _cpp_protection_jsimd_quantize_float_3dnow jsimd_quantize_float_3dnow
%define _cpp_protection_jsimd_quantize_float_sse jsimd_quantize_float_sse
%define _cpp_protection_jsimd_quantize_float_sse2 jsimd_quantize_float_sse2
%define _cpp_protection_jsimd_idct_2x2_mmx jsimd_idct_2x2_mmx
%define _cpp_protection_jsimd_idct_4x4_mmx jsimd_idct_4x4_mmx
%define _cpp_protection_jconst_idct_red_sse2 jconst_idct_red_sse2
%define _cpp_protection_jsimd_idct_2x2_sse2 jsimd_idct_2x2_sse2
%define _cpp_protection_jsimd_idct_4x4_sse2 jsimd_idct_4x4_sse2
%define _cpp_protection_jsimd_idct_islow_mmx jsimd_idct_islow_mmx
%define _cpp_protection_jsimd_idct_ifast_mmx jsimd_idct_ifast_mmx
%define _cpp_protection_jconst_idct_islow_sse2 jconst_idct_islow_sse2
%define _cpp_protection_jsimd_idct_islow_sse2 jsimd_idct_islow_sse2
%define _cpp_protection_jconst_idct_ifast_sse2 jconst_idct_ifast_sse2
%define _cpp_protection_jsimd_idct_ifast_sse2 jsimd_idct_ifast_sse2
%define _cpp_protection_jsimd_idct_float_3dnow jsimd_idct_float_3dnow
%define _cpp_protection_jconst_idct_float_sse jconst_idct_float_sse
%define _cpp_protection_jsimd_idct_float_sse jsimd_idct_float_sse
%define _cpp_protection_jconst_idct_float_sse2 jconst_idct_float_sse2
%define _cpp_protection_jsimd_idct_float_sse2 jsimd_idct_float_sse2
#endif /* NEED_SHORT_EXTERNAL_NAMES */

View File

@@ -320,15 +320,15 @@ const_base:
push rsi
push rdi
sub rsp, SIZEOF_XMMWORD
movlpd XMMWORD [rsp], xmm6
movaps XMMWORD [rsp], xmm6
sub rsp, SIZEOF_XMMWORD
movlpd XMMWORD [rsp], xmm7
movaps XMMWORD [rsp], xmm7
%endmacro
%imacro uncollect_args 0
movlpd xmm7, XMMWORD [rsp]
movaps xmm7, XMMWORD [rsp]
add rsp, SIZEOF_XMMWORD
movlpd xmm6, XMMWORD [rsp]
movaps xmm6, XMMWORD [rsp]
add rsp, SIZEOF_XMMWORD
pop rdi
pop rsi

View File

@@ -1,6 +1,6 @@
IJG JPEG LIBRARY: SYSTEM ARCHITECTURE
Copyright (C) 1991-2009, Thomas G. Lane, Guido Vollbeding.
Copyright (C) 1991-2012, Thomas G. Lane, Guido Vollbeding.
This file is part of the Independent JPEG Group's software.
For conditions of distribution and use, see the accompanying README file.
@@ -385,8 +385,9 @@ objects:
* Data destination manager: writes the output JPEG datastream to its final
destination (e.g., a file). The destination manager supplied with the
library knows how to write to a stdio stream; for other behaviors, the
surrounding application may provide its own destination manager.
library knows how to write to a stdio stream or to a memory buffer;
for other behaviors, the surrounding application may provide its own
destination manager.
* Memory manager: allocates and releases memory, controls virtual arrays
(with backing store management, where required).
@@ -504,9 +505,9 @@ objects:
* Marker reading: decodes JPEG markers (except for RSTn).
* Data source manager: supplies the input JPEG datastream. The source
manager supplied with the library knows how to read from a stdio stream;
for other behaviors, the surrounding application may provide its own source
manager.
manager supplied with the library knows how to read from a stdio stream
or from a memory buffer; for other behaviors, the surrounding application
may provide its own source manager.
* Memory manager: same as for compression library.
@@ -586,8 +587,7 @@ as "((value) & 0xFF)" on signed-char machines and "((int) (value))" elsewhere.
With these conventions, JSAMPLE values can be assumed to be >= 0. This helps
simplify correct rounding during downsampling, etc. The JPEG standard's
specification that sample values run from -128..127 is accommodated by
subtracting 128 just as the sample value is copied into the source array for
the DCT step (this will be an array of signed ints). Similarly, during
subtracting 128 from the sample value in the DCT step. Similarly, during
decompression the output of the IDCT step will be immediately shifted back to
0..255. (NB: different values are required when 12-bit samples are in use.
The code is written in terms of MAXJSAMPLE and CENTERJSAMPLE, which will be

Binary file not shown.

After

Width:  |  Height:  |  Size: 81 KiB

View File

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 34 KiB

View File

Before

Width:  |  Height:  |  Size: 5.0 KiB

After

Width:  |  Height:  |  Size: 5.0 KiB

View File

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

View File

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

Some files were not shown because too many files have changed in this diff Show More