mirror of
https://github.com/opencv/opencv.git
synced 2026-07-31 08:13:04 +04:00
Compare commits
1640 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d5fd2f0155 | |||
| c8ebe0eb86 | |||
| 4bfdf7cf2a | |||
| e58da86efc | |||
| 7ed82aea38 | |||
| dc15187f1b | |||
| ae1a249a0a | |||
| 171fbf879f | |||
| 1b443219ed | |||
| 8a1caa0d16 | |||
| cdcf7e62f3 | |||
| 083727b0a6 | |||
| 718dd9f170 | |||
| 76be3529f4 | |||
| 6c218c7b0f | |||
| e87a0baa4b | |||
| 8ee5f2ad89 | |||
| ee76cef1ff | |||
| 6a51e3b39a | |||
| 6da05f7086 | |||
| ae265a48c7 | |||
| af2f8c69f0 | |||
| e24b1629a0 | |||
| 46ccde82cf | |||
| 537494f4dd | |||
| d9ea9bedb2 | |||
| 1546b9bf99 | |||
| 39d5e14c1f | |||
| 62b5d37b6b | |||
| d78d9bf151 | |||
| a5f0fb6008 | |||
| f2bb3d0d80 | |||
| d5dce63254 | |||
| 01981ed290 | |||
| 037a72debd | |||
| 1ef4b7ae5a | |||
| b314cc4c23 | |||
| 6f5d56d994 | |||
| 644de8f22a | |||
| 36f61f3879 | |||
| aa11f7d8a3 | |||
| 793b2b9ad9 | |||
| 050c960dfc | |||
| f30aafc3cc | |||
| 2f065b8b4c | |||
| aece3e732e | |||
| aabeb8a18e | |||
| ebe9327a92 | |||
| d7d51e4cc7 | |||
| 102d8f67cd | |||
| a00fe15abd | |||
| 3acf8cfd63 | |||
| 5224d016e9 | |||
| d34717d8c9 | |||
| 199687a1c5 | |||
| b5a6c8e2b2 | |||
| a5b8f163d7 | |||
| 6add3b9161 | |||
| 955909bdb5 | |||
| 1ddd61f98a | |||
| 3503a36e5e | |||
| 2ea7269450 | |||
| a968eadbf1 | |||
| c6b63e0e28 | |||
| 7bd8ddc8fa | |||
| 0c4a8e2ca8 | |||
| a3e7c2d8e3 | |||
| 40b8b58bc6 | |||
| fc1a156262 | |||
| 8cbd20b380 | |||
| 43d306fc2d | |||
| 14e264f646 | |||
| 01e23a2222 | |||
| f88d89ad82 | |||
| 969b55036f | |||
| b29f73d5e0 | |||
| e998d89e88 | |||
| 295afd5882 | |||
| cbf978d1f7 | |||
| 94e0ac7d9f | |||
| 08b36e4f48 | |||
| d62d880316 | |||
| 361b5e0ebf | |||
| 8da1b9aafa | |||
| c16e2e6234 | |||
| 19f4cc57c1 | |||
| c08f29c803 | |||
| ecb6d03ccd | |||
| e59793cc75 | |||
| 236ad4aeda | |||
| 97bb91d5fa | |||
| 80d4d4d92c | |||
| 6a7df4e973 | |||
| 098f07664d | |||
| 233030e417 | |||
| 6256e425f3 | |||
| 4dbb8ac4b2 | |||
| 48368dc9a1 | |||
| 691c655630 | |||
| e7f2af5fdb | |||
| 4419f4093e | |||
| b88ad7f2d9 | |||
| b300b6b3bd | |||
| c945ea125a | |||
| c32e349332 | |||
| 118218754b | |||
| 234117800f | |||
| 00c61cf197 | |||
| f6901ab877 | |||
| ac58b2f857 | |||
| 862fc06b6f | |||
| 89ed813585 | |||
| 0dc28d3446 | |||
| 50657e2324 | |||
| 7c22cd49a7 | |||
| 220b37144b | |||
| c012490399 | |||
| e937d9b559 | |||
| 688aea6bec | |||
| 7186c46377 | |||
| 74c8ccb45b | |||
| 3fc1487cc9 | |||
| 48ddb53332 | |||
| 9cfe981e1f | |||
| f584c6d723 | |||
| 3ea9022c5f | |||
| 45ee8e2532 | |||
| 2f9072efdc | |||
| f7b8f522ff | |||
| f6aa9ac304 | |||
| 6c575e8826 | |||
| f52a2cf5e1 | |||
| 5e90802b1a | |||
| 45fee13f3d | |||
| 5bfb779d82 | |||
| 261ad78122 | |||
| 4fa82809df | |||
| 95fd61c9b4 | |||
| d1cdef596c | |||
| 7163781639 | |||
| a63cee2139 | |||
| 3e3787ecb6 | |||
| a723aaedd8 | |||
| 830d8d6b75 | |||
| ebb528976f | |||
| f77c2d700f | |||
| 8c44b8306b | |||
| a07f064e50 | |||
| e668cff573 | |||
| ea4b491a73 | |||
| fa953e4205 | |||
| 986bc65e1f | |||
| 540982cc9d | |||
| 5218443784 | |||
| a61546680b | |||
| 8cb7eae5c9 | |||
| 18440c1faf | |||
| 9f69ca503a | |||
| 49ba744130 | |||
| 3b00ee2afb | |||
| 4b24ddd70d | |||
| 1612db5f91 | |||
| 7dfe68cac6 | |||
| 7d832337ae | |||
| a258404a58 | |||
| 83807811cd | |||
| a3048239b3 | |||
| 23e71d1aa2 | |||
| f787c73841 | |||
| b542a1804c | |||
| 2dff2f36bf | |||
| 1604ea3b27 | |||
| 6b674709b8 | |||
| b23d377567 | |||
| f445b826d0 | |||
| a12ceb04bb | |||
| 623aaaccd4 | |||
| da0fd62c23 | |||
| f56445d7ca | |||
| a10d289997 | |||
| 750b1aba8d | |||
| a3e8c6e866 | |||
| 03bee14372 | |||
| 50ff40d684 | |||
| bfd056ceb1 | |||
| 620629593b | |||
| 05ad3a535f | |||
| 5c76f99fdd | |||
| c31164bf1e | |||
| 3835ab394e | |||
| 20b23da8e2 | |||
| f6795d75a6 | |||
| 36915db699 | |||
| 17640d6008 | |||
| 8711653530 | |||
| 7e019af50d | |||
| 8b61719a9d | |||
| fa11b98800 | |||
| 5ae9892170 | |||
| 6426101433 | |||
| cf8322c0d3 | |||
| 64c67a93d3 | |||
| 0384eb7d8c | |||
| 0c84b91dde | |||
| 154380ccf5 | |||
| 7a796b20ea | |||
| 1f2c83845d | |||
| 71f665bd8c | |||
| 2349a09736 | |||
| 1df533c914 | |||
| 44bf748479 | |||
| 2129c72bc0 | |||
| 0428dce27d | |||
| f9fbd29c14 | |||
| 31dc3e9256 | |||
| 698b2bf729 | |||
| 1d42560018 | |||
| efcf307b4c | |||
| 6876f3b91d | |||
| 60354e3901 | |||
| 2e6e9c14b5 | |||
| 7495a4722f | |||
| 721ab68bec | |||
| 192e5c8166 | |||
| 7ce56b3a47 | |||
| bce5d364df | |||
| 2dfb163281 | |||
| 5376863c0c | |||
| 417d7a38de | |||
| a86e036594 | |||
| ba147d2be2 | |||
| 01324b02e7 | |||
| 792722865f | |||
| 9aa401a7d0 | |||
| a160e4fb6b | |||
| c7422e4d90 | |||
| 1192cbe4ab | |||
| 485d2b593c | |||
| 1bea537731 | |||
| 75e88d613f | |||
| 379b83e946 | |||
| dda1bf1887 | |||
| f7e524cbe6 | |||
| e503ac508e | |||
| 458bd1652d | |||
| f5ba3f51ce | |||
| e5e08ec523 | |||
| d392b11dfb | |||
| cd01ee9a54 | |||
| 8c1af09989 | |||
| 3547ac4b49 | |||
| f6c2bf21c8 | |||
| f53ff0d01c | |||
| 4f48dab023 | |||
| 397ba2d9aa | |||
| a7ffcaab28 | |||
| f617f18e46 | |||
| 4372d75b26 | |||
| 885fb703cf | |||
| cd00d8f3f0 | |||
| b3755e617c | |||
| fc0f9da7a7 | |||
| 277961fa25 | |||
| 8cc2cbf1c4 | |||
| 14a9103fc0 | |||
| 6d1f7c2b1b | |||
| 2c1f3487a4 | |||
| acc6189da0 | |||
| ac177b849c | |||
| d696d7f9ea | |||
| 29aeebf5bc | |||
| 41548a091b | |||
| c9e1386e44 | |||
| cc769ff19d | |||
| 5108e3ced6 | |||
| 8753203df0 | |||
| 1834eed809 | |||
| b34234ac14 | |||
| 7ec9f52509 | |||
| a66f61748f | |||
| b45273eccb | |||
| 68f527267b | |||
| 7f22b34c78 | |||
| ad63d24dba | |||
| 3b5813c035 | |||
| 339b963e6b | |||
| 00890aecdf | |||
| 7fe87d9a5b | |||
| 2171cae8ff | |||
| 3f55152ca0 | |||
| f3cebb3e1b | |||
| 2b227f00f2 | |||
| 98de57c6c4 | |||
| e231be86b7 | |||
| a37f7cce52 | |||
| 7ec221e734 | |||
| 949fe93d5a | |||
| b4e9b4fe7d | |||
| c3ced6db4e | |||
| 0b38571920 | |||
| 2ffe15f22f | |||
| fe9ff64d64 | |||
| 31ddd98c8e | |||
| 3f65c12d0c | |||
| 759c9522fd | |||
| f0149cdae2 | |||
| bedabc15ae | |||
| 565f14655c | |||
| 760e7e8efa | |||
| 336627a776 | |||
| fa25faa2d2 | |||
| 6226ea0085 | |||
| dbab8d8c38 | |||
| 9f02b8742e | |||
| 1067cd0649 | |||
| 1537ecd931 | |||
| 5b5c42d2c7 | |||
| 161890dad4 | |||
| 35846fe735 | |||
| 422f802ec9 | |||
| 5fd3d36fe8 | |||
| 96ce65f021 | |||
| 8457e471fd | |||
| 246de2b7f5 | |||
| e8c26963e9 | |||
| 793e7c0d9f | |||
| 3b337a12c9 | |||
| 2c32cb743c | |||
| 11eff8bae0 | |||
| 883b995fd6 | |||
| 27b2059662 | |||
| a28533933f | |||
| d695208727 | |||
| e6ec42d462 | |||
| 613ff61de7 | |||
| 65b02cc8f2 | |||
| 1c8ee3f957 | |||
| 922108060d | |||
| ce74285c5e | |||
| ff4c3873f2 | |||
| 1192734131 | |||
| c262eea84a | |||
| f2ca7e664a | |||
| cf8f65d806 | |||
| bc221bdb90 | |||
| 29976a04c5 | |||
| a3106d424b | |||
| 77b01deb80 | |||
| f53f491cd2 | |||
| 6bed5c181b | |||
| e421233a1d | |||
| f162c08cda | |||
| 0d1d452b79 | |||
| 3c3e131c38 | |||
| a218cf3c61 | |||
| 866468cc3e | |||
| f66fc199a2 | |||
| 11ac26bfb4 | |||
| 2241bfb0df | |||
| a2f7ef9d21 | |||
| c708f506a4 | |||
| d92af2aa85 | |||
| ae293f27cf | |||
| afe9993376 | |||
| e4d573a080 | |||
| f86c8656a3 | |||
| 6697f0ea86 | |||
| a9f5c19239 | |||
| 53bfdc318a | |||
| e935f06f16 | |||
| 1e18004bdd | |||
| 19646ad049 | |||
| 7e943808b6 | |||
| 88dbee3589 | |||
| 5bfa43f7d5 | |||
| 7ed37b3fa5 | |||
| f0271e54d9 | |||
| 0ac2f0e04c | |||
| ef1690ef45 | |||
| 0fa06b1db0 | |||
| abceef74e0 | |||
| 4cf76754d3 | |||
| 5444a6b11c | |||
| b698d0a6ee | |||
| 11fb04c2f7 | |||
| aaf65bb3af | |||
| 9411cd6c07 | |||
| 9d38a95292 | |||
| 0291dd3ef8 | |||
| a35d4f9029 | |||
| a46ca98c57 | |||
| e65e23b9c0 | |||
| d8b2f11cc8 | |||
| c3bb57afea | |||
| 8a480ac3c1 | |||
| ffe0d50447 | |||
| a199d7adf1 | |||
| 348414dc62 | |||
| 243ce78508 | |||
| 33db2ac928 | |||
| 1fabe92ace | |||
| 4564b8a224 | |||
| 284d26da05 | |||
| 971cc3354b | |||
| e8d4259f9a | |||
| 8086afc60a | |||
| 9b7b22ee0e | |||
| b2ebd37ee2 | |||
| 83e6813345 | |||
| d17ab271e8 | |||
| 09f24a851e | |||
| a216b8bf87 | |||
| 81e027eef7 | |||
| 1c371d07b5 | |||
| 55e8549839 | |||
| f8d6c5b330 | |||
| 435b6df989 | |||
| bf8136eaa6 | |||
| af9ee90091 | |||
| cb2e276bff | |||
| cd0f0384ef | |||
| cc584760d3 | |||
| 5924770504 | |||
| 111cdd7a32 | |||
| 89a17b4232 | |||
| f0c411d8b5 | |||
| e5e767abc1 | |||
| 521aac9665 | |||
| d41b20b268 | |||
| 36da867caf | |||
| c5f540e3d7 | |||
| 1949056423 | |||
| c90e824342 | |||
| 749bd80091 | |||
| 1c0b70bbd2 | |||
| b75f6c05c0 | |||
| 269b810601 | |||
| e54040d540 | |||
| 3d50bde46e | |||
| 0b454486cf | |||
| b96e9a4a4a | |||
| ead1dcf308 | |||
| 553259ef99 | |||
| e18df87a15 | |||
| 5cb8619eca | |||
| 476094ad5a | |||
| ff992183b2 | |||
| d2469edd10 | |||
| 0df8fb70b4 | |||
| 37e2afb8f6 | |||
| 4dd9a36a3c | |||
| 41678fe3d3 | |||
| d0e6d2438c | |||
| a724dc99e8 | |||
| 44d473fba0 | |||
| 5bc6b6fc26 | |||
| 8931c68b20 | |||
| 988bc804bf | |||
| f78f908c09 | |||
| 5487bca4f3 | |||
| 52ac3661b0 | |||
| 27f1ab5a70 | |||
| 762a5c8334 | |||
| 2fed41dfa5 | |||
| 8bf1b9a422 | |||
| e0f9eac521 | |||
| b90a2a8497 | |||
| 950a916952 | |||
| 524a2fffe9 | |||
| 3f13339071 | |||
| eb6678ebef | |||
| 6781ca7d55 | |||
| d62e0a3695 | |||
| dcb7fd8520 | |||
| d5713c657b | |||
| 99c4b76a6d | |||
| e4887aaa5b | |||
| 0970ef57bd | |||
| f98c97f796 | |||
| d69a7a3bbf | |||
| ccf6dd07b3 | |||
| e8129429e9 | |||
| 46d3637609 | |||
| 992c908b56 | |||
| 2566d13100 | |||
| cbdaa93e54 | |||
| 5a15369d4d | |||
| deaf1dd458 | |||
| 65f87b114b | |||
| 8f5b453a96 | |||
| b7eec216e9 | |||
| 4988e131fd | |||
| 17c430da88 | |||
| 96a501c08b | |||
| 657c8d1c65 | |||
| e03891b744 | |||
| dc57707e60 | |||
| 56b5a7d977 | |||
| 65dbbf712d | |||
| 49497d8e7c | |||
| 728684840c | |||
| 73f7d091f8 | |||
| 00e1bc49c8 | |||
| cb3a098b25 | |||
| 5a7045181a | |||
| 6a045fd678 | |||
| 327f92cc46 | |||
| 482cacd420 | |||
| 93a6be836c | |||
| ef7185ce43 | |||
| a5fdcf9881 | |||
| 62a63021c7 | |||
| 33fab84473 | |||
| 0ccc839397 | |||
| 920c180052 | |||
| a711e2aa41 | |||
| a84afb6334 | |||
| ab4065fa1c | |||
| ee73b0bd08 | |||
| e58977a3de | |||
| 31bee49371 | |||
| 48ef6df842 | |||
| 98ad7d01d5 | |||
| cdac7c7bec | |||
| fe09c79f4b | |||
| 206c843f36 | |||
| cabad90d6c | |||
| 4e6a108bda | |||
| 6dba1733f0 | |||
| c62e63909a | |||
| daa88c6b9e | |||
| 9b727fa1f3 | |||
| 7566921364 | |||
| e45d74c8f9 | |||
| 923009b5ff | |||
| 4cec9e5ff1 | |||
| 59ba33658a | |||
| 4064d4c7eb | |||
| e58ce89b10 | |||
| 085bd5f55f | |||
| 6259ba1bfd | |||
| 86905754e4 | |||
| 6044395986 | |||
| eff259b047 | |||
| cd8262eb79 | |||
| d2b854674e | |||
| 4f03f70968 | |||
| ad930f6216 | |||
| f061a0ab36 | |||
| c81d785ada | |||
| 6fb46bb34b | |||
| 2e165053ef | |||
| 8cc8b0d2b4 | |||
| 06b4292534 | |||
| 29f883feee | |||
| 365a10f58c | |||
| 0e69cddda2 | |||
| 3bdd7bfbea | |||
| ad5e70f94e | |||
| 7fae2e834c | |||
| 8e3f5fb209 | |||
| 05fbd1e5bc | |||
| 1491934d17 | |||
| 6573b9ace0 | |||
| ee5ff71d55 | |||
| 6e5f0a2a58 | |||
| 721fac5542 | |||
| fce486c4f9 | |||
| 99bc35a883 | |||
| 63e92cccf2 | |||
| a74ed58893 | |||
| 1b4955342f | |||
| 95ac650af6 | |||
| 2b98aa403e | |||
| 5ed65460d1 | |||
| 0eb7060205 | |||
| 425c653a14 | |||
| 52844614c4 | |||
| 85c0c8c7ed | |||
| a8f04359e8 | |||
| e3d502310f | |||
| cb54f4c2ec | |||
| 77fa1a20bf | |||
| a7cdc42140 | |||
| a8aa9d5ecb | |||
| 52fbfb3ec0 | |||
| d25293b721 | |||
| c07af090f5 | |||
| 456e88a8a4 | |||
| a7cc1159cd | |||
| 6bd87e8146 | |||
| 42a4c3fba6 | |||
| 1cba763189 | |||
| d01cbe9320 | |||
| 9ba5581d17 | |||
| b10ab79743 | |||
| 619462b029 | |||
| 6fdddd53a1 | |||
| d93b6be3cc | |||
| 9755ab160d | |||
| 88a187a737 | |||
| 57f5700e18 | |||
| 2043e06102 | |||
| d84b213f59 | |||
| 177fbc7bbb | |||
| c7dcdc0e88 | |||
| eb67dc9f50 | |||
| 676b818d6a | |||
| 56373428dc | |||
| 411ce04f54 | |||
| 13962b8533 | |||
| 04bee3f9b7 | |||
| 305a245530 | |||
| 74113737f3 | |||
| c244b456f0 | |||
| d321a34f7c | |||
| fb1a58ac76 | |||
| 87ab4ee567 | |||
| 0cbaaba4b1 | |||
| 1644af841b | |||
| b0def9617f | |||
| c2664d912a | |||
| 9697e3ac24 | |||
| d2a9efd039 | |||
| 442999dcdb | |||
| d753ae1489 | |||
| db3e3be8ee | |||
| 0c8da03869 | |||
| 6fbf7042b5 | |||
| 0417c8c9c7 | |||
| d4af89781b | |||
| 265acccd56 | |||
| c6638d62e6 | |||
| a8c1cdf88e | |||
| 7a187e9b5e | |||
| 9096b1c768 | |||
| 781fbde449 | |||
| 55ca0fcc27 | |||
| 1b336bb602 | |||
| 25f3a11a16 | |||
| b1706bc7e5 | |||
| 579d74d35b | |||
| 7ce518106b | |||
| 0fb3b8db72 | |||
| 171cba4947 | |||
| fd498501d6 | |||
| 51bfe74ce1 | |||
| 5f3012fc9a | |||
| b44302382d | |||
| 0f3c82e73b | |||
| 458f1d5ebe | |||
| a43e3bebe6 | |||
| f62fe956d1 | |||
| 02385472b6 | |||
| f30b5995b6 | |||
| 852b0226e0 | |||
| 89a6937c00 | |||
| 08a3eef62a | |||
| 434014b05e | |||
| 29ff1129fb | |||
| 5906b49bd1 | |||
| b03ed532cf | |||
| 7d30e19b3e | |||
| b083c20eb2 | |||
| 7722a2b8a8 | |||
| ef3844a177 | |||
| 476aa443c6 | |||
| cb0f74ab9f | |||
| 977e5afbac | |||
| 08d1c54364 | |||
| dbbfa003d3 | |||
| a17d1843fb | |||
| 5ffc5bca7c | |||
| 11ac2e1475 | |||
| 59608907b8 | |||
| e454c4891e | |||
| 3ed243abde | |||
| d60524ecfa | |||
| 345e071b24 | |||
| be1a121d0d | |||
| 156406b56c | |||
| f68654a204 | |||
| 8abb312c20 | |||
| adcb943f61 | |||
| 5489735258 | |||
| 8de176988d | |||
| 79c5d07abe | |||
| 74020a084b | |||
| 09acd478f1 | |||
| e6c9e2fa50 | |||
| ab2c59b80e | |||
| a5209c4882 | |||
| f1dd5e49c5 | |||
| c6b60e219d | |||
| 740f6628ec | |||
| 821fac187c | |||
| 73fdf75328 | |||
| f7daa9e4f5 | |||
| c3e8a82c9c | |||
| d3aaf2d3a3 | |||
| e58e545584 | |||
| 319db07b6b | |||
| 407cc5f1b6 | |||
| 80037dc6de | |||
| d9bada9867 | |||
| 6b89154afd | |||
| 1f2d4e4839 | |||
| 4a9904fe62 | |||
| 4b5fdc6bb2 | |||
| 2d11edd103 | |||
| 515a06cedf | |||
| fef6192bca | |||
| 7d9e1be588 | |||
| ba3cf47600 | |||
| 9e09828cc3 | |||
| b236f10792 | |||
| f0bef94a03 | |||
| 9f177b2bcd | |||
| 765f333a1d | |||
| 1bec7ca540 | |||
| 29bbbaa0a7 | |||
| 4e97c69792 | |||
| 88d8a48b09 | |||
| 73aa5f567b | |||
| d5e8792f55 | |||
| 6202556fc0 | |||
| be9f3826d7 | |||
| 7f453ade73 | |||
| 5393185add | |||
| b3a261c7ce | |||
| 9fef09fe89 | |||
| 6b0fff72d9 | |||
| 21e28adb87 | |||
| a9b030591b | |||
| 57ca10636c | |||
| d4a9c731ff | |||
| 17d15df6cd | |||
| 98611adeb9 | |||
| 01a8c9ca8d | |||
| 0940c56a3f | |||
| d650b5cc5a | |||
| e96a58f091 | |||
| b624da27bd | |||
| 5b443199ca | |||
| cb82388a84 | |||
| 735c31bb4a | |||
| b7253e3280 | |||
| e02318d384 | |||
| 94d187e269 | |||
| d991c22090 | |||
| 9039284d96 | |||
| 593af7287b | |||
| 322960f795 | |||
| b5035ce991 | |||
| 07c56f149f | |||
| c0f435349a | |||
| 0e1c7eda39 | |||
| 2b2bcc9b38 | |||
| a3b109eca0 | |||
| a1b09a3734 | |||
| d81ac52ce2 | |||
| 220df8252d | |||
| de720ac34a | |||
| 68d59a2913 | |||
| 5ecf5f106a | |||
| 753e417dec | |||
| 7d1094b7e1 | |||
| 5b095dfcb6 | |||
| 7c41b54e3d | |||
| 58426c80a3 | |||
| cddd7f10d5 | |||
| ea3c2307dc | |||
| 65b3209441 | |||
| 400a781ebf | |||
| c8689d9d0a | |||
| ea0d1424d8 | |||
| 365f44b094 | |||
| bcf96d637e | |||
| 6ced54a892 | |||
| 486de65067 | |||
| c5a2d28367 | |||
| b4a6aa335d | |||
| 35245cb76e | |||
| fa349b7a4e | |||
| df305e83fa | |||
| b2464e3379 | |||
| 06bff34a6b | |||
| 6856cc7253 | |||
| 508bd3f55d | |||
| 8b51e2df8b | |||
| bd1b252de9 | |||
| 77ddfa2fc9 | |||
| f30931848e | |||
| b27ae9c63b | |||
| 79f8b7fd73 | |||
| 48e9e651a4 | |||
| 7386d8523b | |||
| 1bf353b876 | |||
| 23e336ee53 | |||
| ac54bb193c | |||
| 713577b257 | |||
| 583f4b9633 | |||
| 45a6386e45 | |||
| e9058ea8f5 | |||
| 3c35b563d7 | |||
| fd06139c20 | |||
| b43da8aa5d | |||
| 066259b656 | |||
| d981d04c76 | |||
| 666be238d8 | |||
| 64f5471b2a | |||
| 4e789635c9 | |||
| 7c17695be4 | |||
| 3e3d4ad797 | |||
| 73bbabcd04 | |||
| 93d79d2e5d | |||
| 1889d72889 | |||
| 6e5437a582 | |||
| 09799402f9 | |||
| 5813d2439c | |||
| 4f1ba5e69e | |||
| c934d9c3cc | |||
| 00b19d6fba | |||
| 8b13b85c5e | |||
| 64b0757758 | |||
| 1622e7cc90 | |||
| 1f9713195b | |||
| ea04f9d12e | |||
| 74e4cfd1da | |||
| 27ee6501eb | |||
| a5696da9ec | |||
| 0b439bcd08 | |||
| b805115c1a | |||
| c41fb45da3 | |||
| cdfa58dde0 | |||
| c722625f28 | |||
| 6630eac813 | |||
| 63f5f93063 | |||
| 1d30a524fa | |||
| 7f90f04df2 | |||
| 5da4bb7e88 | |||
| dc1b1f2cd7 | |||
| 25ec4ce6f1 | |||
| d30bc0a4c0 | |||
| c05ac8729e | |||
| 9926a93a78 | |||
| 7093752cb5 | |||
| 0daf055fe6 | |||
| 3f38edfd61 | |||
| ee201f4df5 | |||
| 7228d2a824 | |||
| 9181ecfc7b | |||
| 4bf94cb5d1 | |||
| 599a3026d1 | |||
| 288fa70ed9 | |||
| 152e6476d9 | |||
| 8d05dab32c | |||
| 3c14a8c507 | |||
| 15b948d109 | |||
| ab3b1e9922 | |||
| cd7db168e0 | |||
| cbcdbde29d | |||
| aff2c7c43c | |||
| 2df978b8e7 | |||
| 10808ccbb4 | |||
| f756923271 | |||
| 51a42c0647 | |||
| 189fc43765 | |||
| a327418767 | |||
| a1641f938e | |||
| 351fb8c058 | |||
| 83c4378d5d | |||
| 561421f748 | |||
| 9415560250 | |||
| e74075c689 | |||
| 511d0fe198 | |||
| 1c1762d3f6 | |||
| e0ac0cfbe2 | |||
| bfcc136dc7 | |||
| 775d031366 | |||
| 1a17f402a4 | |||
| 40973bea31 | |||
| 94e36d8c8d | |||
| 4ee6852a1e | |||
| 0be2c7018b | |||
| aa08900ac8 | |||
| 05d5c284f6 | |||
| d37180a2c4 | |||
| 8badf7f354 | |||
| 150bd3aee6 | |||
| f19d0ae41d | |||
| a748eba42e | |||
| 850b1ea2d7 | |||
| 10d2bcc8a2 | |||
| 7ce1bd5d88 | |||
| 935420217c | |||
| 81d4d4948e | |||
| 041da57e87 | |||
| acf1be547d | |||
| 908bf935f7 | |||
| e59e978fcd | |||
| fbaae7ac37 | |||
| dcf7eb972e | |||
| 2840362868 | |||
| d4fc302c7e | |||
| 1cce9db710 | |||
| e92f1eaa3d | |||
| f84cae833a | |||
| 2cef100303 | |||
| ed58b5489f | |||
| ef5fa498d4 | |||
| 78e4fbd2d7 | |||
| 96075ce0c9 | |||
| c007228d0f | |||
| dca9b4283b | |||
| dcec3150f0 | |||
| d015db3de8 | |||
| ef7fb905aa | |||
| 5e5385a814 | |||
| 7aaa918367 | |||
| c2e484a465 | |||
| f64d807863 | |||
| 81c2f3d194 | |||
| 8c77f35fce | |||
| ff4ce9f7b1 | |||
| fecebea2e3 | |||
| f39784c584 | |||
| 98e38b2a41 | |||
| 1d8c73cf6c | |||
| ef68cc3d5f | |||
| 18550b4601 | |||
| 07a0274507 | |||
| 8ff0399432 | |||
| c8f1948d58 | |||
| f6de25b6cb | |||
| b3514a5708 | |||
| dd2c7c5140 | |||
| 91b0100287 | |||
| 870a775d7d | |||
| 575a609b80 | |||
| ca9756f6a1 | |||
| 675342ecd9 | |||
| 245b2fec34 | |||
| 49a75079f2 | |||
| d3f9ad1145 | |||
| 46615ffc4a | |||
| f351653589 | |||
| f0ffc52435 | |||
| f7d029cfce | |||
| 1eb63cfc42 | |||
| 43ff8f8e8d | |||
| b11a3a0820 | |||
| bef6b6282c | |||
| 9c58a7cb1e | |||
| 69ac19d82d | |||
| b77fe9d624 | |||
| 0556450801 | |||
| 5c7c80dd27 | |||
| d7abb641ca | |||
| 4e75f31c55 | |||
| 1537a5f253 | |||
| ce772b346c | |||
| e1f14fcac7 | |||
| 39d3bbb601 | |||
| b1f42a6506 | |||
| cb5921b375 | |||
| 016f9ab16e | |||
| 499e20da4f | |||
| d50c21e571 | |||
| 4d35a46c48 | |||
| 676d1dfd5b | |||
| 2c9d149ac2 | |||
| 06bf845783 | |||
| acede976e4 | |||
| 90e7c29c46 | |||
| ca6a11e4d2 | |||
| f496a37340 | |||
| b8579f12be | |||
| b745e1c43a | |||
| 21ed892489 | |||
| 5504d94e36 | |||
| 31ec9b2aa7 | |||
| 0c2a43923c | |||
| 63320aba6c | |||
| 2fe9c87433 | |||
| adf54d41d5 | |||
| ab4dbff150 | |||
| 75bd9f86b2 | |||
| 734771418e | |||
| 01a85736e6 | |||
| 51a8885566 | |||
| 7d5a8053d7 | |||
| 60c382d8f1 | |||
| 3371e679ce | |||
| b8cf5d8d5f | |||
| 43df944eb4 | |||
| ce5626db45 | |||
| 763a1d7392 | |||
| 1377b9b736 | |||
| 5db3092a1f | |||
| be1615b1c3 | |||
| 936428cb3b | |||
| ca9fd66744 | |||
| bdc95d2c66 | |||
| c305455cb2 | |||
| 8334932a26 | |||
| a10385543b | |||
| 99d29c9d39 | |||
| a448d3a6aa | |||
| e80adc0bc6 | |||
| 1a6b4d6ce6 | |||
| a15417fe74 | |||
| 1b5730a799 | |||
| 3dcb775d16 | |||
| 2d387356de | |||
| 07c3aae315 | |||
| b36eba7fab | |||
| 8574a757f9 | |||
| 01dcfb0825 | |||
| 01b2c5a77c | |||
| 3a45a65625 | |||
| 0812207db7 | |||
| c8776e6ebd | |||
| cf2a3c8e74 | |||
| 1cc1e6fa56 | |||
| 277f0d270f | |||
| 6216bf9221 | |||
| 388a7ce86e | |||
| 5d95a500ad | |||
| 95341c2b1b | |||
| 54063c40de | |||
| 585593e9fc | |||
| f15e885baf | |||
| 9109cb1ec6 | |||
| 3ffed0bf6e | |||
| dc9ee53ff5 | |||
| 1485968fc4 | |||
| 557ac3dbaf | |||
| 09134ac881 | |||
| 433c5199fd | |||
| d448a636f8 | |||
| 396f43d674 | |||
| 3c5fec6746 | |||
| e12b1c2209 | |||
| f6b2b49e4a | |||
| e1322cf503 | |||
| 67dfdee33f | |||
| 61c4cfd896 | |||
| be17f532e1 | |||
| 6d85fa3fd2 | |||
| 95a07ca11c | |||
| 222a48577f | |||
| 353273579b | |||
| 72c5ac37de | |||
| 1eba7f60c2 | |||
| 7373ef0983 | |||
| 2740901378 | |||
| 0c00d082cf | |||
| e661ad2a67 | |||
| 3a4b79173b | |||
| faceb05775 | |||
| bdc29cccb6 | |||
| 8d78400052 | |||
| b4b4d21212 | |||
| 99502e99cc | |||
| 99436bb8cf | |||
| 7465125f67 | |||
| 340df65fb4 | |||
| 9a463b74dc | |||
| 7e4b2057f2 | |||
| c303aaa94d | |||
| c920b45fb8 | |||
| 2a9a2fff66 | |||
| b0563ce368 | |||
| 673eb2b006 | |||
| ef395c3866 | |||
| 4d3d6230c5 | |||
| a28a520c7f | |||
| 0aac17d9f7 | |||
| ea34b2fefb | |||
| f44a0960df | |||
| b1ed003d08 | |||
| 22d930998b | |||
| d2b0953735 | |||
| 978666c816 | |||
| fa002bde01 | |||
| 13c4dc0e69 | |||
| ad4e5dbd3d | |||
| 0b4c101e8a | |||
| 2d63861c09 | |||
| e8c7d61752 | |||
| 4e8cd4629c | |||
| 467c3ef0ac | |||
| b1f390b170 | |||
| 154fdef965 | |||
| 2f665ec589 | |||
| 801f26c35d | |||
| 6db9f00fd1 | |||
| 39b64fc7d7 | |||
| 4dfa798e75 | |||
| 2aeb32d2d1 | |||
| 8433620295 | |||
| 760e9e0943 | |||
| 7b82ad2918 | |||
| 49d8c0bd52 | |||
| 8253562794 | |||
| d7e839b8c5 | |||
| 2fb1d9d02e | |||
| 4cdb4652cf | |||
| 0fb4f2cc9c | |||
| 183e4d50ed | |||
| 020be63df5 | |||
| 377dd04224 | |||
| 31d624f9a8 | |||
| bf224e61a9 | |||
| 8ac333697d | |||
| dbb30134bc | |||
| 847190b5b8 | |||
| 0f31231872 | |||
| b76aeb40fb | |||
| 8fe9674301 | |||
| 66cf55ea1f | |||
| 4b47c7dbd2 | |||
| 221ddec845 | |||
| 2160f9b20e | |||
| e63af185de | |||
| 11d565ca62 | |||
| 8d69dbdf49 | |||
| 14da5ec311 | |||
| 9cc9237522 | |||
| 25ab141b93 | |||
| 718d7e4b04 | |||
| ca68fac4b2 | |||
| 034a43e7f7 | |||
| ca23c0e630 | |||
| 1d7bfcc958 | |||
| 01ea055d79 | |||
| df74eb4ff6 | |||
| c48473dfe4 | |||
| 77d1c20fb7 | |||
| 05d4975619 | |||
| d4d95bd70d | |||
| 7e7bb3027c | |||
| 8f49b820db | |||
| 3b2e409fa7 | |||
| 1c2ed2876f | |||
| 7f0d90a525 | |||
| 71ec112093 | |||
| e021b85b36 | |||
| 9ea62bfddb | |||
| 00925ad795 | |||
| 683910f579 | |||
| 2645ee90ca | |||
| 0e6ce50131 | |||
| ff70b02efc | |||
| 9b64eadcb6 | |||
| 2a52e44bc6 | |||
| 3af63fe052 | |||
| 3d36f9044d | |||
| a1230ad0a0 | |||
| 448a5452d0 | |||
| 4cebef9090 | |||
| 7080c783d1 | |||
| d3b68b059b | |||
| 866b15ddb8 | |||
| 7d1c42afe1 | |||
| d594e72586 | |||
| 4e56c1326f | |||
| 3ba6b41961 | |||
| 034a5f140c | |||
| 3a99ebb446 | |||
| c1a8fb72b7 | |||
| 11b08b5ff3 | |||
| 850414a501 | |||
| a560ebf09d | |||
| 72fedbe096 | |||
| d00e58cdb0 | |||
| 9f82b74788 | |||
| 764e8ac2c4 | |||
| 612746b4e5 | |||
| 83e1d79403 | |||
| 155b751a75 | |||
| 4966186e10 | |||
| 510a8520c7 | |||
| 09fe66e87f | |||
| 3c85745e22 | |||
| b7ecaceda8 | |||
| 3befdb4ae8 | |||
| db95aec4a7 | |||
| 490908f0ff | |||
| 27b71d6368 | |||
| 9b3be01b83 | |||
| 0bcdf7d03e | |||
| 44560c3e50 | |||
| b927ce18b2 | |||
| 969cc3dd95 | |||
| 198b5096aa | |||
| e0a9468488 | |||
| 7e637c134f | |||
| 619180dffd | |||
| 6d113bd03f | |||
| a76c72acdd | |||
| e9655cf646 | |||
| 34530da66e | |||
| 6271192a32 | |||
| 3a2f40ac6f | |||
| 094a5b0cba | |||
| a55cc07548 | |||
| c9296e599f | |||
| b33ff22988 | |||
| 880d2afb67 | |||
| 9e332dc5fb | |||
| a694e5074f | |||
| 90a4d67e8d | |||
| 23bc89d6fc | |||
| 73ddc091a2 | |||
| bce9837604 | |||
| f3a50224f2 | |||
| d4a17da7b2 | |||
| 4f288a1e28 | |||
| fd09413566 | |||
| ad16c243ca | |||
| da6ad1c640 | |||
| 9ed1332355 | |||
| 90ec651bd7 | |||
| 0aa5391c4b | |||
| 57cf120118 | |||
| 0b85d0ec68 | |||
| e18d5e94c7 | |||
| bc036e1e86 | |||
| 219ef95dd8 | |||
| 8ed89bae84 | |||
| 124bf8339f | |||
| 29d214474f | |||
| 4d0f13544d | |||
| a5ca5f6daf | |||
| b1b78aedd2 | |||
| 9214103564 | |||
| 599a595c6f | |||
| 8559237d4e | |||
| 8808aaccff | |||
| 831153d5fb | |||
| 333a767be4 | |||
| 5012fc5d23 | |||
| f00607c8ac | |||
| 8c24af66bd | |||
| 7ffab23a53 | |||
| 4a39b12a78 | |||
| 1bc607e8d8 | |||
| 98db891851 | |||
| 1f48940a93 | |||
| edcc762f7a | |||
| db5f1c3554 | |||
| 9c4b1d0a51 | |||
| 98b5fb4b9f | |||
| d2cc30e2a5 | |||
| e93c51762b | |||
| b16c1096d1 | |||
| 4d8d152461 | |||
| cc0066d38d | |||
| 5bbe116f89 | |||
| b17e9c614b | |||
| 45d073f889 | |||
| 85c97f772c | |||
| af9ded89d0 | |||
| c13a62ce10 | |||
| d8dea7896b | |||
| 09df7810d1 | |||
| 95aa6d7307 | |||
| 2617c9aa64 | |||
| f48c84eaee | |||
| 84bb67e49b | |||
| 9e4b1d5a75 | |||
| f2d3edec80 | |||
| 53c0189ed7 | |||
| bf96d8239d | |||
| 64588dff46 | |||
| f9bd025722 | |||
| a5d0c7b02c | |||
| 53a853c3c9 | |||
| 43a907ddda | |||
| c2f5f5a202 | |||
| 5e082ab852 | |||
| fce6e7248e | |||
| d54d01ca46 | |||
| 2b96a485e7 | |||
| 8eafddf211 | |||
| 1540ae340f | |||
| 8b5efc6f4c | |||
| c23ab37355 | |||
| 95f0c9b19b | |||
| 01048e5603 | |||
| 102ef39a27 | |||
| 966c2191cb | |||
| 8f3867756c | |||
| b29512032a | |||
| a0f5eb282c | |||
| 07b475062f | |||
| a41cbbdc99 | |||
| 8b2c499be6 | |||
| c87b99e82b | |||
| 96b26dc8f4 | |||
| 4fdf4d380c | |||
| 150c29356a | |||
| 8177adbd54 | |||
| 30331eef4b | |||
| 1f695c4532 | |||
| e007d93d93 | |||
| 77dd40c96c | |||
| f3eef792eb | |||
| 4d14307f5d | |||
| 450b96510e | |||
| 4b0d3316f6 | |||
| 7ac7aca33b | |||
| 6713063a8d | |||
| 331a96c670 | |||
| 1602a38fa9 | |||
| dae1fc8889 | |||
| a6ef9b4584 | |||
| e970eccbf1 | |||
| 5ad9e5f9bc | |||
| 3a546aa380 | |||
| d67a6c1be4 | |||
| d84360e7f3 | |||
| f81fdd58da | |||
| a6f3a21256 | |||
| f3237fdc6e | |||
| cc259e49f6 | |||
| a8c257cecb | |||
| 9a4cafa319 | |||
| c41f50f5f7 | |||
| e48ae883e9 | |||
| 0a91261c7f | |||
| d81a0da3e0 | |||
| ef93aea0da | |||
| 2a6637afdf | |||
| 3efa78311a | |||
| d4422e473a | |||
| aaf9297592 | |||
| 1159453139 | |||
| fb13b87285 | |||
| aa2777ed61 | |||
| 8a588f2c0b | |||
| 1dd24eeec0 | |||
| 5eec3be850 | |||
| 236e3868df | |||
| c3264aa83c | |||
| 9d0f16e8fe | |||
| 867c922bcc | |||
| 41f444a230 | |||
| a631196155 | |||
| e13a73d084 | |||
| 98d96f2cc8 | |||
| bd6ab6d38e | |||
| 80aaed73e6 | |||
| db9f4436e0 | |||
| cd53144ed3 | |||
| f791cf825f | |||
| eb14f9a464 | |||
| 0a691f7840 | |||
| 8ecfb59930 | |||
| 69944cd46b | |||
| 6c8f50d1f3 | |||
| 8d078f63a9 | |||
| bcc9946650 | |||
| d4a28f3bf6 | |||
| 55cdeaa6dd | |||
| 7d998336d3 | |||
| 6ad390a1cd | |||
| 3c2e5583d2 | |||
| d64529f6de | |||
| 3cc07a4411 | |||
| ac0a14631d | |||
| 745153098a | |||
| 981e63d8c2 | |||
| d0d676929d | |||
| 4dffcbd9f0 | |||
| 6d75be03f9 | |||
| fb781834f5 | |||
| 6eba1a4d44 | |||
| fa4871b013 | |||
| 8dd0fd8a13 | |||
| 5baa2c0706 | |||
| 225566da7b | |||
| 0cb3bf95f1 | |||
| d917f889b1 | |||
| e50acb923e | |||
| 4e4dfffe06 | |||
| 85a59ef292 | |||
| f67c8e37d6 | |||
| 17fe63446f | |||
| 0673866ceb | |||
| 0dd1ce1a4f | |||
| c56e91dcc0 | |||
| 5c6d319ebc | |||
| 20fb9281f4 | |||
| edaf4e0104 | |||
| 005f38fb45 | |||
| a173ea36f7 | |||
| e569e9dcbd | |||
| 01c1b341a8 | |||
| 4d291c06f6 | |||
| a9a33d9a5f | |||
| 57c9991413 | |||
| 8519db8efb | |||
| 174022547f | |||
| 579dcf12bd | |||
| f05d5888c9 | |||
| bf2f7b0f8b | |||
| 84c29dce77 | |||
| 126b0d855f | |||
| ac9f8c1f41 | |||
| 86e5e8d765 | |||
| 27edba495a | |||
| 0d456f9111 | |||
| 591f427003 | |||
| 2ced568d34 | |||
| ecbba852cf | |||
| 48c8c95381 | |||
| cd2d6ac935 | |||
| a4bd7506a5 | |||
| 70cbc3d883 | |||
| ec033330df | |||
| e037800e46 | |||
| 7e6bdbad9b | |||
| 5542dcb2bc | |||
| bd531bd828 | |||
| 8facf61bed | |||
| 560f85f8e5 | |||
| f856c964e2 | |||
| 223790e6fc | |||
| 5429b1f5ff | |||
| 24166ac402 | |||
| 02f8a9470a | |||
| 4a19ac5aca | |||
| 4af55e64e9 | |||
| 5790810c3a | |||
| acc089ca64 | |||
| 282a15c9f9 | |||
| 5d01821d9f | |||
| f8f74fc4ae | |||
| 0853085ec6 | |||
| e83438c23d | |||
| 3d5ca3ef75 | |||
| 043b9fbb31 | |||
| 76c21b73aa | |||
| 4d2da2debe | |||
| 84895d2566 | |||
| 4b2363de5c | |||
| ffaf15d0d9 | |||
| 4b35112022 | |||
| bd66f76fea | |||
| 5265db82c7 | |||
| d9474648f0 | |||
| d0e02cccba | |||
| 0687cffe21 | |||
| 504cd8a9f5 | |||
| a3ae69893c | |||
| 55b03dcaba | |||
| 1358c0ae66 | |||
| a6359e49d2 | |||
| f4147c99c8 | |||
| 6670e6b0bb | |||
| 814a5cec41 | |||
| e5ed22bd5b | |||
| 3d14dd4e39 | |||
| 3019927a61 | |||
| 881cee4d8f | |||
| 7e5b5390ba | |||
| b21a861c5b | |||
| 35c24480ae | |||
| 16d8e9e0c8 | |||
| 3fe9dfaa2e | |||
| 832ca0734d | |||
| 15e1acaf67 | |||
| 8b3042da63 | |||
| 8af87d5792 | |||
| 65ccafd494 | |||
| 6c93e42d94 | |||
| 6bc953e911 | |||
| fada959b4b | |||
| c6936f5a77 | |||
| d825caf18e | |||
| 998e355b97 | |||
| 7dad0f23d6 | |||
| 97455f1593 | |||
| 08ba63da02 | |||
| d42e04d0df | |||
| 80ade96c8c | |||
| 00830d9dd8 | |||
| 4e577b8d3c | |||
| 61b6d40539 | |||
| bb91e6999b | |||
| f29bc22005 | |||
| ac30620344 | |||
| 8128f6284a | |||
| 2c0ebf36a9 | |||
| b3a07166ba | |||
| 301626ba26 | |||
| 886220b9be | |||
| 55d54b56bf | |||
| 282fcb90dc | |||
| 09b3383a7e | |||
| b4316af834 | |||
| a696348ec5 | |||
| 3b54ebec3f | |||
| 16b13c6e3b | |||
| f429cee5d1 | |||
| 90e4907b0b | |||
| fb3a334bbe | |||
| 2bd9488475 | |||
| d85e67d3ec | |||
| c30af724ef | |||
| 3e2d8ca0a1 | |||
| 1f8802b94d | |||
| 8b9e8a805d | |||
| 2b9cfe1e1c | |||
| 358139b6b9 | |||
| c6a622542d | |||
| 4ecbcf0885 | |||
| 2638c5e9b7 | |||
| ed377ac1e8 | |||
| ced3df73da | |||
| 4057e81b76 | |||
| 24ca53183d | |||
| fd369a5004 | |||
| f6137292f1 | |||
| a90dacdf75 | |||
| d92a883de1 | |||
| f6a8f7859c | |||
| 4e2ef8c8f5 | |||
| 7cd3615f9f | |||
| 7c741f54fa | |||
| 0d896af8ec | |||
| afc8dd5661 | |||
| 52f930cca7 | |||
| 4cb9faf6c9 | |||
| a67228cd73 | |||
| f4daf14bfa | |||
| abe2ca886d | |||
| 4b93820880 | |||
| be86338a79 | |||
| c1c84d2fd1 | |||
| 3f27f8cf41 | |||
| 31289d2f32 | |||
| f163778da7 | |||
| 8f1e36f7c1 | |||
| 4cc458eb10 | |||
| 55f2370f36 | |||
| a718f2e6ea | |||
| fb61f88b9c | |||
| 38e6d668b1 | |||
| 2c21ea2dd7 | |||
| a9f3acb125 | |||
| 993b9af756 | |||
| e180cc050b | |||
| ea31a14cc5 | |||
| c75d93337e | |||
| 1e32781b54 | |||
| 9ed372b297 | |||
| 4625337179 | |||
| e9e3af0aaa | |||
| a33d50084d | |||
| 7eba3a7c96 | |||
| 1a74de1f9c | |||
| 2d778434f1 | |||
| e57ceea3d3 | |||
| 8b43861217 | |||
| 7d484d21f7 | |||
| 74bc8d351c | |||
| 1f2b2c5242 | |||
| 178c4810e6 | |||
| e4a64760db | |||
| c1cdb2416a | |||
| 40ac72a8f1 | |||
| 43a91f82fe | |||
| ccfca869e5 | |||
| f6ec467f19 | |||
| 039f5ca42e | |||
| 1996ae4a42 | |||
| bb93066558 | |||
| f954f0830c | |||
| dec25e8531 | |||
| 7b28d5b409 | |||
| 1df148aae9 | |||
| 48eecafc89 | |||
| 76cfa65d55 | |||
| ef290366b0 | |||
| b4759d7272 | |||
| 8aebef2459 | |||
| 7b12cbd7dc | |||
| 01f97f150c | |||
| 17a35587e1 | |||
| d76f24567b | |||
| 752653c70b | |||
| 03a602b6ef | |||
| 523f081923 | |||
| 9572895da0 | |||
| 515ec6b98a | |||
| 9ec3d76b21 | |||
| c4c94f891e | |||
| d16cf68a3b | |||
| 4ebd91e637 | |||
| f9c514b391 | |||
| ccb7253818 | |||
| badd0d1ff4 | |||
| 8b55f476be | |||
| 659ffaddb4 | |||
| 07729e396d | |||
| d064079a4e | |||
| cf477f7e9f | |||
| 543e0302d3 | |||
| ffa72fc979 | |||
| 2da7360b63 | |||
| 16bc505d26 | |||
| 6e33769e56 | |||
| 89d3f95a8e | |||
| 5e2bcc9149 | |||
| eff514f8bb | |||
| 2947877871 | |||
| fadb90c579 | |||
| 194304bbe4 | |||
| a13862e924 | |||
| 576ab3df9a | |||
| fd46684bf8 | |||
| 9badb0d903 | |||
| c5f06814bc | |||
| 69d43e2997 | |||
| 0f0dea79fc | |||
| b6d636214e | |||
| 4b64955a12 | |||
| 546239a3a8 | |||
| 8be0a3452d | |||
| 99d914ea3b | |||
| 24284d3d17 | |||
| 9fc872b70b | |||
| e3654d5416 | |||
| d92bee821d | |||
| df10411e05 | |||
| 44e9fb306d |
+41
-17
@@ -1,23 +1,8 @@
|
|||||||
<!--
|
|
||||||
If you have a question rather than reporting a bug please go to http://answers.opencv.org where you get much faster responses.
|
|
||||||
If you need further assistance please read [How To Contribute](https://github.com/opencv/opencv/wiki/How_to_contribute).
|
|
||||||
|
|
||||||
Please:
|
|
||||||
|
|
||||||
* Read the documentation to test with the latest developer build.
|
|
||||||
* Check if other person has already created the same issue to avoid duplicates. You can comment on it if there already is an issue.
|
|
||||||
* Try to be as detailed as possible in your report.
|
|
||||||
* Report only one problem per created issue.
|
|
||||||
|
|
||||||
|
|
||||||
This is a template helping you to create an issue which can be processed as quickly as possible. This is the bug reporting section for the OpenCV library.
|
|
||||||
-->
|
|
||||||
|
|
||||||
##### System information (version)
|
##### System information (version)
|
||||||
<!-- Example
|
<!-- Example
|
||||||
- OpenCV => 3.1
|
- OpenCV => 4.2
|
||||||
- Operating System / Platform => Windows 64 Bit
|
- Operating System / Platform => Windows 64 Bit
|
||||||
- Compiler => Visual Studio 2015
|
- Compiler => Visual Studio 2017
|
||||||
-->
|
-->
|
||||||
|
|
||||||
- OpenCV => :grey_question:
|
- OpenCV => :grey_question:
|
||||||
@@ -36,3 +21,42 @@ This is a template helping you to create an issue which can be processed as quic
|
|||||||
```
|
```
|
||||||
or attach as .txt or .zip file
|
or attach as .txt or .zip file
|
||||||
-->
|
-->
|
||||||
|
|
||||||
|
##### Issue submission checklist
|
||||||
|
|
||||||
|
- [ ] I report the issue, it's not a question
|
||||||
|
<!--
|
||||||
|
OpenCV team works with answers.opencv.org, Stack Overflow and other communities
|
||||||
|
to discuss problems. Tickets with question without real issue statement will be
|
||||||
|
closed.
|
||||||
|
-->
|
||||||
|
- [ ] I checked the problem with documentation, FAQ, open issues,
|
||||||
|
answers.opencv.org, Stack Overflow, etc and have not found solution
|
||||||
|
<!--
|
||||||
|
Places to check:
|
||||||
|
* OpenCV documentation: https://docs.opencv.org
|
||||||
|
* FAQ page: https://github.com/opencv/opencv/wiki/FAQ
|
||||||
|
* OpenCV forum: https://answers.opencv.org
|
||||||
|
* OpenCV issue tracker: https://github.com/opencv/opencv/issues?q=is%3Aissue
|
||||||
|
* Stack Overflow branch: https://stackoverflow.com/questions/tagged/opencv
|
||||||
|
-->
|
||||||
|
- [ ] I updated to latest OpenCV version and the issue is still there
|
||||||
|
<!--
|
||||||
|
master branch for OpenCV 4.x and 3.4 branch for OpenCV 3.x releases.
|
||||||
|
OpenCV team supports only latest release for each branch.
|
||||||
|
The ticket is closed, if the problem is not reproduced with modern version.
|
||||||
|
-->
|
||||||
|
- [ ] There is reproducer code and related data files: videos, images, onnx, etc
|
||||||
|
<!--
|
||||||
|
The best reproducer -- test case for OpenCV that we can add to the library.
|
||||||
|
Recommendations for media files and binary files:
|
||||||
|
* Try to reproduce the issue with images and videos in opencv_extra repository
|
||||||
|
to reduce attachment size
|
||||||
|
* Use PNG for images, if you report some CV related bug, but not image reader
|
||||||
|
issue
|
||||||
|
* Attach the image as archive to the ticket, if you report some reader issue.
|
||||||
|
Image hosting services compress images and it breaks the repro code.
|
||||||
|
* Provide ONNX file for some public model or ONNX file with with random weights,
|
||||||
|
if you report ONNX parsing or handling issue. Architecture details diagram
|
||||||
|
from netron tool can be very useful too. See https://lutzroeder.github.io/netron/
|
||||||
|
-->
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
<!-- Please use this line to close one or multiple issues when this pullrequest gets merged
|
### Pull Request Readiness Checklist
|
||||||
You can add another line right under the first one:
|
|
||||||
resolves #1234
|
|
||||||
resolves #1235
|
|
||||||
-->
|
|
||||||
|
|
||||||
### This pullrequest changes
|
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
|
||||||
|
|
||||||
<!-- Please describe what your pullrequest is changing -->
|
- [ ] I agree to contribute to the project under Apache 2 License.
|
||||||
|
- [ ] To the best of my knowledge, the proposed patch is not based on a code under GPL or other license that is incompatible with OpenCV
|
||||||
|
- [ ] The PR is proposed to proper branch
|
||||||
|
- [ ] There is reference to original bug report and related work
|
||||||
|
- [ ] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
|
||||||
|
Patch to opencv_extra has the same branch name.
|
||||||
|
- [ ] The feature is well documented and sample code can be built with the project CMake
|
||||||
|
|||||||
@@ -0,0 +1,47 @@
|
|||||||
|
name: arm64 build checks
|
||||||
|
|
||||||
|
on: [pull_request]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
|
||||||
|
runs-on: ubuntu-18.04
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Install dependency packages
|
||||||
|
run: |
|
||||||
|
sudo sed -i -E 's|^deb ([^ ]+) (.*)$|deb [arch=amd64] \1 \2\ndeb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ \2|' /etc/apt/sources.list
|
||||||
|
sudo dpkg --add-architecture arm64
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y --no-install-recommends \
|
||||||
|
crossbuild-essential-arm64 \
|
||||||
|
git \
|
||||||
|
cmake \
|
||||||
|
libpython-dev:arm64 \
|
||||||
|
libpython3-dev:arm64 \
|
||||||
|
python-numpy \
|
||||||
|
python3-numpy
|
||||||
|
|
||||||
|
- name: Fetch opencv_contrib
|
||||||
|
run: |
|
||||||
|
git clone --depth 1 https://github.com/opencv/opencv_contrib.git ../opencv_contrib
|
||||||
|
|
||||||
|
- name: Configure
|
||||||
|
run: |
|
||||||
|
mkdir build
|
||||||
|
cd build
|
||||||
|
cmake -DPYTHON2_INCLUDE_PATH=/usr/include/python2.7/ \
|
||||||
|
-DPYTHON2_LIBRARIES=/usr/lib/aarch64-linux-gnu/libpython2.7.so \
|
||||||
|
-DPYTHON2_NUMPY_INCLUDE_DIRS=/usr/lib/python2.7/dist-packages/numpy/core/include \
|
||||||
|
-DPYTHON3_INCLUDE_PATH=/usr/include/python3.6m/ \
|
||||||
|
-DPYTHON3_LIBRARIES=/usr/lib/aarch64-linux-gnu/libpython3.6m.so \
|
||||||
|
-DPYTHON3_NUMPY_INCLUDE_DIRS=/usr/lib/python3/dist-packages/numpy/core/include \
|
||||||
|
-DCMAKE_TOOLCHAIN_FILE=../platforms/linux/aarch64-gnu.toolchain.cmake \
|
||||||
|
-DOPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules \
|
||||||
|
../
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: |
|
||||||
|
cd build
|
||||||
|
make -j$(nproc --all)
|
||||||
@@ -23,3 +23,5 @@ bin/
|
|||||||
*.tlog
|
*.tlog
|
||||||
build
|
build
|
||||||
node_modules
|
node_modules
|
||||||
|
CMakeSettings.json
|
||||||
|
xcuserdata/
|
||||||
|
|||||||
Vendored
+6
-2
@@ -20,8 +20,11 @@ if(CMAKE_COMPILER_IS_GNUCC)
|
|||||||
# - matchTemplate about 5-10%
|
# - matchTemplate about 5-10%
|
||||||
# - goodFeaturesToTrack 10-20%
|
# - goodFeaturesToTrack 10-20%
|
||||||
# - cornerHarris 30% for some cases
|
# - cornerHarris 30% for some cases
|
||||||
|
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "10.0.0")
|
||||||
set_source_files_properties(${carotene_sources} COMPILE_FLAGS "--param ipcp-unit-growth=100000 --param inline-unit-growth=100000 --param large-stack-frame-growth=5000")
|
set_source_files_properties(${carotene_sources} COMPILE_FLAGS "--param ipcp-unit-growth=100000 --param inline-unit-growth=100000 --param large-stack-frame-growth=5000")
|
||||||
|
else()
|
||||||
|
set_source_files_properties(${carotene_sources} COMPILE_FLAGS "--param ipa-cp-unit-growth=100000 --param inline-unit-growth=100000 --param large-stack-frame-growth=5000")
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_library(carotene_objs OBJECT
|
add_library(carotene_objs OBJECT
|
||||||
@@ -37,4 +40,5 @@ if(WITH_NEON)
|
|||||||
target_compile_definitions(carotene_objs PRIVATE "-DWITH_NEON")
|
target_compile_definitions(carotene_objs PRIVATE "-DWITH_NEON")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_library(carotene STATIC EXCLUDE_FROM_ALL "$<TARGET_OBJECTS:carotene_objs>")
|
# we add dummy file to fix XCode build
|
||||||
|
add_library(carotene STATIC EXCLUDE_FROM_ALL "$<TARGET_OBJECTS:carotene_objs>" "${CAROTENE_SOURCE_DIR}/dummy.cpp")
|
||||||
|
|||||||
Vendored
+6
-17
@@ -60,22 +60,6 @@ function(compile_carotene)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_subdirectory("${CAROTENE_DIR}" "${CMAKE_CURRENT_BINARY_DIR}/carotene")
|
add_subdirectory("${CAROTENE_DIR}" "${CMAKE_CURRENT_BINARY_DIR}/carotene")
|
||||||
|
|
||||||
if(ARM OR AARCH64)
|
|
||||||
if(CMAKE_BUILD_TYPE)
|
|
||||||
set(CMAKE_TRY_COMPILE_CONFIGURATION ${CMAKE_BUILD_TYPE})
|
|
||||||
endif()
|
|
||||||
check_cxx_compiler_flag("-mfpu=neon" CXX_HAS_MFPU_NEON)
|
|
||||||
check_c_compiler_flag("-mfpu=neon" C_HAS_MFPU_NEON)
|
|
||||||
if(${CXX_HAS_MFPU_NEON} AND ${C_HAS_MFPU_NEON} AND NOT "${CMAKE_CXX_FLAGS} " MATCHES "-mfpu=neon[^ ]*")
|
|
||||||
get_target_property(old_flags "carotene_objs" COMPILE_FLAGS)
|
|
||||||
if(old_flags)
|
|
||||||
set_target_properties("carotene_objs" PROPERTIES COMPILE_FLAGS "${old_flags} -mfpu=neon")
|
|
||||||
else()
|
|
||||||
set_target_properties("carotene_objs" PROPERTIES COMPILE_FLAGS "-mfpu=neon")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
compile_carotene()
|
compile_carotene()
|
||||||
@@ -90,11 +74,16 @@ set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS ${carotene_defs})
|
|||||||
# matchTemplate about 5-10%
|
# matchTemplate about 5-10%
|
||||||
# goodFeaturesToTrack 10-20%
|
# goodFeaturesToTrack 10-20%
|
||||||
# cornerHarris 30% for some cases
|
# cornerHarris 30% for some cases
|
||||||
|
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "10.0.0")
|
||||||
set_source_files_properties(impl.cpp $<TARGET_OBJECTS:carotene_objs> COMPILE_FLAGS "--param ipcp-unit-growth=100000 --param inline-unit-growth=100000 --param large-stack-frame-growth=5000")
|
set_source_files_properties(impl.cpp $<TARGET_OBJECTS:carotene_objs> COMPILE_FLAGS "--param ipcp-unit-growth=100000 --param inline-unit-growth=100000 --param large-stack-frame-growth=5000")
|
||||||
|
else()
|
||||||
|
set_source_files_properties(impl.cpp $<TARGET_OBJECTS:carotene_objs> COMPILE_FLAGS "--param ipa-cp-unit-growth=100000 --param inline-unit-growth=100000 --param large-stack-frame-growth=5000")
|
||||||
|
endif()
|
||||||
# set_source_files_properties(impl.cpp $<TARGET_OBJECTS:carotene_objs> COMPILE_FLAGS "--param ipcp-unit-growth=100000 --param inline-unit-growth=100000 --param large-stack-frame-growth=5000")
|
# set_source_files_properties(impl.cpp $<TARGET_OBJECTS:carotene_objs> COMPILE_FLAGS "--param ipcp-unit-growth=100000 --param inline-unit-growth=100000 --param large-stack-frame-growth=5000")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_library(tegra_hal STATIC $<TARGET_OBJECTS:carotene_objs>)
|
# we add dummy file to fix XCode build
|
||||||
|
add_library(tegra_hal STATIC $<TARGET_OBJECTS:carotene_objs> "dummy.cpp")
|
||||||
set_target_properties(tegra_hal PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${3P_LIBRARY_OUTPUT_PATH})
|
set_target_properties(tegra_hal PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${3P_LIBRARY_OUTPUT_PATH})
|
||||||
set(OPENCV_SRC_DIR "${CMAKE_SOURCE_DIR}")
|
set(OPENCV_SRC_DIR "${CMAKE_SOURCE_DIR}")
|
||||||
if(NOT BUILD_SHARED_LIBS)
|
if(NOT BUILD_SHARED_LIBS)
|
||||||
|
|||||||
Vendored
+2
@@ -0,0 +1,2 @@
|
|||||||
|
// This file is needed for compilation on some platforms e.g. with XCode generator
|
||||||
|
// Related issue: https://gitlab.kitware.com/cmake/cmake/-/issues/17457
|
||||||
Vendored
+2
@@ -0,0 +1,2 @@
|
|||||||
|
// This file is needed for compilation on some platforms e.g. with XCode generator
|
||||||
|
// Related issue: https://gitlab.kitware.com/cmake/cmake/-/issues/17457
|
||||||
Vendored
+6
-6
@@ -1,9 +1,9 @@
|
|||||||
# Binaries branch name: ffmpeg/master_20191119
|
# Binaries branch name: ffmpeg/master_20200908
|
||||||
# Binaries were created for OpenCV: 318cba4ce37319ba0b0870aab384d5dc066bb124
|
# Binaries were created for OpenCV: f445b826d084188077a5e9d204c4c33d1589f380
|
||||||
ocv_update(FFMPEG_BINARIES_COMMIT "a66a24e9f410ae05da4baeeb8b451912664ce49c")
|
ocv_update(FFMPEG_BINARIES_COMMIT "6152e132572dfdaa32887eabeb7199bef49b14dc")
|
||||||
ocv_update(FFMPEG_FILE_HASH_BIN32 "5de6044cad9398549e57bc46fc13908d")
|
ocv_update(FFMPEG_FILE_HASH_BIN32 "37e2dadf776631acc8856e281f29cf42")
|
||||||
ocv_update(FFMPEG_FILE_HASH_BIN64 "55c0bc8ad27db00116fabf06508de196")
|
ocv_update(FFMPEG_FILE_HASH_BIN64 "cf5dba83edf8619f57ccff4edb989c62")
|
||||||
ocv_update(FFMPEG_FILE_HASH_CMAKE "ad57c038ba34b868277ccbe6dd0f9602")
|
ocv_update(FFMPEG_FILE_HASH_CMAKE "f8e65dbe4a3b4eedc0d2997e07c3f3fd")
|
||||||
|
|
||||||
function(download_win_ffmpeg script_var)
|
function(download_win_ffmpeg script_var)
|
||||||
set(${script_var} "" PARENT_SCOPE)
|
set(${script_var} "" PARENT_SCOPE)
|
||||||
|
|||||||
@@ -0,0 +1,160 @@
|
|||||||
|
/*******************************************************************************
|
||||||
|
* Copyright (c) 2008-2020 The Khronos Group Inc.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
******************************************************************************/
|
||||||
|
/*****************************************************************************\
|
||||||
|
|
||||||
|
Copyright (c) 2013-2019 Intel Corporation All Rights Reserved.
|
||||||
|
|
||||||
|
THESE MATERIALS ARE PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||||
|
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR ITS
|
||||||
|
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||||
|
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||||
|
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||||
|
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||||
|
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY OR TORT (INCLUDING
|
||||||
|
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THESE
|
||||||
|
MATERIALS, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
|
File Name: cl_va_api_media_sharing_intel.h
|
||||||
|
|
||||||
|
Abstract:
|
||||||
|
|
||||||
|
Notes:
|
||||||
|
|
||||||
|
\*****************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef __OPENCL_CL_VA_API_MEDIA_SHARING_INTEL_H
|
||||||
|
#define __OPENCL_CL_VA_API_MEDIA_SHARING_INTEL_H
|
||||||
|
|
||||||
|
#include <CL/cl.h>
|
||||||
|
#include <CL/cl_platform.h>
|
||||||
|
#include <va/va.h>
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/******************************************
|
||||||
|
* cl_intel_va_api_media_sharing extension *
|
||||||
|
*******************************************/
|
||||||
|
|
||||||
|
#define cl_intel_va_api_media_sharing 1
|
||||||
|
|
||||||
|
/* error codes */
|
||||||
|
#define CL_INVALID_VA_API_MEDIA_ADAPTER_INTEL -1098
|
||||||
|
#define CL_INVALID_VA_API_MEDIA_SURFACE_INTEL -1099
|
||||||
|
#define CL_VA_API_MEDIA_SURFACE_ALREADY_ACQUIRED_INTEL -1100
|
||||||
|
#define CL_VA_API_MEDIA_SURFACE_NOT_ACQUIRED_INTEL -1101
|
||||||
|
|
||||||
|
/* cl_va_api_device_source_intel */
|
||||||
|
#define CL_VA_API_DISPLAY_INTEL 0x4094
|
||||||
|
|
||||||
|
/* cl_va_api_device_set_intel */
|
||||||
|
#define CL_PREFERRED_DEVICES_FOR_VA_API_INTEL 0x4095
|
||||||
|
#define CL_ALL_DEVICES_FOR_VA_API_INTEL 0x4096
|
||||||
|
|
||||||
|
/* cl_context_info */
|
||||||
|
#define CL_CONTEXT_VA_API_DISPLAY_INTEL 0x4097
|
||||||
|
|
||||||
|
/* cl_mem_info */
|
||||||
|
#define CL_MEM_VA_API_MEDIA_SURFACE_INTEL 0x4098
|
||||||
|
|
||||||
|
/* cl_image_info */
|
||||||
|
#define CL_IMAGE_VA_API_PLANE_INTEL 0x4099
|
||||||
|
|
||||||
|
/* cl_command_type */
|
||||||
|
#define CL_COMMAND_ACQUIRE_VA_API_MEDIA_SURFACES_INTEL 0x409A
|
||||||
|
#define CL_COMMAND_RELEASE_VA_API_MEDIA_SURFACES_INTEL 0x409B
|
||||||
|
|
||||||
|
typedef cl_uint cl_va_api_device_source_intel;
|
||||||
|
typedef cl_uint cl_va_api_device_set_intel;
|
||||||
|
|
||||||
|
extern CL_API_ENTRY cl_int CL_API_CALL
|
||||||
|
clGetDeviceIDsFromVA_APIMediaAdapterINTEL(
|
||||||
|
cl_platform_id platform,
|
||||||
|
cl_va_api_device_source_intel media_adapter_type,
|
||||||
|
void* media_adapter,
|
||||||
|
cl_va_api_device_set_intel media_adapter_set,
|
||||||
|
cl_uint num_entries,
|
||||||
|
cl_device_id* devices,
|
||||||
|
cl_uint* num_devices) CL_EXT_SUFFIX__VERSION_1_2;
|
||||||
|
|
||||||
|
typedef CL_API_ENTRY cl_int (CL_API_CALL * clGetDeviceIDsFromVA_APIMediaAdapterINTEL_fn)(
|
||||||
|
cl_platform_id platform,
|
||||||
|
cl_va_api_device_source_intel media_adapter_type,
|
||||||
|
void* media_adapter,
|
||||||
|
cl_va_api_device_set_intel media_adapter_set,
|
||||||
|
cl_uint num_entries,
|
||||||
|
cl_device_id* devices,
|
||||||
|
cl_uint* num_devices) CL_EXT_SUFFIX__VERSION_1_2;
|
||||||
|
|
||||||
|
extern CL_API_ENTRY cl_mem CL_API_CALL
|
||||||
|
clCreateFromVA_APIMediaSurfaceINTEL(
|
||||||
|
cl_context context,
|
||||||
|
cl_mem_flags flags,
|
||||||
|
VASurfaceID* surface,
|
||||||
|
cl_uint plane,
|
||||||
|
cl_int* errcode_ret) CL_EXT_SUFFIX__VERSION_1_2;
|
||||||
|
|
||||||
|
typedef CL_API_ENTRY cl_mem (CL_API_CALL * clCreateFromVA_APIMediaSurfaceINTEL_fn)(
|
||||||
|
cl_context context,
|
||||||
|
cl_mem_flags flags,
|
||||||
|
VASurfaceID* surface,
|
||||||
|
cl_uint plane,
|
||||||
|
cl_int* errcode_ret) CL_EXT_SUFFIX__VERSION_1_2;
|
||||||
|
|
||||||
|
extern CL_API_ENTRY cl_int CL_API_CALL
|
||||||
|
clEnqueueAcquireVA_APIMediaSurfacesINTEL(
|
||||||
|
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_EXT_SUFFIX__VERSION_1_2;
|
||||||
|
|
||||||
|
typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueAcquireVA_APIMediaSurfacesINTEL_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_EXT_SUFFIX__VERSION_1_2;
|
||||||
|
|
||||||
|
extern CL_API_ENTRY cl_int CL_API_CALL
|
||||||
|
clEnqueueReleaseVA_APIMediaSurfacesINTEL(
|
||||||
|
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_EXT_SUFFIX__VERSION_1_2;
|
||||||
|
|
||||||
|
typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueReleaseVA_APIMediaSurfacesINTEL_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_EXT_SUFFIX__VERSION_1_2;
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* __OPENCL_CL_VA_API_MEDIA_SHARING_INTEL_H */
|
||||||
|
|
||||||
Vendored
+11
-16
@@ -2,37 +2,32 @@ function(download_ippicv root_var)
|
|||||||
set(${root_var} "" PARENT_SCOPE)
|
set(${root_var} "" PARENT_SCOPE)
|
||||||
|
|
||||||
# Commit SHA in the opencv_3rdparty repo
|
# Commit SHA in the opencv_3rdparty repo
|
||||||
set(IPPICV_COMMIT "32e315a5b106a7b89dbed51c28f8120a48b368b4")
|
set(IPPICV_COMMIT "a56b6ac6f030c312b2dce17430eef13aed9af274")
|
||||||
# Define actual ICV versions
|
# Define actual ICV versions
|
||||||
if(APPLE)
|
if(APPLE)
|
||||||
set(OPENCV_ICV_PLATFORM "macosx")
|
set(OPENCV_ICV_PLATFORM "macosx")
|
||||||
set(OPENCV_ICV_PACKAGE_SUBDIR "ippicv_mac")
|
set(OPENCV_ICV_PACKAGE_SUBDIR "ippicv_mac")
|
||||||
if(X86_64)
|
set(OPENCV_ICV_NAME "ippicv_2020_mac_intel64_20191018_general.tgz")
|
||||||
set(OPENCV_ICV_NAME "ippicv_2019_mac_intel64_general_20180723.tgz")
|
set(OPENCV_ICV_HASH "1c3d675c2a2395d094d523024896e01b")
|
||||||
set(OPENCV_ICV_HASH "fe6b2bb75ae0e3f19ad3ae1a31dfa4a2")
|
|
||||||
else()
|
|
||||||
set(OPENCV_ICV_NAME "ippicv_2019_mac_ia32_general_20180723.tgz")
|
|
||||||
set(OPENCV_ICV_HASH "b5dfa78c87eb75c64470cbe5ec876f4f")
|
|
||||||
endif()
|
|
||||||
elseif((UNIX AND NOT ANDROID) OR (UNIX AND ANDROID_ABI MATCHES "x86"))
|
elseif((UNIX AND NOT ANDROID) OR (UNIX AND ANDROID_ABI MATCHES "x86"))
|
||||||
set(OPENCV_ICV_PLATFORM "linux")
|
set(OPENCV_ICV_PLATFORM "linux")
|
||||||
set(OPENCV_ICV_PACKAGE_SUBDIR "ippicv_lnx")
|
set(OPENCV_ICV_PACKAGE_SUBDIR "ippicv_lnx")
|
||||||
if(X86_64)
|
if(X86_64)
|
||||||
set(OPENCV_ICV_NAME "ippicv_2019_lnx_intel64_general_20180723.tgz")
|
set(OPENCV_ICV_NAME "ippicv_2020_lnx_intel64_20191018_general.tgz")
|
||||||
set(OPENCV_ICV_HASH "c0bd78adb4156bbf552c1dfe90599607")
|
set(OPENCV_ICV_HASH "7421de0095c7a39162ae13a6098782f9")
|
||||||
else()
|
else()
|
||||||
set(OPENCV_ICV_NAME "ippicv_2019_lnx_ia32_general_20180723.tgz")
|
set(OPENCV_ICV_NAME "ippicv_2020_lnx_ia32_20191018_general.tgz")
|
||||||
set(OPENCV_ICV_HASH "4f38432c30bfd6423164b7a24bbc98a0")
|
set(OPENCV_ICV_HASH "ad189a940fb60eb71f291321322fe3e8")
|
||||||
endif()
|
endif()
|
||||||
elseif(WIN32 AND NOT ARM)
|
elseif(WIN32 AND NOT ARM)
|
||||||
set(OPENCV_ICV_PLATFORM "windows")
|
set(OPENCV_ICV_PLATFORM "windows")
|
||||||
set(OPENCV_ICV_PACKAGE_SUBDIR "ippicv_win")
|
set(OPENCV_ICV_PACKAGE_SUBDIR "ippicv_win")
|
||||||
if(X86_64)
|
if(X86_64)
|
||||||
set(OPENCV_ICV_NAME "ippicv_2019_win_intel64_20180723_general.zip")
|
set(OPENCV_ICV_NAME "ippicv_2020_win_intel64_20191018_general.zip")
|
||||||
set(OPENCV_ICV_HASH "1d222685246896fe089f88b8858e4b2f")
|
set(OPENCV_ICV_HASH "879741a7946b814455eee6c6ffde2984")
|
||||||
else()
|
else()
|
||||||
set(OPENCV_ICV_NAME "ippicv_2019_win_ia32_20180723_general.zip")
|
set(OPENCV_ICV_NAME "ippicv_2020_win_ia32_20191018_general.zip")
|
||||||
set(OPENCV_ICV_HASH "0157251a2eb9cd63a3ebc7eed0f3e59e")
|
set(OPENCV_ICV_HASH "cd39bdf0c2e1cac9a61101dad7a2413e")
|
||||||
endif()
|
endif()
|
||||||
else()
|
else()
|
||||||
return()
|
return()
|
||||||
|
|||||||
+4
-2
@@ -4,9 +4,9 @@ ocv_warnings_disable(CMAKE_C_FLAGS -Wunused-parameter -Wsign-compare -Wshorten-6
|
|||||||
|
|
||||||
set(VERSION_MAJOR 2)
|
set(VERSION_MAJOR 2)
|
||||||
set(VERSION_MINOR 0)
|
set(VERSION_MINOR 0)
|
||||||
set(VERSION_REVISION 2)
|
set(VERSION_REVISION 5)
|
||||||
set(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REVISION})
|
set(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REVISION})
|
||||||
set(LIBJPEG_TURBO_VERSION_NUMBER 2000002)
|
set(LIBJPEG_TURBO_VERSION_NUMBER 2000005)
|
||||||
|
|
||||||
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")
|
||||||
@@ -65,6 +65,8 @@ set(JPEG_LIB_VERSION 62)
|
|||||||
# OpenCV
|
# OpenCV
|
||||||
set(JPEG_LIB_VERSION "${VERSION}-${JPEG_LIB_VERSION}" PARENT_SCOPE)
|
set(JPEG_LIB_VERSION "${VERSION}-${JPEG_LIB_VERSION}" PARENT_SCOPE)
|
||||||
|
|
||||||
|
set(THREAD_LOCAL "") # WITH_TURBOJPEG is not used
|
||||||
|
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
add_definitions(-W3 -wd4996 -wd4018)
|
add_definitions(-W3 -wd4996 -wd4018)
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
Vendored
+36
-26
@@ -1,14 +1,14 @@
|
|||||||
Background
|
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 to accelerate
|
||||||
AVX2, NEON, AltiVec) to accelerate baseline JPEG compression and decompression
|
baseline JPEG compression and decompression on x86, x86-64, ARM, PowerPC, and
|
||||||
on x86, x86-64, ARM, and PowerPC systems, as well as progressive JPEG
|
MIPS systems, as well as progressive JPEG compression on x86 and x86-64
|
||||||
compression on x86 and x86-64 systems. On such systems, libjpeg-turbo is
|
systems. On such systems, libjpeg-turbo is generally 2-6x as fast as libjpeg,
|
||||||
generally 2-6x as fast as libjpeg, all else being equal. On other types of
|
all else being equal. On other types of systems, libjpeg-turbo can still
|
||||||
systems, libjpeg-turbo can still outperform libjpeg by a significant amount, by
|
outperform libjpeg by a significant amount, by virtue of its highly-optimized
|
||||||
virtue of its highly-optimized Huffman coding routines. In many cases, the
|
Huffman coding routines. In many cases, the performance of libjpeg-turbo
|
||||||
performance of libjpeg-turbo rivals that of proprietary high-speed JPEG codecs.
|
rivals that of proprietary high-speed JPEG codecs.
|
||||||
|
|
||||||
libjpeg-turbo implements both the traditional libjpeg API as well as the less
|
libjpeg-turbo implements both the traditional libjpeg API as well as the less
|
||||||
powerful but more straightforward TurboJPEG API. libjpeg-turbo also features
|
powerful but more straightforward TurboJPEG API. libjpeg-turbo also features
|
||||||
@@ -135,25 +135,24 @@ without recompiling. libjpeg-turbo does not claim to support all of the
|
|||||||
libjpeg v7+ features, nor to produce identical output to libjpeg v7+ in all
|
libjpeg v7+ features, nor to produce identical output to libjpeg v7+ in all
|
||||||
cases (see below.)
|
cases (see below.)
|
||||||
|
|
||||||
By passing an argument of `--with-jpeg7` or `--with-jpeg8` to `configure`, or
|
By passing an argument of `-DWITH_JPEG7=1` or `-DWITH_JPEG8=1` to `cmake`, you
|
||||||
an argument of `-DWITH_JPEG7=1` or `-DWITH_JPEG8=1` to `cmake`, you can build a
|
can build a version of libjpeg-turbo that emulates the libjpeg v7 or v8 ABI, so
|
||||||
version of libjpeg-turbo that emulates the libjpeg v7 or v8 ABI, so that
|
that programs that are built against libjpeg v7 or v8 can be run with
|
||||||
programs that are built against libjpeg v7 or v8 can be run with libjpeg-turbo.
|
libjpeg-turbo. The following section describes which libjpeg v7+ features are
|
||||||
The following section describes which libjpeg v7+ features are supported and
|
supported and which aren't.
|
||||||
which aren't.
|
|
||||||
|
|
||||||
### Support for libjpeg v7 and v8 Features
|
### Support for libjpeg v7 and v8 Features
|
||||||
|
|
||||||
#### Fully supported
|
#### Fully supported
|
||||||
|
|
||||||
- **libjpeg: IDCT scaling extensions in decompressor**<br>
|
- **libjpeg API: IDCT scaling extensions in decompressor**<br>
|
||||||
libjpeg-turbo supports IDCT scaling with scaling factors of 1/8, 1/4, 3/8,
|
libjpeg-turbo supports IDCT scaling with scaling factors of 1/8, 1/4, 3/8,
|
||||||
1/2, 5/8, 3/4, 7/8, 9/8, 5/4, 11/8, 3/2, 13/8, 7/4, 15/8, and 2/1 (only 1/4
|
1/2, 5/8, 3/4, 7/8, 9/8, 5/4, 11/8, 3/2, 13/8, 7/4, 15/8, and 2/1 (only 1/4
|
||||||
and 1/2 are SIMD-accelerated.)
|
and 1/2 are SIMD-accelerated.)
|
||||||
|
|
||||||
- **libjpeg: Arithmetic coding**
|
- **libjpeg API: Arithmetic coding**
|
||||||
|
|
||||||
- **libjpeg: In-memory source and destination managers**<br>
|
- **libjpeg API: In-memory source and destination managers**<br>
|
||||||
See notes below.
|
See notes below.
|
||||||
|
|
||||||
- **cjpeg: Separate quality settings for luminance and chrominance**<br>
|
- **cjpeg: Separate quality settings for luminance and chrominance**<br>
|
||||||
@@ -185,14 +184,14 @@ means of quality improvement. The reader is invited to peruse the research at
|
|||||||
but it is the general belief of our project that these features have not
|
but it is the general belief of our project that these features have not
|
||||||
demonstrated sufficient usefulness to justify inclusion in libjpeg-turbo.
|
demonstrated sufficient usefulness to justify inclusion in libjpeg-turbo.
|
||||||
|
|
||||||
- **libjpeg: DCT scaling in compressor**<br>
|
- **libjpeg API: DCT scaling in compressor**<br>
|
||||||
`cinfo.scale_num` and `cinfo.scale_denom` are silently ignored.
|
`cinfo.scale_num` and `cinfo.scale_denom` are silently ignored.
|
||||||
There is no technical reason why DCT scaling could not be supported when
|
There is no technical reason why DCT scaling could not be supported when
|
||||||
emulating the libjpeg v7+ API/ABI, but without the SmartScale extension (see
|
emulating the libjpeg v7+ API/ABI, but without the SmartScale extension (see
|
||||||
below), only scaling factors of 1/2, 8/15, 4/7, 8/13, 2/3, 8/11, 4/5, and
|
below), only scaling factors of 1/2, 8/15, 4/7, 8/13, 2/3, 8/11, 4/5, and
|
||||||
8/9 would be available, which is of limited usefulness.
|
8/9 would be available, which is of limited usefulness.
|
||||||
|
|
||||||
- **libjpeg: SmartScale**<br>
|
- **libjpeg API: SmartScale**<br>
|
||||||
`cinfo.block_size` is silently ignored.
|
`cinfo.block_size` is silently ignored.
|
||||||
SmartScale is an extension to the JPEG format that allows for DCT block
|
SmartScale is an extension to the JPEG format that allows for DCT block
|
||||||
sizes other than 8x8. Providing support for this new format would be
|
sizes other than 8x8. Providing support for this new format would be
|
||||||
@@ -205,7 +204,7 @@ demonstrated sufficient usefulness to justify inclusion in libjpeg-turbo.
|
|||||||
interest in providing this feature would be as a means of supporting
|
interest in providing this feature would be as a means of supporting
|
||||||
additional DCT scaling factors.
|
additional DCT scaling factors.
|
||||||
|
|
||||||
- **libjpeg: Fancy downsampling in compressor**<br>
|
- **libjpeg API: Fancy downsampling in compressor**<br>
|
||||||
`cinfo.do_fancy_downsampling` is silently ignored.
|
`cinfo.do_fancy_downsampling` is silently ignored.
|
||||||
This requires the DCT scaling feature, which is not supported.
|
This requires the DCT scaling feature, which is not supported.
|
||||||
|
|
||||||
@@ -247,15 +246,14 @@ don't, and it allows those functions to be provided in the "official"
|
|||||||
libjpeg-turbo binaries.
|
libjpeg-turbo binaries.
|
||||||
|
|
||||||
Those who are concerned about maintaining strict conformance with the libjpeg
|
Those who are concerned about maintaining strict conformance with the libjpeg
|
||||||
v6b or v7 API can pass an argument of `--without-mem-srcdst` to `configure` or
|
v6b or v7 API can pass an argument of `-DWITH_MEM_SRCDST=0` to `cmake` prior to
|
||||||
an argument of `-DWITH_MEM_SRCDST=0` to `cmake` prior to building
|
building libjpeg-turbo. This will restore the pre-1.3 behavior, in which
|
||||||
libjpeg-turbo. This will restore the pre-1.3 behavior, in which
|
|
||||||
`jpeg_mem_src()` and `jpeg_mem_dest()` are only included when emulating the
|
`jpeg_mem_src()` and `jpeg_mem_dest()` are only included when emulating the
|
||||||
libjpeg v8 API/ABI.
|
libjpeg v8 API/ABI.
|
||||||
|
|
||||||
On Un*x systems, including the in-memory source/destination managers changes
|
On Un*x systems, including the in-memory source/destination managers changes
|
||||||
the dynamic library version from 62.1.0 to 62.2.0 if using libjpeg v6b API/ABI
|
the dynamic library version from 62.2.0 to 62.3.0 if using libjpeg v6b API/ABI
|
||||||
emulation and from 7.1.0 to 7.2.0 if using libjpeg v7 API/ABI emulation.
|
emulation and from 7.2.0 to 7.3.0 if using libjpeg v7 API/ABI emulation.
|
||||||
|
|
||||||
Note that, on most Un*x systems, the dynamic linker will not look for a
|
Note that, on most Un*x systems, the dynamic linker will not look for a
|
||||||
function in a library until that function is actually used. Thus, if a program
|
function in a library until that function is actually used. Thus, if a program
|
||||||
@@ -331,7 +329,7 @@ in a way that makes the rest of the libjpeg infrastructure happy, so it is
|
|||||||
necessary to use the slow Huffman decoder when decompressing a JPEG image that
|
necessary to use the slow Huffman decoder when decompressing a JPEG image that
|
||||||
has restart markers. This can cause the decompression performance to drop by
|
has restart markers. This can cause the decompression performance to drop by
|
||||||
as much as 20%, but the performance will still be much greater than that of
|
as much as 20%, but the performance will still be much greater than that of
|
||||||
libjpeg. Many consumer packages, such as PhotoShop, use restart markers when
|
libjpeg. Many consumer packages, such as Photoshop, use restart markers when
|
||||||
generating JPEG images, so images generated by those programs will experience
|
generating JPEG images, so images generated by those programs will experience
|
||||||
this issue.
|
this issue.
|
||||||
|
|
||||||
@@ -344,3 +342,15 @@ quality of 98-100. Thus, libjpeg-turbo must use the non-SIMD quantization
|
|||||||
function in those cases. This causes performance to drop by as much as 40%.
|
function in those cases. This causes performance to drop by as much as 40%.
|
||||||
It is therefore strongly advised that you use the slow integer forward DCT
|
It is therefore strongly advised that you use the slow integer forward DCT
|
||||||
whenever encoding images with a JPEG quality of 98 or higher.
|
whenever encoding images with a JPEG quality of 98 or higher.
|
||||||
|
|
||||||
|
|
||||||
|
Memory Debugger Pitfalls
|
||||||
|
========================
|
||||||
|
|
||||||
|
Valgrind and Memory Sanitizer (MSan) can generate false positives
|
||||||
|
(specifically, incorrect reports of uninitialized memory accesses) when used
|
||||||
|
with libjpeg-turbo's SIMD extensions. It is generally recommended that the
|
||||||
|
SIMD extensions be disabled, either by passing an argument of `-DWITH_SIMD=0`
|
||||||
|
to `cmake` when configuring the build or by setting the environment variable
|
||||||
|
`JSIMD_FORCENONE` to `1` at run time, when testing libjpeg-turbo with Valgrind,
|
||||||
|
MSan, or other memory debuggers.
|
||||||
|
|||||||
+3
@@ -15,6 +15,9 @@
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* How to obtain thread-local storage */
|
||||||
|
#define THREAD_LOCAL @THREAD_LOCAL@
|
||||||
|
|
||||||
/* Define to the full name of this package. */
|
/* Define to the full name of this package. */
|
||||||
#define PACKAGE_NAME "@CMAKE_PROJECT_NAME@"
|
#define PACKAGE_NAME "@CMAKE_PROJECT_NAME@"
|
||||||
|
|
||||||
|
|||||||
Vendored
+8
-4
@@ -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, 2018, D. R. Commander.
|
* Copyright (C) 2009-2011, 2014-2016, 2018-2019, 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.
|
||||||
@@ -43,8 +43,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/* NOTE: Both GCC and Clang define __GNUC__ */
|
/* NOTE: Both GCC and Clang define __GNUC__ */
|
||||||
#if defined __GNUC__ && (defined __arm__ || defined __aarch64__)
|
#if defined(__GNUC__) && (defined(__arm__) || defined(__aarch64__))
|
||||||
#if !defined __thumb__ || defined __thumb2__
|
#if !defined(__thumb__) || defined(__thumb2__)
|
||||||
#define USE_CLZ_INTRINSIC
|
#define USE_CLZ_INTRINSIC
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
@@ -356,6 +356,8 @@ dump_buffer(working_state *state)
|
|||||||
put_buffer = (put_buffer << size) | code; \
|
put_buffer = (put_buffer << size) | code; \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if SIZEOF_SIZE_T != 8 && !defined(_WIN64)
|
||||||
|
|
||||||
#define CHECKBUF15() { \
|
#define CHECKBUF15() { \
|
||||||
if (put_bits > 15) { \
|
if (put_bits > 15) { \
|
||||||
EMIT_BYTE() \
|
EMIT_BYTE() \
|
||||||
@@ -363,6 +365,8 @@ dump_buffer(working_state *state)
|
|||||||
} \
|
} \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
#define CHECKBUF31() { \
|
#define CHECKBUF31() { \
|
||||||
if (put_bits > 31) { \
|
if (put_bits > 31) { \
|
||||||
EMIT_BYTE() \
|
EMIT_BYTE() \
|
||||||
@@ -428,7 +432,7 @@ dump_buffer(working_state *state)
|
|||||||
* scanning order-- 1, 8, 16, etc.), then this will produce an encoded block
|
* scanning order-- 1, 8, 16, etc.), then this will produce an encoded block
|
||||||
* larger than 200 bytes.
|
* larger than 200 bytes.
|
||||||
*/
|
*/
|
||||||
#define BUFSIZE (DCTSIZE2 * 4)
|
#define BUFSIZE (DCTSIZE2 * 8)
|
||||||
|
|
||||||
#define LOAD_BUFFER() { \
|
#define LOAD_BUFFER() { \
|
||||||
if (state->free_in_buffer < BUFSIZE) { \
|
if (state->free_in_buffer < BUFSIZE) { \
|
||||||
|
|||||||
+1
-1
@@ -492,8 +492,8 @@ prepare_for_pass(j_compress_ptr cinfo)
|
|||||||
*/
|
*/
|
||||||
master->pass_type = output_pass;
|
master->pass_type = output_pass;
|
||||||
master->pass_number++;
|
master->pass_number++;
|
||||||
/*FALLTHROUGH*/
|
|
||||||
#endif
|
#endif
|
||||||
|
/*FALLTHROUGH*/
|
||||||
case output_pass:
|
case output_pass:
|
||||||
/* Do a data-output pass. */
|
/* Do a data-output pass. */
|
||||||
/* We need not repeat per-scan setup if prior optimization pass did it. */
|
/* We need not repeat per-scan setup if prior optimization pass did it. */
|
||||||
|
|||||||
Vendored
+2
-2
@@ -52,8 +52,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/* NOTE: Both GCC and Clang define __GNUC__ */
|
/* NOTE: Both GCC and Clang define __GNUC__ */
|
||||||
#if defined __GNUC__ && (defined __arm__ || defined __aarch64__)
|
#if defined(__GNUC__) && (defined(__arm__) || defined(__aarch64__))
|
||||||
#if !defined __thumb__ || defined __thumb2__
|
#if !defined(__thumb__) || defined(__thumb2__)
|
||||||
#define USE_CLZ_INTRINSIC
|
#define USE_CLZ_INTRINSIC
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
-1
@@ -143,7 +143,6 @@ empty_mem_output_buffer(j_compress_ptr cinfo)
|
|||||||
|
|
||||||
MEMCOPY(nextbuffer, dest->buffer, dest->bufsize);
|
MEMCOPY(nextbuffer, dest->buffer, dest->bufsize);
|
||||||
|
|
||||||
if (dest->newbuffer != NULL)
|
|
||||||
free(dest->newbuffer);
|
free(dest->newbuffer);
|
||||||
|
|
||||||
dest->newbuffer = nextbuffer;
|
dest->newbuffer = nextbuffer;
|
||||||
|
|||||||
Vendored
+7
-3
@@ -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, 2018, D. R. Commander.
|
* Copyright (C) 2009-2011, 2016, 2018-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.
|
||||||
*
|
*
|
||||||
@@ -589,7 +589,11 @@ decode_mcu_slow(j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
|
|||||||
if (entropy->dc_needed[blkn]) {
|
if (entropy->dc_needed[blkn]) {
|
||||||
/* Convert DC difference to actual value, update last_dc_val */
|
/* Convert DC difference to actual value, update last_dc_val */
|
||||||
int ci = cinfo->MCU_membership[blkn];
|
int ci = cinfo->MCU_membership[blkn];
|
||||||
s += state.last_dc_val[ci];
|
/* This is really just
|
||||||
|
* s += state.last_dc_val[ci];
|
||||||
|
* It is written this way in order to shut up UBSan.
|
||||||
|
*/
|
||||||
|
s = (int)((unsigned int)s + (unsigned int)state.last_dc_val[ci]);
|
||||||
state.last_dc_val[ci] = s;
|
state.last_dc_val[ci] = s;
|
||||||
if (block) {
|
if (block) {
|
||||||
/* Output the DC coefficient (assumes jpeg_natural_order[0] = 0) */
|
/* Output the DC coefficient (assumes jpeg_natural_order[0] = 0) */
|
||||||
@@ -684,7 +688,7 @@ decode_mcu_fast(j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
|
|||||||
|
|
||||||
if (entropy->dc_needed[blkn]) {
|
if (entropy->dc_needed[blkn]) {
|
||||||
int ci = cinfo->MCU_membership[blkn];
|
int ci = cinfo->MCU_membership[blkn];
|
||||||
s += state.last_dc_val[ci];
|
s = (int)((unsigned int)s + (unsigned int)state.last_dc_val[ci]);
|
||||||
state.last_dc_val[ci] = s;
|
state.last_dc_val[ci] = s;
|
||||||
if (block)
|
if (block)
|
||||||
(*block)[0] = (JCOEF)s;
|
(*block)[0] = (JCOEF)s;
|
||||||
|
|||||||
Vendored
-2
@@ -429,8 +429,6 @@ h2v2_merged_upsample(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
|||||||
#define PACK_TWO_PIXELS_LE(l, r) ((r << 16) | l)
|
#define PACK_TWO_PIXELS_LE(l, r) ((r << 16) | l)
|
||||||
#define PACK_TWO_PIXELS_BE(l, r) ((l << 16) | r)
|
#define PACK_TWO_PIXELS_BE(l, r) ((l << 16) | r)
|
||||||
|
|
||||||
#define PACK_NEED_ALIGNMENT(ptr) (((size_t)(ptr)) & 3)
|
|
||||||
|
|
||||||
#define WRITE_TWO_PIXELS_LE(addr, pixels) { \
|
#define WRITE_TWO_PIXELS_LE(addr, pixels) { \
|
||||||
((INT16 *)(addr))[0] = (INT16)(pixels); \
|
((INT16 *)(addr))[0] = (INT16)(pixels); \
|
||||||
((INT16 *)(addr))[1] = (INT16)((pixels) >> 16); \
|
((INT16 *)(addr))[1] = (INT16)((pixels) >> 16); \
|
||||||
|
|||||||
+9
-5
@@ -8,6 +8,7 @@
|
|||||||
* Copyright (C) 2010, 2015-2016, D. R. Commander.
|
* Copyright (C) 2010, 2015-2016, D. R. Commander.
|
||||||
* Copyright (C) 2014, MIPS Technologies, Inc., California.
|
* Copyright (C) 2014, MIPS Technologies, Inc., California.
|
||||||
* Copyright (C) 2015, Google, Inc.
|
* Copyright (C) 2015, Google, Inc.
|
||||||
|
* Copyright (C) 2019, Arm Limited.
|
||||||
* For conditions of distribution and use, see the accompanying README.ijg
|
* For conditions of distribution and use, see the accompanying README.ijg
|
||||||
* file.
|
* file.
|
||||||
*
|
*
|
||||||
@@ -315,9 +316,9 @@ h1v2_fancy_upsample(j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
|||||||
JSAMPARRAY output_data = *output_data_ptr;
|
JSAMPARRAY output_data = *output_data_ptr;
|
||||||
JSAMPROW inptr0, inptr1, outptr;
|
JSAMPROW inptr0, inptr1, outptr;
|
||||||
#if BITS_IN_JSAMPLE == 8
|
#if BITS_IN_JSAMPLE == 8
|
||||||
int thiscolsum;
|
int thiscolsum, bias;
|
||||||
#else
|
#else
|
||||||
JLONG thiscolsum;
|
JLONG thiscolsum, bias;
|
||||||
#endif
|
#endif
|
||||||
JDIMENSION colctr;
|
JDIMENSION colctr;
|
||||||
int inrow, outrow, v;
|
int inrow, outrow, v;
|
||||||
@@ -327,15 +328,18 @@ h1v2_fancy_upsample(j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
|||||||
for (v = 0; v < 2; v++) {
|
for (v = 0; v < 2; v++) {
|
||||||
/* inptr0 points to nearest input row, inptr1 points to next nearest */
|
/* inptr0 points to nearest input row, inptr1 points to next nearest */
|
||||||
inptr0 = input_data[inrow];
|
inptr0 = input_data[inrow];
|
||||||
if (v == 0) /* next nearest is row above */
|
if (v == 0) { /* next nearest is row above */
|
||||||
inptr1 = input_data[inrow - 1];
|
inptr1 = input_data[inrow - 1];
|
||||||
else /* next nearest is row below */
|
bias = 1;
|
||||||
|
} else { /* next nearest is row below */
|
||||||
inptr1 = input_data[inrow + 1];
|
inptr1 = input_data[inrow + 1];
|
||||||
|
bias = 2;
|
||||||
|
}
|
||||||
outptr = output_data[outrow++];
|
outptr = output_data[outrow++];
|
||||||
|
|
||||||
for (colctr = 0; colctr < compptr->downsampled_width; colctr++) {
|
for (colctr = 0; colctr < compptr->downsampled_width; colctr++) {
|
||||||
thiscolsum = GETJSAMPLE(*inptr0++) * 3 + GETJSAMPLE(*inptr1++);
|
thiscolsum = GETJSAMPLE(*inptr0++) * 3 + GETJSAMPLE(*inptr1++);
|
||||||
*outptr++ = (JSAMPLE)((thiscolsum + 1) >> 2);
|
*outptr++ = (JSAMPLE)((thiscolsum + bias) >> 2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
inrow++;
|
inrow++;
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* jfdctint.c
|
* jfdctint.c
|
||||||
*
|
*
|
||||||
* 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-1996, Thomas G. Lane.
|
* Copyright (C) 1991-1996, Thomas G. Lane.
|
||||||
* libjpeg-turbo Modifications:
|
* libjpeg-turbo Modifications:
|
||||||
* Copyright (C) 2015, D. R. Commander.
|
* Copyright (C) 2015, D. R. Commander.
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* jidctint.c
|
* jidctint.c
|
||||||
*
|
*
|
||||||
* 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-1998, Thomas G. Lane.
|
* Copyright (C) 1991-1998, Thomas G. Lane.
|
||||||
* Modification developed 2002-2009 by Guido Vollbeding.
|
* Modification developed 2002-2009 by Guido Vollbeding.
|
||||||
* libjpeg-turbo Modifications:
|
* libjpeg-turbo Modifications:
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* jidctred.c
|
* jidctred.c
|
||||||
*
|
*
|
||||||
* 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-1998, Thomas G. Lane.
|
* Copyright (C) 1994-1998, Thomas G. Lane.
|
||||||
* libjpeg-turbo Modifications:
|
* libjpeg-turbo Modifications:
|
||||||
* Copyright (C) 2015, D. R. Commander.
|
* Copyright (C) 2015, D. R. Commander.
|
||||||
|
|||||||
+3
-3
@@ -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-2019, D. R. Commander.
|
* Copyright (C) 2010, 2012-2020, 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.
|
||||||
*
|
*
|
||||||
@@ -36,7 +36,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#define JCOPYRIGHT \
|
#define JCOPYRIGHT \
|
||||||
"Copyright (C) 2009-2019 D. R. Commander\n" \
|
"Copyright (C) 2009-2020 D. R. Commander\n" \
|
||||||
"Copyright (C) 2011-2016 Siarhei Siamashka\n" \
|
"Copyright (C) 2011-2016 Siarhei Siamashka\n" \
|
||||||
"Copyright (C) 2015-2016, 2018 Matthieu Darbois\n" \
|
"Copyright (C) 2015-2016, 2018 Matthieu Darbois\n" \
|
||||||
"Copyright (C) 2015 Intel Corporation\n" \
|
"Copyright (C) 2015 Intel Corporation\n" \
|
||||||
@@ -49,4 +49,4 @@
|
|||||||
"Copyright (C) 1991-2016 Thomas G. Lane, Guido Vollbeding"
|
"Copyright (C) 1991-2016 Thomas G. Lane, Guido Vollbeding"
|
||||||
|
|
||||||
#define JCOPYRIGHT_SHORT \
|
#define JCOPYRIGHT_SHORT \
|
||||||
"Copyright (C) 1991-2019 The libjpeg-turbo Project and many others"
|
"Copyright (C) 1991-2020 The libjpeg-turbo Project and many others"
|
||||||
|
|||||||
Vendored
+6
-13
@@ -1,7 +1,7 @@
|
|||||||
The Independent JPEG Group's JPEG software
|
The Independent JPEG Group's JPEG software
|
||||||
==========================================
|
==========================================
|
||||||
|
|
||||||
README for release 9c of 14-Jan-2018
|
README for release 9d of 12-Jan-2020
|
||||||
====================================
|
====================================
|
||||||
|
|
||||||
This distribution contains the ninth public release of the Independent JPEG
|
This distribution contains the ninth public release of the Independent JPEG
|
||||||
@@ -10,8 +10,8 @@ to use it for any purpose, subject to the conditions under LEGAL ISSUES, below.
|
|||||||
|
|
||||||
This software is the work of Tom Lane, Guido Vollbeding, Philip Gladstone,
|
This software is the work of Tom Lane, Guido Vollbeding, Philip Gladstone,
|
||||||
Bill Allombert, Jim Boucher, Lee Crocker, Bob Friesenhahn, Ben Jackson,
|
Bill Allombert, Jim Boucher, Lee Crocker, Bob Friesenhahn, Ben Jackson,
|
||||||
Julian Minguillon, Luis Ortiz, George Phillips, Davide Rossi, Ge' Weijers,
|
John Korejwa, Julian Minguillon, Luis Ortiz, George Phillips, Davide Rossi,
|
||||||
and other members of the Independent JPEG Group.
|
Ge' Weijers, and other members of the Independent JPEG Group.
|
||||||
|
|
||||||
IJG is not affiliated with the ISO/IEC JTC1/SC29/WG1 standards committee
|
IJG is not affiliated with the ISO/IEC JTC1/SC29/WG1 standards committee
|
||||||
(previously known as JPEG, together with ITU-T SG16).
|
(previously known as JPEG, together with ITU-T SG16).
|
||||||
@@ -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-2018, Thomas G. Lane, Guido Vollbeding.
|
This software is copyright (C) 1991-2020, 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
|
||||||
@@ -152,13 +152,6 @@ The same holds for its supporting scripts (config.guess, config.sub,
|
|||||||
ltmain.sh). Another support script, install-sh, is copyright by X Consortium
|
ltmain.sh). Another support script, install-sh, is copyright by X Consortium
|
||||||
but is also freely distributable.
|
but is also freely distributable.
|
||||||
|
|
||||||
The IJG distribution formerly included code to read and write GIF files.
|
|
||||||
To avoid entanglement with the Unisys LZW patent (now expired), GIF reading
|
|
||||||
support has been removed altogether, and the GIF writer has been simplified
|
|
||||||
to produce "uncompressed GIFs". This technique does not use the LZW
|
|
||||||
algorithm; the resulting GIF files are larger than usual, but are readable
|
|
||||||
by all standard GIF decoders.
|
|
||||||
|
|
||||||
|
|
||||||
REFERENCES
|
REFERENCES
|
||||||
==========
|
==========
|
||||||
@@ -246,8 +239,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.v9c.tar.gz, and in Windows-compatible
|
http://www.ijg.org/files/jpegsrc.v9d.tar.gz, and in Windows-compatible
|
||||||
"zip" archive format as http://www.ijg.org/files/jpegsr9c.zip.
|
"zip" archive format as http://www.ijg.org/files/jpegsr9d.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.
|
||||||
|
|||||||
Vendored
+49
@@ -1,6 +1,55 @@
|
|||||||
CHANGE LOG for Independent JPEG Group's JPEG software
|
CHANGE LOG for Independent JPEG Group's JPEG software
|
||||||
|
|
||||||
|
|
||||||
|
Version 9d 12-Jan-2020
|
||||||
|
-----------------------
|
||||||
|
|
||||||
|
Optimize the optimal Huffman code table generation to produce
|
||||||
|
slightly smaller files. Thank to John Korejwa for suggestion.
|
||||||
|
Note: Requires rebuild of testimgp.jpg.
|
||||||
|
|
||||||
|
Decoding Huffman: Use default tables if tables are not defined.
|
||||||
|
Thank to Simone Azzalin for report (Motion JPEG),
|
||||||
|
and to Martin Strunz for hint.
|
||||||
|
|
||||||
|
Add sanity check in optimal Huffman code table generation.
|
||||||
|
Thank to Adam Farley for suggestion.
|
||||||
|
|
||||||
|
rdtarga.c: use read_byte(), with EOF check, instead of getc()
|
||||||
|
in read_*_pixel().
|
||||||
|
Thank to Chijin Zhou for cjpeg potential vulnerability report.
|
||||||
|
|
||||||
|
jmemnobs.c: respect the max_memory_to_use setting in
|
||||||
|
jpeg_mem_available() computation. Thank to Sheng Shu and
|
||||||
|
Dongdong She for djpeg potential vulnerability report.
|
||||||
|
|
||||||
|
jdarith.c, jdhuff.c: avoid left shift of negative value
|
||||||
|
compiler warning in decode_mcu_AC_refine().
|
||||||
|
Thank to Indu Bhagat for suggestion.
|
||||||
|
|
||||||
|
Add x64 (64-bit) platform support, avoid compiler warnings.
|
||||||
|
Thank to Jonathan Potter, Feiyun Wang, and Sheng Shu for suggestion.
|
||||||
|
|
||||||
|
Adjust libjpeg version specification for pkg-config file.
|
||||||
|
Thank to Chen Chen for suggestion.
|
||||||
|
|
||||||
|
Restore GIF read and write support from libjpeg version 6a.
|
||||||
|
Thank to Wolfgang Werner (W.W.) Heinz for suggestion.
|
||||||
|
|
||||||
|
Improve consistency in raw (downsampled) image data processing mode.
|
||||||
|
Thank to Zhongyuan Zhou for hint.
|
||||||
|
|
||||||
|
Avoid out of bounds array read (AC derived table pointers)
|
||||||
|
in start pass in jdhuff.c. Thank to Peng Li for report.
|
||||||
|
|
||||||
|
Improve code sanity (jdhuff.c).
|
||||||
|
Thank to Reza Mirzazade farkhani for reports.
|
||||||
|
|
||||||
|
Add jpegtran -drop option; add options to the crop extension and wipe
|
||||||
|
to fill the extra area with content from the source image region,
|
||||||
|
instead of gray out.
|
||||||
|
|
||||||
|
|
||||||
Version 9c 14-Jan-2018
|
Version 9c 14-Jan-2018
|
||||||
-----------------------
|
-----------------------
|
||||||
|
|
||||||
|
|||||||
Vendored
+9
-8
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* jcarith.c
|
* jcarith.c
|
||||||
*
|
*
|
||||||
* Developed 1997-2013 by Guido Vollbeding.
|
* Developed 1997-2019 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.
|
||||||
*
|
*
|
||||||
@@ -181,11 +181,11 @@ finish_pass (j_compress_ptr cinfo)
|
|||||||
if (e->zc) /* output final pending zero bytes */
|
if (e->zc) /* output final pending zero bytes */
|
||||||
do emit_byte(0x00, cinfo);
|
do emit_byte(0x00, cinfo);
|
||||||
while (--e->zc);
|
while (--e->zc);
|
||||||
emit_byte((e->c >> 19) & 0xFF, cinfo);
|
emit_byte((int) ((e->c >> 19) & 0xFF), cinfo);
|
||||||
if (((e->c >> 19) & 0xFF) == 0xFF)
|
if (((e->c >> 19) & 0xFF) == 0xFF)
|
||||||
emit_byte(0x00, cinfo);
|
emit_byte(0x00, cinfo);
|
||||||
if (e->c & 0x7F800L) {
|
if (e->c & 0x7F800L) {
|
||||||
emit_byte((e->c >> 11) & 0xFF, cinfo);
|
emit_byte((int) ((e->c >> 11) & 0xFF), cinfo);
|
||||||
if (((e->c >> 11) & 0xFF) == 0xFF)
|
if (((e->c >> 11) & 0xFF) == 0xFF)
|
||||||
emit_byte(0x00, cinfo);
|
emit_byte(0x00, cinfo);
|
||||||
}
|
}
|
||||||
@@ -280,7 +280,8 @@ arith_encode (j_compress_ptr cinfo, unsigned char *st, int val)
|
|||||||
/* Note: The 3 spacer bits in the C register guarantee
|
/* Note: The 3 spacer bits in the C register guarantee
|
||||||
* that the new buffer byte can't be 0xFF here
|
* that the new buffer byte can't be 0xFF here
|
||||||
* (see page 160 in the P&M JPEG book). */
|
* (see page 160 in the P&M JPEG book). */
|
||||||
e->buffer = temp & 0xFF; /* new output byte, might overflow later */
|
/* New output byte, might overflow later */
|
||||||
|
e->buffer = (int) (temp & 0xFF);
|
||||||
} else if (temp == 0xFF) {
|
} else if (temp == 0xFF) {
|
||||||
++e->sc; /* stack 0xFF byte (which might overflow later) */
|
++e->sc; /* stack 0xFF byte (which might overflow later) */
|
||||||
} else {
|
} else {
|
||||||
@@ -302,7 +303,8 @@ arith_encode (j_compress_ptr cinfo, unsigned char *st, int val)
|
|||||||
emit_byte(0x00, cinfo);
|
emit_byte(0x00, cinfo);
|
||||||
} while (--e->sc);
|
} while (--e->sc);
|
||||||
}
|
}
|
||||||
e->buffer = temp & 0xFF; /* new output byte (can still overflow) */
|
/* New output byte (can still overflow) */
|
||||||
|
e->buffer = (int) (temp & 0xFF);
|
||||||
}
|
}
|
||||||
e->c &= 0x7FFFFL;
|
e->c &= 0x7FFFFL;
|
||||||
e->ct += 8;
|
e->ct += 8;
|
||||||
@@ -926,9 +928,8 @@ jinit_arith_encoder (j_compress_ptr cinfo)
|
|||||||
arith_entropy_ptr entropy;
|
arith_entropy_ptr entropy;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
entropy = (arith_entropy_ptr)
|
entropy = (arith_entropy_ptr) (*cinfo->mem->alloc_small)
|
||||||
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
|
((j_common_ptr) cinfo, JPOOL_IMAGE, SIZEOF(arith_entropy_encoder));
|
||||||
SIZEOF(arith_entropy_encoder));
|
|
||||||
cinfo->entropy = &entropy->pub;
|
cinfo->entropy = &entropy->pub;
|
||||||
entropy->pub.start_pass = start_pass;
|
entropy->pub.start_pass = start_pass;
|
||||||
entropy->pub.finish_pass = finish_pass;
|
entropy->pub.finish_pass = finish_pass;
|
||||||
|
|||||||
Vendored
+34
-37
@@ -2,7 +2,7 @@
|
|||||||
* jccolor.c
|
* jccolor.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 1991-1996, Thomas G. Lane.
|
* Copyright (C) 1991-1996, Thomas G. Lane.
|
||||||
* Modified 2011-2013 by Guido Vollbeding.
|
* Modified 2011-2019 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.
|
||||||
*
|
*
|
||||||
@@ -105,7 +105,7 @@ rgb_ycc_start (j_compress_ptr cinfo)
|
|||||||
/* Allocate and fill in the conversion tables. */
|
/* Allocate and fill in the conversion tables. */
|
||||||
cconvert->rgb_ycc_tab = rgb_ycc_tab = (INT32 *)
|
cconvert->rgb_ycc_tab = rgb_ycc_tab = (INT32 *)
|
||||||
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
|
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
|
||||||
(TABLE_SIZE * SIZEOF(INT32)));
|
TABLE_SIZE * SIZEOF(INT32));
|
||||||
|
|
||||||
for (i = 0; i <= MAXJSAMPLE; i++) {
|
for (i = 0; i <= MAXJSAMPLE; i++) {
|
||||||
rgb_ycc_tab[i+R_Y_OFF] = FIX(0.299) * i;
|
rgb_ycc_tab[i+R_Y_OFF] = FIX(0.299) * i;
|
||||||
@@ -131,12 +131,12 @@ rgb_ycc_start (j_compress_ptr cinfo)
|
|||||||
* Convert some rows of samples to the JPEG colorspace.
|
* Convert some rows of samples to the JPEG colorspace.
|
||||||
*
|
*
|
||||||
* Note that we change from the application's interleaved-pixel format
|
* Note that we change from the application's interleaved-pixel format
|
||||||
* to our internal noninterleaved, one-plane-per-component format.
|
* to our internal noninterleaved, one-plane-per-component format. The
|
||||||
* The input buffer is therefore three times as wide as the output buffer.
|
* input buffer is therefore three times as wide as the output buffer.
|
||||||
*
|
*
|
||||||
* A starting row offset is provided only for the output buffer. The caller
|
* A starting row offset is provided only for the output buffer. The
|
||||||
* can easily adjust the passed input_buf value to accommodate any row
|
* caller can easily adjust the passed input_buf value to accommodate
|
||||||
* offset required on that side.
|
* any row offset required on that side.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
METHODDEF(void)
|
METHODDEF(void)
|
||||||
@@ -145,8 +145,8 @@ rgb_ycc_convert (j_compress_ptr cinfo,
|
|||||||
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 INT32 * ctab = cconvert->rgb_ycc_tab;
|
|
||||||
register int r, g, b;
|
register int r, g, b;
|
||||||
|
register INT32 * ctab = cconvert->rgb_ycc_tab;
|
||||||
register JSAMPROW inptr;
|
register JSAMPROW inptr;
|
||||||
register JSAMPROW outptr0, outptr1, outptr2;
|
register JSAMPROW outptr0, outptr1, outptr2;
|
||||||
register JDIMENSION col;
|
register JDIMENSION col;
|
||||||
@@ -162,6 +162,7 @@ rgb_ycc_convert (j_compress_ptr cinfo,
|
|||||||
r = GETJSAMPLE(inptr[RGB_RED]);
|
r = GETJSAMPLE(inptr[RGB_RED]);
|
||||||
g = GETJSAMPLE(inptr[RGB_GREEN]);
|
g = GETJSAMPLE(inptr[RGB_GREEN]);
|
||||||
b = GETJSAMPLE(inptr[RGB_BLUE]);
|
b = GETJSAMPLE(inptr[RGB_BLUE]);
|
||||||
|
inptr += RGB_PIXELSIZE;
|
||||||
/* If the inputs are 0..MAXJSAMPLE, the outputs of these equations
|
/* If the inputs are 0..MAXJSAMPLE, the outputs of these equations
|
||||||
* must be too; we do not need an explicit range-limiting operation.
|
* must be too; we do not need an explicit range-limiting operation.
|
||||||
* Hence the value being shifted is never negative, and we don't
|
* Hence the value being shifted is never negative, and we don't
|
||||||
@@ -179,7 +180,6 @@ rgb_ycc_convert (j_compress_ptr cinfo,
|
|||||||
outptr2[col] = (JSAMPLE)
|
outptr2[col] = (JSAMPLE)
|
||||||
((ctab[r+R_CR_OFF] + ctab[g+G_CR_OFF] + ctab[b+B_CR_OFF])
|
((ctab[r+R_CR_OFF] + ctab[g+G_CR_OFF] + ctab[b+B_CR_OFF])
|
||||||
>> SCALEBITS);
|
>> SCALEBITS);
|
||||||
inptr += RGB_PIXELSIZE;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -201,8 +201,8 @@ rgb_gray_convert (j_compress_ptr cinfo,
|
|||||||
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 INT32 * ctab = cconvert->rgb_ycc_tab;
|
|
||||||
register int r, g, b;
|
register int r, g, b;
|
||||||
|
register INT32 * ctab = cconvert->rgb_ycc_tab;
|
||||||
register JSAMPROW inptr;
|
register JSAMPROW inptr;
|
||||||
register JSAMPROW outptr;
|
register JSAMPROW outptr;
|
||||||
register JDIMENSION col;
|
register JDIMENSION col;
|
||||||
@@ -215,11 +215,11 @@ rgb_gray_convert (j_compress_ptr cinfo,
|
|||||||
r = GETJSAMPLE(inptr[RGB_RED]);
|
r = GETJSAMPLE(inptr[RGB_RED]);
|
||||||
g = GETJSAMPLE(inptr[RGB_GREEN]);
|
g = GETJSAMPLE(inptr[RGB_GREEN]);
|
||||||
b = GETJSAMPLE(inptr[RGB_BLUE]);
|
b = GETJSAMPLE(inptr[RGB_BLUE]);
|
||||||
|
inptr += RGB_PIXELSIZE;
|
||||||
/* Y */
|
/* Y */
|
||||||
outptr[col] = (JSAMPLE)
|
outptr[col] = (JSAMPLE)
|
||||||
((ctab[r+R_Y_OFF] + ctab[g+G_Y_OFF] + ctab[b+B_Y_OFF])
|
((ctab[r+R_Y_OFF] + ctab[g+G_Y_OFF] + ctab[b+B_Y_OFF])
|
||||||
>> SCALEBITS);
|
>> SCALEBITS);
|
||||||
inptr += RGB_PIXELSIZE;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -228,8 +228,8 @@ rgb_gray_convert (j_compress_ptr cinfo,
|
|||||||
/*
|
/*
|
||||||
* Convert some rows of samples to the JPEG colorspace.
|
* Convert some rows of samples to the JPEG colorspace.
|
||||||
* This version handles Adobe-style CMYK->YCCK conversion,
|
* This version handles Adobe-style CMYK->YCCK conversion,
|
||||||
* where we convert R=1-C, G=1-M, and B=1-Y to YCbCr using the same
|
* where we convert R=1-C, G=1-M, and B=1-Y to YCbCr using the
|
||||||
* conversion as above, while passing K (black) unchanged.
|
* same conversion as above, while passing K (black) unchanged.
|
||||||
* We assume rgb_ycc_start has been called.
|
* We assume rgb_ycc_start has been called.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -239,8 +239,8 @@ cmyk_ycck_convert (j_compress_ptr cinfo,
|
|||||||
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 INT32 * ctab = cconvert->rgb_ycc_tab;
|
|
||||||
register int r, g, b;
|
register int r, g, b;
|
||||||
|
register INT32 * ctab = cconvert->rgb_ycc_tab;
|
||||||
register JSAMPROW inptr;
|
register JSAMPROW inptr;
|
||||||
register JSAMPROW outptr0, outptr1, outptr2, outptr3;
|
register JSAMPROW outptr0, outptr1, outptr2, outptr3;
|
||||||
register JDIMENSION col;
|
register JDIMENSION col;
|
||||||
@@ -259,6 +259,7 @@ cmyk_ycck_convert (j_compress_ptr cinfo,
|
|||||||
b = MAXJSAMPLE - GETJSAMPLE(inptr[2]);
|
b = MAXJSAMPLE - GETJSAMPLE(inptr[2]);
|
||||||
/* K passes through as-is */
|
/* K passes through as-is */
|
||||||
outptr3[col] = inptr[3]; /* don't need GETJSAMPLE here */
|
outptr3[col] = inptr[3]; /* don't need GETJSAMPLE here */
|
||||||
|
inptr += 4;
|
||||||
/* If the inputs are 0..MAXJSAMPLE, the outputs of these equations
|
/* If the inputs are 0..MAXJSAMPLE, the outputs of these equations
|
||||||
* must be too; we do not need an explicit range-limiting operation.
|
* must be too; we do not need an explicit range-limiting operation.
|
||||||
* Hence the value being shifted is never negative, and we don't
|
* Hence the value being shifted is never negative, and we don't
|
||||||
@@ -276,7 +277,6 @@ cmyk_ycck_convert (j_compress_ptr cinfo,
|
|||||||
outptr2[col] = (JSAMPLE)
|
outptr2[col] = (JSAMPLE)
|
||||||
((ctab[r+R_CR_OFF] + ctab[g+G_CR_OFF] + ctab[b+B_CR_OFF])
|
((ctab[r+R_CR_OFF] + ctab[g+G_CR_OFF] + ctab[b+B_CR_OFF])
|
||||||
>> SCALEBITS);
|
>> SCALEBITS);
|
||||||
inptr += 4;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -312,13 +312,13 @@ rgb_rgb1_convert (j_compress_ptr cinfo,
|
|||||||
r = GETJSAMPLE(inptr[RGB_RED]);
|
r = GETJSAMPLE(inptr[RGB_RED]);
|
||||||
g = GETJSAMPLE(inptr[RGB_GREEN]);
|
g = GETJSAMPLE(inptr[RGB_GREEN]);
|
||||||
b = GETJSAMPLE(inptr[RGB_BLUE]);
|
b = GETJSAMPLE(inptr[RGB_BLUE]);
|
||||||
|
inptr += RGB_PIXELSIZE;
|
||||||
/* Assume that MAXJSAMPLE+1 is a power of 2, so that the MOD
|
/* Assume that MAXJSAMPLE+1 is a power of 2, so that the MOD
|
||||||
* (modulo) operator is equivalent to the bitmask operator AND.
|
* (modulo) operator is equivalent to the bitmask operator AND.
|
||||||
*/
|
*/
|
||||||
outptr0[col] = (JSAMPLE) ((r - g + CENTERJSAMPLE) & MAXJSAMPLE);
|
outptr0[col] = (JSAMPLE) ((r - g + CENTERJSAMPLE) & MAXJSAMPLE);
|
||||||
outptr1[col] = (JSAMPLE) g;
|
outptr1[col] = (JSAMPLE) g;
|
||||||
outptr2[col] = (JSAMPLE) ((b - g + CENTERJSAMPLE) & MAXJSAMPLE);
|
outptr2[col] = (JSAMPLE) ((b - g + CENTERJSAMPLE) & MAXJSAMPLE);
|
||||||
inptr += RGB_PIXELSIZE;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -335,17 +335,17 @@ grayscale_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)
|
||||||
{
|
{
|
||||||
int instride = cinfo->input_components;
|
|
||||||
register JSAMPROW inptr;
|
register JSAMPROW inptr;
|
||||||
register JSAMPROW outptr;
|
register JSAMPROW outptr;
|
||||||
register JDIMENSION col;
|
register JDIMENSION count;
|
||||||
|
register int instride = cinfo->input_components;
|
||||||
JDIMENSION num_cols = cinfo->image_width;
|
JDIMENSION num_cols = cinfo->image_width;
|
||||||
|
|
||||||
while (--num_rows >= 0) {
|
while (--num_rows >= 0) {
|
||||||
inptr = *input_buf++;
|
inptr = *input_buf++;
|
||||||
outptr = output_buf[0][output_row++];
|
outptr = output_buf[0][output_row++];
|
||||||
for (col = 0; col < num_cols; col++) {
|
for (count = num_cols; count > 0; count--) {
|
||||||
outptr[col] = inptr[0]; /* don't need GETJSAMPLE() here */
|
*outptr++ = *inptr; /* don't need GETJSAMPLE() here */
|
||||||
inptr += instride;
|
inptr += instride;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -396,21 +396,21 @@ 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)
|
||||||
{
|
{
|
||||||
int ci;
|
|
||||||
register int nc = cinfo->num_components;
|
|
||||||
register JSAMPROW inptr;
|
register JSAMPROW inptr;
|
||||||
register JSAMPROW outptr;
|
register JSAMPROW outptr;
|
||||||
register JDIMENSION col;
|
register JDIMENSION count;
|
||||||
|
register int num_comps = cinfo->num_components;
|
||||||
JDIMENSION num_cols = cinfo->image_width;
|
JDIMENSION num_cols = cinfo->image_width;
|
||||||
|
int ci;
|
||||||
|
|
||||||
while (--num_rows >= 0) {
|
while (--num_rows >= 0) {
|
||||||
/* It seems fastest to make a separate pass for each component. */
|
/* It seems fastest to make a separate pass for each component. */
|
||||||
for (ci = 0; ci < nc; ci++) {
|
for (ci = 0; ci < num_comps; ci++) {
|
||||||
inptr = input_buf[0] + ci;
|
inptr = input_buf[0] + ci;
|
||||||
outptr = output_buf[ci][output_row];
|
outptr = output_buf[ci][output_row];
|
||||||
for (col = 0; col < num_cols; col++) {
|
for (count = num_cols; count > 0; count--) {
|
||||||
*outptr++ = *inptr; /* don't need GETJSAMPLE() here */
|
*outptr++ = *inptr; /* don't need GETJSAMPLE() here */
|
||||||
inptr += nc;
|
inptr += num_comps;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
input_buf++;
|
input_buf++;
|
||||||
@@ -439,9 +439,8 @@ jinit_color_converter (j_compress_ptr cinfo)
|
|||||||
{
|
{
|
||||||
my_cconvert_ptr cconvert;
|
my_cconvert_ptr cconvert;
|
||||||
|
|
||||||
cconvert = (my_cconvert_ptr)
|
cconvert = (my_cconvert_ptr) (*cinfo->mem->alloc_small)
|
||||||
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
|
((j_common_ptr) cinfo, JPOOL_IMAGE, SIZEOF(my_color_converter));
|
||||||
SIZEOF(my_color_converter));
|
|
||||||
cinfo->cconvert = &cconvert->pub;
|
cinfo->cconvert = &cconvert->pub;
|
||||||
/* set start_pass to null method until we find out differently */
|
/* set start_pass to null method until we find out differently */
|
||||||
cconvert->pub.start_pass = null_method;
|
cconvert->pub.start_pass = null_method;
|
||||||
@@ -455,9 +454,11 @@ jinit_color_converter (j_compress_ptr cinfo)
|
|||||||
|
|
||||||
case JCS_RGB:
|
case JCS_RGB:
|
||||||
case JCS_BG_RGB:
|
case JCS_BG_RGB:
|
||||||
|
#if RGB_PIXELSIZE != 3
|
||||||
if (cinfo->input_components != RGB_PIXELSIZE)
|
if (cinfo->input_components != RGB_PIXELSIZE)
|
||||||
ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);
|
ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);
|
||||||
break;
|
break;
|
||||||
|
#endif /* else share code with YCbCr */
|
||||||
|
|
||||||
case JCS_YCbCr:
|
case JCS_YCbCr:
|
||||||
case JCS_BG_YCC:
|
case JCS_BG_YCC:
|
||||||
@@ -474,7 +475,6 @@ jinit_color_converter (j_compress_ptr cinfo)
|
|||||||
default: /* JCS_UNKNOWN can be anything */
|
default: /* JCS_UNKNOWN can be anything */
|
||||||
if (cinfo->input_components < 1)
|
if (cinfo->input_components < 1)
|
||||||
ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);
|
ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Support color transform only for RGB colorspaces */
|
/* Support color transform only for RGB colorspaces */
|
||||||
@@ -507,7 +507,8 @@ jinit_color_converter (j_compress_ptr cinfo)
|
|||||||
case JCS_BG_RGB:
|
case JCS_BG_RGB:
|
||||||
if (cinfo->num_components != 3)
|
if (cinfo->num_components != 3)
|
||||||
ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
|
ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
|
||||||
if (cinfo->in_color_space == cinfo->jpeg_color_space) {
|
if (cinfo->in_color_space != cinfo->jpeg_color_space)
|
||||||
|
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
|
||||||
switch (cinfo->color_transform) {
|
switch (cinfo->color_transform) {
|
||||||
case JCT_NONE:
|
case JCT_NONE:
|
||||||
cconvert->pub.color_convert = rgb_convert;
|
cconvert->pub.color_convert = rgb_convert;
|
||||||
@@ -518,8 +519,6 @@ jinit_color_converter (j_compress_ptr cinfo)
|
|||||||
default:
|
default:
|
||||||
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
|
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
|
||||||
}
|
}
|
||||||
} else
|
|
||||||
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case JCS_YCbCr:
|
case JCS_YCbCr:
|
||||||
@@ -572,10 +571,9 @@ jinit_color_converter (j_compress_ptr cinfo)
|
|||||||
case JCS_CMYK:
|
case JCS_CMYK:
|
||||||
if (cinfo->num_components != 4)
|
if (cinfo->num_components != 4)
|
||||||
ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
|
ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
|
||||||
if (cinfo->in_color_space == JCS_CMYK)
|
if (cinfo->in_color_space != JCS_CMYK)
|
||||||
cconvert->pub.color_convert = null_convert;
|
|
||||||
else
|
|
||||||
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
|
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
|
||||||
|
cconvert->pub.color_convert = null_convert;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case JCS_YCCK:
|
case JCS_YCCK:
|
||||||
@@ -599,6 +597,5 @@ jinit_color_converter (j_compress_ptr cinfo)
|
|||||||
cinfo->num_components != cinfo->input_components)
|
cinfo->num_components != cinfo->input_components)
|
||||||
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
|
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
|
||||||
cconvert->pub.color_convert = null_convert;
|
cconvert->pub.color_convert = null_convert;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+102
-35
@@ -2,7 +2,7 @@
|
|||||||
* jchuff.c
|
* jchuff.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 1991-1997, Thomas G. Lane.
|
* Copyright (C) 1991-1997, Thomas G. Lane.
|
||||||
* Modified 2006-2013 by Guido Vollbeding.
|
* Modified 2006-2019 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.
|
||||||
*
|
*
|
||||||
@@ -178,13 +178,12 @@ jpeg_make_c_derived_tbl (j_compress_ptr cinfo, boolean isDC, int tblno,
|
|||||||
htbl =
|
htbl =
|
||||||
isDC ? cinfo->dc_huff_tbl_ptrs[tblno] : cinfo->ac_huff_tbl_ptrs[tblno];
|
isDC ? cinfo->dc_huff_tbl_ptrs[tblno] : cinfo->ac_huff_tbl_ptrs[tblno];
|
||||||
if (htbl == NULL)
|
if (htbl == NULL)
|
||||||
ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tblno);
|
htbl = jpeg_std_huff_table((j_common_ptr) cinfo, isDC, tblno);
|
||||||
|
|
||||||
/* Allocate a workspace if we haven't already done so. */
|
/* Allocate a workspace if we haven't already done so. */
|
||||||
if (*pdtbl == NULL)
|
if (*pdtbl == NULL)
|
||||||
*pdtbl = (c_derived_tbl *)
|
*pdtbl = (c_derived_tbl *) (*cinfo->mem->alloc_small)
|
||||||
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
|
((j_common_ptr) cinfo, JPOOL_IMAGE, SIZEOF(c_derived_tbl));
|
||||||
SIZEOF(c_derived_tbl));
|
|
||||||
dtbl = *pdtbl;
|
dtbl = *pdtbl;
|
||||||
|
|
||||||
/* Figure C.1: make table of Huffman code length for each symbol */
|
/* Figure C.1: make table of Huffman code length for each symbol */
|
||||||
@@ -1256,10 +1255,82 @@ jpeg_gen_optimal_table (j_compress_ptr cinfo, JHUFF_TBL * htbl, long freq[])
|
|||||||
UINT8 bits[MAX_CLEN+1]; /* bits[k] = # of symbols with code length k */
|
UINT8 bits[MAX_CLEN+1]; /* bits[k] = # of symbols with code length k */
|
||||||
int codesize[257]; /* codesize[k] = code length of symbol k */
|
int codesize[257]; /* codesize[k] = code length of symbol k */
|
||||||
int others[257]; /* next symbol in current branch of tree */
|
int others[257]; /* next symbol in current branch of tree */
|
||||||
int c1, c2;
|
int c1, c2, i, j;
|
||||||
int p, i, j;
|
UINT8 *p;
|
||||||
long v;
|
long v;
|
||||||
|
|
||||||
|
freq[256] = 1; /* make sure 256 has a nonzero count */
|
||||||
|
/* Including the pseudo-symbol 256 in the Huffman procedure guarantees
|
||||||
|
* that no real symbol is given code-value of all ones, because 256
|
||||||
|
* will be placed last in the largest codeword category.
|
||||||
|
* In the symbol list build procedure this element serves as sentinel
|
||||||
|
* for the zero run loop.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef DONT_USE_FANCY_HUFF_OPT
|
||||||
|
|
||||||
|
/* Build list of symbols sorted in order of descending frequency */
|
||||||
|
/* This approach has several benefits (thank to John Korejwa for the idea):
|
||||||
|
* 1.
|
||||||
|
* If a codelength category is split during the length limiting procedure
|
||||||
|
* below, the feature that more frequent symbols are assigned shorter
|
||||||
|
* codewords remains valid for the adjusted code.
|
||||||
|
* 2.
|
||||||
|
* To reduce consecutive ones in a Huffman data stream (thus reducing the
|
||||||
|
* number of stuff bytes in JPEG) it is preferable to follow 0 branches
|
||||||
|
* (and avoid 1 branches) as much as possible. This is easily done by
|
||||||
|
* assigning symbols to leaves of the Huffman tree in order of decreasing
|
||||||
|
* frequency, with no secondary sort based on codelengths.
|
||||||
|
* 3.
|
||||||
|
* The symbol list can be built independently from the assignment of code
|
||||||
|
* lengths by the Huffman procedure below.
|
||||||
|
* Note: The symbol list build procedure must be performed first, because
|
||||||
|
* the Huffman procedure assigning the codelengths clobbers the frequency
|
||||||
|
* counts!
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Here we use the others array as a linked list of nonzero frequencies
|
||||||
|
* to be sorted. Already sorted elements are removed from the list.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Building list */
|
||||||
|
|
||||||
|
/* This item does not correspond to a valid symbol frequency and is used
|
||||||
|
* as starting index.
|
||||||
|
*/
|
||||||
|
j = 256;
|
||||||
|
|
||||||
|
for (i = 0;; i++) {
|
||||||
|
if (freq[i] == 0) /* skip zero frequencies */
|
||||||
|
continue;
|
||||||
|
if (i > 255)
|
||||||
|
break;
|
||||||
|
others[j] = i; /* this symbol value */
|
||||||
|
j = i; /* previous symbol value */
|
||||||
|
}
|
||||||
|
others[j] = -1; /* mark end of list */
|
||||||
|
|
||||||
|
/* Sorting list */
|
||||||
|
|
||||||
|
p = htbl->huffval;
|
||||||
|
while ((c1 = others[256]) >= 0) {
|
||||||
|
v = freq[c1];
|
||||||
|
i = c1; /* first symbol value */
|
||||||
|
j = 256; /* pseudo symbol value for starting index */
|
||||||
|
while ((c2 = others[c1]) >= 0) {
|
||||||
|
if (freq[c2] > v) {
|
||||||
|
v = freq[c2];
|
||||||
|
i = c2; /* this symbol value */
|
||||||
|
j = c1; /* previous symbol value */
|
||||||
|
}
|
||||||
|
c1 = c2;
|
||||||
|
}
|
||||||
|
others[j] = others[i]; /* remove this symbol i from list */
|
||||||
|
*p++ = (UINT8) i;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* DONT_USE_FANCY_HUFF_OPT */
|
||||||
|
|
||||||
/* This algorithm is explained in section K.2 of the JPEG standard */
|
/* This algorithm is explained in section K.2 of the JPEG standard */
|
||||||
|
|
||||||
MEMZERO(bits, SIZEOF(bits));
|
MEMZERO(bits, SIZEOF(bits));
|
||||||
@@ -1267,12 +1338,6 @@ jpeg_gen_optimal_table (j_compress_ptr cinfo, JHUFF_TBL * htbl, long freq[])
|
|||||||
for (i = 0; i < 257; i++)
|
for (i = 0; i < 257; i++)
|
||||||
others[i] = -1; /* init links to empty */
|
others[i] = -1; /* init links to empty */
|
||||||
|
|
||||||
freq[256] = 1; /* make sure 256 has a nonzero count */
|
|
||||||
/* Including the pseudo-symbol 256 in the Huffman procedure guarantees
|
|
||||||
* that no real symbol is given code-value of all ones, because 256
|
|
||||||
* will be placed last in the largest codeword category.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* Huffman's basic algorithm to assign optimal code lengths to symbols */
|
/* Huffman's basic algorithm to assign optimal code lengths to symbols */
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
@@ -1329,7 +1394,7 @@ jpeg_gen_optimal_table (j_compress_ptr cinfo, JHUFF_TBL * htbl, long freq[])
|
|||||||
/* The JPEG standard seems to think that this can't happen, */
|
/* The JPEG standard seems to think that this can't happen, */
|
||||||
/* but I'm paranoid... */
|
/* but I'm paranoid... */
|
||||||
if (codesize[i] > MAX_CLEN)
|
if (codesize[i] > MAX_CLEN)
|
||||||
ERREXIT(cinfo, JERR_HUFF_CLEN_OVERFLOW);
|
ERREXIT(cinfo, JERR_HUFF_CLEN_OUTOFBOUNDS);
|
||||||
|
|
||||||
bits[codesize[i]]++;
|
bits[codesize[i]]++;
|
||||||
}
|
}
|
||||||
@@ -1349,8 +1414,11 @@ jpeg_gen_optimal_table (j_compress_ptr cinfo, JHUFF_TBL * htbl, long freq[])
|
|||||||
for (i = MAX_CLEN; i > 16; i--) {
|
for (i = MAX_CLEN; i > 16; i--) {
|
||||||
while (bits[i] > 0) {
|
while (bits[i] > 0) {
|
||||||
j = i - 2; /* find length of new prefix to be used */
|
j = i - 2; /* find length of new prefix to be used */
|
||||||
while (bits[j] == 0)
|
while (bits[j] == 0) {
|
||||||
|
if (j == 0)
|
||||||
|
ERREXIT(cinfo, JERR_HUFF_CLEN_OUTOFBOUNDS);
|
||||||
j--;
|
j--;
|
||||||
|
}
|
||||||
|
|
||||||
bits[i] -= 2; /* remove two symbols */
|
bits[i] -= 2; /* remove two symbols */
|
||||||
bits[i-1]++; /* one goes in this length */
|
bits[i-1]++; /* one goes in this length */
|
||||||
@@ -1367,20 +1435,23 @@ jpeg_gen_optimal_table (j_compress_ptr cinfo, JHUFF_TBL * htbl, long freq[])
|
|||||||
/* Return final symbol counts (only for lengths 0..16) */
|
/* Return final symbol counts (only for lengths 0..16) */
|
||||||
MEMCOPY(htbl->bits, bits, SIZEOF(htbl->bits));
|
MEMCOPY(htbl->bits, bits, SIZEOF(htbl->bits));
|
||||||
|
|
||||||
|
#ifdef DONT_USE_FANCY_HUFF_OPT
|
||||||
|
|
||||||
/* 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
|
/* Note: Due to the codelength changes made above, it can happen
|
||||||
* changes made above, but the JPEG spec seems to think this works.
|
* that more frequent symbols are assigned longer codewords.
|
||||||
*/
|
*/
|
||||||
p = 0;
|
p = htbl->huffval;
|
||||||
for (i = 1; i <= MAX_CLEN; i++) {
|
for (i = 1; i <= MAX_CLEN; i++) {
|
||||||
for (j = 0; j <= 255; j++) {
|
for (j = 0; j <= 255; j++) {
|
||||||
if (codesize[j] == i) {
|
if (codesize[j] == i) {
|
||||||
htbl->huffval[p] = (UINT8) j;
|
*p++ = (UINT8) j;
|
||||||
p++;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif /* DONT_USE_FANCY_HUFF_OPT */
|
||||||
|
|
||||||
/* Set sent_table FALSE so updated table will be written to JPEG file. */
|
/* Set sent_table FALSE so updated table will be written to JPEG file. */
|
||||||
htbl->sent_table = FALSE;
|
htbl->sent_table = FALSE;
|
||||||
}
|
}
|
||||||
@@ -1400,13 +1471,13 @@ finish_pass_gather (j_compress_ptr cinfo)
|
|||||||
boolean did_dc[NUM_HUFF_TBLS];
|
boolean did_dc[NUM_HUFF_TBLS];
|
||||||
boolean did_ac[NUM_HUFF_TBLS];
|
boolean did_ac[NUM_HUFF_TBLS];
|
||||||
|
|
||||||
/* It's important not to apply jpeg_gen_optimal_table more than once
|
|
||||||
* per table, because it clobbers the input frequency counts!
|
|
||||||
*/
|
|
||||||
if (cinfo->progressive_mode)
|
if (cinfo->progressive_mode)
|
||||||
/* Flush out buffered data (all we care about is counting the EOB symbol) */
|
/* Flush out buffered data (all we care about is counting the EOB symbol) */
|
||||||
emit_eobrun(entropy);
|
emit_eobrun(entropy);
|
||||||
|
|
||||||
|
/* It's important not to apply jpeg_gen_optimal_table more than once
|
||||||
|
* per table, because it clobbers the input frequency counts!
|
||||||
|
*/
|
||||||
MEMZERO(did_dc, SIZEOF(did_dc));
|
MEMZERO(did_dc, SIZEOF(did_dc));
|
||||||
MEMZERO(did_ac, SIZEOF(did_ac));
|
MEMZERO(did_ac, SIZEOF(did_ac));
|
||||||
|
|
||||||
@@ -1475,9 +1546,8 @@ start_pass_huff (j_compress_ptr cinfo, boolean gather_statistics)
|
|||||||
entropy->pub.encode_mcu = encode_mcu_AC_refine;
|
entropy->pub.encode_mcu = encode_mcu_AC_refine;
|
||||||
/* 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 *) (*cinfo->mem->alloc_small)
|
||||||
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
|
((j_common_ptr) cinfo, JPOOL_IMAGE, MAX_CORR_BITS * SIZEOF(char));
|
||||||
MAX_CORR_BITS * SIZEOF(char));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1505,9 +1575,8 @@ start_pass_huff (j_compress_ptr cinfo, boolean gather_statistics)
|
|||||||
/* Allocate and zero the statistics tables */
|
/* Allocate and zero the statistics tables */
|
||||||
/* Note that jpeg_gen_optimal_table expects 257 entries in each table! */
|
/* Note that jpeg_gen_optimal_table expects 257 entries in each table! */
|
||||||
if (entropy->dc_count_ptrs[tbl] == NULL)
|
if (entropy->dc_count_ptrs[tbl] == NULL)
|
||||||
entropy->dc_count_ptrs[tbl] = (long *)
|
entropy->dc_count_ptrs[tbl] = (long *) (*cinfo->mem->alloc_small)
|
||||||
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
|
((j_common_ptr) cinfo, JPOOL_IMAGE, 257 * SIZEOF(long));
|
||||||
257 * SIZEOF(long));
|
|
||||||
MEMZERO(entropy->dc_count_ptrs[tbl], 257 * SIZEOF(long));
|
MEMZERO(entropy->dc_count_ptrs[tbl], 257 * SIZEOF(long));
|
||||||
} else {
|
} else {
|
||||||
/* Compute derived values for Huffman tables */
|
/* Compute derived values for Huffman tables */
|
||||||
@@ -1525,9 +1594,8 @@ start_pass_huff (j_compress_ptr cinfo, boolean gather_statistics)
|
|||||||
if (tbl < 0 || tbl >= NUM_HUFF_TBLS)
|
if (tbl < 0 || tbl >= NUM_HUFF_TBLS)
|
||||||
ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tbl);
|
ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tbl);
|
||||||
if (entropy->ac_count_ptrs[tbl] == NULL)
|
if (entropy->ac_count_ptrs[tbl] == NULL)
|
||||||
entropy->ac_count_ptrs[tbl] = (long *)
|
entropy->ac_count_ptrs[tbl] = (long *) (*cinfo->mem->alloc_small)
|
||||||
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
|
((j_common_ptr) cinfo, JPOOL_IMAGE, 257 * SIZEOF(long));
|
||||||
257 * SIZEOF(long));
|
|
||||||
MEMZERO(entropy->ac_count_ptrs[tbl], 257 * SIZEOF(long));
|
MEMZERO(entropy->ac_count_ptrs[tbl], 257 * SIZEOF(long));
|
||||||
} else {
|
} else {
|
||||||
jpeg_make_c_derived_tbl(cinfo, FALSE, tbl,
|
jpeg_make_c_derived_tbl(cinfo, FALSE, tbl,
|
||||||
@@ -1556,9 +1624,8 @@ jinit_huff_encoder (j_compress_ptr cinfo)
|
|||||||
huff_entropy_ptr entropy;
|
huff_entropy_ptr entropy;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
entropy = (huff_entropy_ptr)
|
entropy = (huff_entropy_ptr) (*cinfo->mem->alloc_small)
|
||||||
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
|
((j_common_ptr) cinfo, JPOOL_IMAGE, SIZEOF(huff_entropy_encoder));
|
||||||
SIZEOF(huff_entropy_encoder));
|
|
||||||
cinfo->entropy = &entropy->pub;
|
cinfo->entropy = &entropy->pub;
|
||||||
entropy->pub.start_pass = start_pass_huff;
|
entropy->pub.start_pass = start_pass_huff;
|
||||||
|
|
||||||
|
|||||||
Vendored
+3
-5
@@ -2,7 +2,7 @@
|
|||||||
* jcmarker.c
|
* jcmarker.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 1991-1998, Thomas G. Lane.
|
* Copyright (C) 1991-1998, Thomas G. Lane.
|
||||||
* Modified 2003-2013 by Guido Vollbeding.
|
* Modified 2003-2019 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.
|
||||||
*
|
*
|
||||||
@@ -471,7 +471,6 @@ emit_adobe_app14 (j_compress_ptr cinfo)
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
emit_byte(cinfo, 0); /* Color transform = 0 */
|
emit_byte(cinfo, 0); /* Color transform = 0 */
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -702,9 +701,8 @@ jinit_marker_writer (j_compress_ptr cinfo)
|
|||||||
my_marker_ptr marker;
|
my_marker_ptr marker;
|
||||||
|
|
||||||
/* Create the subobject */
|
/* Create the subobject */
|
||||||
marker = (my_marker_ptr)
|
marker = (my_marker_ptr) (*cinfo->mem->alloc_small)
|
||||||
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
|
((j_common_ptr) cinfo, JPOOL_IMAGE, SIZEOF(my_marker_writer));
|
||||||
SIZEOF(my_marker_writer));
|
|
||||||
cinfo->marker = &marker->pub;
|
cinfo->marker = &marker->pub;
|
||||||
/* Initialize method pointers */
|
/* Initialize method pointers */
|
||||||
marker->pub.write_file_header = write_file_header;
|
marker->pub.write_file_header = write_file_header;
|
||||||
|
|||||||
Vendored
+10
-7
@@ -2,7 +2,7 @@
|
|||||||
* jcmaster.c
|
* jcmaster.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 1991-1997, Thomas G. Lane.
|
* Copyright (C) 1991-1997, Thomas G. Lane.
|
||||||
* Modified 2003-2017 by Guido Vollbeding.
|
* Modified 2003-2019 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.
|
||||||
*
|
*
|
||||||
@@ -62,7 +62,7 @@ initial_setup (j_compress_ptr cinfo)
|
|||||||
case 5: cinfo->natural_order = jpeg_natural_order5; break;
|
case 5: cinfo->natural_order = jpeg_natural_order5; break;
|
||||||
case 6: cinfo->natural_order = jpeg_natural_order6; break;
|
case 6: cinfo->natural_order = jpeg_natural_order6; break;
|
||||||
case 7: cinfo->natural_order = jpeg_natural_order7; break;
|
case 7: cinfo->natural_order = jpeg_natural_order7; break;
|
||||||
default: cinfo->natural_order = jpeg_natural_order; break;
|
default: cinfo->natural_order = jpeg_natural_order;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Derive lim_Se from block_size */
|
/* Derive lim_Se from block_size */
|
||||||
@@ -114,18 +114,22 @@ initial_setup (j_compress_ptr cinfo)
|
|||||||
*/
|
*/
|
||||||
ssize = 1;
|
ssize = 1;
|
||||||
#ifdef DCT_SCALING_SUPPORTED
|
#ifdef DCT_SCALING_SUPPORTED
|
||||||
|
if (! cinfo->raw_data_in)
|
||||||
while (cinfo->min_DCT_h_scaled_size * ssize <=
|
while (cinfo->min_DCT_h_scaled_size * ssize <=
|
||||||
(cinfo->do_fancy_downsampling ? DCTSIZE : DCTSIZE / 2) &&
|
(cinfo->do_fancy_downsampling ? DCTSIZE : DCTSIZE / 2) &&
|
||||||
(cinfo->max_h_samp_factor % (compptr->h_samp_factor * ssize * 2)) == 0) {
|
(cinfo->max_h_samp_factor % (compptr->h_samp_factor * ssize * 2)) ==
|
||||||
|
0) {
|
||||||
ssize = ssize * 2;
|
ssize = ssize * 2;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
compptr->DCT_h_scaled_size = cinfo->min_DCT_h_scaled_size * ssize;
|
compptr->DCT_h_scaled_size = cinfo->min_DCT_h_scaled_size * ssize;
|
||||||
ssize = 1;
|
ssize = 1;
|
||||||
#ifdef DCT_SCALING_SUPPORTED
|
#ifdef DCT_SCALING_SUPPORTED
|
||||||
|
if (! cinfo->raw_data_in)
|
||||||
while (cinfo->min_DCT_v_scaled_size * ssize <=
|
while (cinfo->min_DCT_v_scaled_size * ssize <=
|
||||||
(cinfo->do_fancy_downsampling ? DCTSIZE : DCTSIZE / 2) &&
|
(cinfo->do_fancy_downsampling ? DCTSIZE : DCTSIZE / 2) &&
|
||||||
(cinfo->max_v_samp_factor % (compptr->v_samp_factor * ssize * 2)) == 0) {
|
(cinfo->max_v_samp_factor % (compptr->v_samp_factor * ssize * 2)) ==
|
||||||
|
0) {
|
||||||
ssize = ssize * 2;
|
ssize = ssize * 2;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -620,9 +624,8 @@ jinit_c_master_control (j_compress_ptr cinfo, boolean transcode_only)
|
|||||||
{
|
{
|
||||||
my_master_ptr master;
|
my_master_ptr master;
|
||||||
|
|
||||||
master = (my_master_ptr)
|
master = (my_master_ptr) (*cinfo->mem->alloc_small)
|
||||||
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
|
((j_common_ptr) cinfo, JPOOL_IMAGE, SIZEOF(my_comp_master));
|
||||||
SIZEOF(my_comp_master));
|
|
||||||
cinfo->master = &master->pub;
|
cinfo->master = &master->pub;
|
||||||
master->pub.prepare_for_pass = prepare_for_pass;
|
master->pub.prepare_for_pass = prepare_for_pass;
|
||||||
master->pub.pass_startup = pass_startup;
|
master->pub.pass_startup = pass_startup;
|
||||||
|
|||||||
Vendored
+138
@@ -2,6 +2,7 @@
|
|||||||
* jcomapi.c
|
* jcomapi.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 1994-1997, Thomas G. Lane.
|
* Copyright (C) 1994-1997, Thomas G. Lane.
|
||||||
|
* Modified 2019 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.
|
||||||
*
|
*
|
||||||
@@ -104,3 +105,140 @@ jpeg_alloc_huff_table (j_common_ptr cinfo)
|
|||||||
tbl->sent_table = FALSE; /* make sure this is false in any new table */
|
tbl->sent_table = FALSE; /* make sure this is false in any new table */
|
||||||
return tbl;
|
return tbl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Set up the standard Huffman tables (cf. JPEG standard section K.3).
|
||||||
|
* IMPORTANT: these are only valid for 8-bit data precision!
|
||||||
|
* (Would jutils.c be a more reasonable place to put this?)
|
||||||
|
*/
|
||||||
|
|
||||||
|
GLOBAL(JHUFF_TBL *)
|
||||||
|
jpeg_std_huff_table (j_common_ptr cinfo, boolean isDC, int tblno)
|
||||||
|
{
|
||||||
|
JHUFF_TBL **htblptr, *htbl;
|
||||||
|
const UINT8 *bits, *val;
|
||||||
|
int nsymbols, len;
|
||||||
|
|
||||||
|
static const UINT8 bits_dc_luminance[17] =
|
||||||
|
{ /* 0-base */ 0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0 };
|
||||||
|
static const UINT8 val_dc_luminance[] =
|
||||||
|
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 };
|
||||||
|
|
||||||
|
static const UINT8 bits_dc_chrominance[17] =
|
||||||
|
{ /* 0-base */ 0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0 };
|
||||||
|
static const UINT8 val_dc_chrominance[] =
|
||||||
|
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 };
|
||||||
|
|
||||||
|
static const UINT8 bits_ac_luminance[17] =
|
||||||
|
{ /* 0-base */ 0, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 0x7d };
|
||||||
|
static const UINT8 val_ac_luminance[] =
|
||||||
|
{ 0x01, 0x02, 0x03, 0x00, 0x04, 0x11, 0x05, 0x12,
|
||||||
|
0x21, 0x31, 0x41, 0x06, 0x13, 0x51, 0x61, 0x07,
|
||||||
|
0x22, 0x71, 0x14, 0x32, 0x81, 0x91, 0xa1, 0x08,
|
||||||
|
0x23, 0x42, 0xb1, 0xc1, 0x15, 0x52, 0xd1, 0xf0,
|
||||||
|
0x24, 0x33, 0x62, 0x72, 0x82, 0x09, 0x0a, 0x16,
|
||||||
|
0x17, 0x18, 0x19, 0x1a, 0x25, 0x26, 0x27, 0x28,
|
||||||
|
0x29, 0x2a, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39,
|
||||||
|
0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49,
|
||||||
|
0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59,
|
||||||
|
0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69,
|
||||||
|
0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79,
|
||||||
|
0x7a, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89,
|
||||||
|
0x8a, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98,
|
||||||
|
0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7,
|
||||||
|
0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6,
|
||||||
|
0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3, 0xc4, 0xc5,
|
||||||
|
0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2, 0xd3, 0xd4,
|
||||||
|
0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xe1, 0xe2,
|
||||||
|
0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea,
|
||||||
|
0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8,
|
||||||
|
0xf9, 0xfa };
|
||||||
|
|
||||||
|
static const UINT8 bits_ac_chrominance[17] =
|
||||||
|
{ /* 0-base */ 0, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 0x77 };
|
||||||
|
static const UINT8 val_ac_chrominance[] =
|
||||||
|
{ 0x00, 0x01, 0x02, 0x03, 0x11, 0x04, 0x05, 0x21,
|
||||||
|
0x31, 0x06, 0x12, 0x41, 0x51, 0x07, 0x61, 0x71,
|
||||||
|
0x13, 0x22, 0x32, 0x81, 0x08, 0x14, 0x42, 0x91,
|
||||||
|
0xa1, 0xb1, 0xc1, 0x09, 0x23, 0x33, 0x52, 0xf0,
|
||||||
|
0x15, 0x62, 0x72, 0xd1, 0x0a, 0x16, 0x24, 0x34,
|
||||||
|
0xe1, 0x25, 0xf1, 0x17, 0x18, 0x19, 0x1a, 0x26,
|
||||||
|
0x27, 0x28, 0x29, 0x2a, 0x35, 0x36, 0x37, 0x38,
|
||||||
|
0x39, 0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48,
|
||||||
|
0x49, 0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58,
|
||||||
|
0x59, 0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68,
|
||||||
|
0x69, 0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78,
|
||||||
|
0x79, 0x7a, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
|
||||||
|
0x88, 0x89, 0x8a, 0x92, 0x93, 0x94, 0x95, 0x96,
|
||||||
|
0x97, 0x98, 0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5,
|
||||||
|
0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4,
|
||||||
|
0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3,
|
||||||
|
0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2,
|
||||||
|
0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda,
|
||||||
|
0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9,
|
||||||
|
0xea, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8,
|
||||||
|
0xf9, 0xfa };
|
||||||
|
|
||||||
|
if (cinfo->is_decompressor) {
|
||||||
|
if (isDC)
|
||||||
|
htblptr = ((j_decompress_ptr) cinfo)->dc_huff_tbl_ptrs;
|
||||||
|
else
|
||||||
|
htblptr = ((j_decompress_ptr) cinfo)->ac_huff_tbl_ptrs;
|
||||||
|
} else {
|
||||||
|
if (isDC)
|
||||||
|
htblptr = ((j_compress_ptr) cinfo)->dc_huff_tbl_ptrs;
|
||||||
|
else
|
||||||
|
htblptr = ((j_compress_ptr) cinfo)->ac_huff_tbl_ptrs;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (tblno) {
|
||||||
|
case 0:
|
||||||
|
if (isDC) {
|
||||||
|
bits = bits_dc_luminance;
|
||||||
|
val = val_dc_luminance;
|
||||||
|
} else {
|
||||||
|
bits = bits_ac_luminance;
|
||||||
|
val = val_ac_luminance;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
if (isDC) {
|
||||||
|
bits = bits_dc_chrominance;
|
||||||
|
val = val_dc_chrominance;
|
||||||
|
} else {
|
||||||
|
bits = bits_ac_chrominance;
|
||||||
|
val = val_ac_chrominance;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tblno);
|
||||||
|
return NULL; /* avoid compiler warnings for uninitialized variables */
|
||||||
|
}
|
||||||
|
|
||||||
|
if (htblptr[tblno] == NULL)
|
||||||
|
htblptr[tblno] = jpeg_alloc_huff_table(cinfo);
|
||||||
|
|
||||||
|
htbl = htblptr[tblno];
|
||||||
|
|
||||||
|
/* Copy the number-of-symbols-of-each-code-length counts */
|
||||||
|
MEMCOPY(htbl->bits, bits, SIZEOF(htbl->bits));
|
||||||
|
|
||||||
|
/* Validate the counts. We do this here mainly so we can copy the right
|
||||||
|
* number of symbols from the val[] array, without risking marching off
|
||||||
|
* the end of memory. jxhuff.c will do a more thorough test later.
|
||||||
|
*/
|
||||||
|
nsymbols = 0;
|
||||||
|
for (len = 1; len <= 16; len++)
|
||||||
|
nsymbols += bits[len];
|
||||||
|
if (nsymbols > 256)
|
||||||
|
ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);
|
||||||
|
|
||||||
|
if (nsymbols > 0)
|
||||||
|
MEMCOPY(htbl->huffval, val, nsymbols * SIZEOF(UINT8));
|
||||||
|
|
||||||
|
/* Initialize sent_table FALSE so table will be written to JPEG file. */
|
||||||
|
htbl->sent_table = FALSE;
|
||||||
|
|
||||||
|
return htbl;
|
||||||
|
}
|
||||||
|
|||||||
Vendored
+11
-100
@@ -2,7 +2,7 @@
|
|||||||
* jcparam.c
|
* jcparam.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 1991-1998, Thomas G. Lane.
|
* Copyright (C) 1991-1998, Thomas G. Lane.
|
||||||
* Modified 2003-2013 by Guido Vollbeding.
|
* Modified 2003-2019 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.
|
||||||
*
|
*
|
||||||
@@ -162,112 +162,23 @@ jpeg_set_quality (j_compress_ptr cinfo, int quality, boolean force_baseline)
|
|||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Huffman table setup routines
|
* Reset standard Huffman tables
|
||||||
*/
|
*/
|
||||||
|
|
||||||
LOCAL(void)
|
|
||||||
add_huff_table (j_compress_ptr cinfo,
|
|
||||||
JHUFF_TBL **htblptr, const UINT8 *bits, const UINT8 *val)
|
|
||||||
/* Define a Huffman table */
|
|
||||||
{
|
|
||||||
int nsymbols, len;
|
|
||||||
|
|
||||||
if (*htblptr == NULL)
|
|
||||||
*htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo);
|
|
||||||
|
|
||||||
/* Copy the number-of-symbols-of-each-code-length counts */
|
|
||||||
MEMCOPY((*htblptr)->bits, bits, SIZEOF((*htblptr)->bits));
|
|
||||||
|
|
||||||
/* Validate the counts. We do this here mainly so we can copy the right
|
|
||||||
* number of symbols from the val[] array, without risking marching off
|
|
||||||
* the end of memory. jchuff.c will do a more thorough test later.
|
|
||||||
*/
|
|
||||||
nsymbols = 0;
|
|
||||||
for (len = 1; len <= 16; len++)
|
|
||||||
nsymbols += bits[len];
|
|
||||||
if (nsymbols < 1 || nsymbols > 256)
|
|
||||||
ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);
|
|
||||||
|
|
||||||
MEMCOPY((*htblptr)->huffval, val, nsymbols * SIZEOF(UINT8));
|
|
||||||
|
|
||||||
/* Initialize sent_table FALSE so table will be written to JPEG file. */
|
|
||||||
(*htblptr)->sent_table = FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
LOCAL(void)
|
LOCAL(void)
|
||||||
std_huff_tables (j_compress_ptr cinfo)
|
std_huff_tables (j_compress_ptr cinfo)
|
||||||
/* Set up the standard Huffman tables (cf. JPEG standard section K.3) */
|
|
||||||
/* IMPORTANT: these are only valid for 8-bit data precision! */
|
|
||||||
{
|
{
|
||||||
static const UINT8 bits_dc_luminance[17] =
|
if (cinfo->dc_huff_tbl_ptrs[0] != NULL)
|
||||||
{ /* 0-base */ 0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0 };
|
(void) jpeg_std_huff_table((j_common_ptr) cinfo, TRUE, 0);
|
||||||
static const UINT8 val_dc_luminance[] =
|
|
||||||
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 };
|
|
||||||
|
|
||||||
static const UINT8 bits_dc_chrominance[17] =
|
if (cinfo->ac_huff_tbl_ptrs[0] != NULL)
|
||||||
{ /* 0-base */ 0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0 };
|
(void) jpeg_std_huff_table((j_common_ptr) cinfo, FALSE, 0);
|
||||||
static const UINT8 val_dc_chrominance[] =
|
|
||||||
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 };
|
|
||||||
|
|
||||||
static const UINT8 bits_ac_luminance[17] =
|
if (cinfo->dc_huff_tbl_ptrs[1] != NULL)
|
||||||
{ /* 0-base */ 0, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 0x7d };
|
(void) jpeg_std_huff_table((j_common_ptr) cinfo, TRUE, 1);
|
||||||
static const UINT8 val_ac_luminance[] =
|
|
||||||
{ 0x01, 0x02, 0x03, 0x00, 0x04, 0x11, 0x05, 0x12,
|
|
||||||
0x21, 0x31, 0x41, 0x06, 0x13, 0x51, 0x61, 0x07,
|
|
||||||
0x22, 0x71, 0x14, 0x32, 0x81, 0x91, 0xa1, 0x08,
|
|
||||||
0x23, 0x42, 0xb1, 0xc1, 0x15, 0x52, 0xd1, 0xf0,
|
|
||||||
0x24, 0x33, 0x62, 0x72, 0x82, 0x09, 0x0a, 0x16,
|
|
||||||
0x17, 0x18, 0x19, 0x1a, 0x25, 0x26, 0x27, 0x28,
|
|
||||||
0x29, 0x2a, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39,
|
|
||||||
0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49,
|
|
||||||
0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59,
|
|
||||||
0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69,
|
|
||||||
0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79,
|
|
||||||
0x7a, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89,
|
|
||||||
0x8a, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98,
|
|
||||||
0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7,
|
|
||||||
0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6,
|
|
||||||
0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3, 0xc4, 0xc5,
|
|
||||||
0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2, 0xd3, 0xd4,
|
|
||||||
0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xe1, 0xe2,
|
|
||||||
0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea,
|
|
||||||
0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8,
|
|
||||||
0xf9, 0xfa };
|
|
||||||
|
|
||||||
static const UINT8 bits_ac_chrominance[17] =
|
if (cinfo->ac_huff_tbl_ptrs[1] != NULL)
|
||||||
{ /* 0-base */ 0, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 0x77 };
|
(void) jpeg_std_huff_table((j_common_ptr) cinfo, FALSE, 1);
|
||||||
static const UINT8 val_ac_chrominance[] =
|
|
||||||
{ 0x00, 0x01, 0x02, 0x03, 0x11, 0x04, 0x05, 0x21,
|
|
||||||
0x31, 0x06, 0x12, 0x41, 0x51, 0x07, 0x61, 0x71,
|
|
||||||
0x13, 0x22, 0x32, 0x81, 0x08, 0x14, 0x42, 0x91,
|
|
||||||
0xa1, 0xb1, 0xc1, 0x09, 0x23, 0x33, 0x52, 0xf0,
|
|
||||||
0x15, 0x62, 0x72, 0xd1, 0x0a, 0x16, 0x24, 0x34,
|
|
||||||
0xe1, 0x25, 0xf1, 0x17, 0x18, 0x19, 0x1a, 0x26,
|
|
||||||
0x27, 0x28, 0x29, 0x2a, 0x35, 0x36, 0x37, 0x38,
|
|
||||||
0x39, 0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48,
|
|
||||||
0x49, 0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58,
|
|
||||||
0x59, 0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68,
|
|
||||||
0x69, 0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78,
|
|
||||||
0x79, 0x7a, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
|
|
||||||
0x88, 0x89, 0x8a, 0x92, 0x93, 0x94, 0x95, 0x96,
|
|
||||||
0x97, 0x98, 0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5,
|
|
||||||
0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4,
|
|
||||||
0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3,
|
|
||||||
0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2,
|
|
||||||
0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda,
|
|
||||||
0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9,
|
|
||||||
0xea, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8,
|
|
||||||
0xf9, 0xfa };
|
|
||||||
|
|
||||||
add_huff_table(cinfo, &cinfo->dc_huff_tbl_ptrs[0],
|
|
||||||
bits_dc_luminance, val_dc_luminance);
|
|
||||||
add_huff_table(cinfo, &cinfo->ac_huff_tbl_ptrs[0],
|
|
||||||
bits_ac_luminance, val_ac_luminance);
|
|
||||||
add_huff_table(cinfo, &cinfo->dc_huff_tbl_ptrs[1],
|
|
||||||
bits_dc_chrominance, val_dc_chrominance);
|
|
||||||
add_huff_table(cinfo, &cinfo->ac_huff_tbl_ptrs[1],
|
|
||||||
bits_ac_chrominance, val_ac_chrominance);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -306,7 +217,7 @@ jpeg_set_defaults (j_compress_ptr cinfo)
|
|||||||
cinfo->data_precision = BITS_IN_JSAMPLE;
|
cinfo->data_precision = BITS_IN_JSAMPLE;
|
||||||
/* Set up two quantization tables using default quality of 75 */
|
/* Set up two quantization tables using default quality of 75 */
|
||||||
jpeg_set_quality(cinfo, 75, TRUE);
|
jpeg_set_quality(cinfo, 75, TRUE);
|
||||||
/* Set up two Huffman tables */
|
/* Reset standard Huffman tables */
|
||||||
std_huff_tables(cinfo);
|
std_huff_tables(cinfo);
|
||||||
|
|
||||||
/* Initialize default arithmetic coding conditioning */
|
/* Initialize default arithmetic coding conditioning */
|
||||||
|
|||||||
Vendored
+13
-13
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* jdarith.c
|
* jdarith.c
|
||||||
*
|
*
|
||||||
* Developed 1997-2015 by Guido Vollbeding.
|
* Developed 1997-2019 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.
|
||||||
*
|
*
|
||||||
@@ -280,7 +280,7 @@ decode_mcu_DC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
|
|||||||
if ((m = arith_decode(cinfo, st)) != 0) {
|
if ((m = arith_decode(cinfo, st)) != 0) {
|
||||||
st = entropy->dc_stats[tbl] + 20; /* Table F.4: X1 = 20 */
|
st = entropy->dc_stats[tbl] + 20; /* Table F.4: X1 = 20 */
|
||||||
while (arith_decode(cinfo, st)) {
|
while (arith_decode(cinfo, st)) {
|
||||||
if ((m <<= 1) == 0x8000) {
|
if ((m <<= 1) == (int) 0x8000U) {
|
||||||
WARNMS(cinfo, JWRN_ARITH_BAD_CODE);
|
WARNMS(cinfo, JWRN_ARITH_BAD_CODE);
|
||||||
entropy->ct = -1; /* magnitude overflow */
|
entropy->ct = -1; /* magnitude overflow */
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@@ -370,7 +370,7 @@ decode_mcu_AC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
|
|||||||
st = entropy->ac_stats[tbl] +
|
st = entropy->ac_stats[tbl] +
|
||||||
(k <= cinfo->arith_ac_K[tbl] ? 189 : 217);
|
(k <= cinfo->arith_ac_K[tbl] ? 189 : 217);
|
||||||
while (arith_decode(cinfo, st)) {
|
while (arith_decode(cinfo, st)) {
|
||||||
if ((m <<= 1) == 0x8000) {
|
if ((m <<= 1) == (int) 0x8000U) {
|
||||||
WARNMS(cinfo, JWRN_ARITH_BAD_CODE);
|
WARNMS(cinfo, JWRN_ARITH_BAD_CODE);
|
||||||
entropy->ct = -1; /* magnitude overflow */
|
entropy->ct = -1; /* magnitude overflow */
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@@ -404,7 +404,8 @@ decode_mcu_DC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
|
|||||||
{
|
{
|
||||||
arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;
|
arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;
|
||||||
unsigned char *st;
|
unsigned char *st;
|
||||||
int p1, blkn;
|
JCOEF p1;
|
||||||
|
int blkn;
|
||||||
|
|
||||||
/* Process restart marker if needed */
|
/* Process restart marker if needed */
|
||||||
if (cinfo->restart_interval) {
|
if (cinfo->restart_interval) {
|
||||||
@@ -440,7 +441,7 @@ decode_mcu_AC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
|
|||||||
JCOEFPTR thiscoef;
|
JCOEFPTR thiscoef;
|
||||||
unsigned char *st;
|
unsigned char *st;
|
||||||
int tbl, k, kex;
|
int tbl, k, kex;
|
||||||
int p1, m1;
|
JCOEF p1, m1;
|
||||||
const int * natural_order;
|
const int * natural_order;
|
||||||
|
|
||||||
/* Process restart marker if needed */
|
/* Process restart marker if needed */
|
||||||
@@ -459,7 +460,7 @@ decode_mcu_AC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
|
|||||||
tbl = cinfo->cur_comp_info[0]->ac_tbl_no;
|
tbl = cinfo->cur_comp_info[0]->ac_tbl_no;
|
||||||
|
|
||||||
p1 = 1 << cinfo->Al; /* 1 in the bit position being coded */
|
p1 = 1 << cinfo->Al; /* 1 in the bit position being coded */
|
||||||
m1 = (-1) << cinfo->Al; /* -1 in the bit position being coded */
|
m1 = -p1; /* -1 in the bit position being coded */
|
||||||
|
|
||||||
/* Establish EOBx (previous stage end-of-block) index */
|
/* Establish EOBx (previous stage end-of-block) index */
|
||||||
kex = cinfo->Se;
|
kex = cinfo->Se;
|
||||||
@@ -555,7 +556,7 @@ decode_mcu (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
|
|||||||
if ((m = arith_decode(cinfo, st)) != 0) {
|
if ((m = arith_decode(cinfo, st)) != 0) {
|
||||||
st = entropy->dc_stats[tbl] + 20; /* Table F.4: X1 = 20 */
|
st = entropy->dc_stats[tbl] + 20; /* Table F.4: X1 = 20 */
|
||||||
while (arith_decode(cinfo, st)) {
|
while (arith_decode(cinfo, st)) {
|
||||||
if ((m <<= 1) == 0x8000) {
|
if ((m <<= 1) == (int) 0x8000U) {
|
||||||
WARNMS(cinfo, JWRN_ARITH_BAD_CODE);
|
WARNMS(cinfo, JWRN_ARITH_BAD_CODE);
|
||||||
entropy->ct = -1; /* magnitude overflow */
|
entropy->ct = -1; /* magnitude overflow */
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@@ -612,7 +613,7 @@ decode_mcu (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
|
|||||||
st = entropy->ac_stats[tbl] +
|
st = entropy->ac_stats[tbl] +
|
||||||
(k <= cinfo->arith_ac_K[tbl] ? 189 : 217);
|
(k <= cinfo->arith_ac_K[tbl] ? 189 : 217);
|
||||||
while (arith_decode(cinfo, st)) {
|
while (arith_decode(cinfo, st)) {
|
||||||
if ((m <<= 1) == 0x8000) {
|
if ((m <<= 1) == (int) 0x8000U) {
|
||||||
WARNMS(cinfo, JWRN_ARITH_BAD_CODE);
|
WARNMS(cinfo, JWRN_ARITH_BAD_CODE);
|
||||||
entropy->ct = -1; /* magnitude overflow */
|
entropy->ct = -1; /* magnitude overflow */
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@@ -766,9 +767,8 @@ jinit_arith_decoder (j_decompress_ptr cinfo)
|
|||||||
arith_entropy_ptr entropy;
|
arith_entropy_ptr entropy;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
entropy = (arith_entropy_ptr)
|
entropy = (arith_entropy_ptr) (*cinfo->mem->alloc_small)
|
||||||
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
|
((j_common_ptr) cinfo, JPOOL_IMAGE, SIZEOF(arith_entropy_decoder));
|
||||||
SIZEOF(arith_entropy_decoder));
|
|
||||||
cinfo->entropy = &entropy->pub;
|
cinfo->entropy = &entropy->pub;
|
||||||
entropy->pub.start_pass = start_pass;
|
entropy->pub.start_pass = start_pass;
|
||||||
entropy->pub.finish_pass = finish_pass;
|
entropy->pub.finish_pass = finish_pass;
|
||||||
@@ -785,8 +785,8 @@ jinit_arith_decoder (j_decompress_ptr cinfo)
|
|||||||
if (cinfo->progressive_mode) {
|
if (cinfo->progressive_mode) {
|
||||||
/* Create progression status table */
|
/* Create progression status table */
|
||||||
int *coef_bit_ptr, ci;
|
int *coef_bit_ptr, ci;
|
||||||
cinfo->coef_bits = (int (*)[DCTSIZE2])
|
cinfo->coef_bits = (int (*)[DCTSIZE2]) (*cinfo->mem->alloc_small)
|
||||||
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
|
((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++)
|
||||||
|
|||||||
Vendored
+10
-13
@@ -2,7 +2,7 @@
|
|||||||
* jdatadst.c
|
* jdatadst.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 1994-1996, Thomas G. Lane.
|
* Copyright (C) 1994-1996, Thomas G. Lane.
|
||||||
* Modified 2009-2017 by Guido Vollbeding.
|
* Modified 2009-2019 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 @@ typedef struct {
|
|||||||
struct jpeg_destination_mgr pub; /* public fields */
|
struct jpeg_destination_mgr pub; /* public fields */
|
||||||
|
|
||||||
unsigned char ** outbuffer; /* target buffer */
|
unsigned char ** outbuffer; /* target buffer */
|
||||||
unsigned long * outsize;
|
size_t * outsize;
|
||||||
unsigned char * newbuffer; /* newly allocated buffer */
|
unsigned char * newbuffer; /* newly allocated buffer */
|
||||||
JOCTET * buffer; /* start of buffer */
|
JOCTET * buffer; /* start of buffer */
|
||||||
size_t bufsize;
|
size_t bufsize;
|
||||||
@@ -66,9 +66,8 @@ init_destination (j_compress_ptr cinfo)
|
|||||||
my_dest_ptr dest = (my_dest_ptr) cinfo->dest;
|
my_dest_ptr dest = (my_dest_ptr) cinfo->dest;
|
||||||
|
|
||||||
/* Allocate the output buffer --- it will be released when done with image */
|
/* Allocate the output buffer --- it will be released when done with image */
|
||||||
dest->buffer = (JOCTET *)
|
dest->buffer = (JOCTET *) (*cinfo->mem->alloc_small)
|
||||||
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
|
((j_common_ptr) cinfo, JPOOL_IMAGE, OUTPUT_BUF_SIZE * SIZEOF(JOCTET));
|
||||||
OUTPUT_BUF_SIZE * SIZEOF(JOCTET));
|
|
||||||
|
|
||||||
dest->pub.next_output_byte = dest->buffer;
|
dest->pub.next_output_byte = dest->buffer;
|
||||||
dest->pub.free_in_buffer = OUTPUT_BUF_SIZE;
|
dest->pub.free_in_buffer = OUTPUT_BUF_SIZE;
|
||||||
@@ -131,7 +130,7 @@ empty_mem_output_buffer (j_compress_ptr cinfo)
|
|||||||
nextbuffer = (JOCTET *) malloc(nextsize);
|
nextbuffer = (JOCTET *) malloc(nextsize);
|
||||||
|
|
||||||
if (nextbuffer == NULL)
|
if (nextbuffer == NULL)
|
||||||
ERREXIT1(cinfo, JERR_OUT_OF_MEMORY, 10);
|
ERREXIT1(cinfo, JERR_OUT_OF_MEMORY, 11);
|
||||||
|
|
||||||
MEMCOPY(nextbuffer, dest->buffer, dest->bufsize);
|
MEMCOPY(nextbuffer, dest->buffer, dest->bufsize);
|
||||||
|
|
||||||
@@ -204,9 +203,8 @@ jpeg_stdio_dest (j_compress_ptr cinfo, FILE * outfile)
|
|||||||
* sizes may be different. Caveat programmer.
|
* sizes may be different. Caveat programmer.
|
||||||
*/
|
*/
|
||||||
if (cinfo->dest == NULL) { /* first time for this JPEG object? */
|
if (cinfo->dest == NULL) { /* first time for this JPEG object? */
|
||||||
cinfo->dest = (struct jpeg_destination_mgr *)
|
cinfo->dest = (struct jpeg_destination_mgr *) (*cinfo->mem->alloc_small)
|
||||||
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
|
((j_common_ptr) cinfo, JPOOL_PERMANENT, SIZEOF(my_destination_mgr));
|
||||||
SIZEOF(my_destination_mgr));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
dest = (my_dest_ptr) cinfo->dest;
|
dest = (my_dest_ptr) cinfo->dest;
|
||||||
@@ -233,7 +231,7 @@ 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 long * outsize)
|
unsigned char ** outbuffer, size_t * outsize)
|
||||||
{
|
{
|
||||||
my_mem_dest_ptr dest;
|
my_mem_dest_ptr dest;
|
||||||
|
|
||||||
@@ -244,9 +242,8 @@ jpeg_mem_dest (j_compress_ptr cinfo,
|
|||||||
* can be written to the same buffer without re-executing jpeg_mem_dest.
|
* can be written to the same buffer without re-executing jpeg_mem_dest.
|
||||||
*/
|
*/
|
||||||
if (cinfo->dest == NULL) { /* first time for this JPEG object? */
|
if (cinfo->dest == NULL) { /* first time for this JPEG object? */
|
||||||
cinfo->dest = (struct jpeg_destination_mgr *)
|
cinfo->dest = (struct jpeg_destination_mgr *) (*cinfo->mem->alloc_small)
|
||||||
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
|
((j_common_ptr) cinfo, JPOOL_PERMANENT, SIZEOF(my_mem_destination_mgr));
|
||||||
SIZEOF(my_mem_destination_mgr));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
dest = (my_mem_dest_ptr) cinfo->dest;
|
dest = (my_mem_dest_ptr) cinfo->dest;
|
||||||
|
|||||||
Vendored
+15
-16
@@ -2,7 +2,7 @@
|
|||||||
* jdatasrc.c
|
* jdatasrc.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 1994-1996, Thomas G. Lane.
|
* Copyright (C) 1994-1996, Thomas G. Lane.
|
||||||
* Modified 2009-2015 by Guido Vollbeding.
|
* Modified 2009-2019 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.
|
||||||
*
|
*
|
||||||
@@ -156,21 +156,23 @@ METHODDEF(void)
|
|||||||
skip_input_data (j_decompress_ptr cinfo, long num_bytes)
|
skip_input_data (j_decompress_ptr cinfo, long num_bytes)
|
||||||
{
|
{
|
||||||
struct jpeg_source_mgr * src = cinfo->src;
|
struct jpeg_source_mgr * src = cinfo->src;
|
||||||
|
size_t nbytes;
|
||||||
|
|
||||||
/* Just a dumb implementation for now. Could use fseek() except
|
/* Just a dumb implementation for now. Could use fseek() except
|
||||||
* it doesn't work on pipes. Not clear that being smart is worth
|
* it doesn't work on pipes. Not clear that being smart is worth
|
||||||
* any trouble anyway --- large skips are infrequent.
|
* any trouble anyway --- large skips are infrequent.
|
||||||
*/
|
*/
|
||||||
if (num_bytes > 0) {
|
if (num_bytes > 0) {
|
||||||
while (num_bytes > (long) src->bytes_in_buffer) {
|
nbytes = (size_t) num_bytes;
|
||||||
num_bytes -= (long) src->bytes_in_buffer;
|
while (nbytes > src->bytes_in_buffer) {
|
||||||
|
nbytes -= src->bytes_in_buffer;
|
||||||
(void) (*src->fill_input_buffer) (cinfo);
|
(void) (*src->fill_input_buffer) (cinfo);
|
||||||
/* note we assume that fill_input_buffer will never return FALSE,
|
/* note we assume that fill_input_buffer will never return FALSE,
|
||||||
* so suspension need not be handled.
|
* so suspension need not be handled.
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
src->next_input_byte += (size_t) num_bytes;
|
src->next_input_byte += nbytes;
|
||||||
src->bytes_in_buffer -= (size_t) num_bytes;
|
src->bytes_in_buffer -= nbytes;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -219,13 +221,11 @@ jpeg_stdio_src (j_decompress_ptr cinfo, FILE * infile)
|
|||||||
* manager serially with the same JPEG object. Caveat programmer.
|
* manager serially with the same JPEG object. Caveat programmer.
|
||||||
*/
|
*/
|
||||||
if (cinfo->src == NULL) { /* first time for this JPEG object? */
|
if (cinfo->src == NULL) { /* first time for this JPEG object? */
|
||||||
cinfo->src = (struct jpeg_source_mgr *)
|
cinfo->src = (struct jpeg_source_mgr *) (*cinfo->mem->alloc_small)
|
||||||
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
|
((j_common_ptr) cinfo, JPOOL_PERMANENT, SIZEOF(my_source_mgr));
|
||||||
SIZEOF(my_source_mgr));
|
|
||||||
src = (my_src_ptr) cinfo->src;
|
src = (my_src_ptr) cinfo->src;
|
||||||
src->buffer = (JOCTET *)
|
src->buffer = (JOCTET *) (*cinfo->mem->alloc_small)
|
||||||
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
|
((j_common_ptr) cinfo, JPOOL_PERMANENT, INPUT_BUF_SIZE * SIZEOF(JOCTET));
|
||||||
INPUT_BUF_SIZE * SIZEOF(JOCTET));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
src = (my_src_ptr) cinfo->src;
|
src = (my_src_ptr) cinfo->src;
|
||||||
@@ -247,7 +247,7 @@ 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, unsigned long insize)
|
const unsigned char * inbuffer, size_t insize)
|
||||||
{
|
{
|
||||||
struct jpeg_source_mgr * src;
|
struct jpeg_source_mgr * src;
|
||||||
|
|
||||||
@@ -259,9 +259,8 @@ jpeg_mem_src (j_decompress_ptr cinfo,
|
|||||||
* the first one.
|
* the first one.
|
||||||
*/
|
*/
|
||||||
if (cinfo->src == NULL) { /* first time for this JPEG object? */
|
if (cinfo->src == NULL) { /* first time for this JPEG object? */
|
||||||
cinfo->src = (struct jpeg_source_mgr *)
|
cinfo->src = (struct jpeg_source_mgr *) (*cinfo->mem->alloc_small)
|
||||||
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
|
((j_common_ptr) cinfo, JPOOL_PERMANENT, SIZEOF(struct jpeg_source_mgr));
|
||||||
SIZEOF(struct jpeg_source_mgr));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
src = cinfo->src;
|
src = cinfo->src;
|
||||||
@@ -270,6 +269,6 @@ jpeg_mem_src (j_decompress_ptr cinfo,
|
|||||||
src->skip_input_data = skip_input_data;
|
src->skip_input_data = skip_input_data;
|
||||||
src->resync_to_restart = jpeg_resync_to_restart; /* use default method */
|
src->resync_to_restart = jpeg_resync_to_restart; /* use default method */
|
||||||
src->term_source = term_source;
|
src->term_source = term_source;
|
||||||
src->bytes_in_buffer = (size_t) insize;
|
src->bytes_in_buffer = insize;
|
||||||
src->next_input_byte = (const JOCTET *) inbuffer;
|
src->next_input_byte = (const JOCTET *) inbuffer;
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+49
-61
@@ -2,7 +2,7 @@
|
|||||||
* jdcolor.c
|
* jdcolor.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 1991-1997, Thomas G. Lane.
|
* Copyright (C) 1991-1997, Thomas G. Lane.
|
||||||
* Modified 2011-2017 by Guido Vollbeding.
|
* Modified 2011-2019 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.
|
||||||
*
|
*
|
||||||
@@ -124,28 +124,22 @@ build_ycc_rgb_table (j_decompress_ptr cinfo)
|
|||||||
INT32 x;
|
INT32 x;
|
||||||
SHIFT_TEMPS
|
SHIFT_TEMPS
|
||||||
|
|
||||||
cconvert->Cr_r_tab = (int *)
|
cconvert->Cr_r_tab = (int *) (*cinfo->mem->alloc_small)
|
||||||
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
|
((j_common_ptr) cinfo, JPOOL_IMAGE, (MAXJSAMPLE+1) * SIZEOF(int));
|
||||||
(MAXJSAMPLE+1) * SIZEOF(int));
|
cconvert->Cb_b_tab = (int *) (*cinfo->mem->alloc_small)
|
||||||
cconvert->Cb_b_tab = (int *)
|
((j_common_ptr) cinfo, JPOOL_IMAGE, (MAXJSAMPLE+1) * SIZEOF(int));
|
||||||
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
|
cconvert->Cr_g_tab = (INT32 *) (*cinfo->mem->alloc_small)
|
||||||
(MAXJSAMPLE+1) * SIZEOF(int));
|
((j_common_ptr) cinfo, JPOOL_IMAGE, (MAXJSAMPLE+1) * SIZEOF(INT32));
|
||||||
cconvert->Cr_g_tab = (INT32 *)
|
cconvert->Cb_g_tab = (INT32 *) (*cinfo->mem->alloc_small)
|
||||||
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
|
((j_common_ptr) cinfo, JPOOL_IMAGE, (MAXJSAMPLE+1) * SIZEOF(INT32));
|
||||||
(MAXJSAMPLE+1) * SIZEOF(INT32));
|
|
||||||
cconvert->Cb_g_tab = (INT32 *)
|
|
||||||
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
|
|
||||||
(MAXJSAMPLE+1) * SIZEOF(INT32));
|
|
||||||
|
|
||||||
for (i = 0, x = -CENTERJSAMPLE; i <= MAXJSAMPLE; i++, x++) {
|
for (i = 0, x = -CENTERJSAMPLE; i <= MAXJSAMPLE; i++, x++) {
|
||||||
/* i is the actual input pixel value, in the range 0..MAXJSAMPLE */
|
/* i is the actual input pixel value, in the range 0..MAXJSAMPLE */
|
||||||
/* The Cb or Cr value we are thinking of is x = i - CENTERJSAMPLE */
|
/* The Cb or Cr value we are thinking of is x = i - CENTERJSAMPLE */
|
||||||
/* Cr=>R value is nearest int to 1.402 * x */
|
/* Cr=>R value is nearest int to 1.402 * x */
|
||||||
cconvert->Cr_r_tab[i] = (int)
|
cconvert->Cr_r_tab[i] = (int) DESCALE(FIX(1.402) * x, SCALEBITS);
|
||||||
RIGHT_SHIFT(FIX(1.402) * x + ONE_HALF, SCALEBITS);
|
|
||||||
/* Cb=>B value is nearest int to 1.772 * x */
|
/* Cb=>B value is nearest int to 1.772 * x */
|
||||||
cconvert->Cb_b_tab[i] = (int)
|
cconvert->Cb_b_tab[i] = (int) DESCALE(FIX(1.772) * x, SCALEBITS);
|
||||||
RIGHT_SHIFT(FIX(1.772) * x + ONE_HALF, SCALEBITS);
|
|
||||||
/* Cr=>G value is scaled-up -0.714136286 * x */
|
/* Cr=>G value is scaled-up -0.714136286 * x */
|
||||||
cconvert->Cr_g_tab[i] = (- FIX(0.714136286)) * x;
|
cconvert->Cr_g_tab[i] = (- FIX(0.714136286)) * x;
|
||||||
/* Cb=>G value is scaled-up -0.344136286 * x */
|
/* Cb=>G value is scaled-up -0.344136286 * x */
|
||||||
@@ -164,28 +158,22 @@ build_bg_ycc_rgb_table (j_decompress_ptr cinfo)
|
|||||||
INT32 x;
|
INT32 x;
|
||||||
SHIFT_TEMPS
|
SHIFT_TEMPS
|
||||||
|
|
||||||
cconvert->Cr_r_tab = (int *)
|
cconvert->Cr_r_tab = (int *) (*cinfo->mem->alloc_small)
|
||||||
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
|
((j_common_ptr) cinfo, JPOOL_IMAGE, (MAXJSAMPLE+1) * SIZEOF(int));
|
||||||
(MAXJSAMPLE+1) * SIZEOF(int));
|
cconvert->Cb_b_tab = (int *) (*cinfo->mem->alloc_small)
|
||||||
cconvert->Cb_b_tab = (int *)
|
((j_common_ptr) cinfo, JPOOL_IMAGE, (MAXJSAMPLE+1) * SIZEOF(int));
|
||||||
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
|
cconvert->Cr_g_tab = (INT32 *) (*cinfo->mem->alloc_small)
|
||||||
(MAXJSAMPLE+1) * SIZEOF(int));
|
((j_common_ptr) cinfo, JPOOL_IMAGE, (MAXJSAMPLE+1) * SIZEOF(INT32));
|
||||||
cconvert->Cr_g_tab = (INT32 *)
|
cconvert->Cb_g_tab = (INT32 *) (*cinfo->mem->alloc_small)
|
||||||
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
|
((j_common_ptr) cinfo, JPOOL_IMAGE, (MAXJSAMPLE+1) * SIZEOF(INT32));
|
||||||
(MAXJSAMPLE+1) * SIZEOF(INT32));
|
|
||||||
cconvert->Cb_g_tab = (INT32 *)
|
|
||||||
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
|
|
||||||
(MAXJSAMPLE+1) * SIZEOF(INT32));
|
|
||||||
|
|
||||||
for (i = 0, x = -CENTERJSAMPLE; i <= MAXJSAMPLE; i++, x++) {
|
for (i = 0, x = -CENTERJSAMPLE; i <= MAXJSAMPLE; i++, x++) {
|
||||||
/* i is the actual input pixel value, in the range 0..MAXJSAMPLE */
|
/* i is the actual input pixel value, in the range 0..MAXJSAMPLE */
|
||||||
/* The Cb or Cr value we are thinking of is x = i - CENTERJSAMPLE */
|
/* The Cb or Cr value we are thinking of is x = i - CENTERJSAMPLE */
|
||||||
/* Cr=>R value is nearest int to 2.804 * x */
|
/* Cr=>R value is nearest int to 2.804 * x */
|
||||||
cconvert->Cr_r_tab[i] = (int)
|
cconvert->Cr_r_tab[i] = (int) DESCALE(FIX(2.804) * x, SCALEBITS);
|
||||||
RIGHT_SHIFT(FIX(2.804) * x + ONE_HALF, SCALEBITS);
|
|
||||||
/* Cb=>B value is nearest int to 3.544 * x */
|
/* Cb=>B value is nearest int to 3.544 * x */
|
||||||
cconvert->Cb_b_tab[i] = (int)
|
cconvert->Cb_b_tab[i] = (int) DESCALE(FIX(3.544) * x, SCALEBITS);
|
||||||
RIGHT_SHIFT(FIX(3.544) * x + ONE_HALF, SCALEBITS);
|
|
||||||
/* Cr=>G value is scaled-up -1.428272572 * x */
|
/* Cr=>G value is scaled-up -1.428272572 * x */
|
||||||
cconvert->Cr_g_tab[i] = (- FIX(1.428272572)) * x;
|
cconvert->Cr_g_tab[i] = (- FIX(1.428272572)) * x;
|
||||||
/* Cb=>G value is scaled-up -0.688272572 * x */
|
/* Cb=>G value is scaled-up -0.688272572 * x */
|
||||||
@@ -201,6 +189,7 @@ build_bg_ycc_rgb_table (j_decompress_ptr cinfo)
|
|||||||
* Note that we change from noninterleaved, one-plane-per-component format
|
* Note that we change from noninterleaved, one-plane-per-component format
|
||||||
* to interleaved-pixel format. The output buffer is therefore three times
|
* to interleaved-pixel format. The output buffer is therefore three times
|
||||||
* as wide as the input buffer.
|
* as wide as the input buffer.
|
||||||
|
*
|
||||||
* A starting row offset is provided only for the input buffer. The caller
|
* A starting row offset is provided only for the input buffer. The caller
|
||||||
* can easily adjust the passed output_buf value to accommodate any row
|
* can easily adjust the passed output_buf value to accommodate any row
|
||||||
* offset required on that side.
|
* offset required on that side.
|
||||||
@@ -264,9 +253,8 @@ build_rgb_y_table (j_decompress_ptr cinfo)
|
|||||||
INT32 i;
|
INT32 i;
|
||||||
|
|
||||||
/* Allocate and fill in the conversion tables. */
|
/* Allocate and fill in the conversion tables. */
|
||||||
cconvert->rgb_y_tab = rgb_y_tab = (INT32 *)
|
cconvert->rgb_y_tab = rgb_y_tab = (INT32 *) (*cinfo->mem->alloc_small)
|
||||||
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
|
((j_common_ptr) cinfo, JPOOL_IMAGE, TABLE_SIZE * SIZEOF(INT32));
|
||||||
(TABLE_SIZE * SIZEOF(INT32)));
|
|
||||||
|
|
||||||
for (i = 0; i <= MAXJSAMPLE; i++) {
|
for (i = 0; i <= MAXJSAMPLE; i++) {
|
||||||
rgb_y_tab[i+R_Y_OFF] = FIX(0.299) * i;
|
rgb_y_tab[i+R_Y_OFF] = FIX(0.299) * i;
|
||||||
@@ -286,8 +274,8 @@ rgb_gray_convert (j_decompress_ptr cinfo,
|
|||||||
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 INT32 * ctab = cconvert->rgb_y_tab;
|
|
||||||
register int r, g, b;
|
register int r, g, b;
|
||||||
|
register INT32 * ctab = cconvert->rgb_y_tab;
|
||||||
register JSAMPROW outptr;
|
register JSAMPROW outptr;
|
||||||
register JSAMPROW inptr0, inptr1, inptr2;
|
register JSAMPROW inptr0, inptr1, inptr2;
|
||||||
register JDIMENSION col;
|
register JDIMENSION col;
|
||||||
@@ -313,6 +301,7 @@ rgb_gray_convert (j_decompress_ptr cinfo,
|
|||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
* Convert some rows of samples to the output colorspace.
|
||||||
* [R-G,G,B-G] to [R,G,B] conversion with modulo calculation
|
* [R-G,G,B-G] to [R,G,B] conversion with modulo calculation
|
||||||
* (inverse color transform).
|
* (inverse color transform).
|
||||||
* This can be seen as an adaption of the general YCbCr->RGB
|
* This can be seen as an adaption of the general YCbCr->RGB
|
||||||
@@ -364,8 +353,8 @@ rgb1_gray_convert (j_decompress_ptr cinfo,
|
|||||||
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 INT32 * ctab = cconvert->rgb_y_tab;
|
|
||||||
register int r, g, b;
|
register int r, g, b;
|
||||||
|
register INT32 * ctab = cconvert->rgb_y_tab;
|
||||||
register JSAMPROW outptr;
|
register JSAMPROW outptr;
|
||||||
register JSAMPROW inptr0, inptr1, inptr2;
|
register JSAMPROW inptr0, inptr1, inptr2;
|
||||||
register JDIMENSION col;
|
register JDIMENSION col;
|
||||||
@@ -396,6 +385,7 @@ rgb1_gray_convert (j_decompress_ptr cinfo,
|
|||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
* Convert some rows of samples to the output colorspace.
|
||||||
* No colorspace change, but conversion from separate-planes
|
* No colorspace change, but conversion from separate-planes
|
||||||
* to interleaved representation.
|
* to interleaved representation.
|
||||||
*/
|
*/
|
||||||
@@ -430,6 +420,7 @@ rgb_convert (j_decompress_ptr cinfo,
|
|||||||
/*
|
/*
|
||||||
* Color conversion for no colorspace change: just copy the data,
|
* Color conversion for no colorspace change: just copy the data,
|
||||||
* converting from separate-planes to interleaved representation.
|
* converting from separate-planes to interleaved representation.
|
||||||
|
* We assume out_color_components == num_components.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
METHODDEF(void)
|
METHODDEF(void)
|
||||||
@@ -437,20 +428,21 @@ null_convert (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)
|
||||||
{
|
{
|
||||||
int ci;
|
|
||||||
register int nc = cinfo->num_components;
|
|
||||||
register JSAMPROW outptr;
|
register JSAMPROW outptr;
|
||||||
register JSAMPROW inptr;
|
register JSAMPROW inptr;
|
||||||
register JDIMENSION col;
|
register JDIMENSION count;
|
||||||
|
register int num_comps = cinfo->num_components;
|
||||||
JDIMENSION num_cols = cinfo->output_width;
|
JDIMENSION num_cols = cinfo->output_width;
|
||||||
|
int ci;
|
||||||
|
|
||||||
while (--num_rows >= 0) {
|
while (--num_rows >= 0) {
|
||||||
for (ci = 0; ci < nc; ci++) {
|
/* It seems fastest to make a separate pass for each component. */
|
||||||
|
for (ci = 0; ci < num_comps; ci++) {
|
||||||
inptr = input_buf[ci][input_row];
|
inptr = input_buf[ci][input_row];
|
||||||
outptr = output_buf[0] + ci;
|
outptr = output_buf[0] + ci;
|
||||||
for (col = 0; col < num_cols; col++) {
|
for (count = num_cols; count > 0; count--) {
|
||||||
*outptr = *inptr++; /* needn't bother with GETJSAMPLE() here */
|
*outptr = *inptr++; /* don't need GETJSAMPLE() here */
|
||||||
outptr += nc;
|
outptr += num_comps;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
input_row++;
|
input_row++;
|
||||||
@@ -504,9 +496,10 @@ gray_rgb_convert (j_decompress_ptr cinfo,
|
|||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Adobe-style YCCK->CMYK conversion.
|
* Convert some rows of samples to the output colorspace.
|
||||||
* We convert YCbCr to R=1-C, G=1-M, and B=1-Y using the same
|
* This version handles Adobe-style YCCK->CMYK conversion,
|
||||||
* conversion as above, while passing K (black) unchanged.
|
* where we convert YCbCr to R=1-C, G=1-M, and B=1-Y using the
|
||||||
|
* same conversion as above, while passing K (black) unchanged.
|
||||||
* We assume build_ycc_rgb_table has been called.
|
* We assume build_ycc_rgb_table has been called.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -577,9 +570,8 @@ jinit_color_deconverter (j_decompress_ptr cinfo)
|
|||||||
my_cconvert_ptr cconvert;
|
my_cconvert_ptr cconvert;
|
||||||
int ci;
|
int ci;
|
||||||
|
|
||||||
cconvert = (my_cconvert_ptr)
|
cconvert = (my_cconvert_ptr) (*cinfo->mem->alloc_small)
|
||||||
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
|
((j_common_ptr) cinfo, JPOOL_IMAGE, SIZEOF(my_color_deconverter));
|
||||||
SIZEOF(my_color_deconverter));
|
|
||||||
cinfo->cconvert = &cconvert->pub;
|
cinfo->cconvert = &cconvert->pub;
|
||||||
cconvert->pub.start_pass = start_pass_dcolor;
|
cconvert->pub.start_pass = start_pass_dcolor;
|
||||||
|
|
||||||
@@ -607,7 +599,6 @@ jinit_color_deconverter (j_decompress_ptr cinfo)
|
|||||||
default: /* JCS_UNKNOWN can be anything */
|
default: /* JCS_UNKNOWN can be anything */
|
||||||
if (cinfo->num_components < 1)
|
if (cinfo->num_components < 1)
|
||||||
ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
|
ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Support color transform only for RGB colorspaces */
|
/* Support color transform only for RGB colorspaces */
|
||||||
@@ -684,7 +675,8 @@ jinit_color_deconverter (j_decompress_ptr cinfo)
|
|||||||
|
|
||||||
case JCS_BG_RGB:
|
case JCS_BG_RGB:
|
||||||
cinfo->out_color_components = RGB_PIXELSIZE;
|
cinfo->out_color_components = RGB_PIXELSIZE;
|
||||||
if (cinfo->jpeg_color_space == JCS_BG_RGB) {
|
if (cinfo->jpeg_color_space != JCS_BG_RGB)
|
||||||
|
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
|
||||||
switch (cinfo->color_transform) {
|
switch (cinfo->color_transform) {
|
||||||
case JCT_NONE:
|
case JCT_NONE:
|
||||||
cconvert->pub.color_convert = rgb_convert;
|
cconvert->pub.color_convert = rgb_convert;
|
||||||
@@ -695,8 +687,6 @@ jinit_color_deconverter (j_decompress_ptr cinfo)
|
|||||||
default:
|
default:
|
||||||
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
|
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
|
||||||
}
|
}
|
||||||
} else
|
|
||||||
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case JCS_CMYK:
|
case JCS_CMYK:
|
||||||
@@ -714,14 +704,12 @@ jinit_color_deconverter (j_decompress_ptr cinfo)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default: /* permit null conversion to same output space */
|
||||||
/* Permit null conversion to same output space */
|
if (cinfo->out_color_space != cinfo->jpeg_color_space)
|
||||||
if (cinfo->out_color_space == cinfo->jpeg_color_space) {
|
/* unsupported non-null conversion */
|
||||||
|
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
|
||||||
cinfo->out_color_components = cinfo->num_components;
|
cinfo->out_color_components = cinfo->num_components;
|
||||||
cconvert->pub.color_convert = null_convert;
|
cconvert->pub.color_convert = null_convert;
|
||||||
} else /* unsupported non-null conversion */
|
|
||||||
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cinfo->quantize_colors)
|
if (cinfo->quantize_colors)
|
||||||
|
|||||||
Vendored
+1
-8
@@ -2,7 +2,7 @@
|
|||||||
* jdct.h
|
* jdct.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 1994-1996, Thomas G. Lane.
|
* Copyright (C) 1994-1996, Thomas G. Lane.
|
||||||
* Modified 2002-2017 by Guido Vollbeding.
|
* Modified 2002-2019 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.
|
||||||
*
|
*
|
||||||
@@ -358,13 +358,6 @@ EXTERN(void) jpeg_idct_1x2
|
|||||||
|
|
||||||
#define FIX(x) ((INT32) ((x) * CONST_SCALE + 0.5))
|
#define FIX(x) ((INT32) ((x) * CONST_SCALE + 0.5))
|
||||||
|
|
||||||
/* Descale and correctly round an INT32 value that's scaled by N bits.
|
|
||||||
* We assume RIGHT_SHIFT rounds towards minus infinity, so adding
|
|
||||||
* the fudge factor is correct for either sign of X.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define DESCALE(x,n) RIGHT_SHIFT((x) + (ONE << ((n)-1)), n)
|
|
||||||
|
|
||||||
/* Multiply an INT32 variable by an INT32 constant to yield an INT32 result.
|
/* Multiply an INT32 variable by an INT32 constant to yield an INT32 result.
|
||||||
* This macro is used only when the two inputs will actually be no more than
|
* This macro is used only when the two inputs will actually be no more than
|
||||||
* 16 bits wide, so that a 16x16->32 bit multiply can be used instead of a
|
* 16 bits wide, so that a 16x16->32 bit multiply can be used instead of a
|
||||||
|
|||||||
Vendored
+33
-27
@@ -2,7 +2,7 @@
|
|||||||
* jdhuff.c
|
* jdhuff.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 1991-1997, Thomas G. Lane.
|
* Copyright (C) 1991-1997, Thomas G. Lane.
|
||||||
* Modified 2006-2016 by Guido Vollbeding.
|
* Modified 2006-2019 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.
|
||||||
*
|
*
|
||||||
@@ -341,13 +341,12 @@ jpeg_make_d_derived_tbl (j_decompress_ptr cinfo, boolean isDC, int tblno,
|
|||||||
htbl =
|
htbl =
|
||||||
isDC ? cinfo->dc_huff_tbl_ptrs[tblno] : cinfo->ac_huff_tbl_ptrs[tblno];
|
isDC ? cinfo->dc_huff_tbl_ptrs[tblno] : cinfo->ac_huff_tbl_ptrs[tblno];
|
||||||
if (htbl == NULL)
|
if (htbl == NULL)
|
||||||
ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tblno);
|
htbl = jpeg_std_huff_table((j_common_ptr) cinfo, isDC, tblno);
|
||||||
|
|
||||||
/* Allocate a workspace if we haven't already done so. */
|
/* Allocate a workspace if we haven't already done so. */
|
||||||
if (*pdtbl == NULL)
|
if (*pdtbl == NULL)
|
||||||
*pdtbl = (d_derived_tbl *)
|
*pdtbl = (d_derived_tbl *) (*cinfo->mem->alloc_small)
|
||||||
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
|
((j_common_ptr) cinfo, JPOOL_IMAGE, SIZEOF(d_derived_tbl));
|
||||||
SIZEOF(d_derived_tbl));
|
|
||||||
dtbl = *pdtbl;
|
dtbl = *pdtbl;
|
||||||
dtbl->pub = htbl; /* fill in back link */
|
dtbl->pub = htbl; /* fill in back link */
|
||||||
|
|
||||||
@@ -763,7 +762,8 @@ decode_mcu_DC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
|
|||||||
ASSIGN_STATE(entropy->saved, state);
|
ASSIGN_STATE(entropy->saved, state);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Account for restart interval (no-op if not using restarts) */
|
/* Account for restart interval if using restarts */
|
||||||
|
if (cinfo->restart_interval)
|
||||||
entropy->restarts_to_go--;
|
entropy->restarts_to_go--;
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@@ -849,7 +849,8 @@ decode_mcu_AC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
|
|||||||
entropy->saved.EOBRUN = EOBRUN; /* only part of saved state we need */
|
entropy->saved.EOBRUN = EOBRUN; /* only part of saved state we need */
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Account for restart interval (no-op if not using restarts) */
|
/* Account for restart interval if using restarts */
|
||||||
|
if (cinfo->restart_interval)
|
||||||
entropy->restarts_to_go--;
|
entropy->restarts_to_go--;
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@@ -866,7 +867,8 @@ METHODDEF(boolean)
|
|||||||
decode_mcu_DC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
|
decode_mcu_DC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
|
||||||
{
|
{
|
||||||
huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
|
huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
|
||||||
int p1, blkn;
|
JCOEF p1;
|
||||||
|
int blkn;
|
||||||
BITREAD_STATE_VARS;
|
BITREAD_STATE_VARS;
|
||||||
|
|
||||||
/* Process restart marker if needed; may have to suspend */
|
/* Process restart marker if needed; may have to suspend */
|
||||||
@@ -898,7 +900,8 @@ decode_mcu_DC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
|
|||||||
/* Completed MCU, so update state */
|
/* Completed MCU, so update state */
|
||||||
BITREAD_SAVE_STATE(cinfo, entropy->bitstate);
|
BITREAD_SAVE_STATE(cinfo, entropy->bitstate);
|
||||||
|
|
||||||
/* Account for restart interval (no-op if not using restarts) */
|
/* Account for restart interval if using restarts */
|
||||||
|
if (cinfo->restart_interval)
|
||||||
entropy->restarts_to_go--;
|
entropy->restarts_to_go--;
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@@ -915,7 +918,8 @@ decode_mcu_AC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
|
|||||||
huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
|
huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
|
||||||
register int s, k, r;
|
register int s, k, r;
|
||||||
unsigned int EOBRUN;
|
unsigned int EOBRUN;
|
||||||
int Se, p1, m1;
|
int Se;
|
||||||
|
JCOEF p1, m1;
|
||||||
const int * natural_order;
|
const int * natural_order;
|
||||||
JBLOCKROW block;
|
JBLOCKROW block;
|
||||||
JCOEFPTR thiscoef;
|
JCOEFPTR thiscoef;
|
||||||
@@ -937,7 +941,7 @@ decode_mcu_AC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
|
|||||||
|
|
||||||
Se = cinfo->Se;
|
Se = cinfo->Se;
|
||||||
p1 = 1 << cinfo->Al; /* 1 in the bit position being coded */
|
p1 = 1 << cinfo->Al; /* 1 in the bit position being coded */
|
||||||
m1 = (-1) << cinfo->Al; /* -1 in the bit position being coded */
|
m1 = -p1; /* -1 in the bit position being coded */
|
||||||
natural_order = cinfo->natural_order;
|
natural_order = cinfo->natural_order;
|
||||||
|
|
||||||
/* Load up working state */
|
/* Load up working state */
|
||||||
@@ -1047,7 +1051,8 @@ decode_mcu_AC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
|
|||||||
entropy->saved.EOBRUN = EOBRUN; /* only part of saved state we need */
|
entropy->saved.EOBRUN = EOBRUN; /* only part of saved state we need */
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Account for restart interval (no-op if not using restarts) */
|
/* Account for restart interval if using restarts */
|
||||||
|
if (cinfo->restart_interval)
|
||||||
entropy->restarts_to_go--;
|
entropy->restarts_to_go--;
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@@ -1182,7 +1187,8 @@ decode_mcu_sub (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
|
|||||||
ASSIGN_STATE(entropy->saved, state);
|
ASSIGN_STATE(entropy->saved, state);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Account for restart interval (no-op if not using restarts) */
|
/* Account for restart interval if using restarts */
|
||||||
|
if (cinfo->restart_interval)
|
||||||
entropy->restarts_to_go--;
|
entropy->restarts_to_go--;
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@@ -1306,7 +1312,8 @@ decode_mcu (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
|
|||||||
ASSIGN_STATE(entropy->saved, state);
|
ASSIGN_STATE(entropy->saved, state);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Account for restart interval (no-op if not using restarts) */
|
/* Account for restart interval if using restarts */
|
||||||
|
if (cinfo->restart_interval)
|
||||||
entropy->restarts_to_go--;
|
entropy->restarts_to_go--;
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@@ -1343,11 +1350,11 @@ start_pass_huff_decoder (j_decompress_ptr cinfo)
|
|||||||
goto bad;
|
goto bad;
|
||||||
}
|
}
|
||||||
if (cinfo->Al > 13) { /* need not check for < 0 */
|
if (cinfo->Al > 13) { /* need not check for < 0 */
|
||||||
/* Arguably the maximum Al value should be less than 13 for 8-bit precision,
|
/* Arguably the maximum Al value should be less than 13 for 8-bit
|
||||||
* but the spec doesn't say so, and we try to be liberal about what we
|
* precision, but the spec doesn't say so, and we try to be liberal
|
||||||
* accept. Note: large Al values could result in out-of-range DC
|
* about what we accept. Note: large Al values could result in
|
||||||
* coefficients during early scans, leading to bizarre displays due to
|
* out-of-range DC coefficients during early scans, leading to bizarre
|
||||||
* overflows in the IDCT math. But we won't crash.
|
* displays due to overflows in the IDCT math. But we won't crash.
|
||||||
*/
|
*/
|
||||||
bad:
|
bad:
|
||||||
ERREXIT4(cinfo, JERR_BAD_PROGRESSION,
|
ERREXIT4(cinfo, JERR_BAD_PROGRESSION,
|
||||||
@@ -1451,7 +1458,8 @@ start_pass_huff_decoder (j_decompress_ptr cinfo)
|
|||||||
compptr = cinfo->cur_comp_info[ci];
|
compptr = cinfo->cur_comp_info[ci];
|
||||||
/* Precalculate which table to use for each block */
|
/* Precalculate which table to use for each block */
|
||||||
entropy->dc_cur_tbls[blkn] = entropy->dc_derived_tbls[compptr->dc_tbl_no];
|
entropy->dc_cur_tbls[blkn] = entropy->dc_derived_tbls[compptr->dc_tbl_no];
|
||||||
entropy->ac_cur_tbls[blkn] = entropy->ac_derived_tbls[compptr->ac_tbl_no];
|
entropy->ac_cur_tbls[blkn] = /* AC needs no table when not present */
|
||||||
|
cinfo->lim_Se ? entropy->ac_derived_tbls[compptr->ac_tbl_no] : NULL;
|
||||||
/* Decide whether we really care about the coefficient values */
|
/* Decide whether we really care about the coefficient values */
|
||||||
if (compptr->component_needed) {
|
if (compptr->component_needed) {
|
||||||
ci = compptr->DCT_v_scaled_size;
|
ci = compptr->DCT_v_scaled_size;
|
||||||
@@ -1494,7 +1502,6 @@ start_pass_huff_decoder (j_decompress_ptr cinfo)
|
|||||||
if (ci <= 0 || ci > 8) ci = 8;
|
if (ci <= 0 || ci > 8) ci = 8;
|
||||||
if (i <= 0 || i > 8) i = 8;
|
if (i <= 0 || i > 8) i = 8;
|
||||||
entropy->coef_limit[blkn] = 1 + jpeg_zigzag_order[ci - 1][i - 1];
|
entropy->coef_limit[blkn] = 1 + jpeg_zigzag_order[ci - 1][i - 1];
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
entropy->coef_limit[blkn] = 0;
|
entropy->coef_limit[blkn] = 0;
|
||||||
@@ -1522,9 +1529,8 @@ jinit_huff_decoder (j_decompress_ptr cinfo)
|
|||||||
huff_entropy_ptr entropy;
|
huff_entropy_ptr entropy;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
entropy = (huff_entropy_ptr)
|
entropy = (huff_entropy_ptr) (*cinfo->mem->alloc_small)
|
||||||
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
|
((j_common_ptr) cinfo, JPOOL_IMAGE, SIZEOF(huff_entropy_decoder));
|
||||||
SIZEOF(huff_entropy_decoder));
|
|
||||||
cinfo->entropy = &entropy->pub;
|
cinfo->entropy = &entropy->pub;
|
||||||
entropy->pub.start_pass = start_pass_huff_decoder;
|
entropy->pub.start_pass = start_pass_huff_decoder;
|
||||||
entropy->pub.finish_pass = finish_pass_huff;
|
entropy->pub.finish_pass = finish_pass_huff;
|
||||||
@@ -1532,8 +1538,8 @@ jinit_huff_decoder (j_decompress_ptr cinfo)
|
|||||||
if (cinfo->progressive_mode) {
|
if (cinfo->progressive_mode) {
|
||||||
/* Create progression status table */
|
/* Create progression status table */
|
||||||
int *coef_bit_ptr, ci;
|
int *coef_bit_ptr, ci;
|
||||||
cinfo->coef_bits = (int (*)[DCTSIZE2])
|
cinfo->coef_bits = (int (*)[DCTSIZE2]) (*cinfo->mem->alloc_small)
|
||||||
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
|
((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++)
|
||||||
@@ -1545,7 +1551,7 @@ jinit_huff_decoder (j_decompress_ptr cinfo)
|
|||||||
entropy->derived_tbls[i] = NULL;
|
entropy->derived_tbls[i] = NULL;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* Mark tables unallocated */
|
/* Mark derived tables unallocated */
|
||||||
for (i = 0; i < NUM_HUFF_TBLS; i++) {
|
for (i = 0; i < NUM_HUFF_TBLS; i++) {
|
||||||
entropy->dc_derived_tbls[i] = entropy->ac_derived_tbls[i] = NULL;
|
entropy->dc_derived_tbls[i] = entropy->ac_derived_tbls[i] = NULL;
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+7
-13
@@ -2,7 +2,7 @@
|
|||||||
* jdmarker.c
|
* jdmarker.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 1991-1998, Thomas G. Lane.
|
* Copyright (C) 1991-1998, Thomas G. Lane.
|
||||||
* Modified 2009-2013 by Guido Vollbeding.
|
* Modified 2009-2019 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.
|
||||||
*
|
*
|
||||||
@@ -496,8 +496,6 @@ get_dht (j_decompress_ptr cinfo)
|
|||||||
if (count > 256 || ((INT32) count) > length)
|
if (count > 256 || ((INT32) count) > length)
|
||||||
ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);
|
ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);
|
||||||
|
|
||||||
MEMZERO(huffval, SIZEOF(huffval)); /* pre-zero array for later copy */
|
|
||||||
|
|
||||||
for (i = 0; i < count; i++)
|
for (i = 0; i < count; i++)
|
||||||
INPUT_BYTE(cinfo, huffval[i], return FALSE);
|
INPUT_BYTE(cinfo, huffval[i], return FALSE);
|
||||||
|
|
||||||
@@ -517,7 +515,8 @@ get_dht (j_decompress_ptr cinfo)
|
|||||||
*htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo);
|
*htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo);
|
||||||
|
|
||||||
MEMCOPY((*htblptr)->bits, bits, SIZEOF((*htblptr)->bits));
|
MEMCOPY((*htblptr)->bits, bits, SIZEOF((*htblptr)->bits));
|
||||||
MEMCOPY((*htblptr)->huffval, huffval, SIZEOF((*htblptr)->huffval));
|
if (count > 0)
|
||||||
|
MEMCOPY((*htblptr)->huffval, huffval, count * SIZEOF(UINT8));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (length != 0)
|
if (length != 0)
|
||||||
@@ -577,14 +576,14 @@ get_dqt (j_decompress_ptr cinfo)
|
|||||||
count = DCTSIZE2;
|
count = DCTSIZE2;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (count) {
|
switch ((int) count) {
|
||||||
case (2*2): natural_order = jpeg_natural_order2; break;
|
case (2*2): natural_order = jpeg_natural_order2; break;
|
||||||
case (3*3): natural_order = jpeg_natural_order3; break;
|
case (3*3): natural_order = jpeg_natural_order3; break;
|
||||||
case (4*4): natural_order = jpeg_natural_order4; break;
|
case (4*4): natural_order = jpeg_natural_order4; break;
|
||||||
case (5*5): natural_order = jpeg_natural_order5; break;
|
case (5*5): natural_order = jpeg_natural_order5; break;
|
||||||
case (6*6): natural_order = jpeg_natural_order6; break;
|
case (6*6): natural_order = jpeg_natural_order6; break;
|
||||||
case (7*7): natural_order = jpeg_natural_order7; break;
|
case (7*7): natural_order = jpeg_natural_order7; break;
|
||||||
default: natural_order = jpeg_natural_order; break;
|
default: natural_order = jpeg_natural_order;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < count; i++) {
|
for (i = 0; i < count; i++) {
|
||||||
@@ -784,7 +783,6 @@ examine_app0 (j_decompress_ptr cinfo, JOCTET FAR * data,
|
|||||||
default:
|
default:
|
||||||
TRACEMS2(cinfo, 1, JTRC_JFIF_EXTENSION,
|
TRACEMS2(cinfo, 1, JTRC_JFIF_EXTENSION,
|
||||||
GETJOCTET(data[5]), (int) totallen);
|
GETJOCTET(data[5]), (int) totallen);
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* Start of APP0 does not match "JFIF" or "JFXX", or too short */
|
/* Start of APP0 does not match "JFIF" or "JFXX", or too short */
|
||||||
@@ -858,7 +856,6 @@ get_interesting_appn (j_decompress_ptr cinfo)
|
|||||||
default:
|
default:
|
||||||
/* can't get here unless jpeg_save_markers chooses wrong processor */
|
/* can't get here unless jpeg_save_markers chooses wrong processor */
|
||||||
ERREXIT1(cinfo, JERR_UNKNOWN_MARKER, cinfo->unread_marker);
|
ERREXIT1(cinfo, JERR_UNKNOWN_MARKER, cinfo->unread_marker);
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* skip any remaining data -- could be lots */
|
/* skip any remaining data -- could be lots */
|
||||||
@@ -964,7 +961,6 @@ save_marker (j_decompress_ptr cinfo)
|
|||||||
default:
|
default:
|
||||||
TRACEMS2(cinfo, 1, JTRC_MISC_MARKER, cinfo->unread_marker,
|
TRACEMS2(cinfo, 1, JTRC_MISC_MARKER, cinfo->unread_marker,
|
||||||
(int) (data_length + length));
|
(int) (data_length + length));
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* skip any remaining data -- could be lots */
|
/* skip any remaining data -- could be lots */
|
||||||
@@ -1240,7 +1236,6 @@ read_markers (j_decompress_ptr cinfo)
|
|||||||
* ought to change!
|
* ought to change!
|
||||||
*/
|
*/
|
||||||
ERREXIT1(cinfo, JERR_UNKNOWN_MARKER, cinfo->unread_marker);
|
ERREXIT1(cinfo, JERR_UNKNOWN_MARKER, cinfo->unread_marker);
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
/* Successfully processed marker, so reset state variable */
|
/* Successfully processed marker, so reset state variable */
|
||||||
cinfo->unread_marker = 0;
|
cinfo->unread_marker = 0;
|
||||||
@@ -1416,9 +1411,8 @@ jinit_marker_reader (j_decompress_ptr cinfo)
|
|||||||
int i;
|
int i;
|
||||||
|
|
||||||
/* Create subobject in permanent pool */
|
/* Create subobject in permanent pool */
|
||||||
marker = (my_marker_ptr)
|
marker = (my_marker_ptr) (*cinfo->mem->alloc_small)
|
||||||
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
|
((j_common_ptr) cinfo, JPOOL_PERMANENT, SIZEOF(my_marker_reader));
|
||||||
SIZEOF(my_marker_reader));
|
|
||||||
cinfo->marker = &marker->pub;
|
cinfo->marker = &marker->pub;
|
||||||
/* Initialize public method pointers */
|
/* Initialize public method pointers */
|
||||||
marker->pub.reset_marker_reader = reset_marker_reader;
|
marker->pub.reset_marker_reader = reset_marker_reader;
|
||||||
|
|||||||
Vendored
+13
-12
@@ -2,7 +2,7 @@
|
|||||||
* jdmaster.c
|
* jdmaster.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 1991-1997, Thomas G. Lane.
|
* Copyright (C) 1991-1997, Thomas G. Lane.
|
||||||
* Modified 2002-2017 by Guido Vollbeding.
|
* Modified 2002-2019 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.
|
||||||
*
|
*
|
||||||
@@ -104,7 +104,7 @@ jpeg_calc_output_dimensions (j_decompress_ptr cinfo)
|
|||||||
*/
|
*/
|
||||||
{
|
{
|
||||||
#ifdef IDCT_SCALING_SUPPORTED
|
#ifdef IDCT_SCALING_SUPPORTED
|
||||||
int ci;
|
int ci, ssize;
|
||||||
jpeg_component_info *compptr;
|
jpeg_component_info *compptr;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -124,17 +124,21 @@ jpeg_calc_output_dimensions (j_decompress_ptr cinfo)
|
|||||||
*/
|
*/
|
||||||
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++) {
|
||||||
int ssize = 1;
|
ssize = 1;
|
||||||
|
if (! cinfo->raw_data_out)
|
||||||
while (cinfo->min_DCT_h_scaled_size * ssize <=
|
while (cinfo->min_DCT_h_scaled_size * ssize <=
|
||||||
(cinfo->do_fancy_upsampling ? DCTSIZE : DCTSIZE / 2) &&
|
(cinfo->do_fancy_upsampling ? DCTSIZE : DCTSIZE / 2) &&
|
||||||
(cinfo->max_h_samp_factor % (compptr->h_samp_factor * ssize * 2)) == 0) {
|
(cinfo->max_h_samp_factor % (compptr->h_samp_factor * ssize * 2)) ==
|
||||||
|
0) {
|
||||||
ssize = ssize * 2;
|
ssize = ssize * 2;
|
||||||
}
|
}
|
||||||
compptr->DCT_h_scaled_size = cinfo->min_DCT_h_scaled_size * ssize;
|
compptr->DCT_h_scaled_size = cinfo->min_DCT_h_scaled_size * ssize;
|
||||||
ssize = 1;
|
ssize = 1;
|
||||||
|
if (! cinfo->raw_data_out)
|
||||||
while (cinfo->min_DCT_v_scaled_size * ssize <=
|
while (cinfo->min_DCT_v_scaled_size * ssize <=
|
||||||
(cinfo->do_fancy_upsampling ? DCTSIZE : DCTSIZE / 2) &&
|
(cinfo->do_fancy_upsampling ? DCTSIZE : DCTSIZE / 2) &&
|
||||||
(cinfo->max_v_samp_factor % (compptr->v_samp_factor * ssize * 2)) == 0) {
|
(cinfo->max_v_samp_factor % (compptr->v_samp_factor * ssize * 2)) ==
|
||||||
|
0) {
|
||||||
ssize = ssize * 2;
|
ssize = ssize * 2;
|
||||||
}
|
}
|
||||||
compptr->DCT_v_scaled_size = cinfo->min_DCT_v_scaled_size * ssize;
|
compptr->DCT_v_scaled_size = cinfo->min_DCT_v_scaled_size * ssize;
|
||||||
@@ -144,13 +148,10 @@ jpeg_calc_output_dimensions (j_decompress_ptr cinfo)
|
|||||||
compptr->DCT_h_scaled_size = compptr->DCT_v_scaled_size * 2;
|
compptr->DCT_h_scaled_size = compptr->DCT_v_scaled_size * 2;
|
||||||
else if (compptr->DCT_v_scaled_size > compptr->DCT_h_scaled_size * 2)
|
else if (compptr->DCT_v_scaled_size > compptr->DCT_h_scaled_size * 2)
|
||||||
compptr->DCT_v_scaled_size = compptr->DCT_h_scaled_size * 2;
|
compptr->DCT_v_scaled_size = compptr->DCT_h_scaled_size * 2;
|
||||||
}
|
|
||||||
|
|
||||||
/* Recompute downsampled dimensions of components;
|
/* Recompute downsampled dimensions of components;
|
||||||
* application needs to know these if using raw downsampled data.
|
* application needs to know these if using raw downsampled data.
|
||||||
*/
|
*/
|
||||||
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
|
|
||||||
ci++, compptr++) {
|
|
||||||
/* Size in samples, after IDCT scaling */
|
/* Size in samples, after IDCT scaling */
|
||||||
compptr->downsampled_width = (JDIMENSION)
|
compptr->downsampled_width = (JDIMENSION)
|
||||||
jdiv_round_up((long) cinfo->image_width *
|
jdiv_round_up((long) cinfo->image_width *
|
||||||
@@ -172,8 +173,10 @@ jpeg_calc_output_dimensions (j_decompress_ptr cinfo)
|
|||||||
break;
|
break;
|
||||||
case JCS_RGB:
|
case JCS_RGB:
|
||||||
case JCS_BG_RGB:
|
case JCS_BG_RGB:
|
||||||
|
#if RGB_PIXELSIZE != 3
|
||||||
cinfo->out_color_components = RGB_PIXELSIZE;
|
cinfo->out_color_components = RGB_PIXELSIZE;
|
||||||
break;
|
break;
|
||||||
|
#endif /* else share code with YCbCr */
|
||||||
case JCS_YCbCr:
|
case JCS_YCbCr:
|
||||||
case JCS_BG_YCC:
|
case JCS_BG_YCC:
|
||||||
cinfo->out_color_components = 3;
|
cinfo->out_color_components = 3;
|
||||||
@@ -184,7 +187,6 @@ jpeg_calc_output_dimensions (j_decompress_ptr cinfo)
|
|||||||
break;
|
break;
|
||||||
default: /* else must be same colorspace as in file */
|
default: /* else must be same colorspace as in file */
|
||||||
cinfo->out_color_components = cinfo->num_components;
|
cinfo->out_color_components = cinfo->num_components;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
cinfo->output_components = (cinfo->quantize_colors ? 1 :
|
cinfo->output_components = (cinfo->quantize_colors ? 1 :
|
||||||
cinfo->out_color_components);
|
cinfo->out_color_components);
|
||||||
@@ -525,9 +527,8 @@ jinit_master_decompress (j_decompress_ptr cinfo)
|
|||||||
{
|
{
|
||||||
my_master_ptr master;
|
my_master_ptr master;
|
||||||
|
|
||||||
master = (my_master_ptr)
|
master = (my_master_ptr) (*cinfo->mem->alloc_small)
|
||||||
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
|
((j_common_ptr) cinfo, JPOOL_IMAGE, SIZEOF(my_decomp_master));
|
||||||
SIZEOF(my_decomp_master));
|
|
||||||
cinfo->master = &master->pub;
|
cinfo->master = &master->pub;
|
||||||
master->pub.prepare_for_output_pass = prepare_for_output_pass;
|
master->pub.prepare_for_output_pass = prepare_for_output_pass;
|
||||||
master->pub.finish_output_pass = finish_output_pass;
|
master->pub.finish_output_pass = finish_output_pass;
|
||||||
|
|||||||
Vendored
+26
-39
@@ -2,7 +2,7 @@
|
|||||||
* jdmerge.c
|
* jdmerge.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 1994-1996, Thomas G. Lane.
|
* Copyright (C) 1994-1996, Thomas G. Lane.
|
||||||
* Modified 2013-2017 by Guido Vollbeding.
|
* Modified 2013-2019 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.
|
||||||
*
|
*
|
||||||
@@ -95,28 +95,22 @@ build_ycc_rgb_table (j_decompress_ptr cinfo)
|
|||||||
INT32 x;
|
INT32 x;
|
||||||
SHIFT_TEMPS
|
SHIFT_TEMPS
|
||||||
|
|
||||||
upsample->Cr_r_tab = (int *)
|
upsample->Cr_r_tab = (int *) (*cinfo->mem->alloc_small)
|
||||||
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
|
((j_common_ptr) cinfo, JPOOL_IMAGE, (MAXJSAMPLE+1) * SIZEOF(int));
|
||||||
(MAXJSAMPLE+1) * SIZEOF(int));
|
upsample->Cb_b_tab = (int *) (*cinfo->mem->alloc_small)
|
||||||
upsample->Cb_b_tab = (int *)
|
((j_common_ptr) cinfo, JPOOL_IMAGE, (MAXJSAMPLE+1) * SIZEOF(int));
|
||||||
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
|
upsample->Cr_g_tab = (INT32 *) (*cinfo->mem->alloc_small)
|
||||||
(MAXJSAMPLE+1) * SIZEOF(int));
|
((j_common_ptr) cinfo, JPOOL_IMAGE, (MAXJSAMPLE+1) * SIZEOF(INT32));
|
||||||
upsample->Cr_g_tab = (INT32 *)
|
upsample->Cb_g_tab = (INT32 *) (*cinfo->mem->alloc_small)
|
||||||
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
|
((j_common_ptr) cinfo, JPOOL_IMAGE, (MAXJSAMPLE+1) * SIZEOF(INT32));
|
||||||
(MAXJSAMPLE+1) * SIZEOF(INT32));
|
|
||||||
upsample->Cb_g_tab = (INT32 *)
|
|
||||||
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
|
|
||||||
(MAXJSAMPLE+1) * SIZEOF(INT32));
|
|
||||||
|
|
||||||
for (i = 0, x = -CENTERJSAMPLE; i <= MAXJSAMPLE; i++, x++) {
|
for (i = 0, x = -CENTERJSAMPLE; i <= MAXJSAMPLE; i++, x++) {
|
||||||
/* i is the actual input pixel value, in the range 0..MAXJSAMPLE */
|
/* i is the actual input pixel value, in the range 0..MAXJSAMPLE */
|
||||||
/* The Cb or Cr value we are thinking of is x = i - CENTERJSAMPLE */
|
/* The Cb or Cr value we are thinking of is x = i - CENTERJSAMPLE */
|
||||||
/* Cr=>R value is nearest int to 1.402 * x */
|
/* Cr=>R value is nearest int to 1.402 * x */
|
||||||
upsample->Cr_r_tab[i] = (int)
|
upsample->Cr_r_tab[i] = (int) DESCALE(FIX(1.402) * x, SCALEBITS);
|
||||||
RIGHT_SHIFT(FIX(1.402) * x + ONE_HALF, SCALEBITS);
|
|
||||||
/* Cb=>B value is nearest int to 1.772 * x */
|
/* Cb=>B value is nearest int to 1.772 * x */
|
||||||
upsample->Cb_b_tab[i] = (int)
|
upsample->Cb_b_tab[i] = (int) DESCALE(FIX(1.772) * x, SCALEBITS);
|
||||||
RIGHT_SHIFT(FIX(1.772) * x + ONE_HALF, SCALEBITS);
|
|
||||||
/* Cr=>G value is scaled-up -0.714136286 * x */
|
/* Cr=>G value is scaled-up -0.714136286 * x */
|
||||||
upsample->Cr_g_tab[i] = (- FIX(0.714136286)) * x;
|
upsample->Cr_g_tab[i] = (- FIX(0.714136286)) * x;
|
||||||
/* Cb=>G value is scaled-up -0.344136286 * x */
|
/* Cb=>G value is scaled-up -0.344136286 * x */
|
||||||
@@ -135,28 +129,22 @@ build_bg_ycc_rgb_table (j_decompress_ptr cinfo)
|
|||||||
INT32 x;
|
INT32 x;
|
||||||
SHIFT_TEMPS
|
SHIFT_TEMPS
|
||||||
|
|
||||||
upsample->Cr_r_tab = (int *)
|
upsample->Cr_r_tab = (int *) (*cinfo->mem->alloc_small)
|
||||||
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
|
((j_common_ptr) cinfo, JPOOL_IMAGE, (MAXJSAMPLE+1) * SIZEOF(int));
|
||||||
(MAXJSAMPLE+1) * SIZEOF(int));
|
upsample->Cb_b_tab = (int *) (*cinfo->mem->alloc_small)
|
||||||
upsample->Cb_b_tab = (int *)
|
((j_common_ptr) cinfo, JPOOL_IMAGE, (MAXJSAMPLE+1) * SIZEOF(int));
|
||||||
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
|
upsample->Cr_g_tab = (INT32 *) (*cinfo->mem->alloc_small)
|
||||||
(MAXJSAMPLE+1) * SIZEOF(int));
|
((j_common_ptr) cinfo, JPOOL_IMAGE, (MAXJSAMPLE+1) * SIZEOF(INT32));
|
||||||
upsample->Cr_g_tab = (INT32 *)
|
upsample->Cb_g_tab = (INT32 *) (*cinfo->mem->alloc_small)
|
||||||
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
|
((j_common_ptr) cinfo, JPOOL_IMAGE, (MAXJSAMPLE+1) * SIZEOF(INT32));
|
||||||
(MAXJSAMPLE+1) * SIZEOF(INT32));
|
|
||||||
upsample->Cb_g_tab = (INT32 *)
|
|
||||||
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
|
|
||||||
(MAXJSAMPLE+1) * SIZEOF(INT32));
|
|
||||||
|
|
||||||
for (i = 0, x = -CENTERJSAMPLE; i <= MAXJSAMPLE; i++, x++) {
|
for (i = 0, x = -CENTERJSAMPLE; i <= MAXJSAMPLE; i++, x++) {
|
||||||
/* i is the actual input pixel value, in the range 0..MAXJSAMPLE */
|
/* i is the actual input pixel value, in the range 0..MAXJSAMPLE */
|
||||||
/* The Cb or Cr value we are thinking of is x = i - CENTERJSAMPLE */
|
/* The Cb or Cr value we are thinking of is x = i - CENTERJSAMPLE */
|
||||||
/* Cr=>R value is nearest int to 2.804 * x */
|
/* Cr=>R value is nearest int to 2.804 * x */
|
||||||
upsample->Cr_r_tab[i] = (int)
|
upsample->Cr_r_tab[i] = (int) DESCALE(FIX(2.804) * x, SCALEBITS);
|
||||||
RIGHT_SHIFT(FIX(2.804) * x + ONE_HALF, SCALEBITS);
|
|
||||||
/* Cb=>B value is nearest int to 3.544 * x */
|
/* Cb=>B value is nearest int to 3.544 * x */
|
||||||
upsample->Cb_b_tab[i] = (int)
|
upsample->Cb_b_tab[i] = (int) DESCALE(FIX(3.544) * x, SCALEBITS);
|
||||||
RIGHT_SHIFT(FIX(3.544) * x + ONE_HALF, SCALEBITS);
|
|
||||||
/* Cr=>G value is scaled-up -1.428272572 * x */
|
/* Cr=>G value is scaled-up -1.428272572 * x */
|
||||||
upsample->Cr_g_tab[i] = (- FIX(1.428272572)) * x;
|
upsample->Cr_g_tab[i] = (- FIX(1.428272572)) * x;
|
||||||
/* Cb=>G value is scaled-up -0.688272572 * x */
|
/* Cb=>G value is scaled-up -0.688272572 * x */
|
||||||
@@ -419,9 +407,8 @@ jinit_merged_upsampler (j_decompress_ptr cinfo)
|
|||||||
{
|
{
|
||||||
my_upsample_ptr upsample;
|
my_upsample_ptr upsample;
|
||||||
|
|
||||||
upsample = (my_upsample_ptr)
|
upsample = (my_upsample_ptr) (*cinfo->mem->alloc_small)
|
||||||
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
|
((j_common_ptr) cinfo, JPOOL_IMAGE, SIZEOF(my_upsampler));
|
||||||
SIZEOF(my_upsampler));
|
|
||||||
cinfo->upsample = &upsample->pub;
|
cinfo->upsample = &upsample->pub;
|
||||||
upsample->pub.start_pass = start_pass_merged_upsample;
|
upsample->pub.start_pass = start_pass_merged_upsample;
|
||||||
upsample->pub.need_context_rows = FALSE;
|
upsample->pub.need_context_rows = FALSE;
|
||||||
@@ -432,9 +419,9 @@ jinit_merged_upsampler (j_decompress_ptr cinfo)
|
|||||||
upsample->pub.upsample = merged_2v_upsample;
|
upsample->pub.upsample = merged_2v_upsample;
|
||||||
upsample->upmethod = h2v2_merged_upsample;
|
upsample->upmethod = h2v2_merged_upsample;
|
||||||
/* Allocate a spare row buffer */
|
/* Allocate a spare row buffer */
|
||||||
upsample->spare_row = (JSAMPROW)
|
upsample->spare_row = (JSAMPROW) (*cinfo->mem->alloc_large)
|
||||||
(*cinfo->mem->alloc_large) ((j_common_ptr) cinfo, JPOOL_IMAGE,
|
((j_common_ptr) cinfo, JPOOL_IMAGE,
|
||||||
(size_t) (upsample->out_row_width * SIZEOF(JSAMPLE)));
|
(size_t) upsample->out_row_width * SIZEOF(JSAMPLE));
|
||||||
} else {
|
} else {
|
||||||
upsample->pub.upsample = merged_1v_upsample;
|
upsample->pub.upsample = merged_1v_upsample;
|
||||||
upsample->upmethod = h2v1_merged_upsample;
|
upsample->upmethod = h2v1_merged_upsample;
|
||||||
|
|||||||
Vendored
+2
-2
@@ -2,7 +2,7 @@
|
|||||||
* jerror.h
|
* jerror.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 1994-1997, Thomas G. Lane.
|
* Copyright (C) 1994-1997, Thomas G. Lane.
|
||||||
* Modified 1997-2012 by Guido Vollbeding.
|
* Modified 1997-2018 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.
|
||||||
*
|
*
|
||||||
@@ -84,7 +84,7 @@ JMESSAGE(JERR_EOI_EXPECTED, "Didn't expect more than one scan")
|
|||||||
JMESSAGE(JERR_FILE_READ, "Input file read error")
|
JMESSAGE(JERR_FILE_READ, "Input file read error")
|
||||||
JMESSAGE(JERR_FILE_WRITE, "Output file write error --- out of disk space?")
|
JMESSAGE(JERR_FILE_WRITE, "Output file write error --- out of disk space?")
|
||||||
JMESSAGE(JERR_FRACT_SAMPLE_NOTIMPL, "Fractional sampling not implemented yet")
|
JMESSAGE(JERR_FRACT_SAMPLE_NOTIMPL, "Fractional sampling not implemented yet")
|
||||||
JMESSAGE(JERR_HUFF_CLEN_OVERFLOW, "Huffman code size table overflow")
|
JMESSAGE(JERR_HUFF_CLEN_OUTOFBOUNDS, "Huffman code size table out of bounds")
|
||||||
JMESSAGE(JERR_HUFF_MISSING_CODE, "Missing Huffman code table entry")
|
JMESSAGE(JERR_HUFF_MISSING_CODE, "Missing Huffman code table entry")
|
||||||
JMESSAGE(JERR_IMAGE_TOO_BIG, "Maximum supported image dimension is %u pixels")
|
JMESSAGE(JERR_IMAGE_TOO_BIG, "Maximum supported image dimension is %u pixels")
|
||||||
JMESSAGE(JERR_INPUT_EMPTY, "Empty input file")
|
JMESSAGE(JERR_INPUT_EMPTY, "Empty input file")
|
||||||
|
|||||||
Vendored
+59
-53
@@ -2,7 +2,7 @@
|
|||||||
* jfdctint.c
|
* jfdctint.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 1991-1996, Thomas G. Lane.
|
* Copyright (C) 1991-1996, Thomas G. Lane.
|
||||||
* Modification developed 2003-2015 by Guido Vollbeding.
|
* Modification developed 2003-2018 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.
|
||||||
*
|
*
|
||||||
@@ -3261,78 +3261,84 @@ jpeg_fdct_6x3 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)
|
|||||||
GLOBAL(void)
|
GLOBAL(void)
|
||||||
jpeg_fdct_4x2 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)
|
jpeg_fdct_4x2 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)
|
||||||
{
|
{
|
||||||
INT32 tmp0, tmp1;
|
DCTELEM tmp0, tmp2, tmp10, tmp12, tmp4, tmp5;
|
||||||
INT32 tmp10, tmp11;
|
INT32 tmp1, tmp3, tmp11, tmp13;
|
||||||
DCTELEM *dataptr;
|
INT32 z1, z2, z3;
|
||||||
JSAMPROW elemptr;
|
JSAMPROW elemptr;
|
||||||
int ctr;
|
|
||||||
SHIFT_TEMPS
|
SHIFT_TEMPS
|
||||||
|
|
||||||
/* Pre-zero output coefficient block. */
|
/* Pre-zero output coefficient block. */
|
||||||
MEMZERO(data, SIZEOF(DCTELEM) * DCTSIZE2);
|
MEMZERO(data, SIZEOF(DCTELEM) * DCTSIZE2);
|
||||||
|
|
||||||
/* Pass 1: process rows.
|
/* Pass 1: process rows.
|
||||||
* Note results are scaled up by sqrt(8) compared to a true DCT;
|
* Note results are scaled up by sqrt(8) compared to a true DCT.
|
||||||
* furthermore, we scale the results by 2**PASS1_BITS.
|
|
||||||
* We must also scale the output by (8/4)*(8/2) = 2**3, which we add here.
|
|
||||||
* 4-point FDCT kernel,
|
* 4-point FDCT kernel,
|
||||||
* cK represents sqrt(2) * cos(K*pi/16) [refers to 8-point FDCT].
|
* cK represents sqrt(2) * cos(K*pi/16) [refers to 8-point FDCT].
|
||||||
*/
|
*/
|
||||||
|
|
||||||
dataptr = data;
|
/* Row 0 */
|
||||||
for (ctr = 0; ctr < 2; ctr++) {
|
elemptr = sample_data[0] + start_col;
|
||||||
elemptr = sample_data[ctr] + start_col;
|
|
||||||
|
|
||||||
/* Even part */
|
/* Even part */
|
||||||
|
|
||||||
tmp0 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[3]);
|
tmp4 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[3]);
|
||||||
tmp1 = GETJSAMPLE(elemptr[1]) + GETJSAMPLE(elemptr[2]);
|
tmp5 = GETJSAMPLE(elemptr[1]) + GETJSAMPLE(elemptr[2]);
|
||||||
|
|
||||||
tmp10 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[3]);
|
tmp0 = tmp4 + tmp5;
|
||||||
tmp11 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[2]);
|
tmp2 = tmp4 - tmp5;
|
||||||
|
|
||||||
/* Apply unsigned->signed conversion. */
|
|
||||||
dataptr[0] = (DCTELEM)
|
|
||||||
((tmp0 + tmp1 - 4 * CENTERJSAMPLE) << (PASS1_BITS+3));
|
|
||||||
dataptr[2] = (DCTELEM) ((tmp0 - tmp1) << (PASS1_BITS+3));
|
|
||||||
|
|
||||||
/* Odd part */
|
/* Odd part */
|
||||||
|
|
||||||
tmp0 = MULTIPLY(tmp10 + tmp11, FIX_0_541196100); /* c6 */
|
z2 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[3]);
|
||||||
|
z3 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[2]);
|
||||||
|
|
||||||
|
z1 = MULTIPLY(z2 + z3, FIX_0_541196100); /* c6 */
|
||||||
/* Add fudge factor here for final descale. */
|
/* Add fudge factor here for final descale. */
|
||||||
tmp0 += ONE << (CONST_BITS-PASS1_BITS-4);
|
z1 += ONE << (CONST_BITS-3-1);
|
||||||
|
tmp1 = z1 + MULTIPLY(z2, FIX_0_765366865); /* c2-c6 */
|
||||||
|
tmp3 = z1 - MULTIPLY(z3, FIX_1_847759065); /* c2+c6 */
|
||||||
|
|
||||||
dataptr[1] = (DCTELEM)
|
/* Row 1 */
|
||||||
RIGHT_SHIFT(tmp0 + MULTIPLY(tmp10, FIX_0_765366865), /* c2-c6 */
|
elemptr = sample_data[1] + start_col;
|
||||||
CONST_BITS-PASS1_BITS-3);
|
|
||||||
dataptr[3] = (DCTELEM)
|
|
||||||
RIGHT_SHIFT(tmp0 - MULTIPLY(tmp11, FIX_1_847759065), /* c2+c6 */
|
|
||||||
CONST_BITS-PASS1_BITS-3);
|
|
||||||
|
|
||||||
dataptr += DCTSIZE; /* advance pointer to next row */
|
/* Even part */
|
||||||
}
|
|
||||||
|
tmp4 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[3]);
|
||||||
|
tmp5 = GETJSAMPLE(elemptr[1]) + GETJSAMPLE(elemptr[2]);
|
||||||
|
|
||||||
|
tmp10 = tmp4 + tmp5;
|
||||||
|
tmp12 = tmp4 - tmp5;
|
||||||
|
|
||||||
|
/* Odd part */
|
||||||
|
|
||||||
|
z2 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[3]);
|
||||||
|
z3 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[2]);
|
||||||
|
|
||||||
|
z1 = MULTIPLY(z2 + z3, FIX_0_541196100); /* c6 */
|
||||||
|
tmp11 = z1 + MULTIPLY(z2, FIX_0_765366865); /* c2-c6 */
|
||||||
|
tmp13 = z1 - MULTIPLY(z3, FIX_1_847759065); /* c2+c6 */
|
||||||
|
|
||||||
/* Pass 2: process columns.
|
/* Pass 2: process columns.
|
||||||
* We remove the PASS1_BITS scaling, but leave the results scaled up
|
* We leave the results scaled up by an overall factor of 8.
|
||||||
* by an overall factor of 8.
|
* We must also scale the output by (8/4)*(8/2) = 2**3.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
dataptr = data;
|
/* Column 0 */
|
||||||
for (ctr = 0; ctr < 4; ctr++) {
|
/* Apply unsigned->signed conversion. */
|
||||||
/* Even part */
|
data[DCTSIZE*0] = (tmp0 + tmp10 - 8 * CENTERJSAMPLE) << 3;
|
||||||
|
data[DCTSIZE*1] = (tmp0 - tmp10) << 3;
|
||||||
|
|
||||||
/* Add fudge factor here for final descale. */
|
/* Column 1 */
|
||||||
tmp0 = dataptr[DCTSIZE*0] + (ONE << (PASS1_BITS-1));
|
data[DCTSIZE*0+1] = (DCTELEM) RIGHT_SHIFT(tmp1 + tmp11, CONST_BITS-3);
|
||||||
tmp1 = dataptr[DCTSIZE*1];
|
data[DCTSIZE*1+1] = (DCTELEM) RIGHT_SHIFT(tmp1 - tmp11, CONST_BITS-3);
|
||||||
|
|
||||||
dataptr[DCTSIZE*0] = (DCTELEM) RIGHT_SHIFT(tmp0 + tmp1, PASS1_BITS);
|
/* Column 2 */
|
||||||
|
data[DCTSIZE*0+2] = (tmp2 + tmp12) << 3;
|
||||||
|
data[DCTSIZE*1+2] = (tmp2 - tmp12) << 3;
|
||||||
|
|
||||||
/* Odd part */
|
/* Column 3 */
|
||||||
|
data[DCTSIZE*0+3] = (DCTELEM) RIGHT_SHIFT(tmp3 + tmp13, CONST_BITS-3);
|
||||||
dataptr[DCTSIZE*1] = (DCTELEM) RIGHT_SHIFT(tmp0 - tmp1, PASS1_BITS);
|
data[DCTSIZE*1+3] = (DCTELEM) RIGHT_SHIFT(tmp3 - tmp13, CONST_BITS-3);
|
||||||
|
|
||||||
dataptr++; /* advance pointer to next column */
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -4312,7 +4318,6 @@ jpeg_fdct_2x4 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)
|
|||||||
|
|
||||||
/* Pass 1: process rows.
|
/* Pass 1: process rows.
|
||||||
* Note results are scaled up by sqrt(8) compared to a true DCT.
|
* Note results are scaled up by sqrt(8) compared to a true DCT.
|
||||||
* We must also scale the output by (8/2)*(8/4) = 2**3, which we add here.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
dataptr = data;
|
dataptr = data;
|
||||||
@@ -4325,17 +4330,18 @@ jpeg_fdct_2x4 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)
|
|||||||
tmp1 = GETJSAMPLE(elemptr[1]);
|
tmp1 = GETJSAMPLE(elemptr[1]);
|
||||||
|
|
||||||
/* Apply unsigned->signed conversion. */
|
/* Apply unsigned->signed conversion. */
|
||||||
dataptr[0] = (DCTELEM) ((tmp0 + tmp1 - 2 * CENTERJSAMPLE) << 3);
|
dataptr[0] = (DCTELEM) (tmp0 + tmp1 - 2 * CENTERJSAMPLE);
|
||||||
|
|
||||||
/* Odd part */
|
/* Odd part */
|
||||||
|
|
||||||
dataptr[1] = (DCTELEM) ((tmp0 - tmp1) << 3);
|
dataptr[1] = (DCTELEM) (tmp0 - tmp1);
|
||||||
|
|
||||||
dataptr += DCTSIZE; /* advance pointer to next row */
|
dataptr += DCTSIZE; /* advance pointer to next row */
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Pass 2: process columns.
|
/* Pass 2: process columns.
|
||||||
* We leave the results scaled up by an overall factor of 8.
|
* We leave the results scaled up by an overall factor of 8.
|
||||||
|
* We must also scale the output by (8/2)*(8/4) = 2**3.
|
||||||
* 4-point FDCT kernel,
|
* 4-point FDCT kernel,
|
||||||
* cK represents sqrt(2) * cos(K*pi/16) [refers to 8-point FDCT].
|
* cK represents sqrt(2) * cos(K*pi/16) [refers to 8-point FDCT].
|
||||||
*/
|
*/
|
||||||
@@ -4350,21 +4356,21 @@ jpeg_fdct_2x4 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)
|
|||||||
tmp10 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*3];
|
tmp10 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*3];
|
||||||
tmp11 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*2];
|
tmp11 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*2];
|
||||||
|
|
||||||
dataptr[DCTSIZE*0] = (DCTELEM) (tmp0 + tmp1);
|
dataptr[DCTSIZE*0] = (DCTELEM) ((tmp0 + tmp1) << 3);
|
||||||
dataptr[DCTSIZE*2] = (DCTELEM) (tmp0 - tmp1);
|
dataptr[DCTSIZE*2] = (DCTELEM) ((tmp0 - tmp1) << 3);
|
||||||
|
|
||||||
/* Odd part */
|
/* Odd part */
|
||||||
|
|
||||||
tmp0 = MULTIPLY(tmp10 + tmp11, FIX_0_541196100); /* c6 */
|
tmp0 = MULTIPLY(tmp10 + tmp11, FIX_0_541196100); /* c6 */
|
||||||
/* Add fudge factor here for final descale. */
|
/* Add fudge factor here for final descale. */
|
||||||
tmp0 += ONE << (CONST_BITS-1);
|
tmp0 += ONE << (CONST_BITS-3-1);
|
||||||
|
|
||||||
dataptr[DCTSIZE*1] = (DCTELEM)
|
dataptr[DCTSIZE*1] = (DCTELEM)
|
||||||
RIGHT_SHIFT(tmp0 + MULTIPLY(tmp10, FIX_0_765366865), /* c2-c6 */
|
RIGHT_SHIFT(tmp0 + MULTIPLY(tmp10, FIX_0_765366865), /* c2-c6 */
|
||||||
CONST_BITS);
|
CONST_BITS-3);
|
||||||
dataptr[DCTSIZE*3] = (DCTELEM)
|
dataptr[DCTSIZE*3] = (DCTELEM)
|
||||||
RIGHT_SHIFT(tmp0 - MULTIPLY(tmp11, FIX_1_847759065), /* c2+c6 */
|
RIGHT_SHIFT(tmp0 - MULTIPLY(tmp11, FIX_1_847759065), /* c2+c6 */
|
||||||
CONST_BITS);
|
CONST_BITS-3);
|
||||||
|
|
||||||
dataptr++; /* advance pointer to next column */
|
dataptr++; /* advance pointer to next column */
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+6
-6
@@ -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-2016 by Guido Vollbeding.
|
* Modification developed 2002-2018 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.
|
||||||
*
|
*
|
||||||
@@ -1474,7 +1474,7 @@ jpeg_idct_10x10 (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 11x11 output block.
|
* producing an 11x11 output block.
|
||||||
*
|
*
|
||||||
* Optimized algorithm with 24 multiplications in the 1-D kernel.
|
* Optimized algorithm with 24 multiplications in the 1-D kernel.
|
||||||
* cK represents sqrt(2) * cos(K*pi/22).
|
* cK represents sqrt(2) * cos(K*pi/22).
|
||||||
@@ -3675,7 +3675,7 @@ jpeg_idct_10x5 (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 8x4 output block.
|
* producing an 8x4 output block.
|
||||||
*
|
*
|
||||||
* 4-point IDCT in pass 1 (columns), 8-point in pass 2 (rows).
|
* 4-point IDCT in pass 1 (columns), 8-point in pass 2 (rows).
|
||||||
*/
|
*/
|
||||||
@@ -3835,7 +3835,7 @@ jpeg_idct_8x4 (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 reduced-size 6x3 output block.
|
* producing a 6x3 output block.
|
||||||
*
|
*
|
||||||
* 3-point IDCT in pass 1 (columns), 6-point in pass 2 (rows).
|
* 3-point IDCT in pass 1 (columns), 6-point in pass 2 (rows).
|
||||||
*/
|
*/
|
||||||
@@ -4082,7 +4082,7 @@ jpeg_idct_2x1 (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 8x16 output block.
|
* producing an 8x16 output block.
|
||||||
*
|
*
|
||||||
* 16-point IDCT in pass 1 (columns), 8-point in pass 2 (rows).
|
* 16-point IDCT in pass 1 (columns), 8-point in pass 2 (rows).
|
||||||
*/
|
*/
|
||||||
@@ -5004,7 +5004,7 @@ jpeg_idct_4x8 (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 reduced-size 3x6 output block.
|
* producing a 3x6 output block.
|
||||||
*
|
*
|
||||||
* 6-point IDCT in pass 1 (columns), 3-point in pass 2 (rows).
|
* 6-point IDCT in pass 1 (columns), 3-point in pass 2 (rows).
|
||||||
*/
|
*/
|
||||||
|
|||||||
Vendored
+23
-27
@@ -2,7 +2,7 @@
|
|||||||
* jmemmgr.c
|
* jmemmgr.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 1991-1997, Thomas G. Lane.
|
* Copyright (C) 1991-1997, Thomas G. Lane.
|
||||||
* Modified 2011-2012 by Guido Vollbeding.
|
* Modified 2011-2019 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.
|
||||||
*
|
*
|
||||||
@@ -130,7 +130,7 @@ typedef struct {
|
|||||||
jvirt_barray_ptr virt_barray_list;
|
jvirt_barray_ptr virt_barray_list;
|
||||||
|
|
||||||
/* This counts total space obtained from jpeg_get_small/large */
|
/* This counts total space obtained from jpeg_get_small/large */
|
||||||
long total_space_allocated;
|
size_t total_space_allocated;
|
||||||
|
|
||||||
/* alloc_sarray and alloc_barray set this value for use by virtual
|
/* alloc_sarray and alloc_barray set this value for use by virtual
|
||||||
* array routines.
|
* array routines.
|
||||||
@@ -195,7 +195,7 @@ print_mem_stats (j_common_ptr cinfo, int pool_id)
|
|||||||
* This is helpful because message parm array can't handle longs.
|
* This is helpful because message parm array can't handle longs.
|
||||||
*/
|
*/
|
||||||
fprintf(stderr, "Freeing pool %d, total space = %ld\n",
|
fprintf(stderr, "Freeing pool %d, total space = %ld\n",
|
||||||
pool_id, mem->total_space_allocated);
|
pool_id, (long) mem->total_space_allocated);
|
||||||
|
|
||||||
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->hdr.next) {
|
lhdr_ptr = lhdr_ptr->hdr.next) {
|
||||||
@@ -260,11 +260,11 @@ alloc_small (j_common_ptr cinfo, int pool_id, size_t sizeofobject)
|
|||||||
{
|
{
|
||||||
my_mem_ptr mem = (my_mem_ptr) cinfo->mem;
|
my_mem_ptr mem = (my_mem_ptr) cinfo->mem;
|
||||||
small_pool_ptr hdr_ptr, prev_hdr_ptr;
|
small_pool_ptr hdr_ptr, prev_hdr_ptr;
|
||||||
char * data_ptr;
|
|
||||||
size_t odd_bytes, min_request, slop;
|
size_t odd_bytes, min_request, slop;
|
||||||
|
char * data_ptr;
|
||||||
|
|
||||||
/* Check for unsatisfiable request (do now to ensure no overflow below) */
|
/* Check for unsatisfiable request (do now to ensure no overflow below) */
|
||||||
if (sizeofobject > (size_t) (MAX_ALLOC_CHUNK-SIZEOF(small_pool_hdr)))
|
if (sizeofobject > (size_t) MAX_ALLOC_CHUNK - SIZEOF(small_pool_hdr))
|
||||||
out_of_memory(cinfo, 1); /* request exceeds malloc's ability */
|
out_of_memory(cinfo, 1); /* request exceeds malloc's ability */
|
||||||
|
|
||||||
/* Round up the requested size to a multiple of SIZEOF(ALIGN_TYPE) */
|
/* Round up the requested size to a multiple of SIZEOF(ALIGN_TYPE) */
|
||||||
@@ -293,8 +293,8 @@ alloc_small (j_common_ptr cinfo, int pool_id, size_t sizeofobject)
|
|||||||
else
|
else
|
||||||
slop = extra_pool_slop[pool_id];
|
slop = extra_pool_slop[pool_id];
|
||||||
/* Don't ask for more than MAX_ALLOC_CHUNK */
|
/* Don't ask for more than MAX_ALLOC_CHUNK */
|
||||||
if (slop > (size_t) (MAX_ALLOC_CHUNK-min_request))
|
if (slop > (size_t) MAX_ALLOC_CHUNK - min_request)
|
||||||
slop = (size_t) (MAX_ALLOC_CHUNK-min_request);
|
slop = (size_t) MAX_ALLOC_CHUNK - min_request;
|
||||||
/* Try to get space, if fail reduce slop and try again */
|
/* Try to get space, if fail reduce slop and try again */
|
||||||
for (;;) {
|
for (;;) {
|
||||||
hdr_ptr = (small_pool_ptr) jpeg_get_small(cinfo, min_request + slop);
|
hdr_ptr = (small_pool_ptr) jpeg_get_small(cinfo, min_request + slop);
|
||||||
@@ -348,7 +348,7 @@ alloc_large (j_common_ptr cinfo, int pool_id, size_t sizeofobject)
|
|||||||
size_t odd_bytes;
|
size_t odd_bytes;
|
||||||
|
|
||||||
/* Check for unsatisfiable request (do now to ensure no overflow below) */
|
/* Check for unsatisfiable request (do now to ensure no overflow below) */
|
||||||
if (sizeofobject > (size_t) (MAX_ALLOC_CHUNK-SIZEOF(large_pool_hdr)))
|
if (sizeofobject > (size_t) MAX_ALLOC_CHUNK - SIZEOF(large_pool_hdr))
|
||||||
out_of_memory(cinfo, 3); /* request exceeds malloc's ability */
|
out_of_memory(cinfo, 3); /* request exceeds malloc's ability */
|
||||||
|
|
||||||
/* Round up the requested size to a multiple of SIZEOF(ALIGN_TYPE) */
|
/* Round up the requested size to a multiple of SIZEOF(ALIGN_TYPE) */
|
||||||
@@ -416,15 +416,14 @@ alloc_sarray (j_common_ptr cinfo, int pool_id,
|
|||||||
|
|
||||||
/* Get space for row pointers (small object) */
|
/* Get space for row pointers (small object) */
|
||||||
result = (JSAMPARRAY) alloc_small(cinfo, pool_id,
|
result = (JSAMPARRAY) alloc_small(cinfo, pool_id,
|
||||||
(size_t) (numrows * SIZEOF(JSAMPROW)));
|
(size_t) numrows * SIZEOF(JSAMPROW));
|
||||||
|
|
||||||
/* Get the rows themselves (large objects) */
|
/* Get the rows themselves (large objects) */
|
||||||
currow = 0;
|
currow = 0;
|
||||||
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) 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;
|
||||||
@@ -464,15 +463,14 @@ alloc_barray (j_common_ptr cinfo, int pool_id,
|
|||||||
|
|
||||||
/* Get space for row pointers (small object) */
|
/* Get space for row pointers (small object) */
|
||||||
result = (JBLOCKARRAY) alloc_small(cinfo, pool_id,
|
result = (JBLOCKARRAY) alloc_small(cinfo, pool_id,
|
||||||
(size_t) (numrows * SIZEOF(JBLOCKROW)));
|
(size_t) numrows * SIZEOF(JBLOCKROW));
|
||||||
|
|
||||||
/* Get the rows themselves (large objects) */
|
/* Get the rows themselves (large objects) */
|
||||||
currow = 0;
|
currow = 0;
|
||||||
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) 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;
|
||||||
@@ -585,8 +583,8 @@ realize_virt_arrays (j_common_ptr cinfo)
|
|||||||
/* Allocate the in-memory buffers for any unrealized virtual arrays */
|
/* Allocate the in-memory buffers for any unrealized virtual arrays */
|
||||||
{
|
{
|
||||||
my_mem_ptr mem = (my_mem_ptr) cinfo->mem;
|
my_mem_ptr mem = (my_mem_ptr) cinfo->mem;
|
||||||
long space_per_minheight, maximum_space, avail_mem;
|
long bytesperrow, space_per_minheight, maximum_space;
|
||||||
long minheights, max_minheights;
|
long avail_mem, minheights, max_minheights;
|
||||||
jvirt_sarray_ptr sptr;
|
jvirt_sarray_ptr sptr;
|
||||||
jvirt_barray_ptr bptr;
|
jvirt_barray_ptr bptr;
|
||||||
|
|
||||||
@@ -598,18 +596,16 @@ realize_virt_arrays (j_common_ptr cinfo)
|
|||||||
maximum_space = 0;
|
maximum_space = 0;
|
||||||
for (sptr = mem->virt_sarray_list; sptr != NULL; sptr = sptr->next) {
|
for (sptr = mem->virt_sarray_list; sptr != NULL; sptr = sptr->next) {
|
||||||
if (sptr->mem_buffer == NULL) { /* if not realized yet */
|
if (sptr->mem_buffer == NULL) { /* if not realized yet */
|
||||||
space_per_minheight += (long) sptr->maxaccess *
|
bytesperrow = (long) sptr->samplesperrow * SIZEOF(JSAMPLE);
|
||||||
(long) sptr->samplesperrow * SIZEOF(JSAMPLE);
|
space_per_minheight += (long) sptr->maxaccess * bytesperrow;
|
||||||
maximum_space += (long) sptr->rows_in_array *
|
maximum_space += (long) sptr->rows_in_array * bytesperrow;
|
||||||
(long) sptr->samplesperrow * SIZEOF(JSAMPLE);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (bptr = mem->virt_barray_list; bptr != NULL; bptr = bptr->next) {
|
for (bptr = mem->virt_barray_list; bptr != NULL; bptr = bptr->next) {
|
||||||
if (bptr->mem_buffer == NULL) { /* if not realized yet */
|
if (bptr->mem_buffer == NULL) { /* if not realized yet */
|
||||||
space_per_minheight += (long) bptr->maxaccess *
|
bytesperrow = (long) bptr->blocksperrow * SIZEOF(JBLOCK);
|
||||||
(long) bptr->blocksperrow * SIZEOF(JBLOCK);
|
space_per_minheight += (long) bptr->maxaccess * bytesperrow;
|
||||||
maximum_space += (long) bptr->rows_in_array *
|
maximum_space += (long) bptr->rows_in_array * bytesperrow;
|
||||||
(long) bptr->blocksperrow * SIZEOF(JBLOCK);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -618,7 +614,7 @@ realize_virt_arrays (j_common_ptr cinfo)
|
|||||||
|
|
||||||
/* Determine amount of memory to actually use; this is system-dependent. */
|
/* Determine amount of memory to actually use; this is system-dependent. */
|
||||||
avail_mem = jpeg_mem_available(cinfo, space_per_minheight, maximum_space,
|
avail_mem = jpeg_mem_available(cinfo, space_per_minheight, maximum_space,
|
||||||
mem->total_space_allocated);
|
(long) mem->total_space_allocated);
|
||||||
|
|
||||||
/* If the maximum space needed is available, make all the buffers full
|
/* If the maximum space needed is available, make all the buffers full
|
||||||
* height; otherwise parcel it out with the same number of minheights
|
* height; otherwise parcel it out with the same number of minheights
|
||||||
@@ -694,7 +690,7 @@ do_sarray_io (j_common_ptr cinfo, jvirt_sarray_ptr ptr, boolean writing)
|
|||||||
long bytesperrow, file_offset, byte_count, rows, thisrow, i;
|
long bytesperrow, file_offset, byte_count, rows, thisrow, i;
|
||||||
|
|
||||||
bytesperrow = (long) ptr->samplesperrow * SIZEOF(JSAMPLE);
|
bytesperrow = (long) ptr->samplesperrow * SIZEOF(JSAMPLE);
|
||||||
file_offset = ptr->cur_start_row * bytesperrow;
|
file_offset = (long) ptr->cur_start_row * bytesperrow;
|
||||||
/* Loop to read or write each allocation chunk in mem_buffer */
|
/* Loop to read or write each allocation chunk in mem_buffer */
|
||||||
for (i = 0; i < (long) ptr->rows_in_mem; i += ptr->rowsperchunk) {
|
for (i = 0; i < (long) ptr->rows_in_mem; i += ptr->rowsperchunk) {
|
||||||
/* One chunk, but check for short chunk at end of buffer */
|
/* One chunk, but check for short chunk at end of buffer */
|
||||||
@@ -727,7 +723,7 @@ do_barray_io (j_common_ptr cinfo, jvirt_barray_ptr ptr, boolean writing)
|
|||||||
long bytesperrow, file_offset, byte_count, rows, thisrow, i;
|
long bytesperrow, file_offset, byte_count, rows, thisrow, i;
|
||||||
|
|
||||||
bytesperrow = (long) ptr->blocksperrow * SIZEOF(JBLOCK);
|
bytesperrow = (long) ptr->blocksperrow * SIZEOF(JBLOCK);
|
||||||
file_offset = ptr->cur_start_row * bytesperrow;
|
file_offset = (long) ptr->cur_start_row * bytesperrow;
|
||||||
/* Loop to read or write each allocation chunk in mem_buffer */
|
/* Loop to read or write each allocation chunk in mem_buffer */
|
||||||
for (i = 0; i < (long) ptr->rows_in_mem; i += ptr->rowsperchunk) {
|
for (i = 0; i < (long) ptr->rows_in_mem; i += ptr->rowsperchunk) {
|
||||||
/* One chunk, but check for short chunk at end of buffer */
|
/* One chunk, but check for short chunk at end of buffer */
|
||||||
|
|||||||
Vendored
+6
-2
@@ -2,6 +2,7 @@
|
|||||||
* jmemnobs.c
|
* jmemnobs.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 1992-1996, Thomas G. Lane.
|
* Copyright (C) 1992-1996, Thomas G. Lane.
|
||||||
|
* Modified 2019 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.
|
||||||
*
|
*
|
||||||
@@ -12,7 +13,7 @@
|
|||||||
* This is very portable in the sense that it'll compile on almost anything,
|
* This is very portable in the sense that it'll compile on almost anything,
|
||||||
* but you'd better have lots of main memory (or virtual memory) if you want
|
* but you'd better have lots of main memory (or virtual memory) if you want
|
||||||
* to process big images.
|
* to process big images.
|
||||||
* Note that the max_memory_to_use option is ignored by this implementation.
|
* Note that the max_memory_to_use option is respected by this implementation.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define JPEG_INTERNALS
|
#define JPEG_INTERNALS
|
||||||
@@ -66,13 +67,16 @@ jpeg_free_large (j_common_ptr cinfo, void FAR * object, size_t sizeofobject)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* This routine computes the total memory space available for allocation.
|
* This routine computes the total memory space available for allocation.
|
||||||
* Here we always say, "we got all you want bud!"
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
GLOBAL(long)
|
GLOBAL(long)
|
||||||
jpeg_mem_available (j_common_ptr cinfo, long min_bytes_needed,
|
jpeg_mem_available (j_common_ptr cinfo, long min_bytes_needed,
|
||||||
long max_bytes_needed, long already_allocated)
|
long max_bytes_needed, long already_allocated)
|
||||||
{
|
{
|
||||||
|
if (cinfo->mem->max_memory_to_use)
|
||||||
|
return cinfo->mem->max_memory_to_use - already_allocated;
|
||||||
|
|
||||||
|
/* Here we say, "we got all you want bud!" */
|
||||||
return max_bytes_needed;
|
return max_bytes_needed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Vendored
+8
-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-2017 by Guido Vollbeding.
|
* Modified 1997-2019 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.
|
||||||
*
|
*
|
||||||
@@ -302,6 +302,13 @@ struct jpeg_color_quantizer {
|
|||||||
#define RIGHT_SHIFT(x,shft) ((x) >> (shft))
|
#define RIGHT_SHIFT(x,shft) ((x) >> (shft))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Descale and correctly round an INT32 value that's scaled by N bits.
|
||||||
|
* We assume RIGHT_SHIFT rounds towards minus infinity, so adding
|
||||||
|
* the fudge factor is correct for either sign of X.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define DESCALE(x,n) RIGHT_SHIFT((x) + ((INT32) 1 << ((n)-1)), n)
|
||||||
|
|
||||||
|
|
||||||
/* Short forms of external names for systems with brain-damaged linkers. */
|
/* Short forms of external names for systems with brain-damaged linkers. */
|
||||||
|
|
||||||
|
|||||||
Vendored
+7
-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-2017 by Guido Vollbeding.
|
* Modified 2002-2019 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 3
|
#define JPEG_LIB_VERSION_MINOR 4
|
||||||
|
|
||||||
|
|
||||||
/* Various constants determining the sizes of things.
|
/* Various constants determining the sizes of things.
|
||||||
@@ -909,6 +909,7 @@ typedef JMETHOD(boolean, jpeg_marker_parser_method, (j_decompress_ptr cinfo));
|
|||||||
#define jpeg_suppress_tables jSuppressTables
|
#define jpeg_suppress_tables jSuppressTables
|
||||||
#define jpeg_alloc_quant_table jAlcQTable
|
#define jpeg_alloc_quant_table jAlcQTable
|
||||||
#define jpeg_alloc_huff_table jAlcHTable
|
#define jpeg_alloc_huff_table jAlcHTable
|
||||||
|
#define jpeg_std_huff_table jStdHTable
|
||||||
#define jpeg_start_compress jStrtCompress
|
#define jpeg_start_compress jStrtCompress
|
||||||
#define jpeg_write_scanlines jWrtScanlines
|
#define jpeg_write_scanlines jWrtScanlines
|
||||||
#define jpeg_finish_compress jFinCompress
|
#define jpeg_finish_compress jFinCompress
|
||||||
@@ -977,10 +978,10 @@ EXTERN(void) jpeg_stdio_src JPP((j_decompress_ptr cinfo, FILE * infile));
|
|||||||
/* Data source and destination managers: memory buffers. */
|
/* Data source and destination managers: memory buffers. */
|
||||||
EXTERN(void) jpeg_mem_dest JPP((j_compress_ptr cinfo,
|
EXTERN(void) jpeg_mem_dest JPP((j_compress_ptr cinfo,
|
||||||
unsigned char ** outbuffer,
|
unsigned char ** outbuffer,
|
||||||
unsigned long * outsize));
|
size_t * outsize));
|
||||||
EXTERN(void) jpeg_mem_src JPP((j_decompress_ptr cinfo,
|
EXTERN(void) jpeg_mem_src JPP((j_decompress_ptr cinfo,
|
||||||
const unsigned char * inbuffer,
|
const unsigned char * inbuffer,
|
||||||
unsigned long insize));
|
size_t insize));
|
||||||
|
|
||||||
/* Default parameter setup for compression */
|
/* Default parameter setup for compression */
|
||||||
EXTERN(void) jpeg_set_defaults JPP((j_compress_ptr cinfo));
|
EXTERN(void) jpeg_set_defaults JPP((j_compress_ptr cinfo));
|
||||||
@@ -1005,6 +1006,8 @@ EXTERN(void) jpeg_suppress_tables JPP((j_compress_ptr cinfo,
|
|||||||
boolean suppress));
|
boolean suppress));
|
||||||
EXTERN(JQUANT_TBL *) jpeg_alloc_quant_table JPP((j_common_ptr cinfo));
|
EXTERN(JQUANT_TBL *) jpeg_alloc_quant_table JPP((j_common_ptr cinfo));
|
||||||
EXTERN(JHUFF_TBL *) jpeg_alloc_huff_table JPP((j_common_ptr cinfo));
|
EXTERN(JHUFF_TBL *) jpeg_alloc_huff_table JPP((j_common_ptr cinfo));
|
||||||
|
EXTERN(JHUFF_TBL *) jpeg_std_huff_table JPP((j_common_ptr cinfo,
|
||||||
|
boolean isDC, int tblno));
|
||||||
|
|
||||||
/* Main entry points for compression */
|
/* Main entry points for compression */
|
||||||
EXTERN(void) jpeg_start_compress JPP((j_compress_ptr cinfo,
|
EXTERN(void) jpeg_start_compress JPP((j_compress_ptr cinfo,
|
||||||
|
|||||||
Vendored
+3
-3
@@ -2,7 +2,7 @@
|
|||||||
* jutils.c
|
* jutils.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 1991-1996, Thomas G. Lane.
|
* Copyright (C) 1991-1996, Thomas G. Lane.
|
||||||
* Modified 2009-2011 by Guido Vollbeding.
|
* Modified 2009-2019 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.
|
||||||
*
|
*
|
||||||
@@ -185,7 +185,7 @@ jcopy_sample_rows (JSAMPARRAY input_array, int source_row,
|
|||||||
{
|
{
|
||||||
register JSAMPROW inptr, outptr;
|
register JSAMPROW inptr, outptr;
|
||||||
#ifdef FMEMCOPY
|
#ifdef FMEMCOPY
|
||||||
register size_t count = (size_t) (num_cols * SIZEOF(JSAMPLE));
|
register size_t count = (size_t) num_cols * SIZEOF(JSAMPLE);
|
||||||
#else
|
#else
|
||||||
register JDIMENSION count;
|
register JDIMENSION count;
|
||||||
#endif
|
#endif
|
||||||
@@ -213,7 +213,7 @@ jcopy_block_row (JBLOCKROW input_row, JBLOCKROW output_row,
|
|||||||
/* Copy a row of coefficient blocks from one place to another. */
|
/* Copy a row of coefficient blocks from one place to another. */
|
||||||
{
|
{
|
||||||
#ifdef FMEMCOPY
|
#ifdef FMEMCOPY
|
||||||
FMEMCOPY(output_row, input_row, num_blocks * (DCTSIZE2 * SIZEOF(JCOEF)));
|
FMEMCOPY(output_row, input_row, (size_t) num_blocks * (DCTSIZE2 * SIZEOF(JCOEF)));
|
||||||
#else
|
#else
|
||||||
register JCOEFPTR inptr, outptr;
|
register JCOEFPTR inptr, outptr;
|
||||||
register long count;
|
register long count;
|
||||||
|
|||||||
Vendored
+3
-3
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* jversion.h
|
* jversion.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 1991-2018, Thomas G. Lane, Guido Vollbeding.
|
* Copyright (C) 1991-2020, 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 "9c 14-Jan-2018"
|
#define JVERSION "9d 12-Jan-2020"
|
||||||
|
|
||||||
#define JCOPYRIGHT "Copyright (C) 2018, Thomas G. Lane, Guido Vollbeding"
|
#define JCOPYRIGHT "Copyright (C) 2020, Thomas G. Lane, Guido Vollbeding"
|
||||||
|
|||||||
Vendored
+80
@@ -0,0 +1,80 @@
|
|||||||
|
# COPYRIGHT
|
||||||
|
# Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
# or more contributor license agreements. See the NOTICE file
|
||||||
|
# distributed with this work for additional information
|
||||||
|
# regarding copyright ownership. The ASF licenses this file
|
||||||
|
# to you under the Apache License, Version 2.0 (the
|
||||||
|
# License); you may not use this file except in compliance
|
||||||
|
# with the License. You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing,
|
||||||
|
# software distributed under the License is distributed on an
|
||||||
|
# AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
# KIND, either express or implied. See the License for the
|
||||||
|
# specific language governing permissions and limitations
|
||||||
|
# under the License.
|
||||||
|
#
|
||||||
|
# Copyright (c) 2020, OPEN AI LAB
|
||||||
|
# Author: qtang@openailab.com or https://github.com/BUG1989
|
||||||
|
# qli@openailab.com
|
||||||
|
# sqfu@openailab.com
|
||||||
|
|
||||||
|
SET(TENGINE_COMMIT_VERSION "e89cf8870de2ff0a80cfe626c0b52b2a16fb302e")
|
||||||
|
SET(OCV_TENGINE_DIR "${OpenCV_BINARY_DIR}/3rdparty/libtengine")
|
||||||
|
SET(OCV_TENGINE_SOURCE_PATH "${OCV_TENGINE_DIR}/Tengine-${TENGINE_COMMIT_VERSION}")
|
||||||
|
|
||||||
|
IF(EXISTS "${OCV_TENGINE_SOURCE_PATH}")
|
||||||
|
MESSAGE(STATUS "Tengine is exist already at: ${OCV_TENGINE_SOURCE_PATH}")
|
||||||
|
|
||||||
|
SET(Tengine_FOUND ON)
|
||||||
|
SET(BUILD_TENGINE ON)
|
||||||
|
ELSE()
|
||||||
|
SET(OCV_TENGINE_FILENAME "${TENGINE_COMMIT_VERSION}.zip")#name
|
||||||
|
SET(OCV_TENGINE_URL "https://github.com/OAID/Tengine/archive/") #url
|
||||||
|
SET(tengine_md5sum 23f61ebb1dd419f1207d8876496289c5) #md5sum
|
||||||
|
|
||||||
|
ocv_download(FILENAME ${OCV_TENGINE_FILENAME}
|
||||||
|
HASH ${tengine_md5sum}
|
||||||
|
URL
|
||||||
|
"${OPENCV_TENGINE_URL}"
|
||||||
|
"$ENV{OPENCV_TENGINE_URL}"
|
||||||
|
"${OCV_TENGINE_URL}"
|
||||||
|
DESTINATION_DIR "${OCV_TENGINE_DIR}"
|
||||||
|
ID TENGINE
|
||||||
|
STATUS res
|
||||||
|
UNPACK RELATIVE_URL)
|
||||||
|
|
||||||
|
if (NOT res)
|
||||||
|
MESSAGE(STATUS "TENGINE DOWNLOAD FAILED. Turning Tengine_FOUND off.")
|
||||||
|
SET(Tengine_FOUND OFF)
|
||||||
|
else ()
|
||||||
|
MESSAGE(STATUS "TENGINE DOWNLOAD success . ")
|
||||||
|
|
||||||
|
SET(Tengine_FOUND ON)
|
||||||
|
SET(BUILD_TENGINE ON)
|
||||||
|
endif()
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
if(BUILD_TENGINE)
|
||||||
|
SET(HAVE_TENGINE 1)
|
||||||
|
|
||||||
|
if(NOT ANDROID)
|
||||||
|
# linux system
|
||||||
|
if(CMAKE_SYSTEM_PROCESSOR STREQUAL arm)
|
||||||
|
SET(TENGINE_TOOLCHAIN_FLAG "-march=armv7-a")
|
||||||
|
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL aarch64) ## AARCH64
|
||||||
|
SET(TENGINE_TOOLCHAIN_FLAG "-march=armv8-a")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
SET(BUILT_IN_OPENCV ON) ## set for tengine compile discern .
|
||||||
|
SET(Tengine_INCLUDE_DIR "${OCV_TENGINE_SOURCE_PATH}/include" CACHE INTERNAL "")
|
||||||
|
if(EXISTS "${OCV_TENGINE_SOURCE_PATH}/CMakeLists.txt")
|
||||||
|
add_subdirectory("${OCV_TENGINE_SOURCE_PATH}" "${OCV_TENGINE_DIR}/build")
|
||||||
|
else()
|
||||||
|
message(WARNING "TENGINE: Missing 'CMakeLists.txt' in source code package: ${OCV_TENGINE_SOURCE_PATH}")
|
||||||
|
endif()
|
||||||
|
SET(Tengine_LIB "tengine" CACHE INTERNAL "")
|
||||||
|
endif()
|
||||||
Vendored
+8
-6
@@ -126,30 +126,30 @@ endif()
|
|||||||
if(SIZEOF_UNSIGNED_INT EQUAL SIZEOF_SIZE_T)
|
if(SIZEOF_UNSIGNED_INT EQUAL SIZEOF_SIZE_T)
|
||||||
set(TIFF_SIZE_T "unsigned int")
|
set(TIFF_SIZE_T "unsigned int")
|
||||||
set(TIFF_SIZE_FORMAT "%u")
|
set(TIFF_SIZE_FORMAT "%u")
|
||||||
|
set(TIFF_SSIZE_T "signed int")
|
||||||
|
set(TIFF_SSIZE_FORMAT "%d")
|
||||||
elseif(SIZEOF_UNSIGNED_LONG EQUAL SIZEOF_SIZE_T)
|
elseif(SIZEOF_UNSIGNED_LONG EQUAL SIZEOF_SIZE_T)
|
||||||
set(TIFF_SIZE_T "unsigned long")
|
set(TIFF_SIZE_T "unsigned long")
|
||||||
set(TIFF_SIZE_FORMAT "%lu")
|
set(TIFF_SIZE_FORMAT "%lu")
|
||||||
|
set(TIFF_SSIZE_T "signed long")
|
||||||
|
set(TIFF_SSIZE_FORMAT "%ld")
|
||||||
elseif(SIZEOF_UNSIGNED_LONG_LONG EQUAL SIZEOF_SIZE_T)
|
elseif(SIZEOF_UNSIGNED_LONG_LONG EQUAL SIZEOF_SIZE_T)
|
||||||
set(TIFF_SIZE_T "unsigned long")
|
set(TIFF_SIZE_T "unsigned long")
|
||||||
if(MINGW)
|
if(MINGW)
|
||||||
set(TIFF_SIZE_FORMAT "%I64u")
|
set(TIFF_SIZE_FORMAT "%I64u")
|
||||||
|
set(TIFF_SSIZE_FORMAT "%I64d")
|
||||||
else()
|
else()
|
||||||
set(TIFF_SIZE_FORMAT "%llu")
|
set(TIFF_SIZE_FORMAT "%llu")
|
||||||
|
set(TIFF_SSIZE_FORMAT "%lld")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(SIZEOF_SIGNED_INT EQUAL SIZEOF_UNSIGNED_CHAR_P)
|
if(SIZEOF_SIGNED_INT EQUAL SIZEOF_UNSIGNED_CHAR_P)
|
||||||
set(TIFF_SSIZE_T "signed int")
|
|
||||||
set(TIFF_SSIZE_FORMAT "%d")
|
|
||||||
elseif(SIZEOF_SIGNED_LONG EQUAL SIZEOF_UNSIGNED_CHAR_P)
|
elseif(SIZEOF_SIGNED_LONG EQUAL SIZEOF_UNSIGNED_CHAR_P)
|
||||||
set(TIFF_SSIZE_T "signed long")
|
|
||||||
set(TIFF_SSIZE_FORMAT "%ld")
|
|
||||||
elseif(SIZEOF_SIGNED_LONG_LONG EQUAL SIZEOF_UNSIGNED_CHAR_P)
|
elseif(SIZEOF_SIGNED_LONG_LONG EQUAL SIZEOF_UNSIGNED_CHAR_P)
|
||||||
set(TIFF_SSIZE_T "signed long long")
|
set(TIFF_SSIZE_T "signed long long")
|
||||||
if(MINGW)
|
if(MINGW)
|
||||||
set(TIFF_SSIZE_FORMAT "%I64d")
|
|
||||||
else()
|
else()
|
||||||
set(TIFF_SSIZE_FORMAT "%lld")
|
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@@ -216,6 +216,8 @@ endif()
|
|||||||
set(fillorder FILLORDER_MSB2LSB)
|
set(fillorder FILLORDER_MSB2LSB)
|
||||||
if(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "i.*86.*" OR
|
if(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "i.*86.*" OR
|
||||||
CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "amd64.*" OR
|
CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "amd64.*" OR
|
||||||
|
# AMD64 on Windows
|
||||||
|
CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "AMD64" OR
|
||||||
CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "x86_64.*")
|
CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "x86_64.*")
|
||||||
set(fillorder FILLORDER_LSB2MSB)
|
set(fillorder FILLORDER_LSB2MSB)
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
Vendored
+4
@@ -16,7 +16,11 @@ int _TIFF_vsnprintf_f(char* str, size_t size, const char* format, va_list ap)
|
|||||||
int count = -1;
|
int count = -1;
|
||||||
|
|
||||||
if (size != 0)
|
if (size != 0)
|
||||||
|
#if _MSC_VER <= 1310
|
||||||
|
count = _vsnprintf(str, size, format, ap);
|
||||||
|
#else
|
||||||
count = _vsnprintf_s(str, size, _TRUNCATE, format, ap);
|
count = _vsnprintf_s(str, size, _TRUNCATE, format, ap);
|
||||||
|
#endif
|
||||||
if (count == -1)
|
if (count == -1)
|
||||||
count = _vscprintf(format, ap);
|
count = _vscprintf(format, ap);
|
||||||
|
|
||||||
|
|||||||
Vendored
+10
@@ -30,6 +30,7 @@
|
|||||||
#include "tiffiop.h"
|
#include "tiffiop.h"
|
||||||
#include "tif_predict.h"
|
#include "tif_predict.h"
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
#include <float.h>
|
||||||
|
|
||||||
uint32
|
uint32
|
||||||
_TIFFMultiply32(TIFF* tif, uint32 first, uint32 second, const char* where)
|
_TIFFMultiply32(TIFF* tif, uint32 first, uint32 second, const char* where)
|
||||||
@@ -357,6 +358,15 @@ _TIFFUInt64ToDouble(uint64 ui64)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
float _TIFFClampDoubleToFloat( double val )
|
||||||
|
{
|
||||||
|
if( val > FLT_MAX )
|
||||||
|
return FLT_MAX;
|
||||||
|
if( val < -FLT_MAX )
|
||||||
|
return -FLT_MAX;
|
||||||
|
return (float)val;
|
||||||
|
}
|
||||||
|
|
||||||
int _TIFFSeekOK(TIFF* tif, toff_t off)
|
int _TIFFSeekOK(TIFF* tif, toff_t off)
|
||||||
{
|
{
|
||||||
/* Huge offsets, especially -1 / UINT64_MAX, can cause issues */
|
/* Huge offsets, especially -1 / UINT64_MAX, can cause issues */
|
||||||
|
|||||||
+1
-1
@@ -216,7 +216,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Number of bits in a file offset, on hosts where this is settable. */
|
/* Number of bits in a file offset, on hosts where this is settable. */
|
||||||
//disabled for OpenCV CMakeLists.txt: #define _FILE_OFFSET_BITS @FILE_OFFSET_BITS@
|
#define _FILE_OFFSET_BITS @FILE_OFFSET_BITS@
|
||||||
|
|
||||||
/* Define to `__inline__' or `__inline' if that's what the C compiler
|
/* Define to `__inline__' or `__inline' if that's what the C compiler
|
||||||
calls it, or to nothing if 'inline' is not supported under any name. */
|
calls it, or to nothing if 'inline' is not supported under any name. */
|
||||||
|
|||||||
Vendored
+33
-17
@@ -29,7 +29,6 @@
|
|||||||
* (and also some miscellaneous stuff)
|
* (and also some miscellaneous stuff)
|
||||||
*/
|
*/
|
||||||
#include "tiffiop.h"
|
#include "tiffiop.h"
|
||||||
#include <float.h>
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* These are used in the backwards compatibility code...
|
* These are used in the backwards compatibility code...
|
||||||
@@ -88,13 +87,15 @@ setDoubleArrayOneValue(double** vpp, double value, size_t nmemb)
|
|||||||
* Install extra samples information.
|
* Install extra samples information.
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
setExtraSamples(TIFFDirectory* td, va_list ap, uint32* v)
|
setExtraSamples(TIFF* tif, va_list ap, uint32* v)
|
||||||
{
|
{
|
||||||
/* XXX: Unassociated alpha data == 999 is a known Corel Draw bug, see below */
|
/* XXX: Unassociated alpha data == 999 is a known Corel Draw bug, see below */
|
||||||
#define EXTRASAMPLE_COREL_UNASSALPHA 999
|
#define EXTRASAMPLE_COREL_UNASSALPHA 999
|
||||||
|
|
||||||
uint16* va;
|
uint16* va;
|
||||||
uint32 i;
|
uint32 i;
|
||||||
|
TIFFDirectory* td = &tif->tif_dir;
|
||||||
|
static const char module[] = "setExtraSamples";
|
||||||
|
|
||||||
*v = (uint16) va_arg(ap, uint16_vap);
|
*v = (uint16) va_arg(ap, uint16_vap);
|
||||||
if ((uint16) *v > td->td_samplesperpixel)
|
if ((uint16) *v > td->td_samplesperpixel)
|
||||||
@@ -116,6 +117,18 @@ setExtraSamples(TIFFDirectory* td, va_list ap, uint32* v)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( td->td_transferfunction[0] != NULL && (td->td_samplesperpixel - *v > 1) &&
|
||||||
|
!(td->td_samplesperpixel - td->td_extrasamples > 1))
|
||||||
|
{
|
||||||
|
TIFFWarningExt(tif->tif_clientdata,module,
|
||||||
|
"ExtraSamples tag value is changing, "
|
||||||
|
"but TransferFunction was read with a different value. Cancelling it");
|
||||||
|
TIFFClrFieldBit(tif,FIELD_TRANSFERFUNCTION);
|
||||||
|
_TIFFfree(td->td_transferfunction[0]);
|
||||||
|
td->td_transferfunction[0] = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
td->td_extrasamples = (uint16) *v;
|
td->td_extrasamples = (uint16) *v;
|
||||||
_TIFFsetShortArray(&td->td_sampleinfo, va, td->td_extrasamples);
|
_TIFFsetShortArray(&td->td_sampleinfo, va, td->td_extrasamples);
|
||||||
return 1;
|
return 1;
|
||||||
@@ -153,15 +166,6 @@ bad:
|
|||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static float TIFFClampDoubleToFloat( double val )
|
|
||||||
{
|
|
||||||
if( val > FLT_MAX )
|
|
||||||
return FLT_MAX;
|
|
||||||
if( val < -FLT_MAX )
|
|
||||||
return -FLT_MAX;
|
|
||||||
return (float)val;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
_TIFFVSetField(TIFF* tif, uint32 tag, va_list ap)
|
_TIFFVSetField(TIFF* tif, uint32 tag, va_list ap)
|
||||||
{
|
{
|
||||||
@@ -285,6 +289,18 @@ _TIFFVSetField(TIFF* tif, uint32 tag, va_list ap)
|
|||||||
_TIFFfree(td->td_smaxsamplevalue);
|
_TIFFfree(td->td_smaxsamplevalue);
|
||||||
td->td_smaxsamplevalue = NULL;
|
td->td_smaxsamplevalue = NULL;
|
||||||
}
|
}
|
||||||
|
/* Test if 3 transfer functions instead of just one are now needed
|
||||||
|
See http://bugzilla.maptools.org/show_bug.cgi?id=2820 */
|
||||||
|
if( td->td_transferfunction[0] != NULL && (v - td->td_extrasamples > 1) &&
|
||||||
|
!(td->td_samplesperpixel - td->td_extrasamples > 1))
|
||||||
|
{
|
||||||
|
TIFFWarningExt(tif->tif_clientdata,module,
|
||||||
|
"SamplesPerPixel tag value is changing, "
|
||||||
|
"but TransferFunction was read with a different value. Cancelling it");
|
||||||
|
TIFFClrFieldBit(tif,FIELD_TRANSFERFUNCTION);
|
||||||
|
_TIFFfree(td->td_transferfunction[0]);
|
||||||
|
td->td_transferfunction[0] = NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
td->td_samplesperpixel = (uint16) v;
|
td->td_samplesperpixel = (uint16) v;
|
||||||
break;
|
break;
|
||||||
@@ -320,13 +336,13 @@ _TIFFVSetField(TIFF* tif, uint32 tag, va_list ap)
|
|||||||
dblval = va_arg(ap, double);
|
dblval = va_arg(ap, double);
|
||||||
if( dblval < 0 )
|
if( dblval < 0 )
|
||||||
goto badvaluedouble;
|
goto badvaluedouble;
|
||||||
td->td_xresolution = TIFFClampDoubleToFloat( dblval );
|
td->td_xresolution = _TIFFClampDoubleToFloat( dblval );
|
||||||
break;
|
break;
|
||||||
case TIFFTAG_YRESOLUTION:
|
case TIFFTAG_YRESOLUTION:
|
||||||
dblval = va_arg(ap, double);
|
dblval = va_arg(ap, double);
|
||||||
if( dblval < 0 )
|
if( dblval < 0 )
|
||||||
goto badvaluedouble;
|
goto badvaluedouble;
|
||||||
td->td_yresolution = TIFFClampDoubleToFloat( dblval );
|
td->td_yresolution = _TIFFClampDoubleToFloat( dblval );
|
||||||
break;
|
break;
|
||||||
case TIFFTAG_PLANARCONFIG:
|
case TIFFTAG_PLANARCONFIG:
|
||||||
v = (uint16) va_arg(ap, uint16_vap);
|
v = (uint16) va_arg(ap, uint16_vap);
|
||||||
@@ -335,10 +351,10 @@ _TIFFVSetField(TIFF* tif, uint32 tag, va_list ap)
|
|||||||
td->td_planarconfig = (uint16) v;
|
td->td_planarconfig = (uint16) v;
|
||||||
break;
|
break;
|
||||||
case TIFFTAG_XPOSITION:
|
case TIFFTAG_XPOSITION:
|
||||||
td->td_xposition = TIFFClampDoubleToFloat( va_arg(ap, double) );
|
td->td_xposition = _TIFFClampDoubleToFloat( va_arg(ap, double) );
|
||||||
break;
|
break;
|
||||||
case TIFFTAG_YPOSITION:
|
case TIFFTAG_YPOSITION:
|
||||||
td->td_yposition = TIFFClampDoubleToFloat( va_arg(ap, double) );
|
td->td_yposition = _TIFFClampDoubleToFloat( va_arg(ap, double) );
|
||||||
break;
|
break;
|
||||||
case TIFFTAG_RESOLUTIONUNIT:
|
case TIFFTAG_RESOLUTIONUNIT:
|
||||||
v = (uint16) va_arg(ap, uint16_vap);
|
v = (uint16) va_arg(ap, uint16_vap);
|
||||||
@@ -361,7 +377,7 @@ _TIFFVSetField(TIFF* tif, uint32 tag, va_list ap)
|
|||||||
_TIFFsetShortArray(&td->td_colormap[2], va_arg(ap, uint16*), v32);
|
_TIFFsetShortArray(&td->td_colormap[2], va_arg(ap, uint16*), v32);
|
||||||
break;
|
break;
|
||||||
case TIFFTAG_EXTRASAMPLES:
|
case TIFFTAG_EXTRASAMPLES:
|
||||||
if (!setExtraSamples(td, ap, &v))
|
if (!setExtraSamples(tif, ap, &v))
|
||||||
goto badvalue;
|
goto badvalue;
|
||||||
break;
|
break;
|
||||||
case TIFFTAG_MATTEING:
|
case TIFFTAG_MATTEING:
|
||||||
@@ -684,7 +700,7 @@ _TIFFVSetField(TIFF* tif, uint32 tag, va_list ap)
|
|||||||
case TIFF_SRATIONAL:
|
case TIFF_SRATIONAL:
|
||||||
case TIFF_FLOAT:
|
case TIFF_FLOAT:
|
||||||
{
|
{
|
||||||
float v2 = TIFFClampDoubleToFloat(va_arg(ap, double));
|
float v2 = _TIFFClampDoubleToFloat(va_arg(ap, double));
|
||||||
_TIFFmemcpy(val, &v2, tv_size);
|
_TIFFmemcpy(val, &v2, tv_size);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
Vendored
+164
-36
@@ -164,6 +164,7 @@ static int TIFFFetchNormalTag(TIFF*, TIFFDirEntry*, int recover);
|
|||||||
static int TIFFFetchStripThing(TIFF* tif, TIFFDirEntry* dir, uint32 nstrips, uint64** lpp);
|
static int TIFFFetchStripThing(TIFF* tif, TIFFDirEntry* dir, uint32 nstrips, uint64** lpp);
|
||||||
static int TIFFFetchSubjectDistance(TIFF*, TIFFDirEntry*);
|
static int TIFFFetchSubjectDistance(TIFF*, TIFFDirEntry*);
|
||||||
static void ChopUpSingleUncompressedStrip(TIFF*);
|
static void ChopUpSingleUncompressedStrip(TIFF*);
|
||||||
|
static void TryChopUpUncompressedBigTiff(TIFF*);
|
||||||
static uint64 TIFFReadUInt64(const uint8 *value);
|
static uint64 TIFFReadUInt64(const uint8 *value);
|
||||||
static int _TIFFGetMaxColorChannels(uint16 photometric);
|
static int _TIFFGetMaxColorChannels(uint16 photometric);
|
||||||
|
|
||||||
@@ -4246,6 +4247,19 @@ TIFFReadDirectory(TIFF* tif)
|
|||||||
ChopUpSingleUncompressedStrip(tif);
|
ChopUpSingleUncompressedStrip(tif);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* There are also uncompressed stripped files with strips larger than */
|
||||||
|
/* 2 GB, which make them unfriendly with a lot of code. If possible, */
|
||||||
|
/* try to expose smaller "virtual" strips. */
|
||||||
|
if( tif->tif_dir.td_planarconfig == PLANARCONFIG_CONTIG &&
|
||||||
|
tif->tif_dir.td_compression == COMPRESSION_NONE &&
|
||||||
|
(tif->tif_flags&(TIFF_STRIPCHOP|TIFF_ISTILED)) == TIFF_STRIPCHOP &&
|
||||||
|
TIFFStripSize64(tif) > 0x7FFFFFFFUL )
|
||||||
|
{
|
||||||
|
if ( !_TIFFFillStriles(tif) || !tif->tif_dir.td_stripbytecount )
|
||||||
|
return 0;
|
||||||
|
TryChopUpUncompressedBigTiff(tif);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Clear the dirty directory flag.
|
* Clear the dirty directory flag.
|
||||||
*/
|
*/
|
||||||
@@ -5699,6 +5713,63 @@ TIFFFetchSubjectDistance(TIFF* tif, TIFFDirEntry* dir)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void allocChoppedUpStripArrays(TIFF* tif, uint32 nstrips,
|
||||||
|
uint64 stripbytes, uint32 rowsperstrip)
|
||||||
|
{
|
||||||
|
TIFFDirectory *td = &tif->tif_dir;
|
||||||
|
uint64 bytecount;
|
||||||
|
uint64 offset;
|
||||||
|
uint32 i;
|
||||||
|
uint64 *newcounts;
|
||||||
|
uint64 *newoffsets;
|
||||||
|
|
||||||
|
newcounts = (uint64*) _TIFFCheckMalloc(tif, nstrips, sizeof (uint64),
|
||||||
|
"for chopped \"StripByteCounts\" array");
|
||||||
|
newoffsets = (uint64*) _TIFFCheckMalloc(tif, nstrips, sizeof (uint64),
|
||||||
|
"for chopped \"StripOffsets\" array");
|
||||||
|
if (newcounts == NULL || newoffsets == NULL) {
|
||||||
|
/*
|
||||||
|
* Unable to allocate new strip information, give up and use
|
||||||
|
* the original one strip information.
|
||||||
|
*/
|
||||||
|
if (newcounts != NULL)
|
||||||
|
_TIFFfree(newcounts);
|
||||||
|
if (newoffsets != NULL)
|
||||||
|
_TIFFfree(newoffsets);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Fill the strip information arrays with new bytecounts and offsets
|
||||||
|
* that reflect the broken-up format.
|
||||||
|
*/
|
||||||
|
offset = td->td_stripoffset[0];
|
||||||
|
bytecount = td->td_stripoffset[td->td_nstrips-1] +
|
||||||
|
td->td_stripbytecount[td->td_nstrips-1] - offset;
|
||||||
|
for (i = 0; i < nstrips; i++)
|
||||||
|
{
|
||||||
|
if (stripbytes > bytecount)
|
||||||
|
stripbytes = bytecount;
|
||||||
|
newcounts[i] = stripbytes;
|
||||||
|
newoffsets[i] = stripbytes ? offset : 0;
|
||||||
|
offset += stripbytes;
|
||||||
|
bytecount -= stripbytes;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Replace old single strip info with multi-strip info.
|
||||||
|
*/
|
||||||
|
td->td_stripsperimage = td->td_nstrips = nstrips;
|
||||||
|
TIFFSetField(tif, TIFFTAG_ROWSPERSTRIP, rowsperstrip);
|
||||||
|
|
||||||
|
_TIFFfree(td->td_stripbytecount);
|
||||||
|
_TIFFfree(td->td_stripoffset);
|
||||||
|
td->td_stripbytecount = newcounts;
|
||||||
|
td->td_stripoffset = newoffsets;
|
||||||
|
td->td_stripbytecountsorted = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Replace a single strip (tile) of uncompressed data by multiple strips
|
* Replace a single strip (tile) of uncompressed data by multiple strips
|
||||||
* (tiles), each approximately STRIP_SIZE_DEFAULT bytes. This is useful for
|
* (tiles), each approximately STRIP_SIZE_DEFAULT bytes. This is useful for
|
||||||
@@ -5714,11 +5785,8 @@ ChopUpSingleUncompressedStrip(TIFF* tif)
|
|||||||
uint32 rowblock;
|
uint32 rowblock;
|
||||||
uint64 rowblockbytes;
|
uint64 rowblockbytes;
|
||||||
uint64 stripbytes;
|
uint64 stripbytes;
|
||||||
uint32 strip;
|
|
||||||
uint32 nstrips;
|
uint32 nstrips;
|
||||||
uint32 rowsperstrip;
|
uint32 rowsperstrip;
|
||||||
uint64* newcounts;
|
|
||||||
uint64* newoffsets;
|
|
||||||
|
|
||||||
bytecount = td->td_stripbytecount[0];
|
bytecount = td->td_stripbytecount[0];
|
||||||
/* On a newly created file, just re-opened to be filled, we */
|
/* On a newly created file, just re-opened to be filled, we */
|
||||||
@@ -5769,45 +5837,105 @@ ChopUpSingleUncompressedStrip(TIFF* tif)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
newcounts = (uint64*) _TIFFCheckMalloc(tif, nstrips, sizeof (uint64),
|
allocChoppedUpStripArrays(tif, nstrips, stripbytes, rowsperstrip);
|
||||||
"for chopped \"StripByteCounts\" array");
|
}
|
||||||
newoffsets = (uint64*) _TIFFCheckMalloc(tif, nstrips, sizeof (uint64),
|
|
||||||
"for chopped \"StripOffsets\" array");
|
|
||||||
if (newcounts == NULL || newoffsets == NULL) {
|
|
||||||
/*
|
/*
|
||||||
* Unable to allocate new strip information, give up and use
|
* Replace a file with contiguous strips > 2 GB of uncompressed data by
|
||||||
* the original one strip information.
|
* multiple smaller strips. This is useful for
|
||||||
|
* dealing with large images or for dealing with machines with a limited
|
||||||
|
* amount memory.
|
||||||
*/
|
*/
|
||||||
if (newcounts != NULL)
|
static void TryChopUpUncompressedBigTiff( TIFF* tif )
|
||||||
_TIFFfree(newcounts);
|
{
|
||||||
if (newoffsets != NULL)
|
TIFFDirectory *td = &tif->tif_dir;
|
||||||
_TIFFfree(newoffsets);
|
uint32 rowblock;
|
||||||
|
uint64 rowblockbytes;
|
||||||
|
uint32 i;
|
||||||
|
uint64 stripsize;
|
||||||
|
uint32 rowblocksperstrip;
|
||||||
|
uint32 rowsperstrip;
|
||||||
|
uint64 stripbytes;
|
||||||
|
uint32 nstrips;
|
||||||
|
|
||||||
|
stripsize = TIFFStripSize64(tif);
|
||||||
|
|
||||||
|
assert( tif->tif_dir.td_planarconfig == PLANARCONFIG_CONTIG );
|
||||||
|
assert( tif->tif_dir.td_compression == COMPRESSION_NONE );
|
||||||
|
assert( (tif->tif_flags&(TIFF_STRIPCHOP|TIFF_ISTILED)) == TIFF_STRIPCHOP );
|
||||||
|
assert( stripsize > 0x7FFFFFFFUL );
|
||||||
|
|
||||||
|
/* On a newly created file, just re-opened to be filled, we */
|
||||||
|
/* don't want strip chop to trigger as it is going to cause issues */
|
||||||
|
/* later ( StripOffsets and StripByteCounts improperly filled) . */
|
||||||
|
if( td->td_stripbytecount[0] == 0 && tif->tif_mode != O_RDONLY )
|
||||||
|
return;
|
||||||
|
|
||||||
|
if ((td->td_photometric == PHOTOMETRIC_YCBCR)&&
|
||||||
|
(!isUpSampled(tif)))
|
||||||
|
rowblock = td->td_ycbcrsubsampling[1];
|
||||||
|
else
|
||||||
|
rowblock = 1;
|
||||||
|
rowblockbytes = TIFFVStripSize64(tif, rowblock);
|
||||||
|
if( rowblockbytes == 0 || rowblockbytes > 0x7FFFFFFFUL )
|
||||||
|
{
|
||||||
|
/* In case of file with gigantic width */
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
* Fill the strip information arrays with new bytecounts and offsets
|
|
||||||
* that reflect the broken-up format.
|
|
||||||
*/
|
|
||||||
for (strip = 0; strip < nstrips; strip++) {
|
|
||||||
if (stripbytes > bytecount)
|
|
||||||
stripbytes = bytecount;
|
|
||||||
newcounts[strip] = stripbytes;
|
|
||||||
newoffsets[strip] = stripbytes ? offset : 0;
|
|
||||||
offset += stripbytes;
|
|
||||||
bytecount -= stripbytes;
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
* Replace old single strip info with multi-strip info.
|
|
||||||
*/
|
|
||||||
td->td_stripsperimage = td->td_nstrips = nstrips;
|
|
||||||
TIFFSetField(tif, TIFFTAG_ROWSPERSTRIP, rowsperstrip);
|
|
||||||
|
|
||||||
_TIFFfree(td->td_stripbytecount);
|
/* Check that the strips are contiguous and of the expected size */
|
||||||
_TIFFfree(td->td_stripoffset);
|
for( i = 0; i < td->td_nstrips; i++ )
|
||||||
td->td_stripbytecount = newcounts;
|
{
|
||||||
td->td_stripoffset = newoffsets;
|
if( i == td->td_nstrips - 1 )
|
||||||
td->td_stripbytecountsorted = 1;
|
{
|
||||||
|
if( td->td_stripbytecount[i] < TIFFVStripSize64(
|
||||||
|
tif, td->td_imagelength - i * td->td_rowsperstrip ) )
|
||||||
|
{
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if( td->td_stripbytecount[i] != stripsize )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if( i > 0 && td->td_stripoffset[i] !=
|
||||||
|
td->td_stripoffset[i-1] + td->td_stripbytecount[i - 1] )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Aim for 512 MB strips (that will still be manageable by 32 bit builds */
|
||||||
|
rowblocksperstrip = (uint32) (512 * 1024 * 1024 / rowblockbytes);
|
||||||
|
if( rowblocksperstrip == 0 )
|
||||||
|
rowblocksperstrip = 1;
|
||||||
|
rowsperstrip = rowblocksperstrip * rowblock;
|
||||||
|
stripbytes = rowblocksperstrip * rowblockbytes;
|
||||||
|
assert( stripbytes <= 0x7FFFFFFFUL );
|
||||||
|
|
||||||
|
nstrips = TIFFhowmany_32(td->td_imagelength, rowsperstrip);
|
||||||
|
if( nstrips == 0 )
|
||||||
|
return;
|
||||||
|
|
||||||
|
/* If we are going to allocate a lot of memory, make sure that the */
|
||||||
|
/* file is as big as needed */
|
||||||
|
if( tif->tif_mode == O_RDONLY &&
|
||||||
|
nstrips > 1000000 &&
|
||||||
|
(td->td_stripoffset[td->td_nstrips-1] > TIFFGetFileSize(tif) ||
|
||||||
|
td->td_stripoffset[td->td_nstrips-1] +
|
||||||
|
td->td_stripbytecount[td->td_nstrips-1] > TIFFGetFileSize(tif)) )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
allocChoppedUpStripArrays(tif, nstrips, stripbytes, rowsperstrip);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int _TIFFFillStriles( TIFF *tif )
|
int _TIFFFillStriles( TIFF *tif )
|
||||||
{
|
{
|
||||||
|
|||||||
Vendored
+5
-13
@@ -28,7 +28,6 @@
|
|||||||
* Directory Write Support Routines.
|
* Directory Write Support Routines.
|
||||||
*/
|
*/
|
||||||
#include "tiffiop.h"
|
#include "tiffiop.h"
|
||||||
#include <float.h>
|
|
||||||
|
|
||||||
#ifdef HAVE_IEEEFP
|
#ifdef HAVE_IEEEFP
|
||||||
#define TIFFCvtNativeToIEEEFloat(tif, n, fp)
|
#define TIFFCvtNativeToIEEEFloat(tif, n, fp)
|
||||||
@@ -946,15 +945,6 @@ bad:
|
|||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static float TIFFClampDoubleToFloat( double val )
|
|
||||||
{
|
|
||||||
if( val > FLT_MAX )
|
|
||||||
return FLT_MAX;
|
|
||||||
if( val < -FLT_MAX )
|
|
||||||
return -FLT_MAX;
|
|
||||||
return (float)val;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int8 TIFFClampDoubleToInt8( double val )
|
static int8 TIFFClampDoubleToInt8( double val )
|
||||||
{
|
{
|
||||||
if( val > 127 )
|
if( val > 127 )
|
||||||
@@ -1029,7 +1019,7 @@ TIFFWriteDirectoryTagSampleformatArray(TIFF* tif, uint32* ndir, TIFFDirEntry* di
|
|||||||
if (tif->tif_dir.td_bitspersample<=32)
|
if (tif->tif_dir.td_bitspersample<=32)
|
||||||
{
|
{
|
||||||
for (i = 0; i < count; ++i)
|
for (i = 0; i < count; ++i)
|
||||||
((float*)conv)[i] = TIFFClampDoubleToFloat(value[i]);
|
((float*)conv)[i] = _TIFFClampDoubleToFloat(value[i]);
|
||||||
ok = TIFFWriteDirectoryTagFloatArray(tif,ndir,dir,tag,count,(float*)conv);
|
ok = TIFFWriteDirectoryTagFloatArray(tif,ndir,dir,tag,count,(float*)conv);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -1893,12 +1883,14 @@ TIFFWriteDirectoryTagTransferfunction(TIFF* tif, uint32* ndir, TIFFDirEntry* dir
|
|||||||
n=3;
|
n=3;
|
||||||
if (n==3)
|
if (n==3)
|
||||||
{
|
{
|
||||||
if (!_TIFFmemcmp(tif->tif_dir.td_transferfunction[0],tif->tif_dir.td_transferfunction[2],m*sizeof(uint16)))
|
if (tif->tif_dir.td_transferfunction[2] == NULL ||
|
||||||
|
!_TIFFmemcmp(tif->tif_dir.td_transferfunction[0],tif->tif_dir.td_transferfunction[2],m*sizeof(uint16)))
|
||||||
n=2;
|
n=2;
|
||||||
}
|
}
|
||||||
if (n==2)
|
if (n==2)
|
||||||
{
|
{
|
||||||
if (!_TIFFmemcmp(tif->tif_dir.td_transferfunction[0],tif->tif_dir.td_transferfunction[1],m*sizeof(uint16)))
|
if (tif->tif_dir.td_transferfunction[1] == NULL ||
|
||||||
|
!_TIFFmemcmp(tif->tif_dir.td_transferfunction[0],tif->tif_dir.td_transferfunction[1],m*sizeof(uint16)))
|
||||||
n=1;
|
n=1;
|
||||||
}
|
}
|
||||||
if (n==0)
|
if (n==0)
|
||||||
|
|||||||
Vendored
+8
-3
@@ -742,9 +742,14 @@ LogLuvEncodeTile(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
|
|||||||
#undef exp2 /* Conflict with C'99 function */
|
#undef exp2 /* Conflict with C'99 function */
|
||||||
#define exp2(x) exp(M_LN2*(x))
|
#define exp2(x) exp(M_LN2*(x))
|
||||||
|
|
||||||
#define itrunc(x,m) ((m)==SGILOGENCODE_NODITHER ? \
|
static int itrunc(double x, int m)
|
||||||
(int)(x) : \
|
{
|
||||||
(int)((x) + rand()*(1./RAND_MAX) - .5))
|
if( m == SGILOGENCODE_NODITHER )
|
||||||
|
return (int)x;
|
||||||
|
/* Silence CoverityScan warning about bad crypto function */
|
||||||
|
/* coverity[dont_call] */
|
||||||
|
return (int)(x + rand()*(1./RAND_MAX) - .5);
|
||||||
|
}
|
||||||
|
|
||||||
#if !LOGLUV_PUBLIC
|
#if !LOGLUV_PUBLIC
|
||||||
static
|
static
|
||||||
|
|||||||
Vendored
+2
@@ -247,6 +247,8 @@ LZWSetupDecode(TIFF* tif)
|
|||||||
/*
|
/*
|
||||||
* Zero-out the unused entries
|
* Zero-out the unused entries
|
||||||
*/
|
*/
|
||||||
|
/* Silence false positive */
|
||||||
|
/* coverity[overrun-buffer-arg] */
|
||||||
_TIFFmemset(&sp->dec_codetab[CODE_CLEAR], 0,
|
_TIFFmemset(&sp->dec_codetab[CODE_CLEAR], 0,
|
||||||
(CODE_FIRST - CODE_CLEAR) * sizeof (code_t));
|
(CODE_FIRST - CODE_CLEAR) * sizeof (code_t));
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+2
-2
@@ -640,6 +640,7 @@ PixarLogGuessDataFmt(TIFFDirectory *td)
|
|||||||
static tmsize_t
|
static tmsize_t
|
||||||
multiply_ms(tmsize_t m1, tmsize_t m2)
|
multiply_ms(tmsize_t m1, tmsize_t m2)
|
||||||
{
|
{
|
||||||
|
assert(m1 >= 0 && m2 >= 0);
|
||||||
if( m1 == 0 || m2 > TIFF_TMSIZE_T_MAX / m1 )
|
if( m1 == 0 || m2 > TIFF_TMSIZE_T_MAX / m1 )
|
||||||
return 0;
|
return 0;
|
||||||
return m1 * m2;
|
return m1 * m2;
|
||||||
@@ -648,6 +649,7 @@ multiply_ms(tmsize_t m1, tmsize_t m2)
|
|||||||
static tmsize_t
|
static tmsize_t
|
||||||
add_ms(tmsize_t m1, tmsize_t m2)
|
add_ms(tmsize_t m1, tmsize_t m2)
|
||||||
{
|
{
|
||||||
|
assert(m1 >= 0 && m2 >= 0);
|
||||||
/* if either input is zero, assume overflow already occurred */
|
/* if either input is zero, assume overflow already occurred */
|
||||||
if (m1 == 0 || m2 == 0)
|
if (m1 == 0 || m2 == 0)
|
||||||
return 0;
|
return 0;
|
||||||
@@ -817,9 +819,7 @@ PixarLogDecode(TIFF* tif, uint8* op, tmsize_t occ, uint16 s)
|
|||||||
TIFFErrorExt(tif->tif_clientdata, module,
|
TIFFErrorExt(tif->tif_clientdata, module,
|
||||||
"Decoding error at scanline %lu, %s",
|
"Decoding error at scanline %lu, %s",
|
||||||
(unsigned long) tif->tif_row, sp->stream.msg ? sp->stream.msg : "(null)");
|
(unsigned long) tif->tif_row, sp->stream.msg ? sp->stream.msg : "(null)");
|
||||||
if (inflateSync(&sp->stream) != Z_OK)
|
|
||||||
return (0);
|
return (0);
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
if (state != Z_OK) {
|
if (state != Z_OK) {
|
||||||
TIFFErrorExt(tif->tif_clientdata, module, "ZLib error: %s",
|
TIFFErrorExt(tif->tif_clientdata, module, "ZLib error: %s",
|
||||||
|
|||||||
Vendored
+7
-1
@@ -103,6 +103,11 @@ static int TIFFReadAndRealloc( TIFF* tif, tmsize_t size,
|
|||||||
}
|
}
|
||||||
tif->tif_rawdata = new_rawdata;
|
tif->tif_rawdata = new_rawdata;
|
||||||
}
|
}
|
||||||
|
if( tif->tif_rawdata == NULL )
|
||||||
|
{
|
||||||
|
/* should not happen in practice but helps CoverityScan */
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
bytes_read = TIFFReadFile(tif,
|
bytes_read = TIFFReadFile(tif,
|
||||||
tif->tif_rawdata + rawdata_offset + already_read, to_read);
|
tif->tif_rawdata + rawdata_offset + already_read, to_read);
|
||||||
@@ -1367,7 +1372,8 @@ TIFFFillTile(TIFF* tif, uint32 tile)
|
|||||||
tif->tif_rawdataoff = 0;
|
tif->tif_rawdataoff = 0;
|
||||||
tif->tif_rawdataloaded = bytecountm;
|
tif->tif_rawdataloaded = bytecountm;
|
||||||
|
|
||||||
if (!isFillOrder(tif, td->td_fillorder) &&
|
if (tif->tif_rawdata != NULL &&
|
||||||
|
!isFillOrder(tif, td->td_fillorder) &&
|
||||||
(tif->tif_flags & TIFF_NOBITREV) == 0)
|
(tif->tif_flags & TIFF_NOBITREV) == 0)
|
||||||
TIFFReverseBits(tif->tif_rawdata,
|
TIFFReverseBits(tif->tif_rawdata,
|
||||||
tif->tif_rawdataloaded);
|
tif->tif_rawdataloaded);
|
||||||
|
|||||||
Vendored
+19
-8
@@ -349,6 +349,12 @@ TWebPSetupEncode(TIFF* tif)
|
|||||||
|
|
||||||
sp->state |= LSTATE_INIT_ENCODE;
|
sp->state |= LSTATE_INIT_ENCODE;
|
||||||
|
|
||||||
|
if (!WebPPictureInit(&sp->sPicture)) {
|
||||||
|
TIFFErrorExt(tif->tif_clientdata, module,
|
||||||
|
"Error initializing WebP picture.");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (!WebPConfigInitInternal(&sp->sEncoderConfig, WEBP_PRESET_DEFAULT,
|
if (!WebPConfigInitInternal(&sp->sEncoderConfig, WEBP_PRESET_DEFAULT,
|
||||||
sp->quality_level,
|
sp->quality_level,
|
||||||
WEBP_ENCODER_ABI_VERSION)) {
|
WEBP_ENCODER_ABI_VERSION)) {
|
||||||
@@ -357,8 +363,12 @@ TWebPSetupEncode(TIFF* tif)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// WebPConfigInitInternal above sets lossless to false
|
||||||
#if WEBP_ENCODER_ABI_VERSION >= 0x0100
|
#if WEBP_ENCODER_ABI_VERSION >= 0x0100
|
||||||
sp->sEncoderConfig.lossless = sp->lossless;
|
sp->sEncoderConfig.lossless = sp->lossless;
|
||||||
|
if (sp->lossless) {
|
||||||
|
sp->sPicture.use_argb = 1;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!WebPValidateConfig(&sp->sEncoderConfig)) {
|
if (!WebPValidateConfig(&sp->sEncoderConfig)) {
|
||||||
@@ -367,12 +377,6 @@ TWebPSetupEncode(TIFF* tif)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!WebPPictureInit(&sp->sPicture)) {
|
|
||||||
TIFFErrorExt(tif->tif_clientdata, module,
|
|
||||||
"Error initializing WebP picture.");
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -415,6 +419,12 @@ TWebPPreEncode(TIFF* tif, uint16 s)
|
|||||||
/* set up buffer for raw data */
|
/* set up buffer for raw data */
|
||||||
/* given above check and that nSamples <= 4, buffer_size is <= 1 GB */
|
/* given above check and that nSamples <= 4, buffer_size is <= 1 GB */
|
||||||
sp->buffer_size = segment_width * segment_height * sp->nSamples;
|
sp->buffer_size = segment_width * segment_height * sp->nSamples;
|
||||||
|
|
||||||
|
if (sp->pBuffer != NULL) {
|
||||||
|
_TIFFfree(sp->pBuffer);
|
||||||
|
sp->pBuffer = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
sp->pBuffer = _TIFFmalloc(sp->buffer_size);
|
sp->pBuffer = _TIFFmalloc(sp->buffer_size);
|
||||||
if( !sp->pBuffer) {
|
if( !sp->pBuffer) {
|
||||||
TIFFErrorExt(tif->tif_clientdata, module, "Cannot allocate buffer");
|
TIFFErrorExt(tif->tif_clientdata, module, "Cannot allocate buffer");
|
||||||
@@ -544,10 +554,8 @@ TWebPCleanup(TIFF* tif)
|
|||||||
sp->pBuffer = NULL;
|
sp->pBuffer = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tif->tif_data) {
|
|
||||||
_TIFFfree(tif->tif_data);
|
_TIFFfree(tif->tif_data);
|
||||||
tif->tif_data = NULL;
|
tif->tif_data = NULL;
|
||||||
}
|
|
||||||
|
|
||||||
_TIFFSetDefaultCompressionState(tif);
|
_TIFFSetDefaultCompressionState(tif);
|
||||||
}
|
}
|
||||||
@@ -570,6 +578,9 @@ TWebPVSetField(TIFF* tif, uint32 tag, va_list ap)
|
|||||||
case TIFFTAG_WEBP_LOSSLESS:
|
case TIFFTAG_WEBP_LOSSLESS:
|
||||||
#if WEBP_ENCODER_ABI_VERSION >= 0x0100
|
#if WEBP_ENCODER_ABI_VERSION >= 0x0100
|
||||||
sp->lossless = va_arg(ap, int);
|
sp->lossless = va_arg(ap, int);
|
||||||
|
if (sp->lossless){
|
||||||
|
sp->quality_level = 100.0f;
|
||||||
|
}
|
||||||
return 1;
|
return 1;
|
||||||
#else
|
#else
|
||||||
TIFFErrorExt(tif->tif_clientdata, module,
|
TIFFErrorExt(tif->tif_clientdata, module,
|
||||||
|
|||||||
Vendored
+19
-37
@@ -124,7 +124,6 @@ ZIPSetupDecode(TIFF* tif)
|
|||||||
static int
|
static int
|
||||||
ZIPPreDecode(TIFF* tif, uint16 s)
|
ZIPPreDecode(TIFF* tif, uint16 s)
|
||||||
{
|
{
|
||||||
static const char module[] = "ZIPPreDecode";
|
|
||||||
ZIPState* sp = DecoderState(tif);
|
ZIPState* sp = DecoderState(tif);
|
||||||
|
|
||||||
(void) s;
|
(void) s;
|
||||||
@@ -138,12 +137,7 @@ ZIPPreDecode(TIFF* tif, uint16 s)
|
|||||||
we need to simplify this code to reflect a ZLib that is likely updated
|
we need to simplify this code to reflect a ZLib that is likely updated
|
||||||
to deal with 8byte memory sizes, though this code will respond
|
to deal with 8byte memory sizes, though this code will respond
|
||||||
appropriately even before we simplify it */
|
appropriately even before we simplify it */
|
||||||
sp->stream.avail_in = (uInt) tif->tif_rawcc;
|
sp->stream.avail_in = (uint64)tif->tif_rawcc < 0xFFFFFFFFU ? (uInt) tif->tif_rawcc : 0xFFFFFFFFU;
|
||||||
if ((tmsize_t)sp->stream.avail_in != tif->tif_rawcc)
|
|
||||||
{
|
|
||||||
TIFFErrorExt(tif->tif_clientdata, module, "ZLib cannot deal with buffers this size");
|
|
||||||
return (0);
|
|
||||||
}
|
|
||||||
return (inflateReset(&sp->stream) == Z_OK);
|
return (inflateReset(&sp->stream) == Z_OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -158,46 +152,43 @@ ZIPDecode(TIFF* tif, uint8* op, tmsize_t occ, uint16 s)
|
|||||||
assert(sp->state == ZSTATE_INIT_DECODE);
|
assert(sp->state == ZSTATE_INIT_DECODE);
|
||||||
|
|
||||||
sp->stream.next_in = tif->tif_rawcp;
|
sp->stream.next_in = tif->tif_rawcp;
|
||||||
sp->stream.avail_in = (uInt) tif->tif_rawcc;
|
|
||||||
|
|
||||||
sp->stream.next_out = op;
|
sp->stream.next_out = op;
|
||||||
assert(sizeof(sp->stream.avail_out)==4); /* if this assert gets raised,
|
assert(sizeof(sp->stream.avail_out)==4); /* if this assert gets raised,
|
||||||
we need to simplify this code to reflect a ZLib that is likely updated
|
we need to simplify this code to reflect a ZLib that is likely updated
|
||||||
to deal with 8byte memory sizes, though this code will respond
|
to deal with 8byte memory sizes, though this code will respond
|
||||||
appropriately even before we simplify it */
|
appropriately even before we simplify it */
|
||||||
sp->stream.avail_out = (uInt) occ;
|
|
||||||
if ((tmsize_t)sp->stream.avail_out != occ)
|
|
||||||
{
|
|
||||||
TIFFErrorExt(tif->tif_clientdata, module, "ZLib cannot deal with buffers this size");
|
|
||||||
return (0);
|
|
||||||
}
|
|
||||||
do {
|
do {
|
||||||
int state = inflate(&sp->stream, Z_PARTIAL_FLUSH);
|
int state;
|
||||||
|
uInt avail_in_before = (uint64)tif->tif_rawcc <= 0xFFFFFFFFU ? (uInt)tif->tif_rawcc : 0xFFFFFFFFU;
|
||||||
|
uInt avail_out_before = (uint64)occ < 0xFFFFFFFFU ? (uInt) occ : 0xFFFFFFFFU;
|
||||||
|
sp->stream.avail_in = avail_in_before;
|
||||||
|
sp->stream.avail_out = avail_out_before;
|
||||||
|
state = inflate(&sp->stream, Z_PARTIAL_FLUSH);
|
||||||
|
tif->tif_rawcc -= (avail_in_before - sp->stream.avail_in);
|
||||||
|
occ -= (avail_out_before - sp->stream.avail_out);
|
||||||
if (state == Z_STREAM_END)
|
if (state == Z_STREAM_END)
|
||||||
break;
|
break;
|
||||||
if (state == Z_DATA_ERROR) {
|
if (state == Z_DATA_ERROR) {
|
||||||
TIFFErrorExt(tif->tif_clientdata, module,
|
TIFFErrorExt(tif->tif_clientdata, module,
|
||||||
"Decoding error at scanline %lu, %s",
|
"Decoding error at scanline %lu, %s",
|
||||||
(unsigned long) tif->tif_row, SAFE_MSG(sp));
|
(unsigned long) tif->tif_row, SAFE_MSG(sp));
|
||||||
if (inflateSync(&sp->stream) != Z_OK)
|
|
||||||
return (0);
|
return (0);
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
if (state != Z_OK) {
|
if (state != Z_OK) {
|
||||||
TIFFErrorExt(tif->tif_clientdata, module,
|
TIFFErrorExt(tif->tif_clientdata, module,
|
||||||
"ZLib error: %s", SAFE_MSG(sp));
|
"ZLib error: %s", SAFE_MSG(sp));
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
} while (sp->stream.avail_out > 0);
|
} while (occ > 0);
|
||||||
if (sp->stream.avail_out != 0) {
|
if (occ != 0) {
|
||||||
TIFFErrorExt(tif->tif_clientdata, module,
|
TIFFErrorExt(tif->tif_clientdata, module,
|
||||||
"Not enough data at scanline %lu (short " TIFF_UINT64_FORMAT " bytes)",
|
"Not enough data at scanline %lu (short " TIFF_UINT64_FORMAT " bytes)",
|
||||||
(unsigned long) tif->tif_row, (TIFF_UINT64_T) sp->stream.avail_out);
|
(unsigned long) tif->tif_row, (TIFF_UINT64_T) occ);
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
tif->tif_rawcp = sp->stream.next_in;
|
tif->tif_rawcp = sp->stream.next_in;
|
||||||
tif->tif_rawcc = sp->stream.avail_in;
|
|
||||||
|
|
||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
@@ -229,7 +220,6 @@ ZIPSetupEncode(TIFF* tif)
|
|||||||
static int
|
static int
|
||||||
ZIPPreEncode(TIFF* tif, uint16 s)
|
ZIPPreEncode(TIFF* tif, uint16 s)
|
||||||
{
|
{
|
||||||
static const char module[] = "ZIPPreEncode";
|
|
||||||
ZIPState *sp = EncoderState(tif);
|
ZIPState *sp = EncoderState(tif);
|
||||||
|
|
||||||
(void) s;
|
(void) s;
|
||||||
@@ -242,12 +232,7 @@ ZIPPreEncode(TIFF* tif, uint16 s)
|
|||||||
we need to simplify this code to reflect a ZLib that is likely updated
|
we need to simplify this code to reflect a ZLib that is likely updated
|
||||||
to deal with 8byte memory sizes, though this code will respond
|
to deal with 8byte memory sizes, though this code will respond
|
||||||
appropriately even before we simplify it */
|
appropriately even before we simplify it */
|
||||||
sp->stream.avail_out = (uInt)tif->tif_rawdatasize;
|
sp->stream.avail_out = (uint64)tif->tif_rawdatasize <= 0xFFFFFFFFU ? (uInt)tif->tif_rawdatasize : 0xFFFFFFFFU;
|
||||||
if ((tmsize_t)sp->stream.avail_out != tif->tif_rawdatasize)
|
|
||||||
{
|
|
||||||
TIFFErrorExt(tif->tif_clientdata, module, "ZLib cannot deal with buffers this size");
|
|
||||||
return (0);
|
|
||||||
}
|
|
||||||
return (deflateReset(&sp->stream) == Z_OK);
|
return (deflateReset(&sp->stream) == Z_OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -269,13 +254,9 @@ ZIPEncode(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
|
|||||||
we need to simplify this code to reflect a ZLib that is likely updated
|
we need to simplify this code to reflect a ZLib that is likely updated
|
||||||
to deal with 8byte memory sizes, though this code will respond
|
to deal with 8byte memory sizes, though this code will respond
|
||||||
appropriately even before we simplify it */
|
appropriately even before we simplify it */
|
||||||
sp->stream.avail_in = (uInt) cc;
|
|
||||||
if ((tmsize_t)sp->stream.avail_in != cc)
|
|
||||||
{
|
|
||||||
TIFFErrorExt(tif->tif_clientdata, module, "ZLib cannot deal with buffers this size");
|
|
||||||
return (0);
|
|
||||||
}
|
|
||||||
do {
|
do {
|
||||||
|
uInt avail_in_before = (uint64)cc <= 0xFFFFFFFFU ? (uInt)cc : 0xFFFFFFFFU;
|
||||||
|
sp->stream.avail_in = avail_in_before;
|
||||||
if (deflate(&sp->stream, Z_NO_FLUSH) != Z_OK) {
|
if (deflate(&sp->stream, Z_NO_FLUSH) != Z_OK) {
|
||||||
TIFFErrorExt(tif->tif_clientdata, module,
|
TIFFErrorExt(tif->tif_clientdata, module,
|
||||||
"Encoder error: %s",
|
"Encoder error: %s",
|
||||||
@@ -286,9 +267,10 @@ ZIPEncode(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
|
|||||||
tif->tif_rawcc = tif->tif_rawdatasize;
|
tif->tif_rawcc = tif->tif_rawdatasize;
|
||||||
TIFFFlushData1(tif);
|
TIFFFlushData1(tif);
|
||||||
sp->stream.next_out = tif->tif_rawdata;
|
sp->stream.next_out = tif->tif_rawdata;
|
||||||
sp->stream.avail_out = (uInt) tif->tif_rawdatasize; /* this is a safe typecast, as check is made already in ZIPPreEncode */
|
sp->stream.avail_out = (uint64)tif->tif_rawdatasize <= 0xFFFFFFFFU ? (uInt)tif->tif_rawdatasize : 0xFFFFFFFFU;
|
||||||
}
|
}
|
||||||
} while (sp->stream.avail_in > 0);
|
cc -= (avail_in_before - sp->stream.avail_in);
|
||||||
|
} while (cc > 0);
|
||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -314,7 +296,7 @@ ZIPPostEncode(TIFF* tif)
|
|||||||
tif->tif_rawcc = tif->tif_rawdatasize - sp->stream.avail_out;
|
tif->tif_rawcc = tif->tif_rawdatasize - sp->stream.avail_out;
|
||||||
TIFFFlushData1(tif);
|
TIFFFlushData1(tif);
|
||||||
sp->stream.next_out = tif->tif_rawdata;
|
sp->stream.next_out = tif->tif_rawdata;
|
||||||
sp->stream.avail_out = (uInt) tif->tif_rawdatasize; /* this is a safe typecast, as check is made already in ZIPPreEncode */
|
sp->stream.avail_out = (uint64)tif->tif_rawdatasize <= 0xFFFFFFFFU ? (uInt)tif->tif_rawdatasize : 0xFFFFFFFFU;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|||||||
Vendored
+2
@@ -374,6 +374,8 @@ extern void* _TIFFCheckRealloc(TIFF*, void*, tmsize_t, tmsize_t, const char*);
|
|||||||
extern double _TIFFUInt64ToDouble(uint64);
|
extern double _TIFFUInt64ToDouble(uint64);
|
||||||
extern float _TIFFUInt64ToFloat(uint64);
|
extern float _TIFFUInt64ToFloat(uint64);
|
||||||
|
|
||||||
|
extern float _TIFFClampDoubleToFloat(double);
|
||||||
|
|
||||||
extern tmsize_t
|
extern tmsize_t
|
||||||
_TIFFReadEncodedStripAndAllocBuffer(TIFF* tif, uint32 strip,
|
_TIFFReadEncodedStripAndAllocBuffer(TIFF* tif, uint32 strip,
|
||||||
void **buf, tmsize_t bufsizetoalloc,
|
void **buf, tmsize_t bufsizetoalloc,
|
||||||
|
|||||||
Vendored
+1
-1
@@ -732,7 +732,7 @@ static int AllocateMemory(VP8Decoder* const dec) {
|
|||||||
mem += f_info_size;
|
mem += f_info_size;
|
||||||
dec->thread_ctx_.id_ = 0;
|
dec->thread_ctx_.id_ = 0;
|
||||||
dec->thread_ctx_.f_info_ = dec->f_info_;
|
dec->thread_ctx_.f_info_ = dec->f_info_;
|
||||||
if (dec->mt_method_ > 0) {
|
if (dec->filter_type_ > 0 && dec->mt_method_ > 0) {
|
||||||
// secondary cache line. The deblocking process need to make use of the
|
// secondary cache line. The deblocking process need to make use of the
|
||||||
// filtering strength from previous macroblock row, while the new ones
|
// filtering strength from previous macroblock row, while the new ones
|
||||||
// are being decoded in parallel. We'll just swap the pointers.
|
// are being decoded in parallel. We'll just swap the pointers.
|
||||||
|
|||||||
Vendored
+8
-3
@@ -166,9 +166,11 @@ static int AppendToMemBuffer(WebPIDecoder* const idec,
|
|||||||
VP8Decoder* const dec = (VP8Decoder*)idec->dec_;
|
VP8Decoder* const dec = (VP8Decoder*)idec->dec_;
|
||||||
MemBuffer* const mem = &idec->mem_;
|
MemBuffer* const mem = &idec->mem_;
|
||||||
const int need_compressed_alpha = NeedCompressedAlpha(idec);
|
const int need_compressed_alpha = NeedCompressedAlpha(idec);
|
||||||
const uint8_t* const old_start = mem->buf_ + mem->start_;
|
const uint8_t* const old_start =
|
||||||
|
(mem->buf_ == NULL) ? NULL : mem->buf_ + mem->start_;
|
||||||
const uint8_t* const old_base =
|
const uint8_t* const old_base =
|
||||||
need_compressed_alpha ? dec->alpha_data_ : old_start;
|
need_compressed_alpha ? dec->alpha_data_ : old_start;
|
||||||
|
assert(mem->buf_ != NULL || mem->start_ == 0);
|
||||||
assert(mem->mode_ == MEM_MODE_APPEND);
|
assert(mem->mode_ == MEM_MODE_APPEND);
|
||||||
if (data_size > MAX_CHUNK_PAYLOAD) {
|
if (data_size > MAX_CHUNK_PAYLOAD) {
|
||||||
// security safeguard: trying to allocate more than what the format
|
// security safeguard: trying to allocate more than what the format
|
||||||
@@ -184,7 +186,7 @@ static int AppendToMemBuffer(WebPIDecoder* const idec,
|
|||||||
uint8_t* const new_buf =
|
uint8_t* const new_buf =
|
||||||
(uint8_t*)WebPSafeMalloc(extra_size, sizeof(*new_buf));
|
(uint8_t*)WebPSafeMalloc(extra_size, sizeof(*new_buf));
|
||||||
if (new_buf == NULL) return 0;
|
if (new_buf == NULL) return 0;
|
||||||
memcpy(new_buf, old_base, current_size);
|
if (old_base != NULL) memcpy(new_buf, old_base, current_size);
|
||||||
WebPSafeFree(mem->buf_);
|
WebPSafeFree(mem->buf_);
|
||||||
mem->buf_ = new_buf;
|
mem->buf_ = new_buf;
|
||||||
mem->buf_size_ = (size_t)extra_size;
|
mem->buf_size_ = (size_t)extra_size;
|
||||||
@@ -192,6 +194,7 @@ static int AppendToMemBuffer(WebPIDecoder* const idec,
|
|||||||
mem->end_ = current_size;
|
mem->end_ = current_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
assert(mem->buf_ != NULL);
|
||||||
memcpy(mem->buf_ + mem->end_, data, data_size);
|
memcpy(mem->buf_ + mem->end_, data, data_size);
|
||||||
mem->end_ += data_size;
|
mem->end_ += data_size;
|
||||||
assert(mem->end_ <= mem->buf_size_);
|
assert(mem->end_ <= mem->buf_size_);
|
||||||
@@ -204,7 +207,9 @@ static int RemapMemBuffer(WebPIDecoder* const idec,
|
|||||||
const uint8_t* const data, size_t data_size) {
|
const uint8_t* const data, size_t data_size) {
|
||||||
MemBuffer* const mem = &idec->mem_;
|
MemBuffer* const mem = &idec->mem_;
|
||||||
const uint8_t* const old_buf = mem->buf_;
|
const uint8_t* const old_buf = mem->buf_;
|
||||||
const uint8_t* const old_start = old_buf + mem->start_;
|
const uint8_t* const old_start =
|
||||||
|
(old_buf == NULL) ? NULL : old_buf + mem->start_;
|
||||||
|
assert(old_buf != NULL || mem->start_ == 0);
|
||||||
assert(mem->mode_ == MEM_MODE_MAP);
|
assert(mem->mode_ == MEM_MODE_MAP);
|
||||||
|
|
||||||
if (data_size < mem->buf_size_) return 0; // can't remap to a shorter buffer!
|
if (data_size < mem->buf_size_) return 0; // can't remap to a shorter buffer!
|
||||||
|
|||||||
Vendored
+2
-2
@@ -31,8 +31,8 @@ extern "C" {
|
|||||||
|
|
||||||
// version numbers
|
// version numbers
|
||||||
#define DEC_MAJ_VERSION 1
|
#define DEC_MAJ_VERSION 1
|
||||||
#define DEC_MIN_VERSION 0
|
#define DEC_MIN_VERSION 1
|
||||||
#define DEC_REV_VERSION 3
|
#define DEC_REV_VERSION 0
|
||||||
|
|
||||||
// YUV-cache parameters. Cache is 32-bytes wide (= one cacheline).
|
// YUV-cache parameters. Cache is 32-bytes wide (= one cacheline).
|
||||||
// Constraints are: We need to store one 16x16 block of luma samples (y),
|
// Constraints are: We need to store one 16x16 block of luma samples (y),
|
||||||
|
|||||||
Vendored
+5
-5
@@ -754,11 +754,11 @@ static WEBP_INLINE HTreeGroup* GetHtreeGroupForPos(VP8LMetadata* const hdr,
|
|||||||
|
|
||||||
typedef void (*ProcessRowsFunc)(VP8LDecoder* const dec, int row);
|
typedef void (*ProcessRowsFunc)(VP8LDecoder* const dec, int row);
|
||||||
|
|
||||||
static void ApplyInverseTransforms(VP8LDecoder* const dec, int num_rows,
|
static void ApplyInverseTransforms(VP8LDecoder* const dec,
|
||||||
|
int start_row, int num_rows,
|
||||||
const uint32_t* const rows) {
|
const uint32_t* const rows) {
|
||||||
int n = dec->next_transform_;
|
int n = dec->next_transform_;
|
||||||
const int cache_pixs = dec->width_ * num_rows;
|
const int cache_pixs = dec->width_ * num_rows;
|
||||||
const int start_row = dec->last_row_;
|
|
||||||
const int end_row = start_row + num_rows;
|
const int end_row = start_row + num_rows;
|
||||||
const uint32_t* rows_in = rows;
|
const uint32_t* rows_in = rows;
|
||||||
uint32_t* const rows_out = dec->argb_cache_;
|
uint32_t* const rows_out = dec->argb_cache_;
|
||||||
@@ -789,8 +789,7 @@ static void ProcessRows(VP8LDecoder* const dec, int row) {
|
|||||||
VP8Io* const io = dec->io_;
|
VP8Io* const io = dec->io_;
|
||||||
uint8_t* rows_data = (uint8_t*)dec->argb_cache_;
|
uint8_t* rows_data = (uint8_t*)dec->argb_cache_;
|
||||||
const int in_stride = io->width * sizeof(uint32_t); // in unit of RGBA
|
const int in_stride = io->width * sizeof(uint32_t); // in unit of RGBA
|
||||||
|
ApplyInverseTransforms(dec, dec->last_row_, num_rows, rows);
|
||||||
ApplyInverseTransforms(dec, num_rows, rows);
|
|
||||||
if (!SetCropWindow(io, dec->last_row_, row, &rows_data, in_stride)) {
|
if (!SetCropWindow(io, dec->last_row_, row, &rows_data, in_stride)) {
|
||||||
// Nothing to output (this time).
|
// Nothing to output (this time).
|
||||||
} else {
|
} else {
|
||||||
@@ -1193,6 +1192,7 @@ static int DecodeImageData(VP8LDecoder* const dec, uint32_t* const data,
|
|||||||
VP8LFillBitWindow(br);
|
VP8LFillBitWindow(br);
|
||||||
dist_code = GetCopyDistance(dist_symbol, br);
|
dist_code = GetCopyDistance(dist_symbol, br);
|
||||||
dist = PlaneCodeToDistance(width, dist_code);
|
dist = PlaneCodeToDistance(width, dist_code);
|
||||||
|
|
||||||
if (VP8LIsEndOfStream(br)) break;
|
if (VP8LIsEndOfStream(br)) break;
|
||||||
if (src - data < (ptrdiff_t)dist || src_end - src < (ptrdiff_t)length) {
|
if (src - data < (ptrdiff_t)dist || src_end - src < (ptrdiff_t)length) {
|
||||||
goto Error;
|
goto Error;
|
||||||
@@ -1553,7 +1553,7 @@ static void ExtractAlphaRows(VP8LDecoder* const dec, int last_row) {
|
|||||||
const int cache_pixs = width * num_rows_to_process;
|
const int cache_pixs = width * num_rows_to_process;
|
||||||
uint8_t* const dst = output + width * cur_row;
|
uint8_t* const dst = output + width * cur_row;
|
||||||
const uint32_t* const src = dec->argb_cache_;
|
const uint32_t* const src = dec->argb_cache_;
|
||||||
ApplyInverseTransforms(dec, num_rows_to_process, in);
|
ApplyInverseTransforms(dec, cur_row, num_rows_to_process, in);
|
||||||
WebPExtractGreen(src, dst, cache_pixs);
|
WebPExtractGreen(src, dst, cache_pixs);
|
||||||
AlphaApplyFilter(alph_dec,
|
AlphaApplyFilter(alph_dec,
|
||||||
cur_row, cur_row + num_rows_to_process, dst, width);
|
cur_row, cur_row + num_rows_to_process, dst, width);
|
||||||
|
|||||||
Vendored
+2
-2
@@ -24,8 +24,8 @@
|
|||||||
#include "src/webp/format_constants.h"
|
#include "src/webp/format_constants.h"
|
||||||
|
|
||||||
#define DMUX_MAJ_VERSION 1
|
#define DMUX_MAJ_VERSION 1
|
||||||
#define DMUX_MIN_VERSION 0
|
#define DMUX_MIN_VERSION 1
|
||||||
#define DMUX_REV_VERSION 3
|
#define DMUX_REV_VERSION 0
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
size_t start_; // start location of the data
|
size_t start_; // start location of the data
|
||||||
|
|||||||
Vendored
+8
-1
@@ -1361,7 +1361,8 @@ static void RD4_NEON(uint8_t* dst) { // Down-right
|
|||||||
const uint32_t J = dst[-1 + 1 * BPS];
|
const uint32_t J = dst[-1 + 1 * BPS];
|
||||||
const uint32_t K = dst[-1 + 2 * BPS];
|
const uint32_t K = dst[-1 + 2 * BPS];
|
||||||
const uint32_t L = dst[-1 + 3 * BPS];
|
const uint32_t L = dst[-1 + 3 * BPS];
|
||||||
const uint64x1_t LKJI____ = vcreate_u64(L | (K << 8) | (J << 16) | (I << 24));
|
const uint64x1_t LKJI____ =
|
||||||
|
vcreate_u64((uint64_t)L | (K << 8) | (J << 16) | (I << 24));
|
||||||
const uint64x1_t LKJIXABC = vorr_u64(LKJI____, ____XABC);
|
const uint64x1_t LKJIXABC = vorr_u64(LKJI____, ____XABC);
|
||||||
const uint8x8_t KJIXABC_ = vreinterpret_u8_u64(vshr_n_u64(LKJIXABC, 8));
|
const uint8x8_t KJIXABC_ = vreinterpret_u8_u64(vshr_n_u64(LKJIXABC, 8));
|
||||||
const uint8x8_t JIXABC__ = vreinterpret_u8_u64(vshr_n_u64(LKJIXABC, 16));
|
const uint8x8_t JIXABC__ = vreinterpret_u8_u64(vshr_n_u64(LKJIXABC, 16));
|
||||||
@@ -1427,10 +1428,16 @@ static WEBP_INLINE void DC8_NEON(uint8_t* dst, int do_top, int do_left) {
|
|||||||
|
|
||||||
if (do_top) {
|
if (do_top) {
|
||||||
const uint8x8_t A = vld1_u8(dst - BPS); // top row
|
const uint8x8_t A = vld1_u8(dst - BPS); // top row
|
||||||
|
#if defined(__aarch64__)
|
||||||
|
const uint16x8_t B = vmovl_u8(A);
|
||||||
|
const uint16_t p2 = vaddvq_u16(B);
|
||||||
|
sum_top = vdupq_n_u16(p2);
|
||||||
|
#else
|
||||||
const uint16x4_t p0 = vpaddl_u8(A); // cascading summation of the top
|
const uint16x4_t p0 = vpaddl_u8(A); // cascading summation of the top
|
||||||
const uint16x4_t p1 = vpadd_u16(p0, p0);
|
const uint16x4_t p1 = vpadd_u16(p0, p0);
|
||||||
const uint16x4_t p2 = vpadd_u16(p1, p1);
|
const uint16x4_t p2 = vpadd_u16(p1, p1);
|
||||||
sum_top = vcombine_u16(p2, p2);
|
sum_top = vcombine_u16(p2, p2);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if (do_left) {
|
if (do_left) {
|
||||||
|
|||||||
Vendored
+8
-3
@@ -81,7 +81,7 @@ static WEBP_INLINE uint32_t ClampedAddSubtractHalf(uint32_t c0, uint32_t c1,
|
|||||||
|
|
||||||
// gcc <= 4.9 on ARM generates incorrect code in Select() when Sub3() is
|
// gcc <= 4.9 on ARM generates incorrect code in Select() when Sub3() is
|
||||||
// inlined.
|
// inlined.
|
||||||
#if defined(__arm__) && LOCAL_GCC_VERSION <= 0x409
|
#if defined(__arm__) && defined(__GNUC__) && LOCAL_GCC_VERSION <= 0x409
|
||||||
# define LOCAL_INLINE __attribute__ ((noinline))
|
# define LOCAL_INLINE __attribute__ ((noinline))
|
||||||
#else
|
#else
|
||||||
# define LOCAL_INLINE WEBP_INLINE
|
# define LOCAL_INLINE WEBP_INLINE
|
||||||
@@ -167,15 +167,20 @@ static uint32_t Predictor13_C(uint32_t left, const uint32_t* const top) {
|
|||||||
return pred;
|
return pred;
|
||||||
}
|
}
|
||||||
|
|
||||||
GENERATE_PREDICTOR_ADD(Predictor0_C, PredictorAdd0_C)
|
static void PredictorAdd0_C(const uint32_t* in, const uint32_t* upper,
|
||||||
|
int num_pixels, uint32_t* out) {
|
||||||
|
int x;
|
||||||
|
(void)upper;
|
||||||
|
for (x = 0; x < num_pixels; ++x) out[x] = VP8LAddPixels(in[x], ARGB_BLACK);
|
||||||
|
}
|
||||||
static void PredictorAdd1_C(const uint32_t* in, const uint32_t* upper,
|
static void PredictorAdd1_C(const uint32_t* in, const uint32_t* upper,
|
||||||
int num_pixels, uint32_t* out) {
|
int num_pixels, uint32_t* out) {
|
||||||
int i;
|
int i;
|
||||||
uint32_t left = out[-1];
|
uint32_t left = out[-1];
|
||||||
|
(void)upper;
|
||||||
for (i = 0; i < num_pixels; ++i) {
|
for (i = 0; i < num_pixels; ++i) {
|
||||||
out[i] = left = VP8LAddPixels(in[i], left);
|
out[i] = left = VP8LAddPixels(in[i], left);
|
||||||
}
|
}
|
||||||
(void)upper;
|
|
||||||
}
|
}
|
||||||
GENERATE_PREDICTOR_ADD(Predictor2_C, PredictorAdd2_C)
|
GENERATE_PREDICTOR_ADD(Predictor2_C, PredictorAdd2_C)
|
||||||
GENERATE_PREDICTOR_ADD(Predictor3_C, PredictorAdd3_C)
|
GENERATE_PREDICTOR_ADD(Predictor3_C, PredictorAdd3_C)
|
||||||
|
|||||||
+2
@@ -177,6 +177,7 @@ uint32_t VP8LSubPixels(uint32_t a, uint32_t b) {
|
|||||||
static void PREDICTOR_ADD(const uint32_t* in, const uint32_t* upper, \
|
static void PREDICTOR_ADD(const uint32_t* in, const uint32_t* upper, \
|
||||||
int num_pixels, uint32_t* out) { \
|
int num_pixels, uint32_t* out) { \
|
||||||
int x; \
|
int x; \
|
||||||
|
assert(upper != NULL); \
|
||||||
for (x = 0; x < num_pixels; ++x) { \
|
for (x = 0; x < num_pixels; ++x) { \
|
||||||
const uint32_t pred = (PREDICTOR)(out[x - 1], upper + x); \
|
const uint32_t pred = (PREDICTOR)(out[x - 1], upper + x); \
|
||||||
out[x] = VP8LAddPixels(in[x], pred); \
|
out[x] = VP8LAddPixels(in[x], pred); \
|
||||||
@@ -189,6 +190,7 @@ static void PREDICTOR_ADD(const uint32_t* in, const uint32_t* upper, \
|
|||||||
static void PREDICTOR_SUB(const uint32_t* in, const uint32_t* upper, \
|
static void PREDICTOR_SUB(const uint32_t* in, const uint32_t* upper, \
|
||||||
int num_pixels, uint32_t* out) { \
|
int num_pixels, uint32_t* out) { \
|
||||||
int x; \
|
int x; \
|
||||||
|
assert(upper != NULL); \
|
||||||
for (x = 0; x < num_pixels; ++x) { \
|
for (x = 0; x < num_pixels; ++x) { \
|
||||||
const uint32_t pred = (PREDICTOR)(in[x - 1], upper + x); \
|
const uint32_t pred = (PREDICTOR)(in[x - 1], upper + x); \
|
||||||
out[x] = VP8LSubPixels(in[x], pred); \
|
out[x] = VP8LSubPixels(in[x], pred); \
|
||||||
|
|||||||
+2
-1
@@ -455,8 +455,9 @@ static void PredictorSub0_SSE2(const uint32_t* in, const uint32_t* upper,
|
|||||||
_mm_storeu_si128((__m128i*)&out[i], res);
|
_mm_storeu_si128((__m128i*)&out[i], res);
|
||||||
}
|
}
|
||||||
if (i != num_pixels) {
|
if (i != num_pixels) {
|
||||||
VP8LPredictorsSub_C[0](in + i, upper + i, num_pixels - i, out + i);
|
VP8LPredictorsSub_C[0](in + i, NULL, num_pixels - i, out + i);
|
||||||
}
|
}
|
||||||
|
(void)upper;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define GENERATE_PREDICTOR_1(X, IN) \
|
#define GENERATE_PREDICTOR_1(X, IN) \
|
||||||
|
|||||||
+2
-1
@@ -191,8 +191,9 @@ static void PredictorAdd0_SSE2(const uint32_t* in, const uint32_t* upper,
|
|||||||
_mm_storeu_si128((__m128i*)&out[i], res);
|
_mm_storeu_si128((__m128i*)&out[i], res);
|
||||||
}
|
}
|
||||||
if (i != num_pixels) {
|
if (i != num_pixels) {
|
||||||
VP8LPredictorsAdd_C[0](in + i, upper + i, num_pixels - i, out + i);
|
VP8LPredictorsAdd_C[0](in + i, NULL, num_pixels - i, out + i);
|
||||||
}
|
}
|
||||||
|
(void)upper;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Predictor1: left.
|
// Predictor1: left.
|
||||||
|
|||||||
+10
-6
@@ -29,11 +29,15 @@
|
|||||||
#define USE_INVERSE_ALPHA_TABLE
|
#define USE_INVERSE_ALPHA_TABLE
|
||||||
|
|
||||||
#ifdef WORDS_BIGENDIAN
|
#ifdef WORDS_BIGENDIAN
|
||||||
#define ALPHA_OFFSET 0 // uint32_t 0xff000000 is 0xff,00,00,00 in memory
|
// uint32_t 0xff000000 is 0xff,00,00,00 in memory
|
||||||
|
#define CHANNEL_OFFSET(i) (i)
|
||||||
#else
|
#else
|
||||||
#define ALPHA_OFFSET 3 // uint32_t 0xff000000 is 0x00,00,00,ff in memory
|
// uint32_t 0xff000000 is 0x00,00,00,ff in memory
|
||||||
|
#define CHANNEL_OFFSET(i) (3-(i))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define ALPHA_OFFSET CHANNEL_OFFSET(0)
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// Detection of non-trivial transparency
|
// Detection of non-trivial transparency
|
||||||
|
|
||||||
@@ -997,10 +1001,10 @@ static int PictureARGBToYUVA(WebPPicture* picture, WebPEncCSP colorspace,
|
|||||||
return WebPEncodingSetError(picture, VP8_ENC_ERROR_INVALID_CONFIGURATION);
|
return WebPEncodingSetError(picture, VP8_ENC_ERROR_INVALID_CONFIGURATION);
|
||||||
} else {
|
} else {
|
||||||
const uint8_t* const argb = (const uint8_t*)picture->argb;
|
const uint8_t* const argb = (const uint8_t*)picture->argb;
|
||||||
const uint8_t* const a = argb + (0 ^ ALPHA_OFFSET);
|
const uint8_t* const a = argb + CHANNEL_OFFSET(0);
|
||||||
const uint8_t* const r = argb + (1 ^ ALPHA_OFFSET);
|
const uint8_t* const r = argb + CHANNEL_OFFSET(1);
|
||||||
const uint8_t* const g = argb + (2 ^ ALPHA_OFFSET);
|
const uint8_t* const g = argb + CHANNEL_OFFSET(2);
|
||||||
const uint8_t* const b = argb + (3 ^ ALPHA_OFFSET);
|
const uint8_t* const b = argb + CHANNEL_OFFSET(3);
|
||||||
|
|
||||||
picture->colorspace = WEBP_YUV420;
|
picture->colorspace = WEBP_YUV420;
|
||||||
return ImportYUVAFromRGBA(r, g, b, a, 4, 4 * picture->argb_stride,
|
return ImportYUVAFromRGBA(r, g, b, a, 4, 4 * picture->argb_stride,
|
||||||
|
|||||||
Vendored
+2
-2
@@ -31,8 +31,8 @@ extern "C" {
|
|||||||
|
|
||||||
// version numbers
|
// version numbers
|
||||||
#define ENC_MAJ_VERSION 1
|
#define ENC_MAJ_VERSION 1
|
||||||
#define ENC_MIN_VERSION 0
|
#define ENC_MIN_VERSION 1
|
||||||
#define ENC_REV_VERSION 3
|
#define ENC_REV_VERSION 0
|
||||||
|
|
||||||
enum { MAX_LF_LEVELS = 64, // Maximum loop filter level
|
enum { MAX_LF_LEVELS = 64, // Maximum loop filter level
|
||||||
MAX_VARIABLE_LEVEL = 67, // last (inclusive) level with variable cost
|
MAX_VARIABLE_LEVEL = 67, // last (inclusive) level with variable cost
|
||||||
|
|||||||
Vendored
+2
-2
@@ -28,8 +28,8 @@ extern "C" {
|
|||||||
// Defines and constants.
|
// Defines and constants.
|
||||||
|
|
||||||
#define MUX_MAJ_VERSION 1
|
#define MUX_MAJ_VERSION 1
|
||||||
#define MUX_MIN_VERSION 0
|
#define MUX_MIN_VERSION 1
|
||||||
#define MUX_REV_VERSION 3
|
#define MUX_REV_VERSION 0
|
||||||
|
|
||||||
// Chunk object.
|
// Chunk object.
|
||||||
typedef struct WebPChunk WebPChunk;
|
typedef struct WebPChunk WebPChunk;
|
||||||
|
|||||||
Vendored
+1
-1
@@ -100,7 +100,7 @@ static int MuxImageParse(const WebPChunk* const chunk, int copy_data,
|
|||||||
WebPMuxImage* const wpi) {
|
WebPMuxImage* const wpi) {
|
||||||
const uint8_t* bytes = chunk->data_.bytes;
|
const uint8_t* bytes = chunk->data_.bytes;
|
||||||
size_t size = chunk->data_.size;
|
size_t size = chunk->data_.size;
|
||||||
const uint8_t* const last = bytes + size;
|
const uint8_t* const last = (bytes == NULL) ? NULL : bytes + size;
|
||||||
WebPChunk subchunk;
|
WebPChunk subchunk;
|
||||||
size_t subchunk_size;
|
size_t subchunk_size;
|
||||||
WebPChunk** unknown_chunk_list = &wpi->unknown_;
|
WebPChunk** unknown_chunk_list = &wpi->unknown_;
|
||||||
|
|||||||
Vendored
+7
-2
@@ -216,9 +216,14 @@ void WebPSafeFree(void* const ptr) {
|
|||||||
free(ptr);
|
free(ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Public API function.
|
// Public API functions.
|
||||||
|
|
||||||
|
void* WebPMalloc(size_t size) {
|
||||||
|
return WebPSafeMalloc(1, size);
|
||||||
|
}
|
||||||
|
|
||||||
void WebPFree(void* ptr) {
|
void WebPFree(void* ptr) {
|
||||||
free(ptr);
|
WebPSafeFree(ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|||||||
Vendored
+1
-4
@@ -20,7 +20,7 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define WEBP_DECODER_ABI_VERSION 0x0208 // MAJOR(8b) + MINOR(8b)
|
#define WEBP_DECODER_ABI_VERSION 0x0209 // MAJOR(8b) + MINOR(8b)
|
||||||
|
|
||||||
// Note: forward declaring enumerations is not allowed in (strict) C and C++,
|
// Note: forward declaring enumerations is not allowed in (strict) C and C++,
|
||||||
// the types are left here for reference.
|
// the types are left here for reference.
|
||||||
@@ -91,9 +91,6 @@ WEBP_EXTERN uint8_t* WebPDecodeYUV(const uint8_t* data, size_t data_size,
|
|||||||
uint8_t** u, uint8_t** v,
|
uint8_t** u, uint8_t** v,
|
||||||
int* stride, int* uv_stride);
|
int* stride, int* uv_stride);
|
||||||
|
|
||||||
// Releases memory returned by the WebPDecode*() functions above.
|
|
||||||
WEBP_EXTERN void WebPFree(void* ptr);
|
|
||||||
|
|
||||||
// These five functions are variants of the above ones, that decode the image
|
// These five functions are variants of the above ones, that decode the image
|
||||||
// directly into a pre-allocated buffer 'output_buffer'. The maximum storage
|
// directly into a pre-allocated buffer 'output_buffer'. The maximum storage
|
||||||
// available in this buffer is indicated by 'output_buffer_size'. If this
|
// available in this buffer is indicated by 'output_buffer_size'. If this
|
||||||
|
|||||||
Vendored
+1
-4
@@ -20,7 +20,7 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define WEBP_ENCODER_ABI_VERSION 0x020e // MAJOR(8b) + MINOR(8b)
|
#define WEBP_ENCODER_ABI_VERSION 0x020f // MAJOR(8b) + MINOR(8b)
|
||||||
|
|
||||||
// Note: forward declaring enumerations is not allowed in (strict) C and C++,
|
// Note: forward declaring enumerations is not allowed in (strict) C and C++,
|
||||||
// the types are left here for reference.
|
// the types are left here for reference.
|
||||||
@@ -79,9 +79,6 @@ WEBP_EXTERN size_t WebPEncodeLosslessBGRA(const uint8_t* bgra,
|
|||||||
int width, int height, int stride,
|
int width, int height, int stride,
|
||||||
uint8_t** output);
|
uint8_t** output);
|
||||||
|
|
||||||
// Releases memory returned by the WebPEncode*() functions above.
|
|
||||||
WEBP_EXTERN void WebPFree(void* ptr);
|
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// Coding parameters
|
// Coding parameters
|
||||||
|
|
||||||
|
|||||||
Vendored
+6
-6
@@ -57,7 +57,7 @@ extern "C" {
|
|||||||
WebPMuxGetChunk(mux, "ICCP", &icc_profile);
|
WebPMuxGetChunk(mux, "ICCP", &icc_profile);
|
||||||
// ... (Consume icc_data).
|
// ... (Consume icc_data).
|
||||||
WebPMuxDelete(mux);
|
WebPMuxDelete(mux);
|
||||||
free(data);
|
WebPFree(data);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Note: forward declaring enumerations is not allowed in (strict) C and C++,
|
// Note: forward declaring enumerations is not allowed in (strict) C and C++,
|
||||||
@@ -245,7 +245,7 @@ WEBP_EXTERN WebPMuxError WebPMuxPushFrame(
|
|||||||
WebPMux* mux, const WebPMuxFrameInfo* frame, int copy_data);
|
WebPMux* mux, const WebPMuxFrameInfo* frame, int copy_data);
|
||||||
|
|
||||||
// Gets the nth frame from the mux object.
|
// Gets the nth frame from the mux object.
|
||||||
// The content of 'frame->bitstream' is allocated using malloc(), and NOT
|
// The content of 'frame->bitstream' is allocated using WebPMalloc(), and NOT
|
||||||
// owned by the 'mux' object. It MUST be deallocated by the caller by calling
|
// owned by the 'mux' object. It MUST be deallocated by the caller by calling
|
||||||
// WebPDataClear().
|
// WebPDataClear().
|
||||||
// nth=0 has a special meaning - last position.
|
// nth=0 has a special meaning - last position.
|
||||||
@@ -376,10 +376,10 @@ WEBP_EXTERN WebPMuxError WebPMuxNumChunks(const WebPMux* mux,
|
|||||||
// Assembles all chunks in WebP RIFF format and returns in 'assembled_data'.
|
// Assembles all chunks in WebP RIFF format and returns in 'assembled_data'.
|
||||||
// This function also validates the mux object.
|
// This function also validates the mux object.
|
||||||
// Note: The content of 'assembled_data' will be ignored and overwritten.
|
// Note: The content of 'assembled_data' will be ignored and overwritten.
|
||||||
// Also, the content of 'assembled_data' is allocated using malloc(), and NOT
|
// Also, the content of 'assembled_data' is allocated using WebPMalloc(), and
|
||||||
// owned by the 'mux' object. It MUST be deallocated by the caller by calling
|
// NOT owned by the 'mux' object. It MUST be deallocated by the caller by
|
||||||
// WebPDataClear(). It's always safe to call WebPDataClear() upon return,
|
// calling WebPDataClear(). It's always safe to call WebPDataClear() upon
|
||||||
// even in case of error.
|
// return, even in case of error.
|
||||||
// Parameters:
|
// Parameters:
|
||||||
// mux - (in/out) object whose chunks are to be assembled
|
// mux - (in/out) object whose chunks are to be assembled
|
||||||
// assembled_data - (out) assembled WebP data
|
// assembled_data - (out) assembled WebP data
|
||||||
|
|||||||
+5
-5
@@ -14,7 +14,6 @@
|
|||||||
#ifndef WEBP_WEBP_MUX_TYPES_H_
|
#ifndef WEBP_WEBP_MUX_TYPES_H_
|
||||||
#define WEBP_WEBP_MUX_TYPES_H_
|
#define WEBP_WEBP_MUX_TYPES_H_
|
||||||
|
|
||||||
#include <stdlib.h> // free()
|
|
||||||
#include <string.h> // memset()
|
#include <string.h> // memset()
|
||||||
#include "./types.h"
|
#include "./types.h"
|
||||||
|
|
||||||
@@ -56,6 +55,7 @@ typedef enum WebPMuxAnimBlend {
|
|||||||
|
|
||||||
// Data type used to describe 'raw' data, e.g., chunk data
|
// Data type used to describe 'raw' data, e.g., chunk data
|
||||||
// (ICC profile, metadata) and WebP compressed image data.
|
// (ICC profile, metadata) and WebP compressed image data.
|
||||||
|
// 'bytes' memory must be allocated using WebPMalloc() and such.
|
||||||
struct WebPData {
|
struct WebPData {
|
||||||
const uint8_t* bytes;
|
const uint8_t* bytes;
|
||||||
size_t size;
|
size_t size;
|
||||||
@@ -68,11 +68,11 @@ static WEBP_INLINE void WebPDataInit(WebPData* webp_data) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clears the contents of the 'webp_data' object by calling free(). Does not
|
// Clears the contents of the 'webp_data' object by calling WebPFree().
|
||||||
// deallocate the object itself.
|
// Does not deallocate the object itself.
|
||||||
static WEBP_INLINE void WebPDataClear(WebPData* webp_data) {
|
static WEBP_INLINE void WebPDataClear(WebPData* webp_data) {
|
||||||
if (webp_data != NULL) {
|
if (webp_data != NULL) {
|
||||||
free((void*)webp_data->bytes);
|
WebPFree((void*)webp_data->bytes);
|
||||||
WebPDataInit(webp_data);
|
WebPDataInit(webp_data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -83,7 +83,7 @@ static WEBP_INLINE int WebPDataCopy(const WebPData* src, WebPData* dst) {
|
|||||||
if (src == NULL || dst == NULL) return 0;
|
if (src == NULL || dst == NULL) return 0;
|
||||||
WebPDataInit(dst);
|
WebPDataInit(dst);
|
||||||
if (src->bytes != NULL && src->size != 0) {
|
if (src->bytes != NULL && src->size != 0) {
|
||||||
dst->bytes = (uint8_t*)malloc(src->size);
|
dst->bytes = (uint8_t*)WebPMalloc(src->size);
|
||||||
if (dst->bytes == NULL) return 0;
|
if (dst->bytes == NULL) return 0;
|
||||||
memcpy((void*)dst->bytes, src->bytes, src->size);
|
memcpy((void*)dst->bytes, src->bytes, src->size);
|
||||||
dst->size = src->size;
|
dst->size = src->size;
|
||||||
|
|||||||
Vendored
+17
-1
@@ -7,7 +7,7 @@
|
|||||||
// be found in the AUTHORS file in the root of the source tree.
|
// be found in the AUTHORS file in the root of the source tree.
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// Common types
|
// Common types + memory wrappers
|
||||||
//
|
//
|
||||||
// Author: Skal (pascal.massimino@gmail.com)
|
// Author: Skal (pascal.massimino@gmail.com)
|
||||||
|
|
||||||
@@ -49,4 +49,20 @@ typedef long long int int64_t;
|
|||||||
// Macro to check ABI compatibility (same major revision number)
|
// Macro to check ABI compatibility (same major revision number)
|
||||||
#define WEBP_ABI_IS_INCOMPATIBLE(a, b) (((a) >> 8) != ((b) >> 8))
|
#define WEBP_ABI_IS_INCOMPATIBLE(a, b) (((a) >> 8) != ((b) >> 8))
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Allocates 'size' bytes of memory. Returns NULL upon error. Memory
|
||||||
|
// must be deallocated by calling WebPFree(). This function is made available
|
||||||
|
// by the core 'libwebp' library.
|
||||||
|
WEBP_EXTERN void* WebPMalloc(size_t size);
|
||||||
|
|
||||||
|
// Releases memory returned by the WebPDecode*() functions (from decode.h).
|
||||||
|
WEBP_EXTERN void WebPFree(void* ptr);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
} // extern "C"
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif // WEBP_WEBP_TYPES_H_
|
#endif // WEBP_WEBP_TYPES_H_
|
||||||
|
|||||||
+1
-1
@@ -63,7 +63,7 @@ Attribute::~Attribute () {}
|
|||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
struct NameCompare: std::binary_function <const char *, const char *, bool>
|
struct NameCompare
|
||||||
{
|
{
|
||||||
bool
|
bool
|
||||||
operator () (const char *x, const char *y) const
|
operator () (const char *x, const char *y) const
|
||||||
|
|||||||
Vendored
+1
@@ -60,6 +60,7 @@
|
|||||||
#include "ImathNamespace.h"
|
#include "ImathNamespace.h"
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <algorithm>
|
||||||
|
|
||||||
IMATH_INTERNAL_NAMESPACE_HEADER_ENTER
|
IMATH_INTERNAL_NAMESPACE_HEADER_ENTER
|
||||||
|
|
||||||
|
|||||||
Vendored
+21
@@ -0,0 +1,21 @@
|
|||||||
|
# Authors of OpenJPEG
|
||||||
|
See also [THANKS](https://github.com/uclouvain/openjpeg/blob/master/THANKS.md)
|
||||||
|
|
||||||
|
David Janssens designed and implemented the first version of OpenJPEG.
|
||||||
|
|
||||||
|
Kaori Hagihara designed and implemented the first version of OpenJPIP.
|
||||||
|
|
||||||
|
Jerome Fimes implemented the alpha version of OpenJPEG 2.0.
|
||||||
|
|
||||||
|
Giuseppe Baruffa added the JPWL functionalities.
|
||||||
|
|
||||||
|
Mickaël Savinaud implemented the final OpenJPEG 2.0 version based on a big merge between 1.5 version and alpha version of 2.0.
|
||||||
|
|
||||||
|
Mathieu Malaterre participated to the OpenJPEG 2.0 version and improved the libraries and utilities.
|
||||||
|
|
||||||
|
Yannick Verschueren,
|
||||||
|
Herve Drolon,
|
||||||
|
Francois-Olivier Devaux,
|
||||||
|
Antonin Descampe
|
||||||
|
improved the libraries and utilities.
|
||||||
|
|
||||||
Vendored
+683
@@ -0,0 +1,683 @@
|
|||||||
|
# Changelog
|
||||||
|
|
||||||
|
## [v2.3.1](https://github.com/uclouvain/openjpeg/releases/v2.3.1) (2019-04-02)
|
||||||
|
[Full Changelog](https://github.com/uclouvain/openjpeg/compare/v2.3.0...v2.3.1)
|
||||||
|
|
||||||
|
**Closed issues:**
|
||||||
|
|
||||||
|
- v2.2.0 regression for decoding images where TNsot == 0 [\#1120](https://github.com/uclouvain/openjpeg/issues/1120)
|
||||||
|
- Int overflow in jp3d [\#1162](https://github.com/uclouvain/openjpeg/issues/1162)
|
||||||
|
- Heap buffer overflow in opj\_j2k\_update\_image\_data\(\) triggered with Ghostscript [\#1157](https://github.com/uclouvain/openjpeg/issues/1157)
|
||||||
|
- LINUX install doesn't work when building shared libraries is disabled [\#1155](https://github.com/uclouvain/openjpeg/issues/1155)
|
||||||
|
- OPENJPEG null ptr dereference in openjpeg-2.3.0/src/bin/jp2/convert.c:2243 [\#1152](https://github.com/uclouvain/openjpeg/issues/1152)
|
||||||
|
- How to drop certain subbands/layers in DWT [\#1147](https://github.com/uclouvain/openjpeg/issues/1147)
|
||||||
|
- where is the MQ-Coder ouput stream in t2.c? [\#1146](https://github.com/uclouvain/openjpeg/issues/1146)
|
||||||
|
- OpenJPEG 2.3 \(and 2.2?\) multi component image fails to decode with KDU v7.10 [\#1132](https://github.com/uclouvain/openjpeg/issues/1132)
|
||||||
|
- Missing checks for header\_info.height and header\_info.width in function pnmtoimage in src/bin/jpwl/convert.c, which can lead to heap buffer overflow [\#1126](https://github.com/uclouvain/openjpeg/issues/1126)
|
||||||
|
- Assertion Failure in jp2.c [\#1125](https://github.com/uclouvain/openjpeg/issues/1125)
|
||||||
|
- Division-by-zero vulnerabilities in the function pi\_next\_pcrl, pi\_next\_cprl and pi\_next\_rpcl in src/lib/openjp3d/pi.c [\#1123](https://github.com/uclouvain/openjpeg/issues/1123)
|
||||||
|
- Precinct switch \(-c\) doesn't right-shift last record to remaining resolution levels [\#1117](https://github.com/uclouvain/openjpeg/issues/1117)
|
||||||
|
- Sample: encode J2K a data using streams??? [\#1114](https://github.com/uclouvain/openjpeg/issues/1114)
|
||||||
|
- HIGH THROUGHPUT JPEG 2000 \(HTJ2K\) [\#1112](https://github.com/uclouvain/openjpeg/issues/1112)
|
||||||
|
- How to build openjpeg for arm linux? [\#1108](https://github.com/uclouvain/openjpeg/issues/1108)
|
||||||
|
- crash [\#1106](https://github.com/uclouvain/openjpeg/issues/1106)
|
||||||
|
- JP2000 returning OPJ\_CLRSPC\_UNKNOWN color space [\#1103](https://github.com/uclouvain/openjpeg/issues/1103)
|
||||||
|
- Compilation successful but install unsuccessful: Calling executables throws libraries missing error [\#1102](https://github.com/uclouvain/openjpeg/issues/1102)
|
||||||
|
- fprintf format string requires 1 parameter but only 0 are given [\#1093](https://github.com/uclouvain/openjpeg/issues/1093)
|
||||||
|
- fprintf format string requires 1 parameter but only 0 are given [\#1092](https://github.com/uclouvain/openjpeg/issues/1092)
|
||||||
|
- sprintf buffer overflow [\#1088](https://github.com/uclouvain/openjpeg/issues/1088)
|
||||||
|
- sprintf buffer overflow [\#1085](https://github.com/uclouvain/openjpeg/issues/1085)
|
||||||
|
- Infinite loop when reading jp2 [\#1081](https://github.com/uclouvain/openjpeg/issues/1081)
|
||||||
|
- missing format string parameter [\#1074](https://github.com/uclouvain/openjpeg/issues/1074)
|
||||||
|
- Excessive Iteration in opj\_t1\_encode\_cblks \(src/lib/openjp2/t1.c\) [\#1059](https://github.com/uclouvain/openjpeg/issues/1059)
|
||||||
|
- Out-of-bound left shift in opj\_j2k\_setup\_encoder \(src/lib/openjp2/j2k.c\) [\#1057](https://github.com/uclouvain/openjpeg/issues/1057)
|
||||||
|
- Encode image on Unsplash [\#1054](https://github.com/uclouvain/openjpeg/issues/1054)
|
||||||
|
- Integer overflow in opj\_t1\_encode\_cblks \(src/lib/openjp2/t1.c\) [\#1053](https://github.com/uclouvain/openjpeg/issues/1053)
|
||||||
|
- Signed Integer Overflow - 68065512 [\#1048](https://github.com/uclouvain/openjpeg/issues/1048)
|
||||||
|
- Similar vulnerable functions related to CVE-2017-14041 [\#1044](https://github.com/uclouvain/openjpeg/issues/1044)
|
||||||
|
- \[ERROR\] COD marker already read. No more than one COD marker per tile. [\#1043](https://github.com/uclouvain/openjpeg/issues/1043)
|
||||||
|
- failing to install latest version of openjpeg from source [\#1041](https://github.com/uclouvain/openjpeg/issues/1041)
|
||||||
|
- Trouble compressing large raw image [\#1032](https://github.com/uclouvain/openjpeg/issues/1032)
|
||||||
|
- Download and installed code from 2.3 archive. Installing 2.2? [\#1030](https://github.com/uclouvain/openjpeg/issues/1030)
|
||||||
|
- missing fclose [\#1029](https://github.com/uclouvain/openjpeg/issues/1029)
|
||||||
|
- NULL Pointer Access in function imagetopnm of convert.c\(jp2\):1289 [\#860](https://github.com/uclouvain/openjpeg/issues/860)
|
||||||
|
- NULL Pointer Access in function imagetopnm of convert.c:2226\(jp2\) [\#859](https://github.com/uclouvain/openjpeg/issues/859)
|
||||||
|
- Heap Buffer Overflow in function imagetotga of convert.c\(jp2\):942 [\#858](https://github.com/uclouvain/openjpeg/issues/858)
|
||||||
|
|
||||||
|
**Merged pull requests:**
|
||||||
|
|
||||||
|
- abi-check.sh: fix broken download URL [\#1188](https://github.com/uclouvain/openjpeg/pull/1188) ([rouault](https://github.com/rouault))
|
||||||
|
- opj\_t1\_encode\_cblks: fix UBSAN signed integer overflow [\#1187](https://github.com/uclouvain/openjpeg/pull/1187) ([rouault](https://github.com/rouault))
|
||||||
|
- convertbmp: detect invalid file dimensions early \(CVE-2018-6616\) [\#1172](https://github.com/uclouvain/openjpeg/pull/1172) ([hlef](https://github.com/hlef))
|
||||||
|
- color\_apply\_icc\_profile: avoid potential heap buffer overflow [\#1170](https://github.com/uclouvain/openjpeg/pull/1170) ([rouault](https://github.com/rouault))
|
||||||
|
- Fix multiple potential vulnerabilities and bugs [\#1168](https://github.com/uclouvain/openjpeg/pull/1168) ([Young-X](https://github.com/Young-X))
|
||||||
|
- Fix several memory and resource leaks [\#1163](https://github.com/uclouvain/openjpeg/pull/1163) ([nforro](https://github.com/nforro))
|
||||||
|
- Fix some potential overflow issues [\#1161](https://github.com/uclouvain/openjpeg/pull/1161) ([stweil](https://github.com/stweil))
|
||||||
|
- jp3d/jpwl convert: fix write stack buffer overflow [\#1160](https://github.com/uclouvain/openjpeg/pull/1160) ([hlef](https://github.com/hlef))
|
||||||
|
- Int overflow fixed [\#1159](https://github.com/uclouvain/openjpeg/pull/1159) ([ichlubna](https://github.com/ichlubna))
|
||||||
|
- Update knownfailures- files given current configurations [\#1149](https://github.com/uclouvain/openjpeg/pull/1149) ([rouault](https://github.com/rouault))
|
||||||
|
- CVE-2018-5785: fix issues with zero bitmasks [\#1148](https://github.com/uclouvain/openjpeg/pull/1148) ([hlef](https://github.com/hlef))
|
||||||
|
- openjp2/jp2: Fix two format strings [\#1143](https://github.com/uclouvain/openjpeg/pull/1143) ([stweil](https://github.com/stweil))
|
||||||
|
- Changes in pnmtoimage if image data are missing [\#1141](https://github.com/uclouvain/openjpeg/pull/1141) ([szukw000](https://github.com/szukw000))
|
||||||
|
- Relative path to header files is hardcoded in OpenJPEGConfig.cmake.in file [\#1140](https://github.com/uclouvain/openjpeg/pull/1140) ([bukatlib](https://github.com/bukatlib))
|
||||||
|
- Cast on uint ceildiv [\#1136](https://github.com/uclouvain/openjpeg/pull/1136) ([reverson](https://github.com/reverson))
|
||||||
|
- Add -DBUILD\_PKGCONFIG\_FILES to install instructions [\#1133](https://github.com/uclouvain/openjpeg/pull/1133) ([robe2](https://github.com/robe2))
|
||||||
|
- Fix some typos in code comments and documentation [\#1128](https://github.com/uclouvain/openjpeg/pull/1128) ([stweil](https://github.com/stweil))
|
||||||
|
- Fix regression in reading files with TNsot == 0 \(refs \#1120\) [\#1121](https://github.com/uclouvain/openjpeg/pull/1121) ([rouault](https://github.com/rouault))
|
||||||
|
- Use local type declaration for POSIX standard type only for MS compiler [\#1119](https://github.com/uclouvain/openjpeg/pull/1119) ([stweil](https://github.com/stweil))
|
||||||
|
- Fix Mac builds [\#1104](https://github.com/uclouvain/openjpeg/pull/1104) ([rouault](https://github.com/rouault))
|
||||||
|
- jp3d: Replace sprintf\(\) by snprintf\(\) in volumetobin\(\) [\#1101](https://github.com/uclouvain/openjpeg/pull/1101) ([kbabioch](https://github.com/kbabioch))
|
||||||
|
- opj\_mj2\_extract: Rename output\_location to output\_prefix [\#1096](https://github.com/uclouvain/openjpeg/pull/1096) ([kbabioch](https://github.com/kbabioch))
|
||||||
|
- mj2: Add missing variable to format string in fprintf\(\) invocation in meta\_out.c [\#1094](https://github.com/uclouvain/openjpeg/pull/1094) ([kbabioch](https://github.com/kbabioch))
|
||||||
|
- Convert files to UTF-8 encoding [\#1090](https://github.com/uclouvain/openjpeg/pull/1090) ([stweil](https://github.com/stweil))
|
||||||
|
- fix unchecked integer multiplication overflow [\#1080](https://github.com/uclouvain/openjpeg/pull/1080) ([setharnold](https://github.com/setharnold))
|
||||||
|
- Fixed typos [\#1062](https://github.com/uclouvain/openjpeg/pull/1062) ([radarhere](https://github.com/radarhere))
|
||||||
|
- Note that seek uses SEEK\_SET behavior. [\#1055](https://github.com/uclouvain/openjpeg/pull/1055) ([ideasman42](https://github.com/ideasman42))
|
||||||
|
- Some Doxygen tags are removed [\#1050](https://github.com/uclouvain/openjpeg/pull/1050) ([szukw000](https://github.com/szukw000))
|
||||||
|
- Fix resource leak \(CID 179466\) [\#1047](https://github.com/uclouvain/openjpeg/pull/1047) ([stweil](https://github.com/stweil))
|
||||||
|
- Changed cmake version test to allow for cmake 2.8.11.x [\#1042](https://github.com/uclouvain/openjpeg/pull/1042) ([radarhere](https://github.com/radarhere))
|
||||||
|
- Add missing fclose\(\) statement in error condition. [\#1037](https://github.com/uclouvain/openjpeg/pull/1037) ([gfiumara](https://github.com/gfiumara))
|
||||||
|
|
||||||
|
## [v2.3.0](https://github.com/uclouvain/openjpeg/releases/v2.3.0) (2017-10-04)
|
||||||
|
[Full Changelog](https://github.com/uclouvain/openjpeg/compare/v2.2.0...v2.3.0)
|
||||||
|
|
||||||
|
**Implemented enhancements:**
|
||||||
|
|
||||||
|
- Sub-tile decoding: only decode precincts and codeblocks that intersect the window specified in opj_set_decode_area() [\#990](https://github.com/uclouvain/openjpeg/pull/990) ([rouault](https://github.com/rouault))
|
||||||
|
- Sub-tile decoding: only apply IDWT on areas that participate to the window of interest [\#1001](https://github.com/uclouvain/openjpeg/pull/1001) ([rouault](https://github.com/rouault))
|
||||||
|
- Sub-tile decoding: memory use reduction and perf improvements [\#1010](https://github.com/uclouvain/openjpeg/pull/1010) ([rouault](https://github.com/rouault))
|
||||||
|
- Add capability to decode only a subset of all components of an image. [\#1022](https://github.com/uclouvain/openjpeg/pull/1022) ([rouault](https://github.com/rouault))
|
||||||
|
|
||||||
|
**Fixed bugs:**
|
||||||
|
|
||||||
|
- Setting x offset of decode region to -1 causes opj\_decompress to go into infinite loop [\#736](https://github.com/uclouvain/openjpeg/issues/736)
|
||||||
|
- Problem decoding multiple tiles with get\_decoded\_tile when cmap/pclr/cdef boxes are present in jp2 file [\#484](https://github.com/uclouvain/openjpeg/issues/484)
|
||||||
|
- set reduce\_factor\_may\_fail [\#474](https://github.com/uclouvain/openjpeg/issues/474)
|
||||||
|
- opj\_compress.exe, command line parser, infinite loop [\#469](https://github.com/uclouvain/openjpeg/issues/469)
|
||||||
|
- Various memory access issues found via fuzzing [\#448](https://github.com/uclouvain/openjpeg/issues/448)
|
||||||
|
- Multiple warnings when building OpenJPEG \(trunk\) [\#442](https://github.com/uclouvain/openjpeg/issues/442)
|
||||||
|
- Bulk fuzz-testing report [\#427](https://github.com/uclouvain/openjpeg/issues/427)
|
||||||
|
- remove all printf from openjpeg / use proper function pointer for logging [\#371](https://github.com/uclouvain/openjpeg/issues/371)
|
||||||
|
- minor changes, clean-up [\#349](https://github.com/uclouvain/openjpeg/issues/349)
|
||||||
|
- image-\>numcomps \> 4 [\#333](https://github.com/uclouvain/openjpeg/issues/333)
|
||||||
|
- Improve support for region of interest [\#39](https://github.com/uclouvain/openjpeg/issues/39)
|
||||||
|
- Public function to tell kernel type used \(5x3 vs 9x7\) [\#3](https://github.com/uclouvain/openjpeg/issues/3)
|
||||||
|
- elf binary in source package ? [\#1026](https://github.com/uclouvain/openjpeg/issues/1026)
|
||||||
|
- opj\_cio\_open [\#1025](https://github.com/uclouvain/openjpeg/issues/1025)
|
||||||
|
- Building with Visual Studio 2015 [\#1023](https://github.com/uclouvain/openjpeg/issues/1023)
|
||||||
|
- tcd.cpp\>:1617:33: error: assigning to 'OPJ\_INT32 \*' \(aka 'int \*'\) from incompatible type 'void \*' [\#1021](https://github.com/uclouvain/openjpeg/issues/1021)
|
||||||
|
- j2k.cpp \> comparison of address of 'p\_j2k-\>m\_cp.tcps\[0\].m\_data' not equal to a null pointer is always true [\#1020](https://github.com/uclouvain/openjpeg/issues/1020)
|
||||||
|
- Openjpeg 2.2.0 always build shared library even though -DBUILD\_SHARED\_LIBS:bool=off [\#1019](https://github.com/uclouvain/openjpeg/issues/1019)
|
||||||
|
- missing fclose [\#1018](https://github.com/uclouvain/openjpeg/issues/1018)
|
||||||
|
- Use opj\_image\_data\_free instead of opj\_free for image-\>comps\[\].data [\#1014](https://github.com/uclouvain/openjpeg/issues/1014)
|
||||||
|
- malloc poison on some compilers - cross compiling [\#1013](https://github.com/uclouvain/openjpeg/issues/1013)
|
||||||
|
- Add OPJ\_VERSION\_MAJOR, OPJ\_VERSION\_MINOR, OPJ\_VERSION\_MICRO macros in openjpeg.h [\#1011](https://github.com/uclouvain/openjpeg/issues/1011)
|
||||||
|
- Encode: do not perform rate control for single-tile lossless [\#1009](https://github.com/uclouvain/openjpeg/issues/1009)
|
||||||
|
- opj\_set\_decoded\_resolution\_factor\(\): bad interaction with opj\_set\_decode\_area\(\) and/or opj\_decode\(\) [\#1006](https://github.com/uclouvain/openjpeg/issues/1006)
|
||||||
|
- memory allocation failure with .pgx file [\#999](https://github.com/uclouvain/openjpeg/issues/999)
|
||||||
|
- Unable to fuzz with raw image as input [\#998](https://github.com/uclouvain/openjpeg/issues/998)
|
||||||
|
- stack-based buffer overflow write in pgxtoimage \(/convert.c\) [\#997](https://github.com/uclouvain/openjpeg/issues/997)
|
||||||
|
- freeze with a crafted bmp [\#996](https://github.com/uclouvain/openjpeg/issues/996)
|
||||||
|
- invalid memory write in tgatoimage \(convert.c\) [\#995](https://github.com/uclouvain/openjpeg/issues/995)
|
||||||
|
- static build on Windows fails [\#994](https://github.com/uclouvain/openjpeg/issues/994)
|
||||||
|
- another heap-based buffer overflow in opj\_t2\_encode\_packet \(t2.c\) [\#993](https://github.com/uclouvain/openjpeg/issues/993)
|
||||||
|
- heap-based buffer overflow in opj\_t2\_encode\_packet \(t2.c\) [\#992](https://github.com/uclouvain/openjpeg/issues/992)
|
||||||
|
- heap-based buffer overflow in opj\_write\_bytes\_LE \(cio.c\) \(unfixed \#985\) [\#991](https://github.com/uclouvain/openjpeg/issues/991)
|
||||||
|
- heap overflow in opj\_compress [\#988](https://github.com/uclouvain/openjpeg/issues/988)
|
||||||
|
- heap overflow in opj\_decompress [\#987](https://github.com/uclouvain/openjpeg/issues/987)
|
||||||
|
- heap-based buffer overflow in opj\_bio\_byteout \(bio.c\) [\#986](https://github.com/uclouvain/openjpeg/issues/986)
|
||||||
|
- heap-based buffer overflow in opj\_write\_bytes\_LE \(cio.c\) [\#985](https://github.com/uclouvain/openjpeg/issues/985)
|
||||||
|
- memory allocation failure in opj\_aligned\_alloc\_n \(opj\_malloc.c\) [\#983](https://github.com/uclouvain/openjpeg/issues/983)
|
||||||
|
- heap-base buffer overflow in opj\_mqc\_flush \(mqc.c\) [\#982](https://github.com/uclouvain/openjpeg/issues/982)
|
||||||
|
- Decode fails for JP2s with ICC profile [\#981](https://github.com/uclouvain/openjpeg/issues/981)
|
||||||
|
- Unit tests failing on Ubuntu 17.04 [\#916](https://github.com/uclouvain/openjpeg/issues/916)
|
||||||
|
- Encoder crashes on small images [\#901](https://github.com/uclouvain/openjpeg/issues/901)
|
||||||
|
- openjpeg-1.5.3 fails to compile [\#830](https://github.com/uclouvain/openjpeg/issues/830)
|
||||||
|
- opj\_compress crops image \(win\) or creates a jp2 which cannot be decompressed \(lin\) [\#716](https://github.com/uclouvain/openjpeg/issues/716)
|
||||||
|
- -d flag is silently ignored when decoding a single tile [\#693](https://github.com/uclouvain/openjpeg/issues/693)
|
||||||
|
- transition away from dev-utils [\#628](https://github.com/uclouvain/openjpeg/issues/628)
|
||||||
|
- update instructions to build with Visual Studio and 64-Bit Visual C++ Toolset. [\#1028](https://github.com/uclouvain/openjpeg/pull/1028) ([quangnh89](https://github.com/quangnh89))
|
||||||
|
- Add missing newline at end of file [\#1024](https://github.com/uclouvain/openjpeg/pull/1024) ([stweil](https://github.com/stweil))
|
||||||
|
- merge master into coverity\_scan to update coverity results [\#1008](https://github.com/uclouvain/openjpeg/pull/1008) ([detonin](https://github.com/detonin))
|
||||||
|
- Use more const qualifiers [\#984](https://github.com/uclouvain/openjpeg/pull/984) ([stweil](https://github.com/stweil))
|
||||||
|
- Changes in converttif.c for PPC64 [\#980](https://github.com/uclouvain/openjpeg/pull/980) ([szukw000](https://github.com/szukw000))
|
||||||
|
|
||||||
|
## [v2.2.0](https://github.com/uclouvain/openjpeg/releases/v2.2.0) (2017-08-10)
|
||||||
|
[Full Changelog](https://github.com/uclouvain/openjpeg/compare/v2.1.2...v2.2.0)
|
||||||
|
|
||||||
|
**Implemented enhancements:**
|
||||||
|
|
||||||
|
- Memory consumption reduction at decoding side [\#968](https://github.com/uclouvain/openjpeg/pull/968) ([rouault](https://github.com/rouault))
|
||||||
|
- T1 & DWT multithreading decoding optimizations [\#786](https://github.com/uclouvain/openjpeg/pull/786) ([rouault](https://github.com/rouault))
|
||||||
|
- Tier1 decoder speed optimizations [\#783](https://github.com/uclouvain/openjpeg/pull/783) ([rouault](https://github.com/rouault))
|
||||||
|
- Inverse DWT 5x3: lift implementation / SSE accelerated version [\#953](https://github.com/uclouvain/openjpeg/issues/953)
|
||||||
|
- install static libraries [\#969](https://github.com/uclouvain/openjpeg/pull/969) ([jeroen](https://github.com/jeroen))
|
||||||
|
- IDWT 5x3 single-pass lifting and SSE2/AVX2 implementation [\#957](https://github.com/uclouvain/openjpeg/pull/957) ([rouault](https://github.com/rouault))
|
||||||
|
- build both shared and static library [\#954](https://github.com/uclouvain/openjpeg/pull/954) ([jeroen](https://github.com/jeroen))
|
||||||
|
- T1 flag optimizations \(\#172\) [\#945](https://github.com/uclouvain/openjpeg/pull/945) ([rouault](https://github.com/rouault))
|
||||||
|
- CMake: add stronger warnings for openjp2 lib/bin by default, and error out on declaration-after-statement [\#936](https://github.com/uclouvain/openjpeg/pull/936) ([rouault](https://github.com/rouault))
|
||||||
|
- Quiet mode for opj\_decompress via -quiet long parameter. [\#928](https://github.com/uclouvain/openjpeg/pull/928) ([RussellMcOrmond](https://github.com/RussellMcOrmond))
|
||||||
|
- Implement predictive termination check [\#800](https://github.com/uclouvain/openjpeg/pull/800) ([rouault](https://github.com/rouault))
|
||||||
|
|
||||||
|
**Fixed bugs:**
|
||||||
|
|
||||||
|
- Several issues spotted by Google OSS Fuzz - [see here](https://github.com/search?l=&q=OSS+Fuzz+author-date%3A2017-07-04..2017-08-01+repo%3Auclouvain%2Fopenjpeg&ref=advsearch&type=Commits&utf8=%E2%9C%93)
|
||||||
|
- Missing fclose [\#976](https://github.com/uclouvain/openjpeg/issues/976)
|
||||||
|
- Heap buffer overflow read in openjpeg imagetopnm [\#970](https://github.com/uclouvain/openjpeg/issues/970)
|
||||||
|
- opj\_decompress opj\_j2k\_update\_image\_data\(\) Segment falut [\#948](https://github.com/uclouvain/openjpeg/issues/948)
|
||||||
|
- Generic Crash in 1.5.0 [\#941](https://github.com/uclouvain/openjpeg/issues/941)
|
||||||
|
- Segmentation Faults [\#940](https://github.com/uclouvain/openjpeg/issues/940)
|
||||||
|
- Assertions thrown [\#939](https://github.com/uclouvain/openjpeg/issues/939)
|
||||||
|
- Floating Point Errors [\#938](https://github.com/uclouvain/openjpeg/issues/938)
|
||||||
|
- Division by zero crash [\#937](https://github.com/uclouvain/openjpeg/issues/937)
|
||||||
|
- malformed jp2 can cause heap-buffer-overflow [\#909](https://github.com/uclouvain/openjpeg/issues/909)
|
||||||
|
- NULL dereference can cause by malformed file [\#908](https://github.com/uclouvain/openjpeg/issues/908)
|
||||||
|
- Out of bound read in opj\_j2k\_add\_mct [\#907](https://github.com/uclouvain/openjpeg/issues/907)
|
||||||
|
- Check bpno\_plus\_one in opj\_t1\_decode\_cblk [\#903](https://github.com/uclouvain/openjpeg/issues/903)
|
||||||
|
- Undefined-shift in opj\_j2k\_read\_siz [\#902](https://github.com/uclouvain/openjpeg/issues/902)
|
||||||
|
- opj\_compress v2.1.2 can create images opj\_decompress cannot read [\#891](https://github.com/uclouvain/openjpeg/issues/891)
|
||||||
|
- Improper usage of opj\_int\_ceildiv can cause overflows [\#889](https://github.com/uclouvain/openjpeg/issues/889)
|
||||||
|
- Undefined shift in opj\_get\_all\_encoding\_parameters [\#885](https://github.com/uclouvain/openjpeg/issues/885)
|
||||||
|
- Denial of service \(crash\) due to use-after-free when decoding an illegal JPEG2000 image file v2.1.2 \(2017-04 [\#880](https://github.com/uclouvain/openjpeg/issues/880)
|
||||||
|
- Denial of service \(crash\) when decoding an illegal JPEG2000 image file v2.1.2 \(2017-03\) [\#879](https://github.com/uclouvain/openjpeg/issues/879)
|
||||||
|
- bug png 2 j2k [\#868](https://github.com/uclouvain/openjpeg/issues/868)
|
||||||
|
- Inconsistent compression using cinema settings on folder of non-compliant image [\#864](https://github.com/uclouvain/openjpeg/issues/864)
|
||||||
|
- Openjpeg-2.1.2 Heap Buffer Overflow Vulnerability due to Insufficient check [\#862](https://github.com/uclouvain/openjpeg/issues/862)
|
||||||
|
- Heap Buffer Overflow in function pnmtoimage of convert.c [\#861](https://github.com/uclouvain/openjpeg/issues/861)
|
||||||
|
- CVE-2016-9112 FPE\(Floating Point Exception\) in lib/openjp2/pi.c:523 [\#855](https://github.com/uclouvain/openjpeg/issues/855)
|
||||||
|
- CVE-2016-5139, CVE-2016-5152, CVE-2016-5158, CVE-2016-5159 [\#854](https://github.com/uclouvain/openjpeg/issues/854)
|
||||||
|
- Undefined Reference error [\#853](https://github.com/uclouvain/openjpeg/issues/853)
|
||||||
|
- opj\_compress with lossy compression results in strange pixel values [\#851](https://github.com/uclouvain/openjpeg/issues/851)
|
||||||
|
- CVE-2016-1626 and CVE-2016-1628 [\#850](https://github.com/uclouvain/openjpeg/issues/850)
|
||||||
|
- Out-of-Bounds Write in opj\_mqc\_byteout of mqc.c [\#835](https://github.com/uclouvain/openjpeg/issues/835)
|
||||||
|
- WARNING in tgt\_create tree-\>numnodes == 0, no tree created. [\#794](https://github.com/uclouvain/openjpeg/issues/794)
|
||||||
|
- Potential overflow when precision is larger than 32 [\#781](https://github.com/uclouvain/openjpeg/issues/781)
|
||||||
|
- division-by-zero in function opj\_pi\_next\_rpcl of pi.c \(line 366\) [\#780](https://github.com/uclouvain/openjpeg/issues/780)
|
||||||
|
- division-by-zero in function opj\_pi\_next\_rpcl of pi.c \(line 363\) [\#779](https://github.com/uclouvain/openjpeg/issues/779)
|
||||||
|
- division-by-zero in function opj\_pi\_next\_pcrl of pi.c \(line 447\) [\#778](https://github.com/uclouvain/openjpeg/issues/778)
|
||||||
|
- division-by-zero in function opj\_pi\_next\_pcrl of pi.c \(line 444\) [\#777](https://github.com/uclouvain/openjpeg/issues/777)
|
||||||
|
- Encoding the following file with 32x32 tiling produces jp2 image with artifact [\#737](https://github.com/uclouvain/openjpeg/issues/737)
|
||||||
|
- division-by-zero \(SIGFPE\) error in opj\_pi\_next\_cprl function \(line 526 of pi.c\) [\#732](https://github.com/uclouvain/openjpeg/issues/732)
|
||||||
|
- division-by-zero \(SIGFPE\) error in opj\_pi\_next\_cprl function \(line 523 of pi.c\) [\#731](https://github.com/uclouvain/openjpeg/issues/731)
|
||||||
|
- OpenJpeg 2.1 and 1.4 fails to decompress this file correctly [\#721](https://github.com/uclouvain/openjpeg/issues/721)
|
||||||
|
- MQ Encode :uninitialized memory access when first pass does not output any bytes [\#709](https://github.com/uclouvain/openjpeg/issues/709)
|
||||||
|
- Out-of-bounds read in opj\_j2k\_update\_image\_data and opj\_tgt\_reset function [\#704](https://github.com/uclouvain/openjpeg/issues/704)
|
||||||
|
- Remove opj\_aligned\_malloc / opj\_aligned\_realloc / opj\_aligned\_free? [\#689](https://github.com/uclouvain/openjpeg/issues/689)
|
||||||
|
- There is an issue with rendering some type of jpeg file. Please ref the link. [\#672](https://github.com/uclouvain/openjpeg/issues/672)
|
||||||
|
- Null Dereference in tcd\_malloc\_decode\_tile [\#657](https://github.com/uclouvain/openjpeg/issues/657)
|
||||||
|
- ETS-C1P0-p0\_12.j2k-compare2ref & NR-C1P0-p0\_12.j2k-compare2base failing under windows [\#655](https://github.com/uclouvain/openjpeg/issues/655)
|
||||||
|
- Memory leak [\#631](https://github.com/uclouvain/openjpeg/issues/631)
|
||||||
|
- Test 481 reports error in valgrind memcheck [\#612](https://github.com/uclouvain/openjpeg/issues/612)
|
||||||
|
- reserved identifier violation [\#587](https://github.com/uclouvain/openjpeg/issues/587)
|
||||||
|
- Buffer overflow when compressing some 16 bits images of the test suite [\#539](https://github.com/uclouvain/openjpeg/issues/539)
|
||||||
|
- Heap-buffer-overflow in opj\_dwt\_decode\_1 [\#480](https://github.com/uclouvain/openjpeg/issues/480)
|
||||||
|
- Automated fuzz testing [\#468](https://github.com/uclouvain/openjpeg/issues/468)
|
||||||
|
- Expected to find EPH marker [\#425](https://github.com/uclouvain/openjpeg/issues/425)
|
||||||
|
- read: segment too long \(6182\) with max \(35872\) for codeblock 0 \(p=19, b=2, r=5, c=1\) [\#284](https://github.com/uclouvain/openjpeg/issues/284)
|
||||||
|
- building 64bit version has lots of warnings [\#244](https://github.com/uclouvain/openjpeg/issues/244)
|
||||||
|
- Wrong encoding of small tiles with high level number [\#239](https://github.com/uclouvain/openjpeg/issues/239)
|
||||||
|
- Errors raised in pi.c by VS11 analyzer [\#190](https://github.com/uclouvain/openjpeg/issues/190)
|
||||||
|
- Undocumented optimization found in v2 branch of openjpeg [\#183](https://github.com/uclouvain/openjpeg/issues/183)
|
||||||
|
- T1 optimisations jpeg2000 [\#172](https://github.com/uclouvain/openjpeg/issues/172)
|
||||||
|
- Remove OPJ\_NOSANITIZE in opj\_bio\_read\(\) and opj\_bio\_write\(\) \(\#761\) [\#955](https://github.com/uclouvain/openjpeg/pull/955) ([rouault](https://github.com/rouault))
|
||||||
|
- Fix bypass pterm termall and lossless decomposition issue \(\#891, \#892\) [\#949](https://github.com/uclouvain/openjpeg/pull/949) ([rouault](https://github.com/rouault))
|
||||||
|
- Escape quotes to ensure README renders on GitHub correctly [\#914](https://github.com/uclouvain/openjpeg/pull/914) ([alexwlchan](https://github.com/alexwlchan))
|
||||||
|
- Remove spurious .R macros from manpages [\#899](https://github.com/uclouvain/openjpeg/pull/899) ([jwilk](https://github.com/jwilk))
|
||||||
|
- Remove warnings related to empty tag-trees. [\#893](https://github.com/uclouvain/openjpeg/pull/893) ([rouault](https://github.com/rouault))
|
||||||
|
|
||||||
|
**Maintenance-related tasks:**
|
||||||
|
|
||||||
|
- Submit OpenJPEG to oss-fuzz [\#965](https://github.com/uclouvain/openjpeg/issues/965)
|
||||||
|
- Updates for Doxygen to suppress warnings [\#849](https://github.com/uclouvain/openjpeg/issues/849)
|
||||||
|
- Remove useless knownfailures \(since LAZY encoding is fixed\) [\#964](https://github.com/uclouvain/openjpeg/pull/964) ([rouault](https://github.com/rouault))
|
||||||
|
- Enable AVX2 at runtime on Travis-CI and AppVeyor [\#963](https://github.com/uclouvain/openjpeg/pull/963) ([rouault](https://github.com/rouault))
|
||||||
|
- Tests: test opj\_compress in VSC mode \(related to \#172\) [\#935](https://github.com/uclouvain/openjpeg/pull/935) ([rouault](https://github.com/rouault))
|
||||||
|
- Reformat: apply reformattin on .h files \(\#128\) [\#926](https://github.com/uclouvain/openjpeg/pull/926) ([rouault](https://github.com/rouault))
|
||||||
|
- Add mechanisms to reformat and check code style, and reformat whole codebase \(\#128\) [\#919](https://github.com/uclouvain/openjpeg/pull/919) ([rouault](https://github.com/rouault))
|
||||||
|
- Add profiling of CPU and memory usage \(\#912\) [\#918](https://github.com/uclouvain/openjpeg/pull/918) ([rouault](https://github.com/rouault))
|
||||||
|
- Add performance benchmarking scripts [\#917](https://github.com/uclouvain/openjpeg/pull/917) ([rouault](https://github.com/rouault))
|
||||||
|
- Fix retrieval of jpylyzer in AppVeyor [\#915](https://github.com/uclouvain/openjpeg/pull/915) ([rouault](https://github.com/rouault))
|
||||||
|
|
||||||
|
## [v2.1.2](https://github.com/uclouvain/openjpeg/releases/v2.1.2) (2016-09-28)
|
||||||
|
[Full Changelog](https://github.com/uclouvain/openjpeg/compare/v2.1.1...v2.1.2)
|
||||||
|
|
||||||
|
**Closed issues:**
|
||||||
|
|
||||||
|
- null ptr dereference in convert.c:1331 [\#843](https://github.com/uclouvain/openjpeg/issues/843)
|
||||||
|
- Out-of-Bounds Read in function bmp24toimage of convertbmp.c [\#833](https://github.com/uclouvain/openjpeg/issues/833)
|
||||||
|
- Disable automatic compilation of t1\_generate\_luts in CMakeLists.txt [\#831](https://github.com/uclouvain/openjpeg/issues/831)
|
||||||
|
- CVE-2016-7163 Integer overflow in opj\_pi\_create\_decode [\#826](https://github.com/uclouvain/openjpeg/issues/826)
|
||||||
|
- Security Advisory for OpenJPEG [\#810](https://github.com/uclouvain/openjpeg/issues/810)
|
||||||
|
- Add dashboard with static lib [\#804](https://github.com/uclouvain/openjpeg/issues/804)
|
||||||
|
- hidden visibility for the static library / building with -DOPJ\_STATIC against shared lib [\#802](https://github.com/uclouvain/openjpeg/issues/802)
|
||||||
|
- Optimization when building library from source [\#799](https://github.com/uclouvain/openjpeg/issues/799)
|
||||||
|
- unsigned int16 on Solaris 11.2/sparc [\#796](https://github.com/uclouvain/openjpeg/issues/796)
|
||||||
|
- appveyor [\#793](https://github.com/uclouvain/openjpeg/issues/793)
|
||||||
|
- FFMpeg will not link to 2.1.1 release built as shared library [\#766](https://github.com/uclouvain/openjpeg/issues/766)
|
||||||
|
- API change since v2: opj\_event\_mgr\_t not available [\#754](https://github.com/uclouvain/openjpeg/issues/754)
|
||||||
|
- openjpeg.h needs dependencies [\#673](https://github.com/uclouvain/openjpeg/issues/673)
|
||||||
|
- "master" does not build on ubuntu [\#658](https://github.com/uclouvain/openjpeg/issues/658)
|
||||||
|
- Package 'openjp2', required by 'libopenjpip', not found [\#594](https://github.com/uclouvain/openjpeg/issues/594)
|
||||||
|
|
||||||
|
**Merged pull requests:**
|
||||||
|
|
||||||
|
- Fix PNM file reading [\#847](https://github.com/uclouvain/openjpeg/pull/847) ([mayeut](https://github.com/mayeut))
|
||||||
|
- Fix some issues reported by Coverity Scan [\#846](https://github.com/uclouvain/openjpeg/pull/846) ([stweil](https://github.com/stweil))
|
||||||
|
- Fix potential out-of-bounds read \(coverity\) [\#844](https://github.com/uclouvain/openjpeg/pull/844) ([stweil](https://github.com/stweil))
|
||||||
|
- Remove TODO for overflow check [\#842](https://github.com/uclouvain/openjpeg/pull/842) ([mayeut](https://github.com/mayeut))
|
||||||
|
- Add overflow checks for opj\_aligned\_malloc [\#841](https://github.com/uclouvain/openjpeg/pull/841) ([mayeut](https://github.com/mayeut))
|
||||||
|
- Flags in T1 shall be unsigned [\#840](https://github.com/uclouvain/openjpeg/pull/840) ([mayeut](https://github.com/mayeut))
|
||||||
|
- Fix some warnings [\#838](https://github.com/uclouvain/openjpeg/pull/838) ([mayeut](https://github.com/mayeut))
|
||||||
|
- Fix issue 833. [\#834](https://github.com/uclouvain/openjpeg/pull/834) ([trylab](https://github.com/trylab))
|
||||||
|
- Add overflow checks for opj\_aligned\_malloc [\#832](https://github.com/uclouvain/openjpeg/pull/832) ([mayeut](https://github.com/mayeut))
|
||||||
|
- Add test for issue 820 [\#829](https://github.com/uclouvain/openjpeg/pull/829) ([mayeut](https://github.com/mayeut))
|
||||||
|
- Add test for issue 826 [\#827](https://github.com/uclouvain/openjpeg/pull/827) ([mayeut](https://github.com/mayeut))
|
||||||
|
- Fix coverity 113065 \(CWE-484\) [\#824](https://github.com/uclouvain/openjpeg/pull/824) ([mayeut](https://github.com/mayeut))
|
||||||
|
- Add sanity check for tile coordinates [\#823](https://github.com/uclouvain/openjpeg/pull/823) ([mayeut](https://github.com/mayeut))
|
||||||
|
- Add test for PR 818 [\#822](https://github.com/uclouvain/openjpeg/pull/822) ([mayeut](https://github.com/mayeut))
|
||||||
|
- Update to libpng 1.6.25 [\#821](https://github.com/uclouvain/openjpeg/pull/821) ([mayeut](https://github.com/mayeut))
|
||||||
|
- CVE-2016-8332: fix incrementing of "l\_tcp-\>m\_nb\_mcc\_records" in opj\_j2k\_read\_mcc [\#820](https://github.com/uclouvain/openjpeg/pull/820) ([mayeut](https://github.com/mayeut))
|
||||||
|
- Add overflow check in opj\_tcd\_init\_tile [\#819](https://github.com/uclouvain/openjpeg/pull/819) ([mayeut](https://github.com/mayeut))
|
||||||
|
- Fix leak & invalid behavior of opj\_jp2\_read\_ihdr [\#818](https://github.com/uclouvain/openjpeg/pull/818) ([mayeut](https://github.com/mayeut))
|
||||||
|
- Add overflow check in opj\_j2k\_update\_image\_data [\#817](https://github.com/uclouvain/openjpeg/pull/817) ([mayeut](https://github.com/mayeut))
|
||||||
|
- Change 'restrict' define to 'OPJ\_RESTRICT' [\#816](https://github.com/uclouvain/openjpeg/pull/816) ([mayeut](https://github.com/mayeut))
|
||||||
|
- Switch to clang 3.8 [\#814](https://github.com/uclouvain/openjpeg/pull/814) ([mayeut](https://github.com/mayeut))
|
||||||
|
- Fix an integer overflow issue [\#809](https://github.com/uclouvain/openjpeg/pull/809) ([trylab](https://github.com/trylab))
|
||||||
|
- Update to lcms 2.8 [\#808](https://github.com/uclouvain/openjpeg/pull/808) ([mayeut](https://github.com/mayeut))
|
||||||
|
- Update to libpng 1.6.24 [\#807](https://github.com/uclouvain/openjpeg/pull/807) ([mayeut](https://github.com/mayeut))
|
||||||
|
- Reenable clang-3.9 build on travis [\#806](https://github.com/uclouvain/openjpeg/pull/806) ([mayeut](https://github.com/mayeut))
|
||||||
|
- Bit fields type [\#805](https://github.com/uclouvain/openjpeg/pull/805) ([smuehlst](https://github.com/smuehlst))
|
||||||
|
- Add compilation test for standalone inclusion of openjpeg.h [\#798](https://github.com/uclouvain/openjpeg/pull/798) ([mayeut](https://github.com/mayeut))
|
||||||
|
- jpwl: Remove non-portable data type u\_int16\_t \(fix issue \#796\) [\#797](https://github.com/uclouvain/openjpeg/pull/797) ([stweil](https://github.com/stweil))
|
||||||
|
- Fix dependency for pkg-config \(issue \#594\) [\#795](https://github.com/uclouvain/openjpeg/pull/795) ([stweil](https://github.com/stweil))
|
||||||
|
- Add .gitignore [\#787](https://github.com/uclouvain/openjpeg/pull/787) ([stweil](https://github.com/stweil))
|
||||||
|
|
||||||
|
## [v2.1.1](https://github.com/uclouvain/openjpeg/releases/tag/v2.1.1) (2016-07-05)
|
||||||
|
[Full Changelog](https://github.com/uclouvain/openjpeg/compare/version.2.1...v2.1.1)
|
||||||
|
|
||||||
|
**Implemented enhancements:**
|
||||||
|
|
||||||
|
- opj\_malloc replacement [\#625](https://github.com/uclouvain/openjpeg/issues/625)
|
||||||
|
- backport "-p" and "-force-rgb" options in 1.5 [\#606](https://github.com/uclouvain/openjpeg/issues/606)
|
||||||
|
- Use travis-ci matrix build [\#581](https://github.com/uclouvain/openjpeg/issues/581)
|
||||||
|
- Add Coverity Scan analysis [\#580](https://github.com/uclouvain/openjpeg/issues/580)
|
||||||
|
- Unnecessary rate distortion calculations [\#479](https://github.com/uclouvain/openjpeg/issues/479)
|
||||||
|
- Add images from various security issues to test suite [\#415](https://github.com/uclouvain/openjpeg/issues/415)
|
||||||
|
- Coding speed for 9/7 on 32bits platforms \(x86/ARM\) can be improved with a quick fix [\#220](https://github.com/uclouvain/openjpeg/issues/220)
|
||||||
|
|
||||||
|
**Fixed bugs:**
|
||||||
|
|
||||||
|
- Out-of-Bounds Access in function opj\_tgt\_reset of tgt.c [\#775](https://github.com/uclouvain/openjpeg/issues/775)
|
||||||
|
- Heap Buffer Overflow in function color\_cmyk\_to\_rgb of color.c [\#774](https://github.com/uclouvain/openjpeg/issues/774)
|
||||||
|
- division-by-zero \(SIGFPE\) error in opj\_tcd\_init\_tile function \(line 730 of tcd.c\) [\#733](https://github.com/uclouvain/openjpeg/issues/733)
|
||||||
|
- Out-Of-Bounds Read in sycc422\_to\_rgb function [\#726](https://github.com/uclouvain/openjpeg/issues/726)
|
||||||
|
- Heap Corruption in opj\_free function [\#725](https://github.com/uclouvain/openjpeg/issues/725)
|
||||||
|
- Out-Of-Bounds Read in opj\_tcd\_free\_tile function [\#724](https://github.com/uclouvain/openjpeg/issues/724)
|
||||||
|
- Cannot handle box of undefined size [\#653](https://github.com/uclouvain/openjpeg/issues/653)
|
||||||
|
- Compilation fails without platform-supplied aligned malloc [\#642](https://github.com/uclouvain/openjpeg/issues/642)
|
||||||
|
- HP compiler warns about redeclaration of static function [\#640](https://github.com/uclouvain/openjpeg/issues/640)
|
||||||
|
- Implementation-defined behavior of malloc causes different behavior on Linux and AIX [\#635](https://github.com/uclouvain/openjpeg/issues/635)
|
||||||
|
- Build on AIX fails because "opj\_includes.h" is included after system headers [\#633](https://github.com/uclouvain/openjpeg/issues/633)
|
||||||
|
- Compiling with SSE2 on Linux 32-bit causes crashes in OpenJPEG [\#624](https://github.com/uclouvain/openjpeg/issues/624)
|
||||||
|
- Build on AIX fails because of "restrict" pointers [\#620](https://github.com/uclouvain/openjpeg/issues/620)
|
||||||
|
- bug in new tif conversion code [\#609](https://github.com/uclouvain/openjpeg/issues/609)
|
||||||
|
- bin/jp2/convert.c line 1085 Resource leak [\#607](https://github.com/uclouvain/openjpeg/issues/607)
|
||||||
|
- bin/jp2/convert.c memory leak [\#601](https://github.com/uclouvain/openjpeg/issues/601)
|
||||||
|
- Resource leak in opj\_j2k\_create\_cstr\_index in case of failure [\#599](https://github.com/uclouvain/openjpeg/issues/599)
|
||||||
|
- Resource leak in opj\_j2k\_encode in case of failure [\#598](https://github.com/uclouvain/openjpeg/issues/598)
|
||||||
|
- Resource leak in opj\_j2k\_decode\_one\_tile in case of failure [\#597](https://github.com/uclouvain/openjpeg/issues/597)
|
||||||
|
- Resource Leak [\#573](https://github.com/uclouvain/openjpeg/issues/573)
|
||||||
|
- opj\_compress fails to compress lossless on gcc/x86 \(-m32\) [\#571](https://github.com/uclouvain/openjpeg/issues/571)
|
||||||
|
- Use-after-free in opj\_j2k\_write\_mco [\#563](https://github.com/uclouvain/openjpeg/issues/563)
|
||||||
|
- openjpeg-master-2015-07-30 failed to compile on LINUX [\#556](https://github.com/uclouvain/openjpeg/issues/556)
|
||||||
|
- PNG images are always read as RGB\(A\) images [\#536](https://github.com/uclouvain/openjpeg/issues/536)
|
||||||
|
- g4\_colr.j2c not handled properly [\#532](https://github.com/uclouvain/openjpeg/issues/532)
|
||||||
|
- Bigendian: opj\_compress + opj\_decompress fails [\#518](https://github.com/uclouvain/openjpeg/issues/518)
|
||||||
|
- Suspicious code in j2k.c [\#517](https://github.com/uclouvain/openjpeg/issues/517)
|
||||||
|
- Decode times almost double\(!!\) on Visual Studio 2013, 2015 [\#505](https://github.com/uclouvain/openjpeg/issues/505)
|
||||||
|
- opj\_data/input/nonregression/issue226.j2k [\#500](https://github.com/uclouvain/openjpeg/issues/500)
|
||||||
|
- opj\_setup\_encoder always returns true [\#497](https://github.com/uclouvain/openjpeg/issues/497)
|
||||||
|
- Double free in j2k\_read\_ppm\_v3 parsing \(\(presumably invalid\) image. [\#496](https://github.com/uclouvain/openjpeg/issues/496)
|
||||||
|
- Invalid write in opj\_j2k\_update\_image\_data [\#495](https://github.com/uclouvain/openjpeg/issues/495)
|
||||||
|
- Undefined printf format specifier %ud used in code [\#494](https://github.com/uclouvain/openjpeg/issues/494)
|
||||||
|
- Potential double free on malloc failure in opj\_j2k\_copy\_default\_tcp\_and\_create\_tcp\(\) [\#492](https://github.com/uclouvain/openjpeg/issues/492)
|
||||||
|
- Do not link with -ffast-math [\#488](https://github.com/uclouvain/openjpeg/issues/488)
|
||||||
|
- Heap-buffer-overflow in opj\_dwt\_decode [\#486](https://github.com/uclouvain/openjpeg/issues/486)
|
||||||
|
- opj\_dump fails on Windows 7, 64 bits [\#482](https://github.com/uclouvain/openjpeg/issues/482)
|
||||||
|
- SIGSEGV in opj\_j2k\_update\_image\_data via pdfium\_test [\#481](https://github.com/uclouvain/openjpeg/issues/481)
|
||||||
|
- Heap-buffer-overflow in opj\_j2k\_tcp\_destroy [\#477](https://github.com/uclouvain/openjpeg/issues/477)
|
||||||
|
- Invalid image causes write past end of heap buffer [\#476](https://github.com/uclouvain/openjpeg/issues/476)
|
||||||
|
- Assertion `l\_res-\>x0 \>= 0' fails when parsing invalid images [\#475](https://github.com/uclouvain/openjpeg/issues/475)
|
||||||
|
- Bug on opj\_write\_bytes\_BE function [\#472](https://github.com/uclouvain/openjpeg/issues/472)
|
||||||
|
- Refactor j2k\_read\_ppm\_v3 function [\#470](https://github.com/uclouvain/openjpeg/issues/470)
|
||||||
|
- compression: strange precinct dimensions [\#466](https://github.com/uclouvain/openjpeg/issues/466)
|
||||||
|
- \(:- Console message in opj\_decompress -:\) [\#465](https://github.com/uclouvain/openjpeg/issues/465)
|
||||||
|
- opj\_decompress fails to decompress any files [\#463](https://github.com/uclouvain/openjpeg/issues/463)
|
||||||
|
- bio-\>ct is unnecessarily set to zero in opj\_bio\_flush method [\#461](https://github.com/uclouvain/openjpeg/issues/461)
|
||||||
|
- Maximal unsigned short is 65535, not 65536 [\#460](https://github.com/uclouvain/openjpeg/issues/460)
|
||||||
|
- OpenJpeg fails to encode components with different precision properly [\#459](https://github.com/uclouvain/openjpeg/issues/459)
|
||||||
|
- component precision upscaling isn't correct in opj\_decompress [\#458](https://github.com/uclouvain/openjpeg/issues/458)
|
||||||
|
- Multiple precision components won't get encoded to jp2 if 1 component is unsigned 1 bit [\#457](https://github.com/uclouvain/openjpeg/issues/457)
|
||||||
|
- Incorrect code in ../bin/jp2/convert.c, function rawtoimage\_common\(...\) [\#456](https://github.com/uclouvain/openjpeg/issues/456)
|
||||||
|
- \[OpenJPEG-trunk\] opj\_stream\_get\_number\_byte\_left throws assert [\#455](https://github.com/uclouvain/openjpeg/issues/455)
|
||||||
|
- NR-DEC-kodak\_2layers\_lrcp.j2c-31-decode-md5 fails randomly when running tests in parallel [\#454](https://github.com/uclouvain/openjpeg/issues/454)
|
||||||
|
- compare\_raw\_files doesn't report an error on invalid arguments / missing input files [\#453](https://github.com/uclouvain/openjpeg/issues/453)
|
||||||
|
- Forward discrete wavelet transform: implement periodic symmetric extension at boundaries [\#452](https://github.com/uclouvain/openjpeg/issues/452)
|
||||||
|
- Bug in tiff reading method in convert.c [\#449](https://github.com/uclouvain/openjpeg/issues/449)
|
||||||
|
- Image in pdf don't display [\#447](https://github.com/uclouvain/openjpeg/issues/447)
|
||||||
|
- Multiple issues causing opj\_decompress to segfault [\#446](https://github.com/uclouvain/openjpeg/issues/446)
|
||||||
|
- opj\_compress: 40% of encode time is spent freeing data [\#445](https://github.com/uclouvain/openjpeg/issues/445)
|
||||||
|
- Multiple warnings when configuring OpenJPEG on MacOS with CMake 3.x \(trunk\) [\#443](https://github.com/uclouvain/openjpeg/issues/443)
|
||||||
|
- valgrind memleak found [\#437](https://github.com/uclouvain/openjpeg/issues/437)
|
||||||
|
- global-buffer-overflow src/lib/openjp2/t1.c:1146 opj\_t1\_getwmsedec [\#436](https://github.com/uclouvain/openjpeg/issues/436)
|
||||||
|
- Warning introduced on trunk r2923 & r2924 [\#435](https://github.com/uclouvain/openjpeg/issues/435)
|
||||||
|
- heap-buffer-overflow in opj\_t1\_decode\_cblks [\#432](https://github.com/uclouvain/openjpeg/issues/432)
|
||||||
|
- Heap-buffer-overflow in opj\_tcd\_init\_decode\_tile [\#431](https://github.com/uclouvain/openjpeg/issues/431)
|
||||||
|
- Heap-buffer-overflow in opj\_j2k\_tcp\_destroy [\#430](https://github.com/uclouvain/openjpeg/issues/430)
|
||||||
|
- Heap-buffer-overflow in opj\_jp2\_apply\_pclr [\#429](https://github.com/uclouvain/openjpeg/issues/429)
|
||||||
|
- issue412 revisited [\#428](https://github.com/uclouvain/openjpeg/issues/428)
|
||||||
|
- Image distorted \(sides look cankered\) [\#423](https://github.com/uclouvain/openjpeg/issues/423)
|
||||||
|
- openjpeg-2.x-trunk-r2918 is broken in color.c [\#422](https://github.com/uclouvain/openjpeg/issues/422)
|
||||||
|
- Heap-buffer-overflow in opj\_tcd\_init\_decode\_tile [\#420](https://github.com/uclouvain/openjpeg/issues/420)
|
||||||
|
- Heap-use-after-free in opj\_t1\_decode\_cblks [\#418](https://github.com/uclouvain/openjpeg/issues/418)
|
||||||
|
- UNKNOWN in opj\_read\_bytes\_LE [\#417](https://github.com/uclouvain/openjpeg/issues/417)
|
||||||
|
- Transparency problem [\#416](https://github.com/uclouvain/openjpeg/issues/416)
|
||||||
|
- Image with per channel alpha \(cdef\) does not decode properly [\#414](https://github.com/uclouvain/openjpeg/issues/414)
|
||||||
|
- OpenJPEG crashes with attached image [\#413](https://github.com/uclouvain/openjpeg/issues/413)
|
||||||
|
- Palette image with cdef fails to decompress [\#412](https://github.com/uclouvain/openjpeg/issues/412)
|
||||||
|
- Invalid member values from opj\_read\_header or opj\_decode ? [\#411](https://github.com/uclouvain/openjpeg/issues/411)
|
||||||
|
- MD5 Checksum hangs under valgrind on MacOS X [\#410](https://github.com/uclouvain/openjpeg/issues/410)
|
||||||
|
- Heap-buffer-overflow in opj\_tcd\_get\_decoded\_tile\_size [\#408](https://github.com/uclouvain/openjpeg/issues/408)
|
||||||
|
- C++ style comments in trunk/src/lib/openjp2/j2k.c [\#407](https://github.com/uclouvain/openjpeg/issues/407)
|
||||||
|
- Backport bugfixes from trunk to 2.1 branch [\#405](https://github.com/uclouvain/openjpeg/issues/405)
|
||||||
|
- Heap-buffer-overflow in parse\_cmdline\_encoder [\#403](https://github.com/uclouvain/openjpeg/issues/403)
|
||||||
|
- Heap-buffer-overflow in opj\_v4dwt\_interleave\_h [\#400](https://github.com/uclouvain/openjpeg/issues/400)
|
||||||
|
- Heap-buffer-overflow in opj\_dwt\_decode [\#399](https://github.com/uclouvain/openjpeg/issues/399)
|
||||||
|
- Heap-use-after-free in opj\_t1\_decode\_cblks [\#398](https://github.com/uclouvain/openjpeg/issues/398)
|
||||||
|
- Heap-buffer-overflow in opj\_jp2\_apply\_cdef [\#397](https://github.com/uclouvain/openjpeg/issues/397)
|
||||||
|
- Heap-buffer-overflow in opj\_t2\_read\_packet\_header [\#396](https://github.com/uclouvain/openjpeg/issues/396)
|
||||||
|
- Heap-buffer-overflow in opj\_t2\_read\_packet\_header [\#395](https://github.com/uclouvain/openjpeg/issues/395)
|
||||||
|
- Heap-buffer-overflow in opj\_dwt\_decode\_1 [\#394](https://github.com/uclouvain/openjpeg/issues/394)
|
||||||
|
- Heap-double-free in j2k\_read\_ppm\_v3 [\#393](https://github.com/uclouvain/openjpeg/issues/393)
|
||||||
|
- Security hole in j2k.c [\#392](https://github.com/uclouvain/openjpeg/issues/392)
|
||||||
|
- Security: double-free in opj\_tcd\_code\_block\_dec\_deallocate [\#391](https://github.com/uclouvain/openjpeg/issues/391)
|
||||||
|
- check for negative-size params in code [\#390](https://github.com/uclouvain/openjpeg/issues/390)
|
||||||
|
- Heap-buffer-overflow in opj\_t2\_read\_packet\_header [\#389](https://github.com/uclouvain/openjpeg/issues/389)
|
||||||
|
- Heap overflow in OpenJpeg 1.5.2 [\#388](https://github.com/uclouvain/openjpeg/issues/388)
|
||||||
|
- openjpip.so.6 file too short [\#387](https://github.com/uclouvain/openjpeg/issues/387)
|
||||||
|
- Corrupted JP3D file [\#386](https://github.com/uclouvain/openjpeg/issues/386)
|
||||||
|
- variable assigned to itself [\#383](https://github.com/uclouvain/openjpeg/issues/383)
|
||||||
|
- Null pointer dereferencing [\#382](https://github.com/uclouvain/openjpeg/issues/382)
|
||||||
|
- bad use of case statement [\#381](https://github.com/uclouvain/openjpeg/issues/381)
|
||||||
|
- Release 2.1 as a Ubuntu package [\#380](https://github.com/uclouvain/openjpeg/issues/380)
|
||||||
|
- Bug in libopenjpwl.pc [\#374](https://github.com/uclouvain/openjpeg/issues/374)
|
||||||
|
- inconsistent tile numbering in decode output message [\#370](https://github.com/uclouvain/openjpeg/issues/370)
|
||||||
|
- error in code block calculations [\#369](https://github.com/uclouvain/openjpeg/issues/369)
|
||||||
|
- r2872 fails to compile due to "attempt to use poisoned malloc" error in j2k.c [\#368](https://github.com/uclouvain/openjpeg/issues/368)
|
||||||
|
- OSX build gives libopenjp2.6.dylib with not-absolute install name id [\#367](https://github.com/uclouvain/openjpeg/issues/367)
|
||||||
|
- opj\_decompress gives error but successfully decompress in OPJ 2.1 [\#366](https://github.com/uclouvain/openjpeg/issues/366)
|
||||||
|
- pngtoimage\(\) and imagetopng\(\) have wrong byte order for 16-Bit image [\#365](https://github.com/uclouvain/openjpeg/issues/365)
|
||||||
|
- PDF crash in chrome - part2 \(due to attachment limit\) [\#364](https://github.com/uclouvain/openjpeg/issues/364)
|
||||||
|
- PDF crash in chrome - part1 [\#363](https://github.com/uclouvain/openjpeg/issues/363)
|
||||||
|
- PDF crash in chrome - part0 [\#362](https://github.com/uclouvain/openjpeg/issues/362)
|
||||||
|
- Compilation fails on Windows with mingw32 gcc4.8 [\#361](https://github.com/uclouvain/openjpeg/issues/361)
|
||||||
|
- security issue [\#360](https://github.com/uclouvain/openjpeg/issues/360)
|
||||||
|
- improve memory management [\#359](https://github.com/uclouvain/openjpeg/issues/359)
|
||||||
|
- how to compress a yuv420 raw data using opj\_compress [\#357](https://github.com/uclouvain/openjpeg/issues/357)
|
||||||
|
- Some memory allocation are not checked [\#355](https://github.com/uclouvain/openjpeg/issues/355)
|
||||||
|
- Static library symbols shall be marked as hidden [\#354](https://github.com/uclouvain/openjpeg/issues/354)
|
||||||
|
- opj\_compress rejects valid bmp files [\#353](https://github.com/uclouvain/openjpeg/issues/353)
|
||||||
|
- opj\_compress crashes when number of resolutions is set to zero [\#352](https://github.com/uclouvain/openjpeg/issues/352)
|
||||||
|
- Compilation error under Visual Studio 2003 [\#351](https://github.com/uclouvain/openjpeg/issues/351)
|
||||||
|
- opj\_compress description example error \[Low priority\] [\#350](https://github.com/uclouvain/openjpeg/issues/350)
|
||||||
|
- opj\_write\_bytes\_BE is wrong in trunk [\#345](https://github.com/uclouvain/openjpeg/issues/345)
|
||||||
|
- PART1ONLY option in release.sh doesn't work properly [\#332](https://github.com/uclouvain/openjpeg/issues/332)
|
||||||
|
- openjpeg crash error [\#330](https://github.com/uclouvain/openjpeg/issues/330)
|
||||||
|
- openjpeg decompress error [\#329](https://github.com/uclouvain/openjpeg/issues/329)
|
||||||
|
- openjpeg decompress issue [\#326](https://github.com/uclouvain/openjpeg/issues/326)
|
||||||
|
- limited tif support [\#322](https://github.com/uclouvain/openjpeg/issues/322)
|
||||||
|
- asoc value of 65536 is allowed [\#321](https://github.com/uclouvain/openjpeg/issues/321)
|
||||||
|
- opj\_skip\_from\_file error [\#314](https://github.com/uclouvain/openjpeg/issues/314)
|
||||||
|
- Heavy quota usage in openjpeg [\#309](https://github.com/uclouvain/openjpeg/issues/309)
|
||||||
|
- Verify -help actually match letter [\#307](https://github.com/uclouvain/openjpeg/issues/307)
|
||||||
|
- g3\_colr.j2c not handled [\#288](https://github.com/uclouvain/openjpeg/issues/288)
|
||||||
|
- reopen/fix issue 165 [\#280](https://github.com/uclouvain/openjpeg/issues/280)
|
||||||
|
- kakadu conformance tests [\#279](https://github.com/uclouvain/openjpeg/issues/279)
|
||||||
|
- missing break after case statement in opj\_dwt\_decode\_real [\#274](https://github.com/uclouvain/openjpeg/issues/274)
|
||||||
|
- Run Coverity on trunk [\#270](https://github.com/uclouvain/openjpeg/issues/270)
|
||||||
|
- NR-ENC-random-issue-0005.tif-12-encode [\#259](https://github.com/uclouvain/openjpeg/issues/259)
|
||||||
|
- Use new add\_test signature to handle cross compilation [\#258](https://github.com/uclouvain/openjpeg/issues/258)
|
||||||
|
- Loss decoding quality in 2.0.0 [\#254](https://github.com/uclouvain/openjpeg/issues/254)
|
||||||
|
- Decompress that worked in 1.5.1 fails in 2.0 [\#252](https://github.com/uclouvain/openjpeg/issues/252)
|
||||||
|
- Expected endianness with raw input is not documented leading to SEGFAULT [\#251](https://github.com/uclouvain/openjpeg/issues/251)
|
||||||
|
- OpenJPEG writes to stderr [\#246](https://github.com/uclouvain/openjpeg/issues/246)
|
||||||
|
- Inconsistent logging of tile index [\#245](https://github.com/uclouvain/openjpeg/issues/245)
|
||||||
|
- patch for openjpeg-trunk-r2347 and BIG\_ENDIAN [\#242](https://github.com/uclouvain/openjpeg/issues/242)
|
||||||
|
- CMAP: MTYP == 0 \(direct use\) not handled properly [\#235](https://github.com/uclouvain/openjpeg/issues/235)
|
||||||
|
- Black Pixel [\#233](https://github.com/uclouvain/openjpeg/issues/233)
|
||||||
|
- opj\_compress runtime error after fresh Linux install due to apparent failure to execute ldconfig [\#219](https://github.com/uclouvain/openjpeg/issues/219)
|
||||||
|
- openjp2 debug works, release build does not [\#217](https://github.com/uclouvain/openjpeg/issues/217)
|
||||||
|
- openjpeg-branch15-r2299 and openjpeg-trunk-r2299 fail to decode a JP2 file [\#212](https://github.com/uclouvain/openjpeg/issues/212)
|
||||||
|
- openjpeg-trunk issue with Win7 [\#201](https://github.com/uclouvain/openjpeg/issues/201)
|
||||||
|
- undefined reference to `opj\_version' [\#200](https://github.com/uclouvain/openjpeg/issues/200)
|
||||||
|
- In tgt.c we used fprintf not the openjpeg message reporter [\#184](https://github.com/uclouvain/openjpeg/issues/184)
|
||||||
|
- Windows binaries not working under WinXP [\#176](https://github.com/uclouvain/openjpeg/issues/176)
|
||||||
|
- add ability to use intel ipp \(performance primitive\) within OpenJPEG [\#164](https://github.com/uclouvain/openjpeg/issues/164)
|
||||||
|
- Migration guide v2 [\#160](https://github.com/uclouvain/openjpeg/issues/160)
|
||||||
|
- Cannot decompress JPEG2000Aware3.18.7.3Win32\_kdutranscode6.3.1.j2k [\#158](https://github.com/uclouvain/openjpeg/issues/158)
|
||||||
|
- Cannot decompress JPEG2000Aware3.18.7.3Win32.j2k [\#157](https://github.com/uclouvain/openjpeg/issues/157)
|
||||||
|
- openjpeg@googlegroups.com has disappeared [\#153](https://github.com/uclouvain/openjpeg/issues/153)
|
||||||
|
- OpenJPEG 1.5.0 crashes on a ridiculously big file... [\#151](https://github.com/uclouvain/openjpeg/issues/151)
|
||||||
|
- opj\_image vs free [\#146](https://github.com/uclouvain/openjpeg/issues/146)
|
||||||
|
- Windows .dll file invalid [\#140](https://github.com/uclouvain/openjpeg/issues/140)
|
||||||
|
- Problem with second layer of a 2 layer coded LRCP \(with precincts\) [\#135](https://github.com/uclouvain/openjpeg/issues/135)
|
||||||
|
- version 1.4 crashes when opening PDF file with JPEG2000 images [\#133](https://github.com/uclouvain/openjpeg/issues/133)
|
||||||
|
- Setup a win64 dashboard [\#132](https://github.com/uclouvain/openjpeg/issues/132)
|
||||||
|
- J2KP4files/codestreams\_profile0/p0\_13.j2k question jpeg2000 [\#131](https://github.com/uclouvain/openjpeg/issues/131)
|
||||||
|
- Out of memory: Kill process 11204 \(opj\_server\) score 917 or sacrifice child [\#123](https://github.com/uclouvain/openjpeg/issues/123)
|
||||||
|
- FILE\* in opj API is unsafe [\#120](https://github.com/uclouvain/openjpeg/issues/120)
|
||||||
|
- third-party lib order [\#119](https://github.com/uclouvain/openjpeg/issues/119)
|
||||||
|
- openjpeg-1.5.0-Darwin-powerpc.dmg is huge ! [\#113](https://github.com/uclouvain/openjpeg/issues/113)
|
||||||
|
- misleading info in JP2 box lead to wrong number of components [\#110](https://github.com/uclouvain/openjpeg/issues/110)
|
||||||
|
- Image\_to\_j2k says that j2k files is generated but no file is on the HDD [\#109](https://github.com/uclouvain/openjpeg/issues/109)
|
||||||
|
- Error in openjpegV1.4 on compiling image\_to\_j2k: crash on reading bmp file [\#108](https://github.com/uclouvain/openjpeg/issues/108)
|
||||||
|
- Update to abi-compliance-checker 1.96 [\#106](https://github.com/uclouvain/openjpeg/issues/106)
|
||||||
|
- Decode error on the attached JPEG...works in KDU and with JASPER...please help! [\#101](https://github.com/uclouvain/openjpeg/issues/101)
|
||||||
|
- Mac binaries v1.4 is broken [\#95](https://github.com/uclouvain/openjpeg/issues/95)
|
||||||
|
- jp2\_read\_boxhdr\(\) has size bug in version 1 [\#92](https://github.com/uclouvain/openjpeg/issues/92)
|
||||||
|
- Support for Java JAI Imageio [\#90](https://github.com/uclouvain/openjpeg/issues/90)
|
||||||
|
- encoding test failing [\#86](https://github.com/uclouvain/openjpeg/issues/86)
|
||||||
|
- source archive on demand [\#85](https://github.com/uclouvain/openjpeg/issues/85)
|
||||||
|
- CMakeLists.txt and Makefile.am for JPIP are buggy [\#84](https://github.com/uclouvain/openjpeg/issues/84)
|
||||||
|
- pclr-cmap-cdef [\#82](https://github.com/uclouvain/openjpeg/issues/82)
|
||||||
|
- Error when compiling openjpeg\_v1\_4\_sources\_r697 [\#79](https://github.com/uclouvain/openjpeg/issues/79)
|
||||||
|
- J2K codec issue on Windows Mobile [\#77](https://github.com/uclouvain/openjpeg/issues/77)
|
||||||
|
- image\_to\_j2k.exe crashes on large .bmp file [\#75](https://github.com/uclouvain/openjpeg/issues/75)
|
||||||
|
- fatal error C1900 building the project on windows [\#65](https://github.com/uclouvain/openjpeg/issues/65)
|
||||||
|
- same option but different size [\#54](https://github.com/uclouvain/openjpeg/issues/54)
|
||||||
|
- Missing openjpegConfigure.h [\#38](https://github.com/uclouvain/openjpeg/issues/38)
|
||||||
|
- Not an issue in openjpeg, but ... [\#37](https://github.com/uclouvain/openjpeg/issues/37)
|
||||||
|
- OpenJPEG-1.3.0 pclr, cmap and cdef [\#27](https://github.com/uclouvain/openjpeg/issues/27)
|
||||||
|
- realloc maybe too big \(t2.c\) [\#26](https://github.com/uclouvain/openjpeg/issues/26)
|
||||||
|
- libopenjpeg/opj\_malloc.h breaks on FreeBSD/Darwin systems [\#20](https://github.com/uclouvain/openjpeg/issues/20)
|
||||||
|
- image\_to\_j2k not outputting to win32 console properly [\#18](https://github.com/uclouvain/openjpeg/issues/18)
|
||||||
|
- \[OpenJPEG\] OpenJPEG\_v13: tiled image part 2 [\#17](https://github.com/uclouvain/openjpeg/issues/17)
|
||||||
|
- JP2 Color Space modification by Matteo Italia [\#13](https://github.com/uclouvain/openjpeg/issues/13)
|
||||||
|
- Patch submission \( exotic video formats, and a few things \) [\#12](https://github.com/uclouvain/openjpeg/issues/12)
|
||||||
|
- 16 bits lossy compression [\#10](https://github.com/uclouvain/openjpeg/issues/10)
|
||||||
|
- pnm file formats not accepting bitdepth greater than 8 bpp [\#8](https://github.com/uclouvain/openjpeg/issues/8)
|
||||||
|
- Heap corruption in j2k encoder [\#5](https://github.com/uclouvain/openjpeg/issues/5)
|
||||||
|
- JPWL crash in marker reallocation\(+patch\), segfault while decoding image with main header protection [\#4](https://github.com/uclouvain/openjpeg/issues/4)
|
||||||
|
- a couple of small errors in libopenjpeg detected by coverity [\#1](https://github.com/uclouvain/openjpeg/issues/1)
|
||||||
|
|
||||||
|
**Closed issues:**
|
||||||
|
|
||||||
|
- Shared library build broken on ubuntu [\#728](https://github.com/uclouvain/openjpeg/issues/728)
|
||||||
|
- opj\_includes.h shouldn't define `\_\_attribute\_\_` [\#727](https://github.com/uclouvain/openjpeg/issues/727)
|
||||||
|
- Possible website problems due to Jekyll upgrade [\#713](https://github.com/uclouvain/openjpeg/issues/713)
|
||||||
|
- Stable Release? [\#712](https://github.com/uclouvain/openjpeg/issues/712)
|
||||||
|
- Meta Issue : try to fix some of these critical bugs before thinking about optimizing the library [\#710](https://github.com/uclouvain/openjpeg/issues/710)
|
||||||
|
- Tiled encoding broken for images with non power of 2 dimensions [\#702](https://github.com/uclouvain/openjpeg/issues/702)
|
||||||
|
- install\_name \(still\) not set on OS X [\#700](https://github.com/uclouvain/openjpeg/issues/700)
|
||||||
|
- Add section in wiki describing where one can get test images [\#699](https://github.com/uclouvain/openjpeg/issues/699)
|
||||||
|
- Make EvenManager into singleton [\#698](https://github.com/uclouvain/openjpeg/issues/698)
|
||||||
|
- Remove old branches from repo [\#696](https://github.com/uclouvain/openjpeg/issues/696)
|
||||||
|
- MQ Coder encode: Conditional jump or move depends on uninitialised value\(s\) [\#695](https://github.com/uclouvain/openjpeg/issues/695)
|
||||||
|
- Can we add these files to our test suite ? [\#688](https://github.com/uclouvain/openjpeg/issues/688)
|
||||||
|
- -t and -d command line flags for decode are not documented on OpenJPEG website [\#685](https://github.com/uclouvain/openjpeg/issues/685)
|
||||||
|
- Decoding at the precinct level [\#676](https://github.com/uclouvain/openjpeg/issues/676)
|
||||||
|
- Support unscaled 10 bit data for 2K cinema @ 48 FPS, as per DCI standard [\#671](https://github.com/uclouvain/openjpeg/issues/671)
|
||||||
|
- Use parallel jobs in ctest [\#664](https://github.com/uclouvain/openjpeg/issues/664)
|
||||||
|
- \[Security\]Multiple Memory error [\#663](https://github.com/uclouvain/openjpeg/issues/663)
|
||||||
|
- lossy encoding a 16 bit TIF file : severe artifacts in decompressed image [\#660](https://github.com/uclouvain/openjpeg/issues/660)
|
||||||
|
- opj\_compress and opj\_decompress : get\_next\_file method uses hard-coded unix path separator [\#630](https://github.com/uclouvain/openjpeg/issues/630)
|
||||||
|
- Uninitialized variable [\#629](https://github.com/uclouvain/openjpeg/issues/629)
|
||||||
|
- Use of enum variable for bit flags prevents compilation as C++ source [\#619](https://github.com/uclouvain/openjpeg/issues/619)
|
||||||
|
- Serious problem with quantization during lossy encoding [\#615](https://github.com/uclouvain/openjpeg/issues/615)
|
||||||
|
- Decompression does not work with sequential data source [\#613](https://github.com/uclouvain/openjpeg/issues/613)
|
||||||
|
- potential overflow in opj\_tcd\_tile\_t [\#605](https://github.com/uclouvain/openjpeg/issues/605)
|
||||||
|
- Logical condition [\#596](https://github.com/uclouvain/openjpeg/issues/596)
|
||||||
|
- file9.jp2 does not dump correctly on 1.5 [\#595](https://github.com/uclouvain/openjpeg/issues/595)
|
||||||
|
- opj\_compress man page is missing documentation of -jpip option [\#593](https://github.com/uclouvain/openjpeg/issues/593)
|
||||||
|
- opj\_compress fails to compress lossless on gcc/x86 \(-m32\) in 1.5 branch [\#591](https://github.com/uclouvain/openjpeg/issues/591)
|
||||||
|
- Example: opj\_compress -i image.j2k -o image.pgm [\#577](https://github.com/uclouvain/openjpeg/issues/577)
|
||||||
|
- Mismatching delete [\#575](https://github.com/uclouvain/openjpeg/issues/575)
|
||||||
|
- Compilation fails on Win7 [\#546](https://github.com/uclouvain/openjpeg/issues/546)
|
||||||
|
- NR-JP2-file5.jp2-compare2base fails with third party libcms [\#540](https://github.com/uclouvain/openjpeg/issues/540)
|
||||||
|
- CTest spits out an error at the end of the test run [\#516](https://github.com/uclouvain/openjpeg/issues/516)
|
||||||
|
- opj\_uint\_adds\(\) is questionable [\#515](https://github.com/uclouvain/openjpeg/issues/515)
|
||||||
|
- Might consider renaming this method: [\#491](https://github.com/uclouvain/openjpeg/issues/491)
|
||||||
|
- opj\_compress run twice gives different fiile sizes for same file [\#490](https://github.com/uclouvain/openjpeg/issues/490)
|
||||||
|
- Android Support [\#483](https://github.com/uclouvain/openjpeg/issues/483)
|
||||||
|
- Add SSE2/SSE41 implementations for mct.c [\#451](https://github.com/uclouvain/openjpeg/issues/451)
|
||||||
|
- Reduce encoder code block memory usage for non 64x64 code block sizes [\#444](https://github.com/uclouvain/openjpeg/issues/444)
|
||||||
|
- valgrind "Uninitialized Memory Read" & "Uninitialized Memory Conditional" found [\#438](https://github.com/uclouvain/openjpeg/issues/438)
|
||||||
|
- No way to debug opj\_tcd\_init\_encode\_tile or opj\_tcd\_init\_decode\_tile [\#433](https://github.com/uclouvain/openjpeg/issues/433)
|
||||||
|
- Add option to call dsymutil on built binaries [\#409](https://github.com/uclouvain/openjpeg/issues/409)
|
||||||
|
- Allow opj\_compress and opj\_decompress to read/write images over stdin/stdout [\#379](https://github.com/uclouvain/openjpeg/issues/379)
|
||||||
|
- reduce memory significantly for single tile RGB encoding [\#375](https://github.com/uclouvain/openjpeg/issues/375)
|
||||||
|
- Switch code repo to github and start using pull request workflow [\#373](https://github.com/uclouvain/openjpeg/issues/373)
|
||||||
|
- This is a BigTIFF file. This format not supported [\#125](https://github.com/uclouvain/openjpeg/issues/125)
|
||||||
|
- Add a test suite to check the convert functions [\#99](https://github.com/uclouvain/openjpeg/issues/99)
|
||||||
|
- Add build config to the dashboard to verify the autotools build [\#88](https://github.com/uclouvain/openjpeg/issues/88)
|
||||||
|
|
||||||
|
**Merged pull requests:**
|
||||||
|
|
||||||
|
- Correct abi-check.sh for PR [\#791](https://github.com/uclouvain/openjpeg/pull/791) ([mayeut](https://github.com/mayeut))
|
||||||
|
- Update tcd.c [\#790](https://github.com/uclouvain/openjpeg/pull/790) ([maddin200](https://github.com/maddin200))
|
||||||
|
- Update lcms2 [\#773](https://github.com/uclouvain/openjpeg/pull/773) ([mayeut](https://github.com/mayeut))
|
||||||
|
- Use lowercase for cmake commands consistently [\#769](https://github.com/uclouvain/openjpeg/pull/769) ([julienmalik](https://github.com/julienmalik))
|
||||||
|
- Ignore clang's summary warning [\#768](https://github.com/uclouvain/openjpeg/pull/768) ([julienmalik](https://github.com/julienmalik))
|
||||||
|
- Fix UBSan gcc warning for first arg to memset non null [\#767](https://github.com/uclouvain/openjpeg/pull/767) ([julienmalik](https://github.com/julienmalik))
|
||||||
|
- Update to libtiff-4.0.6 [\#764](https://github.com/uclouvain/openjpeg/pull/764) ([mayeut](https://github.com/mayeut))
|
||||||
|
- Fix warnings [\#763](https://github.com/uclouvain/openjpeg/pull/763) ([mayeut](https://github.com/mayeut))
|
||||||
|
- Check SSIZ is valid in opj\_j2k\_read\_siz [\#762](https://github.com/uclouvain/openjpeg/pull/762) ([mayeut](https://github.com/mayeut))
|
||||||
|
- Fix unsigned int overflow reported by UBSan [\#761](https://github.com/uclouvain/openjpeg/pull/761) ([mayeut](https://github.com/mayeut))
|
||||||
|
- Fix unsigned int overflow reported by UBSan [\#759](https://github.com/uclouvain/openjpeg/pull/759) ([mayeut](https://github.com/mayeut))
|
||||||
|
- Fix negative shift left reported by UBSan [\#758](https://github.com/uclouvain/openjpeg/pull/758) ([mayeut](https://github.com/mayeut))
|
||||||
|
- Fix negative shift left reported by UBSan [\#757](https://github.com/uclouvain/openjpeg/pull/757) ([mayeut](https://github.com/mayeut))
|
||||||
|
- Add clang 3.9 build to Travis matrix [\#753](https://github.com/uclouvain/openjpeg/pull/753) ([julienmalik](https://github.com/julienmalik))
|
||||||
|
- Fix implicit floating bool conversion [\#752](https://github.com/uclouvain/openjpeg/pull/752) ([julienmalik](https://github.com/julienmalik))
|
||||||
|
- Do not define \_\_attribute\_\_ in opj\_includes.h [\#751](https://github.com/uclouvain/openjpeg/pull/751) ([mayeut](https://github.com/mayeut))
|
||||||
|
- Allow to read/write 3/5/7/9/11/13/15 bpp TIF files [\#750](https://github.com/uclouvain/openjpeg/pull/750) ([mayeut](https://github.com/mayeut))
|
||||||
|
- Fix heap-buffer-overflow in color\_esycc\_to\_rgb [\#748](https://github.com/uclouvain/openjpeg/pull/748) ([mayeut](https://github.com/mayeut))
|
||||||
|
- update libpng to from 1.6.17 to 1.6.21 [\#747](https://github.com/uclouvain/openjpeg/pull/747) ([julienmalik](https://github.com/julienmalik))
|
||||||
|
- Update cmake & jpylyzer for travis builds [\#746](https://github.com/uclouvain/openjpeg/pull/746) ([julienmalik](https://github.com/julienmalik))
|
||||||
|
- Fix Out-Of-Bounds Read in sycc42x\_to\_rgb function [\#745](https://github.com/uclouvain/openjpeg/pull/745) ([mayeut](https://github.com/mayeut))
|
||||||
|
- cppcheck fix for openjp2 [\#740](https://github.com/uclouvain/openjpeg/pull/740) ([julienmalik](https://github.com/julienmalik))
|
||||||
|
- Fix uninitialized variable reported by cppcheck [\#735](https://github.com/uclouvain/openjpeg/pull/735) ([julienmalik](https://github.com/julienmalik))
|
||||||
|
- Remove dead code in opj\_dump [\#734](https://github.com/uclouvain/openjpeg/pull/734) ([julienmalik](https://github.com/julienmalik))
|
||||||
|
- issue \#695 MQ Encode: ensure that bp pointer never points to uninitialized memory [\#708](https://github.com/uclouvain/openjpeg/pull/708) ([boxerab](https://github.com/boxerab))
|
||||||
|
- Fix issue 135 [\#706](https://github.com/uclouvain/openjpeg/pull/706) ([mayeut](https://github.com/mayeut))
|
||||||
|
- Fix implementation of opj\_calloc [\#705](https://github.com/uclouvain/openjpeg/pull/705) ([stweil](https://github.com/stweil))
|
||||||
|
- \[git/2.1 regression\] Fix opj\_write\_tile\(\) failure when numresolutions=1 [\#690](https://github.com/uclouvain/openjpeg/pull/690) ([rouault](https://github.com/rouault))
|
||||||
|
- Fix fatal crash on 64 bit Linux [\#687](https://github.com/uclouvain/openjpeg/pull/687) ([stweil](https://github.com/stweil))
|
||||||
|
- \[libtiff\] Add missing include statement for ssize\_t [\#686](https://github.com/uclouvain/openjpeg/pull/686) ([mayeut](https://github.com/mayeut))
|
||||||
|
- Fix duplicate article in comments [\#684](https://github.com/uclouvain/openjpeg/pull/684) ([stweil](https://github.com/stweil))
|
||||||
|
- Fix grammar in comment [\#679](https://github.com/uclouvain/openjpeg/pull/679) ([stweil](https://github.com/stweil))
|
||||||
|
- Remove whitespace and CR at line endings [\#678](https://github.com/uclouvain/openjpeg/pull/678) ([stweil](https://github.com/stweil))
|
||||||
|
- Fix typos [\#665](https://github.com/uclouvain/openjpeg/pull/665) ([jwilk](https://github.com/jwilk))
|
||||||
|
- Add missing source for the JPIP library and executables \(issue \#658\) [\#659](https://github.com/uclouvain/openjpeg/pull/659) ([stweil](https://github.com/stweil))
|
||||||
|
- Fix undefined size jp2 box handling [\#654](https://github.com/uclouvain/openjpeg/pull/654) ([mayeut](https://github.com/mayeut))
|
||||||
|
- opj\_decompress: Update error message [\#651](https://github.com/uclouvain/openjpeg/pull/651) ([stweil](https://github.com/stweil))
|
||||||
|
- Fix support of posix\_memalloc for Linux [\#648](https://github.com/uclouvain/openjpeg/pull/648) ([stweil](https://github.com/stweil))
|
||||||
|
- Fix typo in comments [\#647](https://github.com/uclouvain/openjpeg/pull/647) ([stweil](https://github.com/stweil))
|
||||||
|
- Avoid pointer arithmetic with \(void \*\) pointers [\#644](https://github.com/uclouvain/openjpeg/pull/644) ([smuehlst](https://github.com/smuehlst))
|
||||||
|
- Fix HP compiler warning about redeclaration of function \(\#640\) [\#641](https://github.com/uclouvain/openjpeg/pull/641) ([smuehlst](https://github.com/smuehlst))
|
||||||
|
- Fix format strings and unneeded assignment [\#638](https://github.com/uclouvain/openjpeg/pull/638) ([stweil](https://github.com/stweil))
|
||||||
|
- Fix repository for JPEG2000 test data [\#637](https://github.com/uclouvain/openjpeg/pull/637) ([stweil](https://github.com/stweil))
|
||||||
|
- Update allocation functions [\#636](https://github.com/uclouvain/openjpeg/pull/636) ([mayeut](https://github.com/mayeut))
|
||||||
|
- Fix OpenJPEG GitHub issue \#633. [\#634](https://github.com/uclouvain/openjpeg/pull/634) ([smuehlst](https://github.com/smuehlst))
|
||||||
|
- travis-ci: Include add ons in matrix [\#632](https://github.com/uclouvain/openjpeg/pull/632) ([mayeut](https://github.com/mayeut))
|
||||||
|
- Add Appveyor [\#627](https://github.com/uclouvain/openjpeg/pull/627) ([mayeut](https://github.com/mayeut))
|
||||||
|
- Use Travis-ci to run ABI check [\#626](https://github.com/uclouvain/openjpeg/pull/626) ([mayeut](https://github.com/mayeut))
|
||||||
|
- Fix warnings for C++ [\#623](https://github.com/uclouvain/openjpeg/pull/623) ([stweil](https://github.com/stweil))
|
||||||
|
- Fixed problem that C++ compilation failed because of enum variable. [\#622](https://github.com/uclouvain/openjpeg/pull/622) ([smuehlst](https://github.com/smuehlst))
|
||||||
|
- Added missing casts for return values of opj\_malloc\(\)/opj\_calloc\(\). [\#618](https://github.com/uclouvain/openjpeg/pull/618) ([smuehlst](https://github.com/smuehlst))
|
||||||
|
- Add check for seek support before trying TPsot==TNsot workaround [\#617](https://github.com/uclouvain/openjpeg/pull/617) ([mayeut](https://github.com/mayeut))
|
||||||
|
- Fix some typos found by codespell [\#610](https://github.com/uclouvain/openjpeg/pull/610) ([stweil](https://github.com/stweil))
|
||||||
|
- Correct leak in color\_cielab\_to\_rgb [\#590](https://github.com/uclouvain/openjpeg/pull/590) ([mayeut](https://github.com/mayeut))
|
||||||
|
- Add Travis-ci build matrix [\#584](https://github.com/uclouvain/openjpeg/pull/584) ([mayeut](https://github.com/mayeut))
|
||||||
|
- Correct lossless issue on linux x86 [\#579](https://github.com/uclouvain/openjpeg/pull/579) ([mayeut](https://github.com/mayeut))
|
||||||
|
- Travis-ci update [\#578](https://github.com/uclouvain/openjpeg/pull/578) ([mayeut](https://github.com/mayeut))
|
||||||
|
- Correct CMake version requirements [\#572](https://github.com/uclouvain/openjpeg/pull/572) ([mayeut](https://github.com/mayeut))
|
||||||
|
- Add tests for CMYK/esYCC/CIELab [\#567](https://github.com/uclouvain/openjpeg/pull/567) ([mayeut](https://github.com/mayeut))
|
||||||
|
- Add support for CIELab, EYCC and CMYK [\#559](https://github.com/uclouvain/openjpeg/pull/559) ([szukw000](https://github.com/szukw000))
|
||||||
|
- Remove printf/fprintf to stdout/stderr throughout openjp2 lib [\#558](https://github.com/uclouvain/openjpeg/pull/558) ([mayeut](https://github.com/mayeut))
|
||||||
|
- better -ffast-math handling [\#555](https://github.com/uclouvain/openjpeg/pull/555) ([rdieter](https://github.com/rdieter))
|
||||||
|
- Add jpylyzer tests for JP2 compression [\#552](https://github.com/uclouvain/openjpeg/pull/552) ([mayeut](https://github.com/mayeut))
|
||||||
|
- Add COC/QCC in main header when needed [\#551](https://github.com/uclouvain/openjpeg/pull/551) ([mayeut](https://github.com/mayeut))
|
||||||
|
- Use \_\_emul under msvc x86 for fast 64 = 32 \* 32 [\#550](https://github.com/uclouvain/openjpeg/pull/550) ([mayeut](https://github.com/mayeut))
|
||||||
|
- Update convert for PNG output [\#549](https://github.com/uclouvain/openjpeg/pull/549) ([mayeut](https://github.com/mayeut))
|
||||||
|
- Remove some warnings when building [\#548](https://github.com/uclouvain/openjpeg/pull/548) ([mayeut](https://github.com/mayeut))
|
||||||
|
- Switch to libpng-1.6.17 [\#547](https://github.com/uclouvain/openjpeg/pull/547) ([mayeut](https://github.com/mayeut))
|
||||||
|
- Add some missing static keywords [\#545](https://github.com/uclouvain/openjpeg/pull/545) ([mayeut](https://github.com/mayeut))
|
||||||
|
- Switch to libcms2 mm2/Little-CMS@0e8234e090d6aab33f90e2eb0296f30aa0705e57 [\#544](https://github.com/uclouvain/openjpeg/pull/544) ([mayeut](https://github.com/mayeut))
|
||||||
|
- Prevent overflow when coding 16 bits images [\#543](https://github.com/uclouvain/openjpeg/pull/543) ([mayeut](https://github.com/mayeut))
|
||||||
|
- Switch to libcms2-2.6 [\#542](https://github.com/uclouvain/openjpeg/pull/542) ([mayeut](https://github.com/mayeut))
|
||||||
|
- Update PNG support [\#538](https://github.com/uclouvain/openjpeg/pull/538) ([mayeut](https://github.com/mayeut))
|
||||||
|
- Various Minor fixes [\#537](https://github.com/uclouvain/openjpeg/pull/537) ([mayeut](https://github.com/mayeut))
|
||||||
|
- Update TIFF conversion to support more bit depth. [\#535](https://github.com/uclouvain/openjpeg/pull/535) ([mayeut](https://github.com/mayeut))
|
||||||
|
- Add checks for odd looking cmap & for cmap outside jp2h box [\#534](https://github.com/uclouvain/openjpeg/pull/534) ([mayeut](https://github.com/mayeut))
|
||||||
|
- Refactor opj\_j2k\_read\_ppm & opj\_j2k\_read\_ppt [\#533](https://github.com/uclouvain/openjpeg/pull/533) ([mayeut](https://github.com/mayeut))
|
||||||
|
- Add option to force component splitting in imagetopnm [\#531](https://github.com/uclouvain/openjpeg/pull/531) ([mayeut](https://github.com/mayeut))
|
||||||
|
- fix Suspicious code in j2k.c \#517 [\#529](https://github.com/uclouvain/openjpeg/pull/529) ([renevanderark](https://github.com/renevanderark))
|
||||||
|
- Update zlib to version 1.2.8 [\#528](https://github.com/uclouvain/openjpeg/pull/528) ([mayeut](https://github.com/mayeut))
|
||||||
|
- Fix opj\_write\_bytes\_BE \(\#518\) [\#521](https://github.com/uclouvain/openjpeg/pull/521) ([manisandro](https://github.com/manisandro))
|
||||||
|
- Correctly decode files with incorrect tile-part header fields \(TPsot==TNsot\) [\#514](https://github.com/uclouvain/openjpeg/pull/514) ([mayeut](https://github.com/mayeut))
|
||||||
|
- Fixed typos [\#510](https://github.com/uclouvain/openjpeg/pull/510) ([radarhere](https://github.com/radarhere))
|
||||||
|
- Formatted the readme file [\#507](https://github.com/uclouvain/openjpeg/pull/507) ([htmfilho](https://github.com/htmfilho))
|
||||||
|
|
||||||
|
## [version.2.1](https://github.com/uclouvain/openjpeg/releases/tag/version.2.1) (2014-04-29)
|
||||||
|
List of fixed issues and enhancements unavailable, see [NEWS](https://github.com/uclouvain/openjpeg/blob/master/NEWS.md) or [Full Changelog](https://github.com/uclouvain/openjpeg/compare/version.2.0.1...version.2.1)
|
||||||
|
|
||||||
|
## [version.2.0.1](https://github.com/uclouvain/openjpeg/releases/tag/version.2.0.1) (2014-04-22)
|
||||||
|
List of fixed issues and enhancements unavailable, see [NEWS](https://github.com/uclouvain/openjpeg/blob/master/NEWS.md) or [Full Changelog](https://github.com/uclouvain/openjpeg/compare/version.1.5.2...version.2.0.1)
|
||||||
|
|
||||||
|
## [version.1.5.2](https://github.com/uclouvain/openjpeg/releases/tag/version.1.5.2) (2014-03-28)
|
||||||
|
List of fixed issues and enhancements unavailable, see [NEWS](https://github.com/uclouvain/openjpeg/blob/master/NEWS.md) or [Full Changelog](https://github.com/uclouvain/openjpeg/compare/version.2.0...version.1.5.2)
|
||||||
|
|
||||||
|
## [version.2.0](https://github.com/uclouvain/openjpeg/releases/tag/version.2.0) (2014-03-28)
|
||||||
|
List of fixed issues and enhancements unavailable, see [NEWS](https://github.com/uclouvain/openjpeg/blob/master/NEWS.md) or [Full Changelog](https://github.com/uclouvain/openjpeg/compare/version.1.5.1...version.2.0)
|
||||||
|
|
||||||
|
## [version.1.5.1](https://github.com/uclouvain/openjpeg/releases/tag/version.1.5.1) (2012-09-13)
|
||||||
|
List of fixed issues and enhancements unavailable, see [NEWS](https://github.com/uclouvain/openjpeg/blob/master/NEWS.md) or [Full Changelog](https://github.com/uclouvain/openjpeg/compare/version.1.5...version.1.5.1)
|
||||||
|
|
||||||
|
## [version.1.5](https://github.com/uclouvain/openjpeg/releases/tag/version.1.5) (2012-02-07)
|
||||||
|
List of fixed issues and enhancements unavailable, see [NEWS](https://github.com/uclouvain/openjpeg/blob/master/NEWS.md) or [Full Changelog](https://github.com/uclouvain/openjpeg/compare/version.1.3...version.1.5)
|
||||||
|
|
||||||
|
## [version.1.3](https://github.com/uclouvain/openjpeg/releases/tag/version.1.3) (2011-07-03)
|
||||||
|
List of fixed issues and enhancements unavailable, see [NEWS](https://github.com/uclouvain/openjpeg/blob/master/NEWS.md) or [Full Changelog](https://github.com/uclouvain/openjpeg/compare/version.1.4...version.1.3)
|
||||||
|
|
||||||
|
## [version.1.4](https://github.com/uclouvain/openjpeg/releases/tag/version.1.4) (2011-07-03)
|
||||||
|
List of fixed issues and enhancements unavailable, see [NEWS](https://github.com/uclouvain/openjpeg/blob/master/NEWS.md) or [Full Changelog](https://github.com/uclouvain/openjpeg/compare/version.1.2...version.1.4)
|
||||||
|
|
||||||
|
## [version.1.2](https://github.com/uclouvain/openjpeg/releases/tag/version.1.2) (2007-06-04)
|
||||||
|
List of fixed issues and enhancements unavailable, see [NEWS](https://github.com/uclouvain/openjpeg/blob/master/NEWS.md) or [Full Changelog](https://github.com/uclouvain/openjpeg/compare/version.1.1...version.1.2)
|
||||||
|
|
||||||
|
## [version.1.1](https://github.com/uclouvain/openjpeg/releases/tag/version.1.1) (2007-01-31)
|
||||||
|
List of fixed issues and enhancements unavailable, see [NEWS](https://github.com/uclouvain/openjpeg/blob/master/NEWS.md) or [Full Changelog](https://github.com/uclouvain/openjpeg/compare/version.1.0...version.1.1)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
|
||||||
Vendored
+193
@@ -0,0 +1,193 @@
|
|||||||
|
# Build scripts are adopted to OpenCV project
|
||||||
|
# Main CMakeLists.txt to build the OpenJPEG project using CMake (www.cmake.org)
|
||||||
|
# Written by Mathieu Malaterre
|
||||||
|
|
||||||
|
cmake_policy(SET CMP0003 NEW)
|
||||||
|
if(POLICY CMP0042)
|
||||||
|
cmake_policy(SET CMP0042 NEW)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(OPENJPEG_LIBRARY_NAME libopenjp2)
|
||||||
|
|
||||||
|
project(openjpeg C)
|
||||||
|
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
# OPENJPEG version number, useful for packaging and doxygen doc:
|
||||||
|
set(OPENJPEG_VERSION_MAJOR 2)
|
||||||
|
set(OPENJPEG_VERSION_MINOR 3)
|
||||||
|
set(OPENJPEG_VERSION_BUILD 1)
|
||||||
|
set(OPENJPEG_VERSION
|
||||||
|
"${OPENJPEG_VERSION_MAJOR}.${OPENJPEG_VERSION_MINOR}.${OPENJPEG_VERSION_BUILD}")
|
||||||
|
set(PACKAGE_VERSION
|
||||||
|
"${OPENJPEG_VERSION_MAJOR}.${OPENJPEG_VERSION_MINOR}.${OPENJPEG_VERSION_BUILD}")
|
||||||
|
|
||||||
|
# Because autotools does not support X.Y notation for SOVERSION, we have to use
|
||||||
|
# two numbering, one for the openjpeg version and one for openjpeg soversion
|
||||||
|
# version | soversion
|
||||||
|
# 1.0 | 0
|
||||||
|
# 1.1 | 1
|
||||||
|
# 1.2 | 2
|
||||||
|
# 1.3 | 3
|
||||||
|
# 1.4 | 4
|
||||||
|
# 1.5 | 5
|
||||||
|
# 1.5.1 | 5
|
||||||
|
# 2.0 | 6
|
||||||
|
# 2.0.1 | 6
|
||||||
|
# 2.1 | 7
|
||||||
|
# 2.1.1 | 7
|
||||||
|
# 2.1.2 | 7
|
||||||
|
# 2.2.0 | 7
|
||||||
|
# 2.3.0 | 7
|
||||||
|
# 2.3.1 | 7
|
||||||
|
# above is the recommendation by the OPJ team. If you really need to override this default,
|
||||||
|
# you can specify your own OPENJPEG_SOVERSION at cmake configuration time:
|
||||||
|
# cmake -DOPENJPEG_SOVERSION:STRING=42 /path/to/openjpeg
|
||||||
|
if(NOT OPENJPEG_SOVERSION)
|
||||||
|
set(OPENJPEG_SOVERSION 7)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(OPENJPEG_LIBRARY_PROPERTIES
|
||||||
|
VERSION "${OPENJPEG_VERSION_MAJOR}.${OPENJPEG_VERSION_MINOR}.${OPENJPEG_VERSION_BUILD}"
|
||||||
|
SOVERSION "${OPENJPEG_SOVERSION}"
|
||||||
|
)
|
||||||
|
|
||||||
|
set(OPENJPEG_BUILD "opencv-${OPENCV_VERSION}-openjp2-${OPENJPEG_VERSION}")
|
||||||
|
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||||
|
set(OPENJPEG_BUILD "${OPENJPEG_BUILD}-debug")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
message(STATUS "OpenJPEG: VERSION = ${OPENJPEG_VERSION}, BUILD = ${OPENJPEG_BUILD}")
|
||||||
|
|
||||||
|
# --------------------------------------------------------------------------
|
||||||
|
# On Visual Studio 8 MS deprecated C. This removes all 1.276E1265 security
|
||||||
|
# warnings
|
||||||
|
if(WIN32)
|
||||||
|
if(NOT BORLAND)
|
||||||
|
if(NOT CYGWIN)
|
||||||
|
if(NOT MINGW)
|
||||||
|
if(NOT ITK_ENABLE_VISUAL_STUDIO_DEPRECATED_C_WARNINGS)
|
||||||
|
add_definitions(
|
||||||
|
-D_CRT_FAR_MAPPINGS_NO_DEPRECATE
|
||||||
|
-D_CRT_IS_WCTYPE_NO_DEPRECATE
|
||||||
|
-D_CRT_MANAGED_FP_NO_DEPRECATE
|
||||||
|
-D_CRT_NONSTDC_NO_DEPRECATE
|
||||||
|
-D_CRT_SECURE_NO_DEPRECATE
|
||||||
|
-D_CRT_SECURE_NO_DEPRECATE_GLOBALS
|
||||||
|
-D_CRT_SETERRORMODE_BEEP_SLEEP_NO_DEPRECATE
|
||||||
|
-D_CRT_TIME_FUNCTIONS_NO_DEPRECATE
|
||||||
|
-D_CRT_VCCLRIT_NO_DEPRECATE
|
||||||
|
-D_SCL_SECURE_NO_DEPRECATE
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
# Big endian test:
|
||||||
|
include(TestBigEndian)
|
||||||
|
test_big_endian(OPJ_BIG_ENDIAN)
|
||||||
|
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
# opj_config.h generation (1/2)
|
||||||
|
|
||||||
|
# Check if some include files are provided by the system
|
||||||
|
# These files are mandatory, so if they are not provided OpenJPEG library can't be built
|
||||||
|
include(CheckIncludeFile)
|
||||||
|
macro(ensure_file_include INCLUDE_FILENAME VARIABLE_NAME MANDATORY_STATUS)
|
||||||
|
check_include_file(${INCLUDE_FILENAME} ${VARIABLE_NAME})
|
||||||
|
if(NOT ${VARIABLE_NAME})
|
||||||
|
if(${MANDATORY_STATUS})
|
||||||
|
message(STATUS "The file '${INCLUDE_FILENAME}' is mandatory for OpenJPEG build, but not found on your system")
|
||||||
|
return()
|
||||||
|
else()
|
||||||
|
message(STATUS "The file '${INCLUDE_FILENAME}' is optional for OpenJPEG build and not found on your system."
|
||||||
|
" Internal implementation will be used.")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
ensure_file_include("string.h" HAVE_STRING_H YES)
|
||||||
|
ensure_file_include("memory.h" HAVE_MEMORY_H YES)
|
||||||
|
ensure_file_include("stdlib.h" HAVE_STDLIB_H YES)
|
||||||
|
ensure_file_include("stdio.h" HAVE_STDIO_H YES)
|
||||||
|
ensure_file_include("math.h" HAVE_MATH_H YES)
|
||||||
|
ensure_file_include("float.h" HAVE_FLOAT_H YES)
|
||||||
|
ensure_file_include("time.h" HAVE_TIME_H YES)
|
||||||
|
ensure_file_include("stdarg.h" HAVE_STDARG_H YES)
|
||||||
|
ensure_file_include("ctype.h" HAVE_CTYPE_H YES)
|
||||||
|
ensure_file_include("assert.h" HAVE_ASSERT_H YES)
|
||||||
|
|
||||||
|
# For the following files, we provide an alternative, they are not mandatory
|
||||||
|
ensure_file_include("stdint.h" OPJ_HAVE_STDINT_H NO)
|
||||||
|
ensure_file_include("inttypes.h" OPJ_HAVE_INTTYPES_H NO)
|
||||||
|
|
||||||
|
# why check this one ? for openjpip ?
|
||||||
|
CHECK_INCLUDE_FILE("strings.h" HAVE_STRINGS_H)
|
||||||
|
CHECK_INCLUDE_FILE("sys/stat.h" HAVE_SYS_STAT_H)
|
||||||
|
CHECK_INCLUDE_FILE("sys/types.h" HAVE_SYS_TYPES_H)
|
||||||
|
CHECK_INCLUDE_FILE("unistd.h" HAVE_UNISTD_H)
|
||||||
|
|
||||||
|
# Allocating Aligned Memory Blocks
|
||||||
|
include(CheckIncludeFiles)
|
||||||
|
check_include_files(malloc.h OPJ_HAVE_MALLOC_H)
|
||||||
|
include(CheckSymbolExists)
|
||||||
|
# _aligned_alloc https://msdn.microsoft.com/en-us/library/8z34s9c6.aspx
|
||||||
|
check_symbol_exists(_aligned_malloc malloc.h OPJ_HAVE__ALIGNED_MALLOC)
|
||||||
|
# posix_memalign (needs _POSIX_C_SOURCE >= 200112L on Linux)
|
||||||
|
set(_prev_CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS})
|
||||||
|
set(CMAKE_REQUIRED_DEFINITIONS -D_POSIX_C_SOURCE=200112L)
|
||||||
|
check_symbol_exists(posix_memalign stdlib.h OPJ_HAVE_POSIX_MEMALIGN)
|
||||||
|
set(CMAKE_REQUIRED_DEFINITIONS ${_prev_CMAKE_REQUIRED_DEFINITIONS})
|
||||||
|
unset(_prev_CMAKE_REQUIRED_DEFINITIONS)
|
||||||
|
# memalign (obsolete)
|
||||||
|
check_symbol_exists(memalign malloc.h OPJ_HAVE_MEMALIGN)
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
# opj_config.h generation (2/2)
|
||||||
|
configure_file(
|
||||||
|
${CMAKE_CURRENT_LIST_DIR}/openjp2/opj_config.h.cmake.in
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/openjp2/opj_config.h
|
||||||
|
@ONLY
|
||||||
|
)
|
||||||
|
|
||||||
|
configure_file(
|
||||||
|
${CMAKE_CURRENT_LIST_DIR}/openjp2/opj_config_private.h.cmake.in
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/openjp2/opj_config_private.h
|
||||||
|
@ONLY
|
||||||
|
)
|
||||||
|
|
||||||
|
add_subdirectory(openjp2)
|
||||||
|
|
||||||
|
set_target_properties(${OPENJPEG_LIBRARY_NAME}
|
||||||
|
PROPERTIES
|
||||||
|
OUTPUT_NAME ${OPENJPEG_LIBRARY_NAME}
|
||||||
|
DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
|
||||||
|
COMPILE_PDB_NAME ${OPENJPEG_LIBRARY_NAME}
|
||||||
|
COMPILE_PDB_NAME_DEBUG "${OPENJPEG_LIBRARY_NAME}${OPENCV_DEBUG_POSTFIX}"
|
||||||
|
ARCHIVE_OUTPUT_DIRECTORY ${3P_LIBRARY_OUTPUT_PATH}
|
||||||
|
)
|
||||||
|
|
||||||
|
if(ENABLE_SOLUTION_FOLDERS)
|
||||||
|
set_target_properties(${OPENJPEG_LIBRARY_NAME}
|
||||||
|
PROPERTIES
|
||||||
|
FOLDER "3rdparty"
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
ocv_install_3rdparty_licenses(${OPENJPEG_LIBRARY_NAME} README.md LICENSE)
|
||||||
|
|
||||||
|
# Setting all necessary variables
|
||||||
|
set(OPENJPEG_LIBRARIES ${OPENJPEG_LIBRARY_NAME} PARENT_SCOPE)
|
||||||
|
set(OPENJPEG_VERSION ${OPENJPEG_VERSION} PARENT_SCOPE)
|
||||||
|
set(OPENJPEG_MAJOR_VERSION ${OPENJPEG_VERSION_MAJOR} PARENT_SCOPE)
|
||||||
|
set(OPENJPEG_MINOR_VERSION ${OPENJPEG_VERSION_MINOR} PARENT_SCOPE)
|
||||||
|
set(OPENJPEG_BUILD_VERSION ${OPENJPEG_VERSION_BUILD} PARENT_SCOPE)
|
||||||
|
get_target_property(_openjpeg_include_dirs ${OPENJPEG_LIBRARY_NAME} INCLUDE_DIRECTORIES)
|
||||||
|
set(OPENJPEG_INCLUDE_DIRS ${_openjpeg_include_dirs} PARENT_SCOPE)
|
||||||
|
|
||||||
|
# OpenJPEG can't be built only if configuration script doesn't encounter any problem
|
||||||
|
if(NOT DEFINED OCV_CAN_BUILD_OPENJPEG)
|
||||||
|
# all prerequisites are fulfilled
|
||||||
|
set(OCV_CAN_BUILD_OPENJPEG TRUE PARENT_SCOPE)
|
||||||
|
endif()
|
||||||
Vendored
+39
@@ -0,0 +1,39 @@
|
|||||||
|
/*
|
||||||
|
* The copyright in this software is being made available under the 2-clauses
|
||||||
|
* BSD License, included below. This software may be subject to other third
|
||||||
|
* party and contributor rights, including patent rights, and no such rights
|
||||||
|
* are granted under this license.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
|
||||||
|
* Copyright (c) 2002-2014, Professor Benoit Macq
|
||||||
|
* Copyright (c) 2003-2014, Antonin Descampe
|
||||||
|
* Copyright (c) 2003-2009, Francois-Olivier Devaux
|
||||||
|
* Copyright (c) 2005, Herve Drolon, FreeImage Team
|
||||||
|
* Copyright (c) 2002-2003, Yannick Verschueren
|
||||||
|
* Copyright (c) 2001-2003, David Janssens
|
||||||
|
* Copyright (c) 2011-2012, Centre National d'Etudes Spatiales (CNES), France
|
||||||
|
* Copyright (c) 2012, CS Systemes d'Information, France
|
||||||
|
*
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions
|
||||||
|
* are met:
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
Vendored
+83
@@ -0,0 +1,83 @@
|
|||||||
|
|
||||||
|
# OPENJPEG Library and Applications
|
||||||
|
|
||||||
|
## What is OpenJPEG ?
|
||||||
|
|
||||||
|
OpenJPEG is an open-source JPEG 2000 codec written in C language. It has been developed in order to promote the use of [JPEG 2000](http://www.jpeg.org/jpeg2000), a still-image compression standard from the Joint Photographic Experts Group ([JPEG](http://www.jpeg.org)). Since April 2015, it is officially recognized by ISO/IEC and ITU-T as a [JPEG 2000 Reference Software](http://www.itu.int/rec/T-REC-T.804-201504-I!Amd2).
|
||||||
|
|
||||||
|
## Who can use the code ?
|
||||||
|
[![badge-license]][link-license]
|
||||||
|
|
||||||
|
Anyone. As the OpenJPEG code is released under the [BSD 2-clause "Simplified" License][link-license], anyone can use or modify the code, even for commercial applications. The only restriction is to retain the copyright in the sources or in the binaries documentation. Of course, if you modified the code in a way that might be of interest for other users, you are encouraged to share it (through a [github pull request](https://github.com/uclouvain/openjpeg/pulls) or by filling an [issue](https://github.com/uclouvain/openjpeg/issues)) but this is not a requirement.
|
||||||
|
|
||||||
|
## How to install and use OpenJPEG ?
|
||||||
|
API Documentation needs a major refactoring. Meanwhile, you can check [installation](https://github.com/uclouvain/openjpeg/wiki/Installation) instructions and [codec documentation](https://github.com/uclouvain/openjpeg/wiki/DocJ2KCodec).
|
||||||
|
|
||||||
|
## Current Status
|
||||||
|
[![badge-build]][link-build]
|
||||||
|
|
||||||
|
[![badge-msvc-build]][link-msvc-build]
|
||||||
|
|
||||||
|
[![badge-coverity]][link-coverity]
|
||||||
|
|
||||||
|
## Who are the developers ?
|
||||||
|
|
||||||
|
The library is developed and maintained by the Image and Signal Processing Group ([ISPGroup](http://sites.uclouvain.be/ispgroup/)), in the Université catholique de Louvain ([UCL](http://www.uclouvain.be/en-index.html), with the support of the [CNES](https://cnes.fr/), the [CS](http://www.c-s.fr/) company and the [intoPIX](http://www.intopix.com) company. The JPWL module has been developed by the Digital Signal Processing Lab ([DSPLab](http://dsplab.diei.unipg.it/)) of the University of Perugia, Italy ([UNIPG](http://www.unipg.it/)).
|
||||||
|
|
||||||
|
## Details on folders hierarchy
|
||||||
|
|
||||||
|
* src
|
||||||
|
* lib
|
||||||
|
* openjp2: contains the sources of the openjp2 library (Part 1 & 2)
|
||||||
|
* openjpwl: contains the additional sources if you want to build a JPWL-flavoured library.
|
||||||
|
* openjpip: complete client-server architecture for remote browsing of jpeg 2000 images.
|
||||||
|
* openjp3d: JP3D implementation
|
||||||
|
* openmj2: MJ2 implementation
|
||||||
|
* bin: contains all applications that use the openjpeg library
|
||||||
|
* common: common files to all applications
|
||||||
|
* jp2: a basic codec
|
||||||
|
* mj2: motion jpeg 2000 executables
|
||||||
|
* jpip: OpenJPIP applications (server and dec server)
|
||||||
|
* java: a Java client viewer for JPIP
|
||||||
|
* jp3d: JP3D applications
|
||||||
|
* tcltk: a test tool for JP3D
|
||||||
|
* wx
|
||||||
|
* OPJViewer: gui for displaying j2k files (based on wxWidget)
|
||||||
|
* wrapping
|
||||||
|
* java: java jni to use openjpeg in a java program
|
||||||
|
* thirdparty: thirdparty libraries used by some applications. These libraries will be built only if there are not found on the system. Note that libopenjpeg itself does not have any dependency.
|
||||||
|
* doc: doxygen documentation setup file and man pages
|
||||||
|
* tests: configuration files and utilities for the openjpeg test suite. All test images are located in [openjpeg-data](https://github.com/uclouvain/openjpeg-data) repository.
|
||||||
|
* cmake: cmake related files
|
||||||
|
* scripts: scripts for developers
|
||||||
|
|
||||||
|
See [LICENSE][link-license] for license and copyright information.
|
||||||
|
|
||||||
|
See [INSTALL](https://github.com/uclouvain/openjpeg/blob/master/INSTALL.md) for installation procedures.
|
||||||
|
|
||||||
|
See [NEWS](https://github.com/uclouvain/openjpeg/blob/master/NEWS.md) for user visible changes in successive releases.
|
||||||
|
|
||||||
|
## API/ABI
|
||||||
|
|
||||||
|
An API/ABI timeline is automatically updated [here][link-api-timeline].
|
||||||
|
|
||||||
|
OpenJPEG strives to provide a stable API/ABI for your applications. As such it
|
||||||
|
only exposes a limited subset of its functions. It uses a mechanism of
|
||||||
|
exporting/hiding functions. If you are unsure which functions you can use in
|
||||||
|
your applications, you should compile OpenJPEG using something similar to gcc:
|
||||||
|
`-fvisibility=hidden` compilation flag.
|
||||||
|
See also: http://gcc.gnu.org/wiki/Visibility
|
||||||
|
|
||||||
|
On windows, MSVC directly supports export/hiding function and as such the only
|
||||||
|
API available is the one supported by OpenJPEG.
|
||||||
|
|
||||||
|
[comment-license]: https://img.shields.io/github/license/uclouvain/openjpeg.svg "https://img.shields.io/badge/license-BSD--2--Clause-blue.svg"
|
||||||
|
[badge-license]: https://img.shields.io/badge/license-BSD--2--Clause-blue.svg "BSD 2-clause \"Simplified\" License"
|
||||||
|
[link-license]: https://github.com/uclouvain/openjpeg/blob/master/LICENSE "BSD 2-clause \"Simplified\" License"
|
||||||
|
[badge-build]: https://travis-ci.org/uclouvain/openjpeg.svg?branch=master "Build Status"
|
||||||
|
[link-build]: https://travis-ci.org/uclouvain/openjpeg "Build Status"
|
||||||
|
[badge-msvc-build]: https://ci.appveyor.com/api/projects/status/github/uclouvain/openjpeg?branch=master&svg=true "Windows Build Status"
|
||||||
|
[link-msvc-build]: https://ci.appveyor.com/project/detonin/openjpeg/branch/master "Windows Build Status"
|
||||||
|
[badge-coverity]: https://scan.coverity.com/projects/6383/badge.svg "Coverity Scan Build Status"
|
||||||
|
[link-coverity]: https://scan.coverity.com/projects/uclouvain-openjpeg "Coverity Scan Build Status"
|
||||||
|
[link-api-timeline]: http://www.openjpeg.org/abi-check/timeline/openjpeg "OpenJPEG API/ABI timeline"
|
||||||
Vendored
+39
@@ -0,0 +1,39 @@
|
|||||||
|
# OpenJPEG THANKS file
|
||||||
|
|
||||||
|
Many people have contributed to OpenJPEG by reporting problems, suggesting various improvements,
|
||||||
|
or submitting actual code. Here is a list of these people. Help me keep
|
||||||
|
it complete and exempt of errors.
|
||||||
|
|
||||||
|
* Giuseppe Baruffa
|
||||||
|
* Ben Boeckel
|
||||||
|
* Aaron Boxer
|
||||||
|
* David Burken
|
||||||
|
* Matthieu Darbois
|
||||||
|
* Rex Dieter
|
||||||
|
* Herve Drolon
|
||||||
|
* Antonin Descampe
|
||||||
|
* Francois-Olivier Devaux
|
||||||
|
* Parvatha Elangovan
|
||||||
|
* Jerôme Fimes
|
||||||
|
* Bob Friesenhahn
|
||||||
|
* Kaori Hagihara
|
||||||
|
* Luc Hermitte
|
||||||
|
* Luis Ibanez
|
||||||
|
* David Janssens
|
||||||
|
* Hans Johnson
|
||||||
|
* Callum Lerwick
|
||||||
|
* Ke Liu (Tencent's Xuanwu LAB)
|
||||||
|
* Sebastien Lugan
|
||||||
|
* Benoit Macq
|
||||||
|
* Mathieu Malaterre
|
||||||
|
* Julien Malik
|
||||||
|
* Arnaud Maye
|
||||||
|
* Vincent Nicolas
|
||||||
|
* Aleksander Nikolic (Cisco Talos)
|
||||||
|
* Glenn Pearson
|
||||||
|
* Even Rouault
|
||||||
|
* Dzonatas Sol
|
||||||
|
* Winfried Szukalski
|
||||||
|
* Vincent Torri
|
||||||
|
* Yannick Verschueren
|
||||||
|
* Peter Wimmer
|
||||||
+91
@@ -0,0 +1,91 @@
|
|||||||
|
# Defines the source code for the library
|
||||||
|
set(OPENJPEG_SRCS
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/thread.c
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/bio.c
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/cio.c
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/dwt.c
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/event.c
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/image.c
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/invert.c
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/j2k.c
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/jp2.c
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/mct.c
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/mqc.c
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/openjpeg.c
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/opj_clock.c
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/pi.c
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/t1.c
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/t2.c
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/tcd.c
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/tgt.c
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/function_list.c
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/opj_malloc.c
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/sparse_array.c
|
||||||
|
)
|
||||||
|
|
||||||
|
option(OPJ_DISABLE_TPSOT_FIX "Disable TPsot==TNsot fix. See https://github.com/uclouvain/openjpeg/issues/254." OFF)
|
||||||
|
if(OPJ_DISABLE_TPSOT_FIX)
|
||||||
|
add_definitions(-DOPJ_DISABLE_TPSOT_FIX)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Special case for old i586-mingw32msvc-gcc cross compiler
|
||||||
|
# if(NOT WIN32 AND CMAKE_COMPILER_IS_GNUCC AND CMAKE_C_COMPILER MATCHES ".*mingw32msvc.*" )
|
||||||
|
# set(WIN32 YES)
|
||||||
|
# endif()
|
||||||
|
|
||||||
|
ocv_warnings_disable(CMAKE_C_FLAGS -Wundef -Wstrict-prototypes -Wcast-function-type)
|
||||||
|
|
||||||
|
add_library(${OPENJPEG_LIBRARY_NAME} STATIC ${OPENJPEG_SRCS})
|
||||||
|
|
||||||
|
target_compile_definitions(${OPENJPEG_LIBRARY_NAME} PUBLIC OPJ_STATIC)
|
||||||
|
|
||||||
|
ocv_include_directories("${CMAKE_CURRENT_LIST_DIR}" "${CMAKE_CURRENT_BINARY_DIR}")
|
||||||
|
|
||||||
|
if(UNIX)
|
||||||
|
target_link_libraries(${OPENJPEG_LIBRARY_NAME} PRIVATE m)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set_target_properties(${OPENJPEG_LIBRARY_NAME}
|
||||||
|
PROPERTIES
|
||||||
|
${OPENJPEG_LIBRARY_PROPERTIES}
|
||||||
|
)
|
||||||
|
|
||||||
|
#################################################################################
|
||||||
|
# threading configuration
|
||||||
|
#################################################################################
|
||||||
|
|
||||||
|
option(OPJ_USE_THREAD "Build with thread/mutex support " ON)
|
||||||
|
if(NOT OPJ_USE_THREAD)
|
||||||
|
add_definitions(-DMUTEX_stub)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
find_package(Threads QUIET)
|
||||||
|
|
||||||
|
if(OPJ_USE_THREAD AND WIN32 AND NOT Threads_FOUND )
|
||||||
|
add_definitions(-DMUTEX_win32)
|
||||||
|
set(Threads_FOUND YES)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(OPJ_USE_THREAD AND Threads_FOUND AND CMAKE_USE_WIN32_THREADS_INIT)
|
||||||
|
add_definitions(-DMUTEX_win32)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(OPJ_USE_THREAD AND Threads_FOUND AND CMAKE_USE_PTHREADS_INIT )
|
||||||
|
add_definitions(-DMUTEX_pthread)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(OPJ_USE_THREAD AND NOT Threads_FOUND)
|
||||||
|
message(STATUS "No thread library found and thread/mutex support is required by OPJ_USE_THREAD option")
|
||||||
|
set(OCV_CAN_BUILD_OPENJPEG FALSE PARENT_SCOPE)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(OPJ_USE_THREAD AND Threads_FOUND AND CMAKE_USE_PTHREADS_INIT)
|
||||||
|
target_link_libraries(${OPENJPEG_LIBRARY_NAME} PRIVATE ${CMAKE_THREAD_LIBS_INIT})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(NOT BUILD_SHARED_LIBS)
|
||||||
|
ocv_install_target(${OPENJPEG_LIBRARY_NAME}
|
||||||
|
EXPORT OpenCVModules
|
||||||
|
ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev
|
||||||
|
)
|
||||||
|
endif()
|
||||||
Vendored
+217
@@ -0,0 +1,217 @@
|
|||||||
|
/*
|
||||||
|
* The copyright in this software is being made available under the 2-clauses
|
||||||
|
* BSD License, included below. This software may be subject to other third
|
||||||
|
* party and contributor rights, including patent rights, and no such rights
|
||||||
|
* are granted under this license.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
|
||||||
|
* Copyright (c) 2002-2014, Professor Benoit Macq
|
||||||
|
* Copyright (c) 2001-2003, David Janssens
|
||||||
|
* Copyright (c) 2002-2003, Yannick Verschueren
|
||||||
|
* Copyright (c) 2003-2007, Francois-Olivier Devaux
|
||||||
|
* Copyright (c) 2003-2014, Antonin Descampe
|
||||||
|
* Copyright (c) 2005, Herve Drolon, FreeImage Team
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions
|
||||||
|
* are met:
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "opj_includes.h"
|
||||||
|
|
||||||
|
/** @defgroup BIO BIO - Individual bit input-output stream */
|
||||||
|
/*@{*/
|
||||||
|
|
||||||
|
/** @name Local static functions */
|
||||||
|
/*@{*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
Write a bit
|
||||||
|
@param bio BIO handle
|
||||||
|
@param b Bit to write (0 or 1)
|
||||||
|
*/
|
||||||
|
static void opj_bio_putbit(opj_bio_t *bio, OPJ_UINT32 b);
|
||||||
|
/**
|
||||||
|
Read a bit
|
||||||
|
@param bio BIO handle
|
||||||
|
@return Returns the read bit
|
||||||
|
*/
|
||||||
|
static OPJ_UINT32 opj_bio_getbit(opj_bio_t *bio);
|
||||||
|
/**
|
||||||
|
Write a byte
|
||||||
|
@param bio BIO handle
|
||||||
|
@return Returns OPJ_TRUE if successful, returns OPJ_FALSE otherwise
|
||||||
|
*/
|
||||||
|
static OPJ_BOOL opj_bio_byteout(opj_bio_t *bio);
|
||||||
|
/**
|
||||||
|
Read a byte
|
||||||
|
@param bio BIO handle
|
||||||
|
@return Returns OPJ_TRUE if successful, returns OPJ_FALSE otherwise
|
||||||
|
*/
|
||||||
|
static OPJ_BOOL opj_bio_bytein(opj_bio_t *bio);
|
||||||
|
|
||||||
|
/*@}*/
|
||||||
|
|
||||||
|
/*@}*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
==========================================================
|
||||||
|
local functions
|
||||||
|
==========================================================
|
||||||
|
*/
|
||||||
|
|
||||||
|
static OPJ_BOOL opj_bio_byteout(opj_bio_t *bio)
|
||||||
|
{
|
||||||
|
bio->buf = (bio->buf << 8) & 0xffff;
|
||||||
|
bio->ct = bio->buf == 0xff00 ? 7 : 8;
|
||||||
|
if ((OPJ_SIZE_T)bio->bp >= (OPJ_SIZE_T)bio->end) {
|
||||||
|
return OPJ_FALSE;
|
||||||
|
}
|
||||||
|
*bio->bp++ = (OPJ_BYTE)(bio->buf >> 8);
|
||||||
|
return OPJ_TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
static OPJ_BOOL opj_bio_bytein(opj_bio_t *bio)
|
||||||
|
{
|
||||||
|
bio->buf = (bio->buf << 8) & 0xffff;
|
||||||
|
bio->ct = bio->buf == 0xff00 ? 7 : 8;
|
||||||
|
if ((OPJ_SIZE_T)bio->bp >= (OPJ_SIZE_T)bio->end) {
|
||||||
|
return OPJ_FALSE;
|
||||||
|
}
|
||||||
|
bio->buf |= *bio->bp++;
|
||||||
|
return OPJ_TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void opj_bio_putbit(opj_bio_t *bio, OPJ_UINT32 b)
|
||||||
|
{
|
||||||
|
if (bio->ct == 0) {
|
||||||
|
opj_bio_byteout(
|
||||||
|
bio); /* MSD: why not check the return value of this function ? */
|
||||||
|
}
|
||||||
|
bio->ct--;
|
||||||
|
bio->buf |= b << bio->ct;
|
||||||
|
}
|
||||||
|
|
||||||
|
static OPJ_UINT32 opj_bio_getbit(opj_bio_t *bio)
|
||||||
|
{
|
||||||
|
if (bio->ct == 0) {
|
||||||
|
opj_bio_bytein(
|
||||||
|
bio); /* MSD: why not check the return value of this function ? */
|
||||||
|
}
|
||||||
|
bio->ct--;
|
||||||
|
return (bio->buf >> bio->ct) & 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
==========================================================
|
||||||
|
Bit Input/Output interface
|
||||||
|
==========================================================
|
||||||
|
*/
|
||||||
|
|
||||||
|
opj_bio_t* opj_bio_create(void)
|
||||||
|
{
|
||||||
|
opj_bio_t *bio = (opj_bio_t*)opj_malloc(sizeof(opj_bio_t));
|
||||||
|
return bio;
|
||||||
|
}
|
||||||
|
|
||||||
|
void opj_bio_destroy(opj_bio_t *bio)
|
||||||
|
{
|
||||||
|
if (bio) {
|
||||||
|
opj_free(bio);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ptrdiff_t opj_bio_numbytes(opj_bio_t *bio)
|
||||||
|
{
|
||||||
|
return (bio->bp - bio->start);
|
||||||
|
}
|
||||||
|
|
||||||
|
void opj_bio_init_enc(opj_bio_t *bio, OPJ_BYTE *bp, OPJ_UINT32 len)
|
||||||
|
{
|
||||||
|
bio->start = bp;
|
||||||
|
bio->end = bp + len;
|
||||||
|
bio->bp = bp;
|
||||||
|
bio->buf = 0;
|
||||||
|
bio->ct = 8;
|
||||||
|
}
|
||||||
|
|
||||||
|
void opj_bio_init_dec(opj_bio_t *bio, OPJ_BYTE *bp, OPJ_UINT32 len)
|
||||||
|
{
|
||||||
|
bio->start = bp;
|
||||||
|
bio->end = bp + len;
|
||||||
|
bio->bp = bp;
|
||||||
|
bio->buf = 0;
|
||||||
|
bio->ct = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void opj_bio_write(opj_bio_t *bio, OPJ_UINT32 v, OPJ_UINT32 n)
|
||||||
|
{
|
||||||
|
OPJ_INT32 i;
|
||||||
|
|
||||||
|
assert((n > 0U) && (n <= 32U));
|
||||||
|
for (i = (OPJ_INT32)n - 1; i >= 0; i--) {
|
||||||
|
opj_bio_putbit(bio, (v >> i) & 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
OPJ_UINT32 opj_bio_read(opj_bio_t *bio, OPJ_UINT32 n)
|
||||||
|
{
|
||||||
|
OPJ_INT32 i;
|
||||||
|
OPJ_UINT32 v;
|
||||||
|
|
||||||
|
assert((n > 0U) /* && (n <= 32U)*/);
|
||||||
|
#ifdef OPJ_UBSAN_BUILD
|
||||||
|
/* This assert fails for some corrupted images which are gracefully rejected */
|
||||||
|
/* Add this assert only for ubsan build. */
|
||||||
|
/* This is the condition for overflow not to occur below which is needed because of OPJ_NOSANITIZE */
|
||||||
|
assert(n <= 32U);
|
||||||
|
#endif
|
||||||
|
v = 0U;
|
||||||
|
for (i = (OPJ_INT32)n - 1; i >= 0; i--) {
|
||||||
|
v |= opj_bio_getbit(bio) <<
|
||||||
|
i; /* can't overflow, opj_bio_getbit returns 0 or 1 */
|
||||||
|
}
|
||||||
|
return v;
|
||||||
|
}
|
||||||
|
|
||||||
|
OPJ_BOOL opj_bio_flush(opj_bio_t *bio)
|
||||||
|
{
|
||||||
|
if (! opj_bio_byteout(bio)) {
|
||||||
|
return OPJ_FALSE;
|
||||||
|
}
|
||||||
|
if (bio->ct == 7) {
|
||||||
|
if (! opj_bio_byteout(bio)) {
|
||||||
|
return OPJ_FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return OPJ_TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
OPJ_BOOL opj_bio_inalign(opj_bio_t *bio)
|
||||||
|
{
|
||||||
|
if ((bio->buf & 0xff) == 0xff) {
|
||||||
|
if (! opj_bio_bytein(bio)) {
|
||||||
|
return OPJ_FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
bio->ct = 0;
|
||||||
|
return OPJ_TRUE;
|
||||||
|
}
|
||||||
Vendored
+134
@@ -0,0 +1,134 @@
|
|||||||
|
/*
|
||||||
|
* The copyright in this software is being made available under the 2-clauses
|
||||||
|
* BSD License, included below. This software may be subject to other third
|
||||||
|
* party and contributor rights, including patent rights, and no such rights
|
||||||
|
* are granted under this license.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
|
||||||
|
* Copyright (c) 2002-2014, Professor Benoit Macq
|
||||||
|
* Copyright (c) 2001-2003, David Janssens
|
||||||
|
* Copyright (c) 2002-2003, Yannick Verschueren
|
||||||
|
* Copyright (c) 2003-2007, Francois-Olivier Devaux
|
||||||
|
* Copyright (c) 2003-2014, Antonin Descampe
|
||||||
|
* Copyright (c) 2005, Herve Drolon, FreeImage Team
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions
|
||||||
|
* are met:
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef OPJ_BIO_H
|
||||||
|
#define OPJ_BIO_H
|
||||||
|
|
||||||
|
#include <stddef.h> /* ptrdiff_t */
|
||||||
|
|
||||||
|
/**
|
||||||
|
@file bio.h
|
||||||
|
@brief Implementation of an individual bit input-output (BIO)
|
||||||
|
|
||||||
|
The functions in BIO.C have for goal to realize an individual bit input - output.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup BIO BIO - Individual bit input-output stream */
|
||||||
|
/*@{*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
Individual bit input-output stream (BIO)
|
||||||
|
*/
|
||||||
|
typedef struct opj_bio {
|
||||||
|
/** pointer to the start of the buffer */
|
||||||
|
OPJ_BYTE *start;
|
||||||
|
/** pointer to the end of the buffer */
|
||||||
|
OPJ_BYTE *end;
|
||||||
|
/** pointer to the present position in the buffer */
|
||||||
|
OPJ_BYTE *bp;
|
||||||
|
/** temporary place where each byte is read or written */
|
||||||
|
OPJ_UINT32 buf;
|
||||||
|
/** coder : number of bits free to write. decoder : number of bits read */
|
||||||
|
OPJ_UINT32 ct;
|
||||||
|
} opj_bio_t;
|
||||||
|
|
||||||
|
/** @name Exported functions */
|
||||||
|
/*@{*/
|
||||||
|
/* ----------------------------------------------------------------------- */
|
||||||
|
/**
|
||||||
|
Create a new BIO handle
|
||||||
|
@return Returns a new BIO handle if successful, returns NULL otherwise
|
||||||
|
*/
|
||||||
|
opj_bio_t* opj_bio_create(void);
|
||||||
|
/**
|
||||||
|
Destroy a previously created BIO handle
|
||||||
|
@param bio BIO handle to destroy
|
||||||
|
*/
|
||||||
|
void opj_bio_destroy(opj_bio_t *bio);
|
||||||
|
/**
|
||||||
|
Number of bytes written.
|
||||||
|
@param bio BIO handle
|
||||||
|
@return Returns the number of bytes written
|
||||||
|
*/
|
||||||
|
ptrdiff_t opj_bio_numbytes(opj_bio_t *bio);
|
||||||
|
/**
|
||||||
|
Init encoder
|
||||||
|
@param bio BIO handle
|
||||||
|
@param bp Output buffer
|
||||||
|
@param len Output buffer length
|
||||||
|
*/
|
||||||
|
void opj_bio_init_enc(opj_bio_t *bio, OPJ_BYTE *bp, OPJ_UINT32 len);
|
||||||
|
/**
|
||||||
|
Init decoder
|
||||||
|
@param bio BIO handle
|
||||||
|
@param bp Input buffer
|
||||||
|
@param len Input buffer length
|
||||||
|
*/
|
||||||
|
void opj_bio_init_dec(opj_bio_t *bio, OPJ_BYTE *bp, OPJ_UINT32 len);
|
||||||
|
/**
|
||||||
|
Write bits
|
||||||
|
@param bio BIO handle
|
||||||
|
@param v Value of bits
|
||||||
|
@param n Number of bits to write
|
||||||
|
*/
|
||||||
|
void opj_bio_write(opj_bio_t *bio, OPJ_UINT32 v, OPJ_UINT32 n);
|
||||||
|
/**
|
||||||
|
Read bits
|
||||||
|
@param bio BIO handle
|
||||||
|
@param n Number of bits to read
|
||||||
|
@return Returns the corresponding read number
|
||||||
|
*/
|
||||||
|
OPJ_UINT32 opj_bio_read(opj_bio_t *bio, OPJ_UINT32 n);
|
||||||
|
/**
|
||||||
|
Flush bits
|
||||||
|
@param bio BIO handle
|
||||||
|
@return Returns OPJ_TRUE if successful, returns OPJ_FALSE otherwise
|
||||||
|
*/
|
||||||
|
OPJ_BOOL opj_bio_flush(opj_bio_t *bio);
|
||||||
|
/**
|
||||||
|
Passes the ending bits (coming from flushing)
|
||||||
|
@param bio BIO handle
|
||||||
|
@return Returns OPJ_TRUE if successful, returns OPJ_FALSE otherwise
|
||||||
|
*/
|
||||||
|
OPJ_BOOL opj_bio_inalign(opj_bio_t *bio);
|
||||||
|
/* ----------------------------------------------------------------------- */
|
||||||
|
/*@}*/
|
||||||
|
|
||||||
|
/*@}*/
|
||||||
|
|
||||||
|
#endif /* OPJ_BIO_H */
|
||||||
|
|
||||||
Vendored
+683
@@ -0,0 +1,683 @@
|
|||||||
|
/*
|
||||||
|
* The copyright in this software is being made available under the 2-clauses
|
||||||
|
* BSD License, included below. This software may be subject to other third
|
||||||
|
* party and contributor rights, including patent rights, and no such rights
|
||||||
|
* are granted under this license.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
|
||||||
|
* Copyright (c) 2002-2014, Professor Benoit Macq
|
||||||
|
* Copyright (c) 2001-2003, David Janssens
|
||||||
|
* Copyright (c) 2002-2003, Yannick Verschueren
|
||||||
|
* Copyright (c) 2003-2007, Francois-Olivier Devaux
|
||||||
|
* Copyright (c) 2003-2014, Antonin Descampe
|
||||||
|
* Copyright (c) 2005, Herve Drolon, FreeImage Team
|
||||||
|
* Copyright (c) 2008, 2011-2012, Centre National d'Etudes Spatiales (CNES), FR
|
||||||
|
* Copyright (c) 2012, CS Systemes d'Information, France
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions
|
||||||
|
* are met:
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "opj_includes.h"
|
||||||
|
|
||||||
|
/* ----------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
|
||||||
|
/* ----------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
void opj_write_bytes_BE(OPJ_BYTE * p_buffer, OPJ_UINT32 p_value,
|
||||||
|
OPJ_UINT32 p_nb_bytes)
|
||||||
|
{
|
||||||
|
const OPJ_BYTE * l_data_ptr = ((const OPJ_BYTE *) &p_value) + sizeof(
|
||||||
|
OPJ_UINT32) - p_nb_bytes;
|
||||||
|
|
||||||
|
assert(p_nb_bytes > 0 && p_nb_bytes <= sizeof(OPJ_UINT32));
|
||||||
|
|
||||||
|
memcpy(p_buffer, l_data_ptr, p_nb_bytes);
|
||||||
|
}
|
||||||
|
|
||||||
|
void opj_write_bytes_LE(OPJ_BYTE * p_buffer, OPJ_UINT32 p_value,
|
||||||
|
OPJ_UINT32 p_nb_bytes)
|
||||||
|
{
|
||||||
|
const OPJ_BYTE * l_data_ptr = ((const OPJ_BYTE *) &p_value) + p_nb_bytes - 1;
|
||||||
|
OPJ_UINT32 i;
|
||||||
|
|
||||||
|
assert(p_nb_bytes > 0 && p_nb_bytes <= sizeof(OPJ_UINT32));
|
||||||
|
|
||||||
|
for (i = 0; i < p_nb_bytes; ++i) {
|
||||||
|
*(p_buffer++) = *(l_data_ptr--);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void opj_read_bytes_BE(const OPJ_BYTE * p_buffer, OPJ_UINT32 * p_value,
|
||||||
|
OPJ_UINT32 p_nb_bytes)
|
||||||
|
{
|
||||||
|
OPJ_BYTE * l_data_ptr = ((OPJ_BYTE *) p_value);
|
||||||
|
|
||||||
|
assert(p_nb_bytes > 0 && p_nb_bytes <= sizeof(OPJ_UINT32));
|
||||||
|
|
||||||
|
*p_value = 0;
|
||||||
|
memcpy(l_data_ptr + sizeof(OPJ_UINT32) - p_nb_bytes, p_buffer, p_nb_bytes);
|
||||||
|
}
|
||||||
|
|
||||||
|
void opj_read_bytes_LE(const OPJ_BYTE * p_buffer, OPJ_UINT32 * p_value,
|
||||||
|
OPJ_UINT32 p_nb_bytes)
|
||||||
|
{
|
||||||
|
OPJ_BYTE * l_data_ptr = ((OPJ_BYTE *) p_value) + p_nb_bytes - 1;
|
||||||
|
OPJ_UINT32 i;
|
||||||
|
|
||||||
|
assert(p_nb_bytes > 0 && p_nb_bytes <= sizeof(OPJ_UINT32));
|
||||||
|
|
||||||
|
*p_value = 0;
|
||||||
|
for (i = 0; i < p_nb_bytes; ++i) {
|
||||||
|
*(l_data_ptr--) = *(p_buffer++);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void opj_write_double_BE(OPJ_BYTE * p_buffer, OPJ_FLOAT64 p_value)
|
||||||
|
{
|
||||||
|
const OPJ_BYTE * l_data_ptr = ((const OPJ_BYTE *) &p_value);
|
||||||
|
memcpy(p_buffer, l_data_ptr, sizeof(OPJ_FLOAT64));
|
||||||
|
}
|
||||||
|
|
||||||
|
void opj_write_double_LE(OPJ_BYTE * p_buffer, OPJ_FLOAT64 p_value)
|
||||||
|
{
|
||||||
|
const OPJ_BYTE * l_data_ptr = ((const OPJ_BYTE *) &p_value) + sizeof(
|
||||||
|
OPJ_FLOAT64) - 1;
|
||||||
|
OPJ_UINT32 i;
|
||||||
|
for (i = 0; i < sizeof(OPJ_FLOAT64); ++i) {
|
||||||
|
*(p_buffer++) = *(l_data_ptr--);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void opj_read_double_BE(const OPJ_BYTE * p_buffer, OPJ_FLOAT64 * p_value)
|
||||||
|
{
|
||||||
|
OPJ_BYTE * l_data_ptr = ((OPJ_BYTE *) p_value);
|
||||||
|
memcpy(l_data_ptr, p_buffer, sizeof(OPJ_FLOAT64));
|
||||||
|
}
|
||||||
|
|
||||||
|
void opj_read_double_LE(const OPJ_BYTE * p_buffer, OPJ_FLOAT64 * p_value)
|
||||||
|
{
|
||||||
|
OPJ_BYTE * l_data_ptr = ((OPJ_BYTE *) p_value) + sizeof(OPJ_FLOAT64) - 1;
|
||||||
|
OPJ_UINT32 i;
|
||||||
|
for (i = 0; i < sizeof(OPJ_FLOAT64); ++i) {
|
||||||
|
*(l_data_ptr--) = *(p_buffer++);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void opj_write_float_BE(OPJ_BYTE * p_buffer, OPJ_FLOAT32 p_value)
|
||||||
|
{
|
||||||
|
const OPJ_BYTE * l_data_ptr = ((const OPJ_BYTE *) &p_value);
|
||||||
|
memcpy(p_buffer, l_data_ptr, sizeof(OPJ_FLOAT32));
|
||||||
|
}
|
||||||
|
|
||||||
|
void opj_write_float_LE(OPJ_BYTE * p_buffer, OPJ_FLOAT32 p_value)
|
||||||
|
{
|
||||||
|
const OPJ_BYTE * l_data_ptr = ((const OPJ_BYTE *) &p_value) + sizeof(
|
||||||
|
OPJ_FLOAT32) - 1;
|
||||||
|
OPJ_UINT32 i;
|
||||||
|
for (i = 0; i < sizeof(OPJ_FLOAT32); ++i) {
|
||||||
|
*(p_buffer++) = *(l_data_ptr--);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void opj_read_float_BE(const OPJ_BYTE * p_buffer, OPJ_FLOAT32 * p_value)
|
||||||
|
{
|
||||||
|
OPJ_BYTE * l_data_ptr = ((OPJ_BYTE *) p_value);
|
||||||
|
memcpy(l_data_ptr, p_buffer, sizeof(OPJ_FLOAT32));
|
||||||
|
}
|
||||||
|
|
||||||
|
void opj_read_float_LE(const OPJ_BYTE * p_buffer, OPJ_FLOAT32 * p_value)
|
||||||
|
{
|
||||||
|
OPJ_BYTE * l_data_ptr = ((OPJ_BYTE *) p_value) + sizeof(OPJ_FLOAT32) - 1;
|
||||||
|
OPJ_UINT32 i;
|
||||||
|
for (i = 0; i < sizeof(OPJ_FLOAT32); ++i) {
|
||||||
|
*(l_data_ptr--) = *(p_buffer++);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
opj_stream_t* OPJ_CALLCONV opj_stream_create(OPJ_SIZE_T p_buffer_size,
|
||||||
|
OPJ_BOOL l_is_input)
|
||||||
|
{
|
||||||
|
opj_stream_private_t * l_stream = 00;
|
||||||
|
l_stream = (opj_stream_private_t*) opj_calloc(1, sizeof(opj_stream_private_t));
|
||||||
|
if (! l_stream) {
|
||||||
|
return 00;
|
||||||
|
}
|
||||||
|
|
||||||
|
l_stream->m_buffer_size = p_buffer_size;
|
||||||
|
l_stream->m_stored_data = (OPJ_BYTE *) opj_malloc(p_buffer_size);
|
||||||
|
if (! l_stream->m_stored_data) {
|
||||||
|
opj_free(l_stream);
|
||||||
|
return 00;
|
||||||
|
}
|
||||||
|
|
||||||
|
l_stream->m_current_data = l_stream->m_stored_data;
|
||||||
|
|
||||||
|
if (l_is_input) {
|
||||||
|
l_stream->m_status |= OPJ_STREAM_STATUS_INPUT;
|
||||||
|
l_stream->m_opj_skip = opj_stream_read_skip;
|
||||||
|
l_stream->m_opj_seek = opj_stream_read_seek;
|
||||||
|
} else {
|
||||||
|
l_stream->m_status |= OPJ_STREAM_STATUS_OUTPUT;
|
||||||
|
l_stream->m_opj_skip = opj_stream_write_skip;
|
||||||
|
l_stream->m_opj_seek = opj_stream_write_seek;
|
||||||
|
}
|
||||||
|
|
||||||
|
l_stream->m_read_fn = opj_stream_default_read;
|
||||||
|
l_stream->m_write_fn = opj_stream_default_write;
|
||||||
|
l_stream->m_skip_fn = opj_stream_default_skip;
|
||||||
|
l_stream->m_seek_fn = opj_stream_default_seek;
|
||||||
|
|
||||||
|
return (opj_stream_t *) l_stream;
|
||||||
|
}
|
||||||
|
|
||||||
|
opj_stream_t* OPJ_CALLCONV opj_stream_default_create(OPJ_BOOL l_is_input)
|
||||||
|
{
|
||||||
|
return opj_stream_create(OPJ_J2K_STREAM_CHUNK_SIZE, l_is_input);
|
||||||
|
}
|
||||||
|
|
||||||
|
void OPJ_CALLCONV opj_stream_destroy(opj_stream_t* p_stream)
|
||||||
|
{
|
||||||
|
opj_stream_private_t* l_stream = (opj_stream_private_t*) p_stream;
|
||||||
|
|
||||||
|
if (l_stream) {
|
||||||
|
if (l_stream->m_free_user_data_fn) {
|
||||||
|
l_stream->m_free_user_data_fn(l_stream->m_user_data);
|
||||||
|
}
|
||||||
|
opj_free(l_stream->m_stored_data);
|
||||||
|
l_stream->m_stored_data = 00;
|
||||||
|
opj_free(l_stream);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void OPJ_CALLCONV opj_stream_set_read_function(opj_stream_t* p_stream,
|
||||||
|
opj_stream_read_fn p_function)
|
||||||
|
{
|
||||||
|
opj_stream_private_t* l_stream = (opj_stream_private_t*) p_stream;
|
||||||
|
|
||||||
|
if ((!l_stream) || (!(l_stream->m_status & OPJ_STREAM_STATUS_INPUT))) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
l_stream->m_read_fn = p_function;
|
||||||
|
}
|
||||||
|
|
||||||
|
void OPJ_CALLCONV opj_stream_set_seek_function(opj_stream_t* p_stream,
|
||||||
|
opj_stream_seek_fn p_function)
|
||||||
|
{
|
||||||
|
opj_stream_private_t* l_stream = (opj_stream_private_t*) p_stream;
|
||||||
|
|
||||||
|
if (!l_stream) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
l_stream->m_seek_fn = p_function;
|
||||||
|
}
|
||||||
|
|
||||||
|
void OPJ_CALLCONV opj_stream_set_write_function(opj_stream_t* p_stream,
|
||||||
|
opj_stream_write_fn p_function)
|
||||||
|
{
|
||||||
|
opj_stream_private_t* l_stream = (opj_stream_private_t*) p_stream;
|
||||||
|
|
||||||
|
if ((!l_stream) || (!(l_stream->m_status & OPJ_STREAM_STATUS_OUTPUT))) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
l_stream->m_write_fn = p_function;
|
||||||
|
}
|
||||||
|
|
||||||
|
void OPJ_CALLCONV opj_stream_set_skip_function(opj_stream_t* p_stream,
|
||||||
|
opj_stream_skip_fn p_function)
|
||||||
|
{
|
||||||
|
opj_stream_private_t* l_stream = (opj_stream_private_t*) p_stream;
|
||||||
|
|
||||||
|
if (! l_stream) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
l_stream->m_skip_fn = p_function;
|
||||||
|
}
|
||||||
|
|
||||||
|
void OPJ_CALLCONV opj_stream_set_user_data(opj_stream_t* p_stream,
|
||||||
|
void * p_data, opj_stream_free_user_data_fn p_function)
|
||||||
|
{
|
||||||
|
opj_stream_private_t* l_stream = (opj_stream_private_t*) p_stream;
|
||||||
|
if (!l_stream) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
l_stream->m_user_data = p_data;
|
||||||
|
l_stream->m_free_user_data_fn = p_function;
|
||||||
|
}
|
||||||
|
|
||||||
|
void OPJ_CALLCONV opj_stream_set_user_data_length(opj_stream_t* p_stream,
|
||||||
|
OPJ_UINT64 data_length)
|
||||||
|
{
|
||||||
|
opj_stream_private_t* l_stream = (opj_stream_private_t*) p_stream;
|
||||||
|
if (!l_stream) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
l_stream->m_user_data_length = data_length;
|
||||||
|
}
|
||||||
|
|
||||||
|
OPJ_SIZE_T opj_stream_read_data(opj_stream_private_t * p_stream,
|
||||||
|
OPJ_BYTE * p_buffer, OPJ_SIZE_T p_size, opj_event_mgr_t * p_event_mgr)
|
||||||
|
{
|
||||||
|
OPJ_SIZE_T l_read_nb_bytes = 0;
|
||||||
|
if (p_stream->m_bytes_in_buffer >= p_size) {
|
||||||
|
memcpy(p_buffer, p_stream->m_current_data, p_size);
|
||||||
|
p_stream->m_current_data += p_size;
|
||||||
|
p_stream->m_bytes_in_buffer -= p_size;
|
||||||
|
l_read_nb_bytes += p_size;
|
||||||
|
p_stream->m_byte_offset += (OPJ_OFF_T)p_size;
|
||||||
|
return l_read_nb_bytes;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* we are now in the case when the remaining data if not sufficient */
|
||||||
|
if (p_stream->m_status & OPJ_STREAM_STATUS_END) {
|
||||||
|
l_read_nb_bytes += p_stream->m_bytes_in_buffer;
|
||||||
|
memcpy(p_buffer, p_stream->m_current_data, p_stream->m_bytes_in_buffer);
|
||||||
|
p_stream->m_current_data += p_stream->m_bytes_in_buffer;
|
||||||
|
p_stream->m_byte_offset += (OPJ_OFF_T)p_stream->m_bytes_in_buffer;
|
||||||
|
p_stream->m_bytes_in_buffer = 0;
|
||||||
|
return l_read_nb_bytes ? l_read_nb_bytes : (OPJ_SIZE_T) - 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* the flag is not set, we copy data and then do an actual read on the stream */
|
||||||
|
if (p_stream->m_bytes_in_buffer) {
|
||||||
|
l_read_nb_bytes += p_stream->m_bytes_in_buffer;
|
||||||
|
memcpy(p_buffer, p_stream->m_current_data, p_stream->m_bytes_in_buffer);
|
||||||
|
p_stream->m_current_data = p_stream->m_stored_data;
|
||||||
|
p_buffer += p_stream->m_bytes_in_buffer;
|
||||||
|
p_size -= p_stream->m_bytes_in_buffer;
|
||||||
|
p_stream->m_byte_offset += (OPJ_OFF_T)p_stream->m_bytes_in_buffer;
|
||||||
|
p_stream->m_bytes_in_buffer = 0;
|
||||||
|
} else {
|
||||||
|
/* case where we are already at the end of the buffer
|
||||||
|
so reset the m_current_data to point to the start of the
|
||||||
|
stored buffer to get ready to read from disk*/
|
||||||
|
p_stream->m_current_data = p_stream->m_stored_data;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (;;) {
|
||||||
|
/* we should read less than a chunk -> read a chunk */
|
||||||
|
if (p_size < p_stream->m_buffer_size) {
|
||||||
|
/* we should do an actual read on the media */
|
||||||
|
p_stream->m_bytes_in_buffer = p_stream->m_read_fn(p_stream->m_stored_data,
|
||||||
|
p_stream->m_buffer_size, p_stream->m_user_data);
|
||||||
|
|
||||||
|
if (p_stream->m_bytes_in_buffer == (OPJ_SIZE_T) - 1) {
|
||||||
|
/* end of stream */
|
||||||
|
opj_event_msg(p_event_mgr, EVT_INFO, "Stream reached its end !\n");
|
||||||
|
|
||||||
|
p_stream->m_bytes_in_buffer = 0;
|
||||||
|
p_stream->m_status |= OPJ_STREAM_STATUS_END;
|
||||||
|
/* end of stream */
|
||||||
|
return l_read_nb_bytes ? l_read_nb_bytes : (OPJ_SIZE_T) - 1;
|
||||||
|
} else if (p_stream->m_bytes_in_buffer < p_size) {
|
||||||
|
/* not enough data */
|
||||||
|
l_read_nb_bytes += p_stream->m_bytes_in_buffer;
|
||||||
|
memcpy(p_buffer, p_stream->m_current_data, p_stream->m_bytes_in_buffer);
|
||||||
|
p_stream->m_current_data = p_stream->m_stored_data;
|
||||||
|
p_buffer += p_stream->m_bytes_in_buffer;
|
||||||
|
p_size -= p_stream->m_bytes_in_buffer;
|
||||||
|
p_stream->m_byte_offset += (OPJ_OFF_T)p_stream->m_bytes_in_buffer;
|
||||||
|
p_stream->m_bytes_in_buffer = 0;
|
||||||
|
} else {
|
||||||
|
l_read_nb_bytes += p_size;
|
||||||
|
memcpy(p_buffer, p_stream->m_current_data, p_size);
|
||||||
|
p_stream->m_current_data += p_size;
|
||||||
|
p_stream->m_bytes_in_buffer -= p_size;
|
||||||
|
p_stream->m_byte_offset += (OPJ_OFF_T)p_size;
|
||||||
|
return l_read_nb_bytes;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
/* direct read on the dest buffer */
|
||||||
|
p_stream->m_bytes_in_buffer = p_stream->m_read_fn(p_buffer, p_size,
|
||||||
|
p_stream->m_user_data);
|
||||||
|
|
||||||
|
if (p_stream->m_bytes_in_buffer == (OPJ_SIZE_T) - 1) {
|
||||||
|
/* end of stream */
|
||||||
|
opj_event_msg(p_event_mgr, EVT_INFO, "Stream reached its end !\n");
|
||||||
|
|
||||||
|
p_stream->m_bytes_in_buffer = 0;
|
||||||
|
p_stream->m_status |= OPJ_STREAM_STATUS_END;
|
||||||
|
/* end of stream */
|
||||||
|
return l_read_nb_bytes ? l_read_nb_bytes : (OPJ_SIZE_T) - 1;
|
||||||
|
} else if (p_stream->m_bytes_in_buffer < p_size) {
|
||||||
|
/* not enough data */
|
||||||
|
l_read_nb_bytes += p_stream->m_bytes_in_buffer;
|
||||||
|
p_stream->m_current_data = p_stream->m_stored_data;
|
||||||
|
p_buffer += p_stream->m_bytes_in_buffer;
|
||||||
|
p_size -= p_stream->m_bytes_in_buffer;
|
||||||
|
p_stream->m_byte_offset += (OPJ_OFF_T)p_stream->m_bytes_in_buffer;
|
||||||
|
p_stream->m_bytes_in_buffer = 0;
|
||||||
|
} else {
|
||||||
|
/* we have read the exact size */
|
||||||
|
l_read_nb_bytes += p_stream->m_bytes_in_buffer;
|
||||||
|
p_stream->m_byte_offset += (OPJ_OFF_T)p_stream->m_bytes_in_buffer;
|
||||||
|
p_stream->m_current_data = p_stream->m_stored_data;
|
||||||
|
p_stream->m_bytes_in_buffer = 0;
|
||||||
|
return l_read_nb_bytes;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
OPJ_SIZE_T opj_stream_write_data(opj_stream_private_t * p_stream,
|
||||||
|
const OPJ_BYTE * p_buffer,
|
||||||
|
OPJ_SIZE_T p_size,
|
||||||
|
opj_event_mgr_t * p_event_mgr)
|
||||||
|
{
|
||||||
|
OPJ_SIZE_T l_remaining_bytes = 0;
|
||||||
|
OPJ_SIZE_T l_write_nb_bytes = 0;
|
||||||
|
|
||||||
|
if (p_stream->m_status & OPJ_STREAM_STATUS_ERROR) {
|
||||||
|
return (OPJ_SIZE_T) - 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (;;) {
|
||||||
|
l_remaining_bytes = p_stream->m_buffer_size - p_stream->m_bytes_in_buffer;
|
||||||
|
|
||||||
|
/* we have more memory than required */
|
||||||
|
if (l_remaining_bytes >= p_size) {
|
||||||
|
memcpy(p_stream->m_current_data, p_buffer, p_size);
|
||||||
|
|
||||||
|
p_stream->m_current_data += p_size;
|
||||||
|
p_stream->m_bytes_in_buffer += p_size;
|
||||||
|
l_write_nb_bytes += p_size;
|
||||||
|
p_stream->m_byte_offset += (OPJ_OFF_T)p_size;
|
||||||
|
|
||||||
|
return l_write_nb_bytes;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* we copy data and then do an actual read on the stream */
|
||||||
|
if (l_remaining_bytes) {
|
||||||
|
l_write_nb_bytes += l_remaining_bytes;
|
||||||
|
|
||||||
|
memcpy(p_stream->m_current_data, p_buffer, l_remaining_bytes);
|
||||||
|
|
||||||
|
p_stream->m_current_data = p_stream->m_stored_data;
|
||||||
|
|
||||||
|
p_buffer += l_remaining_bytes;
|
||||||
|
p_size -= l_remaining_bytes;
|
||||||
|
p_stream->m_bytes_in_buffer += l_remaining_bytes;
|
||||||
|
p_stream->m_byte_offset += (OPJ_OFF_T)l_remaining_bytes;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! opj_stream_flush(p_stream, p_event_mgr)) {
|
||||||
|
return (OPJ_SIZE_T) - 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
OPJ_BOOL opj_stream_flush(opj_stream_private_t * p_stream,
|
||||||
|
opj_event_mgr_t * p_event_mgr)
|
||||||
|
{
|
||||||
|
/* the number of bytes written on the media. */
|
||||||
|
OPJ_SIZE_T l_current_write_nb_bytes = 0;
|
||||||
|
|
||||||
|
p_stream->m_current_data = p_stream->m_stored_data;
|
||||||
|
|
||||||
|
while (p_stream->m_bytes_in_buffer) {
|
||||||
|
/* we should do an actual write on the media */
|
||||||
|
l_current_write_nb_bytes = p_stream->m_write_fn(p_stream->m_current_data,
|
||||||
|
p_stream->m_bytes_in_buffer,
|
||||||
|
p_stream->m_user_data);
|
||||||
|
|
||||||
|
if (l_current_write_nb_bytes == (OPJ_SIZE_T) - 1) {
|
||||||
|
p_stream->m_status |= OPJ_STREAM_STATUS_ERROR;
|
||||||
|
opj_event_msg(p_event_mgr, EVT_INFO, "Error on writing stream!\n");
|
||||||
|
|
||||||
|
return OPJ_FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
p_stream->m_current_data += l_current_write_nb_bytes;
|
||||||
|
p_stream->m_bytes_in_buffer -= l_current_write_nb_bytes;
|
||||||
|
}
|
||||||
|
|
||||||
|
p_stream->m_current_data = p_stream->m_stored_data;
|
||||||
|
|
||||||
|
return OPJ_TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
OPJ_OFF_T opj_stream_read_skip(opj_stream_private_t * p_stream,
|
||||||
|
OPJ_OFF_T p_size, opj_event_mgr_t * p_event_mgr)
|
||||||
|
{
|
||||||
|
OPJ_OFF_T l_skip_nb_bytes = 0;
|
||||||
|
OPJ_OFF_T l_current_skip_nb_bytes = 0;
|
||||||
|
|
||||||
|
assert(p_size >= 0);
|
||||||
|
|
||||||
|
if (p_stream->m_bytes_in_buffer >= (OPJ_SIZE_T)p_size) {
|
||||||
|
p_stream->m_current_data += p_size;
|
||||||
|
/* it is safe to cast p_size to OPJ_SIZE_T since it is <= m_bytes_in_buffer
|
||||||
|
which is of type OPJ_SIZE_T */
|
||||||
|
p_stream->m_bytes_in_buffer -= (OPJ_SIZE_T)p_size;
|
||||||
|
l_skip_nb_bytes += p_size;
|
||||||
|
p_stream->m_byte_offset += l_skip_nb_bytes;
|
||||||
|
return l_skip_nb_bytes;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* we are now in the case when the remaining data if not sufficient */
|
||||||
|
if (p_stream->m_status & OPJ_STREAM_STATUS_END) {
|
||||||
|
l_skip_nb_bytes += (OPJ_OFF_T)p_stream->m_bytes_in_buffer;
|
||||||
|
p_stream->m_current_data += p_stream->m_bytes_in_buffer;
|
||||||
|
p_stream->m_bytes_in_buffer = 0;
|
||||||
|
p_stream->m_byte_offset += l_skip_nb_bytes;
|
||||||
|
return l_skip_nb_bytes ? l_skip_nb_bytes : (OPJ_OFF_T) - 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* the flag is not set, we copy data and then do an actual skip on the stream */
|
||||||
|
if (p_stream->m_bytes_in_buffer) {
|
||||||
|
l_skip_nb_bytes += (OPJ_OFF_T)p_stream->m_bytes_in_buffer;
|
||||||
|
p_stream->m_current_data = p_stream->m_stored_data;
|
||||||
|
p_size -= (OPJ_OFF_T)p_stream->m_bytes_in_buffer;
|
||||||
|
p_stream->m_bytes_in_buffer = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
while (p_size > 0) {
|
||||||
|
/* Check if we are going beyond the end of file. Most skip_fn do not */
|
||||||
|
/* check that, but we must be careful not to advance m_byte_offset */
|
||||||
|
/* beyond m_user_data_length, otherwise */
|
||||||
|
/* opj_stream_get_number_byte_left() will assert. */
|
||||||
|
if ((OPJ_UINT64)(p_stream->m_byte_offset + l_skip_nb_bytes + p_size) >
|
||||||
|
p_stream->m_user_data_length) {
|
||||||
|
opj_event_msg(p_event_mgr, EVT_INFO, "Stream reached its end !\n");
|
||||||
|
|
||||||
|
p_stream->m_byte_offset += l_skip_nb_bytes;
|
||||||
|
l_skip_nb_bytes = (OPJ_OFF_T)(p_stream->m_user_data_length -
|
||||||
|
(OPJ_UINT64)p_stream->m_byte_offset);
|
||||||
|
|
||||||
|
opj_stream_read_seek(p_stream, (OPJ_OFF_T)p_stream->m_user_data_length,
|
||||||
|
p_event_mgr);
|
||||||
|
p_stream->m_status |= OPJ_STREAM_STATUS_END;
|
||||||
|
|
||||||
|
/* end if stream */
|
||||||
|
return l_skip_nb_bytes ? l_skip_nb_bytes : (OPJ_OFF_T) - 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* we should do an actual skip on the media */
|
||||||
|
l_current_skip_nb_bytes = p_stream->m_skip_fn(p_size, p_stream->m_user_data);
|
||||||
|
if (l_current_skip_nb_bytes == (OPJ_OFF_T) - 1) {
|
||||||
|
opj_event_msg(p_event_mgr, EVT_INFO, "Stream reached its end !\n");
|
||||||
|
|
||||||
|
p_stream->m_status |= OPJ_STREAM_STATUS_END;
|
||||||
|
p_stream->m_byte_offset += l_skip_nb_bytes;
|
||||||
|
/* end if stream */
|
||||||
|
return l_skip_nb_bytes ? l_skip_nb_bytes : (OPJ_OFF_T) - 1;
|
||||||
|
}
|
||||||
|
p_size -= l_current_skip_nb_bytes;
|
||||||
|
l_skip_nb_bytes += l_current_skip_nb_bytes;
|
||||||
|
}
|
||||||
|
|
||||||
|
p_stream->m_byte_offset += l_skip_nb_bytes;
|
||||||
|
|
||||||
|
return l_skip_nb_bytes;
|
||||||
|
}
|
||||||
|
|
||||||
|
OPJ_OFF_T opj_stream_write_skip(opj_stream_private_t * p_stream,
|
||||||
|
OPJ_OFF_T p_size, opj_event_mgr_t * p_event_mgr)
|
||||||
|
{
|
||||||
|
OPJ_BOOL l_is_written = 0;
|
||||||
|
OPJ_OFF_T l_current_skip_nb_bytes = 0;
|
||||||
|
OPJ_OFF_T l_skip_nb_bytes = 0;
|
||||||
|
|
||||||
|
if (p_stream->m_status & OPJ_STREAM_STATUS_ERROR) {
|
||||||
|
return (OPJ_OFF_T) - 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* we should flush data */
|
||||||
|
l_is_written = opj_stream_flush(p_stream, p_event_mgr);
|
||||||
|
if (! l_is_written) {
|
||||||
|
p_stream->m_status |= OPJ_STREAM_STATUS_ERROR;
|
||||||
|
p_stream->m_bytes_in_buffer = 0;
|
||||||
|
return (OPJ_OFF_T) - 1;
|
||||||
|
}
|
||||||
|
/* then skip */
|
||||||
|
|
||||||
|
while (p_size > 0) {
|
||||||
|
/* we should do an actual skip on the media */
|
||||||
|
l_current_skip_nb_bytes = p_stream->m_skip_fn(p_size, p_stream->m_user_data);
|
||||||
|
|
||||||
|
if (l_current_skip_nb_bytes == (OPJ_OFF_T) - 1) {
|
||||||
|
opj_event_msg(p_event_mgr, EVT_INFO, "Stream error!\n");
|
||||||
|
|
||||||
|
p_stream->m_status |= OPJ_STREAM_STATUS_ERROR;
|
||||||
|
p_stream->m_byte_offset += l_skip_nb_bytes;
|
||||||
|
/* end if stream */
|
||||||
|
return l_skip_nb_bytes ? l_skip_nb_bytes : (OPJ_OFF_T) - 1;
|
||||||
|
}
|
||||||
|
p_size -= l_current_skip_nb_bytes;
|
||||||
|
l_skip_nb_bytes += l_current_skip_nb_bytes;
|
||||||
|
}
|
||||||
|
|
||||||
|
p_stream->m_byte_offset += l_skip_nb_bytes;
|
||||||
|
|
||||||
|
return l_skip_nb_bytes;
|
||||||
|
}
|
||||||
|
|
||||||
|
OPJ_OFF_T opj_stream_tell(const opj_stream_private_t * p_stream)
|
||||||
|
{
|
||||||
|
return p_stream->m_byte_offset;
|
||||||
|
}
|
||||||
|
|
||||||
|
OPJ_OFF_T opj_stream_get_number_byte_left(const opj_stream_private_t * p_stream)
|
||||||
|
{
|
||||||
|
assert(p_stream->m_byte_offset >= 0);
|
||||||
|
assert(p_stream->m_user_data_length >= (OPJ_UINT64)p_stream->m_byte_offset);
|
||||||
|
return p_stream->m_user_data_length ?
|
||||||
|
(OPJ_OFF_T)(p_stream->m_user_data_length) - p_stream->m_byte_offset :
|
||||||
|
0;
|
||||||
|
}
|
||||||
|
|
||||||
|
OPJ_OFF_T opj_stream_skip(opj_stream_private_t * p_stream, OPJ_OFF_T p_size,
|
||||||
|
opj_event_mgr_t * p_event_mgr)
|
||||||
|
{
|
||||||
|
assert(p_size >= 0);
|
||||||
|
return p_stream->m_opj_skip(p_stream, p_size, p_event_mgr);
|
||||||
|
}
|
||||||
|
|
||||||
|
OPJ_BOOL opj_stream_read_seek(opj_stream_private_t * p_stream, OPJ_OFF_T p_size,
|
||||||
|
opj_event_mgr_t * p_event_mgr)
|
||||||
|
{
|
||||||
|
OPJ_ARG_NOT_USED(p_event_mgr);
|
||||||
|
p_stream->m_current_data = p_stream->m_stored_data;
|
||||||
|
p_stream->m_bytes_in_buffer = 0;
|
||||||
|
|
||||||
|
if (!(p_stream->m_seek_fn(p_size, p_stream->m_user_data))) {
|
||||||
|
p_stream->m_status |= OPJ_STREAM_STATUS_END;
|
||||||
|
return OPJ_FALSE;
|
||||||
|
} else {
|
||||||
|
/* reset stream status */
|
||||||
|
p_stream->m_status &= (~OPJ_STREAM_STATUS_END);
|
||||||
|
p_stream->m_byte_offset = p_size;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return OPJ_TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
OPJ_BOOL opj_stream_write_seek(opj_stream_private_t * p_stream,
|
||||||
|
OPJ_OFF_T p_size, opj_event_mgr_t * p_event_mgr)
|
||||||
|
{
|
||||||
|
if (! opj_stream_flush(p_stream, p_event_mgr)) {
|
||||||
|
p_stream->m_status |= OPJ_STREAM_STATUS_ERROR;
|
||||||
|
return OPJ_FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
p_stream->m_current_data = p_stream->m_stored_data;
|
||||||
|
p_stream->m_bytes_in_buffer = 0;
|
||||||
|
|
||||||
|
if (! p_stream->m_seek_fn(p_size, p_stream->m_user_data)) {
|
||||||
|
p_stream->m_status |= OPJ_STREAM_STATUS_ERROR;
|
||||||
|
return OPJ_FALSE;
|
||||||
|
} else {
|
||||||
|
p_stream->m_byte_offset = p_size;
|
||||||
|
}
|
||||||
|
|
||||||
|
return OPJ_TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
OPJ_BOOL opj_stream_seek(opj_stream_private_t * p_stream, OPJ_OFF_T p_size,
|
||||||
|
struct opj_event_mgr * p_event_mgr)
|
||||||
|
{
|
||||||
|
assert(p_size >= 0);
|
||||||
|
return p_stream->m_opj_seek(p_stream, p_size, p_event_mgr);
|
||||||
|
}
|
||||||
|
|
||||||
|
OPJ_BOOL opj_stream_has_seek(const opj_stream_private_t * p_stream)
|
||||||
|
{
|
||||||
|
return p_stream->m_seek_fn != opj_stream_default_seek;
|
||||||
|
}
|
||||||
|
|
||||||
|
OPJ_SIZE_T opj_stream_default_read(void * p_buffer, OPJ_SIZE_T p_nb_bytes,
|
||||||
|
void * p_user_data)
|
||||||
|
{
|
||||||
|
OPJ_ARG_NOT_USED(p_buffer);
|
||||||
|
OPJ_ARG_NOT_USED(p_nb_bytes);
|
||||||
|
OPJ_ARG_NOT_USED(p_user_data);
|
||||||
|
return (OPJ_SIZE_T) - 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
OPJ_SIZE_T opj_stream_default_write(void * p_buffer, OPJ_SIZE_T p_nb_bytes,
|
||||||
|
void * p_user_data)
|
||||||
|
{
|
||||||
|
OPJ_ARG_NOT_USED(p_buffer);
|
||||||
|
OPJ_ARG_NOT_USED(p_nb_bytes);
|
||||||
|
OPJ_ARG_NOT_USED(p_user_data);
|
||||||
|
return (OPJ_SIZE_T) - 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
OPJ_OFF_T opj_stream_default_skip(OPJ_OFF_T p_nb_bytes, void * p_user_data)
|
||||||
|
{
|
||||||
|
OPJ_ARG_NOT_USED(p_nb_bytes);
|
||||||
|
OPJ_ARG_NOT_USED(p_user_data);
|
||||||
|
return (OPJ_OFF_T) - 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
OPJ_BOOL opj_stream_default_seek(OPJ_OFF_T p_nb_bytes, void * p_user_data)
|
||||||
|
{
|
||||||
|
OPJ_ARG_NOT_USED(p_nb_bytes);
|
||||||
|
OPJ_ARG_NOT_USED(p_user_data);
|
||||||
|
return OPJ_FALSE;
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user