Compare commits
1203 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5198654f73 | ||
|
|
0d2908a62b | ||
|
|
ee39375c85 | ||
|
|
50d4088439 | ||
|
|
7e8ed0d448 | ||
|
|
6c1538470f | ||
|
|
6b05623682 | ||
|
|
c716918d0a | ||
|
|
619c20d5e8 | ||
|
|
f8a5b80cb0 | ||
|
|
cc11b90b22 | ||
|
|
0629d2a00d | ||
|
|
32ba839c57 | ||
|
|
1da5cf4251 | ||
|
|
fbf0a5fbc5 | ||
|
|
da75d56d6c | ||
|
|
02939f53a0 | ||
|
|
39b950076a | ||
|
|
c0f5e0b702 | ||
|
|
4966e1eec5 | ||
|
|
67753d1298 | ||
|
|
f446e5d5c7 | ||
|
|
0c8bf27a3c | ||
|
|
0aea1da9f0 | ||
|
|
85e2e0f9c2 | ||
|
|
f2ec34de52 | ||
|
|
5e8fd24131 | ||
|
|
71441f322e | ||
|
|
aa20343efd | ||
|
|
7faa703ebf | ||
|
|
e4189accd3 | ||
|
|
5ba6c7effb | ||
|
|
bf506e11b7 | ||
|
|
cdb6c34e1c | ||
|
|
576eef0509 | ||
|
|
f654cf0e2c | ||
|
|
70d831dc0d | ||
|
|
510e67c542 | ||
|
|
243aba148e | ||
|
|
2a4e7f1bc3 | ||
|
|
6a244cb514 | ||
|
|
2ee9faef10 | ||
|
|
a07787f423 | ||
|
|
ace9d06b9e | ||
|
|
752ee33e86 | ||
|
|
d44ffd9db0 | ||
|
|
598cd994f3 | ||
|
|
fa628eff6a | ||
|
|
933289f509 | ||
|
|
888d4075ee | ||
|
|
4802ddd7f7 | ||
|
|
9d8efde83b | ||
|
|
ddd54ff8a8 | ||
|
|
8a178239bd | ||
|
|
6c08ceb2ef | ||
|
|
0d435698f4 | ||
|
|
63c1674ebc | ||
|
|
864600d707 | ||
|
|
4ac7101056 | ||
|
|
4efb529bb7 | ||
|
|
f8e8039204 | ||
|
|
aa805bc89f | ||
|
|
81a64020e3 | ||
|
|
ed363b90ec | ||
|
|
a546be5141 | ||
|
|
c7dadd2d0b | ||
|
|
7475e59637 | ||
|
|
25e40dc42c | ||
|
|
296c8bad7e | ||
|
|
8b7ffebe42 | ||
|
|
a6b1bda094 | ||
|
|
a06aeb25f2 | ||
|
|
fa01dcb519 | ||
|
|
166aa51f5f | ||
|
|
6b99f99b88 | ||
|
|
3bc0839d7f | ||
|
|
7432a53e2b | ||
|
|
f645002fb6 | ||
|
|
0123dd2472 | ||
|
|
668bb847d5 | ||
|
|
3e2cf6909c | ||
|
|
f8dd3830eb | ||
|
|
c51334f4d0 | ||
|
|
779f5622aa | ||
|
|
6d172465cc | ||
|
|
fa6d5a29da | ||
|
|
79929eae12 | ||
|
|
ef62d51374 | ||
|
|
2c19e8cb79 | ||
|
|
00ace7679a | ||
|
|
775862809b | ||
|
|
0cbef40560 | ||
|
|
aed7d4661e | ||
|
|
bbaa3afe23 | ||
|
|
413ac73d98 | ||
|
|
faa4c44453 | ||
|
|
5dae26de7c | ||
|
|
2a41c84487 | ||
|
|
675ad04262 | ||
|
|
30ef0977be | ||
|
|
de852420c0 | ||
|
|
c1afc7921d | ||
|
|
c5c47edfd2 | ||
|
|
a9cad80d19 | ||
|
|
f03d5df238 | ||
|
|
f20cba1bb0 | ||
|
|
0e9c14e1bb | ||
|
|
602f5bea74 | ||
|
|
f46c7875dd | ||
|
|
9cb270a216 | ||
|
|
24ad6a0179 | ||
|
|
e6dd72874e | ||
|
|
60ba1963fe | ||
|
|
f7067a9e73 | ||
|
|
445d9b4196 | ||
|
|
f3db724c2d | ||
|
|
a8e56d39e5 | ||
|
|
1c5a481dfa | ||
|
|
3554fdb9cf | ||
|
|
e3ce6852a6 | ||
|
|
3c85fc4bb1 | ||
|
|
017339f715 | ||
|
|
63eb69de62 | ||
|
|
ebc7c3a760 | ||
|
|
5f1960f38c | ||
|
|
6b236241d2 | ||
|
|
4618c247df | ||
|
|
7e27264523 | ||
|
|
644fbcef01 | ||
|
|
90f94c9ec8 | ||
|
|
29165500c9 | ||
|
|
db2986c96f | ||
|
|
7b008bdf12 | ||
|
|
8a12b6a6a0 | ||
|
|
02fc068dc8 | ||
|
|
338ac421d7 | ||
|
|
1083a3bffb | ||
|
|
e581ede148 | ||
|
|
36b2fecd0c | ||
|
|
83d6a8e643 | ||
|
|
9de0e03f2f | ||
|
|
873b390172 | ||
|
|
6948e6c2bf | ||
|
|
d81d671d36 | ||
|
|
7434b5eb2f | ||
|
|
bf061b4a1c | ||
|
|
d0755fa501 | ||
|
|
c88ce1aa16 | ||
|
|
c629ccd7d9 | ||
|
|
41ebea736d | ||
|
|
2db4ee73ff | ||
|
|
bda865e181 | ||
|
|
a914cb2d9f | ||
|
|
9f785697e4 | ||
|
|
662bf6ba7b | ||
|
|
a7eb278df1 | ||
|
|
71539b3e13 | ||
|
|
564022ebda | ||
|
|
f9d1fcdf6f | ||
|
|
5d2d1d4c47 | ||
|
|
bdbb0138b9 | ||
|
|
78c2093bd4 | ||
|
|
a2cc95b827 | ||
|
|
7129fc6299 | ||
|
|
16db1b3f76 | ||
|
|
fdbbf10e90 | ||
|
|
ecb17510f0 | ||
|
|
33a9675dd3 | ||
|
|
a4d5a6bb1c | ||
|
|
3f97ede419 | ||
|
|
ba88b106d5 | ||
|
|
2ef1bec37f | ||
|
|
a1cea09935 | ||
|
|
c0756e6119 | ||
|
|
8b9eb07a36 | ||
|
|
2a21ae7463 | ||
|
|
cd1bee49e1 | ||
|
|
df3ace7e9c | ||
|
|
33a4b3d400 | ||
|
|
fe0750f0d2 | ||
|
|
a92d31df00 | ||
|
|
b052d67eb1 | ||
|
|
7ff92d811b | ||
|
|
d0d81e9c3a | ||
|
|
00696236df | ||
|
|
2d055dc7c7 | ||
|
|
50a3df621e | ||
|
|
ea0f2c2811 | ||
|
|
04962caf3a | ||
|
|
83052612d0 | ||
|
|
2bbe593b31 | ||
|
|
c62f3f40be | ||
|
|
ebfee8203a | ||
|
|
4dec5210ef | ||
|
|
bc4d369b49 | ||
|
|
d4a32f71d4 | ||
|
|
6bce2c22c7 | ||
|
|
bbe6136281 | ||
|
|
7c0efc8589 | ||
|
|
f4543c7379 | ||
|
|
ce6f3d8cd2 | ||
|
|
5f27ff790b | ||
|
|
d3c8cde986 | ||
|
|
804440b2e1 | ||
|
|
608dfddd22 | ||
|
|
370aaa61fd | ||
|
|
ba67ec6270 | ||
|
|
b83bfa68a9 | ||
|
|
7def1fcf5b | ||
|
|
91c739f541 | ||
|
|
fc76d48701 | ||
|
|
df9b78ab5c | ||
|
|
2e08021a9f | ||
|
|
ad67be3b36 | ||
|
|
873a32e8d0 | ||
|
|
e9ccb2ff22 | ||
|
|
6ab56c195e | ||
|
|
2e7c6109ff | ||
|
|
b2092f33c3 | ||
|
|
c87576eb09 | ||
|
|
fbff4b9500 | ||
|
|
d3a58a33cd | ||
|
|
05a5f4a9cc | ||
|
|
4db50792eb | ||
|
|
8c2c415847 | ||
|
|
5b9d498fa0 | ||
|
|
ab62cf7ba5 | ||
|
|
22505838cb | ||
|
|
11fe81d0df | ||
|
|
0b8d990cef | ||
|
|
ceb4712807 | ||
|
|
3c50582e77 | ||
|
|
b7efc273a0 | ||
|
|
39bd663c71 | ||
|
|
1dc81a3bae | ||
|
|
3a379eda44 | ||
|
|
5f434e6053 | ||
|
|
d11fc3c7c8 | ||
|
|
7464e5fe76 | ||
|
|
33f39a2818 | ||
|
|
049e5c80b9 | ||
|
|
594b7258cc | ||
|
|
0533b31891 | ||
|
|
cca53c920d | ||
|
|
5901802871 | ||
|
|
fbef31f76d | ||
|
|
1aa50b71d9 | ||
|
|
3adc64a4cb | ||
|
|
ccb1d12f53 | ||
|
|
82b8751482 | ||
|
|
c73a82c6aa | ||
|
|
b9f25333f6 | ||
|
|
0f6b96c68e | ||
|
|
eeea9ed397 | ||
|
|
b95528727f | ||
|
|
d9605b0560 | ||
|
|
40e6e8b2a2 | ||
|
|
514307e9e6 | ||
|
|
7388a54647 | ||
|
|
24aeccff3e | ||
|
|
e2f5c7cab3 | ||
|
|
8d4544b7bc | ||
|
|
e3d3cc073d | ||
|
|
b8f2b72acb | ||
|
|
7e6f1ee2d4 | ||
|
|
360ffd4441 | ||
|
|
76ef3c5dda | ||
|
|
6263c1fc1b | ||
|
|
ecfbabdbf3 | ||
|
|
46611eb0ee | ||
|
|
144e7b79e4 | ||
|
|
814fb56282 | ||
|
|
44e609fa3a | ||
|
|
f8301c92dd | ||
|
|
2c0b793539 | ||
|
|
5d5b9a497b | ||
|
|
99de998e2c | ||
|
|
b70fe7221e | ||
|
|
a37736dd43 | ||
|
|
c4c3ac6305 | ||
|
|
f66c307c2e | ||
|
|
38bfd451d5 | ||
|
|
0297e2a61d | ||
|
|
cfbb147aad | ||
|
|
e99d135774 | ||
|
|
f413bb5fb7 | ||
|
|
1d434bfdc9 | ||
|
|
8b11360a8b | ||
|
|
e7fe0653e5 | ||
|
|
84f9fbfe3e | ||
|
|
1bd801a872 | ||
|
|
6af3f00efa | ||
|
|
0d25e86574 | ||
|
|
e45363d7c2 | ||
|
|
ef1c66701a | ||
|
|
f017a5de0f | ||
|
|
e77bd79dc2 | ||
|
|
943adfb1fe | ||
|
|
43e9cee4b2 | ||
|
|
3b78447867 | ||
|
|
7824f70008 | ||
|
|
361192b972 | ||
|
|
1c6030799d | ||
|
|
6fc85ff960 | ||
|
|
a0908f87a5 | ||
|
|
4c778664d0 | ||
|
|
2732926d8d | ||
|
|
8c1d7c702e | ||
|
|
faac204f30 | ||
|
|
682c2b69f9 | ||
|
|
2dc2bbde66 | ||
|
|
d895eac10e | ||
|
|
378f4528ad | ||
|
|
e223a7ee9e | ||
|
|
2e3f284fa5 | ||
|
|
2dac0fbd04 | ||
|
|
9e74f518bd | ||
|
|
222279a4f0 | ||
|
|
038cf66ab2 | ||
|
|
a60728cb34 | ||
|
|
5610bb1fec | ||
|
|
86612bf441 | ||
|
|
af19664571 | ||
|
|
aa411b107f | ||
|
|
fdc2954e79 | ||
|
|
87768cc42c | ||
|
|
166227c3c7 | ||
|
|
1cf34093b9 | ||
|
|
d10edbc1ee | ||
|
|
67599a5dc6 | ||
|
|
dd12a235c5 | ||
|
|
92c7ae8911 | ||
|
|
7bb4dbb81b | ||
|
|
c4f4d18352 | ||
|
|
5e75573709 | ||
|
|
5bfddde8fd | ||
|
|
b7d9250185 | ||
|
|
821a20d0e8 | ||
|
|
a35cc3acf8 | ||
|
|
9e9df11625 | ||
|
|
960ea8fb66 | ||
|
|
d56079bc7e | ||
|
|
80d2fe24c8 | ||
|
|
b0073a2851 | ||
|
|
68a89e0170 | ||
|
|
5d4f2feeed | ||
|
|
3aa498b9e1 | ||
|
|
022952d37d | ||
|
|
593bb84e41 | ||
|
|
dbebf635b0 | ||
|
|
2ed7138390 | ||
|
|
88ae091ca1 | ||
|
|
009b6a50b5 | ||
|
|
885da7cef9 | ||
|
|
7f0bceb586 | ||
|
|
e4552b8143 | ||
|
|
1cdf41108b | ||
|
|
adb33bb1a4 | ||
|
|
8419f05afa | ||
|
|
435f18d902 | ||
|
|
bac0f31e7c | ||
|
|
897a525e3f | ||
|
|
2409fb9d03 | ||
|
|
89c9791c8e | ||
|
|
b861ef600c | ||
|
|
5c2f2cccb7 | ||
|
|
9961cd6aed | ||
|
|
6500625c07 | ||
|
|
b7e14cbaca | ||
|
|
005d7c52a7 | ||
|
|
b9e72234e1 | ||
|
|
618fb42ff1 | ||
|
|
9ba6976321 | ||
|
|
040c688263 | ||
|
|
d3d06f42c1 | ||
|
|
7d8ed9833e | ||
|
|
3317c65fb9 | ||
|
|
bf417e56e0 | ||
|
|
890f35098a | ||
|
|
1bb1e69186 | ||
|
|
abb6a513fa | ||
|
|
671fea53d1 | ||
|
|
857564d019 | ||
|
|
4f4d870822 | ||
|
|
540789427c | ||
|
|
c5aefc3659 | ||
|
|
db6e007c44 | ||
|
|
2d4ca5d710 | ||
|
|
3b80b515fe | ||
|
|
61298968fa | ||
|
|
bd029eb0f7 | ||
|
|
b767b5e6bb | ||
|
|
a7fa97cda5 | ||
|
|
98e6ffb50c | ||
|
|
fca3a77590 | ||
|
|
2bdc88ba48 | ||
|
|
b3633e930b | ||
|
|
8e4a07e20f | ||
|
|
07eadec225 | ||
|
|
811d68b21b | ||
|
|
2bf81e8eb7 | ||
|
|
c6c8c7911f | ||
|
|
3c6b1ba545 | ||
|
|
b4832c620f | ||
|
|
10138c9d35 | ||
|
|
6addfed58b | ||
|
|
01f46504ee | ||
|
|
e2563adb2e | ||
|
|
fa4e9b5926 | ||
|
|
0ccc581b8c | ||
|
|
198cc7c161 | ||
|
|
f934fc621e | ||
|
|
154c2dc749 | ||
|
|
afb8fce223 | ||
|
|
8abacdbd4b | ||
|
|
0a90c5d778 | ||
|
|
1719c57186 | ||
|
|
4aa11c8bb4 | ||
|
|
59aa40fa79 | ||
|
|
11b9c8802c | ||
|
|
0213d619bf | ||
|
|
04a34ea5bf | ||
|
|
ae0631474a | ||
|
|
ff3d754f29 | ||
|
|
0fb3247f9a | ||
|
|
24668df1df | ||
|
|
9ad7a4c6ca | ||
|
|
45b2cca4c0 | ||
|
|
2296d513c1 | ||
|
|
5ca8bf8738 | ||
|
|
6bcd8f8345 | ||
|
|
f4cdf5e8a2 | ||
|
|
b34b2ad711 | ||
|
|
458a2dd64e | ||
|
|
e99b408fe6 | ||
|
|
0442d164dc | ||
|
|
aa5a1808fe | ||
|
|
3f2e3b11f0 | ||
|
|
41e3657631 | ||
|
|
64da9d6ba8 | ||
|
|
6accd550fd | ||
|
|
7421f92041 | ||
|
|
22be928d5a | ||
|
|
6586b254ee | ||
|
|
cd5c8559d6 | ||
|
|
ca4751d1df | ||
|
|
4fcdeb795d | ||
|
|
771fbdeb99 | ||
|
|
52559c88b4 | ||
|
|
7440604f2b | ||
|
|
aaa5ae742a | ||
|
|
2f83944e9b | ||
|
|
5bede571dd | ||
|
|
da64629c62 | ||
|
|
afa79bd62f | ||
|
|
c8a3df184e | ||
|
|
45b9c02bd7 | ||
|
|
9431d5c677 | ||
|
|
8e4bc5dfb0 | ||
|
|
0803520704 | ||
|
|
61130e332a | ||
|
|
3d625746d4 | ||
|
|
b8614f5d9f | ||
|
|
931a4929bb | ||
|
|
2de2cf9e54 | ||
|
|
f42e2be51a | ||
|
|
9f804a5590 | ||
|
|
0af70afcea | ||
|
|
22c11c2e20 | ||
|
|
9d0c277115 | ||
|
|
c543f1b6f9 | ||
|
|
5f55e384a9 | ||
|
|
70d2cc0e04 | ||
|
|
7f90cedc40 | ||
|
|
be2b542bba | ||
|
|
22c2e01d7a | ||
|
|
8b3e32bf48 | ||
|
|
1f63b8d9d1 | ||
|
|
0b818b4134 | ||
|
|
e160ae113f | ||
|
|
a0d29e0364 | ||
|
|
cc4145ce2f | ||
|
|
9f8a003137 | ||
|
|
fc9fec465f | ||
|
|
3252455c3f | ||
|
|
a1c870d302 | ||
|
|
81de93c8a5 | ||
|
|
f46db556e3 | ||
|
|
ba4a6c32f8 | ||
|
|
6a9229ae96 | ||
|
|
8adaa68d4b | ||
|
|
670d50d910 | ||
|
|
00113423f9 | ||
|
|
647786ee51 | ||
|
|
c4c137f5e9 | ||
|
|
eebb09941b | ||
|
|
fdaa047891 | ||
|
|
ba01bcbbc5 | ||
|
|
1e7853c0cc | ||
|
|
af67ada048 | ||
|
|
58c992a2ae | ||
|
|
cf55125611 | ||
|
|
c27f55d6f9 | ||
|
|
b684672502 | ||
|
|
33fb70b328 | ||
|
|
ecc22a1007 | ||
|
|
5ae35d8a86 | ||
|
|
6b041a9221 | ||
|
|
13ac9e8554 | ||
|
|
5b620429e5 | ||
|
|
628b982497 | ||
|
|
41f0b53f18 | ||
|
|
e14730f6cc | ||
|
|
674a037ec7 | ||
|
|
f914eb1111 | ||
|
|
7d12636291 | ||
|
|
f0f1ce1b7f | ||
|
|
ee4c7d28ab | ||
|
|
9c1aac4639 | ||
|
|
936ae5a813 | ||
|
|
de30fe9460 | ||
|
|
6683a2411a | ||
|
|
e456841c1c | ||
|
|
1b9184db5b | ||
|
|
8f94c2b084 | ||
|
|
70d3c1aeec | ||
|
|
a6c9eaf155 | ||
|
|
f506e2cbb5 | ||
|
|
05cd6e6ea0 | ||
|
|
0a9250c2c0 | ||
|
|
019d51d4f1 | ||
|
|
7b8366223a | ||
|
|
52ce04b193 | ||
|
|
b368b2f300 | ||
|
|
0651ee366b | ||
|
|
791e9b4316 | ||
|
|
7702469e15 | ||
|
|
c19ea22c80 | ||
|
|
b03457663d | ||
|
|
448d12d298 | ||
|
|
8aab7a1dad | ||
|
|
ca423d39a3 | ||
|
|
1086af6541 | ||
|
|
7e768e9849 | ||
|
|
9d7101c8f6 | ||
|
|
c2dab98ea0 | ||
|
|
c17aa549ab | ||
|
|
c650f3c220 | ||
|
|
25fc4cc39f | ||
|
|
fee19c375b | ||
|
|
65586bf2be | ||
|
|
f3e8b02df5 | ||
|
|
6de1345133 | ||
|
|
2a74bcdce4 | ||
|
|
c06e5f2928 | ||
|
|
2c6f3ed984 | ||
|
|
b7af9a7762 | ||
|
|
f52a5670da | ||
|
|
33e613d948 | ||
|
|
a856d7bf70 | ||
|
|
5d0234739e | ||
|
|
aad846c416 | ||
|
|
ba12191cc8 | ||
|
|
4a2fe27cb6 | ||
|
|
2aedbe637d | ||
|
|
05c7b00f1d | ||
|
|
0441bdfd88 | ||
|
|
efbdb72ac3 | ||
|
|
92eb806f1d | ||
|
|
dbfa2648d8 | ||
|
|
50b6c75d9d | ||
|
|
e74d1c77ea | ||
|
|
016f5cdbcf | ||
|
|
40feae60f4 | ||
|
|
df1fccf695 | ||
|
|
2f7d48a87e | ||
|
|
da2b560b34 | ||
|
|
faff5f4891 | ||
|
|
a112f12efd | ||
|
|
5e805d2f4b | ||
|
|
030b6fc1c1 | ||
|
|
88d2e0d792 | ||
|
|
8644ed2a04 | ||
|
|
a6b5eab50f | ||
|
|
9d14254225 | ||
|
|
311728cd98 | ||
|
|
44e6c174ee | ||
|
|
d2e0417960 | ||
|
|
aa31d1d14b | ||
|
|
4cf0357c0f | ||
|
|
0f654d4674 | ||
|
|
14faccfa93 | ||
|
|
e420e3a19c | ||
|
|
5bd7a89f6a | ||
|
|
230440c8e7 | ||
|
|
c1e4151607 | ||
|
|
67420f1fa1 | ||
|
|
51b8cd674a | ||
|
|
90d7c850fa | ||
|
|
8ec31e2fb2 | ||
|
|
e0eea893be | ||
|
|
f2e5e59720 | ||
|
|
1df063383d | ||
|
|
1b0a8cdd79 | ||
|
|
6fa79e5dbf | ||
|
|
ed6a876521 | ||
|
|
16b1fdf84d | ||
|
|
d8b3658cdf | ||
|
|
d475ea928b | ||
|
|
c2e128f8c5 | ||
|
|
9b0741512e | ||
|
|
211ab00fc4 | ||
|
|
de5d1ec4e4 | ||
|
|
91ad5467ab | ||
|
|
5d1cec9a79 | ||
|
|
bc1e5525b0 | ||
|
|
f343d7332a | ||
|
|
1109f68db6 | ||
|
|
50b3728013 | ||
|
|
42df487a35 | ||
|
|
85a878bf07 | ||
|
|
4a87a4a6bd | ||
|
|
066c44b341 | ||
|
|
ba8383452c | ||
|
|
d345306ecc | ||
|
|
edf4d637e1 | ||
|
|
c02c1fa775 | ||
|
|
a20f5d026a | ||
|
|
d3aa5c9f94 | ||
|
|
e808882c95 | ||
|
|
a02a9af565 | ||
|
|
061f96dc7d | ||
|
|
00e258dedd | ||
|
|
7672bd3ac5 | ||
|
|
00a69f142a | ||
|
|
adce3b2eeb | ||
|
|
6070e60924 | ||
|
|
dbb92f2eee | ||
|
|
33ddbcc5b3 | ||
|
|
9227c0d77b | ||
|
|
29b738d9b6 | ||
|
|
22b4359e42 | ||
|
|
35c1909f0b | ||
|
|
8de30b8c28 | ||
|
|
14dfb6b81d | ||
|
|
ce02d1d62a | ||
|
|
157c7635db | ||
|
|
b10d6c827d | ||
|
|
cf446479aa | ||
|
|
4658c17c9e | ||
|
|
869095444e | ||
|
|
489864aefa | ||
|
|
2bfd5d8c7d | ||
|
|
71be635a89 | ||
|
|
e3f7e75525 | ||
|
|
b6fb92eeff | ||
|
|
04dc101077 | ||
|
|
d02c734a19 | ||
|
|
9d5f6b9e33 | ||
|
|
de8be2e9f0 | ||
|
|
64d644bcc3 | ||
|
|
395bf7e218 | ||
|
|
67810edcf7 | ||
|
|
cd39e3abc1 | ||
|
|
14ae3e4959 | ||
|
|
ac31113152 | ||
|
|
42c015d5a2 | ||
|
|
49e17cd6a7 | ||
|
|
5e3346ba58 | ||
|
|
2bc15f6bac | ||
|
|
1d4c5744a8 | ||
|
|
24b83b5b0c | ||
|
|
8e732e32be | ||
|
|
e3086351f9 | ||
|
|
3ee533eb7c | ||
|
|
626f00e5c8 | ||
|
|
994f49d8c2 | ||
|
|
411c62396d | ||
|
|
4703b773af | ||
|
|
2ff9d2a26d | ||
|
|
d25fe3fd18 | ||
|
|
9682a6e036 | ||
|
|
a501250666 | ||
|
|
9bfb9ee536 | ||
|
|
8338344cf8 | ||
|
|
abeb01d5f1 | ||
|
|
16d4cc3b34 | ||
|
|
7f352fc982 | ||
|
|
34e538a8ca | ||
|
|
3fbb13e0cd | ||
|
|
3bdddc666b | ||
|
|
c2ddde57c4 | ||
|
|
7a8cefdb71 | ||
|
|
4fa973b836 | ||
|
|
3ec2702bfc | ||
|
|
aa92628cd4 | ||
|
|
6be4598bec | ||
|
|
14a2cd0317 | ||
|
|
fcdffa2265 | ||
|
|
d6e51e6cde | ||
|
|
ef534974a8 | ||
|
|
99799a6c29 | ||
|
|
a399b5bbea | ||
|
|
6f78dc30c5 | ||
|
|
f84a4eb00d | ||
|
|
c3f61d6f57 | ||
|
|
65b1230f18 | ||
|
|
ed7ec8322c | ||
|
|
2540beb951 | ||
|
|
431e5937b5 | ||
|
|
2fea4ae8bf | ||
|
|
5d3d11ee66 | ||
|
|
bdc88147bb | ||
|
|
47ce37c6b0 | ||
|
|
93598f71bb | ||
|
|
82c0d4c9e9 | ||
|
|
a9300ce862 | ||
|
|
4611077eab | ||
|
|
667766d07f | ||
|
|
31a13fcbb2 | ||
|
|
10979fb0fe | ||
|
|
5bc9a1076e | ||
|
|
cc2cf7db19 | ||
|
|
d5a3955024 | ||
|
|
8b351a8fa6 | ||
|
|
9a77f7f3ce | ||
|
|
9237ae5f3e | ||
|
|
0e72ee1ccc | ||
|
|
7e60806f34 | ||
|
|
115955e36e | ||
|
|
90a42bb4d2 | ||
|
|
d6d704d30d | ||
|
|
3f8b9470a9 | ||
|
|
a391158b34 | ||
|
|
187e286f44 | ||
|
|
1c610ebfa3 | ||
|
|
5c4e594064 | ||
|
|
d56b1c71cd | ||
|
|
2139a653b0 | ||
|
|
f634833a16 | ||
|
|
892ed7e6b4 | ||
|
|
977458e00d | ||
|
|
76e7801a58 | ||
|
|
7ed5fe39c9 | ||
|
|
35acffcf0c | ||
|
|
1fbaddde3b | ||
|
|
51a4282abc | ||
|
|
bcfb6ed138 | ||
|
|
59fd32e903 | ||
|
|
efc012f0b5 | ||
|
|
d8cc0513ee | ||
|
|
f90d1d84c7 | ||
|
|
22faf366c3 | ||
|
|
552dd27bde | ||
|
|
4c5eae3bd0 | ||
|
|
4a0cf492f4 | ||
|
|
ac0eff91f6 | ||
|
|
d04c64b75a | ||
|
|
d594af38e1 | ||
|
|
fed7b30436 | ||
|
|
32fa016937 | ||
|
|
5526cf13d0 | ||
|
|
58a0845738 | ||
|
|
0260fd6196 | ||
|
|
d5bc5379a4 | ||
|
|
c5efebc394 | ||
|
|
15ff5c1feb | ||
|
|
696f25e052 | ||
|
|
074a6f24bb | ||
|
|
89d167655e | ||
|
|
91332307b5 | ||
|
|
a43dd1aeb7 | ||
|
|
e3c79837d1 | ||
|
|
77f2cf4e75 | ||
|
|
19f178b9f3 | ||
|
|
5e9da424a4 | ||
|
|
7e1d9c4e42 | ||
|
|
3bcf42b4ac | ||
|
|
5e9c5f9ff7 | ||
|
|
086cc1e5cc | ||
|
|
1873d021c7 | ||
|
|
4be061b162 | ||
|
|
66b6d80ed6 | ||
|
|
92df122286 | ||
|
|
0c7b322efe | ||
|
|
43f33a4d19 | ||
|
|
b02715c1b1 | ||
|
|
ef842c142c | ||
|
|
b58789cb91 | ||
|
|
95dfd2ab45 | ||
|
|
581609cebd | ||
|
|
e701ed74c0 | ||
|
|
ce03e93dfd | ||
|
|
be085e08b3 | ||
|
|
da6a1f6c76 | ||
|
|
407cd22df3 | ||
|
|
43577eacf9 | ||
|
|
045e8f7f07 | ||
|
|
c17c5c8188 | ||
|
|
f2cb47a275 | ||
|
|
a8bb67e5a9 | ||
|
|
3c620745a7 | ||
|
|
3f2ef301c4 | ||
|
|
28db388687 | ||
|
|
a3845bd44b | ||
|
|
c8ddbca289 | ||
|
|
b8530db29f | ||
|
|
cc9133fadf | ||
|
|
02156d7c53 | ||
|
|
8b3f7c6ff0 | ||
|
|
cc8df443e6 | ||
|
|
8755a6805a | ||
|
|
7ce8dfe258 | ||
|
|
3405865cd2 | ||
|
|
18f4b35de5 | ||
|
|
1630b15a0e | ||
|
|
4dc725069a | ||
|
|
2a07591e9b | ||
|
|
6ce4882e2a | ||
|
|
4e08a1d3bc | ||
|
|
a311c1cd21 | ||
|
|
4802041125 | ||
|
|
8bde192230 | ||
|
|
e005c1f751 | ||
|
|
e7c15f3e41 | ||
|
|
1a9a4d13c7 | ||
|
|
892b81cb44 | ||
|
|
38218222cd | ||
|
|
05c1af2f57 | ||
|
|
9eecea2a8e | ||
|
|
2c31f2b499 | ||
|
|
86eefe66a6 | ||
|
|
964a22d663 | ||
|
|
b457b5d42e | ||
|
|
400d484c41 | ||
|
|
47ae9a3e0f | ||
|
|
22f9ca067c | ||
|
|
85712cb267 | ||
|
|
055ddf28b4 | ||
|
|
ad02bb6032 | ||
|
|
6262130033 | ||
|
|
756095aaf0 | ||
|
|
25299d0d2f | ||
|
|
439527e0b9 | ||
|
|
a683760d1c | ||
|
|
f46386f87d | ||
|
|
10e445c341 | ||
|
|
e4f9ae630d | ||
|
|
8252677857 | ||
|
|
452d7857cc | ||
|
|
b9e093c1a8 | ||
|
|
aa8b75afa8 | ||
|
|
50103b80ca | ||
|
|
d850ff7386 | ||
|
|
d70d48ea3e | ||
|
|
7404770855 | ||
|
|
b56211da74 | ||
|
|
4c2c2e7467 | ||
|
|
1913d03c89 | ||
|
|
023d8b367d | ||
|
|
f0512c5686 | ||
|
|
62bb97b9ac | ||
|
|
2719c40abc | ||
|
|
3bc6dc4305 | ||
|
|
be2de6bc98 | ||
|
|
a117c67704 | ||
|
|
74ff1aac8e | ||
|
|
345c3eed92 | ||
|
|
3bfca02ca0 | ||
|
|
a4b6e4cd66 | ||
|
|
763f26b29a | ||
|
|
4ac54c3cd6 | ||
|
|
c20ba350ad | ||
|
|
5cc45fd6df | ||
|
|
eaad60012a | ||
|
|
36adfee700 | ||
|
|
b10fb30664 | ||
|
|
d83e1f8900 | ||
|
|
26a69b1a29 | ||
|
|
5a5af28b7c | ||
|
|
1dd9985842 | ||
|
|
6ca296de5d | ||
|
|
21b5c4bc4d | ||
|
|
9ca11b80fc | ||
|
|
2e1b59c09d | ||
|
|
3c7c57b3ad | ||
|
|
fd7105e1d6 | ||
|
|
38b8c2f0ef | ||
|
|
6ac57da9cd | ||
|
|
4d53f88ea5 | ||
|
|
4add559463 | ||
|
|
f0d2577482 | ||
|
|
55a9cbffe7 | ||
|
|
f54cc16225 | ||
|
|
f80fb63847 | ||
|
|
33c17e84f2 | ||
|
|
979a590374 | ||
|
|
c0cfde855c | ||
|
|
1f981a0210 | ||
|
|
2e25b45529 | ||
|
|
bdb1602e25 | ||
|
|
fe418b6240 | ||
|
|
19e6975e90 | ||
|
|
a97cc7c538 | ||
|
|
d06a3aec90 | ||
|
|
2f1473783f | ||
|
|
a6ae163f09 | ||
|
|
76f402f51b | ||
|
|
b6d2ffa0c3 | ||
|
|
b6563b2d50 | ||
|
|
024e30659f | ||
|
|
cd9000a034 | ||
|
|
24fd779ccf | ||
|
|
366f303099 | ||
|
|
409b94e337 | ||
|
|
b4aae95e78 | ||
|
|
8705f11462 | ||
|
|
627856c2cf | ||
|
|
257a3bcf05 | ||
|
|
117bacff3a | ||
|
|
d910129db9 | ||
|
|
e300354827 | ||
|
|
abd867408b | ||
|
|
7a4d1f0fdb | ||
|
|
89c9085fcd | ||
|
|
71cbfe8860 | ||
|
|
76a6ac5c44 | ||
|
|
1040f1ac81 | ||
|
|
4b8c2743fb | ||
|
|
2413fda880 | ||
|
|
d91d48ed83 | ||
|
|
364c050c1a | ||
|
|
f228b139fa | ||
|
|
6a6ac8951c | ||
|
|
deab46b949 | ||
|
|
5b8f6495d1 | ||
|
|
edc8253164 | ||
|
|
8f91c754c8 | ||
|
|
e0b2920fdd | ||
|
|
03c5cacaec | ||
|
|
d8d4b03bc5 | ||
|
|
ce23b96141 | ||
|
|
75905554de | ||
|
|
ea84d5dd61 | ||
|
|
bb8322f4c8 | ||
|
|
a478af780a | ||
|
|
21e8297c16 | ||
|
|
0879ed8eaf | ||
|
|
53c7d3bc82 | ||
|
|
7e08d60891 | ||
|
|
1dc925aa11 | ||
|
|
fd644379ed | ||
|
|
a119e8f8d0 | ||
|
|
153f54b94f | ||
|
|
ddf1f74cc3 | ||
|
|
674ea621df | ||
|
|
3576a86dfb | ||
|
|
7a3ae15f7d | ||
|
|
be1aa6e080 | ||
|
|
8dc66668e6 | ||
|
|
65ee62c698 | ||
|
|
ba825db7ad | ||
|
|
c49c2e80e8 | ||
|
|
74e983609c | ||
|
|
aa25adaaa0 | ||
|
|
d0d0f09d40 | ||
|
|
0b1530e1e3 | ||
|
|
b9d65553d7 | ||
|
|
1b6f7d3992 | ||
|
|
30ce53edf9 | ||
|
|
c37c0d1195 | ||
|
|
031227571f | ||
|
|
5e8d78ff40 | ||
|
|
134d29791f | ||
|
|
d982f7d040 | ||
|
|
8737bd492f | ||
|
|
ddef5f56d3 | ||
|
|
09345b6eb4 | ||
|
|
7dcc736177 | ||
|
|
2f85b88bdf | ||
|
|
84aba108d6 | ||
|
|
843e7306a1 | ||
|
|
1c7414ba64 | ||
|
|
6e6910e89b | ||
|
|
3b5b551723 | ||
|
|
7a4df47c41 | ||
|
|
faab86eecc | ||
|
|
80a67be49b | ||
|
|
3f60381c7a | ||
|
|
6993ea56e9 | ||
|
|
7aa7b6dbec | ||
|
|
3d9b2409ce | ||
|
|
82b3873e31 | ||
|
|
1edebfd17b | ||
|
|
aaa3706132 | ||
|
|
c840af9323 | ||
|
|
bf617c729e | ||
|
|
7387b7409a | ||
|
|
36a5d9d238 | ||
|
|
83d312b3f5 | ||
|
|
66ecd42c6e | ||
|
|
bb631abf79 | ||
|
|
b0a89debf1 | ||
|
|
e4451444a3 | ||
|
|
e086462c22 | ||
|
|
f77287acae | ||
|
|
85f7af7f92 | ||
|
|
fe51f97001 | ||
|
|
e480777a66 | ||
|
|
daddf82191 | ||
|
|
6be102a7a4 | ||
|
|
d40bcf1723 | ||
|
|
8b4725152d | ||
|
|
9582b1cdee | ||
|
|
7cdba23378 | ||
|
|
68f4bb1ad4 | ||
|
|
5b6447311e | ||
|
|
0cc699da2a | ||
|
|
2a16fd79cc | ||
|
|
0f7601bf85 | ||
|
|
1d7eaef724 | ||
|
|
ac87162327 | ||
|
|
7321ba352c | ||
|
|
c3a5da1def | ||
|
|
ec65eee13b | ||
|
|
d8f6cdb23b | ||
|
|
199c556b18 | ||
|
|
719a2b62ad | ||
|
|
fcbd92d31e | ||
|
|
20e5edecac | ||
|
|
c2bfb82eb7 | ||
|
|
f3a31100ec | ||
|
|
fe706f6e28 | ||
|
|
0d30199d2b | ||
|
|
30d3cc5854 | ||
|
|
c6838b243e | ||
|
|
56e1973681 | ||
|
|
efe0be8eeb | ||
|
|
a0609a5e50 | ||
|
|
0298a12bd8 | ||
|
|
689114d5ef | ||
|
|
bb4cee56c8 | ||
|
|
5c8514046b | ||
|
|
ea3b2ebdc8 | ||
|
|
5926e27a45 | ||
|
|
c139c254e6 | ||
|
|
aebd271f92 | ||
|
|
14b2ea965a | ||
|
|
bab8a11dd8 | ||
|
|
dafd6e3e76 | ||
|
|
e8b4d69f1a | ||
|
|
659295da13 | ||
|
|
b8c4739843 | ||
|
|
9f90f4835e | ||
|
|
a443f36e44 | ||
|
|
90965c3d7e | ||
|
|
3ee7a1103f | ||
|
|
f72fb65759 | ||
|
|
852575c603 | ||
|
|
3a2d3ad1c5 | ||
|
|
7e2aebae6b | ||
|
|
04a22b9409 | ||
|
|
f626e49ae2 | ||
|
|
bd8a138197 | ||
|
|
5fe77ba686 | ||
|
|
b079982e2c | ||
|
|
34e8ec1eef | ||
|
|
8dcefc5dbd | ||
|
|
40b41cfd6a | ||
|
|
22659e40da | ||
|
|
69ec314fb5 | ||
|
|
b50c3ca33f | ||
|
|
b96fd4daa4 | ||
|
|
c3574b2b38 | ||
|
|
e25f0c337c | ||
|
|
feca7e5b6f | ||
|
|
ede97ef4b4 | ||
|
|
f37c1f3363 | ||
|
|
4c24ec5383 | ||
|
|
def5d225f9 | ||
|
|
3b9219b882 | ||
|
|
00c5bcbd7b | ||
|
|
9c5f5a5314 | ||
|
|
0d88231511 | ||
|
|
668d21fe80 | ||
|
|
af894dd7be | ||
|
|
27c9e4290d | ||
|
|
70d9c0bd55 | ||
|
|
f40efc062f | ||
|
|
16299d15a8 | ||
|
|
68e57edef5 | ||
|
|
ff6f4bcf88 | ||
|
|
e35e2360e5 | ||
|
|
cb2dd6c427 | ||
|
|
1798b82a86 | ||
|
|
6b0f9283dd | ||
|
|
79fc8d851e | ||
|
|
eda68dbd6a | ||
|
|
b754ae7260 | ||
|
|
f7f66301b2 | ||
|
|
bfa7c1f2ee | ||
|
|
615df6941d | ||
|
|
4b24e9833c | ||
|
|
1a275c641e | ||
|
|
41f55c093a | ||
|
|
16c97143f3 | ||
|
|
0baf670330 | ||
|
|
357eba2331 | ||
|
|
54656d1d59 | ||
|
|
c5414ae082 | ||
|
|
24b8211e9f | ||
|
|
f14f1a0dc3 | ||
|
|
9821061877 | ||
|
|
98f16a9b4d | ||
|
|
7a9a82bf06 | ||
|
|
db1a243631 | ||
|
|
55e8d83a10 | ||
|
|
5838d99dfe | ||
|
|
825d07f5d5 | ||
|
|
64462a3578 | ||
|
|
36db4985d5 | ||
|
|
4240858f53 | ||
|
|
ea1c8a3360 | ||
|
|
c65c17f5ea | ||
|
|
392b89a5a5 | ||
|
|
3b1c09417f | ||
|
|
f222c7547c | ||
|
|
444950fec8 | ||
|
|
3ca410784c | ||
|
|
4c1c7f5a52 | ||
|
|
2e069ba879 | ||
|
|
c61c02e031 | ||
|
|
05e874048b | ||
|
|
4f2536e187 | ||
|
|
7d3a698e52 | ||
|
|
49933cde47 | ||
|
|
63c18bbe6c | ||
|
|
1fee9f05fb | ||
|
|
b2c532f62d | ||
|
|
9a6243c913 | ||
|
|
4d289a4912 | ||
|
|
5b3da6d4e3 | ||
|
|
95de778c46 | ||
|
|
f585c78fe6 | ||
|
|
164cb4004b | ||
|
|
cb9c102ddb | ||
|
|
0cae220381 | ||
|
|
389975d9ee | ||
|
|
a1a5989d85 | ||
|
|
8311c51c07 | ||
|
|
2691a24539 | ||
|
|
1bd552079d | ||
|
|
daa07a8ac3 | ||
|
|
7a9b1adb5f | ||
|
|
769c80420b | ||
|
|
6212076d91 | ||
|
|
c8eee1dffe | ||
|
|
88617301e9 | ||
|
|
33d5bcb4f3 | ||
|
|
9b74d3f224 | ||
|
|
5cac289deb | ||
|
|
cf75c6f1be | ||
|
|
b0716b6875 | ||
|
|
adce982c72 | ||
|
|
d8d563f60a | ||
|
|
9cc9035c67 | ||
|
|
af9ce6951a | ||
|
|
c689a22bb0 | ||
|
|
65b7cbecf3 | ||
|
|
f7e0f6d5f5 | ||
|
|
6b7eeb745c | ||
|
|
3901fbb143 | ||
|
|
bf9f8d041b | ||
|
|
a63544a357 | ||
|
|
98d1d692b5 | ||
|
|
de4b417a81 | ||
|
|
de0008d00e | ||
|
|
89e518a098 | ||
|
|
59641bb95f | ||
|
|
a06a8bc928 | ||
|
|
0a22f153ea | ||
|
|
4a7a6cc081 | ||
|
|
093fe3bb51 | ||
|
|
205cdc87d4 | ||
|
|
a5cccc9dbf | ||
|
|
c7de3b4d83 | ||
|
|
9a4a8bb721 | ||
|
|
649fe159ce | ||
|
|
e1594812ac | ||
|
|
863946aebd | ||
|
|
c5cf41164a | ||
|
|
a4f55b50c9 | ||
|
|
d7bacc0721 | ||
|
|
f1962bc0ce | ||
|
|
8622727c09 | ||
|
|
ebd6166488 | ||
|
|
f83b43b7c9 | ||
|
|
e2796477e6 | ||
|
|
c653640b0d | ||
|
|
2d830a0e0c | ||
|
|
6687665312 | ||
|
|
d88cc24540 | ||
|
|
3347727ebb |
7
.gitauthors
Normal file
7
.gitauthors
Normal file
@@ -0,0 +1,7 @@
|
||||
|
||||
dcommander = DRC <dcommander@users.sourceforge.net>
|
||||
astrand = Peter Åstrand <astrand@cendio.se>
|
||||
ossman_ = Pierre Ossman <ossman@cendio.se>
|
||||
const_k = Constantin Kaplinsky <const@tightvnc.com>
|
||||
atkac = Adam Tkac <atkac@redhat.com>
|
||||
|
||||
44
.gitignore
vendored
Normal file
44
.gitignore
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
Makefile.in
|
||||
Makefile
|
||||
/CMakeFiles
|
||||
/autom4te.cache
|
||||
/aclocal.m4
|
||||
/compile
|
||||
/configure
|
||||
/depcomp
|
||||
/install-sh
|
||||
/libtool
|
||||
/missing
|
||||
/stamp-h*
|
||||
/java/classnoinst.stamp
|
||||
/pkgscripts/
|
||||
/jconfig.h
|
||||
/jconfigint.h
|
||||
/config.guess
|
||||
/config.h
|
||||
/config.h.in
|
||||
/config.log
|
||||
/config.status
|
||||
/config.sub
|
||||
/ltmain.sh
|
||||
/ar-lib
|
||||
/libjpeg.map
|
||||
/.libs/
|
||||
/simd/.libs/
|
||||
/simd/jsimdcfg.inc
|
||||
*.o
|
||||
*.lo
|
||||
*.la
|
||||
/cjpeg
|
||||
/djpeg
|
||||
/jcstest
|
||||
/jpegtran
|
||||
/jpegyuv
|
||||
/md5/md5cmp
|
||||
/rdjpgcom
|
||||
/test_enc_*
|
||||
/tjbench
|
||||
/tjbenchtest
|
||||
/tjunittest
|
||||
/wrjpgcom
|
||||
/yuvjpeg
|
||||
510
BUILDING.txt
510
BUILDING.txt
@@ -7,6 +7,7 @@
|
||||
Build Requirements
|
||||
==================
|
||||
|
||||
-- pkg-config
|
||||
-- autoconf 2.56 or later
|
||||
-- automake 1.7 or later
|
||||
-- libtool 1.4 or later
|
||||
@@ -35,27 +36,15 @@ Build Requirements
|
||||
|
||||
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 libmozjpeg.
|
||||
Building libmozjpeg with LLVM-GCC v4.2 results in a 10% performance
|
||||
degradation when compressing using 64-bit code, relative to building
|
||||
libmozjpeg with GCC v4.2. Building libmozjpeg with LLVM (clang)
|
||||
results in a 20% performance degradation when compressing using 64-bit
|
||||
code, relative to building libmozjpeg 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.
|
||||
-- GCC v4.1 (or later) or clang recommended
|
||||
|
||||
-- If building the MozJPEG Java wrapper, JDK or OpenJDK 1.5 or later is
|
||||
required. Some systems, such as OS X 10.4, Solaris 10 and later, and Red
|
||||
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.
|
||||
-- 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.
|
||||
|
||||
|
||||
==================
|
||||
@@ -64,30 +53,40 @@ 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 libmozjpeg source directory. You
|
||||
need not necessarily be the same as the mozjpeg source directory. You
|
||||
can create multiple independent binary directories, in which different versions
|
||||
of libmozjpeg can be built from the same source tree using different
|
||||
of mozjpeg 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 libmozjpeg source
|
||||
binary directory, whereas {source_directory} refers to the mozjpeg source
|
||||
directory. For in-tree builds, these directories are the same.
|
||||
|
||||
|
||||
======================
|
||||
Building libmozjpeg
|
||||
======================
|
||||
================
|
||||
Building mozjpeg
|
||||
================
|
||||
|
||||
The following procedure will build libmozjpeg on Linux, FreeBSD, Cygwin, and
|
||||
The following procedure will build mozjpeg on Linux, FreeBSD, Cygwin, and
|
||||
Solaris/x86 systems (on Solaris, this generates a 32-bit library. See below
|
||||
for 64-bit build instructions.)
|
||||
|
||||
Simple Release tar.gz Source Build
|
||||
----------------------------------
|
||||
|
||||
cd {source_directory}
|
||||
./configure [additional configure flags]
|
||||
make
|
||||
|
||||
Non-Release Source Build (e.g. GitHub clone)
|
||||
--------------------------------------------
|
||||
|
||||
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 libmozjpeg from the SVN repository.
|
||||
Results
|
||||
-------
|
||||
|
||||
This will generate the following files under .libs/
|
||||
|
||||
@@ -99,7 +98,7 @@ This will generate the following files under .libs/
|
||||
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
|
||||
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.
|
||||
|
||||
@@ -110,28 +109,28 @@ This will generate the following files under .libs/
|
||||
libjpeg.dll.a (Cygwin)
|
||||
Import library for the libjpeg API
|
||||
|
||||
libmozjpeg.a
|
||||
Static link library for the MozJPEG API
|
||||
libturbojpeg.a
|
||||
Static link library for the TurboJPEG API
|
||||
|
||||
libmozjpeg.so.0.0.0 (Linux, Unix)
|
||||
libmozjpeg.0.0.0.dylib (OS X)
|
||||
cygmozjpeg-0.dll (Cygwin)
|
||||
Shared library for the MozJPEG 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
|
||||
|
||||
libmozjpeg.so (Linux, Unix)
|
||||
libmozjpeg.dylib (OS X)
|
||||
Development symlink for the MozJPEG API
|
||||
libturbojpeg.so (Linux, Unix)
|
||||
libturbojpeg.dylib (OS X)
|
||||
Development symlink for the TurboJPEG API
|
||||
|
||||
libmozjpeg.dll.a (Cygwin)
|
||||
Import library for the MozJPEG 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
|
||||
libmozjpeg that is API/ABI-compatible with libjpeg v7. Add --with-jpeg8 to
|
||||
the configure command to build a version of libmozjpeg that is
|
||||
mozjpeg that is API/ABI-compatible with libjpeg v7. Add --with-jpeg8 to
|
||||
the configure command to build a version of mozjpeg that is
|
||||
API/ABI-compatible with libjpeg v8. See README-turbo.txt for more information
|
||||
on libjpeg v7 and v8 emulation.
|
||||
|
||||
@@ -140,7 +139,7 @@ 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 libmozjpeg that lacks the
|
||||
configure command line to build a version of mozjpeg 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.
|
||||
@@ -150,7 +149,7 @@ Arithmetic Coding Support
|
||||
-------------------------
|
||||
|
||||
Since the patent on arithmetic coding has expired, this functionality has been
|
||||
included in this release of libmozjpeg. libmozjpeg's implementation is
|
||||
included in this release of mozjpeg. mozjpeg'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
|
||||
@@ -158,11 +157,11 @@ add --without-arith-enc or --without-arith-dec to the configure command line to
|
||||
disable encoding or decoding (respectively.)
|
||||
|
||||
|
||||
MozJPEG Java Wrapper
|
||||
TurboJPEG Java Wrapper
|
||||
----------------------
|
||||
Add --with-java to the configure command line to incorporate an optional Java
|
||||
Native Interface wrapper into the MozJPEG shared library and build the Java
|
||||
front-end classes to support it. This allows the MozJPEG shared library to
|
||||
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
|
||||
@@ -173,9 +172,9 @@ to specify arguments that should be passed to the C compiler when building the
|
||||
JNI wrapper. Run 'configure --help' for more details.
|
||||
|
||||
|
||||
========================
|
||||
Installing libmozjpeg
|
||||
========================
|
||||
==================
|
||||
Installing mozjpeg
|
||||
==================
|
||||
|
||||
If you intend to install these libraries and the associated header files, then
|
||||
replace 'make' in the instructions above with
|
||||
@@ -188,16 +187,16 @@ For example,
|
||||
|
||||
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/libmozjpeg/include and the library
|
||||
files in /opt/libmozjpeg/lib32 (32-bit) or /opt/libmozjpeg/lib64
|
||||
is to install the header files in /opt/mozjpeg/include and the library
|
||||
files in /opt/mozjpeg/lib32 (32-bit) or /opt/mozjpeg/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 libmozjpeg into
|
||||
overwriting it. It is recommended that you instead install mozjpeg into
|
||||
a non-system directory and manipulate the LD_LIBRARY_PATH or create symlinks
|
||||
to force applications to use libmozjpeg instead of libjpeg. See
|
||||
to force applications to use mozjpeg instead of libjpeg. See
|
||||
README-turbo.txt for more information.
|
||||
|
||||
|
||||
@@ -216,17 +215,6 @@ Add
|
||||
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
|
||||
---------------------------
|
||||
|
||||
@@ -243,12 +231,12 @@ to the configure command line.
|
||||
Add
|
||||
|
||||
--host x86_64-apple-darwin NASM=/opt/local/bin/nasm \
|
||||
CFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \
|
||||
-mmacosx-version-min=10.4 -O3' \
|
||||
LDFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \
|
||||
-mmacosx-version-min=10.4'
|
||||
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.4 SDK, and NASM 2.07 or later from
|
||||
to the configure command line. The OS X 10.5 SDK, and NASM 2.07 or later from
|
||||
MacPorts, must be installed.
|
||||
|
||||
|
||||
@@ -258,12 +246,12 @@ MacPorts, must be installed.
|
||||
Add
|
||||
|
||||
--host i686-apple-darwin \
|
||||
CFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \
|
||||
-mmacosx-version-min=10.4 -O3 -m32' \
|
||||
LDFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \
|
||||
-mmacosx-version-min=10.4 -m32'
|
||||
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.4 SDK must be installed.
|
||||
to the configure command line. The OS X 10.5 SDK must be installed.
|
||||
|
||||
|
||||
64-bit Library Build on 64-bit Solaris
|
||||
@@ -295,10 +283,10 @@ Add
|
||||
|
||||
CC=cc
|
||||
|
||||
to the configure command line. libmozjpeg will automatically be built with
|
||||
to the configure command line. mozjpeg will automatically be built with
|
||||
the maximum optimization level (-xO5) unless you override CFLAGS.
|
||||
|
||||
To build a 64-bit version of libmozjpeg using Oracle Solaris Studio, add
|
||||
To build a 64-bit version of mozjpeg using Oracle Solaris Studio, add
|
||||
|
||||
--host x86_64-pc-solaris CC=cc CFLAGS='-xO5 -m64' LDFLAGS=-m64
|
||||
|
||||
@@ -315,67 +303,151 @@ Use CMake (see recipes below)
|
||||
ARM Support
|
||||
===========
|
||||
|
||||
This release of libmozjpeg can use ARM NEON SIMD instructions to accelerate
|
||||
This release of mozjpeg can use ARM NEON SIMD instructions to accelerate
|
||||
JPEG compression/decompression by approximately 2-4x on ARMv7 and later
|
||||
platforms. If libmozjpeg is configured on an ARM Linux platform, then the
|
||||
platforms. If mozjpeg is configured on an ARM Linux platform, then the
|
||||
build system will automatically include the NEON SIMD routines, if they are
|
||||
supported.
|
||||
supported. Build instructions for other ARM-based platforms follow.
|
||||
|
||||
|
||||
Building libmozjpeg for iOS
|
||||
------------------------------
|
||||
Building mozjpeg for iOS
|
||||
------------------------
|
||||
|
||||
iOS platforms, such as the iPhone and iPad, also use ARM processors, some of
|
||||
which support NEON instructions. Additional steps are required to build
|
||||
libmozjpeg for these platforms. The steps below assume iOS SDK v4.3. If
|
||||
you are using a different SDK version, then you will need to modify the
|
||||
examples accordingly.
|
||||
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
|
||||
mozjpeg for these platforms.
|
||||
|
||||
Additional build requirements:
|
||||
|
||||
gas-preprocessor.pl (https://github.com/yuvi/gas-preprocessor) should be
|
||||
installed in your PATH.
|
||||
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 3.2.x / iOS 4.3 SDK:
|
||||
IOS_PLATFORMDIR="/Developer/Platforms/iPhoneOS.platform"
|
||||
IOS_SYSROOT="$IOS_PLATFORMDIR/Developer/SDKs/iPhoneOS4.3.sdk"
|
||||
IOS_GCC="$IOS_PLATFORMDIR/Developer/usr/bin/arm-apple-darwin10-llvm-gcc-4.2"
|
||||
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
|
||||
|
||||
Xcode 4.5.x / iOS 6.0 SDK:
|
||||
IOS_PLATFORMDIR="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform"
|
||||
IOS_SYSROOT="$IOS_PLATFORMDIR/Developer/SDKs/iPhoneOS6.0.sdk"
|
||||
IOS_GCC="$IOS_PLATFORMDIR/Developer/usr/bin/arm-apple-darwin10-llvm-gcc-4.2"
|
||||
IOS_SYSROOT=$IOS_PLATFORMDIR/Developer/SDKs/iPhoneOS*.sdk
|
||||
IOS_GCC=$IOS_PLATFORMDIR/Developer/usr/bin/arm-apple-darwin10-llvm-gcc-4.2
|
||||
|
||||
ARM v6 only (up to and including iPhone 3G):
|
||||
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"
|
||||
|
||||
ARM v7 only (iPhone 3GS-4S, iPad 1st-3rd Generation):
|
||||
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"
|
||||
|
||||
ARM v7s only (iPhone 5, iPad 4th Generation):
|
||||
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 libmozjpeg" above, adding
|
||||
Follow the procedure under "Building mozjpeg" above, adding
|
||||
|
||||
--host arm-apple-darwin10 --enable-static --disable-shared \
|
||||
--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.
|
||||
|
||||
Once built, lipo can be used to combine the ARM v6, v7, and/or v7s variants
|
||||
|
||||
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 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 libmozjpeg 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 ARM v7 or v7s 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
|
||||
|
||||
|
||||
*******************************************************************************
|
||||
@@ -387,7 +459,7 @@ infer tagged configuration."
|
||||
Build Requirements
|
||||
==================
|
||||
|
||||
-- CMake (http://www.cmake.org) v2.6 or later
|
||||
-- CMake (http://www.cmake.org) v2.8.8 or later
|
||||
|
||||
-- Microsoft Visual C++ 2005 or later
|
||||
|
||||
@@ -397,11 +469,12 @@ Build Requirements
|
||||
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 libmozjpeg.
|
||||
everything necessary to build mozjpeg.
|
||||
|
||||
* For 32-bit builds, you can also use Microsoft Visual C++ Express
|
||||
Edition. Visual C++ Express Edition is a free download.
|
||||
* If you intend to build libmozjpeg from the command line, then add the
|
||||
* 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 mozjpeg 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
|
||||
@@ -414,12 +487,16 @@ Build Requirements
|
||||
|
||||
-- MinGW
|
||||
|
||||
GCC v4.1 or later recommended for best performance
|
||||
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 MozJPEG Java wrapper, JDK 1.5 or later is required. This
|
||||
-- If building the TurboJPEG Java wrapper, JDK 1.5 or later is required. This
|
||||
can be downloaded from http://www.java.com.
|
||||
|
||||
|
||||
@@ -429,17 +506,17 @@ 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 libmozjpeg source directory. You can
|
||||
not necessarily be the same as the mozjpeg source directory. You can
|
||||
create multiple independent binary directories, in which different versions of
|
||||
libmozjpeg can be built from the same source tree using different compilers
|
||||
mozjpeg 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 libmozjpeg source
|
||||
directory, whereas {source_directory} refers to the mozjpeg source
|
||||
directory. For in-tree builds, these directories are the same.
|
||||
|
||||
|
||||
======================
|
||||
Building libmozjpeg
|
||||
======================
|
||||
================
|
||||
Building mozjpeg
|
||||
================
|
||||
|
||||
|
||||
Visual C++ (Command Line)
|
||||
@@ -449,7 +526,7 @@ Visual C++ (Command Line)
|
||||
cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release {source_directory}
|
||||
nmake
|
||||
|
||||
This will build either a 32-bit or a 64-bit version of libmozjpeg, depending
|
||||
This will build either a 32-bit or a 64-bit version of mozjpeg, depending
|
||||
on which version of cl.exe is in the PATH.
|
||||
|
||||
The following files will be generated under {build_directory}:
|
||||
@@ -460,12 +537,12 @@ The following files will be generated under {build_directory}:
|
||||
DLL for the libjpeg API
|
||||
sharedlib/jpeg.lib
|
||||
Import library for the libjpeg API
|
||||
mozjpeg-static.lib
|
||||
Static link library for the MozJPEG API
|
||||
mozjpeg.dll
|
||||
DLL for the MozJPEG API
|
||||
mozjpeg.lib
|
||||
Import library for the MozJPEG 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.
|
||||
@@ -479,11 +556,16 @@ Choose the appropriate CMake generator option for your version of Visual Studio
|
||||
instance:
|
||||
|
||||
cd {build_directory}
|
||||
cmake -G "Visual Studio 9 2008" {source_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 libmozjpeg.
|
||||
build of mozjpeg.
|
||||
|
||||
This will generate the following files under {build_directory}:
|
||||
|
||||
@@ -493,12 +575,12 @@ This will generate the following files under {build_directory}:
|
||||
DLL for the libjpeg API
|
||||
sharedlib/{configuration}/jpeg.lib
|
||||
Import library for the libjpeg API
|
||||
{configuration}/mozjpeg-static.lib
|
||||
Static link library for the MozJPEG API
|
||||
{configuration}/mozjpeg.dll
|
||||
DLL for the MozJPEG API
|
||||
{configuration}/mozjpeg.lib
|
||||
Import library for the MozJPEG 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,
|
||||
@@ -508,9 +590,12 @@ 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 "MSYS Makefiles" {source_directory}
|
||||
make
|
||||
cmake -G "MinGW Makefiles" {source_directory}
|
||||
mingw32-make
|
||||
|
||||
This will generate the following files under {build_directory}
|
||||
|
||||
@@ -520,12 +605,12 @@ This will generate the following files under {build_directory}
|
||||
DLL for the libjpeg API
|
||||
sharedlib/libjpeg.dll.a
|
||||
Import library for the libjpeg API
|
||||
libmozjpeg.a
|
||||
Static link library for the MozJPEG API
|
||||
libmozjpeg.dll
|
||||
DLL for the MozJPEG API
|
||||
libmozjpeg.dll.a
|
||||
Import library for the MozJPEG 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.
|
||||
@@ -543,8 +628,8 @@ libjpeg v7 or v8 API/ABI Emulation
|
||||
-----------------------------------
|
||||
|
||||
Add "-DWITH_JPEG7=1" to the cmake command line to build a version of
|
||||
libmozjpeg that is API/ABI-compatible with libjpeg v7. Add "-DWITH_JPEG8=1"
|
||||
to the cmake command to build a version of libmozjpeg that is
|
||||
mozjpeg that is API/ABI-compatible with libjpeg v7. Add "-DWITH_JPEG8=1"
|
||||
to the cmake command to build a version of mozjpeg that is
|
||||
API/ABI-compatible with libjpeg v8. See README-turbo.txt for more information
|
||||
on libjpeg v7 and v8 emulation.
|
||||
|
||||
@@ -553,7 +638,7 @@ 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 libmozjpeg that lacks the
|
||||
CMake command line to build a version of mozjpeg 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.
|
||||
@@ -563,7 +648,7 @@ Arithmetic Coding Support
|
||||
-------------------------
|
||||
|
||||
Since the patent on arithmetic coding has expired, this functionality has been
|
||||
included in this release of libmozjpeg. libmozjpeg's implementation is
|
||||
included in this release of mozjpeg. mozjpeg'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
|
||||
@@ -571,11 +656,11 @@ add "-DWITH_ARITH_ENC=0" or "-DWITH_ARITH_DEC=0" to the cmake command line to
|
||||
disable encoding or decoding (respectively.)
|
||||
|
||||
|
||||
MozJPEG Java Wrapper
|
||||
TurboJPEG Java Wrapper
|
||||
----------------------
|
||||
Add "-DWITH_JAVA=1" to the cmake command line to incorporate an optional Java
|
||||
Native Interface wrapper into the MozJPEG shared library and build the Java
|
||||
front-end classes to support it. This allows the MozJPEG shared library to
|
||||
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,
|
||||
@@ -586,11 +671,11 @@ 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 libmozjpeg
|
||||
========================
|
||||
==================
|
||||
Installing mozjpeg
|
||||
==================
|
||||
|
||||
You can use the build system to install libmozjpeg into a directory of your
|
||||
You can use the build system to install mozjpeg into a directory of your
|
||||
choosing (as opposed to creating an installer.) To do this, add:
|
||||
|
||||
-DCMAKE_INSTALL_PREFIX={install_directory}
|
||||
@@ -600,12 +685,12 @@ to the cmake command line.
|
||||
For example,
|
||||
|
||||
cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_INSTALL_PREFIX=c:\libmozjpeg {source_directory}
|
||||
-DCMAKE_INSTALL_PREFIX=c:\mozjpeg {source_directory}
|
||||
nmake install
|
||||
|
||||
will install the header files in c:\libmozjpeg\include, the library files
|
||||
in c:\libmozjpeg\lib, the DLL's in c:\libmozjpeg\bin, and the
|
||||
documentation in c:\libmozjpeg\doc.
|
||||
will install the header files in c:\mozjpeg\include, the library files
|
||||
in c:\mozjpeg\lib, the DLL's in c:\mozjpeg\bin, and the
|
||||
documentation in c:\mozjpeg\doc.
|
||||
|
||||
|
||||
=============
|
||||
@@ -619,11 +704,11 @@ Build Recipes
|
||||
cd {build_directory}
|
||||
CC=/usr/bin/x86_64-w64-mingw32-gcc \
|
||||
cmake -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Windows \
|
||||
-DCMAKE_AR=/usr/bin/x86_64-w64-mingw32-ar \
|
||||
-DCMAKE_RANLIB=/usr/bin/x86_64-w64-mingw32-ranlib {source_directory}
|
||||
-DCMAKE_RC_COMPILER=/usr/bin/x86_64-w64-mingw32-windres.exe \
|
||||
{source_directory}
|
||||
make
|
||||
|
||||
This produces a 64-bit build of libmozjpeg that does not depend on
|
||||
This produces a 64-bit build of mozjpeg 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.
|
||||
|
||||
@@ -634,29 +719,14 @@ mingw64-x86_64-gcc-g++ packages (and their dependencies) must be installed.
|
||||
cd {build_directory}
|
||||
CC=/usr/bin/i686-w64-mingw32-gcc \
|
||||
cmake -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Windows \
|
||||
-DDCMAKE_AR=/usr/bin/i686-w64-mingw32-ar \
|
||||
-DCMAKE_RANLIB=/usr/bin/i686-w64-mingw32-ranlib {source_directory}
|
||||
make
|
||||
|
||||
This produces a 32-bit build of libmozjpeg 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-w64 Build on Windows
|
||||
--------------------------
|
||||
|
||||
This produces a 64-bit build of libmozjpeg using the "native" MinGW-w64
|
||||
toolchain (which is faster than the Cygwin version):
|
||||
|
||||
cd {build_directory}
|
||||
CC={mingw-w64_binary_path}/x86_64-w64-mingw32-gcc \
|
||||
cmake -G "MSYS Makefiles" \
|
||||
-DCMAKE_AR={mingw-w64_binary_path}/x86_64-w64-mingw32-ar \
|
||||
-DCMAKE_RANLIB={mingw-w64_binary_path}/x86_64-w64-mingw32-ranlib \
|
||||
-DCMAKE_RC_COMPILER=/usr/bin/i686-w64-mingw32-windres.exe \
|
||||
{source_directory}
|
||||
make
|
||||
|
||||
This produces a 32-bit build of mozjpeg 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
|
||||
--------------------
|
||||
@@ -695,43 +765,49 @@ make deb
|
||||
|
||||
make dmg
|
||||
|
||||
Create Macintosh package/disk image. This requires the PackageMaker
|
||||
application, which must be installed in /Developer/Applications/Utilities.
|
||||
Note that PackageMaker is not included in recent releases of Xcode, but it
|
||||
can be obtained by downloading the "Auxiliary Tools for Xcode" package from
|
||||
http://developer.apple.com/downloads.
|
||||
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 libmozjpeg, then configure a 64-bit out-of-tree
|
||||
out-of-tree build of mozjpeg, then configure a 64-bit out-of-tree
|
||||
build, then run 'make udmg' from the 64-bit build directory. The build
|
||||
system will look for the 32-bit build under {source_directory}/osxx86 by
|
||||
default, but you can override this by setting the BUILDDIR32 variable on the
|
||||
make command line as shown above.
|
||||
|
||||
make iosdmg [BUILDDIR32={32-bit build directory}] \
|
||||
[BUILDDIRARMV6={ARM v6 build directory}] \
|
||||
[BUILDDIRARMV7={ARM v7 build directory}] \
|
||||
[BUILDDIRARMV7S={ARM v7s 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
|
||||
libmozjpeg static libraries contain ARM architectures necessary to build
|
||||
mozjpeg static libraries contain ARM architectures necessary to build
|
||||
iOS applications. If building on an x86-64 system, the binaries will also
|
||||
contain the i386 architecture, as with 'make udmg' above. You should first
|
||||
configure ARM v6, ARM v7, and/or ARM v7s out-of-tree builds of libmozjpeg
|
||||
(see "Building libmozjpeg for iOS" above.) If you are building an x86-64
|
||||
version of libmozjpeg, you should configure a 32-bit out-of-tree build as
|
||||
well. Next, build libmozjpeg as you would normally, using an out-of-tree
|
||||
build. When it is built, run 'make iosdmg' from the build directory. The
|
||||
build system will look for the ARM v6 build under {source_directory}/iosarmv6
|
||||
by default, the ARM v7 build under {source_directory}/iosarmv7 by default,
|
||||
the ARM v7s build under {source_directory}/iosarmv7s 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, and/or BUILDDIRARMV7S variables on the make command line as
|
||||
shown above.
|
||||
configure ARMv6, ARMv7, ARMv7s, and/or ARMv8 out-of-tree builds of
|
||||
mozjpeg (see "Building mozjpeg for iOS" above.) If you are
|
||||
building an x86-64 version of mozjpeg, you should configure a 32-bit
|
||||
out-of-tree build as well. Next, build mozjpeg 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
|
||||
|
||||
@@ -753,7 +829,7 @@ If using MinGW:
|
||||
|
||||
If using the Visual Studio IDE, build the "installer" project.
|
||||
|
||||
The installer package (libmozjpeg[-gcc][64].exe) will be located under
|
||||
The installer package (mozjpeg[-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
|
||||
@@ -767,24 +843,24 @@ Building a Windows installer requires the Nullsoft Install System
|
||||
** Regression testing
|
||||
*******************************************************************************
|
||||
|
||||
The most common way to test libmozjpeg is by invoking 'make test' on
|
||||
The most common way to test mozjpeg 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 libmozjpeg and libjpeg v6b. This
|
||||
also invokes the MozJPEG unit tests, which ensure that the colorspace
|
||||
extensions, YUV encoding, decompression scaling, and other features of the
|
||||
MozJPEG C and Java APIs are working properly (and, by extension, that the
|
||||
equivalent features of the underlying libjpeg API are also working.)
|
||||
compatibility has been maintained. 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 MozJPEG C and Java
|
||||
wrappers can be run by invoking 'make tjtest'. These extended MozJPEG tests
|
||||
essentially iterate through all of the available features of the MozJPEG APIs
|
||||
that are not covered by the MozJPEG unit tests (this includes the lossless
|
||||
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
|
||||
MozJPEG tests are meant to test for regressions in the MozJPEG wrappers,
|
||||
TurboJPEG tests are meant to test for regressions in the TurboJPEG wrappers,
|
||||
not in the underlying libjpeg API library.
|
||||
|
||||
747
CMakeLists.txt
747
CMakeLists.txt
@@ -2,12 +2,16 @@
|
||||
# Setup
|
||||
#
|
||||
|
||||
cmake_minimum_required(VERSION 2.6)
|
||||
cmake_minimum_required(VERSION 2.8.8)
|
||||
# Use LINK_INTERFACE_LIBRARIES instead of INTERFACE_LINK_LIBRARIES
|
||||
if(POLICY CMP0022)
|
||||
cmake_policy(SET CMP0022 OLD)
|
||||
endif()
|
||||
|
||||
project(libmozjpeg C)
|
||||
set(VERSION 2.0.1)
|
||||
project(mozjpeg C)
|
||||
set(VERSION 3.1)
|
||||
|
||||
if(MINGW OR CYGWIN)
|
||||
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)
|
||||
@@ -43,10 +47,23 @@ 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_JPEG7 "Emulate libjpeg v7 API/ABI (this makes libmozjpeg backward incompatible with libjpeg v6b)" FALSE)
|
||||
option(WITH_JPEG8 "Emulate libjpeg v8 API/ABI (this makes libmozjpeg backward incompatible with libjpeg v6b)" FALSE)
|
||||
option(WITH_JPEG7 "Emulate libjpeg v7 API/ABI (this makes mozjpeg backward incompatible with libjpeg v6b)" FALSE)
|
||||
option(WITH_JPEG8 "Emulate libjpeg v8 API/ABI (this makes mozjpeg backward incompatible with libjpeg v6b)" FALSE)
|
||||
option(WITH_MEM_SRCDST "Include in-memory source/destination manager functions when emulating the libjpeg v6b or v7 API/ABI" TRUE)
|
||||
option(WITH_TURBOJPEG "Include the TurboJPEG wrapper library and associated test programs" TRUE)
|
||||
option(WITH_JAVA "Build Java wrapper for the TurboJPEG library" FALSE)
|
||||
option(WITH_12BIT "Encode/decode JPEG images with 12-bit samples (implies WITH_SIMD=0 WITH_TURBOJPEG=0 WITH_ARITH_ENC=0 WITH_ARITH_DEC=0)" FALSE)
|
||||
|
||||
if(WITH_12BIT)
|
||||
set(WITH_SIMD FALSE)
|
||||
set(WITH_TURBOJPEG FALSE)
|
||||
set(WITH_ARITH_ENC FALSE)
|
||||
set(WITH_ARITH_DEC FALSE)
|
||||
set(BITS_IN_JSAMPLE 12)
|
||||
message(STATUS "12-bit JPEG support enabled")
|
||||
else()
|
||||
set(BITS_IN_JSAMPLE 8)
|
||||
endif()
|
||||
|
||||
if(WITH_ARITH_ENC)
|
||||
set(C_ARITH_CODING_SUPPORTED 1)
|
||||
@@ -62,6 +79,12 @@ else()
|
||||
message(STATUS "Arithmetic decoding support disabled")
|
||||
endif()
|
||||
|
||||
if(WITH_TURBOJPEG)
|
||||
message(STATUS "TurboJPEG C wrapper enabled")
|
||||
else()
|
||||
message(STATUS "TurboJPEG C wrapper disabled")
|
||||
endif()
|
||||
|
||||
if(WITH_JAVA)
|
||||
message(STATUS "TurboJPEG Java wrapper enabled")
|
||||
else()
|
||||
@@ -132,14 +155,14 @@ if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
|
||||
set(CMAKE_INSTALL_PREFIX_DEFAULT ${CMAKE_INSTALL_PREFIX_DEFAULT}64)
|
||||
endif()
|
||||
set(CMAKE_INSTALL_PREFIX "c:/${CMAKE_INSTALL_PREFIX_DEFAULT}" CACHE PATH
|
||||
"Directory into which to install libmozjpeg (default: c:/${CMAKE_INSTALL_PREFIX_DEFAULT})"
|
||||
"Directory into which to install mozjpeg (default: c:/${CMAKE_INSTALL_PREFIX_DEFAULT})"
|
||||
FORCE)
|
||||
endif()
|
||||
|
||||
message(STATUS "Install directory = ${CMAKE_INSTALL_PREFIX}")
|
||||
|
||||
configure_file(win/jconfig.h.in jconfig.h)
|
||||
configure_file(win/config.h.in config.h)
|
||||
configure_file(win/jconfigint.h.in jconfigint.h)
|
||||
|
||||
include_directories("${CMAKE_CURRENT_BINARY_DIR}" "${CMAKE_SOURCE_DIR}")
|
||||
|
||||
@@ -156,13 +179,13 @@ endif()
|
||||
# Targets
|
||||
#
|
||||
|
||||
set(JPEG_SOURCES jcapimin.c jcapistd.c jccoefct.c jccolor.c jcdctmgr.c jchuff.c
|
||||
jcinit.c jcmainct.c jcmarker.c jcmaster.c jcomapi.c jcparam.c jcphuff.c
|
||||
jcprepct.c jcsample.c jctrans.c jdapimin.c jdapistd.c jdatadst.c jdatasrc.c
|
||||
jdcoefct.c jdcolor.c jddctmgr.c jdhuff.c jdinput.c jdmainct.c jdmarker.c
|
||||
jdmaster.c jdmerge.c jdphuff.c jdpostct.c jdsample.c jdtrans.c jerror.c
|
||||
jfdctflt.c jfdctfst.c jfdctint.c jidctflt.c jidctfst.c jidctint.c jidctred.c
|
||||
jquant1.c jquant2.c jutils.c jmemmgr.c jmemnobs.c)
|
||||
set(JPEG_SOURCES jcapimin.c jcapistd.c jccoefct.c jccolor.c jcdctmgr.c jcext.c
|
||||
jchuff.c jcinit.c jcmainct.c jcmarker.c jcmaster.c jcomapi.c jcparam.c
|
||||
jcphuff.c jcprepct.c jcsample.c jctrans.c jdapimin.c jdapistd.c jdatadst.c
|
||||
jdatasrc.c jdcoefct.c jdcolor.c jddctmgr.c jdhuff.c jdinput.c jdmainct.c
|
||||
jdmarker.c jdmaster.c jdmerge.c jdphuff.c jdpostct.c jdsample.c jdtrans.c
|
||||
jerror.c jfdctflt.c jfdctfst.c jfdctint.c jidctflt.c jidctfst.c jidctint.c
|
||||
jidctred.c jquant1.c jquant2.c jutils.c jmemmgr.c jmemnobs.c)
|
||||
|
||||
if(WITH_ARITH_ENC OR WITH_ARITH_DEC)
|
||||
set(JPEG_SOURCES ${JPEG_SOURCES} jaricom.c)
|
||||
@@ -205,57 +228,65 @@ if(WITH_SIMD)
|
||||
add_dependencies(jpeg-static simd)
|
||||
endif()
|
||||
|
||||
set(TURBOJPEG_SOURCES turbojpeg.c transupp.c jdatadst-tj.c jdatasrc-tj.c)
|
||||
if(WITH_JAVA)
|
||||
set(TURBOJPEG_SOURCES ${TURBOJPEG_SOURCES} turbojpeg-jni.c)
|
||||
include_directories(${JAVA_INCLUDE_PATH} ${JAVA_INCLUDE_PATH2})
|
||||
if(WITH_TURBOJPEG)
|
||||
set(TURBOJPEG_SOURCES turbojpeg.c transupp.c jdatadst-tj.c jdatasrc-tj.c)
|
||||
if(WITH_JAVA)
|
||||
set(TURBOJPEG_SOURCES ${TURBOJPEG_SOURCES} turbojpeg-jni.c)
|
||||
include_directories(${JAVA_INCLUDE_PATH} ${JAVA_INCLUDE_PATH2})
|
||||
endif()
|
||||
|
||||
add_library(turbojpeg SHARED ${TURBOJPEG_SOURCES})
|
||||
set_target_properties(turbojpeg PROPERTIES DEFINE_SYMBOL DLLDEFINE)
|
||||
if(MINGW)
|
||||
set_target_properties(turbojpeg PROPERTIES LINK_FLAGS -Wl,--kill-at)
|
||||
endif()
|
||||
target_link_libraries(turbojpeg jpeg-static)
|
||||
set_target_properties(turbojpeg PROPERTIES LINK_INTERFACE_LIBRARIES "")
|
||||
|
||||
add_library(turbojpeg-static STATIC ${JPEG_SOURCES} ${SIMD_OBJS}
|
||||
turbojpeg.c transupp.c jdatadst-tj.c jdatasrc-tj.c)
|
||||
if(NOT MSVC)
|
||||
set_target_properties(turbojpeg-static PROPERTIES OUTPUT_NAME turbojpeg)
|
||||
endif()
|
||||
if(WITH_SIMD)
|
||||
add_dependencies(turbojpeg-static simd)
|
||||
endif()
|
||||
|
||||
add_executable(tjunittest tjunittest.c tjutil.c)
|
||||
target_link_libraries(tjunittest turbojpeg)
|
||||
|
||||
add_executable(tjunittest-static tjunittest.c tjutil.c)
|
||||
target_link_libraries(tjunittest-static turbojpeg-static)
|
||||
|
||||
add_executable(tjbench tjbench.c bmp.c tjutil.c rdbmp.c rdppm.c wrbmp.c
|
||||
wrppm.c)
|
||||
target_link_libraries(tjbench turbojpeg jpeg-static)
|
||||
set_property(TARGET tjbench PROPERTY COMPILE_FLAGS
|
||||
"-DBMP_SUPPORTED -DPPM_SUPPORTED")
|
||||
|
||||
add_executable(tjbench-static tjbench.c bmp.c tjutil.c rdbmp.c rdppm.c wrbmp.c
|
||||
wrppm.c)
|
||||
target_link_libraries(tjbench-static turbojpeg-static jpeg-static)
|
||||
set_property(TARGET tjbench-static PROPERTY COMPILE_FLAGS
|
||||
"-DBMP_SUPPORTED -DPPM_SUPPORTED")
|
||||
endif()
|
||||
|
||||
add_library(turbojpeg SHARED ${TURBOJPEG_SOURCES})
|
||||
set_target_properties(turbojpeg PROPERTIES DEFINE_SYMBOL DLLDEFINE)
|
||||
if(MINGW)
|
||||
set_target_properties(turbojpeg PROPERTIES LINK_FLAGS -Wl,--kill-at)
|
||||
endif()
|
||||
target_link_libraries(turbojpeg jpeg-static)
|
||||
set_target_properties(turbojpeg PROPERTIES LINK_INTERFACE_LIBRARIES "")
|
||||
|
||||
add_library(turbojpeg-static STATIC ${JPEG_SOURCES} ${SIMD_OBJS}
|
||||
turbojpeg.c transupp.c jdatadst-tj.c jdatasrc-tj.c)
|
||||
if(NOT MSVC)
|
||||
set_target_properties(turbojpeg-static PROPERTIES OUTPUT_NAME turbojpeg)
|
||||
endif()
|
||||
if(WITH_SIMD)
|
||||
add_dependencies(turbojpeg-static simd)
|
||||
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)
|
||||
endif()
|
||||
|
||||
add_executable(tjunittest tjunittest.c tjutil.c)
|
||||
target_link_libraries(tjunittest turbojpeg)
|
||||
|
||||
add_executable(tjunittest-static tjunittest.c tjutil.c)
|
||||
target_link_libraries(tjunittest-static turbojpeg-static)
|
||||
|
||||
add_executable(tjbench tjbench.c bmp.c tjutil.c rdbmp.c rdppm.c wrbmp.c
|
||||
wrppm.c)
|
||||
target_link_libraries(tjbench turbojpeg jpeg-static)
|
||||
set_property(TARGET tjbench PROPERTY COMPILE_FLAGS
|
||||
"-DBMP_SUPPORTED -DPPM_SUPPORTED")
|
||||
|
||||
add_executable(tjbench-static tjbench.c bmp.c tjutil.c rdbmp.c rdppm.c wrbmp.c
|
||||
wrppm.c)
|
||||
target_link_libraries(tjbench-static turbojpeg-static jpeg-static)
|
||||
set_property(TARGET tjbench-static PROPERTY COMPILE_FLAGS
|
||||
"-DBMP_SUPPORTED -DPPM_SUPPORTED")
|
||||
|
||||
add_executable(cjpeg-static cjpeg.c cdjpeg.c rdbmp.c rdgif.c rdppm.c rdswitch.c
|
||||
rdtarga.c rdjpeg.c)
|
||||
set_property(TARGET cjpeg-static PROPERTY COMPILE_FLAGS
|
||||
"-DBMP_SUPPORTED -DGIF_SUPPORTED -DPPM_SUPPORTED -DTARGA_SUPPORTED -DUSE_SETMODE")
|
||||
add_executable(cjpeg-static cjpeg.c cdjpeg.c rdgif.c rdppm.c rdswitch.c rdjpeg.c
|
||||
${CJPEG_BMP_SOURCES})
|
||||
set_property(TARGET cjpeg-static PROPERTY COMPILE_FLAGS ${COMPILE_FLAGS})
|
||||
target_link_libraries(cjpeg-static jpeg-static)
|
||||
|
||||
add_executable(djpeg-static djpeg.c cdjpeg.c rdcolmap.c rdswitch.c wrbmp.c wrgif.c
|
||||
wrppm.c wrtarga.c)
|
||||
set_property(TARGET djpeg-static PROPERTY COMPILE_FLAGS
|
||||
"-DBMP_SUPPORTED -DGIF_SUPPORTED -DPPM_SUPPORTED -DTARGA_SUPPORTED -DUSE_SETMODE")
|
||||
add_executable(djpeg-static djpeg.c cdjpeg.c rdcolmap.c rdswitch.c wrgif.c
|
||||
wrppm.c ${DJPEG_BMP_SOURCES})
|
||||
set_property(TARGET djpeg-static PROPERTY COMPILE_FLAGS ${COMPILE_FLAGS})
|
||||
target_link_libraries(djpeg-static jpeg-static)
|
||||
|
||||
add_executable(jpegtran-static jpegtran.c cdjpeg.c rdswitch.c transupp.c)
|
||||
@@ -264,7 +295,7 @@ set_property(TARGET jpegtran-static PROPERTY COMPILE_FLAGS "-DUSE_SETMODE")
|
||||
|
||||
add_executable(rdjpgcom rdjpgcom.c)
|
||||
|
||||
add_executable(wrjpgcom rdjpgcom.c)
|
||||
add_executable(wrjpgcom wrjpgcom.c)
|
||||
|
||||
|
||||
#
|
||||
@@ -279,167 +310,438 @@ endif()
|
||||
|
||||
enable_testing()
|
||||
|
||||
set(MD5_JPEG_INT 9a68f56bc76e466aa7e52f415d0f4a5f)
|
||||
set(MD5_JPEG_FAST 0e1502e7fa421835e376a314fac2a39f)
|
||||
set(MD5_JPEG_FAST_100 7bf72a8e741d64eecb960c97323af77c)
|
||||
set(MD5_JPEG_FLOAT d1623885ffafcd40c684af09e3d65cd5)
|
||||
set(MD5_JPEG_FLOAT_NOSIMD fb4884c35f8273f498cb32879de5c455)
|
||||
set(MD5_JPEG_INT_GRAY 72b51f894b8f4a10b3ee3066770aa38d)
|
||||
set(MD5_PPM_INT d1ed0d11f076b842525271647716aeb8)
|
||||
set(MD5_PPM_FAST 048298a2d2410261c0533cb97bcfef23)
|
||||
set(MD5_PPM_FLOAT 7f5b446ee36b2630e06785b8d42af15f)
|
||||
set(MD5_PPM_FLOAT_NOSIMD 64072f1dbdc5b3a187777788604971a5)
|
||||
set(MD5_PPM_INT_2_1 9f9de8c0612f8d06869b960b05abf9c9)
|
||||
set(MD5_PPM_INT_15_8 b6875bc070720b899566cc06459b63b7)
|
||||
set(MD5_PPM_INT_7_4 06a177eae05f164fac57f7a2c346ee87)
|
||||
set(MD5_PPM_INT_13_8 bc3452573c8152f6ae552939ee19f82f)
|
||||
set(MD5_PPM_INT_3_2 f5a8b88a8a7f96016f04d259cf82ed67)
|
||||
set(MD5_PPM_INT_11_8 d8cc73c0aaacd4556569b59437ba00a5)
|
||||
set(MD5_PPM_INT_5_4 32775dd9ad2ab90f4c5b219b53e0c86c)
|
||||
set(MD5_PPM_INT_9_8 d25e61bc7eac0002f5b393aa223747b6)
|
||||
set(MD5_PPM_INT_7_8 ddb564b7c74a09494016d6cd7502a946)
|
||||
set(MD5_PPM_INT_3_4 8ed8e68808c3fbc4ea764fc9d2968646)
|
||||
set(MD5_PPM_INT_5_8 a3363274999da2366a024efae6d16c9b)
|
||||
set(MD5_PPM_INT_1_2 e692a315cea26b988c8e8b29a5dbcd81)
|
||||
set(MD5_PPM_INT_3_8 79eca9175652ced755155c90e785a996)
|
||||
set(MD5_PPM_INT_1_4 79cd778f8bf1a117690052cacdd54eca)
|
||||
set(MD5_PPM_INT_1_8 391b3d4aca640c8567d6f8745eb2142f)
|
||||
set(MD5_PPM_FAST_1_2 f30bcf6d32ccd44cbdd9aeaacbd9454f)
|
||||
set(MD5_BMP_256 4980185e3776e89bd931736e1cddeee6)
|
||||
set(MD5_JPEG_ARI e986fb0a637a8d833d96e8a6d6d84ea1)
|
||||
set(MD5_PPM_ARI 72b59a99bcf1de24c5b27d151bde2437)
|
||||
set(MD5_JPEG_PROG 1c4afddc05c0a43489ee54438a482d92)
|
||||
set(MD5_JPEG_PROG_ARI 0a8f1c8f66e113c3cf635df0a475a617)
|
||||
set(MD5_JPEG_CROP b4197f377e621c4e9b1d20471432610d)
|
||||
if(WITH_12BIT)
|
||||
set(TESTORIG testorig12.jpg)
|
||||
set(MD5_JPEG_RGB_ISLOW 9620f424569594bb9242b48498ad801f)
|
||||
set(MD5_PPM_RGB_ISLOW f3301d2219783b8b3d942b7239fa50c0)
|
||||
set(MD5_JPEG_422_IFAST_OPT 7322e3bd2f127f7de4b40d4480ce60e4)
|
||||
set(MD5_PPM_422_IFAST 79807fa552899e66a04708f533e16950)
|
||||
set(MD5_PPM_422M_IFAST 07737bfe8a7c1c87aaa393a0098d16b0)
|
||||
set(MD5_JPEG_420_IFAST_Q100_PROG a1da220b5604081863a504297ed59e55)
|
||||
set(MD5_PPM_420_Q100_IFAST 1b3730122709f53d007255e8dfd3305e)
|
||||
set(MD5_PPM_420M_Q100_IFAST 980a1a3c5bf9510022869d30b7d26566)
|
||||
set(MD5_JPEG_GRAY_ISLOW 235c90707b16e2e069f37c888b2636d9)
|
||||
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)
|
||||
set(MD5_PPM_420M_ISLOW_2_1 4ca6be2a6f326ff9eaab63e70a8259c0)
|
||||
set(MD5_PPM_420M_ISLOW_15_8 12aa9f9534c1b3d7ba047322226365eb)
|
||||
set(MD5_PPM_420M_ISLOW_13_8 f7e22817c7b25e1393e4ec101e9d4e96)
|
||||
set(MD5_PPM_420M_ISLOW_11_8 800a16f9f4dc9b293197bfe11be10a82)
|
||||
set(MD5_PPM_420M_ISLOW_9_8 06b7a92a9bc69f4dc36ec40f1937d55c)
|
||||
set(MD5_PPM_420M_ISLOW_7_8 3ec444a14a4ab4eab88ffc49c48eca43)
|
||||
set(MD5_PPM_420M_ISLOW_3_4 3e726b7ea872445b19437d1c1d4f0d93)
|
||||
set(MD5_PPM_420M_ISLOW_5_8 a8a771abdc94301d20ffac119b2caccd)
|
||||
set(MD5_PPM_420M_ISLOW_1_2 b419124dd5568b085787234866102866)
|
||||
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_JPEG_CROP cdb35ff4b4519392690ea040c56ea99c)
|
||||
else()
|
||||
set(TESTORIG testorig.jpg)
|
||||
set(MD5_JPEG_RGB_ISLOW 768e970dd57b340ff1b83c9d3d47c77b)
|
||||
set(MD5_PPM_RGB_ISLOW 00a257f5393fef8821f2b88ac7421291)
|
||||
set(MD5_BMP_RGB_ISLOW_565 f07d2e75073e4bb10f6c6f4d36e2e3be)
|
||||
set(MD5_BMP_RGB_ISLOW_565D 4cfa0928ef3e6bb626d7728c924cfda4)
|
||||
set(MD5_JPEG_422_IFAST_OPT 2540287b79d913f91665e660303ab2c8)
|
||||
set(MD5_PPM_422_IFAST 35bd6b3f833bad23de82acea847129fa)
|
||||
set(MD5_PPM_422M_IFAST 8dbc65323d62cca7c91ba02dd1cfa81d)
|
||||
set(MD5_BMP_422M_IFAST_565 3294bd4d9a1f2b3d08ea6020d0db7065)
|
||||
set(MD5_BMP_422M_IFAST_565D da98c9c7b6039511be4a79a878a9abc1)
|
||||
set(MD5_JPEG_420_IFAST_Q100_PROG 990cbe0329c882420a2094da7e5adade)
|
||||
set(MD5_PPM_420_Q100_IFAST 5a732542015c278ff43635e473a8a294)
|
||||
set(MD5_PPM_420M_Q100_IFAST ff692ee9323a3b424894862557c092f1)
|
||||
set(MD5_JPEG_GRAY_ISLOW 72b51f894b8f4a10b3ee3066770aa38d)
|
||||
set(MD5_PPM_GRAY_ISLOW 8d3596c56eace32f205deccc229aa5ed)
|
||||
set(MD5_PPM_GRAY_ISLOW_RGB 116424ac07b79e5e801f00508eab48ec)
|
||||
set(MD5_BMP_GRAY_ISLOW_565 12f78118e56a2f48b966f792fedf23cc)
|
||||
set(MD5_BMP_GRAY_ISLOW_565D bdbbd616441a24354c98553df5dc82db)
|
||||
set(MD5_JPEG_420S_IFAST_OPT 388708217ac46273ca33086b22827ed8)
|
||||
if(WITH_SIMD)
|
||||
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)
|
||||
endif()
|
||||
set(MD5_JPEG_420_ISLOW_ARI e986fb0a637a8d833d96e8a6d6d84ea1)
|
||||
set(MD5_JPEG_444_ISLOW_PROGARI 0a8f1c8f66e113c3cf635df0a475a617)
|
||||
set(MD5_PPM_420M_IFAST_ARI 72b59a99bcf1de24c5b27d151bde2437)
|
||||
set(MD5_JPEG_420_ISLOW 9a68f56bc76e466aa7e52f415d0f4a5f)
|
||||
set(MD5_PPM_420M_ISLOW_2_1 9f9de8c0612f8d06869b960b05abf9c9)
|
||||
set(MD5_PPM_420M_ISLOW_15_8 b6875bc070720b899566cc06459b63b7)
|
||||
set(MD5_PPM_420M_ISLOW_13_8 bc3452573c8152f6ae552939ee19f82f)
|
||||
set(MD5_PPM_420M_ISLOW_11_8 d8cc73c0aaacd4556569b59437ba00a5)
|
||||
set(MD5_PPM_420M_ISLOW_9_8 d25e61bc7eac0002f5b393aa223747b6)
|
||||
set(MD5_PPM_420M_ISLOW_7_8 ddb564b7c74a09494016d6cd7502a946)
|
||||
set(MD5_PPM_420M_ISLOW_3_4 8ed8e68808c3fbc4ea764fc9d2968646)
|
||||
set(MD5_PPM_420M_ISLOW_5_8 a3363274999da2366a024efae6d16c9b)
|
||||
set(MD5_PPM_420M_ISLOW_1_2 e692a315cea26b988c8e8b29a5dbcd81)
|
||||
set(MD5_PPM_420M_ISLOW_3_8 79eca9175652ced755155c90e785a996)
|
||||
set(MD5_PPM_420M_ISLOW_1_4 79cd778f8bf1a117690052cacdd54eca)
|
||||
set(MD5_PPM_420M_ISLOW_1_8 391b3d4aca640c8567d6f8745eb2142f)
|
||||
set(MD5_BMP_420_ISLOW_256 4980185e3776e89bd931736e1cddeee6)
|
||||
set(MD5_BMP_420_ISLOW_565 bf9d13e16c4923b92e1faa604d7922cb)
|
||||
set(MD5_BMP_420_ISLOW_565D 6bde71526acc44bcff76f696df8638d2)
|
||||
set(MD5_BMP_420M_ISLOW_565 8dc0185245353cfa32ad97027342216f)
|
||||
set(MD5_BMP_420M_ISLOW_565D d1be3a3339166255e76fa50a0d70d73e)
|
||||
set(MD5_JPEG_CROP b4197f377e621c4e9b1d20471432610d)
|
||||
endif()
|
||||
|
||||
if(WITH_JAVA)
|
||||
add_test(TJUnitTest ${JAVA_RUNTIME} -cp "java/${OBJDIR}turbojpeg.jar" "-Djava.library.path=${CMAKE_CURRENT_BINARY_DIR}/${OBJDIR}" TJUnitTest)
|
||||
add_test(TJUnitTest-yuv ${JAVA_RUNTIME} -cp "java/${OBJDIR}turbojpeg.jar" "-Djava.library.path=${CMAKE_CURRENT_BINARY_DIR}/${OBJDIR}" TJUnitTest -yuv)
|
||||
add_test(TJUnitTest-yuv-nopad ${JAVA_RUNTIME} -cp "java/${OBJDIR}turbojpeg.jar" "-Djava.library.path=${CMAKE_CURRENT_BINARY_DIR}/${OBJDIR}" TJUnitTest -yuv -noyuvpad)
|
||||
add_test(TJUnitTest-bi ${JAVA_RUNTIME} -cp "java/${OBJDIR}turbojpeg.jar" "-Djava.library.path=${CMAKE_CURRENT_BINARY_DIR}/${OBJDIR}" TJUnitTest -bi)
|
||||
add_test(TJUnitTest-bi-yuv ${JAVA_RUNTIME} -cp "java/${OBJDIR}turbojpeg.jar" "-Djava.library.path=${CMAKE_CURRENT_BINARY_DIR}/${OBJDIR}" TJUnitTest -bi -yuv)
|
||||
add_test(TJUnitTest-bi-yuv-nopad ${JAVA_RUNTIME} -cp "java/${OBJDIR}turbojpeg.jar" "-Djava.library.path=${CMAKE_CURRENT_BINARY_DIR}/${OBJDIR}" TJUnitTest -bi -yuv -noyuvpad)
|
||||
add_test(TJUnitTest
|
||||
${JAVA_RUNTIME} -cp java/${OBJDIR}turbojpeg.jar
|
||||
-Djava.library.path=${CMAKE_CURRENT_BINARY_DIR}/${OBJDIR}
|
||||
TJUnitTest)
|
||||
add_test(TJUnitTest-yuv
|
||||
${JAVA_RUNTIME} -cp java/${OBJDIR}turbojpeg.jar
|
||||
-Djava.library.path=${CMAKE_CURRENT_BINARY_DIR}/${OBJDIR}
|
||||
TJUnitTest -yuv)
|
||||
add_test(TJUnitTest-yuv-nopad
|
||||
${JAVA_RUNTIME} -cp java/${OBJDIR}turbojpeg.jar
|
||||
-Djava.library.path=${CMAKE_CURRENT_BINARY_DIR}/${OBJDIR}
|
||||
TJUnitTest -yuv -noyuvpad)
|
||||
add_test(TJUnitTest-bi
|
||||
${JAVA_RUNTIME} -cp java/${OBJDIR}turbojpeg.jar
|
||||
-Djava.library.path=${CMAKE_CURRENT_BINARY_DIR}/${OBJDIR}
|
||||
TJUnitTest -bi)
|
||||
add_test(TJUnitTest-bi-yuv
|
||||
${JAVA_RUNTIME} -cp java/${OBJDIR}turbojpeg.jar
|
||||
-Djava.library.path=${CMAKE_CURRENT_BINARY_DIR}/${OBJDIR}
|
||||
TJUnitTest -bi -yuv)
|
||||
add_test(TJUnitTest-bi-yuv-nopad
|
||||
${JAVA_RUNTIME} -cp java/${OBJDIR}turbojpeg.jar
|
||||
-Djava.library.path=${CMAKE_CURRENT_BINARY_DIR}/${OBJDIR}
|
||||
TJUnitTest -bi -yuv -noyuvpad)
|
||||
endif()
|
||||
add_test(tjunittest tjunittest)
|
||||
add_test(tjunittest-alloc tjunittest -alloc)
|
||||
add_test(tjunittest-yuv tjunittest -yuv)
|
||||
add_test(tjunittest-yuv-alloc tjunittest -yuv -alloc)
|
||||
add_test(tjunittest-yuv-nopad tjunittest -yuv -noyuvpad)
|
||||
add_test(cjpeg-int sharedlib/cjpeg -dct int -outfile testoutint.jpg "${CMAKE_SOURCE_DIR}/testimages/testorig.ppm")
|
||||
add_test(cjpeg-int-cmp "${CMAKE_COMMAND}" -DMD5=${MD5_JPEG_INT} -DFILE=testoutint.jpg -P "${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake")
|
||||
add_test(cjpeg-fast sharedlib/cjpeg -dct fast -opt -outfile testoutfst.jpg "${CMAKE_SOURCE_DIR}/testimages/testorig.ppm")
|
||||
add_test(cjpeg-fast-cmp "${CMAKE_COMMAND}" -DMD5=${MD5_JPEG_FAST} -DFILE=testoutfst.jpg -P "${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake")
|
||||
add_test(cjpeg-fast-100 sharedlib/cjpeg -dct fast -quality 100 -opt -outfile testoutfst100.jpg "${CMAKE_SOURCE_DIR}/testimages/testorig.ppm")
|
||||
add_test(cjpeg-fast-100-cmp "${CMAKE_COMMAND}" -DMD5=${MD5_JPEG_FAST_100} -DFILE=testoutfst100.jpg -P "${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake")
|
||||
add_test(cjpeg-float sharedlib/cjpeg -dct float -outfile testoutflt.jpg "${CMAKE_SOURCE_DIR}/testimages/testorig.ppm")
|
||||
if(WITH_SIMD)
|
||||
add_test(cjpeg-float-cmp "${CMAKE_COMMAND}" -DMD5=${MD5_JPEG_FLOAT} -DFILE=testoutflt.jpg -P "${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake")
|
||||
else()
|
||||
add_test(cjpeg-float-cmp "${CMAKE_COMMAND}" -DMD5=${MD5_JPEG_FLOAT_NOSIMD} -DFILE=testoutflt.jpg -P "${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake")
|
||||
endif()
|
||||
add_test(cjpeg-int-gray sharedlib/cjpeg -dct int -grayscale -outfile testoutgray.jpg "${CMAKE_SOURCE_DIR}/testimages/testorig.ppm")
|
||||
add_test(cjpeg-int-gray-cmp "${CMAKE_COMMAND}" -DMD5=${MD5_JPEG_INT_GRAY} -DFILE=testoutgray.jpg -P "${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake")
|
||||
add_test(djpeg-int sharedlib/djpeg -dct int -fast -ppm -outfile testoutint.ppm "${CMAKE_SOURCE_DIR}/testimages/testorig.jpg")
|
||||
add_test(djpeg-int-cmp "${CMAKE_COMMAND}" -DMD5=${MD5_PPM_INT} -DFILE=testoutint.ppm -P "${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake")
|
||||
add_test(djpeg-fast sharedlib/djpeg -dct fast -ppm -outfile testoutfst.ppm "${CMAKE_SOURCE_DIR}/testimages/testorig.jpg")
|
||||
add_test(djpeg-fast-cmp "${CMAKE_COMMAND}" -DMD5=${MD5_PPM_FAST} -DFILE=testoutfst.ppm -P "${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake")
|
||||
add_test(djpeg-float sharedlib/djpeg -dct float -ppm -outfile testoutflt.ppm "${CMAKE_SOURCE_DIR}/testimages/testorig.jpg")
|
||||
if(WITH_SIMD)
|
||||
add_test(djpeg-float-cmp "${CMAKE_COMMAND}" -DMD5=${MD5_PPM_FLOAT} -DFILE=testoutflt.ppm -P "${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake")
|
||||
else()
|
||||
add_test(djpeg-float-cmp "${CMAKE_COMMAND}" -DMD5=${MD5_PPM_FLOAT_NOSIMD} -DFILE=testoutflt.ppm -P "${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake")
|
||||
endif()
|
||||
foreach(scale 2_1 15_8 7_4 13_8 3_2 11_8 5_4 9_8 7_8 3_4 5_8 1_2 3_8 1_4 1_8)
|
||||
string(REGEX REPLACE "_" "/" scalearg ${scale})
|
||||
add_test(djpeg-int-${scale} sharedlib/djpeg -dct int -nosmooth -scale ${scalearg} -ppm -outfile testoutint${scale}.ppm "${CMAKE_SOURCE_DIR}/testimages/testorig.jpg")
|
||||
add_test(djpeg-int-${scale}-cmp "${CMAKE_COMMAND}" -DMD5=${MD5_PPM_INT_${scale}} -DFILE=testoutint${scale}.ppm -P "${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake")
|
||||
endforeach()
|
||||
add_test(djpeg-fast-1_2 sharedlib/djpeg -dct fast -scale 1/2 -ppm -outfile testoutfst1_2.ppm "${CMAKE_SOURCE_DIR}/testimages/testorig.jpg")
|
||||
add_test(djpeg-fast-1_2-cmp "${CMAKE_COMMAND}" -DMD5=${MD5_PPM_FAST_1_2} -DFILE=testoutfst1_2.ppm -P "${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake")
|
||||
add_test(djpeg-256 sharedlib/djpeg -dct int -bmp -colors 256 -outfile testout.bmp "${CMAKE_SOURCE_DIR}/testimages/testorig.jpg")
|
||||
add_test(djpeg-256-cmp "${CMAKE_COMMAND}" -DMD5=${MD5_BMP_256} -DFILE=testout.bmp -P "${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake")
|
||||
add_test(cjpeg-prog sharedlib/cjpeg -dct int -progressive -outfile testoutp.jpg "${CMAKE_SOURCE_DIR}/testimages/testorig.ppm")
|
||||
add_test(cjpeg-prog-cmp "${CMAKE_COMMAND}" -DMD5=${MD5_JPEG_PROG} -DFILE=testoutp.jpg -P "${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake")
|
||||
add_test(jpegtran-prog sharedlib/jpegtran -outfile testoutt.jpg testoutp.jpg")
|
||||
add_test(jpegtran-prog-cmp "${CMAKE_COMMAND}" -DMD5=${MD5_JPEG_INT} -DFILE=testoutt.jpg -P "${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake")
|
||||
if(WITH_ARITH_ENC)
|
||||
add_test(cjpeg-ari sharedlib/cjpeg -dct int -arithmetic -outfile testoutari.jpg "${CMAKE_SOURCE_DIR}/testimages/testorig.ppm")
|
||||
add_test(cjpeg-ari-cmp "${CMAKE_COMMAND}" -DMD5=${MD5_JPEG_ARI} -DFILE=testoutari.jpg -P "${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake")
|
||||
add_test(jpegtran-toari sharedlib/jpegtran -arithmetic -outfile testouta.jpg "${CMAKE_SOURCE_DIR}/testimages/testimgint.jpg")
|
||||
add_test(jpegtran-toari-cmp "${CMAKE_COMMAND}" -DMD5=${MD5_JPEG_ARI} -DFILE=testouta.jpg -P "${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake")
|
||||
add_test(cjpeg-prog-ari sharedlib/cjpeg -dct int -progressive -arithmetic -sample 1x1 -outfile testoutpa.jpg "${CMAKE_SOURCE_DIR}/testimages/testorig.ppm")
|
||||
add_test(cjpeg-prog-ari-cmp "${CMAKE_COMMAND}" -DMD5=${MD5_JPEG_PROG_ARI} -DFILE=testoutpa.jpg -P "${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake")
|
||||
endif()
|
||||
if(WITH_ARITH_DEC)
|
||||
add_test(djpeg-ari sharedlib/djpeg -dct int -fast -ppm -outfile testoutari.ppm "${CMAKE_SOURCE_DIR}/testimages/testimgari.jpg")
|
||||
add_test(djpeg-ari-cmp "${CMAKE_COMMAND}" -DMD5=${MD5_PPM_ARI} -DFILE=testoutari.ppm -P "${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake")
|
||||
add_test(jpegtran-fromari sharedlib/jpegtran -outfile testouta.jpg "${CMAKE_SOURCE_DIR}/testimages/testimgari.jpg")
|
||||
add_test(jpegtran-fromari-cmp "${CMAKE_COMMAND}" -DMD5=${MD5_JPEG_INT} -DFILE=testouta.jpg -P "${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake")
|
||||
endif()
|
||||
add_test(jpegtran-crop sharedlib/jpegtran -crop 120x90+20+50 -transpose -perfect -outfile testoutcrop.jpg "${CMAKE_SOURCE_DIR}/testimages/testorig.jpg")
|
||||
add_test(jpegtran-crop-cmp "${CMAKE_COMMAND}" -DMD5=${MD5_JPEG_CROP} -DFILE=testoutcrop.jpg -P "${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake")
|
||||
|
||||
add_test(tjunittest-static tjunittest-static)
|
||||
add_test(tjunittest-static-alloc tjunittest-static -alloc)
|
||||
add_test(tjunittest-static-yuv tjunittest-static -yuv)
|
||||
add_test(tjunittest-static-yuv-alloc tjunittest-static -yuv -alloc)
|
||||
add_test(tjunittest-static-yuv-nopad tjunittest-static -yuv -noyuvpad)
|
||||
add_test(cjpeg-static-int cjpeg-static -dct int -outfile testoutint.jpg "${CMAKE_SOURCE_DIR}/testimages/testorig.ppm")
|
||||
add_test(cjpeg-static-int-cmp "${CMAKE_COMMAND}" -DMD5=${MD5_JPEG_INT} -DFILE=testoutint.jpg -P "${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake")
|
||||
add_test(cjpeg-static-fast cjpeg-static -dct fast -opt -outfile testoutfst.jpg "${CMAKE_SOURCE_DIR}/testimages/testorig.ppm")
|
||||
add_test(cjpeg-static-fast-cmp "${CMAKE_COMMAND}" -DMD5=${MD5_JPEG_FAST} -DFILE=testoutfst.jpg -P "${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake")
|
||||
add_test(cjpeg-static-fast-100 cjpeg-static -dct fast -quality 100 -opt -outfile testoutfst100.jpg "${CMAKE_SOURCE_DIR}/testimages/testorig.ppm")
|
||||
add_test(cjpeg-static-fast-100-cmp "${CMAKE_COMMAND}" -DMD5=${MD5_JPEG_FAST_100} -DFILE=testoutfst100.jpg -P "${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake")
|
||||
add_test(cjpeg-static-float cjpeg-static -dct float -outfile testoutflt.jpg "${CMAKE_SOURCE_DIR}/testimages/testorig.ppm")
|
||||
if(WITH_SIMD)
|
||||
add_test(cjpeg-static-float-cmp "${CMAKE_COMMAND}" -DMD5=${MD5_JPEG_FLOAT} -DFILE=testoutflt.jpg -P "${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake")
|
||||
else()
|
||||
add_test(cjpeg-static-float-cmp "${CMAKE_COMMAND}" -DMD5=${MD5_JPEG_FLOAT_NOSIMD} -DFILE=testoutflt.jpg -P "${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake")
|
||||
endif()
|
||||
add_test(cjpeg-static-int-gray cjpeg-static -dct int -grayscale -outfile testoutgray.jpg "${CMAKE_SOURCE_DIR}/testimages/testorig.ppm")
|
||||
add_test(cjpeg-static-int-gray-cmp "${CMAKE_COMMAND}" -DMD5=${MD5_JPEG_INT_GRAY} -DFILE=testoutgray.jpg -P "${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake")
|
||||
add_test(djpeg-static-int djpeg-static -dct int -fast -ppm -outfile testoutint.ppm "${CMAKE_SOURCE_DIR}/testimages/testorig.jpg")
|
||||
add_test(djpeg-static-int-cmp "${CMAKE_COMMAND}" -DMD5=${MD5_PPM_INT} -DFILE=testoutint.ppm -P "${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake")
|
||||
add_test(djpeg-static-fast djpeg-static -dct fast -ppm -outfile testoutfst.ppm "${CMAKE_SOURCE_DIR}/testimages/testorig.jpg")
|
||||
add_test(djpeg-static-fast-cmp "${CMAKE_COMMAND}" -DMD5=${MD5_PPM_FAST} -DFILE=testoutfst.ppm -P "${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake")
|
||||
add_test(djpeg-static-float djpeg-static -dct float -ppm -outfile testoutflt.ppm "${CMAKE_SOURCE_DIR}/testimages/testorig.jpg")
|
||||
if(WITH_SIMD)
|
||||
add_test(djpeg-static-float-cmp "${CMAKE_COMMAND}" -DMD5=${MD5_PPM_FLOAT} -DFILE=testoutflt.ppm -P "${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake")
|
||||
else()
|
||||
add_test(djpeg-static-float-cmp "${CMAKE_COMMAND}" -DMD5=${MD5_PPM_FLOAT_NOSIMD} -DFILE=testoutflt.ppm -P "${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake")
|
||||
endif()
|
||||
foreach(scale 2_1 15_8 7_4 13_8 3_2 11_8 5_4 9_8 7_8 3_4 5_8 1_2 3_8 1_4 1_8)
|
||||
string(REGEX REPLACE "_" "/" scalearg ${scale})
|
||||
add_test(djpeg-static-int-${scale} djpeg-static -dct int -nosmooth -scale ${scalearg} -ppm -outfile testoutint${scale}.ppm "${CMAKE_SOURCE_DIR}/testimages/testorig.jpg")
|
||||
add_test(djpeg-static-int-${scale}-cmp "${CMAKE_COMMAND}" -DMD5=${MD5_PPM_INT_${scale}} -DFILE=testoutint${scale}.ppm -P "${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake")
|
||||
endforeach()
|
||||
add_test(djpeg-static-fast-1_2 djpeg-static -dct fast -scale 1/2 -ppm -outfile testoutfst1_2.ppm "${CMAKE_SOURCE_DIR}/testimages/testorig.jpg")
|
||||
add_test(djpeg-static-fast-1_2-cmp "${CMAKE_COMMAND}" -DMD5=${MD5_PPM_FAST_1_2} -DFILE=testoutfst1_2.ppm -P "${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake")
|
||||
add_test(djpeg-static-256 djpeg-static -dct int -bmp -colors 256 -outfile testout.bmp "${CMAKE_SOURCE_DIR}/testimages/testorig.jpg")
|
||||
add_test(djpeg-static-256-cmp "${CMAKE_COMMAND}" -DMD5=${MD5_BMP_256} -DFILE=testout.bmp -P "${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake")
|
||||
add_test(cjpeg-static-prog cjpeg-static -dct int -progressive -outfile testoutp.jpg "${CMAKE_SOURCE_DIR}/testimages/testorig.ppm")
|
||||
add_test(cjpeg-static-prog-cmp "${CMAKE_COMMAND}" -DMD5=${MD5_JPEG_PROG} -DFILE=testoutp.jpg -P "${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake")
|
||||
add_test(jpegtran-static-prog jpegtran-static -outfile testoutt.jpg testoutp.jpg")
|
||||
add_test(jpegtran-static-prog-cmp "${CMAKE_COMMAND}" -DMD5=${MD5_JPEG_INT} -DFILE=testoutt.jpg -P "${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake")
|
||||
if(WITH_ARITH_ENC)
|
||||
add_test(cjpeg-static-ari cjpeg-static -dct int -arithmetic -outfile testoutari.jpg "${CMAKE_SOURCE_DIR}/testimages/testorig.ppm")
|
||||
add_test(cjpeg-static-ari-cmp "${CMAKE_COMMAND}" -DMD5=${MD5_JPEG_ARI} -DFILE=testoutari.jpg -P "${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake")
|
||||
add_test(jpegtran-static-toari jpegtran-static -arithmetic -outfile testouta.jpg "${CMAKE_SOURCE_DIR}/testimages/testimgint.jpg")
|
||||
add_test(jpegtran-static-toari-cmp "${CMAKE_COMMAND}" -DMD5=${MD5_JPEG_ARI} -DFILE=testouta.jpg -P "${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake")
|
||||
add_test(cjpeg-static-prog-ari cjpeg-static -dct int -progressive -arithmetic -sample 1x1 -outfile testoutpa.jpg "${CMAKE_SOURCE_DIR}/testimages/testorig.ppm")
|
||||
add_test(cjpeg-static-prog-ari-cmp "${CMAKE_COMMAND}" -DMD5=${MD5_JPEG_PROG_ARI} -DFILE=testoutpa.jpg -P "${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake")
|
||||
endif()
|
||||
if(WITH_ARITH_DEC)
|
||||
add_test(djpeg-static-ari djpeg-static -dct int -fast -ppm -outfile testoutari.ppm "${CMAKE_SOURCE_DIR}/testimages/testimgari.jpg")
|
||||
add_test(djpeg-static-ari-cmp "${CMAKE_COMMAND}" -DMD5=${MD5_PPM_ARI} -DFILE=testoutari.ppm -P "${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake")
|
||||
add_test(jpegtran-static-fromari jpegtran-static -outfile testouta.jpg "${CMAKE_SOURCE_DIR}/testimages/testimgari.jpg")
|
||||
add_test(jpegtran-static-fromari-cmp "${CMAKE_COMMAND}" -DMD5=${MD5_JPEG_INT} -DFILE=testouta.jpg -P "${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake")
|
||||
endif()
|
||||
add_test(jpegtran-static-crop jpegtran-static -crop 120x90+20+50 -transpose -perfect -outfile testoutcrop.jpg "${CMAKE_SOURCE_DIR}/testimages/testorig.jpg")
|
||||
add_test(jpegtran-static-crop-cmp "${CMAKE_COMMAND}" -DMD5=${MD5_JPEG_CROP} -DFILE=testoutcrop.jpg -P "${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake")
|
||||
foreach(libtype shared static)
|
||||
if(libtype STREQUAL "shared")
|
||||
set(dir sharedlib/)
|
||||
else()
|
||||
set(dir "")
|
||||
set(suffix -static)
|
||||
endif()
|
||||
if(WITH_TURBOJPEG)
|
||||
add_test(tjunittest${suffix} tjunittest${suffix})
|
||||
add_test(tjunittest${suffix}-alloc tjunittest${suffix} -alloc)
|
||||
add_test(tjunittest${suffix}-yuv tjunittest${suffix} -yuv)
|
||||
add_test(tjunittest${suffix}-yuv-alloc tjunittest${suffix} -yuv -alloc)
|
||||
add_test(tjunittest${suffix}-yuv-nopad tjunittest${suffix} -yuv -noyuvpad)
|
||||
endif()
|
||||
|
||||
add_custom_target(testclean COMMAND "${CMAKE_COMMAND}" -P
|
||||
"${CMAKE_SOURCE_DIR}/cmakescripts/testclean.cmake" VERBATIM)
|
||||
# These tests are carefully chosen to provide full coverage of as many of the
|
||||
# underlying algorithms as possible (including all of the SIMD-accelerated
|
||||
# ones.)
|
||||
|
||||
# CC: null SAMP: fullsize FDCT: islow ENT: huff
|
||||
add_test(cjpeg${suffix}-rgb-islow
|
||||
${dir}cjpeg${suffix} -revert -rgb -dct int -outfile testout_rgb_islow.jpg
|
||||
${CMAKE_SOURCE_DIR}/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)
|
||||
# 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)
|
||||
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)
|
||||
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)
|
||||
# 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)
|
||||
endif()
|
||||
|
||||
# CC: RGB->YCC SAMP: fullsize/h2v1 FDCT: ifast ENT: 2-pass huff
|
||||
add_test(cjpeg${suffix}-422-ifast-opt
|
||||
${dir}cjpeg${suffix} -revert -sample 2x1 -dct fast -opt
|
||||
-outfile testout_422_ifast_opt.jpg
|
||||
${CMAKE_SOURCE_DIR}/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)
|
||||
# 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)
|
||||
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)
|
||||
# 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)
|
||||
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)
|
||||
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)
|
||||
# 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)
|
||||
endif()
|
||||
|
||||
# CC: RGB->YCC SAMP: fullsize/h2v2 FDCT: ifast ENT: prog huff
|
||||
add_test(cjpeg${suffix}-420-q100-ifast-prog
|
||||
${dir}cjpeg${suffix} -revert -sample 2x2 -quality 100 -dct fast -prog
|
||||
-outfile testout_420_q100_ifast_prog.jpg
|
||||
${CMAKE_SOURCE_DIR}/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)
|
||||
# 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)
|
||||
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)
|
||||
# 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)
|
||||
|
||||
# CC: RGB->Gray SAMP: fullsize FDCT: islow ENT: huff
|
||||
add_test(cjpeg${suffix}-gray-islow
|
||||
${dir}cjpeg${suffix} -revert -gray -dct int -outfile testout_gray_islow.jpg
|
||||
${CMAKE_SOURCE_DIR}/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)
|
||||
# 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)
|
||||
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)
|
||||
# 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)
|
||||
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)
|
||||
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)
|
||||
# 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)
|
||||
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} -revert -sample 2x2 -smooth 1 -dct int -opt -outfile
|
||||
testout_420s_ifast_opt.jpg ${CMAKE_SOURCE_DIR}/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)
|
||||
|
||||
# CC: RGB->YCC SAMP: fullsize/int FDCT: float ENT: prog huff
|
||||
add_test(cjpeg${suffix}-3x2-float-prog
|
||||
${dir}cjpeg${suffix} -revert -sample 3x2 -dct float -prog
|
||||
-outfile testout_3x2_float_prog.jpg
|
||||
${CMAKE_SOURCE_DIR}/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)
|
||||
# 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)
|
||||
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)
|
||||
|
||||
if(WITH_ARITH_ENC)
|
||||
# CC: YCC->RGB SAMP: fullsize/h2v2 FDCT: islow ENT: arith
|
||||
add_test(cjpeg${suffix}-420-islow-ari
|
||||
${dir}cjpeg${suffix} -revert -dct int -arithmetic
|
||||
-outfile testout_420_islow_ari.jpg
|
||||
${CMAKE_SOURCE_DIR}/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)
|
||||
add_test(jpegtran${suffix}-420-islow-ari
|
||||
${dir}jpegtran${suffix} -revert -arithmetic
|
||||
-outfile testout_420_islow_ari.jpg
|
||||
${CMAKE_SOURCE_DIR}/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)
|
||||
# CC: YCC->RGB SAMP: fullsize FDCT: islow ENT: prog arith
|
||||
add_test(cjpeg${suffix}-444-islow-progari
|
||||
${dir}cjpeg${suffix} -revert -sample 1x1 -dct int -progressive -arithmetic
|
||||
-outfile testout_444_islow_progari.jpg
|
||||
${CMAKE_SOURCE_DIR}/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)
|
||||
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)
|
||||
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)
|
||||
add_test(jpegtran${suffix}-420-islow
|
||||
${dir}jpegtran${suffix} -revert -outfile testout_420_islow.jpg
|
||||
${CMAKE_SOURCE_DIR}/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)
|
||||
endif()
|
||||
|
||||
# 2/1-- CC: YCC->RGB SAMP: h2v2 merged IDCT: 16x16 islow ENT: huff
|
||||
# 15/8-- CC: YCC->RGB SAMP: h2v2 merged IDCT: 15x15 islow ENT: huff
|
||||
# 13/8-- CC: YCC->RGB SAMP: h2v2 merged IDCT: 13x13 islow ENT: huff
|
||||
# 11/8-- CC: YCC->RGB SAMP: h2v2 merged IDCT: 11x11 islow ENT: huff
|
||||
# 9/8-- CC: YCC->RGB SAMP: h2v2 merged IDCT: 9x9 islow ENT: huff
|
||||
# 7/8-- CC: YCC->RGB SAMP: h2v2 merged IDCT: 7x7 islow/14x14 islow
|
||||
# ENT: huff
|
||||
# 3/4-- CC: YCC->RGB SAMP: h2v2 merged IDCT: 6x6 islow/12x12 islow
|
||||
# ENT: huff
|
||||
# 5/8-- CC: YCC->RGB SAMP: h2v2 merged IDCT: 5x5 islow/10x10 islow
|
||||
# ENT: huff
|
||||
# 1/2-- CC: YCC->RGB SAMP: h2v2 merged IDCT: 4x4 islow/8x8 islow
|
||||
# ENT: huff
|
||||
# 3/8-- CC: YCC->RGB SAMP: h2v2 merged IDCT: 3x3 islow/6x6 islow
|
||||
# ENT: huff
|
||||
# 1/4-- CC: YCC->RGB SAMP: h2v2 merged IDCT: 2x2 islow/4x4 islow
|
||||
# ENT: huff
|
||||
# 1/8-- CC: YCC->RGB SAMP: h2v2 merged IDCT: 1x1 islow/2x2 islow
|
||||
# ENT: huff
|
||||
foreach(scale 2_1 15_8 13_8 11_8 9_8 7_8 3_4 5_8 1_2 3_8 1_4 1_8)
|
||||
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})
|
||||
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)
|
||||
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})
|
||||
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)
|
||||
# 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})
|
||||
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)
|
||||
# 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})
|
||||
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)
|
||||
# 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})
|
||||
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)
|
||||
# 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})
|
||||
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)
|
||||
endif()
|
||||
add_test(jpegtran${suffix}-crop
|
||||
${dir}jpegtran${suffix} -revert -crop 120x90+20+50 -transpose -perfect
|
||||
-outfile testout_crop.jpg ${CMAKE_SOURCE_DIR}/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)
|
||||
|
||||
endforeach()
|
||||
|
||||
add_custom_target(testclean COMMAND ${CMAKE_COMMAND} -P
|
||||
${CMAKE_SOURCE_DIR}/cmakescripts/testclean.cmake)
|
||||
|
||||
|
||||
#
|
||||
@@ -476,18 +778,21 @@ endif()
|
||||
|
||||
STRING(REGEX REPLACE "/" "\\\\" INST_DIR "${CMAKE_INSTALL_PREFIX}")
|
||||
|
||||
configure_file(release/libmozjpeg.nsi.in libmozjpeg.nsi @ONLY)
|
||||
configure_file(release/mozjpeg.nsi.in mozjpeg.nsi @ONLY)
|
||||
|
||||
if(WITH_JAVA)
|
||||
set(JAVA_DEPEND java)
|
||||
endif()
|
||||
add_custom_target(installer
|
||||
makensis -nocd ${INST_DEFS} libmozjpeg.nsi
|
||||
makensis -nocd ${INST_DEFS} mozjpeg.nsi
|
||||
DEPENDS jpeg jpeg-static turbojpeg turbojpeg-static rdjpgcom wrjpgcom
|
||||
cjpeg djpeg jpegtran tjbench ${JAVA_DEPEND}
|
||||
SOURCES libmozjpeg.nsi)
|
||||
SOURCES mozjpeg.nsi)
|
||||
|
||||
install(TARGETS jpeg-static turbojpeg turbojpeg-static rdjpgcom wrjpgcom tjbench
|
||||
if(WITH_TURBOJPEG)
|
||||
set(TURBOJPEG_TARGETS turbojpeg turbojpeg-static tjbench)
|
||||
endif()
|
||||
install(TARGETS jpeg-static rdjpgcom wrjpgcom ${TURBOJPEG_TARGETS}
|
||||
ARCHIVE DESTINATION lib
|
||||
LIBRARY DESTINATION lib
|
||||
RUNTIME DESTINATION bin
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
Version 1.0 (March 4, 2014)
|
||||
===========================
|
||||
|
||||
* Add 'jpgcrush' functionality. Figures out which progressive coding configuration uses the fewest bits.
|
||||
213
ChangeLog.txt
213
ChangeLog.txt
@@ -1,27 +1,190 @@
|
||||
1.4 pre-beta
|
||||
============
|
||||
1.4.0
|
||||
=====
|
||||
|
||||
[1] The TurboJPEG API can now be used to generate YUV images with an arbitrary
|
||||
line padding (previously, it only supported 4-byte padding, which was
|
||||
compatible with X Video.) Also, the decompress-to-YUV function has been
|
||||
extended to support image scaling.
|
||||
[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() wherby 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] Added support for 4:1:1 subsampling to the TurboJPEG API. 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.
|
||||
[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] Added support for CMYK images to the TurboJPEG API. This feature allows
|
||||
CMYK source images to be compressed to YCCK JPEGs and YCCK or CMYK JPEGs to be
|
||||
decompressed to CMYK destination images. Conversion between CMYK and RGB
|
||||
images is not supported. Such conversion requires a color management system
|
||||
and is out of scope for a codec library.
|
||||
[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 TurboJPEG API can now be used to compress JPEG images from YUV planar
|
||||
source images.
|
||||
[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
|
||||
@@ -48,6 +211,20 @@ 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
|
||||
=====
|
||||
@@ -142,7 +319,7 @@ 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 ARM v7s architecture to libjpeg.a and libturbojpeg.a in the official
|
||||
[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.
|
||||
|
||||
@@ -225,7 +402,7 @@ K component is assigned a component ID of 1 instead of 4. Although these files
|
||||
are in violation of the spec, other JPEG implementations handle them
|
||||
correctly.
|
||||
|
||||
[7] Added ARM v6 and ARM v7 architectures to libjpeg.a and libturbojpeg.a in
|
||||
[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.
|
||||
|
||||
|
||||
@@ -2,6 +2,6 @@ Redistribution and use in source and binary forms, with or without modification,
|
||||
|
||||
* 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 libmozjpeg Project nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
||||
* Neither the name of the mozjpeg 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.
|
||||
|
||||
462
Makefile.am
462
Makefile.am
@@ -11,17 +11,18 @@ endif
|
||||
nodist_include_HEADERS = jconfig.h
|
||||
|
||||
|
||||
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
|
||||
HDRS = jchuff.h jcmaster.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 \
|
||||
jpeg_nbits_table.h
|
||||
|
||||
libjpeg_la_SOURCES = $(HDRS) jcapimin.c jcapistd.c jccoefct.c jccolor.c \
|
||||
jcdctmgr.c jchuff.c jcinit.c jcmainct.c jcmarker.c jcmaster.c \
|
||||
jcomapi.c jcparam.c jcphuff.c jcprepct.c jcsample.c jctrans.c \
|
||||
jdapimin.c jdapistd.c jdatadst.c jdatasrc.c jdcoefct.c jdcolor.c \
|
||||
jddctmgr.c jdhuff.c jdinput.c jdmainct.c jdmarker.c jdmaster.c \
|
||||
jdmerge.c jdphuff.c jdpostct.c jdsample.c jdtrans.c jerror.c \
|
||||
jfdctflt.c jfdctfst.c jfdctint.c jidctflt.c jidctfst.c jidctint.c \
|
||||
jidctred.c jquant1.c jquant2.c jutils.c jmemmgr.c jmemnobs.c
|
||||
jcdctmgr.c jcext.c jchuff.c jcinit.c jcmainct.c jcmarker.c \
|
||||
jcmaster.c jcomapi.c jcparam.c jcphuff.c jcprepct.c jcsample.c \
|
||||
jctrans.c jdapimin.c jdapistd.c jdatadst.c jdatasrc.c jdcoefct.c \
|
||||
jdcolor.c jddctmgr.c jdhuff.c jdinput.c jdmainct.c jdmarker.c \
|
||||
jdmaster.c jdmerge.c jdphuff.c jdpostct.c jdsample.c jdtrans.c \
|
||||
jerror.c jfdctflt.c jfdctfst.c jfdctint.c jidctflt.c jidctfst.c \
|
||||
jidctint.c jidctred.c jquant1.c jquant2.c jutils.c jmemmgr.c jmemnobs.c
|
||||
|
||||
if WITH_ARITH
|
||||
libjpeg_la_SOURCES += jaricom.c
|
||||
@@ -107,21 +108,40 @@ tjunittest_LDADD = libturbojpeg.la
|
||||
endif
|
||||
|
||||
|
||||
cjpeg_SOURCES = cdjpeg.h cderror.h cdjpeg.c cjpeg.c rdbmp.c rdgif.c \
|
||||
rdppm.c rdswitch.c rdtarga.c rdjpeg.c
|
||||
cjpeg_SOURCES = cdjpeg.h cderror.h cdjpeg.c cjpeg.c rdgif.c rdppm.c rdswitch.c rdjpeg.c
|
||||
if WITH_12BIT
|
||||
else
|
||||
cjpeg_SOURCES += rdbmp.c rdtarga.c
|
||||
endif
|
||||
|
||||
cjpeg_LDADD = libjpeg.la
|
||||
|
||||
cjpeg_CFLAGS = -DBMP_SUPPORTED -DGIF_SUPPORTED -DPPM_SUPPORTED \
|
||||
-DTARGA_SUPPORTED
|
||||
cjpeg_CFLAGS = -DGIF_SUPPORTED -DPPM_SUPPORTED
|
||||
if WITH_12BIT
|
||||
else
|
||||
cjpeg_CFLAGS += -DBMP_SUPPORTED -DTARGA_SUPPORTED
|
||||
endif
|
||||
|
||||
if HAVE_LIBPNG
|
||||
cjpeg_CFLAGS += -DPNG_SUPPORTED $(libpng_CFLAGS)
|
||||
cjpeg_LDADD += $(libpng_LIBS)
|
||||
cjpeg_SOURCES += rdpng.c
|
||||
endif
|
||||
|
||||
djpeg_SOURCES = cdjpeg.h cderror.h cdjpeg.c djpeg.c rdcolmap.c rdswitch.c \
|
||||
wrbmp.c wrgif.c wrppm.c wrtarga.c
|
||||
wrgif.c wrppm.c
|
||||
if WITH_12BIT
|
||||
else
|
||||
djpeg_SOURCES += wrbmp.c wrtarga.c
|
||||
endif
|
||||
|
||||
djpeg_LDADD = libjpeg.la
|
||||
|
||||
djpeg_CFLAGS = -DBMP_SUPPORTED -DGIF_SUPPORTED -DPPM_SUPPORTED \
|
||||
-DTARGA_SUPPORTED
|
||||
djpeg_CFLAGS = -DGIF_SUPPORTED -DPPM_SUPPORTED
|
||||
if WITH_12BIT
|
||||
else
|
||||
djpeg_CFLAGS += -DBMP_SUPPORTED -DTARGA_SUPPORTED
|
||||
endif
|
||||
|
||||
jpegtran_SOURCES = jpegtran.c rdswitch.c cdjpeg.c transupp.c transupp.h
|
||||
|
||||
@@ -162,7 +182,8 @@ dist_example_DATA = example.c
|
||||
|
||||
EXTRA_DIST = win release $(DOCS) testimages CMakeLists.txt \
|
||||
sharedlib/CMakeLists.txt cmakescripts libjpeg.map.in doc doxygen.config \
|
||||
jccolext.c jdcolext.c jdmrgext.c
|
||||
doxygen-extra.css jccolext.c jdcolext.c jdcol565.c jdmrgext.c jdmrg565.c \
|
||||
jstdhuff.c
|
||||
|
||||
dist-hook:
|
||||
rm -rf `find $(distdir) -name .svn`
|
||||
@@ -170,40 +191,96 @@ dist-hook:
|
||||
|
||||
SUBDIRS += md5
|
||||
|
||||
MD5_JPEG_INT = 9a68f56bc76e466aa7e52f415d0f4a5f
|
||||
MD5_JPEG_FAST = 0e1502e7fa421835e376a314fac2a39f
|
||||
MD5_JPEG_FAST_100 = 7bf72a8e741d64eecb960c97323af77c
|
||||
MD5_JPEG_FLOAT = d1623885ffafcd40c684af09e3d65cd5
|
||||
MD5_JPEG_FLOAT_NOSIMD = fb4884c35f8273f498cb32879de5c455
|
||||
MD5_JPEG_INT_GRAY = 72b51f894b8f4a10b3ee3066770aa38d
|
||||
MD5_PPM_INT = d1ed0d11f076b842525271647716aeb8
|
||||
MD5_PPM_FAST = 048298a2d2410261c0533cb97bcfef23
|
||||
MD5_PPM_FLOAT = 7f5b446ee36b2630e06785b8d42af15f
|
||||
MD5_PPM_FLOAT_NOSIMD = 64072f1dbdc5b3a187777788604971a5
|
||||
MD5_PPM_INT_2_1 = 9f9de8c0612f8d06869b960b05abf9c9
|
||||
MD5_PPM_INT_15_8 = b6875bc070720b899566cc06459b63b7
|
||||
MD5_PPM_INT_7_4 = 06a177eae05f164fac57f7a2c346ee87
|
||||
MD5_PPM_INT_13_8 = bc3452573c8152f6ae552939ee19f82f
|
||||
MD5_PPM_INT_3_2 = f5a8b88a8a7f96016f04d259cf82ed67
|
||||
MD5_PPM_INT_11_8 = d8cc73c0aaacd4556569b59437ba00a5
|
||||
MD5_PPM_INT_5_4 = 32775dd9ad2ab90f4c5b219b53e0c86c
|
||||
MD5_PPM_INT_9_8 = d25e61bc7eac0002f5b393aa223747b6
|
||||
MD5_PPM_INT_7_8 = ddb564b7c74a09494016d6cd7502a946
|
||||
MD5_PPM_INT_3_4 = 8ed8e68808c3fbc4ea764fc9d2968646
|
||||
MD5_PPM_INT_5_8 = a3363274999da2366a024efae6d16c9b
|
||||
MD5_PPM_INT_1_2 = e692a315cea26b988c8e8b29a5dbcd81
|
||||
MD5_PPM_INT_3_8 = 79eca9175652ced755155c90e785a996
|
||||
MD5_PPM_INT_1_4 = 79cd778f8bf1a117690052cacdd54eca
|
||||
MD5_PPM_INT_1_8 = 391b3d4aca640c8567d6f8745eb2142f
|
||||
MD5_PPM_FAST_1_2 = f30bcf6d32ccd44cbdd9aeaacbd9454f
|
||||
MD5_BMP_256 = 4980185e3776e89bd931736e1cddeee6
|
||||
MD5_JPEG_ARI = e986fb0a637a8d833d96e8a6d6d84ea1
|
||||
MD5_PPM_ARI = 72b59a99bcf1de24c5b27d151bde2437
|
||||
MD5_JPEG_PROG = 1c4afddc05c0a43489ee54438a482d92
|
||||
MD5_JPEG_PROG_ARI = 0a8f1c8f66e113c3cf635df0a475a617
|
||||
if WITH_12BIT
|
||||
|
||||
TESTORIG = testorig12.jpg
|
||||
MD5_JPEG_RGB_ISLOW = 9620f424569594bb9242b48498ad801f
|
||||
MD5_PPM_RGB_ISLOW = f3301d2219783b8b3d942b7239fa50c0
|
||||
MD5_JPEG_422_IFAST_OPT = 7322e3bd2f127f7de4b40d4480ce60e4
|
||||
MD5_PPM_422_IFAST = 79807fa552899e66a04708f533e16950
|
||||
MD5_PPM_422M_IFAST = 07737bfe8a7c1c87aaa393a0098d16b0
|
||||
MD5_JPEG_420_IFAST_Q100_PROG = a1da220b5604081863a504297ed59e55
|
||||
MD5_PPM_420_Q100_IFAST = 1b3730122709f53d007255e8dfd3305e
|
||||
MD5_PPM_420M_Q100_IFAST = 980a1a3c5bf9510022869d30b7d26566
|
||||
MD5_JPEG_GRAY_ISLOW = 235c90707b16e2e069f37c888b2636d9
|
||||
MD5_PPM_GRAY_ISLOW = 7213c10af507ad467da5578ca5ee1fca
|
||||
MD5_PPM_GRAY_ISLOW_RGB = e96ee81c30a6ed422d466338bd3de65d
|
||||
MD5_JPEG_420S_IFAST_OPT = 7af8e60be4d9c227ec63ac9b6630855e
|
||||
MD5_JPEG_3x2_FLOAT_PROG = a8c17daf77b457725ec929e215b603f8
|
||||
MD5_PPM_3x2_FLOAT = 42876ab9e5c2f76a87d08db5fbd57956
|
||||
MD5_PPM_420M_ISLOW_2_1 = 4ca6be2a6f326ff9eaab63e70a8259c0
|
||||
MD5_PPM_420M_ISLOW_15_8 = 12aa9f9534c1b3d7ba047322226365eb
|
||||
MD5_PPM_420M_ISLOW_13_8 = f7e22817c7b25e1393e4ec101e9d4e96
|
||||
MD5_PPM_420M_ISLOW_11_8 = 800a16f9f4dc9b293197bfe11be10a82
|
||||
MD5_PPM_420M_ISLOW_9_8 = 06b7a92a9bc69f4dc36ec40f1937d55c
|
||||
MD5_PPM_420M_ISLOW_7_8 = 3ec444a14a4ab4eab88ffc49c48eca43
|
||||
MD5_PPM_420M_ISLOW_3_4 = 3e726b7ea872445b19437d1c1d4f0d93
|
||||
MD5_PPM_420M_ISLOW_5_8 = a8a771abdc94301d20ffac119b2caccd
|
||||
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_JPEG_CROP = cdb35ff4b4519392690ea040c56ea99c
|
||||
|
||||
else
|
||||
|
||||
TESTORIG = testorig.jpg
|
||||
MD5_JPEG_RGB_ISLOW = 768e970dd57b340ff1b83c9d3d47c77b
|
||||
MD5_PPM_RGB_ISLOW = 00a257f5393fef8821f2b88ac7421291
|
||||
MD5_BMP_RGB_ISLOW_565 = f07d2e75073e4bb10f6c6f4d36e2e3be
|
||||
MD5_BMP_RGB_ISLOW_565D = 4cfa0928ef3e6bb626d7728c924cfda4
|
||||
MD5_JPEG_422_IFAST_OPT = 2540287b79d913f91665e660303ab2c8
|
||||
MD5_PPM_422_IFAST = 35bd6b3f833bad23de82acea847129fa
|
||||
MD5_PPM_422M_IFAST = 8dbc65323d62cca7c91ba02dd1cfa81d
|
||||
MD5_BMP_422M_IFAST_565 = 3294bd4d9a1f2b3d08ea6020d0db7065
|
||||
MD5_BMP_422M_IFAST_565D = da98c9c7b6039511be4a79a878a9abc1
|
||||
MD5_JPEG_420_IFAST_Q100_PROG = 990cbe0329c882420a2094da7e5adade
|
||||
MD5_PPM_420_Q100_IFAST = 5a732542015c278ff43635e473a8a294
|
||||
MD5_PPM_420M_Q100_IFAST = ff692ee9323a3b424894862557c092f1
|
||||
MD5_JPEG_GRAY_ISLOW = 72b51f894b8f4a10b3ee3066770aa38d
|
||||
MD5_PPM_GRAY_ISLOW = 8d3596c56eace32f205deccc229aa5ed
|
||||
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.
|
||||
if WITH_SSE_FLOAT_DCT
|
||||
MD5_JPEG_3x2_FLOAT_PROG = 343e3f8caf8af5986ebaf0bdc13b5c71
|
||||
MD5_PPM_3x2_FLOAT = 1a75f36e5904d6fc3a85a43da9ad89bb
|
||||
else
|
||||
MD5_JPEG_3x2_FLOAT_PROG = 9bca803d2042bd1eb03819e2bf92b3e5
|
||||
MD5_PPM_3x2_FLOAT = f6bfab038438ed8f5522fbd33595dcdc
|
||||
endif
|
||||
MD5_JPEG_420_ISLOW_ARI = e986fb0a637a8d833d96e8a6d6d84ea1
|
||||
MD5_JPEG_444_ISLOW_PROGARI = 0a8f1c8f66e113c3cf635df0a475a617
|
||||
MD5_PPM_420M_IFAST_ARI = 72b59a99bcf1de24c5b27d151bde2437
|
||||
MD5_JPEG_420_ISLOW = 9a68f56bc76e466aa7e52f415d0f4a5f
|
||||
MD5_PPM_420M_ISLOW_2_1 = 9f9de8c0612f8d06869b960b05abf9c9
|
||||
MD5_PPM_420M_ISLOW_15_8 = b6875bc070720b899566cc06459b63b7
|
||||
MD5_PPM_420M_ISLOW_13_8 = bc3452573c8152f6ae552939ee19f82f
|
||||
MD5_PPM_420M_ISLOW_11_8 = d8cc73c0aaacd4556569b59437ba00a5
|
||||
MD5_PPM_420M_ISLOW_9_8 = d25e61bc7eac0002f5b393aa223747b6
|
||||
MD5_PPM_420M_ISLOW_7_8 = ddb564b7c74a09494016d6cd7502a946
|
||||
MD5_PPM_420M_ISLOW_3_4 = 8ed8e68808c3fbc4ea764fc9d2968646
|
||||
MD5_PPM_420M_ISLOW_5_8 = a3363274999da2366a024efae6d16c9b
|
||||
MD5_PPM_420M_ISLOW_1_2 = e692a315cea26b988c8e8b29a5dbcd81
|
||||
MD5_PPM_420M_ISLOW_3_8 = 79eca9175652ced755155c90e785a996
|
||||
MD5_PPM_420M_ISLOW_1_4 = 79cd778f8bf1a117690052cacdd54eca
|
||||
MD5_PPM_420M_ISLOW_1_8 = 391b3d4aca640c8567d6f8745eb2142f
|
||||
MD5_BMP_420_ISLOW_256 = 4980185e3776e89bd931736e1cddeee6
|
||||
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_JPEG_CROP = b4197f377e621c4e9b1d20471432610d
|
||||
|
||||
test: testclean all
|
||||
endif
|
||||
|
||||
.PHONY: test
|
||||
test: tjquicktest bittest
|
||||
|
||||
tjquicktest: testclean all
|
||||
|
||||
if WITH_TURBOJPEG
|
||||
if WITH_JAVA
|
||||
$(JAVA) -cp java/turbojpeg.jar -Djava.library.path=.libs TJUnitTest
|
||||
@@ -219,84 +296,205 @@ endif
|
||||
./tjunittest -yuv -alloc
|
||||
./tjunittest -yuv -noyuvpad
|
||||
endif
|
||||
./cjpeg -dct int -outfile testoutint.jpg $(srcdir)/testimages/testorig.ppm
|
||||
md5/md5cmp $(MD5_JPEG_INT) testoutint.jpg
|
||||
./cjpeg -dct fast -opt -outfile testoutfst.jpg $(srcdir)/testimages/testorig.ppm
|
||||
md5/md5cmp $(MD5_JPEG_FAST) testoutfst.jpg
|
||||
./cjpeg -dct fast -quality 100 -opt -outfile testoutfst100.jpg $(srcdir)/testimages/testorig.ppm
|
||||
md5/md5cmp $(MD5_JPEG_FAST_100) testoutfst100.jpg
|
||||
./cjpeg -dct float -outfile testoutflt.jpg $(srcdir)/testimages/testorig.ppm
|
||||
if WITH_SSE_FLOAT_DCT
|
||||
md5/md5cmp $(MD5_JPEG_FLOAT) testoutflt.jpg
|
||||
|
||||
bittest: testclean all
|
||||
|
||||
# These tests are carefully crafted to provide full coverage of as many of the
|
||||
# underlying algorithms as possible (including all of the SIMD-accelerated
|
||||
# ones.)
|
||||
|
||||
# CC: null SAMP: fullsize FDCT: islow ENT: huff
|
||||
./cjpeg -revert -rgb -dct int -outfile testout_rgb_islow.jpg $(srcdir)/testimages/testorig.ppm
|
||||
md5/md5cmp $(MD5_JPEG_RGB_ISLOW) testout_rgb_islow.jpg
|
||||
# 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
|
||||
if WITH_12BIT
|
||||
rm testout_rgb_islow.jpg
|
||||
else
|
||||
md5/md5cmp $(MD5_JPEG_FLOAT_NOSIMD) testoutflt.jpg
|
||||
# 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
|
||||
# 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
|
||||
endif
|
||||
./cjpeg -dct int -grayscale -outfile testoutgray.jpg $(srcdir)/testimages/testorig.ppm
|
||||
md5/md5cmp $(MD5_JPEG_INT_GRAY) testoutgray.jpg
|
||||
./djpeg -dct int -fast -ppm -outfile testoutint.ppm $(srcdir)/testimages/testorig.jpg
|
||||
md5/md5cmp $(MD5_PPM_INT) testoutint.ppm
|
||||
./djpeg -dct fast -ppm -outfile testoutfst.ppm $(srcdir)/testimages/testorig.jpg
|
||||
md5/md5cmp $(MD5_PPM_FAST) testoutfst.ppm
|
||||
./djpeg -dct float -ppm -outfile testoutflt.ppm $(srcdir)/testimages/testorig.jpg
|
||||
if WITH_SSE_FLOAT_DCT
|
||||
md5/md5cmp $(MD5_PPM_FLOAT) testoutflt.ppm
|
||||
|
||||
# CC: RGB->YCC SAMP: fullsize/h2v1 FDCT: ifast ENT: 2-pass huff
|
||||
./cjpeg -revert -sample 2x1 -dct fast -opt -outfile testout_422_ifast_opt.jpg $(srcdir)/testimages/testorig.ppm
|
||||
md5/md5cmp $(MD5_JPEG_422_IFAST_OPT) testout_422_ifast_opt.jpg
|
||||
# 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
|
||||
# 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
|
||||
if WITH_12BIT
|
||||
rm testout_422_ifast_opt.jpg
|
||||
else
|
||||
md5/md5cmp $(MD5_PPM_FLOAT_NOSIMD) testoutflt.ppm
|
||||
# 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
|
||||
# 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
|
||||
endif
|
||||
./djpeg -dct int -nosmooth -scale 2/1 -ppm -outfile testoutint2_1.ppm $(srcdir)/testimages/testorig.jpg;
|
||||
md5/md5cmp $(MD5_PPM_INT_2_1) testoutint2_1.ppm;
|
||||
./djpeg -dct int -nosmooth -scale 15/8 -ppm -outfile testoutint15_8.ppm $(srcdir)/testimages/testorig.jpg;
|
||||
md5/md5cmp $(MD5_PPM_INT_15_8) testoutint15_8.ppm;
|
||||
./djpeg -dct int -nosmooth -scale 7/4 -ppm -outfile testoutint7_4.ppm $(srcdir)/testimages/testorig.jpg;
|
||||
md5/md5cmp $(MD5_PPM_INT_7_4) testoutint7_4.ppm;
|
||||
./djpeg -dct int -nosmooth -scale 13/8 -ppm -outfile testoutint13_8.ppm $(srcdir)/testimages/testorig.jpg;
|
||||
md5/md5cmp $(MD5_PPM_INT_13_8) testoutint13_8.ppm;
|
||||
./djpeg -dct int -nosmooth -scale 3/2 -ppm -outfile testoutint3_2.ppm $(srcdir)/testimages/testorig.jpg;
|
||||
md5/md5cmp $(MD5_PPM_INT_3_2) testoutint3_2.ppm;
|
||||
./djpeg -dct int -nosmooth -scale 11/8 -ppm -outfile testoutint11_8.ppm $(srcdir)/testimages/testorig.jpg;
|
||||
md5/md5cmp $(MD5_PPM_INT_11_8) testoutint11_8.ppm;
|
||||
./djpeg -dct int -nosmooth -scale 5/4 -ppm -outfile testoutint5_4.ppm $(srcdir)/testimages/testorig.jpg;
|
||||
md5/md5cmp $(MD5_PPM_INT_5_4) testoutint5_4.ppm;
|
||||
./djpeg -dct int -nosmooth -scale 9/8 -ppm -outfile testoutint9_8.ppm $(srcdir)/testimages/testorig.jpg;
|
||||
md5/md5cmp $(MD5_PPM_INT_9_8) testoutint9_8.ppm;
|
||||
./djpeg -dct int -nosmooth -scale 7/8 -ppm -outfile testoutint7_8.ppm $(srcdir)/testimages/testorig.jpg;
|
||||
md5/md5cmp $(MD5_PPM_INT_7_8) testoutint7_8.ppm;
|
||||
./djpeg -dct int -nosmooth -scale 3/4 -ppm -outfile testoutint3_4.ppm $(srcdir)/testimages/testorig.jpg;
|
||||
md5/md5cmp $(MD5_PPM_INT_3_4) testoutint3_4.ppm;
|
||||
./djpeg -dct int -nosmooth -scale 5/8 -ppm -outfile testoutint5_8.ppm $(srcdir)/testimages/testorig.jpg;
|
||||
md5/md5cmp $(MD5_PPM_INT_5_8) testoutint5_8.ppm;
|
||||
./djpeg -dct int -nosmooth -scale 1/2 -ppm -outfile testoutint1_2.ppm $(srcdir)/testimages/testorig.jpg;
|
||||
md5/md5cmp $(MD5_PPM_INT_1_2) testoutint1_2.ppm;
|
||||
./djpeg -dct int -nosmooth -scale 3/8 -ppm -outfile testoutint3_8.ppm $(srcdir)/testimages/testorig.jpg;
|
||||
md5/md5cmp $(MD5_PPM_INT_3_8) testoutint3_8.ppm;
|
||||
./djpeg -dct int -nosmooth -scale 1/4 -ppm -outfile testoutint1_4.ppm $(srcdir)/testimages/testorig.jpg;
|
||||
md5/md5cmp $(MD5_PPM_INT_1_4) testoutint1_4.ppm;
|
||||
./djpeg -dct int -nosmooth -scale 1/8 -ppm -outfile testoutint1_8.ppm $(srcdir)/testimages/testorig.jpg;
|
||||
md5/md5cmp $(MD5_PPM_INT_1_8) testoutint1_8.ppm;
|
||||
./djpeg -dct fast -scale 1/2 -ppm -outfile testoutfst1_2.ppm $(srcdir)/testimages/testorig.jpg
|
||||
md5/md5cmp $(MD5_PPM_FAST_1_2) testoutfst1_2.ppm
|
||||
./djpeg -dct int -bmp -colors 256 -outfile testout.bmp $(srcdir)/testimages/testorig.jpg
|
||||
md5/md5cmp $(MD5_BMP_256) testout.bmp
|
||||
|
||||
# CC: RGB->YCC SAMP: fullsize/h2v2 FDCT: ifast ENT: prog huff
|
||||
./cjpeg -revert -sample 2x2 -quality 100 -dct fast -prog -outfile testout_420_q100_ifast_prog.jpg $(srcdir)/testimages/testorig.ppm
|
||||
md5/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
|
||||
./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
|
||||
# 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
|
||||
|
||||
# CC: RGB->Gray SAMP: fullsize FDCT: islow ENT: huff
|
||||
./cjpeg -revert -gray -dct int -outfile testout_gray_islow.jpg $(srcdir)/testimages/testorig.ppm
|
||||
md5/md5cmp $(MD5_JPEG_GRAY_ISLOW) testout_gray_islow.jpg
|
||||
# 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
|
||||
# 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
|
||||
if WITH_12BIT
|
||||
rm 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
|
||||
# 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
|
||||
endif
|
||||
|
||||
# CC: RGB->YCC SAMP: fullsize smooth/h2v2 smooth FDCT: islow
|
||||
# ENT: 2-pass huff
|
||||
./cjpeg -revert -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
|
||||
|
||||
# CC: RGB->YCC SAMP: fullsize/int FDCT: float ENT: prog huff
|
||||
./cjpeg -revert -sample 3x2 -dct float -prog -outfile testout_3x2_float_prog.jpg $(srcdir)/testimages/testorig.ppm
|
||||
md5/md5cmp $(MD5_JPEG_3x2_FLOAT_PROG) testout_3x2_float_prog.jpg
|
||||
# CC: YCC->RGB SAMP: fullsize/int IDCT: float ENT: prog huff
|
||||
./djpeg -dct float -outfile testout_3x2_float.ppm testout_3x2_float_prog.jpg
|
||||
md5/md5cmp $(MD5_PPM_3x2_FLOAT) testout_3x2_float.ppm
|
||||
rm testout_3x2_float.ppm testout_3x2_float_prog.jpg
|
||||
|
||||
if WITH_ARITH_ENC
|
||||
./cjpeg -dct int -arithmetic -outfile testoutari.jpg $(srcdir)/testimages/testorig.ppm
|
||||
md5/md5cmp $(MD5_JPEG_ARI) testoutari.jpg
|
||||
./jpegtran -arithmetic -outfile testouta.jpg $(srcdir)/testimages/testimgint.jpg
|
||||
md5/md5cmp $(MD5_JPEG_ARI) testouta.jpg
|
||||
./cjpeg -dct int -progressive -arithmetic -sample 1x1 -outfile testoutpa.jpg $(srcdir)/testimages/testorig.ppm
|
||||
md5/md5cmp $(MD5_JPEG_PROG_ARI) testoutpa.jpg
|
||||
# CC: YCC->RGB SAMP: fullsize/h2v2 FDCT: islow ENT: arith
|
||||
./cjpeg -revert -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
|
||||
./jpegtran -revert -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
|
||||
# CC: YCC->RGB SAMP: fullsize FDCT: islow ENT: prog arith
|
||||
./cjpeg -revert -sample 1x1 -dct int -progressive -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
|
||||
endif
|
||||
if WITH_ARITH_DEC
|
||||
./djpeg -dct int -fast -ppm -outfile testoutari.ppm $(srcdir)/testimages/testimgari.jpg
|
||||
md5/md5cmp $(MD5_PPM_ARI) testoutari.ppm
|
||||
./jpegtran -outfile testouta.jpg $(srcdir)/testimages/testimgari.jpg
|
||||
md5/md5cmp $(MD5_JPEG_INT) testouta.jpg
|
||||
# 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
|
||||
./jpegtran -revert -outfile testout_420_islow.jpg $(srcdir)/testimages/testimgari.jpg
|
||||
md5/md5cmp $(MD5_JPEG_420_ISLOW) testout_420_islow.jpg
|
||||
rm testout_420_islow.jpg
|
||||
endif
|
||||
./cjpeg -dct int -progressive -outfile testoutp.jpg $(srcdir)/testimages/testorig.ppm
|
||||
md5/md5cmp $(MD5_JPEG_PROG) testoutp.jpg
|
||||
./jpegtran -outfile testoutt.jpg testoutp.jpg
|
||||
md5/md5cmp $(MD5_JPEG_INT) testoutt.jpg
|
||||
./jpegtran -crop 120x90+20+50 -transpose -perfect -outfile testoutcrop.jpg $(srcdir)/testimages/testorig.jpg
|
||||
md5/md5cmp $(MD5_JPEG_CROP) testoutcrop.jpg
|
||||
|
||||
# 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
|
||||
# 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
|
||||
# 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
|
||||
# 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
|
||||
# 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
|
||||
# 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
|
||||
# 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
|
||||
# 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
|
||||
# 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
|
||||
# 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
|
||||
# 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
|
||||
# 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
|
||||
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
|
||||
# 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
|
||||
# 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
|
||||
# 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
|
||||
# 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
|
||||
endif
|
||||
|
||||
./jpegtran -revert -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
|
||||
|
||||
|
||||
testclean:
|
||||
@@ -335,31 +533,35 @@ testclean:
|
||||
|
||||
tjtest:
|
||||
sh ./tjbenchtest
|
||||
sh ./tjbenchtest -alloc
|
||||
sh ./tjbenchtest -yuv
|
||||
sh ./tjbenchtest -yuv -alloc
|
||||
if WITH_JAVA
|
||||
sh ./tjbenchtest.java
|
||||
sh ./tjbenchtest.java -yuv
|
||||
endif
|
||||
|
||||
|
||||
pkgscripts/libmozjpeg.spec: pkgscripts/libmozjpeg.spec.tmpl
|
||||
cat pkgscripts/libmozjpeg.spec.tmpl | sed s@%{__prefix}@$(prefix)@g | \
|
||||
pkgscripts/mozjpeg.spec: pkgscripts/mozjpeg.spec.tmpl
|
||||
cat pkgscripts/mozjpeg.spec.tmpl | sed s@%{__prefix}@$(prefix)@g | \
|
||||
sed s@%{__bindir}@$(bindir)@g | sed s@%{__datadir}@$(datadir)@g | \
|
||||
sed s@%{__docdir}@$(docdir)@g | sed s@%{__includedir}@$(includedir)@g | \
|
||||
sed s@%{__libdir}@$(libdir)@g | sed s@%{__mandir}@$(mandir)@g \
|
||||
> pkgscripts/libmozjpeg.spec
|
||||
> pkgscripts/mozjpeg.spec
|
||||
|
||||
rpm: all pkgscripts/libmozjpeg.spec
|
||||
rpm: all pkgscripts/mozjpeg.spec
|
||||
TMPDIR=`mktemp -d /tmp/${PACKAGE_NAME}-build.XXXXXX`; \
|
||||
mkdir -p $$TMPDIR/RPMS; \
|
||||
ln -fs `pwd` $$TMPDIR/BUILD; \
|
||||
rm -f ${PKGNAME}-${VERSION}.${RPMARCH}.rpm; \
|
||||
rpmbuild -bb --define "_blddir $$TMPDIR/buildroot" \
|
||||
--define "_topdir $$TMPDIR" \
|
||||
--target ${RPMARCH} pkgscripts/libmozjpeg.spec; \
|
||||
--target ${RPMARCH} pkgscripts/mozjpeg.spec; \
|
||||
cp $$TMPDIR/RPMS/${RPMARCH}/${PKGNAME}-${VERSION}-${BUILD}.${RPMARCH}.rpm \
|
||||
${PKGNAME}-${VERSION}.${RPMARCH}.rpm; \
|
||||
rm -rf $$TMPDIR
|
||||
|
||||
srpm: dist-gzip pkgscripts/libmozjpeg.spec
|
||||
srpm: dist-gzip pkgscripts/mozjpeg.spec
|
||||
TMPDIR=`mktemp -d /tmp/${PACKAGE_NAME}-build.XXXXXX`; \
|
||||
mkdir -p $$TMPDIR/RPMS; \
|
||||
mkdir -p $$TMPDIR/SRPMS; \
|
||||
@@ -368,10 +570,10 @@ srpm: dist-gzip pkgscripts/libmozjpeg.spec
|
||||
mkdir -p $$TMPDIR/SPECS; \
|
||||
rm -f ${PKGNAME}-${VERSION}.src.rpm; \
|
||||
cp ${PACKAGE_NAME}-${VERSION}.tar.gz $$TMPDIR/SOURCES; \
|
||||
cat pkgscripts/libmozjpeg.spec | sed s/%{_blddir}/%{_tmppath}/g \
|
||||
cat pkgscripts/mozjpeg.spec | sed s/%{_blddir}/%{_tmppath}/g \
|
||||
| sed s/#--\>//g \
|
||||
> $$TMPDIR/SPECS/libmozjpeg.spec; \
|
||||
rpmbuild -bs --define "_topdir $$TMPDIR" $$TMPDIR/SPECS/libmozjpeg.spec; \
|
||||
> $$TMPDIR/SPECS/mozjpeg.spec; \
|
||||
rpmbuild -bs --define "_topdir $$TMPDIR" $$TMPDIR/SPECS/mozjpeg.spec; \
|
||||
cp $$TMPDIR/SRPMS/${PKGNAME}-${VERSION}-${BUILD}.src.rpm \
|
||||
${PKGNAME}-${VERSION}.src.rpm; \
|
||||
rm -rf $$TMPDIR
|
||||
@@ -401,12 +603,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}
|
||||
sh pkgscripts/makemacpkg -build32 ${BUILDDIR32} -buildarmv6 ${BUILDDIRARMV6} -buildarmv7 ${BUILDDIRARMV7} -buildarmv7s ${BUILDDIRARMV7S} -buildarmv8 ${BUILDDIRARMV8} -lipo "${LIPO}"
|
||||
|
||||
else
|
||||
|
||||
iosdmg: all pkgscripts/makemacpkg pkgscripts/uninstall
|
||||
sh pkgscripts/makemacpkg -buildarmv6 ${BUILDDIRARMV6} -buildarmv7 ${BUILDDIRARMV7} -buildarmv7s ${BUILDDIRARMV7S}
|
||||
sh pkgscripts/makemacpkg -buildarmv6 ${BUILDDIRARMV6} -buildarmv7 ${BUILDDIRARMV7} -buildarmv7s ${BUILDDIRARMV7S} -buildarmv8 ${BUILDDIRARMV8} -lipo "${LIPO}"
|
||||
|
||||
endif
|
||||
|
||||
|
||||
9
README
9
README
@@ -36,7 +36,6 @@ TO DO Plans for future IJG releases.
|
||||
Other documentation files in the distribution are:
|
||||
|
||||
User documentation:
|
||||
install.txt How to configure and install the IJG software.
|
||||
usage.txt Usage instructions for cjpeg, djpeg, jpegtran,
|
||||
rdjpgcom, and wrjpgcom.
|
||||
*.1 Unix-style man pages for programs (same info as usage.txt).
|
||||
@@ -48,9 +47,9 @@ Programmer and internal documentation:
|
||||
structure.txt Overview of the JPEG library's internal structure.
|
||||
coderules.txt Coding style rules --- please read if you contribute code.
|
||||
|
||||
Please read at least the files install.txt and usage.txt. Some information
|
||||
can also be found in the JPEG FAQ (Frequently Asked Questions) article. See
|
||||
ARCHIVE LOCATIONS below to find out where to obtain the FAQ article.
|
||||
Please read at least usage.txt. Some information can also be found in the JPEG
|
||||
FAQ (Frequently Asked Questions) article. See ARCHIVE LOCATIONS below to find
|
||||
out where to obtain the FAQ article.
|
||||
|
||||
If you want to understand how the JPEG code works, we suggest reading one or
|
||||
more of the REFERENCES, then looking at the documentation files (in roughly
|
||||
@@ -62,7 +61,7 @@ OVERVIEW
|
||||
|
||||
This package contains C software to implement JPEG image encoding, decoding,
|
||||
and transcoding. JPEG (pronounced "jay-peg") is a standardized compression
|
||||
method for full-color and gray-scale images. JPEG's strong suit is compressing
|
||||
method for full-color and grayscale images. JPEG's strong suit is compressing
|
||||
photographic images or other types of images that have smooth color and
|
||||
brightness transitions between neighboring pixels. Images with sharp lines or
|
||||
other abrupt features may not compress well with JPEG, and a higher JPEG
|
||||
|
||||
@@ -0,0 +1,194 @@
|
||||
Mozilla JPEG Encoder Project
|
||||
============================
|
||||
|
||||
mozjpeg is a fork of libjpeg-turbo that aims to speed up load times of web
|
||||
pages by reducing the size (and, by extension, the transmission time) of JPEG
|
||||
files. It accomplishes this by enabling optimized Huffman trees and
|
||||
progressive entropy coding by default in the JPEG compressor, as well as
|
||||
splitting the spectrum of DCT coefficients into separate scans and using
|
||||
Trellis quantisation.
|
||||
|
||||
Although it is based on libjpeg-turbo, mozjpeg is not intended to be a
|
||||
general-purpose or high-performance JPEG library. Its performance is highly
|
||||
"asymmetric". That is, the JPEG files it generates require much more time to
|
||||
compress than to decompress. When the default settings are used, mozjpeg is
|
||||
considerably slower than libjpeg-turbo or even libjpeg at compressing images.
|
||||
Thus, it is not generally suitable for real-time compression. It is best used
|
||||
as part of a web encoding workflow.
|
||||
|
||||
|
||||
libjpeg API Extensibility Framework
|
||||
===================================
|
||||
|
||||
mozjpeg's implementation of the libjpeg API includes an extensibility framework
|
||||
that allows new features to be added without modifying the transparent libjpeg
|
||||
compress/decompress structures (which would break backward ABI compatibility.)
|
||||
Extension parameters are placed into the opaque jpeg_comp_master structure, and
|
||||
a set of accessor functions and globally unique tokens allows for
|
||||
getting/setting those parameters without directly accessing the structure.
|
||||
|
||||
Currently, only the accessor functions necessary to support the mozjpeg
|
||||
extensions are implemented, but the framework can be easily extended in the
|
||||
future to accommodate additional simple parameter types, complex or
|
||||
multi-valued parameters, or decompressor extensions.
|
||||
|
||||
|
||||
The currently-implemented accessor functions are as follows:
|
||||
|
||||
boolean jpeg_c_bool_param_supported (j_compress_ptr cinfo,
|
||||
J_BOOLEAN_PARAM param)
|
||||
Returns TRUE if the given boolean extension parameter is supported by
|
||||
this implementation of the libjpeg API, or FALSE otherwise.
|
||||
|
||||
void jpeg_c_set_bool_param (j_compress_ptr cinfo,
|
||||
J_BOOLEAN_PARAM param, boolean value);
|
||||
Set the given boolean extension parameter to the given value (TRUE or
|
||||
FALSE.)
|
||||
|
||||
boolean jpeg_c_get_bool_param (j_compress_ptr cinfo, J_BOOLEAN_PARAM param)
|
||||
Get the value of the given boolean extension parameter (TRUE or FALSE.)
|
||||
|
||||
boolean jpeg_c_float_param_supported (j_compress_ptr cinfo,
|
||||
J_FLOAT_PARAM param)
|
||||
Returns TRUE if the given floating point extension parameter is
|
||||
supported by this implementation of the libjpeg API, or FALSE
|
||||
otherwise.
|
||||
|
||||
void jpeg_c_set_float_param (j_compress_ptr cinfo, J_FLOAT_PARAM param,
|
||||
float value)
|
||||
Set the given floating point extension parameter to the given value.
|
||||
|
||||
float jpeg_c_get_float_param (j_compress_ptr cinfo, J_FLOAT_PARAM param);
|
||||
Get the value of the given floating point extension parameter.
|
||||
|
||||
boolean jpeg_c_int_param_supported (j_compress_ptr cinfo,
|
||||
J_INT_PARAM param)
|
||||
Returns TRUE if the given integer extension parameter is supported by
|
||||
this implementation of the libjpeg API, or FALSE otherwise.
|
||||
|
||||
void jpeg_c_set_int_param (j_compress_ptr cinfo, J_INT_PARAM param,
|
||||
int value)
|
||||
Set the given integer extension parameter to the given value.
|
||||
|
||||
int jpeg_c_get_int_param (j_compress_ptr cinfo, J_INT_PARAM param)
|
||||
Get the value of the given integer extension parameter.
|
||||
|
||||
|
||||
Boolean Extension Parameters Supported by mozjpeg
|
||||
-------------------------------------------------
|
||||
|
||||
* JBOOLEAN_OPTIMIZE_SCANS (default: TRUE)
|
||||
Specifies whether scan parameters should be optimized. Parameter
|
||||
optimization is done as in jpgcrush. jpeg_simple_progression() should be called
|
||||
after setting JBOOLEAN_OPTIMIZE_SCANS.
|
||||
When disabling JBOOLEAN_OPTIMIZE_SCANS, cinfo.scan_info should additionally be
|
||||
set to NULL to disable use of the progressive coding mode, if so desired.
|
||||
|
||||
* JBOOLEAN_TRELLIS_QUANT (default: TRUE)
|
||||
Specifies whether to apply trellis quantization. For each 8x8 block, trellis
|
||||
quantization determines the best tradeoff between rate and distortion.
|
||||
|
||||
* JBOOLEAN_TRELLIS_QUANT_DC (default: TRUE)
|
||||
Specifies whether to apply trellis quantization to DC coefficients.
|
||||
|
||||
* JBOOLEAN_TRELLIS_EOB_OPT (default: FALSE)
|
||||
Specifies whether to optimize runs of zero blocks in trellis quantization.
|
||||
This is applicable only when JBOOLEAN_USE_SCANS_IN_TRELLIS is enabled.
|
||||
|
||||
* JBOOLEAN_USE_LAMBDA_WEIGHT_TBL currently has no effect.
|
||||
|
||||
* JBOOLEAN_USE_SCANS_IN_TRELLIS (default: FALSE)
|
||||
Specifies whether multiple scans should be considered during trellis
|
||||
quantization.
|
||||
|
||||
* JBOOLEAN_TRELLIS_Q_OPT (default: FALSE)
|
||||
Specifies whether to optimize the quantization table after trellis
|
||||
quantization. If enabled, then a revised quantization table is derived so
|
||||
as to minimize the reconstruction error of the quantized coefficients.
|
||||
|
||||
* JBOOLEAN_OVERSHOOT_DERINGING (default: TRUE)
|
||||
Specifies whether overshooting is applied to samples with extreme values
|
||||
(for example, 0 and 255 for 8-bit samples). Overshooting may reduce ringing
|
||||
artifacts from compression, in particular in areas where black text appears
|
||||
on a white background.
|
||||
|
||||
|
||||
Floating Point Extension Parameters Supported by mozjpeg
|
||||
--------------------------------------------------------
|
||||
|
||||
* JFLOAT_LAMBDA_LOG_SCALE1 (default: 14.75)
|
||||
JFLOAT_LAMBDA_LOG_SCALE2 (default: 16.5)
|
||||
These parameters specify the lambda value used in trellis quantization. The
|
||||
lambda value (Lagrange multiplier) in the
|
||||
R + lambda * D
|
||||
equation is derived from
|
||||
lambda = 2^s1 / ((2^s2 + n) * q^2),
|
||||
where s1 and s2 are the values of JFLOAT_LAMBDA_LOG_SCALE1 and
|
||||
JFLOAT_LAMBDA_LOG_SCALE2, n is the average of the squared unquantized AC
|
||||
coefficients within the current 8x8 block, and q is the quantization table
|
||||
entry associated with the current coefficient frequency. If
|
||||
JFLOAT_LAMBDA_LOG_SCALE2 is 0, then an alternate form is used that does not
|
||||
rely on n:
|
||||
lambda = 2^(s1-12) / q^2.
|
||||
|
||||
* JFLOAT_TRELLIS_DELTA_DC_WEIGHT (default: 0.0)
|
||||
This parameter controls how distortion is calculated in DC trellis quantization
|
||||
(enabled with JBOOLEAN_TRELLIS_QUANT_DC). It defines weighting between distortion
|
||||
of the DC coefficient and distortion of the vertical gradient of DC coefficients.
|
||||
The value of the parameter corresponds to the weight applied to the distortion
|
||||
of the vertical gradient.
|
||||
|
||||
|
||||
Integer Extension Parameters Supported by mozjpeg
|
||||
-------------------------------------------------
|
||||
|
||||
* JINT_COMPRESS_PROFILE (default: JCP_MAX_COMPRESSION)
|
||||
Select a compression profile, which is a set of default parameters that will
|
||||
achieve a desired compression goal. This parameter controls the behavior of
|
||||
the jpeg_set_defaults() function. Thus, setting JINT_COMPRESS_PROFILE does
|
||||
not cause any other parameters to be modified until jpeg_set_defaults() is
|
||||
called. The following compression profiles are supported:
|
||||
|
||||
- JCP_MAX_COMPRESSION (default)
|
||||
Increase the compression ratio as much as possible, at the expense of
|
||||
increased encoding time. This enables progressive entropy coding and all
|
||||
mozjpeg extensions.
|
||||
|
||||
- JCP_FASTEST
|
||||
Use the libjpeg[-turbo] defaults (baseline entropy coding, no mozjpeg
|
||||
extensions enabled.)
|
||||
|
||||
* JINT_TRELLIS_FREQ_SPLIT (default: 8)
|
||||
Specifies the position within the zigzag scan at which the split between
|
||||
scans is positioned in the context of trellis quantization.
|
||||
JBOOLEAN_USE_SCANS_IN_TRELLIS must be enabled for this parameter to have any
|
||||
effect.
|
||||
|
||||
* JINT_TRELLIS_NUM_LOOPS (default: 1)
|
||||
Specifies the number of trellis quantization passes. Huffman tables are
|
||||
updated between passes.
|
||||
|
||||
* JINT_BASE_QUANT_TBL_IDX (default: 3)
|
||||
Specifies which quantization table set to use. The following options are
|
||||
available:
|
||||
0 = Tables from JPEG Annex K
|
||||
1 = Flat table
|
||||
2 = Table tuned for MSSIM on Kodak image set
|
||||
3 = Table from http://www.imagemagick.org/discourse-server/viewtopic.php?f=22&t=20333&p=98008#p98008
|
||||
4 = Table tuned for PSNR-HVS-M on Kodak image set
|
||||
5 = Table from: Relevance of Human Vision to JPEG-DCT Compression
|
||||
(1992) Klein, Silverstein and Carney
|
||||
6 = Table from: DCTune Perceptual Optimization of Compressed Dental X-Rays
|
||||
(1997) Watson, Taylor, Borthwick
|
||||
7 = Table from: A Visual Detection Model for DCT Coefficient Quantization
|
||||
(12/9/93) Ahumada, Watson, Peterson
|
||||
8 = Table from: An Improved Detection Model for DCT Coefficient Quantization
|
||||
(1993) Peterson, Ahumada and Watson
|
||||
|
||||
* JINT_DC_SCAN_OPT_MODE (default: 1)
|
||||
Specifies the DC scan optimization mode. The following options are
|
||||
available:
|
||||
0 = One scan for all components
|
||||
1 = One scan per component
|
||||
2 = Optimize between one scan for all components and one scan for the first
|
||||
component plus one scan for the remaining components
|
||||
|
||||
162
README-turbo.txt
Executable file → Normal file
162
README-turbo.txt
Executable file → Normal file
@@ -81,131 +81,6 @@ JPEG images:
|
||||
There is no significant performance advantage to either API when both are used
|
||||
to perform similar operations.
|
||||
|
||||
======================
|
||||
Installation Directory
|
||||
======================
|
||||
|
||||
This document assumes that libjpeg-turbo will be installed in the default
|
||||
directory (/opt/libjpeg-turbo on Un*x and Mac systems and
|
||||
c:\libjpeg-turbo[-gcc][64] on Windows systems. If your installation of
|
||||
libjpeg-turbo resides in a different directory, then adjust the instructions
|
||||
accordingly.
|
||||
|
||||
=============================
|
||||
Replacing libjpeg at Run Time
|
||||
=============================
|
||||
|
||||
Un*x
|
||||
----
|
||||
|
||||
If a Un*x application is dynamically linked with libjpeg, then you can replace
|
||||
libjpeg with libjpeg-turbo at run time by manipulating LD_LIBRARY_PATH.
|
||||
For instance:
|
||||
|
||||
[Using libjpeg]
|
||||
> time cjpeg <vgl_5674_0098.ppm >vgl_5674_0098.jpg
|
||||
real 0m0.392s
|
||||
user 0m0.074s
|
||||
sys 0m0.020s
|
||||
|
||||
[Using libjpeg-turbo]
|
||||
> export LD_LIBRARY_PATH=/opt/libjpeg-turbo/{lib}:$LD_LIBRARY_PATH
|
||||
> time cjpeg <vgl_5674_0098.ppm >vgl_5674_0098.jpg
|
||||
real 0m0.109s
|
||||
user 0m0.029s
|
||||
sys 0m0.010s
|
||||
|
||||
({lib} = lib32 or lib64, depending on whether you wish to use the 32-bit or the
|
||||
64-bit version of libjpeg-turbo.)
|
||||
|
||||
System administrators can also replace the libjpeg symlinks in /usr/lib* with
|
||||
links to the libjpeg-turbo dynamic library located in /opt/libjpeg-turbo/{lib}.
|
||||
This will effectively accelerate every application that uses the libjpeg
|
||||
dynamic library on the system.
|
||||
|
||||
Windows
|
||||
-------
|
||||
|
||||
If a Windows application is dynamically linked with libjpeg, then you can
|
||||
replace libjpeg with libjpeg-turbo at run time by backing up the application's
|
||||
copy of jpeg62.dll, jpeg7.dll, or jpeg8.dll (assuming the application has its
|
||||
own local copy of this library) and copying the corresponding DLL from
|
||||
libjpeg-turbo into the application's install directory. The official
|
||||
libjpeg-turbo binary packages only provide jpeg62.dll. If the application uses
|
||||
jpeg7.dll or jpeg8.dll instead, then it will be necessary to build
|
||||
libjpeg-turbo from source (see "libjpeg v7 and v8 API/ABI Emulation" below.)
|
||||
|
||||
The following information is specific to the official libjpeg-turbo binary
|
||||
packages for Visual C++:
|
||||
|
||||
-- jpeg62.dll requires the Visual C++ 2008 C run-time DLL (msvcr90.dll).
|
||||
msvcr90.dll ships with more recent versions of Windows, but users of older
|
||||
Windows releases can obtain it from the Visual C++ 2008 Redistributable
|
||||
Package, which is available as a free download from Microsoft's web site.
|
||||
|
||||
-- Features of the libjpeg API that require passing a C run-time structure,
|
||||
such as a file handle, from an application to the library will probably not
|
||||
work with jpeg62.dll, unless the application is also built to use the Visual
|
||||
C++ 2008 C run-time DLL. In particular, this affects jpeg_stdio_dest() and
|
||||
jpeg_stdio_src().
|
||||
|
||||
Mac
|
||||
---
|
||||
|
||||
Mac applications typically embed their own copies of the libjpeg dylib inside
|
||||
the (hidden) application bundle, so it is not possible to globally replace
|
||||
libjpeg on OS X systems. Replacing the application's version of the libjpeg
|
||||
dylib would generally involve copying libjpeg.*.dylib from libjpeg-turbo into
|
||||
the appropriate place in the application bundle and using install_name_tool to
|
||||
repoint the libjpeg-turbo dylib to its new directory. This requires an
|
||||
advanced knowledge of OS X and would not survive an upgrade or a re-install of
|
||||
the application. Thus, it is not recommended for most users.
|
||||
|
||||
========================================
|
||||
Using libjpeg-turbo in Your Own Programs
|
||||
========================================
|
||||
|
||||
For the most part, libjpeg-turbo should work identically to libjpeg, so in
|
||||
most cases, an application can be built against libjpeg and then run against
|
||||
libjpeg-turbo. On Un*x systems and Cygwin, you can build against libjpeg-turbo
|
||||
instead of libjpeg by setting
|
||||
|
||||
CPATH=/opt/libjpeg-turbo/include
|
||||
and
|
||||
LIBRARY_PATH=/opt/libjpeg-turbo/{lib}
|
||||
|
||||
({lib} = lib32 or lib64, depending on whether you are building a 32-bit or a
|
||||
64-bit application.)
|
||||
|
||||
If using MinGW, then set
|
||||
|
||||
CPATH=/c/libjpeg-turbo-gcc[64]/include
|
||||
and
|
||||
LIBRARY_PATH=/c/libjpeg-turbo-gcc[64]/lib
|
||||
|
||||
Building against libjpeg-turbo is useful, for instance, if you want to build an
|
||||
application that leverages the libjpeg-turbo colorspace extensions (see below.)
|
||||
On Un*x systems, you would still need to manipulate LD_LIBRARY_PATH or create
|
||||
appropriate symlinks to use libjpeg-turbo at run time. On such systems, you
|
||||
can pass -R /opt/libjpeg-turbo/{lib} to the linker to force the use of
|
||||
libjpeg-turbo at run time rather than libjpeg (also useful if you want to
|
||||
leverage the colorspace extensions), or you can link against the libjpeg-turbo
|
||||
static library.
|
||||
|
||||
To force a Un*x or MinGW application to link against the static version of
|
||||
libjpeg-turbo, you can use the following linker options:
|
||||
|
||||
-Wl,-Bstatic -ljpeg -Wl,-Bdynamic
|
||||
|
||||
On OS X, simply add /opt/libjpeg-turbo/lib/libjpeg.a to the linker command
|
||||
line.
|
||||
|
||||
To build Visual C++ applications using libjpeg-turbo, add
|
||||
c:\libjpeg-turbo[64]\include to the system or user INCLUDE environment
|
||||
variable and c:\libjpeg-turbo[64]\lib to the system or user LIB environment
|
||||
variable, and then link against either jpeg.lib (to use the DLL version of
|
||||
libjpeg-turbo) or jpeg-static.lib (to use the static version of libjpeg-turbo.)
|
||||
|
||||
=====================
|
||||
Colorspace Extensions
|
||||
=====================
|
||||
@@ -265,7 +140,7 @@ 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 still not
|
||||
based on the libjpeg v6b code base. Although libjpeg v7 and v8 are not
|
||||
as widely used as v6b, enough programs (including a few Linux distros) made
|
||||
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
|
||||
@@ -419,10 +294,25 @@ details.
|
||||
|
||||
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 are not guaranteed to
|
||||
be identical (the accuracy of the floating point DCT/IDCT is constant when
|
||||
using libjpeg-turbo's SIMD extensions, but otherwise, it can depend heavily on
|
||||
the compiler and compiler settings.)
|
||||
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.)
|
||||
-- When not using the SIMD extensions, then the accuracy of the floating point
|
||||
DCT/IDCT can depend on the compiler and 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
|
||||
@@ -430,16 +320,14 @@ 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 a bit differently than libjpeg v6b does,
|
||||
and libjpeg-turbo's SIMD extensions are based on the libjpeg v6b behavior.
|
||||
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.
|
||||
|
||||
-- When using the floating point IDCT, for the reasons stated above and also
|
||||
because the floating point IDCT algorithm was modified in libjpeg v8a to
|
||||
improve accuracy.
|
||||
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
|
||||
|
||||
@@ -7,6 +7,9 @@ The idea is to reduce transfer times for JPEGs on the Web, thus reducing page lo
|
||||
|
||||
'mozjpeg' is not intended to be a general JPEG library replacement. It makes tradeoffs that are intended to benefit Web use cases and focuses solely on improving encoding. It is best used as part of a Web encoding workflow. For a general JPEG library (e.g. your system libjpeg), especially if you care about decoding, we recommend libjpeg-turbo.
|
||||
|
||||
For more information, see the project announcement:
|
||||
More information:
|
||||
|
||||
https://blog.mozilla.org/research/2014/03/05/introducing-the-mozjpeg-project/
|
||||
* [Mailing List](https://lists.mozilla.org/listinfo/dev-mozjpeg)</a>
|
||||
* [Version 3.0 Announcement](https://boomswaggerboom.wordpress.com/2014/12/30/mozjpeg-3-0-released/)
|
||||
* [Version 2.0 Announcement](https://blog.mozilla.org/research/2014/07/15/mozilla-advances-jpeg-encoding-with-mozjpeg-2-0/)
|
||||
* [Version 1.0 Announcement](https://blog.mozilla.org/research/2014/03/05/introducing-the-mozjpeg-project/)
|
||||
|
||||
37
acinclude.m4
37
acinclude.m4
@@ -184,7 +184,7 @@ AC_DEFUN([AC_CHECK_COMPATIBLE_ARM_ASSEMBLER_IFELSE],[
|
||||
# AC_CHECK_COMPATIBLE_MIPSEL_ASSEMBLER_IFELSE
|
||||
# --------------------------
|
||||
# Test whether the assembler is suitable and supports MIPS instructions
|
||||
AC_DEFUN([AC_CHECK_COMPATIBLE_MIPSEL_ASSEMBLER_IFELSE],[
|
||||
AC_DEFUN([AC_CHECK_COMPATIBLE_MIPS_ASSEMBLER_IFELSE],[
|
||||
have_mips_dspr2=no
|
||||
ac_save_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$CCASFLAGS -mdspr2"
|
||||
@@ -210,3 +210,38 @@ AC_DEFUN([AC_CHECK_COMPATIBLE_MIPSEL_ASSEMBLER_IFELSE],[
|
||||
$2
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN([AC_CHECK_COMPATIBLE_ARM64_ASSEMBLER_IFELSE],[
|
||||
ac_good_gnu_arm_assembler=no
|
||||
ac_save_CC="$CC"
|
||||
ac_save_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$CCASFLAGS -x assembler-with-cpp"
|
||||
CC="$CCAS"
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
||||
.text
|
||||
.arch armv8-a+fp+simd
|
||||
movi v0.16b, #100]])], ac_good_gnu_arm_assembler=yes)
|
||||
|
||||
ac_use_gas_preprocessor=no
|
||||
if test "x$ac_good_gnu_arm_assembler" = "xno" ; then
|
||||
CC="gas-preprocessor.pl $CCAS"
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
||||
.text
|
||||
.arch armv8-a+fp+simd
|
||||
movi v0.16b, #100]])], ac_use_gas_preprocessor=yes)
|
||||
fi
|
||||
CFLAGS="$ac_save_CFLAGS"
|
||||
CC="$ac_save_CC"
|
||||
|
||||
if test "x$ac_use_gas_preprocessor" = "xyes" ; then
|
||||
CCAS="gas-preprocessor.pl $CCAS"
|
||||
AC_SUBST([CCAS])
|
||||
ac_good_gnu_arm_assembler=yes
|
||||
fi
|
||||
|
||||
if test "x$ac_good_gnu_arm_assembler" = "xyes" ; then
|
||||
$1
|
||||
else
|
||||
$2
|
||||
fi
|
||||
])
|
||||
|
||||
6
bmp.c
6
bmp.c
@@ -169,7 +169,7 @@ int loadbmp(char *filename, unsigned char **buf, int *w, int *h,
|
||||
nlines);
|
||||
}
|
||||
cinfo.next_scanline+=nlines;
|
||||
}
|
||||
}
|
||||
|
||||
(*src->finish_input)(&cinfo, src);
|
||||
|
||||
@@ -236,7 +236,7 @@ int savebmp(char *filename, unsigned char *buf, int w, int h, int srcpf,
|
||||
_throw("savebmp(): Could not initialize PPM writer");
|
||||
}
|
||||
|
||||
dst->output_file=file;
|
||||
dst->output_file=file;
|
||||
(*dst->start_output)(&dinfo, dst);
|
||||
(*dinfo.mem->realize_virt_arrays)((j_common_ptr)&dinfo);
|
||||
|
||||
@@ -258,7 +258,7 @@ int savebmp(char *filename, unsigned char *buf, int w, int h, int srcpf,
|
||||
}
|
||||
(*dst->put_pixel_rows)(&dinfo, dst, nlines);
|
||||
dinfo.output_scanline+=nlines;
|
||||
}
|
||||
}
|
||||
|
||||
(*dst->finish_output)(&dinfo, dst);
|
||||
|
||||
|
||||
15
cderror.h
15
cderror.h
@@ -33,7 +33,7 @@
|
||||
|
||||
typedef enum {
|
||||
|
||||
#define JMESSAGE(code,string) code ,
|
||||
#define JMESSAGE(code,string) code ,
|
||||
|
||||
#endif /* JMAKE_ENUM_LIST */
|
||||
|
||||
@@ -62,7 +62,7 @@ JMESSAGE(JERR_GIF_IMAGENOTFOUND, "Too few images in GIF file")
|
||||
JMESSAGE(JERR_GIF_NOT, "Not a GIF file")
|
||||
JMESSAGE(JTRC_GIF, "%ux%ux%d GIF image")
|
||||
JMESSAGE(JTRC_GIF_BADVERSION,
|
||||
"Warning: unexpected GIF version number '%c%c%c'")
|
||||
"Warning: unexpected GIF version number '%c%c%c'")
|
||||
JMESSAGE(JTRC_GIF_EXTENSION, "Ignoring GIF extension block of type 0x%02x")
|
||||
JMESSAGE(JTRC_GIF_NONSQUARE, "Caution: nonsquare pixels in input")
|
||||
JMESSAGE(JWRN_GIF_BADDATA, "Corrupt data in GIF file")
|
||||
@@ -74,6 +74,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")
|
||||
@@ -110,18 +111,22 @@ JMESSAGE(JERR_TGA_NOTCOMP, "Targa support was not compiled")
|
||||
#endif /* TARGA_SUPPORTED */
|
||||
|
||||
JMESSAGE(JERR_BAD_CMAP_FILE,
|
||||
"Color map file is invalid or of unsupported format")
|
||||
"Color map file is invalid or of unsupported format")
|
||||
JMESSAGE(JERR_TOO_MANY_COLORS,
|
||||
"Output file format cannot handle %d colormap entries")
|
||||
"Output file format cannot handle %d colormap entries")
|
||||
JMESSAGE(JERR_UNGETC_FAILED, "ungetc failed")
|
||||
#ifdef TARGA_SUPPORTED
|
||||
JMESSAGE(JERR_UNKNOWN_FORMAT,
|
||||
"Unrecognized input file format --- perhaps you need -targa")
|
||||
"Unrecognized input file format --- perhaps you need -targa")
|
||||
#else
|
||||
JMESSAGE(JERR_UNKNOWN_FORMAT, "Unrecognized input file format")
|
||||
#endif
|
||||
JMESSAGE(JERR_UNSUPPORTED_FORMAT, "Unsupported output file format")
|
||||
|
||||
#ifdef PNG_SUPPORTED
|
||||
JMESSAGE(JERR_PNG_ERROR, "Unable to read PNG file: %s")
|
||||
#endif
|
||||
|
||||
#ifdef JMAKE_ENUM_LIST
|
||||
|
||||
JMSG_LASTADDONCODE
|
||||
|
||||
74
cdjpeg.c
74
cdjpeg.c
@@ -1,60 +1,22 @@
|
||||
/*
|
||||
* cdjpeg.c
|
||||
*
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1991-1997, Thomas G. Lane.
|
||||
* This file is part of the Independent JPEG Group's software.
|
||||
* 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.
|
||||
*
|
||||
* This file contains common support routines used by the IJG application
|
||||
* programs (cjpeg, djpeg, jpegtran).
|
||||
*/
|
||||
|
||||
#include "cdjpeg.h" /* Common decls for cjpeg/djpeg applications */
|
||||
#include <ctype.h> /* to declare isupper(), tolower() */
|
||||
#ifdef NEED_SIGNAL_CATCHER
|
||||
#include <signal.h> /* to declare signal() */
|
||||
#endif
|
||||
#include "cdjpeg.h" /* Common decls for cjpeg/djpeg applications */
|
||||
#include <ctype.h> /* to declare isupper(), tolower() */
|
||||
#ifdef USE_SETMODE
|
||||
#include <fcntl.h> /* to declare setmode()'s parameter macros */
|
||||
#include <fcntl.h> /* to declare setmode()'s parameter macros */
|
||||
/* If you have setmode() but not <io.h>, just delete this line: */
|
||||
#include <io.h> /* to declare setmode() */
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Signal catcher to ensure that temporary files are removed before aborting.
|
||||
* NB: for Amiga Manx C this is actually a global routine named _abort();
|
||||
* we put "#define signal_catcher _abort" in jconfig.h. Talk about bogus...
|
||||
*/
|
||||
|
||||
#ifdef NEED_SIGNAL_CATCHER
|
||||
|
||||
static j_common_ptr sig_cinfo;
|
||||
|
||||
void /* must be global for Manx C */
|
||||
signal_catcher (int signum)
|
||||
{
|
||||
if (sig_cinfo != NULL) {
|
||||
if (sig_cinfo->err != NULL) /* turn off trace output */
|
||||
sig_cinfo->err->trace_level = 0;
|
||||
jpeg_destroy(sig_cinfo); /* clean up memory allocation & temp files */
|
||||
}
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
|
||||
GLOBAL(void)
|
||||
enable_signal_catcher (j_common_ptr cinfo)
|
||||
{
|
||||
sig_cinfo = cinfo;
|
||||
#ifdef SIGINT /* not all systems have SIGINT */
|
||||
signal(SIGINT, signal_catcher);
|
||||
#endif
|
||||
#ifdef SIGTERM /* not all systems have SIGTERM */
|
||||
signal(SIGTERM, signal_catcher);
|
||||
#endif
|
||||
}
|
||||
|
||||
#include <io.h> /* to declare setmode() */
|
||||
#endif
|
||||
|
||||
|
||||
@@ -75,8 +37,8 @@ progress_monitor (j_common_ptr cinfo)
|
||||
prog->percent_done = percent_done;
|
||||
if (total_passes > 1) {
|
||||
fprintf(stderr, "\rPass %d/%d: %3d%% ",
|
||||
prog->pub.completed_passes + prog->completed_extra_passes + 1,
|
||||
total_passes, percent_done);
|
||||
prog->pub.completed_passes + prog->completed_extra_passes + 1,
|
||||
total_passes, percent_done);
|
||||
} else {
|
||||
fprintf(stderr, "\r %3d%% ", percent_done);
|
||||
}
|
||||
@@ -126,17 +88,17 @@ keymatch (char * arg, const char * keyword, int minchars)
|
||||
|
||||
while ((ca = *arg++) != '\0') {
|
||||
if ((ck = *keyword++) == '\0')
|
||||
return FALSE; /* arg longer than keyword, no good */
|
||||
if (isupper(ca)) /* force arg to lcase (assume ck is already) */
|
||||
return FALSE; /* arg longer than keyword, no good */
|
||||
if (isupper(ca)) /* force arg to lcase (assume ck is already) */
|
||||
ca = tolower(ca);
|
||||
if (ca != ck)
|
||||
return FALSE; /* no good */
|
||||
nmatched++; /* count matched characters */
|
||||
return FALSE; /* no good */
|
||||
nmatched++; /* count matched characters */
|
||||
}
|
||||
/* reached end of argument; fail if it's too short for unique abbrev */
|
||||
if (nmatched < minchars)
|
||||
return FALSE;
|
||||
return TRUE; /* A-OK */
|
||||
return TRUE; /* A-OK */
|
||||
}
|
||||
|
||||
|
||||
@@ -150,10 +112,10 @@ read_stdin (void)
|
||||
{
|
||||
FILE * input_file = stdin;
|
||||
|
||||
#ifdef USE_SETMODE /* need to hack file mode? */
|
||||
#ifdef USE_SETMODE /* need to hack file mode? */
|
||||
setmode(fileno(stdin), O_BINARY);
|
||||
#endif
|
||||
#ifdef USE_FDOPEN /* need to re-open in binary mode? */
|
||||
#ifdef USE_FDOPEN /* need to re-open in binary mode? */
|
||||
if ((input_file = fdopen(fileno(stdin), READ_BINARY)) == NULL) {
|
||||
fprintf(stderr, "Cannot reopen stdin\n");
|
||||
exit(EXIT_FAILURE);
|
||||
@@ -168,10 +130,10 @@ write_stdout (void)
|
||||
{
|
||||
FILE * output_file = stdout;
|
||||
|
||||
#ifdef USE_SETMODE /* need to hack file mode? */
|
||||
#ifdef USE_SETMODE /* need to hack file mode? */
|
||||
setmode(fileno(stdout), O_BINARY);
|
||||
#endif
|
||||
#ifdef USE_FDOPEN /* need to re-open in binary mode? */
|
||||
#ifdef USE_FDOPEN /* need to re-open in binary mode? */
|
||||
if ((output_file = fdopen(fileno(stdout), WRITE_BINARY)) == NULL) {
|
||||
fprintf(stderr, "Cannot reopen stdout\n");
|
||||
exit(EXIT_FAILURE);
|
||||
|
||||
145
cdjpeg.h
145
cdjpeg.h
@@ -1,8 +1,10 @@
|
||||
/*
|
||||
* cdjpeg.h
|
||||
*
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1994-1997, Thomas G. Lane.
|
||||
* This file is part of the Independent JPEG Group's software.
|
||||
* It was modified by The libjpeg-turbo Project to include only code relevant
|
||||
* to libjpeg-turbo.
|
||||
* mozjpeg Modifications:
|
||||
* Copyright (C) 2014, Mozilla Corporation.
|
||||
* For conditions of distribution and use, see the accompanying README file.
|
||||
@@ -11,12 +13,12 @@
|
||||
* cjpeg and djpeg. It is NOT used by the core JPEG library.
|
||||
*/
|
||||
|
||||
#define JPEG_CJPEG_DJPEG /* define proper options in jconfig.h */
|
||||
#define JPEG_INTERNAL_OPTIONS /* cjpeg.c,djpeg.c need to see xxx_SUPPORTED */
|
||||
#define JPEG_CJPEG_DJPEG /* define proper options in jconfig.h */
|
||||
#define JPEG_INTERNAL_OPTIONS /* cjpeg.c,djpeg.c need to see xxx_SUPPORTED */
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
#include "jerror.h" /* get library error codes too */
|
||||
#include "cderror.h" /* get application-specific error codes */
|
||||
#include "jerror.h" /* get library error codes too */
|
||||
#include "cderror.h" /* get application-specific error codes */
|
||||
|
||||
#define JPEG_RAW_READER 0
|
||||
|
||||
@@ -27,12 +29,9 @@
|
||||
typedef struct cjpeg_source_struct * cjpeg_source_ptr;
|
||||
|
||||
struct cjpeg_source_struct {
|
||||
JMETHOD(void, start_input, (j_compress_ptr cinfo,
|
||||
cjpeg_source_ptr sinfo));
|
||||
JMETHOD(JDIMENSION, get_pixel_rows, (j_compress_ptr cinfo,
|
||||
cjpeg_source_ptr sinfo));
|
||||
JMETHOD(void, finish_input, (j_compress_ptr cinfo,
|
||||
cjpeg_source_ptr sinfo));
|
||||
void (*start_input) (j_compress_ptr cinfo, cjpeg_source_ptr sinfo);
|
||||
JDIMENSION (*get_pixel_rows) (j_compress_ptr cinfo, cjpeg_source_ptr sinfo);
|
||||
void (*finish_input) (j_compress_ptr cinfo, cjpeg_source_ptr sinfo);
|
||||
|
||||
FILE *input_file;
|
||||
|
||||
@@ -58,15 +57,12 @@ struct djpeg_dest_struct {
|
||||
/* start_output is called after jpeg_start_decompress finishes.
|
||||
* The color map will be ready at this time, if one is needed.
|
||||
*/
|
||||
JMETHOD(void, start_output, (j_decompress_ptr cinfo,
|
||||
djpeg_dest_ptr dinfo));
|
||||
void (*start_output) (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo);
|
||||
/* Emit the specified number of pixel rows from the buffer. */
|
||||
JMETHOD(void, put_pixel_rows, (j_decompress_ptr cinfo,
|
||||
djpeg_dest_ptr dinfo,
|
||||
JDIMENSION rows_supplied));
|
||||
void (*put_pixel_rows) (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo,
|
||||
JDIMENSION rows_supplied);
|
||||
/* Finish up at the end of the image. */
|
||||
JMETHOD(void, finish_output, (j_decompress_ptr cinfo,
|
||||
djpeg_dest_ptr dinfo));
|
||||
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;
|
||||
@@ -89,9 +85,9 @@ struct djpeg_dest_struct {
|
||||
*/
|
||||
|
||||
struct cdjpeg_progress_mgr {
|
||||
struct jpeg_progress_mgr pub; /* fields known to JPEG library */
|
||||
int completed_extra_passes; /* extra passes completed */
|
||||
int total_extra_passes; /* total extra */
|
||||
struct jpeg_progress_mgr pub; /* fields known to JPEG library */
|
||||
int completed_extra_passes; /* extra passes completed */
|
||||
int total_extra_passes; /* total extra */
|
||||
/* last printed percentage stored here to avoid multiple printouts */
|
||||
int percent_done;
|
||||
};
|
||||
@@ -99,101 +95,62 @@ struct cdjpeg_progress_mgr {
|
||||
typedef struct cdjpeg_progress_mgr * cd_progress_ptr;
|
||||
|
||||
|
||||
/* Short forms of external names for systems with brain-damaged linkers. */
|
||||
|
||||
#ifdef NEED_SHORT_EXTERNAL_NAMES
|
||||
#define jinit_read_bmp jIRdBMP
|
||||
#define jinit_write_bmp jIWrBMP
|
||||
#define jinit_read_jpeg jIRdJPG
|
||||
#define jinit_read_gif jIRdGIF
|
||||
#define jinit_write_gif jIWrGIF
|
||||
#define jinit_read_ppm jIRdPPM
|
||||
#define jinit_write_ppm jIWrPPM
|
||||
#define jinit_read_rle jIRdRLE
|
||||
#define jinit_write_rle jIWrRLE
|
||||
#define jinit_read_targa jIRdTarga
|
||||
#define jinit_write_targa jIWrTarga
|
||||
#define read_quant_tables RdQTables
|
||||
#define read_scan_script RdScnScript
|
||||
#define set_quality_ratings SetQRates
|
||||
#define set_quant_slots SetQSlots
|
||||
#define set_sample_factors SetSFacts
|
||||
#define read_color_map RdCMap
|
||||
#define enable_signal_catcher EnSigCatcher
|
||||
#define start_progress_monitor StProgMon
|
||||
#define end_progress_monitor EnProgMon
|
||||
#define read_stdin RdStdin
|
||||
#define write_stdout WrStdout
|
||||
#endif /* NEED_SHORT_EXTERNAL_NAMES */
|
||||
|
||||
/* Module selection routines for I/O modules. */
|
||||
|
||||
EXTERN(cjpeg_source_ptr) jinit_read_bmp JPP((j_compress_ptr cinfo));
|
||||
EXTERN(djpeg_dest_ptr) jinit_write_bmp JPP((j_decompress_ptr cinfo,
|
||||
boolean is_os2));
|
||||
EXTERN(cjpeg_source_ptr) jinit_read_gif JPP((j_compress_ptr cinfo));
|
||||
EXTERN(djpeg_dest_ptr) jinit_write_gif JPP((j_decompress_ptr cinfo));
|
||||
EXTERN(cjpeg_source_ptr) jinit_read_jpeg JPP((j_compress_ptr cinfo));
|
||||
EXTERN(cjpeg_source_ptr) jinit_read_ppm JPP((j_compress_ptr cinfo));
|
||||
EXTERN(djpeg_dest_ptr) jinit_write_ppm JPP((j_decompress_ptr cinfo));
|
||||
EXTERN(cjpeg_source_ptr) jinit_read_rle JPP((j_compress_ptr cinfo));
|
||||
EXTERN(djpeg_dest_ptr) jinit_write_rle JPP((j_decompress_ptr cinfo));
|
||||
EXTERN(cjpeg_source_ptr) jinit_read_targa JPP((j_compress_ptr cinfo));
|
||||
EXTERN(djpeg_dest_ptr) jinit_write_targa JPP((j_decompress_ptr cinfo));
|
||||
EXTERN(cjpeg_source_ptr) jinit_read_bmp (j_compress_ptr cinfo);
|
||||
EXTERN(djpeg_dest_ptr) jinit_write_bmp (j_decompress_ptr cinfo,
|
||||
boolean is_os2);
|
||||
EXTERN(cjpeg_source_ptr) jinit_read_gif (j_compress_ptr cinfo);
|
||||
EXTERN(djpeg_dest_ptr) jinit_write_gif (j_decompress_ptr cinfo);
|
||||
EXTERN(cjpeg_source_ptr) jinit_read_jpeg (j_compress_ptr cinfo);
|
||||
EXTERN(cjpeg_source_ptr) jinit_read_ppm (j_compress_ptr cinfo);
|
||||
EXTERN(cjpeg_source_ptr) jinit_read_png (j_compress_ptr cinfo);
|
||||
EXTERN(djpeg_dest_ptr) jinit_write_ppm (j_decompress_ptr cinfo);
|
||||
EXTERN(cjpeg_source_ptr) jinit_read_rle (j_compress_ptr cinfo);
|
||||
EXTERN(djpeg_dest_ptr) jinit_write_rle (j_decompress_ptr cinfo);
|
||||
EXTERN(cjpeg_source_ptr) jinit_read_targa (j_compress_ptr cinfo);
|
||||
EXTERN(djpeg_dest_ptr) jinit_write_targa (j_decompress_ptr cinfo);
|
||||
|
||||
/* cjpeg support routines (in rdswitch.c) */
|
||||
|
||||
EXTERN(boolean) read_quant_tables JPP((j_compress_ptr cinfo, char * filename,
|
||||
boolean force_baseline));
|
||||
EXTERN(boolean) read_scan_script JPP((j_compress_ptr cinfo, char * filename));
|
||||
EXTERN(boolean) set_quality_ratings JPP((j_compress_ptr cinfo, char *arg,
|
||||
boolean force_baseline));
|
||||
EXTERN(boolean) set_quant_slots JPP((j_compress_ptr cinfo, char *arg));
|
||||
EXTERN(boolean) set_sample_factors JPP((j_compress_ptr cinfo, char *arg));
|
||||
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) set_quality_ratings (j_compress_ptr cinfo, char *arg,
|
||||
boolean force_baseline);
|
||||
EXTERN(boolean) set_quant_slots (j_compress_ptr cinfo, char *arg);
|
||||
EXTERN(boolean) set_sample_factors (j_compress_ptr cinfo, char *arg);
|
||||
|
||||
/* djpeg support routines (in rdcolmap.c) */
|
||||
|
||||
EXTERN(void) read_color_map JPP((j_decompress_ptr cinfo, FILE * infile));
|
||||
EXTERN(void) read_color_map (j_decompress_ptr cinfo, FILE * infile);
|
||||
|
||||
/* common support routines (in cdjpeg.c) */
|
||||
|
||||
EXTERN(void) enable_signal_catcher JPP((j_common_ptr cinfo));
|
||||
EXTERN(void) start_progress_monitor JPP((j_common_ptr cinfo,
|
||||
cd_progress_ptr progress));
|
||||
EXTERN(void) end_progress_monitor JPP((j_common_ptr cinfo));
|
||||
EXTERN(boolean) keymatch JPP((char * arg, const char * keyword, int minchars));
|
||||
EXTERN(FILE *) read_stdin JPP((void));
|
||||
EXTERN(FILE *) write_stdout JPP((void));
|
||||
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(FILE *) read_stdin (void);
|
||||
EXTERN(FILE *) write_stdout (void);
|
||||
|
||||
/* miscellaneous useful macros */
|
||||
|
||||
#ifdef DONT_USE_B_MODE /* define mode parameters for fopen() */
|
||||
#define READ_BINARY "r"
|
||||
#define WRITE_BINARY "w"
|
||||
#ifdef DONT_USE_B_MODE /* define mode parameters for fopen() */
|
||||
#define READ_BINARY "r"
|
||||
#define WRITE_BINARY "w"
|
||||
#else
|
||||
#ifdef VMS /* VMS is very nonstandard */
|
||||
#define READ_BINARY "rb", "ctx=stm"
|
||||
#define WRITE_BINARY "wb", "ctx=stm"
|
||||
#else /* standard ANSI-compliant case */
|
||||
#define READ_BINARY "rb"
|
||||
#define WRITE_BINARY "wb"
|
||||
#endif
|
||||
#define READ_BINARY "rb"
|
||||
#define WRITE_BINARY "wb"
|
||||
#endif
|
||||
|
||||
#ifndef EXIT_FAILURE /* define exit() codes if not provided */
|
||||
#ifndef EXIT_FAILURE /* define exit() codes if not provided */
|
||||
#define EXIT_FAILURE 1
|
||||
#endif
|
||||
#ifndef EXIT_SUCCESS
|
||||
#ifdef VMS
|
||||
#define EXIT_SUCCESS 1 /* VMS is very nonstandard */
|
||||
#else
|
||||
#define EXIT_SUCCESS 0
|
||||
#endif
|
||||
#endif
|
||||
#ifndef EXIT_WARNING
|
||||
#ifdef VMS
|
||||
#define EXIT_WARNING 1 /* VMS is very nonstandard */
|
||||
#else
|
||||
#define EXIT_WARNING 2
|
||||
#endif
|
||||
#endif
|
||||
|
||||
30
cjpeg.1
30
cjpeg.1
@@ -1,4 +1,4 @@
|
||||
.TH CJPEG 1 "18 January 2013"
|
||||
.TH CJPEG 1 "21 November 2014"
|
||||
.SH NAME
|
||||
cjpeg \- compress an image file to a JPEG file
|
||||
.SH SYNOPSIS
|
||||
@@ -16,7 +16,7 @@ cjpeg \- compress an image file to a JPEG file
|
||||
compresses the named image file, or the standard input if no file is
|
||||
named, and produces a JPEG/JFIF file on the standard output.
|
||||
The currently supported input file formats are: PPM (PBMPLUS color
|
||||
format), PGM (PBMPLUS gray-scale format), BMP, Targa, and RLE (Utah Raster
|
||||
format), PGM (PBMPLUS grayscale format), BMP, Targa, and RLE (Utah Raster
|
||||
Toolkit format). (RLE is supported only if the URT library is available.)
|
||||
.SH OPTIONS
|
||||
All switch names may be abbreviated; for example,
|
||||
@@ -166,14 +166,27 @@ Use integer DCT method (default).
|
||||
.TP
|
||||
.B \-dct fast
|
||||
Use fast integer DCT (less accurate).
|
||||
In libjpeg-turbo, the fast method is generally about 5-15% faster than the int
|
||||
method when using the x86/x86-64 SIMD extensions (results may vary with other
|
||||
SIMD implementations, or when using libjpeg-turbo without SIMD extensions.)
|
||||
For quality levels of 90 and below, there should be little or no perceptible
|
||||
difference between the two algorithms. For quality levels above 90, however,
|
||||
the difference between the fast and the int methods becomes more pronounced.
|
||||
With quality=97, for instance, the fast method incurs generally about a 1-3 dB
|
||||
loss (in PSNR) relative to the int method, but this can be larger for some
|
||||
images. Do not use the fast method with quality levels above 97. The
|
||||
algorithm often degenerates at quality=98 and above and can actually produce a
|
||||
more lossy image than if lower quality levels had been used. Also, in
|
||||
libjpeg-turbo, the fast method is not fully accelerated for quality levels
|
||||
above 97, so it will be slower than the int method.
|
||||
.TP
|
||||
.B \-dct float
|
||||
Use floating-point DCT method.
|
||||
The float method is very slightly more accurate than the int method, but is
|
||||
much slower unless your machine has very fast floating-point hardware. Also
|
||||
note that results of the floating-point method may vary slightly across
|
||||
machines, while the integer methods should give the same results everywhere.
|
||||
The fast integer method is much less accurate than the other two.
|
||||
The float method is mainly a legacy feature. It does not produce significantly
|
||||
more accurate results than the int method, and it is much slower. The float
|
||||
method may also give different results on different machines due to varying
|
||||
roundoff behavior, whereas the integer methods should give the same results on
|
||||
all machines.
|
||||
.TP
|
||||
.BI \-restart " N"
|
||||
Emit a JPEG restart marker every N MCU rows, or every N MCU blocks if "B" is
|
||||
@@ -208,6 +221,9 @@ give more output. Also, version information is printed at startup.
|
||||
.B \-debug
|
||||
Same as
|
||||
.BR \-verbose .
|
||||
.TP
|
||||
.B \-version
|
||||
Print version information and exit.
|
||||
.PP
|
||||
The
|
||||
.B \-restart
|
||||
|
||||
351
cjpeg.c
351
cjpeg.c
@@ -5,7 +5,7 @@
|
||||
* Copyright (C) 1991-1998, Thomas G. Lane.
|
||||
* Modified 2003-2011 by Guido Vollbeding.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2010, 2013, D. R. Commander.
|
||||
* Copyright (C) 2010, 2013-2014, D. R. Commander.
|
||||
* mozjpeg Modifications:
|
||||
* Copyright (C) 2014, Mozilla Corporation.
|
||||
* For conditions of distribution and use, see the accompanying README file.
|
||||
@@ -15,8 +15,8 @@
|
||||
*
|
||||
* Two different command line styles are permitted, depending on the
|
||||
* compile-time switch TWO_FILE_COMMANDLINE:
|
||||
* cjpeg [options] inputfile outputfile
|
||||
* cjpeg [options] [inputfile]
|
||||
* cjpeg [options] inputfile outputfile
|
||||
* cjpeg [options] [inputfile]
|
||||
* In the second style, output is always to standard output, which you'd
|
||||
* normally redirect to a file or pipe to some other program. Input is
|
||||
* either from a named file or from standard input (typically redirected).
|
||||
@@ -24,28 +24,28 @@
|
||||
* don't support pipes. Also, you MUST use the first style if your system
|
||||
* doesn't do binary I/O to stdin/stdout.
|
||||
* To simplify script writing, the "-outfile" switch is provided. The syntax
|
||||
* cjpeg [options] -outfile outputfile inputfile
|
||||
* cjpeg [options] -outfile outputfile inputfile
|
||||
* works regardless of which command line style is used.
|
||||
*/
|
||||
|
||||
#include "cdjpeg.h" /* Common decls for cjpeg/djpeg applications */
|
||||
#include "jversion.h" /* for version message */
|
||||
#include "config.h"
|
||||
#include "cdjpeg.h" /* Common decls for cjpeg/djpeg applications */
|
||||
#include "jversion.h" /* for version message */
|
||||
#include "jconfigint.h"
|
||||
|
||||
#ifdef USE_CCOMMAND /* command-line reader for Macintosh */
|
||||
#ifdef USE_CCOMMAND /* command-line reader for Macintosh */
|
||||
#ifdef __MWERKS__
|
||||
#include <SIOUX.h> /* Metrowerks needs this */
|
||||
#include <console.h> /* ... and this */
|
||||
#include <console.h> /* ... and this */
|
||||
#endif
|
||||
#ifdef THINK_C
|
||||
#include <console.h> /* Think declares it here */
|
||||
#include <console.h> /* Think declares it here */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
/* Create the add-on message string table. */
|
||||
|
||||
#define JMESSAGE(code,string) string ,
|
||||
#define JMESSAGE(code,string) string ,
|
||||
|
||||
static const char * const cdjpeg_message_table[] = {
|
||||
#include "cderror.h"
|
||||
@@ -79,7 +79,7 @@ static const char * const cdjpeg_message_table[] = {
|
||||
* seldom-used ID field), so we provide a switch to force Targa input mode.
|
||||
*/
|
||||
|
||||
static boolean is_targa; /* records user -targa switch */
|
||||
static boolean is_targa; /* records user -targa switch */
|
||||
static boolean is_jpeg;
|
||||
|
||||
LOCAL(cjpeg_source_ptr)
|
||||
@@ -113,6 +113,10 @@ select_file_type (j_compress_ptr cinfo, FILE * infile)
|
||||
case 'P':
|
||||
return jinit_read_ppm(cinfo);
|
||||
#endif
|
||||
#ifdef PNG_SUPPORTED
|
||||
case 0x89:
|
||||
return jinit_read_png(cinfo);
|
||||
#endif
|
||||
#ifdef RLE_SUPPORTED
|
||||
case 'R':
|
||||
return jinit_read_rle(cinfo);
|
||||
@@ -129,7 +133,7 @@ select_file_type (j_compress_ptr cinfo, FILE * infile)
|
||||
break;
|
||||
}
|
||||
|
||||
return NULL; /* suppress compiler warnings */
|
||||
return NULL; /* suppress compiler warnings */
|
||||
}
|
||||
|
||||
|
||||
@@ -142,8 +146,8 @@ select_file_type (j_compress_ptr cinfo, FILE * infile)
|
||||
*/
|
||||
|
||||
|
||||
static const char * progname; /* program name for error messages */
|
||||
static char * outfilename; /* for -outfile switch */
|
||||
static const char * progname; /* program name for error messages */
|
||||
static char * outfilename; /* for -outfile switch */
|
||||
boolean memdst; /* for -memdst switch */
|
||||
|
||||
|
||||
@@ -168,33 +172,49 @@ usage (void)
|
||||
#ifdef C_PROGRESSIVE_SUPPORTED
|
||||
fprintf(stderr, " -progressive Create progressive JPEG file (enabled by default)\n");
|
||||
#endif
|
||||
fprintf(stderr, " -baseline Create baseline JPEG file (disable progressive coding)\n");
|
||||
#ifdef TARGA_SUPPORTED
|
||||
fprintf(stderr, " -targa Input file is Targa format (usually not needed)\n");
|
||||
#endif
|
||||
fprintf(stderr, " -revert Revert to standard defaults (instead of mozjpeg defaults)\n");
|
||||
fprintf(stderr, " -fastcrush Disable progressive scan optimization\n");
|
||||
fprintf(stderr, " -multidcscan Use multiple DC scans (may be incompatible with some JPEG decoders)\n");
|
||||
fprintf(stderr, " -dc-scan-opt DC scan optimization mode\n");
|
||||
fprintf(stderr, " - 0 One scan for all components\n");
|
||||
fprintf(stderr, " - 1 One scan per component (default)\n");
|
||||
fprintf(stderr, " - 2 Optimize between one scan for all components and one scan for 1st component\n");
|
||||
fprintf(stderr, " plus one scan for remaining components\n");
|
||||
fprintf(stderr, " -notrellis Disable trellis optimization\n");
|
||||
fprintf(stderr, " -trellis-dc Enable trellis optimization of DC coefficients (default)\n");
|
||||
fprintf(stderr, " -notrellis-dc Disable trellis optimization of DC coefficients\n");
|
||||
fprintf(stderr, " -tune-psnr Tune trellis optimization for PSNR\n");
|
||||
fprintf(stderr, " -tune-hvs-psnr Tune trellis optimization for PSNR-HVS (default)\n");
|
||||
fprintf(stderr, " -tune-ssim Tune trellis optimization for SSIM\n");
|
||||
fprintf(stderr, " -tune-ms-ssim Tune trellis optimization for MS-SSIM\n");
|
||||
fprintf(stderr, "Switches for advanced users:\n");
|
||||
fprintf(stderr, " -noovershoot Disable black-on-white deringing via overshoot\n");
|
||||
#ifdef C_ARITH_CODING_SUPPORTED
|
||||
fprintf(stderr, " -arithmetic Use arithmetic coding\n");
|
||||
#endif
|
||||
#ifdef DCT_ISLOW_SUPPORTED
|
||||
fprintf(stderr, " -dct int Use integer DCT method%s\n",
|
||||
(JDCT_DEFAULT == JDCT_ISLOW ? " (default)" : ""));
|
||||
(JDCT_DEFAULT == JDCT_ISLOW ? " (default)" : ""));
|
||||
#endif
|
||||
#ifdef DCT_IFAST_SUPPORTED
|
||||
fprintf(stderr, " -dct fast Use fast integer DCT (less accurate)%s\n",
|
||||
(JDCT_DEFAULT == JDCT_IFAST ? " (default)" : ""));
|
||||
(JDCT_DEFAULT == JDCT_IFAST ? " (default)" : ""));
|
||||
#endif
|
||||
#ifdef DCT_FLOAT_SUPPORTED
|
||||
fprintf(stderr, " -dct float Use floating-point DCT method%s\n",
|
||||
(JDCT_DEFAULT == JDCT_FLOAT ? " (default)" : ""));
|
||||
(JDCT_DEFAULT == JDCT_FLOAT ? " (default)" : ""));
|
||||
#endif
|
||||
fprintf(stderr, " -quant-baseline Use 8-bit quantization table entries for baseline JPEG compatibility\n");
|
||||
fprintf(stderr, " -quant-table N Use predefined quantization table N:\n");
|
||||
fprintf(stderr, " - 0 JPEG Annex K\n");
|
||||
fprintf(stderr, " - 1 Flat\n");
|
||||
fprintf(stderr, " - 2 Custom, tuned for MS-SSIM\n");
|
||||
fprintf(stderr, " - 3 ImageMagick table by N. Robidoux\n");
|
||||
fprintf(stderr, " - 4 Custom, tuned for PSNR-HVS\n");
|
||||
fprintf(stderr, " - 5 Table from paper by Klein, Silverstein and Carney\n");
|
||||
fprintf(stderr, " -restart N Set restart interval in rows, or in blocks with B\n");
|
||||
#ifdef INPUT_SMOOTHING_SUPPORTED
|
||||
fprintf(stderr, " -smooth N Smooth dithered input (N=1..100 is strength)\n");
|
||||
@@ -205,8 +225,8 @@ usage (void)
|
||||
fprintf(stderr, " -memdst Compress to memory instead of file (useful for benchmarking)\n");
|
||||
#endif
|
||||
fprintf(stderr, " -verbose or -debug Emit debug output\n");
|
||||
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, " -qslots N[,...] Set component quantization tables\n");
|
||||
fprintf(stderr, " -sample HxV[,...] Set component sampling factors\n");
|
||||
@@ -219,7 +239,7 @@ usage (void)
|
||||
|
||||
LOCAL(int)
|
||||
parse_switches (j_compress_ptr cinfo, int argc, char **argv,
|
||||
int last_file_arg_seen, boolean for_real)
|
||||
int last_file_arg_seen, boolean for_real)
|
||||
/* Parse optional switches.
|
||||
* Returns argv[] index of first file-name argument (== argc if none).
|
||||
* Any file names with indexes <= last_file_arg_seen are ignored;
|
||||
@@ -233,15 +253,15 @@ parse_switches (j_compress_ptr cinfo, int argc, char **argv,
|
||||
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. */
|
||||
|
||||
force_baseline = FALSE; /* by default, allow 16-bit quantizers */
|
||||
force_baseline = FALSE; /* by default, allow 16-bit quantizers */
|
||||
#ifdef C_PROGRESSIVE_SUPPORTED
|
||||
simple_progressive = cinfo->num_scans == 0 ? FALSE : TRUE;
|
||||
#else
|
||||
@@ -259,39 +279,50 @@ parse_switches (j_compress_ptr cinfo, int argc, char **argv,
|
||||
if (*arg != '-') {
|
||||
/* Not a switch, must be a file name argument */
|
||||
if (argn <= last_file_arg_seen) {
|
||||
outfilename = NULL; /* -outfile applies to just one input file */
|
||||
continue; /* ignore this name if previously processed */
|
||||
outfilename = NULL; /* -outfile applies to just one input file */
|
||||
continue; /* ignore this name if previously processed */
|
||||
}
|
||||
break; /* else done parsing switches */
|
||||
break; /* else done parsing switches */
|
||||
}
|
||||
arg++; /* advance past switch marker character */
|
||||
arg++; /* advance past switch marker character */
|
||||
|
||||
if (keymatch(arg, "arithmetic", 1)) {
|
||||
/* Use arithmetic coding. */
|
||||
#ifdef C_ARITH_CODING_SUPPORTED
|
||||
cinfo->arith_code = TRUE;
|
||||
|
||||
/* No table optimization required for AC */
|
||||
cinfo->optimize_coding = FALSE;
|
||||
#else
|
||||
fprintf(stderr, "%s: sorry, arithmetic coding not supported\n",
|
||||
progname);
|
||||
progname);
|
||||
exit(EXIT_FAILURE);
|
||||
#endif
|
||||
|
||||
} else if (keymatch(arg, "baseline", 1)) {
|
||||
/* Force baseline-compatible output (8-bit quantizer values). */
|
||||
force_baseline = TRUE;
|
||||
/* Disable multiple scans */
|
||||
simple_progressive = FALSE;
|
||||
cinfo->num_scans = 0;
|
||||
cinfo->scan_info = NULL;
|
||||
|
||||
} else if (keymatch(arg, "dct", 2)) {
|
||||
/* Select DCT algorithm. */
|
||||
if (++argn >= argc) /* advance to next argument */
|
||||
usage();
|
||||
if (++argn >= argc) { /* advance to next argument */
|
||||
fprintf(stderr, "%s: missing argument for dct\n", progname);
|
||||
usage();
|
||||
}
|
||||
if (keymatch(argv[argn], "int", 1)) {
|
||||
cinfo->dct_method = JDCT_ISLOW;
|
||||
cinfo->dct_method = JDCT_ISLOW;
|
||||
} else if (keymatch(argv[argn], "fast", 2)) {
|
||||
cinfo->dct_method = JDCT_IFAST;
|
||||
cinfo->dct_method = JDCT_IFAST;
|
||||
} else if (keymatch(argv[argn], "float", 2)) {
|
||||
cinfo->dct_method = JDCT_FLOAT;
|
||||
} else
|
||||
usage();
|
||||
cinfo->dct_method = JDCT_FLOAT;
|
||||
} else {
|
||||
fprintf(stderr, "%s: invalid argument for dct\n", progname);
|
||||
usage();
|
||||
}
|
||||
|
||||
} else if (keymatch(arg, "debug", 1) || keymatch(arg, "verbose", 1)) {
|
||||
/* Enable debug printouts. */
|
||||
@@ -299,21 +330,22 @@ parse_switches (j_compress_ptr cinfo, int argc, char **argv,
|
||||
static boolean printed_version = FALSE;
|
||||
|
||||
if (! printed_version) {
|
||||
fprintf(stderr, "%s version %s (build %s)\n",
|
||||
PACKAGE_NAME, VERSION, BUILD);
|
||||
fprintf(stderr, "%s\n\n", JCOPYRIGHT);
|
||||
fprintf(stderr, "Emulating The Independent JPEG Group's software, version %s\n\n",
|
||||
JVERSION);
|
||||
printed_version = TRUE;
|
||||
fprintf(stderr, "%s version %s (build %s)\n",
|
||||
PACKAGE_NAME, VERSION, BUILD);
|
||||
fprintf(stderr, "%s\n\n", JCOPYRIGHT);
|
||||
fprintf(stderr, "Emulating The Independent JPEG Group's software, version %s\n\n",
|
||||
JVERSION);
|
||||
printed_version = TRUE;
|
||||
}
|
||||
cinfo->err->trace_level++;
|
||||
|
||||
} else if (keymatch(arg, "fastcrush", 4)) {
|
||||
cinfo->optimize_scans = FALSE;
|
||||
} else if (keymatch(arg, "version", 4)) {
|
||||
fprintf(stderr, "%s version %s (build %s)\n",
|
||||
PACKAGE_NAME, VERSION, BUILD);
|
||||
exit(EXIT_SUCCESS);
|
||||
|
||||
} else if (keymatch(arg, "flat", 4)) {
|
||||
cinfo->use_flat_quant_tbl = TRUE;
|
||||
jpeg_set_quality(cinfo, 75, TRUE);
|
||||
} else if (keymatch(arg, "fastcrush", 4)) {
|
||||
jpeg_c_set_bool_param(cinfo, JBOOLEAN_OPTIMIZE_SCANS, FALSE);
|
||||
|
||||
} else if (keymatch(arg, "grayscale", 2) || keymatch(arg, "greyscale",2)) {
|
||||
/* Force a monochrome JPEG file to be generated. */
|
||||
@@ -324,30 +356,36 @@ parse_switches (j_compress_ptr cinfo, int argc, char **argv,
|
||||
jpeg_set_colorspace(cinfo, JCS_RGB);
|
||||
|
||||
} else if (keymatch(arg, "lambda1", 7)) {
|
||||
if (++argn >= argc) /* advance to next argument */
|
||||
usage();
|
||||
cinfo->lambda_log_scale1 = atof(argv[argn]);
|
||||
if (++argn >= argc) /* advance to next argument */
|
||||
usage();
|
||||
jpeg_c_set_float_param(cinfo, JFLOAT_LAMBDA_LOG_SCALE1,
|
||||
atof(argv[argn]));
|
||||
|
||||
} else if (keymatch(arg, "lambda2", 7)) {
|
||||
if (++argn >= argc) /* advance to next argument */
|
||||
usage();
|
||||
cinfo->lambda_log_scale2 = atof(argv[argn]);
|
||||
if (++argn >= argc) /* advance to next argument */
|
||||
usage();
|
||||
jpeg_c_set_float_param(cinfo, JFLOAT_LAMBDA_LOG_SCALE2,
|
||||
atof(argv[argn]));
|
||||
|
||||
} else if (keymatch(arg, "maxmemory", 3)) {
|
||||
/* Maximum memory in Kb (or Mb with 'm'). */
|
||||
long lval;
|
||||
char ch = 'x';
|
||||
|
||||
if (++argn >= argc) /* advance to next argument */
|
||||
usage();
|
||||
if (++argn >= argc) /* advance to next argument */
|
||||
usage();
|
||||
if (sscanf(argv[argn], "%ld%c", &lval, &ch) < 1)
|
||||
usage();
|
||||
usage();
|
||||
if (ch == 'm' || ch == 'M')
|
||||
lval *= 1000L;
|
||||
lval *= 1000L;
|
||||
cinfo->mem->max_memory_to_use = lval * 1000L;
|
||||
|
||||
} else if (keymatch(arg, "multidcscan", 3)) {
|
||||
cinfo->one_dc_scan = FALSE;
|
||||
} else if (keymatch(arg, "dc-scan-opt", 3)) {
|
||||
if (++argn >= argc) { /* advance to next argument */
|
||||
fprintf(stderr, "%s: missing argument for dc-scan-opt\n", progname);
|
||||
usage();
|
||||
}
|
||||
jpeg_c_set_int_param(cinfo, JINT_DC_SCAN_OPT_MODE, atoi(argv[argn]));
|
||||
|
||||
} else if (keymatch(arg, "optimize", 1) || keymatch(arg, "optimise", 1)) {
|
||||
/* Enable entropy parm optimization. */
|
||||
@@ -355,15 +393,17 @@ parse_switches (j_compress_ptr cinfo, int argc, char **argv,
|
||||
cinfo->optimize_coding = TRUE;
|
||||
#else
|
||||
fprintf(stderr, "%s: sorry, entropy optimization was not compiled in\n",
|
||||
progname);
|
||||
progname);
|
||||
exit(EXIT_FAILURE);
|
||||
#endif
|
||||
|
||||
} else if (keymatch(arg, "outfile", 4)) {
|
||||
/* Set output file name. */
|
||||
if (++argn >= argc) /* advance to next argument */
|
||||
usage();
|
||||
outfilename = argv[argn]; /* save it away for later use */
|
||||
if (++argn >= argc) { /* advance to next argument */
|
||||
fprintf(stderr, "%s: missing argument for outfile\n", progname);
|
||||
usage();
|
||||
}
|
||||
outfilename = argv[argn]; /* save it away for later use */
|
||||
|
||||
} else if (keymatch(arg, "progressive", 1)) {
|
||||
/* Select simple progressive mode. */
|
||||
@@ -372,7 +412,7 @@ parse_switches (j_compress_ptr cinfo, int argc, char **argv,
|
||||
/* We must postpone execution until num_components is known. */
|
||||
#else
|
||||
fprintf(stderr, "%s: sorry, progressive output was not compiled in\n",
|
||||
progname);
|
||||
progname);
|
||||
exit(EXIT_FAILURE);
|
||||
#endif
|
||||
|
||||
@@ -388,14 +428,16 @@ parse_switches (j_compress_ptr cinfo, int argc, char **argv,
|
||||
|
||||
} else if (keymatch(arg, "quality", 1)) {
|
||||
/* Quality ratings (quantization table scaling factors). */
|
||||
if (++argn >= argc) /* advance to next argument */
|
||||
usage();
|
||||
if (++argn >= argc) { /* advance to next argument */
|
||||
fprintf(stderr, "%s: missing argument for quality\n", progname);
|
||||
usage();
|
||||
}
|
||||
qualityarg = argv[argn];
|
||||
|
||||
} else if (keymatch(arg, "qslots", 2)) {
|
||||
/* Quantization table slot numbers. */
|
||||
if (++argn >= argc) /* advance to next argument */
|
||||
usage();
|
||||
if (++argn >= argc) /* advance to next argument */
|
||||
usage();
|
||||
qslotsarg = argv[argn];
|
||||
/* Must delay setting qslots until after we have processed any
|
||||
* colorspace-determining switches, since jpeg_set_colorspace sets
|
||||
@@ -404,39 +446,55 @@ parse_switches (j_compress_ptr cinfo, int argc, char **argv,
|
||||
|
||||
} else if (keymatch(arg, "qtables", 2)) {
|
||||
/* Quantization tables fetched from file. */
|
||||
if (++argn >= argc) /* advance to next argument */
|
||||
usage();
|
||||
if (++argn >= argc) /* advance to next argument */
|
||||
usage();
|
||||
qtablefile = argv[argn];
|
||||
/* We postpone actually reading the file in case -quality comes later. */
|
||||
|
||||
} else if (keymatch(arg, "quant-table", 7)) {
|
||||
int val;
|
||||
if (++argn >= argc) /* advance to next argument */
|
||||
usage();
|
||||
val = atoi(argv[argn]);
|
||||
jpeg_c_set_int_param(cinfo, JINT_BASE_QUANT_TBL_IDX, val);
|
||||
if (jpeg_c_get_int_param(cinfo, JINT_BASE_QUANT_TBL_IDX) != val) {
|
||||
fprintf(stderr, "%s: %d is invalid argument for quant-table\n", progname, val);
|
||||
usage();
|
||||
}
|
||||
jpeg_set_quality(cinfo, 75, TRUE);
|
||||
|
||||
} else if (keymatch(arg, "quant-baseline", 7)) {
|
||||
/* Force quantization table to meet baseline requirements */
|
||||
force_baseline = TRUE;
|
||||
|
||||
} else if (keymatch(arg, "restart", 1)) {
|
||||
/* Restart interval in MCU rows (or in MCUs with 'b'). */
|
||||
long lval;
|
||||
char ch = 'x';
|
||||
|
||||
if (++argn >= argc) /* advance to next argument */
|
||||
usage();
|
||||
if (++argn >= argc) /* advance to next argument */
|
||||
usage();
|
||||
if (sscanf(argv[argn], "%ld%c", &lval, &ch) < 1)
|
||||
usage();
|
||||
usage();
|
||||
if (lval < 0 || lval > 65535L)
|
||||
usage();
|
||||
usage();
|
||||
if (ch == 'b' || ch == 'B') {
|
||||
cinfo->restart_interval = (unsigned int) lval;
|
||||
cinfo->restart_in_rows = 0; /* else prior '-restart n' overrides me */
|
||||
cinfo->restart_interval = (unsigned int) lval;
|
||||
cinfo->restart_in_rows = 0; /* else prior '-restart n' overrides me */
|
||||
} else {
|
||||
cinfo->restart_in_rows = (int) lval;
|
||||
/* restart_interval will be computed during startup */
|
||||
cinfo->restart_in_rows = (int) lval;
|
||||
/* restart_interval will be computed during startup */
|
||||
}
|
||||
|
||||
} else if (keymatch(arg, "revert", 3)) {
|
||||
/* revert to old JPEG default */
|
||||
cinfo->use_moz_defaults = FALSE;
|
||||
jpeg_c_set_int_param(cinfo, JINT_COMPRESS_PROFILE, JCP_FASTEST);
|
||||
jpeg_set_defaults(cinfo);
|
||||
|
||||
} else if (keymatch(arg, "sample", 2)) {
|
||||
/* Set sampling factors. */
|
||||
if (++argn >= argc) /* advance to next argument */
|
||||
usage();
|
||||
if (++argn >= argc) /* advance to next argument */
|
||||
usage();
|
||||
samplearg = argv[argn];
|
||||
/* Must delay setting sample factors until after we have processed any
|
||||
* colorspace-determining switches, since jpeg_set_colorspace sets
|
||||
@@ -446,13 +504,13 @@ parse_switches (j_compress_ptr cinfo, int argc, char **argv,
|
||||
} else if (keymatch(arg, "scans", 4)) {
|
||||
/* Set scan script. */
|
||||
#ifdef C_MULTISCAN_FILES_SUPPORTED
|
||||
if (++argn >= argc) /* advance to next argument */
|
||||
usage();
|
||||
if (++argn >= argc) /* advance to next argument */
|
||||
usage();
|
||||
scansarg = argv[argn];
|
||||
/* We must postpone reading the file in case -progressive appears. */
|
||||
#else
|
||||
fprintf(stderr, "%s: sorry, multi-scan output was not compiled in\n",
|
||||
progname);
|
||||
progname);
|
||||
exit(EXIT_FAILURE);
|
||||
#endif
|
||||
|
||||
@@ -460,52 +518,70 @@ parse_switches (j_compress_ptr cinfo, int argc, char **argv,
|
||||
/* Set input smoothing factor. */
|
||||
int val;
|
||||
|
||||
if (++argn >= argc) /* advance to next argument */
|
||||
usage();
|
||||
if (++argn >= argc) /* advance to next argument */
|
||||
usage();
|
||||
if (sscanf(argv[argn], "%d", &val) != 1)
|
||||
usage();
|
||||
usage();
|
||||
if (val < 0 || val > 100)
|
||||
usage();
|
||||
usage();
|
||||
cinfo->smoothing_factor = val;
|
||||
|
||||
} else if (keymatch(arg, "targa", 1)) {
|
||||
/* Input file is Targa format. */
|
||||
is_targa = TRUE;
|
||||
|
||||
} else if (keymatch(arg, "notrellis-dc", 11)) {
|
||||
/* disable trellis quantization */
|
||||
jpeg_c_set_bool_param(cinfo, JBOOLEAN_TRELLIS_QUANT_DC, FALSE);
|
||||
|
||||
} else if (keymatch(arg, "notrellis", 1)) {
|
||||
/* disable trellis quantization */
|
||||
cinfo->trellis_quant = FALSE;
|
||||
jpeg_c_set_bool_param(cinfo, JBOOLEAN_TRELLIS_QUANT, FALSE);
|
||||
|
||||
} else if (keymatch(arg, "trellis-dc-ver-weight", 12)) {
|
||||
if (++argn >= argc) { /* advance to next argument */
|
||||
fprintf(stderr, "%s: missing argument for trellis-dc-ver-weight\n", progname);
|
||||
usage();
|
||||
}
|
||||
jpeg_c_set_float_param(cinfo, JFLOAT_TRELLIS_DELTA_DC_WEIGHT, atof(argv[argn]));
|
||||
|
||||
} else if (keymatch(arg, "trellis-dc", 9)) {
|
||||
/* enable DC trellis quantization */
|
||||
jpeg_c_set_bool_param(cinfo, JBOOLEAN_TRELLIS_QUANT_DC, TRUE);
|
||||
|
||||
} else if (keymatch(arg, "tune-psnr", 6)) {
|
||||
cinfo->use_flat_quant_tbl = TRUE;
|
||||
cinfo->lambda_log_scale1 = 9.0;
|
||||
cinfo->lambda_log_scale2 = 0.0;
|
||||
cinfo->use_lambda_weight_tbl = FALSE;
|
||||
jpeg_c_set_int_param(cinfo, JINT_BASE_QUANT_TBL_IDX, 1);
|
||||
jpeg_c_set_float_param(cinfo, JFLOAT_LAMBDA_LOG_SCALE1, 9.0);
|
||||
jpeg_c_set_float_param(cinfo, JFLOAT_LAMBDA_LOG_SCALE2, 0.0);
|
||||
jpeg_c_set_bool_param(cinfo, JBOOLEAN_USE_LAMBDA_WEIGHT_TBL, FALSE);
|
||||
jpeg_set_quality(cinfo, 75, TRUE);
|
||||
|
||||
} else if (keymatch(arg, "tune-ssim", 6)) {
|
||||
cinfo->use_flat_quant_tbl = TRUE;
|
||||
cinfo->lambda_log_scale1 = 12.0;
|
||||
cinfo->lambda_log_scale2 = 13.5;
|
||||
cinfo->use_lambda_weight_tbl = FALSE;
|
||||
jpeg_c_set_int_param(cinfo, JINT_BASE_QUANT_TBL_IDX, 1);
|
||||
jpeg_c_set_float_param(cinfo, JFLOAT_LAMBDA_LOG_SCALE1, 11.5);
|
||||
jpeg_c_set_float_param(cinfo, JFLOAT_LAMBDA_LOG_SCALE2, 12.75);
|
||||
jpeg_c_set_bool_param(cinfo, JBOOLEAN_USE_LAMBDA_WEIGHT_TBL, FALSE);
|
||||
jpeg_set_quality(cinfo, 75, TRUE);
|
||||
|
||||
} else if (keymatch(arg, "tune-ms-ssim", 6)) {
|
||||
cinfo->use_flat_quant_tbl = FALSE;
|
||||
cinfo->lambda_log_scale1 = 14.25;
|
||||
cinfo->lambda_log_scale2 = 12.75;
|
||||
cinfo->use_lambda_weight_tbl = TRUE;
|
||||
jpeg_c_set_int_param(cinfo, JINT_BASE_QUANT_TBL_IDX, 3);
|
||||
jpeg_c_set_float_param(cinfo, JFLOAT_LAMBDA_LOG_SCALE1, 12.0);
|
||||
jpeg_c_set_float_param(cinfo, JFLOAT_LAMBDA_LOG_SCALE2, 13.0);
|
||||
jpeg_c_set_bool_param(cinfo, JBOOLEAN_USE_LAMBDA_WEIGHT_TBL, TRUE);
|
||||
jpeg_set_quality(cinfo, 75, TRUE);
|
||||
|
||||
} else if (keymatch(arg, "tune-hvs-psnr", 6)) {
|
||||
cinfo->use_flat_quant_tbl = FALSE;
|
||||
cinfo->lambda_log_scale1 = 16.0;
|
||||
cinfo->lambda_log_scale2 = 15.5;
|
||||
cinfo->use_lambda_weight_tbl = TRUE;
|
||||
jpeg_c_set_int_param(cinfo, JINT_BASE_QUANT_TBL_IDX, 3);
|
||||
jpeg_c_set_float_param(cinfo, JFLOAT_LAMBDA_LOG_SCALE1, 14.75);
|
||||
jpeg_c_set_float_param(cinfo, JFLOAT_LAMBDA_LOG_SCALE2, 16.5);
|
||||
jpeg_c_set_bool_param(cinfo, JBOOLEAN_USE_LAMBDA_WEIGHT_TBL, TRUE);
|
||||
jpeg_set_quality(cinfo, 75, TRUE);
|
||||
|
||||
} else if (keymatch(arg, "noovershoot", 11)) {
|
||||
jpeg_c_set_bool_param(cinfo, JBOOLEAN_OVERSHOOT_DERINGING, FALSE);
|
||||
} else {
|
||||
usage(); /* bogus switch */
|
||||
fprintf(stderr, "%s: unknown option '%s'\n", progname, arg);
|
||||
usage(); /* bogus switch */
|
||||
}
|
||||
}
|
||||
|
||||
@@ -515,35 +591,41 @@ parse_switches (j_compress_ptr cinfo, int argc, char **argv,
|
||||
|
||||
/* Set quantization tables for selected quality. */
|
||||
/* Some or all may be overridden if -qtables is present. */
|
||||
if (qualityarg != NULL) /* process -quality if it was present */
|
||||
if (! set_quality_ratings(cinfo, qualityarg, force_baseline))
|
||||
usage();
|
||||
if (qualityarg != NULL) /* process -quality if it was present */
|
||||
if (! set_quality_ratings(cinfo, qualityarg, force_baseline)) {
|
||||
fprintf(stderr, "%s: can't set quality ratings\n", progname);
|
||||
usage();
|
||||
}
|
||||
|
||||
if (qtablefile != NULL) /* process -qtables if it was present */
|
||||
if (! read_quant_tables(cinfo, qtablefile, force_baseline))
|
||||
usage();
|
||||
if (qtablefile != NULL) /* process -qtables if it was present */
|
||||
if (! read_quant_tables(cinfo, qtablefile, force_baseline)) {
|
||||
fprintf(stderr, "%s: can't read qtable file\n", progname);
|
||||
usage();
|
||||
}
|
||||
|
||||
if (qslotsarg != NULL) /* process -qslots if it was present */
|
||||
if (qslotsarg != NULL) /* process -qslots if it was present */
|
||||
if (! set_quant_slots(cinfo, qslotsarg))
|
||||
usage();
|
||||
usage();
|
||||
|
||||
if (samplearg != NULL) /* process -sample if it was present */
|
||||
if (! set_sample_factors(cinfo, samplearg))
|
||||
usage();
|
||||
if (samplearg != NULL) /* process -sample if it was present */
|
||||
if (! set_sample_factors(cinfo, samplearg)) {
|
||||
fprintf(stderr, "%s: can't set sample factors\n", progname);
|
||||
usage();
|
||||
}
|
||||
|
||||
#ifdef C_PROGRESSIVE_SUPPORTED
|
||||
if (simple_progressive) /* process -progressive; -scans can override */
|
||||
if (simple_progressive) /* process -progressive; -scans can override */
|
||||
jpeg_simple_progression(cinfo);
|
||||
#endif
|
||||
|
||||
#ifdef C_MULTISCAN_FILES_SUPPORTED
|
||||
if (scansarg != NULL) /* process -scans if it was present */
|
||||
if (scansarg != NULL) /* process -scans if it was present */
|
||||
if (! read_scan_script(cinfo, scansarg))
|
||||
usage();
|
||||
usage();
|
||||
#endif
|
||||
}
|
||||
|
||||
return argn; /* return index of next arg (file name) */
|
||||
return argn; /* return index of next arg (file name) */
|
||||
}
|
||||
|
||||
|
||||
@@ -574,7 +656,7 @@ main (int argc, char **argv)
|
||||
|
||||
progname = argv[0];
|
||||
if (progname == NULL || progname[0] == 0)
|
||||
progname = "cjpeg"; /* in case C library doesn't provide it */
|
||||
progname = "cjpeg"; /* in case C library doesn't provide it */
|
||||
|
||||
/* Initialize the JPEG compression object with default error handling. */
|
||||
cinfo.err = jpeg_std_error(&jerr);
|
||||
@@ -584,11 +666,6 @@ main (int argc, char **argv)
|
||||
jerr.first_addon_message = JMSG_FIRSTADDONCODE;
|
||||
jerr.last_addon_message = JMSG_LASTADDONCODE;
|
||||
|
||||
/* Now safe to enable signal catcher. */
|
||||
#ifdef NEED_SIGNAL_CATCHER
|
||||
enable_signal_catcher((j_common_ptr) &cinfo);
|
||||
#endif
|
||||
|
||||
/* Initialize JPEG parameters.
|
||||
* Much of this may be overridden later.
|
||||
* In particular, we don't yet know the input file's color space,
|
||||
@@ -596,7 +673,6 @@ main (int argc, char **argv)
|
||||
*/
|
||||
|
||||
cinfo.in_color_space = JCS_RGB; /* arbitrary guess */
|
||||
cinfo.use_moz_defaults = TRUE;
|
||||
jpeg_set_defaults(&cinfo);
|
||||
|
||||
/* Scan command line to find file names.
|
||||
@@ -670,7 +746,7 @@ main (int argc, char **argv)
|
||||
#if JPEG_RAW_READER
|
||||
if (!is_jpeg)
|
||||
#endif
|
||||
jpeg_default_colorspace(&cinfo);
|
||||
jpeg_default_colorspace(&cinfo);
|
||||
|
||||
/* Adjust default compression parameters by re-parsing the options */
|
||||
file_index = parse_switches(&cinfo, argc, argv, 0, TRUE);
|
||||
@@ -704,7 +780,7 @@ main (int argc, char **argv)
|
||||
GETJOCTET(marker->data[2]) == 0x49 &&
|
||||
GETJOCTET(marker->data[3]) == 0x46 &&
|
||||
GETJOCTET(marker->data[4]) == 0)
|
||||
continue; /* reject duplicate JFIF */
|
||||
continue; /* reject duplicate JFIF */
|
||||
if (cinfo.write_Adobe_marker &&
|
||||
marker->marker == JPEG_APP0+14 &&
|
||||
marker->data_length >= 5 &&
|
||||
@@ -713,8 +789,9 @@ main (int argc, char **argv)
|
||||
GETJOCTET(marker->data[2]) == 0x6F &&
|
||||
GETJOCTET(marker->data[3]) == 0x62 &&
|
||||
GETJOCTET(marker->data[4]) == 0x65)
|
||||
continue; /* reject duplicate Adobe */
|
||||
jpeg_write_marker(&cinfo, marker->marker, marker->data, marker->data_length);
|
||||
continue; /* reject duplicate Adobe */
|
||||
jpeg_write_marker(&cinfo, marker->marker, marker->data,
|
||||
marker->data_length);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -726,7 +803,7 @@ main (int argc, char **argv)
|
||||
(void) jpeg_write_raw_data(&cinfo, src_mgr->plane_pointer, num_scanlines);
|
||||
else
|
||||
#endif
|
||||
(void) jpeg_write_scanlines(&cinfo, src_mgr->buffer, num_scanlines);
|
||||
(void) jpeg_write_scanlines(&cinfo, src_mgr->buffer, num_scanlines);
|
||||
}
|
||||
|
||||
/* Finish compression and release memory */
|
||||
@@ -752,5 +829,5 @@ main (int argc, char **argv)
|
||||
|
||||
/* All done. */
|
||||
exit(jerr.num_warnings ? EXIT_WARNING : EXIT_SUCCESS);
|
||||
return 0; /* suppress no-return-value warnings */
|
||||
return 0; /* suppress no-return-value warnings */
|
||||
}
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
IJG JPEG LIBRARY: CODING RULES
|
||||
|
||||
This file was part of the Independent JPEG Group's software:
|
||||
Copyright (C) 1991-1996, Thomas G. Lane.
|
||||
This file is part of the Independent JPEG Group's software.
|
||||
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.
|
||||
|
||||
|
||||
@@ -21,33 +23,18 @@ Block comments should be laid out thusly:
|
||||
*/
|
||||
|
||||
We indent statements in K&R style, e.g.,
|
||||
if (test) {
|
||||
then-part;
|
||||
} else {
|
||||
else-part;
|
||||
}
|
||||
if (test) {
|
||||
then-part;
|
||||
} else {
|
||||
else-part;
|
||||
}
|
||||
with two spaces per indentation level. (This indentation convention is
|
||||
handled automatically by GNU Emacs and many other text editors.)
|
||||
|
||||
Multi-word names should be written in lower case with underscores, e.g.,
|
||||
multi_word_name (not multiWordName). Preprocessor symbols and enum constants
|
||||
are similar but upper case (MULTI_WORD_NAME). Names should be unique within
|
||||
the first fifteen characters. (On some older systems, global names must be
|
||||
unique within six characters. We accommodate this without cluttering the
|
||||
source code by using macros to substitute shorter names.)
|
||||
|
||||
We use function prototypes everywhere; we rely on automatic source code
|
||||
transformation to feed prototype-less C compilers. Transformation is done
|
||||
by the simple and portable tool 'ansi2knr.c' (courtesy of Ghostscript).
|
||||
ansi2knr is not very bright, so it imposes a format requirement on function
|
||||
declarations: the function name MUST BEGIN IN COLUMN 1. Thus all functions
|
||||
should be written in the following style:
|
||||
|
||||
LOCAL(int *)
|
||||
function_name (int a, char *b)
|
||||
{
|
||||
code...
|
||||
}
|
||||
the first fifteen characters.
|
||||
|
||||
Note that each function definition must begin with GLOBAL(type), LOCAL(type),
|
||||
or METHODDEF(type). These macros expand to "static type" or just "type" as
|
||||
@@ -55,32 +42,8 @@ appropriate. They provide a readable indication of the routine's usage and
|
||||
can readily be changed for special needs. (For instance, special linkage
|
||||
keywords can be inserted for use in Windows DLLs.)
|
||||
|
||||
ansi2knr does not transform method declarations (function pointers in
|
||||
structs). We handle these with a macro JMETHOD, defined as
|
||||
#ifdef HAVE_PROTOTYPES
|
||||
#define JMETHOD(type,methodname,arglist) type (*methodname) arglist
|
||||
#else
|
||||
#define JMETHOD(type,methodname,arglist) type (*methodname) ()
|
||||
#endif
|
||||
which is used like this:
|
||||
struct function_pointers {
|
||||
JMETHOD(void, init_entropy_encoder, (int somearg, jparms *jp));
|
||||
JMETHOD(void, term_entropy_encoder, (void));
|
||||
};
|
||||
Note the set of parentheses surrounding the parameter list.
|
||||
|
||||
A similar solution is used for forward and external function declarations
|
||||
(see the EXTERN and JPP macros).
|
||||
|
||||
If the code is to work on non-ANSI compilers, we cannot rely on a prototype
|
||||
declaration to coerce actual parameters into the right types. Therefore, use
|
||||
explicit casts on actual parameters whenever the actual parameter type is not
|
||||
identical to the formal parameter. Beware of implicit conversions to "int".
|
||||
|
||||
It seems there are some non-ANSI compilers in which the sizeof() operator
|
||||
is defined to return int, yet size_t is defined as long. Needless to say,
|
||||
this is brain-damaged. Always use the SIZEOF() macro in place of sizeof(),
|
||||
so that the result is guaranteed to be of type size_t.
|
||||
A similar solution is used for external function declarations (see the EXTERN
|
||||
macro.)
|
||||
|
||||
|
||||
The JPEG library is intended to be used within larger programs. Furthermore,
|
||||
@@ -94,9 +57,7 @@ pass these through the common routines provided.
|
||||
wherever possible. (Note that our method-based calling conventions help this
|
||||
a lot: in many modules only the initialization function will ever need to be
|
||||
called directly, so only that function need be externally visible.) All
|
||||
global function names should begin with "jpeg_", and should have an
|
||||
abbreviated name (unique in the first six characters) substituted by macro
|
||||
when NEED_SHORT_EXTERNAL_NAMES is set.
|
||||
global function names should begin with "jpeg_".
|
||||
|
||||
3. Don't use global variables; anything that must be used in another module
|
||||
should be in the common data structures.
|
||||
@@ -107,10 +68,9 @@ the system architecture document, structure.txt).
|
||||
|
||||
5. Source file names should begin with "j" for files that are part of the
|
||||
library proper; source files that are not part of the library, such as cjpeg.c
|
||||
and djpeg.c, do not begin with "j". Keep source file names to eight
|
||||
characters (plus ".c" or ".h", etc) to make life easy for MS-DOSers. Keep
|
||||
compression and decompression code in separate source files --- some
|
||||
applications may want only one half of the library.
|
||||
and djpeg.c, do not begin with "j". Keep compression and decompression code in
|
||||
separate source files --- some applications may want only one half of the
|
||||
library.
|
||||
|
||||
Note: these rules (particularly #4) are not followed religiously in the
|
||||
modules that are used in cjpeg/djpeg but are not part of the JPEG library
|
||||
|
||||
176
configure.ac
176
configure.ac
@@ -2,29 +2,27 @@
|
||||
# Process this file with autoconf to produce a configure script.
|
||||
|
||||
AC_PREREQ([2.56])
|
||||
AC_INIT([libmozjpeg], [2.0.1])
|
||||
AC_INIT([mozjpeg], [3.1])
|
||||
BUILD=`date +%Y%m%d`
|
||||
|
||||
AM_INIT_AUTOMAKE([-Wall foreign dist-bzip2])
|
||||
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES(yes)])
|
||||
AC_PREFIX_DEFAULT(/opt/libmozjpeg)
|
||||
|
||||
# Always build with prototypes
|
||||
AC_DEFINE([HAVE_PROTOTYPES], 1, [Define if your compiler supports prototypes])
|
||||
AC_PREFIX_DEFAULT(/opt/mozjpeg)
|
||||
|
||||
# Checks for programs.
|
||||
SAVED_CFLAGS=${CFLAGS}
|
||||
SAVED_CPPFLAGS=${CPPFLAGS}
|
||||
AC_PROG_CPP
|
||||
AC_PROG_CC
|
||||
AM_PROG_CC_C_O
|
||||
m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
|
||||
AM_PROG_AS
|
||||
AM_PROG_CC_C_O
|
||||
AC_PROG_INSTALL
|
||||
AM_PROG_AR
|
||||
m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
|
||||
AC_PROG_LIBTOOL
|
||||
AC_PROG_LN_S
|
||||
|
||||
# When the prefix is /opt/libmozjpeg, we assume that an "official" binary is
|
||||
# When the prefix is /opt/mozjpeg, we assume that an "official" binary is
|
||||
# being created, and thus we install things into specific locations.
|
||||
|
||||
old_prefix=${prefix}
|
||||
@@ -33,12 +31,12 @@ if test "x$prefix" = "xNONE" -a "x$ac_default_prefix" != "x"; then
|
||||
fi
|
||||
DATADIR=`eval echo ${datadir}`
|
||||
DATADIR=`eval echo $DATADIR`
|
||||
if test "$DATADIR" = "/opt/libmozjpeg/share"; then
|
||||
if test "$DATADIR" = "/opt/mozjpeg/share"; then
|
||||
datadir='${prefix}'
|
||||
fi
|
||||
DATADIR=`eval echo ${datarootdir}`
|
||||
DATADIR=`eval echo $DATADIR`
|
||||
if test "$DATADIR" = "/opt/libmozjpeg/share"; then
|
||||
if test "$DATADIR" = "/opt/mozjpeg/share"; then
|
||||
datarootdir='${prefix}'
|
||||
fi
|
||||
|
||||
@@ -50,7 +48,7 @@ fi
|
||||
if test "x${libdir}" = 'x${exec_prefix}/lib' -o "x${libdir}" = 'x${prefix}/lib'; then
|
||||
LIBDIR=`eval echo ${libdir}`
|
||||
LIBDIR=`eval echo $LIBDIR`
|
||||
if test "$LIBDIR" = "/opt/libmozjpeg/lib"; then
|
||||
if test "$LIBDIR" = "/opt/mozjpeg/lib"; then
|
||||
case $host_os in
|
||||
darwin*)
|
||||
;;
|
||||
@@ -95,11 +93,16 @@ fi
|
||||
# Checks for libraries.
|
||||
AC_CHECK_LIB([m],[pow])
|
||||
|
||||
PKG_CHECK_MODULES([libpng], [libpng], [HAVE_LIBPNG=1], [
|
||||
PKG_CHECK_MODULES([libpng], [libpng12], [HAVE_LIBPNG=1], [HAVE_LIBPNG=0])
|
||||
])
|
||||
AM_CONDITIONAL([HAVE_LIBPNG], [test "$HAVE_LIBPNG" -eq 1])
|
||||
|
||||
# Checks for header files.
|
||||
AC_HEADER_STDC
|
||||
AC_CHECK_HEADERS([stddef.h stdlib.h string.h])
|
||||
AC_CHECK_HEADERS([stddef.h stdlib.h locale.h string.h])
|
||||
AC_CHECK_HEADER([sys/types.h],
|
||||
AC_DEFINE([NEED_SYS_TYPES_H], 1, [Define if you have sys/types.h]))
|
||||
AC_DEFINE([NEED_SYS_TYPES_H], 1, [Define if you need to include <sys/types.h> to get size_t.]))
|
||||
|
||||
# Checks for typedefs, structures, and compiler characteristics.
|
||||
AC_C_CONST
|
||||
@@ -131,34 +134,25 @@ AC_TRY_RUN(
|
||||
exit(is_shifting_signed(-0x7F7E80B1L));
|
||||
}],
|
||||
[AC_MSG_RESULT(no)
|
||||
AC_DEFINE([RIGHT_SHIFT_IS_UNSIGNED], 1, [Define if shift is unsigned])],
|
||||
AC_DEFINE([RIGHT_SHIFT_IS_UNSIGNED], 1,
|
||||
[Define if your (broken) compiler shifts signed values as if they were unsigned.])],
|
||||
[AC_MSG_RESULT(yes)],
|
||||
[AC_MSG_RESULT(Assuming that right shift is signed on target machine.)])
|
||||
|
||||
# test whether global names are unique to at least 15 chars
|
||||
AC_MSG_CHECKING([for short external names])
|
||||
AC_TRY_LINK(
|
||||
[int possibly_duplicate_function () { return 0; }
|
||||
int possibly_dupli_function () { return 1; }], [ ],
|
||||
[AC_MSG_RESULT(ok)],
|
||||
[AC_MSG_RESULT(short)
|
||||
AC_DEFINE([NEED_SHORT_EXTERNAL_NAMES], 1,
|
||||
[Define if you need short function names])])
|
||||
|
||||
# Checks for library functions.
|
||||
AC_CHECK_FUNCS([memset memcpy], [],
|
||||
[AC_DEFINE([NEED_BSD_STRINGS], 1,
|
||||
[Define if you have BSD-like bzero and bcopy])])
|
||||
[Define if you have BSD-like bzero and bcopy in <strings.h> rather than memset/memcpy in <string.h>.])])
|
||||
|
||||
AC_MSG_CHECKING([libjpeg API version])
|
||||
AC_ARG_VAR(JPEG_LIB_VERSION, [libjpeg API version (62, 70, or 80)])
|
||||
if test "x$JPEG_LIB_VERSION" = "x"; then
|
||||
AC_ARG_WITH([jpeg7],
|
||||
AC_HELP_STRING([--with-jpeg7],
|
||||
[Emulate libjpeg v7 API/ABI (this makes libmozjpeg backward incompatible with libjpeg v6b.)]))
|
||||
[Emulate libjpeg v7 API/ABI (this makes mozjpeg backward incompatible with libjpeg v6b.)]))
|
||||
AC_ARG_WITH([jpeg8],
|
||||
AC_HELP_STRING([--with-jpeg8],
|
||||
[Emulate libjpeg v8 API/ABI (this makes libmozjpeg backward incompatible with libjpeg v6b.)]))
|
||||
[Emulate libjpeg v8 API/ABI (this makes mozjpeg backward incompatible with libjpeg v6b.)]))
|
||||
if test "x${with_jpeg8}" = "xyes"; then
|
||||
JPEG_LIB_VERSION=80
|
||||
else
|
||||
@@ -176,9 +170,9 @@ AC_DEFINE_UNQUOTED(JPEG_LIB_VERSION, [$JPEG_LIB_VERSION],
|
||||
[libjpeg API version])
|
||||
|
||||
AC_ARG_VAR(SO_MAJOR_VERSION,
|
||||
[Major version of the libmozjpeg shared library (default is determined by the API version)])
|
||||
[Major version of the mozjpeg shared library (default is determined by the API version)])
|
||||
AC_ARG_VAR(SO_MINOR_VERSION,
|
||||
[Minor version of the libmozjpeg shared library (default is determined by the API version)])
|
||||
[Minor version of the mozjpeg shared library (default is determined by the API version)])
|
||||
if test "x$SO_MAJOR_VERSION" = "x"; then
|
||||
case "$JPEG_LIB_VERSION" in
|
||||
62) SO_MAJOR_VERSION=$JPEG_LIB_VERSION ;;
|
||||
@@ -195,7 +189,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])
|
||||
@@ -206,7 +200,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)
|
||||
@@ -223,12 +217,12 @@ AC_SUBST(SO_MINOR_VERSION)
|
||||
AC_SUBST(SO_AGE)
|
||||
AC_SUBST(MEM_SRCDST_FUNCTIONS)
|
||||
|
||||
AC_DEFINE_UNQUOTED(LIBMOZJPEG_VERSION, [$VERSION], [libmozjpeg version])
|
||||
AC_DEFINE_UNQUOTED(MOZJPEG_VERSION, [$VERSION], [mozjpeg version])
|
||||
|
||||
VERSION_SCRIPT=yes
|
||||
AC_ARG_ENABLE([ld-version-script],
|
||||
AS_HELP_STRING([--disable-ld-version-script],
|
||||
[Disable linker version script for libmozjpeg (default is to use linker version script if the linker supports it)]),
|
||||
[Disable linker version script for mozjpeg (default is to use linker version script if the linker supports it)]),
|
||||
[VERSION_SCRIPT=$enableval], [])
|
||||
|
||||
AC_MSG_CHECKING([whether the linker supports version scripts])
|
||||
@@ -256,7 +250,7 @@ if test "x$VERSION_SCRIPT_FLAG" = "x"; then
|
||||
fi
|
||||
LDFLAGS="$SAVED_LDFLAGS"
|
||||
|
||||
AC_MSG_CHECKING([whether to use version script when building libmozjpeg])
|
||||
AC_MSG_CHECKING([whether to use version script when building mozjpeg])
|
||||
AC_MSG_RESULT($VERSION_SCRIPT)
|
||||
|
||||
AM_CONDITIONAL(VERSION_SCRIPT, test "x$VERSION_SCRIPT" = "xyes")
|
||||
@@ -265,7 +259,7 @@ AC_SUBST(VERSION_SCRIPT_FLAG)
|
||||
# Check for non-broken inline under various spellings
|
||||
AC_MSG_CHECKING(for inline)
|
||||
ljt_cv_inline=""
|
||||
AC_TRY_COMPILE(, [} __attribute__((always_inline)) int foo() { return 0; }
|
||||
AC_TRY_COMPILE(, [} inline __attribute__((always_inline)) int foo() { return 0; }
|
||||
int bar() { return foo();], ljt_cv_inline="inline __attribute__((always_inline))",
|
||||
AC_TRY_COMPILE(, [} __inline__ int foo() { return 0; }
|
||||
int bar() { return foo();], ljt_cv_inline="__inline__",
|
||||
@@ -274,13 +268,16 @@ int bar() { return foo();], ljt_cv_inline="__inline",
|
||||
AC_TRY_COMPILE(, [} inline int foo() { return 0; }
|
||||
int bar() { return foo();], ljt_cv_inline="inline"))))
|
||||
AC_MSG_RESULT($ljt_cv_inline)
|
||||
AC_DEFINE_UNQUOTED([INLINE],[inline $ljt_cv_inline],[How to obtain function inlining.])
|
||||
AC_DEFINE_UNQUOTED([INLINE],[$ljt_cv_inline],[How to obtain function inlining.])
|
||||
|
||||
# Arithmetic coding support
|
||||
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]))
|
||||
if test "x$with_12bit" = "xyes"; then
|
||||
with_arith_enc=no
|
||||
fi
|
||||
if test "x$with_arith_enc" = "xno"; then
|
||||
AC_MSG_RESULT(no)
|
||||
RPM_CONFIG_ARGS="$RPM_CONFIG_ARGS --without-arith-enc"
|
||||
@@ -294,6 +291,9 @@ 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]))
|
||||
if test "x$with_12bit" = "xyes"; then
|
||||
with_arith_dec=no
|
||||
fi
|
||||
if test "x$with_arith_dec" = "xno"; then
|
||||
AC_MSG_RESULT(no)
|
||||
RPM_CONFIG_ARGS="$RPM_CONFIG_ARGS --without-arith-dec"
|
||||
@@ -306,11 +306,26 @@ AM_CONDITIONAL([WITH_ARITH_DEC], [test "x$with_arith_dec" != "xno"])
|
||||
AM_CONDITIONAL([WITH_ARITH],
|
||||
[test "x$with_arith_dec" != "xno" -o "x$with_arith_enc" != "xno"])
|
||||
|
||||
# 12-bit component support
|
||||
AC_MSG_CHECKING([whether to use 12-bit samples])
|
||||
AC_ARG_WITH([12bit],
|
||||
AC_HELP_STRING([--with-12bit], [Encode/decode JPEG images with 12-bit samples (implies --without-simd --without-turbojpeg --without-arith-dec --without-arith-enc)]))
|
||||
if test "x$with_12bit" = "xyes"; then
|
||||
AC_DEFINE([BITS_IN_JSAMPLE], [12], [use 8 or 12])
|
||||
AC_MSG_RESULT(yes)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
AM_CONDITIONAL([WITH_12BIT], [test "x$with_12bit" = "xyes"])
|
||||
|
||||
# TurboJPEG support
|
||||
AC_MSG_CHECKING([whether to build TurboJPEG C wrapper])
|
||||
AC_ARG_WITH([turbojpeg],
|
||||
AC_HELP_STRING([--without-turbojpeg],
|
||||
[Do not include the TurboJPEG wrapper library and associated test programs]))
|
||||
if test "x$with_12bit" = "xyes"; then
|
||||
with_turbojpeg=no
|
||||
fi
|
||||
if test "x$with_turbojpeg" = "xno"; then
|
||||
AC_MSG_RESULT(no)
|
||||
RPM_CONFIG_ARGS="$RPM_CONFIG_ARGS --without-turbojpeg"
|
||||
@@ -342,7 +357,7 @@ AC_ARG_VAR(JNI_CFLAGS,
|
||||
AC_MSG_CHECKING([whether to build TurboJPEG Java wrapper])
|
||||
AC_ARG_WITH([java],
|
||||
AC_HELP_STRING([--with-java], [Build Java wrapper for the TurboJPEG library]))
|
||||
if test "x$with_turbojpeg" = "xno"; then
|
||||
if test "x$with_12bit" = "xyes" -o "x$with_turbojpeg" = "xno"; then
|
||||
with_java=no
|
||||
fi
|
||||
|
||||
@@ -403,6 +418,9 @@ fi
|
||||
# SIMD is optional
|
||||
AC_ARG_WITH([simd],
|
||||
AC_HELP_STRING([--without-simd], [Do not include SIMD extensions]))
|
||||
if test "x$with_12bit" = "xyes"; then
|
||||
with_simd=no
|
||||
fi
|
||||
if test "x${with_simd}" != "xno"; then
|
||||
require_simd=no
|
||||
if test "x${with_simd}" = "xyes"; then
|
||||
@@ -425,26 +443,14 @@ if test "x${with_simd}" != "xno"; then
|
||||
AC_MSG_RESULT([yes (arm)])
|
||||
AC_MSG_CHECKING([if the assembler is GNU-compatible and can be used])
|
||||
AC_CHECK_COMPATIBLE_ARM_ASSEMBLER_IFELSE(
|
||||
[AC_MSG_RESULT([yes])
|
||||
[if test "x$ac_use_gas_preprocessor" = "xyes"; then
|
||||
AC_MSG_RESULT([yes (with gas-preprocessor)])
|
||||
else
|
||||
AC_MSG_RESULT([yes])
|
||||
fi
|
||||
simd_arch=arm],
|
||||
[AC_MSG_RESULT([no])
|
||||
with_simd=no])
|
||||
if test "x${with_simd}" = "xno"; then
|
||||
if test "x${require_simd}" = "xyes"; then
|
||||
AC_MSG_ERROR([SIMD support can't be enabled.])
|
||||
else
|
||||
AC_MSG_WARN([SIMD support can't be enabled. Performance will suffer.])
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
mipsel*)
|
||||
AC_MSG_RESULT([yes (mipsel)])
|
||||
AC_MSG_CHECKING([if the assembler is GNU-compatible and can be used])
|
||||
AC_CHECK_COMPATIBLE_MIPSEL_ASSEMBLER_IFELSE(
|
||||
[AC_MSG_RESULT([yes])
|
||||
simd_arch=mipsel],
|
||||
[AC_MSG_RESULT([no])
|
||||
with_simd=no])
|
||||
if test "x${with_simd}" = "xno"; then
|
||||
if test "x${require_simd}" = "xyes"; then
|
||||
AC_MSG_ERROR([SIMD support can't be enabled.])
|
||||
@@ -453,6 +459,46 @@ if test "x${with_simd}" != "xno"; then
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
aarch64*)
|
||||
AC_MSG_RESULT([yes (arm64)])
|
||||
AC_MSG_CHECKING([if the assembler is GNU-compatible and can be used])
|
||||
AC_CHECK_COMPATIBLE_ARM64_ASSEMBLER_IFELSE(
|
||||
[if test "x$ac_use_gas_preprocessor" = "xyes"; then
|
||||
AC_MSG_RESULT([yes (with gas-preprocessor)])
|
||||
else
|
||||
AC_MSG_RESULT([yes])
|
||||
fi
|
||||
simd_arch=aarch64],
|
||||
[AC_MSG_RESULT([no])
|
||||
with_simd=no])
|
||||
if test "x${with_simd}" = "xno"; then
|
||||
if test "x${require_simd}" = "xyes"; then
|
||||
AC_MSG_ERROR([SIMD support can't be enabled.])
|
||||
else
|
||||
AC_MSG_WARN([SIMD support can't be enabled. Performance will suffer.])
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
mips*)
|
||||
AC_MSG_RESULT([yes (mips)])
|
||||
AC_MSG_CHECKING([if the assembler is GNU-compatible and can be used])
|
||||
AC_CHECK_COMPATIBLE_MIPS_ASSEMBLER_IFELSE(
|
||||
[AC_MSG_RESULT([yes])
|
||||
simd_arch=mips],
|
||||
[AC_MSG_RESULT([no])
|
||||
with_simd=no])
|
||||
if test "x${with_simd}" = "xno"; then
|
||||
if test "x${require_simd}" = "xyes"; then
|
||||
AC_MSG_ERROR([SIMD support can't be enabled.])
|
||||
else
|
||||
AC_MSG_WARN([SIMD support can't be enabled. Performance will suffer.])
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
powerpc*)
|
||||
AC_MSG_RESULT([yes (powerpc)])
|
||||
simd_arch=powerpc
|
||||
;;
|
||||
*)
|
||||
AC_MSG_RESULT([no ("$host_cpu")])
|
||||
with_simd=no;
|
||||
@@ -476,11 +522,13 @@ AM_CONDITIONAL([WITH_SSE_FLOAT_DCT], [test "x$simd_arch" = "xx86_64" -o "x$simd_
|
||||
AM_CONDITIONAL([SIMD_I386], [test "x$simd_arch" = "xi386"])
|
||||
AM_CONDITIONAL([SIMD_X86_64], [test "x$simd_arch" = "xx86_64"])
|
||||
AM_CONDITIONAL([SIMD_ARM], [test "x$simd_arch" = "xarm"])
|
||||
AM_CONDITIONAL([SIMD_MIPSEL], [test "x$simd_arch" = "xmipsel"])
|
||||
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"])
|
||||
|
||||
AC_ARG_VAR(PKGNAME, [distribution package name (default: libmozjpeg)])
|
||||
AC_ARG_VAR(PKGNAME, [distribution package name (default: mozjpeg)])
|
||||
if test "x$PKGNAME" = "x"; then
|
||||
PKGNAME=$PACKAGE_NAME
|
||||
fi
|
||||
@@ -501,20 +549,20 @@ AC_SUBST(RPMARCH)
|
||||
AC_SUBST(RPM_CONFIG_ARGS)
|
||||
AC_SUBST(DEBARCH)
|
||||
AC_SUBST(BUILD)
|
||||
AC_DEFINE_UNQUOTED([BUILD], "$BUILD", [Build number])
|
||||
AC_DEFINE_UNQUOTED([BUILD], "$BUILD", [libjpeg-turbo build number])
|
||||
|
||||
# jconfig.h is the file we use, but we have another before that to
|
||||
# fool autoheader. the reason is that we include this header in our
|
||||
# API headers, which can screw things up for users of the lib.
|
||||
# jconfig.h is a minimal version that allows this package to be built
|
||||
# NOTE: autoheader automatically modifies the input file of the first
|
||||
# invocation of AC_CONFIG_HEADERS, so we put config.h first to prevent
|
||||
# jconfig.h.in from being clobbered. config.h is used only internally, whereas
|
||||
# jconfig.h contains macros that are relevant to external programs (macros that
|
||||
# specify which features were built into the library.)
|
||||
AC_CONFIG_HEADERS([config.h])
|
||||
AC_CONFIG_HEADERS([jconfig.h])
|
||||
AC_CONFIG_FILES([pkgscripts/libmozjpeg.spec.tmpl:release/libmozjpeg.spec.in])
|
||||
AC_CONFIG_HEADERS([jconfigint.h])
|
||||
AC_CONFIG_FILES([pkgscripts/mozjpeg.spec.tmpl:release/mozjpeg.spec.in])
|
||||
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/Description.plist:release/Description.plist.in])
|
||||
AC_CONFIG_FILES([pkgscripts/Info.plist:release/Info.plist.in])
|
||||
AC_CONFIG_FILES([pkgscripts/uninstall.tmpl:release/uninstall.in])
|
||||
if test "x$with_turbojpeg" != "xno"; then
|
||||
AC_CONFIG_FILES([tjbenchtest])
|
||||
|
||||
46
djpeg.1
46
djpeg.1
@@ -1,4 +1,4 @@
|
||||
.TH DJPEG 1 "18 January 2013"
|
||||
.TH DJPEG 1 "21 November 2014"
|
||||
.SH NAME
|
||||
djpeg \- decompress a JPEG file to an image file
|
||||
.SH SYNOPSIS
|
||||
@@ -55,11 +55,14 @@ default options are chosen for highest quality output.) Currently, this is
|
||||
equivalent to \fB\-dct fast \-nosmooth \-onepass \-dither ordered\fR.
|
||||
.TP
|
||||
.B \-grayscale
|
||||
Force gray-scale output even if JPEG file is color. Useful for viewing on
|
||||
Force grayscale output even if JPEG file is color. Useful for viewing on
|
||||
monochrome displays; also,
|
||||
.B djpeg
|
||||
runs noticeably faster in this mode.
|
||||
.TP
|
||||
.B \-rgb
|
||||
Force RGB output even if JPEG file is grayscale.
|
||||
.TP
|
||||
.BI \-scale " M/N"
|
||||
Scale the output image by a factor M/N. Currently the scale factor must be
|
||||
M/8, where M is an integer between 1 and 16 inclusive, or any reduced fraction
|
||||
@@ -74,7 +77,7 @@ emitted if
|
||||
.B \-colors
|
||||
or
|
||||
.B \-grayscale
|
||||
is specified, or if the JPEG file is gray-scale; otherwise, 24-bit full-color
|
||||
is specified, or if the JPEG file is grayscale; otherwise, 24-bit full-color
|
||||
format is emitted.
|
||||
.TP
|
||||
.B \-gif
|
||||
@@ -88,12 +91,12 @@ emitted if
|
||||
.B \-colors
|
||||
or
|
||||
.B \-grayscale
|
||||
is specified, or if the JPEG file is gray-scale; otherwise, 24-bit full-color
|
||||
is specified, or if the JPEG file is grayscale; otherwise, 24-bit full-color
|
||||
format is emitted.
|
||||
.TP
|
||||
.B \-pnm
|
||||
Select PBMPLUS (PPM/PGM) output format (this is the default format).
|
||||
PGM is emitted if the JPEG file is gray-scale or if
|
||||
PGM is emitted if the JPEG file is grayscale or if
|
||||
.B \-grayscale
|
||||
is specified; otherwise PPM is emitted.
|
||||
.TP
|
||||
@@ -101,8 +104,8 @@ is specified; otherwise PPM is emitted.
|
||||
Select RLE output format. (Requires URT library.)
|
||||
.TP
|
||||
.B \-targa
|
||||
Select Targa output format. Gray-scale format is emitted if the JPEG file is
|
||||
gray-scale or if
|
||||
Select Targa output format. Grayscale format is emitted if the JPEG file is
|
||||
grayscale or if
|
||||
.B \-grayscale
|
||||
is specified; otherwise, colormapped format is emitted if
|
||||
.B \-colors
|
||||
@@ -115,14 +118,28 @@ Use integer DCT method (default).
|
||||
.TP
|
||||
.B \-dct fast
|
||||
Use fast integer DCT (less accurate).
|
||||
In libjpeg-turbo, the fast method is generally about 5-15% faster than the int
|
||||
method when using the x86/x86-64 SIMD extensions (results may vary with other
|
||||
SIMD implementations, or when using libjpeg-turbo without SIMD extensions.) If
|
||||
the JPEG image was compressed using a quality level of 85 or below, then there
|
||||
should be little or no perceptible difference between the two algorithms. When
|
||||
decompressing images that were compressed using quality levels above 85,
|
||||
however, the difference between the fast and int methods becomes more
|
||||
pronounced. With images compressed using quality=97, for instance, the fast
|
||||
method incurs generally about a 4-6 dB loss (in PSNR) relative to the int
|
||||
method, but this can be larger for some images. If you can avoid it, do not
|
||||
use the fast method when decompressing images that were compressed using
|
||||
quality levels above 97. The algorithm often degenerates for such images and
|
||||
can actually produce a more lossy output image than if the JPEG image had been
|
||||
compressed using lower quality levels.
|
||||
.TP
|
||||
.B \-dct float
|
||||
Use floating-point DCT method.
|
||||
The float method is very slightly more accurate than the int method, but is
|
||||
much slower unless your machine has very fast floating-point hardware. Also
|
||||
note that results of the floating-point method may vary slightly across
|
||||
machines, while the integer methods should give the same results everywhere.
|
||||
The fast integer method is much less accurate than the other two.
|
||||
The float method is mainly a legacy feature. It does not produce significantly
|
||||
more accurate results than the int method, and it is much slower. The float
|
||||
method may also give different results on different machines due to varying
|
||||
roundoff behavior, whereas the integer methods should give the same results on
|
||||
all machines.
|
||||
.TP
|
||||
.B \-dither fs
|
||||
Use Floyd-Steinberg dithering in color quantization.
|
||||
@@ -160,7 +177,7 @@ faster and needs less memory, but it produces a lower-quality image.
|
||||
is ignored unless you also say
|
||||
.B \-colors
|
||||
.IR N .
|
||||
Also, the one-pass method is always used for gray-scale output (the two-pass
|
||||
Also, the one-pass method is always used for grayscale output (the two-pass
|
||||
method is no improvement then).
|
||||
.TP
|
||||
.BI \-maxmemory " N"
|
||||
@@ -185,6 +202,9 @@ give more output. Also, version information is printed at startup.
|
||||
.B \-debug
|
||||
Same as
|
||||
.BR \-verbose .
|
||||
.TP
|
||||
.B \-version
|
||||
Print version information and exit.
|
||||
.SH EXAMPLES
|
||||
.LP
|
||||
This example decompresses the JPEG file foo.jpg, quantizes it to
|
||||
|
||||
218
djpeg.c
218
djpeg.c
@@ -4,7 +4,7 @@
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1991-1997, Thomas G. Lane.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2010-2011, 2013, D. R. Commander.
|
||||
* Copyright (C) 2010-2011, 2013-2014, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README file.
|
||||
*
|
||||
* This file contains a command-line user interface for the JPEG decompressor.
|
||||
@@ -12,8 +12,8 @@
|
||||
*
|
||||
* Two different command line styles are permitted, depending on the
|
||||
* compile-time switch TWO_FILE_COMMANDLINE:
|
||||
* djpeg [options] inputfile outputfile
|
||||
* djpeg [options] [inputfile]
|
||||
* djpeg [options] inputfile outputfile
|
||||
* djpeg [options] [inputfile]
|
||||
* In the second style, output is always to standard output, which you'd
|
||||
* normally redirect to a file or pipe to some other program. Input is
|
||||
* either from a named file or from standard input (typically redirected).
|
||||
@@ -21,30 +21,30 @@
|
||||
* don't support pipes. Also, you MUST use the first style if your system
|
||||
* doesn't do binary I/O to stdin/stdout.
|
||||
* To simplify script writing, the "-outfile" switch is provided. The syntax
|
||||
* djpeg [options] -outfile outputfile inputfile
|
||||
* djpeg [options] -outfile outputfile inputfile
|
||||
* works regardless of which command line style is used.
|
||||
*/
|
||||
|
||||
#include "cdjpeg.h" /* Common decls for cjpeg/djpeg applications */
|
||||
#include "jversion.h" /* for version message */
|
||||
#include "config.h"
|
||||
#include "cdjpeg.h" /* Common decls for cjpeg/djpeg applications */
|
||||
#include "jversion.h" /* for version message */
|
||||
#include "jconfigint.h"
|
||||
|
||||
#include <ctype.h> /* to declare isprint() */
|
||||
#include <ctype.h> /* to declare isprint() */
|
||||
|
||||
#ifdef USE_CCOMMAND /* command-line reader for Macintosh */
|
||||
#ifdef USE_CCOMMAND /* command-line reader for Macintosh */
|
||||
#ifdef __MWERKS__
|
||||
#include <SIOUX.h> /* Metrowerks needs this */
|
||||
#include <console.h> /* ... and this */
|
||||
#include <console.h> /* ... and this */
|
||||
#endif
|
||||
#ifdef THINK_C
|
||||
#include <console.h> /* Think declares it here */
|
||||
#include <console.h> /* Think declares it here */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
/* Create the add-on message string table. */
|
||||
|
||||
#define JMESSAGE(code,string) string ,
|
||||
#define JMESSAGE(code,string) string ,
|
||||
|
||||
static const char * const cdjpeg_message_table[] = {
|
||||
#include "cderror.h"
|
||||
@@ -60,17 +60,17 @@ static const char * const cdjpeg_message_table[] = {
|
||||
*/
|
||||
|
||||
typedef enum {
|
||||
FMT_BMP, /* BMP format (Windows flavor) */
|
||||
FMT_GIF, /* GIF format */
|
||||
FMT_OS2, /* BMP format (OS/2 flavor) */
|
||||
FMT_PPM, /* PPM/PGM (PBMPLUS formats) */
|
||||
FMT_RLE, /* RLE format */
|
||||
FMT_TARGA, /* Targa format */
|
||||
FMT_TIFF /* TIFF format */
|
||||
FMT_BMP, /* BMP format (Windows flavor) */
|
||||
FMT_GIF, /* GIF format */
|
||||
FMT_OS2, /* BMP format (OS/2 flavor) */
|
||||
FMT_PPM, /* PPM/PGM (PBMPLUS formats) */
|
||||
FMT_RLE, /* RLE format */
|
||||
FMT_TARGA, /* Targa format */
|
||||
FMT_TIFF /* TIFF format */
|
||||
} IMAGE_FORMATS;
|
||||
|
||||
#ifndef DEFAULT_FMT /* so can override from CFLAGS in Makefile */
|
||||
#define DEFAULT_FMT FMT_PPM
|
||||
#ifndef DEFAULT_FMT /* so can override from CFLAGS in Makefile */
|
||||
#define DEFAULT_FMT FMT_PPM
|
||||
#endif
|
||||
|
||||
static IMAGE_FORMATS requested_fmt;
|
||||
@@ -85,8 +85,8 @@ static IMAGE_FORMATS requested_fmt;
|
||||
*/
|
||||
|
||||
|
||||
static const char * progname; /* program name for error messages */
|
||||
static char * outfilename; /* for -outfile switch */
|
||||
static const char * progname; /* program name for error messages */
|
||||
static char * outfilename; /* for -outfile switch */
|
||||
boolean memsrc; /* for -memsrc switch */
|
||||
#define INPUT_BUF_SIZE 4096
|
||||
|
||||
@@ -107,45 +107,46 @@ usage (void)
|
||||
fprintf(stderr, " -fast Fast, low-quality processing\n");
|
||||
fprintf(stderr, " -grayscale Force grayscale output\n");
|
||||
fprintf(stderr, " -rgb Force RGB output\n");
|
||||
fprintf(stderr, " -rgb565 Force RGB565 output\n");
|
||||
#ifdef IDCT_SCALING_SUPPORTED
|
||||
fprintf(stderr, " -scale M/N Scale output image by fraction M/N, eg, 1/8\n");
|
||||
#endif
|
||||
#ifdef BMP_SUPPORTED
|
||||
fprintf(stderr, " -bmp Select BMP output format (Windows style)%s\n",
|
||||
(DEFAULT_FMT == FMT_BMP ? " (default)" : ""));
|
||||
(DEFAULT_FMT == FMT_BMP ? " (default)" : ""));
|
||||
#endif
|
||||
#ifdef GIF_SUPPORTED
|
||||
fprintf(stderr, " -gif Select GIF output format%s\n",
|
||||
(DEFAULT_FMT == FMT_GIF ? " (default)" : ""));
|
||||
(DEFAULT_FMT == FMT_GIF ? " (default)" : ""));
|
||||
#endif
|
||||
#ifdef BMP_SUPPORTED
|
||||
fprintf(stderr, " -os2 Select BMP output format (OS/2 style)%s\n",
|
||||
(DEFAULT_FMT == FMT_OS2 ? " (default)" : ""));
|
||||
(DEFAULT_FMT == FMT_OS2 ? " (default)" : ""));
|
||||
#endif
|
||||
#ifdef PPM_SUPPORTED
|
||||
fprintf(stderr, " -pnm Select PBMPLUS (PPM/PGM) output format%s\n",
|
||||
(DEFAULT_FMT == FMT_PPM ? " (default)" : ""));
|
||||
(DEFAULT_FMT == FMT_PPM ? " (default)" : ""));
|
||||
#endif
|
||||
#ifdef RLE_SUPPORTED
|
||||
fprintf(stderr, " -rle Select Utah RLE output format%s\n",
|
||||
(DEFAULT_FMT == FMT_RLE ? " (default)" : ""));
|
||||
(DEFAULT_FMT == FMT_RLE ? " (default)" : ""));
|
||||
#endif
|
||||
#ifdef TARGA_SUPPORTED
|
||||
fprintf(stderr, " -targa Select Targa output format%s\n",
|
||||
(DEFAULT_FMT == FMT_TARGA ? " (default)" : ""));
|
||||
(DEFAULT_FMT == FMT_TARGA ? " (default)" : ""));
|
||||
#endif
|
||||
fprintf(stderr, "Switches for advanced users:\n");
|
||||
#ifdef DCT_ISLOW_SUPPORTED
|
||||
fprintf(stderr, " -dct int Use integer DCT method%s\n",
|
||||
(JDCT_DEFAULT == JDCT_ISLOW ? " (default)" : ""));
|
||||
(JDCT_DEFAULT == JDCT_ISLOW ? " (default)" : ""));
|
||||
#endif
|
||||
#ifdef DCT_IFAST_SUPPORTED
|
||||
fprintf(stderr, " -dct fast Use fast integer DCT (less accurate)%s\n",
|
||||
(JDCT_DEFAULT == JDCT_IFAST ? " (default)" : ""));
|
||||
(JDCT_DEFAULT == JDCT_IFAST ? " (default)" : ""));
|
||||
#endif
|
||||
#ifdef DCT_FLOAT_SUPPORTED
|
||||
fprintf(stderr, " -dct float Use floating-point DCT method%s\n",
|
||||
(JDCT_DEFAULT == JDCT_FLOAT ? " (default)" : ""));
|
||||
(JDCT_DEFAULT == JDCT_FLOAT ? " (default)" : ""));
|
||||
#endif
|
||||
fprintf(stderr, " -dither fs Use F-S dithering (default)\n");
|
||||
fprintf(stderr, " -dither none Don't use dithering in quantization\n");
|
||||
@@ -164,13 +165,14 @@ usage (void)
|
||||
#endif
|
||||
|
||||
fprintf(stderr, " -verbose or -debug Emit debug output\n");
|
||||
fprintf(stderr, " -version Print version information and exit\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
|
||||
LOCAL(int)
|
||||
parse_switches (j_decompress_ptr cinfo, int argc, char **argv,
|
||||
int last_file_arg_seen, boolean for_real)
|
||||
int last_file_arg_seen, boolean for_real)
|
||||
/* Parse optional switches.
|
||||
* Returns argv[] index of first file-name argument (== argc if none).
|
||||
* Any file names with indexes <= last_file_arg_seen are ignored;
|
||||
@@ -184,7 +186,7 @@ parse_switches (j_decompress_ptr cinfo, int argc, char **argv,
|
||||
char * arg;
|
||||
|
||||
/* Set up default JPEG parameters. */
|
||||
requested_fmt = DEFAULT_FMT; /* set default output file format */
|
||||
requested_fmt = DEFAULT_FMT; /* set default output file format */
|
||||
outfilename = NULL;
|
||||
memsrc = FALSE;
|
||||
cinfo->err->trace_level = 0;
|
||||
@@ -196,54 +198,54 @@ parse_switches (j_decompress_ptr cinfo, int argc, char **argv,
|
||||
if (*arg != '-') {
|
||||
/* Not a switch, must be a file name argument */
|
||||
if (argn <= last_file_arg_seen) {
|
||||
outfilename = NULL; /* -outfile applies to just one input file */
|
||||
continue; /* ignore this name if previously processed */
|
||||
outfilename = NULL; /* -outfile applies to just one input file */
|
||||
continue; /* ignore this name if previously processed */
|
||||
}
|
||||
break; /* else done parsing switches */
|
||||
break; /* else done parsing switches */
|
||||
}
|
||||
arg++; /* advance past switch marker character */
|
||||
arg++; /* advance past switch marker character */
|
||||
|
||||
if (keymatch(arg, "bmp", 1)) {
|
||||
/* BMP output format. */
|
||||
requested_fmt = FMT_BMP;
|
||||
|
||||
} else if (keymatch(arg, "colors", 1) || keymatch(arg, "colours", 1) ||
|
||||
keymatch(arg, "quantize", 1) || keymatch(arg, "quantise", 1)) {
|
||||
keymatch(arg, "quantize", 1) || keymatch(arg, "quantise", 1)) {
|
||||
/* Do color quantization. */
|
||||
int val;
|
||||
|
||||
if (++argn >= argc) /* advance to next argument */
|
||||
usage();
|
||||
if (++argn >= argc) /* advance to next argument */
|
||||
usage();
|
||||
if (sscanf(argv[argn], "%d", &val) != 1)
|
||||
usage();
|
||||
usage();
|
||||
cinfo->desired_number_of_colors = val;
|
||||
cinfo->quantize_colors = TRUE;
|
||||
|
||||
} else if (keymatch(arg, "dct", 2)) {
|
||||
/* Select IDCT algorithm. */
|
||||
if (++argn >= argc) /* advance to next argument */
|
||||
usage();
|
||||
if (++argn >= argc) /* advance to next argument */
|
||||
usage();
|
||||
if (keymatch(argv[argn], "int", 1)) {
|
||||
cinfo->dct_method = JDCT_ISLOW;
|
||||
cinfo->dct_method = JDCT_ISLOW;
|
||||
} else if (keymatch(argv[argn], "fast", 2)) {
|
||||
cinfo->dct_method = JDCT_IFAST;
|
||||
cinfo->dct_method = JDCT_IFAST;
|
||||
} else if (keymatch(argv[argn], "float", 2)) {
|
||||
cinfo->dct_method = JDCT_FLOAT;
|
||||
cinfo->dct_method = JDCT_FLOAT;
|
||||
} else
|
||||
usage();
|
||||
usage();
|
||||
|
||||
} else if (keymatch(arg, "dither", 2)) {
|
||||
/* Select dithering algorithm. */
|
||||
if (++argn >= argc) /* advance to next argument */
|
||||
usage();
|
||||
if (++argn >= argc) /* advance to next argument */
|
||||
usage();
|
||||
if (keymatch(argv[argn], "fs", 2)) {
|
||||
cinfo->dither_mode = JDITHER_FS;
|
||||
cinfo->dither_mode = JDITHER_FS;
|
||||
} else if (keymatch(argv[argn], "none", 2)) {
|
||||
cinfo->dither_mode = JDITHER_NONE;
|
||||
cinfo->dither_mode = JDITHER_NONE;
|
||||
} else if (keymatch(argv[argn], "ordered", 2)) {
|
||||
cinfo->dither_mode = JDITHER_ORDERED;
|
||||
cinfo->dither_mode = JDITHER_ORDERED;
|
||||
} else
|
||||
usage();
|
||||
usage();
|
||||
|
||||
} else if (keymatch(arg, "debug", 1) || keymatch(arg, "verbose", 1)) {
|
||||
/* Enable debug printouts. */
|
||||
@@ -251,21 +253,26 @@ parse_switches (j_decompress_ptr cinfo, int argc, char **argv,
|
||||
static boolean printed_version = FALSE;
|
||||
|
||||
if (! printed_version) {
|
||||
fprintf(stderr, "%s version %s (build %s)\n",
|
||||
PACKAGE_NAME, VERSION, BUILD);
|
||||
fprintf(stderr, "%s\n\n", JCOPYRIGHT);
|
||||
fprintf(stderr, "Emulating The Independent JPEG Group's software, version %s\n\n",
|
||||
JVERSION);
|
||||
printed_version = TRUE;
|
||||
fprintf(stderr, "%s version %s (build %s)\n",
|
||||
PACKAGE_NAME, VERSION, BUILD);
|
||||
fprintf(stderr, "%s\n\n", JCOPYRIGHT);
|
||||
fprintf(stderr, "Emulating The Independent JPEG Group's software, version %s\n\n",
|
||||
JVERSION);
|
||||
printed_version = TRUE;
|
||||
}
|
||||
cinfo->err->trace_level++;
|
||||
|
||||
} else if (keymatch(arg, "version", 4)) {
|
||||
fprintf(stderr, "%s version %s (build %s)\n",
|
||||
PACKAGE_NAME, VERSION, BUILD);
|
||||
exit(EXIT_SUCCESS);
|
||||
|
||||
} else if (keymatch(arg, "fast", 1)) {
|
||||
/* Select recommended processing options for quick-and-dirty output. */
|
||||
cinfo->two_pass_quantize = FALSE;
|
||||
cinfo->dither_mode = JDITHER_ORDERED;
|
||||
if (! cinfo->quantize_colors) /* don't override an earlier -colors */
|
||||
cinfo->desired_number_of_colors = 216;
|
||||
cinfo->desired_number_of_colors = 216;
|
||||
cinfo->dct_method = JDCT_FASTEST;
|
||||
cinfo->do_fancy_upsampling = FALSE;
|
||||
|
||||
@@ -281,23 +288,27 @@ parse_switches (j_decompress_ptr cinfo, int argc, char **argv,
|
||||
/* Force RGB output. */
|
||||
cinfo->out_color_space = JCS_RGB;
|
||||
|
||||
} else if (keymatch(arg, "rgb565", 2)) {
|
||||
/* Force RGB565 output. */
|
||||
cinfo->out_color_space = JCS_RGB565;
|
||||
|
||||
} else if (keymatch(arg, "map", 3)) {
|
||||
/* Quantize to a color map taken from an input file. */
|
||||
if (++argn >= argc) /* advance to next argument */
|
||||
usage();
|
||||
if (for_real) { /* too expensive to do twice! */
|
||||
#ifdef QUANT_2PASS_SUPPORTED /* otherwise can't quantize to supplied map */
|
||||
FILE * mapfile;
|
||||
if (++argn >= argc) /* advance to next argument */
|
||||
usage();
|
||||
if (for_real) { /* too expensive to do twice! */
|
||||
#ifdef QUANT_2PASS_SUPPORTED /* otherwise can't quantize to supplied map */
|
||||
FILE * mapfile;
|
||||
|
||||
if ((mapfile = fopen(argv[argn], READ_BINARY)) == NULL) {
|
||||
fprintf(stderr, "%s: can't open %s\n", progname, argv[argn]);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
read_color_map(cinfo, mapfile);
|
||||
fclose(mapfile);
|
||||
cinfo->quantize_colors = TRUE;
|
||||
if ((mapfile = fopen(argv[argn], READ_BINARY)) == NULL) {
|
||||
fprintf(stderr, "%s: can't open %s\n", progname, argv[argn]);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
read_color_map(cinfo, mapfile);
|
||||
fclose(mapfile);
|
||||
cinfo->quantize_colors = TRUE;
|
||||
#else
|
||||
ERREXIT(cinfo, JERR_NOT_COMPILED);
|
||||
ERREXIT(cinfo, JERR_NOT_COMPILED);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -306,12 +317,12 @@ parse_switches (j_decompress_ptr cinfo, int argc, char **argv,
|
||||
long lval;
|
||||
char ch = 'x';
|
||||
|
||||
if (++argn >= argc) /* advance to next argument */
|
||||
usage();
|
||||
if (++argn >= argc) /* advance to next argument */
|
||||
usage();
|
||||
if (sscanf(argv[argn], "%ld%c", &lval, &ch) < 1)
|
||||
usage();
|
||||
usage();
|
||||
if (ch == 'm' || ch == 'M')
|
||||
lval *= 1000L;
|
||||
lval *= 1000L;
|
||||
cinfo->mem->max_memory_to_use = lval * 1000L;
|
||||
|
||||
} else if (keymatch(arg, "nosmooth", 3)) {
|
||||
@@ -328,9 +339,9 @@ parse_switches (j_decompress_ptr cinfo, int argc, char **argv,
|
||||
|
||||
} else if (keymatch(arg, "outfile", 4)) {
|
||||
/* Set output file name. */
|
||||
if (++argn >= argc) /* advance to next argument */
|
||||
usage();
|
||||
outfilename = argv[argn]; /* save it away for later use */
|
||||
if (++argn >= argc) /* advance to next argument */
|
||||
usage();
|
||||
outfilename = argv[argn]; /* save it away for later use */
|
||||
|
||||
} else if (keymatch(arg, "memsrc", 2)) {
|
||||
/* Use in-memory source manager */
|
||||
@@ -352,22 +363,22 @@ parse_switches (j_decompress_ptr cinfo, int argc, char **argv,
|
||||
|
||||
} else if (keymatch(arg, "scale", 1)) {
|
||||
/* Scale the output image by a fraction M/N. */
|
||||
if (++argn >= argc) /* advance to next argument */
|
||||
usage();
|
||||
if (++argn >= argc) /* advance to next argument */
|
||||
usage();
|
||||
if (sscanf(argv[argn], "%d/%d",
|
||||
&cinfo->scale_num, &cinfo->scale_denom) != 2)
|
||||
usage();
|
||||
&cinfo->scale_num, &cinfo->scale_denom) != 2)
|
||||
usage();
|
||||
|
||||
} else if (keymatch(arg, "targa", 1)) {
|
||||
/* Targa output format. */
|
||||
requested_fmt = FMT_TARGA;
|
||||
|
||||
} else {
|
||||
usage(); /* bogus switch */
|
||||
usage(); /* bogus switch */
|
||||
}
|
||||
}
|
||||
|
||||
return argn; /* return index of next arg (file name) */
|
||||
return argn; /* return index of next arg (file name) */
|
||||
}
|
||||
|
||||
|
||||
@@ -403,14 +414,14 @@ print_text_marker (j_decompress_ptr cinfo)
|
||||
|
||||
length = jpeg_getc(cinfo) << 8;
|
||||
length += jpeg_getc(cinfo);
|
||||
length -= 2; /* discount the length word itself */
|
||||
length -= 2; /* discount the length word itself */
|
||||
|
||||
if (traceit) {
|
||||
if (cinfo->unread_marker == JPEG_COM)
|
||||
fprintf(stderr, "Comment, length %ld:\n", (long) length);
|
||||
else /* assume it is an APPn otherwise */
|
||||
else /* assume it is an APPn otherwise */
|
||||
fprintf(stderr, "APP%d, length %ld:\n",
|
||||
cinfo->unread_marker - JPEG_APP0, (long) length);
|
||||
cinfo->unread_marker - JPEG_APP0, (long) length);
|
||||
}
|
||||
|
||||
while (--length >= 0) {
|
||||
@@ -422,16 +433,16 @@ print_text_marker (j_decompress_ptr cinfo)
|
||||
* Newlines in CR, CR/LF, or LF form will be printed as one newline.
|
||||
*/
|
||||
if (ch == '\r') {
|
||||
fprintf(stderr, "\n");
|
||||
fprintf(stderr, "\n");
|
||||
} else if (ch == '\n') {
|
||||
if (lastch != '\r')
|
||||
fprintf(stderr, "\n");
|
||||
if (lastch != '\r')
|
||||
fprintf(stderr, "\n");
|
||||
} else if (ch == '\\') {
|
||||
fprintf(stderr, "\\\\");
|
||||
fprintf(stderr, "\\\\");
|
||||
} else if (isprint(ch)) {
|
||||
putc(ch, stderr);
|
||||
putc(ch, stderr);
|
||||
} else {
|
||||
fprintf(stderr, "\\%03o", ch);
|
||||
fprintf(stderr, "\\%03o", ch);
|
||||
}
|
||||
lastch = ch;
|
||||
}
|
||||
@@ -471,7 +482,7 @@ main (int argc, char **argv)
|
||||
|
||||
progname = argv[0];
|
||||
if (progname == NULL || progname[0] == 0)
|
||||
progname = "djpeg"; /* in case C library doesn't provide it */
|
||||
progname = "djpeg"; /* in case C library doesn't provide it */
|
||||
|
||||
/* Initialize the JPEG decompression object with default error handling. */
|
||||
cinfo.err = jpeg_std_error(&jerr);
|
||||
@@ -490,11 +501,6 @@ main (int argc, char **argv)
|
||||
jpeg_set_marker_processor(&cinfo, JPEG_COM, print_text_marker);
|
||||
jpeg_set_marker_processor(&cinfo, JPEG_APP0+12, print_text_marker);
|
||||
|
||||
/* Now safe to enable signal catcher. */
|
||||
#ifdef NEED_SIGNAL_CATCHER
|
||||
enable_signal_catcher((j_common_ptr) &cinfo);
|
||||
#endif
|
||||
|
||||
/* Scan command line to find file names. */
|
||||
/* It is convenient to use just one switch-parsing routine, but the switch
|
||||
* values read here are ignored; we will rescan the switches after opening
|
||||
@@ -510,14 +516,14 @@ main (int argc, char **argv)
|
||||
if (outfilename == NULL) {
|
||||
if (file_index != argc-2) {
|
||||
fprintf(stderr, "%s: must name one input and one output file\n",
|
||||
progname);
|
||||
progname);
|
||||
usage();
|
||||
}
|
||||
outfilename = argv[file_index+1];
|
||||
} else {
|
||||
if (file_index != argc-1) {
|
||||
fprintf(stderr, "%s: must name one input and one output file\n",
|
||||
progname);
|
||||
progname);
|
||||
usage();
|
||||
}
|
||||
}
|
||||
@@ -634,7 +640,7 @@ main (int argc, char **argv)
|
||||
/* Process data */
|
||||
while (cinfo.output_scanline < cinfo.output_height) {
|
||||
num_scanlines = jpeg_read_scanlines(&cinfo, dest_mgr->buffer,
|
||||
dest_mgr->buffer_height);
|
||||
dest_mgr->buffer_height);
|
||||
(*dest_mgr->put_pixel_rows) (&cinfo, dest_mgr, num_scanlines);
|
||||
}
|
||||
|
||||
@@ -668,5 +674,5 @@ main (int argc, char **argv)
|
||||
|
||||
/* All done. */
|
||||
exit(jerr.num_warnings ? EXIT_WARNING : EXIT_SUCCESS);
|
||||
return 0; /* suppress no-return-value warnings */
|
||||
return 0; /* suppress no-return-value warnings */
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
$(document).ready(function() { searchBox.OnSelectItem(0); });
|
||||
</script>
|
||||
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||
<link href="doxygen-extra.css" rel="stylesheet" type="text/css"/>
|
||||
</head>
|
||||
<body>
|
||||
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
$(document).ready(function() { searchBox.OnSelectItem(0); });
|
||||
</script>
|
||||
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||
<link href="doxygen-extra.css" rel="stylesheet" type="text/css"/>
|
||||
</head>
|
||||
<body>
|
||||
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||
|
||||
3
doc/html/doxygen-extra.css
Normal file
3
doc/html/doxygen-extra.css
Normal file
@@ -0,0 +1,3 @@
|
||||
code {
|
||||
color: #4665A2;
|
||||
}
|
||||
@@ -14,6 +14,7 @@
|
||||
$(document).ready(function() { searchBox.OnSelectItem(0); });
|
||||
</script>
|
||||
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||
<link href="doxygen-extra.css" rel="stylesheet" type="text/css"/>
|
||||
</head>
|
||||
<body>
|
||||
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
$(document).ready(function() { searchBox.OnSelectItem(0); });
|
||||
</script>
|
||||
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||
<link href="doxygen-extra.css" rel="stylesheet" type="text/css"/>
|
||||
</head>
|
||||
<body>
|
||||
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
$(document).ready(function() { searchBox.OnSelectItem(0); });
|
||||
</script>
|
||||
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||
<link href="doxygen-extra.css" rel="stylesheet" type="text/css"/>
|
||||
</head>
|
||||
<body>
|
||||
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||
@@ -231,15 +232,30 @@ Functions</h2></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: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>
|
||||
<tr class="memitem:gaf451664a62c1f6c7cc5a6401f32908c9"><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#gaf451664a62c1f6c7cc5a6401f32908c9">tjBufSizeYUV2</a> (int width, int pad, int height, int subsamp)</td></tr>
|
||||
<tr class="memdesc:gaf451664a62c1f6c7cc5a6401f32908c9"><td class="mdescLeft"> </td><td class="mdescRight">The size of the buffer (in bytes) required to hold a YUV planar image with the given parameters. <a href="#gaf451664a62c1f6c7cc5a6401f32908c9">More...</a><br/></td></tr>
|
||||
<tr class="separator:gaf451664a62c1f6c7cc5a6401f32908c9"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:ga6f98d977bfa9d167c97172e876ba61e2"><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#ga6f98d977bfa9d167c97172e876ba61e2">tjPlaneSizeYUV</a> (int componentID, int width, int stride, int height, int subsamp)</td></tr>
|
||||
<tr class="memdesc:ga6f98d977bfa9d167c97172e876ba61e2"><td class="mdescLeft"> </td><td class="mdescRight">The size of the buffer (in bytes) required to hold a YUV image plane with the given parameters. <a href="#ga6f98d977bfa9d167c97172e876ba61e2">More...</a><br/></td></tr>
|
||||
<tr class="separator:ga6f98d977bfa9d167c97172e876ba61e2"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:ga63fb66bb1e36c74008c4634360becbb1"><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#ga63fb66bb1e36c74008c4634360becbb1">tjPlaneWidth</a> (int componentID, int width, int subsamp)</td></tr>
|
||||
<tr class="memdesc:ga63fb66bb1e36c74008c4634360becbb1"><td class="mdescLeft"> </td><td class="mdescRight">The plane width of a YUV image plane with the given parameters. <a href="#ga63fb66bb1e36c74008c4634360becbb1">More...</a><br/></td></tr>
|
||||
<tr class="separator:ga63fb66bb1e36c74008c4634360becbb1"><td class="memSeparator" colspan="2"> </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: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>
|
||||
@@ -255,6 +271,15 @@ Functions</h2></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: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>
|
||||
@@ -297,7 +322,12 @@ Variables</h2></td></tr>
|
||||
</table>
|
||||
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
|
||||
<p>TurboJPEG API. </p>
|
||||
<p>This API provides an interface for generating, decoding, and transforming planar YUV and JPEG images in memory. </p>
|
||||
<p>This API provides an interface for generating, decoding, and transforming planar YUV and JPEG images in memory.</p>
|
||||
<p><a class="anchor" id="YUVnotes"></a></p>
|
||||
<h2>YUV Image Format Notes</h2>
|
||||
<p>Technically, the JPEG format uses the YCbCr colorspace (which is technically not a colorspace but a color transform), but per the convention of the digital video community, the TurboJPEG API uses "YUV" to refer to an image format consisting of Y, Cb, and Cr image planes.</p>
|
||||
<p>Each plane is simply a 2D array of bytes, each byte representing the value of one of the components (Y, Cb, or Cr) at a particular location in the image. The width and height of each plane are determined by the image width, height, and level of chrominance subsampling. The luminance plane width is the image width padded to the nearest multiple of the horizontal subsampling factor (2 in the case of 4:2:0 and 4:2:2, 4 in the case of 4:1:1, 1 in the case of 4:4:4 or grayscale.) Similarly, the luminance plane height is the image height padded to the nearest multiple of the vertical subsampling factor (2 in the case of 4:2:0 or 4:4:0, 1 in the case of 4:4:4 or grayscale.) This is irrespective of any additional padding that may be specified as an argument to the various YUV functions. The chrominance plane width is equal to the luminance plane width divided by the horizontal subsampling factor, and the chrominance plane height is equal to the luminance plane height divided by the vertical subsampling factor.</p>
|
||||
<p>For example, if the source image is 35 x 35 pixels and 4:2:2 subsampling is used, then the luminance plane would be 36 x 35 bytes, and each of the chrominance planes would be 18 x 35 bytes. If you specify a line padding of 4 bytes on top of this, then the luminance plane would be 36 x 35 bytes, and each of the chrominance planes would be 20 x 35 bytes. </p>
|
||||
<h2 class="groupheader">Macro Definition Documentation</h2>
|
||||
<a class="anchor" id="ga39f57a6fb02d9cf32e7b6890099b5a71"></a>
|
||||
<div class="memitem">
|
||||
@@ -690,7 +720,6 @@ Variables</h2></td></tr>
|
||||
|
||||
<p>Chrominance subsampling options. </p>
|
||||
<p>When pixels are converted from RGB to YCbCr (see <a class="el" href="group___turbo_j_p_e_g.html#gga4f83ad3368e0e29d1957be0efa7c3720a7389b8f65bb387ffedce3efd0d78ec75" title="YCbCr colorspace.">TJCS_YCbCr</a>) or from CMYK to YCCK (see <a class="el" href="group___turbo_j_p_e_g.html#gga4f83ad3368e0e29d1957be0efa7c3720a53839e0fe867b76b58d16b0a1a7c598e" title="YCCK colorspace.">TJCS_YCCK</a>) as part of the JPEG compression process, some of the Cb and Cr (chrominance) components can be discarded or averaged together to produce a smaller image with little perceptible loss of image clarity (the human eye is more sensitive to small changes in brightness than to small changes in color.) This is called "chrominance subsampling". </p>
|
||||
<p>NOTE: Technically, the JPEG format uses the YCbCr colorspace, but per the convention of the digital video community, the TurboJPEG API uses "YUV" to refer to an image format consisting of Y, Cb, and Cr image planes. </p>
|
||||
<table class="fieldtable">
|
||||
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><em><a class="anchor" id="gga1d047060ea80bb9820d540bb928e9074afb8da4f44197837bdec0a4f593dacae3"></a>TJSAMP_444</em> </td><td class="fielddoc">
|
||||
<p>4:4:4 chrominance subsampling (no chrominance subsampling). </p>
|
||||
@@ -710,11 +739,13 @@ Variables</h2></td></tr>
|
||||
</td></tr>
|
||||
<tr><td class="fieldname"><em><a class="anchor" id="gga1d047060ea80bb9820d540bb928e9074accf740e6f3aa6ba20ba922cad13cb974"></a>TJSAMP_440</em> </td><td class="fielddoc">
|
||||
<p>4:4:0 chrominance subsampling. </p>
|
||||
<p>The JPEG or YUV image will contain one chrominance component for every 1x2 block of pixels in the source image. Note that 4:4:0 subsampling is not fully accelerated in libjpeg-turbo. </p>
|
||||
<p>The JPEG or YUV image will contain one chrominance component for every 1x2 block of pixels in the source image.</p>
|
||||
<dl class="section note"><dt>Note</dt><dd>4:4:0 subsampling is not fully accelerated in libjpeg-turbo. </dd></dl>
|
||||
</td></tr>
|
||||
<tr><td class="fieldname"><em><a class="anchor" id="gga1d047060ea80bb9820d540bb928e9074a28ec62575e5ea295c3fde3001dc628e2"></a>TJSAMP_411</em> </td><td class="fielddoc">
|
||||
<p>4:1:1 chrominance subsampling. </p>
|
||||
<p>The JPEG or YUV image will contain one chrominance component for every 4x1 block of pixels in the source image. JPEG images compressed with 4:1:1 subsampling will be almost exactly the same size as those compressed with 4:2:0 subsampling, and in the aggregate, both subsampling methods produce approximately the same perceptual quality. However, 4:1:1 is better able to reproduce sharp horizontal features. Note that 4:1:1 subsampling is not fully accelerated in libjpeg-turbo. </p>
|
||||
<p>The JPEG or YUV image will contain one chrominance component for every 4x1 block of pixels in the source image. JPEG images compressed with 4:1:1 subsampling will be almost exactly the same size as those compressed with 4:2:0 subsampling, and in the aggregate, both subsampling methods produce approximately the same perceptual quality. However, 4:1:1 is better able to reproduce sharp horizontal features.</p>
|
||||
<dl class="section note"><dt>Note</dt><dd>4:1:1 subsampling is not fully accelerated in libjpeg-turbo. </dd></dl>
|
||||
</td></tr>
|
||||
</table>
|
||||
|
||||
@@ -788,7 +819,7 @@ Variables</h2></td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>a pointer to a newly-allocated buffer with the specified number of bytes</dd></dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>a pointer to a newly-allocated buffer with the specified number of bytes.</dd></dl>
|
||||
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="group___turbo_j_p_e_g.html#ga8c4a1231dc06a450514c835f6471f137" title="Free an image buffer previously allocated by TurboJPEG.">tjFree()</a> </dd></dl>
|
||||
|
||||
</div>
|
||||
@@ -827,8 +858,8 @@ Variables</h2></td></tr>
|
||||
<p>The number of bytes returned by this function is larger than the size of the uncompressed source image. The reason for this is that the JPEG format uses 16-bit coefficients, and it is thus possible for a very high-quality JPEG image with very high-frequency content to expand rather than compress when converted to the JPEG format. Such images represent a very rare corner case, but since there is no way to predict the size of a JPEG image prior to compression, the corner case has to be handled.</p>
|
||||
<dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramname">width</td><td>width of the image (in pixels) </td></tr>
|
||||
<tr><td class="paramname">height</td><td>height of the image (in pixels) </td></tr>
|
||||
<tr><td class="paramname">width</td><td>width (in pixels) of the image</td></tr>
|
||||
<tr><td class="paramname">height</td><td>height (in pixels) of the image</td></tr>
|
||||
<tr><td class="paramname">jpegSubsamp</td><td>the level of chrominance subsampling to be used when generating the JPEG image (see <a class="el" href="group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074">Chrominance subsampling options</a>.)</td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
@@ -876,9 +907,9 @@ Variables</h2></td></tr>
|
||||
<p>The size of the buffer (in bytes) required to hold a YUV planar image with the given parameters. </p>
|
||||
<dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramname">width</td><td>width of the image (in pixels) </td></tr>
|
||||
<tr><td class="paramname">pad</td><td>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.) </td></tr>
|
||||
<tr><td class="paramname">height</td><td>height of the image (in pixels) </td></tr>
|
||||
<tr><td class="paramname">width</td><td>width (in pixels) of the image</td></tr>
|
||||
<tr><td class="paramname">pad</td><td>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.)</td></tr>
|
||||
<tr><td class="paramname">height</td><td>height (in pixels) of the image</td></tr>
|
||||
<tr><td class="paramname">subsamp</td><td>level of chrominance subsampling in the image (see <a class="el" href="group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074">Chrominance subsampling options</a>.)</td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
@@ -968,22 +999,22 @@ Variables</h2></td></tr>
|
||||
<p>Compress an RGB, grayscale, or CMYK image into a JPEG image. </p>
|
||||
<dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramname">handle</td><td>a handle to a TurboJPEG compressor or transformer instance </td></tr>
|
||||
<tr><td class="paramname">srcBuf</td><td>pointer to an image buffer containing RGB, grayscale, or CMYK pixels to be compressed </td></tr>
|
||||
<tr><td class="paramname">width</td><td>width (in pixels) of the source image </td></tr>
|
||||
<tr><td class="paramname">pitch</td><td>bytes per line of the source image. Normally, this should be <code>width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code> if the image is unpadded, or <code><a class="el" href="group___turbo_j_p_e_g.html#ga0aba955473315e405295d978f0c16511" title="Pad the given width to the nearest 32-bit boundary.">TJPAD</a>(width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat])</code> if each line of the image is padded to the nearest 32-bit boundary, as is the case for Windows bitmaps. You can also be clever and use this parameter to skip lines, etc. Setting this parameter to 0 is the equivalent of setting it to <code>width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code>. </td></tr>
|
||||
<tr><td class="paramname">height</td><td>height (in pixels) of the source image </td></tr>
|
||||
<tr><td class="paramname">pixelFormat</td><td>pixel format of the source image (see <a class="el" href="group___turbo_j_p_e_g.html#gac916144e26c3817ac514e64ae5d12e2a">Pixel formats</a>.) </td></tr>
|
||||
<tr><td class="paramname">handle</td><td>a handle to a TurboJPEG compressor or transformer instance</td></tr>
|
||||
<tr><td class="paramname">srcBuf</td><td>pointer to an image buffer containing RGB, grayscale, or CMYK pixels to be compressed</td></tr>
|
||||
<tr><td class="paramname">width</td><td>width (in pixels) of the source image</td></tr>
|
||||
<tr><td class="paramname">pitch</td><td>bytes per line in the source image. Normally, this should be <code>width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code> if the image is unpadded, or <code><a class="el" href="group___turbo_j_p_e_g.html#ga0aba955473315e405295d978f0c16511" title="Pad the given width to the nearest 32-bit boundary.">TJPAD</a>(width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat])</code> if each line of the image is padded to the nearest 32-bit boundary, as is the case for Windows bitmaps. You can also be clever and use this parameter to skip lines, etc. Setting this parameter to 0 is the equivalent of setting it to <code>width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code>.</td></tr>
|
||||
<tr><td class="paramname">height</td><td>height (in pixels) of the source image</td></tr>
|
||||
<tr><td class="paramname">pixelFormat</td><td>pixel format of the source image (see <a class="el" href="group___turbo_j_p_e_g.html#gac916144e26c3817ac514e64ae5d12e2a">Pixel formats</a>.)</td></tr>
|
||||
<tr><td class="paramname">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>
|
||||
</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.) </td></tr>
|
||||
<tr><td class="paramname">jpegSubsamp</td><td>the level of chrominance subsampling to be used when generating the JPEG image (see <a class="el" href="group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074">Chrominance subsampling options</a>.) </td></tr>
|
||||
<tr><td class="paramname">jpegQual</td><td>the image quality of the generated JPEG image (1 = worst, 100 = best) </td></tr>
|
||||
<tr><td class="paramname">flags</td><td>the bitwise OR of one or more of the <a class="el" href="group___turbo_j_p_e_g.html#ga72ecf4ebe6eb702d3c6f5ca27455e1ec">flags</a>.</td></tr>
|
||||
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>
|
||||
<tr><td class="paramname">jpegSubsamp</td><td>the level of chrominance subsampling to be used when generating the JPEG image (see <a class="el" href="group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074">Chrominance subsampling options</a>.)</td></tr>
|
||||
<tr><td class="paramname">jpegQual</td><td>the image quality of the generated JPEG image (1 = worst, 100 = best)</td></tr>
|
||||
<tr><td class="paramname">flags</td><td>the bitwise OR of one or more of the <a class="el" href="group___turbo_j_p_e_g.html#ga72ecf4ebe6eb702d3c6f5ca27455e1ec">flags</a></td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
@@ -1066,21 +1097,304 @@ If you choose option 1, <code>*jpegSize</code> should be set to the size of your
|
||||
<p>Compress a YUV planar image into a JPEG image. </p>
|
||||
<dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramname">handle</td><td>a handle to a TurboJPEG compressor or transformer instance </td></tr>
|
||||
<tr><td class="paramname">srcBuf</td><td>pointer to an image buffer containing a YUV planar image to be compressed. The Y, U (Cb), and V (Cr) image planes should be stored sequentially in the buffer, and the size of each plane is determined by the specified width, height, padding, and level of chrominance subsampling. If the chrominance components are subsampled along the horizontal dimension, then the width of the luminance plane should be padded to the nearest multiple of 2 (same goes for the height of the luminance plane, if the chrominance components are subsampled along the vertical dimension.) This is irrespective of any additional padding specified in the <code>pad</code> parameter. </td></tr>
|
||||
<tr><td class="paramname">width</td><td>width (in pixels) of the source image </td></tr>
|
||||
<tr><td class="paramname">pad</td><td>the line padding used in the source image. For instance, if each line in each plane of the YUV image is padded to the nearest multiple of 4 bytes, then <code>pad</code> should be set to 4. </td></tr>
|
||||
<tr><td class="paramname">height</td><td>height (in pixels) of the source image </td></tr>
|
||||
<tr><td class="paramname">subsamp</td><td>the level of chrominance subsampling used in the source image (see <a class="el" href="group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074">Chrominance subsampling options</a>.) </td></tr>
|
||||
<tr><td class="paramname">handle</td><td>a handle to a TurboJPEG compressor or transformer instance</td></tr>
|
||||
<tr><td class="paramname">srcBuf</td><td>pointer to an image buffer containing a YUV planar image to be compressed. The size of this buffer should match the value returned by <a class="el" href="group___turbo_j_p_e_g.html#gaf451664a62c1f6c7cc5a6401f32908c9" title="The size of the buffer (in bytes) required to hold a YUV planar image with the given parameters...">tjBufSizeYUV2()</a> for the given image width, height, padding, and level of chrominance subsampling. The Y, U (Cb), and V (Cr) image planes should be stored sequentially in the source buffer (refer to <a class="el" href="group___turbo_j_p_e_g.html#YUVnotes">YUV Image Format Notes</a>.)</td></tr>
|
||||
<tr><td class="paramname">width</td><td>width (in pixels) of the source image. If the width is not an even multiple of the MCU block width (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>), then an intermediate buffer copy will be performed within TurboJPEG.</td></tr>
|
||||
<tr><td class="paramname">pad</td><td>the line padding used in the source image. For instance, if each line in each plane of the YUV image is padded to the nearest multiple of 4 bytes, then <code>pad</code> should be set to 4.</td></tr>
|
||||
<tr><td class="paramname">height</td><td>height (in pixels) of the source image. If the height is not an even multiple of the MCU block height (see <a class="el" href="group___turbo_j_p_e_g.html#gabd247bb9fecb393eca57366feb8327bf" title="MCU block height (in pixels) for a given level of chrominance subsampling.">tjMCUHeight</a>), then an intermediate buffer copy will be performed within TurboJPEG.</td></tr>
|
||||
<tr><td class="paramname">subsamp</td><td>the level of chrominance subsampling used in the source image (see <a class="el" href="group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074">Chrominance subsampling options</a>.)</td></tr>
|
||||
<tr><td class="paramname">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>
|
||||
</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.) </td></tr>
|
||||
<tr><td class="paramname">jpegQual</td><td>the image quality of the generated JPEG image (1 = worst, 100 = best) </td></tr>
|
||||
<tr><td class="paramname">flags</td><td>the bitwise OR of one or more of the <a class="el" href="group___turbo_j_p_e_g.html#ga72ecf4ebe6eb702d3c6f5ca27455e1ec">flags</a>.</td></tr>
|
||||
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>
|
||||
<tr><td class="paramname">jpegQual</td><td>the image quality of the generated JPEG image (1 = worst, 100 = best)</td></tr>
|
||||
<tr><td class="paramname">flags</td><td>the bitwise OR of one or more of the <a class="el" href="group___turbo_j_p_e_g.html#ga72ecf4ebe6eb702d3c6f5ca27455e1ec">flags</a></td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>0 if successful, or -1 if an error occurred (see <a class="el" href="group___turbo_j_p_e_g.html#ga9af79c908ec131b1ae8d52fe40375abf" title="Returns a descriptive error message explaining why the last command failed.">tjGetErrorStr()</a>.) </dd></dl>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<a class="anchor" id="gaa89a1982cb4556b12ae7af4439991af6"></a>
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<table class="memname">
|
||||
<tr>
|
||||
<td class="memname">DLLEXPORT int DLLCALL tjCompressFromYUVPlanes </td>
|
||||
<td>(</td>
|
||||
<td class="paramtype"><a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> </td>
|
||||
<td class="paramname"><em>handle</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">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="paramname"><em>width</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">int * </td>
|
||||
<td class="paramname"><em>strides</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">int </td>
|
||||
<td class="paramname"><em>height</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">int </td>
|
||||
<td class="paramname"><em>subsamp</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">unsigned char ** </td>
|
||||
<td class="paramname"><em>jpegBuf</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">unsigned long * </td>
|
||||
<td class="paramname"><em>jpegSize</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">int </td>
|
||||
<td class="paramname"><em>jpegQual</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">int </td>
|
||||
<td class="paramname"><em>flags</em> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>)</td>
|
||||
<td></td><td></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>Compress a set of Y, U (Cb), and V (Cr) image planes into a JPEG image. </p>
|
||||
<dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramname">handle</td><td>a handle to a TurboJPEG compressor or transformer instance</td></tr>
|
||||
<tr><td class="paramname">srcPlanes</td><td>an array of pointers to Y, U (Cb), and V (Cr) image planes (or just a Y plane, if compressing a grayscale image) that contain a YUV image to be compressed. These planes can be contiguous or non-contiguous in memory. The size of each plane should match the value returned by <a class="el" href="group___turbo_j_p_e_g.html#ga6f98d977bfa9d167c97172e876ba61e2" title="The size of the buffer (in bytes) required to hold a YUV image plane with the given parameters...">tjPlaneSizeYUV()</a> for the given image width, height, strides, and level of chrominance subsampling. Refer to <a class="el" href="group___turbo_j_p_e_g.html#YUVnotes">YUV Image Format Notes</a> for more details.</td></tr>
|
||||
<tr><td class="paramname">width</td><td>width (in pixels) of the source image. If the width is not an even multiple of the MCU block width (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>), then an intermediate buffer copy will be performed within TurboJPEG.</td></tr>
|
||||
<tr><td class="paramname">strides</td><td>an array of integers, each specifying the number of bytes per line in the corresponding plane of the YUV source image. Setting the stride for any plane to 0 is the same as setting it to the plane width (see <a class="el" href="group___turbo_j_p_e_g.html#YUVnotes">YUV Image Format Notes</a>.) If <code>strides</code> is NULL, then the strides for all planes will be set to their respective plane widths. You can adjust the strides in order to specify an arbitrary amount of line padding in each plane or to create a JPEG image from a subregion of a larger YUV planar image.</td></tr>
|
||||
<tr><td class="paramname">height</td><td>height (in pixels) of the source image. If the height is not an even multiple of the MCU block height (see <a class="el" href="group___turbo_j_p_e_g.html#gabd247bb9fecb393eca57366feb8327bf" title="MCU block height (in pixels) for a given level of chrominance subsampling.">tjMCUHeight</a>), then an intermediate buffer copy will be performed within TurboJPEG.</td></tr>
|
||||
<tr><td class="paramname">subsamp</td><td>the level of chrominance subsampling used in the source image (see <a class="el" href="group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074">Chrominance subsampling options</a>.)</td></tr>
|
||||
<tr><td class="paramname">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>
|
||||
</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>
|
||||
<tr><td class="paramname">jpegQual</td><td>the image quality of the generated JPEG image (1 = worst, 100 = best)</td></tr>
|
||||
<tr><td class="paramname">flags</td><td>the bitwise OR of one or more of the <a class="el" href="group___turbo_j_p_e_g.html#ga72ecf4ebe6eb702d3c6f5ca27455e1ec">flags</a></td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>0 if successful, or -1 if an error occurred (see <a class="el" href="group___turbo_j_p_e_g.html#ga9af79c908ec131b1ae8d52fe40375abf" title="Returns a descriptive error message explaining why the last command failed.">tjGetErrorStr()</a>.) </dd></dl>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<a class="anchor" id="ga132ae2c2cadcf64c8bb0f3bdf69da3ed"></a>
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<table class="memname">
|
||||
<tr>
|
||||
<td class="memname">DLLEXPORT int DLLCALL tjDecodeYUV </td>
|
||||
<td>(</td>
|
||||
<td class="paramtype"><a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> </td>
|
||||
<td class="paramname"><em>handle</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">unsigned char * </td>
|
||||
<td class="paramname"><em>srcBuf</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">int </td>
|
||||
<td class="paramname"><em>pad</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">int </td>
|
||||
<td class="paramname"><em>subsamp</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">unsigned char * </td>
|
||||
<td class="paramname"><em>dstBuf</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">int </td>
|
||||
<td class="paramname"><em>width</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">int </td>
|
||||
<td class="paramname"><em>pitch</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">int </td>
|
||||
<td class="paramname"><em>height</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">int </td>
|
||||
<td class="paramname"><em>pixelFormat</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">int </td>
|
||||
<td class="paramname"><em>flags</em> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>)</td>
|
||||
<td></td><td></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>Decode a YUV planar image into an RGB or grayscale image. </p>
|
||||
<p>This function uses the accelerated color conversion routines in the underlying codec but does not execute any of the other steps in the JPEG decompression process.</p>
|
||||
<dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramname">handle</td><td>a handle to a TurboJPEG decompressor or transformer instance</td></tr>
|
||||
<tr><td class="paramname">srcBuf</td><td>pointer to an image buffer containing a YUV planar image to be decoded. The size of this buffer should match the value returned by <a class="el" href="group___turbo_j_p_e_g.html#gaf451664a62c1f6c7cc5a6401f32908c9" title="The size of the buffer (in bytes) required to hold a YUV planar image with the given parameters...">tjBufSizeYUV2()</a> for the given image width, height, padding, and level of chrominance subsampling. The Y, U (Cb), and V (Cr) image planes should be stored sequentially in the source buffer (refer to <a class="el" href="group___turbo_j_p_e_g.html#YUVnotes">YUV Image Format Notes</a>.)</td></tr>
|
||||
<tr><td class="paramname">pad</td><td>Use this parameter to specify that the width of each line in each plane of the YUV source image is padded to the nearest multiple of this number of bytes (must be a power of 2.)</td></tr>
|
||||
<tr><td class="paramname">subsamp</td><td>the level of chrominance subsampling used in the YUV source image (see <a class="el" href="group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074">Chrominance subsampling options</a>.)</td></tr>
|
||||
<tr><td class="paramname">dstBuf</td><td>pointer to an image buffer that will receive the decoded image. This buffer should normally be <code>pitch * height</code> bytes in size, but the <code>dstBuf</code> pointer can also be used to decode into a specific region of a larger buffer.</td></tr>
|
||||
<tr><td class="paramname">width</td><td>width (in pixels) of the source and destination images</td></tr>
|
||||
<tr><td class="paramname">pitch</td><td>bytes per line in the destination image. Normally, this should be <code>width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code> if the destination image is unpadded, or <code><a class="el" href="group___turbo_j_p_e_g.html#ga0aba955473315e405295d978f0c16511" title="Pad the given width to the nearest 32-bit boundary.">TJPAD</a>(width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat])</code> if each line of the destination image should be padded to the nearest 32-bit boundary, as is the case for Windows bitmaps. You can also be clever and use the pitch parameter to skip lines, etc. Setting this parameter to 0 is the equivalent of setting it to <code>width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code>.</td></tr>
|
||||
<tr><td class="paramname">height</td><td>height (in pixels) of the source and destination images</td></tr>
|
||||
<tr><td class="paramname">pixelFormat</td><td>pixel format of the destination image (see <a class="el" href="group___turbo_j_p_e_g.html#gac916144e26c3817ac514e64ae5d12e2a">Pixel formats</a>.)</td></tr>
|
||||
<tr><td class="paramname">flags</td><td>the bitwise OR of one or more of the <a class="el" href="group___turbo_j_p_e_g.html#ga72ecf4ebe6eb702d3c6f5ca27455e1ec">flags</a></td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>0 if successful, or -1 if an error occurred (see <a class="el" href="group___turbo_j_p_e_g.html#ga9af79c908ec131b1ae8d52fe40375abf" title="Returns a descriptive error message explaining why the last command failed.">tjGetErrorStr()</a>.) </dd></dl>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<a class="anchor" id="ga6cb5b0e1101a2b20edea576e11faf93d"></a>
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<table class="memname">
|
||||
<tr>
|
||||
<td class="memname">DLLEXPORT int DLLCALL tjDecodeYUVPlanes </td>
|
||||
<td>(</td>
|
||||
<td class="paramtype"><a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> </td>
|
||||
<td class="paramname"><em>handle</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">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="paramname"><em>strides</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">int </td>
|
||||
<td class="paramname"><em>subsamp</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">unsigned char * </td>
|
||||
<td class="paramname"><em>dstBuf</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">int </td>
|
||||
<td class="paramname"><em>width</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">int </td>
|
||||
<td class="paramname"><em>pitch</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">int </td>
|
||||
<td class="paramname"><em>height</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">int </td>
|
||||
<td class="paramname"><em>pixelFormat</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">int </td>
|
||||
<td class="paramname"><em>flags</em> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>)</td>
|
||||
<td></td><td></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>Decode a set of Y, U (Cb), and V (Cr) image planes into an RGB or grayscale image. </p>
|
||||
<p>This function uses the accelerated color conversion routines in the underlying codec but does not execute any of the other steps in the JPEG decompression process.</p>
|
||||
<dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramname">handle</td><td>a handle to a TurboJPEG decompressor or transformer instance</td></tr>
|
||||
<tr><td class="paramname">srcPlanes</td><td>an array of pointers to Y, U (Cb), and V (Cr) image planes (or just a Y plane, if decoding a grayscale image) that contain a YUV image to be decoded. These planes can be contiguous or non-contiguous in memory. The size of each plane should match the value returned by <a class="el" href="group___turbo_j_p_e_g.html#ga6f98d977bfa9d167c97172e876ba61e2" title="The size of the buffer (in bytes) required to hold a YUV image plane with the given parameters...">tjPlaneSizeYUV()</a> for the given image width, height, strides, and level of chrominance subsampling. Refer to <a class="el" href="group___turbo_j_p_e_g.html#YUVnotes">YUV Image Format Notes</a> for more details.</td></tr>
|
||||
<tr><td class="paramname">strides</td><td>an array of integers, each specifying the number of bytes per line in the corresponding plane of the YUV source image. Setting the stride for any plane to 0 is the same as setting it to the plane width (see <a class="el" href="group___turbo_j_p_e_g.html#YUVnotes">YUV Image Format Notes</a>.) If <code>strides</code> is NULL, then the strides for all planes will be set to their respective plane widths. You can adjust the strides in order to specify an arbitrary amount of line padding in each plane or to decode a subregion of a larger YUV planar image.</td></tr>
|
||||
<tr><td class="paramname">subsamp</td><td>the level of chrominance subsampling used in the YUV source image (see <a class="el" href="group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074">Chrominance subsampling options</a>.)</td></tr>
|
||||
<tr><td class="paramname">dstBuf</td><td>pointer to an image buffer that will receive the decoded image. This buffer should normally be <code>pitch * height</code> bytes in size, but the <code>dstBuf</code> pointer can also be used to decode into a specific region of a larger buffer.</td></tr>
|
||||
<tr><td class="paramname">width</td><td>width (in pixels) of the source and destination images</td></tr>
|
||||
<tr><td class="paramname">pitch</td><td>bytes per line in the destination image. Normally, this should be <code>width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code> if the destination image is unpadded, or <code><a class="el" href="group___turbo_j_p_e_g.html#ga0aba955473315e405295d978f0c16511" title="Pad the given width to the nearest 32-bit boundary.">TJPAD</a>(width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat])</code> if each line of the destination image should be padded to the nearest 32-bit boundary, as is the case for Windows bitmaps. You can also be clever and use the pitch parameter to skip lines, etc. Setting this parameter to 0 is the equivalent of setting it to <code>width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code>.</td></tr>
|
||||
<tr><td class="paramname">height</td><td>height (in pixels) of the source and destination images</td></tr>
|
||||
<tr><td class="paramname">pixelFormat</td><td>pixel format of the destination image (see <a class="el" href="group___turbo_j_p_e_g.html#gac916144e26c3817ac514e64ae5d12e2a">Pixel formats</a>.)</td></tr>
|
||||
<tr><td class="paramname">flags</td><td>the bitwise OR of one or more of the <a class="el" href="group___turbo_j_p_e_g.html#ga72ecf4ebe6eb702d3c6f5ca27455e1ec">flags</a></td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
@@ -1157,15 +1471,15 @@ If you choose option 1, <code>*jpegSize</code> should be set to the size of your
|
||||
<p>Decompress a JPEG image to an RGB, grayscale, or CMYK image. </p>
|
||||
<dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramname">handle</td><td>a handle to a TurboJPEG decompressor or transformer instance </td></tr>
|
||||
<tr><td class="paramname">jpegBuf</td><td>pointer to a buffer containing the JPEG image to decompress </td></tr>
|
||||
<tr><td class="paramname">jpegSize</td><td>size of the JPEG image (in bytes) </td></tr>
|
||||
<tr><td class="paramname">dstBuf</td><td>pointer to an image buffer that will receive the decompressed image. This buffer should normally be <code>pitch * scaledHeight</code> bytes in size, where <code>scaledHeight</code> can be determined by calling <a class="el" href="group___turbo_j_p_e_g.html#ga84878bb65404204743aa18cac02781df" title="Compute the scaled value of dimension using the given scaling factor.">TJSCALED()</a> with the JPEG image height and one of the scaling factors returned by <a class="el" href="group___turbo_j_p_e_g.html#ga6449044b9af402999ccf52f401333be8" title="Returns a list of fractional scaling factors that the JPEG decompressor in this implementation of Tur...">tjGetScalingFactors()</a>. The <code>dstBuf</code> pointer may also be used to decompress into a specific region of a larger buffer. </td></tr>
|
||||
<tr><td class="paramname">width</td><td>desired width (in pixels) of the destination image. If this is different than the width of the JPEG image being decompressed, then TurboJPEG will use scaling in the JPEG decompressor to generate the largest possible image that will fit within the desired width. If <code>width</code> is set to 0, then only the height will be considered when determining the scaled image size. </td></tr>
|
||||
<tr><td class="paramname">pitch</td><td>bytes per line of the destination image. Normally, this is <code>scaledWidth * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code> if the decompressed image is unpadded, else <code><a class="el" href="group___turbo_j_p_e_g.html#ga0aba955473315e405295d978f0c16511" title="Pad the given width to the nearest 32-bit boundary.">TJPAD</a>(scaledWidth * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat])</code> if each line of the decompressed image is padded to the nearest 32-bit boundary, as is the case for Windows bitmaps. (NOTE: <code>scaledWidth</code> can be determined by calling <a class="el" href="group___turbo_j_p_e_g.html#ga84878bb65404204743aa18cac02781df" title="Compute the scaled value of dimension using the given scaling factor.">TJSCALED()</a> with the JPEG image width and one of the scaling factors returned by <a class="el" href="group___turbo_j_p_e_g.html#ga6449044b9af402999ccf52f401333be8" title="Returns a list of fractional scaling factors that the JPEG decompressor in this implementation of Tur...">tjGetScalingFactors()</a>.) You can also be clever and use the pitch parameter to skip lines, etc. Setting this parameter to 0 is the equivalent of setting it to <code>scaledWidth * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code>. </td></tr>
|
||||
<tr><td class="paramname">height</td><td>desired height (in pixels) of the destination image. If this is different than the height of the JPEG image being decompressed, then TurboJPEG will use scaling in the JPEG decompressor to generate the largest possible image that will fit within the desired height. If <code>height</code> is set to 0, then only the width will be considered when determining the scaled image size. </td></tr>
|
||||
<tr><td class="paramname">pixelFormat</td><td>pixel format of the destination image (see <a class="el" href="group___turbo_j_p_e_g.html#gac916144e26c3817ac514e64ae5d12e2a">Pixel formats</a>.) </td></tr>
|
||||
<tr><td class="paramname">flags</td><td>the bitwise OR of one or more of the <a class="el" href="group___turbo_j_p_e_g.html#ga72ecf4ebe6eb702d3c6f5ca27455e1ec">flags</a>.</td></tr>
|
||||
<tr><td class="paramname">handle</td><td>a handle to a TurboJPEG decompressor or transformer instance</td></tr>
|
||||
<tr><td class="paramname">jpegBuf</td><td>pointer to a buffer containing the JPEG image to decompress</td></tr>
|
||||
<tr><td class="paramname">jpegSize</td><td>size of the JPEG image (in bytes)</td></tr>
|
||||
<tr><td class="paramname">dstBuf</td><td>pointer to an image buffer that will receive the decompressed image. This buffer should normally be <code>pitch * scaledHeight</code> bytes in size, where <code>scaledHeight</code> can be determined by calling <a class="el" href="group___turbo_j_p_e_g.html#ga84878bb65404204743aa18cac02781df" title="Compute the scaled value of dimension using the given scaling factor.">TJSCALED()</a> with the JPEG image height and one of the scaling factors returned by <a class="el" href="group___turbo_j_p_e_g.html#ga6449044b9af402999ccf52f401333be8" title="Returns a list of fractional scaling factors that the JPEG decompressor in this implementation of Tur...">tjGetScalingFactors()</a>. The <code>dstBuf</code> pointer may also be used to decompress into a specific region of a larger buffer.</td></tr>
|
||||
<tr><td class="paramname">width</td><td>desired width (in pixels) of the destination image. If this is different than the width of the JPEG image being decompressed, then TurboJPEG will use scaling in the JPEG decompressor to generate the largest possible image that will fit within the desired width. If <code>width</code> is set to 0, then only the height will be considered when determining the scaled image size.</td></tr>
|
||||
<tr><td class="paramname">pitch</td><td>bytes per line in the destination image. Normally, this is <code>scaledWidth * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code> if the decompressed image is unpadded, else <code><a class="el" href="group___turbo_j_p_e_g.html#ga0aba955473315e405295d978f0c16511" title="Pad the given width to the nearest 32-bit boundary.">TJPAD</a>(scaledWidth * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat])</code> if each line of the decompressed image is padded to the nearest 32-bit boundary, as is the case for Windows bitmaps. (NOTE: <code>scaledWidth</code> can be determined by calling <a class="el" href="group___turbo_j_p_e_g.html#ga84878bb65404204743aa18cac02781df" title="Compute the scaled value of dimension using the given scaling factor.">TJSCALED()</a> with the JPEG image width and one of the scaling factors returned by <a class="el" href="group___turbo_j_p_e_g.html#ga6449044b9af402999ccf52f401333be8" title="Returns a list of fractional scaling factors that the JPEG decompressor in this implementation of Tur...">tjGetScalingFactors()</a>.) You can also be clever and use the pitch parameter to skip lines, etc. Setting this parameter to 0 is the equivalent of setting it to <code>scaledWidth * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code>.</td></tr>
|
||||
<tr><td class="paramname">height</td><td>desired height (in pixels) of the destination image. If this is different than the height of the JPEG image being decompressed, then TurboJPEG will use scaling in the JPEG decompressor to generate the largest possible image that will fit within the desired height. If <code>height</code> is set to 0, then only the width will be considered when determining the scaled image size.</td></tr>
|
||||
<tr><td class="paramname">pixelFormat</td><td>pixel format of the destination image (see <a class="el" href="group___turbo_j_p_e_g.html#gac916144e26c3817ac514e64ae5d12e2a">Pixel formats</a>.)</td></tr>
|
||||
<tr><td class="paramname">flags</td><td>the bitwise OR of one or more of the <a class="el" href="group___turbo_j_p_e_g.html#ga72ecf4ebe6eb702d3c6f5ca27455e1ec">flags</a></td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
@@ -1230,12 +1544,12 @@ If you choose option 1, <code>*jpegSize</code> should be set to the size of your
|
||||
<p>Retrieve information about a JPEG image without decompressing it. </p>
|
||||
<dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramname">handle</td><td>a handle to a TurboJPEG decompressor or transformer instance </td></tr>
|
||||
<tr><td class="paramname">jpegBuf</td><td>pointer to a buffer containing a JPEG image </td></tr>
|
||||
<tr><td class="paramname">jpegSize</td><td>size of the JPEG image (in bytes) </td></tr>
|
||||
<tr><td class="paramname">width</td><td>pointer to an integer variable that will receive the width (in pixels) of the JPEG image </td></tr>
|
||||
<tr><td class="paramname">height</td><td>pointer to an integer variable that will receive the height (in pixels) of the JPEG image </td></tr>
|
||||
<tr><td class="paramname">jpegSubsamp</td><td>pointer to an integer variable that will receive the level of chrominance subsampling used when compressing the JPEG image (see <a class="el" href="group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074">Chrominance subsampling options</a>.) </td></tr>
|
||||
<tr><td class="paramname">handle</td><td>a handle to a TurboJPEG decompressor or transformer instance</td></tr>
|
||||
<tr><td class="paramname">jpegBuf</td><td>pointer to a buffer containing a JPEG image</td></tr>
|
||||
<tr><td class="paramname">jpegSize</td><td>size of the JPEG image (in bytes)</td></tr>
|
||||
<tr><td class="paramname">width</td><td>pointer to an integer variable that will receive the width (in pixels) of the JPEG image</td></tr>
|
||||
<tr><td class="paramname">height</td><td>pointer to an integer variable that will receive the height (in pixels) of the JPEG image</td></tr>
|
||||
<tr><td class="paramname">jpegSubsamp</td><td>pointer to an integer variable that will receive the level of chrominance subsampling used when the JPEG image was compressed (see <a class="el" href="group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074">Chrominance subsampling options</a>.)</td></tr>
|
||||
<tr><td class="paramname">jpegColorspace</td><td>pointer to an integer variable that will receive one of the JPEG colorspace constants, indicating the colorspace of the JPEG image (see <a class="el" href="group___turbo_j_p_e_g.html#ga4f83ad3368e0e29d1957be0efa7c3720">JPEG colorspaces</a>.)</td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
@@ -1305,18 +1619,96 @@ If you choose option 1, <code>*jpegSize</code> should be set to the size of your
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>Decompress a JPEG image to a YUV planar image. </p>
|
||||
<p>This function performs JPEG decompression but leaves out the color conversion step, so a planar YUV image is generated instead of an RGB image. The structure of the planes in this image is the same as in the images generated by <a class="el" href="group___turbo_j_p_e_g.html#ga0a5ffbf7cb58a5b6a8201114fe889360" title="Encode an RGB or grayscale image into a YUV planar image.">tjEncodeYUV3()</a>. Note that, if the width or height of the JPEG image is not an even multiple of the MCU block size (see <a class="el" href="group___turbo_j_p_e_g.html#ga9e61e7cd47a15a173283ba94e781308c" title="MCU block width (in pixels) for a given level of chrominance subsampling.">tjMCUWidth</a> and <a class="el" href="group___turbo_j_p_e_g.html#gabd247bb9fecb393eca57366feb8327bf" title="MCU block height (in pixels) for a given level of chrominance subsampling.">tjMCUHeight</a>), then an intermediate buffer copy will be performed within TurboJPEG. </p>
|
||||
<p>NOTE: Technically, the JPEG format uses the YCbCr colorspace, but per the convention of the digital video community, the TurboJPEG API uses "YUV" to refer to an image format consisting of Y, Cb, and Cr image planes.</p>
|
||||
<p>This function performs JPEG decompression but leaves out the color conversion step, so a planar YUV image is generated instead of an RGB image.</p>
|
||||
<dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramname">handle</td><td>a handle to a TurboJPEG decompressor or transformer instance </td></tr>
|
||||
<tr><td class="paramname">jpegBuf</td><td>pointer to a buffer containing the JPEG image to decompress </td></tr>
|
||||
<tr><td class="paramname">jpegSize</td><td>size of the JPEG image (in bytes) </td></tr>
|
||||
<tr><td class="paramname">dstBuf</td><td>pointer to an image buffer that will receive the YUV image. Use <a class="el" href="group___turbo_j_p_e_g.html#gaf451664a62c1f6c7cc5a6401f32908c9" title="The size of the buffer (in bytes) required to hold a YUV planar image with the given parameters...">tjBufSizeYUV2()</a> to determine the appropriate size for this buffer based on the image width, height, padding, and level of subsampling. </td></tr>
|
||||
<tr><td class="paramname">width</td><td>desired width (in pixels) of the YUV image. If this is different than the width of the JPEG image being decompressed, then TurboJPEG will use scaling in the JPEG decompressor to generate the largest possible image that will fit within the desired width. If <code>width</code> is set to 0, then only the height will be considered when determining the scaled image size. </td></tr>
|
||||
<tr><td class="paramname">pad</td><td>the width of each line in each plane of the YUV image will be padded to the nearest multiple of this number of bytes (must be a power of 2.) To generate images suitable for X Video, <code>pad</code> should be set to 4. </td></tr>
|
||||
<tr><td class="paramname">height</td><td>desired height (in pixels) of the YUV image. If this is different than the height of the JPEG image being decompressed, then TurboJPEG will use scaling in the JPEG decompressor to generate the largest possible image that will fit within the desired height. If <code>height</code> is set to 0, then only the width will be considered when determining the scaled image size. </td></tr>
|
||||
<tr><td class="paramname">flags</td><td>the bitwise OR of one or more of the <a class="el" href="group___turbo_j_p_e_g.html#ga72ecf4ebe6eb702d3c6f5ca27455e1ec">flags</a>.</td></tr>
|
||||
<tr><td class="paramname">handle</td><td>a handle to a TurboJPEG decompressor or transformer instance</td></tr>
|
||||
<tr><td class="paramname">jpegBuf</td><td>pointer to a buffer containing the JPEG image to decompress</td></tr>
|
||||
<tr><td class="paramname">jpegSize</td><td>size of the JPEG image (in bytes)</td></tr>
|
||||
<tr><td class="paramname">dstBuf</td><td>pointer to an image buffer that will receive the YUV image. Use <a class="el" href="group___turbo_j_p_e_g.html#gaf451664a62c1f6c7cc5a6401f32908c9" title="The size of the buffer (in bytes) required to hold a YUV planar image with the given parameters...">tjBufSizeYUV2()</a> to determine the appropriate size for this buffer based on the image width, height, padding, and level of subsampling. The Y, U (Cb), and V (Cr) image planes will be stored sequentially in the buffer (refer to <a class="el" href="group___turbo_j_p_e_g.html#YUVnotes">YUV Image Format Notes</a>.)</td></tr>
|
||||
<tr><td class="paramname">width</td><td>desired width (in pixels) of the YUV image. If this is different than the width of the JPEG image being decompressed, then TurboJPEG will use scaling in the JPEG decompressor to generate the largest possible image that will fit within the desired width. If <code>width</code> is set to 0, then only the height will be considered when determining the scaled image size. If the scaled width is not an even multiple of the MCU block width (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>), then an intermediate buffer copy will be performed within TurboJPEG.</td></tr>
|
||||
<tr><td class="paramname">pad</td><td>the width of each line in each plane of the YUV image will be padded to the nearest multiple of this number of bytes (must be a power of 2.) To generate images suitable for X Video, <code>pad</code> should be set to 4.</td></tr>
|
||||
<tr><td class="paramname">height</td><td>desired height (in pixels) of the YUV image. If this is different than the height of the JPEG image being decompressed, then TurboJPEG will use scaling in the JPEG decompressor to generate the largest possible image that will fit within the desired height. If <code>height</code> is set to 0, then only the width will be considered when determining the scaled image size. If the scaled height is not an even multiple of the MCU block height (see <a class="el" href="group___turbo_j_p_e_g.html#gabd247bb9fecb393eca57366feb8327bf" title="MCU block height (in pixels) for a given level of chrominance subsampling.">tjMCUHeight</a>), then an intermediate buffer copy will be performed within TurboJPEG.</td></tr>
|
||||
<tr><td class="paramname">flags</td><td>the bitwise OR of one or more of the <a class="el" href="group___turbo_j_p_e_g.html#ga72ecf4ebe6eb702d3c6f5ca27455e1ec">flags</a></td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>0 if successful, or -1 if an error occurred (see <a class="el" href="group___turbo_j_p_e_g.html#ga9af79c908ec131b1ae8d52fe40375abf" title="Returns a descriptive error message explaining why the last command failed.">tjGetErrorStr()</a>.) </dd></dl>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<a class="anchor" id="ga0828a38ae29631ac28b6857cefb0eebf"></a>
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<table class="memname">
|
||||
<tr>
|
||||
<td class="memname">DLLEXPORT int DLLCALL tjDecompressToYUVPlanes </td>
|
||||
<td>(</td>
|
||||
<td class="paramtype"><a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> </td>
|
||||
<td class="paramname"><em>handle</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">unsigned char * </td>
|
||||
<td class="paramname"><em>jpegBuf</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">unsigned long </td>
|
||||
<td class="paramname"><em>jpegSize</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">unsigned char ** </td>
|
||||
<td class="paramname"><em>dstPlanes</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">int </td>
|
||||
<td class="paramname"><em>width</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">int * </td>
|
||||
<td class="paramname"><em>strides</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">int </td>
|
||||
<td class="paramname"><em>height</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">int </td>
|
||||
<td class="paramname"><em>flags</em> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>)</td>
|
||||
<td></td><td></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>Decompress a JPEG image into separate Y, U (Cb), and V (Cr) image planes. </p>
|
||||
<p>This function performs JPEG decompression but leaves out the color conversion step, so a planar YUV image is generated instead of an RGB image.</p>
|
||||
<dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramname">handle</td><td>a handle to a TurboJPEG decompressor or transformer instance</td></tr>
|
||||
<tr><td class="paramname">jpegBuf</td><td>pointer to a buffer containing the JPEG image to decompress</td></tr>
|
||||
<tr><td class="paramname">jpegSize</td><td>size of the JPEG image (in bytes)</td></tr>
|
||||
<tr><td class="paramname">dstPlanes</td><td>an array of pointers to Y, U (Cb), and V (Cr) image planes (or just a Y plane, if decompressing a grayscale image) that will receive the YUV image. These planes can be contiguous or non-contiguous in memory. Use <a class="el" href="group___turbo_j_p_e_g.html#ga6f98d977bfa9d167c97172e876ba61e2" title="The size of the buffer (in bytes) required to hold a YUV image plane with the given parameters...">tjPlaneSizeYUV()</a> to determine the appropriate size for each plane based on the scaled image width, scaled image height, strides, and level of chrominance subsampling. Refer to <a class="el" href="group___turbo_j_p_e_g.html#YUVnotes">YUV Image Format Notes</a> for more details.</td></tr>
|
||||
<tr><td class="paramname">width</td><td>desired width (in pixels) of the YUV image. If this is different than the width of the JPEG image being decompressed, then TurboJPEG will use scaling in the JPEG decompressor to generate the largest possible image that will fit within the desired width. If <code>width</code> is set to 0, then only the height will be considered when determining the scaled image size. If the scaled width is not an even multiple of the MCU block width (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>), then an intermediate buffer copy will be performed within TurboJPEG.</td></tr>
|
||||
<tr><td class="paramname">strides</td><td>an array of integers, each specifying the number of bytes per line in the corresponding plane of the output image. Setting the stride for any plane to 0 is the same as setting it to the scaled plane width (see <a class="el" href="group___turbo_j_p_e_g.html#YUVnotes">YUV Image Format Notes</a>.) If <code>strides</code> is NULL, then the strides for all planes will be set to their respective scaled plane widths. You can adjust the strides in order to add an arbitrary amount of line padding to each plane or to decompress the JPEG image into a subregion of a larger YUV planar image.</td></tr>
|
||||
<tr><td class="paramname">height</td><td>desired height (in pixels) of the YUV image. If this is different than the height of the JPEG image being decompressed, then TurboJPEG will use scaling in the JPEG decompressor to generate the largest possible image that will fit within the desired height. If <code>height</code> is set to 0, then only the width will be considered when determining the scaled image size. If the scaled height is not an even multiple of the MCU block height (see <a class="el" href="group___turbo_j_p_e_g.html#gabd247bb9fecb393eca57366feb8327bf" title="MCU block height (in pixels) for a given level of chrominance subsampling.">tjMCUHeight</a>), then an intermediate buffer copy will be performed within TurboJPEG.</td></tr>
|
||||
<tr><td class="paramname">flags</td><td>the bitwise OR of one or more of the <a class="el" href="group___turbo_j_p_e_g.html#ga72ecf4ebe6eb702d3c6f5ca27455e1ec">flags</a></td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
@@ -1422,20 +1814,112 @@ If you choose option 1, <code>*jpegSize</code> should be set to the size of your
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>Encode an RGB or grayscale image into a YUV planar image. </p>
|
||||
<p>This function uses the accelerated color conversion routines in TurboJPEG's underlying codec but does not execute any of the other steps in the JPEG compression process. The Y, U (Cb), and V (Cr) image planes are stored sequentially into the destination buffer, and the size of each plane is determined by the width and height of the source image, as well as the specified padding and level of chrominance subsampling. If the chrominance components are subsampled along the horizontal dimension, then the width of the luminance plane is padded to the nearest multiple of 2 in the output image (same goes for the height of the luminance plane, if the chrominance components are subsampled along the vertical dimension.) </p>
|
||||
<p>NOTE: Technically, the JPEG format uses the YCbCr colorspace, but per the convention of the digital video community, the TurboJPEG API uses "YUV" to refer to an image format consisting of Y, Cb, and Cr image planes.</p>
|
||||
<p>This function uses the accelerated color conversion routines in the underlying codec but does not execute any of the other steps in the JPEG compression process.</p>
|
||||
<dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramname">handle</td><td>a handle to a TurboJPEG compressor or transformer instance </td></tr>
|
||||
<tr><td class="paramname">srcBuf</td><td>pointer to an image buffer containing RGB or grayscale pixels to be encoded </td></tr>
|
||||
<tr><td class="paramname">width</td><td>width (in pixels) of the source image </td></tr>
|
||||
<tr><td class="paramname">pitch</td><td>bytes per line of the source image. Normally, this should be <code>width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code> if the image is unpadded, or <code><a class="el" href="group___turbo_j_p_e_g.html#ga0aba955473315e405295d978f0c16511" title="Pad the given width to the nearest 32-bit boundary.">TJPAD</a>(width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat])</code> if each line of the image is padded to the nearest 32-bit boundary, as is the case for Windows bitmaps. You can also be clever and use this parameter to skip lines, etc. Setting this parameter to 0 is the equivalent of setting it to <code>width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code>. </td></tr>
|
||||
<tr><td class="paramname">height</td><td>height (in pixels) of the source image </td></tr>
|
||||
<tr><td class="paramname">pixelFormat</td><td>pixel format of the source image (see <a class="el" href="group___turbo_j_p_e_g.html#gac916144e26c3817ac514e64ae5d12e2a">Pixel formats</a>.) </td></tr>
|
||||
<tr><td class="paramname">dstBuf</td><td>pointer to an image buffer that will receive the YUV image. Use <a class="el" href="group___turbo_j_p_e_g.html#gaf451664a62c1f6c7cc5a6401f32908c9" title="The size of the buffer (in bytes) required to hold a YUV planar image with the given parameters...">tjBufSizeYUV2()</a> to determine the appropriate size for this buffer based on the image width, height, padding, and level of chrominance subsampling. </td></tr>
|
||||
<tr><td class="paramname">pad</td><td>the width of each line in each plane of the YUV image will be padded to the nearest multiple of this number of bytes (must be a power of 2.) To generate images suitable for X Video, <code>pad</code> should be set to 4. </td></tr>
|
||||
<tr><td class="paramname">subsamp</td><td>the level of chrominance subsampling to be used when generating the YUV image (see <a class="el" href="group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074">Chrominance subsampling options</a>.) To generate images suitable for X Video, <code>subsamp</code> should be set to <a class="el" href="group___turbo_j_p_e_g.html#gga1d047060ea80bb9820d540bb928e9074a63085dbf683cfe39e513cdb6343e3737">TJSAMP_420</a>. This produces an image compatible with the I420 (AKA "YUV420P") format. </td></tr>
|
||||
<tr><td class="paramname">flags</td><td>the bitwise OR of one or more of the <a class="el" href="group___turbo_j_p_e_g.html#ga72ecf4ebe6eb702d3c6f5ca27455e1ec">flags</a>.</td></tr>
|
||||
<tr><td class="paramname">handle</td><td>a handle to a TurboJPEG compressor or transformer instance</td></tr>
|
||||
<tr><td class="paramname">srcBuf</td><td>pointer to an image buffer containing RGB or grayscale pixels to be encoded</td></tr>
|
||||
<tr><td class="paramname">width</td><td>width (in pixels) of the source image</td></tr>
|
||||
<tr><td class="paramname">pitch</td><td>bytes per line in the source image. Normally, this should be <code>width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code> if the image is unpadded, or <code><a class="el" href="group___turbo_j_p_e_g.html#ga0aba955473315e405295d978f0c16511" title="Pad the given width to the nearest 32-bit boundary.">TJPAD</a>(width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat])</code> if each line of the image is padded to the nearest 32-bit boundary, as is the case for Windows bitmaps. You can also be clever and use this parameter to skip lines, etc. Setting this parameter to 0 is the equivalent of setting it to <code>width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code>.</td></tr>
|
||||
<tr><td class="paramname">height</td><td>height (in pixels) of the source image</td></tr>
|
||||
<tr><td class="paramname">pixelFormat</td><td>pixel format of the source image (see <a class="el" href="group___turbo_j_p_e_g.html#gac916144e26c3817ac514e64ae5d12e2a">Pixel formats</a>.)</td></tr>
|
||||
<tr><td class="paramname">dstBuf</td><td>pointer to an image buffer that will receive the YUV image. Use <a class="el" href="group___turbo_j_p_e_g.html#gaf451664a62c1f6c7cc5a6401f32908c9" title="The size of the buffer (in bytes) required to hold a YUV planar image with the given parameters...">tjBufSizeYUV2()</a> to determine the appropriate size for this buffer based on the image width, height, padding, and level of chrominance subsampling. The Y, U (Cb), and V (Cr) image planes will be stored sequentially in the buffer (refer to <a class="el" href="group___turbo_j_p_e_g.html#YUVnotes">YUV Image Format Notes</a>.)</td></tr>
|
||||
<tr><td class="paramname">pad</td><td>the width of each line in each plane of the YUV image will be padded to the nearest multiple of this number of bytes (must be a power of 2.) To generate images suitable for X Video, <code>pad</code> should be set to 4.</td></tr>
|
||||
<tr><td class="paramname">subsamp</td><td>the level of chrominance subsampling to be used when generating the YUV image (see <a class="el" href="group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074">Chrominance subsampling options</a>.) To generate images suitable for X Video, <code>subsamp</code> should be set to <a class="el" href="group___turbo_j_p_e_g.html#gga1d047060ea80bb9820d540bb928e9074a63085dbf683cfe39e513cdb6343e3737">TJSAMP_420</a>. This produces an image compatible with the I420 (AKA "YUV420P") format.</td></tr>
|
||||
<tr><td class="paramname">flags</td><td>the bitwise OR of one or more of the <a class="el" href="group___turbo_j_p_e_g.html#ga72ecf4ebe6eb702d3c6f5ca27455e1ec">flags</a></td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>0 if successful, or -1 if an error occurred (see <a class="el" href="group___turbo_j_p_e_g.html#ga9af79c908ec131b1ae8d52fe40375abf" title="Returns a descriptive error message explaining why the last command failed.">tjGetErrorStr()</a>.) </dd></dl>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<a class="anchor" id="gaa791db8598853ddcad24e42897ef1269"></a>
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<table class="memname">
|
||||
<tr>
|
||||
<td class="memname">DLLEXPORT int DLLCALL tjEncodeYUVPlanes </td>
|
||||
<td>(</td>
|
||||
<td class="paramtype"><a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> </td>
|
||||
<td class="paramname"><em>handle</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">unsigned char * </td>
|
||||
<td class="paramname"><em>srcBuf</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">int </td>
|
||||
<td class="paramname"><em>width</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">int </td>
|
||||
<td class="paramname"><em>pitch</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">int </td>
|
||||
<td class="paramname"><em>height</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">int </td>
|
||||
<td class="paramname"><em>pixelFormat</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">unsigned char ** </td>
|
||||
<td class="paramname"><em>dstPlanes</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">int * </td>
|
||||
<td class="paramname"><em>strides</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">int </td>
|
||||
<td class="paramname"><em>subsamp</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">int </td>
|
||||
<td class="paramname"><em>flags</em> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>)</td>
|
||||
<td></td><td></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>Encode an RGB or grayscale image into separate Y, U (Cb), and V (Cr) image planes. </p>
|
||||
<p>This function uses the accelerated color conversion routines in the underlying codec but does not execute any of the other steps in the JPEG compression process.</p>
|
||||
<dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramname">handle</td><td>a handle to a TurboJPEG compressor or transformer instance</td></tr>
|
||||
<tr><td class="paramname">srcBuf</td><td>pointer to an image buffer containing RGB or grayscale pixels to be encoded</td></tr>
|
||||
<tr><td class="paramname">width</td><td>width (in pixels) of the source image</td></tr>
|
||||
<tr><td class="paramname">pitch</td><td>bytes per line in the source image. Normally, this should be <code>width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code> if the image is unpadded, or <code><a class="el" href="group___turbo_j_p_e_g.html#ga0aba955473315e405295d978f0c16511" title="Pad the given width to the nearest 32-bit boundary.">TJPAD</a>(width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat])</code> if each line of the image is padded to the nearest 32-bit boundary, as is the case for Windows bitmaps. You can also be clever and use this parameter to skip lines, etc. Setting this parameter to 0 is the equivalent of setting it to <code>width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code>.</td></tr>
|
||||
<tr><td class="paramname">height</td><td>height (in pixels) of the source image</td></tr>
|
||||
<tr><td class="paramname">pixelFormat</td><td>pixel format of the source image (see <a class="el" href="group___turbo_j_p_e_g.html#gac916144e26c3817ac514e64ae5d12e2a">Pixel formats</a>.)</td></tr>
|
||||
<tr><td class="paramname">dstPlanes</td><td>an array of pointers to Y, U (Cb), and V (Cr) image planes (or just a Y plane, if generating a grayscale image) that will receive the encoded image. These planes can be contiguous or non-contiguous in memory. Use <a class="el" href="group___turbo_j_p_e_g.html#ga6f98d977bfa9d167c97172e876ba61e2" title="The size of the buffer (in bytes) required to hold a YUV image plane with the given parameters...">tjPlaneSizeYUV()</a> to determine the appropriate size for each plane based on the image width, height, strides, and level of chrominance subsampling. Refer to <a class="el" href="group___turbo_j_p_e_g.html#YUVnotes">YUV Image Format Notes</a> for more details.</td></tr>
|
||||
<tr><td class="paramname">strides</td><td>an array of integers, each specifying the number of bytes per line in the corresponding plane of the output image. Setting the stride for any plane to 0 is the same as setting it to the plane width (see <a class="el" href="group___turbo_j_p_e_g.html#YUVnotes">YUV Image Format Notes</a>.) If <code>strides</code> is NULL, then the strides for all planes will be set to their respective plane widths. You can adjust the strides in order to add an arbitrary amount of line padding to each plane or to encode an RGB or grayscale image into a subregion of a larger YUV planar image.</td></tr>
|
||||
<tr><td class="paramname">subsamp</td><td>the level of chrominance subsampling to be used when generating the YUV image (see <a class="el" href="group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074">Chrominance subsampling options</a>.) To generate images suitable for X Video, <code>subsamp</code> should be set to <a class="el" href="group___turbo_j_p_e_g.html#gga1d047060ea80bb9820d540bb928e9074a63085dbf683cfe39e513cdb6343e3737">TJSAMP_420</a>. This produces an image compatible with the I420 (AKA "YUV420P") format.</td></tr>
|
||||
<tr><td class="paramname">flags</td><td>the bitwise OR of one or more of the <a class="el" href="group___turbo_j_p_e_g.html#ga72ecf4ebe6eb702d3c6f5ca27455e1ec">flags</a></td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
@@ -1568,6 +2052,151 @@ If you choose option 1, <code>*jpegSize</code> should be set to the size of your
|
||||
<p>Create a new TurboJPEG transformer instance. </p>
|
||||
<dl class="section return"><dt>Returns</dt><dd>a handle to the newly-created instance, or NULL if an error occurred (see <a class="el" href="group___turbo_j_p_e_g.html#ga9af79c908ec131b1ae8d52fe40375abf" title="Returns a descriptive error message explaining why the last command failed.">tjGetErrorStr()</a>.) </dd></dl>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<a class="anchor" id="ga1a209696c6a80748f20e134b3c64789f"></a>
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<table class="memname">
|
||||
<tr>
|
||||
<td class="memname">DLLEXPORT int tjPlaneHeight </td>
|
||||
<td>(</td>
|
||||
<td class="paramtype">int </td>
|
||||
<td class="paramname"><em>componentID</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">int </td>
|
||||
<td class="paramname"><em>height</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">int </td>
|
||||
<td class="paramname"><em>subsamp</em> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>)</td>
|
||||
<td></td><td></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>The plane height of a YUV image plane with the given parameters. </p>
|
||||
<p>Refer to <a class="el" href="group___turbo_j_p_e_g.html#YUVnotes">YUV Image Format Notes</a> for a description of plane height.</p>
|
||||
<dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramname">componentID</td><td>ID number of the image plane (0 = Y, 1 = U/Cb, 2 = V/Cr)</td></tr>
|
||||
<tr><td class="paramname">height</td><td>height (in pixels) of the YUV image</td></tr>
|
||||
<tr><td class="paramname">subsamp</td><td>level of chrominance subsampling in the image (see <a class="el" href="group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074">Chrominance subsampling options</a>.)</td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>the plane height of a YUV image plane with the given parameters, or -1 if the arguments are out of bounds. </dd></dl>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<a class="anchor" id="ga6f98d977bfa9d167c97172e876ba61e2"></a>
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<table class="memname">
|
||||
<tr>
|
||||
<td class="memname">DLLEXPORT unsigned long DLLCALL tjPlaneSizeYUV </td>
|
||||
<td>(</td>
|
||||
<td class="paramtype">int </td>
|
||||
<td class="paramname"><em>componentID</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">int </td>
|
||||
<td class="paramname"><em>width</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">int </td>
|
||||
<td class="paramname"><em>stride</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">int </td>
|
||||
<td class="paramname"><em>height</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">int </td>
|
||||
<td class="paramname"><em>subsamp</em> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>)</td>
|
||||
<td></td><td></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>The size of the buffer (in bytes) required to hold a YUV image plane with the given parameters. </p>
|
||||
<dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramname">componentID</td><td>ID number of the image plane (0 = Y, 1 = U/Cb, 2 = V/Cr)</td></tr>
|
||||
<tr><td class="paramname">width</td><td>width (in pixels) of the YUV image. NOTE: this is the width of the whole image, not the plane width.</td></tr>
|
||||
<tr><td class="paramname">stride</td><td>bytes per line in the image plane. Setting this to 0 is the equivalent of setting it to the plane width.</td></tr>
|
||||
<tr><td class="paramname">height</td><td>height (in pixels) of the YUV image. NOTE: this is the height of the whole image, not the plane height.</td></tr>
|
||||
<tr><td class="paramname">subsamp</td><td>level of chrominance subsampling in the image (see <a class="el" href="group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074">Chrominance subsampling options</a>.)</td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>the size of the buffer (in bytes) required to hold the YUV image plane, or -1 if the arguments are out of bounds. </dd></dl>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<a class="anchor" id="ga63fb66bb1e36c74008c4634360becbb1"></a>
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<table class="memname">
|
||||
<tr>
|
||||
<td class="memname">DLLEXPORT int tjPlaneWidth </td>
|
||||
<td>(</td>
|
||||
<td class="paramtype">int </td>
|
||||
<td class="paramname"><em>componentID</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">int </td>
|
||||
<td class="paramname"><em>width</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">int </td>
|
||||
<td class="paramname"><em>subsamp</em> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>)</td>
|
||||
<td></td><td></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>The plane width of a YUV image plane with the given parameters. </p>
|
||||
<p>Refer to <a class="el" href="group___turbo_j_p_e_g.html#YUVnotes">YUV Image Format Notes</a> for a description of plane width.</p>
|
||||
<dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramname">componentID</td><td>ID number of the image plane (0 = Y, 1 = U/Cb, 2 = V/Cr)</td></tr>
|
||||
<tr><td class="paramname">width</td><td>width (in pixels) of the YUV image</td></tr>
|
||||
<tr><td class="paramname">subsamp</td><td>level of chrominance subsampling in the image (see <a class="el" href="group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074">Chrominance subsampling options</a>.)</td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>the plane width of a YUV image plane with the given parameters, or -1 if the arguments are out of bounds. </dd></dl>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<a class="anchor" id="gae403193ceb4aafb7e0f56ab587b48616"></a>
|
||||
@@ -1631,22 +2260,22 @@ If you choose option 1, <code>*jpegSize</code> should be set to the size of your
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>Losslessly transform a JPEG image into another JPEG image. </p>
|
||||
<p>Lossless transforms work by moving the raw coefficients from one JPEG image structure to another without altering the values of the coefficients. While this is typically faster than decompressing the image, transforming it, and re-compressing it, lossless transforms are not free. Each lossless transform requires reading and performing Huffman decoding on all of the coefficients in the source image, regardless of the size of the destination image. Thus, this function provides a means of generating multiple transformed images from the same source or applying multiple transformations simultaneously, in order to eliminate the need to read the source coefficients multiple times.</p>
|
||||
<p>Lossless transforms work by moving the raw DCT coefficients from one JPEG image structure to another without altering the values of the coefficients. While this is typically faster than decompressing the image, transforming it, and re-compressing it, lossless transforms are not free. Each lossless transform requires reading and performing Huffman decoding on all of the coefficients in the source image, regardless of the size of the destination image. Thus, this function provides a means of generating multiple transformed images from the same source or applying multiple transformations simultaneously, in order to eliminate the need to read the source coefficients multiple times.</p>
|
||||
<dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramname">handle</td><td>a handle to a TurboJPEG transformer instance </td></tr>
|
||||
<tr><td class="paramname">jpegBuf</td><td>pointer to a buffer containing the JPEG image to transform </td></tr>
|
||||
<tr><td class="paramname">jpegSize</td><td>size of the JPEG image (in bytes) </td></tr>
|
||||
<tr><td class="paramname">n</td><td>the number of transformed JPEG images to generate </td></tr>
|
||||
<tr><td class="paramname">handle</td><td>a handle to a TurboJPEG transformer instance</td></tr>
|
||||
<tr><td class="paramname">jpegBuf</td><td>pointer to a buffer containing the JPEG source image to transform</td></tr>
|
||||
<tr><td class="paramname">jpegSize</td><td>size of the JPEG source image (in bytes)</td></tr>
|
||||
<tr><td class="paramname">n</td><td>the number of transformed JPEG images to generate</td></tr>
|
||||
<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>
|
||||
</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>
|
||||
<tr><td class="paramname">transforms</td><td>pointer to an array of n <a class="el" href="structtjtransform.html" title="Lossless transform.">tjtransform</a> structures, each of which specifies the transform parameters and/or cropping region for the corresponding transformed output image. </td></tr>
|
||||
<tr><td class="paramname">flags</td><td>the bitwise OR of one or more of the <a class="el" href="group___turbo_j_p_e_g.html#ga72ecf4ebe6eb702d3c6f5ca27455e1ec">flags</a>.</td></tr>
|
||||
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>
|
||||
<tr><td class="paramname">transforms</td><td>pointer to an array of n <a class="el" href="structtjtransform.html" title="Lossless transform.">tjtransform</a> structures, each of which specifies the transform parameters and/or cropping region for the corresponding transformed output image.</td></tr>
|
||||
<tr><td class="paramname">flags</td><td>the bitwise OR of one or more of the <a class="el" href="group___turbo_j_p_e_g.html#ga72ecf4ebe6eb702d3c6f5ca27455e1ec">flags</a></td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
$(document).ready(function() { searchBox.OnSelectItem(0); });
|
||||
</script>
|
||||
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||
<link href="doxygen-extra.css" rel="stylesheet" type="text/css"/>
|
||||
</head>
|
||||
<body>
|
||||
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
$(document).ready(function() { searchBox.OnSelectItem(0); });
|
||||
</script>
|
||||
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||
<link href="doxygen-extra.css" rel="stylesheet" type="text/css"/>
|
||||
</head>
|
||||
<body>
|
||||
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||
|
||||
@@ -10,17 +10,22 @@ var searchData=
|
||||
['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']]],
|
||||
['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']]],
|
||||
['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']]],
|
||||
['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']]],
|
||||
@@ -51,6 +56,9 @@ var searchData=
|
||||
['tjpf_5fxbgr',['TJPF_XBGR',['../group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aaf6603b27147de47e212e75dac027b2af',1,'turbojpeg.h']]],
|
||||
['tjpf_5fxrgb',['TJPF_XRGB',['../group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aadae996905efcfa3b42a0bb3bea7f9d84',1,'turbojpeg.h']]],
|
||||
['tjpixelsize',['tjPixelSize',['../group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c',1,'turbojpeg.h']]],
|
||||
['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']]],
|
||||
['tjredoffset',['tjRedOffset',['../group___turbo_j_p_e_g.html#gadd9b446742ac8a3923f7992c7988fea8',1,'turbojpeg.h']]],
|
||||
['tjregion',['tjregion',['../structtjregion.html',1,'']]],
|
||||
['tjsamp',['TJSAMP',['../group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074',1,'turbojpeg.h']]],
|
||||
|
||||
@@ -5,16 +5,24 @@ var searchData=
|
||||
['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']]],
|
||||
['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']]],
|
||||
['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']]],
|
||||
['tjinitcompress',['tjInitCompress',['../group___turbo_j_p_e_g.html#ga3d10c47fbe4a2489a2b30c931551d01a',1,'turbojpeg.h']]],
|
||||
['tjinitdecompress',['tjInitDecompress',['../group___turbo_j_p_e_g.html#gae5408179d041e2a2f7199c8283cf649e',1,'turbojpeg.h']]],
|
||||
['tjinittransform',['tjInitTransform',['../group___turbo_j_p_e_g.html#ga3155b775bfbac9dbba869b95a0367902',1,'turbojpeg.h']]],
|
||||
['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']]]
|
||||
];
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
$(document).ready(function() { searchBox.OnSelectItem(0); });
|
||||
</script>
|
||||
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||
<link href="doxygen-extra.css" rel="stylesheet" type="text/css"/>
|
||||
</head>
|
||||
<body>
|
||||
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
$(document).ready(function() { searchBox.OnSelectItem(0); });
|
||||
</script>
|
||||
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||
<link href="doxygen-extra.css" rel="stylesheet" type="text/css"/>
|
||||
</head>
|
||||
<body>
|
||||
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
$(document).ready(function() { searchBox.OnSelectItem(0); });
|
||||
</script>
|
||||
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||
<link href="doxygen-extra.css" rel="stylesheet" type="text/css"/>
|
||||
</head>
|
||||
<body>
|
||||
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||
@@ -128,11 +129,11 @@ Data Fields</h2></td></tr>
|
||||
<p>This allows for custom filters or other transformations to be applied in the frequency domain.</p>
|
||||
<dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramname">coeffs</td><td>pointer to an array of transformed DCT coefficients. (NOTE: this pointer is not guaranteed to be valid once the callback returns, so applications wishing to hand off the DCT coefficients to another function or library should make a copy of them within the body of the callback.) </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">coeffs</td><td>pointer to an array of transformed DCT coefficients. (NOTE: this pointer is not guaranteed to be valid once the callback returns, so applications wishing to hand off the DCT coefficients to another function or library should make a copy of them within the body of the callback.)</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">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>
|
||||
|
||||
3
doxygen-extra.css
Normal file
3
doxygen-extra.css
Normal file
@@ -0,0 +1,3 @@
|
||||
code {
|
||||
color: #4665A2;
|
||||
}
|
||||
@@ -13,3 +13,4 @@ JAVADOC_AUTOBRIEF = YES
|
||||
MAX_INITIALIZER_LINES = 0
|
||||
ALWAYS_DETAILED_SEC = YES
|
||||
HTML_TIMESTAMP = NO
|
||||
HTML_EXTRA_STYLESHEET = doxygen-extra.css
|
||||
|
||||
34
example.c
34
example.c
@@ -58,9 +58,9 @@
|
||||
* RGB color and is described by:
|
||||
*/
|
||||
|
||||
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 */
|
||||
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 */
|
||||
|
||||
|
||||
/*
|
||||
@@ -88,9 +88,9 @@ write_JPEG_file (char * filename, int quality)
|
||||
*/
|
||||
struct jpeg_error_mgr jerr;
|
||||
/* More stuff */
|
||||
FILE * outfile; /* target file */
|
||||
JSAMPROW row_pointer[1]; /* pointer to JSAMPLE row[s] */
|
||||
int row_stride; /* physical row width in image buffer */
|
||||
FILE * outfile; /* target file */
|
||||
JSAMPROW row_pointer[1]; /* pointer to JSAMPLE row[s] */
|
||||
int row_stride; /* physical row width in image buffer */
|
||||
|
||||
/* Step 1: allocate and initialize JPEG compression object */
|
||||
|
||||
@@ -122,12 +122,10 @@ write_JPEG_file (char * filename, int quality)
|
||||
/* First we supply a description of the input image.
|
||||
* Four fields of the cinfo struct must be filled in:
|
||||
*/
|
||||
cinfo.image_width = image_width; /* image width and height, in pixels */
|
||||
cinfo.image_width = image_width; /* image width and height, in pixels */
|
||||
cinfo.image_height = image_height;
|
||||
cinfo.input_components = 3; /* # of color components per pixel */
|
||||
cinfo.in_color_space = JCS_RGB; /* colorspace of input image */
|
||||
cinfo.use_moz_defaults = TRUE; /* use Mozilla defaults for improved compression */
|
||||
|
||||
cinfo.input_components = 3; /* # of color components per pixel */
|
||||
cinfo.in_color_space = JCS_RGB; /* colorspace of input image */
|
||||
/* Now use the library's routine to set default compression parameters.
|
||||
* (You must set at least cinfo.in_color_space before calling this,
|
||||
* since the defaults depend on the source color space.)
|
||||
@@ -153,7 +151,7 @@ write_JPEG_file (char * filename, int quality)
|
||||
* To keep things simple, we pass one scanline per call; you can pass
|
||||
* more if you wish, though.
|
||||
*/
|
||||
row_stride = image_width * 3; /* JSAMPLEs per row in image_buffer */
|
||||
row_stride = image_width * 3; /* JSAMPLEs per row in image_buffer */
|
||||
|
||||
while (cinfo.next_scanline < cinfo.image_height) {
|
||||
/* jpeg_write_scanlines expects an array of pointers to scanlines.
|
||||
@@ -250,9 +248,9 @@ write_JPEG_file (char * filename, int quality)
|
||||
*/
|
||||
|
||||
struct my_error_mgr {
|
||||
struct jpeg_error_mgr pub; /* "public" fields */
|
||||
struct jpeg_error_mgr pub; /* "public" fields */
|
||||
|
||||
jmp_buf setjmp_buffer; /* for return to caller */
|
||||
jmp_buf setjmp_buffer; /* for return to caller */
|
||||
};
|
||||
|
||||
typedef struct my_error_mgr * my_error_ptr;
|
||||
@@ -295,9 +293,9 @@ read_JPEG_file (char * filename)
|
||||
*/
|
||||
struct my_error_mgr jerr;
|
||||
/* More stuff */
|
||||
FILE * infile; /* source file */
|
||||
JSAMPARRAY buffer; /* Output row buffer */
|
||||
int row_stride; /* physical row width in output buffer */
|
||||
FILE * infile; /* source file */
|
||||
JSAMPARRAY buffer; /* Output row buffer */
|
||||
int row_stride; /* physical row width in output buffer */
|
||||
|
||||
/* In this example we want to open the input file before doing anything else,
|
||||
* so that the setjmp() error recovery below can assume the file is open.
|
||||
@@ -363,7 +361,7 @@ read_JPEG_file (char * filename)
|
||||
row_stride = cinfo.output_width * cinfo.output_components;
|
||||
/* Make a one-row-high sample array that will go away when done with image */
|
||||
buffer = (*cinfo.mem->alloc_sarray)
|
||||
((j_common_ptr) &cinfo, JPOOL_IMAGE, row_stride, 1);
|
||||
((j_common_ptr) &cinfo, JPOOL_IMAGE, row_stride, 1);
|
||||
|
||||
/* Step 6: while (scan lines remain to be read) */
|
||||
/* jpeg_read_scanlines(...); */
|
||||
|
||||
26
git-init-svn.sh
Executable file
26
git-init-svn.sh
Executable file
@@ -0,0 +1,26 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
# Make a local, clean libjpeg-turbo branch that tracks the remote libjpeg-turbo.
|
||||
# This will allow pushing of imported libjpeg-turbo commits to the mozjpeg repository.
|
||||
# The libjpeg-turbo branch must only contain imported SVN commits (with git-svn-id: in the message).
|
||||
git branch -f -t libjpeg-turbo origin/libjpeg-turbo
|
||||
|
||||
# Configure git-svn. "git svn fetch" will rebuild remaining git-svn metadata.
|
||||
git config svn-remote.svn.url svn://svn.code.sf.net/p/libjpeg-turbo/code
|
||||
git config svn-remote.svn.fetch trunk:refs/heads/libjpeg-turbo
|
||||
|
||||
# Enable mapping of SVN usernames to git authors.
|
||||
git config svn.authorsfile .gitauthors
|
||||
|
||||
# Mark which libjpeg-turbo commit has been used to start mozjpeg.
|
||||
# Required for accurate merging and blame.
|
||||
echo > .git/info/grafts "72b66f9c77b3e4ae363b21e48145f635cec0b193 540789427ccae8e9e778151cbc16ab8ee88ac6a8"
|
||||
|
||||
# To get changes from SVN:
|
||||
# git svn fetch
|
||||
# git push origin libjpeg-turbo
|
||||
#
|
||||
# To merge SVN changes with mozjpeg:
|
||||
# git checkout master
|
||||
# git merge libjpeg-turbo
|
||||
@@ -8,12 +8,13 @@ set(JAVA_CLASSNAMES org/libjpegturbo/turbojpeg/TJ
|
||||
org/libjpegturbo/turbojpeg/TJScalingFactor
|
||||
org/libjpegturbo/turbojpeg/TJTransform
|
||||
org/libjpegturbo/turbojpeg/TJTransformer
|
||||
org/libjpegturbo/turbojpeg/YUVImage
|
||||
TJUnitTest
|
||||
TJExample
|
||||
TJBench)
|
||||
|
||||
if(MSVC_IDE)
|
||||
set(OBJDIR "${CMAKE_CURRENT_BINARY_DIR}/$(OutDir)")
|
||||
set(OBJDIR "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}")
|
||||
else()
|
||||
set(OBJDIR "${CMAKE_CURRENT_BINARY_DIR}")
|
||||
endif()
|
||||
|
||||
@@ -13,6 +13,7 @@ JAVASOURCES = org/libjpegturbo/turbojpeg/TJ.java \
|
||||
org/libjpegturbo/turbojpeg/TJScalingFactor.java \
|
||||
org/libjpegturbo/turbojpeg/TJTransform.java \
|
||||
org/libjpegturbo/turbojpeg/TJTransformer.java \
|
||||
org/libjpegturbo/turbojpeg/YUVImage.java \
|
||||
TJExample.java \
|
||||
TJUnitTest.java \
|
||||
TJBench.java
|
||||
@@ -34,6 +35,7 @@ JAVA_CLASSES = org/libjpegturbo/turbojpeg/TJ.class \
|
||||
org/libjpegturbo/turbojpeg/TJScalingFactor.class \
|
||||
org/libjpegturbo/turbojpeg/TJTransform.class \
|
||||
org/libjpegturbo/turbojpeg/TJTransformer.class \
|
||||
org/libjpegturbo/turbojpeg/YUVImage.class \
|
||||
TJExample.class \
|
||||
TJUnitTest.class \
|
||||
TJBench.class
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C)2009-2013 D. R. Commander. All Rights Reserved.
|
||||
* Copyright (C)2009-2014 D. R. Commander. All Rights Reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
@@ -34,12 +34,8 @@ import org.libjpegturbo.turbojpeg.*;
|
||||
|
||||
class TJBench {
|
||||
|
||||
static final int YUVENCODE = 1;
|
||||
static final int YUVDECODE = 2;
|
||||
static final int YUVCOMPRESS = 3;
|
||||
|
||||
static int flags = 0, yuv = 0, quiet = 0, pf = TJ.PF_BGR, yuvpad = 1;
|
||||
static boolean compOnly, decompOnly, doTile;
|
||||
static int flags = 0, quiet = 0, pf = TJ.PF_BGR, yuvpad = 1, warmup = 1;
|
||||
static boolean compOnly, decompOnly, doTile, doYUV;
|
||||
|
||||
static final String[] pixFormatStr = {
|
||||
"RGB", "BGR", "RGBX", "BGRX", "XBGR", "XRGB", "GRAY"
|
||||
@@ -134,68 +130,97 @@ class TJBench {
|
||||
|
||||
|
||||
/* Decompression test */
|
||||
static void decompTest(byte[] srcBuf, byte[][] jpegBuf, int[] jpegSize,
|
||||
byte[] dstBuf, int w, int h, int subsamp,
|
||||
int jpegQual, String fileName, int tilew, int tileh)
|
||||
throws Exception {
|
||||
static void decomp(byte[] srcBuf, byte[][] jpegBuf, int[] jpegSize,
|
||||
byte[] dstBuf, int w, int h, int subsamp, int jpegQual,
|
||||
String fileName, int tilew, int tileh) throws Exception {
|
||||
String qualStr = new String(""), sizeStr, tempStr;
|
||||
TJDecompressor tjd;
|
||||
double start, elapsed;
|
||||
int ps = TJ.getPixelSize(pf), i;
|
||||
double elapsed, elapsedDecode;
|
||||
int ps = TJ.getPixelSize(pf), i, iter = 0;
|
||||
int scaledw = sf.getScaled(w);
|
||||
int scaledh = sf.getScaled(h);
|
||||
int yuvSize = TJ.bufSizeYUV(scaledw, yuvpad, scaledh, subsamp), bufsize;
|
||||
int pitch = scaledw * ps;
|
||||
YUVImage yuvImage = null;
|
||||
|
||||
if (jpegQual > 0)
|
||||
qualStr = new String("_Q" + jpegQual);
|
||||
|
||||
tjd = new TJDecompressor();
|
||||
|
||||
int bufSize = (yuv == YUVDECODE ? yuvSize : pitch * scaledh);
|
||||
if (dstBuf == null)
|
||||
dstBuf = new byte[bufSize];
|
||||
dstBuf = new byte[pitch * scaledh];
|
||||
|
||||
/* Set the destination buffer to gray so we know whether the decompressor
|
||||
attempted to write to it */
|
||||
Arrays.fill(dstBuf, (byte)127);
|
||||
|
||||
/* Execute once to preload cache */
|
||||
tjd.setJPEGImage(jpegBuf[0], jpegSize[0]);
|
||||
if (yuv == YUVDECODE)
|
||||
tjd.decompressToYUV(dstBuf, scaledw, yuvpad, scaledh, flags);
|
||||
else
|
||||
tjd.decompress(dstBuf, scaledw, pitch, scaledh, pf, flags);
|
||||
|
||||
/* Benchmark */
|
||||
for (i = 0, start = getTime(); (elapsed = getTime() - start) < benchTime;
|
||||
i++) {
|
||||
int tile = 0;
|
||||
if (yuv == YUVDECODE)
|
||||
tjd.decompressToYUV(dstBuf, scaledw, yuvpad, scaledh, flags);
|
||||
else {
|
||||
for (int y = 0; y < h; y += tileh) {
|
||||
for (int x = 0; x < w; x += tilew, tile++) {
|
||||
int width = doTile ? Math.min(tilew, w - x) : scaledw;
|
||||
int height = doTile ? Math.min(tileh, h - y) : scaledh;
|
||||
tjd.setJPEGImage(jpegBuf[tile], jpegSize[tile]);
|
||||
tjd.decompress(dstBuf, x, y, width, pitch, height, pf, flags);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (doYUV) {
|
||||
int width = doTile ? tilew : scaledw;
|
||||
int height = doTile ? tileh : scaledh;
|
||||
yuvImage = new YUVImage(width, yuvpad, height, subsamp);
|
||||
Arrays.fill(yuvImage.getBuf(), (byte)127);
|
||||
}
|
||||
|
||||
/* Benchmark */
|
||||
iter -= warmup;
|
||||
elapsed = elapsedDecode = 0.0;
|
||||
while (true) {
|
||||
int tile = 0;
|
||||
double start = getTime();
|
||||
for (int y = 0; y < h; y += tileh) {
|
||||
for (int x = 0; x < w; x += tilew, tile++) {
|
||||
int width = doTile ? Math.min(tilew, w - x) : scaledw;
|
||||
int height = doTile ? Math.min(tileh, h - y) : scaledh;
|
||||
tjd.setSourceImage(jpegBuf[tile], jpegSize[tile]);
|
||||
if (doYUV) {
|
||||
yuvImage.setBuf(yuvImage.getBuf(), width, yuvpad, height, subsamp);
|
||||
tjd.decompressToYUV(yuvImage, flags);
|
||||
double startDecode = getTime();
|
||||
tjd.setSourceImage(yuvImage);
|
||||
tjd.decompress(dstBuf, x, y, width, pitch, height, pf, flags);
|
||||
if (iter >= 0)
|
||||
elapsedDecode += getTime() - startDecode;
|
||||
} else
|
||||
tjd.decompress(dstBuf, x, y, width, pitch, height, pf, flags);
|
||||
}
|
||||
}
|
||||
iter++;
|
||||
if (iter >= 1) {
|
||||
elapsed += getTime() - start;
|
||||
if (elapsed >= benchTime)
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(doYUV)
|
||||
elapsed -= elapsedDecode;
|
||||
|
||||
tjd = null;
|
||||
for (i = 0; i < jpegBuf.length; i++)
|
||||
jpegBuf[i] = null;
|
||||
jpegBuf = null; jpegSize = null;
|
||||
System.gc();
|
||||
|
||||
if (quiet != 0)
|
||||
System.out.println(
|
||||
sigFig((double)(w * h) / 1000000. * (double)i / elapsed, 4));
|
||||
else {
|
||||
System.out.format("D--> Frame rate: %f fps\n",
|
||||
(double)i / elapsed);
|
||||
System.out.format(" Dest. throughput: %f Megapixels/sec\n",
|
||||
(double)(w * h) / 1000000. * (double)i / elapsed);
|
||||
if (quiet != 0) {
|
||||
System.out.format("%-6s%s",
|
||||
sigFig((double)(w * h) / 1000000. * (double)iter / elapsed, 4),
|
||||
quiet == 2 ? "\n" : " ");
|
||||
if (doYUV)
|
||||
System.out.format("%s\n",
|
||||
sigFig((double)(w * h) / 1000000. * (double)iter / elapsedDecode, 4));
|
||||
else if (quiet != 2)
|
||||
System.out.print("\n");
|
||||
} else {
|
||||
System.out.format("%s --> Frame rate: %f fps\n",
|
||||
(doYUV ? "Decomp to YUV":"Decompress "),
|
||||
(double)iter / elapsed);
|
||||
System.out.format(" Throughput: %f Megapixels/sec\n",
|
||||
(double)(w * h) / 1000000. * (double)iter / elapsed);
|
||||
if (doYUV) {
|
||||
System.out.format("YUV Decode --> Frame rate: %f fps\n",
|
||||
(double)iter / elapsedDecode);
|
||||
System.out.format(" Throughput: %f Megapixels/sec\n",
|
||||
(double)(w * h) / 1000000. * (double)iter / elapsedDecode);
|
||||
}
|
||||
}
|
||||
|
||||
if (sf.getNum() != 1 || sf.getDenom() != 1)
|
||||
@@ -205,130 +230,57 @@ class TJBench {
|
||||
else
|
||||
sizeStr = new String("full");
|
||||
if (decompOnly)
|
||||
tempStr = new String(fileName + "_" + sizeStr +
|
||||
(yuv != 0 ? ".yuv" : ".bmp"));
|
||||
tempStr = new String(fileName + "_" + sizeStr + ".bmp");
|
||||
else
|
||||
tempStr = new String(fileName + "_" + subName[subsamp] + qualStr +
|
||||
"_" + sizeStr + (yuv != 0 ? ".yuv" : ".bmp"));
|
||||
"_" + sizeStr + ".bmp");
|
||||
|
||||
if (yuv == YUVDECODE) {
|
||||
FileOutputStream fos = new FileOutputStream(tempStr);
|
||||
fos.write(dstBuf, 0, yuvSize);
|
||||
fos.close();
|
||||
} else {
|
||||
saveImage(tempStr, dstBuf, scaledw, scaledh, pf);
|
||||
int ndx = tempStr.indexOf('.');
|
||||
tempStr = new String(tempStr.substring(0, ndx) + "-err.bmp");
|
||||
if (srcBuf != null && sf.getNum() == 1 && sf.getDenom() == 1) {
|
||||
if (quiet == 0)
|
||||
System.out.println("Compression error written to " + tempStr + ".");
|
||||
if (subsamp == TJ.SAMP_GRAY) {
|
||||
for (int y = 0, index = 0; y < h; y++, index += pitch) {
|
||||
for (int x = 0, index2 = index; x < w; x++, index2 += ps) {
|
||||
int rindex = index2 + TJ.getRedOffset(pf);
|
||||
int gindex = index2 + TJ.getGreenOffset(pf);
|
||||
int bindex = index2 + TJ.getBlueOffset(pf);
|
||||
int lum = (int)((double)(srcBuf[rindex] & 0xff) * 0.299 +
|
||||
(double)(srcBuf[gindex] & 0xff) * 0.587 +
|
||||
(double)(srcBuf[bindex] & 0xff) * 0.114 + 0.5);
|
||||
if (lum > 255) lum = 255;
|
||||
if (lum < 0) lum = 0;
|
||||
dstBuf[rindex] = (byte)Math.abs((dstBuf[rindex] & 0xff) - lum);
|
||||
dstBuf[gindex] = (byte)Math.abs((dstBuf[gindex] & 0xff) - lum);
|
||||
dstBuf[bindex] = (byte)Math.abs((dstBuf[bindex] & 0xff) - lum);
|
||||
}
|
||||
saveImage(tempStr, dstBuf, scaledw, scaledh, pf);
|
||||
int ndx = tempStr.lastIndexOf('.');
|
||||
tempStr = new String(tempStr.substring(0, ndx) + "-err.bmp");
|
||||
if (srcBuf != null && sf.getNum() == 1 && sf.getDenom() == 1) {
|
||||
if (quiet == 0)
|
||||
System.out.println("Compression error written to " + tempStr + ".");
|
||||
if (subsamp == TJ.SAMP_GRAY) {
|
||||
for (int y = 0, index = 0; y < h; y++, index += pitch) {
|
||||
for (int x = 0, index2 = index; x < w; x++, index2 += ps) {
|
||||
int rindex = index2 + TJ.getRedOffset(pf);
|
||||
int gindex = index2 + TJ.getGreenOffset(pf);
|
||||
int bindex = index2 + TJ.getBlueOffset(pf);
|
||||
int lum = (int)((double)(srcBuf[rindex] & 0xff) * 0.299 +
|
||||
(double)(srcBuf[gindex] & 0xff) * 0.587 +
|
||||
(double)(srcBuf[bindex] & 0xff) * 0.114 + 0.5);
|
||||
if (lum > 255) lum = 255;
|
||||
if (lum < 0) lum = 0;
|
||||
dstBuf[rindex] = (byte)Math.abs((dstBuf[rindex] & 0xff) - lum);
|
||||
dstBuf[gindex] = (byte)Math.abs((dstBuf[gindex] & 0xff) - lum);
|
||||
dstBuf[bindex] = (byte)Math.abs((dstBuf[bindex] & 0xff) - lum);
|
||||
}
|
||||
} else {
|
||||
for (int y = 0; y < h; y++)
|
||||
for (int x = 0; x < w * ps; x++)
|
||||
dstBuf[pitch * y + x] =
|
||||
(byte)Math.abs((dstBuf[pitch * y + x] & 0xff) -
|
||||
(srcBuf[pitch * y + x] & 0xff));
|
||||
}
|
||||
saveImage(tempStr, dstBuf, w, h, pf);
|
||||
} else {
|
||||
for (int y = 0; y < h; y++)
|
||||
for (int x = 0; x < w * ps; x++)
|
||||
dstBuf[pitch * y + x] =
|
||||
(byte)Math.abs((dstBuf[pitch * y + x] & 0xff) -
|
||||
(srcBuf[pitch * y + x] & 0xff));
|
||||
}
|
||||
saveImage(tempStr, dstBuf, w, h, pf);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void doTestYUV(byte[] srcBuf, int w, int h, int subsamp,
|
||||
String fileName) throws Exception {
|
||||
TJCompressor tjc;
|
||||
byte[] dstBuf;
|
||||
double start, elapsed;
|
||||
int ps = TJ.getPixelSize(pf), i;
|
||||
int yuvSize = 0;
|
||||
|
||||
yuvSize = TJ.bufSizeYUV(w, h, subsamp);
|
||||
dstBuf = new byte[yuvSize];
|
||||
|
||||
if (quiet == 0)
|
||||
System.out.format(">>>>> %s (%s) <--> YUV %s <<<<<\n",
|
||||
pixFormatStr[pf],
|
||||
(flags & TJ.FLAG_BOTTOMUP) != 0 ? "Bottom-up" : "Top-down",
|
||||
subNameLong[subsamp]);
|
||||
|
||||
if (quiet == 1)
|
||||
System.out.format("%s\t%s\t%s\tN/A\t", pixFormatStr[pf],
|
||||
(flags & TJ.FLAG_BOTTOMUP) != 0 ? "BU" : "TD",
|
||||
subNameLong[subsamp]);
|
||||
|
||||
tjc = new TJCompressor(srcBuf, w, 0, h, pf);
|
||||
tjc.setSubsamp(subsamp);
|
||||
|
||||
/* Execute once to preload cache */
|
||||
tjc.encodeYUV(dstBuf, flags);
|
||||
|
||||
/* Benchmark */
|
||||
for (i = 0, start = getTime();
|
||||
(elapsed = getTime() - start) < benchTime; i++)
|
||||
tjc.encodeYUV(dstBuf, flags);
|
||||
|
||||
if (quiet == 1)
|
||||
System.out.format("%-4d %-4d\t", w, h);
|
||||
if (quiet != 0) {
|
||||
System.out.format("%s%c%s%c",
|
||||
sigFig((double)(w * h) / 1000000. * (double) i / elapsed, 4),
|
||||
quiet == 2 ? '\n' : '\t',
|
||||
sigFig((double)(w * h * ps) / (double)yuvSize, 4),
|
||||
quiet == 2 ? '\n' : '\t');
|
||||
} else {
|
||||
System.out.format("\n%s size: %d x %d\n", "Image", w, h);
|
||||
System.out.format("C--> Frame rate: %f fps\n",
|
||||
(double)i / elapsed);
|
||||
System.out.format(" Output image size: %d bytes\n", yuvSize);
|
||||
System.out.format(" Compression ratio: %f:1\n",
|
||||
(double)(w * h * ps) / (double)yuvSize);
|
||||
System.out.format(" Source throughput: %f Megapixels/sec\n",
|
||||
(double)(w * h) / 1000000. * (double)i / elapsed);
|
||||
System.out.format(" Output bit stream: %f Megabits/sec\n",
|
||||
(double)yuvSize * 8. / 1000000. * (double)i / elapsed);
|
||||
}
|
||||
String tempStr = fileName + "_" + subName[subsamp] + ".yuv";
|
||||
FileOutputStream fos = new FileOutputStream(tempStr);
|
||||
fos.write(dstBuf, 0, yuvSize);
|
||||
fos.close();
|
||||
if (quiet == 0)
|
||||
System.out.println("Reference image written to " + tempStr);
|
||||
}
|
||||
|
||||
|
||||
static void doTest(byte[] srcBuf, int w, int h, int subsamp, int jpegQual,
|
||||
String fileName) throws Exception {
|
||||
static void fullTest(byte[] srcBuf, int w, int h, int subsamp, int jpegQual,
|
||||
String fileName) throws Exception {
|
||||
TJCompressor tjc;
|
||||
byte[] tmpBuf;
|
||||
byte[][] jpegBuf;
|
||||
int[] jpegSize;
|
||||
double start, elapsed;
|
||||
int totalJpegSize = 0, tilew, tileh, i;
|
||||
int ps = (yuv == YUVCOMPRESS ? 3 : TJ.getPixelSize(pf));
|
||||
double start, elapsed, elapsedEncode;
|
||||
int totalJpegSize = 0, tilew, tileh, i, iter;
|
||||
int ps = TJ.getPixelSize(pf);
|
||||
int ntilesw = 1, ntilesh = 1, pitch = w * ps;
|
||||
String pfStr = (yuv == YUVCOMPRESS ? "YUV" : pixFormatStr[pf]);
|
||||
|
||||
if (yuv == YUVENCODE) {
|
||||
doTestYUV(srcBuf, w, h, subsamp, fileName);
|
||||
return;
|
||||
}
|
||||
String pfStr = pixFormatStr[pf];
|
||||
YUVImage yuvImage = null;
|
||||
|
||||
tmpBuf = new byte[pitch * h];
|
||||
|
||||
@@ -353,61 +305,94 @@ class TJBench {
|
||||
|
||||
/* Compression test */
|
||||
if (quiet == 1)
|
||||
System.out.format("%s\t%s\t%s\t%d\t", pfStr,
|
||||
System.out.format("%-4s (%s) %-5s %-3d ", pfStr,
|
||||
(flags & TJ.FLAG_BOTTOMUP) != 0 ? "BU" : "TD",
|
||||
subNameLong[subsamp], jpegQual);
|
||||
if (yuv != YUVCOMPRESS)
|
||||
for (i = 0; i < h; i++)
|
||||
System.arraycopy(srcBuf, w * ps * i, tmpBuf, pitch * i, w * ps);
|
||||
if (yuv == YUVCOMPRESS)
|
||||
tjc.setSourceImageYUV(srcBuf, tilew, yuvpad, tileh);
|
||||
else
|
||||
tjc.setSourceImage(srcBuf, tilew, pitch, tileh, pf);
|
||||
for (i = 0; i < h; i++)
|
||||
System.arraycopy(srcBuf, w * ps * i, tmpBuf, pitch * i, w * ps);
|
||||
tjc.setJPEGQuality(jpegQual);
|
||||
tjc.setSubsamp(subsamp);
|
||||
|
||||
/* Execute once to preload cache */
|
||||
tjc.compress(jpegBuf[0], flags);
|
||||
if (doYUV) {
|
||||
yuvImage = new YUVImage(tilew, yuvpad, tileh, subsamp);
|
||||
Arrays.fill(yuvImage.getBuf(), (byte)127);
|
||||
}
|
||||
|
||||
/* Benchmark */
|
||||
for (i = 0, start = getTime();
|
||||
(elapsed = getTime() - start) < benchTime; i++) {
|
||||
iter = -warmup;
|
||||
elapsed = elapsedEncode = 0.0;
|
||||
while (true) {
|
||||
int tile = 0;
|
||||
totalJpegSize = 0;
|
||||
start = getTime();
|
||||
for (int y = 0; y < h; y += tileh) {
|
||||
for (int x = 0; x < w; x += tilew, tile++) {
|
||||
int width = Math.min(tilew, w - x);
|
||||
int height = Math.min(tileh, h - y);
|
||||
if (yuv != YUVCOMPRESS)
|
||||
tjc.setSourceImage(srcBuf, x, y, width, pitch, height, pf);
|
||||
tjc.setSourceImage(srcBuf, x, y, width, pitch, height, pf);
|
||||
if (doYUV) {
|
||||
double startEncode = getTime();
|
||||
yuvImage.setBuf(yuvImage.getBuf(), width, yuvpad, height,
|
||||
subsamp);
|
||||
tjc.encodeYUV(yuvImage, flags);
|
||||
if (iter >= 0)
|
||||
elapsedEncode += getTime() - startEncode;
|
||||
tjc.setSourceImage(yuvImage);
|
||||
}
|
||||
tjc.compress(jpegBuf[tile], flags);
|
||||
jpegSize[tile] = tjc.getCompressedSize();
|
||||
totalJpegSize += jpegSize[tile];
|
||||
}
|
||||
}
|
||||
iter++;
|
||||
if (iter >= 1) {
|
||||
elapsed += getTime() - start;
|
||||
if (elapsed >= benchTime)
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (doYUV)
|
||||
elapsed -= elapsedEncode;
|
||||
|
||||
if (quiet == 1)
|
||||
System.out.format("%-4d %-4d\t", tilew, tileh);
|
||||
System.out.format("%-5d %-5d ", tilew, tileh);
|
||||
if (quiet != 0) {
|
||||
System.out.format("%s%c%s%c",
|
||||
sigFig((double)(w * h) / 1000000. * (double) i / elapsed, 4),
|
||||
quiet == 2 ? '\n' : '\t',
|
||||
if (doYUV)
|
||||
System.out.format("%-6s%s",
|
||||
sigFig((double)(w * h) / 1000000. * (double)iter / elapsedEncode, 4),
|
||||
quiet == 2 ? "\n" : " ");
|
||||
System.out.format("%-6s%s",
|
||||
sigFig((double)(w * h) / 1000000. * (double)iter / elapsed, 4),
|
||||
quiet == 2 ? "\n" : " ");
|
||||
System.out.format("%-6s%s",
|
||||
sigFig((double)(w * h * ps) / (double)totalJpegSize, 4),
|
||||
quiet == 2 ? '\n' : '\t');
|
||||
quiet == 2 ? "\n" : " ");
|
||||
} else {
|
||||
System.out.format("\n%s size: %d x %d\n", doTile ? "Tile" : "Image",
|
||||
tilew, tileh);
|
||||
System.out.format("C--> Frame rate: %f fps\n",
|
||||
(double)i / elapsed);
|
||||
System.out.format(" Output image size: %d bytes\n",
|
||||
if (doYUV) {
|
||||
System.out.format("Encode YUV --> Frame rate: %f fps\n",
|
||||
(double)iter / elapsedEncode);
|
||||
System.out.format(" Output image size: %d bytes\n",
|
||||
yuvImage.getSize());
|
||||
System.out.format(" Compression ratio: %f:1\n",
|
||||
(double)(w * h * ps) / (double)yuvImage.getSize());
|
||||
System.out.format(" Throughput: %f Megapixels/sec\n",
|
||||
(double)(w * h) / 1000000. * (double)iter / elapsedEncode);
|
||||
System.out.format(" Output bit stream: %f Megabits/sec\n",
|
||||
(double)yuvImage.getSize() * 8. / 1000000. * (double)iter / elapsedEncode);
|
||||
}
|
||||
System.out.format("%s --> Frame rate: %f fps\n",
|
||||
doYUV ? "Comp from YUV" : "Compress ",
|
||||
(double)iter / elapsed);
|
||||
System.out.format(" Output image size: %d bytes\n",
|
||||
totalJpegSize);
|
||||
System.out.format(" Compression ratio: %f:1\n",
|
||||
System.out.format(" Compression ratio: %f:1\n",
|
||||
(double)(w * h * ps) / (double)totalJpegSize);
|
||||
System.out.format(" Source throughput: %f Megapixels/sec\n",
|
||||
(double)(w * h) / 1000000. * (double)i / elapsed);
|
||||
System.out.format(" Output bit stream: %f Megabits/sec\n",
|
||||
(double)totalJpegSize * 8. / 1000000. * (double)i / elapsed);
|
||||
System.out.format(" Throughput: %f Megapixels/sec\n",
|
||||
(double)(w * h) / 1000000. * (double)iter / elapsed);
|
||||
System.out.format(" Output bit stream: %f Megabits/sec\n",
|
||||
(double)totalJpegSize * 8. / 1000000. * (double)iter / elapsed);
|
||||
}
|
||||
if (tilew == w && tileh == h) {
|
||||
String tempStr = fileName + "_" + subName[subsamp] + "_" + "Q" +
|
||||
@@ -421,27 +406,22 @@ class TJBench {
|
||||
|
||||
/* Decompression test */
|
||||
if (!compOnly)
|
||||
decompTest(srcBuf, jpegBuf, jpegSize, tmpBuf, w, h, subsamp, jpegQual,
|
||||
fileName, tilew, tileh);
|
||||
|
||||
for (i = 0; i < ntilesw * ntilesh; i++)
|
||||
jpegBuf[i] = null;
|
||||
jpegBuf = null; jpegSize = null;
|
||||
System.gc();
|
||||
decomp(srcBuf, jpegBuf, jpegSize, tmpBuf, w, h, subsamp, jpegQual,
|
||||
fileName, tilew, tileh);
|
||||
|
||||
if (tilew == w && tileh == h) break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void doDecompTest(String fileName) throws Exception {
|
||||
static void decompTest(String fileName) throws Exception {
|
||||
TJTransformer tjt;
|
||||
byte[][] jpegBuf;
|
||||
byte[][] jpegBuf = null;
|
||||
byte[] srcBuf;
|
||||
int[] jpegSize;
|
||||
int[] jpegSize = null;
|
||||
int totalJpegSize;
|
||||
int w = 0, h = 0, subsamp = -1, cs = -1, _w, _h, _tilew, _tileh,
|
||||
_ntilesw, _ntilesh, _subsamp, x, y;
|
||||
_ntilesw, _ntilesh, _subsamp, x, y, iter;
|
||||
int ntilesw = 1, ntilesh = 1;
|
||||
double start, elapsed;
|
||||
int ps = TJ.getPixelSize(pf), tile;
|
||||
@@ -452,13 +432,13 @@ class TJBench {
|
||||
fis.read(srcBuf, 0, srcSize);
|
||||
fis.close();
|
||||
|
||||
int index = fileName.indexOf('.');
|
||||
int index = fileName.lastIndexOf('.');
|
||||
if (index >= 0)
|
||||
fileName = new String(fileName.substring(0, index));
|
||||
|
||||
tjt = new TJTransformer();
|
||||
|
||||
tjt.setJPEGImage(srcBuf, srcSize);
|
||||
tjt.setSourceImage(srcBuf, srcSize);
|
||||
w = tjt.getWidth();
|
||||
h = tjt.getHeight();
|
||||
subsamp = tjt.getSubsamp();
|
||||
@@ -466,19 +446,20 @@ class TJBench {
|
||||
|
||||
if (quiet == 1) {
|
||||
System.out.println("All performance values in Mpixels/sec\n");
|
||||
System.out.format("Bitmap\tBitmap\tJPEG\tJPEG\t%s %s \tXform\tComp\tDecomp\n",
|
||||
System.out.format("Bitmap JPEG JPEG %s %s Xform Comp Decomp ",
|
||||
(doTile ? "Tile " : "Image"),
|
||||
(doTile ? "Tile " : "Image"));
|
||||
System.out.println("Format\tOrder\tCS\tSubsamp\tWidth Height\tPerf \tRatio\tPerf\n");
|
||||
} else if (quiet == 0) {
|
||||
if (yuv == YUVDECODE)
|
||||
System.out.format(">>>>> JPEG %s --> YUV <<<<<",
|
||||
formatName(subsamp, cs));
|
||||
else
|
||||
System.out.format(">>>>> JPEG %s --> %s (%s) <<<<<",
|
||||
formatName(subsamp, cs), pixFormatStr[pf],
|
||||
(flags & TJ.FLAG_BOTTOMUP) != 0 ? "Bottom-up" : "Top-down");
|
||||
}
|
||||
if (doYUV)
|
||||
System.out.print("Decode");
|
||||
System.out.print("\n");
|
||||
System.out.print("Format CS Subsamp Width Height Perf Ratio Perf ");
|
||||
if (doYUV)
|
||||
System.out.print("Perf");
|
||||
System.out.println("\n");
|
||||
} else if (quiet == 0)
|
||||
System.out.format(">>>>> JPEG %s --> %s (%s) <<<<<\n",
|
||||
formatName(subsamp, cs), pixFormatStr[pf],
|
||||
(flags & TJ.FLAG_BOTTOMUP) != 0 ? "Bottom-up" : "Top-down");
|
||||
|
||||
for (int tilew = doTile ? 16 : w, tileh = doTile ? 16 : h; ;
|
||||
tilew *= 2, tileh *= 2) {
|
||||
@@ -498,10 +479,10 @@ class TJBench {
|
||||
sf.getScaled(_h));
|
||||
System.out.println("");
|
||||
} else if (quiet == 1) {
|
||||
System.out.format("%s\t%s\t%s\t%s\t", pixFormatStr[pf],
|
||||
System.out.format("%-4s (%s) %-5s %-5s ", pixFormatStr[pf],
|
||||
(flags & TJ.FLAG_BOTTOMUP) != 0 ? "BU" : "TD",
|
||||
csName[cs], subNameLong[subsamp]);
|
||||
System.out.format("%-4d %-4d\t", tilew, tileh);
|
||||
System.out.format("%-5d %-5d ", tilew, tileh);
|
||||
}
|
||||
|
||||
_subsamp = subsamp;
|
||||
@@ -530,6 +511,16 @@ class TJBench {
|
||||
_ntilesw = (_w + _tilew - 1) / _tilew;
|
||||
_ntilesh = (_h + _tileh - 1) / _tileh;
|
||||
|
||||
if (xformOp == TJTransform.OP_TRANSPOSE ||
|
||||
xformOp == TJTransform.OP_TRANSVERSE ||
|
||||
xformOp == TJTransform.OP_ROT90 ||
|
||||
xformOp == TJTransform.OP_ROT270) {
|
||||
if (_subsamp == TJ.SAMP_422)
|
||||
_subsamp = TJ.SAMP_440;
|
||||
else if (_subsamp == TJ.SAMP_440)
|
||||
_subsamp = TJ.SAMP_422;
|
||||
}
|
||||
|
||||
TJTransform[] t = new TJTransform[_ntilesw * _ntilesh];
|
||||
jpegBuf = new byte[_ntilesw * _ntilesh][TJ.bufSize(_tilew, _tileh, subsamp)];
|
||||
|
||||
@@ -548,37 +539,45 @@ class TJBench {
|
||||
}
|
||||
}
|
||||
|
||||
start = getTime();
|
||||
tjt.transform(jpegBuf, t, flags);
|
||||
jpegSize = tjt.getTransformedSizes();
|
||||
elapsed = getTime() - start;
|
||||
|
||||
iter = -warmup;
|
||||
elapsed = 0.;
|
||||
while (true) {
|
||||
start = getTime();
|
||||
tjt.transform(jpegBuf, t, flags);
|
||||
jpegSize = tjt.getTransformedSizes();
|
||||
iter++;
|
||||
if (iter >= 1) {
|
||||
elapsed += getTime() - start;
|
||||
if (elapsed >= benchTime)
|
||||
break;
|
||||
}
|
||||
}
|
||||
t = null;
|
||||
|
||||
for (tile = 0, totalJpegSize = 0; tile < _ntilesw * _ntilesh; tile++)
|
||||
totalJpegSize += jpegSize[tile];
|
||||
|
||||
if (quiet != 0) {
|
||||
System.out.format("%s%c%s%c",
|
||||
System.out.format("%-6s%s%-6s%s",
|
||||
sigFig((double)(w * h) / 1000000. / elapsed, 4),
|
||||
quiet == 2 ? '\n' : '\t',
|
||||
quiet == 2 ? "\n" : " ",
|
||||
sigFig((double)(w * h * ps) / (double)totalJpegSize, 4),
|
||||
quiet == 2 ? '\n' : '\t');
|
||||
quiet == 2 ? "\n" : " ");
|
||||
} else if (quiet == 0) {
|
||||
System.out.format("X--> Frame rate: %f fps\n",
|
||||
System.out.format("Transform --> Frame rate: %f fps\n",
|
||||
1.0 / elapsed);
|
||||
System.out.format(" Output image size: %lu bytes\n",
|
||||
System.out.format(" Output image size: %d bytes\n",
|
||||
totalJpegSize);
|
||||
System.out.format(" Compression ratio: %f:1\n",
|
||||
System.out.format(" Compression ratio: %f:1\n",
|
||||
(double)(w * h * ps) / (double)totalJpegSize);
|
||||
System.out.format(" Source throughput: %f Megapixels/sec\n",
|
||||
System.out.format(" Throughput: %f Megapixels/sec\n",
|
||||
(double)(w * h) / 1000000. / elapsed);
|
||||
System.out.format(" Output bit stream: %f Megabits/sec\n",
|
||||
System.out.format(" Output bit stream: %f Megabits/sec\n",
|
||||
(double)totalJpegSize * 8. / 1000000. / elapsed);
|
||||
}
|
||||
} else {
|
||||
if (quiet == 1)
|
||||
System.out.print("N/A\tN/A\t");
|
||||
System.out.print("N/A N/A ");
|
||||
jpegBuf = new byte[1][TJ.bufSize(_tilew, _tileh, subsamp)];
|
||||
jpegSize = new int[1];
|
||||
jpegSize[0] = srcSize;
|
||||
@@ -590,8 +589,8 @@ class TJBench {
|
||||
if (h == tileh)
|
||||
_tileh = _h;
|
||||
if ((xformOpt & TJTransform.OPT_NOOUTPUT) == 0)
|
||||
decompTest(null, jpegBuf, jpegSize, null, _w, _h, _subsamp, 0,
|
||||
fileName, _tilew, _tileh);
|
||||
decomp(null, jpegBuf, jpegSize, null, _w, _h, _subsamp, 0,
|
||||
fileName, _tilew, _tileh);
|
||||
else if (quiet == 1)
|
||||
System.out.println("N/A");
|
||||
|
||||
@@ -610,7 +609,7 @@ class TJBench {
|
||||
String className = new TJBench().getClass().getName();
|
||||
|
||||
System.out.println("\nUSAGE: java " + className);
|
||||
System.out.println(" <Inputfile (BMP|YUV)> <Quality> [options]\n");
|
||||
System.out.println(" <Inputfile (BMP)> <Quality> [options]\n");
|
||||
System.out.println(" java " + className);
|
||||
System.out.println(" <Inputfile (JPG)> [options]\n");
|
||||
System.out.println("Options:\n");
|
||||
@@ -618,32 +617,24 @@ class TJBench {
|
||||
System.out.println("-bottomup = Test bottom-up compression/decompression");
|
||||
System.out.println("-tile = Test performance of the codec when the image is encoded as separate");
|
||||
System.out.println(" tiles of varying sizes.");
|
||||
System.out.println("-forcemmx, -forcesse, -forcesse2, -forcesse3 =");
|
||||
System.out.println(" Force MMX, SSE, SSE2, or SSE3 code paths in the underlying codec");
|
||||
System.out.println("-rgb, -bgr, -rgbx, -bgrx, -xbgr, -xrgb =");
|
||||
System.out.println(" Test the specified color conversion path in the codec (default: BGR)");
|
||||
System.out.println(" Test the specified color conversion path in the codec (default = BGR)");
|
||||
System.out.println("-fastupsample = Use the fastest chrominance upsampling algorithm available in");
|
||||
System.out.println(" the underlying codec");
|
||||
System.out.println("-fastdct = Use the fastest DCT/IDCT algorithms available in the underlying");
|
||||
System.out.println(" codec");
|
||||
System.out.println("-accuratedct = Use the most accurate DCT/IDCT algorithms available in the");
|
||||
System.out.println(" underlying codec");
|
||||
System.out.println("-subsamp <s> = if compressing a JPEG image from a YUV planar source image,");
|
||||
System.out.println(" this specifies the level of chrominance subsampling used in the source");
|
||||
System.out.println(" image. Otherwise, this specifies the level of chrominance subsampling");
|
||||
System.out.println(" to use in the JPEG destination image. <s> = 444, 422, 440, 420, 411,");
|
||||
System.out.println(" or GRAY");
|
||||
System.out.println("-subsamp <s> = When testing JPEG compression, this option specifies the level");
|
||||
System.out.println(" of chrominance subsampling to use (<s> = 444, 422, 440, 420, 411, or");
|
||||
System.out.println(" GRAY). The default is to test Grayscale, 4:2:0, 4:2:2, and 4:4:4 in");
|
||||
System.out.println(" sequence.");
|
||||
System.out.println("-quiet = Output results in tabular rather than verbose format");
|
||||
System.out.println("-yuvencode = Encode RGB input as planar YUV rather than compressing as JPEG");
|
||||
System.out.println("-yuvdecode = Decode JPEG image to planar YUV rather than RGB");
|
||||
System.out.println("-yuvsize WxH = if compressing a JPEG image from a YUV planar source image, this");
|
||||
System.out.println(" specifies the width and height of the source image.");
|
||||
System.out.println("-yuvpad <p> = if compressing a JPEG image from a YUV planar source image, this");
|
||||
System.out.println(" specifies the number of bytes to which each row of each plane in the");
|
||||
System.out.println(" source image is padded. If decompressing a JPEG image to a YUV planar");
|
||||
System.out.println(" destination image, this specifies the row padding for each plane of the");
|
||||
System.out.println(" destination image. (default=1)");
|
||||
System.out.println("-scale M/N = scale down the width/height of the decompressed JPEG image by a");
|
||||
System.out.println("-yuv = Test YUV encoding/decoding functions");
|
||||
System.out.println("-yuvpad <p> = If testing YUV encoding/decoding, this specifies the number of");
|
||||
System.out.println(" bytes to which each row of each plane in the intermediate YUV image is");
|
||||
System.out.println(" padded (default = 1)");
|
||||
System.out.println("-scale M/N = Scale down the width/height of the decompressed JPEG image by a");
|
||||
System.out.print (" factor of M/N (M/N = ");
|
||||
for (i = 0; i < nsf; i++) {
|
||||
System.out.format("%d/%d", scalingFactors[i].getNum(),
|
||||
@@ -666,7 +657,9 @@ 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("-componly = Stop after running compression tests. Do not test decompression.\n");
|
||||
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("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);
|
||||
@@ -687,25 +680,10 @@ class TJBench {
|
||||
String tempStr = argv[0].toLowerCase();
|
||||
if (tempStr.endsWith(".jpg") || tempStr.endsWith(".jpeg"))
|
||||
decompOnly = true;
|
||||
if (tempStr.endsWith(".yuv"))
|
||||
yuv = YUVCOMPRESS;
|
||||
|
||||
System.out.println("");
|
||||
|
||||
if (argv.length > minArg) {
|
||||
for (int i = minArg; i < argv.length; i++) {
|
||||
if (argv[i].equalsIgnoreCase("-yuvencode")) {
|
||||
System.out.println("Testing YUV planar encoding\n");
|
||||
yuv = YUVENCODE; maxQual = minQual = 100;
|
||||
}
|
||||
if (argv[i].equalsIgnoreCase("-yuvdecode")) {
|
||||
System.out.println("Testing YUV planar decoding\n");
|
||||
yuv = YUVDECODE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!decompOnly && yuv != YUVENCODE) {
|
||||
if (!decompOnly) {
|
||||
minArg = 2;
|
||||
if (argv.length < minArg)
|
||||
usage();
|
||||
@@ -729,22 +707,6 @@ class TJBench {
|
||||
if (argv[i].equalsIgnoreCase("-tile")) {
|
||||
doTile = true; xformOpt |= TJTransform.OPT_CROP;
|
||||
}
|
||||
if (argv[i].equalsIgnoreCase("-forcesse3")) {
|
||||
System.out.println("Forcing SSE3 code\n");
|
||||
flags |= TJ.FLAG_FORCESSE3;
|
||||
}
|
||||
if (argv[i].equalsIgnoreCase("-forcesse2")) {
|
||||
System.out.println("Forcing SSE2 code\n");
|
||||
flags |= TJ.FLAG_FORCESSE2;
|
||||
}
|
||||
if (argv[i].equalsIgnoreCase("-forcesse")) {
|
||||
System.out.println("Forcing SSE code\n");
|
||||
flags |= TJ.FLAG_FORCESSE;
|
||||
}
|
||||
if (argv[i].equalsIgnoreCase("-forcemmx")) {
|
||||
System.out.println("Forcing MMX code\n");
|
||||
flags |= TJ.FLAG_FORCEMMX;
|
||||
}
|
||||
if (argv[i].equalsIgnoreCase("-fastupsample")) {
|
||||
System.out.println("Using fast upsampling code\n");
|
||||
flags |= TJ.FLAG_FASTUPSAMPLE;
|
||||
@@ -826,18 +788,9 @@ class TJBench {
|
||||
else
|
||||
usage();
|
||||
}
|
||||
if (argv[i].equalsIgnoreCase("-yuvsize") && i < argv.length - 1) {
|
||||
int temp1 = 0, temp2 = 0;
|
||||
Scanner scanner = new Scanner(argv[++i]).useDelimiter("x");
|
||||
try {
|
||||
temp1 = scanner.nextInt();
|
||||
temp2 = scanner.nextInt();
|
||||
} catch(Exception e) {}
|
||||
if (temp1 >= 1 && temp2 >= 1) {
|
||||
w = temp1;
|
||||
h = temp2;
|
||||
} else
|
||||
usage();
|
||||
if (argv[i].equalsIgnoreCase("-yuv")) {
|
||||
System.out.println("Testing YUV planar encoding/decoding\n");
|
||||
doYUV = true;
|
||||
}
|
||||
if (argv[i].equalsIgnoreCase("-yuvpad") && i < argv.length - 1) {
|
||||
int temp = 0;
|
||||
@@ -864,6 +817,16 @@ class TJBench {
|
||||
}
|
||||
if (argv[i].equalsIgnoreCase("-componly"))
|
||||
compOnly = true;
|
||||
if (argv[i].equalsIgnoreCase("-warmup") && i < argv.length - 1) {
|
||||
int temp = -1;
|
||||
try {
|
||||
temp = Integer.parseInt(argv[++i]);
|
||||
} catch (NumberFormatException e) {}
|
||||
if (temp >= 0) {
|
||||
warmup = temp;
|
||||
System.out.format("Warmup runs = %d\n\n", warmup);
|
||||
}
|
||||
}
|
||||
if (argv[i].equalsIgnoreCase("-?"))
|
||||
usage();
|
||||
}
|
||||
@@ -878,67 +841,60 @@ class TJBench {
|
||||
doTile = false;
|
||||
}
|
||||
|
||||
if (yuv != 0 && doTile) {
|
||||
System.out.println("Disabling tiled compression/decompression tests, because those tests do not");
|
||||
System.out.println("work when YUV encoding, compression, or decoding is enabled.\n");
|
||||
doTile = false;
|
||||
}
|
||||
|
||||
if (!decompOnly) {
|
||||
if(yuv == YUVCOMPRESS) {
|
||||
if (w < 1 || h < 1 || subsamp < 0 || subsamp >= TJ.NUMSAMP)
|
||||
throw new Exception("YUV image size and/or subsampling not specified");
|
||||
FileInputStream fis = new FileInputStream(argv[0]);
|
||||
int srcSize = (int)fis.getChannel().size();
|
||||
if (srcSize != TJ.bufSizeYUV(w, yuvpad, h, subsamp))
|
||||
throw new Exception("YUV image file is the wrong size");
|
||||
srcBuf = new byte[srcSize];
|
||||
fis.read(srcBuf, 0, srcSize);
|
||||
fis.close();
|
||||
}
|
||||
else {
|
||||
int[] width = new int[1], height = new int[1];
|
||||
srcBuf = loadImage(argv[0], width, height, pf);
|
||||
w = width[0]; h = height[0];
|
||||
int index = -1;
|
||||
if ((index = argv[0].indexOf('.')) >= 0)
|
||||
argv[0] = argv[0].substring(0, index);
|
||||
}
|
||||
int[] width = new int[1], height = new int[1];
|
||||
srcBuf = loadImage(argv[0], width, height, pf);
|
||||
w = width[0]; h = height[0];
|
||||
int index = -1;
|
||||
if ((index = argv[0].lastIndexOf('.')) >= 0)
|
||||
argv[0] = argv[0].substring(0, index);
|
||||
}
|
||||
|
||||
if (quiet == 1 && !decompOnly) {
|
||||
System.out.println("All performance values in Mpixels/sec\n");
|
||||
System.out.format("Bitmap\tBitmap\tJPEG\tJPEG\t%s %s \tComp\tComp\tDecomp\n",
|
||||
System.out.format("Bitmap JPEG JPEG %s %s ",
|
||||
(doTile ? "Tile " : "Image"), (doTile ? "Tile " : "Image"));
|
||||
System.out.println("Format\tOrder\tSubsamp\tQual\tWidth Height\tPerf \tRatio\tPerf\n");
|
||||
if (doYUV)
|
||||
System.out.print("Encode ");
|
||||
System.out.print("Comp Comp Decomp ");
|
||||
if (doYUV)
|
||||
System.out.print("Decode");
|
||||
System.out.print("\n");
|
||||
System.out.print("Format Subsamp Qual Width Height ");
|
||||
if (doYUV)
|
||||
System.out.print("Perf ");
|
||||
System.out.print("Perf Ratio Perf ");
|
||||
if (doYUV)
|
||||
System.out.print("Perf");
|
||||
System.out.println("\n");
|
||||
}
|
||||
|
||||
if (decompOnly) {
|
||||
doDecompTest(argv[0]);
|
||||
decompTest(argv[0]);
|
||||
System.out.println("");
|
||||
System.exit(retval);
|
||||
}
|
||||
|
||||
System.gc();
|
||||
if (yuv == YUVCOMPRESS || (subsamp >= 0 && subsamp < TJ.NUMSAMP)) {
|
||||
if (subsamp >= 0 && subsamp < TJ.NUMSAMP) {
|
||||
for (int i = maxQual; i >= minQual; i--)
|
||||
doTest(srcBuf, w, h, subsamp, i, argv[0]);
|
||||
fullTest(srcBuf, w, h, subsamp, i, argv[0]);
|
||||
System.out.println("");
|
||||
} else {
|
||||
for (int i = maxQual; i >= minQual; i--)
|
||||
doTest(srcBuf, w, h, TJ.SAMP_GRAY, i, argv[0]);
|
||||
fullTest(srcBuf, w, h, TJ.SAMP_GRAY, i, argv[0]);
|
||||
System.out.println("");
|
||||
System.gc();
|
||||
for (int i = maxQual; i >= minQual; i--)
|
||||
doTest(srcBuf, w, h, TJ.SAMP_420, i, argv[0]);
|
||||
fullTest(srcBuf, w, h, TJ.SAMP_420, i, argv[0]);
|
||||
System.out.println("");
|
||||
System.gc();
|
||||
for (int i = maxQual; i >= minQual; i--)
|
||||
doTest(srcBuf, w, h, TJ.SAMP_422, i, argv[0]);
|
||||
fullTest(srcBuf, w, h, TJ.SAMP_422, i, argv[0]);
|
||||
System.out.println("");
|
||||
System.gc();
|
||||
for (int i = maxQual; i >= minQual; i--)
|
||||
doTest(srcBuf, w, h, TJ.SAMP_444, i, argv[0]);
|
||||
fullTest(srcBuf, w, h, TJ.SAMP_444, i, argv[0]);
|
||||
System.out.println("");
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C)2011-2012 D. R. Commander. All Rights Reserved.
|
||||
* Copyright (C)2011-2012, 2014 D. R. Commander. All Rights Reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
@@ -324,11 +324,11 @@ public class TJExample implements TJCustomFilter {
|
||||
tjc.setSubsamp(outSubsamp);
|
||||
tjc.setJPEGQuality(outQual);
|
||||
if (img != null)
|
||||
jpegBuf = tjc.compress(img, flags);
|
||||
tjc.setSourceImage(img, 0, 0, 0, 0);
|
||||
else {
|
||||
tjc.setSourceImage(bmpBuf, width, 0, height, TJ.PF_BGRX);
|
||||
jpegBuf = tjc.compress(flags);
|
||||
tjc.setSourceImage(bmpBuf, 0, 0, width, 0, height, TJ.PF_BGRX);
|
||||
}
|
||||
jpegBuf = tjc.compress(flags);
|
||||
jpegSize = tjc.getCompressedSize();
|
||||
tjc.close();
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C)2011-2013 D. R. Commander. All Rights Reserved.
|
||||
* Copyright (C)2011-2014 D. R. Commander. All Rights Reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
@@ -92,9 +92,7 @@ public class TJUnitTest {
|
||||
TJ.PF_RGB
|
||||
};
|
||||
|
||||
private static final int YUVENCODE = 1;
|
||||
private static final int YUVDECODE = 2;
|
||||
private static int yuv = 0;
|
||||
private static boolean doYUV = false;
|
||||
private static int pad = 4;
|
||||
private static boolean bi = false;
|
||||
|
||||
@@ -152,10 +150,6 @@ public class TJUnitTest {
|
||||
return "Unknown";
|
||||
}
|
||||
|
||||
private static double getTime() {
|
||||
return (double)System.nanoTime() / 1.0e9;
|
||||
}
|
||||
|
||||
private static void initBuf(byte[] buf, int w, int pitch, int h, int pf,
|
||||
int flags) throws Exception {
|
||||
int roffset = TJ.getRedOffset(pf);
|
||||
@@ -538,54 +532,6 @@ public class TJUnitTest {
|
||||
return ((v + (p) - 1) & (~((p) - 1)));
|
||||
}
|
||||
|
||||
private static void initBufYUV(byte[] buf, int w, int pad, int h,
|
||||
int subsamp) throws Exception {
|
||||
int row, col;
|
||||
int hsf = TJ.getMCUWidth(subsamp) / 8, vsf = TJ.getMCUHeight(subsamp) / 8;
|
||||
int pw = PAD(w, hsf), ph = PAD(h, vsf);
|
||||
int cw = pw / hsf, ch = ph / vsf;
|
||||
int ypitch = PAD(pw, pad), uvpitch = PAD(cw, pad);
|
||||
int halfway = 16, blockSize = 8;
|
||||
|
||||
Arrays.fill(buf, (byte)0);
|
||||
for (row = 0; row < ph; row++) {
|
||||
for (col = 0; col < pw; col++) {
|
||||
int index = ypitch * row + col;
|
||||
if (((row / blockSize) + (col / blockSize)) % 2 == 0) {
|
||||
if (row < halfway)
|
||||
buf[index] = (byte)255;
|
||||
else
|
||||
buf[index] = 0;
|
||||
} else {
|
||||
if (row < halfway)
|
||||
buf[index] = 76;
|
||||
else
|
||||
buf[index] = (byte)226;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (subsamp != TJ.SAMP_GRAY) {
|
||||
halfway = 16 / vsf;
|
||||
for (row = 0; row < ch; row++) {
|
||||
for (col = 0; col < cw; col++) {
|
||||
int uindex = ypitch * ph + (uvpitch * row + col),
|
||||
vindex = ypitch * ph + uvpitch * ch + (uvpitch * row + col);
|
||||
if (((row * vsf / blockSize) + (col * hsf / blockSize)) % 2 == 0) {
|
||||
buf[uindex] = buf[vindex] = (byte)128;
|
||||
} else {
|
||||
if (row < halfway) {
|
||||
buf[uindex] = 85;
|
||||
buf[vindex] = (byte)255;
|
||||
} else {
|
||||
buf[uindex] = 0;
|
||||
buf[vindex] = (byte)149;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static int checkBufYUV(byte[] buf, int size, int w, int h,
|
||||
int subsamp, TJScalingFactor sf)
|
||||
throws Exception {
|
||||
@@ -690,96 +636,68 @@ public class TJUnitTest {
|
||||
private static int compTest(TJCompressor tjc, byte[] dstBuf, int w,
|
||||
int h, int pf, String baseName, int subsamp,
|
||||
int jpegQual, int flags) throws Exception {
|
||||
String tempstr;
|
||||
String tempStr;
|
||||
byte[] srcBuf = null;
|
||||
BufferedImage img = null;
|
||||
String pfStr;
|
||||
String pfStr, pfStrLong;
|
||||
String buStr = (flags & TJ.FLAG_BOTTOMUP) != 0 ? "BU" : "TD";
|
||||
String buStrLong = (flags & TJ.FLAG_BOTTOMUP) != 0 ?
|
||||
"Bottom-Up" : "Top-Down ";
|
||||
String buStr = (flags & TJ.FLAG_BOTTOMUP) != 0 ? "BU" : "TD";
|
||||
double t;
|
||||
int size = 0, ps, imgType = pf;
|
||||
|
||||
if (yuv == YUVDECODE) {
|
||||
System.out.format("YUV %s %s --> JPEG Q%d ... ", subNameLong[subsamp],
|
||||
buStrLong, jpegQual);
|
||||
srcBuf = new byte[TJ.bufSizeYUV(w, pad, h, subsamp)];
|
||||
initBufYUV(srcBuf, w, pad, h, subsamp);
|
||||
pfStr = "YUV";
|
||||
if (bi) {
|
||||
pf = biTypePF(imgType);
|
||||
pfStr = biTypeStr(imgType);
|
||||
pfStrLong = pfStr + " (" + pixFormatStr[pf] + ")";
|
||||
} else {
|
||||
if (bi) {
|
||||
pf = biTypePF(imgType);
|
||||
pfStr = biTypeStr(imgType);
|
||||
} else
|
||||
pfStr = pixFormatStr[pf];
|
||||
ps = TJ.getPixelSize(pf);
|
||||
pfStr = pixFormatStr[pf];
|
||||
pfStrLong = pfStr;
|
||||
}
|
||||
ps = TJ.getPixelSize(pf);
|
||||
|
||||
System.out.print(pfStr + " ");
|
||||
if (bi)
|
||||
System.out.print("(" + pixFormatStr[pf] + ") ");
|
||||
if (yuv == YUVENCODE)
|
||||
System.out.format("%s -> %s YUV ... ", buStrLong,
|
||||
subNameLong[subsamp]);
|
||||
else
|
||||
System.out.format("%s -> %s Q%d ... ", buStrLong, subNameLong[subsamp],
|
||||
jpegQual);
|
||||
|
||||
if (bi) {
|
||||
img = new BufferedImage(w, h, imgType);
|
||||
initImg(img, pf, flags);
|
||||
tempstr = baseName + "_enc_" + pfStr + "_" + buStr + "_" +
|
||||
subName[subsamp] + "_Q" + jpegQual + ".png";
|
||||
File file = new File(tempstr);
|
||||
ImageIO.write(img, "png", file);
|
||||
} else {
|
||||
srcBuf = new byte[w * h * ps + 1];
|
||||
initBuf(srcBuf, w, w * ps, h, pf, flags);
|
||||
}
|
||||
if (bi) {
|
||||
img = new BufferedImage(w, h, imgType);
|
||||
initImg(img, pf, flags);
|
||||
tempStr = baseName + "_enc_" + pfStr + "_" + buStr + "_" +
|
||||
subName[subsamp] + "_Q" + jpegQual + ".png";
|
||||
File file = new File(tempStr);
|
||||
ImageIO.write(img, "png", file);
|
||||
tjc.setSourceImage(img, 0, 0, 0, 0);
|
||||
} else {
|
||||
srcBuf = new byte[w * h * ps + 1];
|
||||
initBuf(srcBuf, w, w * ps, h, pf, flags);
|
||||
tjc.setSourceImage(srcBuf, 0, 0, w, 0, h, pf);
|
||||
}
|
||||
Arrays.fill(dstBuf, (byte)0);
|
||||
|
||||
t = getTime();
|
||||
tjc.setSubsamp(subsamp);
|
||||
tjc.setJPEGQuality(jpegQual);
|
||||
tjc.setYUVPad(pad);
|
||||
if (bi) {
|
||||
if (yuv == YUVENCODE)
|
||||
tjc.encodeYUV(img, dstBuf, flags);
|
||||
else
|
||||
tjc.compress(img, dstBuf, flags);
|
||||
} else {
|
||||
if (yuv == YUVDECODE)
|
||||
tjc.setSourceImageYUV(srcBuf, w, pad, h);
|
||||
else
|
||||
tjc.setSourceImage(srcBuf, w, 0, h, pf);
|
||||
if (yuv == YUVENCODE)
|
||||
tjc.encodeYUV(dstBuf, flags);
|
||||
else
|
||||
tjc.compress(dstBuf, flags);
|
||||
}
|
||||
size = tjc.getCompressedSize();
|
||||
t = getTime() - t;
|
||||
|
||||
if (yuv == YUVENCODE)
|
||||
tempstr = baseName + "_enc_" + pfStr + "_" + buStr + "_" +
|
||||
subName[subsamp] + ".yuv";
|
||||
else
|
||||
tempstr = baseName + "_enc_" + pfStr + "_" + buStr + "_" +
|
||||
subName[subsamp] + "_Q" + jpegQual + ".jpg";
|
||||
writeJPEG(dstBuf, size, tempstr);
|
||||
|
||||
if (yuv == YUVENCODE) {
|
||||
if (checkBufYUV(dstBuf, size, w, h, subsamp,
|
||||
new TJScalingFactor(1, 1)) == 1)
|
||||
System.out.print("Passed.");
|
||||
if (doYUV) {
|
||||
System.out.format("%s %s -> YUV %s ... ", pfStrLong, buStrLong,
|
||||
subNameLong[subsamp]);
|
||||
YUVImage yuvImage = tjc.encodeYUV(pad, flags);
|
||||
if (checkBufYUV(yuvImage.getBuf(), yuvImage.getSize(), w, h, subsamp,
|
||||
new TJScalingFactor(1, 1)) == 1)
|
||||
System.out.print("Passed.\n");
|
||||
else {
|
||||
System.out.print("FAILED!");
|
||||
System.out.print("FAILED!\n");
|
||||
exitStatus = -1;
|
||||
}
|
||||
} else
|
||||
System.out.print("Done.");
|
||||
System.out.format(" %.6f ms\n", t * 1000.);
|
||||
System.out.println(" Result in " + tempstr);
|
||||
|
||||
System.out.format("YUV %s %s -> JPEG Q%d ... ", subNameLong[subsamp],
|
||||
buStrLong, jpegQual);
|
||||
tjc.setSourceImage(yuvImage);
|
||||
} else {
|
||||
System.out.format("%s %s -> %s Q%d ... ", pfStrLong, buStrLong,
|
||||
subNameLong[subsamp], jpegQual);
|
||||
}
|
||||
tjc.compress(dstBuf, flags);
|
||||
size = tjc.getCompressedSize();
|
||||
|
||||
tempStr = baseName + "_enc_" + pfStr + "_" + buStr + "_" +
|
||||
subName[subsamp] + "_Q" + jpegQual + ".jpg";
|
||||
writeJPEG(dstBuf, size, tempStr);
|
||||
System.out.println("Done.\n Result in " + tempStr);
|
||||
|
||||
return size;
|
||||
}
|
||||
@@ -788,41 +706,25 @@ public class TJUnitTest {
|
||||
int jpegSize, int w, int h, int pf,
|
||||
String baseName, int subsamp, int flags,
|
||||
TJScalingFactor sf) throws Exception {
|
||||
String pfStr, tempstr;
|
||||
double t;
|
||||
String pfStr, pfStrLong, tempStr;
|
||||
String buStrLong = (flags & TJ.FLAG_BOTTOMUP) != 0 ?
|
||||
"Bottom-Up" : "Top-Down ";
|
||||
int scaledWidth = sf.getScaled(w);
|
||||
int scaledHeight = sf.getScaled(h);
|
||||
int temp1, temp2, imgType = pf;
|
||||
BufferedImage img = null;
|
||||
byte[] dstBuf = null;
|
||||
|
||||
if (yuv == YUVENCODE) return;
|
||||
|
||||
if (bi) {
|
||||
pf = biTypePF(imgType);
|
||||
pfStr = biTypeStr(imgType);
|
||||
} else
|
||||
pfStrLong = pfStr + " (" + pixFormatStr[pf] + ")";
|
||||
} else {
|
||||
pfStr = pixFormatStr[pf];
|
||||
|
||||
System.out.print("JPEG -> ");
|
||||
if (yuv == YUVDECODE)
|
||||
System.out.print("YUV " + subNameLong[subsamp] + " ");
|
||||
else {
|
||||
System.out.print(pfStr + " ");
|
||||
if (bi)
|
||||
System.out.print("(" + pixFormatStr[pf] + ") ");
|
||||
if ((flags & TJ.FLAG_BOTTOMUP) != 0)
|
||||
System.out.print("Bottom-Up ");
|
||||
else
|
||||
System.out.print("Top-Down ");
|
||||
pfStrLong = pfStr;
|
||||
}
|
||||
if (!sf.isOne())
|
||||
System.out.print(sf.getNum() + "/" + sf.getDenom() + " ... ");
|
||||
else
|
||||
System.out.print("... ");
|
||||
|
||||
t = getTime();
|
||||
tjd.setJPEGImage(jpegBuf, jpegSize);
|
||||
tjd.setSourceImage(jpegBuf, jpegSize);
|
||||
if (tjd.getWidth() != w || tjd.getHeight() != h ||
|
||||
tjd.getSubsamp() != subsamp)
|
||||
throw new Exception("Incorrect JPEG header");
|
||||
@@ -834,44 +736,52 @@ public class TJUnitTest {
|
||||
if (temp1 != scaledWidth || temp2 != scaledHeight)
|
||||
throw new Exception("Scaled size mismatch");
|
||||
|
||||
if (yuv == YUVDECODE)
|
||||
dstBuf = tjd.decompressToYUV(scaledWidth, pad, scaledHeight, flags);
|
||||
else {
|
||||
if (bi)
|
||||
img = tjd.decompress(scaledWidth, scaledHeight, imgType, flags);
|
||||
else
|
||||
dstBuf = tjd.decompress(scaledWidth, 0, scaledHeight, pf, flags);
|
||||
if (doYUV) {
|
||||
System.out.format("JPEG -> YUV %s ", subNameLong[subsamp]);
|
||||
if(!sf.isOne())
|
||||
System.out.format("%d/%d ... ", sf.getNum(), sf.getDenom());
|
||||
else System.out.print("... ");
|
||||
YUVImage yuvImage = tjd.decompressToYUV(scaledWidth, pad, scaledHeight,
|
||||
flags);
|
||||
if (checkBufYUV(yuvImage.getBuf(), yuvImage.getSize(), scaledWidth,
|
||||
scaledHeight, subsamp, sf) == 1)
|
||||
System.out.print("Passed.\n");
|
||||
else {
|
||||
System.out.print("FAILED!\n"); exitStatus = -1;
|
||||
}
|
||||
|
||||
System.out.format("YUV %s -> %s %s ... ", subNameLong[subsamp],
|
||||
pfStrLong, buStrLong);
|
||||
tjd.setSourceImage(yuvImage);
|
||||
} else {
|
||||
System.out.format("JPEG -> %s %s ", pfStrLong, buStrLong);
|
||||
if(!sf.isOne())
|
||||
System.out.format("%d/%d ... ", sf.getNum(), sf.getDenom());
|
||||
else System.out.print("... ");
|
||||
}
|
||||
t = getTime() - t;
|
||||
if (bi)
|
||||
img = tjd.decompress(scaledWidth, scaledHeight, imgType, flags);
|
||||
else
|
||||
dstBuf = tjd.decompress(scaledWidth, 0, scaledHeight, pf, flags);
|
||||
|
||||
if (bi) {
|
||||
tempstr = baseName + "_dec_" + pfStr + "_" +
|
||||
tempStr = baseName + "_dec_" + pfStr + "_" +
|
||||
(((flags & TJ.FLAG_BOTTOMUP) != 0) ? "BU" : "TD") + "_" +
|
||||
subName[subsamp] + "_" +
|
||||
(double)sf.getNum() / (double)sf.getDenom() + "x" + ".png";
|
||||
File file = new File(tempstr);
|
||||
File file = new File(tempStr);
|
||||
ImageIO.write(img, "png", file);
|
||||
}
|
||||
|
||||
if (yuv == YUVDECODE) {
|
||||
if (checkBufYUV(dstBuf, dstBuf.length, scaledWidth, scaledHeight,
|
||||
subsamp, sf) == 1)
|
||||
System.out.print("Passed.");
|
||||
else {
|
||||
System.out.print("FAILED!"); exitStatus = -1;
|
||||
}
|
||||
} else {
|
||||
if ((bi && checkImg(img, pf, subsamp, sf, flags) == 1) ||
|
||||
(!bi && checkBuf(dstBuf, scaledWidth,
|
||||
scaledWidth * TJ.getPixelSize(pf), scaledHeight, pf,
|
||||
subsamp, sf, flags) == 1))
|
||||
System.out.print("Passed.");
|
||||
else {
|
||||
System.out.print("FAILED!");
|
||||
exitStatus = -1;
|
||||
}
|
||||
if ((bi && checkImg(img, pf, subsamp, sf, flags) == 1) ||
|
||||
(!bi && checkBuf(dstBuf, scaledWidth,
|
||||
scaledWidth * TJ.getPixelSize(pf), scaledHeight, pf,
|
||||
subsamp, sf, flags) == 1))
|
||||
System.out.print("Passed.\n");
|
||||
else {
|
||||
System.out.print("FAILED!\n");
|
||||
exitStatus = -1;
|
||||
}
|
||||
System.out.format(" %.6f ms\n", t * 1000.);
|
||||
}
|
||||
|
||||
private static void decompTest(TJDecompressor tjd, byte[] jpegBuf,
|
||||
@@ -900,10 +810,7 @@ public class TJUnitTest {
|
||||
int size;
|
||||
byte[] dstBuf;
|
||||
|
||||
if (yuv == YUVENCODE)
|
||||
dstBuf = new byte[TJ.bufSizeYUV(w, pad, h, subsamp)];
|
||||
else
|
||||
dstBuf = new byte[TJ.bufSize(w, h, subsamp)];
|
||||
dstBuf = new byte[TJ.bufSize(w, h, subsamp)];
|
||||
|
||||
try {
|
||||
tjc = new TJCompressor();
|
||||
@@ -916,20 +823,16 @@ public class TJUnitTest {
|
||||
if (subsamp == TJ.SAMP_422 || subsamp == TJ.SAMP_420 ||
|
||||
subsamp == TJ.SAMP_440 || subsamp == TJ.SAMP_411)
|
||||
flags |= TJ.FLAG_FASTUPSAMPLE;
|
||||
if (i == 1) {
|
||||
if (yuv == YUVDECODE) {
|
||||
tjc.close();
|
||||
tjd.close();
|
||||
return;
|
||||
} else
|
||||
flags |= TJ.FLAG_BOTTOMUP;
|
||||
}
|
||||
if (i == 1)
|
||||
flags |= TJ.FLAG_BOTTOMUP;
|
||||
size = compTest(tjc, dstBuf, w, h, pf, baseName, subsamp, 100,
|
||||
flags);
|
||||
decompTest(tjd, dstBuf, size, w, h, pf, baseName, subsamp, flags);
|
||||
if (pf >= TJ.PF_RGBX && pf <= TJ.PF_XRGB && !bi)
|
||||
if (pf >= TJ.PF_RGBX && pf <= TJ.PF_XRGB && !bi) {
|
||||
System.out.print("\n");
|
||||
decompTest(tjd, dstBuf, size, w, h, pf + (TJ.PF_RGBA - TJ.PF_RGBX),
|
||||
baseName, subsamp, flags);
|
||||
}
|
||||
System.out.print("\n");
|
||||
}
|
||||
}
|
||||
@@ -945,7 +848,8 @@ public class TJUnitTest {
|
||||
|
||||
private static void bufSizeTest() throws Exception {
|
||||
int w, h, i, subsamp;
|
||||
byte[] srcBuf, jpegBuf;
|
||||
byte[] srcBuf, dstBuf = null;
|
||||
YUVImage dstImage = null;
|
||||
TJCompressor tjc = null;
|
||||
Random r = new Random();
|
||||
|
||||
@@ -959,22 +863,34 @@ public class TJUnitTest {
|
||||
if (h % 100 == 0)
|
||||
System.out.format("%04d x %04d\b\b\b\b\b\b\b\b\b\b\b", w, h);
|
||||
srcBuf = new byte[w * h * 4];
|
||||
jpegBuf = new byte[TJ.bufSize(w, h, subsamp)];
|
||||
if (doYUV)
|
||||
dstImage = new YUVImage(w, pad, h, subsamp);
|
||||
else
|
||||
dstBuf = new byte[TJ.bufSize(w, h, subsamp)];
|
||||
for (i = 0; i < w * h * 4; i++) {
|
||||
srcBuf[i] = (byte)(r.nextInt(2) * 255);
|
||||
}
|
||||
tjc.setSourceImage(srcBuf, w, 0, h, TJ.PF_BGRX);
|
||||
tjc.setSourceImage(srcBuf, 0, 0, w, 0, h, TJ.PF_BGRX);
|
||||
tjc.setSubsamp(subsamp);
|
||||
tjc.setJPEGQuality(100);
|
||||
tjc.compress(jpegBuf, 0);
|
||||
if (doYUV)
|
||||
tjc.encodeYUV(dstImage, 0);
|
||||
else
|
||||
tjc.compress(dstBuf, 0);
|
||||
|
||||
srcBuf = new byte[h * w * 4];
|
||||
jpegBuf = new byte[TJ.bufSize(h, w, subsamp)];
|
||||
if (doYUV)
|
||||
dstImage = new YUVImage(h, pad, w, subsamp);
|
||||
else
|
||||
dstBuf = new byte[TJ.bufSize(h, w, subsamp)];
|
||||
for (i = 0; i < h * w * 4; i++) {
|
||||
srcBuf[i] = (byte)(r.nextInt(2) * 255);
|
||||
}
|
||||
tjc.setSourceImage(srcBuf, h, 0, w, TJ.PF_BGRX);
|
||||
tjc.compress(jpegBuf, 0);
|
||||
tjc.setSourceImage(srcBuf, 0, 0, h, 0, w, TJ.PF_BGRX);
|
||||
if (doYUV)
|
||||
tjc.encodeYUV(dstImage, 0);
|
||||
else
|
||||
tjc.compress(dstBuf, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -989,10 +905,9 @@ public class TJUnitTest {
|
||||
public static void main(String[] argv) {
|
||||
try {
|
||||
String testName = "javatest";
|
||||
boolean doyuv = false;
|
||||
for (int i = 0; i < argv.length; i++) {
|
||||
if (argv[i].equalsIgnoreCase("-yuv"))
|
||||
doyuv = true;
|
||||
doYUV = true;
|
||||
if (argv[i].equalsIgnoreCase("-noyuvpad"))
|
||||
pad = 1;
|
||||
if (argv[i].substring(0, 1).equalsIgnoreCase("-h") ||
|
||||
@@ -1003,10 +918,8 @@ public class TJUnitTest {
|
||||
testName = "javabitest";
|
||||
}
|
||||
}
|
||||
if (doyuv) {
|
||||
yuv = YUVENCODE;
|
||||
if (doYUV)
|
||||
_4byteFormats[4] = -1;
|
||||
}
|
||||
doTest(35, 39, bi ? _3byteFormatsBI : _3byteFormats, TJ.SAMP_444,
|
||||
testName);
|
||||
doTest(39, 41, bi ? _4byteFormatsBI : _4byteFormats, TJ.SAMP_444,
|
||||
@@ -1033,24 +946,17 @@ public class TJUnitTest {
|
||||
_4byteFormats[4] = -1;
|
||||
doTest(35, 39, bi ? _4byteFormatsBI : _4byteFormats, TJ.SAMP_GRAY,
|
||||
testName);
|
||||
if (!doyuv && !bi)
|
||||
if (!bi)
|
||||
bufSizeTest();
|
||||
if (doyuv && !bi) {
|
||||
yuv = YUVDECODE;
|
||||
if (doYUV && !bi) {
|
||||
System.out.print("\n--------------------\n\n");
|
||||
doTest(48, 48, onlyRGB, TJ.SAMP_444, "javatest_yuv0");
|
||||
doTest(35, 39, onlyRGB, TJ.SAMP_444, "javatest_yuv1");
|
||||
doTest(48, 48, onlyRGB, TJ.SAMP_422, "javatest_yuv0");
|
||||
doTest(39, 41, onlyRGB, TJ.SAMP_422, "javatest_yuv1");
|
||||
doTest(48, 48, onlyRGB, TJ.SAMP_420, "javatest_yuv0");
|
||||
doTest(41, 35, onlyRGB, TJ.SAMP_420, "javatest_yuv1");
|
||||
doTest(48, 48, onlyRGB, TJ.SAMP_440, "javatest_yuv0");
|
||||
doTest(35, 39, onlyRGB, TJ.SAMP_440, "javatest_yuv1");
|
||||
doTest(48, 48, onlyRGB, TJ.SAMP_411, "javatest_yuv0");
|
||||
doTest(39, 41, onlyRGB, TJ.SAMP_411, "javatest_yuv1");
|
||||
doTest(48, 48, onlyRGB, TJ.SAMP_GRAY, "javatest_yuv0");
|
||||
doTest(41, 35, onlyRGB, TJ.SAMP_GRAY, "javatest_yuv1");
|
||||
doTest(48, 48, onlyGray, TJ.SAMP_GRAY, "javatest_yuv0");
|
||||
doTest(35, 39, onlyGray, TJ.SAMP_GRAY, "javatest_yuv1");
|
||||
}
|
||||
} catch(Exception e) {
|
||||
e.printStackTrace();
|
||||
|
||||
@@ -1,41 +1,23 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<!--NewPage-->
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>
|
||||
All Classes
|
||||
</TITLE>
|
||||
|
||||
|
||||
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
|
||||
|
||||
|
||||
</HEAD>
|
||||
|
||||
<BODY BGCOLOR="white">
|
||||
<FONT size="+1" CLASS="FrameHeadingFont">
|
||||
<B>All Classes</B></FONT>
|
||||
<BR>
|
||||
|
||||
<TABLE BORDER="0" WIDTH="100%" SUMMARY="">
|
||||
<TR>
|
||||
<TD NOWRAP><FONT CLASS="FrameItemFont"><A HREF="org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg" target="classFrame">TJ</A>
|
||||
<BR>
|
||||
<A HREF="org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg" target="classFrame">TJCompressor</A>
|
||||
<BR>
|
||||
<A HREF="org/libjpegturbo/turbojpeg/TJCustomFilter.html" title="interface in org.libjpegturbo.turbojpeg" target="classFrame"><I>TJCustomFilter</I></A>
|
||||
<BR>
|
||||
<A HREF="org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg" target="classFrame">TJDecompressor</A>
|
||||
<BR>
|
||||
<A HREF="org/libjpegturbo/turbojpeg/TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg" target="classFrame">TJScalingFactor</A>
|
||||
<BR>
|
||||
<A HREF="org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg" target="classFrame">TJTransform</A>
|
||||
<BR>
|
||||
<A HREF="org/libjpegturbo/turbojpeg/TJTransformer.html" title="class in org.libjpegturbo.turbojpeg" target="classFrame">TJTransformer</A>
|
||||
<BR>
|
||||
</FONT></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
<!-- NewPage -->
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>All Classes</title>
|
||||
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
|
||||
</head>
|
||||
<body>
|
||||
<h1 class="bar">All Classes</h1>
|
||||
<div class="indexContainer">
|
||||
<ul>
|
||||
<li><a href="org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg" target="classFrame">TJ</a></li>
|
||||
<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/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>
|
||||
<li><a href="org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg" target="classFrame">YUVImage</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1,41 +1,23 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<!--NewPage-->
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>
|
||||
All Classes
|
||||
</TITLE>
|
||||
|
||||
|
||||
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
|
||||
|
||||
|
||||
</HEAD>
|
||||
|
||||
<BODY BGCOLOR="white">
|
||||
<FONT size="+1" CLASS="FrameHeadingFont">
|
||||
<B>All Classes</B></FONT>
|
||||
<BR>
|
||||
|
||||
<TABLE BORDER="0" WIDTH="100%" SUMMARY="">
|
||||
<TR>
|
||||
<TD NOWRAP><FONT CLASS="FrameItemFont"><A HREF="org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</A>
|
||||
<BR>
|
||||
<A HREF="org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg">TJCompressor</A>
|
||||
<BR>
|
||||
<A HREF="org/libjpegturbo/turbojpeg/TJCustomFilter.html" title="interface in org.libjpegturbo.turbojpeg"><I>TJCustomFilter</I></A>
|
||||
<BR>
|
||||
<A HREF="org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</A>
|
||||
<BR>
|
||||
<A HREF="org/libjpegturbo/turbojpeg/TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg">TJScalingFactor</A>
|
||||
<BR>
|
||||
<A HREF="org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</A>
|
||||
<BR>
|
||||
<A HREF="org/libjpegturbo/turbojpeg/TJTransformer.html" title="class in org.libjpegturbo.turbojpeg">TJTransformer</A>
|
||||
<BR>
|
||||
</FONT></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
<!-- NewPage -->
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>All Classes</title>
|
||||
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
|
||||
</head>
|
||||
<body>
|
||||
<h1 class="bar">All Classes</h1>
|
||||
<div class="indexContainer">
|
||||
<ul>
|
||||
<li><a href="org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></li>
|
||||
<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/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>
|
||||
<li><a href="org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1,462 +1,479 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<!--NewPage-->
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>
|
||||
Constant Field Values
|
||||
</TITLE>
|
||||
|
||||
|
||||
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
|
||||
|
||||
<SCRIPT type="text/javascript">
|
||||
function windowTitle()
|
||||
{
|
||||
<!-- NewPage -->
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Constant Field Values</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="Constant Field Values";
|
||||
}
|
||||
}
|
||||
</SCRIPT>
|
||||
<NOSCRIPT>
|
||||
</NOSCRIPT>
|
||||
|
||||
</HEAD>
|
||||
|
||||
<BODY BGCOLOR="white" onload="windowTitle();">
|
||||
<HR>
|
||||
|
||||
|
||||
//-->
|
||||
</script>
|
||||
<noscript>
|
||||
<div>JavaScript is disabled on your browser.</div>
|
||||
</noscript>
|
||||
<!-- ========= START OF TOP NAVBAR ======= -->
|
||||
<A NAME="navbar_top"><!-- --></A>
|
||||
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
|
||||
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
|
||||
<TR>
|
||||
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
|
||||
<A NAME="navbar_top_firstrow"><!-- --></A>
|
||||
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
|
||||
<TR ALIGN="center" VALIGN="top">
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="org/libjpegturbo/turbojpeg/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="org/libjpegturbo/turbojpeg/package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
</TD>
|
||||
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
|
||||
</EM>
|
||||
</TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
||||
PREV
|
||||
NEXT</FONT></TD>
|
||||
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
||||
<A HREF="index.html?constant-values.html" target="_top"><B>FRAMES</B></A>
|
||||
<A HREF="constant-values.html" target="_top"><B>NO FRAMES</B></A>
|
||||
<SCRIPT type="text/javascript">
|
||||
<!--
|
||||
<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</li>
|
||||
<li><a href="org/libjpegturbo/turbojpeg/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>Prev</li>
|
||||
<li>Next</li>
|
||||
</ul>
|
||||
<ul class="navList">
|
||||
<li><a href="index.html?constant-values.html" target="_top">Frames</a></li>
|
||||
<li><a href="constant-values.html" target="_top">No Frames</a></li>
|
||||
</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) {
|
||||
document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>');
|
||||
allClassesLink.style.display = "block";
|
||||
}
|
||||
else {
|
||||
allClassesLink.style.display = "none";
|
||||
}
|
||||
//-->
|
||||
</SCRIPT>
|
||||
<NOSCRIPT>
|
||||
<A HREF="allclasses-noframe.html"><B>All Classes</B></A>
|
||||
</NOSCRIPT>
|
||||
|
||||
|
||||
</FONT></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<A NAME="skip-navbar_top"></A>
|
||||
</script>
|
||||
</div>
|
||||
<a name="skip-navbar_top">
|
||||
<!-- -->
|
||||
</a></div>
|
||||
<!-- ========= END OF TOP NAVBAR ========= -->
|
||||
|
||||
<HR>
|
||||
<CENTER>
|
||||
<H1>
|
||||
Constant Field Values</H1>
|
||||
</CENTER>
|
||||
<HR SIZE="4" NOSHADE>
|
||||
<B>Contents</B><UL>
|
||||
<LI><A HREF="#org.libjpegturbo">org.libjpegturbo.*</A>
|
||||
</UL>
|
||||
|
||||
<A NAME="org.libjpegturbo"><!-- --></A>
|
||||
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
||||
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
|
||||
<TH ALIGN="left"><FONT SIZE="+2">
|
||||
org.libjpegturbo.*</FONT></TH>
|
||||
</TR>
|
||||
</TABLE>
|
||||
|
||||
<P>
|
||||
|
||||
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
||||
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
|
||||
<TH ALIGN="left" COLSPAN="3">org.libjpegturbo.turbojpeg.<A HREF="org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</A></TH>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<A NAME="org.libjpegturbo.turbojpeg.TJ.CS_CMYK"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
|
||||
<CODE>public static final int</CODE></FONT></TD>
|
||||
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#CS_CMYK">CS_CMYK</A></CODE></TD>
|
||||
<TD ALIGN="right"><CODE>3</CODE></TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<A NAME="org.libjpegturbo.turbojpeg.TJ.CS_GRAY"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
|
||||
<CODE>public static final int</CODE></FONT></TD>
|
||||
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#CS_GRAY">CS_GRAY</A></CODE></TD>
|
||||
<TD ALIGN="right"><CODE>2</CODE></TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<A NAME="org.libjpegturbo.turbojpeg.TJ.CS_RGB"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
|
||||
<CODE>public static final int</CODE></FONT></TD>
|
||||
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#CS_RGB">CS_RGB</A></CODE></TD>
|
||||
<TD ALIGN="right"><CODE>0</CODE></TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<A NAME="org.libjpegturbo.turbojpeg.TJ.CS_YCbCr"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
|
||||
<CODE>public static final int</CODE></FONT></TD>
|
||||
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#CS_YCbCr">CS_YCbCr</A></CODE></TD>
|
||||
<TD ALIGN="right"><CODE>1</CODE></TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<A NAME="org.libjpegturbo.turbojpeg.TJ.CS_YCCK"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
|
||||
<CODE>public static final int</CODE></FONT></TD>
|
||||
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#CS_YCCK">CS_YCCK</A></CODE></TD>
|
||||
<TD ALIGN="right"><CODE>4</CODE></TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<A NAME="org.libjpegturbo.turbojpeg.TJ.FLAG_ACCURATEDCT"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
|
||||
<CODE>public static final int</CODE></FONT></TD>
|
||||
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#FLAG_ACCURATEDCT">FLAG_ACCURATEDCT</A></CODE></TD>
|
||||
<TD ALIGN="right"><CODE>4096</CODE></TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<A NAME="org.libjpegturbo.turbojpeg.TJ.FLAG_BOTTOMUP"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
|
||||
<CODE>public static final int</CODE></FONT></TD>
|
||||
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#FLAG_BOTTOMUP">FLAG_BOTTOMUP</A></CODE></TD>
|
||||
<TD ALIGN="right"><CODE>2</CODE></TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<A NAME="org.libjpegturbo.turbojpeg.TJ.FLAG_FASTDCT"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
|
||||
<CODE>public static final int</CODE></FONT></TD>
|
||||
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#FLAG_FASTDCT">FLAG_FASTDCT</A></CODE></TD>
|
||||
<TD ALIGN="right"><CODE>2048</CODE></TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<A NAME="org.libjpegturbo.turbojpeg.TJ.FLAG_FASTUPSAMPLE"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
|
||||
<CODE>public static final int</CODE></FONT></TD>
|
||||
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#FLAG_FASTUPSAMPLE">FLAG_FASTUPSAMPLE</A></CODE></TD>
|
||||
<TD ALIGN="right"><CODE>256</CODE></TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<A NAME="org.libjpegturbo.turbojpeg.TJ.FLAG_FORCEMMX"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
|
||||
<CODE>public static final int</CODE></FONT></TD>
|
||||
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#FLAG_FORCEMMX">FLAG_FORCEMMX</A></CODE></TD>
|
||||
<TD ALIGN="right"><CODE>8</CODE></TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<A NAME="org.libjpegturbo.turbojpeg.TJ.FLAG_FORCESSE"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
|
||||
<CODE>public static final int</CODE></FONT></TD>
|
||||
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#FLAG_FORCESSE">FLAG_FORCESSE</A></CODE></TD>
|
||||
<TD ALIGN="right"><CODE>16</CODE></TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<A NAME="org.libjpegturbo.turbojpeg.TJ.FLAG_FORCESSE2"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
|
||||
<CODE>public static final int</CODE></FONT></TD>
|
||||
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#FLAG_FORCESSE2">FLAG_FORCESSE2</A></CODE></TD>
|
||||
<TD ALIGN="right"><CODE>32</CODE></TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<A NAME="org.libjpegturbo.turbojpeg.TJ.FLAG_FORCESSE3"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
|
||||
<CODE>public static final int</CODE></FONT></TD>
|
||||
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#FLAG_FORCESSE3">FLAG_FORCESSE3</A></CODE></TD>
|
||||
<TD ALIGN="right"><CODE>128</CODE></TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<A NAME="org.libjpegturbo.turbojpeg.TJ.NUMCS"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
|
||||
<CODE>public static final int</CODE></FONT></TD>
|
||||
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#NUMCS">NUMCS</A></CODE></TD>
|
||||
<TD ALIGN="right"><CODE>5</CODE></TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<A NAME="org.libjpegturbo.turbojpeg.TJ.NUMPF"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
|
||||
<CODE>public static final int</CODE></FONT></TD>
|
||||
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#NUMPF">NUMPF</A></CODE></TD>
|
||||
<TD ALIGN="right"><CODE>12</CODE></TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<A NAME="org.libjpegturbo.turbojpeg.TJ.NUMSAMP"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
|
||||
<CODE>public static final int</CODE></FONT></TD>
|
||||
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#NUMSAMP">NUMSAMP</A></CODE></TD>
|
||||
<TD ALIGN="right"><CODE>6</CODE></TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<A NAME="org.libjpegturbo.turbojpeg.TJ.PF_ABGR"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
|
||||
<CODE>public static final int</CODE></FONT></TD>
|
||||
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#PF_ABGR">PF_ABGR</A></CODE></TD>
|
||||
<TD ALIGN="right"><CODE>9</CODE></TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<A NAME="org.libjpegturbo.turbojpeg.TJ.PF_ARGB"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
|
||||
<CODE>public static final int</CODE></FONT></TD>
|
||||
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#PF_ARGB">PF_ARGB</A></CODE></TD>
|
||||
<TD ALIGN="right"><CODE>10</CODE></TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<A NAME="org.libjpegturbo.turbojpeg.TJ.PF_BGR"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
|
||||
<CODE>public static final int</CODE></FONT></TD>
|
||||
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#PF_BGR">PF_BGR</A></CODE></TD>
|
||||
<TD ALIGN="right"><CODE>1</CODE></TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<A NAME="org.libjpegturbo.turbojpeg.TJ.PF_BGRA"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
|
||||
<CODE>public static final int</CODE></FONT></TD>
|
||||
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#PF_BGRA">PF_BGRA</A></CODE></TD>
|
||||
<TD ALIGN="right"><CODE>8</CODE></TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<A NAME="org.libjpegturbo.turbojpeg.TJ.PF_BGRX"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
|
||||
<CODE>public static final int</CODE></FONT></TD>
|
||||
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#PF_BGRX">PF_BGRX</A></CODE></TD>
|
||||
<TD ALIGN="right"><CODE>3</CODE></TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<A NAME="org.libjpegturbo.turbojpeg.TJ.PF_CMYK"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
|
||||
<CODE>public static final int</CODE></FONT></TD>
|
||||
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#PF_CMYK">PF_CMYK</A></CODE></TD>
|
||||
<TD ALIGN="right"><CODE>11</CODE></TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<A NAME="org.libjpegturbo.turbojpeg.TJ.PF_GRAY"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
|
||||
<CODE>public static final int</CODE></FONT></TD>
|
||||
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#PF_GRAY">PF_GRAY</A></CODE></TD>
|
||||
<TD ALIGN="right"><CODE>6</CODE></TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<A NAME="org.libjpegturbo.turbojpeg.TJ.PF_RGB"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
|
||||
<CODE>public static final int</CODE></FONT></TD>
|
||||
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#PF_RGB">PF_RGB</A></CODE></TD>
|
||||
<TD ALIGN="right"><CODE>0</CODE></TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<A NAME="org.libjpegturbo.turbojpeg.TJ.PF_RGBA"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
|
||||
<CODE>public static final int</CODE></FONT></TD>
|
||||
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#PF_RGBA">PF_RGBA</A></CODE></TD>
|
||||
<TD ALIGN="right"><CODE>7</CODE></TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<A NAME="org.libjpegturbo.turbojpeg.TJ.PF_RGBX"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
|
||||
<CODE>public static final int</CODE></FONT></TD>
|
||||
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#PF_RGBX">PF_RGBX</A></CODE></TD>
|
||||
<TD ALIGN="right"><CODE>2</CODE></TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<A NAME="org.libjpegturbo.turbojpeg.TJ.PF_XBGR"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
|
||||
<CODE>public static final int</CODE></FONT></TD>
|
||||
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#PF_XBGR">PF_XBGR</A></CODE></TD>
|
||||
<TD ALIGN="right"><CODE>4</CODE></TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<A NAME="org.libjpegturbo.turbojpeg.TJ.PF_XRGB"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
|
||||
<CODE>public static final int</CODE></FONT></TD>
|
||||
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#PF_XRGB">PF_XRGB</A></CODE></TD>
|
||||
<TD ALIGN="right"><CODE>5</CODE></TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<A NAME="org.libjpegturbo.turbojpeg.TJ.SAMP_411"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
|
||||
<CODE>public static final int</CODE></FONT></TD>
|
||||
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#SAMP_411">SAMP_411</A></CODE></TD>
|
||||
<TD ALIGN="right"><CODE>5</CODE></TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<A NAME="org.libjpegturbo.turbojpeg.TJ.SAMP_420"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
|
||||
<CODE>public static final int</CODE></FONT></TD>
|
||||
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#SAMP_420">SAMP_420</A></CODE></TD>
|
||||
<TD ALIGN="right"><CODE>2</CODE></TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<A NAME="org.libjpegturbo.turbojpeg.TJ.SAMP_422"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
|
||||
<CODE>public static final int</CODE></FONT></TD>
|
||||
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#SAMP_422">SAMP_422</A></CODE></TD>
|
||||
<TD ALIGN="right"><CODE>1</CODE></TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<A NAME="org.libjpegturbo.turbojpeg.TJ.SAMP_440"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
|
||||
<CODE>public static final int</CODE></FONT></TD>
|
||||
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#SAMP_440">SAMP_440</A></CODE></TD>
|
||||
<TD ALIGN="right"><CODE>4</CODE></TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<A NAME="org.libjpegturbo.turbojpeg.TJ.SAMP_444"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
|
||||
<CODE>public static final int</CODE></FONT></TD>
|
||||
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#SAMP_444">SAMP_444</A></CODE></TD>
|
||||
<TD ALIGN="right"><CODE>0</CODE></TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<A NAME="org.libjpegturbo.turbojpeg.TJ.SAMP_GRAY"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
|
||||
<CODE>public static final int</CODE></FONT></TD>
|
||||
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#SAMP_GRAY">SAMP_GRAY</A></CODE></TD>
|
||||
<TD ALIGN="right"><CODE>3</CODE></TD>
|
||||
</TR>
|
||||
</FONT></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
|
||||
<P>
|
||||
|
||||
<P>
|
||||
|
||||
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
||||
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
|
||||
<TH ALIGN="left" COLSPAN="3">org.libjpegturbo.turbojpeg.<A HREF="org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</A></TH>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<A NAME="org.libjpegturbo.turbojpeg.TJTransform.NUMOP"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
|
||||
<CODE>public static final int</CODE></FONT></TD>
|
||||
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJTransform.html#NUMOP">NUMOP</A></CODE></TD>
|
||||
<TD ALIGN="right"><CODE>8</CODE></TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<A NAME="org.libjpegturbo.turbojpeg.TJTransform.OP_HFLIP"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
|
||||
<CODE>public static final int</CODE></FONT></TD>
|
||||
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJTransform.html#OP_HFLIP">OP_HFLIP</A></CODE></TD>
|
||||
<TD ALIGN="right"><CODE>1</CODE></TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<A NAME="org.libjpegturbo.turbojpeg.TJTransform.OP_NONE"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
|
||||
<CODE>public static final int</CODE></FONT></TD>
|
||||
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJTransform.html#OP_NONE">OP_NONE</A></CODE></TD>
|
||||
<TD ALIGN="right"><CODE>0</CODE></TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<A NAME="org.libjpegturbo.turbojpeg.TJTransform.OP_ROT180"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
|
||||
<CODE>public static final int</CODE></FONT></TD>
|
||||
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJTransform.html#OP_ROT180">OP_ROT180</A></CODE></TD>
|
||||
<TD ALIGN="right"><CODE>6</CODE></TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<A NAME="org.libjpegturbo.turbojpeg.TJTransform.OP_ROT270"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
|
||||
<CODE>public static final int</CODE></FONT></TD>
|
||||
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJTransform.html#OP_ROT270">OP_ROT270</A></CODE></TD>
|
||||
<TD ALIGN="right"><CODE>7</CODE></TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<A NAME="org.libjpegturbo.turbojpeg.TJTransform.OP_ROT90"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
|
||||
<CODE>public static final int</CODE></FONT></TD>
|
||||
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJTransform.html#OP_ROT90">OP_ROT90</A></CODE></TD>
|
||||
<TD ALIGN="right"><CODE>5</CODE></TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<A NAME="org.libjpegturbo.turbojpeg.TJTransform.OP_TRANSPOSE"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
|
||||
<CODE>public static final int</CODE></FONT></TD>
|
||||
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJTransform.html#OP_TRANSPOSE">OP_TRANSPOSE</A></CODE></TD>
|
||||
<TD ALIGN="right"><CODE>3</CODE></TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<A NAME="org.libjpegturbo.turbojpeg.TJTransform.OP_TRANSVERSE"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
|
||||
<CODE>public static final int</CODE></FONT></TD>
|
||||
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJTransform.html#OP_TRANSVERSE">OP_TRANSVERSE</A></CODE></TD>
|
||||
<TD ALIGN="right"><CODE>4</CODE></TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<A NAME="org.libjpegturbo.turbojpeg.TJTransform.OP_VFLIP"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
|
||||
<CODE>public static final int</CODE></FONT></TD>
|
||||
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJTransform.html#OP_VFLIP">OP_VFLIP</A></CODE></TD>
|
||||
<TD ALIGN="right"><CODE>2</CODE></TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<A NAME="org.libjpegturbo.turbojpeg.TJTransform.OPT_CROP"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
|
||||
<CODE>public static final int</CODE></FONT></TD>
|
||||
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJTransform.html#OPT_CROP">OPT_CROP</A></CODE></TD>
|
||||
<TD ALIGN="right"><CODE>4</CODE></TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<A NAME="org.libjpegturbo.turbojpeg.TJTransform.OPT_GRAY"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
|
||||
<CODE>public static final int</CODE></FONT></TD>
|
||||
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJTransform.html#OPT_GRAY">OPT_GRAY</A></CODE></TD>
|
||||
<TD ALIGN="right"><CODE>8</CODE></TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<A NAME="org.libjpegturbo.turbojpeg.TJTransform.OPT_NOOUTPUT"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
|
||||
<CODE>public static final int</CODE></FONT></TD>
|
||||
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJTransform.html#OPT_NOOUTPUT">OPT_NOOUTPUT</A></CODE></TD>
|
||||
<TD ALIGN="right"><CODE>16</CODE></TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<A NAME="org.libjpegturbo.turbojpeg.TJTransform.OPT_PERFECT"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
|
||||
<CODE>public static final int</CODE></FONT></TD>
|
||||
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJTransform.html#OPT_PERFECT">OPT_PERFECT</A></CODE></TD>
|
||||
<TD ALIGN="right"><CODE>1</CODE></TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<A NAME="org.libjpegturbo.turbojpeg.TJTransform.OPT_TRIM"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
|
||||
<CODE>public static final int</CODE></FONT></TD>
|
||||
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJTransform.html#OPT_TRIM">OPT_TRIM</A></CODE></TD>
|
||||
<TD ALIGN="right"><CODE>2</CODE></TD>
|
||||
</TR>
|
||||
</FONT></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
|
||||
<P>
|
||||
|
||||
<P>
|
||||
<HR>
|
||||
|
||||
|
||||
<div class="header">
|
||||
<h1 title="Constant Field Values" class="title">Constant Field Values</h1>
|
||||
<h2 title="Contents">Contents</h2>
|
||||
<ul>
|
||||
<li><a href="#org.libjpegturbo">org.libjpegturbo.*</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="constantValuesContainer"><a name="org.libjpegturbo">
|
||||
<!-- -->
|
||||
</a>
|
||||
<h2 title="org.libjpegturbo">org.libjpegturbo.*</h2>
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<table border="0" cellpadding="3" cellspacing="0" summary="Constant Field Values table, listing constant fields, and values">
|
||||
<caption><span>org.libjpegturbo.turbojpeg.<a href="org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></span><span class="tabEnd"> </span></caption>
|
||||
<tr>
|
||||
<th class="colFirst" scope="col">Modifier and Type</th>
|
||||
<th scope="col">Constant Field</th>
|
||||
<th class="colLast" scope="col">Value</th>
|
||||
</tr>
|
||||
<tbody>
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.CS_CMYK">
|
||||
<!-- -->
|
||||
</a><code>public static final int</code></td>
|
||||
<td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#CS_CMYK">CS_CMYK</a></code></td>
|
||||
<td class="colLast"><code>3</code></td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.CS_GRAY">
|
||||
<!-- -->
|
||||
</a><code>public static final int</code></td>
|
||||
<td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#CS_GRAY">CS_GRAY</a></code></td>
|
||||
<td class="colLast"><code>2</code></td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.CS_RGB">
|
||||
<!-- -->
|
||||
</a><code>public static final int</code></td>
|
||||
<td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#CS_RGB">CS_RGB</a></code></td>
|
||||
<td class="colLast"><code>0</code></td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.CS_YCbCr">
|
||||
<!-- -->
|
||||
</a><code>public static final int</code></td>
|
||||
<td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#CS_YCbCr">CS_YCbCr</a></code></td>
|
||||
<td class="colLast"><code>1</code></td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.CS_YCCK">
|
||||
<!-- -->
|
||||
</a><code>public static final int</code></td>
|
||||
<td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#CS_YCCK">CS_YCCK</a></code></td>
|
||||
<td class="colLast"><code>4</code></td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.FLAG_ACCURATEDCT">
|
||||
<!-- -->
|
||||
</a><code>public static final int</code></td>
|
||||
<td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#FLAG_ACCURATEDCT">FLAG_ACCURATEDCT</a></code></td>
|
||||
<td class="colLast"><code>4096</code></td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.FLAG_BOTTOMUP">
|
||||
<!-- -->
|
||||
</a><code>public static final int</code></td>
|
||||
<td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#FLAG_BOTTOMUP">FLAG_BOTTOMUP</a></code></td>
|
||||
<td class="colLast"><code>2</code></td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.FLAG_FASTDCT">
|
||||
<!-- -->
|
||||
</a><code>public static final int</code></td>
|
||||
<td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#FLAG_FASTDCT">FLAG_FASTDCT</a></code></td>
|
||||
<td class="colLast"><code>2048</code></td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.FLAG_FASTUPSAMPLE">
|
||||
<!-- -->
|
||||
</a><code>public static final int</code></td>
|
||||
<td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#FLAG_FASTUPSAMPLE">FLAG_FASTUPSAMPLE</a></code></td>
|
||||
<td class="colLast"><code>256</code></td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.FLAG_FORCEMMX">
|
||||
<!-- -->
|
||||
</a><code>public static final int</code></td>
|
||||
<td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#FLAG_FORCEMMX">FLAG_FORCEMMX</a></code></td>
|
||||
<td class="colLast"><code>8</code></td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.FLAG_FORCESSE">
|
||||
<!-- -->
|
||||
</a><code>public static final int</code></td>
|
||||
<td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#FLAG_FORCESSE">FLAG_FORCESSE</a></code></td>
|
||||
<td class="colLast"><code>16</code></td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.FLAG_FORCESSE2">
|
||||
<!-- -->
|
||||
</a><code>public static final int</code></td>
|
||||
<td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#FLAG_FORCESSE2">FLAG_FORCESSE2</a></code></td>
|
||||
<td class="colLast"><code>32</code></td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.FLAG_FORCESSE3">
|
||||
<!-- -->
|
||||
</a><code>public static final int</code></td>
|
||||
<td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#FLAG_FORCESSE3">FLAG_FORCESSE3</a></code></td>
|
||||
<td class="colLast"><code>128</code></td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.NUMCS">
|
||||
<!-- -->
|
||||
</a><code>public static final int</code></td>
|
||||
<td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#NUMCS">NUMCS</a></code></td>
|
||||
<td class="colLast"><code>5</code></td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.NUMPF">
|
||||
<!-- -->
|
||||
</a><code>public static final int</code></td>
|
||||
<td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#NUMPF">NUMPF</a></code></td>
|
||||
<td class="colLast"><code>12</code></td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.NUMSAMP">
|
||||
<!-- -->
|
||||
</a><code>public static final int</code></td>
|
||||
<td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#NUMSAMP">NUMSAMP</a></code></td>
|
||||
<td class="colLast"><code>6</code></td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.PF_ABGR">
|
||||
<!-- -->
|
||||
</a><code>public static final int</code></td>
|
||||
<td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#PF_ABGR">PF_ABGR</a></code></td>
|
||||
<td class="colLast"><code>9</code></td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.PF_ARGB">
|
||||
<!-- -->
|
||||
</a><code>public static final int</code></td>
|
||||
<td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#PF_ARGB">PF_ARGB</a></code></td>
|
||||
<td class="colLast"><code>10</code></td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.PF_BGR">
|
||||
<!-- -->
|
||||
</a><code>public static final int</code></td>
|
||||
<td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#PF_BGR">PF_BGR</a></code></td>
|
||||
<td class="colLast"><code>1</code></td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.PF_BGRA">
|
||||
<!-- -->
|
||||
</a><code>public static final int</code></td>
|
||||
<td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#PF_BGRA">PF_BGRA</a></code></td>
|
||||
<td class="colLast"><code>8</code></td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.PF_BGRX">
|
||||
<!-- -->
|
||||
</a><code>public static final int</code></td>
|
||||
<td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#PF_BGRX">PF_BGRX</a></code></td>
|
||||
<td class="colLast"><code>3</code></td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.PF_CMYK">
|
||||
<!-- -->
|
||||
</a><code>public static final int</code></td>
|
||||
<td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#PF_CMYK">PF_CMYK</a></code></td>
|
||||
<td class="colLast"><code>11</code></td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.PF_GRAY">
|
||||
<!-- -->
|
||||
</a><code>public static final int</code></td>
|
||||
<td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#PF_GRAY">PF_GRAY</a></code></td>
|
||||
<td class="colLast"><code>6</code></td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.PF_RGB">
|
||||
<!-- -->
|
||||
</a><code>public static final int</code></td>
|
||||
<td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#PF_RGB">PF_RGB</a></code></td>
|
||||
<td class="colLast"><code>0</code></td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.PF_RGBA">
|
||||
<!-- -->
|
||||
</a><code>public static final int</code></td>
|
||||
<td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#PF_RGBA">PF_RGBA</a></code></td>
|
||||
<td class="colLast"><code>7</code></td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.PF_RGBX">
|
||||
<!-- -->
|
||||
</a><code>public static final int</code></td>
|
||||
<td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#PF_RGBX">PF_RGBX</a></code></td>
|
||||
<td class="colLast"><code>2</code></td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.PF_XBGR">
|
||||
<!-- -->
|
||||
</a><code>public static final int</code></td>
|
||||
<td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#PF_XBGR">PF_XBGR</a></code></td>
|
||||
<td class="colLast"><code>4</code></td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.PF_XRGB">
|
||||
<!-- -->
|
||||
</a><code>public static final int</code></td>
|
||||
<td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#PF_XRGB">PF_XRGB</a></code></td>
|
||||
<td class="colLast"><code>5</code></td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.SAMP_411">
|
||||
<!-- -->
|
||||
</a><code>public static final int</code></td>
|
||||
<td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#SAMP_411">SAMP_411</a></code></td>
|
||||
<td class="colLast"><code>5</code></td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.SAMP_420">
|
||||
<!-- -->
|
||||
</a><code>public static final int</code></td>
|
||||
<td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#SAMP_420">SAMP_420</a></code></td>
|
||||
<td class="colLast"><code>2</code></td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.SAMP_422">
|
||||
<!-- -->
|
||||
</a><code>public static final int</code></td>
|
||||
<td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#SAMP_422">SAMP_422</a></code></td>
|
||||
<td class="colLast"><code>1</code></td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.SAMP_440">
|
||||
<!-- -->
|
||||
</a><code>public static final int</code></td>
|
||||
<td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#SAMP_440">SAMP_440</a></code></td>
|
||||
<td class="colLast"><code>4</code></td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.SAMP_444">
|
||||
<!-- -->
|
||||
</a><code>public static final int</code></td>
|
||||
<td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#SAMP_444">SAMP_444</a></code></td>
|
||||
<td class="colLast"><code>0</code></td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJ.SAMP_GRAY">
|
||||
<!-- -->
|
||||
</a><code>public static final int</code></td>
|
||||
<td><code><a href="org/libjpegturbo/turbojpeg/TJ.html#SAMP_GRAY">SAMP_GRAY</a></code></td>
|
||||
<td class="colLast"><code>3</code></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</li>
|
||||
<li class="blockList">
|
||||
<table border="0" cellpadding="3" cellspacing="0" summary="Constant Field Values table, listing constant fields, and values">
|
||||
<caption><span>org.libjpegturbo.turbojpeg.<a href="org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</a></span><span class="tabEnd"> </span></caption>
|
||||
<tr>
|
||||
<th class="colFirst" scope="col">Modifier and Type</th>
|
||||
<th scope="col">Constant Field</th>
|
||||
<th class="colLast" scope="col">Value</th>
|
||||
</tr>
|
||||
<tbody>
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJTransform.NUMOP">
|
||||
<!-- -->
|
||||
</a><code>public static final int</code></td>
|
||||
<td><code><a href="org/libjpegturbo/turbojpeg/TJTransform.html#NUMOP">NUMOP</a></code></td>
|
||||
<td class="colLast"><code>8</code></td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJTransform.OP_HFLIP">
|
||||
<!-- -->
|
||||
</a><code>public static final int</code></td>
|
||||
<td><code><a href="org/libjpegturbo/turbojpeg/TJTransform.html#OP_HFLIP">OP_HFLIP</a></code></td>
|
||||
<td class="colLast"><code>1</code></td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJTransform.OP_NONE">
|
||||
<!-- -->
|
||||
</a><code>public static final int</code></td>
|
||||
<td><code><a href="org/libjpegturbo/turbojpeg/TJTransform.html#OP_NONE">OP_NONE</a></code></td>
|
||||
<td class="colLast"><code>0</code></td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJTransform.OP_ROT180">
|
||||
<!-- -->
|
||||
</a><code>public static final int</code></td>
|
||||
<td><code><a href="org/libjpegturbo/turbojpeg/TJTransform.html#OP_ROT180">OP_ROT180</a></code></td>
|
||||
<td class="colLast"><code>6</code></td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJTransform.OP_ROT270">
|
||||
<!-- -->
|
||||
</a><code>public static final int</code></td>
|
||||
<td><code><a href="org/libjpegturbo/turbojpeg/TJTransform.html#OP_ROT270">OP_ROT270</a></code></td>
|
||||
<td class="colLast"><code>7</code></td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJTransform.OP_ROT90">
|
||||
<!-- -->
|
||||
</a><code>public static final int</code></td>
|
||||
<td><code><a href="org/libjpegturbo/turbojpeg/TJTransform.html#OP_ROT90">OP_ROT90</a></code></td>
|
||||
<td class="colLast"><code>5</code></td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJTransform.OP_TRANSPOSE">
|
||||
<!-- -->
|
||||
</a><code>public static final int</code></td>
|
||||
<td><code><a href="org/libjpegturbo/turbojpeg/TJTransform.html#OP_TRANSPOSE">OP_TRANSPOSE</a></code></td>
|
||||
<td class="colLast"><code>3</code></td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJTransform.OP_TRANSVERSE">
|
||||
<!-- -->
|
||||
</a><code>public static final int</code></td>
|
||||
<td><code><a href="org/libjpegturbo/turbojpeg/TJTransform.html#OP_TRANSVERSE">OP_TRANSVERSE</a></code></td>
|
||||
<td class="colLast"><code>4</code></td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJTransform.OP_VFLIP">
|
||||
<!-- -->
|
||||
</a><code>public static final int</code></td>
|
||||
<td><code><a href="org/libjpegturbo/turbojpeg/TJTransform.html#OP_VFLIP">OP_VFLIP</a></code></td>
|
||||
<td class="colLast"><code>2</code></td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJTransform.OPT_CROP">
|
||||
<!-- -->
|
||||
</a><code>public static final int</code></td>
|
||||
<td><code><a href="org/libjpegturbo/turbojpeg/TJTransform.html#OPT_CROP">OPT_CROP</a></code></td>
|
||||
<td class="colLast"><code>4</code></td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJTransform.OPT_GRAY">
|
||||
<!-- -->
|
||||
</a><code>public static final int</code></td>
|
||||
<td><code><a href="org/libjpegturbo/turbojpeg/TJTransform.html#OPT_GRAY">OPT_GRAY</a></code></td>
|
||||
<td class="colLast"><code>8</code></td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJTransform.OPT_NOOUTPUT">
|
||||
<!-- -->
|
||||
</a><code>public static final int</code></td>
|
||||
<td><code><a href="org/libjpegturbo/turbojpeg/TJTransform.html#OPT_NOOUTPUT">OPT_NOOUTPUT</a></code></td>
|
||||
<td class="colLast"><code>16</code></td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJTransform.OPT_PERFECT">
|
||||
<!-- -->
|
||||
</a><code>public static final int</code></td>
|
||||
<td><code><a href="org/libjpegturbo/turbojpeg/TJTransform.html#OPT_PERFECT">OPT_PERFECT</a></code></td>
|
||||
<td class="colLast"><code>1</code></td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJTransform.OPT_TRIM">
|
||||
<!-- -->
|
||||
</a><code>public static final int</code></td>
|
||||
<td><code><a href="org/libjpegturbo/turbojpeg/TJTransform.html#OPT_TRIM">OPT_TRIM</a></code></td>
|
||||
<td class="colLast"><code>2</code></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<!-- ======= START OF BOTTOM NAVBAR ====== -->
|
||||
<A NAME="navbar_bottom"><!-- --></A>
|
||||
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
|
||||
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
|
||||
<TR>
|
||||
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
|
||||
<A NAME="navbar_bottom_firstrow"><!-- --></A>
|
||||
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
|
||||
<TR ALIGN="center" VALIGN="top">
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="org/libjpegturbo/turbojpeg/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="org/libjpegturbo/turbojpeg/package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
</TD>
|
||||
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
|
||||
</EM>
|
||||
</TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
||||
PREV
|
||||
NEXT</FONT></TD>
|
||||
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
||||
<A HREF="index.html?constant-values.html" target="_top"><B>FRAMES</B></A>
|
||||
<A HREF="constant-values.html" target="_top"><B>NO FRAMES</B></A>
|
||||
<SCRIPT type="text/javascript">
|
||||
<!--
|
||||
<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</li>
|
||||
<li><a href="org/libjpegturbo/turbojpeg/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>Prev</li>
|
||||
<li>Next</li>
|
||||
</ul>
|
||||
<ul class="navList">
|
||||
<li><a href="index.html?constant-values.html" target="_top">Frames</a></li>
|
||||
<li><a href="constant-values.html" target="_top">No Frames</a></li>
|
||||
</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) {
|
||||
document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>');
|
||||
allClassesLink.style.display = "block";
|
||||
}
|
||||
else {
|
||||
allClassesLink.style.display = "none";
|
||||
}
|
||||
//-->
|
||||
</SCRIPT>
|
||||
<NOSCRIPT>
|
||||
<A HREF="allclasses-noframe.html"><B>All Classes</B></A>
|
||||
</NOSCRIPT>
|
||||
|
||||
|
||||
</FONT></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<A NAME="skip-navbar_bottom"></A>
|
||||
</script>
|
||||
</div>
|
||||
<a name="skip-navbar_bottom">
|
||||
<!-- -->
|
||||
</a></div>
|
||||
<!-- ======== END OF BOTTOM NAVBAR ======= -->
|
||||
|
||||
<HR>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1,208 +1,248 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<!--NewPage-->
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>
|
||||
Deprecated List
|
||||
</TITLE>
|
||||
|
||||
|
||||
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
|
||||
|
||||
<SCRIPT type="text/javascript">
|
||||
function windowTitle()
|
||||
{
|
||||
<!-- NewPage -->
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Deprecated List</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="Deprecated List";
|
||||
}
|
||||
}
|
||||
</SCRIPT>
|
||||
<NOSCRIPT>
|
||||
</NOSCRIPT>
|
||||
|
||||
</HEAD>
|
||||
|
||||
<BODY BGCOLOR="white" onload="windowTitle();">
|
||||
<HR>
|
||||
|
||||
|
||||
//-->
|
||||
</script>
|
||||
<noscript>
|
||||
<div>JavaScript is disabled on your browser.</div>
|
||||
</noscript>
|
||||
<!-- ========= START OF TOP NAVBAR ======= -->
|
||||
<A NAME="navbar_top"><!-- --></A>
|
||||
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
|
||||
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
|
||||
<TR>
|
||||
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
|
||||
<A NAME="navbar_top_firstrow"><!-- --></A>
|
||||
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
|
||||
<TR ALIGN="center" VALIGN="top">
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="org/libjpegturbo/turbojpeg/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="org/libjpegturbo/turbojpeg/package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Deprecated</B></FONT> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
</TD>
|
||||
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
|
||||
</EM>
|
||||
</TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
||||
PREV
|
||||
NEXT</FONT></TD>
|
||||
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
||||
<A HREF="index.html?deprecated-list.html" target="_top"><B>FRAMES</B></A>
|
||||
<A HREF="deprecated-list.html" target="_top"><B>NO FRAMES</B></A>
|
||||
<SCRIPT type="text/javascript">
|
||||
<!--
|
||||
<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</li>
|
||||
<li><a href="org/libjpegturbo/turbojpeg/package-tree.html">Tree</a></li>
|
||||
<li class="navBarCell1Rev">Deprecated</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>Prev</li>
|
||||
<li>Next</li>
|
||||
</ul>
|
||||
<ul class="navList">
|
||||
<li><a href="index.html?deprecated-list.html" target="_top">Frames</a></li>
|
||||
<li><a href="deprecated-list.html" target="_top">No Frames</a></li>
|
||||
</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) {
|
||||
document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>');
|
||||
allClassesLink.style.display = "block";
|
||||
}
|
||||
else {
|
||||
allClassesLink.style.display = "none";
|
||||
}
|
||||
//-->
|
||||
</SCRIPT>
|
||||
<NOSCRIPT>
|
||||
<A HREF="allclasses-noframe.html"><B>All Classes</B></A>
|
||||
</NOSCRIPT>
|
||||
|
||||
|
||||
</FONT></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<A NAME="skip-navbar_top"></A>
|
||||
</script>
|
||||
</div>
|
||||
<a name="skip-navbar_top">
|
||||
<!-- -->
|
||||
</a></div>
|
||||
<!-- ========= END OF TOP NAVBAR ========= -->
|
||||
|
||||
<HR>
|
||||
<CENTER>
|
||||
<H2>
|
||||
<B>Deprecated API</B></H2>
|
||||
</CENTER>
|
||||
<HR SIZE="4" NOSHADE>
|
||||
<B>Contents</B><UL>
|
||||
<LI><A HREF="#field">Deprecated Fields</A>
|
||||
<LI><A HREF="#method">Deprecated Methods</A>
|
||||
</UL>
|
||||
|
||||
<A NAME="field"><!-- --></A>
|
||||
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
||||
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
|
||||
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
|
||||
<B>Deprecated Fields</B></FONT></TH>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<TD><A HREF="org/libjpegturbo/turbojpeg/TJ.html#FLAG_FORCEMMX">org.libjpegturbo.turbojpeg.TJ.FLAG_FORCEMMX</A>
|
||||
<BR>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<TD><A HREF="org/libjpegturbo/turbojpeg/TJ.html#FLAG_FORCESSE">org.libjpegturbo.turbojpeg.TJ.FLAG_FORCESSE</A>
|
||||
<BR>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<TD><A HREF="org/libjpegturbo/turbojpeg/TJ.html#FLAG_FORCESSE2">org.libjpegturbo.turbojpeg.TJ.FLAG_FORCESSE2</A>
|
||||
<BR>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<TD><A HREF="org/libjpegturbo/turbojpeg/TJ.html#FLAG_FORCESSE3">org.libjpegturbo.turbojpeg.TJ.FLAG_FORCESSE3</A>
|
||||
<BR>
|
||||
</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
|
||||
<P>
|
||||
<A NAME="method"><!-- --></A>
|
||||
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
||||
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
|
||||
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
|
||||
<B>Deprecated Methods</B></FONT></TH>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<TD><A HREF="org/libjpegturbo/turbojpeg/TJ.html#bufSizeYUV(int, int, int)">org.libjpegturbo.turbojpeg.TJ.bufSizeYUV(int, int, int)</A>
|
||||
<BR>
|
||||
<I>Use <A HREF="org/libjpegturbo/turbojpeg/TJ.html#bufSizeYUV(int, int, int, int)"><CODE>TJ.bufSizeYUV(int, int, int, int)</CODE></A> instead.</I> </TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<TD><A HREF="org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[], int, int, int, int, int)">org.libjpegturbo.turbojpeg.TJDecompressor.decompress(byte[], int, int, int, int, int)</A>
|
||||
<BR>
|
||||
<I>Use
|
||||
<A HREF="org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[], int, int, int, int, int, int, int)"><CODE>TJDecompressor.decompress(byte[], int, int, int, int, int, int, int)</CODE></A> instead.</I> </TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<TD><A HREF="org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(byte[], int)">org.libjpegturbo.turbojpeg.TJDecompressor.decompressToYUV(byte[], int)</A>
|
||||
<BR>
|
||||
<I>Use <A HREF="org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(byte[], int, int, int, int)"><CODE>TJDecompressor.decompressToYUV(byte[], int, int, int, int)</CODE></A>
|
||||
instead.</I> </TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<TD><A HREF="org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(int)">org.libjpegturbo.turbojpeg.TJDecompressor.decompressToYUV(int)</A>
|
||||
<BR>
|
||||
<I>Use <A HREF="org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(int, int, int, int)"><CODE>TJDecompressor.decompressToYUV(int, int, int, int)</CODE></A> instead.</I> </TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<TD><A HREF="org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[], int, int, int, int)">org.libjpegturbo.turbojpeg.TJCompressor.setSourceImage(byte[], int, int, int, int)</A>
|
||||
<BR>
|
||||
<I>Use
|
||||
<A HREF="org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[], int, int, int, int, int, int)"><CODE>TJCompressor.setSourceImage(byte[], int, int, int, int, int, int)</CODE></A> instead.</I> </TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
|
||||
<P>
|
||||
<HR>
|
||||
|
||||
|
||||
<div class="header">
|
||||
<h1 title="Deprecated API" class="title">Deprecated API</h1>
|
||||
<h2 title="Contents">Contents</h2>
|
||||
<ul>
|
||||
<li><a href="#field">Deprecated Fields</a></li>
|
||||
<li><a href="#method">Deprecated Methods</a></li>
|
||||
<li><a href="#constructor">Deprecated Constructors</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="contentContainer"><a name="field">
|
||||
<!-- -->
|
||||
</a>
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<table border="0" cellpadding="3" cellspacing="0" summary="Deprecated Fields table, listing deprecated fields, and an explanation">
|
||||
<caption><span>Deprecated Fields</span><span class="tabEnd"> </span></caption>
|
||||
<tr>
|
||||
<th class="colOne" scope="col">Field and Description</th>
|
||||
</tr>
|
||||
<tbody>
|
||||
<tr class="altColor">
|
||||
<td class="colOne"><a href="org/libjpegturbo/turbojpeg/TJ.html#FLAG_FORCEMMX">org.libjpegturbo.turbojpeg.TJ.FLAG_FORCEMMX</a></td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colOne"><a href="org/libjpegturbo/turbojpeg/TJ.html#FLAG_FORCESSE">org.libjpegturbo.turbojpeg.TJ.FLAG_FORCESSE</a></td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colOne"><a href="org/libjpegturbo/turbojpeg/TJ.html#FLAG_FORCESSE2">org.libjpegturbo.turbojpeg.TJ.FLAG_FORCESSE2</a></td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colOne"><a href="org/libjpegturbo/turbojpeg/TJ.html#FLAG_FORCESSE3">org.libjpegturbo.turbojpeg.TJ.FLAG_FORCESSE3</a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="method">
|
||||
<!-- -->
|
||||
</a>
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<table border="0" cellpadding="3" cellspacing="0" summary="Deprecated Methods table, listing deprecated methods, and an explanation">
|
||||
<caption><span>Deprecated Methods</span><span class="tabEnd"> </span></caption>
|
||||
<tr>
|
||||
<th class="colOne" scope="col">Method and Description</th>
|
||||
</tr>
|
||||
<tbody>
|
||||
<tr class="altColor">
|
||||
<td class="colOne"><a href="org/libjpegturbo/turbojpeg/TJ.html#bufSizeYUV(int,%20int,%20int)">org.libjpegturbo.turbojpeg.TJ.bufSizeYUV(int, int, int)</a>
|
||||
<div class="block"><i>Use <a href="org/libjpegturbo/turbojpeg/TJ.html#bufSizeYUV(int,%20int,%20int,%20int)"><code>TJ.bufSizeYUV(int, int, int, int)</code></a> instead.</i></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colOne"><a href="org/libjpegturbo/turbojpeg/TJCompressor.html#compress(java.awt.image.BufferedImage,%20byte[],%20int)">org.libjpegturbo.turbojpeg.TJCompressor.compress(BufferedImage, byte[], int)</a>
|
||||
<div class="block"><i>Use
|
||||
<a href="org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage,%20int,%20int,%20int,%20int)"><code>TJCompressor.setSourceImage(BufferedImage, int, int, int, int)</code></a> and
|
||||
<a href="org/libjpegturbo/turbojpeg/TJCompressor.html#compress(byte[],%20int)"><code>TJCompressor.compress(byte[], int)</code></a> instead.</i></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colOne"><a href="org/libjpegturbo/turbojpeg/TJCompressor.html#compress(java.awt.image.BufferedImage,%20int)">org.libjpegturbo.turbojpeg.TJCompressor.compress(BufferedImage, int)</a>
|
||||
<div class="block"><i>Use
|
||||
<a href="org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage,%20int,%20int,%20int,%20int)"><code>TJCompressor.setSourceImage(BufferedImage, int, int, int, int)</code></a> and
|
||||
<a href="org/libjpegturbo/turbojpeg/TJCompressor.html#compress(int)"><code>TJCompressor.compress(int)</code></a> instead.</i></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colOne"><a href="org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[],%20int,%20int,%20int,%20int,%20int)">org.libjpegturbo.turbojpeg.TJDecompressor.decompress(byte[], int, int, int, int, int)</a>
|
||||
<div class="block"><i>Use
|
||||
<a href="org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[],%20int,%20int,%20int,%20int,%20int,%20int,%20int)"><code>TJDecompressor.decompress(byte[], int, int, int, int, int, int, int)</code></a> instead.</i></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colOne"><a href="org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(byte[],%20int)">org.libjpegturbo.turbojpeg.TJDecompressor.decompressToYUV(byte[], int)</a>
|
||||
<div class="block"><i>Use <a href="org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(org.libjpegturbo.turbojpeg.YUVImage,%20int)"><code>TJDecompressor.decompressToYUV(YUVImage, int)</code></a> instead.</i></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colOne"><a href="org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(int)">org.libjpegturbo.turbojpeg.TJDecompressor.decompressToYUV(int)</a>
|
||||
<div class="block"><i>Use <a href="org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(int,%20int,%20int,%20int)"><code>TJDecompressor.decompressToYUV(int, int, int, int)</code></a> instead.</i></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colOne"><a href="org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(java.awt.image.BufferedImage,%20byte[],%20int)">org.libjpegturbo.turbojpeg.TJCompressor.encodeYUV(BufferedImage, byte[], int)</a>
|
||||
<div class="block"><i>Use
|
||||
<a href="org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage,%20int,%20int,%20int,%20int)"><code>TJCompressor.setSourceImage(BufferedImage, int, int, int, int)</code></a> and
|
||||
<a href="org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(byte[],%20int)"><code>TJCompressor.encodeYUV(byte[], int)</code></a> instead.</i></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colOne"><a href="org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(java.awt.image.BufferedImage,%20int)">org.libjpegturbo.turbojpeg.TJCompressor.encodeYUV(BufferedImage, int)</a>
|
||||
<div class="block"><i>Use
|
||||
<a href="org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage,%20int,%20int,%20int,%20int)"><code>TJCompressor.setSourceImage(BufferedImage, int, int, int, int)</code></a> and
|
||||
<a href="org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(int,%20int)"><code>TJCompressor.encodeYUV(int, int)</code></a> instead.</i></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colOne"><a href="org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(byte[],%20int)">org.libjpegturbo.turbojpeg.TJCompressor.encodeYUV(byte[], int)</a>
|
||||
<div class="block"><i>Use <a href="org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(org.libjpegturbo.turbojpeg.YUVImage,%20int)"><code>TJCompressor.encodeYUV(YUVImage, int)</code></a> instead.</i></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colOne"><a href="org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(int)">org.libjpegturbo.turbojpeg.TJCompressor.encodeYUV(int)</a>
|
||||
<div class="block"><i>Use <a href="org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(int,%20int)"><code>TJCompressor.encodeYUV(int, int)</code></a> instead.</i></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colOne"><a href="org/libjpegturbo/turbojpeg/TJDecompressor.html#setJPEGImage(byte[],%20int)">org.libjpegturbo.turbojpeg.TJDecompressor.setJPEGImage(byte[], int)</a>
|
||||
<div class="block"><i>Use <a href="org/libjpegturbo/turbojpeg/TJDecompressor.html#setSourceImage(byte[],%20int)"><code>TJDecompressor.setSourceImage(byte[], int)</code></a> instead.</i></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colOne"><a href="org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[],%20int,%20int,%20int,%20int)">org.libjpegturbo.turbojpeg.TJCompressor.setSourceImage(byte[], int, int, int, int)</a>
|
||||
<div class="block"><i>Use
|
||||
<a href="org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[],%20int,%20int,%20int,%20int,%20int,%20int)"><code>TJCompressor.setSourceImage(byte[], int, int, int, int, int, int)</code></a> instead.</i></div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="constructor">
|
||||
<!-- -->
|
||||
</a>
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<table border="0" cellpadding="3" cellspacing="0" summary="Deprecated Constructors table, listing deprecated constructors, and an explanation">
|
||||
<caption><span>Deprecated Constructors</span><span class="tabEnd"> </span></caption>
|
||||
<tr>
|
||||
<th class="colOne" scope="col">Constructor and Description</th>
|
||||
</tr>
|
||||
<tbody>
|
||||
<tr class="altColor">
|
||||
<td class="colOne"><a href="org/libjpegturbo/turbojpeg/TJCompressor.html#TJCompressor(byte[],%20int,%20int,%20int,%20int)">org.libjpegturbo.turbojpeg.TJCompressor(byte[], int, int, int, int)</a>
|
||||
<div class="block"><i>Use
|
||||
<a href="org/libjpegturbo/turbojpeg/TJCompressor.html#TJCompressor(byte[],%20int,%20int,%20int,%20int,%20int,%20int)"><code>TJCompressor.TJCompressor(byte[], int, int, int, int, int, int)</code></a> instead.</i></div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<!-- ======= START OF BOTTOM NAVBAR ====== -->
|
||||
<A NAME="navbar_bottom"><!-- --></A>
|
||||
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
|
||||
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
|
||||
<TR>
|
||||
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
|
||||
<A NAME="navbar_bottom_firstrow"><!-- --></A>
|
||||
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
|
||||
<TR ALIGN="center" VALIGN="top">
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="org/libjpegturbo/turbojpeg/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="org/libjpegturbo/turbojpeg/package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Deprecated</B></FONT> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
</TD>
|
||||
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
|
||||
</EM>
|
||||
</TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
||||
PREV
|
||||
NEXT</FONT></TD>
|
||||
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
||||
<A HREF="index.html?deprecated-list.html" target="_top"><B>FRAMES</B></A>
|
||||
<A HREF="deprecated-list.html" target="_top"><B>NO FRAMES</B></A>
|
||||
<SCRIPT type="text/javascript">
|
||||
<!--
|
||||
<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</li>
|
||||
<li><a href="org/libjpegturbo/turbojpeg/package-tree.html">Tree</a></li>
|
||||
<li class="navBarCell1Rev">Deprecated</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>Prev</li>
|
||||
<li>Next</li>
|
||||
</ul>
|
||||
<ul class="navList">
|
||||
<li><a href="index.html?deprecated-list.html" target="_top">Frames</a></li>
|
||||
<li><a href="deprecated-list.html" target="_top">No Frames</a></li>
|
||||
</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) {
|
||||
document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>');
|
||||
allClassesLink.style.display = "block";
|
||||
}
|
||||
else {
|
||||
allClassesLink.style.display = "none";
|
||||
}
|
||||
//-->
|
||||
</SCRIPT>
|
||||
<NOSCRIPT>
|
||||
<A HREF="allclasses-noframe.html"><B>All Classes</B></A>
|
||||
</NOSCRIPT>
|
||||
|
||||
|
||||
</FONT></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<A NAME="skip-navbar_bottom"></A>
|
||||
</script>
|
||||
</div>
|
||||
<a name="skip-navbar_bottom">
|
||||
<!-- -->
|
||||
</a></div>
|
||||
<!-- ======== END OF BOTTOM NAVBAR ======= -->
|
||||
|
||||
<HR>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1,207 +1,206 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<!--NewPage-->
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>
|
||||
API Help
|
||||
</TITLE>
|
||||
|
||||
|
||||
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
|
||||
|
||||
<SCRIPT type="text/javascript">
|
||||
function windowTitle()
|
||||
{
|
||||
<!-- NewPage -->
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>API Help</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="API Help";
|
||||
}
|
||||
}
|
||||
</SCRIPT>
|
||||
<NOSCRIPT>
|
||||
</NOSCRIPT>
|
||||
|
||||
</HEAD>
|
||||
|
||||
<BODY BGCOLOR="white" onload="windowTitle();">
|
||||
<HR>
|
||||
|
||||
|
||||
//-->
|
||||
</script>
|
||||
<noscript>
|
||||
<div>JavaScript is disabled on your browser.</div>
|
||||
</noscript>
|
||||
<!-- ========= START OF TOP NAVBAR ======= -->
|
||||
<A NAME="navbar_top"><!-- --></A>
|
||||
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
|
||||
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
|
||||
<TR>
|
||||
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
|
||||
<A NAME="navbar_top_firstrow"><!-- --></A>
|
||||
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
|
||||
<TR ALIGN="center" VALIGN="top">
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="org/libjpegturbo/turbojpeg/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="org/libjpegturbo/turbojpeg/package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Help</B></FONT> </TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
</TD>
|
||||
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
|
||||
</EM>
|
||||
</TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
||||
PREV
|
||||
NEXT</FONT></TD>
|
||||
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
||||
<A HREF="index.html?help-doc.html" target="_top"><B>FRAMES</B></A>
|
||||
<A HREF="help-doc.html" target="_top"><B>NO FRAMES</B></A>
|
||||
<SCRIPT type="text/javascript">
|
||||
<!--
|
||||
<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</li>
|
||||
<li><a href="org/libjpegturbo/turbojpeg/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 class="navBarCell1Rev">Help</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="subNav">
|
||||
<ul class="navList">
|
||||
<li>Prev</li>
|
||||
<li>Next</li>
|
||||
</ul>
|
||||
<ul class="navList">
|
||||
<li><a href="index.html?help-doc.html" target="_top">Frames</a></li>
|
||||
<li><a href="help-doc.html" target="_top">No Frames</a></li>
|
||||
</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) {
|
||||
document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>');
|
||||
allClassesLink.style.display = "block";
|
||||
}
|
||||
else {
|
||||
allClassesLink.style.display = "none";
|
||||
}
|
||||
//-->
|
||||
</SCRIPT>
|
||||
<NOSCRIPT>
|
||||
<A HREF="allclasses-noframe.html"><B>All Classes</B></A>
|
||||
</NOSCRIPT>
|
||||
|
||||
|
||||
</FONT></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<A NAME="skip-navbar_top"></A>
|
||||
</script>
|
||||
</div>
|
||||
<a name="skip-navbar_top">
|
||||
<!-- -->
|
||||
</a></div>
|
||||
<!-- ========= END OF TOP NAVBAR ========= -->
|
||||
|
||||
<HR>
|
||||
<CENTER>
|
||||
<H1>
|
||||
How This API Document Is Organized</H1>
|
||||
</CENTER>
|
||||
This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows.<H3>
|
||||
Package</H3>
|
||||
<BLOCKQUOTE>
|
||||
|
||||
<P>
|
||||
Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain four categories:<UL>
|
||||
<LI>Interfaces (italic)<LI>Classes<LI>Enums<LI>Exceptions<LI>Errors<LI>Annotation Types</UL>
|
||||
</BLOCKQUOTE>
|
||||
<H3>
|
||||
Class/Interface</H3>
|
||||
<BLOCKQUOTE>
|
||||
|
||||
<P>
|
||||
Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions:<UL>
|
||||
<LI>Class inheritance diagram<LI>Direct Subclasses<LI>All Known Subinterfaces<LI>All Known Implementing Classes<LI>Class/interface declaration<LI>Class/interface description
|
||||
<P>
|
||||
<LI>Nested Class Summary<LI>Field Summary<LI>Constructor Summary<LI>Method Summary
|
||||
<P>
|
||||
<LI>Field Detail<LI>Constructor Detail<LI>Method Detail</UL>
|
||||
Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.</BLOCKQUOTE>
|
||||
</BLOCKQUOTE>
|
||||
<H3>
|
||||
Annotation Type</H3>
|
||||
<BLOCKQUOTE>
|
||||
|
||||
<P>
|
||||
Each annotation type has its own separate page with the following sections:<UL>
|
||||
<LI>Annotation Type declaration<LI>Annotation Type description<LI>Required Element Summary<LI>Optional Element Summary<LI>Element Detail</UL>
|
||||
</BLOCKQUOTE>
|
||||
</BLOCKQUOTE>
|
||||
<H3>
|
||||
Enum</H3>
|
||||
<BLOCKQUOTE>
|
||||
|
||||
<P>
|
||||
Each enum has its own separate page with the following sections:<UL>
|
||||
<LI>Enum declaration<LI>Enum description<LI>Enum Constant Summary<LI>Enum Constant Detail</UL>
|
||||
</BLOCKQUOTE>
|
||||
<H3>
|
||||
Tree (Class Hierarchy)</H3>
|
||||
<BLOCKQUOTE>
|
||||
There is a <A HREF="overview-tree.html">Class Hierarchy</A> page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. The classes are organized by inheritance structure starting with <code>java.lang.Object</code>. The interfaces do not inherit from <code>java.lang.Object</code>.<UL>
|
||||
<LI>When viewing the Overview page, clicking on "Tree" displays the hierarchy for all packages.<LI>When viewing a particular package, class or interface page, clicking "Tree" displays the hierarchy for only that package.</UL>
|
||||
</BLOCKQUOTE>
|
||||
<H3>
|
||||
Deprecated API</H3>
|
||||
<BLOCKQUOTE>
|
||||
The <A HREF="deprecated-list.html">Deprecated API</A> page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to improvements, and a replacement API is usually given. Deprecated APIs may be removed in future implementations.</BLOCKQUOTE>
|
||||
<H3>
|
||||
Index</H3>
|
||||
<BLOCKQUOTE>
|
||||
The <A HREF="index-all.html">Index</A> contains an alphabetic list of all classes, interfaces, constructors, methods, and fields.</BLOCKQUOTE>
|
||||
<H3>
|
||||
Prev/Next</H3>
|
||||
These links take you to the next or previous class, interface, package, or related page.<H3>
|
||||
Frames/No Frames</H3>
|
||||
These links show and hide the HTML frames. All pages are available with or without frames.
|
||||
<P>
|
||||
<H3>
|
||||
Serialized Form</H3>
|
||||
Each serializable or externalizable class has a description of its serialization fields and methods. This information is of interest to re-implementors, not to developers using the API. While there is no link in the navigation bar, you can get to this information by going to any serialized class and clicking "Serialized Form" in the "See also" section of the class description.
|
||||
<P>
|
||||
<H3>
|
||||
Constant Field Values</H3>
|
||||
The <a href="constant-values.html">Constant Field Values</a> page lists the static final fields and their values.
|
||||
<P>
|
||||
<FONT SIZE="-1">
|
||||
<EM>
|
||||
This help file applies to API documentation generated using the standard doclet.</EM>
|
||||
</FONT>
|
||||
<BR>
|
||||
<HR>
|
||||
|
||||
|
||||
<div class="header">
|
||||
<h1 class="title">How This API Document Is Organized</h1>
|
||||
<div class="subTitle">This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows.</div>
|
||||
</div>
|
||||
<div class="contentContainer">
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<h2>Package</h2>
|
||||
<p>Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain six categories:</p>
|
||||
<ul>
|
||||
<li>Interfaces (italic)</li>
|
||||
<li>Classes</li>
|
||||
<li>Enums</li>
|
||||
<li>Exceptions</li>
|
||||
<li>Errors</li>
|
||||
<li>Annotation Types</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="blockList">
|
||||
<h2>Class/Interface</h2>
|
||||
<p>Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions:</p>
|
||||
<ul>
|
||||
<li>Class inheritance diagram</li>
|
||||
<li>Direct Subclasses</li>
|
||||
<li>All Known Subinterfaces</li>
|
||||
<li>All Known Implementing Classes</li>
|
||||
<li>Class/interface declaration</li>
|
||||
<li>Class/interface description</li>
|
||||
</ul>
|
||||
<ul>
|
||||
<li>Nested Class Summary</li>
|
||||
<li>Field Summary</li>
|
||||
<li>Constructor Summary</li>
|
||||
<li>Method Summary</li>
|
||||
</ul>
|
||||
<ul>
|
||||
<li>Field Detail</li>
|
||||
<li>Constructor Detail</li>
|
||||
<li>Method Detail</li>
|
||||
</ul>
|
||||
<p>Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.</p>
|
||||
</li>
|
||||
<li class="blockList">
|
||||
<h2>Annotation Type</h2>
|
||||
<p>Each annotation type has its own separate page with the following sections:</p>
|
||||
<ul>
|
||||
<li>Annotation Type declaration</li>
|
||||
<li>Annotation Type description</li>
|
||||
<li>Required Element Summary</li>
|
||||
<li>Optional Element Summary</li>
|
||||
<li>Element Detail</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="blockList">
|
||||
<h2>Enum</h2>
|
||||
<p>Each enum has its own separate page with the following sections:</p>
|
||||
<ul>
|
||||
<li>Enum declaration</li>
|
||||
<li>Enum description</li>
|
||||
<li>Enum Constant Summary</li>
|
||||
<li>Enum Constant Detail</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="blockList">
|
||||
<h2>Tree (Class Hierarchy)</h2>
|
||||
<p>There is a <a href="overview-tree.html">Class Hierarchy</a> page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. The classes are organized by inheritance structure starting with <code>java.lang.Object</code>. The interfaces do not inherit from <code>java.lang.Object</code>.</p>
|
||||
<ul>
|
||||
<li>When viewing the Overview page, clicking on "Tree" displays the hierarchy for all packages.</li>
|
||||
<li>When viewing a particular package, class or interface page, clicking "Tree" displays the hierarchy for only that package.</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="blockList">
|
||||
<h2>Deprecated API</h2>
|
||||
<p>The <a href="deprecated-list.html">Deprecated API</a> page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to improvements, and a replacement API is usually given. Deprecated APIs may be removed in future implementations.</p>
|
||||
</li>
|
||||
<li class="blockList">
|
||||
<h2>Index</h2>
|
||||
<p>The <a href="index-all.html">Index</a> contains an alphabetic list of all classes, interfaces, constructors, methods, and fields.</p>
|
||||
</li>
|
||||
<li class="blockList">
|
||||
<h2>Prev/Next</h2>
|
||||
<p>These links take you to the next or previous class, interface, package, or related page.</p>
|
||||
</li>
|
||||
<li class="blockList">
|
||||
<h2>Frames/No Frames</h2>
|
||||
<p>These links show and hide the HTML frames. All pages are available with or without frames.</p>
|
||||
</li>
|
||||
<li class="blockList">
|
||||
<h2>All Classes</h2>
|
||||
<p>The <a href="allclasses-noframe.html">All Classes</a> link shows all classes and interfaces except non-static nested types.</p>
|
||||
</li>
|
||||
<li class="blockList">
|
||||
<h2>Serialized Form</h2>
|
||||
<p>Each serializable or externalizable class has a description of its serialization fields and methods. This information is of interest to re-implementors, not to developers using the API. While there is no link in the navigation bar, you can get to this information by going to any serialized class and clicking "Serialized Form" in the "See also" section of the class description.</p>
|
||||
</li>
|
||||
<li class="blockList">
|
||||
<h2>Constant Field Values</h2>
|
||||
<p>The <a href="constant-values.html">Constant Field Values</a> page lists the static final fields and their values.</p>
|
||||
</li>
|
||||
</ul>
|
||||
<em>This help file applies to API documentation generated using the standard doclet.</em></div>
|
||||
<!-- ======= START OF BOTTOM NAVBAR ====== -->
|
||||
<A NAME="navbar_bottom"><!-- --></A>
|
||||
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
|
||||
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
|
||||
<TR>
|
||||
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
|
||||
<A NAME="navbar_bottom_firstrow"><!-- --></A>
|
||||
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
|
||||
<TR ALIGN="center" VALIGN="top">
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="org/libjpegturbo/turbojpeg/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="org/libjpegturbo/turbojpeg/package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Help</B></FONT> </TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
</TD>
|
||||
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
|
||||
</EM>
|
||||
</TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
||||
PREV
|
||||
NEXT</FONT></TD>
|
||||
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
||||
<A HREF="index.html?help-doc.html" target="_top"><B>FRAMES</B></A>
|
||||
<A HREF="help-doc.html" target="_top"><B>NO FRAMES</B></A>
|
||||
<SCRIPT type="text/javascript">
|
||||
<!--
|
||||
<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</li>
|
||||
<li><a href="org/libjpegturbo/turbojpeg/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 class="navBarCell1Rev">Help</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="subNav">
|
||||
<ul class="navList">
|
||||
<li>Prev</li>
|
||||
<li>Next</li>
|
||||
</ul>
|
||||
<ul class="navList">
|
||||
<li><a href="index.html?help-doc.html" target="_top">Frames</a></li>
|
||||
<li><a href="help-doc.html" target="_top">No Frames</a></li>
|
||||
</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) {
|
||||
document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>');
|
||||
allClassesLink.style.display = "block";
|
||||
}
|
||||
else {
|
||||
allClassesLink.style.display = "none";
|
||||
}
|
||||
//-->
|
||||
</SCRIPT>
|
||||
<NOSCRIPT>
|
||||
<A HREF="allclasses-noframe.html"><B>All Classes</B></A>
|
||||
</NOSCRIPT>
|
||||
|
||||
|
||||
</FONT></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<A NAME="skip-navbar_bottom"></A>
|
||||
</script>
|
||||
</div>
|
||||
<a name="skip-navbar_bottom">
|
||||
<!-- -->
|
||||
</a></div>
|
||||
<!-- ======== END OF BOTTOM NAVBAR ======= -->
|
||||
|
||||
<HR>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,17 +1,21 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
|
||||
<!--NewPage-->
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>
|
||||
Generated Documentation (Untitled)
|
||||
</TITLE>
|
||||
<SCRIPT type="text/javascript">
|
||||
<!-- NewPage -->
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Generated Documentation (Untitled)</title>
|
||||
<script type="text/javascript">
|
||||
targetPage = "" + window.location.search;
|
||||
if (targetPage != "" && targetPage != "undefined")
|
||||
targetPage = targetPage.substring(1);
|
||||
if (targetPage.indexOf(":") != -1 || (targetPage != "" && !validURL(targetPage)))
|
||||
targetPage = "undefined";
|
||||
function validURL(url) {
|
||||
try {
|
||||
url = decodeURIComponent(url);
|
||||
}
|
||||
catch (error) {
|
||||
return false;
|
||||
}
|
||||
var pos = url.indexOf(".html");
|
||||
if (pos == -1 || pos != url.length - 5)
|
||||
return false;
|
||||
@@ -23,7 +27,8 @@ Generated Documentation (Untitled)
|
||||
if ('a' <= ch && ch <= 'z' ||
|
||||
'A' <= ch && ch <= 'Z' ||
|
||||
ch == '$' ||
|
||||
ch == '_') {
|
||||
ch == '_' ||
|
||||
ch.charCodeAt(0) > 127) {
|
||||
allowNumber = true;
|
||||
allowSep = true;
|
||||
} else if ('0' <= ch && ch <= '9'
|
||||
@@ -49,21 +54,17 @@ Generated Documentation (Untitled)
|
||||
if (targetPage != "" && targetPage != "undefined")
|
||||
top.classFrame.location = top.targetPage;
|
||||
}
|
||||
</SCRIPT>
|
||||
<NOSCRIPT>
|
||||
</NOSCRIPT>
|
||||
</HEAD>
|
||||
<FRAMESET cols="20%,80%" title="" onLoad="top.loadFrames()">
|
||||
<FRAME src="allclasses-frame.html" name="packageFrame" title="All classes and interfaces (except non-static nested types)">
|
||||
<FRAME src="org/libjpegturbo/turbojpeg/package-summary.html" name="classFrame" title="Package, class and interface descriptions" scrolling="yes">
|
||||
<NOFRAMES>
|
||||
<H2>
|
||||
Frame Alert</H2>
|
||||
|
||||
<P>
|
||||
This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client.
|
||||
<BR>
|
||||
Link to<A HREF="org/libjpegturbo/turbojpeg/package-summary.html">Non-frame version.</A>
|
||||
</NOFRAMES>
|
||||
</FRAMESET>
|
||||
</HTML>
|
||||
</script>
|
||||
</head>
|
||||
<frameset cols="20%,80%" title="Documentation frame" onload="top.loadFrames()">
|
||||
<frame src="allclasses-frame.html" name="packageFrame" title="All classes and interfaces (except non-static nested types)">
|
||||
<frame src="org/libjpegturbo/turbojpeg/package-summary.html" name="classFrame" title="Package, class and interface descriptions" scrolling="yes">
|
||||
<noframes>
|
||||
<noscript>
|
||||
<div>JavaScript is disabled on your browser.</div>
|
||||
</noscript>
|
||||
<h2>Frame Alert</h2>
|
||||
<p>This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. Link to <a href="org/libjpegturbo/turbojpeg/package-summary.html">Non-frame version</a>.</p>
|
||||
</noframes>
|
||||
</frameset>
|
||||
</html>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,238 +1,237 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<!--NewPage-->
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>
|
||||
TJCustomFilter
|
||||
</TITLE>
|
||||
|
||||
|
||||
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
|
||||
|
||||
<SCRIPT type="text/javascript">
|
||||
function windowTitle()
|
||||
{
|
||||
<!-- NewPage -->
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>TJCustomFilter</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="TJCustomFilter";
|
||||
}
|
||||
}
|
||||
</SCRIPT>
|
||||
<NOSCRIPT>
|
||||
</NOSCRIPT>
|
||||
|
||||
</HEAD>
|
||||
|
||||
<BODY BGCOLOR="white" onload="windowTitle();">
|
||||
<HR>
|
||||
|
||||
|
||||
//-->
|
||||
</script>
|
||||
<noscript>
|
||||
<div>JavaScript is disabled on your browser.</div>
|
||||
</noscript>
|
||||
<!-- ========= START OF TOP NAVBAR ======= -->
|
||||
<A NAME="navbar_top"><!-- --></A>
|
||||
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
|
||||
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
|
||||
<TR>
|
||||
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
|
||||
<A NAME="navbar_top_firstrow"><!-- --></A>
|
||||
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
|
||||
<TR ALIGN="center" VALIGN="top">
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../org/libjpegturbo/turbojpeg/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
</TD>
|
||||
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
|
||||
</EM>
|
||||
</TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
||||
<A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg"><B>PREV CLASS</B></A>
|
||||
<A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg"><B>NEXT CLASS</B></A></FONT></TD>
|
||||
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
||||
<A HREF="../../../index.html?org/libjpegturbo/turbojpeg/TJCustomFilter.html" target="_top"><B>FRAMES</B></A>
|
||||
<A HREF="TJCustomFilter.html" target="_top"><B>NO FRAMES</B></A>
|
||||
<SCRIPT type="text/javascript">
|
||||
<!--
|
||||
<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/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">Prev Class</span></a></li>
|
||||
<li><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.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/TJCustomFilter.html" target="_top">Frames</a></li>
|
||||
<li><a href="TJCustomFilter.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) {
|
||||
document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');
|
||||
allClassesLink.style.display = "block";
|
||||
}
|
||||
else {
|
||||
allClassesLink.style.display = "none";
|
||||
}
|
||||
//-->
|
||||
</SCRIPT>
|
||||
<NOSCRIPT>
|
||||
<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>
|
||||
</NOSCRIPT>
|
||||
|
||||
|
||||
</FONT></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
|
||||
SUMMARY: NESTED | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD>
|
||||
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
|
||||
DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<A NAME="skip-navbar_top"></A>
|
||||
</script>
|
||||
</div>
|
||||
<div>
|
||||
<ul class="subNavList">
|
||||
<li>Summary: </li>
|
||||
<li>Nested | </li>
|
||||
<li>Field | </li>
|
||||
<li>Constr | </li>
|
||||
<li><a href="#method_summary">Method</a></li>
|
||||
</ul>
|
||||
<ul class="subNavList">
|
||||
<li>Detail: </li>
|
||||
<li>Field | </li>
|
||||
<li>Constr | </li>
|
||||
<li><a href="#method_detail">Method</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<a name="skip-navbar_top">
|
||||
<!-- -->
|
||||
</a></div>
|
||||
<!-- ========= END OF TOP NAVBAR ========= -->
|
||||
|
||||
<HR>
|
||||
<!-- ======== START OF CLASS DATA ======== -->
|
||||
<H2>
|
||||
<FONT SIZE="-1">
|
||||
org.libjpegturbo.turbojpeg</FONT>
|
||||
<BR>
|
||||
Interface TJCustomFilter</H2>
|
||||
<HR>
|
||||
<DL>
|
||||
<DT><PRE>public interface <B>TJCustomFilter</B></DL>
|
||||
</PRE>
|
||||
|
||||
<P>
|
||||
Custom filter callback interface
|
||||
<P>
|
||||
|
||||
<P>
|
||||
<HR>
|
||||
|
||||
<P>
|
||||
|
||||
<div class="header">
|
||||
<div class="subTitle">org.libjpegturbo.turbojpeg</div>
|
||||
<h2 title="Interface TJCustomFilter" class="title">Interface TJCustomFilter</h2>
|
||||
</div>
|
||||
<div class="contentContainer">
|
||||
<div class="description">
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<hr>
|
||||
<br>
|
||||
<pre>public interface <span class="strong">TJCustomFilter</span></pre>
|
||||
<div class="block">Custom filter callback interface</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="summary">
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<!-- ========== METHOD SUMMARY =========== -->
|
||||
|
||||
<A NAME="method_summary"><!-- --></A>
|
||||
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
||||
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
|
||||
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
|
||||
<B>Method Summary</B></FONT></TH>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||||
<CODE> void</CODE></FONT></TD>
|
||||
<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJCustomFilter.html#customFilter(java.nio.ShortBuffer, java.awt.Rectangle, java.awt.Rectangle, int, int, org.libjpegturbo.turbojpeg.TJTransform)">customFilter</A></B>(java.nio.ShortBuffer coeffBuffer,
|
||||
java.awt.Rectangle bufferRegion,
|
||||
java.awt.Rectangle planeRegion,
|
||||
int componentID,
|
||||
int transformID,
|
||||
<A HREF="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</A> transform)</CODE>
|
||||
|
||||
<BR>
|
||||
A callback function that can be used to modify the DCT coefficients after
|
||||
<ul class="blockList">
|
||||
<li class="blockList"><a name="method_summary">
|
||||
<!-- -->
|
||||
</a>
|
||||
<h3>Method Summary</h3>
|
||||
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
|
||||
<caption><span>Methods</span><span class="tabEnd"> </span></caption>
|
||||
<tr>
|
||||
<th class="colFirst" scope="col">Modifier and Type</th>
|
||||
<th class="colLast" scope="col">Method and Description</th>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><code>void</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJCustomFilter.html#customFilter(java.nio.ShortBuffer,%20java.awt.Rectangle,%20java.awt.Rectangle,%20int,%20int,%20org.libjpegturbo.turbojpeg.TJTransform)">customFilter</a></strong>(java.nio.ShortBuffer coeffBuffer,
|
||||
java.awt.Rectangle bufferRegion,
|
||||
java.awt.Rectangle planeRegion,
|
||||
int componentID,
|
||||
int transformID,
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</a> transform)</code>
|
||||
<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.</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
|
||||
<P>
|
||||
|
||||
JPEG image.</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="details">
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<!-- ============ METHOD DETAIL ========== -->
|
||||
|
||||
<A NAME="method_detail"><!-- --></A>
|
||||
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
||||
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
|
||||
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
|
||||
<B>Method Detail</B></FONT></TH>
|
||||
</TR>
|
||||
</TABLE>
|
||||
|
||||
<A NAME="customFilter(java.nio.ShortBuffer, java.awt.Rectangle, java.awt.Rectangle, int, int, org.libjpegturbo.turbojpeg.TJTransform)"><!-- --></A><H3>
|
||||
customFilter</H3>
|
||||
<PRE>
|
||||
void <B>customFilter</B>(java.nio.ShortBuffer coeffBuffer,
|
||||
java.awt.Rectangle bufferRegion,
|
||||
java.awt.Rectangle planeRegion,
|
||||
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>
|
||||
<DL>
|
||||
<DD>A callback function that can be used to modify the DCT coefficients after
|
||||
<ul class="blockList">
|
||||
<li class="blockList"><a name="method_detail">
|
||||
<!-- -->
|
||||
</a>
|
||||
<h3>Method Detail</h3>
|
||||
<a name="customFilter(java.nio.ShortBuffer, java.awt.Rectangle, java.awt.Rectangle, int, int, org.libjpegturbo.turbojpeg.TJTransform)">
|
||||
<!-- -->
|
||||
</a>
|
||||
<ul class="blockListLast">
|
||||
<li class="blockList">
|
||||
<h4>customFilter</h4>
|
||||
<pre>void customFilter(java.nio.ShortBuffer coeffBuffer,
|
||||
java.awt.Rectangle bufferRegion,
|
||||
java.awt.Rectangle planeRegion,
|
||||
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>
|
||||
<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
|
||||
applied in the frequency domain.
|
||||
<P>
|
||||
<DD><DL>
|
||||
<DT><B>Parameters:</B><DD><CODE>coeffBuffer</CODE> - a buffer containing transformed DCT coefficients.
|
||||
applied in the frequency domain.</div>
|
||||
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>coeffBuffer</code> - a buffer containing transformed DCT coefficients.
|
||||
(NOTE: this buffer is not guaranteed to be valid once the callback
|
||||
returns, so applications wishing to hand off the DCT coefficients to
|
||||
another function or library should make a copy of them within the body of
|
||||
the callback.)<DD><CODE>bufferRegion</CODE> - rectangle containing the width and height of
|
||||
the callback.)</dd><dd><code>bufferRegion</code> - rectangle containing the width and height of
|
||||
<code>coeffBuffer</code> as well as its offset relative to the component
|
||||
plane. TurboJPEG implementations may choose to split each component plane
|
||||
into multiple DCT coefficient buffers and call the callback function once
|
||||
for each buffer.<DD><CODE>planeRegion</CODE> - rectangle containing the width and height of the
|
||||
component plane to which <code>coeffBuffer</code> belongs<DD><CODE>componentID</CODE> - ID number of the component plane to which
|
||||
for each buffer.</dd><dd><code>planeRegion</code> - rectangle containing the width and height of the
|
||||
component plane to which <code>coeffBuffer</code> belongs</dd><dd><code>componentID</code> - ID number of the component plane to which
|
||||
<code>coeffBuffer</code> belongs (Y, Cb, and Cr have, respectively, ID's
|
||||
of 0, 1, and 2 in typical JPEG images.)<DD><CODE>transformID</CODE> - ID number of the transformed image to which
|
||||
of 0, 1, and 2 in typical JPEG images.)</dd><dd><code>transformID</code> - ID number of the transformed image to which
|
||||
<code>coeffBuffer</code> belongs. This is the same as the index of the
|
||||
transform in the <code>transforms</code> array that was passed to <A HREF="../../../org/libjpegturbo/turbojpeg/TJTransformer.html#transform(byte[][], org.libjpegturbo.turbojpeg.TJTransform[], int)"><CODE>TJTransformer.transform()</CODE></A>.<DD><CODE>transform</CODE> - a <A HREF="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg"><CODE>TJTransform</CODE></A> instance that specifies the
|
||||
parameters and/or cropping region for this transform
|
||||
<DT><B>Throws:</B>
|
||||
<DD><CODE>java.lang.Exception</CODE></DL>
|
||||
</DD>
|
||||
</DL>
|
||||
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>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<!-- ========= END OF CLASS DATA ========= -->
|
||||
<HR>
|
||||
|
||||
|
||||
<!-- ======= START OF BOTTOM NAVBAR ====== -->
|
||||
<A NAME="navbar_bottom"><!-- --></A>
|
||||
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
|
||||
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
|
||||
<TR>
|
||||
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
|
||||
<A NAME="navbar_bottom_firstrow"><!-- --></A>
|
||||
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
|
||||
<TR ALIGN="center" VALIGN="top">
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../org/libjpegturbo/turbojpeg/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
</TD>
|
||||
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
|
||||
</EM>
|
||||
</TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
||||
<A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg"><B>PREV CLASS</B></A>
|
||||
<A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg"><B>NEXT CLASS</B></A></FONT></TD>
|
||||
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
||||
<A HREF="../../../index.html?org/libjpegturbo/turbojpeg/TJCustomFilter.html" target="_top"><B>FRAMES</B></A>
|
||||
<A HREF="TJCustomFilter.html" target="_top"><B>NO FRAMES</B></A>
|
||||
<SCRIPT type="text/javascript">
|
||||
<!--
|
||||
<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/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">Prev Class</span></a></li>
|
||||
<li><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.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/TJCustomFilter.html" target="_top">Frames</a></li>
|
||||
<li><a href="TJCustomFilter.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) {
|
||||
document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');
|
||||
allClassesLink.style.display = "block";
|
||||
}
|
||||
else {
|
||||
allClassesLink.style.display = "none";
|
||||
}
|
||||
//-->
|
||||
</SCRIPT>
|
||||
<NOSCRIPT>
|
||||
<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>
|
||||
</NOSCRIPT>
|
||||
|
||||
|
||||
</FONT></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
|
||||
SUMMARY: NESTED | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD>
|
||||
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
|
||||
DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<A NAME="skip-navbar_bottom"></A>
|
||||
</script>
|
||||
</div>
|
||||
<div>
|
||||
<ul class="subNavList">
|
||||
<li>Summary: </li>
|
||||
<li>Nested | </li>
|
||||
<li>Field | </li>
|
||||
<li>Constr | </li>
|
||||
<li><a href="#method_summary">Method</a></li>
|
||||
</ul>
|
||||
<ul class="subNavList">
|
||||
<li>Detail: </li>
|
||||
<li>Field | </li>
|
||||
<li>Constr | </li>
|
||||
<li><a href="#method_detail">Method</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<a name="skip-navbar_bottom">
|
||||
<!-- -->
|
||||
</a></div>
|
||||
<!-- ======== END OF BOTTOM NAVBAR ======= -->
|
||||
|
||||
<HR>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,356 +1,336 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<!--NewPage-->
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>
|
||||
TJScalingFactor
|
||||
</TITLE>
|
||||
|
||||
|
||||
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
|
||||
|
||||
<SCRIPT type="text/javascript">
|
||||
function windowTitle()
|
||||
{
|
||||
<!-- NewPage -->
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>TJScalingFactor</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="TJScalingFactor";
|
||||
}
|
||||
}
|
||||
</SCRIPT>
|
||||
<NOSCRIPT>
|
||||
</NOSCRIPT>
|
||||
|
||||
</HEAD>
|
||||
|
||||
<BODY BGCOLOR="white" onload="windowTitle();">
|
||||
<HR>
|
||||
|
||||
|
||||
//-->
|
||||
</script>
|
||||
<noscript>
|
||||
<div>JavaScript is disabled on your browser.</div>
|
||||
</noscript>
|
||||
<!-- ========= START OF TOP NAVBAR ======= -->
|
||||
<A NAME="navbar_top"><!-- --></A>
|
||||
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
|
||||
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
|
||||
<TR>
|
||||
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
|
||||
<A NAME="navbar_top_firstrow"><!-- --></A>
|
||||
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
|
||||
<TR ALIGN="center" VALIGN="top">
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../org/libjpegturbo/turbojpeg/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
</TD>
|
||||
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
|
||||
</EM>
|
||||
</TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
||||
<A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg"><B>PREV CLASS</B></A>
|
||||
<A HREF="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg"><B>NEXT CLASS</B></A></FONT></TD>
|
||||
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
||||
<A HREF="../../../index.html?org/libjpegturbo/turbojpeg/TJScalingFactor.html" target="_top"><B>FRAMES</B></A>
|
||||
<A HREF="TJScalingFactor.html" target="_top"><B>NO FRAMES</B></A>
|
||||
<SCRIPT type="text/javascript">
|
||||
<!--
|
||||
<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/TJTransform.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/TJScalingFactor.html" target="_top">Frames</a></li>
|
||||
<li><a href="TJScalingFactor.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) {
|
||||
document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');
|
||||
allClassesLink.style.display = "block";
|
||||
}
|
||||
else {
|
||||
allClassesLink.style.display = "none";
|
||||
}
|
||||
//-->
|
||||
</SCRIPT>
|
||||
<NOSCRIPT>
|
||||
<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>
|
||||
</NOSCRIPT>
|
||||
|
||||
|
||||
</FONT></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
|
||||
SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
|
||||
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
|
||||
DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<A NAME="skip-navbar_top"></A>
|
||||
</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="#method_summary">Method</a></li>
|
||||
</ul>
|
||||
<ul class="subNavList">
|
||||
<li>Detail: </li>
|
||||
<li>Field | </li>
|
||||
<li><a href="#constructor_detail">Constr</a> | </li>
|
||||
<li><a href="#method_detail">Method</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<a name="skip-navbar_top">
|
||||
<!-- -->
|
||||
</a></div>
|
||||
<!-- ========= END OF TOP NAVBAR ========= -->
|
||||
|
||||
<HR>
|
||||
<!-- ======== START OF CLASS DATA ======== -->
|
||||
<H2>
|
||||
<FONT SIZE="-1">
|
||||
org.libjpegturbo.turbojpeg</FONT>
|
||||
<BR>
|
||||
Class TJScalingFactor</H2>
|
||||
<PRE>
|
||||
java.lang.Object
|
||||
<IMG SRC="../../../resources/inherit.gif" ALT="extended by "><B>org.libjpegturbo.turbojpeg.TJScalingFactor</B>
|
||||
</PRE>
|
||||
<HR>
|
||||
<DL>
|
||||
<DT><PRE>public class <B>TJScalingFactor</B><DT>extends java.lang.Object</DL>
|
||||
</PRE>
|
||||
|
||||
<P>
|
||||
Fractional scaling factor
|
||||
<P>
|
||||
|
||||
<P>
|
||||
<HR>
|
||||
|
||||
<P>
|
||||
|
||||
<div class="header">
|
||||
<div class="subTitle">org.libjpegturbo.turbojpeg</div>
|
||||
<h2 title="Class TJScalingFactor" class="title">Class TJScalingFactor</h2>
|
||||
</div>
|
||||
<div class="contentContainer">
|
||||
<ul class="inheritance">
|
||||
<li>java.lang.Object</li>
|
||||
<li>
|
||||
<ul class="inheritance">
|
||||
<li>org.libjpegturbo.turbojpeg.TJScalingFactor</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="description">
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<hr>
|
||||
<br>
|
||||
<pre>public class <span class="strong">TJScalingFactor</span>
|
||||
extends java.lang.Object</pre>
|
||||
<div class="block">Fractional scaling factor</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="summary">
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
|
||||
|
||||
<A NAME="constructor_summary"><!-- --></A>
|
||||
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
||||
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
|
||||
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
|
||||
<B>Constructor Summary</B></FONT></TH>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html#TJScalingFactor(int, int)">TJScalingFactor</A></B>(int num,
|
||||
int denom)</CODE>
|
||||
|
||||
<BR>
|
||||
</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
|
||||
<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/TJScalingFactor.html#TJScalingFactor(int,%20int)">TJScalingFactor</a></strong>(int num,
|
||||
int denom)</code> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</li>
|
||||
</ul>
|
||||
<!-- ========== METHOD SUMMARY =========== -->
|
||||
|
||||
<A NAME="method_summary"><!-- --></A>
|
||||
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
||||
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
|
||||
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
|
||||
<B>Method Summary</B></FONT></TH>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||||
<CODE> boolean</CODE></FONT></TD>
|
||||
<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html#equals(org.libjpegturbo.turbojpeg.TJScalingFactor)">equals</A></B>(<A HREF="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg">TJScalingFactor</A> other)</CODE>
|
||||
|
||||
<BR>
|
||||
Returns true or false, depending on whether this instance and
|
||||
<code>other</code> have the same numerator and denominator.</TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||||
<CODE> int</CODE></FONT></TD>
|
||||
<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html#getDenom()">getDenom</A></B>()</CODE>
|
||||
|
||||
<BR>
|
||||
Returns denominator</TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||||
<CODE> int</CODE></FONT></TD>
|
||||
<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html#getNum()">getNum</A></B>()</CODE>
|
||||
|
||||
<BR>
|
||||
Returns numerator</TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||||
<CODE> int</CODE></FONT></TD>
|
||||
<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html#getScaled(int)">getScaled</A></B>(int dimension)</CODE>
|
||||
|
||||
<BR>
|
||||
Returns the scaled value of <code>dimension</code>.</TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||||
<CODE> boolean</CODE></FONT></TD>
|
||||
<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html#isOne()">isOne</A></B>()</CODE>
|
||||
|
||||
<BR>
|
||||
Returns true or false, depending on whether this instance is equal to
|
||||
1/1.</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
|
||||
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
||||
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
|
||||
<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
|
||||
<P>
|
||||
|
||||
<ul class="blockList">
|
||||
<li class="blockList"><a name="method_summary">
|
||||
<!-- -->
|
||||
</a>
|
||||
<h3>Method Summary</h3>
|
||||
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
|
||||
<caption><span>Methods</span><span class="tabEnd"> </span></caption>
|
||||
<tr>
|
||||
<th class="colFirst" scope="col">Modifier and Type</th>
|
||||
<th class="colLast" scope="col">Method and Description</th>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><code>boolean</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html#equals(org.libjpegturbo.turbojpeg.TJScalingFactor)">equals</a></strong>(<a href="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg">TJScalingFactor</a> other)</code>
|
||||
<div class="block">Returns true or false, depending on whether this instance and
|
||||
<code>other</code> have the same numerator and denominator.</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colFirst"><code>int</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html#getDenom()">getDenom</a></strong>()</code>
|
||||
<div class="block">Returns denominator</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><code>int</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html#getNum()">getNum</a></strong>()</code>
|
||||
<div class="block">Returns numerator</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colFirst"><code>int</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html#getScaled(int)">getScaled</a></strong>(int dimension)</code>
|
||||
<div class="block">Returns the scaled value of <code>dimension</code>.</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><code>boolean</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html#isOne()">isOne</a></strong>()</code>
|
||||
<div class="block">Returns true or false, depending on whether this instance is equal to
|
||||
1/1.</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<ul class="blockList">
|
||||
<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
|
||||
<!-- -->
|
||||
</a>
|
||||
<h3>Methods inherited from class java.lang.Object</h3>
|
||||
<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="details">
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<!-- ========= CONSTRUCTOR DETAIL ======== -->
|
||||
|
||||
<A NAME="constructor_detail"><!-- --></A>
|
||||
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
||||
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
|
||||
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
|
||||
<B>Constructor Detail</B></FONT></TH>
|
||||
</TR>
|
||||
</TABLE>
|
||||
|
||||
<A NAME="TJScalingFactor(int, int)"><!-- --></A><H3>
|
||||
TJScalingFactor</H3>
|
||||
<PRE>
|
||||
public <B>TJScalingFactor</B>(int num,
|
||||
int denom)
|
||||
throws java.lang.Exception</PRE>
|
||||
<DL>
|
||||
<DL>
|
||||
|
||||
<DT><B>Throws:</B>
|
||||
<DD><CODE>java.lang.Exception</CODE></DL>
|
||||
</DL>
|
||||
|
||||
<ul class="blockList">
|
||||
<li class="blockList"><a name="constructor_detail">
|
||||
<!-- -->
|
||||
</a>
|
||||
<h3>Constructor Detail</h3>
|
||||
<a name="TJScalingFactor(int, int)">
|
||||
<!-- -->
|
||||
</a>
|
||||
<ul class="blockListLast">
|
||||
<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>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<!-- ============ METHOD DETAIL ========== -->
|
||||
|
||||
<A NAME="method_detail"><!-- --></A>
|
||||
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
||||
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
|
||||
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
|
||||
<B>Method Detail</B></FONT></TH>
|
||||
</TR>
|
||||
</TABLE>
|
||||
|
||||
<A NAME="getNum()"><!-- --></A><H3>
|
||||
getNum</H3>
|
||||
<PRE>
|
||||
public int <B>getNum</B>()</PRE>
|
||||
<DL>
|
||||
<DD>Returns numerator
|
||||
<P>
|
||||
<DD><DL>
|
||||
|
||||
<DT><B>Returns:</B><DD>numerator</DL>
|
||||
</DD>
|
||||
</DL>
|
||||
<HR>
|
||||
|
||||
<A NAME="getDenom()"><!-- --></A><H3>
|
||||
getDenom</H3>
|
||||
<PRE>
|
||||
public int <B>getDenom</B>()</PRE>
|
||||
<DL>
|
||||
<DD>Returns denominator
|
||||
<P>
|
||||
<DD><DL>
|
||||
|
||||
<DT><B>Returns:</B><DD>denominator</DL>
|
||||
</DD>
|
||||
</DL>
|
||||
<HR>
|
||||
|
||||
<A NAME="getScaled(int)"><!-- --></A><H3>
|
||||
getScaled</H3>
|
||||
<PRE>
|
||||
public int <B>getScaled</B>(int dimension)</PRE>
|
||||
<DL>
|
||||
<DD>Returns the scaled value of <code>dimension</code>. This function
|
||||
<ul class="blockList">
|
||||
<li class="blockList"><a name="method_detail">
|
||||
<!-- -->
|
||||
</a>
|
||||
<h3>Method Detail</h3>
|
||||
<a name="getNum()">
|
||||
<!-- -->
|
||||
</a>
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<h4>getNum</h4>
|
||||
<pre>public int getNum()</pre>
|
||||
<div class="block">Returns numerator</div>
|
||||
<dl><dt><span class="strong">Returns:</span></dt><dd>numerator</dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="getDenom()">
|
||||
<!-- -->
|
||||
</a>
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<h4>getDenom</h4>
|
||||
<pre>public int getDenom()</pre>
|
||||
<div class="block">Returns denominator</div>
|
||||
<dl><dt><span class="strong">Returns:</span></dt><dd>denominator</dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="getScaled(int)">
|
||||
<!-- -->
|
||||
</a>
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<h4>getScaled</h4>
|
||||
<pre>public int getScaled(int dimension)</pre>
|
||||
<div class="block">Returns the scaled value of <code>dimension</code>. This function
|
||||
performs the integer equivalent of
|
||||
<code>ceil(dimension * scalingFactor)</code>.
|
||||
<P>
|
||||
<DD><DL>
|
||||
|
||||
<DT><B>Returns:</B><DD>the scaled value of <code>dimension</code></DL>
|
||||
</DD>
|
||||
</DL>
|
||||
<HR>
|
||||
|
||||
<A NAME="equals(org.libjpegturbo.turbojpeg.TJScalingFactor)"><!-- --></A><H3>
|
||||
equals</H3>
|
||||
<PRE>
|
||||
public boolean <B>equals</B>(<A HREF="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg">TJScalingFactor</A> other)</PRE>
|
||||
<DL>
|
||||
<DD>Returns true or false, depending on whether this instance and
|
||||
<code>other</code> have the same numerator and denominator.
|
||||
<P>
|
||||
<DD><DL>
|
||||
|
||||
<DT><B>Returns:</B><DD>true or false, depending on whether this instance and
|
||||
<code>other</code> have the same numerator and denominator</DL>
|
||||
</DD>
|
||||
</DL>
|
||||
<HR>
|
||||
|
||||
<A NAME="isOne()"><!-- --></A><H3>
|
||||
isOne</H3>
|
||||
<PRE>
|
||||
public boolean <B>isOne</B>()</PRE>
|
||||
<DL>
|
||||
<DD>Returns true or false, depending on whether this instance is equal to
|
||||
1/1.
|
||||
<P>
|
||||
<DD><DL>
|
||||
|
||||
<DT><B>Returns:</B><DD>true or false, depending on whether this instance is equal to
|
||||
1/1</DL>
|
||||
</DD>
|
||||
</DL>
|
||||
<code>ceil(dimension * scalingFactor)</code>.</div>
|
||||
<dl><dt><span class="strong">Returns:</span></dt><dd>the scaled value of <code>dimension</code>.</dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="equals(org.libjpegturbo.turbojpeg.TJScalingFactor)">
|
||||
<!-- -->
|
||||
</a>
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<h4>equals</h4>
|
||||
<pre>public boolean equals(<a href="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg">TJScalingFactor</a> other)</pre>
|
||||
<div class="block">Returns true or false, depending on whether this instance and
|
||||
<code>other</code> have the same numerator and denominator.</div>
|
||||
<dl><dt><span class="strong">Returns:</span></dt><dd>true or false, depending on whether this instance and
|
||||
<code>other</code> have the same numerator and denominator.</dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="isOne()">
|
||||
<!-- -->
|
||||
</a>
|
||||
<ul class="blockListLast">
|
||||
<li class="blockList">
|
||||
<h4>isOne</h4>
|
||||
<pre>public boolean isOne()</pre>
|
||||
<div class="block">Returns true or false, depending on whether this instance is equal to
|
||||
1/1.</div>
|
||||
<dl><dt><span class="strong">Returns:</span></dt><dd>true or false, depending on whether this instance is equal to
|
||||
1/1.</dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<!-- ========= END OF CLASS DATA ========= -->
|
||||
<HR>
|
||||
|
||||
|
||||
<!-- ======= START OF BOTTOM NAVBAR ====== -->
|
||||
<A NAME="navbar_bottom"><!-- --></A>
|
||||
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
|
||||
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
|
||||
<TR>
|
||||
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
|
||||
<A NAME="navbar_bottom_firstrow"><!-- --></A>
|
||||
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
|
||||
<TR ALIGN="center" VALIGN="top">
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../org/libjpegturbo/turbojpeg/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
</TD>
|
||||
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
|
||||
</EM>
|
||||
</TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
||||
<A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg"><B>PREV CLASS</B></A>
|
||||
<A HREF="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg"><B>NEXT CLASS</B></A></FONT></TD>
|
||||
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
||||
<A HREF="../../../index.html?org/libjpegturbo/turbojpeg/TJScalingFactor.html" target="_top"><B>FRAMES</B></A>
|
||||
<A HREF="TJScalingFactor.html" target="_top"><B>NO FRAMES</B></A>
|
||||
<SCRIPT type="text/javascript">
|
||||
<!--
|
||||
<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/TJTransform.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/TJScalingFactor.html" target="_top">Frames</a></li>
|
||||
<li><a href="TJScalingFactor.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) {
|
||||
document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');
|
||||
allClassesLink.style.display = "block";
|
||||
}
|
||||
else {
|
||||
allClassesLink.style.display = "none";
|
||||
}
|
||||
//-->
|
||||
</SCRIPT>
|
||||
<NOSCRIPT>
|
||||
<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>
|
||||
</NOSCRIPT>
|
||||
|
||||
|
||||
</FONT></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
|
||||
SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
|
||||
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
|
||||
DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<A NAME="skip-navbar_bottom"></A>
|
||||
</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="#method_summary">Method</a></li>
|
||||
</ul>
|
||||
<ul class="subNavList">
|
||||
<li>Detail: </li>
|
||||
<li>Field | </li>
|
||||
<li><a href="#constructor_detail">Constr</a> | </li>
|
||||
<li><a href="#method_detail">Method</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<a name="skip-navbar_bottom">
|
||||
<!-- -->
|
||||
</a></div>
|
||||
<!-- ======== END OF BOTTOM NAVBAR ======= -->
|
||||
|
||||
<HR>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,301 +1,291 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<!--NewPage-->
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>
|
||||
TJTransformer
|
||||
</TITLE>
|
||||
|
||||
|
||||
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
|
||||
|
||||
<SCRIPT type="text/javascript">
|
||||
function windowTitle()
|
||||
{
|
||||
<!-- NewPage -->
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>TJTransformer</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="TJTransformer";
|
||||
}
|
||||
}
|
||||
</SCRIPT>
|
||||
<NOSCRIPT>
|
||||
</NOSCRIPT>
|
||||
|
||||
</HEAD>
|
||||
|
||||
<BODY BGCOLOR="white" onload="windowTitle();">
|
||||
<HR>
|
||||
|
||||
|
||||
//-->
|
||||
</script>
|
||||
<noscript>
|
||||
<div>JavaScript is disabled on your browser.</div>
|
||||
</noscript>
|
||||
<!-- ========= START OF TOP NAVBAR ======= -->
|
||||
<A NAME="navbar_top"><!-- --></A>
|
||||
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
|
||||
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
|
||||
<TR>
|
||||
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
|
||||
<A NAME="navbar_top_firstrow"><!-- --></A>
|
||||
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
|
||||
<TR ALIGN="center" VALIGN="top">
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../org/libjpegturbo/turbojpeg/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
</TD>
|
||||
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
|
||||
</EM>
|
||||
</TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
||||
<A HREF="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg"><B>PREV CLASS</B></A>
|
||||
NEXT CLASS</FONT></TD>
|
||||
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
||||
<A HREF="../../../index.html?org/libjpegturbo/turbojpeg/TJTransformer.html" target="_top"><B>FRAMES</B></A>
|
||||
<A HREF="TJTransformer.html" target="_top"><B>NO FRAMES</B></A>
|
||||
<SCRIPT type="text/javascript">
|
||||
<!--
|
||||
<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/TJTransform.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">Prev Class</span></a></li>
|
||||
<li><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.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/TJTransformer.html" target="_top">Frames</a></li>
|
||||
<li><a href="TJTransformer.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) {
|
||||
document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');
|
||||
allClassesLink.style.display = "block";
|
||||
}
|
||||
else {
|
||||
allClassesLink.style.display = "none";
|
||||
}
|
||||
//-->
|
||||
</SCRIPT>
|
||||
<NOSCRIPT>
|
||||
<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>
|
||||
</NOSCRIPT>
|
||||
|
||||
|
||||
</FONT></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
|
||||
SUMMARY: NESTED | <A HREF="#fields_inherited_from_class_org.libjpegturbo.turbojpeg.TJDecompressor">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
|
||||
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
|
||||
DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<A NAME="skip-navbar_top"></A>
|
||||
</script>
|
||||
</div>
|
||||
<div>
|
||||
<ul class="subNavList">
|
||||
<li>Summary: </li>
|
||||
<li>Nested | </li>
|
||||
<li><a href="#fields_inherited_from_class_org.libjpegturbo.turbojpeg.TJDecompressor">Field</a> | </li>
|
||||
<li><a href="#constructor_summary">Constr</a> | </li>
|
||||
<li><a href="#method_summary">Method</a></li>
|
||||
</ul>
|
||||
<ul class="subNavList">
|
||||
<li>Detail: </li>
|
||||
<li>Field | </li>
|
||||
<li><a href="#constructor_detail">Constr</a> | </li>
|
||||
<li><a href="#method_detail">Method</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<a name="skip-navbar_top">
|
||||
<!-- -->
|
||||
</a></div>
|
||||
<!-- ========= END OF TOP NAVBAR ========= -->
|
||||
|
||||
<HR>
|
||||
<!-- ======== START OF CLASS DATA ======== -->
|
||||
<H2>
|
||||
<FONT SIZE="-1">
|
||||
org.libjpegturbo.turbojpeg</FONT>
|
||||
<BR>
|
||||
Class TJTransformer</H2>
|
||||
<PRE>
|
||||
java.lang.Object
|
||||
<IMG SRC="../../../resources/inherit.gif" ALT="extended by "><A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">org.libjpegturbo.turbojpeg.TJDecompressor</A>
|
||||
<IMG SRC="../../../resources/inherit.gif" ALT="extended by "><B>org.libjpegturbo.turbojpeg.TJTransformer</B>
|
||||
</PRE>
|
||||
<HR>
|
||||
<DL>
|
||||
<DT><PRE>public class <B>TJTransformer</B><DT>extends <A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</A></DL>
|
||||
</PRE>
|
||||
|
||||
<P>
|
||||
TurboJPEG lossless transformer
|
||||
<P>
|
||||
|
||||
<P>
|
||||
<HR>
|
||||
|
||||
<P>
|
||||
<div class="header">
|
||||
<div class="subTitle">org.libjpegturbo.turbojpeg</div>
|
||||
<h2 title="Class TJTransformer" class="title">Class TJTransformer</h2>
|
||||
</div>
|
||||
<div class="contentContainer">
|
||||
<ul class="inheritance">
|
||||
<li>java.lang.Object</li>
|
||||
<li>
|
||||
<ul class="inheritance">
|
||||
<li><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">org.libjpegturbo.turbojpeg.TJDecompressor</a></li>
|
||||
<li>
|
||||
<ul class="inheritance">
|
||||
<li>org.libjpegturbo.turbojpeg.TJTransformer</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="description">
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<hr>
|
||||
<br>
|
||||
<pre>public class <span class="strong">TJTransformer</span>
|
||||
extends <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></pre>
|
||||
<div class="block">TurboJPEG lossless transformer</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="summary">
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<!-- =========== FIELD SUMMARY =========== -->
|
||||
|
||||
<A NAME="field_summary"><!-- --></A>
|
||||
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
||||
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
|
||||
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
|
||||
<B>Field Summary</B></FONT></TH>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<A NAME="fields_inherited_from_class_org.libjpegturbo.turbojpeg.TJDecompressor"><!-- --></A>
|
||||
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
||||
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
|
||||
<TH ALIGN="left"><B>Fields inherited from class org.libjpegturbo.turbojpeg.<A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</A></B></TH>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<TD><CODE><A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#handle">handle</A>, <A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#jpegBuf">jpegBuf</A>, <A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#jpegBufSize">jpegBufSize</A>, <A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#jpegColorspace">jpegColorspace</A>, <A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#jpegHeight">jpegHeight</A>, <A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#jpegSubsamp">jpegSubsamp</A>, <A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#jpegWidth">jpegWidth</A></CODE></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
|
||||
<ul class="blockList">
|
||||
<li class="blockList"><a name="field_summary">
|
||||
<!-- -->
|
||||
</a>
|
||||
<h3>Field Summary</h3>
|
||||
<ul class="blockList">
|
||||
<li class="blockList"><a name="fields_inherited_from_class_org.libjpegturbo.turbojpeg.TJDecompressor">
|
||||
<!-- -->
|
||||
</a>
|
||||
<h3>Fields inherited from class org.libjpegturbo.turbojpeg.<a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></h3>
|
||||
<code><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#handle">handle</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#jpegBuf">jpegBuf</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#jpegBufSize">jpegBufSize</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#jpegColorspace">jpegColorspace</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#jpegHeight">jpegHeight</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#jpegSubsamp">jpegSubsamp</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#jpegWidth">jpegWidth</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#yuvImage">yuvImage</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
|
||||
|
||||
<A NAME="constructor_summary"><!-- --></A>
|
||||
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
||||
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
|
||||
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
|
||||
<B>Constructor Summary</B></FONT></TH>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJTransformer.html#TJTransformer()">TJTransformer</A></B>()</CODE>
|
||||
|
||||
<BR>
|
||||
Create a TurboJPEG lossless transformer instance.</TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJTransformer.html#TJTransformer(byte[])">TJTransformer</A></B>(byte[] jpegImage)</CODE>
|
||||
|
||||
<BR>
|
||||
Create a TurboJPEG lossless transformer instance and associate the JPEG
|
||||
image stored in <code>jpegImage</code> with the newly-created instance.</TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJTransformer.html#TJTransformer(byte[], int)">TJTransformer</A></B>(byte[] jpegImage,
|
||||
int imageSize)</CODE>
|
||||
|
||||
<BR>
|
||||
Create a TurboJPEG lossless transformer instance and associate the JPEG
|
||||
<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/TJTransformer.html#TJTransformer()">TJTransformer</a></strong>()</code>
|
||||
<div class="block">Create a TurboJPEG lossless transformer instance.</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colOne"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJTransformer.html#TJTransformer(byte[])">TJTransformer</a></strong>(byte[] jpegImage)</code>
|
||||
<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>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colOne"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJTransformer.html#TJTransformer(byte[],%20int)">TJTransformer</a></strong>(byte[] jpegImage,
|
||||
int imageSize)</code>
|
||||
<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.</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
|
||||
<code>jpegImage</code> with the newly created instance.</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</li>
|
||||
</ul>
|
||||
<!-- ========== METHOD SUMMARY =========== -->
|
||||
|
||||
<A NAME="method_summary"><!-- --></A>
|
||||
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
||||
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
|
||||
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
|
||||
<B>Method Summary</B></FONT></TH>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||||
<CODE> int[]</CODE></FONT></TD>
|
||||
<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJTransformer.html#getTransformedSizes()">getTransformedSizes</A></B>()</CODE>
|
||||
|
||||
<BR>
|
||||
Returns an array containing the sizes of the transformed JPEG images from
|
||||
the most recent call to <A HREF="../../../org/libjpegturbo/turbojpeg/TJTransformer.html#transform(byte[][], org.libjpegturbo.turbojpeg.TJTransform[], int)"><CODE>transform()</CODE></A>.</TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||||
<CODE> void</CODE></FONT></TD>
|
||||
<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJTransformer.html#transform(byte[][], org.libjpegturbo.turbojpeg.TJTransform[], int)">transform</A></B>(byte[][] dstBufs,
|
||||
<A HREF="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</A>[] transforms,
|
||||
int flags)</CODE>
|
||||
|
||||
<BR>
|
||||
Losslessly transform the JPEG image associated with this transformer
|
||||
<ul class="blockList">
|
||||
<li class="blockList"><a name="method_summary">
|
||||
<!-- -->
|
||||
</a>
|
||||
<h3>Method Summary</h3>
|
||||
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
|
||||
<caption><span>Methods</span><span class="tabEnd"> </span></caption>
|
||||
<tr>
|
||||
<th class="colFirst" scope="col">Modifier and Type</th>
|
||||
<th class="colLast" scope="col">Method and Description</th>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><code>int[]</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJTransformer.html#getTransformedSizes()">getTransformedSizes</a></strong>()</code>
|
||||
<div class="block">Returns an array containing the sizes of the transformed JPEG images
|
||||
generated by the most recent transform operation.</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colFirst"><code>void</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJTransformer.html#transform(byte[][],%20org.libjpegturbo.turbojpeg.TJTransform[],%20int)">transform</a></strong>(byte[][] dstBufs,
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</a>[] transforms,
|
||||
int flags)</code>
|
||||
<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.</TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||||
<CODE> <A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</A>[]</CODE></FONT></TD>
|
||||
<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJTransformer.html#transform(org.libjpegturbo.turbojpeg.TJTransform[], int)">transform</A></B>(<A HREF="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</A>[] transforms,
|
||||
int flags)</CODE>
|
||||
|
||||
<BR>
|
||||
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.</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<A NAME="methods_inherited_from_class_org.libjpegturbo.turbojpeg.TJDecompressor"><!-- --></A>
|
||||
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
||||
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
|
||||
<TH ALIGN="left"><B>Methods inherited from class org.libjpegturbo.turbojpeg.<A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</A></B></TH>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<TD><CODE><A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#close()">close</A>, <A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(java.awt.image.BufferedImage, int)">decompress</A>, <A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[], int, int, int, int, int)">decompress</A>, <A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[], int, int, int, int, int, int, int)">decompress</A>, <A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(int[], int, int, int, int, int, int, int)">decompress</A>, <A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(int, int, int, int)">decompress</A>, <A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(int, int, int, int, int)">decompress</A>, <A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(byte[], int)">decompressToYUV</A>, <A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(byte[], int, int, int, int)">decompressToYUV</A>, <A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(int)">decompressToYUV</A>, <A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(int, int, int, int)">decompressToYUV</A>, <A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#finalize()">finalize</A>, <A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getColorspace()">getColorspace</A>, <A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getHeight()">getHeight</A>, <A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getJPEGBuf()">getJPEGBuf</A>, <A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getJPEGSize()">getJPEGSize</A>, <A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getScaledHeight(int, int)">getScaledHeight</A>, <A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getScaledWidth(int, int)">getScaledWidth</A>, <A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getSubsamp()">getSubsamp</A>, <A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getWidth()">getWidth</A>, <A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#setJPEGImage(byte[], int)">setJPEGImage</A></CODE></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
|
||||
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
||||
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
|
||||
<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<TD><CODE>clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
|
||||
<P>
|
||||
|
||||
buffers.</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><code><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a>[]</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJTransformer.html#transform(org.libjpegturbo.turbojpeg.TJTransform[],%20int)">transform</a></strong>(<a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</a>[] transforms,
|
||||
int flags)</code>
|
||||
<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>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<ul class="blockList">
|
||||
<li class="blockList"><a name="methods_inherited_from_class_org.libjpegturbo.turbojpeg.TJDecompressor">
|
||||
<!-- -->
|
||||
</a>
|
||||
<h3>Methods inherited from class org.libjpegturbo.turbojpeg.<a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></h3>
|
||||
<code><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#close()">close</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(java.awt.image.BufferedImage,%20int)">decompress</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[],%20int,%20int,%20int,%20int,%20int)">decompress</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[],%20int,%20int,%20int,%20int,%20int,%20int,%20int)">decompress</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(int[],%20int,%20int,%20int,%20int,%20int,%20int,%20int)">decompress</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(int,%20int,%20int,%20int)">decompress</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(int,%20int,%20int,%20int,%20int)">decompress</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(byte[],%20int)">decompressToYUV</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(int)">decompressToYUV</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(int,%20int[],%20int,%20int)">decompressToYUV</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(int,%20int,%20int,%20int)">decompressToYUV</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(org.libjpegturbo.turbojpeg.YUVImage,%20int)">decompressToYUV</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#finalize()">finalize</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getColorspace()">getColorspace</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getHeight()">getHeight</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getJPEGBuf()">getJPEGBuf</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getJPEGSize()">getJPEGSize</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getScaledHeight(int,%20int)">getScaledHeight</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getScaledWidth(int,%20int)">getScaledWidth</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getSubsamp()">getSubsamp</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getWidth()">getWidth</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#setJPEGImage(byte[],%20int)">setJPEGImage</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#setSourceImage(byte[],%20int)">setSourceImage</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#setSourceImage(org.libjpegturbo.turbojpeg.YUVImage)">setSourceImage</a></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, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="details">
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<!-- ========= CONSTRUCTOR DETAIL ======== -->
|
||||
|
||||
<A NAME="constructor_detail"><!-- --></A>
|
||||
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
||||
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
|
||||
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
|
||||
<B>Constructor Detail</B></FONT></TH>
|
||||
</TR>
|
||||
</TABLE>
|
||||
|
||||
<A NAME="TJTransformer()"><!-- --></A><H3>
|
||||
TJTransformer</H3>
|
||||
<PRE>
|
||||
public <B>TJTransformer</B>()
|
||||
throws java.lang.Exception</PRE>
|
||||
<DL>
|
||||
<DD>Create a TurboJPEG lossless transformer instance.
|
||||
<P>
|
||||
<DL>
|
||||
|
||||
<DT><B>Throws:</B>
|
||||
<DD><CODE>java.lang.Exception</CODE></DL>
|
||||
</DL>
|
||||
<HR>
|
||||
|
||||
<A NAME="TJTransformer(byte[])"><!-- --></A><H3>
|
||||
TJTransformer</H3>
|
||||
<PRE>
|
||||
public <B>TJTransformer</B>(byte[] jpegImage)
|
||||
throws java.lang.Exception</PRE>
|
||||
<DL>
|
||||
<DD>Create a TurboJPEG lossless transformer instance and associate the JPEG
|
||||
image stored in <code>jpegImage</code> with the newly-created instance.
|
||||
<P>
|
||||
<DL>
|
||||
<DT><B>Parameters:</B><DD><CODE>jpegImage</CODE> - JPEG image buffer (size of the JPEG image is assumed to
|
||||
be the length of the array)
|
||||
<DT><B>Throws:</B>
|
||||
<DD><CODE>java.lang.Exception</CODE></DL>
|
||||
</DL>
|
||||
<HR>
|
||||
|
||||
<A NAME="TJTransformer(byte[], int)"><!-- --></A><H3>
|
||||
TJTransformer</H3>
|
||||
<PRE>
|
||||
public <B>TJTransformer</B>(byte[] jpegImage,
|
||||
int imageSize)
|
||||
throws java.lang.Exception</PRE>
|
||||
<DL>
|
||||
<DD>Create a TurboJPEG lossless transformer instance and associate the JPEG
|
||||
<ul class="blockList">
|
||||
<li class="blockList"><a name="constructor_detail">
|
||||
<!-- -->
|
||||
</a>
|
||||
<h3>Constructor Detail</h3>
|
||||
<a name="TJTransformer()">
|
||||
<!-- -->
|
||||
</a>
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<h4>TJTransformer</h4>
|
||||
<pre>public TJTransformer()
|
||||
throws java.lang.Exception</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>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="TJTransformer(byte[])">
|
||||
<!-- -->
|
||||
</a>
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<h4>TJTransformer</h4>
|
||||
<pre>public TJTransformer(byte[] jpegImage)
|
||||
throws java.lang.Exception</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>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="TJTransformer(byte[], int)">
|
||||
<!-- -->
|
||||
</a>
|
||||
<ul class="blockListLast">
|
||||
<li class="blockList">
|
||||
<h4>TJTransformer</h4>
|
||||
<pre>public TJTransformer(byte[] jpegImage,
|
||||
int imageSize)
|
||||
throws java.lang.Exception</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.
|
||||
<P>
|
||||
<DL>
|
||||
<DT><B>Parameters:</B><DD><CODE>jpegImage</CODE> - JPEG image buffer<DD><CODE>imageSize</CODE> - size of the JPEG image (in bytes)
|
||||
<DT><B>Throws:</B>
|
||||
<DD><CODE>java.lang.Exception</CODE></DL>
|
||||
</DL>
|
||||
|
||||
<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>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<!-- ============ METHOD DETAIL ========== -->
|
||||
|
||||
<A NAME="method_detail"><!-- --></A>
|
||||
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
||||
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
|
||||
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
|
||||
<B>Method Detail</B></FONT></TH>
|
||||
</TR>
|
||||
</TABLE>
|
||||
|
||||
<A NAME="transform(byte[][], org.libjpegturbo.turbojpeg.TJTransform[], int)"><!-- --></A><H3>
|
||||
transform</H3>
|
||||
<PRE>
|
||||
public void <B>transform</B>(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>
|
||||
<DL>
|
||||
<DD>Losslessly transform the JPEG image associated with this transformer
|
||||
<ul class="blockList">
|
||||
<li class="blockList"><a name="method_detail">
|
||||
<!-- -->
|
||||
</a>
|
||||
<h3>Method Detail</h3>
|
||||
<a name="transform(byte[][], org.libjpegturbo.turbojpeg.TJTransform[], int)">
|
||||
<!-- -->
|
||||
</a>
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<h4>transform</h4>
|
||||
<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>
|
||||
<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
|
||||
JPEG image structure to another without altering the values of the
|
||||
@@ -306,121 +296,121 @@ public void <B>transform</B>(byte[][] dstBufs,
|
||||
size of the destination image. Thus, this method provides a means of
|
||||
generating multiple transformed images from the same source or of applying
|
||||
multiple transformations simultaneously, in order to eliminate the need to
|
||||
read the source coefficients multiple times.
|
||||
<P>
|
||||
<DD><DL>
|
||||
<DT><B>Parameters:</B><DD><CODE>dstBufs</CODE> - an array of image buffers. <code>dstbufs[i]</code> will
|
||||
read the source coefficients multiple times.</div>
|
||||
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>dstBufs</code> - an array of image buffers. <code>dstbufs[i]</code> will
|
||||
receive a JPEG image that has been transformed using the parameters in
|
||||
<code>transforms[i]</code>. Use <A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html#bufSize(int, int, int)"><CODE>TJ.bufSize(int, int, int)</CODE></A> to determine the
|
||||
<code>transforms[i]</code>. Use <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#bufSize(int,%20int,%20int)"><code>TJ.bufSize(int, int, int)</code></a> to determine the
|
||||
maximum size for each buffer based on the transformed or cropped width and
|
||||
height.<DD><CODE>transforms</CODE> - an array of <A HREF="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg"><CODE>TJTransform</CODE></A> instances, each of
|
||||
height and the level of subsampling used in the source image.</dd><dd><code>transforms</code> - an array of <a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg"><code>TJTransform</code></a> instances, each of
|
||||
which specifies the transform parameters and/or cropping region for the
|
||||
corresponding transformed output image<DD><CODE>flags</CODE> - the bitwise OR of one or more of <A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg"><CODE>TJ.FLAG_*</CODE></A>
|
||||
<DT><B>Throws:</B>
|
||||
<DD><CODE>java.lang.Exception</CODE></DL>
|
||||
</DD>
|
||||
</DL>
|
||||
<HR>
|
||||
|
||||
<A NAME="transform(org.libjpegturbo.turbojpeg.TJTransform[], int)"><!-- --></A><H3>
|
||||
transform</H3>
|
||||
<PRE>
|
||||
public <A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</A>[] <B>transform</B>(<A HREF="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</A>[] transforms,
|
||||
int flags)
|
||||
throws java.lang.Exception</PRE>
|
||||
<DL>
|
||||
<DD>Losslessly transform the JPEG image associated with this transformer
|
||||
instance and return an array of <A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg"><CODE>TJDecompressor</CODE></A> instances, each of
|
||||
which has a transformed JPEG image associated with it.
|
||||
<P>
|
||||
<DD><DL>
|
||||
<DT><B>Parameters:</B><DD><CODE>transforms</CODE> - an array of <A HREF="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg"><CODE>TJTransform</CODE></A> instances, each of
|
||||
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>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="transform(org.libjpegturbo.turbojpeg.TJTransform[], int)">
|
||||
<!-- -->
|
||||
</a>
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<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>
|
||||
<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>
|
||||
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>transforms</code> - an array of <a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg"><code>TJTransform</code></a> instances, each of
|
||||
which specifies the transform parameters and/or cropping region for the
|
||||
corresponding transformed output image<DD><CODE>flags</CODE> - the bitwise OR of one or more of <A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg"><CODE>TJ.FLAG_*</CODE></A>
|
||||
<DT><B>Returns:</B><DD>an array of <A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg"><CODE>TJDecompressor</CODE></A> instances, each of
|
||||
which has a transformed JPEG image associated with it
|
||||
<DT><B>Throws:</B>
|
||||
<DD><CODE>java.lang.Exception</CODE></DL>
|
||||
</DD>
|
||||
</DL>
|
||||
<HR>
|
||||
|
||||
<A NAME="getTransformedSizes()"><!-- --></A><H3>
|
||||
getTransformedSizes</H3>
|
||||
<PRE>
|
||||
public int[] <B>getTransformedSizes</B>()
|
||||
throws java.lang.Exception</PRE>
|
||||
<DL>
|
||||
<DD>Returns an array containing the sizes of the transformed JPEG images from
|
||||
the most recent call to <A HREF="../../../org/libjpegturbo/turbojpeg/TJTransformer.html#transform(byte[][], org.libjpegturbo.turbojpeg.TJTransform[], int)"><CODE>transform()</CODE></A>.
|
||||
<P>
|
||||
<DD><DL>
|
||||
|
||||
<DT><B>Returns:</B><DD>an array containing the sizes of the transformed JPEG images from
|
||||
the most recent call to <A HREF="../../../org/libjpegturbo/turbojpeg/TJTransformer.html#transform(byte[][], org.libjpegturbo.turbojpeg.TJTransform[], int)"><CODE>transform()</CODE></A>
|
||||
<DT><B>Throws:</B>
|
||||
<DD><CODE>java.lang.Exception</CODE></DL>
|
||||
</DD>
|
||||
</DL>
|
||||
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">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>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="getTransformedSizes()">
|
||||
<!-- -->
|
||||
</a>
|
||||
<ul class="blockListLast">
|
||||
<li class="blockList">
|
||||
<h4>getTransformedSizes</h4>
|
||||
<pre>public int[] getTransformedSizes()
|
||||
throws java.lang.Exception</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>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<!-- ========= END OF CLASS DATA ========= -->
|
||||
<HR>
|
||||
|
||||
|
||||
<!-- ======= START OF BOTTOM NAVBAR ====== -->
|
||||
<A NAME="navbar_bottom"><!-- --></A>
|
||||
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
|
||||
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
|
||||
<TR>
|
||||
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
|
||||
<A NAME="navbar_bottom_firstrow"><!-- --></A>
|
||||
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
|
||||
<TR ALIGN="center" VALIGN="top">
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../org/libjpegturbo/turbojpeg/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
</TD>
|
||||
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
|
||||
</EM>
|
||||
</TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
||||
<A HREF="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg"><B>PREV CLASS</B></A>
|
||||
NEXT CLASS</FONT></TD>
|
||||
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
||||
<A HREF="../../../index.html?org/libjpegturbo/turbojpeg/TJTransformer.html" target="_top"><B>FRAMES</B></A>
|
||||
<A HREF="TJTransformer.html" target="_top"><B>NO FRAMES</B></A>
|
||||
<SCRIPT type="text/javascript">
|
||||
<!--
|
||||
<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/TJTransform.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">Prev Class</span></a></li>
|
||||
<li><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.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/TJTransformer.html" target="_top">Frames</a></li>
|
||||
<li><a href="TJTransformer.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) {
|
||||
document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');
|
||||
allClassesLink.style.display = "block";
|
||||
}
|
||||
else {
|
||||
allClassesLink.style.display = "none";
|
||||
}
|
||||
//-->
|
||||
</SCRIPT>
|
||||
<NOSCRIPT>
|
||||
<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>
|
||||
</NOSCRIPT>
|
||||
|
||||
|
||||
</FONT></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
|
||||
SUMMARY: NESTED | <A HREF="#fields_inherited_from_class_org.libjpegturbo.turbojpeg.TJDecompressor">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
|
||||
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
|
||||
DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<A NAME="skip-navbar_bottom"></A>
|
||||
</script>
|
||||
</div>
|
||||
<div>
|
||||
<ul class="subNavList">
|
||||
<li>Summary: </li>
|
||||
<li>Nested | </li>
|
||||
<li><a href="#fields_inherited_from_class_org.libjpegturbo.turbojpeg.TJDecompressor">Field</a> | </li>
|
||||
<li><a href="#constructor_summary">Constr</a> | </li>
|
||||
<li><a href="#method_summary">Method</a></li>
|
||||
</ul>
|
||||
<ul class="subNavList">
|
||||
<li>Detail: </li>
|
||||
<li>Field | </li>
|
||||
<li><a href="#constructor_detail">Constr</a> | </li>
|
||||
<li><a href="#method_detail">Method</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<a name="skip-navbar_bottom">
|
||||
<!-- -->
|
||||
</a></div>
|
||||
<!-- ======== END OF BOTTOM NAVBAR ======= -->
|
||||
|
||||
<HR>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
806
java/doc/org/libjpegturbo/turbojpeg/YUVImage.html
Normal file
806
java/doc/org/libjpegturbo/turbojpeg/YUVImage.html
Normal file
@@ -0,0 +1,806 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<!-- NewPage -->
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>YUVImage</title>
|
||||
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
|
||||
</head>
|
||||
<body>
|
||||
<script type="text/javascript"><!--
|
||||
if (location.href.indexOf('is-external=true') == -1) {
|
||||
parent.document.title="YUVImage";
|
||||
}
|
||||
//-->
|
||||
</script>
|
||||
<noscript>
|
||||
<div>JavaScript is disabled on your browser.</div>
|
||||
</noscript>
|
||||
<!-- ========= START OF TOP NAVBAR ======= -->
|
||||
<div class="topNav"><a name="navbar_top">
|
||||
<!-- -->
|
||||
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
|
||||
<!-- -->
|
||||
</a>
|
||||
<ul class="navList" title="Navigation">
|
||||
<li><a href="../../../org/libjpegturbo/turbojpeg/package-summary.html">Package</a></li>
|
||||
<li class="navBarCell1Rev">Class</li>
|
||||
<li><a href="package-tree.html">Tree</a></li>
|
||||
<li><a href="../../../deprecated-list.html">Deprecated</a></li>
|
||||
<li><a href="../../../index-all.html">Index</a></li>
|
||||
<li><a href="../../../help-doc.html">Help</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="subNav">
|
||||
<ul class="navList">
|
||||
<li><a href="../../../org/libjpegturbo/turbojpeg/TJTransformer.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">Prev Class</span></a></li>
|
||||
<li>Next Class</li>
|
||||
</ul>
|
||||
<ul class="navList">
|
||||
<li><a href="../../../index.html?org/libjpegturbo/turbojpeg/YUVImage.html" target="_top">Frames</a></li>
|
||||
<li><a href="YUVImage.html" target="_top">No Frames</a></li>
|
||||
</ul>
|
||||
<ul class="navList" id="allclasses_navbar_top">
|
||||
<li><a href="../../../allclasses-noframe.html">All Classes</a></li>
|
||||
</ul>
|
||||
<div>
|
||||
<script type="text/javascript"><!--
|
||||
allClassesLink = document.getElementById("allclasses_navbar_top");
|
||||
if(window==top) {
|
||||
allClassesLink.style.display = "block";
|
||||
}
|
||||
else {
|
||||
allClassesLink.style.display = "none";
|
||||
}
|
||||
//-->
|
||||
</script>
|
||||
</div>
|
||||
<div>
|
||||
<ul class="subNavList">
|
||||
<li>Summary: </li>
|
||||
<li>Nested | </li>
|
||||
<li><a href="#field_summary">Field</a> | </li>
|
||||
<li><a href="#constructor_summary">Constr</a> | </li>
|
||||
<li><a href="#method_summary">Method</a></li>
|
||||
</ul>
|
||||
<ul class="subNavList">
|
||||
<li>Detail: </li>
|
||||
<li><a href="#field_detail">Field</a> | </li>
|
||||
<li><a href="#constructor_detail">Constr</a> | </li>
|
||||
<li><a href="#method_detail">Method</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<a name="skip-navbar_top">
|
||||
<!-- -->
|
||||
</a></div>
|
||||
<!-- ========= END OF TOP NAVBAR ========= -->
|
||||
<!-- ======== START OF CLASS DATA ======== -->
|
||||
<div class="header">
|
||||
<div class="subTitle">org.libjpegturbo.turbojpeg</div>
|
||||
<h2 title="Class YUVImage" class="title">Class YUVImage</h2>
|
||||
</div>
|
||||
<div class="contentContainer">
|
||||
<ul class="inheritance">
|
||||
<li>java.lang.Object</li>
|
||||
<li>
|
||||
<ul class="inheritance">
|
||||
<li>org.libjpegturbo.turbojpeg.YUVImage</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="description">
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<hr>
|
||||
<br>
|
||||
<pre>public class <span class="strong">YUVImage</span>
|
||||
extends java.lang.Object</pre>
|
||||
<div class="block">This class encapsulates a YUV planar image and the metadata
|
||||
associated with it. The TurboJPEG API allows both the JPEG compression and
|
||||
decompression pipelines to be split into stages: YUV encode, compress from
|
||||
YUV, decompress to YUV, and YUV decode. A <code>YUVImage</code> instance
|
||||
serves as the destination image for YUV encode and decompress-to-YUV
|
||||
operations and as the source image for compress-from-YUV and YUV decode
|
||||
operations.
|
||||
<p>
|
||||
Technically, the JPEG format uses the YCbCr colorspace (which technically is
|
||||
not a "colorspace" but rather a "color transform"), but per the convention
|
||||
of the digital video community, the TurboJPEG API uses "YUV" to refer to an
|
||||
image format consisting of Y, Cb, and Cr image planes.
|
||||
<p>
|
||||
Each plane is simply a 2D array of bytes, each byte representing the value
|
||||
of one of the components (Y, Cb, or Cr) at a particular location in the
|
||||
image. The width and height of each plane are determined by the image
|
||||
width, height, and level of chrominance subsampling. The luminance plane
|
||||
width is the image width padded to the nearest multiple of the horizontal
|
||||
subsampling factor (2 in the case of 4:2:0 and 4:2:2, 4 in the case of
|
||||
4:1:1, 1 in the case of 4:4:4 or grayscale.) Similarly, the luminance plane
|
||||
height is the image height padded to the nearest multiple of the vertical
|
||||
subsampling factor (2 in the case of 4:2:0 or 4:4:0, 1 in the case of 4:4:4
|
||||
or grayscale.) The chrominance plane width is equal to the luminance plane
|
||||
width divided by the horizontal subsampling factor, and the chrominance
|
||||
plane height is equal to the luminance plane height divided by the vertical
|
||||
subsampling factor.
|
||||
<p>
|
||||
For example, if the source image is 35 x 35 pixels and 4:2:2 subsampling is
|
||||
used, then the luminance plane would be 36 x 35 bytes, and each of the
|
||||
chrominance planes would be 18 x 35 bytes. If you specify a line padding of
|
||||
4 bytes on top of this, then the luminance plane would be 36 x 35 bytes, and
|
||||
each of the chrominance planes would be 20 x 35 bytes.</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="summary">
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<!-- =========== FIELD SUMMARY =========== -->
|
||||
<ul class="blockList">
|
||||
<li class="blockList"><a name="field_summary">
|
||||
<!-- -->
|
||||
</a>
|
||||
<h3>Field Summary</h3>
|
||||
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation">
|
||||
<caption><span>Fields</span><span class="tabEnd"> </span></caption>
|
||||
<tr>
|
||||
<th class="colFirst" scope="col">Modifier and Type</th>
|
||||
<th class="colLast" scope="col">Field and Description</th>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><code>protected long</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html#handle">handle</a></strong></code> </td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colFirst"><code>protected int</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html#yuvHeight">yuvHeight</a></strong></code> </td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><code>protected int[]</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html#yuvOffsets">yuvOffsets</a></strong></code> </td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colFirst"><code>protected int</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html#yuvPad">yuvPad</a></strong></code> </td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><code>protected byte[][]</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html#yuvPlanes">yuvPlanes</a></strong></code> </td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colFirst"><code>protected int[]</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html#yuvStrides">yuvStrides</a></strong></code> </td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><code>protected int</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html#yuvSubsamp">yuvSubsamp</a></strong></code> </td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colFirst"><code>protected int</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html#yuvWidth">yuvWidth</a></strong></code> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</li>
|
||||
</ul>
|
||||
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
|
||||
<ul class="blockList">
|
||||
<li class="blockList"><a name="constructor_summary">
|
||||
<!-- -->
|
||||
</a>
|
||||
<h3>Constructor Summary</h3>
|
||||
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
|
||||
<caption><span>Constructors</span><span class="tabEnd"> </span></caption>
|
||||
<tr>
|
||||
<th class="colOne" scope="col">Constructor and Description</th>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colOne"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html#YUVImage(byte[][],%20int[],%20int,%20int[],%20int,%20int)">YUVImage</a></strong>(byte[][] planes,
|
||||
int[] offsets,
|
||||
int width,
|
||||
int[] strides,
|
||||
int height,
|
||||
int subsamp)</code>
|
||||
<div class="block">Create a new <code>YUVImage</code> instance from a set of existing image
|
||||
planes.</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colOne"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html#YUVImage(byte[],%20int,%20int,%20int,%20int)">YUVImage</a></strong>(byte[] yuvImage,
|
||||
int width,
|
||||
int pad,
|
||||
int height,
|
||||
int subsamp)</code>
|
||||
<div class="block">Create a new <code>YUVImage</code> instance from an existing unified image
|
||||
buffer.</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colOne"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html#YUVImage(int,%20int[],%20int,%20int)">YUVImage</a></strong>(int width,
|
||||
int[] strides,
|
||||
int height,
|
||||
int subsamp)</code>
|
||||
<div class="block">Create a new <code>YUVImage</code> instance backed by separate image
|
||||
planes, and allocate memory for the image planes.</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colOne"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html#YUVImage(int,%20int,%20int,%20int)">YUVImage</a></strong>(int width,
|
||||
int pad,
|
||||
int height,
|
||||
int subsamp)</code>
|
||||
<div class="block">Create a new <code>YUVImage</code> instance backed by a unified image
|
||||
buffer, and allocate memory for the image buffer.</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</li>
|
||||
</ul>
|
||||
<!-- ========== METHOD SUMMARY =========== -->
|
||||
<ul class="blockList">
|
||||
<li class="blockList"><a name="method_summary">
|
||||
<!-- -->
|
||||
</a>
|
||||
<h3>Method Summary</h3>
|
||||
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
|
||||
<caption><span>Methods</span><span class="tabEnd"> </span></caption>
|
||||
<tr>
|
||||
<th class="colFirst" scope="col">Modifier and Type</th>
|
||||
<th class="colLast" scope="col">Method and Description</th>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><code>byte[]</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html#getBuf()">getBuf</a></strong>()</code>
|
||||
<div class="block">Returns the YUV image buffer (if this image is stored in a unified
|
||||
buffer rather than separate image planes.)</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colFirst"><code>int</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html#getHeight()">getHeight</a></strong>()</code>
|
||||
<div class="block">Returns the height of the YUV image (or subregion.)</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><code>int[]</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html#getOffsets()">getOffsets</a></strong>()</code>
|
||||
<div class="block">Returns the offsets (in bytes) of each plane within the planes of a larger
|
||||
YUV image.</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colFirst"><code>int</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html#getPad()">getPad</a></strong>()</code>
|
||||
<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>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><code>byte[][]</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html#getPlanes()">getPlanes</a></strong>()</code>
|
||||
<div class="block">Returns the YUV image planes.</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colFirst"><code>int</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html#getSize()">getSize</a></strong>()</code>
|
||||
<div class="block">Returns the size (in bytes) of the YUV image buffer (if this image is
|
||||
stored in a unified buffer rather than separate image planes.)</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><code>int[]</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html#getStrides()">getStrides</a></strong>()</code>
|
||||
<div class="block">Returns the number of bytes per line of each plane in the YUV image.</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colFirst"><code>int</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html#getSubsamp()">getSubsamp</a></strong>()</code>
|
||||
<div class="block">Returns the level of chrominance subsampling used in the YUV image.</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><code>int</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html#getWidth()">getWidth</a></strong>()</code>
|
||||
<div class="block">Returns the width of the YUV image (or subregion.)</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colFirst"><code>void</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html#setBuf(byte[][],%20int[],%20int,%20int[],%20int,%20int)">setBuf</a></strong>(byte[][] planes,
|
||||
int[] offsets,
|
||||
int width,
|
||||
int[] strides,
|
||||
int height,
|
||||
int subsamp)</code>
|
||||
<div class="block">Assign a set of image planes to this <code>YUVImage</code> instance.</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><code>void</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html#setBuf(byte[],%20int,%20int,%20int,%20int)">setBuf</a></strong>(byte[] yuvImage,
|
||||
int width,
|
||||
int pad,
|
||||
int height,
|
||||
int subsamp)</code>
|
||||
<div class="block">Assign a unified image buffer to this <code>YUVImage</code> instance.</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<ul class="blockList">
|
||||
<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
|
||||
<!-- -->
|
||||
</a>
|
||||
<h3>Methods inherited from class java.lang.Object</h3>
|
||||
<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="details">
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<!-- ============ FIELD DETAIL =========== -->
|
||||
<ul class="blockList">
|
||||
<li class="blockList"><a name="field_detail">
|
||||
<!-- -->
|
||||
</a>
|
||||
<h3>Field Detail</h3>
|
||||
<a name="handle">
|
||||
<!-- -->
|
||||
</a>
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<h4>handle</h4>
|
||||
<pre>protected long handle</pre>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="yuvPlanes">
|
||||
<!-- -->
|
||||
</a>
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<h4>yuvPlanes</h4>
|
||||
<pre>protected byte[][] yuvPlanes</pre>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="yuvOffsets">
|
||||
<!-- -->
|
||||
</a>
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<h4>yuvOffsets</h4>
|
||||
<pre>protected int[] yuvOffsets</pre>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="yuvStrides">
|
||||
<!-- -->
|
||||
</a>
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<h4>yuvStrides</h4>
|
||||
<pre>protected int[] yuvStrides</pre>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="yuvPad">
|
||||
<!-- -->
|
||||
</a>
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<h4>yuvPad</h4>
|
||||
<pre>protected int yuvPad</pre>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="yuvWidth">
|
||||
<!-- -->
|
||||
</a>
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<h4>yuvWidth</h4>
|
||||
<pre>protected int yuvWidth</pre>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="yuvHeight">
|
||||
<!-- -->
|
||||
</a>
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<h4>yuvHeight</h4>
|
||||
<pre>protected int yuvHeight</pre>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="yuvSubsamp">
|
||||
<!-- -->
|
||||
</a>
|
||||
<ul class="blockListLast">
|
||||
<li class="blockList">
|
||||
<h4>yuvSubsamp</h4>
|
||||
<pre>protected int yuvSubsamp</pre>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<!-- ========= CONSTRUCTOR DETAIL ======== -->
|
||||
<ul class="blockList">
|
||||
<li class="blockList"><a name="constructor_detail">
|
||||
<!-- -->
|
||||
</a>
|
||||
<h3>Constructor Detail</h3>
|
||||
<a name="YUVImage(int, int[], int, int)">
|
||||
<!-- -->
|
||||
</a>
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<h4>YUVImage</h4>
|
||||
<pre>public YUVImage(int width,
|
||||
int[] strides,
|
||||
int height,
|
||||
int subsamp)
|
||||
throws java.lang.Exception</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
|
||||
per line in the corresponding plane of the YUV image. Setting the stride
|
||||
for any plane to 0 is the same as setting it to the plane width (see
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg"><code>above</code></a>.) If <code>strides</code> is null, then the
|
||||
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>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="YUVImage(int, int, int, int)">
|
||||
<!-- -->
|
||||
</a>
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<h4>YUVImage</h4>
|
||||
<pre>public YUVImage(int width,
|
||||
int pad,
|
||||
int height,
|
||||
int subsamp)
|
||||
throws java.lang.Exception</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>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="YUVImage(byte[][], int[], int, int[], int, int)">
|
||||
<!-- -->
|
||||
</a>
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<h4>YUVImage</h4>
|
||||
<pre>public YUVImage(byte[][] planes,
|
||||
int[] offsets,
|
||||
int width,
|
||||
int[] strides,
|
||||
int height,
|
||||
int subsamp)
|
||||
throws java.lang.Exception</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)
|
||||
image planes (or just the Y plane, if the image is grayscale.) These
|
||||
planes can be contiguous or non-contiguous in memory. Plane
|
||||
<code>i</code> should be at least <code>offsets[i] +
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJ.html#planeSizeYUV(int,%20int,%20int,%20int,%20int)"><code>TJ.planeSizeYUV</code></a>(i, width, strides[i], height, subsamp)</code>
|
||||
bytes in size.</dd><dd><code>offsets</code> - If this <code>YUVImage</code> instance represents a
|
||||
subregion of a larger image, then <code>offsets[i]</code> specifies the
|
||||
offset (in bytes) of the subregion within plane <code>i</code> of the
|
||||
larger image. Setting this to null is the same as setting the offsets for
|
||||
all planes to 0.</dd><dd><code>width</code> - width (in pixels) of the new YUV image (or subregion)</dd><dd><code>strides</code> - an array of integers, each specifying the number of bytes
|
||||
per line in the corresponding plane of the YUV image. Setting the stride
|
||||
for any plane to 0 is the same as setting it to the plane width (see
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg"><code>above</code></a>.) If <code>strides</code> is null, then the
|
||||
strides for all planes will be set to their respective plane widths. You
|
||||
can adjust the strides in order to add an arbitrary amount of line padding
|
||||
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>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="YUVImage(byte[], int, int, int, int)">
|
||||
<!-- -->
|
||||
</a>
|
||||
<ul class="blockListLast">
|
||||
<li class="blockList">
|
||||
<h4>YUVImage</h4>
|
||||
<pre>public YUVImage(byte[] yuvImage,
|
||||
int width,
|
||||
int pad,
|
||||
int height,
|
||||
int subsamp)
|
||||
throws java.lang.Exception</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
|
||||
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
|
||||
this buffer. The Y, U (Cb), and V (Cr) image planes are stored
|
||||
sequentially in the buffer (see <a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg"><code>above</code></a> for a description
|
||||
of the image format.)</dd><dd><code>width</code> - width (in pixels) of the YUV image</dd><dd><code>pad</code> - the line padding used in the YUV image buffer. For
|
||||
instance, if each line in each plane of the buffer is padded to the
|
||||
nearest multiple of 4 bytes, then <code>pad</code> should be set to 4.</dd><dd><code>height</code> - height (in pixels) of the YUV image</dd><dd><code>subsamp</code> - the level of chrominance subsampling used in the YUV
|
||||
image (one of <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#SAMP_444"><code>TJ.SAMP_*</code></a>)</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<!-- ============ METHOD DETAIL ========== -->
|
||||
<ul class="blockList">
|
||||
<li class="blockList"><a name="method_detail">
|
||||
<!-- -->
|
||||
</a>
|
||||
<h3>Method Detail</h3>
|
||||
<a name="setBuf(byte[][], int[], int, int[], int, int)">
|
||||
<!-- -->
|
||||
</a>
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<h4>setBuf</h4>
|
||||
<pre>public void setBuf(byte[][] planes,
|
||||
int[] offsets,
|
||||
int width,
|
||||
int[] strides,
|
||||
int height,
|
||||
int subsamp)
|
||||
throws java.lang.Exception</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
|
||||
planes can be contiguous or non-contiguous in memory. Plane
|
||||
<code>i</code> should be at least <code>offsets[i] +
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJ.html#planeSizeYUV(int,%20int,%20int,%20int,%20int)"><code>TJ.planeSizeYUV</code></a>(i, width, strides[i], height, subsamp)</code>
|
||||
bytes in size.</dd><dd><code>offsets</code> - If this <code>YUVImage</code> instance represents a
|
||||
subregion of a larger image, then <code>offsets[i]</code> specifies the
|
||||
offset (in bytes) of the subregion within plane <code>i</code> of the
|
||||
larger image. Setting this to null is the same as setting the offsets for
|
||||
all planes to 0.</dd><dd><code>width</code> - width (in pixels) of the YUV image (or subregion)</dd><dd><code>strides</code> - an array of integers, each specifying the number of bytes
|
||||
per line in the corresponding plane of the YUV image. Setting the stride
|
||||
for any plane to 0 is the same as setting it to the plane width (see
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg"><code>above</code></a>.) If <code>strides</code> is null, then the
|
||||
strides for all planes will be set to their respective plane widths. You
|
||||
can adjust the strides in order to add an arbitrary amount of line padding
|
||||
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>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="setBuf(byte[], int, int, int, int)">
|
||||
<!-- -->
|
||||
</a>
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<h4>setBuf</h4>
|
||||
<pre>public void setBuf(byte[] yuvImage,
|
||||
int width,
|
||||
int pad,
|
||||
int height,
|
||||
int subsamp)
|
||||
throws java.lang.Exception</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
|
||||
this buffer. The Y, U (Cb), and V (Cr) image planes are stored
|
||||
sequentially in the buffer (see <a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg"><code>above</code></a> for a description
|
||||
of the image format.)</dd><dd><code>width</code> - width (in pixels) of the YUV image</dd><dd><code>pad</code> - the line padding used in the YUV image buffer. For
|
||||
instance, if each line in each plane of the buffer is padded to the
|
||||
nearest multiple of 4 bytes, then <code>pad</code> should be set to 4.</dd><dd><code>height</code> - height (in pixels) of the YUV image</dd><dd><code>subsamp</code> - the level of chrominance subsampling used in the YUV
|
||||
image (one of <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#SAMP_444"><code>TJ.SAMP_*</code></a>)</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="getWidth()">
|
||||
<!-- -->
|
||||
</a>
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<h4>getWidth</h4>
|
||||
<pre>public int getWidth()
|
||||
throws java.lang.Exception</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>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="getHeight()">
|
||||
<!-- -->
|
||||
</a>
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<h4>getHeight</h4>
|
||||
<pre>public int getHeight()
|
||||
throws java.lang.Exception</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>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="getPad()">
|
||||
<!-- -->
|
||||
</a>
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<h4>getPad</h4>
|
||||
<pre>public int getPad()
|
||||
throws java.lang.Exception</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>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="getStrides()">
|
||||
<!-- -->
|
||||
</a>
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<h4>getStrides</h4>
|
||||
<pre>public int[] getStrides()
|
||||
throws java.lang.Exception</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>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="getOffsets()">
|
||||
<!-- -->
|
||||
</a>
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<h4>getOffsets</h4>
|
||||
<pre>public int[] getOffsets()
|
||||
throws java.lang.Exception</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>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="getSubsamp()">
|
||||
<!-- -->
|
||||
</a>
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<h4>getSubsamp</h4>
|
||||
<pre>public int getSubsamp()
|
||||
throws java.lang.Exception</pre>
|
||||
<div class="block">Returns the level of chrominance subsampling used in the YUV image. See
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJ.html#SAMP_444"><code>TJ.SAMP_*</code></a>.</div>
|
||||
<dl><dt><span class="strong">Returns:</span></dt><dd>the level of chrominance subsampling used in the YUV image</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="getPlanes()">
|
||||
<!-- -->
|
||||
</a>
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<h4>getPlanes</h4>
|
||||
<pre>public byte[][] getPlanes()
|
||||
throws java.lang.Exception</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>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="getBuf()">
|
||||
<!-- -->
|
||||
</a>
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<h4>getBuf</h4>
|
||||
<pre>public byte[] getBuf()
|
||||
throws java.lang.Exception</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>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="getSize()">
|
||||
<!-- -->
|
||||
</a>
|
||||
<ul class="blockListLast">
|
||||
<li class="blockList">
|
||||
<h4>getSize</h4>
|
||||
<pre>public int getSize()
|
||||
throws java.lang.Exception</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>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<!-- ========= END OF CLASS DATA ========= -->
|
||||
<!-- ======= START OF BOTTOM NAVBAR ====== -->
|
||||
<div class="bottomNav"><a name="navbar_bottom">
|
||||
<!-- -->
|
||||
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
|
||||
<!-- -->
|
||||
</a>
|
||||
<ul class="navList" title="Navigation">
|
||||
<li><a href="../../../org/libjpegturbo/turbojpeg/package-summary.html">Package</a></li>
|
||||
<li class="navBarCell1Rev">Class</li>
|
||||
<li><a href="package-tree.html">Tree</a></li>
|
||||
<li><a href="../../../deprecated-list.html">Deprecated</a></li>
|
||||
<li><a href="../../../index-all.html">Index</a></li>
|
||||
<li><a href="../../../help-doc.html">Help</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="subNav">
|
||||
<ul class="navList">
|
||||
<li><a href="../../../org/libjpegturbo/turbojpeg/TJTransformer.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">Prev Class</span></a></li>
|
||||
<li>Next Class</li>
|
||||
</ul>
|
||||
<ul class="navList">
|
||||
<li><a href="../../../index.html?org/libjpegturbo/turbojpeg/YUVImage.html" target="_top">Frames</a></li>
|
||||
<li><a href="YUVImage.html" target="_top">No Frames</a></li>
|
||||
</ul>
|
||||
<ul class="navList" id="allclasses_navbar_bottom">
|
||||
<li><a href="../../../allclasses-noframe.html">All Classes</a></li>
|
||||
</ul>
|
||||
<div>
|
||||
<script type="text/javascript"><!--
|
||||
allClassesLink = document.getElementById("allclasses_navbar_bottom");
|
||||
if(window==top) {
|
||||
allClassesLink.style.display = "block";
|
||||
}
|
||||
else {
|
||||
allClassesLink.style.display = "none";
|
||||
}
|
||||
//-->
|
||||
</script>
|
||||
</div>
|
||||
<div>
|
||||
<ul class="subNavList">
|
||||
<li>Summary: </li>
|
||||
<li>Nested | </li>
|
||||
<li><a href="#field_summary">Field</a> | </li>
|
||||
<li><a href="#constructor_summary">Constr</a> | </li>
|
||||
<li><a href="#method_summary">Method</a></li>
|
||||
</ul>
|
||||
<ul class="subNavList">
|
||||
<li>Detail: </li>
|
||||
<li><a href="#field_detail">Field</a> | </li>
|
||||
<li><a href="#constructor_detail">Constr</a> | </li>
|
||||
<li><a href="#method_detail">Method</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<a name="skip-navbar_bottom">
|
||||
<!-- -->
|
||||
</a></div>
|
||||
<!-- ======== END OF BOTTOM NAVBAR ======= -->
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,51 +1,27 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<!--NewPage-->
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>
|
||||
org.libjpegturbo.turbojpeg
|
||||
</TITLE>
|
||||
|
||||
|
||||
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
|
||||
|
||||
|
||||
</HEAD>
|
||||
|
||||
<BODY BGCOLOR="white">
|
||||
<FONT size="+1" CLASS="FrameTitleFont">
|
||||
<A HREF="../../../org/libjpegturbo/turbojpeg/package-summary.html" target="classFrame">org.libjpegturbo.turbojpeg</A></FONT>
|
||||
<TABLE BORDER="0" WIDTH="100%" SUMMARY="">
|
||||
<TR>
|
||||
<TD NOWRAP><FONT size="+1" CLASS="FrameHeadingFont">
|
||||
Interfaces</FONT>
|
||||
<FONT CLASS="FrameItemFont">
|
||||
<BR>
|
||||
<A HREF="TJCustomFilter.html" title="interface in org.libjpegturbo.turbojpeg" target="classFrame"><I>TJCustomFilter</I></A></FONT></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
|
||||
|
||||
<TABLE BORDER="0" WIDTH="100%" SUMMARY="">
|
||||
<TR>
|
||||
<TD NOWRAP><FONT size="+1" CLASS="FrameHeadingFont">
|
||||
Classes</FONT>
|
||||
<FONT CLASS="FrameItemFont">
|
||||
<BR>
|
||||
<A HREF="TJ.html" title="class in org.libjpegturbo.turbojpeg" target="classFrame">TJ</A>
|
||||
<BR>
|
||||
<A HREF="TJCompressor.html" title="class in org.libjpegturbo.turbojpeg" target="classFrame">TJCompressor</A>
|
||||
<BR>
|
||||
<A HREF="TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg" target="classFrame">TJDecompressor</A>
|
||||
<BR>
|
||||
<A HREF="TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg" target="classFrame">TJScalingFactor</A>
|
||||
<BR>
|
||||
<A HREF="TJTransform.html" title="class in org.libjpegturbo.turbojpeg" target="classFrame">TJTransform</A>
|
||||
<BR>
|
||||
<A HREF="TJTransformer.html" title="class in org.libjpegturbo.turbojpeg" target="classFrame">TJTransformer</A></FONT></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
<!-- NewPage -->
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>org.libjpegturbo.turbojpeg</title>
|
||||
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
|
||||
</head>
|
||||
<body>
|
||||
<h1 class="bar"><a href="../../../org/libjpegturbo/turbojpeg/package-summary.html" target="classFrame">org.libjpegturbo.turbojpeg</a></h1>
|
||||
<div class="indexContainer">
|
||||
<h2 title="Interfaces">Interfaces</h2>
|
||||
<ul title="Interfaces">
|
||||
<li><a href="TJCustomFilter.html" title="interface in org.libjpegturbo.turbojpeg" target="classFrame"><i>TJCustomFilter</i></a></li>
|
||||
</ul>
|
||||
<h2 title="Classes">Classes</h2>
|
||||
<ul title="Classes">
|
||||
<li><a href="TJ.html" title="class in org.libjpegturbo.turbojpeg" target="classFrame">TJ</a></li>
|
||||
<li><a href="TJCompressor.html" title="class in org.libjpegturbo.turbojpeg" target="classFrame">TJCompressor</a></li>
|
||||
<li><a href="TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg" target="classFrame">TJDecompressor</a></li>
|
||||
<li><a href="TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg" target="classFrame">TJScalingFactor</a></li>
|
||||
<li><a href="TJTransform.html" title="class in org.libjpegturbo.turbojpeg" target="classFrame">TJTransform</a></li>
|
||||
<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>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1,185 +1,183 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<!--NewPage-->
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>
|
||||
org.libjpegturbo.turbojpeg
|
||||
</TITLE>
|
||||
|
||||
|
||||
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
|
||||
|
||||
<SCRIPT type="text/javascript">
|
||||
function windowTitle()
|
||||
{
|
||||
<!-- NewPage -->
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>org.libjpegturbo.turbojpeg</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="org.libjpegturbo.turbojpeg";
|
||||
}
|
||||
}
|
||||
</SCRIPT>
|
||||
<NOSCRIPT>
|
||||
</NOSCRIPT>
|
||||
|
||||
</HEAD>
|
||||
|
||||
<BODY BGCOLOR="white" onload="windowTitle();">
|
||||
<HR>
|
||||
|
||||
|
||||
//-->
|
||||
</script>
|
||||
<noscript>
|
||||
<div>JavaScript is disabled on your browser.</div>
|
||||
</noscript>
|
||||
<!-- ========= START OF TOP NAVBAR ======= -->
|
||||
<A NAME="navbar_top"><!-- --></A>
|
||||
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
|
||||
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
|
||||
<TR>
|
||||
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
|
||||
<A NAME="navbar_top_firstrow"><!-- --></A>
|
||||
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
|
||||
<TR ALIGN="center" VALIGN="top">
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../org/libjpegturbo/turbojpeg/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
</TD>
|
||||
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
|
||||
</EM>
|
||||
</TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
||||
PREV PACKAGE
|
||||
NEXT PACKAGE</FONT></TD>
|
||||
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
||||
<A HREF="../../../index.html?org/libjpegturbo/turbojpeg/package-summary.html" target="_top"><B>FRAMES</B></A>
|
||||
<A HREF="package-summary.html" target="_top"><B>NO FRAMES</B></A>
|
||||
<SCRIPT type="text/javascript">
|
||||
<!--
|
||||
<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</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>Prev Package</li>
|
||||
<li>Next Package</li>
|
||||
</ul>
|
||||
<ul class="navList">
|
||||
<li><a href="../../../index.html?org/libjpegturbo/turbojpeg/package-summary.html" target="_top">Frames</a></li>
|
||||
<li><a href="package-summary.html" target="_top">No Frames</a></li>
|
||||
</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) {
|
||||
document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');
|
||||
allClassesLink.style.display = "block";
|
||||
}
|
||||
else {
|
||||
allClassesLink.style.display = "none";
|
||||
}
|
||||
//-->
|
||||
</SCRIPT>
|
||||
<NOSCRIPT>
|
||||
<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>
|
||||
</NOSCRIPT>
|
||||
|
||||
|
||||
</FONT></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<A NAME="skip-navbar_top"></A>
|
||||
</script>
|
||||
</div>
|
||||
<a name="skip-navbar_top">
|
||||
<!-- -->
|
||||
</a></div>
|
||||
<!-- ========= END OF TOP NAVBAR ========= -->
|
||||
|
||||
<HR>
|
||||
<H2>
|
||||
Package org.libjpegturbo.turbojpeg
|
||||
</H2>
|
||||
|
||||
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
||||
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
|
||||
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
|
||||
<B>Interface Summary</B></FONT></TH>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<TD WIDTH="15%"><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJCustomFilter.html" title="interface in org.libjpegturbo.turbojpeg">TJCustomFilter</A></B></TD>
|
||||
<TD>Custom filter callback interface</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
|
||||
|
||||
<P>
|
||||
|
||||
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
||||
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
|
||||
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
|
||||
<B>Class Summary</B></FONT></TH>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<TD WIDTH="15%"><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</A></B></TD>
|
||||
<TD>TurboJPEG utility class (cannot be instantiated)</TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<TD WIDTH="15%"><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg">TJCompressor</A></B></TD>
|
||||
<TD>TurboJPEG compressor</TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<TD WIDTH="15%"><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</A></B></TD>
|
||||
<TD>TurboJPEG decompressor</TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<TD WIDTH="15%"><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg">TJScalingFactor</A></B></TD>
|
||||
<TD>Fractional scaling factor</TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<TD WIDTH="15%"><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</A></B></TD>
|
||||
<TD>Lossless transform parameters</TD>
|
||||
</TR>
|
||||
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||||
<TD WIDTH="15%"><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJTransformer.html" title="class in org.libjpegturbo.turbojpeg">TJTransformer</A></B></TD>
|
||||
<TD>TurboJPEG lossless transformer</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
|
||||
|
||||
<P>
|
||||
<DL>
|
||||
</DL>
|
||||
<HR>
|
||||
|
||||
|
||||
<div class="header">
|
||||
<h1 title="Package" class="title">Package org.libjpegturbo.turbojpeg</h1>
|
||||
</div>
|
||||
<div class="contentContainer">
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<table class="packageSummary" border="0" cellpadding="3" cellspacing="0" summary="Interface Summary table, listing interfaces, and an explanation">
|
||||
<caption><span>Interface Summary</span><span class="tabEnd"> </span></caption>
|
||||
<tr>
|
||||
<th class="colFirst" scope="col">Interface</th>
|
||||
<th class="colLast" scope="col">Description</th>
|
||||
</tr>
|
||||
<tbody>
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><a href="../../../org/libjpegturbo/turbojpeg/TJCustomFilter.html" title="interface in org.libjpegturbo.turbojpeg">TJCustomFilter</a></td>
|
||||
<td class="colLast">
|
||||
<div class="block">Custom filter callback interface</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</li>
|
||||
<li class="blockList">
|
||||
<table class="packageSummary" border="0" cellpadding="3" cellspacing="0" summary="Class Summary table, listing classes, and an explanation">
|
||||
<caption><span>Class Summary</span><span class="tabEnd"> </span></caption>
|
||||
<tr>
|
||||
<th class="colFirst" scope="col">Class</th>
|
||||
<th class="colLast" scope="col">Description</th>
|
||||
</tr>
|
||||
<tbody>
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><a href="../../../org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></td>
|
||||
<td class="colLast">
|
||||
<div class="block">TurboJPEG utility class (cannot be instantiated)</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colFirst"><a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg">TJCompressor</a></td>
|
||||
<td class="colLast">
|
||||
<div class="block">TurboJPEG compressor</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></td>
|
||||
<td class="colLast">
|
||||
<div class="block">TurboJPEG decompressor</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colFirst"><a href="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg">TJScalingFactor</a></td>
|
||||
<td class="colLast">
|
||||
<div class="block">Fractional scaling factor</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</a></td>
|
||||
<td class="colLast">
|
||||
<div class="block">Lossless transform parameters</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colFirst"><a href="../../../org/libjpegturbo/turbojpeg/TJTransformer.html" title="class in org.libjpegturbo.turbojpeg">TJTransformer</a></td>
|
||||
<td class="colLast">
|
||||
<div class="block">TurboJPEG lossless transformer</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a></td>
|
||||
<td class="colLast">
|
||||
<div class="block">This class encapsulates a YUV planar image and the metadata
|
||||
associated with it.</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<!-- ======= START OF BOTTOM NAVBAR ====== -->
|
||||
<A NAME="navbar_bottom"><!-- --></A>
|
||||
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
|
||||
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
|
||||
<TR>
|
||||
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
|
||||
<A NAME="navbar_bottom_firstrow"><!-- --></A>
|
||||
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
|
||||
<TR ALIGN="center" VALIGN="top">
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../org/libjpegturbo/turbojpeg/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
</TD>
|
||||
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
|
||||
</EM>
|
||||
</TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
||||
PREV PACKAGE
|
||||
NEXT PACKAGE</FONT></TD>
|
||||
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
||||
<A HREF="../../../index.html?org/libjpegturbo/turbojpeg/package-summary.html" target="_top"><B>FRAMES</B></A>
|
||||
<A HREF="package-summary.html" target="_top"><B>NO FRAMES</B></A>
|
||||
<SCRIPT type="text/javascript">
|
||||
<!--
|
||||
<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</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>Prev Package</li>
|
||||
<li>Next Package</li>
|
||||
</ul>
|
||||
<ul class="navList">
|
||||
<li><a href="../../../index.html?org/libjpegturbo/turbojpeg/package-summary.html" target="_top">Frames</a></li>
|
||||
<li><a href="package-summary.html" target="_top">No Frames</a></li>
|
||||
</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) {
|
||||
document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');
|
||||
allClassesLink.style.display = "block";
|
||||
}
|
||||
else {
|
||||
allClassesLink.style.display = "none";
|
||||
}
|
||||
//-->
|
||||
</SCRIPT>
|
||||
<NOSCRIPT>
|
||||
<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>
|
||||
</NOSCRIPT>
|
||||
|
||||
|
||||
</FONT></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<A NAME="skip-navbar_bottom"></A>
|
||||
</script>
|
||||
</div>
|
||||
<a name="skip-navbar_bottom">
|
||||
<!-- -->
|
||||
</a></div>
|
||||
<!-- ======== END OF BOTTOM NAVBAR ======= -->
|
||||
|
||||
<HR>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1,159 +1,143 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<!--NewPage-->
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>
|
||||
org.libjpegturbo.turbojpeg Class Hierarchy
|
||||
</TITLE>
|
||||
|
||||
|
||||
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
|
||||
|
||||
<SCRIPT type="text/javascript">
|
||||
function windowTitle()
|
||||
{
|
||||
<!-- NewPage -->
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>org.libjpegturbo.turbojpeg Class Hierarchy</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="org.libjpegturbo.turbojpeg Class Hierarchy";
|
||||
}
|
||||
}
|
||||
</SCRIPT>
|
||||
<NOSCRIPT>
|
||||
</NOSCRIPT>
|
||||
|
||||
</HEAD>
|
||||
|
||||
<BODY BGCOLOR="white" onload="windowTitle();">
|
||||
<HR>
|
||||
|
||||
|
||||
//-->
|
||||
</script>
|
||||
<noscript>
|
||||
<div>JavaScript is disabled on your browser.</div>
|
||||
</noscript>
|
||||
<!-- ========= START OF TOP NAVBAR ======= -->
|
||||
<A NAME="navbar_top"><!-- --></A>
|
||||
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
|
||||
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
|
||||
<TR>
|
||||
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
|
||||
<A NAME="navbar_top_firstrow"><!-- --></A>
|
||||
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
|
||||
<TR ALIGN="center" VALIGN="top">
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../org/libjpegturbo/turbojpeg/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD>
|
||||
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Tree</B></FONT> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
</TD>
|
||||
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
|
||||
</EM>
|
||||
</TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
||||
PREV
|
||||
NEXT</FONT></TD>
|
||||
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
||||
<A HREF="../../../index.html?org/libjpegturbo/turbojpeg/package-tree.html" target="_top"><B>FRAMES</B></A>
|
||||
<A HREF="package-tree.html" target="_top"><B>NO FRAMES</B></A>
|
||||
<SCRIPT type="text/javascript">
|
||||
<!--
|
||||
<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</li>
|
||||
<li class="navBarCell1Rev">Tree</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>Prev</li>
|
||||
<li>Next</li>
|
||||
</ul>
|
||||
<ul class="navList">
|
||||
<li><a href="../../../index.html?org/libjpegturbo/turbojpeg/package-tree.html" target="_top">Frames</a></li>
|
||||
<li><a href="package-tree.html" target="_top">No Frames</a></li>
|
||||
</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) {
|
||||
document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');
|
||||
allClassesLink.style.display = "block";
|
||||
}
|
||||
else {
|
||||
allClassesLink.style.display = "none";
|
||||
}
|
||||
//-->
|
||||
</SCRIPT>
|
||||
<NOSCRIPT>
|
||||
<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>
|
||||
</NOSCRIPT>
|
||||
|
||||
|
||||
</FONT></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<A NAME="skip-navbar_top"></A>
|
||||
</script>
|
||||
</div>
|
||||
<a name="skip-navbar_top">
|
||||
<!-- -->
|
||||
</a></div>
|
||||
<!-- ========= END OF TOP NAVBAR ========= -->
|
||||
|
||||
<HR>
|
||||
<CENTER>
|
||||
<H2>
|
||||
Hierarchy For Package org.libjpegturbo.turbojpeg
|
||||
</H2>
|
||||
</CENTER>
|
||||
<H2>
|
||||
Class Hierarchy
|
||||
</H2>
|
||||
<UL>
|
||||
<LI TYPE="circle">java.lang.Object<UL>
|
||||
<LI TYPE="circle">java.awt.geom.RectangularShape (implements java.lang.Cloneable, java.awt.Shape)
|
||||
<UL>
|
||||
<LI TYPE="circle">java.awt.geom.Rectangle2D<UL>
|
||||
<LI TYPE="circle">java.awt.Rectangle (implements java.io.Serializable, java.awt.Shape)
|
||||
<UL>
|
||||
<LI TYPE="circle">org.libjpegturbo.turbojpeg.<A HREF="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg"><B>TJTransform</B></A></UL>
|
||||
</UL>
|
||||
</UL>
|
||||
<LI TYPE="circle">org.libjpegturbo.turbojpeg.<A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg"><B>TJ</B></A><LI TYPE="circle">org.libjpegturbo.turbojpeg.<A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg"><B>TJCompressor</B></A><LI TYPE="circle">org.libjpegturbo.turbojpeg.<A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg"><B>TJDecompressor</B></A><UL>
|
||||
<LI TYPE="circle">org.libjpegturbo.turbojpeg.<A HREF="../../../org/libjpegturbo/turbojpeg/TJTransformer.html" title="class in org.libjpegturbo.turbojpeg"><B>TJTransformer</B></A></UL>
|
||||
<LI TYPE="circle">org.libjpegturbo.turbojpeg.<A HREF="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg"><B>TJScalingFactor</B></A></UL>
|
||||
</UL>
|
||||
<H2>
|
||||
Interface Hierarchy
|
||||
</H2>
|
||||
<UL>
|
||||
<LI TYPE="circle">org.libjpegturbo.turbojpeg.<A HREF="../../../org/libjpegturbo/turbojpeg/TJCustomFilter.html" title="interface in org.libjpegturbo.turbojpeg"><B>TJCustomFilter</B></A></UL>
|
||||
<HR>
|
||||
|
||||
|
||||
<div class="header">
|
||||
<h1 class="title">Hierarchy For Package org.libjpegturbo.turbojpeg</h1>
|
||||
</div>
|
||||
<div class="contentContainer">
|
||||
<h2 title="Class Hierarchy">Class Hierarchy</h2>
|
||||
<ul>
|
||||
<li type="circle">java.lang.Object
|
||||
<ul>
|
||||
<li type="circle">java.awt.geom.RectangularShape (implements java.lang.Cloneable, java.awt.Shape)
|
||||
<ul>
|
||||
<li type="circle">java.awt.geom.Rectangle2D
|
||||
<ul>
|
||||
<li type="circle">java.awt.Rectangle (implements java.io.Serializable, java.awt.Shape)
|
||||
<ul>
|
||||
<li type="circle">org.libjpegturbo.turbojpeg.<a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">TJTransform</span></a></li>
|
||||
</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>
|
||||
<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>
|
||||
</li>
|
||||
<li type="circle">org.libjpegturbo.turbojpeg.<a href="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">TJScalingFactor</span></a></li>
|
||||
<li type="circle">org.libjpegturbo.turbojpeg.<a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">YUVImage</span></a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<h2 title="Interface Hierarchy">Interface Hierarchy</h2>
|
||||
<ul>
|
||||
<li type="circle">org.libjpegturbo.turbojpeg.<a href="../../../org/libjpegturbo/turbojpeg/TJCustomFilter.html" title="interface in org.libjpegturbo.turbojpeg"><span class="strong">TJCustomFilter</span></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<!-- ======= START OF BOTTOM NAVBAR ====== -->
|
||||
<A NAME="navbar_bottom"><!-- --></A>
|
||||
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
|
||||
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
|
||||
<TR>
|
||||
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
|
||||
<A NAME="navbar_bottom_firstrow"><!-- --></A>
|
||||
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
|
||||
<TR ALIGN="center" VALIGN="top">
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../org/libjpegturbo/turbojpeg/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD>
|
||||
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Tree</B></FONT> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
</TD>
|
||||
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
|
||||
</EM>
|
||||
</TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
||||
PREV
|
||||
NEXT</FONT></TD>
|
||||
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
||||
<A HREF="../../../index.html?org/libjpegturbo/turbojpeg/package-tree.html" target="_top"><B>FRAMES</B></A>
|
||||
<A HREF="package-tree.html" target="_top"><B>NO FRAMES</B></A>
|
||||
<SCRIPT type="text/javascript">
|
||||
<!--
|
||||
<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</li>
|
||||
<li class="navBarCell1Rev">Tree</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>Prev</li>
|
||||
<li>Next</li>
|
||||
</ul>
|
||||
<ul class="navList">
|
||||
<li><a href="../../../index.html?org/libjpegturbo/turbojpeg/package-tree.html" target="_top">Frames</a></li>
|
||||
<li><a href="package-tree.html" target="_top">No Frames</a></li>
|
||||
</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) {
|
||||
document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');
|
||||
allClassesLink.style.display = "block";
|
||||
}
|
||||
else {
|
||||
allClassesLink.style.display = "none";
|
||||
}
|
||||
//-->
|
||||
</SCRIPT>
|
||||
<NOSCRIPT>
|
||||
<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>
|
||||
</NOSCRIPT>
|
||||
|
||||
|
||||
</FONT></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<A NAME="skip-navbar_bottom"></A>
|
||||
</script>
|
||||
</div>
|
||||
<a name="skip-navbar_bottom">
|
||||
<!-- -->
|
||||
</a></div>
|
||||
<!-- ======== END OF BOTTOM NAVBAR ======= -->
|
||||
|
||||
<HR>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1,161 +1,147 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<!--NewPage-->
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>
|
||||
Class Hierarchy
|
||||
</TITLE>
|
||||
|
||||
|
||||
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
|
||||
|
||||
<SCRIPT type="text/javascript">
|
||||
function windowTitle()
|
||||
{
|
||||
<!-- NewPage -->
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Class Hierarchy</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="Class Hierarchy";
|
||||
}
|
||||
}
|
||||
</SCRIPT>
|
||||
<NOSCRIPT>
|
||||
</NOSCRIPT>
|
||||
|
||||
</HEAD>
|
||||
|
||||
<BODY BGCOLOR="white" onload="windowTitle();">
|
||||
<HR>
|
||||
|
||||
|
||||
//-->
|
||||
</script>
|
||||
<noscript>
|
||||
<div>JavaScript is disabled on your browser.</div>
|
||||
</noscript>
|
||||
<!-- ========= START OF TOP NAVBAR ======= -->
|
||||
<A NAME="navbar_top"><!-- --></A>
|
||||
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
|
||||
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
|
||||
<TR>
|
||||
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
|
||||
<A NAME="navbar_top_firstrow"><!-- --></A>
|
||||
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
|
||||
<TR ALIGN="center" VALIGN="top">
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="org/libjpegturbo/turbojpeg/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD>
|
||||
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Tree</B></FONT> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
</TD>
|
||||
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
|
||||
</EM>
|
||||
</TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
||||
PREV
|
||||
NEXT</FONT></TD>
|
||||
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
||||
<A HREF="index.html?overview-tree.html" target="_top"><B>FRAMES</B></A>
|
||||
<A HREF="overview-tree.html" target="_top"><B>NO FRAMES</B></A>
|
||||
<SCRIPT type="text/javascript">
|
||||
<!--
|
||||
<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</li>
|
||||
<li class="navBarCell1Rev">Tree</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>Prev</li>
|
||||
<li>Next</li>
|
||||
</ul>
|
||||
<ul class="navList">
|
||||
<li><a href="index.html?overview-tree.html" target="_top">Frames</a></li>
|
||||
<li><a href="overview-tree.html" target="_top">No Frames</a></li>
|
||||
</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) {
|
||||
document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>');
|
||||
allClassesLink.style.display = "block";
|
||||
}
|
||||
else {
|
||||
allClassesLink.style.display = "none";
|
||||
}
|
||||
//-->
|
||||
</SCRIPT>
|
||||
<NOSCRIPT>
|
||||
<A HREF="allclasses-noframe.html"><B>All Classes</B></A>
|
||||
</NOSCRIPT>
|
||||
|
||||
|
||||
</FONT></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<A NAME="skip-navbar_top"></A>
|
||||
</script>
|
||||
</div>
|
||||
<a name="skip-navbar_top">
|
||||
<!-- -->
|
||||
</a></div>
|
||||
<!-- ========= END OF TOP NAVBAR ========= -->
|
||||
|
||||
<HR>
|
||||
<CENTER>
|
||||
<H2>
|
||||
Hierarchy For All Packages</H2>
|
||||
</CENTER>
|
||||
<DL>
|
||||
<DT><B>Package Hierarchies:</B><DD><A HREF="org/libjpegturbo/turbojpeg/package-tree.html">org.libjpegturbo.turbojpeg</A></DL>
|
||||
<HR>
|
||||
<H2>
|
||||
Class Hierarchy
|
||||
</H2>
|
||||
<UL>
|
||||
<LI TYPE="circle">java.lang.Object<UL>
|
||||
<LI TYPE="circle">java.awt.geom.RectangularShape (implements java.lang.Cloneable, java.awt.Shape)
|
||||
<UL>
|
||||
<LI TYPE="circle">java.awt.geom.Rectangle2D<UL>
|
||||
<LI TYPE="circle">java.awt.Rectangle (implements java.io.Serializable, java.awt.Shape)
|
||||
<UL>
|
||||
<LI TYPE="circle">org.libjpegturbo.turbojpeg.<A HREF="org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg"><B>TJTransform</B></A></UL>
|
||||
</UL>
|
||||
</UL>
|
||||
<LI TYPE="circle">org.libjpegturbo.turbojpeg.<A HREF="org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg"><B>TJ</B></A><LI TYPE="circle">org.libjpegturbo.turbojpeg.<A HREF="org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg"><B>TJCompressor</B></A><LI TYPE="circle">org.libjpegturbo.turbojpeg.<A HREF="org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg"><B>TJDecompressor</B></A><UL>
|
||||
<LI TYPE="circle">org.libjpegturbo.turbojpeg.<A HREF="org/libjpegturbo/turbojpeg/TJTransformer.html" title="class in org.libjpegturbo.turbojpeg"><B>TJTransformer</B></A></UL>
|
||||
<LI TYPE="circle">org.libjpegturbo.turbojpeg.<A HREF="org/libjpegturbo/turbojpeg/TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg"><B>TJScalingFactor</B></A></UL>
|
||||
</UL>
|
||||
<H2>
|
||||
Interface Hierarchy
|
||||
</H2>
|
||||
<UL>
|
||||
<LI TYPE="circle">org.libjpegturbo.turbojpeg.<A HREF="org/libjpegturbo/turbojpeg/TJCustomFilter.html" title="interface in org.libjpegturbo.turbojpeg"><B>TJCustomFilter</B></A></UL>
|
||||
<HR>
|
||||
|
||||
|
||||
<div class="header">
|
||||
<h1 class="title">Hierarchy For All Packages</h1>
|
||||
<span class="strong">Package Hierarchies:</span>
|
||||
<ul class="horizontal">
|
||||
<li><a href="org/libjpegturbo/turbojpeg/package-tree.html">org.libjpegturbo.turbojpeg</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="contentContainer">
|
||||
<h2 title="Class Hierarchy">Class Hierarchy</h2>
|
||||
<ul>
|
||||
<li type="circle">java.lang.Object
|
||||
<ul>
|
||||
<li type="circle">java.awt.geom.RectangularShape (implements java.lang.Cloneable, java.awt.Shape)
|
||||
<ul>
|
||||
<li type="circle">java.awt.geom.Rectangle2D
|
||||
<ul>
|
||||
<li type="circle">java.awt.Rectangle (implements java.io.Serializable, java.awt.Shape)
|
||||
<ul>
|
||||
<li type="circle">org.libjpegturbo.turbojpeg.<a href="org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">TJTransform</span></a></li>
|
||||
</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>
|
||||
<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>
|
||||
</li>
|
||||
<li type="circle">org.libjpegturbo.turbojpeg.<a href="org/libjpegturbo/turbojpeg/TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">TJScalingFactor</span></a></li>
|
||||
<li type="circle">org.libjpegturbo.turbojpeg.<a href="org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">YUVImage</span></a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<h2 title="Interface Hierarchy">Interface Hierarchy</h2>
|
||||
<ul>
|
||||
<li type="circle">org.libjpegturbo.turbojpeg.<a href="org/libjpegturbo/turbojpeg/TJCustomFilter.html" title="interface in org.libjpegturbo.turbojpeg"><span class="strong">TJCustomFilter</span></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<!-- ======= START OF BOTTOM NAVBAR ====== -->
|
||||
<A NAME="navbar_bottom"><!-- --></A>
|
||||
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
|
||||
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
|
||||
<TR>
|
||||
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
|
||||
<A NAME="navbar_bottom_firstrow"><!-- --></A>
|
||||
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
|
||||
<TR ALIGN="center" VALIGN="top">
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="org/libjpegturbo/turbojpeg/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD>
|
||||
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Tree</B></FONT> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
</TD>
|
||||
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
|
||||
</EM>
|
||||
</TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
||||
PREV
|
||||
NEXT</FONT></TD>
|
||||
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
||||
<A HREF="index.html?overview-tree.html" target="_top"><B>FRAMES</B></A>
|
||||
<A HREF="overview-tree.html" target="_top"><B>NO FRAMES</B></A>
|
||||
<SCRIPT type="text/javascript">
|
||||
<!--
|
||||
<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</li>
|
||||
<li class="navBarCell1Rev">Tree</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>Prev</li>
|
||||
<li>Next</li>
|
||||
</ul>
|
||||
<ul class="navList">
|
||||
<li><a href="index.html?overview-tree.html" target="_top">Frames</a></li>
|
||||
<li><a href="overview-tree.html" target="_top">No Frames</a></li>
|
||||
</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) {
|
||||
document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>');
|
||||
allClassesLink.style.display = "block";
|
||||
}
|
||||
else {
|
||||
allClassesLink.style.display = "none";
|
||||
}
|
||||
//-->
|
||||
</SCRIPT>
|
||||
<NOSCRIPT>
|
||||
<A HREF="allclasses-noframe.html"><B>All Classes</B></A>
|
||||
</NOSCRIPT>
|
||||
|
||||
|
||||
</FONT></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<A NAME="skip-navbar_bottom"></A>
|
||||
</script>
|
||||
</div>
|
||||
<a name="skip-navbar_bottom">
|
||||
<!-- -->
|
||||
</a></div>
|
||||
<!-- ======== END OF BOTTOM NAVBAR ======= -->
|
||||
|
||||
<HR>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
BIN
java/doc/resources/background.gif
Normal file
BIN
java/doc/resources/background.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.3 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 57 B |
BIN
java/doc/resources/tab.gif
Normal file
BIN
java/doc/resources/tab.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 291 B |
BIN
java/doc/resources/titlebar.gif
Normal file
BIN
java/doc/resources/titlebar.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 10 KiB |
BIN
java/doc/resources/titlebar_end.gif
Normal file
BIN
java/doc/resources/titlebar_end.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 849 B |
@@ -1,200 +1,150 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<!--NewPage-->
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>
|
||||
Serialized Form
|
||||
</TITLE>
|
||||
|
||||
|
||||
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
|
||||
|
||||
<SCRIPT type="text/javascript">
|
||||
function windowTitle()
|
||||
{
|
||||
<!-- NewPage -->
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Serialized Form</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="Serialized Form";
|
||||
}
|
||||
}
|
||||
</SCRIPT>
|
||||
<NOSCRIPT>
|
||||
</NOSCRIPT>
|
||||
|
||||
</HEAD>
|
||||
|
||||
<BODY BGCOLOR="white" onload="windowTitle();">
|
||||
<HR>
|
||||
|
||||
|
||||
//-->
|
||||
</script>
|
||||
<noscript>
|
||||
<div>JavaScript is disabled on your browser.</div>
|
||||
</noscript>
|
||||
<!-- ========= START OF TOP NAVBAR ======= -->
|
||||
<A NAME="navbar_top"><!-- --></A>
|
||||
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
|
||||
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
|
||||
<TR>
|
||||
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
|
||||
<A NAME="navbar_top_firstrow"><!-- --></A>
|
||||
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
|
||||
<TR ALIGN="center" VALIGN="top">
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="org/libjpegturbo/turbojpeg/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="org/libjpegturbo/turbojpeg/package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
</TD>
|
||||
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
|
||||
</EM>
|
||||
</TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
||||
PREV
|
||||
NEXT</FONT></TD>
|
||||
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
||||
<A HREF="index.html?serialized-form.html" target="_top"><B>FRAMES</B></A>
|
||||
<A HREF="serialized-form.html" target="_top"><B>NO FRAMES</B></A>
|
||||
<SCRIPT type="text/javascript">
|
||||
<!--
|
||||
<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</li>
|
||||
<li><a href="org/libjpegturbo/turbojpeg/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>Prev</li>
|
||||
<li>Next</li>
|
||||
</ul>
|
||||
<ul class="navList">
|
||||
<li><a href="index.html?serialized-form.html" target="_top">Frames</a></li>
|
||||
<li><a href="serialized-form.html" target="_top">No Frames</a></li>
|
||||
</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) {
|
||||
document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>');
|
||||
allClassesLink.style.display = "block";
|
||||
}
|
||||
else {
|
||||
allClassesLink.style.display = "none";
|
||||
}
|
||||
//-->
|
||||
</SCRIPT>
|
||||
<NOSCRIPT>
|
||||
<A HREF="allclasses-noframe.html"><B>All Classes</B></A>
|
||||
</NOSCRIPT>
|
||||
|
||||
|
||||
</FONT></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<A NAME="skip-navbar_top"></A>
|
||||
</script>
|
||||
</div>
|
||||
<a name="skip-navbar_top">
|
||||
<!-- -->
|
||||
</a></div>
|
||||
<!-- ========= END OF TOP NAVBAR ========= -->
|
||||
|
||||
<HR>
|
||||
<CENTER>
|
||||
<H1>
|
||||
Serialized Form</H1>
|
||||
</CENTER>
|
||||
<HR SIZE="4" NOSHADE>
|
||||
|
||||
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
||||
<TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor">
|
||||
<TH ALIGN="center"><FONT SIZE="+2">
|
||||
<B>Package</B> <B>org.libjpegturbo.turbojpeg</B></FONT></TH>
|
||||
</TR>
|
||||
</TABLE>
|
||||
|
||||
<P>
|
||||
<A NAME="org.libjpegturbo.turbojpeg.TJTransform"><!-- --></A>
|
||||
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
||||
<TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor">
|
||||
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
|
||||
<B>Class <A HREF="org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">org.libjpegturbo.turbojpeg.TJTransform</A> extends java.awt.Rectangle implements Serializable</B></FONT></TH>
|
||||
</TR>
|
||||
</TABLE>
|
||||
|
||||
<P>
|
||||
<B>serialVersionUID: </B>-127367705761430371L
|
||||
|
||||
<P>
|
||||
<A NAME="serializedForm"><!-- --></A>
|
||||
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
||||
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
|
||||
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
|
||||
<B>Serialized Fields</B></FONT></TH>
|
||||
</TR>
|
||||
</TABLE>
|
||||
|
||||
<H3>
|
||||
op</H3>
|
||||
<PRE>
|
||||
int <B>op</B></PRE>
|
||||
<DL>
|
||||
<DD>Transform operation (one of <code>OP_*</code>)
|
||||
<P>
|
||||
<DL>
|
||||
</DL>
|
||||
</DL>
|
||||
<HR>
|
||||
<H3>
|
||||
options</H3>
|
||||
<PRE>
|
||||
int <B>options</B></PRE>
|
||||
<DL>
|
||||
<DD>Transform options (bitwise OR of one or more of <code>OPT_*</code>)
|
||||
<P>
|
||||
<DL>
|
||||
</DL>
|
||||
</DL>
|
||||
<HR>
|
||||
<H3>
|
||||
cf</H3>
|
||||
<PRE>
|
||||
<A HREF="org/libjpegturbo/turbojpeg/TJCustomFilter.html" title="interface in org.libjpegturbo.turbojpeg">TJCustomFilter</A> <B>cf</B></PRE>
|
||||
<DL>
|
||||
<DD>Custom filter instance
|
||||
<P>
|
||||
<DL>
|
||||
</DL>
|
||||
</DL>
|
||||
|
||||
<P>
|
||||
<HR>
|
||||
|
||||
|
||||
<div class="header">
|
||||
<h1 title="Serialized Form" class="title">Serialized Form</h1>
|
||||
</div>
|
||||
<div class="serializedFormContainer">
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<h2 title="Package">Package org.libjpegturbo.turbojpeg</h2>
|
||||
<ul class="blockList">
|
||||
<li class="blockList"><a name="org.libjpegturbo.turbojpeg.TJTransform">
|
||||
<!-- -->
|
||||
</a>
|
||||
<h3>Class <a href="org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">org.libjpegturbo.turbojpeg.TJTransform</a> extends java.awt.Rectangle implements Serializable</h3>
|
||||
<dl class="nameValue">
|
||||
<dt>serialVersionUID:</dt>
|
||||
<dd>-127367705761430371L</dd>
|
||||
</dl>
|
||||
<ul class="blockList">
|
||||
<li class="blockList"><a name="serializedForm">
|
||||
<!-- -->
|
||||
</a>
|
||||
<h3>Serialized Fields</h3>
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<h4>op</h4>
|
||||
<pre>int op</pre>
|
||||
<div class="block">Transform operation (one of <code>OP_*</code>)</div>
|
||||
</li>
|
||||
<li class="blockList">
|
||||
<h4>options</h4>
|
||||
<pre>int options</pre>
|
||||
<div class="block">Transform options (bitwise OR of one or more of <code>OPT_*</code>)</div>
|
||||
</li>
|
||||
<li class="blockListLast">
|
||||
<h4>cf</h4>
|
||||
<pre><a href="org/libjpegturbo/turbojpeg/TJCustomFilter.html" title="interface in org.libjpegturbo.turbojpeg">TJCustomFilter</a> cf</pre>
|
||||
<div class="block">Custom filter instance</div>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<!-- ======= START OF BOTTOM NAVBAR ====== -->
|
||||
<A NAME="navbar_bottom"><!-- --></A>
|
||||
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
|
||||
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
|
||||
<TR>
|
||||
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
|
||||
<A NAME="navbar_bottom_firstrow"><!-- --></A>
|
||||
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
|
||||
<TR ALIGN="center" VALIGN="top">
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="org/libjpegturbo/turbojpeg/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="org/libjpegturbo/turbojpeg/package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
</TD>
|
||||
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
|
||||
</EM>
|
||||
</TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
||||
PREV
|
||||
NEXT</FONT></TD>
|
||||
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
||||
<A HREF="index.html?serialized-form.html" target="_top"><B>FRAMES</B></A>
|
||||
<A HREF="serialized-form.html" target="_top"><B>NO FRAMES</B></A>
|
||||
<SCRIPT type="text/javascript">
|
||||
<!--
|
||||
<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</li>
|
||||
<li><a href="org/libjpegturbo/turbojpeg/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>Prev</li>
|
||||
<li>Next</li>
|
||||
</ul>
|
||||
<ul class="navList">
|
||||
<li><a href="index.html?serialized-form.html" target="_top">Frames</a></li>
|
||||
<li><a href="serialized-form.html" target="_top">No Frames</a></li>
|
||||
</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) {
|
||||
document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>');
|
||||
allClassesLink.style.display = "block";
|
||||
}
|
||||
else {
|
||||
allClassesLink.style.display = "none";
|
||||
}
|
||||
//-->
|
||||
</SCRIPT>
|
||||
<NOSCRIPT>
|
||||
<A HREF="allclasses-noframe.html"><B>All Classes</B></A>
|
||||
</NOSCRIPT>
|
||||
|
||||
|
||||
</FONT></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<A NAME="skip-navbar_bottom"></A>
|
||||
</script>
|
||||
</div>
|
||||
<a name="skip-navbar_bottom">
|
||||
<!-- -->
|
||||
</a></div>
|
||||
<!-- ======== END OF BOTTOM NAVBAR ======= -->
|
||||
|
||||
<HR>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1,29 +1,474 @@
|
||||
/* Javadoc style sheet */
|
||||
|
||||
/* Define colors, fonts and other style attributes here to override the defaults */
|
||||
|
||||
/* Page background color */
|
||||
body { background-color: #FFFFFF; color:#000000 }
|
||||
|
||||
/* Headings */
|
||||
h1 { font-size: 145% }
|
||||
|
||||
/* Table colors */
|
||||
.TableHeadingColor { background: #CCCCFF; color:#000000 } /* Dark mauve */
|
||||
.TableSubHeadingColor { background: #EEEEFF; color:#000000 } /* Light mauve */
|
||||
.TableRowColor { background: #FFFFFF; color:#000000 } /* White */
|
||||
|
||||
/* Font used in left-hand frame lists */
|
||||
.FrameTitleFont { font-size: 100%; font-family: Helvetica, Arial, sans-serif; color:#000000 }
|
||||
.FrameHeadingFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif; color:#000000 }
|
||||
.FrameItemFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif; color:#000000 }
|
||||
|
||||
/* Navigation bar fonts and colors */
|
||||
.NavBarCell1 { background-color:#EEEEFF; color:#000000} /* Light mauve */
|
||||
.NavBarCell1Rev { background-color:#00008B; color:#FFFFFF} /* Dark Blue */
|
||||
.NavBarFont1 { font-family: Arial, Helvetica, sans-serif; color:#000000;color:#000000;}
|
||||
.NavBarFont1Rev { font-family: Arial, Helvetica, sans-serif; color:#FFFFFF;color:#FFFFFF;}
|
||||
|
||||
.NavBarCell2 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF; color:#000000}
|
||||
.NavBarCell3 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF; color:#000000}
|
||||
|
||||
/*
|
||||
Overall document style
|
||||
*/
|
||||
body {
|
||||
background-color:#ffffff;
|
||||
color:#353833;
|
||||
font-family:Arial, Helvetica, sans-serif;
|
||||
font-size:76%;
|
||||
margin:0;
|
||||
}
|
||||
a:link, a:visited {
|
||||
text-decoration:none;
|
||||
color:#4c6b87;
|
||||
}
|
||||
a:hover, a:focus {
|
||||
text-decoration:none;
|
||||
color:#bb7a2a;
|
||||
}
|
||||
a:active {
|
||||
text-decoration:none;
|
||||
color:#4c6b87;
|
||||
}
|
||||
a[name] {
|
||||
color:#353833;
|
||||
}
|
||||
a[name]:hover {
|
||||
text-decoration:none;
|
||||
color:#353833;
|
||||
}
|
||||
pre {
|
||||
font-size:1.3em;
|
||||
}
|
||||
h1 {
|
||||
font-size:1.8em;
|
||||
}
|
||||
h2 {
|
||||
font-size:1.5em;
|
||||
}
|
||||
h3 {
|
||||
font-size:1.4em;
|
||||
}
|
||||
h4 {
|
||||
font-size:1.3em;
|
||||
}
|
||||
h5 {
|
||||
font-size:1.2em;
|
||||
}
|
||||
h6 {
|
||||
font-size:1.1em;
|
||||
}
|
||||
ul {
|
||||
list-style-type:disc;
|
||||
}
|
||||
code, tt {
|
||||
font-size:1.2em;
|
||||
}
|
||||
dt code {
|
||||
font-size:1.2em;
|
||||
}
|
||||
table tr td dt code {
|
||||
font-size:1.2em;
|
||||
vertical-align:top;
|
||||
}
|
||||
sup {
|
||||
font-size:.6em;
|
||||
}
|
||||
/*
|
||||
Document title and Copyright styles
|
||||
*/
|
||||
.clear {
|
||||
clear:both;
|
||||
height:0px;
|
||||
overflow:hidden;
|
||||
}
|
||||
.aboutLanguage {
|
||||
float:right;
|
||||
padding:0px 21px;
|
||||
font-size:.8em;
|
||||
z-index:200;
|
||||
margin-top:-7px;
|
||||
}
|
||||
.legalCopy {
|
||||
margin-left:.5em;
|
||||
}
|
||||
.bar a, .bar a:link, .bar a:visited, .bar a:active {
|
||||
color:#FFFFFF;
|
||||
text-decoration:none;
|
||||
}
|
||||
.bar a:hover, .bar a:focus {
|
||||
color:#bb7a2a;
|
||||
}
|
||||
.tab {
|
||||
background-color:#0066FF;
|
||||
background-image:url(resources/titlebar.gif);
|
||||
background-position:left top;
|
||||
background-repeat:no-repeat;
|
||||
color:#ffffff;
|
||||
padding:8px;
|
||||
width:5em;
|
||||
font-weight:bold;
|
||||
}
|
||||
/*
|
||||
Navigation bar styles
|
||||
*/
|
||||
.bar {
|
||||
background-image:url(resources/background.gif);
|
||||
background-repeat:repeat-x;
|
||||
color:#FFFFFF;
|
||||
padding:.8em .5em .4em .8em;
|
||||
height:auto;/*height:1.8em;*/
|
||||
font-size:1em;
|
||||
margin:0;
|
||||
}
|
||||
.topNav {
|
||||
background-image:url(resources/background.gif);
|
||||
background-repeat:repeat-x;
|
||||
color:#FFFFFF;
|
||||
float:left;
|
||||
padding:0;
|
||||
width:100%;
|
||||
clear:right;
|
||||
height:2.8em;
|
||||
padding-top:10px;
|
||||
overflow:hidden;
|
||||
}
|
||||
.bottomNav {
|
||||
margin-top:10px;
|
||||
background-image:url(resources/background.gif);
|
||||
background-repeat:repeat-x;
|
||||
color:#FFFFFF;
|
||||
float:left;
|
||||
padding:0;
|
||||
width:100%;
|
||||
clear:right;
|
||||
height:2.8em;
|
||||
padding-top:10px;
|
||||
overflow:hidden;
|
||||
}
|
||||
.subNav {
|
||||
background-color:#dee3e9;
|
||||
border-bottom:1px solid #9eadc0;
|
||||
float:left;
|
||||
width:100%;
|
||||
overflow:hidden;
|
||||
}
|
||||
.subNav div {
|
||||
clear:left;
|
||||
float:left;
|
||||
padding:0 0 5px 6px;
|
||||
}
|
||||
ul.navList, ul.subNavList {
|
||||
float:left;
|
||||
margin:0 25px 0 0;
|
||||
padding:0;
|
||||
}
|
||||
ul.navList li{
|
||||
list-style:none;
|
||||
float:left;
|
||||
padding:3px 6px;
|
||||
}
|
||||
ul.subNavList li{
|
||||
list-style:none;
|
||||
float:left;
|
||||
font-size:90%;
|
||||
}
|
||||
.topNav a:link, .topNav a:active, .topNav a:visited, .bottomNav a:link, .bottomNav a:active, .bottomNav a:visited {
|
||||
color:#FFFFFF;
|
||||
text-decoration:none;
|
||||
}
|
||||
.topNav a:hover, .bottomNav a:hover {
|
||||
text-decoration:none;
|
||||
color:#bb7a2a;
|
||||
}
|
||||
.navBarCell1Rev {
|
||||
background-image:url(resources/tab.gif);
|
||||
background-color:#a88834;
|
||||
color:#FFFFFF;
|
||||
margin: auto 5px;
|
||||
border:1px solid #c9aa44;
|
||||
}
|
||||
/*
|
||||
Page header and footer styles
|
||||
*/
|
||||
.header, .footer {
|
||||
clear:both;
|
||||
margin:0 20px;
|
||||
padding:5px 0 0 0;
|
||||
}
|
||||
.indexHeader {
|
||||
margin:10px;
|
||||
position:relative;
|
||||
}
|
||||
.indexHeader h1 {
|
||||
font-size:1.3em;
|
||||
}
|
||||
.title {
|
||||
color:#2c4557;
|
||||
margin:10px 0;
|
||||
}
|
||||
.subTitle {
|
||||
margin:5px 0 0 0;
|
||||
}
|
||||
.header ul {
|
||||
margin:0 0 25px 0;
|
||||
padding:0;
|
||||
}
|
||||
.footer ul {
|
||||
margin:20px 0 5px 0;
|
||||
}
|
||||
.header ul li, .footer ul li {
|
||||
list-style:none;
|
||||
font-size:1.2em;
|
||||
}
|
||||
/*
|
||||
Heading styles
|
||||
*/
|
||||
div.details ul.blockList ul.blockList ul.blockList li.blockList h4, div.details ul.blockList ul.blockList ul.blockListLast li.blockList h4 {
|
||||
background-color:#dee3e9;
|
||||
border-top:1px solid #9eadc0;
|
||||
border-bottom:1px solid #9eadc0;
|
||||
margin:0 0 6px -8px;
|
||||
padding:2px 5px;
|
||||
}
|
||||
ul.blockList ul.blockList ul.blockList li.blockList h3 {
|
||||
background-color:#dee3e9;
|
||||
border-top:1px solid #9eadc0;
|
||||
border-bottom:1px solid #9eadc0;
|
||||
margin:0 0 6px -8px;
|
||||
padding:2px 5px;
|
||||
}
|
||||
ul.blockList ul.blockList li.blockList h3 {
|
||||
padding:0;
|
||||
margin:15px 0;
|
||||
}
|
||||
ul.blockList li.blockList h2 {
|
||||
padding:0px 0 20px 0;
|
||||
}
|
||||
/*
|
||||
Page layout container styles
|
||||
*/
|
||||
.contentContainer, .sourceContainer, .classUseContainer, .serializedFormContainer, .constantValuesContainer {
|
||||
clear:both;
|
||||
padding:10px 20px;
|
||||
position:relative;
|
||||
}
|
||||
.indexContainer {
|
||||
margin:10px;
|
||||
position:relative;
|
||||
font-size:1.0em;
|
||||
}
|
||||
.indexContainer h2 {
|
||||
font-size:1.1em;
|
||||
padding:0 0 3px 0;
|
||||
}
|
||||
.indexContainer ul {
|
||||
margin:0;
|
||||
padding:0;
|
||||
}
|
||||
.indexContainer ul li {
|
||||
list-style:none;
|
||||
}
|
||||
.contentContainer .description dl dt, .contentContainer .details dl dt, .serializedFormContainer dl dt {
|
||||
font-size:1.1em;
|
||||
font-weight:bold;
|
||||
margin:10px 0 0 0;
|
||||
color:#4E4E4E;
|
||||
}
|
||||
.contentContainer .description dl dd, .contentContainer .details dl dd, .serializedFormContainer dl dd {
|
||||
margin:10px 0 10px 20px;
|
||||
}
|
||||
.serializedFormContainer dl.nameValue dt {
|
||||
margin-left:1px;
|
||||
font-size:1.1em;
|
||||
display:inline;
|
||||
font-weight:bold;
|
||||
}
|
||||
.serializedFormContainer dl.nameValue dd {
|
||||
margin:0 0 0 1px;
|
||||
font-size:1.1em;
|
||||
display:inline;
|
||||
}
|
||||
/*
|
||||
List styles
|
||||
*/
|
||||
ul.horizontal li {
|
||||
display:inline;
|
||||
font-size:0.9em;
|
||||
}
|
||||
ul.inheritance {
|
||||
margin:0;
|
||||
padding:0;
|
||||
}
|
||||
ul.inheritance li {
|
||||
display:inline;
|
||||
list-style:none;
|
||||
}
|
||||
ul.inheritance li ul.inheritance {
|
||||
margin-left:15px;
|
||||
padding-left:15px;
|
||||
padding-top:1px;
|
||||
}
|
||||
ul.blockList, ul.blockListLast {
|
||||
margin:10px 0 10px 0;
|
||||
padding:0;
|
||||
}
|
||||
ul.blockList li.blockList, ul.blockListLast li.blockList {
|
||||
list-style:none;
|
||||
margin-bottom:25px;
|
||||
}
|
||||
ul.blockList ul.blockList li.blockList, ul.blockList ul.blockListLast li.blockList {
|
||||
padding:0px 20px 5px 10px;
|
||||
border:1px solid #9eadc0;
|
||||
background-color:#f9f9f9;
|
||||
}
|
||||
ul.blockList ul.blockList ul.blockList li.blockList, ul.blockList ul.blockList ul.blockListLast li.blockList {
|
||||
padding:0 0 5px 8px;
|
||||
background-color:#ffffff;
|
||||
border:1px solid #9eadc0;
|
||||
border-top:none;
|
||||
}
|
||||
ul.blockList ul.blockList ul.blockList ul.blockList li.blockList {
|
||||
margin-left:0;
|
||||
padding-left:0;
|
||||
padding-bottom:15px;
|
||||
border:none;
|
||||
border-bottom:1px solid #9eadc0;
|
||||
}
|
||||
ul.blockList ul.blockList ul.blockList ul.blockList li.blockListLast {
|
||||
list-style:none;
|
||||
border-bottom:none;
|
||||
padding-bottom:0;
|
||||
}
|
||||
table tr td dl, table tr td dl dt, table tr td dl dd {
|
||||
margin-top:0;
|
||||
margin-bottom:1px;
|
||||
}
|
||||
/*
|
||||
Table styles
|
||||
*/
|
||||
.contentContainer table, .classUseContainer table, .constantValuesContainer table {
|
||||
border-bottom:1px solid #9eadc0;
|
||||
width:100%;
|
||||
}
|
||||
.contentContainer ul li table, .classUseContainer ul li table, .constantValuesContainer ul li table {
|
||||
width:100%;
|
||||
}
|
||||
.contentContainer .description table, .contentContainer .details table {
|
||||
border-bottom:none;
|
||||
}
|
||||
.contentContainer ul li table th.colOne, .contentContainer ul li table th.colFirst, .contentContainer ul li table th.colLast, .classUseContainer ul li table th, .constantValuesContainer ul li table th, .contentContainer ul li table td.colOne, .contentContainer ul li table td.colFirst, .contentContainer ul li table td.colLast, .classUseContainer ul li table td, .constantValuesContainer ul li table td{
|
||||
vertical-align:top;
|
||||
padding-right:20px;
|
||||
}
|
||||
.contentContainer ul li table th.colLast, .classUseContainer ul li table th.colLast,.constantValuesContainer ul li table th.colLast,
|
||||
.contentContainer ul li table td.colLast, .classUseContainer ul li table td.colLast,.constantValuesContainer ul li table td.colLast,
|
||||
.contentContainer ul li table th.colOne, .classUseContainer ul li table th.colOne,
|
||||
.contentContainer ul li table td.colOne, .classUseContainer ul li table td.colOne {
|
||||
padding-right:3px;
|
||||
}
|
||||
.overviewSummary caption, .packageSummary caption, .contentContainer ul.blockList li.blockList caption, .summary caption, .classUseContainer caption, .constantValuesContainer caption {
|
||||
position:relative;
|
||||
text-align:left;
|
||||
background-repeat:no-repeat;
|
||||
color:#FFFFFF;
|
||||
font-weight:bold;
|
||||
clear:none;
|
||||
overflow:hidden;
|
||||
padding:0px;
|
||||
margin:0px;
|
||||
}
|
||||
caption a:link, caption a:hover, caption a:active, caption a:visited {
|
||||
color:#FFFFFF;
|
||||
}
|
||||
.overviewSummary caption span, .packageSummary caption span, .contentContainer ul.blockList li.blockList caption span, .summary caption span, .classUseContainer caption span, .constantValuesContainer caption span {
|
||||
white-space:nowrap;
|
||||
padding-top:8px;
|
||||
padding-left:8px;
|
||||
display:block;
|
||||
float:left;
|
||||
background-image:url(resources/titlebar.gif);
|
||||
height:18px;
|
||||
}
|
||||
.overviewSummary .tabEnd, .packageSummary .tabEnd, .contentContainer ul.blockList li.blockList .tabEnd, .summary .tabEnd, .classUseContainer .tabEnd, .constantValuesContainer .tabEnd {
|
||||
width:10px;
|
||||
background-image:url(resources/titlebar_end.gif);
|
||||
background-repeat:no-repeat;
|
||||
background-position:top right;
|
||||
position:relative;
|
||||
float:left;
|
||||
}
|
||||
ul.blockList ul.blockList li.blockList table {
|
||||
margin:0 0 12px 0px;
|
||||
width:100%;
|
||||
}
|
||||
.tableSubHeadingColor {
|
||||
background-color: #EEEEFF;
|
||||
}
|
||||
.altColor {
|
||||
background-color:#eeeeef;
|
||||
}
|
||||
.rowColor {
|
||||
background-color:#ffffff;
|
||||
}
|
||||
.overviewSummary td, .packageSummary td, .contentContainer ul.blockList li.blockList td, .summary td, .classUseContainer td, .constantValuesContainer td {
|
||||
text-align:left;
|
||||
padding:3px 3px 3px 7px;
|
||||
}
|
||||
th.colFirst, th.colLast, th.colOne, .constantValuesContainer th {
|
||||
background:#dee3e9;
|
||||
border-top:1px solid #9eadc0;
|
||||
border-bottom:1px solid #9eadc0;
|
||||
text-align:left;
|
||||
padding:3px 3px 3px 7px;
|
||||
}
|
||||
td.colOne a:link, td.colOne a:active, td.colOne a:visited, td.colOne a:hover, td.colFirst a:link, td.colFirst a:active, td.colFirst a:visited, td.colFirst a:hover, td.colLast a:link, td.colLast a:active, td.colLast a:visited, td.colLast a:hover, .constantValuesContainer td a:link, .constantValuesContainer td a:active, .constantValuesContainer td a:visited, .constantValuesContainer td a:hover {
|
||||
font-weight:bold;
|
||||
}
|
||||
td.colFirst, th.colFirst {
|
||||
border-left:1px solid #9eadc0;
|
||||
white-space:nowrap;
|
||||
}
|
||||
td.colLast, th.colLast {
|
||||
border-right:1px solid #9eadc0;
|
||||
}
|
||||
td.colOne, th.colOne {
|
||||
border-right:1px solid #9eadc0;
|
||||
border-left:1px solid #9eadc0;
|
||||
}
|
||||
table.overviewSummary {
|
||||
padding:0px;
|
||||
margin-left:0px;
|
||||
}
|
||||
table.overviewSummary td.colFirst, table.overviewSummary th.colFirst,
|
||||
table.overviewSummary td.colOne, table.overviewSummary th.colOne {
|
||||
width:25%;
|
||||
vertical-align:middle;
|
||||
}
|
||||
table.packageSummary td.colFirst, table.overviewSummary th.colFirst {
|
||||
width:25%;
|
||||
vertical-align:middle;
|
||||
}
|
||||
/*
|
||||
Content styles
|
||||
*/
|
||||
.description pre {
|
||||
margin-top:0;
|
||||
}
|
||||
.deprecatedContent {
|
||||
margin:0;
|
||||
padding:10px 0;
|
||||
}
|
||||
.docSummary {
|
||||
padding:0;
|
||||
}
|
||||
/*
|
||||
Formatting effect styles
|
||||
*/
|
||||
.sourceLineNo {
|
||||
color:green;
|
||||
padding:0 30px 0 0;
|
||||
}
|
||||
h1.hidden {
|
||||
visibility:hidden;
|
||||
overflow:hidden;
|
||||
font-size:.9em;
|
||||
}
|
||||
.block {
|
||||
display:block;
|
||||
margin:3px 0 0 0;
|
||||
}
|
||||
.strong {
|
||||
font-weight:bold;
|
||||
}
|
||||
|
||||
@@ -84,7 +84,8 @@ public final class TJ {
|
||||
* @param subsamp the level of chrominance subsampling (one of
|
||||
* <code>SAMP_*</code>)
|
||||
*
|
||||
* @return the MCU block width for the given level of chrominance subsampling
|
||||
* @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)
|
||||
@@ -105,7 +106,7 @@ public final class TJ {
|
||||
* <code>SAMP_*</code>)
|
||||
*
|
||||
* @return the MCU block height for the given level of chrominance
|
||||
* subsampling
|
||||
* subsampling.
|
||||
*/
|
||||
public static int getMCUHeight(int subsamp) throws Exception {
|
||||
if (subsamp < 0 || subsamp >= NUMSAMP)
|
||||
@@ -214,7 +215,7 @@ public final class TJ {
|
||||
*
|
||||
* @param pixelFormat the pixel format (one of <code>PF_*</code>)
|
||||
*
|
||||
* @return the pixel size (in bytes) for the given pixel format
|
||||
* @return the pixel size (in bytes) for the given pixel format.
|
||||
*/
|
||||
public static int getPixelSize(int pixelFormat) throws Exception {
|
||||
if (pixelFormat < 0 || pixelFormat >= NUMPF)
|
||||
@@ -236,7 +237,7 @@ public final class TJ {
|
||||
*
|
||||
* @param pixelFormat the pixel format (one of <code>PF_*</code>)
|
||||
*
|
||||
* @return the red offset for the given pixel format
|
||||
* @return the red offset for the given pixel format.
|
||||
*/
|
||||
public static int getRedOffset(int pixelFormat) throws Exception {
|
||||
if (pixelFormat < 0 || pixelFormat >= NUMPF)
|
||||
@@ -258,7 +259,7 @@ public final class TJ {
|
||||
*
|
||||
* @param pixelFormat the pixel format (one of <code>PF_*</code>)
|
||||
*
|
||||
* @return the green offset for the given pixel format
|
||||
* @return the green offset for the given pixel format.
|
||||
*/
|
||||
public static int getGreenOffset(int pixelFormat) throws Exception {
|
||||
if (pixelFormat < 0 || pixelFormat >= NUMPF)
|
||||
@@ -280,7 +281,7 @@ public final class TJ {
|
||||
*
|
||||
* @param pixelFormat the pixel format (one of <code>PF_*</code>)
|
||||
*
|
||||
* @return the blue offset for the given pixel format
|
||||
* @return the blue offset for the given pixel format.
|
||||
*/
|
||||
public static int getBlueOffset(int pixelFormat) throws Exception {
|
||||
if (pixelFormat < 0 || pixelFormat >= NUMPF)
|
||||
@@ -404,7 +405,7 @@ public final class TJ {
|
||||
* generating the JPEG image (one of {@link TJ TJ.SAMP_*})
|
||||
*
|
||||
* @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
|
||||
* image with the given width, height, and level of chrominance subsampling.
|
||||
*/
|
||||
public static native int bufSize(int width, int height, int jpegSubsamp)
|
||||
throws Exception;
|
||||
@@ -416,8 +417,7 @@ public final class TJ {
|
||||
* @param width the width (in pixels) of the YUV image
|
||||
*
|
||||
* @param pad 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.)
|
||||
* the nearest multiple of this number of bytes (must be a power of 2.)
|
||||
*
|
||||
* @param height the height (in pixels) of the YUV image
|
||||
*
|
||||
@@ -425,7 +425,7 @@ public final class TJ {
|
||||
* image (one of {@link TJ TJ.SAMP_*})
|
||||
*
|
||||
* @return the size of the buffer (in bytes) required to hold a YUV planar
|
||||
* image with the given width, height, and level of chrominance subsampling
|
||||
* image with the given width, height, and level of chrominance subsampling.
|
||||
*/
|
||||
public static native int bufSizeYUV(int width, int pad, int height,
|
||||
int subsamp)
|
||||
@@ -438,12 +438,72 @@ public final class TJ {
|
||||
public static native int bufSizeYUV(int width, int height, int subsamp)
|
||||
throws Exception;
|
||||
|
||||
/**
|
||||
* Returns the size of the buffer (in bytes) required to hold a YUV image
|
||||
* plane with the given parameters.
|
||||
*
|
||||
* @param componentID ID number of the image plane (0 = Y, 1 = U/Cb,
|
||||
* 2 = V/Cr)
|
||||
*
|
||||
* @param width width (in pixels) of the YUV image. NOTE: this is the width
|
||||
* of the whole image, not the plane width.
|
||||
*
|
||||
* @param stride bytes per line in the image plane.
|
||||
*
|
||||
* @param height height (in pixels) of the YUV image. NOTE: this is the
|
||||
* height of the whole image, not the plane height.
|
||||
*
|
||||
* @param subsamp the level of chrominance subsampling used in the YUV
|
||||
* image (one of {@link TJ TJ.SAMP_*})
|
||||
*
|
||||
* @return the size of the buffer (in bytes) required to hold a YUV planar
|
||||
* image with the given parameters.
|
||||
*/
|
||||
public static native int planeSizeYUV(int componentID, int width, int stride,
|
||||
int height, int subsamp)
|
||||
throws Exception;
|
||||
|
||||
/**
|
||||
* Returns the plane width of a YUV image plane with the given parameters.
|
||||
* Refer to {@link YUVImage YUVImage} for a description of plane width.
|
||||
*
|
||||
* @param componentID ID number of the image plane (0 = Y, 1 = U/Cb,
|
||||
* 2 = V/Cr)
|
||||
*
|
||||
* @param width width (in pixels) of the YUV image
|
||||
*
|
||||
* @param subsamp the level of chrominance subsampling used in the YUV image
|
||||
* (one of {@link TJ TJ.SAMP_*})
|
||||
*
|
||||
* @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;
|
||||
|
||||
/**
|
||||
* Returns the plane height of a YUV image plane with the given parameters.
|
||||
* Refer to {@link YUVImage YUVImage} for a description of plane height.
|
||||
*
|
||||
* @param componentID ID number of the image plane (0 = Y, 1 = U/Cb,
|
||||
* 2 = V/Cr)
|
||||
*
|
||||
* @param height height (in pixels) of the YUV image
|
||||
*
|
||||
* @param subsamp the level of chrominance subsampling used in the YUV image
|
||||
* (one of {@link TJ TJ.SAMP_*})
|
||||
*
|
||||
* @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;
|
||||
|
||||
/**
|
||||
* Returns a list of fractional scaling factors that the JPEG decompressor in
|
||||
* this implementation of TurboJPEG supports.
|
||||
*
|
||||
* @return a list of fractional scaling factors that the JPEG decompressor in
|
||||
* this implementation of TurboJPEG supports
|
||||
* this implementation of TurboJPEG supports.
|
||||
*/
|
||||
public static native TJScalingFactor[] getScalingFactors()
|
||||
throws Exception;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C)2011-2013 D. R. Commander. All Rights Reserved.
|
||||
* Copyright (C)2011-2014 D. R. Commander. All Rights Reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
@@ -48,28 +48,7 @@ public class TJCompressor {
|
||||
|
||||
/**
|
||||
* Create a TurboJPEG compressor instance and associate the uncompressed
|
||||
* source image stored in <code>srcImage</code> with the newly-created
|
||||
* instance.
|
||||
*
|
||||
* @param srcImage see {@link #setSourceImage} for description
|
||||
*
|
||||
* @param width see {@link #setSourceImage} for description
|
||||
*
|
||||
* @param pitch see {@link #setSourceImage} for description
|
||||
*
|
||||
* @param height see {@link #setSourceImage} for description
|
||||
*
|
||||
* @param pixelFormat pixel format of the source image (one of
|
||||
* {@link TJ TJ.PF_*})
|
||||
*/
|
||||
public TJCompressor(byte[] srcImage, int width, int pitch, int height,
|
||||
int pixelFormat) throws Exception {
|
||||
setSourceImage(srcImage, width, pitch, height, pixelFormat);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a TurboJPEG compressor instance and associate the uncompressed
|
||||
* source image stored in <code>srcImage</code> with the newly-created
|
||||
* source image stored in <code>srcImage</code> with the newly created
|
||||
* instance.
|
||||
*
|
||||
* @param srcImage see {@link #setSourceImage} for description
|
||||
@@ -85,7 +64,7 @@ public class TJCompressor {
|
||||
* @param height see {@link #setSourceImage} for description
|
||||
*
|
||||
* @param pixelFormat pixel format of the source image (one of
|
||||
* {@link TJ TJ.PF_*})
|
||||
* {@link TJ#PF_RGB TJ.PF_*})
|
||||
*/
|
||||
public TJCompressor(byte[] srcImage, int x, int y, int width, int pitch,
|
||||
int height, int pixelFormat) throws Exception {
|
||||
@@ -93,34 +72,70 @@ public class TJCompressor {
|
||||
}
|
||||
|
||||
/**
|
||||
* Associate an uncompressed source image with this compressor instance.
|
||||
* @deprecated Use
|
||||
* {@link #TJCompressor(byte[], int, int, int, int, int, int)} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public TJCompressor(byte[] srcImage, int width, int pitch, int height,
|
||||
int pixelFormat) throws Exception {
|
||||
setSourceImage(srcImage, width, pitch, height, pixelFormat);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a TurboJPEG compressor instance and associate the uncompressed
|
||||
* source image stored in <code>srcImage</code> with the newly created
|
||||
* instance.
|
||||
*
|
||||
* @param srcImage see
|
||||
* {@link #setSourceImage(BufferedImage, int, int, int, int)} for description
|
||||
*
|
||||
* @param x see
|
||||
* {@link #setSourceImage(BufferedImage, int, int, int, int)} for description
|
||||
*
|
||||
* @param y see
|
||||
* {@link #setSourceImage(BufferedImage, int, int, int, int)} for description
|
||||
*
|
||||
* @param width see
|
||||
* {@link #setSourceImage(BufferedImage, int, int, int, int)} for description
|
||||
*
|
||||
* @param height see
|
||||
* {@link #setSourceImage(BufferedImage, int, int, int, int)} for description
|
||||
*/
|
||||
public TJCompressor(BufferedImage srcImage, int x, int y, int width,
|
||||
int height) throws Exception {
|
||||
setSourceImage(srcImage, x, y, width, height);
|
||||
}
|
||||
|
||||
/**
|
||||
* Associate an uncompressed RGB, grayscale, or CMYK source image with this
|
||||
* compressor instance.
|
||||
*
|
||||
* @param srcImage image buffer containing RGB, grayscale, or CMYK pixels to
|
||||
* be compressed
|
||||
* be compressed or encoded
|
||||
*
|
||||
* @param x x offset (in pixels) of the region from which the JPEG image
|
||||
* should be compressed, relative to the start of <code>srcImage</code>.
|
||||
* @param x x offset (in pixels) of the region in the source image from which
|
||||
* the JPEG or YUV image should be compressed/encoded
|
||||
*
|
||||
* @param y y offset (in pixels) of the region from which the JPEG image
|
||||
* should be compressed, relative to the start of <code>srcImage</code>.
|
||||
* @param y y offset (in pixels) of the region in the source image from which
|
||||
* the JPEG or YUV image should be compressed/encoded
|
||||
*
|
||||
* @param width width (in pixels) of the region in the source image from
|
||||
* which the JPEG image should be compressed.
|
||||
* which the JPEG or YUV image should be compressed/encoded
|
||||
*
|
||||
* @param pitch bytes per line of the source image. Normally, this should be
|
||||
* <code>width * TJ.pixelSize(pixelFormat)</code> if the source image is
|
||||
* unpadded, but you can use this parameter to, for instance, specify that
|
||||
* the scanlines in the source image are padded to a 4-byte boundary or to
|
||||
* compress a JPEG image from a region of a larger source image. You can
|
||||
* also be clever and use this parameter to skip lines, etc. Setting this
|
||||
* parameter to 0 is the equivalent of setting it to <code>width *
|
||||
* TJ.pixelSize(pixelFormat)</code>.
|
||||
* compress/encode a JPEG or YUV image from a region of a larger source
|
||||
* image. You can also be clever and use this parameter to skip lines, etc.
|
||||
* Setting this parameter to 0 is the equivalent of setting it to
|
||||
* <code>width * TJ.pixelSize(pixelFormat)</code>.
|
||||
*
|
||||
* @param height height (in pixels) of the region in the source image from
|
||||
* which the JPEG image should be compressed.
|
||||
* which the JPEG or YUV image should be compressed/encoded
|
||||
*
|
||||
* @param pixelFormat pixel format of the source image (one of
|
||||
* {@link TJ TJ.PF_*})
|
||||
* {@link TJ#PF_RGB TJ.PF_*})
|
||||
*/
|
||||
public void setSourceImage(byte[] srcImage, int x, int y, int width,
|
||||
int pitch, int height, int pixelFormat)
|
||||
@@ -139,7 +154,8 @@ public class TJCompressor {
|
||||
srcPixelFormat = pixelFormat;
|
||||
srcX = x;
|
||||
srcY = y;
|
||||
srcIsYUV = false;
|
||||
srcBufInt = null;
|
||||
srcYUVImage = null;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -154,147 +170,38 @@ public class TJCompressor {
|
||||
}
|
||||
|
||||
/**
|
||||
* Associate an uncompressed YUV planar source image with this compressor
|
||||
* instance.
|
||||
*
|
||||
* @param srcImage image buffer containing a YUV planar image to be
|
||||
* compressed. The Y, U (Cb), and V (Cr) image planes should be stored
|
||||
* sequentially in the buffer, and the size of each plane is determined by
|
||||
* the specified width, height, and padding, as well as the level of
|
||||
* chrominance subsampling (specified using {@link #setSubsamp}.) If the
|
||||
* chrominance components are subsampled along the horizontal dimension, then
|
||||
* the width of the luminance plane should be padded to the nearest multiple
|
||||
* of 2 (same goes for the height of the luminance plane, if the chrominance
|
||||
* components are subsampled along the vertical dimension.) This is
|
||||
* irrespective of any additional padding specified in the <code>pad</code>
|
||||
* parameter.
|
||||
*
|
||||
* @param width width (in pixels) of the source image
|
||||
*
|
||||
* @param pad the line padding used in the source image. For instance, if
|
||||
* each line in each plane of the YUV image is padded to the nearest multiple
|
||||
* of 4 bytes, then <code>pad</code> should be set to 4.
|
||||
*
|
||||
* @param height height (in pixels) of the source image
|
||||
*/
|
||||
public void setSourceImageYUV(byte[] srcImage, int width, int pad,
|
||||
int height) throws Exception {
|
||||
if (handle == 0) init();
|
||||
if (srcImage == null || width < 1 || pad < 1 || height < 1)
|
||||
throw new Exception("Invalid argument in setSourceImageYUV()");
|
||||
srcBuf = srcImage;
|
||||
srcWidth = width;
|
||||
srcYUVPad = pad;
|
||||
srcHeight = height;
|
||||
srcIsYUV = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the level of chrominance subsampling for subsequent compress/encode
|
||||
* operations. When pixels are converted from RGB to YCbCr (see
|
||||
* {@link TJ#CS_YCbCr}) or from CMYK to YCCK (see {@link TJ#CS_YCCK}) as part
|
||||
* of the JPEG compression process, some of the Cb and Cr (chrominance)
|
||||
* components can be discarded or averaged together to produce a smaller
|
||||
* image with little perceptible loss of image clarity (the human eye is more
|
||||
* sensitive to small changes in brightness than to small changes in color.)
|
||||
* This is called "chrominance subsampling".
|
||||
* <p>
|
||||
* NOTE: When compressing a YUV planar image into a JPEG image, this method
|
||||
* also specifies the level of chrominance subsampling used in the source
|
||||
* image.
|
||||
*
|
||||
* @param newSubsamp the new level of chrominance subsampling (one of
|
||||
* {@link TJ TJ.SAMP_*})
|
||||
*/
|
||||
public void setSubsamp(int newSubsamp) throws Exception {
|
||||
if (newSubsamp < 0 || newSubsamp >= TJ.NUMSAMP)
|
||||
throw new Exception("Invalid argument in setSubsamp()");
|
||||
subsamp = newSubsamp;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the JPEG image quality level for subsequent compress operations.
|
||||
*
|
||||
* @param quality the new JPEG image quality level (1 to 100, 1 = worst,
|
||||
* 100 = best)
|
||||
*/
|
||||
public void setJPEGQuality(int quality) throws Exception {
|
||||
if (quality < 1 || quality > 100)
|
||||
throw new Exception("Invalid argument in setJPEGQuality()");
|
||||
jpegQuality = quality;
|
||||
}
|
||||
|
||||
/**
|
||||
* Compress the uncompressed source image associated with this compressor
|
||||
* instance and output a JPEG image to the given destination buffer.
|
||||
*
|
||||
* @param dstBuf buffer that will receive the JPEG image. Use
|
||||
* {@link TJ#bufSize} to determine the maximum size for this buffer based on
|
||||
* the image width, height, and level of chrominance subsampling.
|
||||
*
|
||||
* @param flags the bitwise OR of one or more of {@link TJ TJ.FLAG_*}
|
||||
*/
|
||||
public void compress(byte[] dstBuf, int flags) throws Exception {
|
||||
if (dstBuf == null || flags < 0)
|
||||
throw new Exception("Invalid argument in compress()");
|
||||
if (srcBuf == null)
|
||||
throw new Exception(NO_ASSOC_ERROR);
|
||||
if (jpegQuality < 0)
|
||||
throw new Exception("JPEG Quality not set");
|
||||
if (subsamp < 0)
|
||||
throw new Exception("Subsampling level not set");
|
||||
if (srcIsYUV)
|
||||
compressedSize = compressFromYUV(srcBuf, srcWidth, srcYUVPad, srcHeight,
|
||||
subsamp, dstBuf, jpegQuality, flags);
|
||||
else {
|
||||
if (srcX >= 0 && srcY >= 0)
|
||||
compressedSize = compress(srcBuf, srcX, srcY, srcWidth, srcPitch,
|
||||
srcHeight, srcPixelFormat, dstBuf, subsamp,
|
||||
jpegQuality, flags);
|
||||
else
|
||||
compressedSize = compress(srcBuf, srcWidth, srcPitch, srcHeight,
|
||||
srcPixelFormat, dstBuf, subsamp, jpegQuality,
|
||||
flags);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Compress the uncompressed source image associated with this compressor
|
||||
* instance and return a buffer containing a JPEG image.
|
||||
*
|
||||
* @param flags the bitwise OR of one or more of {@link TJ TJ.FLAG_*}
|
||||
*
|
||||
* @return a buffer containing a JPEG image. The length of this buffer will
|
||||
* not be equal to the size of the JPEG image. Use {@link
|
||||
* #getCompressedSize} to obtain the size of the JPEG image.
|
||||
*/
|
||||
public byte[] compress(int flags) throws Exception {
|
||||
if (srcWidth < 1 || srcHeight < 1)
|
||||
throw new Exception(NO_ASSOC_ERROR);
|
||||
byte[] buf = new byte[TJ.bufSize(srcWidth, srcHeight, subsamp)];
|
||||
compress(buf, flags);
|
||||
return buf;
|
||||
}
|
||||
|
||||
/**
|
||||
* Compress the uncompressed source image stored in <code>srcImage</code>
|
||||
* and output a JPEG image to the given destination buffer.
|
||||
* Associate an uncompressed RGB or grayscale source image with this
|
||||
* compressor instance.
|
||||
*
|
||||
* @param srcImage a <code>BufferedImage</code> instance containing RGB or
|
||||
* grayscale pixels to be compressed
|
||||
* grayscale pixels to be compressed or encoded
|
||||
*
|
||||
* @param dstBuf buffer that will receive the JPEG image. Use
|
||||
* {@link TJ#bufSize} to determine the maximum size for this buffer based on
|
||||
* the image width, height, and level of chrominance subsampling.
|
||||
* @param x x offset (in pixels) of the region in the source image from which
|
||||
* the JPEG or YUV image should be compressed/encoded
|
||||
*
|
||||
* @param flags the bitwise OR of one or more of {@link TJ TJ.FLAG_*}
|
||||
* @param y y offset (in pixels) of the region in the source image from which
|
||||
* the JPEG or YUV image should be compressed/encoded
|
||||
*
|
||||
* @param width width (in pixels) of the region in the source image from
|
||||
* which the JPEG or YUV image should be compressed/encoded (0 = use the
|
||||
* width of the source image)
|
||||
*
|
||||
* @param height height (in pixels) of the region in the source image from
|
||||
* which the JPEG or YUV image should be compressed/encoded (0 = use the
|
||||
* height of the source image)
|
||||
*/
|
||||
public void compress(BufferedImage srcImage, byte[] dstBuf, int flags)
|
||||
throws Exception {
|
||||
if (srcImage == null || dstBuf == null || flags < 0)
|
||||
throw new Exception("Invalid argument in compress()");
|
||||
int width = srcImage.getWidth();
|
||||
int height = srcImage.getHeight();
|
||||
public void setSourceImage(BufferedImage srcImage, int x, int y, int width,
|
||||
int height) throws Exception {
|
||||
if (handle == 0) init();
|
||||
if (srcImage == null || x < 0 || y < 0 || width < 0 || height < 0)
|
||||
throw new Exception("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");
|
||||
|
||||
int pixelFormat;
|
||||
boolean intPixels = false;
|
||||
if (byteOrder == null)
|
||||
@@ -324,235 +231,333 @@ public class TJCompressor {
|
||||
default:
|
||||
throw new Exception("Unsupported BufferedImage format");
|
||||
}
|
||||
srcPixelFormat = pixelFormat;
|
||||
|
||||
WritableRaster wr = srcImage.getRaster();
|
||||
if (jpegQuality < 0)
|
||||
throw new Exception("JPEG Quality not set");
|
||||
if (subsamp < 0)
|
||||
throw new Exception("Subsampling level not set");
|
||||
if (intPixels) {
|
||||
SinglePixelPackedSampleModel sm =
|
||||
(SinglePixelPackedSampleModel)srcImage.getSampleModel();
|
||||
int stride = sm.getScanlineStride();
|
||||
srcStride = sm.getScanlineStride();
|
||||
DataBufferInt db = (DataBufferInt)wr.getDataBuffer();
|
||||
int[] buf = db.getData();
|
||||
if (srcX >= 0 && srcY >= 0)
|
||||
compressedSize = compress(buf, srcX, srcY, width, stride, height,
|
||||
pixelFormat, dstBuf, subsamp, jpegQuality,
|
||||
flags);
|
||||
else
|
||||
compressedSize = compress(buf, width, stride, height, pixelFormat,
|
||||
dstBuf, subsamp, jpegQuality, flags);
|
||||
srcBufInt = db.getData();
|
||||
srcBuf = null;
|
||||
} else {
|
||||
ComponentSampleModel sm =
|
||||
(ComponentSampleModel)srcImage.getSampleModel();
|
||||
int pixelSize = sm.getPixelStride();
|
||||
if (pixelSize != TJ.getPixelSize(pixelFormat))
|
||||
throw new Exception("Inconsistency between pixel format and pixel size in BufferedImage");
|
||||
int pitch = sm.getScanlineStride();
|
||||
srcPitch = sm.getScanlineStride();
|
||||
DataBufferByte db = (DataBufferByte)wr.getDataBuffer();
|
||||
byte[] buf = db.getData();
|
||||
srcBuf = db.getData();
|
||||
srcBufInt = null;
|
||||
}
|
||||
srcYUVImage = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Associate an uncompressed YUV planar source image with this compressor
|
||||
* instance.
|
||||
*
|
||||
* @param srcImage YUV planar image to be compressed
|
||||
*/
|
||||
public void setSourceImage(YUVImage srcImage) throws Exception {
|
||||
if (handle == 0) init();
|
||||
if (srcImage == null)
|
||||
throw new Exception("Invalid argument in setSourceImage()");
|
||||
srcYUVImage = srcImage;
|
||||
srcBuf = null;
|
||||
srcBufInt = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the level of chrominance subsampling for subsequent compress/encode
|
||||
* operations. When pixels are converted from RGB to YCbCr (see
|
||||
* {@link TJ#CS_YCbCr}) or from CMYK to YCCK (see {@link TJ#CS_YCCK}) as part
|
||||
* of the JPEG compression process, some of the Cb and Cr (chrominance)
|
||||
* components can be discarded or averaged together to produce a smaller
|
||||
* image with little perceptible loss of image clarity (the human eye is more
|
||||
* sensitive to small changes in brightness than to small changes in color.)
|
||||
* This is called "chrominance subsampling".
|
||||
* <p>
|
||||
* NOTE: This method has no effect when compressing a JPEG image from a YUV
|
||||
* planar source. In that case, the level of chrominance subsampling in
|
||||
* the JPEG image is determined by the source. Further, this method has no
|
||||
* effect when encoding to a pre-allocated {@link YUVImage} instance. In
|
||||
* that case, the level of chrominance subsampling is determined by the
|
||||
* destination.
|
||||
*
|
||||
* @param newSubsamp the level of chrominance subsampling to use in
|
||||
* subsequent compress/encode oeprations (one of
|
||||
* {@link TJ#SAMP_444 TJ.SAMP_*})
|
||||
*/
|
||||
public void setSubsamp(int newSubsamp) throws Exception {
|
||||
if (newSubsamp < 0 || newSubsamp >= TJ.NUMSAMP)
|
||||
throw new Exception("Invalid argument in setSubsamp()");
|
||||
subsamp = newSubsamp;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the JPEG image quality level for subsequent compress operations.
|
||||
*
|
||||
* @param quality the new JPEG image quality level (1 to 100, 1 = worst,
|
||||
* 100 = best)
|
||||
*/
|
||||
public void setJPEGQuality(int quality) throws Exception {
|
||||
if (quality < 1 || quality > 100)
|
||||
throw new Exception("Invalid argument in setJPEGQuality()");
|
||||
jpegQuality = quality;
|
||||
}
|
||||
|
||||
/**
|
||||
* Compress the uncompressed source image associated with this compressor
|
||||
* instance and output a JPEG image to the given destination buffer.
|
||||
*
|
||||
* @param dstBuf buffer that will receive the JPEG image. Use
|
||||
* {@link TJ#bufSize} to determine the maximum size for this buffer based on
|
||||
* the source image's width and height and the desired level of chrominance
|
||||
* subsampling.
|
||||
*
|
||||
* @param flags the bitwise OR of one or more of
|
||||
* {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*}
|
||||
*/
|
||||
public void compress(byte[] dstBuf, int flags) throws Exception {
|
||||
if (dstBuf == null || flags < 0)
|
||||
throw new Exception("Invalid argument in compress()");
|
||||
if (srcBuf == null && srcBufInt == null && srcYUVImage == null)
|
||||
throw new Exception(NO_ASSOC_ERROR);
|
||||
if (jpegQuality < 0)
|
||||
throw new Exception("JPEG Quality not set");
|
||||
if (subsamp < 0 && srcYUVImage == null)
|
||||
throw new Exception("Subsampling level not set");
|
||||
|
||||
if (srcYUVImage != null)
|
||||
compressedSize = compressFromYUV(srcYUVImage.getPlanes(),
|
||||
srcYUVImage.getOffsets(),
|
||||
srcYUVImage.getWidth(),
|
||||
srcYUVImage.getStrides(),
|
||||
srcYUVImage.getHeight(),
|
||||
srcYUVImage.getSubsamp(),
|
||||
dstBuf, jpegQuality, flags);
|
||||
else if (srcBuf != null) {
|
||||
if (srcX >= 0 && srcY >= 0)
|
||||
compressedSize = compress(buf, srcX, srcY, width, pitch, height,
|
||||
pixelFormat, dstBuf, subsamp, jpegQuality,
|
||||
flags);
|
||||
compressedSize = compress(srcBuf, srcX, srcY, srcWidth, srcPitch,
|
||||
srcHeight, srcPixelFormat, dstBuf, subsamp,
|
||||
jpegQuality, flags);
|
||||
else
|
||||
compressedSize = compress(buf, width, pitch, height, pixelFormat,
|
||||
dstBuf, subsamp, jpegQuality, flags);
|
||||
compressedSize = compress(srcBuf, srcWidth, srcPitch, srcHeight,
|
||||
srcPixelFormat, dstBuf, subsamp, jpegQuality,
|
||||
flags);
|
||||
} else if (srcBufInt != null) {
|
||||
if (srcX >= 0 && srcY >= 0)
|
||||
compressedSize = compress(srcBufInt, srcX, srcY, srcWidth, srcStride,
|
||||
srcHeight, srcPixelFormat, dstBuf, subsamp,
|
||||
jpegQuality, flags);
|
||||
else
|
||||
compressedSize = compress(srcBufInt, srcWidth, srcStride, srcHeight,
|
||||
srcPixelFormat, dstBuf, subsamp, jpegQuality,
|
||||
flags);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Compress the uncompressed source image stored in <code>srcImage</code>
|
||||
* and return a buffer containing a JPEG image.
|
||||
* Compress the uncompressed source image associated with this compressor
|
||||
* instance and return a buffer containing a JPEG image.
|
||||
*
|
||||
* @param srcImage a <code>BufferedImage</code> instance containing RGB or
|
||||
* grayscale pixels to be compressed
|
||||
*
|
||||
* @param flags the bitwise OR of one or more of {@link TJ TJ.FLAG_*}
|
||||
* @param flags the bitwise OR of one or more of
|
||||
* {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*}
|
||||
*
|
||||
* @return a buffer containing a JPEG image. The length of this buffer will
|
||||
* not be equal to the size of the JPEG image. Use {@link
|
||||
* #getCompressedSize} to obtain the size of the JPEG image.
|
||||
*/
|
||||
public byte[] compress(BufferedImage srcImage, int flags) throws Exception {
|
||||
int width = srcImage.getWidth();
|
||||
int height = srcImage.getHeight();
|
||||
byte[] buf = new byte[TJ.bufSize(width, height, subsamp)];
|
||||
compress(srcImage, buf, flags);
|
||||
public byte[] compress(int flags) throws Exception {
|
||||
if (srcWidth < 1 || srcHeight < 1)
|
||||
throw new Exception(NO_ASSOC_ERROR);
|
||||
byte[] buf = new byte[TJ.bufSize(srcWidth, srcHeight, subsamp)];
|
||||
compress(buf, flags);
|
||||
return buf;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use
|
||||
* {@link #setSourceImage(BufferedImage, int, int, int, int)} and
|
||||
* {@link #compress(byte[], int)} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public void compress(BufferedImage srcImage, byte[] dstBuf, int flags)
|
||||
throws Exception {
|
||||
setSourceImage(srcImage, 0, 0, 0, 0);
|
||||
compress(dstBuf, flags);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the plane padding for subsequent YUV encode operations.
|
||||
*
|
||||
* @param pad the width of each line in each plane of the YUV image will be
|
||||
* padded to the nearest multiple of this number of bytes (must be a
|
||||
* power of 2.) The default padding is 4 bytes, which generates
|
||||
* images suitable for direct video display.
|
||||
* @deprecated Use
|
||||
* {@link #setSourceImage(BufferedImage, int, int, int, int)} and
|
||||
* {@link #compress(int)} instead.
|
||||
*/
|
||||
public void setYUVPad(int pad) throws Exception {
|
||||
if(pad < 1 || ((pad & (pad - 1)) != 0))
|
||||
throw new Exception("Invalid argument in setYUVPad()");
|
||||
yuvPad = pad;
|
||||
@Deprecated
|
||||
public byte[] compress(BufferedImage srcImage, int flags) throws Exception {
|
||||
setSourceImage(srcImage, 0, 0, 0, 0);
|
||||
return compress(flags);
|
||||
}
|
||||
|
||||
/**
|
||||
* Encode the uncompressed source image associated with this compressor
|
||||
* instance and output a YUV planar image to the given destination buffer.
|
||||
* This method uses the accelerated color conversion routines in TurboJPEG's
|
||||
* underlying codec but does not execute any of the other steps in the JPEG
|
||||
* compression process. The Y, U (Cb), and V (Cr) image planes are stored
|
||||
* sequentially into the destination buffer, and the size of each plane is
|
||||
* determined by the width and height of the source image, as well as the
|
||||
* specified padding and level of chrominance subsampling. If the
|
||||
* chrominance components are subsampled along the horizontal dimension, then
|
||||
* the width of the luminance plane is padded to the nearest multiple of 2 in
|
||||
* the output image (same goes for the height of the luminance plane, if the
|
||||
* chrominance components are subsampled along the vertical dimension.)
|
||||
* <p>
|
||||
* NOTE: Technically, the JPEG format uses the YCbCr colorspace, but per the
|
||||
* convention of the digital video community, the TurboJPEG API uses "YUV" to
|
||||
* refer to an image format consisting of Y, Cb, and Cr image planes.
|
||||
* instance into a YUV planar image and store it in the given
|
||||
* <code>YUVImage</code> instance. This method uses the accelerated color
|
||||
* conversion routines in TurboJPEG's underlying codec but does not execute
|
||||
* any of the other steps in the JPEG compression process. Encoding
|
||||
* CMYK source images to YUV is not supported.
|
||||
*
|
||||
* @param dstBuf buffer that will receive the YUV planar image. Use
|
||||
* {@link TJ#bufSizeYUV} to determine the appropriate size for this buffer
|
||||
* based on the image width, height, and level of chrominance subsampling.
|
||||
* @param dstImage {@link YUVImage} instance that will receive the YUV planar
|
||||
* image
|
||||
*
|
||||
* @param flags the bitwise OR of one or more of {@link TJ TJ.FLAG_*}
|
||||
* @param flags the bitwise OR of one or more of
|
||||
* {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*}
|
||||
*/
|
||||
public void encodeYUV(YUVImage dstImage, int flags) throws Exception {
|
||||
if (dstImage == null || flags < 0)
|
||||
throw new Exception("Invalid argument in encodeYUV()");
|
||||
if (srcBuf == null && srcBufInt == null)
|
||||
throw new Exception(NO_ASSOC_ERROR);
|
||||
if (srcYUVImage != null)
|
||||
throw new Exception("Source image is not correct type");
|
||||
if (subsamp < 0)
|
||||
throw new Exception("Subsampling level not set");
|
||||
if (srcWidth != dstImage.getWidth() || srcHeight != dstImage.getHeight())
|
||||
throw new Exception("Destination image is the wrong size");
|
||||
|
||||
if (srcBufInt != null) {
|
||||
encodeYUV(srcBufInt, srcX, srcY, srcWidth, srcStride, srcHeight,
|
||||
srcPixelFormat, dstImage.getPlanes(), dstImage.getOffsets(),
|
||||
dstImage.getStrides(), dstImage.getSubsamp(), flags);
|
||||
} else {
|
||||
encodeYUV(srcBuf, srcX, srcY, srcWidth, srcPitch, srcHeight,
|
||||
srcPixelFormat, dstImage.getPlanes(), dstImage.getOffsets(),
|
||||
dstImage.getStrides(), dstImage.getSubsamp(), flags);
|
||||
}
|
||||
compressedSize = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link #encodeYUV(YUVImage, int)} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public void encodeYUV(byte[] dstBuf, int flags) throws Exception {
|
||||
if (dstBuf == null || flags < 0)
|
||||
throw new Exception("Invalid argument in compress()");
|
||||
if (srcBuf == null)
|
||||
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");
|
||||
encodeYUV(srcBuf, srcWidth, srcPitch, srcHeight, srcPixelFormat, dstBuf,
|
||||
yuvPad, subsamp, flags);
|
||||
compressedSize = TJ.bufSizeYUV(srcWidth, yuvPad, srcHeight, subsamp);
|
||||
YUVImage yuvImage = new YUVImage(dstBuf, srcWidth, 4, srcHeight, subsamp);
|
||||
encodeYUV(yuvImage, flags);
|
||||
}
|
||||
|
||||
/**
|
||||
* Encode the uncompressed source image associated with this compressor
|
||||
* instance and return a buffer containing a YUV planar image. See
|
||||
* {@link #encodeYUV(byte[], int)} for more detail.
|
||||
* instance into a unified YUV planar image buffer and return a
|
||||
* <code>YUVImage</code> instance containing the encoded image. This method
|
||||
* uses the accelerated color conversion routines in TurboJPEG's underlying
|
||||
* codec but does not execute any of the other steps in the JPEG compression
|
||||
* process. Encoding CMYK source images to YUV is not supported.
|
||||
*
|
||||
* @param flags the bitwise OR of one or more of {@link TJ TJ.FLAG_*}
|
||||
* @param pad the width of each line in each plane of the YUV image will be
|
||||
* padded to the nearest multiple of this number of bytes (must be a power of
|
||||
* 2.)
|
||||
*
|
||||
* @return a buffer containing a YUV planar image
|
||||
* @param flags the bitwise OR of one or more of
|
||||
* {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*}
|
||||
*
|
||||
* @return a YUV planar image.
|
||||
*/
|
||||
public YUVImage encodeYUV(int pad, int flags) throws Exception {
|
||||
if (srcWidth < 1 || srcHeight < 1)
|
||||
throw new Exception(NO_ASSOC_ERROR);
|
||||
if (subsamp < 0)
|
||||
throw new Exception("Subsampling level not set");
|
||||
if(pad < 1 || ((pad & (pad - 1)) != 0))
|
||||
throw new Exception("Invalid argument in encodeYUV()");
|
||||
YUVImage yuvImage = new YUVImage(srcWidth, pad, srcHeight, subsamp);
|
||||
encodeYUV(yuvImage, flags);
|
||||
return yuvImage;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
* method uses the accelerated color conversion routines in TurboJPEG's
|
||||
* underlying codec but does not execute any of the other steps in the JPEG
|
||||
* compression process. Encoding CMYK source images to YUV is not supported.
|
||||
*
|
||||
* @param strides an array of integers, each specifying the number of bytes
|
||||
* per line in the corresponding plane of the output image. Setting the
|
||||
* stride for any plane to 0 is the same as setting it to the component width
|
||||
* of the plane. If <code>strides</code> is null, then the strides for all
|
||||
* planes will be set to their respective component widths. You can adjust
|
||||
* the strides in order to add an arbitrary amount of line padding to each
|
||||
* plane.
|
||||
*
|
||||
* @param flags the bitwise OR of one or more of
|
||||
* {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*}
|
||||
*
|
||||
* @return a YUV planar image.
|
||||
*/
|
||||
public YUVImage encodeYUV(int[] 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");
|
||||
YUVImage yuvImage = new YUVImage(srcWidth, strides, srcHeight, subsamp);
|
||||
encodeYUV(yuvImage, flags);
|
||||
return yuvImage;
|
||||
}
|
||||
|
||||
/**
|
||||
* @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");
|
||||
byte[] buf = new byte[TJ.bufSizeYUV(srcWidth, yuvPad, srcHeight, subsamp)];
|
||||
encodeYUV(buf, flags);
|
||||
return buf;
|
||||
YUVImage yuvImage = new YUVImage(srcWidth, 4, srcHeight, subsamp);
|
||||
encodeYUV(yuvImage, flags);
|
||||
return yuvImage.getBuf();
|
||||
}
|
||||
|
||||
/**
|
||||
* Encode the uncompressed source image stored in <code>srcImage</code>
|
||||
* and output a YUV planar image to the given destination buffer. See
|
||||
* {@link #encodeYUV(byte[], int)} for more detail.
|
||||
*
|
||||
* @param srcImage a <code>BufferedImage</code> instance containing RGB or
|
||||
* grayscale pixels to be encoded
|
||||
*
|
||||
* @param dstBuf buffer that will receive the YUV planar image. Use
|
||||
* {@link TJ#bufSizeYUV} to determine the appropriate size for this buffer
|
||||
* based on the image width, height, and level of chrominance subsampling.
|
||||
*
|
||||
* @param flags the bitwise OR of one or more of {@link TJ TJ.FLAG_*}
|
||||
* @deprecated Use
|
||||
* {@link #setSourceImage(BufferedImage, int, int, int, int)} and
|
||||
* {@link #encodeYUV(byte[], int)} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public void encodeYUV(BufferedImage srcImage, byte[] dstBuf, int flags)
|
||||
throws Exception {
|
||||
if (srcImage == null || dstBuf == null || flags < 0)
|
||||
throw new Exception("Invalid argument in encodeYUV()");
|
||||
int width = srcImage.getWidth();
|
||||
int height = srcImage.getHeight();
|
||||
int pixelFormat; boolean intPixels = false;
|
||||
if (byteOrder == null)
|
||||
byteOrder = ByteOrder.nativeOrder();
|
||||
switch(srcImage.getType()) {
|
||||
case BufferedImage.TYPE_3BYTE_BGR:
|
||||
pixelFormat = TJ.PF_BGR; break;
|
||||
case BufferedImage.TYPE_4BYTE_ABGR:
|
||||
case BufferedImage.TYPE_4BYTE_ABGR_PRE:
|
||||
pixelFormat = TJ.PF_XBGR; break;
|
||||
case BufferedImage.TYPE_BYTE_GRAY:
|
||||
pixelFormat = TJ.PF_GRAY; break;
|
||||
case BufferedImage.TYPE_INT_BGR:
|
||||
if (byteOrder == ByteOrder.BIG_ENDIAN)
|
||||
pixelFormat = TJ.PF_XBGR;
|
||||
else
|
||||
pixelFormat = TJ.PF_RGBX;
|
||||
intPixels = true; break;
|
||||
case BufferedImage.TYPE_INT_RGB:
|
||||
case BufferedImage.TYPE_INT_ARGB:
|
||||
case BufferedImage.TYPE_INT_ARGB_PRE:
|
||||
if (byteOrder == ByteOrder.BIG_ENDIAN)
|
||||
pixelFormat = TJ.PF_XRGB;
|
||||
else
|
||||
pixelFormat = TJ.PF_BGRX;
|
||||
intPixels = true; break;
|
||||
default:
|
||||
throw new Exception("Unsupported BufferedImage format");
|
||||
}
|
||||
WritableRaster wr = srcImage.getRaster();
|
||||
if (subsamp < 0) throw new Exception("Subsampling level not set");
|
||||
if (intPixels) {
|
||||
SinglePixelPackedSampleModel sm =
|
||||
(SinglePixelPackedSampleModel)srcImage.getSampleModel();
|
||||
int stride = sm.getScanlineStride();
|
||||
DataBufferInt db = (DataBufferInt)wr.getDataBuffer();
|
||||
int[] buf = db.getData();
|
||||
encodeYUV(buf, width, stride, height, pixelFormat, dstBuf, yuvPad,
|
||||
subsamp, flags);
|
||||
} else {
|
||||
ComponentSampleModel sm =
|
||||
(ComponentSampleModel)srcImage.getSampleModel();
|
||||
int pixelSize = sm.getPixelStride();
|
||||
if (pixelSize != TJ.getPixelSize(pixelFormat))
|
||||
throw new Exception("Inconsistency between pixel format and pixel size in BufferedImage");
|
||||
int pitch = sm.getScanlineStride();
|
||||
DataBufferByte db = (DataBufferByte)wr.getDataBuffer();
|
||||
byte[] buf = db.getData();
|
||||
encodeYUV(buf, width, pitch, height, pixelFormat, dstBuf, yuvPad,
|
||||
subsamp, flags);
|
||||
}
|
||||
compressedSize = TJ.bufSizeYUV(width, yuvPad, height, subsamp);
|
||||
setSourceImage(srcImage, 0, 0, 0, 0);
|
||||
encodeYUV(dstBuf, flags);
|
||||
}
|
||||
|
||||
/**
|
||||
* Encode the uncompressed source image stored in <code>srcImage</code>
|
||||
* and return a buffer containing a YUV planar image. See
|
||||
* {@link #encodeYUV(byte[], int)} for more detail.
|
||||
*
|
||||
* @param srcImage a <code>BufferedImage</code> instance containing RGB or
|
||||
* grayscale pixels to be encoded
|
||||
*
|
||||
* @param flags the bitwise OR of one or more of {@link TJ TJ.FLAG_*}
|
||||
*
|
||||
* @return a buffer containing a YUV planar image
|
||||
* @deprecated Use
|
||||
* {@link #setSourceImage(BufferedImage, int, int, int, int)} and
|
||||
* {@link #encodeYUV(int, int)} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public byte[] encodeYUV(BufferedImage srcImage, int flags) throws Exception {
|
||||
if (subsamp < 0)
|
||||
throw new Exception("Subsampling level not set");
|
||||
int width = srcImage.getWidth();
|
||||
int height = srcImage.getHeight();
|
||||
byte[] buf = new byte[TJ.bufSizeYUV(width, yuvPad, height, subsamp)];
|
||||
encodeYUV(srcImage, buf, flags);
|
||||
return buf;
|
||||
setSourceImage(srcImage, 0, 0, 0, 0);
|
||||
return encodeYUV(flags);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the size of the image (in bytes) generated by the most recent
|
||||
* compress/encode operation.
|
||||
* compress operation.
|
||||
*
|
||||
* @return the size of the image (in bytes) generated by the most recent
|
||||
* compress/encode operation
|
||||
* compress operation.
|
||||
*/
|
||||
public int getCompressedSize() {
|
||||
return compressedSize;
|
||||
@@ -562,7 +567,8 @@ public class TJCompressor {
|
||||
* Free the native structures associated with this compressor instance.
|
||||
*/
|
||||
public void close() throws Exception {
|
||||
destroy();
|
||||
if (handle != 0)
|
||||
destroy();
|
||||
}
|
||||
|
||||
protected void finalize() throws Throwable {
|
||||
@@ -595,25 +601,28 @@ public class TJCompressor {
|
||||
int stride, int height, int pixelFormat, byte[] dstBuf, int jpegSubsamp,
|
||||
int jpegQual, int flags) throws Exception;
|
||||
|
||||
private native int compressFromYUV(byte[] srcBuf, int width, int pad,
|
||||
int height, int subsamp, byte[] dstBuf, int jpegQual, int flags)
|
||||
private native int compressFromYUV(byte[][] srcPlanes, int[] srcOffsets,
|
||||
int width, int[] srcStrides, int height, int subsamp, byte[] dstBuf,
|
||||
int jpegQual, int flags)
|
||||
throws Exception;
|
||||
|
||||
private native void encodeYUV(byte[] srcBuf, int width, int pitch,
|
||||
int height, int pixelFormat, byte[] dstBuf, int subsamp, int flags)
|
||||
throws Exception; // deprecated
|
||||
|
||||
private native void encodeYUV(byte[] srcBuf, int width, int pitch,
|
||||
int height, int pixelFormat, byte[] dstBuf, int pad, int subsamp,
|
||||
int flags) throws Exception;
|
||||
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;
|
||||
|
||||
private native void encodeYUV(int[] srcBuf, int width, int stride,
|
||||
int height, int pixelFormat, byte[] dstBuf, int subsamp, int flags)
|
||||
throws Exception; // deprecated
|
||||
|
||||
private native void encodeYUV(int[] srcBuf, int width, int pitch,
|
||||
int height, int pixelFormat, byte[] dstBuf, int pad, int subsamp,
|
||||
int flags) throws Exception;
|
||||
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;
|
||||
|
||||
static {
|
||||
TJLoader.load();
|
||||
@@ -621,14 +630,15 @@ public class TJCompressor {
|
||||
|
||||
private long handle = 0;
|
||||
private byte[] srcBuf = null;
|
||||
private int[] srcBufInt = null;
|
||||
private int srcWidth = 0;
|
||||
private int srcHeight = 0;
|
||||
private int srcX = -1;
|
||||
private int srcY = -1;
|
||||
private int srcPitch = 0;
|
||||
private int srcStride = 0;
|
||||
private int srcPixelFormat = -1;
|
||||
private int srcYUVPad = -1;
|
||||
private boolean srcIsYUV;
|
||||
private YUVImage srcYUVImage = null;
|
||||
private int subsamp = -1;
|
||||
private int jpegQuality = -1;
|
||||
private int compressedSize = 0;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C)2011-2013 D. R. Commander. All Rights Reserved.
|
||||
* Copyright (C)2011-2014 D. R. Commander. All Rights Reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
@@ -47,21 +47,21 @@ public class TJDecompressor {
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a TurboJPEG decompressor instance and associate the JPEG image
|
||||
* stored in <code>jpegImage</code> with the newly-created instance.
|
||||
* Create a TurboJPEG decompressor instance and associate the JPEG source
|
||||
* 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)
|
||||
*/
|
||||
public TJDecompressor(byte[] jpegImage) throws Exception {
|
||||
init();
|
||||
setJPEGImage(jpegImage, jpegImage.length);
|
||||
setSourceImage(jpegImage, jpegImage.length);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a TurboJPEG decompressor instance and associate the JPEG image
|
||||
* of length <code>imageSize</code> bytes stored in <code>jpegImage</code>
|
||||
* with the newly-created instance.
|
||||
* 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.
|
||||
*
|
||||
* @param jpegImage JPEG image buffer
|
||||
*
|
||||
@@ -69,7 +69,20 @@ public class TJDecompressor {
|
||||
*/
|
||||
public TJDecompressor(byte[] jpegImage, int imageSize) throws Exception {
|
||||
init();
|
||||
setJPEGImage(jpegImage, imageSize);
|
||||
setSourceImage(jpegImage, imageSize);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a TurboJPEG decompressor instance and associate the YUV planar
|
||||
* source image stored in <code>yuvImage</code> with the newly created
|
||||
* instance.
|
||||
*
|
||||
* @param yuvImage {@link YUVImage} instance containing a YUV planar
|
||||
* image to be decoded
|
||||
*/
|
||||
public TJDecompressor(YUVImage yuvImage) throws Exception {
|
||||
init();
|
||||
setSourceImage(yuvImage);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -81,48 +94,82 @@ public class TJDecompressor {
|
||||
*
|
||||
* @param imageSize size of the JPEG image (in bytes)
|
||||
*/
|
||||
public void setJPEGImage(byte[] jpegImage, int imageSize) throws Exception {
|
||||
public void setSourceImage(byte[] jpegImage, int imageSize)
|
||||
throws Exception {
|
||||
if (jpegImage == null || imageSize < 1)
|
||||
throw new Exception("Invalid argument in setJPEGImage()");
|
||||
throw new Exception("Invalid argument in setSourceImage()");
|
||||
jpegBuf = jpegImage;
|
||||
jpegBufSize = imageSize;
|
||||
decompressHeader(jpegBuf, jpegBufSize);
|
||||
yuvImage = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the width of the JPEG image associated with this decompressor
|
||||
* instance.
|
||||
* @deprecated Use {@link #setSourceImage(byte[], int)} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public void setJPEGImage(byte[] jpegImage, int imageSize) throws Exception {
|
||||
setSourceImage(jpegImage, imageSize);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* @return the width of the JPEG image associated with this decompressor
|
||||
* instance
|
||||
* @param srcImage {@link YUVImage} instance containing a YUV planar image to
|
||||
* be decoded
|
||||
*/
|
||||
public void setSourceImage(YUVImage srcImage) throws Exception {
|
||||
if (srcImage == null)
|
||||
throw new Exception("Invalid argument in setSourceImage()");
|
||||
yuvImage = srcImage;
|
||||
jpegBuf = null;
|
||||
jpegBufSize = 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the width of the source image (JPEG or YUV) associated with this
|
||||
* decompressor instance.
|
||||
*
|
||||
* @return the width of the source image (JPEG or YUV) associated with this
|
||||
* decompressor instance.
|
||||
*/
|
||||
public int getWidth() throws Exception {
|
||||
if (yuvImage != null)
|
||||
return yuvImage.getWidth();
|
||||
if (jpegWidth < 1)
|
||||
throw new Exception(NO_ASSOC_ERROR);
|
||||
return jpegWidth;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the height of the JPEG image associated with this decompressor
|
||||
* instance.
|
||||
* Returns the height of the source image (JPEG or YUV) associated with this
|
||||
* decompressor instance.
|
||||
*
|
||||
* @return the height of the JPEG image associated with this decompressor
|
||||
* instance
|
||||
* @return the height of the source image (JPEG or YUV) associated with this
|
||||
* decompressor instance.
|
||||
*/
|
||||
public int getHeight() throws Exception {
|
||||
if (yuvImage != null)
|
||||
return yuvImage.getHeight();
|
||||
if (jpegHeight < 1)
|
||||
throw new Exception(NO_ASSOC_ERROR);
|
||||
return jpegHeight;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the level of chrominance subsampling used in the JPEG image
|
||||
* associated with this decompressor instance. See {@link TJ TJ.SAMP_*}.
|
||||
* Returns the level of chrominance subsampling used in the source image
|
||||
* (JPEG or YUV) associated with this decompressor instance. See
|
||||
* {@link TJ#SAMP_444 TJ.SAMP_*}.
|
||||
*
|
||||
* @return the level of chrominance subsampling used in the JPEG image
|
||||
* associated with this decompressor instance
|
||||
* @return the level of chrominance subsampling used in the source image
|
||||
* (JPEG or YUV) associated with this decompressor instance.
|
||||
*/
|
||||
public int getSubsamp() throws Exception {
|
||||
if (yuvImage != null)
|
||||
return yuvImage.getSubsamp();
|
||||
if (jpegSubsamp < 0)
|
||||
throw new Exception(NO_ASSOC_ERROR);
|
||||
if (jpegSubsamp >= TJ.NUMSAMP)
|
||||
@@ -131,13 +178,16 @@ public class TJDecompressor {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the colorspace used in the JPEG image associated with this
|
||||
* decompressor instance. See {@link TJ TJ.CS_*}.
|
||||
* Returns the colorspace used in the source image (JPEG or YUV) associated
|
||||
* with this decompressor instance. See {@link TJ#CS_RGB TJ.CS_*}. If the
|
||||
* source image is YUV, then this always returns {@link TJ#CS_YCbCr}.
|
||||
*
|
||||
* @return the colorspace used in the JPEG image associated with this
|
||||
* decompressor instance
|
||||
* @return the colorspace used in the source image (JPEG or YUV) associated
|
||||
* with this decompressor instance.
|
||||
*/
|
||||
public int getColorspace() throws Exception {
|
||||
if (yuvImage != null)
|
||||
return TJ.CS_YCbCr;
|
||||
if (jpegColorspace < 0)
|
||||
throw new Exception(NO_ASSOC_ERROR);
|
||||
if (jpegColorspace >= TJ.NUMCS)
|
||||
@@ -148,7 +198,7 @@ public class TJDecompressor {
|
||||
/**
|
||||
* Returns the JPEG image buffer associated with this decompressor instance.
|
||||
*
|
||||
* @return the JPEG image buffer associated with this decompressor instance
|
||||
* @return the JPEG image buffer associated with this decompressor instance.
|
||||
*/
|
||||
public byte[] getJPEGBuf() throws Exception {
|
||||
if (jpegBuf == null)
|
||||
@@ -161,7 +211,7 @@ public class TJDecompressor {
|
||||
* decompressor instance.
|
||||
*
|
||||
* @return the size of the JPEG image (in bytes) associated with this
|
||||
* decompressor instance
|
||||
* decompressor instance.
|
||||
*/
|
||||
public int getJPEGSize() throws Exception {
|
||||
if (jpegBufSize < 1)
|
||||
@@ -169,7 +219,6 @@ public class TJDecompressor {
|
||||
return jpegBufSize;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the width of the largest scaled-down image that the TurboJPEG
|
||||
* decompressor can generate without exceeding the desired image width and
|
||||
@@ -187,7 +236,7 @@ public class TJDecompressor {
|
||||
*
|
||||
* @return the width of the largest scaled-down image that the TurboJPEG
|
||||
* decompressor can generate without exceeding the desired image width and
|
||||
* height
|
||||
* height.
|
||||
*/
|
||||
public int getScaledWidth(int desiredWidth, int desiredHeight)
|
||||
throws Exception {
|
||||
@@ -229,7 +278,7 @@ public class TJDecompressor {
|
||||
*
|
||||
* @return the height of the largest scaled-down image that the TurboJPEG
|
||||
* decompressor can generate without exceeding the desired image width and
|
||||
* height
|
||||
* height.
|
||||
*/
|
||||
public int getScaledHeight(int desiredWidth, int desiredHeight)
|
||||
throws Exception {
|
||||
@@ -255,73 +304,91 @@ public class TJDecompressor {
|
||||
}
|
||||
|
||||
/**
|
||||
* Decompress the JPEG source image associated with this decompressor
|
||||
* instance and output a decompressed image to the given destination buffer.
|
||||
* 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.
|
||||
*
|
||||
* @param dstBuf buffer that will receive the decompressed image. This
|
||||
* buffer should normally be <code>pitch * scaledHeight</code> bytes in size,
|
||||
* where <code>scaledHeight</code> can be determined by calling <code>
|
||||
* @param dstBuf buffer that will receive the decompressed/decoded image.
|
||||
* If the source image is a JPEG image, then this buffer should normally be
|
||||
* <code>pitch * scaledHeight</code> bytes in size, where
|
||||
* <code>scaledHeight</code> can be determined by calling <code>
|
||||
* scalingFactor.{@link TJScalingFactor#getScaled getScaled}(jpegHeight)
|
||||
* </code> with one of the scaling factors returned from {@link
|
||||
* TJ#getScalingFactors} or by calling {@link #getScaledHeight}. However,
|
||||
* the buffer may also be larger than the dimensions of the JPEG image, in
|
||||
* which case the <code>x</code>, <code>y</code>, and <code>pitch</code>
|
||||
* parameters can be used to specify the region into which the JPEG image
|
||||
* should be decompressed.
|
||||
* TJ#getScalingFactors} or by calling {@link #getScaledHeight}. If the
|
||||
* source image is a YUV image, then this buffer should normally be
|
||||
* <code>pitch * height</code> bytes in size, where <code>height</code> is
|
||||
* the height of the YUV image. However, the buffer may also be larger than
|
||||
* the dimensions of the source image, in which case the <code>x</code>,
|
||||
* <code>y</code>, and <code>pitch</code> parameters can be used to specify
|
||||
* the region into which the source image should be decompressed/decoded.
|
||||
*
|
||||
* @param x x offset (in pixels) of the region into which the JPEG image
|
||||
* should be decompressed, relative to the start of <code>dstBuf</code>.
|
||||
* @param x x offset (in pixels) of the region in the destination image into
|
||||
* which the source image should be decompressed/decoded
|
||||
*
|
||||
* @param y y offset (in pixels) of the region into which the JPEG image
|
||||
* should be decompressed, relative to the start of <code>dstBuf</code>.
|
||||
* @param y y offset (in pixels) of the region in the destination image into
|
||||
* which the source image should be decompressed/decoded
|
||||
*
|
||||
* @param desiredWidth desired width (in pixels) of the decompressed image
|
||||
* (or image region.) If the desired image dimensions are different than the
|
||||
* dimensions of the JPEG image being decompressed, then TurboJPEG will use
|
||||
* scaling in the JPEG decompressor to generate the largest possible image
|
||||
* that will fit within the desired dimensions. Setting this to 0 is the
|
||||
* same as setting it to the width of the JPEG image (in other words, the
|
||||
* width will not be considered when determining the scaled image size.)
|
||||
* @param desiredWidth If the source image is a JPEG image, then this
|
||||
* specifies the desired width (in pixels) of the decompressed image (or
|
||||
* image region.) If the desired destination image dimensions are different
|
||||
* than the source image dimensions, then TurboJPEG will use scaling in the
|
||||
* JPEG decompressor to generate the largest possible image that will fit
|
||||
* within the desired dimensions. Setting this to 0 is the same as setting
|
||||
* it to the width of the JPEG image (in other words, the width will not be
|
||||
* considered when determining the scaled image size.) This parameter is
|
||||
* ignored if the source image is a YUV image.
|
||||
*
|
||||
* @param pitch bytes per line of the destination image. Normally, this
|
||||
* should be set to <code>scaledWidth * TJ.pixelSize(pixelFormat)</code> if
|
||||
* the decompressed image is unpadded, but you can use this to, for instance,
|
||||
* pad each line of the decompressed image to a 4-byte boundary or to
|
||||
* decompress the JPEG image into a region of a larger image. NOTE:
|
||||
* <code>scaledWidth</code> can be determined by calling <code>
|
||||
* the destination image is unpadded, but you can use this to, for instance,
|
||||
* pad each line of the destination image to a 4-byte boundary or to
|
||||
* decompress/decode the source image into a region of a larger image. NOTE:
|
||||
* if the source image is a JPEG image, then <code>scaledWidth</code> can be
|
||||
* determined by calling <code>
|
||||
* scalingFactor.{@link TJScalingFactor#getScaled getScaled}(jpegWidth)
|
||||
* </code> or by calling {@link #getScaledWidth}. Setting this parameter to
|
||||
* 0 is the equivalent of setting it to <code>scaledWidth *
|
||||
* TJ.pixelSize(pixelFormat)</code>.
|
||||
* </code> or by calling {@link #getScaledWidth}. If the source image is a
|
||||
* YUV image, then <code>scaledWidth</code> is the width of the YUV image.
|
||||
* Setting this parameter to 0 is the equivalent of setting it to
|
||||
* <code>scaledWidth * TJ.pixelSize(pixelFormat)</code>.
|
||||
*
|
||||
* @param desiredHeight desired height (in pixels) of the decompressed image
|
||||
* (or image region.) If the desired image dimensions are different than the
|
||||
* dimensions of the JPEG image being decompressed, then TurboJPEG will use
|
||||
* scaling in the JPEG decompressor to generate the largest possible image
|
||||
* that will fit within the desired dimensions. Setting this to 0 is the
|
||||
* same as setting it to the height of the JPEG image (in other words, the
|
||||
* height will not be considered when determining the scaled image size.)
|
||||
* @param desiredHeight If the source image is a JPEG image, then this
|
||||
* specifies the desired height (in pixels) of the decompressed image (or
|
||||
* image region.) If the desired destination image dimensions are different
|
||||
* than the source image dimensions, then TurboJPEG will use scaling in the
|
||||
* JPEG decompressor to generate the largest possible image that will fit
|
||||
* within the desired dimensions. Setting this to 0 is the same as setting
|
||||
* it to the height of the JPEG image (in other words, the height will not be
|
||||
* considered when determining the scaled image size.) This parameter is
|
||||
* ignored if the source image is a YUV image.
|
||||
*
|
||||
* @param pixelFormat pixel format of the decompressed image (one of
|
||||
* {@link TJ TJ.PF_*})
|
||||
* @param pixelFormat pixel format of the decompressed/decoded image (one of
|
||||
* {@link TJ#PF_RGB TJ.PF_*})
|
||||
*
|
||||
* @param flags the bitwise OR of one or more of {@link TJ TJ.FLAG_*}
|
||||
* @param flags the bitwise OR of one or more of
|
||||
* {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*}
|
||||
*/
|
||||
public void decompress(byte[] dstBuf, int x, int y, int desiredWidth,
|
||||
int pitch, int desiredHeight, int pixelFormat,
|
||||
int flags) throws Exception {
|
||||
if (jpegBuf == null)
|
||||
if (jpegBuf == null && yuvImage == null)
|
||||
throw new Exception(NO_ASSOC_ERROR);
|
||||
if (dstBuf == null || x < 0 || y < 0 || desiredWidth < 0 || pitch < 0 ||
|
||||
desiredHeight < 0 || pixelFormat < 0 || pixelFormat >= TJ.NUMPF ||
|
||||
flags < 0)
|
||||
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()");
|
||||
if (x > 0 || y > 0)
|
||||
decompress(jpegBuf, jpegBufSize, dstBuf, x, y, desiredWidth, pitch,
|
||||
desiredHeight, pixelFormat, flags);
|
||||
else
|
||||
decompress(jpegBuf, jpegBufSize, dstBuf, desiredWidth, pitch,
|
||||
desiredHeight, pixelFormat, flags);
|
||||
if (yuvImage != null)
|
||||
decodeYUV(yuvImage.getPlanes(), yuvImage.getOffsets(),
|
||||
yuvImage.getStrides(), yuvImage.getSubsamp(), dstBuf, x, y,
|
||||
yuvImage.getWidth(), pitch, yuvImage.getHeight(), pixelFormat,
|
||||
flags);
|
||||
else {
|
||||
if (x > 0 || y > 0)
|
||||
decompress(jpegBuf, jpegBufSize, dstBuf, x, y, desiredWidth, pitch,
|
||||
desiredHeight, pixelFormat, flags);
|
||||
else
|
||||
decompress(jpegBuf, jpegBufSize, dstBuf, desiredWidth, pitch,
|
||||
desiredHeight, pixelFormat, flags);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -353,15 +420,17 @@ public class TJDecompressor {
|
||||
* for description
|
||||
*
|
||||
* @param pixelFormat pixel format of the decompressed image (one of
|
||||
* {@link TJ TJ.PF_*})
|
||||
* {@link TJ#PF_RGB TJ.PF_*})
|
||||
*
|
||||
* @param flags the bitwise OR of one or more of {@link TJ TJ.FLAG_*}
|
||||
* @param flags the bitwise OR of one or more of
|
||||
* {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*}
|
||||
*
|
||||
* @return a buffer containing the decompressed image
|
||||
* @return a buffer containing the decompressed image.
|
||||
*/
|
||||
public byte[] decompress(int desiredWidth, int pitch, int desiredHeight,
|
||||
int pixelFormat, int flags) throws Exception {
|
||||
if (desiredWidth < 0 || pitch < 0 || desiredHeight < 0 ||
|
||||
if (pitch < 0 ||
|
||||
(yuvImage == null && (desiredWidth < 0 || desiredHeight < 0)) ||
|
||||
pixelFormat < 0 || pixelFormat >= TJ.NUMPF || flags < 0)
|
||||
throw new Exception("Invalid argument in decompress()");
|
||||
int pixelSize = TJ.getPixelSize(pixelFormat);
|
||||
@@ -376,22 +445,118 @@ public class TJDecompressor {
|
||||
|
||||
/**
|
||||
* Decompress the JPEG source image associated with this decompressor
|
||||
* instance and output a YUV planar image to the given destination buffer.
|
||||
* This method performs JPEG decompression but leaves out the color
|
||||
* conversion step, so a planar YUV image is generated instead of an RGB
|
||||
* image. The padding of the planes in this image is the same as in the
|
||||
* images generated by {@link TJCompressor#encodeYUV(byte[], int)}. Note
|
||||
* that, if the width or height of the image is not an even multiple of the
|
||||
* MCU block size (see {@link TJ#getMCUWidth} and {@link TJ#getMCUHeight}),
|
||||
* then an intermediate buffer copy will be performed within TurboJPEG.
|
||||
* <p>
|
||||
* NOTE: Technically, the JPEG format uses the YCbCr colorspace, but per the
|
||||
* convention of the digital video community, the TurboJPEG API uses "YUV" to
|
||||
* refer to an image format consisting of Y, Cb, and Cr image planes.
|
||||
* instance into a YUV planar image and store it in the given
|
||||
* <code>YUVImage</code> instance. This method performs JPEG decompression
|
||||
* but leaves out the color conversion step, so a planar YUV image is
|
||||
* generated instead of an RGB or grayscale image. This method cannot be
|
||||
* used to decompress JPEG source images with the CMYK or YCCK colorspace.
|
||||
*
|
||||
* @param dstBuf buffer that will receive the YUV planar image. Use
|
||||
* {@link TJ#bufSizeYUV} to determine the appropriate size for this buffer
|
||||
* based on the image width, height, and level of chrominance subsampling.
|
||||
* @param dstImage {@link YUVImage} instance that will receive the YUV planar
|
||||
* image. The level of subsampling specified in this <code>YUVImage</code>
|
||||
* instance must match that of the JPEG image, and the width and height
|
||||
* specified in the <code>YUVImage</code> instance must match one of the
|
||||
* scaled image sizes that TurboJPEG is capable of generating from the JPEG
|
||||
* source image.
|
||||
*
|
||||
* @param flags the bitwise OR of one or more of
|
||||
* {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*}
|
||||
*/
|
||||
public void decompressToYUV(YUVImage dstImage, int flags) throws Exception {
|
||||
if (jpegBuf == null)
|
||||
throw new Exception(NO_ASSOC_ERROR);
|
||||
if (dstImage == null || flags < 0)
|
||||
throw new Exception("Invalid argument in decompressToYUV()");
|
||||
int scaledWidth = getScaledWidth(dstImage.getWidth(),
|
||||
dstImage.getHeight());
|
||||
int scaledHeight = getScaledHeight(dstImage.getWidth(),
|
||||
dstImage.getHeight());
|
||||
if (scaledWidth != dstImage.getWidth() ||
|
||||
scaledHeight != dstImage.getHeight())
|
||||
throw new Exception("YUVImage dimensions do not match one of the scaled image sizes that TurboJPEG is capable of generating.");
|
||||
if (jpegSubsamp != dstImage.getSubsamp())
|
||||
throw new Exception("YUVImage subsampling level does not match that of the JPEG image");
|
||||
|
||||
decompressToYUV(jpegBuf, jpegBufSize, dstImage.getPlanes(),
|
||||
dstImage.getOffsets(), dstImage.getWidth(),
|
||||
dstImage.getStrides(), dstImage.getHeight(), flags);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link #decompressToYUV(YUVImage, int)} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public void decompressToYUV(byte[] dstBuf, int flags) throws Exception {
|
||||
YUVImage dstImage = new YUVImage(dstBuf, jpegWidth, 4, jpegHeight,
|
||||
jpegSubsamp);
|
||||
decompressToYUV(dstImage, flags);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
* This method performs JPEG decompression but leaves out the color
|
||||
* conversion step, so a planar YUV image is generated instead of an RGB or
|
||||
* grayscale image. This method cannot be used to decompress JPEG source
|
||||
* images with the CMYK or YCCK colorspace.
|
||||
*
|
||||
* @param desiredWidth desired width (in pixels) of the YUV image. If the
|
||||
* desired image dimensions are different than the dimensions of the JPEG
|
||||
* image being decompressed, then TurboJPEG will use scaling in the JPEG
|
||||
* decompressor to generate the largest possible image that will fit within
|
||||
* the desired dimensions. Setting this to 0 is the same as setting it to
|
||||
* the width of the JPEG image (in other words, the width will not be
|
||||
* considered when determining the scaled image size.)
|
||||
*
|
||||
* @param strides an array of integers, each specifying the number of bytes
|
||||
* per line in the corresponding plane of the output image. Setting the
|
||||
* stride for any plane to 0 is the same as setting it to the scaled
|
||||
* component width of the plane. If <tt>strides</tt> is NULL, then the
|
||||
* strides for all planes will be set to their respective scaled component
|
||||
* widths. You can adjust the strides in order to add an arbitrary amount of
|
||||
* line padding to each plane.
|
||||
*
|
||||
* @param desiredHeight desired height (in pixels) of the YUV image. If the
|
||||
* desired image dimensions are different than the dimensions of the JPEG
|
||||
* image being decompressed, then TurboJPEG will use scaling in the JPEG
|
||||
* decompressor to generate the largest possible image that will fit within
|
||||
* the desired dimensions. Setting this to 0 is the same as setting it to
|
||||
* the height of the JPEG image (in other words, the height will not be
|
||||
* considered when determining the scaled image size.)
|
||||
*
|
||||
* @param flags the bitwise OR of one or more of
|
||||
* {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*}
|
||||
*
|
||||
* @return a YUV planar image.
|
||||
*/
|
||||
public YUVImage decompressToYUV(int desiredWidth, int[] strides,
|
||||
int desiredHeight,
|
||||
int flags) throws Exception {
|
||||
if (flags < 0)
|
||||
throw new Exception("Invalid argument in decompressToYUV()");
|
||||
if (jpegWidth < 1 || jpegHeight < 1 || jpegSubsamp < 0)
|
||||
throw new Exception(NO_ASSOC_ERROR);
|
||||
if (jpegSubsamp >= TJ.NUMSAMP)
|
||||
throw new Exception("JPEG header information is invalid");
|
||||
if (yuvImage != null)
|
||||
throw new Exception("Source image is the wrong type");
|
||||
|
||||
int scaledWidth = getScaledWidth(desiredWidth, desiredHeight);
|
||||
int scaledHeight = getScaledHeight(desiredWidth, desiredHeight);
|
||||
YUVImage yuvImage = new YUVImage(scaledWidth, null, scaledHeight,
|
||||
jpegSubsamp);
|
||||
decompressToYUV(yuvImage, flags);
|
||||
return yuvImage;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
* method performs JPEG decompression but leaves out the color conversion
|
||||
* step, so a planar YUV image is generated instead of an RGB or grayscale
|
||||
* image. This method cannot be used to decompress JPEG source images with
|
||||
* the CMYK or YCCK colorspace.
|
||||
*
|
||||
* @param desiredWidth desired width (in pixels) of the YUV image. If the
|
||||
* desired image dimensions are different than the dimensions of the JPEG
|
||||
@@ -413,60 +578,28 @@ public class TJDecompressor {
|
||||
* the height of the JPEG image (in other words, the height will not be
|
||||
* considered when determining the scaled image size.)
|
||||
*
|
||||
* @param flags the bitwise OR of one or more of {@link TJ TJ.FLAG_*}
|
||||
* @param flags the bitwise OR of one or more of
|
||||
* {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*}
|
||||
*
|
||||
* @return a YUV planar image.
|
||||
*/
|
||||
public void decompressToYUV(byte[] dstBuf, int desiredWidth, int pad,
|
||||
int desiredHeight, int flags) throws Exception {
|
||||
if (jpegBuf == null)
|
||||
throw new Exception(NO_ASSOC_ERROR);
|
||||
if (dstBuf == null || desiredWidth < 0 || pad < 1 ||
|
||||
((pad & (pad - 1)) != 0) || desiredHeight < 0 || flags < 0)
|
||||
throw new Exception("Invalid argument in decompressToYUV()");
|
||||
decompressToYUV(jpegBuf, jpegBufSize, dstBuf, desiredWidth, pad,
|
||||
desiredHeight, flags);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link #decompressToYUV(byte[], int, int, int, int)}
|
||||
* instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public void decompressToYUV(byte[] dstBuf, int flags) throws Exception {
|
||||
decompressToYUV(dstBuf, 0, 4, 0, flags);
|
||||
}
|
||||
|
||||
/**
|
||||
* Decompress the JPEG source image associated with this decompressor
|
||||
* instance and return a buffer containing a YUV planar image. See {@link
|
||||
* #decompressToYUV(byte[], int, int, int, int)} for more detail.
|
||||
*
|
||||
* @param desiredWidth see
|
||||
* {@link #decompressToYUV(byte[], int, int, int, int)} for description
|
||||
*
|
||||
* @param pad see {@link #decompressToYUV(byte[], int, int, int, int)} for
|
||||
* description
|
||||
*
|
||||
* @param desiredHeight see {@link
|
||||
* #decompressToYUV(byte[], int, int, int, int)} for description
|
||||
*
|
||||
* @param flags the bitwise OR of one or more of {@link TJ TJ.FLAG_*}
|
||||
*
|
||||
* @return a buffer containing a YUV planar image
|
||||
*/
|
||||
public byte[] decompressToYUV(int desiredWidth, int pad, int desiredHeight,
|
||||
int flags) throws Exception {
|
||||
public YUVImage decompressToYUV(int desiredWidth, int pad, int desiredHeight,
|
||||
int flags) throws Exception {
|
||||
if (flags < 0)
|
||||
throw new Exception("Invalid argument in decompressToYUV()");
|
||||
if (jpegWidth < 1 || jpegHeight < 1 || jpegSubsamp < 0)
|
||||
throw new Exception(NO_ASSOC_ERROR);
|
||||
if (jpegSubsamp >= TJ.NUMSAMP)
|
||||
throw new Exception("JPEG header information is invalid");
|
||||
if (yuvImage != null)
|
||||
throw new Exception("Source image is the wrong type");
|
||||
|
||||
int scaledWidth = getScaledWidth(desiredWidth, desiredHeight);
|
||||
int scaledHeight = getScaledHeight(desiredWidth, desiredHeight);
|
||||
byte[] buf = new byte[TJ.bufSizeYUV(scaledWidth, pad, scaledHeight,
|
||||
jpegSubsamp)];
|
||||
decompressToYUV(buf, desiredWidth, pad, desiredHeight, flags);
|
||||
return buf;
|
||||
YUVImage yuvImage = new YUVImage(scaledWidth, pad, scaledHeight,
|
||||
jpegSubsamp);
|
||||
decompressToYUV(yuvImage, flags);
|
||||
return yuvImage;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -474,91 +607,127 @@ public class TJDecompressor {
|
||||
*/
|
||||
@Deprecated
|
||||
public byte[] decompressToYUV(int flags) throws Exception {
|
||||
return decompressToYUV(0, 4, 0, flags);
|
||||
YUVImage dstImage = new YUVImage(jpegWidth, 4, jpegHeight, jpegSubsamp);
|
||||
decompressToYUV(dstImage, flags);
|
||||
return dstImage.getBuf();
|
||||
}
|
||||
|
||||
/**
|
||||
* Decompress the JPEG source image associated with this decompressor
|
||||
* instance and output a decompressed image to the given destination buffer.
|
||||
* 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.
|
||||
*
|
||||
* @param dstBuf buffer that will receive the decompressed image. This
|
||||
* buffer should normally be <code>stride * scaledHeight</code> pixels in
|
||||
* size, where <code>scaledHeight</code> can be determined by calling <code>
|
||||
* @param dstBuf buffer that will receive the decompressed/decoded image.
|
||||
* If the source image is a JPEG image, then this buffer should normally be
|
||||
* <code>stride * scaledHeight</code> pixels in size, where
|
||||
* <code>scaledHeight</code> can be determined by calling <code>
|
||||
* scalingFactor.{@link TJScalingFactor#getScaled getScaled}(jpegHeight)
|
||||
* </code> with one of the scaling factors returned from {@link
|
||||
* TJ#getScalingFactors} or by calling {@link #getScaledHeight}. However,
|
||||
* the buffer may also be larger than the dimensions of the JPEG image, in
|
||||
* which case the <code>x</code>, <code>y</code>, and <code>stride</code>
|
||||
* parameters can be used to specify the region into which the JPEG image
|
||||
* should be decompressed.
|
||||
* TJ#getScalingFactors} or by calling {@link #getScaledHeight}. If the
|
||||
* source image is a YUV image, then this buffer should normally be
|
||||
* <code>stride * height</code> pixels in size, where <code>height</code> is
|
||||
* the height of the YUV image. However, the buffer may also be larger than
|
||||
* the dimensions of the JPEG image, in which case the <code>x</code>,
|
||||
* <code>y</code>, and <code>stride</code> parameters can be used to specify
|
||||
* the region into which the source image should be decompressed.
|
||||
*
|
||||
* @param x x offset (in pixels) of the region into which the JPEG image
|
||||
* should be decompressed, relative to the start of <code>dstBuf</code>.
|
||||
* @param x x offset (in pixels) of the region in the destination image into
|
||||
* which the source image should be decompressed/decoded
|
||||
*
|
||||
* @param y y offset (in pixels) of the region into which the JPEG image
|
||||
* should be decompressed, relative to the start of <code>dstBuf</code>.
|
||||
* @param y y offset (in pixels) of the region in the destination image into
|
||||
* which the source image should be decompressed/decoded
|
||||
*
|
||||
* @param desiredWidth desired width (in pixels) of the decompressed image
|
||||
* (or image region.) If the desired image dimensions are different than the
|
||||
* dimensions of the JPEG image being decompressed, then TurboJPEG will use
|
||||
* scaling in the JPEG decompressor to generate the largest possible image
|
||||
* that will fit within the desired dimensions. Setting this to 0 is the
|
||||
* same as setting it to the width of the JPEG image (in other words, the
|
||||
* width will not be considered when determining the scaled image size.)
|
||||
* @param desiredWidth If the source image is a JPEG image, then this
|
||||
* specifies the desired width (in pixels) of the decompressed image (or
|
||||
* image region.) If the desired destination image dimensions are different
|
||||
* than the source image dimensions, then TurboJPEG will use scaling in the
|
||||
* JPEG decompressor to generate the largest possible image that will fit
|
||||
* within the desired dimensions. Setting this to 0 is the same as setting
|
||||
* it to the width of the JPEG image (in other words, the width will not be
|
||||
* considered when determining the scaled image size.) This parameter is
|
||||
* ignored if the source image is a YUV image.
|
||||
*
|
||||
* @param stride pixels per line of the destination image. Normally, this
|
||||
* should be set to <code>scaledWidth</code>, but you can use this to, for
|
||||
* instance, decompress the JPEG image into a region of a larger image.
|
||||
* NOTE: <code>scaledWidth</code> can be determined by calling <code>
|
||||
* NOTE: if the source image is a JPEG image, then <code>scaledWidth</code>
|
||||
* can be determined by calling <code>
|
||||
* scalingFactor.{@link TJScalingFactor#getScaled getScaled}(jpegWidth)
|
||||
* </code> or by calling {@link #getScaledWidth}. Setting this parameter to
|
||||
* 0 is the equivalent of setting it to <code>scaledWidth</code>.
|
||||
* </code> or by calling {@link #getScaledWidth}. If the source image is a
|
||||
* YUV image, then <code>scaledWidth</code> is the width of the YUV image.
|
||||
* Setting this parameter to 0 is the equivalent of setting it to
|
||||
* <code>scaledWidth</code>.
|
||||
*
|
||||
* @param desiredHeight desired height (in pixels) of the decompressed image
|
||||
* (or image region.) If the desired image dimensions are different than the
|
||||
* dimensions of the JPEG image being decompressed, then TurboJPEG will use
|
||||
* scaling in the JPEG decompressor to generate the largest possible image
|
||||
* that will fit within the desired dimensions. Setting this to 0 is the
|
||||
* same as setting it to the height of the JPEG image (in other words, the
|
||||
* height will not be considered when determining the scaled image size.)
|
||||
* @param desiredHeight If the source image is a JPEG image, then this
|
||||
* specifies the desired height (in pixels) of the decompressed image (or
|
||||
* image region.) If the desired destination image dimensions are different
|
||||
* than the source image dimensions, then TurboJPEG will use scaling in the
|
||||
* JPEG decompressor to generate the largest possible image that will fit
|
||||
* within the desired dimensions. Setting this to 0 is the same as setting
|
||||
* it to the height of the JPEG image (in other words, the height will not be
|
||||
* considered when determining the scaled image size.) This parameter is
|
||||
* ignored if the source image is a YUV image.
|
||||
*
|
||||
* @param pixelFormat pixel format of the decompressed image (one of
|
||||
* {@link TJ TJ.PF_*})
|
||||
* {@link TJ#PF_RGB TJ.PF_*})
|
||||
*
|
||||
* @param flags the bitwise OR of one or more of {@link TJ TJ.FLAG_*}
|
||||
* @param flags the bitwise OR of one or more of
|
||||
* {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*}
|
||||
*/
|
||||
public void decompress(int[] dstBuf, int x, int y, int desiredWidth,
|
||||
int stride, int desiredHeight, int pixelFormat,
|
||||
int flags) throws Exception {
|
||||
if (jpegBuf == null)
|
||||
if (jpegBuf == null && yuvImage == null)
|
||||
throw new Exception(NO_ASSOC_ERROR);
|
||||
if (dstBuf == null || x < 0 || y < 0 || desiredWidth < 0 || stride < 0 ||
|
||||
desiredHeight < 0 || pixelFormat < 0 || pixelFormat >= TJ.NUMPF ||
|
||||
flags < 0)
|
||||
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()");
|
||||
decompress(jpegBuf, jpegBufSize, dstBuf, x, y, desiredWidth, stride,
|
||||
desiredHeight, pixelFormat, flags);
|
||||
if (yuvImage != null)
|
||||
decodeYUV(yuvImage.getPlanes(), yuvImage.getOffsets(),
|
||||
yuvImage.getStrides(), yuvImage.getSubsamp(), dstBuf, x, y,
|
||||
yuvImage.getWidth(), stride, yuvImage.getHeight(), pixelFormat,
|
||||
flags);
|
||||
else
|
||||
decompress(jpegBuf, jpegBufSize, dstBuf, x, y, desiredWidth, stride,
|
||||
desiredHeight, pixelFormat, flags);
|
||||
}
|
||||
|
||||
/**
|
||||
* Decompress the JPEG source image associated with this decompressor
|
||||
* instance and output a decompressed image to the given
|
||||
* <code>BufferedImage</code> instance.
|
||||
* 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.
|
||||
*
|
||||
* @param dstImage a <code>BufferedImage</code> instance that will receive
|
||||
* the decompressed image
|
||||
* the decompressed/decoded image. If the source image is a JPEG image, then
|
||||
* the width and height of the <code>BufferedImage</code> instance must match
|
||||
* one of the scaled image sizes that TurboJPEG is capable of generating from
|
||||
* the JPEG image. If the source image is a YUV image, then the width and
|
||||
* height of the <code>BufferedImage</code> instance must match the width and
|
||||
* height of the YUV image.
|
||||
*
|
||||
* @param flags the bitwise OR of one or more of {@link TJ TJ.FLAG_*}
|
||||
* @param flags the bitwise OR of one or more of
|
||||
* {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*}
|
||||
*/
|
||||
public void decompress(BufferedImage dstImage, int flags) throws Exception {
|
||||
if (dstImage == null || flags < 0)
|
||||
throw new Exception("Invalid argument in decompress()");
|
||||
int desiredWidth = dstImage.getWidth();
|
||||
int desiredHeight = dstImage.getHeight();
|
||||
int scaledWidth = getScaledWidth(desiredWidth, desiredHeight);
|
||||
int scaledHeight = getScaledHeight(desiredWidth, desiredHeight);
|
||||
if (scaledWidth != desiredWidth || scaledHeight != desiredHeight)
|
||||
throw new Exception("BufferedImage dimensions do not match a scaled image size that TurboJPEG is capable of generating.");
|
||||
int scaledWidth, scaledHeight;
|
||||
|
||||
if (yuvImage != null) {
|
||||
if (desiredWidth != yuvImage.getWidth() ||
|
||||
desiredHeight != yuvImage.getHeight())
|
||||
throw new Exception("BufferedImage dimensions do not match the dimensions of the source image.");
|
||||
scaledWidth = yuvImage.getWidth();
|
||||
scaledHeight = yuvImage.getHeight();
|
||||
} else {
|
||||
scaledWidth = getScaledWidth(desiredWidth, desiredHeight);
|
||||
scaledHeight = getScaledHeight(desiredWidth, desiredHeight);
|
||||
if (scaledWidth != desiredWidth || scaledHeight != desiredHeight)
|
||||
throw new Exception("BufferedImage dimensions do not match one of the scaled image sizes that TurboJPEG is capable of generating.");
|
||||
}
|
||||
int pixelFormat; boolean intPixels = false;
|
||||
if (byteOrder == null)
|
||||
byteOrder = ByteOrder.nativeOrder();
|
||||
@@ -599,10 +768,17 @@ public class TJDecompressor {
|
||||
int stride = sm.getScanlineStride();
|
||||
DataBufferInt db = (DataBufferInt)wr.getDataBuffer();
|
||||
int[] buf = db.getData();
|
||||
if (jpegBuf == null)
|
||||
throw new Exception(NO_ASSOC_ERROR);
|
||||
decompress(jpegBuf, jpegBufSize, buf, scaledWidth, stride, scaledHeight,
|
||||
pixelFormat, flags);
|
||||
if (yuvImage != null)
|
||||
decodeYUV(yuvImage.getPlanes(), yuvImage.getOffsets(),
|
||||
yuvImage.getStrides(), yuvImage.getSubsamp(), buf, 0, 0,
|
||||
yuvImage.getWidth(), stride, yuvImage.getHeight(),
|
||||
pixelFormat, flags);
|
||||
else {
|
||||
if (jpegBuf == null)
|
||||
throw new Exception(NO_ASSOC_ERROR);
|
||||
decompress(jpegBuf, jpegBufSize, buf, 0, 0, scaledWidth, stride,
|
||||
scaledHeight, pixelFormat, flags);
|
||||
}
|
||||
} else {
|
||||
ComponentSampleModel sm =
|
||||
(ComponentSampleModel)dstImage.getSampleModel();
|
||||
@@ -612,14 +788,15 @@ public class TJDecompressor {
|
||||
int pitch = sm.getScanlineStride();
|
||||
DataBufferByte db = (DataBufferByte)wr.getDataBuffer();
|
||||
byte[] buf = db.getData();
|
||||
decompress(buf, scaledWidth, pitch, scaledHeight, pixelFormat, flags);
|
||||
decompress(buf, 0, 0, scaledWidth, pitch, scaledHeight, pixelFormat,
|
||||
flags);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Decompress the JPEG source image associated with this decompressor
|
||||
* instance and return a <code>BufferedImage</code> instance containing the
|
||||
* decompressed image.
|
||||
* 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.
|
||||
*
|
||||
* @param desiredWidth see
|
||||
* {@link #decompress(byte[], int, int, int, int, int, int, int)} for
|
||||
@@ -629,19 +806,21 @@ public class TJDecompressor {
|
||||
* {@link #decompress(byte[], int, int, int, int, int, int, int)} for
|
||||
* description
|
||||
*
|
||||
* @param bufferedImageType the image type of the newly-created
|
||||
* <code>BufferedImage</code> instance (for instance,
|
||||
* @param bufferedImageType the image type of the <code>BufferedImage</code>
|
||||
* instance that will be created (for instance,
|
||||
* <code>BufferedImage.TYPE_INT_RGB</code>)
|
||||
*
|
||||
* @param flags the bitwise OR of one or more of {@link TJ TJ.FLAG_*}
|
||||
* @param flags the bitwise OR of one or more of
|
||||
* {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*}
|
||||
*
|
||||
* @return a <code>BufferedImage</code> instance containing the
|
||||
* decompressed image
|
||||
* decompressed/decoded image.
|
||||
*/
|
||||
public BufferedImage decompress(int desiredWidth, int desiredHeight,
|
||||
int bufferedImageType, int flags)
|
||||
throws Exception {
|
||||
if (desiredWidth < 0 || desiredHeight < 0 || flags < 0)
|
||||
if ((yuvImage == null && (desiredWidth < 0 || desiredHeight < 0)) ||
|
||||
flags < 0)
|
||||
throw new Exception("Invalid argument in decompress()");
|
||||
int scaledWidth = getScaledWidth(desiredWidth, desiredHeight);
|
||||
int scaledHeight = getScaledHeight(desiredWidth, desiredHeight);
|
||||
@@ -655,7 +834,8 @@ public class TJDecompressor {
|
||||
* Free the native structures associated with this decompressor instance.
|
||||
*/
|
||||
public void close() throws Exception {
|
||||
destroy();
|
||||
if (handle != 0)
|
||||
destroy();
|
||||
}
|
||||
|
||||
protected void finalize() throws Throwable {
|
||||
@@ -693,8 +873,17 @@ public class TJDecompressor {
|
||||
private native void decompressToYUV(byte[] srcBuf, int size, byte[] dstBuf,
|
||||
int flags) throws Exception; // deprecated
|
||||
|
||||
private native void decompressToYUV(byte[] srcBuf, int size, byte[] dstBuf,
|
||||
int desiredWidth, int pad, int desiredheight, int flags) throws Exception;
|
||||
private native void decompressToYUV(byte[] srcBuf, int size,
|
||||
byte[][] dstPlanes, int[] dstOffsets, int desiredWidth, int[] dstStrides,
|
||||
int desiredheight, int flags) throws Exception;
|
||||
|
||||
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;
|
||||
|
||||
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;
|
||||
|
||||
static {
|
||||
TJLoader.load();
|
||||
@@ -703,6 +892,7 @@ public class TJDecompressor {
|
||||
protected long handle = 0;
|
||||
protected byte[] jpegBuf = null;
|
||||
protected int jpegBufSize = 0;
|
||||
protected YUVImage yuvImage = null;
|
||||
protected int jpegWidth = 0;
|
||||
protected int jpegHeight = 0;
|
||||
protected int jpegSubsamp = -1;
|
||||
|
||||
@@ -42,6 +42,7 @@ public class TJScalingFactor {
|
||||
|
||||
/**
|
||||
* Returns numerator
|
||||
*
|
||||
* @return numerator
|
||||
*/
|
||||
public int getNum() {
|
||||
@@ -50,6 +51,7 @@ public class TJScalingFactor {
|
||||
|
||||
/**
|
||||
* Returns denominator
|
||||
*
|
||||
* @return denominator
|
||||
*/
|
||||
public int getDenom() {
|
||||
@@ -60,7 +62,8 @@ public class TJScalingFactor {
|
||||
* Returns the scaled value of <code>dimension</code>. This function
|
||||
* performs the integer equivalent of
|
||||
* <code>ceil(dimension * scalingFactor)</code>.
|
||||
* @return the scaled value of <code>dimension</code>
|
||||
*
|
||||
* @return the scaled value of <code>dimension</code>.
|
||||
*/
|
||||
public int getScaled(int dimension) {
|
||||
return (dimension * num + denom - 1) / denom;
|
||||
@@ -69,8 +72,9 @@ public class TJScalingFactor {
|
||||
/**
|
||||
* Returns true or false, depending on whether this instance and
|
||||
* <code>other</code> have the same numerator and denominator.
|
||||
*
|
||||
* @return true or false, depending on whether this instance and
|
||||
* <code>other</code> have the same numerator and denominator
|
||||
* <code>other</code> have the same numerator and denominator.
|
||||
*/
|
||||
public boolean equals(TJScalingFactor other) {
|
||||
return (this.num == other.num && this.denom == other.denom);
|
||||
@@ -79,8 +83,9 @@ public class TJScalingFactor {
|
||||
/**
|
||||
* Returns true or false, depending on whether this instance is equal to
|
||||
* 1/1.
|
||||
*
|
||||
* @return true or false, depending on whether this instance is equal to
|
||||
* 1/1
|
||||
* 1/1.
|
||||
*/
|
||||
public boolean isOne() {
|
||||
return (num == 1 && denom == 1);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C)2011, 2013 D. R. Commander. All Rights Reserved.
|
||||
* Copyright (C)2011, 2013-2014 D. R. Commander. All Rights Reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
@@ -42,20 +42,20 @@ public class TJTransformer extends TJDecompressor {
|
||||
|
||||
/**
|
||||
* Create a TurboJPEG lossless transformer instance and associate the JPEG
|
||||
* image stored in <code>jpegImage</code> with the newly-created instance.
|
||||
* image stored in <code>jpegImage</code> with the newly created instance.
|
||||
*
|
||||
* @param jpegImage JPEG image buffer (size of the JPEG image is assumed to
|
||||
* be the length of the array)
|
||||
*/
|
||||
public TJTransformer(byte[] jpegImage) throws Exception {
|
||||
init();
|
||||
setJPEGImage(jpegImage, jpegImage.length);
|
||||
setSourceImage(jpegImage, jpegImage.length);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
* <code>jpegImage</code> with the newly created instance.
|
||||
*
|
||||
* @param jpegImage JPEG image buffer
|
||||
*
|
||||
@@ -63,7 +63,7 @@ public class TJTransformer extends TJDecompressor {
|
||||
*/
|
||||
public TJTransformer(byte[] jpegImage, int imageSize) throws Exception {
|
||||
init();
|
||||
setJPEGImage(jpegImage, imageSize);
|
||||
setSourceImage(jpegImage, imageSize);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -84,13 +84,14 @@ public class TJTransformer extends TJDecompressor {
|
||||
* receive a JPEG image that has been transformed using the parameters in
|
||||
* <code>transforms[i]</code>. Use {@link TJ#bufSize} to determine the
|
||||
* maximum size for each buffer based on the transformed or cropped width and
|
||||
* height.
|
||||
* height and the level of subsampling used in the source image.
|
||||
*
|
||||
* @param transforms an array of {@link TJTransform} instances, each of
|
||||
* which specifies the transform parameters and/or cropping region for the
|
||||
* corresponding transformed output image
|
||||
*
|
||||
* @param flags the bitwise OR of one or more of {@link TJ TJ.FLAG_*}
|
||||
* @param flags the bitwise OR of one or more of
|
||||
* {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*}
|
||||
*/
|
||||
public void transform(byte[][] dstBufs, TJTransform[] transforms,
|
||||
int flags) throws Exception {
|
||||
@@ -110,9 +111,10 @@ public class TJTransformer extends TJDecompressor {
|
||||
* corresponding transformed output image
|
||||
*
|
||||
* @return an array of {@link TJDecompressor} instances, each of
|
||||
* which has a transformed JPEG image associated with it
|
||||
* which has a transformed JPEG image associated with it.
|
||||
*
|
||||
* @param flags the bitwise OR of one or more of {@link TJ TJ.FLAG_*}
|
||||
* @param flags the bitwise OR of one or more of
|
||||
* {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*}
|
||||
*/
|
||||
public TJDecompressor[] transform(TJTransform[] transforms, int flags)
|
||||
throws Exception {
|
||||
@@ -135,11 +137,11 @@ public class TJTransformer extends TJDecompressor {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an array containing the sizes of the transformed JPEG images from
|
||||
* the most recent call to {@link #transform transform()}.
|
||||
* Returns an array containing the sizes of the transformed JPEG images
|
||||
* generated by the most recent transform operation.
|
||||
*
|
||||
* @return an array containing the sizes of the transformed JPEG images from
|
||||
* the most recent call to {@link #transform transform()}
|
||||
* @return an array containing the sizes of the transformed JPEG images
|
||||
* generated by the most recent transform operation.
|
||||
*/
|
||||
public int[] getTransformedSizes() throws Exception {
|
||||
if (transformedSizes == null)
|
||||
|
||||
441
java/org/libjpegturbo/turbojpeg/YUVImage.java
Normal file
441
java/org/libjpegturbo/turbojpeg/YUVImage.java
Normal file
@@ -0,0 +1,441 @@
|
||||
/*
|
||||
* Copyright (C)2014 D. R. Commander. All Rights Reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* - Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* - Neither the name of the libjpeg-turbo Project nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from this
|
||||
* software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS",
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package org.libjpegturbo.turbojpeg;
|
||||
|
||||
/**
|
||||
* This class encapsulates a YUV planar image and the metadata
|
||||
* associated with it. The TurboJPEG API allows both the JPEG compression and
|
||||
* decompression pipelines to be split into stages: YUV encode, compress from
|
||||
* YUV, decompress to YUV, and YUV decode. A <code>YUVImage</code> instance
|
||||
* serves as the destination image for YUV encode and decompress-to-YUV
|
||||
* operations and as the source image for compress-from-YUV and YUV decode
|
||||
* operations.
|
||||
* <p>
|
||||
* Technically, the JPEG format uses the YCbCr colorspace (which technically is
|
||||
* not a "colorspace" but rather a "color transform"), but per the convention
|
||||
* of the digital video community, the TurboJPEG API uses "YUV" to refer to an
|
||||
* image format consisting of Y, Cb, and Cr image planes.
|
||||
* <p>
|
||||
* Each plane is simply a 2D array of bytes, each byte representing the value
|
||||
* of one of the components (Y, Cb, or Cr) at a particular location in the
|
||||
* image. The width and height of each plane are determined by the image
|
||||
* width, height, and level of chrominance subsampling. The luminance plane
|
||||
* width is the image width padded to the nearest multiple of the horizontal
|
||||
* subsampling factor (2 in the case of 4:2:0 and 4:2:2, 4 in the case of
|
||||
* 4:1:1, 1 in the case of 4:4:4 or grayscale.) Similarly, the luminance plane
|
||||
* height is the image height padded to the nearest multiple of the vertical
|
||||
* subsampling factor (2 in the case of 4:2:0 or 4:4:0, 1 in the case of 4:4:4
|
||||
* or grayscale.) The chrominance plane width is equal to the luminance plane
|
||||
* width divided by the horizontal subsampling factor, and the chrominance
|
||||
* plane height is equal to the luminance plane height divided by the vertical
|
||||
* subsampling factor.
|
||||
* <p>
|
||||
* For example, if the source image is 35 x 35 pixels and 4:2:2 subsampling is
|
||||
* used, then the luminance plane would be 36 x 35 bytes, and each of the
|
||||
* chrominance planes would be 18 x 35 bytes. If you specify a line padding of
|
||||
* 4 bytes on top of this, then the luminance plane would be 36 x 35 bytes, and
|
||||
* each of the chrominance planes would be 20 x 35 bytes.
|
||||
*/
|
||||
public class YUVImage {
|
||||
|
||||
private static final String NO_ASSOC_ERROR =
|
||||
"No image data is associated with this instance";
|
||||
|
||||
/**
|
||||
* Create a new <code>YUVImage</code> instance backed by separate image
|
||||
* planes, and allocate memory for the image planes.
|
||||
*
|
||||
* @param width width (in pixels) of the YUV image
|
||||
*
|
||||
* @param strides an array of integers, each specifying the number of bytes
|
||||
* per line in the corresponding plane of the YUV image. Setting the stride
|
||||
* for any plane to 0 is the same as setting it to the plane width (see
|
||||
* {@link YUVImage above}.) If <code>strides</code> is null, then the
|
||||
* 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.
|
||||
*
|
||||
* @param height height (in pixels) of the YUV image
|
||||
*
|
||||
* @param subsamp the level of chrominance subsampling to be used in the YUV
|
||||
* image (one of {@link TJ#SAMP_444 TJ.SAMP_*})
|
||||
*/
|
||||
public YUVImage(int width, int[] strides, int height, int subsamp)
|
||||
throws Exception {
|
||||
setBuf(null, null, width, strides, height, subsamp, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new <code>YUVImage</code> instance backed by a unified image
|
||||
* buffer, and allocate memory for the image buffer.
|
||||
*
|
||||
* @param width width (in pixels) of the YUV image
|
||||
*
|
||||
* @param pad Each line of each plane in the YUV image buffer will be padded
|
||||
* to this number of bytes (must be a power of 2.)
|
||||
*
|
||||
* @param height height (in pixels) of the YUV image
|
||||
*
|
||||
* @param subsamp the level of chrominance subsampling to be used in the YUV
|
||||
* image (one of {@link TJ#SAMP_444 TJ.SAMP_*})
|
||||
*/
|
||||
public YUVImage(int width, int pad, int height, int subsamp)
|
||||
throws Exception {
|
||||
setBuf(new byte[TJ.bufSizeYUV(width, pad, height, subsamp)], width, pad,
|
||||
height, subsamp);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new <code>YUVImage</code> instance from a set of existing image
|
||||
* planes.
|
||||
*
|
||||
* @param planes 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
|
||||
* planes can be contiguous or non-contiguous in memory. Plane
|
||||
* <code>i</code> should be at least <code>offsets[i] +
|
||||
* {@link TJ#planeSizeYUV TJ.planeSizeYUV}(i, width, strides[i], height, subsamp)</code>
|
||||
* bytes in size.
|
||||
*
|
||||
* @param offsets If this <code>YUVImage</code> instance represents a
|
||||
* subregion of a larger image, then <code>offsets[i]</code> specifies the
|
||||
* offset (in bytes) of the subregion within plane <code>i</code> of the
|
||||
* larger image. Setting this to null is the same as setting the offsets for
|
||||
* all planes to 0.
|
||||
*
|
||||
* @param width width (in pixels) of the new YUV image (or subregion)
|
||||
*
|
||||
* @param strides an array of integers, each specifying the number of bytes
|
||||
* per line in the corresponding plane of the YUV image. Setting the stride
|
||||
* for any plane to 0 is the same as setting it to the plane width (see
|
||||
* {@link YUVImage above}.) If <code>strides</code> is null, then the
|
||||
* strides for all planes will be set to their respective plane widths. You
|
||||
* can adjust the strides in order to add an arbitrary amount of line padding
|
||||
* 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.)
|
||||
*
|
||||
* @param height height (in pixels) of the new YUV image (or subregion)
|
||||
*
|
||||
* @param subsamp the level of chrominance subsampling used in the YUV
|
||||
* 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 {
|
||||
setBuf(planes, offsets, width, strides, height, subsamp, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new <code>YUVImage</code> instance from an existing unified image
|
||||
* buffer.
|
||||
*
|
||||
* @param yuvImage image buffer that contains or will contain YUV planar
|
||||
* image data. Use {@link TJ#bufSizeYUV} to determine the minimum size for
|
||||
* this buffer. The Y, U (Cb), and V (Cr) image planes are stored
|
||||
* sequentially in the buffer (see {@link YUVImage above} for a description
|
||||
* of the image format.)
|
||||
*
|
||||
* @param width width (in pixels) of the YUV image
|
||||
*
|
||||
* @param pad the line padding used in the YUV image buffer. For
|
||||
* instance, if each line in each plane of the buffer is padded to the
|
||||
* nearest multiple of 4 bytes, then <code>pad</code> should be set to 4.
|
||||
*
|
||||
* @param height height (in pixels) of the YUV image
|
||||
*
|
||||
* @param subsamp the level of chrominance subsampling used in the YUV
|
||||
* image (one of {@link TJ#SAMP_444 TJ.SAMP_*})
|
||||
*/
|
||||
public YUVImage(byte[] yuvImage, int width, int pad, int height,
|
||||
int subsamp) throws Exception {
|
||||
setBuf(yuvImage, width, pad, height, subsamp);
|
||||
}
|
||||
|
||||
/**
|
||||
* Assign a set of image planes to this <code>YUVImage</code> instance.
|
||||
*
|
||||
* @param planes 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
|
||||
* planes can be contiguous or non-contiguous in memory. Plane
|
||||
* <code>i</code> should be at least <code>offsets[i] +
|
||||
* {@link TJ#planeSizeYUV TJ.planeSizeYUV}(i, width, strides[i], height, subsamp)</code>
|
||||
* bytes in size.
|
||||
*
|
||||
* @param offsets If this <code>YUVImage</code> instance represents a
|
||||
* subregion of a larger image, then <code>offsets[i]</code> specifies the
|
||||
* offset (in bytes) of the subregion within plane <code>i</code> of the
|
||||
* larger image. Setting this to null is the same as setting the offsets for
|
||||
* all planes to 0.
|
||||
*
|
||||
* @param width width (in pixels) of the YUV image (or subregion)
|
||||
*
|
||||
* @param strides an array of integers, each specifying the number of bytes
|
||||
* per line in the corresponding plane of the YUV image. Setting the stride
|
||||
* for any plane to 0 is the same as setting it to the plane width (see
|
||||
* {@link YUVImage above}.) If <code>strides</code> is null, then the
|
||||
* strides for all planes will be set to their respective plane widths. You
|
||||
* can adjust the strides in order to add an arbitrary amount of line padding
|
||||
* 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.)
|
||||
*
|
||||
* @param height height (in pixels) of the YUV image (or subregion)
|
||||
*
|
||||
* @param subsamp the level of chrominance subsampling used in the YUV
|
||||
* 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 {
|
||||
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 {
|
||||
if ((planes == null && !alloc) || width < 1 || height < 1 || subsamp < 0 ||
|
||||
subsamp >= TJ.NUMSAMP)
|
||||
throw new Exception("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");
|
||||
|
||||
if (offsets == null)
|
||||
offsets = new int[nc];
|
||||
if (strides == null)
|
||||
strides = new int[nc];
|
||||
|
||||
for (int i = 0; i < nc; i++) {
|
||||
int pw = TJ.planeWidth(i, width, subsamp);
|
||||
int ph = TJ.planeHeight(i, height, subsamp);
|
||||
int planeSize = TJ.planeSizeYUV(i, width, strides[i], height, subsamp);
|
||||
|
||||
if (strides[i] == 0)
|
||||
strides[i] = pw;
|
||||
if (alloc) {
|
||||
if (strides[i] < pw)
|
||||
throw new Exception("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()");
|
||||
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");
|
||||
if (planes[i].length < offsets[i] + planeSize)
|
||||
throw new Exception("Image plane " + i + " is not large enough");
|
||||
}
|
||||
|
||||
yuvPlanes = planes;
|
||||
yuvOffsets = offsets;
|
||||
yuvWidth = width;
|
||||
yuvStrides = strides;
|
||||
yuvHeight = height;
|
||||
yuvSubsamp = subsamp;
|
||||
}
|
||||
|
||||
/**
|
||||
* Assign a unified image buffer to this <code>YUVImage</code> instance.
|
||||
*
|
||||
* @param yuvImage image buffer that contains or will contain YUV planar
|
||||
* image data. Use {@link TJ#bufSizeYUV} to determine the minimum size for
|
||||
* this buffer. The Y, U (Cb), and V (Cr) image planes are stored
|
||||
* sequentially in the buffer (see {@link YUVImage above} for a description
|
||||
* of the image format.)
|
||||
*
|
||||
* @param width width (in pixels) of the YUV image
|
||||
*
|
||||
* @param pad the line padding used in the YUV image buffer. For
|
||||
* instance, if each line in each plane of the buffer is padded to the
|
||||
* nearest multiple of 4 bytes, then <code>pad</code> should be set to 4.
|
||||
*
|
||||
* @param height height (in pixels) of the YUV image
|
||||
*
|
||||
* @param subsamp the level of chrominance subsampling used in the YUV
|
||||
* image (one of {@link TJ#SAMP_444 TJ.SAMP_*})
|
||||
*/
|
||||
public void setBuf(byte[] yuvImage, int width, int pad, int height,
|
||||
int subsamp) throws Exception {
|
||||
if (yuvImage == null || width < 1 || pad < 1 || ((pad & (pad - 1)) != 0) ||
|
||||
height < 1 || subsamp < 0 || subsamp >= TJ.NUMSAMP)
|
||||
throw new Exception("Invalid argument in YUVImage::setBuf()");
|
||||
if (yuvImage.length < TJ.bufSizeYUV(width, pad, height, subsamp))
|
||||
throw new Exception("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];
|
||||
int[] offsets = new int[nc];
|
||||
|
||||
planes[0] = yuvImage;
|
||||
strides[0] = PAD(TJ.planeWidth(0, width, subsamp), pad);
|
||||
if (subsamp != TJ.SAMP_GRAY) {
|
||||
strides[1] = strides[2] = PAD(TJ.planeWidth(1, width, subsamp), pad);
|
||||
planes[1] = planes[2] = yuvImage;
|
||||
offsets[1] = offsets[0] +
|
||||
strides[0] * TJ.planeHeight(0, height, subsamp);
|
||||
offsets[2] = offsets[1] +
|
||||
strides[1] * TJ.planeHeight(1, height, subsamp);
|
||||
}
|
||||
|
||||
yuvPad = pad;
|
||||
setBuf(planes, offsets, width, strides, height, subsamp);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the width of the YUV image (or subregion.)
|
||||
*
|
||||
* @return the width of the YUV image (or subregion)
|
||||
*/
|
||||
public int getWidth() throws Exception {
|
||||
if (yuvWidth < 1)
|
||||
throw new Exception(NO_ASSOC_ERROR);
|
||||
return yuvWidth;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the height of the YUV image (or subregion.)
|
||||
*
|
||||
* @return the height of the YUV image (or subregion)
|
||||
*/
|
||||
public int getHeight() throws Exception {
|
||||
if (yuvHeight < 1)
|
||||
throw new Exception(NO_ASSOC_ERROR);
|
||||
return yuvHeight;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the line padding used in the YUV image buffer (if this image is
|
||||
* stored in a unified buffer rather than separate image planes.)
|
||||
*
|
||||
* @return the line padding used in the YUV image buffer
|
||||
*/
|
||||
public int getPad() throws Exception {
|
||||
if (yuvPlanes == null)
|
||||
throw new Exception(NO_ASSOC_ERROR);
|
||||
if (yuvPad < 1 || ((yuvPad & (yuvPad - 1)) != 0))
|
||||
throw new Exception("Image is not stored in a unified buffer");
|
||||
return yuvPad;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the number of bytes per line of each plane in the YUV image.
|
||||
*
|
||||
* @return the number of bytes per line of each plane in the YUV image
|
||||
*/
|
||||
public int[] getStrides() throws Exception {
|
||||
if (yuvStrides == null)
|
||||
throw new Exception(NO_ASSOC_ERROR);
|
||||
return yuvStrides;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the offsets (in bytes) of each plane within the planes of a larger
|
||||
* YUV image.
|
||||
*
|
||||
* @return the offsets (in bytes) of each plane within the planes of a larger
|
||||
* YUV image
|
||||
*/
|
||||
public int[] getOffsets() throws Exception {
|
||||
if (yuvOffsets == null)
|
||||
throw new Exception(NO_ASSOC_ERROR);
|
||||
return yuvOffsets;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the level of chrominance subsampling used in the YUV image. See
|
||||
* {@link TJ#SAMP_444 TJ.SAMP_*}.
|
||||
*
|
||||
* @return the level of chrominance subsampling used in the YUV image
|
||||
*/
|
||||
public int getSubsamp() throws Exception {
|
||||
if (yuvSubsamp < 0 || yuvSubsamp >= TJ.NUMSAMP)
|
||||
throw new Exception(NO_ASSOC_ERROR);
|
||||
return yuvSubsamp;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the YUV image planes. If the image is stored in a unified buffer,
|
||||
* then all image planes will point to that buffer.
|
||||
*
|
||||
* @return the YUV image planes
|
||||
*/
|
||||
public byte[][] getPlanes() throws Exception {
|
||||
if (yuvPlanes == null)
|
||||
throw new Exception(NO_ASSOC_ERROR);
|
||||
return yuvPlanes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the YUV image buffer (if this image is stored in a unified
|
||||
* buffer rather than separate image planes.)
|
||||
*
|
||||
* @return the YUV image buffer
|
||||
*/
|
||||
public byte[] getBuf() throws Exception {
|
||||
if (yuvPlanes == null || yuvSubsamp < 0 || yuvSubsamp >= TJ.NUMSAMP)
|
||||
throw new Exception(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");
|
||||
}
|
||||
return yuvPlanes[0];
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the size (in bytes) of the YUV image buffer (if this image is
|
||||
* stored in a unified buffer rather than separate image planes.)
|
||||
*
|
||||
* @return the size (in bytes) of the YUV image buffer
|
||||
*/
|
||||
public int getSize() throws Exception {
|
||||
if (yuvPlanes == null || yuvSubsamp < 0 || yuvSubsamp >= TJ.NUMSAMP)
|
||||
throw new Exception(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");
|
||||
for (int i = 1; i < nc; i++) {
|
||||
if (yuvPlanes[i] != yuvPlanes[0])
|
||||
throw new Exception("Image is not stored in a unified buffer");
|
||||
}
|
||||
return TJ.bufSizeYUV(yuvWidth, yuvPad, yuvHeight, yuvSubsamp);
|
||||
}
|
||||
|
||||
private static final int PAD(int v, int p) {
|
||||
return (v + p - 1) & (~(p - 1));
|
||||
}
|
||||
|
||||
protected long handle = 0;
|
||||
protected byte[][] yuvPlanes = null;
|
||||
protected int[] yuvOffsets = null;
|
||||
protected int[] yuvStrides = null;
|
||||
protected int yuvPad = 0;
|
||||
protected int yuvWidth = 0;
|
||||
protected int yuvHeight = 0;
|
||||
protected int yuvSubsamp = -1;
|
||||
};
|
||||
@@ -91,6 +91,30 @@ JNIEXPORT jint JNICALL Java_org_libjpegturbo_turbojpeg_TJ_bufSizeYUV__IIII
|
||||
JNIEXPORT jint JNICALL Java_org_libjpegturbo_turbojpeg_TJ_bufSizeYUV__III
|
||||
(JNIEnv *, jclass, jint, jint, jint);
|
||||
|
||||
/*
|
||||
* Class: org_libjpegturbo_turbojpeg_TJ
|
||||
* Method: planeSizeYUV
|
||||
* Signature: (IIIII)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_org_libjpegturbo_turbojpeg_TJ_planeSizeYUV__IIIII
|
||||
(JNIEnv *, jclass, jint, jint, jint, jint, jint);
|
||||
|
||||
/*
|
||||
* Class: org_libjpegturbo_turbojpeg_TJ
|
||||
* Method: planeWidth
|
||||
* Signature: (III)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_org_libjpegturbo_turbojpeg_TJ_planeWidth__III
|
||||
(JNIEnv *, jclass, jint, jint, jint);
|
||||
|
||||
/*
|
||||
* Class: org_libjpegturbo_turbojpeg_TJ
|
||||
* Method: planeHeight
|
||||
* Signature: (III)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_org_libjpegturbo_turbojpeg_TJ_planeHeight__III
|
||||
(JNIEnv *, jclass, jint, jint, jint);
|
||||
|
||||
/*
|
||||
* Class: org_libjpegturbo_turbojpeg_TJ
|
||||
* Method: getScalingFactors
|
||||
|
||||
@@ -58,10 +58,10 @@ JNIEXPORT jint JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_compress___3
|
||||
/*
|
||||
* Class: org_libjpegturbo_turbojpeg_TJCompressor
|
||||
* Method: compressFromYUV
|
||||
* Signature: ([BIIII[BII)I
|
||||
* Signature: ([[B[II[III[BII)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_compressFromYUV___3BIIII_3BII
|
||||
(JNIEnv *, jobject, jbyteArray, jint, jint, jint, jint, jbyteArray, jint, jint);
|
||||
JNIEXPORT jint JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_compressFromYUV___3_3B_3II_3III_3BII
|
||||
(JNIEnv *, jobject, jobjectArray, jintArray, jint, jintArray, jint, jint, jbyteArray, jint, jint);
|
||||
|
||||
/*
|
||||
* Class: org_libjpegturbo_turbojpeg_TJCompressor
|
||||
@@ -74,10 +74,10 @@ JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_encodeYUV___
|
||||
/*
|
||||
* Class: org_libjpegturbo_turbojpeg_TJCompressor
|
||||
* Method: encodeYUV
|
||||
* Signature: ([BIIII[BIII)V
|
||||
* Signature: ([BIIIIII[[B[I[III)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_encodeYUV___3BIIII_3BIII
|
||||
(JNIEnv *, jobject, jbyteArray, jint, jint, jint, jint, jbyteArray, jint, jint, jint);
|
||||
JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_encodeYUV___3BIIIIII_3_3B_3I_3III
|
||||
(JNIEnv *, jobject, jbyteArray, jint, jint, jint, jint, jint, jint, jobjectArray, jintArray, jintArray, jint, jint);
|
||||
|
||||
/*
|
||||
* Class: org_libjpegturbo_turbojpeg_TJCompressor
|
||||
@@ -90,10 +90,10 @@ JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_encodeYUV___
|
||||
/*
|
||||
* Class: org_libjpegturbo_turbojpeg_TJCompressor
|
||||
* Method: encodeYUV
|
||||
* Signature: ([IIIII[BIII)V
|
||||
* Signature: ([IIIIIII[[B[I[III)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_encodeYUV___3IIIII_3BIII
|
||||
(JNIEnv *, jobject, jintArray, jint, jint, jint, jint, jbyteArray, jint, jint, jint);
|
||||
JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_encodeYUV___3IIIIIII_3_3B_3I_3III
|
||||
(JNIEnv *, jobject, jintArray, jint, jint, jint, jint, jint, jint, jobjectArray, jintArray, jintArray, jint, jint);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -74,10 +74,26 @@ JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompress
|
||||
/*
|
||||
* Class: org_libjpegturbo_turbojpeg_TJDecompressor
|
||||
* Method: decompressToYUV
|
||||
* Signature: ([BI[BIIII)V
|
||||
* Signature: ([BI[[B[II[III)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompressToYUV___3BI_3BIIII
|
||||
(JNIEnv *, jobject, jbyteArray, jint, jbyteArray, jint, jint, jint, jint);
|
||||
JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompressToYUV___3BI_3_3B_3II_3III
|
||||
(JNIEnv *, jobject, jbyteArray, jint, jobjectArray, jintArray, jint, jintArray, jint, jint);
|
||||
|
||||
/*
|
||||
* Class: org_libjpegturbo_turbojpeg_TJDecompressor
|
||||
* Method: decodeYUV
|
||||
* Signature: ([[B[I[II[BIIIIIII)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJDecompressor_decodeYUV___3_3B_3I_3II_3BIIIIIII
|
||||
(JNIEnv *, jobject, jobjectArray, jintArray, jintArray, jint, jbyteArray, jint, jint, jint, jint, jint, jint, jint);
|
||||
|
||||
/*
|
||||
* Class: org_libjpegturbo_turbojpeg_TJDecompressor
|
||||
* Method: decodeYUV
|
||||
* Signature: ([[B[I[II[IIIIIIII)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJDecompressor_decodeYUV___3_3B_3I_3II_3IIIIIIII
|
||||
(JNIEnv *, jobject, jobjectArray, jintArray, jintArray, jint, jintArray, jint, jint, jint, jint, jint, jint, jint);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
56
jcapimin.c
56
jcapimin.c
@@ -1,9 +1,11 @@
|
||||
/*
|
||||
* jcapimin.c
|
||||
*
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1994-1998, Thomas G. Lane.
|
||||
* Modified 2003-2010 by Guido Vollbeding.
|
||||
* This file is part of the Independent JPEG Group's software.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2014, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README file.
|
||||
*
|
||||
* This file contains application interface code for the compression half
|
||||
@@ -20,6 +22,8 @@
|
||||
#define JPEG_INTERNALS
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
#include "jmemsys.h"
|
||||
#include "jcmaster.h"
|
||||
|
||||
|
||||
/*
|
||||
@@ -33,12 +37,12 @@ jpeg_CreateCompress (j_compress_ptr cinfo, int version, size_t structsize)
|
||||
int i;
|
||||
|
||||
/* Guard against version mismatches between library and caller. */
|
||||
cinfo->mem = NULL; /* so jpeg_destroy knows mem mgr not called */
|
||||
cinfo->mem = NULL; /* so jpeg_destroy knows mem mgr not called */
|
||||
if (version != JPEG_LIB_VERSION)
|
||||
ERREXIT2(cinfo, JERR_BAD_LIB_VERSION, JPEG_LIB_VERSION, version);
|
||||
if (structsize != SIZEOF(struct jpeg_compress_struct))
|
||||
if (structsize != sizeof(struct jpeg_compress_struct))
|
||||
ERREXIT2(cinfo, JERR_BAD_STRUCT_SIZE,
|
||||
(int) SIZEOF(struct jpeg_compress_struct), (int) structsize);
|
||||
(int) sizeof(struct jpeg_compress_struct), (int) structsize);
|
||||
|
||||
/* For debugging purposes, we zero the whole master structure.
|
||||
* But the application has already set the err pointer, and may have set
|
||||
@@ -49,7 +53,7 @@ jpeg_CreateCompress (j_compress_ptr cinfo, int version, size_t structsize)
|
||||
{
|
||||
struct jpeg_error_mgr * err = cinfo->err;
|
||||
void * client_data = cinfo->client_data; /* ignore Purify complaint here */
|
||||
MEMZERO(cinfo, SIZEOF(struct jpeg_compress_struct));
|
||||
MEMZERO(cinfo, sizeof(struct jpeg_compress_struct));
|
||||
cinfo->err = err;
|
||||
cinfo->client_data = client_data;
|
||||
}
|
||||
@@ -85,10 +89,20 @@ jpeg_CreateCompress (j_compress_ptr cinfo, int version, size_t structsize)
|
||||
|
||||
cinfo->script_space = NULL;
|
||||
|
||||
cinfo->input_gamma = 1.0; /* in case application forgets */
|
||||
cinfo->input_gamma = 1.0; /* in case application forgets */
|
||||
|
||||
/* OK, I'm ready */
|
||||
cinfo->global_state = CSTATE_START;
|
||||
|
||||
/* The master struct is used to store extension parameters, so we allocate it
|
||||
* here. It is later reallocated by jinit_c_master_control().
|
||||
*/
|
||||
cinfo->master = (struct jpeg_comp_master *)
|
||||
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
|
||||
sizeof(my_comp_master));
|
||||
MEMZERO(cinfo->master, sizeof(my_comp_master));
|
||||
|
||||
cinfo->master->compress_profile = JCP_MAX_COMPRESSION;
|
||||
}
|
||||
|
||||
|
||||
@@ -173,15 +187,15 @@ jpeg_finish_compress (j_compress_ptr cinfo)
|
||||
(*cinfo->master->prepare_for_pass) (cinfo);
|
||||
for (iMCU_row = 0; iMCU_row < cinfo->total_iMCU_rows; iMCU_row++) {
|
||||
if (cinfo->progress != NULL) {
|
||||
cinfo->progress->pass_counter = (long) iMCU_row;
|
||||
cinfo->progress->pass_limit = (long) cinfo->total_iMCU_rows;
|
||||
(*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo);
|
||||
cinfo->progress->pass_counter = (long) iMCU_row;
|
||||
cinfo->progress->pass_limit = (long) cinfo->total_iMCU_rows;
|
||||
(*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo);
|
||||
}
|
||||
/* We bypass the main controller and invoke coef controller directly;
|
||||
* all work is being done from the coefficient buffer.
|
||||
*/
|
||||
if (! (*cinfo->coef->compress_data) (cinfo, (JSAMPIMAGE) NULL))
|
||||
ERREXIT(cinfo, JERR_CANT_SUSPEND);
|
||||
ERREXIT(cinfo, JERR_CANT_SUSPEND);
|
||||
}
|
||||
(*cinfo->master->finish_pass) (cinfo);
|
||||
}
|
||||
@@ -202,9 +216,9 @@ jpeg_finish_compress (j_compress_ptr cinfo)
|
||||
|
||||
GLOBAL(void)
|
||||
jpeg_write_marker (j_compress_ptr cinfo, int marker,
|
||||
const JOCTET *dataptr, unsigned int datalen)
|
||||
const JOCTET *dataptr, unsigned int datalen)
|
||||
{
|
||||
JMETHOD(void, write_marker_byte, (j_compress_ptr info, int val));
|
||||
void (*write_marker_byte) (j_compress_ptr info, int val);
|
||||
|
||||
if (cinfo->next_scanline != 0 ||
|
||||
(cinfo->global_state != CSTATE_SCANNING &&
|
||||
@@ -213,7 +227,7 @@ jpeg_write_marker (j_compress_ptr cinfo, int marker,
|
||||
ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
|
||||
|
||||
(*cinfo->marker->write_marker_header) (cinfo, marker, datalen);
|
||||
write_marker_byte = cinfo->marker->write_marker_byte; /* copy for speed */
|
||||
write_marker_byte = cinfo->marker->write_marker_byte; /* copy for speed */
|
||||
while (datalen--) {
|
||||
(*write_marker_byte) (cinfo, *dataptr);
|
||||
dataptr++;
|
||||
@@ -248,14 +262,14 @@ jpeg_write_m_byte (j_compress_ptr cinfo, int val)
|
||||
* To produce a pair of files containing abbreviated tables and abbreviated
|
||||
* image data, one would proceed as follows:
|
||||
*
|
||||
* initialize JPEG object
|
||||
* set JPEG parameters
|
||||
* set destination to table file
|
||||
* jpeg_write_tables(cinfo);
|
||||
* set destination to image file
|
||||
* jpeg_start_compress(cinfo, FALSE);
|
||||
* write data...
|
||||
* jpeg_finish_compress(cinfo);
|
||||
* initialize JPEG object
|
||||
* set JPEG parameters
|
||||
* set destination to table file
|
||||
* jpeg_write_tables(cinfo);
|
||||
* set destination to image file
|
||||
* jpeg_start_compress(cinfo, FALSE);
|
||||
* write data...
|
||||
* jpeg_finish_compress(cinfo);
|
||||
*
|
||||
* jpeg_write_tables has the side effect of marking all tables written
|
||||
* (same as jpeg_suppress_tables(..., TRUE)). Thus a subsequent start_compress
|
||||
|
||||
11
jcapistd.c
11
jcapistd.c
@@ -43,11 +43,12 @@ jpeg_start_compress (j_compress_ptr cinfo, boolean write_all_tables)
|
||||
ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
|
||||
|
||||
if (write_all_tables)
|
||||
jpeg_suppress_tables(cinfo, FALSE); /* mark all tables to be written */
|
||||
jpeg_suppress_tables(cinfo, FALSE); /* mark all tables to be written */
|
||||
|
||||
/* setting up scan optimisation pattern failed, disable scan optimisation */
|
||||
if (cinfo->num_scans_luma == 0)
|
||||
cinfo->optimize_scans = FALSE;
|
||||
if (cinfo->master->num_scans_luma == 0 || cinfo->scan_info == NULL ||
|
||||
cinfo->num_scans == 0)
|
||||
cinfo->master->optimize_scans = FALSE;
|
||||
|
||||
/* (Re)initialize error mgr and destination modules */
|
||||
(*cinfo->err->reset_error_mgr) ((j_common_ptr) cinfo);
|
||||
@@ -81,7 +82,7 @@ jpeg_start_compress (j_compress_ptr cinfo, boolean write_all_tables)
|
||||
|
||||
GLOBAL(JDIMENSION)
|
||||
jpeg_write_scanlines (j_compress_ptr cinfo, JSAMPARRAY scanlines,
|
||||
JDIMENSION num_lines)
|
||||
JDIMENSION num_lines)
|
||||
{
|
||||
JDIMENSION row_ctr, rows_left;
|
||||
|
||||
@@ -124,7 +125,7 @@ jpeg_write_scanlines (j_compress_ptr cinfo, JSAMPARRAY scanlines,
|
||||
|
||||
GLOBAL(JDIMENSION)
|
||||
jpeg_write_raw_data (j_compress_ptr cinfo, JSAMPIMAGE data,
|
||||
JDIMENSION num_lines)
|
||||
JDIMENSION num_lines)
|
||||
{
|
||||
JDIMENSION lines_per_iMCU_row;
|
||||
|
||||
|
||||
398
jcarith.c
398
jcarith.c
@@ -1,8 +1,10 @@
|
||||
/*
|
||||
* jcarith.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.
|
||||
* 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.
|
||||
*
|
||||
* This file contains portable arithmetic entropy encoding routines for JPEG
|
||||
@@ -16,7 +18,7 @@
|
||||
#define JPEG_INTERNALS
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
|
||||
#include <math.h>
|
||||
|
||||
/* Expanded entropy encoder object for arithmetic encoding. */
|
||||
|
||||
@@ -34,8 +36,8 @@ typedef struct {
|
||||
int last_dc_val[MAX_COMPS_IN_SCAN]; /* last DC coef for each component */
|
||||
int dc_context[MAX_COMPS_IN_SCAN]; /* context index for DC conditioning */
|
||||
|
||||
unsigned int restarts_to_go; /* MCUs left in this restart interval */
|
||||
int next_restart_num; /* next restart number to write (0-7) */
|
||||
unsigned int restarts_to_go; /* MCUs left in this restart interval */
|
||||
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];
|
||||
@@ -101,14 +103,14 @@ typedef arith_entropy_encoder * arith_entropy_ptr;
|
||||
*/
|
||||
|
||||
#ifdef RIGHT_SHIFT_IS_UNSIGNED
|
||||
#define ISHIFT_TEMPS int ishift_temp;
|
||||
#define ISHIFT_TEMPS int ishift_temp;
|
||||
#define IRIGHT_SHIFT(x,shft) \
|
||||
((ishift_temp = (x)) < 0 ? \
|
||||
(ishift_temp >> (shft)) | ((~0) << (16-(shft))) : \
|
||||
(ishift_temp >> (shft)))
|
||||
((ishift_temp = (x)) < 0 ? \
|
||||
(ishift_temp >> (shft)) | ((~0) << (16-(shft))) : \
|
||||
(ishift_temp >> (shft)))
|
||||
#else
|
||||
#define ISHIFT_TEMPS
|
||||
#define IRIGHT_SHIFT(x,shft) ((x) >> (shft))
|
||||
#define IRIGHT_SHIFT(x,shft) ((x) >> (shft))
|
||||
#endif
|
||||
|
||||
|
||||
@@ -118,6 +120,10 @@ emit_byte (int val, j_compress_ptr cinfo)
|
||||
{
|
||||
struct jpeg_destination_mgr * dest = cinfo->dest;
|
||||
|
||||
/* Do not emit bytes during trellis passes */
|
||||
if (cinfo->master->trellis_passes)
|
||||
return;
|
||||
|
||||
*dest->next_output_byte++ = (JOCTET) val;
|
||||
if (--dest->free_in_buffer == 0)
|
||||
if (! (*dest->empty_output_buffer) (cinfo))
|
||||
@@ -149,11 +155,11 @@ finish_pass (j_compress_ptr cinfo)
|
||||
/* One final overflow has to be handled */
|
||||
if (e->buffer >= 0) {
|
||||
if (e->zc)
|
||||
do emit_byte(0x00, cinfo);
|
||||
while (--e->zc);
|
||||
do emit_byte(0x00, cinfo);
|
||||
while (--e->zc);
|
||||
emit_byte(e->buffer + 1, cinfo);
|
||||
if (e->buffer + 1 == 0xFF)
|
||||
emit_byte(0x00, cinfo);
|
||||
emit_byte(0x00, cinfo);
|
||||
}
|
||||
e->zc += e->sc; /* carry-over converts stacked 0xFF bytes to 0x00 */
|
||||
e->sc = 0;
|
||||
@@ -162,17 +168,17 @@ finish_pass (j_compress_ptr cinfo)
|
||||
++e->zc;
|
||||
else if (e->buffer >= 0) {
|
||||
if (e->zc)
|
||||
do emit_byte(0x00, cinfo);
|
||||
while (--e->zc);
|
||||
do emit_byte(0x00, cinfo);
|
||||
while (--e->zc);
|
||||
emit_byte(e->buffer, cinfo);
|
||||
}
|
||||
if (e->sc) {
|
||||
if (e->zc)
|
||||
do emit_byte(0x00, cinfo);
|
||||
while (--e->zc);
|
||||
do emit_byte(0x00, cinfo);
|
||||
while (--e->zc);
|
||||
do {
|
||||
emit_byte(0xFF, cinfo);
|
||||
emit_byte(0x00, cinfo);
|
||||
emit_byte(0xFF, cinfo);
|
||||
emit_byte(0x00, cinfo);
|
||||
} while (--e->sc);
|
||||
}
|
||||
}
|
||||
@@ -187,7 +193,7 @@ finish_pass (j_compress_ptr cinfo)
|
||||
if (e->c & 0x7F800L) {
|
||||
emit_byte((e->c >> 11) & 0xFF, cinfo);
|
||||
if (((e->c >> 11) & 0xFF) == 0xFF)
|
||||
emit_byte(0x00, cinfo);
|
||||
emit_byte(0x00, cinfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -227,9 +233,9 @@ arith_encode (j_compress_ptr cinfo, unsigned char *st, int val)
|
||||
* Qe values and probability estimation state machine
|
||||
*/
|
||||
sv = *st;
|
||||
qe = jpeg_aritab[sv & 0x7F]; /* => Qe_Value */
|
||||
nl = qe & 0xFF; qe >>= 8; /* Next_Index_LPS + Switch_MPS */
|
||||
nm = qe & 0xFF; qe >>= 8; /* Next_Index_MPS */
|
||||
qe = jpeg_aritab[sv & 0x7F]; /* => Qe_Value */
|
||||
nl = qe & 0xFF; qe >>= 8; /* Next_Index_LPS + Switch_MPS */
|
||||
nm = qe & 0xFF; qe >>= 8; /* Next_Index_MPS */
|
||||
|
||||
/* Encode & estimation procedures per sections D.1.4 & D.1.5 */
|
||||
e->a -= qe;
|
||||
@@ -243,7 +249,7 @@ arith_encode (j_compress_ptr cinfo, unsigned char *st, int val)
|
||||
e->c += e->a;
|
||||
e->a = qe;
|
||||
}
|
||||
*st = (sv & 0x80) ^ nl; /* Estimate_after_LPS */
|
||||
*st = (sv & 0x80) ^ nl; /* Estimate_after_LPS */
|
||||
} else {
|
||||
/* Encode the more probable symbol */
|
||||
if (e->a >= 0x8000L)
|
||||
@@ -255,7 +261,7 @@ arith_encode (j_compress_ptr cinfo, unsigned char *st, int val)
|
||||
e->c += e->a;
|
||||
e->a = qe;
|
||||
}
|
||||
*st = (sv & 0x80) ^ nm; /* Estimate_after_MPS */
|
||||
*st = (sv & 0x80) ^ nm; /* Estimate_after_MPS */
|
||||
}
|
||||
|
||||
/* Renormalization & data output per section D.1.6 */
|
||||
@@ -266,43 +272,43 @@ arith_encode (j_compress_ptr cinfo, unsigned char *st, int val)
|
||||
/* Another byte is ready for output */
|
||||
temp = e->c >> 19;
|
||||
if (temp > 0xFF) {
|
||||
/* Handle overflow over all stacked 0xFF bytes */
|
||||
if (e->buffer >= 0) {
|
||||
if (e->zc)
|
||||
do emit_byte(0x00, cinfo);
|
||||
while (--e->zc);
|
||||
emit_byte(e->buffer + 1, cinfo);
|
||||
if (e->buffer + 1 == 0xFF)
|
||||
emit_byte(0x00, cinfo);
|
||||
}
|
||||
e->zc += e->sc; /* carry-over converts stacked 0xFF bytes to 0x00 */
|
||||
e->sc = 0;
|
||||
/* Note: The 3 spacer bits in the C register guarantee
|
||||
* that the new buffer byte can't be 0xFF here
|
||||
* (see page 160 in the P&M JPEG book). */
|
||||
e->buffer = temp & 0xFF; /* new output byte, might overflow later */
|
||||
/* Handle overflow over all stacked 0xFF bytes */
|
||||
if (e->buffer >= 0) {
|
||||
if (e->zc)
|
||||
do emit_byte(0x00, cinfo);
|
||||
while (--e->zc);
|
||||
emit_byte(e->buffer + 1, cinfo);
|
||||
if (e->buffer + 1 == 0xFF)
|
||||
emit_byte(0x00, cinfo);
|
||||
}
|
||||
e->zc += e->sc; /* carry-over converts stacked 0xFF bytes to 0x00 */
|
||||
e->sc = 0;
|
||||
/* Note: The 3 spacer bits in the C register guarantee
|
||||
* that the new buffer byte can't be 0xFF here
|
||||
* (see page 160 in the P&M JPEG book). */
|
||||
e->buffer = temp & 0xFF; /* new output byte, might overflow later */
|
||||
} else if (temp == 0xFF) {
|
||||
++e->sc; /* stack 0xFF byte (which might overflow later) */
|
||||
++e->sc; /* stack 0xFF byte (which might overflow later) */
|
||||
} else {
|
||||
/* Output all stacked 0xFF bytes, they will not overflow any more */
|
||||
if (e->buffer == 0)
|
||||
++e->zc;
|
||||
else if (e->buffer >= 0) {
|
||||
if (e->zc)
|
||||
do emit_byte(0x00, cinfo);
|
||||
while (--e->zc);
|
||||
emit_byte(e->buffer, cinfo);
|
||||
}
|
||||
if (e->sc) {
|
||||
if (e->zc)
|
||||
do emit_byte(0x00, cinfo);
|
||||
while (--e->zc);
|
||||
do {
|
||||
emit_byte(0xFF, cinfo);
|
||||
emit_byte(0x00, cinfo);
|
||||
} while (--e->sc);
|
||||
}
|
||||
e->buffer = temp & 0xFF; /* new output byte (can still overflow) */
|
||||
/* Output all stacked 0xFF bytes, they will not overflow any more */
|
||||
if (e->buffer == 0)
|
||||
++e->zc;
|
||||
else if (e->buffer >= 0) {
|
||||
if (e->zc)
|
||||
do emit_byte(0x00, cinfo);
|
||||
while (--e->zc);
|
||||
emit_byte(e->buffer, cinfo);
|
||||
}
|
||||
if (e->sc) {
|
||||
if (e->zc)
|
||||
do emit_byte(0x00, cinfo);
|
||||
while (--e->zc);
|
||||
do {
|
||||
emit_byte(0xFF, cinfo);
|
||||
emit_byte(0x00, cinfo);
|
||||
} while (--e->sc);
|
||||
}
|
||||
e->buffer = temp & 0xFF; /* new output byte (can still overflow) */
|
||||
}
|
||||
e->c &= 0x7FFFFL;
|
||||
e->ct += 8;
|
||||
@@ -398,45 +404,45 @@ encode_mcu_DC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
|
||||
/* Figure F.4: Encode_DC_DIFF */
|
||||
if ((v = m - entropy->last_dc_val[ci]) == 0) {
|
||||
arith_encode(cinfo, st, 0);
|
||||
entropy->dc_context[ci] = 0; /* zero diff category */
|
||||
entropy->dc_context[ci] = 0; /* zero diff category */
|
||||
} else {
|
||||
entropy->last_dc_val[ci] = m;
|
||||
arith_encode(cinfo, st, 1);
|
||||
/* Figure F.6: Encoding nonzero value v */
|
||||
/* Figure F.7: Encoding the sign of v */
|
||||
if (v > 0) {
|
||||
arith_encode(cinfo, st + 1, 0); /* Table F.4: SS = S0 + 1 */
|
||||
st += 2; /* Table F.4: SP = S0 + 2 */
|
||||
entropy->dc_context[ci] = 4; /* small positive diff category */
|
||||
arith_encode(cinfo, st + 1, 0); /* Table F.4: SS = S0 + 1 */
|
||||
st += 2; /* Table F.4: SP = S0 + 2 */
|
||||
entropy->dc_context[ci] = 4; /* small positive diff category */
|
||||
} else {
|
||||
v = -v;
|
||||
arith_encode(cinfo, st + 1, 1); /* Table F.4: SS = S0 + 1 */
|
||||
st += 3; /* Table F.4: SN = S0 + 3 */
|
||||
entropy->dc_context[ci] = 8; /* small negative diff category */
|
||||
v = -v;
|
||||
arith_encode(cinfo, st + 1, 1); /* Table F.4: SS = S0 + 1 */
|
||||
st += 3; /* Table F.4: SN = S0 + 3 */
|
||||
entropy->dc_context[ci] = 8; /* small negative diff category */
|
||||
}
|
||||
/* Figure F.8: Encoding the magnitude category of v */
|
||||
m = 0;
|
||||
if (v -= 1) {
|
||||
arith_encode(cinfo, st, 1);
|
||||
m = 1;
|
||||
v2 = v;
|
||||
st = entropy->dc_stats[tbl] + 20; /* Table F.4: X1 = 20 */
|
||||
while (v2 >>= 1) {
|
||||
arith_encode(cinfo, st, 1);
|
||||
m <<= 1;
|
||||
st += 1;
|
||||
}
|
||||
arith_encode(cinfo, st, 1);
|
||||
m = 1;
|
||||
v2 = v;
|
||||
st = entropy->dc_stats[tbl] + 20; /* Table F.4: X1 = 20 */
|
||||
while (v2 >>= 1) {
|
||||
arith_encode(cinfo, st, 1);
|
||||
m <<= 1;
|
||||
st += 1;
|
||||
}
|
||||
}
|
||||
arith_encode(cinfo, st, 0);
|
||||
/* Section F.1.4.4.1.2: Establish dc_context conditioning category */
|
||||
if (m < (int) ((1L << cinfo->arith_dc_L[tbl]) >> 1))
|
||||
entropy->dc_context[ci] = 0; /* zero diff category */
|
||||
entropy->dc_context[ci] = 0; /* zero diff category */
|
||||
else if (m > (int) ((1L << cinfo->arith_dc_U[tbl]) >> 1))
|
||||
entropy->dc_context[ci] += 8; /* large diff category */
|
||||
entropy->dc_context[ci] += 8; /* large diff category */
|
||||
/* Figure F.9: Encoding the magnitude bit pattern of v */
|
||||
st += 14;
|
||||
while (m >>= 1)
|
||||
arith_encode(cinfo, st, (m & v) ? 1 : 0);
|
||||
arith_encode(cinfo, st, (m & v) ? 1 : 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -491,21 +497,21 @@ encode_mcu_AC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
|
||||
/* Figure F.5: Encode_AC_Coefficients */
|
||||
for (k = cinfo->Ss; k <= ke; k++) {
|
||||
st = entropy->ac_stats[tbl] + 3 * (k - 1);
|
||||
arith_encode(cinfo, st, 0); /* EOB decision */
|
||||
arith_encode(cinfo, st, 0); /* EOB decision */
|
||||
for (;;) {
|
||||
if ((v = (*block)[jpeg_natural_order[k]]) >= 0) {
|
||||
if (v >>= cinfo->Al) {
|
||||
arith_encode(cinfo, st + 1, 1);
|
||||
arith_encode(cinfo, entropy->fixed_bin, 0);
|
||||
break;
|
||||
}
|
||||
if (v >>= cinfo->Al) {
|
||||
arith_encode(cinfo, st + 1, 1);
|
||||
arith_encode(cinfo, entropy->fixed_bin, 0);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
v = -v;
|
||||
if (v >>= cinfo->Al) {
|
||||
arith_encode(cinfo, st + 1, 1);
|
||||
arith_encode(cinfo, entropy->fixed_bin, 1);
|
||||
break;
|
||||
}
|
||||
v = -v;
|
||||
if (v >>= cinfo->Al) {
|
||||
arith_encode(cinfo, st + 1, 1);
|
||||
arith_encode(cinfo, entropy->fixed_bin, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
arith_encode(cinfo, st + 1, 0); st += 3; k++;
|
||||
}
|
||||
@@ -517,15 +523,15 @@ encode_mcu_AC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
|
||||
m = 1;
|
||||
v2 = v;
|
||||
if (v2 >>= 1) {
|
||||
arith_encode(cinfo, st, 1);
|
||||
m <<= 1;
|
||||
st = entropy->ac_stats[tbl] +
|
||||
(k <= cinfo->arith_ac_K[tbl] ? 189 : 217);
|
||||
while (v2 >>= 1) {
|
||||
arith_encode(cinfo, st, 1);
|
||||
m <<= 1;
|
||||
st += 1;
|
||||
}
|
||||
arith_encode(cinfo, st, 1);
|
||||
m <<= 1;
|
||||
st = entropy->ac_stats[tbl] +
|
||||
(k <= cinfo->arith_ac_K[tbl] ? 189 : 217);
|
||||
while (v2 >>= 1) {
|
||||
arith_encode(cinfo, st, 1);
|
||||
m <<= 1;
|
||||
st += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
arith_encode(cinfo, st, 0);
|
||||
@@ -566,7 +572,7 @@ encode_mcu_DC_refine (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
|
||||
entropy->restarts_to_go--;
|
||||
}
|
||||
|
||||
st = entropy->fixed_bin; /* use fixed probability estimation */
|
||||
st = entropy->fixed_bin; /* use fixed probability estimation */
|
||||
Al = cinfo->Al;
|
||||
|
||||
/* Encode the MCU data blocks */
|
||||
@@ -635,29 +641,29 @@ encode_mcu_AC_refine (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
|
||||
for (k = cinfo->Ss; k <= ke; k++) {
|
||||
st = entropy->ac_stats[tbl] + 3 * (k - 1);
|
||||
if (k > kex)
|
||||
arith_encode(cinfo, st, 0); /* EOB decision */
|
||||
arith_encode(cinfo, st, 0); /* EOB decision */
|
||||
for (;;) {
|
||||
if ((v = (*block)[jpeg_natural_order[k]]) >= 0) {
|
||||
if (v >>= cinfo->Al) {
|
||||
if (v >> 1) /* previously nonzero coef */
|
||||
arith_encode(cinfo, st + 2, (v & 1));
|
||||
else { /* newly nonzero coef */
|
||||
arith_encode(cinfo, st + 1, 1);
|
||||
arith_encode(cinfo, entropy->fixed_bin, 0);
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (v >>= cinfo->Al) {
|
||||
if (v >> 1) /* previously nonzero coef */
|
||||
arith_encode(cinfo, st + 2, (v & 1));
|
||||
else { /* newly nonzero coef */
|
||||
arith_encode(cinfo, st + 1, 1);
|
||||
arith_encode(cinfo, entropy->fixed_bin, 0);
|
||||
}
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
v = -v;
|
||||
if (v >>= cinfo->Al) {
|
||||
if (v >> 1) /* previously nonzero coef */
|
||||
arith_encode(cinfo, st + 2, (v & 1));
|
||||
else { /* newly nonzero coef */
|
||||
arith_encode(cinfo, st + 1, 1);
|
||||
arith_encode(cinfo, entropy->fixed_bin, 1);
|
||||
}
|
||||
break;
|
||||
}
|
||||
v = -v;
|
||||
if (v >>= cinfo->Al) {
|
||||
if (v >> 1) /* previously nonzero coef */
|
||||
arith_encode(cinfo, st + 2, (v & 1));
|
||||
else { /* newly nonzero coef */
|
||||
arith_encode(cinfo, st + 1, 1);
|
||||
arith_encode(cinfo, entropy->fixed_bin, 1);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
arith_encode(cinfo, st + 1, 0); st += 3; k++;
|
||||
}
|
||||
@@ -713,45 +719,45 @@ encode_mcu (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
|
||||
/* Figure F.4: Encode_DC_DIFF */
|
||||
if ((v = (*block)[0] - entropy->last_dc_val[ci]) == 0) {
|
||||
arith_encode(cinfo, st, 0);
|
||||
entropy->dc_context[ci] = 0; /* zero diff category */
|
||||
entropy->dc_context[ci] = 0; /* zero diff category */
|
||||
} else {
|
||||
entropy->last_dc_val[ci] = (*block)[0];
|
||||
arith_encode(cinfo, st, 1);
|
||||
/* Figure F.6: Encoding nonzero value v */
|
||||
/* Figure F.7: Encoding the sign of v */
|
||||
if (v > 0) {
|
||||
arith_encode(cinfo, st + 1, 0); /* Table F.4: SS = S0 + 1 */
|
||||
st += 2; /* Table F.4: SP = S0 + 2 */
|
||||
entropy->dc_context[ci] = 4; /* small positive diff category */
|
||||
arith_encode(cinfo, st + 1, 0); /* Table F.4: SS = S0 + 1 */
|
||||
st += 2; /* Table F.4: SP = S0 + 2 */
|
||||
entropy->dc_context[ci] = 4; /* small positive diff category */
|
||||
} else {
|
||||
v = -v;
|
||||
arith_encode(cinfo, st + 1, 1); /* Table F.4: SS = S0 + 1 */
|
||||
st += 3; /* Table F.4: SN = S0 + 3 */
|
||||
entropy->dc_context[ci] = 8; /* small negative diff category */
|
||||
v = -v;
|
||||
arith_encode(cinfo, st + 1, 1); /* Table F.4: SS = S0 + 1 */
|
||||
st += 3; /* Table F.4: SN = S0 + 3 */
|
||||
entropy->dc_context[ci] = 8; /* small negative diff category */
|
||||
}
|
||||
/* Figure F.8: Encoding the magnitude category of v */
|
||||
m = 0;
|
||||
if (v -= 1) {
|
||||
arith_encode(cinfo, st, 1);
|
||||
m = 1;
|
||||
v2 = v;
|
||||
st = entropy->dc_stats[tbl] + 20; /* Table F.4: X1 = 20 */
|
||||
while (v2 >>= 1) {
|
||||
arith_encode(cinfo, st, 1);
|
||||
m <<= 1;
|
||||
st += 1;
|
||||
}
|
||||
arith_encode(cinfo, st, 1);
|
||||
m = 1;
|
||||
v2 = v;
|
||||
st = entropy->dc_stats[tbl] + 20; /* Table F.4: X1 = 20 */
|
||||
while (v2 >>= 1) {
|
||||
arith_encode(cinfo, st, 1);
|
||||
m <<= 1;
|
||||
st += 1;
|
||||
}
|
||||
}
|
||||
arith_encode(cinfo, st, 0);
|
||||
/* Section F.1.4.4.1.2: Establish dc_context conditioning category */
|
||||
if (m < (int) ((1L << cinfo->arith_dc_L[tbl]) >> 1))
|
||||
entropy->dc_context[ci] = 0; /* zero diff category */
|
||||
entropy->dc_context[ci] = 0; /* zero diff category */
|
||||
else if (m > (int) ((1L << cinfo->arith_dc_U[tbl]) >> 1))
|
||||
entropy->dc_context[ci] += 8; /* large diff category */
|
||||
entropy->dc_context[ci] += 8; /* large diff category */
|
||||
/* Figure F.9: Encoding the magnitude bit pattern of v */
|
||||
st += 14;
|
||||
while (m >>= 1)
|
||||
arith_encode(cinfo, st, (m & v) ? 1 : 0);
|
||||
arith_encode(cinfo, st, (m & v) ? 1 : 0);
|
||||
}
|
||||
|
||||
/* Sections F.1.4.2 & F.1.4.4.2: Encoding of AC coefficients */
|
||||
@@ -765,43 +771,43 @@ encode_mcu (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
|
||||
/* Figure F.5: Encode_AC_Coefficients */
|
||||
for (k = 1; k <= ke; k++) {
|
||||
st = entropy->ac_stats[tbl] + 3 * (k - 1);
|
||||
arith_encode(cinfo, st, 0); /* EOB decision */
|
||||
arith_encode(cinfo, st, 0); /* EOB decision */
|
||||
while ((v = (*block)[jpeg_natural_order[k]]) == 0) {
|
||||
arith_encode(cinfo, st + 1, 0); st += 3; k++;
|
||||
arith_encode(cinfo, st + 1, 0); st += 3; k++;
|
||||
}
|
||||
arith_encode(cinfo, st + 1, 1);
|
||||
/* Figure F.6: Encoding nonzero value v */
|
||||
/* Figure F.7: Encoding the sign of v */
|
||||
if (v > 0) {
|
||||
arith_encode(cinfo, entropy->fixed_bin, 0);
|
||||
arith_encode(cinfo, entropy->fixed_bin, 0);
|
||||
} else {
|
||||
v = -v;
|
||||
arith_encode(cinfo, entropy->fixed_bin, 1);
|
||||
v = -v;
|
||||
arith_encode(cinfo, entropy->fixed_bin, 1);
|
||||
}
|
||||
st += 2;
|
||||
/* Figure F.8: Encoding the magnitude category of v */
|
||||
m = 0;
|
||||
if (v -= 1) {
|
||||
arith_encode(cinfo, st, 1);
|
||||
m = 1;
|
||||
v2 = v;
|
||||
if (v2 >>= 1) {
|
||||
arith_encode(cinfo, st, 1);
|
||||
m <<= 1;
|
||||
st = entropy->ac_stats[tbl] +
|
||||
(k <= cinfo->arith_ac_K[tbl] ? 189 : 217);
|
||||
while (v2 >>= 1) {
|
||||
arith_encode(cinfo, st, 1);
|
||||
m <<= 1;
|
||||
st += 1;
|
||||
}
|
||||
}
|
||||
arith_encode(cinfo, st, 1);
|
||||
m = 1;
|
||||
v2 = v;
|
||||
if (v2 >>= 1) {
|
||||
arith_encode(cinfo, st, 1);
|
||||
m <<= 1;
|
||||
st = entropy->ac_stats[tbl] +
|
||||
(k <= cinfo->arith_ac_K[tbl] ? 189 : 217);
|
||||
while (v2 >>= 1) {
|
||||
arith_encode(cinfo, st, 1);
|
||||
m <<= 1;
|
||||
st += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
arith_encode(cinfo, st, 0);
|
||||
/* Figure F.9: Encoding the magnitude bit pattern of v */
|
||||
st += 14;
|
||||
while (m >>= 1)
|
||||
arith_encode(cinfo, st, (m & v) ? 1 : 0);
|
||||
arith_encode(cinfo, st, (m & v) ? 1 : 0);
|
||||
}
|
||||
/* Encode EOB decision only if k <= DCTSIZE2 - 1 */
|
||||
if (k <= DCTSIZE2 - 1) {
|
||||
@@ -824,6 +830,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;
|
||||
boolean progressive_mode;
|
||||
|
||||
if (gather_statistics)
|
||||
/* Make sure to avoid that in the master control logic!
|
||||
@@ -834,18 +841,22 @@ start_pass (j_compress_ptr cinfo, boolean gather_statistics)
|
||||
|
||||
/* We assume jcmaster.c already validated the progressive scan parameters. */
|
||||
|
||||
/* Trellis optimization does DC and AC in same pass and without refinement
|
||||
* so consider progressive mode to be off in such case */
|
||||
progressive_mode = (cinfo->master->trellis_passes) ? FALSE : cinfo->progressive_mode;
|
||||
|
||||
/* Select execution routines */
|
||||
if (cinfo->progressive_mode) {
|
||||
if (progressive_mode) {
|
||||
if (cinfo->Ah == 0) {
|
||||
if (cinfo->Ss == 0)
|
||||
entropy->pub.encode_mcu = encode_mcu_DC_first;
|
||||
entropy->pub.encode_mcu = encode_mcu_DC_first;
|
||||
else
|
||||
entropy->pub.encode_mcu = encode_mcu_AC_first;
|
||||
entropy->pub.encode_mcu = encode_mcu_AC_first;
|
||||
} else {
|
||||
if (cinfo->Ss == 0)
|
||||
entropy->pub.encode_mcu = encode_mcu_DC_refine;
|
||||
entropy->pub.encode_mcu = encode_mcu_DC_refine;
|
||||
else
|
||||
entropy->pub.encode_mcu = encode_mcu_AC_refine;
|
||||
entropy->pub.encode_mcu = encode_mcu_AC_refine;
|
||||
}
|
||||
} else
|
||||
entropy->pub.encode_mcu = encode_mcu;
|
||||
@@ -854,31 +865,31 @@ start_pass (j_compress_ptr cinfo, boolean gather_statistics)
|
||||
for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
|
||||
compptr = cinfo->cur_comp_info[ci];
|
||||
/* DC needs no table for refinement scan */
|
||||
if (cinfo->progressive_mode == 0 || (cinfo->Ss == 0 && cinfo->Ah == 0)) {
|
||||
if (progressive_mode == 0 || (cinfo->Ss == 0 && cinfo->Ah == 0)) {
|
||||
tbl = compptr->dc_tbl_no;
|
||||
if (tbl < 0 || tbl >= NUM_ARITH_TBLS)
|
||||
ERREXIT1(cinfo, JERR_NO_ARITH_TABLE, tbl);
|
||||
ERREXIT1(cinfo, JERR_NO_ARITH_TABLE, tbl);
|
||||
if (entropy->dc_stats[tbl] == NULL)
|
||||
entropy->dc_stats[tbl] = (unsigned char *) (*cinfo->mem->alloc_small)
|
||||
((j_common_ptr) cinfo, JPOOL_IMAGE, DC_STAT_BINS);
|
||||
entropy->dc_stats[tbl] = (unsigned char *) (*cinfo->mem->alloc_small)
|
||||
((j_common_ptr) cinfo, JPOOL_IMAGE, DC_STAT_BINS);
|
||||
MEMZERO(entropy->dc_stats[tbl], DC_STAT_BINS);
|
||||
/* Initialize DC predictions to 0 */
|
||||
entropy->last_dc_val[ci] = 0;
|
||||
entropy->dc_context[ci] = 0;
|
||||
}
|
||||
/* AC needs no table when not present */
|
||||
if (cinfo->progressive_mode == 0 || cinfo->Se) {
|
||||
if (progressive_mode == 0 || cinfo->Se) {
|
||||
tbl = compptr->ac_tbl_no;
|
||||
if (tbl < 0 || tbl >= NUM_ARITH_TBLS)
|
||||
ERREXIT1(cinfo, JERR_NO_ARITH_TABLE, tbl);
|
||||
ERREXIT1(cinfo, JERR_NO_ARITH_TABLE, tbl);
|
||||
if (entropy->ac_stats[tbl] == NULL)
|
||||
entropy->ac_stats[tbl] = (unsigned char *) (*cinfo->mem->alloc_small)
|
||||
((j_common_ptr) cinfo, JPOOL_IMAGE, AC_STAT_BINS);
|
||||
entropy->ac_stats[tbl] = (unsigned char *) (*cinfo->mem->alloc_small)
|
||||
((j_common_ptr) cinfo, JPOOL_IMAGE, AC_STAT_BINS);
|
||||
MEMZERO(entropy->ac_stats[tbl], AC_STAT_BINS);
|
||||
#ifdef CALCULATE_SPECTRAL_CONDITIONING
|
||||
if (cinfo->progressive_mode)
|
||||
/* Section G.1.3.2: Set appropriate arithmetic conditioning value Kx */
|
||||
cinfo->arith_ac_K[tbl] = cinfo->Ss + ((8 + cinfo->Se - cinfo->Ss) >> 4);
|
||||
if (progressive_mode)
|
||||
/* Section G.1.3.2: Set appropriate arithmetic conditioning value Kx */
|
||||
cinfo->arith_ac_K[tbl] = cinfo->Ss + ((8 + cinfo->Se - cinfo->Ss) >> 4);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -909,7 +920,7 @@ jinit_arith_encoder (j_compress_ptr cinfo)
|
||||
|
||||
entropy = (arith_entropy_ptr)
|
||||
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
|
||||
SIZEOF(arith_entropy_encoder));
|
||||
sizeof(arith_entropy_encoder));
|
||||
cinfo->entropy = (struct jpeg_entropy_encoder *) entropy;
|
||||
entropy->pub.start_pass = start_pass;
|
||||
entropy->pub.finish_pass = finish_pass;
|
||||
@@ -923,3 +934,34 @@ jinit_arith_encoder (j_compress_ptr cinfo)
|
||||
/* Initialize index for fixed probability estimation */
|
||||
entropy->fixed_bin[0] = 113;
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jget_arith_rates (j_compress_ptr cinfo, int dc_tbl_no, int ac_tbl_no, arith_rates *r)
|
||||
{
|
||||
int i;
|
||||
arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;
|
||||
|
||||
r->arith_dc_L = cinfo->arith_dc_L[dc_tbl_no];
|
||||
r->arith_dc_U = cinfo->arith_dc_U[dc_tbl_no];
|
||||
r->arith_ac_K = cinfo->arith_ac_K[ac_tbl_no];
|
||||
|
||||
for (i = 0; i < DC_STAT_BINS; i++) {
|
||||
int state = entropy->dc_stats[dc_tbl_no][i];
|
||||
int mps_val = state >> 7;
|
||||
float prob_lps = (jpeg_aritab[state & 0x7f] >> 16) / 46340.95; /* 32768*sqrt(2) */
|
||||
float prob_0 = (mps_val) ? prob_lps : 1.0 - prob_lps;
|
||||
float prob_1 = 1.0 - prob_0;
|
||||
r->rate_dc[i][0] = -log(prob_0) / log(2.0);
|
||||
r->rate_dc[i][1] = -log(prob_1) / log(2.0);
|
||||
}
|
||||
|
||||
for (i = 0; i < AC_STAT_BINS; i++) {
|
||||
int state = entropy->ac_stats[ac_tbl_no][i];
|
||||
int mps_val = state >> 7;
|
||||
float prob_lps = (jpeg_aritab[state & 0x7f] >> 16) / 46340.95;
|
||||
float prob_0 = (mps_val) ? prob_lps : 1.0 - prob_lps;
|
||||
float prob_1 = 1.0 - prob_0;
|
||||
r->rate_ac[i][0] = -log(prob_0) / log(2.0);
|
||||
r->rate_ac[i][1] = -log(prob_1) / log(2.0);
|
||||
}
|
||||
}
|
||||
|
||||
281
jccoefct.c
281
jccoefct.c
@@ -1,10 +1,12 @@
|
||||
/*
|
||||
* jccoefct.c
|
||||
*
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* 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.
|
||||
* mozjpeg Modifications:
|
||||
* Copyright (C) 2014, Mozilla Corporation.
|
||||
* This file is part of the Independent JPEG Group's software.
|
||||
* For conditions of distribution and use, see the accompanying README file.
|
||||
*
|
||||
* This file contains the coefficient buffer controller for compression.
|
||||
@@ -36,19 +38,16 @@
|
||||
typedef struct {
|
||||
struct jpeg_c_coef_controller pub; /* public fields */
|
||||
|
||||
JDIMENSION iMCU_row_num; /* iMCU row # within image */
|
||||
JDIMENSION mcu_ctr; /* counts MCUs processed in current row */
|
||||
int MCU_vert_offset; /* counts MCU rows within iMCU row */
|
||||
int MCU_rows_per_iMCU_row; /* number of such rows needed */
|
||||
JDIMENSION iMCU_row_num; /* iMCU row # within image */
|
||||
JDIMENSION mcu_ctr; /* counts MCUs processed in current row */
|
||||
int MCU_vert_offset; /* counts MCU rows within iMCU row */
|
||||
int MCU_rows_per_iMCU_row; /* number of such rows needed */
|
||||
|
||||
/* For single-pass compression, it's sufficient to buffer just one MCU
|
||||
* (although this may prove a bit slow in practice). We allocate a
|
||||
* workspace of C_MAX_BLOCKS_IN_MCU coefficient blocks, and reuse it for each
|
||||
* MCU constructed and sent. (On 80x86, the workspace is FAR even though
|
||||
* it's not really very big; this is to keep the module interfaces unchanged
|
||||
* when a large coefficient buffer is necessary.)
|
||||
* In multi-pass modes, this array points to the current MCU's blocks
|
||||
* within the virtual arrays.
|
||||
* MCU constructed and sent. In multi-pass modes, this array points to the
|
||||
* current MCU's blocks within the virtual arrays.
|
||||
*/
|
||||
JBLOCKROW MCU_buffer[C_MAX_BLOCKS_IN_MCU];
|
||||
|
||||
@@ -65,15 +64,15 @@ typedef my_coef_controller * my_coef_ptr;
|
||||
|
||||
/* Forward declarations */
|
||||
METHODDEF(boolean) compress_data
|
||||
JPP((j_compress_ptr cinfo, JSAMPIMAGE input_buf));
|
||||
(j_compress_ptr cinfo, JSAMPIMAGE input_buf);
|
||||
#ifdef FULL_COEF_BUFFER_SUPPORTED
|
||||
METHODDEF(boolean) compress_first_pass
|
||||
JPP((j_compress_ptr cinfo, JSAMPIMAGE input_buf));
|
||||
(j_compress_ptr cinfo, JSAMPIMAGE input_buf);
|
||||
METHODDEF(boolean) compress_output
|
||||
JPP((j_compress_ptr cinfo, JSAMPIMAGE input_buf));
|
||||
(j_compress_ptr cinfo, JSAMPIMAGE input_buf);
|
||||
#endif
|
||||
METHODDEF(boolean) compress_trellis_pass
|
||||
JPP((j_compress_ptr cinfo, JSAMPIMAGE input_buf));
|
||||
(j_compress_ptr cinfo, JSAMPIMAGE input_buf);
|
||||
|
||||
|
||||
LOCAL(void)
|
||||
@@ -157,7 +156,7 @@ METHODDEF(boolean)
|
||||
compress_data (j_compress_ptr cinfo, JSAMPIMAGE input_buf)
|
||||
{
|
||||
my_coef_ptr coef = (my_coef_ptr) cinfo->coef;
|
||||
JDIMENSION MCU_col_num; /* index of current MCU within row */
|
||||
JDIMENSION MCU_col_num; /* index of current MCU within row */
|
||||
JDIMENSION last_MCU_col = cinfo->MCUs_per_row - 1;
|
||||
JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1;
|
||||
int blkn, bi, ci, yindex, yoffset, blockcnt;
|
||||
@@ -168,7 +167,7 @@ compress_data (j_compress_ptr cinfo, JSAMPIMAGE input_buf)
|
||||
for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row;
|
||||
yoffset++) {
|
||||
for (MCU_col_num = coef->mcu_ctr; MCU_col_num <= last_MCU_col;
|
||||
MCU_col_num++) {
|
||||
MCU_col_num++) {
|
||||
/* Determine where data comes from in input_buf and do the DCT thing.
|
||||
* Each call on forward_DCT processes a horizontal row of DCT blocks
|
||||
* as wide as an MCU; we rely on having allocated the MCU_buffer[] blocks
|
||||
@@ -180,46 +179,47 @@ compress_data (j_compress_ptr cinfo, JSAMPIMAGE input_buf)
|
||||
*/
|
||||
blkn = 0;
|
||||
for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
|
||||
compptr = cinfo->cur_comp_info[ci];
|
||||
blockcnt = (MCU_col_num < last_MCU_col) ? compptr->MCU_width
|
||||
: compptr->last_col_width;
|
||||
xpos = MCU_col_num * compptr->MCU_sample_width;
|
||||
ypos = yoffset * DCTSIZE; /* ypos == (yoffset+yindex) * DCTSIZE */
|
||||
for (yindex = 0; yindex < compptr->MCU_height; yindex++) {
|
||||
if (coef->iMCU_row_num < last_iMCU_row ||
|
||||
yoffset+yindex < compptr->last_row_height) {
|
||||
(*cinfo->fdct->forward_DCT) (cinfo, compptr,
|
||||
input_buf[compptr->component_index],
|
||||
coef->MCU_buffer[blkn],
|
||||
ypos, xpos, (JDIMENSION) blockcnt, NULL);
|
||||
if (blockcnt < compptr->MCU_width) {
|
||||
/* Create some dummy blocks at the right edge of the image. */
|
||||
jzero_far((void FAR *) coef->MCU_buffer[blkn + blockcnt],
|
||||
(compptr->MCU_width - blockcnt) * SIZEOF(JBLOCK));
|
||||
for (bi = blockcnt; bi < compptr->MCU_width; bi++) {
|
||||
coef->MCU_buffer[blkn+bi][0][0] = coef->MCU_buffer[blkn+bi-1][0][0];
|
||||
}
|
||||
}
|
||||
} else {
|
||||
/* Create a row of dummy blocks at the bottom of the image. */
|
||||
jzero_far((void FAR *) coef->MCU_buffer[blkn],
|
||||
compptr->MCU_width * SIZEOF(JBLOCK));
|
||||
for (bi = 0; bi < compptr->MCU_width; bi++) {
|
||||
coef->MCU_buffer[blkn+bi][0][0] = coef->MCU_buffer[blkn-1][0][0];
|
||||
}
|
||||
}
|
||||
blkn += compptr->MCU_width;
|
||||
ypos += DCTSIZE;
|
||||
}
|
||||
compptr = cinfo->cur_comp_info[ci];
|
||||
blockcnt = (MCU_col_num < last_MCU_col) ? compptr->MCU_width
|
||||
: compptr->last_col_width;
|
||||
xpos = MCU_col_num * compptr->MCU_sample_width;
|
||||
ypos = yoffset * DCTSIZE; /* ypos == (yoffset+yindex) * DCTSIZE */
|
||||
for (yindex = 0; yindex < compptr->MCU_height; yindex++) {
|
||||
if (coef->iMCU_row_num < last_iMCU_row ||
|
||||
yoffset+yindex < compptr->last_row_height) {
|
||||
(*cinfo->fdct->forward_DCT) (cinfo, compptr,
|
||||
input_buf[compptr->component_index],
|
||||
coef->MCU_buffer[blkn],
|
||||
ypos, xpos, (JDIMENSION) blockcnt,
|
||||
NULL);
|
||||
if (blockcnt < compptr->MCU_width) {
|
||||
/* Create some dummy blocks at the right edge of the image. */
|
||||
jzero_far((void *) coef->MCU_buffer[blkn + blockcnt],
|
||||
(compptr->MCU_width - blockcnt) * sizeof(JBLOCK));
|
||||
for (bi = blockcnt; bi < compptr->MCU_width; bi++) {
|
||||
coef->MCU_buffer[blkn+bi][0][0] = coef->MCU_buffer[blkn+bi-1][0][0];
|
||||
}
|
||||
}
|
||||
} else {
|
||||
/* Create a row of dummy blocks at the bottom of the image. */
|
||||
jzero_far((void *) coef->MCU_buffer[blkn],
|
||||
compptr->MCU_width * sizeof(JBLOCK));
|
||||
for (bi = 0; bi < compptr->MCU_width; bi++) {
|
||||
coef->MCU_buffer[blkn+bi][0][0] = coef->MCU_buffer[blkn-1][0][0];
|
||||
}
|
||||
}
|
||||
blkn += compptr->MCU_width;
|
||||
ypos += DCTSIZE;
|
||||
}
|
||||
}
|
||||
/* Try to write the MCU. In event of a suspension failure, we will
|
||||
* re-DCT the MCU on restart (a bit inefficient, could be fixed...)
|
||||
*/
|
||||
if (! (*cinfo->entropy->encode_mcu) (cinfo, coef->MCU_buffer)) {
|
||||
/* Suspension forced; update state counters and exit */
|
||||
coef->MCU_vert_offset = yoffset;
|
||||
coef->mcu_ctr = MCU_col_num;
|
||||
return FALSE;
|
||||
/* Suspension forced; update state counters and exit */
|
||||
coef->MCU_vert_offset = yoffset;
|
||||
coef->mcu_ctr = MCU_col_num;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
/* Completed an MCU row, but perhaps not an iMCU row */
|
||||
@@ -301,17 +301,18 @@ compress_first_pass (j_compress_ptr cinfo, JSAMPIMAGE input_buf)
|
||||
for (block_row = 0; block_row < block_rows; block_row++) {
|
||||
thisblockrow = buffer[block_row];
|
||||
(*cinfo->fdct->forward_DCT) (cinfo, compptr,
|
||||
input_buf[ci], thisblockrow,
|
||||
(JDIMENSION) (block_row * DCTSIZE),
|
||||
(JDIMENSION) 0, blocks_across, buffer_dst[block_row]);
|
||||
input_buf[ci], thisblockrow,
|
||||
(JDIMENSION) (block_row * DCTSIZE),
|
||||
(JDIMENSION) 0, blocks_across,
|
||||
buffer_dst[block_row]);
|
||||
if (ndummy > 0) {
|
||||
/* Create dummy blocks at the right edge of the image. */
|
||||
thisblockrow += blocks_across; /* => first dummy block */
|
||||
jzero_far((void FAR *) thisblockrow, ndummy * SIZEOF(JBLOCK));
|
||||
lastDC = thisblockrow[-1][0];
|
||||
for (bi = 0; bi < ndummy; bi++) {
|
||||
thisblockrow[bi][0] = lastDC;
|
||||
}
|
||||
/* Create dummy blocks at the right edge of the image. */
|
||||
thisblockrow += blocks_across; /* => first dummy block */
|
||||
jzero_far((void *) thisblockrow, ndummy * sizeof(JBLOCK));
|
||||
lastDC = thisblockrow[-1][0];
|
||||
for (bi = 0; bi < ndummy; bi++) {
|
||||
thisblockrow[bi][0] = lastDC;
|
||||
}
|
||||
}
|
||||
}
|
||||
/* If at end of image, create dummy block rows as needed.
|
||||
@@ -320,22 +321,22 @@ compress_first_pass (j_compress_ptr cinfo, JSAMPIMAGE input_buf)
|
||||
* This squeezes a few more bytes out of the resulting file...
|
||||
*/
|
||||
if (coef->iMCU_row_num == last_iMCU_row) {
|
||||
blocks_across += ndummy; /* include lower right corner */
|
||||
blocks_across += ndummy; /* include lower right corner */
|
||||
MCUs_across = blocks_across / h_samp_factor;
|
||||
for (block_row = block_rows; block_row < compptr->v_samp_factor;
|
||||
block_row++) {
|
||||
thisblockrow = buffer[block_row];
|
||||
lastblockrow = buffer[block_row-1];
|
||||
jzero_far((void FAR *) thisblockrow,
|
||||
(size_t) (blocks_across * SIZEOF(JBLOCK)));
|
||||
for (MCUindex = 0; MCUindex < MCUs_across; MCUindex++) {
|
||||
lastDC = lastblockrow[h_samp_factor-1][0];
|
||||
for (bi = 0; bi < h_samp_factor; bi++) {
|
||||
thisblockrow[bi][0] = lastDC;
|
||||
}
|
||||
thisblockrow += h_samp_factor; /* advance to next MCU in row */
|
||||
lastblockrow += h_samp_factor;
|
||||
}
|
||||
block_row++) {
|
||||
thisblockrow = buffer[block_row];
|
||||
lastblockrow = buffer[block_row-1];
|
||||
jzero_far((void *) thisblockrow,
|
||||
(size_t) (blocks_across * sizeof(JBLOCK)));
|
||||
for (MCUindex = 0; MCUindex < MCUs_across; MCUindex++) {
|
||||
lastDC = lastblockrow[h_samp_factor-1][0];
|
||||
for (bi = 0; bi < h_samp_factor; bi++) {
|
||||
thisblockrow[bi][0] = lastDC;
|
||||
}
|
||||
thisblockrow += h_samp_factor; /* advance to next MCU in row */
|
||||
lastblockrow += h_samp_factor;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -361,11 +362,27 @@ compress_trellis_pass (j_compress_ptr cinfo, JSAMPIMAGE input_buf)
|
||||
JBLOCKARRAY buffer_dst;
|
||||
|
||||
for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
|
||||
c_derived_tbl dctbl_data;
|
||||
c_derived_tbl *dctbl = &dctbl_data;
|
||||
c_derived_tbl actbl_data;
|
||||
c_derived_tbl *actbl = &actbl_data;
|
||||
|
||||
#ifdef C_ARITH_CODING_SUPPORTED
|
||||
arith_rates arith_r_data;
|
||||
arith_rates *arith_r = &arith_r_data;
|
||||
#endif
|
||||
|
||||
compptr = cinfo->cur_comp_info[ci];
|
||||
|
||||
jpeg_make_c_derived_tbl(cinfo, FALSE, compptr->ac_tbl_no, &actbl);
|
||||
#ifdef C_ARITH_CODING_SUPPORTED
|
||||
if (cinfo->arith_code)
|
||||
jget_arith_rates(cinfo, compptr->dc_tbl_no, compptr->ac_tbl_no, arith_r);
|
||||
else
|
||||
#endif
|
||||
{
|
||||
jpeg_make_c_derived_tbl(cinfo, TRUE, compptr->dc_tbl_no, &dctbl);
|
||||
jpeg_make_c_derived_tbl(cinfo, FALSE, compptr->ac_tbl_no, &actbl);
|
||||
}
|
||||
|
||||
/* Align the virtual buffer for this component. */
|
||||
buffer = (*cinfo->mem->access_virt_barray)
|
||||
@@ -392,21 +409,40 @@ compress_trellis_pass (j_compress_ptr cinfo, JSAMPIMAGE input_buf)
|
||||
ndummy = (int) (blocks_across % h_samp_factor);
|
||||
if (ndummy > 0)
|
||||
ndummy = h_samp_factor - ndummy;
|
||||
|
||||
lastDC = 0;
|
||||
|
||||
/* Perform DCT for all non-dummy blocks in this iMCU row. Each call
|
||||
* on forward_DCT processes a complete horizontal row of DCT blocks.
|
||||
*/
|
||||
for (block_row = 0; block_row < block_rows; block_row++) {
|
||||
thisblockrow = buffer[block_row];
|
||||
quantize_trellis(cinfo, actbl, thisblockrow, buffer_dst[block_row], blocks_across, cinfo->quant_tbl_ptrs[compptr->quant_tbl_no], cinfo->norm_src[compptr->quant_tbl_no], cinfo->norm_coef[compptr->quant_tbl_no]);
|
||||
lastblockrow = (block_row > 0) ? buffer[block_row-1] : NULL;
|
||||
#ifdef C_ARITH_CODING_SUPPORTED
|
||||
if (cinfo->arith_code)
|
||||
quantize_trellis_arith(cinfo, arith_r, thisblockrow,
|
||||
buffer_dst[block_row], blocks_across,
|
||||
cinfo->quant_tbl_ptrs[compptr->quant_tbl_no],
|
||||
cinfo->master->norm_src[compptr->quant_tbl_no],
|
||||
cinfo->master->norm_coef[compptr->quant_tbl_no],
|
||||
&lastDC, lastblockrow, buffer_dst[block_row-1]);
|
||||
else
|
||||
#endif
|
||||
quantize_trellis(cinfo, dctbl, actbl, thisblockrow,
|
||||
buffer_dst[block_row], blocks_across,
|
||||
cinfo->quant_tbl_ptrs[compptr->quant_tbl_no],
|
||||
cinfo->master->norm_src[compptr->quant_tbl_no],
|
||||
cinfo->master->norm_coef[compptr->quant_tbl_no],
|
||||
&lastDC, lastblockrow, buffer_dst[block_row-1]);
|
||||
|
||||
if (ndummy > 0) {
|
||||
/* Create dummy blocks at the right edge of the image. */
|
||||
thisblockrow += blocks_across; /* => first dummy block */
|
||||
jzero_far((void FAR *) thisblockrow, ndummy * SIZEOF(JBLOCK));
|
||||
lastDC = thisblockrow[-1][0];
|
||||
for (bi = 0; bi < ndummy; bi++) {
|
||||
thisblockrow[bi][0] = lastDC;
|
||||
}
|
||||
/* Create dummy blocks at the right edge of the image. */
|
||||
thisblockrow += blocks_across; /* => first dummy block */
|
||||
jzero_far((void *) thisblockrow, ndummy * sizeof(JBLOCK));
|
||||
lastDC = thisblockrow[-1][0];
|
||||
for (bi = 0; bi < ndummy; bi++) {
|
||||
thisblockrow[bi][0] = lastDC;
|
||||
}
|
||||
}
|
||||
}
|
||||
/* If at end of image, create dummy block rows as needed.
|
||||
@@ -415,22 +451,22 @@ compress_trellis_pass (j_compress_ptr cinfo, JSAMPIMAGE input_buf)
|
||||
* This squeezes a few more bytes out of the resulting file...
|
||||
*/
|
||||
if (coef->iMCU_row_num == last_iMCU_row) {
|
||||
blocks_across += ndummy; /* include lower right corner */
|
||||
blocks_across += ndummy; /* include lower right corner */
|
||||
MCUs_across = blocks_across / h_samp_factor;
|
||||
for (block_row = block_rows; block_row < compptr->v_samp_factor;
|
||||
block_row++) {
|
||||
thisblockrow = buffer[block_row];
|
||||
lastblockrow = buffer[block_row-1];
|
||||
jzero_far((void FAR *) thisblockrow,
|
||||
(size_t) (blocks_across * SIZEOF(JBLOCK)));
|
||||
for (MCUindex = 0; MCUindex < MCUs_across; MCUindex++) {
|
||||
lastDC = lastblockrow[h_samp_factor-1][0];
|
||||
for (bi = 0; bi < h_samp_factor; bi++) {
|
||||
thisblockrow[bi][0] = lastDC;
|
||||
}
|
||||
thisblockrow += h_samp_factor; /* advance to next MCU in row */
|
||||
lastblockrow += h_samp_factor;
|
||||
}
|
||||
block_row++) {
|
||||
thisblockrow = buffer[block_row];
|
||||
lastblockrow = buffer[block_row-1];
|
||||
jzero_far((void *) thisblockrow,
|
||||
(size_t) (blocks_across * sizeof(JBLOCK)));
|
||||
for (MCUindex = 0; MCUindex < MCUs_across; MCUindex++) {
|
||||
lastDC = lastblockrow[h_samp_factor-1][0];
|
||||
for (bi = 0; bi < h_samp_factor; bi++) {
|
||||
thisblockrow[bi][0] = lastDC;
|
||||
}
|
||||
thisblockrow += h_samp_factor; /* advance to next MCU in row */
|
||||
lastblockrow += h_samp_factor;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -457,7 +493,7 @@ METHODDEF(boolean)
|
||||
compress_output (j_compress_ptr cinfo, JSAMPIMAGE input_buf)
|
||||
{
|
||||
my_coef_ptr coef = (my_coef_ptr) cinfo->coef;
|
||||
JDIMENSION MCU_col_num; /* index of current MCU within row */
|
||||
JDIMENSION MCU_col_num; /* index of current MCU within row */
|
||||
int blkn, ci, xindex, yindex, yoffset;
|
||||
JDIMENSION start_col;
|
||||
JBLOCKARRAY buffer[MAX_COMPS_IN_SCAN];
|
||||
@@ -480,26 +516,25 @@ compress_output (j_compress_ptr cinfo, JSAMPIMAGE input_buf)
|
||||
for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row;
|
||||
yoffset++) {
|
||||
for (MCU_col_num = coef->mcu_ctr; MCU_col_num < cinfo->MCUs_per_row;
|
||||
MCU_col_num++) {
|
||||
MCU_col_num++) {
|
||||
/* Construct list of pointers to DCT blocks belonging to this MCU */
|
||||
blkn = 0; /* index of current DCT block within MCU */
|
||||
blkn = 0; /* index of current DCT block within MCU */
|
||||
for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
|
||||
compptr = cinfo->cur_comp_info[ci];
|
||||
start_col = MCU_col_num * compptr->MCU_width;
|
||||
for (yindex = 0; yindex < compptr->MCU_height; yindex++) {
|
||||
buffer_ptr = buffer[ci][yindex+yoffset] + start_col;
|
||||
for (xindex = 0; xindex < compptr->MCU_width; xindex++) {
|
||||
coef->MCU_buffer[blkn++] = buffer_ptr++;
|
||||
}
|
||||
}
|
||||
compptr = cinfo->cur_comp_info[ci];
|
||||
start_col = MCU_col_num * compptr->MCU_width;
|
||||
for (yindex = 0; yindex < compptr->MCU_height; yindex++) {
|
||||
buffer_ptr = buffer[ci][yindex+yoffset] + start_col;
|
||||
for (xindex = 0; xindex < compptr->MCU_width; xindex++) {
|
||||
coef->MCU_buffer[blkn++] = buffer_ptr++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Try to write the MCU. */
|
||||
if (! (*cinfo->entropy->encode_mcu) (cinfo, coef->MCU_buffer)) {
|
||||
/* Suspension forced; update state counters and exit */
|
||||
coef->MCU_vert_offset = yoffset;
|
||||
coef->mcu_ctr = MCU_col_num;
|
||||
return FALSE;
|
||||
/* Suspension forced; update state counters and exit */
|
||||
coef->MCU_vert_offset = yoffset;
|
||||
coef->mcu_ctr = MCU_col_num;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
/* Completed an MCU row, but perhaps not an iMCU row */
|
||||
@@ -525,7 +560,7 @@ jinit_c_coef_controller (j_compress_ptr cinfo, boolean need_full_buffer)
|
||||
|
||||
coef = (my_coef_ptr)
|
||||
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
|
||||
SIZEOF(my_coef_controller));
|
||||
sizeof(my_coef_controller));
|
||||
cinfo->coef = (struct jpeg_c_coef_controller *) coef;
|
||||
coef->pub.start_pass = start_pass_coef;
|
||||
|
||||
@@ -538,14 +573,14 @@ jinit_c_coef_controller (j_compress_ptr cinfo, boolean need_full_buffer)
|
||||
jpeg_component_info *compptr;
|
||||
|
||||
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
|
||||
ci++, compptr++) {
|
||||
ci++, compptr++) {
|
||||
coef->whole_image[ci] = (*cinfo->mem->request_virt_barray)
|
||||
((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE,
|
||||
(JDIMENSION) jround_up((long) compptr->width_in_blocks,
|
||||
(long) compptr->h_samp_factor),
|
||||
(JDIMENSION) jround_up((long) compptr->height_in_blocks,
|
||||
(long) compptr->v_samp_factor),
|
||||
(JDIMENSION) compptr->v_samp_factor);
|
||||
((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE,
|
||||
(JDIMENSION) jround_up((long) compptr->width_in_blocks,
|
||||
(long) compptr->h_samp_factor),
|
||||
(JDIMENSION) jround_up((long) compptr->height_in_blocks,
|
||||
(long) compptr->v_samp_factor),
|
||||
(JDIMENSION) compptr->v_samp_factor);
|
||||
|
||||
coef->whole_image_uq[ci] = (*cinfo->mem->request_virt_barray)
|
||||
((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE,
|
||||
@@ -565,7 +600,7 @@ jinit_c_coef_controller (j_compress_ptr cinfo, boolean need_full_buffer)
|
||||
|
||||
buffer = (JBLOCKROW)
|
||||
(*cinfo->mem->alloc_large) ((j_common_ptr) cinfo, JPOOL_IMAGE,
|
||||
C_MAX_BLOCKS_IN_MCU * SIZEOF(JBLOCK));
|
||||
C_MAX_BLOCKS_IN_MCU * sizeof(JBLOCK));
|
||||
for (i = 0; i < C_MAX_BLOCKS_IN_MCU; i++) {
|
||||
coef->MCU_buffer[i] = buffer + i;
|
||||
}
|
||||
|
||||
16
jccolext.c
16
jccolext.c
@@ -58,16 +58,16 @@ rgb_ycc_convert_internal (j_compress_ptr cinfo,
|
||||
*/
|
||||
/* Y */
|
||||
outptr0[col] = (JSAMPLE)
|
||||
((ctab[r+R_Y_OFF] + ctab[g+G_Y_OFF] + ctab[b+B_Y_OFF])
|
||||
>> SCALEBITS);
|
||||
((ctab[r+R_Y_OFF] + ctab[g+G_Y_OFF] + ctab[b+B_Y_OFF])
|
||||
>> SCALEBITS);
|
||||
/* Cb */
|
||||
outptr1[col] = (JSAMPLE)
|
||||
((ctab[r+R_CB_OFF] + ctab[g+G_CB_OFF] + ctab[b+B_CB_OFF])
|
||||
>> SCALEBITS);
|
||||
((ctab[r+R_CB_OFF] + ctab[g+G_CB_OFF] + ctab[b+B_CB_OFF])
|
||||
>> SCALEBITS);
|
||||
/* Cr */
|
||||
outptr2[col] = (JSAMPLE)
|
||||
((ctab[r+R_CR_OFF] + ctab[g+G_CR_OFF] + ctab[b+B_CR_OFF])
|
||||
>> SCALEBITS);
|
||||
((ctab[r+R_CR_OFF] + ctab[g+G_CR_OFF] + ctab[b+B_CR_OFF])
|
||||
>> SCALEBITS);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -108,8 +108,8 @@ rgb_gray_convert_internal (j_compress_ptr cinfo,
|
||||
inptr += RGB_PIXELSIZE;
|
||||
/* Y */
|
||||
outptr[col] = (JSAMPLE)
|
||||
((ctab[r+R_Y_OFF] + ctab[g+G_Y_OFF] + ctab[b+B_Y_OFF])
|
||||
>> SCALEBITS);
|
||||
((ctab[r+R_Y_OFF] + ctab[g+G_Y_OFF] + ctab[b+B_Y_OFF])
|
||||
>> SCALEBITS);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
164
jccolor.c
164
jccolor.c
@@ -6,6 +6,7 @@
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
|
||||
* Copyright (C) 2009-2012, D. R. Commander.
|
||||
* Copyright (C) 2014, MIPS Technologies, Inc., California
|
||||
* For conditions of distribution and use, see the accompanying README file.
|
||||
*
|
||||
* This file contains input colorspace conversion routines.
|
||||
@@ -15,7 +16,7 @@
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
#include "jsimd.h"
|
||||
#include "config.h"
|
||||
#include "jconfigint.h"
|
||||
|
||||
|
||||
/* Private subobject */
|
||||
@@ -24,7 +25,7 @@ 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 */
|
||||
INT32 * rgb_ycc_tab; /* => table for RGB to YCbCr conversion */
|
||||
} my_color_converter;
|
||||
|
||||
typedef my_color_converter * my_cconvert_ptr;
|
||||
@@ -36,9 +37,9 @@ typedef my_color_converter * my_cconvert_ptr;
|
||||
* YCbCr is defined per CCIR 601-1, except that Cb and Cr are
|
||||
* normalized to the range 0..MAXJSAMPLE rather than -0.5 .. 0.5.
|
||||
* The conversion equations to be implemented are therefore
|
||||
* Y = 0.29900 * R + 0.58700 * G + 0.11400 * B
|
||||
* Cb = -0.16874 * R - 0.33126 * G + 0.50000 * B + CENTERJSAMPLE
|
||||
* Cr = 0.50000 * R - 0.41869 * G - 0.08131 * B + CENTERJSAMPLE
|
||||
* Y = 0.29900 * R + 0.58700 * G + 0.11400 * B
|
||||
* Cb = -0.16874 * R - 0.33126 * G + 0.50000 * B + CENTERJSAMPLE
|
||||
* Cr = 0.50000 * R - 0.41869 * G - 0.08131 * B + CENTERJSAMPLE
|
||||
* (These numbers are derived from TIFF 6.0 section 21, dated 3-June-92.)
|
||||
* Note: older versions of the IJG code used a zero offset of MAXJSAMPLE/2,
|
||||
* rather than CENTERJSAMPLE, for Cb and Cr. This gave equal positive and
|
||||
@@ -60,10 +61,10 @@ typedef my_color_converter * my_cconvert_ptr;
|
||||
* in the tables to save adding them separately in the inner loop.
|
||||
*/
|
||||
|
||||
#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 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))
|
||||
|
||||
/* 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
|
||||
@@ -71,16 +72,16 @@ typedef my_color_converter * my_cconvert_ptr;
|
||||
* machines (more than can hold all eight addresses, anyway).
|
||||
*/
|
||||
|
||||
#define R_Y_OFF 0 /* offset to R => Y section */
|
||||
#define G_Y_OFF (1*(MAXJSAMPLE+1)) /* offset to G => Y section */
|
||||
#define B_Y_OFF (2*(MAXJSAMPLE+1)) /* etc. */
|
||||
#define R_CB_OFF (3*(MAXJSAMPLE+1))
|
||||
#define G_CB_OFF (4*(MAXJSAMPLE+1))
|
||||
#define B_CB_OFF (5*(MAXJSAMPLE+1))
|
||||
#define R_CR_OFF B_CB_OFF /* B=>Cb, R=>Cr are the same */
|
||||
#define G_CR_OFF (6*(MAXJSAMPLE+1))
|
||||
#define B_CR_OFF (7*(MAXJSAMPLE+1))
|
||||
#define TABLE_SIZE (8*(MAXJSAMPLE+1))
|
||||
#define R_Y_OFF 0 /* offset to R => Y section */
|
||||
#define G_Y_OFF (1*(MAXJSAMPLE+1)) /* offset to G => Y section */
|
||||
#define B_Y_OFF (2*(MAXJSAMPLE+1)) /* etc. */
|
||||
#define R_CB_OFF (3*(MAXJSAMPLE+1))
|
||||
#define G_CB_OFF (4*(MAXJSAMPLE+1))
|
||||
#define B_CB_OFF (5*(MAXJSAMPLE+1))
|
||||
#define R_CR_OFF B_CB_OFF /* B=>Cb, R=>Cr are the same */
|
||||
#define G_CR_OFF (6*(MAXJSAMPLE+1))
|
||||
#define B_CR_OFF (7*(MAXJSAMPLE+1))
|
||||
#define TABLE_SIZE (8*(MAXJSAMPLE+1))
|
||||
|
||||
|
||||
/* Include inline routines for colorspace extensions */
|
||||
@@ -202,7 +203,7 @@ rgb_ycc_start (j_compress_ptr cinfo)
|
||||
/* Allocate and fill in the conversion tables. */
|
||||
cconvert->rgb_ycc_tab = rgb_ycc_tab = (INT32 *)
|
||||
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
|
||||
(TABLE_SIZE * SIZEOF(INT32)));
|
||||
(TABLE_SIZE * sizeof(INT32)));
|
||||
|
||||
for (i = 0; i <= MAXJSAMPLE; i++) {
|
||||
rgb_ycc_tab[i+R_Y_OFF] = FIX(0.29900) * i;
|
||||
@@ -230,8 +231,8 @@ rgb_ycc_start (j_compress_ptr cinfo)
|
||||
|
||||
METHODDEF(void)
|
||||
rgb_ycc_convert (j_compress_ptr cinfo,
|
||||
JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
|
||||
JDIMENSION output_row, int num_rows)
|
||||
JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
|
||||
JDIMENSION output_row, int num_rows)
|
||||
{
|
||||
switch (cinfo->in_color_space) {
|
||||
case JCS_EXT_RGB:
|
||||
@@ -279,8 +280,8 @@ rgb_ycc_convert (j_compress_ptr cinfo,
|
||||
|
||||
METHODDEF(void)
|
||||
rgb_gray_convert (j_compress_ptr cinfo,
|
||||
JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
|
||||
JDIMENSION output_row, int num_rows)
|
||||
JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
|
||||
JDIMENSION output_row, int num_rows)
|
||||
{
|
||||
switch (cinfo->in_color_space) {
|
||||
case JCS_EXT_RGB:
|
||||
@@ -325,8 +326,8 @@ rgb_gray_convert (j_compress_ptr cinfo,
|
||||
|
||||
METHODDEF(void)
|
||||
rgb_rgb_convert (j_compress_ptr cinfo,
|
||||
JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
|
||||
JDIMENSION output_row, int num_rows)
|
||||
JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
|
||||
JDIMENSION output_row, int num_rows)
|
||||
{
|
||||
switch (cinfo->in_color_space) {
|
||||
case JCS_EXT_RGB:
|
||||
@@ -375,8 +376,8 @@ rgb_rgb_convert (j_compress_ptr cinfo,
|
||||
|
||||
METHODDEF(void)
|
||||
cmyk_ycck_convert (j_compress_ptr cinfo,
|
||||
JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
|
||||
JDIMENSION output_row, int num_rows)
|
||||
JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
|
||||
JDIMENSION output_row, int num_rows)
|
||||
{
|
||||
my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;
|
||||
register int r, g, b;
|
||||
@@ -398,7 +399,7 @@ cmyk_ycck_convert (j_compress_ptr cinfo,
|
||||
g = MAXJSAMPLE - GETJSAMPLE(inptr[1]);
|
||||
b = MAXJSAMPLE - GETJSAMPLE(inptr[2]);
|
||||
/* K passes through as-is */
|
||||
outptr3[col] = inptr[3]; /* don't need GETJSAMPLE here */
|
||||
outptr3[col] = inptr[3]; /* don't need GETJSAMPLE here */
|
||||
inptr += 4;
|
||||
/* If the inputs are 0..MAXJSAMPLE, the outputs of these equations
|
||||
* must be too; we do not need an explicit range-limiting operation.
|
||||
@@ -407,16 +408,16 @@ cmyk_ycck_convert (j_compress_ptr cinfo,
|
||||
*/
|
||||
/* Y */
|
||||
outptr0[col] = (JSAMPLE)
|
||||
((ctab[r+R_Y_OFF] + ctab[g+G_Y_OFF] + ctab[b+B_Y_OFF])
|
||||
>> SCALEBITS);
|
||||
((ctab[r+R_Y_OFF] + ctab[g+G_Y_OFF] + ctab[b+B_Y_OFF])
|
||||
>> SCALEBITS);
|
||||
/* Cb */
|
||||
outptr1[col] = (JSAMPLE)
|
||||
((ctab[r+R_CB_OFF] + ctab[g+G_CB_OFF] + ctab[b+B_CB_OFF])
|
||||
>> SCALEBITS);
|
||||
((ctab[r+R_CB_OFF] + ctab[g+G_CB_OFF] + ctab[b+B_CB_OFF])
|
||||
>> SCALEBITS);
|
||||
/* Cr */
|
||||
outptr2[col] = (JSAMPLE)
|
||||
((ctab[r+R_CR_OFF] + ctab[g+G_CR_OFF] + ctab[b+B_CR_OFF])
|
||||
>> SCALEBITS);
|
||||
((ctab[r+R_CR_OFF] + ctab[g+G_CR_OFF] + ctab[b+B_CR_OFF])
|
||||
>> SCALEBITS);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -430,8 +431,8 @@ cmyk_ycck_convert (j_compress_ptr cinfo,
|
||||
|
||||
METHODDEF(void)
|
||||
grayscale_convert (j_compress_ptr cinfo,
|
||||
JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
|
||||
JDIMENSION output_row, int num_rows)
|
||||
JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
|
||||
JDIMENSION output_row, int num_rows)
|
||||
{
|
||||
register JSAMPROW inptr;
|
||||
register JSAMPROW outptr;
|
||||
@@ -444,7 +445,7 @@ grayscale_convert (j_compress_ptr cinfo,
|
||||
outptr = output_buf[0][output_row];
|
||||
output_row++;
|
||||
for (col = 0; col < num_cols; col++) {
|
||||
outptr[col] = inptr[0]; /* don't need GETJSAMPLE() here */
|
||||
outptr[col] = inptr[0]; /* don't need GETJSAMPLE() here */
|
||||
inptr += instride;
|
||||
}
|
||||
}
|
||||
@@ -459,8 +460,8 @@ grayscale_convert (j_compress_ptr cinfo,
|
||||
|
||||
METHODDEF(void)
|
||||
null_convert (j_compress_ptr cinfo,
|
||||
JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
|
||||
JDIMENSION output_row, int num_rows)
|
||||
JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
|
||||
JDIMENSION output_row, int num_rows)
|
||||
{
|
||||
register JSAMPROW inptr;
|
||||
register JSAMPROW outptr;
|
||||
@@ -475,8 +476,8 @@ null_convert (j_compress_ptr cinfo,
|
||||
inptr = *input_buf;
|
||||
outptr = output_buf[ci][output_row];
|
||||
for (col = 0; col < num_cols; col++) {
|
||||
outptr[col] = inptr[ci]; /* don't need GETJSAMPLE() here */
|
||||
inptr += nc;
|
||||
outptr[col] = inptr[ci]; /* don't need GETJSAMPLE() here */
|
||||
inptr += nc;
|
||||
}
|
||||
}
|
||||
input_buf++;
|
||||
@@ -507,7 +508,7 @@ jinit_color_converter (j_compress_ptr cinfo)
|
||||
|
||||
cconvert = (my_cconvert_ptr)
|
||||
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
|
||||
SIZEOF(my_color_converter));
|
||||
sizeof(my_color_converter));
|
||||
cinfo->cconvert = (struct jpeg_color_converter *) cconvert;
|
||||
/* set start_pass to null method until we find out differently */
|
||||
cconvert->pub.start_pass = null_method;
|
||||
@@ -545,7 +546,7 @@ jinit_color_converter (j_compress_ptr cinfo)
|
||||
ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);
|
||||
break;
|
||||
|
||||
default: /* JCS_UNKNOWN can be anything */
|
||||
default: /* JCS_UNKNOWN can be anything */
|
||||
if (cinfo->input_components < 1)
|
||||
ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);
|
||||
break;
|
||||
@@ -587,19 +588,24 @@ jinit_color_converter (j_compress_ptr cinfo)
|
||||
if (rgb_red[cinfo->in_color_space] == 0 &&
|
||||
rgb_green[cinfo->in_color_space] == 1 &&
|
||||
rgb_blue[cinfo->in_color_space] == 2 &&
|
||||
rgb_pixelsize[cinfo->in_color_space] == 3)
|
||||
cconvert->pub.color_convert = null_convert;
|
||||
else if (cinfo->in_color_space == JCS_RGB ||
|
||||
cinfo->in_color_space == JCS_EXT_RGB ||
|
||||
cinfo->in_color_space == JCS_EXT_RGBX ||
|
||||
cinfo->in_color_space == JCS_EXT_BGR ||
|
||||
cinfo->in_color_space == JCS_EXT_BGRX ||
|
||||
cinfo->in_color_space == JCS_EXT_XBGR ||
|
||||
cinfo->in_color_space == JCS_EXT_XRGB ||
|
||||
cinfo->in_color_space == JCS_EXT_RGBA ||
|
||||
cinfo->in_color_space == JCS_EXT_BGRA ||
|
||||
cinfo->in_color_space == JCS_EXT_ABGR ||
|
||||
cinfo->in_color_space == JCS_EXT_ARGB)
|
||||
rgb_pixelsize[cinfo->in_color_space] == 3) {
|
||||
#if defined(__mips__)
|
||||
if (jsimd_c_can_null_convert())
|
||||
cconvert->pub.color_convert = jsimd_c_null_convert;
|
||||
else
|
||||
#endif
|
||||
cconvert->pub.color_convert = null_convert;
|
||||
} else if (cinfo->in_color_space == JCS_RGB ||
|
||||
cinfo->in_color_space == JCS_EXT_RGB ||
|
||||
cinfo->in_color_space == JCS_EXT_RGBX ||
|
||||
cinfo->in_color_space == JCS_EXT_BGR ||
|
||||
cinfo->in_color_space == JCS_EXT_BGRX ||
|
||||
cinfo->in_color_space == JCS_EXT_XBGR ||
|
||||
cinfo->in_color_space == JCS_EXT_XRGB ||
|
||||
cinfo->in_color_space == JCS_EXT_RGBA ||
|
||||
cinfo->in_color_space == JCS_EXT_BGRA ||
|
||||
cinfo->in_color_space == JCS_EXT_ABGR ||
|
||||
cinfo->in_color_space == JCS_EXT_ARGB)
|
||||
cconvert->pub.color_convert = rgb_rgb_convert;
|
||||
else
|
||||
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
|
||||
@@ -625,18 +631,28 @@ jinit_color_converter (j_compress_ptr cinfo)
|
||||
cconvert->pub.start_pass = rgb_ycc_start;
|
||||
cconvert->pub.color_convert = rgb_ycc_convert;
|
||||
}
|
||||
} else if (cinfo->in_color_space == JCS_YCbCr)
|
||||
cconvert->pub.color_convert = null_convert;
|
||||
else
|
||||
} else if (cinfo->in_color_space == JCS_YCbCr) {
|
||||
#if defined(__mips__)
|
||||
if (jsimd_c_can_null_convert())
|
||||
cconvert->pub.color_convert = jsimd_c_null_convert;
|
||||
else
|
||||
#endif
|
||||
cconvert->pub.color_convert = null_convert;
|
||||
} else
|
||||
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
|
||||
break;
|
||||
|
||||
case JCS_CMYK:
|
||||
if (cinfo->num_components != 4)
|
||||
ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
|
||||
if (cinfo->in_color_space == JCS_CMYK)
|
||||
cconvert->pub.color_convert = null_convert;
|
||||
else
|
||||
if (cinfo->in_color_space == JCS_CMYK) {
|
||||
#if defined(__mips__)
|
||||
if (jsimd_c_can_null_convert())
|
||||
cconvert->pub.color_convert = jsimd_c_null_convert;
|
||||
else
|
||||
#endif
|
||||
cconvert->pub.color_convert = null_convert;
|
||||
} else
|
||||
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
|
||||
break;
|
||||
|
||||
@@ -646,17 +662,27 @@ jinit_color_converter (j_compress_ptr cinfo)
|
||||
if (cinfo->in_color_space == JCS_CMYK) {
|
||||
cconvert->pub.start_pass = rgb_ycc_start;
|
||||
cconvert->pub.color_convert = cmyk_ycck_convert;
|
||||
} else if (cinfo->in_color_space == JCS_YCCK)
|
||||
cconvert->pub.color_convert = null_convert;
|
||||
else
|
||||
} else if (cinfo->in_color_space == JCS_YCCK) {
|
||||
#if defined(__mips__)
|
||||
if (jsimd_c_can_null_convert())
|
||||
cconvert->pub.color_convert = jsimd_c_null_convert;
|
||||
else
|
||||
#endif
|
||||
cconvert->pub.color_convert = null_convert;
|
||||
} else
|
||||
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
|
||||
break;
|
||||
|
||||
default: /* allow null conversion of JCS_UNKNOWN */
|
||||
default: /* allow null conversion of JCS_UNKNOWN */
|
||||
if (cinfo->jpeg_color_space != cinfo->in_color_space ||
|
||||
cinfo->num_components != cinfo->input_components)
|
||||
cinfo->num_components != cinfo->input_components)
|
||||
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
|
||||
cconvert->pub.color_convert = null_convert;
|
||||
#if defined(__mips__)
|
||||
if (jsimd_c_can_null_convert())
|
||||
cconvert->pub.color_convert = jsimd_c_null_convert;
|
||||
else
|
||||
#endif
|
||||
cconvert->pub.color_convert = null_convert;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
1060
jcdctmgr.c
1060
jcdctmgr.c
File diff suppressed because it is too large
Load Diff
219
jcext.c
Normal file
219
jcext.c
Normal file
@@ -0,0 +1,219 @@
|
||||
/*
|
||||
* jcext.c
|
||||
*
|
||||
* Copyright (C) 2014, D. R. Commander.
|
||||
* Copyright (C) 2014, Mozilla Corporation.
|
||||
* For conditions of distribution and use, see the accompanying README file.
|
||||
*
|
||||
* This file contains accessor functions for extension parameters. These
|
||||
* allow for extending the functionality of the libjpeg API without breaking
|
||||
* backward ABI compatibility.
|
||||
*/
|
||||
|
||||
#define JPEG_INTERNALS
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
|
||||
|
||||
GLOBAL(boolean)
|
||||
jpeg_c_bool_param_supported (const j_compress_ptr cinfo, J_BOOLEAN_PARAM param)
|
||||
{
|
||||
switch (param) {
|
||||
case JBOOLEAN_OPTIMIZE_SCANS:
|
||||
case JBOOLEAN_TRELLIS_QUANT:
|
||||
case JBOOLEAN_TRELLIS_QUANT_DC:
|
||||
case JBOOLEAN_TRELLIS_EOB_OPT:
|
||||
case JBOOLEAN_USE_LAMBDA_WEIGHT_TBL:
|
||||
case JBOOLEAN_USE_SCANS_IN_TRELLIS:
|
||||
case JBOOLEAN_TRELLIS_Q_OPT:
|
||||
case JBOOLEAN_OVERSHOOT_DERINGING:
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
GLOBAL(void)
|
||||
jpeg_c_set_bool_param (j_compress_ptr cinfo, J_BOOLEAN_PARAM param,
|
||||
boolean value)
|
||||
{
|
||||
switch(param) {
|
||||
case JBOOLEAN_OPTIMIZE_SCANS:
|
||||
cinfo->master->optimize_scans = value;
|
||||
break;
|
||||
case JBOOLEAN_TRELLIS_QUANT:
|
||||
cinfo->master->trellis_quant = value;
|
||||
break;
|
||||
case JBOOLEAN_TRELLIS_QUANT_DC:
|
||||
cinfo->master->trellis_quant_dc = value;
|
||||
break;
|
||||
case JBOOLEAN_TRELLIS_EOB_OPT:
|
||||
cinfo->master->trellis_eob_opt = value;
|
||||
break;
|
||||
case JBOOLEAN_USE_LAMBDA_WEIGHT_TBL:
|
||||
cinfo->master->use_lambda_weight_tbl = value;
|
||||
break;
|
||||
case JBOOLEAN_USE_SCANS_IN_TRELLIS:
|
||||
cinfo->master->use_scans_in_trellis = value;
|
||||
break;
|
||||
case JBOOLEAN_TRELLIS_Q_OPT:
|
||||
cinfo->master->trellis_q_opt = value;
|
||||
break;
|
||||
case JBOOLEAN_OVERSHOOT_DERINGING:
|
||||
cinfo->master->overshoot_deringing = value;
|
||||
break;
|
||||
default:
|
||||
ERREXIT(cinfo, JERR_BAD_PARAM);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
GLOBAL(boolean)
|
||||
jpeg_c_get_bool_param (const j_compress_ptr cinfo, J_BOOLEAN_PARAM param)
|
||||
{
|
||||
switch(param) {
|
||||
case JBOOLEAN_OPTIMIZE_SCANS:
|
||||
return cinfo->master->optimize_scans;
|
||||
case JBOOLEAN_TRELLIS_QUANT:
|
||||
return cinfo->master->trellis_quant;
|
||||
case JBOOLEAN_TRELLIS_QUANT_DC:
|
||||
return cinfo->master->trellis_quant_dc;
|
||||
case JBOOLEAN_TRELLIS_EOB_OPT:
|
||||
return cinfo->master->trellis_eob_opt;
|
||||
case JBOOLEAN_USE_LAMBDA_WEIGHT_TBL:
|
||||
return cinfo->master->use_lambda_weight_tbl;
|
||||
case JBOOLEAN_USE_SCANS_IN_TRELLIS:
|
||||
return cinfo->master->use_scans_in_trellis;
|
||||
case JBOOLEAN_TRELLIS_Q_OPT:
|
||||
return cinfo->master->trellis_q_opt;
|
||||
case JBOOLEAN_OVERSHOOT_DERINGING:
|
||||
return cinfo->master->overshoot_deringing;
|
||||
default:
|
||||
ERREXIT(cinfo, JERR_BAD_PARAM);
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
GLOBAL(boolean)
|
||||
jpeg_c_float_param_supported (const j_compress_ptr cinfo, J_FLOAT_PARAM param)
|
||||
{
|
||||
switch (param) {
|
||||
case JFLOAT_LAMBDA_LOG_SCALE1:
|
||||
case JFLOAT_LAMBDA_LOG_SCALE2:
|
||||
case JFLOAT_TRELLIS_DELTA_DC_WEIGHT:
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
GLOBAL(void)
|
||||
jpeg_c_set_float_param (j_compress_ptr cinfo, J_FLOAT_PARAM param, float value)
|
||||
{
|
||||
switch (param) {
|
||||
case JFLOAT_LAMBDA_LOG_SCALE1:
|
||||
cinfo->master->lambda_log_scale1 = value;
|
||||
break;
|
||||
case JFLOAT_LAMBDA_LOG_SCALE2:
|
||||
cinfo->master->lambda_log_scale2 = value;
|
||||
break;
|
||||
case JFLOAT_TRELLIS_DELTA_DC_WEIGHT:
|
||||
cinfo->master->trellis_delta_dc_weight = value;
|
||||
break;
|
||||
default:
|
||||
ERREXIT(cinfo, JERR_BAD_PARAM);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
GLOBAL(float)
|
||||
jpeg_c_get_float_param (const j_compress_ptr cinfo, J_FLOAT_PARAM param)
|
||||
{
|
||||
switch (param) {
|
||||
case JFLOAT_LAMBDA_LOG_SCALE1:
|
||||
return cinfo->master->lambda_log_scale1;
|
||||
case JFLOAT_LAMBDA_LOG_SCALE2:
|
||||
return cinfo->master->lambda_log_scale2;
|
||||
case JFLOAT_TRELLIS_DELTA_DC_WEIGHT:
|
||||
return cinfo->master->trellis_delta_dc_weight;
|
||||
default:
|
||||
ERREXIT(cinfo, JERR_BAD_PARAM);
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
GLOBAL(boolean)
|
||||
jpeg_c_int_param_supported (const j_compress_ptr cinfo, J_INT_PARAM param)
|
||||
{
|
||||
switch (param) {
|
||||
case JINT_COMPRESS_PROFILE:
|
||||
case JINT_TRELLIS_FREQ_SPLIT:
|
||||
case JINT_TRELLIS_NUM_LOOPS:
|
||||
case JINT_BASE_QUANT_TBL_IDX:
|
||||
case JINT_DC_SCAN_OPT_MODE:
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
GLOBAL(void)
|
||||
jpeg_c_set_int_param (j_compress_ptr cinfo, J_INT_PARAM param, int value)
|
||||
{
|
||||
switch (param) {
|
||||
case JINT_COMPRESS_PROFILE:
|
||||
switch (value) {
|
||||
case JCP_MAX_COMPRESSION:
|
||||
case JCP_FASTEST:
|
||||
cinfo->master->compress_profile = value;
|
||||
break;
|
||||
default:
|
||||
ERREXIT(cinfo, JERR_BAD_PARAM_VALUE);
|
||||
}
|
||||
break;
|
||||
case JINT_TRELLIS_FREQ_SPLIT:
|
||||
cinfo->master->trellis_freq_split = value;
|
||||
break;
|
||||
case JINT_TRELLIS_NUM_LOOPS:
|
||||
cinfo->master->trellis_num_loops = value;
|
||||
break;
|
||||
case JINT_BASE_QUANT_TBL_IDX:
|
||||
if (value >= 0 && value <= 8)
|
||||
cinfo->master->quant_tbl_master_idx = value;
|
||||
break;
|
||||
case JINT_DC_SCAN_OPT_MODE:
|
||||
cinfo->master->dc_scan_opt_mode = value;
|
||||
break;
|
||||
default:
|
||||
ERREXIT(cinfo, JERR_BAD_PARAM);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
GLOBAL(int)
|
||||
jpeg_c_get_int_param (const j_compress_ptr cinfo, J_INT_PARAM param)
|
||||
{
|
||||
switch (param) {
|
||||
case JINT_COMPRESS_PROFILE:
|
||||
return cinfo->master->compress_profile;
|
||||
case JINT_TRELLIS_FREQ_SPLIT:
|
||||
return cinfo->master->trellis_freq_split;
|
||||
case JINT_TRELLIS_NUM_LOOPS:
|
||||
return cinfo->master->trellis_num_loops;
|
||||
case JINT_BASE_QUANT_TBL_IDX:
|
||||
return cinfo->master->quant_tbl_master_idx;
|
||||
case JINT_DC_SCAN_OPT_MODE:
|
||||
return cinfo->master->dc_scan_opt_mode;
|
||||
default:
|
||||
ERREXIT(cinfo, JERR_BAD_PARAM);
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
236
jchuff.c
236
jchuff.c
@@ -4,7 +4,7 @@
|
||||
* 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, D. R. Commander.
|
||||
* Copyright (C) 2009-2011, 2014 D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README file.
|
||||
*
|
||||
* This file contains Huffman entropy encoding routines.
|
||||
@@ -19,11 +19,38 @@
|
||||
#define JPEG_INTERNALS
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
#include "jchuff.h" /* Declarations shared with jcphuff.c */
|
||||
#include "jchuff.h" /* Declarations shared with jcphuff.c */
|
||||
#include <limits.h>
|
||||
|
||||
static unsigned char jpeg_nbits_table[65536];
|
||||
static int jpeg_nbits_table_init = 0;
|
||||
/*
|
||||
* NOTE: If USE_CLZ_INTRINSIC is defined, then clz/bsr instructions will be
|
||||
* used for bit counting rather than the lookup table. This will reduce the
|
||||
* memory footprint by 64k, which is important for some mobile applications
|
||||
* that create many isolated instances of libjpeg-turbo (web browsers, for
|
||||
* instance.) This may improve performance on some mobile platforms as well.
|
||||
* This feature is enabled by default only on ARM processors, because some x86
|
||||
* chips have a slow implementation of bsr, and the use of clz/bsr cannot be
|
||||
* shown to have a significant performance impact even on the x86 chips that
|
||||
* have a fast implementation of it. When building for ARMv6, you can
|
||||
* explicitly disable the use of clz/bsr by adding -mthumb to the compiler
|
||||
* flags (this defines __thumb__).
|
||||
*/
|
||||
|
||||
/* NOTE: Both GCC and Clang define __GNUC__ */
|
||||
#if defined __GNUC__ && (defined __arm__ || defined __aarch64__)
|
||||
#if !defined __thumb__ || defined __thumb2__
|
||||
#define USE_CLZ_INTRINSIC
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef USE_CLZ_INTRINSIC
|
||||
#define JPEG_NBITS_NONZERO(x) (32 - __builtin_clz(x))
|
||||
#define JPEG_NBITS(x) (x ? JPEG_NBITS_NONZERO(x) : 0)
|
||||
#else
|
||||
#include "jpeg_nbits_table.h"
|
||||
#define JPEG_NBITS(x) (jpeg_nbits_table[x])
|
||||
#define JPEG_NBITS_NONZERO(x) JPEG_NBITS(x)
|
||||
#endif
|
||||
|
||||
#ifndef min
|
||||
#define min(a,b) ((a)<(b)?(a):(b))
|
||||
@@ -37,8 +64,8 @@ static int jpeg_nbits_table_init = 0;
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
size_t put_buffer; /* current bit-accumulation buffer */
|
||||
int put_bits; /* # of bits now in it */
|
||||
size_t put_buffer; /* current bit-accumulation buffer */
|
||||
int put_bits; /* # of bits now in it */
|
||||
int last_dc_val[MAX_COMPS_IN_SCAN]; /* last DC coef for each component */
|
||||
} savable_state;
|
||||
|
||||
@@ -52,12 +79,12 @@ typedef struct {
|
||||
#else
|
||||
#if MAX_COMPS_IN_SCAN == 4
|
||||
#define ASSIGN_STATE(dest,src) \
|
||||
((dest).put_buffer = (src).put_buffer, \
|
||||
(dest).put_bits = (src).put_bits, \
|
||||
(dest).last_dc_val[0] = (src).last_dc_val[0], \
|
||||
(dest).last_dc_val[1] = (src).last_dc_val[1], \
|
||||
(dest).last_dc_val[2] = (src).last_dc_val[2], \
|
||||
(dest).last_dc_val[3] = (src).last_dc_val[3])
|
||||
((dest).put_buffer = (src).put_buffer, \
|
||||
(dest).put_bits = (src).put_bits, \
|
||||
(dest).last_dc_val[0] = (src).last_dc_val[0], \
|
||||
(dest).last_dc_val[1] = (src).last_dc_val[1], \
|
||||
(dest).last_dc_val[2] = (src).last_dc_val[2], \
|
||||
(dest).last_dc_val[3] = (src).last_dc_val[3])
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -65,17 +92,17 @@ typedef struct {
|
||||
typedef struct {
|
||||
struct jpeg_entropy_encoder pub; /* public fields */
|
||||
|
||||
savable_state saved; /* Bit buffer & DC state at start of MCU */
|
||||
savable_state saved; /* Bit buffer & DC state at start of MCU */
|
||||
|
||||
/* These fields are NOT loaded into local working state. */
|
||||
unsigned int restarts_to_go; /* MCUs left in this restart interval */
|
||||
int next_restart_num; /* next restart number to write (0-7) */
|
||||
unsigned int restarts_to_go; /* MCUs left in this restart interval */
|
||||
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];
|
||||
|
||||
#ifdef ENTROPY_OPT_SUPPORTED /* Statistics tables for optimization */
|
||||
#ifdef ENTROPY_OPT_SUPPORTED /* Statistics tables for optimization */
|
||||
long * dc_count_ptrs[NUM_HUFF_TBLS];
|
||||
long * ac_count_ptrs[NUM_HUFF_TBLS];
|
||||
#endif
|
||||
@@ -88,21 +115,20 @@ typedef huff_entropy_encoder * huff_entropy_ptr;
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
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 */
|
||||
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 */
|
||||
} working_state;
|
||||
|
||||
|
||||
/* Forward declarations */
|
||||
METHODDEF(boolean) encode_mcu_huff JPP((j_compress_ptr cinfo,
|
||||
JBLOCKROW *MCU_data));
|
||||
METHODDEF(void) finish_pass_huff JPP((j_compress_ptr cinfo));
|
||||
METHODDEF(boolean) encode_mcu_huff (j_compress_ptr cinfo, JBLOCKROW *MCU_data);
|
||||
METHODDEF(void) finish_pass_huff (j_compress_ptr cinfo);
|
||||
#ifdef ENTROPY_OPT_SUPPORTED
|
||||
METHODDEF(boolean) encode_mcu_gather JPP((j_compress_ptr cinfo,
|
||||
JBLOCKROW *MCU_data));
|
||||
METHODDEF(void) finish_pass_gather JPP((j_compress_ptr cinfo));
|
||||
METHODDEF(boolean) encode_mcu_gather (j_compress_ptr cinfo,
|
||||
JBLOCKROW *MCU_data);
|
||||
METHODDEF(void) finish_pass_gather (j_compress_ptr cinfo);
|
||||
#endif
|
||||
|
||||
|
||||
@@ -140,29 +166,29 @@ start_pass_huff (j_compress_ptr cinfo, boolean gather_statistics)
|
||||
/* Check for invalid table indexes */
|
||||
/* (make_c_derived_tbl does this in the other path) */
|
||||
if (dctbl < 0 || dctbl >= NUM_HUFF_TBLS)
|
||||
ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, dctbl);
|
||||
ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, dctbl);
|
||||
if (actbl < 0 || actbl >= NUM_HUFF_TBLS)
|
||||
ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, actbl);
|
||||
ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, actbl);
|
||||
/* Allocate and zero the statistics tables */
|
||||
/* Note that jpeg_gen_optimal_table expects 257 entries in each table! */
|
||||
if (entropy->dc_count_ptrs[dctbl] == NULL)
|
||||
entropy->dc_count_ptrs[dctbl] = (long *)
|
||||
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
|
||||
257 * SIZEOF(long));
|
||||
MEMZERO(entropy->dc_count_ptrs[dctbl], 257 * SIZEOF(long));
|
||||
entropy->dc_count_ptrs[dctbl] = (long *)
|
||||
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
|
||||
257 * sizeof(long));
|
||||
MEMZERO(entropy->dc_count_ptrs[dctbl], 257 * sizeof(long));
|
||||
if (entropy->ac_count_ptrs[actbl] == NULL)
|
||||
entropy->ac_count_ptrs[actbl] = (long *)
|
||||
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
|
||||
257 * SIZEOF(long));
|
||||
MEMZERO(entropy->ac_count_ptrs[actbl], 257 * SIZEOF(long));
|
||||
entropy->ac_count_ptrs[actbl] = (long *)
|
||||
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
|
||||
257 * sizeof(long));
|
||||
MEMZERO(entropy->ac_count_ptrs[actbl], 257 * sizeof(long));
|
||||
#endif
|
||||
} else {
|
||||
/* Compute derived values for Huffman tables */
|
||||
/* We may do this more than once for a table, but it's not expensive */
|
||||
jpeg_make_c_derived_tbl(cinfo, TRUE, dctbl,
|
||||
& entropy->dc_derived_tbls[dctbl]);
|
||||
& entropy->dc_derived_tbls[dctbl]);
|
||||
jpeg_make_c_derived_tbl(cinfo, FALSE, actbl,
|
||||
& entropy->ac_derived_tbls[actbl]);
|
||||
& entropy->ac_derived_tbls[actbl]);
|
||||
}
|
||||
/* Initialize DC predictions to 0 */
|
||||
entropy->saved.last_dc_val[ci] = 0;
|
||||
@@ -187,7 +213,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;
|
||||
@@ -212,7 +238,7 @@ jpeg_make_c_derived_tbl (j_compress_ptr cinfo, boolean isDC, int tblno,
|
||||
if (*pdtbl == NULL)
|
||||
*pdtbl = (c_derived_tbl *)
|
||||
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
|
||||
SIZEOF(c_derived_tbl));
|
||||
sizeof(c_derived_tbl));
|
||||
dtbl = *pdtbl;
|
||||
|
||||
/* Figure C.1: make table of Huffman code length for each symbol */
|
||||
@@ -220,7 +246,7 @@ jpeg_make_c_derived_tbl (j_compress_ptr cinfo, boolean isDC, int tblno,
|
||||
p = 0;
|
||||
for (l = 1; l <= 16; l++) {
|
||||
i = (int) htbl->bits[l];
|
||||
if (i < 0 || p + i > 256) /* protect against table overrun */
|
||||
if (i < 0 || p + i > 256) /* protect against table overrun */
|
||||
ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);
|
||||
while (i--)
|
||||
huffsize[p++] = (char) l;
|
||||
@@ -255,7 +281,7 @@ jpeg_make_c_derived_tbl (j_compress_ptr cinfo, boolean isDC, int tblno,
|
||||
* this lets us detect duplicate VAL entries here, and later
|
||||
* allows emit_bits to detect any attempt to emit such symbols.
|
||||
*/
|
||||
MEMZERO(dtbl->ehufsi, SIZEOF(dtbl->ehufsi));
|
||||
MEMZERO(dtbl->ehufsi, sizeof(dtbl->ehufsi));
|
||||
|
||||
/* This is also a convenient place to check for out-of-range
|
||||
* and duplicated VAL entries. We allow 0..255 for AC symbols
|
||||
@@ -271,15 +297,6 @@ jpeg_make_c_derived_tbl (j_compress_ptr cinfo, boolean isDC, int tblno,
|
||||
dtbl->ehufco[i] = huffcode[p];
|
||||
dtbl->ehufsi[i] = huffsize[p];
|
||||
}
|
||||
|
||||
if(!jpeg_nbits_table_init) {
|
||||
for(i = 0; i < 65536; i++) {
|
||||
int nbits = 0, temp = i;
|
||||
while (temp) {temp >>= 1; nbits++;}
|
||||
jpeg_nbits_table[i] = nbits;
|
||||
}
|
||||
jpeg_nbits_table_init = 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -287,10 +304,10 @@ jpeg_make_c_derived_tbl (j_compress_ptr cinfo, boolean isDC, int tblno,
|
||||
|
||||
/* Emit a byte, taking 'action' if must suspend. */
|
||||
#define emit_byte(state,val,action) \
|
||||
{ *(state)->next_output_byte++ = (JOCTET) (val); \
|
||||
if (--(state)->free_in_buffer == 0) \
|
||||
if (! dump_buffer(state)) \
|
||||
{ action; } }
|
||||
{ *(state)->next_output_byte++ = (JOCTET) (val); \
|
||||
if (--(state)->free_in_buffer == 0) \
|
||||
if (! dump_buffer(state)) \
|
||||
{ action; } }
|
||||
|
||||
|
||||
LOCAL(boolean)
|
||||
@@ -391,7 +408,16 @@ dump_buffer (working_state * state)
|
||||
#endif
|
||||
|
||||
|
||||
#define BUFSIZE (DCTSIZE2 * 2)
|
||||
/* Although it is exceedingly rare, it is possible for a Huffman-encoded
|
||||
* coefficient block to be larger than the 128-byte unencoded block. For each
|
||||
* of the 64 coefficients, PUT_BITS is invoked twice, and each invocation can
|
||||
* theoretically store 16 bits (for a maximum of 2048 bits or 256 bytes per
|
||||
* encoded block.) If, for instance, one artificially sets the AC
|
||||
* coefficients to alternating values of 32767 and -32768 (using the JPEG
|
||||
* scanning order-- 1, 8, 16, etc.), then this will produce an encoded block
|
||||
* larger than 200 bytes.
|
||||
*/
|
||||
#define BUFSIZE (DCTSIZE2 * 4)
|
||||
|
||||
#define LOAD_BUFFER() { \
|
||||
if (state->free_in_buffer < BUFSIZE) { \
|
||||
@@ -438,7 +464,7 @@ flush_bits (working_state * state)
|
||||
PUT_BITS(0x7F, 7)
|
||||
while (put_bits >= 8) EMIT_BYTE()
|
||||
|
||||
state->cur.put_buffer = 0; /* and reset bit-buffer to empty */
|
||||
state->cur.put_buffer = 0; /* and reset bit-buffer to empty */
|
||||
state->cur.put_bits = 0;
|
||||
STORE_BUFFER()
|
||||
|
||||
@@ -450,7 +476,7 @@ flush_bits (working_state * state)
|
||||
|
||||
LOCAL(boolean)
|
||||
encode_one_block (working_state * state, JCOEFPTR block, int last_dc_val,
|
||||
c_derived_tbl *dctbl, c_derived_tbl *actbl)
|
||||
c_derived_tbl *dctbl, c_derived_tbl *actbl)
|
||||
{
|
||||
int temp, temp2, temp3;
|
||||
int nbits;
|
||||
@@ -482,7 +508,7 @@ encode_one_block (working_state * state, JCOEFPTR block, int last_dc_val,
|
||||
temp2 += temp3;
|
||||
|
||||
/* Find the number of bits needed for the magnitude of the coefficient */
|
||||
nbits = jpeg_nbits_table[temp];
|
||||
nbits = JPEG_NBITS(temp);
|
||||
|
||||
/* Emit the Huffman-coded symbol for the number of bits */
|
||||
code = dctbl->ehufco[nbits];
|
||||
@@ -500,7 +526,7 @@ encode_one_block (working_state * state, JCOEFPTR block, int last_dc_val,
|
||||
|
||||
/* Encode the AC coefficients per section F.1.2.2 */
|
||||
|
||||
r = 0; /* r = run length of zeros */
|
||||
r = 0; /* r = run length of zeros */
|
||||
|
||||
/* Manually unroll the k loop to eliminate the counter variable. This
|
||||
* improves performance greatly on systems with a limited number of
|
||||
@@ -516,7 +542,7 @@ encode_one_block (working_state * state, JCOEFPTR block, int last_dc_val,
|
||||
temp ^= temp3; \
|
||||
temp -= temp3; \
|
||||
temp2 += temp3; \
|
||||
nbits = jpeg_nbits_table[temp]; \
|
||||
nbits = JPEG_NBITS_NONZERO(temp); \
|
||||
/* if run length > 15, must emit special run-length-16 codes (0xF0) */ \
|
||||
while (r > 15) { \
|
||||
EMIT_BITS(code_0xf0, size_0xf0) \
|
||||
@@ -606,7 +632,7 @@ encode_mcu_huff (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
|
||||
if (cinfo->restart_interval) {
|
||||
if (entropy->restarts_to_go == 0)
|
||||
if (! emit_restart(&state, entropy->next_restart_num))
|
||||
return FALSE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* Encode the MCU data blocks */
|
||||
@@ -614,9 +640,9 @@ encode_mcu_huff (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
|
||||
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]))
|
||||
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];
|
||||
@@ -686,7 +712,7 @@ finish_pass_huff (j_compress_ptr cinfo)
|
||||
|
||||
LOCAL(void)
|
||||
htest_one_block (j_compress_ptr cinfo, JCOEFPTR block, int last_dc_val,
|
||||
long dc_counts[], long ac_counts[])
|
||||
long dc_counts[], long ac_counts[])
|
||||
{
|
||||
register int temp;
|
||||
register int nbits;
|
||||
@@ -715,7 +741,7 @@ htest_one_block (j_compress_ptr cinfo, JCOEFPTR block, int last_dc_val,
|
||||
|
||||
/* Encode the AC coefficients per section F.1.2.2 */
|
||||
|
||||
r = 0; /* r = run length of zeros */
|
||||
r = 0; /* r = run length of zeros */
|
||||
|
||||
for (k = 1; k < DCTSIZE2; k++) {
|
||||
if ((temp = block[jpeg_natural_order[k]]) == 0) {
|
||||
@@ -723,21 +749,21 @@ htest_one_block (j_compress_ptr cinfo, JCOEFPTR block, int last_dc_val,
|
||||
} else {
|
||||
/* if run length > 15, must emit special run-length-16 codes (0xF0) */
|
||||
while (r > 15) {
|
||||
ac_counts[0xF0]++;
|
||||
r -= 16;
|
||||
ac_counts[0xF0]++;
|
||||
r -= 16;
|
||||
}
|
||||
|
||||
/* Find the number of bits needed for the magnitude of the coefficient */
|
||||
if (temp < 0)
|
||||
temp = -temp;
|
||||
temp = -temp;
|
||||
|
||||
/* Find the number of bits needed for the magnitude of the coefficient */
|
||||
nbits = 1; /* there must be at least one 1 bit */
|
||||
nbits = 1; /* there must be at least one 1 bit */
|
||||
while ((temp >>= 1))
|
||||
nbits++;
|
||||
nbits++;
|
||||
/* Check for out-of-range coefficient values */
|
||||
if (nbits > MAX_COEF_BITS)
|
||||
ERREXIT(cinfo, JERR_BAD_DCT_COEF);
|
||||
ERREXIT(cinfo, JERR_BAD_DCT_COEF);
|
||||
|
||||
/* Count Huffman symbol for run length / number of bits */
|
||||
ac_counts[(r << 4) + nbits]++;
|
||||
@@ -769,7 +795,7 @@ encode_mcu_gather (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
|
||||
if (entropy->restarts_to_go == 0) {
|
||||
/* Re-initialize DC predictions to 0 */
|
||||
for (ci = 0; ci < cinfo->comps_in_scan; ci++)
|
||||
entropy->saved.last_dc_val[ci] = 0;
|
||||
entropy->saved.last_dc_val[ci] = 0;
|
||||
/* Update restart state */
|
||||
entropy->restarts_to_go = cinfo->restart_interval;
|
||||
}
|
||||
@@ -780,8 +806,8 @@ encode_mcu_gather (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
|
||||
ci = cinfo->MCU_membership[blkn];
|
||||
compptr = cinfo->cur_comp_info[ci];
|
||||
htest_one_block(cinfo, MCU_data[blkn][0], entropy->saved.last_dc_val[ci],
|
||||
entropy->dc_count_ptrs[compptr->dc_tbl_no],
|
||||
entropy->ac_count_ptrs[compptr->ac_tbl_no]);
|
||||
entropy->dc_count_ptrs[compptr->dc_tbl_no],
|
||||
entropy->ac_count_ptrs[compptr->ac_tbl_no]);
|
||||
entropy->saved.last_dc_val[ci] = MCU_data[blkn][0][0];
|
||||
}
|
||||
|
||||
@@ -820,22 +846,22 @@ 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[])
|
||||
{
|
||||
#define MAX_CLEN 32 /* assumed maximum initial code length */
|
||||
UINT8 bits[MAX_CLEN+1]; /* bits[k] = # of symbols with code length k */
|
||||
int codesize[257]; /* codesize[k] = code length of symbol k */
|
||||
int others[257]; /* next symbol in current branch of tree */
|
||||
#define MAX_CLEN 32 /* assumed maximum initial code length */
|
||||
UINT8 bits[MAX_CLEN+1]; /* bits[k] = # of symbols with code length k */
|
||||
int codesize[257]; /* codesize[k] = code length of symbol k */
|
||||
int others[257]; /* next symbol in current branch of tree */
|
||||
int c1, c2;
|
||||
int p, i, j;
|
||||
long v;
|
||||
|
||||
/* This algorithm is explained in section K.2 of the JPEG standard */
|
||||
|
||||
MEMZERO(bits, SIZEOF(bits));
|
||||
MEMZERO(codesize, SIZEOF(codesize));
|
||||
MEMZERO(bits, sizeof(bits));
|
||||
MEMZERO(codesize, sizeof(codesize));
|
||||
for (i = 0; i < 257; i++)
|
||||
others[i] = -1; /* init links to empty */
|
||||
others[i] = -1; /* init links to empty */
|
||||
|
||||
freq[256] = 1; /* make sure 256 has a nonzero count */
|
||||
freq[256] = 1; /* make sure 256 has a nonzero count */
|
||||
/* Including the pseudo-symbol 256 in the Huffman procedure guarantees
|
||||
* that no real symbol is given code-value of all ones, because 256
|
||||
* will be placed last in the largest codeword category.
|
||||
@@ -850,8 +876,8 @@ jpeg_gen_optimal_table (j_compress_ptr cinfo, JHUFF_TBL * htbl, long freq[])
|
||||
v = 1000000000L;
|
||||
for (i = 0; i <= 256; i++) {
|
||||
if (freq[i] && freq[i] <= v) {
|
||||
v = freq[i];
|
||||
c1 = i;
|
||||
v = freq[i];
|
||||
c1 = i;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -861,8 +887,8 @@ jpeg_gen_optimal_table (j_compress_ptr cinfo, JHUFF_TBL * htbl, long freq[])
|
||||
v = 1000000000L;
|
||||
for (i = 0; i <= 256; i++) {
|
||||
if (freq[i] && freq[i] <= v && i != c1) {
|
||||
v = freq[i];
|
||||
c2 = i;
|
||||
v = freq[i];
|
||||
c2 = i;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -881,7 +907,7 @@ jpeg_gen_optimal_table (j_compress_ptr cinfo, JHUFF_TBL * htbl, long freq[])
|
||||
codesize[c1]++;
|
||||
}
|
||||
|
||||
others[c1] = c2; /* chain c2 onto c1's tree branch */
|
||||
others[c1] = c2; /* chain c2 onto c1's tree branch */
|
||||
|
||||
/* Increment the codesize of everything in c2's tree branch */
|
||||
codesize[c2]++;
|
||||
@@ -897,7 +923,7 @@ jpeg_gen_optimal_table (j_compress_ptr cinfo, JHUFF_TBL * htbl, long freq[])
|
||||
/* The JPEG standard seems to think that this can't happen, */
|
||||
/* but I'm paranoid... */
|
||||
if (codesize[i] > MAX_CLEN)
|
||||
ERREXIT(cinfo, JERR_HUFF_CLEN_OVERFLOW);
|
||||
ERREXIT(cinfo, JERR_HUFF_CLEN_OVERFLOW);
|
||||
|
||||
bits[codesize[i]]++;
|
||||
}
|
||||
@@ -916,24 +942,24 @@ jpeg_gen_optimal_table (j_compress_ptr cinfo, JHUFF_TBL * htbl, long freq[])
|
||||
|
||||
for (i = MAX_CLEN; i > 16; i--) {
|
||||
while (bits[i] > 0) {
|
||||
j = i - 2; /* find length of new prefix to be used */
|
||||
j = i - 2; /* find length of new prefix to be used */
|
||||
while (bits[j] == 0)
|
||||
j--;
|
||||
j--;
|
||||
|
||||
bits[i] -= 2; /* remove two symbols */
|
||||
bits[i-1]++; /* one goes in this length */
|
||||
bits[j+1] += 2; /* two new symbols in this length */
|
||||
bits[j]--; /* symbol of this length is now a prefix */
|
||||
bits[i] -= 2; /* remove two symbols */
|
||||
bits[i-1]++; /* one goes in this length */
|
||||
bits[j+1] += 2; /* two new symbols in this length */
|
||||
bits[j]--; /* symbol of this length is now a prefix */
|
||||
}
|
||||
}
|
||||
|
||||
/* Remove the count for the pseudo-symbol 256 from the largest codelength */
|
||||
while (bits[i] == 0) /* find largest codelength still in use */
|
||||
while (bits[i] == 0) /* find largest codelength still in use */
|
||||
i--;
|
||||
bits[i]--;
|
||||
|
||||
/* Return final symbol counts (only for lengths 0..16) */
|
||||
MEMCOPY(htbl->bits, bits, SIZEOF(htbl->bits));
|
||||
MEMCOPY(htbl->bits, bits, sizeof(htbl->bits));
|
||||
|
||||
/* Return a list of the symbols sorted by code length */
|
||||
/* It's not real clear to me why we don't need to consider the codelength
|
||||
@@ -943,8 +969,8 @@ jpeg_gen_optimal_table (j_compress_ptr cinfo, JHUFF_TBL * htbl, long freq[])
|
||||
for (i = 1; i <= MAX_CLEN; i++) {
|
||||
for (j = 0; j <= 255; j++) {
|
||||
if (codesize[j] == i) {
|
||||
htbl->huffval[p] = (UINT8) j;
|
||||
p++;
|
||||
htbl->huffval[p] = (UINT8) j;
|
||||
p++;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -971,8 +997,8 @@ finish_pass_gather (j_compress_ptr cinfo)
|
||||
/* It's important not to apply jpeg_gen_optimal_table more than once
|
||||
* per table, because it clobbers the input frequency counts!
|
||||
*/
|
||||
MEMZERO(did_dc, SIZEOF(did_dc));
|
||||
MEMZERO(did_ac, SIZEOF(did_ac));
|
||||
MEMZERO(did_dc, sizeof(did_dc));
|
||||
MEMZERO(did_ac, sizeof(did_ac));
|
||||
|
||||
for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
|
||||
compptr = cinfo->cur_comp_info[ci];
|
||||
@@ -981,14 +1007,14 @@ finish_pass_gather (j_compress_ptr cinfo)
|
||||
if (! did_dc[dctbl]) {
|
||||
htblptr = & cinfo->dc_huff_tbl_ptrs[dctbl];
|
||||
if (*htblptr == NULL)
|
||||
*htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo);
|
||||
*htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo);
|
||||
jpeg_gen_optimal_table(cinfo, *htblptr, entropy->dc_count_ptrs[dctbl]);
|
||||
did_dc[dctbl] = TRUE;
|
||||
}
|
||||
if (! did_ac[actbl]) {
|
||||
htblptr = & cinfo->ac_huff_tbl_ptrs[actbl];
|
||||
if (*htblptr == NULL)
|
||||
*htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo);
|
||||
*htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo);
|
||||
jpeg_gen_optimal_table(cinfo, *htblptr, entropy->ac_count_ptrs[actbl]);
|
||||
did_ac[actbl] = TRUE;
|
||||
}
|
||||
@@ -1011,7 +1037,7 @@ jinit_huff_encoder (j_compress_ptr cinfo)
|
||||
|
||||
entropy = (huff_entropy_ptr)
|
||||
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
|
||||
SIZEOF(huff_entropy_encoder));
|
||||
sizeof(huff_entropy_encoder));
|
||||
cinfo->entropy = (struct jpeg_entropy_encoder *) entropy;
|
||||
entropy->pub.start_pass = start_pass_huff;
|
||||
|
||||
|
||||
26
jchuff.h
26
jchuff.h
@@ -1,10 +1,12 @@
|
||||
/*
|
||||
* jchuff.h
|
||||
*
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1991-1997, Thomas G. Lane.
|
||||
* It was modified by The libjpeg-turbo Project to include only code relevant
|
||||
* to libjpeg-turbo.
|
||||
* mozjpeg Modifications:
|
||||
* Copyright (C) 2014, Mozilla Corporation.
|
||||
* This file is part of the Independent JPEG Group's software.
|
||||
* For conditions of distribution and use, see the accompanying README file.
|
||||
*
|
||||
* This file contains declarations for Huffman entropy encoding routines
|
||||
@@ -27,27 +29,21 @@
|
||||
/* Derived data constructed for each Huffman table */
|
||||
|
||||
typedef struct {
|
||||
unsigned int ehufco[256]; /* code for each symbol */
|
||||
char ehufsi[256]; /* length of code for each symbol */
|
||||
unsigned int ehufco[256]; /* code for each symbol */
|
||||
char ehufsi[256]; /* length of code for each symbol */
|
||||
/* If no code has been allocated for a symbol S, ehufsi[S] contains 0 */
|
||||
} c_derived_tbl;
|
||||
|
||||
/* Short forms of external names for systems with brain-damaged linkers. */
|
||||
|
||||
#ifdef NEED_SHORT_EXTERNAL_NAMES
|
||||
#define jpeg_make_c_derived_tbl jMkCDerived
|
||||
#define jpeg_gen_optimal_table jGenOptTbl
|
||||
#endif /* NEED_SHORT_EXTERNAL_NAMES */
|
||||
|
||||
/* Expand a Huffman table definition into the derived format */
|
||||
EXTERN(void) jpeg_make_c_derived_tbl
|
||||
JPP((j_compress_ptr cinfo, boolean isDC, int tblno,
|
||||
c_derived_tbl ** pdtbl));
|
||||
(j_compress_ptr cinfo, boolean isDC, int tblno,
|
||||
c_derived_tbl ** pdtbl);
|
||||
|
||||
/* Generate an optimal table definition given the specified counts */
|
||||
EXTERN(void) jpeg_gen_optimal_table
|
||||
JPP((j_compress_ptr cinfo, JHUFF_TBL * htbl, long freq[]));
|
||||
(j_compress_ptr cinfo, JHUFF_TBL * htbl, long freq[]);
|
||||
|
||||
EXTERN(void) quantize_trellis
|
||||
JPP((j_compress_ptr cinfo, c_derived_tbl *actbl, JBLOCKROW coef_blocks, JBLOCKROW src, JDIMENSION num_blocks,
|
||||
JQUANT_TBL * qtbl, double *norm_src, double *norm_coef));
|
||||
(j_compress_ptr cinfo, c_derived_tbl *dctbl, c_derived_tbl *actbl, JBLOCKROW coef_blocks, JBLOCKROW src, JDIMENSION num_blocks,
|
||||
JQUANT_TBL * qtbl, double *norm_src, double *norm_coef, JCOEF *last_dc_val,
|
||||
JBLOCKROW coef_blocks_above, JBLOCKROW src_above);
|
||||
|
||||
3
jcinit.c
3
jcinit.c
@@ -62,7 +62,8 @@ jinit_compress_master (j_compress_ptr cinfo)
|
||||
|
||||
/* Need a full-image coefficient buffer in any multi-pass mode. */
|
||||
jinit_c_coef_controller(cinfo,
|
||||
(boolean) (cinfo->num_scans > 1 || cinfo->optimize_coding || cinfo->optimize_scans));
|
||||
(boolean) (cinfo->num_scans > 1 || cinfo->optimize_coding ||
|
||||
cinfo->master->optimize_scans || cinfo->master->trellis_quant));
|
||||
jinit_c_main_controller(cinfo, FALSE /* never need full buffer here */);
|
||||
|
||||
jinit_marker_writer(cinfo);
|
||||
|
||||
186
jcmainct.c
186
jcmainct.c
@@ -1,8 +1,10 @@
|
||||
/*
|
||||
* jcmainct.c
|
||||
*
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1994-1996, Thomas G. Lane.
|
||||
* This file is part of the Independent JPEG Group's software.
|
||||
* 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.
|
||||
*
|
||||
* This file contains the main buffer controller for compression.
|
||||
@@ -15,36 +17,21 @@
|
||||
#include "jpeglib.h"
|
||||
|
||||
|
||||
/* Note: currently, there is no operating mode in which a full-image buffer
|
||||
* is needed at this step. If there were, that mode could not be used with
|
||||
* "raw data" input, since this module is bypassed in that case. However,
|
||||
* we've left the code here for possible use in special applications.
|
||||
*/
|
||||
#undef FULL_MAIN_BUFFER_SUPPORTED
|
||||
|
||||
|
||||
/* Private buffer controller object */
|
||||
|
||||
typedef struct {
|
||||
struct jpeg_c_main_controller pub; /* public fields */
|
||||
|
||||
JDIMENSION cur_iMCU_row; /* number of current iMCU row */
|
||||
JDIMENSION rowgroup_ctr; /* counts row groups received in iMCU row */
|
||||
boolean suspended; /* remember if we suspended output */
|
||||
J_BUF_MODE pass_mode; /* current operating mode */
|
||||
JDIMENSION cur_iMCU_row; /* number of current iMCU row */
|
||||
JDIMENSION rowgroup_ctr; /* counts row groups received in iMCU row */
|
||||
boolean suspended; /* remember if we suspended output */
|
||||
J_BUF_MODE pass_mode; /* current operating mode */
|
||||
|
||||
/* If using just a strip buffer, this points to the entire set of buffers
|
||||
* (we allocate one for each component). In the full-image case, this
|
||||
* points to the currently accessible strips of the virtual arrays.
|
||||
*/
|
||||
JSAMPARRAY buffer[MAX_COMPONENTS];
|
||||
|
||||
#ifdef FULL_MAIN_BUFFER_SUPPORTED
|
||||
/* If using full-image storage, this array holds pointers to virtual-array
|
||||
* control blocks for each component. Unused if not full-image storage.
|
||||
*/
|
||||
jvirt_sarray_ptr whole_image[MAX_COMPONENTS];
|
||||
#endif
|
||||
} my_main_controller;
|
||||
|
||||
typedef my_main_controller * my_main_ptr;
|
||||
@@ -52,13 +39,8 @@ typedef my_main_controller * my_main_ptr;
|
||||
|
||||
/* Forward declarations */
|
||||
METHODDEF(void) process_data_simple_main
|
||||
JPP((j_compress_ptr cinfo, JSAMPARRAY input_buf,
|
||||
JDIMENSION *in_row_ctr, JDIMENSION in_rows_avail));
|
||||
#ifdef FULL_MAIN_BUFFER_SUPPORTED
|
||||
METHODDEF(void) process_data_buffer_main
|
||||
JPP((j_compress_ptr cinfo, JSAMPARRAY input_buf,
|
||||
JDIMENSION *in_row_ctr, JDIMENSION in_rows_avail));
|
||||
#endif
|
||||
(j_compress_ptr cinfo, JSAMPARRAY input_buf, JDIMENSION *in_row_ctr,
|
||||
JDIMENSION in_rows_avail);
|
||||
|
||||
|
||||
/*
|
||||
@@ -74,32 +56,14 @@ start_pass_main (j_compress_ptr cinfo, J_BUF_MODE pass_mode)
|
||||
if (cinfo->raw_data_in)
|
||||
return;
|
||||
|
||||
main_ptr->cur_iMCU_row = 0; /* initialize counters */
|
||||
if (pass_mode != JBUF_PASS_THRU)
|
||||
ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
|
||||
|
||||
main_ptr->cur_iMCU_row = 0; /* initialize counters */
|
||||
main_ptr->rowgroup_ctr = 0;
|
||||
main_ptr->suspended = FALSE;
|
||||
main_ptr->pass_mode = pass_mode; /* save mode for use by process_data */
|
||||
|
||||
switch (pass_mode) {
|
||||
case JBUF_PASS_THRU:
|
||||
#ifdef FULL_MAIN_BUFFER_SUPPORTED
|
||||
if (main_ptr->whole_image[0] != NULL)
|
||||
ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
|
||||
#endif
|
||||
main_ptr->pub.process_data = process_data_simple_main;
|
||||
break;
|
||||
#ifdef FULL_MAIN_BUFFER_SUPPORTED
|
||||
case JBUF_SAVE_SOURCE:
|
||||
case JBUF_CRANK_DEST:
|
||||
case JBUF_SAVE_AND_PASS:
|
||||
if (main_ptr->whole_image[0] == NULL)
|
||||
ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
|
||||
main_ptr->pub.process_data = process_data_buffer_main;
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
|
||||
break;
|
||||
}
|
||||
main_ptr->pass_mode = pass_mode; /* save mode for use by process_data */
|
||||
main_ptr->pub.process_data = process_data_simple_main;
|
||||
}
|
||||
|
||||
|
||||
@@ -111,8 +75,8 @@ start_pass_main (j_compress_ptr cinfo, J_BUF_MODE pass_mode)
|
||||
|
||||
METHODDEF(void)
|
||||
process_data_simple_main (j_compress_ptr cinfo,
|
||||
JSAMPARRAY input_buf, JDIMENSION *in_row_ctr,
|
||||
JDIMENSION in_rows_avail)
|
||||
JSAMPARRAY input_buf, JDIMENSION *in_row_ctr,
|
||||
JDIMENSION in_rows_avail)
|
||||
{
|
||||
my_main_ptr main_ptr = (my_main_ptr) cinfo->main;
|
||||
|
||||
@@ -120,9 +84,9 @@ process_data_simple_main (j_compress_ptr cinfo,
|
||||
/* Read input data if we haven't filled the main buffer yet */
|
||||
if (main_ptr->rowgroup_ctr < DCTSIZE)
|
||||
(*cinfo->prep->pre_process_data) (cinfo,
|
||||
input_buf, in_row_ctr, in_rows_avail,
|
||||
main_ptr->buffer, &main_ptr->rowgroup_ctr,
|
||||
(JDIMENSION) DCTSIZE);
|
||||
input_buf, in_row_ctr, in_rows_avail,
|
||||
main_ptr->buffer, &main_ptr->rowgroup_ctr,
|
||||
(JDIMENSION) DCTSIZE);
|
||||
|
||||
/* If we don't have a full iMCU row buffered, return to application for
|
||||
* more data. Note that preprocessor will always pad to fill the iMCU row
|
||||
@@ -140,8 +104,8 @@ process_data_simple_main (j_compress_ptr cinfo,
|
||||
* think we were done.
|
||||
*/
|
||||
if (! main_ptr->suspended) {
|
||||
(*in_row_ctr)--;
|
||||
main_ptr->suspended = TRUE;
|
||||
(*in_row_ctr)--;
|
||||
main_ptr->suspended = TRUE;
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -158,85 +122,6 @@ process_data_simple_main (j_compress_ptr cinfo,
|
||||
}
|
||||
|
||||
|
||||
#ifdef FULL_MAIN_BUFFER_SUPPORTED
|
||||
|
||||
/*
|
||||
* Process some data.
|
||||
* This routine handles all of the modes that use a full-size buffer.
|
||||
*/
|
||||
|
||||
METHODDEF(void)
|
||||
process_data_buffer_main (j_compress_ptr cinfo,
|
||||
JSAMPARRAY input_buf, JDIMENSION *in_row_ctr,
|
||||
JDIMENSION in_rows_avail)
|
||||
{
|
||||
my_main_ptr main_ptr = (my_main_ptr) cinfo->main;
|
||||
int ci;
|
||||
jpeg_component_info *compptr;
|
||||
boolean writing = (main_ptr->pass_mode != JBUF_CRANK_DEST);
|
||||
|
||||
while (main_ptr->cur_iMCU_row < cinfo->total_iMCU_rows) {
|
||||
/* Realign the virtual buffers if at the start of an iMCU row. */
|
||||
if (main_ptr->rowgroup_ctr == 0) {
|
||||
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
|
||||
ci++, compptr++) {
|
||||
main_ptr->buffer[ci] = (*cinfo->mem->access_virt_sarray)
|
||||
((j_common_ptr) cinfo, main_ptr->whole_image[ci],
|
||||
main_ptr->cur_iMCU_row * (compptr->v_samp_factor * DCTSIZE),
|
||||
(JDIMENSION) (compptr->v_samp_factor * DCTSIZE), writing);
|
||||
}
|
||||
/* In a read pass, pretend we just read some source data. */
|
||||
if (! writing) {
|
||||
*in_row_ctr += cinfo->max_v_samp_factor * DCTSIZE;
|
||||
main_ptr->rowgroup_ctr = DCTSIZE;
|
||||
}
|
||||
}
|
||||
|
||||
/* If a write pass, read input data until the current iMCU row is full. */
|
||||
/* Note: preprocessor will pad if necessary to fill the last iMCU row. */
|
||||
if (writing) {
|
||||
(*cinfo->prep->pre_process_data) (cinfo,
|
||||
input_buf, in_row_ctr, in_rows_avail,
|
||||
main_ptr->buffer, &main_ptr->rowgroup_ctr,
|
||||
(JDIMENSION) DCTSIZE);
|
||||
/* Return to application if we need more data to fill the iMCU row. */
|
||||
if (main_ptr->rowgroup_ctr < DCTSIZE)
|
||||
return;
|
||||
}
|
||||
|
||||
/* Emit data, unless this is a sink-only pass. */
|
||||
if (main_ptr->pass_mode != JBUF_SAVE_SOURCE) {
|
||||
if (! (*cinfo->coef->compress_data) (cinfo, main_ptr->buffer)) {
|
||||
/* If compressor did not consume the whole row, then we must need to
|
||||
* suspend processing and return to the application. In this situation
|
||||
* we pretend we didn't yet consume the last input row; otherwise, if
|
||||
* it happened to be the last row of the image, the application would
|
||||
* think we were done.
|
||||
*/
|
||||
if (! main_ptr->suspended) {
|
||||
(*in_row_ctr)--;
|
||||
main_ptr->suspended = TRUE;
|
||||
}
|
||||
return;
|
||||
}
|
||||
/* We did finish the row. Undo our little suspension hack if a previous
|
||||
* call suspended; then mark the main buffer empty.
|
||||
*/
|
||||
if (main_ptr->suspended) {
|
||||
(*in_row_ctr)++;
|
||||
main_ptr->suspended = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
/* If get here, we are done with this iMCU row. Mark buffer empty. */
|
||||
main_ptr->rowgroup_ctr = 0;
|
||||
main_ptr->cur_iMCU_row++;
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* FULL_MAIN_BUFFER_SUPPORTED */
|
||||
|
||||
|
||||
/*
|
||||
* Initialize main buffer controller.
|
||||
*/
|
||||
@@ -250,7 +135,7 @@ jinit_c_main_controller (j_compress_ptr cinfo, boolean need_full_buffer)
|
||||
|
||||
main_ptr = (my_main_ptr)
|
||||
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
|
||||
SIZEOF(my_main_controller));
|
||||
sizeof(my_main_controller));
|
||||
cinfo->main = (struct jpeg_c_main_controller *) main_ptr;
|
||||
main_ptr->pub.start_pass = start_pass_main;
|
||||
|
||||
@@ -262,32 +147,15 @@ jinit_c_main_controller (j_compress_ptr cinfo, boolean need_full_buffer)
|
||||
* may be of a different size.
|
||||
*/
|
||||
if (need_full_buffer) {
|
||||
#ifdef FULL_MAIN_BUFFER_SUPPORTED
|
||||
/* Allocate a full-image virtual array for each component */
|
||||
/* Note we pad the bottom to a multiple of the iMCU height */
|
||||
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
|
||||
ci++, compptr++) {
|
||||
main_ptr->whole_image[ci] = (*cinfo->mem->request_virt_sarray)
|
||||
((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE,
|
||||
compptr->width_in_blocks * DCTSIZE,
|
||||
(JDIMENSION) jround_up((long) compptr->height_in_blocks,
|
||||
(long) compptr->v_samp_factor) * DCTSIZE,
|
||||
(JDIMENSION) (compptr->v_samp_factor * DCTSIZE));
|
||||
}
|
||||
#else
|
||||
ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
|
||||
#endif
|
||||
} else {
|
||||
#ifdef FULL_MAIN_BUFFER_SUPPORTED
|
||||
main_ptr->whole_image[0] = NULL; /* flag for no virtual arrays */
|
||||
#endif
|
||||
/* Allocate a strip buffer for each component */
|
||||
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
|
||||
ci++, compptr++) {
|
||||
ci++, compptr++) {
|
||||
main_ptr->buffer[ci] = (*cinfo->mem->alloc_sarray)
|
||||
((j_common_ptr) cinfo, JPOOL_IMAGE,
|
||||
compptr->width_in_blocks * DCTSIZE,
|
||||
(JDIMENSION) (compptr->v_samp_factor * DCTSIZE));
|
||||
((j_common_ptr) cinfo, JPOOL_IMAGE,
|
||||
compptr->width_in_blocks * DCTSIZE,
|
||||
(JDIMENSION) (compptr->v_samp_factor * DCTSIZE));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
292
jcmarker.c
292
jcmarker.c
@@ -17,7 +17,7 @@
|
||||
#include "jpegcomp.h"
|
||||
|
||||
|
||||
typedef enum { /* JPEG marker codes */
|
||||
typedef enum { /* JPEG marker codes */
|
||||
M_SOF0 = 0xc0,
|
||||
M_SOF1 = 0xc1,
|
||||
M_SOF2 = 0xc2,
|
||||
@@ -173,7 +173,7 @@ emit_dqt (j_compress_ptr cinfo, int index)
|
||||
/* The table entries must be emitted in zigzag order. */
|
||||
unsigned int qval = qtbl->quantval[jpeg_natural_order[i]];
|
||||
if (prec)
|
||||
emit_byte(cinfo, (int) (qval >> 8));
|
||||
emit_byte(cinfo, (int) (qval >> 8));
|
||||
emit_byte(cinfo, (int) (qval & 0xFF));
|
||||
}
|
||||
|
||||
@@ -183,6 +183,72 @@ emit_dqt (j_compress_ptr cinfo, int index)
|
||||
return prec;
|
||||
}
|
||||
|
||||
LOCAL(int)
|
||||
emit_multi_dqt (j_compress_ptr cinfo)
|
||||
/* Emits a DQT marker containing all quantization tables */
|
||||
/* Returns number of emitted 16-bit tables, or -1 for failed for baseline checking. */
|
||||
{
|
||||
int prec[MAX_COMPONENTS];
|
||||
int seen[MAX_COMPONENTS] = { 0 };
|
||||
int fin_prec = 0;
|
||||
int ci;
|
||||
int size = 0;
|
||||
|
||||
if (cinfo->master->compress_profile == JCP_FASTEST)
|
||||
return -1;
|
||||
|
||||
for (ci = 0; ci < cinfo->num_components; ci++) {
|
||||
int tbl_num = cinfo->comp_info[ci].quant_tbl_no;
|
||||
int i;
|
||||
JQUANT_TBL * qtbl = cinfo->quant_tbl_ptrs[tbl_num];
|
||||
|
||||
if (qtbl == NULL || qtbl->sent_table == TRUE)
|
||||
return -1;
|
||||
|
||||
prec[ci] = 0;
|
||||
for (i = 0; i < DCTSIZE2; i++)
|
||||
prec[ci] = !!(prec[ci] + (qtbl->quantval[i] > 255));
|
||||
|
||||
fin_prec += prec[ci];
|
||||
}
|
||||
|
||||
emit_marker(cinfo, M_DQT);
|
||||
|
||||
for (ci = 0; ci < cinfo->num_components; ci++) {
|
||||
int tbl_num = cinfo->comp_info[ci].quant_tbl_no;
|
||||
|
||||
if (!seen[tbl_num]) {
|
||||
size += DCTSIZE2 * (prec[ci] + 1) + 1;
|
||||
seen[tbl_num] = 1;
|
||||
}
|
||||
}
|
||||
size += 2;
|
||||
|
||||
emit_2bytes(cinfo, size);
|
||||
|
||||
for (ci = 0; ci < cinfo->num_components; ci++) {
|
||||
int tbl_num = cinfo->comp_info[ci].quant_tbl_no;
|
||||
int i;
|
||||
JQUANT_TBL * qtbl = cinfo->quant_tbl_ptrs[tbl_num];
|
||||
|
||||
if (qtbl->sent_table == TRUE)
|
||||
continue;
|
||||
|
||||
emit_byte(cinfo, tbl_num + (prec[ci] << 4));
|
||||
|
||||
for (i = 0; i < DCTSIZE2; i++) {
|
||||
unsigned int qval = qtbl->quantval[jpeg_natural_order[i]];
|
||||
|
||||
if (prec[ci])
|
||||
emit_byte(cinfo, (int) (qval >> 8));
|
||||
emit_byte(cinfo, (int) (qval & 0xFF));
|
||||
}
|
||||
|
||||
qtbl->sent_table = TRUE;
|
||||
}
|
||||
|
||||
return fin_prec;
|
||||
}
|
||||
|
||||
LOCAL(void)
|
||||
emit_dht (j_compress_ptr cinfo, int index, boolean is_ac)
|
||||
@@ -193,7 +259,7 @@ emit_dht (j_compress_ptr cinfo, int index, boolean is_ac)
|
||||
|
||||
if (is_ac) {
|
||||
htbl = cinfo->ac_huff_tbl_ptrs[index];
|
||||
index += 0x10; /* output index has AC bit set */
|
||||
index += 0x10; /* output index has AC bit set */
|
||||
} else {
|
||||
htbl = cinfo->dc_huff_tbl_ptrs[index];
|
||||
}
|
||||
@@ -221,6 +287,115 @@ emit_dht (j_compress_ptr cinfo, int index, boolean is_ac)
|
||||
}
|
||||
}
|
||||
|
||||
LOCAL(boolean)
|
||||
emit_multi_dht (j_compress_ptr cinfo)
|
||||
/* Emit all DHT markers */
|
||||
/* Returns FALSE on failure, TRUE otherwise. */
|
||||
{
|
||||
int i, j;
|
||||
int length = 2;
|
||||
int dclens[NUM_HUFF_TBLS] = { 0 };
|
||||
int aclens[NUM_HUFF_TBLS] = { 0 };
|
||||
JHUFF_TBL *dcseen[NUM_HUFF_TBLS] = { NULL };
|
||||
JHUFF_TBL *acseen[NUM_HUFF_TBLS] = { NULL };
|
||||
|
||||
if (cinfo->master->compress_profile == JCP_FASTEST)
|
||||
return 0;
|
||||
|
||||
/* Calclate the total length. */
|
||||
for (i = 0; i < cinfo->comps_in_scan; i++) {
|
||||
jpeg_component_info *compptr = cinfo->cur_comp_info[i];
|
||||
int dcidx = compptr->dc_tbl_no;
|
||||
int acidx = compptr->ac_tbl_no;
|
||||
JHUFF_TBL *dctbl = cinfo->dc_huff_tbl_ptrs[dcidx];
|
||||
JHUFF_TBL *actbl = cinfo->ac_huff_tbl_ptrs[acidx];
|
||||
int seen = 0;
|
||||
|
||||
/* Handle DC table lenghts */
|
||||
if (cinfo->Ss == 0 && cinfo->Ah == 0) {
|
||||
if (dctbl == NULL)
|
||||
ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, dcidx);
|
||||
|
||||
if (dctbl->sent_table)
|
||||
continue;
|
||||
|
||||
for (j = 0; j < NUM_HUFF_TBLS; j++)
|
||||
seen += (dctbl == dcseen[j]);
|
||||
if (seen)
|
||||
continue;
|
||||
dcseen[i] = dctbl;
|
||||
|
||||
for (j = 1; j <= 16; j++)
|
||||
dclens[i] += dctbl->bits[j];
|
||||
length += dclens[i] + 16 + 1;
|
||||
}
|
||||
|
||||
/* Handle AC table lengths */
|
||||
if (cinfo->Se) {
|
||||
if (actbl == NULL)
|
||||
ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, acidx + 0x10);
|
||||
|
||||
if (actbl->sent_table)
|
||||
continue;
|
||||
|
||||
seen = 0;
|
||||
for (j = 0; j < NUM_HUFF_TBLS; j++)
|
||||
seen += (actbl == acseen[j]);
|
||||
if (seen)
|
||||
continue;
|
||||
acseen[i] = actbl;
|
||||
|
||||
for (j = 1; j <= 16; j++)
|
||||
aclens[i] += actbl->bits[j];
|
||||
length += aclens[i] + 16 + 1;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/* Make sure we can fit it all into one DHT marker */
|
||||
if (length > (1 << 16) - 1)
|
||||
return FALSE;
|
||||
|
||||
emit_marker(cinfo, M_DHT);
|
||||
emit_2bytes(cinfo, length);
|
||||
|
||||
for (i = 0; i < cinfo->comps_in_scan; i++) {
|
||||
jpeg_component_info *compptr = cinfo->cur_comp_info[i];
|
||||
int dcidx = compptr->dc_tbl_no;
|
||||
int acidx = compptr->ac_tbl_no;
|
||||
JHUFF_TBL *dctbl = cinfo->dc_huff_tbl_ptrs[dcidx];
|
||||
JHUFF_TBL *actbl = cinfo->ac_huff_tbl_ptrs[acidx];
|
||||
|
||||
acidx += 0x10;
|
||||
|
||||
/* DC */
|
||||
if (cinfo->Ss == 0 && cinfo->Ah == 0 && !dctbl->sent_table) {
|
||||
emit_byte(cinfo, dcidx);
|
||||
|
||||
for (j = 1; j <= 16; j++)
|
||||
emit_byte(cinfo, dctbl->bits[j]);
|
||||
|
||||
for (j = 0; j < dclens[i]; j++)
|
||||
emit_byte(cinfo, dctbl->huffval[j]);
|
||||
|
||||
dctbl->sent_table = TRUE;
|
||||
}
|
||||
|
||||
if (cinfo->Se && !actbl->sent_table) {
|
||||
emit_byte(cinfo, acidx);
|
||||
|
||||
for (j = 1; j <= 16; j++)
|
||||
emit_byte(cinfo, actbl->bits[j]);
|
||||
|
||||
for (j = 0; j < aclens[i]; j++)
|
||||
emit_byte(cinfo, actbl->huffval[j]);
|
||||
|
||||
actbl->sent_table = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
LOCAL(void)
|
||||
emit_dac (j_compress_ptr cinfo)
|
||||
@@ -258,12 +433,12 @@ emit_dac (j_compress_ptr cinfo)
|
||||
|
||||
for (i = 0; i < NUM_ARITH_TBLS; i++) {
|
||||
if (dc_in_use[i]) {
|
||||
emit_byte(cinfo, i);
|
||||
emit_byte(cinfo, cinfo->arith_dc_L[i] + (cinfo->arith_dc_U[i]<<4));
|
||||
emit_byte(cinfo, i);
|
||||
emit_byte(cinfo, cinfo->arith_dc_L[i] + (cinfo->arith_dc_U[i]<<4));
|
||||
}
|
||||
if (ac_in_use[i]) {
|
||||
emit_byte(cinfo, i + 0x10);
|
||||
emit_byte(cinfo, cinfo->arith_ac_K[i]);
|
||||
emit_byte(cinfo, i + 0x10);
|
||||
emit_byte(cinfo, cinfo->arith_ac_K[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -277,7 +452,7 @@ emit_dri (j_compress_ptr cinfo)
|
||||
{
|
||||
emit_marker(cinfo, M_DRI);
|
||||
|
||||
emit_2bytes(cinfo, 4); /* fixed length */
|
||||
emit_2bytes(cinfo, 4); /* fixed length */
|
||||
|
||||
emit_2bytes(cinfo, (int) cinfo->restart_interval);
|
||||
}
|
||||
@@ -354,22 +529,22 @@ emit_jfif_app0 (j_compress_ptr cinfo)
|
||||
/* Emit a JFIF-compliant APP0 marker */
|
||||
{
|
||||
/*
|
||||
* Length of APP0 block (2 bytes)
|
||||
* Block ID (4 bytes - ASCII "JFIF")
|
||||
* Zero byte (1 byte to terminate the ID string)
|
||||
* Version Major, Minor (2 bytes - major first)
|
||||
* Units (1 byte - 0x00 = none, 0x01 = inch, 0x02 = cm)
|
||||
* Xdpu (2 bytes - dots per unit horizontal)
|
||||
* Ydpu (2 bytes - dots per unit vertical)
|
||||
* Thumbnail X size (1 byte)
|
||||
* Thumbnail Y size (1 byte)
|
||||
* Length of APP0 block (2 bytes)
|
||||
* Block ID (4 bytes - ASCII "JFIF")
|
||||
* Zero byte (1 byte to terminate the ID string)
|
||||
* Version Major, Minor (2 bytes - major first)
|
||||
* Units (1 byte - 0x00 = none, 0x01 = inch, 0x02 = cm)
|
||||
* Xdpu (2 bytes - dots per unit horizontal)
|
||||
* Ydpu (2 bytes - dots per unit vertical)
|
||||
* Thumbnail X size (1 byte)
|
||||
* Thumbnail Y size (1 byte)
|
||||
*/
|
||||
|
||||
emit_marker(cinfo, M_APP0);
|
||||
|
||||
emit_2bytes(cinfo, 2 + 4 + 1 + 2 + 1 + 2 + 2 + 1 + 1); /* length */
|
||||
|
||||
emit_byte(cinfo, 0x4A); /* Identifier: ASCII "JFIF" */
|
||||
emit_byte(cinfo, 0x4A); /* Identifier: ASCII "JFIF" */
|
||||
emit_byte(cinfo, 0x46);
|
||||
emit_byte(cinfo, 0x49);
|
||||
emit_byte(cinfo, 0x46);
|
||||
@@ -379,7 +554,7 @@ emit_jfif_app0 (j_compress_ptr cinfo)
|
||||
emit_byte(cinfo, cinfo->density_unit); /* Pixel size information */
|
||||
emit_2bytes(cinfo, (int) cinfo->X_density);
|
||||
emit_2bytes(cinfo, (int) cinfo->Y_density);
|
||||
emit_byte(cinfo, 0); /* No thumbnail image */
|
||||
emit_byte(cinfo, 0); /* No thumbnail image */
|
||||
emit_byte(cinfo, 0);
|
||||
}
|
||||
|
||||
@@ -389,12 +564,12 @@ emit_adobe_app14 (j_compress_ptr cinfo)
|
||||
/* Emit an Adobe APP14 marker */
|
||||
{
|
||||
/*
|
||||
* Length of APP14 block (2 bytes)
|
||||
* Block ID (5 bytes - ASCII "Adobe")
|
||||
* Version Number (2 bytes - currently 100)
|
||||
* Flags0 (2 bytes - currently 0)
|
||||
* Flags1 (2 bytes - currently 0)
|
||||
* Color transform (1 byte)
|
||||
* Length of APP14 block (2 bytes)
|
||||
* Block ID (5 bytes - ASCII "Adobe")
|
||||
* Version Number (2 bytes - currently 100)
|
||||
* Flags0 (2 bytes - currently 0)
|
||||
* Flags1 (2 bytes - currently 0)
|
||||
* Color transform (1 byte)
|
||||
*
|
||||
* Although Adobe TN 5116 mentions Version = 101, all the Adobe files
|
||||
* now in circulation seem to use Version = 100, so that's what we write.
|
||||
@@ -408,23 +583,23 @@ emit_adobe_app14 (j_compress_ptr cinfo)
|
||||
|
||||
emit_2bytes(cinfo, 2 + 5 + 2 + 2 + 2 + 1); /* length */
|
||||
|
||||
emit_byte(cinfo, 0x41); /* Identifier: ASCII "Adobe" */
|
||||
emit_byte(cinfo, 0x41); /* Identifier: ASCII "Adobe" */
|
||||
emit_byte(cinfo, 0x64);
|
||||
emit_byte(cinfo, 0x6F);
|
||||
emit_byte(cinfo, 0x62);
|
||||
emit_byte(cinfo, 0x65);
|
||||
emit_2bytes(cinfo, 100); /* Version */
|
||||
emit_2bytes(cinfo, 0); /* Flags0 */
|
||||
emit_2bytes(cinfo, 0); /* Flags1 */
|
||||
emit_2bytes(cinfo, 100); /* Version */
|
||||
emit_2bytes(cinfo, 0); /* Flags0 */
|
||||
emit_2bytes(cinfo, 0); /* Flags1 */
|
||||
switch (cinfo->jpeg_color_space) {
|
||||
case JCS_YCbCr:
|
||||
emit_byte(cinfo, 1); /* Color transform = 1 */
|
||||
emit_byte(cinfo, 1); /* Color transform = 1 */
|
||||
break;
|
||||
case JCS_YCCK:
|
||||
emit_byte(cinfo, 2); /* Color transform = 2 */
|
||||
emit_byte(cinfo, 2); /* Color transform = 2 */
|
||||
break;
|
||||
default:
|
||||
emit_byte(cinfo, 0); /* Color transform = 0 */
|
||||
emit_byte(cinfo, 0); /* Color transform = 0 */
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -442,12 +617,12 @@ METHODDEF(void)
|
||||
write_marker_header (j_compress_ptr cinfo, int marker, unsigned int datalen)
|
||||
/* Emit an arbitrary marker header */
|
||||
{
|
||||
if (datalen > (unsigned int) 65533) /* safety check */
|
||||
if (datalen > (unsigned int) 65533) /* safety check */
|
||||
ERREXIT(cinfo, JERR_BAD_LENGTH);
|
||||
|
||||
emit_marker(cinfo, (JPEG_MARKER) marker);
|
||||
|
||||
emit_2bytes(cinfo, (int) (datalen + 2)); /* total length */
|
||||
emit_2bytes(cinfo, (int) (datalen + 2)); /* total length */
|
||||
}
|
||||
|
||||
METHODDEF(void)
|
||||
@@ -474,12 +649,12 @@ write_file_header (j_compress_ptr cinfo)
|
||||
{
|
||||
my_marker_ptr marker = (my_marker_ptr) cinfo->marker;
|
||||
|
||||
emit_marker(cinfo, M_SOI); /* first the SOI */
|
||||
emit_marker(cinfo, M_SOI); /* first the SOI */
|
||||
|
||||
/* SOI is defined to reset restart interval to 0 */
|
||||
marker->last_restart_interval = 0;
|
||||
|
||||
if (cinfo->write_JFIF_header) /* next an optional JFIF APP0 */
|
||||
if (cinfo->write_JFIF_header) /* next an optional JFIF APP0 */
|
||||
emit_jfif_app0(cinfo);
|
||||
if (cinfo->write_Adobe_marker) /* next an optional Adobe APP14 */
|
||||
emit_adobe_app14(cinfo);
|
||||
@@ -504,10 +679,13 @@ write_frame_header (j_compress_ptr cinfo)
|
||||
/* Emit DQT for each quantization table.
|
||||
* Note that emit_dqt() suppresses any duplicate tables.
|
||||
*/
|
||||
prec = 0;
|
||||
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
|
||||
ci++, compptr++) {
|
||||
prec += emit_dqt(cinfo, compptr->quant_tbl_no);
|
||||
prec = emit_multi_dqt(cinfo);
|
||||
if (prec == -1) {
|
||||
prec = 0;
|
||||
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
|
||||
ci++, compptr++) {
|
||||
prec += emit_dqt(cinfo, compptr->quant_tbl_no);
|
||||
}
|
||||
}
|
||||
/* now prec is nonzero iff there are any 16-bit quant tables. */
|
||||
|
||||
@@ -520,9 +698,9 @@ write_frame_header (j_compress_ptr cinfo)
|
||||
} else {
|
||||
is_baseline = TRUE;
|
||||
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
|
||||
ci++, compptr++) {
|
||||
ci++, compptr++) {
|
||||
if (compptr->dc_tbl_no > 1 || compptr->ac_tbl_no > 1)
|
||||
is_baseline = FALSE;
|
||||
is_baseline = FALSE;
|
||||
}
|
||||
if (prec && is_baseline) {
|
||||
is_baseline = FALSE;
|
||||
@@ -539,11 +717,11 @@ write_frame_header (j_compress_ptr cinfo)
|
||||
emit_sof(cinfo, M_SOF9); /* SOF code for sequential arithmetic */
|
||||
} else {
|
||||
if (cinfo->progressive_mode)
|
||||
emit_sof(cinfo, M_SOF2); /* SOF code for progressive Huffman */
|
||||
emit_sof(cinfo, M_SOF2); /* SOF code for progressive Huffman */
|
||||
else if (is_baseline)
|
||||
emit_sof(cinfo, M_SOF0); /* SOF code for baseline implementation */
|
||||
emit_sof(cinfo, M_SOF0); /* SOF code for baseline implementation */
|
||||
else
|
||||
emit_sof(cinfo, M_SOF1); /* SOF code for non-baseline Huffman file */
|
||||
emit_sof(cinfo, M_SOF1); /* SOF code for non-baseline Huffman file */
|
||||
}
|
||||
}
|
||||
|
||||
@@ -571,14 +749,16 @@ write_scan_header (j_compress_ptr cinfo)
|
||||
/* Emit Huffman tables.
|
||||
* Note that emit_dht() suppresses any duplicate tables.
|
||||
*/
|
||||
for (i = 0; i < cinfo->comps_in_scan; i++) {
|
||||
compptr = cinfo->cur_comp_info[i];
|
||||
/* DC needs no table for refinement scan */
|
||||
if (cinfo->Ss == 0 && cinfo->Ah == 0)
|
||||
emit_dht(cinfo, compptr->dc_tbl_no, FALSE);
|
||||
/* AC needs no table when not present */
|
||||
if (cinfo->Se)
|
||||
emit_dht(cinfo, compptr->ac_tbl_no, TRUE);
|
||||
if (!emit_multi_dht(cinfo)) {
|
||||
for (i = 0; i < cinfo->comps_in_scan; i++) {
|
||||
compptr = cinfo->cur_comp_info[i];
|
||||
/* DC needs no table for refinement scan */
|
||||
if (cinfo->Ss == 0 && cinfo->Ah == 0)
|
||||
emit_dht(cinfo, compptr->dc_tbl_no, FALSE);
|
||||
/* AC needs no table when not present */
|
||||
if (cinfo->Se)
|
||||
emit_dht(cinfo, compptr->ac_tbl_no, TRUE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -627,9 +807,9 @@ write_tables_only (j_compress_ptr cinfo)
|
||||
if (! cinfo->arith_code) {
|
||||
for (i = 0; i < NUM_HUFF_TBLS; i++) {
|
||||
if (cinfo->dc_huff_tbl_ptrs[i] != NULL)
|
||||
emit_dht(cinfo, i, FALSE);
|
||||
emit_dht(cinfo, i, FALSE);
|
||||
if (cinfo->ac_huff_tbl_ptrs[i] != NULL)
|
||||
emit_dht(cinfo, i, TRUE);
|
||||
emit_dht(cinfo, i, TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -649,7 +829,7 @@ jinit_marker_writer (j_compress_ptr cinfo)
|
||||
/* Create the subobject */
|
||||
marker = (my_marker_ptr)
|
||||
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
|
||||
SIZEOF(my_marker_writer));
|
||||
sizeof(my_marker_writer));
|
||||
cinfo->marker = (struct jpeg_marker_writer *) marker;
|
||||
/* Initialize method pointers */
|
||||
marker->pub.write_file_header = write_file_header;
|
||||
|
||||
290
jcmaster.c
290
jcmaster.c
@@ -5,7 +5,7 @@
|
||||
* Copyright (C) 1991-1997, Thomas G. Lane.
|
||||
* Modified 2003-2010 by Guido Vollbeding.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2010, D. R. Commander.
|
||||
* Copyright (C) 2010, 2014, D. R. Commander.
|
||||
* mozjpeg Modifications:
|
||||
* Copyright (C) 2014, Mozilla Corporation.
|
||||
* For conditions of distribution and use, see the accompanying README file.
|
||||
@@ -20,41 +20,8 @@
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
#include "jpegcomp.h"
|
||||
|
||||
|
||||
/* Private state */
|
||||
|
||||
typedef enum {
|
||||
main_pass, /* input data, also do first output step */
|
||||
huff_opt_pass, /* Huffman code optimization pass */
|
||||
output_pass, /* data output pass */
|
||||
trellis_pass /* trellis quantization pass */
|
||||
} c_pass_type;
|
||||
|
||||
typedef struct {
|
||||
struct jpeg_comp_master pub; /* public fields */
|
||||
|
||||
c_pass_type pass_type; /* the type of the current pass */
|
||||
|
||||
int pass_number; /* # of passes completed */
|
||||
int total_passes; /* total # of passes needed */
|
||||
|
||||
int scan_number; /* current index in scan_info[] */
|
||||
|
||||
/* fields for scan optimisation */
|
||||
int pass_number_scan_opt_base; /* pass number where scan optimization begins */
|
||||
unsigned char * scan_buffer[64]; /* buffer for a given scan */
|
||||
unsigned long scan_size[64]; /* size for a given scan */
|
||||
unsigned long best_cost; /* bit count for best frequency split */
|
||||
int best_freq_split_idx_luma; /* index for best frequency split (luma) */
|
||||
int best_freq_split_idx_chroma; /* index for best frequency split (chroma) */
|
||||
int best_Al_luma; /* best value for Al found in scan search (luma) */
|
||||
int best_Al_chroma; /* best value for Al found in scan search (luma) */
|
||||
boolean interleave_chroma_dc; /* indicate whether to interleave chroma DC scans */
|
||||
struct jpeg_destination_mgr * saved_dest; /* saved value of cinfo->dest */
|
||||
} my_comp_master;
|
||||
|
||||
typedef my_comp_master * my_master_ptr;
|
||||
#include "jmemsys.h"
|
||||
#include "jcmaster.h"
|
||||
|
||||
|
||||
/*
|
||||
@@ -120,7 +87,7 @@ initial_setup (j_compress_ptr cinfo, boolean transcode_only)
|
||||
/* Check that number of components won't exceed internal array sizes */
|
||||
if (cinfo->num_components > MAX_COMPONENTS)
|
||||
ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->num_components,
|
||||
MAX_COMPONENTS);
|
||||
MAX_COMPONENTS);
|
||||
|
||||
/* Compute maximum sampling factors; check factor validity */
|
||||
cinfo->max_h_samp_factor = 1;
|
||||
@@ -128,12 +95,12 @@ initial_setup (j_compress_ptr cinfo, boolean transcode_only)
|
||||
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
|
||||
ci++, compptr++) {
|
||||
if (compptr->h_samp_factor<=0 || compptr->h_samp_factor>MAX_SAMP_FACTOR ||
|
||||
compptr->v_samp_factor<=0 || compptr->v_samp_factor>MAX_SAMP_FACTOR)
|
||||
compptr->v_samp_factor<=0 || compptr->v_samp_factor>MAX_SAMP_FACTOR)
|
||||
ERREXIT(cinfo, JERR_BAD_SAMPLING);
|
||||
cinfo->max_h_samp_factor = MAX(cinfo->max_h_samp_factor,
|
||||
compptr->h_samp_factor);
|
||||
compptr->h_samp_factor);
|
||||
cinfo->max_v_samp_factor = MAX(cinfo->max_v_samp_factor,
|
||||
compptr->v_samp_factor);
|
||||
compptr->v_samp_factor);
|
||||
}
|
||||
|
||||
/* Compute dimensions of components */
|
||||
@@ -150,17 +117,17 @@ initial_setup (j_compress_ptr cinfo, boolean transcode_only)
|
||||
/* Size in DCT blocks */
|
||||
compptr->width_in_blocks = (JDIMENSION)
|
||||
jdiv_round_up((long) cinfo->_jpeg_width * (long) compptr->h_samp_factor,
|
||||
(long) (cinfo->max_h_samp_factor * DCTSIZE));
|
||||
(long) (cinfo->max_h_samp_factor * DCTSIZE));
|
||||
compptr->height_in_blocks = (JDIMENSION)
|
||||
jdiv_round_up((long) cinfo->_jpeg_height * (long) compptr->v_samp_factor,
|
||||
(long) (cinfo->max_v_samp_factor * DCTSIZE));
|
||||
(long) (cinfo->max_v_samp_factor * DCTSIZE));
|
||||
/* Size in samples */
|
||||
compptr->downsampled_width = (JDIMENSION)
|
||||
jdiv_round_up((long) cinfo->_jpeg_width * (long) compptr->h_samp_factor,
|
||||
(long) cinfo->max_h_samp_factor);
|
||||
(long) cinfo->max_h_samp_factor);
|
||||
compptr->downsampled_height = (JDIMENSION)
|
||||
jdiv_round_up((long) cinfo->_jpeg_height * (long) compptr->v_samp_factor,
|
||||
(long) cinfo->max_v_samp_factor);
|
||||
(long) cinfo->max_v_samp_factor);
|
||||
/* Mark component needed (this flag isn't actually used for compression) */
|
||||
compptr->component_needed = TRUE;
|
||||
}
|
||||
@@ -170,7 +137,7 @@ initial_setup (j_compress_ptr cinfo, boolean transcode_only)
|
||||
*/
|
||||
cinfo->total_iMCU_rows = (JDIMENSION)
|
||||
jdiv_round_up((long) cinfo->_jpeg_height,
|
||||
(long) (cinfo->max_v_samp_factor*DCTSIZE));
|
||||
(long) (cinfo->max_v_samp_factor*DCTSIZE));
|
||||
}
|
||||
|
||||
|
||||
@@ -192,7 +159,7 @@ validate_script (j_compress_ptr cinfo)
|
||||
/* -1 until that coefficient has been seen; then last Al for it */
|
||||
#endif
|
||||
|
||||
if (cinfo->optimize_scans) {
|
||||
if (cinfo->master->optimize_scans) {
|
||||
cinfo->progressive_mode = TRUE;
|
||||
/* When we optimize scans, there is redundancy in the scan list
|
||||
* and this function will fail. Therefore skip all this checking
|
||||
@@ -213,7 +180,7 @@ validate_script (j_compress_ptr cinfo)
|
||||
last_bitpos_ptr = & last_bitpos[0][0];
|
||||
for (ci = 0; ci < cinfo->num_components; ci++)
|
||||
for (coefi = 0; coefi < DCTSIZE2; coefi++)
|
||||
*last_bitpos_ptr++ = -1;
|
||||
*last_bitpos_ptr++ = -1;
|
||||
#else
|
||||
ERREXIT(cinfo, JERR_NOT_COMPILED);
|
||||
#endif
|
||||
@@ -231,10 +198,10 @@ validate_script (j_compress_ptr cinfo)
|
||||
for (ci = 0; ci < ncomps; ci++) {
|
||||
thisi = scanptr->component_index[ci];
|
||||
if (thisi < 0 || thisi >= cinfo->num_components)
|
||||
ERREXIT1(cinfo, JERR_BAD_SCAN_SCRIPT, scanno);
|
||||
ERREXIT1(cinfo, JERR_BAD_SCAN_SCRIPT, scanno);
|
||||
/* Components must appear in SOF order within each scan */
|
||||
if (ci > 0 && thisi <= scanptr->component_index[ci-1])
|
||||
ERREXIT1(cinfo, JERR_BAD_SCAN_SCRIPT, scanno);
|
||||
ERREXIT1(cinfo, JERR_BAD_SCAN_SCRIPT, scanno);
|
||||
}
|
||||
/* Validate progression parameters */
|
||||
Ss = scanptr->Ss;
|
||||
@@ -256,43 +223,43 @@ validate_script (j_compress_ptr cinfo)
|
||||
#define MAX_AH_AL 13
|
||||
#endif
|
||||
if (Ss < 0 || Ss >= DCTSIZE2 || Se < Ss || Se >= DCTSIZE2 ||
|
||||
Ah < 0 || Ah > MAX_AH_AL || Al < 0 || Al > MAX_AH_AL)
|
||||
ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);
|
||||
Ah < 0 || Ah > MAX_AH_AL || Al < 0 || Al > MAX_AH_AL)
|
||||
ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);
|
||||
if (Ss == 0) {
|
||||
if (Se != 0) /* DC and AC together not OK */
|
||||
ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);
|
||||
if (Se != 0) /* DC and AC together not OK */
|
||||
ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);
|
||||
} else {
|
||||
if (ncomps != 1) /* AC scans must be for only one component */
|
||||
ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);
|
||||
if (ncomps != 1) /* AC scans must be for only one component */
|
||||
ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);
|
||||
}
|
||||
for (ci = 0; ci < ncomps; ci++) {
|
||||
last_bitpos_ptr = & last_bitpos[scanptr->component_index[ci]][0];
|
||||
if (Ss != 0 && last_bitpos_ptr[0] < 0) /* AC without prior DC scan */
|
||||
ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);
|
||||
for (coefi = Ss; coefi <= Se; coefi++) {
|
||||
if (last_bitpos_ptr[coefi] < 0) {
|
||||
/* first scan of this coefficient */
|
||||
if (Ah != 0)
|
||||
ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);
|
||||
} else {
|
||||
/* not first scan */
|
||||
if (Ah != last_bitpos_ptr[coefi] || Al != Ah-1)
|
||||
ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);
|
||||
}
|
||||
last_bitpos_ptr[coefi] = Al;
|
||||
}
|
||||
last_bitpos_ptr = & last_bitpos[scanptr->component_index[ci]][0];
|
||||
if (Ss != 0 && last_bitpos_ptr[0] < 0) /* AC without prior DC scan */
|
||||
ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);
|
||||
for (coefi = Ss; coefi <= Se; coefi++) {
|
||||
if (last_bitpos_ptr[coefi] < 0) {
|
||||
/* first scan of this coefficient */
|
||||
if (Ah != 0)
|
||||
ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);
|
||||
} else {
|
||||
/* not first scan */
|
||||
if (Ah != last_bitpos_ptr[coefi] || Al != Ah-1)
|
||||
ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);
|
||||
}
|
||||
last_bitpos_ptr[coefi] = Al;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
} else {
|
||||
/* For sequential JPEG, all progression parameters must be these: */
|
||||
if (Ss != 0 || Se != DCTSIZE2-1 || Ah != 0 || Al != 0)
|
||||
ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);
|
||||
ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);
|
||||
/* Make sure components are not sent twice */
|
||||
for (ci = 0; ci < ncomps; ci++) {
|
||||
thisi = scanptr->component_index[ci];
|
||||
if (component_sent[thisi])
|
||||
ERREXIT1(cinfo, JERR_BAD_SCAN_SCRIPT, scanno);
|
||||
component_sent[thisi] = TRUE;
|
||||
thisi = scanptr->component_index[ci];
|
||||
if (component_sent[thisi])
|
||||
ERREXIT1(cinfo, JERR_BAD_SCAN_SCRIPT, scanno);
|
||||
component_sent[thisi] = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -307,13 +274,13 @@ validate_script (j_compress_ptr cinfo)
|
||||
*/
|
||||
for (ci = 0; ci < cinfo->num_components; ci++) {
|
||||
if (last_bitpos[ci][0] < 0)
|
||||
ERREXIT(cinfo, JERR_MISSING_DATA);
|
||||
ERREXIT(cinfo, JERR_MISSING_DATA);
|
||||
}
|
||||
#endif
|
||||
} else {
|
||||
for (ci = 0; ci < cinfo->num_components; ci++) {
|
||||
if (! component_sent[ci])
|
||||
ERREXIT(cinfo, JERR_MISSING_DATA);
|
||||
ERREXIT(cinfo, JERR_MISSING_DATA);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -331,12 +298,18 @@ select_scan_parameters (j_compress_ptr cinfo)
|
||||
my_master_ptr master = (my_master_ptr) cinfo->master;
|
||||
if (master->pass_number < master->pass_number_scan_opt_base) {
|
||||
cinfo->comps_in_scan = 1;
|
||||
if (cinfo->use_scans_in_trellis) {
|
||||
cinfo->cur_comp_info[0] = &cinfo->comp_info[master->pass_number/(4*cinfo->trellis_num_loops)];
|
||||
cinfo->Ss = (master->pass_number%4 < 2) ? 1 : cinfo->trellis_freq_split+1;
|
||||
cinfo->Se = (master->pass_number%4 < 2) ? cinfo->trellis_freq_split : DCTSIZE2-1;
|
||||
if (cinfo->master->use_scans_in_trellis) {
|
||||
cinfo->cur_comp_info[0] =
|
||||
&cinfo->comp_info[master->pass_number /
|
||||
(4 * cinfo->master->trellis_num_loops)];
|
||||
cinfo->Ss = (master->pass_number % 4 < 2) ?
|
||||
1 : cinfo->master->trellis_freq_split + 1;
|
||||
cinfo->Se = (master->pass_number % 4 < 2) ?
|
||||
cinfo->master->trellis_freq_split : DCTSIZE2 - 1;
|
||||
} else {
|
||||
cinfo->cur_comp_info[0] = &cinfo->comp_info[master->pass_number/(2*cinfo->trellis_num_loops)];
|
||||
cinfo->cur_comp_info[0] =
|
||||
&cinfo->comp_info[master->pass_number /
|
||||
(2 * cinfo->master->trellis_num_loops)];
|
||||
cinfo->Ss = 1;
|
||||
cinfo->Se = DCTSIZE2-1;
|
||||
}
|
||||
@@ -348,22 +321,27 @@ select_scan_parameters (j_compress_ptr cinfo)
|
||||
cinfo->comps_in_scan = scanptr->comps_in_scan;
|
||||
for (ci = 0; ci < scanptr->comps_in_scan; ci++) {
|
||||
cinfo->cur_comp_info[ci] =
|
||||
&cinfo->comp_info[scanptr->component_index[ci]];
|
||||
&cinfo->comp_info[scanptr->component_index[ci]];
|
||||
}
|
||||
cinfo->Ss = scanptr->Ss;
|
||||
cinfo->Se = scanptr->Se;
|
||||
cinfo->Ah = scanptr->Ah;
|
||||
cinfo->Al = scanptr->Al;
|
||||
if (cinfo->optimize_scans) {
|
||||
if (cinfo->master->optimize_scans) {
|
||||
/* luma frequency split passes */
|
||||
if (master->scan_number >= cinfo->num_scans_luma_dc+3*cinfo->Al_max_luma+2 &&
|
||||
master->scan_number < cinfo->num_scans_luma)
|
||||
if (master->scan_number >= cinfo->master->num_scans_luma_dc +
|
||||
3 * cinfo->master->Al_max_luma + 2 &&
|
||||
master->scan_number < cinfo->master->num_scans_luma)
|
||||
cinfo->Al = master->best_Al_luma;
|
||||
/* chroma frequency split passes */
|
||||
if (master->scan_number >= cinfo->num_scans_luma+cinfo->num_scans_chroma_dc+(6*cinfo->Al_max_chroma+4) &&
|
||||
if (master->scan_number >= cinfo->master->num_scans_luma +
|
||||
cinfo->master->num_scans_chroma_dc +
|
||||
(6 * cinfo->master->Al_max_chroma + 4) &&
|
||||
master->scan_number < cinfo->num_scans)
|
||||
cinfo->Al = master->best_Al_chroma;
|
||||
}
|
||||
/* save value for later retrieval during printout of scans */
|
||||
master->actual_Al[master->scan_number] = cinfo->Al;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
@@ -371,7 +349,7 @@ select_scan_parameters (j_compress_ptr cinfo)
|
||||
/* Prepare for single sequential-JPEG scan containing all components */
|
||||
if (cinfo->num_components > MAX_COMPS_IN_SCAN)
|
||||
ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->num_components,
|
||||
MAX_COMPS_IN_SCAN);
|
||||
MAX_COMPS_IN_SCAN);
|
||||
cinfo->comps_in_scan = cinfo->num_components;
|
||||
for (ci = 0; ci < cinfo->num_components; ci++) {
|
||||
cinfo->cur_comp_info[ci] = &cinfo->comp_info[ci];
|
||||
@@ -423,15 +401,15 @@ per_scan_setup (j_compress_ptr cinfo)
|
||||
/* Interleaved (multi-component) scan */
|
||||
if (cinfo->comps_in_scan <= 0 || cinfo->comps_in_scan > MAX_COMPS_IN_SCAN)
|
||||
ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->comps_in_scan,
|
||||
MAX_COMPS_IN_SCAN);
|
||||
MAX_COMPS_IN_SCAN);
|
||||
|
||||
/* Overall image size in MCUs */
|
||||
cinfo->MCUs_per_row = (JDIMENSION)
|
||||
jdiv_round_up((long) cinfo->_jpeg_width,
|
||||
(long) (cinfo->max_h_samp_factor*DCTSIZE));
|
||||
(long) (cinfo->max_h_samp_factor*DCTSIZE));
|
||||
cinfo->MCU_rows_in_scan = (JDIMENSION)
|
||||
jdiv_round_up((long) cinfo->_jpeg_height,
|
||||
(long) (cinfo->max_v_samp_factor*DCTSIZE));
|
||||
(long) (cinfo->max_v_samp_factor*DCTSIZE));
|
||||
|
||||
cinfo->blocks_in_MCU = 0;
|
||||
|
||||
@@ -452,9 +430,9 @@ per_scan_setup (j_compress_ptr cinfo)
|
||||
/* Prepare array describing MCU composition */
|
||||
mcublks = compptr->MCU_blocks;
|
||||
if (cinfo->blocks_in_MCU + mcublks > C_MAX_BLOCKS_IN_MCU)
|
||||
ERREXIT(cinfo, JERR_BAD_MCU_SIZE);
|
||||
ERREXIT(cinfo, JERR_BAD_MCU_SIZE);
|
||||
while (mcublks-- > 0) {
|
||||
cinfo->MCU_membership[cinfo->blocks_in_MCU++] = ci;
|
||||
cinfo->MCU_membership[cinfo->blocks_in_MCU++] = ci;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -481,7 +459,8 @@ METHODDEF(void)
|
||||
prepare_for_pass (j_compress_ptr cinfo)
|
||||
{
|
||||
my_master_ptr master = (my_master_ptr) cinfo->master;
|
||||
cinfo->trellis_passes = master->pass_number < master->pass_number_scan_opt_base;
|
||||
cinfo->master->trellis_passes =
|
||||
master->pass_number < master->pass_number_scan_opt_base;
|
||||
|
||||
switch (master->pass_type) {
|
||||
case main_pass:
|
||||
@@ -496,12 +475,12 @@ prepare_for_pass (j_compress_ptr cinfo)
|
||||
(*cinfo->prep->start_pass) (cinfo, JBUF_PASS_THRU);
|
||||
}
|
||||
(*cinfo->fdct->start_pass) (cinfo);
|
||||
(*cinfo->entropy->start_pass) (cinfo, cinfo->optimize_coding);
|
||||
(*cinfo->entropy->start_pass) (cinfo, (cinfo->optimize_coding || cinfo->master->trellis_quant) && !cinfo->arith_code);
|
||||
(*cinfo->coef->start_pass) (cinfo,
|
||||
(master->total_passes > 1 ?
|
||||
JBUF_SAVE_AND_PASS : JBUF_PASS_THRU));
|
||||
(master->total_passes > 1 ?
|
||||
JBUF_SAVE_AND_PASS : JBUF_PASS_THRU));
|
||||
(*cinfo->main->start_pass) (cinfo, JBUF_PASS_THRU);
|
||||
if (cinfo->optimize_coding) {
|
||||
if (cinfo->optimize_coding || cinfo->master->trellis_quant) {
|
||||
/* No immediate data output; postpone writing frame/scan headers */
|
||||
master->pub.call_pass_startup = FALSE;
|
||||
} else {
|
||||
@@ -534,7 +513,7 @@ prepare_for_pass (j_compress_ptr cinfo)
|
||||
select_scan_parameters(cinfo);
|
||||
per_scan_setup(cinfo);
|
||||
}
|
||||
if (cinfo->optimize_scans) {
|
||||
if (cinfo->master->optimize_scans) {
|
||||
master->saved_dest = cinfo->dest;
|
||||
cinfo->dest = NULL;
|
||||
master->scan_size[master->scan_number] = 0;
|
||||
@@ -550,17 +529,19 @@ prepare_for_pass (j_compress_ptr cinfo)
|
||||
master->pub.call_pass_startup = FALSE;
|
||||
break;
|
||||
case trellis_pass:
|
||||
if (master->pass_number%(cinfo->num_components*(cinfo->use_scans_in_trellis?4:2)) == 1 && cinfo->trellis_q_opt) {
|
||||
if (master->pass_number %
|
||||
(cinfo->num_components * (cinfo->master->use_scans_in_trellis ? 4 : 2)) == 1 &&
|
||||
cinfo->master->trellis_q_opt) {
|
||||
int i, j;
|
||||
|
||||
for (i = 0; i < NUM_QUANT_TBLS; i++) {
|
||||
for (j = 1; j < DCTSIZE2; j++) {
|
||||
cinfo->norm_src[i][j] = 0.0;
|
||||
cinfo->norm_coef[i][j] = 0.0;
|
||||
cinfo->master->norm_src[i][j] = 0.0;
|
||||
cinfo->master->norm_coef[i][j] = 0.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
(*cinfo->entropy->start_pass) (cinfo, TRUE);
|
||||
(*cinfo->entropy->start_pass) (cinfo, !cinfo->arith_code);
|
||||
(*cinfo->coef->start_pass) (cinfo, JBUF_REQUANT);
|
||||
master->pub.call_pass_startup = FALSE;
|
||||
break;
|
||||
@@ -613,7 +594,7 @@ copy_buffer (j_compress_ptr cinfo, int scan_idx)
|
||||
for (i = 0; i < cinfo->scan_info[scan_idx].comps_in_scan; i++)
|
||||
fprintf(stderr, "%s%d", (i==0)?"":",", cinfo->scan_info[scan_idx].component_index[i]);
|
||||
fprintf(stderr, ": %d %d", cinfo->scan_info[scan_idx].Ss, cinfo->scan_info[scan_idx].Se);
|
||||
fprintf(stderr, " %d %d", cinfo->scan_info[scan_idx].Ah, cinfo->scan_info[scan_idx].Al);
|
||||
fprintf(stderr, " %d %d", cinfo->scan_info[scan_idx].Ah, master->actual_Al[scan_idx]);
|
||||
fprintf(stderr, "\n");
|
||||
}
|
||||
|
||||
@@ -624,7 +605,9 @@ copy_buffer (j_compress_ptr cinfo, int scan_idx)
|
||||
size -= cinfo->dest->free_in_buffer;
|
||||
cinfo->dest->next_output_byte += cinfo->dest->free_in_buffer;
|
||||
cinfo->dest->free_in_buffer = 0;
|
||||
(*cinfo->dest->empty_output_buffer)(cinfo);
|
||||
|
||||
if (!(*cinfo->dest->empty_output_buffer)(cinfo))
|
||||
ERREXIT(cinfo, JERR_UNSUPPORTED_SUSPEND);
|
||||
}
|
||||
|
||||
MEMCOPY(cinfo->dest->next_output_byte, src, size);
|
||||
@@ -638,8 +621,12 @@ select_scans (j_compress_ptr cinfo, int next_scan_number)
|
||||
my_master_ptr master = (my_master_ptr) cinfo->master;
|
||||
|
||||
int base_scan_idx = 0;
|
||||
int luma_freq_split_scan_start = cinfo->num_scans_luma_dc + 3 * cinfo->Al_max_luma + 2;
|
||||
int chroma_freq_split_scan_start = cinfo->num_scans_luma+cinfo->num_scans_chroma_dc+(6*cinfo->Al_max_chroma+4);
|
||||
int luma_freq_split_scan_start = cinfo->master->num_scans_luma_dc +
|
||||
3 * cinfo->master->Al_max_luma + 2;
|
||||
int chroma_freq_split_scan_start = cinfo->master->num_scans_luma +
|
||||
cinfo->master->num_scans_chroma_dc +
|
||||
(6 * cinfo->master->Al_max_chroma + 4);
|
||||
int passes_per_scan = cinfo->optimize_coding ? 2 : 1;
|
||||
|
||||
if (next_scan_number > 1 && next_scan_number <= luma_freq_split_scan_start) {
|
||||
if ((next_scan_number - 1) % 3 == 2) {
|
||||
@@ -656,11 +643,12 @@ select_scans (j_compress_ptr cinfo, int next_scan_number)
|
||||
master->best_Al_luma = Al;
|
||||
} else {
|
||||
master->scan_number = luma_freq_split_scan_start - 1;
|
||||
master->pass_number = 2 * master->scan_number + 1 + master->pass_number_scan_opt_base;
|
||||
master->pass_number = passes_per_scan * (master->scan_number + 1) - 1 + master->pass_number_scan_opt_base;
|
||||
}
|
||||
}
|
||||
|
||||
} else if (next_scan_number > luma_freq_split_scan_start && next_scan_number <= cinfo->num_scans_luma) {
|
||||
} else if (next_scan_number > luma_freq_split_scan_start &&
|
||||
next_scan_number <= cinfo->master->num_scans_luma) {
|
||||
if (next_scan_number == luma_freq_split_scan_start + 1) {
|
||||
master->best_freq_split_idx_luma = 0;
|
||||
master->best_cost = master->scan_size[next_scan_number-1];
|
||||
@@ -680,21 +668,25 @@ select_scans (j_compress_ptr cinfo, int next_scan_number)
|
||||
if ((idx == 2 && master->best_freq_split_idx_luma == 0) ||
|
||||
(idx == 3 && master->best_freq_split_idx_luma != 2) ||
|
||||
(idx == 4 && master->best_freq_split_idx_luma != 4)) {
|
||||
master->scan_number = cinfo->num_scans_luma - 1;
|
||||
master->pass_number = 2 * master->scan_number + 1 + master->pass_number_scan_opt_base;
|
||||
master->scan_number = cinfo->master->num_scans_luma - 1;
|
||||
master->pass_number = passes_per_scan * (master->scan_number + 1) - 1 + master->pass_number_scan_opt_base;
|
||||
master->pub.is_last_pass = (master->pass_number == master->total_passes - 1);
|
||||
}
|
||||
}
|
||||
|
||||
} else if (cinfo->num_scans > cinfo->num_scans_luma) {
|
||||
} else if (cinfo->num_scans > cinfo->master->num_scans_luma) {
|
||||
|
||||
if (next_scan_number == cinfo->num_scans_luma+cinfo->num_scans_chroma_dc) {
|
||||
base_scan_idx = cinfo->num_scans_luma;
|
||||
if (next_scan_number == cinfo->master->num_scans_luma +
|
||||
cinfo->master->num_scans_chroma_dc) {
|
||||
base_scan_idx = cinfo->master->num_scans_luma;
|
||||
|
||||
master->interleave_chroma_dc = master->scan_size[base_scan_idx] <= master->scan_size[base_scan_idx+1] + master->scan_size[base_scan_idx+2];
|
||||
|
||||
} else if (next_scan_number > cinfo->num_scans_luma+cinfo->num_scans_chroma_dc && next_scan_number <= chroma_freq_split_scan_start) {
|
||||
base_scan_idx = cinfo->num_scans_luma + cinfo->num_scans_chroma_dc;
|
||||
} else if (next_scan_number > cinfo->master->num_scans_luma +
|
||||
cinfo->master->num_scans_chroma_dc &&
|
||||
next_scan_number <= chroma_freq_split_scan_start) {
|
||||
base_scan_idx = cinfo->master->num_scans_luma +
|
||||
cinfo->master->num_scans_chroma_dc;
|
||||
if ((next_scan_number - base_scan_idx) % 6 == 4) {
|
||||
int Al = (next_scan_number - base_scan_idx) / 6;
|
||||
int i;
|
||||
@@ -713,7 +705,7 @@ select_scans (j_compress_ptr cinfo, int next_scan_number)
|
||||
master->best_Al_chroma = Al;
|
||||
} else {
|
||||
master->scan_number = chroma_freq_split_scan_start - 1;
|
||||
master->pass_number = 2 * master->scan_number + 1 + master->pass_number_scan_opt_base;
|
||||
master->pass_number = passes_per_scan * (master->scan_number + 1) - 1 + master->pass_number_scan_opt_base;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -741,7 +733,7 @@ select_scans (j_compress_ptr cinfo, int next_scan_number)
|
||||
(idx == 3 && master->best_freq_split_idx_chroma != 2) ||
|
||||
(idx == 4 && master->best_freq_split_idx_chroma != 4)) {
|
||||
master->scan_number = cinfo->num_scans - 1;
|
||||
master->pass_number = 2 * master->scan_number + 1 + master->pass_number_scan_opt_base;
|
||||
master->pass_number = passes_per_scan * (master->scan_number + 1) - 1 + master->pass_number_scan_opt_base;
|
||||
master->pub.is_last_pass = (master->pass_number == master->total_passes - 1);
|
||||
}
|
||||
}
|
||||
@@ -754,10 +746,11 @@ select_scans (j_compress_ptr cinfo, int next_scan_number)
|
||||
|
||||
copy_buffer(cinfo, 0);
|
||||
|
||||
if (cinfo->num_scans > cinfo->num_scans_luma && !cinfo->one_dc_scan) {
|
||||
base_scan_idx = cinfo->num_scans_luma;
|
||||
if (cinfo->num_scans > cinfo->master->num_scans_luma &&
|
||||
cinfo->master->dc_scan_opt_mode != 0) {
|
||||
base_scan_idx = cinfo->master->num_scans_luma;
|
||||
|
||||
if (master->interleave_chroma_dc)
|
||||
if (master->interleave_chroma_dc && cinfo->master->dc_scan_opt_mode != 1)
|
||||
copy_buffer(cinfo, base_scan_idx);
|
||||
else {
|
||||
copy_buffer(cinfo, base_scan_idx+1);
|
||||
@@ -776,7 +769,7 @@ select_scans (j_compress_ptr cinfo, int next_scan_number)
|
||||
for (Al = master->best_Al_luma-1; Al >= min_Al; Al--)
|
||||
copy_buffer(cinfo, 3 + 3*Al);
|
||||
|
||||
if (cinfo->num_scans > cinfo->num_scans_luma) {
|
||||
if (cinfo->num_scans > cinfo->master->num_scans_luma) {
|
||||
if (master->best_freq_split_idx_chroma == 0) {
|
||||
copy_buffer(cinfo, chroma_freq_split_scan_start);
|
||||
copy_buffer(cinfo, chroma_freq_split_scan_start+1);
|
||||
@@ -788,7 +781,8 @@ select_scans (j_compress_ptr cinfo, int next_scan_number)
|
||||
copy_buffer(cinfo, chroma_freq_split_scan_start+4*(master->best_freq_split_idx_chroma-1)+5);
|
||||
}
|
||||
|
||||
base_scan_idx = cinfo->num_scans_luma + cinfo->num_scans_chroma_dc;
|
||||
base_scan_idx = cinfo->master->num_scans_luma +
|
||||
cinfo->master->num_scans_chroma_dc;
|
||||
|
||||
for (Al = master->best_Al_chroma-1; Al >= min_Al; Al--) {
|
||||
copy_buffer(cinfo, base_scan_idx + 6*Al + 4);
|
||||
@@ -799,7 +793,7 @@ select_scans (j_compress_ptr cinfo, int next_scan_number)
|
||||
for (Al = min_Al-1; Al >= 0; Al--) {
|
||||
copy_buffer(cinfo, 3 + 3*Al);
|
||||
|
||||
if (cinfo->num_scans > cinfo->num_scans_luma) {
|
||||
if (cinfo->num_scans > cinfo->master->num_scans_luma) {
|
||||
copy_buffer(cinfo, base_scan_idx + 6*Al + 4);
|
||||
copy_buffer(cinfo, base_scan_idx + 6*Al + 5);
|
||||
}
|
||||
@@ -832,7 +826,7 @@ finish_pass_master (j_compress_ptr cinfo)
|
||||
/* next pass is either output of scan 0 (after optimization)
|
||||
* or output of scan 1 (if no optimization).
|
||||
*/
|
||||
if (cinfo->trellis_quant)
|
||||
if (cinfo->master->trellis_quant)
|
||||
master->pass_type = trellis_pass;
|
||||
else {
|
||||
master->pass_type = output_pass;
|
||||
@@ -848,7 +842,7 @@ finish_pass_master (j_compress_ptr cinfo)
|
||||
/* next pass is either optimization or output of next scan */
|
||||
if (cinfo->optimize_coding)
|
||||
master->pass_type = huff_opt_pass;
|
||||
if (cinfo->optimize_scans) {
|
||||
if (cinfo->master->optimize_scans) {
|
||||
(*cinfo->dest->term_destination)(cinfo);
|
||||
cinfo->dest = master->saved_dest;
|
||||
select_scans(cinfo, master->scan_number + 1);
|
||||
@@ -857,15 +851,21 @@ finish_pass_master (j_compress_ptr cinfo)
|
||||
master->scan_number++;
|
||||
break;
|
||||
case trellis_pass:
|
||||
master->pass_type = (cinfo->optimize_coding || master->pass_number < master->pass_number_scan_opt_base-1) ? huff_opt_pass : output_pass;
|
||||
if (cinfo->optimize_coding)
|
||||
master->pass_type = huff_opt_pass;
|
||||
else
|
||||
master->pass_type = (master->pass_number < master->pass_number_scan_opt_base-1) ? trellis_pass : output_pass;
|
||||
|
||||
if ((master->pass_number+1)%(cinfo->num_components*(cinfo->use_scans_in_trellis?4:2)) == 0 && cinfo->trellis_q_opt) {
|
||||
if ((master->pass_number + 1) %
|
||||
(cinfo->num_components * (cinfo->master->use_scans_in_trellis ? 4 : 2)) == 0 &&
|
||||
cinfo->master->trellis_q_opt) {
|
||||
int i, j;
|
||||
|
||||
for (i = 0; i < NUM_QUANT_TBLS; i++) {
|
||||
for (j = 1; j < DCTSIZE2; j++) {
|
||||
if (cinfo->norm_coef[i][j] != 0.0) {
|
||||
int q = (int)(cinfo->norm_src[i][j] / cinfo->norm_coef[i][j] + 0.5);
|
||||
if (cinfo->master->norm_coef[i][j] != 0.0) {
|
||||
int q = (int)(cinfo->master->norm_src[i][j] /
|
||||
cinfo->master->norm_coef[i][j] + 0.5);
|
||||
if (q > 254) q = 254;
|
||||
if (q < 1) q = 1;
|
||||
cinfo->quant_tbl_ptrs[i]->quantval[j] = q;
|
||||
@@ -887,16 +887,13 @@ finish_pass_master (j_compress_ptr cinfo)
|
||||
GLOBAL(void)
|
||||
jinit_c_master_control (j_compress_ptr cinfo, boolean transcode_only)
|
||||
{
|
||||
my_master_ptr master;
|
||||
my_master_ptr master = (my_master_ptr) cinfo->master;
|
||||
|
||||
master = (my_master_ptr)
|
||||
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
|
||||
SIZEOF(my_comp_master));
|
||||
cinfo->master = (struct jpeg_comp_master *) master;
|
||||
master->pub.prepare_for_pass = prepare_for_pass;
|
||||
master->pub.pass_startup = pass_startup;
|
||||
master->pub.finish_pass = finish_pass_master;
|
||||
master->pub.is_last_pass = FALSE;
|
||||
master->pub.call_pass_startup = FALSE;
|
||||
|
||||
/* Validate parameters, determine derived values */
|
||||
initial_setup(cinfo, transcode_only);
|
||||
@@ -912,7 +909,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 */
|
||||
@@ -933,23 +930,24 @@ jinit_c_master_control (j_compress_ptr cinfo, boolean transcode_only)
|
||||
else
|
||||
master->total_passes = cinfo->num_scans;
|
||||
|
||||
if (cinfo->trellis_quant) {
|
||||
if (cinfo->progressive_mode)
|
||||
master->total_passes += ((cinfo->use_scans_in_trellis) ? 4 : 2) * cinfo->num_components * cinfo->trellis_num_loops;
|
||||
master->pass_number_scan_opt_base = 0;
|
||||
if (cinfo->master->trellis_quant) {
|
||||
if (cinfo->optimize_coding)
|
||||
master->pass_number_scan_opt_base =
|
||||
((cinfo->master->use_scans_in_trellis) ? 4 : 2) * cinfo->num_components *
|
||||
cinfo->master->trellis_num_loops;
|
||||
else
|
||||
master->total_passes += 1;
|
||||
master->pass_number_scan_opt_base =
|
||||
((cinfo->master->use_scans_in_trellis) ? 2 : 1) * cinfo->num_components *
|
||||
cinfo->master->trellis_num_loops + 1;
|
||||
master->total_passes += master->pass_number_scan_opt_base;
|
||||
}
|
||||
|
||||
if (cinfo->optimize_scans) {
|
||||
if (cinfo->master->optimize_scans) {
|
||||
int i;
|
||||
master->best_Al_chroma = 0;
|
||||
|
||||
for (i = 0; i < cinfo->num_scans; i++)
|
||||
master->scan_buffer[i] = NULL;
|
||||
}
|
||||
|
||||
if (cinfo->trellis_quant)
|
||||
master->pass_number_scan_opt_base = ((cinfo->use_scans_in_trellis) ? 4 : 2) * cinfo->num_components * cinfo->trellis_num_loops;
|
||||
else
|
||||
master->pass_number_scan_opt_base = 0;
|
||||
}
|
||||
|
||||
47
jcmaster.h
Normal file
47
jcmaster.h
Normal file
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
* jcmaster.h
|
||||
*
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1991-1997, Thomas G. Lane.
|
||||
* mozjpeg Modifications:
|
||||
* Copyright (C) 2014, Mozilla Corporation.
|
||||
* For conditions of distribution and use, see the accompanying README file.
|
||||
*
|
||||
* This file contains the master control structures for the JPEG compressor.
|
||||
*/
|
||||
|
||||
|
||||
/* Private state */
|
||||
|
||||
typedef enum {
|
||||
main_pass, /* input data, also do first output step */
|
||||
huff_opt_pass, /* Huffman code optimization pass */
|
||||
output_pass, /* data output pass */
|
||||
trellis_pass /* trellis quantization pass */
|
||||
} c_pass_type;
|
||||
|
||||
typedef struct {
|
||||
struct jpeg_comp_master pub; /* public fields */
|
||||
|
||||
c_pass_type pass_type; /* the type of the current pass */
|
||||
|
||||
int pass_number; /* # of passes completed */
|
||||
int total_passes; /* total # of passes needed */
|
||||
|
||||
int scan_number; /* current index in scan_info[] */
|
||||
|
||||
/* fields for scan optimisation */
|
||||
int pass_number_scan_opt_base; /* pass number where scan optimization begins */
|
||||
unsigned char * scan_buffer[64]; /* buffer for a given scan */
|
||||
unsigned long scan_size[64]; /* size for a given scan */
|
||||
int actual_Al[64]; /* actual value of Al used for a scan */
|
||||
unsigned long best_cost; /* bit count for best frequency split */
|
||||
int best_freq_split_idx_luma; /* index for best frequency split (luma) */
|
||||
int best_freq_split_idx_chroma; /* index for best frequency split (chroma) */
|
||||
int best_Al_luma; /* best value for Al found in scan search (luma) */
|
||||
int best_Al_chroma; /* best value for Al found in scan search (luma) */
|
||||
boolean interleave_chroma_dc; /* indicate whether to interleave chroma DC scans */
|
||||
struct jpeg_destination_mgr * saved_dest; /* saved value of cinfo->dest */
|
||||
} my_comp_master;
|
||||
|
||||
typedef my_comp_master * my_master_ptr;
|
||||
18
jcomapi.c
18
jcomapi.c
@@ -1,8 +1,10 @@
|
||||
/*
|
||||
* jcomapi.c
|
||||
*
|
||||
* Copyright (C) 1994-1997, Thomas G. Lane.
|
||||
* This file is part of the Independent JPEG Group's software.
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1994-1997, Thomas G. Lane.0
|
||||
* 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.
|
||||
*
|
||||
* This file contains application interface routines that are used for both
|
||||
@@ -72,8 +74,8 @@ jpeg_destroy (j_common_ptr cinfo)
|
||||
/* NB: mem pointer is NULL if memory mgr failed to initialize. */
|
||||
if (cinfo->mem != NULL)
|
||||
(*cinfo->mem->self_destruct) (cinfo);
|
||||
cinfo->mem = NULL; /* be safe if jpeg_destroy is called twice */
|
||||
cinfo->global_state = 0; /* mark it destroyed */
|
||||
cinfo->mem = NULL; /* be safe if jpeg_destroy is called twice */
|
||||
cinfo->global_state = 0; /* mark it destroyed */
|
||||
}
|
||||
|
||||
|
||||
@@ -88,8 +90,8 @@ jpeg_alloc_quant_table (j_common_ptr cinfo)
|
||||
JQUANT_TBL *tbl;
|
||||
|
||||
tbl = (JQUANT_TBL *)
|
||||
(*cinfo->mem->alloc_small) (cinfo, JPOOL_PERMANENT, SIZEOF(JQUANT_TBL));
|
||||
tbl->sent_table = FALSE; /* make sure this is false in any new table */
|
||||
(*cinfo->mem->alloc_small) (cinfo, JPOOL_PERMANENT, sizeof(JQUANT_TBL));
|
||||
tbl->sent_table = FALSE; /* make sure this is false in any new table */
|
||||
return tbl;
|
||||
}
|
||||
|
||||
@@ -100,7 +102,7 @@ jpeg_alloc_huff_table (j_common_ptr cinfo)
|
||||
JHUFF_TBL *tbl;
|
||||
|
||||
tbl = (JHUFF_TBL *)
|
||||
(*cinfo->mem->alloc_small) (cinfo, JPOOL_PERMANENT, SIZEOF(JHUFF_TBL));
|
||||
tbl->sent_table = FALSE; /* make sure this is false in any new table */
|
||||
(*cinfo->mem->alloc_small) (cinfo, JPOOL_PERMANENT, sizeof(JHUFF_TBL));
|
||||
tbl->sent_table = FALSE; /* make sure this is false in any new table */
|
||||
return tbl;
|
||||
}
|
||||
|
||||
36
jconfig.h.in
36
jconfig.h.in
@@ -12,11 +12,19 @@
|
||||
/* Support arithmetic decoding */
|
||||
#undef D_ARITH_CODING_SUPPORTED
|
||||
|
||||
/* Support in-memory source/destination managers */
|
||||
#undef MEM_SRCDST_SUPPORTED
|
||||
/*
|
||||
* Define BITS_IN_JSAMPLE as either
|
||||
* 8 for 8-bit sample values (the usual setting)
|
||||
* 12 for 12-bit sample values
|
||||
* Only 8 and 12 are legal data precisions for lossy JPEG according to the
|
||||
* JPEG standard, and the IJG code does not support anything else!
|
||||
* We do not support run-time selection of data precision, sorry.
|
||||
*/
|
||||
|
||||
/* Compiler supports function prototypes. */
|
||||
#undef HAVE_PROTOTYPES
|
||||
#define BITS_IN_JSAMPLE 8 /* use 8 or 12 */
|
||||
|
||||
/* Define to 1 if you have the <locale.h> header file. */
|
||||
#undef HAVE_LOCALE_H
|
||||
|
||||
/* Define to 1 if you have the <stddef.h> header file. */
|
||||
#undef HAVE_STDDEF_H
|
||||
@@ -24,25 +32,27 @@
|
||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
||||
#undef HAVE_STDLIB_H
|
||||
|
||||
/* Compiler supports 'unsigned char'. */
|
||||
/* Define to 1 if the system has the type `unsigned char'. */
|
||||
#undef HAVE_UNSIGNED_CHAR
|
||||
|
||||
/* Compiler supports 'unsigned short'. */
|
||||
/* Define to 1 if the system has the type `unsigned short'. */
|
||||
#undef HAVE_UNSIGNED_SHORT
|
||||
|
||||
/* Compiler does not support pointers to unspecified structures. */
|
||||
/* Compiler does not support pointers to undefined structures. */
|
||||
#undef INCOMPLETE_TYPES_BROKEN
|
||||
|
||||
/* Compiler has <strings.h> rather than standard <string.h>. */
|
||||
/* Support in-memory source/destination managers */
|
||||
#undef MEM_SRCDST_SUPPORTED
|
||||
|
||||
/* Define if you have BSD-like bzero and bcopy in <strings.h> rather than
|
||||
memset/memcpy in <string.h>. */
|
||||
#undef NEED_BSD_STRINGS
|
||||
|
||||
/* Linker requires that global names be unique in first 15 characters. */
|
||||
#undef NEED_SHORT_EXTERNAL_NAMES
|
||||
|
||||
/* Need to include <sys/types.h> in order to obtain size_t. */
|
||||
/* Define if you need to include <sys/types.h> to get size_t. */
|
||||
#undef NEED_SYS_TYPES_H
|
||||
|
||||
/* Broken compiler shifts signed values as an unsigned shift. */
|
||||
/* Define if your (broken) compiler shifts signed values as if they were
|
||||
unsigned. */
|
||||
#undef RIGHT_SHIFT_IS_UNSIGNED
|
||||
|
||||
/* Use accelerated SIMD routines. */
|
||||
|
||||
45
jconfig.txt
45
jconfig.txt
@@ -1,8 +1,10 @@
|
||||
/*
|
||||
* jconfig.txt
|
||||
*
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1991-1994, Thomas G. Lane.
|
||||
* This file is part of the Independent JPEG Group's software.
|
||||
* 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.
|
||||
*
|
||||
* This file documents the configuration options that are required to
|
||||
@@ -23,11 +25,6 @@
|
||||
* #define the symbol if yes, #undef it if no.
|
||||
*/
|
||||
|
||||
/* Does your compiler support function prototypes?
|
||||
* (If not, you also need to use ansi2knr, see install.txt)
|
||||
*/
|
||||
#define HAVE_PROTOTYPES
|
||||
|
||||
/* Does your compiler support the declaration "unsigned char" ?
|
||||
* How about "unsigned short" ?
|
||||
*/
|
||||
@@ -48,7 +45,7 @@
|
||||
* If you're not sure, leaving it undefined will work at some cost in speed.
|
||||
* If you defined HAVE_UNSIGNED_CHAR then the speed difference is minimal.
|
||||
*/
|
||||
#undef CHAR_IS_UNSIGNED
|
||||
#undef __CHAR_UNSIGNED__
|
||||
|
||||
/* Define this if your system has an ANSI-conforming <stddef.h> file.
|
||||
*/
|
||||
@@ -69,19 +66,6 @@
|
||||
*/
|
||||
#undef NEED_SYS_TYPES_H
|
||||
|
||||
/* For 80x86 machines, you need to define NEED_FAR_POINTERS,
|
||||
* unless you are using a large-data memory model or 80386 flat-memory mode.
|
||||
* On less brain-damaged CPUs this symbol must not be defined.
|
||||
* (Defining this symbol causes large data structures to be referenced through
|
||||
* "far" pointers and to be allocated with a special version of malloc.)
|
||||
*/
|
||||
#undef NEED_FAR_POINTERS
|
||||
|
||||
/* Define this if your linker needs global names to be unique in less
|
||||
* than the first 15 characters.
|
||||
*/
|
||||
#undef NEED_SHORT_EXTERNAL_NAMES
|
||||
|
||||
/* Although a real ANSI C compiler can deal perfectly well with pointers to
|
||||
* unspecified structures (see "incomplete types" in the spec), a few pre-ANSI
|
||||
* and pseudo-ANSI compilers get confused. To keep one of these bozos happy,
|
||||
@@ -94,10 +78,10 @@
|
||||
/* Define "boolean" as unsigned char, not int, on Windows systems.
|
||||
*/
|
||||
#ifdef _WIN32
|
||||
#ifndef __RPCNDR_H__ /* don't conflict if rpcndr.h already read */
|
||||
#ifndef __RPCNDR_H__ /* don't conflict if rpcndr.h already read */
|
||||
typedef unsigned char boolean;
|
||||
#endif
|
||||
#define HAVE_BOOLEAN /* prevent jmorecfg.h from redefining it */
|
||||
#define HAVE_BOOLEAN /* prevent jmorecfg.h from redefining it */
|
||||
#endif
|
||||
|
||||
|
||||
@@ -130,11 +114,12 @@ typedef unsigned char boolean;
|
||||
|
||||
/* These defines indicate which image (non-JPEG) file formats are allowed. */
|
||||
|
||||
#define BMP_SUPPORTED /* BMP image file format */
|
||||
#define GIF_SUPPORTED /* GIF image file format */
|
||||
#define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */
|
||||
#undef RLE_SUPPORTED /* Utah RLE image file format */
|
||||
#define TARGA_SUPPORTED /* Targa image file format */
|
||||
#define PNG_SUPPORTED /* PNG image file format */
|
||||
#define BMP_SUPPORTED /* BMP image file format */
|
||||
#define GIF_SUPPORTED /* GIF image file format */
|
||||
#define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */
|
||||
#undef RLE_SUPPORTED /* Utah RLE image file format */
|
||||
#define TARGA_SUPPORTED /* Targa image file format */
|
||||
|
||||
/* Define this if you want to name both input and output files on the command
|
||||
* line, rather than using stdout and optionally stdin. You MUST do this if
|
||||
@@ -143,12 +128,6 @@ typedef unsigned char boolean;
|
||||
*/
|
||||
#undef TWO_FILE_COMMANDLINE
|
||||
|
||||
/* Define this if your system needs explicit cleanup of temporary files.
|
||||
* This is crucial under MS-DOS, where the temporary "files" may be areas
|
||||
* of extended memory; on most other systems it's not as important.
|
||||
*/
|
||||
#undef NEED_SIGNAL_CATCHER
|
||||
|
||||
/* By default, we open image files with fopen(...,"rb") or fopen(...,"wb").
|
||||
* This is necessary on systems that distinguish text files from binary files,
|
||||
* and is harmless on most systems that don't. If you have one of the rare
|
||||
|
||||
11
jconfigint.h.in
Normal file
11
jconfigint.h.in
Normal file
@@ -0,0 +1,11 @@
|
||||
/* libjpeg-turbo build number */
|
||||
#undef BUILD
|
||||
|
||||
/* How to obtain function inlining. */
|
||||
#undef INLINE
|
||||
|
||||
/* Define to the full name of this package. */
|
||||
#undef PACKAGE_NAME
|
||||
|
||||
/* Version number of package */
|
||||
#undef VERSION
|
||||
529
jcparam.c
529
jcparam.c
@@ -18,6 +18,7 @@
|
||||
#define JPEG_INTERNALS
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
#include "jstdhuff.c"
|
||||
|
||||
|
||||
/*
|
||||
@@ -26,8 +27,8 @@
|
||||
|
||||
GLOBAL(void)
|
||||
jpeg_add_quant_table (j_compress_ptr cinfo, int which_tbl,
|
||||
const unsigned int *basic_table,
|
||||
int scale_factor, boolean force_baseline)
|
||||
const unsigned int *basic_table,
|
||||
int scale_factor, boolean force_baseline)
|
||||
/* Define a quantization table equal to the basic_table times
|
||||
* a scale factor (given as a percentage).
|
||||
* If force_baseline is TRUE, the computed quantization table entries
|
||||
@@ -56,7 +57,7 @@ jpeg_add_quant_table (j_compress_ptr cinfo, int which_tbl,
|
||||
if (temp <= 0L) temp = 1L;
|
||||
if (temp > 32767L) temp = 32767L; /* max quantizer needed for 12 bits */
|
||||
if (force_baseline && temp > 255L)
|
||||
temp = 255L; /* limit to baseline range if requested */
|
||||
temp = 255L; /* limit to baseline range if requested */
|
||||
(*qtblptr)->quantval[i] = (UINT16) temp;
|
||||
}
|
||||
|
||||
@@ -69,36 +70,222 @@ jpeg_add_quant_table (j_compress_ptr cinfo, int which_tbl,
|
||||
* The spec says that the values given produce "good" quality, and
|
||||
* when divided by 2, "very good" quality.
|
||||
*/
|
||||
static const unsigned int std_luminance_quant_tbl[DCTSIZE2] = {
|
||||
16, 11, 10, 16, 24, 40, 51, 61,
|
||||
12, 12, 14, 19, 26, 58, 60, 55,
|
||||
14, 13, 16, 24, 40, 57, 69, 56,
|
||||
14, 17, 22, 29, 51, 87, 80, 62,
|
||||
18, 22, 37, 56, 68, 109, 103, 77,
|
||||
24, 35, 55, 64, 81, 104, 113, 92,
|
||||
49, 64, 78, 87, 103, 121, 120, 101,
|
||||
72, 92, 95, 98, 112, 100, 103, 99
|
||||
};
|
||||
static const unsigned int std_chrominance_quant_tbl[DCTSIZE2] = {
|
||||
17, 18, 24, 47, 99, 99, 99, 99,
|
||||
18, 21, 26, 66, 99, 99, 99, 99,
|
||||
24, 26, 56, 99, 99, 99, 99, 99,
|
||||
47, 66, 99, 99, 99, 99, 99, 99,
|
||||
99, 99, 99, 99, 99, 99, 99, 99,
|
||||
99, 99, 99, 99, 99, 99, 99, 99,
|
||||
99, 99, 99, 99, 99, 99, 99, 99,
|
||||
99, 99, 99, 99, 99, 99, 99, 99
|
||||
static const unsigned int std_luminance_quant_tbl[9][DCTSIZE2] = {
|
||||
{
|
||||
/* JPEG Annex K
|
||||
*/
|
||||
16, 11, 10, 16, 24, 40, 51, 61,
|
||||
12, 12, 14, 19, 26, 58, 60, 55,
|
||||
14, 13, 16, 24, 40, 57, 69, 56,
|
||||
14, 17, 22, 29, 51, 87, 80, 62,
|
||||
18, 22, 37, 56, 68, 109, 103, 77,
|
||||
24, 35, 55, 64, 81, 104, 113, 92,
|
||||
49, 64, 78, 87, 103, 121, 120, 101,
|
||||
72, 92, 95, 98, 112, 100, 103, 99
|
||||
},
|
||||
{
|
||||
/* flat
|
||||
*/
|
||||
16, 16, 16, 16, 16, 16, 16, 16,
|
||||
16, 16, 16, 16, 16, 16, 16, 16,
|
||||
16, 16, 16, 16, 16, 16, 16, 16,
|
||||
16, 16, 16, 16, 16, 16, 16, 16,
|
||||
16, 16, 16, 16, 16, 16, 16, 16,
|
||||
16, 16, 16, 16, 16, 16, 16, 16,
|
||||
16, 16, 16, 16, 16, 16, 16, 16,
|
||||
16, 16, 16, 16, 16, 16, 16, 16
|
||||
},
|
||||
{
|
||||
12, 17, 20, 21, 30, 34, 56, 63,
|
||||
18, 20, 20, 26, 28, 51, 61, 55,
|
||||
19, 20, 21, 26, 33, 58, 69, 55,
|
||||
26, 26, 26, 30, 46, 87, 86, 66,
|
||||
31, 33, 36, 40, 46, 96, 100, 73,
|
||||
40, 35, 46, 62, 81, 100, 111, 91,
|
||||
46, 66, 76, 86, 102, 121, 120, 101,
|
||||
68, 90, 90, 96, 113, 102, 105, 103
|
||||
},
|
||||
{
|
||||
/* From http://www.imagemagick.org/discourse-server/viewtopic.php?f=22&t=20333&p=98008#p98008
|
||||
*/
|
||||
16, 16, 16, 18, 25, 37, 56, 85,
|
||||
16, 17, 20, 27, 34, 40, 53, 75,
|
||||
16, 20, 24, 31, 43, 62, 91, 135,
|
||||
18, 27, 31, 40, 53, 74, 106, 156,
|
||||
25, 34, 43, 53, 69, 94, 131, 189,
|
||||
37, 40, 62, 74, 94, 124, 169, 238,
|
||||
56, 53, 91, 106, 131, 169, 226, 311,
|
||||
85, 75, 135, 156, 189, 238, 311, 418
|
||||
},
|
||||
{
|
||||
9, 10, 12, 14, 27, 32, 51, 62,
|
||||
11, 12, 14, 19, 27, 44, 59, 73,
|
||||
12, 14, 18, 25, 42, 59, 79, 78,
|
||||
17, 18, 25, 42, 61, 92, 87, 92,
|
||||
23, 28, 42, 75, 79, 112, 112, 99,
|
||||
40, 42, 59, 84, 88, 124, 132, 111,
|
||||
42, 64, 78, 95, 105, 126, 125, 99,
|
||||
70, 75, 100, 102, 116, 100, 107, 98
|
||||
},
|
||||
{
|
||||
/* Relevance of human vision to JPEG-DCT compression (1992) Klein, Silverstein and Carney.
|
||||
*/
|
||||
10, 12, 14, 19, 26, 38, 57, 86,
|
||||
12, 18, 21, 28, 35, 41, 54, 76,
|
||||
14, 21, 25, 32, 44, 63, 92, 136,
|
||||
19, 28, 32, 41, 54, 75, 107, 157,
|
||||
26, 35, 44, 54, 70, 95, 132, 190,
|
||||
38, 41, 63, 75, 95, 125, 170, 239,
|
||||
57, 54, 92, 107, 132, 170, 227, 312,
|
||||
86, 76, 136, 157, 190, 239, 312, 419
|
||||
},
|
||||
{
|
||||
/* DCTune perceptual optimization of compressed dental X-Rays (1997) Watson, Taylor, Borthwick
|
||||
*/
|
||||
7, 8, 10, 14, 23, 44, 95, 241,
|
||||
8, 8, 11, 15, 25, 47, 102, 255,
|
||||
10, 11, 13, 19, 31, 58, 127, 255,
|
||||
14, 15, 19, 27, 44, 83, 181, 255,
|
||||
23, 25, 31, 44, 72, 136, 255, 255,
|
||||
44, 47, 58, 83, 136, 255, 255, 255,
|
||||
95, 102, 127, 181, 255, 255, 255, 255,
|
||||
241, 255, 255, 255, 255, 255, 255, 255
|
||||
},
|
||||
{
|
||||
/* A visual detection model for DCT coefficient quantization (12/9/93) Ahumada, Watson, Peterson
|
||||
*/
|
||||
15, 11, 11, 12, 15, 19, 25, 32,
|
||||
11, 13, 10, 10, 12, 15, 19, 24,
|
||||
11, 10, 14, 14, 16, 18, 22, 27,
|
||||
12, 10, 14, 18, 21, 24, 28, 33,
|
||||
15, 12, 16, 21, 26, 31, 36, 42,
|
||||
19, 15, 18, 24, 31, 38, 45, 53,
|
||||
25, 19, 22, 28, 36, 45, 55, 65,
|
||||
32, 24, 27, 33, 42, 53, 65, 77
|
||||
},
|
||||
{
|
||||
/* An improved detection model for DCT coefficient quantization (1993) Peterson, Ahumada and Watson
|
||||
*/
|
||||
14, 10, 11, 14, 19, 25, 34, 45,
|
||||
10, 11, 11, 12, 15, 20, 26, 33,
|
||||
11, 11, 15, 18, 21, 25, 31, 38,
|
||||
14, 12, 18, 24, 28, 33, 39, 47,
|
||||
19, 15, 21, 28, 36, 43, 51, 59,
|
||||
25, 20, 25, 33, 43, 54, 64, 74,
|
||||
34, 26, 31, 39, 51, 64, 77, 91,
|
||||
45, 33, 38, 47, 59, 74, 91, 108
|
||||
}
|
||||
};
|
||||
|
||||
static const unsigned int flat_quant_tbl[DCTSIZE2] = {
|
||||
16, 16, 16, 16, 16, 16, 16, 16,
|
||||
16, 16, 16, 16, 16, 16, 16, 16,
|
||||
16, 16, 16, 16, 16, 16, 16, 16,
|
||||
16, 16, 16, 16, 16, 16, 16, 16,
|
||||
16, 16, 16, 16, 16, 16, 16, 16,
|
||||
16, 16, 16, 16, 16, 16, 16, 16,
|
||||
16, 16, 16, 16, 16, 16, 16, 16,
|
||||
16, 16, 16, 16, 16, 16, 16, 16
|
||||
static const unsigned int std_chrominance_quant_tbl[9][DCTSIZE2] = {
|
||||
{
|
||||
/* JPEG Annex K
|
||||
*/
|
||||
17, 18, 24, 47, 99, 99, 99, 99,
|
||||
18, 21, 26, 66, 99, 99, 99, 99,
|
||||
24, 26, 56, 99, 99, 99, 99, 99,
|
||||
47, 66, 99, 99, 99, 99, 99, 99,
|
||||
99, 99, 99, 99, 99, 99, 99, 99,
|
||||
99, 99, 99, 99, 99, 99, 99, 99,
|
||||
99, 99, 99, 99, 99, 99, 99, 99,
|
||||
99, 99, 99, 99, 99, 99, 99, 99
|
||||
},
|
||||
{
|
||||
/* flat
|
||||
*/
|
||||
16, 16, 16, 16, 16, 16, 16, 16,
|
||||
16, 16, 16, 16, 16, 16, 16, 16,
|
||||
16, 16, 16, 16, 16, 16, 16, 16,
|
||||
16, 16, 16, 16, 16, 16, 16, 16,
|
||||
16, 16, 16, 16, 16, 16, 16, 16,
|
||||
16, 16, 16, 16, 16, 16, 16, 16,
|
||||
16, 16, 16, 16, 16, 16, 16, 16,
|
||||
16, 16, 16, 16, 16, 16, 16, 16
|
||||
},
|
||||
{
|
||||
8, 12, 15, 15, 86, 96, 96, 98,
|
||||
13, 13, 15, 26, 90, 96, 99, 98,
|
||||
12, 15, 18, 96, 99, 99, 99, 99,
|
||||
17, 16, 90, 96, 99, 99, 99, 99,
|
||||
96, 96, 99, 99, 99, 99, 99, 99,
|
||||
99, 99, 99, 99, 99, 99, 99, 99,
|
||||
99, 99, 99, 99, 99, 99, 99, 99,
|
||||
99, 99, 99, 99, 99, 99, 99, 99
|
||||
},
|
||||
{
|
||||
/* From http://www.imagemagick.org/discourse-server/viewtopic.php?f=22&t=20333&p=98008#p98008
|
||||
*/
|
||||
16, 16, 16, 18, 25, 37, 56, 85,
|
||||
16, 17, 20, 27, 34, 40, 53, 75,
|
||||
16, 20, 24, 31, 43, 62, 91, 135,
|
||||
18, 27, 31, 40, 53, 74, 106, 156,
|
||||
25, 34, 43, 53, 69, 94, 131, 189,
|
||||
37, 40, 62, 74, 94, 124, 169, 238,
|
||||
56, 53, 91, 106, 131, 169, 226, 311,
|
||||
85, 75, 135, 156, 189, 238, 311, 418
|
||||
},
|
||||
{
|
||||
9, 10, 17, 19, 62, 89, 91, 97,
|
||||
12, 13, 18, 29, 84, 91, 88, 98,
|
||||
14, 19, 29, 93, 95, 95, 98, 97,
|
||||
20, 26, 84, 88, 95, 95, 98, 94,
|
||||
26, 86, 91, 93, 97, 99, 98, 99,
|
||||
99, 100, 98, 99, 99, 99, 99, 99,
|
||||
99, 99, 99, 99, 99, 99, 99, 99,
|
||||
97, 97, 99, 99, 99, 99, 97, 99
|
||||
},
|
||||
{
|
||||
/* Relevance of human vision to JPEG-DCT compression (1992) Klein, Silverstein and Carney.
|
||||
* Copied from luma
|
||||
*/
|
||||
10, 12, 14, 19, 26, 38, 57, 86,
|
||||
12, 18, 21, 28, 35, 41, 54, 76,
|
||||
14, 21, 25, 32, 44, 63, 92, 136,
|
||||
19, 28, 32, 41, 54, 75, 107, 157,
|
||||
26, 35, 44, 54, 70, 95, 132, 190,
|
||||
38, 41, 63, 75, 95, 125, 170, 239,
|
||||
57, 54, 92, 107, 132, 170, 227, 312,
|
||||
86, 76, 136, 157, 190, 239, 312, 419
|
||||
},
|
||||
{
|
||||
/* DCTune perceptual optimization of compressed dental X-Rays (1997) Watson, Taylor, Borthwick
|
||||
* Copied from luma
|
||||
*/
|
||||
7, 8, 10, 14, 23, 44, 95, 241,
|
||||
8, 8, 11, 15, 25, 47, 102, 255,
|
||||
10, 11, 13, 19, 31, 58, 127, 255,
|
||||
14, 15, 19, 27, 44, 83, 181, 255,
|
||||
23, 25, 31, 44, 72, 136, 255, 255,
|
||||
44, 47, 58, 83, 136, 255, 255, 255,
|
||||
95, 102, 127, 181, 255, 255, 255, 255,
|
||||
241, 255, 255, 255, 255, 255, 255, 255
|
||||
},
|
||||
{
|
||||
/* A visual detection model for DCT coefficient quantization (12/9/93) Ahumada, Watson, Peterson
|
||||
* Copied from luma
|
||||
*/
|
||||
15, 11, 11, 12, 15, 19, 25, 32,
|
||||
11, 13, 10, 10, 12, 15, 19, 24,
|
||||
11, 10, 14, 14, 16, 18, 22, 27,
|
||||
12, 10, 14, 18, 21, 24, 28, 33,
|
||||
15, 12, 16, 21, 26, 31, 36, 42,
|
||||
19, 15, 18, 24, 31, 38, 45, 53,
|
||||
25, 19, 22, 28, 36, 45, 55, 65,
|
||||
32, 24, 27, 33, 42, 53, 65, 77
|
||||
},
|
||||
{
|
||||
/* An improved detection model for DCT coefficient quantization (1993) Peterson, Ahumada and Watson
|
||||
* Copied from luma
|
||||
*/
|
||||
14, 10, 11, 14, 19, 25, 34, 45,
|
||||
10, 11, 11, 12, 15, 20, 26, 33,
|
||||
11, 11, 15, 18, 21, 25, 31, 38,
|
||||
14, 12, 18, 24, 28, 33, 39, 47,
|
||||
19, 15, 21, 28, 36, 43, 51, 59,
|
||||
25, 20, 25, 33, 43, 54, 64, 74,
|
||||
34, 26, 31, 39, 51, 64, 77, 91,
|
||||
45, 33, 38, 47, 59, 74, 91, 108
|
||||
}
|
||||
};
|
||||
|
||||
#if JPEG_LIB_VERSION >= 70
|
||||
@@ -110,24 +297,17 @@ jpeg_default_qtables (j_compress_ptr cinfo, boolean force_baseline)
|
||||
*/
|
||||
{
|
||||
/* Set up two quantization tables using the specified scaling */
|
||||
if (cinfo->use_flat_quant_tbl) {
|
||||
jpeg_add_quant_table(cinfo, 0, flat_quant_tbl,
|
||||
cinfo->q_scale_factor[0], force_baseline);
|
||||
jpeg_add_quant_table(cinfo, 1, flat_quant_tbl,
|
||||
cinfo->q_scale_factor[1], force_baseline);
|
||||
} else {
|
||||
jpeg_add_quant_table(cinfo, 0, std_luminance_quant_tbl,
|
||||
cinfo->q_scale_factor[0], force_baseline);
|
||||
jpeg_add_quant_table(cinfo, 1, std_chrominance_quant_tbl,
|
||||
cinfo->q_scale_factor[1], force_baseline);
|
||||
}
|
||||
jpeg_add_quant_table(cinfo, 0, std_luminance_quant_tbl[cinfo->master->quant_tbl_master_idx],
|
||||
cinfo->q_scale_factor[0], force_baseline);
|
||||
jpeg_add_quant_table(cinfo, 1, std_chrominance_quant_tbl[cinfo->master->quant_tbl_master_idx],
|
||||
cinfo->q_scale_factor[1], force_baseline);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
GLOBAL(void)
|
||||
jpeg_set_linear_quality (j_compress_ptr cinfo, int scale_factor,
|
||||
boolean force_baseline)
|
||||
boolean force_baseline)
|
||||
/* Set or change the 'quality' (quantization) setting, using default tables
|
||||
* and a straight percentage-scaling quality scale. In most cases it's better
|
||||
* to use jpeg_set_quality (below); this entry point is provided for
|
||||
@@ -135,30 +315,29 @@ jpeg_set_linear_quality (j_compress_ptr cinfo, int scale_factor,
|
||||
*/
|
||||
{
|
||||
/* Set up two quantization tables using the specified scaling */
|
||||
if (cinfo->use_flat_quant_tbl) {
|
||||
jpeg_add_quant_table(cinfo, 0, flat_quant_tbl,
|
||||
scale_factor, force_baseline);
|
||||
jpeg_add_quant_table(cinfo, 1, flat_quant_tbl,
|
||||
scale_factor, force_baseline);
|
||||
} else {
|
||||
jpeg_add_quant_table(cinfo, 0, std_luminance_quant_tbl,
|
||||
scale_factor, force_baseline);
|
||||
jpeg_add_quant_table(cinfo, 1, std_chrominance_quant_tbl,
|
||||
scale_factor, force_baseline);
|
||||
}
|
||||
jpeg_add_quant_table(cinfo, 0, std_luminance_quant_tbl[cinfo->master->quant_tbl_master_idx],
|
||||
scale_factor, force_baseline);
|
||||
jpeg_add_quant_table(cinfo, 1, std_chrominance_quant_tbl[cinfo->master->quant_tbl_master_idx],
|
||||
scale_factor, force_baseline);
|
||||
}
|
||||
|
||||
|
||||
GLOBAL(int)
|
||||
jpeg_quality_scaling (int quality)
|
||||
{
|
||||
return jpeg_float_quality_scaling(quality);
|
||||
}
|
||||
|
||||
GLOBAL(float)
|
||||
jpeg_float_quality_scaling(float quality)
|
||||
/* Convert a user-specified quality rating to a percentage scaling factor
|
||||
* for an underlying quantization table, using our recommended scaling curve.
|
||||
* The input 'quality' factor should be 0 (terrible) to 100 (very good).
|
||||
*/
|
||||
{
|
||||
/* Safety limit on quality factor. Convert 0 to 1 to avoid zero divide. */
|
||||
if (quality <= 0) quality = 1;
|
||||
if (quality > 100) quality = 100;
|
||||
if (quality <= 0.f) quality = 1.f;
|
||||
if (quality > 100.f) quality = 100.f;
|
||||
|
||||
/* The basic table is used as-is (scaling 100) for a quality of 50.
|
||||
* Qualities 50..100 are converted to scaling percentage 200 - 2*Q;
|
||||
@@ -166,10 +345,10 @@ jpeg_quality_scaling (int quality)
|
||||
* to make all the table entries 1 (hence, minimum quantization loss).
|
||||
* Qualities 1..50 are converted to scaling percentage 5000/Q.
|
||||
*/
|
||||
if (quality < 50)
|
||||
quality = 5000 / quality;
|
||||
if (quality < 50.f)
|
||||
quality = 5000.f / quality;
|
||||
else
|
||||
quality = 200 - quality*2;
|
||||
quality = 200.f - quality*2.f;
|
||||
|
||||
return quality;
|
||||
}
|
||||
@@ -191,116 +370,6 @@ jpeg_set_quality (j_compress_ptr cinfo, int quality, boolean force_baseline)
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Huffman table setup routines
|
||||
*/
|
||||
|
||||
LOCAL(void)
|
||||
add_huff_table (j_compress_ptr cinfo,
|
||||
JHUFF_TBL **htblptr, const UINT8 *bits, const UINT8 *val)
|
||||
/* Define a Huffman table */
|
||||
{
|
||||
int nsymbols, len;
|
||||
|
||||
if (*htblptr == NULL)
|
||||
*htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo);
|
||||
|
||||
/* Copy the number-of-symbols-of-each-code-length counts */
|
||||
MEMCOPY((*htblptr)->bits, bits, SIZEOF((*htblptr)->bits));
|
||||
|
||||
/* Validate the counts. We do this here mainly so we can copy the right
|
||||
* number of symbols from the val[] array, without risking marching off
|
||||
* the end of memory. jchuff.c will do a more thorough test later.
|
||||
*/
|
||||
nsymbols = 0;
|
||||
for (len = 1; len <= 16; len++)
|
||||
nsymbols += bits[len];
|
||||
if (nsymbols < 1 || nsymbols > 256)
|
||||
ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);
|
||||
|
||||
MEMCOPY((*htblptr)->huffval, val, nsymbols * SIZEOF(UINT8));
|
||||
|
||||
/* Initialize sent_table FALSE so table will be written to JPEG file. */
|
||||
(*htblptr)->sent_table = FALSE;
|
||||
}
|
||||
|
||||
|
||||
LOCAL(void)
|
||||
std_huff_tables (j_compress_ptr cinfo)
|
||||
/* Set up the standard Huffman tables (cf. JPEG standard section K.3) */
|
||||
/* IMPORTANT: these are only valid for 8-bit data precision! */
|
||||
{
|
||||
static const UINT8 bits_dc_luminance[17] =
|
||||
{ /* 0-base */ 0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0 };
|
||||
static const UINT8 val_dc_luminance[] =
|
||||
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 };
|
||||
|
||||
static const UINT8 bits_dc_chrominance[17] =
|
||||
{ /* 0-base */ 0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0 };
|
||||
static const UINT8 val_dc_chrominance[] =
|
||||
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 };
|
||||
|
||||
static const UINT8 bits_ac_luminance[17] =
|
||||
{ /* 0-base */ 0, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 0x7d };
|
||||
static const UINT8 val_ac_luminance[] =
|
||||
{ 0x01, 0x02, 0x03, 0x00, 0x04, 0x11, 0x05, 0x12,
|
||||
0x21, 0x31, 0x41, 0x06, 0x13, 0x51, 0x61, 0x07,
|
||||
0x22, 0x71, 0x14, 0x32, 0x81, 0x91, 0xa1, 0x08,
|
||||
0x23, 0x42, 0xb1, 0xc1, 0x15, 0x52, 0xd1, 0xf0,
|
||||
0x24, 0x33, 0x62, 0x72, 0x82, 0x09, 0x0a, 0x16,
|
||||
0x17, 0x18, 0x19, 0x1a, 0x25, 0x26, 0x27, 0x28,
|
||||
0x29, 0x2a, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39,
|
||||
0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49,
|
||||
0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59,
|
||||
0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69,
|
||||
0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79,
|
||||
0x7a, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89,
|
||||
0x8a, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98,
|
||||
0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7,
|
||||
0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6,
|
||||
0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3, 0xc4, 0xc5,
|
||||
0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2, 0xd3, 0xd4,
|
||||
0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xe1, 0xe2,
|
||||
0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea,
|
||||
0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8,
|
||||
0xf9, 0xfa };
|
||||
|
||||
static const UINT8 bits_ac_chrominance[17] =
|
||||
{ /* 0-base */ 0, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 0x77 };
|
||||
static const UINT8 val_ac_chrominance[] =
|
||||
{ 0x00, 0x01, 0x02, 0x03, 0x11, 0x04, 0x05, 0x21,
|
||||
0x31, 0x06, 0x12, 0x41, 0x51, 0x07, 0x61, 0x71,
|
||||
0x13, 0x22, 0x32, 0x81, 0x08, 0x14, 0x42, 0x91,
|
||||
0xa1, 0xb1, 0xc1, 0x09, 0x23, 0x33, 0x52, 0xf0,
|
||||
0x15, 0x62, 0x72, 0xd1, 0x0a, 0x16, 0x24, 0x34,
|
||||
0xe1, 0x25, 0xf1, 0x17, 0x18, 0x19, 0x1a, 0x26,
|
||||
0x27, 0x28, 0x29, 0x2a, 0x35, 0x36, 0x37, 0x38,
|
||||
0x39, 0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48,
|
||||
0x49, 0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58,
|
||||
0x59, 0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68,
|
||||
0x69, 0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78,
|
||||
0x79, 0x7a, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
|
||||
0x88, 0x89, 0x8a, 0x92, 0x93, 0x94, 0x95, 0x96,
|
||||
0x97, 0x98, 0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5,
|
||||
0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4,
|
||||
0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3,
|
||||
0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2,
|
||||
0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda,
|
||||
0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9,
|
||||
0xea, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8,
|
||||
0xf9, 0xfa };
|
||||
|
||||
add_huff_table(cinfo, &cinfo->dc_huff_tbl_ptrs[0],
|
||||
bits_dc_luminance, val_dc_luminance);
|
||||
add_huff_table(cinfo, &cinfo->ac_huff_tbl_ptrs[0],
|
||||
bits_ac_luminance, val_ac_luminance);
|
||||
add_huff_table(cinfo, &cinfo->dc_huff_tbl_ptrs[1],
|
||||
bits_dc_chrominance, val_dc_chrominance);
|
||||
add_huff_table(cinfo, &cinfo->ac_huff_tbl_ptrs[1],
|
||||
bits_ac_chrominance, val_ac_chrominance);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Default parameter setup for compression.
|
||||
*
|
||||
@@ -327,19 +396,19 @@ jpeg_set_defaults (j_compress_ptr cinfo)
|
||||
if (cinfo->comp_info == NULL)
|
||||
cinfo->comp_info = (jpeg_component_info *)
|
||||
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
|
||||
MAX_COMPONENTS * SIZEOF(jpeg_component_info));
|
||||
MAX_COMPONENTS * sizeof(jpeg_component_info));
|
||||
|
||||
/* Initialize everything not dependent on the color space */
|
||||
|
||||
#if JPEG_LIB_VERSION >= 70
|
||||
cinfo->scale_num = 1; /* 1:1 scaling */
|
||||
cinfo->scale_num = 1; /* 1:1 scaling */
|
||||
cinfo->scale_denom = 1;
|
||||
#endif
|
||||
cinfo->data_precision = BITS_IN_JSAMPLE;
|
||||
/* Set up two quantization tables using default quality of 75 */
|
||||
jpeg_set_quality(cinfo, 75, TRUE);
|
||||
/* Set up two Huffman tables */
|
||||
std_huff_tables(cinfo);
|
||||
std_huff_tables((j_common_ptr) cinfo);
|
||||
|
||||
/* Initialize default arithmetic coding conditioning */
|
||||
for (i = 0; i < NUM_ARITH_TBLS; i++) {
|
||||
@@ -348,19 +417,9 @@ jpeg_set_defaults (j_compress_ptr cinfo)
|
||||
cinfo->arith_ac_K[i] = 5;
|
||||
}
|
||||
|
||||
#ifdef C_PROGRESSIVE_SUPPORTED
|
||||
cinfo->scan_info = NULL;
|
||||
cinfo->num_scans = 0;
|
||||
if (!cinfo->use_moz_defaults) {
|
||||
/* Default is no multiple-scan output */
|
||||
cinfo->scan_info = NULL;
|
||||
cinfo->num_scans = 0;
|
||||
}
|
||||
#else
|
||||
/* Default is no multiple-scan output */
|
||||
cinfo->scan_info = NULL;
|
||||
cinfo->num_scans = 0;
|
||||
#endif
|
||||
|
||||
/* Expect normal source image, not raw downsampled data */
|
||||
cinfo->raw_data_in = FALSE;
|
||||
@@ -369,7 +428,7 @@ jpeg_set_defaults (j_compress_ptr cinfo)
|
||||
cinfo->arith_code = FALSE;
|
||||
|
||||
#ifdef ENTROPY_OPT_SUPPORTED
|
||||
if (cinfo->use_moz_defaults)
|
||||
if (cinfo->master->compress_profile == JCP_MAX_COMPRESSION)
|
||||
/* By default, do extra passes to optimize entropy coding */
|
||||
cinfo->optimize_coding = TRUE;
|
||||
else
|
||||
@@ -396,6 +455,9 @@ jpeg_set_defaults (j_compress_ptr cinfo)
|
||||
cinfo->do_fancy_downsampling = TRUE;
|
||||
#endif
|
||||
|
||||
cinfo->master->overshoot_deringing =
|
||||
cinfo->master->compress_profile == JCP_MAX_COMPRESSION;
|
||||
|
||||
/* No input smoothing */
|
||||
cinfo->smoothing_factor = 0;
|
||||
|
||||
@@ -417,33 +479,38 @@ jpeg_set_defaults (j_compress_ptr cinfo)
|
||||
*/
|
||||
cinfo->JFIF_major_version = 1; /* Default JFIF version = 1.01 */
|
||||
cinfo->JFIF_minor_version = 1;
|
||||
cinfo->density_unit = 0; /* Pixel size is unknown by default */
|
||||
cinfo->X_density = 1; /* Pixel aspect ratio is square by default */
|
||||
cinfo->density_unit = 0; /* Pixel size is unknown by default */
|
||||
cinfo->X_density = 1; /* Pixel aspect ratio is square by default */
|
||||
cinfo->Y_density = 1;
|
||||
|
||||
/* Choose JPEG colorspace based on input space, set defaults accordingly */
|
||||
|
||||
jpeg_default_colorspace(cinfo);
|
||||
|
||||
cinfo->one_dc_scan = TRUE;
|
||||
cinfo->master->dc_scan_opt_mode = 1;
|
||||
|
||||
#ifdef C_PROGRESSIVE_SUPPORTED
|
||||
if (cinfo->use_moz_defaults) {
|
||||
cinfo->optimize_scans = TRUE;
|
||||
if (cinfo->master->compress_profile == JCP_MAX_COMPRESSION) {
|
||||
cinfo->master->optimize_scans = TRUE;
|
||||
jpeg_simple_progression(cinfo);
|
||||
} else
|
||||
cinfo->optimize_scans = FALSE;
|
||||
cinfo->master->optimize_scans = FALSE;
|
||||
#endif
|
||||
|
||||
cinfo->trellis_quant = cinfo->use_moz_defaults;
|
||||
cinfo->lambda_log_scale1 = 16.0;
|
||||
cinfo->lambda_log_scale2 = 15.5;
|
||||
cinfo->master->trellis_quant =
|
||||
cinfo->master->compress_profile == JCP_MAX_COMPRESSION;
|
||||
cinfo->master->lambda_log_scale1 = 14.75;
|
||||
cinfo->master->lambda_log_scale2 = 16.5;
|
||||
cinfo->master->quant_tbl_master_idx =
|
||||
cinfo->master->compress_profile == JCP_MAX_COMPRESSION ? 3 : 0;
|
||||
|
||||
cinfo->use_lambda_weight_tbl = TRUE;
|
||||
cinfo->use_scans_in_trellis = FALSE;
|
||||
cinfo->trellis_freq_split = 8;
|
||||
cinfo->trellis_num_loops = 1;
|
||||
cinfo->trellis_q_opt = FALSE;
|
||||
cinfo->master->use_lambda_weight_tbl = TRUE;
|
||||
cinfo->master->use_scans_in_trellis = FALSE;
|
||||
cinfo->master->trellis_freq_split = 8;
|
||||
cinfo->master->trellis_num_loops = 1;
|
||||
cinfo->master->trellis_q_opt = FALSE;
|
||||
cinfo->master->trellis_quant_dc = TRUE;
|
||||
cinfo->master->trellis_delta_dc_weight = 0.0;
|
||||
}
|
||||
|
||||
|
||||
@@ -564,7 +631,7 @@ jpeg_set_colorspace (j_compress_ptr cinfo, J_COLOR_SPACE colorspace)
|
||||
cinfo->num_components = cinfo->input_components;
|
||||
if (cinfo->num_components < 1 || cinfo->num_components > MAX_COMPONENTS)
|
||||
ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->num_components,
|
||||
MAX_COMPONENTS);
|
||||
MAX_COMPONENTS);
|
||||
for (ci = 0; ci < cinfo->num_components; ci++) {
|
||||
SET_COMP(ci, ci, 1,1, 0, 0,0);
|
||||
}
|
||||
@@ -579,7 +646,7 @@ jpeg_set_colorspace (j_compress_ptr cinfo, J_COLOR_SPACE colorspace)
|
||||
|
||||
LOCAL(jpeg_scan_info *)
|
||||
fill_a_scan (jpeg_scan_info * scanptr, int ci,
|
||||
int Ss, int Se, int Ah, int Al)
|
||||
int Ss, int Se, int Ah, int Al)
|
||||
/* Support routine: generate one scan for specified component */
|
||||
{
|
||||
scanptr->comps_in_scan = 1;
|
||||
@@ -594,7 +661,7 @@ fill_a_scan (jpeg_scan_info * scanptr, int ci,
|
||||
|
||||
LOCAL(jpeg_scan_info *)
|
||||
fill_a_scan_pair (jpeg_scan_info * scanptr, int ci,
|
||||
int Ss, int Se, int Ah, int Al)
|
||||
int Ss, int Se, int Ah, int Al)
|
||||
/* Support routine: generate one scan for pair of components */
|
||||
{
|
||||
scanptr->comps_in_scan = 2;
|
||||
@@ -610,7 +677,7 @@ fill_a_scan_pair (jpeg_scan_info * scanptr, int ci,
|
||||
|
||||
LOCAL(jpeg_scan_info *)
|
||||
fill_scans (jpeg_scan_info * scanptr, int ncomps,
|
||||
int Ss, int Se, int Ah, int Al)
|
||||
int Ss, int Se, int Ah, int Al)
|
||||
/* Support routine: generate one scan for each component */
|
||||
{
|
||||
int ci;
|
||||
@@ -676,7 +743,7 @@ jpeg_search_progression (j_compress_ptr cinfo)
|
||||
} else if (ncomps == 1) {
|
||||
nscans = 23;
|
||||
} else {
|
||||
cinfo->num_scans_luma = 0;
|
||||
cinfo->master->num_scans_luma = 0;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -691,16 +758,18 @@ jpeg_search_progression (j_compress_ptr cinfo)
|
||||
cinfo->script_space_size = MAX(nscans, 64);
|
||||
cinfo->script_space = (jpeg_scan_info *)
|
||||
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
|
||||
cinfo->script_space_size * SIZEOF(jpeg_scan_info));
|
||||
cinfo->script_space_size * sizeof(jpeg_scan_info));
|
||||
}
|
||||
scanptr = cinfo->script_space;
|
||||
cinfo->scan_info = scanptr;
|
||||
cinfo->num_scans = nscans;
|
||||
|
||||
cinfo->Al_max_luma = 3;
|
||||
cinfo->num_scans_luma_dc = 1;
|
||||
cinfo->num_frequency_splits = 5;
|
||||
cinfo->num_scans_luma = cinfo->num_scans_luma_dc + (3 * cinfo->Al_max_luma + 2) + (2 * cinfo->num_frequency_splits + 1);
|
||||
cinfo->master->Al_max_luma = 3;
|
||||
cinfo->master->num_scans_luma_dc = 1;
|
||||
cinfo->master->num_frequency_splits = 5;
|
||||
cinfo->master->num_scans_luma =
|
||||
cinfo->master->num_scans_luma_dc + (3 * cinfo->master->Al_max_luma + 2) +
|
||||
(2 * cinfo->master->num_frequency_splits + 1);
|
||||
|
||||
/* 23 scans for luma */
|
||||
/* 1 scan for DC */
|
||||
@@ -711,7 +780,7 @@ jpeg_search_progression (j_compress_ptr cinfo)
|
||||
/* last 4 done conditionally */
|
||||
|
||||
/* luma DC by itself */
|
||||
if (cinfo->one_dc_scan)
|
||||
if (cinfo->master->dc_scan_opt_mode == 0)
|
||||
scanptr = fill_dc_scans(scanptr, ncomps, 0, 0);
|
||||
else
|
||||
scanptr = fill_dc_scans(scanptr, 1, 0, 0);
|
||||
@@ -719,7 +788,7 @@ jpeg_search_progression (j_compress_ptr cinfo)
|
||||
scanptr = fill_a_scan(scanptr, 0, 1, 8, 0, 0);
|
||||
scanptr = fill_a_scan(scanptr, 0, 9, 63, 0, 0);
|
||||
|
||||
for (Al = 0; Al < cinfo->Al_max_luma; Al++) {
|
||||
for (Al = 0; Al < cinfo->master->Al_max_luma; Al++) {
|
||||
scanptr = fill_a_scan(scanptr, 0, 1, 63, Al+1, Al);
|
||||
scanptr = fill_a_scan(scanptr, 0, 1, 8, 0, Al+1);
|
||||
scanptr = fill_a_scan(scanptr, 0, 9, 63, 0, Al+1);
|
||||
@@ -727,17 +796,17 @@ jpeg_search_progression (j_compress_ptr cinfo)
|
||||
|
||||
scanptr = fill_a_scan(scanptr, 0, 1, 63, 0, 0);
|
||||
|
||||
for (i = 0; i < cinfo->num_frequency_splits; i++) {
|
||||
for (i = 0; i < cinfo->master->num_frequency_splits; i++) {
|
||||
scanptr = fill_a_scan(scanptr, 0, 1, frequency_split[i], 0, 0);
|
||||
scanptr = fill_a_scan(scanptr, 0, frequency_split[i]+1, 63, 0, 0);
|
||||
}
|
||||
|
||||
if (ncomps == 1) {
|
||||
cinfo->Al_max_chroma = 0;
|
||||
cinfo->num_scans_chroma_dc = 0;
|
||||
cinfo->master->Al_max_chroma = 0;
|
||||
cinfo->master->num_scans_chroma_dc = 0;
|
||||
} else {
|
||||
cinfo->Al_max_chroma = 2;
|
||||
cinfo->num_scans_chroma_dc = 3;
|
||||
cinfo->master->Al_max_chroma = 2;
|
||||
cinfo->master->num_scans_chroma_dc = 3;
|
||||
/* 41 scans for chroma */
|
||||
|
||||
/* chroma DC combined */
|
||||
@@ -751,7 +820,7 @@ jpeg_search_progression (j_compress_ptr cinfo)
|
||||
scanptr = fill_a_scan(scanptr, 2, 1, 8, 0, 0);
|
||||
scanptr = fill_a_scan(scanptr, 2, 9, 63, 0, 0);
|
||||
|
||||
for (Al = 0; Al < cinfo->Al_max_chroma; Al++) {
|
||||
for (Al = 0; Al < cinfo->master->Al_max_chroma; Al++) {
|
||||
scanptr = fill_a_scan(scanptr, 1, 1, 63, Al+1, Al);
|
||||
scanptr = fill_a_scan(scanptr, 2, 1, 63, Al+1, Al);
|
||||
scanptr = fill_a_scan(scanptr, 1, 1, 8, 0, Al+1);
|
||||
@@ -763,7 +832,7 @@ jpeg_search_progression (j_compress_ptr cinfo)
|
||||
scanptr = fill_a_scan(scanptr, 1, 1, 63, 0, 0);
|
||||
scanptr = fill_a_scan(scanptr, 2, 1, 63, 0, 0);
|
||||
|
||||
for (i = 0; i < cinfo->num_frequency_splits; i++) {
|
||||
for (i = 0; i < cinfo->master->num_frequency_splits; i++) {
|
||||
scanptr = fill_a_scan(scanptr, 1, 1, frequency_split[i], 0, 0);
|
||||
scanptr = fill_a_scan(scanptr, 1, frequency_split[i]+1, 63, 0, 0);
|
||||
scanptr = fill_a_scan(scanptr, 2, 1, frequency_split[i], 0, 0);
|
||||
@@ -786,7 +855,7 @@ jpeg_simple_progression (j_compress_ptr cinfo)
|
||||
int nscans;
|
||||
jpeg_scan_info * scanptr;
|
||||
|
||||
if (cinfo->optimize_scans) {
|
||||
if (cinfo->master->optimize_scans) {
|
||||
if (jpeg_search_progression(cinfo) == TRUE)
|
||||
return;
|
||||
}
|
||||
@@ -802,16 +871,16 @@ jpeg_simple_progression (j_compress_ptr cinfo)
|
||||
nscans = 10;
|
||||
} else {
|
||||
/* All-purpose script for other color spaces. */
|
||||
if (cinfo->use_moz_defaults == TRUE) {
|
||||
if (cinfo->master->compress_profile == JCP_MAX_COMPRESSION) {
|
||||
if (ncomps > MAX_COMPS_IN_SCAN)
|
||||
nscans = 5 * ncomps; /* 2 DC + 4 AC scans per component */
|
||||
nscans = 5 * ncomps; /* 2 DC + 4 AC scans per component */
|
||||
else
|
||||
nscans = 1 + 4 * ncomps; /* 2 DC scans; 4 AC scans per component */
|
||||
nscans = 1 + 4 * ncomps; /* 2 DC scans; 4 AC scans per component */
|
||||
} else {
|
||||
if (ncomps > MAX_COMPS_IN_SCAN)
|
||||
nscans = 6 * ncomps; /* 2 DC + 4 AC scans per component */
|
||||
nscans = 6 * ncomps; /* 2 DC + 4 AC scans per component */
|
||||
else
|
||||
nscans = 2 + 4 * ncomps; /* 2 DC scans; 4 AC scans per component */
|
||||
nscans = 2 + 4 * ncomps; /* 2 DC scans; 4 AC scans per component */
|
||||
}
|
||||
}
|
||||
|
||||
@@ -826,7 +895,7 @@ jpeg_simple_progression (j_compress_ptr cinfo)
|
||||
cinfo->script_space_size = MAX(nscans, 10);
|
||||
cinfo->script_space = (jpeg_scan_info *)
|
||||
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
|
||||
cinfo->script_space_size * SIZEOF(jpeg_scan_info));
|
||||
cinfo->script_space_size * sizeof(jpeg_scan_info));
|
||||
}
|
||||
scanptr = cinfo->script_space;
|
||||
cinfo->scan_info = scanptr;
|
||||
@@ -834,11 +903,16 @@ jpeg_simple_progression (j_compress_ptr cinfo)
|
||||
|
||||
if (ncomps == 3 && cinfo->jpeg_color_space == JCS_YCbCr) {
|
||||
/* Custom script for YCbCr color images. */
|
||||
if (cinfo->use_moz_defaults == TRUE) {
|
||||
if (cinfo->master->compress_profile == JCP_MAX_COMPRESSION) {
|
||||
/* scan defined in jpeg_scan_rgb.txt in jpgcrush */
|
||||
/* Initial DC scan */
|
||||
if (cinfo->one_dc_scan)
|
||||
/* Initial DC scan */
|
||||
if (cinfo->master->dc_scan_opt_mode == 0)
|
||||
scanptr = fill_dc_scans(scanptr, ncomps, 0, 0);
|
||||
else if (cinfo->master->dc_scan_opt_mode == 1) {
|
||||
scanptr = fill_a_scan(scanptr, 0, 0, 0, 0, 0);
|
||||
scanptr = fill_a_scan(scanptr, 1, 0, 0, 0, 0);
|
||||
scanptr = fill_a_scan(scanptr, 2, 0, 0, 0, 0);
|
||||
}
|
||||
else {
|
||||
scanptr = fill_dc_scans(scanptr, 1, 0, 0);
|
||||
scanptr = fill_a_scan_pair(scanptr, 1, 0, 0, 0, 0);
|
||||
@@ -877,7 +951,7 @@ jpeg_simple_progression (j_compress_ptr cinfo)
|
||||
}
|
||||
} else {
|
||||
/* All-purpose script for other color spaces. */
|
||||
if (cinfo->use_moz_defaults == TRUE) {
|
||||
if (cinfo->master->compress_profile == JCP_MAX_COMPRESSION) {
|
||||
/* scan defined in jpeg_scan_bw.txt in jpgcrush */
|
||||
/* DC component, no successive approximation */
|
||||
scanptr = fill_dc_scans(scanptr, ncomps, 0, 0);
|
||||
@@ -902,5 +976,4 @@ jpeg_simple_progression (j_compress_ptr cinfo)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endif /* C_PROGRESSIVE_SUPPORTED */
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user