Compare commits
310 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e5c1613ccd | ||
|
|
b0971e47d7 | ||
|
|
e248d430e2 | ||
|
|
acb634931a | ||
|
|
1db1ce45da | ||
|
|
d0c3aa900b | ||
|
|
6a2b067428 | ||
|
|
11eec4a398 | ||
|
|
301ba4f305 | ||
|
|
70f236ddd7 | ||
|
|
2a4f189444 | ||
|
|
9d64f3c60b | ||
|
|
da2a27ef05 | ||
|
|
c082dc039d | ||
|
|
d4c41fe0da | ||
|
|
a0b7de9a47 | ||
|
|
2252795571 | ||
|
|
eb38b61bfe | ||
|
|
47b29e8cd9 | ||
|
|
e1e816e665 | ||
|
|
6441018150 | ||
|
|
fcfc6c5eed | ||
|
|
786b649331 | ||
|
|
f4ba09b33a | ||
|
|
0f4fcced0a | ||
|
|
82bf7f5858 | ||
|
|
3582ce90bb | ||
|
|
d6d7b53968 | ||
|
|
f9f0c75bb8 | ||
|
|
3da94de248 | ||
|
|
ab664e35fc | ||
|
|
ce26e83f47 | ||
|
|
74e4c793cd | ||
|
|
a280fa630c | ||
|
|
6aae007745 | ||
|
|
4ad94b2963 | ||
|
|
2d4b2f14d0 | ||
|
|
9366cf0bca | ||
|
|
13e6b151b0 | ||
|
|
1ee329d617 | ||
|
|
b47c5e737f | ||
|
|
ce262eb5d7 | ||
|
|
27f817cd11 | ||
|
|
0df2e2188b | ||
|
|
6d22430a3a | ||
|
|
e9e3a2edd7 | ||
|
|
211c69f317 | ||
|
|
1625253d49 | ||
|
|
a0047bdea4 | ||
|
|
7bfb22af12 | ||
|
|
ac4a899511 | ||
|
|
dfefba7752 | ||
|
|
4cf67f2363 | ||
|
|
9407cf7f47 | ||
|
|
cb88e5da80 | ||
|
|
e9d9c31fd2 | ||
|
|
077e5bb4e0 | ||
|
|
a1dd35680d | ||
|
|
a09ba29a55 | ||
|
|
8ce2c9119a | ||
|
|
db04435165 | ||
|
|
7723d7f7d0 | ||
|
|
628c168c86 | ||
|
|
1120ff29a1 | ||
|
|
1945ad961b | ||
|
|
6e9d43e085 | ||
|
|
9055fb408d | ||
|
|
9e6c6a14f8 | ||
|
|
3ff13e651b | ||
|
|
1d50a8cd08 | ||
|
|
123f7258a8 | ||
|
|
e5091f2cf3 | ||
|
|
8f1c0a681c | ||
|
|
68cf83db56 | ||
|
|
f06cc1200f | ||
|
|
5c064de10d | ||
|
|
2e480fa2a3 | ||
|
|
5e576386b5 | ||
|
|
0d61e80ab0 | ||
|
|
ee681aa304 | ||
|
|
346837cad3 | ||
|
|
eb7962a02b | ||
|
|
3c67d4f7c0 | ||
|
|
1959e28b49 | ||
|
|
dec79952d6 | ||
|
|
2628c562bc | ||
|
|
28d1a1300c | ||
|
|
1a3aebd88e | ||
|
|
1e81b0c3ea | ||
|
|
b2817f5251 | ||
|
|
6f241d4d42 | ||
|
|
1385f8b281 | ||
|
|
742fb37dde | ||
|
|
a839a7a964 | ||
|
|
3f56bd597c | ||
|
|
e5f280c4c4 | ||
|
|
4f58123130 | ||
|
|
622d6678a8 | ||
|
|
b3247c7d71 | ||
|
|
a572622dd6 | ||
|
|
7cb8de4ae0 | ||
|
|
056536f660 | ||
|
|
7c202f76e7 | ||
|
|
fa722636be | ||
|
|
2354810a43 | ||
|
|
45c1e3a887 | ||
|
|
f57bae0ddd | ||
|
|
025c1f66de | ||
|
|
3ab68cf563 | ||
|
|
5f972324ee | ||
|
|
f76c01d0bd | ||
|
|
d4be42360c | ||
|
|
e621dfc508 | ||
|
|
9100b67a75 | ||
|
|
bd49803f92 | ||
|
|
ae41128845 | ||
|
|
54e6b8e806 | ||
|
|
83aeb7b28c | ||
|
|
a560e4b423 | ||
|
|
fc11193e7a | ||
|
|
e7f88aec23 | ||
|
|
aefd8b7942 | ||
|
|
18dcac4632 | ||
|
|
03841e6e89 | ||
|
|
d123c125c5 | ||
|
|
8632f1b262 | ||
|
|
bba7978981 | ||
|
|
28f00bf235 | ||
|
|
ab80273b61 | ||
|
|
53c635b8e8 | ||
|
|
46ecffa324 | ||
|
|
219470d6ac | ||
|
|
15aaa7f7e2 | ||
|
|
45bbe06ec5 | ||
|
|
2d62325754 | ||
|
|
f9134384b7 | ||
|
|
ce0dd949b2 | ||
|
|
8ff67fdb24 | ||
|
|
55a18d4007 | ||
|
|
2d56acb840 | ||
|
|
c454c595dc | ||
|
|
0463f7c9aa | ||
|
|
04dd34c14e | ||
|
|
3ee3d8799a | ||
|
|
6c8a71efa7 | ||
|
|
271b0bf033 | ||
|
|
6e053525ee | ||
|
|
fe11699d90 | ||
|
|
cf888486d1 | ||
|
|
cb49bb00d9 | ||
|
|
cbfa696fc1 | ||
|
|
f5cd71c5cf | ||
|
|
da047e8b14 | ||
|
|
6c3fc97b1a | ||
|
|
3128061382 | ||
|
|
8af3f8a9cb | ||
|
|
d38b4f21ec | ||
|
|
e8aa5fa934 | ||
|
|
ec6941f7bc | ||
|
|
499c470b63 | ||
|
|
9c8cee8c29 | ||
|
|
4e356a92dc | ||
|
|
93eaa37a3b | ||
|
|
f3a8684cd1 | ||
|
|
eb59b6e72d | ||
|
|
368cd52d38 | ||
|
|
e7f1418525 | ||
|
|
2111c5acda | ||
|
|
5a3b4fed4b | ||
|
|
5f2cbbd039 | ||
|
|
fbe5007fbc | ||
|
|
71e971fb35 | ||
|
|
6fa5ebdc10 | ||
|
|
d70a5c12fc | ||
|
|
aa769febf2 | ||
|
|
d65e768b2e | ||
|
|
1e32fe3113 | ||
|
|
250c887763 | ||
|
|
e42032ba62 | ||
|
|
17de518357 | ||
|
|
7e3acc0e0a | ||
|
|
ac85335cd8 | ||
|
|
bf04316e63 | ||
|
|
d8da49effe | ||
|
|
30ebafda2a | ||
|
|
60efb896e0 | ||
|
|
8e9cef2e6f | ||
|
|
870b4f28b4 | ||
|
|
b961f0bfce | ||
|
|
54792ba340 | ||
|
|
498d9bc92f | ||
|
|
b4922b42e7 | ||
|
|
465a9fe0cb | ||
|
|
00d82c425e | ||
|
|
b5a55e6dd7 | ||
|
|
f62dbccf5f | ||
|
|
b657631953 | ||
|
|
58ae401e50 | ||
|
|
333f3cf756 | ||
|
|
73befdb148 | ||
|
|
6709e4a0cf | ||
|
|
82923eb93a | ||
|
|
a3ef34c626 | ||
|
|
6fa14b37ee | ||
|
|
ce4ff407ff | ||
|
|
b1682fb7c8 | ||
|
|
b2db23c449 | ||
|
|
7222ec2717 | ||
|
|
8fb37b8171 | ||
|
|
b3b3b29e4c | ||
|
|
7170d9e0e5 | ||
|
|
57e206662a | ||
|
|
939e466082 | ||
|
|
7c726a4515 | ||
|
|
a61fd32137 | ||
|
|
944aa8e3c4 | ||
|
|
2a0b4ac337 | ||
|
|
cf0e58de53 | ||
|
|
b6590d67b3 | ||
|
|
22eb6c2bf3 | ||
|
|
9a2a42d8ee | ||
|
|
8c4c6d29e6 | ||
|
|
9993410e44 | ||
|
|
b3b9a213bf | ||
|
|
9bbf2b8551 | ||
|
|
45a2369b44 | ||
|
|
99f0289606 | ||
|
|
03e755bbd3 | ||
|
|
74b9f609a2 | ||
|
|
739edeb8a6 | ||
|
|
a3deac158b | ||
|
|
10dc5cfeff | ||
|
|
b3817dab86 | ||
|
|
1a4778f8f0 | ||
|
|
c23e36e800 | ||
|
|
65c5ec2f0f | ||
|
|
9cc597221e | ||
|
|
6ed4d9d110 | ||
|
|
306e1d2d77 | ||
|
|
162c9985d6 | ||
|
|
7a7da9460a | ||
|
|
ac09954b1d | ||
|
|
6a25894472 | ||
|
|
ecc583682a | ||
|
|
07afe8a50f | ||
|
|
eb32cc1e6d | ||
|
|
691cd93383 | ||
|
|
54014d9c2a | ||
|
|
06bf10d19e | ||
|
|
89b5e06df5 | ||
|
|
eea6424596 | ||
|
|
7a8c53e4bd | ||
|
|
771ab19437 | ||
|
|
3f7608348d | ||
|
|
2e429094a4 | ||
|
|
2e2ea8e02c | ||
|
|
246b01bb0a | ||
|
|
c4e3c361d7 | ||
|
|
2ab5ea6c48 | ||
|
|
c641cddb80 | ||
|
|
86af36aebc | ||
|
|
11c4010c3c | ||
|
|
2517ef72ed | ||
|
|
9ab2c1071b | ||
|
|
cbcb53617b | ||
|
|
ada430bb3d | ||
|
|
406bb01ca2 | ||
|
|
a6a24c270e | ||
|
|
52a4ec6c8a | ||
|
|
cf78941db4 | ||
|
|
51eba06011 | ||
|
|
d71a6e0c25 | ||
|
|
f0abd46c3b | ||
|
|
ac4daa7716 | ||
|
|
af69295d3f | ||
|
|
6aed11293d | ||
|
|
a5005751a3 | ||
|
|
25347882ed | ||
|
|
8de75d0f57 | ||
|
|
22048207ea | ||
|
|
2b223a034b | ||
|
|
577ecd93f1 | ||
|
|
ff30c63934 | ||
|
|
45453085e7 | ||
|
|
b1fec4ff98 | ||
|
|
5976e42550 | ||
|
|
62bae204f4 | ||
|
|
8163aad6cc | ||
|
|
99f125ec07 | ||
|
|
13af139624 | ||
|
|
87fd253bd0 | ||
|
|
bf8a5feb79 | ||
|
|
535674b1b8 | ||
|
|
c9da78525b | ||
|
|
0691162a8b | ||
|
|
9cb418d221 | ||
|
|
935d1d6398 | ||
|
|
86ae5913b1 | ||
|
|
6cb7f40a18 | ||
|
|
040435afb9 | ||
|
|
fb0c394037 | ||
|
|
e1ac40104c | ||
|
|
1e2f49619e | ||
|
|
bb383b4175 | ||
|
|
ef263e3e83 | ||
|
|
0426cd3441 | ||
|
|
7affbfc241 | ||
|
|
cd2d8e1cc7 | ||
|
|
f72f1f2e94 | ||
|
|
c0a8256a92 |
14
.gitignore
vendored
Normal file
14
.gitignore
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
.DS_Store
|
||||
Makefile.in
|
||||
aclocal.m4
|
||||
ar-lib
|
||||
autom4te.cache
|
||||
compile
|
||||
config.guess
|
||||
config.h.in
|
||||
config.sub
|
||||
configure
|
||||
depcomp
|
||||
install-sh
|
||||
ltmain.sh
|
||||
missing
|
||||
129
.travis.yml
Normal file
129
.travis.yml
Normal file
@@ -0,0 +1,129 @@
|
||||
language: c
|
||||
|
||||
matrix:
|
||||
include:
|
||||
- os: linux
|
||||
env: BUILD_OFFICIAL=1
|
||||
sudo: required
|
||||
services:
|
||||
- docker
|
||||
- os: osx
|
||||
env: BUILD_OFFICIAL=1
|
||||
osx_image: xcode7.3
|
||||
- os: linux
|
||||
compiler: clang
|
||||
env:
|
||||
CFLAGS="-O1 -g -fsanitize=address -fno-omit-frame-pointer"
|
||||
CONFIGURE_FLAGS="--disable-shared"
|
||||
ASAN_OPTIONS="detect_leaks=1 symbolize=1"
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- nasm
|
||||
- os: linux
|
||||
compiler: gcc
|
||||
env: CONFIGURE_FLAGS="--with-12bit"
|
||||
- os: linux
|
||||
compiler: gcc
|
||||
env: CONFIGURE_FLAGS="--with-jpeg7"
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- nasm
|
||||
- os: linux
|
||||
compiler: gcc
|
||||
env: CONFIGURE_FLAGS="--with-jpeg8"
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- nasm
|
||||
- os: linux
|
||||
compiler: gcc
|
||||
env: CONFIGURE_FLAGS="--without-simd"
|
||||
|
||||
before_install:
|
||||
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then
|
||||
brew install nasm homebrew/versions/gcc5 md5sha1sum Caskroom/versions/java6 &&
|
||||
ln -fs /usr/local/bin/gpg1 /usr/local/bin/gpg &&
|
||||
git clone --depth=1 https://github.com/libjpeg-turbo/gas-preprocessor.git ~/src/gas-preprocessor &&
|
||||
ln -fs /Applications/Xcode.app /Applications/Xcode72.app;
|
||||
fi
|
||||
- if [ "${BUILD_OFFICIAL:-}" != "" ]; then
|
||||
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
|
||||
docker pull dcommander/buildljt;
|
||||
fi &&
|
||||
git clone --depth=1 https://github.com/libjpeg-turbo/buildscripts.git -b $TRAVIS_BRANCH ~/src/buildscripts &&
|
||||
openssl aes-256-cbc -K $encrypted_f92e8533f6f1_key -iv $encrypted_f92e8533f6f1_iv -in ci/keys.enc -out ci/keys -d &&
|
||||
tar xf ci/keys &&
|
||||
rm ci/keys &&
|
||||
mv ci/gpgsign ~/src/buildscripts &&
|
||||
gpg --import ci/sign_ljt &&
|
||||
rm ci/sign_ljt;
|
||||
fi
|
||||
|
||||
script:
|
||||
- if [ "${BUILD_OFFICIAL:-}" != "" ]; then
|
||||
mkdir -p ~/src/ljt.nightly &&
|
||||
if [ -f .git/shallow ]; then
|
||||
mv .git/shallow .git/shallow.bak;
|
||||
fi &&
|
||||
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
|
||||
docker run -v $HOME/src/ljt.nightly:/root/src/ljt.nightly -v $HOME/src/buildscripts:/root/src/buildscripts -v $TRAVIS_BUILD_DIR:/root/src/libjpeg-turbo -v $HOME/.gnupg:/root/.gnupg -t dcommander/buildljt:latest bash -c "rpm --import http://pgp.mit.edu/pks/lookup?op=get\&search=0x0575F26BD5B3FDB1 && ~/src/buildscripts/buildljt -r file:///root/src/libjpeg-turbo $TRAVIS_BRANCH -v" &&
|
||||
sudo chown -R travis:travis ~/src/ljt.nightly &&
|
||||
mv ~/src/ljt.nightly/latest/log-$TRAVIS_OS_NAME.txt ~/src/ljt.nightly/latest/files/;
|
||||
else
|
||||
PATH=$PATH:~/src/gas-preprocessor ~/src/buildscripts/buildljt -r file://$TRAVIS_BUILD_DIR $TRAVIS_BRANCH -v &&
|
||||
mv ~/src/ljt.nightly/latest/log-$TRAVIS_OS_NAME.txt ~/src/ljt.nightly/latest/files/;
|
||||
fi &&
|
||||
if [ -f .git/shallow.bak ]; then
|
||||
mv .git/shallow.bak .git/shallow;
|
||||
fi
|
||||
fi
|
||||
- if [ "${BUILD_OFFICIAL:-}" == "" ]; then
|
||||
autoreconf -fiv &&
|
||||
mkdir build &&
|
||||
pushd build &&
|
||||
../configure ${CONFIGURE_FLAGS} &&
|
||||
make -j &&
|
||||
if [[ "${CONFIGURE_FLAGS}" =~ "with-12bit" ||
|
||||
"${CONFIGURE_FLAGS}" =~ "without-simd" ]]; then
|
||||
make test FLOATTEST=32bit;
|
||||
else
|
||||
make test FLOATTEST=sse &&
|
||||
JSIMD_FORCENONE=1 make test FLOATTEST=32bit;
|
||||
fi &&
|
||||
popd;
|
||||
fi
|
||||
|
||||
after_failure:
|
||||
- if [ "${BUILD_OFFICIAL:-}" == "" ]; then
|
||||
if [ -f $TRAVIS_BUILD_DIR/build/config.log ]; then
|
||||
cat $TRAVIS_BUILD_DIR/build/config.log;
|
||||
fi
|
||||
fi
|
||||
|
||||
deploy:
|
||||
- provider: s3
|
||||
bucket: libjpeg-turbo-pr
|
||||
access_key_id:
|
||||
secure: bmFEt4H90/oR/LiN9XI+G26Pd6hiyrTw3+Vg3lS4ynwAYk33weApaVM8CyzQTgIhGSPzFStqVm9fTrb3RmrYP/PnNS+/surOeWLkH2DMRxvc0qmetBuNx1+vAN7FUkY8MO/u5uE9WXHAdp4e64pXcLXEbKmh+wgDm72b35WmMxErtHsGbpqy+j47rQkY4BJGi7XQzjjafaamfm4PzitsjkYYsgX8KLI16jyJEIirvyDHCPTn9wKR/jSjelDl+xTlgZGuCqmLCBW8f6JgycIspWjcYfO4WpWvkbnnI2sl3rCMPvOYc4wHe8SwzG0l4tM1PblZZDRcU7vjE15PmNf1Xfq9Vx3RpgBJv+UBNL/Vn0rKdpUCeEcfC12hxrske8DWpV6waBiDivjQJreE+YRXqa5YBhV/EdkoKYCqafnJvRASlOko9evje8F9KXTNsIGTT1HPmU9QM9WoJwLs/Xa3t09EmA2IjhcuAvvUmwCTuBBQVAlDjExiTT3Zhc9IYZDD92JgpAYLgridtzR87ElOxKhTkR4PowdI6UiLYArPjMFTjoz5Rivb9qNpbLaQC8HCYgLWxpWtUTzlW/9rM8izHpF8ySFHjO6E2aA9OJFc0tcbEGwAs2jLGD01OduU+DbBfsIkW0EgfXCPbD3FVgHsn3tkuzgO/bg20SM7uuCEYKQ=
|
||||
secret_access_key:
|
||||
secure: mrkOpEtqd2dEmi/qNJyX9vkME+6xgVBnXaRETKF7jT+flcQCQ0ayQkRkMV7lzGqq44XFg+n6Cpfn6oW0gH9RNdcC8YQvFP+kgzPx6nw6V/M31Vz6ySapJf59HBzVevf0NJkr0/1JoWsp1iq4IoN10WPzsCXZB55Io3Cf7DgpR+yiyBlWOctDfNdjJ97Juw3ENE80MHDf0fVqdUOIknQka1p68yAGkjar9kc2Oe7o94RzzmoqEn8tuFumiBQjIcuVRALsKqz+eIxBNgkL3BF9shVyRjOWLAeBhMPVFxZs5Dgd4ECbvU0i33gfmje3d6qqcw78N2lZaLefoVvWol3pOzVO133ewOSY9/lmpqEiRUU2ohEe8T4aSoS7posBW42itUTO4Y5w+eVOnHsm4sRQaI+/AXWTe7GPel+P8Qbe8Ya10A5gnpoag7o3raRDcHx+/qaZw1Af/u4XiAOYz3be3U90Qc+YMc/kS5i8BH0GXBbSfaWQ00CwRFlZQ3n1xUqmjC2CmjZTki3W/p7mEt0DjhcH9ZIXscK603sCC+mF6pEd9019k5fG/8fr2Y4Ptai9kd3BxZJCX9/jSoMfWOBbgkA5bRgHU0xrAj+p49qD6Ej9Xr8GE3+uebz3sEuhSFRnCKwKoOHOemfgevfO2y/jQXP677WPf3xQX7bVDfTFSHU=
|
||||
acl: public_read
|
||||
local-dir: $HOME/src/ljt.nightly/latest/files
|
||||
upload-dir: $TRAVIS_BRANCH/$TRAVIS_OS_NAME
|
||||
on:
|
||||
branch: master
|
||||
condition: -n "$BUILD_OFFICIAL"
|
||||
- provider: s3
|
||||
bucket: libjpeg-turbo-pr
|
||||
access_key_id:
|
||||
secure: bmFEt4H90/oR/LiN9XI+G26Pd6hiyrTw3+Vg3lS4ynwAYk33weApaVM8CyzQTgIhGSPzFStqVm9fTrb3RmrYP/PnNS+/surOeWLkH2DMRxvc0qmetBuNx1+vAN7FUkY8MO/u5uE9WXHAdp4e64pXcLXEbKmh+wgDm72b35WmMxErtHsGbpqy+j47rQkY4BJGi7XQzjjafaamfm4PzitsjkYYsgX8KLI16jyJEIirvyDHCPTn9wKR/jSjelDl+xTlgZGuCqmLCBW8f6JgycIspWjcYfO4WpWvkbnnI2sl3rCMPvOYc4wHe8SwzG0l4tM1PblZZDRcU7vjE15PmNf1Xfq9Vx3RpgBJv+UBNL/Vn0rKdpUCeEcfC12hxrske8DWpV6waBiDivjQJreE+YRXqa5YBhV/EdkoKYCqafnJvRASlOko9evje8F9KXTNsIGTT1HPmU9QM9WoJwLs/Xa3t09EmA2IjhcuAvvUmwCTuBBQVAlDjExiTT3Zhc9IYZDD92JgpAYLgridtzR87ElOxKhTkR4PowdI6UiLYArPjMFTjoz5Rivb9qNpbLaQC8HCYgLWxpWtUTzlW/9rM8izHpF8ySFHjO6E2aA9OJFc0tcbEGwAs2jLGD01OduU+DbBfsIkW0EgfXCPbD3FVgHsn3tkuzgO/bg20SM7uuCEYKQ=
|
||||
secret_access_key:
|
||||
secure: mrkOpEtqd2dEmi/qNJyX9vkME+6xgVBnXaRETKF7jT+flcQCQ0ayQkRkMV7lzGqq44XFg+n6Cpfn6oW0gH9RNdcC8YQvFP+kgzPx6nw6V/M31Vz6ySapJf59HBzVevf0NJkr0/1JoWsp1iq4IoN10WPzsCXZB55Io3Cf7DgpR+yiyBlWOctDfNdjJ97Juw3ENE80MHDf0fVqdUOIknQka1p68yAGkjar9kc2Oe7o94RzzmoqEn8tuFumiBQjIcuVRALsKqz+eIxBNgkL3BF9shVyRjOWLAeBhMPVFxZs5Dgd4ECbvU0i33gfmje3d6qqcw78N2lZaLefoVvWol3pOzVO133ewOSY9/lmpqEiRUU2ohEe8T4aSoS7posBW42itUTO4Y5w+eVOnHsm4sRQaI+/AXWTe7GPel+P8Qbe8Ya10A5gnpoag7o3raRDcHx+/qaZw1Af/u4XiAOYz3be3U90Qc+YMc/kS5i8BH0GXBbSfaWQ00CwRFlZQ3n1xUqmjC2CmjZTki3W/p7mEt0DjhcH9ZIXscK603sCC+mF6pEd9019k5fG/8fr2Y4Ptai9kd3BxZJCX9/jSoMfWOBbgkA5bRgHU0xrAj+p49qD6Ej9Xr8GE3+uebz3sEuhSFRnCKwKoOHOemfgevfO2y/jQXP677WPf3xQX7bVDfTFSHU=
|
||||
acl: public_read
|
||||
local-dir: $HOME/src/ljt.nightly/latest/files
|
||||
upload-dir: $TRAVIS_BRANCH/$TRAVIS_OS_NAME
|
||||
on:
|
||||
branch: dev
|
||||
condition: -n "$BUILD_OFFICIAL"
|
||||
964
BUILDING.md
Normal file
964
BUILDING.md
Normal file
@@ -0,0 +1,964 @@
|
||||
Un*x Platforms (including Mac and Cygwin)
|
||||
=========================================
|
||||
|
||||
|
||||
Build Requirements
|
||||
------------------
|
||||
|
||||
- autoconf 2.56 or later
|
||||
- automake 1.7 or later
|
||||
- libtool 1.4 or later
|
||||
* If using Xcode 4.3 or later on OS X, autoconf and automake are no longer
|
||||
provided. The easiest way to obtain them is from
|
||||
[MacPorts](http://www.MacPorts.org) or [Homebrew](http://brew.sh/).
|
||||
|
||||
- [NASM](http://www.nasm.us) or [YASM](http://yasm.tortall.net)
|
||||
(if building x86 or x86-64 SIMD extensions)
|
||||
* If using NASM, 0.98, or 2.01 or later is required for an x86 build (0.99
|
||||
and 2.00 do not work properly with libjpeg-turbo's x86 SIMD code.)
|
||||
* If using NASM, 2.00 or later is required for an x86-64 build.
|
||||
* If using NASM, 2.07 or later (except 2.11.08) is required for an x86-64
|
||||
Mac build (2.11.08 does not work properly with libjpeg-turbo's x86-64 SIMD
|
||||
code when building macho64 objects.) NASM or YASM can be obtained from
|
||||
[MacPorts](http://www.macports.org/) or [Homebrew](http://brew.sh/).
|
||||
|
||||
The binary RPMs released by the NASM project do not work on older Linux
|
||||
systems, such as Red Hat Enterprise Linux 5. On such systems, you can easily
|
||||
build and install NASM from a source RPM by downloading one of the SRPMs from
|
||||
|
||||
<http://www.nasm.us/pub/nasm/releasebuilds>
|
||||
|
||||
and executing the following as root:
|
||||
|
||||
ARCH=`uname -m`
|
||||
rpmbuild --rebuild nasm-{version}.src.rpm
|
||||
rpm -Uvh /usr/src/redhat/RPMS/$ARCH/nasm-{version}.$ARCH.rpm
|
||||
|
||||
NOTE: the NASM build will fail if texinfo is not installed.
|
||||
|
||||
- GCC v4.1 (or later) or Clang recommended for best performance
|
||||
|
||||
- If building the TurboJPEG Java wrapper, JDK or OpenJDK 1.5 or later is
|
||||
required. Most modern Linux distributions, as well as Solaris 10 and later,
|
||||
include JDK or OpenJDK. On OS X 10.5 and 10.6, it will be necessary to
|
||||
install the Java Developer Package, which can be downloaded from
|
||||
<http://developer.apple.com/downloads> (Apple ID required.) For other
|
||||
systems, you can obtain the Oracle Java Development Kit from
|
||||
<http://www.java.com>.
|
||||
|
||||
|
||||
Out-of-Tree Builds
|
||||
------------------
|
||||
|
||||
Binary objects, libraries, and executables are generated in the directory from
|
||||
which `configure` is executed (the "binary directory"), and this directory need
|
||||
not necessarily be the same as the libjpeg-turbo source directory. You can
|
||||
create multiple independent binary directories, in which different versions of
|
||||
libjpeg-turbo can be built from the same source tree using different compilers
|
||||
or settings. In the sections below, *{build_directory}* refers to the binary
|
||||
directory, whereas *{source_directory}* refers to the libjpeg-turbo source
|
||||
directory. For in-tree builds, these directories are the same.
|
||||
|
||||
|
||||
Build Procedure
|
||||
---------------
|
||||
|
||||
The following procedure will build libjpeg-turbo on Unix and Unix-like systems.
|
||||
(On Solaris, this generates a 32-bit build. See "Build Recipes" below for
|
||||
64-bit build instructions.)
|
||||
|
||||
cd {source_directory}
|
||||
autoreconf -fiv
|
||||
cd {build_directory}
|
||||
sh {source_directory}/configure [additional configure flags]
|
||||
make
|
||||
|
||||
NOTE: Running autoreconf in the source directory is not necessary if building
|
||||
libjpeg-turbo from one of the official release tarballs.
|
||||
|
||||
This will generate the following files under **.libs/**:
|
||||
|
||||
**libjpeg.a**<br>
|
||||
Static link library for the libjpeg API
|
||||
|
||||
**libjpeg.so.{version}** (Linux, Unix)<br>
|
||||
**libjpeg.{version}.dylib** (Mac)<br>
|
||||
**cygjpeg-{version}.dll** (Cygwin)<br>
|
||||
Shared library for the libjpeg API
|
||||
|
||||
By default, *{version}* is 62.2.0, 7.2.0, or 8.1.2, depending on whether
|
||||
libjpeg v6b (default), v7, or v8 emulation is enabled. If using Cygwin,
|
||||
*{version}* is 62, 7, or 8.
|
||||
|
||||
**libjpeg.so** (Linux, Unix)<br>
|
||||
**libjpeg.dylib** (Mac)<br>
|
||||
Development symlink for the libjpeg API
|
||||
|
||||
**libjpeg.dll.a** (Cygwin)<br>
|
||||
Import library for the libjpeg API
|
||||
|
||||
**libturbojpeg.a**<br>
|
||||
Static link library for the TurboJPEG API
|
||||
|
||||
**libturbojpeg.so.0.1.0** (Linux, Unix)<br>
|
||||
**libturbojpeg.0.1.0.dylib** (Mac)<br>
|
||||
**cygturbojpeg-0.dll** (Cygwin)<br>
|
||||
Shared library for the TurboJPEG API
|
||||
|
||||
**libturbojpeg.so** (Linux, Unix)<br>
|
||||
**libturbojpeg.dylib** (Mac)<br>
|
||||
Development symlink for the TurboJPEG API
|
||||
|
||||
**libturbojpeg.dll.a** (Cygwin)<br>
|
||||
Import library for the TurboJPEG API
|
||||
|
||||
|
||||
### libjpeg v7 or v8 API/ABI Emulation
|
||||
|
||||
Add `--with-jpeg7` to the `configure` command line to build a version of
|
||||
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.md](README.md) for more
|
||||
information about libjpeg v7 and v8 emulation.
|
||||
|
||||
|
||||
### In-Memory Source/Destination Managers
|
||||
|
||||
When using libjpeg v6b or v7 API/ABI emulation, add `--without-mem-srcdst` to
|
||||
the `configure` command line to build a version of libjpeg-turbo that lacks the
|
||||
`jpeg_mem_src()` and `jpeg_mem_dest()` functions. These functions were not
|
||||
part of the original libjpeg v6b and v7 APIs, so removing them ensures strict
|
||||
conformance with those APIs. See [README.md](README.md) for more information.
|
||||
|
||||
|
||||
### Arithmetic Coding Support
|
||||
|
||||
Since the patent on arithmetic coding has expired, this functionality has been
|
||||
included in this release of libjpeg-turbo. libjpeg-turbo's implementation is
|
||||
based on the implementation in libjpeg v8, but it works when emulating libjpeg
|
||||
v7 or v6b as well. The default is to enable both arithmetic encoding and
|
||||
decoding, but those who have philosophical objections to arithmetic coding can
|
||||
add `--without-arith-enc` or `--without-arith-dec` to the `configure` command
|
||||
line to disable encoding or decoding (respectively.)
|
||||
|
||||
|
||||
### TurboJPEG Java Wrapper
|
||||
|
||||
Add `--with-java` to the `configure` command line to incorporate an optional
|
||||
Java Native Interface (JNI) wrapper into the TurboJPEG shared library and build
|
||||
the Java front-end classes to support it. This allows the TurboJPEG shared
|
||||
library to be used directly from Java applications. See
|
||||
[java/README](java/README) for more details.
|
||||
|
||||
You can set the `JAVAC`, `JAR`, and `JAVA` configure variables to specify
|
||||
alternate commands for javac, jar, and java (respectively.) You can also
|
||||
set the `JAVACFLAGS` configure variable to specify arguments that should be
|
||||
passed to the Java compiler when building the TurboJPEG classes, and
|
||||
`JNI_CFLAGS` to specify arguments that should be passed to the C compiler when
|
||||
building the JNI wrapper. Run `configure --help` for more details.
|
||||
|
||||
|
||||
Build Recipes
|
||||
-------------
|
||||
|
||||
|
||||
### 32-bit Build on 64-bit Linux
|
||||
|
||||
Add
|
||||
|
||||
--host i686-pc-linux-gnu CFLAGS='-O3 -m32' LDFLAGS=-m32
|
||||
|
||||
to the `configure` command line.
|
||||
|
||||
|
||||
### 64-bit Build on 64-bit OS X
|
||||
|
||||
Add
|
||||
|
||||
--host x86_64-apple-darwin NASM=/opt/local/bin/nasm
|
||||
|
||||
to the `configure` command line. NASM 2.07 or later from MacPorts or Homebrew
|
||||
must be installed. If using Homebrew, then replace `/opt/local` with
|
||||
`/usr/local`.
|
||||
|
||||
|
||||
### 32-bit Build on 64-bit OS X
|
||||
|
||||
Add
|
||||
|
||||
--host i686-apple-darwin CFLAGS='-O3 -m32' LDFLAGS=-m32
|
||||
|
||||
to the `configure` command line.
|
||||
|
||||
|
||||
### 64-bit Backward-Compatible Build on 64-bit OS X
|
||||
|
||||
Add
|
||||
|
||||
--host x86_64-apple-darwin NASM=/opt/local/bin/nasm \
|
||||
CFLAGS='-mmacosx-version-min=10.5 -O3' \
|
||||
LDFLAGS='-mmacosx-version-min=10.5'
|
||||
|
||||
to the `configure` command line. NASM 2.07 or later from MacPorts or Homebrew
|
||||
must be installed. If using Homebrew, then replace `/opt/local` with
|
||||
`/usr/local`.
|
||||
|
||||
|
||||
### 32-bit Backward-Compatible Build on OS X
|
||||
|
||||
Add
|
||||
|
||||
--host i686-apple-darwin \
|
||||
CFLAGS='-mmacosx-version-min=10.5 -O3 -m32' \
|
||||
LDFLAGS='-mmacosx-version-min=10.5 -m32'
|
||||
|
||||
to the `configure` command line.
|
||||
|
||||
|
||||
### 64-bit Build on 64-bit Solaris
|
||||
|
||||
Add
|
||||
|
||||
--host x86_64-pc-solaris CFLAGS='-O3 -m64' LDFLAGS=-m64
|
||||
|
||||
to the `configure` command line.
|
||||
|
||||
|
||||
### 32-bit Build on 64-bit FreeBSD
|
||||
|
||||
Add
|
||||
|
||||
--host i386-unknown-freebsd CFLAGS='-O3 -m32' LDFLAGS=-m32
|
||||
|
||||
to the `configure` command line. NASM 2.07 or later from FreeBSD ports must be
|
||||
installed.
|
||||
|
||||
|
||||
### Oracle Solaris Studio
|
||||
|
||||
Add
|
||||
|
||||
CC=cc
|
||||
|
||||
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 Oracle Solaris Studio, add
|
||||
|
||||
--host x86_64-pc-solaris CC=cc CFLAGS='-xO5 -m64' LDFLAGS=-m64
|
||||
|
||||
to the `configure` command line.
|
||||
|
||||
|
||||
### MinGW Build on Cygwin
|
||||
|
||||
Use CMake (see recipes below)
|
||||
|
||||
|
||||
Building libjpeg-turbo for iOS
|
||||
------------------------------
|
||||
|
||||
iOS platforms, such as the iPhone and iPad, use ARM processors, and all
|
||||
currently supported models include NEON instructions. Thus, they can take
|
||||
advantage of libjpeg-turbo's SIMD extensions to significantly accelerate JPEG
|
||||
compression/decompression. This section describes how to build libjpeg-turbo
|
||||
for these platforms.
|
||||
|
||||
|
||||
### Additional build requirements
|
||||
|
||||
- For configurations that require [gas-preprocessor.pl]
|
||||
(https://raw.githubusercontent.com/libjpeg-turbo/gas-preprocessor/master/gas-preprocessor.pl),
|
||||
it should be installed in your `PATH`.
|
||||
|
||||
|
||||
### ARMv7 (32-bit)
|
||||
|
||||
**gas-preprocessor.pl required**
|
||||
|
||||
The following scripts demonstrate how to build libjpeg-turbo to run on the
|
||||
iPhone 3GS-4S/iPad 1st-3rd Generation and newer:
|
||||
|
||||
#### Xcode 4.2 and earlier (LLVM-GCC)
|
||||
|
||||
IOS_PLATFORMDIR=/Developer/Platforms/iPhoneOS.platform
|
||||
IOS_SYSROOT=($IOS_PLATFORMDIR/Developer/SDKs/iPhoneOS*.sdk)
|
||||
|
||||
export host_alias=arm-apple-darwin10
|
||||
export CC=${IOS_PLATFORMDIR}/Developer/usr/bin/arm-apple-darwin10-llvm-gcc-4.2
|
||||
export CFLAGS="-mfloat-abi=softfp -isysroot ${IOS_SYSROOT[0]} -O3 -march=armv7 -mcpu=cortex-a8 -mtune=cortex-a8 -mfpu=neon -miphoneos-version-min=3.0"
|
||||
|
||||
cd {build_directory}
|
||||
sh {source_directory}/configure [additional configure flags]
|
||||
make
|
||||
|
||||
#### Xcode 4.3-4.6 (LLVM-GCC)
|
||||
|
||||
Same as above, but replace the first line with:
|
||||
|
||||
IOS_PLATFORMDIR=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform
|
||||
|
||||
#### Xcode 5 and later (Clang)
|
||||
|
||||
IOS_PLATFORMDIR=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform
|
||||
IOS_SYSROOT=($IOS_PLATFORMDIR/Developer/SDKs/iPhoneOS*.sdk)
|
||||
|
||||
export host_alias=arm-apple-darwin10
|
||||
export CC=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
|
||||
export CFLAGS="-mfloat-abi=softfp -isysroot ${IOS_SYSROOT[0]} -O3 -arch armv7 -miphoneos-version-min=3.0"
|
||||
export CCASFLAGS="$CFLAGS -no-integrated-as"
|
||||
|
||||
cd {build_directory}
|
||||
sh {source_directory}/configure [additional configure flags]
|
||||
make
|
||||
|
||||
|
||||
### ARMv7s (32-bit)
|
||||
|
||||
**gas-preprocessor.pl required**
|
||||
|
||||
The following scripts demonstrate how to build libjpeg-turbo to run on the
|
||||
iPhone 5/iPad 4th Generation and newer:
|
||||
|
||||
#### Xcode 4.5-4.6 (LLVM-GCC)
|
||||
|
||||
IOS_PLATFORMDIR=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform
|
||||
IOS_SYSROOT=($IOS_PLATFORMDIR/Developer/SDKs/iPhoneOS*.sdk)
|
||||
|
||||
export host_alias=arm-apple-darwin10
|
||||
export CC=${IOS_PLATFORMDIR}/Developer/usr/bin/arm-apple-darwin10-llvm-gcc-4.2
|
||||
export CFLAGS="-mfloat-abi=softfp -isysroot ${IOS_SYSROOT[0]} -O3 -march=armv7s -mcpu=swift -mtune=swift -mfpu=neon -miphoneos-version-min=6.0"
|
||||
|
||||
cd {build_directory}
|
||||
sh {source_directory}/configure [additional configure flags]
|
||||
make
|
||||
|
||||
#### Xcode 5 and later (Clang)
|
||||
|
||||
Same as the ARMv7 build procedure for Xcode 5 and later, except replace the
|
||||
compiler flags as follows:
|
||||
|
||||
export CFLAGS="-mfloat-abi=softfp -isysroot ${IOS_SYSROOT[0]} -O3 -arch armv7s -miphoneos-version-min=6.0"
|
||||
|
||||
|
||||
### ARMv8 (64-bit)
|
||||
|
||||
**gas-preprocessor.pl required if using Xcode < 6**
|
||||
|
||||
The following script demonstrates how to build libjpeg-turbo to run on the
|
||||
iPhone 5S/iPad Mini 2/iPad Air and newer.
|
||||
|
||||
IOS_PLATFORMDIR=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform
|
||||
IOS_SYSROOT=($IOS_PLATFORMDIR/Developer/SDKs/iPhoneOS*.sdk)
|
||||
|
||||
export host_alias=aarch64-apple-darwin
|
||||
export CC=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
|
||||
export CFLAGS="-isysroot ${IOS_SYSROOT[0]} -O3 -arch arm64 -miphoneos-version-min=7.0 -funwind-tables"
|
||||
|
||||
cd {build_directory}
|
||||
sh {source_directory}/configure [additional configure flags]
|
||||
make
|
||||
|
||||
Once built, lipo can be used to combine the ARMv7, v7s, and/or v8 variants into
|
||||
a universal library.
|
||||
|
||||
|
||||
Building libjpeg-turbo for Android
|
||||
----------------------------------
|
||||
|
||||
Building libjpeg-turbo for Android platforms requires the
|
||||
[Android NDK](https://developer.android.com/tools/sdk/ndk) and autotools.
|
||||
|
||||
|
||||
### ARMv7 (32-bit)
|
||||
|
||||
The following is a general recipe script that can be modified for your specific
|
||||
needs.
|
||||
|
||||
# Set these variables to suit your needs
|
||||
NDK_PATH={full path to the "ndk" directory-- for example, /opt/android/sdk/ndk-bundle}
|
||||
BUILD_PLATFORM={the platform name for the NDK package you installed--
|
||||
for example, "windows-x86" or "linux-x86_64" or "darwin-x86_64"}
|
||||
TOOLCHAIN_VERSION={"4.8", "4.9", "clang3.5", etc. This corresponds to a
|
||||
toolchain directory under ${NDK_PATH}/toolchains/.}
|
||||
ANDROID_VERSION={The minimum version of Android to support-- for example,
|
||||
"16", "19", etc.}
|
||||
|
||||
# It should not be necessary to modify the rest
|
||||
HOST=arm-linux-androideabi
|
||||
SYSROOT=${NDK_PATH}/platforms/android-${ANDROID_VERSION}/arch-arm
|
||||
ANDROID_CFLAGS="-march=armv7-a -mfloat-abi=softfp -fprefetch-loop-arrays \
|
||||
--sysroot=${SYSROOT}"
|
||||
|
||||
TOOLCHAIN=${NDK_PATH}/toolchains/${HOST}-${TOOLCHAIN_VERSION}/prebuilt/${BUILD_PLATFORM}
|
||||
export CPP=${TOOLCHAIN}/bin/${HOST}-cpp
|
||||
export AR=${TOOLCHAIN}/bin/${HOST}-ar
|
||||
export NM=${TOOLCHAIN}/bin/${HOST}-nm
|
||||
export CC=${TOOLCHAIN}/bin/${HOST}-gcc
|
||||
export LD=${TOOLCHAIN}/bin/${HOST}-ld
|
||||
export RANLIB=${TOOLCHAIN}/bin/${HOST}-ranlib
|
||||
export OBJDUMP=${TOOLCHAIN}/bin/${HOST}-objdump
|
||||
export STRIP=${TOOLCHAIN}/bin/${HOST}-strip
|
||||
cd {build_directory}
|
||||
sh {source_directory}/configure --host=${HOST} \
|
||||
CFLAGS="${ANDROID_CFLAGS} -O3 -fPIE" \
|
||||
CPPFLAGS="${ANDROID_CFLAGS}" \
|
||||
LDFLAGS="${ANDROID_CFLAGS} -pie" --with-simd ${1+"$@"}
|
||||
make
|
||||
|
||||
|
||||
### ARMv8 (64-bit)
|
||||
|
||||
The following is a general recipe script that can be modified for your specific
|
||||
needs.
|
||||
|
||||
# Set these variables to suit your needs
|
||||
NDK_PATH={full path to the "ndk" directory-- for example, /opt/android/sdk/ndk-bundle}
|
||||
BUILD_PLATFORM={the platform name for the NDK package you installed--
|
||||
for example, "windows-x86" or "linux-x86_64" or "darwin-x86_64"}
|
||||
TOOLCHAIN_VERSION={"4.8", "4.9", "clang3.5", etc. This corresponds to a
|
||||
toolchain directory under ${NDK_PATH}/toolchains/.}
|
||||
ANDROID_VERSION={The minimum version of Android to support. "21" or later
|
||||
is required for a 64-bit build.}
|
||||
|
||||
# It should not be necessary to modify the rest
|
||||
HOST=aarch64-linux-android
|
||||
SYSROOT=${NDK_PATH}/platforms/android-${ANDROID_VERSION}/arch-arm64
|
||||
ANDROID_CFLAGS="--sysroot=${SYSROOT}"
|
||||
|
||||
TOOLCHAIN=${NDK_PATH}/toolchains/${HOST}-${TOOLCHAIN_VERSION}/prebuilt/${BUILD_PLATFORM}
|
||||
export CPP=${TOOLCHAIN}/bin/${HOST}-cpp
|
||||
export AR=${TOOLCHAIN}/bin/${HOST}-ar
|
||||
export NM=${TOOLCHAIN}/bin/${HOST}-nm
|
||||
export CC=${TOOLCHAIN}/bin/${HOST}-gcc
|
||||
export LD=${TOOLCHAIN}/bin/${HOST}-ld
|
||||
export RANLIB=${TOOLCHAIN}/bin/${HOST}-ranlib
|
||||
export OBJDUMP=${TOOLCHAIN}/bin/${HOST}-objdump
|
||||
export STRIP=${TOOLCHAIN}/bin/${HOST}-strip
|
||||
cd {build_directory}
|
||||
sh {source_directory}/configure --host=${HOST} \
|
||||
CFLAGS="${ANDROID_CFLAGS} -O3 -fPIE" \
|
||||
CPPFLAGS="${ANDROID_CFLAGS}" \
|
||||
LDFLAGS="${ANDROID_CFLAGS} -pie" --with-simd ${1+"$@"}
|
||||
make
|
||||
|
||||
|
||||
### x86 (32-bit)
|
||||
|
||||
The following is a general recipe script that can be modified for your specific
|
||||
needs.
|
||||
|
||||
# Set these variables to suit your needs
|
||||
NDK_PATH={full path to the "ndk" directory-- for example, /opt/android/sdk/ndk-bundle}
|
||||
BUILD_PLATFORM={the platform name for the NDK package you installed--
|
||||
for example, "windows-x86" or "linux-x86_64" or "darwin-x86_64"}
|
||||
TOOLCHAIN_VERSION={"4.8", "4.9", "clang3.5", etc. This corresponds to a
|
||||
toolchain directory under ${NDK_PATH}/toolchains/.}
|
||||
ANDROID_VERSION={The minimum version of Android to support-- for example,
|
||||
"16", "19", etc.}
|
||||
|
||||
# It should not be necessary to modify the rest
|
||||
HOST=i686-linux-android
|
||||
SYSROOT=${NDK_PATH}/platforms/android-${ANDROID_VERSION}/arch-x86
|
||||
ANDROID_CFLAGS="--sysroot=${SYSROOT}"
|
||||
|
||||
TOOLCHAIN=${NDK_PATH}/toolchains/x86-${TOOLCHAIN_VERSION}/prebuilt/${BUILD_PLATFORM}
|
||||
export CPP=${TOOLCHAIN}/bin/${HOST}-cpp
|
||||
export AR=${TOOLCHAIN}/bin/${HOST}-ar
|
||||
export NM=${TOOLCHAIN}/bin/${HOST}-nm
|
||||
export CC=${TOOLCHAIN}/bin/${HOST}-gcc
|
||||
export LD=${TOOLCHAIN}/bin/${HOST}-ld
|
||||
export RANLIB=${TOOLCHAIN}/bin/${HOST}-ranlib
|
||||
export OBJDUMP=${TOOLCHAIN}/bin/${HOST}-objdump
|
||||
export STRIP=${TOOLCHAIN}/bin/${HOST}-strip
|
||||
cd {build_directory}
|
||||
sh {source_directory}/configure --host=${HOST} \
|
||||
CFLAGS="${ANDROID_CFLAGS} -O3 -fPIE" \
|
||||
CPPFLAGS="${ANDROID_CFLAGS}" \
|
||||
LDFLAGS="${ANDROID_CFLAGS} -pie" --with-simd ${1+"$@"}
|
||||
make
|
||||
|
||||
|
||||
### x86-64 (64-bit)
|
||||
|
||||
The following is a general recipe script that can be modified for your specific
|
||||
needs.
|
||||
|
||||
# Set these variables to suit your needs
|
||||
NDK_PATH={full path to the "ndk" directory-- for example, /opt/android/sdk/ndk-bundle}
|
||||
BUILD_PLATFORM={the platform name for the NDK package you installed--
|
||||
for example, "windows-x86" or "linux-x86_64" or "darwin-x86_64"}
|
||||
TOOLCHAIN_VERSION={"4.8", "4.9", "clang3.5", etc. This corresponds to a
|
||||
toolchain directory under ${NDK_PATH}/toolchains/.}
|
||||
ANDROID_VERSION={The minimum version of Android to support. "21" or later
|
||||
is required for a 64-bit build.}
|
||||
|
||||
# It should not be necessary to modify the rest
|
||||
HOST=x86_64-linux-android
|
||||
SYSROOT=${NDK_PATH}/platforms/android-${ANDROID_VERSION}/arch-x86_64
|
||||
ANDROID_CFLAGS="--sysroot=${SYSROOT}"
|
||||
|
||||
TOOLCHAIN=${NDK_PATH}/toolchains/x86_64-${TOOLCHAIN_VERSION}/prebuilt/${BUILD_PLATFORM}
|
||||
export CPP=${TOOLCHAIN}/bin/${HOST}-cpp
|
||||
export AR=${TOOLCHAIN}/bin/${HOST}-ar
|
||||
export NM=${TOOLCHAIN}/bin/${HOST}-nm
|
||||
export CC=${TOOLCHAIN}/bin/${HOST}-gcc
|
||||
export LD=${TOOLCHAIN}/bin/${HOST}-ld
|
||||
export RANLIB=${TOOLCHAIN}/bin/${HOST}-ranlib
|
||||
export OBJDUMP=${TOOLCHAIN}/bin/${HOST}-objdump
|
||||
export STRIP=${TOOLCHAIN}/bin/${HOST}-strip
|
||||
cd {build_directory}
|
||||
sh {source_directory}/configure --host=${HOST} \
|
||||
CFLAGS="${ANDROID_CFLAGS} -O3 -fPIE" \
|
||||
CPPFLAGS="${ANDROID_CFLAGS}" \
|
||||
LDFLAGS="${ANDROID_CFLAGS} -pie" --with-simd ${1+"$@"}
|
||||
make
|
||||
|
||||
|
||||
If building for Android 4.0.x (API level < 16) or earlier, remove `-fPIE` from
|
||||
`CFLAGS` and `-pie` from `LDFLAGS`.
|
||||
|
||||
|
||||
Installing libjpeg-turbo
|
||||
------------------------
|
||||
|
||||
To install libjpeg-turbo after it is built, replace `make` in the build
|
||||
instructions with `make install`.
|
||||
|
||||
The `--prefix` argument to configure (or the `prefix` configure variable) can
|
||||
be used to specify an installation directory of your choosing. If you don't
|
||||
specify an installation directory, then the default is to install libjpeg-turbo
|
||||
under **/opt/libjpeg-turbo** and to place the libraries in
|
||||
**/opt/libjpeg-turbo/lib32** (32-bit) or **/opt/libjpeg-turbo/lib64** (64-bit.)
|
||||
|
||||
The `bindir`, `datadir`, `docdir`, `includedir`, `libdir`, and `mandir`
|
||||
configure variables allow a finer degree of control over where specific files in
|
||||
the libjpeg-turbo distribution should be installed. These variables can either
|
||||
be specified at configure time or passed as arguments to `make install`.
|
||||
|
||||
|
||||
Windows (Visual C++ or MinGW)
|
||||
=============================
|
||||
|
||||
|
||||
Build Requirements
|
||||
------------------
|
||||
|
||||
- [CMake](http://www.cmake.org) v2.8.11 or later
|
||||
|
||||
- [NASM](http://www.nasm.us) or [YASM](http://yasm.tortall.net)
|
||||
* If using NASM, 0.98 or later is required for an x86 build.
|
||||
* If using NASM, 2.05 or later is required for an x86-64 build.
|
||||
* **nasm.exe**/**yasm.exe** should be in your `PATH`.
|
||||
|
||||
- Microsoft Visual C++ 2005 or later
|
||||
|
||||
If you don't already have Visual C++, then the easiest way to get it is by
|
||||
installing the
|
||||
[Windows SDK](http://msdn.microsoft.com/en-us/windows/bb980924.aspx).
|
||||
The Windows SDK includes both 32-bit and 64-bit Visual C++ compilers and
|
||||
everything necessary to build libjpeg-turbo.
|
||||
|
||||
* You can also use Microsoft Visual Studio Express/Community Edition, which
|
||||
is a free download. (NOTE: versions prior to 2012 can only be used to
|
||||
build 32-bit code.)
|
||||
* If you intend to build libjpeg-turbo from the command line, then add the
|
||||
appropriate compiler and SDK directories to the `INCLUDE`, `LIB`, and
|
||||
`PATH` environment variables. This is generally accomplished by
|
||||
executing `vcvars32.bat` or `vcvars64.bat` and `SetEnv.cmd`.
|
||||
`vcvars32.bat` and `vcvars64.bat` are part of Visual C++ and are located in
|
||||
the same directory as the compiler. `SetEnv.cmd` is part of the Windows
|
||||
SDK. You can pass optional arguments to `SetEnv.cmd` to specify a 32-bit
|
||||
or 64-bit build environment.
|
||||
|
||||
... OR ...
|
||||
|
||||
- MinGW
|
||||
|
||||
[MSYS2](http://msys2.github.io/) or [tdm-gcc](http://tdm-gcc.tdragon.net/)
|
||||
recommended if building on a Windows machine. Both distributions install a
|
||||
Start Menu link that can be used to launch a command prompt with the
|
||||
appropriate compiler paths automatically set.
|
||||
|
||||
- If building the TurboJPEG Java wrapper, JDK 1.5 or later is required. This
|
||||
can be downloaded from <http://www.java.com>.
|
||||
|
||||
|
||||
Out-of-Tree Builds
|
||||
------------------
|
||||
|
||||
Binary objects, libraries, and executables are generated in the directory from
|
||||
which CMake is executed (the "binary directory"), and this directory need not
|
||||
necessarily be the same as the libjpeg-turbo source directory. You can create
|
||||
multiple independent binary directories, in which different versions of
|
||||
libjpeg-turbo can be built from the same source tree using different compilers
|
||||
or settings. In the sections below, *{build_directory}* refers to the binary
|
||||
directory, whereas *{source_directory}* refers to the libjpeg-turbo source
|
||||
directory. For in-tree builds, these directories are the same.
|
||||
|
||||
|
||||
Build Procedure
|
||||
---------------
|
||||
|
||||
NOTE: The build procedures below assume that CMake is invoked from the command
|
||||
line, but all of these procedures can be adapted to the CMake GUI as
|
||||
well.
|
||||
|
||||
|
||||
### Visual C++ (Command Line)
|
||||
|
||||
cd {build_directory}
|
||||
cmake -G"NMake Makefiles" -DCMAKE_BUILD_TYPE=Release [additional CMake flags] {source_directory}
|
||||
nmake
|
||||
|
||||
This will build either a 32-bit or a 64-bit version of libjpeg-turbo, depending
|
||||
on which version of **cl.exe** is in the `PATH`.
|
||||
|
||||
The following files will be generated under *{build_directory}*:
|
||||
|
||||
**jpeg-static.lib**<br>
|
||||
Static link library for the libjpeg API
|
||||
|
||||
**sharedlib/jpeg{version}.dll**<br>
|
||||
DLL for the libjpeg API
|
||||
|
||||
**sharedlib/jpeg.lib**<br>
|
||||
Import library for the libjpeg API
|
||||
|
||||
**turbojpeg-static.lib**<br>
|
||||
Static link library for the TurboJPEG API
|
||||
|
||||
**turbojpeg.dll**<br>
|
||||
DLL for the TurboJPEG API
|
||||
|
||||
**turbojpeg.lib**<br>
|
||||
Import library for the TurboJPEG API
|
||||
|
||||
*{version}* is 62, 7, or 8, depending on whether libjpeg v6b (default), v7, or
|
||||
v8 emulation is enabled.
|
||||
|
||||
|
||||
### Visual C++ (IDE)
|
||||
|
||||
Choose the appropriate CMake generator option for your version of Visual Studio
|
||||
(run `cmake` with no arguments for a list of available generators.) For
|
||||
instance:
|
||||
|
||||
cd {build_directory}
|
||||
cmake -G"Visual Studio 10" [additional CMake flags] {source_directory}
|
||||
|
||||
NOTE: Add "Win64" to the generator name (for example, "Visual Studio 10
|
||||
Win64") to build a 64-bit version of libjpeg-turbo. A separate build directory
|
||||
must be used for 32-bit and 64-bit builds.
|
||||
|
||||
You can then open **ALL_BUILD.vcproj** in Visual Studio and build one of the
|
||||
configurations in that project ("Debug", "Release", etc.) to generate a full
|
||||
build of libjpeg-turbo.
|
||||
|
||||
This will generate the following files under *{build_directory}*:
|
||||
|
||||
**{configuration}/jpeg-static.lib**<br>
|
||||
Static link library for the libjpeg API
|
||||
|
||||
**sharedlib/{configuration}/jpeg{version}.dll**<br>
|
||||
DLL for the libjpeg API
|
||||
|
||||
**sharedlib/{configuration}/jpeg.lib**<br>
|
||||
Import library for the libjpeg API
|
||||
|
||||
**{configuration}/turbojpeg-static.lib**<br>
|
||||
Static link library for the TurboJPEG API
|
||||
|
||||
**{configuration}/turbojpeg.dll**<br>
|
||||
DLL for the TurboJPEG API
|
||||
|
||||
**{configuration}/turbojpeg.lib**<br>
|
||||
Import library for the TurboJPEG API
|
||||
|
||||
*{configuration}* is Debug, Release, RelWithDebInfo, or MinSizeRel, depending
|
||||
on the configuration you built in the IDE, and *{version}* is 62, 7, or 8,
|
||||
depending on whether libjpeg v6b (default), v7, or v8 emulation is enabled.
|
||||
|
||||
|
||||
### MinGW
|
||||
|
||||
NOTE: This assumes that you are building on a Windows machine using the MSYS
|
||||
environment. If you are cross-compiling on a Un*x platform (including Mac and
|
||||
Cygwin), then see "Build Recipes" below.
|
||||
|
||||
cd {build_directory}
|
||||
cmake -G"MSYS Makefiles" [additional CMake flags] {source_directory}
|
||||
make
|
||||
|
||||
This will generate the following files under *{build_directory}*:
|
||||
|
||||
**libjpeg.a**<br>
|
||||
Static link library for the libjpeg API
|
||||
|
||||
**sharedlib/libjpeg-{version}.dll**<br>
|
||||
DLL for the libjpeg API
|
||||
|
||||
**sharedlib/libjpeg.dll.a**<br>
|
||||
Import library for the libjpeg API
|
||||
|
||||
**libturbojpeg.a**<br>
|
||||
Static link library for the TurboJPEG API
|
||||
|
||||
**libturbojpeg.dll**<br>
|
||||
DLL for the TurboJPEG API
|
||||
|
||||
**libturbojpeg.dll.a**<br>
|
||||
Import library for the TurboJPEG API
|
||||
|
||||
*{version}* is 62, 7, or 8, depending on whether libjpeg v6b (default), v7, or
|
||||
v8 emulation is enabled.
|
||||
|
||||
|
||||
### Debug Build
|
||||
|
||||
Add `-DCMAKE_BUILD_TYPE=Debug` to the CMake command line. Or, if building
|
||||
with NMake, remove `-DCMAKE_BUILD_TYPE=Release` (Debug builds are the default
|
||||
with NMake.)
|
||||
|
||||
|
||||
### 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 API/ABI-compatible with libjpeg v7. Add `-DWITH_JPEG8=1`
|
||||
to the CMake command line to build a version of libjpeg-turbo that is
|
||||
API/ABI-compatible with libjpeg v8. See [README.md](README.md) for more
|
||||
information about libjpeg v7 and v8 emulation.
|
||||
|
||||
|
||||
### In-Memory Source/Destination Managers
|
||||
|
||||
When using libjpeg v6b or v7 API/ABI emulation, add `-DWITH_MEM_SRCDST=0` to
|
||||
the CMake command line to build a version of libjpeg-turbo that lacks the
|
||||
`jpeg_mem_src()` and `jpeg_mem_dest()` functions. These functions were not
|
||||
part of the original libjpeg v6b and v7 APIs, so removing them ensures strict
|
||||
conformance with those APIs. See [README.md](README.md) for more information.
|
||||
|
||||
|
||||
### Arithmetic Coding Support
|
||||
|
||||
Since the patent on arithmetic coding has expired, this functionality has been
|
||||
included in this release of libjpeg-turbo. libjpeg-turbo's implementation is
|
||||
based on the implementation in libjpeg v8, but it works when emulating libjpeg
|
||||
v7 or v6b as well. The default is to enable both arithmetic encoding and
|
||||
decoding, but those who have philosophical objections to arithmetic coding can
|
||||
add `-DWITH_ARITH_ENC=0` or `-DWITH_ARITH_DEC=0` to the CMake command line to
|
||||
disable encoding or decoding (respectively.)
|
||||
|
||||
|
||||
### TurboJPEG Java Wrapper
|
||||
|
||||
Add `-DWITH_JAVA=1` to the CMake command line to incorporate an optional Java
|
||||
Native Interface (JNI) wrapper into the TurboJPEG shared library and build the
|
||||
Java front-end classes to support it. This allows the TurboJPEG shared library
|
||||
to be used directly from Java applications. See [java/README](java/README) for
|
||||
more details.
|
||||
|
||||
If Java is not in your `PATH`, or if you wish to use an alternate JDK to
|
||||
build/test libjpeg-turbo, then (prior to running CMake) set the `JAVA_HOME`
|
||||
environment variable to the location of the JDK that you wish to use. The
|
||||
`Java_JAVAC_EXECUTABLE`, `Java_JAVA_EXECUTABLE`, and `Java_JAR_EXECUTABLE`
|
||||
CMake variables can also be used to specify alternate commands or locations for
|
||||
javac, jar, and java (respectively.) You can also set the `JAVACFLAGS` CMake
|
||||
variable to specify arguments that should be passed to the Java compiler when
|
||||
building the TurboJPEG classes.
|
||||
|
||||
|
||||
Build Recipes
|
||||
-------------
|
||||
|
||||
|
||||
### 32-bit MinGW Build on Un*x (including Mac and Cygwin)
|
||||
|
||||
Create a file called **toolchain.cmake** under *{build_directory}*, with the
|
||||
following contents:
|
||||
|
||||
set(CMAKE_SYSTEM_NAME Windows)
|
||||
set(CMAKE_SYSTEM_PROCESSOR X86)
|
||||
set(CMAKE_C_COMPILER {mingw_binary_path}/i686-w64-mingw32-gcc)
|
||||
set(CMAKE_RC_COMPILER {mingw_binary_path}/i686-w64-mingw32-windres)
|
||||
|
||||
*{mingw\_binary\_path}* is the directory under which the MinGW binaries are
|
||||
located (usually **/usr/bin**.) Next, execute the following commands:
|
||||
|
||||
cd {build_directory}
|
||||
cmake -G"Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=toolchain.cmake \
|
||||
[additional CMake flags] {source_directory}
|
||||
make
|
||||
|
||||
|
||||
### 64-bit MinGW Build on Un*x (including Mac and Cygwin)
|
||||
|
||||
Create a file called **toolchain.cmake** under *{build_directory}*, with the
|
||||
following contents:
|
||||
|
||||
set(CMAKE_SYSTEM_NAME Windows)
|
||||
set(CMAKE_SYSTEM_PROCESSOR AMD64)
|
||||
set(CMAKE_C_COMPILER {mingw_binary_path}/x86_64-w64-mingw32-gcc)
|
||||
set(CMAKE_RC_COMPILER {mingw_binary_path}/x86_64-w64-mingw32-windres)
|
||||
|
||||
*{mingw\_binary\_path}* is the directory under which the MinGW binaries are
|
||||
located (usually **/usr/bin**.) Next, execute the following commands:
|
||||
|
||||
cd {build_directory}
|
||||
cmake -G"Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=toolchain.cmake \
|
||||
[additional CMake flags] {source_directory}
|
||||
make
|
||||
|
||||
|
||||
Installing libjpeg-turbo
|
||||
------------------------
|
||||
|
||||
You can use the build system to install libjpeg-turbo (as opposed to creating
|
||||
an installer package.) To do this, run `make install` or `nmake install`
|
||||
(or build the "install" target in the Visual Studio IDE.) Running
|
||||
`make uninstall` or `nmake uninstall` (or building the "uninstall" target in
|
||||
the Visual Studio IDE) will uninstall libjpeg-turbo.
|
||||
|
||||
The `CMAKE_INSTALL_PREFIX` CMake variable can be modified in order to install
|
||||
libjpeg-turbo into a directory of your choosing. If you don't specify
|
||||
`CMAKE_INSTALL_PREFIX`, then the default is:
|
||||
|
||||
**c:\libjpeg-turbo**<br>
|
||||
Visual Studio 32-bit build
|
||||
|
||||
**c:\libjpeg-turbo64**<br>
|
||||
Visual Studio 64-bit build
|
||||
|
||||
**c:\libjpeg-turbo-gcc**<br>
|
||||
MinGW 32-bit build
|
||||
|
||||
**c:\libjpeg-turbo-gcc64**<br>
|
||||
MinGW 64-bit build
|
||||
|
||||
|
||||
Creating Distribution Packages
|
||||
==============================
|
||||
|
||||
The following commands can be used to create various types of distribution
|
||||
packages:
|
||||
|
||||
|
||||
Linux
|
||||
-----
|
||||
|
||||
make rpm
|
||||
|
||||
Create Red Hat-style binary RPM package. Requires RPM v4 or later.
|
||||
|
||||
make srpm
|
||||
|
||||
This runs `make dist` to create a pristine source tarball, then creates a
|
||||
Red Hat-style source RPM package from the tarball. Requires RPM v4 or later.
|
||||
|
||||
make deb
|
||||
|
||||
Create Debian-style binary package. Requires dpkg.
|
||||
|
||||
|
||||
Mac
|
||||
---
|
||||
|
||||
make dmg
|
||||
|
||||
Create Mac package/disk image. This requires pkgbuild and productbuild, which
|
||||
are installed by default on OS X 10.7 and later and which can be obtained by
|
||||
installing Xcode 3.2.6 (with the "Unix Development" option) on OS X 10.6.
|
||||
Packages built in this manner can be installed on OS X 10.5 and later, but they
|
||||
must be built on OS X 10.6 or later.
|
||||
|
||||
make udmg [BUILDDIR32={32-bit build directory}]
|
||||
|
||||
On 64-bit OS X systems, this creates a Mac package/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}] \
|
||||
[BUILDDIRARMV7={ARMv7 build directory}] \
|
||||
[BUILDDIRARMV7S={ARMv7s build directory}] \
|
||||
[BUILDDIRARMV8={ARMv8 build directory}]
|
||||
|
||||
This creates a Mac package/disk image in which the libjpeg-turbo 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 ARMv7, ARMv7s, and/or ARMv8
|
||||
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 ARMv7
|
||||
build under *{source_directory}*/iosarmv7 by default, the ARMv7s build under
|
||||
*{source_directory}*/iosarmv7s by default, the ARMv8 build under
|
||||
*{source_directory}*/iosarmv8 by default, and (if applicable) the 32-bit build
|
||||
under *{source_directory}*/osxx86 by default, but you can override this by
|
||||
setting the `BUILDDIR32`, `BUILDDIRARMV7`, `BUILDDIRARMV7S`, and/or
|
||||
`BUILDDIRARMV8` variables on the `make` command line as shown above.
|
||||
|
||||
NOTE: If including an ARMv8 build in the package, then you may need to use
|
||||
Xcode's version of lipo instead of the operating system's. To do this, pass
|
||||
an argument of `LIPO="xcrun lipo"` on the make command line.
|
||||
|
||||
make cygwinpkg
|
||||
|
||||
Build a Cygwin binary package.
|
||||
|
||||
|
||||
Windows
|
||||
-------
|
||||
|
||||
If using NMake:
|
||||
|
||||
cd {build_directory}
|
||||
nmake installer
|
||||
|
||||
If using MinGW:
|
||||
|
||||
cd {build_directory}
|
||||
make installer
|
||||
|
||||
If using the Visual Studio IDE, build the "installer" target.
|
||||
|
||||
The installer package (libjpeg-turbo-*{version}*[-gcc|-vc][64].exe) will be
|
||||
located under *{build_directory}*. If building using the Visual Studio IDE,
|
||||
then the installer package will be located in a subdirectory with the same name
|
||||
as the configuration you built (such as *{build_directory}*\Debug\ or
|
||||
*{build_directory}*\Release\).
|
||||
|
||||
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` (Un*x) or
|
||||
`nmake test` (Windows command line) or by building the "RUN_TESTS" target
|
||||
(Visual Studio IDE), 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` (Un*x) or `nmake testclean` (Windows command line) or
|
||||
building the "testclean" target (Visual Studio IDE) will clean up the output
|
||||
images generated by the tests.
|
||||
|
||||
On Un*x platforms, more extensive tests of the TurboJPEG C and Java wrappers
|
||||
can be run by invoking `make tjtest`. These extended TurboJPEG tests
|
||||
essentially iterate through all of the available features of the TurboJPEG APIs
|
||||
that are not covered by the TurboJPEG unit tests (including 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 API library.
|
||||
884
BUILDING.txt
884
BUILDING.txt
@@ -1,884 +0,0 @@
|
||||
*******************************************************************************
|
||||
** Building on Un*x Platforms (including Cygwin and OS X)
|
||||
*******************************************************************************
|
||||
|
||||
|
||||
==================
|
||||
Build Requirements
|
||||
==================
|
||||
|
||||
-- autoconf 2.56 or later
|
||||
-- automake 1.7 or later
|
||||
-- libtool 1.4 or later
|
||||
* If using Xcode 4.3 or later on OS X, autoconf and automake are no longer
|
||||
provided. The easiest way to obtain them is from MacPorts
|
||||
(http://www.macports.org/).
|
||||
|
||||
-- NASM (if building x86 or x86-64 SIMD extensions)
|
||||
* 0.98, or 2.01 or later is required for a 32-bit build
|
||||
* NASM 2.00 or later is required for a 64-bit build
|
||||
* NASM 2.07 or later is required for a 64-bit build on OS X. This can be
|
||||
obtained from MacPorts (http://www.macports.org/).
|
||||
|
||||
The binary RPMs released by the NASM project do not work on older Linux
|
||||
systems, such as Red Hat Enterprise Linux 4. On such systems, you can
|
||||
easily build and install NASM from a source RPM by downloading one of the
|
||||
SRPMs from
|
||||
|
||||
http://www.nasm.us/pub/nasm/releasebuilds
|
||||
|
||||
and executing the following as root:
|
||||
|
||||
ARCH=`uname -m`
|
||||
rpmbuild --rebuild nasm-{version}.src.rpm
|
||||
rpm -Uvh /usr/src/redhat/RPMS/$ARCH/nasm-{version}.$ARCH.rpm
|
||||
|
||||
NOTE: the NASM build will fail if texinfo is not installed.
|
||||
|
||||
-- GCC v4.1 or later recommended for best performance
|
||||
* Beginning with Xcode 4, Apple stopped distributing GCC and switched to
|
||||
the LLVM compiler. Xcode v4.0 through v4.6 provides a GCC front end
|
||||
called LLVM-GCC. Unfortunately, as of this writing, neither LLVM-GCC nor
|
||||
the LLVM (clang) compiler produces optimal performance with libjpeg-turbo.
|
||||
Building libjpeg-turbo with LLVM-GCC v4.2 results in a 10% performance
|
||||
degradation when compressing using 64-bit code, relative to building
|
||||
libjpeg-turbo with GCC v4.2. Building libjpeg-turbo with LLVM (clang)
|
||||
results in a 20% performance degradation when compressing using 64-bit
|
||||
code, relative to building libjpeg-turbo with GCC v4.2. If you are
|
||||
running Snow Leopard or earlier, it is suggested that you continue to use
|
||||
Xcode v3.2.6, which provides GCC v4.2. If you are using Lion or later, it
|
||||
is suggested that you install Apple GCC v4.2 through MacPorts.
|
||||
|
||||
-- If building the TurboJPEG Java wrapper, JDK or OpenJDK 1.5 or later is
|
||||
required. Some systems, such as Solaris 10 and later and Red Hat Enterprise
|
||||
Linux 5 and later, have this pre-installed. On OS X 10.5 and later, it will
|
||||
be necessary to install the Java Developer Package, which can be downloaded
|
||||
from http://developer.apple.com/downloads (Apple ID required.) For systems
|
||||
that do not have a JDK installed, you can obtain the Oracle Java Development
|
||||
Kit from http://www.java.com.
|
||||
|
||||
|
||||
==================
|
||||
Out-of-Tree Builds
|
||||
==================
|
||||
|
||||
Binary objects, libraries, and executables are generated in the same directory
|
||||
from which configure was executed (the "binary directory"), and this directory
|
||||
need not necessarily be the same as the libjpeg-turbo source directory. You
|
||||
can create multiple independent binary directories, in which different versions
|
||||
of libjpeg-turbo can be built from the same source tree using different
|
||||
compilers or settings. In the sections below, {build_directory} refers to the
|
||||
binary directory, whereas {source_directory} refers to the libjpeg-turbo source
|
||||
directory. For in-tree builds, these directories are the same.
|
||||
|
||||
|
||||
======================
|
||||
Building libjpeg-turbo
|
||||
======================
|
||||
|
||||
The following procedure will build libjpeg-turbo on Linux, FreeBSD, Cygwin, and
|
||||
Solaris/x86 systems (on Solaris, this generates a 32-bit library. See below
|
||||
for 64-bit build instructions.)
|
||||
|
||||
cd {source_directory}
|
||||
autoreconf -fiv
|
||||
cd {build_directory}
|
||||
sh {source_directory}/configure [additional configure flags]
|
||||
make
|
||||
|
||||
NOTE: Running autoreconf in the source directory is usually only necessary if
|
||||
building libjpeg-turbo from the SVN repository.
|
||||
|
||||
This will generate the following files under .libs/
|
||||
|
||||
libjpeg.a
|
||||
Static link library for the libjpeg API
|
||||
|
||||
libjpeg.so.{version} (Linux, Unix)
|
||||
libjpeg.{version}.dylib (OS X)
|
||||
cygjpeg-{version}.dll (Cygwin)
|
||||
Shared library for the libjpeg API
|
||||
|
||||
By default, {version} is 62.1.0, 7.1.0, or 8.0.2, depending on whether
|
||||
libjpeg v6b (default), v7, or v8 emulation is enabled. If using Cygwin,
|
||||
{version} is 62, 7, or 8.
|
||||
|
||||
libjpeg.so (Linux, Unix)
|
||||
libjpeg.dylib (OS X)
|
||||
Development symlink for the libjpeg API
|
||||
|
||||
libjpeg.dll.a (Cygwin)
|
||||
Import library for the libjpeg API
|
||||
|
||||
libturbojpeg.a
|
||||
Static link library for the TurboJPEG API
|
||||
|
||||
libturbojpeg.so.0.1.0 (Linux, Unix)
|
||||
libturbojpeg.0.1.0.dylib (OS X)
|
||||
cygturbojpeg-0.dll (Cygwin)
|
||||
Shared library for the TurboJPEG API
|
||||
|
||||
libturbojpeg.so (Linux, Unix)
|
||||
libturbojpeg.dylib (OS X)
|
||||
Development symlink for the TurboJPEG API
|
||||
|
||||
libturbojpeg.dll.a (Cygwin)
|
||||
Import library for the TurboJPEG API
|
||||
|
||||
|
||||
libjpeg v7 or v8 API/ABI Emulation
|
||||
----------------------------------
|
||||
|
||||
Add --with-jpeg7 to the configure command line to build a version of
|
||||
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.
|
||||
|
||||
|
||||
In-Memory Source/Destination Managers
|
||||
-------------------------------------
|
||||
|
||||
When using libjpeg v6b or v7 API/ABI emulation, add --without-mem-srcdst to the
|
||||
configure command line to build a version of libjpeg-turbo that lacks the
|
||||
jpeg_mem_src() and jpeg_mem_dest() functions. These functions were not part of
|
||||
the original libjpeg v6b and v7 APIs, so removing them ensures strict
|
||||
conformance with those APIs. See README-turbo.txt for more information.
|
||||
|
||||
|
||||
Arithmetic Coding Support
|
||||
-------------------------
|
||||
|
||||
Since the patent on arithmetic coding has expired, this functionality has been
|
||||
included in this release of libjpeg-turbo. libjpeg-turbo's implementation is
|
||||
based on the implementation in libjpeg v8, but it works when emulating libjpeg
|
||||
v7 or v6b as well. The default is to enable both arithmetic encoding and
|
||||
decoding, but those who have philosophical objections to arithmetic coding can
|
||||
add --without-arith-enc or --without-arith-dec to the configure command line to
|
||||
disable encoding or decoding (respectively.)
|
||||
|
||||
|
||||
TurboJPEG Java Wrapper
|
||||
----------------------
|
||||
Add --with-java to the configure command line to incorporate an optional Java
|
||||
Native Interface wrapper into the TurboJPEG shared library and build the Java
|
||||
front-end classes to support it. This allows the TurboJPEG shared library to
|
||||
be used directly from Java applications. See java/README for more details.
|
||||
|
||||
You can set the JAVAC, JAR, and JAVA configure variables to specify
|
||||
alternate commands for javac, jar, and java (respectively.) You can also
|
||||
set the JAVACFLAGS configure variable to specify arguments that should be
|
||||
passed to the Java compiler when building the front-end classes, and JNI_CFLAGS
|
||||
to specify arguments that should be passed to the C compiler when building the
|
||||
JNI wrapper. Run 'configure --help' for more details.
|
||||
|
||||
|
||||
========================
|
||||
Installing libjpeg-turbo
|
||||
========================
|
||||
|
||||
If you intend to install these libraries and the associated header files, then
|
||||
replace 'make' in the instructions above with
|
||||
|
||||
make install prefix={base dir} libdir={library directory}
|
||||
|
||||
For example,
|
||||
|
||||
make install prefix=/usr/local libdir=/usr/local/lib64
|
||||
|
||||
will install the header files in /usr/local/include and the library files in
|
||||
/usr/local/lib64. If 'prefix' and 'libdir' are not specified, then the default
|
||||
is to install the header files in /opt/libjpeg-turbo/include and the library
|
||||
files in /opt/libjpeg-turbo/lib32 (32-bit) or /opt/libjpeg-turbo/lib64
|
||||
(64-bit.)
|
||||
|
||||
NOTE: You can specify a prefix of /usr and a libdir of, for instance,
|
||||
/usr/lib64 to overwrite the system's version of libjpeg. If you do this,
|
||||
however, then be sure to BACK UP YOUR SYSTEM'S INSTALLATION OF LIBJPEG before
|
||||
overwriting it. It is recommended that you instead install libjpeg-turbo into
|
||||
a non-system directory and manipulate the LD_LIBRARY_PATH or create symlinks
|
||||
to force applications to use libjpeg-turbo instead of libjpeg. See
|
||||
README-turbo.txt for more information.
|
||||
|
||||
|
||||
=============
|
||||
Build Recipes
|
||||
=============
|
||||
|
||||
|
||||
32-bit Build on 64-bit Linux
|
||||
----------------------------
|
||||
|
||||
Add
|
||||
|
||||
--host i686-pc-linux-gnu CFLAGS='-O3 -m32' LDFLAGS=-m32
|
||||
|
||||
to the configure command line.
|
||||
|
||||
|
||||
64-bit Build on 64-bit OS X
|
||||
---------------------------
|
||||
|
||||
Add
|
||||
|
||||
--host x86_64-apple-darwin NASM=/opt/local/bin/nasm
|
||||
|
||||
to the configure command line. NASM 2.07 or later from MacPorts must be
|
||||
installed.
|
||||
|
||||
|
||||
32-bit Build on 64-bit OS X
|
||||
---------------------------
|
||||
|
||||
Add
|
||||
|
||||
--host i686-apple-darwin CFLAGS='-O3 -m32' LDFLAGS=-m32
|
||||
|
||||
to the configure command line.
|
||||
|
||||
|
||||
64-bit Backward-Compatible Build on 64-bit OS X
|
||||
-----------------------------------------------
|
||||
|
||||
Add
|
||||
|
||||
--host x86_64-apple-darwin NASM=/opt/local/bin/nasm \
|
||||
CFLAGS='-isysroot /Developer/SDKs/MacOSX10.5.sdk \
|
||||
-mmacosx-version-min=10.5 -O3' \
|
||||
LDFLAGS='-isysroot /Developer/SDKs/MacOSX10.5.sdk \
|
||||
-mmacosx-version-min=10.5'
|
||||
|
||||
to the configure command line. The OS X 10.5 SDK, and NASM 2.07 or later from
|
||||
MacPorts, must be installed.
|
||||
|
||||
|
||||
32-bit Backward-Compatible Build on OS X
|
||||
----------------------------------------
|
||||
|
||||
Add
|
||||
|
||||
--host i686-apple-darwin \
|
||||
CFLAGS='-isysroot /Developer/SDKs/MacOSX10.5.sdk \
|
||||
-mmacosx-version-min=10.5 -O3 -m32' \
|
||||
LDFLAGS='-isysroot /Developer/SDKs/MacOSX10.5.sdk \
|
||||
-mmacosx-version-min=10.5 -m32'
|
||||
|
||||
to the configure command line. The OS X 10.5 SDK must be installed.
|
||||
|
||||
|
||||
64-bit Library Build on 64-bit Solaris
|
||||
--------------------------------------
|
||||
|
||||
Add
|
||||
|
||||
--host x86_64-pc-solaris CFLAGS='-O3 -m64' LDFLAGS=-m64
|
||||
|
||||
to the configure command line.
|
||||
|
||||
|
||||
32-bit Build on 64-bit FreeBSD
|
||||
------------------------------
|
||||
|
||||
Add
|
||||
|
||||
--host i386-unknown-freebsd CC='gcc -B /usr/lib32' CFLAGS='-O3 -m32' \
|
||||
LDFLAGS='-B/usr/lib32'
|
||||
|
||||
to the configure command line. NASM 2.07 or later from FreeBSD ports must be
|
||||
installed.
|
||||
|
||||
|
||||
Oracle Solaris Studio
|
||||
---------------------
|
||||
|
||||
Add
|
||||
|
||||
CC=cc
|
||||
|
||||
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 Oracle Solaris Studio, add
|
||||
|
||||
--host x86_64-pc-solaris CC=cc CFLAGS='-xO5 -m64' LDFLAGS=-m64
|
||||
|
||||
to the configure command line.
|
||||
|
||||
|
||||
MinGW Build on Cygwin
|
||||
---------------------
|
||||
|
||||
Use CMake (see recipes below)
|
||||
|
||||
|
||||
===========
|
||||
ARM Support
|
||||
===========
|
||||
|
||||
This release of libjpeg-turbo can use ARM NEON SIMD instructions to accelerate
|
||||
JPEG compression/decompression by approximately 2-4x on ARMv7 and later
|
||||
platforms. If libjpeg-turbo is configured on an ARM Linux platform, then the
|
||||
build system will automatically include the NEON SIMD routines, if they are
|
||||
supported. Build instructions for other ARM-based platforms follow.
|
||||
|
||||
|
||||
Building libjpeg-turbo for iOS
|
||||
------------------------------
|
||||
|
||||
iOS platforms, such as the iPhone and iPad, use ARM processors, some of which
|
||||
support NEON instructions. Additional steps are required in order to build
|
||||
libjpeg-turbo for these platforms.
|
||||
|
||||
Additional build requirements:
|
||||
|
||||
gas-preprocessor.pl
|
||||
(https://sourceforge.net/p/libjpeg-turbo/code/HEAD/tree/gas-preprocessor)
|
||||
should be installed in your PATH.
|
||||
|
||||
|
||||
ARM 32-bit Build (Xcode 4.6.x and earlier, LLVM-GCC):
|
||||
|
||||
Set the following shell variables for simplicity:
|
||||
|
||||
Xcode 4.2 and earlier:
|
||||
IOS_PLATFORMDIR=/Developer/Platforms/iPhoneOS.platform
|
||||
Xcode 4.3 and later:
|
||||
IOS_PLATFORMDIR=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform
|
||||
|
||||
IOS_SYSROOT=$IOS_PLATFORMDIR/Developer/SDKs/iPhoneOS*.sdk
|
||||
IOS_GCC=$IOS_PLATFORMDIR/Developer/usr/bin/arm-apple-darwin10-llvm-gcc-4.2
|
||||
|
||||
ARMv6 (code will run on all iOS devices, not SIMD-accelerated):
|
||||
[NOTE: Requires Xcode 4.4.x or earlier]
|
||||
IOS_CFLAGS="-march=armv6 -mcpu=arm1176jzf-s -mfpu=vfp"
|
||||
|
||||
ARMv7 (code will run on iPhone 3GS-4S/iPad 1st-3rd Generation and newer):
|
||||
IOS_CFLAGS="-march=armv7 -mcpu=cortex-a8 -mtune=cortex-a8 -mfpu=neon"
|
||||
|
||||
ARMv7s (code will run on iPhone 5/iPad 4th Generation and newer):
|
||||
[NOTE: Requires Xcode 4.5 or later]
|
||||
IOS_CFLAGS="-march=armv7s -mcpu=swift -mtune=swift -mfpu=neon"
|
||||
|
||||
Follow the procedure under "Building libjpeg-turbo" above, adding
|
||||
|
||||
--host arm-apple-darwin10 \
|
||||
CC="$IOS_GCC" LD="$IOS_GCC" \
|
||||
CFLAGS="-mfloat-abi=softfp -isysroot $IOS_SYSROOT -O3 $IOS_CFLAGS" \
|
||||
LDFLAGS="-mfloat-abi=softfp -isysroot $IOS_SYSROOT $IOS_CFLAGS"
|
||||
|
||||
to the configure command line.
|
||||
|
||||
|
||||
ARM 32-bit Build (Xcode 5.0.x and later, Clang):
|
||||
|
||||
Set the following shell variables for simplicity:
|
||||
|
||||
IOS_PLATFORMDIR=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform
|
||||
IOS_SYSROOT=$IOS_PLATFORMDIR/Developer/SDKs/iPhoneOS*.sdk
|
||||
IOS_GCC=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
|
||||
|
||||
ARMv7 (code will run on iPhone 3GS-4S/iPad 1st-3rd Generation and newer):
|
||||
IOS_CFLAGS="-arch armv7"
|
||||
|
||||
ARMv7s (code will run on iPhone 5/iPad 4th Generation and newer):
|
||||
IOS_CFLAGS="-arch armv7s"
|
||||
|
||||
Follow the procedure under "Building libjpeg-turbo" above, adding
|
||||
|
||||
--host arm-apple-darwin10 \
|
||||
CC="$IOS_GCC" LD="$IOS_GCC" \
|
||||
CFLAGS="-mfloat-abi=softfp -isysroot $IOS_SYSROOT -O3 $IOS_CFLAGS" \
|
||||
LDFLAGS="-mfloat-abi=softfp -isysroot $IOS_SYSROOT $IOS_CFLAGS" \
|
||||
CCASFLAGS="-no-integrated-as $IOS_CFLAGS"
|
||||
|
||||
to the configure command line.
|
||||
|
||||
|
||||
ARMv8 64-bit Build (Xcode 5.0.x and later, Clang):
|
||||
|
||||
Code will run on iPhone 5S/iPad Mini 2/iPad Air and newer.
|
||||
|
||||
Set the following shell variables for simplicity:
|
||||
|
||||
IOS_PLATFORMDIR=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform
|
||||
IOS_SYSROOT=$IOS_PLATFORMDIR/Developer/SDKs/iPhoneOS*.sdk
|
||||
IOS_GCC=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
|
||||
IOS_CFLAGS="-arch arm64"
|
||||
|
||||
Follow the procedure under "Building libjpeg-turbo" above, adding
|
||||
|
||||
--host aarch64-apple-darwin \
|
||||
CC="$IOS_GCC" LD="$IOS_GCC" \
|
||||
CFLAGS="-isysroot $IOS_SYSROOT -O3 $IOS_CFLAGS" \
|
||||
LDFLAGS="-isysroot $IOS_SYSROOT $IOS_CFLAGS"
|
||||
|
||||
to the configure command line.
|
||||
|
||||
|
||||
NOTE: You can also add -miphoneos-version-min={version} to $IOS_CFLAGS above
|
||||
in order to support older versions of iOS than the default version supported by
|
||||
the SDK.
|
||||
|
||||
Once built, lipo can be used to combine the ARMv6, v7, v7s, and/or v8 variants
|
||||
into a universal library.
|
||||
|
||||
NOTE: If you are building libjpeg-turbo from the "official" project tarball,
|
||||
then it is highly likely that you will need to run 'autoreconf -fiv' in the
|
||||
source tree prior to building ARMv7, v7s, or v8 iOS binaries using the
|
||||
techniques described above. Otherwise, you may get a libtool error such as
|
||||
"unable to infer tagged configuration."
|
||||
|
||||
|
||||
Building libjpeg-turbo for Android
|
||||
----------------------------------
|
||||
|
||||
Building libjpeg-turbo for Android platforms requires the Android NDK
|
||||
(https://developer.android.com/tools/sdk/ndk) and autotools. The following is
|
||||
a general recipe script that can be modified for your specific needs.
|
||||
|
||||
# Set these variables to suit your needs
|
||||
NDK_PATH={full path to the "ndk" directory-- for example, /opt/android/ndk}
|
||||
BUILD_PLATFORM={the platform name for the NDK package you installed--
|
||||
for example, "windows-x86" or "linux-x86_64"}
|
||||
TOOLCHAIN_VERSION={"4.6", "4.8", etc. This corresponds to a toolchain
|
||||
directory under ${NDK_PATH}/toolchains/.}
|
||||
ANDROID_VERSION={The minimum version of Android to support-- for example,
|
||||
"9", "19", etc.}
|
||||
|
||||
HOST=arm-linux-androideabi
|
||||
TOOLCHAIN=${NDK_PATH}/toolchains/${HOST}-${TOOLCHAIN_VERSION}/prebuilt/${BUILD_PLATFORM}
|
||||
SYSROOT=${NDK_PATH}/platforms/android-${ANDROID_VERSION}/arch-arm
|
||||
ANDROID_INCLUDES="-I${SYSROOT}/usr/include -I${TOOLCHAIN}/include"
|
||||
ANDROID_CFLAGS="-march=armv7-a -mfloat-abi=softfp -fprefetch-loop-arrays \
|
||||
-fstrict-aliasing --sysroot=${SYSROOT}"
|
||||
export CPP=${TOOLCHAIN}/bin/${HOST}-cpp
|
||||
export AR=${TOOLCHAIN}/bin/${HOST}-ar
|
||||
export AS=${TOOLCHAIN}/bin/${HOST}-as
|
||||
export NM=${TOOLCHAIN}/bin/${HOST}-nm
|
||||
export CC=${TOOLCHAIN}/bin/${HOST}-gcc
|
||||
export LD=${TOOLCHAIN}/bin/${HOST}-ld
|
||||
export RANLIB=${TOOLCHAIN}/bin/${HOST}-ranlib
|
||||
export OBJDUMP=${TOOLCHAIN}/bin/${HOST}-objdump
|
||||
export STRIP=${TOOLCHAIN}/bin/${HOST}-strip
|
||||
cd {build_directory}
|
||||
sh {source_directory}/configure --host=${HOST} \
|
||||
CFLAGS="${ANDROID_INCLUDES} ${ANDROID_CFLAGS} -O3" \
|
||||
CPPFLAGS="${ANDROID_INCLUDES} ${ANDROID_CFLAGS}" \
|
||||
LDFLAGS="${ANDROID_CFLAGS}" --with-simd ${1+"$@"}
|
||||
make
|
||||
|
||||
|
||||
*******************************************************************************
|
||||
** Building on Windows (Visual C++ or MinGW)
|
||||
*******************************************************************************
|
||||
|
||||
|
||||
==================
|
||||
Build Requirements
|
||||
==================
|
||||
|
||||
-- CMake (http://www.cmake.org) v2.8.8 or later
|
||||
|
||||
-- Microsoft Visual C++ 2005 or later
|
||||
|
||||
If you don't already have Visual C++, then the easiest way to get it is by
|
||||
installing the Windows SDK:
|
||||
|
||||
http://msdn.microsoft.com/en-us/windows/bb980924.aspx
|
||||
|
||||
The Windows SDK includes both 32-bit and 64-bit Visual C++ compilers and
|
||||
everything necessary to build libjpeg-turbo.
|
||||
|
||||
* You can also use Microsoft Visual Studio Express Edition, which is a free
|
||||
download. (NOTE: versions prior to 2012 can only be used to build 32-bit
|
||||
code.)
|
||||
* If you intend to build libjpeg-turbo from the command line, then add the
|
||||
appropriate compiler and SDK directories to the INCLUDE, LIB, and PATH
|
||||
environment variables. This is generally accomplished by executing
|
||||
vcvars32.bat or vcvars64.bat and SetEnv.cmd. vcvars32.bat and
|
||||
vcvars64.bat are part of Visual C++ and are located in the same directory
|
||||
as the compiler. SetEnv.cmd is part of the Windows SDK. You can pass
|
||||
optional arguments to SetEnv.cmd to specify a 32-bit or 64-bit build
|
||||
environment.
|
||||
|
||||
... OR ...
|
||||
|
||||
-- MinGW
|
||||
|
||||
MinGW-builds (http://sourceforge.net/projects/mingwbuilds/) or
|
||||
tdm-gcc (http://tdm-gcc.tdragon.net/) recommended if building on a Windows
|
||||
machine. Both distributions install a Start Menu link that can be used to
|
||||
launch a command prompt with the appropriate compiler paths automatically
|
||||
set.
|
||||
|
||||
-- NASM (http://www.nasm.us/) 0.98 or later (NASM 2.05 or later is required for
|
||||
a 64-bit build)
|
||||
|
||||
-- If building the TurboJPEG Java wrapper, JDK 1.5 or later is required. This
|
||||
can be downloaded from http://www.java.com.
|
||||
|
||||
|
||||
==================
|
||||
Out-of-Tree Builds
|
||||
==================
|
||||
|
||||
Binary objects, libraries, and executables are generated in the same directory
|
||||
from which cmake was executed (the "binary directory"), and this directory need
|
||||
not necessarily be the same as the libjpeg-turbo source directory. You can
|
||||
create multiple independent binary directories, in which different versions of
|
||||
libjpeg-turbo can be built from the same source tree using different compilers
|
||||
or settings. In the sections below, {build_directory} refers to the binary
|
||||
directory, whereas {source_directory} refers to the libjpeg-turbo source
|
||||
directory. For in-tree builds, these directories are the same.
|
||||
|
||||
|
||||
======================
|
||||
Building libjpeg-turbo
|
||||
======================
|
||||
|
||||
|
||||
Visual C++ (Command Line)
|
||||
-------------------------
|
||||
|
||||
cd {build_directory}
|
||||
cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release {source_directory}
|
||||
nmake
|
||||
|
||||
This will build either a 32-bit or a 64-bit version of libjpeg-turbo, depending
|
||||
on which version of cl.exe is in the PATH.
|
||||
|
||||
The following files will be generated under {build_directory}:
|
||||
|
||||
jpeg-static.lib
|
||||
Static link library for the libjpeg API
|
||||
sharedlib/jpeg{version}.dll
|
||||
DLL for the libjpeg API
|
||||
sharedlib/jpeg.lib
|
||||
Import library for the libjpeg API
|
||||
turbojpeg-static.lib
|
||||
Static link library for the TurboJPEG API
|
||||
turbojpeg.dll
|
||||
DLL for the TurboJPEG API
|
||||
turbojpeg.lib
|
||||
Import library for the TurboJPEG API
|
||||
|
||||
{version} is 62, 7, or 8, depending on whether libjpeg v6b (default), v7, or
|
||||
v8 emulation is enabled.
|
||||
|
||||
|
||||
Visual C++ (IDE)
|
||||
----------------
|
||||
|
||||
Choose the appropriate CMake generator option for your version of Visual Studio
|
||||
(run "cmake" with no arguments for a list of available generators.) For
|
||||
instance:
|
||||
|
||||
cd {build_directory}
|
||||
cmake -G "Visual Studio 10" {source_directory}
|
||||
|
||||
NOTE: Add "Win64" to the generator name (for example, "Visual Studio 10
|
||||
Win64") to build a 64-bit version of libjpeg-turbo. Recent versions of CMake
|
||||
no longer document that. A separate build directory must be used for 32-bit
|
||||
and 64-bit builds.
|
||||
|
||||
You can then open ALL_BUILD.vcproj in Visual Studio and build one of the
|
||||
configurations in that project ("Debug", "Release", etc.) to generate a full
|
||||
build of libjpeg-turbo.
|
||||
|
||||
This will generate the following files under {build_directory}:
|
||||
|
||||
{configuration}/jpeg-static.lib
|
||||
Static link library for the libjpeg API
|
||||
sharedlib/{configuration}/jpeg{version}.dll
|
||||
DLL for the libjpeg API
|
||||
sharedlib/{configuration}/jpeg.lib
|
||||
Import library for the libjpeg API
|
||||
{configuration}/turbojpeg-static.lib
|
||||
Static link library for the TurboJPEG API
|
||||
{configuration}/turbojpeg.dll
|
||||
DLL for the TurboJPEG API
|
||||
{configuration}/turbojpeg.lib
|
||||
Import library for the TurboJPEG API
|
||||
|
||||
{configuration} is Debug, Release, RelWithDebInfo, or MinSizeRel, depending on
|
||||
the configuration you built in the IDE, and {version} is 62, 7, or 8,
|
||||
depending on whether libjpeg v6b (default), v7, or v8 emulation is enabled.
|
||||
|
||||
|
||||
MinGW
|
||||
-----
|
||||
|
||||
NOTE: This assumes that you are building on a Windows machine. If you are
|
||||
cross-compiling on a Linux/Unix machine, then see "Build Recipes" below.
|
||||
|
||||
cd {build_directory}
|
||||
cmake -G "MinGW Makefiles" {source_directory}
|
||||
mingw32-make
|
||||
|
||||
This will generate the following files under {build_directory}
|
||||
|
||||
libjpeg.a
|
||||
Static link library for the libjpeg API
|
||||
sharedlib/libjpeg-{version}.dll
|
||||
DLL for the libjpeg API
|
||||
sharedlib/libjpeg.dll.a
|
||||
Import library for the libjpeg API
|
||||
libturbojpeg.a
|
||||
Static link library for the TurboJPEG API
|
||||
libturbojpeg.dll
|
||||
DLL for the TurboJPEG API
|
||||
libturbojpeg.dll.a
|
||||
Import library for the TurboJPEG API
|
||||
|
||||
{version} is 62, 7, or 8, depending on whether libjpeg v6b (default), v7, or
|
||||
v8 emulation is enabled.
|
||||
|
||||
|
||||
Debug Build
|
||||
-----------
|
||||
|
||||
Add "-DCMAKE_BUILD_TYPE=Debug" to the cmake command line. Or, if building with
|
||||
NMake, remove "-DCMAKE_BUILD_TYPE=Release" (Debug builds are the default with
|
||||
NMake.)
|
||||
|
||||
|
||||
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 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.
|
||||
|
||||
|
||||
In-Memory Source/Destination Managers
|
||||
-------------------------------------
|
||||
|
||||
When using libjpeg v6b or v7 API/ABI emulation, add -DWITH_MEM_SRCDST=0 to the
|
||||
CMake command line to build a version of libjpeg-turbo that lacks the
|
||||
jpeg_mem_src() and jpeg_mem_dest() functions. These functions were not part of
|
||||
the original libjpeg v6b and v7 APIs, so removing them ensures strict
|
||||
conformance with those APIs. See README-turbo.txt for more information.
|
||||
|
||||
|
||||
Arithmetic Coding Support
|
||||
-------------------------
|
||||
|
||||
Since the patent on arithmetic coding has expired, this functionality has been
|
||||
included in this release of libjpeg-turbo. libjpeg-turbo's implementation is
|
||||
based on the implementation in libjpeg v8, but it works when emulating libjpeg
|
||||
v7 or v6b as well. The default is to enable both arithmetic encoding and
|
||||
decoding, but those who have philosophical objections to arithmetic coding can
|
||||
add "-DWITH_ARITH_ENC=0" or "-DWITH_ARITH_DEC=0" to the cmake command line to
|
||||
disable encoding or decoding (respectively.)
|
||||
|
||||
|
||||
TurboJPEG Java Wrapper
|
||||
----------------------
|
||||
Add "-DWITH_JAVA=1" to the cmake command line to incorporate an optional Java
|
||||
Native Interface wrapper into the TurboJPEG shared library and build the Java
|
||||
front-end classes to support it. This allows the TurboJPEG shared library to
|
||||
be used directly from Java applications. See java/README for more details.
|
||||
|
||||
If you are using CMake 2.8, you can set the Java_JAVAC_EXECUTABLE,
|
||||
Java_JAVA_EXECUTABLE, and Java_JAR_EXECUTABLE CMake variables to specify
|
||||
alternate commands or locations for javac, jar, and java (respectively.) If
|
||||
you are using CMake 2.6, set JAVA_COMPILE, JAVA_RUNTIME, and JAVA_ARCHIVE
|
||||
instead. You can also set the JAVACFLAGS CMake variable to specify arguments
|
||||
that should be passed to the Java compiler when building the front-end classes.
|
||||
|
||||
|
||||
========================
|
||||
Installing libjpeg-turbo
|
||||
========================
|
||||
|
||||
You can use the build system to install libjpeg-turbo into a directory of your
|
||||
choosing (as opposed to creating an installer.) To do this, add:
|
||||
|
||||
-DCMAKE_INSTALL_PREFIX={install_directory}
|
||||
|
||||
to the cmake command line.
|
||||
|
||||
For example,
|
||||
|
||||
cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_INSTALL_PREFIX=c:\libjpeg-turbo {source_directory}
|
||||
nmake install
|
||||
|
||||
will install the header files in c:\libjpeg-turbo\include, the library files
|
||||
in c:\libjpeg-turbo\lib, the DLL's in c:\libjpeg-turbo\bin, and the
|
||||
documentation in c:\libjpeg-turbo\doc.
|
||||
|
||||
|
||||
=============
|
||||
Build Recipes
|
||||
=============
|
||||
|
||||
|
||||
64-bit MinGW Build on Cygwin
|
||||
----------------------------
|
||||
|
||||
cd {build_directory}
|
||||
CC=/usr/bin/x86_64-w64-mingw32-gcc \
|
||||
cmake -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Windows \
|
||||
-DCMAKE_RC_COMPILER=/usr/bin/x86_64-w64-mingw32-windres.exe \
|
||||
{source_directory}
|
||||
make
|
||||
|
||||
This produces a 64-bit build of libjpeg-turbo that does not depend on
|
||||
cygwin1.dll or other Cygwin DLL's. The mingw64-x86_64-gcc-core and
|
||||
mingw64-x86_64-gcc-g++ packages (and their dependencies) must be installed.
|
||||
|
||||
|
||||
32-bit MinGW Build on Cygwin
|
||||
----------------------------
|
||||
|
||||
cd {build_directory}
|
||||
CC=/usr/bin/i686-w64-mingw32-gcc \
|
||||
cmake -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Windows \
|
||||
-DCMAKE_RC_COMPILER=/usr/bin/i686-w64-mingw32-windres.exe \
|
||||
{source_directory}
|
||||
make
|
||||
|
||||
This produces a 32-bit build of libjpeg-turbo that does not depend on
|
||||
cygwin1.dll or other Cygwin DLL's. The mingw64-i686-gcc-core and
|
||||
mingw64-i686-gcc-g++ packages (and their dependencies) must be installed.
|
||||
|
||||
|
||||
MinGW Build on Linux
|
||||
--------------------
|
||||
|
||||
cd {build_directory}
|
||||
CC={mingw_binary_path}/i386-mingw32-gcc \
|
||||
cmake -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Windows \
|
||||
-DCMAKE_AR={mingw_binary_path}/i386-mingw32-ar \
|
||||
-DCMAKE_RANLIB={mingw_binary_path}/i386-mingw32-ranlib \
|
||||
{source_directory}
|
||||
make
|
||||
|
||||
|
||||
*******************************************************************************
|
||||
** Creating Release Packages
|
||||
*******************************************************************************
|
||||
|
||||
The following commands can be used to create various types of release packages:
|
||||
|
||||
|
||||
Unix/Linux
|
||||
----------
|
||||
|
||||
make rpm
|
||||
|
||||
Create Red Hat-style binary RPM package. Requires RPM v4 or later.
|
||||
|
||||
make srpm
|
||||
|
||||
This runs 'make dist' to create a pristine source tarball, then creates a
|
||||
Red Hat-style source RPM package from the tarball. Requires RPM v4 or later.
|
||||
|
||||
make deb
|
||||
|
||||
Create Debian-style binary package. Requires dpkg.
|
||||
|
||||
make dmg
|
||||
|
||||
Create Macintosh package/disk image. This requires pkgbuild and
|
||||
productbuild, which are installed by default on OS X 10.7 and later and which
|
||||
can be obtained by installing Xcode 3.2.6 (with the "Unix Development"
|
||||
option) on OS X 10.6. Packages built in this manner can be installed on OS X
|
||||
10.5 and later, but they must be built on OS X 10.6 or later.
|
||||
|
||||
make udmg [BUILDDIR32={32-bit build directory}]
|
||||
|
||||
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={ARMv6 build directory}] \
|
||||
[BUILDDIRARMV7={ARMv7 build directory}] \
|
||||
[BUILDDIRARMV7S={ARMv7s build directory}] \
|
||||
[BUILDDIRARMV8={ARMv8 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 ARMv6, ARMv7, ARMv7s, and/or ARMv8 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 ARMv6 build under
|
||||
{source_directory}/iosarmv6 by default, the ARMv7 build under
|
||||
{source_directory}/iosarmv7 by default, the ARMv7s build under
|
||||
{source_directory}/iosarmv7s by default, the ARMv8 build under
|
||||
{source_directory}/iosarmv8 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, BUILDDIRARMV7, BUILDDIRARMV7S, and/or
|
||||
BUILDDIRARMV8 variables on the make command line as shown above.
|
||||
|
||||
NOTE: If including an ARMv8 build in the package, then you may need to use
|
||||
Xcode's version of lipo instead of the operating system's. To do this, pass
|
||||
an argument of LIPO="xcrun lipo" on the make command line.
|
||||
|
||||
make cygwinpkg
|
||||
|
||||
Build a Cygwin binary package.
|
||||
|
||||
|
||||
Windows
|
||||
-------
|
||||
|
||||
If using NMake:
|
||||
|
||||
cd {build_directory}
|
||||
nmake installer
|
||||
|
||||
If using MinGW:
|
||||
|
||||
cd {build_directory}
|
||||
make installer
|
||||
|
||||
If using the Visual Studio IDE, build the "installer" project.
|
||||
|
||||
The installer package (libjpeg-turbo[-gcc][64].exe) will be located under
|
||||
{build_directory}. If building using the Visual Studio IDE, then the installer
|
||||
package will be located in a subdirectory with the same name as the
|
||||
configuration you built (such as {build_directory}\Debug\ or
|
||||
{build_directory}\Release\).
|
||||
|
||||
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 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 API library.
|
||||
436
CMakeLists.txt
436
CMakeLists.txt
@@ -2,32 +2,39 @@
|
||||
# Setup
|
||||
#
|
||||
|
||||
cmake_minimum_required(VERSION 2.8.8)
|
||||
cmake_minimum_required(VERSION 2.8.11)
|
||||
# Use LINK_INTERFACE_LIBRARIES instead of INTERFACE_LINK_LIBRARIES
|
||||
if(POLICY CMP0022)
|
||||
cmake_policy(SET CMP0022 OLD)
|
||||
endif()
|
||||
|
||||
project(libjpeg-turbo C)
|
||||
set(VERSION 1.4.1)
|
||||
|
||||
if(CYGWIN OR NOT CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
|
||||
execute_process(COMMAND "date" "+%Y%m%d" OUTPUT_VARIABLE BUILD)
|
||||
string(REGEX REPLACE "\n" "" BUILD ${BUILD})
|
||||
elseif(WIN32)
|
||||
execute_process(COMMAND "wmic.exe" "os" "get" "LocalDateTime" OUTPUT_VARIABLE
|
||||
BUILD)
|
||||
string(REGEX REPLACE "[^0-9]" "" BUILD "${BUILD}")
|
||||
if (BUILD STREQUAL "")
|
||||
execute_process(COMMAND "cmd.exe" "/C" "DATE" "/T" OUTPUT_VARIABLE BUILD)
|
||||
string(REGEX REPLACE ".*[ ]([0-9]*)[/.]([0-9]*)[/.]([0-9]*).*" "\\3\\2\\1" BUILD "${BUILD}")
|
||||
else()
|
||||
string(SUBSTRING "${BUILD}" 0 8 BUILD)
|
||||
set(VERSION 1.5.2)
|
||||
string(REPLACE "." ";" VERSION_TRIPLET ${VERSION})
|
||||
list(GET VERSION_TRIPLET 0 VERSION_MAJOR)
|
||||
list(GET VERSION_TRIPLET 1 VERSION_MINOR)
|
||||
list(GET VERSION_TRIPLET 2 VERSION_REVISION)
|
||||
function(pad_number NUMBER OUTPUT_LEN)
|
||||
string(LENGTH "${${NUMBER}}" INPUT_LEN)
|
||||
if(INPUT_LEN LESS OUTPUT_LEN)
|
||||
math(EXPR ZEROES "${OUTPUT_LEN} - ${INPUT_LEN} - 1")
|
||||
set(NUM ${${NUMBER}})
|
||||
foreach(C RANGE ${ZEROES})
|
||||
set(NUM "0${NUM}")
|
||||
endforeach()
|
||||
set(${NUMBER} ${NUM} PARENT_SCOPE)
|
||||
endif()
|
||||
else()
|
||||
endfunction()
|
||||
pad_number(VERSION_MINOR 3)
|
||||
pad_number(VERSION_REVISION 3)
|
||||
set(LIBJPEG_TURBO_VERSION_NUMBER ${VERSION_MAJOR}${VERSION_MINOR}${VERSION_REVISION})
|
||||
|
||||
if(NOT WIN32)
|
||||
message(FATAL_ERROR "Platform not supported by this build system. Use autotools instead.")
|
||||
endif()
|
||||
|
||||
string(TIMESTAMP BUILD "%Y%m%d")
|
||||
|
||||
# This does nothing except when using MinGW. CMAKE_BUILD_TYPE has no meaning
|
||||
# in Visual Studio, and it always defaults to Debug when using NMake.
|
||||
if(NOT CMAKE_BUILD_TYPE)
|
||||
@@ -45,8 +52,8 @@ endif()
|
||||
message(STATUS "VERSION = ${VERSION}, BUILD = ${BUILD}")
|
||||
|
||||
option(WITH_SIMD "Include SIMD extensions" TRUE)
|
||||
option(WITH_ARITH_ENC "Include arithmetic encoding support" TRUE)
|
||||
option(WITH_ARITH_DEC "Include arithmetic decoding support" TRUE)
|
||||
option(WITH_ARITH_ENC "Include arithmetic encoding support when emulating the libjpeg v6b API/ABI" TRUE)
|
||||
option(WITH_ARITH_DEC "Include arithmetic decoding support when emulating the libjpeg v6b API/ABI" TRUE)
|
||||
option(WITH_JPEG7 "Emulate libjpeg v7 API/ABI (this makes libjpeg-turbo backward incompatible with libjpeg v6b)" FALSE)
|
||||
option(WITH_JPEG8 "Emulate libjpeg v8 API/ABI (this makes libjpeg-turbo backward incompatible with libjpeg v6b)" FALSE)
|
||||
option(WITH_MEM_SRCDST "Include in-memory source/destination manager functions when emulating the libjpeg v6b or v7 API/ABI" TRUE)
|
||||
@@ -59,6 +66,7 @@ option(ENABLE_SHARED "Build shared libraries" TRUE)
|
||||
if(WITH_12BIT)
|
||||
set(WITH_SIMD FALSE)
|
||||
set(WITH_TURBOJPEG FALSE)
|
||||
set(WITH_JAVA FALSE)
|
||||
set(WITH_ARITH_ENC FALSE)
|
||||
set(WITH_ARITH_DEC FALSE)
|
||||
set(BITS_IN_JSAMPLE 12)
|
||||
@@ -67,6 +75,14 @@ else()
|
||||
set(BITS_IN_JSAMPLE 8)
|
||||
endif()
|
||||
|
||||
if(WITH_JPEG8 OR WITH_JPEG7)
|
||||
set(WITH_ARITH_ENC 1)
|
||||
set(WITH_ARITH_DEC 1)
|
||||
endif()
|
||||
if(WITH_JPEG8)
|
||||
set(WITH_MEM_SRCDST 1)
|
||||
endif()
|
||||
|
||||
if(WITH_ARITH_ENC)
|
||||
set(C_ARITH_CODING_SUPPORTED 1)
|
||||
message(STATUS "Arithmetic encoding support enabled")
|
||||
@@ -172,6 +188,14 @@ configure_file(win/jconfigint.h.in jconfigint.h)
|
||||
|
||||
include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_SOURCE_DIR})
|
||||
|
||||
string(TOUPPER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_UC)
|
||||
|
||||
set(EFFECTIVE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE_UC}}")
|
||||
message(STATUS "Compiler flags = ${EFFECTIVE_C_FLAGS}")
|
||||
|
||||
set(EFFECTIVE_LD_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS_${CMAKE_BUILD_TYPE_UC}}")
|
||||
message(STATUS "Linker flags = ${EFFECTIVE_LD_FLAGS}")
|
||||
|
||||
if(WITH_JAVA)
|
||||
find_package(Java)
|
||||
find_package(JNI)
|
||||
@@ -290,8 +314,8 @@ if(WITH_12BIT)
|
||||
set(COMPILE_FLAGS "-DGIF_SUPPORTED -DPPM_SUPPORTED -DUSE_SETMODE")
|
||||
else()
|
||||
set(COMPILE_FLAGS "-DBMP_SUPPORTED -DGIF_SUPPORTED -DPPM_SUPPORTED -DTARGA_SUPPORTED -DUSE_SETMODE")
|
||||
set(CJPEG_BMP_SOURCES rdbmp.c rdtarga.c)
|
||||
set(DJPEG_BMP_SOURCES wrbmp.c wrtarga.c)
|
||||
set(CJPEG_BMP_SOURCES rdbmp.c rdtarga.c)
|
||||
set(DJPEG_BMP_SOURCES wrbmp.c wrtarga.c)
|
||||
endif()
|
||||
|
||||
if(ENABLE_STATIC)
|
||||
@@ -319,6 +343,8 @@ add_executable(wrjpgcom wrjpgcom.c)
|
||||
# Tests
|
||||
#
|
||||
|
||||
add_subdirectory(md5)
|
||||
|
||||
if(MSVC_IDE)
|
||||
set(OBJDIR "\${CTEST_CONFIGURATION_TYPE}/")
|
||||
else()
|
||||
@@ -341,8 +367,20 @@ if(WITH_12BIT)
|
||||
set(MD5_PPM_GRAY_ISLOW 7213c10af507ad467da5578ca5ee1fca)
|
||||
set(MD5_PPM_GRAY_ISLOW_RGB e96ee81c30a6ed422d466338bd3de65d)
|
||||
set(MD5_JPEG_420S_IFAST_OPT 7af8e60be4d9c227ec63ac9b6630855e)
|
||||
set(MD5_JPEG_3x2_FLOAT_PROG a8c17daf77b457725ec929e215b603f8)
|
||||
set(MD5_PPM_3x2_FLOAT 42876ab9e5c2f76a87d08db5fbd57956)
|
||||
if(64BIT)
|
||||
# Windows/x64 uses SSE for floating point
|
||||
set(MD5_JPEG_3x2_FLOAT_PROG a8c17daf77b457725ec929e215b603f8)
|
||||
set(MD5_PPM_3x2_FLOAT 42876ab9e5c2f76a87d08db5fbd57956)
|
||||
else()
|
||||
# Windows/x86 uses the 387 FPU for floating point
|
||||
if(MSVC)
|
||||
set(MD5_JPEG_3x2_FLOAT_PROG e27840755870fa849872e58aa0cd1400)
|
||||
set(MD5_PPM_3x2_FLOAT 6c2880b83bb1aa41dfe330e7a9768690)
|
||||
else()
|
||||
set(MD5_JPEG_3x2_FLOAT_PROG bc6dbbefac2872f6b9d6c4a0ae60c3c0)
|
||||
set(MD5_PPM_3x2_FLOAT f58119ee294198ac9b4a9f5645a34266)
|
||||
endif()
|
||||
endif()
|
||||
set(MD5_PPM_420M_ISLOW_2_1 4ca6be2a6f326ff9eaab63e70a8259c0)
|
||||
set(MD5_PPM_420M_ISLOW_15_8 12aa9f9534c1b3d7ba047322226365eb)
|
||||
set(MD5_PPM_420M_ISLOW_13_8 f7e22817c7b25e1393e4ec101e9d4e96)
|
||||
@@ -355,6 +393,10 @@ if(WITH_12BIT)
|
||||
set(MD5_PPM_420M_ISLOW_3_8 343d19015531b7bbe746124127244fa8)
|
||||
set(MD5_PPM_420M_ISLOW_1_4 35fd59d866e44659edfa3c18db2a3edb)
|
||||
set(MD5_PPM_420M_ISLOW_1_8 ccaed48ac0aedefda5d4abe4013f4ad7)
|
||||
set(MD5_PPM_420_ISLOW_SKIP15_31 86664cd9dc956536409e44e244d20a97)
|
||||
set(MD5_PPM_420_ISLOW_PROG_CROP62x62_71_71 452a21656115a163029cfba5c04fa76a)
|
||||
set(MD5_PPM_444_ISLOW_SKIP1_6 ef63901f71ef7a75cd78253fc0914f84)
|
||||
set(MD5_PPM_444_ISLOW_PROG_CROP98x98_13_13 15b173fb5872d9575572fbcc1b05956f)
|
||||
set(MD5_JPEG_CROP cdb35ff4b4519392690ea040c56ea99c)
|
||||
else()
|
||||
set(TESTORIG testorig.jpg)
|
||||
@@ -380,8 +422,18 @@ else()
|
||||
set(MD5_JPEG_3x2_FLOAT_PROG 343e3f8caf8af5986ebaf0bdc13b5c71)
|
||||
set(MD5_PPM_3x2_FLOAT 1a75f36e5904d6fc3a85a43da9ad89bb)
|
||||
else()
|
||||
set(MD5_JPEG_3x2_FLOAT_PROG 9bca803d2042bd1eb03819e2bf92b3e5)
|
||||
set(MD5_PPM_3x2_FLOAT f6bfab038438ed8f5522fbd33595dcdc)
|
||||
if(64BIT)
|
||||
set(MD5_JPEG_3x2_FLOAT_PROG 9bca803d2042bd1eb03819e2bf92b3e5)
|
||||
set(MD5_PPM_3x2_FLOAT f6bfab038438ed8f5522fbd33595dcdc)
|
||||
else()
|
||||
if(MSVC)
|
||||
set(MD5_JPEG_3x2_FLOAT_PROG 7999ce9cd0ee9b6c7043b7351ab7639d)
|
||||
set(MD5_PPM_3x2_FLOAT 28cdc448a6b75e97892f0e0f8d4b21f3)
|
||||
else()
|
||||
set(MD5_JPEG_3x2_FLOAT_PROG 1657664a410e0822c924b54f6f65e6e9)
|
||||
set(MD5_PPM_3x2_FLOAT cb0a1f027f3d2917c902b5640214e025)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
set(MD5_JPEG_420_ISLOW_ARI e986fb0a637a8d833d96e8a6d6d84ea1)
|
||||
set(MD5_JPEG_444_ISLOW_PROGARI 0a8f1c8f66e113c3cf635df0a475a617)
|
||||
@@ -404,6 +456,13 @@ else()
|
||||
set(MD5_BMP_420_ISLOW_565D 6bde71526acc44bcff76f696df8638d2)
|
||||
set(MD5_BMP_420M_ISLOW_565 8dc0185245353cfa32ad97027342216f)
|
||||
set(MD5_BMP_420M_ISLOW_565D d1be3a3339166255e76fa50a0d70d73e)
|
||||
set(MD5_PPM_420_ISLOW_SKIP15_31 c4c65c1e43d7275cd50328a61e6534f0)
|
||||
set(MD5_PPM_420_ISLOW_ARI_SKIP16_139 087c6b123db16ac00cb88c5b590bb74a)
|
||||
set(MD5_PPM_420_ISLOW_PROG_CROP62x62_71_71 26eb36ccc7d1f0cb80cdabb0ac8b5d99)
|
||||
set(MD5_PPM_420_ISLOW_ARI_CROP53x53_4_4 886c6775af22370257122f8b16207e6d)
|
||||
set(MD5_PPM_444_ISLOW_SKIP1_6 5606f86874cf26b8fcee1117a0a436a6)
|
||||
set(MD5_PPM_444_ISLOW_PROG_CROP98x98_13_13 db87dc7ce26bcdc7a6b56239ce2b9d6c)
|
||||
set(MD5_PPM_444_ISLOW_ARI_CROP37x37_0_0 cb57b32bd6d03e35432362f7bf184b6d)
|
||||
set(MD5_JPEG_CROP b4197f377e621c4e9b1d20471432610d)
|
||||
endif()
|
||||
|
||||
@@ -442,6 +501,13 @@ if(ENABLE_STATIC)
|
||||
set(TEST_LIBTYPES ${TEST_LIBTYPES} static)
|
||||
endif()
|
||||
|
||||
set(TESTIMAGES ${CMAKE_SOURCE_DIR}/testimages)
|
||||
set(MD5CMP ${CMAKE_CURRENT_BINARY_DIR}/md5/md5cmp)
|
||||
if(CMAKE_CROSSCOMPILING)
|
||||
file(RELATIVE_PATH TESTIMAGES ${CMAKE_CURRENT_BINARY_DIR} ${TESTIMAGES})
|
||||
file(RELATIVE_PATH MD5CMP ${CMAKE_CURRENT_BINARY_DIR} ${MD5CMP})
|
||||
endif()
|
||||
|
||||
foreach(libtype ${TEST_LIBTYPES})
|
||||
if(libtype STREQUAL "shared")
|
||||
set(dir sharedlib/)
|
||||
@@ -463,219 +529,186 @@ foreach(libtype ${TEST_LIBTYPES})
|
||||
|
||||
# CC: null SAMP: fullsize FDCT: islow ENT: huff
|
||||
add_test(cjpeg${suffix}-rgb-islow
|
||||
${dir}cjpeg${suffix} -rgb -dct int -outfile testout_rgb_islow.jpg
|
||||
${CMAKE_SOURCE_DIR}/testimages/testorig.ppm)
|
||||
${dir}cjpeg${suffix} -rgb -dct int
|
||||
-outfile testout_rgb_islow.jpg ${TESTIMAGES}/testorig.ppm)
|
||||
add_test(cjpeg${suffix}-rgb-islow-cmp
|
||||
${CMAKE_COMMAND} -DMD5=${MD5_JPEG_RGB_ISLOW} -DFILE=testout_rgb_islow.jpg
|
||||
-P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)
|
||||
${MD5CMP} ${MD5_JPEG_RGB_ISLOW} testout_rgb_islow.jpg)
|
||||
|
||||
# CC: null SAMP: fullsize IDCT: islow ENT: huff
|
||||
add_test(djpeg${suffix}-rgb-islow
|
||||
${dir}djpeg${suffix} -dct int -ppm -outfile testout_rgb_islow.ppm
|
||||
testout_rgb_islow.jpg)
|
||||
${dir}djpeg${suffix} -dct int -ppm
|
||||
-outfile testout_rgb_islow.ppm testout_rgb_islow.jpg)
|
||||
add_test(djpeg${suffix}-rgb-islow-cmp
|
||||
${CMAKE_COMMAND} -DMD5=${MD5_PPM_RGB_ISLOW} -DFILE=testout_rgb_islow.ppm
|
||||
-P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)
|
||||
${MD5CMP} ${MD5_PPM_RGB_ISLOW} testout_rgb_islow.ppm)
|
||||
|
||||
if(NOT WITH_12BIT)
|
||||
# CC: RGB->RGB565 SAMP: fullsize IDCT: islow ENT: huff
|
||||
add_test(djpeg${suffix}-rgb-islow-565
|
||||
${dir}djpeg${suffix} -dct int -rgb565 -dither none -bmp
|
||||
-outfile testout_rgb_islow_565.bmp testout_rgb_islow.jpg)
|
||||
add_test(djpeg${suffix}-rgb-islow-565-cmp
|
||||
${CMAKE_COMMAND} -DMD5=${MD5_BMP_RGB_ISLOW_565}
|
||||
-DFILE=testout_rgb_islow_565.bmp
|
||||
-P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)
|
||||
${MD5CMP} ${MD5_BMP_RGB_ISLOW_565} testout_rgb_islow_565.bmp)
|
||||
|
||||
# CC: RGB->RGB565 (dithered) SAMP: fullsize IDCT: islow ENT: huff
|
||||
add_test(djpeg${suffix}-rgb-islow-565D
|
||||
${dir}djpeg${suffix} -dct int -rgb565 -bmp
|
||||
-outfile testout_rgb_islow_565D.bmp testout_rgb_islow.jpg)
|
||||
add_test(djpeg${suffix}-rgb-islow-565D-cmp
|
||||
${CMAKE_COMMAND} -DMD5=${MD5_BMP_RGB_ISLOW_565D}
|
||||
-DFILE=testout_rgb_islow_565D.bmp
|
||||
-P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)
|
||||
${MD5CMP} ${MD5_BMP_RGB_ISLOW_565D} testout_rgb_islow_565D.bmp)
|
||||
endif()
|
||||
|
||||
# CC: RGB->YCC SAMP: fullsize/h2v1 FDCT: ifast ENT: 2-pass huff
|
||||
add_test(cjpeg${suffix}-422-ifast-opt
|
||||
${dir}cjpeg${suffix} -sample 2x1 -dct fast -opt
|
||||
-outfile testout_422_ifast_opt.jpg
|
||||
${CMAKE_SOURCE_DIR}/testimages/testorig.ppm)
|
||||
-outfile testout_422_ifast_opt.jpg ${TESTIMAGES}/testorig.ppm)
|
||||
add_test(cjpeg${suffix}-422-ifast-opt-cmp
|
||||
${CMAKE_COMMAND} -DMD5=${MD5_JPEG_422_IFAST_OPT}
|
||||
-DFILE=testout_422_ifast_opt.jpg
|
||||
-P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)
|
||||
${MD5CMP} ${MD5_JPEG_422_IFAST_OPT} testout_422_ifast_opt.jpg)
|
||||
|
||||
# CC: YCC->RGB SAMP: fullsize/h2v1 fancy IDCT: ifast ENT: huff
|
||||
add_test(djpeg${suffix}-422-ifast
|
||||
${dir}djpeg${suffix} -dct fast -outfile testout_422_ifast.ppm
|
||||
testout_422_ifast_opt.jpg)
|
||||
${dir}djpeg${suffix} -dct fast
|
||||
-outfile testout_422_ifast.ppm testout_422_ifast_opt.jpg)
|
||||
add_test(djpeg${suffix}-422-ifast-cmp
|
||||
${CMAKE_COMMAND} -DMD5=${MD5_PPM_422_IFAST} -DFILE=testout_422_ifast.ppm
|
||||
-P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)
|
||||
${MD5CMP} ${MD5_PPM_422_IFAST} testout_422_ifast.ppm)
|
||||
|
||||
# CC: YCC->RGB SAMP: h2v1 merged IDCT: ifast ENT: huff
|
||||
add_test(djpeg${suffix}-422m-ifast
|
||||
${dir}djpeg${suffix} -dct fast -nosmooth -outfile testout_422m_ifast.ppm
|
||||
testout_422_ifast_opt.jpg)
|
||||
${dir}djpeg${suffix} -dct fast -nosmooth
|
||||
-outfile testout_422m_ifast.ppm testout_422_ifast_opt.jpg)
|
||||
add_test(djpeg${suffix}-422m-ifast-cmp
|
||||
${CMAKE_COMMAND} -DMD5=${MD5_PPM_422M_IFAST} -DFILE=testout_422m_ifast.ppm
|
||||
-P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)
|
||||
${MD5CMP} ${MD5_PPM_422M_IFAST} testout_422m_ifast.ppm)
|
||||
|
||||
if(NOT WITH_12BIT)
|
||||
# CC: YCC->RGB565 SAMP: h2v1 merged IDCT: ifast ENT: huff
|
||||
add_test(djpeg${suffix}-422m-ifast-565
|
||||
${dir}djpeg${suffix} -dct int -nosmooth -rgb565 -dither none -bmp
|
||||
-outfile testout_422m_ifast_565.bmp testout_422_ifast_opt.jpg)
|
||||
add_test(djpeg${suffix}-422m-ifast-565-cmp
|
||||
${CMAKE_COMMAND} -DMD5=${MD5_BMP_422M_IFAST_565}
|
||||
-DFILE=testout_422m_ifast_565.bmp
|
||||
-P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)
|
||||
${MD5CMP} ${MD5_BMP_422M_IFAST_565} testout_422m_ifast_565.bmp)
|
||||
|
||||
# CC: YCC->RGB565 (dithered) SAMP: h2v1 merged IDCT: ifast ENT: huff
|
||||
add_test(djpeg${suffix}-422m-ifast-565D
|
||||
${dir}djpeg${suffix} -dct int -nosmooth -rgb565 -bmp
|
||||
-outfile testout_422m_ifast_565D.bmp testout_422_ifast_opt.jpg)
|
||||
add_test(djpeg${suffix}-422m-ifast-565D-cmp
|
||||
${CMAKE_COMMAND} -DMD5=${MD5_BMP_422M_IFAST_565D}
|
||||
-DFILE=testout_422m_ifast_565D.bmp
|
||||
-P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)
|
||||
${MD5CMP} ${MD5_BMP_422M_IFAST_565D} testout_422m_ifast_565D.bmp)
|
||||
endif()
|
||||
|
||||
# CC: RGB->YCC SAMP: fullsize/h2v2 FDCT: ifast ENT: prog huff
|
||||
add_test(cjpeg${suffix}-420-q100-ifast-prog
|
||||
${dir}cjpeg${suffix} -sample 2x2 -quality 100 -dct fast -prog
|
||||
-outfile testout_420_q100_ifast_prog.jpg
|
||||
${CMAKE_SOURCE_DIR}/testimages/testorig.ppm)
|
||||
-outfile testout_420_q100_ifast_prog.jpg ${TESTIMAGES}/testorig.ppm)
|
||||
add_test(cjpeg${suffix}-420-q100-ifast-prog-cmp
|
||||
${CMAKE_COMMAND} -DMD5=${MD5_JPEG_420_IFAST_Q100_PROG}
|
||||
-DFILE=testout_420_q100_ifast_prog.jpg
|
||||
-P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)
|
||||
${MD5CMP} ${MD5_JPEG_420_IFAST_Q100_PROG} testout_420_q100_ifast_prog.jpg)
|
||||
|
||||
# CC: YCC->RGB SAMP: fullsize/h2v2 fancy IDCT: ifast ENT: prog huff
|
||||
add_test(djpeg${suffix}-420-q100-ifast-prog
|
||||
${dir}djpeg${suffix} -dct fast -outfile testout_420_q100_ifast.ppm
|
||||
testout_420_q100_ifast_prog.jpg)
|
||||
${dir}djpeg${suffix} -dct fast
|
||||
-outfile testout_420_q100_ifast.ppm testout_420_q100_ifast_prog.jpg)
|
||||
add_test(djpeg${suffix}-420-q100-ifast-prog-cmp
|
||||
${CMAKE_COMMAND} -DMD5=${MD5_PPM_420_Q100_IFAST}
|
||||
-DFILE=testout_420_q100_ifast.ppm
|
||||
-P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)
|
||||
${MD5CMP} ${MD5_PPM_420_Q100_IFAST} testout_420_q100_ifast.ppm)
|
||||
|
||||
# CC: YCC->RGB SAMP: h2v2 merged IDCT: ifast ENT: prog huff
|
||||
add_test(djpeg${suffix}-420m-q100-ifast-prog
|
||||
${dir}djpeg${suffix} -dct fast -nosmooth
|
||||
-outfile testout_420m_q100_ifast.ppm testout_420_q100_ifast_prog.jpg)
|
||||
add_test(djpeg${suffix}-420m-q100-ifast-prog-cmp
|
||||
${CMAKE_COMMAND} -DMD5=${MD5_PPM_420M_Q100_IFAST}
|
||||
-DFILE=testout_420m_q100_ifast.ppm
|
||||
-P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)
|
||||
${MD5CMP} ${MD5_PPM_420M_Q100_IFAST} testout_420m_q100_ifast.ppm)
|
||||
|
||||
# CC: RGB->Gray SAMP: fullsize FDCT: islow ENT: huff
|
||||
add_test(cjpeg${suffix}-gray-islow
|
||||
${dir}cjpeg${suffix} -gray -dct int -outfile testout_gray_islow.jpg
|
||||
${CMAKE_SOURCE_DIR}/testimages/testorig.ppm)
|
||||
${dir}cjpeg${suffix} -gray -dct int
|
||||
-outfile testout_gray_islow.jpg ${TESTIMAGES}/testorig.ppm)
|
||||
add_test(cjpeg${suffix}-gray-islow-cmp
|
||||
${CMAKE_COMMAND} -DMD5=${MD5_JPEG_GRAY_ISLOW}
|
||||
-DFILE=testout_gray_islow.jpg
|
||||
-P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)
|
||||
${MD5CMP} ${MD5_JPEG_GRAY_ISLOW} testout_gray_islow.jpg)
|
||||
|
||||
# CC: Gray->Gray SAMP: fullsize IDCT: islow ENT: huff
|
||||
add_test(djpeg${suffix}-gray-islow
|
||||
${dir}djpeg${suffix} -dct int -outfile testout_gray_islow.ppm
|
||||
testout_gray_islow.jpg)
|
||||
${dir}djpeg${suffix} -dct int
|
||||
-outfile testout_gray_islow.ppm testout_gray_islow.jpg)
|
||||
add_test(djpeg${suffix}-gray-islow-cmp
|
||||
${CMAKE_COMMAND} -DMD5=${MD5_PPM_GRAY_ISLOW}
|
||||
-DFILE=testout_gray_islow.ppm
|
||||
-P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)
|
||||
${MD5CMP} ${MD5_PPM_GRAY_ISLOW} testout_gray_islow.ppm)
|
||||
|
||||
# CC: Gray->RGB SAMP: fullsize IDCT: islow ENT: huff
|
||||
add_test(djpeg${suffix}-gray-islow-rgb
|
||||
${dir}djpeg${suffix} -dct int -rgb -outfile testout_gray_islow_rgb.ppm
|
||||
testout_gray_islow.jpg)
|
||||
${dir}djpeg${suffix} -dct int -rgb
|
||||
-outfile testout_gray_islow_rgb.ppm testout_gray_islow.jpg)
|
||||
add_test(djpeg${suffix}-gray-islow-rgb-cmp
|
||||
${CMAKE_COMMAND} -DMD5=${MD5_PPM_GRAY_ISLOW_RGB}
|
||||
-DFILE=testout_gray_islow_rgb.ppm
|
||||
-P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)
|
||||
${MD5CMP} ${MD5_PPM_GRAY_ISLOW_RGB} testout_gray_islow_rgb.ppm)
|
||||
|
||||
if(NOT WITH_12BIT)
|
||||
# CC: Gray->RGB565 SAMP: fullsize IDCT: islow ENT: huff
|
||||
add_test(djpeg${suffix}-gray-islow-565
|
||||
${dir}djpeg${suffix} -dct int -rgb565 -dither none -bmp
|
||||
-outfile testout_gray_islow_565.bmp testout_gray_islow.jpg)
|
||||
add_test(djpeg${suffix}-gray-islow-565-cmp
|
||||
${CMAKE_COMMAND} -DMD5=${MD5_BMP_GRAY_ISLOW_565}
|
||||
-DFILE=testout_gray_islow_565.bmp
|
||||
-P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)
|
||||
${MD5CMP} ${MD5_BMP_GRAY_ISLOW_565} testout_gray_islow_565.bmp)
|
||||
|
||||
# CC: Gray->RGB565 (dithered) SAMP: fullsize IDCT: islow ENT: huff
|
||||
add_test(djpeg${suffix}-gray-islow-565D
|
||||
${dir}djpeg${suffix} -dct int -rgb565 -bmp
|
||||
-outfile testout_gray_islow_565D.bmp testout_gray_islow.jpg)
|
||||
add_test(djpeg${suffix}-gray-islow-565D-cmp
|
||||
${CMAKE_COMMAND} -DMD5=${MD5_BMP_GRAY_ISLOW_565D}
|
||||
-DFILE=testout_gray_islow_565D.bmp
|
||||
-P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)
|
||||
${MD5CMP} ${MD5_BMP_GRAY_ISLOW_565D} testout_gray_islow_565D.bmp)
|
||||
endif()
|
||||
|
||||
# CC: RGB->YCC SAMP: fullsize smooth/h2v2 smooth FDCT: islow
|
||||
# ENT: 2-pass huff
|
||||
add_test(cjpeg${suffix}-420s-ifast-opt
|
||||
${dir}cjpeg${suffix} -sample 2x2 -smooth 1 -dct int -opt -outfile
|
||||
testout_420s_ifast_opt.jpg ${CMAKE_SOURCE_DIR}/testimages/testorig.ppm)
|
||||
${dir}cjpeg${suffix} -sample 2x2 -smooth 1 -dct int -opt
|
||||
-outfile testout_420s_ifast_opt.jpg ${TESTIMAGES}/testorig.ppm)
|
||||
add_test(cjpeg${suffix}-420s-ifast-opt-cmp
|
||||
${CMAKE_COMMAND} -DMD5=${MD5_JPEG_420S_IFAST_OPT}
|
||||
-DFILE=testout_420s_ifast_opt.jpg
|
||||
-P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)
|
||||
${MD5CMP} ${MD5_JPEG_420S_IFAST_OPT} testout_420s_ifast_opt.jpg)
|
||||
|
||||
# CC: RGB->YCC SAMP: fullsize/int FDCT: float ENT: prog huff
|
||||
add_test(cjpeg${suffix}-3x2-float-prog
|
||||
${dir}cjpeg${suffix} -sample 3x2 -dct float -prog
|
||||
-outfile testout_3x2_float_prog.jpg
|
||||
${CMAKE_SOURCE_DIR}/testimages/testorig.ppm)
|
||||
-outfile testout_3x2_float_prog.jpg ${TESTIMAGES}/testorig.ppm)
|
||||
add_test(cjpeg${suffix}-3x2-float-prog-cmp
|
||||
${CMAKE_COMMAND} -DMD5=${MD5_JPEG_3x2_FLOAT_PROG}
|
||||
-DFILE=testout_3x2_float_prog.jpg
|
||||
-P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)
|
||||
${MD5CMP} ${MD5_JPEG_3x2_FLOAT_PROG} testout_3x2_float_prog.jpg)
|
||||
|
||||
# CC: YCC->RGB SAMP: fullsize/int IDCT: float ENT: prog huff
|
||||
add_test(djpeg${suffix}-3x2-float-prog
|
||||
${dir}djpeg${suffix} -dct float -outfile testout_3x2_float.ppm
|
||||
testout_3x2_float_prog.jpg)
|
||||
${dir}djpeg${suffix} -dct float
|
||||
-outfile testout_3x2_float.ppm testout_3x2_float_prog.jpg)
|
||||
add_test(djpeg${suffix}-3x2-float-prog-cmp
|
||||
${CMAKE_COMMAND} -DMD5=${MD5_PPM_3x2_FLOAT} -DFILE=testout_3x2_float.ppm
|
||||
-P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)
|
||||
${MD5CMP} ${MD5_PPM_3x2_FLOAT} testout_3x2_float.ppm)
|
||||
|
||||
if(WITH_ARITH_ENC)
|
||||
# CC: YCC->RGB SAMP: fullsize/h2v2 FDCT: islow ENT: arith
|
||||
add_test(cjpeg${suffix}-420-islow-ari
|
||||
${dir}cjpeg${suffix} -dct int -arithmetic
|
||||
-outfile testout_420_islow_ari.jpg
|
||||
${CMAKE_SOURCE_DIR}/testimages/testorig.ppm)
|
||||
-outfile testout_420_islow_ari.jpg ${TESTIMAGES}/testorig.ppm)
|
||||
add_test(cjpeg${suffix}-420-islow-ari-cmp
|
||||
${CMAKE_COMMAND} -DMD5=${MD5_JPEG_420_ISLOW_ARI}
|
||||
-DFILE=testout_420_islow_ari.jpg
|
||||
-P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)
|
||||
${MD5CMP} ${MD5_JPEG_420_ISLOW_ARI} testout_420_islow_ari.jpg)
|
||||
|
||||
add_test(jpegtran${suffix}-420-islow-ari
|
||||
${dir}jpegtran${suffix} -arithmetic
|
||||
-outfile testout_420_islow_ari.jpg
|
||||
${CMAKE_SOURCE_DIR}/testimages/testimgint.jpg)
|
||||
-outfile testout_420_islow_ari.jpg ${TESTIMAGES}/testimgint.jpg)
|
||||
add_test(jpegtran${suffix}-420-islow-ari-cmp
|
||||
${CMAKE_COMMAND} -DMD5=${MD5_JPEG_420_ISLOW_ARI}
|
||||
-DFILE=testout_420_islow_ari.jpg
|
||||
-P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)
|
||||
${MD5CMP} ${MD5_JPEG_420_ISLOW_ARI} testout_420_islow_ari.jpg)
|
||||
|
||||
# CC: YCC->RGB SAMP: fullsize FDCT: islow ENT: prog arith
|
||||
add_test(cjpeg${suffix}-444-islow-progari
|
||||
${dir}cjpeg${suffix} -sample 1x1 -dct int -progressive -arithmetic
|
||||
-outfile testout_444_islow_progari.jpg
|
||||
${CMAKE_SOURCE_DIR}/testimages/testorig.ppm)
|
||||
${dir}cjpeg${suffix} -sample 1x1 -dct int -prog -arithmetic
|
||||
-outfile testout_444_islow_progari.jpg ${TESTIMAGES}/testorig.ppm)
|
||||
add_test(cjpeg${suffix}-444-islow-progari-cmp
|
||||
${CMAKE_COMMAND} -DMD5=${MD5_JPEG_444_ISLOW_PROGARI}
|
||||
-DFILE=testout_444_islow_progari.jpg
|
||||
-P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)
|
||||
${MD5CMP} ${MD5_JPEG_444_ISLOW_PROGARI} testout_444_islow_progari.jpg)
|
||||
endif()
|
||||
|
||||
if(WITH_ARITH_DEC)
|
||||
# CC: RGB->YCC SAMP: h2v2 merged IDCT: ifast ENT: arith
|
||||
add_test(djpeg${suffix}-420m-ifast-ari
|
||||
${dir}djpeg${suffix} -fast -ppm -outfile testout_420m_ifast_ari.ppm
|
||||
${CMAKE_SOURCE_DIR}/testimages/testimgari.jpg)
|
||||
${dir}djpeg${suffix} -fast -ppm
|
||||
-outfile testout_420m_ifast_ari.ppm ${TESTIMAGES}/testimgari.jpg)
|
||||
add_test(djpeg${suffix}-420m-ifast-ari-cmp
|
||||
${CMAKE_COMMAND} -DMD5=${MD5_PPM_420M_IFAST_ARI}
|
||||
-DFILE=testout_420m_ifast_ari.ppm
|
||||
-P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)
|
||||
${MD5CMP} ${MD5_PPM_420M_IFAST_ARI} testout_420m_ifast_ari.ppm)
|
||||
|
||||
add_test(jpegtran${suffix}-420-islow
|
||||
${dir}jpegtran${suffix} -outfile testout_420_islow.jpg
|
||||
${CMAKE_SOURCE_DIR}/testimages/testimgari.jpg)
|
||||
${dir}jpegtran${suffix}
|
||||
-outfile testout_420_islow.jpg ${TESTIMAGES}/testimgari.jpg)
|
||||
add_test(jpegtran${suffix}-420-islow-cmp
|
||||
${CMAKE_COMMAND} -DMD5=${MD5_JPEG_420_ISLOW}
|
||||
-DFILE=testout_420_islow.jpg
|
||||
-P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)
|
||||
${MD5CMP} ${MD5_JPEG_420_ISLOW} testout_420_islow.jpg)
|
||||
endif()
|
||||
|
||||
# 2/1-- CC: YCC->RGB SAMP: h2v2 merged IDCT: 16x16 islow ENT: huff
|
||||
@@ -701,67 +734,135 @@ foreach(libtype ${TEST_LIBTYPES})
|
||||
string(REGEX REPLACE "_" "/" scalearg ${scale})
|
||||
add_test(djpeg${suffix}-420m-islow-${scale}
|
||||
${dir}djpeg${suffix} -dct int -scale ${scalearg} -nosmooth -ppm
|
||||
-outfile testout_420m_islow_${scale}.ppm
|
||||
${CMAKE_SOURCE_DIR}/testimages/${TESTORIG})
|
||||
-outfile testout_420m_islow_${scale}.ppm ${TESTIMAGES}/${TESTORIG})
|
||||
add_test(djpeg${suffix}-420m-islow-${scale}-cmp
|
||||
${CMAKE_COMMAND} -DMD5=${MD5_PPM_420M_ISLOW_${scale}}
|
||||
-DFILE=testout_420m_islow_${scale}.ppm
|
||||
-P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)
|
||||
${MD5CMP} ${MD5_PPM_420M_ISLOW_${scale}} testout_420m_islow_${scale}.ppm)
|
||||
endforeach()
|
||||
|
||||
if(NOT WITH_12BIT)
|
||||
# CC: YCC->RGB (dithered) SAMP: h2v2 fancy IDCT: islow ENT: huff
|
||||
add_test(djpeg${suffix}-420-islow-256
|
||||
${dir}djpeg${suffix} -dct int -colors 256 -bmp
|
||||
-outfile testout_420_islow_256.bmp
|
||||
${CMAKE_SOURCE_DIR}/testimages/${TESTORIG})
|
||||
-outfile testout_420_islow_256.bmp ${TESTIMAGES}/${TESTORIG})
|
||||
add_test(djpeg${suffix}-420-islow-256-cmp
|
||||
${CMAKE_COMMAND} -DMD5=${MD5_BMP_420_ISLOW_256}
|
||||
-DFILE=testout_420_islow_256.bmp
|
||||
-P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)
|
||||
${MD5CMP} ${MD5_BMP_420_ISLOW_256} testout_420_islow_256.bmp)
|
||||
|
||||
# CC: YCC->RGB565 SAMP: h2v2 fancy IDCT: islow ENT: huff
|
||||
add_test(djpeg${suffix}-420-islow-565
|
||||
${dir}djpeg${suffix} -dct int -rgb565 -dither none -bmp
|
||||
-outfile testout_420_islow_565.bmp
|
||||
${CMAKE_SOURCE_DIR}/testimages/${TESTORIG})
|
||||
-outfile testout_420_islow_565.bmp ${TESTIMAGES}/${TESTORIG})
|
||||
add_test(djpeg${suffix}-420-islow-565-cmp
|
||||
${CMAKE_COMMAND} -DMD5=${MD5_BMP_420_ISLOW_565}
|
||||
-DFILE=testout_420_islow_565.bmp
|
||||
-P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)
|
||||
${MD5CMP} ${MD5_BMP_420_ISLOW_565} testout_420_islow_565.bmp)
|
||||
|
||||
# CC: YCC->RGB565 (dithered) SAMP: h2v2 fancy IDCT: islow ENT: huff
|
||||
add_test(djpeg${suffix}-420-islow-565D
|
||||
${dir}djpeg${suffix} -dct int -rgb565 -bmp
|
||||
-outfile testout_420_islow_565D.bmp
|
||||
${CMAKE_SOURCE_DIR}/testimages/${TESTORIG})
|
||||
-outfile testout_420_islow_565D.bmp ${TESTIMAGES}/${TESTORIG})
|
||||
add_test(djpeg${suffix}-420-islow-565D-cmp
|
||||
${CMAKE_COMMAND} -DMD5=${MD5_BMP_420_ISLOW_565D}
|
||||
-DFILE=testout_420_islow_565D.bmp
|
||||
-P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)
|
||||
${MD5CMP} ${MD5_BMP_420_ISLOW_565D} testout_420_islow_565D.bmp)
|
||||
|
||||
# CC: YCC->RGB565 SAMP: h2v2 merged IDCT: islow ENT: huff
|
||||
add_test(djpeg${suffix}-420m-islow-565
|
||||
${dir}djpeg${suffix} -dct int -nosmooth -rgb565 -dither none -bmp
|
||||
-outfile testout_420m_islow_565.bmp
|
||||
${CMAKE_SOURCE_DIR}/testimages/${TESTORIG})
|
||||
-outfile testout_420m_islow_565.bmp ${TESTIMAGES}/${TESTORIG})
|
||||
add_test(djpeg${suffix}-420m-islow-565-cmp
|
||||
${CMAKE_COMMAND} -DMD5=${MD5_BMP_420M_ISLOW_565}
|
||||
-DFILE=testout_420m_islow_565.bmp
|
||||
-P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)
|
||||
${MD5CMP} ${MD5_BMP_420M_ISLOW_565} testout_420m_islow_565.bmp)
|
||||
|
||||
# CC: YCC->RGB565 (dithered) SAMP: h2v2 merged IDCT: islow ENT: huff
|
||||
add_test(djpeg${suffix}-420m-islow-565D
|
||||
${dir}djpeg${suffix} -dct int -nosmooth -rgb565 -bmp
|
||||
-outfile testout_420m_islow_565D.bmp
|
||||
${CMAKE_SOURCE_DIR}/testimages/${TESTORIG})
|
||||
-outfile testout_420m_islow_565D.bmp ${TESTIMAGES}/${TESTORIG})
|
||||
add_test(djpeg${suffix}-420m-islow-565D-cmp
|
||||
${CMAKE_COMMAND} -DMD5=${MD5_BMP_420M_ISLOW_565D}
|
||||
-DFILE=testout_420m_islow_565D.bmp
|
||||
-P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)
|
||||
${MD5CMP} ${MD5_BMP_420M_ISLOW_565D} testout_420m_islow_565D.bmp)
|
||||
endif()
|
||||
|
||||
# Partial decode tests. These tests are designed to cover all of the
|
||||
# possible code paths in jpeg_skip_scanlines().
|
||||
|
||||
# Context rows: Yes Intra-iMCU row: Yes iMCU row prefetch: No ENT: huff
|
||||
add_test(djpeg${suffix}-420-islow-skip15_31
|
||||
${dir}djpeg${suffix} -dct int -skip 15,31 -ppm
|
||||
-outfile testout_420_islow_skip15,31.ppm ${TESTIMAGES}/${TESTORIG})
|
||||
add_test(djpeg${suffix}-420-islow-skip15_31-cmp
|
||||
${MD5CMP} ${MD5_PPM_420_ISLOW_SKIP15_31} testout_420_islow_skip15,31.ppm)
|
||||
|
||||
# Context rows: Yes Intra-iMCU row: No iMCU row prefetch: Yes ENT: arith
|
||||
if(WITH_ARITH_DEC)
|
||||
add_test(djpeg${suffix}-420-islow-ari-skip16_139
|
||||
${dir}djpeg${suffix} -dct int -skip 16,139 -ppm
|
||||
-outfile testout_420_islow_ari_skip16,139.ppm
|
||||
${TESTIMAGES}/testimgari.jpg)
|
||||
add_test(djpeg${suffix}-420-islow-ari_skip16_139-cmp
|
||||
${MD5CMP} ${MD5_PPM_420_ISLOW_ARI_SKIP16_139}
|
||||
testout_420_islow_ari_skip16,139.ppm)
|
||||
endif()
|
||||
|
||||
# Context rows: Yes Intra-iMCU row: No iMCU row prefetch: No ENT: prog huff
|
||||
add_test(cjpeg${suffix}-420-islow-prog
|
||||
${dir}cjpeg${suffix} -dct int -prog
|
||||
-outfile testout_420_islow_prog.jpg ${TESTIMAGES}/testorig.ppm)
|
||||
add_test(djpeg${suffix}-420-islow-prog-crop62x62_71_71
|
||||
${dir}djpeg${suffix} -dct int -crop 62x62+71+71 -ppm
|
||||
-outfile testout_420_islow_prog_crop62x62,71,71.ppm
|
||||
testout_420_islow_prog.jpg)
|
||||
add_test(djpeg${suffix}-420-islow-prog-crop62x62_71_71-cmp
|
||||
${MD5CMP} ${MD5_PPM_420_ISLOW_PROG_CROP62x62_71_71}
|
||||
testout_420_islow_prog_crop62x62,71,71.ppm)
|
||||
|
||||
# Context rows: Yes Intra-iMCU row: No iMCU row prefetch: No ENT: arith
|
||||
if(WITH_ARITH_DEC)
|
||||
add_test(djpeg${suffix}-420-islow-ari-crop53x53_4_4
|
||||
${dir}djpeg${suffix} -dct int -crop 53x53+4+4 -ppm
|
||||
-outfile testout_420_islow_ari_crop53x53,4,4.ppm
|
||||
${TESTIMAGES}/testimgari.jpg)
|
||||
add_test(djpeg${suffix}-420-islow-ari-crop53x53_4_4-cmp
|
||||
${MD5CMP} ${MD5_PPM_420_ISLOW_ARI_CROP53x53_4_4}
|
||||
testout_420_islow_ari_crop53x53,4,4.ppm)
|
||||
endif()
|
||||
|
||||
# Context rows: No Intra-iMCU row: Yes ENT: huff
|
||||
add_test(cjpeg${suffix}-444-islow
|
||||
${dir}cjpeg${suffix} -dct int -sample 1x1
|
||||
-outfile testout_444_islow.jpg ${TESTIMAGES}/testorig.ppm)
|
||||
add_test(djpeg${suffix}-444-islow-skip1_6
|
||||
${dir}djpeg${suffix} -dct int -skip 1,6 -ppm
|
||||
-outfile testout_444_islow_skip1,6.ppm testout_444_islow.jpg)
|
||||
add_test(djpeg${suffix}-444-islow-skip1_6-cmp
|
||||
${MD5CMP} ${MD5_PPM_444_ISLOW_SKIP1_6} testout_444_islow_skip1,6.ppm)
|
||||
|
||||
# Context rows: No Intra-iMCU row: No ENT: prog huff
|
||||
add_test(cjpeg${suffix}-444-islow-prog
|
||||
${dir}cjpeg${suffix} -dct int -prog -sample 1x1
|
||||
-outfile testout_444_islow_prog.jpg ${TESTIMAGES}/testorig.ppm)
|
||||
add_test(djpeg${suffix}-444-islow-prog-crop98x98_13_13
|
||||
${dir}djpeg${suffix} -dct int -crop 98x98+13+13 -ppm
|
||||
-outfile testout_444_islow_prog_crop98x98,13,13.ppm
|
||||
testout_444_islow_prog.jpg)
|
||||
add_test(djpeg${suffix}-444-islow-prog_crop98x98_13_13-cmp
|
||||
${MD5CMP} ${MD5_PPM_444_ISLOW_PROG_CROP98x98_13_13}
|
||||
testout_444_islow_prog_crop98x98,13,13.ppm)
|
||||
|
||||
# Context rows: No Intra-iMCU row: No ENT: arith
|
||||
if(WITH_ARITH_ENC)
|
||||
add_test(cjpeg${suffix}-444-islow-ari
|
||||
${dir}cjpeg${suffix} -dct int -arithmetic -sample 1x1
|
||||
-outfile testout_444_islow_ari.jpg ${TESTIMAGES}/testorig.ppm)
|
||||
if(WITH_ARITH_DEC)
|
||||
add_test(djpeg${suffix}-444-islow-ari-crop37x37_0_0
|
||||
${dir}djpeg${suffix} -dct int -crop 37x37+0+0 -ppm
|
||||
-outfile testout_444_islow_ari_crop37x37,0,0.ppm
|
||||
testout_444_islow_ari.jpg)
|
||||
add_test(djpeg${suffix}-444-islow-ari-crop37x37_0_0-cmp
|
||||
${MD5CMP} ${MD5_PPM_444_ISLOW_ARI_CROP37x37_0_0}
|
||||
testout_444_islow_ari_crop37x37,0,0.ppm)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
add_test(jpegtran${suffix}-crop
|
||||
${dir}jpegtran${suffix} -crop 120x90+20+50 -transpose -perfect
|
||||
-outfile testout_crop.jpg ${CMAKE_SOURCE_DIR}/testimages/${TESTORIG})
|
||||
-outfile testout_crop.jpg ${TESTIMAGES}/${TESTORIG})
|
||||
add_test(jpegtran${suffix}-crop-cmp
|
||||
${CMAKE_COMMAND} -DMD5=${MD5_JPEG_CROP} -DFILE=testout_crop.jpg
|
||||
-P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)
|
||||
${MD5CMP} ${MD5_JPEG_CROP} testout_crop.jpg)
|
||||
|
||||
endforeach()
|
||||
|
||||
@@ -845,7 +946,7 @@ endif()
|
||||
|
||||
install(TARGETS rdjpgcom wrjpgcom RUNTIME DESTINATION bin)
|
||||
|
||||
install(FILES ${CMAKE_SOURCE_DIR}/README ${CMAKE_SOURCE_DIR}/README-turbo.txt
|
||||
install(FILES ${CMAKE_SOURCE_DIR}/README.ijg ${CMAKE_SOURCE_DIR}/README.md
|
||||
${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
|
||||
@@ -854,3 +955,8 @@ install(FILES ${CMAKE_SOURCE_DIR}/README ${CMAKE_SOURCE_DIR}/README-turbo.txt
|
||||
install(FILES ${CMAKE_BINARY_DIR}/jconfig.h ${CMAKE_SOURCE_DIR}/jerror.h
|
||||
${CMAKE_SOURCE_DIR}/jmorecfg.h ${CMAKE_SOURCE_DIR}/jpeglib.h
|
||||
DESTINATION include)
|
||||
|
||||
configure_file("${CMAKE_SOURCE_DIR}/cmakescripts/cmake_uninstall.cmake.in"
|
||||
"cmake_uninstall.cmake" IMMEDIATE @ONLY)
|
||||
|
||||
add_custom_target(uninstall COMMAND ${CMAKE_COMMAND} -P cmake_uninstall.cmake)
|
||||
|
||||
1107
ChangeLog.md
Normal file
1107
ChangeLog.md
Normal file
File diff suppressed because it is too large
Load Diff
706
ChangeLog.txt
706
ChangeLog.txt
@@ -1,706 +0,0 @@
|
||||
1.4.1
|
||||
=====
|
||||
|
||||
[1] tjbench now properly handles CMYK/YCCK JPEG files. Passing an argument of
|
||||
-cmyk (instead of, for instance, -rgb) will cause tjbench to internally convert
|
||||
the source bitmap to CMYK prior to compression, to generate YCCK JPEG files,
|
||||
and to internally convert the decompressed CMYK pixels back to RGB after
|
||||
decompression (the latter is done automatically if a CMYK or YCCK JPEG is
|
||||
passed to tjbench as a source image.) The CMYK<->RGB conversion operation is
|
||||
not benchmarked. NOTE: The quick & dirty CMYK<->RGB conversions that tjbench
|
||||
uses are suitable for testing only. Proper conversion between CMYK and RGB
|
||||
requires a color management system.
|
||||
|
||||
[2] 'make test' now performs additional bitwise regression tests using tjbench,
|
||||
mainly for the purpose of testing compression from/decompression to a subregion
|
||||
of a larger image buffer.
|
||||
|
||||
[3] 'make test' no longer tests the regression of the floating point DCT/IDCT
|
||||
by default, since the results of those tests can vary if the algorithms in
|
||||
question are not implemented using SIMD instructions on a particular platform.
|
||||
See the comments in Makefile.am for information on how to re-enable the tests
|
||||
and to specify an expected result for them based on the particulars of your
|
||||
platform.
|
||||
|
||||
[4] The NULL color conversion routines have been significantly optimized,
|
||||
which speeds up the compression of RGB and CMYK JPEGs by 5-20% when using
|
||||
64-bit code and 0-3% when using 32-bit code, and the decompression of those
|
||||
images by 10-30% when using 64-bit code and 3-12% when using 32-bit code.
|
||||
|
||||
[5] Fixed an "illegal instruction" error that occurred when djpeg from a
|
||||
SIMD-enabled libjpeg-turbo MIPS build was executed with the -nosmooth option on
|
||||
a MIPS machine that lacked DSPr2 support. The MIPS SIMD routines for h2v1 and
|
||||
h2v2 merged upsampling were not properly checking for the existence of DSPr2.
|
||||
|
||||
[6] Performance has been improved significantly on 64-bit non-Linux and
|
||||
non-Windows platforms (generally 10-20% faster compression and 5-10% faster
|
||||
decompression.) Due to an oversight, the 64-bit version of the accelerated
|
||||
Huffman codec was not being compiled in when libjpeg-turbo was built on
|
||||
platforms other than Windows or Linux. Oops.
|
||||
|
||||
[7] Fixed an extremely rare bug in the Huffman encoder that caused 64-bit
|
||||
builds of libjpeg-turbo to incorrectly encode a few specific test images when
|
||||
quality=98, an optimized Huffman table, and the slow integer forward DCT were
|
||||
used.
|
||||
|
||||
[8] The Windows (CMake) build system now supports building only static or only
|
||||
shared libraries. This is accomplished by adding either -DENABLE_STATIC=0 or
|
||||
-DENABLE_SHARED=0 to the CMake command line.
|
||||
|
||||
[9] TurboJPEG API functions will now return an error code if a warning is
|
||||
triggered in the underlying libjpeg API. For instance, if a JPEG file is
|
||||
corrupt, the TurboJPEG decompression functions will attempt to decompress
|
||||
as much of the image as possible, but those functions will now return -1 to
|
||||
indicate that the decompression was not entirely successful.
|
||||
|
||||
[10] Fixed a bug in the MIPS DSPr2 4:2:2 fancy upsampling routine that caused a
|
||||
buffer overflow (and subsequent segfault) when decompressing a 4:2:2 JPEG image
|
||||
in which the right-most MCU was 5 or 6 pixels wide.
|
||||
|
||||
|
||||
1.4.0
|
||||
=====
|
||||
|
||||
[1] Fixed a build issue on OS X PowerPC platforms (md5cmp failed to build
|
||||
because OS X does not provide the le32toh() and htole32() functions.)
|
||||
|
||||
[2] The non-SIMD RGB565 color conversion code did not work correctly on big
|
||||
endian machines. This has been fixed.
|
||||
|
||||
[3] Fixed an issue in tjPlaneSizeYUV() whereby it would erroneously return 1
|
||||
instead of -1 if componentID was > 0 and subsamp was TJSAMP_GRAY.
|
||||
|
||||
[3] Fixed an issue in tjBufSizeYUV2() whereby it would erroneously return 0
|
||||
instead of -1 if width was < 1.
|
||||
|
||||
[5] The Huffman encoder now uses clz and bsr instructions for bit counting on
|
||||
ARM64 platforms (see 1.4 beta1 [5].)
|
||||
|
||||
[6] The close() method in the TJCompressor and TJDecompressor Java classes is
|
||||
now idempotent. Previously, that method would call the native tjDestroy()
|
||||
function even if the TurboJPEG instance had already been destroyed. This
|
||||
caused an exception to be thrown during finalization, if the close() method had
|
||||
already been called. The exception was caught, but it was still an expensive
|
||||
operation.
|
||||
|
||||
[7] The TurboJPEG API previously generated an error ("Could not determine
|
||||
subsampling type for JPEG image") when attempting to decompress grayscale JPEG
|
||||
images that were compressed with a sampling factor other than 1 (for instance,
|
||||
with 'cjpeg -grayscale -sample 2x2'). Subsampling technically has no meaning
|
||||
with grayscale JPEGs, and thus the horizontal and vertical sampling factors
|
||||
for such images are ignored by the decompressor. However, the TurboJPEG API
|
||||
was being too rigid and was expecting the sampling factors to be equal to 1
|
||||
before it treated the image as a grayscale JPEG.
|
||||
|
||||
[8] cjpeg, djpeg, and jpegtran now accept an argument of -version, which will
|
||||
print the library version and exit.
|
||||
|
||||
[9] Referring to 1.4 beta1 [15], another extremely rare circumstance was
|
||||
discovered under which the Huffman encoder's local buffer can be overrun
|
||||
when a buffered destination manager is being used and an
|
||||
extremely-high-frequency block (basically junk image data) is being encoded.
|
||||
Even though the Huffman local buffer was increased from 128 bytes to 136 bytes
|
||||
to address the previous issue, the new issue caused even the larger buffer to
|
||||
be overrun. Further analysis reveals that, in the absolute worst case (such as
|
||||
setting alternating AC coefficients to 32767 and -32768 in the JPEG scanning
|
||||
order), the Huffman encoder can produce encoded blocks that approach double the
|
||||
size of the unencoded blocks. Thus, the Huffman local buffer was increased to
|
||||
256 bytes, which should prevent any such issue from re-occurring in the future.
|
||||
|
||||
[10] The new tjPlaneSizeYUV(), tjPlaneWidth(), and tjPlaneHeight() functions
|
||||
were not actually usable on any platform except OS X and Windows, because
|
||||
those functions were not included in the libturbojpeg mapfile. This has been
|
||||
fixed.
|
||||
|
||||
[11] Restored the JPP(), JMETHOD(), and FAR macros in the libjpeg-turbo header
|
||||
files. The JPP() and JMETHOD() macros were originally implemented in libjpeg
|
||||
as a way of supporting non-ANSI compilers that lacked support for prototype
|
||||
parameters. libjpeg-turbo has never supported such compilers, but some
|
||||
software packages still use the macros to define their own prototypes.
|
||||
Similarly, libjpeg-turbo has never supported MS-DOS and other platforms that
|
||||
have far symbols, but some software packages still use the FAR macro. A pretty
|
||||
good argument can be made that this is a bad practice on the part of the
|
||||
software in question, but since this affects more than one package, it's just
|
||||
easier to fix it here.
|
||||
|
||||
[12] Fixed issues that were preventing the ARM 64-bit SIMD code from compiling
|
||||
for iOS, and included an ARMv8 architecture in all of the binaries installed by
|
||||
the "official" libjpeg-turbo SDK for OS X.
|
||||
|
||||
|
||||
1.3.90 (1.4 beta1)
|
||||
==================
|
||||
|
||||
[1] New features in the TurboJPEG API:
|
||||
-- YUV planar images can now be generated with an arbitrary line padding
|
||||
(previously only 4-byte padding, which was compatible with X Video, was
|
||||
supported.)
|
||||
-- The decompress-to-YUV function has been extended to support image scaling.
|
||||
-- JPEG images can now be compressed from YUV planar source images.
|
||||
-- YUV planar images can now be decoded into RGB or grayscale images.
|
||||
-- 4:1:1 subsampling is now supported. This is mainly included for
|
||||
compatibility, since 4:1:1 is not fully accelerated in libjpeg-turbo and has no
|
||||
significant advantages relative to 4:2:0.
|
||||
-- CMYK images are now supported. This feature allows CMYK source images to be
|
||||
compressed to YCCK JPEGs and YCCK or CMYK JPEGs to be decompressed to CMYK
|
||||
destination images. Conversion between CMYK/YCCK and RGB or YUV images is not
|
||||
supported. Such conversion requires a color management system and is thus out
|
||||
of scope for a codec library.
|
||||
-- The handling of YUV images in the Java API has been significantly refactored
|
||||
and should now be much more intuitive.
|
||||
-- The Java API now supports encoding a YUV image from an arbitrary position in
|
||||
a large image buffer.
|
||||
-- All of the YUV functions now have a corresponding function that operates on
|
||||
separate image planes instead of a unified image buffer. This allows for
|
||||
compressing/decoding from or decompressing/encoding to a subregion of a larger
|
||||
YUV image. It also allows for handling YUV formats that swap the order of the
|
||||
U and V planes.
|
||||
|
||||
[2] Added SIMD acceleration for DSPr2-capable MIPS platforms. This speeds up
|
||||
the compression of full-color JPEGs by 70-80% on such platforms and
|
||||
decompression by 25-35%.
|
||||
|
||||
[3] If an application attempts to decompress a Huffman-coded JPEG image whose
|
||||
header does not contain Huffman tables, libjpeg-turbo will now insert the
|
||||
default Huffman tables. In order to save space, many motion JPEG video frames
|
||||
are encoded without the default Huffman tables, so these frames can now be
|
||||
successfully decompressed by libjpeg-turbo without additional work on the part
|
||||
of the application. An application can still override the Huffman tables, for
|
||||
instance to re-use tables from a previous frame of the same video.
|
||||
|
||||
[4] The Mac packaging system now uses pkgbuild and productbuild rather than
|
||||
PackageMaker (which is obsolete and no longer supported.) This means that
|
||||
OS X 10.6 "Snow Leopard" or later must be used when packaging libjpeg-turbo,
|
||||
although the packages produced can be installed on OS X 10.5 "Leopard" or
|
||||
later. OS X 10.4 "Tiger" is no longer supported.
|
||||
|
||||
[5] The Huffman encoder now uses clz and bsr instructions for bit counting on
|
||||
ARM platforms rather than a lookup table. This reduces the memory footprint
|
||||
by 64k, which may be important for some mobile applications. Out of four
|
||||
Android devices that were tested, two demonstrated a small overall performance
|
||||
loss (~3-4% on average) with ARMv6 code and a small gain (also ~3-4%) with
|
||||
ARMv7 code when enabling this new feature, but the other two devices
|
||||
demonstrated a significant overall performance gain with both ARMv6 and ARMv7
|
||||
code (~10-20%) when enabling the feature. Actual mileage may vary.
|
||||
|
||||
[6] Worked around an issue with Visual C++ 2010 and later that caused incorrect
|
||||
pixels to be generated when decompressing a JPEG image to a 256-color bitmap,
|
||||
if compiler optimization was enabled when libjpeg-turbo was built. This caused
|
||||
the regression tests to fail when doing a release build under Visual C++ 2010
|
||||
and later.
|
||||
|
||||
[7] Improved the accuracy and performance of the non-SIMD implementation of the
|
||||
floating point inverse DCT (using code borrowed from libjpeg v8a and later.)
|
||||
The accuracy of this implementation now matches the accuracy of the SSE/SSE2
|
||||
implementation. Note, however, that the floating point DCT/IDCT algorithms are
|
||||
mainly a legacy feature. They generally do not produce significantly better
|
||||
accuracy than the slow integer DCT/IDCT algorithms, and they are quite a bit
|
||||
slower.
|
||||
|
||||
[8] Added a new output colorspace (JCS_RGB565) to the libjpeg API that allows
|
||||
for decompressing JPEG images into RGB565 (16-bit) pixels. If dithering is not
|
||||
used, then this code path is SIMD-accelerated on ARM platforms.
|
||||
|
||||
[9] Numerous obsolete features, such as support for non-ANSI compilers and
|
||||
support for the MS-DOS memory model, were removed from the libjpeg code,
|
||||
greatly improving its readability and making it easier to maintain and extend.
|
||||
|
||||
[10] Fixed a segfault that occurred when calling output_message() with msg_code
|
||||
set to JMSG_COPYRIGHT.
|
||||
|
||||
[11] Fixed an issue whereby wrjpgcom was allowing comments longer than 65k
|
||||
characters to be passed on the command line, which was causing it to generate
|
||||
incorrect JPEG files.
|
||||
|
||||
[12] Fixed a bug in the build system that was causing the Windows version of
|
||||
wrjpgcom to be built using the rdjpgcom source code.
|
||||
|
||||
[13] Restored 12-bit-per-component JPEG support. A 12-bit version of
|
||||
libjpeg-turbo can now be built by passing an argument of --with-12bit to
|
||||
configure (Unix) or -DWITH_12BIT=1 to cmake (Windows.) 12-bit JPEG support is
|
||||
included only for convenience. Enabling this feature disables all of the
|
||||
performance features in libjpeg-turbo, as well as arithmetic coding and the
|
||||
TurboJPEG API. The resulting library still contains the other libjpeg-turbo
|
||||
features (such as the colorspace extensions), but in general, it performs no
|
||||
faster than libjpeg v6b.
|
||||
|
||||
[14] Added ARM 64-bit SIMD acceleration for the YCC-to-RGB color conversion
|
||||
and IDCT algorithms (both are used during JPEG decompression.) For unknown
|
||||
reasons (probably related to clang), this code cannot currently be compiled for
|
||||
iOS.
|
||||
|
||||
[15] Fixed an extremely rare bug that could cause the Huffman encoder's local
|
||||
buffer to overrun when a very high-frequency MCU is compressed using quality
|
||||
100 and no subsampling, and when the JPEG output buffer is being dynamically
|
||||
resized by the destination manager. This issue was so rare that, even with a
|
||||
test program specifically designed to make the bug occur (by injecting random
|
||||
high-frequency YUV data into the compressor), it was reproducible only once in
|
||||
about every 25 million iterations.
|
||||
|
||||
[16] Fixed an oversight in the TurboJPEG C wrapper: if any of the JPEG
|
||||
compression functions was called repeatedly with the same
|
||||
automatically-allocated destination buffer, then TurboJPEG would erroneously
|
||||
assume that the jpegSize parameter was equal to the size of the buffer, when in
|
||||
fact that parameter was probably equal to the size of the most recently
|
||||
compressed JPEG image. If the size of the previous JPEG image was not as large
|
||||
as the current JPEG image, then TurboJPEG would unnecessarily reallocate the
|
||||
destination buffer.
|
||||
|
||||
|
||||
1.3.1
|
||||
=====
|
||||
|
||||
[1] On Un*x systems, 'make install' now installs the libjpeg-turbo libraries
|
||||
into /opt/libjpeg-turbo/lib32 by default on any 32-bit system, not just x86,
|
||||
and into /opt/libjpeg-turbo/lib64 by default on any 64-bit system, not just
|
||||
x86-64. You can override this by overriding either the 'prefix' or 'libdir'
|
||||
configure variables.
|
||||
|
||||
[2] The Windows installer now places a copy of the TurboJPEG DLLs in the same
|
||||
directory as the rest of the libjpeg-turbo binaries. This was mainly done
|
||||
to support TurboVNC 1.3, which bundles the DLLs in its Windows installation.
|
||||
When using a 32-bit version of CMake on 64-bit Windows, it is impossible to
|
||||
access the c:\WINDOWS\system32 directory, which made it impossible for the
|
||||
TurboVNC build scripts to bundle the 64-bit TurboJPEG DLL.
|
||||
|
||||
[3] Fixed a bug whereby attempting to encode a progressive JPEG with arithmetic
|
||||
entropy coding (by passing arguments of -progressive -arithmetic to cjpeg or
|
||||
jpegtran, for instance) would result in an error, "Requested feature was
|
||||
omitted at compile time".
|
||||
|
||||
[4] Fixed a couple of issues whereby malformed JPEG images would cause
|
||||
libjpeg-turbo to use uninitialized memory during decompression.
|
||||
|
||||
[5] Fixed an error ("Buffer passed to JPEG library is too small") that occurred
|
||||
when calling the TurboJPEG YUV encoding function with a very small (< 5x5)
|
||||
source image, and added a unit test to check for this error.
|
||||
|
||||
[6] The Java classes should now build properly under Visual Studio 2010 and
|
||||
later.
|
||||
|
||||
[7] Fixed an issue that prevented SRPMs generated using the in-tree packaging
|
||||
tools from being rebuilt on certain newer Linux distributions.
|
||||
|
||||
[8] Numerous minor fixes to eliminate compilation and build/packaging system
|
||||
warnings, fix cosmetic issues, improve documentation clarity, and other general
|
||||
source cleanup.
|
||||
|
||||
|
||||
1.3.0
|
||||
=====
|
||||
|
||||
[1] 'make test' now works properly on FreeBSD, and it no longer requires the
|
||||
md5sum executable to be present on other Un*x platforms.
|
||||
|
||||
[2] Overhauled the packaging system:
|
||||
-- To avoid conflict with vendor-supplied libjpeg-turbo packages, the
|
||||
official RPMs and DEBs for libjpeg-turbo have been renamed to
|
||||
"libjpeg-turbo-official".
|
||||
-- The TurboJPEG libraries are now located under /opt/libjpeg-turbo in the
|
||||
official Linux and Mac packages, to avoid conflict with vendor-supplied
|
||||
packages and also to streamline the packaging system.
|
||||
-- Release packages are now created with the directory structure defined
|
||||
by the configure variables "prefix", "bindir", "libdir", etc. (Un*x) or by the
|
||||
CMAKE_INSTALL_PREFIX variable (Windows.) The exception is that the docs are
|
||||
always located under the system default documentation directory on Un*x and Mac
|
||||
systems, and on Windows, the TurboJPEG DLL is always located in the Windows
|
||||
system directory.
|
||||
-- To avoid confusion, official libjpeg-turbo packages on Linux/Unix platforms
|
||||
(except for Mac) will always install the 32-bit libraries in
|
||||
/opt/libjpeg-turbo/lib32 and the 64-bit libraries in /opt/libjpeg-turbo/lib64.
|
||||
-- Fixed an issue whereby, in some cases, the libjpeg-turbo executables on Un*x
|
||||
systems were not properly linking with the shared libraries installed by the
|
||||
same package.
|
||||
-- Fixed an issue whereby building the "installer" target on Windows when
|
||||
WITH_JAVA=1 would fail if the TurboJPEG JAR had not been previously built.
|
||||
-- Building the "install" target on Windows now installs files into the same
|
||||
places that the installer does.
|
||||
|
||||
[3] Fixed a Huffman encoder bug that prevented I/O suspension from working
|
||||
properly.
|
||||
|
||||
|
||||
1.2.90 (1.3 beta1)
|
||||
==================
|
||||
|
||||
[1] Added support for additional scaling factors (3/8, 5/8, 3/4, 7/8, 9/8, 5/4,
|
||||
11/8, 3/2, 13/8, 7/4, 15/8, and 2) when decompressing. Note that the IDCT will
|
||||
not be SIMD-accelerated when using any of these new scaling factors.
|
||||
|
||||
[2] The TurboJPEG dynamic library is now versioned. It was not strictly
|
||||
necessary to do so, because TurboJPEG uses versioned symbols, and if a function
|
||||
changes in an ABI-incompatible way, that function is renamed and a legacy
|
||||
function is provided to maintain backward compatibility. However, certain
|
||||
Linux distro maintainers have a policy against accepting any library that isn't
|
||||
versioned.
|
||||
|
||||
[3] Extended the TurboJPEG Java API so that it can be used to compress a JPEG
|
||||
image from and decompress a JPEG image to an arbitrary position in a large
|
||||
image buffer.
|
||||
|
||||
[4] The tjDecompressToYUV() function now supports the TJFLAG_FASTDCT flag.
|
||||
|
||||
[5] The 32-bit supplementary package for amd64 Debian systems now provides
|
||||
symlinks in /usr/lib/i386-linux-gnu for the TurboJPEG libraries in /usr/lib32.
|
||||
This allows those libraries to be used on MultiArch-compatible systems (such as
|
||||
Ubuntu 11 and later) without setting the linker path.
|
||||
|
||||
[6] The TurboJPEG Java wrapper should now find the JNI library on Mac systems
|
||||
without having to pass -Djava.library.path=/usr/lib to java.
|
||||
|
||||
[7] TJBench has been ported to Java to provide a convenient way of validating
|
||||
the performance of the TurboJPEG Java API. It can be run with
|
||||
'java -cp turbojpeg.jar TJBench'.
|
||||
|
||||
[8] cjpeg can now be used to generate JPEG files with the RGB colorspace
|
||||
(feature ported from jpeg-8d.)
|
||||
|
||||
[9] The width and height in the -crop argument passed to jpegtran can now be
|
||||
suffixed with "f" to indicate that, when the upper left corner of the cropping
|
||||
region is automatically moved to the nearest iMCU boundary, the bottom right
|
||||
corner should be moved by the same amount. In other words, this feature causes
|
||||
jpegtran to strictly honor the specified width/height rather than the specified
|
||||
bottom right corner (feature ported from jpeg-8d.)
|
||||
|
||||
[10] JPEG files using the RGB colorspace can now be decompressed into grayscale
|
||||
images (feature ported from jpeg-8d.)
|
||||
|
||||
[11] Fixed a regression caused by 1.2.1[7] whereby the build would fail with
|
||||
multiple "Mismatch in operand sizes" errors when attempting to build the x86
|
||||
SIMD code with NASM 0.98.
|
||||
|
||||
[12] The in-memory source/destination managers (jpeg_mem_src() and
|
||||
jpeg_mem_dest()) are now included by default when building libjpeg-turbo with
|
||||
libjpeg v6b or v7 emulation, so that programs can take advantage of these
|
||||
functions without requiring the use of the backward-incompatible libjpeg v8
|
||||
ABI. The "age number" of the libjpeg-turbo library on Un*x systems has been
|
||||
incremented by 1 to reflect this. You can disable this feature with a
|
||||
configure/CMake switch in order to retain strict API/ABI compatibility with the
|
||||
libjpeg v6b or v7 API/ABI (or with previous versions of libjpeg-turbo.) See
|
||||
README-turbo.txt for more details.
|
||||
|
||||
[13] Added ARMv7s architecture to libjpeg.a and libturbojpeg.a in the official
|
||||
libjpeg-turbo binary package for OS X, so that those libraries can be used to
|
||||
build applications that leverage the faster CPUs in the iPhone 5 and iPad 4.
|
||||
|
||||
|
||||
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 ARMv6 and ARMv7 architectures to libjpeg.a and libturbojpeg.a in
|
||||
the official libjpeg-turbo binary package for OS X, so that those libraries can
|
||||
be used to build both OS X and iOS applications.
|
||||
|
||||
|
||||
1.1.90 (1.2 beta1)
|
||||
==================
|
||||
|
||||
[1] Added a Java wrapper for the TurboJPEG API. See java/README for more
|
||||
details.
|
||||
|
||||
[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 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 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] 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
|
||||
transposed or rotated 90 degrees.
|
||||
|
||||
[8] All legacy VirtualGL code has been re-factored, and this has allowed
|
||||
libjpeg-turbo, in its entirety, to be re-licensed under a BSD-style license.
|
||||
|
||||
[9] libjpeg-turbo can now be built with YASM.
|
||||
|
||||
[10] Added SIMD acceleration for ARM Linux and iOS platforms that support
|
||||
NEON instructions.
|
||||
|
||||
[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 the TurboJPEG API
|
||||
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
|
||||
(jpegtran <input.jpg >output.jpg).
|
||||
|
||||
[13] The inclusion of libjpeg v7 and v8 emulation as well as arithmetic coding
|
||||
support in libjpeg-turbo v1.1.0 introduced several new error constants in
|
||||
jerror.h, and these were mistakenly enabled for all emulation modes, causing
|
||||
the error enum in libjpeg-turbo to sometimes have different values than the
|
||||
same enum in libjpeg. This represents an ABI incompatibility, and it caused
|
||||
problems with rare applications that took specific action based on a particular
|
||||
error value. The fix was to include the new error constants conditionally
|
||||
based on whether libjpeg v7 or v8 emulation was enabled.
|
||||
|
||||
[14] Fixed an issue whereby Windows applications that used libjpeg-turbo would
|
||||
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] Fixed 32-bit supplementary package for amd64 Debian systems, which was
|
||||
broken by enhancements to the packaging system in 1.1.
|
||||
|
||||
[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).
|
||||
|
||||
|
||||
1.1.1
|
||||
=====
|
||||
|
||||
[1] Fixed a 1-pixel error in row 0, column 21 of the luminance plane generated
|
||||
by tjEncodeYUV().
|
||||
|
||||
[2] libjpeg-turbo's accelerated Huffman decoder previously ignored unexpected
|
||||
markers found in the middle of the JPEG data stream during decompression. It
|
||||
will now hand off decoding of a particular block to the unaccelerated Huffman
|
||||
decoder if an unexpected marker is found, so that the unaccelerated Huffman
|
||||
decoder can generate an appropriate warning.
|
||||
|
||||
[3] Older versions of MinGW64 prefixed symbol names with underscores by
|
||||
default, which differed from the behavior of 64-bit Visual C++. MinGW64 1.0
|
||||
has adopted the behavior of 64-bit Visual C++ as the default, so to accommodate
|
||||
this, the libjpeg-turbo SIMD function names are no longer prefixed with an
|
||||
underscore when building with MinGW64. This means that, when building
|
||||
libjpeg-turbo with older versions of MinGW64, you will now have to add
|
||||
-fno-leading-underscore to the CFLAGS.
|
||||
|
||||
[4] Fixed a regression bug in the NSIS script that caused the Windows installer
|
||||
build to fail when using the Visual Studio IDE.
|
||||
|
||||
[5] Fixed a bug in jpeg_read_coefficients() whereby it would not initialize
|
||||
cinfo->image_width and cinfo->image_height if libjpeg v7 or v8 emulation was
|
||||
enabled. This specifically caused the jpegoptim program to fail if it was
|
||||
linked against a version of libjpeg-turbo that was built with libjpeg v7 or v8
|
||||
emulation.
|
||||
|
||||
[6] Eliminated excessive I/O overhead that occurred when reading BMP files in
|
||||
cjpeg.
|
||||
|
||||
[7] Eliminated errors in the output of cjpeg on Windows that occurred when the
|
||||
application was invoked using I/O redirection (cjpeg <inputfile >output.jpg).
|
||||
|
||||
|
||||
1.1.0
|
||||
=====
|
||||
|
||||
[1] The algorithm used by the SIMD quantization function cannot produce correct
|
||||
results when the JPEG quality is >= 98 and the fast integer forward DCT is
|
||||
used. Thus, the non-SIMD quantization function is now used for those cases,
|
||||
and libjpeg-turbo should now produce identical output to libjpeg v6b in all
|
||||
cases.
|
||||
|
||||
[2] Despite the above, the fast integer forward DCT still degrades somewhat for
|
||||
JPEG qualities greater than 95, so the TurboJPEG wrapper will now automatically
|
||||
use the slow integer forward DCT when generating JPEG images of quality 96 or
|
||||
greater. This reduces compression performance by as much as 15% for these
|
||||
high-quality images but is necessary to ensure that the images are perceptually
|
||||
lossless. It also ensures that the library can avoid the performance pitfall
|
||||
created by [1].
|
||||
|
||||
[3] Ported jpgtest.cxx to pure C to avoid the need for a C++ compiler.
|
||||
|
||||
[4] Fixed visual artifacts in grayscale JPEG compression caused by a typo in
|
||||
the RGB-to-luminance lookup tables.
|
||||
|
||||
[5] The Windows distribution packages now include the libjpeg run-time programs
|
||||
(cjpeg, etc.)
|
||||
|
||||
[6] All packages now include jpgtest.
|
||||
|
||||
[7] The TurboJPEG dynamic library now uses versioned symbols.
|
||||
|
||||
[8] Added two new TurboJPEG API functions, tjEncodeYUV() and
|
||||
tjDecompressToYUV(), to replace the somewhat hackish TJ_YUV flag.
|
||||
|
||||
|
||||
1.0.90 (1.1 beta1)
|
||||
==================
|
||||
|
||||
[1] Added emulation of the libjpeg v7 and v8 APIs and ABIs. See
|
||||
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] 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.
|
||||
|
||||
[5] If the default install prefix (/opt/libjpeg-turbo) is used, then
|
||||
'make install' now creates /opt/libjpeg-turbo/lib32 and
|
||||
/opt/libjpeg-turbo/lib64 sym links to duplicate the behavior of the binary
|
||||
packages.
|
||||
|
||||
[6] All symbols in the libjpeg-turbo dynamic library are now versioned, even
|
||||
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 the TurboJPEG API, which causes both the compressor
|
||||
and decompressor to output planar YUV images.
|
||||
|
||||
[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.
|
||||
|
||||
|
||||
1.0.1
|
||||
=====
|
||||
|
||||
[1] The Huffman decoder will now handle erroneous Huffman codes (for instance,
|
||||
from a corrupt JPEG image.) Previously, these would cause libjpeg-turbo to
|
||||
crash under certain circumstances.
|
||||
|
||||
[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
|
||||
INCOMPLETE_TYPES_BROKEN macro should be defined.
|
||||
|
||||
|
||||
1.0.0
|
||||
=====
|
||||
|
||||
[1] 2983700: Further FreeBSD build tweaks (no longer necessary to specify
|
||||
--host when configuring on a 64-bit system)
|
||||
|
||||
[2] Created symlinks in the Unix/Linux packages so that the TurboJPEG
|
||||
include file can always be found in /opt/libjpeg-turbo/include, the 32-bit
|
||||
static libraries can always be found in /opt/libjpeg-turbo/lib32, and the
|
||||
64-bit static libraries can always be found in /opt/libjpeg-turbo/lib64.
|
||||
|
||||
[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
|
||||
contains just the 32-bit libjpeg-turbo libraries.
|
||||
|
||||
[5] Moved the libraries from */lib32 to */lib in the i386 Debian package.
|
||||
|
||||
[6] Include distribution package for Cygwin
|
||||
|
||||
[7] No longer necessary to specify --without-simd on non-x86 architectures, and
|
||||
unit tests now work on those architectures.
|
||||
|
||||
|
||||
0.0.93
|
||||
======
|
||||
|
||||
[1] 2982659, Fixed x86-64 build on FreeBSD systems
|
||||
|
||||
[2] 2988188: Added support for Windows 64-bit systems
|
||||
|
||||
|
||||
0.0.91
|
||||
======
|
||||
|
||||
[1] Added documentation to .deb packages
|
||||
|
||||
[2] 2968313: Fixed data corruption issues when decompressing large JPEG images
|
||||
and/or using buffered I/O with the libjpeg-turbo decompressor
|
||||
|
||||
|
||||
0.0.90
|
||||
======
|
||||
|
||||
Initial release
|
||||
139
LICENSE.md
Normal file
139
LICENSE.md
Normal file
@@ -0,0 +1,139 @@
|
||||
libjpeg-turbo Licenses
|
||||
======================
|
||||
|
||||
libjpeg-turbo is covered by three compatible BSD-style open source licenses:
|
||||
|
||||
- The IJG (Independent JPEG Group) License, which is listed in
|
||||
[README.ijg](README.ijg)
|
||||
|
||||
This license applies to the libjpeg API library and associated programs
|
||||
(any code inherited from libjpeg, and any modifications to that code.)
|
||||
|
||||
- The Modified (3-clause) BSD License, which is listed below
|
||||
|
||||
This license covers the TurboJPEG API library and associated programs.
|
||||
|
||||
- The zlib License, which is listed below
|
||||
|
||||
This license is a subset of the other two, and it covers the libjpeg-turbo
|
||||
SIMD extensions.
|
||||
|
||||
|
||||
Complying with the libjpeg-turbo Licenses
|
||||
=========================================
|
||||
|
||||
This section provides a roll-up of the libjpeg-turbo licensing terms, to the
|
||||
best of our understanding.
|
||||
|
||||
1. If you are distributing a modified version of the libjpeg-turbo source,
|
||||
then:
|
||||
|
||||
1. You cannot alter or remove any existing copyright or license notices
|
||||
from the source.
|
||||
|
||||
**Origin**
|
||||
- Clause 1 of the IJG License
|
||||
- Clause 1 of the Modified BSD License
|
||||
- Clauses 1 and 3 of the zlib License
|
||||
|
||||
2. You must add your own copyright notice to the header of each source
|
||||
file you modified, so others can tell that you modified that file (if
|
||||
there is not an existing copyright header in that file, then you can
|
||||
simply add a notice stating that you modified the file.)
|
||||
|
||||
**Origin**
|
||||
- Clause 1 of the IJG License
|
||||
- Clause 2 of the zlib License
|
||||
|
||||
3. You must include the IJG README file, and you must not alter any of the
|
||||
copyright or license text in that file.
|
||||
|
||||
**Origin**
|
||||
- Clause 1 of the IJG License
|
||||
|
||||
2. If you are distributing only libjpeg-turbo binaries without the source, or
|
||||
if you are distributing an application that statically links with
|
||||
libjpeg-turbo, then:
|
||||
|
||||
1. Your product documentation must include a message stating:
|
||||
|
||||
This software is based in part on the work of the Independent JPEG
|
||||
Group.
|
||||
|
||||
**Origin**
|
||||
- Clause 2 of the IJG license
|
||||
|
||||
2. If your binary distribution includes or uses the TurboJPEG API, then
|
||||
your product documentation must include the text of the Modified BSD
|
||||
License.
|
||||
|
||||
**Origin**
|
||||
- Clause 2 of the Modified BSD License
|
||||
|
||||
3. You cannot use the name of the IJG or The libjpeg-turbo Project or the
|
||||
contributors thereof in advertising, publicity, etc.
|
||||
|
||||
**Origin**
|
||||
- IJG License
|
||||
- Clause 3 of the Modified BSD License
|
||||
|
||||
4. The IJG and The libjpeg-turbo Project do not warrant libjpeg-turbo to be
|
||||
free of defects, nor do we accept any liability for undesirable
|
||||
consequences resulting from your use of the software.
|
||||
|
||||
**Origin**
|
||||
- IJG License
|
||||
- Modified BSD License
|
||||
- zlib License
|
||||
|
||||
|
||||
The Modified (3-clause) BSD License
|
||||
===================================
|
||||
|
||||
Copyright (C)\<YEAR\> \<AUTHOR\>. 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.
|
||||
|
||||
|
||||
The zlib License
|
||||
================
|
||||
|
||||
Copyright (C) \<YEAR\>, \<AUTHOR\>.
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
198
Makefile.am
198
Makefile.am
@@ -10,6 +10,11 @@ endif
|
||||
|
||||
nodist_include_HEADERS = jconfig.h
|
||||
|
||||
pkgconfigdir = $(libdir)/pkgconfig
|
||||
pkgconfig_DATA = pkgscripts/libjpeg.pc
|
||||
if WITH_TURBOJPEG
|
||||
pkgconfig_DATA += pkgscripts/libturbojpeg.pc
|
||||
endif
|
||||
|
||||
HDRS = jchuff.h jdct.h jdhuff.h jerror.h jinclude.h jmemsys.h jmorecfg.h \
|
||||
jpegint.h jpeglib.h jversion.h jsimd.h jsimddct.h jpegcomp.h \
|
||||
@@ -155,11 +160,11 @@ jcstest_LDADD = libjpeg.la
|
||||
|
||||
dist_man1_MANS = cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 wrjpgcom.1
|
||||
|
||||
DOCS= coderules.txt jconfig.txt change.log rdrle.c wrrle.c BUILDING.txt \
|
||||
ChangeLog.txt
|
||||
DOCS= coderules.txt jconfig.txt change.log rdrle.c wrrle.c BUILDING.md \
|
||||
ChangeLog.md
|
||||
|
||||
dist_doc_DATA = README README-turbo.txt libjpeg.txt structure.txt usage.txt \
|
||||
wizard.txt
|
||||
dist_doc_DATA = README.ijg README.md libjpeg.txt structure.txt usage.txt \
|
||||
wizard.txt LICENSE.md
|
||||
|
||||
exampledir = $(docdir)
|
||||
dist_example_DATA = example.c
|
||||
@@ -168,7 +173,8 @@ dist_example_DATA = example.c
|
||||
EXTRA_DIST = win release $(DOCS) testimages CMakeLists.txt \
|
||||
sharedlib/CMakeLists.txt cmakescripts libjpeg.map.in doc doxygen.config \
|
||||
doxygen-extra.css jccolext.c jdcolext.c jdcol565.c jdmrgext.c jdmrg565.c \
|
||||
jstdhuff.c
|
||||
jstdhuff.c jdcoefct.h jdmainct.h jdmaster.h jdsample.h wrppm.h \
|
||||
md5/CMakeLists.txt
|
||||
|
||||
dist-hook:
|
||||
rm -rf `find $(distdir) -name .svn`
|
||||
@@ -196,6 +202,8 @@ MD5_PPM_3x2_FLOAT_SSE = 42876ab9e5c2f76a87d08db5fbd57956
|
||||
MD5_JPEG_3x2_FLOAT_PROG_32BIT = a8c17daf77b457725ec929e215b603f8
|
||||
MD5_PPM_3x2_FLOAT_32BIT = 42876ab9e5c2f76a87d08db5fbd57956
|
||||
MD5_PPM_3x2_FLOAT_64BIT = d6fbc71153b3d8ded484dbc17c7b9cf4
|
||||
MD5_JPEG_3x2_FLOAT_PROG_387 = bc6dbbefac2872f6b9d6c4a0ae60c3c0
|
||||
MD5_PPM_3x2_FLOAT_387 = bcc5723c61560463ac60f772e742d092
|
||||
MD5_JPEG_3x2_IFAST_PROG = 1396cc2b7185cfe943d408c9d305339e
|
||||
MD5_PPM_3x2_IFAST = 3975985ef6eeb0a2cdc58daa651ccc00
|
||||
MD5_PPM_420M_ISLOW_2_1 = 4ca6be2a6f326ff9eaab63e70a8259c0
|
||||
@@ -210,6 +218,10 @@ MD5_PPM_420M_ISLOW_1_2 = b419124dd5568b085787234866102866
|
||||
MD5_PPM_420M_ISLOW_3_8 = 343d19015531b7bbe746124127244fa8
|
||||
MD5_PPM_420M_ISLOW_1_4 = 35fd59d866e44659edfa3c18db2a3edb
|
||||
MD5_PPM_420M_ISLOW_1_8 = ccaed48ac0aedefda5d4abe4013f4ad7
|
||||
MD5_PPM_420_ISLOW_SKIP15_31 = 86664cd9dc956536409e44e244d20a97
|
||||
MD5_PPM_420_ISLOW_PROG_CROP62x62_71_71 = 452a21656115a163029cfba5c04fa76a
|
||||
MD5_PPM_444_ISLOW_SKIP1_6 = ef63901f71ef7a75cd78253fc0914f84
|
||||
MD5_PPM_444_ISLOW_PROG_CROP98x98_13_13 = 15b173fb5872d9575572fbcc1b05956f
|
||||
MD5_JPEG_CROP = cdb35ff4b4519392690ea040c56ea99c
|
||||
|
||||
else
|
||||
@@ -233,12 +245,14 @@ MD5_PPM_GRAY_ISLOW_RGB = 116424ac07b79e5e801f00508eab48ec
|
||||
MD5_BMP_GRAY_ISLOW_565 = 12f78118e56a2f48b966f792fedf23cc
|
||||
MD5_BMP_GRAY_ISLOW_565D = bdbbd616441a24354c98553df5dc82db
|
||||
MD5_JPEG_420S_IFAST_OPT = 388708217ac46273ca33086b22827ed8
|
||||
# See README-turbo.txt for more details on why this next bit is necessary.
|
||||
# See README.md for more details on why this next bit is necessary.
|
||||
MD5_JPEG_3x2_FLOAT_PROG_SSE = 343e3f8caf8af5986ebaf0bdc13b5c71
|
||||
MD5_PPM_3x2_FLOAT_SSE = 1a75f36e5904d6fc3a85a43da9ad89bb
|
||||
MD5_JPEG_3x2_FLOAT_PROG_32BIT = 9bca803d2042bd1eb03819e2bf92b3e5
|
||||
MD5_PPM_3x2_FLOAT_32BIT = f6bfab038438ed8f5522fbd33595dcdc
|
||||
MD5_PPM_3x2_FLOAT_64BIT = 0e917a34193ef976b679a6b069b1be26
|
||||
MD5_JPEG_3x2_FLOAT_PROG_387 = 1657664a410e0822c924b54f6f65e6e9
|
||||
MD5_PPM_3x2_FLOAT_387 = cb0a1f027f3d2917c902b5640214e025
|
||||
MD5_JPEG_3x2_IFAST_PROG = 1ee5d2c1a77f2da495f993c8c7cceca5
|
||||
MD5_PPM_3x2_IFAST = fd283664b3b49127984af0a7f118fccd
|
||||
MD5_JPEG_420_ISLOW_ARI = e986fb0a637a8d833d96e8a6d6d84ea1
|
||||
@@ -262,6 +276,13 @@ MD5_BMP_420_ISLOW_565 = bf9d13e16c4923b92e1faa604d7922cb
|
||||
MD5_BMP_420_ISLOW_565D = 6bde71526acc44bcff76f696df8638d2
|
||||
MD5_BMP_420M_ISLOW_565 = 8dc0185245353cfa32ad97027342216f
|
||||
MD5_BMP_420M_ISLOW_565D =d1be3a3339166255e76fa50a0d70d73e
|
||||
MD5_PPM_420_ISLOW_SKIP15_31 = c4c65c1e43d7275cd50328a61e6534f0
|
||||
MD5_PPM_420_ISLOW_ARI_SKIP16_139 = 087c6b123db16ac00cb88c5b590bb74a
|
||||
MD5_PPM_420_ISLOW_PROG_CROP62x62_71_71 = 26eb36ccc7d1f0cb80cdabb0ac8b5d99
|
||||
MD5_PPM_420_ISLOW_ARI_CROP53x53_4_4 = 886c6775af22370257122f8b16207e6d
|
||||
MD5_PPM_444_ISLOW_SKIP1_6 = 5606f86874cf26b8fcee1117a0a436a6
|
||||
MD5_PPM_444_ISLOW_PROG_CROP98x98_13_13 = db87dc7ce26bcdc7a6b56239ce2b9d6c
|
||||
MD5_PPM_444_ISLOW_ARI_CROP37x37_0_0 = cb57b32bd6d03e35432362f7bf184b6d
|
||||
MD5_JPEG_CROP = b4197f377e621c4e9b1d20471432610d
|
||||
|
||||
endif
|
||||
@@ -269,7 +290,11 @@ endif
|
||||
.PHONY: test
|
||||
test: tjquicktest tjbittest bittest
|
||||
|
||||
if CROSS_COMPILING
|
||||
tjquicktest: testclean
|
||||
else
|
||||
tjquicktest: testclean all
|
||||
endif
|
||||
|
||||
if WITH_TURBOJPEG
|
||||
if WITH_JAVA
|
||||
@@ -288,7 +313,11 @@ endif
|
||||
endif
|
||||
echo GREAT SUCCESS!
|
||||
|
||||
if CROSS_COMPILING
|
||||
tjbittest: testclean
|
||||
else
|
||||
tjbittest: testclean all
|
||||
endif
|
||||
|
||||
if WITH_TURBOJPEG
|
||||
|
||||
@@ -312,7 +341,7 @@ MD5_PPM_444_TILE = 7964e41e67cfb8d0a587c0aa4798f9c3
|
||||
# Test compressing from/decompressing to an arbitrary subregion of a larger
|
||||
# image buffer
|
||||
cp $(srcdir)/testimages/testorig.ppm testout_tile.ppm
|
||||
./tjbench testout_tile.ppm 95 -rgb -quiet -tile -benchtime 0.01 >/dev/null 2>&1
|
||||
./tjbench testout_tile.ppm 95 -rgb -quiet -tile -benchtime 0.01 -warmup 0 >/dev/null 2>&1
|
||||
for i in 8 16 32 64 128; do \
|
||||
md5/md5cmp $(MD5_PPM_GRAY_TILE) testout_tile_GRAY_Q95_$$i\x$$i.ppm; \
|
||||
done
|
||||
@@ -329,9 +358,9 @@ MD5_PPM_444_TILE = 7964e41e67cfb8d0a587c0aa4798f9c3
|
||||
for i in 8 16 32 64 128; do \
|
||||
md5/md5cmp $(MD5_PPM_444_TILE) testout_tile_444_Q95_$$i\x$$i.ppm; \
|
||||
done
|
||||
rm testout_tile_GRAY_* testout_tile_420_* testout_tile_422_* testout_tile_444_*
|
||||
rm -f testout_tile_GRAY_* testout_tile_420_* testout_tile_422_* testout_tile_444_*
|
||||
|
||||
./tjbench testout_tile.ppm 95 -rgb -fastupsample -quiet -tile -benchtime 0.01 >/dev/null 2>&1
|
||||
./tjbench testout_tile.ppm 95 -rgb -fastupsample -quiet -tile -benchtime 0.01 -warmup 0 >/dev/null 2>&1
|
||||
md5/md5cmp $(MD5_PPM_420M_8x8_TILE) testout_tile_420_Q95_8x8.ppm
|
||||
for i in 16 32 64 128; do \
|
||||
md5/md5cmp $(MD5_PPM_420M_TILE) testout_tile_420_Q95_$$i\x$$i.ppm; \
|
||||
@@ -340,12 +369,16 @@ MD5_PPM_444_TILE = 7964e41e67cfb8d0a587c0aa4798f9c3
|
||||
for i in 16 32 64 128; do \
|
||||
md5/md5cmp $(MD5_PPM_422M_TILE) testout_tile_422_Q95_$$i\x$$i.ppm; \
|
||||
done
|
||||
rm testout_tile_GRAY_* testout_tile_420_* testout_tile_422_* testout_tile_444_* testout_tile.ppm
|
||||
rm -f testout_tile_GRAY_* testout_tile_420_* testout_tile_422_* testout_tile_444_* testout_tile.ppm
|
||||
echo GREAT SUCCESS!
|
||||
|
||||
endif
|
||||
|
||||
if CROSS_COMPILING
|
||||
bittest: testclean
|
||||
else
|
||||
bittest: testclean all
|
||||
endif
|
||||
|
||||
# These tests are carefully crafted to provide full coverage of as many of the
|
||||
# underlying algorithms as possible (including all of the SIMD-accelerated
|
||||
@@ -357,18 +390,18 @@ bittest: testclean all
|
||||
# CC: null SAMP: fullsize IDCT: islow ENT: huff
|
||||
./djpeg -dct int -ppm -outfile testout_rgb_islow.ppm testout_rgb_islow.jpg
|
||||
md5/md5cmp $(MD5_PPM_RGB_ISLOW) testout_rgb_islow.ppm
|
||||
rm testout_rgb_islow.ppm
|
||||
rm -f testout_rgb_islow.ppm
|
||||
if WITH_12BIT
|
||||
rm testout_rgb_islow.jpg
|
||||
rm -f testout_rgb_islow.jpg
|
||||
else
|
||||
# CC: RGB->RGB565 SAMP: fullsize IDCT: islow ENT: huff
|
||||
./djpeg -dct int -rgb565 -dither none -bmp -outfile testout_rgb_islow_565.bmp testout_rgb_islow.jpg
|
||||
md5/md5cmp $(MD5_BMP_RGB_ISLOW_565) testout_rgb_islow_565.bmp
|
||||
rm testout_rgb_islow_565.bmp
|
||||
rm -f testout_rgb_islow_565.bmp
|
||||
# CC: RGB->RGB565 (dithered) SAMP: fullsize IDCT: islow ENT: huff
|
||||
./djpeg -dct int -rgb565 -bmp -outfile testout_rgb_islow_565D.bmp testout_rgb_islow.jpg
|
||||
md5/md5cmp $(MD5_BMP_RGB_ISLOW_565D) testout_rgb_islow_565D.bmp
|
||||
rm testout_rgb_islow_565D.bmp testout_rgb_islow.jpg
|
||||
rm -f testout_rgb_islow_565D.bmp testout_rgb_islow.jpg
|
||||
endif
|
||||
|
||||
# CC: RGB->YCC SAMP: fullsize/h2v1 FDCT: ifast ENT: 2-pass huff
|
||||
@@ -377,22 +410,22 @@ endif
|
||||
# CC: YCC->RGB SAMP: fullsize/h2v1 fancy IDCT: ifast ENT: huff
|
||||
./djpeg -dct fast -outfile testout_422_ifast.ppm testout_422_ifast_opt.jpg
|
||||
md5/md5cmp $(MD5_PPM_422_IFAST) testout_422_ifast.ppm
|
||||
rm testout_422_ifast.ppm
|
||||
rm -f testout_422_ifast.ppm
|
||||
# CC: YCC->RGB SAMP: h2v1 merged IDCT: ifast ENT: huff
|
||||
./djpeg -dct fast -nosmooth -outfile testout_422m_ifast.ppm testout_422_ifast_opt.jpg
|
||||
md5/md5cmp $(MD5_PPM_422M_IFAST) testout_422m_ifast.ppm
|
||||
rm testout_422m_ifast.ppm
|
||||
rm -f testout_422m_ifast.ppm
|
||||
if WITH_12BIT
|
||||
rm testout_422_ifast_opt.jpg
|
||||
rm -f testout_422_ifast_opt.jpg
|
||||
else
|
||||
# CC: YCC->RGB565 SAMP: h2v1 merged IDCT: ifast ENT: huff
|
||||
./djpeg -dct int -nosmooth -rgb565 -dither none -bmp -outfile testout_422m_ifast_565.bmp testout_422_ifast_opt.jpg
|
||||
md5/md5cmp $(MD5_BMP_422M_IFAST_565) testout_422m_ifast_565.bmp
|
||||
rm testout_422m_ifast_565.bmp
|
||||
rm -f testout_422m_ifast_565.bmp
|
||||
# CC: YCC->RGB565 (dithered) SAMP: h2v1 merged IDCT: ifast ENT: huff
|
||||
./djpeg -dct int -nosmooth -rgb565 -bmp -outfile testout_422m_ifast_565D.bmp testout_422_ifast_opt.jpg
|
||||
md5/md5cmp $(MD5_BMP_422M_IFAST_565D) testout_422m_ifast_565D.bmp
|
||||
rm testout_422m_ifast_565D.bmp testout_422_ifast_opt.jpg
|
||||
rm -f testout_422m_ifast_565D.bmp testout_422_ifast_opt.jpg
|
||||
endif
|
||||
|
||||
# CC: RGB->YCC SAMP: fullsize/h2v2 FDCT: ifast ENT: prog huff
|
||||
@@ -401,11 +434,11 @@ endif
|
||||
# CC: YCC->RGB SAMP: fullsize/h2v2 fancy IDCT: ifast ENT: prog huff
|
||||
./djpeg -dct fast -outfile testout_420_q100_ifast.ppm testout_420_q100_ifast_prog.jpg
|
||||
md5/md5cmp $(MD5_PPM_420_Q100_IFAST) testout_420_q100_ifast.ppm
|
||||
rm testout_420_q100_ifast.ppm
|
||||
rm -f testout_420_q100_ifast.ppm
|
||||
# CC: YCC->RGB SAMP: h2v2 merged IDCT: ifast ENT: prog huff
|
||||
./djpeg -dct fast -nosmooth -outfile testout_420m_q100_ifast.ppm testout_420_q100_ifast_prog.jpg
|
||||
md5/md5cmp $(MD5_PPM_420M_Q100_IFAST) testout_420m_q100_ifast.ppm
|
||||
rm testout_420m_q100_ifast.ppm testout_420_q100_ifast_prog.jpg
|
||||
rm -f testout_420m_q100_ifast.ppm testout_420_q100_ifast_prog.jpg
|
||||
|
||||
# CC: RGB->Gray SAMP: fullsize FDCT: islow ENT: huff
|
||||
./cjpeg -gray -dct int -outfile testout_gray_islow.jpg $(srcdir)/testimages/testorig.ppm
|
||||
@@ -413,35 +446,36 @@ endif
|
||||
# CC: Gray->Gray SAMP: fullsize IDCT: islow ENT: huff
|
||||
./djpeg -dct int -outfile testout_gray_islow.ppm testout_gray_islow.jpg
|
||||
md5/md5cmp $(MD5_PPM_GRAY_ISLOW) testout_gray_islow.ppm
|
||||
rm testout_gray_islow.ppm
|
||||
rm -f testout_gray_islow.ppm
|
||||
# CC: Gray->RGB SAMP: fullsize IDCT: islow ENT: huff
|
||||
./djpeg -dct int -rgb -outfile testout_gray_islow_rgb.ppm testout_gray_islow.jpg
|
||||
md5/md5cmp $(MD5_PPM_GRAY_ISLOW_RGB) testout_gray_islow_rgb.ppm
|
||||
rm testout_gray_islow_rgb.ppm
|
||||
rm -f testout_gray_islow_rgb.ppm
|
||||
if WITH_12BIT
|
||||
rm testout_gray_islow.jpg
|
||||
rm -f testout_gray_islow.jpg
|
||||
else
|
||||
# CC: Gray->RGB565 SAMP: fullsize IDCT: islow ENT: huff
|
||||
./djpeg -dct int -rgb565 -dither none -bmp -outfile testout_gray_islow_565.bmp testout_gray_islow.jpg
|
||||
md5/md5cmp $(MD5_BMP_GRAY_ISLOW_565) testout_gray_islow_565.bmp
|
||||
rm testout_gray_islow_565.bmp
|
||||
rm -f testout_gray_islow_565.bmp
|
||||
# CC: Gray->RGB565 (dithered) SAMP: fullsize IDCT: islow ENT: huff
|
||||
./djpeg -dct int -rgb565 -bmp -outfile testout_gray_islow_565D.bmp testout_gray_islow.jpg
|
||||
md5/md5cmp $(MD5_BMP_GRAY_ISLOW_565D) testout_gray_islow_565D.bmp
|
||||
rm testout_gray_islow_565D.bmp testout_gray_islow.jpg
|
||||
rm -f testout_gray_islow_565D.bmp testout_gray_islow.jpg
|
||||
endif
|
||||
|
||||
# CC: RGB->YCC SAMP: fullsize smooth/h2v2 smooth FDCT: islow
|
||||
# ENT: 2-pass huff
|
||||
./cjpeg -sample 2x2 -smooth 1 -dct int -opt -outfile testout_420s_ifast_opt.jpg $(srcdir)/testimages/testorig.ppm
|
||||
md5/md5cmp $(MD5_JPEG_420S_IFAST_OPT) testout_420s_ifast_opt.jpg
|
||||
rm testout_420s_ifast_opt.jpg
|
||||
rm -f testout_420s_ifast_opt.jpg
|
||||
|
||||
# The output of the floating point tests is not validated by default, because
|
||||
# the output differs depending on the type of floating point math used, and
|
||||
# this is only deterministic if the DCT/IDCT are implemented using SIMD
|
||||
# instructions on a particular platform. Pass one of the following on the make
|
||||
# command line to validate the floating point tests against one of the expected # results:
|
||||
# command line to validate the floating point tests against one of the expected
|
||||
# results:
|
||||
#
|
||||
# FLOATTEST=sse validate against the expected results from the libjpeg-turbo
|
||||
# SSE SIMD extensions
|
||||
@@ -451,6 +485,9 @@ endif
|
||||
# x86-64 compilers)
|
||||
# FLOATTEST=64bit validate against the exepected results from the C code
|
||||
# when running on a 64-bit FPU
|
||||
# FLOATTEST=387 validate against the expected results from the C code when
|
||||
# the 387 FPU is being used for floating point math (which is
|
||||
# generally the default with x86 compilers)
|
||||
|
||||
# CC: RGB->YCC SAMP: fullsize/int FDCT: float ENT: prog huff
|
||||
./cjpeg -sample 3x2 -dct float -prog -outfile testout_3x2_float_prog.jpg $(srcdir)/testimages/testorig.ppm
|
||||
@@ -458,6 +495,8 @@ endif
|
||||
md5/md5cmp $(MD5_JPEG_3x2_FLOAT_PROG_SSE) testout_3x2_float_prog.jpg; \
|
||||
elif [ "${FLOATTEST}" = "32bit" -o "${FLOATTEST}" = "64bit" ]; then \
|
||||
md5/md5cmp $(MD5_JPEG_3x2_FLOAT_PROG_32BIT) testout_3x2_float_prog.jpg; \
|
||||
elif [ "${FLOATTEST}" = "387" ]; then \
|
||||
md5/md5cmp $(MD5_JPEG_3x2_FLOAT_PROG_387) testout_3x2_float_prog.jpg; \
|
||||
fi
|
||||
# CC: YCC->RGB SAMP: fullsize/int IDCT: float ENT: prog huff
|
||||
./djpeg -dct float -outfile testout_3x2_float.ppm testout_3x2_float_prog.jpg
|
||||
@@ -467,8 +506,10 @@ endif
|
||||
md5/md5cmp $(MD5_PPM_3x2_FLOAT_32BIT) testout_3x2_float.ppm; \
|
||||
elif [ "${FLOATTEST}" = "64bit" ]; then \
|
||||
md5/md5cmp $(MD5_PPM_3x2_FLOAT_64BIT) testout_3x2_float.ppm; \
|
||||
elif [ "${FLOATTEST}" = "387" ]; then \
|
||||
md5/md5cmp $(MD5_PPM_3x2_FLOAT_387) testout_3x2_float.ppm; \
|
||||
fi
|
||||
rm testout_3x2_float.ppm testout_3x2_float_prog.jpg
|
||||
rm -f testout_3x2_float.ppm testout_3x2_float_prog.jpg
|
||||
|
||||
# CC: RGB->YCC SAMP: fullsize/int FDCT: ifast ENT: prog huff
|
||||
./cjpeg -sample 3x2 -dct fast -prog -outfile testout_3x2_ifast_prog.jpg $(srcdir)/testimages/testorig.ppm
|
||||
@@ -476,106 +517,151 @@ endif
|
||||
# CC: YCC->RGB SAMP: fullsize/int IDCT: ifast ENT: prog huff
|
||||
./djpeg -dct fast -outfile testout_3x2_ifast.ppm testout_3x2_ifast_prog.jpg
|
||||
md5/md5cmp $(MD5_PPM_3x2_IFAST) testout_3x2_ifast.ppm
|
||||
rm testout_3x2_ifast.ppm testout_3x2_ifast_prog.jpg
|
||||
rm -f testout_3x2_ifast.ppm testout_3x2_ifast_prog.jpg
|
||||
|
||||
if WITH_ARITH_ENC
|
||||
# CC: YCC->RGB SAMP: fullsize/h2v2 FDCT: islow ENT: arith
|
||||
./cjpeg -dct int -arithmetic -outfile testout_420_islow_ari.jpg $(srcdir)/testimages/testorig.ppm
|
||||
md5/md5cmp $(MD5_JPEG_420_ISLOW_ARI) testout_420_islow_ari.jpg
|
||||
rm testout_420_islow_ari.jpg
|
||||
rm -f testout_420_islow_ari.jpg
|
||||
./jpegtran -arithmetic -outfile testout_420_islow_ari.jpg $(srcdir)/testimages/testimgint.jpg
|
||||
md5/md5cmp $(MD5_JPEG_420_ISLOW_ARI) testout_420_islow_ari.jpg
|
||||
rm testout_420_islow_ari.jpg
|
||||
rm -f testout_420_islow_ari.jpg
|
||||
# CC: YCC->RGB SAMP: fullsize FDCT: islow ENT: prog arith
|
||||
./cjpeg -sample 1x1 -dct int -progressive -arithmetic -outfile testout_444_islow_progari.jpg $(srcdir)/testimages/testorig.ppm
|
||||
./cjpeg -sample 1x1 -dct int -prog -arithmetic -outfile testout_444_islow_progari.jpg $(srcdir)/testimages/testorig.ppm
|
||||
md5/md5cmp $(MD5_JPEG_444_ISLOW_PROGARI) testout_444_islow_progari.jpg
|
||||
rm testout_444_islow_progari.jpg
|
||||
rm -f testout_444_islow_progari.jpg
|
||||
endif
|
||||
if WITH_ARITH_DEC
|
||||
# CC: RGB->YCC SAMP: h2v2 merged IDCT: ifast ENT: arith
|
||||
./djpeg -fast -ppm -outfile testout_420m_ifast_ari.ppm $(srcdir)/testimages/testimgari.jpg
|
||||
md5/md5cmp $(MD5_PPM_420M_IFAST_ARI) testout_420m_ifast_ari.ppm
|
||||
rm testout_420m_ifast_ari.ppm
|
||||
rm -f testout_420m_ifast_ari.ppm
|
||||
./jpegtran -outfile testout_420_islow.jpg $(srcdir)/testimages/testimgari.jpg
|
||||
md5/md5cmp $(MD5_JPEG_420_ISLOW) testout_420_islow.jpg
|
||||
rm testout_420_islow.jpg
|
||||
rm -f testout_420_islow.jpg
|
||||
endif
|
||||
|
||||
# CC: YCC->RGB SAMP: h2v2 merged IDCT: 16x16 islow ENT: huff
|
||||
./djpeg -dct int -scale 2/1 -nosmooth -ppm -outfile testout_420m_islow_2_1.ppm $(srcdir)/testimages/$(TESTORIG)
|
||||
md5/md5cmp $(MD5_PPM_420M_ISLOW_2_1) testout_420m_islow_2_1.ppm
|
||||
rm testout_420m_islow_2_1.ppm
|
||||
rm -f testout_420m_islow_2_1.ppm
|
||||
# CC: YCC->RGB SAMP: h2v2 merged IDCT: 15x15 islow ENT: huff
|
||||
./djpeg -dct int -scale 15/8 -nosmooth -ppm -outfile testout_420m_islow_15_8.ppm $(srcdir)/testimages/$(TESTORIG)
|
||||
md5/md5cmp $(MD5_PPM_420M_ISLOW_15_8) testout_420m_islow_15_8.ppm
|
||||
rm testout_420m_islow_15_8.ppm
|
||||
rm -f testout_420m_islow_15_8.ppm
|
||||
# CC: YCC->RGB SAMP: h2v2 merged IDCT: 13x13 islow ENT: huff
|
||||
./djpeg -dct int -scale 13/8 -nosmooth -ppm -outfile testout_420m_islow_13_8.ppm $(srcdir)/testimages/$(TESTORIG)
|
||||
md5/md5cmp $(MD5_PPM_420M_ISLOW_13_8) testout_420m_islow_13_8.ppm
|
||||
rm testout_420m_islow_13_8.ppm
|
||||
rm -f testout_420m_islow_13_8.ppm
|
||||
# CC: YCC->RGB SAMP: h2v2 merged IDCT: 11x11 islow ENT: huff
|
||||
./djpeg -dct int -scale 11/8 -nosmooth -ppm -outfile testout_420m_islow_11_8.ppm $(srcdir)/testimages/$(TESTORIG)
|
||||
md5/md5cmp $(MD5_PPM_420M_ISLOW_11_8) testout_420m_islow_11_8.ppm
|
||||
rm testout_420m_islow_11_8.ppm
|
||||
rm -f testout_420m_islow_11_8.ppm
|
||||
# CC: YCC->RGB SAMP: h2v2 merged IDCT: 9x9 islow ENT: huff
|
||||
./djpeg -dct int -scale 9/8 -nosmooth -ppm -outfile testout_420m_islow_9_8.ppm $(srcdir)/testimages/$(TESTORIG)
|
||||
md5/md5cmp $(MD5_PPM_420M_ISLOW_9_8) testout_420m_islow_9_8.ppm
|
||||
rm testout_420m_islow_9_8.ppm
|
||||
rm -f testout_420m_islow_9_8.ppm
|
||||
# CC: YCC->RGB SAMP: h2v2 merged IDCT: 7x7 islow/14x14 islow ENT: huff
|
||||
./djpeg -dct int -scale 7/8 -nosmooth -ppm -outfile testout_420m_islow_7_8.ppm $(srcdir)/testimages/$(TESTORIG)
|
||||
md5/md5cmp $(MD5_PPM_420M_ISLOW_7_8) testout_420m_islow_7_8.ppm
|
||||
rm testout_420m_islow_7_8.ppm
|
||||
rm -f testout_420m_islow_7_8.ppm
|
||||
# CC: YCC->RGB SAMP: h2v2 merged IDCT: 6x6 islow/12x12 islow ENT: huff
|
||||
./djpeg -dct int -scale 3/4 -nosmooth -ppm -outfile testout_420m_islow_3_4.ppm $(srcdir)/testimages/$(TESTORIG)
|
||||
md5/md5cmp $(MD5_PPM_420M_ISLOW_3_4) testout_420m_islow_3_4.ppm
|
||||
rm testout_420m_islow_3_4.ppm
|
||||
rm -f testout_420m_islow_3_4.ppm
|
||||
# CC: YCC->RGB SAMP: h2v2 merged IDCT: 5x5 islow/10x10 islow ENT: huff
|
||||
./djpeg -dct int -scale 5/8 -nosmooth -ppm -outfile testout_420m_islow_5_8.ppm $(srcdir)/testimages/$(TESTORIG)
|
||||
md5/md5cmp $(MD5_PPM_420M_ISLOW_5_8) testout_420m_islow_5_8.ppm
|
||||
rm testout_420m_islow_5_8.ppm
|
||||
rm -f testout_420m_islow_5_8.ppm
|
||||
# CC: YCC->RGB SAMP: h2v2 merged IDCT: 4x4 islow/8x8 islow ENT: huff
|
||||
./djpeg -dct int -scale 1/2 -nosmooth -ppm -outfile testout_420m_islow_1_2.ppm $(srcdir)/testimages/$(TESTORIG)
|
||||
md5/md5cmp $(MD5_PPM_420M_ISLOW_1_2) testout_420m_islow_1_2.ppm
|
||||
rm testout_420m_islow_1_2.ppm
|
||||
rm -f testout_420m_islow_1_2.ppm
|
||||
# CC: YCC->RGB SAMP: h2v2 merged IDCT: 3x3 islow/6x6 islow ENT: huff
|
||||
./djpeg -dct int -scale 3/8 -nosmooth -ppm -outfile testout_420m_islow_3_8.ppm $(srcdir)/testimages/$(TESTORIG)
|
||||
md5/md5cmp $(MD5_PPM_420M_ISLOW_3_8) testout_420m_islow_3_8.ppm
|
||||
rm testout_420m_islow_3_8.ppm
|
||||
rm -f testout_420m_islow_3_8.ppm
|
||||
# CC: YCC->RGB SAMP: h2v2 merged IDCT: 2x2 islow/4x4 islow ENT: huff
|
||||
./djpeg -dct int -scale 1/4 -nosmooth -ppm -outfile testout_420m_islow_1_4.ppm $(srcdir)/testimages/$(TESTORIG)
|
||||
md5/md5cmp $(MD5_PPM_420M_ISLOW_1_4) testout_420m_islow_1_4.ppm
|
||||
rm testout_420m_islow_1_4.ppm
|
||||
rm -f testout_420m_islow_1_4.ppm
|
||||
# CC: YCC->RGB SAMP: h2v2 merged IDCT: 1x1 islow/2x2 islow ENT: huff
|
||||
./djpeg -dct int -scale 1/8 -nosmooth -ppm -outfile testout_420m_islow_1_8.ppm $(srcdir)/testimages/$(TESTORIG)
|
||||
md5/md5cmp $(MD5_PPM_420M_ISLOW_1_8) testout_420m_islow_1_8.ppm
|
||||
rm testout_420m_islow_1_8.ppm
|
||||
rm -f testout_420m_islow_1_8.ppm
|
||||
if WITH_12BIT
|
||||
else
|
||||
# CC: YCC->RGB (dithered) SAMP: h2v2 fancy IDCT: islow ENT: huff
|
||||
./djpeg -dct int -colors 256 -bmp -outfile testout_420_islow_256.bmp $(srcdir)/testimages/$(TESTORIG)
|
||||
md5/md5cmp $(MD5_BMP_420_ISLOW_256) testout_420_islow_256.bmp
|
||||
rm testout_420_islow_256.bmp
|
||||
rm -f testout_420_islow_256.bmp
|
||||
# CC: YCC->RGB565 SAMP: h2v2 fancy IDCT: islow ENT: huff
|
||||
./djpeg -dct int -rgb565 -dither none -bmp -outfile testout_420_islow_565.bmp $(srcdir)/testimages/$(TESTORIG)
|
||||
md5/md5cmp $(MD5_BMP_420_ISLOW_565) testout_420_islow_565.bmp
|
||||
rm testout_420_islow_565.bmp
|
||||
rm -f testout_420_islow_565.bmp
|
||||
# CC: YCC->RGB565 (dithered) SAMP: h2v2 fancy IDCT: islow ENT: huff
|
||||
./djpeg -dct int -rgb565 -bmp -outfile testout_420_islow_565D.bmp $(srcdir)/testimages/$(TESTORIG)
|
||||
md5/md5cmp $(MD5_BMP_420_ISLOW_565D) testout_420_islow_565D.bmp
|
||||
rm testout_420_islow_565D.bmp
|
||||
rm -f testout_420_islow_565D.bmp
|
||||
# CC: YCC->RGB565 SAMP: h2v2 merged IDCT: islow ENT: huff
|
||||
./djpeg -dct int -nosmooth -rgb565 -dither none -bmp -outfile testout_420m_islow_565.bmp $(srcdir)/testimages/$(TESTORIG)
|
||||
md5/md5cmp $(MD5_BMP_420M_ISLOW_565) testout_420m_islow_565.bmp
|
||||
rm testout_420m_islow_565.bmp
|
||||
rm -f testout_420m_islow_565.bmp
|
||||
# CC: YCC->RGB565 (dithered) SAMP: h2v2 merged IDCT: islow ENT: huff
|
||||
./djpeg -dct int -nosmooth -rgb565 -bmp -outfile testout_420m_islow_565D.bmp $(srcdir)/testimages/$(TESTORIG)
|
||||
md5/md5cmp $(MD5_BMP_420M_ISLOW_565D) testout_420m_islow_565D.bmp
|
||||
rm testout_420m_islow_565D.bmp
|
||||
rm -f testout_420m_islow_565D.bmp
|
||||
endif
|
||||
|
||||
# Partial decode tests. These tests are designed to cover all of the possible
|
||||
# code paths in jpeg_skip_scanlines().
|
||||
|
||||
# Context rows: Yes Intra-iMCU row: Yes iMCU row prefetch: No ENT: huff
|
||||
./djpeg -dct int -skip 15,31 -ppm -outfile testout_420_islow_skip15,31.ppm $(srcdir)/testimages/$(TESTORIG)
|
||||
md5/md5cmp $(MD5_PPM_420_ISLOW_SKIP15_31) testout_420_islow_skip15,31.ppm
|
||||
rm -f testout_420_islow_skip15,31.ppm
|
||||
# Context rows: Yes Intra-iMCU row: No iMCU row prefetch: Yes ENT: arith
|
||||
if WITH_ARITH_DEC
|
||||
./djpeg -dct int -skip 16,139 -ppm -outfile testout_420_islow_ari_skip16,139.ppm $(srcdir)/testimages/testimgari.jpg
|
||||
md5/md5cmp $(MD5_PPM_420_ISLOW_ARI_SKIP16_139) testout_420_islow_ari_skip16,139.ppm
|
||||
rm -f testout_420_islow_ari_skip16,139.ppm
|
||||
endif
|
||||
# Context rows: Yes Intra-iMCU row: No iMCU row prefetch: No ENT: prog huff
|
||||
./cjpeg -dct int -prog -outfile testout_420_islow_prog.jpg $(srcdir)/testimages/testorig.ppm
|
||||
./djpeg -dct int -crop 62x62+71+71 -ppm -outfile testout_420_islow_prog_crop62x62,71,71.ppm testout_420_islow_prog.jpg
|
||||
md5/md5cmp $(MD5_PPM_420_ISLOW_PROG_CROP62x62_71_71) testout_420_islow_prog_crop62x62,71,71.ppm
|
||||
rm -f testout_420_islow_prog_crop62x62,71,71.ppm testout_420_islow_prog.jpg
|
||||
# Context rows: Yes Intra-iMCU row: No iMCU row prefetch: No ENT: arith
|
||||
if WITH_ARITH_DEC
|
||||
./djpeg -dct int -crop 53x53+4+4 -ppm -outfile testout_420_islow_ari_crop53x53,4,4.ppm $(srcdir)/testimages/testimgari.jpg
|
||||
md5/md5cmp $(MD5_PPM_420_ISLOW_ARI_CROP53x53_4_4) testout_420_islow_ari_crop53x53,4,4.ppm
|
||||
rm -f testout_420_islow_ari_crop53x53,4,4.ppm
|
||||
endif
|
||||
# Context rows: No Intra-iMCU row: Yes ENT: huff
|
||||
./cjpeg -dct int -sample 1x1 -outfile testout_444_islow.jpg $(srcdir)/testimages/testorig.ppm
|
||||
./djpeg -dct int -skip 1,6 -ppm -outfile testout_444_islow_skip1,6.ppm testout_444_islow.jpg
|
||||
md5/md5cmp $(MD5_PPM_444_ISLOW_SKIP1_6) testout_444_islow_skip1,6.ppm
|
||||
rm -f testout_444_islow_skip1,6.ppm testout_444_islow.jpg
|
||||
# Context rows: No Intra-iMCU row: No ENT: prog huff
|
||||
./cjpeg -dct int -prog -sample 1x1 -outfile testout_444_islow_prog.jpg $(srcdir)/testimages/testorig.ppm
|
||||
./djpeg -dct int -crop 98x98+13+13 -ppm -outfile testout_444_islow_prog_crop98x98,13,13.ppm testout_444_islow_prog.jpg
|
||||
md5/md5cmp $(MD5_PPM_444_ISLOW_PROG_CROP98x98_13_13) testout_444_islow_prog_crop98x98,13,13.ppm
|
||||
rm -f testout_444_islow_prog_crop98x98,13,13.ppm testout_444_islow_prog.jpg
|
||||
# Context rows: No Intra-iMCU row: No ENT: arith
|
||||
if WITH_ARITH_ENC
|
||||
./cjpeg -dct int -arithmetic -sample 1x1 -outfile testout_444_islow_ari.jpg $(srcdir)/testimages/testorig.ppm
|
||||
if WITH_ARITH_DEC
|
||||
./djpeg -dct int -crop 37x37+0+0 -ppm -outfile testout_444_islow_ari_crop37x37,0,0.ppm testout_444_islow_ari.jpg
|
||||
md5/md5cmp $(MD5_PPM_444_ISLOW_ARI_CROP37x37_0_0) testout_444_islow_ari_crop37x37,0,0.ppm
|
||||
rm -f testout_444_islow_ari_crop37x37,0,0.ppm
|
||||
endif
|
||||
rm -f testout_444_islow_ari.jpg
|
||||
endif
|
||||
|
||||
./jpegtran -crop 120x90+20+50 -transpose -perfect -outfile testout_crop.jpg $(srcdir)/testimages/$(TESTORIG)
|
||||
md5/md5cmp $(MD5_JPEG_CROP) testout_crop.jpg
|
||||
rm testout_crop.jpg
|
||||
rm -f testout_crop.jpg
|
||||
echo GREAT SUCCESS!
|
||||
|
||||
|
||||
@@ -685,12 +771,12 @@ udmg: all pkgscripts/makemacpkg pkgscripts/uninstall
|
||||
sh pkgscripts/makemacpkg -build32 ${BUILDDIR32}
|
||||
|
||||
iosdmg: all pkgscripts/makemacpkg pkgscripts/uninstall
|
||||
sh pkgscripts/makemacpkg -build32 ${BUILDDIR32} -buildarmv6 ${BUILDDIRARMV6} -buildarmv7 ${BUILDDIRARMV7} -buildarmv7s ${BUILDDIRARMV7S} -buildarmv8 ${BUILDDIRARMV8} -lipo "${LIPO}"
|
||||
sh pkgscripts/makemacpkg -build32 ${BUILDDIR32} -buildarmv7 ${BUILDDIRARMV7} -buildarmv7s ${BUILDDIRARMV7S} -buildarmv8 ${BUILDDIRARMV8} -lipo "${LIPO}"
|
||||
|
||||
else
|
||||
|
||||
iosdmg: all pkgscripts/makemacpkg pkgscripts/uninstall
|
||||
sh pkgscripts/makemacpkg -buildarmv6 ${BUILDDIRARMV6} -buildarmv7 ${BUILDDIRARMV7} -buildarmv7s ${BUILDDIRARMV7S} -buildarmv8 ${BUILDDIRARMV8} -lipo "${LIPO}"
|
||||
sh pkgscripts/makemacpkg -buildarmv7 ${BUILDDIRARMV7} -buildarmv7s ${BUILDDIRARMV7S} -buildarmv8 ${BUILDDIRARMV8} -lipo "${LIPO}"
|
||||
|
||||
endif
|
||||
|
||||
|
||||
364
README-turbo.txt
364
README-turbo.txt
@@ -1,364 +0,0 @@
|
||||
*******************************************************************************
|
||||
** Background
|
||||
*******************************************************************************
|
||||
|
||||
libjpeg-turbo is a JPEG image codec that uses SIMD instructions (MMX, SSE2,
|
||||
NEON) to accelerate baseline JPEG compression and decompression on x86, x86-64,
|
||||
and ARM systems. On such systems, libjpeg-turbo is generally 2-4x as fast as
|
||||
libjpeg, all else being equal. On other types of systems, libjpeg-turbo can
|
||||
still outperform libjpeg by a significant amount, by virtue of its
|
||||
highly-optimized Huffman coding routines. In many cases, the performance of
|
||||
libjpeg-turbo rivals that of proprietary high-speed JPEG codecs.
|
||||
|
||||
libjpeg-turbo implements both the traditional libjpeg API as well as the less
|
||||
powerful but more straightforward TurboJPEG API. libjpeg-turbo also features
|
||||
colorspace extensions that allow it to compress from/decompress to 32-bit and
|
||||
big-endian pixel buffers (RGBX, XBGR, etc.), as well as a full-featured Java
|
||||
interface.
|
||||
|
||||
libjpeg-turbo was originally based on libjpeg/SIMD, an MMX-accelerated
|
||||
derivative of libjpeg v6b developed by Miyasaka Masaru. The TigerVNC and
|
||||
VirtualGL projects made numerous enhancements to the codec in 2009, and in
|
||||
early 2010, libjpeg-turbo spun off into an independent project, with the goal
|
||||
of making high-speed JPEG compression/decompression technology available to a
|
||||
broader range of users and developers.
|
||||
|
||||
|
||||
*******************************************************************************
|
||||
** License
|
||||
*******************************************************************************
|
||||
|
||||
Most of libjpeg-turbo inherits the non-restrictive, BSD-style license used by
|
||||
libjpeg (see README.) The TurboJPEG wrapper (both C and Java versions) and
|
||||
associated test programs bear a similar license, which is reproduced below:
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
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.
|
||||
|
||||
|
||||
*******************************************************************************
|
||||
** Using libjpeg-turbo
|
||||
*******************************************************************************
|
||||
|
||||
libjpeg-turbo includes two APIs that can be used to compress and decompress
|
||||
JPEG images:
|
||||
|
||||
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 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. The libjpeg API implementation in libjpeg-turbo
|
||||
is both API/ABI-compatible and mathematically compatible with libjpeg v6b.
|
||||
It can also optionally be configured to be API/ABI-compatible with libjpeg v7
|
||||
and v8 (see below.)
|
||||
|
||||
There is no significant performance advantage to either API when both are used
|
||||
to perform similar operations.
|
||||
|
||||
=====================
|
||||
Colorspace Extensions
|
||||
=====================
|
||||
|
||||
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 */
|
||||
JCS_EXT_RGBX /* red/green/blue/x */
|
||||
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_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 compressing from/decompressing to an RGB buffer.
|
||||
|
||||
Your application can check for the existence of these extensions at compile
|
||||
time with:
|
||||
|
||||
#ifdef JCS_EXTENSIONS
|
||||
|
||||
At run time, attempting to use these extensions with a libjpeg implementation
|
||||
that does not support them will result in a "Bogus input colorspace" error.
|
||||
Applications can trap this error in order to test whether run-time support is
|
||||
available for the colorspace extensions.
|
||||
|
||||
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 Emulation
|
||||
===================================
|
||||
|
||||
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 were
|
||||
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 not
|
||||
as widely used as v6b, enough programs (including a few Linux distros) made
|
||||
the switch that there was a demand to emulate the libjpeg v7 and v8 ABIs
|
||||
in libjpeg-turbo. It should be noted, however, that this feature was added
|
||||
primarily so that applications that had already been compiled to use libjpeg
|
||||
v7+ could take advantage of accelerated baseline JPEG encoding/decoding
|
||||
without recompiling. libjpeg-turbo does not claim to support all of the
|
||||
libjpeg v7+ features, nor to produce identical output to libjpeg v7+ in all
|
||||
cases (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 that emulates the libjpeg v7 or v8 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.
|
||||
|
||||
Support for libjpeg v7 and v8 Features:
|
||||
---------------------------------------
|
||||
|
||||
Fully supported:
|
||||
|
||||
-- libjpeg: IDCT scaling extensions in decompressor
|
||||
libjpeg-turbo supports IDCT scaling with scaling factors of 1/8, 1/4, 3/8,
|
||||
1/2, 5/8, 3/4, 7/8, 9/8, 5/4, 11/8, 3/2, 13/8, 7/4, 15/8, and 2/1 (only 1/4
|
||||
and 1/2 are SIMD-accelerated.)
|
||||
|
||||
-- libjpeg: arithmetic coding
|
||||
|
||||
-- libjpeg: In-memory source and destination managers
|
||||
See notes below.
|
||||
|
||||
-- cjpeg: Separate quality settings for luminance and chrominance
|
||||
Note that the libpjeg v7+ API was extended to accommodate this feature only
|
||||
for convenience purposes. It has always been possible to implement this
|
||||
feature with libjpeg v6b (see rdswitch.c for an example.)
|
||||
|
||||
-- cjpeg: 32-bit BMP support
|
||||
|
||||
-- cjpeg: -rgb option
|
||||
|
||||
-- jpegtran: lossless cropping
|
||||
|
||||
-- jpegtran: -perfect option
|
||||
|
||||
-- jpegtran: forcing width/height when performing lossless crop
|
||||
|
||||
-- rdjpgcom: -raw option
|
||||
|
||||
-- rdjpgcom: locale awareness
|
||||
|
||||
|
||||
Not supported:
|
||||
|
||||
NOTE: As of this writing, extensive research has been conducted into the
|
||||
usefulness of DCT scaling as a means of data reduction and SmartScale as a
|
||||
means of quality improvement. The reader is invited to peruse the research at
|
||||
http://www.libjpeg-turbo.org/About/SmartScale and draw his/her own conclusions,
|
||||
but it is the general belief of our project that these features have not
|
||||
demonstrated sufficient usefulness to justify inclusion in libjpeg-turbo.
|
||||
|
||||
-- libjpeg: DCT scaling in compressor
|
||||
cinfo.scale_num and cinfo.scale_denom are silently ignored.
|
||||
There is no technical reason why DCT scaling could not be supported when
|
||||
emulating the libjpeg v7+ API/ABI, but without the SmartScale extension (see
|
||||
below), only scaling factors of 1/2, 8/15, 4/7, 8/13, 2/3, 8/11, 4/5, and
|
||||
8/9 would be available, 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. Providing support for this new format would be
|
||||
feasible (particularly without full acceleration.) However, until/unless
|
||||
the format becomes either an official industry standard or, at minimum, an
|
||||
accepted solution in the community, we are hesitant to implement it, as
|
||||
there is no sense of whether or how it might change in the future. It is
|
||||
our belief that SmartScale has not demonstrated sufficient usefulness as a
|
||||
lossless format nor as a means of quality enhancement, and thus, our primary
|
||||
interest in providing this feature would be as a means of supporting
|
||||
additional DCT scaling factors.
|
||||
|
||||
-- libjpeg: Fancy downsampling in compressor
|
||||
cinfo.do_fancy_downsampling is silently ignored.
|
||||
This requires the DCT scaling feature, which is not supported.
|
||||
|
||||
-- jpegtran: Scaling
|
||||
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.
|
||||
|
||||
What About libjpeg v9?
|
||||
----------------------
|
||||
|
||||
libjpeg v9 introduced yet another field to the JPEG compression structure
|
||||
(color_transform), thus making the ABI backward incompatible with that of
|
||||
libjpeg v8. This new field was introduced solely for the purpose of supporting
|
||||
lossless SmartScale encoding. Further, there was actually no reason to extend
|
||||
the API in this manner, as the color transform could have just as easily been
|
||||
activated by way of a new JPEG colorspace constant, thus preserving backward
|
||||
ABI compatibility.
|
||||
|
||||
Our research (see link above) has shown that lossless SmartScale does not
|
||||
generally accomplish anything that can't already be accomplished better with
|
||||
existing, standard lossless formats. Thus, at this time, it is our belief that
|
||||
there is not sufficient technical justification for software to upgrade from
|
||||
libjpeg v8 to libjpeg v9, and therefore, not sufficient technical justification
|
||||
for us to emulate the libjpeg v9 ABI.
|
||||
|
||||
=====================================
|
||||
In-Memory Source/Destination Managers
|
||||
=====================================
|
||||
|
||||
By default, libjpeg-turbo 1.3 and later includes the jpeg_mem_src() and
|
||||
jpeg_mem_dest() functions, even when not emulating the libjpeg v8 API/ABI.
|
||||
Previously, it was necessary to build libjpeg-turbo from source with libjpeg v8
|
||||
API/ABI emulation in order to use the in-memory source/destination managers,
|
||||
but several projects requested that those functions be included when emulating
|
||||
the libjpeg v6b API/ABI as well. This allows the use of those functions by
|
||||
programs that need them without breaking ABI compatibility for programs that
|
||||
don't, and it allows those functions to be provided in the "official"
|
||||
libjpeg-turbo binaries.
|
||||
|
||||
Those who are concerned about maintaining strict conformance with the libjpeg
|
||||
v6b or v7 API can pass an argument of --without-mem-srcdst to configure or
|
||||
an argument of -DWITH_MEM_SRCDST=0 to CMake prior to building libjpeg-turbo.
|
||||
This will restore the pre-1.3 behavior, in which jpeg_mem_src() and
|
||||
jpeg_mem_dest() are only included when emulating the libjpeg v8 API/ABI.
|
||||
|
||||
On Un*x systems, including the in-memory source/destination managers changes
|
||||
the dynamic library version from 62.0.0 to 62.1.0 if using libjpeg v6b API/ABI
|
||||
emulation and from 7.0.0 to 7.1.0 if using libjpeg v7 API/ABI emulation.
|
||||
|
||||
Note that, on most Un*x systems, the dynamic linker will not look for a
|
||||
function in a library until that function is actually used. Thus, if a program
|
||||
is built against libjpeg-turbo 1.3+ and uses jpeg_mem_src() or jpeg_mem_dest(),
|
||||
that program will not fail if run against an older version of libjpeg-turbo or
|
||||
against libjpeg v7- until the program actually tries to call jpeg_mem_src() or
|
||||
jpeg_mem_dest(). Such is not the case on Windows. If a program is built
|
||||
against the libjpeg-turbo 1.3+ DLL and uses jpeg_mem_src() or jpeg_mem_dest(),
|
||||
then it must use the libjpeg-turbo 1.3+ DLL at run time.
|
||||
|
||||
Both cjpeg and djpeg have been extended to allow testing the in-memory
|
||||
source/destination manager functions. See their respective man pages for more
|
||||
details.
|
||||
|
||||
|
||||
*******************************************************************************
|
||||
** Mathematical Compatibility
|
||||
*******************************************************************************
|
||||
|
||||
For the most part, libjpeg-turbo should produce identical output to libjpeg
|
||||
v6b. The one exception to this is when using the floating point DCT/IDCT, in
|
||||
which case the outputs of libjpeg v6b and libjpeg-turbo can differ for the
|
||||
following reasons:
|
||||
|
||||
-- The SSE/SSE2 floating point DCT implementation in libjpeg-turbo is ever so
|
||||
slightly more accurate than the implementation in libjpeg v6b, but not by
|
||||
any amount perceptible to human vision (generally in the range of 0.01 to
|
||||
0.08 dB gain in PNSR.)
|
||||
-- When not using the SIMD extensions, libjpeg-turbo uses the more accurate
|
||||
(and slightly faster) floating point IDCT algorithm introduced in libjpeg
|
||||
v8a as opposed to the algorithm used in libjpeg v6b. It should be noted,
|
||||
however, that this algorithm basically brings the accuracy of the floating
|
||||
point IDCT in line with the accuracy of the slow integer IDCT. The floating
|
||||
point DCT/IDCT algorithms are mainly a legacy feature, and they do not
|
||||
produce significantly more accuracy than the slow integer algorithms (to put
|
||||
numbers on this, the typical difference in PNSR between the two algorithms
|
||||
is less than 0.10 dB, whereas changing the quality level by 1 in the upper
|
||||
range of the quality scale is typically more like a 1.0 dB difference.)
|
||||
-- If the floating point algorithms in libjpeg-turbo are not implemented using
|
||||
SIMD instructions on a particular platform, then the accuracy of the
|
||||
floating point DCT/IDCT can depend on the compiler settings.
|
||||
|
||||
While libjpeg-turbo does emulate the libjpeg v8 API/ABI, under the hood, it is
|
||||
still using the same algorithms as libjpeg v6b, so there are several specific
|
||||
cases in which libjpeg-turbo cannot be expected to produce the same output as
|
||||
libjpeg v8:
|
||||
|
||||
-- When decompressing using scaling factors of 1/2 and 1/4, because libjpeg v8
|
||||
implements those scaling algorithms differently than libjpeg v6b does, and
|
||||
libjpeg-turbo's SIMD extensions are based on the libjpeg v6b behavior.
|
||||
|
||||
-- When using chrominance subsampling, because libjpeg v8 implements this
|
||||
with its DCT/IDCT scaling algorithms rather than with a separate
|
||||
downsampling/upsampling algorithm. In our testing, the subsampled/upsampled
|
||||
output of libjpeg v8 is less accurate than that of libjpeg v6b for this
|
||||
reason.
|
||||
|
||||
-- When decompressing using a scaling factor > 1 and merged (AKA "non-fancy" or
|
||||
"non-smooth") chrominance upsampling, because libjpeg v8 does not support
|
||||
merged upsampling with scaling factors > 1.
|
||||
|
||||
|
||||
*******************************************************************************
|
||||
** Performance Pitfalls
|
||||
*******************************************************************************
|
||||
|
||||
===============
|
||||
Restart Markers
|
||||
===============
|
||||
|
||||
The optimized Huffman decoder in libjpeg-turbo does not handle restart markers
|
||||
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
|
||||
===============================================
|
||||
|
||||
The algorithm used by the SIMD-accelerated quantization function cannot produce
|
||||
correct results whenever the fast integer forward DCT is used along with a JPEG
|
||||
quality of 98-100. Thus, libjpeg-turbo must use the non-SIMD quantization
|
||||
function in those cases. This causes performance to drop by as much as 40%.
|
||||
It is therefore strongly advised that you use the slow integer forward DCT
|
||||
whenever encoding images with a JPEG quality of 98 or higher.
|
||||
@@ -1,7 +1,7 @@
|
||||
libjpeg-turbo note: This file has been modified by The libjpeg-turbo Project
|
||||
to include only information relevant to libjpeg-turbo, to wordsmith certain
|
||||
sections, and to remove impolitic language that existed in the libjpeg v8
|
||||
README. It is included only for reference. Please see README-turbo.txt for
|
||||
README. It is included only for reference. Please see README.md for
|
||||
information specific to libjpeg-turbo.
|
||||
|
||||
|
||||
@@ -128,7 +128,7 @@ with respect to this software, its quality, accuracy, merchantability, or
|
||||
fitness for a particular purpose. This software is provided "AS IS", and you,
|
||||
its user, assume the entire risk as to its quality and accuracy.
|
||||
|
||||
This software is copyright (C) 1991-2012, Thomas G. Lane, Guido Vollbeding.
|
||||
This software is copyright (C) 1991-2016, Thomas G. Lane, Guido Vollbeding.
|
||||
All Rights Reserved except as specified below.
|
||||
|
||||
Permission is hereby granted to use, copy, modify, and distribute this
|
||||
@@ -166,11 +166,11 @@ ltmain.sh). Another support script, install-sh, is copyright by X Consortium
|
||||
but is also freely distributable.
|
||||
|
||||
The IJG distribution formerly included code to read and write GIF files.
|
||||
To avoid entanglement with the Unisys LZW patent, GIF reading support has
|
||||
been removed altogether, and the GIF writer has been simplified to produce
|
||||
"uncompressed GIFs". This technique does not use the LZW algorithm; the
|
||||
resulting GIF files are larger than usual, but are readable by all standard
|
||||
GIF decoders.
|
||||
To avoid entanglement with the Unisys LZW patent (now expired), GIF reading
|
||||
support has been removed altogether, and the GIF writer has been simplified
|
||||
to produce "uncompressed GIFs". This technique does not use the LZW
|
||||
algorithm; the resulting GIF files are larger than usual, but are readable
|
||||
by all standard GIF decoders.
|
||||
|
||||
We are required to state that
|
||||
"The Graphics Interchange Format(c) is the Copyright property of
|
||||
@@ -189,8 +189,8 @@ The best short technical introduction to the JPEG compression algorithm is
|
||||
Communications of the ACM, April 1991 (vol. 34 no. 4), pp. 30-44.
|
||||
(Adjacent articles in that issue discuss MPEG motion picture compression,
|
||||
applications of JPEG, and related topics.) If you don't have the CACM issue
|
||||
handy, a PostScript file containing a revised version of Wallace's article is
|
||||
available at http://www.ijg.org/files/wallace.ps.gz. The file (actually
|
||||
handy, a PDF file containing a revised version of Wallace's article is
|
||||
available at http://www.ijg.org/files/Wallace.JPEG.pdf. The file (actually
|
||||
a preprint for an article that appeared in IEEE Trans. Consumer Electronics)
|
||||
omits the sample images that appeared in CACM, but it includes corrections
|
||||
and some added material. Note: the Wallace article is copyright ACM and IEEE,
|
||||
@@ -246,9 +246,7 @@ 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.v8d.tar.gz, and in Windows-compatible
|
||||
"zip" archive format as http://www.ijg.org/files/jpegsr8d.zip.
|
||||
directory "files".
|
||||
|
||||
The JPEG FAQ (Frequently Asked Questions) article is a source of some
|
||||
general information about JPEG.
|
||||
341
README.md
Executable file
341
README.md
Executable file
@@ -0,0 +1,341 @@
|
||||
Background
|
||||
==========
|
||||
|
||||
libjpeg-turbo is a JPEG image codec that uses SIMD instructions (MMX, SSE2,
|
||||
NEON, AltiVec) to accelerate baseline JPEG compression and decompression on
|
||||
x86, x86-64, ARM, and PowerPC systems. On such systems, libjpeg-turbo is
|
||||
generally 2-6x as fast as libjpeg, all else being equal. On other types of
|
||||
systems, libjpeg-turbo can still outperform libjpeg by a significant amount, by
|
||||
virtue of its highly-optimized Huffman coding routines. In many cases, the
|
||||
performance of libjpeg-turbo rivals that of proprietary high-speed JPEG codecs.
|
||||
|
||||
libjpeg-turbo implements both the traditional libjpeg API as well as the less
|
||||
powerful but more straightforward TurboJPEG API. libjpeg-turbo also features
|
||||
colorspace extensions that allow it to compress from/decompress to 32-bit and
|
||||
big-endian pixel buffers (RGBX, XBGR, etc.), as well as a full-featured Java
|
||||
interface.
|
||||
|
||||
libjpeg-turbo was originally based on libjpeg/SIMD, an MMX-accelerated
|
||||
derivative of libjpeg v6b developed by Miyasaka Masaru. The TigerVNC and
|
||||
VirtualGL projects made numerous enhancements to the codec in 2009, and in
|
||||
early 2010, libjpeg-turbo spun off into an independent project, with the goal
|
||||
of making high-speed JPEG compression/decompression technology available to a
|
||||
broader range of users and developers.
|
||||
|
||||
|
||||
License
|
||||
=======
|
||||
|
||||
libjpeg-turbo is covered by three compatible BSD-style open source licenses.
|
||||
Refer to [LICENSE.md](LICENSE.md) for a roll-up of license terms.
|
||||
|
||||
|
||||
Building libjpeg-turbo
|
||||
======================
|
||||
|
||||
Refer to [BUILDING.md](BUILDING.md) for complete instructions.
|
||||
|
||||
|
||||
Using libjpeg-turbo
|
||||
===================
|
||||
|
||||
libjpeg-turbo includes two APIs that can be used to compress and decompress
|
||||
JPEG images:
|
||||
|
||||
- **TurboJPEG API**<br>
|
||||
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**<br>
|
||||
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. The libjpeg API implementation in libjpeg-turbo is both
|
||||
API/ABI-compatible and mathematically compatible with libjpeg v6b. It can
|
||||
also optionally be configured to be API/ABI-compatible with libjpeg v7 and v8
|
||||
(see below.)
|
||||
|
||||
There is no significant performance advantage to either API when both are used
|
||||
to perform similar operations.
|
||||
|
||||
Colorspace Extensions
|
||||
---------------------
|
||||
|
||||
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 */
|
||||
JCS_EXT_RGBX /* red/green/blue/x */
|
||||
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_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 compressing from/decompressing to an RGB buffer.
|
||||
|
||||
Your application can check for the existence of these extensions at compile
|
||||
time with:
|
||||
|
||||
#ifdef JCS_EXTENSIONS
|
||||
|
||||
At run time, attempting to use these extensions with a libjpeg implementation
|
||||
that does not support them will result in a "Bogus input colorspace" error.
|
||||
Applications can trap this error in order to test whether run-time support is
|
||||
available for the colorspace extensions.
|
||||
|
||||
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](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 Emulation
|
||||
-----------------------------------
|
||||
|
||||
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 were
|
||||
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 not
|
||||
as widely used as v6b, enough programs (including a few Linux distros) made
|
||||
the switch that there was a demand to emulate the libjpeg v7 and v8 ABIs
|
||||
in libjpeg-turbo. It should be noted, however, that this feature was added
|
||||
primarily so that applications that had already been compiled to use libjpeg
|
||||
v7+ could take advantage of accelerated baseline JPEG encoding/decoding
|
||||
without recompiling. libjpeg-turbo does not claim to support all of the
|
||||
libjpeg v7+ features, nor to produce identical output to libjpeg v7+ in all
|
||||
cases (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 that emulates the libjpeg v7 or v8 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.
|
||||
|
||||
### Support for libjpeg v7 and v8 Features
|
||||
|
||||
#### Fully supported
|
||||
|
||||
- **libjpeg: IDCT scaling extensions in decompressor**<br>
|
||||
libjpeg-turbo supports IDCT scaling with scaling factors of 1/8, 1/4, 3/8,
|
||||
1/2, 5/8, 3/4, 7/8, 9/8, 5/4, 11/8, 3/2, 13/8, 7/4, 15/8, and 2/1 (only 1/4
|
||||
and 1/2 are SIMD-accelerated.)
|
||||
|
||||
- **libjpeg: Arithmetic coding**
|
||||
|
||||
- **libjpeg: In-memory source and destination managers**<br>
|
||||
See notes below.
|
||||
|
||||
- **cjpeg: Separate quality settings for luminance and chrominance**<br>
|
||||
Note that the libpjeg v7+ API was extended to accommodate this feature only
|
||||
for convenience purposes. It has always been possible to implement this
|
||||
feature with libjpeg v6b (see rdswitch.c for an example.)
|
||||
|
||||
- **cjpeg: 32-bit BMP support**
|
||||
|
||||
- **cjpeg: `-rgb` option**
|
||||
|
||||
- **jpegtran: Lossless cropping**
|
||||
|
||||
- **jpegtran: `-perfect` option**
|
||||
|
||||
- **jpegtran: Forcing width/height when performing lossless crop**
|
||||
|
||||
- **rdjpgcom: `-raw` option**
|
||||
|
||||
- **rdjpgcom: Locale awareness**
|
||||
|
||||
|
||||
#### Not supported
|
||||
|
||||
NOTE: As of this writing, extensive research has been conducted into the
|
||||
usefulness of DCT scaling as a means of data reduction and SmartScale as a
|
||||
means of quality improvement. The reader is invited to peruse the research at
|
||||
<http://www.libjpeg-turbo.org/About/SmartScale> and draw his/her own conclusions,
|
||||
but it is the general belief of our project that these features have not
|
||||
demonstrated sufficient usefulness to justify inclusion in libjpeg-turbo.
|
||||
|
||||
- **libjpeg: DCT scaling in compressor**<br>
|
||||
`cinfo.scale_num` and `cinfo.scale_denom` are silently ignored.
|
||||
There is no technical reason why DCT scaling could not be supported when
|
||||
emulating the libjpeg v7+ API/ABI, but without the SmartScale extension (see
|
||||
below), only scaling factors of 1/2, 8/15, 4/7, 8/13, 2/3, 8/11, 4/5, and
|
||||
8/9 would be available, which is of limited usefulness.
|
||||
|
||||
- **libjpeg: SmartScale**<br>
|
||||
`cinfo.block_size` is silently ignored.
|
||||
SmartScale is an extension to the JPEG format that allows for DCT block
|
||||
sizes other than 8x8. Providing support for this new format would be
|
||||
feasible (particularly without full acceleration.) However, until/unless
|
||||
the format becomes either an official industry standard or, at minimum, an
|
||||
accepted solution in the community, we are hesitant to implement it, as
|
||||
there is no sense of whether or how it might change in the future. It is
|
||||
our belief that SmartScale has not demonstrated sufficient usefulness as a
|
||||
lossless format nor as a means of quality enhancement, and thus our primary
|
||||
interest in providing this feature would be as a means of supporting
|
||||
additional DCT scaling factors.
|
||||
|
||||
- **libjpeg: Fancy downsampling in compressor**<br>
|
||||
`cinfo.do_fancy_downsampling` is silently ignored.
|
||||
This requires the DCT scaling feature, which is not supported.
|
||||
|
||||
- **jpegtran: Scaling**<br>
|
||||
This requires both the DCT scaling and SmartScale features, which are not
|
||||
supported.
|
||||
|
||||
- **Lossless RGB JPEG files**<br>
|
||||
This requires the SmartScale feature, which is not supported.
|
||||
|
||||
### What About libjpeg v9?
|
||||
|
||||
libjpeg v9 introduced yet another field to the JPEG compression structure
|
||||
(`color_transform`), thus making the ABI backward incompatible with that of
|
||||
libjpeg v8. This new field was introduced solely for the purpose of supporting
|
||||
lossless SmartScale encoding. Furthermore, there was actually no reason to
|
||||
extend the API in this manner, as the color transform could have just as easily
|
||||
been activated by way of a new JPEG colorspace constant, thus preserving
|
||||
backward ABI compatibility.
|
||||
|
||||
Our research (see link above) has shown that lossless SmartScale does not
|
||||
generally accomplish anything that can't already be accomplished better with
|
||||
existing, standard lossless formats. Therefore, at this time it is our belief
|
||||
that there is not sufficient technical justification for software projects to
|
||||
upgrade from libjpeg v8 to libjpeg v9, and thus there is not sufficient
|
||||
technical justification for us to emulate the libjpeg v9 ABI.
|
||||
|
||||
In-Memory Source/Destination Managers
|
||||
-------------------------------------
|
||||
|
||||
By default, libjpeg-turbo 1.3 and later includes the `jpeg_mem_src()` and
|
||||
`jpeg_mem_dest()` functions, even when not emulating the libjpeg v8 API/ABI.
|
||||
Previously, it was necessary to build libjpeg-turbo from source with libjpeg v8
|
||||
API/ABI emulation in order to use the in-memory source/destination managers,
|
||||
but several projects requested that those functions be included when emulating
|
||||
the libjpeg v6b API/ABI as well. This allows the use of those functions by
|
||||
programs that need them, without breaking ABI compatibility for programs that
|
||||
don't, and it allows those functions to be provided in the "official"
|
||||
libjpeg-turbo binaries.
|
||||
|
||||
Those who are concerned about maintaining strict conformance with the libjpeg
|
||||
v6b or v7 API can pass an argument of `--without-mem-srcdst` to `configure` or
|
||||
an argument of `-DWITH_MEM_SRCDST=0` to `cmake` prior to building
|
||||
libjpeg-turbo. This will restore the pre-1.3 behavior, in which
|
||||
`jpeg_mem_src()` and `jpeg_mem_dest()` are only included when emulating the
|
||||
libjpeg v8 API/ABI.
|
||||
|
||||
On Un*x systems, including the in-memory source/destination managers changes
|
||||
the dynamic library version from 62.1.0 to 62.2.0 if using libjpeg v6b API/ABI
|
||||
emulation and from 7.1.0 to 7.2.0 if using libjpeg v7 API/ABI emulation.
|
||||
|
||||
Note that, on most Un*x systems, the dynamic linker will not look for a
|
||||
function in a library until that function is actually used. Thus, if a program
|
||||
is built against libjpeg-turbo 1.3+ and uses `jpeg_mem_src()` or
|
||||
`jpeg_mem_dest()`, that program will not fail if run against an older version
|
||||
of libjpeg-turbo or against libjpeg v7- until the program actually tries to
|
||||
call `jpeg_mem_src()` or `jpeg_mem_dest()`. Such is not the case on Windows.
|
||||
If a program is built against the libjpeg-turbo 1.3+ DLL and uses
|
||||
`jpeg_mem_src()` or `jpeg_mem_dest()`, then it must use the libjpeg-turbo 1.3+
|
||||
DLL at run time.
|
||||
|
||||
Both cjpeg and djpeg have been extended to allow testing the in-memory
|
||||
source/destination manager functions. See their respective man pages for more
|
||||
details.
|
||||
|
||||
|
||||
Mathematical Compatibility
|
||||
==========================
|
||||
|
||||
For the most part, libjpeg-turbo should produce identical output to libjpeg
|
||||
v6b. The one exception to this is when using the floating point DCT/IDCT, in
|
||||
which case the outputs of libjpeg v6b and libjpeg-turbo can differ for the
|
||||
following reasons:
|
||||
|
||||
- The SSE/SSE2 floating point DCT implementation in libjpeg-turbo is ever so
|
||||
slightly more accurate than the implementation in libjpeg v6b, but not by
|
||||
any amount perceptible to human vision (generally in the range of 0.01 to
|
||||
0.08 dB gain in PNSR.)
|
||||
|
||||
- When not using the SIMD extensions, libjpeg-turbo uses the more accurate
|
||||
(and slightly faster) floating point IDCT algorithm introduced in libjpeg
|
||||
v8a as opposed to the algorithm used in libjpeg v6b. It should be noted,
|
||||
however, that this algorithm basically brings the accuracy of the floating
|
||||
point IDCT in line with the accuracy of the slow integer IDCT. The floating
|
||||
point DCT/IDCT algorithms are mainly a legacy feature, and they do not
|
||||
produce significantly more accuracy than the slow integer algorithms (to put
|
||||
numbers on this, the typical difference in PNSR between the two algorithms
|
||||
is less than 0.10 dB, whereas changing the quality level by 1 in the upper
|
||||
range of the quality scale is typically more like a 1.0 dB difference.)
|
||||
|
||||
- If the floating point algorithms in libjpeg-turbo are not implemented using
|
||||
SIMD instructions on a particular platform, then the accuracy of the
|
||||
floating point DCT/IDCT can depend on the compiler settings.
|
||||
|
||||
While libjpeg-turbo does emulate the libjpeg v8 API/ABI, under the hood it is
|
||||
still using the same algorithms as libjpeg v6b, so there are several specific
|
||||
cases in which libjpeg-turbo cannot be expected to produce the same output as
|
||||
libjpeg v8:
|
||||
|
||||
- When decompressing using scaling factors of 1/2 and 1/4, because libjpeg v8
|
||||
implements those scaling algorithms differently than libjpeg v6b does, and
|
||||
libjpeg-turbo's SIMD extensions are based on the libjpeg v6b behavior.
|
||||
|
||||
- When using chrominance subsampling, because libjpeg v8 implements this
|
||||
with its DCT/IDCT scaling algorithms rather than with a separate
|
||||
downsampling/upsampling algorithm. In our testing, the subsampled/upsampled
|
||||
output of libjpeg v8 is less accurate than that of libjpeg v6b for this
|
||||
reason.
|
||||
|
||||
- When decompressing using a scaling factor > 1 and merged (AKA "non-fancy" or
|
||||
"non-smooth") chrominance upsampling, because libjpeg v8 does not support
|
||||
merged upsampling with scaling factors > 1.
|
||||
|
||||
|
||||
Performance Pitfalls
|
||||
====================
|
||||
|
||||
Restart Markers
|
||||
---------------
|
||||
|
||||
The optimized Huffman decoder in libjpeg-turbo does not handle restart markers
|
||||
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
|
||||
-----------------------------------------------
|
||||
|
||||
The algorithm used by the SIMD-accelerated quantization function cannot produce
|
||||
correct results whenever the fast integer forward DCT is used along with a JPEG
|
||||
quality of 98-100. Thus, libjpeg-turbo must use the non-SIMD quantization
|
||||
function in those cases. This causes performance to drop by as much as 40%.
|
||||
It is therefore strongly advised that you use the slow integer forward DCT
|
||||
whenever encoding images with a JPEG quality of 98 or higher.
|
||||
19
acinclude.m4
19
acinclude.m4
@@ -3,8 +3,11 @@
|
||||
# Check that NASM exists and determine flags
|
||||
AC_DEFUN([AC_PROG_NASM],[
|
||||
|
||||
AC_CHECK_PROGS(NASM, [nasm nasmw yasm])
|
||||
test -z "$NASM" && AC_MSG_ERROR([no nasm (Netwide Assembler) found])
|
||||
AC_ARG_VAR(NASM, [NASM command (used to build the x86/x86-64 SIMD code)])
|
||||
if test "x$NASM" = "x"; then
|
||||
AC_CHECK_PROGS(NASM, [nasm nasmw yasm])
|
||||
test -z "$NASM" && AC_MSG_ERROR([no nasm (Netwide Assembler) found])
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING([for object file format of host system])
|
||||
case "$host_os" in
|
||||
@@ -219,16 +222,20 @@ AC_DEFUN([AC_CHECK_COMPATIBLE_ARM64_ASSEMBLER_IFELSE],[
|
||||
CC="$CCAS"
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
||||
.text
|
||||
.arch armv8-a+fp+simd
|
||||
movi v0.16b, #100]])], ac_good_gnu_arm_assembler=yes)
|
||||
MYVAR .req x0
|
||||
movi v0.16b, #100
|
||||
mov MYVAR, #100
|
||||
.unreq MYVAR]])], ac_good_gnu_arm_assembler=yes)
|
||||
|
||||
ac_use_gas_preprocessor=no
|
||||
if test "x$ac_good_gnu_arm_assembler" = "xno" ; then
|
||||
CC="gas-preprocessor.pl $CCAS"
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
||||
.text
|
||||
.arch armv8-a+fp+simd
|
||||
movi v0.16b, #100]])], ac_use_gas_preprocessor=yes)
|
||||
MYVAR .req x0
|
||||
movi v0.16b, #100
|
||||
mov MYVAR, #100
|
||||
.unreq MYVAR]])], ac_use_gas_preprocessor=yes)
|
||||
fi
|
||||
CFLAGS="$ac_save_CFLAGS"
|
||||
CC="$ac_save_CC"
|
||||
|
||||
57
appveyor.yml
Normal file
57
appveyor.yml
Normal file
@@ -0,0 +1,57 @@
|
||||
install:
|
||||
- cmd: >-
|
||||
mkdir c:\installers
|
||||
|
||||
mkdir c:\temp
|
||||
|
||||
curl -fSL -o c:\installers\nasm-2.10.01-win32.zip http://www.nasm.us/pub/nasm/releasebuilds/2.10.01/win32/nasm-2.10.01-win32.zip
|
||||
|
||||
7z x c:\installers\nasm-2.10.01-win32.zip -oc:\ > c:\installers\nasm.install.log
|
||||
|
||||
set INCLUDE=c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include;c:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\include
|
||||
|
||||
set LIB=c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\lib\amd64;c:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\lib\x64
|
||||
|
||||
set PATH=c:\nasm-2.10.01;c:\Program Files (x86)\NSIS;c:\msys64\mingw32\bin;c:\msys64\usr\bin;c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64;c:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE;c:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\bin\x64;c:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\bin;%PATH%
|
||||
|
||||
set MSYSTEM=MINGW32
|
||||
|
||||
bash -c "pacman --noconfirm -S autoconf automake libtool zip"
|
||||
|
||||
mklink /d "%ProgramData%\Oracle\Java32" "c:\Program Files (x86)\Java\jdk1.6.0"
|
||||
|
||||
git clone --depth=1 https://github.com/libjpeg-turbo/buildscripts.git c:/buildscripts
|
||||
|
||||
build_script:
|
||||
- cmd: >-
|
||||
for /f %%i in ('"cygpath %CD%"') do set MINGWPATH=%%i
|
||||
|
||||
bash c:/buildscripts/buildljt -r file://%MINGWPATH% -b /c/ljt.nightly %APPVEYOR_REPO_BRANCH% -v
|
||||
|
||||
move c:\ljt.nightly\files\*.tar.gz .
|
||||
|
||||
move c:\ljt.nightly\files\*.exe .
|
||||
|
||||
move c:\ljt.nightly\files\*.zip .
|
||||
|
||||
move c:\ljt.nightly\log-windows.txt .
|
||||
|
||||
artifacts:
|
||||
- path: '*.tar.gz'
|
||||
name: Source tarball
|
||||
|
||||
- path: '*-gcc*.exe'
|
||||
name: SDK for MinGW
|
||||
|
||||
- path: '*-vc*.exe'
|
||||
name: SDK for Visual C++
|
||||
|
||||
- path: '*.zip'
|
||||
name: Windows JNI JARs
|
||||
|
||||
- path: 'log-windows.txt'
|
||||
name: Build log
|
||||
|
||||
test: off
|
||||
|
||||
deploy: off
|
||||
21
bmp.c
21
bmp.c
@@ -108,10 +108,14 @@ static void pixelconvert(unsigned char *srcbuf, int srcpf, int srcbottomup,
|
||||
m=(m-k)/(1.0-k);
|
||||
y=(y-k)/(1.0-k);
|
||||
}
|
||||
if(c>1.0) c=1.0; if(c<0.) c=0.;
|
||||
if(m>1.0) m=1.0; if(m<0.) m=0.;
|
||||
if(y>1.0) y=1.0; if(y<0.) y=0.;
|
||||
if(k>1.0) k=1.0; if(k<0.) k=0.;
|
||||
if(c>1.0) c=1.0;
|
||||
if(c<0.) c=0.;
|
||||
if(m>1.0) m=1.0;
|
||||
if(m<0.) m=0.;
|
||||
if(y>1.0) y=1.0;
|
||||
if(y<0.) y=0.;
|
||||
if(k>1.0) k=1.0;
|
||||
if(k<0.) k=0.;
|
||||
*dstcolptr++=(unsigned char)(255.0-c*255.0+0.5);
|
||||
*dstcolptr++=(unsigned char)(255.0-m*255.0+0.5);
|
||||
*dstcolptr++=(unsigned char)(255.0-y*255.0+0.5);
|
||||
@@ -133,9 +137,12 @@ static void pixelconvert(unsigned char *srcbuf, int srcpf, int srcbottomup,
|
||||
double r=c*k/255.;
|
||||
double g=m*k/255.;
|
||||
double b=y*k/255.;
|
||||
if(r>255.0) r=255.0; if(r<0.) r=0.;
|
||||
if(g>255.0) g=255.0; if(g<0.) g=0.;
|
||||
if(b>255.0) b=255.0; if(b<0.) b=0.;
|
||||
if(r>255.0) r=255.0;
|
||||
if(r<0.) r=0.;
|
||||
if(g>255.0) g=255.0;
|
||||
if(g<0.) g=0.;
|
||||
if(b>255.0) b=255.0;
|
||||
if(b<0.) b=0.;
|
||||
dstcolptr[tjRedOffset[dstpf]]=(unsigned char)(r+0.5);
|
||||
dstcolptr[tjGreenOffset[dstpf]]=(unsigned char)(g+0.5);
|
||||
dstcolptr[tjBlueOffset[dstpf]]=(unsigned char)(b+0.5);
|
||||
|
||||
@@ -4,7 +4,8 @@
|
||||
* Copyright (C) 1994-1997, Thomas G. Lane.
|
||||
* Modified 2009 by Guido Vollbeding.
|
||||
* This file is part of the Independent JPEG Group's software.
|
||||
* For conditions of distribution and use, see the accompanying README file.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
* This file defines the error and message codes for the cjpeg/djpeg
|
||||
* applications. These strings are not needed as part of the JPEG library
|
||||
@@ -74,6 +75,7 @@ JMESSAGE(JWRN_GIF_NOMOREDATA, "Ran out of GIF bits")
|
||||
#ifdef PPM_SUPPORTED
|
||||
JMESSAGE(JERR_PPM_COLORSPACE, "PPM output must be grayscale or RGB")
|
||||
JMESSAGE(JERR_PPM_NONNUMERIC, "Nonnumeric data in PPM file")
|
||||
JMESSAGE(JERR_PPM_TOOLARGE, "Integer value too large in PPM file")
|
||||
JMESSAGE(JERR_PPM_NOT, "Not a PPM/PGM file")
|
||||
JMESSAGE(JTRC_PGM, "%ux%u PGM image")
|
||||
JMESSAGE(JTRC_PGM_TEXT, "%ux%u text PGM image")
|
||||
|
||||
5
cdjpeg.c
5
cdjpeg.c
@@ -5,7 +5,8 @@
|
||||
* Copyright (C) 1991-1997, Thomas G. Lane.
|
||||
* It was modified by The libjpeg-turbo Project to include only code relevant
|
||||
* to libjpeg-turbo.
|
||||
* For conditions of distribution and use, see the accompanying README file.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
* This file contains common support routines used by the IJG application
|
||||
* programs (cjpeg, djpeg, jpegtran).
|
||||
@@ -81,7 +82,7 @@ end_progress_monitor (j_common_ptr cinfo)
|
||||
*/
|
||||
|
||||
GLOBAL(boolean)
|
||||
keymatch (char * arg, const char * keyword, int minchars)
|
||||
keymatch (char *arg, const char *keyword, int minchars)
|
||||
{
|
||||
register int ca, ck;
|
||||
register int nmatched = 0;
|
||||
|
||||
19
cdjpeg.h
19
cdjpeg.h
@@ -5,7 +5,8 @@
|
||||
* Copyright (C) 1994-1997, Thomas G. Lane.
|
||||
* It was modified by The libjpeg-turbo Project to include only code relevant
|
||||
* to libjpeg-turbo.
|
||||
* For conditions of distribution and use, see the accompanying README file.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
* This file contains common declarations for the sample applications
|
||||
* cjpeg and djpeg. It is NOT used by the core JPEG library.
|
||||
@@ -23,7 +24,7 @@
|
||||
* Object interface for cjpeg's source file decoding modules
|
||||
*/
|
||||
|
||||
typedef struct cjpeg_source_struct * cjpeg_source_ptr;
|
||||
typedef struct cjpeg_source_struct *cjpeg_source_ptr;
|
||||
|
||||
struct cjpeg_source_struct {
|
||||
void (*start_input) (j_compress_ptr cinfo, cjpeg_source_ptr sinfo);
|
||||
@@ -41,7 +42,7 @@ struct cjpeg_source_struct {
|
||||
* Object interface for djpeg's output file encoding modules
|
||||
*/
|
||||
|
||||
typedef struct djpeg_dest_struct * djpeg_dest_ptr;
|
||||
typedef struct djpeg_dest_struct *djpeg_dest_ptr;
|
||||
|
||||
struct djpeg_dest_struct {
|
||||
/* start_output is called after jpeg_start_decompress finishes.
|
||||
@@ -55,7 +56,7 @@ struct djpeg_dest_struct {
|
||||
void (*finish_output) (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo);
|
||||
|
||||
/* Target file spec; filled in by djpeg.c after object is created. */
|
||||
FILE * output_file;
|
||||
FILE *output_file;
|
||||
|
||||
/* Output pixel-row buffer. Created by module init or start_output.
|
||||
* Width is cinfo->output_width * cinfo->output_components;
|
||||
@@ -82,7 +83,7 @@ struct cdjpeg_progress_mgr {
|
||||
int percent_done;
|
||||
};
|
||||
|
||||
typedef struct cdjpeg_progress_mgr * cd_progress_ptr;
|
||||
typedef struct cdjpeg_progress_mgr *cd_progress_ptr;
|
||||
|
||||
|
||||
/* Module selection routines for I/O modules. */
|
||||
@@ -101,9 +102,9 @@ EXTERN(djpeg_dest_ptr) jinit_write_targa (j_decompress_ptr cinfo);
|
||||
|
||||
/* cjpeg support routines (in rdswitch.c) */
|
||||
|
||||
EXTERN(boolean) read_quant_tables (j_compress_ptr cinfo, char * filename,
|
||||
EXTERN(boolean) read_quant_tables (j_compress_ptr cinfo, char *filename,
|
||||
boolean force_baseline);
|
||||
EXTERN(boolean) read_scan_script (j_compress_ptr cinfo, char * filename);
|
||||
EXTERN(boolean) read_scan_script (j_compress_ptr cinfo, char *filename);
|
||||
EXTERN(boolean) set_quality_ratings (j_compress_ptr cinfo, char *arg,
|
||||
boolean force_baseline);
|
||||
EXTERN(boolean) set_quant_slots (j_compress_ptr cinfo, char *arg);
|
||||
@@ -111,7 +112,7 @@ EXTERN(boolean) set_sample_factors (j_compress_ptr cinfo, char *arg);
|
||||
|
||||
/* djpeg support routines (in rdcolmap.c) */
|
||||
|
||||
EXTERN(void) read_color_map (j_decompress_ptr cinfo, FILE * infile);
|
||||
EXTERN(void) read_color_map (j_decompress_ptr cinfo, FILE *infile);
|
||||
|
||||
/* common support routines (in cdjpeg.c) */
|
||||
|
||||
@@ -119,7 +120,7 @@ EXTERN(void) enable_signal_catcher (j_common_ptr cinfo);
|
||||
EXTERN(void) start_progress_monitor (j_common_ptr cinfo,
|
||||
cd_progress_ptr progress);
|
||||
EXTERN(void) end_progress_monitor (j_common_ptr cinfo);
|
||||
EXTERN(boolean) keymatch (char * arg, const char * keyword, int minchars);
|
||||
EXTERN(boolean) keymatch (char *arg, const char *keyword, int minchars);
|
||||
EXTERN(FILE *) read_stdin (void);
|
||||
EXTERN(FILE *) write_stdout (void);
|
||||
|
||||
|
||||
23
change.log
23
change.log
@@ -1,9 +1,28 @@
|
||||
NOTE: This file was modified by The libjpeg-turbo Project to include only
|
||||
information relevant to libjpeg-turbo.
|
||||
libjpeg-turbo note: This file has been modified by The libjpeg-turbo Project
|
||||
to include only information relevant to libjpeg-turbo. It is included only for
|
||||
reference. Please see ChangeLog.md for information specific to libjpeg-turbo.
|
||||
|
||||
|
||||
CHANGE LOG for Independent JPEG Group's JPEG software
|
||||
|
||||
|
||||
Version 9b 17-Jan-2016
|
||||
-----------------------
|
||||
|
||||
Document 'f' specifier for jpegtran -crop specification.
|
||||
Thank to Michele Martone for suggestion.
|
||||
|
||||
|
||||
Version 9 13-Jan-2013
|
||||
----------------------
|
||||
|
||||
Add remark for jpeg_mem_dest() in jdatadst.c.
|
||||
Thank to Elie-Gregoire Khoury for the hint.
|
||||
|
||||
Correct argument type in format string, avoid compiler warnings.
|
||||
Thank to Vincent Torri for hint.
|
||||
|
||||
|
||||
Version 8d 15-Jan-2012
|
||||
-----------------------
|
||||
|
||||
|
||||
BIN
ci/keys.enc
Normal file
BIN
ci/keys.enc
Normal file
Binary file not shown.
21
cjpeg.1
21
cjpeg.1
@@ -1,4 +1,4 @@
|
||||
.TH CJPEG 1 "21 November 2014"
|
||||
.TH CJPEG 1 "18 March 2017"
|
||||
.SH NAME
|
||||
cjpeg \- compress an image file to a JPEG file
|
||||
.SH SYNOPSIS
|
||||
@@ -85,8 +85,8 @@ reconstructed image: the higher the quality setting, the larger the JPEG file,
|
||||
and the closer the output image will be to the original input. Normally you
|
||||
want to use the lowest quality setting (smallest file) that decompresses into
|
||||
something visually indistinguishable from the original image. For this
|
||||
purpose the quality setting should be between 50 and 95; the default of 75 is
|
||||
often about right. If you see defects at
|
||||
purpose the quality setting should generally be between 50 and 95 (the default
|
||||
is 75) for photographic images. If you see defects at
|
||||
.B \-quality
|
||||
75, then go up 5 or 10 counts at a time until you are happy with the output
|
||||
image. (The optimal setting will vary from one image to another.)
|
||||
@@ -94,11 +94,10 @@ image. (The optimal setting will vary from one image to another.)
|
||||
.B \-quality
|
||||
100 will generate a quantization table of all 1's, minimizing loss in the
|
||||
quantization step (but there is still information loss in subsampling, as well
|
||||
as roundoff error). This setting is mainly of interest for experimental
|
||||
purposes. Quality values above about 95 are
|
||||
.B not
|
||||
recommended for normal use; the compressed file size goes up dramatically for
|
||||
hardly any gain in output image quality.
|
||||
as roundoff error.) For most images, specifying a quality value above
|
||||
about 95 will increase the size of the compressed file dramatically, and while
|
||||
the quality gain from these higher quality values is measurable (using metrics
|
||||
such as PSNR or SSIM), it is rarely perceivable by human vision.
|
||||
.PP
|
||||
In the other direction, quality values below 50 will produce very small files
|
||||
of low image quality. Settings around 5 to 10 might be useful in preparing an
|
||||
@@ -203,7 +202,7 @@ Set limit for amount of memory to use in processing large images. Value is
|
||||
in thousands of bytes, or millions of bytes if "M" is attached to the
|
||||
number. For example,
|
||||
.B \-max 4m
|
||||
selects 4000000 bytes. If more space is needed, temporary files will be used.
|
||||
selects 4000000 bytes. If more space is needed, an error will occur.
|
||||
.TP
|
||||
.BI \-outfile " name"
|
||||
Send output image to the named file, not to standard output.
|
||||
@@ -338,11 +337,11 @@ Independent JPEG Group
|
||||
This file was modified by The libjpeg-turbo Project to include only information
|
||||
relevant to libjpeg-turbo, to wordsmith certain sections, and to describe
|
||||
features not present in libjpeg.
|
||||
.SH BUGS
|
||||
.SH ISSUES
|
||||
Support for GIF input files was removed in cjpeg v6b due to concerns over
|
||||
the Unisys LZW patent. Although this patent expired in 2006, cjpeg still
|
||||
lacks GIF support, for these historical reasons. (Conversion of GIF files to
|
||||
JPEG is usually a bad idea anyway.)
|
||||
JPEG is usually a bad idea anyway, since GIF is a 256-color format.)
|
||||
.PP
|
||||
Not all variants of BMP and Targa file formats are supported.
|
||||
.PP
|
||||
|
||||
36
cjpeg.c
36
cjpeg.c
@@ -5,8 +5,9 @@
|
||||
* Copyright (C) 1991-1998, Thomas G. Lane.
|
||||
* Modified 2003-2011 by Guido Vollbeding.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2010, 2013-2014, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README file.
|
||||
* Copyright (C) 2010, 2013-2014, 2017, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
* This file contains a command-line user interface for the JPEG compressor.
|
||||
* It should work on any system with Unix- or MS-DOS-style command lines.
|
||||
@@ -81,7 +82,7 @@ static boolean is_targa; /* records user -targa switch */
|
||||
|
||||
|
||||
LOCAL(cjpeg_source_ptr)
|
||||
select_file_type (j_compress_ptr cinfo, FILE * infile)
|
||||
select_file_type (j_compress_ptr cinfo, FILE *infile)
|
||||
{
|
||||
int c;
|
||||
|
||||
@@ -137,9 +138,9 @@ select_file_type (j_compress_ptr cinfo, FILE * infile)
|
||||
*/
|
||||
|
||||
|
||||
static const char * progname; /* program name for error messages */
|
||||
static char * outfilename; /* for -outfile switch */
|
||||
boolean memdst; /* for -memdst switch */
|
||||
static const char *progname; /* program name for error messages */
|
||||
static char *outfilename; /* for -outfile switch */
|
||||
boolean memdst; /* for -memdst switch */
|
||||
|
||||
|
||||
LOCAL(void)
|
||||
@@ -154,7 +155,8 @@ usage (void)
|
||||
#endif
|
||||
|
||||
fprintf(stderr, "Switches (names may be abbreviated):\n");
|
||||
fprintf(stderr, " -quality N[,...] Compression quality (0..100; 5-95 is useful range)\n");
|
||||
fprintf(stderr, " -quality N[,...] Compression quality (0..100; 5-95 is most useful range,\n");
|
||||
fprintf(stderr, " default is 75)\n");
|
||||
fprintf(stderr, " -grayscale Create monochrome JPEG file\n");
|
||||
fprintf(stderr, " -rgb Create RGB JPEG file\n");
|
||||
#ifdef ENTROPY_OPT_SUPPORTED
|
||||
@@ -195,11 +197,11 @@ usage (void)
|
||||
fprintf(stderr, " -version Print version information and exit\n");
|
||||
fprintf(stderr, "Switches for wizards:\n");
|
||||
fprintf(stderr, " -baseline Force baseline quantization tables\n");
|
||||
fprintf(stderr, " -qtables file Use quantization tables given in file\n");
|
||||
fprintf(stderr, " -qtables FILE Use quantization tables given in FILE\n");
|
||||
fprintf(stderr, " -qslots N[,...] Set component quantization tables\n");
|
||||
fprintf(stderr, " -sample HxV[,...] Set component sampling factors\n");
|
||||
#ifdef C_MULTISCAN_FILES_SUPPORTED
|
||||
fprintf(stderr, " -scans file Create multi-scan JPEG per script file\n");
|
||||
fprintf(stderr, " -scans FILE Create multi-scan JPEG per script FILE\n");
|
||||
#endif
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
@@ -218,14 +220,14 @@ parse_switches (j_compress_ptr cinfo, int argc, char **argv,
|
||||
*/
|
||||
{
|
||||
int argn;
|
||||
char * arg;
|
||||
char *arg;
|
||||
boolean force_baseline;
|
||||
boolean simple_progressive;
|
||||
char * qualityarg = NULL; /* saves -quality parm if any */
|
||||
char * qtablefile = NULL; /* saves -qtables filename if any */
|
||||
char * qslotsarg = NULL; /* saves -qslots parm if any */
|
||||
char * samplearg = NULL; /* saves -sample parm if any */
|
||||
char * scansarg = NULL; /* saves -scans parm if any */
|
||||
char *qualityarg = NULL; /* saves -quality parm if any */
|
||||
char *qtablefile = NULL; /* saves -qtables filename if any */
|
||||
char *qslotsarg = NULL; /* saves -qslots parm if any */
|
||||
char *samplearg = NULL; /* saves -sample parm if any */
|
||||
char *scansarg = NULL; /* saves -scans parm if any */
|
||||
|
||||
/* Set up default JPEG parameters. */
|
||||
|
||||
@@ -493,8 +495,8 @@ main (int argc, char **argv)
|
||||
#endif
|
||||
int file_index;
|
||||
cjpeg_source_ptr src_mgr;
|
||||
FILE * input_file;
|
||||
FILE * output_file = NULL;
|
||||
FILE *input_file;
|
||||
FILE *output_file = NULL;
|
||||
unsigned char *outbuffer = NULL;
|
||||
unsigned long outsize = 0;
|
||||
JDIMENSION num_scanlines;
|
||||
|
||||
24
cmakescripts/cmake_uninstall.cmake.in
Normal file
24
cmakescripts/cmake_uninstall.cmake.in
Normal file
@@ -0,0 +1,24 @@
|
||||
# This code is from the CMake FAQ
|
||||
|
||||
if (NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
|
||||
message(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"")
|
||||
endif(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
|
||||
|
||||
file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
|
||||
string(REGEX REPLACE "\n" ";" files "${files}")
|
||||
list(REVERSE files)
|
||||
foreach (file ${files})
|
||||
message(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"")
|
||||
if (EXISTS "$ENV{DESTDIR}${file}")
|
||||
execute_process(
|
||||
COMMAND "@CMAKE_COMMAND@" -E remove "$ENV{DESTDIR}${file}"
|
||||
OUTPUT_VARIABLE rm_out
|
||||
RESULT_VARIABLE rm_retval
|
||||
)
|
||||
if(NOT ${rm_retval} EQUAL 0)
|
||||
message(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"")
|
||||
endif (NOT ${rm_retval} EQUAL 0)
|
||||
else (EXISTS "$ENV{DESTDIR}${file}")
|
||||
message(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.")
|
||||
endif (EXISTS "$ENV{DESTDIR}${file}")
|
||||
endforeach(file)
|
||||
@@ -1,15 +0,0 @@
|
||||
if(NOT MD5)
|
||||
message(FATAL_ERROR "MD5 not specified")
|
||||
endif()
|
||||
|
||||
if(NOT FILE)
|
||||
message(FATAL_ERROR "FILE not specified")
|
||||
endif()
|
||||
|
||||
file(MD5 ${FILE} MD5FILE)
|
||||
|
||||
if(NOT MD5 STREQUAL MD5FILE)
|
||||
message(FATAL_ERROR "MD5 of ${FILE} should be ${MD5}, not ${MD5FILE}.")
|
||||
else()
|
||||
message(STATUS "${MD5}: OK")
|
||||
endif()
|
||||
@@ -24,7 +24,12 @@ file(GLOB FILES
|
||||
*_440_*.png
|
||||
*_440_*.ppm
|
||||
*_440_*.jpg
|
||||
*_440.yuv)
|
||||
*_440.yuv
|
||||
*_411_*.bmp
|
||||
*_411_*.png
|
||||
*_411_*.ppm
|
||||
*_411_*.jpg
|
||||
*_411.yuv)
|
||||
|
||||
if(NOT FILES STREQUAL "")
|
||||
message(STATUS "Removing test files")
|
||||
|
||||
@@ -4,7 +4,7 @@ This file was part of the Independent JPEG Group's software:
|
||||
Copyright (C) 1991-1996, Thomas G. Lane.
|
||||
It was modified by The libjpeg-turbo Project to include only information
|
||||
relevant to libjpeg-turbo.
|
||||
For conditions of distribution and use, see the accompanying README file.
|
||||
For conditions of distribution and use, see the accompanying README.ijg file.
|
||||
|
||||
|
||||
Since numerous people will be contributing code and bug fixes, it's important
|
||||
|
||||
43
configure.ac
43
configure.ac
@@ -2,8 +2,7 @@
|
||||
# Process this file with autoconf to produce a configure script.
|
||||
|
||||
AC_PREREQ([2.56])
|
||||
AC_INIT([libjpeg-turbo], [1.4.1])
|
||||
BUILD=`date +%Y%m%d`
|
||||
AC_INIT([libjpeg-turbo], [1.5.2])
|
||||
|
||||
AM_INIT_AUTOMAKE([-Wall foreign dist-bzip2])
|
||||
AC_PREFIX_DEFAULT(/opt/libjpeg-turbo)
|
||||
@@ -22,6 +21,12 @@ AC_PROG_INSTALL
|
||||
AC_PROG_LIBTOOL
|
||||
AC_PROG_LN_S
|
||||
|
||||
AC_ARG_WITH([build-date], [Use custom build string to enable reproducible builds (default: YYMMDD)],
|
||||
[BUILD="$with_build_date"],
|
||||
[BUILD=`date +%Y%m%d`])
|
||||
|
||||
PKG_PROG_PKG_CONFIG
|
||||
|
||||
# When the prefix is /opt/libjpeg-turbo, we assume that an "official" binary is
|
||||
# being created, and thus we install things into specific locations.
|
||||
|
||||
@@ -74,7 +79,7 @@ prefix=${old_prefix}
|
||||
|
||||
# Check whether compiler supports pointers to undefined structures
|
||||
AC_MSG_CHECKING(whether compiler supports pointers to undefined structures)
|
||||
AC_TRY_COMPILE([ typedef struct undefined_structure * undef_struct_ptr; ], ,
|
||||
AC_TRY_COMPILE([ typedef struct undefined_structure *undef_struct_ptr; ], ,
|
||||
AC_MSG_RESULT(yes),
|
||||
[AC_MSG_RESULT(no)
|
||||
AC_DEFINE([INCOMPLETE_TYPES_BROKEN], [1],
|
||||
@@ -189,7 +194,7 @@ fi
|
||||
RPM_CONFIG_ARGS=
|
||||
|
||||
# Memory source/destination managers
|
||||
SO_AGE=0
|
||||
SO_AGE=1
|
||||
MEM_SRCDST_FUNCTIONS=
|
||||
if test "x${with_jpeg8}" != "xyes"; then
|
||||
AC_MSG_CHECKING([whether to include in-memory source/destination managers])
|
||||
@@ -200,7 +205,7 @@ if test "x${with_jpeg8}" != "xyes"; then
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE([MEM_SRCDST_SUPPORTED], [1],
|
||||
[Support in-memory source/destination managers])
|
||||
SO_AGE=1
|
||||
SO_AGE=2
|
||||
MEM_SRCDST_FUNCTIONS="global: jpeg_mem_dest; jpeg_mem_src;";
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
@@ -219,6 +224,16 @@ AC_SUBST(MEM_SRCDST_FUNCTIONS)
|
||||
|
||||
AC_DEFINE_UNQUOTED(LIBJPEG_TURBO_VERSION, [$VERSION], [libjpeg-turbo version])
|
||||
|
||||
m4_define(version_triplet,m4_split(AC_PACKAGE_VERSION,[[.]]))
|
||||
m4_define(version_major,m4_car(m4_shiftn(1,[],version_triplet)))
|
||||
m4_define(version_minor,m4_car(m4_shiftn(2,[],version_triplet)))
|
||||
m4_define(version_revision,m4_car(m4_shiftn(3,[],version_triplet)))
|
||||
VERSION_MAJOR=version_major
|
||||
VERSION_MINOR=version_minor
|
||||
VERSION_REVISION=version_revision
|
||||
LIBJPEG_TURBO_VERSION_NUMBER=`printf "%d%03d%03d" $VERSION_MAJOR $VERSION_MINOR $VERSION_REVISION`
|
||||
AC_DEFINE_UNQUOTED(LIBJPEG_TURBO_VERSION_NUMBER, [$LIBJPEG_TURBO_VERSION_NUMBER], [libjpeg-turbo version in integer form])
|
||||
|
||||
VERSION_SCRIPT=yes
|
||||
AC_ARG_ENABLE([ld-version-script],
|
||||
AS_HELP_STRING([--disable-ld-version-script],
|
||||
@@ -274,10 +289,13 @@ AC_DEFINE_UNQUOTED([INLINE],[$ljt_cv_inline],[How to obtain function inlining.])
|
||||
AC_MSG_CHECKING([whether to include arithmetic encoding support])
|
||||
AC_ARG_WITH([arith-enc],
|
||||
AC_HELP_STRING([--without-arith-enc],
|
||||
[Do not include arithmetic encoding support]))
|
||||
[Do not include arithmetic encoding support when emulating the libjpeg v6b API/ABI]))
|
||||
if test "x$with_12bit" = "xyes"; then
|
||||
with_arith_enc=no
|
||||
fi
|
||||
if test "x${with_jpeg8}" = "xyes" -o "x${with_jpeg7}" = "xyes"; then
|
||||
with_arith_enc=yes
|
||||
fi
|
||||
if test "x$with_arith_enc" = "xno"; then
|
||||
AC_MSG_RESULT(no)
|
||||
RPM_CONFIG_ARGS="$RPM_CONFIG_ARGS --without-arith-enc"
|
||||
@@ -290,10 +308,13 @@ AM_CONDITIONAL([WITH_ARITH_ENC], [test "x$with_arith_enc" != "xno"])
|
||||
AC_MSG_CHECKING([whether to include arithmetic decoding support])
|
||||
AC_ARG_WITH([arith-dec],
|
||||
AC_HELP_STRING([--without-arith-dec],
|
||||
[Do not include arithmetic decoding support]))
|
||||
[Do not include arithmetic decoding support when emulating the libjpeg v6b API/ABI]))
|
||||
if test "x$with_12bit" = "xyes"; then
|
||||
with_arith_dec=no
|
||||
fi
|
||||
if test "x${with_jpeg8}" = "xyes" -o "x${with_jpeg7}" = "xyes"; then
|
||||
with_arith_dec=yes
|
||||
fi
|
||||
if test "x$with_arith_dec" = "xno"; then
|
||||
AC_MSG_RESULT(no)
|
||||
RPM_CONFIG_ARGS="$RPM_CONFIG_ARGS --without-arith-dec"
|
||||
@@ -495,6 +516,10 @@ if test "x${with_simd}" != "xno"; then
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
powerpc*)
|
||||
AC_MSG_RESULT([yes (powerpc)])
|
||||
simd_arch=powerpc
|
||||
;;
|
||||
*)
|
||||
AC_MSG_RESULT([no ("$host_cpu")])
|
||||
with_simd=no;
|
||||
@@ -520,8 +545,10 @@ AM_CONDITIONAL([SIMD_X86_64], [test "x$simd_arch" = "xx86_64"])
|
||||
AM_CONDITIONAL([SIMD_ARM], [test "x$simd_arch" = "xarm"])
|
||||
AM_CONDITIONAL([SIMD_ARM_64], [test "x$simd_arch" = "xaarch64"])
|
||||
AM_CONDITIONAL([SIMD_MIPS], [test "x$simd_arch" = "xmips"])
|
||||
AM_CONDITIONAL([SIMD_POWERPC], [test "x$simd_arch" = "xpowerpc"])
|
||||
AM_CONDITIONAL([X86_64], [test "x$host_cpu" = "xx86_64" -o "x$host_cpu" = "xamd64"])
|
||||
AM_CONDITIONAL([WITH_TURBOJPEG], [test "x$with_turbojpeg" != "xno"])
|
||||
AM_CONDITIONAL([CROSS_COMPILING], [test "x$cross_compiling" = "xyes"])
|
||||
|
||||
AC_ARG_VAR(PKGNAME, [distribution package name (default: libjpeg-turbo)])
|
||||
if test "x$PKGNAME" = "x"; then
|
||||
@@ -568,6 +595,8 @@ AC_CONFIG_FILES([pkgscripts/makecygwinpkg.tmpl:release/makecygwinpkg.in])
|
||||
AC_CONFIG_FILES([pkgscripts/makedpkg.tmpl:release/makedpkg.in])
|
||||
AC_CONFIG_FILES([pkgscripts/makemacpkg.tmpl:release/makemacpkg.in])
|
||||
AC_CONFIG_FILES([pkgscripts/uninstall.tmpl:release/uninstall.in])
|
||||
AC_CONFIG_FILES([pkgscripts/libjpeg.pc:release/libjpeg.pc.in])
|
||||
AC_CONFIG_FILES([pkgscripts/libturbojpeg.pc:release/libturbojpeg.pc.in])
|
||||
if test "x$with_turbojpeg" != "xno"; then
|
||||
AC_CONFIG_FILES([tjbenchtest])
|
||||
fi
|
||||
|
||||
28
djpeg.1
28
djpeg.1
@@ -1,4 +1,4 @@
|
||||
.TH DJPEG 1 "21 November 2014"
|
||||
.TH DJPEG 1 "18 March 2017"
|
||||
.SH NAME
|
||||
djpeg \- decompress a JPEG file to an image file
|
||||
.SH SYNOPSIS
|
||||
@@ -185,7 +185,7 @@ Set limit for amount of memory to use in processing large images. Value is
|
||||
in thousands of bytes, or millions of bytes if "M" is attached to the
|
||||
number. For example,
|
||||
.B \-max 4m
|
||||
selects 4000000 bytes. If more space is needed, temporary files will be used.
|
||||
selects 4000000 bytes. If more space is needed, an error will occur.
|
||||
.TP
|
||||
.BI \-outfile " name"
|
||||
Send output image to the named file, not to standard output.
|
||||
@@ -194,6 +194,18 @@ Send output image to the named file, not to standard output.
|
||||
Load input file into memory before decompressing. This feature was implemented
|
||||
mainly as a way of testing the in-memory source manager (jpeg_mem_src().)
|
||||
.TP
|
||||
.BI \-skip " Y0,Y1"
|
||||
Decompress all rows of the JPEG image except those between Y0 and Y1
|
||||
(inclusive.) Note that if decompression scaling is being used, then Y0 and Y1
|
||||
are relative to the scaled image dimensions.
|
||||
.TP
|
||||
.BI \-crop " WxH+X+Y"
|
||||
Decompress only a rectangular subregion of the image, starting at point X,Y
|
||||
with width W and height H. If necessary, X will be shifted left to the nearest
|
||||
iMCU boundary, and the width will be increased accordingly. Note that if
|
||||
decompression scaling is being used, then X, Y, W, and H are relative to the
|
||||
scaled image dimensions.
|
||||
.TP
|
||||
.B \-verbose
|
||||
Enable debug printout. More
|
||||
.BR \-v 's
|
||||
@@ -271,8 +283,10 @@ Independent JPEG Group
|
||||
This file was modified by The libjpeg-turbo Project to include only information
|
||||
relevant to libjpeg-turbo, to wordsmith certain sections, and to describe
|
||||
features not present in libjpeg.
|
||||
.SH BUGS
|
||||
To avoid the Unisys LZW patent,
|
||||
.B djpeg
|
||||
produces uncompressed GIF files. These are larger than they should be, but
|
||||
are readable by standard GIF decoders.
|
||||
.SH ISSUES
|
||||
Support for compressed GIF output files was removed in djpeg v6b due to
|
||||
concerns over the Unisys LZW patent. Although this patent expired in 2006,
|
||||
djpeg still lacks compressed GIF support, for these historical reasons.
|
||||
(Conversion of JPEG files to GIF is usually a bad idea anyway, since GIF is a
|
||||
256-color format.) The uncompressed GIF files that djpeg generates are larger
|
||||
than they should be, but they are readable by standard GIF decoders.
|
||||
|
||||
143
djpeg.c
143
djpeg.c
@@ -3,9 +3,12 @@
|
||||
*
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1991-1997, Thomas G. Lane.
|
||||
* Modified 2013 by Guido Vollbeding.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2010-2011, 2013-2014, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README file.
|
||||
* Copyright (C) 2010-2011, 2013-2016, D. R. Commander.
|
||||
* Copyright (C) 2015, Google, Inc.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
* This file contains a command-line user interface for the JPEG decompressor.
|
||||
* It should work on any system with Unix- or MS-DOS-style command lines.
|
||||
@@ -28,6 +31,7 @@
|
||||
#include "cdjpeg.h" /* Common decls for cjpeg/djpeg applications */
|
||||
#include "jversion.h" /* for version message */
|
||||
#include "jconfigint.h"
|
||||
#include "wrppm.h"
|
||||
|
||||
#include <ctype.h> /* to declare isprint() */
|
||||
|
||||
@@ -85,9 +89,12 @@ static IMAGE_FORMATS requested_fmt;
|
||||
*/
|
||||
|
||||
|
||||
static const char * progname; /* program name for error messages */
|
||||
static char * outfilename; /* for -outfile switch */
|
||||
boolean memsrc; /* for -memsrc switch */
|
||||
static const char *progname; /* program name for error messages */
|
||||
static char *outfilename; /* for -outfile switch */
|
||||
boolean memsrc; /* for -memsrc switch */
|
||||
boolean skip, crop;
|
||||
JDIMENSION skip_start, skip_end;
|
||||
JDIMENSION crop_x, crop_y, crop_width, crop_height;
|
||||
#define INPUT_BUF_SIZE 4096
|
||||
|
||||
|
||||
@@ -164,6 +171,8 @@ usage (void)
|
||||
fprintf(stderr, " -memsrc Load input file into memory before decompressing\n");
|
||||
#endif
|
||||
|
||||
fprintf(stderr, " -skip Y0,Y1 Decompress all rows except those between Y0 and Y1 (inclusive)\n");
|
||||
fprintf(stderr, " -crop WxH+X+Y Decompress only a rectangular subregion of the image\n");
|
||||
fprintf(stderr, " -verbose or -debug Emit debug output\n");
|
||||
fprintf(stderr, " -version Print version information and exit\n");
|
||||
exit(EXIT_FAILURE);
|
||||
@@ -183,12 +192,14 @@ parse_switches (j_decompress_ptr cinfo, int argc, char **argv,
|
||||
*/
|
||||
{
|
||||
int argn;
|
||||
char * arg;
|
||||
char *arg;
|
||||
|
||||
/* Set up default JPEG parameters. */
|
||||
requested_fmt = DEFAULT_FMT; /* set default output file format */
|
||||
outfilename = NULL;
|
||||
memsrc = FALSE;
|
||||
skip = FALSE;
|
||||
crop = FALSE;
|
||||
cinfo->err->trace_level = 0;
|
||||
|
||||
/* Scan command line options, adjust parameters */
|
||||
@@ -298,7 +309,7 @@ parse_switches (j_decompress_ptr cinfo, int argc, char **argv,
|
||||
usage();
|
||||
if (for_real) { /* too expensive to do twice! */
|
||||
#ifdef QUANT_2PASS_SUPPORTED /* otherwise can't quantize to supplied map */
|
||||
FILE * mapfile;
|
||||
FILE *mapfile;
|
||||
|
||||
if ((mapfile = fopen(argv[argn], READ_BINARY)) == NULL) {
|
||||
fprintf(stderr, "%s: can't open %s\n", progname, argv[argn]);
|
||||
@@ -361,14 +372,32 @@ parse_switches (j_decompress_ptr cinfo, int argc, char **argv,
|
||||
/* RLE output format. */
|
||||
requested_fmt = FMT_RLE;
|
||||
|
||||
} else if (keymatch(arg, "scale", 1)) {
|
||||
} else if (keymatch(arg, "scale", 2)) {
|
||||
/* Scale the output image by a fraction M/N. */
|
||||
if (++argn >= argc) /* advance to next argument */
|
||||
usage();
|
||||
if (sscanf(argv[argn], "%d/%d",
|
||||
if (sscanf(argv[argn], "%u/%u",
|
||||
&cinfo->scale_num, &cinfo->scale_denom) != 2)
|
||||
usage();
|
||||
|
||||
} else if (keymatch(arg, "skip", 2)) {
|
||||
if (++argn >= argc)
|
||||
usage();
|
||||
if (sscanf(argv[argn], "%u,%u", &skip_start, &skip_end) != 2 ||
|
||||
skip_start > skip_end)
|
||||
usage();
|
||||
skip = TRUE;
|
||||
|
||||
} else if (keymatch(arg, "crop", 2)) {
|
||||
char c;
|
||||
if (++argn >= argc)
|
||||
usage();
|
||||
if (sscanf(argv[argn], "%u%c%u+%u+%u", &crop_width, &c, &crop_height,
|
||||
&crop_x, &crop_y) != 5 ||
|
||||
(c != 'X' && c != 'x') || crop_width < 1 || crop_height < 1)
|
||||
usage();
|
||||
crop = TRUE;
|
||||
|
||||
} else if (keymatch(arg, "targa", 1)) {
|
||||
/* Targa output format. */
|
||||
requested_fmt = FMT_TARGA;
|
||||
@@ -393,7 +422,7 @@ LOCAL(unsigned int)
|
||||
jpeg_getc (j_decompress_ptr cinfo)
|
||||
/* Read next byte */
|
||||
{
|
||||
struct jpeg_source_mgr * datasrc = cinfo->src;
|
||||
struct jpeg_source_mgr *datasrc = cinfo->src;
|
||||
|
||||
if (datasrc->bytes_in_buffer == 0) {
|
||||
if (! (*datasrc->fill_input_buffer) (cinfo))
|
||||
@@ -408,7 +437,7 @@ METHODDEF(boolean)
|
||||
print_text_marker (j_decompress_ptr cinfo)
|
||||
{
|
||||
boolean traceit = (cinfo->err->trace_level >= 1);
|
||||
INT32 length;
|
||||
long length;
|
||||
unsigned int ch;
|
||||
unsigned int lastch = 0;
|
||||
|
||||
@@ -469,8 +498,8 @@ main (int argc, char **argv)
|
||||
#endif
|
||||
int file_index;
|
||||
djpeg_dest_ptr dest_mgr = NULL;
|
||||
FILE * input_file;
|
||||
FILE * output_file;
|
||||
FILE *input_file;
|
||||
FILE *output_file;
|
||||
unsigned char *inbuffer = NULL;
|
||||
unsigned long insize = 0;
|
||||
JDIMENSION num_scanlines;
|
||||
@@ -634,14 +663,88 @@ main (int argc, char **argv)
|
||||
/* Start decompressor */
|
||||
(void) jpeg_start_decompress(&cinfo);
|
||||
|
||||
/* Write output file header */
|
||||
(*dest_mgr->start_output) (&cinfo, dest_mgr);
|
||||
/* Skip rows */
|
||||
if (skip) {
|
||||
JDIMENSION tmp;
|
||||
|
||||
/* Process data */
|
||||
while (cinfo.output_scanline < cinfo.output_height) {
|
||||
num_scanlines = jpeg_read_scanlines(&cinfo, dest_mgr->buffer,
|
||||
dest_mgr->buffer_height);
|
||||
(*dest_mgr->put_pixel_rows) (&cinfo, dest_mgr, num_scanlines);
|
||||
/* Check for valid skip_end. We cannot check this value until after
|
||||
* jpeg_start_decompress() is called. Note that we have already verified
|
||||
* that skip_start <= skip_end.
|
||||
*/
|
||||
if (skip_end > cinfo.output_height - 1) {
|
||||
fprintf(stderr, "%s: skip region exceeds image height %d\n", progname,
|
||||
cinfo.output_height);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
/* Write output file header. This is a hack to ensure that the destination
|
||||
* manager creates an output image of the proper size.
|
||||
*/
|
||||
tmp = cinfo.output_height;
|
||||
cinfo.output_height -= (skip_end - skip_start + 1);
|
||||
(*dest_mgr->start_output) (&cinfo, dest_mgr);
|
||||
cinfo.output_height = tmp;
|
||||
|
||||
/* Process data */
|
||||
while (cinfo.output_scanline < skip_start) {
|
||||
num_scanlines = jpeg_read_scanlines(&cinfo, dest_mgr->buffer,
|
||||
dest_mgr->buffer_height);
|
||||
(*dest_mgr->put_pixel_rows) (&cinfo, dest_mgr, num_scanlines);
|
||||
}
|
||||
jpeg_skip_scanlines(&cinfo, skip_end - skip_start + 1);
|
||||
while (cinfo.output_scanline < cinfo.output_height) {
|
||||
num_scanlines = jpeg_read_scanlines(&cinfo, dest_mgr->buffer,
|
||||
dest_mgr->buffer_height);
|
||||
(*dest_mgr->put_pixel_rows) (&cinfo, dest_mgr, num_scanlines);
|
||||
}
|
||||
|
||||
/* Decompress a subregion */
|
||||
} else if (crop) {
|
||||
JDIMENSION tmp;
|
||||
|
||||
/* Check for valid crop dimensions. We cannot check these values until
|
||||
* after jpeg_start_decompress() is called.
|
||||
*/
|
||||
if (crop_x + crop_width > cinfo.output_width ||
|
||||
crop_y + crop_height > cinfo.output_height) {
|
||||
fprintf(stderr, "%s: crop dimensions exceed image dimensions %d x %d\n",
|
||||
progname, cinfo.output_width, cinfo.output_height);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
jpeg_crop_scanline(&cinfo, &crop_x, &crop_width);
|
||||
((ppm_dest_ptr) dest_mgr)->buffer_width = cinfo.output_width *
|
||||
cinfo.out_color_components *
|
||||
sizeof(JSAMPLE);
|
||||
|
||||
/* Write output file header. This is a hack to ensure that the destination
|
||||
* manager creates an output image of the proper size.
|
||||
*/
|
||||
tmp = cinfo.output_height;
|
||||
cinfo.output_height = crop_height;
|
||||
(*dest_mgr->start_output) (&cinfo, dest_mgr);
|
||||
cinfo.output_height = tmp;
|
||||
|
||||
/* Process data */
|
||||
jpeg_skip_scanlines(&cinfo, crop_y);
|
||||
while (cinfo.output_scanline < crop_y + crop_height) {
|
||||
num_scanlines = jpeg_read_scanlines(&cinfo, dest_mgr->buffer,
|
||||
dest_mgr->buffer_height);
|
||||
(*dest_mgr->put_pixel_rows) (&cinfo, dest_mgr, num_scanlines);
|
||||
}
|
||||
jpeg_skip_scanlines(&cinfo, cinfo.output_height - crop_y - crop_height);
|
||||
|
||||
/* Normal full-image decompress */
|
||||
} else {
|
||||
/* Write output file header */
|
||||
(*dest_mgr->start_output) (&cinfo, dest_mgr);
|
||||
|
||||
/* Process data */
|
||||
while (cinfo.output_scanline < cinfo.output_height) {
|
||||
num_scanlines = jpeg_read_scanlines(&cinfo, dest_mgr->buffer,
|
||||
dest_mgr->buffer_height);
|
||||
(*dest_mgr->put_pixel_rows) (&cinfo, dest_mgr, num_scanlines);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef PROGRESS_REPORT
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
<tr style="height: 56px;">
|
||||
<td style="padding-left: 0.5em;">
|
||||
<div id="projectname">TurboJPEG
|
||||
 <span id="projectnumber">1.4</span>
|
||||
 <span id="projectnumber">1.5</span>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
<tr style="height: 56px;">
|
||||
<td style="padding-left: 0.5em;">
|
||||
<div id="projectname">TurboJPEG
|
||||
 <span id="projectnumber">1.4</span>
|
||||
 <span id="projectnumber">1.5</span>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
<tr style="height: 56px;">
|
||||
<td style="padding-left: 0.5em;">
|
||||
<div id="projectname">TurboJPEG
|
||||
 <span id="projectnumber">1.4</span>
|
||||
 <span id="projectnumber">1.5</span>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
<tr style="height: 56px;">
|
||||
<td style="padding-left: 0.5em;">
|
||||
<div id="projectname">TurboJPEG
|
||||
 <span id="projectnumber">1.4</span>
|
||||
 <span id="projectnumber">1.5</span>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
<tr style="height: 56px;">
|
||||
<td style="padding-left: 0.5em;">
|
||||
<div id="projectname">TurboJPEG
|
||||
 <span id="projectnumber">1.4</span>
|
||||
 <span id="projectnumber">1.5</span>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -132,10 +132,10 @@ Macros</h2></td></tr>
|
||||
<tr class="memdesc:ga0f6dbd18adf38b7d46ac547f0f4d562c"><td class="mdescLeft"> </td><td class="mdescRight">The number of transform operations. <a href="#ga0f6dbd18adf38b7d46ac547f0f4d562c">More...</a><br/></td></tr>
|
||||
<tr class="separator:ga0f6dbd18adf38b7d46ac547f0f4d562c"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:ga50e03cb5ed115330e212417429600b00"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga50e03cb5ed115330e212417429600b00">TJXOPT_PERFECT</a></td></tr>
|
||||
<tr class="memdesc:ga50e03cb5ed115330e212417429600b00"><td class="mdescLeft"> </td><td class="mdescRight">This option will cause <a class="el" href="group___turbo_j_p_e_g.html#gae403193ceb4aafb7e0f56ab587b48616" title="Losslessly transform a JPEG image into another JPEG image.">tjTransform()</a> to return an error if the transform is not perfect. <a href="#ga50e03cb5ed115330e212417429600b00">More...</a><br/></td></tr>
|
||||
<tr class="memdesc:ga50e03cb5ed115330e212417429600b00"><td class="mdescLeft"> </td><td class="mdescRight">This option will cause <a class="el" href="group___turbo_j_p_e_g.html#gad02cd42b69f193a0623a9c801788df3a" title="Losslessly transform a JPEG image into another JPEG image.">tjTransform()</a> to return an error if the transform is not perfect. <a href="#ga50e03cb5ed115330e212417429600b00">More...</a><br/></td></tr>
|
||||
<tr class="separator:ga50e03cb5ed115330e212417429600b00"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:ga319826b7eb1583c0595bbe7b95428709"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga319826b7eb1583c0595bbe7b95428709">TJXOPT_TRIM</a></td></tr>
|
||||
<tr class="memdesc:ga319826b7eb1583c0595bbe7b95428709"><td class="mdescLeft"> </td><td class="mdescRight">This option will cause <a class="el" href="group___turbo_j_p_e_g.html#gae403193ceb4aafb7e0f56ab587b48616" title="Losslessly transform a JPEG image into another JPEG image.">tjTransform()</a> to discard any partial MCU blocks that cannot be transformed. <a href="#ga319826b7eb1583c0595bbe7b95428709">More...</a><br/></td></tr>
|
||||
<tr class="memdesc:ga319826b7eb1583c0595bbe7b95428709"><td class="mdescLeft"> </td><td class="mdescRight">This option will cause <a class="el" href="group___turbo_j_p_e_g.html#gad02cd42b69f193a0623a9c801788df3a" title="Losslessly transform a JPEG image into another JPEG image.">tjTransform()</a> to discard any partial MCU blocks that cannot be transformed. <a href="#ga319826b7eb1583c0595bbe7b95428709">More...</a><br/></td></tr>
|
||||
<tr class="separator:ga319826b7eb1583c0595bbe7b95428709"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:ga9c771a757fc1294add611906b89ab2d2"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga9c771a757fc1294add611906b89ab2d2">TJXOPT_CROP</a></td></tr>
|
||||
<tr class="memdesc:ga9c771a757fc1294add611906b89ab2d2"><td class="mdescLeft"> </td><td class="mdescRight">This option will enable lossless cropping. <a href="#ga9c771a757fc1294add611906b89ab2d2">More...</a><br/></td></tr>
|
||||
@@ -144,7 +144,7 @@ Macros</h2></td></tr>
|
||||
<tr class="memdesc:ga3acee7b48ade1b99e5588736007c2589"><td class="mdescLeft"> </td><td class="mdescRight">This option will discard the color data in the input image and produce a grayscale output image. <a href="#ga3acee7b48ade1b99e5588736007c2589">More...</a><br/></td></tr>
|
||||
<tr class="separator:ga3acee7b48ade1b99e5588736007c2589"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:gafbf992bbf6e006705886333703ffab31"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#gafbf992bbf6e006705886333703ffab31">TJXOPT_NOOUTPUT</a></td></tr>
|
||||
<tr class="memdesc:gafbf992bbf6e006705886333703ffab31"><td class="mdescLeft"> </td><td class="mdescRight">This option will prevent <a class="el" href="group___turbo_j_p_e_g.html#gae403193ceb4aafb7e0f56ab587b48616" title="Losslessly transform a JPEG image into another JPEG image.">tjTransform()</a> from outputting a JPEG image for this particular transform (this can be used in conjunction with a custom filter to capture the transformed DCT coefficients without transcoding them.) <a href="#gafbf992bbf6e006705886333703ffab31">More...</a><br/></td></tr>
|
||||
<tr class="memdesc:gafbf992bbf6e006705886333703ffab31"><td class="mdescLeft"> </td><td class="mdescRight">This option will prevent <a class="el" href="group___turbo_j_p_e_g.html#gad02cd42b69f193a0623a9c801788df3a" title="Losslessly transform a JPEG image into another JPEG image.">tjTransform()</a> from outputting a JPEG image for this particular transform (this can be used in conjunction with a custom filter to capture the transformed DCT coefficients without transcoding them.) <a href="#gafbf992bbf6e006705886333703ffab31">More...</a><br/></td></tr>
|
||||
<tr class="separator:gafbf992bbf6e006705886333703ffab31"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:ga0aba955473315e405295d978f0c16511"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga0aba955473315e405295d978f0c16511">TJPAD</a>(width)</td></tr>
|
||||
<tr class="memdesc:ga0aba955473315e405295d978f0c16511"><td class="mdescLeft"> </td><td class="mdescRight">Pad the given width to the nearest 32-bit boundary. <a href="#ga0aba955473315e405295d978f0c16511">More...</a><br/></td></tr>
|
||||
@@ -218,7 +218,7 @@ Enumerations</h2></td></tr>
|
||||
<a class="el" href="group___turbo_j_p_e_g.html#gga2de531af4e7e6c4f124908376b354866a3064ee5dfb7f032df332818587567a08">TJXOP_ROT270</a>
|
||||
<br/>
|
||||
}</td></tr>
|
||||
<tr class="memdesc:ga2de531af4e7e6c4f124908376b354866"><td class="mdescLeft"> </td><td class="mdescRight">Transform operations for <a class="el" href="group___turbo_j_p_e_g.html#gae403193ceb4aafb7e0f56ab587b48616" title="Losslessly transform a JPEG image into another JPEG image.">tjTransform()</a> <a href="group___turbo_j_p_e_g.html#ga2de531af4e7e6c4f124908376b354866">More...</a><br/></td></tr>
|
||||
<tr class="memdesc:ga2de531af4e7e6c4f124908376b354866"><td class="mdescLeft"> </td><td class="mdescRight">Transform operations for <a class="el" href="group___turbo_j_p_e_g.html#gad02cd42b69f193a0623a9c801788df3a" title="Losslessly transform a JPEG image into another JPEG image.">tjTransform()</a> <a href="group___turbo_j_p_e_g.html#ga2de531af4e7e6c4f124908376b354866">More...</a><br/></td></tr>
|
||||
<tr class="separator:ga2de531af4e7e6c4f124908376b354866"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
</table><table class="memberdecls">
|
||||
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
|
||||
@@ -226,15 +226,15 @@ Functions</h2></td></tr>
|
||||
<tr class="memitem:ga3d10c47fbe4a2489a2b30c931551d01a"><td class="memItemLeft" align="right" valign="top">DLLEXPORT <a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> DLLCALL </td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga3d10c47fbe4a2489a2b30c931551d01a">tjInitCompress</a> (void)</td></tr>
|
||||
<tr class="memdesc:ga3d10c47fbe4a2489a2b30c931551d01a"><td class="mdescLeft"> </td><td class="mdescRight">Create a TurboJPEG compressor instance. <a href="#ga3d10c47fbe4a2489a2b30c931551d01a">More...</a><br/></td></tr>
|
||||
<tr class="separator:ga3d10c47fbe4a2489a2b30c931551d01a"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:gaba62b7a98f960839b588579898495cf2"><td class="memItemLeft" align="right" valign="top">DLLEXPORT int DLLCALL </td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#gaba62b7a98f960839b588579898495cf2">tjCompress2</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, unsigned char *srcBuf, int width, int pitch, int height, int pixelFormat, unsigned char **jpegBuf, unsigned long *jpegSize, int jpegSubsamp, int jpegQual, int flags)</td></tr>
|
||||
<tr class="memdesc:gaba62b7a98f960839b588579898495cf2"><td class="mdescLeft"> </td><td class="mdescRight">Compress an RGB, grayscale, or CMYK image into a JPEG image. <a href="#gaba62b7a98f960839b588579898495cf2">More...</a><br/></td></tr>
|
||||
<tr class="separator:gaba62b7a98f960839b588579898495cf2"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:ga0b931126c7a615ddc3bbd0cca6698d67"><td class="memItemLeft" align="right" valign="top">DLLEXPORT int DLLCALL </td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga0b931126c7a615ddc3bbd0cca6698d67">tjCompressFromYUV</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, unsigned char *srcBuf, int width, int pad, int height, int subsamp, unsigned char **jpegBuf, unsigned long *jpegSize, int jpegQual, int flags)</td></tr>
|
||||
<tr class="memdesc:ga0b931126c7a615ddc3bbd0cca6698d67"><td class="mdescLeft"> </td><td class="mdescRight">Compress a YUV planar image into a JPEG image. <a href="#ga0b931126c7a615ddc3bbd0cca6698d67">More...</a><br/></td></tr>
|
||||
<tr class="separator:ga0b931126c7a615ddc3bbd0cca6698d67"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:gaa89a1982cb4556b12ae7af4439991af6"><td class="memItemLeft" align="right" valign="top">DLLEXPORT int DLLCALL </td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#gaa89a1982cb4556b12ae7af4439991af6">tjCompressFromYUVPlanes</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, unsigned char **srcPlanes, int width, int *strides, int height, int subsamp, unsigned char **jpegBuf, unsigned long *jpegSize, int jpegQual, int flags)</td></tr>
|
||||
<tr class="memdesc:gaa89a1982cb4556b12ae7af4439991af6"><td class="mdescLeft"> </td><td class="mdescRight">Compress a set of Y, U (Cb), and V (Cr) image planes into a JPEG image. <a href="#gaa89a1982cb4556b12ae7af4439991af6">More...</a><br/></td></tr>
|
||||
<tr class="separator:gaa89a1982cb4556b12ae7af4439991af6"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:gaf38f2ed44bdc88e730e08b632fa6e88e"><td class="memItemLeft" align="right" valign="top">DLLEXPORT int DLLCALL </td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#gaf38f2ed44bdc88e730e08b632fa6e88e">tjCompress2</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, const unsigned char *srcBuf, int width, int pitch, int height, int pixelFormat, unsigned char **jpegBuf, unsigned long *jpegSize, int jpegSubsamp, int jpegQual, int flags)</td></tr>
|
||||
<tr class="memdesc:gaf38f2ed44bdc88e730e08b632fa6e88e"><td class="mdescLeft"> </td><td class="mdescRight">Compress an RGB, grayscale, or CMYK image into a JPEG image. <a href="#gaf38f2ed44bdc88e730e08b632fa6e88e">More...</a><br/></td></tr>
|
||||
<tr class="separator:gaf38f2ed44bdc88e730e08b632fa6e88e"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:ga6f6de375d6ec0020faba627e37e5a060"><td class="memItemLeft" align="right" valign="top">DLLEXPORT int DLLCALL </td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga6f6de375d6ec0020faba627e37e5a060">tjCompressFromYUV</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, const unsigned char *srcBuf, int width, int pad, int height, int subsamp, unsigned char **jpegBuf, unsigned long *jpegSize, int jpegQual, int flags)</td></tr>
|
||||
<tr class="memdesc:ga6f6de375d6ec0020faba627e37e5a060"><td class="mdescLeft"> </td><td class="mdescRight">Compress a YUV planar image into a JPEG image. <a href="#ga6f6de375d6ec0020faba627e37e5a060">More...</a><br/></td></tr>
|
||||
<tr class="separator:ga6f6de375d6ec0020faba627e37e5a060"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:ga0b84c682d8accf097d7a743c965d3464"><td class="memItemLeft" align="right" valign="top">DLLEXPORT int DLLCALL </td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga0b84c682d8accf097d7a743c965d3464">tjCompressFromYUVPlanes</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, const unsigned char **srcPlanes, int width, const int *strides, int height, int subsamp, unsigned char **jpegBuf, unsigned long *jpegSize, int jpegQual, int flags)</td></tr>
|
||||
<tr class="memdesc:ga0b84c682d8accf097d7a743c965d3464"><td class="mdescLeft"> </td><td class="mdescRight">Compress a set of Y, U (Cb), and V (Cr) image planes into a JPEG image. <a href="#ga0b84c682d8accf097d7a743c965d3464">More...</a><br/></td></tr>
|
||||
<tr class="separator:ga0b84c682d8accf097d7a743c965d3464"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:gaccc5bca7f12fcdcc302e6e1c6d4b311b"><td class="memItemLeft" align="right" valign="top">DLLEXPORT unsigned long DLLCALL </td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#gaccc5bca7f12fcdcc302e6e1c6d4b311b">tjBufSize</a> (int width, int height, int jpegSubsamp)</td></tr>
|
||||
<tr class="memdesc:gaccc5bca7f12fcdcc302e6e1c6d4b311b"><td class="mdescLeft"> </td><td class="mdescRight">The maximum size of the buffer (in bytes) required to hold a JPEG image with the given parameters. <a href="#gaccc5bca7f12fcdcc302e6e1c6d4b311b">More...</a><br/></td></tr>
|
||||
<tr class="separator:gaccc5bca7f12fcdcc302e6e1c6d4b311b"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
@@ -250,42 +250,42 @@ Functions</h2></td></tr>
|
||||
<tr class="memitem:ga1a209696c6a80748f20e134b3c64789f"><td class="memItemLeft" align="right" valign="top">DLLEXPORT int </td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga1a209696c6a80748f20e134b3c64789f">tjPlaneHeight</a> (int componentID, int height, int subsamp)</td></tr>
|
||||
<tr class="memdesc:ga1a209696c6a80748f20e134b3c64789f"><td class="mdescLeft"> </td><td class="mdescRight">The plane height of a YUV image plane with the given parameters. <a href="#ga1a209696c6a80748f20e134b3c64789f">More...</a><br/></td></tr>
|
||||
<tr class="separator:ga1a209696c6a80748f20e134b3c64789f"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:ga0a5ffbf7cb58a5b6a8201114fe889360"><td class="memItemLeft" align="right" valign="top">DLLEXPORT int DLLCALL </td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga0a5ffbf7cb58a5b6a8201114fe889360">tjEncodeYUV3</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, unsigned char *srcBuf, int width, int pitch, int height, int pixelFormat, unsigned char *dstBuf, int pad, int subsamp, int flags)</td></tr>
|
||||
<tr class="memdesc:ga0a5ffbf7cb58a5b6a8201114fe889360"><td class="mdescLeft"> </td><td class="mdescRight">Encode an RGB or grayscale image into a YUV planar image. <a href="#ga0a5ffbf7cb58a5b6a8201114fe889360">More...</a><br/></td></tr>
|
||||
<tr class="separator:ga0a5ffbf7cb58a5b6a8201114fe889360"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:gaa791db8598853ddcad24e42897ef1269"><td class="memItemLeft" align="right" valign="top">DLLEXPORT int DLLCALL </td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#gaa791db8598853ddcad24e42897ef1269">tjEncodeYUVPlanes</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, unsigned char *srcBuf, int width, int pitch, int height, int pixelFormat, unsigned char **dstPlanes, int *strides, int subsamp, int flags)</td></tr>
|
||||
<tr class="memdesc:gaa791db8598853ddcad24e42897ef1269"><td class="mdescLeft"> </td><td class="mdescRight">Encode an RGB or grayscale image into separate Y, U (Cb), and V (Cr) image planes. <a href="#gaa791db8598853ddcad24e42897ef1269">More...</a><br/></td></tr>
|
||||
<tr class="separator:gaa791db8598853ddcad24e42897ef1269"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:gaabe05acd734990053ad1294b5ef239aa"><td class="memItemLeft" align="right" valign="top">DLLEXPORT int DLLCALL </td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#gaabe05acd734990053ad1294b5ef239aa">tjEncodeYUV3</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, const unsigned char *srcBuf, int width, int pitch, int height, int pixelFormat, unsigned char *dstBuf, int pad, int subsamp, int flags)</td></tr>
|
||||
<tr class="memdesc:gaabe05acd734990053ad1294b5ef239aa"><td class="mdescLeft"> </td><td class="mdescRight">Encode an RGB or grayscale image into a YUV planar image. <a href="#gaabe05acd734990053ad1294b5ef239aa">More...</a><br/></td></tr>
|
||||
<tr class="separator:gaabe05acd734990053ad1294b5ef239aa"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:ga8a65ed3bd12df57c219d46afbc9008f1"><td class="memItemLeft" align="right" valign="top">DLLEXPORT int DLLCALL </td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga8a65ed3bd12df57c219d46afbc9008f1">tjEncodeYUVPlanes</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, const unsigned char *srcBuf, int width, int pitch, int height, int pixelFormat, unsigned char **dstPlanes, int *strides, int subsamp, int flags)</td></tr>
|
||||
<tr class="memdesc:ga8a65ed3bd12df57c219d46afbc9008f1"><td class="mdescLeft"> </td><td class="mdescRight">Encode an RGB or grayscale image into separate Y, U (Cb), and V (Cr) image planes. <a href="#ga8a65ed3bd12df57c219d46afbc9008f1">More...</a><br/></td></tr>
|
||||
<tr class="separator:ga8a65ed3bd12df57c219d46afbc9008f1"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:gae5408179d041e2a2f7199c8283cf649e"><td class="memItemLeft" align="right" valign="top">DLLEXPORT <a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> DLLCALL </td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#gae5408179d041e2a2f7199c8283cf649e">tjInitDecompress</a> (void)</td></tr>
|
||||
<tr class="memdesc:gae5408179d041e2a2f7199c8283cf649e"><td class="mdescLeft"> </td><td class="mdescRight">Create a TurboJPEG decompressor instance. <a href="#gae5408179d041e2a2f7199c8283cf649e">More...</a><br/></td></tr>
|
||||
<tr class="separator:gae5408179d041e2a2f7199c8283cf649e"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:gacd0fac3af74b3511d39b4781b7103086"><td class="memItemLeft" align="right" valign="top">DLLEXPORT int DLLCALL </td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#gacd0fac3af74b3511d39b4781b7103086">tjDecompressHeader3</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, unsigned char *jpegBuf, unsigned long jpegSize, int *width, int *height, int *jpegSubsamp, int *jpegColorspace)</td></tr>
|
||||
<tr class="memdesc:gacd0fac3af74b3511d39b4781b7103086"><td class="mdescLeft"> </td><td class="mdescRight">Retrieve information about a JPEG image without decompressing it. <a href="#gacd0fac3af74b3511d39b4781b7103086">More...</a><br/></td></tr>
|
||||
<tr class="separator:gacd0fac3af74b3511d39b4781b7103086"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:ga3fced455e504e8ff4fbad28ba94a3020"><td class="memItemLeft" align="right" valign="top">DLLEXPORT int DLLCALL </td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga3fced455e504e8ff4fbad28ba94a3020">tjDecompressHeader3</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, const unsigned char *jpegBuf, unsigned long jpegSize, int *width, int *height, int *jpegSubsamp, int *jpegColorspace)</td></tr>
|
||||
<tr class="memdesc:ga3fced455e504e8ff4fbad28ba94a3020"><td class="mdescLeft"> </td><td class="mdescRight">Retrieve information about a JPEG image without decompressing it. <a href="#ga3fced455e504e8ff4fbad28ba94a3020">More...</a><br/></td></tr>
|
||||
<tr class="separator:ga3fced455e504e8ff4fbad28ba94a3020"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:ga6449044b9af402999ccf52f401333be8"><td class="memItemLeft" align="right" valign="top">DLLEXPORT <a class="el" href="structtjscalingfactor.html">tjscalingfactor</a> *DLLCALL </td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga6449044b9af402999ccf52f401333be8">tjGetScalingFactors</a> (int *numscalingfactors)</td></tr>
|
||||
<tr class="memdesc:ga6449044b9af402999ccf52f401333be8"><td class="mdescLeft"> </td><td class="mdescRight">Returns a list of fractional scaling factors that the JPEG decompressor in this implementation of TurboJPEG supports. <a href="#ga6449044b9af402999ccf52f401333be8">More...</a><br/></td></tr>
|
||||
<tr class="separator:ga6449044b9af402999ccf52f401333be8"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:gada69cc6443d1bb493b40f1626259e5e9"><td class="memItemLeft" align="right" valign="top">DLLEXPORT int DLLCALL </td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#gada69cc6443d1bb493b40f1626259e5e9">tjDecompress2</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, unsigned char *jpegBuf, unsigned long jpegSize, unsigned char *dstBuf, int width, int pitch, int height, int pixelFormat, int flags)</td></tr>
|
||||
<tr class="memdesc:gada69cc6443d1bb493b40f1626259e5e9"><td class="mdescLeft"> </td><td class="mdescRight">Decompress a JPEG image to an RGB, grayscale, or CMYK image. <a href="#gada69cc6443d1bb493b40f1626259e5e9">More...</a><br/></td></tr>
|
||||
<tr class="separator:gada69cc6443d1bb493b40f1626259e5e9"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:ga7c08b340ad7f8e85d407bd9e81d44d07"><td class="memItemLeft" align="right" valign="top">DLLEXPORT int DLLCALL </td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga7c08b340ad7f8e85d407bd9e81d44d07">tjDecompressToYUV2</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, unsigned char *jpegBuf, unsigned long jpegSize, unsigned char *dstBuf, int width, int pad, int height, int flags)</td></tr>
|
||||
<tr class="memdesc:ga7c08b340ad7f8e85d407bd9e81d44d07"><td class="mdescLeft"> </td><td class="mdescRight">Decompress a JPEG image to a YUV planar image. <a href="#ga7c08b340ad7f8e85d407bd9e81d44d07">More...</a><br/></td></tr>
|
||||
<tr class="separator:ga7c08b340ad7f8e85d407bd9e81d44d07"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:ga0828a38ae29631ac28b6857cefb0eebf"><td class="memItemLeft" align="right" valign="top">DLLEXPORT int DLLCALL </td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga0828a38ae29631ac28b6857cefb0eebf">tjDecompressToYUVPlanes</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, unsigned char *jpegBuf, unsigned long jpegSize, unsigned char **dstPlanes, int width, int *strides, int height, int flags)</td></tr>
|
||||
<tr class="memdesc:ga0828a38ae29631ac28b6857cefb0eebf"><td class="mdescLeft"> </td><td class="mdescRight">Decompress a JPEG image into separate Y, U (Cb), and V (Cr) image planes. <a href="#ga0828a38ae29631ac28b6857cefb0eebf">More...</a><br/></td></tr>
|
||||
<tr class="separator:ga0828a38ae29631ac28b6857cefb0eebf"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:ga132ae2c2cadcf64c8bb0f3bdf69da3ed"><td class="memItemLeft" align="right" valign="top">DLLEXPORT int DLLCALL </td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga132ae2c2cadcf64c8bb0f3bdf69da3ed">tjDecodeYUV</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, unsigned char *srcBuf, int pad, int subsamp, unsigned char *dstBuf, int width, int pitch, int height, int pixelFormat, int flags)</td></tr>
|
||||
<tr class="memdesc:ga132ae2c2cadcf64c8bb0f3bdf69da3ed"><td class="mdescLeft"> </td><td class="mdescRight">Decode a YUV planar image into an RGB or grayscale image. <a href="#ga132ae2c2cadcf64c8bb0f3bdf69da3ed">More...</a><br/></td></tr>
|
||||
<tr class="separator:ga132ae2c2cadcf64c8bb0f3bdf69da3ed"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:ga6cb5b0e1101a2b20edea576e11faf93d"><td class="memItemLeft" align="right" valign="top">DLLEXPORT int DLLCALL </td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga6cb5b0e1101a2b20edea576e11faf93d">tjDecodeYUVPlanes</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, unsigned char **srcPlanes, int *strides, int subsamp, unsigned char *dstBuf, int width, int pitch, int height, int pixelFormat, int flags)</td></tr>
|
||||
<tr class="memdesc:ga6cb5b0e1101a2b20edea576e11faf93d"><td class="mdescLeft"> </td><td class="mdescRight">Decode a set of Y, U (Cb), and V (Cr) image planes into an RGB or grayscale image. <a href="#ga6cb5b0e1101a2b20edea576e11faf93d">More...</a><br/></td></tr>
|
||||
<tr class="separator:ga6cb5b0e1101a2b20edea576e11faf93d"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:gad8026a417e16a76313bc0a6c9e8b2ba2"><td class="memItemLeft" align="right" valign="top">DLLEXPORT int DLLCALL </td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#gad8026a417e16a76313bc0a6c9e8b2ba2">tjDecompress2</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, const unsigned char *jpegBuf, unsigned long jpegSize, unsigned char *dstBuf, int width, int pitch, int height, int pixelFormat, int flags)</td></tr>
|
||||
<tr class="memdesc:gad8026a417e16a76313bc0a6c9e8b2ba2"><td class="mdescLeft"> </td><td class="mdescRight">Decompress a JPEG image to an RGB, grayscale, or CMYK image. <a href="#gad8026a417e16a76313bc0a6c9e8b2ba2">More...</a><br/></td></tr>
|
||||
<tr class="separator:gad8026a417e16a76313bc0a6c9e8b2ba2"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:ga39e08906528db5a764670ea48d344b09"><td class="memItemLeft" align="right" valign="top">DLLEXPORT int DLLCALL </td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga39e08906528db5a764670ea48d344b09">tjDecompressToYUV2</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, const unsigned char *jpegBuf, unsigned long jpegSize, unsigned char *dstBuf, int width, int pad, int height, int flags)</td></tr>
|
||||
<tr class="memdesc:ga39e08906528db5a764670ea48d344b09"><td class="mdescLeft"> </td><td class="mdescRight">Decompress a JPEG image to a YUV planar image. <a href="#ga39e08906528db5a764670ea48d344b09">More...</a><br/></td></tr>
|
||||
<tr class="separator:ga39e08906528db5a764670ea48d344b09"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:ga38d0ef90692663b3ffb5b16da2541512"><td class="memItemLeft" align="right" valign="top">DLLEXPORT int DLLCALL </td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga38d0ef90692663b3ffb5b16da2541512">tjDecompressToYUVPlanes</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, const unsigned char *jpegBuf, unsigned long jpegSize, unsigned char **dstPlanes, int width, int *strides, int height, int flags)</td></tr>
|
||||
<tr class="memdesc:ga38d0ef90692663b3ffb5b16da2541512"><td class="mdescLeft"> </td><td class="mdescRight">Decompress a JPEG image into separate Y, U (Cb), and V (Cr) image planes. <a href="#ga38d0ef90692663b3ffb5b16da2541512">More...</a><br/></td></tr>
|
||||
<tr class="separator:ga38d0ef90692663b3ffb5b16da2541512"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:ga077c61027b875afecd5a1613bf18b3c1"><td class="memItemLeft" align="right" valign="top">DLLEXPORT int DLLCALL </td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga077c61027b875afecd5a1613bf18b3c1">tjDecodeYUV</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, const unsigned char *srcBuf, int pad, int subsamp, unsigned char *dstBuf, int width, int pitch, int height, int pixelFormat, int flags)</td></tr>
|
||||
<tr class="memdesc:ga077c61027b875afecd5a1613bf18b3c1"><td class="mdescLeft"> </td><td class="mdescRight">Decode a YUV planar image into an RGB or grayscale image. <a href="#ga077c61027b875afecd5a1613bf18b3c1">More...</a><br/></td></tr>
|
||||
<tr class="separator:ga077c61027b875afecd5a1613bf18b3c1"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:gaf42f19b7a496eb18bdc84fe61ee6d3e2"><td class="memItemLeft" align="right" valign="top">DLLEXPORT int DLLCALL </td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#gaf42f19b7a496eb18bdc84fe61ee6d3e2">tjDecodeYUVPlanes</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, const unsigned char **srcPlanes, const int *strides, int subsamp, unsigned char *dstBuf, int width, int pitch, int height, int pixelFormat, int flags)</td></tr>
|
||||
<tr class="memdesc:gaf42f19b7a496eb18bdc84fe61ee6d3e2"><td class="mdescLeft"> </td><td class="mdescRight">Decode a set of Y, U (Cb), and V (Cr) image planes into an RGB or grayscale image. <a href="#gaf42f19b7a496eb18bdc84fe61ee6d3e2">More...</a><br/></td></tr>
|
||||
<tr class="separator:gaf42f19b7a496eb18bdc84fe61ee6d3e2"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:ga3155b775bfbac9dbba869b95a0367902"><td class="memItemLeft" align="right" valign="top">DLLEXPORT <a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> DLLCALL </td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga3155b775bfbac9dbba869b95a0367902">tjInitTransform</a> (void)</td></tr>
|
||||
<tr class="memdesc:ga3155b775bfbac9dbba869b95a0367902"><td class="mdescLeft"> </td><td class="mdescRight">Create a new TurboJPEG transformer instance. <a href="#ga3155b775bfbac9dbba869b95a0367902">More...</a><br/></td></tr>
|
||||
<tr class="separator:ga3155b775bfbac9dbba869b95a0367902"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:gae403193ceb4aafb7e0f56ab587b48616"><td class="memItemLeft" align="right" valign="top">DLLEXPORT int DLLCALL </td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#gae403193ceb4aafb7e0f56ab587b48616">tjTransform</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, unsigned char *jpegBuf, unsigned long jpegSize, int n, unsigned char **dstBufs, unsigned long *dstSizes, <a class="el" href="structtjtransform.html">tjtransform</a> *transforms, int flags)</td></tr>
|
||||
<tr class="memdesc:gae403193ceb4aafb7e0f56ab587b48616"><td class="mdescLeft"> </td><td class="mdescRight">Losslessly transform a JPEG image into another JPEG image. <a href="#gae403193ceb4aafb7e0f56ab587b48616">More...</a><br/></td></tr>
|
||||
<tr class="separator:gae403193ceb4aafb7e0f56ab587b48616"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:gad02cd42b69f193a0623a9c801788df3a"><td class="memItemLeft" align="right" valign="top">DLLEXPORT int DLLCALL </td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#gad02cd42b69f193a0623a9c801788df3a">tjTransform</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, const unsigned char *jpegBuf, unsigned long jpegSize, int n, unsigned char **dstBufs, unsigned long *dstSizes, <a class="el" href="structtjtransform.html">tjtransform</a> *transforms, int flags)</td></tr>
|
||||
<tr class="memdesc:gad02cd42b69f193a0623a9c801788df3a"><td class="mdescLeft"> </td><td class="mdescRight">Losslessly transform a JPEG image into another JPEG image. <a href="#gad02cd42b69f193a0623a9c801788df3a">More...</a><br/></td></tr>
|
||||
<tr class="separator:gad02cd42b69f193a0623a9c801788df3a"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:ga674adee917b95ad4a896f1ba39e12540"><td class="memItemLeft" align="right" valign="top">DLLEXPORT int DLLCALL </td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga674adee917b95ad4a896f1ba39e12540">tjDestroy</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle)</td></tr>
|
||||
<tr class="memdesc:ga674adee917b95ad4a896f1ba39e12540"><td class="mdescLeft"> </td><td class="mdescRight">Destroy a TurboJPEG compressor, decompressor, or transformer instance. <a href="#ga674adee917b95ad4a896f1ba39e12540">More...</a><br/></td></tr>
|
||||
<tr class="separator:ga674adee917b95ad4a896f1ba39e12540"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
@@ -455,7 +455,7 @@ Variables</h2></td></tr>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>Disable buffer (re)allocation. </p>
|
||||
<p>If passed to <a class="el" href="group___turbo_j_p_e_g.html#gaba62b7a98f960839b588579898495cf2" title="Compress an RGB, grayscale, or CMYK image into a JPEG image.">tjCompress2()</a> or <a class="el" href="group___turbo_j_p_e_g.html#gae403193ceb4aafb7e0f56ab587b48616" title="Losslessly transform a JPEG image into another JPEG image.">tjTransform()</a>, this flag will cause those functions to generate an error if the JPEG image buffer is invalid or too small rather than attempting to allocate or reallocate that buffer. This reproduces the behavior of earlier versions of TurboJPEG. </p>
|
||||
<p>If passed to one of the JPEG compression or transform functions, this flag will cause those functions to generate an error if the JPEG image buffer is invalid or too small rather than attempting to allocate or reallocate that buffer. This reproduces the behavior of earlier versions of TurboJPEG. </p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -517,7 +517,7 @@ Variables</h2></td></tr>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>This option will enable lossless cropping. </p>
|
||||
<p>See <a class="el" href="group___turbo_j_p_e_g.html#gae403193ceb4aafb7e0f56ab587b48616" title="Losslessly transform a JPEG image into another JPEG image.">tjTransform()</a> for more information. </p>
|
||||
<p>See <a class="el" href="group___turbo_j_p_e_g.html#gad02cd42b69f193a0623a9c801788df3a" title="Losslessly transform a JPEG image into another JPEG image.">tjTransform()</a> for more information. </p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -545,7 +545,7 @@ Variables</h2></td></tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>This option will prevent <a class="el" href="group___turbo_j_p_e_g.html#gae403193ceb4aafb7e0f56ab587b48616" title="Losslessly transform a JPEG image into another JPEG image.">tjTransform()</a> from outputting a JPEG image for this particular transform (this can be used in conjunction with a custom filter to capture the transformed DCT coefficients without transcoding them.) </p>
|
||||
<p>This option will prevent <a class="el" href="group___turbo_j_p_e_g.html#gad02cd42b69f193a0623a9c801788df3a" title="Losslessly transform a JPEG image into another JPEG image.">tjTransform()</a> from outputting a JPEG image for this particular transform (this can be used in conjunction with a custom filter to capture the transformed DCT coefficients without transcoding them.) </p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -559,7 +559,7 @@ Variables</h2></td></tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>This option will cause <a class="el" href="group___turbo_j_p_e_g.html#gae403193ceb4aafb7e0f56ab587b48616" title="Losslessly transform a JPEG image into another JPEG image.">tjTransform()</a> to return an error if the transform is not perfect. </p>
|
||||
<p>This option will cause <a class="el" href="group___turbo_j_p_e_g.html#gad02cd42b69f193a0623a9c801788df3a" title="Losslessly transform a JPEG image into another JPEG image.">tjTransform()</a> to return an error if the transform is not perfect. </p>
|
||||
<p>Lossless transforms operate on MCU blocks, whose size depends on the level of chrominance subsampling used (see <a class="el" href="group___turbo_j_p_e_g.html#ga9e61e7cd47a15a173283ba94e781308c" title="MCU block width (in pixels) for a given level of chrominance subsampling.">tjMCUWidth</a> and <a class="el" href="group___turbo_j_p_e_g.html#gabd247bb9fecb393eca57366feb8327bf" title="MCU block height (in pixels) for a given level of chrominance subsampling.">tjMCUHeight</a>.) If the image's width or height is not evenly divisible by the MCU block size, then there will be partial MCU blocks on the right and/or bottom edges. It is not possible to move these partial MCU blocks to the top or left of the image, so any transform that would require that is "imperfect." If this option is not specified, then any partial MCU blocks that cannot be transformed will be left in place, which will create odd-looking strips on the right or bottom edge of the image. </p>
|
||||
|
||||
</div>
|
||||
@@ -574,7 +574,7 @@ Variables</h2></td></tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>This option will cause <a class="el" href="group___turbo_j_p_e_g.html#gae403193ceb4aafb7e0f56ab587b48616" title="Losslessly transform a JPEG image into another JPEG image.">tjTransform()</a> to discard any partial MCU blocks that cannot be transformed. </p>
|
||||
<p>This option will cause <a class="el" href="group___turbo_j_p_e_g.html#gad02cd42b69f193a0623a9c801788df3a" title="Losslessly transform a JPEG image into another JPEG image.">tjTransform()</a> to discard any partial MCU blocks that cannot be transformed. </p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -761,7 +761,7 @@ Variables</h2></td></tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>Transform operations for <a class="el" href="group___turbo_j_p_e_g.html#gae403193ceb4aafb7e0f56ab587b48616" title="Losslessly transform a JPEG image into another JPEG image.">tjTransform()</a> </p>
|
||||
<p>Transform operations for <a class="el" href="group___turbo_j_p_e_g.html#gad02cd42b69f193a0623a9c801788df3a" title="Losslessly transform a JPEG image into another JPEG image.">tjTransform()</a> </p>
|
||||
<table class="fieldtable">
|
||||
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><em><a class="anchor" id="gga2de531af4e7e6c4f124908376b354866aad88c0366cd3f7d0eac9d7a3fa1c2c27"></a>TJXOP_NONE</em> </td><td class="fielddoc">
|
||||
<p>Do not transform the position of the image pixels. </p>
|
||||
@@ -812,7 +812,7 @@ Variables</h2></td></tr>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>Allocate an image buffer for use with TurboJPEG. </p>
|
||||
<p>You should always use this function to allocate the JPEG destination buffer(s) for <a class="el" href="group___turbo_j_p_e_g.html#gaba62b7a98f960839b588579898495cf2" title="Compress an RGB, grayscale, or CMYK image into a JPEG image.">tjCompress2()</a> and <a class="el" href="group___turbo_j_p_e_g.html#gae403193ceb4aafb7e0f56ab587b48616" title="Losslessly transform a JPEG image into another JPEG image.">tjTransform()</a> unless you are disabling automatic buffer (re)allocation (by setting <a class="el" href="group___turbo_j_p_e_g.html#ga8808d403c68b62aaa58a4c1e58e98963" title="Disable buffer (re)allocation.">TJFLAG_NOREALLOC</a>.)</p>
|
||||
<p>You should always use this function to allocate the JPEG destination buffer(s) for the compression and transform functions unless you are disabling automatic buffer (re)allocation (by setting <a class="el" href="group___turbo_j_p_e_g.html#ga8808d403c68b62aaa58a4c1e58e98963" title="Disable buffer (re)allocation.">TJFLAG_NOREALLOC</a>.)</p>
|
||||
<dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramname">bytes</td><td>the number of bytes to allocate</td></tr>
|
||||
@@ -918,7 +918,7 @@ Variables</h2></td></tr>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<a class="anchor" id="gaba62b7a98f960839b588579898495cf2"></a>
|
||||
<a class="anchor" id="gaf38f2ed44bdc88e730e08b632fa6e88e"></a>
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<table class="memname">
|
||||
@@ -931,7 +931,7 @@ Variables</h2></td></tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">unsigned char * </td>
|
||||
<td class="paramtype">const unsigned char * </td>
|
||||
<td class="paramname"><em>srcBuf</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -1008,7 +1008,7 @@ Variables</h2></td></tr>
|
||||
<tr><td class="paramname">jpegBuf</td><td>address of a pointer to an image buffer that will receive the JPEG image. TurboJPEG has the ability to reallocate the JPEG buffer to accommodate the size of the JPEG image. Thus, you can choose to:<ol type="1">
|
||||
<li>pre-allocate the JPEG buffer with an arbitrary size using <a class="el" href="group___turbo_j_p_e_g.html#ga5c9234bda6d993cdaffdd89bf81a00ff" title="Allocate an image buffer for use with TurboJPEG.">tjAlloc()</a> and let TurboJPEG grow the buffer as needed,</li>
|
||||
<li>set <code>*jpegBuf</code> to NULL to tell TurboJPEG to allocate the buffer for you, or</li>
|
||||
<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>
|
||||
<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 that it won't be.)</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 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.) If <code>*jpegBuf</code> points to a JPEG image buffer that is being reused from a previous call to one of the JPEG compression functions, then <code>*jpegSize</code> is ignored.</td></tr>
|
||||
@@ -1022,7 +1022,7 @@ If you choose option 1, <code>*jpegSize</code> should be set to the size of your
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<a class="anchor" id="ga0b931126c7a615ddc3bbd0cca6698d67"></a>
|
||||
<a class="anchor" id="ga6f6de375d6ec0020faba627e37e5a060"></a>
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<table class="memname">
|
||||
@@ -1035,7 +1035,7 @@ If you choose option 1, <code>*jpegSize</code> should be set to the size of your
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">unsigned char * </td>
|
||||
<td class="paramtype">const unsigned char * </td>
|
||||
<td class="paramname"><em>srcBuf</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -1106,7 +1106,7 @@ If you choose option 1, <code>*jpegSize</code> should be set to the size of your
|
||||
<tr><td class="paramname">jpegBuf</td><td>address of a pointer to an image buffer that will receive the JPEG image. TurboJPEG has the ability to reallocate the JPEG buffer to accommodate the size of the JPEG image. Thus, you can choose to:<ol type="1">
|
||||
<li>pre-allocate the JPEG buffer with an arbitrary size using <a class="el" href="group___turbo_j_p_e_g.html#ga5c9234bda6d993cdaffdd89bf81a00ff" title="Allocate an image buffer for use with TurboJPEG.">tjAlloc()</a> and let TurboJPEG grow the buffer as needed,</li>
|
||||
<li>set <code>*jpegBuf</code> to NULL to tell TurboJPEG to allocate the buffer for you, or</li>
|
||||
<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>
|
||||
<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 that it won't be.)</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 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.) If <code>*jpegBuf</code> points to a JPEG image buffer that is being reused from a previous call to one of the JPEG compression functions, then <code>*jpegSize</code> is ignored.</td></tr>
|
||||
@@ -1119,7 +1119,7 @@ If you choose option 1, <code>*jpegSize</code> should be set to the size of your
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<a class="anchor" id="gaa89a1982cb4556b12ae7af4439991af6"></a>
|
||||
<a class="anchor" id="ga0b84c682d8accf097d7a743c965d3464"></a>
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<table class="memname">
|
||||
@@ -1132,7 +1132,7 @@ If you choose option 1, <code>*jpegSize</code> should be set to the size of your
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">unsigned char ** </td>
|
||||
<td class="paramtype">const unsigned char ** </td>
|
||||
<td class="paramname"><em>srcPlanes</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -1144,7 +1144,7 @@ If you choose option 1, <code>*jpegSize</code> should be set to the size of your
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">int * </td>
|
||||
<td class="paramtype">const int * </td>
|
||||
<td class="paramname"><em>strides</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -1203,7 +1203,7 @@ If you choose option 1, <code>*jpegSize</code> should be set to the size of your
|
||||
<tr><td class="paramname">jpegBuf</td><td>address of a pointer to an image buffer that will receive the JPEG image. TurboJPEG has the ability to reallocate the JPEG buffer to accommodate the size of the JPEG image. Thus, you can choose to:<ol type="1">
|
||||
<li>pre-allocate the JPEG buffer with an arbitrary size using <a class="el" href="group___turbo_j_p_e_g.html#ga5c9234bda6d993cdaffdd89bf81a00ff" title="Allocate an image buffer for use with TurboJPEG.">tjAlloc()</a> and let TurboJPEG grow the buffer as needed,</li>
|
||||
<li>set <code>*jpegBuf</code> to NULL to tell TurboJPEG to allocate the buffer for you, or</li>
|
||||
<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>
|
||||
<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 that it won't be.)</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 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.) If <code>*jpegBuf</code> points to a JPEG image buffer that is being reused from a previous call to one of the JPEG compression functions, then <code>*jpegSize</code> is ignored.</td></tr>
|
||||
@@ -1216,7 +1216,7 @@ If you choose option 1, <code>*jpegSize</code> should be set to the size of your
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<a class="anchor" id="ga132ae2c2cadcf64c8bb0f3bdf69da3ed"></a>
|
||||
<a class="anchor" id="ga077c61027b875afecd5a1613bf18b3c1"></a>
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<table class="memname">
|
||||
@@ -1229,7 +1229,7 @@ If you choose option 1, <code>*jpegSize</code> should be set to the size of your
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">unsigned char * </td>
|
||||
<td class="paramtype">const unsigned char * </td>
|
||||
<td class="paramname"><em>srcBuf</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -1309,7 +1309,7 @@ If you choose option 1, <code>*jpegSize</code> should be set to the size of your
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<a class="anchor" id="ga6cb5b0e1101a2b20edea576e11faf93d"></a>
|
||||
<a class="anchor" id="gaf42f19b7a496eb18bdc84fe61ee6d3e2"></a>
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<table class="memname">
|
||||
@@ -1322,13 +1322,13 @@ If you choose option 1, <code>*jpegSize</code> should be set to the size of your
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">unsigned char ** </td>
|
||||
<td class="paramtype">const unsigned char ** </td>
|
||||
<td class="paramname"><em>srcPlanes</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">int * </td>
|
||||
<td class="paramtype">const int * </td>
|
||||
<td class="paramname"><em>strides</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -1402,7 +1402,7 @@ If you choose option 1, <code>*jpegSize</code> should be set to the size of your
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<a class="anchor" id="gada69cc6443d1bb493b40f1626259e5e9"></a>
|
||||
<a class="anchor" id="gad8026a417e16a76313bc0a6c9e8b2ba2"></a>
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<table class="memname">
|
||||
@@ -1415,7 +1415,7 @@ If you choose option 1, <code>*jpegSize</code> should be set to the size of your
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">unsigned char * </td>
|
||||
<td class="paramtype">const unsigned char * </td>
|
||||
<td class="paramname"><em>jpegBuf</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -1487,7 +1487,7 @@ If you choose option 1, <code>*jpegSize</code> should be set to the size of your
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<a class="anchor" id="gacd0fac3af74b3511d39b4781b7103086"></a>
|
||||
<a class="anchor" id="ga3fced455e504e8ff4fbad28ba94a3020"></a>
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<table class="memname">
|
||||
@@ -1500,7 +1500,7 @@ If you choose option 1, <code>*jpegSize</code> should be set to the size of your
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">unsigned char * </td>
|
||||
<td class="paramtype">const unsigned char * </td>
|
||||
<td class="paramname"><em>jpegBuf</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -1558,7 +1558,7 @@ If you choose option 1, <code>*jpegSize</code> should be set to the size of your
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<a class="anchor" id="ga7c08b340ad7f8e85d407bd9e81d44d07"></a>
|
||||
<a class="anchor" id="ga39e08906528db5a764670ea48d344b09"></a>
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<table class="memname">
|
||||
@@ -1571,7 +1571,7 @@ If you choose option 1, <code>*jpegSize</code> should be set to the size of your
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">unsigned char * </td>
|
||||
<td class="paramtype">const unsigned char * </td>
|
||||
<td class="paramname"><em>jpegBuf</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -1637,7 +1637,7 @@ If you choose option 1, <code>*jpegSize</code> should be set to the size of your
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<a class="anchor" id="ga0828a38ae29631ac28b6857cefb0eebf"></a>
|
||||
<a class="anchor" id="ga38d0ef90692663b3ffb5b16da2541512"></a>
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<table class="memname">
|
||||
@@ -1650,7 +1650,7 @@ If you choose option 1, <code>*jpegSize</code> should be set to the size of your
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">unsigned char * </td>
|
||||
<td class="paramtype">const unsigned char * </td>
|
||||
<td class="paramname"><em>jpegBuf</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -1741,7 +1741,7 @@ If you choose option 1, <code>*jpegSize</code> should be set to the size of your
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<a class="anchor" id="ga0a5ffbf7cb58a5b6a8201114fe889360"></a>
|
||||
<a class="anchor" id="gaabe05acd734990053ad1294b5ef239aa"></a>
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<table class="memname">
|
||||
@@ -1754,7 +1754,7 @@ If you choose option 1, <code>*jpegSize</code> should be set to the size of your
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">unsigned char * </td>
|
||||
<td class="paramtype">const unsigned char * </td>
|
||||
<td class="paramname"><em>srcBuf</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -1834,7 +1834,7 @@ If you choose option 1, <code>*jpegSize</code> should be set to the size of your
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<a class="anchor" id="gaa791db8598853ddcad24e42897ef1269"></a>
|
||||
<a class="anchor" id="ga8a65ed3bd12df57c219d46afbc9008f1"></a>
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<table class="memname">
|
||||
@@ -1847,7 +1847,7 @@ If you choose option 1, <code>*jpegSize</code> should be set to the size of your
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">unsigned char * </td>
|
||||
<td class="paramtype">const unsigned char * </td>
|
||||
<td class="paramname"><em>srcBuf</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -1942,7 +1942,7 @@ If you choose option 1, <code>*jpegSize</code> should be set to the size of your
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>Free an image buffer previously allocated by TurboJPEG. </p>
|
||||
<p>You should always use this function to free JPEG destination buffer(s) that were automatically (re)allocated by <a class="el" href="group___turbo_j_p_e_g.html#gaba62b7a98f960839b588579898495cf2" title="Compress an RGB, grayscale, or CMYK image into a JPEG image.">tjCompress2()</a> or <a class="el" href="group___turbo_j_p_e_g.html#gae403193ceb4aafb7e0f56ab587b48616" title="Losslessly transform a JPEG image into another JPEG image.">tjTransform()</a> or that were manually allocated using <a class="el" href="group___turbo_j_p_e_g.html#ga5c9234bda6d993cdaffdd89bf81a00ff" title="Allocate an image buffer for use with TurboJPEG.">tjAlloc()</a>.</p>
|
||||
<p>You should always use this function to free JPEG destination buffer(s) that were automatically (re)allocated by the compression and transform functions or that were manually allocated using <a class="el" href="group___turbo_j_p_e_g.html#ga5c9234bda6d993cdaffdd89bf81a00ff" title="Allocate an image buffer for use with TurboJPEG.">tjAlloc()</a>.</p>
|
||||
<dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramname">buffer</td><td>address of the buffer to free</td></tr>
|
||||
@@ -2199,7 +2199,7 @@ If you choose option 1, <code>*jpegSize</code> should be set to the size of your
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<a class="anchor" id="gae403193ceb4aafb7e0f56ab587b48616"></a>
|
||||
<a class="anchor" id="gad02cd42b69f193a0623a9c801788df3a"></a>
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<table class="memname">
|
||||
@@ -2212,7 +2212,7 @@ If you choose option 1, <code>*jpegSize</code> should be set to the size of your
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">unsigned char * </td>
|
||||
<td class="paramtype">const unsigned char * </td>
|
||||
<td class="paramname"><em>jpegBuf</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -2270,7 +2270,7 @@ If you choose option 1, <code>*jpegSize</code> should be set to the size of your
|
||||
<tr><td class="paramname">dstBufs</td><td>pointer to an array of n image buffers. <code>dstBufs[i]</code> will receive a JPEG image that has been transformed using the parameters in <code>transforms[i]</code>. TurboJPEG has the ability to reallocate the JPEG buffer to accommodate the size of the JPEG image. Thus, you can choose to:<ol type="1">
|
||||
<li>pre-allocate the JPEG buffer with an arbitrary size using <a class="el" href="group___turbo_j_p_e_g.html#ga5c9234bda6d993cdaffdd89bf81a00ff" title="Allocate an image buffer for use with TurboJPEG.">tjAlloc()</a> and let TurboJPEG grow the buffer as needed,</li>
|
||||
<li>set <code>dstBufs[i]</code> to NULL to tell TurboJPEG to allocate the buffer for you, or</li>
|
||||
<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 transformed or 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>
|
||||
<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 transformed or cropped width and height. Under normal circumstances, 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 that it won't be.) Note, however, that there are some rare cases (such as transforming images with a large amount of embedded EXIF or ICC profile data) in which the output image will be larger than the worst-case size, and <a class="el" href="group___turbo_j_p_e_g.html#ga8808d403c68b62aaa58a4c1e58e98963" title="Disable buffer (re)allocation.">TJFLAG_NOREALLOC</a> cannot be used in those cases.</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 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>
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
<tr style="height: 56px;">
|
||||
<td style="padding-left: 0.5em;">
|
||||
<div id="projectname">TurboJPEG
|
||||
 <span id="projectnumber">1.4</span>
|
||||
 <span id="projectnumber">1.5</span>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
<tr style="height: 56px;">
|
||||
<td style="padding-left: 0.5em;">
|
||||
<div id="projectname">TurboJPEG
|
||||
 <span id="projectnumber">1.4</span>
|
||||
 <span id="projectnumber">1.5</span>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -8,24 +8,24 @@ var searchData=
|
||||
['tjblueoffset',['tjBlueOffset',['../group___turbo_j_p_e_g.html#ga84e2e35d3f08025f976ec1ec53693dea',1,'turbojpeg.h']]],
|
||||
['tjbufsize',['tjBufSize',['../group___turbo_j_p_e_g.html#gaccc5bca7f12fcdcc302e6e1c6d4b311b',1,'turbojpeg.h']]],
|
||||
['tjbufsizeyuv2',['tjBufSizeYUV2',['../group___turbo_j_p_e_g.html#gaf451664a62c1f6c7cc5a6401f32908c9',1,'turbojpeg.h']]],
|
||||
['tjcompress2',['tjCompress2',['../group___turbo_j_p_e_g.html#gaba62b7a98f960839b588579898495cf2',1,'turbojpeg.h']]],
|
||||
['tjcompressfromyuv',['tjCompressFromYUV',['../group___turbo_j_p_e_g.html#ga0b931126c7a615ddc3bbd0cca6698d67',1,'turbojpeg.h']]],
|
||||
['tjcompressfromyuvplanes',['tjCompressFromYUVPlanes',['../group___turbo_j_p_e_g.html#gaa89a1982cb4556b12ae7af4439991af6',1,'turbojpeg.h']]],
|
||||
['tjcompress2',['tjCompress2',['../group___turbo_j_p_e_g.html#gaf38f2ed44bdc88e730e08b632fa6e88e',1,'turbojpeg.h']]],
|
||||
['tjcompressfromyuv',['tjCompressFromYUV',['../group___turbo_j_p_e_g.html#ga6f6de375d6ec0020faba627e37e5a060',1,'turbojpeg.h']]],
|
||||
['tjcompressfromyuvplanes',['tjCompressFromYUVPlanes',['../group___turbo_j_p_e_g.html#ga0b84c682d8accf097d7a743c965d3464',1,'turbojpeg.h']]],
|
||||
['tjcs',['TJCS',['../group___turbo_j_p_e_g.html#ga4f83ad3368e0e29d1957be0efa7c3720',1,'turbojpeg.h']]],
|
||||
['tjcs_5fcmyk',['TJCS_CMYK',['../group___turbo_j_p_e_g.html#gga4f83ad3368e0e29d1957be0efa7c3720a6c8b636152ac8195b869587db315ee53',1,'turbojpeg.h']]],
|
||||
['tjcs_5fgray',['TJCS_GRAY',['../group___turbo_j_p_e_g.html#gga4f83ad3368e0e29d1957be0efa7c3720ab3e7d6a87f695e45b81c1b5262b5a50a',1,'turbojpeg.h']]],
|
||||
['tjcs_5frgb',['TJCS_RGB',['../group___turbo_j_p_e_g.html#gga4f83ad3368e0e29d1957be0efa7c3720a677cb7ccb85c4038ac41964a2e09e555',1,'turbojpeg.h']]],
|
||||
['tjcs_5fycbcr',['TJCS_YCbCr',['../group___turbo_j_p_e_g.html#gga4f83ad3368e0e29d1957be0efa7c3720a7389b8f65bb387ffedce3efd0d78ec75',1,'turbojpeg.h']]],
|
||||
['tjcs_5fycck',['TJCS_YCCK',['../group___turbo_j_p_e_g.html#gga4f83ad3368e0e29d1957be0efa7c3720a53839e0fe867b76b58d16b0a1a7c598e',1,'turbojpeg.h']]],
|
||||
['tjdecodeyuv',['tjDecodeYUV',['../group___turbo_j_p_e_g.html#ga132ae2c2cadcf64c8bb0f3bdf69da3ed',1,'turbojpeg.h']]],
|
||||
['tjdecodeyuvplanes',['tjDecodeYUVPlanes',['../group___turbo_j_p_e_g.html#ga6cb5b0e1101a2b20edea576e11faf93d',1,'turbojpeg.h']]],
|
||||
['tjdecompress2',['tjDecompress2',['../group___turbo_j_p_e_g.html#gada69cc6443d1bb493b40f1626259e5e9',1,'turbojpeg.h']]],
|
||||
['tjdecompressheader3',['tjDecompressHeader3',['../group___turbo_j_p_e_g.html#gacd0fac3af74b3511d39b4781b7103086',1,'turbojpeg.h']]],
|
||||
['tjdecompresstoyuv2',['tjDecompressToYUV2',['../group___turbo_j_p_e_g.html#ga7c08b340ad7f8e85d407bd9e81d44d07',1,'turbojpeg.h']]],
|
||||
['tjdecompresstoyuvplanes',['tjDecompressToYUVPlanes',['../group___turbo_j_p_e_g.html#ga0828a38ae29631ac28b6857cefb0eebf',1,'turbojpeg.h']]],
|
||||
['tjdecodeyuv',['tjDecodeYUV',['../group___turbo_j_p_e_g.html#ga077c61027b875afecd5a1613bf18b3c1',1,'turbojpeg.h']]],
|
||||
['tjdecodeyuvplanes',['tjDecodeYUVPlanes',['../group___turbo_j_p_e_g.html#gaf42f19b7a496eb18bdc84fe61ee6d3e2',1,'turbojpeg.h']]],
|
||||
['tjdecompress2',['tjDecompress2',['../group___turbo_j_p_e_g.html#gad8026a417e16a76313bc0a6c9e8b2ba2',1,'turbojpeg.h']]],
|
||||
['tjdecompressheader3',['tjDecompressHeader3',['../group___turbo_j_p_e_g.html#ga3fced455e504e8ff4fbad28ba94a3020',1,'turbojpeg.h']]],
|
||||
['tjdecompresstoyuv2',['tjDecompressToYUV2',['../group___turbo_j_p_e_g.html#ga39e08906528db5a764670ea48d344b09',1,'turbojpeg.h']]],
|
||||
['tjdecompresstoyuvplanes',['tjDecompressToYUVPlanes',['../group___turbo_j_p_e_g.html#ga38d0ef90692663b3ffb5b16da2541512',1,'turbojpeg.h']]],
|
||||
['tjdestroy',['tjDestroy',['../group___turbo_j_p_e_g.html#ga674adee917b95ad4a896f1ba39e12540',1,'turbojpeg.h']]],
|
||||
['tjencodeyuv3',['tjEncodeYUV3',['../group___turbo_j_p_e_g.html#ga0a5ffbf7cb58a5b6a8201114fe889360',1,'turbojpeg.h']]],
|
||||
['tjencodeyuvplanes',['tjEncodeYUVPlanes',['../group___turbo_j_p_e_g.html#gaa791db8598853ddcad24e42897ef1269',1,'turbojpeg.h']]],
|
||||
['tjencodeyuv3',['tjEncodeYUV3',['../group___turbo_j_p_e_g.html#gaabe05acd734990053ad1294b5ef239aa',1,'turbojpeg.h']]],
|
||||
['tjencodeyuvplanes',['tjEncodeYUVPlanes',['../group___turbo_j_p_e_g.html#ga8a65ed3bd12df57c219d46afbc9008f1',1,'turbojpeg.h']]],
|
||||
['tjflag_5faccuratedct',['TJFLAG_ACCURATEDCT',['../group___turbo_j_p_e_g.html#gacb233cfd722d66d1ccbf48a7de81f0e0',1,'turbojpeg.h']]],
|
||||
['tjflag_5fbottomup',['TJFLAG_BOTTOMUP',['../group___turbo_j_p_e_g.html#ga72ecf4ebe6eb702d3c6f5ca27455e1ec',1,'turbojpeg.h']]],
|
||||
['tjflag_5ffastdct',['TJFLAG_FASTDCT',['../group___turbo_j_p_e_g.html#gaabce235db80d3f698b27f36cbd453da2',1,'turbojpeg.h']]],
|
||||
@@ -70,7 +70,7 @@ var searchData=
|
||||
['tjsamp_5fgray',['TJSAMP_GRAY',['../group___turbo_j_p_e_g.html#gga1d047060ea80bb9820d540bb928e9074a3f1c9504842ddc7a48d0f690754b6248',1,'turbojpeg.h']]],
|
||||
['tjscaled',['TJSCALED',['../group___turbo_j_p_e_g.html#ga84878bb65404204743aa18cac02781df',1,'turbojpeg.h']]],
|
||||
['tjscalingfactor',['tjscalingfactor',['../structtjscalingfactor.html',1,'']]],
|
||||
['tjtransform',['tjtransform',['../structtjtransform.html',1,'tjtransform'],['../group___turbo_j_p_e_g.html#gae403193ceb4aafb7e0f56ab587b48616',1,'tjTransform(tjhandle handle, unsigned char *jpegBuf, unsigned long jpegSize, int n, unsigned char **dstBufs, unsigned long *dstSizes, tjtransform *transforms, int flags): turbojpeg.h'],['../group___turbo_j_p_e_g.html#gaa29f3189c41be12ec5dee7caec318a31',1,'tjtransform(): turbojpeg.h']]],
|
||||
['tjtransform',['tjtransform',['../structtjtransform.html',1,'tjtransform'],['../group___turbo_j_p_e_g.html#gad02cd42b69f193a0623a9c801788df3a',1,'tjTransform(tjhandle handle, const unsigned char *jpegBuf, unsigned long jpegSize, int n, unsigned char **dstBufs, unsigned long *dstSizes, tjtransform *transforms, int flags): turbojpeg.h'],['../group___turbo_j_p_e_g.html#gaa29f3189c41be12ec5dee7caec318a31',1,'tjtransform(): turbojpeg.h']]],
|
||||
['tjxop',['TJXOP',['../group___turbo_j_p_e_g.html#ga2de531af4e7e6c4f124908376b354866',1,'turbojpeg.h']]],
|
||||
['tjxop_5fhflip',['TJXOP_HFLIP',['../group___turbo_j_p_e_g.html#gga2de531af4e7e6c4f124908376b354866aa0df69776caa30f0fa28e26332d311ce',1,'turbojpeg.h']]],
|
||||
['tjxop_5fnone',['TJXOP_NONE',['../group___turbo_j_p_e_g.html#gga2de531af4e7e6c4f124908376b354866aad88c0366cd3f7d0eac9d7a3fa1c2c27',1,'turbojpeg.h']]],
|
||||
|
||||
@@ -3,18 +3,18 @@ var searchData=
|
||||
['tjalloc',['tjAlloc',['../group___turbo_j_p_e_g.html#ga5c9234bda6d993cdaffdd89bf81a00ff',1,'turbojpeg.h']]],
|
||||
['tjbufsize',['tjBufSize',['../group___turbo_j_p_e_g.html#gaccc5bca7f12fcdcc302e6e1c6d4b311b',1,'turbojpeg.h']]],
|
||||
['tjbufsizeyuv2',['tjBufSizeYUV2',['../group___turbo_j_p_e_g.html#gaf451664a62c1f6c7cc5a6401f32908c9',1,'turbojpeg.h']]],
|
||||
['tjcompress2',['tjCompress2',['../group___turbo_j_p_e_g.html#gaba62b7a98f960839b588579898495cf2',1,'turbojpeg.h']]],
|
||||
['tjcompressfromyuv',['tjCompressFromYUV',['../group___turbo_j_p_e_g.html#ga0b931126c7a615ddc3bbd0cca6698d67',1,'turbojpeg.h']]],
|
||||
['tjcompressfromyuvplanes',['tjCompressFromYUVPlanes',['../group___turbo_j_p_e_g.html#gaa89a1982cb4556b12ae7af4439991af6',1,'turbojpeg.h']]],
|
||||
['tjdecodeyuv',['tjDecodeYUV',['../group___turbo_j_p_e_g.html#ga132ae2c2cadcf64c8bb0f3bdf69da3ed',1,'turbojpeg.h']]],
|
||||
['tjdecodeyuvplanes',['tjDecodeYUVPlanes',['../group___turbo_j_p_e_g.html#ga6cb5b0e1101a2b20edea576e11faf93d',1,'turbojpeg.h']]],
|
||||
['tjdecompress2',['tjDecompress2',['../group___turbo_j_p_e_g.html#gada69cc6443d1bb493b40f1626259e5e9',1,'turbojpeg.h']]],
|
||||
['tjdecompressheader3',['tjDecompressHeader3',['../group___turbo_j_p_e_g.html#gacd0fac3af74b3511d39b4781b7103086',1,'turbojpeg.h']]],
|
||||
['tjdecompresstoyuv2',['tjDecompressToYUV2',['../group___turbo_j_p_e_g.html#ga7c08b340ad7f8e85d407bd9e81d44d07',1,'turbojpeg.h']]],
|
||||
['tjdecompresstoyuvplanes',['tjDecompressToYUVPlanes',['../group___turbo_j_p_e_g.html#ga0828a38ae29631ac28b6857cefb0eebf',1,'turbojpeg.h']]],
|
||||
['tjcompress2',['tjCompress2',['../group___turbo_j_p_e_g.html#gaf38f2ed44bdc88e730e08b632fa6e88e',1,'turbojpeg.h']]],
|
||||
['tjcompressfromyuv',['tjCompressFromYUV',['../group___turbo_j_p_e_g.html#ga6f6de375d6ec0020faba627e37e5a060',1,'turbojpeg.h']]],
|
||||
['tjcompressfromyuvplanes',['tjCompressFromYUVPlanes',['../group___turbo_j_p_e_g.html#ga0b84c682d8accf097d7a743c965d3464',1,'turbojpeg.h']]],
|
||||
['tjdecodeyuv',['tjDecodeYUV',['../group___turbo_j_p_e_g.html#ga077c61027b875afecd5a1613bf18b3c1',1,'turbojpeg.h']]],
|
||||
['tjdecodeyuvplanes',['tjDecodeYUVPlanes',['../group___turbo_j_p_e_g.html#gaf42f19b7a496eb18bdc84fe61ee6d3e2',1,'turbojpeg.h']]],
|
||||
['tjdecompress2',['tjDecompress2',['../group___turbo_j_p_e_g.html#gad8026a417e16a76313bc0a6c9e8b2ba2',1,'turbojpeg.h']]],
|
||||
['tjdecompressheader3',['tjDecompressHeader3',['../group___turbo_j_p_e_g.html#ga3fced455e504e8ff4fbad28ba94a3020',1,'turbojpeg.h']]],
|
||||
['tjdecompresstoyuv2',['tjDecompressToYUV2',['../group___turbo_j_p_e_g.html#ga39e08906528db5a764670ea48d344b09',1,'turbojpeg.h']]],
|
||||
['tjdecompresstoyuvplanes',['tjDecompressToYUVPlanes',['../group___turbo_j_p_e_g.html#ga38d0ef90692663b3ffb5b16da2541512',1,'turbojpeg.h']]],
|
||||
['tjdestroy',['tjDestroy',['../group___turbo_j_p_e_g.html#ga674adee917b95ad4a896f1ba39e12540',1,'turbojpeg.h']]],
|
||||
['tjencodeyuv3',['tjEncodeYUV3',['../group___turbo_j_p_e_g.html#ga0a5ffbf7cb58a5b6a8201114fe889360',1,'turbojpeg.h']]],
|
||||
['tjencodeyuvplanes',['tjEncodeYUVPlanes',['../group___turbo_j_p_e_g.html#gaa791db8598853ddcad24e42897ef1269',1,'turbojpeg.h']]],
|
||||
['tjencodeyuv3',['tjEncodeYUV3',['../group___turbo_j_p_e_g.html#gaabe05acd734990053ad1294b5ef239aa',1,'turbojpeg.h']]],
|
||||
['tjencodeyuvplanes',['tjEncodeYUVPlanes',['../group___turbo_j_p_e_g.html#ga8a65ed3bd12df57c219d46afbc9008f1',1,'turbojpeg.h']]],
|
||||
['tjfree',['tjFree',['../group___turbo_j_p_e_g.html#ga8c4a1231dc06a450514c835f6471f137',1,'turbojpeg.h']]],
|
||||
['tjgeterrorstr',['tjGetErrorStr',['../group___turbo_j_p_e_g.html#ga9af79c908ec131b1ae8d52fe40375abf',1,'turbojpeg.h']]],
|
||||
['tjgetscalingfactors',['tjGetScalingFactors',['../group___turbo_j_p_e_g.html#ga6449044b9af402999ccf52f401333be8',1,'turbojpeg.h']]],
|
||||
@@ -24,5 +24,5 @@ var searchData=
|
||||
['tjplaneheight',['tjPlaneHeight',['../group___turbo_j_p_e_g.html#ga1a209696c6a80748f20e134b3c64789f',1,'turbojpeg.h']]],
|
||||
['tjplanesizeyuv',['tjPlaneSizeYUV',['../group___turbo_j_p_e_g.html#ga6f98d977bfa9d167c97172e876ba61e2',1,'turbojpeg.h']]],
|
||||
['tjplanewidth',['tjPlaneWidth',['../group___turbo_j_p_e_g.html#ga63fb66bb1e36c74008c4634360becbb1',1,'turbojpeg.h']]],
|
||||
['tjtransform',['tjTransform',['../group___turbo_j_p_e_g.html#gae403193ceb4aafb7e0f56ab587b48616',1,'turbojpeg.h']]]
|
||||
['tjtransform',['tjTransform',['../group___turbo_j_p_e_g.html#gad02cd42b69f193a0623a9c801788df3a',1,'turbojpeg.h']]]
|
||||
];
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
<tr style="height: 56px;">
|
||||
<td style="padding-left: 0.5em;">
|
||||
<div id="projectname">TurboJPEG
|
||||
 <span id="projectnumber">1.4</span>
|
||||
 <span id="projectnumber">1.5</span>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
<tr style="height: 56px;">
|
||||
<td style="padding-left: 0.5em;">
|
||||
<div id="projectname">TurboJPEG
|
||||
 <span id="projectnumber">1.4</span>
|
||||
 <span id="projectnumber">1.5</span>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
<tr style="height: 56px;">
|
||||
<td style="padding-left: 0.5em;">
|
||||
<div id="projectname">TurboJPEG
|
||||
 <span id="projectnumber">1.4</span>
|
||||
 <span id="projectnumber">1.5</span>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -133,7 +133,7 @@ Data Fields</h2></td></tr>
|
||||
<tr><td class="paramname">arrayRegion</td><td><a class="el" href="structtjregion.html" title="Cropping region.">tjregion</a> structure containing the width and height of the array pointed to by <code>coeffs</code> as well as its offset relative to the component plane. TurboJPEG implementations may choose to split each component plane into multiple DCT coefficient arrays and call the callback function once for each array.</td></tr>
|
||||
<tr><td class="paramname">planeRegion</td><td><a class="el" href="structtjregion.html" title="Cropping region.">tjregion</a> structure containing the width and height of the component plane to which <code>coeffs</code> belongs</td></tr>
|
||||
<tr><td class="paramname">componentID</td><td>ID number of the component plane to which <code>coeffs</code> belongs (Y, Cb, and Cr have, respectively, ID's of 0, 1, and 2 in typical JPEG images.)</td></tr>
|
||||
<tr><td class="paramname">transformID</td><td>ID number of the transformed image to which <code>coeffs</code> belongs. This is the same as the index of the transform in the <code>transforms</code> array that was passed to <a class="el" href="group___turbo_j_p_e_g.html#gae403193ceb4aafb7e0f56ab587b48616" title="Losslessly transform a JPEG image into another JPEG image.">tjTransform()</a>.</td></tr>
|
||||
<tr><td class="paramname">transformID</td><td>ID number of the transformed image to which <code>coeffs</code> belongs. This is the same as the index of the transform in the <code>transforms</code> array that was passed to <a class="el" href="group___turbo_j_p_e_g.html#gad02cd42b69f193a0623a9c801788df3a" title="Losslessly transform a JPEG image into another JPEG image.">tjTransform()</a>.</td></tr>
|
||||
<tr><td class="paramname">transform</td><td>a pointer to a <a class="el" href="structtjtransform.html" title="Lossless transform.">tjtransform</a> structure that specifies the parameters and/or cropping region for this transform</td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
PROJECT_NAME = TurboJPEG
|
||||
PROJECT_NUMBER = 1.4
|
||||
PROJECT_NUMBER = 1.5
|
||||
OUTPUT_DIRECTORY = doc/
|
||||
USE_WINDOWS_ENCODING = NO
|
||||
OPTIMIZE_OUTPUT_FOR_C = YES
|
||||
|
||||
12
example.c
12
example.c
@@ -58,7 +58,7 @@
|
||||
* RGB color and is described by:
|
||||
*/
|
||||
|
||||
extern JSAMPLE * image_buffer; /* Points to large array of R,G,B-order data */
|
||||
extern JSAMPLE *image_buffer; /* Points to large array of R,G,B-order data */
|
||||
extern int image_height; /* Number of rows in image */
|
||||
extern int image_width; /* Number of columns in image */
|
||||
|
||||
@@ -69,7 +69,7 @@ extern int image_width; /* Number of columns in image */
|
||||
*/
|
||||
|
||||
GLOBAL(void)
|
||||
write_JPEG_file (char * filename, int quality)
|
||||
write_JPEG_file (char *filename, int quality)
|
||||
{
|
||||
/* This struct contains the JPEG compression parameters and pointers to
|
||||
* working space (which is allocated as needed by the JPEG library).
|
||||
@@ -88,7 +88,7 @@ write_JPEG_file (char * filename, int quality)
|
||||
*/
|
||||
struct jpeg_error_mgr jerr;
|
||||
/* More stuff */
|
||||
FILE * outfile; /* target file */
|
||||
FILE *outfile; /* target file */
|
||||
JSAMPROW row_pointer[1]; /* pointer to JSAMPLE row[s] */
|
||||
int row_stride; /* physical row width in image buffer */
|
||||
|
||||
@@ -253,7 +253,7 @@ struct my_error_mgr {
|
||||
jmp_buf setjmp_buffer; /* for return to caller */
|
||||
};
|
||||
|
||||
typedef struct my_error_mgr * my_error_ptr;
|
||||
typedef struct my_error_mgr *my_error_ptr;
|
||||
|
||||
/*
|
||||
* Here's the routine that will replace the standard error_exit method:
|
||||
@@ -281,7 +281,7 @@ my_error_exit (j_common_ptr cinfo)
|
||||
|
||||
|
||||
GLOBAL(int)
|
||||
read_JPEG_file (char * filename)
|
||||
read_JPEG_file (char *filename)
|
||||
{
|
||||
/* This struct contains the JPEG decompression parameters and pointers to
|
||||
* working space (which is allocated as needed by the JPEG library).
|
||||
@@ -293,7 +293,7 @@ read_JPEG_file (char * filename)
|
||||
*/
|
||||
struct my_error_mgr jerr;
|
||||
/* More stuff */
|
||||
FILE * infile; /* source file */
|
||||
FILE *infile; /* source file */
|
||||
JSAMPARRAY buffer; /* Output row buffer */
|
||||
int row_stride; /* physical row width in output buffer */
|
||||
|
||||
|
||||
13
jaricom.c
13
jaricom.c
@@ -1,9 +1,12 @@
|
||||
/*
|
||||
* jaricom.c
|
||||
*
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Developed 1997-2009 by Guido Vollbeding.
|
||||
* This file is part of the Independent JPEG Group's software.
|
||||
* For conditions of distribution and use, see the accompanying README file.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2015, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
* This file contains probability estimation tables for common use in
|
||||
* arithmetic entropy encoding and decoding routines.
|
||||
@@ -18,7 +21,7 @@
|
||||
#include "jpeglib.h"
|
||||
|
||||
/* The following #define specifies the packing of the four components
|
||||
* into the compact INT32 representation.
|
||||
* into the compact JLONG representation.
|
||||
* Note that this formula must match the actual arithmetic encoder
|
||||
* and decoder implementation. The implementation has to be changed
|
||||
* if this formula is changed.
|
||||
@@ -26,9 +29,9 @@
|
||||
* implementation (jbig_tab.c).
|
||||
*/
|
||||
|
||||
#define V(i,a,b,c,d) (((INT32)a << 16) | ((INT32)c << 8) | ((INT32)d << 7) | b)
|
||||
#define V(i,a,b,c,d) (((JLONG)a << 16) | ((JLONG)c << 8) | ((JLONG)d << 7) | b)
|
||||
|
||||
const INT32 jpeg_aritab[113+1] = {
|
||||
const JLONG jpeg_aritab[113+1] = {
|
||||
/*
|
||||
* Index, Qe_Value, Next_Index_LPS, Next_Index_MPS, Switch_MPS
|
||||
*/
|
||||
|
||||
@@ -5,6 +5,7 @@ set(JAVA_CLASSNAMES org/libjpegturbo/turbojpeg/TJ
|
||||
org/libjpegturbo/turbojpeg/TJCompressor
|
||||
org/libjpegturbo/turbojpeg/TJCustomFilter
|
||||
org/libjpegturbo/turbojpeg/TJDecompressor
|
||||
org/libjpegturbo/turbojpeg/TJException
|
||||
org/libjpegturbo/turbojpeg/TJScalingFactor
|
||||
org/libjpegturbo/turbojpeg/TJTransform
|
||||
org/libjpegturbo/turbojpeg/TJTransformer
|
||||
|
||||
@@ -10,6 +10,7 @@ JAVASOURCES = org/libjpegturbo/turbojpeg/TJ.java \
|
||||
org/libjpegturbo/turbojpeg/TJCompressor.java \
|
||||
org/libjpegturbo/turbojpeg/TJCustomFilter.java \
|
||||
org/libjpegturbo/turbojpeg/TJDecompressor.java \
|
||||
org/libjpegturbo/turbojpeg/TJException.java \
|
||||
org/libjpegturbo/turbojpeg/TJScalingFactor.java \
|
||||
org/libjpegturbo/turbojpeg/TJTransform.java \
|
||||
org/libjpegturbo/turbojpeg/TJTransformer.java \
|
||||
@@ -31,6 +32,7 @@ JAVA_CLASSES = org/libjpegturbo/turbojpeg/TJ.class \
|
||||
org/libjpegturbo/turbojpeg/TJCompressor.class \
|
||||
org/libjpegturbo/turbojpeg/TJCustomFilter.class \
|
||||
org/libjpegturbo/turbojpeg/TJDecompressor.class \
|
||||
org/libjpegturbo/turbojpeg/TJException.class \
|
||||
org/libjpegturbo/turbojpeg/TJLoader.class \
|
||||
org/libjpegturbo/turbojpeg/TJScalingFactor.class \
|
||||
org/libjpegturbo/turbojpeg/TJTransform.class \
|
||||
@@ -42,7 +44,7 @@ JAVA_CLASSES = org/libjpegturbo/turbojpeg/TJ.class \
|
||||
|
||||
all: all-am turbojpeg.jar
|
||||
|
||||
turbojpeg.jar: $(JAVA_CLASSES) ${srcdir}/MANIFEST.MF
|
||||
turbojpeg.jar: classnoinst.stamp ${srcdir}/MANIFEST.MF
|
||||
$(JAR) cfm turbojpeg.jar ${srcdir}/MANIFEST.MF $(JAVA_CLASSES)
|
||||
|
||||
clean-local:
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C)2009-2014 D. R. Commander. All Rights Reserved.
|
||||
* Copyright (C)2009-2014, 2016-2017 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:
|
||||
@@ -34,8 +34,8 @@ import org.libjpegturbo.turbojpeg.*;
|
||||
|
||||
class TJBench {
|
||||
|
||||
static int flags = 0, quiet = 0, pf = TJ.PF_BGR, yuvpad = 1, warmup = 1;
|
||||
static boolean compOnly, decompOnly, doTile, doYUV;
|
||||
static int flags = 0, quiet = 0, pf = TJ.PF_BGR, yuvpad = 1;
|
||||
static boolean compOnly, decompOnly, doTile, doYUV, write = true;
|
||||
|
||||
static final String[] pixFormatStr = {
|
||||
"RGB", "BGR", "RGBX", "BGRX", "XBGR", "XRGB", "GRAY"
|
||||
@@ -55,7 +55,7 @@ class TJBench {
|
||||
|
||||
static TJScalingFactor sf;
|
||||
static int xformOp = TJTransform.OP_NONE, xformOpt = 0;
|
||||
static double benchTime = 5.0;
|
||||
static double benchTime = 5.0, warmup = 1.0;
|
||||
|
||||
|
||||
static final double getTime() {
|
||||
@@ -162,7 +162,7 @@ class TJBench {
|
||||
}
|
||||
|
||||
/* Benchmark */
|
||||
iter -= warmup;
|
||||
iter = -1;
|
||||
elapsed = elapsedDecode = 0.0;
|
||||
while (true) {
|
||||
int tile = 0;
|
||||
@@ -184,11 +184,14 @@ class TJBench {
|
||||
tjd.decompress(dstBuf, x, y, width, pitch, height, pf, flags);
|
||||
}
|
||||
}
|
||||
iter++;
|
||||
if (iter >= 1) {
|
||||
elapsed += getTime() - start;
|
||||
elapsed += getTime() - start;
|
||||
if (iter >= 0) {
|
||||
iter++;
|
||||
if (elapsed >= benchTime)
|
||||
break;
|
||||
} else if (elapsed >= warmup) {
|
||||
iter = 0;
|
||||
elapsed = elapsedDecode = 0.0;
|
||||
}
|
||||
}
|
||||
if(doYUV)
|
||||
@@ -223,6 +226,8 @@ class TJBench {
|
||||
}
|
||||
}
|
||||
|
||||
if (!write) return;
|
||||
|
||||
if (sf.getNum() != 1 || sf.getDenom() != 1)
|
||||
sizeStr = new String(sf.getNum() + "_" + sf.getDenom());
|
||||
else if (tilew != w || tileh != h)
|
||||
@@ -319,7 +324,7 @@ class TJBench {
|
||||
}
|
||||
|
||||
/* Benchmark */
|
||||
iter = -warmup;
|
||||
iter = -1;
|
||||
elapsed = elapsedEncode = 0.0;
|
||||
while (true) {
|
||||
int tile = 0;
|
||||
@@ -344,11 +349,14 @@ class TJBench {
|
||||
totalJpegSize += jpegSize[tile];
|
||||
}
|
||||
}
|
||||
iter++;
|
||||
if (iter >= 1) {
|
||||
elapsed += getTime() - start;
|
||||
elapsed += getTime() - start;
|
||||
if (iter >= 0) {
|
||||
iter++;
|
||||
if (elapsed >= benchTime)
|
||||
break;
|
||||
} else if (elapsed >= warmup) {
|
||||
iter = 0;
|
||||
elapsed = elapsedEncode = 0.0;
|
||||
}
|
||||
}
|
||||
if (doYUV)
|
||||
@@ -394,7 +402,7 @@ class TJBench {
|
||||
System.out.format(" Output bit stream: %f Megabits/sec\n",
|
||||
(double)totalJpegSize * 8. / 1000000. * (double)iter / elapsed);
|
||||
}
|
||||
if (tilew == w && tileh == h) {
|
||||
if (tilew == w && tileh == h && write) {
|
||||
String tempStr = fileName + "_" + subName[subsamp] + "_" + "Q" +
|
||||
jpegQual + ".jpg";
|
||||
FileOutputStream fos = new FileOutputStream(tempStr);
|
||||
@@ -539,17 +547,20 @@ class TJBench {
|
||||
}
|
||||
}
|
||||
|
||||
iter = -warmup;
|
||||
iter = -1;
|
||||
elapsed = 0.;
|
||||
while (true) {
|
||||
start = getTime();
|
||||
tjt.transform(jpegBuf, t, flags);
|
||||
jpegSize = tjt.getTransformedSizes();
|
||||
iter++;
|
||||
if (iter >= 1) {
|
||||
elapsed += getTime() - start;
|
||||
elapsed += getTime() - start;
|
||||
if (iter >= 0) {
|
||||
iter++;
|
||||
if (elapsed >= benchTime)
|
||||
break;
|
||||
} else if (elapsed >= warmup) {
|
||||
iter = 0;
|
||||
elapsed = 0.0;
|
||||
}
|
||||
}
|
||||
t = null;
|
||||
@@ -580,8 +591,8 @@ class TJBench {
|
||||
System.out.print("N/A N/A ");
|
||||
jpegBuf = new byte[1][TJ.bufSize(_tilew, _tileh, subsamp)];
|
||||
jpegSize = new int[1];
|
||||
jpegBuf[0] = srcBuf;
|
||||
jpegSize[0] = srcSize;
|
||||
System.arraycopy(srcBuf, 0, jpegBuf[0], 0, srcSize);
|
||||
}
|
||||
|
||||
if (w == tilew)
|
||||
@@ -657,9 +668,12 @@ class TJBench {
|
||||
System.out.println("-grayscale = Perform lossless grayscale conversion prior to decompression");
|
||||
System.out.println(" test (can be combined with the other transforms above)");
|
||||
System.out.println("-benchtime <t> = Run each benchmark for at least <t> seconds (default = 5.0)");
|
||||
System.out.println("-warmup <w> = Execute each benchmark <w> times to prime the cache before");
|
||||
System.out.println(" taking performance measurements (default = 1)");
|
||||
System.out.println("-componly = Stop after running compression tests. Do not test decompression.\n");
|
||||
System.out.println("-warmup <t> = Run each benchmark for <t> seconds (default = 1.0) prior to");
|
||||
System.out.println(" starting the timer, in order to prime the caches and thus improve the");
|
||||
System.out.println(" consistency of the results.");
|
||||
System.out.println("-componly = Stop after running compression tests. Do not test decompression.");
|
||||
System.out.println("-nowrite = Do not write reference or output images (improves consistency");
|
||||
System.out.println(" of performance measurements.)\n");
|
||||
System.out.println("NOTE: If the quality is specified as a range (e.g. 90-100), a separate");
|
||||
System.out.println("test will be performed for all quality values in the range.\n");
|
||||
System.exit(1);
|
||||
@@ -817,15 +831,18 @@ class TJBench {
|
||||
}
|
||||
if (argv[i].equalsIgnoreCase("-componly"))
|
||||
compOnly = true;
|
||||
if (argv[i].equalsIgnoreCase("-nowrite"))
|
||||
write = false;
|
||||
if (argv[i].equalsIgnoreCase("-warmup") && i < argv.length - 1) {
|
||||
int temp = -1;
|
||||
double temp = -1;
|
||||
try {
|
||||
temp = Integer.parseInt(argv[++i]);
|
||||
temp = Double.parseDouble(argv[++i]);
|
||||
} catch (NumberFormatException e) {}
|
||||
if (temp >= 0) {
|
||||
if (temp >= 0.0) {
|
||||
warmup = temp;
|
||||
System.out.format("Warmup runs = %d\n\n", warmup);
|
||||
}
|
||||
System.out.format("Warmup time = %.1f seconds\n\n", warmup);
|
||||
} else
|
||||
usage();
|
||||
}
|
||||
if (argv[i].equalsIgnoreCase("-?"))
|
||||
usage();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C)2011-2012, 2014 D. R. Commander. All Rights Reserved.
|
||||
* Copyright (C)2011-2012, 2014-2015 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:
|
||||
@@ -351,7 +351,7 @@ public class TJExample implements TJCustomFilter {
|
||||
public void customFilter(ShortBuffer coeffBuffer, Rectangle bufferRegion,
|
||||
Rectangle planeRegion, int componentIndex,
|
||||
int transformIndex, TJTransform transform)
|
||||
throws Exception {
|
||||
throws TJException {
|
||||
for (int i = 0; i < bufferRegion.width * bufferRegion.height; i++) {
|
||||
coeffBuffer.put(i, (short)(-coeffBuffer.get(i)));
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C)2011-2015 D. R. Commander. All Rights Reserved.
|
||||
* Copyright (C)2011-2016 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:
|
||||
@@ -892,6 +892,9 @@ public class TJUnitTest {
|
||||
else
|
||||
tjc.compress(dstBuf, 0);
|
||||
}
|
||||
dstImage = null;
|
||||
dstBuf = null;
|
||||
System.gc();
|
||||
}
|
||||
}
|
||||
System.out.println("Done. ");
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
<li><a href="org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg" target="classFrame">TJCompressor</a></li>
|
||||
<li><a href="org/libjpegturbo/turbojpeg/TJCustomFilter.html" title="interface in org.libjpegturbo.turbojpeg" target="classFrame"><i>TJCustomFilter</i></a></li>
|
||||
<li><a href="org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg" target="classFrame">TJDecompressor</a></li>
|
||||
<li><a href="org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg" target="classFrame">TJException</a></li>
|
||||
<li><a href="org/libjpegturbo/turbojpeg/TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg" target="classFrame">TJScalingFactor</a></li>
|
||||
<li><a href="org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg" target="classFrame">TJTransform</a></li>
|
||||
<li><a href="org/libjpegturbo/turbojpeg/TJTransformer.html" title="class in org.libjpegturbo.turbojpeg" target="classFrame">TJTransformer</a></li>
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
<li><a href="org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg">TJCompressor</a></li>
|
||||
<li><a href="org/libjpegturbo/turbojpeg/TJCustomFilter.html" title="interface in org.libjpegturbo.turbojpeg"><i>TJCustomFilter</i></a></li>
|
||||
<li><a href="org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></li>
|
||||
<li><a href="org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></li>
|
||||
<li><a href="org/libjpegturbo/turbojpeg/TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg">TJScalingFactor</a></li>
|
||||
<li><a href="org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</a></li>
|
||||
<li><a href="org/libjpegturbo/turbojpeg/TJTransformer.html" title="class in org.libjpegturbo.turbojpeg">TJTransformer</a></li>
|
||||
|
||||
@@ -821,6 +821,16 @@
|
||||
source image stored in <code>yuvImage</code> with the newly created
|
||||
instance.</div>
|
||||
</dd>
|
||||
<dt><a href="./org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">TJException</span></a> - Exception in <a href="./org/libjpegturbo/turbojpeg/package-summary.html">org.libjpegturbo.turbojpeg</a></dt>
|
||||
<dd> </dd>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJException.html#TJException()">TJException()</a></span> - Constructor for exception org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></dt>
|
||||
<dd> </dd>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJException.html#TJException(java.lang.String,%20java.lang.Throwable)">TJException(String, Throwable)</a></span> - Constructor for exception org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></dt>
|
||||
<dd> </dd>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJException.html#TJException(java.lang.String)">TJException(String)</a></span> - Constructor for exception org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></dt>
|
||||
<dd> </dd>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJException.html#TJException(java.lang.Throwable)">TJException(Throwable)</a></span> - Constructor for exception org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></dt>
|
||||
<dd> </dd>
|
||||
<dt><a href="./org/libjpegturbo/turbojpeg/TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">TJScalingFactor</span></a> - Class in <a href="./org/libjpegturbo/turbojpeg/package-summary.html">org.libjpegturbo.turbojpeg</a></dt>
|
||||
<dd>
|
||||
<div class="block">Fractional scaling factor</div>
|
||||
|
||||
@@ -983,16 +983,13 @@ public static final int FLAG_FORCESSE3</pre>
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<h4>getMCUWidth</h4>
|
||||
<pre>public static int getMCUWidth(int subsamp)
|
||||
throws java.lang.Exception</pre>
|
||||
<pre>public static int getMCUWidth(int subsamp)</pre>
|
||||
<div class="block">Returns the MCU block width for the given level of chrominance
|
||||
subsampling.</div>
|
||||
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>subsamp</code> - the level of chrominance subsampling (one of
|
||||
<code>SAMP_*</code>)</dd>
|
||||
<dt><span class="strong">Returns:</span></dt><dd>the MCU block width for the given level of chrominance
|
||||
subsampling.</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
subsampling.</dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="getMCUHeight(int)">
|
||||
@@ -1001,16 +998,13 @@ public static final int FLAG_FORCESSE3</pre>
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<h4>getMCUHeight</h4>
|
||||
<pre>public static int getMCUHeight(int subsamp)
|
||||
throws java.lang.Exception</pre>
|
||||
<pre>public static int getMCUHeight(int subsamp)</pre>
|
||||
<div class="block">Returns the MCU block height for the given level of chrominance
|
||||
subsampling.</div>
|
||||
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>subsamp</code> - the level of chrominance subsampling (one of
|
||||
<code>SAMP_*</code>)</dd>
|
||||
<dt><span class="strong">Returns:</span></dt><dd>the MCU block height for the given level of chrominance
|
||||
subsampling.</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
subsampling.</dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="getPixelSize(int)">
|
||||
@@ -1019,13 +1013,10 @@ public static final int FLAG_FORCESSE3</pre>
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<h4>getPixelSize</h4>
|
||||
<pre>public static int getPixelSize(int pixelFormat)
|
||||
throws java.lang.Exception</pre>
|
||||
<pre>public static int getPixelSize(int pixelFormat)</pre>
|
||||
<div class="block">Returns the pixel size (in bytes) for the given pixel format.</div>
|
||||
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>pixelFormat</code> - the pixel format (one of <code>PF_*</code>)</dd>
|
||||
<dt><span class="strong">Returns:</span></dt><dd>the pixel size (in bytes) for the given pixel format.</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
<dt><span class="strong">Returns:</span></dt><dd>the pixel size (in bytes) for the given pixel format.</dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="getRedOffset(int)">
|
||||
@@ -1034,17 +1025,14 @@ public static final int FLAG_FORCESSE3</pre>
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<h4>getRedOffset</h4>
|
||||
<pre>public static int getRedOffset(int pixelFormat)
|
||||
throws java.lang.Exception</pre>
|
||||
<pre>public static int getRedOffset(int pixelFormat)</pre>
|
||||
<div class="block">For the given pixel format, returns the number of bytes that the red
|
||||
component is offset from the start of the pixel. For instance, if a pixel
|
||||
of format <code>TJ.PF_BGRX</code> is stored in <code>char pixel[]</code>,
|
||||
then the red component will be
|
||||
<code>pixel[TJ.getRedOffset(TJ.PF_BGRX)]</code>.</div>
|
||||
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>pixelFormat</code> - the pixel format (one of <code>PF_*</code>)</dd>
|
||||
<dt><span class="strong">Returns:</span></dt><dd>the red offset for the given pixel format.</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
<dt><span class="strong">Returns:</span></dt><dd>the red offset for the given pixel format.</dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="getGreenOffset(int)">
|
||||
@@ -1053,17 +1041,14 @@ public static final int FLAG_FORCESSE3</pre>
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<h4>getGreenOffset</h4>
|
||||
<pre>public static int getGreenOffset(int pixelFormat)
|
||||
throws java.lang.Exception</pre>
|
||||
<pre>public static int getGreenOffset(int pixelFormat)</pre>
|
||||
<div class="block">For the given pixel format, returns the number of bytes that the green
|
||||
component is offset from the start of the pixel. For instance, if a pixel
|
||||
of format <code>TJ.PF_BGRX</code> is stored in <code>char pixel[]</code>,
|
||||
then the green component will be
|
||||
<code>pixel[TJ.getGreenOffset(TJ.PF_BGRX)]</code>.</div>
|
||||
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>pixelFormat</code> - the pixel format (one of <code>PF_*</code>)</dd>
|
||||
<dt><span class="strong">Returns:</span></dt><dd>the green offset for the given pixel format.</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
<dt><span class="strong">Returns:</span></dt><dd>the green offset for the given pixel format.</dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="getBlueOffset(int)">
|
||||
@@ -1072,17 +1057,14 @@ public static final int FLAG_FORCESSE3</pre>
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<h4>getBlueOffset</h4>
|
||||
<pre>public static int getBlueOffset(int pixelFormat)
|
||||
throws java.lang.Exception</pre>
|
||||
<pre>public static int getBlueOffset(int pixelFormat)</pre>
|
||||
<div class="block">For the given pixel format, returns the number of bytes that the blue
|
||||
component is offset from the start of the pixel. For instance, if a pixel
|
||||
of format <code>TJ.PF_BGRX</code> is stored in <code>char pixel[]</code>,
|
||||
then the blue component will be
|
||||
<code>pixel[TJ.getBlueOffset(TJ.PF_BGRX)]</code>.</div>
|
||||
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>pixelFormat</code> - the pixel format (one of <code>PF_*</code>)</dd>
|
||||
<dt><span class="strong">Returns:</span></dt><dd>the blue offset for the given pixel format.</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
<dt><span class="strong">Returns:</span></dt><dd>the blue offset for the given pixel format.</dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="bufSize(int, int, int)">
|
||||
@@ -1093,16 +1075,13 @@ public static final int FLAG_FORCESSE3</pre>
|
||||
<h4>bufSize</h4>
|
||||
<pre>public static int bufSize(int width,
|
||||
int height,
|
||||
int jpegSubsamp)
|
||||
throws java.lang.Exception</pre>
|
||||
int jpegSubsamp)</pre>
|
||||
<div class="block">Returns the maximum size of the buffer (in bytes) required to hold a JPEG
|
||||
image with the given width, height, and level of chrominance subsampling.</div>
|
||||
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>width</code> - the width (in pixels) of the JPEG image</dd><dd><code>height</code> - the height (in pixels) of the JPEG image</dd><dd><code>jpegSubsamp</code> - the level of chrominance subsampling to be used when
|
||||
generating the JPEG image (one of <a href="../../../org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg"><code>TJ.SAMP_*</code></a>)</dd>
|
||||
<dt><span class="strong">Returns:</span></dt><dd>the maximum size of the buffer (in bytes) required to hold a JPEG
|
||||
image with the given width, height, and level of chrominance subsampling.</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
image with the given width, height, and level of chrominance subsampling.</dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="bufSizeYUV(int, int, int, int)">
|
||||
@@ -1114,17 +1093,14 @@ public static final int FLAG_FORCESSE3</pre>
|
||||
<pre>public static int bufSizeYUV(int width,
|
||||
int pad,
|
||||
int height,
|
||||
int subsamp)
|
||||
throws java.lang.Exception</pre>
|
||||
int subsamp)</pre>
|
||||
<div class="block">Returns the size of the buffer (in bytes) required to hold a YUV planar
|
||||
image with the given width, height, and level of chrominance subsampling.</div>
|
||||
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>width</code> - the width (in pixels) of the YUV image</dd><dd><code>pad</code> - the width of each line in each plane of the image is padded to
|
||||
the nearest multiple of this number of bytes (must be a power of 2.)</dd><dd><code>height</code> - the height (in pixels) of the YUV image</dd><dd><code>subsamp</code> - the level of chrominance subsampling used in the YUV
|
||||
image (one of <a href="../../../org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg"><code>TJ.SAMP_*</code></a>)</dd>
|
||||
<dt><span class="strong">Returns:</span></dt><dd>the size of the buffer (in bytes) required to hold a YUV planar
|
||||
image with the given width, height, and level of chrominance subsampling.</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
image with the given width, height, and level of chrominance subsampling.</dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="bufSizeYUV(int, int, int)">
|
||||
@@ -1136,11 +1112,8 @@ public static final int FLAG_FORCESSE3</pre>
|
||||
<pre>@Deprecated
|
||||
public static int bufSizeYUV(int width,
|
||||
int height,
|
||||
int subsamp)
|
||||
throws java.lang.Exception</pre>
|
||||
int subsamp)</pre>
|
||||
<div class="block"><span class="strong">Deprecated.</span> <i>Use <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#bufSizeYUV(int,%20int,%20int,%20int)"><code>bufSizeYUV(int, int, int, int)</code></a> instead.</i></div>
|
||||
<dl><dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="planeSizeYUV(int, int, int, int, int)">
|
||||
@@ -1153,8 +1126,7 @@ public static int bufSizeYUV(int width,
|
||||
int width,
|
||||
int stride,
|
||||
int height,
|
||||
int subsamp)
|
||||
throws java.lang.Exception</pre>
|
||||
int subsamp)</pre>
|
||||
<div class="block">Returns the size of the buffer (in bytes) required to hold a YUV image
|
||||
plane with the given parameters.</div>
|
||||
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>componentID</code> - ID number of the image plane (0 = Y, 1 = U/Cb,
|
||||
@@ -1163,9 +1135,7 @@ public static int bufSizeYUV(int width,
|
||||
height of the whole image, not the plane height.</dd><dd><code>subsamp</code> - the level of chrominance subsampling used in the YUV
|
||||
image (one of <a href="../../../org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg"><code>TJ.SAMP_*</code></a>)</dd>
|
||||
<dt><span class="strong">Returns:</span></dt><dd>the size of the buffer (in bytes) required to hold a YUV planar
|
||||
image with the given parameters.</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
image with the given parameters.</dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="planeWidth(int, int, int)">
|
||||
@@ -1176,16 +1146,13 @@ public static int bufSizeYUV(int width,
|
||||
<h4>planeWidth</h4>
|
||||
<pre>public static int planeWidth(int componentID,
|
||||
int width,
|
||||
int subsamp)
|
||||
throws java.lang.Exception</pre>
|
||||
int subsamp)</pre>
|
||||
<div class="block">Returns the plane width of a YUV image plane with the given parameters.
|
||||
Refer to <a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg"><code>YUVImage</code></a> for a description of plane width.</div>
|
||||
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>componentID</code> - ID number of the image plane (0 = Y, 1 = U/Cb,
|
||||
2 = V/Cr)</dd><dd><code>width</code> - width (in pixels) of the YUV image</dd><dd><code>subsamp</code> - the level of chrominance subsampling used in the YUV image
|
||||
(one of <a href="../../../org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg"><code>TJ.SAMP_*</code></a>)</dd>
|
||||
<dt><span class="strong">Returns:</span></dt><dd>the plane width of a YUV image plane with the given parameters.</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
<dt><span class="strong">Returns:</span></dt><dd>the plane width of a YUV image plane with the given parameters.</dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="planeHeight(int, int, int)">
|
||||
@@ -1196,16 +1163,13 @@ public static int bufSizeYUV(int width,
|
||||
<h4>planeHeight</h4>
|
||||
<pre>public static int planeHeight(int componentID,
|
||||
int height,
|
||||
int subsamp)
|
||||
throws java.lang.Exception</pre>
|
||||
int subsamp)</pre>
|
||||
<div class="block">Returns the plane height of a YUV image plane with the given parameters.
|
||||
Refer to <a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg"><code>YUVImage</code></a> for a description of plane height.</div>
|
||||
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>componentID</code> - ID number of the image plane (0 = Y, 1 = U/Cb,
|
||||
2 = V/Cr)</dd><dd><code>height</code> - height (in pixels) of the YUV image</dd><dd><code>subsamp</code> - the level of chrominance subsampling used in the YUV image
|
||||
(one of <a href="../../../org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg"><code>TJ.SAMP_*</code></a>)</dd>
|
||||
<dt><span class="strong">Returns:</span></dt><dd>the plane height of a YUV image plane with the given parameters.</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
<dt><span class="strong">Returns:</span></dt><dd>the plane height of a YUV image plane with the given parameters.</dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="getScalingFactors()">
|
||||
@@ -1214,14 +1178,11 @@ public static int bufSizeYUV(int width,
|
||||
<ul class="blockListLast">
|
||||
<li class="blockList">
|
||||
<h4>getScalingFactors</h4>
|
||||
<pre>public static <a href="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg">TJScalingFactor</a>[] getScalingFactors()
|
||||
throws java.lang.Exception</pre>
|
||||
<pre>public static <a href="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg">TJScalingFactor</a>[] getScalingFactors()</pre>
|
||||
<div class="block">Returns a list of fractional scaling factors that the JPEG decompressor in
|
||||
this implementation of TurboJPEG supports.</div>
|
||||
<dl><dt><span class="strong">Returns:</span></dt><dd>a list of fractional scaling factors that the JPEG decompressor in
|
||||
this implementation of TurboJPEG supports.</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
this implementation of TurboJPEG supports.</dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
@@ -90,10 +90,15 @@
|
||||
<div class="description">
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<dl>
|
||||
<dt>All Implemented Interfaces:</dt>
|
||||
<dd>java.io.Closeable, java.lang.AutoCloseable</dd>
|
||||
</dl>
|
||||
<hr>
|
||||
<br>
|
||||
<pre>public class <span class="strong">TJCompressor</span>
|
||||
extends java.lang.Object</pre>
|
||||
extends java.lang.Object
|
||||
implements java.io.Closeable</pre>
|
||||
<div class="block">TurboJPEG compressor</div>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -376,10 +381,10 @@ extends java.lang.Object</pre>
|
||||
<li class="blockList">
|
||||
<h4>TJCompressor</h4>
|
||||
<pre>public TJCompressor()
|
||||
throws java.lang.Exception</pre>
|
||||
throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
|
||||
<div class="block">Create a TurboJPEG compressor instance.</div>
|
||||
<dl><dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="TJCompressor(byte[], int, int, int, int, int, int)">
|
||||
@@ -395,14 +400,14 @@ extends java.lang.Object</pre>
|
||||
int pitch,
|
||||
int height,
|
||||
int pixelFormat)
|
||||
throws java.lang.Exception</pre>
|
||||
throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
|
||||
<div class="block">Create a TurboJPEG compressor instance and associate the uncompressed
|
||||
source image stored in <code>srcImage</code> with the newly created
|
||||
instance.</div>
|
||||
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>srcImage</code> - see <a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[],%20int,%20int,%20int,%20int,%20int,%20int)"><code>setSourceImage(byte[], int, int, int, int, int, int)</code></a> for description</dd><dd><code>x</code> - see <a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[],%20int,%20int,%20int,%20int,%20int,%20int)"><code>setSourceImage(byte[], int, int, int, int, int, int)</code></a> for description</dd><dd><code>y</code> - see <a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[],%20int,%20int,%20int,%20int,%20int,%20int)"><code>setSourceImage(byte[], int, int, int, int, int, int)</code></a> for description</dd><dd><code>width</code> - see <a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[],%20int,%20int,%20int,%20int,%20int,%20int)"><code>setSourceImage(byte[], int, int, int, int, int, int)</code></a> for description</dd><dd><code>pitch</code> - see <a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[],%20int,%20int,%20int,%20int,%20int,%20int)"><code>setSourceImage(byte[], int, int, int, int, int, int)</code></a> for description</dd><dd><code>height</code> - see <a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[],%20int,%20int,%20int,%20int,%20int,%20int)"><code>setSourceImage(byte[], int, int, int, int, int, int)</code></a> for description</dd><dd><code>pixelFormat</code> - pixel format of the source image (one of
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJ.html#PF_RGB"><code>TJ.PF_*</code></a>)</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="TJCompressor(byte[], int, int, int, int)">
|
||||
@@ -417,11 +422,11 @@ public TJCompressor(byte[] srcImage,
|
||||
int pitch,
|
||||
int height,
|
||||
int pixelFormat)
|
||||
throws java.lang.Exception</pre>
|
||||
throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
|
||||
<div class="block"><span class="strong">Deprecated.</span> <i>Use
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#TJCompressor(byte[],%20int,%20int,%20int,%20int,%20int,%20int)"><code>TJCompressor(byte[], int, int, int, int, int, int)</code></a> instead.</i></div>
|
||||
<dl><dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="TJCompressor(java.awt.image.BufferedImage, int, int, int, int)">
|
||||
@@ -435,7 +440,7 @@ public TJCompressor(byte[] srcImage,
|
||||
int y,
|
||||
int width,
|
||||
int height)
|
||||
throws java.lang.Exception</pre>
|
||||
throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
|
||||
<div class="block">Create a TurboJPEG compressor instance and associate the uncompressed
|
||||
source image stored in <code>srcImage</code> with the newly created
|
||||
instance.</div>
|
||||
@@ -446,7 +451,7 @@ public TJCompressor(byte[] srcImage,
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage,%20int,%20int,%20int,%20int)"><code>setSourceImage(BufferedImage, int, int, int, int)</code></a> for description</dd><dd><code>height</code> - see
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage,%20int,%20int,%20int,%20int)"><code>setSourceImage(BufferedImage, int, int, int, int)</code></a> for description</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
@@ -470,11 +475,11 @@ public TJCompressor(byte[] srcImage,
|
||||
int pitch,
|
||||
int height,
|
||||
int pixelFormat)
|
||||
throws java.lang.Exception</pre>
|
||||
throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
|
||||
<div class="block">Associate an uncompressed RGB, grayscale, or CMYK source image with this
|
||||
compressor instance.</div>
|
||||
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>srcImage</code> - image buffer containing RGB, grayscale, or CMYK pixels to
|
||||
be compressed or encoded</dd><dd><code>x</code> - x offset (in pixels) of the region in the source image from which
|
||||
be compressed or encoded. This buffer is not modified.</dd><dd><code>x</code> - x offset (in pixels) of the region in the source image from which
|
||||
the JPEG or YUV image should be compressed/encoded</dd><dd><code>y</code> - y offset (in pixels) of the region in the source image from which
|
||||
the JPEG or YUV image should be compressed/encoded</dd><dd><code>width</code> - width (in pixels) of the region in the source image from
|
||||
which the JPEG or YUV image should be compressed/encoded</dd><dd><code>pitch</code> - bytes per line of the source image. Normally, this should be
|
||||
@@ -488,7 +493,7 @@ public TJCompressor(byte[] srcImage,
|
||||
which the JPEG or YUV image should be compressed/encoded</dd><dd><code>pixelFormat</code> - pixel format of the source image (one of
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJ.html#PF_RGB"><code>TJ.PF_*</code></a>)</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="setSourceImage(byte[], int, int, int, int)">
|
||||
@@ -503,11 +508,11 @@ public void setSourceImage(byte[] srcImage,
|
||||
int pitch,
|
||||
int height,
|
||||
int pixelFormat)
|
||||
throws java.lang.Exception</pre>
|
||||
throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
|
||||
<div class="block"><span class="strong">Deprecated.</span> <i>Use
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[],%20int,%20int,%20int,%20int,%20int,%20int)"><code>setSourceImage(byte[], int, int, int, int, int, int)</code></a> instead.</i></div>
|
||||
<dl><dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="setSourceImage(java.awt.image.BufferedImage, int, int, int, int)">
|
||||
@@ -521,11 +526,11 @@ public void setSourceImage(byte[] srcImage,
|
||||
int y,
|
||||
int width,
|
||||
int height)
|
||||
throws java.lang.Exception</pre>
|
||||
throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
|
||||
<div class="block">Associate an uncompressed RGB or grayscale source image with this
|
||||
compressor instance.</div>
|
||||
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>srcImage</code> - a <code>BufferedImage</code> instance containing RGB or
|
||||
grayscale pixels to be compressed or encoded</dd><dd><code>x</code> - x offset (in pixels) of the region in the source image from which
|
||||
grayscale pixels to be compressed or encoded. This image is not modified.</dd><dd><code>x</code> - x offset (in pixels) of the region in the source image from which
|
||||
the JPEG or YUV image should be compressed/encoded</dd><dd><code>y</code> - y offset (in pixels) of the region in the source image from which
|
||||
the JPEG or YUV image should be compressed/encoded</dd><dd><code>width</code> - width (in pixels) of the region in the source image from
|
||||
which the JPEG or YUV image should be compressed/encoded (0 = use the
|
||||
@@ -533,7 +538,7 @@ public void setSourceImage(byte[] srcImage,
|
||||
which the JPEG or YUV image should be compressed/encoded (0 = use the
|
||||
height of the source image)</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="setSourceImage(org.libjpegturbo.turbojpeg.YUVImage)">
|
||||
@@ -543,12 +548,13 @@ public void setSourceImage(byte[] srcImage,
|
||||
<li class="blockList">
|
||||
<h4>setSourceImage</h4>
|
||||
<pre>public void setSourceImage(<a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a> srcImage)
|
||||
throws java.lang.Exception</pre>
|
||||
throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
|
||||
<div class="block">Associate an uncompressed YUV planar source image with this compressor
|
||||
instance.</div>
|
||||
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>srcImage</code> - YUV planar image to be compressed</dd>
|
||||
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>srcImage</code> - YUV planar image to be compressed. This image is not
|
||||
modified.</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="setSubsamp(int)">
|
||||
@@ -557,8 +563,7 @@ public void setSourceImage(byte[] srcImage,
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<h4>setSubsamp</h4>
|
||||
<pre>public void setSubsamp(int newSubsamp)
|
||||
throws java.lang.Exception</pre>
|
||||
<pre>public void setSubsamp(int newSubsamp)</pre>
|
||||
<div class="block">Set the level of chrominance subsampling for subsequent compress/encode
|
||||
operations. When pixels are converted from RGB to YCbCr (see
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJ.html#CS_YCbCr"><code>TJ.CS_YCbCr</code></a>) or from CMYK to YCCK (see <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#CS_YCCK"><code>TJ.CS_YCCK</code></a>) as part
|
||||
@@ -576,9 +581,7 @@ public void setSourceImage(byte[] srcImage,
|
||||
destination.</div>
|
||||
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>newSubsamp</code> - the level of chrominance subsampling to use in
|
||||
subsequent compress/encode oeprations (one of
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJ.html#SAMP_444"><code>TJ.SAMP_*</code></a>)</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJ.html#SAMP_444"><code>TJ.SAMP_*</code></a>)</dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="setJPEGQuality(int)">
|
||||
@@ -587,13 +590,10 @@ public void setSourceImage(byte[] srcImage,
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<h4>setJPEGQuality</h4>
|
||||
<pre>public void setJPEGQuality(int quality)
|
||||
throws java.lang.Exception</pre>
|
||||
<pre>public void setJPEGQuality(int quality)</pre>
|
||||
<div class="block">Set the JPEG image quality level for subsequent compress operations.</div>
|
||||
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>quality</code> - the new JPEG image quality level (1 to 100, 1 = worst,
|
||||
100 = best)</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
100 = best)</dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="compress(byte[], int)">
|
||||
@@ -604,7 +604,7 @@ public void setSourceImage(byte[] srcImage,
|
||||
<h4>compress</h4>
|
||||
<pre>public void compress(byte[] dstBuf,
|
||||
int flags)
|
||||
throws java.lang.Exception</pre>
|
||||
throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
|
||||
<div class="block">Compress the uncompressed source image associated with this compressor
|
||||
instance and output a JPEG image to the given destination buffer.</div>
|
||||
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>dstBuf</code> - buffer that will receive the JPEG image. Use
|
||||
@@ -613,7 +613,7 @@ public void setSourceImage(byte[] srcImage,
|
||||
subsampling.</dd><dd><code>flags</code> - the bitwise OR of one or more of
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJ.html#FLAG_BOTTOMUP"><code>TJ.FLAG_*</code></a></dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="compress(int)">
|
||||
@@ -623,7 +623,7 @@ public void setSourceImage(byte[] srcImage,
|
||||
<li class="blockList">
|
||||
<h4>compress</h4>
|
||||
<pre>public byte[] compress(int flags)
|
||||
throws java.lang.Exception</pre>
|
||||
throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
|
||||
<div class="block">Compress the uncompressed source image associated with this compressor
|
||||
instance and return a buffer containing a JPEG image.</div>
|
||||
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>flags</code> - the bitwise OR of one or more of
|
||||
@@ -631,7 +631,7 @@ public void setSourceImage(byte[] srcImage,
|
||||
<dt><span class="strong">Returns:</span></dt><dd>a buffer containing a JPEG image. The length of this buffer will
|
||||
not be equal to the size of the JPEG image. Use <a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#getCompressedSize()"><code>getCompressedSize()</code></a> to obtain the size of the JPEG image.</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="compress(java.awt.image.BufferedImage, byte[], int)">
|
||||
@@ -644,12 +644,12 @@ public void setSourceImage(byte[] srcImage,
|
||||
public void compress(java.awt.image.BufferedImage srcImage,
|
||||
byte[] dstBuf,
|
||||
int flags)
|
||||
throws java.lang.Exception</pre>
|
||||
throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
|
||||
<div class="block"><span class="strong">Deprecated.</span> <i>Use
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage,%20int,%20int,%20int,%20int)"><code>setSourceImage(BufferedImage, int, int, int, int)</code></a> and
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#compress(byte[],%20int)"><code>compress(byte[], int)</code></a> instead.</i></div>
|
||||
<dl><dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="compress(java.awt.image.BufferedImage, int)">
|
||||
@@ -661,12 +661,12 @@ public void compress(java.awt.image.BufferedImage srcImage,
|
||||
<pre>@Deprecated
|
||||
public byte[] compress(java.awt.image.BufferedImage srcImage,
|
||||
int flags)
|
||||
throws java.lang.Exception</pre>
|
||||
throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
|
||||
<div class="block"><span class="strong">Deprecated.</span> <i>Use
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage,%20int,%20int,%20int,%20int)"><code>setSourceImage(BufferedImage, int, int, int, int)</code></a> and
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#compress(int)"><code>compress(int)</code></a> instead.</i></div>
|
||||
<dl><dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="encodeYUV(org.libjpegturbo.turbojpeg.YUVImage, int)">
|
||||
@@ -677,7 +677,7 @@ public byte[] compress(java.awt.image.BufferedImage srcImage,
|
||||
<h4>encodeYUV</h4>
|
||||
<pre>public void encodeYUV(<a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a> dstImage,
|
||||
int flags)
|
||||
throws java.lang.Exception</pre>
|
||||
throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
|
||||
<div class="block">Encode the uncompressed source image associated with this compressor
|
||||
instance into a YUV planar image and store it in the given
|
||||
<code>YUVImage</code> instance. This method uses the accelerated color
|
||||
@@ -688,7 +688,7 @@ public byte[] compress(java.awt.image.BufferedImage srcImage,
|
||||
image</dd><dd><code>flags</code> - the bitwise OR of one or more of
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJ.html#FLAG_BOTTOMUP"><code>TJ.FLAG_*</code></a></dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="encodeYUV(byte[], int)">
|
||||
@@ -700,10 +700,10 @@ public byte[] compress(java.awt.image.BufferedImage srcImage,
|
||||
<pre>@Deprecated
|
||||
public void encodeYUV(byte[] dstBuf,
|
||||
int flags)
|
||||
throws java.lang.Exception</pre>
|
||||
throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
|
||||
<div class="block"><span class="strong">Deprecated.</span> <i>Use <a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(org.libjpegturbo.turbojpeg.YUVImage,%20int)"><code>encodeYUV(YUVImage, int)</code></a> instead.</i></div>
|
||||
<dl><dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="encodeYUV(int, int)">
|
||||
@@ -714,7 +714,7 @@ public void encodeYUV(byte[] dstBuf,
|
||||
<h4>encodeYUV</h4>
|
||||
<pre>public <a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a> encodeYUV(int pad,
|
||||
int flags)
|
||||
throws java.lang.Exception</pre>
|
||||
throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
|
||||
<div class="block">Encode the uncompressed source image associated with this compressor
|
||||
instance into a unified YUV planar image buffer and return a
|
||||
<code>YUVImage</code> instance containing the encoded image. This method
|
||||
@@ -727,7 +727,7 @@ public void encodeYUV(byte[] dstBuf,
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJ.html#FLAG_BOTTOMUP"><code>TJ.FLAG_*</code></a></dd>
|
||||
<dt><span class="strong">Returns:</span></dt><dd>a YUV planar image.</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="encodeYUV(int[], int)">
|
||||
@@ -738,7 +738,7 @@ public void encodeYUV(byte[] dstBuf,
|
||||
<h4>encodeYUV</h4>
|
||||
<pre>public <a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a> encodeYUV(int[] strides,
|
||||
int flags)
|
||||
throws java.lang.Exception</pre>
|
||||
throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
|
||||
<div class="block">Encode the uncompressed source image associated with this compressor
|
||||
instance into separate Y, U (Cb), and V (Cr) image planes and return a
|
||||
<code>YUVImage</code> instance containing the encoded image planes. This
|
||||
@@ -755,7 +755,7 @@ public void encodeYUV(byte[] dstBuf,
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJ.html#FLAG_BOTTOMUP"><code>TJ.FLAG_*</code></a></dd>
|
||||
<dt><span class="strong">Returns:</span></dt><dd>a YUV planar image.</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="encodeYUV(int)">
|
||||
@@ -766,10 +766,10 @@ public void encodeYUV(byte[] dstBuf,
|
||||
<h4>encodeYUV</h4>
|
||||
<pre>@Deprecated
|
||||
public byte[] encodeYUV(int flags)
|
||||
throws java.lang.Exception</pre>
|
||||
throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
|
||||
<div class="block"><span class="strong">Deprecated.</span> <i>Use <a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(int,%20int)"><code>encodeYUV(int, int)</code></a> instead.</i></div>
|
||||
<dl><dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="encodeYUV(java.awt.image.BufferedImage, byte[], int)">
|
||||
@@ -782,12 +782,12 @@ public byte[] encodeYUV(int flags)
|
||||
public void encodeYUV(java.awt.image.BufferedImage srcImage,
|
||||
byte[] dstBuf,
|
||||
int flags)
|
||||
throws java.lang.Exception</pre>
|
||||
throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
|
||||
<div class="block"><span class="strong">Deprecated.</span> <i>Use
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage,%20int,%20int,%20int,%20int)"><code>setSourceImage(BufferedImage, int, int, int, int)</code></a> and
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(byte[],%20int)"><code>encodeYUV(byte[], int)</code></a> instead.</i></div>
|
||||
<dl><dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="encodeYUV(java.awt.image.BufferedImage, int)">
|
||||
@@ -799,12 +799,12 @@ public void encodeYUV(java.awt.image.BufferedImage srcImage,
|
||||
<pre>@Deprecated
|
||||
public byte[] encodeYUV(java.awt.image.BufferedImage srcImage,
|
||||
int flags)
|
||||
throws java.lang.Exception</pre>
|
||||
throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
|
||||
<div class="block"><span class="strong">Deprecated.</span> <i>Use
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage,%20int,%20int,%20int,%20int)"><code>setSourceImage(BufferedImage, int, int, int, int)</code></a> and
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(int,%20int)"><code>encodeYUV(int, int)</code></a> instead.</i></div>
|
||||
<dl><dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="getCompressedSize()">
|
||||
@@ -827,10 +827,15 @@ public byte[] encodeYUV(java.awt.image.BufferedImage srcImage,
|
||||
<li class="blockList">
|
||||
<h4>close</h4>
|
||||
<pre>public void close()
|
||||
throws java.lang.Exception</pre>
|
||||
throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
|
||||
<div class="block">Free the native structures associated with this compressor instance.</div>
|
||||
<dl><dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
<dl>
|
||||
<dt><strong>Specified by:</strong></dt>
|
||||
<dd><code>close</code> in interface <code>java.io.Closeable</code></dd>
|
||||
<dt><strong>Specified by:</strong></dt>
|
||||
<dd><code>close</code> in interface <code>java.lang.AutoCloseable</code></dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="finalize()">
|
||||
|
||||
@@ -144,7 +144,7 @@
|
||||
int componentID,
|
||||
int transformID,
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</a> transform)
|
||||
throws java.lang.Exception</pre>
|
||||
throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
|
||||
<div class="block">A callback function that can be used to modify the DCT coefficients after
|
||||
they are losslessly transformed but before they are transcoded to a new
|
||||
JPEG image. This allows for custom filters or other transformations to be
|
||||
@@ -165,7 +165,7 @@
|
||||
transform in the <code>transforms</code> array that was passed to <a href="../../../org/libjpegturbo/turbojpeg/TJTransformer.html#transform(byte[][],%20org.libjpegturbo.turbojpeg.TJTransform[],%20int)"><code>TJTransformer.transform()</code></a>.</dd><dd><code>transform</code> - a <a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg"><code>TJTransform</code></a> instance that specifies the
|
||||
parameters and/or cropping region for this transform</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
<div class="subNav">
|
||||
<ul class="navList">
|
||||
<li><a href="../../../org/libjpegturbo/turbojpeg/TJCustomFilter.html" title="interface in org.libjpegturbo.turbojpeg"><span class="strong">Prev Class</span></a></li>
|
||||
<li><a href="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">Next Class</span></a></li>
|
||||
<li><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">Next Class</span></a></li>
|
||||
</ul>
|
||||
<ul class="navList">
|
||||
<li><a href="../../../index.html?org/libjpegturbo/turbojpeg/TJDecompressor.html" target="_top">Frames</a></li>
|
||||
@@ -91,13 +91,18 @@
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<dl>
|
||||
<dt>All Implemented Interfaces:</dt>
|
||||
<dd>java.io.Closeable, java.lang.AutoCloseable</dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt>Direct Known Subclasses:</dt>
|
||||
<dd><a href="../../../org/libjpegturbo/turbojpeg/TJTransformer.html" title="class in org.libjpegturbo.turbojpeg">TJTransformer</a></dd>
|
||||
</dl>
|
||||
<hr>
|
||||
<br>
|
||||
<pre>public class <span class="strong">TJDecompressor</span>
|
||||
extends java.lang.Object</pre>
|
||||
extends java.lang.Object
|
||||
implements java.io.Closeable</pre>
|
||||
<div class="block">TurboJPEG decompressor</div>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -529,10 +534,10 @@ extends java.lang.Object</pre>
|
||||
<li class="blockList">
|
||||
<h4>TJDecompressor</h4>
|
||||
<pre>public TJDecompressor()
|
||||
throws java.lang.Exception</pre>
|
||||
throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
|
||||
<div class="block">Create a TurboJPEG decompresssor instance.</div>
|
||||
<dl><dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="TJDecompressor(byte[])">
|
||||
@@ -542,13 +547,13 @@ extends java.lang.Object</pre>
|
||||
<li class="blockList">
|
||||
<h4>TJDecompressor</h4>
|
||||
<pre>public TJDecompressor(byte[] jpegImage)
|
||||
throws java.lang.Exception</pre>
|
||||
throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
|
||||
<div class="block">Create a TurboJPEG decompressor instance and associate the JPEG source
|
||||
image stored in <code>jpegImage</code> with the newly created instance.</div>
|
||||
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>jpegImage</code> - JPEG image buffer (size of the JPEG image is assumed to
|
||||
be the length of the array)</dd>
|
||||
be the length of the array.) This buffer is not modified.</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="TJDecompressor(byte[], int)">
|
||||
@@ -559,13 +564,13 @@ extends java.lang.Object</pre>
|
||||
<h4>TJDecompressor</h4>
|
||||
<pre>public TJDecompressor(byte[] jpegImage,
|
||||
int imageSize)
|
||||
throws java.lang.Exception</pre>
|
||||
throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
|
||||
<div class="block">Create a TurboJPEG decompressor instance and associate the JPEG source
|
||||
image of length <code>imageSize</code> bytes stored in
|
||||
<code>jpegImage</code> with the newly created instance.</div>
|
||||
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>jpegImage</code> - JPEG image buffer</dd><dd><code>imageSize</code> - size of the JPEG image (in bytes)</dd>
|
||||
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>jpegImage</code> - JPEG image buffer. This buffer is not modified.</dd><dd><code>imageSize</code> - size of the JPEG image (in bytes)</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="TJDecompressor(org.libjpegturbo.turbojpeg.YUVImage)">
|
||||
@@ -575,14 +580,14 @@ extends java.lang.Object</pre>
|
||||
<li class="blockList">
|
||||
<h4>TJDecompressor</h4>
|
||||
<pre>public TJDecompressor(<a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a> yuvImage)
|
||||
throws java.lang.Exception</pre>
|
||||
throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
|
||||
<div class="block">Create a TurboJPEG decompressor instance and associate the YUV planar
|
||||
source image stored in <code>yuvImage</code> with the newly created
|
||||
instance.</div>
|
||||
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>yuvImage</code> - <a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg"><code>YUVImage</code></a> instance containing a YUV planar
|
||||
image to be decoded</dd>
|
||||
image to be decoded. This image is not modified.</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
@@ -601,13 +606,13 @@ extends java.lang.Object</pre>
|
||||
<h4>setSourceImage</h4>
|
||||
<pre>public void setSourceImage(byte[] jpegImage,
|
||||
int imageSize)
|
||||
throws java.lang.Exception</pre>
|
||||
throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
|
||||
<div class="block">Associate the JPEG image of length <code>imageSize</code> bytes stored in
|
||||
<code>jpegImage</code> with this decompressor instance. This image will
|
||||
be used as the source image for subsequent decompress operations.</div>
|
||||
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>jpegImage</code> - JPEG image buffer</dd><dd><code>imageSize</code> - size of the JPEG image (in bytes)</dd>
|
||||
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>jpegImage</code> - JPEG image buffer. This buffer is not modified.</dd><dd><code>imageSize</code> - size of the JPEG image (in bytes)</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="setJPEGImage(byte[], int)">
|
||||
@@ -619,10 +624,10 @@ extends java.lang.Object</pre>
|
||||
<pre>@Deprecated
|
||||
public void setJPEGImage(byte[] jpegImage,
|
||||
int imageSize)
|
||||
throws java.lang.Exception</pre>
|
||||
throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
|
||||
<div class="block"><span class="strong">Deprecated.</span> <i>Use <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#setSourceImage(byte[],%20int)"><code>setSourceImage(byte[], int)</code></a> instead.</i></div>
|
||||
<dl><dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="setSourceImage(org.libjpegturbo.turbojpeg.YUVImage)">
|
||||
@@ -631,15 +636,12 @@ public void setJPEGImage(byte[] jpegImage,
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<h4>setSourceImage</h4>
|
||||
<pre>public void setSourceImage(<a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a> srcImage)
|
||||
throws java.lang.Exception</pre>
|
||||
<pre>public void setSourceImage(<a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a> srcImage)</pre>
|
||||
<div class="block">Associate the specified YUV planar source image with this decompressor
|
||||
instance. Subsequent decompress operations will decode this image into an
|
||||
RGB or grayscale destination image.</div>
|
||||
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>srcImage</code> - <a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg"><code>YUVImage</code></a> instance containing a YUV planar image to
|
||||
be decoded</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
be decoded. This image is not modified.</dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="getWidth()">
|
||||
@@ -648,14 +650,11 @@ public void setJPEGImage(byte[] jpegImage,
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<h4>getWidth</h4>
|
||||
<pre>public int getWidth()
|
||||
throws java.lang.Exception</pre>
|
||||
<pre>public int getWidth()</pre>
|
||||
<div class="block">Returns the width of the source image (JPEG or YUV) associated with this
|
||||
decompressor instance.</div>
|
||||
<dl><dt><span class="strong">Returns:</span></dt><dd>the width of the source image (JPEG or YUV) associated with this
|
||||
decompressor instance.</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
decompressor instance.</dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="getHeight()">
|
||||
@@ -664,14 +663,11 @@ public void setJPEGImage(byte[] jpegImage,
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<h4>getHeight</h4>
|
||||
<pre>public int getHeight()
|
||||
throws java.lang.Exception</pre>
|
||||
<pre>public int getHeight()</pre>
|
||||
<div class="block">Returns the height of the source image (JPEG or YUV) associated with this
|
||||
decompressor instance.</div>
|
||||
<dl><dt><span class="strong">Returns:</span></dt><dd>the height of the source image (JPEG or YUV) associated with this
|
||||
decompressor instance.</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
decompressor instance.</dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="getSubsamp()">
|
||||
@@ -680,15 +676,12 @@ public void setJPEGImage(byte[] jpegImage,
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<h4>getSubsamp</h4>
|
||||
<pre>public int getSubsamp()
|
||||
throws java.lang.Exception</pre>
|
||||
<pre>public int getSubsamp()</pre>
|
||||
<div class="block">Returns the level of chrominance subsampling used in the source image
|
||||
(JPEG or YUV) associated with this decompressor instance. See
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJ.html#SAMP_444"><code>TJ.SAMP_*</code></a>.</div>
|
||||
<dl><dt><span class="strong">Returns:</span></dt><dd>the level of chrominance subsampling used in the source image
|
||||
(JPEG or YUV) associated with this decompressor instance.</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
(JPEG or YUV) associated with this decompressor instance.</dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="getColorspace()">
|
||||
@@ -697,15 +690,12 @@ public void setJPEGImage(byte[] jpegImage,
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<h4>getColorspace</h4>
|
||||
<pre>public int getColorspace()
|
||||
throws java.lang.Exception</pre>
|
||||
<pre>public int getColorspace()</pre>
|
||||
<div class="block">Returns the colorspace used in the source image (JPEG or YUV) associated
|
||||
with this decompressor instance. See <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#CS_RGB"><code>TJ.CS_*</code></a>. If the
|
||||
source image is YUV, then this always returns <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#CS_YCbCr"><code>TJ.CS_YCbCr</code></a>.</div>
|
||||
<dl><dt><span class="strong">Returns:</span></dt><dd>the colorspace used in the source image (JPEG or YUV) associated
|
||||
with this decompressor instance.</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
with this decompressor instance.</dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="getJPEGBuf()">
|
||||
@@ -714,12 +704,9 @@ public void setJPEGImage(byte[] jpegImage,
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<h4>getJPEGBuf</h4>
|
||||
<pre>public byte[] getJPEGBuf()
|
||||
throws java.lang.Exception</pre>
|
||||
<pre>public byte[] getJPEGBuf()</pre>
|
||||
<div class="block">Returns the JPEG image buffer associated with this decompressor instance.</div>
|
||||
<dl><dt><span class="strong">Returns:</span></dt><dd>the JPEG image buffer associated with this decompressor instance.</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
<dl><dt><span class="strong">Returns:</span></dt><dd>the JPEG image buffer associated with this decompressor instance.</dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="getJPEGSize()">
|
||||
@@ -728,14 +715,11 @@ public void setJPEGImage(byte[] jpegImage,
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<h4>getJPEGSize</h4>
|
||||
<pre>public int getJPEGSize()
|
||||
throws java.lang.Exception</pre>
|
||||
<pre>public int getJPEGSize()</pre>
|
||||
<div class="block">Returns the size of the JPEG image (in bytes) associated with this
|
||||
decompressor instance.</div>
|
||||
<dl><dt><span class="strong">Returns:</span></dt><dd>the size of the JPEG image (in bytes) associated with this
|
||||
decompressor instance.</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
decompressor instance.</dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="getScaledWidth(int, int)">
|
||||
@@ -745,8 +729,7 @@ public void setJPEGImage(byte[] jpegImage,
|
||||
<li class="blockList">
|
||||
<h4>getScaledWidth</h4>
|
||||
<pre>public int getScaledWidth(int desiredWidth,
|
||||
int desiredHeight)
|
||||
throws java.lang.Exception</pre>
|
||||
int desiredHeight)</pre>
|
||||
<div class="block">Returns the width of the largest scaled-down image that the TurboJPEG
|
||||
decompressor can generate without exceeding the desired image width and
|
||||
height.</div>
|
||||
@@ -759,9 +742,7 @@ public void setJPEGImage(byte[] jpegImage,
|
||||
the scaled image size.)</dd>
|
||||
<dt><span class="strong">Returns:</span></dt><dd>the width of the largest scaled-down image that the TurboJPEG
|
||||
decompressor can generate without exceeding the desired image width and
|
||||
height.</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
height.</dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="getScaledHeight(int, int)">
|
||||
@@ -771,8 +752,7 @@ public void setJPEGImage(byte[] jpegImage,
|
||||
<li class="blockList">
|
||||
<h4>getScaledHeight</h4>
|
||||
<pre>public int getScaledHeight(int desiredWidth,
|
||||
int desiredHeight)
|
||||
throws java.lang.Exception</pre>
|
||||
int desiredHeight)</pre>
|
||||
<div class="block">Returns the height of the largest scaled-down image that the TurboJPEG
|
||||
decompressor can generate without exceeding the desired image width and
|
||||
height.</div>
|
||||
@@ -785,9 +765,7 @@ public void setJPEGImage(byte[] jpegImage,
|
||||
the scaled image size.)</dd>
|
||||
<dt><span class="strong">Returns:</span></dt><dd>the height of the largest scaled-down image that the TurboJPEG
|
||||
decompressor can generate without exceeding the desired image width and
|
||||
height.</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
height.</dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="decompress(byte[], int, int, int, int, int, int, int)">
|
||||
@@ -804,7 +782,7 @@ public void setJPEGImage(byte[] jpegImage,
|
||||
int desiredHeight,
|
||||
int pixelFormat,
|
||||
int flags)
|
||||
throws java.lang.Exception</pre>
|
||||
throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
|
||||
<div class="block">Decompress the JPEG source image or decode the YUV source image associated
|
||||
with this decompressor instance and output a grayscale, RGB, or CMYK image
|
||||
to the given destination buffer.</div>
|
||||
@@ -852,7 +830,7 @@ public void setJPEGImage(byte[] jpegImage,
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJ.html#PF_RGB"><code>TJ.PF_*</code></a>)</dd><dd><code>flags</code> - the bitwise OR of one or more of
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJ.html#FLAG_BOTTOMUP"><code>TJ.FLAG_*</code></a></dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="decompress(byte[], int, int, int, int, int)">
|
||||
@@ -868,11 +846,11 @@ public void decompress(byte[] dstBuf,
|
||||
int desiredHeight,
|
||||
int pixelFormat,
|
||||
int flags)
|
||||
throws java.lang.Exception</pre>
|
||||
throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
|
||||
<div class="block"><span class="strong">Deprecated.</span> <i>Use
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[],%20int,%20int,%20int,%20int,%20int,%20int,%20int)"><code>decompress(byte[], int, int, int, int, int, int, int)</code></a> instead.</i></div>
|
||||
<dl><dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="decompress(int, int, int, int, int)">
|
||||
@@ -886,7 +864,7 @@ public void decompress(byte[] dstBuf,
|
||||
int desiredHeight,
|
||||
int pixelFormat,
|
||||
int flags)
|
||||
throws java.lang.Exception</pre>
|
||||
throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
|
||||
<div class="block">Decompress the JPEG source image associated with this decompressor
|
||||
instance and return a buffer containing the decompressed image.</div>
|
||||
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>desiredWidth</code> - see
|
||||
@@ -900,7 +878,7 @@ public void decompress(byte[] dstBuf,
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJ.html#FLAG_BOTTOMUP"><code>TJ.FLAG_*</code></a></dd>
|
||||
<dt><span class="strong">Returns:</span></dt><dd>a buffer containing the decompressed image.</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="decompressToYUV(org.libjpegturbo.turbojpeg.YUVImage, int)">
|
||||
@@ -911,7 +889,7 @@ public void decompress(byte[] dstBuf,
|
||||
<h4>decompressToYUV</h4>
|
||||
<pre>public void decompressToYUV(<a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a> dstImage,
|
||||
int flags)
|
||||
throws java.lang.Exception</pre>
|
||||
throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
|
||||
<div class="block">Decompress the JPEG source image associated with this decompressor
|
||||
instance into a YUV planar image and store it in the given
|
||||
<code>YUVImage</code> instance. This method performs JPEG decompression
|
||||
@@ -926,7 +904,7 @@ public void decompress(byte[] dstBuf,
|
||||
source image.</dd><dd><code>flags</code> - the bitwise OR of one or more of
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJ.html#FLAG_BOTTOMUP"><code>TJ.FLAG_*</code></a></dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="decompressToYUV(byte[], int)">
|
||||
@@ -938,10 +916,10 @@ public void decompress(byte[] dstBuf,
|
||||
<pre>@Deprecated
|
||||
public void decompressToYUV(byte[] dstBuf,
|
||||
int flags)
|
||||
throws java.lang.Exception</pre>
|
||||
throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
|
||||
<div class="block"><span class="strong">Deprecated.</span> <i>Use <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(org.libjpegturbo.turbojpeg.YUVImage,%20int)"><code>decompressToYUV(YUVImage, int)</code></a> instead.</i></div>
|
||||
<dl><dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="decompressToYUV(int, int[], int, int)">
|
||||
@@ -954,7 +932,7 @@ public void decompressToYUV(byte[] dstBuf,
|
||||
int[] strides,
|
||||
int desiredHeight,
|
||||
int flags)
|
||||
throws java.lang.Exception</pre>
|
||||
throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
|
||||
<div class="block">Decompress the JPEG source image associated with this decompressor
|
||||
instance into a set of Y, U (Cb), and V (Cr) image planes and return a
|
||||
<code>YUVImage</code> instance containing the decompressed image planes.
|
||||
@@ -984,7 +962,7 @@ public void decompressToYUV(byte[] dstBuf,
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJ.html#FLAG_BOTTOMUP"><code>TJ.FLAG_*</code></a></dd>
|
||||
<dt><span class="strong">Returns:</span></dt><dd>a YUV planar image.</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="decompressToYUV(int, int, int, int)">
|
||||
@@ -997,7 +975,7 @@ public void decompressToYUV(byte[] dstBuf,
|
||||
int pad,
|
||||
int desiredHeight,
|
||||
int flags)
|
||||
throws java.lang.Exception</pre>
|
||||
throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
|
||||
<div class="block">Decompress the JPEG source image associated with this decompressor
|
||||
instance into a unified YUV planar image buffer and return a
|
||||
<code>YUVImage</code> instance containing the decompressed image. This
|
||||
@@ -1023,7 +1001,7 @@ public void decompressToYUV(byte[] dstBuf,
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJ.html#FLAG_BOTTOMUP"><code>TJ.FLAG_*</code></a></dd>
|
||||
<dt><span class="strong">Returns:</span></dt><dd>a YUV planar image.</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="decompressToYUV(int)">
|
||||
@@ -1034,10 +1012,10 @@ public void decompressToYUV(byte[] dstBuf,
|
||||
<h4>decompressToYUV</h4>
|
||||
<pre>@Deprecated
|
||||
public byte[] decompressToYUV(int flags)
|
||||
throws java.lang.Exception</pre>
|
||||
throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
|
||||
<div class="block"><span class="strong">Deprecated.</span> <i>Use <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(int,%20int,%20int,%20int)"><code>decompressToYUV(int, int, int, int)</code></a> instead.</i></div>
|
||||
<dl><dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="decompress(int[], int, int, int, int, int, int, int)">
|
||||
@@ -1054,7 +1032,7 @@ public byte[] decompressToYUV(int flags)
|
||||
int desiredHeight,
|
||||
int pixelFormat,
|
||||
int flags)
|
||||
throws java.lang.Exception</pre>
|
||||
throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
|
||||
<div class="block">Decompress the JPEG source image or decode the YUV source image associated
|
||||
with this decompressor instance and output a grayscale, RGB, or CMYK image
|
||||
to the given destination buffer.</div>
|
||||
@@ -1100,7 +1078,7 @@ public byte[] decompressToYUV(int flags)
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJ.html#PF_RGB"><code>TJ.PF_*</code></a>)</dd><dd><code>flags</code> - the bitwise OR of one or more of
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJ.html#FLAG_BOTTOMUP"><code>TJ.FLAG_*</code></a></dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="decompress(java.awt.image.BufferedImage, int)">
|
||||
@@ -1111,7 +1089,7 @@ public byte[] decompressToYUV(int flags)
|
||||
<h4>decompress</h4>
|
||||
<pre>public void decompress(java.awt.image.BufferedImage dstImage,
|
||||
int flags)
|
||||
throws java.lang.Exception</pre>
|
||||
throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
|
||||
<div class="block">Decompress the JPEG source image or decode the YUV source image associated
|
||||
with this decompressor instance and output a decompressed/decoded image to
|
||||
the given <code>BufferedImage</code> instance.</div>
|
||||
@@ -1124,7 +1102,7 @@ public byte[] decompressToYUV(int flags)
|
||||
height of the YUV image.</dd><dd><code>flags</code> - the bitwise OR of one or more of
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJ.html#FLAG_BOTTOMUP"><code>TJ.FLAG_*</code></a></dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="decompress(int, int, int, int)">
|
||||
@@ -1137,7 +1115,7 @@ public byte[] decompressToYUV(int flags)
|
||||
int desiredHeight,
|
||||
int bufferedImageType,
|
||||
int flags)
|
||||
throws java.lang.Exception</pre>
|
||||
throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
|
||||
<div class="block">Decompress the JPEG source image or decode the YUV source image associated
|
||||
with this decompressor instance and return a <code>BufferedImage</code>
|
||||
instance containing the decompressed/decoded image.</div>
|
||||
@@ -1152,7 +1130,7 @@ public byte[] decompressToYUV(int flags)
|
||||
<dt><span class="strong">Returns:</span></dt><dd>a <code>BufferedImage</code> instance containing the
|
||||
decompressed/decoded image.</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="close()">
|
||||
@@ -1162,10 +1140,15 @@ public byte[] decompressToYUV(int flags)
|
||||
<li class="blockList">
|
||||
<h4>close</h4>
|
||||
<pre>public void close()
|
||||
throws java.lang.Exception</pre>
|
||||
throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
|
||||
<div class="block">Free the native structures associated with this decompressor instance.</div>
|
||||
<dl><dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
<dl>
|
||||
<dt><strong>Specified by:</strong></dt>
|
||||
<dd><code>close</code> in interface <code>java.io.Closeable</code></dd>
|
||||
<dt><strong>Specified by:</strong></dt>
|
||||
<dd><code>close</code> in interface <code>java.lang.AutoCloseable</code></dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="finalize()">
|
||||
@@ -1208,7 +1191,7 @@ public byte[] decompressToYUV(int flags)
|
||||
<div class="subNav">
|
||||
<ul class="navList">
|
||||
<li><a href="../../../org/libjpegturbo/turbojpeg/TJCustomFilter.html" title="interface in org.libjpegturbo.turbojpeg"><span class="strong">Prev Class</span></a></li>
|
||||
<li><a href="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">Next Class</span></a></li>
|
||||
<li><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">Next Class</span></a></li>
|
||||
</ul>
|
||||
<ul class="navList">
|
||||
<li><a href="../../../index.html?org/libjpegturbo/turbojpeg/TJDecompressor.html" target="_top">Frames</a></li>
|
||||
|
||||
287
java/doc/org/libjpegturbo/turbojpeg/TJException.html
Normal file
287
java/doc/org/libjpegturbo/turbojpeg/TJException.html
Normal file
@@ -0,0 +1,287 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<!-- NewPage -->
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>TJException</title>
|
||||
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
|
||||
</head>
|
||||
<body>
|
||||
<script type="text/javascript"><!--
|
||||
if (location.href.indexOf('is-external=true') == -1) {
|
||||
parent.document.title="TJException";
|
||||
}
|
||||
//-->
|
||||
</script>
|
||||
<noscript>
|
||||
<div>JavaScript is disabled on your browser.</div>
|
||||
</noscript>
|
||||
<!-- ========= START OF TOP NAVBAR ======= -->
|
||||
<div class="topNav"><a name="navbar_top">
|
||||
<!-- -->
|
||||
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
|
||||
<!-- -->
|
||||
</a>
|
||||
<ul class="navList" title="Navigation">
|
||||
<li><a href="../../../org/libjpegturbo/turbojpeg/package-summary.html">Package</a></li>
|
||||
<li class="navBarCell1Rev">Class</li>
|
||||
<li><a href="package-tree.html">Tree</a></li>
|
||||
<li><a href="../../../deprecated-list.html">Deprecated</a></li>
|
||||
<li><a href="../../../index-all.html">Index</a></li>
|
||||
<li><a href="../../../help-doc.html">Help</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="subNav">
|
||||
<ul class="navList">
|
||||
<li><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">Prev Class</span></a></li>
|
||||
<li><a href="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">Next Class</span></a></li>
|
||||
</ul>
|
||||
<ul class="navList">
|
||||
<li><a href="../../../index.html?org/libjpegturbo/turbojpeg/TJException.html" target="_top">Frames</a></li>
|
||||
<li><a href="TJException.html" target="_top">No Frames</a></li>
|
||||
</ul>
|
||||
<ul class="navList" id="allclasses_navbar_top">
|
||||
<li><a href="../../../allclasses-noframe.html">All Classes</a></li>
|
||||
</ul>
|
||||
<div>
|
||||
<script type="text/javascript"><!--
|
||||
allClassesLink = document.getElementById("allclasses_navbar_top");
|
||||
if(window==top) {
|
||||
allClassesLink.style.display = "block";
|
||||
}
|
||||
else {
|
||||
allClassesLink.style.display = "none";
|
||||
}
|
||||
//-->
|
||||
</script>
|
||||
</div>
|
||||
<div>
|
||||
<ul class="subNavList">
|
||||
<li>Summary: </li>
|
||||
<li>Nested | </li>
|
||||
<li>Field | </li>
|
||||
<li><a href="#constructor_summary">Constr</a> | </li>
|
||||
<li><a href="#methods_inherited_from_class_java.lang.Throwable">Method</a></li>
|
||||
</ul>
|
||||
<ul class="subNavList">
|
||||
<li>Detail: </li>
|
||||
<li>Field | </li>
|
||||
<li><a href="#constructor_detail">Constr</a> | </li>
|
||||
<li>Method</li>
|
||||
</ul>
|
||||
</div>
|
||||
<a name="skip-navbar_top">
|
||||
<!-- -->
|
||||
</a></div>
|
||||
<!-- ========= END OF TOP NAVBAR ========= -->
|
||||
<!-- ======== START OF CLASS DATA ======== -->
|
||||
<div class="header">
|
||||
<div class="subTitle">org.libjpegturbo.turbojpeg</div>
|
||||
<h2 title="Class TJException" class="title">Class TJException</h2>
|
||||
</div>
|
||||
<div class="contentContainer">
|
||||
<ul class="inheritance">
|
||||
<li>java.lang.Object</li>
|
||||
<li>
|
||||
<ul class="inheritance">
|
||||
<li>java.lang.Throwable</li>
|
||||
<li>
|
||||
<ul class="inheritance">
|
||||
<li>java.lang.Exception</li>
|
||||
<li>
|
||||
<ul class="inheritance">
|
||||
<li>java.io.IOException</li>
|
||||
<li>
|
||||
<ul class="inheritance">
|
||||
<li>org.libjpegturbo.turbojpeg.TJException</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="description">
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<dl>
|
||||
<dt>All Implemented Interfaces:</dt>
|
||||
<dd>java.io.Serializable</dd>
|
||||
</dl>
|
||||
<hr>
|
||||
<br>
|
||||
<pre>public class <span class="strong">TJException</span>
|
||||
extends java.io.IOException</pre>
|
||||
<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../serialized-form.html#org.libjpegturbo.turbojpeg.TJException">Serialized Form</a></dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="summary">
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
|
||||
<ul class="blockList">
|
||||
<li class="blockList"><a name="constructor_summary">
|
||||
<!-- -->
|
||||
</a>
|
||||
<h3>Constructor Summary</h3>
|
||||
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
|
||||
<caption><span>Constructors</span><span class="tabEnd"> </span></caption>
|
||||
<tr>
|
||||
<th class="colOne" scope="col">Constructor and Description</th>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colOne"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJException.html#TJException()">TJException</a></strong>()</code> </td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colOne"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJException.html#TJException(java.lang.String)">TJException</a></strong>(java.lang.String message)</code> </td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colOne"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJException.html#TJException(java.lang.String,%20java.lang.Throwable)">TJException</a></strong>(java.lang.String message,
|
||||
java.lang.Throwable cause)</code> </td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colOne"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJException.html#TJException(java.lang.Throwable)">TJException</a></strong>(java.lang.Throwable cause)</code> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</li>
|
||||
</ul>
|
||||
<!-- ========== METHOD SUMMARY =========== -->
|
||||
<ul class="blockList">
|
||||
<li class="blockList"><a name="method_summary">
|
||||
<!-- -->
|
||||
</a>
|
||||
<h3>Method Summary</h3>
|
||||
<ul class="blockList">
|
||||
<li class="blockList"><a name="methods_inherited_from_class_java.lang.Throwable">
|
||||
<!-- -->
|
||||
</a>
|
||||
<h3>Methods inherited from class java.lang.Throwable</h3>
|
||||
<code>addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString</code></li>
|
||||
</ul>
|
||||
<ul class="blockList">
|
||||
<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
|
||||
<!-- -->
|
||||
</a>
|
||||
<h3>Methods inherited from class java.lang.Object</h3>
|
||||
<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait</code></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="details">
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<!-- ========= CONSTRUCTOR DETAIL ======== -->
|
||||
<ul class="blockList">
|
||||
<li class="blockList"><a name="constructor_detail">
|
||||
<!-- -->
|
||||
</a>
|
||||
<h3>Constructor Detail</h3>
|
||||
<a name="TJException()">
|
||||
<!-- -->
|
||||
</a>
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<h4>TJException</h4>
|
||||
<pre>public TJException()</pre>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="TJException(java.lang.String, java.lang.Throwable)">
|
||||
<!-- -->
|
||||
</a>
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<h4>TJException</h4>
|
||||
<pre>public TJException(java.lang.String message,
|
||||
java.lang.Throwable cause)</pre>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="TJException(java.lang.String)">
|
||||
<!-- -->
|
||||
</a>
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<h4>TJException</h4>
|
||||
<pre>public TJException(java.lang.String message)</pre>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="TJException(java.lang.Throwable)">
|
||||
<!-- -->
|
||||
</a>
|
||||
<ul class="blockListLast">
|
||||
<li class="blockList">
|
||||
<h4>TJException</h4>
|
||||
<pre>public TJException(java.lang.Throwable cause)</pre>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<!-- ========= END OF CLASS DATA ========= -->
|
||||
<!-- ======= START OF BOTTOM NAVBAR ====== -->
|
||||
<div class="bottomNav"><a name="navbar_bottom">
|
||||
<!-- -->
|
||||
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
|
||||
<!-- -->
|
||||
</a>
|
||||
<ul class="navList" title="Navigation">
|
||||
<li><a href="../../../org/libjpegturbo/turbojpeg/package-summary.html">Package</a></li>
|
||||
<li class="navBarCell1Rev">Class</li>
|
||||
<li><a href="package-tree.html">Tree</a></li>
|
||||
<li><a href="../../../deprecated-list.html">Deprecated</a></li>
|
||||
<li><a href="../../../index-all.html">Index</a></li>
|
||||
<li><a href="../../../help-doc.html">Help</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="subNav">
|
||||
<ul class="navList">
|
||||
<li><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">Prev Class</span></a></li>
|
||||
<li><a href="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">Next Class</span></a></li>
|
||||
</ul>
|
||||
<ul class="navList">
|
||||
<li><a href="../../../index.html?org/libjpegturbo/turbojpeg/TJException.html" target="_top">Frames</a></li>
|
||||
<li><a href="TJException.html" target="_top">No Frames</a></li>
|
||||
</ul>
|
||||
<ul class="navList" id="allclasses_navbar_bottom">
|
||||
<li><a href="../../../allclasses-noframe.html">All Classes</a></li>
|
||||
</ul>
|
||||
<div>
|
||||
<script type="text/javascript"><!--
|
||||
allClassesLink = document.getElementById("allclasses_navbar_bottom");
|
||||
if(window==top) {
|
||||
allClassesLink.style.display = "block";
|
||||
}
|
||||
else {
|
||||
allClassesLink.style.display = "none";
|
||||
}
|
||||
//-->
|
||||
</script>
|
||||
</div>
|
||||
<div>
|
||||
<ul class="subNavList">
|
||||
<li>Summary: </li>
|
||||
<li>Nested | </li>
|
||||
<li>Field | </li>
|
||||
<li><a href="#constructor_summary">Constr</a> | </li>
|
||||
<li><a href="#methods_inherited_from_class_java.lang.Throwable">Method</a></li>
|
||||
</ul>
|
||||
<ul class="subNavList">
|
||||
<li>Detail: </li>
|
||||
<li>Field | </li>
|
||||
<li><a href="#constructor_detail">Constr</a> | </li>
|
||||
<li>Method</li>
|
||||
</ul>
|
||||
</div>
|
||||
<a name="skip-navbar_bottom">
|
||||
<!-- -->
|
||||
</a></div>
|
||||
<!-- ======== END OF BOTTOM NAVBAR ======= -->
|
||||
</body>
|
||||
</html>
|
||||
@@ -32,7 +32,7 @@
|
||||
</div>
|
||||
<div class="subNav">
|
||||
<ul class="navList">
|
||||
<li><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">Prev Class</span></a></li>
|
||||
<li><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">Prev Class</span></a></li>
|
||||
<li><a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">Next Class</span></a></li>
|
||||
</ul>
|
||||
<ul class="navList">
|
||||
@@ -192,10 +192,7 @@ extends java.lang.Object</pre>
|
||||
<li class="blockList">
|
||||
<h4>TJScalingFactor</h4>
|
||||
<pre>public TJScalingFactor(int num,
|
||||
int denom)
|
||||
throws java.lang.Exception</pre>
|
||||
<dl><dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
int denom)</pre>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
@@ -291,7 +288,7 @@ extends java.lang.Object</pre>
|
||||
</div>
|
||||
<div class="subNav">
|
||||
<ul class="navList">
|
||||
<li><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">Prev Class</span></a></li>
|
||||
<li><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">Prev Class</span></a></li>
|
||||
<li><a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">Next Class</span></a></li>
|
||||
</ul>
|
||||
<ul class="navList">
|
||||
|
||||
@@ -608,8 +608,7 @@ extends java.awt.Rectangle</pre>
|
||||
int h,
|
||||
int op,
|
||||
int options,
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJCustomFilter.html" title="interface in org.libjpegturbo.turbojpeg">TJCustomFilter</a> cf)
|
||||
throws java.lang.Exception</pre>
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJCustomFilter.html" title="interface in org.libjpegturbo.turbojpeg">TJCustomFilter</a> cf)</pre>
|
||||
<div class="block">Create a new lossless transform instance with the given parameters.</div>
|
||||
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - the left boundary of the cropping region. This must be evenly
|
||||
divisible by the MCU block width (see <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#getMCUWidth(int)"><code>TJ.getMCUWidth(int)</code></a>)</dd><dd><code>y</code> - the upper boundary of the cropping region. This must be evenly
|
||||
@@ -618,9 +617,7 @@ extends java.awt.Rectangle</pre>
|
||||
<code>x</code>).</dd><dd><code>h</code> - the height of the cropping region. Setting this to 0 is the
|
||||
equivalent of setting it to (height of the source JPEG image -
|
||||
<code>y</code>).</dd><dd><code>op</code> - one of the transform operations (<code>OP_*</code>)</dd><dd><code>options</code> - the bitwise OR of one or more of the transform options
|
||||
(<code>OPT_*</code>)</dd><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</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
(<code>OPT_*</code>)</dd><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</dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="TJTransform(java.awt.Rectangle, int, int, org.libjpegturbo.turbojpeg.TJCustomFilter)">
|
||||
@@ -632,15 +629,12 @@ extends java.awt.Rectangle</pre>
|
||||
<pre>public TJTransform(java.awt.Rectangle r,
|
||||
int op,
|
||||
int options,
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJCustomFilter.html" title="interface in org.libjpegturbo.turbojpeg">TJCustomFilter</a> cf)
|
||||
throws java.lang.Exception</pre>
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJCustomFilter.html" title="interface in org.libjpegturbo.turbojpeg">TJCustomFilter</a> cf)</pre>
|
||||
<div class="block">Create a new lossless transform instance with the given parameters.</div>
|
||||
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>r</code> - a <code>Rectangle</code> instance that specifies the cropping
|
||||
region. See <a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html#TJTransform(int,%20int,%20int,%20int,%20int,%20int,%20org.libjpegturbo.turbojpeg.TJCustomFilter)"><code>TJTransform(int, int, int, int, int, int, TJCustomFilter)</code></a> for more
|
||||
detail.</dd><dd><code>op</code> - one of the transform operations (<code>OP_*</code>)</dd><dd><code>options</code> - the bitwise OR of one or more of the transform options
|
||||
(<code>OPT_*</code>)</dd><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</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
(<code>OPT_*</code>)</dd><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</dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
@@ -95,6 +95,10 @@
|
||||
<div class="description">
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<dl>
|
||||
<dt>All Implemented Interfaces:</dt>
|
||||
<dd>java.io.Closeable, java.lang.AutoCloseable</dd>
|
||||
</dl>
|
||||
<hr>
|
||||
<br>
|
||||
<pre>public class <span class="strong">TJTransformer</span>
|
||||
@@ -228,10 +232,10 @@ extends <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title=
|
||||
<li class="blockList">
|
||||
<h4>TJTransformer</h4>
|
||||
<pre>public TJTransformer()
|
||||
throws java.lang.Exception</pre>
|
||||
throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
|
||||
<div class="block">Create a TurboJPEG lossless transformer instance.</div>
|
||||
<dl><dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="TJTransformer(byte[])">
|
||||
@@ -241,13 +245,13 @@ extends <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title=
|
||||
<li class="blockList">
|
||||
<h4>TJTransformer</h4>
|
||||
<pre>public TJTransformer(byte[] jpegImage)
|
||||
throws java.lang.Exception</pre>
|
||||
throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
|
||||
<div class="block">Create a TurboJPEG lossless transformer instance and associate the JPEG
|
||||
image stored in <code>jpegImage</code> with the newly created instance.</div>
|
||||
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>jpegImage</code> - JPEG image buffer (size of the JPEG image is assumed to
|
||||
be the length of the array)</dd>
|
||||
be the length of the array.) This buffer is not modified.</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="TJTransformer(byte[], int)">
|
||||
@@ -258,13 +262,13 @@ extends <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title=
|
||||
<h4>TJTransformer</h4>
|
||||
<pre>public TJTransformer(byte[] jpegImage,
|
||||
int imageSize)
|
||||
throws java.lang.Exception</pre>
|
||||
throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
|
||||
<div class="block">Create a TurboJPEG lossless transformer instance and associate the JPEG
|
||||
image of length <code>imageSize</code> bytes stored in
|
||||
<code>jpegImage</code> with the newly created instance.</div>
|
||||
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>jpegImage</code> - JPEG image buffer</dd><dd><code>imageSize</code> - size of the JPEG image (in bytes)</dd>
|
||||
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>jpegImage</code> - JPEG image buffer. This buffer is not modified.</dd><dd><code>imageSize</code> - size of the JPEG image (in bytes)</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
@@ -284,7 +288,7 @@ extends <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title=
|
||||
<pre>public void transform(byte[][] dstBufs,
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</a>[] transforms,
|
||||
int flags)
|
||||
throws java.lang.Exception</pre>
|
||||
throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
|
||||
<div class="block">Losslessly transform the JPEG image associated with this transformer
|
||||
instance into one or more JPEG images stored in the given destination
|
||||
buffers. Lossless transforms work by moving the raw coefficients from one
|
||||
@@ -306,7 +310,7 @@ extends <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title=
|
||||
corresponding transformed output image</dd><dd><code>flags</code> - the bitwise OR of one or more of
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJ.html#FLAG_BOTTOMUP"><code>TJ.FLAG_*</code></a></dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="transform(org.libjpegturbo.turbojpeg.TJTransform[], int)">
|
||||
@@ -317,7 +321,7 @@ extends <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title=
|
||||
<h4>transform</h4>
|
||||
<pre>public <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a>[] transform(<a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</a>[] transforms,
|
||||
int flags)
|
||||
throws java.lang.Exception</pre>
|
||||
throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
|
||||
<div class="block">Losslessly transform the JPEG image associated with this transformer
|
||||
instance and return an array of <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg"><code>TJDecompressor</code></a> instances, each of
|
||||
which has a transformed JPEG image associated with it.</div>
|
||||
@@ -328,7 +332,7 @@ extends <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title=
|
||||
<dt><span class="strong">Returns:</span></dt><dd>an array of <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg"><code>TJDecompressor</code></a> instances, each of
|
||||
which has a transformed JPEG image associated with it.</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="getTransformedSizes()">
|
||||
@@ -337,14 +341,11 @@ extends <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title=
|
||||
<ul class="blockListLast">
|
||||
<li class="blockList">
|
||||
<h4>getTransformedSizes</h4>
|
||||
<pre>public int[] getTransformedSizes()
|
||||
throws java.lang.Exception</pre>
|
||||
<pre>public int[] getTransformedSizes()</pre>
|
||||
<div class="block">Returns an array containing the sizes of the transformed JPEG images
|
||||
generated by the most recent transform operation.</div>
|
||||
<dl><dt><span class="strong">Returns:</span></dt><dd>an array containing the sizes of the transformed JPEG images
|
||||
generated by the most recent transform operation.</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
generated by the most recent transform operation.</dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
@@ -434,8 +434,7 @@ extends java.lang.Object</pre>
|
||||
<pre>public YUVImage(int width,
|
||||
int[] strides,
|
||||
int height,
|
||||
int subsamp)
|
||||
throws java.lang.Exception</pre>
|
||||
int subsamp)</pre>
|
||||
<div class="block">Create a new <code>YUVImage</code> instance backed by separate image
|
||||
planes, and allocate memory for the image planes.</div>
|
||||
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>width</code> - width (in pixels) of the YUV image</dd><dd><code>strides</code> - an array of integers, each specifying the number of bytes
|
||||
@@ -445,9 +444,7 @@ extends java.lang.Object</pre>
|
||||
strides for all planes will be set to their respective plane widths. When
|
||||
using this constructor, the stride for each plane must be equal to or
|
||||
greater than the plane width.</dd><dd><code>height</code> - height (in pixels) of the YUV image</dd><dd><code>subsamp</code> - the level of chrominance subsampling to be used in the YUV
|
||||
image (one of <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#SAMP_444"><code>TJ.SAMP_*</code></a>)</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
image (one of <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#SAMP_444"><code>TJ.SAMP_*</code></a>)</dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="YUVImage(int, int, int, int)">
|
||||
@@ -459,15 +456,12 @@ extends java.lang.Object</pre>
|
||||
<pre>public YUVImage(int width,
|
||||
int pad,
|
||||
int height,
|
||||
int subsamp)
|
||||
throws java.lang.Exception</pre>
|
||||
int subsamp)</pre>
|
||||
<div class="block">Create a new <code>YUVImage</code> instance backed by a unified image
|
||||
buffer, and allocate memory for the image buffer.</div>
|
||||
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>width</code> - width (in pixels) of the YUV image</dd><dd><code>pad</code> - Each line of each plane in the YUV image buffer will be padded
|
||||
to this number of bytes (must be a power of 2.)</dd><dd><code>height</code> - height (in pixels) of the YUV image</dd><dd><code>subsamp</code> - the level of chrominance subsampling to be used in the YUV
|
||||
image (one of <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#SAMP_444"><code>TJ.SAMP_*</code></a>)</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
image (one of <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#SAMP_444"><code>TJ.SAMP_*</code></a>)</dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="YUVImage(byte[][], int[], int, int[], int, int)">
|
||||
@@ -481,8 +475,7 @@ extends java.lang.Object</pre>
|
||||
int width,
|
||||
int[] strides,
|
||||
int height,
|
||||
int subsamp)
|
||||
throws java.lang.Exception</pre>
|
||||
int subsamp)</pre>
|
||||
<div class="block">Create a new <code>YUVImage</code> instance from a set of existing image
|
||||
planes.</div>
|
||||
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>planes</code> - an array of buffers representing the Y, U (Cb), and V (Cr)
|
||||
@@ -503,9 +496,7 @@ extends java.lang.Object</pre>
|
||||
to each plane or to specify that this <code>YUVImage</code> instance is a
|
||||
subregion of a larger image (in which case, <code>strides[i]</code> should
|
||||
be set to the plane width of plane <code>i</code> in the larger image.)</dd><dd><code>height</code> - height (in pixels) of the new YUV image (or subregion)</dd><dd><code>subsamp</code> - the level of chrominance subsampling used in the YUV
|
||||
image (one of <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#SAMP_444"><code>TJ.SAMP_*</code></a>)</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
image (one of <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#SAMP_444"><code>TJ.SAMP_*</code></a>)</dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="YUVImage(byte[], int, int, int, int)">
|
||||
@@ -518,8 +509,7 @@ extends java.lang.Object</pre>
|
||||
int width,
|
||||
int pad,
|
||||
int height,
|
||||
int subsamp)
|
||||
throws java.lang.Exception</pre>
|
||||
int subsamp)</pre>
|
||||
<div class="block">Create a new <code>YUVImage</code> instance from an existing unified image
|
||||
buffer.</div>
|
||||
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>yuvImage</code> - image buffer that contains or will contain YUV planar
|
||||
@@ -529,9 +519,7 @@ extends java.lang.Object</pre>
|
||||
of the image format.)</dd><dd><code>width</code> - width (in pixels) of the YUV image</dd><dd><code>pad</code> - the line padding used in the YUV image buffer. For
|
||||
instance, if each line in each plane of the buffer is padded to the
|
||||
nearest multiple of 4 bytes, then <code>pad</code> should be set to 4.</dd><dd><code>height</code> - height (in pixels) of the YUV image</dd><dd><code>subsamp</code> - the level of chrominance subsampling used in the YUV
|
||||
image (one of <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#SAMP_444"><code>TJ.SAMP_*</code></a>)</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
image (one of <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#SAMP_444"><code>TJ.SAMP_*</code></a>)</dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
@@ -553,8 +541,7 @@ extends java.lang.Object</pre>
|
||||
int width,
|
||||
int[] strides,
|
||||
int height,
|
||||
int subsamp)
|
||||
throws java.lang.Exception</pre>
|
||||
int subsamp)</pre>
|
||||
<div class="block">Assign a set of image planes to this <code>YUVImage</code> instance.</div>
|
||||
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>planes</code> - an array of buffers representing the Y, U (Cb), and V (Cr)
|
||||
image planes (or just the Y plane, if the image is grayscale.) These
|
||||
@@ -574,9 +561,7 @@ extends java.lang.Object</pre>
|
||||
to each plane or to specify that this <code>YUVImage</code> image is a
|
||||
subregion of a larger image (in which case, <code>strides[i]</code> should
|
||||
be set to the plane width of plane <code>i</code> in the larger image.)</dd><dd><code>height</code> - height (in pixels) of the YUV image (or subregion)</dd><dd><code>subsamp</code> - the level of chrominance subsampling used in the YUV
|
||||
image (one of <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#SAMP_444"><code>TJ.SAMP_*</code></a>)</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
image (one of <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#SAMP_444"><code>TJ.SAMP_*</code></a>)</dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="setBuf(byte[], int, int, int, int)">
|
||||
@@ -589,8 +574,7 @@ extends java.lang.Object</pre>
|
||||
int width,
|
||||
int pad,
|
||||
int height,
|
||||
int subsamp)
|
||||
throws java.lang.Exception</pre>
|
||||
int subsamp)</pre>
|
||||
<div class="block">Assign a unified image buffer to this <code>YUVImage</code> instance.</div>
|
||||
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>yuvImage</code> - image buffer that contains or will contain YUV planar
|
||||
image data. Use <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#bufSizeYUV(int,%20int,%20int,%20int)"><code>TJ.bufSizeYUV(int, int, int, int)</code></a> to determine the minimum size for
|
||||
@@ -599,9 +583,7 @@ extends java.lang.Object</pre>
|
||||
of the image format.)</dd><dd><code>width</code> - width (in pixels) of the YUV image</dd><dd><code>pad</code> - the line padding used in the YUV image buffer. For
|
||||
instance, if each line in each plane of the buffer is padded to the
|
||||
nearest multiple of 4 bytes, then <code>pad</code> should be set to 4.</dd><dd><code>height</code> - height (in pixels) of the YUV image</dd><dd><code>subsamp</code> - the level of chrominance subsampling used in the YUV
|
||||
image (one of <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#SAMP_444"><code>TJ.SAMP_*</code></a>)</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
image (one of <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#SAMP_444"><code>TJ.SAMP_*</code></a>)</dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="getWidth()">
|
||||
@@ -610,12 +592,9 @@ extends java.lang.Object</pre>
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<h4>getWidth</h4>
|
||||
<pre>public int getWidth()
|
||||
throws java.lang.Exception</pre>
|
||||
<pre>public int getWidth()</pre>
|
||||
<div class="block">Returns the width of the YUV image (or subregion.)</div>
|
||||
<dl><dt><span class="strong">Returns:</span></dt><dd>the width of the YUV image (or subregion)</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
<dl><dt><span class="strong">Returns:</span></dt><dd>the width of the YUV image (or subregion)</dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="getHeight()">
|
||||
@@ -624,12 +603,9 @@ extends java.lang.Object</pre>
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<h4>getHeight</h4>
|
||||
<pre>public int getHeight()
|
||||
throws java.lang.Exception</pre>
|
||||
<pre>public int getHeight()</pre>
|
||||
<div class="block">Returns the height of the YUV image (or subregion.)</div>
|
||||
<dl><dt><span class="strong">Returns:</span></dt><dd>the height of the YUV image (or subregion)</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
<dl><dt><span class="strong">Returns:</span></dt><dd>the height of the YUV image (or subregion)</dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="getPad()">
|
||||
@@ -638,13 +614,10 @@ extends java.lang.Object</pre>
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<h4>getPad</h4>
|
||||
<pre>public int getPad()
|
||||
throws java.lang.Exception</pre>
|
||||
<pre>public int getPad()</pre>
|
||||
<div class="block">Returns the line padding used in the YUV image buffer (if this image is
|
||||
stored in a unified buffer rather than separate image planes.)</div>
|
||||
<dl><dt><span class="strong">Returns:</span></dt><dd>the line padding used in the YUV image buffer</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
<dl><dt><span class="strong">Returns:</span></dt><dd>the line padding used in the YUV image buffer</dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="getStrides()">
|
||||
@@ -653,12 +626,9 @@ extends java.lang.Object</pre>
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<h4>getStrides</h4>
|
||||
<pre>public int[] getStrides()
|
||||
throws java.lang.Exception</pre>
|
||||
<pre>public int[] getStrides()</pre>
|
||||
<div class="block">Returns the number of bytes per line of each plane in the YUV image.</div>
|
||||
<dl><dt><span class="strong">Returns:</span></dt><dd>the number of bytes per line of each plane in the YUV image</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
<dl><dt><span class="strong">Returns:</span></dt><dd>the number of bytes per line of each plane in the YUV image</dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="getOffsets()">
|
||||
@@ -667,14 +637,11 @@ extends java.lang.Object</pre>
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<h4>getOffsets</h4>
|
||||
<pre>public int[] getOffsets()
|
||||
throws java.lang.Exception</pre>
|
||||
<pre>public int[] getOffsets()</pre>
|
||||
<div class="block">Returns the offsets (in bytes) of each plane within the planes of a larger
|
||||
YUV image.</div>
|
||||
<dl><dt><span class="strong">Returns:</span></dt><dd>the offsets (in bytes) of each plane within the planes of a larger
|
||||
YUV image</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
YUV image</dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="getSubsamp()">
|
||||
@@ -683,13 +650,10 @@ extends java.lang.Object</pre>
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<h4>getSubsamp</h4>
|
||||
<pre>public int getSubsamp()
|
||||
throws java.lang.Exception</pre>
|
||||
<pre>public int getSubsamp()</pre>
|
||||
<div class="block">Returns the level of chrominance subsampling used in the YUV image. See
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJ.html#SAMP_444"><code>TJ.SAMP_*</code></a>.</div>
|
||||
<dl><dt><span class="strong">Returns:</span></dt><dd>the level of chrominance subsampling used in the YUV image</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
<dl><dt><span class="strong">Returns:</span></dt><dd>the level of chrominance subsampling used in the YUV image</dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="getPlanes()">
|
||||
@@ -698,13 +662,10 @@ extends java.lang.Object</pre>
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<h4>getPlanes</h4>
|
||||
<pre>public byte[][] getPlanes()
|
||||
throws java.lang.Exception</pre>
|
||||
<pre>public byte[][] getPlanes()</pre>
|
||||
<div class="block">Returns the YUV image planes. If the image is stored in a unified buffer,
|
||||
then all image planes will point to that buffer.</div>
|
||||
<dl><dt><span class="strong">Returns:</span></dt><dd>the YUV image planes</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
<dl><dt><span class="strong">Returns:</span></dt><dd>the YUV image planes</dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="getBuf()">
|
||||
@@ -713,13 +674,10 @@ extends java.lang.Object</pre>
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<h4>getBuf</h4>
|
||||
<pre>public byte[] getBuf()
|
||||
throws java.lang.Exception</pre>
|
||||
<pre>public byte[] getBuf()</pre>
|
||||
<div class="block">Returns the YUV image buffer (if this image is stored in a unified
|
||||
buffer rather than separate image planes.)</div>
|
||||
<dl><dt><span class="strong">Returns:</span></dt><dd>the YUV image buffer</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
<dl><dt><span class="strong">Returns:</span></dt><dd>the YUV image buffer</dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="getSize()">
|
||||
@@ -728,13 +686,10 @@ extends java.lang.Object</pre>
|
||||
<ul class="blockListLast">
|
||||
<li class="blockList">
|
||||
<h4>getSize</h4>
|
||||
<pre>public int getSize()
|
||||
throws java.lang.Exception</pre>
|
||||
<pre>public int getSize()</pre>
|
||||
<div class="block">Returns the size (in bytes) of the YUV image buffer (if this image is
|
||||
stored in a unified buffer rather than separate image planes.)</div>
|
||||
<dl><dt><span class="strong">Returns:</span></dt><dd>the size (in bytes) of the YUV image buffer</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
<dl><dt><span class="strong">Returns:</span></dt><dd>the size (in bytes) of the YUV image buffer</dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
@@ -22,6 +22,10 @@
|
||||
<li><a href="TJTransformer.html" title="class in org.libjpegturbo.turbojpeg" target="classFrame">TJTransformer</a></li>
|
||||
<li><a href="YUVImage.html" title="class in org.libjpegturbo.turbojpeg" target="classFrame">YUVImage</a></li>
|
||||
</ul>
|
||||
<h2 title="Exceptions">Exceptions</h2>
|
||||
<ul title="Exceptions">
|
||||
<li><a href="TJException.html" title="class in org.libjpegturbo.turbojpeg" target="classFrame">TJException</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -134,6 +134,21 @@
|
||||
</tbody>
|
||||
</table>
|
||||
</li>
|
||||
<li class="blockList">
|
||||
<table class="packageSummary" border="0" cellpadding="3" cellspacing="0" summary="Exception Summary table, listing exceptions, and an explanation">
|
||||
<caption><span>Exception Summary</span><span class="tabEnd"> </span></caption>
|
||||
<tr>
|
||||
<th class="colFirst" scope="col">Exception</th>
|
||||
<th class="colLast" scope="col">Description</th>
|
||||
</tr>
|
||||
<tbody>
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></td>
|
||||
<td class="colLast"> </td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<!-- ======= START OF BOTTOM NAVBAR ====== -->
|
||||
|
||||
@@ -79,9 +79,22 @@
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li type="circle">java.lang.Throwable (implements java.io.Serializable)
|
||||
<ul>
|
||||
<li type="circle">java.lang.Exception
|
||||
<ul>
|
||||
<li type="circle">java.io.IOException
|
||||
<ul>
|
||||
<li type="circle">org.libjpegturbo.turbojpeg.<a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">TJException</span></a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li type="circle">org.libjpegturbo.turbojpeg.<a href="../../../org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">TJ</span></a></li>
|
||||
<li type="circle">org.libjpegturbo.turbojpeg.<a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">TJCompressor</span></a></li>
|
||||
<li type="circle">org.libjpegturbo.turbojpeg.<a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">TJDecompressor</span></a>
|
||||
<li type="circle">org.libjpegturbo.turbojpeg.<a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">TJCompressor</span></a> (implements java.io.Closeable)</li>
|
||||
<li type="circle">org.libjpegturbo.turbojpeg.<a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">TJDecompressor</span></a> (implements java.io.Closeable)
|
||||
<ul>
|
||||
<li type="circle">org.libjpegturbo.turbojpeg.<a href="../../../org/libjpegturbo/turbojpeg/TJTransformer.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">TJTransformer</span></a></li>
|
||||
</ul>
|
||||
|
||||
@@ -83,9 +83,22 @@
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li type="circle">java.lang.Throwable (implements java.io.Serializable)
|
||||
<ul>
|
||||
<li type="circle">java.lang.Exception
|
||||
<ul>
|
||||
<li type="circle">java.io.IOException
|
||||
<ul>
|
||||
<li type="circle">org.libjpegturbo.turbojpeg.<a href="org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">TJException</span></a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li type="circle">org.libjpegturbo.turbojpeg.<a href="org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">TJ</span></a></li>
|
||||
<li type="circle">org.libjpegturbo.turbojpeg.<a href="org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">TJCompressor</span></a></li>
|
||||
<li type="circle">org.libjpegturbo.turbojpeg.<a href="org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">TJDecompressor</span></a>
|
||||
<li type="circle">org.libjpegturbo.turbojpeg.<a href="org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">TJCompressor</span></a> (implements java.io.Closeable)</li>
|
||||
<li type="circle">org.libjpegturbo.turbojpeg.<a href="org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">TJDecompressor</span></a> (implements java.io.Closeable)
|
||||
<ul>
|
||||
<li type="circle">org.libjpegturbo.turbojpeg.<a href="org/libjpegturbo/turbojpeg/TJTransformer.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">TJTransformer</span></a></li>
|
||||
</ul>
|
||||
|
||||
@@ -66,6 +66,15 @@
|
||||
<li class="blockList">
|
||||
<h2 title="Package">Package org.libjpegturbo.turbojpeg</h2>
|
||||
<ul class="blockList">
|
||||
<li class="blockList"><a name="org.libjpegturbo.turbojpeg.TJException">
|
||||
<!-- -->
|
||||
</a>
|
||||
<h3>Class <a href="org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">org.libjpegturbo.turbojpeg.TJException</a> extends java.io.IOException implements Serializable</h3>
|
||||
<dl class="nameValue">
|
||||
<dt>serialVersionUID:</dt>
|
||||
<dd>1L</dd>
|
||||
</dl>
|
||||
</li>
|
||||
<li class="blockList"><a name="org.libjpegturbo.turbojpeg.TJTransform">
|
||||
<!-- -->
|
||||
</a>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (C)2011-2013 D. R. Commander. All Rights Reserved.
|
||||
* Copyright (C)2015 Viktor Szathmáry. All Rights Reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
@@ -87,9 +88,8 @@ public final class TJ {
|
||||
* @return the MCU block width for the given level of chrominance
|
||||
* subsampling.
|
||||
*/
|
||||
public static int getMCUWidth(int subsamp) throws Exception {
|
||||
if (subsamp < 0 || subsamp >= NUMSAMP)
|
||||
throw new Exception("Invalid subsampling type");
|
||||
public static int getMCUWidth(int subsamp) {
|
||||
checkSubsampling(subsamp);
|
||||
return mcuWidth[subsamp];
|
||||
}
|
||||
|
||||
@@ -108,9 +108,8 @@ public final class TJ {
|
||||
* @return the MCU block height for the given level of chrominance
|
||||
* subsampling.
|
||||
*/
|
||||
public static int getMCUHeight(int subsamp) throws Exception {
|
||||
if (subsamp < 0 || subsamp >= NUMSAMP)
|
||||
throw new Exception("Invalid subsampling type");
|
||||
public static int getMCUHeight(int subsamp) {
|
||||
checkSubsampling(subsamp);
|
||||
return mcuHeight[subsamp];
|
||||
}
|
||||
|
||||
@@ -217,9 +216,8 @@ public final class TJ {
|
||||
*
|
||||
* @return the pixel size (in bytes) for the given pixel format.
|
||||
*/
|
||||
public static int getPixelSize(int pixelFormat) throws Exception {
|
||||
if (pixelFormat < 0 || pixelFormat >= NUMPF)
|
||||
throw new Exception("Invalid pixel format");
|
||||
public static int getPixelSize(int pixelFormat) {
|
||||
checkPixelFormat(pixelFormat);
|
||||
return pixelSize[pixelFormat];
|
||||
}
|
||||
|
||||
@@ -239,9 +237,8 @@ public final class TJ {
|
||||
*
|
||||
* @return the red offset for the given pixel format.
|
||||
*/
|
||||
public static int getRedOffset(int pixelFormat) throws Exception {
|
||||
if (pixelFormat < 0 || pixelFormat >= NUMPF)
|
||||
throw new Exception("Invalid pixel format");
|
||||
public static int getRedOffset(int pixelFormat) {
|
||||
checkPixelFormat(pixelFormat);
|
||||
return redOffset[pixelFormat];
|
||||
}
|
||||
|
||||
@@ -261,9 +258,8 @@ public final class TJ {
|
||||
*
|
||||
* @return the green offset for the given pixel format.
|
||||
*/
|
||||
public static int getGreenOffset(int pixelFormat) throws Exception {
|
||||
if (pixelFormat < 0 || pixelFormat >= NUMPF)
|
||||
throw new Exception("Invalid pixel format");
|
||||
public static int getGreenOffset(int pixelFormat) {
|
||||
checkPixelFormat(pixelFormat);
|
||||
return greenOffset[pixelFormat];
|
||||
}
|
||||
|
||||
@@ -283,9 +279,8 @@ public final class TJ {
|
||||
*
|
||||
* @return the blue offset for the given pixel format.
|
||||
*/
|
||||
public static int getBlueOffset(int pixelFormat) throws Exception {
|
||||
if (pixelFormat < 0 || pixelFormat >= NUMPF)
|
||||
throw new Exception("Invalid pixel format");
|
||||
public static int getBlueOffset(int pixelFormat) {
|
||||
checkPixelFormat(pixelFormat);
|
||||
return blueOffset[pixelFormat];
|
||||
}
|
||||
|
||||
@@ -407,8 +402,7 @@ public final class TJ {
|
||||
* @return the maximum size of the buffer (in bytes) required to hold a JPEG
|
||||
* image with the given width, height, and level of chrominance subsampling.
|
||||
*/
|
||||
public static native int bufSize(int width, int height, int jpegSubsamp)
|
||||
throws Exception;
|
||||
public static native int bufSize(int width, int height, int jpegSubsamp);
|
||||
|
||||
/**
|
||||
* Returns the size of the buffer (in bytes) required to hold a YUV planar
|
||||
@@ -428,15 +422,13 @@ public final class TJ {
|
||||
* image with the given width, height, and level of chrominance subsampling.
|
||||
*/
|
||||
public static native int bufSizeYUV(int width, int pad, int height,
|
||||
int subsamp)
|
||||
throws Exception;
|
||||
int subsamp);
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link #bufSizeYUV(int, int, int, int)} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public static native int bufSizeYUV(int width, int height, int subsamp)
|
||||
throws Exception;
|
||||
public static native int bufSizeYUV(int width, int height, int subsamp);
|
||||
|
||||
/**
|
||||
* Returns the size of the buffer (in bytes) required to hold a YUV image
|
||||
@@ -460,8 +452,7 @@ public final class TJ {
|
||||
* image with the given parameters.
|
||||
*/
|
||||
public static native int planeSizeYUV(int componentID, int width, int stride,
|
||||
int height, int subsamp)
|
||||
throws Exception;
|
||||
int height, int subsamp);
|
||||
|
||||
/**
|
||||
* Returns the plane width of a YUV image plane with the given parameters.
|
||||
@@ -477,8 +468,7 @@ public final class TJ {
|
||||
*
|
||||
* @return the plane width of a YUV image plane with the given parameters.
|
||||
*/
|
||||
public static native int planeWidth(int componentID, int width, int subsamp)
|
||||
throws Exception;
|
||||
public static native int planeWidth(int componentID, int width, int subsamp);
|
||||
|
||||
/**
|
||||
* Returns the plane height of a YUV image plane with the given parameters.
|
||||
@@ -495,8 +485,7 @@ public final class TJ {
|
||||
* @return the plane height of a YUV image plane with the given parameters.
|
||||
*/
|
||||
public static native int planeHeight(int componentID, int height,
|
||||
int subsamp)
|
||||
throws Exception;
|
||||
int subsamp);
|
||||
|
||||
/**
|
||||
* Returns a list of fractional scaling factors that the JPEG decompressor in
|
||||
@@ -505,10 +494,20 @@ public final class TJ {
|
||||
* @return a list of fractional scaling factors that the JPEG decompressor in
|
||||
* this implementation of TurboJPEG supports.
|
||||
*/
|
||||
public static native TJScalingFactor[] getScalingFactors()
|
||||
throws Exception;
|
||||
public static native TJScalingFactor[] getScalingFactors();
|
||||
|
||||
static {
|
||||
TJLoader.load();
|
||||
}
|
||||
};
|
||||
|
||||
private static void checkPixelFormat(int pixelFormat) {
|
||||
if (pixelFormat < 0 || pixelFormat >= NUMPF)
|
||||
throw new IllegalArgumentException("Invalid pixel format");
|
||||
}
|
||||
|
||||
private static void checkSubsampling(int subsamp) {
|
||||
if (subsamp < 0 || subsamp >= NUMSAMP)
|
||||
throw new IllegalArgumentException("Invalid subsampling type");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (C)2011-2014 D. R. Commander. All Rights Reserved.
|
||||
* Copyright (C)2011-2015 D. R. Commander. All Rights Reserved.
|
||||
* Copyright (C)2015 Viktor Szathmáry. All Rights Reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
@@ -30,11 +31,12 @@ package org.libjpegturbo.turbojpeg;
|
||||
|
||||
import java.awt.image.*;
|
||||
import java.nio.*;
|
||||
import java.io.*;
|
||||
|
||||
/**
|
||||
* TurboJPEG compressor
|
||||
*/
|
||||
public class TJCompressor {
|
||||
public class TJCompressor implements Closeable {
|
||||
|
||||
private static final String NO_ASSOC_ERROR =
|
||||
"No source image is associated with this instance";
|
||||
@@ -42,7 +44,7 @@ public class TJCompressor {
|
||||
/**
|
||||
* Create a TurboJPEG compressor instance.
|
||||
*/
|
||||
public TJCompressor() throws Exception {
|
||||
public TJCompressor() throws TJException {
|
||||
init();
|
||||
}
|
||||
|
||||
@@ -67,7 +69,7 @@ public class TJCompressor {
|
||||
* {@link TJ#PF_RGB TJ.PF_*})
|
||||
*/
|
||||
public TJCompressor(byte[] srcImage, int x, int y, int width, int pitch,
|
||||
int height, int pixelFormat) throws Exception {
|
||||
int height, int pixelFormat) throws TJException {
|
||||
setSourceImage(srcImage, x, y, width, pitch, height, pixelFormat);
|
||||
}
|
||||
|
||||
@@ -77,7 +79,7 @@ public class TJCompressor {
|
||||
*/
|
||||
@Deprecated
|
||||
public TJCompressor(byte[] srcImage, int width, int pitch, int height,
|
||||
int pixelFormat) throws Exception {
|
||||
int pixelFormat) throws TJException {
|
||||
setSourceImage(srcImage, width, pitch, height, pixelFormat);
|
||||
}
|
||||
|
||||
@@ -102,7 +104,7 @@ public class TJCompressor {
|
||||
* {@link #setSourceImage(BufferedImage, int, int, int, int)} for description
|
||||
*/
|
||||
public TJCompressor(BufferedImage srcImage, int x, int y, int width,
|
||||
int height) throws Exception {
|
||||
int height) throws TJException {
|
||||
setSourceImage(srcImage, x, y, width, height);
|
||||
}
|
||||
|
||||
@@ -111,7 +113,7 @@ public class TJCompressor {
|
||||
* compressor instance.
|
||||
*
|
||||
* @param srcImage image buffer containing RGB, grayscale, or CMYK pixels to
|
||||
* be compressed or encoded
|
||||
* be compressed or encoded. This buffer is not modified.
|
||||
*
|
||||
* @param x x offset (in pixels) of the region in the source image from which
|
||||
* the JPEG or YUV image should be compressed/encoded
|
||||
@@ -139,11 +141,11 @@ public class TJCompressor {
|
||||
*/
|
||||
public void setSourceImage(byte[] srcImage, int x, int y, int width,
|
||||
int pitch, int height, int pixelFormat)
|
||||
throws Exception {
|
||||
throws TJException {
|
||||
if (handle == 0) init();
|
||||
if (srcImage == null || x < 0 || y < 0 || width < 1 || height < 1 ||
|
||||
pitch < 0 || pixelFormat < 0 || pixelFormat >= TJ.NUMPF)
|
||||
throw new Exception("Invalid argument in setSourceImage()");
|
||||
throw new IllegalArgumentException("Invalid argument in setSourceImage()");
|
||||
srcBuf = srcImage;
|
||||
srcWidth = width;
|
||||
if (pitch == 0)
|
||||
@@ -164,7 +166,7 @@ public class TJCompressor {
|
||||
*/
|
||||
@Deprecated
|
||||
public void setSourceImage(byte[] srcImage, int width, int pitch,
|
||||
int height, int pixelFormat) throws Exception {
|
||||
int height, int pixelFormat) throws TJException {
|
||||
setSourceImage(srcImage, 0, 0, width, pitch, height, pixelFormat);
|
||||
srcX = srcY = -1;
|
||||
}
|
||||
@@ -174,7 +176,7 @@ public class TJCompressor {
|
||||
* compressor instance.
|
||||
*
|
||||
* @param srcImage a <code>BufferedImage</code> instance containing RGB or
|
||||
* grayscale pixels to be compressed or encoded
|
||||
* grayscale pixels to be compressed or encoded. This image is not modified.
|
||||
*
|
||||
* @param x x offset (in pixels) of the region in the source image from which
|
||||
* the JPEG or YUV image should be compressed/encoded
|
||||
@@ -191,16 +193,16 @@ public class TJCompressor {
|
||||
* height of the source image)
|
||||
*/
|
||||
public void setSourceImage(BufferedImage srcImage, int x, int y, int width,
|
||||
int height) throws Exception {
|
||||
int height) throws TJException {
|
||||
if (handle == 0) init();
|
||||
if (srcImage == null || x < 0 || y < 0 || width < 0 || height < 0)
|
||||
throw new Exception("Invalid argument in setSourceImage()");
|
||||
throw new IllegalArgumentException("Invalid argument in setSourceImage()");
|
||||
srcX = x;
|
||||
srcY = y;
|
||||
srcWidth = (width == 0) ? srcImage.getWidth(): width;
|
||||
srcHeight = (height == 0) ? srcImage.getHeight() : height;
|
||||
if (x + width > srcImage.getWidth() || y + height > srcImage.getHeight())
|
||||
throw new Exception("Compression region exceeds the bounds of the source image");
|
||||
throw new IllegalArgumentException("Compression region exceeds the bounds of the source image");
|
||||
|
||||
int pixelFormat;
|
||||
boolean intPixels = false;
|
||||
@@ -229,7 +231,7 @@ public class TJCompressor {
|
||||
pixelFormat = TJ.PF_BGRX;
|
||||
intPixels = true; break;
|
||||
default:
|
||||
throw new Exception("Unsupported BufferedImage format");
|
||||
throw new IllegalArgumentException("Unsupported BufferedImage format");
|
||||
}
|
||||
srcPixelFormat = pixelFormat;
|
||||
|
||||
@@ -246,7 +248,7 @@ public class TJCompressor {
|
||||
(ComponentSampleModel)srcImage.getSampleModel();
|
||||
int pixelSize = sm.getPixelStride();
|
||||
if (pixelSize != TJ.getPixelSize(pixelFormat))
|
||||
throw new Exception("Inconsistency between pixel format and pixel size in BufferedImage");
|
||||
throw new IllegalArgumentException("Inconsistency between pixel format and pixel size in BufferedImage");
|
||||
srcPitch = sm.getScanlineStride();
|
||||
DataBufferByte db = (DataBufferByte)wr.getDataBuffer();
|
||||
srcBuf = db.getData();
|
||||
@@ -259,12 +261,13 @@ public class TJCompressor {
|
||||
* Associate an uncompressed YUV planar source image with this compressor
|
||||
* instance.
|
||||
*
|
||||
* @param srcImage YUV planar image to be compressed
|
||||
* @param srcImage YUV planar image to be compressed. This image is not
|
||||
* modified.
|
||||
*/
|
||||
public void setSourceImage(YUVImage srcImage) throws Exception {
|
||||
public void setSourceImage(YUVImage srcImage) throws TJException {
|
||||
if (handle == 0) init();
|
||||
if (srcImage == null)
|
||||
throw new Exception("Invalid argument in setSourceImage()");
|
||||
throw new IllegalArgumentException("Invalid argument in setSourceImage()");
|
||||
srcYUVImage = srcImage;
|
||||
srcBuf = null;
|
||||
srcBufInt = null;
|
||||
@@ -291,9 +294,9 @@ public class TJCompressor {
|
||||
* subsequent compress/encode oeprations (one of
|
||||
* {@link TJ#SAMP_444 TJ.SAMP_*})
|
||||
*/
|
||||
public void setSubsamp(int newSubsamp) throws Exception {
|
||||
public void setSubsamp(int newSubsamp) {
|
||||
if (newSubsamp < 0 || newSubsamp >= TJ.NUMSAMP)
|
||||
throw new Exception("Invalid argument in setSubsamp()");
|
||||
throw new IllegalArgumentException("Invalid argument in setSubsamp()");
|
||||
subsamp = newSubsamp;
|
||||
}
|
||||
|
||||
@@ -303,9 +306,9 @@ public class TJCompressor {
|
||||
* @param quality the new JPEG image quality level (1 to 100, 1 = worst,
|
||||
* 100 = best)
|
||||
*/
|
||||
public void setJPEGQuality(int quality) throws Exception {
|
||||
public void setJPEGQuality(int quality) {
|
||||
if (quality < 1 || quality > 100)
|
||||
throw new Exception("Invalid argument in setJPEGQuality()");
|
||||
throw new IllegalArgumentException("Invalid argument in setJPEGQuality()");
|
||||
jpegQuality = quality;
|
||||
}
|
||||
|
||||
@@ -321,15 +324,15 @@ public class TJCompressor {
|
||||
* @param flags the bitwise OR of one or more of
|
||||
* {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*}
|
||||
*/
|
||||
public void compress(byte[] dstBuf, int flags) throws Exception {
|
||||
public void compress(byte[] dstBuf, int flags) throws TJException {
|
||||
if (dstBuf == null || flags < 0)
|
||||
throw new Exception("Invalid argument in compress()");
|
||||
throw new IllegalArgumentException("Invalid argument in compress()");
|
||||
if (srcBuf == null && srcBufInt == null && srcYUVImage == null)
|
||||
throw new Exception(NO_ASSOC_ERROR);
|
||||
throw new IllegalStateException(NO_ASSOC_ERROR);
|
||||
if (jpegQuality < 0)
|
||||
throw new Exception("JPEG Quality not set");
|
||||
throw new IllegalStateException("JPEG Quality not set");
|
||||
if (subsamp < 0 && srcYUVImage == null)
|
||||
throw new Exception("Subsampling level not set");
|
||||
throw new IllegalStateException("Subsampling level not set");
|
||||
|
||||
if (srcYUVImage != null)
|
||||
compressedSize = compressFromYUV(srcYUVImage.getPlanes(),
|
||||
@@ -371,9 +374,8 @@ public class TJCompressor {
|
||||
* not be equal to the size of the JPEG image. Use {@link
|
||||
* #getCompressedSize} to obtain the size of the JPEG image.
|
||||
*/
|
||||
public byte[] compress(int flags) throws Exception {
|
||||
if (srcWidth < 1 || srcHeight < 1)
|
||||
throw new Exception(NO_ASSOC_ERROR);
|
||||
public byte[] compress(int flags) throws TJException {
|
||||
checkSourceImage();
|
||||
byte[] buf = new byte[TJ.bufSize(srcWidth, srcHeight, subsamp)];
|
||||
compress(buf, flags);
|
||||
return buf;
|
||||
@@ -386,7 +388,7 @@ public class TJCompressor {
|
||||
*/
|
||||
@Deprecated
|
||||
public void compress(BufferedImage srcImage, byte[] dstBuf, int flags)
|
||||
throws Exception {
|
||||
throws TJException {
|
||||
setSourceImage(srcImage, 0, 0, 0, 0);
|
||||
compress(dstBuf, flags);
|
||||
}
|
||||
@@ -397,7 +399,8 @@ public class TJCompressor {
|
||||
* {@link #compress(int)} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public byte[] compress(BufferedImage srcImage, int flags) throws Exception {
|
||||
public byte[] compress(BufferedImage srcImage, int flags)
|
||||
throws TJException {
|
||||
setSourceImage(srcImage, 0, 0, 0, 0);
|
||||
return compress(flags);
|
||||
}
|
||||
@@ -416,17 +419,16 @@ public class TJCompressor {
|
||||
* @param flags the bitwise OR of one or more of
|
||||
* {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*}
|
||||
*/
|
||||
public void encodeYUV(YUVImage dstImage, int flags) throws Exception {
|
||||
public void encodeYUV(YUVImage dstImage, int flags) throws TJException {
|
||||
if (dstImage == null || flags < 0)
|
||||
throw new Exception("Invalid argument in encodeYUV()");
|
||||
throw new IllegalArgumentException("Invalid argument in encodeYUV()");
|
||||
if (srcBuf == null && srcBufInt == null)
|
||||
throw new Exception(NO_ASSOC_ERROR);
|
||||
throw new IllegalStateException(NO_ASSOC_ERROR);
|
||||
if (srcYUVImage != null)
|
||||
throw new Exception("Source image is not correct type");
|
||||
if (subsamp < 0)
|
||||
throw new Exception("Subsampling level not set");
|
||||
throw new IllegalStateException("Source image is not correct type");
|
||||
checkSubsampling();
|
||||
if (srcWidth != dstImage.getWidth() || srcHeight != dstImage.getHeight())
|
||||
throw new Exception("Destination image is the wrong size");
|
||||
throw new IllegalStateException("Destination image is the wrong size");
|
||||
|
||||
if (srcBufInt != null) {
|
||||
encodeYUV(srcBufInt, srcX, srcY, srcWidth, srcStride, srcHeight,
|
||||
@@ -444,13 +446,11 @@ public class TJCompressor {
|
||||
* @deprecated Use {@link #encodeYUV(YUVImage, int)} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public void encodeYUV(byte[] dstBuf, int flags) throws Exception {
|
||||
public void encodeYUV(byte[] dstBuf, int flags) throws TJException {
|
||||
if(dstBuf == null)
|
||||
throw new Exception("Invalid argument in encodeYUV()");
|
||||
if (srcWidth < 1 || srcHeight < 1)
|
||||
throw new Exception(NO_ASSOC_ERROR);
|
||||
if (subsamp < 0)
|
||||
throw new Exception("Subsampling level not set");
|
||||
throw new IllegalArgumentException("Invalid argument in encodeYUV()");
|
||||
checkSourceImage();
|
||||
checkSubsampling();
|
||||
YUVImage yuvImage = new YUVImage(dstBuf, srcWidth, 4, srcHeight, subsamp);
|
||||
encodeYUV(yuvImage, flags);
|
||||
}
|
||||
@@ -472,13 +472,11 @@ public class TJCompressor {
|
||||
*
|
||||
* @return a YUV planar image.
|
||||
*/
|
||||
public YUVImage encodeYUV(int pad, int flags) throws Exception {
|
||||
if (srcWidth < 1 || srcHeight < 1)
|
||||
throw new Exception(NO_ASSOC_ERROR);
|
||||
if (subsamp < 0)
|
||||
throw new Exception("Subsampling level not set");
|
||||
public YUVImage encodeYUV(int pad, int flags) throws TJException {
|
||||
checkSourceImage();
|
||||
checkSubsampling();
|
||||
if(pad < 1 || ((pad & (pad - 1)) != 0))
|
||||
throw new Exception("Invalid argument in encodeYUV()");
|
||||
throw new IllegalStateException("Invalid argument in encodeYUV()");
|
||||
YUVImage yuvImage = new YUVImage(srcWidth, pad, srcHeight, subsamp);
|
||||
encodeYUV(yuvImage, flags);
|
||||
return yuvImage;
|
||||
@@ -505,11 +503,9 @@ public class TJCompressor {
|
||||
*
|
||||
* @return a YUV planar image.
|
||||
*/
|
||||
public YUVImage encodeYUV(int[] strides, int flags) throws Exception {
|
||||
if (srcWidth < 1 || srcHeight < 1)
|
||||
throw new Exception(NO_ASSOC_ERROR);
|
||||
if (subsamp < 0)
|
||||
throw new Exception("Subsampling level not set");
|
||||
public YUVImage encodeYUV(int[] strides, int flags) throws TJException {
|
||||
checkSourceImage();
|
||||
checkSubsampling();
|
||||
YUVImage yuvImage = new YUVImage(srcWidth, strides, srcHeight, subsamp);
|
||||
encodeYUV(yuvImage, flags);
|
||||
return yuvImage;
|
||||
@@ -519,11 +515,9 @@ public class TJCompressor {
|
||||
* @deprecated Use {@link #encodeYUV(int, int)} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public byte[] encodeYUV(int flags) throws Exception {
|
||||
if (srcWidth < 1 || srcHeight < 1)
|
||||
throw new Exception(NO_ASSOC_ERROR);
|
||||
if (subsamp < 0)
|
||||
throw new Exception("Subsampling level not set");
|
||||
public byte[] encodeYUV(int flags) throws TJException {
|
||||
checkSourceImage();
|
||||
checkSubsampling();
|
||||
YUVImage yuvImage = new YUVImage(srcWidth, 4, srcHeight, subsamp);
|
||||
encodeYUV(yuvImage, flags);
|
||||
return yuvImage.getBuf();
|
||||
@@ -536,7 +530,7 @@ public class TJCompressor {
|
||||
*/
|
||||
@Deprecated
|
||||
public void encodeYUV(BufferedImage srcImage, byte[] dstBuf, int flags)
|
||||
throws Exception {
|
||||
throws TJException {
|
||||
setSourceImage(srcImage, 0, 0, 0, 0);
|
||||
encodeYUV(dstBuf, flags);
|
||||
}
|
||||
@@ -547,7 +541,8 @@ public class TJCompressor {
|
||||
* {@link #encodeYUV(int, int)} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public byte[] encodeYUV(BufferedImage srcImage, int flags) throws Exception {
|
||||
public byte[] encodeYUV(BufferedImage srcImage, int flags)
|
||||
throws TJException {
|
||||
setSourceImage(srcImage, 0, 0, 0, 0);
|
||||
return encodeYUV(flags);
|
||||
}
|
||||
@@ -566,68 +561,84 @@ public class TJCompressor {
|
||||
/**
|
||||
* Free the native structures associated with this compressor instance.
|
||||
*/
|
||||
public void close() throws Exception {
|
||||
@Override
|
||||
public void close() throws TJException {
|
||||
if (handle != 0)
|
||||
destroy();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void finalize() throws Throwable {
|
||||
try {
|
||||
close();
|
||||
} catch(Exception e) {
|
||||
} catch(TJException e) {
|
||||
} finally {
|
||||
super.finalize();
|
||||
}
|
||||
};
|
||||
|
||||
private native void init() throws Exception;
|
||||
private native void init() throws TJException;
|
||||
|
||||
private native void destroy() throws Exception;
|
||||
private native void destroy() throws TJException;
|
||||
|
||||
// JPEG size in bytes is returned
|
||||
@Deprecated
|
||||
private native int compress(byte[] srcBuf, int width, int pitch,
|
||||
int height, int pixelFormat, byte[] dstBuf, int jpegSubsamp, int jpegQual,
|
||||
int flags) throws Exception; // deprecated
|
||||
int flags) throws TJException;
|
||||
|
||||
private native int compress(byte[] srcBuf, int x, int y, int width,
|
||||
int pitch, int height, int pixelFormat, byte[] dstBuf, int jpegSubsamp,
|
||||
int jpegQual, int flags) throws Exception;
|
||||
int jpegQual, int flags) throws TJException;
|
||||
|
||||
@Deprecated
|
||||
private native int compress(int[] srcBuf, int width, int stride,
|
||||
int height, int pixelFormat, byte[] dstBuf, int jpegSubsamp, int jpegQual,
|
||||
int flags) throws Exception; // deprecated
|
||||
int flags) throws TJException;
|
||||
|
||||
private native int compress(int[] srcBuf, int x, int y, int width,
|
||||
int stride, int height, int pixelFormat, byte[] dstBuf, int jpegSubsamp,
|
||||
int jpegQual, int flags) throws Exception;
|
||||
int jpegQual, int flags) throws TJException;
|
||||
|
||||
private native int compressFromYUV(byte[][] srcPlanes, int[] srcOffsets,
|
||||
int width, int[] srcStrides, int height, int subsamp, byte[] dstBuf,
|
||||
int jpegQual, int flags)
|
||||
throws Exception;
|
||||
throws TJException;
|
||||
|
||||
@Deprecated
|
||||
private native void encodeYUV(byte[] srcBuf, int width, int pitch,
|
||||
int height, int pixelFormat, byte[] dstBuf, int subsamp, int flags)
|
||||
throws Exception; // deprecated
|
||||
throws TJException;
|
||||
|
||||
private native void encodeYUV(byte[] srcBuf, int x, int y, int width,
|
||||
int pitch, int height, int pixelFormat, byte[][] dstPlanes,
|
||||
int[] dstOffsets, int[] dstStrides, int subsamp, int flags)
|
||||
throws Exception;
|
||||
throws TJException;
|
||||
|
||||
@Deprecated
|
||||
private native void encodeYUV(int[] srcBuf, int width, int stride,
|
||||
int height, int pixelFormat, byte[] dstBuf, int subsamp, int flags)
|
||||
throws Exception; // deprecated
|
||||
throws TJException;
|
||||
|
||||
private native void encodeYUV(int[] srcBuf, int x, int y, int width,
|
||||
int srcStride, int height, int pixelFormat, byte[][] dstPlanes,
|
||||
int[] dstOffsets, int[] dstStrides, int subsamp, int flags)
|
||||
throws Exception;
|
||||
throws TJException;
|
||||
|
||||
static {
|
||||
TJLoader.load();
|
||||
}
|
||||
|
||||
private void checkSourceImage() {
|
||||
if (srcWidth < 1 || srcHeight < 1)
|
||||
throw new IllegalStateException(NO_ASSOC_ERROR);
|
||||
}
|
||||
|
||||
private void checkSubsampling() {
|
||||
if (subsamp < 0)
|
||||
throw new IllegalStateException("Subsampling level not set");
|
||||
}
|
||||
|
||||
private long handle = 0;
|
||||
private byte[] srcBuf = null;
|
||||
private int[] srcBufInt = null;
|
||||
@@ -644,4 +655,4 @@ public class TJCompressor {
|
||||
private int compressedSize = 0;
|
||||
private int yuvPad = 4;
|
||||
private ByteOrder byteOrder = null;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -72,5 +72,5 @@ public interface TJCustomFilter {
|
||||
void customFilter(ShortBuffer coeffBuffer, Rectangle bufferRegion,
|
||||
Rectangle planeRegion, int componentID, int transformID,
|
||||
TJTransform transform)
|
||||
throws Exception;
|
||||
throws TJException;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (C)2011-2014 D. R. Commander. All Rights Reserved.
|
||||
* Copyright (C)2011-2015 D. R. Commander. All Rights Reserved.
|
||||
* Copyright (C)2015 Viktor Szathmáry. All Rights Reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
@@ -30,11 +31,12 @@ package org.libjpegturbo.turbojpeg;
|
||||
|
||||
import java.awt.image.*;
|
||||
import java.nio.*;
|
||||
import java.io.*;
|
||||
|
||||
/**
|
||||
* TurboJPEG decompressor
|
||||
*/
|
||||
public class TJDecompressor {
|
||||
public class TJDecompressor implements Closeable {
|
||||
|
||||
private static final String NO_ASSOC_ERROR =
|
||||
"No JPEG image is associated with this instance";
|
||||
@@ -42,7 +44,7 @@ public class TJDecompressor {
|
||||
/**
|
||||
* Create a TurboJPEG decompresssor instance.
|
||||
*/
|
||||
public TJDecompressor() throws Exception {
|
||||
public TJDecompressor() throws TJException {
|
||||
init();
|
||||
}
|
||||
|
||||
@@ -51,9 +53,9 @@ public class TJDecompressor {
|
||||
* image stored in <code>jpegImage</code> with the newly created instance.
|
||||
*
|
||||
* @param jpegImage JPEG image buffer (size of the JPEG image is assumed to
|
||||
* be the length of the array)
|
||||
* be the length of the array.) This buffer is not modified.
|
||||
*/
|
||||
public TJDecompressor(byte[] jpegImage) throws Exception {
|
||||
public TJDecompressor(byte[] jpegImage) throws TJException {
|
||||
init();
|
||||
setSourceImage(jpegImage, jpegImage.length);
|
||||
}
|
||||
@@ -63,11 +65,11 @@ public class TJDecompressor {
|
||||
* image of length <code>imageSize</code> bytes stored in
|
||||
* <code>jpegImage</code> with the newly created instance.
|
||||
*
|
||||
* @param jpegImage JPEG image buffer
|
||||
* @param jpegImage JPEG image buffer. This buffer is not modified.
|
||||
*
|
||||
* @param imageSize size of the JPEG image (in bytes)
|
||||
*/
|
||||
public TJDecompressor(byte[] jpegImage, int imageSize) throws Exception {
|
||||
public TJDecompressor(byte[] jpegImage, int imageSize) throws TJException {
|
||||
init();
|
||||
setSourceImage(jpegImage, imageSize);
|
||||
}
|
||||
@@ -78,9 +80,9 @@ public class TJDecompressor {
|
||||
* instance.
|
||||
*
|
||||
* @param yuvImage {@link YUVImage} instance containing a YUV planar
|
||||
* image to be decoded
|
||||
* image to be decoded. This image is not modified.
|
||||
*/
|
||||
public TJDecompressor(YUVImage yuvImage) throws Exception {
|
||||
public TJDecompressor(YUVImage yuvImage) throws TJException {
|
||||
init();
|
||||
setSourceImage(yuvImage);
|
||||
}
|
||||
@@ -90,14 +92,14 @@ public class TJDecompressor {
|
||||
* <code>jpegImage</code> with this decompressor instance. This image will
|
||||
* be used as the source image for subsequent decompress operations.
|
||||
*
|
||||
* @param jpegImage JPEG image buffer
|
||||
* @param jpegImage JPEG image buffer. This buffer is not modified.
|
||||
*
|
||||
* @param imageSize size of the JPEG image (in bytes)
|
||||
*/
|
||||
public void setSourceImage(byte[] jpegImage, int imageSize)
|
||||
throws Exception {
|
||||
throws TJException {
|
||||
if (jpegImage == null || imageSize < 1)
|
||||
throw new Exception("Invalid argument in setSourceImage()");
|
||||
throw new IllegalArgumentException("Invalid argument in setSourceImage()");
|
||||
jpegBuf = jpegImage;
|
||||
jpegBufSize = imageSize;
|
||||
decompressHeader(jpegBuf, jpegBufSize);
|
||||
@@ -108,7 +110,8 @@ public class TJDecompressor {
|
||||
* @deprecated Use {@link #setSourceImage(byte[], int)} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public void setJPEGImage(byte[] jpegImage, int imageSize) throws Exception {
|
||||
public void setJPEGImage(byte[] jpegImage, int imageSize)
|
||||
throws TJException {
|
||||
setSourceImage(jpegImage, imageSize);
|
||||
}
|
||||
|
||||
@@ -118,11 +121,11 @@ public class TJDecompressor {
|
||||
* RGB or grayscale destination image.
|
||||
*
|
||||
* @param srcImage {@link YUVImage} instance containing a YUV planar image to
|
||||
* be decoded
|
||||
* be decoded. This image is not modified.
|
||||
*/
|
||||
public void setSourceImage(YUVImage srcImage) throws Exception {
|
||||
public void setSourceImage(YUVImage srcImage) {
|
||||
if (srcImage == null)
|
||||
throw new Exception("Invalid argument in setSourceImage()");
|
||||
throw new IllegalArgumentException("Invalid argument in setSourceImage()");
|
||||
yuvImage = srcImage;
|
||||
jpegBuf = null;
|
||||
jpegBufSize = 0;
|
||||
@@ -136,11 +139,11 @@ public class TJDecompressor {
|
||||
* @return the width of the source image (JPEG or YUV) associated with this
|
||||
* decompressor instance.
|
||||
*/
|
||||
public int getWidth() throws Exception {
|
||||
public int getWidth() {
|
||||
if (yuvImage != null)
|
||||
return yuvImage.getWidth();
|
||||
if (jpegWidth < 1)
|
||||
throw new Exception(NO_ASSOC_ERROR);
|
||||
throw new IllegalStateException(NO_ASSOC_ERROR);
|
||||
return jpegWidth;
|
||||
}
|
||||
|
||||
@@ -151,11 +154,11 @@ public class TJDecompressor {
|
||||
* @return the height of the source image (JPEG or YUV) associated with this
|
||||
* decompressor instance.
|
||||
*/
|
||||
public int getHeight() throws Exception {
|
||||
public int getHeight() {
|
||||
if (yuvImage != null)
|
||||
return yuvImage.getHeight();
|
||||
if (jpegHeight < 1)
|
||||
throw new Exception(NO_ASSOC_ERROR);
|
||||
throw new IllegalStateException(NO_ASSOC_ERROR);
|
||||
return jpegHeight;
|
||||
}
|
||||
|
||||
@@ -167,13 +170,13 @@ public class TJDecompressor {
|
||||
* @return the level of chrominance subsampling used in the source image
|
||||
* (JPEG or YUV) associated with this decompressor instance.
|
||||
*/
|
||||
public int getSubsamp() throws Exception {
|
||||
public int getSubsamp() {
|
||||
if (yuvImage != null)
|
||||
return yuvImage.getSubsamp();
|
||||
if (jpegSubsamp < 0)
|
||||
throw new Exception(NO_ASSOC_ERROR);
|
||||
throw new IllegalStateException(NO_ASSOC_ERROR);
|
||||
if (jpegSubsamp >= TJ.NUMSAMP)
|
||||
throw new Exception("JPEG header information is invalid");
|
||||
throw new IllegalStateException("JPEG header information is invalid");
|
||||
return jpegSubsamp;
|
||||
}
|
||||
|
||||
@@ -185,13 +188,13 @@ public class TJDecompressor {
|
||||
* @return the colorspace used in the source image (JPEG or YUV) associated
|
||||
* with this decompressor instance.
|
||||
*/
|
||||
public int getColorspace() throws Exception {
|
||||
public int getColorspace() {
|
||||
if (yuvImage != null)
|
||||
return TJ.CS_YCbCr;
|
||||
if (jpegColorspace < 0)
|
||||
throw new Exception(NO_ASSOC_ERROR);
|
||||
throw new IllegalStateException(NO_ASSOC_ERROR);
|
||||
if (jpegColorspace >= TJ.NUMCS)
|
||||
throw new Exception("JPEG header information is invalid");
|
||||
throw new IllegalStateException("JPEG header information is invalid");
|
||||
return jpegColorspace;
|
||||
}
|
||||
|
||||
@@ -200,9 +203,9 @@ public class TJDecompressor {
|
||||
*
|
||||
* @return the JPEG image buffer associated with this decompressor instance.
|
||||
*/
|
||||
public byte[] getJPEGBuf() throws Exception {
|
||||
public byte[] getJPEGBuf() {
|
||||
if (jpegBuf == null)
|
||||
throw new Exception(NO_ASSOC_ERROR);
|
||||
throw new IllegalStateException(NO_ASSOC_ERROR);
|
||||
return jpegBuf;
|
||||
}
|
||||
|
||||
@@ -213,9 +216,9 @@ public class TJDecompressor {
|
||||
* @return the size of the JPEG image (in bytes) associated with this
|
||||
* decompressor instance.
|
||||
*/
|
||||
public int getJPEGSize() throws Exception {
|
||||
public int getJPEGSize() {
|
||||
if (jpegBufSize < 1)
|
||||
throw new Exception(NO_ASSOC_ERROR);
|
||||
throw new IllegalStateException(NO_ASSOC_ERROR);
|
||||
return jpegBufSize;
|
||||
}
|
||||
|
||||
@@ -238,12 +241,11 @@ public class TJDecompressor {
|
||||
* decompressor can generate without exceeding the desired image width and
|
||||
* height.
|
||||
*/
|
||||
public int getScaledWidth(int desiredWidth, int desiredHeight)
|
||||
throws Exception {
|
||||
public int getScaledWidth(int desiredWidth, int desiredHeight) {
|
||||
if (jpegWidth < 1 || jpegHeight < 1)
|
||||
throw new Exception(NO_ASSOC_ERROR);
|
||||
throw new IllegalStateException(NO_ASSOC_ERROR);
|
||||
if (desiredWidth < 0 || desiredHeight < 0)
|
||||
throw new Exception("Invalid argument in getScaledWidth()");
|
||||
throw new IllegalArgumentException("Invalid argument in getScaledWidth()");
|
||||
TJScalingFactor[] sf = TJ.getScalingFactors();
|
||||
if (desiredWidth == 0)
|
||||
desiredWidth = jpegWidth;
|
||||
@@ -257,7 +259,7 @@ public class TJDecompressor {
|
||||
break;
|
||||
}
|
||||
if (scaledWidth > desiredWidth || scaledHeight > desiredHeight)
|
||||
throw new Exception("Could not scale down to desired image dimensions");
|
||||
throw new IllegalArgumentException("Could not scale down to desired image dimensions");
|
||||
return scaledWidth;
|
||||
}
|
||||
|
||||
@@ -280,12 +282,11 @@ public class TJDecompressor {
|
||||
* decompressor can generate without exceeding the desired image width and
|
||||
* height.
|
||||
*/
|
||||
public int getScaledHeight(int desiredWidth, int desiredHeight)
|
||||
throws Exception {
|
||||
public int getScaledHeight(int desiredWidth, int desiredHeight) {
|
||||
if (jpegWidth < 1 || jpegHeight < 1)
|
||||
throw new Exception(NO_ASSOC_ERROR);
|
||||
throw new IllegalStateException(NO_ASSOC_ERROR);
|
||||
if (desiredWidth < 0 || desiredHeight < 0)
|
||||
throw new Exception("Invalid argument in getScaledHeight()");
|
||||
throw new IllegalArgumentException("Invalid argument in getScaledHeight()");
|
||||
TJScalingFactor[] sf = TJ.getScalingFactors();
|
||||
if (desiredWidth == 0)
|
||||
desiredWidth = jpegWidth;
|
||||
@@ -299,7 +300,7 @@ public class TJDecompressor {
|
||||
break;
|
||||
}
|
||||
if (scaledWidth > desiredWidth || scaledHeight > desiredHeight)
|
||||
throw new Exception("Could not scale down to desired image dimensions");
|
||||
throw new IllegalArgumentException("Could not scale down to desired image dimensions");
|
||||
return scaledHeight;
|
||||
}
|
||||
|
||||
@@ -369,13 +370,13 @@ public class TJDecompressor {
|
||||
*/
|
||||
public void decompress(byte[] dstBuf, int x, int y, int desiredWidth,
|
||||
int pitch, int desiredHeight, int pixelFormat,
|
||||
int flags) throws Exception {
|
||||
int flags) throws TJException {
|
||||
if (jpegBuf == null && yuvImage == null)
|
||||
throw new Exception(NO_ASSOC_ERROR);
|
||||
throw new IllegalStateException(NO_ASSOC_ERROR);
|
||||
if (dstBuf == null || x < 0 || y < 0 || pitch < 0 ||
|
||||
(yuvImage != null && (desiredWidth < 0 || desiredHeight < 0)) ||
|
||||
pixelFormat < 0 || pixelFormat >= TJ.NUMPF || flags < 0)
|
||||
throw new Exception("Invalid argument in decompress()");
|
||||
throw new IllegalArgumentException("Invalid argument in decompress()");
|
||||
if (yuvImage != null)
|
||||
decodeYUV(yuvImage.getPlanes(), yuvImage.getOffsets(),
|
||||
yuvImage.getStrides(), yuvImage.getSubsamp(), dstBuf, x, y,
|
||||
@@ -398,7 +399,7 @@ public class TJDecompressor {
|
||||
@Deprecated
|
||||
public void decompress(byte[] dstBuf, int desiredWidth, int pitch,
|
||||
int desiredHeight, int pixelFormat, int flags)
|
||||
throws Exception {
|
||||
throws TJException {
|
||||
decompress(dstBuf, 0, 0, desiredWidth, pitch, desiredHeight, pixelFormat,
|
||||
flags);
|
||||
}
|
||||
@@ -428,11 +429,11 @@ public class TJDecompressor {
|
||||
* @return a buffer containing the decompressed image.
|
||||
*/
|
||||
public byte[] decompress(int desiredWidth, int pitch, int desiredHeight,
|
||||
int pixelFormat, int flags) throws Exception {
|
||||
int pixelFormat, int flags) throws TJException {
|
||||
if (pitch < 0 ||
|
||||
(yuvImage == null && (desiredWidth < 0 || desiredHeight < 0)) ||
|
||||
pixelFormat < 0 || pixelFormat >= TJ.NUMPF || flags < 0)
|
||||
throw new Exception("Invalid argument in decompress()");
|
||||
throw new IllegalArgumentException("Invalid argument in decompress()");
|
||||
int pixelSize = TJ.getPixelSize(pixelFormat);
|
||||
int scaledWidth = getScaledWidth(desiredWidth, desiredHeight);
|
||||
int scaledHeight = getScaledHeight(desiredWidth, desiredHeight);
|
||||
@@ -461,20 +462,21 @@ public class TJDecompressor {
|
||||
* @param flags the bitwise OR of one or more of
|
||||
* {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*}
|
||||
*/
|
||||
public void decompressToYUV(YUVImage dstImage, int flags) throws Exception {
|
||||
public void decompressToYUV(YUVImage dstImage, int flags)
|
||||
throws TJException {
|
||||
if (jpegBuf == null)
|
||||
throw new Exception(NO_ASSOC_ERROR);
|
||||
throw new IllegalStateException(NO_ASSOC_ERROR);
|
||||
if (dstImage == null || flags < 0)
|
||||
throw new Exception("Invalid argument in decompressToYUV()");
|
||||
throw new IllegalArgumentException("Invalid argument in decompressToYUV()");
|
||||
int scaledWidth = getScaledWidth(dstImage.getWidth(),
|
||||
dstImage.getHeight());
|
||||
int scaledHeight = getScaledHeight(dstImage.getWidth(),
|
||||
dstImage.getHeight());
|
||||
if (scaledWidth != dstImage.getWidth() ||
|
||||
scaledHeight != dstImage.getHeight())
|
||||
throw new Exception("YUVImage dimensions do not match one of the scaled image sizes that TurboJPEG is capable of generating.");
|
||||
throw new IllegalArgumentException("YUVImage dimensions do not match one of the scaled image sizes that TurboJPEG is capable of generating.");
|
||||
if (jpegSubsamp != dstImage.getSubsamp())
|
||||
throw new Exception("YUVImage subsampling level does not match that of the JPEG image");
|
||||
throw new IllegalArgumentException("YUVImage subsampling level does not match that of the JPEG image");
|
||||
|
||||
decompressToYUV(jpegBuf, jpegBufSize, dstImage.getPlanes(),
|
||||
dstImage.getOffsets(), dstImage.getWidth(),
|
||||
@@ -485,7 +487,7 @@ public class TJDecompressor {
|
||||
* @deprecated Use {@link #decompressToYUV(YUVImage, int)} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public void decompressToYUV(byte[] dstBuf, int flags) throws Exception {
|
||||
public void decompressToYUV(byte[] dstBuf, int flags) throws TJException {
|
||||
YUVImage dstImage = new YUVImage(dstBuf, jpegWidth, 4, jpegHeight,
|
||||
jpegSubsamp);
|
||||
decompressToYUV(dstImage, flags);
|
||||
@@ -531,15 +533,15 @@ public class TJDecompressor {
|
||||
*/
|
||||
public YUVImage decompressToYUV(int desiredWidth, int[] strides,
|
||||
int desiredHeight,
|
||||
int flags) throws Exception {
|
||||
int flags) throws TJException {
|
||||
if (flags < 0)
|
||||
throw new Exception("Invalid argument in decompressToYUV()");
|
||||
throw new IllegalArgumentException("Invalid argument in decompressToYUV()");
|
||||
if (jpegWidth < 1 || jpegHeight < 1 || jpegSubsamp < 0)
|
||||
throw new Exception(NO_ASSOC_ERROR);
|
||||
throw new IllegalStateException(NO_ASSOC_ERROR);
|
||||
if (jpegSubsamp >= TJ.NUMSAMP)
|
||||
throw new Exception("JPEG header information is invalid");
|
||||
throw new IllegalStateException("JPEG header information is invalid");
|
||||
if (yuvImage != null)
|
||||
throw new Exception("Source image is the wrong type");
|
||||
throw new IllegalStateException("Source image is the wrong type");
|
||||
|
||||
int scaledWidth = getScaledWidth(desiredWidth, desiredHeight);
|
||||
int scaledHeight = getScaledHeight(desiredWidth, desiredHeight);
|
||||
@@ -584,15 +586,15 @@ public class TJDecompressor {
|
||||
* @return a YUV planar image.
|
||||
*/
|
||||
public YUVImage decompressToYUV(int desiredWidth, int pad, int desiredHeight,
|
||||
int flags) throws Exception {
|
||||
int flags) throws TJException {
|
||||
if (flags < 0)
|
||||
throw new Exception("Invalid argument in decompressToYUV()");
|
||||
throw new IllegalArgumentException("Invalid argument in decompressToYUV()");
|
||||
if (jpegWidth < 1 || jpegHeight < 1 || jpegSubsamp < 0)
|
||||
throw new Exception(NO_ASSOC_ERROR);
|
||||
throw new IllegalStateException(NO_ASSOC_ERROR);
|
||||
if (jpegSubsamp >= TJ.NUMSAMP)
|
||||
throw new Exception("JPEG header information is invalid");
|
||||
throw new IllegalStateException("JPEG header information is invalid");
|
||||
if (yuvImage != null)
|
||||
throw new Exception("Source image is the wrong type");
|
||||
throw new IllegalStateException("Source image is the wrong type");
|
||||
|
||||
int scaledWidth = getScaledWidth(desiredWidth, desiredHeight);
|
||||
int scaledHeight = getScaledHeight(desiredWidth, desiredHeight);
|
||||
@@ -606,7 +608,7 @@ public class TJDecompressor {
|
||||
* @deprecated Use {@link #decompressToYUV(int, int, int, int)} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public byte[] decompressToYUV(int flags) throws Exception {
|
||||
public byte[] decompressToYUV(int flags) throws TJException {
|
||||
YUVImage dstImage = new YUVImage(jpegWidth, 4, jpegHeight, jpegSubsamp);
|
||||
decompressToYUV(dstImage, flags);
|
||||
return dstImage.getBuf();
|
||||
@@ -676,13 +678,13 @@ public class TJDecompressor {
|
||||
*/
|
||||
public void decompress(int[] dstBuf, int x, int y, int desiredWidth,
|
||||
int stride, int desiredHeight, int pixelFormat,
|
||||
int flags) throws Exception {
|
||||
int flags) throws TJException {
|
||||
if (jpegBuf == null && yuvImage == null)
|
||||
throw new Exception(NO_ASSOC_ERROR);
|
||||
throw new IllegalStateException(NO_ASSOC_ERROR);
|
||||
if (dstBuf == null || x < 0 || y < 0 || stride < 0 ||
|
||||
(yuvImage != null && (desiredWidth < 0 || desiredHeight < 0)) ||
|
||||
pixelFormat < 0 || pixelFormat >= TJ.NUMPF || flags < 0)
|
||||
throw new Exception("Invalid argument in decompress()");
|
||||
throw new IllegalArgumentException("Invalid argument in decompress()");
|
||||
if (yuvImage != null)
|
||||
decodeYUV(yuvImage.getPlanes(), yuvImage.getOffsets(),
|
||||
yuvImage.getStrides(), yuvImage.getSubsamp(), dstBuf, x, y,
|
||||
@@ -709,9 +711,10 @@ public class TJDecompressor {
|
||||
* @param flags the bitwise OR of one or more of
|
||||
* {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*}
|
||||
*/
|
||||
public void decompress(BufferedImage dstImage, int flags) throws Exception {
|
||||
public void decompress(BufferedImage dstImage, int flags)
|
||||
throws TJException {
|
||||
if (dstImage == null || flags < 0)
|
||||
throw new Exception("Invalid argument in decompress()");
|
||||
throw new IllegalArgumentException("Invalid argument in decompress()");
|
||||
int desiredWidth = dstImage.getWidth();
|
||||
int desiredHeight = dstImage.getHeight();
|
||||
int scaledWidth, scaledHeight;
|
||||
@@ -719,14 +722,14 @@ public class TJDecompressor {
|
||||
if (yuvImage != null) {
|
||||
if (desiredWidth != yuvImage.getWidth() ||
|
||||
desiredHeight != yuvImage.getHeight())
|
||||
throw new Exception("BufferedImage dimensions do not match the dimensions of the source image.");
|
||||
throw new IllegalArgumentException("BufferedImage dimensions do not match the dimensions of the source image.");
|
||||
scaledWidth = yuvImage.getWidth();
|
||||
scaledHeight = yuvImage.getHeight();
|
||||
} else {
|
||||
scaledWidth = getScaledWidth(desiredWidth, desiredHeight);
|
||||
scaledHeight = getScaledHeight(desiredWidth, desiredHeight);
|
||||
if (scaledWidth != desiredWidth || scaledHeight != desiredHeight)
|
||||
throw new Exception("BufferedImage dimensions do not match one of the scaled image sizes that TurboJPEG is capable of generating.");
|
||||
throw new IllegalArgumentException("BufferedImage dimensions do not match one of the scaled image sizes that TurboJPEG is capable of generating.");
|
||||
}
|
||||
int pixelFormat; boolean intPixels = false;
|
||||
if (byteOrder == null)
|
||||
@@ -759,7 +762,7 @@ public class TJDecompressor {
|
||||
pixelFormat = TJ.PF_BGRA;
|
||||
intPixels = true; break;
|
||||
default:
|
||||
throw new Exception("Unsupported BufferedImage format");
|
||||
throw new IllegalArgumentException("Unsupported BufferedImage format");
|
||||
}
|
||||
WritableRaster wr = dstImage.getRaster();
|
||||
if (intPixels) {
|
||||
@@ -775,7 +778,7 @@ public class TJDecompressor {
|
||||
pixelFormat, flags);
|
||||
else {
|
||||
if (jpegBuf == null)
|
||||
throw new Exception(NO_ASSOC_ERROR);
|
||||
throw new IllegalStateException(NO_ASSOC_ERROR);
|
||||
decompress(jpegBuf, jpegBufSize, buf, 0, 0, scaledWidth, stride,
|
||||
scaledHeight, pixelFormat, flags);
|
||||
}
|
||||
@@ -784,7 +787,7 @@ public class TJDecompressor {
|
||||
(ComponentSampleModel)dstImage.getSampleModel();
|
||||
int pixelSize = sm.getPixelStride();
|
||||
if (pixelSize != TJ.getPixelSize(pixelFormat))
|
||||
throw new Exception("Inconsistency between pixel format and pixel size in BufferedImage");
|
||||
throw new IllegalArgumentException("Inconsistency between pixel format and pixel size in BufferedImage");
|
||||
int pitch = sm.getScanlineStride();
|
||||
DataBufferByte db = (DataBufferByte)wr.getDataBuffer();
|
||||
byte[] buf = db.getData();
|
||||
@@ -818,10 +821,10 @@ public class TJDecompressor {
|
||||
*/
|
||||
public BufferedImage decompress(int desiredWidth, int desiredHeight,
|
||||
int bufferedImageType, int flags)
|
||||
throws Exception {
|
||||
throws TJException {
|
||||
if ((yuvImage == null && (desiredWidth < 0 || desiredHeight < 0)) ||
|
||||
flags < 0)
|
||||
throw new Exception("Invalid argument in decompress()");
|
||||
throw new IllegalArgumentException("Invalid argument in decompress()");
|
||||
int scaledWidth = getScaledWidth(desiredWidth, desiredHeight);
|
||||
int scaledHeight = getScaledHeight(desiredWidth, desiredHeight);
|
||||
BufferedImage img = new BufferedImage(scaledWidth, scaledHeight,
|
||||
@@ -833,57 +836,62 @@ public class TJDecompressor {
|
||||
/**
|
||||
* Free the native structures associated with this decompressor instance.
|
||||
*/
|
||||
public void close() throws Exception {
|
||||
@Override
|
||||
public void close() throws TJException {
|
||||
if (handle != 0)
|
||||
destroy();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void finalize() throws Throwable {
|
||||
try {
|
||||
close();
|
||||
} catch(Exception e) {
|
||||
} catch(TJException e) {
|
||||
} finally {
|
||||
super.finalize();
|
||||
}
|
||||
};
|
||||
|
||||
private native void init() throws Exception;
|
||||
private native void init() throws TJException;
|
||||
|
||||
private native void destroy() throws Exception;
|
||||
private native void destroy() throws TJException;
|
||||
|
||||
private native void decompressHeader(byte[] srcBuf, int size)
|
||||
throws Exception;
|
||||
throws TJException;
|
||||
|
||||
@Deprecated
|
||||
private native void decompress(byte[] srcBuf, int size, byte[] dstBuf,
|
||||
int desiredWidth, int pitch, int desiredHeight, int pixelFormat, int flags)
|
||||
throws Exception; // deprecated
|
||||
throws TJException;
|
||||
|
||||
private native void decompress(byte[] srcBuf, int size, byte[] dstBuf, int x,
|
||||
int y, int desiredWidth, int pitch, int desiredHeight, int pixelFormat,
|
||||
int flags) throws Exception;
|
||||
int flags) throws TJException;
|
||||
|
||||
@Deprecated
|
||||
private native void decompress(byte[] srcBuf, int size, int[] dstBuf,
|
||||
int desiredWidth, int stride, int desiredHeight, int pixelFormat,
|
||||
int flags) throws Exception; // deprecated
|
||||
int flags) throws TJException;
|
||||
|
||||
private native void decompress(byte[] srcBuf, int size, int[] dstBuf, int x,
|
||||
int y, int desiredWidth, int stride, int desiredHeight, int pixelFormat,
|
||||
int flags) throws Exception;
|
||||
int flags) throws TJException;
|
||||
|
||||
@Deprecated
|
||||
private native void decompressToYUV(byte[] srcBuf, int size, byte[] dstBuf,
|
||||
int flags) throws Exception; // deprecated
|
||||
int flags) throws TJException;
|
||||
|
||||
private native void decompressToYUV(byte[] srcBuf, int size,
|
||||
byte[][] dstPlanes, int[] dstOffsets, int desiredWidth, int[] dstStrides,
|
||||
int desiredheight, int flags) throws Exception;
|
||||
int desiredheight, int flags) throws TJException;
|
||||
|
||||
private native void decodeYUV(byte[][] srcPlanes, int[] srcOffsets,
|
||||
int[] srcStrides, int subsamp, byte[] dstBuf, int x, int y, int width,
|
||||
int pitch, int height, int pixelFormat, int flags) throws Exception;
|
||||
int pitch, int height, int pixelFormat, int flags) throws TJException;
|
||||
|
||||
private native void decodeYUV(byte[][] srcPlanes, int[] srcOffsets,
|
||||
int[] srcStrides, int subsamp, int[] dstBuf, int x, int y, int width,
|
||||
int stride, int height, int pixelFormat, int flags) throws Exception;
|
||||
int stride, int height, int pixelFormat, int flags) throws TJException;
|
||||
|
||||
static {
|
||||
TJLoader.load();
|
||||
@@ -898,4 +906,4 @@ public class TJDecompressor {
|
||||
protected int jpegSubsamp = -1;
|
||||
protected int jpegColorspace = -1;
|
||||
private ByteOrder byteOrder = null;
|
||||
};
|
||||
}
|
||||
|
||||
53
java/org/libjpegturbo/turbojpeg/TJException.java
Normal file
53
java/org/libjpegturbo/turbojpeg/TJException.java
Normal file
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (C)2015 Viktor Szathmáry. All Rights Reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* - Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* - Neither the name of the libjpeg-turbo Project nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from this
|
||||
* software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS",
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package org.libjpegturbo.turbojpeg;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class TJException extends IOException {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public TJException() {
|
||||
super();
|
||||
}
|
||||
|
||||
public TJException(String message, Throwable cause) {
|
||||
super(message, cause);
|
||||
}
|
||||
|
||||
public TJException(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
public TJException(Throwable cause) {
|
||||
super(cause);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -32,4 +32,4 @@ final class TJLoader {
|
||||
static void load() {
|
||||
System.loadLibrary("@TURBOJPEG_DLL_NAME@");
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -56,4 +56,4 @@ final class TJLoader {
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (C)2011 D. R. Commander. All Rights Reserved.
|
||||
* Copyright (C)2015 Viktor Szathmáry. All Rights Reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
@@ -33,9 +34,9 @@ package org.libjpegturbo.turbojpeg;
|
||||
*/
|
||||
public class TJScalingFactor {
|
||||
|
||||
public TJScalingFactor(int num, int denom) throws Exception {
|
||||
public TJScalingFactor(int num, int denom) {
|
||||
if (num < 1 || denom < 1)
|
||||
throw new Exception("Numerator and denominator must be >= 1");
|
||||
throw new IllegalArgumentException("Numerator and denominator must be >= 1");
|
||||
this.num = num;
|
||||
this.denom = denom;
|
||||
}
|
||||
@@ -77,7 +78,7 @@ public class TJScalingFactor {
|
||||
* <code>other</code> have the same numerator and denominator.
|
||||
*/
|
||||
public boolean equals(TJScalingFactor other) {
|
||||
return (this.num == other.num && this.denom == other.denom);
|
||||
return this.num == other.num && this.denom == other.denom;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -88,7 +89,7 @@ public class TJScalingFactor {
|
||||
* 1/1.
|
||||
*/
|
||||
public boolean isOne() {
|
||||
return (num == 1 && denom == 1);
|
||||
return num == 1 && denom == 1;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -100,4 +101,4 @@ public class TJScalingFactor {
|
||||
* Denominator
|
||||
*/
|
||||
private int denom = 1;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -160,7 +160,7 @@ public class TJTransform extends Rectangle {
|
||||
* TJCustomFilter} interface, or null if no custom filter is needed
|
||||
*/
|
||||
public TJTransform(int x, int y, int w, int h, int op, int options,
|
||||
TJCustomFilter cf) throws Exception {
|
||||
TJCustomFilter cf) {
|
||||
super(x, y, w, h);
|
||||
this.op = op;
|
||||
this.options = options;
|
||||
@@ -184,7 +184,7 @@ public class TJTransform extends Rectangle {
|
||||
* TJCustomFilter} interface, or null if no custom filter is needed
|
||||
*/
|
||||
public TJTransform(Rectangle r, int op, int options,
|
||||
TJCustomFilter cf) throws Exception {
|
||||
TJCustomFilter cf) {
|
||||
super(r);
|
||||
this.op = op;
|
||||
this.options = options;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (C)2011, 2013-2014 D. R. Commander. All Rights Reserved.
|
||||
* Copyright (C)2011, 2013-2015 D. R. Commander. All Rights Reserved.
|
||||
* Copyright (C)2015 Viktor Szathmáry. All Rights Reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
@@ -36,7 +37,7 @@ public class TJTransformer extends TJDecompressor {
|
||||
/**
|
||||
* Create a TurboJPEG lossless transformer instance.
|
||||
*/
|
||||
public TJTransformer() throws Exception {
|
||||
public TJTransformer() throws TJException {
|
||||
init();
|
||||
}
|
||||
|
||||
@@ -45,9 +46,9 @@ public class TJTransformer extends TJDecompressor {
|
||||
* image stored in <code>jpegImage</code> with the newly created instance.
|
||||
*
|
||||
* @param jpegImage JPEG image buffer (size of the JPEG image is assumed to
|
||||
* be the length of the array)
|
||||
* be the length of the array.) This buffer is not modified.
|
||||
*/
|
||||
public TJTransformer(byte[] jpegImage) throws Exception {
|
||||
public TJTransformer(byte[] jpegImage) throws TJException {
|
||||
init();
|
||||
setSourceImage(jpegImage, jpegImage.length);
|
||||
}
|
||||
@@ -57,11 +58,11 @@ public class TJTransformer extends TJDecompressor {
|
||||
* image of length <code>imageSize</code> bytes stored in
|
||||
* <code>jpegImage</code> with the newly created instance.
|
||||
*
|
||||
* @param jpegImage JPEG image buffer
|
||||
* @param jpegImage JPEG image buffer. This buffer is not modified.
|
||||
*
|
||||
* @param imageSize size of the JPEG image (in bytes)
|
||||
*/
|
||||
public TJTransformer(byte[] jpegImage, int imageSize) throws Exception {
|
||||
public TJTransformer(byte[] jpegImage, int imageSize) throws TJException {
|
||||
init();
|
||||
setSourceImage(jpegImage, imageSize);
|
||||
}
|
||||
@@ -94,9 +95,9 @@ public class TJTransformer extends TJDecompressor {
|
||||
* {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*}
|
||||
*/
|
||||
public void transform(byte[][] dstBufs, TJTransform[] transforms,
|
||||
int flags) throws Exception {
|
||||
int flags) throws TJException {
|
||||
if (jpegBuf == null)
|
||||
throw new Exception("JPEG buffer not initialized");
|
||||
throw new IllegalStateException("JPEG buffer not initialized");
|
||||
transformedSizes = transform(jpegBuf, jpegBufSize, dstBufs, transforms,
|
||||
flags);
|
||||
}
|
||||
@@ -117,10 +118,10 @@ public class TJTransformer extends TJDecompressor {
|
||||
* {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*}
|
||||
*/
|
||||
public TJDecompressor[] transform(TJTransform[] transforms, int flags)
|
||||
throws Exception {
|
||||
throws TJException {
|
||||
byte[][] dstBufs = new byte[transforms.length][];
|
||||
if (jpegWidth < 1 || jpegHeight < 1)
|
||||
throw new Exception("JPEG buffer not initialized");
|
||||
throw new IllegalStateException("JPEG buffer not initialized");
|
||||
for (int i = 0; i < transforms.length; i++) {
|
||||
int w = jpegWidth, h = jpegHeight;
|
||||
if ((transforms[i].options & TJTransform.OPT_CROP) != 0) {
|
||||
@@ -143,20 +144,20 @@ public class TJTransformer extends TJDecompressor {
|
||||
* @return an array containing the sizes of the transformed JPEG images
|
||||
* generated by the most recent transform operation.
|
||||
*/
|
||||
public int[] getTransformedSizes() throws Exception {
|
||||
public int[] getTransformedSizes() {
|
||||
if (transformedSizes == null)
|
||||
throw new Exception("No image has been transformed yet");
|
||||
throw new IllegalStateException("No image has been transformed yet");
|
||||
return transformedSizes;
|
||||
}
|
||||
|
||||
private native void init() throws Exception;
|
||||
private native void init() throws TJException;
|
||||
|
||||
private native int[] transform(byte[] srcBuf, int srcSize, byte[][] dstBufs,
|
||||
TJTransform[] transforms, int flags) throws Exception;
|
||||
TJTransform[] transforms, int flags) throws TJException;
|
||||
|
||||
static {
|
||||
TJLoader.load();
|
||||
}
|
||||
|
||||
private int[] transformedSizes = null;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (C)2014 D. R. Commander. All Rights Reserved.
|
||||
* Copyright (C)2015 Viktor Szathmáry. All Rights Reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
@@ -86,8 +87,7 @@ public class YUVImage {
|
||||
* @param subsamp the level of chrominance subsampling to be used in the YUV
|
||||
* image (one of {@link TJ#SAMP_444 TJ.SAMP_*})
|
||||
*/
|
||||
public YUVImage(int width, int[] strides, int height, int subsamp)
|
||||
throws Exception {
|
||||
public YUVImage(int width, int[] strides, int height, int subsamp) {
|
||||
setBuf(null, null, width, strides, height, subsamp, true);
|
||||
}
|
||||
|
||||
@@ -105,8 +105,7 @@ public class YUVImage {
|
||||
* @param subsamp the level of chrominance subsampling to be used in the YUV
|
||||
* image (one of {@link TJ#SAMP_444 TJ.SAMP_*})
|
||||
*/
|
||||
public YUVImage(int width, int pad, int height, int subsamp)
|
||||
throws Exception {
|
||||
public YUVImage(int width, int pad, int height, int subsamp) {
|
||||
setBuf(new byte[TJ.bufSizeYUV(width, pad, height, subsamp)], width, pad,
|
||||
height, subsamp);
|
||||
}
|
||||
@@ -146,7 +145,7 @@ public class YUVImage {
|
||||
* image (one of {@link TJ#SAMP_444 TJ.SAMP_*})
|
||||
*/
|
||||
public YUVImage(byte[][] planes, int[] offsets, int width, int[] strides,
|
||||
int height, int subsamp) throws Exception {
|
||||
int height, int subsamp) {
|
||||
setBuf(planes, offsets, width, strides, height, subsamp, false);
|
||||
}
|
||||
|
||||
@@ -172,7 +171,7 @@ public class YUVImage {
|
||||
* image (one of {@link TJ#SAMP_444 TJ.SAMP_*})
|
||||
*/
|
||||
public YUVImage(byte[] yuvImage, int width, int pad, int height,
|
||||
int subsamp) throws Exception {
|
||||
int subsamp) {
|
||||
setBuf(yuvImage, width, pad, height, subsamp);
|
||||
}
|
||||
|
||||
@@ -210,20 +209,20 @@ public class YUVImage {
|
||||
* image (one of {@link TJ#SAMP_444 TJ.SAMP_*})
|
||||
*/
|
||||
public void setBuf(byte[][] planes, int[] offsets, int width, int strides[],
|
||||
int height, int subsamp) throws Exception {
|
||||
int height, int subsamp) {
|
||||
setBuf(planes, offsets, width, strides, height, subsamp, false);
|
||||
}
|
||||
|
||||
private void setBuf(byte[][] planes, int[] offsets, int width, int strides[],
|
||||
int height, int subsamp, boolean alloc) throws Exception {
|
||||
int height, int subsamp, boolean alloc) {
|
||||
if ((planes == null && !alloc) || width < 1 || height < 1 || subsamp < 0 ||
|
||||
subsamp >= TJ.NUMSAMP)
|
||||
throw new Exception("Invalid argument in YUVImage::setBuf()");
|
||||
throw new IllegalArgumentException("Invalid argument in YUVImage::setBuf()");
|
||||
|
||||
int nc = (subsamp == TJ.SAMP_GRAY ? 1 : 3);
|
||||
if (planes.length != nc || (offsets != null && offsets.length != nc) ||
|
||||
(strides != null && strides.length != nc))
|
||||
throw new Exception("YUVImage::setBuf(): planes, offsets, or strides array is the wrong size");
|
||||
throw new IllegalArgumentException("YUVImage::setBuf(): planes, offsets, or strides array is the wrong size");
|
||||
|
||||
if (offsets == null)
|
||||
offsets = new int[nc];
|
||||
@@ -239,15 +238,15 @@ public class YUVImage {
|
||||
strides[i] = pw;
|
||||
if (alloc) {
|
||||
if (strides[i] < pw)
|
||||
throw new Exception("Stride must be >= plane width when allocating a new YUV image");
|
||||
throw new IllegalArgumentException("Stride must be >= plane width when allocating a new YUV image");
|
||||
planes[i] = new byte[strides[i] * ph];
|
||||
}
|
||||
if (planes[i] == null || offsets[i] < 0)
|
||||
throw new Exception("Invalid argument in YUVImage::setBuf()");
|
||||
throw new IllegalArgumentException("Invalid argument in YUVImage::setBuf()");
|
||||
if (strides[i] < 0 && offsets[i] - planeSize + pw < 0)
|
||||
throw new Exception("Stride for plane " + i + " would cause memory to be accessed below plane boundary");
|
||||
throw new IllegalArgumentException("Stride for plane " + i + " would cause memory to be accessed below plane boundary");
|
||||
if (planes[i].length < offsets[i] + planeSize)
|
||||
throw new Exception("Image plane " + i + " is not large enough");
|
||||
throw new IllegalArgumentException("Image plane " + i + " is not large enough");
|
||||
}
|
||||
|
||||
yuvPlanes = planes;
|
||||
@@ -279,13 +278,13 @@ public class YUVImage {
|
||||
* image (one of {@link TJ#SAMP_444 TJ.SAMP_*})
|
||||
*/
|
||||
public void setBuf(byte[] yuvImage, int width, int pad, int height,
|
||||
int subsamp) throws Exception {
|
||||
int subsamp) {
|
||||
if (yuvImage == null || width < 1 || pad < 1 || ((pad & (pad - 1)) != 0) ||
|
||||
height < 1 || subsamp < 0 || subsamp >= TJ.NUMSAMP)
|
||||
throw new Exception("Invalid argument in YUVImage::setBuf()");
|
||||
throw new IllegalArgumentException("Invalid argument in YUVImage::setBuf()");
|
||||
if (yuvImage.length < TJ.bufSizeYUV(width, pad, height, subsamp))
|
||||
throw new Exception("YUV image buffer is not large enough");
|
||||
|
||||
throw new IllegalArgumentException("YUV image buffer is not large enough");
|
||||
|
||||
int nc = (subsamp == TJ.SAMP_GRAY ? 1 : 3);
|
||||
byte[][] planes = new byte[nc][];
|
||||
int[] strides = new int[nc];
|
||||
@@ -311,9 +310,9 @@ public class YUVImage {
|
||||
*
|
||||
* @return the width of the YUV image (or subregion)
|
||||
*/
|
||||
public int getWidth() throws Exception {
|
||||
public int getWidth() {
|
||||
if (yuvWidth < 1)
|
||||
throw new Exception(NO_ASSOC_ERROR);
|
||||
throw new IllegalStateException(NO_ASSOC_ERROR);
|
||||
return yuvWidth;
|
||||
}
|
||||
|
||||
@@ -322,9 +321,9 @@ public class YUVImage {
|
||||
*
|
||||
* @return the height of the YUV image (or subregion)
|
||||
*/
|
||||
public int getHeight() throws Exception {
|
||||
public int getHeight() {
|
||||
if (yuvHeight < 1)
|
||||
throw new Exception(NO_ASSOC_ERROR);
|
||||
throw new IllegalStateException(NO_ASSOC_ERROR);
|
||||
return yuvHeight;
|
||||
}
|
||||
|
||||
@@ -334,11 +333,11 @@ public class YUVImage {
|
||||
*
|
||||
* @return the line padding used in the YUV image buffer
|
||||
*/
|
||||
public int getPad() throws Exception {
|
||||
public int getPad() {
|
||||
if (yuvPlanes == null)
|
||||
throw new Exception(NO_ASSOC_ERROR);
|
||||
throw new IllegalStateException(NO_ASSOC_ERROR);
|
||||
if (yuvPad < 1 || ((yuvPad & (yuvPad - 1)) != 0))
|
||||
throw new Exception("Image is not stored in a unified buffer");
|
||||
throw new IllegalStateException("Image is not stored in a unified buffer");
|
||||
return yuvPad;
|
||||
}
|
||||
|
||||
@@ -347,9 +346,9 @@ public class YUVImage {
|
||||
*
|
||||
* @return the number of bytes per line of each plane in the YUV image
|
||||
*/
|
||||
public int[] getStrides() throws Exception {
|
||||
public int[] getStrides() {
|
||||
if (yuvStrides == null)
|
||||
throw new Exception(NO_ASSOC_ERROR);
|
||||
throw new IllegalStateException(NO_ASSOC_ERROR);
|
||||
return yuvStrides;
|
||||
}
|
||||
|
||||
@@ -360,9 +359,9 @@ public class YUVImage {
|
||||
* @return the offsets (in bytes) of each plane within the planes of a larger
|
||||
* YUV image
|
||||
*/
|
||||
public int[] getOffsets() throws Exception {
|
||||
public int[] getOffsets() {
|
||||
if (yuvOffsets == null)
|
||||
throw new Exception(NO_ASSOC_ERROR);
|
||||
throw new IllegalStateException(NO_ASSOC_ERROR);
|
||||
return yuvOffsets;
|
||||
}
|
||||
|
||||
@@ -372,9 +371,9 @@ public class YUVImage {
|
||||
*
|
||||
* @return the level of chrominance subsampling used in the YUV image
|
||||
*/
|
||||
public int getSubsamp() throws Exception {
|
||||
public int getSubsamp() {
|
||||
if (yuvSubsamp < 0 || yuvSubsamp >= TJ.NUMSAMP)
|
||||
throw new Exception(NO_ASSOC_ERROR);
|
||||
throw new IllegalStateException(NO_ASSOC_ERROR);
|
||||
return yuvSubsamp;
|
||||
}
|
||||
|
||||
@@ -384,9 +383,9 @@ public class YUVImage {
|
||||
*
|
||||
* @return the YUV image planes
|
||||
*/
|
||||
public byte[][] getPlanes() throws Exception {
|
||||
public byte[][] getPlanes() {
|
||||
if (yuvPlanes == null)
|
||||
throw new Exception(NO_ASSOC_ERROR);
|
||||
throw new IllegalStateException(NO_ASSOC_ERROR);
|
||||
return yuvPlanes;
|
||||
}
|
||||
|
||||
@@ -396,13 +395,13 @@ public class YUVImage {
|
||||
*
|
||||
* @return the YUV image buffer
|
||||
*/
|
||||
public byte[] getBuf() throws Exception {
|
||||
public byte[] getBuf() {
|
||||
if (yuvPlanes == null || yuvSubsamp < 0 || yuvSubsamp >= TJ.NUMSAMP)
|
||||
throw new Exception(NO_ASSOC_ERROR);
|
||||
throw new IllegalStateException(NO_ASSOC_ERROR);
|
||||
int nc = (yuvSubsamp == TJ.SAMP_GRAY ? 1 : 3);
|
||||
for (int i = 1; i < nc; i++) {
|
||||
if (yuvPlanes[i] != yuvPlanes[0])
|
||||
throw new Exception("Image is not stored in a unified buffer");
|
||||
throw new IllegalStateException("Image is not stored in a unified buffer");
|
||||
}
|
||||
return yuvPlanes[0];
|
||||
}
|
||||
@@ -413,15 +412,15 @@ public class YUVImage {
|
||||
*
|
||||
* @return the size (in bytes) of the YUV image buffer
|
||||
*/
|
||||
public int getSize() throws Exception {
|
||||
public int getSize() {
|
||||
if (yuvPlanes == null || yuvSubsamp < 0 || yuvSubsamp >= TJ.NUMSAMP)
|
||||
throw new Exception(NO_ASSOC_ERROR);
|
||||
throw new IllegalStateException(NO_ASSOC_ERROR);
|
||||
int nc = (yuvSubsamp == TJ.SAMP_GRAY ? 1 : 3);
|
||||
if (yuvPad < 1)
|
||||
throw new Exception("Image is not stored in a unified buffer");
|
||||
throw new IllegalStateException("Image is not stored in a unified buffer");
|
||||
for (int i = 1; i < nc; i++) {
|
||||
if (yuvPlanes[i] != yuvPlanes[0])
|
||||
throw new Exception("Image is not stored in a unified buffer");
|
||||
throw new IllegalStateException("Image is not stored in a unified buffer");
|
||||
}
|
||||
return TJ.bufSizeYUV(yuvWidth, yuvPad, yuvHeight, yuvSubsamp);
|
||||
}
|
||||
@@ -438,4 +437,4 @@ public class YUVImage {
|
||||
protected int yuvWidth = 0;
|
||||
protected int yuvHeight = 0;
|
||||
protected int yuvSubsamp = -1;
|
||||
};
|
||||
}
|
||||
|
||||
11
jcapimin.c
11
jcapimin.c
@@ -6,7 +6,8 @@
|
||||
* Modified 2003-2010 by Guido Vollbeding.
|
||||
* It was modified by The libjpeg-turbo Project to include only code relevant
|
||||
* to libjpeg-turbo.
|
||||
* For conditions of distribution and use, see the accompanying README file.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
* This file contains application interface code for the compression half
|
||||
* of the JPEG library. These are the "minimum" API routines that may be
|
||||
@@ -49,8 +50,8 @@ jpeg_CreateCompress (j_compress_ptr cinfo, int version, size_t structsize)
|
||||
* complain here.
|
||||
*/
|
||||
{
|
||||
struct jpeg_error_mgr * err = cinfo->err;
|
||||
void * client_data = cinfo->client_data; /* ignore Purify complaint here */
|
||||
struct jpeg_error_mgr *err = cinfo->err;
|
||||
void *client_data = cinfo->client_data; /* ignore Purify complaint here */
|
||||
MEMZERO(cinfo, sizeof(struct jpeg_compress_struct));
|
||||
cinfo->err = err;
|
||||
cinfo->client_data = client_data;
|
||||
@@ -133,8 +134,8 @@ GLOBAL(void)
|
||||
jpeg_suppress_tables (j_compress_ptr cinfo, boolean suppress)
|
||||
{
|
||||
int i;
|
||||
JQUANT_TBL * qtbl;
|
||||
JHUFF_TBL * htbl;
|
||||
JQUANT_TBL *qtbl;
|
||||
JHUFF_TBL *htbl;
|
||||
|
||||
for (i = 0; i < NUM_QUANT_TBLS; i++) {
|
||||
if ((qtbl = cinfo->quant_tbl_ptrs[i]) != NULL)
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
*
|
||||
* Copyright (C) 1994-1996, Thomas G. Lane.
|
||||
* This file is part of the Independent JPEG Group's software.
|
||||
* For conditions of distribution and use, see the accompanying README file.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
* This file contains application interface code for the compression half
|
||||
* of the JPEG library. These are the "standard" API routines that are
|
||||
|
||||
37
jcarith.c
37
jcarith.c
@@ -3,9 +3,10 @@
|
||||
*
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Developed 1997-2009 by Guido Vollbeding.
|
||||
* It was modified by The libjpeg-turbo Project to include only code relevant
|
||||
* to libjpeg-turbo.
|
||||
* For conditions of distribution and use, see the accompanying README file.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2015, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
* This file contains portable arithmetic entropy encoding routines for JPEG
|
||||
* (implementing the ISO/IEC IS 10918-1 and CCITT Recommendation ITU-T T.81).
|
||||
@@ -25,10 +26,10 @@
|
||||
typedef struct {
|
||||
struct jpeg_entropy_encoder pub; /* public fields */
|
||||
|
||||
INT32 c; /* C register, base of coding interval, layout as in sec. D.1.3 */
|
||||
INT32 a; /* A register, normalized size of coding interval */
|
||||
INT32 sc; /* counter for stacked 0xFF values which might overflow */
|
||||
INT32 zc; /* counter for pending 0x00 output values which might *
|
||||
JLONG c; /* C register, base of coding interval, layout as in sec. D.1.3 */
|
||||
JLONG a; /* A register, normalized size of coding interval */
|
||||
JLONG sc; /* counter for stacked 0xFF values which might overflow */
|
||||
JLONG zc; /* counter for pending 0x00 output values which might *
|
||||
* be discarded at the end ("Pacman" termination) */
|
||||
int ct; /* bit shift counter, determines when next byte will be written */
|
||||
int buffer; /* buffer for most recent output byte != 0xFF */
|
||||
@@ -40,14 +41,14 @@ typedef struct {
|
||||
int next_restart_num; /* next restart number to write (0-7) */
|
||||
|
||||
/* Pointers to statistics areas (these workspaces have image lifespan) */
|
||||
unsigned char * dc_stats[NUM_ARITH_TBLS];
|
||||
unsigned char * ac_stats[NUM_ARITH_TBLS];
|
||||
unsigned char *dc_stats[NUM_ARITH_TBLS];
|
||||
unsigned char *ac_stats[NUM_ARITH_TBLS];
|
||||
|
||||
/* Statistics bin for coding with fixed probability 0.5 */
|
||||
unsigned char fixed_bin[4];
|
||||
} arith_entropy_encoder;
|
||||
|
||||
typedef arith_entropy_encoder * arith_entropy_ptr;
|
||||
typedef arith_entropy_encoder *arith_entropy_ptr;
|
||||
|
||||
/* The following two definitions specify the allocation chunk size
|
||||
* for the statistics area.
|
||||
@@ -97,8 +98,8 @@ typedef arith_entropy_encoder * arith_entropy_ptr;
|
||||
#define CALCULATE_SPECTRAL_CONDITIONING
|
||||
*/
|
||||
|
||||
/* IRIGHT_SHIFT is like RIGHT_SHIFT, but works on int rather than INT32.
|
||||
* We assume that int right shift is unsigned if INT32 right shift is,
|
||||
/* IRIGHT_SHIFT is like RIGHT_SHIFT, but works on int rather than JLONG.
|
||||
* We assume that int right shift is unsigned if JLONG right shift is,
|
||||
* which should be safe.
|
||||
*/
|
||||
|
||||
@@ -118,7 +119,7 @@ LOCAL(void)
|
||||
emit_byte (int val, j_compress_ptr cinfo)
|
||||
/* Write next output byte; we do not support suspension in this module. */
|
||||
{
|
||||
struct jpeg_destination_mgr * dest = cinfo->dest;
|
||||
struct jpeg_destination_mgr *dest = cinfo->dest;
|
||||
|
||||
*dest->next_output_byte++ = (JOCTET) val;
|
||||
if (--dest->free_in_buffer == 0)
|
||||
@@ -135,7 +136,7 @@ METHODDEF(void)
|
||||
finish_pass (j_compress_ptr cinfo)
|
||||
{
|
||||
arith_entropy_ptr e = (arith_entropy_ptr) cinfo->entropy;
|
||||
INT32 temp;
|
||||
JLONG temp;
|
||||
|
||||
/* Section D.1.8: Termination of encoding */
|
||||
|
||||
@@ -222,7 +223,7 @@ arith_encode (j_compress_ptr cinfo, unsigned char *st, int val)
|
||||
{
|
||||
register arith_entropy_ptr e = (arith_entropy_ptr) cinfo->entropy;
|
||||
register unsigned char nl, nm;
|
||||
register INT32 qe, temp;
|
||||
register JLONG qe, temp;
|
||||
register int sv;
|
||||
|
||||
/* Fetch values from our compact representation of Table D.2:
|
||||
@@ -322,7 +323,7 @@ emit_restart (j_compress_ptr cinfo, int restart_num)
|
||||
{
|
||||
arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;
|
||||
int ci;
|
||||
jpeg_component_info * compptr;
|
||||
jpeg_component_info *compptr;
|
||||
|
||||
finish_pass(cinfo);
|
||||
|
||||
@@ -682,7 +683,7 @@ METHODDEF(boolean)
|
||||
encode_mcu (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
|
||||
{
|
||||
arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;
|
||||
jpeg_component_info * compptr;
|
||||
jpeg_component_info *compptr;
|
||||
JBLOCKROW block;
|
||||
unsigned char *st;
|
||||
int blkn, ci, tbl, k, ke;
|
||||
@@ -825,7 +826,7 @@ start_pass (j_compress_ptr cinfo, boolean gather_statistics)
|
||||
{
|
||||
arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;
|
||||
int ci, tbl;
|
||||
jpeg_component_info * compptr;
|
||||
jpeg_component_info *compptr;
|
||||
|
||||
if (gather_statistics)
|
||||
/* Make sure to avoid that in the master control logic!
|
||||
|
||||
@@ -5,7 +5,8 @@
|
||||
* Copyright (C) 1994-1997, Thomas G. Lane.
|
||||
* It was modified by The libjpeg-turbo Project to include only code and
|
||||
* information relevant to libjpeg-turbo.
|
||||
* For conditions of distribution and use, see the accompanying README file.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
* This file contains the coefficient buffer controller for compression.
|
||||
* This controller is the top level of the JPEG compressor proper.
|
||||
@@ -53,7 +54,7 @@ typedef struct {
|
||||
jvirt_barray_ptr whole_image[MAX_COMPONENTS];
|
||||
} my_coef_controller;
|
||||
|
||||
typedef my_coef_controller * my_coef_ptr;
|
||||
typedef my_coef_controller *my_coef_ptr;
|
||||
|
||||
|
||||
/* Forward declarations */
|
||||
|
||||
@@ -4,8 +4,9 @@
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1991-1996, Thomas G. Lane.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2009-2012, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README file.
|
||||
* Copyright (C) 2009-2012, 2015, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
* This file contains input colorspace conversion routines.
|
||||
*/
|
||||
@@ -34,7 +35,7 @@ rgb_ycc_convert_internal (j_compress_ptr cinfo,
|
||||
{
|
||||
my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;
|
||||
register int r, g, b;
|
||||
register INT32 * ctab = cconvert->rgb_ycc_tab;
|
||||
register JLONG * ctab = cconvert->rgb_ycc_tab;
|
||||
register JSAMPROW inptr;
|
||||
register JSAMPROW outptr0, outptr1, outptr2;
|
||||
register JDIMENSION col;
|
||||
@@ -91,7 +92,7 @@ rgb_gray_convert_internal (j_compress_ptr cinfo,
|
||||
{
|
||||
my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;
|
||||
register int r, g, b;
|
||||
register INT32 * ctab = cconvert->rgb_ycc_tab;
|
||||
register JLONG * ctab = cconvert->rgb_ycc_tab;
|
||||
register JSAMPROW inptr;
|
||||
register JSAMPROW outptr;
|
||||
register JDIMENSION col;
|
||||
|
||||
27
jccolor.c
27
jccolor.c
@@ -5,9 +5,10 @@
|
||||
* Copyright (C) 1991-1996, Thomas G. Lane.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
|
||||
* Copyright (C) 2009-2012, 2015 D. R. Commander.
|
||||
* Copyright (C) 2014, MIPS Technologies, Inc., California
|
||||
* For conditions of distribution and use, see the accompanying README file.
|
||||
* Copyright (C) 2009-2012, 2015, D. R. Commander.
|
||||
* Copyright (C) 2014, MIPS Technologies, Inc., California.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
* This file contains input colorspace conversion routines.
|
||||
*/
|
||||
@@ -25,10 +26,10 @@ typedef struct {
|
||||
struct jpeg_color_converter pub; /* public fields */
|
||||
|
||||
/* Private state for RGB->YCC conversion */
|
||||
INT32 * rgb_ycc_tab; /* => table for RGB to YCbCr conversion */
|
||||
JLONG *rgb_ycc_tab; /* => table for RGB to YCbCr conversion */
|
||||
} my_color_converter;
|
||||
|
||||
typedef my_color_converter * my_cconvert_ptr;
|
||||
typedef my_color_converter *my_cconvert_ptr;
|
||||
|
||||
|
||||
/**************** RGB -> YCbCr conversion: most common case **************/
|
||||
@@ -62,9 +63,9 @@ typedef my_color_converter * my_cconvert_ptr;
|
||||
*/
|
||||
|
||||
#define SCALEBITS 16 /* speediest right-shift on some machines */
|
||||
#define CBCR_OFFSET ((INT32) CENTERJSAMPLE << SCALEBITS)
|
||||
#define ONE_HALF ((INT32) 1 << (SCALEBITS-1))
|
||||
#define FIX(x) ((INT32) ((x) * (1L<<SCALEBITS) + 0.5))
|
||||
#define CBCR_OFFSET ((JLONG) CENTERJSAMPLE << SCALEBITS)
|
||||
#define ONE_HALF ((JLONG) 1 << (SCALEBITS-1))
|
||||
#define FIX(x) ((JLONG) ((x) * (1L<<SCALEBITS) + 0.5))
|
||||
|
||||
/* We allocate one big table and divide it up into eight parts, instead of
|
||||
* doing eight alloc_small requests. This lets us use a single table base
|
||||
@@ -197,13 +198,13 @@ METHODDEF(void)
|
||||
rgb_ycc_start (j_compress_ptr cinfo)
|
||||
{
|
||||
my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;
|
||||
INT32 * rgb_ycc_tab;
|
||||
INT32 i;
|
||||
JLONG *rgb_ycc_tab;
|
||||
JLONG i;
|
||||
|
||||
/* Allocate and fill in the conversion tables. */
|
||||
cconvert->rgb_ycc_tab = rgb_ycc_tab = (INT32 *)
|
||||
cconvert->rgb_ycc_tab = rgb_ycc_tab = (JLONG *)
|
||||
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
|
||||
(TABLE_SIZE * sizeof(INT32)));
|
||||
(TABLE_SIZE * sizeof(JLONG)));
|
||||
|
||||
for (i = 0; i <= MAXJSAMPLE; i++) {
|
||||
rgb_ycc_tab[i+R_Y_OFF] = FIX(0.29900) * i;
|
||||
@@ -381,7 +382,7 @@ cmyk_ycck_convert (j_compress_ptr cinfo,
|
||||
{
|
||||
my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;
|
||||
register int r, g, b;
|
||||
register INT32 * ctab = cconvert->rgb_ycc_tab;
|
||||
register JLONG *ctab = cconvert->rgb_ycc_tab;
|
||||
register JSAMPROW inptr;
|
||||
register JSAMPROW outptr0, outptr1, outptr2, outptr3;
|
||||
register JDIMENSION col;
|
||||
|
||||
99
jcdctmgr.c
99
jcdctmgr.c
@@ -6,8 +6,9 @@
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 1999-2006, MIYASAKA Masaru.
|
||||
* Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
|
||||
* Copyright (C) 2011, 2014 D. R. Commander
|
||||
* For conditions of distribution and use, see the accompanying README file.
|
||||
* Copyright (C) 2011, 2014-2015, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
* This file contains the forward-DCT management logic.
|
||||
* This code selects a particular DCT implementation to be used,
|
||||
@@ -24,21 +25,21 @@
|
||||
|
||||
/* Private subobject for this module */
|
||||
|
||||
typedef void (*forward_DCT_method_ptr) (DCTELEM * data);
|
||||
typedef void (*float_DCT_method_ptr) (FAST_FLOAT * data);
|
||||
typedef void (*forward_DCT_method_ptr) (DCTELEM *data);
|
||||
typedef void (*float_DCT_method_ptr) (FAST_FLOAT *data);
|
||||
|
||||
typedef void (*convsamp_method_ptr) (JSAMPARRAY sample_data,
|
||||
JDIMENSION start_col,
|
||||
DCTELEM * workspace);
|
||||
DCTELEM *workspace);
|
||||
typedef void (*float_convsamp_method_ptr) (JSAMPARRAY sample_data,
|
||||
JDIMENSION start_col,
|
||||
FAST_FLOAT *workspace);
|
||||
|
||||
typedef void (*quantize_method_ptr) (JCOEFPTR coef_block, DCTELEM * divisors,
|
||||
DCTELEM * workspace);
|
||||
typedef void (*quantize_method_ptr) (JCOEFPTR coef_block, DCTELEM *divisors,
|
||||
DCTELEM *workspace);
|
||||
typedef void (*float_quantize_method_ptr) (JCOEFPTR coef_block,
|
||||
FAST_FLOAT * divisors,
|
||||
FAST_FLOAT * workspace);
|
||||
FAST_FLOAT *divisors,
|
||||
FAST_FLOAT *workspace);
|
||||
|
||||
METHODDEF(void) quantize (JCOEFPTR, DCTELEM *, DCTELEM *);
|
||||
|
||||
@@ -54,22 +55,22 @@ typedef struct {
|
||||
* entries, because of scaling (especially for an unnormalized DCT).
|
||||
* Each table is given in normal array order.
|
||||
*/
|
||||
DCTELEM * divisors[NUM_QUANT_TBLS];
|
||||
DCTELEM *divisors[NUM_QUANT_TBLS];
|
||||
|
||||
/* work area for FDCT subroutine */
|
||||
DCTELEM * workspace;
|
||||
DCTELEM *workspace;
|
||||
|
||||
#ifdef DCT_FLOAT_SUPPORTED
|
||||
/* Same as above for the floating-point case. */
|
||||
float_DCT_method_ptr float_dct;
|
||||
float_convsamp_method_ptr float_convsamp;
|
||||
float_quantize_method_ptr float_quantize;
|
||||
FAST_FLOAT * float_divisors[NUM_QUANT_TBLS];
|
||||
FAST_FLOAT * float_workspace;
|
||||
FAST_FLOAT *float_divisors[NUM_QUANT_TBLS];
|
||||
FAST_FLOAT *float_workspace;
|
||||
#endif
|
||||
} my_fdct_controller;
|
||||
|
||||
typedef my_fdct_controller * my_fdct_ptr;
|
||||
typedef my_fdct_controller *my_fdct_ptr;
|
||||
|
||||
|
||||
#if BITS_IN_JSAMPLE == 8
|
||||
@@ -169,12 +170,25 @@ flss (UINT16 val)
|
||||
*/
|
||||
|
||||
LOCAL(int)
|
||||
compute_reciprocal (UINT16 divisor, DCTELEM * dtbl)
|
||||
compute_reciprocal (UINT16 divisor, DCTELEM *dtbl)
|
||||
{
|
||||
UDCTELEM2 fq, fr;
|
||||
UDCTELEM c;
|
||||
int b, r;
|
||||
|
||||
if (divisor == 1) {
|
||||
/* divisor == 1 means unquantized, so these reciprocal/correction/shift
|
||||
* values will cause the C quantization algorithm to act like the
|
||||
* identity function. Since only the C quantization algorithm is used in
|
||||
* these cases, the scale value is irrelevant.
|
||||
*/
|
||||
dtbl[DCTSIZE2 * 0] = (DCTELEM) 1; /* reciprocal */
|
||||
dtbl[DCTSIZE2 * 1] = (DCTELEM) 0; /* correction */
|
||||
dtbl[DCTSIZE2 * 2] = (DCTELEM) 1; /* scale */
|
||||
dtbl[DCTSIZE2 * 3] = -(DCTELEM) (sizeof(DCTELEM) * 8); /* shift */
|
||||
return 0;
|
||||
}
|
||||
|
||||
b = flss(divisor) - 1;
|
||||
r = sizeof(DCTELEM) * 8 + b;
|
||||
|
||||
@@ -195,7 +209,11 @@ compute_reciprocal (UINT16 divisor, DCTELEM * dtbl)
|
||||
|
||||
dtbl[DCTSIZE2 * 0] = (DCTELEM) fq; /* reciprocal */
|
||||
dtbl[DCTSIZE2 * 1] = (DCTELEM) c; /* correction + roundfactor */
|
||||
#ifdef WITH_SIMD
|
||||
dtbl[DCTSIZE2 * 2] = (DCTELEM) (1 << (sizeof(DCTELEM)*8*2 - r)); /* scale */
|
||||
#else
|
||||
dtbl[DCTSIZE2 * 2] = 1;
|
||||
#endif
|
||||
dtbl[DCTSIZE2 * 3] = (DCTELEM) r - sizeof(DCTELEM)*8; /* shift */
|
||||
|
||||
if(r <= 16) return 0;
|
||||
@@ -220,8 +238,8 @@ start_pass_fdctmgr (j_compress_ptr cinfo)
|
||||
my_fdct_ptr fdct = (my_fdct_ptr) cinfo->fdct;
|
||||
int ci, qtblno, i;
|
||||
jpeg_component_info *compptr;
|
||||
JQUANT_TBL * qtbl;
|
||||
DCTELEM * dtbl;
|
||||
JQUANT_TBL *qtbl;
|
||||
DCTELEM *dtbl;
|
||||
|
||||
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
|
||||
ci++, compptr++) {
|
||||
@@ -247,8 +265,8 @@ start_pass_fdctmgr (j_compress_ptr cinfo)
|
||||
dtbl = fdct->divisors[qtblno];
|
||||
for (i = 0; i < DCTSIZE2; i++) {
|
||||
#if BITS_IN_JSAMPLE == 8
|
||||
if(!compute_reciprocal(qtbl->quantval[i] << 3, &dtbl[i])
|
||||
&& fdct->quantize == jsimd_quantize)
|
||||
if (!compute_reciprocal(qtbl->quantval[i] << 3, &dtbl[i]) &&
|
||||
fdct->quantize == jsimd_quantize)
|
||||
fdct->quantize = quantize;
|
||||
#else
|
||||
dtbl[i] = ((DCTELEM) qtbl->quantval[i]) << 3;
|
||||
@@ -287,16 +305,16 @@ start_pass_fdctmgr (j_compress_ptr cinfo)
|
||||
dtbl = fdct->divisors[qtblno];
|
||||
for (i = 0; i < DCTSIZE2; i++) {
|
||||
#if BITS_IN_JSAMPLE == 8
|
||||
if(!compute_reciprocal(
|
||||
DESCALE(MULTIPLY16V16((INT32) qtbl->quantval[i],
|
||||
(INT32) aanscales[i]),
|
||||
CONST_BITS-3), &dtbl[i])
|
||||
&& fdct->quantize == jsimd_quantize)
|
||||
if (!compute_reciprocal(
|
||||
DESCALE(MULTIPLY16V16((JLONG) qtbl->quantval[i],
|
||||
(JLONG) aanscales[i]),
|
||||
CONST_BITS-3), &dtbl[i]) &&
|
||||
fdct->quantize == jsimd_quantize)
|
||||
fdct->quantize = quantize;
|
||||
#else
|
||||
dtbl[i] = (DCTELEM)
|
||||
DESCALE(MULTIPLY16V16((INT32) qtbl->quantval[i],
|
||||
(INT32) aanscales[i]),
|
||||
DESCALE(MULTIPLY16V16((JLONG) qtbl->quantval[i],
|
||||
(JLONG) aanscales[i]),
|
||||
CONST_BITS-3);
|
||||
#endif
|
||||
}
|
||||
@@ -314,7 +332,7 @@ start_pass_fdctmgr (j_compress_ptr cinfo)
|
||||
* What's actually stored is 1/divisor so that the inner loop can
|
||||
* use a multiplication rather than a division.
|
||||
*/
|
||||
FAST_FLOAT * fdtbl;
|
||||
FAST_FLOAT *fdtbl;
|
||||
int row, col;
|
||||
static const double aanscalefactor[DCTSIZE] = {
|
||||
1.0, 1.387039845, 1.306562965, 1.175875602,
|
||||
@@ -352,7 +370,7 @@ start_pass_fdctmgr (j_compress_ptr cinfo)
|
||||
*/
|
||||
|
||||
METHODDEF(void)
|
||||
convsamp (JSAMPARRAY sample_data, JDIMENSION start_col, DCTELEM * workspace)
|
||||
convsamp (JSAMPARRAY sample_data, JDIMENSION start_col, DCTELEM *workspace)
|
||||
{
|
||||
register DCTELEM *workspaceptr;
|
||||
register JSAMPROW elemptr;
|
||||
@@ -387,7 +405,7 @@ convsamp (JSAMPARRAY sample_data, JDIMENSION start_col, DCTELEM * workspace)
|
||||
*/
|
||||
|
||||
METHODDEF(void)
|
||||
quantize (JCOEFPTR coef_block, DCTELEM * divisors, DCTELEM * workspace)
|
||||
quantize (JCOEFPTR coef_block, DCTELEM *divisors, DCTELEM *workspace)
|
||||
{
|
||||
int i;
|
||||
DCTELEM temp;
|
||||
@@ -395,7 +413,8 @@ quantize (JCOEFPTR coef_block, DCTELEM * divisors, DCTELEM * workspace)
|
||||
|
||||
#if BITS_IN_JSAMPLE == 8
|
||||
|
||||
UDCTELEM recip, corr, shift;
|
||||
UDCTELEM recip, corr;
|
||||
int shift;
|
||||
UDCTELEM2 product;
|
||||
|
||||
for (i = 0; i < DCTSIZE2; i++) {
|
||||
@@ -408,12 +427,12 @@ quantize (JCOEFPTR coef_block, DCTELEM * divisors, DCTELEM * workspace)
|
||||
temp = -temp;
|
||||
product = (UDCTELEM2)(temp + corr) * recip;
|
||||
product >>= shift + sizeof(DCTELEM)*8;
|
||||
temp = product;
|
||||
temp = (DCTELEM)product;
|
||||
temp = -temp;
|
||||
} else {
|
||||
product = (UDCTELEM2)(temp + corr) * recip;
|
||||
product >>= shift + sizeof(DCTELEM)*8;
|
||||
temp = product;
|
||||
temp = (DCTELEM)product;
|
||||
}
|
||||
output_ptr[i] = (JCOEF) temp;
|
||||
}
|
||||
@@ -468,7 +487,7 @@ quantize (JCOEFPTR coef_block, DCTELEM * divisors, DCTELEM * workspace)
|
||||
*/
|
||||
|
||||
METHODDEF(void)
|
||||
forward_DCT (j_compress_ptr cinfo, jpeg_component_info * compptr,
|
||||
forward_DCT (j_compress_ptr cinfo, jpeg_component_info *compptr,
|
||||
JSAMPARRAY sample_data, JBLOCKROW coef_blocks,
|
||||
JDIMENSION start_row, JDIMENSION start_col,
|
||||
JDIMENSION num_blocks)
|
||||
@@ -476,8 +495,8 @@ forward_DCT (j_compress_ptr cinfo, jpeg_component_info * compptr,
|
||||
{
|
||||
/* This routine is heavily used, so it's worth coding it tightly. */
|
||||
my_fdct_ptr fdct = (my_fdct_ptr) cinfo->fdct;
|
||||
DCTELEM * divisors = fdct->divisors[compptr->quant_tbl_no];
|
||||
DCTELEM * workspace;
|
||||
DCTELEM *divisors = fdct->divisors[compptr->quant_tbl_no];
|
||||
DCTELEM *workspace;
|
||||
JDIMENSION bi;
|
||||
|
||||
/* Make sure the compiler doesn't look up these every pass */
|
||||
@@ -505,7 +524,7 @@ forward_DCT (j_compress_ptr cinfo, jpeg_component_info * compptr,
|
||||
|
||||
|
||||
METHODDEF(void)
|
||||
convsamp_float (JSAMPARRAY sample_data, JDIMENSION start_col, FAST_FLOAT * workspace)
|
||||
convsamp_float (JSAMPARRAY sample_data, JDIMENSION start_col, FAST_FLOAT *workspace)
|
||||
{
|
||||
register FAST_FLOAT *workspaceptr;
|
||||
register JSAMPROW elemptr;
|
||||
@@ -536,7 +555,7 @@ convsamp_float (JSAMPARRAY sample_data, JDIMENSION start_col, FAST_FLOAT * works
|
||||
|
||||
|
||||
METHODDEF(void)
|
||||
quantize_float (JCOEFPTR coef_block, FAST_FLOAT * divisors, FAST_FLOAT * workspace)
|
||||
quantize_float (JCOEFPTR coef_block, FAST_FLOAT *divisors, FAST_FLOAT *workspace)
|
||||
{
|
||||
register FAST_FLOAT temp;
|
||||
register int i;
|
||||
@@ -558,7 +577,7 @@ quantize_float (JCOEFPTR coef_block, FAST_FLOAT * divisors, FAST_FLOAT * workspa
|
||||
|
||||
|
||||
METHODDEF(void)
|
||||
forward_DCT_float (j_compress_ptr cinfo, jpeg_component_info * compptr,
|
||||
forward_DCT_float (j_compress_ptr cinfo, jpeg_component_info *compptr,
|
||||
JSAMPARRAY sample_data, JBLOCKROW coef_blocks,
|
||||
JDIMENSION start_row, JDIMENSION start_col,
|
||||
JDIMENSION num_blocks)
|
||||
@@ -566,8 +585,8 @@ forward_DCT_float (j_compress_ptr cinfo, jpeg_component_info * compptr,
|
||||
{
|
||||
/* This routine is heavily used, so it's worth coding it tightly. */
|
||||
my_fdct_ptr fdct = (my_fdct_ptr) cinfo->fdct;
|
||||
FAST_FLOAT * divisors = fdct->float_divisors[compptr->quant_tbl_no];
|
||||
FAST_FLOAT * workspace;
|
||||
FAST_FLOAT *divisors = fdct->float_divisors[compptr->quant_tbl_no];
|
||||
FAST_FLOAT *workspace;
|
||||
JDIMENSION bi;
|
||||
|
||||
|
||||
|
||||
106
jchuff.c
106
jchuff.c
@@ -4,8 +4,10 @@
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1991-1997, Thomas G. Lane.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2009-2011, 2014-2015 D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README file.
|
||||
* Copyright (C) 2009-2011, 2014-2016, D. R. Commander.
|
||||
* Copyright (C) 2015, Matthieu Darbois.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
* This file contains Huffman entropy encoding routines.
|
||||
*
|
||||
@@ -19,7 +21,8 @@
|
||||
#define JPEG_INTERNALS
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
#include "jchuff.h" /* Declarations shared with jcphuff.c */
|
||||
#include "jsimd.h"
|
||||
#include "jconfigint.h"
|
||||
#include <limits.h>
|
||||
|
||||
/*
|
||||
@@ -99,23 +102,25 @@ typedef struct {
|
||||
int next_restart_num; /* next restart number to write (0-7) */
|
||||
|
||||
/* Pointers to derived tables (these workspaces have image lifespan) */
|
||||
c_derived_tbl * dc_derived_tbls[NUM_HUFF_TBLS];
|
||||
c_derived_tbl * ac_derived_tbls[NUM_HUFF_TBLS];
|
||||
c_derived_tbl *dc_derived_tbls[NUM_HUFF_TBLS];
|
||||
c_derived_tbl *ac_derived_tbls[NUM_HUFF_TBLS];
|
||||
|
||||
#ifdef ENTROPY_OPT_SUPPORTED /* Statistics tables for optimization */
|
||||
long * dc_count_ptrs[NUM_HUFF_TBLS];
|
||||
long * ac_count_ptrs[NUM_HUFF_TBLS];
|
||||
long *dc_count_ptrs[NUM_HUFF_TBLS];
|
||||
long *ac_count_ptrs[NUM_HUFF_TBLS];
|
||||
#endif
|
||||
|
||||
int simd;
|
||||
} huff_entropy_encoder;
|
||||
|
||||
typedef huff_entropy_encoder * huff_entropy_ptr;
|
||||
typedef huff_entropy_encoder *huff_entropy_ptr;
|
||||
|
||||
/* Working state while writing an MCU.
|
||||
* This struct contains all the fields that are needed by subroutines.
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
JOCTET * next_output_byte; /* => next byte to write in buffer */
|
||||
JOCTET *next_output_byte; /* => next byte to write in buffer */
|
||||
size_t free_in_buffer; /* # of byte spaces remaining in buffer */
|
||||
savable_state cur; /* Current bit buffer & DC state */
|
||||
j_compress_ptr cinfo; /* dump_buffer needs access to this */
|
||||
@@ -143,7 +148,7 @@ start_pass_huff (j_compress_ptr cinfo, boolean gather_statistics)
|
||||
{
|
||||
huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
|
||||
int ci, dctbl, actbl;
|
||||
jpeg_component_info * compptr;
|
||||
jpeg_component_info *compptr;
|
||||
|
||||
if (gather_statistics) {
|
||||
#ifdef ENTROPY_OPT_SUPPORTED
|
||||
@@ -157,6 +162,8 @@ start_pass_huff (j_compress_ptr cinfo, boolean gather_statistics)
|
||||
entropy->pub.finish_pass = finish_pass_huff;
|
||||
}
|
||||
|
||||
entropy->simd = jsimd_can_huff_encode_one_block();
|
||||
|
||||
for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
|
||||
compptr = cinfo->cur_comp_info[ci];
|
||||
dctbl = compptr->dc_tbl_no;
|
||||
@@ -213,7 +220,7 @@ start_pass_huff (j_compress_ptr cinfo, boolean gather_statistics)
|
||||
|
||||
GLOBAL(void)
|
||||
jpeg_make_c_derived_tbl (j_compress_ptr cinfo, boolean isDC, int tblno,
|
||||
c_derived_tbl ** pdtbl)
|
||||
c_derived_tbl **pdtbl)
|
||||
{
|
||||
JHUFF_TBL *htbl;
|
||||
c_derived_tbl *dtbl;
|
||||
@@ -268,7 +275,7 @@ jpeg_make_c_derived_tbl (j_compress_ptr cinfo, boolean isDC, int tblno,
|
||||
/* code is now 1 more than the last code used for codelength si; but
|
||||
* it must still fit in si bits, since no code is allowed to be all ones.
|
||||
*/
|
||||
if (((INT32) code) >= (((INT32) 1) << si))
|
||||
if (((JLONG) code) >= (((JLONG) 1) << si))
|
||||
ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);
|
||||
code <<= 1;
|
||||
si++;
|
||||
@@ -311,10 +318,10 @@ jpeg_make_c_derived_tbl (j_compress_ptr cinfo, boolean isDC, int tblno,
|
||||
|
||||
|
||||
LOCAL(boolean)
|
||||
dump_buffer (working_state * state)
|
||||
dump_buffer (working_state *state)
|
||||
/* Empty the output buffer; return TRUE if successful, FALSE if must suspend */
|
||||
{
|
||||
struct jpeg_destination_mgr * dest = state->cinfo->dest;
|
||||
struct jpeg_destination_mgr *dest = state->cinfo->dest;
|
||||
|
||||
if (! (*dest->empty_output_buffer) (state->cinfo))
|
||||
return FALSE;
|
||||
@@ -388,7 +395,7 @@ dump_buffer (working_state * state)
|
||||
}
|
||||
|
||||
#define EMIT_CODE(code, size) { \
|
||||
temp2 &= (((INT32) 1)<<nbits) - 1; \
|
||||
temp2 &= (((JLONG) 1)<<nbits) - 1; \
|
||||
CHECKBUF31() \
|
||||
PUT_BITS(code, size) \
|
||||
PUT_BITS(temp2, nbits) \
|
||||
@@ -402,7 +409,7 @@ dump_buffer (working_state * state)
|
||||
}
|
||||
|
||||
#define EMIT_CODE(code, size) { \
|
||||
temp2 &= (((INT32) 1)<<nbits) - 1; \
|
||||
temp2 &= (((JLONG) 1)<<nbits) - 1; \
|
||||
PUT_BITS(code, size) \
|
||||
CHECKBUF15() \
|
||||
PUT_BITS(temp2, nbits) \
|
||||
@@ -454,7 +461,7 @@ dump_buffer (working_state * state)
|
||||
|
||||
|
||||
LOCAL(boolean)
|
||||
flush_bits (working_state * state)
|
||||
flush_bits (working_state *state)
|
||||
{
|
||||
JOCTET _buffer[BUFSIZE], *buffer;
|
||||
size_t put_buffer; int put_bits;
|
||||
@@ -479,7 +486,24 @@ flush_bits (working_state * state)
|
||||
/* Encode a single block's worth of coefficients */
|
||||
|
||||
LOCAL(boolean)
|
||||
encode_one_block (working_state * state, JCOEFPTR block, int last_dc_val,
|
||||
encode_one_block_simd (working_state *state, JCOEFPTR block, int last_dc_val,
|
||||
c_derived_tbl *dctbl, c_derived_tbl *actbl)
|
||||
{
|
||||
JOCTET _buffer[BUFSIZE], *buffer;
|
||||
size_t bytes, bytestocopy; int localbuf = 0;
|
||||
|
||||
LOAD_BUFFER()
|
||||
|
||||
buffer = jsimd_huff_encode_one_block(state, buffer, block, last_dc_val,
|
||||
dctbl, actbl);
|
||||
|
||||
STORE_BUFFER()
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
LOCAL(boolean)
|
||||
encode_one_block (working_state *state, JCOEFPTR block, int last_dc_val,
|
||||
c_derived_tbl *dctbl, c_derived_tbl *actbl)
|
||||
{
|
||||
int temp, temp2, temp3;
|
||||
@@ -520,7 +544,7 @@ encode_one_block (working_state * state, JCOEFPTR block, int last_dc_val,
|
||||
EMIT_BITS(code, size)
|
||||
|
||||
/* Mask off any extra bits in code */
|
||||
temp2 &= (((INT32) 1)<<nbits) - 1;
|
||||
temp2 &= (((JLONG) 1)<<nbits) - 1;
|
||||
|
||||
/* Emit that number of bits of the value, if positive, */
|
||||
/* or the complement of its magnitude, if negative. */
|
||||
@@ -592,7 +616,7 @@ encode_one_block (working_state * state, JCOEFPTR block, int last_dc_val,
|
||||
*/
|
||||
|
||||
LOCAL(boolean)
|
||||
emit_restart (working_state * state, int restart_num)
|
||||
emit_restart (working_state *state, int restart_num)
|
||||
{
|
||||
int ci;
|
||||
|
||||
@@ -622,7 +646,7 @@ encode_mcu_huff (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
|
||||
huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
|
||||
working_state state;
|
||||
int blkn, ci;
|
||||
jpeg_component_info * compptr;
|
||||
jpeg_component_info *compptr;
|
||||
|
||||
/* Load up working state */
|
||||
state.next_output_byte = cinfo->dest->next_output_byte;
|
||||
@@ -638,16 +662,30 @@ encode_mcu_huff (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
|
||||
}
|
||||
|
||||
/* Encode the MCU data blocks */
|
||||
for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
|
||||
ci = cinfo->MCU_membership[blkn];
|
||||
compptr = cinfo->cur_comp_info[ci];
|
||||
if (! encode_one_block(&state,
|
||||
MCU_data[blkn][0], state.cur.last_dc_val[ci],
|
||||
entropy->dc_derived_tbls[compptr->dc_tbl_no],
|
||||
entropy->ac_derived_tbls[compptr->ac_tbl_no]))
|
||||
return FALSE;
|
||||
/* Update last_dc_val */
|
||||
state.cur.last_dc_val[ci] = MCU_data[blkn][0][0];
|
||||
if (entropy->simd) {
|
||||
for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
|
||||
ci = cinfo->MCU_membership[blkn];
|
||||
compptr = cinfo->cur_comp_info[ci];
|
||||
if (! encode_one_block_simd(&state,
|
||||
MCU_data[blkn][0], state.cur.last_dc_val[ci],
|
||||
entropy->dc_derived_tbls[compptr->dc_tbl_no],
|
||||
entropy->ac_derived_tbls[compptr->ac_tbl_no]))
|
||||
return FALSE;
|
||||
/* Update last_dc_val */
|
||||
state.cur.last_dc_val[ci] = MCU_data[blkn][0][0];
|
||||
}
|
||||
} else {
|
||||
for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
|
||||
ci = cinfo->MCU_membership[blkn];
|
||||
compptr = cinfo->cur_comp_info[ci];
|
||||
if (! encode_one_block(&state,
|
||||
MCU_data[blkn][0], state.cur.last_dc_val[ci],
|
||||
entropy->dc_derived_tbls[compptr->dc_tbl_no],
|
||||
entropy->ac_derived_tbls[compptr->ac_tbl_no]))
|
||||
return FALSE;
|
||||
/* Update last_dc_val */
|
||||
state.cur.last_dc_val[ci] = MCU_data[blkn][0][0];
|
||||
}
|
||||
}
|
||||
|
||||
/* Completed MCU, so update state */
|
||||
@@ -790,7 +828,7 @@ encode_mcu_gather (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
|
||||
{
|
||||
huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
|
||||
int blkn, ci;
|
||||
jpeg_component_info * compptr;
|
||||
jpeg_component_info *compptr;
|
||||
|
||||
/* Take care of restart intervals if needed */
|
||||
if (cinfo->restart_interval) {
|
||||
@@ -846,7 +884,7 @@ encode_mcu_gather (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
|
||||
*/
|
||||
|
||||
GLOBAL(void)
|
||||
jpeg_gen_optimal_table (j_compress_ptr cinfo, JHUFF_TBL * htbl, long freq[])
|
||||
jpeg_gen_optimal_table (j_compress_ptr cinfo, JHUFF_TBL *htbl, long freq[])
|
||||
{
|
||||
#define MAX_CLEN 32 /* assumed maximum initial code length */
|
||||
UINT8 bits[MAX_CLEN+1]; /* bits[k] = # of symbols with code length k */
|
||||
@@ -991,7 +1029,7 @@ finish_pass_gather (j_compress_ptr cinfo)
|
||||
{
|
||||
huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
|
||||
int ci, dctbl, actbl;
|
||||
jpeg_component_info * compptr;
|
||||
jpeg_component_info *compptr;
|
||||
JHUFF_TBL **htblptr;
|
||||
boolean did_dc[NUM_HUFF_TBLS];
|
||||
boolean did_ac[NUM_HUFF_TBLS];
|
||||
|
||||
5
jchuff.h
5
jchuff.h
@@ -5,7 +5,8 @@
|
||||
* Copyright (C) 1991-1997, Thomas G. Lane.
|
||||
* It was modified by The libjpeg-turbo Project to include only code relevant
|
||||
* to libjpeg-turbo.
|
||||
* For conditions of distribution and use, see the accompanying README file.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
* This file contains declarations for Huffman entropy encoding routines
|
||||
* that are shared between the sequential encoder (jchuff.c) and the
|
||||
@@ -39,4 +40,4 @@ EXTERN(void) jpeg_make_c_derived_tbl
|
||||
|
||||
/* Generate an optimal table definition given the specified counts */
|
||||
EXTERN(void) jpeg_gen_optimal_table
|
||||
(j_compress_ptr cinfo, JHUFF_TBL * htbl, long freq[]);
|
||||
(j_compress_ptr cinfo, JHUFF_TBL *htbl, long freq[]);
|
||||
|
||||
3
jcinit.c
3
jcinit.c
@@ -3,7 +3,8 @@
|
||||
*
|
||||
* Copyright (C) 1991-1997, Thomas G. Lane.
|
||||
* This file is part of the Independent JPEG Group's software.
|
||||
* For conditions of distribution and use, see the accompanying README file.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
* This file contains initialization logic for the JPEG compressor.
|
||||
* This routine is in charge of selecting the modules to be executed and
|
||||
|
||||
@@ -5,7 +5,8 @@
|
||||
* Copyright (C) 1994-1996, Thomas G. Lane.
|
||||
* It was modified by The libjpeg-turbo Project to include only code relevant
|
||||
* to libjpeg-turbo.
|
||||
* For conditions of distribution and use, see the accompanying README file.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
* This file contains the main buffer controller for compression.
|
||||
* The main buffer lies between the pre-processor and the JPEG
|
||||
@@ -34,7 +35,7 @@ typedef struct {
|
||||
JSAMPARRAY buffer[MAX_COMPONENTS];
|
||||
} my_main_controller;
|
||||
|
||||
typedef my_main_controller * my_main_ptr;
|
||||
typedef my_main_controller *my_main_ptr;
|
||||
|
||||
|
||||
/* Forward declarations */
|
||||
|
||||
11
jcmarker.c
11
jcmarker.c
@@ -6,7 +6,8 @@
|
||||
* Modified 2003-2010 by Guido Vollbeding.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2010, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README file.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
* This file contains routines to write JPEG datastream markers.
|
||||
*/
|
||||
@@ -93,7 +94,7 @@ typedef struct {
|
||||
unsigned int last_restart_interval; /* last DRI value emitted; 0 after SOI */
|
||||
} my_marker_writer;
|
||||
|
||||
typedef my_marker_writer * my_marker_ptr;
|
||||
typedef my_marker_writer *my_marker_ptr;
|
||||
|
||||
|
||||
/*
|
||||
@@ -112,7 +113,7 @@ LOCAL(void)
|
||||
emit_byte (j_compress_ptr cinfo, int val)
|
||||
/* Emit a byte */
|
||||
{
|
||||
struct jpeg_destination_mgr * dest = cinfo->dest;
|
||||
struct jpeg_destination_mgr *dest = cinfo->dest;
|
||||
|
||||
*(dest->next_output_byte)++ = (JOCTET) val;
|
||||
if (--dest->free_in_buffer == 0) {
|
||||
@@ -149,7 +150,7 @@ emit_dqt (j_compress_ptr cinfo, int index)
|
||||
/* Emit a DQT marker */
|
||||
/* Returns the precision used (0 = 8bits, 1 = 16bits) for baseline checking */
|
||||
{
|
||||
JQUANT_TBL * qtbl = cinfo->quant_tbl_ptrs[index];
|
||||
JQUANT_TBL *qtbl = cinfo->quant_tbl_ptrs[index];
|
||||
int prec;
|
||||
int i;
|
||||
|
||||
@@ -188,7 +189,7 @@ LOCAL(void)
|
||||
emit_dht (j_compress_ptr cinfo, int index, boolean is_ac)
|
||||
/* Emit a DHT marker */
|
||||
{
|
||||
JHUFF_TBL * htbl;
|
||||
JHUFF_TBL *htbl;
|
||||
int length, i;
|
||||
|
||||
if (is_ac) {
|
||||
|
||||
28
jcmaster.c
28
jcmaster.c
@@ -5,8 +5,9 @@
|
||||
* Copyright (C) 1991-1997, Thomas G. Lane.
|
||||
* Modified 2003-2010 by Guido Vollbeding.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2010, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README file.
|
||||
* Copyright (C) 2010, 2016, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
* This file contains master control logic for the JPEG compressor.
|
||||
* These routines are concerned with parameter validation, initial setup,
|
||||
@@ -18,6 +19,7 @@
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
#include "jpegcomp.h"
|
||||
#include "jconfigint.h"
|
||||
|
||||
|
||||
/* Private state */
|
||||
@@ -37,9 +39,19 @@ typedef struct {
|
||||
int total_passes; /* total # of passes needed */
|
||||
|
||||
int scan_number; /* current index in scan_info[] */
|
||||
|
||||
/*
|
||||
* This is here so we can add libjpeg-turbo version/build information to the
|
||||
* global string table without introducing a new global symbol. Adding this
|
||||
* information to the global string table allows one to examine a binary
|
||||
* object and determine which version of libjpeg-turbo it was built from or
|
||||
* linked against.
|
||||
*/
|
||||
const char *jpeg_version;
|
||||
|
||||
} my_comp_master;
|
||||
|
||||
typedef my_comp_master * my_master_ptr;
|
||||
typedef my_comp_master *my_master_ptr;
|
||||
|
||||
|
||||
/*
|
||||
@@ -167,12 +179,12 @@ validate_script (j_compress_ptr cinfo)
|
||||
* determine whether it uses progressive JPEG, and set cinfo->progressive_mode.
|
||||
*/
|
||||
{
|
||||
const jpeg_scan_info * scanptr;
|
||||
const jpeg_scan_info *scanptr;
|
||||
int scanno, ncomps, ci, coefi, thisi;
|
||||
int Ss, Se, Ah, Al;
|
||||
boolean component_sent[MAX_COMPONENTS];
|
||||
#ifdef C_PROGRESSIVE_SUPPORTED
|
||||
int * last_bitpos_ptr;
|
||||
int *last_bitpos_ptr;
|
||||
int last_bitpos[MAX_COMPONENTS][DCTSIZE2];
|
||||
/* -1 until that coefficient has been seen; then last Al for it */
|
||||
#endif
|
||||
@@ -308,7 +320,7 @@ select_scan_parameters (j_compress_ptr cinfo)
|
||||
if (cinfo->scan_info != NULL) {
|
||||
/* Prepare for current scan --- the script is already validated */
|
||||
my_master_ptr master = (my_master_ptr) cinfo->master;
|
||||
const jpeg_scan_info * scanptr = cinfo->scan_info + master->scan_number;
|
||||
const jpeg_scan_info *scanptr = cinfo->scan_info + master->scan_number;
|
||||
|
||||
cinfo->comps_in_scan = scanptr->comps_in_scan;
|
||||
for (ci = 0; ci < scanptr->comps_in_scan; ci++) {
|
||||
@@ -602,7 +614,7 @@ jinit_c_master_control (j_compress_ptr cinfo, boolean transcode_only)
|
||||
cinfo->num_scans = 1;
|
||||
}
|
||||
|
||||
if (cinfo->progressive_mode && !cinfo->arith_code) /* TEMPORARY HACK ??? */
|
||||
if (cinfo->progressive_mode && !cinfo->arith_code) /* TEMPORARY HACK ??? */
|
||||
cinfo->optimize_coding = TRUE; /* assume default tables no good for progressive mode */
|
||||
|
||||
/* Initialize my private state */
|
||||
@@ -622,4 +634,6 @@ jinit_c_master_control (j_compress_ptr cinfo, boolean transcode_only)
|
||||
master->total_passes = cinfo->num_scans * 2;
|
||||
else
|
||||
master->total_passes = cinfo->num_scans;
|
||||
|
||||
master->jpeg_version = PACKAGE_NAME " version " VERSION " (build " BUILD ")";
|
||||
}
|
||||
|
||||
@@ -2,10 +2,11 @@
|
||||
* jcomapi.c
|
||||
*
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1994-1997, Thomas G. Lane.0
|
||||
* Copyright (C) 1994-1997, Thomas G. Lane.
|
||||
* It was modified by The libjpeg-turbo Project to include only code relevant
|
||||
* to libjpeg-turbo.
|
||||
* For conditions of distribution and use, see the accompanying README file.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
* This file contains application interface routines that are used for both
|
||||
* compression and decompression.
|
||||
|
||||
@@ -6,6 +6,9 @@
|
||||
/* libjpeg-turbo version */
|
||||
#define LIBJPEG_TURBO_VERSION 0
|
||||
|
||||
/* libjpeg-turbo version in integer form */
|
||||
#define LIBJPEG_TURBO_VERSION_NUMBER 0
|
||||
|
||||
/* Support arithmetic encoding */
|
||||
#undef C_ARITH_CODING_SUPPORTED
|
||||
|
||||
@@ -68,6 +71,3 @@
|
||||
|
||||
/* Define to `unsigned int' if <sys/types.h> does not define. */
|
||||
#undef size_t
|
||||
|
||||
/* The size of `size_t', as computed by sizeof. */
|
||||
#undef SIZEOF_SIZE_T
|
||||
|
||||
@@ -5,7 +5,8 @@
|
||||
* Copyright (C) 1991-1994, Thomas G. Lane.
|
||||
* It was modified by The libjpeg-turbo Project to include only code relevant
|
||||
* to libjpeg-turbo.
|
||||
* For conditions of distribution and use, see the accompanying README file.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
* This file documents the configuration options that are required to
|
||||
* customize the JPEG software for a particular system.
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
/* libjpeg-turbo build number */
|
||||
#undef BUILD
|
||||
|
||||
/* Compiler's inline keyword */
|
||||
#undef inline
|
||||
|
||||
/* How to obtain function inlining. */
|
||||
#undef INLINE
|
||||
|
||||
@@ -9,3 +12,6 @@
|
||||
|
||||
/* Version number of package */
|
||||
#undef VERSION
|
||||
|
||||
/* The size of `size_t', as computed by sizeof. */
|
||||
#undef SIZEOF_SIZE_T
|
||||
|
||||
15
jcparam.c
15
jcparam.c
@@ -6,7 +6,8 @@
|
||||
* Modified 2003-2008 by Guido Vollbeding.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2009-2011, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README file.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
* This file contains optional default-setting code for the JPEG compressor.
|
||||
* Applications do not have to use this file, but those that don't use it
|
||||
@@ -33,7 +34,7 @@ jpeg_add_quant_table (j_compress_ptr cinfo, int which_tbl,
|
||||
* are limited to 1..255 for JPEG baseline compatibility.
|
||||
*/
|
||||
{
|
||||
JQUANT_TBL ** qtblptr;
|
||||
JQUANT_TBL **qtblptr;
|
||||
int i;
|
||||
long temp;
|
||||
|
||||
@@ -321,7 +322,7 @@ jpeg_default_colorspace (j_compress_ptr cinfo)
|
||||
GLOBAL(void)
|
||||
jpeg_set_colorspace (j_compress_ptr cinfo, J_COLOR_SPACE colorspace)
|
||||
{
|
||||
jpeg_component_info * compptr;
|
||||
jpeg_component_info *compptr;
|
||||
int ci;
|
||||
|
||||
#define SET_COMP(index,id,hsamp,vsamp,quant,dctbl,actbl) \
|
||||
@@ -403,7 +404,7 @@ jpeg_set_colorspace (j_compress_ptr cinfo, J_COLOR_SPACE colorspace)
|
||||
#ifdef C_PROGRESSIVE_SUPPORTED
|
||||
|
||||
LOCAL(jpeg_scan_info *)
|
||||
fill_a_scan (jpeg_scan_info * scanptr, int ci,
|
||||
fill_a_scan (jpeg_scan_info *scanptr, int ci,
|
||||
int Ss, int Se, int Ah, int Al)
|
||||
/* Support routine: generate one scan for specified component */
|
||||
{
|
||||
@@ -418,7 +419,7 @@ fill_a_scan (jpeg_scan_info * scanptr, int ci,
|
||||
}
|
||||
|
||||
LOCAL(jpeg_scan_info *)
|
||||
fill_scans (jpeg_scan_info * scanptr, int ncomps,
|
||||
fill_scans (jpeg_scan_info *scanptr, int ncomps,
|
||||
int Ss, int Se, int Ah, int Al)
|
||||
/* Support routine: generate one scan for each component */
|
||||
{
|
||||
@@ -437,7 +438,7 @@ fill_scans (jpeg_scan_info * scanptr, int ncomps,
|
||||
}
|
||||
|
||||
LOCAL(jpeg_scan_info *)
|
||||
fill_dc_scans (jpeg_scan_info * scanptr, int ncomps, int Ah, int Al)
|
||||
fill_dc_scans (jpeg_scan_info *scanptr, int ncomps, int Ah, int Al)
|
||||
/* Support routine: generate interleaved DC scan if possible, else N scans */
|
||||
{
|
||||
int ci;
|
||||
@@ -469,7 +470,7 @@ jpeg_simple_progression (j_compress_ptr cinfo)
|
||||
{
|
||||
int ncomps = cinfo->num_components;
|
||||
int nscans;
|
||||
jpeg_scan_info * scanptr;
|
||||
jpeg_scan_info *scanptr;
|
||||
|
||||
/* Safety check to ensure start_compress not called yet. */
|
||||
if (cinfo->global_state != CSTATE_START)
|
||||
|
||||
39
jcphuff.c
39
jcphuff.c
@@ -3,9 +3,10 @@
|
||||
*
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1995-1997, Thomas G. Lane.
|
||||
* It was modified by The libjpeg-turbo Project to include only code relevant
|
||||
* to libjpeg-turbo.
|
||||
* For conditions of distribution and use, see the accompanying README file.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2015, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
* This file contains Huffman entropy encoding routines for progressive JPEG.
|
||||
*
|
||||
@@ -32,9 +33,9 @@ typedef struct {
|
||||
/* Bit-level coding status.
|
||||
* next_output_byte/free_in_buffer are local copies of cinfo->dest fields.
|
||||
*/
|
||||
JOCTET * next_output_byte; /* => next byte to write in buffer */
|
||||
JOCTET *next_output_byte; /* => next byte to write in buffer */
|
||||
size_t free_in_buffer; /* # of byte spaces remaining in buffer */
|
||||
INT32 put_buffer; /* current bit-accumulation buffer */
|
||||
size_t put_buffer; /* current bit-accumulation buffer */
|
||||
int put_bits; /* # of bits now in it */
|
||||
j_compress_ptr cinfo; /* link to cinfo (needed for dump_buffer) */
|
||||
|
||||
@@ -45,7 +46,7 @@ typedef struct {
|
||||
int ac_tbl_no; /* the table number of the single component */
|
||||
unsigned int EOBRUN; /* run length of EOBs */
|
||||
unsigned int BE; /* # of buffered correction bits before MCU */
|
||||
char * bit_buffer; /* buffer for correction bits (1 per char) */
|
||||
char *bit_buffer; /* buffer for correction bits (1 per char) */
|
||||
/* packing correction bits tightly would save some space but cost time... */
|
||||
|
||||
unsigned int restarts_to_go; /* MCUs left in this restart interval */
|
||||
@@ -55,13 +56,13 @@ typedef struct {
|
||||
* Since any one scan codes only DC or only AC, we only need one set
|
||||
* of tables, not one for DC and one for AC.
|
||||
*/
|
||||
c_derived_tbl * derived_tbls[NUM_HUFF_TBLS];
|
||||
c_derived_tbl *derived_tbls[NUM_HUFF_TBLS];
|
||||
|
||||
/* Statistics tables for optimization; again, one set is enough */
|
||||
long * count_ptrs[NUM_HUFF_TBLS];
|
||||
long *count_ptrs[NUM_HUFF_TBLS];
|
||||
} phuff_entropy_encoder;
|
||||
|
||||
typedef phuff_entropy_encoder * phuff_entropy_ptr;
|
||||
typedef phuff_entropy_encoder *phuff_entropy_ptr;
|
||||
|
||||
/* MAX_CORR_BITS is the number of bits the AC refinement correction-bit
|
||||
* buffer can hold. Larger sizes may slightly improve compression, but
|
||||
@@ -71,8 +72,8 @@ typedef phuff_entropy_encoder * phuff_entropy_ptr;
|
||||
|
||||
#define MAX_CORR_BITS 1000 /* Max # of correction bits I can buffer */
|
||||
|
||||
/* IRIGHT_SHIFT is like RIGHT_SHIFT, but works on int rather than INT32.
|
||||
* We assume that int right shift is unsigned if INT32 right shift is,
|
||||
/* IRIGHT_SHIFT is like RIGHT_SHIFT, but works on int rather than JLONG.
|
||||
* We assume that int right shift is unsigned if JLONG right shift is,
|
||||
* which should be safe.
|
||||
*/
|
||||
|
||||
@@ -110,7 +111,7 @@ start_pass_phuff (j_compress_ptr cinfo, boolean gather_statistics)
|
||||
phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;
|
||||
boolean is_DC_band;
|
||||
int ci, tbl;
|
||||
jpeg_component_info * compptr;
|
||||
jpeg_component_info *compptr;
|
||||
|
||||
entropy->cinfo = cinfo;
|
||||
entropy->gather_statistics = gather_statistics;
|
||||
@@ -207,7 +208,7 @@ LOCAL(void)
|
||||
dump_buffer (phuff_entropy_ptr entropy)
|
||||
/* Empty the output buffer; we do not support suspension in this module. */
|
||||
{
|
||||
struct jpeg_destination_mgr * dest = entropy->cinfo->dest;
|
||||
struct jpeg_destination_mgr *dest = entropy->cinfo->dest;
|
||||
|
||||
if (! (*dest->empty_output_buffer) (entropy->cinfo))
|
||||
ERREXIT(entropy->cinfo, JERR_CANT_SUSPEND);
|
||||
@@ -230,7 +231,7 @@ emit_bits (phuff_entropy_ptr entropy, unsigned int code, int size)
|
||||
/* Emit some bits, unless we are in gather mode */
|
||||
{
|
||||
/* This routine is heavily used, so it's worth coding tightly. */
|
||||
register INT32 put_buffer = (INT32) code;
|
||||
register size_t put_buffer = (size_t) code;
|
||||
register int put_bits = entropy->put_bits;
|
||||
|
||||
/* if size is 0, caller used an invalid Huffman table entry */
|
||||
@@ -240,7 +241,7 @@ emit_bits (phuff_entropy_ptr entropy, unsigned int code, int size)
|
||||
if (entropy->gather_statistics)
|
||||
return; /* do nothing if we're only getting stats */
|
||||
|
||||
put_buffer &= (((INT32) 1)<<size) - 1; /* mask off any extra bits in code */
|
||||
put_buffer &= (((size_t) 1)<<size) - 1; /* mask off any extra bits in code */
|
||||
|
||||
put_bits += size; /* new number of bits in buffer */
|
||||
|
||||
@@ -283,7 +284,7 @@ emit_symbol (phuff_entropy_ptr entropy, int tbl_no, int symbol)
|
||||
if (entropy->gather_statistics)
|
||||
entropy->count_ptrs[tbl_no][symbol]++;
|
||||
else {
|
||||
c_derived_tbl * tbl = entropy->derived_tbls[tbl_no];
|
||||
c_derived_tbl *tbl = entropy->derived_tbls[tbl_no];
|
||||
emit_bits(entropy, tbl->ehufco[symbol], tbl->ehufsi[symbol]);
|
||||
}
|
||||
}
|
||||
@@ -294,7 +295,7 @@ emit_symbol (phuff_entropy_ptr entropy, int tbl_no, int symbol)
|
||||
*/
|
||||
|
||||
LOCAL(void)
|
||||
emit_buffered_bits (phuff_entropy_ptr entropy, char * bufstart,
|
||||
emit_buffered_bits (phuff_entropy_ptr entropy, char *bufstart,
|
||||
unsigned int nbits)
|
||||
{
|
||||
if (entropy->gather_statistics)
|
||||
@@ -382,7 +383,7 @@ encode_mcu_DC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
|
||||
int blkn, ci;
|
||||
int Al = cinfo->Al;
|
||||
JBLOCKROW block;
|
||||
jpeg_component_info * compptr;
|
||||
jpeg_component_info *compptr;
|
||||
ISHIFT_TEMPS
|
||||
|
||||
entropy->next_output_byte = cinfo->dest->next_output_byte;
|
||||
@@ -769,7 +770,7 @@ finish_pass_gather_phuff (j_compress_ptr cinfo)
|
||||
phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;
|
||||
boolean is_DC_band;
|
||||
int ci, tbl;
|
||||
jpeg_component_info * compptr;
|
||||
jpeg_component_info *compptr;
|
||||
JHUFF_TBL **htblptr;
|
||||
boolean did[NUM_HUFF_TBLS];
|
||||
|
||||
|
||||
11
jcprepct.c
11
jcprepct.c
@@ -5,7 +5,8 @@
|
||||
* Copyright (C) 1994-1996, Thomas G. Lane.
|
||||
* It was modified by The libjpeg-turbo Project to include only code relevant
|
||||
* to libjpeg-turbo.
|
||||
* For conditions of distribution and use, see the accompanying README file.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
* This file contains the compression preprocessing controller.
|
||||
* This controller manages the color conversion, downsampling,
|
||||
@@ -69,7 +70,7 @@ typedef struct {
|
||||
#endif
|
||||
} my_prep_controller;
|
||||
|
||||
typedef my_prep_controller * my_prep_ptr;
|
||||
typedef my_prep_controller *my_prep_ptr;
|
||||
|
||||
|
||||
/*
|
||||
@@ -136,7 +137,7 @@ pre_process_data (j_compress_ptr cinfo,
|
||||
my_prep_ptr prep = (my_prep_ptr) cinfo->prep;
|
||||
int numrows, ci;
|
||||
JDIMENSION inrows;
|
||||
jpeg_component_info * compptr;
|
||||
jpeg_component_info *compptr;
|
||||
|
||||
while (*in_row_ctr < in_rows_avail &&
|
||||
*out_row_group_ctr < out_row_groups_avail) {
|
||||
@@ -271,7 +272,7 @@ create_context_buffer (j_compress_ptr cinfo)
|
||||
my_prep_ptr prep = (my_prep_ptr) cinfo->prep;
|
||||
int rgroup_height = cinfo->max_v_samp_factor;
|
||||
int ci, i;
|
||||
jpeg_component_info * compptr;
|
||||
jpeg_component_info *compptr;
|
||||
JSAMPARRAY true_buffer, fake_buffer;
|
||||
|
||||
/* Grab enough space for fake row pointers for all the components;
|
||||
@@ -318,7 +319,7 @@ jinit_c_prep_controller (j_compress_ptr cinfo, boolean need_full_buffer)
|
||||
{
|
||||
my_prep_ptr prep;
|
||||
int ci;
|
||||
jpeg_component_info * compptr;
|
||||
jpeg_component_info *compptr;
|
||||
|
||||
if (need_full_buffer) /* safety check */
|
||||
ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
|
||||
|
||||
32
jcsample.c
32
jcsample.c
@@ -5,8 +5,10 @@
|
||||
* Copyright (C) 1991-1996, Thomas G. Lane.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
|
||||
* Copyright (C) 2014, MIPS Technologies, Inc., California
|
||||
* For conditions of distribution and use, see the accompanying README file.
|
||||
* Copyright (C) 2014, MIPS Technologies, Inc., California.
|
||||
* Copyright (C) 2015, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
* This file contains downsampling routines.
|
||||
*
|
||||
@@ -56,7 +58,7 @@
|
||||
|
||||
/* Pointer to routine to downsample a single component */
|
||||
typedef void (*downsample1_ptr) (j_compress_ptr cinfo,
|
||||
jpeg_component_info * compptr,
|
||||
jpeg_component_info *compptr,
|
||||
JSAMPARRAY input_data,
|
||||
JSAMPARRAY output_data);
|
||||
|
||||
@@ -69,7 +71,7 @@ typedef struct {
|
||||
downsample1_ptr methods[MAX_COMPONENTS];
|
||||
} my_downsampler;
|
||||
|
||||
typedef my_downsampler * my_downsample_ptr;
|
||||
typedef my_downsampler *my_downsample_ptr;
|
||||
|
||||
|
||||
/*
|
||||
@@ -122,7 +124,7 @@ sep_downsample (j_compress_ptr cinfo,
|
||||
{
|
||||
my_downsample_ptr downsample = (my_downsample_ptr) cinfo->downsample;
|
||||
int ci;
|
||||
jpeg_component_info * compptr;
|
||||
jpeg_component_info *compptr;
|
||||
JSAMPARRAY in_ptr, out_ptr;
|
||||
|
||||
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
|
||||
@@ -142,14 +144,14 @@ sep_downsample (j_compress_ptr cinfo,
|
||||
*/
|
||||
|
||||
METHODDEF(void)
|
||||
int_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,
|
||||
int_downsample (j_compress_ptr cinfo, jpeg_component_info *compptr,
|
||||
JSAMPARRAY input_data, JSAMPARRAY output_data)
|
||||
{
|
||||
int inrow, outrow, h_expand, v_expand, numpix, numpix2, h, v;
|
||||
JDIMENSION outcol, outcol_h; /* outcol_h == outcol*h_expand */
|
||||
JDIMENSION output_cols = compptr->width_in_blocks * DCTSIZE;
|
||||
JSAMPROW inptr, outptr;
|
||||
INT32 outvalue;
|
||||
JLONG outvalue;
|
||||
|
||||
h_expand = cinfo->max_h_samp_factor / compptr->h_samp_factor;
|
||||
v_expand = cinfo->max_v_samp_factor / compptr->v_samp_factor;
|
||||
@@ -172,7 +174,7 @@ int_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,
|
||||
for (v = 0; v < v_expand; v++) {
|
||||
inptr = input_data[inrow+v] + outcol_h;
|
||||
for (h = 0; h < h_expand; h++) {
|
||||
outvalue += (INT32) GETJSAMPLE(*inptr++);
|
||||
outvalue += (JLONG) GETJSAMPLE(*inptr++);
|
||||
}
|
||||
}
|
||||
*outptr++ = (JSAMPLE) ((outvalue + numpix2) / numpix);
|
||||
@@ -189,7 +191,7 @@ int_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,
|
||||
*/
|
||||
|
||||
METHODDEF(void)
|
||||
fullsize_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,
|
||||
fullsize_downsample (j_compress_ptr cinfo, jpeg_component_info *compptr,
|
||||
JSAMPARRAY input_data, JSAMPARRAY output_data)
|
||||
{
|
||||
/* Copy the data */
|
||||
@@ -214,7 +216,7 @@ fullsize_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,
|
||||
*/
|
||||
|
||||
METHODDEF(void)
|
||||
h2v1_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,
|
||||
h2v1_downsample (j_compress_ptr cinfo, jpeg_component_info *compptr,
|
||||
JSAMPARRAY input_data, JSAMPARRAY output_data)
|
||||
{
|
||||
int outrow;
|
||||
@@ -251,7 +253,7 @@ h2v1_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,
|
||||
*/
|
||||
|
||||
METHODDEF(void)
|
||||
h2v2_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,
|
||||
h2v2_downsample (j_compress_ptr cinfo, jpeg_component_info *compptr,
|
||||
JSAMPARRAY input_data, JSAMPARRAY output_data)
|
||||
{
|
||||
int inrow, outrow;
|
||||
@@ -294,14 +296,14 @@ h2v2_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,
|
||||
*/
|
||||
|
||||
METHODDEF(void)
|
||||
h2v2_smooth_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,
|
||||
h2v2_smooth_downsample (j_compress_ptr cinfo, jpeg_component_info *compptr,
|
||||
JSAMPARRAY input_data, JSAMPARRAY output_data)
|
||||
{
|
||||
int inrow, outrow;
|
||||
JDIMENSION colctr;
|
||||
JDIMENSION output_cols = compptr->width_in_blocks * DCTSIZE;
|
||||
register JSAMPROW inptr0, inptr1, above_ptr, below_ptr, outptr;
|
||||
INT32 membersum, neighsum, memberscale, neighscale;
|
||||
JLONG membersum, neighsum, memberscale, neighscale;
|
||||
|
||||
/* Expand input data enough to let all the output samples be generated
|
||||
* by the standard loop. Special-casing padded output would be more
|
||||
@@ -401,7 +403,7 @@ fullsize_smooth_downsample (j_compress_ptr cinfo, jpeg_component_info *compptr,
|
||||
JDIMENSION colctr;
|
||||
JDIMENSION output_cols = compptr->width_in_blocks * DCTSIZE;
|
||||
register JSAMPROW inptr, above_ptr, below_ptr, outptr;
|
||||
INT32 membersum, neighsum, memberscale, neighscale;
|
||||
JLONG membersum, neighsum, memberscale, neighscale;
|
||||
int colsum, lastcolsum, nextcolsum;
|
||||
|
||||
/* Expand input data enough to let all the output samples be generated
|
||||
@@ -470,7 +472,7 @@ jinit_downsampler (j_compress_ptr cinfo)
|
||||
{
|
||||
my_downsample_ptr downsample;
|
||||
int ci;
|
||||
jpeg_component_info * compptr;
|
||||
jpeg_component_info *compptr;
|
||||
boolean smoothok = TRUE;
|
||||
|
||||
downsample = (my_downsample_ptr)
|
||||
|
||||
19
jctrans.c
19
jctrans.c
@@ -6,7 +6,8 @@
|
||||
* Modified 2000-2009 by Guido Vollbeding.
|
||||
* It was modified by The libjpeg-turbo Project to include only code relevant
|
||||
* to libjpeg-turbo.
|
||||
* For conditions of distribution and use, see the accompanying README file.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
* This file contains library routines for transcoding compression,
|
||||
* that is, writing raw DCT coefficient arrays to an output JPEG file.
|
||||
@@ -20,9 +21,9 @@
|
||||
|
||||
/* Forward declarations */
|
||||
LOCAL(void) transencode_master_selection
|
||||
(j_compress_ptr cinfo, jvirt_barray_ptr * coef_arrays);
|
||||
(j_compress_ptr cinfo, jvirt_barray_ptr *coef_arrays);
|
||||
LOCAL(void) transencode_coef_controller
|
||||
(j_compress_ptr cinfo, jvirt_barray_ptr * coef_arrays);
|
||||
(j_compress_ptr cinfo, jvirt_barray_ptr *coef_arrays);
|
||||
|
||||
|
||||
/*
|
||||
@@ -38,7 +39,7 @@ LOCAL(void) transencode_coef_controller
|
||||
*/
|
||||
|
||||
GLOBAL(void)
|
||||
jpeg_write_coefficients (j_compress_ptr cinfo, jvirt_barray_ptr * coef_arrays)
|
||||
jpeg_write_coefficients (j_compress_ptr cinfo, jvirt_barray_ptr *coef_arrays)
|
||||
{
|
||||
if (cinfo->global_state != CSTATE_START)
|
||||
ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
|
||||
@@ -66,7 +67,7 @@ GLOBAL(void)
|
||||
jpeg_copy_critical_parameters (j_decompress_ptr srcinfo,
|
||||
j_compress_ptr dstinfo)
|
||||
{
|
||||
JQUANT_TBL ** qtblptr;
|
||||
JQUANT_TBL **qtblptr;
|
||||
jpeg_component_info *incomp, *outcomp;
|
||||
JQUANT_TBL *c_quant, *slot_quant;
|
||||
int tblno, ci, coefi;
|
||||
@@ -165,7 +166,7 @@ jpeg_copy_critical_parameters (j_decompress_ptr srcinfo,
|
||||
|
||||
LOCAL(void)
|
||||
transencode_master_selection (j_compress_ptr cinfo,
|
||||
jvirt_barray_ptr * coef_arrays)
|
||||
jvirt_barray_ptr *coef_arrays)
|
||||
{
|
||||
/* Although we don't actually use input_components for transcoding,
|
||||
* jcmaster.c's initial_setup will complain if input_components is 0.
|
||||
@@ -227,13 +228,13 @@ typedef struct {
|
||||
int MCU_rows_per_iMCU_row; /* number of such rows needed */
|
||||
|
||||
/* Virtual block array for each component. */
|
||||
jvirt_barray_ptr * whole_image;
|
||||
jvirt_barray_ptr *whole_image;
|
||||
|
||||
/* Workspace for constructing dummy blocks at right/bottom edges. */
|
||||
JBLOCKROW dummy_buffer[C_MAX_BLOCKS_IN_MCU];
|
||||
} my_coef_controller;
|
||||
|
||||
typedef my_coef_controller * my_coef_ptr;
|
||||
typedef my_coef_controller *my_coef_ptr;
|
||||
|
||||
|
||||
LOCAL(void)
|
||||
@@ -374,7 +375,7 @@ compress_output (j_compress_ptr cinfo, JSAMPIMAGE input_buf)
|
||||
|
||||
LOCAL(void)
|
||||
transencode_coef_controller (j_compress_ptr cinfo,
|
||||
jvirt_barray_ptr * coef_arrays)
|
||||
jvirt_barray_ptr *coef_arrays)
|
||||
{
|
||||
my_coef_ptr coef;
|
||||
JBLOCKROW buffer;
|
||||
|
||||
16
jdapimin.c
16
jdapimin.c
@@ -3,9 +3,10 @@
|
||||
*
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1994-1998, Thomas G. Lane.
|
||||
* It was modified by The libjpeg-turbo Project to include only code relevant
|
||||
* to libjpeg-turbo.
|
||||
* For conditions of distribution and use, see the accompanying README file.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2016, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
* This file contains application interface code for the decompression half
|
||||
* of the JPEG library. These are the "minimum" API routines that may be
|
||||
@@ -21,6 +22,7 @@
|
||||
#define JPEG_INTERNALS
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
#include "jdmaster.h"
|
||||
|
||||
|
||||
/*
|
||||
@@ -82,6 +84,14 @@ jpeg_CreateDecompress (j_decompress_ptr cinfo, int version, size_t structsize)
|
||||
|
||||
/* OK, I'm ready */
|
||||
cinfo->global_state = DSTATE_START;
|
||||
|
||||
/* The master struct is used to store extension parameters, so we allocate it
|
||||
* here.
|
||||
*/
|
||||
cinfo->master = (struct jpeg_decomp_master *)
|
||||
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
|
||||
sizeof(my_decomp_master));
|
||||
MEMZERO(cinfo->master, sizeof(my_decomp_master));
|
||||
}
|
||||
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user