mirror of
https://github.com/opencv/opencv.git
synced 2026-07-30 15:53:03 +04:00
Compare commits
1129 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6bdb9ca725 | |||
| 1ca74c3c03 | |||
| c3a588037a | |||
| 3fd36c1be1 | |||
| 24effe8cd6 | |||
| 2ff1fb60ad | |||
| 374d952e09 | |||
| 6efdfee3f0 | |||
| 42ac089e12 | |||
| 4748aca61f | |||
| f2fe6f40c2 | |||
| 7837ae0e19 | |||
| a007220c52 | |||
| ebb77bb311 | |||
| 53400d86e2 | |||
| c0489963bb | |||
| 98fc098216 | |||
| 953c60829e | |||
| 6d811f9879 | |||
| 22d0c57a1c | |||
| b1485d0337 | |||
| bdc097495a | |||
| feff8bf972 | |||
| f301f17b61 | |||
| c13a5ce229 | |||
| ab5252c18e | |||
| e35fd463e7 | |||
| fd11e3a81d | |||
| 22d86116ee | |||
| deea46000e | |||
| c99db2b9db | |||
| c69245da1f | |||
| 2b66495a9d | |||
| a105f56957 | |||
| 23bd1866ca | |||
| 59c182ed2b | |||
| c06115cb3f | |||
| 8b483a91bc | |||
| 8814645c8d | |||
| c92f3072b4 | |||
| ffea927ac2 | |||
| 77346d7286 | |||
| 440a937d24 | |||
| ba0b3983c6 | |||
| a3144cbadc | |||
| 5c9a624a85 | |||
| d88d1c9935 | |||
| ed9bca969c | |||
| aa61e79615 | |||
| 25dee8383c | |||
| f81e401cd0 | |||
| 7ce9428e96 | |||
| 677b94c92e | |||
| b88435fdc2 | |||
| 790927bb55 | |||
| e923712d81 | |||
| eacadf0e73 | |||
| e3daf489c8 | |||
| 1c17b3281a | |||
| d2cacac07a | |||
| e0be771b64 | |||
| c2096771cb | |||
| 3cf9185159 | |||
| c8abf2ad14 | |||
| c4d2e3c0b3 | |||
| b40fd6de32 | |||
| 3516d0835e | |||
| fcc69d5a60 | |||
| fef7fc343e | |||
| ad2854c8b3 | |||
| eabbe38001 | |||
| b1ea91d8bd | |||
| 66842f5a18 | |||
| 33e9fe9312 | |||
| 65c209fad3 | |||
| a9163a53d3 | |||
| c657c6cbac | |||
| 8167d47efc | |||
| 1ecea1f4a6 | |||
| 46fd112f9b | |||
| bcf7d3160c | |||
| d2872afce0 | |||
| 70c88a2087 | |||
| 7770ba1f10 | |||
| 7b3a752012 | |||
| 5a75808516 | |||
| 03c4c67dad | |||
| f5f9187720 | |||
| 89b82e796e | |||
| 48fa39f675 | |||
| 69c19dc3d3 | |||
| 5c0502b470 | |||
| f10fce9ab4 | |||
| aaad238c6e | |||
| 741aee6901 | |||
| 0428f60d66 | |||
| b465c82696 | |||
| 8609198b05 | |||
| bf8b5ffeb1 | |||
| a17231a6b4 | |||
| b3a0507546 | |||
| f139a0bda8 | |||
| bdf23ce855 | |||
| 6a49887695 | |||
| e7b6753a10 | |||
| fafada28eb | |||
| 4ffb5b62ea | |||
| f73395122c | |||
| 0a13633411 | |||
| 76e403cf25 | |||
| fe42933ac5 | |||
| 9d4f01626c | |||
| d974d4c6ce | |||
| ba703157cf | |||
| 8bd2720c28 | |||
| 7e46766c8d | |||
| 9ef5373776 | |||
| abd7d63b74 | |||
| 6769ee3748 | |||
| 0fda243a05 | |||
| 70dfae31a2 | |||
| 048ddbf9ee | |||
| 2a6527e751 | |||
| 26228e6b4d | |||
| f3aab47f94 | |||
| f224d740a3 | |||
| 700f7a275f | |||
| e319340253 | |||
| 6508bbcef5 | |||
| 9bf8b496d6 | |||
| d4120dd2fe | |||
| 8c849a48cc | |||
| 654d0c29ad | |||
| 8d0b3dad5c | |||
| 90eb529bc4 | |||
| 6506c19ac3 | |||
| 30a60d396b | |||
| d134ec54c5 | |||
| ca7640e10f | |||
| 288e6f9c07 | |||
| 70b883cfeb | |||
| ea525d5685 | |||
| 1b40528e1a | |||
| 824465ea27 | |||
| 4a33014edc | |||
| 57676cf64d | |||
| 114674c3d9 | |||
| c05595e482 | |||
| d4d7ab0620 | |||
| c74206e4de | |||
| 96d5cbd036 | |||
| d0c4a92b4c | |||
| d7409604b5 | |||
| 29dbeb253c | |||
| 5a497077f1 | |||
| 6bf6d1dc6b | |||
| 56e832ee43 | |||
| 601096f360 | |||
| aa09febf79 | |||
| 8aca1934ff | |||
| 8a0b93bc4d | |||
| 8b1fe8f6e0 | |||
| 7243eda2ff | |||
| 3f7cc45686 | |||
| 84b8a2fb05 | |||
| c93e2ff81d | |||
| 0cdfd72529 | |||
| 70ce2bbb9e | |||
| 464972855e | |||
| 58ca013b90 | |||
| 869ea22f34 | |||
| 8ef8088686 | |||
| c5e9bbe4f3 | |||
| 33fb253a66 | |||
| 51ceabb2eb | |||
| b1a5c76215 | |||
| 9612397aa2 | |||
| 04f720d56a | |||
| b8f35aa109 | |||
| a1e96a7deb | |||
| fcc7d8dd4e | |||
| 7df3141bbc | |||
| 57ccf14952 | |||
| 13ecd5bb25 | |||
| a703b9ed84 | |||
| e4a80aee09 | |||
| 26551f178c | |||
| 32772a5436 | |||
| 7c96857c02 | |||
| 15b8a8d935 | |||
| e0cb01e2cf | |||
| 935067ee05 | |||
| d513fb4c8e | |||
| 596b8a5d06 | |||
| 6f267be6f1 | |||
| 76b40a37e7 | |||
| a77275e650 | |||
| 40c71a2463 | |||
| 5ef548a985 | |||
| f38a61c66d | |||
| 3f92bcc11a | |||
| b2135be594 | |||
| 6193e403e7 | |||
| 32da0705cf | |||
| ba1a48c2ce | |||
| 821f17d666 | |||
| 0e1ef8f8e1 | |||
| 96a27f4266 | |||
| 26ac5a3bdc | |||
| cf93a05d2d | |||
| 90ccd2f37c | |||
| a4b4432015 | |||
| 365323afec | |||
| 99f709ca96 | |||
| 3fc02353be | |||
| ca79f75b32 | |||
| 987bb2ca61 | |||
| 960bb540ec | |||
| b9d6fc9dad | |||
| 1031b7f4bc | |||
| 406313bbc5 | |||
| cadb4dee14 | |||
| d2c64b566b | |||
| c5069266dc | |||
| d6ba235655 | |||
| 63775320ae | |||
| b584c23061 | |||
| ba934ff1ce | |||
| b811420d28 | |||
| b231e91d87 | |||
| 977d2c4330 | |||
| 3f4004ae45 | |||
| 03fe1cb7fc | |||
| 4dadf17bd9 | |||
| 6d5ac67681 | |||
| 1275248f39 | |||
| d3cf0d2c06 | |||
| 5ef7325874 | |||
| 5a6b23e8f3 | |||
| e90438fe3c | |||
| f7d5b39ec9 | |||
| eec9fa9d5e | |||
| 4d3989817c | |||
| 59864a3bbc | |||
| f9f160404a | |||
| ebaefbb745 | |||
| 47c5ee5d9c | |||
| 77d4e3e8d2 | |||
| a0c3bb70a9 | |||
| 2693ed9b22 | |||
| 4a7ca5a291 | |||
| 7295983964 | |||
| 39a6889767 | |||
| 0db4fb1835 | |||
| ac425f67e4 | |||
| a2125594ea | |||
| 416c693b3f | |||
| 321c74ccd6 | |||
| 6158bd2afa | |||
| d2911a8d41 | |||
| 2ee00e7f7d | |||
| ad092bf1ce | |||
| 557990fdcf | |||
| a66a1a24d7 | |||
| 099f4f9e7c | |||
| 8bac8b513c | |||
| 781f4d439e | |||
| a8a71eb200 | |||
| 61f589ddd0 | |||
| c6de84d868 | |||
| 228af2d617 | |||
| 002904e445 | |||
| e0f8bb83a6 | |||
| 12fdaf895e | |||
| c12e26ff28 | |||
| 0d2bc7b5fd | |||
| e4e0bb533d | |||
| f5e01f7b49 | |||
| c9fcc12e3b | |||
| 4ea8526e9f | |||
| 5ccb2a4cbd | |||
| c3b838b738 | |||
| 054c796213 | |||
| 245c256b1c | |||
| 6aa07cdc7e | |||
| 894ad33bf4 | |||
| 34f6b05467 | |||
| 32c6e58bdb | |||
| 8bcd7e122a | |||
| 3c086fb2fe | |||
| 32b6ebb670 | |||
| 4997a6bf06 | |||
| 1e9e2aa95c | |||
| b9399a5df8 | |||
| eedbd1ad59 | |||
| 7589225fc0 | |||
| 39a975cb29 | |||
| 594a95839c | |||
| 3998b41d68 | |||
| 57fae4a6a1 | |||
| 3200fe0e53 | |||
| 82e5b961d3 | |||
| e00b0f6f47 | |||
| 6dfe2ddc21 | |||
| fee87c5fdb | |||
| 07fe1cd6b8 | |||
| ac14cee71c | |||
| f795878d1a | |||
| bc95c609ff | |||
| ca022fdb4c | |||
| 206b546e5a | |||
| 2370079220 | |||
| 02936dcf86 | |||
| ff877af2af | |||
| 9a24886282 | |||
| 350532ea2c | |||
| 3b8701e97e | |||
| a37201abee | |||
| e3e8a58799 | |||
| 275579a835 | |||
| db6a6ccaba | |||
| 69560588fe | |||
| edf2cbd5f7 | |||
| b00e19a8da | |||
| 6dea8309c5 | |||
| 9befb7a1d7 | |||
| 44836c7f78 | |||
| 97681d0607 | |||
| 3e4a195b61 | |||
| 915427621f | |||
| e9a2e665b2 | |||
| 25d62cc929 | |||
| 93ef27aeba | |||
| a04ab2298b | |||
| 43e457c883 | |||
| bc79f477dd | |||
| e3aa96ccf2 | |||
| 0a45b8c478 | |||
| 75f4c1abf2 | |||
| e10c01047c | |||
| 8937e8756e | |||
| a743de0e24 | |||
| c531e275cc | |||
| e59c6caee5 | |||
| 54fc60eb37 | |||
| 031e57b359 | |||
| 96a2f80bf2 | |||
| f2f600f807 | |||
| 24790e4061 | |||
| c251915198 | |||
| 4112866821 | |||
| 5b521bb778 | |||
| 3cfd8cc1fe | |||
| 411ca87a86 | |||
| 2172544bb7 | |||
| df7049d465 | |||
| 01a41d86bc | |||
| 0a461e7922 | |||
| daa308f81c | |||
| 333e51b217 | |||
| 8fd87033ef | |||
| 44d146af9a | |||
| f3e9eb3371 | |||
| 63e4b35c19 | |||
| e8a703a71d | |||
| 9b9e04a061 | |||
| 4a6888ccf6 | |||
| e755c66418 | |||
| e8ff5cac1d | |||
| d17d3b66aa | |||
| 5620306c70 | |||
| e8283f94ed | |||
| 894f208de3 | |||
| f8c96cb18a | |||
| e72f451173 | |||
| 5c63be3c6e | |||
| e21f89a16d | |||
| 16294437d5 | |||
| d75a089690 | |||
| 4b205680df | |||
| 779f59da6b | |||
| f5ddaef46b | |||
| aa6c66aa54 | |||
| 6b32bd5f15 | |||
| 31a22c27fe | |||
| 0ae053fdf8 | |||
| d8c5bd92ae | |||
| 2a67375239 | |||
| 5ac55fc132 | |||
| 13a782c039 | |||
| 8ab6efb8c0 | |||
| ab24325df3 | |||
| 681e0323f2 | |||
| baf372ad3d | |||
| 95d9cfb5c3 | |||
| 264679a725 | |||
| bb7dc5f992 | |||
| 1f519eea89 | |||
| b8c080de12 | |||
| b6e41ebf27 | |||
| ba0ed79635 | |||
| 8ca4252303 | |||
| b909df5531 | |||
| 3697ebef47 | |||
| 549c53121a | |||
| dfdc91f8c9 | |||
| eba696a41e | |||
| 54a14c877c | |||
| fc0498b5bd | |||
| a29e59a770 | |||
| f9eab2de5e | |||
| e9ed7eb68d | |||
| 3f5c85e933 | |||
| 6aab6a251c | |||
| 1c661e7548 | |||
| a457fbdb58 | |||
| d2aadabc5e | |||
| f8791f072d | |||
| db7f689728 | |||
| b3e6c97d98 | |||
| 10d61a2b44 | |||
| 878af7ada8 | |||
| d2f9cfcf81 | |||
| 52644f067e | |||
| 417ac94456 | |||
| 02bfd20760 | |||
| 6d916c5bb4 | |||
| 1e9ad5476d | |||
| 5e80191d27 | |||
| 058367f34c | |||
| 254f88f805 | |||
| 60fb1fde75 | |||
| 00367289bd | |||
| a9769b9202 | |||
| 6d62be55b3 | |||
| 002925466b | |||
| 8fae361768 | |||
| 65919ed839 | |||
| cdee3d33b4 | |||
| f5ca9d3fe1 | |||
| 4a8fd71a2e | |||
| 1e6e18ff05 | |||
| 5c05b7bc01 | |||
| a51d46cbf9 | |||
| c6deba6003 | |||
| 08019732e2 | |||
| aab9ef4290 | |||
| 03382d29cc | |||
| 3833d86f0f | |||
| 94ec0e9b74 | |||
| e8e020ffb7 | |||
| e9b8571afc | |||
| 51631b90af | |||
| a2445c44cb | |||
| 5c56b8ce92 | |||
| 1aca1d582e | |||
| 3efd2df87f | |||
| f1fb002682 | |||
| d5a0d6783a | |||
| 5fde16ba90 | |||
| 394bc91e07 | |||
| edb3337ead | |||
| fa96507fe7 | |||
| 1febb12942 | |||
| 9802b4e123 | |||
| e1ef7a2288 | |||
| f768f89803 | |||
| 1f75c67c56 | |||
| f1b6228d4f | |||
| d58f9ae824 | |||
| a38157a1f4 | |||
| f355b3505f | |||
| 3b015dfc7d | |||
| 0ec72cbd10 | |||
| 68e220e7bb | |||
| 143b3d2b5b | |||
| e96c94c4e4 | |||
| 9c0af1f675 | |||
| 3289a0aff9 | |||
| 723165f878 | |||
| 805ab6331f | |||
| 738435b1dd | |||
| d8b42792a6 | |||
| f94253b82b | |||
| 8ea2f59d33 | |||
| d6d4571628 | |||
| 43de95eb19 | |||
| 0ecc2b8c17 | |||
| 52548bde05 | |||
| 29b3f66507 | |||
| 081d9bc73f | |||
| 0d477d7364 | |||
| e0d88cb7a4 | |||
| 571dfa7605 | |||
| ca8a1d2cff | |||
| 38a3c1ce6b | |||
| a3be8d7cd7 | |||
| 483e9f341c | |||
| aaf56c2839 | |||
| 05563f5bc4 | |||
| 61d3222a22 | |||
| a81c0e6db9 | |||
| d73261844e | |||
| b07f951e6b | |||
| 42484f3bcb | |||
| d7c465d49e | |||
| c5204a74c0 | |||
| 4a2544ff4b | |||
| c9b3e718db | |||
| 44d21e5a79 | |||
| 8c698262ea | |||
| 1094ed64e9 | |||
| 791ebd05fc | |||
| 483f28723c | |||
| a550e50683 | |||
| 472f3b7347 | |||
| 898cf70210 | |||
| b958498074 | |||
| 171dd9eff5 | |||
| e07ffe902e | |||
| 9b130efbb3 | |||
| 22701f0c27 | |||
| f0fb91f2d4 | |||
| f9564e053d | |||
| 2acc7c96e7 | |||
| 1810702bf0 | |||
| 96e2126ade | |||
| fb9c083a51 | |||
| dc28a1aba2 | |||
| f3319f6140 | |||
| def8fa2248 | |||
| 2fd1a4eef7 | |||
| fff7b7e459 | |||
| 7ed858e38e | |||
| f629cdfe2c | |||
| 26e426adb1 | |||
| 190467b6c1 | |||
| eb243847eb | |||
| a433394870 | |||
| e90e0ef9aa | |||
| bc4b2d521c | |||
| f0f50b757d | |||
| 33cb9c5ca5 | |||
| 132253c9f3 | |||
| 9340af1a8a | |||
| 447116a93c | |||
| d848594deb | |||
| dbc7faca46 | |||
| b5e2ec4ea4 | |||
| 7b4aefedea | |||
| 30a595789c | |||
| 6ca3c7f59f | |||
| 84fd8190f3 | |||
| 7a55f2af3b | |||
| 88996323b6 | |||
| 8b192b76c0 | |||
| 962d57b4d6 | |||
| 18151e79bb | |||
| a70e1eecd9 | |||
| 3e876c5066 | |||
| 6bff0e24f8 | |||
| 47c45e5bd3 | |||
| 8936a0f3a5 | |||
| 68012bfbf9 | |||
| 9fabc3406f | |||
| e7338024f6 | |||
| 63bb97cc19 | |||
| 1220dd4877 | |||
| 96ab78dc4f | |||
| 3201ea89d6 | |||
| dfa753c6b4 | |||
| 6389dfe49c | |||
| dadb1473c1 | |||
| c3b0a68a2b | |||
| f024425dd0 | |||
| 1b294c013a | |||
| b998c06d08 | |||
| 5ba8aa781c | |||
| 455323ed58 | |||
| eb161942de | |||
| fa8e301c69 | |||
| 55c02ff628 | |||
| 9a81ff7315 | |||
| 5acfa524cb | |||
| 94c7d99d0d | |||
| 471b83ccd5 | |||
| 7bb8d89ef3 | |||
| 6b6222bfbb | |||
| 5a77f4cee3 | |||
| adc1ef9308 | |||
| fc57129300 | |||
| b7ca3d77a6 | |||
| ceff82877d | |||
| 1aff378ae8 | |||
| 163d5e4d39 | |||
| bc9893799d | |||
| 1c092a181d | |||
| a6ed8f268a | |||
| ddfaa41f07 | |||
| 77fa59c3da | |||
| 3bcbd2a078 | |||
| 85ea37ac01 | |||
| dac31e84fb | |||
| 138a80611c | |||
| 2da00161c5 | |||
| 9408c3e640 | |||
| 1c180f4c7f | |||
| cd4926778e | |||
| 38c0278be3 | |||
| ffd4a27901 | |||
| 683acd9ae2 | |||
| 643d9df42d | |||
| 84847cf4c3 | |||
| 61b928d9bd | |||
| e8a626d43a | |||
| 025f679dbc | |||
| afb157df67 | |||
| 82be2d6210 | |||
| b95fdc1992 | |||
| d17699363c | |||
| 90c34c5c17 | |||
| 0023d8a106 | |||
| 4f6be11c0e | |||
| a164a131f9 | |||
| 0431ecb9e2 | |||
| 18d10d6b86 | |||
| cd879bedb4 | |||
| 45ced8e022 | |||
| 520e351489 | |||
| 2f7fc1a598 | |||
| ec39f0dc9e | |||
| e98222dfb3 | |||
| 3b3347857f | |||
| 7d2190a5d4 | |||
| c1981f28ad | |||
| 8eb685de9d | |||
| 9bfaf4fe40 | |||
| de4be8e610 | |||
| 0bbd28e0d4 | |||
| 8fac166b66 | |||
| 5c404bb142 | |||
| 9b635830bc | |||
| 319e891d7d | |||
| 4a54aa3fbd | |||
| 3f9343e238 | |||
| f7856a0f35 | |||
| 5c0a98cfb6 | |||
| 269c28e69e | |||
| a5c92c2029 | |||
| 3abae3c511 | |||
| 2e4d771005 | |||
| 4f764b812e | |||
| f7b6e30156 | |||
| 9dccfe2a96 | |||
| 2b84039a16 | |||
| 96610c7ee1 | |||
| 52f16e0f55 | |||
| dedd966002 | |||
| 6d3ae8d4ca | |||
| c667de9b68 | |||
| 621e3eaed8 | |||
| 3ef046b6c9 | |||
| 74d5cdb6d8 | |||
| ebe13a9613 | |||
| 7c1d9fea8b | |||
| 59e4f85898 | |||
| a304069687 | |||
| 62d079fa69 | |||
| 3902694075 | |||
| 00861b668a | |||
| 0d747daf47 | |||
| 78384d8923 | |||
| c9a76ede94 | |||
| 246733382f | |||
| d1387b25eb | |||
| 86561fef90 | |||
| 64fd1c95a5 | |||
| ef16e4203e | |||
| 92cbec6fb1 | |||
| 0cfd95c097 | |||
| 169dc9c311 | |||
| 60a841c797 | |||
| a246d8d8e9 | |||
| 64629cb94e | |||
| 9515137cb2 | |||
| 5f500692f1 | |||
| 227ec19929 | |||
| a2bbfa1db5 | |||
| a9ddf12187 | |||
| 39630e076a | |||
| 7621b91769 | |||
| c8056b3e27 | |||
| a0a1fb5fec | |||
| 7ce2397b62 | |||
| e0841f3d6e | |||
| b38de57f9a | |||
| dad2247b56 | |||
| 33b765d797 | |||
| 4368f04afa | |||
| b5961cc5d1 | |||
| 28925572f6 | |||
| 0c490accae | |||
| 1b5a9c9718 | |||
| bd43e4f28b | |||
| ec41a4897a | |||
| 1fb93b62c0 | |||
| d38869eb76 | |||
| ab21dc6d47 | |||
| aa167434e6 | |||
| ba5ddd6499 | |||
| d8b8c3b145 | |||
| ba6c2df15d | |||
| c300070b8a | |||
| 4bb6edf176 | |||
| cafa010389 | |||
| 8bc8a94645 | |||
| 8483801eab | |||
| d4a96b699e | |||
| 4fa4bef41d | |||
| c4ec46c195 | |||
| 69ff7a76d6 | |||
| 3ca6a72457 | |||
| 7d2118e324 | |||
| 97548b01c7 | |||
| e3286c9055 | |||
| df1f62b34c | |||
| 2f288f94e5 | |||
| 2a2d195240 | |||
| 07655c2b4d | |||
| a34c02a001 | |||
| 341e2fa72d | |||
| 21f0146402 | |||
| 45169577ca | |||
| 2ece029fe0 | |||
| 06193f28ef | |||
| 144b1f4d9d | |||
| bda90dae77 | |||
| 1e583942b9 | |||
| 6894651027 | |||
| 6dfb6a3016 | |||
| 4b91dfd215 | |||
| ccb89a889a | |||
| 06a4c20f60 | |||
| fcb07c64f3 | |||
| 6316b3ed91 | |||
| de22442046 | |||
| 10ce935823 | |||
| 7d3d6bc4e2 | |||
| 982e6fc721 | |||
| 3cd6e3b304 | |||
| 1fb8dcb0de | |||
| 428ff431df | |||
| 8ce7d9a4d1 | |||
| e8c20bfae6 | |||
| d6b82dcd65 | |||
| 5368a4ac41 | |||
| 9cfd219d70 | |||
| 9340fc0c50 | |||
| f738e490a3 | |||
| 55366caecd | |||
| 212420516f | |||
| 3bcff7f941 | |||
| 6686559c70 | |||
| cedd78d526 | |||
| c443a3d657 | |||
| 5f88bbe3d5 | |||
| 41da3ef1d2 | |||
| 714b38360f | |||
| 097fc1a271 | |||
| 2bd0844be3 | |||
| 0fe17eeb68 | |||
| b82ecaf48c | |||
| 65fc863d86 | |||
| 9cef78b685 | |||
| 865bd7abff | |||
| 49f43b03b1 | |||
| 58835eeb78 | |||
| 0df607e5dd | |||
| ea68f7ea1e | |||
| e09a464242 | |||
| 4e60db9030 | |||
| 74e3403620 | |||
| a8e635f177 | |||
| 04fad57fc1 | |||
| f41359688b | |||
| 6c862fae13 | |||
| ce1432e42d | |||
| 93a402d0f2 | |||
| f4c2c4412b | |||
| 4fe2d9bdbc | |||
| d43597c199 | |||
| 5451b89aed | |||
| fdf6323942 | |||
| 032e458085 | |||
| a7c4ee9ae1 | |||
| ec25689b42 | |||
| 4fac12c8d3 | |||
| cae1859324 | |||
| 352f4fead6 | |||
| 2c3f02c83f | |||
| 19e8121a38 | |||
| 69fd8964a2 | |||
| ccbc16f3a9 | |||
| ec469b5530 | |||
| 8b52eabd48 | |||
| d4b9e2d0f4 | |||
| 470dfba96c | |||
| 43c68d1864 | |||
| 40dd96e83a | |||
| 73bf170800 | |||
| 990afa9032 | |||
| c03a936cfc | |||
| e4a4f93b72 | |||
| f1a99995c4 | |||
| 872e7894b4 | |||
| de8eda5fdf | |||
| 8158e5b7a0 | |||
| f4b6ae46d1 | |||
| cdf6e460e8 | |||
| be1ae9d4a6 | |||
| 9cca066ee8 | |||
| 8c8715c4dd | |||
| 915c3fd7fa | |||
| a54affeb8d | |||
| 18ab85efc2 | |||
| e0b664f390 | |||
| bd1342c164 | |||
| ea9a17ebc2 | |||
| 61eb1a6848 | |||
| 2143f7cee1 | |||
| 80e5642ca2 | |||
| af0a83f0b3 | |||
| f3074fd559 | |||
| 2c07c6718f | |||
| 5a01227aa1 | |||
| ce3c92eb1f | |||
| b99c9145bf | |||
| 6ec08f268f | |||
| 8546ac3ce6 | |||
| 9a8dbfd57f | |||
| 756a98a395 | |||
| 9dc7554089 | |||
| 6eac8f78b9 | |||
| 98e2bb8721 | |||
| 842c58a7d6 | |||
| 7a2dca5947 | |||
| 110e80f0ee | |||
| 11dbd86aa3 | |||
| 40af53b1d6 | |||
| 7e8cc580c9 | |||
| 442fdfd4b2 | |||
| 922cd208f7 | |||
| 8b541e450b | |||
| 39783a6584 | |||
| f26912960f | |||
| db588bb831 | |||
| b9d2e6664d | |||
| a43337c28e | |||
| eb9001665e | |||
| fcfb29766b | |||
| d8b58205be | |||
| 796b0fec7d | |||
| d5a2fe5180 | |||
| 74574dfae4 | |||
| d2f70f61aa | |||
| 3182cc4277 | |||
| 3b43f90cc8 | |||
| b9a6a96324 | |||
| 7bcfe8f204 | |||
| 99b39aa5bd | |||
| bbf39b0964 | |||
| 7366eebebb | |||
| e36a3acbc0 | |||
| 89c106b29e | |||
| 35edad3e74 | |||
| 98f89f9079 | |||
| 8ee1be7d09 | |||
| 45c4d3a62b | |||
| 93dab9e1e9 | |||
| 480c6dae6d | |||
| 3132c8ee08 | |||
| 3d1dbd2ccd | |||
| 5a2faab2e6 | |||
| 6e9b6a27cf | |||
| 80d37ba698 | |||
| 0a98bc0ee9 | |||
| 47b6955ba0 | |||
| 030e955db7 | |||
| f5b58e5fc9 | |||
| f0179f96a7 | |||
| 3ba49ccecc | |||
| d034ef6f27 | |||
| 7d24727184 | |||
| 5478165e16 | |||
| a9f67c2d1d | |||
| ed8f0ab265 | |||
| 20afae5a14 | |||
| caa013b2a4 | |||
| 9548093b46 | |||
| 5fd47352cf | |||
| f1f0f630c7 | |||
| dd696066b5 | |||
| 1bf1694506 | |||
| 865c29a754 | |||
| 8c1e0537ec | |||
| d5a3ad5b64 | |||
| 30cf5e0164 | |||
| 5421d0866b | |||
| 225bdc21c0 | |||
| a065c10bcb | |||
| 98d8436440 | |||
| 4cf321f3f8 | |||
| 0aa0f2ada2 | |||
| f6d3adcf3d | |||
| e11213dcef | |||
| fe7c93cc05 | |||
| 2b6be3cb0f | |||
| fd49ee5f39 | |||
| 93a36b0df1 | |||
| 4e12febe90 | |||
| 6eabe6bc14 | |||
| 3bc9912f6e | |||
| 4c94804bb0 | |||
| 682e03bdb2 | |||
| ca4fd1e427 | |||
| 91d152e2c2 | |||
| 1d8b30bf4f | |||
| 0311770e8b | |||
| 82cd2f8c93 | |||
| 20400aa9f7 | |||
| 4cbd09c41c | |||
| 4ebb617000 | |||
| 0e70363f4a | |||
| 7baa5efbe4 | |||
| ed710eaa1c | |||
| bfd663c281 | |||
| 5c7fe0fe05 | |||
| 1db5d82b7f | |||
| 3064e40d9e | |||
| 334c4d62b5 | |||
| 715f881dda | |||
| 507f8add1c | |||
| 8cedc052ca | |||
| 6e34d2778f | |||
| dc84cf9914 | |||
| 4b82c8a22b | |||
| 7af7bcae18 | |||
| 93cea6e46e | |||
| 7c72e095fa | |||
| aebb66682b | |||
| ca5976e3d4 | |||
| 9e94212eac | |||
| 3bba5b5a31 | |||
| 9b71f5fd54 | |||
| 428720f490 | |||
| 3c92d40f6e | |||
| cd66f6e3db | |||
| 1a961660d8 | |||
| 9d3d5e9d65 | |||
| fbde57dba8 | |||
| dcee7b1605 | |||
| b769ad2c23 | |||
| 3c70d966cb | |||
| d9b573795b | |||
| 3aaf8dfd11 | |||
| e3633ec4a2 | |||
| 0b49680339 | |||
| 439e43a027 | |||
| af8a3a0b66 | |||
| 183c0fcab1 | |||
| bd00471a89 | |||
| ff1ec6ccc6 | |||
| 86136c0ccc | |||
| 087d9745b3 | |||
| b40a7ffbe4 | |||
| 094615b2c5 | |||
| c88e6b344b | |||
| 6e88bff3e3 | |||
| 5aceac6b93 | |||
| b12e1acdec | |||
| 21eb60f88b | |||
| b1caa4f4d5 | |||
| 9e7014b59f | |||
| a1f4e65d03 | |||
| f3d62c94b1 | |||
| 2e28ff78c1 | |||
| 1606137df2 | |||
| 0711dab09d | |||
| 5f57842575 | |||
| 4e16ec2826 | |||
| 5d9c6723ee | |||
| 6b4becfd03 | |||
| c8777da2d6 | |||
| b17c1c6721 | |||
| f8786c9bf4 | |||
| f0ef4b2246 | |||
| d32d576d6d | |||
| 39b90ae9fb | |||
| 757d8ac8f7 | |||
| 5e2a81dc26 | |||
| 52050ebe32 | |||
| 33d477e049 | |||
| c4abdb8050 | |||
| 0af9e19be7 | |||
| b6a0acb8f6 | |||
| 5527c41468 | |||
| 1629e29b98 | |||
| 3091d10b00 | |||
| 8f7e92e466 | |||
| d7b1f28a90 | |||
| 4e679e1cc5 | |||
| d2174e2e75 | |||
| 87f651c119 | |||
| 07c10d6fc3 | |||
| 66d9a33b50 | |||
| 9cbdb48d6d | |||
| b068d26fad | |||
| fb8e652c3f | |||
| bbedebb57c | |||
| f67b197d49 | |||
| 6ad3bf3130 | |||
| bc4e471847 | |||
| a63f66c90e | |||
| eab6744ac7 | |||
| f46cd9dbf5 | |||
| 37a5af3673 | |||
| b19bb95d66 | |||
| 8ecc5e6f64 | |||
| 554eae56d1 | |||
| 4e66d078d2 | |||
| a42bbc9722 | |||
| fe33ce02af | |||
| 9362639437 | |||
| 418898029c | |||
| c918ac298c | |||
| 252fd63194 | |||
| 2f5af1bd33 | |||
| cca2c4b314 | |||
| 4501a2cdea | |||
| eb00dce78e | |||
| 268d73165e | |||
| 5916ebf500 | |||
| ac262f5b5d | |||
| d998e70a25 | |||
| 3585522b24 | |||
| 02e9636f1b | |||
| 3c3c5ef2b6 | |||
| ff775b2e54 | |||
| 4f668e1023 | |||
| ed2e1af3e8 | |||
| 266725a378 | |||
| 9be8ab06ed | |||
| 190ad749e4 | |||
| 97c3bcb1b7 | |||
| 9c4eb20221 | |||
| dcdbaef348 | |||
| 20d82cf6d5 | |||
| 970293a229 | |||
| 74ba4b7ae2 | |||
| a84e11451b | |||
| 3478240de9 | |||
| 0395b2ea9c | |||
| 3812ae7949 | |||
| 400fd5c3ec | |||
| 67e6a6077d | |||
| a84bbc62b1 | |||
| dc5e69b4d4 | |||
| 78f80c35d2 | |||
| 3721c8bb06 | |||
| b9496f8d9d | |||
| bbc6b95c02 | |||
| f0ddf302b2 | |||
| 6596eab66c | |||
| 9205ad6990 | |||
| 49de982ee7 | |||
| ca00c1dce2 | |||
| 133eb8d13a | |||
| dcdb3b36ef | |||
| a202dc9a90 | |||
| 0e9c90a0d9 | |||
| 0165ffa90d | |||
| 794c14b29a | |||
| 012e43de4b | |||
| 36dfb71c60 | |||
| 4366c8734f | |||
| 4ced27e149 | |||
| e48682a9f7 | |||
| 6e39856623 | |||
| 6bd5d7f037 | |||
| ea882d58c6 | |||
| 78bd55c8df | |||
| 4ae5df5509 | |||
| 7812a805ad | |||
| 82c77fa244 | |||
| 054bd23a43 | |||
| 3bbe5d3956 | |||
| fd674b85bb | |||
| facd5988ce | |||
| b11566bfc7 | |||
| e5e1ba3c97 | |||
| ebe14fa4ac | |||
| 3da8b4ccad | |||
| e986ff46f7 | |||
| 62199df815 | |||
| 9cc12ff0ac | |||
| d0504c95f4 | |||
| e8ac3ea9ea | |||
| 4b4874e67a | |||
| 7d0d6cd5ee | |||
| d745af6763 | |||
| 71aee662bd | |||
| 14d943f588 | |||
| 5f2fed0e25 | |||
| caa3633cbf | |||
| deb8ba2237 | |||
| 7d69289092 | |||
| c9dfcc4de8 | |||
| beba82b22b | |||
| cd169941f2 | |||
| c8f59bf1e0 | |||
| ff8c53ea20 | |||
| 148aee31e4 | |||
| a208c3bf04 | |||
| d9089741bc | |||
| 7beb24553a | |||
| d4917a5bd3 | |||
| ffc9aa050d | |||
| c0e11bb50e | |||
| f35e043cf9 |
Vendored
+2
@@ -1127,6 +1127,7 @@ inline int TEGRA_FILTERINIT(cvhalFilter2D **context, uchar *kernel_data, size_t
|
|||||||
{
|
{
|
||||||
std::memcpy(ctx->kernel_data + kernel_width * j, kernel_data + kernel_step * j, kernel_width * sizeof(int16_t));
|
std::memcpy(ctx->kernel_data + kernel_width * j, kernel_data + kernel_step * j, kernel_width * sizeof(int16_t));
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
delete[] ctx->kernel_data;
|
delete[] ctx->kernel_data;
|
||||||
delete ctx;
|
delete ctx;
|
||||||
@@ -1243,6 +1244,7 @@ inline int TEGRA_SEPFILTERINIT(cvhalFilter2D **context, int src_type, int dst_ty
|
|||||||
ctx->kernely_data[0]=((int16_t*)kernely_data)[0];
|
ctx->kernely_data[0]=((int16_t*)kernely_data)[0];
|
||||||
ctx->kernely_data[1]=((int16_t*)kernely_data)[1];
|
ctx->kernely_data[1]=((int16_t*)kernely_data)[1];
|
||||||
ctx->kernely_data[2]=((int16_t*)kernely_data)[2];
|
ctx->kernely_data[2]=((int16_t*)kernely_data)[2];
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
delete ctx;
|
delete ctx;
|
||||||
return CV_HAL_ERROR_NOT_IMPLEMENTED;
|
return CV_HAL_ERROR_NOT_IMPLEMENTED;
|
||||||
|
|||||||
Vendored
+1
@@ -109,6 +109,7 @@ bool isResizeLinearOpenCVSupported(const Size2D &ssize, const Size2D &dsize, u32
|
|||||||
&& dsize.width >= 2 && dsize.height >= 8
|
&& dsize.width >= 2 && dsize.height >= 8
|
||||||
&& (2*dsize.width != ssize.width || 2*dsize.height != ssize.height)) // 2x downscaling is performed as area in OpenCV which differs from this implementation
|
&& (2*dsize.width != ssize.width || 2*dsize.height != ssize.height)) // 2x downscaling is performed as area in OpenCV which differs from this implementation
|
||||||
return isSupportedConfiguration();
|
return isSupportedConfiguration();
|
||||||
|
return false;
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
|
|||||||
+16
@@ -12,6 +12,22 @@ Write-Output ("=" * 120)
|
|||||||
Write-Output ""
|
Write-Output ""
|
||||||
|
|
||||||
if(![System.IO.File]::Exists($output)) {
|
if(![System.IO.File]::Exists($output)) {
|
||||||
|
try {
|
||||||
|
[io.file]::OpenWrite($output).close()
|
||||||
|
} catch {
|
||||||
|
Write-Warning "Unable to write: $output"
|
||||||
|
if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) {
|
||||||
|
Write-Warning "Launching with 'Administrator' elevated privileges..."
|
||||||
|
Pause
|
||||||
|
Start-Process powershell.exe "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`"" -Verb RunAs
|
||||||
|
exit
|
||||||
|
} else {
|
||||||
|
Write-Output "FATAL: Unable to write with elevated privileges: $output"
|
||||||
|
Pause
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Write-Output ("Downloading: " + $output)
|
Write-Output ("Downloading: " + $output)
|
||||||
Import-Module BitsTransfer
|
Import-Module BitsTransfer
|
||||||
|
|||||||
Vendored
+5
-5
@@ -1,8 +1,8 @@
|
|||||||
# Binaries branch name: ffmpeg/3.4_20181103
|
# Binaries branch name: ffmpeg/3.4_20190905
|
||||||
# Binaries were created for OpenCV: c6d2f0399a706028f476f3d08358ea787503020d
|
# Binaries were created for OpenCV: fafada28ebc0f2e5423a7d8ece425574ef01ff60
|
||||||
ocv_update(FFMPEG_BINARIES_COMMIT "fe71c0ad807fdc33c2178e48e488f1e9b177c39a")
|
ocv_update(FFMPEG_BINARIES_COMMIT "bf1730f4c4ba1996bed1fe268b52e4e942151cd6")
|
||||||
ocv_update(FFMPEG_FILE_HASH_BIN32 "41b81bb9a50cabd4bea385f7b50a069a")
|
ocv_update(FFMPEG_FILE_HASH_BIN32 "6899624f88cb4cbb1604edc5e12b18ab")
|
||||||
ocv_update(FFMPEG_FILE_HASH_BIN64 "a9ea7dbbc8e5afd08e00e223a831b578")
|
ocv_update(FFMPEG_FILE_HASH_BIN64 "4729c052cb0c53ab56e9a0eed91559df")
|
||||||
ocv_update(FFMPEG_FILE_HASH_CMAKE "3b90f67f4b429e77d3da36698cef700c")
|
ocv_update(FFMPEG_FILE_HASH_CMAKE "3b90f67f4b429e77d3da36698cef700c")
|
||||||
|
|
||||||
function(download_win_ffmpeg script_var)
|
function(download_win_ffmpeg script_var)
|
||||||
|
|||||||
+122
@@ -0,0 +1,122 @@
|
|||||||
|
/**********************************************************************************
|
||||||
|
* Copyright (c) 2008-2009 The Khronos Group Inc.
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
|
* copy of this software and/or associated documentation files (the
|
||||||
|
* "Materials"), to deal in the Materials without restriction, including
|
||||||
|
* without limitation the rights to use, copy, modify, merge, publish,
|
||||||
|
* distribute, sublicense, and/or sell copies of the Materials, and to
|
||||||
|
* permit persons to whom the Materials are furnished to do so, subject to
|
||||||
|
* the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included
|
||||||
|
* in all copies or substantial portions of the Materials.
|
||||||
|
*
|
||||||
|
* THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||||
|
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||||
|
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||||
|
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||||
|
* MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
|
||||||
|
**********************************************************************************/
|
||||||
|
|
||||||
|
#ifndef __OPENCL_CL_D3D11_EXT_H
|
||||||
|
#define __OPENCL_CL_D3D11_EXT_H
|
||||||
|
|
||||||
|
#include <d3d11.h>
|
||||||
|
#include <CL/cl.h>
|
||||||
|
#include <CL/cl_platform.h>
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/******************************************************************************
|
||||||
|
* cl_nv_d3d11_sharing */
|
||||||
|
|
||||||
|
typedef cl_uint cl_d3d11_device_source_nv;
|
||||||
|
typedef cl_uint cl_d3d11_device_set_nv;
|
||||||
|
|
||||||
|
/******************************************************************************/
|
||||||
|
|
||||||
|
// Error Codes
|
||||||
|
#define CL_INVALID_D3D11_DEVICE_NV -1006
|
||||||
|
#define CL_INVALID_D3D11_RESOURCE_NV -1007
|
||||||
|
#define CL_D3D11_RESOURCE_ALREADY_ACQUIRED_NV -1008
|
||||||
|
#define CL_D3D11_RESOURCE_NOT_ACQUIRED_NV -1009
|
||||||
|
|
||||||
|
// cl_d3d11_device_source_nv
|
||||||
|
#define CL_D3D11_DEVICE_NV 0x4019
|
||||||
|
#define CL_D3D11_DXGI_ADAPTER_NV 0x401A
|
||||||
|
|
||||||
|
// cl_d3d11_device_set_nv
|
||||||
|
#define CL_PREFERRED_DEVICES_FOR_D3D11_NV 0x401B
|
||||||
|
#define CL_ALL_DEVICES_FOR_D3D11_NV 0x401C
|
||||||
|
|
||||||
|
// cl_context_info
|
||||||
|
#define CL_CONTEXT_D3D11_DEVICE_NV 0x401D
|
||||||
|
|
||||||
|
// cl_mem_info
|
||||||
|
#define CL_MEM_D3D11_RESOURCE_NV 0x401E
|
||||||
|
|
||||||
|
// cl_image_info
|
||||||
|
#define CL_IMAGE_D3D11_SUBRESOURCE_NV 0x401F
|
||||||
|
|
||||||
|
// cl_command_type
|
||||||
|
#define CL_COMMAND_ACQUIRE_D3D11_OBJECTS_NV 0x4020
|
||||||
|
#define CL_COMMAND_RELEASE_D3D11_OBJECTS_NV 0x4021
|
||||||
|
|
||||||
|
/******************************************************************************/
|
||||||
|
|
||||||
|
typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetDeviceIDsFromD3D11NV_fn)(
|
||||||
|
cl_platform_id platform,
|
||||||
|
cl_d3d11_device_source_nv d3d_device_source,
|
||||||
|
void * d3d_object,
|
||||||
|
cl_d3d11_device_set_nv d3d_device_set,
|
||||||
|
cl_uint num_entries,
|
||||||
|
cl_device_id * devices,
|
||||||
|
cl_uint * num_devices) CL_API_SUFFIX__VERSION_1_0;
|
||||||
|
|
||||||
|
typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D11BufferNV_fn)(
|
||||||
|
cl_context context,
|
||||||
|
cl_mem_flags flags,
|
||||||
|
ID3D11Buffer * resource,
|
||||||
|
cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0;
|
||||||
|
|
||||||
|
typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D11Texture2DNV_fn)(
|
||||||
|
cl_context context,
|
||||||
|
cl_mem_flags flags,
|
||||||
|
ID3D11Texture2D * resource,
|
||||||
|
UINT subresource,
|
||||||
|
cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0;
|
||||||
|
|
||||||
|
typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D11Texture3DNV_fn)(
|
||||||
|
cl_context context,
|
||||||
|
cl_mem_flags flags,
|
||||||
|
ID3D11Texture3D * resource,
|
||||||
|
UINT subresource,
|
||||||
|
cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0;
|
||||||
|
|
||||||
|
typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueAcquireD3D11ObjectsNV_fn)(
|
||||||
|
cl_command_queue command_queue,
|
||||||
|
cl_uint num_objects,
|
||||||
|
const cl_mem * mem_objects,
|
||||||
|
cl_uint num_events_in_wait_list,
|
||||||
|
const cl_event * event_wait_list,
|
||||||
|
cl_event * event) CL_API_SUFFIX__VERSION_1_0;
|
||||||
|
|
||||||
|
typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueReleaseD3D11ObjectsNV_fn)(
|
||||||
|
cl_command_queue command_queue,
|
||||||
|
cl_uint num_objects,
|
||||||
|
cl_mem * mem_objects,
|
||||||
|
cl_uint num_events_in_wait_list,
|
||||||
|
const cl_event * event_wait_list,
|
||||||
|
cl_event * event) CL_API_SUFFIX__VERSION_1_0;
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif // __OPENCL_CL_D3D11_H
|
||||||
|
|
||||||
+7
-1
@@ -196,6 +196,10 @@
|
|||||||
# define ITT_ARCH_PPC64 5
|
# define ITT_ARCH_PPC64 5
|
||||||
#endif /* ITT_ARCH_PPC64 */
|
#endif /* ITT_ARCH_PPC64 */
|
||||||
|
|
||||||
|
#ifndef ITT_ARCH_AARCH64 /* 64-bit ARM */
|
||||||
|
# define ITT_ARCH_AARCH64 6
|
||||||
|
#endif /* ITT_ARCH_AARCH64 */
|
||||||
|
|
||||||
#ifndef ITT_ARCH
|
#ifndef ITT_ARCH
|
||||||
# if defined _M_IX86 || defined __i386__
|
# if defined _M_IX86 || defined __i386__
|
||||||
# define ITT_ARCH ITT_ARCH_IA32
|
# define ITT_ARCH ITT_ARCH_IA32
|
||||||
@@ -205,6 +209,8 @@
|
|||||||
# define ITT_ARCH ITT_ARCH_IA64
|
# define ITT_ARCH ITT_ARCH_IA64
|
||||||
# elif defined _M_ARM || defined __arm__
|
# elif defined _M_ARM || defined __arm__
|
||||||
# define ITT_ARCH ITT_ARCH_ARM
|
# define ITT_ARCH ITT_ARCH_ARM
|
||||||
|
# elif defined __aarch64__
|
||||||
|
# define ITT_ARCH ITT_ARCH_AARCH64
|
||||||
# elif defined __powerpc64__
|
# elif defined __powerpc64__
|
||||||
# define ITT_ARCH ITT_ARCH_PPC64
|
# define ITT_ARCH ITT_ARCH_PPC64
|
||||||
# endif
|
# endif
|
||||||
@@ -359,7 +365,7 @@ ITT_INLINE long __TBB_machine_fetchadd4(volatile void* ptr, long addend)
|
|||||||
: "memory");
|
: "memory");
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
#elif ITT_ARCH==ITT_ARCH_ARM || ITT_ARCH==ITT_ARCH_PPC64
|
#elif ITT_ARCH==ITT_ARCH_ARM || ITT_ARCH==ITT_ARCH_AARCH64 || ITT_ARCH==ITT_ARCH_PPC64
|
||||||
#define __TBB_machine_fetchadd4(addr, val) __sync_fetch_and_add(addr, val)
|
#define __TBB_machine_fetchadd4(addr, val) __sync_fetch_and_add(addr, val)
|
||||||
#endif /* ITT_ARCH==ITT_ARCH_IA64 */
|
#endif /* ITT_ARCH==ITT_ARCH_IA64 */
|
||||||
#ifndef ITT_SIMPLE_INIT
|
#ifndef ITT_SIMPLE_INIT
|
||||||
|
|||||||
+6
@@ -17,6 +17,12 @@
|
|||||||
#if !defined(JAS_WIN_MSVC_BUILD)
|
#if !defined(JAS_WIN_MSVC_BUILD)
|
||||||
/* A configure-based build is being used. */
|
/* A configure-based build is being used. */
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
// uClibc-ng workaround: https://github.com/opencv/opencv/pull/15279
|
||||||
|
#ifndef L_tmpnam
|
||||||
|
#define L_tmpnam 20
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* Extra debugging support */
|
/* Extra debugging support */
|
||||||
|
|||||||
+39
-12
@@ -2,11 +2,11 @@ project(${JPEG_LIBRARY} C)
|
|||||||
|
|
||||||
ocv_warnings_disable(CMAKE_C_FLAGS -Wunused-parameter -Wsign-compare -Wshorten-64-to-32 -Wimplicit-fallthrough)
|
ocv_warnings_disable(CMAKE_C_FLAGS -Wunused-parameter -Wsign-compare -Wshorten-64-to-32 -Wimplicit-fallthrough)
|
||||||
|
|
||||||
set(VERSION_MAJOR 1)
|
set(VERSION_MAJOR 2)
|
||||||
set(VERSION_MINOR 5)
|
set(VERSION_MINOR 0)
|
||||||
set(VERSION_REVISION 3)
|
set(VERSION_REVISION 2)
|
||||||
set(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REVISION})
|
set(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REVISION})
|
||||||
set(LIBJPEG_TURBO_VERSION_NUMBER 1005003)
|
set(LIBJPEG_TURBO_VERSION_NUMBER 2000002)
|
||||||
|
|
||||||
string(TIMESTAMP BUILD "opencv-${OPENCV_VERSION}-libjpeg-turbo")
|
string(TIMESTAMP BUILD "opencv-${OPENCV_VERSION}-libjpeg-turbo")
|
||||||
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||||
@@ -18,16 +18,38 @@ message(STATUS "libjpeg-turbo: VERSION = ${VERSION}, BUILD = ${BUILD}")
|
|||||||
option(WITH_ARITH_ENC "Include arithmetic encoding support when emulating the libjpeg v6b API/ABI" TRUE)
|
option(WITH_ARITH_ENC "Include arithmetic encoding support when emulating the libjpeg v6b API/ABI" TRUE)
|
||||||
option(WITH_ARITH_DEC "Include arithmetic decoding support when emulating the libjpeg v6b API/ABI" TRUE)
|
option(WITH_ARITH_DEC "Include arithmetic decoding support when emulating the libjpeg v6b API/ABI" TRUE)
|
||||||
|
|
||||||
if(NOT DEFINED SIZEOF_SIZE_T)
|
include(CheckCSourceCompiles)
|
||||||
if(IOS) # Workaround iOS issues
|
include(CheckIncludeFiles)
|
||||||
set(SIZEOF_SIZE_T "${CMAKE_SIZEOF_VOID_P}")
|
|
||||||
message(STATUS "SIZEOF_SIZE_T = ${SIZEOF_SIZE_T}")
|
|
||||||
else()
|
|
||||||
include(CheckTypeSize)
|
include(CheckTypeSize)
|
||||||
CHECK_TYPE_SIZE("size_t" SIZEOF_SIZE_T)
|
|
||||||
|
check_type_size("size_t" SIZEOF_SIZE_T)
|
||||||
|
check_type_size("unsigned long" SIZEOF_UNSIGNED_LONG)
|
||||||
|
|
||||||
|
if(SIZEOF_SIZE_T EQUAL SIZEOF_UNSIGNED_LONG)
|
||||||
|
check_c_source_compiles("int main(int argc, char **argv) { unsigned long a = argc; return __builtin_ctzl(a); }"
|
||||||
|
HAVE_BUILTIN_CTZL)
|
||||||
endif()
|
endif()
|
||||||
|
if(MSVC)
|
||||||
|
check_include_files("intrin.h" HAVE_INTRIN_H)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(UNIX)
|
||||||
|
# Check for headers
|
||||||
|
check_include_files(locale.h HAVE_LOCALE_H)
|
||||||
|
check_include_files(stddef.h HAVE_STDDEF_H)
|
||||||
|
check_include_files(stdlib.h HAVE_STDLIB_H)
|
||||||
|
check_include_files(sys/types.h NEED_SYS_TYPES_H)
|
||||||
|
|
||||||
|
# Other predefines
|
||||||
|
# undef NEED_BSD_STRINGS
|
||||||
|
ocv_update(HAVE_UNSIGNED_CHAR 1)
|
||||||
|
ocv_update(HAVE_UNSIGNED_SHORT 1)
|
||||||
|
# undef INCOMPLETE_TYPES_BROKEN
|
||||||
|
ocv_update(RIGHT_SHIFT_IS_UNSIGNED 0)
|
||||||
|
ocv_update(__CHAR_UNSIGNED__ 0)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
set(BITS_IN_JSAMPLE 8)
|
set(BITS_IN_JSAMPLE 8)
|
||||||
|
|
||||||
if(WITH_ARITH_ENC)
|
if(WITH_ARITH_ENC)
|
||||||
@@ -47,15 +69,20 @@ if(MSVC)
|
|||||||
add_definitions(-W3 -wd4996 -wd4018)
|
add_definitions(-W3 -wd4996 -wd4018)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(WIN32)
|
||||||
|
configure_file(jconfig.h.win.in jconfig.h)
|
||||||
|
else()
|
||||||
configure_file(jconfig.h.in jconfig.h)
|
configure_file(jconfig.h.in jconfig.h)
|
||||||
|
endif()
|
||||||
configure_file(jconfigint.h.in jconfigint.h)
|
configure_file(jconfigint.h.in jconfigint.h)
|
||||||
|
|
||||||
include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/src)
|
include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/src)
|
||||||
|
|
||||||
set(JPEG_SOURCES jcapimin.c jcapistd.c jccoefct.c jccolor.c jcdctmgr.c jchuff.c
|
set(JPEG_SOURCES
|
||||||
|
jcapimin.c jcapistd.c jccoefct.c jccolor.c jcdctmgr.c jchuff.c jcicc.c
|
||||||
jcinit.c jcmainct.c jcmarker.c jcmaster.c jcomapi.c jcparam.c jcphuff.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
|
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
|
jdcoefct.c jdcolor.c jddctmgr.c jdhuff.c jdicc.c jdinput.c jdmainct.c jdmarker.c
|
||||||
jdmaster.c jdmerge.c jdphuff.c jdpostct.c jdsample.c jdtrans.c jerror.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
|
jfdctflt.c jfdctfst.c jfdctint.c jidctflt.c jidctfst.c jidctint.c jidctred.c
|
||||||
jquant1.c jquant2.c jutils.c jmemmgr.c jmemnobs.c)
|
jquant1.c jquant2.c jutils.c jmemmgr.c jmemnobs.c)
|
||||||
|
|||||||
Vendored
+16
-23
@@ -11,9 +11,10 @@ libjpeg-turbo is covered by three compatible BSD-style open source licenses:
|
|||||||
|
|
||||||
- The Modified (3-clause) BSD License, which is listed below
|
- The Modified (3-clause) BSD License, which is listed below
|
||||||
|
|
||||||
This license covers the TurboJPEG API library and associated programs.
|
This license covers the TurboJPEG API library and associated programs, as
|
||||||
|
well as the build system.
|
||||||
|
|
||||||
- The zlib License, which is listed below
|
- The [zlib License](https://opensource.org/licenses/Zlib)
|
||||||
|
|
||||||
This license is a subset of the other two, and it covers the libjpeg-turbo
|
This license is a subset of the other two, and it covers the libjpeg-turbo
|
||||||
SIMD extensions.
|
SIMD extensions.
|
||||||
@@ -65,7 +66,7 @@ best of our understanding.
|
|||||||
|
|
||||||
2. If your binary distribution includes or uses the TurboJPEG API, then
|
2. If your binary distribution includes or uses the TurboJPEG API, then
|
||||||
your product documentation must include the text of the Modified BSD
|
your product documentation must include the text of the Modified BSD
|
||||||
License.
|
License (see below.)
|
||||||
|
|
||||||
**Origin**
|
**Origin**
|
||||||
- Clause 2 of the Modified BSD License
|
- Clause 2 of the Modified BSD License
|
||||||
@@ -90,7 +91,8 @@ best of our understanding.
|
|||||||
The Modified (3-clause) BSD License
|
The Modified (3-clause) BSD License
|
||||||
===================================
|
===================================
|
||||||
|
|
||||||
Copyright (C)\<YEAR\> \<AUTHOR\>. All Rights Reserved.
|
Copyright (C)2009-2019 D. R. Commander. All Rights Reserved.
|
||||||
|
Copyright (C)2015 Viktor Szathmáry. All Rights Reserved.
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without
|
Redistribution and use in source and binary forms, with or without
|
||||||
modification, are permitted provided that the following conditions are met:
|
modification, are permitted provided that the following conditions are met:
|
||||||
@@ -117,23 +119,14 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|||||||
POSSIBILITY OF SUCH DAMAGE.
|
POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
|
|
||||||
The zlib License
|
Why Three Licenses?
|
||||||
================
|
===================
|
||||||
|
|
||||||
Copyright (C) \<YEAR\>, \<AUTHOR\>.
|
The zlib License could have been used instead of the Modified (3-clause) BSD
|
||||||
|
License, and since the IJG License effectively subsumes the distribution
|
||||||
This software is provided 'as-is', without any express or implied
|
conditions of the zlib License, this would have effectively placed
|
||||||
warranty. In no event will the authors be held liable for any damages
|
libjpeg-turbo binary distributions under the IJG License. However, the IJG
|
||||||
arising from the use of this software.
|
License specifically refers to the Independent JPEG Group and does not extend
|
||||||
|
attribution and endorsement protections to other entities. Thus, it was
|
||||||
Permission is granted to anyone to use this software for any purpose,
|
desirable to choose a license that granted us the same protections for new code
|
||||||
including commercial applications, and to alter it and redistribute it
|
that were granted to the IJG for code derived from their software.
|
||||||
freely, subject to the following restrictions:
|
|
||||||
|
|
||||||
1. The origin of this software must not be misrepresented; you must not
|
|
||||||
claim that you wrote the original software. If you use this software
|
|
||||||
in a product, an acknowledgment in the product documentation would be
|
|
||||||
appreciated but is not required.
|
|
||||||
2. Altered source versions must be plainly marked as such, and must not be
|
|
||||||
misrepresented as being the original software.
|
|
||||||
3. This notice may not be removed or altered from any source distribution.
|
|
||||||
|
|||||||
Vendored
+24
-26
@@ -43,7 +43,7 @@ User documentation:
|
|||||||
change.log Version-to-version change highlights.
|
change.log Version-to-version change highlights.
|
||||||
Programmer and internal documentation:
|
Programmer and internal documentation:
|
||||||
libjpeg.txt How to use the JPEG library in your own programs.
|
libjpeg.txt How to use the JPEG library in your own programs.
|
||||||
example.c Sample code for calling the JPEG library.
|
example.txt Sample code for calling the JPEG library.
|
||||||
structure.txt Overview of the JPEG library's internal structure.
|
structure.txt Overview of the JPEG library's internal structure.
|
||||||
coderules.txt Coding style rules --- please read if you contribute code.
|
coderules.txt Coding style rules --- please read if you contribute code.
|
||||||
|
|
||||||
@@ -159,12 +159,6 @@ commercial products, provided that all warranty or liability claims are
|
|||||||
assumed by the product vendor.
|
assumed by the product vendor.
|
||||||
|
|
||||||
|
|
||||||
The Unix configuration script "configure" was produced with GNU Autoconf.
|
|
||||||
It is copyright by the Free Software Foundation but is freely distributable.
|
|
||||||
The same holds for its supporting scripts (config.guess, config.sub,
|
|
||||||
ltmain.sh). Another support script, install-sh, is copyright by X Consortium
|
|
||||||
but is also freely distributable.
|
|
||||||
|
|
||||||
The IJG distribution formerly included code to read and write GIF files.
|
The IJG distribution formerly included code to read and write GIF files.
|
||||||
To avoid entanglement with the Unisys LZW patent (now expired), GIF reading
|
To avoid entanglement with the Unisys LZW patent (now expired), GIF reading
|
||||||
support has been removed altogether, and the GIF writer has been simplified
|
support has been removed altogether, and the GIF writer has been simplified
|
||||||
@@ -220,14 +214,14 @@ Continuous-tone Still Images, Part 2: Compliance testing" and has document
|
|||||||
numbers ISO/IEC IS 10918-2, ITU-T T.83.
|
numbers ISO/IEC IS 10918-2, ITU-T T.83.
|
||||||
|
|
||||||
The JPEG standard does not specify all details of an interchangeable file
|
The JPEG standard does not specify all details of an interchangeable file
|
||||||
format. For the omitted details we follow the "JFIF" conventions, revision
|
format. For the omitted details, we follow the "JFIF" conventions, revision
|
||||||
1.02. JFIF 1.02 has been adopted as an Ecma International Technical Report
|
1.02. JFIF version 1 has been adopted as ISO/IEC 10918-5 (05/2013) and
|
||||||
and thus received a formal publication status. It is available as a free
|
Recommendation ITU-T T.871 (05/2011): Information technology - Digital
|
||||||
download in PDF format from
|
compression and coding of continuous-tone still images: JPEG File Interchange
|
||||||
http://www.ecma-international.org/publications/techreports/E-TR-098.htm.
|
Format (JFIF). It is available as a free download in PDF file format from
|
||||||
A PostScript version of the JFIF document is available at
|
https://www.iso.org/standard/54989.html and http://www.itu.int/rec/T-REC-T.871.
|
||||||
http://www.ijg.org/files/jfif.ps.gz. There is also a plain text version at
|
A PDF file of the older JFIF 1.02 specification is available at
|
||||||
http://www.ijg.org/files/jfif.txt.gz, but it is missing the figures.
|
http://www.w3.org/Graphics/JPEG/jfif3.pdf.
|
||||||
|
|
||||||
The TIFF 6.0 file format specification can be obtained by FTP from
|
The TIFF 6.0 file format specification can be obtained by FTP from
|
||||||
ftp://ftp.sgi.com/graphics/tiff/TIFF6.ps.gz. The JPEG incorporation scheme
|
ftp://ftp.sgi.com/graphics/tiff/TIFF6.ps.gz. The JPEG incorporation scheme
|
||||||
@@ -259,18 +253,22 @@ with body
|
|||||||
send usenet/news.answers/jpeg-faq/part2
|
send usenet/news.answers/jpeg-faq/part2
|
||||||
|
|
||||||
|
|
||||||
FILE FORMAT WARS
|
FILE FORMAT COMPATIBILITY
|
||||||
================
|
=========================
|
||||||
|
|
||||||
The ISO/IEC JTC1/SC29/WG1 standards committee (also known as JPEG, together
|
This software implements ITU T.81 | ISO/IEC 10918 with some extensions from
|
||||||
with ITU-T SG16) currently promotes different formats containing the name
|
ITU T.871 | ISO/IEC 10918-5 (JPEG File Interchange Format-- see REFERENCES).
|
||||||
"JPEG" which are incompatible with original DCT-based JPEG. IJG therefore does
|
Informally, the term "JPEG image" or "JPEG file" most often refers to JFIF or
|
||||||
not support these formats (see REFERENCES). Indeed, one of the original
|
a subset thereof, but there are other formats containing the name "JPEG" that
|
||||||
reasons for developing this free software was to help force convergence on
|
are incompatible with the DCT-based JPEG standard or with JFIF (for instance,
|
||||||
common, interoperable format standards for JPEG files.
|
JPEG 2000 and JPEG XR). This software therefore does not support these
|
||||||
Don't use an incompatible file format!
|
formats. Indeed, one of the original reasons for developing this free software
|
||||||
(In any case, our decoder will remain capable of reading existing JPEG
|
was to help force convergence on a common, interoperable format standard for
|
||||||
image files indefinitely.)
|
JPEG files.
|
||||||
|
|
||||||
|
JFIF is a minimal or "low end" representation. TIFF/JPEG (TIFF revision 6.0 as
|
||||||
|
modified by TIFF Technical Note #2) can be used for "high end" applications
|
||||||
|
that need to record a lot of additional data about an image.
|
||||||
|
|
||||||
|
|
||||||
TO DO
|
TO DO
|
||||||
|
|||||||
Vendored
+9
-4
@@ -2,8 +2,9 @@ Background
|
|||||||
==========
|
==========
|
||||||
|
|
||||||
libjpeg-turbo is a JPEG image codec that uses SIMD instructions (MMX, SSE2,
|
libjpeg-turbo is a JPEG image codec that uses SIMD instructions (MMX, SSE2,
|
||||||
NEON, AltiVec) to accelerate baseline JPEG compression and decompression on
|
AVX2, NEON, AltiVec) to accelerate baseline JPEG compression and decompression
|
||||||
x86, x86-64, ARM, and PowerPC systems. On such systems, libjpeg-turbo is
|
on x86, x86-64, ARM, and PowerPC systems, as well as progressive JPEG
|
||||||
|
compression on x86 and x86-64 systems. On such systems, libjpeg-turbo is
|
||||||
generally 2-6x as fast as libjpeg, all else being equal. On other types of
|
generally 2-6x as fast as libjpeg, all else being equal. On other types of
|
||||||
systems, libjpeg-turbo can still outperform libjpeg by a significant amount, by
|
systems, libjpeg-turbo can still outperform libjpeg by a significant amount, by
|
||||||
virtue of its highly-optimized Huffman coding routines. In many cases, the
|
virtue of its highly-optimized Huffman coding routines. In many cases, the
|
||||||
@@ -48,7 +49,10 @@ JPEG images:
|
|||||||
straightforward to achieve using the underlying libjpeg API, such as
|
straightforward to achieve using the underlying libjpeg API, such as
|
||||||
generating planar YUV images and performing multiple simultaneous lossless
|
generating planar YUV images and performing multiple simultaneous lossless
|
||||||
transforms on an image. The Java interface for libjpeg-turbo is written on
|
transforms on an image. The Java interface for libjpeg-turbo is written on
|
||||||
top of the TurboJPEG API.
|
top of the TurboJPEG API. The TurboJPEG API is recommended for first-time
|
||||||
|
users of libjpeg-turbo. Refer to [tjexample.c](tjexample.c) and
|
||||||
|
[TJExample.java](java/TJExample.java) for examples of its usage and to
|
||||||
|
<http://libjpeg-turbo.org/Documentation/Documentation> for API documentation.
|
||||||
|
|
||||||
- **libjpeg API**<br>
|
- **libjpeg API**<br>
|
||||||
This is the de facto industry-standard API for compressing and decompressing
|
This is the de facto industry-standard API for compressing and decompressing
|
||||||
@@ -56,7 +60,8 @@ JPEG images:
|
|||||||
more powerful. The libjpeg API implementation in libjpeg-turbo is both
|
more powerful. The libjpeg API implementation in libjpeg-turbo is both
|
||||||
API/ABI-compatible and mathematically compatible with libjpeg v6b. It can
|
API/ABI-compatible and mathematically compatible with libjpeg v6b. It can
|
||||||
also optionally be configured to be API/ABI-compatible with libjpeg v7 and v8
|
also optionally be configured to be API/ABI-compatible with libjpeg v7 and v8
|
||||||
(see below.)
|
(see below.) Refer to [cjpeg.c](cjpeg.c) and [djpeg.c](djpeg.c) for examples
|
||||||
|
of its usage and to [libjpeg.txt](libjpeg.txt) for API documentation.
|
||||||
|
|
||||||
There is no significant performance advantage to either API when both are used
|
There is no significant performance advantage to either API when both are used
|
||||||
to perform similar operations.
|
to perform similar operations.
|
||||||
|
|||||||
Vendored
+54
-34
@@ -1,12 +1,25 @@
|
|||||||
/* jconfig.vc --- jconfig.h for Microsoft Visual C++ on Windows 95 or NT. */
|
/* Version ID for the JPEG library.
|
||||||
/* see jconfig.txt for explanations */
|
* Might be useful for tests like "#if JPEG_LIB_VERSION >= 60".
|
||||||
|
*/
|
||||||
#define JPEG_LIB_VERSION @JPEG_LIB_VERSION@
|
#define JPEG_LIB_VERSION @JPEG_LIB_VERSION@
|
||||||
|
|
||||||
|
/* libjpeg-turbo version */
|
||||||
#define LIBJPEG_TURBO_VERSION @VERSION@
|
#define LIBJPEG_TURBO_VERSION @VERSION@
|
||||||
|
|
||||||
|
/* libjpeg-turbo version in integer form */
|
||||||
#define LIBJPEG_TURBO_VERSION_NUMBER @LIBJPEG_TURBO_VERSION_NUMBER@
|
#define LIBJPEG_TURBO_VERSION_NUMBER @LIBJPEG_TURBO_VERSION_NUMBER@
|
||||||
#cmakedefine C_ARITH_CODING_SUPPORTED
|
|
||||||
#cmakedefine D_ARITH_CODING_SUPPORTED
|
/* Support arithmetic encoding */
|
||||||
#cmakedefine MEM_SRCDST_SUPPORTED
|
#cmakedefine C_ARITH_CODING_SUPPORTED 1
|
||||||
|
|
||||||
|
/* Support arithmetic decoding */
|
||||||
|
#cmakedefine D_ARITH_CODING_SUPPORTED 1
|
||||||
|
|
||||||
|
/* Support in-memory source/destination managers */
|
||||||
|
#cmakedefine MEM_SRCDST_SUPPORTED 1
|
||||||
|
|
||||||
|
/* Use accelerated SIMD routines. */
|
||||||
|
#cmakedefine WITH_SIMD 1
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Define BITS_IN_JSAMPLE as either
|
* Define BITS_IN_JSAMPLE as either
|
||||||
@@ -19,35 +32,42 @@
|
|||||||
|
|
||||||
#define BITS_IN_JSAMPLE @BITS_IN_JSAMPLE@ /* use 8 or 12 */
|
#define BITS_IN_JSAMPLE @BITS_IN_JSAMPLE@ /* use 8 or 12 */
|
||||||
|
|
||||||
#define HAVE_UNSIGNED_CHAR
|
/* Define to 1 if you have the <locale.h> header file. */
|
||||||
#define HAVE_UNSIGNED_SHORT
|
#cmakedefine HAVE_LOCALE_H 1
|
||||||
/* #define void char */
|
|
||||||
/* #define const */
|
|
||||||
#undef __CHAR_UNSIGNED__
|
|
||||||
#define HAVE_STDDEF_H
|
|
||||||
#define HAVE_STDLIB_H
|
|
||||||
#undef NEED_BSD_STRINGS
|
|
||||||
#undef NEED_SYS_TYPES_H
|
|
||||||
#undef NEED_FAR_POINTERS /* we presume a 32-bit flat memory model */
|
|
||||||
#undef INCOMPLETE_TYPES_BROKEN
|
|
||||||
|
|
||||||
/* Define "boolean" as unsigned char, not int, per Windows custom */
|
/* Define to 1 if you have the <stddef.h> header file. */
|
||||||
#ifndef __RPCNDR_H__ /* don't conflict if rpcndr.h already read */
|
#cmakedefine HAVE_STDDEF_H 1
|
||||||
typedef unsigned char boolean;
|
|
||||||
|
/* Define to 1 if you have the <stdlib.h> header file. */
|
||||||
|
#cmakedefine HAVE_STDLIB_H 1
|
||||||
|
|
||||||
|
/* Define if you need to include <sys/types.h> to get size_t. */
|
||||||
|
#cmakedefine NEED_SYS_TYPES_H 1
|
||||||
|
|
||||||
|
/* Define if you have BSD-like bzero and bcopy in <strings.h> rather than
|
||||||
|
memset/memcpy in <string.h>. */
|
||||||
|
#cmakedefine NEED_BSD_STRINGS 1
|
||||||
|
|
||||||
|
/* Define to 1 if the system has the type `unsigned char'. */
|
||||||
|
#cmakedefine HAVE_UNSIGNED_CHAR 1
|
||||||
|
|
||||||
|
/* Define to 1 if the system has the type `unsigned short'. */
|
||||||
|
#cmakedefine HAVE_UNSIGNED_SHORT 1
|
||||||
|
|
||||||
|
/* Compiler does not support pointers to undefined structures. */
|
||||||
|
#cmakedefine INCOMPLETE_TYPES_BROKEN 1
|
||||||
|
|
||||||
|
/* Define if your (broken) compiler shifts signed values as if they were
|
||||||
|
unsigned. */
|
||||||
|
#cmakedefine RIGHT_SHIFT_IS_UNSIGNED 1
|
||||||
|
|
||||||
|
/* Define to 1 if type `char' is unsigned and you are not using gcc. */
|
||||||
|
#ifndef __CHAR_UNSIGNED__
|
||||||
|
#cmakedefine __CHAR_UNSIGNED__ 1
|
||||||
#endif
|
#endif
|
||||||
#define HAVE_BOOLEAN /* prevent jmorecfg.h from redefining it */
|
|
||||||
|
|
||||||
/* Define "INT32" as int, not long, per Windows custom */
|
/* Define to empty if `const' does not conform to ANSI C. */
|
||||||
#if !(defined(_BASETSD_H_) || defined(_BASETSD_H)) /* don't conflict if basetsd.h already read */
|
/* #undef const */
|
||||||
typedef short INT16;
|
|
||||||
typedef signed int INT32;
|
|
||||||
#endif
|
|
||||||
#define XMD_H /* prevent jmorecfg.h from redefining it */
|
|
||||||
|
|
||||||
#ifdef JPEG_INTERNALS
|
/* Define to `unsigned int' if <sys/types.h> does not define. */
|
||||||
|
/* #undef size_t */
|
||||||
#undef RIGHT_SHIFT_IS_UNSIGNED
|
|
||||||
|
|
||||||
#define SIZEOF_SIZE_T @SIZEOF_SIZE_T@
|
|
||||||
|
|
||||||
#endif /* JPEG_INTERNALS */
|
|
||||||
|
|||||||
+34
@@ -0,0 +1,34 @@
|
|||||||
|
#define JPEG_LIB_VERSION @JPEG_LIB_VERSION@
|
||||||
|
#define LIBJPEG_TURBO_VERSION @VERSION@
|
||||||
|
#define LIBJPEG_TURBO_VERSION_NUMBER @LIBJPEG_TURBO_VERSION_NUMBER@
|
||||||
|
|
||||||
|
#cmakedefine C_ARITH_CODING_SUPPORTED
|
||||||
|
#cmakedefine D_ARITH_CODING_SUPPORTED
|
||||||
|
#cmakedefine MEM_SRCDST_SUPPORTED
|
||||||
|
#cmakedefine WITH_SIMD
|
||||||
|
|
||||||
|
#define BITS_IN_JSAMPLE @BITS_IN_JSAMPLE@ /* use 8 or 12 */
|
||||||
|
|
||||||
|
#define HAVE_STDDEF_H
|
||||||
|
#define HAVE_STDLIB_H
|
||||||
|
#undef NEED_SYS_TYPES_H
|
||||||
|
#undef NEED_BSD_STRINGS
|
||||||
|
|
||||||
|
#define HAVE_UNSIGNED_CHAR
|
||||||
|
#define HAVE_UNSIGNED_SHORT
|
||||||
|
#undef INCOMPLETE_TYPES_BROKEN
|
||||||
|
#undef RIGHT_SHIFT_IS_UNSIGNED
|
||||||
|
#undef __CHAR_UNSIGNED__
|
||||||
|
|
||||||
|
/* Define "boolean" as unsigned char, not int, per Windows custom */
|
||||||
|
#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 "INT32" as int, not long, per Windows custom */
|
||||||
|
#if !(defined(_BASETSD_H_) || defined(_BASETSD_H)) /* don't conflict if basetsd.h already read */
|
||||||
|
typedef short INT16;
|
||||||
|
typedef signed int INT32;
|
||||||
|
#endif
|
||||||
|
#define XMD_H /* prevent jmorecfg.h from redefining it */
|
||||||
+28
-2
@@ -1,7 +1,10 @@
|
|||||||
#define VERSION "@VERSION@"
|
/* libjpeg-turbo build number */
|
||||||
#define BUILD "@BUILD@"
|
#define BUILD "@BUILD@"
|
||||||
#define PACKAGE_NAME "@CMAKE_PROJECT_NAME@"
|
|
||||||
|
|
||||||
|
/* Compiler's inline keyword */
|
||||||
|
#undef inline
|
||||||
|
|
||||||
|
/* How to obtain function inlining. */
|
||||||
#ifndef INLINE
|
#ifndef INLINE
|
||||||
#if defined(__GNUC__)
|
#if defined(__GNUC__)
|
||||||
#define INLINE inline __attribute__((always_inline))
|
#define INLINE inline __attribute__((always_inline))
|
||||||
@@ -11,3 +14,26 @@
|
|||||||
#define INLINE
|
#define INLINE
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Define to the full name of this package. */
|
||||||
|
#define PACKAGE_NAME "@CMAKE_PROJECT_NAME@"
|
||||||
|
|
||||||
|
/* Version number of package */
|
||||||
|
#define VERSION "@VERSION@"
|
||||||
|
|
||||||
|
/* The size of `size_t', as computed by sizeof. */
|
||||||
|
#define SIZEOF_SIZE_T @SIZEOF_SIZE_T@
|
||||||
|
|
||||||
|
/* Define if your compiler has __builtin_ctzl() and sizeof(unsigned long) == sizeof(size_t). */
|
||||||
|
#cmakedefine HAVE_BUILTIN_CTZL
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <intrin.h> header file. */
|
||||||
|
#cmakedefine HAVE_INTRIN_H
|
||||||
|
|
||||||
|
#if defined(_MSC_VER) && defined(HAVE_INTRIN_H)
|
||||||
|
#if (SIZEOF_SIZE_T == 8)
|
||||||
|
#define HAVE_BITSCANFORWARD64
|
||||||
|
#elif (SIZEOF_SIZE_T == 4)
|
||||||
|
#define HAVE_BITSCANFORWARD
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|||||||
Vendored
+6
-5
@@ -4,16 +4,16 @@
|
|||||||
* This file was part of the Independent JPEG Group's software:
|
* This file was part of the Independent JPEG Group's software:
|
||||||
* Developed 1997-2009 by Guido Vollbeding.
|
* Developed 1997-2009 by Guido Vollbeding.
|
||||||
* libjpeg-turbo Modifications:
|
* libjpeg-turbo Modifications:
|
||||||
* Copyright (C) 2015, D. R. Commander.
|
* Copyright (C) 2015, 2018, D. R. Commander.
|
||||||
* For conditions of distribution and use, see the accompanying README.ijg
|
* For conditions of distribution and use, see the accompanying README.ijg
|
||||||
* file.
|
* file.
|
||||||
*
|
*
|
||||||
* This file contains probability estimation tables for common use in
|
* This file contains probability estimation tables for common use in
|
||||||
* arithmetic entropy encoding and decoding routines.
|
* arithmetic entropy encoding and decoding routines.
|
||||||
*
|
*
|
||||||
* This data represents Table D.2 in the JPEG spec (ISO/IEC IS 10918-1
|
* This data represents Table D.2 in
|
||||||
* and CCITT Recommendation ITU-T T.81) and Table 24 in the JBIG spec
|
* Recommendation ITU-T T.81 (1992) | ISO/IEC 10918-1:1994 and Table 24 in
|
||||||
* (ISO/IEC IS 11544 and CCITT Recommendation ITU-T T.82).
|
* Recommendation ITU-T T.82 (1993) | ISO/IEC 11544:1993.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define JPEG_INTERNALS
|
#define JPEG_INTERNALS
|
||||||
@@ -29,7 +29,8 @@
|
|||||||
* implementation (jbig_tab.c).
|
* implementation (jbig_tab.c).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define V(i,a,b,c,d) (((JLONG)a << 16) | ((JLONG)c << 8) | ((JLONG)d << 7) | b)
|
#define V(i, a, b, c, d) \
|
||||||
|
(((JLONG)a << 16) | ((JLONG)c << 8) | ((JLONG)d << 7) | b)
|
||||||
|
|
||||||
const JLONG jpeg_aritab[113 + 1] = {
|
const JLONG jpeg_aritab[113 + 1] = {
|
||||||
/*
|
/*
|
||||||
|
|||||||
+2
-2
@@ -204,8 +204,8 @@ jpeg_finish_compress (j_compress_ptr cinfo)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
GLOBAL(void)
|
GLOBAL(void)
|
||||||
jpeg_write_marker (j_compress_ptr cinfo, int marker,
|
jpeg_write_marker(j_compress_ptr cinfo, int marker, const JOCTET *dataptr,
|
||||||
const JOCTET *dataptr, unsigned int datalen)
|
unsigned int datalen)
|
||||||
{
|
{
|
||||||
void (*write_marker_byte) (j_compress_ptr info, int val);
|
void (*write_marker_byte) (j_compress_ptr info, int val);
|
||||||
|
|
||||||
|
|||||||
Vendored
+9
-5
@@ -4,16 +4,19 @@
|
|||||||
* This file was part of the Independent JPEG Group's software:
|
* This file was part of the Independent JPEG Group's software:
|
||||||
* Developed 1997-2009 by Guido Vollbeding.
|
* Developed 1997-2009 by Guido Vollbeding.
|
||||||
* libjpeg-turbo Modifications:
|
* libjpeg-turbo Modifications:
|
||||||
* Copyright (C) 2015, D. R. Commander.
|
* Copyright (C) 2015, 2018, D. R. Commander.
|
||||||
* For conditions of distribution and use, see the accompanying README.ijg
|
* For conditions of distribution and use, see the accompanying README.ijg
|
||||||
* file.
|
* file.
|
||||||
*
|
*
|
||||||
* This file contains portable arithmetic entropy encoding routines for JPEG
|
* This file contains portable arithmetic entropy encoding routines for JPEG
|
||||||
* (implementing the ISO/IEC IS 10918-1 and CCITT Recommendation ITU-T T.81).
|
* (implementing Recommendation ITU-T T.81 | ISO/IEC 10918-1).
|
||||||
*
|
*
|
||||||
* Both sequential and progressive modes are supported in this single module.
|
* Both sequential and progressive modes are supported in this single module.
|
||||||
*
|
*
|
||||||
* Suspension is not currently supported in this module.
|
* Suspension is not currently supported in this module.
|
||||||
|
*
|
||||||
|
* NOTE: All referenced figures are from
|
||||||
|
* Recommendation ITU-T T.81 (1992) | ISO/IEC 10918-1:1994.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define JPEG_INTERNALS
|
#define JPEG_INTERNALS
|
||||||
@@ -142,13 +145,13 @@ finish_pass (j_compress_ptr cinfo)
|
|||||||
|
|
||||||
/* Find the e->c in the coding interval with the largest
|
/* Find the e->c in the coding interval with the largest
|
||||||
* number of trailing zero bits */
|
* number of trailing zero bits */
|
||||||
if ((temp = (e->a - 1 + e->c) & 0xFFFF0000L) < e->c)
|
if ((temp = (e->a - 1 + e->c) & 0xFFFF0000UL) < e->c)
|
||||||
e->c = temp + 0x8000L;
|
e->c = temp + 0x8000L;
|
||||||
else
|
else
|
||||||
e->c = temp;
|
e->c = temp;
|
||||||
/* Send remaining bytes to output */
|
/* Send remaining bytes to output */
|
||||||
e->c <<= e->ct;
|
e->c <<= e->ct;
|
||||||
if (e->c & 0xF8000000L) {
|
if (e->c & 0xF8000000UL) {
|
||||||
/* One final overflow has to be handled */
|
/* One final overflow has to be handled */
|
||||||
if (e->buffer >= 0) {
|
if (e->buffer >= 0) {
|
||||||
if (e->zc)
|
if (e->zc)
|
||||||
@@ -881,7 +884,8 @@ start_pass (j_compress_ptr cinfo, boolean gather_statistics)
|
|||||||
#ifdef CALCULATE_SPECTRAL_CONDITIONING
|
#ifdef CALCULATE_SPECTRAL_CONDITIONING
|
||||||
if (cinfo->progressive_mode)
|
if (cinfo->progressive_mode)
|
||||||
/* Section G.1.3.2: Set appropriate arithmetic conditioning value Kx */
|
/* Section G.1.3.2: Set appropriate arithmetic conditioning value Kx */
|
||||||
cinfo->arith_ac_K[tbl] = cinfo->Ss + ((8 + cinfo->Se - cinfo->Ss) >> 4);
|
cinfo->arith_ac_K[tbl] = cinfo->Ss +
|
||||||
|
((8 + cinfo->Se - cinfo->Ss) >> 4);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+10
-10
@@ -58,13 +58,11 @@ typedef my_coef_controller *my_coef_ptr;
|
|||||||
|
|
||||||
|
|
||||||
/* Forward declarations */
|
/* Forward declarations */
|
||||||
METHODDEF(boolean) compress_data
|
METHODDEF(boolean) compress_data(j_compress_ptr cinfo, JSAMPIMAGE input_buf);
|
||||||
(j_compress_ptr cinfo, JSAMPIMAGE input_buf);
|
|
||||||
#ifdef FULL_COEF_BUFFER_SUPPORTED
|
#ifdef FULL_COEF_BUFFER_SUPPORTED
|
||||||
METHODDEF(boolean) compress_first_pass
|
METHODDEF(boolean) compress_first_pass(j_compress_ptr cinfo,
|
||||||
(j_compress_ptr cinfo, JSAMPIMAGE input_buf);
|
JSAMPIMAGE input_buf);
|
||||||
METHODDEF(boolean) compress_output
|
METHODDEF(boolean) compress_output(j_compress_ptr cinfo, JSAMPIMAGE input_buf);
|
||||||
(j_compress_ptr cinfo, JSAMPIMAGE input_buf);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
@@ -167,8 +165,8 @@ compress_data (j_compress_ptr cinfo, JSAMPIMAGE input_buf)
|
|||||||
blkn = 0;
|
blkn = 0;
|
||||||
for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
|
for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
|
||||||
compptr = cinfo->cur_comp_info[ci];
|
compptr = cinfo->cur_comp_info[ci];
|
||||||
blockcnt = (MCU_col_num < last_MCU_col) ? compptr->MCU_width
|
blockcnt = (MCU_col_num < last_MCU_col) ? compptr->MCU_width :
|
||||||
: compptr->last_col_width;
|
compptr->last_col_width;
|
||||||
xpos = MCU_col_num * compptr->MCU_sample_width;
|
xpos = MCU_col_num * compptr->MCU_sample_width;
|
||||||
ypos = yoffset * DCTSIZE; /* ypos == (yoffset+yindex) * DCTSIZE */
|
ypos = yoffset * DCTSIZE; /* ypos == (yoffset+yindex) * DCTSIZE */
|
||||||
for (yindex = 0; yindex < compptr->MCU_height; yindex++) {
|
for (yindex = 0; yindex < compptr->MCU_height; yindex++) {
|
||||||
@@ -183,7 +181,8 @@ compress_data (j_compress_ptr cinfo, JSAMPIMAGE input_buf)
|
|||||||
jzero_far((void *)coef->MCU_buffer[blkn + blockcnt],
|
jzero_far((void *)coef->MCU_buffer[blkn + blockcnt],
|
||||||
(compptr->MCU_width - blockcnt) * sizeof(JBLOCK));
|
(compptr->MCU_width - blockcnt) * sizeof(JBLOCK));
|
||||||
for (bi = blockcnt; bi < compptr->MCU_width; bi++) {
|
for (bi = blockcnt; bi < compptr->MCU_width; bi++) {
|
||||||
coef->MCU_buffer[blkn+bi][0][0] = coef->MCU_buffer[blkn+bi-1][0][0];
|
coef->MCU_buffer[blkn + bi][0][0] =
|
||||||
|
coef->MCU_buffer[blkn + bi - 1][0][0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -191,7 +190,8 @@ compress_data (j_compress_ptr cinfo, JSAMPIMAGE input_buf)
|
|||||||
jzero_far((void *)coef->MCU_buffer[blkn],
|
jzero_far((void *)coef->MCU_buffer[blkn],
|
||||||
compptr->MCU_width * sizeof(JBLOCK));
|
compptr->MCU_width * sizeof(JBLOCK));
|
||||||
for (bi = 0; bi < compptr->MCU_width; bi++) {
|
for (bi = 0; bi < compptr->MCU_width; bi++) {
|
||||||
coef->MCU_buffer[blkn+bi][0][0] = coef->MCU_buffer[blkn-1][0][0];
|
coef->MCU_buffer[blkn + bi][0][0] =
|
||||||
|
coef->MCU_buffer[blkn - 1][0][0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
blkn += compptr->MCU_width;
|
blkn += compptr->MCU_width;
|
||||||
|
|||||||
+17
-21
@@ -29,9 +29,9 @@
|
|||||||
|
|
||||||
INLINE
|
INLINE
|
||||||
LOCAL(void)
|
LOCAL(void)
|
||||||
rgb_ycc_convert_internal (j_compress_ptr cinfo,
|
rgb_ycc_convert_internal(j_compress_ptr cinfo, JSAMPARRAY input_buf,
|
||||||
JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
|
JSAMPIMAGE output_buf, JDIMENSION output_row,
|
||||||
JDIMENSION output_row, int num_rows)
|
int num_rows)
|
||||||
{
|
{
|
||||||
my_cconvert_ptr cconvert = (my_cconvert_ptr)cinfo->cconvert;
|
my_cconvert_ptr cconvert = (my_cconvert_ptr)cinfo->cconvert;
|
||||||
register int r, g, b;
|
register int r, g, b;
|
||||||
@@ -58,17 +58,14 @@ rgb_ycc_convert_internal (j_compress_ptr cinfo,
|
|||||||
* need the general RIGHT_SHIFT macro.
|
* need the general RIGHT_SHIFT macro.
|
||||||
*/
|
*/
|
||||||
/* Y */
|
/* Y */
|
||||||
outptr0[col] = (JSAMPLE)
|
outptr0[col] = (JSAMPLE)((ctab[r + R_Y_OFF] + ctab[g + G_Y_OFF] +
|
||||||
((ctab[r+R_Y_OFF] + ctab[g+G_Y_OFF] + ctab[b+B_Y_OFF])
|
ctab[b + B_Y_OFF]) >> SCALEBITS);
|
||||||
>> SCALEBITS);
|
|
||||||
/* Cb */
|
/* Cb */
|
||||||
outptr1[col] = (JSAMPLE)
|
outptr1[col] = (JSAMPLE)((ctab[r + R_CB_OFF] + ctab[g + G_CB_OFF] +
|
||||||
((ctab[r+R_CB_OFF] + ctab[g+G_CB_OFF] + ctab[b+B_CB_OFF])
|
ctab[b + B_CB_OFF]) >> SCALEBITS);
|
||||||
>> SCALEBITS);
|
|
||||||
/* Cr */
|
/* Cr */
|
||||||
outptr2[col] = (JSAMPLE)
|
outptr2[col] = (JSAMPLE)((ctab[r + R_CR_OFF] + ctab[g + G_CR_OFF] +
|
||||||
((ctab[r+R_CR_OFF] + ctab[g+G_CR_OFF] + ctab[b+B_CR_OFF])
|
ctab[b + B_CR_OFF]) >> SCALEBITS);
|
||||||
>> SCALEBITS);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -86,9 +83,9 @@ rgb_ycc_convert_internal (j_compress_ptr cinfo,
|
|||||||
|
|
||||||
INLINE
|
INLINE
|
||||||
LOCAL(void)
|
LOCAL(void)
|
||||||
rgb_gray_convert_internal (j_compress_ptr cinfo,
|
rgb_gray_convert_internal(j_compress_ptr cinfo, JSAMPARRAY input_buf,
|
||||||
JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
|
JSAMPIMAGE output_buf, JDIMENSION output_row,
|
||||||
JDIMENSION output_row, int num_rows)
|
int num_rows)
|
||||||
{
|
{
|
||||||
my_cconvert_ptr cconvert = (my_cconvert_ptr)cinfo->cconvert;
|
my_cconvert_ptr cconvert = (my_cconvert_ptr)cinfo->cconvert;
|
||||||
register int r, g, b;
|
register int r, g, b;
|
||||||
@@ -108,9 +105,8 @@ rgb_gray_convert_internal (j_compress_ptr cinfo,
|
|||||||
b = GETJSAMPLE(inptr[RGB_BLUE]);
|
b = GETJSAMPLE(inptr[RGB_BLUE]);
|
||||||
inptr += RGB_PIXELSIZE;
|
inptr += RGB_PIXELSIZE;
|
||||||
/* Y */
|
/* Y */
|
||||||
outptr[col] = (JSAMPLE)
|
outptr[col] = (JSAMPLE)((ctab[r + R_Y_OFF] + ctab[g + G_Y_OFF] +
|
||||||
((ctab[r+R_Y_OFF] + ctab[g+G_Y_OFF] + ctab[b+B_Y_OFF])
|
ctab[b + B_Y_OFF]) >> SCALEBITS);
|
||||||
>> SCALEBITS);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -123,9 +119,9 @@ rgb_gray_convert_internal (j_compress_ptr cinfo,
|
|||||||
|
|
||||||
INLINE
|
INLINE
|
||||||
LOCAL(void)
|
LOCAL(void)
|
||||||
rgb_rgb_convert_internal (j_compress_ptr cinfo,
|
rgb_rgb_convert_internal(j_compress_ptr cinfo, JSAMPARRAY input_buf,
|
||||||
JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
|
JSAMPIMAGE output_buf, JDIMENSION output_row,
|
||||||
JDIMENSION output_row, int num_rows)
|
int num_rows)
|
||||||
{
|
{
|
||||||
register JSAMPROW inptr;
|
register JSAMPROW inptr;
|
||||||
register JSAMPROW outptr0, outptr1, outptr2;
|
register JSAMPROW outptr0, outptr1, outptr2;
|
||||||
|
|||||||
Vendored
+17
-26
@@ -231,9 +231,8 @@ rgb_ycc_start (j_compress_ptr cinfo)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
METHODDEF(void)
|
METHODDEF(void)
|
||||||
rgb_ycc_convert (j_compress_ptr cinfo,
|
rgb_ycc_convert(j_compress_ptr cinfo, JSAMPARRAY input_buf,
|
||||||
JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
|
JSAMPIMAGE output_buf, JDIMENSION output_row, int num_rows)
|
||||||
JDIMENSION output_row, int num_rows)
|
|
||||||
{
|
{
|
||||||
switch (cinfo->in_color_space) {
|
switch (cinfo->in_color_space) {
|
||||||
case JCS_EXT_RGB:
|
case JCS_EXT_RGB:
|
||||||
@@ -280,9 +279,8 @@ rgb_ycc_convert (j_compress_ptr cinfo,
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
METHODDEF(void)
|
METHODDEF(void)
|
||||||
rgb_gray_convert (j_compress_ptr cinfo,
|
rgb_gray_convert(j_compress_ptr cinfo, JSAMPARRAY input_buf,
|
||||||
JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
|
JSAMPIMAGE output_buf, JDIMENSION output_row, int num_rows)
|
||||||
JDIMENSION output_row, int num_rows)
|
|
||||||
{
|
{
|
||||||
switch (cinfo->in_color_space) {
|
switch (cinfo->in_color_space) {
|
||||||
case JCS_EXT_RGB:
|
case JCS_EXT_RGB:
|
||||||
@@ -326,9 +324,8 @@ rgb_gray_convert (j_compress_ptr cinfo,
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
METHODDEF(void)
|
METHODDEF(void)
|
||||||
rgb_rgb_convert (j_compress_ptr cinfo,
|
rgb_rgb_convert(j_compress_ptr cinfo, JSAMPARRAY input_buf,
|
||||||
JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
|
JSAMPIMAGE output_buf, JDIMENSION output_row, int num_rows)
|
||||||
JDIMENSION output_row, int num_rows)
|
|
||||||
{
|
{
|
||||||
switch (cinfo->in_color_space) {
|
switch (cinfo->in_color_space) {
|
||||||
case JCS_EXT_RGB:
|
case JCS_EXT_RGB:
|
||||||
@@ -376,9 +373,8 @@ rgb_rgb_convert (j_compress_ptr cinfo,
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
METHODDEF(void)
|
METHODDEF(void)
|
||||||
cmyk_ycck_convert (j_compress_ptr cinfo,
|
cmyk_ycck_convert(j_compress_ptr cinfo, JSAMPARRAY input_buf,
|
||||||
JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
|
JSAMPIMAGE output_buf, JDIMENSION output_row, int num_rows)
|
||||||
JDIMENSION output_row, int num_rows)
|
|
||||||
{
|
{
|
||||||
my_cconvert_ptr cconvert = (my_cconvert_ptr)cinfo->cconvert;
|
my_cconvert_ptr cconvert = (my_cconvert_ptr)cinfo->cconvert;
|
||||||
register int r, g, b;
|
register int r, g, b;
|
||||||
@@ -408,17 +404,14 @@ cmyk_ycck_convert (j_compress_ptr cinfo,
|
|||||||
* need the general RIGHT_SHIFT macro.
|
* need the general RIGHT_SHIFT macro.
|
||||||
*/
|
*/
|
||||||
/* Y */
|
/* Y */
|
||||||
outptr0[col] = (JSAMPLE)
|
outptr0[col] = (JSAMPLE)((ctab[r + R_Y_OFF] + ctab[g + G_Y_OFF] +
|
||||||
((ctab[r+R_Y_OFF] + ctab[g+G_Y_OFF] + ctab[b+B_Y_OFF])
|
ctab[b + B_Y_OFF]) >> SCALEBITS);
|
||||||
>> SCALEBITS);
|
|
||||||
/* Cb */
|
/* Cb */
|
||||||
outptr1[col] = (JSAMPLE)
|
outptr1[col] = (JSAMPLE)((ctab[r + R_CB_OFF] + ctab[g + G_CB_OFF] +
|
||||||
((ctab[r+R_CB_OFF] + ctab[g+G_CB_OFF] + ctab[b+B_CB_OFF])
|
ctab[b + B_CB_OFF]) >> SCALEBITS);
|
||||||
>> SCALEBITS);
|
|
||||||
/* Cr */
|
/* Cr */
|
||||||
outptr2[col] = (JSAMPLE)
|
outptr2[col] = (JSAMPLE)((ctab[r + R_CR_OFF] + ctab[g + G_CR_OFF] +
|
||||||
((ctab[r+R_CR_OFF] + ctab[g+G_CR_OFF] + ctab[b+B_CR_OFF])
|
ctab[b + B_CR_OFF]) >> SCALEBITS);
|
||||||
>> SCALEBITS);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -431,9 +424,8 @@ cmyk_ycck_convert (j_compress_ptr cinfo,
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
METHODDEF(void)
|
METHODDEF(void)
|
||||||
grayscale_convert (j_compress_ptr cinfo,
|
grayscale_convert(j_compress_ptr cinfo, JSAMPARRAY input_buf,
|
||||||
JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
|
JSAMPIMAGE output_buf, JDIMENSION output_row, int num_rows)
|
||||||
JDIMENSION output_row, int num_rows)
|
|
||||||
{
|
{
|
||||||
register JSAMPROW inptr;
|
register JSAMPROW inptr;
|
||||||
register JSAMPROW outptr;
|
register JSAMPROW outptr;
|
||||||
@@ -460,8 +452,7 @@ grayscale_convert (j_compress_ptr cinfo,
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
METHODDEF(void)
|
METHODDEF(void)
|
||||||
null_convert (j_compress_ptr cinfo,
|
null_convert(j_compress_ptr cinfo, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
|
||||||
JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
|
|
||||||
JDIMENSION output_row, int num_rows)
|
JDIMENSION output_row, int num_rows)
|
||||||
{
|
{
|
||||||
register JSAMPROW inptr;
|
register JSAMPROW inptr;
|
||||||
|
|||||||
+5
-5
@@ -489,8 +489,7 @@ quantize (JCOEFPTR coef_block, DCTELEM *divisors, DCTELEM *workspace)
|
|||||||
METHODDEF(void)
|
METHODDEF(void)
|
||||||
forward_DCT(j_compress_ptr cinfo, jpeg_component_info *compptr,
|
forward_DCT(j_compress_ptr cinfo, jpeg_component_info *compptr,
|
||||||
JSAMPARRAY sample_data, JBLOCKROW coef_blocks,
|
JSAMPARRAY sample_data, JBLOCKROW coef_blocks,
|
||||||
JDIMENSION start_row, JDIMENSION start_col,
|
JDIMENSION start_row, JDIMENSION start_col, JDIMENSION num_blocks)
|
||||||
JDIMENSION num_blocks)
|
|
||||||
/* This version is used for integer DCT implementations. */
|
/* This version is used for integer DCT implementations. */
|
||||||
{
|
{
|
||||||
/* This routine is heavily used, so it's worth coding it tightly. */
|
/* This routine is heavily used, so it's worth coding it tightly. */
|
||||||
@@ -522,9 +521,9 @@ forward_DCT (j_compress_ptr cinfo, jpeg_component_info *compptr,
|
|||||||
|
|
||||||
#ifdef DCT_FLOAT_SUPPORTED
|
#ifdef DCT_FLOAT_SUPPORTED
|
||||||
|
|
||||||
|
|
||||||
METHODDEF(void)
|
METHODDEF(void)
|
||||||
convsamp_float (JSAMPARRAY sample_data, JDIMENSION start_col, FAST_FLOAT *workspace)
|
convsamp_float(JSAMPARRAY sample_data, JDIMENSION start_col,
|
||||||
|
FAST_FLOAT *workspace)
|
||||||
{
|
{
|
||||||
register FAST_FLOAT *workspaceptr;
|
register FAST_FLOAT *workspaceptr;
|
||||||
register JSAMPROW elemptr;
|
register JSAMPROW elemptr;
|
||||||
@@ -555,7 +554,8 @@ convsamp_float (JSAMPARRAY sample_data, JDIMENSION start_col, FAST_FLOAT *worksp
|
|||||||
|
|
||||||
|
|
||||||
METHODDEF(void)
|
METHODDEF(void)
|
||||||
quantize_float (JCOEFPTR coef_block, FAST_FLOAT *divisors, FAST_FLOAT *workspace)
|
quantize_float(JCOEFPTR coef_block, FAST_FLOAT *divisors,
|
||||||
|
FAST_FLOAT *workspace)
|
||||||
{
|
{
|
||||||
register FAST_FLOAT temp;
|
register FAST_FLOAT temp;
|
||||||
register int i;
|
register int i;
|
||||||
|
|||||||
Vendored
+29
-28
@@ -4,7 +4,7 @@
|
|||||||
* This file was part of the Independent JPEG Group's software:
|
* This file was part of the Independent JPEG Group's software:
|
||||||
* Copyright (C) 1991-1997, Thomas G. Lane.
|
* Copyright (C) 1991-1997, Thomas G. Lane.
|
||||||
* libjpeg-turbo Modifications:
|
* libjpeg-turbo Modifications:
|
||||||
* Copyright (C) 2009-2011, 2014-2016, D. R. Commander.
|
* Copyright (C) 2009-2011, 2014-2016, 2018, D. R. Commander.
|
||||||
* Copyright (C) 2015, Matthieu Darbois.
|
* Copyright (C) 2015, Matthieu Darbois.
|
||||||
* For conditions of distribution and use, see the accompanying README.ijg
|
* For conditions of distribution and use, see the accompanying README.ijg
|
||||||
* file.
|
* file.
|
||||||
@@ -16,6 +16,9 @@
|
|||||||
* back up to the start of the current MCU. To do this, we copy state
|
* back up to the start of the current MCU. To do this, we copy state
|
||||||
* variables into local working storage, and update them back to the
|
* variables into local working storage, and update them back to the
|
||||||
* permanent JPEG objects only upon successful completion of an MCU.
|
* permanent JPEG objects only upon successful completion of an MCU.
|
||||||
|
*
|
||||||
|
* NOTE: All referenced figures are from
|
||||||
|
* Recommendation ITU-T T.81 (1992) | ISO/IEC 10918-1:1994.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define JPEG_INTERNALS
|
#define JPEG_INTERNALS
|
||||||
@@ -55,10 +58,6 @@
|
|||||||
#define JPEG_NBITS_NONZERO(x) JPEG_NBITS(x)
|
#define JPEG_NBITS_NONZERO(x) JPEG_NBITS(x)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef min
|
|
||||||
#define min(a,b) ((a)<(b)?(a):(b))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/* Expanded entropy encoder object for Huffman encoding.
|
/* Expanded entropy encoder object for Huffman encoding.
|
||||||
*
|
*
|
||||||
@@ -310,11 +309,12 @@ jpeg_make_c_derived_tbl (j_compress_ptr cinfo, boolean isDC, int tblno,
|
|||||||
/* Outputting bytes to the file */
|
/* Outputting bytes to the file */
|
||||||
|
|
||||||
/* Emit a byte, taking 'action' if must suspend. */
|
/* Emit a byte, taking 'action' if must suspend. */
|
||||||
#define emit_byte(state,val,action) \
|
#define emit_byte(state, val, action) { \
|
||||||
{ *(state)->next_output_byte++ = (JOCTET) (val); \
|
*(state)->next_output_byte++ = (JOCTET)(val); \
|
||||||
if (--(state)->free_in_buffer == 0) \
|
if (--(state)->free_in_buffer == 0) \
|
||||||
if (!dump_buffer(state)) \
|
if (!dump_buffer(state)) \
|
||||||
{ action; } }
|
{ action; } \
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
LOCAL(boolean)
|
LOCAL(boolean)
|
||||||
@@ -434,8 +434,8 @@ dump_buffer (working_state *state)
|
|||||||
if (state->free_in_buffer < BUFSIZE) { \
|
if (state->free_in_buffer < BUFSIZE) { \
|
||||||
localbuf = 1; \
|
localbuf = 1; \
|
||||||
buffer = _buffer; \
|
buffer = _buffer; \
|
||||||
} \
|
} else \
|
||||||
else buffer = state->next_output_byte; \
|
buffer = state->next_output_byte; \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define STORE_BUFFER() { \
|
#define STORE_BUFFER() { \
|
||||||
@@ -443,7 +443,7 @@ dump_buffer (working_state *state)
|
|||||||
bytes = buffer - _buffer; \
|
bytes = buffer - _buffer; \
|
||||||
buffer = _buffer; \
|
buffer = _buffer; \
|
||||||
while (bytes > 0) { \
|
while (bytes > 0) { \
|
||||||
bytestocopy = min(bytes, state->free_in_buffer); \
|
bytestocopy = MIN(bytes, state->free_in_buffer); \
|
||||||
MEMCOPY(state->next_output_byte, buffer, bytestocopy); \
|
MEMCOPY(state->next_output_byte, buffer, bytestocopy); \
|
||||||
state->next_output_byte += bytestocopy; \
|
state->next_output_byte += bytestocopy; \
|
||||||
buffer += bytestocopy; \
|
buffer += bytestocopy; \
|
||||||
@@ -452,8 +452,7 @@ dump_buffer (working_state *state)
|
|||||||
if (!dump_buffer(state)) return FALSE; \
|
if (!dump_buffer(state)) return FALSE; \
|
||||||
bytes -= bytestocopy; \
|
bytes -= bytestocopy; \
|
||||||
} \
|
} \
|
||||||
} \
|
} else { \
|
||||||
else { \
|
|
||||||
state->free_in_buffer -= (buffer - state->next_output_byte); \
|
state->free_in_buffer -= (buffer - state->next_output_byte); \
|
||||||
state->next_output_byte = buffer; \
|
state->next_output_byte = buffer; \
|
||||||
} \
|
} \
|
||||||
@@ -863,13 +862,14 @@ encode_mcu_gather (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
|
|||||||
* one bits (so that padding bits added at the end of a compressed segment
|
* one bits (so that padding bits added at the end of a compressed segment
|
||||||
* can't look like a valid code). Because of the canonical ordering of
|
* can't look like a valid code). Because of the canonical ordering of
|
||||||
* codewords, this just means that there must be an unused slot in the
|
* codewords, this just means that there must be an unused slot in the
|
||||||
* longest codeword length category. Section K.2 of the JPEG spec suggests
|
* longest codeword length category. Annex K (Clause K.2) of
|
||||||
* reserving such a slot by pretending that symbol 256 is a valid symbol
|
* Rec. ITU-T T.81 (1992) | ISO/IEC 10918-1:1994 suggests reserving such a slot
|
||||||
* with count 1. In theory that's not optimal; giving it count zero but
|
* by pretending that symbol 256 is a valid symbol with count 1. In theory
|
||||||
* including it in the symbol set anyway should give a better Huffman code.
|
* that's not optimal; giving it count zero but including it in the symbol set
|
||||||
* But the theoretically better code actually seems to come out worse in
|
* anyway should give a better Huffman code. But the theoretically better code
|
||||||
* practice, because it produces more all-ones bytes (which incur stuffed
|
* actually seems to come out worse in practice, because it produces more
|
||||||
* zero bytes in the final file). In any case the difference is tiny.
|
* all-ones bytes (which incur stuffed zero bytes in the final file). In any
|
||||||
|
* case the difference is tiny.
|
||||||
*
|
*
|
||||||
* The JPEG standard requires Huffman codes to be no more than 16 bits long.
|
* The JPEG standard requires Huffman codes to be no more than 16 bits long.
|
||||||
* If some symbols have a very small but nonzero probability, the Huffman tree
|
* If some symbols have a very small but nonzero probability, the Huffman tree
|
||||||
@@ -971,13 +971,13 @@ jpeg_gen_optimal_table (j_compress_ptr cinfo, JHUFF_TBL *htbl, long freq[])
|
|||||||
|
|
||||||
/* JPEG doesn't allow symbols with code lengths over 16 bits, so if the pure
|
/* JPEG doesn't allow symbols with code lengths over 16 bits, so if the pure
|
||||||
* Huffman procedure assigned any such lengths, we must adjust the coding.
|
* Huffman procedure assigned any such lengths, we must adjust the coding.
|
||||||
* Here is what the JPEG spec says about how this next bit works:
|
* Here is what Rec. ITU-T T.81 | ISO/IEC 10918-1 says about how this next
|
||||||
* Since symbols are paired for the longest Huffman code, the symbols are
|
* bit works: Since symbols are paired for the longest Huffman code, the
|
||||||
* removed from this length category two at a time. The prefix for the pair
|
* symbols are removed from this length category two at a time. The prefix
|
||||||
* (which is one bit shorter) is allocated to one of the pair; then,
|
* for the pair (which is one bit shorter) is allocated to one of the pair;
|
||||||
* skipping the BITS entry for that prefix length, a code word from the next
|
* then, skipping the BITS entry for that prefix length, a code word from the
|
||||||
* shortest nonzero BITS entry is converted into a prefix for two code words
|
* next shortest nonzero BITS entry is converted into a prefix for two code
|
||||||
* one bit longer.
|
* words one bit longer.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
for (i = MAX_CLEN; i > 16; i--) {
|
for (i = MAX_CLEN; i > 16; i--) {
|
||||||
@@ -1003,7 +1003,8 @@ jpeg_gen_optimal_table (j_compress_ptr cinfo, JHUFF_TBL *htbl, long freq[])
|
|||||||
|
|
||||||
/* Return a list of the symbols sorted by code length */
|
/* 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
|
/* It's not real clear to me why we don't need to consider the codelength
|
||||||
* changes made above, but the JPEG spec seems to think this works.
|
* changes made above, but Rec. ITU-T T.81 | ISO/IEC 10918-1 seems to think
|
||||||
|
* this works.
|
||||||
*/
|
*/
|
||||||
p = 0;
|
p = 0;
|
||||||
for (i = 1; i <= MAX_CLEN; i++) {
|
for (i = 1; i <= MAX_CLEN; i++) {
|
||||||
|
|||||||
Vendored
+4
-5
@@ -34,10 +34,9 @@ typedef struct {
|
|||||||
} c_derived_tbl;
|
} c_derived_tbl;
|
||||||
|
|
||||||
/* Expand a Huffman table definition into the derived format */
|
/* Expand a Huffman table definition into the derived format */
|
||||||
EXTERN(void) jpeg_make_c_derived_tbl
|
EXTERN(void) jpeg_make_c_derived_tbl(j_compress_ptr cinfo, boolean isDC,
|
||||||
(j_compress_ptr cinfo, boolean isDC, int tblno,
|
int tblno, c_derived_tbl **pdtbl);
|
||||||
c_derived_tbl ** pdtbl);
|
|
||||||
|
|
||||||
/* Generate an optimal table definition given the specified counts */
|
/* Generate an optimal table definition given the specified counts */
|
||||||
EXTERN(void) jpeg_gen_optimal_table
|
EXTERN(void) jpeg_gen_optimal_table(j_compress_ptr cinfo, JHUFF_TBL *htbl,
|
||||||
(j_compress_ptr cinfo, JHUFF_TBL *htbl, long freq[]);
|
long freq[]);
|
||||||
|
|||||||
Vendored
+105
@@ -0,0 +1,105 @@
|
|||||||
|
/*
|
||||||
|
* jcicc.c
|
||||||
|
*
|
||||||
|
* Copyright (C) 1997-1998, Thomas G. Lane, Todd Newman.
|
||||||
|
* Copyright (C) 2017, D. R. Commander.
|
||||||
|
* For conditions of distribution and use, see the accompanying README.ijg
|
||||||
|
* file.
|
||||||
|
*
|
||||||
|
* This file provides code to write International Color Consortium (ICC) device
|
||||||
|
* profiles embedded in JFIF JPEG image files. The ICC has defined a standard
|
||||||
|
* for including such data in JPEG "APP2" markers. The code given here does
|
||||||
|
* not know anything about the internal structure of the ICC profile data; it
|
||||||
|
* just knows how to embed the profile data in a JPEG file while writing it.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define JPEG_INTERNALS
|
||||||
|
#include "jinclude.h"
|
||||||
|
#include "jpeglib.h"
|
||||||
|
#include "jerror.h"
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Since an ICC profile can be larger than the maximum size of a JPEG marker
|
||||||
|
* (64K), we need provisions to split it into multiple markers. The format
|
||||||
|
* defined by the ICC specifies one or more APP2 markers containing the
|
||||||
|
* following data:
|
||||||
|
* Identifying string ASCII "ICC_PROFILE\0" (12 bytes)
|
||||||
|
* Marker sequence number 1 for first APP2, 2 for next, etc (1 byte)
|
||||||
|
* Number of markers Total number of APP2's used (1 byte)
|
||||||
|
* Profile data (remainder of APP2 data)
|
||||||
|
* Decoders should use the marker sequence numbers to reassemble the profile,
|
||||||
|
* rather than assuming that the APP2 markers appear in the correct sequence.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define ICC_MARKER (JPEG_APP0 + 2) /* JPEG marker code for ICC */
|
||||||
|
#define ICC_OVERHEAD_LEN 14 /* size of non-profile data in APP2 */
|
||||||
|
#define MAX_BYTES_IN_MARKER 65533 /* maximum data len of a JPEG marker */
|
||||||
|
#define MAX_DATA_BYTES_IN_MARKER (MAX_BYTES_IN_MARKER - ICC_OVERHEAD_LEN)
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This routine writes the given ICC profile data into a JPEG file. It *must*
|
||||||
|
* be called AFTER calling jpeg_start_compress() and BEFORE the first call to
|
||||||
|
* jpeg_write_scanlines(). (This ordering ensures that the APP2 marker(s) will
|
||||||
|
* appear after the SOI and JFIF or Adobe markers, but before all else.)
|
||||||
|
*/
|
||||||
|
|
||||||
|
GLOBAL(void)
|
||||||
|
jpeg_write_icc_profile(j_compress_ptr cinfo, const JOCTET *icc_data_ptr,
|
||||||
|
unsigned int icc_data_len)
|
||||||
|
{
|
||||||
|
unsigned int num_markers; /* total number of markers we'll write */
|
||||||
|
int cur_marker = 1; /* per spec, counting starts at 1 */
|
||||||
|
unsigned int length; /* number of bytes to write in this marker */
|
||||||
|
|
||||||
|
if (icc_data_ptr == NULL || icc_data_len == 0)
|
||||||
|
ERREXIT(cinfo, JERR_BUFFER_SIZE);
|
||||||
|
if (cinfo->global_state < CSTATE_SCANNING)
|
||||||
|
ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
|
||||||
|
|
||||||
|
/* Calculate the number of markers we'll need, rounding up of course */
|
||||||
|
num_markers = icc_data_len / MAX_DATA_BYTES_IN_MARKER;
|
||||||
|
if (num_markers * MAX_DATA_BYTES_IN_MARKER != icc_data_len)
|
||||||
|
num_markers++;
|
||||||
|
|
||||||
|
while (icc_data_len > 0) {
|
||||||
|
/* length of profile to put in this marker */
|
||||||
|
length = icc_data_len;
|
||||||
|
if (length > MAX_DATA_BYTES_IN_MARKER)
|
||||||
|
length = MAX_DATA_BYTES_IN_MARKER;
|
||||||
|
icc_data_len -= length;
|
||||||
|
|
||||||
|
/* Write the JPEG marker header (APP2 code and marker length) */
|
||||||
|
jpeg_write_m_header(cinfo, ICC_MARKER,
|
||||||
|
(unsigned int)(length + ICC_OVERHEAD_LEN));
|
||||||
|
|
||||||
|
/* Write the marker identifying string "ICC_PROFILE" (null-terminated). We
|
||||||
|
* code it in this less-than-transparent way so that the code works even if
|
||||||
|
* the local character set is not ASCII.
|
||||||
|
*/
|
||||||
|
jpeg_write_m_byte(cinfo, 0x49);
|
||||||
|
jpeg_write_m_byte(cinfo, 0x43);
|
||||||
|
jpeg_write_m_byte(cinfo, 0x43);
|
||||||
|
jpeg_write_m_byte(cinfo, 0x5F);
|
||||||
|
jpeg_write_m_byte(cinfo, 0x50);
|
||||||
|
jpeg_write_m_byte(cinfo, 0x52);
|
||||||
|
jpeg_write_m_byte(cinfo, 0x4F);
|
||||||
|
jpeg_write_m_byte(cinfo, 0x46);
|
||||||
|
jpeg_write_m_byte(cinfo, 0x49);
|
||||||
|
jpeg_write_m_byte(cinfo, 0x4C);
|
||||||
|
jpeg_write_m_byte(cinfo, 0x45);
|
||||||
|
jpeg_write_m_byte(cinfo, 0x0);
|
||||||
|
|
||||||
|
/* Add the sequencing info */
|
||||||
|
jpeg_write_m_byte(cinfo, cur_marker);
|
||||||
|
jpeg_write_m_byte(cinfo, (int)num_markers);
|
||||||
|
|
||||||
|
/* Add the profile data */
|
||||||
|
while (length--) {
|
||||||
|
jpeg_write_m_byte(cinfo, *icc_data_ptr);
|
||||||
|
icc_data_ptr++;
|
||||||
|
}
|
||||||
|
cur_marker++;
|
||||||
|
}
|
||||||
|
}
|
||||||
Vendored
+2
-2
@@ -60,8 +60,8 @@ jinit_compress_master (j_compress_ptr cinfo)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Need a full-image coefficient buffer in any multi-pass mode. */
|
/* Need a full-image coefficient buffer in any multi-pass mode. */
|
||||||
jinit_c_coef_controller(cinfo,
|
jinit_c_coef_controller(cinfo, (boolean)(cinfo->num_scans > 1 ||
|
||||||
(boolean) (cinfo->num_scans > 1 || cinfo->optimize_coding));
|
cinfo->optimize_coding));
|
||||||
jinit_c_main_controller(cinfo, FALSE /* never need full buffer here */);
|
jinit_c_main_controller(cinfo, FALSE /* never need full buffer here */);
|
||||||
|
|
||||||
jinit_marker_writer(cinfo);
|
jinit_marker_writer(cinfo);
|
||||||
|
|||||||
+8
-8
@@ -39,8 +39,9 @@ typedef my_main_controller *my_main_ptr;
|
|||||||
|
|
||||||
|
|
||||||
/* Forward declarations */
|
/* Forward declarations */
|
||||||
METHODDEF(void) process_data_simple_main
|
METHODDEF(void) process_data_simple_main(j_compress_ptr cinfo,
|
||||||
(j_compress_ptr cinfo, JSAMPARRAY input_buf, JDIMENSION *in_row_ctr,
|
JSAMPARRAY input_buf,
|
||||||
|
JDIMENSION *in_row_ctr,
|
||||||
JDIMENSION in_rows_avail);
|
JDIMENSION in_rows_avail);
|
||||||
|
|
||||||
|
|
||||||
@@ -75,18 +76,17 @@ start_pass_main (j_compress_ptr cinfo, J_BUF_MODE pass_mode)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
METHODDEF(void)
|
METHODDEF(void)
|
||||||
process_data_simple_main (j_compress_ptr cinfo,
|
process_data_simple_main(j_compress_ptr cinfo, JSAMPARRAY input_buf,
|
||||||
JSAMPARRAY input_buf, JDIMENSION *in_row_ctr,
|
JDIMENSION *in_row_ctr, JDIMENSION in_rows_avail)
|
||||||
JDIMENSION in_rows_avail)
|
|
||||||
{
|
{
|
||||||
my_main_ptr main_ptr = (my_main_ptr)cinfo->main;
|
my_main_ptr main_ptr = (my_main_ptr)cinfo->main;
|
||||||
|
|
||||||
while (main_ptr->cur_iMCU_row < cinfo->total_iMCU_rows) {
|
while (main_ptr->cur_iMCU_row < cinfo->total_iMCU_rows) {
|
||||||
/* Read input data if we haven't filled the main buffer yet */
|
/* Read input data if we haven't filled the main buffer yet */
|
||||||
if (main_ptr->rowgroup_ctr < DCTSIZE)
|
if (main_ptr->rowgroup_ctr < DCTSIZE)
|
||||||
(*cinfo->prep->pre_process_data) (cinfo,
|
(*cinfo->prep->pre_process_data) (cinfo, input_buf, in_row_ctr,
|
||||||
input_buf, in_row_ctr, in_rows_avail,
|
in_rows_avail, main_ptr->buffer,
|
||||||
main_ptr->buffer, &main_ptr->rowgroup_ctr,
|
&main_ptr->rowgroup_ctr,
|
||||||
(JDIMENSION)DCTSIZE);
|
(JDIMENSION)DCTSIZE);
|
||||||
|
|
||||||
/* If we don't have a full iMCU row buffered, return to application for
|
/* If we don't have a full iMCU row buffered, return to application for
|
||||||
|
|||||||
+1
-2
@@ -296,8 +296,7 @@ emit_sof (j_compress_ptr cinfo, JPEG_MARKER code)
|
|||||||
emit_2bytes(cinfo, 3 * cinfo->num_components + 2 + 5 + 1); /* length */
|
emit_2bytes(cinfo, 3 * cinfo->num_components + 2 + 5 + 1); /* length */
|
||||||
|
|
||||||
/* Make sure image isn't bigger than SOF field can handle */
|
/* Make sure image isn't bigger than SOF field can handle */
|
||||||
if ((long) cinfo->_jpeg_height > 65535L ||
|
if ((long)cinfo->_jpeg_height > 65535L || (long)cinfo->_jpeg_width > 65535L)
|
||||||
(long) cinfo->_jpeg_width > 65535L)
|
|
||||||
ERREXIT1(cinfo, JERR_IMAGE_TOO_BIG, (unsigned int)65535);
|
ERREXIT1(cinfo, JERR_IMAGE_TOO_BIG, (unsigned int)65535);
|
||||||
|
|
||||||
emit_byte(cinfo, cinfo->data_precision);
|
emit_byte(cinfo, cinfo->data_precision);
|
||||||
|
|||||||
+11
-10
@@ -5,7 +5,7 @@
|
|||||||
* Copyright (C) 1991-1997, Thomas G. Lane.
|
* Copyright (C) 1991-1997, Thomas G. Lane.
|
||||||
* Modified 2003-2010 by Guido Vollbeding.
|
* Modified 2003-2010 by Guido Vollbeding.
|
||||||
* libjpeg-turbo Modifications:
|
* libjpeg-turbo Modifications:
|
||||||
* Copyright (C) 2010, 2016, D. R. Commander.
|
* Copyright (C) 2010, 2016, 2018, D. R. Commander.
|
||||||
* For conditions of distribution and use, see the accompanying README.ijg
|
* For conditions of distribution and use, see the accompanying README.ijg
|
||||||
* file.
|
* file.
|
||||||
*
|
*
|
||||||
@@ -95,8 +95,8 @@ initial_setup (j_compress_ptr cinfo, boolean transcode_only)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Sanity check on image dimensions */
|
/* Sanity check on image dimensions */
|
||||||
if (cinfo->_jpeg_height <= 0 || cinfo->_jpeg_width <= 0
|
if (cinfo->_jpeg_height <= 0 || cinfo->_jpeg_width <= 0 ||
|
||||||
|| cinfo->num_components <= 0 || cinfo->input_components <= 0)
|
cinfo->num_components <= 0 || cinfo->input_components <= 0)
|
||||||
ERREXIT(cinfo, JERR_EMPTY_IMAGE);
|
ERREXIT(cinfo, JERR_EMPTY_IMAGE);
|
||||||
|
|
||||||
/* Make sure image isn't bigger than I can handle */
|
/* Make sure image isn't bigger than I can handle */
|
||||||
@@ -124,8 +124,10 @@ initial_setup (j_compress_ptr cinfo, boolean transcode_only)
|
|||||||
cinfo->max_v_samp_factor = 1;
|
cinfo->max_v_samp_factor = 1;
|
||||||
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
|
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
|
||||||
ci++, compptr++) {
|
ci++, compptr++) {
|
||||||
if (compptr->h_samp_factor<=0 || compptr->h_samp_factor>MAX_SAMP_FACTOR ||
|
if (compptr->h_samp_factor <= 0 ||
|
||||||
compptr->v_samp_factor<=0 || compptr->v_samp_factor>MAX_SAMP_FACTOR)
|
compptr->h_samp_factor > MAX_SAMP_FACTOR ||
|
||||||
|
compptr->v_samp_factor <= 0 ||
|
||||||
|
compptr->v_samp_factor > MAX_SAMP_FACTOR)
|
||||||
ERREXIT(cinfo, JERR_BAD_SAMPLING);
|
ERREXIT(cinfo, JERR_BAD_SAMPLING);
|
||||||
cinfo->max_h_samp_factor = MAX(cinfo->max_h_samp_factor,
|
cinfo->max_h_samp_factor = MAX(cinfo->max_h_samp_factor,
|
||||||
compptr->h_samp_factor);
|
compptr->h_samp_factor);
|
||||||
@@ -232,9 +234,9 @@ validate_script (j_compress_ptr cinfo)
|
|||||||
Al = scanptr->Al;
|
Al = scanptr->Al;
|
||||||
if (cinfo->progressive_mode) {
|
if (cinfo->progressive_mode) {
|
||||||
#ifdef C_PROGRESSIVE_SUPPORTED
|
#ifdef C_PROGRESSIVE_SUPPORTED
|
||||||
/* The JPEG spec simply gives the ranges 0..13 for Ah and Al, but that
|
/* Rec. ITU-T T.81 | ISO/IEC 10918-1 simply gives the ranges 0..13 for Ah
|
||||||
* seems wrong: the upper bound ought to depend on data precision.
|
* and Al, but that seems wrong: the upper bound ought to depend on data
|
||||||
* Perhaps they really meant 0..N+1 for N-bit precision.
|
* precision. Perhaps they really meant 0..N+1 for N-bit precision.
|
||||||
* Here we allow 0..10 for 8-bit data; Al larger than 10 results in
|
* Here we allow 0..10 for 8-bit data; Al larger than 10 results in
|
||||||
* out-of-range reconstructed DC values during the first DC scan,
|
* out-of-range reconstructed DC values during the first DC scan,
|
||||||
* which might cause problems for some decoders.
|
* which might cause problems for some decoders.
|
||||||
@@ -331,8 +333,7 @@ select_scan_parameters (j_compress_ptr cinfo)
|
|||||||
cinfo->Se = scanptr->Se;
|
cinfo->Se = scanptr->Se;
|
||||||
cinfo->Ah = scanptr->Ah;
|
cinfo->Ah = scanptr->Ah;
|
||||||
cinfo->Al = scanptr->Al;
|
cinfo->Al = scanptr->Al;
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
/* Prepare for single sequential-JPEG scan containing all components */
|
/* Prepare for single sequential-JPEG scan containing all components */
|
||||||
|
|||||||
Vendored
+7
-8
@@ -5,7 +5,7 @@
|
|||||||
* Copyright (C) 1991-1998, Thomas G. Lane.
|
* Copyright (C) 1991-1998, Thomas G. Lane.
|
||||||
* Modified 2003-2008 by Guido Vollbeding.
|
* Modified 2003-2008 by Guido Vollbeding.
|
||||||
* libjpeg-turbo Modifications:
|
* libjpeg-turbo Modifications:
|
||||||
* Copyright (C) 2009-2011, D. R. Commander.
|
* Copyright (C) 2009-2011, 2018, D. R. Commander.
|
||||||
* For conditions of distribution and use, see the accompanying README.ijg
|
* For conditions of distribution and use, see the accompanying README.ijg
|
||||||
* file.
|
* file.
|
||||||
*
|
*
|
||||||
@@ -26,8 +26,8 @@
|
|||||||
|
|
||||||
GLOBAL(void)
|
GLOBAL(void)
|
||||||
jpeg_add_quant_table(j_compress_ptr cinfo, int which_tbl,
|
jpeg_add_quant_table(j_compress_ptr cinfo, int which_tbl,
|
||||||
const unsigned int *basic_table,
|
const unsigned int *basic_table, int scale_factor,
|
||||||
int scale_factor, boolean force_baseline)
|
boolean force_baseline)
|
||||||
/* Define a quantization table equal to the basic_table times
|
/* Define a quantization table equal to the basic_table times
|
||||||
* a scale factor (given as a percentage).
|
* a scale factor (given as a percentage).
|
||||||
* If force_baseline is TRUE, the computed quantization table entries
|
* If force_baseline is TRUE, the computed quantization table entries
|
||||||
@@ -65,7 +65,8 @@ jpeg_add_quant_table (j_compress_ptr cinfo, int which_tbl,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* These are the sample quantization tables given in JPEG spec section K.1.
|
/* These are the sample quantization tables given in Annex K (Clause K.1) of
|
||||||
|
* Recommendation ITU-T T.81 (1992) | ISO/IEC 10918-1:1994.
|
||||||
* The spec says that the values given produce "good" quality, and
|
* The spec says that the values given produce "good" quality, and
|
||||||
* when divided by 2, "very good" quality.
|
* when divided by 2, "very good" quality.
|
||||||
*/
|
*/
|
||||||
@@ -404,8 +405,7 @@ jpeg_set_colorspace (j_compress_ptr cinfo, J_COLOR_SPACE colorspace)
|
|||||||
#ifdef C_PROGRESSIVE_SUPPORTED
|
#ifdef C_PROGRESSIVE_SUPPORTED
|
||||||
|
|
||||||
LOCAL(jpeg_scan_info *)
|
LOCAL(jpeg_scan_info *)
|
||||||
fill_a_scan (jpeg_scan_info *scanptr, int ci,
|
fill_a_scan(jpeg_scan_info *scanptr, int ci, int Ss, int Se, int Ah, int Al)
|
||||||
int Ss, int Se, int Ah, int Al)
|
|
||||||
/* Support routine: generate one scan for specified component */
|
/* Support routine: generate one scan for specified component */
|
||||||
{
|
{
|
||||||
scanptr->comps_in_scan = 1;
|
scanptr->comps_in_scan = 1;
|
||||||
@@ -419,8 +419,7 @@ fill_a_scan (jpeg_scan_info *scanptr, int ci,
|
|||||||
}
|
}
|
||||||
|
|
||||||
LOCAL(jpeg_scan_info *)
|
LOCAL(jpeg_scan_info *)
|
||||||
fill_scans (jpeg_scan_info *scanptr, int ncomps,
|
fill_scans(jpeg_scan_info *scanptr, int ncomps, int Ss, int Se, int Ah, int Al)
|
||||||
int Ss, int Se, int Ah, int Al)
|
|
||||||
/* Support routine: generate one scan for each component */
|
/* Support routine: generate one scan for each component */
|
||||||
{
|
{
|
||||||
int ci;
|
int ci;
|
||||||
|
|||||||
Vendored
+417
-146
@@ -4,7 +4,8 @@
|
|||||||
* This file was part of the Independent JPEG Group's software:
|
* This file was part of the Independent JPEG Group's software:
|
||||||
* Copyright (C) 1995-1997, Thomas G. Lane.
|
* Copyright (C) 1995-1997, Thomas G. Lane.
|
||||||
* libjpeg-turbo Modifications:
|
* libjpeg-turbo Modifications:
|
||||||
* Copyright (C) 2015, D. R. Commander.
|
* Copyright (C) 2011, 2015, 2018, D. R. Commander.
|
||||||
|
* Copyright (C) 2016, 2018, Matthieu Darbois.
|
||||||
* For conditions of distribution and use, see the accompanying README.ijg
|
* For conditions of distribution and use, see the accompanying README.ijg
|
||||||
* file.
|
* file.
|
||||||
*
|
*
|
||||||
@@ -18,15 +19,69 @@
|
|||||||
#define JPEG_INTERNALS
|
#define JPEG_INTERNALS
|
||||||
#include "jinclude.h"
|
#include "jinclude.h"
|
||||||
#include "jpeglib.h"
|
#include "jpeglib.h"
|
||||||
#include "jchuff.h" /* Declarations shared with jchuff.c */
|
#include "jsimd.h"
|
||||||
|
#include "jconfigint.h"
|
||||||
|
#include <limits.h>
|
||||||
|
|
||||||
|
#ifdef HAVE_INTRIN_H
|
||||||
|
#include <intrin.h>
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#ifdef HAVE_BITSCANFORWARD64
|
||||||
|
#pragma intrinsic(_BitScanForward64)
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_BITSCANFORWARD
|
||||||
|
#pragma intrinsic(_BitScanForward)
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef C_PROGRESSIVE_SUPPORTED
|
#ifdef C_PROGRESSIVE_SUPPORTED
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 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
|
||||||
|
|
||||||
|
|
||||||
/* Expanded entropy encoder object for progressive Huffman encoding. */
|
/* Expanded entropy encoder object for progressive Huffman encoding. */
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
struct jpeg_entropy_encoder pub; /* public fields */
|
struct jpeg_entropy_encoder pub; /* public fields */
|
||||||
|
|
||||||
|
/* Pointer to routine to prepare data for encode_mcu_AC_first() */
|
||||||
|
void (*AC_first_prepare) (const JCOEF *block,
|
||||||
|
const int *jpeg_natural_order_start, int Sl,
|
||||||
|
int Al, JCOEF *values, size_t *zerobits);
|
||||||
|
/* Pointer to routine to prepare data for encode_mcu_AC_refine() */
|
||||||
|
int (*AC_refine_prepare) (const JCOEF *block,
|
||||||
|
const int *jpeg_natural_order_start, int Sl,
|
||||||
|
int Al, JCOEF *absvalues, size_t *bits);
|
||||||
|
|
||||||
/* Mode flag: TRUE for optimization, FALSE for actual data output */
|
/* Mode flag: TRUE for optimization, FALSE for actual data output */
|
||||||
boolean gather_statistics;
|
boolean gather_statistics;
|
||||||
|
|
||||||
@@ -88,19 +143,53 @@ typedef phuff_entropy_encoder *phuff_entropy_ptr;
|
|||||||
#define IRIGHT_SHIFT(x, shft) ((x) >> (shft))
|
#define IRIGHT_SHIFT(x, shft) ((x) >> (shft))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define PAD(v, p) ((v + (p) - 1) & (~((p) - 1)))
|
||||||
|
|
||||||
/* Forward declarations */
|
/* Forward declarations */
|
||||||
METHODDEF(boolean) encode_mcu_DC_first(j_compress_ptr cinfo,
|
METHODDEF(boolean) encode_mcu_DC_first(j_compress_ptr cinfo,
|
||||||
JBLOCKROW *MCU_data);
|
JBLOCKROW *MCU_data);
|
||||||
|
METHODDEF(void) encode_mcu_AC_first_prepare
|
||||||
|
(const JCOEF *block, const int *jpeg_natural_order_start, int Sl, int Al,
|
||||||
|
JCOEF *values, size_t *zerobits);
|
||||||
METHODDEF(boolean) encode_mcu_AC_first(j_compress_ptr cinfo,
|
METHODDEF(boolean) encode_mcu_AC_first(j_compress_ptr cinfo,
|
||||||
JBLOCKROW *MCU_data);
|
JBLOCKROW *MCU_data);
|
||||||
METHODDEF(boolean) encode_mcu_DC_refine(j_compress_ptr cinfo,
|
METHODDEF(boolean) encode_mcu_DC_refine(j_compress_ptr cinfo,
|
||||||
JBLOCKROW *MCU_data);
|
JBLOCKROW *MCU_data);
|
||||||
|
METHODDEF(int) encode_mcu_AC_refine_prepare
|
||||||
|
(const JCOEF *block, const int *jpeg_natural_order_start, int Sl, int Al,
|
||||||
|
JCOEF *absvalues, size_t *bits);
|
||||||
METHODDEF(boolean) encode_mcu_AC_refine(j_compress_ptr cinfo,
|
METHODDEF(boolean) encode_mcu_AC_refine(j_compress_ptr cinfo,
|
||||||
JBLOCKROW *MCU_data);
|
JBLOCKROW *MCU_data);
|
||||||
METHODDEF(void) finish_pass_phuff(j_compress_ptr cinfo);
|
METHODDEF(void) finish_pass_phuff(j_compress_ptr cinfo);
|
||||||
METHODDEF(void) finish_pass_gather_phuff(j_compress_ptr cinfo);
|
METHODDEF(void) finish_pass_gather_phuff(j_compress_ptr cinfo);
|
||||||
|
|
||||||
|
|
||||||
|
/* Count bit loop zeroes */
|
||||||
|
INLINE
|
||||||
|
METHODDEF(int)
|
||||||
|
count_zeroes(size_t *x)
|
||||||
|
{
|
||||||
|
int result;
|
||||||
|
#if defined(HAVE_BUILTIN_CTZL)
|
||||||
|
result = __builtin_ctzl(*x);
|
||||||
|
*x >>= result;
|
||||||
|
#elif defined(HAVE_BITSCANFORWARD64)
|
||||||
|
_BitScanForward64(&result, *x);
|
||||||
|
*x >>= result;
|
||||||
|
#elif defined(HAVE_BITSCANFORWARD)
|
||||||
|
_BitScanForward(&result, *x);
|
||||||
|
*x >>= result;
|
||||||
|
#else
|
||||||
|
result = 0;
|
||||||
|
while ((*x & 1) == 0) {
|
||||||
|
++result;
|
||||||
|
*x >>= 1;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Initialize for a Huffman-compressed scan using progressive JPEG.
|
* Initialize for a Huffman-compressed scan using progressive JPEG.
|
||||||
*/
|
*/
|
||||||
@@ -126,11 +215,19 @@ start_pass_phuff (j_compress_ptr cinfo, boolean gather_statistics)
|
|||||||
entropy->pub.encode_mcu = encode_mcu_DC_first;
|
entropy->pub.encode_mcu = encode_mcu_DC_first;
|
||||||
else
|
else
|
||||||
entropy->pub.encode_mcu = encode_mcu_AC_first;
|
entropy->pub.encode_mcu = encode_mcu_AC_first;
|
||||||
|
if (jsimd_can_encode_mcu_AC_first_prepare())
|
||||||
|
entropy->AC_first_prepare = jsimd_encode_mcu_AC_first_prepare;
|
||||||
|
else
|
||||||
|
entropy->AC_first_prepare = encode_mcu_AC_first_prepare;
|
||||||
} else {
|
} else {
|
||||||
if (is_DC_band)
|
if (is_DC_band)
|
||||||
entropy->pub.encode_mcu = encode_mcu_DC_refine;
|
entropy->pub.encode_mcu = encode_mcu_DC_refine;
|
||||||
else {
|
else {
|
||||||
entropy->pub.encode_mcu = encode_mcu_AC_refine;
|
entropy->pub.encode_mcu = encode_mcu_AC_refine;
|
||||||
|
if (jsimd_can_encode_mcu_AC_refine_prepare())
|
||||||
|
entropy->AC_refine_prepare = jsimd_encode_mcu_AC_refine_prepare;
|
||||||
|
else
|
||||||
|
entropy->AC_refine_prepare = encode_mcu_AC_refine_prepare;
|
||||||
/* AC refinement needs a correction bit buffer */
|
/* AC refinement needs a correction bit buffer */
|
||||||
if (entropy->bit_buffer == NULL)
|
if (entropy->bit_buffer == NULL)
|
||||||
entropy->bit_buffer = (char *)
|
entropy->bit_buffer = (char *)
|
||||||
@@ -198,10 +295,11 @@ start_pass_phuff (j_compress_ptr cinfo, boolean gather_statistics)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/* Emit a byte */
|
/* Emit a byte */
|
||||||
#define emit_byte(entropy,val) \
|
#define emit_byte(entropy, val) { \
|
||||||
{ *(entropy)->next_output_byte++ = (JOCTET) (val); \
|
*(entropy)->next_output_byte++ = (JOCTET)(val); \
|
||||||
if (--(entropy)->free_in_buffer == 0) \
|
if (--(entropy)->free_in_buffer == 0) \
|
||||||
dump_buffer(entropy); }
|
dump_buffer(entropy); \
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
LOCAL(void)
|
LOCAL(void)
|
||||||
@@ -320,9 +418,7 @@ emit_eobrun (phuff_entropy_ptr entropy)
|
|||||||
|
|
||||||
if (entropy->EOBRUN > 0) { /* if there is any pending EOBRUN */
|
if (entropy->EOBRUN > 0) { /* if there is any pending EOBRUN */
|
||||||
temp = entropy->EOBRUN;
|
temp = entropy->EOBRUN;
|
||||||
nbits = 0;
|
nbits = JPEG_NBITS_NONZERO(temp) - 1;
|
||||||
while ((temp >>= 1))
|
|
||||||
nbits++;
|
|
||||||
/* safety check: shouldn't happen given limited correction-bit buffer */
|
/* safety check: shouldn't happen given limited correction-bit buffer */
|
||||||
if (nbits > 14)
|
if (nbits > 14)
|
||||||
ERREXIT(entropy->cinfo, JERR_HUFF_MISSING_CODE);
|
ERREXIT(entropy->cinfo, JERR_HUFF_MISSING_CODE);
|
||||||
@@ -378,7 +474,7 @@ METHODDEF(boolean)
|
|||||||
encode_mcu_DC_first(j_compress_ptr cinfo, JBLOCKROW *MCU_data)
|
encode_mcu_DC_first(j_compress_ptr cinfo, JBLOCKROW *MCU_data)
|
||||||
{
|
{
|
||||||
phuff_entropy_ptr entropy = (phuff_entropy_ptr)cinfo->entropy;
|
phuff_entropy_ptr entropy = (phuff_entropy_ptr)cinfo->entropy;
|
||||||
register int temp, temp2;
|
register int temp, temp2, temp3;
|
||||||
register int nbits;
|
register int nbits;
|
||||||
int blkn, ci;
|
int blkn, ci;
|
||||||
int Al = cinfo->Al;
|
int Al = cinfo->Al;
|
||||||
@@ -410,20 +506,20 @@ encode_mcu_DC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
|
|||||||
entropy->last_dc_val[ci] = temp2;
|
entropy->last_dc_val[ci] = temp2;
|
||||||
|
|
||||||
/* Encode the DC coefficient difference per section G.1.2.1 */
|
/* Encode the DC coefficient difference per section G.1.2.1 */
|
||||||
temp2 = temp;
|
|
||||||
if (temp < 0) {
|
/* This is a well-known technique for obtaining the absolute value without
|
||||||
temp = -temp; /* temp is abs value of input */
|
* a branch. It is derived from an assembly language technique presented
|
||||||
|
* in "How to Optimize for the Pentium Processors", Copyright (c) 1996,
|
||||||
|
* 1997 by Agner Fog.
|
||||||
|
*/
|
||||||
|
temp3 = temp >> (CHAR_BIT * sizeof(int) - 1);
|
||||||
|
temp ^= temp3;
|
||||||
|
temp -= temp3; /* temp is abs value of input */
|
||||||
/* For a negative input, want temp2 = bitwise complement of abs(input) */
|
/* For a negative input, want temp2 = bitwise complement of abs(input) */
|
||||||
/* This code assumes we are on a two's complement machine */
|
temp2 = temp ^ temp3;
|
||||||
temp2--;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Find the number of bits needed for the magnitude of the coefficient */
|
/* Find the number of bits needed for the magnitude of the coefficient */
|
||||||
nbits = 0;
|
nbits = JPEG_NBITS(temp);
|
||||||
while (temp) {
|
|
||||||
nbits++;
|
|
||||||
temp >>= 1;
|
|
||||||
}
|
|
||||||
/* Check for out-of-range coefficient values.
|
/* Check for out-of-range coefficient values.
|
||||||
* Since we're encoding a difference, the range limit is twice as much.
|
* Since we're encoding a difference, the range limit is twice as much.
|
||||||
*/
|
*/
|
||||||
@@ -456,21 +552,116 @@ encode_mcu_DC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Data preparation for encode_mcu_AC_first().
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define COMPUTE_ABSVALUES_AC_FIRST(Sl) { \
|
||||||
|
for (k = 0; k < Sl; k++) { \
|
||||||
|
temp = block[jpeg_natural_order_start[k]]; \
|
||||||
|
if (temp == 0) \
|
||||||
|
continue; \
|
||||||
|
/* We must apply the point transform by Al. For AC coefficients this \
|
||||||
|
* is an integer division with rounding towards 0. To do this portably \
|
||||||
|
* in C, we shift after obtaining the absolute value; so the code is \
|
||||||
|
* interwoven with finding the abs value (temp) and output bits (temp2). \
|
||||||
|
*/ \
|
||||||
|
temp2 = temp >> (CHAR_BIT * sizeof(int) - 1); \
|
||||||
|
temp ^= temp2; \
|
||||||
|
temp -= temp2; /* temp is abs value of input */ \
|
||||||
|
temp >>= Al; /* apply the point transform */ \
|
||||||
|
/* Watch out for case that nonzero coef is zero after point transform */ \
|
||||||
|
if (temp == 0) \
|
||||||
|
continue; \
|
||||||
|
/* For a negative coef, want temp2 = bitwise complement of abs(coef) */ \
|
||||||
|
temp2 ^= temp; \
|
||||||
|
values[k] = temp; \
|
||||||
|
values[k + DCTSIZE2] = temp2; \
|
||||||
|
zerobits |= ((size_t)1U) << k; \
|
||||||
|
} \
|
||||||
|
}
|
||||||
|
|
||||||
|
METHODDEF(void)
|
||||||
|
encode_mcu_AC_first_prepare(const JCOEF *block,
|
||||||
|
const int *jpeg_natural_order_start, int Sl,
|
||||||
|
int Al, JCOEF *values, size_t *bits)
|
||||||
|
{
|
||||||
|
register int k, temp, temp2;
|
||||||
|
size_t zerobits = 0U;
|
||||||
|
int Sl0 = Sl;
|
||||||
|
|
||||||
|
#if SIZEOF_SIZE_T == 4
|
||||||
|
if (Sl0 > 32)
|
||||||
|
Sl0 = 32;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
COMPUTE_ABSVALUES_AC_FIRST(Sl0);
|
||||||
|
|
||||||
|
bits[0] = zerobits;
|
||||||
|
#if SIZEOF_SIZE_T == 4
|
||||||
|
zerobits = 0U;
|
||||||
|
|
||||||
|
if (Sl > 32) {
|
||||||
|
Sl -= 32;
|
||||||
|
jpeg_natural_order_start += 32;
|
||||||
|
values += 32;
|
||||||
|
|
||||||
|
COMPUTE_ABSVALUES_AC_FIRST(Sl);
|
||||||
|
}
|
||||||
|
bits[1] = zerobits;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* MCU encoding for AC initial scan (either spectral selection,
|
* MCU encoding for AC initial scan (either spectral selection,
|
||||||
* or first pass of successive approximation).
|
* or first pass of successive approximation).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#define ENCODE_COEFS_AC_FIRST(label) { \
|
||||||
|
while (zerobits) { \
|
||||||
|
r = count_zeroes(&zerobits); \
|
||||||
|
cvalue += r; \
|
||||||
|
label \
|
||||||
|
temp = cvalue[0]; \
|
||||||
|
temp2 = cvalue[DCTSIZE2]; \
|
||||||
|
\
|
||||||
|
/* if run length > 15, must emit special run-length-16 codes (0xF0) */ \
|
||||||
|
while (r > 15) { \
|
||||||
|
emit_symbol(entropy, entropy->ac_tbl_no, 0xF0); \
|
||||||
|
r -= 16; \
|
||||||
|
} \
|
||||||
|
\
|
||||||
|
/* Find the number of bits needed for the magnitude of the coefficient */ \
|
||||||
|
nbits = JPEG_NBITS_NONZERO(temp); /* there must be at least one 1 bit */ \
|
||||||
|
/* Check for out-of-range coefficient values */ \
|
||||||
|
if (nbits > MAX_COEF_BITS) \
|
||||||
|
ERREXIT(cinfo, JERR_BAD_DCT_COEF); \
|
||||||
|
\
|
||||||
|
/* Count/emit Huffman symbol for run length / number of bits */ \
|
||||||
|
emit_symbol(entropy, entropy->ac_tbl_no, (r << 4) + nbits); \
|
||||||
|
\
|
||||||
|
/* Emit that number of bits of the value, if positive, */ \
|
||||||
|
/* or the complement of its magnitude, if negative. */ \
|
||||||
|
emit_bits(entropy, (unsigned int)temp2, nbits); \
|
||||||
|
\
|
||||||
|
cvalue++; \
|
||||||
|
zerobits >>= 1; \
|
||||||
|
} \
|
||||||
|
}
|
||||||
|
|
||||||
METHODDEF(boolean)
|
METHODDEF(boolean)
|
||||||
encode_mcu_AC_first(j_compress_ptr cinfo, JBLOCKROW *MCU_data)
|
encode_mcu_AC_first(j_compress_ptr cinfo, JBLOCKROW *MCU_data)
|
||||||
{
|
{
|
||||||
phuff_entropy_ptr entropy = (phuff_entropy_ptr)cinfo->entropy;
|
phuff_entropy_ptr entropy = (phuff_entropy_ptr)cinfo->entropy;
|
||||||
register int temp, temp2;
|
register int temp, temp2;
|
||||||
register int nbits;
|
register int nbits, r;
|
||||||
register int r, k;
|
int Sl = cinfo->Se - cinfo->Ss + 1;
|
||||||
int Se = cinfo->Se;
|
|
||||||
int Al = cinfo->Al;
|
int Al = cinfo->Al;
|
||||||
JBLOCKROW block;
|
JCOEF values_unaligned[2 * DCTSIZE2 + 15];
|
||||||
|
JCOEF *values;
|
||||||
|
const JCOEF *cvalue;
|
||||||
|
size_t zerobits;
|
||||||
|
size_t bits[8 / SIZEOF_SIZE_T];
|
||||||
|
|
||||||
entropy->next_output_byte = cinfo->dest->next_output_byte;
|
entropy->next_output_byte = cinfo->dest->next_output_byte;
|
||||||
entropy->free_in_buffer = cinfo->dest->free_in_buffer;
|
entropy->free_in_buffer = cinfo->dest->free_in_buffer;
|
||||||
@@ -480,66 +671,48 @@ encode_mcu_AC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
|
|||||||
if (entropy->restarts_to_go == 0)
|
if (entropy->restarts_to_go == 0)
|
||||||
emit_restart(entropy, entropy->next_restart_num);
|
emit_restart(entropy, entropy->next_restart_num);
|
||||||
|
|
||||||
/* Encode the MCU data block */
|
#ifdef WITH_SIMD
|
||||||
block = MCU_data[0];
|
cvalue = values = (JCOEF *)PAD((size_t)values_unaligned, 16);
|
||||||
|
#else
|
||||||
|
/* Not using SIMD, so alignment is not needed */
|
||||||
|
cvalue = values = values_unaligned;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Prepare data */
|
||||||
|
entropy->AC_first_prepare(MCU_data[0][0], jpeg_natural_order + cinfo->Ss,
|
||||||
|
Sl, Al, values, bits);
|
||||||
|
|
||||||
|
zerobits = bits[0];
|
||||||
|
#if SIZEOF_SIZE_T == 4
|
||||||
|
zerobits |= bits[1];
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Emit any pending EOBRUN */
|
||||||
|
if (zerobits && (entropy->EOBRUN > 0))
|
||||||
|
emit_eobrun(entropy);
|
||||||
|
|
||||||
|
#if SIZEOF_SIZE_T == 4
|
||||||
|
zerobits = bits[0];
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Encode the AC coefficients per section G.1.2.2, fig. G.3 */
|
/* Encode the AC coefficients per section G.1.2.2, fig. G.3 */
|
||||||
|
|
||||||
r = 0; /* r = run length of zeros */
|
ENCODE_COEFS_AC_FIRST((void)0;);
|
||||||
|
|
||||||
for (k = cinfo->Ss; k <= Se; k++) {
|
#if SIZEOF_SIZE_T == 4
|
||||||
if ((temp = (*block)[jpeg_natural_order[k]]) == 0) {
|
zerobits = bits[1];
|
||||||
r++;
|
if (zerobits) {
|
||||||
continue;
|
int diff = ((values + DCTSIZE2 / 2) - cvalue);
|
||||||
}
|
r = count_zeroes(&zerobits);
|
||||||
/* We must apply the point transform by Al. For AC coefficients this
|
r += diff;
|
||||||
* is an integer division with rounding towards 0. To do this portably
|
cvalue += r;
|
||||||
* in C, we shift after obtaining the absolute value; so the code is
|
goto first_iter_ac_first;
|
||||||
* interwoven with finding the abs value (temp) and output bits (temp2).
|
|
||||||
*/
|
|
||||||
if (temp < 0) {
|
|
||||||
temp = -temp; /* temp is abs value of input */
|
|
||||||
temp >>= Al; /* apply the point transform */
|
|
||||||
/* For a negative coef, want temp2 = bitwise complement of abs(coef) */
|
|
||||||
temp2 = ~temp;
|
|
||||||
} else {
|
|
||||||
temp >>= Al; /* apply the point transform */
|
|
||||||
temp2 = temp;
|
|
||||||
}
|
|
||||||
/* Watch out for case that nonzero coef is zero after point transform */
|
|
||||||
if (temp == 0) {
|
|
||||||
r++;
|
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Emit any pending EOBRUN */
|
ENCODE_COEFS_AC_FIRST(first_iter_ac_first:);
|
||||||
if (entropy->EOBRUN > 0)
|
#endif
|
||||||
emit_eobrun(entropy);
|
|
||||||
/* if run length > 15, must emit special run-length-16 codes (0xF0) */
|
|
||||||
while (r > 15) {
|
|
||||||
emit_symbol(entropy, entropy->ac_tbl_no, 0xF0);
|
|
||||||
r -= 16;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Find the number of bits needed for the magnitude of the coefficient */
|
if (cvalue < (values + Sl)) { /* If there are trailing zeroes, */
|
||||||
nbits = 1; /* there must be at least one 1 bit */
|
|
||||||
while ((temp >>= 1))
|
|
||||||
nbits++;
|
|
||||||
/* Check for out-of-range coefficient values */
|
|
||||||
if (nbits > MAX_COEF_BITS)
|
|
||||||
ERREXIT(cinfo, JERR_BAD_DCT_COEF);
|
|
||||||
|
|
||||||
/* Count/emit Huffman symbol for run length / number of bits */
|
|
||||||
emit_symbol(entropy, entropy->ac_tbl_no, (r << 4) + nbits);
|
|
||||||
|
|
||||||
/* Emit that number of bits of the value, if positive, */
|
|
||||||
/* or the complement of its magnitude, if negative. */
|
|
||||||
emit_bits(entropy, (unsigned int) temp2, nbits);
|
|
||||||
|
|
||||||
r = 0; /* reset zero run length */
|
|
||||||
}
|
|
||||||
|
|
||||||
if (r > 0) { /* If there are trailing zeroes, */
|
|
||||||
entropy->EOBRUN++; /* count an EOB */
|
entropy->EOBRUN++; /* count an EOB */
|
||||||
if (entropy->EOBRUN == 0x7FFF)
|
if (entropy->EOBRUN == 0x7FFF)
|
||||||
emit_eobrun(entropy); /* force it out to avoid overflow */
|
emit_eobrun(entropy); /* force it out to avoid overflow */
|
||||||
@@ -611,23 +784,149 @@ encode_mcu_DC_refine (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Data preparation for encode_mcu_AC_refine().
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define COMPUTE_ABSVALUES_AC_REFINE(Sl, koffset) { \
|
||||||
|
/* It is convenient to make a pre-pass to determine the transformed \
|
||||||
|
* coefficients' absolute values and the EOB position. \
|
||||||
|
*/ \
|
||||||
|
for (k = 0; k < Sl; k++) { \
|
||||||
|
temp = block[jpeg_natural_order_start[k]]; \
|
||||||
|
/* We must apply the point transform by Al. For AC coefficients this \
|
||||||
|
* is an integer division with rounding towards 0. To do this portably \
|
||||||
|
* in C, we shift after obtaining the absolute value. \
|
||||||
|
*/ \
|
||||||
|
temp2 = temp >> (CHAR_BIT * sizeof(int) - 1); \
|
||||||
|
temp ^= temp2; \
|
||||||
|
temp -= temp2; /* temp is abs value of input */ \
|
||||||
|
temp >>= Al; /* apply the point transform */ \
|
||||||
|
if (temp != 0) { \
|
||||||
|
zerobits |= ((size_t)1U) << k; \
|
||||||
|
signbits |= ((size_t)(temp2 + 1)) << k; \
|
||||||
|
} \
|
||||||
|
absvalues[k] = (JCOEF)temp; /* save abs value for main pass */ \
|
||||||
|
if (temp == 1) \
|
||||||
|
EOB = k + koffset; /* EOB = index of last newly-nonzero coef */ \
|
||||||
|
} \
|
||||||
|
}
|
||||||
|
|
||||||
|
METHODDEF(int)
|
||||||
|
encode_mcu_AC_refine_prepare(const JCOEF *block,
|
||||||
|
const int *jpeg_natural_order_start, int Sl,
|
||||||
|
int Al, JCOEF *absvalues, size_t *bits)
|
||||||
|
{
|
||||||
|
register int k, temp, temp2;
|
||||||
|
int EOB = 0;
|
||||||
|
size_t zerobits = 0U, signbits = 0U;
|
||||||
|
int Sl0 = Sl;
|
||||||
|
|
||||||
|
#if SIZEOF_SIZE_T == 4
|
||||||
|
if (Sl0 > 32)
|
||||||
|
Sl0 = 32;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
COMPUTE_ABSVALUES_AC_REFINE(Sl0, 0);
|
||||||
|
|
||||||
|
bits[0] = zerobits;
|
||||||
|
#if SIZEOF_SIZE_T == 8
|
||||||
|
bits[1] = signbits;
|
||||||
|
#else
|
||||||
|
bits[2] = signbits;
|
||||||
|
|
||||||
|
zerobits = 0U;
|
||||||
|
signbits = 0U;
|
||||||
|
|
||||||
|
if (Sl > 32) {
|
||||||
|
Sl -= 32;
|
||||||
|
jpeg_natural_order_start += 32;
|
||||||
|
absvalues += 32;
|
||||||
|
|
||||||
|
COMPUTE_ABSVALUES_AC_REFINE(Sl, 32);
|
||||||
|
}
|
||||||
|
|
||||||
|
bits[1] = zerobits;
|
||||||
|
bits[3] = signbits;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return EOB;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* MCU encoding for AC successive approximation refinement scan.
|
* MCU encoding for AC successive approximation refinement scan.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#define ENCODE_COEFS_AC_REFINE(label) { \
|
||||||
|
while (zerobits) { \
|
||||||
|
int idx = count_zeroes(&zerobits); \
|
||||||
|
r += idx; \
|
||||||
|
cabsvalue += idx; \
|
||||||
|
signbits >>= idx; \
|
||||||
|
label \
|
||||||
|
/* Emit any required ZRLs, but not if they can be folded into EOB */ \
|
||||||
|
while (r > 15 && (cabsvalue <= EOBPTR)) { \
|
||||||
|
/* emit any pending EOBRUN and the BE correction bits */ \
|
||||||
|
emit_eobrun(entropy); \
|
||||||
|
/* Emit ZRL */ \
|
||||||
|
emit_symbol(entropy, entropy->ac_tbl_no, 0xF0); \
|
||||||
|
r -= 16; \
|
||||||
|
/* Emit buffered correction bits that must be associated with ZRL */ \
|
||||||
|
emit_buffered_bits(entropy, BR_buffer, BR); \
|
||||||
|
BR_buffer = entropy->bit_buffer; /* BE bits are gone now */ \
|
||||||
|
BR = 0; \
|
||||||
|
} \
|
||||||
|
\
|
||||||
|
temp = *cabsvalue++; \
|
||||||
|
\
|
||||||
|
/* If the coef was previously nonzero, it only needs a correction bit. \
|
||||||
|
* NOTE: a straight translation of the spec's figure G.7 would suggest \
|
||||||
|
* that we also need to test r > 15. But if r > 15, we can only get here \
|
||||||
|
* if k > EOB, which implies that this coefficient is not 1. \
|
||||||
|
*/ \
|
||||||
|
if (temp > 1) { \
|
||||||
|
/* The correction bit is the next bit of the absolute value. */ \
|
||||||
|
BR_buffer[BR++] = (char)(temp & 1); \
|
||||||
|
signbits >>= 1; \
|
||||||
|
zerobits >>= 1; \
|
||||||
|
continue; \
|
||||||
|
} \
|
||||||
|
\
|
||||||
|
/* Emit any pending EOBRUN and the BE correction bits */ \
|
||||||
|
emit_eobrun(entropy); \
|
||||||
|
\
|
||||||
|
/* Count/emit Huffman symbol for run length / number of bits */ \
|
||||||
|
emit_symbol(entropy, entropy->ac_tbl_no, (r << 4) + 1); \
|
||||||
|
\
|
||||||
|
/* Emit output bit for newly-nonzero coef */ \
|
||||||
|
temp = signbits & 1; /* ((*block)[jpeg_natural_order_start[k]] < 0) ? 0 : 1 */ \
|
||||||
|
emit_bits(entropy, (unsigned int)temp, 1); \
|
||||||
|
\
|
||||||
|
/* Emit buffered correction bits that must be associated with this code */ \
|
||||||
|
emit_buffered_bits(entropy, BR_buffer, BR); \
|
||||||
|
BR_buffer = entropy->bit_buffer; /* BE bits are gone now */ \
|
||||||
|
BR = 0; \
|
||||||
|
r = 0; /* reset zero run length */ \
|
||||||
|
signbits >>= 1; \
|
||||||
|
zerobits >>= 1; \
|
||||||
|
} \
|
||||||
|
}
|
||||||
|
|
||||||
METHODDEF(boolean)
|
METHODDEF(boolean)
|
||||||
encode_mcu_AC_refine(j_compress_ptr cinfo, JBLOCKROW *MCU_data)
|
encode_mcu_AC_refine(j_compress_ptr cinfo, JBLOCKROW *MCU_data)
|
||||||
{
|
{
|
||||||
phuff_entropy_ptr entropy = (phuff_entropy_ptr)cinfo->entropy;
|
phuff_entropy_ptr entropy = (phuff_entropy_ptr)cinfo->entropy;
|
||||||
register int temp;
|
register int temp, r;
|
||||||
register int r, k;
|
|
||||||
int EOB;
|
|
||||||
char *BR_buffer;
|
char *BR_buffer;
|
||||||
unsigned int BR;
|
unsigned int BR;
|
||||||
int Se = cinfo->Se;
|
int Sl = cinfo->Se - cinfo->Ss + 1;
|
||||||
int Al = cinfo->Al;
|
int Al = cinfo->Al;
|
||||||
JBLOCKROW block;
|
JCOEF absvalues_unaligned[DCTSIZE2 + 15];
|
||||||
int absvalues[DCTSIZE2];
|
JCOEF *absvalues;
|
||||||
|
const JCOEF *cabsvalue, *EOBPTR;
|
||||||
|
size_t zerobits, signbits;
|
||||||
|
size_t bits[16 / SIZEOF_SIZE_T];
|
||||||
|
|
||||||
entropy->next_output_byte = cinfo->dest->next_output_byte;
|
entropy->next_output_byte = cinfo->dest->next_output_byte;
|
||||||
entropy->free_in_buffer = cinfo->dest->free_in_buffer;
|
entropy->free_in_buffer = cinfo->dest->free_in_buffer;
|
||||||
@@ -637,26 +936,17 @@ encode_mcu_AC_refine (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
|
|||||||
if (entropy->restarts_to_go == 0)
|
if (entropy->restarts_to_go == 0)
|
||||||
emit_restart(entropy, entropy->next_restart_num);
|
emit_restart(entropy, entropy->next_restart_num);
|
||||||
|
|
||||||
/* Encode the MCU data block */
|
#ifdef WITH_SIMD
|
||||||
block = MCU_data[0];
|
cabsvalue = absvalues = (JCOEF *)PAD((size_t)absvalues_unaligned, 16);
|
||||||
|
#else
|
||||||
|
/* Not using SIMD, so alignment is not needed */
|
||||||
|
cabsvalue = absvalues = absvalues_unaligned;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* It is convenient to make a pre-pass to determine the transformed
|
/* Prepare data */
|
||||||
* coefficients' absolute values and the EOB position.
|
EOBPTR = absvalues +
|
||||||
*/
|
entropy->AC_refine_prepare(MCU_data[0][0], jpeg_natural_order + cinfo->Ss,
|
||||||
EOB = 0;
|
Sl, Al, absvalues, bits);
|
||||||
for (k = cinfo->Ss; k <= Se; k++) {
|
|
||||||
temp = (*block)[jpeg_natural_order[k]];
|
|
||||||
/* We must apply the point transform by Al. For AC coefficients this
|
|
||||||
* is an integer division with rounding towards 0. To do this portably
|
|
||||||
* in C, we shift after obtaining the absolute value.
|
|
||||||
*/
|
|
||||||
if (temp < 0)
|
|
||||||
temp = -temp; /* temp is abs value of input */
|
|
||||||
temp >>= Al; /* apply the point transform */
|
|
||||||
absvalues[k] = temp; /* save abs value for main pass */
|
|
||||||
if (temp == 1)
|
|
||||||
EOB = k; /* EOB = index of last newly-nonzero coef */
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Encode the AC coefficients per section G.1.2.3, fig. G.7 */
|
/* Encode the AC coefficients per section G.1.2.3, fig. G.7 */
|
||||||
|
|
||||||
@@ -664,52 +954,32 @@ encode_mcu_AC_refine (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
|
|||||||
BR = 0; /* BR = count of buffered bits added now */
|
BR = 0; /* BR = count of buffered bits added now */
|
||||||
BR_buffer = entropy->bit_buffer + entropy->BE; /* Append bits to buffer */
|
BR_buffer = entropy->bit_buffer + entropy->BE; /* Append bits to buffer */
|
||||||
|
|
||||||
for (k = cinfo->Ss; k <= Se; k++) {
|
zerobits = bits[0];
|
||||||
if ((temp = absvalues[k]) == 0) {
|
#if SIZEOF_SIZE_T == 8
|
||||||
r++;
|
signbits = bits[1];
|
||||||
continue;
|
#else
|
||||||
|
signbits = bits[2];
|
||||||
|
#endif
|
||||||
|
ENCODE_COEFS_AC_REFINE((void)0;);
|
||||||
|
|
||||||
|
#if SIZEOF_SIZE_T == 4
|
||||||
|
zerobits = bits[1];
|
||||||
|
signbits = bits[3];
|
||||||
|
|
||||||
|
if (zerobits) {
|
||||||
|
int diff = ((absvalues + DCTSIZE2 / 2) - cabsvalue);
|
||||||
|
int idx = count_zeroes(&zerobits);
|
||||||
|
signbits >>= idx;
|
||||||
|
idx += diff;
|
||||||
|
r += idx;
|
||||||
|
cabsvalue += idx;
|
||||||
|
goto first_iter_ac_refine;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Emit any required ZRLs, but not if they can be folded into EOB */
|
ENCODE_COEFS_AC_REFINE(first_iter_ac_refine:);
|
||||||
while (r > 15 && k <= EOB) {
|
#endif
|
||||||
/* emit any pending EOBRUN and the BE correction bits */
|
|
||||||
emit_eobrun(entropy);
|
|
||||||
/* Emit ZRL */
|
|
||||||
emit_symbol(entropy, entropy->ac_tbl_no, 0xF0);
|
|
||||||
r -= 16;
|
|
||||||
/* Emit buffered correction bits that must be associated with ZRL */
|
|
||||||
emit_buffered_bits(entropy, BR_buffer, BR);
|
|
||||||
BR_buffer = entropy->bit_buffer; /* BE bits are gone now */
|
|
||||||
BR = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* If the coef was previously nonzero, it only needs a correction bit.
|
r |= (int)((absvalues + Sl) - cabsvalue);
|
||||||
* NOTE: a straight translation of the spec's figure G.7 would suggest
|
|
||||||
* that we also need to test r > 15. But if r > 15, we can only get here
|
|
||||||
* if k > EOB, which implies that this coefficient is not 1.
|
|
||||||
*/
|
|
||||||
if (temp > 1) {
|
|
||||||
/* The correction bit is the next bit of the absolute value. */
|
|
||||||
BR_buffer[BR++] = (char) (temp & 1);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Emit any pending EOBRUN and the BE correction bits */
|
|
||||||
emit_eobrun(entropy);
|
|
||||||
|
|
||||||
/* Count/emit Huffman symbol for run length / number of bits */
|
|
||||||
emit_symbol(entropy, entropy->ac_tbl_no, (r << 4) + 1);
|
|
||||||
|
|
||||||
/* Emit output bit for newly-nonzero coef */
|
|
||||||
temp = ((*block)[jpeg_natural_order[k]] < 0) ? 0 : 1;
|
|
||||||
emit_bits(entropy, (unsigned int) temp, 1);
|
|
||||||
|
|
||||||
/* Emit buffered correction bits that must be associated with this code */
|
|
||||||
emit_buffered_bits(entropy, BR_buffer, BR);
|
|
||||||
BR_buffer = entropy->bit_buffer; /* BE bits are gone now */
|
|
||||||
BR = 0;
|
|
||||||
r = 0; /* reset zero run length */
|
|
||||||
}
|
|
||||||
|
|
||||||
if (r > 0 || BR > 0) { /* If there are trailing zeroes, */
|
if (r > 0 || BR > 0) { /* If there are trailing zeroes, */
|
||||||
entropy->EOBRUN++; /* count an EOB */
|
entropy->EOBRUN++; /* count an EOB */
|
||||||
@@ -718,7 +988,8 @@ encode_mcu_AC_refine (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
|
|||||||
* 1. overflow of the EOB counter;
|
* 1. overflow of the EOB counter;
|
||||||
* 2. overflow of the correction bit buffer during the next MCU.
|
* 2. overflow of the correction bit buffer during the next MCU.
|
||||||
*/
|
*/
|
||||||
if (entropy->EOBRUN == 0x7FFF || entropy->BE > (MAX_CORR_BITS-DCTSIZE2+1))
|
if (entropy->EOBRUN == 0x7FFF ||
|
||||||
|
entropy->BE > (MAX_CORR_BITS - DCTSIZE2 + 1))
|
||||||
emit_eobrun(entropy);
|
emit_eobrun(entropy);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+13
-19
@@ -106,14 +106,14 @@ start_pass_prep (j_compress_ptr cinfo, J_BUF_MODE pass_mode)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
LOCAL(void)
|
LOCAL(void)
|
||||||
expand_bottom_edge (JSAMPARRAY image_data, JDIMENSION num_cols,
|
expand_bottom_edge(JSAMPARRAY image_data, JDIMENSION num_cols, int input_rows,
|
||||||
int input_rows, int output_rows)
|
int output_rows)
|
||||||
{
|
{
|
||||||
register int row;
|
register int row;
|
||||||
|
|
||||||
for (row = input_rows; row < output_rows; row++) {
|
for (row = input_rows; row < output_rows; row++) {
|
||||||
jcopy_sample_rows(image_data, input_rows-1, image_data, row,
|
jcopy_sample_rows(image_data, input_rows - 1, image_data, row, 1,
|
||||||
1, num_cols);
|
num_cols);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -128,9 +128,8 @@ expand_bottom_edge (JSAMPARRAY image_data, JDIMENSION num_cols,
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
METHODDEF(void)
|
METHODDEF(void)
|
||||||
pre_process_data (j_compress_ptr cinfo,
|
pre_process_data(j_compress_ptr cinfo, JSAMPARRAY input_buf,
|
||||||
JSAMPARRAY input_buf, JDIMENSION *in_row_ctr,
|
JDIMENSION *in_row_ctr, JDIMENSION in_rows_avail,
|
||||||
JDIMENSION in_rows_avail,
|
|
||||||
JSAMPIMAGE output_buf, JDIMENSION *out_row_group_ctr,
|
JSAMPIMAGE output_buf, JDIMENSION *out_row_group_ctr,
|
||||||
JDIMENSION out_row_groups_avail)
|
JDIMENSION out_row_groups_avail)
|
||||||
{
|
{
|
||||||
@@ -172,12 +171,10 @@ pre_process_data (j_compress_ptr cinfo,
|
|||||||
/* If at bottom of image, pad the output to a full iMCU height.
|
/* If at bottom of image, pad the output to a full iMCU height.
|
||||||
* Note we assume the caller is providing a one-iMCU-height output buffer!
|
* Note we assume the caller is providing a one-iMCU-height output buffer!
|
||||||
*/
|
*/
|
||||||
if (prep->rows_to_go == 0 &&
|
if (prep->rows_to_go == 0 && *out_row_group_ctr < out_row_groups_avail) {
|
||||||
*out_row_group_ctr < out_row_groups_avail) {
|
|
||||||
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
|
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
|
||||||
ci++, compptr++) {
|
ci++, compptr++) {
|
||||||
expand_bottom_edge(output_buf[ci],
|
expand_bottom_edge(output_buf[ci], compptr->width_in_blocks * DCTSIZE,
|
||||||
compptr->width_in_blocks * DCTSIZE,
|
|
||||||
(int)(*out_row_group_ctr * compptr->v_samp_factor),
|
(int)(*out_row_group_ctr * compptr->v_samp_factor),
|
||||||
(int)(out_row_groups_avail * compptr->v_samp_factor));
|
(int)(out_row_groups_avail * compptr->v_samp_factor));
|
||||||
}
|
}
|
||||||
@@ -195,9 +192,8 @@ pre_process_data (j_compress_ptr cinfo,
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
METHODDEF(void)
|
METHODDEF(void)
|
||||||
pre_process_context (j_compress_ptr cinfo,
|
pre_process_context(j_compress_ptr cinfo, JSAMPARRAY input_buf,
|
||||||
JSAMPARRAY input_buf, JDIMENSION *in_row_ctr,
|
JDIMENSION *in_row_ctr, JDIMENSION in_rows_avail,
|
||||||
JDIMENSION in_rows_avail,
|
|
||||||
JSAMPIMAGE output_buf, JDIMENSION *out_row_group_ctr,
|
JSAMPIMAGE output_buf, JDIMENSION *out_row_group_ctr,
|
||||||
JDIMENSION out_row_groups_avail)
|
JDIMENSION out_row_groups_avail)
|
||||||
{
|
{
|
||||||
@@ -221,9 +217,8 @@ pre_process_context (j_compress_ptr cinfo,
|
|||||||
for (ci = 0; ci < cinfo->num_components; ci++) {
|
for (ci = 0; ci < cinfo->num_components; ci++) {
|
||||||
int row;
|
int row;
|
||||||
for (row = 1; row <= cinfo->max_v_samp_factor; row++) {
|
for (row = 1; row <= cinfo->max_v_samp_factor; row++) {
|
||||||
jcopy_sample_rows(prep->color_buf[ci], 0,
|
jcopy_sample_rows(prep->color_buf[ci], 0, prep->color_buf[ci],
|
||||||
prep->color_buf[ci], -row,
|
-row, 1, cinfo->image_width);
|
||||||
1, cinfo->image_width);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -245,8 +240,7 @@ pre_process_context (j_compress_ptr cinfo,
|
|||||||
}
|
}
|
||||||
/* If we've gotten enough data, downsample a row group. */
|
/* If we've gotten enough data, downsample a row group. */
|
||||||
if (prep->next_buf_row == prep->next_buf_stop) {
|
if (prep->next_buf_row == prep->next_buf_stop) {
|
||||||
(*cinfo->downsample->downsample) (cinfo,
|
(*cinfo->downsample->downsample) (cinfo, prep->color_buf,
|
||||||
prep->color_buf,
|
|
||||||
(JDIMENSION)prep->this_row_group,
|
(JDIMENSION)prep->this_row_group,
|
||||||
output_buf, *out_row_group_ctr);
|
output_buf, *out_row_group_ctr);
|
||||||
(*out_row_group_ctr)++;
|
(*out_row_group_ctr)++;
|
||||||
|
|||||||
+20
-20
@@ -91,8 +91,8 @@ start_pass_downsample (j_compress_ptr cinfo)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
LOCAL(void)
|
LOCAL(void)
|
||||||
expand_right_edge (JSAMPARRAY image_data, int num_rows,
|
expand_right_edge(JSAMPARRAY image_data, int num_rows, JDIMENSION input_cols,
|
||||||
JDIMENSION input_cols, JDIMENSION output_cols)
|
JDIMENSION output_cols)
|
||||||
{
|
{
|
||||||
register JSAMPROW ptr;
|
register JSAMPROW ptr;
|
||||||
register JSAMPLE pixval;
|
register JSAMPLE pixval;
|
||||||
@@ -118,9 +118,9 @@ expand_right_edge (JSAMPARRAY image_data, int num_rows,
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
METHODDEF(void)
|
METHODDEF(void)
|
||||||
sep_downsample (j_compress_ptr cinfo,
|
sep_downsample(j_compress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||||
JSAMPIMAGE input_buf, JDIMENSION in_row_index,
|
JDIMENSION in_row_index, JSAMPIMAGE output_buf,
|
||||||
JSAMPIMAGE output_buf, JDIMENSION out_row_group_index)
|
JDIMENSION out_row_group_index)
|
||||||
{
|
{
|
||||||
my_downsample_ptr downsample = (my_downsample_ptr)cinfo->downsample;
|
my_downsample_ptr downsample = (my_downsample_ptr)cinfo->downsample;
|
||||||
int ci;
|
int ci;
|
||||||
@@ -162,8 +162,8 @@ int_downsample (j_compress_ptr cinfo, jpeg_component_info *compptr,
|
|||||||
* by the standard loop. Special-casing padded output would be more
|
* by the standard loop. Special-casing padded output would be more
|
||||||
* efficient.
|
* efficient.
|
||||||
*/
|
*/
|
||||||
expand_right_edge(input_data, cinfo->max_v_samp_factor,
|
expand_right_edge(input_data, cinfo->max_v_samp_factor, cinfo->image_width,
|
||||||
cinfo->image_width, output_cols * h_expand);
|
output_cols * h_expand);
|
||||||
|
|
||||||
inrow = 0;
|
inrow = 0;
|
||||||
for (outrow = 0; outrow < compptr->v_samp_factor; outrow++) {
|
for (outrow = 0; outrow < compptr->v_samp_factor; outrow++) {
|
||||||
@@ -195,11 +195,11 @@ fullsize_downsample (j_compress_ptr cinfo, jpeg_component_info *compptr,
|
|||||||
JSAMPARRAY input_data, JSAMPARRAY output_data)
|
JSAMPARRAY input_data, JSAMPARRAY output_data)
|
||||||
{
|
{
|
||||||
/* Copy the data */
|
/* Copy the data */
|
||||||
jcopy_sample_rows(input_data, 0, output_data, 0,
|
jcopy_sample_rows(input_data, 0, output_data, 0, cinfo->max_v_samp_factor,
|
||||||
cinfo->max_v_samp_factor, cinfo->image_width);
|
cinfo->image_width);
|
||||||
/* Edge-expand */
|
/* Edge-expand */
|
||||||
expand_right_edge(output_data, cinfo->max_v_samp_factor,
|
expand_right_edge(output_data, cinfo->max_v_samp_factor, cinfo->image_width,
|
||||||
cinfo->image_width, compptr->width_in_blocks * DCTSIZE);
|
compptr->width_in_blocks * DCTSIZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -229,16 +229,16 @@ h2v1_downsample (j_compress_ptr cinfo, jpeg_component_info *compptr,
|
|||||||
* by the standard loop. Special-casing padded output would be more
|
* by the standard loop. Special-casing padded output would be more
|
||||||
* efficient.
|
* efficient.
|
||||||
*/
|
*/
|
||||||
expand_right_edge(input_data, cinfo->max_v_samp_factor,
|
expand_right_edge(input_data, cinfo->max_v_samp_factor, cinfo->image_width,
|
||||||
cinfo->image_width, output_cols * 2);
|
output_cols * 2);
|
||||||
|
|
||||||
for (outrow = 0; outrow < compptr->v_samp_factor; outrow++) {
|
for (outrow = 0; outrow < compptr->v_samp_factor; outrow++) {
|
||||||
outptr = output_data[outrow];
|
outptr = output_data[outrow];
|
||||||
inptr = input_data[outrow];
|
inptr = input_data[outrow];
|
||||||
bias = 0; /* bias = 0,1,0,1,... for successive samples */
|
bias = 0; /* bias = 0,1,0,1,... for successive samples */
|
||||||
for (outcol = 0; outcol < output_cols; outcol++) {
|
for (outcol = 0; outcol < output_cols; outcol++) {
|
||||||
*outptr++ = (JSAMPLE) ((GETJSAMPLE(*inptr) + GETJSAMPLE(inptr[1])
|
*outptr++ =
|
||||||
+ bias) >> 1);
|
(JSAMPLE)((GETJSAMPLE(*inptr) + GETJSAMPLE(inptr[1]) + bias) >> 1);
|
||||||
bias ^= 1; /* 0=>1, 1=>0 */
|
bias ^= 1; /* 0=>1, 1=>0 */
|
||||||
inptr += 2;
|
inptr += 2;
|
||||||
}
|
}
|
||||||
@@ -266,8 +266,8 @@ h2v2_downsample (j_compress_ptr cinfo, jpeg_component_info *compptr,
|
|||||||
* by the standard loop. Special-casing padded output would be more
|
* by the standard loop. Special-casing padded output would be more
|
||||||
* efficient.
|
* efficient.
|
||||||
*/
|
*/
|
||||||
expand_right_edge(input_data, cinfo->max_v_samp_factor,
|
expand_right_edge(input_data, cinfo->max_v_samp_factor, cinfo->image_width,
|
||||||
cinfo->image_width, output_cols * 2);
|
output_cols * 2);
|
||||||
|
|
||||||
inrow = 0;
|
inrow = 0;
|
||||||
for (outrow = 0; outrow < compptr->v_samp_factor; outrow++) {
|
for (outrow = 0; outrow < compptr->v_samp_factor; outrow++) {
|
||||||
@@ -276,9 +276,9 @@ h2v2_downsample (j_compress_ptr cinfo, jpeg_component_info *compptr,
|
|||||||
inptr1 = input_data[inrow + 1];
|
inptr1 = input_data[inrow + 1];
|
||||||
bias = 1; /* bias = 1,2,1,2,... for successive samples */
|
bias = 1; /* bias = 1,2,1,2,... for successive samples */
|
||||||
for (outcol = 0; outcol < output_cols; outcol++) {
|
for (outcol = 0; outcol < output_cols; outcol++) {
|
||||||
*outptr++ = (JSAMPLE) ((GETJSAMPLE(*inptr0) + GETJSAMPLE(inptr0[1]) +
|
*outptr++ =
|
||||||
GETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[1])
|
(JSAMPLE)((GETJSAMPLE(*inptr0) + GETJSAMPLE(inptr0[1]) +
|
||||||
+ bias) >> 2);
|
GETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[1]) + bias) >> 2);
|
||||||
bias ^= 3; /* 1=>2, 2=>1 */
|
bias ^= 3; /* 1=>2, 2=>1 */
|
||||||
inptr0 += 2; inptr1 += 2;
|
inptr0 += 2; inptr1 += 2;
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+8
-10
@@ -20,10 +20,10 @@
|
|||||||
|
|
||||||
|
|
||||||
/* Forward declarations */
|
/* Forward declarations */
|
||||||
LOCAL(void) transencode_master_selection
|
LOCAL(void) transencode_master_selection(j_compress_ptr cinfo,
|
||||||
(j_compress_ptr cinfo, jvirt_barray_ptr *coef_arrays);
|
jvirt_barray_ptr *coef_arrays);
|
||||||
LOCAL(void) transencode_coef_controller
|
LOCAL(void) transencode_coef_controller(j_compress_ptr cinfo,
|
||||||
(j_compress_ptr cinfo, jvirt_barray_ptr *coef_arrays);
|
jvirt_barray_ptr *coef_arrays);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -64,8 +64,7 @@ jpeg_write_coefficients (j_compress_ptr cinfo, jvirt_barray_ptr *coef_arrays)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
GLOBAL(void)
|
GLOBAL(void)
|
||||||
jpeg_copy_critical_parameters (j_decompress_ptr srcinfo,
|
jpeg_copy_critical_parameters(j_decompress_ptr srcinfo, j_compress_ptr dstinfo)
|
||||||
j_compress_ptr dstinfo)
|
|
||||||
{
|
{
|
||||||
JQUANT_TBL **qtblptr;
|
JQUANT_TBL **qtblptr;
|
||||||
jpeg_component_info *incomp, *outcomp;
|
jpeg_component_info *incomp, *outcomp;
|
||||||
@@ -100,8 +99,7 @@ jpeg_copy_critical_parameters (j_decompress_ptr srcinfo,
|
|||||||
qtblptr = &dstinfo->quant_tbl_ptrs[tblno];
|
qtblptr = &dstinfo->quant_tbl_ptrs[tblno];
|
||||||
if (*qtblptr == NULL)
|
if (*qtblptr == NULL)
|
||||||
*qtblptr = jpeg_alloc_quant_table((j_common_ptr)dstinfo);
|
*qtblptr = jpeg_alloc_quant_table((j_common_ptr)dstinfo);
|
||||||
MEMCOPY((*qtblptr)->quantval,
|
MEMCOPY((*qtblptr)->quantval, srcinfo->quant_tbl_ptrs[tblno]->quantval,
|
||||||
srcinfo->quant_tbl_ptrs[tblno]->quantval,
|
|
||||||
sizeof((*qtblptr)->quantval));
|
sizeof((*qtblptr)->quantval));
|
||||||
(*qtblptr)->sent_table = FALSE;
|
(*qtblptr)->sent_table = FALSE;
|
||||||
}
|
}
|
||||||
@@ -321,8 +319,8 @@ compress_output (j_compress_ptr cinfo, JSAMPIMAGE input_buf)
|
|||||||
for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
|
for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
|
||||||
compptr = cinfo->cur_comp_info[ci];
|
compptr = cinfo->cur_comp_info[ci];
|
||||||
start_col = MCU_col_num * compptr->MCU_width;
|
start_col = MCU_col_num * compptr->MCU_width;
|
||||||
blockcnt = (MCU_col_num < last_MCU_col) ? compptr->MCU_width
|
blockcnt = (MCU_col_num < last_MCU_col) ? compptr->MCU_width :
|
||||||
: compptr->last_col_width;
|
compptr->last_col_width;
|
||||||
for (yindex = 0; yindex < compptr->MCU_height; yindex++) {
|
for (yindex = 0; yindex < compptr->MCU_height; yindex++) {
|
||||||
if (coef->iMCU_row_num < last_iMCU_row ||
|
if (coef->iMCU_row_num < last_iMCU_row ||
|
||||||
yindex + yoffset < compptr->last_row_height) {
|
yindex + yoffset < compptr->last_row_height) {
|
||||||
|
|||||||
+11
-9
@@ -4,7 +4,7 @@
|
|||||||
* This file was part of the Independent JPEG Group's software:
|
* This file was part of the Independent JPEG Group's software:
|
||||||
* Copyright (C) 1994-1996, Thomas G. Lane.
|
* Copyright (C) 1994-1996, Thomas G. Lane.
|
||||||
* libjpeg-turbo Modifications:
|
* libjpeg-turbo Modifications:
|
||||||
* Copyright (C) 2010, 2015-2017, D. R. Commander.
|
* Copyright (C) 2010, 2015-2018, D. R. Commander.
|
||||||
* Copyright (C) 2015, Google, Inc.
|
* Copyright (C) 2015, Google, Inc.
|
||||||
* For conditions of distribution and use, see the accompanying README.ijg
|
* For conditions of distribution and use, see the accompanying README.ijg
|
||||||
* file.
|
* file.
|
||||||
@@ -210,8 +210,7 @@ jpeg_crop_scanline (j_decompress_ptr cinfo, JDIMENSION *xoffset,
|
|||||||
/* Set the first and last iMCU columns that we must decompress. These values
|
/* Set the first and last iMCU columns that we must decompress. These values
|
||||||
* will be used in single-scan decompressions.
|
* will be used in single-scan decompressions.
|
||||||
*/
|
*/
|
||||||
cinfo->master->first_iMCU_col =
|
cinfo->master->first_iMCU_col = (JDIMENSION)(long)(*xoffset) / (long)align;
|
||||||
(JDIMENSION) (long) (*xoffset) / (long) align;
|
|
||||||
cinfo->master->last_iMCU_col =
|
cinfo->master->last_iMCU_col =
|
||||||
(JDIMENSION)jdiv_round_up((long)(*xoffset + cinfo->output_width),
|
(JDIMENSION)jdiv_round_up((long)(*xoffset + cinfo->output_width),
|
||||||
(long)align) - 1;
|
(long)align) - 1;
|
||||||
@@ -236,8 +235,7 @@ jpeg_crop_scanline (j_decompress_ptr cinfo, JDIMENSION *xoffset,
|
|||||||
cinfo->master->first_MCU_col[ci] =
|
cinfo->master->first_MCU_col[ci] =
|
||||||
(JDIMENSION)(long)(*xoffset * hsf) / (long)align;
|
(JDIMENSION)(long)(*xoffset * hsf) / (long)align;
|
||||||
cinfo->master->last_MCU_col[ci] =
|
cinfo->master->last_MCU_col[ci] =
|
||||||
(JDIMENSION) jdiv_round_up((long) ((*xoffset + cinfo->output_width) *
|
(JDIMENSION)jdiv_round_up((long)((*xoffset + cinfo->output_width) * hsf),
|
||||||
hsf),
|
|
||||||
(long)align) - 1;
|
(long)align) - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -320,12 +318,15 @@ read_and_discard_scanlines (j_decompress_ptr cinfo, JDIMENSION num_lines)
|
|||||||
JDIMENSION n;
|
JDIMENSION n;
|
||||||
void (*color_convert) (j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
void (*color_convert) (j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||||
JDIMENSION input_row, JSAMPARRAY output_buf,
|
JDIMENSION input_row, JSAMPARRAY output_buf,
|
||||||
int num_rows);
|
int num_rows) = NULL;
|
||||||
void (*color_quantize) (j_decompress_ptr cinfo, JSAMPARRAY input_buf,
|
void (*color_quantize) (j_decompress_ptr cinfo, JSAMPARRAY input_buf,
|
||||||
JSAMPARRAY output_buf, int num_rows) = NULL;
|
JSAMPARRAY output_buf, int num_rows) = NULL;
|
||||||
|
|
||||||
|
if (cinfo->cconvert && cinfo->cconvert->color_convert) {
|
||||||
color_convert = cinfo->cconvert->color_convert;
|
color_convert = cinfo->cconvert->color_convert;
|
||||||
cinfo->cconvert->color_convert = noop_convert;
|
cinfo->cconvert->color_convert = noop_convert;
|
||||||
|
}
|
||||||
|
|
||||||
if (cinfo->cquantize && cinfo->cquantize->color_quantize) {
|
if (cinfo->cquantize && cinfo->cquantize->color_quantize) {
|
||||||
color_quantize = cinfo->cquantize->color_quantize;
|
color_quantize = cinfo->cquantize->color_quantize;
|
||||||
cinfo->cquantize->color_quantize = noop_quantize;
|
cinfo->cquantize->color_quantize = noop_quantize;
|
||||||
@@ -334,7 +335,9 @@ read_and_discard_scanlines (j_decompress_ptr cinfo, JDIMENSION num_lines)
|
|||||||
for (n = 0; n < num_lines; n++)
|
for (n = 0; n < num_lines; n++)
|
||||||
jpeg_read_scanlines(cinfo, NULL, 1);
|
jpeg_read_scanlines(cinfo, NULL, 1);
|
||||||
|
|
||||||
|
if (color_convert)
|
||||||
cinfo->cconvert->color_convert = color_convert;
|
cinfo->cconvert->color_convert = color_convert;
|
||||||
|
|
||||||
if (color_quantize)
|
if (color_quantize)
|
||||||
cinfo->cquantize->color_quantize = color_quantize;
|
cinfo->cquantize->color_quantize = color_quantize;
|
||||||
}
|
}
|
||||||
@@ -481,7 +484,7 @@ jpeg_skip_scanlines (j_decompress_ptr cinfo, JDIMENSION num_lines)
|
|||||||
if (cinfo->upsample->need_context_rows) {
|
if (cinfo->upsample->need_context_rows) {
|
||||||
cinfo->output_scanline += lines_to_skip;
|
cinfo->output_scanline += lines_to_skip;
|
||||||
cinfo->output_iMCU_row += lines_to_skip / lines_per_iMCU_row;
|
cinfo->output_iMCU_row += lines_to_skip / lines_per_iMCU_row;
|
||||||
main_ptr->iMCU_row_ctr += lines_after_iMCU_row / lines_per_iMCU_row;
|
main_ptr->iMCU_row_ctr += lines_to_skip / lines_per_iMCU_row;
|
||||||
/* It is complex to properly move to the middle of a context block, so
|
/* It is complex to properly move to the middle of a context block, so
|
||||||
* read the remaining lines instead of skipping them.
|
* read the remaining lines instead of skipping them.
|
||||||
*/
|
*/
|
||||||
@@ -595,8 +598,7 @@ jpeg_start_output (j_decompress_ptr cinfo, int scan_number)
|
|||||||
/* Limit scan number to valid range */
|
/* Limit scan number to valid range */
|
||||||
if (scan_number <= 0)
|
if (scan_number <= 0)
|
||||||
scan_number = 1;
|
scan_number = 1;
|
||||||
if (cinfo->inputctl->eoi_reached &&
|
if (cinfo->inputctl->eoi_reached && scan_number > cinfo->input_scan_number)
|
||||||
scan_number > cinfo->input_scan_number)
|
|
||||||
scan_number = cinfo->input_scan_number;
|
scan_number = cinfo->input_scan_number;
|
||||||
cinfo->output_scan_number = scan_number;
|
cinfo->output_scan_number = scan_number;
|
||||||
/* Perform any dummy output passes, and set up for the real pass */
|
/* Perform any dummy output passes, and set up for the real pass */
|
||||||
|
|||||||
Vendored
+10
-6
@@ -4,16 +4,19 @@
|
|||||||
* This file was part of the Independent JPEG Group's software:
|
* This file was part of the Independent JPEG Group's software:
|
||||||
* Developed 1997-2015 by Guido Vollbeding.
|
* Developed 1997-2015 by Guido Vollbeding.
|
||||||
* libjpeg-turbo Modifications:
|
* libjpeg-turbo Modifications:
|
||||||
* Copyright (C) 2015-2016, D. R. Commander.
|
* Copyright (C) 2015-2018, D. R. Commander.
|
||||||
* For conditions of distribution and use, see the accompanying README.ijg
|
* For conditions of distribution and use, see the accompanying README.ijg
|
||||||
* file.
|
* file.
|
||||||
*
|
*
|
||||||
* This file contains portable arithmetic entropy decoding routines for JPEG
|
* This file contains portable arithmetic entropy encoding routines for JPEG
|
||||||
* (implementing the ISO/IEC IS 10918-1 and CCITT Recommendation ITU-T T.81).
|
* (implementing Recommendation ITU-T T.81 | ISO/IEC 10918-1).
|
||||||
*
|
*
|
||||||
* Both sequential and progressive modes are supported in this single module.
|
* Both sequential and progressive modes are supported in this single module.
|
||||||
*
|
*
|
||||||
* Suspension is not currently supported in this module.
|
* Suspension is not currently supported in this module.
|
||||||
|
*
|
||||||
|
* NOTE: All referenced figures are from
|
||||||
|
* Recommendation ITU-T T.81 (1992) | ISO/IEC 10918-1:1994.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define JPEG_INTERNALS
|
#define JPEG_INTERNALS
|
||||||
@@ -306,7 +309,7 @@ decode_mcu_DC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
|
|||||||
while (m >>= 1)
|
while (m >>= 1)
|
||||||
if (arith_decode(cinfo, st)) v |= m;
|
if (arith_decode(cinfo, st)) v |= m;
|
||||||
v += 1; if (sign) v = -v;
|
v += 1; if (sign) v = -v;
|
||||||
entropy->last_dc_val[ci] += v;
|
entropy->last_dc_val[ci] = (entropy->last_dc_val[ci] + v) & 0xffff;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Scale and output the DC coefficient (assumes jpeg_natural_order[0]=0) */
|
/* Scale and output the DC coefficient (assumes jpeg_natural_order[0]=0) */
|
||||||
@@ -564,7 +567,7 @@ decode_mcu (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
|
|||||||
while (m >>= 1)
|
while (m >>= 1)
|
||||||
if (arith_decode(cinfo, st)) v |= m;
|
if (arith_decode(cinfo, st)) v |= m;
|
||||||
v += 1; if (sign) v = -v;
|
v += 1; if (sign) v = -v;
|
||||||
entropy->last_dc_val[ci] += v;
|
entropy->last_dc_val[ci] = (entropy->last_dc_val[ci] + v) & 0xffff;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (block)
|
if (block)
|
||||||
@@ -760,7 +763,8 @@ jinit_arith_decoder (j_decompress_ptr cinfo)
|
|||||||
int *coef_bit_ptr, ci;
|
int *coef_bit_ptr, ci;
|
||||||
cinfo->coef_bits = (int (*)[DCTSIZE2])
|
cinfo->coef_bits = (int (*)[DCTSIZE2])
|
||||||
(*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
|
(*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
|
||||||
cinfo->num_components*DCTSIZE2*sizeof(int));
|
cinfo->num_components * DCTSIZE2 *
|
||||||
|
sizeof(int));
|
||||||
coef_bit_ptr = &cinfo->coef_bits[0][0];
|
coef_bit_ptr = &cinfo->coef_bits[0][0];
|
||||||
for (ci = 0; ci < cinfo->num_components; ci++)
|
for (ci = 0; ci < cinfo->num_components; ci++)
|
||||||
for (i = 0; i < DCTSIZE2; i++)
|
for (i = 0; i < DCTSIZE2; i++)
|
||||||
|
|||||||
+2
-2
@@ -249,8 +249,8 @@ jpeg_stdio_dest (j_compress_ptr cinfo, FILE *outfile)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
GLOBAL(void)
|
GLOBAL(void)
|
||||||
jpeg_mem_dest (j_compress_ptr cinfo,
|
jpeg_mem_dest(j_compress_ptr cinfo, unsigned char **outbuffer,
|
||||||
unsigned char **outbuffer, unsigned long *outsize)
|
unsigned long *outsize)
|
||||||
{
|
{
|
||||||
my_mem_dest_ptr dest;
|
my_mem_dest_ptr dest;
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -260,8 +260,8 @@ jpeg_stdio_src (j_decompress_ptr cinfo, FILE *infile)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
GLOBAL(void)
|
GLOBAL(void)
|
||||||
jpeg_mem_src (j_decompress_ptr cinfo,
|
jpeg_mem_src(j_decompress_ptr cinfo, const unsigned char *inbuffer,
|
||||||
const unsigned char *inbuffer, unsigned long insize)
|
unsigned long insize)
|
||||||
{
|
{
|
||||||
struct jpeg_source_mgr *src;
|
struct jpeg_source_mgr *src;
|
||||||
|
|
||||||
|
|||||||
+11
-12
@@ -25,16 +25,15 @@
|
|||||||
|
|
||||||
|
|
||||||
/* Forward declarations */
|
/* Forward declarations */
|
||||||
METHODDEF(int) decompress_onepass
|
METHODDEF(int) decompress_onepass(j_decompress_ptr cinfo,
|
||||||
(j_decompress_ptr cinfo, JSAMPIMAGE output_buf);
|
JSAMPIMAGE output_buf);
|
||||||
#ifdef D_MULTISCAN_FILES_SUPPORTED
|
#ifdef D_MULTISCAN_FILES_SUPPORTED
|
||||||
METHODDEF(int) decompress_data
|
METHODDEF(int) decompress_data(j_decompress_ptr cinfo, JSAMPIMAGE output_buf);
|
||||||
(j_decompress_ptr cinfo, JSAMPIMAGE output_buf);
|
|
||||||
#endif
|
#endif
|
||||||
#ifdef BLOCK_SMOOTHING_SUPPORTED
|
#ifdef BLOCK_SMOOTHING_SUPPORTED
|
||||||
LOCAL(boolean) smoothing_ok(j_decompress_ptr cinfo);
|
LOCAL(boolean) smoothing_ok(j_decompress_ptr cinfo);
|
||||||
METHODDEF(int) decompress_smooth_data
|
METHODDEF(int) decompress_smooth_data(j_decompress_ptr cinfo,
|
||||||
(j_decompress_ptr cinfo, JSAMPIMAGE output_buf);
|
JSAMPIMAGE output_buf);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
@@ -129,8 +128,8 @@ decompress_onepass (j_decompress_ptr cinfo, JSAMPIMAGE output_buf)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
inverse_DCT = cinfo->idct->inverse_DCT[compptr->component_index];
|
inverse_DCT = cinfo->idct->inverse_DCT[compptr->component_index];
|
||||||
useful_width = (MCU_col_num < last_MCU_col) ? compptr->MCU_width
|
useful_width = (MCU_col_num < last_MCU_col) ?
|
||||||
: compptr->last_col_width;
|
compptr->MCU_width : compptr->last_col_width;
|
||||||
output_ptr = output_buf[compptr->component_index] +
|
output_ptr = output_buf[compptr->component_index] +
|
||||||
yoffset * compptr->_DCT_scaled_size;
|
yoffset * compptr->_DCT_scaled_size;
|
||||||
start_col = (MCU_col_num - cinfo->master->first_iMCU_col) *
|
start_col = (MCU_col_num - cinfo->master->first_iMCU_col) *
|
||||||
@@ -307,8 +306,8 @@ decompress_data (j_decompress_ptr cinfo, JSAMPIMAGE output_buf)
|
|||||||
output_col = 0;
|
output_col = 0;
|
||||||
for (block_num = cinfo->master->first_MCU_col[ci];
|
for (block_num = cinfo->master->first_MCU_col[ci];
|
||||||
block_num <= cinfo->master->last_MCU_col[ci]; block_num++) {
|
block_num <= cinfo->master->last_MCU_col[ci]; block_num++) {
|
||||||
(*inverse_DCT) (cinfo, compptr, (JCOEFPTR) buffer_ptr,
|
(*inverse_DCT) (cinfo, compptr, (JCOEFPTR)buffer_ptr, output_ptr,
|
||||||
output_ptr, output_col);
|
output_col);
|
||||||
buffer_ptr++;
|
buffer_ptr++;
|
||||||
output_col += compptr->_DCT_scaled_size;
|
output_col += compptr->_DCT_scaled_size;
|
||||||
}
|
}
|
||||||
@@ -599,8 +598,8 @@ decompress_smooth_data (j_decompress_ptr cinfo, JSAMPIMAGE output_buf)
|
|||||||
workspace[2] = (JCOEF)pred;
|
workspace[2] = (JCOEF)pred;
|
||||||
}
|
}
|
||||||
/* OK, do the IDCT */
|
/* OK, do the IDCT */
|
||||||
(*inverse_DCT) (cinfo, compptr, (JCOEFPTR) workspace,
|
(*inverse_DCT) (cinfo, compptr, (JCOEFPTR)workspace, output_ptr,
|
||||||
output_ptr, output_col);
|
output_col);
|
||||||
/* Advance for next column */
|
/* Advance for next column */
|
||||||
DC1 = DC2; DC2 = DC3;
|
DC1 = DC2; DC2 = DC3;
|
||||||
DC4 = DC5; DC5 = DC6;
|
DC4 = DC5; DC5 = DC6;
|
||||||
|
|||||||
+18
-18
@@ -17,9 +17,9 @@
|
|||||||
|
|
||||||
INLINE
|
INLINE
|
||||||
LOCAL(void)
|
LOCAL(void)
|
||||||
ycc_rgb565_convert_internal (j_decompress_ptr cinfo,
|
ycc_rgb565_convert_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||||
JSAMPIMAGE input_buf, JDIMENSION input_row,
|
JDIMENSION input_row, JSAMPARRAY output_buf,
|
||||||
JSAMPARRAY output_buf, int num_rows)
|
int num_rows)
|
||||||
{
|
{
|
||||||
my_cconvert_ptr cconvert = (my_cconvert_ptr)cinfo->cconvert;
|
my_cconvert_ptr cconvert = (my_cconvert_ptr)cinfo->cconvert;
|
||||||
register int y, cb, cr;
|
register int y, cb, cr;
|
||||||
@@ -96,9 +96,9 @@ ycc_rgb565_convert_internal (j_decompress_ptr cinfo,
|
|||||||
|
|
||||||
INLINE
|
INLINE
|
||||||
LOCAL(void)
|
LOCAL(void)
|
||||||
ycc_rgb565D_convert_internal (j_decompress_ptr cinfo,
|
ycc_rgb565D_convert_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||||
JSAMPIMAGE input_buf, JDIMENSION input_row,
|
JDIMENSION input_row, JSAMPARRAY output_buf,
|
||||||
JSAMPARRAY output_buf, int num_rows)
|
int num_rows)
|
||||||
{
|
{
|
||||||
my_cconvert_ptr cconvert = (my_cconvert_ptr)cinfo->cconvert;
|
my_cconvert_ptr cconvert = (my_cconvert_ptr)cinfo->cconvert;
|
||||||
register int y, cb, cr;
|
register int y, cb, cr;
|
||||||
@@ -182,9 +182,9 @@ ycc_rgb565D_convert_internal (j_decompress_ptr cinfo,
|
|||||||
|
|
||||||
INLINE
|
INLINE
|
||||||
LOCAL(void)
|
LOCAL(void)
|
||||||
rgb_rgb565_convert_internal (j_decompress_ptr cinfo,
|
rgb_rgb565_convert_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||||
JSAMPIMAGE input_buf, JDIMENSION input_row,
|
JDIMENSION input_row, JSAMPARRAY output_buf,
|
||||||
JSAMPARRAY output_buf, int num_rows)
|
int num_rows)
|
||||||
{
|
{
|
||||||
register JSAMPROW outptr;
|
register JSAMPROW outptr;
|
||||||
register JSAMPROW inptr0, inptr1, inptr2;
|
register JSAMPROW inptr0, inptr1, inptr2;
|
||||||
@@ -237,9 +237,9 @@ rgb_rgb565_convert_internal (j_decompress_ptr cinfo,
|
|||||||
|
|
||||||
INLINE
|
INLINE
|
||||||
LOCAL(void)
|
LOCAL(void)
|
||||||
rgb_rgb565D_convert_internal (j_decompress_ptr cinfo,
|
rgb_rgb565D_convert_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||||
JSAMPIMAGE input_buf, JDIMENSION input_row,
|
JDIMENSION input_row, JSAMPARRAY output_buf,
|
||||||
JSAMPARRAY output_buf, int num_rows)
|
int num_rows)
|
||||||
{
|
{
|
||||||
register JSAMPROW outptr;
|
register JSAMPROW outptr;
|
||||||
register JSAMPROW inptr0, inptr1, inptr2;
|
register JSAMPROW inptr0, inptr1, inptr2;
|
||||||
@@ -296,9 +296,9 @@ rgb_rgb565D_convert_internal (j_decompress_ptr cinfo,
|
|||||||
|
|
||||||
INLINE
|
INLINE
|
||||||
LOCAL(void)
|
LOCAL(void)
|
||||||
gray_rgb565_convert_internal (j_decompress_ptr cinfo,
|
gray_rgb565_convert_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||||
JSAMPIMAGE input_buf, JDIMENSION input_row,
|
JDIMENSION input_row, JSAMPARRAY output_buf,
|
||||||
JSAMPARRAY output_buf, int num_rows)
|
int num_rows)
|
||||||
{
|
{
|
||||||
register JSAMPROW inptr, outptr;
|
register JSAMPROW inptr, outptr;
|
||||||
register JDIMENSION col;
|
register JDIMENSION col;
|
||||||
@@ -336,9 +336,9 @@ gray_rgb565_convert_internal (j_decompress_ptr cinfo,
|
|||||||
|
|
||||||
INLINE
|
INLINE
|
||||||
LOCAL(void)
|
LOCAL(void)
|
||||||
gray_rgb565D_convert_internal (j_decompress_ptr cinfo,
|
gray_rgb565D_convert_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||||
JSAMPIMAGE input_buf, JDIMENSION input_row,
|
JDIMENSION input_row, JSAMPARRAY output_buf,
|
||||||
JSAMPARRAY output_buf, int num_rows)
|
int num_rows)
|
||||||
{
|
{
|
||||||
register JSAMPROW inptr, outptr;
|
register JSAMPROW inptr, outptr;
|
||||||
register JDIMENSION col;
|
register JDIMENSION col;
|
||||||
|
|||||||
+9
-9
@@ -28,9 +28,9 @@
|
|||||||
|
|
||||||
INLINE
|
INLINE
|
||||||
LOCAL(void)
|
LOCAL(void)
|
||||||
ycc_rgb_convert_internal (j_decompress_ptr cinfo,
|
ycc_rgb_convert_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||||
JSAMPIMAGE input_buf, JDIMENSION input_row,
|
JDIMENSION input_row, JSAMPARRAY output_buf,
|
||||||
JSAMPARRAY output_buf, int num_rows)
|
int num_rows)
|
||||||
{
|
{
|
||||||
my_cconvert_ptr cconvert = (my_cconvert_ptr)cinfo->cconvert;
|
my_cconvert_ptr cconvert = (my_cconvert_ptr)cinfo->cconvert;
|
||||||
register int y, cb, cr;
|
register int y, cb, cr;
|
||||||
@@ -81,9 +81,9 @@ ycc_rgb_convert_internal (j_decompress_ptr cinfo,
|
|||||||
|
|
||||||
INLINE
|
INLINE
|
||||||
LOCAL(void)
|
LOCAL(void)
|
||||||
gray_rgb_convert_internal (j_decompress_ptr cinfo,
|
gray_rgb_convert_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||||
JSAMPIMAGE input_buf, JDIMENSION input_row,
|
JDIMENSION input_row, JSAMPARRAY output_buf,
|
||||||
JSAMPARRAY output_buf, int num_rows)
|
int num_rows)
|
||||||
{
|
{
|
||||||
register JSAMPROW inptr, outptr;
|
register JSAMPROW inptr, outptr;
|
||||||
register JDIMENSION col;
|
register JDIMENSION col;
|
||||||
@@ -112,9 +112,9 @@ gray_rgb_convert_internal (j_decompress_ptr cinfo,
|
|||||||
|
|
||||||
INLINE
|
INLINE
|
||||||
LOCAL(void)
|
LOCAL(void)
|
||||||
rgb_rgb_convert_internal (j_decompress_ptr cinfo,
|
rgb_rgb_convert_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||||
JSAMPIMAGE input_buf, JDIMENSION input_row,
|
JDIMENSION input_row, JSAMPARRAY output_buf,
|
||||||
JSAMPARRAY output_buf, int num_rows)
|
int num_rows)
|
||||||
{
|
{
|
||||||
register JSAMPROW inptr0, inptr1, inptr2;
|
register JSAMPROW inptr0, inptr1, inptr2;
|
||||||
register JSAMPROW outptr;
|
register JSAMPROW outptr;
|
||||||
|
|||||||
Vendored
+31
-45
@@ -251,9 +251,8 @@ build_ycc_rgb_table (j_decompress_ptr cinfo)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
METHODDEF(void)
|
METHODDEF(void)
|
||||||
ycc_rgb_convert (j_decompress_ptr cinfo,
|
ycc_rgb_convert(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||||
JSAMPIMAGE input_buf, JDIMENSION input_row,
|
JDIMENSION input_row, JSAMPARRAY output_buf, int num_rows)
|
||||||
JSAMPARRAY output_buf, int num_rows)
|
|
||||||
{
|
{
|
||||||
switch (cinfo->out_color_space) {
|
switch (cinfo->out_color_space) {
|
||||||
case JCS_EXT_RGB:
|
case JCS_EXT_RGB:
|
||||||
@@ -324,9 +323,8 @@ build_rgb_y_table (j_decompress_ptr cinfo)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
METHODDEF(void)
|
METHODDEF(void)
|
||||||
rgb_gray_convert (j_decompress_ptr cinfo,
|
rgb_gray_convert(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||||
JSAMPIMAGE input_buf, JDIMENSION input_row,
|
JDIMENSION input_row, JSAMPARRAY output_buf, int num_rows)
|
||||||
JSAMPARRAY output_buf, int num_rows)
|
|
||||||
{
|
{
|
||||||
my_cconvert_ptr cconvert = (my_cconvert_ptr)cinfo->cconvert;
|
my_cconvert_ptr cconvert = (my_cconvert_ptr)cinfo->cconvert;
|
||||||
register int r, g, b;
|
register int r, g, b;
|
||||||
@@ -347,9 +345,8 @@ rgb_gray_convert (j_decompress_ptr cinfo,
|
|||||||
g = GETJSAMPLE(inptr1[col]);
|
g = GETJSAMPLE(inptr1[col]);
|
||||||
b = GETJSAMPLE(inptr2[col]);
|
b = GETJSAMPLE(inptr2[col]);
|
||||||
/* Y */
|
/* Y */
|
||||||
outptr[col] = (JSAMPLE)
|
outptr[col] = (JSAMPLE)((ctab[r + R_Y_OFF] + ctab[g + G_Y_OFF] +
|
||||||
((ctab[r+R_Y_OFF] + ctab[g+G_Y_OFF] + ctab[b+B_Y_OFF])
|
ctab[b + B_Y_OFF]) >> SCALEBITS);
|
||||||
>> SCALEBITS);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -361,9 +358,8 @@ rgb_gray_convert (j_decompress_ptr cinfo,
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
METHODDEF(void)
|
METHODDEF(void)
|
||||||
null_convert (j_decompress_ptr cinfo,
|
null_convert(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||||
JSAMPIMAGE input_buf, JDIMENSION input_row,
|
JDIMENSION input_row, JSAMPARRAY output_buf, int num_rows)
|
||||||
JSAMPARRAY output_buf, int num_rows)
|
|
||||||
{
|
{
|
||||||
register JSAMPROW inptr, inptr0, inptr1, inptr2, inptr3, outptr;
|
register JSAMPROW inptr, inptr0, inptr1, inptr2, inptr3, outptr;
|
||||||
register JDIMENSION col;
|
register JDIMENSION col;
|
||||||
@@ -423,12 +419,11 @@ null_convert (j_decompress_ptr cinfo,
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
METHODDEF(void)
|
METHODDEF(void)
|
||||||
grayscale_convert (j_decompress_ptr cinfo,
|
grayscale_convert(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||||
JSAMPIMAGE input_buf, JDIMENSION input_row,
|
JDIMENSION input_row, JSAMPARRAY output_buf, int num_rows)
|
||||||
JSAMPARRAY output_buf, int num_rows)
|
|
||||||
{
|
{
|
||||||
jcopy_sample_rows(input_buf[0], (int) input_row, output_buf, 0,
|
jcopy_sample_rows(input_buf[0], (int)input_row, output_buf, 0, num_rows,
|
||||||
num_rows, cinfo->output_width);
|
cinfo->output_width);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -437,9 +432,8 @@ grayscale_convert (j_decompress_ptr cinfo,
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
METHODDEF(void)
|
METHODDEF(void)
|
||||||
gray_rgb_convert (j_decompress_ptr cinfo,
|
gray_rgb_convert(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||||
JSAMPIMAGE input_buf, JDIMENSION input_row,
|
JDIMENSION input_row, JSAMPARRAY output_buf, int num_rows)
|
||||||
JSAMPARRAY output_buf, int num_rows)
|
|
||||||
{
|
{
|
||||||
switch (cinfo->out_color_space) {
|
switch (cinfo->out_color_space) {
|
||||||
case JCS_EXT_RGB:
|
case JCS_EXT_RGB:
|
||||||
@@ -483,9 +477,8 @@ gray_rgb_convert (j_decompress_ptr cinfo,
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
METHODDEF(void)
|
METHODDEF(void)
|
||||||
rgb_rgb_convert (j_decompress_ptr cinfo,
|
rgb_rgb_convert(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||||
JSAMPIMAGE input_buf, JDIMENSION input_row,
|
JDIMENSION input_row, JSAMPARRAY output_buf, int num_rows)
|
||||||
JSAMPARRAY output_buf, int num_rows)
|
|
||||||
{
|
{
|
||||||
switch (cinfo->out_color_space) {
|
switch (cinfo->out_color_space) {
|
||||||
case JCS_EXT_RGB:
|
case JCS_EXT_RGB:
|
||||||
@@ -532,9 +525,8 @@ rgb_rgb_convert (j_decompress_ptr cinfo,
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
METHODDEF(void)
|
METHODDEF(void)
|
||||||
ycck_cmyk_convert (j_decompress_ptr cinfo,
|
ycck_cmyk_convert(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||||
JSAMPIMAGE input_buf, JDIMENSION input_row,
|
JDIMENSION input_row, JSAMPARRAY output_buf, int num_rows)
|
||||||
JSAMPARRAY output_buf, int num_rows)
|
|
||||||
{
|
{
|
||||||
my_cconvert_ptr cconvert = (my_cconvert_ptr)cinfo->cconvert;
|
my_cconvert_ptr cconvert = (my_cconvert_ptr)cinfo->cconvert;
|
||||||
register int y, cb, cr;
|
register int y, cb, cr;
|
||||||
@@ -600,7 +592,7 @@ ycck_cmyk_convert (j_decompress_ptr cinfo,
|
|||||||
/* Declarations for ordered dithering
|
/* Declarations for ordered dithering
|
||||||
*
|
*
|
||||||
* We use a 4x4 ordered dither array packed into 32 bits. This array is
|
* We use a 4x4 ordered dither array packed into 32 bits. This array is
|
||||||
* sufficent for dithering RGB888 to RGB565.
|
* sufficient for dithering RGB888 to RGB565.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define DITHER_MASK 0x3
|
#define DITHER_MASK 0x3
|
||||||
@@ -662,9 +654,8 @@ static INLINE boolean is_big_endian(void)
|
|||||||
|
|
||||||
|
|
||||||
METHODDEF(void)
|
METHODDEF(void)
|
||||||
ycc_rgb565_convert (j_decompress_ptr cinfo,
|
ycc_rgb565_convert(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||||
JSAMPIMAGE input_buf, JDIMENSION input_row,
|
JDIMENSION input_row, JSAMPARRAY output_buf, int num_rows)
|
||||||
JSAMPARRAY output_buf, int num_rows)
|
|
||||||
{
|
{
|
||||||
if (is_big_endian())
|
if (is_big_endian())
|
||||||
ycc_rgb565_convert_be(cinfo, input_buf, input_row, output_buf, num_rows);
|
ycc_rgb565_convert_be(cinfo, input_buf, input_row, output_buf, num_rows);
|
||||||
@@ -674,9 +665,8 @@ ycc_rgb565_convert (j_decompress_ptr cinfo,
|
|||||||
|
|
||||||
|
|
||||||
METHODDEF(void)
|
METHODDEF(void)
|
||||||
ycc_rgb565D_convert (j_decompress_ptr cinfo,
|
ycc_rgb565D_convert(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||||
JSAMPIMAGE input_buf, JDIMENSION input_row,
|
JDIMENSION input_row, JSAMPARRAY output_buf, int num_rows)
|
||||||
JSAMPARRAY output_buf, int num_rows)
|
|
||||||
{
|
{
|
||||||
if (is_big_endian())
|
if (is_big_endian())
|
||||||
ycc_rgb565D_convert_be(cinfo, input_buf, input_row, output_buf, num_rows);
|
ycc_rgb565D_convert_be(cinfo, input_buf, input_row, output_buf, num_rows);
|
||||||
@@ -686,9 +676,8 @@ ycc_rgb565D_convert (j_decompress_ptr cinfo,
|
|||||||
|
|
||||||
|
|
||||||
METHODDEF(void)
|
METHODDEF(void)
|
||||||
rgb_rgb565_convert (j_decompress_ptr cinfo,
|
rgb_rgb565_convert(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||||
JSAMPIMAGE input_buf, JDIMENSION input_row,
|
JDIMENSION input_row, JSAMPARRAY output_buf, int num_rows)
|
||||||
JSAMPARRAY output_buf, int num_rows)
|
|
||||||
{
|
{
|
||||||
if (is_big_endian())
|
if (is_big_endian())
|
||||||
rgb_rgb565_convert_be(cinfo, input_buf, input_row, output_buf, num_rows);
|
rgb_rgb565_convert_be(cinfo, input_buf, input_row, output_buf, num_rows);
|
||||||
@@ -698,9 +687,8 @@ rgb_rgb565_convert (j_decompress_ptr cinfo,
|
|||||||
|
|
||||||
|
|
||||||
METHODDEF(void)
|
METHODDEF(void)
|
||||||
rgb_rgb565D_convert (j_decompress_ptr cinfo,
|
rgb_rgb565D_convert(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||||
JSAMPIMAGE input_buf, JDIMENSION input_row,
|
JDIMENSION input_row, JSAMPARRAY output_buf, int num_rows)
|
||||||
JSAMPARRAY output_buf, int num_rows)
|
|
||||||
{
|
{
|
||||||
if (is_big_endian())
|
if (is_big_endian())
|
||||||
rgb_rgb565D_convert_be(cinfo, input_buf, input_row, output_buf, num_rows);
|
rgb_rgb565D_convert_be(cinfo, input_buf, input_row, output_buf, num_rows);
|
||||||
@@ -710,9 +698,8 @@ rgb_rgb565D_convert (j_decompress_ptr cinfo,
|
|||||||
|
|
||||||
|
|
||||||
METHODDEF(void)
|
METHODDEF(void)
|
||||||
gray_rgb565_convert (j_decompress_ptr cinfo,
|
gray_rgb565_convert(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||||
JSAMPIMAGE input_buf, JDIMENSION input_row,
|
JDIMENSION input_row, JSAMPARRAY output_buf, int num_rows)
|
||||||
JSAMPARRAY output_buf, int num_rows)
|
|
||||||
{
|
{
|
||||||
if (is_big_endian())
|
if (is_big_endian())
|
||||||
gray_rgb565_convert_be(cinfo, input_buf, input_row, output_buf, num_rows);
|
gray_rgb565_convert_be(cinfo, input_buf, input_row, output_buf, num_rows);
|
||||||
@@ -722,9 +709,8 @@ gray_rgb565_convert (j_decompress_ptr cinfo,
|
|||||||
|
|
||||||
|
|
||||||
METHODDEF(void)
|
METHODDEF(void)
|
||||||
gray_rgb565D_convert (j_decompress_ptr cinfo,
|
gray_rgb565D_convert(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||||
JSAMPIMAGE input_buf, JDIMENSION input_row,
|
JDIMENSION input_row, JSAMPARRAY output_buf, int num_rows)
|
||||||
JSAMPARRAY output_buf, int num_rows)
|
|
||||||
{
|
{
|
||||||
if (is_big_endian())
|
if (is_big_endian())
|
||||||
gray_rgb565D_convert_be(cinfo, input_buf, input_row, output_buf, num_rows);
|
gray_rgb565D_convert_be(cinfo, input_buf, input_row, output_buf, num_rows);
|
||||||
|
|||||||
Vendored
+54
-54
@@ -94,60 +94,60 @@ EXTERN(void) jpeg_fdct_islow (DCTELEM *data);
|
|||||||
EXTERN(void) jpeg_fdct_ifast(DCTELEM *data);
|
EXTERN(void) jpeg_fdct_ifast(DCTELEM *data);
|
||||||
EXTERN(void) jpeg_fdct_float(FAST_FLOAT *data);
|
EXTERN(void) jpeg_fdct_float(FAST_FLOAT *data);
|
||||||
|
|
||||||
EXTERN(void) jpeg_idct_islow
|
EXTERN(void) jpeg_idct_islow(j_decompress_ptr cinfo,
|
||||||
(j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
jpeg_component_info *compptr, JCOEFPTR coef_block,
|
||||||
JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col);
|
JSAMPARRAY output_buf, JDIMENSION output_col);
|
||||||
EXTERN(void) jpeg_idct_ifast
|
EXTERN(void) jpeg_idct_ifast(j_decompress_ptr cinfo,
|
||||||
(j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
jpeg_component_info *compptr, JCOEFPTR coef_block,
|
||||||
JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col);
|
JSAMPARRAY output_buf, JDIMENSION output_col);
|
||||||
EXTERN(void) jpeg_idct_float
|
EXTERN(void) jpeg_idct_float(j_decompress_ptr cinfo,
|
||||||
(j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
jpeg_component_info *compptr, JCOEFPTR coef_block,
|
||||||
JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col);
|
JSAMPARRAY output_buf, JDIMENSION output_col);
|
||||||
EXTERN(void) jpeg_idct_7x7
|
EXTERN(void) jpeg_idct_7x7(j_decompress_ptr cinfo,
|
||||||
(j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
jpeg_component_info *compptr, JCOEFPTR coef_block,
|
||||||
JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col);
|
JSAMPARRAY output_buf, JDIMENSION output_col);
|
||||||
EXTERN(void) jpeg_idct_6x6
|
EXTERN(void) jpeg_idct_6x6(j_decompress_ptr cinfo,
|
||||||
(j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
jpeg_component_info *compptr, JCOEFPTR coef_block,
|
||||||
JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col);
|
JSAMPARRAY output_buf, JDIMENSION output_col);
|
||||||
EXTERN(void) jpeg_idct_5x5
|
EXTERN(void) jpeg_idct_5x5(j_decompress_ptr cinfo,
|
||||||
(j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
jpeg_component_info *compptr, JCOEFPTR coef_block,
|
||||||
JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col);
|
JSAMPARRAY output_buf, JDIMENSION output_col);
|
||||||
EXTERN(void) jpeg_idct_4x4
|
EXTERN(void) jpeg_idct_4x4(j_decompress_ptr cinfo,
|
||||||
(j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
jpeg_component_info *compptr, JCOEFPTR coef_block,
|
||||||
JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col);
|
JSAMPARRAY output_buf, JDIMENSION output_col);
|
||||||
EXTERN(void) jpeg_idct_3x3
|
EXTERN(void) jpeg_idct_3x3(j_decompress_ptr cinfo,
|
||||||
(j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
jpeg_component_info *compptr, JCOEFPTR coef_block,
|
||||||
JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col);
|
JSAMPARRAY output_buf, JDIMENSION output_col);
|
||||||
EXTERN(void) jpeg_idct_2x2
|
EXTERN(void) jpeg_idct_2x2(j_decompress_ptr cinfo,
|
||||||
(j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
jpeg_component_info *compptr, JCOEFPTR coef_block,
|
||||||
JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col);
|
JSAMPARRAY output_buf, JDIMENSION output_col);
|
||||||
EXTERN(void) jpeg_idct_1x1
|
EXTERN(void) jpeg_idct_1x1(j_decompress_ptr cinfo,
|
||||||
(j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
jpeg_component_info *compptr, JCOEFPTR coef_block,
|
||||||
JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col);
|
JSAMPARRAY output_buf, JDIMENSION output_col);
|
||||||
EXTERN(void) jpeg_idct_9x9
|
EXTERN(void) jpeg_idct_9x9(j_decompress_ptr cinfo,
|
||||||
(j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
jpeg_component_info *compptr, JCOEFPTR coef_block,
|
||||||
JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col);
|
JSAMPARRAY output_buf, JDIMENSION output_col);
|
||||||
EXTERN(void) jpeg_idct_10x10
|
EXTERN(void) jpeg_idct_10x10(j_decompress_ptr cinfo,
|
||||||
(j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
jpeg_component_info *compptr, JCOEFPTR coef_block,
|
||||||
JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col);
|
JSAMPARRAY output_buf, JDIMENSION output_col);
|
||||||
EXTERN(void) jpeg_idct_11x11
|
EXTERN(void) jpeg_idct_11x11(j_decompress_ptr cinfo,
|
||||||
(j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
jpeg_component_info *compptr, JCOEFPTR coef_block,
|
||||||
JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col);
|
JSAMPARRAY output_buf, JDIMENSION output_col);
|
||||||
EXTERN(void) jpeg_idct_12x12
|
EXTERN(void) jpeg_idct_12x12(j_decompress_ptr cinfo,
|
||||||
(j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
jpeg_component_info *compptr, JCOEFPTR coef_block,
|
||||||
JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col);
|
JSAMPARRAY output_buf, JDIMENSION output_col);
|
||||||
EXTERN(void) jpeg_idct_13x13
|
EXTERN(void) jpeg_idct_13x13(j_decompress_ptr cinfo,
|
||||||
(j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
jpeg_component_info *compptr, JCOEFPTR coef_block,
|
||||||
JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col);
|
JSAMPARRAY output_buf, JDIMENSION output_col);
|
||||||
EXTERN(void) jpeg_idct_14x14
|
EXTERN(void) jpeg_idct_14x14(j_decompress_ptr cinfo,
|
||||||
(j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
jpeg_component_info *compptr, JCOEFPTR coef_block,
|
||||||
JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col);
|
JSAMPARRAY output_buf, JDIMENSION output_col);
|
||||||
EXTERN(void) jpeg_idct_15x15
|
EXTERN(void) jpeg_idct_15x15(j_decompress_ptr cinfo,
|
||||||
(j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
jpeg_component_info *compptr, JCOEFPTR coef_block,
|
||||||
JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col);
|
JSAMPARRAY output_buf, JDIMENSION output_col);
|
||||||
EXTERN(void) jpeg_idct_16x16
|
EXTERN(void) jpeg_idct_16x16(j_decompress_ptr cinfo,
|
||||||
(j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
jpeg_component_info *compptr, JCOEFPTR coef_block,
|
||||||
JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col);
|
JSAMPARRAY output_buf, JDIMENSION output_col);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
Vendored
+21
-16
@@ -4,7 +4,7 @@
|
|||||||
* This file was part of the Independent JPEG Group's software:
|
* This file was part of the Independent JPEG Group's software:
|
||||||
* Copyright (C) 1991-1997, Thomas G. Lane.
|
* Copyright (C) 1991-1997, Thomas G. Lane.
|
||||||
* libjpeg-turbo Modifications:
|
* libjpeg-turbo Modifications:
|
||||||
* Copyright (C) 2009-2011, 2016, D. R. Commander.
|
* Copyright (C) 2009-2011, 2016, 2018, D. R. Commander.
|
||||||
* For conditions of distribution and use, see the accompanying README.ijg
|
* For conditions of distribution and use, see the accompanying README.ijg
|
||||||
* file.
|
* file.
|
||||||
*
|
*
|
||||||
@@ -15,6 +15,9 @@
|
|||||||
* up to the start of the current MCU. To do this, we copy state variables
|
* up to the start of the current MCU. To do this, we copy state variables
|
||||||
* into local working storage, and update them back to the permanent
|
* into local working storage, and update them back to the permanent
|
||||||
* storage only upon successful completion of an MCU.
|
* storage only upon successful completion of an MCU.
|
||||||
|
*
|
||||||
|
* NOTE: All referenced figures are from
|
||||||
|
* Recommendation ITU-T T.81 (1992) | ISO/IEC 10918-1:1994.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define JPEG_INTERNALS
|
#define JPEG_INTERNALS
|
||||||
@@ -400,8 +403,7 @@ jpeg_fill_bit_buffer (bitread_working_state *state,
|
|||||||
handle markers. We have to hand off any blocks with markers to the
|
handle markers. We have to hand off any blocks with markers to the
|
||||||
slower routines. */
|
slower routines. */
|
||||||
|
|
||||||
#define GET_BYTE \
|
#define GET_BYTE { \
|
||||||
{ \
|
|
||||||
register int c0, c1; \
|
register int c0, c1; \
|
||||||
c0 = GETJOCTET(*buffer++); \
|
c0 = GETJOCTET(*buffer++); \
|
||||||
c1 = GETJOCTET(*buffer); \
|
c1 = GETJOCTET(*buffer); \
|
||||||
@@ -460,7 +462,7 @@ jpeg_huff_decode (bitread_working_state *state,
|
|||||||
code = GET_BITS(l);
|
code = GET_BITS(l);
|
||||||
|
|
||||||
/* Collect the rest of the Huffman code one bit at a time. */
|
/* Collect the rest of the Huffman code one bit at a time. */
|
||||||
/* This is per Figure F.16 in the JPEG spec. */
|
/* This is per Figure F.16. */
|
||||||
|
|
||||||
while (code > htbl->maxcode[l]) {
|
while (code > htbl->maxcode[l]) {
|
||||||
code <<= 1;
|
code <<= 1;
|
||||||
@@ -493,21 +495,25 @@ jpeg_huff_decode (bitread_working_state *state,
|
|||||||
#ifdef AVOID_TABLES
|
#ifdef AVOID_TABLES
|
||||||
|
|
||||||
#define NEG_1 ((unsigned int)-1)
|
#define NEG_1 ((unsigned int)-1)
|
||||||
#define HUFF_EXTEND(x,s) ((x) + ((((x) - (1<<((s)-1))) >> 31) & (((NEG_1)<<(s)) + 1)))
|
#define HUFF_EXTEND(x, s) \
|
||||||
|
((x) + ((((x) - (1 << ((s) - 1))) >> 31) & (((NEG_1) << (s)) + 1)))
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
#define HUFF_EXTEND(x,s) ((x) < extend_test[s] ? (x) + extend_offset[s] : (x))
|
#define HUFF_EXTEND(x, s) \
|
||||||
|
((x) < extend_test[s] ? (x) + extend_offset[s] : (x))
|
||||||
|
|
||||||
static const int extend_test[16] = /* entry n is 2**(n-1) */
|
static const int extend_test[16] = { /* entry n is 2**(n-1) */
|
||||||
{ 0, 0x0001, 0x0002, 0x0004, 0x0008, 0x0010, 0x0020, 0x0040, 0x0080,
|
0, 0x0001, 0x0002, 0x0004, 0x0008, 0x0010, 0x0020, 0x0040, 0x0080,
|
||||||
0x0100, 0x0200, 0x0400, 0x0800, 0x1000, 0x2000, 0x4000 };
|
0x0100, 0x0200, 0x0400, 0x0800, 0x1000, 0x2000, 0x4000
|
||||||
|
};
|
||||||
|
|
||||||
static const int extend_offset[16] = /* entry n is (-1 << n) + 1 */
|
static const int extend_offset[16] = { /* entry n is (-1 << n) + 1 */
|
||||||
{ 0, ((-1)<<1) + 1, ((-1)<<2) + 1, ((-1)<<3) + 1, ((-1)<<4) + 1,
|
0, ((-1) << 1) + 1, ((-1) << 2) + 1, ((-1) << 3) + 1, ((-1) << 4) + 1,
|
||||||
((-1) << 5) + 1, ((-1) << 6) + 1, ((-1) << 7) + 1, ((-1) << 8) + 1,
|
((-1) << 5) + 1, ((-1) << 6) + 1, ((-1) << 7) + 1, ((-1) << 8) + 1,
|
||||||
((-1) << 9) + 1, ((-1) << 10) + 1, ((-1) << 11) + 1, ((-1) << 12) + 1,
|
((-1) << 9) + 1, ((-1) << 10) + 1, ((-1) << 11) + 1, ((-1) << 12) + 1,
|
||||||
((-1)<<13) + 1, ((-1)<<14) + 1, ((-1)<<15) + 1 };
|
((-1) << 13) + 1, ((-1) << 14) + 1, ((-1) << 15) + 1
|
||||||
|
};
|
||||||
|
|
||||||
#endif /* AVOID_TABLES */
|
#endif /* AVOID_TABLES */
|
||||||
|
|
||||||
@@ -766,8 +772,8 @@ decode_mcu (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
|
|||||||
usefast = 0;
|
usefast = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cinfo->src->bytes_in_buffer < BUFSIZE * (size_t)cinfo->blocks_in_MCU
|
if (cinfo->src->bytes_in_buffer < BUFSIZE * (size_t)cinfo->blocks_in_MCU ||
|
||||||
|| cinfo->unread_marker != 0)
|
cinfo->unread_marker != 0)
|
||||||
usefast = 0;
|
usefast = 0;
|
||||||
|
|
||||||
/* If we've run out of data, just leave the MCU set to zeroes.
|
/* If we've run out of data, just leave the MCU set to zeroes.
|
||||||
@@ -777,8 +783,7 @@ decode_mcu (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
|
|||||||
|
|
||||||
if (usefast) {
|
if (usefast) {
|
||||||
if (!decode_mcu_fast(cinfo, MCU_data)) goto use_slow;
|
if (!decode_mcu_fast(cinfo, MCU_data)) goto use_slow;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
use_slow:
|
use_slow:
|
||||||
if (!decode_mcu_slow(cinfo, MCU_data)) return FALSE;
|
if (!decode_mcu_slow(cinfo, MCU_data)) return FALSE;
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+19
-15
@@ -47,9 +47,8 @@ typedef struct {
|
|||||||
} d_derived_tbl;
|
} d_derived_tbl;
|
||||||
|
|
||||||
/* Expand a Huffman table definition into the derived format */
|
/* Expand a Huffman table definition into the derived format */
|
||||||
EXTERN(void) jpeg_make_d_derived_tbl
|
EXTERN(void) jpeg_make_d_derived_tbl(j_decompress_ptr cinfo, boolean isDC,
|
||||||
(j_decompress_ptr cinfo, boolean isDC, int tblno,
|
int tblno, d_derived_tbl **pdtbl);
|
||||||
d_derived_tbl ** pdtbl);
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -149,11 +148,13 @@ typedef struct { /* Bitreading working state within an MCU */
|
|||||||
* is evaluated multiple times.
|
* is evaluated multiple times.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define CHECK_BIT_BUFFER(state,nbits,action) \
|
#define CHECK_BIT_BUFFER(state, nbits, action) { \
|
||||||
{ if (bits_left < (nbits)) { \
|
if (bits_left < (nbits)) { \
|
||||||
if (!jpeg_fill_bit_buffer(&(state), get_buffer, bits_left, nbits)) \
|
if (!jpeg_fill_bit_buffer(&(state), get_buffer, bits_left, nbits)) \
|
||||||
{ action; } \
|
{ action; } \
|
||||||
get_buffer = (state).get_buffer; bits_left = (state).bits_left; } }
|
get_buffer = (state).get_buffer; bits_left = (state).bits_left; \
|
||||||
|
} \
|
||||||
|
}
|
||||||
|
|
||||||
#define GET_BITS(nbits) \
|
#define GET_BITS(nbits) \
|
||||||
(((int)(get_buffer >> (bits_left -= (nbits)))) & ((1 << (nbits)) - 1))
|
(((int)(get_buffer >> (bits_left -= (nbits)))) & ((1 << (nbits)) - 1))
|
||||||
@@ -165,8 +166,8 @@ typedef struct { /* Bitreading working state within an MCU */
|
|||||||
(bits_left -= (nbits))
|
(bits_left -= (nbits))
|
||||||
|
|
||||||
/* Load up the bit buffer to a depth of at least nbits */
|
/* Load up the bit buffer to a depth of at least nbits */
|
||||||
EXTERN(boolean) jpeg_fill_bit_buffer
|
EXTERN(boolean) jpeg_fill_bit_buffer(bitread_working_state *state,
|
||||||
(bitread_working_state *state, register bit_buf_type get_buffer,
|
register bit_buf_type get_buffer,
|
||||||
register int bits_left, int nbits);
|
register int bits_left, int nbits);
|
||||||
|
|
||||||
|
|
||||||
@@ -187,10 +188,11 @@ EXTERN(boolean) jpeg_fill_bit_buffer
|
|||||||
* 3. jpeg_huff_decode returns -1 if forced to suspend.
|
* 3. jpeg_huff_decode returns -1 if forced to suspend.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define HUFF_DECODE(result,state,htbl,failaction,slowlabel) \
|
#define HUFF_DECODE(result, state, htbl, failaction, slowlabel) { \
|
||||||
{ register int nb, look; \
|
register int nb, look; \
|
||||||
if (bits_left < HUFF_LOOKAHEAD) { \
|
if (bits_left < HUFF_LOOKAHEAD) { \
|
||||||
if (! jpeg_fill_bit_buffer(&state,get_buffer,bits_left, 0)) {failaction;} \
|
if (!jpeg_fill_bit_buffer(&state, get_buffer, bits_left, 0)) \
|
||||||
|
{ failaction; } \
|
||||||
get_buffer = state.get_buffer; bits_left = state.bits_left; \
|
get_buffer = state.get_buffer; bits_left = state.bits_left; \
|
||||||
if (bits_left < HUFF_LOOKAHEAD) { \
|
if (bits_left < HUFF_LOOKAHEAD) { \
|
||||||
nb = 1; goto slowlabel; \
|
nb = 1; goto slowlabel; \
|
||||||
@@ -202,7 +204,8 @@ EXTERN(boolean) jpeg_fill_bit_buffer
|
|||||||
result = htbl->lookup[look] & ((1 << HUFF_LOOKAHEAD) - 1); \
|
result = htbl->lookup[look] & ((1 << HUFF_LOOKAHEAD) - 1); \
|
||||||
} else { \
|
} else { \
|
||||||
slowlabel: \
|
slowlabel: \
|
||||||
if ((result=jpeg_huff_decode(&state,get_buffer,bits_left,htbl,nb)) < 0) \
|
if ((result = \
|
||||||
|
jpeg_huff_decode(&state, get_buffer, bits_left, htbl, nb)) < 0) \
|
||||||
{ failaction; } \
|
{ failaction; } \
|
||||||
get_buffer = state.get_buffer; bits_left = state.bits_left; \
|
get_buffer = state.get_buffer; bits_left = state.bits_left; \
|
||||||
} \
|
} \
|
||||||
@@ -229,6 +232,7 @@ slowlabel: \
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Out-of-line case for Huffman code fetching */
|
/* Out-of-line case for Huffman code fetching */
|
||||||
EXTERN(int) jpeg_huff_decode
|
EXTERN(int) jpeg_huff_decode(bitread_working_state *state,
|
||||||
(bitread_working_state *state, register bit_buf_type get_buffer,
|
register bit_buf_type get_buffer,
|
||||||
register int bits_left, d_derived_tbl *htbl, int min_bits);
|
register int bits_left, d_derived_tbl *htbl,
|
||||||
|
int min_bits);
|
||||||
|
|||||||
Vendored
+171
@@ -0,0 +1,171 @@
|
|||||||
|
/*
|
||||||
|
* jdicc.c
|
||||||
|
*
|
||||||
|
* Copyright (C) 1997-1998, Thomas G. Lane, Todd Newman.
|
||||||
|
* Copyright (C) 2017, D. R. Commander.
|
||||||
|
* For conditions of distribution and use, see the accompanying README.ijg
|
||||||
|
* file.
|
||||||
|
*
|
||||||
|
* This file provides code to read International Color Consortium (ICC) device
|
||||||
|
* profiles embedded in JFIF JPEG image files. The ICC has defined a standard
|
||||||
|
* for including such data in JPEG "APP2" markers. The code given here does
|
||||||
|
* not know anything about the internal structure of the ICC profile data; it
|
||||||
|
* just knows how to get the profile data from a JPEG file while reading it.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define JPEG_INTERNALS
|
||||||
|
#include "jinclude.h"
|
||||||
|
#include "jpeglib.h"
|
||||||
|
#include "jerror.h"
|
||||||
|
|
||||||
|
#ifndef HAVE_STDLIB_H /* <stdlib.h> should declare malloc() */
|
||||||
|
extern void *malloc(size_t size);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#define ICC_MARKER (JPEG_APP0 + 2) /* JPEG marker code for ICC */
|
||||||
|
#define ICC_OVERHEAD_LEN 14 /* size of non-profile data in APP2 */
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Handy subroutine to test whether a saved marker is an ICC profile marker.
|
||||||
|
*/
|
||||||
|
|
||||||
|
LOCAL(boolean)
|
||||||
|
marker_is_icc(jpeg_saved_marker_ptr marker)
|
||||||
|
{
|
||||||
|
return
|
||||||
|
marker->marker == ICC_MARKER &&
|
||||||
|
marker->data_length >= ICC_OVERHEAD_LEN &&
|
||||||
|
/* verify the identifying string */
|
||||||
|
GETJOCTET(marker->data[0]) == 0x49 &&
|
||||||
|
GETJOCTET(marker->data[1]) == 0x43 &&
|
||||||
|
GETJOCTET(marker->data[2]) == 0x43 &&
|
||||||
|
GETJOCTET(marker->data[3]) == 0x5F &&
|
||||||
|
GETJOCTET(marker->data[4]) == 0x50 &&
|
||||||
|
GETJOCTET(marker->data[5]) == 0x52 &&
|
||||||
|
GETJOCTET(marker->data[6]) == 0x4F &&
|
||||||
|
GETJOCTET(marker->data[7]) == 0x46 &&
|
||||||
|
GETJOCTET(marker->data[8]) == 0x49 &&
|
||||||
|
GETJOCTET(marker->data[9]) == 0x4C &&
|
||||||
|
GETJOCTET(marker->data[10]) == 0x45 &&
|
||||||
|
GETJOCTET(marker->data[11]) == 0x0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* See if there was an ICC profile in the JPEG file being read; if so,
|
||||||
|
* reassemble and return the profile data.
|
||||||
|
*
|
||||||
|
* TRUE is returned if an ICC profile was found, FALSE if not. If TRUE is
|
||||||
|
* returned, *icc_data_ptr is set to point to the returned data, and
|
||||||
|
* *icc_data_len is set to its length.
|
||||||
|
*
|
||||||
|
* IMPORTANT: the data at *icc_data_ptr is allocated with malloc() and must be
|
||||||
|
* freed by the caller with free() when the caller no longer needs it.
|
||||||
|
* (Alternatively, we could write this routine to use the IJG library's memory
|
||||||
|
* allocator, so that the data would be freed implicitly when
|
||||||
|
* jpeg_finish_decompress() is called. But it seems likely that many
|
||||||
|
* applications will prefer to have the data stick around after decompression
|
||||||
|
* finishes.)
|
||||||
|
*/
|
||||||
|
|
||||||
|
GLOBAL(boolean)
|
||||||
|
jpeg_read_icc_profile(j_decompress_ptr cinfo, JOCTET **icc_data_ptr,
|
||||||
|
unsigned int *icc_data_len)
|
||||||
|
{
|
||||||
|
jpeg_saved_marker_ptr marker;
|
||||||
|
int num_markers = 0;
|
||||||
|
int seq_no;
|
||||||
|
JOCTET *icc_data;
|
||||||
|
unsigned int total_length;
|
||||||
|
#define MAX_SEQ_NO 255 /* sufficient since marker numbers are bytes */
|
||||||
|
char marker_present[MAX_SEQ_NO + 1]; /* 1 if marker found */
|
||||||
|
unsigned int data_length[MAX_SEQ_NO + 1]; /* size of profile data in marker */
|
||||||
|
unsigned int data_offset[MAX_SEQ_NO + 1]; /* offset for data in marker */
|
||||||
|
|
||||||
|
if (icc_data_ptr == NULL || icc_data_len == NULL)
|
||||||
|
ERREXIT(cinfo, JERR_BUFFER_SIZE);
|
||||||
|
if (cinfo->global_state < DSTATE_READY)
|
||||||
|
ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
|
||||||
|
|
||||||
|
*icc_data_ptr = NULL; /* avoid confusion if FALSE return */
|
||||||
|
*icc_data_len = 0;
|
||||||
|
|
||||||
|
/* This first pass over the saved markers discovers whether there are
|
||||||
|
* any ICC markers and verifies the consistency of the marker numbering.
|
||||||
|
*/
|
||||||
|
|
||||||
|
for (seq_no = 1; seq_no <= MAX_SEQ_NO; seq_no++)
|
||||||
|
marker_present[seq_no] = 0;
|
||||||
|
|
||||||
|
for (marker = cinfo->marker_list; marker != NULL; marker = marker->next) {
|
||||||
|
if (marker_is_icc(marker)) {
|
||||||
|
if (num_markers == 0)
|
||||||
|
num_markers = GETJOCTET(marker->data[13]);
|
||||||
|
else if (num_markers != GETJOCTET(marker->data[13])) {
|
||||||
|
WARNMS(cinfo, JWRN_BOGUS_ICC); /* inconsistent num_markers fields */
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
seq_no = GETJOCTET(marker->data[12]);
|
||||||
|
if (seq_no <= 0 || seq_no > num_markers) {
|
||||||
|
WARNMS(cinfo, JWRN_BOGUS_ICC); /* bogus sequence number */
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
if (marker_present[seq_no]) {
|
||||||
|
WARNMS(cinfo, JWRN_BOGUS_ICC); /* duplicate sequence numbers */
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
marker_present[seq_no] = 1;
|
||||||
|
data_length[seq_no] = marker->data_length - ICC_OVERHEAD_LEN;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (num_markers == 0)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
/* Check for missing markers, count total space needed,
|
||||||
|
* compute offset of each marker's part of the data.
|
||||||
|
*/
|
||||||
|
|
||||||
|
total_length = 0;
|
||||||
|
for (seq_no = 1; seq_no <= num_markers; seq_no++) {
|
||||||
|
if (marker_present[seq_no] == 0) {
|
||||||
|
WARNMS(cinfo, JWRN_BOGUS_ICC); /* missing sequence number */
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
data_offset[seq_no] = total_length;
|
||||||
|
total_length += data_length[seq_no];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (total_length == 0) {
|
||||||
|
WARNMS(cinfo, JWRN_BOGUS_ICC); /* found only empty markers? */
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Allocate space for assembled data */
|
||||||
|
icc_data = (JOCTET *)malloc(total_length * sizeof(JOCTET));
|
||||||
|
if (icc_data == NULL)
|
||||||
|
ERREXIT1(cinfo, JERR_OUT_OF_MEMORY, 11); /* oops, out of memory */
|
||||||
|
|
||||||
|
/* and fill it in */
|
||||||
|
for (marker = cinfo->marker_list; marker != NULL; marker = marker->next) {
|
||||||
|
if (marker_is_icc(marker)) {
|
||||||
|
JOCTET FAR *src_ptr;
|
||||||
|
JOCTET *dst_ptr;
|
||||||
|
unsigned int length;
|
||||||
|
seq_no = GETJOCTET(marker->data[12]);
|
||||||
|
dst_ptr = icc_data + data_offset[seq_no];
|
||||||
|
src_ptr = marker->data + ICC_OVERHEAD_LEN;
|
||||||
|
length = data_length[seq_no];
|
||||||
|
while (length--) {
|
||||||
|
*dst_ptr++ = *src_ptr++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
*icc_data_ptr = icc_data;
|
||||||
|
*icc_data_len = total_length;
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
Vendored
+11
-8
@@ -4,7 +4,7 @@
|
|||||||
* This file was part of the Independent JPEG Group's software:
|
* This file was part of the Independent JPEG Group's software:
|
||||||
* Copyright (C) 1991-1997, Thomas G. Lane.
|
* Copyright (C) 1991-1997, Thomas G. Lane.
|
||||||
* libjpeg-turbo Modifications:
|
* libjpeg-turbo Modifications:
|
||||||
* Copyright (C) 2010, 2016, D. R. Commander.
|
* Copyright (C) 2010, 2016, 2018, D. R. Commander.
|
||||||
* Copyright (C) 2015, Google, Inc.
|
* Copyright (C) 2015, Google, Inc.
|
||||||
* For conditions of distribution and use, see the accompanying README.ijg
|
* For conditions of distribution and use, see the accompanying README.ijg
|
||||||
* file.
|
* file.
|
||||||
@@ -66,8 +66,10 @@ initial_setup (j_decompress_ptr cinfo)
|
|||||||
cinfo->max_v_samp_factor = 1;
|
cinfo->max_v_samp_factor = 1;
|
||||||
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
|
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
|
||||||
ci++, compptr++) {
|
ci++, compptr++) {
|
||||||
if (compptr->h_samp_factor<=0 || compptr->h_samp_factor>MAX_SAMP_FACTOR ||
|
if (compptr->h_samp_factor <= 0 ||
|
||||||
compptr->v_samp_factor<=0 || compptr->v_samp_factor>MAX_SAMP_FACTOR)
|
compptr->h_samp_factor > MAX_SAMP_FACTOR ||
|
||||||
|
compptr->v_samp_factor <= 0 ||
|
||||||
|
compptr->v_samp_factor > MAX_SAMP_FACTOR)
|
||||||
ERREXIT(cinfo, JERR_BAD_SAMPLING);
|
ERREXIT(cinfo, JERR_BAD_SAMPLING);
|
||||||
cinfo->max_h_samp_factor = MAX(cinfo->max_h_samp_factor,
|
cinfo->max_h_samp_factor = MAX(cinfo->max_h_samp_factor,
|
||||||
compptr->h_samp_factor);
|
compptr->h_samp_factor);
|
||||||
@@ -198,7 +200,8 @@ per_scan_setup (j_decompress_ptr cinfo)
|
|||||||
compptr->MCU_width = compptr->h_samp_factor;
|
compptr->MCU_width = compptr->h_samp_factor;
|
||||||
compptr->MCU_height = compptr->v_samp_factor;
|
compptr->MCU_height = compptr->v_samp_factor;
|
||||||
compptr->MCU_blocks = compptr->MCU_width * compptr->MCU_height;
|
compptr->MCU_blocks = compptr->MCU_width * compptr->MCU_height;
|
||||||
compptr->MCU_sample_width = compptr->MCU_width * compptr->_DCT_scaled_size;
|
compptr->MCU_sample_width = compptr->MCU_width *
|
||||||
|
compptr->_DCT_scaled_size;
|
||||||
/* Figure number of non-dummy blocks in last MCU column & row */
|
/* Figure number of non-dummy blocks in last MCU column & row */
|
||||||
tmp = (int)(compptr->width_in_blocks % compptr->MCU_width);
|
tmp = (int)(compptr->width_in_blocks % compptr->MCU_width);
|
||||||
if (tmp == 0) tmp = compptr->MCU_width;
|
if (tmp == 0) tmp = compptr->MCU_width;
|
||||||
@@ -231,10 +234,10 @@ per_scan_setup (j_decompress_ptr cinfo)
|
|||||||
* means that we have to save away the table actually used for each component.
|
* means that we have to save away the table actually used for each component.
|
||||||
* We do this by copying the table at the start of the first scan containing
|
* We do this by copying the table at the start of the first scan containing
|
||||||
* the component.
|
* the component.
|
||||||
* The JPEG spec prohibits the encoder from changing the contents of a Q-table
|
* Rec. ITU-T T.81 | ISO/IEC 10918-1 prohibits the encoder from changing the
|
||||||
* slot between scans of a component using that slot. If the encoder does so
|
* contents of a Q-table slot between scans of a component using that slot. If
|
||||||
* anyway, this decoder will simply use the Q-table values that were current
|
* the encoder does so anyway, this decoder will simply use the Q-table values
|
||||||
* at the start of the first scan for the component.
|
* that were current at the start of the first scan for the component.
|
||||||
*
|
*
|
||||||
* The decompressor output side looks only at the saved quant tables,
|
* The decompressor output side looks only at the saved quant tables,
|
||||||
* not at the current Q-table slots.
|
* not at the current Q-table slots.
|
||||||
|
|||||||
+28
-24
@@ -112,16 +112,19 @@
|
|||||||
|
|
||||||
|
|
||||||
/* Forward declarations */
|
/* Forward declarations */
|
||||||
METHODDEF(void) process_data_simple_main
|
METHODDEF(void) process_data_simple_main(j_decompress_ptr cinfo,
|
||||||
(j_decompress_ptr cinfo, JSAMPARRAY output_buf,
|
JSAMPARRAY output_buf,
|
||||||
JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail);
|
JDIMENSION *out_row_ctr,
|
||||||
METHODDEF(void) process_data_context_main
|
JDIMENSION out_rows_avail);
|
||||||
(j_decompress_ptr cinfo, JSAMPARRAY output_buf,
|
METHODDEF(void) process_data_context_main(j_decompress_ptr cinfo,
|
||||||
JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail);
|
JSAMPARRAY output_buf,
|
||||||
|
JDIMENSION *out_row_ctr,
|
||||||
|
JDIMENSION out_rows_avail);
|
||||||
#ifdef QUANT_2PASS_SUPPORTED
|
#ifdef QUANT_2PASS_SUPPORTED
|
||||||
METHODDEF(void) process_data_crank_post
|
METHODDEF(void) process_data_crank_post(j_decompress_ptr cinfo,
|
||||||
(j_decompress_ptr cinfo, JSAMPARRAY output_buf,
|
JSAMPARRAY output_buf,
|
||||||
JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail);
|
JDIMENSION *out_row_ctr,
|
||||||
|
JDIMENSION out_rows_avail);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
@@ -286,9 +289,8 @@ start_pass_main (j_decompress_ptr cinfo, J_BUF_MODE pass_mode)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
METHODDEF(void)
|
METHODDEF(void)
|
||||||
process_data_simple_main (j_decompress_ptr cinfo,
|
process_data_simple_main(j_decompress_ptr cinfo, JSAMPARRAY output_buf,
|
||||||
JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
|
JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail)
|
||||||
JDIMENSION out_rows_avail)
|
|
||||||
{
|
{
|
||||||
my_main_ptr main_ptr = (my_main_ptr)cinfo->main;
|
my_main_ptr main_ptr = (my_main_ptr)cinfo->main;
|
||||||
JDIMENSION rowgroups_avail;
|
JDIMENSION rowgroups_avail;
|
||||||
@@ -326,9 +328,8 @@ process_data_simple_main (j_decompress_ptr cinfo,
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
METHODDEF(void)
|
METHODDEF(void)
|
||||||
process_data_context_main (j_decompress_ptr cinfo,
|
process_data_context_main(j_decompress_ptr cinfo, JSAMPARRAY output_buf,
|
||||||
JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
|
JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail)
|
||||||
JDIMENSION out_rows_avail)
|
|
||||||
{
|
{
|
||||||
my_main_ptr main_ptr = (my_main_ptr)cinfo->main;
|
my_main_ptr main_ptr = (my_main_ptr)cinfo->main;
|
||||||
|
|
||||||
@@ -349,9 +350,11 @@ process_data_context_main (j_decompress_ptr cinfo,
|
|||||||
switch (main_ptr->context_state) {
|
switch (main_ptr->context_state) {
|
||||||
case CTX_POSTPONED_ROW:
|
case CTX_POSTPONED_ROW:
|
||||||
/* Call postprocessor using previously set pointers for postponed row */
|
/* Call postprocessor using previously set pointers for postponed row */
|
||||||
(*cinfo->post->post_process_data) (cinfo, main_ptr->xbuffer[main_ptr->whichptr],
|
(*cinfo->post->post_process_data) (cinfo,
|
||||||
&main_ptr->rowgroup_ctr, main_ptr->rowgroups_avail,
|
main_ptr->xbuffer[main_ptr->whichptr],
|
||||||
output_buf, out_row_ctr, out_rows_avail);
|
&main_ptr->rowgroup_ctr,
|
||||||
|
main_ptr->rowgroups_avail, output_buf,
|
||||||
|
out_row_ctr, out_rows_avail);
|
||||||
if (main_ptr->rowgroup_ctr < main_ptr->rowgroups_avail)
|
if (main_ptr->rowgroup_ctr < main_ptr->rowgroups_avail)
|
||||||
return; /* Need to suspend */
|
return; /* Need to suspend */
|
||||||
main_ptr->context_state = CTX_PREPARE_FOR_IMCU;
|
main_ptr->context_state = CTX_PREPARE_FOR_IMCU;
|
||||||
@@ -371,9 +374,11 @@ process_data_context_main (j_decompress_ptr cinfo,
|
|||||||
/*FALLTHROUGH*/
|
/*FALLTHROUGH*/
|
||||||
case CTX_PROCESS_IMCU:
|
case CTX_PROCESS_IMCU:
|
||||||
/* Call postprocessor using previously set pointers */
|
/* Call postprocessor using previously set pointers */
|
||||||
(*cinfo->post->post_process_data) (cinfo, main_ptr->xbuffer[main_ptr->whichptr],
|
(*cinfo->post->post_process_data) (cinfo,
|
||||||
&main_ptr->rowgroup_ctr, main_ptr->rowgroups_avail,
|
main_ptr->xbuffer[main_ptr->whichptr],
|
||||||
output_buf, out_row_ctr, out_rows_avail);
|
&main_ptr->rowgroup_ctr,
|
||||||
|
main_ptr->rowgroups_avail, output_buf,
|
||||||
|
out_row_ctr, out_rows_avail);
|
||||||
if (main_ptr->rowgroup_ctr < main_ptr->rowgroups_avail)
|
if (main_ptr->rowgroup_ctr < main_ptr->rowgroups_avail)
|
||||||
return; /* Need to suspend */
|
return; /* Need to suspend */
|
||||||
/* After the first iMCU, change wraparound pointers to normal state */
|
/* After the first iMCU, change wraparound pointers to normal state */
|
||||||
@@ -400,9 +405,8 @@ process_data_context_main (j_decompress_ptr cinfo,
|
|||||||
#ifdef QUANT_2PASS_SUPPORTED
|
#ifdef QUANT_2PASS_SUPPORTED
|
||||||
|
|
||||||
METHODDEF(void)
|
METHODDEF(void)
|
||||||
process_data_crank_post (j_decompress_ptr cinfo,
|
process_data_crank_post(j_decompress_ptr cinfo, JSAMPARRAY output_buf,
|
||||||
JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
|
JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail)
|
||||||
JDIMENSION out_rows_avail)
|
|
||||||
{
|
{
|
||||||
(*cinfo->post->post_process_data) (cinfo, (JSAMPIMAGE)NULL,
|
(*cinfo->post->post_process_data) (cinfo, (JSAMPIMAGE)NULL,
|
||||||
(JDIMENSION *)NULL, (JDIMENSION)0,
|
(JDIMENSION *)NULL, (JDIMENSION)0,
|
||||||
|
|||||||
+6
-6
@@ -267,8 +267,8 @@ get_sof (j_decompress_ptr cinfo, boolean is_prog, boolean is_arith)
|
|||||||
/* We don't support files in which the image height is initially specified */
|
/* We don't support files in which the image height is initially specified */
|
||||||
/* as 0 and is later redefined by DNL. As long as we have to check that, */
|
/* as 0 and is later redefined by DNL. As long as we have to check that, */
|
||||||
/* might as well have a general sanity check. */
|
/* might as well have a general sanity check. */
|
||||||
if (cinfo->image_height <= 0 || cinfo->image_width <= 0
|
if (cinfo->image_height <= 0 || cinfo->image_width <= 0 ||
|
||||||
|| cinfo->num_components <= 0)
|
cinfo->num_components <= 0)
|
||||||
ERREXIT(cinfo, JERR_EMPTY_IMAGE);
|
ERREXIT(cinfo, JERR_EMPTY_IMAGE);
|
||||||
|
|
||||||
if (length != (cinfo->num_components * 3))
|
if (length != (cinfo->num_components * 3))
|
||||||
@@ -598,8 +598,8 @@ get_dri (j_decompress_ptr cinfo)
|
|||||||
|
|
||||||
|
|
||||||
LOCAL(void)
|
LOCAL(void)
|
||||||
examine_app0 (j_decompress_ptr cinfo, JOCTET *data,
|
examine_app0(j_decompress_ptr cinfo, JOCTET *data, unsigned int datalen,
|
||||||
unsigned int datalen, JLONG remaining)
|
JLONG remaining)
|
||||||
/* Examine first few bytes from an APP0.
|
/* Examine first few bytes from an APP0.
|
||||||
* Take appropriate action if it is a JFIF marker.
|
* Take appropriate action if it is a JFIF marker.
|
||||||
* datalen is # of bytes at data[], remaining is length of rest of marker data.
|
* datalen is # of bytes at data[], remaining is length of rest of marker data.
|
||||||
@@ -674,8 +674,8 @@ examine_app0 (j_decompress_ptr cinfo, JOCTET *data,
|
|||||||
|
|
||||||
|
|
||||||
LOCAL(void)
|
LOCAL(void)
|
||||||
examine_app14 (j_decompress_ptr cinfo, JOCTET *data,
|
examine_app14(j_decompress_ptr cinfo, JOCTET *data, unsigned int datalen,
|
||||||
unsigned int datalen, JLONG remaining)
|
JLONG remaining)
|
||||||
/* Examine first few bytes from an APP14.
|
/* Examine first few bytes from an APP14.
|
||||||
* Take appropriate action if it is an Adobe marker.
|
* Take appropriate action if it is an Adobe marker.
|
||||||
* datalen is # of bytes at data[], remaining is length of rest of marker data.
|
* datalen is # of bytes at data[], remaining is length of rest of marker data.
|
||||||
|
|||||||
+2
-1
@@ -469,7 +469,8 @@ master_selection (j_decompress_ptr cinfo)
|
|||||||
prepare_range_limit_table(cinfo);
|
prepare_range_limit_table(cinfo);
|
||||||
|
|
||||||
/* Width of an output scanline must be representable as JDIMENSION. */
|
/* Width of an output scanline must be representable as JDIMENSION. */
|
||||||
samplesperrow = (long) cinfo->output_width * (long) cinfo->out_color_components;
|
samplesperrow = (long)cinfo->output_width *
|
||||||
|
(long)cinfo->out_color_components;
|
||||||
jd_samplesperrow = (JDIMENSION)samplesperrow;
|
jd_samplesperrow = (JDIMENSION)samplesperrow;
|
||||||
if ((long)jd_samplesperrow != samplesperrow)
|
if ((long)jd_samplesperrow != samplesperrow)
|
||||||
ERREXIT(cinfo, JERR_WIDTH_OVERFLOW);
|
ERREXIT(cinfo, JERR_WIDTH_OVERFLOW);
|
||||||
|
|||||||
Vendored
+23
-31
@@ -248,11 +248,10 @@ start_pass_merged_upsample (j_decompress_ptr cinfo)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
METHODDEF(void)
|
METHODDEF(void)
|
||||||
merged_2v_upsample (j_decompress_ptr cinfo,
|
merged_2v_upsample(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||||
JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr,
|
JDIMENSION *in_row_group_ctr,
|
||||||
JDIMENSION in_row_groups_avail,
|
JDIMENSION in_row_groups_avail, JSAMPARRAY output_buf,
|
||||||
JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
|
JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail)
|
||||||
JDIMENSION out_rows_avail)
|
|
||||||
/* 2:1 vertical sampling case: may need a spare row. */
|
/* 2:1 vertical sampling case: may need a spare row. */
|
||||||
{
|
{
|
||||||
my_upsample_ptr upsample = (my_upsample_ptr)cinfo->upsample;
|
my_upsample_ptr upsample = (my_upsample_ptr)cinfo->upsample;
|
||||||
@@ -264,8 +263,8 @@ merged_2v_upsample (j_decompress_ptr cinfo,
|
|||||||
JDIMENSION size = upsample->out_row_width;
|
JDIMENSION size = upsample->out_row_width;
|
||||||
if (cinfo->out_color_space == JCS_RGB565)
|
if (cinfo->out_color_space == JCS_RGB565)
|
||||||
size = cinfo->output_width * 2;
|
size = cinfo->output_width * 2;
|
||||||
jcopy_sample_rows(& upsample->spare_row, 0, output_buf + *out_row_ctr, 0,
|
jcopy_sample_rows(&upsample->spare_row, 0, output_buf + *out_row_ctr, 0, 1,
|
||||||
1, size);
|
size);
|
||||||
num_rows = 1;
|
num_rows = 1;
|
||||||
upsample->spare_full = FALSE;
|
upsample->spare_full = FALSE;
|
||||||
} else {
|
} else {
|
||||||
@@ -300,11 +299,10 @@ merged_2v_upsample (j_decompress_ptr cinfo,
|
|||||||
|
|
||||||
|
|
||||||
METHODDEF(void)
|
METHODDEF(void)
|
||||||
merged_1v_upsample (j_decompress_ptr cinfo,
|
merged_1v_upsample(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||||
JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr,
|
JDIMENSION *in_row_group_ctr,
|
||||||
JDIMENSION in_row_groups_avail,
|
JDIMENSION in_row_groups_avail, JSAMPARRAY output_buf,
|
||||||
JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
|
JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail)
|
||||||
JDIMENSION out_rows_avail)
|
|
||||||
/* 1:1 vertical sampling case: much easier, never need a spare row. */
|
/* 1:1 vertical sampling case: much easier, never need a spare row. */
|
||||||
{
|
{
|
||||||
my_upsample_ptr upsample = (my_upsample_ptr)cinfo->upsample;
|
my_upsample_ptr upsample = (my_upsample_ptr)cinfo->upsample;
|
||||||
@@ -333,9 +331,8 @@ merged_1v_upsample (j_decompress_ptr cinfo,
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
METHODDEF(void)
|
METHODDEF(void)
|
||||||
h2v1_merged_upsample (j_decompress_ptr cinfo,
|
h2v1_merged_upsample(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||||
JSAMPIMAGE input_buf, JDIMENSION in_row_group_ctr,
|
JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf)
|
||||||
JSAMPARRAY output_buf)
|
|
||||||
{
|
{
|
||||||
switch (cinfo->out_color_space) {
|
switch (cinfo->out_color_space) {
|
||||||
case JCS_EXT_RGB:
|
case JCS_EXT_RGB:
|
||||||
@@ -379,9 +376,8 @@ h2v1_merged_upsample (j_decompress_ptr cinfo,
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
METHODDEF(void)
|
METHODDEF(void)
|
||||||
h2v2_merged_upsample (j_decompress_ptr cinfo,
|
h2v2_merged_upsample(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||||
JSAMPIMAGE input_buf, JDIMENSION in_row_group_ctr,
|
JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf)
|
||||||
JSAMPARRAY output_buf)
|
|
||||||
{
|
{
|
||||||
switch (cinfo->out_color_space) {
|
switch (cinfo->out_color_space) {
|
||||||
case JCS_EXT_RGB:
|
case JCS_EXT_RGB:
|
||||||
@@ -452,7 +448,7 @@ h2v2_merged_upsample (j_decompress_ptr cinfo,
|
|||||||
/* Declarations for ordered dithering
|
/* Declarations for ordered dithering
|
||||||
*
|
*
|
||||||
* We use a 4x4 ordered dither array packed into 32 bits. This array is
|
* We use a 4x4 ordered dither array packed into 32 bits. This array is
|
||||||
* sufficent for dithering RGB888 to RGB565.
|
* sufficient for dithering RGB888 to RGB565.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define DITHER_MASK 0x3
|
#define DITHER_MASK 0x3
|
||||||
@@ -510,9 +506,8 @@ static INLINE boolean is_big_endian(void)
|
|||||||
|
|
||||||
|
|
||||||
METHODDEF(void)
|
METHODDEF(void)
|
||||||
h2v1_merged_upsample_565 (j_decompress_ptr cinfo,
|
h2v1_merged_upsample_565(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||||
JSAMPIMAGE input_buf, JDIMENSION in_row_group_ctr,
|
JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf)
|
||||||
JSAMPARRAY output_buf)
|
|
||||||
{
|
{
|
||||||
if (is_big_endian())
|
if (is_big_endian())
|
||||||
h2v1_merged_upsample_565_be(cinfo, input_buf, in_row_group_ctr,
|
h2v1_merged_upsample_565_be(cinfo, input_buf, in_row_group_ctr,
|
||||||
@@ -524,9 +519,8 @@ h2v1_merged_upsample_565 (j_decompress_ptr cinfo,
|
|||||||
|
|
||||||
|
|
||||||
METHODDEF(void)
|
METHODDEF(void)
|
||||||
h2v1_merged_upsample_565D (j_decompress_ptr cinfo,
|
h2v1_merged_upsample_565D(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||||
JSAMPIMAGE input_buf, JDIMENSION in_row_group_ctr,
|
JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf)
|
||||||
JSAMPARRAY output_buf)
|
|
||||||
{
|
{
|
||||||
if (is_big_endian())
|
if (is_big_endian())
|
||||||
h2v1_merged_upsample_565D_be(cinfo, input_buf, in_row_group_ctr,
|
h2v1_merged_upsample_565D_be(cinfo, input_buf, in_row_group_ctr,
|
||||||
@@ -538,9 +532,8 @@ h2v1_merged_upsample_565D (j_decompress_ptr cinfo,
|
|||||||
|
|
||||||
|
|
||||||
METHODDEF(void)
|
METHODDEF(void)
|
||||||
h2v2_merged_upsample_565 (j_decompress_ptr cinfo,
|
h2v2_merged_upsample_565(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||||
JSAMPIMAGE input_buf, JDIMENSION in_row_group_ctr,
|
JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf)
|
||||||
JSAMPARRAY output_buf)
|
|
||||||
{
|
{
|
||||||
if (is_big_endian())
|
if (is_big_endian())
|
||||||
h2v2_merged_upsample_565_be(cinfo, input_buf, in_row_group_ctr,
|
h2v2_merged_upsample_565_be(cinfo, input_buf, in_row_group_ctr,
|
||||||
@@ -552,9 +545,8 @@ h2v2_merged_upsample_565 (j_decompress_ptr cinfo,
|
|||||||
|
|
||||||
|
|
||||||
METHODDEF(void)
|
METHODDEF(void)
|
||||||
h2v2_merged_upsample_565D (j_decompress_ptr cinfo,
|
h2v2_merged_upsample_565D(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||||
JSAMPIMAGE input_buf, JDIMENSION in_row_group_ctr,
|
JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf)
|
||||||
JSAMPARRAY output_buf)
|
|
||||||
{
|
{
|
||||||
if (is_big_endian())
|
if (is_big_endian())
|
||||||
h2v2_merged_upsample_565D_be(cinfo, input_buf, in_row_group_ctr,
|
h2v2_merged_upsample_565D_be(cinfo, input_buf, in_row_group_ctr,
|
||||||
|
|||||||
+11
-13
@@ -5,7 +5,7 @@
|
|||||||
* Copyright (C) 1994-1996, Thomas G. Lane.
|
* Copyright (C) 1994-1996, Thomas G. Lane.
|
||||||
* libjpeg-turbo Modifications:
|
* libjpeg-turbo Modifications:
|
||||||
* Copyright (C) 2013, Linaro Limited.
|
* Copyright (C) 2013, Linaro Limited.
|
||||||
* Copyright (C) 2014-2015, D. R. Commander.
|
* Copyright (C) 2014-2015, 2018, D. R. Commander.
|
||||||
* For conditions of distribution and use, see the accompanying README.ijg
|
* For conditions of distribution and use, see the accompanying README.ijg
|
||||||
* file.
|
* file.
|
||||||
*
|
*
|
||||||
@@ -15,8 +15,7 @@
|
|||||||
|
|
||||||
INLINE
|
INLINE
|
||||||
LOCAL(void)
|
LOCAL(void)
|
||||||
h2v1_merged_upsample_565_internal (j_decompress_ptr cinfo,
|
h2v1_merged_upsample_565_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||||
JSAMPIMAGE input_buf,
|
|
||||||
JDIMENSION in_row_group_ctr,
|
JDIMENSION in_row_group_ctr,
|
||||||
JSAMPARRAY output_buf)
|
JSAMPARRAY output_buf)
|
||||||
{
|
{
|
||||||
@@ -160,8 +159,7 @@ h2v1_merged_upsample_565D_internal (j_decompress_ptr cinfo,
|
|||||||
|
|
||||||
INLINE
|
INLINE
|
||||||
LOCAL(void)
|
LOCAL(void)
|
||||||
h2v2_merged_upsample_565_internal (j_decompress_ptr cinfo,
|
h2v2_merged_upsample_565_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||||
JSAMPIMAGE input_buf,
|
|
||||||
JDIMENSION in_row_group_ctr,
|
JDIMENSION in_row_group_ctr,
|
||||||
JSAMPARRAY output_buf)
|
JSAMPARRAY output_buf)
|
||||||
{
|
{
|
||||||
@@ -304,20 +302,20 @@ h2v2_merged_upsample_565D_internal (j_decompress_ptr cinfo,
|
|||||||
rgb = PACK_SHORT_565(r, g, b);
|
rgb = PACK_SHORT_565(r, g, b);
|
||||||
|
|
||||||
y = GETJSAMPLE(*inptr00++);
|
y = GETJSAMPLE(*inptr00++);
|
||||||
r = range_limit[DITHER_565_R(y + cred, d1)];
|
r = range_limit[DITHER_565_R(y + cred, d0)];
|
||||||
g = range_limit[DITHER_565_G(y + cgreen, d1)];
|
g = range_limit[DITHER_565_G(y + cgreen, d0)];
|
||||||
b = range_limit[DITHER_565_B(y + cblue, d1)];
|
b = range_limit[DITHER_565_B(y + cblue, d0)];
|
||||||
d1 = DITHER_ROTATE(d1);
|
d0 = DITHER_ROTATE(d0);
|
||||||
rgb = PACK_TWO_PIXELS(rgb, PACK_SHORT_565(r, g, b));
|
rgb = PACK_TWO_PIXELS(rgb, PACK_SHORT_565(r, g, b));
|
||||||
|
|
||||||
WRITE_TWO_PIXELS(outptr0, rgb);
|
WRITE_TWO_PIXELS(outptr0, rgb);
|
||||||
outptr0 += 4;
|
outptr0 += 4;
|
||||||
|
|
||||||
y = GETJSAMPLE(*inptr01++);
|
y = GETJSAMPLE(*inptr01++);
|
||||||
r = range_limit[DITHER_565_R(y + cred, d0)];
|
r = range_limit[DITHER_565_R(y + cred, d1)];
|
||||||
g = range_limit[DITHER_565_G(y + cgreen, d0)];
|
g = range_limit[DITHER_565_G(y + cgreen, d1)];
|
||||||
b = range_limit[DITHER_565_B(y + cblue, d0)];
|
b = range_limit[DITHER_565_B(y + cblue, d1)];
|
||||||
d0 = DITHER_ROTATE(d0);
|
d1 = DITHER_ROTATE(d1);
|
||||||
rgb = PACK_SHORT_565(r, g, b);
|
rgb = PACK_SHORT_565(r, g, b);
|
||||||
|
|
||||||
y = GETJSAMPLE(*inptr01++);
|
y = GETJSAMPLE(*inptr01++);
|
||||||
|
|||||||
+2
-4
@@ -21,8 +21,7 @@
|
|||||||
|
|
||||||
INLINE
|
INLINE
|
||||||
LOCAL(void)
|
LOCAL(void)
|
||||||
h2v1_merged_upsample_internal (j_decompress_ptr cinfo,
|
h2v1_merged_upsample_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||||
JSAMPIMAGE input_buf,
|
|
||||||
JDIMENSION in_row_group_ctr,
|
JDIMENSION in_row_group_ctr,
|
||||||
JSAMPARRAY output_buf)
|
JSAMPARRAY output_buf)
|
||||||
{
|
{
|
||||||
@@ -94,8 +93,7 @@ h2v1_merged_upsample_internal (j_decompress_ptr cinfo,
|
|||||||
|
|
||||||
INLINE
|
INLINE
|
||||||
LOCAL(void)
|
LOCAL(void)
|
||||||
h2v2_merged_upsample_internal (j_decompress_ptr cinfo,
|
h2v2_merged_upsample_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||||
JSAMPIMAGE input_buf,
|
|
||||||
JDIMENSION in_row_group_ctr,
|
JDIMENSION in_row_group_ctr,
|
||||||
JSAMPARRAY output_buf)
|
JSAMPARRAY output_buf)
|
||||||
{
|
{
|
||||||
|
|||||||
Vendored
+23
-10
@@ -4,7 +4,7 @@
|
|||||||
* This file was part of the Independent JPEG Group's software:
|
* This file was part of the Independent JPEG Group's software:
|
||||||
* Copyright (C) 1995-1997, Thomas G. Lane.
|
* Copyright (C) 1995-1997, Thomas G. Lane.
|
||||||
* libjpeg-turbo Modifications:
|
* libjpeg-turbo Modifications:
|
||||||
* Copyright (C) 2015-2016, D. R. Commander.
|
* Copyright (C) 2015-2016, 2018, D. R. Commander.
|
||||||
* For conditions of distribution and use, see the accompanying README.ijg
|
* For conditions of distribution and use, see the accompanying README.ijg
|
||||||
* file.
|
* file.
|
||||||
*
|
*
|
||||||
@@ -15,12 +15,16 @@
|
|||||||
* up to the start of the current MCU. To do this, we copy state variables
|
* up to the start of the current MCU. To do this, we copy state variables
|
||||||
* into local working storage, and update them back to the permanent
|
* into local working storage, and update them back to the permanent
|
||||||
* storage only upon successful completion of an MCU.
|
* storage only upon successful completion of an MCU.
|
||||||
|
*
|
||||||
|
* NOTE: All referenced figures are from
|
||||||
|
* Recommendation ITU-T T.81 (1992) | ISO/IEC 10918-1:1994.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define JPEG_INTERNALS
|
#define JPEG_INTERNALS
|
||||||
#include "jinclude.h"
|
#include "jinclude.h"
|
||||||
#include "jpeglib.h"
|
#include "jpeglib.h"
|
||||||
#include "jdhuff.h" /* Declarations shared with jdhuff.c */
|
#include "jdhuff.h" /* Declarations shared with jdhuff.c */
|
||||||
|
#include <limits.h>
|
||||||
|
|
||||||
|
|
||||||
#ifdef D_PROGRESSIVE_SUPPORTED
|
#ifdef D_PROGRESSIVE_SUPPORTED
|
||||||
@@ -206,21 +210,25 @@ start_pass_phuff_decoder (j_decompress_ptr cinfo)
|
|||||||
#ifdef AVOID_TABLES
|
#ifdef AVOID_TABLES
|
||||||
|
|
||||||
#define NEG_1 ((unsigned)-1)
|
#define NEG_1 ((unsigned)-1)
|
||||||
#define HUFF_EXTEND(x,s) ((x) < (1<<((s)-1)) ? (x) + (((NEG_1)<<(s)) + 1) : (x))
|
#define HUFF_EXTEND(x, s) \
|
||||||
|
((x) < (1 << ((s) - 1)) ? (x) + (((NEG_1) << (s)) + 1) : (x))
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
#define HUFF_EXTEND(x,s) ((x) < extend_test[s] ? (x) + extend_offset[s] : (x))
|
#define HUFF_EXTEND(x, s) \
|
||||||
|
((x) < extend_test[s] ? (x) + extend_offset[s] : (x))
|
||||||
|
|
||||||
static const int extend_test[16] = /* entry n is 2**(n-1) */
|
static const int extend_test[16] = { /* entry n is 2**(n-1) */
|
||||||
{ 0, 0x0001, 0x0002, 0x0004, 0x0008, 0x0010, 0x0020, 0x0040, 0x0080,
|
0, 0x0001, 0x0002, 0x0004, 0x0008, 0x0010, 0x0020, 0x0040, 0x0080,
|
||||||
0x0100, 0x0200, 0x0400, 0x0800, 0x1000, 0x2000, 0x4000 };
|
0x0100, 0x0200, 0x0400, 0x0800, 0x1000, 0x2000, 0x4000
|
||||||
|
};
|
||||||
|
|
||||||
static const int extend_offset[16] = /* entry n is (-1 << n) + 1 */
|
static const int extend_offset[16] = { /* entry n is (-1 << n) + 1 */
|
||||||
{ 0, ((-1)<<1) + 1, ((-1)<<2) + 1, ((-1)<<3) + 1, ((-1)<<4) + 1,
|
0, ((-1) << 1) + 1, ((-1) << 2) + 1, ((-1) << 3) + 1, ((-1) << 4) + 1,
|
||||||
((-1) << 5) + 1, ((-1) << 6) + 1, ((-1) << 7) + 1, ((-1) << 8) + 1,
|
((-1) << 5) + 1, ((-1) << 6) + 1, ((-1) << 7) + 1, ((-1) << 8) + 1,
|
||||||
((-1) << 9) + 1, ((-1) << 10) + 1, ((-1) << 11) + 1, ((-1) << 12) + 1,
|
((-1) << 9) + 1, ((-1) << 10) + 1, ((-1) << 11) + 1, ((-1) << 12) + 1,
|
||||||
((-1)<<13) + 1, ((-1)<<14) + 1, ((-1)<<15) + 1 };
|
((-1) << 13) + 1, ((-1) << 14) + 1, ((-1) << 15) + 1
|
||||||
|
};
|
||||||
|
|
||||||
#endif /* AVOID_TABLES */
|
#endif /* AVOID_TABLES */
|
||||||
|
|
||||||
@@ -336,6 +344,10 @@ decode_mcu_DC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Convert DC difference to actual value, update last_dc_val */
|
/* Convert DC difference to actual value, update last_dc_val */
|
||||||
|
if ((state.last_dc_val[ci] >= 0 &&
|
||||||
|
s > INT_MAX - state.last_dc_val[ci]) ||
|
||||||
|
(state.last_dc_val[ci] < 0 && s < INT_MIN - state.last_dc_val[ci]))
|
||||||
|
ERREXIT(cinfo, JERR_BAD_DCT_COEF);
|
||||||
s += state.last_dc_val[ci];
|
s += state.last_dc_val[ci];
|
||||||
state.last_dc_val[ci] = s;
|
state.last_dc_val[ci] = s;
|
||||||
/* Scale and output the coefficient (assumes jpeg_natural_order[0]=0) */
|
/* Scale and output the coefficient (assumes jpeg_natural_order[0]=0) */
|
||||||
@@ -664,7 +676,8 @@ jinit_phuff_decoder (j_decompress_ptr cinfo)
|
|||||||
/* Create progression status table */
|
/* Create progression status table */
|
||||||
cinfo->coef_bits = (int (*)[DCTSIZE2])
|
cinfo->coef_bits = (int (*)[DCTSIZE2])
|
||||||
(*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
|
(*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
|
||||||
cinfo->num_components*DCTSIZE2*sizeof(int));
|
cinfo->num_components * DCTSIZE2 *
|
||||||
|
sizeof(int));
|
||||||
coef_bit_ptr = &cinfo->coef_bits[0][0];
|
coef_bit_ptr = &cinfo->coef_bits[0][0];
|
||||||
for (ci = 0; ci < cinfo->num_components; ci++)
|
for (ci = 0; ci < cinfo->num_components; ci++)
|
||||||
for (i = 0; i < DCTSIZE2; i++)
|
for (i = 0; i < DCTSIZE2; i++)
|
||||||
|
|||||||
+41
-37
@@ -46,21 +46,27 @@ typedef my_post_controller *my_post_ptr;
|
|||||||
|
|
||||||
|
|
||||||
/* Forward declarations */
|
/* Forward declarations */
|
||||||
METHODDEF(void) post_process_1pass
|
METHODDEF(void) post_process_1pass(j_decompress_ptr cinfo,
|
||||||
(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
JSAMPIMAGE input_buf,
|
||||||
JDIMENSION *in_row_group_ctr, JDIMENSION in_row_groups_avail,
|
JDIMENSION *in_row_group_ctr,
|
||||||
JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
|
JDIMENSION in_row_groups_avail,
|
||||||
|
JSAMPARRAY output_buf,
|
||||||
|
JDIMENSION *out_row_ctr,
|
||||||
JDIMENSION out_rows_avail);
|
JDIMENSION out_rows_avail);
|
||||||
#ifdef QUANT_2PASS_SUPPORTED
|
#ifdef QUANT_2PASS_SUPPORTED
|
||||||
METHODDEF(void) post_process_prepass
|
METHODDEF(void) post_process_prepass(j_decompress_ptr cinfo,
|
||||||
(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
JSAMPIMAGE input_buf,
|
||||||
JDIMENSION *in_row_group_ctr, JDIMENSION in_row_groups_avail,
|
JDIMENSION *in_row_group_ctr,
|
||||||
JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
|
JDIMENSION in_row_groups_avail,
|
||||||
|
JSAMPARRAY output_buf,
|
||||||
|
JDIMENSION *out_row_ctr,
|
||||||
JDIMENSION out_rows_avail);
|
JDIMENSION out_rows_avail);
|
||||||
METHODDEF(void) post_process_2pass
|
METHODDEF(void) post_process_2pass(j_decompress_ptr cinfo,
|
||||||
(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
JSAMPIMAGE input_buf,
|
||||||
JDIMENSION *in_row_group_ctr, JDIMENSION in_row_groups_avail,
|
JDIMENSION *in_row_group_ctr,
|
||||||
JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
|
JDIMENSION in_row_groups_avail,
|
||||||
|
JSAMPARRAY output_buf,
|
||||||
|
JDIMENSION *out_row_ctr,
|
||||||
JDIMENSION out_rows_avail);
|
JDIMENSION out_rows_avail);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -123,11 +129,10 @@ start_pass_dpost (j_decompress_ptr cinfo, J_BUF_MODE pass_mode)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
METHODDEF(void)
|
METHODDEF(void)
|
||||||
post_process_1pass (j_decompress_ptr cinfo,
|
post_process_1pass(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||||
JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr,
|
JDIMENSION *in_row_group_ctr,
|
||||||
JDIMENSION in_row_groups_avail,
|
JDIMENSION in_row_groups_avail, JSAMPARRAY output_buf,
|
||||||
JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
|
JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail)
|
||||||
JDIMENSION out_rows_avail)
|
|
||||||
{
|
{
|
||||||
my_post_ptr post = (my_post_ptr)cinfo->post;
|
my_post_ptr post = (my_post_ptr)cinfo->post;
|
||||||
JDIMENSION num_rows, max_rows;
|
JDIMENSION num_rows, max_rows;
|
||||||
@@ -138,12 +143,13 @@ post_process_1pass (j_decompress_ptr cinfo,
|
|||||||
if (max_rows > post->strip_height)
|
if (max_rows > post->strip_height)
|
||||||
max_rows = post->strip_height;
|
max_rows = post->strip_height;
|
||||||
num_rows = 0;
|
num_rows = 0;
|
||||||
(*cinfo->upsample->upsample) (cinfo,
|
(*cinfo->upsample->upsample) (cinfo, input_buf, in_row_group_ctr,
|
||||||
input_buf, in_row_group_ctr, in_row_groups_avail,
|
in_row_groups_avail, post->buffer, &num_rows,
|
||||||
post->buffer, &num_rows, max_rows);
|
max_rows);
|
||||||
/* Quantize and emit data. */
|
/* Quantize and emit data. */
|
||||||
(*cinfo->cquantize->color_quantize) (cinfo,
|
(*cinfo->cquantize->color_quantize) (cinfo, post->buffer,
|
||||||
post->buffer, output_buf + *out_row_ctr, (int) num_rows);
|
output_buf + *out_row_ctr,
|
||||||
|
(int)num_rows);
|
||||||
*out_row_ctr += num_rows;
|
*out_row_ctr += num_rows;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -155,11 +161,10 @@ post_process_1pass (j_decompress_ptr cinfo,
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
METHODDEF(void)
|
METHODDEF(void)
|
||||||
post_process_prepass (j_decompress_ptr cinfo,
|
post_process_prepass(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||||
JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr,
|
JDIMENSION *in_row_group_ctr,
|
||||||
JDIMENSION in_row_groups_avail,
|
JDIMENSION in_row_groups_avail, JSAMPARRAY output_buf,
|
||||||
JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
|
JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail)
|
||||||
JDIMENSION out_rows_avail)
|
|
||||||
{
|
{
|
||||||
my_post_ptr post = (my_post_ptr)cinfo->post;
|
my_post_ptr post = (my_post_ptr)cinfo->post;
|
||||||
JDIMENSION old_next_row, num_rows;
|
JDIMENSION old_next_row, num_rows;
|
||||||
@@ -173,9 +178,9 @@ post_process_prepass (j_decompress_ptr cinfo,
|
|||||||
|
|
||||||
/* Upsample some data (up to a strip height's worth). */
|
/* Upsample some data (up to a strip height's worth). */
|
||||||
old_next_row = post->next_row;
|
old_next_row = post->next_row;
|
||||||
(*cinfo->upsample->upsample) (cinfo,
|
(*cinfo->upsample->upsample) (cinfo, input_buf, in_row_group_ctr,
|
||||||
input_buf, in_row_group_ctr, in_row_groups_avail,
|
in_row_groups_avail, post->buffer,
|
||||||
post->buffer, &post->next_row, post->strip_height);
|
&post->next_row, post->strip_height);
|
||||||
|
|
||||||
/* Allow quantizer to scan new data. No data is emitted, */
|
/* Allow quantizer to scan new data. No data is emitted, */
|
||||||
/* but we advance out_row_ctr so outer loop can tell when we're done. */
|
/* but we advance out_row_ctr so outer loop can tell when we're done. */
|
||||||
@@ -199,11 +204,10 @@ post_process_prepass (j_decompress_ptr cinfo,
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
METHODDEF(void)
|
METHODDEF(void)
|
||||||
post_process_2pass (j_decompress_ptr cinfo,
|
post_process_2pass(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||||
JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr,
|
JDIMENSION *in_row_group_ctr,
|
||||||
JDIMENSION in_row_groups_avail,
|
JDIMENSION in_row_groups_avail, JSAMPARRAY output_buf,
|
||||||
JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
|
JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail)
|
||||||
JDIMENSION out_rows_avail)
|
|
||||||
{
|
{
|
||||||
my_post_ptr post = (my_post_ptr)cinfo->post;
|
my_post_ptr post = (my_post_ptr)cinfo->post;
|
||||||
JDIMENSION num_rows, max_rows;
|
JDIMENSION num_rows, max_rows;
|
||||||
@@ -226,8 +230,8 @@ post_process_2pass (j_decompress_ptr cinfo,
|
|||||||
num_rows = max_rows;
|
num_rows = max_rows;
|
||||||
|
|
||||||
/* Quantize and emit data. */
|
/* Quantize and emit data. */
|
||||||
(*cinfo->cquantize->color_quantize) (cinfo,
|
(*cinfo->cquantize->color_quantize) (cinfo, post->buffer + post->next_row,
|
||||||
post->buffer + post->next_row, output_buf + *out_row_ctr,
|
output_buf + *out_row_ctr,
|
||||||
(int)num_rows);
|
(int)num_rows);
|
||||||
*out_row_ctr += num_rows;
|
*out_row_ctr += num_rows;
|
||||||
|
|
||||||
|
|||||||
+6
-9
@@ -56,9 +56,8 @@ start_pass_upsample (j_decompress_ptr cinfo)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
METHODDEF(void)
|
METHODDEF(void)
|
||||||
sep_upsample (j_decompress_ptr cinfo,
|
sep_upsample(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||||
JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr,
|
JDIMENSION *in_row_group_ctr, JDIMENSION in_row_groups_avail,
|
||||||
JDIMENSION in_row_groups_avail,
|
|
||||||
JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
|
JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
|
||||||
JDIMENSION out_rows_avail)
|
JDIMENSION out_rows_avail)
|
||||||
{
|
{
|
||||||
@@ -97,8 +96,7 @@ sep_upsample (j_decompress_ptr cinfo,
|
|||||||
|
|
||||||
(*cinfo->cconvert->color_convert) (cinfo, upsample->color_buf,
|
(*cinfo->cconvert->color_convert) (cinfo, upsample->color_buf,
|
||||||
(JDIMENSION)upsample->next_row_out,
|
(JDIMENSION)upsample->next_row_out,
|
||||||
output_buf + *out_row_ctr,
|
output_buf + *out_row_ctr, (int)num_rows);
|
||||||
(int) num_rows);
|
|
||||||
|
|
||||||
/* Adjust counts */
|
/* Adjust counts */
|
||||||
*out_row_ctr += num_rows;
|
*out_row_ctr += num_rows;
|
||||||
@@ -247,8 +245,8 @@ h2v2_upsample (j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
|||||||
*outptr++ = invalue;
|
*outptr++ = invalue;
|
||||||
*outptr++ = invalue;
|
*outptr++ = invalue;
|
||||||
}
|
}
|
||||||
jcopy_sample_rows(output_data, outrow, output_data, outrow+1,
|
jcopy_sample_rows(output_data, outrow, output_data, outrow + 1, 1,
|
||||||
1, cinfo->output_width);
|
cinfo->output_width);
|
||||||
inrow++;
|
inrow++;
|
||||||
outrow += 2;
|
outrow += 2;
|
||||||
}
|
}
|
||||||
@@ -459,8 +457,7 @@ jinit_upsampler (j_decompress_ptr cinfo)
|
|||||||
/* Fullsize components can be processed without any work. */
|
/* Fullsize components can be processed without any work. */
|
||||||
upsample->methods[ci] = fullsize_upsample;
|
upsample->methods[ci] = fullsize_upsample;
|
||||||
need_buffer = FALSE;
|
need_buffer = FALSE;
|
||||||
} else if (h_in_group * 2 == h_out_group &&
|
} else if (h_in_group * 2 == h_out_group && v_in_group == v_out_group) {
|
||||||
v_in_group == v_out_group) {
|
|
||||||
/* Special cases for 2h1v upsampling */
|
/* Special cases for 2h1v upsampling */
|
||||||
if (do_fancy && compptr->downsampled_width > 2) {
|
if (do_fancy && compptr->downsampled_width > 2) {
|
||||||
if (jsimd_can_h2v1_fancy_upsample())
|
if (jsimd_can_h2v1_fancy_upsample())
|
||||||
|
|||||||
Vendored
+4
-5
@@ -5,7 +5,7 @@
|
|||||||
* Copyright (C) 1994-1997, Thomas G. Lane.
|
* Copyright (C) 1994-1997, Thomas G. Lane.
|
||||||
* Modified 1997-2009 by Guido Vollbeding.
|
* Modified 1997-2009 by Guido Vollbeding.
|
||||||
* libjpeg-turbo Modifications:
|
* libjpeg-turbo Modifications:
|
||||||
* Copyright (C) 2014, D. R. Commander.
|
* Copyright (C) 2014, 2017, D. R. Commander.
|
||||||
* For conditions of distribution and use, see the accompanying README.ijg
|
* For conditions of distribution and use, see the accompanying README.ijg
|
||||||
* file.
|
* file.
|
||||||
*
|
*
|
||||||
@@ -44,8 +44,7 @@ JMESSAGE(JMSG_NOMESSAGE, "Bogus message code %d") /* Must be first entry! */
|
|||||||
|
|
||||||
/* For maintenance convenience, list is alphabetical by message code name */
|
/* For maintenance convenience, list is alphabetical by message code name */
|
||||||
#if JPEG_LIB_VERSION < 70
|
#if JPEG_LIB_VERSION < 70
|
||||||
JMESSAGE(JERR_ARITH_NOTIMPL,
|
JMESSAGE(JERR_ARITH_NOTIMPL, "Sorry, arithmetic coding is not implemented")
|
||||||
"Sorry, arithmetic coding is not implemented")
|
|
||||||
#endif
|
#endif
|
||||||
JMESSAGE(JERR_BAD_ALIGN_TYPE, "ALIGN_TYPE is wrong, please fix")
|
JMESSAGE(JERR_BAD_ALIGN_TYPE, "ALIGN_TYPE is wrong, please fix")
|
||||||
JMESSAGE(JERR_BAD_ALLOC_CHUNK, "MAX_ALLOC_CHUNK is wrong, please fix")
|
JMESSAGE(JERR_BAD_ALLOC_CHUNK, "MAX_ALLOC_CHUNK is wrong, please fix")
|
||||||
@@ -154,8 +153,7 @@ JMESSAGE(JTRC_HUFFBITS, " %3d %3d %3d %3d %3d %3d %3d %3d")
|
|||||||
JMESSAGE(JTRC_JFIF, "JFIF APP0 marker: version %d.%02d, density %dx%d %d")
|
JMESSAGE(JTRC_JFIF, "JFIF APP0 marker: version %d.%02d, density %dx%d %d")
|
||||||
JMESSAGE(JTRC_JFIF_BADTHUMBNAILSIZE,
|
JMESSAGE(JTRC_JFIF_BADTHUMBNAILSIZE,
|
||||||
"Warning: thumbnail image size does not match data length %u")
|
"Warning: thumbnail image size does not match data length %u")
|
||||||
JMESSAGE(JTRC_JFIF_EXTENSION,
|
JMESSAGE(JTRC_JFIF_EXTENSION, "JFIF extension marker: type 0x%02x, length %u")
|
||||||
"JFIF extension marker: type 0x%02x, length %u")
|
|
||||||
JMESSAGE(JTRC_JFIF_THUMBNAIL, " with %d x %d thumbnail image")
|
JMESSAGE(JTRC_JFIF_THUMBNAIL, " with %d x %d thumbnail image")
|
||||||
JMESSAGE(JTRC_MISC_MARKER, "Miscellaneous marker 0x%02x, length %u")
|
JMESSAGE(JTRC_MISC_MARKER, "Miscellaneous marker 0x%02x, length %u")
|
||||||
JMESSAGE(JTRC_PARMLESS_MARKER, "Unexpected marker 0x%02x")
|
JMESSAGE(JTRC_PARMLESS_MARKER, "Unexpected marker 0x%02x")
|
||||||
@@ -208,6 +206,7 @@ JMESSAGE(JERR_NO_ARITH_TABLE, "Arithmetic table 0x%02x was not defined")
|
|||||||
JMESSAGE(JWRN_ARITH_BAD_CODE, "Corrupt JPEG data: bad arithmetic code")
|
JMESSAGE(JWRN_ARITH_BAD_CODE, "Corrupt JPEG data: bad arithmetic code")
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
JMESSAGE(JWRN_BOGUS_ICC, "Corrupt JPEG data: bad ICC marker")
|
||||||
|
|
||||||
#ifdef JMAKE_ENUM_LIST
|
#ifdef JMAKE_ENUM_LIST
|
||||||
|
|
||||||
|
|||||||
+4
-2
@@ -242,9 +242,11 @@ jpeg_fdct_islow (DCTELEM *data)
|
|||||||
dataptr[DCTSIZE * 4] = (DCTELEM)DESCALE(tmp10 - tmp11, PASS1_BITS);
|
dataptr[DCTSIZE * 4] = (DCTELEM)DESCALE(tmp10 - tmp11, PASS1_BITS);
|
||||||
|
|
||||||
z1 = MULTIPLY(tmp12 + tmp13, FIX_0_541196100);
|
z1 = MULTIPLY(tmp12 + tmp13, FIX_0_541196100);
|
||||||
dataptr[DCTSIZE*2] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp13, FIX_0_765366865),
|
dataptr[DCTSIZE * 2] =
|
||||||
|
(DCTELEM)DESCALE(z1 + MULTIPLY(tmp13, FIX_0_765366865),
|
||||||
CONST_BITS + PASS1_BITS);
|
CONST_BITS + PASS1_BITS);
|
||||||
dataptr[DCTSIZE*6] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp12, - FIX_1_847759065),
|
dataptr[DCTSIZE * 6] =
|
||||||
|
(DCTELEM)DESCALE(z1 + MULTIPLY(tmp12, -FIX_1_847759065),
|
||||||
CONST_BITS + PASS1_BITS);
|
CONST_BITS + PASS1_BITS);
|
||||||
|
|
||||||
/* Odd part per figure 8 --- note paper omits factor of sqrt(2).
|
/* Odd part per figure 8 --- note paper omits factor of sqrt(2).
|
||||||
|
|||||||
+2
-2
@@ -70,8 +70,8 @@
|
|||||||
|
|
||||||
GLOBAL(void)
|
GLOBAL(void)
|
||||||
jpeg_idct_float(j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
jpeg_idct_float(j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
||||||
JCOEFPTR coef_block,
|
JCOEFPTR coef_block, JSAMPARRAY output_buf,
|
||||||
JSAMPARRAY output_buf, JDIMENSION output_col)
|
JDIMENSION output_col)
|
||||||
{
|
{
|
||||||
FAST_FLOAT tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
|
FAST_FLOAT tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
|
||||||
FAST_FLOAT tmp10, tmp11, tmp12, tmp13;
|
FAST_FLOAT tmp10, tmp11, tmp12, tmp13;
|
||||||
|
|||||||
+22
-22
@@ -169,8 +169,8 @@
|
|||||||
|
|
||||||
GLOBAL(void)
|
GLOBAL(void)
|
||||||
jpeg_idct_ifast(j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
jpeg_idct_ifast(j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
||||||
JCOEFPTR coef_block,
|
JCOEFPTR coef_block, JSAMPARRAY output_buf,
|
||||||
JSAMPARRAY output_buf, JDIMENSION output_col)
|
JDIMENSION output_col)
|
||||||
{
|
{
|
||||||
DCTELEM tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
|
DCTELEM tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
|
||||||
DCTELEM tmp10, tmp11, tmp12, tmp13;
|
DCTELEM tmp10, tmp11, tmp12, tmp13;
|
||||||
@@ -296,8 +296,8 @@ jpeg_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
|||||||
if (wsptr[1] == 0 && wsptr[2] == 0 && wsptr[3] == 0 && wsptr[4] == 0 &&
|
if (wsptr[1] == 0 && wsptr[2] == 0 && wsptr[3] == 0 && wsptr[4] == 0 &&
|
||||||
wsptr[5] == 0 && wsptr[6] == 0 && wsptr[7] == 0) {
|
wsptr[5] == 0 && wsptr[6] == 0 && wsptr[7] == 0) {
|
||||||
/* AC terms all zero */
|
/* AC terms all zero */
|
||||||
JSAMPLE dcval = range_limit[IDESCALE(wsptr[0], PASS1_BITS+3)
|
JSAMPLE dcval =
|
||||||
& RANGE_MASK];
|
range_limit[IDESCALE(wsptr[0], PASS1_BITS + 3) & RANGE_MASK];
|
||||||
|
|
||||||
outptr[0] = dcval;
|
outptr[0] = dcval;
|
||||||
outptr[1] = dcval;
|
outptr[1] = dcval;
|
||||||
@@ -319,8 +319,8 @@ jpeg_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
|||||||
tmp11 = ((DCTELEM)wsptr[0] - (DCTELEM)wsptr[4]);
|
tmp11 = ((DCTELEM)wsptr[0] - (DCTELEM)wsptr[4]);
|
||||||
|
|
||||||
tmp13 = ((DCTELEM)wsptr[2] + (DCTELEM)wsptr[6]);
|
tmp13 = ((DCTELEM)wsptr[2] + (DCTELEM)wsptr[6]);
|
||||||
tmp12 = MULTIPLY((DCTELEM) wsptr[2] - (DCTELEM) wsptr[6], FIX_1_414213562)
|
tmp12 =
|
||||||
- tmp13;
|
MULTIPLY((DCTELEM)wsptr[2] - (DCTELEM)wsptr[6], FIX_1_414213562) - tmp13;
|
||||||
|
|
||||||
tmp0 = tmp10 + tmp13;
|
tmp0 = tmp10 + tmp13;
|
||||||
tmp3 = tmp10 - tmp13;
|
tmp3 = tmp10 - tmp13;
|
||||||
@@ -347,22 +347,22 @@ jpeg_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
|||||||
|
|
||||||
/* Final output stage: scale down by a factor of 8 and range-limit */
|
/* Final output stage: scale down by a factor of 8 and range-limit */
|
||||||
|
|
||||||
outptr[0] = range_limit[IDESCALE(tmp0 + tmp7, PASS1_BITS+3)
|
outptr[0] =
|
||||||
& RANGE_MASK];
|
range_limit[IDESCALE(tmp0 + tmp7, PASS1_BITS + 3) & RANGE_MASK];
|
||||||
outptr[7] = range_limit[IDESCALE(tmp0 - tmp7, PASS1_BITS+3)
|
outptr[7] =
|
||||||
& RANGE_MASK];
|
range_limit[IDESCALE(tmp0 - tmp7, PASS1_BITS + 3) & RANGE_MASK];
|
||||||
outptr[1] = range_limit[IDESCALE(tmp1 + tmp6, PASS1_BITS+3)
|
outptr[1] =
|
||||||
& RANGE_MASK];
|
range_limit[IDESCALE(tmp1 + tmp6, PASS1_BITS + 3) & RANGE_MASK];
|
||||||
outptr[6] = range_limit[IDESCALE(tmp1 - tmp6, PASS1_BITS+3)
|
outptr[6] =
|
||||||
& RANGE_MASK];
|
range_limit[IDESCALE(tmp1 - tmp6, PASS1_BITS + 3) & RANGE_MASK];
|
||||||
outptr[2] = range_limit[IDESCALE(tmp2 + tmp5, PASS1_BITS+3)
|
outptr[2] =
|
||||||
& RANGE_MASK];
|
range_limit[IDESCALE(tmp2 + tmp5, PASS1_BITS + 3) & RANGE_MASK];
|
||||||
outptr[5] = range_limit[IDESCALE(tmp2 - tmp5, PASS1_BITS+3)
|
outptr[5] =
|
||||||
& RANGE_MASK];
|
range_limit[IDESCALE(tmp2 - tmp5, PASS1_BITS + 3) & RANGE_MASK];
|
||||||
outptr[4] = range_limit[IDESCALE(tmp3 + tmp4, PASS1_BITS+3)
|
outptr[4] =
|
||||||
& RANGE_MASK];
|
range_limit[IDESCALE(tmp3 + tmp4, PASS1_BITS + 3) & RANGE_MASK];
|
||||||
outptr[3] = range_limit[IDESCALE(tmp3 - tmp4, PASS1_BITS+3)
|
outptr[3] =
|
||||||
& RANGE_MASK];
|
range_limit[IDESCALE(tmp3 - tmp4, PASS1_BITS + 3) & RANGE_MASK];
|
||||||
|
|
||||||
wsptr += DCTSIZE; /* advance pointer to next row */
|
wsptr += DCTSIZE; /* advance pointer to next row */
|
||||||
}
|
}
|
||||||
|
|||||||
+288
-288
@@ -171,8 +171,8 @@
|
|||||||
|
|
||||||
GLOBAL(void)
|
GLOBAL(void)
|
||||||
jpeg_idct_islow(j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
jpeg_idct_islow(j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
||||||
JCOEFPTR coef_block,
|
JCOEFPTR coef_block, JSAMPARRAY output_buf,
|
||||||
JSAMPARRAY output_buf, JDIMENSION output_col)
|
JDIMENSION output_col)
|
||||||
{
|
{
|
||||||
JLONG tmp0, tmp1, tmp2, tmp3;
|
JLONG tmp0, tmp1, tmp2, tmp3;
|
||||||
JLONG tmp10, tmp11, tmp12, tmp13;
|
JLONG tmp10, tmp11, tmp12, tmp13;
|
||||||
@@ -208,8 +208,8 @@ jpeg_idct_islow (j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
|||||||
inptr[DCTSIZE * 5] == 0 && inptr[DCTSIZE * 6] == 0 &&
|
inptr[DCTSIZE * 5] == 0 && inptr[DCTSIZE * 6] == 0 &&
|
||||||
inptr[DCTSIZE * 7] == 0) {
|
inptr[DCTSIZE * 7] == 0) {
|
||||||
/* AC terms all zero */
|
/* AC terms all zero */
|
||||||
int dcval = LEFT_SHIFT(DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]),
|
int dcval = LEFT_SHIFT(DEQUANTIZE(inptr[DCTSIZE * 0],
|
||||||
PASS1_BITS);
|
quantptr[DCTSIZE * 0]), PASS1_BITS);
|
||||||
|
|
||||||
wsptr[DCTSIZE * 0] = dcval;
|
wsptr[DCTSIZE * 0] = dcval;
|
||||||
wsptr[DCTSIZE * 1] = dcval;
|
wsptr[DCTSIZE * 1] = dcval;
|
||||||
@@ -314,8 +314,8 @@ jpeg_idct_islow (j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
|||||||
if (wsptr[1] == 0 && wsptr[2] == 0 && wsptr[3] == 0 && wsptr[4] == 0 &&
|
if (wsptr[1] == 0 && wsptr[2] == 0 && wsptr[3] == 0 && wsptr[4] == 0 &&
|
||||||
wsptr[5] == 0 && wsptr[6] == 0 && wsptr[7] == 0) {
|
wsptr[5] == 0 && wsptr[6] == 0 && wsptr[7] == 0) {
|
||||||
/* AC terms all zero */
|
/* AC terms all zero */
|
||||||
JSAMPLE dcval = range_limit[(int) DESCALE((JLONG) wsptr[0], PASS1_BITS+3)
|
JSAMPLE dcval = range_limit[(int)DESCALE((JLONG)wsptr[0],
|
||||||
& RANGE_MASK];
|
PASS1_BITS + 3) & RANGE_MASK];
|
||||||
|
|
||||||
outptr[0] = dcval;
|
outptr[0] = dcval;
|
||||||
outptr[1] = dcval;
|
outptr[1] = dcval;
|
||||||
@@ -384,29 +384,29 @@ jpeg_idct_islow (j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
|||||||
/* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */
|
/* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */
|
||||||
|
|
||||||
outptr[0] = range_limit[(int)DESCALE(tmp10 + tmp3,
|
outptr[0] = range_limit[(int)DESCALE(tmp10 + tmp3,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[7] = range_limit[(int)DESCALE(tmp10 - tmp3,
|
outptr[7] = range_limit[(int)DESCALE(tmp10 - tmp3,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[1] = range_limit[(int)DESCALE(tmp11 + tmp2,
|
outptr[1] = range_limit[(int)DESCALE(tmp11 + tmp2,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[6] = range_limit[(int)DESCALE(tmp11 - tmp2,
|
outptr[6] = range_limit[(int)DESCALE(tmp11 - tmp2,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[2] = range_limit[(int)DESCALE(tmp12 + tmp1,
|
outptr[2] = range_limit[(int)DESCALE(tmp12 + tmp1,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[5] = range_limit[(int)DESCALE(tmp12 - tmp1,
|
outptr[5] = range_limit[(int)DESCALE(tmp12 - tmp1,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[3] = range_limit[(int)DESCALE(tmp13 + tmp0,
|
outptr[3] = range_limit[(int)DESCALE(tmp13 + tmp0,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[4] = range_limit[(int)DESCALE(tmp13 - tmp0,
|
outptr[4] = range_limit[(int)DESCALE(tmp13 - tmp0,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
|
|
||||||
wsptr += DCTSIZE; /* advance pointer to next row */
|
wsptr += DCTSIZE; /* advance pointer to next row */
|
||||||
}
|
}
|
||||||
@@ -425,8 +425,8 @@ jpeg_idct_islow (j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
|||||||
|
|
||||||
GLOBAL(void)
|
GLOBAL(void)
|
||||||
jpeg_idct_7x7(j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
jpeg_idct_7x7(j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
||||||
JCOEFPTR coef_block,
|
JCOEFPTR coef_block, JSAMPARRAY output_buf,
|
||||||
JSAMPARRAY output_buf, JDIMENSION output_col)
|
JDIMENSION output_col)
|
||||||
{
|
{
|
||||||
JLONG tmp0, tmp1, tmp2, tmp10, tmp11, tmp12, tmp13;
|
JLONG tmp0, tmp1, tmp2, tmp10, tmp11, tmp12, tmp13;
|
||||||
JLONG z1, z2, z3;
|
JLONG z1, z2, z3;
|
||||||
@@ -538,26 +538,26 @@ jpeg_idct_7x7 (j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
|||||||
/* Final output stage */
|
/* Final output stage */
|
||||||
|
|
||||||
outptr[0] = range_limit[(int)RIGHT_SHIFT(tmp10 + tmp0,
|
outptr[0] = range_limit[(int)RIGHT_SHIFT(tmp10 + tmp0,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[6] = range_limit[(int)RIGHT_SHIFT(tmp10 - tmp0,
|
outptr[6] = range_limit[(int)RIGHT_SHIFT(tmp10 - tmp0,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[1] = range_limit[(int)RIGHT_SHIFT(tmp11 + tmp1,
|
outptr[1] = range_limit[(int)RIGHT_SHIFT(tmp11 + tmp1,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[5] = range_limit[(int)RIGHT_SHIFT(tmp11 - tmp1,
|
outptr[5] = range_limit[(int)RIGHT_SHIFT(tmp11 - tmp1,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[2] = range_limit[(int)RIGHT_SHIFT(tmp12 + tmp2,
|
outptr[2] = range_limit[(int)RIGHT_SHIFT(tmp12 + tmp2,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[4] = range_limit[(int)RIGHT_SHIFT(tmp12 - tmp2,
|
outptr[4] = range_limit[(int)RIGHT_SHIFT(tmp12 - tmp2,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[3] = range_limit[(int)RIGHT_SHIFT(tmp13,
|
outptr[3] = range_limit[(int)RIGHT_SHIFT(tmp13,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
|
|
||||||
wsptr += 7; /* advance pointer to next row */
|
wsptr += 7; /* advance pointer to next row */
|
||||||
}
|
}
|
||||||
@@ -574,8 +574,8 @@ jpeg_idct_7x7 (j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
|||||||
|
|
||||||
GLOBAL(void)
|
GLOBAL(void)
|
||||||
jpeg_idct_6x6(j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
jpeg_idct_6x6(j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
||||||
JCOEFPTR coef_block,
|
JCOEFPTR coef_block, JSAMPARRAY output_buf,
|
||||||
JSAMPARRAY output_buf, JDIMENSION output_col)
|
JDIMENSION output_col)
|
||||||
{
|
{
|
||||||
JLONG tmp0, tmp1, tmp2, tmp10, tmp11, tmp12;
|
JLONG tmp0, tmp1, tmp2, tmp10, tmp11, tmp12;
|
||||||
JLONG z1, z2, z3;
|
JLONG z1, z2, z3;
|
||||||
@@ -662,23 +662,23 @@ jpeg_idct_6x6 (j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
|||||||
/* Final output stage */
|
/* Final output stage */
|
||||||
|
|
||||||
outptr[0] = range_limit[(int)RIGHT_SHIFT(tmp10 + tmp0,
|
outptr[0] = range_limit[(int)RIGHT_SHIFT(tmp10 + tmp0,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[5] = range_limit[(int)RIGHT_SHIFT(tmp10 - tmp0,
|
outptr[5] = range_limit[(int)RIGHT_SHIFT(tmp10 - tmp0,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[1] = range_limit[(int)RIGHT_SHIFT(tmp11 + tmp1,
|
outptr[1] = range_limit[(int)RIGHT_SHIFT(tmp11 + tmp1,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[4] = range_limit[(int)RIGHT_SHIFT(tmp11 - tmp1,
|
outptr[4] = range_limit[(int)RIGHT_SHIFT(tmp11 - tmp1,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[2] = range_limit[(int)RIGHT_SHIFT(tmp12 + tmp2,
|
outptr[2] = range_limit[(int)RIGHT_SHIFT(tmp12 + tmp2,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[3] = range_limit[(int)RIGHT_SHIFT(tmp12 - tmp2,
|
outptr[3] = range_limit[(int)RIGHT_SHIFT(tmp12 - tmp2,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
|
|
||||||
wsptr += 6; /* advance pointer to next row */
|
wsptr += 6; /* advance pointer to next row */
|
||||||
}
|
}
|
||||||
@@ -695,8 +695,8 @@ jpeg_idct_6x6 (j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
|||||||
|
|
||||||
GLOBAL(void)
|
GLOBAL(void)
|
||||||
jpeg_idct_5x5(j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
jpeg_idct_5x5(j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
||||||
JCOEFPTR coef_block,
|
JCOEFPTR coef_block, JSAMPARRAY output_buf,
|
||||||
JSAMPARRAY output_buf, JDIMENSION output_col)
|
JDIMENSION output_col)
|
||||||
{
|
{
|
||||||
JLONG tmp0, tmp1, tmp10, tmp11, tmp12;
|
JLONG tmp0, tmp1, tmp10, tmp11, tmp12;
|
||||||
JLONG z1, z2, z3;
|
JLONG z1, z2, z3;
|
||||||
@@ -780,20 +780,20 @@ jpeg_idct_5x5 (j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
|||||||
/* Final output stage */
|
/* Final output stage */
|
||||||
|
|
||||||
outptr[0] = range_limit[(int)RIGHT_SHIFT(tmp10 + tmp0,
|
outptr[0] = range_limit[(int)RIGHT_SHIFT(tmp10 + tmp0,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[4] = range_limit[(int)RIGHT_SHIFT(tmp10 - tmp0,
|
outptr[4] = range_limit[(int)RIGHT_SHIFT(tmp10 - tmp0,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[1] = range_limit[(int)RIGHT_SHIFT(tmp11 + tmp1,
|
outptr[1] = range_limit[(int)RIGHT_SHIFT(tmp11 + tmp1,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[3] = range_limit[(int)RIGHT_SHIFT(tmp11 - tmp1,
|
outptr[3] = range_limit[(int)RIGHT_SHIFT(tmp11 - tmp1,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[2] = range_limit[(int)RIGHT_SHIFT(tmp12,
|
outptr[2] = range_limit[(int)RIGHT_SHIFT(tmp12,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
|
|
||||||
wsptr += 5; /* advance pointer to next row */
|
wsptr += 5; /* advance pointer to next row */
|
||||||
}
|
}
|
||||||
@@ -810,8 +810,8 @@ jpeg_idct_5x5 (j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
|||||||
|
|
||||||
GLOBAL(void)
|
GLOBAL(void)
|
||||||
jpeg_idct_3x3(j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
jpeg_idct_3x3(j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
||||||
JCOEFPTR coef_block,
|
JCOEFPTR coef_block, JSAMPARRAY output_buf,
|
||||||
JSAMPARRAY output_buf, JDIMENSION output_col)
|
JDIMENSION output_col)
|
||||||
{
|
{
|
||||||
JLONG tmp0, tmp2, tmp10, tmp12;
|
JLONG tmp0, tmp2, tmp10, tmp12;
|
||||||
JCOEFPTR inptr;
|
JCOEFPTR inptr;
|
||||||
@@ -876,14 +876,14 @@ jpeg_idct_3x3 (j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
|||||||
/* Final output stage */
|
/* Final output stage */
|
||||||
|
|
||||||
outptr[0] = range_limit[(int)RIGHT_SHIFT(tmp10 + tmp0,
|
outptr[0] = range_limit[(int)RIGHT_SHIFT(tmp10 + tmp0,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[2] = range_limit[(int)RIGHT_SHIFT(tmp10 - tmp0,
|
outptr[2] = range_limit[(int)RIGHT_SHIFT(tmp10 - tmp0,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[1] = range_limit[(int)RIGHT_SHIFT(tmp2,
|
outptr[1] = range_limit[(int)RIGHT_SHIFT(tmp2,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
|
|
||||||
wsptr += 3; /* advance pointer to next row */
|
wsptr += 3; /* advance pointer to next row */
|
||||||
}
|
}
|
||||||
@@ -900,8 +900,8 @@ jpeg_idct_3x3 (j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
|||||||
|
|
||||||
GLOBAL(void)
|
GLOBAL(void)
|
||||||
jpeg_idct_9x9(j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
jpeg_idct_9x9(j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
||||||
JCOEFPTR coef_block,
|
JCOEFPTR coef_block, JSAMPARRAY output_buf,
|
||||||
JSAMPARRAY output_buf, JDIMENSION output_col)
|
JDIMENSION output_col)
|
||||||
{
|
{
|
||||||
JLONG tmp0, tmp1, tmp2, tmp3, tmp10, tmp11, tmp12, tmp13, tmp14;
|
JLONG tmp0, tmp1, tmp2, tmp3, tmp10, tmp11, tmp12, tmp13, tmp14;
|
||||||
JLONG z1, z2, z3, z4;
|
JLONG z1, z2, z3, z4;
|
||||||
@@ -1029,32 +1029,32 @@ jpeg_idct_9x9 (j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
|||||||
/* Final output stage */
|
/* Final output stage */
|
||||||
|
|
||||||
outptr[0] = range_limit[(int)RIGHT_SHIFT(tmp10 + tmp0,
|
outptr[0] = range_limit[(int)RIGHT_SHIFT(tmp10 + tmp0,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[8] = range_limit[(int)RIGHT_SHIFT(tmp10 - tmp0,
|
outptr[8] = range_limit[(int)RIGHT_SHIFT(tmp10 - tmp0,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[1] = range_limit[(int)RIGHT_SHIFT(tmp11 + tmp1,
|
outptr[1] = range_limit[(int)RIGHT_SHIFT(tmp11 + tmp1,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[7] = range_limit[(int)RIGHT_SHIFT(tmp11 - tmp1,
|
outptr[7] = range_limit[(int)RIGHT_SHIFT(tmp11 - tmp1,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[2] = range_limit[(int)RIGHT_SHIFT(tmp12 + tmp2,
|
outptr[2] = range_limit[(int)RIGHT_SHIFT(tmp12 + tmp2,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[6] = range_limit[(int)RIGHT_SHIFT(tmp12 - tmp2,
|
outptr[6] = range_limit[(int)RIGHT_SHIFT(tmp12 - tmp2,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[3] = range_limit[(int)RIGHT_SHIFT(tmp13 + tmp3,
|
outptr[3] = range_limit[(int)RIGHT_SHIFT(tmp13 + tmp3,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[5] = range_limit[(int)RIGHT_SHIFT(tmp13 - tmp3,
|
outptr[5] = range_limit[(int)RIGHT_SHIFT(tmp13 - tmp3,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[4] = range_limit[(int)RIGHT_SHIFT(tmp14,
|
outptr[4] = range_limit[(int)RIGHT_SHIFT(tmp14,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
|
|
||||||
wsptr += 8; /* advance pointer to next row */
|
wsptr += 8; /* advance pointer to next row */
|
||||||
}
|
}
|
||||||
@@ -1071,8 +1071,8 @@ jpeg_idct_9x9 (j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
|||||||
|
|
||||||
GLOBAL(void)
|
GLOBAL(void)
|
||||||
jpeg_idct_10x10(j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
jpeg_idct_10x10(j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
||||||
JCOEFPTR coef_block,
|
JCOEFPTR coef_block, JSAMPARRAY output_buf,
|
||||||
JSAMPARRAY output_buf, JDIMENSION output_col)
|
JDIMENSION output_col)
|
||||||
{
|
{
|
||||||
JLONG tmp10, tmp11, tmp12, tmp13, tmp14;
|
JLONG tmp10, tmp11, tmp12, tmp13, tmp14;
|
||||||
JLONG tmp20, tmp21, tmp22, tmp23, tmp24;
|
JLONG tmp20, tmp21, tmp22, tmp23, tmp24;
|
||||||
@@ -1221,35 +1221,35 @@ jpeg_idct_10x10 (j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
|||||||
/* Final output stage */
|
/* Final output stage */
|
||||||
|
|
||||||
outptr[0] = range_limit[(int)RIGHT_SHIFT(tmp20 + tmp10,
|
outptr[0] = range_limit[(int)RIGHT_SHIFT(tmp20 + tmp10,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[9] = range_limit[(int)RIGHT_SHIFT(tmp20 - tmp10,
|
outptr[9] = range_limit[(int)RIGHT_SHIFT(tmp20 - tmp10,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[1] = range_limit[(int)RIGHT_SHIFT(tmp21 + tmp11,
|
outptr[1] = range_limit[(int)RIGHT_SHIFT(tmp21 + tmp11,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[8] = range_limit[(int)RIGHT_SHIFT(tmp21 - tmp11,
|
outptr[8] = range_limit[(int)RIGHT_SHIFT(tmp21 - tmp11,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[2] = range_limit[(int)RIGHT_SHIFT(tmp22 + tmp12,
|
outptr[2] = range_limit[(int)RIGHT_SHIFT(tmp22 + tmp12,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[7] = range_limit[(int)RIGHT_SHIFT(tmp22 - tmp12,
|
outptr[7] = range_limit[(int)RIGHT_SHIFT(tmp22 - tmp12,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[3] = range_limit[(int)RIGHT_SHIFT(tmp23 + tmp13,
|
outptr[3] = range_limit[(int)RIGHT_SHIFT(tmp23 + tmp13,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[6] = range_limit[(int)RIGHT_SHIFT(tmp23 - tmp13,
|
outptr[6] = range_limit[(int)RIGHT_SHIFT(tmp23 - tmp13,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[4] = range_limit[(int)RIGHT_SHIFT(tmp24 + tmp14,
|
outptr[4] = range_limit[(int)RIGHT_SHIFT(tmp24 + tmp14,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[5] = range_limit[(int)RIGHT_SHIFT(tmp24 - tmp14,
|
outptr[5] = range_limit[(int)RIGHT_SHIFT(tmp24 - tmp14,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
|
|
||||||
wsptr += 8; /* advance pointer to next row */
|
wsptr += 8; /* advance pointer to next row */
|
||||||
}
|
}
|
||||||
@@ -1266,8 +1266,8 @@ jpeg_idct_10x10 (j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
|||||||
|
|
||||||
GLOBAL(void)
|
GLOBAL(void)
|
||||||
jpeg_idct_11x11(j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
jpeg_idct_11x11(j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
||||||
JCOEFPTR coef_block,
|
JCOEFPTR coef_block, JSAMPARRAY output_buf,
|
||||||
JSAMPARRAY output_buf, JDIMENSION output_col)
|
JDIMENSION output_col)
|
||||||
{
|
{
|
||||||
JLONG tmp10, tmp11, tmp12, tmp13, tmp14;
|
JLONG tmp10, tmp11, tmp12, tmp13, tmp14;
|
||||||
JLONG tmp20, tmp21, tmp22, tmp23, tmp24, tmp25;
|
JLONG tmp20, tmp21, tmp22, tmp23, tmp24, tmp25;
|
||||||
@@ -1412,38 +1412,38 @@ jpeg_idct_11x11 (j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
|||||||
/* Final output stage */
|
/* Final output stage */
|
||||||
|
|
||||||
outptr[0] = range_limit[(int)RIGHT_SHIFT(tmp20 + tmp10,
|
outptr[0] = range_limit[(int)RIGHT_SHIFT(tmp20 + tmp10,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[10] = range_limit[(int)RIGHT_SHIFT(tmp20 - tmp10,
|
outptr[10] = range_limit[(int)RIGHT_SHIFT(tmp20 - tmp10,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[1] = range_limit[(int)RIGHT_SHIFT(tmp21 + tmp11,
|
outptr[1] = range_limit[(int)RIGHT_SHIFT(tmp21 + tmp11,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[9] = range_limit[(int)RIGHT_SHIFT(tmp21 - tmp11,
|
outptr[9] = range_limit[(int)RIGHT_SHIFT(tmp21 - tmp11,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[2] = range_limit[(int)RIGHT_SHIFT(tmp22 + tmp12,
|
outptr[2] = range_limit[(int)RIGHT_SHIFT(tmp22 + tmp12,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[8] = range_limit[(int)RIGHT_SHIFT(tmp22 - tmp12,
|
outptr[8] = range_limit[(int)RIGHT_SHIFT(tmp22 - tmp12,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[3] = range_limit[(int)RIGHT_SHIFT(tmp23 + tmp13,
|
outptr[3] = range_limit[(int)RIGHT_SHIFT(tmp23 + tmp13,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[7] = range_limit[(int)RIGHT_SHIFT(tmp23 - tmp13,
|
outptr[7] = range_limit[(int)RIGHT_SHIFT(tmp23 - tmp13,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[4] = range_limit[(int)RIGHT_SHIFT(tmp24 + tmp14,
|
outptr[4] = range_limit[(int)RIGHT_SHIFT(tmp24 + tmp14,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[6] = range_limit[(int)RIGHT_SHIFT(tmp24 - tmp14,
|
outptr[6] = range_limit[(int)RIGHT_SHIFT(tmp24 - tmp14,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[5] = range_limit[(int)RIGHT_SHIFT(tmp25,
|
outptr[5] = range_limit[(int)RIGHT_SHIFT(tmp25,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
|
|
||||||
wsptr += 8; /* advance pointer to next row */
|
wsptr += 8; /* advance pointer to next row */
|
||||||
}
|
}
|
||||||
@@ -1460,8 +1460,8 @@ jpeg_idct_11x11 (j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
|||||||
|
|
||||||
GLOBAL(void)
|
GLOBAL(void)
|
||||||
jpeg_idct_12x12(j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
jpeg_idct_12x12(j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
||||||
JCOEFPTR coef_block,
|
JCOEFPTR coef_block, JSAMPARRAY output_buf,
|
||||||
JSAMPARRAY output_buf, JDIMENSION output_col)
|
JDIMENSION output_col)
|
||||||
{
|
{
|
||||||
JLONG tmp10, tmp11, tmp12, tmp13, tmp14, tmp15;
|
JLONG tmp10, tmp11, tmp12, tmp13, tmp14, tmp15;
|
||||||
JLONG tmp20, tmp21, tmp22, tmp23, tmp24, tmp25;
|
JLONG tmp20, tmp21, tmp22, tmp23, tmp24, tmp25;
|
||||||
@@ -1625,41 +1625,41 @@ jpeg_idct_12x12 (j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
|||||||
/* Final output stage */
|
/* Final output stage */
|
||||||
|
|
||||||
outptr[0] = range_limit[(int)RIGHT_SHIFT(tmp20 + tmp10,
|
outptr[0] = range_limit[(int)RIGHT_SHIFT(tmp20 + tmp10,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[11] = range_limit[(int)RIGHT_SHIFT(tmp20 - tmp10,
|
outptr[11] = range_limit[(int)RIGHT_SHIFT(tmp20 - tmp10,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[1] = range_limit[(int)RIGHT_SHIFT(tmp21 + tmp11,
|
outptr[1] = range_limit[(int)RIGHT_SHIFT(tmp21 + tmp11,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[10] = range_limit[(int)RIGHT_SHIFT(tmp21 - tmp11,
|
outptr[10] = range_limit[(int)RIGHT_SHIFT(tmp21 - tmp11,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[2] = range_limit[(int)RIGHT_SHIFT(tmp22 + tmp12,
|
outptr[2] = range_limit[(int)RIGHT_SHIFT(tmp22 + tmp12,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[9] = range_limit[(int)RIGHT_SHIFT(tmp22 - tmp12,
|
outptr[9] = range_limit[(int)RIGHT_SHIFT(tmp22 - tmp12,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[3] = range_limit[(int)RIGHT_SHIFT(tmp23 + tmp13,
|
outptr[3] = range_limit[(int)RIGHT_SHIFT(tmp23 + tmp13,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[8] = range_limit[(int)RIGHT_SHIFT(tmp23 - tmp13,
|
outptr[8] = range_limit[(int)RIGHT_SHIFT(tmp23 - tmp13,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[4] = range_limit[(int)RIGHT_SHIFT(tmp24 + tmp14,
|
outptr[4] = range_limit[(int)RIGHT_SHIFT(tmp24 + tmp14,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[7] = range_limit[(int)RIGHT_SHIFT(tmp24 - tmp14,
|
outptr[7] = range_limit[(int)RIGHT_SHIFT(tmp24 - tmp14,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[5] = range_limit[(int)RIGHT_SHIFT(tmp25 + tmp15,
|
outptr[5] = range_limit[(int)RIGHT_SHIFT(tmp25 + tmp15,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[6] = range_limit[(int)RIGHT_SHIFT(tmp25 - tmp15,
|
outptr[6] = range_limit[(int)RIGHT_SHIFT(tmp25 - tmp15,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
|
|
||||||
wsptr += 8; /* advance pointer to next row */
|
wsptr += 8; /* advance pointer to next row */
|
||||||
}
|
}
|
||||||
@@ -1676,8 +1676,8 @@ jpeg_idct_12x12 (j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
|||||||
|
|
||||||
GLOBAL(void)
|
GLOBAL(void)
|
||||||
jpeg_idct_13x13(j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
jpeg_idct_13x13(j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
||||||
JCOEFPTR coef_block,
|
JCOEFPTR coef_block, JSAMPARRAY output_buf,
|
||||||
JSAMPARRAY output_buf, JDIMENSION output_col)
|
JDIMENSION output_col)
|
||||||
{
|
{
|
||||||
JLONG tmp10, tmp11, tmp12, tmp13, tmp14, tmp15;
|
JLONG tmp10, tmp11, tmp12, tmp13, tmp14, tmp15;
|
||||||
JLONG tmp20, tmp21, tmp22, tmp23, tmp24, tmp25, tmp26;
|
JLONG tmp20, tmp21, tmp22, tmp23, tmp24, tmp25, tmp26;
|
||||||
@@ -1850,44 +1850,44 @@ jpeg_idct_13x13 (j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
|||||||
/* Final output stage */
|
/* Final output stage */
|
||||||
|
|
||||||
outptr[0] = range_limit[(int)RIGHT_SHIFT(tmp20 + tmp10,
|
outptr[0] = range_limit[(int)RIGHT_SHIFT(tmp20 + tmp10,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[12] = range_limit[(int)RIGHT_SHIFT(tmp20 - tmp10,
|
outptr[12] = range_limit[(int)RIGHT_SHIFT(tmp20 - tmp10,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[1] = range_limit[(int)RIGHT_SHIFT(tmp21 + tmp11,
|
outptr[1] = range_limit[(int)RIGHT_SHIFT(tmp21 + tmp11,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[11] = range_limit[(int)RIGHT_SHIFT(tmp21 - tmp11,
|
outptr[11] = range_limit[(int)RIGHT_SHIFT(tmp21 - tmp11,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[2] = range_limit[(int)RIGHT_SHIFT(tmp22 + tmp12,
|
outptr[2] = range_limit[(int)RIGHT_SHIFT(tmp22 + tmp12,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[10] = range_limit[(int)RIGHT_SHIFT(tmp22 - tmp12,
|
outptr[10] = range_limit[(int)RIGHT_SHIFT(tmp22 - tmp12,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[3] = range_limit[(int)RIGHT_SHIFT(tmp23 + tmp13,
|
outptr[3] = range_limit[(int)RIGHT_SHIFT(tmp23 + tmp13,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[9] = range_limit[(int)RIGHT_SHIFT(tmp23 - tmp13,
|
outptr[9] = range_limit[(int)RIGHT_SHIFT(tmp23 - tmp13,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[4] = range_limit[(int)RIGHT_SHIFT(tmp24 + tmp14,
|
outptr[4] = range_limit[(int)RIGHT_SHIFT(tmp24 + tmp14,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[8] = range_limit[(int)RIGHT_SHIFT(tmp24 - tmp14,
|
outptr[8] = range_limit[(int)RIGHT_SHIFT(tmp24 - tmp14,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[5] = range_limit[(int)RIGHT_SHIFT(tmp25 + tmp15,
|
outptr[5] = range_limit[(int)RIGHT_SHIFT(tmp25 + tmp15,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[7] = range_limit[(int)RIGHT_SHIFT(tmp25 - tmp15,
|
outptr[7] = range_limit[(int)RIGHT_SHIFT(tmp25 - tmp15,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[6] = range_limit[(int)RIGHT_SHIFT(tmp26,
|
outptr[6] = range_limit[(int)RIGHT_SHIFT(tmp26,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
|
|
||||||
wsptr += 8; /* advance pointer to next row */
|
wsptr += 8; /* advance pointer to next row */
|
||||||
}
|
}
|
||||||
@@ -1904,8 +1904,8 @@ jpeg_idct_13x13 (j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
|||||||
|
|
||||||
GLOBAL(void)
|
GLOBAL(void)
|
||||||
jpeg_idct_14x14(j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
jpeg_idct_14x14(j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
||||||
JCOEFPTR coef_block,
|
JCOEFPTR coef_block, JSAMPARRAY output_buf,
|
||||||
JSAMPARRAY output_buf, JDIMENSION output_col)
|
JDIMENSION output_col)
|
||||||
{
|
{
|
||||||
JLONG tmp10, tmp11, tmp12, tmp13, tmp14, tmp15, tmp16;
|
JLONG tmp10, tmp11, tmp12, tmp13, tmp14, tmp15, tmp16;
|
||||||
JLONG tmp20, tmp21, tmp22, tmp23, tmp24, tmp25, tmp26;
|
JLONG tmp20, tmp21, tmp22, tmp23, tmp24, tmp25, tmp26;
|
||||||
@@ -2073,47 +2073,47 @@ jpeg_idct_14x14 (j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
|||||||
/* Final output stage */
|
/* Final output stage */
|
||||||
|
|
||||||
outptr[0] = range_limit[(int)RIGHT_SHIFT(tmp20 + tmp10,
|
outptr[0] = range_limit[(int)RIGHT_SHIFT(tmp20 + tmp10,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[13] = range_limit[(int)RIGHT_SHIFT(tmp20 - tmp10,
|
outptr[13] = range_limit[(int)RIGHT_SHIFT(tmp20 - tmp10,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[1] = range_limit[(int)RIGHT_SHIFT(tmp21 + tmp11,
|
outptr[1] = range_limit[(int)RIGHT_SHIFT(tmp21 + tmp11,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[12] = range_limit[(int)RIGHT_SHIFT(tmp21 - tmp11,
|
outptr[12] = range_limit[(int)RIGHT_SHIFT(tmp21 - tmp11,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[2] = range_limit[(int)RIGHT_SHIFT(tmp22 + tmp12,
|
outptr[2] = range_limit[(int)RIGHT_SHIFT(tmp22 + tmp12,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[11] = range_limit[(int)RIGHT_SHIFT(tmp22 - tmp12,
|
outptr[11] = range_limit[(int)RIGHT_SHIFT(tmp22 - tmp12,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[3] = range_limit[(int)RIGHT_SHIFT(tmp23 + tmp13,
|
outptr[3] = range_limit[(int)RIGHT_SHIFT(tmp23 + tmp13,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[10] = range_limit[(int)RIGHT_SHIFT(tmp23 - tmp13,
|
outptr[10] = range_limit[(int)RIGHT_SHIFT(tmp23 - tmp13,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[4] = range_limit[(int)RIGHT_SHIFT(tmp24 + tmp14,
|
outptr[4] = range_limit[(int)RIGHT_SHIFT(tmp24 + tmp14,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[9] = range_limit[(int)RIGHT_SHIFT(tmp24 - tmp14,
|
outptr[9] = range_limit[(int)RIGHT_SHIFT(tmp24 - tmp14,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[5] = range_limit[(int)RIGHT_SHIFT(tmp25 + tmp15,
|
outptr[5] = range_limit[(int)RIGHT_SHIFT(tmp25 + tmp15,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[8] = range_limit[(int)RIGHT_SHIFT(tmp25 - tmp15,
|
outptr[8] = range_limit[(int)RIGHT_SHIFT(tmp25 - tmp15,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[6] = range_limit[(int)RIGHT_SHIFT(tmp26 + tmp16,
|
outptr[6] = range_limit[(int)RIGHT_SHIFT(tmp26 + tmp16,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[7] = range_limit[(int)RIGHT_SHIFT(tmp26 - tmp16,
|
outptr[7] = range_limit[(int)RIGHT_SHIFT(tmp26 - tmp16,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
|
|
||||||
wsptr += 8; /* advance pointer to next row */
|
wsptr += 8; /* advance pointer to next row */
|
||||||
}
|
}
|
||||||
@@ -2130,8 +2130,8 @@ jpeg_idct_14x14 (j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
|||||||
|
|
||||||
GLOBAL(void)
|
GLOBAL(void)
|
||||||
jpeg_idct_15x15(j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
jpeg_idct_15x15(j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
||||||
JCOEFPTR coef_block,
|
JCOEFPTR coef_block, JSAMPARRAY output_buf,
|
||||||
JSAMPARRAY output_buf, JDIMENSION output_col)
|
JDIMENSION output_col)
|
||||||
{
|
{
|
||||||
JLONG tmp10, tmp11, tmp12, tmp13, tmp14, tmp15, tmp16;
|
JLONG tmp10, tmp11, tmp12, tmp13, tmp14, tmp15, tmp16;
|
||||||
JLONG tmp20, tmp21, tmp22, tmp23, tmp24, tmp25, tmp26, tmp27;
|
JLONG tmp20, tmp21, tmp22, tmp23, tmp24, tmp25, tmp26, tmp27;
|
||||||
@@ -2312,50 +2312,50 @@ jpeg_idct_15x15 (j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
|||||||
/* Final output stage */
|
/* Final output stage */
|
||||||
|
|
||||||
outptr[0] = range_limit[(int)RIGHT_SHIFT(tmp20 + tmp10,
|
outptr[0] = range_limit[(int)RIGHT_SHIFT(tmp20 + tmp10,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[14] = range_limit[(int)RIGHT_SHIFT(tmp20 - tmp10,
|
outptr[14] = range_limit[(int)RIGHT_SHIFT(tmp20 - tmp10,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[1] = range_limit[(int)RIGHT_SHIFT(tmp21 + tmp11,
|
outptr[1] = range_limit[(int)RIGHT_SHIFT(tmp21 + tmp11,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[13] = range_limit[(int)RIGHT_SHIFT(tmp21 - tmp11,
|
outptr[13] = range_limit[(int)RIGHT_SHIFT(tmp21 - tmp11,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[2] = range_limit[(int)RIGHT_SHIFT(tmp22 + tmp12,
|
outptr[2] = range_limit[(int)RIGHT_SHIFT(tmp22 + tmp12,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[12] = range_limit[(int)RIGHT_SHIFT(tmp22 - tmp12,
|
outptr[12] = range_limit[(int)RIGHT_SHIFT(tmp22 - tmp12,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[3] = range_limit[(int)RIGHT_SHIFT(tmp23 + tmp13,
|
outptr[3] = range_limit[(int)RIGHT_SHIFT(tmp23 + tmp13,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[11] = range_limit[(int)RIGHT_SHIFT(tmp23 - tmp13,
|
outptr[11] = range_limit[(int)RIGHT_SHIFT(tmp23 - tmp13,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[4] = range_limit[(int)RIGHT_SHIFT(tmp24 + tmp14,
|
outptr[4] = range_limit[(int)RIGHT_SHIFT(tmp24 + tmp14,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[10] = range_limit[(int)RIGHT_SHIFT(tmp24 - tmp14,
|
outptr[10] = range_limit[(int)RIGHT_SHIFT(tmp24 - tmp14,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[5] = range_limit[(int)RIGHT_SHIFT(tmp25 + tmp15,
|
outptr[5] = range_limit[(int)RIGHT_SHIFT(tmp25 + tmp15,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[9] = range_limit[(int)RIGHT_SHIFT(tmp25 - tmp15,
|
outptr[9] = range_limit[(int)RIGHT_SHIFT(tmp25 - tmp15,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[6] = range_limit[(int)RIGHT_SHIFT(tmp26 + tmp16,
|
outptr[6] = range_limit[(int)RIGHT_SHIFT(tmp26 + tmp16,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[8] = range_limit[(int)RIGHT_SHIFT(tmp26 - tmp16,
|
outptr[8] = range_limit[(int)RIGHT_SHIFT(tmp26 - tmp16,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[7] = range_limit[(int)RIGHT_SHIFT(tmp27,
|
outptr[7] = range_limit[(int)RIGHT_SHIFT(tmp27,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
|
|
||||||
wsptr += 8; /* advance pointer to next row */
|
wsptr += 8; /* advance pointer to next row */
|
||||||
}
|
}
|
||||||
@@ -2372,8 +2372,8 @@ jpeg_idct_15x15 (j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
|||||||
|
|
||||||
GLOBAL(void)
|
GLOBAL(void)
|
||||||
jpeg_idct_16x16(j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
jpeg_idct_16x16(j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
||||||
JCOEFPTR coef_block,
|
JCOEFPTR coef_block, JSAMPARRAY output_buf,
|
||||||
JSAMPARRAY output_buf, JDIMENSION output_col)
|
JDIMENSION output_col)
|
||||||
{
|
{
|
||||||
JLONG tmp0, tmp1, tmp2, tmp3, tmp10, tmp11, tmp12, tmp13;
|
JLONG tmp0, tmp1, tmp2, tmp3, tmp10, tmp11, tmp12, tmp13;
|
||||||
JLONG tmp20, tmp21, tmp22, tmp23, tmp24, tmp25, tmp26, tmp27;
|
JLONG tmp20, tmp21, tmp22, tmp23, tmp24, tmp25, tmp26, tmp27;
|
||||||
@@ -2571,53 +2571,53 @@ jpeg_idct_16x16 (j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
|||||||
/* Final output stage */
|
/* Final output stage */
|
||||||
|
|
||||||
outptr[0] = range_limit[(int)RIGHT_SHIFT(tmp20 + tmp0,
|
outptr[0] = range_limit[(int)RIGHT_SHIFT(tmp20 + tmp0,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[15] = range_limit[(int)RIGHT_SHIFT(tmp20 - tmp0,
|
outptr[15] = range_limit[(int)RIGHT_SHIFT(tmp20 - tmp0,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[1] = range_limit[(int)RIGHT_SHIFT(tmp21 + tmp1,
|
outptr[1] = range_limit[(int)RIGHT_SHIFT(tmp21 + tmp1,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[14] = range_limit[(int)RIGHT_SHIFT(tmp21 - tmp1,
|
outptr[14] = range_limit[(int)RIGHT_SHIFT(tmp21 - tmp1,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[2] = range_limit[(int)RIGHT_SHIFT(tmp22 + tmp2,
|
outptr[2] = range_limit[(int)RIGHT_SHIFT(tmp22 + tmp2,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[13] = range_limit[(int)RIGHT_SHIFT(tmp22 - tmp2,
|
outptr[13] = range_limit[(int)RIGHT_SHIFT(tmp22 - tmp2,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[3] = range_limit[(int)RIGHT_SHIFT(tmp23 + tmp3,
|
outptr[3] = range_limit[(int)RIGHT_SHIFT(tmp23 + tmp3,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[12] = range_limit[(int)RIGHT_SHIFT(tmp23 - tmp3,
|
outptr[12] = range_limit[(int)RIGHT_SHIFT(tmp23 - tmp3,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[4] = range_limit[(int)RIGHT_SHIFT(tmp24 + tmp10,
|
outptr[4] = range_limit[(int)RIGHT_SHIFT(tmp24 + tmp10,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[11] = range_limit[(int)RIGHT_SHIFT(tmp24 - tmp10,
|
outptr[11] = range_limit[(int)RIGHT_SHIFT(tmp24 - tmp10,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[5] = range_limit[(int)RIGHT_SHIFT(tmp25 + tmp11,
|
outptr[5] = range_limit[(int)RIGHT_SHIFT(tmp25 + tmp11,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[10] = range_limit[(int)RIGHT_SHIFT(tmp25 - tmp11,
|
outptr[10] = range_limit[(int)RIGHT_SHIFT(tmp25 - tmp11,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[6] = range_limit[(int)RIGHT_SHIFT(tmp26 + tmp12,
|
outptr[6] = range_limit[(int)RIGHT_SHIFT(tmp26 + tmp12,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[9] = range_limit[(int)RIGHT_SHIFT(tmp26 - tmp12,
|
outptr[9] = range_limit[(int)RIGHT_SHIFT(tmp26 - tmp12,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[7] = range_limit[(int)RIGHT_SHIFT(tmp27 + tmp13,
|
outptr[7] = range_limit[(int)RIGHT_SHIFT(tmp27 + tmp13,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[8] = range_limit[(int)RIGHT_SHIFT(tmp27 - tmp13,
|
outptr[8] = range_limit[(int)RIGHT_SHIFT(tmp27 - tmp13,
|
||||||
CONST_BITS+PASS1_BITS+3)
|
CONST_BITS + PASS1_BITS + 3) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
|
|
||||||
wsptr += 8; /* advance pointer to next row */
|
wsptr += 8; /* advance pointer to next row */
|
||||||
}
|
}
|
||||||
|
|||||||
+60
-54
@@ -119,8 +119,8 @@
|
|||||||
|
|
||||||
GLOBAL(void)
|
GLOBAL(void)
|
||||||
jpeg_idct_4x4(j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
jpeg_idct_4x4(j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
||||||
JCOEFPTR coef_block,
|
JCOEFPTR coef_block, JSAMPARRAY output_buf,
|
||||||
JSAMPARRAY output_buf, JDIMENSION output_col)
|
JDIMENSION output_col)
|
||||||
{
|
{
|
||||||
JLONG tmp0, tmp2, tmp10, tmp12;
|
JLONG tmp0, tmp2, tmp10, tmp12;
|
||||||
JLONG z1, z2, z3, z4;
|
JLONG z1, z2, z3, z4;
|
||||||
@@ -146,8 +146,8 @@ jpeg_idct_4x4 (j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
|||||||
inptr[DCTSIZE * 3] == 0 && inptr[DCTSIZE * 5] == 0 &&
|
inptr[DCTSIZE * 3] == 0 && inptr[DCTSIZE * 5] == 0 &&
|
||||||
inptr[DCTSIZE * 6] == 0 && inptr[DCTSIZE * 7] == 0) {
|
inptr[DCTSIZE * 6] == 0 && inptr[DCTSIZE * 7] == 0) {
|
||||||
/* AC terms all zero; we need not examine term 4 for 4x4 output */
|
/* AC terms all zero; we need not examine term 4 for 4x4 output */
|
||||||
int dcval = LEFT_SHIFT(DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]),
|
int dcval = LEFT_SHIFT(DEQUANTIZE(inptr[DCTSIZE * 0],
|
||||||
PASS1_BITS);
|
quantptr[DCTSIZE * 0]), PASS1_BITS);
|
||||||
|
|
||||||
wsptr[DCTSIZE * 0] = dcval;
|
wsptr[DCTSIZE * 0] = dcval;
|
||||||
wsptr[DCTSIZE * 1] = dcval;
|
wsptr[DCTSIZE * 1] = dcval;
|
||||||
@@ -177,22 +177,26 @@ jpeg_idct_4x4 (j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
|||||||
z3 = DEQUANTIZE(inptr[DCTSIZE * 3], quantptr[DCTSIZE * 3]);
|
z3 = DEQUANTIZE(inptr[DCTSIZE * 3], quantptr[DCTSIZE * 3]);
|
||||||
z4 = DEQUANTIZE(inptr[DCTSIZE * 1], quantptr[DCTSIZE * 1]);
|
z4 = DEQUANTIZE(inptr[DCTSIZE * 1], quantptr[DCTSIZE * 1]);
|
||||||
|
|
||||||
tmp0 = MULTIPLY(z1, - FIX_0_211164243) /* sqrt(2) * (c3-c1) */
|
tmp0 = MULTIPLY(z1, -FIX_0_211164243) + /* sqrt(2) * ( c3-c1) */
|
||||||
+ MULTIPLY(z2, FIX_1_451774981) /* sqrt(2) * (c3+c7) */
|
MULTIPLY(z2, FIX_1_451774981) + /* sqrt(2) * ( c3+c7) */
|
||||||
+ MULTIPLY(z3, - FIX_2_172734803) /* sqrt(2) * (-c1-c5) */
|
MULTIPLY(z3, -FIX_2_172734803) + /* sqrt(2) * (-c1-c5) */
|
||||||
+ MULTIPLY(z4, FIX_1_061594337); /* sqrt(2) * (c5+c7) */
|
MULTIPLY(z4, FIX_1_061594337); /* sqrt(2) * ( c5+c7) */
|
||||||
|
|
||||||
tmp2 = MULTIPLY(z1, - FIX_0_509795579) /* sqrt(2) * (c7-c5) */
|
tmp2 = MULTIPLY(z1, -FIX_0_509795579) + /* sqrt(2) * (c7-c5) */
|
||||||
+ MULTIPLY(z2, - FIX_0_601344887) /* sqrt(2) * (c5-c1) */
|
MULTIPLY(z2, -FIX_0_601344887) + /* sqrt(2) * (c5-c1) */
|
||||||
+ MULTIPLY(z3, FIX_0_899976223) /* sqrt(2) * (c3-c7) */
|
MULTIPLY(z3, FIX_0_899976223) + /* sqrt(2) * (c3-c7) */
|
||||||
+ MULTIPLY(z4, FIX_2_562915447); /* sqrt(2) * (c1+c3) */
|
MULTIPLY(z4, FIX_2_562915447); /* sqrt(2) * (c1+c3) */
|
||||||
|
|
||||||
/* Final output stage */
|
/* Final output stage */
|
||||||
|
|
||||||
wsptr[DCTSIZE*0] = (int) DESCALE(tmp10 + tmp2, CONST_BITS-PASS1_BITS+1);
|
wsptr[DCTSIZE * 0] =
|
||||||
wsptr[DCTSIZE*3] = (int) DESCALE(tmp10 - tmp2, CONST_BITS-PASS1_BITS+1);
|
(int)DESCALE(tmp10 + tmp2, CONST_BITS - PASS1_BITS + 1);
|
||||||
wsptr[DCTSIZE*1] = (int) DESCALE(tmp12 + tmp0, CONST_BITS-PASS1_BITS+1);
|
wsptr[DCTSIZE * 3] =
|
||||||
wsptr[DCTSIZE*2] = (int) DESCALE(tmp12 - tmp0, CONST_BITS-PASS1_BITS+1);
|
(int)DESCALE(tmp10 - tmp2, CONST_BITS - PASS1_BITS + 1);
|
||||||
|
wsptr[DCTSIZE * 1] =
|
||||||
|
(int)DESCALE(tmp12 + tmp0, CONST_BITS - PASS1_BITS + 1);
|
||||||
|
wsptr[DCTSIZE * 2] =
|
||||||
|
(int)DESCALE(tmp12 - tmp0, CONST_BITS - PASS1_BITS + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Pass 2: process 4 rows from work array, store into output array. */
|
/* Pass 2: process 4 rows from work array, store into output array. */
|
||||||
@@ -206,8 +210,8 @@ jpeg_idct_4x4 (j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
|||||||
if (wsptr[1] == 0 && wsptr[2] == 0 && wsptr[3] == 0 &&
|
if (wsptr[1] == 0 && wsptr[2] == 0 && wsptr[3] == 0 &&
|
||||||
wsptr[5] == 0 && wsptr[6] == 0 && wsptr[7] == 0) {
|
wsptr[5] == 0 && wsptr[6] == 0 && wsptr[7] == 0) {
|
||||||
/* AC terms all zero */
|
/* AC terms all zero */
|
||||||
JSAMPLE dcval = range_limit[(int) DESCALE((JLONG) wsptr[0], PASS1_BITS+3)
|
JSAMPLE dcval = range_limit[(int)DESCALE((JLONG)wsptr[0],
|
||||||
& RANGE_MASK];
|
PASS1_BITS + 3) & RANGE_MASK];
|
||||||
|
|
||||||
outptr[0] = dcval;
|
outptr[0] = dcval;
|
||||||
outptr[1] = dcval;
|
outptr[1] = dcval;
|
||||||
@@ -223,8 +227,8 @@ jpeg_idct_4x4 (j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
|||||||
|
|
||||||
tmp0 = LEFT_SHIFT((JLONG)wsptr[0], CONST_BITS + 1);
|
tmp0 = LEFT_SHIFT((JLONG)wsptr[0], CONST_BITS + 1);
|
||||||
|
|
||||||
tmp2 = MULTIPLY((JLONG) wsptr[2], FIX_1_847759065)
|
tmp2 = MULTIPLY((JLONG)wsptr[2], FIX_1_847759065) +
|
||||||
+ MULTIPLY((JLONG) wsptr[6], - FIX_0_765366865);
|
MULTIPLY((JLONG)wsptr[6], -FIX_0_765366865);
|
||||||
|
|
||||||
tmp10 = tmp0 + tmp2;
|
tmp10 = tmp0 + tmp2;
|
||||||
tmp12 = tmp0 - tmp2;
|
tmp12 = tmp0 - tmp2;
|
||||||
@@ -236,30 +240,30 @@ jpeg_idct_4x4 (j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
|||||||
z3 = (JLONG)wsptr[3];
|
z3 = (JLONG)wsptr[3];
|
||||||
z4 = (JLONG)wsptr[1];
|
z4 = (JLONG)wsptr[1];
|
||||||
|
|
||||||
tmp0 = MULTIPLY(z1, - FIX_0_211164243) /* sqrt(2) * (c3-c1) */
|
tmp0 = MULTIPLY(z1, -FIX_0_211164243) + /* sqrt(2) * ( c3-c1) */
|
||||||
+ MULTIPLY(z2, FIX_1_451774981) /* sqrt(2) * (c3+c7) */
|
MULTIPLY(z2, FIX_1_451774981) + /* sqrt(2) * ( c3+c7) */
|
||||||
+ MULTIPLY(z3, - FIX_2_172734803) /* sqrt(2) * (-c1-c5) */
|
MULTIPLY(z3, -FIX_2_172734803) + /* sqrt(2) * (-c1-c5) */
|
||||||
+ MULTIPLY(z4, FIX_1_061594337); /* sqrt(2) * (c5+c7) */
|
MULTIPLY(z4, FIX_1_061594337); /* sqrt(2) * ( c5+c7) */
|
||||||
|
|
||||||
tmp2 = MULTIPLY(z1, - FIX_0_509795579) /* sqrt(2) * (c7-c5) */
|
tmp2 = MULTIPLY(z1, -FIX_0_509795579) + /* sqrt(2) * (c7-c5) */
|
||||||
+ MULTIPLY(z2, - FIX_0_601344887) /* sqrt(2) * (c5-c1) */
|
MULTIPLY(z2, -FIX_0_601344887) + /* sqrt(2) * (c5-c1) */
|
||||||
+ MULTIPLY(z3, FIX_0_899976223) /* sqrt(2) * (c3-c7) */
|
MULTIPLY(z3, FIX_0_899976223) + /* sqrt(2) * (c3-c7) */
|
||||||
+ MULTIPLY(z4, FIX_2_562915447); /* sqrt(2) * (c1+c3) */
|
MULTIPLY(z4, FIX_2_562915447); /* sqrt(2) * (c1+c3) */
|
||||||
|
|
||||||
/* Final output stage */
|
/* Final output stage */
|
||||||
|
|
||||||
outptr[0] = range_limit[(int)DESCALE(tmp10 + tmp2,
|
outptr[0] = range_limit[(int)DESCALE(tmp10 + tmp2,
|
||||||
CONST_BITS+PASS1_BITS+3+1)
|
CONST_BITS + PASS1_BITS + 3 + 1) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[3] = range_limit[(int)DESCALE(tmp10 - tmp2,
|
outptr[3] = range_limit[(int)DESCALE(tmp10 - tmp2,
|
||||||
CONST_BITS+PASS1_BITS+3+1)
|
CONST_BITS + PASS1_BITS + 3 + 1) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[1] = range_limit[(int)DESCALE(tmp12 + tmp0,
|
outptr[1] = range_limit[(int)DESCALE(tmp12 + tmp0,
|
||||||
CONST_BITS+PASS1_BITS+3+1)
|
CONST_BITS + PASS1_BITS + 3 + 1) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[2] = range_limit[(int)DESCALE(tmp12 - tmp0,
|
outptr[2] = range_limit[(int)DESCALE(tmp12 - tmp0,
|
||||||
CONST_BITS+PASS1_BITS+3+1)
|
CONST_BITS + PASS1_BITS + 3 + 1) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
|
|
||||||
wsptr += DCTSIZE; /* advance pointer to next row */
|
wsptr += DCTSIZE; /* advance pointer to next row */
|
||||||
}
|
}
|
||||||
@@ -273,8 +277,8 @@ jpeg_idct_4x4 (j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
|||||||
|
|
||||||
GLOBAL(void)
|
GLOBAL(void)
|
||||||
jpeg_idct_2x2(j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
jpeg_idct_2x2(j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
||||||
JCOEFPTR coef_block,
|
JCOEFPTR coef_block, JSAMPARRAY output_buf,
|
||||||
JSAMPARRAY output_buf, JDIMENSION output_col)
|
JDIMENSION output_col)
|
||||||
{
|
{
|
||||||
JLONG tmp0, tmp10, z1;
|
JLONG tmp0, tmp10, z1;
|
||||||
JCOEFPTR inptr;
|
JCOEFPTR inptr;
|
||||||
@@ -298,8 +302,8 @@ jpeg_idct_2x2 (j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
|||||||
if (inptr[DCTSIZE * 1] == 0 && inptr[DCTSIZE * 3] == 0 &&
|
if (inptr[DCTSIZE * 1] == 0 && inptr[DCTSIZE * 3] == 0 &&
|
||||||
inptr[DCTSIZE * 5] == 0 && inptr[DCTSIZE * 7] == 0) {
|
inptr[DCTSIZE * 5] == 0 && inptr[DCTSIZE * 7] == 0) {
|
||||||
/* AC terms all zero; we need not examine terms 2,4,6 for 2x2 output */
|
/* AC terms all zero; we need not examine terms 2,4,6 for 2x2 output */
|
||||||
int dcval = LEFT_SHIFT(DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]),
|
int dcval = LEFT_SHIFT(DEQUANTIZE(inptr[DCTSIZE * 0],
|
||||||
PASS1_BITS);
|
quantptr[DCTSIZE * 0]), PASS1_BITS);
|
||||||
|
|
||||||
wsptr[DCTSIZE * 0] = dcval;
|
wsptr[DCTSIZE * 0] = dcval;
|
||||||
wsptr[DCTSIZE * 1] = dcval;
|
wsptr[DCTSIZE * 1] = dcval;
|
||||||
@@ -325,8 +329,10 @@ jpeg_idct_2x2 (j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
|||||||
|
|
||||||
/* Final output stage */
|
/* Final output stage */
|
||||||
|
|
||||||
wsptr[DCTSIZE*0] = (int) DESCALE(tmp10 + tmp0, CONST_BITS-PASS1_BITS+2);
|
wsptr[DCTSIZE * 0] =
|
||||||
wsptr[DCTSIZE*1] = (int) DESCALE(tmp10 - tmp0, CONST_BITS-PASS1_BITS+2);
|
(int)DESCALE(tmp10 + tmp0, CONST_BITS - PASS1_BITS + 2);
|
||||||
|
wsptr[DCTSIZE * 1] =
|
||||||
|
(int)DESCALE(tmp10 - tmp0, CONST_BITS - PASS1_BITS + 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Pass 2: process 2 rows from work array, store into output array. */
|
/* Pass 2: process 2 rows from work array, store into output array. */
|
||||||
@@ -339,8 +345,8 @@ jpeg_idct_2x2 (j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
|||||||
#ifndef NO_ZERO_ROW_TEST
|
#ifndef NO_ZERO_ROW_TEST
|
||||||
if (wsptr[1] == 0 && wsptr[3] == 0 && wsptr[5] == 0 && wsptr[7] == 0) {
|
if (wsptr[1] == 0 && wsptr[3] == 0 && wsptr[5] == 0 && wsptr[7] == 0) {
|
||||||
/* AC terms all zero */
|
/* AC terms all zero */
|
||||||
JSAMPLE dcval = range_limit[(int) DESCALE((JLONG) wsptr[0], PASS1_BITS+3)
|
JSAMPLE dcval = range_limit[(int)DESCALE((JLONG)wsptr[0],
|
||||||
& RANGE_MASK];
|
PASS1_BITS + 3) & RANGE_MASK];
|
||||||
|
|
||||||
outptr[0] = dcval;
|
outptr[0] = dcval;
|
||||||
outptr[1] = dcval;
|
outptr[1] = dcval;
|
||||||
@@ -356,19 +362,19 @@ jpeg_idct_2x2 (j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
|||||||
|
|
||||||
/* Odd part */
|
/* Odd part */
|
||||||
|
|
||||||
tmp0 = MULTIPLY((JLONG) wsptr[7], - FIX_0_720959822) /* sqrt(2) * (c7-c5+c3-c1) */
|
tmp0 = MULTIPLY((JLONG)wsptr[7], -FIX_0_720959822) + /* sqrt(2) * ( c7-c5+c3-c1) */
|
||||||
+ MULTIPLY((JLONG) wsptr[5], FIX_0_850430095) /* sqrt(2) * (-c1+c3+c5+c7) */
|
MULTIPLY((JLONG)wsptr[5], FIX_0_850430095) + /* sqrt(2) * (-c1+c3+c5+c7) */
|
||||||
+ MULTIPLY((JLONG) wsptr[3], - FIX_1_272758580) /* sqrt(2) * (-c1+c3-c5-c7) */
|
MULTIPLY((JLONG)wsptr[3], -FIX_1_272758580) + /* sqrt(2) * (-c1+c3-c5-c7) */
|
||||||
+ MULTIPLY((JLONG) wsptr[1], FIX_3_624509785); /* sqrt(2) * (c1+c3+c5+c7) */
|
MULTIPLY((JLONG)wsptr[1], FIX_3_624509785); /* sqrt(2) * ( c1+c3+c5+c7) */
|
||||||
|
|
||||||
/* Final output stage */
|
/* Final output stage */
|
||||||
|
|
||||||
outptr[0] = range_limit[(int)DESCALE(tmp10 + tmp0,
|
outptr[0] = range_limit[(int)DESCALE(tmp10 + tmp0,
|
||||||
CONST_BITS+PASS1_BITS+3+2)
|
CONST_BITS + PASS1_BITS + 3 + 2) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
outptr[1] = range_limit[(int)DESCALE(tmp10 - tmp0,
|
outptr[1] = range_limit[(int)DESCALE(tmp10 - tmp0,
|
||||||
CONST_BITS+PASS1_BITS+3+2)
|
CONST_BITS + PASS1_BITS + 3 + 2) &
|
||||||
& RANGE_MASK];
|
RANGE_MASK];
|
||||||
|
|
||||||
wsptr += DCTSIZE; /* advance pointer to next row */
|
wsptr += DCTSIZE; /* advance pointer to next row */
|
||||||
}
|
}
|
||||||
@@ -382,8 +388,8 @@ jpeg_idct_2x2 (j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
|||||||
|
|
||||||
GLOBAL(void)
|
GLOBAL(void)
|
||||||
jpeg_idct_1x1(j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
jpeg_idct_1x1(j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
||||||
JCOEFPTR coef_block,
|
JCOEFPTR coef_block, JSAMPARRAY output_buf,
|
||||||
JSAMPARRAY output_buf, JDIMENSION output_col)
|
JDIMENSION output_col)
|
||||||
{
|
{
|
||||||
int dcval;
|
int dcval;
|
||||||
ISLOW_MULT_TYPE *quantptr;
|
ISLOW_MULT_TYPE *quantptr;
|
||||||
|
|||||||
+8
-4
@@ -61,14 +61,18 @@
|
|||||||
#ifdef NEED_BSD_STRINGS
|
#ifdef NEED_BSD_STRINGS
|
||||||
|
|
||||||
#include <strings.h>
|
#include <strings.h>
|
||||||
#define MEMZERO(target,size) bzero((void *)(target), (size_t)(size))
|
#define MEMZERO(target, size) \
|
||||||
#define MEMCOPY(dest,src,size) bcopy((const void *)(src), (void *)(dest), (size_t)(size))
|
bzero((void *)(target), (size_t)(size))
|
||||||
|
#define MEMCOPY(dest, src, size) \
|
||||||
|
bcopy((const void *)(src), (void *)(dest), (size_t)(size))
|
||||||
|
|
||||||
#else /* not BSD, assume ANSI/SysV string lib */
|
#else /* not BSD, assume ANSI/SysV string lib */
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#define MEMZERO(target,size) memset((void *)(target), 0, (size_t)(size))
|
#define MEMZERO(target, size) \
|
||||||
#define MEMCOPY(dest,src,size) memcpy((void *)(dest), (const void *)(src), (size_t)(size))
|
memset((void *)(target), 0, (size_t)(size))
|
||||||
|
#define MEMCOPY(dest, src, size) \
|
||||||
|
memcpy((void *)(dest), (const void *)(src), (size_t)(size))
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
Vendored
+21
-25
@@ -32,7 +32,7 @@
|
|||||||
#include "jinclude.h"
|
#include "jinclude.h"
|
||||||
#include "jpeglib.h"
|
#include "jpeglib.h"
|
||||||
#include "jmemsys.h" /* import the system-dependent declarations */
|
#include "jmemsys.h" /* import the system-dependent declarations */
|
||||||
#ifndef _WIN32
|
#if !defined(_MSC_VER) || _MSC_VER > 1600
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#endif
|
#endif
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
@@ -89,7 +89,9 @@ round_up_pow2 (size_t a, size_t b)
|
|||||||
#ifndef WITH_SIMD
|
#ifndef WITH_SIMD
|
||||||
#define ALIGN_SIZE sizeof(double)
|
#define ALIGN_SIZE sizeof(double)
|
||||||
#else
|
#else
|
||||||
#define ALIGN_SIZE 16 /* Most SIMD implementations require this */
|
#define ALIGN_SIZE 32 /* Most of the SIMD instructions we support require
|
||||||
|
16-byte (128-bit) alignment, but AVX2 requires
|
||||||
|
32-byte alignment. */
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -206,15 +208,13 @@ print_mem_stats (j_common_ptr cinfo, int pool_id)
|
|||||||
|
|
||||||
for (lhdr_ptr = mem->large_list[pool_id]; lhdr_ptr != NULL;
|
for (lhdr_ptr = mem->large_list[pool_id]; lhdr_ptr != NULL;
|
||||||
lhdr_ptr = lhdr_ptr->next) {
|
lhdr_ptr = lhdr_ptr->next) {
|
||||||
fprintf(stderr, " Large chunk used %ld\n",
|
fprintf(stderr, " Large chunk used %ld\n", (long)lhdr_ptr->bytes_used);
|
||||||
(long) lhdr_ptr->bytes_used);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (shdr_ptr = mem->small_list[pool_id]; shdr_ptr != NULL;
|
for (shdr_ptr = mem->small_list[pool_id]; shdr_ptr != NULL;
|
||||||
shdr_ptr = shdr_ptr->next) {
|
shdr_ptr = shdr_ptr->next) {
|
||||||
fprintf(stderr, " Small chunk used %ld free %ld\n",
|
fprintf(stderr, " Small chunk used %ld free %ld\n",
|
||||||
(long) shdr_ptr->bytes_used,
|
(long)shdr_ptr->bytes_used, (long)shdr_ptr->bytes_left);
|
||||||
(long) shdr_ptr->bytes_left);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -250,14 +250,12 @@ out_of_memory (j_common_ptr cinfo, int which)
|
|||||||
* adjustment.
|
* adjustment.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static const size_t first_pool_slop[JPOOL_NUMPOOLS] =
|
static const size_t first_pool_slop[JPOOL_NUMPOOLS] = {
|
||||||
{
|
|
||||||
1600, /* first PERMANENT pool */
|
1600, /* first PERMANENT pool */
|
||||||
16000 /* first IMAGE pool */
|
16000 /* first IMAGE pool */
|
||||||
};
|
};
|
||||||
|
|
||||||
static const size_t extra_pool_slop[JPOOL_NUMPOOLS] =
|
static const size_t extra_pool_slop[JPOOL_NUMPOOLS] = {
|
||||||
{
|
|
||||||
0, /* additional PERMANENT pools */
|
0, /* additional PERMANENT pools */
|
||||||
5000 /* additional IMAGE pools */
|
5000 /* additional IMAGE pools */
|
||||||
};
|
};
|
||||||
@@ -433,8 +431,8 @@ alloc_large (j_common_ptr cinfo, int pool_id, size_t sizeofobject)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
METHODDEF(JSAMPARRAY)
|
METHODDEF(JSAMPARRAY)
|
||||||
alloc_sarray (j_common_ptr cinfo, int pool_id,
|
alloc_sarray(j_common_ptr cinfo, int pool_id, JDIMENSION samplesperrow,
|
||||||
JDIMENSION samplesperrow, JDIMENSION numrows)
|
JDIMENSION numrows)
|
||||||
/* Allocate a 2-D sample array */
|
/* Allocate a 2-D sample array */
|
||||||
{
|
{
|
||||||
my_mem_ptr mem = (my_mem_ptr)cinfo->mem;
|
my_mem_ptr mem = (my_mem_ptr)cinfo->mem;
|
||||||
@@ -475,8 +473,8 @@ alloc_sarray (j_common_ptr cinfo, int pool_id,
|
|||||||
while (currow < numrows) {
|
while (currow < numrows) {
|
||||||
rowsperchunk = MIN(rowsperchunk, numrows - currow);
|
rowsperchunk = MIN(rowsperchunk, numrows - currow);
|
||||||
workspace = (JSAMPROW)alloc_large(cinfo, pool_id,
|
workspace = (JSAMPROW)alloc_large(cinfo, pool_id,
|
||||||
(size_t) ((size_t) rowsperchunk * (size_t) samplesperrow
|
(size_t)((size_t)rowsperchunk * (size_t)samplesperrow *
|
||||||
* sizeof(JSAMPLE)));
|
sizeof(JSAMPLE)));
|
||||||
for (i = rowsperchunk; i > 0; i--) {
|
for (i = rowsperchunk; i > 0; i--) {
|
||||||
result[currow++] = workspace;
|
result[currow++] = workspace;
|
||||||
workspace += samplesperrow;
|
workspace += samplesperrow;
|
||||||
@@ -493,8 +491,8 @@ alloc_sarray (j_common_ptr cinfo, int pool_id,
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
METHODDEF(JBLOCKARRAY)
|
METHODDEF(JBLOCKARRAY)
|
||||||
alloc_barray (j_common_ptr cinfo, int pool_id,
|
alloc_barray(j_common_ptr cinfo, int pool_id, JDIMENSION blocksperrow,
|
||||||
JDIMENSION blocksperrow, JDIMENSION numrows)
|
JDIMENSION numrows)
|
||||||
/* Allocate a 2-D coefficient-block array */
|
/* Allocate a 2-D coefficient-block array */
|
||||||
{
|
{
|
||||||
my_mem_ptr mem = (my_mem_ptr)cinfo->mem;
|
my_mem_ptr mem = (my_mem_ptr)cinfo->mem;
|
||||||
@@ -527,8 +525,8 @@ alloc_barray (j_common_ptr cinfo, int pool_id,
|
|||||||
while (currow < numrows) {
|
while (currow < numrows) {
|
||||||
rowsperchunk = MIN(rowsperchunk, numrows - currow);
|
rowsperchunk = MIN(rowsperchunk, numrows - currow);
|
||||||
workspace = (JBLOCKROW)alloc_large(cinfo, pool_id,
|
workspace = (JBLOCKROW)alloc_large(cinfo, pool_id,
|
||||||
(size_t) ((size_t) rowsperchunk * (size_t) blocksperrow
|
(size_t)((size_t)rowsperchunk * (size_t)blocksperrow *
|
||||||
* sizeof(JBLOCK)));
|
sizeof(JBLOCK)));
|
||||||
for (i = rowsperchunk; i > 0; i--) {
|
for (i = rowsperchunk; i > 0; i--) {
|
||||||
result[currow++] = workspace;
|
result[currow++] = workspace;
|
||||||
workspace += blocksperrow;
|
workspace += blocksperrow;
|
||||||
@@ -819,8 +817,7 @@ do_barray_io (j_common_ptr cinfo, jvirt_barray_ptr ptr, boolean writing)
|
|||||||
|
|
||||||
METHODDEF(JSAMPARRAY)
|
METHODDEF(JSAMPARRAY)
|
||||||
access_virt_sarray(j_common_ptr cinfo, jvirt_sarray_ptr ptr,
|
access_virt_sarray(j_common_ptr cinfo, jvirt_sarray_ptr ptr,
|
||||||
JDIMENSION start_row, JDIMENSION num_rows,
|
JDIMENSION start_row, JDIMENSION num_rows, boolean writable)
|
||||||
boolean writable)
|
|
||||||
/* Access the part of a virtual sample array starting at start_row */
|
/* Access the part of a virtual sample array starting at start_row */
|
||||||
/* and extending for num_rows rows. writable is true if */
|
/* and extending for num_rows rows. writable is true if */
|
||||||
/* caller intends to modify the accessed area. */
|
/* caller intends to modify the accessed area. */
|
||||||
@@ -904,8 +901,7 @@ access_virt_sarray (j_common_ptr cinfo, jvirt_sarray_ptr ptr,
|
|||||||
|
|
||||||
METHODDEF(JBLOCKARRAY)
|
METHODDEF(JBLOCKARRAY)
|
||||||
access_virt_barray(j_common_ptr cinfo, jvirt_barray_ptr ptr,
|
access_virt_barray(j_common_ptr cinfo, jvirt_barray_ptr ptr,
|
||||||
JDIMENSION start_row, JDIMENSION num_rows,
|
JDIMENSION start_row, JDIMENSION num_rows, boolean writable)
|
||||||
boolean writable)
|
|
||||||
/* Access the part of a virtual block array starting at start_row */
|
/* Access the part of a virtual block array starting at start_row */
|
||||||
/* and extending for num_rows rows. writable is true if */
|
/* and extending for num_rows rows. writable is true if */
|
||||||
/* caller intends to modify the accessed area. */
|
/* caller intends to modify the accessed area. */
|
||||||
@@ -1048,8 +1044,7 @@ free_pool (j_common_ptr cinfo, int pool_id)
|
|||||||
|
|
||||||
while (shdr_ptr != NULL) {
|
while (shdr_ptr != NULL) {
|
||||||
small_pool_ptr next_shdr_ptr = shdr_ptr->next;
|
small_pool_ptr next_shdr_ptr = shdr_ptr->next;
|
||||||
space_freed = shdr_ptr->bytes_used +
|
space_freed = shdr_ptr->bytes_used + shdr_ptr->bytes_left +
|
||||||
shdr_ptr->bytes_left +
|
|
||||||
sizeof(small_pool_hdr);
|
sizeof(small_pool_hdr);
|
||||||
jpeg_free_small(cinfo, (void *)shdr_ptr, space_freed);
|
jpeg_free_small(cinfo, (void *)shdr_ptr, space_freed);
|
||||||
mem->total_space_allocated -= space_freed;
|
mem->total_space_allocated -= space_freed;
|
||||||
@@ -1166,7 +1161,8 @@ jinit_memory_mgr (j_common_ptr cinfo)
|
|||||||
* this feature.
|
* this feature.
|
||||||
*/
|
*/
|
||||||
#ifndef NO_GETENV
|
#ifndef NO_GETENV
|
||||||
{ char *memenv;
|
{
|
||||||
|
char *memenv;
|
||||||
|
|
||||||
if ((memenv = getenv("JPEGMEM")) != NULL) {
|
if ((memenv = getenv("JPEGMEM")) != NULL) {
|
||||||
char ch = 'x';
|
char ch = 'x';
|
||||||
|
|||||||
+2
-2
@@ -4,7 +4,7 @@
|
|||||||
* This file was part of the Independent JPEG Group's software:
|
* This file was part of the Independent JPEG Group's software:
|
||||||
* Copyright (C) 1992-1996, Thomas G. Lane.
|
* Copyright (C) 1992-1996, Thomas G. Lane.
|
||||||
* libjpeg-turbo Modifications:
|
* libjpeg-turbo Modifications:
|
||||||
* Copyright (C) 2017, D. R. Commander.
|
* Copyright (C) 2017-2018, D. R. Commander.
|
||||||
* For conditions of distribution and use, see the accompanying README.ijg
|
* For conditions of distribution and use, see the accompanying README.ijg
|
||||||
* file.
|
* file.
|
||||||
*
|
*
|
||||||
@@ -72,7 +72,7 @@ jpeg_mem_available (j_common_ptr cinfo, size_t min_bytes_needed,
|
|||||||
size_t max_bytes_needed, size_t already_allocated)
|
size_t max_bytes_needed, size_t already_allocated)
|
||||||
{
|
{
|
||||||
if (cinfo->mem->max_memory_to_use) {
|
if (cinfo->mem->max_memory_to_use) {
|
||||||
if (cinfo->mem->max_memory_to_use > already_allocated)
|
if ((size_t)cinfo->mem->max_memory_to_use > already_allocated)
|
||||||
return cinfo->mem->max_memory_to_use - already_allocated;
|
return cinfo->mem->max_memory_to_use - already_allocated;
|
||||||
else
|
else
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
+8
-8
@@ -5,7 +5,7 @@
|
|||||||
* Copyright (C) 1991-1997, Thomas G. Lane.
|
* Copyright (C) 1991-1997, Thomas G. Lane.
|
||||||
* Modified 1997-2009 by Guido Vollbeding.
|
* Modified 1997-2009 by Guido Vollbeding.
|
||||||
* libjpeg-turbo Modifications:
|
* libjpeg-turbo Modifications:
|
||||||
* Copyright (C) 2009, 2011, 2014-2015, D. R. Commander.
|
* Copyright (C) 2009, 2011, 2014-2015, 2018, D. R. Commander.
|
||||||
* For conditions of distribution and use, see the accompanying README.ijg
|
* For conditions of distribution and use, see the accompanying README.ijg
|
||||||
* file.
|
* file.
|
||||||
*
|
*
|
||||||
@@ -17,9 +17,9 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Maximum number of components (color channels) allowed in JPEG image.
|
* Maximum number of components (color channels) allowed in JPEG image.
|
||||||
* To meet the letter of the JPEG spec, set this to 255. However, darn
|
* To meet the letter of Rec. ITU-T T.81 | ISO/IEC 10918-1, set this to 255.
|
||||||
* few applications need more than 4 channels (maybe 5 for CMYK + alpha
|
* However, darn few applications need more than 4 channels (maybe 5 for CMYK +
|
||||||
* mask). We recommend 10 as a reasonable compromise; use 4 if you are
|
* alpha mask). We recommend 10 as a reasonable compromise; use 4 if you are
|
||||||
* really short on memory. (Each allowed component costs a hundred or so
|
* really short on memory. (Each allowed component costs a hundred or so
|
||||||
* bytes of storage, whether actually used in an image or not.)
|
* bytes of storage, whether actually used in an image or not.)
|
||||||
*/
|
*/
|
||||||
@@ -315,10 +315,10 @@ typedef int boolean;
|
|||||||
* with it. In reality, few people ever did this, because there were some
|
* with it. In reality, few people ever did this, because there were some
|
||||||
* severe restrictions involved (cjpeg and djpeg no longer worked properly,
|
* severe restrictions involved (cjpeg and djpeg no longer worked properly,
|
||||||
* compressing/decompressing RGB JPEGs no longer worked properly, and the color
|
* compressing/decompressing RGB JPEGs no longer worked properly, and the color
|
||||||
* quantizer wouldn't work with pixel sizes other than 3.) Further, since all
|
* quantizer wouldn't work with pixel sizes other than 3.) Furthermore, since
|
||||||
* of the O/S-supplied versions of libjpeg were built with the default values
|
* all of the O/S-supplied versions of libjpeg were built with the default
|
||||||
* of RGB_RED, RGB_GREEN, RGB_BLUE, and RGB_PIXELSIZE, many applications have
|
* values of RGB_RED, RGB_GREEN, RGB_BLUE, and RGB_PIXELSIZE, many applications
|
||||||
* come to regard these values as immutable.
|
* have come to regard these values as immutable.
|
||||||
*
|
*
|
||||||
* The libjpeg-turbo colorspace extensions provide a much cleaner way of
|
* The libjpeg-turbo colorspace extensions provide a much cleaner way of
|
||||||
* compressing from/decompressing to buffers with arbitrary component orders
|
* compressing from/decompressing to buffers with arbitrary component orders
|
||||||
|
|||||||
Vendored
+13
-3
@@ -5,7 +5,7 @@
|
|||||||
* Copyright (C) 1991-1998, Thomas G. Lane.
|
* Copyright (C) 1991-1998, Thomas G. Lane.
|
||||||
* Modified 2002-2009 by Guido Vollbeding.
|
* Modified 2002-2009 by Guido Vollbeding.
|
||||||
* libjpeg-turbo Modifications:
|
* libjpeg-turbo Modifications:
|
||||||
* Copyright (C) 2009-2011, 2013-2014, 2016, D. R. Commander.
|
* Copyright (C) 2009-2011, 2013-2014, 2016-2017, D. R. Commander.
|
||||||
* Copyright (C) 2015, Google, Inc.
|
* Copyright (C) 2015, Google, Inc.
|
||||||
* For conditions of distribution and use, see the accompanying README.ijg
|
* For conditions of distribution and use, see the accompanying README.ijg
|
||||||
* file.
|
* file.
|
||||||
@@ -921,8 +921,7 @@ EXTERN(void) jpeg_stdio_src (j_decompress_ptr cinfo, FILE *infile);
|
|||||||
EXTERN(void) jpeg_mem_dest(j_compress_ptr cinfo, unsigned char **outbuffer,
|
EXTERN(void) jpeg_mem_dest(j_compress_ptr cinfo, unsigned char **outbuffer,
|
||||||
unsigned long *outsize);
|
unsigned long *outsize);
|
||||||
EXTERN(void) jpeg_mem_src(j_decompress_ptr cinfo,
|
EXTERN(void) jpeg_mem_src(j_decompress_ptr cinfo,
|
||||||
const unsigned char *inbuffer,
|
const unsigned char *inbuffer, unsigned long insize);
|
||||||
unsigned long insize);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Default parameter setup for compression */
|
/* Default parameter setup for compression */
|
||||||
@@ -976,6 +975,12 @@ EXTERN(void) jpeg_write_m_byte (j_compress_ptr cinfo, int val);
|
|||||||
/* Alternate compression function: just write an abbreviated table file */
|
/* Alternate compression function: just write an abbreviated table file */
|
||||||
EXTERN(void) jpeg_write_tables(j_compress_ptr cinfo);
|
EXTERN(void) jpeg_write_tables(j_compress_ptr cinfo);
|
||||||
|
|
||||||
|
/* Write ICC profile. See libjpeg.txt for usage information. */
|
||||||
|
EXTERN(void) jpeg_write_icc_profile(j_compress_ptr cinfo,
|
||||||
|
const JOCTET *icc_data_ptr,
|
||||||
|
unsigned int icc_data_len);
|
||||||
|
|
||||||
|
|
||||||
/* Decompression startup: read start of JPEG datastream to see what's there */
|
/* Decompression startup: read start of JPEG datastream to see what's there */
|
||||||
EXTERN(int) jpeg_read_header(j_decompress_ptr cinfo, boolean require_image);
|
EXTERN(int) jpeg_read_header(j_decompress_ptr cinfo, boolean require_image);
|
||||||
/* Return value is one of: */
|
/* Return value is one of: */
|
||||||
@@ -1057,6 +1062,11 @@ EXTERN(void) jpeg_destroy (j_common_ptr cinfo);
|
|||||||
/* Default restart-marker-resync procedure for use by data source modules */
|
/* Default restart-marker-resync procedure for use by data source modules */
|
||||||
EXTERN(boolean) jpeg_resync_to_restart(j_decompress_ptr cinfo, int desired);
|
EXTERN(boolean) jpeg_resync_to_restart(j_decompress_ptr cinfo, int desired);
|
||||||
|
|
||||||
|
/* Read ICC profile. See libjpeg.txt for usage information. */
|
||||||
|
EXTERN(boolean) jpeg_read_icc_profile(j_decompress_ptr cinfo,
|
||||||
|
JOCTET **icc_data_ptr,
|
||||||
|
unsigned int *icc_data_len);
|
||||||
|
|
||||||
|
|
||||||
/* These marker codes are exported since applications and data source modules
|
/* These marker codes are exported since applications and data source modules
|
||||||
* are likely to want to use them.
|
* are likely to want to use them.
|
||||||
|
|||||||
Vendored
+16
-14
@@ -74,7 +74,8 @@
|
|||||||
#define ODITHER_SIZE 16 /* dimension of dither matrix */
|
#define ODITHER_SIZE 16 /* dimension of dither matrix */
|
||||||
/* NB: if ODITHER_SIZE is not a power of 2, ODITHER_MASK uses will break */
|
/* NB: if ODITHER_SIZE is not a power of 2, ODITHER_MASK uses will break */
|
||||||
#define ODITHER_CELLS (ODITHER_SIZE * ODITHER_SIZE) /* # cells in matrix */
|
#define ODITHER_CELLS (ODITHER_SIZE * ODITHER_SIZE) /* # cells in matrix */
|
||||||
#define ODITHER_MASK (ODITHER_SIZE-1) /* mask for wrapping around counters */
|
#define ODITHER_MASK (ODITHER_SIZE - 1) /* mask for wrapping around
|
||||||
|
counters */
|
||||||
|
|
||||||
typedef int ODITHER_MATRIX[ODITHER_SIZE][ODITHER_SIZE];
|
typedef int ODITHER_MATRIX[ODITHER_SIZE][ODITHER_SIZE];
|
||||||
typedef int (*ODITHER_MATRIX_PTR)[ODITHER_SIZE];
|
typedef int (*ODITHER_MATRIX_PTR)[ODITHER_SIZE];
|
||||||
@@ -153,7 +154,7 @@ typedef struct {
|
|||||||
*/
|
*/
|
||||||
boolean is_padded; /* is the colorindex padded for odither? */
|
boolean is_padded; /* is the colorindex padded for odither? */
|
||||||
|
|
||||||
int Ncolors[MAX_Q_COMPS]; /* # of values alloced to each component */
|
int Ncolors[MAX_Q_COMPS]; /* # of values allocated to each component */
|
||||||
|
|
||||||
/* Variables for ordered dithering */
|
/* Variables for ordered dithering */
|
||||||
int row_index; /* cur row's vertical index in dither matrix */
|
int row_index; /* cur row's vertical index in dither matrix */
|
||||||
@@ -285,9 +286,9 @@ create_colormap (j_decompress_ptr cinfo)
|
|||||||
|
|
||||||
/* Report selected color counts */
|
/* Report selected color counts */
|
||||||
if (cinfo->out_color_components == 3)
|
if (cinfo->out_color_components == 3)
|
||||||
TRACEMS4(cinfo, 1, JTRC_QUANT_3_NCOLORS,
|
TRACEMS4(cinfo, 1, JTRC_QUANT_3_NCOLORS, total_colors,
|
||||||
total_colors, cquantize->Ncolors[0],
|
cquantize->Ncolors[0], cquantize->Ncolors[1],
|
||||||
cquantize->Ncolors[1], cquantize->Ncolors[2]);
|
cquantize->Ncolors[2]);
|
||||||
else
|
else
|
||||||
TRACEMS1(cinfo, 1, JTRC_QUANT_NCOLORS, total_colors);
|
TRACEMS1(cinfo, 1, JTRC_QUANT_NCOLORS, total_colors);
|
||||||
|
|
||||||
@@ -413,8 +414,8 @@ make_odither_array (j_decompress_ptr cinfo, int ncolors)
|
|||||||
den = 2 * ODITHER_CELLS * ((JLONG)(ncolors - 1));
|
den = 2 * ODITHER_CELLS * ((JLONG)(ncolors - 1));
|
||||||
for (j = 0; j < ODITHER_SIZE; j++) {
|
for (j = 0; j < ODITHER_SIZE; j++) {
|
||||||
for (k = 0; k < ODITHER_SIZE; k++) {
|
for (k = 0; k < ODITHER_SIZE; k++) {
|
||||||
num = ((JLONG) (ODITHER_CELLS-1 - 2*((int)base_dither_matrix[j][k])))
|
num = ((JLONG)(ODITHER_CELLS - 1 -
|
||||||
* MAXJSAMPLE;
|
2 * ((int)base_dither_matrix[j][k]))) * MAXJSAMPLE;
|
||||||
/* Ensure round towards zero despite C's lack of consistency
|
/* Ensure round towards zero despite C's lack of consistency
|
||||||
* about rounding negative values in integer division...
|
* about rounding negative values in integer division...
|
||||||
*/
|
*/
|
||||||
@@ -550,7 +551,8 @@ quantize_ord_dither (j_decompress_ptr cinfo, JSAMPARRAY input_buf,
|
|||||||
* inputs. The maximum dither is +- MAXJSAMPLE; this sets the
|
* inputs. The maximum dither is +- MAXJSAMPLE; this sets the
|
||||||
* required amount of padding.
|
* required amount of padding.
|
||||||
*/
|
*/
|
||||||
*output_ptr += colorindex_ci[GETJSAMPLE(*input_ptr)+dither[col_index]];
|
*output_ptr +=
|
||||||
|
colorindex_ci[GETJSAMPLE(*input_ptr) + dither[col_index]];
|
||||||
input_ptr += nc;
|
input_ptr += nc;
|
||||||
output_ptr++;
|
output_ptr++;
|
||||||
col_index = (col_index + 1) & ODITHER_MASK;
|
col_index = (col_index + 1) & ODITHER_MASK;
|
||||||
@@ -593,12 +595,12 @@ quantize3_ord_dither (j_decompress_ptr cinfo, JSAMPARRAY input_buf,
|
|||||||
col_index = 0;
|
col_index = 0;
|
||||||
|
|
||||||
for (col = width; col > 0; col--) {
|
for (col = width; col > 0; col--) {
|
||||||
pixcode = GETJSAMPLE(colorindex0[GETJSAMPLE(*input_ptr++) +
|
pixcode =
|
||||||
dither0[col_index]]);
|
GETJSAMPLE(colorindex0[GETJSAMPLE(*input_ptr++) + dither0[col_index]]);
|
||||||
pixcode += GETJSAMPLE(colorindex1[GETJSAMPLE(*input_ptr++) +
|
pixcode +=
|
||||||
dither1[col_index]]);
|
GETJSAMPLE(colorindex1[GETJSAMPLE(*input_ptr++) + dither1[col_index]]);
|
||||||
pixcode += GETJSAMPLE(colorindex2[GETJSAMPLE(*input_ptr++) +
|
pixcode +=
|
||||||
dither2[col_index]]);
|
GETJSAMPLE(colorindex2[GETJSAMPLE(*input_ptr++) + dither2[col_index]]);
|
||||||
*output_ptr++ = (JSAMPLE)pixcode;
|
*output_ptr++ = (JSAMPLE)pixcode;
|
||||||
col_index = (col_index + 1) & ODITHER_MASK;
|
col_index = (col_index + 1) & ODITHER_MASK;
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+15
-12
@@ -437,8 +437,7 @@ median_cut (j_decompress_ptr cinfo, boxptr boxlist, int numboxes,
|
|||||||
cmax = c1; n = 1;
|
cmax = c1; n = 1;
|
||||||
if (c0 > cmax) { cmax = c0; n = 0; }
|
if (c0 > cmax) { cmax = c0; n = 0; }
|
||||||
if (c2 > cmax) { n = 2; }
|
if (c2 > cmax) { n = 2; }
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
cmax = c1; n = 1;
|
cmax = c1; n = 1;
|
||||||
if (c2 > cmax) { cmax = c2; n = 2; }
|
if (c2 > cmax) { cmax = c2; n = 2; }
|
||||||
if (c0 > cmax) { n = 0; }
|
if (c0 > cmax) { n = 0; }
|
||||||
@@ -892,8 +891,8 @@ fill_inverse_cmap (j_decompress_ptr cinfo, int c0, int c1, int c2)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
METHODDEF(void)
|
METHODDEF(void)
|
||||||
pass2_no_dither (j_decompress_ptr cinfo,
|
pass2_no_dither(j_decompress_ptr cinfo, JSAMPARRAY input_buf,
|
||||||
JSAMPARRAY input_buf, JSAMPARRAY output_buf, int num_rows)
|
JSAMPARRAY output_buf, int num_rows)
|
||||||
/* This version performs no dithering */
|
/* This version performs no dithering */
|
||||||
{
|
{
|
||||||
my_cquantize_ptr cquantize = (my_cquantize_ptr)cinfo->cquantize;
|
my_cquantize_ptr cquantize = (my_cquantize_ptr)cinfo->cquantize;
|
||||||
@@ -926,8 +925,8 @@ pass2_no_dither (j_decompress_ptr cinfo,
|
|||||||
|
|
||||||
|
|
||||||
METHODDEF(void)
|
METHODDEF(void)
|
||||||
pass2_fs_dither (j_decompress_ptr cinfo,
|
pass2_fs_dither(j_decompress_ptr cinfo, JSAMPARRAY input_buf,
|
||||||
JSAMPARRAY input_buf, JSAMPARRAY output_buf, int num_rows)
|
JSAMPARRAY output_buf, int num_rows)
|
||||||
/* This version performs Floyd-Steinberg dithering */
|
/* This version performs Floyd-Steinberg dithering */
|
||||||
{
|
{
|
||||||
my_cquantize_ptr cquantize = (my_cquantize_ptr)cinfo->cquantize;
|
my_cquantize_ptr cquantize = (my_cquantize_ptr)cinfo->cquantize;
|
||||||
@@ -1004,13 +1003,16 @@ pass2_fs_dither (j_decompress_ptr cinfo,
|
|||||||
cur1 = GETJSAMPLE(range_limit[cur1]);
|
cur1 = GETJSAMPLE(range_limit[cur1]);
|
||||||
cur2 = GETJSAMPLE(range_limit[cur2]);
|
cur2 = GETJSAMPLE(range_limit[cur2]);
|
||||||
/* Index into the cache with adjusted pixel value */
|
/* Index into the cache with adjusted pixel value */
|
||||||
cachep = & histogram[cur0>>C0_SHIFT][cur1>>C1_SHIFT][cur2>>C2_SHIFT];
|
cachep =
|
||||||
|
&histogram[cur0 >> C0_SHIFT][cur1 >> C1_SHIFT][cur2 >> C2_SHIFT];
|
||||||
/* If we have not seen this color before, find nearest colormap */
|
/* If we have not seen this color before, find nearest colormap */
|
||||||
/* entry and update the cache */
|
/* entry and update the cache */
|
||||||
if (*cachep == 0)
|
if (*cachep == 0)
|
||||||
fill_inverse_cmap(cinfo, cur0>>C0_SHIFT,cur1>>C1_SHIFT,cur2>>C2_SHIFT);
|
fill_inverse_cmap(cinfo, cur0 >> C0_SHIFT, cur1 >> C1_SHIFT,
|
||||||
|
cur2 >> C2_SHIFT);
|
||||||
/* Now emit the colormap index for this cell */
|
/* Now emit the colormap index for this cell */
|
||||||
{ register int pixcode = *cachep - 1;
|
{
|
||||||
|
register int pixcode = *cachep - 1;
|
||||||
*outptr = (JSAMPLE)pixcode;
|
*outptr = (JSAMPLE)pixcode;
|
||||||
/* Compute representation error for this pixel */
|
/* Compute representation error for this pixel */
|
||||||
cur0 -= GETJSAMPLE(colormap0[pixcode]);
|
cur0 -= GETJSAMPLE(colormap0[pixcode]);
|
||||||
@@ -1021,7 +1023,8 @@ pass2_fs_dither (j_decompress_ptr cinfo,
|
|||||||
* Add these into the running sums, and simultaneously shift the
|
* Add these into the running sums, and simultaneously shift the
|
||||||
* next-line error sums left by 1 column.
|
* next-line error sums left by 1 column.
|
||||||
*/
|
*/
|
||||||
{ register LOCFSERROR bnexterr;
|
{
|
||||||
|
register LOCFSERROR bnexterr;
|
||||||
|
|
||||||
bnexterr = cur0; /* Process component 0 */
|
bnexterr = cur0; /* Process component 0 */
|
||||||
errorptr[0] = (FSERROR)(bpreverr0 + cur0 * 3);
|
errorptr[0] = (FSERROR)(bpreverr0 + cur0 * 3);
|
||||||
@@ -1167,8 +1170,8 @@ start_pass_2_quant (j_decompress_ptr cinfo, boolean is_pre_scan)
|
|||||||
ERREXIT1(cinfo, JERR_QUANT_MANY_COLORS, MAXNUMCOLORS);
|
ERREXIT1(cinfo, JERR_QUANT_MANY_COLORS, MAXNUMCOLORS);
|
||||||
|
|
||||||
if (cinfo->dither_mode == JDITHER_FS) {
|
if (cinfo->dither_mode == JDITHER_FS) {
|
||||||
size_t arraysize = (size_t) ((cinfo->output_width + 2) *
|
size_t arraysize =
|
||||||
(3 * sizeof(FSERROR)));
|
(size_t)((cinfo->output_width + 2) * (3 * sizeof(FSERROR)));
|
||||||
/* Allocate Floyd-Steinberg workspace if we didn't already. */
|
/* Allocate Floyd-Steinberg workspace if we didn't already. */
|
||||||
if (cquantize->fserrors == NULL)
|
if (cquantize->fserrors == NULL)
|
||||||
cquantize->fserrors = (FSERRPTR)(*cinfo->mem->alloc_large)
|
cquantize->fserrors = (FSERRPTR)(*cinfo->mem->alloc_large)
|
||||||
|
|||||||
Vendored
+69
-45
@@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
|
* Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
|
||||||
* Copyright (C) 2011, 2014, D. R. Commander.
|
* Copyright (C) 2011, 2014, D. R. Commander.
|
||||||
* Copyright (C) 2015, Matthieu Darbois.
|
* Copyright (C) 2015-2016, 2018, Matthieu Darbois.
|
||||||
*
|
*
|
||||||
* Based on the x86 SIMD extension for IJG JPEG library,
|
* Based on the x86 SIMD extension for IJG JPEG library,
|
||||||
* Copyright (C) 1999-2006, MIYASAKA Masaru.
|
* Copyright (C) 1999-2006, MIYASAKA Masaru.
|
||||||
@@ -19,75 +19,99 @@ EXTERN(int) jsimd_can_ycc_rgb (void);
|
|||||||
EXTERN(int) jsimd_can_ycc_rgb565(void);
|
EXTERN(int) jsimd_can_ycc_rgb565(void);
|
||||||
EXTERN(int) jsimd_c_can_null_convert(void);
|
EXTERN(int) jsimd_c_can_null_convert(void);
|
||||||
|
|
||||||
EXTERN(void) jsimd_rgb_ycc_convert
|
EXTERN(void) jsimd_rgb_ycc_convert(j_compress_ptr cinfo, JSAMPARRAY input_buf,
|
||||||
(j_compress_ptr cinfo, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
|
JSAMPIMAGE output_buf,
|
||||||
JDIMENSION output_row, int num_rows);
|
JDIMENSION output_row, int num_rows);
|
||||||
EXTERN(void) jsimd_rgb_gray_convert
|
EXTERN(void) jsimd_rgb_gray_convert(j_compress_ptr cinfo, JSAMPARRAY input_buf,
|
||||||
(j_compress_ptr cinfo, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
|
JSAMPIMAGE output_buf,
|
||||||
JDIMENSION output_row, int num_rows);
|
JDIMENSION output_row, int num_rows);
|
||||||
EXTERN(void) jsimd_ycc_rgb_convert
|
EXTERN(void) jsimd_ycc_rgb_convert(j_decompress_ptr cinfo,
|
||||||
(j_decompress_ptr cinfo, JSAMPIMAGE input_buf, JDIMENSION input_row,
|
JSAMPIMAGE input_buf, JDIMENSION input_row,
|
||||||
JSAMPARRAY output_buf, int num_rows);
|
JSAMPARRAY output_buf, int num_rows);
|
||||||
EXTERN(void) jsimd_ycc_rgb565_convert
|
EXTERN(void) jsimd_ycc_rgb565_convert(j_decompress_ptr cinfo,
|
||||||
(j_decompress_ptr cinfo, JSAMPIMAGE input_buf, JDIMENSION input_row,
|
JSAMPIMAGE input_buf,
|
||||||
|
JDIMENSION input_row,
|
||||||
JSAMPARRAY output_buf, int num_rows);
|
JSAMPARRAY output_buf, int num_rows);
|
||||||
EXTERN(void) jsimd_c_null_convert
|
EXTERN(void) jsimd_c_null_convert(j_compress_ptr cinfo, JSAMPARRAY input_buf,
|
||||||
(j_compress_ptr cinfo, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
|
JSAMPIMAGE output_buf, JDIMENSION output_row,
|
||||||
JDIMENSION output_row, int num_rows);
|
int num_rows);
|
||||||
|
|
||||||
EXTERN(int) jsimd_can_h2v2_downsample(void);
|
EXTERN(int) jsimd_can_h2v2_downsample(void);
|
||||||
EXTERN(int) jsimd_can_h2v1_downsample(void);
|
EXTERN(int) jsimd_can_h2v1_downsample(void);
|
||||||
|
|
||||||
EXTERN(void) jsimd_h2v2_downsample
|
EXTERN(void) jsimd_h2v2_downsample(j_compress_ptr cinfo,
|
||||||
(j_compress_ptr cinfo, jpeg_component_info *compptr,
|
jpeg_component_info *compptr,
|
||||||
JSAMPARRAY input_data, JSAMPARRAY output_data);
|
JSAMPARRAY input_data,
|
||||||
|
JSAMPARRAY output_data);
|
||||||
|
|
||||||
EXTERN(int) jsimd_can_h2v2_smooth_downsample(void);
|
EXTERN(int) jsimd_can_h2v2_smooth_downsample(void);
|
||||||
|
|
||||||
EXTERN(void) jsimd_h2v2_smooth_downsample
|
EXTERN(void) jsimd_h2v2_smooth_downsample(j_compress_ptr cinfo,
|
||||||
(j_compress_ptr cinfo, jpeg_component_info *compptr,
|
jpeg_component_info *compptr,
|
||||||
JSAMPARRAY input_data, JSAMPARRAY output_data);
|
JSAMPARRAY input_data,
|
||||||
|
JSAMPARRAY output_data);
|
||||||
|
|
||||||
EXTERN(void) jsimd_h2v1_downsample
|
EXTERN(void) jsimd_h2v1_downsample(j_compress_ptr cinfo,
|
||||||
(j_compress_ptr cinfo, jpeg_component_info *compptr,
|
jpeg_component_info *compptr,
|
||||||
JSAMPARRAY input_data, JSAMPARRAY output_data);
|
JSAMPARRAY input_data,
|
||||||
|
JSAMPARRAY output_data);
|
||||||
|
|
||||||
EXTERN(int) jsimd_can_h2v2_upsample(void);
|
EXTERN(int) jsimd_can_h2v2_upsample(void);
|
||||||
EXTERN(int) jsimd_can_h2v1_upsample(void);
|
EXTERN(int) jsimd_can_h2v1_upsample(void);
|
||||||
EXTERN(int) jsimd_can_int_upsample(void);
|
EXTERN(int) jsimd_can_int_upsample(void);
|
||||||
|
|
||||||
EXTERN(void) jsimd_h2v2_upsample
|
EXTERN(void) jsimd_h2v2_upsample(j_decompress_ptr cinfo,
|
||||||
(j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
jpeg_component_info *compptr,
|
||||||
JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr);
|
JSAMPARRAY input_data,
|
||||||
EXTERN(void) jsimd_h2v1_upsample
|
JSAMPARRAY *output_data_ptr);
|
||||||
(j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
EXTERN(void) jsimd_h2v1_upsample(j_decompress_ptr cinfo,
|
||||||
JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr);
|
jpeg_component_info *compptr,
|
||||||
EXTERN(void) jsimd_int_upsample
|
JSAMPARRAY input_data,
|
||||||
(j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
JSAMPARRAY *output_data_ptr);
|
||||||
JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr);
|
EXTERN(void) jsimd_int_upsample(j_decompress_ptr cinfo,
|
||||||
|
jpeg_component_info *compptr,
|
||||||
|
JSAMPARRAY input_data,
|
||||||
|
JSAMPARRAY *output_data_ptr);
|
||||||
|
|
||||||
EXTERN(int) jsimd_can_h2v2_fancy_upsample(void);
|
EXTERN(int) jsimd_can_h2v2_fancy_upsample(void);
|
||||||
EXTERN(int) jsimd_can_h2v1_fancy_upsample(void);
|
EXTERN(int) jsimd_can_h2v1_fancy_upsample(void);
|
||||||
|
|
||||||
EXTERN(void) jsimd_h2v2_fancy_upsample
|
EXTERN(void) jsimd_h2v2_fancy_upsample(j_decompress_ptr cinfo,
|
||||||
(j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
jpeg_component_info *compptr,
|
||||||
JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr);
|
JSAMPARRAY input_data,
|
||||||
EXTERN(void) jsimd_h2v1_fancy_upsample
|
JSAMPARRAY *output_data_ptr);
|
||||||
(j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
EXTERN(void) jsimd_h2v1_fancy_upsample(j_decompress_ptr cinfo,
|
||||||
JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr);
|
jpeg_component_info *compptr,
|
||||||
|
JSAMPARRAY input_data,
|
||||||
|
JSAMPARRAY *output_data_ptr);
|
||||||
|
|
||||||
EXTERN(int) jsimd_can_h2v2_merged_upsample(void);
|
EXTERN(int) jsimd_can_h2v2_merged_upsample(void);
|
||||||
EXTERN(int) jsimd_can_h2v1_merged_upsample(void);
|
EXTERN(int) jsimd_can_h2v1_merged_upsample(void);
|
||||||
|
|
||||||
EXTERN(void) jsimd_h2v2_merged_upsample
|
EXTERN(void) jsimd_h2v2_merged_upsample(j_decompress_ptr cinfo,
|
||||||
(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
JSAMPIMAGE input_buf,
|
||||||
JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf);
|
JDIMENSION in_row_group_ctr,
|
||||||
EXTERN(void) jsimd_h2v1_merged_upsample
|
JSAMPARRAY output_buf);
|
||||||
(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
EXTERN(void) jsimd_h2v1_merged_upsample(j_decompress_ptr cinfo,
|
||||||
JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf);
|
JSAMPIMAGE input_buf,
|
||||||
|
JDIMENSION in_row_group_ctr,
|
||||||
|
JSAMPARRAY output_buf);
|
||||||
|
|
||||||
EXTERN(int) jsimd_can_huff_encode_one_block(void);
|
EXTERN(int) jsimd_can_huff_encode_one_block(void);
|
||||||
|
|
||||||
EXTERN(JOCTET*) jsimd_huff_encode_one_block
|
EXTERN(JOCTET *) jsimd_huff_encode_one_block(void *state, JOCTET *buffer,
|
||||||
(void *state, JOCTET *buffer, JCOEFPTR block, int last_dc_val,
|
JCOEFPTR block, int last_dc_val,
|
||||||
c_derived_tbl *dctbl, c_derived_tbl *actbl);
|
c_derived_tbl *dctbl,
|
||||||
|
c_derived_tbl *actbl);
|
||||||
|
|
||||||
|
EXTERN(int) jsimd_can_encode_mcu_AC_first_prepare(void);
|
||||||
|
|
||||||
|
EXTERN(void) jsimd_encode_mcu_AC_first_prepare
|
||||||
|
(const JCOEF *block, const int *jpeg_natural_order_start, int Sl, int Al,
|
||||||
|
JCOEF *values, size_t *zerobits);
|
||||||
|
|
||||||
|
EXTERN(int) jsimd_can_encode_mcu_AC_refine_prepare(void);
|
||||||
|
|
||||||
|
EXTERN(int) jsimd_encode_mcu_AC_refine_prepare
|
||||||
|
(const JCOEF *block, const int *jpeg_natural_order_start, int Sl, int Al,
|
||||||
|
JCOEF *absvalues, size_t *bits);
|
||||||
|
|||||||
+56
-42
@@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
|
* Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
|
||||||
* Copyright (C) 2009-2011, 2014, D. R. Commander.
|
* Copyright (C) 2009-2011, 2014, D. R. Commander.
|
||||||
* Copyright (C) 2015, Matthieu Darbois.
|
* Copyright (C) 2015-2016, 2018, Matthieu Darbois.
|
||||||
*
|
*
|
||||||
* Based on the x86 SIMD extension for IJG JPEG library,
|
* Based on the x86 SIMD extension for IJG JPEG library,
|
||||||
* Copyright (C) 1999-2006, MIYASAKA Masaru.
|
* Copyright (C) 1999-2006, MIYASAKA Masaru.
|
||||||
@@ -50,37 +50,37 @@ jsimd_c_can_null_convert (void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
GLOBAL(void)
|
GLOBAL(void)
|
||||||
jsimd_rgb_ycc_convert (j_compress_ptr cinfo,
|
jsimd_rgb_ycc_convert(j_compress_ptr cinfo, JSAMPARRAY input_buf,
|
||||||
JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
|
JSAMPIMAGE output_buf, JDIMENSION output_row,
|
||||||
JDIMENSION output_row, int num_rows)
|
int num_rows)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
GLOBAL(void)
|
GLOBAL(void)
|
||||||
jsimd_rgb_gray_convert (j_compress_ptr cinfo,
|
jsimd_rgb_gray_convert(j_compress_ptr cinfo, JSAMPARRAY input_buf,
|
||||||
JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
|
JSAMPIMAGE output_buf, JDIMENSION output_row,
|
||||||
JDIMENSION output_row, int num_rows)
|
int num_rows)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
GLOBAL(void)
|
GLOBAL(void)
|
||||||
jsimd_ycc_rgb_convert (j_decompress_ptr cinfo,
|
jsimd_ycc_rgb_convert(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||||
JSAMPIMAGE input_buf, JDIMENSION input_row,
|
JDIMENSION input_row, JSAMPARRAY output_buf,
|
||||||
JSAMPARRAY output_buf, int num_rows)
|
int num_rows)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
GLOBAL(void)
|
GLOBAL(void)
|
||||||
jsimd_ycc_rgb565_convert (j_decompress_ptr cinfo,
|
jsimd_ycc_rgb565_convert(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||||
JSAMPIMAGE input_buf, JDIMENSION input_row,
|
JDIMENSION input_row, JSAMPARRAY output_buf,
|
||||||
JSAMPARRAY output_buf, int num_rows)
|
int num_rows)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
GLOBAL(void)
|
GLOBAL(void)
|
||||||
jsimd_c_null_convert (j_compress_ptr cinfo,
|
jsimd_c_null_convert(j_compress_ptr cinfo, JSAMPARRAY input_buf,
|
||||||
JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
|
JSAMPIMAGE output_buf, JDIMENSION output_row,
|
||||||
JDIMENSION output_row, int num_rows)
|
int num_rows)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -146,18 +146,14 @@ jsimd_int_upsample (j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
|||||||
}
|
}
|
||||||
|
|
||||||
GLOBAL(void)
|
GLOBAL(void)
|
||||||
jsimd_h2v2_upsample (j_decompress_ptr cinfo,
|
jsimd_h2v2_upsample(j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
||||||
jpeg_component_info *compptr,
|
JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr)
|
||||||
JSAMPARRAY input_data,
|
|
||||||
JSAMPARRAY *output_data_ptr)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
GLOBAL(void)
|
GLOBAL(void)
|
||||||
jsimd_h2v1_upsample (j_decompress_ptr cinfo,
|
jsimd_h2v1_upsample(j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
||||||
jpeg_component_info *compptr,
|
JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr)
|
||||||
JSAMPARRAY input_data,
|
|
||||||
JSAMPARRAY *output_data_ptr)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -174,18 +170,14 @@ jsimd_can_h2v1_fancy_upsample (void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
GLOBAL(void)
|
GLOBAL(void)
|
||||||
jsimd_h2v2_fancy_upsample (j_decompress_ptr cinfo,
|
jsimd_h2v2_fancy_upsample(j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
||||||
jpeg_component_info *compptr,
|
JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr)
|
||||||
JSAMPARRAY input_data,
|
|
||||||
JSAMPARRAY *output_data_ptr)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
GLOBAL(void)
|
GLOBAL(void)
|
||||||
jsimd_h2v1_fancy_upsample (j_decompress_ptr cinfo,
|
jsimd_h2v1_fancy_upsample(j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
||||||
jpeg_component_info *compptr,
|
JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr)
|
||||||
JSAMPARRAY input_data,
|
|
||||||
JSAMPARRAY *output_data_ptr)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -202,18 +194,14 @@ jsimd_can_h2v1_merged_upsample (void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
GLOBAL(void)
|
GLOBAL(void)
|
||||||
jsimd_h2v2_merged_upsample (j_decompress_ptr cinfo,
|
jsimd_h2v2_merged_upsample(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||||
JSAMPIMAGE input_buf,
|
JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf)
|
||||||
JDIMENSION in_row_group_ctr,
|
|
||||||
JSAMPARRAY output_buf)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
GLOBAL(void)
|
GLOBAL(void)
|
||||||
jsimd_h2v1_merged_upsample (j_decompress_ptr cinfo,
|
jsimd_h2v1_merged_upsample(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||||
JSAMPIMAGE input_buf,
|
JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf)
|
||||||
JDIMENSION in_row_group_ctr,
|
|
||||||
JSAMPARRAY output_buf)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -287,8 +275,7 @@ jsimd_can_quantize_float (void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
GLOBAL(void)
|
GLOBAL(void)
|
||||||
jsimd_quantize (JCOEFPTR coef_block, DCTELEM *divisors,
|
jsimd_quantize(JCOEFPTR coef_block, DCTELEM *divisors, DCTELEM *workspace)
|
||||||
DCTELEM *workspace)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -402,3 +389,30 @@ jsimd_huff_encode_one_block (void *state, JOCTET *buffer, JCOEFPTR block,
|
|||||||
{
|
{
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GLOBAL(int)
|
||||||
|
jsimd_can_encode_mcu_AC_first_prepare(void)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
GLOBAL(void)
|
||||||
|
jsimd_encode_mcu_AC_first_prepare(const JCOEF *block,
|
||||||
|
const int *jpeg_natural_order_start, int Sl,
|
||||||
|
int Al, JCOEF *values, size_t *zerobits)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
GLOBAL(int)
|
||||||
|
jsimd_can_encode_mcu_AC_refine_prepare(void)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
GLOBAL(int)
|
||||||
|
jsimd_encode_mcu_AC_refine_prepare(const JCOEF *block,
|
||||||
|
const int *jpeg_natural_order_start, int Sl,
|
||||||
|
int Al, JCOEF *absvalues, size_t *bits)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|||||||
+7
-11
@@ -14,8 +14,7 @@ EXTERN(int) jsimd_can_convsamp_float (void);
|
|||||||
|
|
||||||
EXTERN(void) jsimd_convsamp(JSAMPARRAY sample_data, JDIMENSION start_col,
|
EXTERN(void) jsimd_convsamp(JSAMPARRAY sample_data, JDIMENSION start_col,
|
||||||
DCTELEM *workspace);
|
DCTELEM *workspace);
|
||||||
EXTERN(void) jsimd_convsamp_float (JSAMPARRAY sample_data,
|
EXTERN(void) jsimd_convsamp_float(JSAMPARRAY sample_data, JDIMENSION start_col,
|
||||||
JDIMENSION start_col,
|
|
||||||
FAST_FLOAT *workspace);
|
FAST_FLOAT *workspace);
|
||||||
|
|
||||||
EXTERN(int) jsimd_can_fdct_islow(void);
|
EXTERN(int) jsimd_can_fdct_islow(void);
|
||||||
@@ -40,17 +39,14 @@ EXTERN(int) jsimd_can_idct_6x6 (void);
|
|||||||
EXTERN(int) jsimd_can_idct_12x12(void);
|
EXTERN(int) jsimd_can_idct_12x12(void);
|
||||||
|
|
||||||
EXTERN(void) jsimd_idct_2x2(j_decompress_ptr cinfo,
|
EXTERN(void) jsimd_idct_2x2(j_decompress_ptr cinfo,
|
||||||
jpeg_component_info *compptr,
|
jpeg_component_info *compptr, JCOEFPTR coef_block,
|
||||||
JCOEFPTR coef_block, JSAMPARRAY output_buf,
|
JSAMPARRAY output_buf, JDIMENSION output_col);
|
||||||
JDIMENSION output_col);
|
|
||||||
EXTERN(void) jsimd_idct_4x4(j_decompress_ptr cinfo,
|
EXTERN(void) jsimd_idct_4x4(j_decompress_ptr cinfo,
|
||||||
jpeg_component_info *compptr,
|
jpeg_component_info *compptr, JCOEFPTR coef_block,
|
||||||
JCOEFPTR coef_block, JSAMPARRAY output_buf,
|
JSAMPARRAY output_buf, JDIMENSION output_col);
|
||||||
JDIMENSION output_col);
|
|
||||||
EXTERN(void) jsimd_idct_6x6(j_decompress_ptr cinfo,
|
EXTERN(void) jsimd_idct_6x6(j_decompress_ptr cinfo,
|
||||||
jpeg_component_info *compptr,
|
jpeg_component_info *compptr, JCOEFPTR coef_block,
|
||||||
JCOEFPTR coef_block, JSAMPARRAY output_buf,
|
JSAMPARRAY output_buf, JDIMENSION output_col);
|
||||||
JDIMENSION output_col);
|
|
||||||
EXTERN(void) jsimd_idct_12x12(j_decompress_ptr cinfo,
|
EXTERN(void) jsimd_idct_12x12(j_decompress_ptr cinfo,
|
||||||
jpeg_component_info *compptr,
|
jpeg_component_info *compptr,
|
||||||
JCOEFPTR coef_block, JSAMPARRAY output_buf,
|
JCOEFPTR coef_block, JSAMPARRAY output_buf,
|
||||||
|
|||||||
+28
-20
@@ -17,8 +17,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
LOCAL(void)
|
LOCAL(void)
|
||||||
add_huff_table (j_common_ptr cinfo,
|
add_huff_table(j_common_ptr cinfo, JHUFF_TBL **htblptr, const UINT8 *bits,
|
||||||
JHUFF_TBL **htblptr, const UINT8 *bits, const UINT8 *val)
|
const UINT8 *val)
|
||||||
/* Define a Huffman table */
|
/* Define a Huffman table */
|
||||||
{
|
{
|
||||||
int nsymbols, len;
|
int nsymbols, len;
|
||||||
@@ -56,20 +56,25 @@ std_huff_tables (j_common_ptr cinfo)
|
|||||||
{
|
{
|
||||||
JHUFF_TBL **dc_huff_tbl_ptrs, **ac_huff_tbl_ptrs;
|
JHUFF_TBL **dc_huff_tbl_ptrs, **ac_huff_tbl_ptrs;
|
||||||
|
|
||||||
static const UINT8 bits_dc_luminance[17] =
|
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 };
|
/* 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 val_dc_luminance[] = {
|
||||||
|
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11
|
||||||
|
};
|
||||||
|
|
||||||
static const UINT8 bits_dc_chrominance[17] =
|
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 };
|
/* 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 val_dc_chrominance[] = {
|
||||||
|
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11
|
||||||
|
};
|
||||||
|
|
||||||
static const UINT8 bits_ac_luminance[17] =
|
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 };
|
/* 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,
|
static const UINT8 val_ac_luminance[] = {
|
||||||
|
0x01, 0x02, 0x03, 0x00, 0x04, 0x11, 0x05, 0x12,
|
||||||
0x21, 0x31, 0x41, 0x06, 0x13, 0x51, 0x61, 0x07,
|
0x21, 0x31, 0x41, 0x06, 0x13, 0x51, 0x61, 0x07,
|
||||||
0x22, 0x71, 0x14, 0x32, 0x81, 0x91, 0xa1, 0x08,
|
0x22, 0x71, 0x14, 0x32, 0x81, 0x91, 0xa1, 0x08,
|
||||||
0x23, 0x42, 0xb1, 0xc1, 0x15, 0x52, 0xd1, 0xf0,
|
0x23, 0x42, 0xb1, 0xc1, 0x15, 0x52, 0xd1, 0xf0,
|
||||||
@@ -89,12 +94,14 @@ std_huff_tables (j_common_ptr cinfo)
|
|||||||
0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xe1, 0xe2,
|
0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xe1, 0xe2,
|
||||||
0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea,
|
0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea,
|
||||||
0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8,
|
0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8,
|
||||||
0xf9, 0xfa };
|
0xf9, 0xfa
|
||||||
|
};
|
||||||
|
|
||||||
static const UINT8 bits_ac_chrominance[17] =
|
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 };
|
/* 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,
|
static const UINT8 val_ac_chrominance[] = {
|
||||||
|
0x00, 0x01, 0x02, 0x03, 0x11, 0x04, 0x05, 0x21,
|
||||||
0x31, 0x06, 0x12, 0x41, 0x51, 0x07, 0x61, 0x71,
|
0x31, 0x06, 0x12, 0x41, 0x51, 0x07, 0x61, 0x71,
|
||||||
0x13, 0x22, 0x32, 0x81, 0x08, 0x14, 0x42, 0x91,
|
0x13, 0x22, 0x32, 0x81, 0x08, 0x14, 0x42, 0x91,
|
||||||
0xa1, 0xb1, 0xc1, 0x09, 0x23, 0x33, 0x52, 0xf0,
|
0xa1, 0xb1, 0xc1, 0x09, 0x23, 0x33, 0x52, 0xf0,
|
||||||
@@ -114,7 +121,8 @@ std_huff_tables (j_common_ptr cinfo)
|
|||||||
0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda,
|
0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda,
|
||||||
0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9,
|
0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9,
|
||||||
0xea, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8,
|
0xea, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8,
|
||||||
0xf9, 0xfa };
|
0xf9, 0xfa
|
||||||
|
};
|
||||||
|
|
||||||
if (cinfo->is_decompressor) {
|
if (cinfo->is_decompressor) {
|
||||||
dc_huff_tbl_ptrs = ((j_decompress_ptr)cinfo)->dc_huff_tbl_ptrs;
|
dc_huff_tbl_ptrs = ((j_decompress_ptr)cinfo)->dc_huff_tbl_ptrs;
|
||||||
|
|||||||
Vendored
+2
-2
@@ -92,8 +92,8 @@ jround_up (long a, long b)
|
|||||||
|
|
||||||
GLOBAL(void)
|
GLOBAL(void)
|
||||||
jcopy_sample_rows(JSAMPARRAY input_array, int source_row,
|
jcopy_sample_rows(JSAMPARRAY input_array, int source_row,
|
||||||
JSAMPARRAY output_array, int dest_row,
|
JSAMPARRAY output_array, int dest_row, int num_rows,
|
||||||
int num_rows, JDIMENSION num_cols)
|
JDIMENSION num_cols)
|
||||||
/* Copy some rows of samples from one place to another.
|
/* Copy some rows of samples from one place to another.
|
||||||
* num_rows rows are copied from input_array[source_row++]
|
* num_rows rows are copied from input_array[source_row++]
|
||||||
* to output_array[dest_row++]; these areas may overlap for duplication.
|
* to output_array[dest_row++]; these areas may overlap for duplication.
|
||||||
|
|||||||
+8
-5
@@ -4,7 +4,7 @@
|
|||||||
* This file was part of the Independent JPEG Group's software:
|
* This file was part of the Independent JPEG Group's software:
|
||||||
* Copyright (C) 1991-2012, Thomas G. Lane, Guido Vollbeding.
|
* Copyright (C) 1991-2012, Thomas G. Lane, Guido Vollbeding.
|
||||||
* libjpeg-turbo Modifications:
|
* libjpeg-turbo Modifications:
|
||||||
* Copyright (C) 2010, 2012-2017, D. R. Commander.
|
* Copyright (C) 2010, 2012-2019, D. R. Commander.
|
||||||
* For conditions of distribution and use, see the accompanying README.ijg
|
* For conditions of distribution and use, see the accompanying README.ijg
|
||||||
* file.
|
* file.
|
||||||
*
|
*
|
||||||
@@ -35,15 +35,18 @@
|
|||||||
* their code
|
* their code
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define JCOPYRIGHT "Copyright (C) 2009-2017 D. R. Commander\n" \
|
#define JCOPYRIGHT \
|
||||||
|
"Copyright (C) 2009-2019 D. R. Commander\n" \
|
||||||
"Copyright (C) 2011-2016 Siarhei Siamashka\n" \
|
"Copyright (C) 2011-2016 Siarhei Siamashka\n" \
|
||||||
"Copyright (C) 2015-2016 Matthieu Darbois\n" \
|
"Copyright (C) 2015-2016, 2018 Matthieu Darbois\n" \
|
||||||
|
"Copyright (C) 2015 Intel Corporation\n" \
|
||||||
"Copyright (C) 2015 Google, Inc.\n" \
|
"Copyright (C) 2015 Google, Inc.\n" \
|
||||||
"Copyright (C) 2013-2014 MIPS Technologies, Inc.\n" \
|
"Copyright (C) 2013-2014 MIPS Technologies, Inc.\n" \
|
||||||
"Copyright (C) 2013 Linaro Limited\n" \
|
"Copyright (C) 2013 Linaro Limited\n" \
|
||||||
"Copyright (C) 2009-2011 Nokia Corporation and/or its subsidiary(-ies)\n" \
|
"Copyright (C) 2009-2011 Nokia Corporation and/or its subsidiary(-ies)\n" \
|
||||||
"Copyright (C) 2009 Pierre Ossman for Cendio AB\n" \
|
"Copyright (C) 2009 Pierre Ossman for Cendio AB\n" \
|
||||||
"Copyright (C) 1999-2006 MIYASAKA Masaru\n" \
|
"Copyright (C) 1999-2006 MIYASAKA Masaru\n" \
|
||||||
"Copyright (C) 1991-2016 Thomas G. Lane, Guido Vollbeding" \
|
"Copyright (C) 1991-2016 Thomas G. Lane, Guido Vollbeding"
|
||||||
|
|
||||||
#define JCOPYRIGHT_SHORT "Copyright (C) 1991-2017 The libjpeg-turbo Project and many others"
|
#define JCOPYRIGHT_SHORT \
|
||||||
|
"Copyright (C) 1991-2019 The libjpeg-turbo Project and many others"
|
||||||
|
|||||||
Vendored
-7
@@ -15,13 +15,6 @@ else()
|
|||||||
ocv_list_filterout(lib_srcs jmemnobs.c)
|
ocv_list_filterout(lib_srcs jmemnobs.c)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(WINRT)
|
|
||||||
add_definitions(-DNO_GETENV)
|
|
||||||
get_directory_property( DirDefs COMPILE_DEFINITIONS )
|
|
||||||
message(STATUS "Adding NO_GETENV to compiler definitions for WINRT:")
|
|
||||||
message(STATUS " COMPILE_DEFINITIONS = ${DirDefs}")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# ----------------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------------
|
||||||
# Define the library target:
|
# Define the library target:
|
||||||
# ----------------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------------
|
||||||
|
|||||||
Vendored
+9
-6
@@ -1,7 +1,7 @@
|
|||||||
The Independent JPEG Group's JPEG software
|
The Independent JPEG Group's JPEG software
|
||||||
==========================================
|
==========================================
|
||||||
|
|
||||||
README for release 9b of 17-Jan-2016
|
README for release 9c of 14-Jan-2018
|
||||||
====================================
|
====================================
|
||||||
|
|
||||||
This distribution contains the ninth public release of the Independent JPEG
|
This distribution contains the ninth public release of the Independent JPEG
|
||||||
@@ -115,7 +115,7 @@ with respect to this software, its quality, accuracy, merchantability, or
|
|||||||
fitness for a particular purpose. This software is provided "AS IS", and you,
|
fitness for a particular purpose. This software is provided "AS IS", and you,
|
||||||
its user, assume the entire risk as to its quality and accuracy.
|
its user, assume the entire risk as to its quality and accuracy.
|
||||||
|
|
||||||
This software is copyright (C) 1991-2016, Thomas G. Lane, Guido Vollbeding.
|
This software is copyright (C) 1991-2018, Thomas G. Lane, Guido Vollbeding.
|
||||||
All Rights Reserved except as specified below.
|
All Rights Reserved except as specified below.
|
||||||
|
|
||||||
Permission is hereby granted to use, copy, modify, and distribute this
|
Permission is hereby granted to use, copy, modify, and distribute this
|
||||||
@@ -246,8 +246,8 @@ ARCHIVE LOCATIONS
|
|||||||
The "official" archive site for this software is www.ijg.org.
|
The "official" archive site for this software is www.ijg.org.
|
||||||
The most recent released version can always be found there in
|
The most recent released version can always be found there in
|
||||||
directory "files". This particular version will be archived as
|
directory "files". This particular version will be archived as
|
||||||
http://www.ijg.org/files/jpegsrc.v9b.tar.gz, and in Windows-compatible
|
http://www.ijg.org/files/jpegsrc.v9c.tar.gz, and in Windows-compatible
|
||||||
"zip" archive format as http://www.ijg.org/files/jpegsr9b.zip.
|
"zip" archive format as http://www.ijg.org/files/jpegsr9c.zip.
|
||||||
|
|
||||||
The JPEG FAQ (Frequently Asked Questions) article is a source of some
|
The JPEG FAQ (Frequently Asked Questions) article is a source of some
|
||||||
general information about JPEG.
|
general information about JPEG.
|
||||||
@@ -293,8 +293,11 @@ communication about JPEG configuration in Sigma Photo Pro software.
|
|||||||
|
|
||||||
Thank to Andrew Finkenstadt for hosting the ijg.org site.
|
Thank to Andrew Finkenstadt for hosting the ijg.org site.
|
||||||
|
|
||||||
Last but not least special thank to Thomas G. Lane for the original
|
Thank to Thomas G. Lane for the original design and development of
|
||||||
design and development of this singular software package.
|
this singular software package.
|
||||||
|
|
||||||
|
Thank to Lars Goehler, Andreas Heinecke, Sebastian Fuss, Yvonne Roebert,
|
||||||
|
Andrej Werner, and Ulf-Dietrich Braumann for support and public relations.
|
||||||
|
|
||||||
|
|
||||||
FILE FORMAT WARS
|
FILE FORMAT WARS
|
||||||
|
|||||||
Vendored
+21
@@ -1,6 +1,27 @@
|
|||||||
CHANGE LOG for Independent JPEG Group's JPEG software
|
CHANGE LOG for Independent JPEG Group's JPEG software
|
||||||
|
|
||||||
|
|
||||||
|
Version 9c 14-Jan-2018
|
||||||
|
-----------------------
|
||||||
|
|
||||||
|
jpegtran: add an option to the -wipe switch to fill the region
|
||||||
|
with the average of adjacent blocks, instead of gray out.
|
||||||
|
Thank to Caitlyn Feddock and Maddie Ziegler for inspiration.
|
||||||
|
|
||||||
|
Make range extension bits adjustable (in jpegint.h).
|
||||||
|
Thank to Robin Watts for suggestion.
|
||||||
|
|
||||||
|
Provide macros for fflush() and ferror() in jinclude.h in order
|
||||||
|
to facilitate adaption by applications using an own FILE class.
|
||||||
|
Thank to Gerhard Huber for suggestion.
|
||||||
|
|
||||||
|
Add libjpeg pkg-config file. Thank to Mark Lavi, Vincent Torri,
|
||||||
|
Patrick McMunn, and Huw Davies for suggestion.
|
||||||
|
|
||||||
|
Add sanity checks in cjpeg image reader modules.
|
||||||
|
Thank to Bingchang, Liu for reports.
|
||||||
|
|
||||||
|
|
||||||
Version 9b 17-Jan-2016
|
Version 9b 17-Jan-2016
|
||||||
-----------------------
|
-----------------------
|
||||||
|
|
||||||
|
|||||||
Vendored
+167
-2
@@ -2,7 +2,7 @@
|
|||||||
* jcinit.c
|
* jcinit.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 1991-1997, Thomas G. Lane.
|
* Copyright (C) 1991-1997, Thomas G. Lane.
|
||||||
* Modified 2003-2013 by Guido Vollbeding.
|
* Modified 2003-2017 by Guido Vollbeding.
|
||||||
* This file is part of the Independent JPEG Group's software.
|
* This file is part of the Independent JPEG Group's software.
|
||||||
* For conditions of distribution and use, see the accompanying README file.
|
* For conditions of distribution and use, see the accompanying README file.
|
||||||
*
|
*
|
||||||
@@ -21,6 +21,168 @@
|
|||||||
#include "jpeglib.h"
|
#include "jpeglib.h"
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Compute JPEG image dimensions and related values.
|
||||||
|
* NOTE: this is exported for possible use by application.
|
||||||
|
* Hence it mustn't do anything that can't be done twice.
|
||||||
|
*/
|
||||||
|
|
||||||
|
GLOBAL(void)
|
||||||
|
jpeg_calc_jpeg_dimensions (j_compress_ptr cinfo)
|
||||||
|
/* Do computations that are needed before master selection phase */
|
||||||
|
{
|
||||||
|
/* Sanity check on input image dimensions to prevent overflow in
|
||||||
|
* following calculations.
|
||||||
|
* We do check jpeg_width and jpeg_height in initial_setup in jcmaster.c,
|
||||||
|
* but image_width and image_height can come from arbitrary data,
|
||||||
|
* and we need some space for multiplication by block_size.
|
||||||
|
*/
|
||||||
|
if (((long) cinfo->image_width >> 24) || ((long) cinfo->image_height >> 24))
|
||||||
|
ERREXIT1(cinfo, JERR_IMAGE_TOO_BIG, (unsigned int) JPEG_MAX_DIMENSION);
|
||||||
|
|
||||||
|
#ifdef DCT_SCALING_SUPPORTED
|
||||||
|
|
||||||
|
/* Compute actual JPEG image dimensions and DCT scaling choices. */
|
||||||
|
if (cinfo->scale_num >= cinfo->scale_denom * cinfo->block_size) {
|
||||||
|
/* Provide block_size/1 scaling */
|
||||||
|
cinfo->jpeg_width = cinfo->image_width * cinfo->block_size;
|
||||||
|
cinfo->jpeg_height = cinfo->image_height * cinfo->block_size;
|
||||||
|
cinfo->min_DCT_h_scaled_size = 1;
|
||||||
|
cinfo->min_DCT_v_scaled_size = 1;
|
||||||
|
} else if (cinfo->scale_num * 2 >= cinfo->scale_denom * cinfo->block_size) {
|
||||||
|
/* Provide block_size/2 scaling */
|
||||||
|
cinfo->jpeg_width = (JDIMENSION)
|
||||||
|
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 2L);
|
||||||
|
cinfo->jpeg_height = (JDIMENSION)
|
||||||
|
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 2L);
|
||||||
|
cinfo->min_DCT_h_scaled_size = 2;
|
||||||
|
cinfo->min_DCT_v_scaled_size = 2;
|
||||||
|
} else if (cinfo->scale_num * 3 >= cinfo->scale_denom * cinfo->block_size) {
|
||||||
|
/* Provide block_size/3 scaling */
|
||||||
|
cinfo->jpeg_width = (JDIMENSION)
|
||||||
|
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 3L);
|
||||||
|
cinfo->jpeg_height = (JDIMENSION)
|
||||||
|
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 3L);
|
||||||
|
cinfo->min_DCT_h_scaled_size = 3;
|
||||||
|
cinfo->min_DCT_v_scaled_size = 3;
|
||||||
|
} else if (cinfo->scale_num * 4 >= cinfo->scale_denom * cinfo->block_size) {
|
||||||
|
/* Provide block_size/4 scaling */
|
||||||
|
cinfo->jpeg_width = (JDIMENSION)
|
||||||
|
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 4L);
|
||||||
|
cinfo->jpeg_height = (JDIMENSION)
|
||||||
|
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 4L);
|
||||||
|
cinfo->min_DCT_h_scaled_size = 4;
|
||||||
|
cinfo->min_DCT_v_scaled_size = 4;
|
||||||
|
} else if (cinfo->scale_num * 5 >= cinfo->scale_denom * cinfo->block_size) {
|
||||||
|
/* Provide block_size/5 scaling */
|
||||||
|
cinfo->jpeg_width = (JDIMENSION)
|
||||||
|
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 5L);
|
||||||
|
cinfo->jpeg_height = (JDIMENSION)
|
||||||
|
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 5L);
|
||||||
|
cinfo->min_DCT_h_scaled_size = 5;
|
||||||
|
cinfo->min_DCT_v_scaled_size = 5;
|
||||||
|
} else if (cinfo->scale_num * 6 >= cinfo->scale_denom * cinfo->block_size) {
|
||||||
|
/* Provide block_size/6 scaling */
|
||||||
|
cinfo->jpeg_width = (JDIMENSION)
|
||||||
|
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 6L);
|
||||||
|
cinfo->jpeg_height = (JDIMENSION)
|
||||||
|
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 6L);
|
||||||
|
cinfo->min_DCT_h_scaled_size = 6;
|
||||||
|
cinfo->min_DCT_v_scaled_size = 6;
|
||||||
|
} else if (cinfo->scale_num * 7 >= cinfo->scale_denom * cinfo->block_size) {
|
||||||
|
/* Provide block_size/7 scaling */
|
||||||
|
cinfo->jpeg_width = (JDIMENSION)
|
||||||
|
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 7L);
|
||||||
|
cinfo->jpeg_height = (JDIMENSION)
|
||||||
|
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 7L);
|
||||||
|
cinfo->min_DCT_h_scaled_size = 7;
|
||||||
|
cinfo->min_DCT_v_scaled_size = 7;
|
||||||
|
} else if (cinfo->scale_num * 8 >= cinfo->scale_denom * cinfo->block_size) {
|
||||||
|
/* Provide block_size/8 scaling */
|
||||||
|
cinfo->jpeg_width = (JDIMENSION)
|
||||||
|
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 8L);
|
||||||
|
cinfo->jpeg_height = (JDIMENSION)
|
||||||
|
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 8L);
|
||||||
|
cinfo->min_DCT_h_scaled_size = 8;
|
||||||
|
cinfo->min_DCT_v_scaled_size = 8;
|
||||||
|
} else if (cinfo->scale_num * 9 >= cinfo->scale_denom * cinfo->block_size) {
|
||||||
|
/* Provide block_size/9 scaling */
|
||||||
|
cinfo->jpeg_width = (JDIMENSION)
|
||||||
|
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 9L);
|
||||||
|
cinfo->jpeg_height = (JDIMENSION)
|
||||||
|
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 9L);
|
||||||
|
cinfo->min_DCT_h_scaled_size = 9;
|
||||||
|
cinfo->min_DCT_v_scaled_size = 9;
|
||||||
|
} else if (cinfo->scale_num * 10 >= cinfo->scale_denom * cinfo->block_size) {
|
||||||
|
/* Provide block_size/10 scaling */
|
||||||
|
cinfo->jpeg_width = (JDIMENSION)
|
||||||
|
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 10L);
|
||||||
|
cinfo->jpeg_height = (JDIMENSION)
|
||||||
|
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 10L);
|
||||||
|
cinfo->min_DCT_h_scaled_size = 10;
|
||||||
|
cinfo->min_DCT_v_scaled_size = 10;
|
||||||
|
} else if (cinfo->scale_num * 11 >= cinfo->scale_denom * cinfo->block_size) {
|
||||||
|
/* Provide block_size/11 scaling */
|
||||||
|
cinfo->jpeg_width = (JDIMENSION)
|
||||||
|
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 11L);
|
||||||
|
cinfo->jpeg_height = (JDIMENSION)
|
||||||
|
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 11L);
|
||||||
|
cinfo->min_DCT_h_scaled_size = 11;
|
||||||
|
cinfo->min_DCT_v_scaled_size = 11;
|
||||||
|
} else if (cinfo->scale_num * 12 >= cinfo->scale_denom * cinfo->block_size) {
|
||||||
|
/* Provide block_size/12 scaling */
|
||||||
|
cinfo->jpeg_width = (JDIMENSION)
|
||||||
|
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 12L);
|
||||||
|
cinfo->jpeg_height = (JDIMENSION)
|
||||||
|
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 12L);
|
||||||
|
cinfo->min_DCT_h_scaled_size = 12;
|
||||||
|
cinfo->min_DCT_v_scaled_size = 12;
|
||||||
|
} else if (cinfo->scale_num * 13 >= cinfo->scale_denom * cinfo->block_size) {
|
||||||
|
/* Provide block_size/13 scaling */
|
||||||
|
cinfo->jpeg_width = (JDIMENSION)
|
||||||
|
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 13L);
|
||||||
|
cinfo->jpeg_height = (JDIMENSION)
|
||||||
|
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 13L);
|
||||||
|
cinfo->min_DCT_h_scaled_size = 13;
|
||||||
|
cinfo->min_DCT_v_scaled_size = 13;
|
||||||
|
} else if (cinfo->scale_num * 14 >= cinfo->scale_denom * cinfo->block_size) {
|
||||||
|
/* Provide block_size/14 scaling */
|
||||||
|
cinfo->jpeg_width = (JDIMENSION)
|
||||||
|
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 14L);
|
||||||
|
cinfo->jpeg_height = (JDIMENSION)
|
||||||
|
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 14L);
|
||||||
|
cinfo->min_DCT_h_scaled_size = 14;
|
||||||
|
cinfo->min_DCT_v_scaled_size = 14;
|
||||||
|
} else if (cinfo->scale_num * 15 >= cinfo->scale_denom * cinfo->block_size) {
|
||||||
|
/* Provide block_size/15 scaling */
|
||||||
|
cinfo->jpeg_width = (JDIMENSION)
|
||||||
|
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 15L);
|
||||||
|
cinfo->jpeg_height = (JDIMENSION)
|
||||||
|
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 15L);
|
||||||
|
cinfo->min_DCT_h_scaled_size = 15;
|
||||||
|
cinfo->min_DCT_v_scaled_size = 15;
|
||||||
|
} else {
|
||||||
|
/* Provide block_size/16 scaling */
|
||||||
|
cinfo->jpeg_width = (JDIMENSION)
|
||||||
|
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 16L);
|
||||||
|
cinfo->jpeg_height = (JDIMENSION)
|
||||||
|
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 16L);
|
||||||
|
cinfo->min_DCT_h_scaled_size = 16;
|
||||||
|
cinfo->min_DCT_v_scaled_size = 16;
|
||||||
|
}
|
||||||
|
|
||||||
|
#else /* !DCT_SCALING_SUPPORTED */
|
||||||
|
|
||||||
|
/* Hardwire it to "no scaling" */
|
||||||
|
cinfo->jpeg_width = cinfo->image_width;
|
||||||
|
cinfo->jpeg_height = cinfo->image_height;
|
||||||
|
cinfo->min_DCT_h_scaled_size = DCTSIZE;
|
||||||
|
cinfo->min_DCT_v_scaled_size = DCTSIZE;
|
||||||
|
|
||||||
|
#endif /* DCT_SCALING_SUPPORTED */
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Master selection of compression modules.
|
* Master selection of compression modules.
|
||||||
* This is done once at the start of processing an image. We determine
|
* This is done once at the start of processing an image. We determine
|
||||||
@@ -37,7 +199,7 @@ jinit_compress_master (j_compress_ptr cinfo)
|
|||||||
if (cinfo->data_precision != BITS_IN_JSAMPLE)
|
if (cinfo->data_precision != BITS_IN_JSAMPLE)
|
||||||
ERREXIT1(cinfo, JERR_BAD_PRECISION, cinfo->data_precision);
|
ERREXIT1(cinfo, JERR_BAD_PRECISION, cinfo->data_precision);
|
||||||
|
|
||||||
/* Sanity check on image dimensions */
|
/* Sanity check on input image dimensions */
|
||||||
if (cinfo->image_height <= 0 || cinfo->image_width <= 0 ||
|
if (cinfo->image_height <= 0 || cinfo->image_width <= 0 ||
|
||||||
cinfo->input_components <= 0)
|
cinfo->input_components <= 0)
|
||||||
ERREXIT(cinfo, JERR_EMPTY_IMAGE);
|
ERREXIT(cinfo, JERR_EMPTY_IMAGE);
|
||||||
@@ -48,6 +210,9 @@ jinit_compress_master (j_compress_ptr cinfo)
|
|||||||
if ((long) jd_samplesperrow != samplesperrow)
|
if ((long) jd_samplesperrow != samplesperrow)
|
||||||
ERREXIT(cinfo, JERR_WIDTH_OVERFLOW);
|
ERREXIT(cinfo, JERR_WIDTH_OVERFLOW);
|
||||||
|
|
||||||
|
/* Compute JPEG image dimensions and related values. */
|
||||||
|
jpeg_calc_jpeg_dimensions(cinfo);
|
||||||
|
|
||||||
/* Initialize master control (includes parameter checking/processing) */
|
/* Initialize master control (includes parameter checking/processing) */
|
||||||
jinit_c_master_control(cinfo, FALSE /* full compression */);
|
jinit_c_master_control(cinfo, FALSE /* full compression */);
|
||||||
|
|
||||||
|
|||||||
Vendored
+5
-187
@@ -2,7 +2,7 @@
|
|||||||
* jcmaster.c
|
* jcmaster.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 1991-1997, Thomas G. Lane.
|
* Copyright (C) 1991-1997, Thomas G. Lane.
|
||||||
* Modified 2003-2013 by Guido Vollbeding.
|
* Modified 2003-2017 by Guido Vollbeding.
|
||||||
* This file is part of the Independent JPEG Group's software.
|
* This file is part of the Independent JPEG Group's software.
|
||||||
* For conditions of distribution and use, see the accompanying README file.
|
* For conditions of distribution and use, see the accompanying README file.
|
||||||
*
|
*
|
||||||
@@ -43,191 +43,13 @@ typedef my_comp_master * my_master_ptr;
|
|||||||
* Support routines that do various essential calculations.
|
* Support routines that do various essential calculations.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
|
||||||
* Compute JPEG image dimensions and related values.
|
|
||||||
* NOTE: this is exported for possible use by application.
|
|
||||||
* Hence it mustn't do anything that can't be done twice.
|
|
||||||
*/
|
|
||||||
|
|
||||||
GLOBAL(void)
|
|
||||||
jpeg_calc_jpeg_dimensions (j_compress_ptr cinfo)
|
|
||||||
/* Do computations that are needed before master selection phase */
|
|
||||||
{
|
|
||||||
#ifdef DCT_SCALING_SUPPORTED
|
|
||||||
|
|
||||||
/* Sanity check on input image dimensions to prevent overflow in
|
|
||||||
* following calculation.
|
|
||||||
* We do check jpeg_width and jpeg_height in initial_setup below,
|
|
||||||
* but image_width and image_height can come from arbitrary data,
|
|
||||||
* and we need some space for multiplication by block_size.
|
|
||||||
*/
|
|
||||||
if (((long) cinfo->image_width >> 24) || ((long) cinfo->image_height >> 24))
|
|
||||||
ERREXIT1(cinfo, JERR_IMAGE_TOO_BIG, (unsigned int) JPEG_MAX_DIMENSION);
|
|
||||||
|
|
||||||
/* Compute actual JPEG image dimensions and DCT scaling choices. */
|
|
||||||
if (cinfo->scale_num >= cinfo->scale_denom * cinfo->block_size) {
|
|
||||||
/* Provide block_size/1 scaling */
|
|
||||||
cinfo->jpeg_width = cinfo->image_width * cinfo->block_size;
|
|
||||||
cinfo->jpeg_height = cinfo->image_height * cinfo->block_size;
|
|
||||||
cinfo->min_DCT_h_scaled_size = 1;
|
|
||||||
cinfo->min_DCT_v_scaled_size = 1;
|
|
||||||
} else if (cinfo->scale_num * 2 >= cinfo->scale_denom * cinfo->block_size) {
|
|
||||||
/* Provide block_size/2 scaling */
|
|
||||||
cinfo->jpeg_width = (JDIMENSION)
|
|
||||||
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 2L);
|
|
||||||
cinfo->jpeg_height = (JDIMENSION)
|
|
||||||
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 2L);
|
|
||||||
cinfo->min_DCT_h_scaled_size = 2;
|
|
||||||
cinfo->min_DCT_v_scaled_size = 2;
|
|
||||||
} else if (cinfo->scale_num * 3 >= cinfo->scale_denom * cinfo->block_size) {
|
|
||||||
/* Provide block_size/3 scaling */
|
|
||||||
cinfo->jpeg_width = (JDIMENSION)
|
|
||||||
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 3L);
|
|
||||||
cinfo->jpeg_height = (JDIMENSION)
|
|
||||||
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 3L);
|
|
||||||
cinfo->min_DCT_h_scaled_size = 3;
|
|
||||||
cinfo->min_DCT_v_scaled_size = 3;
|
|
||||||
} else if (cinfo->scale_num * 4 >= cinfo->scale_denom * cinfo->block_size) {
|
|
||||||
/* Provide block_size/4 scaling */
|
|
||||||
cinfo->jpeg_width = (JDIMENSION)
|
|
||||||
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 4L);
|
|
||||||
cinfo->jpeg_height = (JDIMENSION)
|
|
||||||
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 4L);
|
|
||||||
cinfo->min_DCT_h_scaled_size = 4;
|
|
||||||
cinfo->min_DCT_v_scaled_size = 4;
|
|
||||||
} else if (cinfo->scale_num * 5 >= cinfo->scale_denom * cinfo->block_size) {
|
|
||||||
/* Provide block_size/5 scaling */
|
|
||||||
cinfo->jpeg_width = (JDIMENSION)
|
|
||||||
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 5L);
|
|
||||||
cinfo->jpeg_height = (JDIMENSION)
|
|
||||||
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 5L);
|
|
||||||
cinfo->min_DCT_h_scaled_size = 5;
|
|
||||||
cinfo->min_DCT_v_scaled_size = 5;
|
|
||||||
} else if (cinfo->scale_num * 6 >= cinfo->scale_denom * cinfo->block_size) {
|
|
||||||
/* Provide block_size/6 scaling */
|
|
||||||
cinfo->jpeg_width = (JDIMENSION)
|
|
||||||
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 6L);
|
|
||||||
cinfo->jpeg_height = (JDIMENSION)
|
|
||||||
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 6L);
|
|
||||||
cinfo->min_DCT_h_scaled_size = 6;
|
|
||||||
cinfo->min_DCT_v_scaled_size = 6;
|
|
||||||
} else if (cinfo->scale_num * 7 >= cinfo->scale_denom * cinfo->block_size) {
|
|
||||||
/* Provide block_size/7 scaling */
|
|
||||||
cinfo->jpeg_width = (JDIMENSION)
|
|
||||||
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 7L);
|
|
||||||
cinfo->jpeg_height = (JDIMENSION)
|
|
||||||
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 7L);
|
|
||||||
cinfo->min_DCT_h_scaled_size = 7;
|
|
||||||
cinfo->min_DCT_v_scaled_size = 7;
|
|
||||||
} else if (cinfo->scale_num * 8 >= cinfo->scale_denom * cinfo->block_size) {
|
|
||||||
/* Provide block_size/8 scaling */
|
|
||||||
cinfo->jpeg_width = (JDIMENSION)
|
|
||||||
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 8L);
|
|
||||||
cinfo->jpeg_height = (JDIMENSION)
|
|
||||||
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 8L);
|
|
||||||
cinfo->min_DCT_h_scaled_size = 8;
|
|
||||||
cinfo->min_DCT_v_scaled_size = 8;
|
|
||||||
} else if (cinfo->scale_num * 9 >= cinfo->scale_denom * cinfo->block_size) {
|
|
||||||
/* Provide block_size/9 scaling */
|
|
||||||
cinfo->jpeg_width = (JDIMENSION)
|
|
||||||
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 9L);
|
|
||||||
cinfo->jpeg_height = (JDIMENSION)
|
|
||||||
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 9L);
|
|
||||||
cinfo->min_DCT_h_scaled_size = 9;
|
|
||||||
cinfo->min_DCT_v_scaled_size = 9;
|
|
||||||
} else if (cinfo->scale_num * 10 >= cinfo->scale_denom * cinfo->block_size) {
|
|
||||||
/* Provide block_size/10 scaling */
|
|
||||||
cinfo->jpeg_width = (JDIMENSION)
|
|
||||||
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 10L);
|
|
||||||
cinfo->jpeg_height = (JDIMENSION)
|
|
||||||
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 10L);
|
|
||||||
cinfo->min_DCT_h_scaled_size = 10;
|
|
||||||
cinfo->min_DCT_v_scaled_size = 10;
|
|
||||||
} else if (cinfo->scale_num * 11 >= cinfo->scale_denom * cinfo->block_size) {
|
|
||||||
/* Provide block_size/11 scaling */
|
|
||||||
cinfo->jpeg_width = (JDIMENSION)
|
|
||||||
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 11L);
|
|
||||||
cinfo->jpeg_height = (JDIMENSION)
|
|
||||||
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 11L);
|
|
||||||
cinfo->min_DCT_h_scaled_size = 11;
|
|
||||||
cinfo->min_DCT_v_scaled_size = 11;
|
|
||||||
} else if (cinfo->scale_num * 12 >= cinfo->scale_denom * cinfo->block_size) {
|
|
||||||
/* Provide block_size/12 scaling */
|
|
||||||
cinfo->jpeg_width = (JDIMENSION)
|
|
||||||
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 12L);
|
|
||||||
cinfo->jpeg_height = (JDIMENSION)
|
|
||||||
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 12L);
|
|
||||||
cinfo->min_DCT_h_scaled_size = 12;
|
|
||||||
cinfo->min_DCT_v_scaled_size = 12;
|
|
||||||
} else if (cinfo->scale_num * 13 >= cinfo->scale_denom * cinfo->block_size) {
|
|
||||||
/* Provide block_size/13 scaling */
|
|
||||||
cinfo->jpeg_width = (JDIMENSION)
|
|
||||||
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 13L);
|
|
||||||
cinfo->jpeg_height = (JDIMENSION)
|
|
||||||
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 13L);
|
|
||||||
cinfo->min_DCT_h_scaled_size = 13;
|
|
||||||
cinfo->min_DCT_v_scaled_size = 13;
|
|
||||||
} else if (cinfo->scale_num * 14 >= cinfo->scale_denom * cinfo->block_size) {
|
|
||||||
/* Provide block_size/14 scaling */
|
|
||||||
cinfo->jpeg_width = (JDIMENSION)
|
|
||||||
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 14L);
|
|
||||||
cinfo->jpeg_height = (JDIMENSION)
|
|
||||||
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 14L);
|
|
||||||
cinfo->min_DCT_h_scaled_size = 14;
|
|
||||||
cinfo->min_DCT_v_scaled_size = 14;
|
|
||||||
} else if (cinfo->scale_num * 15 >= cinfo->scale_denom * cinfo->block_size) {
|
|
||||||
/* Provide block_size/15 scaling */
|
|
||||||
cinfo->jpeg_width = (JDIMENSION)
|
|
||||||
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 15L);
|
|
||||||
cinfo->jpeg_height = (JDIMENSION)
|
|
||||||
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 15L);
|
|
||||||
cinfo->min_DCT_h_scaled_size = 15;
|
|
||||||
cinfo->min_DCT_v_scaled_size = 15;
|
|
||||||
} else {
|
|
||||||
/* Provide block_size/16 scaling */
|
|
||||||
cinfo->jpeg_width = (JDIMENSION)
|
|
||||||
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 16L);
|
|
||||||
cinfo->jpeg_height = (JDIMENSION)
|
|
||||||
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 16L);
|
|
||||||
cinfo->min_DCT_h_scaled_size = 16;
|
|
||||||
cinfo->min_DCT_v_scaled_size = 16;
|
|
||||||
}
|
|
||||||
|
|
||||||
#else /* !DCT_SCALING_SUPPORTED */
|
|
||||||
|
|
||||||
/* Hardwire it to "no scaling" */
|
|
||||||
cinfo->jpeg_width = cinfo->image_width;
|
|
||||||
cinfo->jpeg_height = cinfo->image_height;
|
|
||||||
cinfo->min_DCT_h_scaled_size = DCTSIZE;
|
|
||||||
cinfo->min_DCT_v_scaled_size = DCTSIZE;
|
|
||||||
|
|
||||||
#endif /* DCT_SCALING_SUPPORTED */
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
LOCAL(void)
|
LOCAL(void)
|
||||||
jpeg_calc_trans_dimensions (j_compress_ptr cinfo)
|
initial_setup (j_compress_ptr cinfo)
|
||||||
{
|
|
||||||
if (cinfo->min_DCT_h_scaled_size != cinfo->min_DCT_v_scaled_size)
|
|
||||||
ERREXIT2(cinfo, JERR_BAD_DCTSIZE,
|
|
||||||
cinfo->min_DCT_h_scaled_size, cinfo->min_DCT_v_scaled_size);
|
|
||||||
|
|
||||||
cinfo->block_size = cinfo->min_DCT_h_scaled_size;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
LOCAL(void)
|
|
||||||
initial_setup (j_compress_ptr cinfo, boolean transcode_only)
|
|
||||||
/* Do computations that are needed before master selection phase */
|
/* Do computations that are needed before master selection phase */
|
||||||
{
|
{
|
||||||
int ci, ssize;
|
int ci, ssize;
|
||||||
jpeg_component_info *compptr;
|
jpeg_component_info *compptr;
|
||||||
|
|
||||||
if (transcode_only)
|
|
||||||
jpeg_calc_trans_dimensions(cinfo);
|
|
||||||
else
|
|
||||||
jpeg_calc_jpeg_dimensions(cinfo);
|
|
||||||
|
|
||||||
/* Sanity check on block_size */
|
/* Sanity check on block_size */
|
||||||
if (cinfo->block_size < 1 || cinfo->block_size > 16)
|
if (cinfo->block_size < 1 || cinfo->block_size > 16)
|
||||||
ERREXIT2(cinfo, JERR_BAD_DCTSIZE, cinfo->block_size, cinfo->block_size);
|
ERREXIT2(cinfo, JERR_BAD_DCTSIZE, cinfo->block_size, cinfo->block_size);
|
||||||
@@ -414,13 +236,9 @@ validate_script (j_compress_ptr cinfo)
|
|||||||
* out-of-range reconstructed DC values during the first DC scan,
|
* out-of-range reconstructed DC values during the first DC scan,
|
||||||
* which might cause problems for some decoders.
|
* which might cause problems for some decoders.
|
||||||
*/
|
*/
|
||||||
#if BITS_IN_JSAMPLE == 8
|
|
||||||
#define MAX_AH_AL 10
|
|
||||||
#else
|
|
||||||
#define MAX_AH_AL 13
|
|
||||||
#endif
|
|
||||||
if (Ss < 0 || Ss >= DCTSIZE2 || Se < Ss || Se >= DCTSIZE2 ||
|
if (Ss < 0 || Ss >= DCTSIZE2 || Se < Ss || Se >= DCTSIZE2 ||
|
||||||
Ah < 0 || Ah > MAX_AH_AL || Al < 0 || Al > MAX_AH_AL)
|
Ah < 0 || Ah > (cinfo->data_precision > 8 ? 13 : 10) ||
|
||||||
|
Al < 0 || Al > (cinfo->data_precision > 8 ? 13 : 10))
|
||||||
ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);
|
ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);
|
||||||
if (Ss == 0) {
|
if (Ss == 0) {
|
||||||
if (Se != 0) /* DC and AC together not OK */
|
if (Se != 0) /* DC and AC together not OK */
|
||||||
@@ -812,7 +630,7 @@ jinit_c_master_control (j_compress_ptr cinfo, boolean transcode_only)
|
|||||||
master->pub.is_last_pass = FALSE;
|
master->pub.is_last_pass = FALSE;
|
||||||
|
|
||||||
/* Validate parameters, determine derived values */
|
/* Validate parameters, determine derived values */
|
||||||
initial_setup(cinfo, transcode_only);
|
initial_setup(cinfo);
|
||||||
|
|
||||||
if (cinfo->scan_info != NULL) {
|
if (cinfo->scan_info != NULL) {
|
||||||
#ifdef C_MULTISCAN_FILES_SUPPORTED
|
#ifdef C_MULTISCAN_FILES_SUPPORTED
|
||||||
|
|||||||
Vendored
+21
-3
@@ -2,7 +2,7 @@
|
|||||||
* jctrans.c
|
* jctrans.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 1995-1998, Thomas G. Lane.
|
* Copyright (C) 1995-1998, Thomas G. Lane.
|
||||||
* Modified 2000-2013 by Guido Vollbeding.
|
* Modified 2000-2017 by Guido Vollbeding.
|
||||||
* This file is part of the Independent JPEG Group's software.
|
* This file is part of the Independent JPEG Group's software.
|
||||||
* For conditions of distribution and use, see the accompanying README file.
|
* For conditions of distribution and use, see the accompanying README file.
|
||||||
*
|
*
|
||||||
@@ -85,12 +85,15 @@ jpeg_copy_critical_parameters (j_decompress_ptr srcinfo,
|
|||||||
jpeg_set_defaults(dstinfo);
|
jpeg_set_defaults(dstinfo);
|
||||||
/* jpeg_set_defaults may choose wrong colorspace, eg YCbCr if input is RGB.
|
/* jpeg_set_defaults may choose wrong colorspace, eg YCbCr if input is RGB.
|
||||||
* Fix it to get the right header markers for the image colorspace.
|
* Fix it to get the right header markers for the image colorspace.
|
||||||
* Note: Entropy table assignment in jpeg_set_colorspace depends
|
* Note: Entropy table assignment in jpeg_set_colorspace
|
||||||
* on color_transform.
|
* depends on color_transform.
|
||||||
|
* Adaption is also required for setting the appropriate
|
||||||
|
* entropy coding mode dependent on image data precision.
|
||||||
*/
|
*/
|
||||||
dstinfo->color_transform = srcinfo->color_transform;
|
dstinfo->color_transform = srcinfo->color_transform;
|
||||||
jpeg_set_colorspace(dstinfo, srcinfo->jpeg_color_space);
|
jpeg_set_colorspace(dstinfo, srcinfo->jpeg_color_space);
|
||||||
dstinfo->data_precision = srcinfo->data_precision;
|
dstinfo->data_precision = srcinfo->data_precision;
|
||||||
|
dstinfo->arith_code = srcinfo->data_precision > 8 ? TRUE : FALSE;
|
||||||
dstinfo->CCIR601_sampling = srcinfo->CCIR601_sampling;
|
dstinfo->CCIR601_sampling = srcinfo->CCIR601_sampling;
|
||||||
/* Copy the source's quantization tables. */
|
/* Copy the source's quantization tables. */
|
||||||
for (tblno = 0; tblno < NUM_QUANT_TBLS; tblno++) {
|
for (tblno = 0; tblno < NUM_QUANT_TBLS; tblno++) {
|
||||||
@@ -157,6 +160,18 @@ jpeg_copy_critical_parameters (j_decompress_ptr srcinfo,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
LOCAL(void)
|
||||||
|
jpeg_calc_trans_dimensions (j_compress_ptr cinfo)
|
||||||
|
/* Do computations that are needed before master selection phase */
|
||||||
|
{
|
||||||
|
if (cinfo->min_DCT_h_scaled_size != cinfo->min_DCT_v_scaled_size)
|
||||||
|
ERREXIT2(cinfo, JERR_BAD_DCTSIZE,
|
||||||
|
cinfo->min_DCT_h_scaled_size, cinfo->min_DCT_v_scaled_size);
|
||||||
|
|
||||||
|
cinfo->block_size = cinfo->min_DCT_h_scaled_size;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Master selection of compression modules for transcoding.
|
* Master selection of compression modules for transcoding.
|
||||||
* This substitutes for jcinit.c's initialization of the full compressor.
|
* This substitutes for jcinit.c's initialization of the full compressor.
|
||||||
@@ -166,6 +181,9 @@ LOCAL(void)
|
|||||||
transencode_master_selection (j_compress_ptr cinfo,
|
transencode_master_selection (j_compress_ptr cinfo,
|
||||||
jvirt_barray_ptr * coef_arrays)
|
jvirt_barray_ptr * coef_arrays)
|
||||||
{
|
{
|
||||||
|
/* Do computations that are needed before master selection phase */
|
||||||
|
jpeg_calc_trans_dimensions(cinfo);
|
||||||
|
|
||||||
/* Initialize master control (includes parameter checking/processing) */
|
/* Initialize master control (includes parameter checking/processing) */
|
||||||
jinit_c_master_control(cinfo, TRUE /* transcode only */);
|
jinit_c_master_control(cinfo, TRUE /* transcode only */);
|
||||||
|
|
||||||
|
|||||||
Vendored
+3
-3
@@ -2,7 +2,7 @@
|
|||||||
* jdatadst.c
|
* jdatadst.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 1994-1996, Thomas G. Lane.
|
* Copyright (C) 1994-1996, Thomas G. Lane.
|
||||||
* Modified 2009-2012 by Guido Vollbeding.
|
* Modified 2009-2017 by Guido Vollbeding.
|
||||||
* This file is part of the Independent JPEG Group's software.
|
* This file is part of the Independent JPEG Group's software.
|
||||||
* For conditions of distribution and use, see the accompanying README file.
|
* For conditions of distribution and use, see the accompanying README file.
|
||||||
*
|
*
|
||||||
@@ -170,9 +170,9 @@ term_destination (j_compress_ptr cinfo)
|
|||||||
if (JFWRITE(dest->outfile, dest->buffer, datacount) != datacount)
|
if (JFWRITE(dest->outfile, dest->buffer, datacount) != datacount)
|
||||||
ERREXIT(cinfo, JERR_FILE_WRITE);
|
ERREXIT(cinfo, JERR_FILE_WRITE);
|
||||||
}
|
}
|
||||||
fflush(dest->outfile);
|
JFFLUSH(dest->outfile);
|
||||||
/* Make sure we wrote the output file OK */
|
/* Make sure we wrote the output file OK */
|
||||||
if (ferror(dest->outfile))
|
if (JFERROR(dest->outfile))
|
||||||
ERREXIT(cinfo, JERR_FILE_WRITE);
|
ERREXIT(cinfo, JERR_FILE_WRITE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Vendored
+7
-1
@@ -2,7 +2,7 @@
|
|||||||
* jdcolor.c
|
* jdcolor.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 1991-1997, Thomas G. Lane.
|
* Copyright (C) 1991-1997, Thomas G. Lane.
|
||||||
* Modified 2011-2015 by Guido Vollbeding.
|
* Modified 2011-2017 by Guido Vollbeding.
|
||||||
* This file is part of the Independent JPEG Group's software.
|
* This file is part of the Independent JPEG Group's software.
|
||||||
* For conditions of distribution and use, see the accompanying README file.
|
* For conditions of distribution and use, see the accompanying README file.
|
||||||
*
|
*
|
||||||
@@ -14,6 +14,12 @@
|
|||||||
#include "jpeglib.h"
|
#include "jpeglib.h"
|
||||||
|
|
||||||
|
|
||||||
|
#if RANGE_BITS < 2
|
||||||
|
/* Deliberate syntax err */
|
||||||
|
Sorry, this code requires 2 or more range extension bits.
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* Private subobject */
|
/* Private subobject */
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|||||||
Vendored
+5
-6
@@ -2,7 +2,7 @@
|
|||||||
* jdct.h
|
* jdct.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 1994-1996, Thomas G. Lane.
|
* Copyright (C) 1994-1996, Thomas G. Lane.
|
||||||
* Modified 2002-2015 by Guido Vollbeding.
|
* Modified 2002-2017 by Guido Vollbeding.
|
||||||
* This file is part of the Independent JPEG Group's software.
|
* This file is part of the Independent JPEG Group's software.
|
||||||
* For conditions of distribution and use, see the accompanying README file.
|
* For conditions of distribution and use, see the accompanying README file.
|
||||||
*
|
*
|
||||||
@@ -79,13 +79,12 @@ typedef FAST_FLOAT FLOAT_MULT_TYPE; /* preferred floating type */
|
|||||||
* converting them to unsigned form (0..MAXJSAMPLE). The raw outputs could
|
* converting them to unsigned form (0..MAXJSAMPLE). The raw outputs could
|
||||||
* be quite far out of range if the input data is corrupt, so a bulletproof
|
* be quite far out of range if the input data is corrupt, so a bulletproof
|
||||||
* range-limiting step is required. We use a mask-and-table-lookup method
|
* range-limiting step is required. We use a mask-and-table-lookup method
|
||||||
* to do the combined operations quickly, assuming that MAXJSAMPLE+1
|
* to do the combined operations quickly, assuming that RANGE_CENTER
|
||||||
* is a power of 2. See the comments with prepare_range_limit_table
|
* (defined in jpegint.h) is a power of 2. See the comments with
|
||||||
* (in jdmaster.c) for more info.
|
* prepare_range_limit_table (in jdmaster.c) for more info.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define RANGE_MASK (MAXJSAMPLE * 4 + 3) /* 2 bits wider than legal samples */
|
#define RANGE_MASK (RANGE_CENTER * 2 - 1)
|
||||||
#define RANGE_CENTER (MAXJSAMPLE * 2 + 2)
|
|
||||||
#define RANGE_SUBSET (RANGE_CENTER - CENTERJSAMPLE)
|
#define RANGE_SUBSET (RANGE_CENTER - CENTERJSAMPLE)
|
||||||
|
|
||||||
#define IDCT_range_limit(cinfo) ((cinfo)->sample_range_limit - RANGE_SUBSET)
|
#define IDCT_range_limit(cinfo) ((cinfo)->sample_range_limit - RANGE_SUBSET)
|
||||||
|
|||||||
Vendored
+4
-5
@@ -2,7 +2,7 @@
|
|||||||
* jdhuff.c
|
* jdhuff.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 1991-1997, Thomas G. Lane.
|
* Copyright (C) 1991-1997, Thomas G. Lane.
|
||||||
* Modified 2006-2013 by Guido Vollbeding.
|
* Modified 2006-2016 by Guido Vollbeding.
|
||||||
* This file is part of the Independent JPEG Group's software.
|
* This file is part of the Independent JPEG Group's software.
|
||||||
* For conditions of distribution and use, see the accompanying README file.
|
* For conditions of distribution and use, see the accompanying README file.
|
||||||
*
|
*
|
||||||
@@ -799,10 +799,6 @@ decode_mcu_AC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
|
|||||||
*/
|
*/
|
||||||
if (! entropy->insufficient_data) {
|
if (! entropy->insufficient_data) {
|
||||||
|
|
||||||
Se = cinfo->Se;
|
|
||||||
Al = cinfo->Al;
|
|
||||||
natural_order = cinfo->natural_order;
|
|
||||||
|
|
||||||
/* Load up working state.
|
/* Load up working state.
|
||||||
* We can avoid loading/saving bitread state if in an EOB run.
|
* We can avoid loading/saving bitread state if in an EOB run.
|
||||||
*/
|
*/
|
||||||
@@ -814,6 +810,9 @@ decode_mcu_AC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
|
|||||||
EOBRUN--; /* ...process it now (we do nothing) */
|
EOBRUN--; /* ...process it now (we do nothing) */
|
||||||
else {
|
else {
|
||||||
BITREAD_LOAD_STATE(cinfo,entropy->bitstate);
|
BITREAD_LOAD_STATE(cinfo,entropy->bitstate);
|
||||||
|
Se = cinfo->Se;
|
||||||
|
Al = cinfo->Al;
|
||||||
|
natural_order = cinfo->natural_order;
|
||||||
block = MCU_data[0];
|
block = MCU_data[0];
|
||||||
tbl = entropy->ac_derived_tbl;
|
tbl = entropy->ac_derived_tbl;
|
||||||
|
|
||||||
|
|||||||
Vendored
+19
-25
@@ -2,7 +2,7 @@
|
|||||||
* jdmainct.c
|
* jdmainct.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 1994-1996, Thomas G. Lane.
|
* Copyright (C) 1994-1996, Thomas G. Lane.
|
||||||
* Modified 2002-2012 by Guido Vollbeding.
|
* Modified 2002-2016 by Guido Vollbeding.
|
||||||
* This file is part of the Independent JPEG Group's software.
|
* This file is part of the Independent JPEG Group's software.
|
||||||
* For conditions of distribution and use, see the accompanying README file.
|
* For conditions of distribution and use, see the accompanying README file.
|
||||||
*
|
*
|
||||||
@@ -26,8 +26,8 @@
|
|||||||
* trivial. Its responsibility is to provide context rows for upsampling/
|
* trivial. Its responsibility is to provide context rows for upsampling/
|
||||||
* rescaling, and doing this in an efficient fashion is a bit tricky.
|
* rescaling, and doing this in an efficient fashion is a bit tricky.
|
||||||
*
|
*
|
||||||
* Postprocessor input data is counted in "row groups". A row group
|
* Postprocessor input data is counted in "row groups". A row group is
|
||||||
* is defined to be (v_samp_factor * DCT_scaled_size / min_DCT_scaled_size)
|
* defined to be (v_samp_factor * DCT_v_scaled_size / min_DCT_v_scaled_size)
|
||||||
* sample rows of each component. (We require DCT_scaled_size values to be
|
* sample rows of each component. (We require DCT_scaled_size values to be
|
||||||
* chosen such that these numbers are integers. In practice DCT_scaled_size
|
* chosen such that these numbers are integers. In practice DCT_scaled_size
|
||||||
* values will likely be powers of two, so we actually have the stronger
|
* values will likely be powers of two, so we actually have the stronger
|
||||||
@@ -37,8 +37,8 @@
|
|||||||
* applying).
|
* applying).
|
||||||
*
|
*
|
||||||
* The coefficient controller will deliver data to us one iMCU row at a time;
|
* The coefficient controller will deliver data to us one iMCU row at a time;
|
||||||
* each iMCU row contains v_samp_factor * DCT_scaled_size sample rows, or
|
* each iMCU row contains v_samp_factor * DCT_v_scaled_size sample rows, or
|
||||||
* exactly min_DCT_scaled_size row groups. (This amount of data corresponds
|
* exactly min_DCT_v_scaled_size row groups. (This amount of data corresponds
|
||||||
* to one row of MCUs when the image is fully interleaved.) Note that the
|
* to one row of MCUs when the image is fully interleaved.) Note that the
|
||||||
* number of sample rows varies across components, but the number of row
|
* number of sample rows varies across components, but the number of row
|
||||||
* groups does not. Some garbage sample rows may be included in the last iMCU
|
* groups does not. Some garbage sample rows may be included in the last iMCU
|
||||||
@@ -75,7 +75,7 @@
|
|||||||
* We could do this most simply by copying data around in our buffer, but
|
* We could do this most simply by copying data around in our buffer, but
|
||||||
* that'd be very slow. We can avoid copying any data by creating a rather
|
* that'd be very slow. We can avoid copying any data by creating a rather
|
||||||
* strange pointer structure. Here's how it works. We allocate a workspace
|
* strange pointer structure. Here's how it works. We allocate a workspace
|
||||||
* consisting of M+2 row groups (where M = min_DCT_scaled_size is the number
|
* consisting of M+2 row groups (where M = min_DCT_v_scaled_size is the number
|
||||||
* of row groups per iMCU row). We create two sets of redundant pointers to
|
* of row groups per iMCU row). We create two sets of redundant pointers to
|
||||||
* the workspace. Labeling the physical row groups 0 to M+1, the synthesized
|
* the workspace. Labeling the physical row groups 0 to M+1, the synthesized
|
||||||
* pointer lists look like this:
|
* pointer lists look like this:
|
||||||
@@ -100,11 +100,11 @@
|
|||||||
* the first or last sample row as necessary (this is cheaper than copying
|
* the first or last sample row as necessary (this is cheaper than copying
|
||||||
* sample rows around).
|
* sample rows around).
|
||||||
*
|
*
|
||||||
* This scheme breaks down if M < 2, ie, min_DCT_scaled_size is 1. In that
|
* This scheme breaks down if M < 2, ie, min_DCT_v_scaled_size is 1. In that
|
||||||
* situation each iMCU row provides only one row group so the buffering logic
|
* situation each iMCU row provides only one row group so the buffering logic
|
||||||
* must be different (eg, we must read two iMCU rows before we can emit the
|
* must be different (eg, we must read two iMCU rows before we can emit the
|
||||||
* first row group). For now, we simply do not support providing context
|
* first row group). For now, we simply do not support providing context
|
||||||
* rows when min_DCT_scaled_size is 1. That combination seems unlikely to
|
* rows when min_DCT_v_scaled_size is 1. That combination seems unlikely to
|
||||||
* be worth providing --- if someone wants a 1/8th-size preview, they probably
|
* be worth providing --- if someone wants a 1/8th-size preview, they probably
|
||||||
* want it quick and dirty, so a context-free upsampler is sufficient.
|
* want it quick and dirty, so a context-free upsampler is sufficient.
|
||||||
*/
|
*/
|
||||||
@@ -118,17 +118,18 @@ typedef struct {
|
|||||||
/* Pointer to allocated workspace (M or M+2 row groups). */
|
/* Pointer to allocated workspace (M or M+2 row groups). */
|
||||||
JSAMPARRAY buffer[MAX_COMPONENTS];
|
JSAMPARRAY buffer[MAX_COMPONENTS];
|
||||||
|
|
||||||
boolean buffer_full; /* Have we gotten an iMCU row from decoder? */
|
|
||||||
JDIMENSION rowgroup_ctr; /* counts row groups output to postprocessor */
|
JDIMENSION rowgroup_ctr; /* counts row groups output to postprocessor */
|
||||||
|
JDIMENSION rowgroups_avail; /* row groups available to postprocessor */
|
||||||
|
|
||||||
/* Remaining fields are only used in the context case. */
|
/* Remaining fields are only used in the context case. */
|
||||||
|
|
||||||
|
boolean buffer_full; /* Have we gotten an iMCU row from decoder? */
|
||||||
|
|
||||||
/* These are the master pointers to the funny-order pointer lists. */
|
/* These are the master pointers to the funny-order pointer lists. */
|
||||||
JSAMPIMAGE xbuffer[2]; /* pointers to weird pointer lists */
|
JSAMPIMAGE xbuffer[2]; /* pointers to weird pointer lists */
|
||||||
|
|
||||||
int whichptr; /* indicates which pointer set is now in use */
|
int whichptr; /* indicates which pointer set is now in use */
|
||||||
int context_state; /* process_data state machine status */
|
int context_state; /* process_data state machine status */
|
||||||
JDIMENSION rowgroups_avail; /* row groups available to postprocessor */
|
|
||||||
JDIMENSION iMCU_row_ctr; /* counts iMCU rows to detect image top/bot */
|
JDIMENSION iMCU_row_ctr; /* counts iMCU rows to detect image top/bot */
|
||||||
} my_main_controller;
|
} my_main_controller;
|
||||||
|
|
||||||
@@ -195,7 +196,7 @@ alloc_funny_pointers (j_decompress_ptr cinfo)
|
|||||||
LOCAL(void)
|
LOCAL(void)
|
||||||
make_funny_pointers (j_decompress_ptr cinfo)
|
make_funny_pointers (j_decompress_ptr cinfo)
|
||||||
/* Create the funny pointer lists discussed in the comments above.
|
/* Create the funny pointer lists discussed in the comments above.
|
||||||
* The actual workspace is already allocated (in main->buffer),
|
* The actual workspace is already allocated (in mainp->buffer),
|
||||||
* and the space for the pointer lists is allocated too.
|
* and the space for the pointer lists is allocated too.
|
||||||
* This routine just fills in the curiously ordered lists.
|
* This routine just fills in the curiously ordered lists.
|
||||||
* This will be repeated at the beginning of each pass.
|
* This will be repeated at the beginning of each pass.
|
||||||
@@ -317,12 +318,12 @@ start_pass_main (j_decompress_ptr cinfo, J_BUF_MODE pass_mode)
|
|||||||
mainp->whichptr = 0; /* Read first iMCU row into xbuffer[0] */
|
mainp->whichptr = 0; /* Read first iMCU row into xbuffer[0] */
|
||||||
mainp->context_state = CTX_PREPARE_FOR_IMCU;
|
mainp->context_state = CTX_PREPARE_FOR_IMCU;
|
||||||
mainp->iMCU_row_ctr = 0;
|
mainp->iMCU_row_ctr = 0;
|
||||||
|
mainp->buffer_full = FALSE; /* Mark buffer empty */
|
||||||
} else {
|
} else {
|
||||||
/* Simple case with no context needed */
|
/* Simple case with no context needed */
|
||||||
mainp->pub.process_data = process_data_simple_main;
|
mainp->pub.process_data = process_data_simple_main;
|
||||||
|
mainp->rowgroup_ctr = mainp->rowgroups_avail; /* Mark buffer empty */
|
||||||
}
|
}
|
||||||
mainp->buffer_full = FALSE; /* Mark buffer empty */
|
|
||||||
mainp->rowgroup_ctr = 0;
|
|
||||||
break;
|
break;
|
||||||
#ifdef QUANT_2PASS_SUPPORTED
|
#ifdef QUANT_2PASS_SUPPORTED
|
||||||
case JBUF_CRANK_DEST:
|
case JBUF_CRANK_DEST:
|
||||||
@@ -348,17 +349,14 @@ process_data_simple_main (j_decompress_ptr cinfo,
|
|||||||
JDIMENSION out_rows_avail)
|
JDIMENSION out_rows_avail)
|
||||||
{
|
{
|
||||||
my_main_ptr mainp = (my_main_ptr) cinfo->main;
|
my_main_ptr mainp = (my_main_ptr) cinfo->main;
|
||||||
JDIMENSION rowgroups_avail;
|
|
||||||
|
|
||||||
/* Read input data if we haven't filled the main buffer yet */
|
/* Read input data if we haven't filled the main buffer yet */
|
||||||
if (! mainp->buffer_full) {
|
if (mainp->rowgroup_ctr >= mainp->rowgroups_avail) {
|
||||||
if (! (*cinfo->coef->decompress_data) (cinfo, mainp->buffer))
|
if (! (*cinfo->coef->decompress_data) (cinfo, mainp->buffer))
|
||||||
return; /* suspension forced, can do nothing more */
|
return; /* suspension forced, can do nothing more */
|
||||||
mainp->buffer_full = TRUE; /* OK, we have an iMCU row to work with */
|
mainp->rowgroup_ctr = 0; /* OK, we have an iMCU row to work with */
|
||||||
}
|
}
|
||||||
|
|
||||||
/* There are always min_DCT_scaled_size row groups in an iMCU row. */
|
|
||||||
rowgroups_avail = (JDIMENSION) cinfo->min_DCT_v_scaled_size;
|
|
||||||
/* Note: at the bottom of the image, we may pass extra garbage row groups
|
/* Note: at the bottom of the image, we may pass extra garbage row groups
|
||||||
* to the postprocessor. The postprocessor has to check for bottom
|
* to the postprocessor. The postprocessor has to check for bottom
|
||||||
* of image anyway (at row resolution), so no point in us doing it too.
|
* of image anyway (at row resolution), so no point in us doing it too.
|
||||||
@@ -366,14 +364,8 @@ process_data_simple_main (j_decompress_ptr cinfo,
|
|||||||
|
|
||||||
/* Feed the postprocessor */
|
/* Feed the postprocessor */
|
||||||
(*cinfo->post->post_process_data) (cinfo, mainp->buffer,
|
(*cinfo->post->post_process_data) (cinfo, mainp->buffer,
|
||||||
&mainp->rowgroup_ctr, rowgroups_avail,
|
&mainp->rowgroup_ctr, mainp->rowgroups_avail,
|
||||||
output_buf, out_row_ctr, out_rows_avail);
|
output_buf, out_row_ctr, out_rows_avail);
|
||||||
|
|
||||||
/* Has postprocessor consumed all the data yet? If so, mark buffer empty */
|
|
||||||
if (mainp->rowgroup_ctr >= rowgroups_avail) {
|
|
||||||
mainp->buffer_full = FALSE;
|
|
||||||
mainp->rowgroup_ctr = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -498,7 +490,9 @@ jinit_d_main_controller (j_decompress_ptr cinfo, boolean need_full_buffer)
|
|||||||
alloc_funny_pointers(cinfo); /* Alloc space for xbuffer[] lists */
|
alloc_funny_pointers(cinfo); /* Alloc space for xbuffer[] lists */
|
||||||
ngroups = cinfo->min_DCT_v_scaled_size + 2;
|
ngroups = cinfo->min_DCT_v_scaled_size + 2;
|
||||||
} else {
|
} else {
|
||||||
|
/* There are always min_DCT_v_scaled_size row groups in an iMCU row. */
|
||||||
ngroups = cinfo->min_DCT_v_scaled_size;
|
ngroups = cinfo->min_DCT_v_scaled_size;
|
||||||
|
mainp->rowgroups_avail = (JDIMENSION) ngroups;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
|
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
|
||||||
|
|||||||
Vendored
+6
-7
@@ -2,7 +2,7 @@
|
|||||||
* jdmaster.c
|
* jdmaster.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 1991-1997, Thomas G. Lane.
|
* Copyright (C) 1991-1997, Thomas G. Lane.
|
||||||
* Modified 2002-2015 by Guido Vollbeding.
|
* Modified 2002-2017 by Guido Vollbeding.
|
||||||
* This file is part of the Independent JPEG Group's software.
|
* This file is part of the Independent JPEG Group's software.
|
||||||
* For conditions of distribution and use, see the accompanying README file.
|
* For conditions of distribution and use, see the accompanying README file.
|
||||||
*
|
*
|
||||||
@@ -237,18 +237,17 @@ prepare_range_limit_table (j_decompress_ptr cinfo)
|
|||||||
JSAMPLE * table;
|
JSAMPLE * table;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
table = (JSAMPLE *)
|
table = (JSAMPLE *) (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo,
|
||||||
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
|
JPOOL_IMAGE, (RANGE_CENTER * 2 + MAXJSAMPLE + 1) * SIZEOF(JSAMPLE));
|
||||||
5 * (MAXJSAMPLE+1) * SIZEOF(JSAMPLE));
|
|
||||||
/* First segment of range limit table: limit[x] = 0 for x < 0 */
|
/* First segment of range limit table: limit[x] = 0 for x < 0 */
|
||||||
MEMZERO(table, 2 * (MAXJSAMPLE+1) * SIZEOF(JSAMPLE));
|
MEMZERO(table, RANGE_CENTER * SIZEOF(JSAMPLE));
|
||||||
table += 2 * (MAXJSAMPLE+1); /* allow negative subscripts of table */
|
table += RANGE_CENTER; /* allow negative subscripts of table */
|
||||||
cinfo->sample_range_limit = table;
|
cinfo->sample_range_limit = table;
|
||||||
/* Main part of range limit table: limit[x] = x */
|
/* Main part of range limit table: limit[x] = x */
|
||||||
for (i = 0; i <= MAXJSAMPLE; i++)
|
for (i = 0; i <= MAXJSAMPLE; i++)
|
||||||
table[i] = (JSAMPLE) i;
|
table[i] = (JSAMPLE) i;
|
||||||
/* End of range limit table: limit[x] = MAXJSAMPLE for x > MAXJSAMPLE */
|
/* End of range limit table: limit[x] = MAXJSAMPLE for x > MAXJSAMPLE */
|
||||||
for (; i < 3 * (MAXJSAMPLE+1); i++)
|
for (; i <= MAXJSAMPLE + RANGE_CENTER; i++)
|
||||||
table[i] = MAXJSAMPLE;
|
table[i] = MAXJSAMPLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Vendored
+7
-1
@@ -2,7 +2,7 @@
|
|||||||
* jdmerge.c
|
* jdmerge.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 1994-1996, Thomas G. Lane.
|
* Copyright (C) 1994-1996, Thomas G. Lane.
|
||||||
* Modified 2013-2015 by Guido Vollbeding.
|
* Modified 2013-2017 by Guido Vollbeding.
|
||||||
* This file is part of the Independent JPEG Group's software.
|
* This file is part of the Independent JPEG Group's software.
|
||||||
* For conditions of distribution and use, see the accompanying README file.
|
* For conditions of distribution and use, see the accompanying README file.
|
||||||
*
|
*
|
||||||
@@ -40,6 +40,12 @@
|
|||||||
#ifdef UPSAMPLE_MERGING_SUPPORTED
|
#ifdef UPSAMPLE_MERGING_SUPPORTED
|
||||||
|
|
||||||
|
|
||||||
|
#if RANGE_BITS < 2
|
||||||
|
/* Deliberate syntax err */
|
||||||
|
Sorry, this code requires 2 or more range extension bits.
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* Private subobject */
|
/* Private subobject */
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|||||||
Vendored
+2
-2
@@ -2,7 +2,7 @@
|
|||||||
* jfdctflt.c
|
* jfdctflt.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 1994-1996, Thomas G. Lane.
|
* Copyright (C) 1994-1996, Thomas G. Lane.
|
||||||
* Modified 2003-2015 by Guido Vollbeding.
|
* Modified 2003-2017 by Guido Vollbeding.
|
||||||
* This file is part of the Independent JPEG Group's software.
|
* This file is part of the Independent JPEG Group's software.
|
||||||
* For conditions of distribution and use, see the accompanying README file.
|
* For conditions of distribution and use, see the accompanying README file.
|
||||||
*
|
*
|
||||||
@@ -48,7 +48,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#if DCTSIZE != 8
|
#if DCTSIZE != 8
|
||||||
Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */
|
Sorry, this code only copes with 8x8 DCT blocks. /* deliberate syntax err */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Vendored
+2
-2
@@ -2,7 +2,7 @@
|
|||||||
* jfdctfst.c
|
* jfdctfst.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 1994-1996, Thomas G. Lane.
|
* Copyright (C) 1994-1996, Thomas G. Lane.
|
||||||
* Modified 2003-2015 by Guido Vollbeding.
|
* Modified 2003-2017 by Guido Vollbeding.
|
||||||
* This file is part of the Independent JPEG Group's software.
|
* This file is part of the Independent JPEG Group's software.
|
||||||
* For conditions of distribution and use, see the accompanying README file.
|
* For conditions of distribution and use, see the accompanying README file.
|
||||||
*
|
*
|
||||||
@@ -44,7 +44,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#if DCTSIZE != 8
|
#if DCTSIZE != 8
|
||||||
Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */
|
Sorry, this code only copes with 8x8 DCT blocks. /* deliberate syntax err */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Vendored
+2
-2
@@ -2,7 +2,7 @@
|
|||||||
* jidctflt.c
|
* jidctflt.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 1994-1998, Thomas G. Lane.
|
* Copyright (C) 1994-1998, Thomas G. Lane.
|
||||||
* Modified 2010-2015 by Guido Vollbeding.
|
* Modified 2010-2017 by Guido Vollbeding.
|
||||||
* This file is part of the Independent JPEG Group's software.
|
* This file is part of the Independent JPEG Group's software.
|
||||||
* For conditions of distribution and use, see the accompanying README file.
|
* For conditions of distribution and use, see the accompanying README file.
|
||||||
*
|
*
|
||||||
@@ -50,7 +50,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#if DCTSIZE != 8
|
#if DCTSIZE != 8
|
||||||
Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */
|
Sorry, this code only copes with 8x8 DCT blocks. /* deliberate syntax err */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Vendored
+2
-2
@@ -2,7 +2,7 @@
|
|||||||
* jidctfst.c
|
* jidctfst.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 1994-1998, Thomas G. Lane.
|
* Copyright (C) 1994-1998, Thomas G. Lane.
|
||||||
* Modified 2015 by Guido Vollbeding.
|
* Modified 2015-2017 by Guido Vollbeding.
|
||||||
* This file is part of the Independent JPEG Group's software.
|
* This file is part of the Independent JPEG Group's software.
|
||||||
* For conditions of distribution and use, see the accompanying README file.
|
* For conditions of distribution and use, see the accompanying README file.
|
||||||
*
|
*
|
||||||
@@ -46,7 +46,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#if DCTSIZE != 8
|
#if DCTSIZE != 8
|
||||||
Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */
|
Sorry, this code only copes with 8x8 DCT blocks. /* deliberate syntax err */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Vendored
+18
-17
@@ -2,7 +2,7 @@
|
|||||||
* jidctint.c
|
* jidctint.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 1991-1998, Thomas G. Lane.
|
* Copyright (C) 1991-1998, Thomas G. Lane.
|
||||||
* Modification developed 2002-2015 by Guido Vollbeding.
|
* Modification developed 2002-2016 by Guido Vollbeding.
|
||||||
* This file is part of the Independent JPEG Group's software.
|
* This file is part of the Independent JPEG Group's software.
|
||||||
* For conditions of distribution and use, see the accompanying README file.
|
* For conditions of distribution and use, see the accompanying README file.
|
||||||
*
|
*
|
||||||
@@ -166,6 +166,7 @@
|
|||||||
/*
|
/*
|
||||||
* Perform dequantization and inverse DCT on one block of coefficients.
|
* Perform dequantization and inverse DCT on one block of coefficients.
|
||||||
*
|
*
|
||||||
|
* Optimized algorithm with 12 multiplications in the 1-D kernel.
|
||||||
* cK represents sqrt(2) * cos(K*pi/16).
|
* cK represents sqrt(2) * cos(K*pi/16).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -428,7 +429,7 @@ jpeg_idct_islow (j_decompress_ptr cinfo, jpeg_component_info * compptr,
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Perform dequantization and inverse DCT on one block of coefficients,
|
* Perform dequantization and inverse DCT on one block of coefficients,
|
||||||
* producing a 7x7 output block.
|
* producing a reduced-size 7x7 output block.
|
||||||
*
|
*
|
||||||
* Optimized algorithm with 12 multiplications in the 1-D kernel.
|
* Optimized algorithm with 12 multiplications in the 1-D kernel.
|
||||||
* cK represents sqrt(2) * cos(K*pi/14).
|
* cK represents sqrt(2) * cos(K*pi/14).
|
||||||
@@ -2623,7 +2624,7 @@ jpeg_idct_16x16 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
|
|||||||
tmp0 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);
|
tmp0 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);
|
||||||
tmp0 <<= CONST_BITS;
|
tmp0 <<= CONST_BITS;
|
||||||
/* Add fudge factor here for final descale. */
|
/* Add fudge factor here for final descale. */
|
||||||
tmp0 += 1 << (CONST_BITS-PASS1_BITS-1);
|
tmp0 += ONE << (CONST_BITS-PASS1_BITS-1);
|
||||||
|
|
||||||
z1 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);
|
z1 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);
|
||||||
tmp1 = MULTIPLY(z1, FIX(1.306562965)); /* c4[16] = c2[8] */
|
tmp1 = MULTIPLY(z1, FIX(1.306562965)); /* c4[16] = c2[8] */
|
||||||
@@ -2920,13 +2921,6 @@ jpeg_idct_16x8 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
|
|||||||
* The rotator is c(-6).
|
* The rotator is c(-6).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
z2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);
|
|
||||||
z3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);
|
|
||||||
|
|
||||||
z1 = MULTIPLY(z2 + z3, FIX_0_541196100); /* c6 */
|
|
||||||
tmp2 = z1 + MULTIPLY(z2, FIX_0_765366865); /* c2-c6 */
|
|
||||||
tmp3 = z1 - MULTIPLY(z3, FIX_1_847759065); /* c2+c6 */
|
|
||||||
|
|
||||||
z2 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);
|
z2 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);
|
||||||
z3 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);
|
z3 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);
|
||||||
z2 <<= CONST_BITS;
|
z2 <<= CONST_BITS;
|
||||||
@@ -2937,6 +2931,13 @@ jpeg_idct_16x8 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
|
|||||||
tmp0 = z2 + z3;
|
tmp0 = z2 + z3;
|
||||||
tmp1 = z2 - z3;
|
tmp1 = z2 - z3;
|
||||||
|
|
||||||
|
z2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);
|
||||||
|
z3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);
|
||||||
|
|
||||||
|
z1 = MULTIPLY(z2 + z3, FIX_0_541196100); /* c6 */
|
||||||
|
tmp2 = z1 + MULTIPLY(z2, FIX_0_765366865); /* c2-c6 */
|
||||||
|
tmp3 = z1 - MULTIPLY(z3, FIX_1_847759065); /* c2+c6 */
|
||||||
|
|
||||||
tmp10 = tmp0 + tmp2;
|
tmp10 = tmp0 + tmp2;
|
||||||
tmp13 = tmp0 - tmp2;
|
tmp13 = tmp0 - tmp2;
|
||||||
tmp11 = tmp1 + tmp3;
|
tmp11 = tmp1 + tmp3;
|
||||||
@@ -4883,13 +4884,6 @@ jpeg_idct_4x8 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
|
|||||||
* The rotator is c(-6).
|
* The rotator is c(-6).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
z2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);
|
|
||||||
z3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);
|
|
||||||
|
|
||||||
z1 = MULTIPLY(z2 + z3, FIX_0_541196100); /* c6 */
|
|
||||||
tmp2 = z1 + MULTIPLY(z2, FIX_0_765366865); /* c2-c6 */
|
|
||||||
tmp3 = z1 - MULTIPLY(z3, FIX_1_847759065); /* c2+c6 */
|
|
||||||
|
|
||||||
z2 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);
|
z2 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);
|
||||||
z3 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);
|
z3 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);
|
||||||
z2 <<= CONST_BITS;
|
z2 <<= CONST_BITS;
|
||||||
@@ -4900,6 +4894,13 @@ jpeg_idct_4x8 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
|
|||||||
tmp0 = z2 + z3;
|
tmp0 = z2 + z3;
|
||||||
tmp1 = z2 - z3;
|
tmp1 = z2 - z3;
|
||||||
|
|
||||||
|
z2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);
|
||||||
|
z3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);
|
||||||
|
|
||||||
|
z1 = MULTIPLY(z2 + z3, FIX_0_541196100); /* c6 */
|
||||||
|
tmp2 = z1 + MULTIPLY(z2, FIX_0_765366865); /* c2-c6 */
|
||||||
|
tmp3 = z1 - MULTIPLY(z3, FIX_1_847759065); /* c2+c6 */
|
||||||
|
|
||||||
tmp10 = tmp0 + tmp2;
|
tmp10 = tmp0 + tmp2;
|
||||||
tmp13 = tmp0 - tmp2;
|
tmp13 = tmp0 - tmp2;
|
||||||
tmp11 = tmp1 + tmp3;
|
tmp11 = tmp1 + tmp3;
|
||||||
|
|||||||
Vendored
+6
@@ -2,6 +2,7 @@
|
|||||||
* jinclude.h
|
* jinclude.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 1991-1994, Thomas G. Lane.
|
* Copyright (C) 1991-1994, Thomas G. Lane.
|
||||||
|
* Modified 2017 by Guido Vollbeding.
|
||||||
* This file is part of the Independent JPEG Group's software.
|
* This file is part of the Independent JPEG Group's software.
|
||||||
* For conditions of distribution and use, see the accompanying README file.
|
* For conditions of distribution and use, see the accompanying README file.
|
||||||
*
|
*
|
||||||
@@ -83,9 +84,14 @@
|
|||||||
* The modules that use fread() and fwrite() always invoke them through
|
* The modules that use fread() and fwrite() always invoke them through
|
||||||
* these macros. On some systems you may need to twiddle the argument casts.
|
* these macros. On some systems you may need to twiddle the argument casts.
|
||||||
* CAUTION: argument order is different from underlying functions!
|
* CAUTION: argument order is different from underlying functions!
|
||||||
|
*
|
||||||
|
* Furthermore, macros are provided for fflush() and ferror() in order
|
||||||
|
* to facilitate adaption by applications using an own FILE class.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define JFREAD(file,buf,sizeofbuf) \
|
#define JFREAD(file,buf,sizeofbuf) \
|
||||||
((size_t) fread((void *) (buf), (size_t) 1, (size_t) (sizeofbuf), (file)))
|
((size_t) fread((void *) (buf), (size_t) 1, (size_t) (sizeofbuf), (file)))
|
||||||
#define JFWRITE(file,buf,sizeofbuf) \
|
#define JFWRITE(file,buf,sizeofbuf) \
|
||||||
((size_t) fwrite((const void *) (buf), (size_t) 1, (size_t) (sizeofbuf), (file)))
|
((size_t) fwrite((const void *) (buf), (size_t) 1, (size_t) (sizeofbuf), (file)))
|
||||||
|
#define JFFLUSH(file) fflush(file)
|
||||||
|
#define JFERROR(file) ferror(file)
|
||||||
|
|||||||
Vendored
+14
-1
@@ -2,7 +2,7 @@
|
|||||||
* jpegint.h
|
* jpegint.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 1991-1997, Thomas G. Lane.
|
* Copyright (C) 1991-1997, Thomas G. Lane.
|
||||||
* Modified 1997-2013 by Guido Vollbeding.
|
* Modified 1997-2017 by Guido Vollbeding.
|
||||||
* This file is part of the Independent JPEG Group's software.
|
* This file is part of the Independent JPEG Group's software.
|
||||||
* For conditions of distribution and use, see the accompanying README file.
|
* For conditions of distribution and use, see the accompanying README file.
|
||||||
*
|
*
|
||||||
@@ -260,6 +260,19 @@ struct jpeg_color_quantizer {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/* Definition of range extension bits for decompression processes.
|
||||||
|
* See the comments with prepare_range_limit_table (in jdmaster.c)
|
||||||
|
* for more info.
|
||||||
|
* The recommended default value for normal applications is 2.
|
||||||
|
* Applications with special requirements may use a different value.
|
||||||
|
* For example, Ghostscript wants to use 3 for proper handling of
|
||||||
|
* wacky images with oversize coefficient values.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define RANGE_BITS 2
|
||||||
|
#define RANGE_CENTER (CENTERJSAMPLE << RANGE_BITS)
|
||||||
|
|
||||||
|
|
||||||
/* Miscellaneous useful macros */
|
/* Miscellaneous useful macros */
|
||||||
|
|
||||||
#undef MAX
|
#undef MAX
|
||||||
|
|||||||
Vendored
+4
-4
@@ -2,7 +2,7 @@
|
|||||||
* jpeglib.h
|
* jpeglib.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 1991-1998, Thomas G. Lane.
|
* Copyright (C) 1991-1998, Thomas G. Lane.
|
||||||
* Modified 2002-2015 by Guido Vollbeding.
|
* Modified 2002-2017 by Guido Vollbeding.
|
||||||
* This file is part of the Independent JPEG Group's software.
|
* This file is part of the Independent JPEG Group's software.
|
||||||
* For conditions of distribution and use, see the accompanying README file.
|
* For conditions of distribution and use, see the accompanying README file.
|
||||||
*
|
*
|
||||||
@@ -39,7 +39,7 @@ extern "C" {
|
|||||||
|
|
||||||
#define JPEG_LIB_VERSION 90 /* Compatibility version 9.0 */
|
#define JPEG_LIB_VERSION 90 /* Compatibility version 9.0 */
|
||||||
#define JPEG_LIB_VERSION_MAJOR 9
|
#define JPEG_LIB_VERSION_MAJOR 9
|
||||||
#define JPEG_LIB_VERSION_MINOR 2
|
#define JPEG_LIB_VERSION_MINOR 3
|
||||||
|
|
||||||
|
|
||||||
/* Various constants determining the sizes of things.
|
/* Various constants determining the sizes of things.
|
||||||
@@ -411,8 +411,8 @@ struct jpeg_compress_struct {
|
|||||||
JDIMENSION total_iMCU_rows; /* # of iMCU rows to be input to coef ctlr */
|
JDIMENSION total_iMCU_rows; /* # of iMCU rows to be input to coef ctlr */
|
||||||
/* The coefficient controller receives data in units of MCU rows as defined
|
/* The coefficient controller receives data in units of MCU rows as defined
|
||||||
* for fully interleaved scans (whether the JPEG file is interleaved or not).
|
* for fully interleaved scans (whether the JPEG file is interleaved or not).
|
||||||
* There are v_samp_factor * DCTSIZE sample rows of each component in an
|
* There are v_samp_factor * DCT_v_scaled_size sample rows of each component
|
||||||
* "iMCU" (interleaved MCU) row.
|
* in an "iMCU" (interleaved MCU) row.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
Vendored
+3
-3
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* jversion.h
|
* jversion.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 1991-2016, Thomas G. Lane, Guido Vollbeding.
|
* Copyright (C) 1991-2018, Thomas G. Lane, Guido Vollbeding.
|
||||||
* This file is part of the Independent JPEG Group's software.
|
* This file is part of the Independent JPEG Group's software.
|
||||||
* For conditions of distribution and use, see the accompanying README file.
|
* For conditions of distribution and use, see the accompanying README file.
|
||||||
*
|
*
|
||||||
@@ -9,6 +9,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#define JVERSION "9b 17-Jan-2016"
|
#define JVERSION "9c 14-Jan-2018"
|
||||||
|
|
||||||
#define JCOPYRIGHT "Copyright (C) 2016, Thomas G. Lane, Guido Vollbeding"
|
#define JCOPYRIGHT "Copyright (C) 2018, Thomas G. Lane, Guido Vollbeding"
|
||||||
|
|||||||
Vendored
+43
-5
@@ -6063,9 +6063,47 @@ Version 1.6.35 [July 15, 2018]
|
|||||||
Added missing parentheses to a macro definition
|
Added missing parentheses to a macro definition
|
||||||
(suggested by "irwir" in GitHub issue #216)
|
(suggested by "irwir" in GitHub issue #216)
|
||||||
|
|
||||||
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
|
Version 1.6.36 [December 1, 2018]
|
||||||
(subscription required; visit
|
Optimized png_do_expand_palette for ARM processors.
|
||||||
https://lists.sourceforge.net/lists/listinfo/png-mng-implement
|
Improved performance by around 10-22% on a recent ARM Chromebook.
|
||||||
to subscribe).
|
(Contributed by Richard Townsend, ARM Holdings)
|
||||||
|
Fixed manipulation of machine-specific optimization options.
|
||||||
|
(Contributed by Vicki Pfau)
|
||||||
|
Used memcpy instead of manual pointer arithmetic on Intel SSE2.
|
||||||
|
(Contributed by Samuel Williams)
|
||||||
|
Fixed build errors with MSVC on ARM64.
|
||||||
|
(Contributed by Zhijie Liang)
|
||||||
|
Fixed detection of libm in CMakeLists.
|
||||||
|
(Contributed by Cameron Cawley)
|
||||||
|
Fixed incorrect creation of pkg-config file in CMakeLists.
|
||||||
|
(Contributed by Kyle Bentley)
|
||||||
|
Fixed the CMake build on Windows MSYS by avoiding symlinks.
|
||||||
|
Fixed a build warning on OpenBSD.
|
||||||
|
(Contributed by Theo Buehler)
|
||||||
|
Fixed various typos in comments.
|
||||||
|
(Contributed by "luz.paz")
|
||||||
|
Raised the minimum required CMake version from 3.0.2 to 3.1.
|
||||||
|
Removed yet more of the vestigial support for pre-ANSI C compilers.
|
||||||
|
Removed ancient makefiles for ancient systems that have been broken
|
||||||
|
across all previous libpng-1.6.x versions.
|
||||||
|
Removed the Y2K compliance statement and the export control
|
||||||
|
information.
|
||||||
|
Applied various code style and documentation fixes.
|
||||||
|
|
||||||
Glenn R-P
|
Version 1.6.37 [April 14, 2019]
|
||||||
|
Fixed a use-after-free vulnerability (CVE-2019-7317) in png_image_free.
|
||||||
|
Fixed a memory leak in the ARM NEON implementation of png_do_expand_palette.
|
||||||
|
Fixed a memory leak in pngtest.c.
|
||||||
|
Fixed two vulnerabilities (CVE-2018-14048, CVE-2018-14550) in
|
||||||
|
contrib/pngminus; refactor.
|
||||||
|
Changed the license of contrib/pngminus to MIT; refresh makefile and docs.
|
||||||
|
(Contributed by Willem van Schaik)
|
||||||
|
Fixed a typo in the libpng license v2.
|
||||||
|
(Contributed by Miguel Ojeda)
|
||||||
|
Added makefiles for AddressSanitizer-enabled builds.
|
||||||
|
Cleaned up various makefiles.
|
||||||
|
|
||||||
|
Send comments/corrections/commendations to png-mng-implement at lists.sf.net.
|
||||||
|
Subscription is required; visit
|
||||||
|
https://lists.sourceforge.net/lists/listinfo/png-mng-implement
|
||||||
|
to subscribe.
|
||||||
|
|||||||
Vendored
+19
-5
@@ -29,8 +29,11 @@ file(GLOB lib_hdrs *.h)
|
|||||||
|
|
||||||
|
|
||||||
if(ARM OR AARCH64)
|
if(ARM OR AARCH64)
|
||||||
if(ENABLE_NEON AND NOT AARCH64)
|
if(ENABLE_NEON)
|
||||||
list(APPEND lib_srcs arm/arm_init.c arm/filter_neon.S arm/filter_neon_intrinsics.c)
|
if(NOT AARCH64)
|
||||||
|
list(APPEND lib_srcs arm/filter_neon.S)
|
||||||
|
endif()
|
||||||
|
list(APPEND lib_srcs arm/arm_init.c arm/filter_neon_intrinsics.c arm/palette_neon_intrinsics.c)
|
||||||
add_definitions(-DPNG_ARM_NEON_OPT=2)
|
add_definitions(-DPNG_ARM_NEON_OPT=2)
|
||||||
else()
|
else()
|
||||||
add_definitions(-DPNG_ARM_NEON_OPT=0) # NEON assembler is not supported
|
add_definitions(-DPNG_ARM_NEON_OPT=0) # NEON assembler is not supported
|
||||||
@@ -43,8 +46,19 @@ if(";${CPU_BASELINE_FINAL};" MATCHES "SSE2"
|
|||||||
add_definitions(-DPNG_INTEL_SSE)
|
add_definitions(-DPNG_INTEL_SSE)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# set definitions and sources for MIPS
|
||||||
|
if(";${CPU_BASELINE_FINAL};" MATCHES "MSA")
|
||||||
|
list(APPEND lib_srcs mips/mips_init.c mips/filter_msa_intrinsics.c)
|
||||||
|
add_definitions(-DPNG_MIPS_MSA_OPT=2)
|
||||||
|
ocv_warnings_disable(CMAKE_C_FLAGS -Wshadow)
|
||||||
|
else()
|
||||||
|
add_definitions(-DPNG_MIPS_MSA_OPT=0)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(PPC64LE OR PPC64)
|
if(PPC64LE OR PPC64)
|
||||||
if(ENABLE_VSX AND NOT PPC64)
|
# VSX3 features are backwards compatible
|
||||||
|
if(";${CPU_BASELINE_FINAL};" MATCHES "VSX.*"
|
||||||
|
AND NOT PPC64)
|
||||||
list(APPEND lib_srcs powerpc/powerpc_init.c powerpc/filter_vsx_intrinsics.c)
|
list(APPEND lib_srcs powerpc/powerpc_init.c powerpc/filter_vsx_intrinsics.c)
|
||||||
add_definitions(-DPNG_POWERPC_VSX_OPT=2)
|
add_definitions(-DPNG_POWERPC_VSX_OPT=2)
|
||||||
else()
|
else()
|
||||||
@@ -63,7 +77,7 @@ endif(MSVC)
|
|||||||
add_library(${PNG_LIBRARY} STATIC ${lib_srcs} ${lib_hdrs})
|
add_library(${PNG_LIBRARY} STATIC ${lib_srcs} ${lib_hdrs})
|
||||||
target_link_libraries(${PNG_LIBRARY} ${ZLIB_LIBRARIES})
|
target_link_libraries(${PNG_LIBRARY} ${ZLIB_LIBRARIES})
|
||||||
|
|
||||||
ocv_warnings_disable(CMAKE_C_FLAGS -Wundef -Wcast-align -Wimplicit-fallthrough)
|
ocv_warnings_disable(CMAKE_C_FLAGS -Wundef -Wcast-align -Wimplicit-fallthrough -Wunused-parameter -Wsign-compare)
|
||||||
|
|
||||||
set_target_properties(${PNG_LIBRARY}
|
set_target_properties(${PNG_LIBRARY}
|
||||||
PROPERTIES OUTPUT_NAME ${PNG_LIBRARY}
|
PROPERTIES OUTPUT_NAME ${PNG_LIBRARY}
|
||||||
@@ -81,4 +95,4 @@ if(NOT BUILD_SHARED_LIBS)
|
|||||||
ocv_install_target(${PNG_LIBRARY} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev)
|
ocv_install_target(${PNG_LIBRARY} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
ocv_install_3rdparty_licenses(libpng LICENSE README opencv-libpng.patch)
|
ocv_install_3rdparty_licenses(libpng LICENSE README)
|
||||||
|
|||||||
Vendored
+58
-57
@@ -1,16 +1,45 @@
|
|||||||
|
COPYRIGHT NOTICE, DISCLAIMER, and LICENSE
|
||||||
|
=========================================
|
||||||
|
|
||||||
This copy of the libpng notices is provided for your convenience. In case of
|
PNG Reference Library License version 2
|
||||||
any discrepancy between this copy and the notices in the file png.h that is
|
---------------------------------------
|
||||||
included in the libpng distribution, the latter shall prevail.
|
|
||||||
|
|
||||||
COPYRIGHT NOTICE, DISCLAIMER, and LICENSE:
|
* Copyright (c) 1995-2019 The PNG Reference Library Authors.
|
||||||
|
* Copyright (c) 2018-2019 Cosmin Truta.
|
||||||
|
* Copyright (c) 2000-2002, 2004, 2006-2018 Glenn Randers-Pehrson.
|
||||||
|
* Copyright (c) 1996-1997 Andreas Dilger.
|
||||||
|
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
|
||||||
|
|
||||||
If you modify libpng you may insert additional notices immediately following
|
The software is supplied "as is", without warranty of any kind,
|
||||||
this sentence.
|
express or implied, including, without limitation, the warranties
|
||||||
|
of merchantability, fitness for a particular purpose, title, and
|
||||||
|
non-infringement. In no event shall the Copyright owners, or
|
||||||
|
anyone distributing the software, be liable for any damages or
|
||||||
|
other liability, whether in contract, tort or otherwise, arising
|
||||||
|
from, out of, or in connection with the software, or the use or
|
||||||
|
other dealings in the software, even if advised of the possibility
|
||||||
|
of such damage.
|
||||||
|
|
||||||
This code is released under the libpng license.
|
Permission is hereby granted to use, copy, modify, and distribute
|
||||||
|
this software, or portions hereof, for any purpose, without fee,
|
||||||
|
subject to the following restrictions:
|
||||||
|
|
||||||
libpng versions 1.0.7, July 1, 2000 through 1.6.35, July 15, 2018 are
|
1. The origin of this software must not be misrepresented; you
|
||||||
|
must not claim that you wrote the original software. If you
|
||||||
|
use this software in a product, an acknowledgment in the product
|
||||||
|
documentation would be appreciated, but is not required.
|
||||||
|
|
||||||
|
2. Altered source versions must be plainly marked as such, and must
|
||||||
|
not be misrepresented as being the original software.
|
||||||
|
|
||||||
|
3. This Copyright notice may not be removed or altered from any
|
||||||
|
source or altered source distribution.
|
||||||
|
|
||||||
|
|
||||||
|
PNG Reference Library License version 1 (for libpng 0.5 through 1.6.35)
|
||||||
|
-----------------------------------------------------------------------
|
||||||
|
|
||||||
|
libpng versions 1.0.7, July 1, 2000, through 1.6.35, July 15, 2018 are
|
||||||
Copyright (c) 2000-2002, 2004, 2006-2018 Glenn Randers-Pehrson, are
|
Copyright (c) 2000-2002, 2004, 2006-2018 Glenn Randers-Pehrson, are
|
||||||
derived from libpng-1.0.6, and are distributed according to the same
|
derived from libpng-1.0.6, and are distributed according to the same
|
||||||
disclaimer and license as libpng-1.0.6 with the following individuals
|
disclaimer and license as libpng-1.0.6 with the following individuals
|
||||||
@@ -28,22 +57,22 @@ added to the list of Contributing Authors:
|
|||||||
|
|
||||||
and with the following additions to the disclaimer:
|
and with the following additions to the disclaimer:
|
||||||
|
|
||||||
There is no warranty against interference with your enjoyment of the
|
There is no warranty against interference with your enjoyment of
|
||||||
library or against infringement. There is no warranty that our
|
the library or against infringement. There is no warranty that our
|
||||||
efforts or the library will fulfill any of your particular purposes
|
efforts or the library will fulfill any of your particular purposes
|
||||||
or needs. This library is provided with all faults, and the entire
|
or needs. This library is provided with all faults, and the entire
|
||||||
risk of satisfactory quality, performance, accuracy, and effort is with
|
risk of satisfactory quality, performance, accuracy, and effort is
|
||||||
the user.
|
with the user.
|
||||||
|
|
||||||
Some files in the "contrib" directory and some configure-generated
|
Some files in the "contrib" directory and some configure-generated
|
||||||
files that are distributed with libpng have other copyright owners and
|
files that are distributed with libpng have other copyright owners, and
|
||||||
are released under other open source licenses.
|
are released under other open source licenses.
|
||||||
|
|
||||||
libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are
|
libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are
|
||||||
Copyright (c) 1998-2000 Glenn Randers-Pehrson, are derived from
|
Copyright (c) 1998-2000 Glenn Randers-Pehrson, are derived from
|
||||||
libpng-0.96, and are distributed according to the same disclaimer and
|
libpng-0.96, and are distributed according to the same disclaimer and
|
||||||
license as libpng-0.96, with the following individuals added to the list
|
license as libpng-0.96, with the following individuals added to the
|
||||||
of Contributing Authors:
|
list of Contributing Authors:
|
||||||
|
|
||||||
Tom Lane
|
Tom Lane
|
||||||
Glenn Randers-Pehrson
|
Glenn Randers-Pehrson
|
||||||
@@ -62,7 +91,7 @@ Contributing Authors:
|
|||||||
Greg Roelofs
|
Greg Roelofs
|
||||||
Tom Tanner
|
Tom Tanner
|
||||||
|
|
||||||
Some files in the "scripts" directory have other copyright owners
|
Some files in the "scripts" directory have other copyright owners,
|
||||||
but are released under this license.
|
but are released under this license.
|
||||||
|
|
||||||
libpng versions 0.5, May 1995, through 0.88, January 1996, are
|
libpng versions 0.5, May 1995, through 0.88, January 1996, are
|
||||||
@@ -77,13 +106,14 @@ is defined as the following set of individuals:
|
|||||||
Paul Schmidt
|
Paul Schmidt
|
||||||
Tim Wegner
|
Tim Wegner
|
||||||
|
|
||||||
The PNG Reference Library is supplied "AS IS". The Contributing Authors
|
The PNG Reference Library is supplied "AS IS". The Contributing
|
||||||
and Group 42, Inc. disclaim all warranties, expressed or implied,
|
Authors and Group 42, Inc. disclaim all warranties, expressed or
|
||||||
including, without limitation, the warranties of merchantability and of
|
implied, including, without limitation, the warranties of
|
||||||
fitness for any purpose. The Contributing Authors and Group 42, Inc.
|
merchantability and of fitness for any purpose. The Contributing
|
||||||
assume no liability for direct, indirect, incidental, special, exemplary,
|
Authors and Group 42, Inc. assume no liability for direct, indirect,
|
||||||
or consequential damages, which may result from the use of the PNG
|
incidental, special, exemplary, or consequential damages, which may
|
||||||
Reference Library, even if advised of the possibility of such damage.
|
result from the use of the PNG Reference Library, even if advised of
|
||||||
|
the possibility of such damage.
|
||||||
|
|
||||||
Permission is hereby granted to use, copy, modify, and distribute this
|
Permission is hereby granted to use, copy, modify, and distribute this
|
||||||
source code, or portions hereof, for any purpose, without fee, subject
|
source code, or portions hereof, for any purpose, without fee, subject
|
||||||
@@ -97,37 +127,8 @@ to the following restrictions:
|
|||||||
3. This Copyright notice may not be removed or altered from any
|
3. This Copyright notice may not be removed or altered from any
|
||||||
source or altered source distribution.
|
source or altered source distribution.
|
||||||
|
|
||||||
The Contributing Authors and Group 42, Inc. specifically permit, without
|
The Contributing Authors and Group 42, Inc. specifically permit,
|
||||||
fee, and encourage the use of this source code as a component to
|
without fee, and encourage the use of this source code as a component
|
||||||
supporting the PNG file format in commercial products. If you use this
|
to supporting the PNG file format in commercial products. If you use
|
||||||
source code in a product, acknowledgment is not required but would be
|
this source code in a product, acknowledgment is not required but would
|
||||||
appreciated.
|
be appreciated.
|
||||||
|
|
||||||
END OF COPYRIGHT NOTICE, DISCLAIMER, and LICENSE.
|
|
||||||
|
|
||||||
TRADEMARK:
|
|
||||||
|
|
||||||
The name "libpng" has not been registered by the Copyright owner
|
|
||||||
as a trademark in any jurisdiction. However, because libpng has
|
|
||||||
been distributed and maintained world-wide, continually since 1995,
|
|
||||||
the Copyright owner claims "common-law trademark protection" in any
|
|
||||||
jurisdiction where common-law trademark is recognized.
|
|
||||||
|
|
||||||
OSI CERTIFICATION:
|
|
||||||
|
|
||||||
Libpng is OSI Certified Open Source Software. OSI Certified Open Source is
|
|
||||||
a certification mark of the Open Source Initiative. OSI has not addressed
|
|
||||||
the additional disclaimers inserted at version 1.0.7.
|
|
||||||
|
|
||||||
EXPORT CONTROL:
|
|
||||||
|
|
||||||
The Copyright owner believes that the Export Control Classification
|
|
||||||
Number (ECCN) for libpng is EAR99, which means not subject to export
|
|
||||||
controls or International Traffic in Arms Regulations (ITAR) because
|
|
||||||
it is open source, publicly available software, that does not contain
|
|
||||||
any encryption software. See the EAR, paragraphs 734.3(b)(3) and
|
|
||||||
734.7(b).
|
|
||||||
|
|
||||||
Glenn Randers-Pehrson
|
|
||||||
glennrp at users.sourceforge.net
|
|
||||||
July 15, 2018
|
|
||||||
|
|||||||
Vendored
+35
-74
@@ -1,15 +1,16 @@
|
|||||||
README for libpng version 1.6.35 - July 15, 2018 (shared library 16.0)
|
README for libpng version 1.6.37 - April 14, 2019
|
||||||
See the note about version numbers near the top of png.h
|
=================================================
|
||||||
|
|
||||||
|
See the note about version numbers near the top of png.h.
|
||||||
See INSTALL for instructions on how to install libpng.
|
See INSTALL for instructions on how to install libpng.
|
||||||
|
|
||||||
Libpng comes in several distribution formats. Get libpng-*.tar.gz or
|
Libpng comes in several distribution formats. Get libpng-*.tar.gz or
|
||||||
libpng-*.tar.xz or if you want UNIX-style line endings in the text files,
|
libpng-*.tar.xz or if you want UNIX-style line endings in the text
|
||||||
or lpng*.7z or lpng*.zip if you want DOS-style line endings.
|
files, or lpng*.7z or lpng*.zip if you want DOS-style line endings.
|
||||||
|
|
||||||
Version 0.89 was the first official release of libpng. Don't let the
|
Version 0.89 was the first official release of libpng. Don't let the
|
||||||
fact that it's the first release fool you. The libpng library has been in
|
fact that it's the first release fool you. The libpng library has been
|
||||||
extensive use and testing since mid-1995. By late 1997 it had
|
in extensive use and testing since mid-1995. By late 1997 it had
|
||||||
finally gotten to the stage where there hadn't been significant
|
finally gotten to the stage where there hadn't been significant
|
||||||
changes to the API in some time, and people have a bad feeling about
|
changes to the API in some time, and people have a bad feeling about
|
||||||
libraries with versions < 1.0. Version 1.0.0 was released in
|
libraries with versions < 1.0. Version 1.0.0 was released in
|
||||||
@@ -60,59 +61,37 @@ the library action on the detection of chunk CRC errors. It is possible
|
|||||||
to set different actions based on whether the CRC error occurred in a
|
to set different actions based on whether the CRC error occurred in a
|
||||||
critical or an ancillary chunk.
|
critical or an ancillary chunk.
|
||||||
|
|
||||||
The changes made to the library, and bugs fixed are based on discussions
|
For a detailed description on using libpng, read libpng-manual.txt.
|
||||||
on the PNG-implement mailing list and not on material submitted
|
For examples of libpng in a program, see example.c and pngtest.c. For
|
||||||
privately to Guy, Andreas, or Glenn. They will forward any good
|
usage information and restrictions (what little they are) on libpng,
|
||||||
suggestions to the list.
|
see png.h. For a description on using zlib (the compression library
|
||||||
|
used by libpng) and zlib's restrictions, see zlib.h
|
||||||
For a detailed description on using libpng, read libpng-manual.txt. For
|
|
||||||
examples of libpng in a program, see example.c and pngtest.c. For usage
|
|
||||||
information and restrictions (what little they are) on libpng, see
|
|
||||||
png.h. For a description on using zlib (the compression library used by
|
|
||||||
libpng) and zlib's restrictions, see zlib.h
|
|
||||||
|
|
||||||
I have included a general makefile, as well as several machine and
|
I have included a general makefile, as well as several machine and
|
||||||
compiler specific ones, but you may have to modify one for your own needs.
|
compiler specific ones, but you may have to modify one for your own
|
||||||
|
needs.
|
||||||
|
|
||||||
You should use zlib 1.0.4 or later to run this, but it MAY work with
|
You should use zlib 1.0.4 or later to run this, but it MAY work with
|
||||||
versions as old as zlib 0.95. Even so, there are bugs in older zlib
|
versions as old as zlib 0.95. Even so, there are bugs in older zlib
|
||||||
versions which can cause the output of invalid compression streams for
|
versions which can cause the output of invalid compression streams for
|
||||||
some images. You will definitely need zlib 1.0.4 or later if you are
|
some images.
|
||||||
taking advantage of the MS-DOS "far" structure allocation for the small
|
|
||||||
and medium memory models. You should also note that zlib is a
|
|
||||||
compression library that is useful for more things than just PNG files.
|
|
||||||
You can use zlib as a drop-in replacement for fread() and fwrite() if
|
|
||||||
you are so inclined.
|
|
||||||
|
|
||||||
zlib should be available at the same place that libpng is, or at zlib.net.
|
You should also note that zlib is a compression library that is useful
|
||||||
|
for more things than just PNG files. You can use zlib as a drop-in
|
||||||
|
replacement for fread() and fwrite(), if you are so inclined.
|
||||||
|
|
||||||
|
zlib should be available at the same place that libpng is, or at
|
||||||
|
https://zlib.net.
|
||||||
|
|
||||||
You may also want a copy of the PNG specification. It is available
|
You may also want a copy of the PNG specification. It is available
|
||||||
as an RFC, a W3C Recommendation, and an ISO/IEC Standard. You can find
|
as an RFC, a W3C Recommendation, and an ISO/IEC Standard. You can find
|
||||||
these at http://www.libpng.org/pub/png/pngdocs.html .
|
these at http://www.libpng.org/pub/png/pngdocs.html .
|
||||||
|
|
||||||
This code is currently being archived at libpng.sourceforge.io in the
|
This code is currently being archived at libpng.sourceforge.io in the
|
||||||
[DOWNLOAD] area, and at http://libpng.download/src . If you
|
[DOWNLOAD] area, and at http://libpng.download/src .
|
||||||
can't find it in any of those places, e-mail me, and I'll help you find it.
|
|
||||||
|
|
||||||
I am not a lawyer, but I believe that the Export Control Classification
|
This release, based in a large way on Glenn's, Guy's and Andreas'
|
||||||
Number (ECCN) for libpng is EAR99, which means not subject to export
|
earlier work, was created and will be supported by myself and the PNG
|
||||||
controls or International Traffic in Arms Regulations (ITAR) because it
|
|
||||||
is open source, publicly available software, that does not contain any
|
|
||||||
encryption software. See the EAR, paragraphs 734.3(b)(3) and 734.7(b).
|
|
||||||
|
|
||||||
If you have any code changes, requests, problems, etc., please e-mail
|
|
||||||
them to me. Also, I'd appreciate any make files or project files,
|
|
||||||
and any modifications you needed to make to get libpng to compile,
|
|
||||||
along with a #define variable to tell what compiler/system you are on.
|
|
||||||
If you needed to add transformations to libpng, or wish libpng would
|
|
||||||
provide the image in a different way, drop me a note (and code, if
|
|
||||||
possible), so I can consider supporting the transformation.
|
|
||||||
Finally, if you get any warning messages when compiling libpng
|
|
||||||
(note: not zlib), and they are easy to fix, I'd appreciate the
|
|
||||||
fix. Please mention "libpng" somewhere in the subject line. Thanks.
|
|
||||||
|
|
||||||
This release was created and will be supported by myself (of course
|
|
||||||
based in a large way on Guy's and Andreas' earlier work), and the PNG
|
|
||||||
development group.
|
development group.
|
||||||
|
|
||||||
Send comments/corrections/commendations to png-mng-implement at
|
Send comments/corrections/commendations to png-mng-implement at
|
||||||
@@ -120,34 +99,21 @@ lists.sourceforge.net (subscription required; visit
|
|||||||
https://lists.sourceforge.net/lists/listinfo/png-mng-implement
|
https://lists.sourceforge.net/lists/listinfo/png-mng-implement
|
||||||
to subscribe).
|
to subscribe).
|
||||||
|
|
||||||
You can't reach Guy, the original libpng author, at the addresses
|
Send general questions about the PNG specification to png-mng-misc
|
||||||
given in previous versions of this document. He and Andreas will
|
at lists.sourceforge.net (subscription required; visit
|
||||||
read mail addressed to the png-implement list, however.
|
|
||||||
|
|
||||||
Please do not send general questions about PNG. Send them to
|
|
||||||
png-mng-misc at lists.sf.net (subscription required; visit
|
|
||||||
https://lists.sourceforge.net/lists/listinfo/png-mng-misc to
|
https://lists.sourceforge.net/lists/listinfo/png-mng-misc to
|
||||||
subscribe). If you have a question about something
|
subscribe).
|
||||||
in the PNG specification that is related to using libpng, send it
|
|
||||||
to me. Send me any questions that start with "I was using libpng,
|
|
||||||
and ...". If in doubt, send questions to me. I'll bounce them
|
|
||||||
to others, if necessary.
|
|
||||||
|
|
||||||
Please do not send suggestions on how to change PNG. We have
|
|
||||||
been discussing PNG for twenty years now, and it is official and
|
|
||||||
finished. If you have suggestions for libpng, however, I'll
|
|
||||||
gladly listen. Even if your suggestion is not used immediately,
|
|
||||||
it may be used later.
|
|
||||||
|
|
||||||
Files in this distribution:
|
Files in this distribution:
|
||||||
|
|
||||||
ANNOUNCE => Announcement of this version, with recent changes
|
ANNOUNCE => Announcement of this version, with recent changes
|
||||||
|
AUTHORS => List of contributing authors
|
||||||
CHANGES => Description of changes between libpng versions
|
CHANGES => Description of changes between libpng versions
|
||||||
KNOWNBUG => List of known bugs and deficiencies
|
KNOWNBUG => List of known bugs and deficiencies
|
||||||
LICENSE => License to use and redistribute libpng
|
LICENSE => License to use and redistribute libpng
|
||||||
README => This file
|
README => This file
|
||||||
TODO => Things not implemented in the current library
|
TODO => Things not implemented in the current library
|
||||||
Y2KINFO => Statement of Y2K compliance
|
TRADEMARK => Trademark information
|
||||||
example.c => Example code for using libpng functions
|
example.c => Example code for using libpng functions
|
||||||
libpng.3 => manual page for libpng (includes libpng-manual.txt)
|
libpng.3 => manual page for libpng (includes libpng-manual.txt)
|
||||||
libpng-manual.txt => Description of libpng and its functions
|
libpng-manual.txt => Description of libpng and its functions
|
||||||
@@ -208,15 +174,10 @@ Files in this distribution:
|
|||||||
scripts => Directory containing scripts for building libpng:
|
scripts => Directory containing scripts for building libpng:
|
||||||
(see scripts/README.txt for the list of scripts)
|
(see scripts/README.txt for the list of scripts)
|
||||||
|
|
||||||
Good luck, and happy coding.
|
Good luck, and happy coding!
|
||||||
|
|
||||||
-Glenn Randers-Pehrson (current maintainer, since 1998)
|
* Cosmin Truta (current maintainer, since 2018)
|
||||||
Internet: glennrp at users.sourceforge.net
|
* Glenn Randers-Pehrson (former maintainer, 1998-2018)
|
||||||
|
* Andreas Eric Dilger (former maintainer, 1996-1997)
|
||||||
-Andreas Eric Dilger (former maintainer, 1996-1997)
|
* Guy Eric Schalnat (original author and former maintainer, 1995-1996)
|
||||||
Internet: adilger at enel.ucalgary.ca
|
(formerly of Group 42, Inc.)
|
||||||
Web: http://www-mddsp.enel.ucalgary.ca/People/adilger/
|
|
||||||
|
|
||||||
-Guy Eric Schalnat (original author and former maintainer, 1995-1996)
|
|
||||||
(formerly of Group 42, Inc)
|
|
||||||
Internet: gschal at infinet.com
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user